Class: HQMF::ED

Inherits:
Object
  • Object
show all
Includes:
Conversion::Utilities
Defined in:
lib/hqmf-model/types.rb

Overview

What does ED stand for? ED has a lot more elements / attributes to represent, but only caring about what I see used…

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Conversion::Utilities

#build_hash, #check_equality, #json_array, #openstruct_to_json

Constructor Details

#initialize(type, value, media_type) ⇒ ED

Returns a new instance of ED.



385
386
387
388
389
# File 'lib/hqmf-model/types.rb', line 385

def initialize(type, value, media_type)
  @type = type || 'ED'
  @value = value
  @media_type = media_type
end

Instance Attribute Details

#media_typeObject

Returns the value of attribute media_type.



383
384
385
# File 'lib/hqmf-model/types.rb', line 383

def media_type
  @media_type
end

#typeObject

Returns the value of attribute type.



383
384
385
# File 'lib/hqmf-model/types.rb', line 383

def type
  @type
end

#valueObject

Returns the value of attribute value.



383
384
385
# File 'lib/hqmf-model/types.rb', line 383

def value
  @value
end

Class Method Details

.from_json(json) ⇒ Object



391
392
393
394
# File 'lib/hqmf-model/types.rb', line 391

def self.from_json(json)
  json = json.with_indifferent_access
  HQMF::ED.new(json['type'], json['value'], json['media_type'])
end

Instance Method Details

#==(other) ⇒ Object



400
401
402
# File 'lib/hqmf-model/types.rb', line 400

def ==(other)
  check_equality(self,other)
end

#to_jsonObject



396
397
398
# File 'lib/hqmf-model/types.rb', line 396

def to_json
  build_hash(self, [:type, :value, :media_type])
end