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
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_percentage ⇒ Object Also known as: percent
183 184 185 |
# File 'lib/percentage.rb', line 183 def to_percentage Percentage(self) end |