Class: Mutant::Matcher::Config Private
- Inherits:
-
Object
- Object
- Mutant::Matcher::Config
- Includes:
- Adamantium
- Defined in:
- lib/mutant/matcher/config.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Subject matcher configuration
Constant Summary collapse
- INSPECT_FORMAT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
"#<#{self} %s>"
- ATTRIBUTE_DELIMITER =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
' '
- ATTRIBUTE_FORMAT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'%s: [%s]'
- ENUM_DELIMITER =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
','
- EMPTY_ATTRIBUTES =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'empty'
- PRESENTATIONS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
IceNine.deep_freeze( ignore: :syntax, start_expressions: :syntax, subject_filters: :inspect, subjects: :syntax )
- DEFAULT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
new(Hash[anima.attribute_names.map { |name| [name, []] }])
- LOADER =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Transform::Sequence.new( [ Transform::Hash.new( optional: [ Transform::Hash::Key.new('subjects', expression_array), Transform::Hash::Key.new('ignore', expression_array) ], required: [] ), Transform::Hash::Symbolize.new, ->(attributes) { Either::Right.new(DEFAULT.with(attributes)) } ] )
Instance Method Summary collapse
-
#add(attribute, value) ⇒ Config
private
Add value to configurable collection.
-
#inspect ⇒ String
private
Inspection string.
-
#merge(other) ⇒ Config
private
Merge with other config.
Instance Method Details
#add(attribute, value) ⇒ Config
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Add value to configurable collection
64 65 66 |
# File 'lib/mutant/matcher/config.rb', line 64 def add(attribute, value) with(attribute => public_send(attribute) + [value]) end |
#inspect ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Inspection string
53 54 55 |
# File 'lib/mutant/matcher/config.rb', line 53 def inspect INSPECT_FORMAT % inspect_attributes end |
#merge(other) ⇒ Config
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Merge with other config
73 74 75 76 77 78 79 |
# File 'lib/mutant/matcher/config.rb', line 73 def merge(other) self.class.new( to_h .map { |name, value| [name, value + other.public_send(name)] } .to_h ) end |