Class: Vx::ServiceConnector::GitlabV6::Commits
- Inherits:
-
Struct
- Object
- Struct
- Vx::ServiceConnector::GitlabV6::Commits
- Defined in:
- lib/vx/service_connector/gitlab_v6/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
4 5 6 |
# File 'lib/vx/service_connector/gitlab_v6/commits.rb', line 4 def repo @repo end |
#session ⇒ Object
Returns the value of attribute session
4 5 6 |
# File 'lib/vx/service_connector/gitlab_v6/commits.rb', line 4 def session @session end |
Instance Method Details
#last(options = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/vx/service_connector/gitlab_v6/commits.rb', line 6 def last( = {}) begin commit = session.get "/projects/#{repo.id}/repository/commits/HEAD" Model::Payload.from_hash( skip: false, pull_request?: false, branch: 'HEAD', branch_label: 'HEAD', sha: commit.id, message: commit.title, author: commit., author_email: commit., web_url: "#{repo.html_url}/commits/#{commit.id}" ) rescue RequestError nil end end |