Class: Octonore::HTTPHelper

Inherits:
Object
  • Object
show all
Includes:
HTTParty, Singleton
Defined in:
lib/octonore/http_helper.rb

Constant Summary collapse

USER_AGENT =
"octonore/#{VERSION}"

Instance Method Summary collapse

Instance Method Details

#get(location) ⇒ Hash

Get the specified template’s hash from Github.

Parameters:

  • location (String)

    location of resource to get

Returns:

  • (Hash)

    whatever is gotten



16
17
18
# File 'lib/octonore/http_helper.rb', line 16

def get(location)
  self.class.get location, headers: headers 
end

#headersObject



20
21
22
# File 'lib/octonore/http_helper.rb', line 20

def headers
  {"User-Agent" => USER_AGENT}
end