Class: ShortURL::Services::MooURL

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

Constructor Details

#initializeMooURL

Returns a new instance of MooURL.



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

def initialize
  super("moourl.com")

  @code = 302
  @method = :get
  @action = "/create/"
  @field = "source"
end

Instance Method Details

#on_response(response) ⇒ Object



16
17
18
# File 'lib/shorturl/services/moourl.rb', line 16

def on_response(response)
  "http://moourl.com/" + res["location"].match(/\?moo=/).post_match
end