Class: HFAM::CommandSet
- Inherits:
-
Object
- Object
- HFAM::CommandSet
- Defined in:
- lib/hfam/command_set.rb
Instance Method Summary collapse
- #dispatch_commands(payload) ⇒ Object
-
#initialize ⇒ CommandSet
constructor
A new instance of CommandSet.
Constructor Details
#initialize ⇒ CommandSet
Returns a new instance of CommandSet.
3 4 5 6 7 8 |
# File 'lib/hfam/command_set.rb', line 3 def initialize @commands = { symlink: ::HFAM::Command::Symlink.new, source: ::HFAM::Command::Source.new } end |
Instance Method Details
#dispatch_commands(payload) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/hfam/command_set.rb', line 10 def dispatch_commands(payload) payload.commands.each_with_index do |command, index| ::HFAM::Logger.error("hfamconfig:#{index + 1} : unknown command '#{command[1][:command]}' with args #{command[1][:args]}") and next if command[0] == :unknown @commands[command[0]].run(command) end end |