Class: GitWebhook::Notifier

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

Instance Method Summary collapse

Constructor Details

#initialize(data_hash) ⇒ Notifier

Returns a new instance of Notifier.



9
10
11
# File 'lib/git-webhook/notifier.rb', line 9

def initialize(data_hash)
  @data_hash = data_hash
end

Instance Method Details

#notify(url) ⇒ Object



13
14
15
16
# File 'lib/git-webhook/notifier.rb', line 13

def notify(url)
  Net::HTTP.post_form(URI.parse(url), { :payload => @data_hash.to_json })
  puts @data_hash.to_yaml
end