Class: GreenByPhone::Response

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Response

Returns a new instance of Response.



17
18
19
20
21
22
23
24
# File 'lib/green_by_phone/response.rb', line 17

def initialize(options = {})
  @result = options[:result]
  @result_description = options[:result_escription]
  @verify_result = options[:verify_result]
  @verify_result_description = options[:verify_result_description]
  @check_number = options[:check_number]
  @check_id = options[:check_id]
end

Instance Attribute Details

#check_idObject (readonly)

Returns the value of attribute check_id.



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

def check_id
  @check_id
end

#check_numberObject (readonly)

Returns the value of attribute check_number.



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

def check_number
  @check_number
end

#resultObject (readonly)

Returns the value of attribute result.



3
4
5
# File 'lib/green_by_phone/response.rb', line 3

def result
  @result
end

#result_descriptionObject (readonly)

Returns the value of attribute result_description.



3
4
5
# File 'lib/green_by_phone/response.rb', line 3

def result_description
  @result_description
end

#verify_resultObject (readonly)

Returns the value of attribute verify_result.



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

def verify_result
  @verify_result
end

#verify_result_descriptionObject (readonly)

Returns the value of attribute verify_result_description.



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

def verify_result_description
  @verify_result_description
end

Class Method Details

.new_from_request(options = {}) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/green_by_phone/response.rb', line 7

def self.new_from_request(options = {})
  self.new(
    :result => options['Result'],
    :result_description => options['ResultDescription'],
    :verify_result => options['VerifyResult'],
    :verify_result_description => options['VerifyResultDescription'],
    :check_number => options['CheckNumber'],
    :check_id => options['Check_ID'])
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/green_by_phone/response.rb', line 26

def success?
  @result == 0 && @verification_result == 0
end