Class: ArchUnit::Metrics::FluentApi::CustomMetricCondition
- Inherits:
-
Object
- Object
- ArchUnit::Metrics::FluentApi::CustomMetricCondition
- Includes:
- Common::FluentApi::Checkable
- Defined in:
- lib/archunit/metrics/fluentapi/custom_metric_condition.rb
Overview
Executable custom class-metric predicate.
Instance Attribute Summary collapse
-
#predicate ⇒ Object
readonly
Returns the value of attribute predicate.
-
#selection ⇒ Object
readonly
Returns the value of attribute selection.
Instance Method Summary collapse
-
#initialize(selection:, predicate:) ⇒ CustomMetricCondition
constructor
A new instance of CustomMetricCondition.
Methods included from Common::FluentApi::Checkable
Constructor Details
#initialize(selection:, predicate:) ⇒ CustomMetricCondition
Returns a new instance of CustomMetricCondition.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/archunit/metrics/fluentapi/custom_metric_condition.rb', line 15 def initialize(selection:, predicate:) unless selection.is_a?(CustomMetricBuilder) raise ArgumentError, 'selection must be a CustomMetricBuilder' end raise ArgumentError, 'predicate must respond to call' unless predicate.respond_to?(:call) @selection = selection @predicate = predicate.dup.freeze freeze end |
Instance Attribute Details
#predicate ⇒ Object (readonly)
Returns the value of attribute predicate.
13 14 15 |
# File 'lib/archunit/metrics/fluentapi/custom_metric_condition.rb', line 13 def predicate @predicate end |
#selection ⇒ Object (readonly)
Returns the value of attribute selection.
13 14 15 |
# File 'lib/archunit/metrics/fluentapi/custom_metric_condition.rb', line 13 def selection @selection end |