Class: MasonClient::Result
- Inherits:
-
Object
- Object
- MasonClient::Result
- Defined in:
- lib/mason_client/result.rb
Instance Attribute Summary collapse
-
#callback ⇒ Object
readonly
Returns the value of attribute callback.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(url, callback, status) ⇒ Result
constructor
A new instance of Result.
- #success? ⇒ Boolean
Constructor Details
#initialize(url, callback, status) ⇒ Result
Returns a new instance of Result.
7 8 9 10 11 |
# File 'lib/mason_client/result.rb', line 7 def initialize(url, callback, status) @url = url @callback = callback @status = status end |
Instance Attribute Details
#callback ⇒ Object (readonly)
Returns the value of attribute callback.
13 14 15 |
# File 'lib/mason_client/result.rb', line 13 def callback @callback end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
13 14 15 |
# File 'lib/mason_client/result.rb', line 13 def url @url end |
Class Method Details
.from(payload) ⇒ Object
3 4 5 |
# File 'lib/mason_client/result.rb', line 3 def self.from(payload) new(payload["url"], payload["callback"], payload["status"]) end |
Instance Method Details
#success? ⇒ Boolean
15 16 17 |
# File 'lib/mason_client/result.rb', line 15 def success? @status.zero? end |