module ChefCompat::CopiedFromChef::Chef::Provider::InlineResources::ClassMethods

Public Instance Methods

action(name, &block) click to toggle source
# File files/lib/chef_compat/copied_from_chef/chef/provider.rb, line 135
        def action(name, &block)
          # We need the block directly in a method so that `super` works
          define_method("compile_action_#{name}", &block)
          # We try hard to use `def` because define_method doesn't show the method name in the stack.
          begin
            class_eval <<-EOM
              def action_#{name}
                compile_and_converge_action { compile_action_#{name} }
              end
            EOM
          rescue SyntaxError
            define_method("action_#{name}") { send("compile_action_#{name}") }
          end
        end