Class: Integer

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

Instance Method Summary collapse

Instance Method Details

#as_percentage_of(n) ⇒ Object



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

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

#percent_of(n) ⇒ Object



180
181
182
# File 'lib/percentage.rb', line 180

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

#to_percentageObject Also known as: percent



174
175
176
# File 'lib/percentage.rb', line 174

def to_percentage
  Percentage(self)
end