Class: Canpe::TemplateBindingContainer
- Inherits:
-
Object
- Object
- Canpe::TemplateBindingContainer
- Defined in:
- lib/canpe/template_binding_container.rb
Instance Attribute Summary collapse
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
Instance Method Summary collapse
- #[](name) ⇒ Object
-
#initialize(hash) ⇒ TemplateBindingContainer
constructor
A new instance of TemplateBindingContainer.
Constructor Details
#initialize(hash) ⇒ TemplateBindingContainer
Returns a new instance of TemplateBindingContainer.
7 8 9 |
# File 'lib/canpe/template_binding_container.rb', line 7 def initialize(hash) @hash = hash end |
Instance Attribute Details
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
5 6 7 |
# File 'lib/canpe/template_binding_container.rb', line 5 def hash @hash end |
Instance Method Details
#[](name) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/canpe/template_binding_container.rb', line 11 def [](name) if hash.key? name hash[name] else TemplateBindingReflector.new([{method: name, args: []}]) end end |