Class: Souffle::Node::RunListItem
- Inherits:
-
Object
- Object
- Souffle::Node::RunListItem
- Defined in:
- lib/souffle/node/runlist_item.rb
Overview
A single runlist item, most be parsed and either a recipe or role.
Instance Method Summary collapse
-
#==(runlist_item) ⇒ Boolean
Overriding the default equality comparator to use string representation.
-
#eql?(runlist_item) ⇒ Boolean
Overriding the default equality comparator to use string representation.
-
#initialize(item = nil) ⇒ RunListItem
constructor
Creates a new runlist item from a string.
-
#name ⇒ String
Returns the name of the runlist item.
-
#to_s ⇒ Object
Returns the RunListItem as it’s original string.
-
#type ⇒ String
Returns the type of the runlist item.
Constructor Details
#initialize(item = nil) ⇒ RunListItem
Creates a new runlist item from a string.
the runlist item or type isn’t a proper chef role or recipe.
11 12 13 14 |
# File 'lib/souffle/node/runlist_item.rb', line 11 def initialize(item=nil) @original_item = item @item = Souffle::Node::RunListParser.parse(item) end |
Instance Method Details
#==(runlist_item) ⇒ Boolean
Overriding the default equality comparator to use string representation.
40 41 42 |
# File 'lib/souffle/node/runlist_item.rb', line 40 def ==(runlist_item) self.to_s == runlist_item.to_s end |
#eql?(runlist_item) ⇒ Boolean
Overriding the default equality comparator to use string representation.
49 50 51 |
# File 'lib/souffle/node/runlist_item.rb', line 49 def eql?(runlist_item) self.to_s == runlist_item.to_s end |
#name ⇒ String
Returns the name of the runlist item.
19 20 21 |
# File 'lib/souffle/node/runlist_item.rb', line 19 def name @item["name"] end |
#to_s ⇒ Object
Returns the RunListItem as it’s original string.
31 32 33 |
# File 'lib/souffle/node/runlist_item.rb', line 31 def to_s @original_item end |
#type ⇒ String
Returns the type of the runlist item.
26 27 28 |
# File 'lib/souffle/node/runlist_item.rb', line 26 def type @item["type"] end |