Class: ArchUnit::GraphReporting::Projection::GraphQueryOptions
- Inherits:
-
Data
- Object
- Data
- ArchUnit::GraphReporting::Projection::GraphQueryOptions
- Defined in:
- lib/archunit/graph/projection/graph_query_options.rb
Overview
Immutable selection, collapsing, and presentation options for a graph snapshot.
Instance Attribute Summary collapse
-
#collapse ⇒ Object
readonly
Returns the value of attribute collapse.
-
#dependents_of ⇒ Object
readonly
Returns the value of attribute dependents_of.
-
#focus ⇒ Object
readonly
Returns the value of attribute focus.
-
#focus_depth ⇒ Object
readonly
Returns the value of attribute focus_depth.
-
#include_external_dependencies ⇒ Object
readonly
Returns the value of attribute include_external_dependencies.
-
#include_self_dependencies ⇒ Object
readonly
Returns the value of attribute include_self_dependencies.
-
#reachable_from ⇒ Object
readonly
Returns the value of attribute reachable_from.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(include_external_dependencies: false, include_self_dependencies: false, focus: nil, focus_depth: 1, reachable_from: nil, dependents_of: nil, collapse: nil, title: nil) ⇒ GraphQueryOptions
constructor
The options bag deliberately mirrors the eight independent fluent modifiers.
-
#with(**overrides) ⇒ Object
rubocop:enable Metrics/ParameterLists.
Constructor Details
#initialize(include_external_dependencies: false, include_self_dependencies: false, focus: nil, focus_depth: 1, reachable_from: nil, dependents_of: nil, collapse: nil, title: nil) ⇒ GraphQueryOptions
The options bag deliberately mirrors the eight independent fluent modifiers. rubocop:disable Metrics/ParameterLists
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/archunit/graph/projection/graph_query_options.rb', line 25 def initialize( include_external_dependencies: false, include_self_dependencies: false, focus: nil, focus_depth: 1, reachable_from: nil, dependents_of: nil, collapse: nil, title: nil ) validate_boolean(include_external_dependencies, :include_external_dependencies) validate_boolean(include_self_dependencies, :include_self_dependencies) validate_filter(focus, :focus) validate_focus_depth(focus_depth) validate_filter(reachable_from, :reachable_from) validate_filter(dependents_of, :dependents_of) validate_collapse(collapse) title = immutable_title(title) super end |
Instance Attribute Details
#collapse ⇒ Object (readonly)
Returns the value of attribute collapse
11 12 13 |
# File 'lib/archunit/graph/projection/graph_query_options.rb', line 11 def collapse @collapse end |
#dependents_of ⇒ Object (readonly)
Returns the value of attribute dependents_of
11 12 13 |
# File 'lib/archunit/graph/projection/graph_query_options.rb', line 11 def dependents_of @dependents_of end |
#focus ⇒ Object (readonly)
Returns the value of attribute focus
11 12 13 |
# File 'lib/archunit/graph/projection/graph_query_options.rb', line 11 def focus @focus end |
#focus_depth ⇒ Object (readonly)
Returns the value of attribute focus_depth
11 12 13 |
# File 'lib/archunit/graph/projection/graph_query_options.rb', line 11 def focus_depth @focus_depth end |
#include_external_dependencies ⇒ Object (readonly)
Returns the value of attribute include_external_dependencies
11 12 13 |
# File 'lib/archunit/graph/projection/graph_query_options.rb', line 11 def include_external_dependencies @include_external_dependencies end |
#include_self_dependencies ⇒ Object (readonly)
Returns the value of attribute include_self_dependencies
11 12 13 |
# File 'lib/archunit/graph/projection/graph_query_options.rb', line 11 def include_self_dependencies @include_self_dependencies end |
#reachable_from ⇒ Object (readonly)
Returns the value of attribute reachable_from
11 12 13 |
# File 'lib/archunit/graph/projection/graph_query_options.rb', line 11 def reachable_from @reachable_from end |
#title ⇒ Object (readonly)
Returns the value of attribute title
11 12 13 |
# File 'lib/archunit/graph/projection/graph_query_options.rb', line 11 def title @title end |
Class Method Details
.resolve(value) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/archunit/graph/projection/graph_query_options.rb', line 16 def self.resolve(value) return new if value.nil? return value if value.is_a?(self) raise ArgumentError, 'options must be a GraphQueryOptions value or nil' end |
Instance Method Details
#with(**overrides) ⇒ Object
rubocop:enable Metrics/ParameterLists
42 43 44 |
# File 'lib/archunit/graph/projection/graph_query_options.rb', line 42 def with(**overrides) self.class.new(**to_h, **overrides) end |