Sha256: 91d6348da2e16374349c17704e48d28c39fc21bae3c32db897409edf76b4595f
Contents?: true
Size: 582 Bytes
Versions: 9
Compression:
Stored size: 582 Bytes
Contents
module Gurke class StepDefinition attr_reader :pattern, :method_name, :opts def initialize(pattern, opts = {}) @pattern = pattern @opts = opts end def method_name "#{type.to_s.capitalize} #{pattern}" end def type opts[:type] || :any end def match(name, type = :any) match = pattern.match(name) return unless match return if self.type != :any && self.type != type Match.new(method_name, match.to_a[1..-1]) end class Match < Struct.new(:method_name, :params); end end end
Version data entries
9 entries across 9 versions & 1 rubygems