Method: Praxis::ApiGeneralInfo#version_with

Defined in:
lib/praxis/api_general_info.rb

#version_with(val = nil) ⇒ Object



76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/praxis/api_general_info.rb', line 76

def version_with(val = nil)
  if val.nil?
    get(:version_with)
  elsif @global_info.nil?
    Application.instance.versioning_scheme = val
    set(:version_with, val) # this *is* the global info
  else
    raise 'Use of version_with is only allowed in the global part of ' \
      'the API definition (but you are attempting to use it in the API ' \
      "definition of version #{version}"
  end
end