lib/peeky/predicates/attr_reader_predicate.rb
# Match will return true if the method_info seems to be an :attr_reader
#
# @param instance [Object] instance the object that has this method (required)
# @param method_info [String] method info (required)
Match will return true if the method_info seems to be an :attr_reader
Match will return true if the method_info seems to be an : attr_reader
def prerequisites(instance, method_info)
        return false if %w[! ? =].include?(method_info.name.to_s[-1..-1])
        return false unless method_info.parameters.length.zero?
        return false unless instance.respond_to?(method_info.name)
        true
      end
def prerequisites ( instance , method_info ) return false if %w[ ! ? = ] . include? ( method_info . name . to_s [ - 1 .. - 1 ] ) return false unless method_info . parameters . length . zero? return false unless instance . respond_to? ( method_info . name ) true end
Match will return true if the method_info seems to be an :attr_reader
Match will return true if the method_info seems to be an : attr_reader
# look for obvious NON :attr_reader patterns
instance
instance the object that has this method (required)
instance the object that has this method ( required )
method_info
method info (required)
method info ( required )