Class: Clarc::Response
- Inherits:
-
Object
- Object
- Clarc::Response
- Defined in:
- lib/clarc/response.rb
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(status, result) ⇒ Response
constructor
A new instance of Response.
- #method_missing(name, *args, &block) ⇒ Object
Constructor Details
#initialize(status, result) ⇒ Response
Returns a new instance of Response.
5 6 7 |
# File 'lib/clarc/response.rb', line 5 def initialize status, result @status, @result = status, result end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
9 10 11 12 |
# File 'lib/clarc/response.rb', line 9 def method_missing name, *args, &block return super unless name.end_with?('?') @status.to_sym == name[0..-2].to_sym end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
3 4 5 |
# File 'lib/clarc/response.rb', line 3 def result @result end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
3 4 5 |
# File 'lib/clarc/response.rb', line 3 def status @status end |