Class: HQMF1::Value
- Inherits:
-
Object
- Object
- HQMF1::Value
- Includes:
- Utilities
- Defined in:
- lib/hqmf-parser/1.0/range.rb
Overview
Represents a bound within a HQMF pauseQuantity, has a value, a unit and an inclusive/exclusive indicator
Instance Method Summary collapse
- #inclusive? ⇒ Boolean
-
#initialize(entry) ⇒ Value
constructor
A new instance of Value.
- #to_json ⇒ Object
- #unit ⇒ Object
- #value ⇒ 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) ⇒ Value
Returns a new instance of Value.
7 8 9 |
# File 'lib/hqmf-parser/1.0/range.rb', line 7 def initialize(entry) @entry = entry end |
Instance Method Details
#inclusive? ⇒ Boolean
19 20 21 22 23 24 25 26 |
# File 'lib/hqmf-parser/1.0/range.rb', line 19 def inclusive? case attr_val('./@inclusive') when 'true' true else false end end |
#to_json ⇒ Object
28 29 30 |
# File 'lib/hqmf-parser/1.0/range.rb', line 28 def to_json build_hash(self, [:value,:unit,:inclusive?]) end |
#unit ⇒ Object
15 16 17 |
# File 'lib/hqmf-parser/1.0/range.rb', line 15 def unit attr_val('./@unit') end |
#value ⇒ Object
11 12 13 |
# File 'lib/hqmf-parser/1.0/range.rb', line 11 def value attr_val('./@value') end |