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.
Attributes included from Common::FluentApi::Checkable
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.
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/archunit/metrics/fluentapi/custom_metric_condition.rb', line 16 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.
14 15 16 |
# File 'lib/archunit/metrics/fluentapi/custom_metric_condition.rb', line 14 def predicate @predicate end |
#selection ⇒ Object (readonly)
Returns the value of attribute selection.
14 15 16 |
# File 'lib/archunit/metrics/fluentapi/custom_metric_condition.rb', line 14 def selection @selection end |
ArchUnitRuby