Sha256: 262c8389a82bec4160109e8a5ee57bf23e9655ae8beb7a7aae78acd163bee84c

Contents?: true

Size: 342 Bytes

Versions: 11

Compression:

Stored size: 342 Bytes

Contents

module Relevance
  module Tarantula

    class Transform 
      attr_accessor :from, :to
      def initialize(from, to)
        @from = from
        @to = to
      end
      def [](string)
        case to
        when Proc
          string.gsub(from, &to)
        else
          string.gsub(from, to)
        end
      end
    end

  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
codez-tarantula-0.5.5 lib/relevance/tarantula/transform.rb
codez-tarantula-0.5.4 lib/relevance/tarantula/transform.rb
codez-tarantula-0.5.3 lib/relevance/tarantula/transform.rb
codez-tarantula-0.5.1 lib/relevance/tarantula/transform.rb
codez-tarantula-0.5.0 lib/relevance/tarantula/transform.rb
tarantula-0.5.1 lib/relevance/tarantula/transform.rb
tarantula-0.5.0 lib/relevance/tarantula/transform.rb
tarantula-0.4.3 lib/relevance/tarantula/transform.rb
tarantula-0.4.2 lib/relevance/tarantula/transform.rb
tarantula-0.4.1 lib/relevance/tarantula/transform.rb
tarantula-0.4.0 lib/relevance/tarantula/transform.rb