Class: ROM::Firebase::ResponseHandler
- Inherits:
-
Object
- Object
- ROM::Firebase::ResponseHandler
- Defined in:
- lib/rom/firebase/response_handler.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(response, dataset) ⇒ ResponseHandler
constructor
A new instance of ResponseHandler.
Constructor Details
#initialize(response, dataset) ⇒ ResponseHandler
Returns a new instance of ResponseHandler.
8 9 10 11 |
# File 'lib/rom/firebase/response_handler.rb', line 8 def initialize(response, dataset) @response = response @dataset = dataset end |
Class Method Details
.call(response, dataset) ⇒ Object
4 5 6 |
# File 'lib/rom/firebase/response_handler.rb', line 4 def self.call(response, dataset) new(response, dataset).call end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/rom/firebase/response_handler.rb', line 13 def call return create_response if [:request_method] == :post return [path_response] unless path.nil? || path.empty? return [] if [:request_method] == :delete # delete always succeeds collection_response end |