Class: Libfchat::WebAPI
- Inherits:
-
Object
- Object
- Libfchat::WebAPI
- Defined in:
- lib/libfchat/webapi.rb
Instance Attribute Summary collapse
-
#ticket ⇒ Object
readonly
Returns the value of attribute ticket.
Instance Method Summary collapse
Instance Attribute Details
#ticket ⇒ Object (readonly)
Returns the value of attribute ticket.
11 12 13 |
# File 'lib/libfchat/webapi.rb', line 11 def ticket @ticket end |
Instance Method Details
#get_ticket(account, password) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/libfchat/webapi.rb', line 13 def get_ticket(account,password) uri = URI('http://www.f-list.net/json/getApiTicket.php') res = Net::HTTP.post_form(uri, 'account' => account, 'password' => password) json = MultiJson.load(res.body) if json['ticket'] @ticket = json['ticket'] else raise json['error'] end return json end |