Class: Sensi::PollResponse

Inherits:
HashToObject show all
Defined in:
lib/sensi/poll_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from HashToObject

#add, #add_var, #contains_hash, #convert, #from_json!, #to_json

Constructor Details

#initialize(json) ⇒ PollResponse

Returns a new instance of PollResponse.



10
11
12
13
14
15
16
# File 'lib/sensi/poll_response.rb', line 10

def initialize(json)
	@json = json
	convert(json)
	@code = 200
rescue
	@code = 500
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



8
9
10
# File 'lib/sensi/poll_response.rb', line 8

def code
  @code
end

#jsonObject (readonly)

Returns the value of attribute json.



8
9
10
# File 'lib/sensi/poll_response.rb', line 8

def json
  @json
end

Instance Method Details

#groups_tokenObject



22
23
24
25
26
# File 'lib/sensi/poll_response.rb', line 22

def groups_token
	self.g
rescue 
	nil
end

#message_idObject



18
19
20
# File 'lib/sensi/poll_response.rb', line 18

def message_id
	self.c
end

#timed_out?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/sensi/poll_response.rb', line 28

def timed_out?
	respond_to?(:t)
end