Class: ShortURL::Services::TinyURL
- Inherits:
-
ShortURL::Service
- Object
- ShortURL::Service
- ShortURL::Services::TinyURL
- Defined in:
- lib/shorturl/services/tinyurl.rb
Instance Attribute Summary
Attributes inherited from ShortURL::Service
#action, #block, #code, #field, #method, #port, #response_block, #ssl
Instance Method Summary collapse
-
#initialize ⇒ TinyURL
constructor
A new instance of TinyURL.
- #on_body(body) ⇒ Object
Methods inherited from ShortURL::Service
Constructor Details
#initialize ⇒ TinyURL
Returns a new instance of TinyURL.
7 8 9 10 11 12 |
# File 'lib/shorturl/services/tinyurl.rb', line 7 def initialize super('tinyurl.com') @action = "/api-create.php" @method = :get end |
Instance Method Details
#on_body(body) ⇒ Object
14 15 16 |
# File 'lib/shorturl/services/tinyurl.rb', line 14 def on_body(body) URI.extract(body).grep(/tinyurl/)[0] end |