class Terrafying::State::LocalStateStore

Public Class Methods

has_local_state?(config) click to toggle source
# File lib/terrafying/state.rb, line 42
def self.has_local_state?(config)
  File.exist?(state_path(config.path))
end
new(path) click to toggle source
# File lib/terrafying/state.rb, line 26
def initialize(path)
  @path = LocalStateStore.state_path(path)
end

Private Class Methods

state_path(path) click to toggle source
# File lib/terrafying/state.rb, line 48
def self.state_path(path)
  File.join(File.dirname(path), STATE_FILENAME)
end

Public Instance Methods

delete() click to toggle source
# File lib/terrafying/state.rb, line 38
def delete
  File.delete(@path)
end
get() click to toggle source
# File lib/terrafying/state.rb, line 30
def get
  IO.read(@path)
end
put(state) click to toggle source
# File lib/terrafying/state.rb, line 34
def put(state)
  IO.write(@path, state)
end