Class: Ultron::Connection

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

Class Method Summary collapse

Class Method Details

.perform(url) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/ultron/connection.rb', line 6

def self.perform url
  c         = Curl::Easy.new("%s" % url)
  c.headers = {
      'Accept'     => 'application/json',
      'User-agent' => 'Ultron v%s: https://rubygems.org/gems/ultron' % Ultron::VERSION
  }

  c.perform
  JSON.parse c.body_str
end