Class: Ostructer::OsArray
- Extended by:
- Forwardable
- Includes:
- Enumerable
- Defined in:
- lib/ostructer.rb
Instance Attribute Summary
Attributes inherited from OsBase
Instance Method Summary collapse
-
#initialize(ary, logger) ⇒ OsArray
constructor
A new instance of OsArray.
- #to_openstruct_pass2 ⇒ Object
Methods inherited from OsBase
Constructor Details
#initialize(ary, logger) ⇒ OsArray
Returns a new instance of OsArray.
112 113 114 115 116 117 118 |
# File 'lib/ostructer.rb', line 112 def initialize( ary, logger ) @ary = ary @logger = logger @parent = nil @field = "[!unknown_array]" end |
Instance Method Details
#to_openstruct_pass2 ⇒ Object
120 121 122 123 124 125 126 127 128 |
# File 'lib/ostructer.rb', line 120 def to_openstruct_pass2 self.each_with_index do | el, index | if el.is_a?( OsOpenStruct ) || el.is_a?( OsArray ) || el.is_a?( OsValue ) el.field = "[#{index}]" el.parent = self end el.to_openstruct_pass2 end end |