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, #check_nil_conjunction_on_child, #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.
45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/hqmf-parser/1.0/range.rb', line 45 def initialize(entry) @entry = entry if @entry @low = optional_value('./cda:low') @high = optional_value('./cda:high') if (@low == nil && @high == nil) @low = optional_value('.',true) @high = optional_value('.',true) end end end |
Instance Attribute Details
#high ⇒ Object (readonly)
Returns the value of attribute high.
43 44 45 |
# File 'lib/hqmf-parser/1.0/range.rb', line 43 def high @high end |
#low ⇒ Object (readonly)
Returns the value of attribute low.
43 44 45 |
# File 'lib/hqmf-parser/1.0/range.rb', line 43 def low @low end |
Instance Method Details
#to_json ⇒ Object
57 58 59 60 61 62 |
# File 'lib/hqmf-parser/1.0/range.rb', line 57 def to_json json = {} json[:low] = self.low.to_json if self.low json[:high] = self.high.to_json if self.high json end |