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



77
78
79
80
81
# File 'lib/deepstruct.rb', line 77

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

#sizeObject Also known as: length



83
84
85
# File 'lib/deepstruct.rb', line 83

def size
  @value.size
end