Class: Integer
- Inherits:
-
Object
- Object
- Integer
- Defined in:
- lib/percentage.rb
Instance Method Summary collapse
- #as_percentage_of(n) ⇒ Object
- #percent_of(n) ⇒ Object
- #to_percentage ⇒ Object (also: #percent)
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_percentage ⇒ Object Also known as: percent
174 175 176 |
# File 'lib/percentage.rb', line 174 def to_percentage Percentage(self) end |