Sha256: 258ea534a588182bd1efbf9d3e7c581aedb35d74c9f573c7d0dd150c0e279e31

Contents?: true

Size: 436 Bytes

Versions: 6

Compression:

Stored size: 436 Bytes

Contents

# https://github.com/rails/rails/edit/master/activesupport/lib/active_support/string_inquirer.rb
module A9n
  class StringInquirer < String
    private

    def respond_to_missing?(method_name, include_private = false)
      (method_name[-1] == '?') || super
    end

    def method_missing(method_name, *arguments)
      if method_name[-1] == '?'
        self == method_name[0..-2]
      else
        super
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
a9n-0.9.1 lib/a9n/ext/string_inquirer.rb
a9n-0.9.0 lib/a9n/ext/string_inquirer.rb
a9n-0.8.3 lib/a9n/ext/string_inquirer.rb
a9n-0.8.2 lib/a9n/ext/string_inquirer.rb
a9n-0.8.0 lib/a9n/ext/string_inquirer.rb
a9n-0.7.0 lib/a9n/ext/string_inquirer.rb