Class: GrabzIt::CookieJar
- Inherits:
-
Object
- Object
- GrabzIt::CookieJar
- Defined in:
- lib/grabz_it/cookie_jar.rb
Instance Attribute Summary collapse
-
#cookies ⇒ Object
Returns the value of attribute cookies.
-
#message ⇒ Object
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(xml) ⇒ CookieJar
constructor
A new instance of CookieJar.
Constructor Details
#initialize(xml) ⇒ CookieJar
Returns a new instance of CookieJar.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/grabz_it/cookie_jar.rb', line 5 def initialize(xml) @cookies = [] doc = REXML::Document.new(xml) @message = doc.root.elements['Message'].text begin (doc.root.elements.to_a("//WebResult/Cookies/Cookie")) rescue => ex raise "Invalid Response: #{xml}" end end |
Instance Attribute Details
#cookies ⇒ Object
Returns the value of attribute cookies.
3 4 5 |
# File 'lib/grabz_it/cookie_jar.rb', line 3 def @cookies end |
#message ⇒ Object
Returns the value of attribute message.
3 4 5 |
# File 'lib/grabz_it/cookie_jar.rb', line 3 def @message end |