Class: Materialize::Response
- Inherits:
-
Object
- Object
- Materialize::Response
- Defined in:
- lib/materialize/response.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(options) ⇒ Response
constructor
A new instance of Response.
-
#method_missing(message) ⇒ Object
This is used to look up ids -> e.g.
- #ok? ⇒ Boolean
Constructor Details
#initialize(options) ⇒ Response
Returns a new instance of Response.
6 7 8 9 10 |
# File 'lib/materialize/response.rb', line 6 def initialize() @message = ['message'] @status = ['status'].to_sym @options = end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(message) ⇒ Object
This is used to look up ids -> e.g. patient_id, phase_id, etc.
17 18 19 |
# File 'lib/materialize/response.rb', line 17 def method_missing() .send(:[], .to_s) end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
4 5 6 |
# File 'lib/materialize/response.rb', line 4 def @message end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/materialize/response.rb', line 4 def @options end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/materialize/response.rb', line 4 def status @status end |
Instance Method Details
#ok? ⇒ Boolean
12 13 14 |
# File 'lib/materialize/response.rb', line 12 def ok? status == :ok end |