Method: Praxis::ResourceDefinition::ClassMethods#version

Defined in:
lib/praxis/resource_definition.rb

#version(version = nil, options = nil) ⇒ Object



167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# File 'lib/praxis/resource_definition.rb', line 167

def version(version=nil, options=nil)
  return @version unless version

  @version = version

  unless options.nil?
    warn 'DEPRECATED: ResourceDefinition.version with options is no longer supported. Define in api global info instead.'

    @version_options = options
    version_using = Array(@version_options[:using])
    if version_using.include?(:path)
      @version_prefix = "#{Praxis::Request::path_version_prefix}#{self.version}"
    end
  end
end