Sha256: 286f4705e9b5559313bb67dc123caa3d64f7d19df746cc5d7ed2cac578ffe868

Contents?: true

Size: 450 Bytes

Versions: 5

Compression:

Stored size: 450 Bytes

Contents

# frozen_string_literal: true

module Grumlin
  module Expressions
    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

5 entries across 5 versions & 1 rubygems

Version Path
grumlin-0.14.2 lib/grumlin/expressions/tool.rb
grumlin-0.14.1 lib/grumlin/expressions/tool.rb
grumlin-0.14.0 lib/grumlin/expressions/tool.rb
grumlin-0.13.1 lib/grumlin/expressions/tool.rb
grumlin-0.13.0 lib/grumlin/expressions/tool.rb