module Hash::DynamicMatcher

Private Instance Methods

finder() click to toggle source
# File lib/jsable_hash/dynamic_matcher.rb, line 22
def finder
  'fetch'
end
match(name) click to toggle source
# File lib/jsable_hash/dynamic_matcher.rb, line 12
def match(name)
  return name.to_s if send(matcher, name.to_s)
  return name.to_sym if send(matcher, name.to_sym)
  nil
end
matcher() click to toggle source
# File lib/jsable_hash/dynamic_matcher.rb, line 18
def matcher
  'has_key?'
end
method_missing(name, *args, &block) click to toggle source
Calls superclass method
# File lib/jsable_hash/dynamic_matcher.rb, line 5
def method_missing(name, *args, &block)
  t_key = match(name)

  return send(finder, t_key) if t_key
  super
end