Class: Brock::FieldTemplateContext
- Inherits:
-
Object
- Object
- Brock::FieldTemplateContext
- Defined in:
- lib/brock/field_template_context.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #binding ⇒ Object
-
#initialize(field, value) ⇒ FieldTemplateContext
constructor
A new instance of FieldTemplateContext.
- #method_missing(method, *args, &blk) ⇒ Object
Constructor Details
#initialize(field, value) ⇒ FieldTemplateContext
Returns a new instance of FieldTemplateContext.
6 7 8 9 |
# File 'lib/brock/field_template_context.rb', line 6 def initialize(field, value) @field = field @value = value end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &blk) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/brock/field_template_context.rb', line 15 def method_missing(method, *args, &blk) if @field and @field.respond_to?(method) @field.send(method, *args, &blk) else super(*args, &blk) end end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
4 5 6 |
# File 'lib/brock/field_template_context.rb', line 4 def value @value end |
Instance Method Details
#binding ⇒ Object
11 12 13 |
# File 'lib/brock/field_template_context.rb', line 11 def binding super end |