Class: Catlogic::Quantity
- Inherits:
-
Object
- Object
- Catlogic::Quantity
- Defined in:
- lib/catlogic/quantity.rb
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
Instance Method Summary collapse
-
#initialize(quantity) ⇒ Quantity
constructor
A new instance of Quantity.
- #opposite ⇒ Object
- #to_quantity ⇒ Object
Constructor Details
#initialize(quantity) ⇒ Quantity
Returns a new instance of Quantity.
5 6 7 |
# File 'lib/catlogic/quantity.rb', line 5 def initialize(quantity) @label = quantity end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
3 4 5 |
# File 'lib/catlogic/quantity.rb', line 3 def label @label end |
Instance Method Details
#opposite ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/catlogic/quantity.rb', line 9 def opposite if self.label == 'universal' quantityopposite = Quantity.new('particular') elsif self.label == 'particular' quantityopposite = Quantity.new('universal') end return quantityopposite end |
#to_quantity ⇒ Object
17 18 19 |
# File 'lib/catlogic/quantity.rb', line 17 def to_quantity self end |