Sha256: 7881bc4e30dfcca10a44cb7e5c74976b909045821b3c2fed039175e2bb539a35

Contents?: true

Size: 301 Bytes

Versions: 21

Compression:

Stored size: 301 Bytes

Contents

class String
    
  ##
  # Replace +hash+ keys with associated values.
  
  def tokenize! hash = {}
    hash.each { |key, value| gsub! /:#{key}/, value.to_s }
    self
  end
    
  ##
  # Replace +hash+ keys with associated values.
  
  def tokenize hash = {}
    self.dup.tokenize! hash
  end
  
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
visionmedia-commander-3.0.0 lib/commander/core_ext/string.rb
visionmedia-commander-3.0.1 lib/commander/core_ext/string.rb
visionmedia-commander-3.0.2 lib/commander/core_ext/string.rb
visionmedia-commander-3.0.3 lib/commander/core_ext/string.rb
visionmedia-commander-3.1.0 lib/commander/core_ext/string.rb
visionmedia-commander-3.1.1 lib/commander/core_ext/string.rb
visionmedia-commander-3.1.2 lib/commander/core_ext/string.rb
visionmedia-commander-3.1.4 lib/commander/core_ext/string.rb
visionmedia-commander-3.1.5 lib/commander/core_ext/string.rb
visionmedia-commander-3.1.6 lib/commander/core_ext/string.rb
visionmedia-commander-3.1.7 lib/commander/core_ext/string.rb
visionmedia-commander-3.1.8 lib/commander/core_ext/string.rb
visionmedia-commander-3.2.0 lib/commander/core_ext/string.rb
visionmedia-commander-3.2.2 lib/commander/core_ext/string.rb
visionmedia-commander-3.2.3 lib/commander/core_ext/string.rb
visionmedia-commander-3.2.4 lib/commander/core_ext/string.rb
visionmedia-commander-3.2.5 lib/commander/core_ext/string.rb
visionmedia-commander-3.2.6 lib/commander/core_ext/string.rb
visionmedia-commander-3.2.7 lib/commander/core_ext/string.rb
visionmedia-commander-3.2.8 lib/commander/core_ext/string.rb