Class: Gitmine::Commit

Inherits:
Object
  • Object
show all
Defined in:
lib/gitmine/commit.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(grit_commit) ⇒ Commit

Initialize a new Commit objects that delegates methods to the Grit::Commit object passed in



5
6
7
# File 'lib/gitmine/commit.rb', line 5

def initialize(grit_commit)
  @grit_commit = grit_commit
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args, &block) ⇒ Object (protected)

Delegate methods to Grit::Commit



22
23
24
25
# File 'lib/gitmine/commit.rb', line 22

def method_missing(m, *args, &block)  
  return @grit_commit.send(m, args, block) if @grit_commit.respond_to? m
  super
end

Instance Attribute Details

#grit_commitObject (readonly)

Returns the value of attribute grit_commit.



2
3
4
# File 'lib/gitmine/commit.rb', line 2

def grit_commit
  @grit_commit
end

Instance Method Details

#idObject

Delegate #id to Grit::Commit



16
17
18
# File 'lib/gitmine/commit.rb', line 16

def id
  @grit_commit.id
end

#issueObject

Issue associated with this commit Return nil if their is no associated issue



11
12
13
# File 'lib/gitmine/commit.rb', line 11

def issue
  @issue ||= Gitmine::Issue.get_for_commit(message)
end