Class: Marley::Joints::Joint
- Extended by:
- Utils::ClassAttrs
- Defined in:
- lib/marley/joint.rb
Instance Attribute Summary collapse
-
#opts ⇒ Object
Returns the value of attribute opts.
Instance Method Summary collapse
- #config(opts) ⇒ Object
-
#initialize(opts = {}) ⇒ Joint
constructor
A new instance of Joint.
- #smoke ⇒ Object
Methods included from Utils::ClassAttrs
Constructor Details
#initialize(opts = {}) ⇒ Joint
Returns a new instance of Joint.
10 11 12 |
# File 'lib/marley/joint.rb', line 10 def initialize(opts={}) config(opts) end |
Instance Attribute Details
#opts ⇒ Object
Returns the value of attribute opts.
9 10 11 |
# File 'lib/marley/joint.rb', line 9 def opts @opts end |
Instance Method Details
#config(opts) ⇒ Object
26 27 28 |
# File 'lib/marley/joint.rb', line 26 def config(opts) @opts=(@opts || self.class.default_opts || {}).merge(opts) end |
#smoke ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/marley/joint.rb', line 13 def smoke @opts[:required_joints].to_a.each do |j| Marley.joint(j) end resources=self.class::Resources resources.constants.each do |resource_name| @opts[:plugins].to_a.each do |plugin_name| Marley.plugin(plugin_name).apply(resources.const_get(resource_name)) end MR.const_set(resource_name, resources.const_get(resource_name)) unless (@opts[:resources] && ! @opts[:resources].include?(resource_name) ) end self end |