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
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#synchronized ⇒ Object
Returns the value of attribute synchronized.
Class Method Summary collapse
-
.resolve(path) ⇒ Object
Helper methods for resource module.
Instance Method Summary collapse
Instance Attribute Details
#model ⇒ Object (readonly)
Returns the value of attribute model.
8 9 10 |
# File 'lib/sfpagent/module.rb', line 8 def model @model end |
#parent ⇒ Object
Returns the value of attribute parent.
7 8 9 |
# File 'lib/sfpagent/module.rb', line 7 def parent @parent end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
8 9 10 |
# File 'lib/sfpagent/module.rb', line 8 def state @state end |
#synchronized ⇒ Object
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_state ⇒ Object
16 17 18 |
# File 'lib/sfpagent/module.rb', line 16 def update_state @state = {} end |