Class: Mushikago::Mitsubachi::Cookiejar

Inherits:
Object
  • Object
show all
Defined in:
lib/mushikago/mitsubachi/cookiejar.rb

Overview

http_fetch/http_pushに渡すcookiejarオブジェクト

Examples:

require 'mushikago'
cookiejar = Mushikago::Mitsubachi::Cookiejar.new
cookiejar.add Mushikago::Mitsubachi::Cookie.new('name', 'value', 'domain', 'path', true)

client = Mushikago::Mitsubachi::Client.new(:api_key => '<api_key>', :secret_key => '<secret_key>')
client.http_fetch('project01', 'http://www.mushikago.org/', 'sample.rb', :cookiejar => cookiejar)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCookiejar

Returns a new instance of Cookiejar.



17
18
19
# File 'lib/mushikago/mitsubachi/cookiejar.rb', line 17

def initialize
  @cookies = []
end

Instance Attribute Details

#cookiesObject (readonly)

Returns the value of attribute cookies.



16
17
18
# File 'lib/mushikago/mitsubachi/cookiejar.rb', line 16

def cookies
  @cookies
end

Instance Method Details

#add(cookie) ⇒ Object



21
22
23
# File 'lib/mushikago/mitsubachi/cookiejar.rb', line 21

def add cookie
  @cookies << cookie
end

#to_json(*args) ⇒ Object



25
26
27
# File 'lib/mushikago/mitsubachi/cookiejar.rb', line 25

def to_json *args
  @cookies.to_json(args)
end