Class: Fuelator::Parameters::Pair
- Inherits:
-
Object
- Object
- Fuelator::Parameters::Pair
- Includes:
- Validator
- Defined in:
- lib/fuelator/parameters/pair.rb
Constant Summary collapse
- DIRECTIVES =
[:launch, :land]
Instance Attribute Summary collapse
-
#directive ⇒ Object
readonly
Returns the value of attribute directive.
-
#gravity ⇒ Object
readonly
Returns the value of attribute gravity.
Instance Method Summary collapse
-
#initialize(pair) ⇒ Pair
constructor
A new instance of Pair.
- #valid_directive? ⇒ Boolean
- #valid_gravity? ⇒ Boolean
Methods included from Validator
Constructor Details
#initialize(pair) ⇒ Pair
Returns a new instance of Pair.
9 10 11 12 |
# File 'lib/fuelator/parameters/pair.rb', line 9 def initialize(pair) @directive = pair[0] @gravity = pair[1] end |
Instance Attribute Details
#directive ⇒ Object (readonly)
Returns the value of attribute directive.
7 8 9 |
# File 'lib/fuelator/parameters/pair.rb', line 7 def directive @directive end |
#gravity ⇒ Object (readonly)
Returns the value of attribute gravity.
7 8 9 |
# File 'lib/fuelator/parameters/pair.rb', line 7 def gravity @gravity end |
Instance Method Details
#valid_directive? ⇒ Boolean
14 15 16 |
# File 'lib/fuelator/parameters/pair.rb', line 14 def valid_directive? directive.is_a?(Symbol) && DIRECTIVES.include?(directive) end |
#valid_gravity? ⇒ Boolean
18 19 20 |
# File 'lib/fuelator/parameters/pair.rb', line 18 def valid_gravity? gravity.is_a?(Numeric) end |