Class: Elibri::ONIX::Release_3_0::Extent
- Inherits:
-
Object
- Object
- Elibri::ONIX::Release_3_0::Extent
- Defined in:
- lib/elibri_onix/onix_3_0/extent.rb
Instance Attribute Summary collapse
-
#to_xml ⇒ Object
Returns the value of attribute to_xml.
-
#type ⇒ Object
Returns the value of attribute type.
-
#unit ⇒ Object
Returns the value of attribute unit.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(data) ⇒ Extent
constructor
A new instance of Extent.
- #inspect_include_fields ⇒ Object
- #type_name ⇒ Object
- #unit_name ⇒ Object
Constructor Details
#initialize(data) ⇒ Extent
Returns a new instance of Extent.
8 9 10 11 12 13 |
# File 'lib/elibri_onix/onix_3_0/extent.rb', line 8 def initialize(data) @to_xml = data.to_s @type = data.css('ExtentType')&.text&.strip @value = data.css('ExtentValue')&.text&.strip&.to_i @unit = data.css('ExtentUnit')&.text&.strip end |
Instance Attribute Details
#to_xml ⇒ Object
Returns the value of attribute to_xml.
6 7 8 |
# File 'lib/elibri_onix/onix_3_0/extent.rb', line 6 def to_xml @to_xml end |
#type ⇒ Object
Returns the value of attribute type.
6 7 8 |
# File 'lib/elibri_onix/onix_3_0/extent.rb', line 6 def type @type end |
#unit ⇒ Object
Returns the value of attribute unit.
6 7 8 |
# File 'lib/elibri_onix/onix_3_0/extent.rb', line 6 def unit @unit end |
#value ⇒ Object
Returns the value of attribute value.
6 7 8 |
# File 'lib/elibri_onix/onix_3_0/extent.rb', line 6 def value @value end |
Instance Method Details
#inspect_include_fields ⇒ Object
23 24 25 |
# File 'lib/elibri_onix/onix_3_0/extent.rb', line 23 def inspect_include_fields [:type_name, :unit_name] end |