2014-07-03 21:16:12 +00:00
|
|
|
module Mutant
|
|
|
|
class Matcher
|
2015-07-07 19:41:12 +00:00
|
|
|
# Subject matcher configuration
|
2014-07-03 21:16:12 +00:00
|
|
|
class Config
|
|
|
|
include Adamantium, Anima::Update, Anima.new(
|
|
|
|
:match_expressions,
|
2015-07-07 19:41:12 +00:00
|
|
|
:ignore_expressions
|
2014-07-03 21:16:12 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
DEFAULT = new(Hash[anima.attribute_names.map { |name| [name, []] }])
|
|
|
|
|
2015-07-03 15:21:39 +00:00
|
|
|
# Add value to configurable collection
|
2014-07-03 21:16:12 +00:00
|
|
|
#
|
|
|
|
# @param [Symbol] attribute
|
|
|
|
# @param [Object] value
|
|
|
|
#
|
|
|
|
# @return [Config]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
def add(attribute, value)
|
|
|
|
update(attribute => public_send(attribute).dup << value)
|
|
|
|
end
|
|
|
|
|
|
|
|
end # Config
|
|
|
|
end # Matcher
|
|
|
|
end # Mutant
|