Class: Hangup

Inherits:
ReturnStatus show all
Defined in:
lib/ruby-agi/rs/hangup.rb

Instance Method Summary collapse

Methods inherited from ReturnStatus

#command, #command_error?, #message, #result, #return_code, #to_s

Constructor Details

#initialize(command, response) ⇒ Hangup

Returns a new instance of Hangup.



40
41
42
# File 'lib/ruby-agi/rs/hangup.rb', line 40

def initialize(command, response)
  super(command, response)
end

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


68
69
70
# File 'lib/ruby-agi/rs/hangup.rb', line 68

def error?
  return command_error?
end

#failure?Boolean

Returns:

  • (Boolean)


56
57
58
59
60
61
62
63
64
65
66
# File 'lib/ruby-agi/rs/hangup.rb', line 56

def failure?
  if @is_failure.nil?
    if result == '-1'
      @is_failure = true
    else
      @is_failure = false
    end 
  end

  return @is_failure
end

#responseObject



72
73
74
# File 'lib/ruby-agi/rs/hangup.rb', line 72

def response
  return message
end

#success?Boolean

Returns:

  • (Boolean)


44
45
46
47
48
49
50
51
52
53
54
# File 'lib/ruby-agi/rs/hangup.rb', line 44

def success?
  if @is_success.nil?
    if result == '1'
      @is_success = true
    else
      @is_success = false
    end 
  end

  return @is_success
end