Module: Secretariat::Versioner

Included in:
Invoice, LineItem
Defined in:
lib/secretariat/versioner.rb

Instance Method Summary collapse

Instance Method Details

#by_version(version, v1, v2) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/secretariat/versioner.rb', line 3

def by_version(version, v1, v2)
  if version == 1
    v1
  elsif version == 2
    v2
  else
    raise "Unsupported Version: #{version}"
  end
end