Class: XmlDsl::InstanceWrapper
- Inherits:
-
Object
- Object
- XmlDsl::InstanceWrapper
- Defined in:
- lib/xml_dsl/block_method.rb
Instance Attribute Summary collapse
-
#instance ⇒ Object
Returns the value of attribute instance.
Instance Method Summary collapse
-
#initialize(instance) ⇒ InstanceWrapper
constructor
A new instance of InstanceWrapper.
- #set(key, value) ⇒ Object
Constructor Details
#initialize(instance) ⇒ InstanceWrapper
Returns a new instance of InstanceWrapper.
62 63 64 |
# File 'lib/xml_dsl/block_method.rb', line 62 def initialize(instance) self.instance = instance end |
Instance Attribute Details
#instance ⇒ Object
Returns the value of attribute instance.
60 61 62 |
# File 'lib/xml_dsl/block_method.rb', line 60 def instance @instance end |
Instance Method Details
#set(key, value) ⇒ Object
66 67 68 69 70 71 72 |
# File 'lib/xml_dsl/block_method.rb', line 66 def set(key, value) if instance.is_a? Hash instance[key] = value else instance.send "#{key}=", value end end |