Class: Ostructer::OsArray

Inherits:
OsBase show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/ostructer.rb

Instance Attribute Summary

Attributes inherited from OsBase

#field, #logger, #parent

Instance Method Summary collapse

Methods inherited from OsBase

#full_dot_path

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_pass2Object



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