class Unicafe::PriceParser

Constants

EDULLISESTI
KEVYESTI
MAUKKAASTI

Public Instance Methods

parse(price_string) click to toggle source
# File lib/unicafe/price_parser.rb, line 10
def parse price_string
  case price_string
  when 'Maukkaasti'
    MAUKKAASTI
  when 'Edullisesti'
    EDULLISESTI
  when 'Kevyesti'
    KEVYESTI
  when /^Makeasti (.*)$/
    price_string.match(/([,0-9]+)/)[0].gsub(',','.')
  else
    raise PriceError
  end
end