Class: Brock::FieldTemplateContext

Inherits:
Object
  • Object
show all
Defined in:
lib/brock/field_template_context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#valueObject (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

#bindingObject



11
12
13
# File 'lib/brock/field_template_context.rb', line 11

def binding
  super
end