Class: ShortURL::Services::Shorl

Inherits:
ShortURL::Service show all
Defined in:
lib/shorturl/services/shorl.rb

Instance Attribute Summary

Attributes inherited from ShortURL::Service

#action, #block, #code, #field, #method, #port, #response_block, #ssl

Instance Method Summary collapse

Methods inherited from ShortURL::Service

#call, #on_response

Constructor Details

#initializeShorl

Returns a new instance of Shorl.



7
8
9
10
11
# File 'lib/shorturl/services/shorl.rb', line 7

def initialize
  super("shorl.com")

  @action = "/create.php"
end

Instance Method Details

#on_body(body) ⇒ Object



13
14
15
# File 'lib/shorturl/services/shorl.rb', line 13

def on_body(body)
  URI.extract(body)[2]
end