Class: HQMF::TypedReference

Inherits:
Object
  • Object
show all
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

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(reference, type, mood = nil) ⇒ TypedReference

Create a new HQMF::Reference

Parameters:



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

#moodObject

Returns the value of attribute mood.



307
308
309
# File 'lib/hqmf-model/types.rb', line 307

def mood
  @mood
end

#referenceObject

Returns the value of attribute reference.



307
308
309
# File 'lib/hqmf-model/types.rb', line 307

def reference
  @reference
end

#typeObject

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_jsonObject



324
325
326
# File 'lib/hqmf-model/types.rb', line 324

def to_json
  build_hash(self, [:type, :reference,:mood])
end