Class: FSSM::State

Inherits:
Object
  • Object
show all
Defined in:
lib/fssm/state.rb

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ State

Returns a new instance of State.



3
4
5
6
# File 'lib/fssm/state.rb', line 3

def initialize(path)
  @path = path
  @cache = FSSM::Tree::Cache.new
end

Instance Method Details

#refresh(base = nil, skip_callbacks = false) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/fssm/state.rb', line 8

def refresh(base=nil, skip_callbacks=false)
  previous, current = recache(base || @path.to_pathname)

  unless skip_callbacks
    deleted(previous, current)
    created(previous, current)
    modified(previous, current)
  end
end