Class: ArchSpec::Rules::Naming::Selected
- Inherits:
-
Object
- Object
- ArchSpec::Rules::Naming::Selected
- Defined in:
- lib/archspec/rules/naming_rules.rb
Overview
A chosen selector, waiting for a constraint. Each constraint method builds a NamingRule, attaches it, and returns the component proxy so rules chain.
Instance Method Summary collapse
- #forbidden(except: [], because: nil) ⇒ Object
-
#initialize(component, selector, scope) ⇒ Selected
constructor
A new instance of Selected.
- #requires(template, on: nil, scope: :instance, except: [], because: nil) ⇒ Object
Constructor Details
#initialize(component, selector, scope) ⇒ Selected
Returns a new instance of Selected.
175 176 177 178 179 |
# File 'lib/archspec/rules/naming_rules.rb', line 175 def initialize(component, selector, scope) @component = component @selector = selector @scope = scope end |
Instance Method Details
#forbidden(except: [], because: nil) ⇒ Object
181 182 183 |
# File 'lib/archspec/rules/naming_rules.rb', line 181 def forbidden(except: [], because: nil) add(Forbidden.new, except, because) end |
#requires(template, on: nil, scope: :instance, except: [], because: nil) ⇒ Object
185 186 187 188 |
# File 'lib/archspec/rules/naming_rules.rb', line 185 def requires(template, on: nil, scope: :instance, except: [], because: nil) validate_template!(template) add(Requires.new(template, on: component_name(on), scope: scope), except, because) end |