Sha256: 7c4d8643a8ac11ac7bb30ef8cb4173ec2a8d50243844c4ba717f014bc2a7eedf
Contents?: true
Size: 969 Bytes
Versions: 25
Compression:
Stored size: 969 Bytes
Contents
module IB module Messages module Incoming # Called Error in Java code, but in fact this type of messages also # deliver system alerts and additional (non-error) info from TWS. ErrorMessage = Error = Alert = def_message([4, 2], [:error_id, :int], [:code, :int], [:message, :string]) class Alert # Is it an Error message? def error? code < 1000 end # Is it a System message? def system? code > 1000 && code < 2000 end # Is it a Warning message? def warning? code > 2000 end def to_human "TWS #{ error? ? 'Error' : system? ? 'System' : 'Warning'} #{code}: #{message}" end end # class Alert end # module Incoming end # module Messages end # module IB
Version data entries
25 entries across 25 versions & 3 rubygems