module Mobj::MatchEx

Public Instance Methods

method_missing(name, *args, &block) click to toggle source
Calls superclass method
# File lib/ext/match_data.rb, line 8
def method_missing(name, *args, &block)
  if name[-1] == '?' && names.includes?(name[0...-1])
    return to_h[name[0...-1].sym]
  elsif names.includes?(name.to_s)
    return to_h[name.sym]
  end
  super
end
to_h() click to toggle source
# File lib/ext/match_data.rb, line 4
def to_h
  Hash[names.map(&:sym).zip(captures)]
end