Class: VoiceCom::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/voice_com/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) {|_self| ... } ⇒ Response

Returns a new instance of Response.

Yields:

  • (_self)

Yield Parameters:



7
8
9
10
11
12
# File 'lib/voice_com/response.rb', line 7

def initialize(args = {})
  args.each {|k,v| instance_variable_set("@#{k.strip}", v)}
  yield self if block_given?
  validate!
  parse_answer
end

Instance Attribute Details

#answerObject

Returns the value of attribute answer.



4
5
6
# File 'lib/voice_com/response.rb', line 4

def answer
  @answer
end

#answer_hashObject (readonly)

Returns the value of attribute answer_hash.



5
6
7
# File 'lib/voice_com/response.rb', line 5

def answer_hash
  @answer_hash
end

#dlrObject

Returns the value of attribute dlr.



4
5
6
# File 'lib/voice_com/response.rb', line 4

def dlr
  @dlr
end

#fromObject

Returns the value of attribute from.



4
5
6
# File 'lib/voice_com/response.rb', line 4

def from
  @from
end

#sidObject

Returns the value of attribute sid.



4
5
6
# File 'lib/voice_com/response.rb', line 4

def sid
  @sid
end

#smsIDObject

Returns the value of attribute smsID.



4
5
6
# File 'lib/voice_com/response.rb', line 4

def smsID
  @smsID
end

#toObject

Returns the value of attribute to.



4
5
6
# File 'lib/voice_com/response.rb', line 4

def to
  @to
end

#tsObject

Returns the value of attribute ts.



4
5
6
# File 'lib/voice_com/response.rb', line 4

def ts
  @ts
end

#voicecom_idObject

Returns the value of attribute voicecom_id.



4
5
6
# File 'lib/voice_com/response.rb', line 4

def voicecom_id
  @voicecom_id
end

Instance Method Details

#get_answerObject



22
23
24
# File 'lib/voice_com/response.rb', line 22

def get_answer
  Hash[@answer.split("+").map{|x| x.split(":")}]
end

#parse_answerObject



18
19
20
# File 'lib/voice_com/response.rb', line 18

def parse_answer
  @answer_hash = get_answer
end

#sms_idObject



14
15
16
# File 'lib/voice_com/response.rb', line 14

def sms_id
  @dlr
end

#success?Boolean

Returns:

  • (Boolean)


27
28
29
30
31
32
# File 'lib/voice_com/response.rb', line 27

def success?
  
  #in que to be implemented
  true 

end