module NetSuite module Records class MatrixOptionList # Deals with both hash and arrays of attributes[:matrix_option_list] # # Hash: # # # # # # # # Array: # # # # # # # # # # def initialize(attributes = {}) case attributes[:matrix_option] when Hash options << OpenStruct.new( type_id: attributes[:matrix_option][:value][:'@type_id'], value_id: attributes[:matrix_option][:value][:'@internal_id'] ) when Array attributes[:matrix_option].each do |option| options << OpenStruct.new( type_id: option[:value][:'@type_id'], value_id: option[:value][:'@internal_id'] ) end end end def options @options ||= [] end end end end