Class: DeepStruct::ArrayWrapper

Inherits:
DeepWrapper show all
Includes:
Enumerable
Defined in:
lib/deepstruct.rb

Instance Method Summary collapse

Methods inherited from DeepWrapper

#[], #[]=, #initialize, #inspect, #to_json, #unwrap

Constructor Details

This class inherits a constructor from DeepStruct::DeepWrapper

Instance Method Details

#eachObject



85
86
87
88
89
# File 'lib/deepstruct.rb', line 85

def each
  block_given? or return enum_for(__method__)
  @value.each { |o| yield(DeepStruct.wrap(o)) }
  self
end

#sizeObject Also known as: length



91
92
93
# File 'lib/deepstruct.rb', line 91

def size
  @value.size
end