Class: BigDecimal

Inherits:
Object
  • Object
show all
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_percentageObject



160
161
162
# File 'lib/percentage.rb', line 160

def to_percentage
  Percentage(self)
end