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