Class: HQMF::GenericValueContainer
- Inherits:
-
Object
- Object
- HQMF::GenericValueContainer
- Includes:
- Conversion::Utilities
- Defined in:
- lib/hqmf-model/types.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(type, value) ⇒ GenericValueContainer
constructor
A new instance of GenericValueContainer.
- #to_json ⇒ Object
Methods included from Conversion::Utilities
#build_hash, #check_equality, #json_array, #openstruct_to_json
Constructor Details
#initialize(type, value) ⇒ GenericValueContainer
Returns a new instance of GenericValueContainer.
409 410 411 412 |
# File 'lib/hqmf-model/types.rb', line 409 def initialize(type, value) @type = type @value = value end |
Instance Attribute Details
#type ⇒ Object
Returns the value of attribute type.
407 408 409 |
# File 'lib/hqmf-model/types.rb', line 407 def type @type end |
#value ⇒ Object
Returns the value of attribute value.
407 408 409 |
# File 'lib/hqmf-model/types.rb', line 407 def value @value end |
Class Method Details
.from_json(json) ⇒ Object
414 415 416 417 |
# File 'lib/hqmf-model/types.rb', line 414 def self.from_json(json) json = json.with_indifferent_access HQMF::GenericValueContainer.new(json['type'], json['value']) end |
Instance Method Details
#==(other) ⇒ Object
423 424 425 |
# File 'lib/hqmf-model/types.rb', line 423 def ==(other) check_equality(self,other) end |
#to_json ⇒ Object
419 420 421 |
# File 'lib/hqmf-model/types.rb', line 419 def to_json build_hash(self, [:type, :value]) end |