Class: TDDMode

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

Instance Method Summary collapse

Methods inherited from ReturnStatus

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

Constructor Details

#initialize(command, response) ⇒ TDDMode

Returns a new instance of TDDMode.



45
46
47
# File 'lib/ruby-agi/rs/tdd_mode.rb', line 45

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

Instance Method Details

#capable?Boolean

Returns:

  • (Boolean)


73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/ruby-agi/rs/tdd_mode.rb', line 73

def capable?
	if @is_capable.nil?
		if result == '0'
			@is_capable = false
			@is_success = false
			@is_failure = true
		else
			@is_capable = true
		end
	end
	
	return @is_capable
end

#error?Boolean

Returns:

  • (Boolean)


87
88
89
# File 'lib/ruby-agi/rs/tdd_mode.rb', line 87

def error?
	return command_error?
end

#failure?Boolean

Returns:

  • (Boolean)


61
62
63
64
65
66
67
68
69
70
71
# File 'lib/ruby-agi/rs/tdd_mode.rb', line 61

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

	return @is_failure
end

#responseObject



91
92
93
# File 'lib/ruby-agi/rs/tdd_mode.rb', line 91

def response
	return message
end

#success?Boolean

Returns:

  • (Boolean)


49
50
51
52
53
54
55
56
57
58
59
# File 'lib/ruby-agi/rs/tdd_mode.rb', line 49

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

	return @is_success
end