Module: Visor::Common::Extensions::Array

Defined in:
lib/common/extensions/array.rb

Overview

Extending Array class

Instance Method Summary collapse

Instance Method Details

#to_openstructArray

Convert each array element to an OpenStruct. Used for Hash.to_openstruct

Returns:

  • (Array)

    The array with elements converted to OpenStruct.



18
19
20
# File 'lib/common/extensions/array.rb', line 18

def to_openstruct
  map { |el| el.to_openstruct }
end