Class: HQMF1::Range
- Inherits:
-
Object
- Object
- HQMF1::Range
- Includes:
- Utilities
- Defined in:
- lib/hqmf-parser/1.0/range.rb
Overview
Represents a HQMF pauseQuantity which can have low and high bounds
Instance Attribute Summary collapse
-
#high ⇒ Object
readonly
Returns the value of attribute high.
-
#low ⇒ Object
readonly
Returns the value of attribute low.
Instance Method Summary collapse
-
#initialize(entry) ⇒ Range
constructor
A new instance of Range.
- #to_json ⇒ Object
Methods included from Utilities
#attr_val, #clean_json, #clean_json_recursive
Methods included from HQMF::Conversion::Utilities
#build_hash, #check_equality, #json_array, #openstruct_to_json
Constructor Details
#initialize(entry) ⇒ Range
Returns a new instance of Range.
38 39 40 41 42 43 44 |
# File 'lib/hqmf-parser/1.0/range.rb', line 38 def initialize(entry) @entry = entry if @entry @low = optional_value('./cda:low') @high = optional_value('./cda:high') end end |
Instance Attribute Details
#high ⇒ Object (readonly)
Returns the value of attribute high.
36 37 38 |
# File 'lib/hqmf-parser/1.0/range.rb', line 36 def high @high end |
#low ⇒ Object (readonly)
Returns the value of attribute low.
36 37 38 |
# File 'lib/hqmf-parser/1.0/range.rb', line 36 def low @low end |
Instance Method Details
#to_json ⇒ Object
46 47 48 49 50 51 |
# File 'lib/hqmf-parser/1.0/range.rb', line 46 def to_json json = {} json[:low] = self.low.to_json if self.low json[:high] = self.high.to_json if self.high json end |