Class: Vx::ServiceConnector::Github::Commits
- Inherits:
-
Struct
- Object
- Struct
- Vx::ServiceConnector::Github::Commits
- Defined in:
- lib/vx/service_connector/github/commits.rb
Instance Attribute Summary collapse
-
#repo ⇒ Object
Returns the value of attribute repo.
-
#session ⇒ Object
Returns the value of attribute session.
Instance Method Summary collapse
Instance Attribute Details
#repo ⇒ Object
Returns the value of attribute repo
6 7 8 |
# File 'lib/vx/service_connector/github/commits.rb', line 6 def repo @repo end |
#session ⇒ Object
Returns the value of attribute session
6 7 8 |
# File 'lib/vx/service_connector/github/commits.rb', line 6 def session @session end |
Instance Method Details
#last(options = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/vx/service_connector/github/commits.rb', line 7 def last( = {}) begin project = session.repository(repo.full_name) branch = project.default_branch || 'master' commit = session.commit(repo.full_name, branch) Model::Payload.from_hash( skip: false, pull_request?: false, branch: branch, branch_label: branch, sha: commit.sha, message: commit.commit., author: commit.commit..name, author_email: commit.commit..email, web_url: commit.commit.url ) rescue Octokit::NotFound nil end end |