Class: Achetepe

Inherits:
Object
  • Object
show all
Defined in:
lib/achetepe.rb

Class Method Summary collapse

Class Method Details

.get(url, &block) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/achetepe.rb', line 6

def get(url, &block)
  uri = URI(url)

  Thread.new do
    yield Net::HTTP.get_response(uri)
  end
end

.post(url, params = {}, &block) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/achetepe.rb', line 14

def post(url, params = {}, &block)
  uri = URI(url)

  Thread.new do
    yield Net::HTTP.post_form(uri, params)
  end
end