Class: Smooth::Query::Response
Instance Attribute Summary
Attributes inherited from Response
#command_action, #current_user, #event_namespace, #outcome, #request_headers, #serializer_klass, #serializer_options, #success
Instance Method Summary collapse
Methods inherited from Response
#body, #headers, #initialize, #status, #success?, #to_rack
Constructor Details
This class inherits a constructor from Smooth::Response
Instance Method Details
#object ⇒ Object
181 182 183 184 185 186 187 188 189 |
# 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 ⇒ Object
174 175 176 177 178 179 |
# File 'lib/smooth/query.rb', line 174 def @serializer_options.tap do |o| o[:each_serializer] = @serializer unless command_action == :find o[:scope] = current_user end end |