Class: XMLStruct::CollectionProxy
- Inherits:
-
BlankishSlate
- Object
- BlankishSlate
- XMLStruct::CollectionProxy
- Defined in:
- lib/xml_struct/collection_proxy.rb
Instance Method Summary collapse
-
#initialize(target) ⇒ CollectionProxy
constructor
A new instance of CollectionProxy.
-
#method_missing(m, *a, &b) ⇒ Object
:nodoc:.
Constructor Details
#initialize(target) ⇒ CollectionProxy
Returns a new instance of CollectionProxy.
2 3 4 |
# File 'lib/xml_struct/collection_proxy.rb', line 2 def initialize(target) @__children, @__attributes, @__target = {}, {}, target end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *a, &b) ⇒ Object
:nodoc:
6 7 8 9 |
# File 'lib/xml_struct/collection_proxy.rb', line 6 def method_missing(m, *a, &b) # :nodoc: answer = __question_answer(m, *a, &b) answer.nil? ? (@__target.__send__(m, *a, &b) if @__target) : answer end |