Class: TicketMaster::Provider::Github::GithubComment

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/github/github.rb

Constant Summary collapse

URI =
'http://github.com/api/v2/json'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



7
8
9
# File 'lib/github/github.rb', line 7

def body
  @body
end

#created_atObject

Returns the value of attribute created_at.



7
8
9
# File 'lib/github/github.rb', line 7

def created_at
  @created_at
end

#gravatar_idObject

Returns the value of attribute gravatar_id.



7
8
9
# File 'lib/github/github.rb', line 7

def gravatar_id
  @gravatar_id
end

#idObject

Returns the value of attribute id.



7
8
9
# File 'lib/github/github.rb', line 7

def id
  @id
end

#updated_atObject

Returns the value of attribute updated_at.



7
8
9
# File 'lib/github/github.rb', line 7

def updated_at
  @updated_at
end

#userObject

Returns the value of attribute user.



7
8
9
# File 'lib/github/github.rb', line 7

def user
  @user
end

Class Method Details

.auth_paramsObject



19
20
21
# File 'lib/github/github.rb', line 19

def self.auth_params
 {:login => Octopi::Api.api., :token => Octopi::Api.api.token}
end

.create(repo, number, comment) ⇒ Object



15
16
17
# File 'lib/github/github.rb', line 15

def self.create(repo, number, comment)
 HTTParty.post("#{secure}/issues/comment/#{repo.username}/#{repo.name}/#{number}", :query => auth_params, :body => {:comment => comment}).parsed_response['comment']
end

.find_all(repo, number) ⇒ Object



11
12
13
# File 'lib/github/github.rb', line 11

def self.find_all(repo, number)
 HTTParty.get("#{URI}/issues/comments/#{repo.username}/#{repo.name}/#{number}", :query => auth_params).parsed_response['comments']
end

.secureObject



23
24
25
# File 'lib/github/github.rb', line 23

def self.secure
  URI.gsub('http','https')
end