Class: Enumeration
- Inherits:
-
Object
- Object
- Enumeration
- Defined in:
- lib/voruby/misc.rb,
lib/misc/misc.rb
Overview
An abstract class that represents a set of possible choices.
Direct Known Subclasses
VORuby::ADQL::V1_0::AggregateFunctionName, VORuby::ADQL::V1_0::AllOrDistinct, VORuby::ADQL::V1_0::BinaryOperator, VORuby::ADQL::V1_0::Comparison, VORuby::ADQL::V1_0::JointTableQualifier, VORuby::ADQL::V1_0::MathFunctionName, VORuby::ADQL::V1_0::OrderDirection, VORuby::ADQL::V1_0::TrigonometricFunctionName, VORuby::ADQL::V1_0::UnaryOperator, VORuby::STC::V1_10::Coords::TimeOrigin, VORuby::STC::V1_10::Coords::TimeScale, VORuby::STC::V1_10::Coords::Unit, VORuby::STC::V1_10::STC::DopplerDefinition, VORuby::STC::V1_10::STC::PlanetaryEphem, VORuby::STC::V1_30::DopplerDefinitionType, VORuby::STC::V1_30::PlanetaryEphemType, VORuby::STC::V1_30::PosAngleReferenceType, VORuby::STC::V1_30::ProjectionType, VORuby::STC::V1_30::RelocatableOriginType, VORuby::STC::V1_30::TimeScaleType, VORuby::STC::V1_30::UnitType, VORuby::STC::V1_30::ValueType, VORuby::VOEvent::V1_1::Cite, VORuby::XLink::V1_2::Actuate, VORuby::XLink::V1_2::Show, VORuby::XLink::V1_2::Type
Instance Attribute Summary collapse
-
#choices ⇒ Object
readonly
Returns the value of attribute choices.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
- #==(v) ⇒ Object
-
#initialize(v) ⇒ Enumeration
constructor
A new instance of Enumeration.
- #to_s ⇒ Object
Constructor Details
#initialize(v) ⇒ Enumeration
Returns a new instance of Enumeration.
29 30 31 32 |
# File 'lib/misc/misc.rb', line 29 def initialize(choices, value) @choices = choices self.value = value end |
Instance Attribute Details
#choices ⇒ Object (readonly)
Returns the value of attribute choices.
27 28 29 |
# File 'lib/misc/misc.rb', line 27 def choices @choices end |
#value ⇒ Object
Returns the value of attribute value.
27 28 29 |
# File 'lib/misc/misc.rb', line 27 def value @value end |
Class Method Details
.choices ⇒ Object
100 |
# File 'lib/voruby/misc.rb', line 100 def self.choices; nil end |
Instance Method Details
#==(v) ⇒ Object
39 40 41 42 |
# File 'lib/misc/misc.rb', line 39 def ==(obj) return false if !obj.is_a?(self.class) self.value == obj.value end |
#to_s ⇒ Object
116 117 118 |
# File 'lib/voruby/misc.rb', line 116 def to_s self.value.to_s end |