Class: Vx::ServiceConnector::Github::Commits

Inherits:
Struct
  • Object
show all
Defined in:
lib/vx/service_connector/github/commits.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#repoObject

Returns the value of attribute repo

Returns:

  • (Object)

    the current value of repo



4
5
6
# File 'lib/vx/service_connector/github/commits.rb', line 4

def repo
  @repo
end

#sessionObject

Returns the value of attribute session

Returns:

  • (Object)

    the current value of session



4
5
6
# File 'lib/vx/service_connector/github/commits.rb', line 4

def session
  @session
end

Instance Method Details

#get(sha) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/vx/service_connector/github/commits.rb', line 6

def get(sha)
  begin
    commit = session.commit repo.full_name, sha
    commit_to_model commit
  rescue ::Octokit::NotFound => e
    $stderr.puts "ERROR: #{e.inspect}"
    nil
  end
end