Class: IB::Messages::Incoming::Alert

Inherits:
Object
  • Object
show all
Defined in:
lib/ib/messages/incoming/alert.rb

Instance Method Summary collapse

Instance Method Details

#error?Boolean

Is it an Error message?

Returns:

  • (Boolean)


13
14
15
# File 'lib/ib/messages/incoming/alert.rb', line 13

def error?
  code < 1000
end

#system?Boolean

Is it a System message?

Returns:

  • (Boolean)


18
19
20
# File 'lib/ib/messages/incoming/alert.rb', line 18

def system?
  code > 1000 && code < 2000
end

#to_humanObject



27
28
29
# File 'lib/ib/messages/incoming/alert.rb', line 27

def to_human
  "TWS #{ error? ? 'Error' : system? ? 'System' : 'Warning'} #{code}: #{message}"
end

#warning?Boolean

Is it a Warning message?

Returns:

  • (Boolean)


23
24
25
# File 'lib/ib/messages/incoming/alert.rb', line 23

def warning?
  code > 2000
end