Sha256: a3c7945b611c827feacfd2016f37396867318fea50fb5ddb337c85362d19dad6

Contents?: true

Size: 273 Bytes

Versions: 11

Compression:

Stored size: 273 Bytes

Contents

require "patternmatching"

include PatternMatching

# Example for matching Hash
dict = build { {:name => "Taro", :age => 5} }
make dict do
  seems as {{:name => :name}} do
    puts "He is " + name
  end
  seems something do
    puts "no name"
  end
end # => "He is Taro"

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
patternmatching-0.1.0 examples/hash_matching.rb
patternmatching-0.2.1 examples/hash_matching.rb
patternmatching-0.1.4 examples/hash_matching.rb
patternmatching-0.2.3 examples/hash_matching.rb
patternmatching-0.1.1 examples/hash_matching.rb
patternmatching-0.1.2 examples/hash_matching.rb
patternmatching-0.1.3 examples/hash_matching.rb
patternmatching-0.2.0 examples/hash_matching.rb
patternmatching-0.2.2 examples/hash_matching.rb
patternmatching-0.2.4 examples/hash_matching.rb
patternmatching-0.2.5 examples/hash_matching.rb