Class: Lois::Github
- Inherits:
-
Object
- Object
- Lois::Github
- Defined in:
- lib/lois/github.rb
Defined Under Namespace
Classes: Status
Instance Attribute Summary collapse
-
#credentials ⇒ Object
readonly
Returns the value of attribute credentials.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#pull_request_sha ⇒ Object
readonly
Returns the value of attribute pull_request_sha.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
Instance Method Summary collapse
- #failure(context, description, artifact_url = nil) ⇒ Object
-
#initialize(credentials, organization, repository, pull_request_sha) ⇒ Github
constructor
A new instance of Github.
- #pending(context, description, artifact_url = nil) ⇒ Object
- #pull_request_status_api_url ⇒ Object
- #success(context, description, artifact_url = nil) ⇒ Object
Constructor Details
#initialize(credentials, organization, repository, pull_request_sha) ⇒ Github
Returns a new instance of Github.
9 10 11 12 13 14 |
# File 'lib/lois/github.rb', line 9 def initialize(credentials, organization, repository, pull_request_sha) @credentials = credentials @organization = organization @repository = repository @pull_request_sha = pull_request_sha end |
Instance Attribute Details
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
7 8 9 |
# File 'lib/lois/github.rb', line 7 def credentials @credentials end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
7 8 9 |
# File 'lib/lois/github.rb', line 7 def organization @organization end |
#pull_request_sha ⇒ Object (readonly)
Returns the value of attribute pull_request_sha.
7 8 9 |
# File 'lib/lois/github.rb', line 7 def pull_request_sha @pull_request_sha end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
7 8 9 |
# File 'lib/lois/github.rb', line 7 def repository @repository end |
Instance Method Details
#failure(context, description, artifact_url = nil) ⇒ Object
24 25 26 |
# File 'lib/lois/github.rb', line 24 def failure(context, description, artifact_url = nil) update_status(Status.new('failure', context, description, artifact_url)) end |
#pending(context, description, artifact_url = nil) ⇒ Object
16 17 18 |
# File 'lib/lois/github.rb', line 16 def pending(context, description, artifact_url = nil) update_status(Status.new('pending', context, description, artifact_url)) end |
#pull_request_status_api_url ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/lois/github.rb', line 28 def pull_request_status_api_url @pull_request_status_api_url ||= File.join( 'https://api.github.com/repos', organization, repository, 'statuses', pull_request_sha ) end |
#success(context, description, artifact_url = nil) ⇒ Object
20 21 22 |
# File 'lib/lois/github.rb', line 20 def success(context, description, artifact_url = nil) update_status(Status.new('success', context, description, artifact_url)) end |