Class: GithubApi::Reference

Inherits:
Object
  • Object
show all
Defined in:
lib/github-api/other.rb

Overview

Reference class


Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repo, data) ⇒ Reference

Returns a new instance of Reference.



22
23
24
25
# File 'lib/github-api/other.rb', line 22

def initialize(repo, data)
  @repo = repo
  @data = data
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



20
21
22
# File 'lib/github-api/other.rb', line 20

def data
  @data
end

#repoObject

Returns the value of attribute repo.



20
21
22
# File 'lib/github-api/other.rb', line 20

def repo
  @repo
end

Instance Method Details

#commitObject



27
28
29
30
# File 'lib/github-api/other.rb', line 27

def commit
  # TODO: Object in ref is not always a commit.
  @repo.commit(data["object"]["sha"])
end