Class: BigDecimal
- Inherits:
-
Object
- Object
- BigDecimal
- Defined in:
- lib/percentage.rb
Instance Method Summary collapse
Instance Method Details
#as_percentage_of(n) ⇒ Object
168 169 170 |
# File 'lib/percentage.rb', line 168 def as_percentage_of(n) Percentage.new(self / n) end |
#percent_of(n) ⇒ Object
164 165 166 |
# File 'lib/percentage.rb', line 164 def percent_of(n) n * Percentage(self) end |
#to_percentage ⇒ Object
160 161 162 |
# File 'lib/percentage.rb', line 160 def to_percentage Percentage(self) end |