class HQMF::Ratio

Attributes

denominator[RW]
numerator[RW]
type[RW]

Public Class Methods

from_json(json) click to toggle source
# File lib/hqmf-model/types.rb, line 470
def self.from_json(json)
  type = json["type"] if json["type"]
  numerator = json["numerator"] if json["numerator"]
  denominator = json["denominator"] if json["denominator"]
  HQMF::Ratio.new(type, numerator, denominator)
end
new(type, numerator, denominator) click to toggle source

@param [String] type @param [Value] numerator @param [Value] denominator

# File lib/hqmf-model/types.rb, line 464
def initialize(type, numerator, denominator)
  @type = type || 'RT'
  @numerator = numerator
  @denominator = denominator
end

Public Instance Methods

==(other) click to toggle source
# File lib/hqmf-model/types.rb, line 489
def ==(other)
  check_equality(self, other)
end
denominator?() click to toggle source
# File lib/hqmf-model/types.rb, line 481
def denominator?
  @denominator
end
numerator?() click to toggle source
# File lib/hqmf-model/types.rb, line 477
def numerator?
  @numerator
end
to_json() click to toggle source
# File lib/hqmf-model/types.rb, line 485
def to_json
  build_hash(self, [:type, :numerator, :denominator])
end