Class: Patch::Patch
- Inherits:
-
Object
- Object
- Patch::Patch
- Defined in:
- lib/patch/patch.rb
Overview
A single patch consisting of a node mapping and actions
Instance Attribute Summary collapse
-
#actions ⇒ Object
readonly
Returns the value of attribute actions.
-
#maps ⇒ Object
readonly
Returns the value of attribute maps.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#enable ⇒ Boolean
Enable the given nodes to implement this patch.
-
#initialize(name, maps, actions) ⇒ Patch
constructor
A new instance of Patch.
Constructor Details
#initialize(name, maps, actions) ⇒ Patch
Returns a new instance of Patch.
11 12 13 14 |
# File 'lib/patch/patch.rb', line 11 def initialize(name, maps, actions) @name = name populate(maps, actions) end |
Instance Attribute Details
#actions ⇒ Object (readonly)
Returns the value of attribute actions.
6 7 8 |
# File 'lib/patch/patch.rb', line 6 def actions @actions end |
#maps ⇒ Object (readonly)
Returns the value of attribute maps.
6 7 8 |
# File 'lib/patch/patch.rb', line 6 def maps @maps end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/patch/patch.rb', line 6 def name @name end |
Instance Method Details
#enable ⇒ Boolean
Enable the given nodes to implement this patch
19 20 21 22 |
# File 'lib/patch/patch.rb', line 19 def enable result = @maps.map { |map| map.enable(self) } result.any? end |