Class: Twoffein::Cookie

Inherits:
Object
  • Object
show all
Defined in:
lib/twoffein-client/cookie.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target_screen_name) ⇒ Cookie

Returns a new instance of Cookie.



8
9
10
# File 'lib/twoffein-client/cookie.rb', line 8

def initialize target_screen_name
  @target_screen_name = target_screen_name
end

Instance Attribute Details

#target_screen_nameObject

Returns the value of attribute target_screen_name.



6
7
8
# File 'lib/twoffein-client/cookie.rb', line 6

def target_screen_name
  @target_screen_name
end

Instance Method Details

#postObject Also known as: send

Raises:



12
13
14
15
16
# File 'lib/twoffein-client/cookie.rb', line 12

def post
  info = HTTP.post("cookie", :target_screen_name => @target_screen_name)
  raise Server::Error.new(info[:code], info[:error]) if info.has_key? :error
  info
end

#to_sObject



19
20
21
# File 'lib/twoffein-client/cookie.rb', line 19

def to_s
  "Ich gebe #@target_screen_name einen Keks!"
end