Class: BuckKnife::Commands::AddRole

Inherits:
Struct
  • Object
show all
Includes:
Base
Defined in:
lib/buckknife/commands/add_role.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Base

#base_run_list, #build_run_list, #to_s

Instance Attribute Details

#nodeObject

Returns the value of attribute node

Returns:

  • (Object)

    the current value of node



3
4
5
# File 'lib/buckknife/commands/add_role.rb', line 3

def node
  @node
end

Instance Method Details

#commandObject



6
7
8
9
10
# File 'lib/buckknife/commands/add_role.rb', line 6

def command
  node.run_list_items.map do |item|
    Command.new('knife').arg('node', 'run_list', 'add', node.name, item)
  end.join("\n")
end