Class: GitWebhook::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/git-webhook/builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(old, new, ref, repository_path, options = {}) ⇒ Builder

Returns a new instance of Builder.



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/git-webhook/builder.rb', line 8

def initialize(old, new, ref, repository_path, options = {})
  @repository = GitWebhook::Repository.new(repository_path, options)
  data = {
    :before => old,
    :after => new,
    :ref => ref,
    :commits => @repository.commits_between(old, new),
    :repository => @repository.info
  }
  data.delete :repository if data[:repository].empty?
  @data_hash = data
end

Instance Attribute Details

#data_hashObject (readonly)

Returns the value of attribute data_hash.



6
7
8
# File 'lib/git-webhook/builder.rb', line 6

def data_hash
  @data_hash
end