Class: Watobo::HTTP::Cookies
- Inherits:
-
Object
- Object
- Watobo::HTTP::Cookies
- Defined in:
- lib/watobo/http/cookies/cookies.rb
Instance Method Summary collapse
- #has_parm?(parm_name) ⇒ Boolean
-
#initialize(root) ⇒ Cookies
constructor
A new instance of Cookies.
- #parameters(&block) ⇒ Object
- #set(parm) ⇒ Object
- #to_s ⇒ Object
Constructor Details
Instance Method Details
#has_parm?(parm_name) ⇒ Boolean
35 36 37 |
# File 'lib/watobo/http/cookies/cookies.rb', line 35 def has_parm?(parm_name) false end |
#parameters(&block) ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/watobo/http/cookies/cookies.rb', line 39 def parameters(&block) parms = [] =[] ={ :secure => false, :http_only => false } @root.headers.each do |line| if line =~ /^(Set\-)?Cookie2?: (.*)/i then [:secure] = true if line =~ /secure/i [:http_only] = true if line =~ /httponly/i clist = $2.split(";") clist.each do |c| name, value = c.strip.split("=").map{|v| v.strip} puts "NEW COOKIE: #{name} - #{value}" [:name] = name [:value] = value << Watobo::CookieParameter.new() end end end return end |
#set(parm) ⇒ Object
31 32 33 |
# File 'lib/watobo/http/cookies/cookies.rb', line 31 def set(parm) end |
#to_s ⇒ Object
26 27 28 |
# File 'lib/watobo/http/cookies/cookies.rb', line 26 def to_s s = @root.url_string end |