Class: SmoothOperator::CookieJar
- Inherits:
-
Hash
- Object
- Hash
- SmoothOperator::CookieJar
- Defined in:
- lib/smooth_operator/cookie_jar.rb
Instance Method Summary collapse
Instance Method Details
#parse(*cookie_strings) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/smooth_operator/cookie_jar.rb', line 8 def parse(*) .each do || next unless .is_a?(String) key, value = .split('; ').first.split('=', 2) self[key] = value end self end |
#to_s ⇒ Object
4 5 6 |
# File 'lib/smooth_operator/cookie_jar.rb', line 4 def to_s self.map { |key, value| "#{key}=#{value}"}.join("; ") end |