Sha256: 83e03123a15b943c609e3cd750132ce02f79836584b6ee07b998b27e4eb875aa
Contents?: true
Size: 384 Bytes
Versions: 11
Compression:
Stored size: 384 Bytes
Contents
require "patternmatching" include PatternMatching class Person def initialize(name, age) @name = name @age = age end attr :name attr :age end # Example for matching Object except Hash person = Person.new("Jiro", 3) make person do seems as {{:name => :name}} do puts "He is " + name end seems something do puts "no name" end end # => "He is Jiro"
Version data entries
11 entries across 11 versions & 1 rubygems