Class: Txgh::GithubStatus
- Inherits:
-
Object
- Object
- Txgh::GithubStatus
- Defined in:
- lib/txgh/github_status.rb
Defined Under Namespace
Classes: State
Constant Summary collapse
- ALL_COMPLETE_DESCRIPTION =
"Translations complete!"
- TARGET_URL_TEMPLATE =
"https://www.transifex.com/%{organization}/%{project_slug}/%{resource_slug}/"
- DESCRIPTION_TEMPLATE =
"%{complete}/%{total} translations complete."
- CONTEXT =
'continuous-localization/txgh'
Instance Attribute Summary collapse
-
#project ⇒ Object
readonly
Returns the value of attribute project.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
-
#tx_resource ⇒ Object
readonly
Returns the value of attribute tx_resource.
Instance Method Summary collapse
-
#initialize(project, repo, tx_resource) ⇒ GithubStatus
constructor
A new instance of GithubStatus.
- #update(sha) ⇒ Object
Constructor Details
#initialize(project, repo, tx_resource) ⇒ GithubStatus
Returns a new instance of GithubStatus.
24 25 26 27 28 |
# File 'lib/txgh/github_status.rb', line 24 def initialize(project, repo, tx_resource) @project = project @repo = repo @tx_resource = tx_resource end |
Instance Attribute Details
#project ⇒ Object (readonly)
Returns the value of attribute project.
22 23 24 |
# File 'lib/txgh/github_status.rb', line 22 def project @project end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
22 23 24 |
# File 'lib/txgh/github_status.rb', line 22 def repo @repo end |
#tx_resource ⇒ Object (readonly)
Returns the value of attribute tx_resource.
22 23 24 |
# File 'lib/txgh/github_status.rb', line 22 def tx_resource @tx_resource end |
Instance Method Details
#update(sha) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/txgh/github_status.rb', line 30 def update(sha) repo.api.create_status( repo.name, sha, state, { context: context, target_url: target_url, description: description } ) end |