Class: GrabzIt::Response
- Inherits:
-
Object
- Object
- GrabzIt::Response
- Defined in:
- lib/grabz_it/response.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
Returns the value of attribute message.
-
#result ⇒ Object
Returns the value of attribute result.
-
#screenshot_id ⇒ Object
Returns the value of attribute screenshot_id.
Instance Method Summary collapse
-
#initialize(xml) ⇒ Response
constructor
A new instance of Response.
- #successful? ⇒ Boolean
Constructor Details
#initialize(xml) ⇒ Response
Returns a new instance of Response.
5 6 7 8 9 10 |
# File 'lib/grabz_it/response.rb', line 5 def initialize(xml) doc = REXML::Document.new(xml) @result = doc.root.elements['Result'].text @screenshot_id = doc.root.elements['ID'].text @message = doc.root.elements['Message'].text end |
Instance Attribute Details
#message ⇒ Object
Returns the value of attribute message.
3 4 5 |
# File 'lib/grabz_it/response.rb', line 3 def @message end |
#result ⇒ Object
Returns the value of attribute result.
3 4 5 |
# File 'lib/grabz_it/response.rb', line 3 def result @result end |
#screenshot_id ⇒ Object
Returns the value of attribute screenshot_id.
3 4 5 |
# File 'lib/grabz_it/response.rb', line 3 def screenshot_id @screenshot_id end |
Instance Method Details
#successful? ⇒ Boolean
12 13 14 |
# File 'lib/grabz_it/response.rb', line 12 def successful? @result == 'True' end |