Class: IB::Messages::Incoming::Alert
- Defined in:
- lib/ib/messages/incoming/alert.rb
Instance Method Summary collapse
-
#error? ⇒ Boolean
Is it an Error message?.
-
#system? ⇒ Boolean
Is it a System message?.
- #to_human ⇒ Object
-
#warning? ⇒ Boolean
Is it a Warning message?.
Instance Method Details
#error? ⇒ Boolean
Is it an Error message?
13 14 15 |
# File 'lib/ib/messages/incoming/alert.rb', line 13 def error? code < 1000 end |
#system? ⇒ Boolean
Is it a System message?
18 19 20 |
# File 'lib/ib/messages/incoming/alert.rb', line 18 def system? code > 1000 && code < 2000 end |
#to_human ⇒ Object
27 28 29 |
# File 'lib/ib/messages/incoming/alert.rb', line 27 def to_human "TWS #{ error? ? 'Error' : system? ? 'System' : 'Warning'} #{code}: #{}" end |
#warning? ⇒ Boolean
Is it a Warning message?
23 24 25 |
# File 'lib/ib/messages/incoming/alert.rb', line 23 def warning? code > 2000 end |