Class: WhoCan::Responder::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/who_can/responder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(header, payload) ⇒ Response

Returns a new instance of Response.



13
14
15
16
17
# File 'lib/who_can/responder.rb', line 13

def initialize(header, payload)
  @header, @payload = header, payload
  @response = ''
  @do_not_respond = false
end

Instance Attribute Details

#delayObject

Returns the value of attribute delay.



9
10
11
# File 'lib/who_can/responder.rb', line 9

def delay
  @delay
end

#do_not_respondObject

Returns the value of attribute do_not_respond.



11
12
13
# File 'lib/who_can/responder.rb', line 11

def do_not_respond
  @do_not_respond
end

#headerObject (readonly)

Returns the value of attribute header.



9
10
11
# File 'lib/who_can/responder.rb', line 9

def header
  @header
end

#payloadObject (readonly)

Returns the value of attribute payload.



9
10
11
# File 'lib/who_can/responder.rb', line 9

def payload
  @payload
end

#responseObject

Returns the value of attribute response.



9
10
11
# File 'lib/who_can/responder.rb', line 9

def response
  @response
end

Instance Method Details

#validate!Object



31
32
33
# File 'lib/who_can/responder.rb', line 31

def validate!
  raise DelayMustBeSetError unless delay
end