Class: VORuby::VOTable::V1_1::Max
- Inherits:
-
Base
- Object
- XML::Object::Base
- Base
- VORuby::VOTable::V1_1::Max
- Defined in:
- lib/voruby/votable/1.1/votable.rb
Overview
The maximum value a column may take on.
Constant Summary collapse
- ELEMENT_NAME =
'MAX'
Instance Attribute Summary
Attributes inherited from XML::Object::Base
Instance Method Summary collapse
- #inclusive ⇒ Object
-
#inclusive=(i) ⇒ Object
Set whether the maximum value is inclusive or not.
-
#inclusive? ⇒ Boolean
Check whether the maximum value is inclusive or not.
-
#initialize(defn = nil) ⇒ Max
constructor
Create a new maximum value for a column.
- #value ⇒ Object
- #value=(v) ⇒ Object
Methods inherited from Base
#==, element_name, #get_element, #xpath_for
Methods inherited from XML::Object::Base
#==, element_name, from_file, #to_s
Constructor Details
Instance Method Details
#inclusive ⇒ Object
1431 1432 1433 |
# File 'lib/voruby/votable/1.1/votable.rb', line 1431 def inclusive self.node['inclusive'] end |
#inclusive=(i) ⇒ Object
Set whether the maximum value is inclusive or not. Takes a boolean value or a yes/no string.
max.inclusive = false # or...
max.inclusive = 'no'
1445 1446 1447 1448 1449 1450 1451 1452 1453 |
# File 'lib/voruby/votable/1.1/votable.rb', line 1445 def inclusive=(i) if i.is_a?(TrueClass) @node['inclusive'] = 'yes' elsif i.is_a?(FalseClass) @node['inclusive'] = 'no' else @node['inclusive'] = i.to_s end end |
#inclusive? ⇒ Boolean
Check whether the maximum value is inclusive or not. By default, the maximum is inclusive.
1437 1438 1439 |
# File 'lib/voruby/votable/1.1/votable.rb', line 1437 def inclusive? self.node['inclusive'] == 'yes' end |
#value ⇒ Object
1423 1424 1425 |
# File 'lib/voruby/votable/1.1/votable.rb', line 1423 def value self.node['value'] end |
#value=(v) ⇒ Object
1427 1428 1429 |
# File 'lib/voruby/votable/1.1/votable.rb', line 1427 def value=(v) @node['value'] = v.to_s end |