class PatternMatch::PatternValue

Public Class Methods

new(val, compare_by = :===) click to toggle source
Calls superclass method PatternMatch::Pattern::new
# File lib/pattern-match/core.rb, line 297
def initialize(val, compare_by = :===)
  super()
  @val = val
  @compare_by = compare_by
end

Public Instance Methods

inspect() click to toggle source
# File lib/pattern-match/core.rb, line 309
def inspect
  "#<#{self.class.name}: val=#{@val.inspect}>"
end
match(vals) click to toggle source
Calls superclass method PatternMatch::Pattern#match
# File lib/pattern-match/core.rb, line 303
def match(vals)
  super do |val|
    @val.__send__(@compare_by, val)
  end
end