Class: Capistrano::Webhooks::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/capistrano/webhooks/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, options) ⇒ Client

Returns a new instance of Client.



8
9
10
11
# File 'lib/capistrano/webhooks/client.rb', line 8

def initialize(url, options)
  @url     = url
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/capistrano/webhooks/client.rb', line 6

def options
  @options
end

#urlObject (readonly)

Returns the value of attribute url.



6
7
8
# File 'lib/capistrano/webhooks/client.rb', line 6

def url
  @url
end

Instance Method Details

#runObject



13
14
15
16
17
# File 'lib/capistrano/webhooks/client.rb', line 13

def run
  return if dry_run?

  connection.send options[:method], url.to_s, options[:payload]
end