Sha256: f13f76c2b27b3909e3c7554832acc40ed1ebb90a23b64f6c0262058a87e1aeca

Contents?: true

Size: 538 Bytes

Versions: 1

Compression:

Stored size: 538 Bytes

Contents

module Turnip
  module Execute
    def step(description, *extra_args)
      extra_args.concat(description.extra_args) if description.respond_to?(:extra_args)

      matches = methods.map do |method|
        next unless method.to_s.start_with?("match: ")
        send(method.to_s, description.to_s)
      end.compact
      raise Turnip::Pending, description if matches.length == 0
      raise Turnip::Ambiguous, description if matches.length > 1
      send(matches.first.expression, *(matches.first.params + extra_args))
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
turnip-1.0.0 lib/turnip/execute.rb