Class: Kodama::Client::BinlogInfo
- Inherits:
-
Object
- Object
- Kodama::Client::BinlogInfo
- Defined in:
- lib/kodama/client.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#position ⇒ Object
Returns the value of attribute position.
Instance Method Summary collapse
-
#initialize(filename = nil, position = nil) ⇒ BinlogInfo
constructor
A new instance of BinlogInfo.
- #load!(position_file) ⇒ Object
- #save(position_file = nil) ⇒ Object
- #valid? ⇒ Boolean
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
#filename ⇒ Object
Returns the value of attribute filename.
181 182 183 |
# File 'lib/kodama/client.rb', line 181 def filename @filename end |
#position ⇒ Object
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
188 189 190 |
# File 'lib/kodama/client.rb', line 188 def valid? @filename && @position end |