class HQMF::Collection

Attributes

type[RW]
values[RW]

Public Class Methods

from_json(json) click to toggle source
# File lib/hqmf-model/types.rb, line 437
def self.from_json(json)
  json = json.with_indifferent_access
  values = []
  type = json['type']
  json['values'].each { |value| values.push(HQMF::DataCriteria.convert_value(value))}
  HQMF::Collection.new(type, values)
end
new(type, values) click to toggle source
# File lib/hqmf-model/types.rb, line 432
def initialize(type, values)
  @type = type || 'COL'
  @values = values || []
end

Public Instance Methods

==(other) click to toggle source
# File lib/hqmf-model/types.rb, line 452
def ==(other)
  check_equality(self,other)
end
to_json() click to toggle source
# File lib/hqmf-model/types.rb, line 445
def to_json
  json = build_hash(self, [:type])
  json[:values] = []
  @values.each {|value| json[:values] << value.to_json  }
  json    
end