Class: GrabzIt::Status
- Inherits:
-
Object
- Object
- GrabzIt::Status
- Defined in:
- lib/grabz_it/status.rb
Instance Attribute Summary collapse
-
#cached ⇒ Object
Returns the value of attribute cached.
-
#expired ⇒ Object
Returns the value of attribute expired.
-
#message ⇒ Object
Returns the value of attribute message.
-
#processing ⇒ Object
Returns the value of attribute processing.
Instance Method Summary collapse
- #available? ⇒ Boolean
- #failed? ⇒ Boolean
-
#initialize(xml) ⇒ Status
constructor
A new instance of Status.
Constructor Details
#initialize(xml) ⇒ Status
Returns a new instance of Status.
5 6 7 8 9 10 11 |
# File 'lib/grabz_it/status.rb', line 5 def initialize(xml) doc = REXML::Document.new(xml) @processing = (doc.root.elements['Processing'].text == 'True') @cached = (doc.root.elements['Cached'].text == 'True') @expired = (doc.root.elements['Expired'].text == 'True') @message = doc.root.elements['Message'].text end |
Instance Attribute Details
#cached ⇒ Object
Returns the value of attribute cached.
3 4 5 |
# File 'lib/grabz_it/status.rb', line 3 def cached @cached end |
#expired ⇒ Object
Returns the value of attribute expired.
3 4 5 |
# File 'lib/grabz_it/status.rb', line 3 def expired @expired end |
#message ⇒ Object
Returns the value of attribute message.
3 4 5 |
# File 'lib/grabz_it/status.rb', line 3 def @message end |
#processing ⇒ Object
Returns the value of attribute processing.
3 4 5 |
# File 'lib/grabz_it/status.rb', line 3 def processing @processing end |
Instance Method Details
#available? ⇒ Boolean
17 18 19 |
# File 'lib/grabz_it/status.rb', line 17 def available? @cached end |
#failed? ⇒ Boolean
13 14 15 |
# File 'lib/grabz_it/status.rb', line 13 def failed? !@processing && !@cached end |