Repository URL to install this package:
|
Version:
7.3.3 ▾
|
# frozen_string_literal: true
# Attribute Matchers from sinatra-base
module AttributeMatchers
def _has_attribute_with_value?(name, matcher)
matcher === self[name] # rubocop:disable Style/CaseEquality
end
def _has_attribute?(name)
!self[name].nil?
end
# NB: has_attributes? is built in *somewhere*
def has_attribute?(*attributes, **attribute_values) # rubocop:disable Naming/PredicatePrefix
attributes.all? { |name| _has_attribute? name } &&
attribute_values.all? { |name, value| _has_attribute_with_value? name, value }
end
end