Method: OldApiResource::Base.find

Defined in:
lib/old_api_resource/base.rb

.find(*arguments) ⇒ Object



192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/old_api_resource/base.rb', line 192

def find(*arguments)
  scope   = arguments.slice!(0)
  options = arguments.slice!(0) || {}

  case scope
    when :all   then find_every(options)
    when :first then find_every(options).first
    when :last  then find_every(options).last
    when :one   then find_one(options)
    else             find_single(scope, options)
  end
end