Class: ActiveHook::Server::Send

Inherits:
Object
  • Object
show all
Defined in:
lib/activehook/server/send.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Send

Returns a new instance of Send.



13
14
15
# File 'lib/activehook/server/send.rb', line 13

def initialize(options = {})
  options.each { |key, value| send("#{key}=", value) }
end

Instance Attribute Details

#hookObject

Returns the value of attribute hook.



10
11
12
# File 'lib/activehook/server/send.rb', line 10

def hook
  @hook
end

#responseObject (readonly)

Returns the value of attribute response.



11
12
13
# File 'lib/activehook/server/send.rb', line 11

def response
  @response
end

#response_timeObject (readonly)

Returns the value of attribute response_time.



11
12
13
# File 'lib/activehook/server/send.rb', line 11

def response_time
  @response_time
end

#statusObject (readonly)

Returns the value of attribute status.



11
12
13
# File 'lib/activehook/server/send.rb', line 11

def status
  @status
end

Instance Method Details

#startObject



17
18
19
20
# File 'lib/activehook/server/send.rb', line 17

def start
  @status = post_hook
  log_status
end

#success?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/activehook/server/send.rb', line 26

def success?
  @status == :success
end

#uriObject



22
23
24
# File 'lib/activehook/server/send.rb', line 22

def uri
  @uri ||= URI.parse(@hook.uri)
end