Class: XxxRename::Actions::Resolver

Inherits:
Object
  • Object
show all
Defined in:
lib/xxx_rename/actions/resolver.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Resolver

Returns a new instance of Resolver.



9
10
11
# File 'lib/xxx_rename/actions/resolver.rb', line 9

def initialize(config)
  @config = config
end

Instance Method Details

#resolve!(action) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/xxx_rename/actions/resolver.rb', line 13

def resolve!(action)
  action = action.to_sym
  case action
  when :sync_to_stash
    actions_klass_hash.fetch(action, StashAppPostMovie.new(@config))
  when :log_rename_op
    actions_klass_hash.fetch(action, LogNewFilename.new(@config))
  else
    raise Errors::FatalError, "Unknown action #{action}"
  end
end