Sha256: 4394930d8fa2fe471ae560966e50d9ab1adb9023b46ab67ff4231ae94152804e

Contents?: true

Size: 258 Bytes

Versions: 33

Compression:

Stored size: 258 Bytes

Contents

class Relevance::Tarantula::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


Version data entries

33 entries across 33 versions & 5 rubygems

Version Path
relevance-tarantula-0.0.1 lib/relevance/tarantula/transform.rb
relevance-tarantula-0.0.2 lib/relevance/tarantula/transform.rb
relevance-tarantula-0.0.3 lib/relevance/tarantula/transform.rb
relevance-tarantula-0.0.5 lib/relevance/tarantula/transform.rb
relevance-tarantula-0.0.6 lib/relevance/tarantula/transform.rb
relevance-tarantula-0.0.7.1 lib/relevance/tarantula/transform.rb
relevance-tarantula-0.0.7 lib/relevance/tarantula/transform.rb
relevance-tarantula-0.0.8.0 lib/relevance/tarantula/transform.rb
relevance-tarantula-0.0.8.1 lib/relevance/tarantula/transform.rb
relevance-tarantula-0.1.0 lib/relevance/tarantula/transform.rb
relevance-tarantula-0.1.1 lib/relevance/tarantula/transform.rb
relevance-tarantula-0.1.2 lib/relevance/tarantula/transform.rb
relevance-tarantula-0.1.3 lib/relevance/tarantula/transform.rb
relevance-tarantula-0.1.4 lib/relevance/tarantula/transform.rb
relevance-tarantula-0.1.5 lib/relevance/tarantula/transform.rb
relevance-tarantula-0.1.6 lib/relevance/tarantula/transform.rb
relevance-tarantula-0.1.7 lib/relevance/tarantula/transform.rb
relevance-tarantula-0.1.8 lib/relevance/tarantula/transform.rb
relevance-tarantula-0.2.0 lib/relevance/tarantula/transform.rb
relevance-tarantula-0.2.1 lib/relevance/tarantula/transform.rb