Module: Picklive::Currency

Defined in:
lib/picklive/currency.rb

Defined Under Namespace

Modules: Converters, ModelMethods Classes: Base, Chips, GBP

Class Method Summary collapse

Class Method Details

.[](code) ⇒ Object

Raises:

  • (ArgumentError)


8
9
10
11
12
13
# File 'lib/picklive/currency.rb', line 8

def self.[](code)
  puts "WARN: Currency code #{code.inspect} is DEPRECATED" if code == 'chip'
  return GBP if code == 'GBP'
  return Chips if code == 'chips' || code == 'chip'
  raise ArgumentError.new("unknown currency code: #{code.inspect}")
end

.allObject



15
# File 'lib/picklive/currency.rb', line 15

def self.all            ; [GBP, Chips] ; end

.cash_codesObject



16
# File 'lib/picklive/currency.rb', line 16

def self.cash_codes     ; 'GBP'       ; end

.virtual_codesObject



17
# File 'lib/picklive/currency.rb', line 17

def self.virtual_codes  ; 'chips'      ; end