Class: Flydata::Helper::Action::ActionPosition

Inherits:
Object
  • Object
show all
Includes:
Util::FileUtil
Defined in:
lib/flydata/helper/action/check_remote_actions.rb

Instance Method Summary collapse

Methods included from Util::FileUtil

#read_line, #tail, #write_line

Constructor Details

#initialize(config) ⇒ ActionPosition

Returns a new instance of ActionPosition.


42
43
44
# File 'lib/flydata/helper/action/check_remote_actions.rb', line 42

def initialize(config)
  @path = config.helper_action_position_path
end

Instance Method Details

#loadObject


48
49
50
# File 'lib/flydata/helper/action/check_remote_actions.rb', line 48

def load
  read_line(@path).to_i
end

#save(position) ⇒ Object


45
46
47
# File 'lib/flydata/helper/action/check_remote_actions.rb', line 45

def save(position)
  write_line(@path, position.to_s)
end