class Vizkit::CallbackSpec::UnboundBlockAdapter
Callback adapter for code blocks not tied to any object
Public Class Methods
new(block)
click to toggle source
# File lib/vizkit/plugin.rb, line 238 def initialize(block) @block = block end
Public Instance Methods
bind(object)
click to toggle source
Binds the code block to an object and returns a new BlockAdapter. The UnboundBlockAdapter is not modified.
@param [Object] object the object @return [BlockAdapter]
# File lib/vizkit/plugin.rb, line 247 def bind(object) BlockAdapter.new(@block, object) end
block_name()
click to toggle source
Name of the code block which is used for pretty_print of the PluginSpec @return [Symbol] the name
# File lib/vizkit/plugin.rb, line 262 def block_name :CodeBlock end
call(*args, &block)
click to toggle source
# File lib/vizkit/plugin.rb, line 251 def call(*args, &block) if block args << block end @block.call(*args) end