Class: Rational

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

Instance Method Summary collapse

Instance Method Details

#as_percentage_of(n) ⇒ Object



154
155
156
# File 'lib/percentage.rb', line 154

def as_percentage_of(n)
  Percentage.new(self / n)
end

#percent_of(n) ⇒ Object



150
151
152
# File 'lib/percentage.rb', line 150

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

#to_percentageObject



146
147
148
# File 'lib/percentage.rb', line 146

def to_percentage
  Percentage(self)
end