Class: GitWebhook::Builder
- Inherits:
-
Object
- Object
- GitWebhook::Builder
- Defined in:
- lib/git-webhook/builder.rb
Instance Attribute Summary collapse
-
#data_hash ⇒ Object
readonly
Returns the value of attribute data_hash.
Instance Method Summary collapse
-
#initialize(old, new, ref, repository_path, options = {}) ⇒ Builder
constructor
A new instance of Builder.
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, = {}) @repository = GitWebhook::Repository.new(repository_path, ) 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_hash ⇒ Object (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 |