Class: Mysql::BinLogPosition
- Inherits:
-
Object
- Object
- Mysql::BinLogPosition
- Includes:
- Comparable
- Defined in:
- lib/flydata/fluent-plugins/mysql/binlog_position.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#pos ⇒ Object
Returns the value of attribute pos.
Instance Method Summary collapse
- #<=>(obj) ⇒ Object
-
#initialize(binlog_content) ⇒ BinLogPosition
constructor
A new instance of BinLogPosition.
- #to_s ⇒ Object
Constructor Details
#initialize(binlog_content) ⇒ BinLogPosition
Returns a new instance of BinLogPosition.
6 7 8 9 10 |
# File 'lib/flydata/fluent-plugins/mysql/binlog_position.rb', line 6 def initialize(binlog_content) items = binlog_content.split("\t") @file = items[0] @pos = items[1].to_i end |
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
4 5 6 |
# File 'lib/flydata/fluent-plugins/mysql/binlog_position.rb', line 4 def file @file end |
#pos ⇒ Object
Returns the value of attribute pos.
4 5 6 |
# File 'lib/flydata/fluent-plugins/mysql/binlog_position.rb', line 4 def pos @pos end |
Instance Method Details
#<=>(obj) ⇒ Object
12 13 14 |
# File 'lib/flydata/fluent-plugins/mysql/binlog_position.rb', line 12 def <=>(obj) (self.file <=> obj.file) == 0 ? (self.pos <=> obj.pos) : (self.file <=> obj.file) end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/flydata/fluent-plugins/mysql/binlog_position.rb', line 16 def to_s "#{file}\t#{pos}" end |