class Smooth::Query::Response

Public Instance Methods

object() click to toggle source
# File lib/smooth/query.rb, line 181
def object
  return @object if @object

  if command_action.to_sym == :find
    outcome.result
  elsif success? && command_action.to_sym == :query
    outcome.result.to_a
  end
end
options() click to toggle source
# File lib/smooth/query.rb, line 174
def options
  @serializer_options.tap do |o|
    o[:each_serializer] = @serializer unless command_action == :find
    o[:scope] = current_user
  end
end
serializer() click to toggle source
# File lib/smooth/query.rb, line 166
def serializer
  if command_action.to_sym == :find
    @serializer
  else
    Smooth::ArraySerializer
  end
end