Sha256: f2837089b023c90c070264aeb6db9d5938191096b25b0143049b214c1fb9e027

Contents?: true

Size: 619 Bytes

Versions: 10

Compression:

Stored size: 619 Bytes

Contents

module Lucid
  module WireSupport
    class WireStepDefinition
      attr_reader :regexp_source, :file_colon_line

      def initialize(connection, data)
        @connection = connection
        @id              = data['id']
        @regexp_source   = data['regexp'] || "Unknown"
        @file_colon_line = data['source'] || "Unknown"
      end

      def invoke(args)
        prepared_args = args.map{ |arg| prepare(arg) }
        @connection.invoke(@id, prepared_args)
      end

      private

      def prepare(arg)
        return arg unless arg.is_a?(Lucid::AST::Table)
        arg.raw
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
lucid-0.3.0 lib/lucid/wire_support/wire_step_definition.rb
lucid-0.2.1 lib/lucid/wire_support/wire_step_definition.rb
lucid-0.2.0 lib/lucid/wire_support/wire_step_definition.rb
lucid-0.1.1 lib/lucid/wire_support/wire_step_definition.rb
lucid-0.1.0 lib/lucid/wire_support/wire_step_definition.rb
lucid-0.0.9 lib/lucid/wire_support/wire_step_definition.rb
lucid-0.0.8 lib/lucid/wire_support/wire_step_definition.rb
lucid-0.0.7 lib/lucid/wire_support/wire_step_definition.rb
lucid-0.0.6 lib/lucid/wire_support/wire_step_definition.rb
lucid-0.0.5 lib/lucid/wire_support/wire_step_definition.rb