Class: Twoffein::Cookie
- Inherits:
-
Object
- Object
- Twoffein::Cookie
- Defined in:
- lib/twoffein-client/cookie.rb
Instance Attribute Summary collapse
-
#target_screen_name ⇒ Object
Returns the value of attribute target_screen_name.
Instance Method Summary collapse
-
#initialize(target_screen_name) ⇒ Cookie
constructor
A new instance of Cookie.
- #post ⇒ Object (also: #send)
- #to_s ⇒ Object
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_name ⇒ Object
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
#post ⇒ Object Also known as: send
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_s ⇒ Object
19 20 21 |
# File 'lib/twoffein-client/cookie.rb', line 19 def to_s "Ich gebe #@target_screen_name einen Keks!" end |