Class: Integer

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

Instance Method Summary collapse

Instance Method Details

#as_percentage_of(n) ⇒ Object



193
194
195
# File 'lib/percentage.rb', line 193

def as_percentage_of(n)
  Percentage.new(Rational(self, n))
end

#percent_of(n) ⇒ Object



189
190
191
# File 'lib/percentage.rb', line 189

def percent_of(n)
  n * Percentage(self)
end

#to_percentageObject Also known as: percent



183
184
185
# File 'lib/percentage.rb', line 183

def to_percentage
  Percentage(self)
end