Class: DTest::Block
- Inherits:
-
Object
- Object
- DTest::Block
- Defined in:
- lib/dtest/core.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parameter ⇒ Object
Returns the value of attribute parameter.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#result ⇒ Object
Returns the value of attribute result.
Instance Method Summary collapse
- #call(context, name = nil) ⇒ Object
-
#initialize(name, option, &block) ⇒ Block
constructor
A new instance of Block.
Constructor Details
#initialize(name, option, &block) ⇒ Block
Returns a new instance of Block.
240 241 242 243 244 245 246 247 |
# File 'lib/dtest/core.rb', line 240 def initialize(name, option, &block) @name = name @parent = nil @option = option @block = block @result = nil # caller result object @parameter = nil end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
237 238 239 |
# File 'lib/dtest/core.rb', line 237 def name @name end |
#parameter ⇒ Object
Returns the value of attribute parameter.
238 239 240 |
# File 'lib/dtest/core.rb', line 238 def parameter @parameter end |
#parent ⇒ Object
Returns the value of attribute parent.
238 239 240 |
# File 'lib/dtest/core.rb', line 238 def parent @parent end |
#result ⇒ Object
Returns the value of attribute result.
238 239 240 |
# File 'lib/dtest/core.rb', line 238 def result @result end |
Instance Method Details
#call(context, name = nil) ⇒ Object
249 250 251 252 253 254 255 256 257 258 |
# File 'lib/dtest/core.rb', line 249 def call(context, name = nil) @parent = name if name context.call({ :parent => @parent, :name => @name, :option => @option, :result => @result, :parameter => @parameter, }, @block) end |