Class: Catlogic::Quantity

Inherits:
Object
  • Object
show all
Defined in:
lib/catlogic/quantity.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#labelObject (readonly)

Returns the value of attribute label.



3
4
5
# File 'lib/catlogic/quantity.rb', line 3

def label
  @label
end

Instance Method Details

#oppositeObject



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_quantityObject



17
18
19
# File 'lib/catlogic/quantity.rb', line 17

def to_quantity
  self
end