Class: Fixnum
- Inherits:
-
Object
- Object
- Fixnum
- Defined in:
- lib/picklive/currency.rb
Instance Method Summary collapse
- #chips ⇒ Object
- #pennies ⇒ Object (also: #pence)
- #percent ⇒ Object
- #pounds ⇒ Object (also: #pound)
- #to_pennies ⇒ Object
- #to_pounds ⇒ Object
Instance Method Details
#chips ⇒ Object
221 222 223 |
# File 'lib/picklive/currency.rb', line 221 def chips Picklive::Currency::Chips.new(self) end |
#pennies ⇒ Object Also known as: pence
208 209 210 |
# File 'lib/picklive/currency.rb', line 208 def pennies Picklive::Currency::GBP.new(self) end |
#percent ⇒ Object
199 200 201 |
# File 'lib/picklive/currency.rb', line 199 def percent self.to_f / 100 end |
#pounds ⇒ Object Also known as: pound
203 204 205 |
# File 'lib/picklive/currency.rb', line 203 def pounds (self * 100).pennies end |
#to_pennies ⇒ Object
217 218 219 |
# File 'lib/picklive/currency.rb', line 217 def to_pennies self * 100 end |
#to_pounds ⇒ Object
213 214 215 |
# File 'lib/picklive/currency.rb', line 213 def to_pounds self / 100.0 end |