Class: BuckKnife::Node

Inherits:
Object
  • Object
show all
Includes:
DataAccessor
Defined in:
lib/buckknife/node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DataAccessor

#_read_data, #_write_data, included

Constructor Details

#initialize(name, data) ⇒ Node

Returns a new instance of Node.



6
7
8
9
# File 'lib/buckknife/node.rb', line 6

def initialize(name, data)
  @name = name
  @data = data
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/buckknife/node.rb', line 4

def name
  @name
end

Instance Method Details

#recipesObject



18
19
20
# File 'lib/buckknife/node.rb', line 18

def recipes
  @data["recipes"].split(' ')
end

#rolesObject



14
15
16
# File 'lib/buckknife/node.rb', line 14

def roles
  @data["roles"].split(' ')
end

#run_listObject



22
23
24
# File 'lib/buckknife/node.rb', line 22

def run_list
  BuckKnife::Helper.combine_roles_and_recipes(roles, recipes)
end

#run_list_itemsObject



26
27
28
# File 'lib/buckknife/node.rb', line 26

def run_list_items
  run_list.split(' ')
end