Class: Outbound::Result

Inherits:
Object
  • Object
show all
Includes:
Defaults
Defined in:
lib/outbound.rb

Constant Summary

Constants included from Defaults

Defaults::HEADERS

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error, received_call) ⇒ Result

Returns a new instance of Result.



77
78
79
80
# File 'lib/outbound.rb', line 77

def initialize error, received_call
  @error = error
  @received_call = received_call
end

Instance Attribute Details

#errorObject

Returns the value of attribute error.



82
83
84
# File 'lib/outbound.rb', line 82

def error
  @error
end

#received_callObject

Returns the value of attribute received_call.



83
84
85
# File 'lib/outbound.rb', line 83

def received_call
  @received_call
end

Instance Method Details

#connection_error?Boolean

Returns:

  • (Boolean)


97
98
99
# File 'lib/outbound.rb', line 97

def connection_error?
  return @error == Outbound::ERROR_CONNECTION
end

#event_name_error?Boolean

Returns:

  • (Boolean)


93
94
95
# File 'lib/outbound.rb', line 93

def event_name_error?
  return @error == Outbound::ERROR_EVENT_NAME
end

#init_error?Boolean

Returns:

  • (Boolean)


101
102
103
# File 'lib/outbound.rb', line 101

def init_error?
  return @error == Outbound::ERROR_INIT
end

#platform_error?Boolean

Returns:

  • (Boolean)


109
110
111
# File 'lib/outbound.rb', line 109

def platform_error?
  return @error == Outbound::ERROR_PLATFORM
end

#success?Boolean

Returns:

  • (Boolean)


85
86
87
# File 'lib/outbound.rb', line 85

def success?
  return @received_call && @error == nil
end

#token_error?Boolean

Returns:

  • (Boolean)


105
106
107
# File 'lib/outbound.rb', line 105

def token_error?
  return @error == Outbound::ERROR_TOKEN
end

#user_id_error?Boolean

Returns:

  • (Boolean)


89
90
91
# File 'lib/outbound.rb', line 89

def user_id_error?
  return @error == Outbound::ERROR_USER_ID
end