Class: WebHookDispatcher::Response
- Inherits:
-
Object
- Object
- WebHookDispatcher::Response
- Defined in:
- lib/webhook-dispatcher/response.rb
Instance Attribute Summary collapse
-
#exception ⇒ Object
readonly
Returns the value of attribute exception.
-
#http_code ⇒ Object
readonly
Returns the value of attribute http_code.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#success ⇒ Object
readonly
Returns the value of attribute success.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Response
constructor
A new instance of Response.
- #success? ⇒ Boolean
Constructor Details
#initialize(options = {}) ⇒ Response
Returns a new instance of Response.
3 4 5 6 7 8 9 10 11 |
# File 'lib/webhook-dispatcher/response.rb', line 3 def initialize( = {}) = .dup @success = (.delete(:success) == true) @status = .delete(:status) || :unknown @http_code = .delete(:http_code) || nil @message = .delete(:message) || nil @exception = .delete(:exception) || nil raise(ArgumentError, "invalid parameter") unless .empty? end |
Instance Attribute Details
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
13 14 15 |
# File 'lib/webhook-dispatcher/response.rb', line 13 def exception @exception end |
#http_code ⇒ Object (readonly)
Returns the value of attribute http_code.
13 14 15 |
# File 'lib/webhook-dispatcher/response.rb', line 13 def http_code @http_code end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
13 14 15 |
# File 'lib/webhook-dispatcher/response.rb', line 13 def @message end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
13 14 15 |
# File 'lib/webhook-dispatcher/response.rb', line 13 def status @status end |
#success ⇒ Object (readonly)
Returns the value of attribute success.
13 14 15 |
# File 'lib/webhook-dispatcher/response.rb', line 13 def success @success end |
Instance Method Details
#success? ⇒ Boolean
15 16 17 |
# File 'lib/webhook-dispatcher/response.rb', line 15 def success? return self.success end |