Class: HTTPHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/committer-tools.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.token=(value) ⇒ Object (writeonly)

Sets the attribute token

Parameters:

  • value

    the value to set the attribute token to.



6
7
8
# File 'lib/committer-tools.rb', line 6

def token=(value)
  @token = value
end

Class Method Details

.get(url) ⇒ Object



9
10
11
# File 'lib/committer-tools.rb', line 9

def self.get(url)
  RestClient.get(url, { params: { access_token: @token } }).body
end

.get_json(url) ⇒ Object



13
14
15
# File 'lib/committer-tools.rb', line 13

def self.get_json(url)
  JSON.parse(get(url))
end