Class: HQMF::TypedReference
- Inherits:
-
Object
- Object
- HQMF::TypedReference
- Includes:
- Conversion::Utilities
- Defined in:
- lib/hqmf-model/types.rb
Overview
Represents a HQMF reference from a precondition to a data criteria
Instance Attribute Summary collapse
-
#mood ⇒ Object
Returns the value of attribute mood.
-
#reference ⇒ Object
Returns the value of attribute reference.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(reference, type, mood = nil) ⇒ TypedReference
constructor
Create a new HQMF::Reference.
- #to_json ⇒ Object
Methods included from Conversion::Utilities
#build_hash, #check_equality, #json_array, #openstruct_to_json
Constructor Details
#initialize(reference, type, mood = nil) ⇒ TypedReference
Create a new HQMF::Reference
311 312 313 314 315 |
# File 'lib/hqmf-model/types.rb', line 311 def initialize(reference,type,mood=nil) @reference = reference @type = type @mood = mood end |
Instance Attribute Details
#mood ⇒ Object
Returns the value of attribute mood.
307 308 309 |
# File 'lib/hqmf-model/types.rb', line 307 def mood @mood end |
#reference ⇒ Object
Returns the value of attribute reference.
307 308 309 |
# File 'lib/hqmf-model/types.rb', line 307 def reference @reference end |
#type ⇒ Object
Returns the value of attribute type.
307 308 309 |
# File 'lib/hqmf-model/types.rb', line 307 def type @type end |
Class Method Details
.from_json(json) ⇒ Object
317 318 319 320 321 322 |
# File 'lib/hqmf-model/types.rb', line 317 def self.from_json(json) type = json["type"] reference = json["reference"] mood = json["mood"] new(reference,type,mood) end |
Instance Method Details
#==(other) ⇒ Object
328 329 330 |
# File 'lib/hqmf-model/types.rb', line 328 def ==(other) check_equality(self,other) end |
#to_json ⇒ Object
324 325 326 |
# File 'lib/hqmf-model/types.rb', line 324 def to_json build_hash(self, [:type, :reference,:mood]) end |