Class: Mysql::BinLogPositionFile

Inherits:
Object
  • Object
show all
Defined in:
lib/flydata/fluent-plugins/mysql/binlog_position_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ BinLogPositionFile

Returns a new instance of BinLogPositionFile.



5
6
7
# File 'lib/flydata/fluent-plugins/mysql/binlog_position_file.rb', line 5

def initialize(path)
  @path = path
end

Instance Attribute Details

#pathObject

Returns the value of attribute path.



3
4
5
# File 'lib/flydata/fluent-plugins/mysql/binlog_position_file.rb', line 3

def path
  @path
end

Instance Method Details

#exists?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/flydata/fluent-plugins/mysql/binlog_position_file.rb', line 9

def exists?
  File.exists?(@path)
end

#readObject



13
14
15
# File 'lib/flydata/fluent-plugins/mysql/binlog_position_file.rb', line 13

def read
  File.open(@path) {|f| f.read }
end