class Missingly::RegexDelegateMatcher

Attributes

delegate_name[R]
options[R]
regex[R]

Public Class Methods

new(regex, options, delegate_name) click to toggle source
# File lib/missingly/regex_delegate_matcher.rb, line 5
def initialize(regex, options, delegate_name)
  @regex, @options, @delegate_name = regex, options, delegate_name
end

Public Instance Methods

matchable() click to toggle source
# File lib/missingly/regex_delegate_matcher.rb, line 15
def matchable; regex; end
should_respond_to?(instance, name) click to toggle source
# File lib/missingly/regex_delegate_matcher.rb, line 9
def should_respond_to?(instance, name)
  matches = regex.match name
  delegate_responds_to = instance.send(delegate_name).respond_to?(name)
  matches && delegate_responds_to
end