Class: Kodama::Client::BinlogInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/kodama/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename = nil, position = nil) ⇒ BinlogInfo

Returns a new instance of BinlogInfo.



183
184
185
186
# File 'lib/kodama/client.rb', line 183

def initialize(filename = nil, position = nil)
  @filename = filename
  @position = position
end

Instance Attribute Details

#filenameObject

Returns the value of attribute filename.



181
182
183
# File 'lib/kodama/client.rb', line 181

def filename
  @filename
end

#positionObject

Returns the value of attribute position.



181
182
183
# File 'lib/kodama/client.rb', line 181

def position
  @position
end

Instance Method Details

#load!(position_file) ⇒ Object



198
199
200
# File 'lib/kodama/client.rb', line 198

def load!(position_file)
  @filename, @position = position_file.read
end

#save(position_file = nil) ⇒ Object



192
193
194
195
196
# File 'lib/kodama/client.rb', line 192

def save(position_file = nil)
  if position_file
    position_file.update(@filename, @position)
  end
end

#valid?Boolean

Returns:

  • (Boolean)


188
189
190
# File 'lib/kodama/client.rb', line 188

def valid?
  @filename && @position
end