Module: Sfp::Resource

Defined in:
lib/sfpagent/module.rb

Overview

predefined methods: update_state, apply, reset, resolve, resolve_model, resolve_state

Constant Summary collapse

@@resource =
Object.new.extend(Sfp::Resource)

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#modelObject (readonly)

Returns the value of attribute model.



8
9
10
# File 'lib/sfpagent/module.rb', line 8

def model
  @model
end

#parentObject

Returns the value of attribute parent.



7
8
9
# File 'lib/sfpagent/module.rb', line 7

def parent
  @parent
end

#stateObject (readonly)

Returns the value of attribute state.



8
9
10
# File 'lib/sfpagent/module.rb', line 8

def state
  @state
end

#synchronizedObject

Returns the value of attribute synchronized.



7
8
9
# File 'lib/sfpagent/module.rb', line 7

def synchronized
  @synchronized
end

Class Method Details

.resolve(path) ⇒ Object

Helper methods for resource module



26
27
28
# File 'lib/sfpagent/module.rb', line 26

def self.resolve(path)
  @@resource.resolve(path)
end

Instance Method Details

#init(model = {}) ⇒ Object



10
11
12
13
14
# File 'lib/sfpagent/module.rb', line 10

def init(model={})
  @state = {}
  @model = (model.length <= 0 ? {} : Sfp.to_ruby(model))
  @synchronized = []
end

#update_stateObject



16
17
18
# File 'lib/sfpagent/module.rb', line 16

def update_state
  @state = {}
end