Class: ActiveRecord::Remote::Response
- Inherits:
-
Object
- Object
- ActiveRecord::Remote::Response
- Defined in:
- lib/active_record/remote/response.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#parsed_response ⇒ Object
(also: #parsed)
Returns the value of attribute parsed_response.
Instance Method Summary collapse
- #handle_response(response) ⇒ Object
-
#initialize(options) ⇒ Response
constructor
A new instance of Response.
- #operation ⇒ Object
- #record_instance ⇒ Object
- #response_message ⇒ Object
- #success? ⇒ Boolean
- #valid? ⇒ Boolean
Constructor Details
#initialize(options) ⇒ Response
Returns a new instance of Response.
9 10 11 12 |
# File 'lib/active_record/remote/response.rb', line 9 def initialize() @options = handle_response([:raw_response]) end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
5 6 7 |
# File 'lib/active_record/remote/response.rb', line 5 def @options end |
#parsed_response ⇒ Object Also known as: parsed
Returns the value of attribute parsed_response.
5 6 7 |
# File 'lib/active_record/remote/response.rb', line 5 def parsed_response @parsed_response end |
Instance Method Details
#handle_response(response) ⇒ Object
26 27 28 |
# File 'lib/active_record/remote/response.rb', line 26 def handle_response(response) # implement in subclass end |
#operation ⇒ Object
14 15 16 |
# File 'lib/active_record/remote/response.rb', line 14 def operation [:operation] end |
#record_instance ⇒ Object
18 19 20 |
# File 'lib/active_record/remote/response.rb', line 18 def record_instance [:instance] end |
#response_message ⇒ Object
30 31 32 |
# File 'lib/active_record/remote/response.rb', line 30 def # implement in subclass end |
#success? ⇒ Boolean
22 23 24 |
# File 'lib/active_record/remote/response.rb', line 22 def success? record_instance.errors.blank? end |
#valid? ⇒ Boolean
34 35 36 |
# File 'lib/active_record/remote/response.rb', line 34 def valid? # implement in subclass end |