class HQMF::TemporalReference

Constants

INVERSION
TYPES

Attributes

range[R]
reference[R]
type[R]

Public Class Methods

from_json(json) click to toggle source
# File lib/hqmf-model/types.rb, line 241
def self.from_json(json)
  type = json["type"] if json["type"]
  reference = HQMF::Reference.new(json["reference"]) if json["reference"]
  range = HQMF::Range.from_json(json["range"]) if json["range"]
  
  HQMF::TemporalReference.new(type,reference,range)
end
new(type, reference, range) click to toggle source

@param [String] type @param [Reference] reference @param [Range] range

# File lib/hqmf-model/types.rb, line 231
def initialize(type, reference, range)
  @type = type
  @reference = reference
  if (range.is_a? HQMF::Value)
    @range = HQMF::Range.new('IVL_PQ', range, range, nil)
  else
    @range = range
  end
end

Public Instance Methods

==(other) click to toggle source
# File lib/hqmf-model/types.rb, line 257
def ==(other)
  check_equality(self,other)
end
to_json() click to toggle source
# File lib/hqmf-model/types.rb, line 250
def to_json
  json = build_hash(self, [:type])
  json[:reference] = @reference.to_json if @reference
  json[:range] = @range.to_json if @range
  json
end