Sha256: 8c6088b9276ffd494bf22936b9932c5457aa40b9024a371b0746dae122f067b1

Contents?: true

Size: 444 Bytes

Versions: 6

Compression:

Stored size: 444 Bytes

Contents

# frozen_string_literal: true

module Grumlin
  module Tools
    module Tool
      def define_steps(steps, tool_name)
        steps.each do |step|
          self.class.define_method step do
            name = "@#{step}"
            return instance_variable_get(name) if instance_variable_defined?(name)

            instance_variable_set(name, TypedValue.new(type: tool_name, value: step))
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
grumlin-0.12.5 lib/grumlin/tools/tool.rb
grumlin-0.12.4 lib/grumlin/tools/tool.rb
grumlin-0.12.3 lib/grumlin/tools/tool.rb
grumlin-0.12.2 lib/grumlin/tools/tool.rb
grumlin-0.12.1 lib/grumlin/tools/tool.rb
grumlin-0.12.0 lib/grumlin/tools/tool.rb