Class: ShortURL::Services::ShitURL

Inherits:
ShortURL::Service show all
Defined in:
lib/shorturl/services/shiturl.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

#initializeShitURL

Returns a new instance of ShitURL.



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

def initialize
  super("shiturl.com")

  @method = :get
  @action = "/make.php"
end

Instance Method Details

#on_body(body) ⇒ Object



14
15
16
# File 'lib/shorturl/services/shiturl.rb', line 14

def on_body(body)
  URI.extract(body).grep(/shiturl/)[0]
end