Class: Vanguard::Builder::Nullary
- Inherits:
-
Vanguard::Builder
- Object
- Vanguard::Builder
- Vanguard::Builder::Nullary
- Includes:
- AbstractType
- Defined in:
- lib/vanguard/builder/nullary.rb
Overview
Abstract base class for nullary builders
Constant Summary collapse
- OPTIONS =
[].freeze
- REQUIRED_OPTIONS =
[].freeze
Instance Attribute Summary collapse
-
#arguments ⇒ Enumerable<Object>
readonly
private
Return arguments.
-
#klass ⇒ Class
readonly
private
Return arguments.
-
#options ⇒ Hash
readonly
private
Return options.
Class Method Summary collapse
-
.run(*arguments) ⇒ Enumerable<Rule>
private
Run builder.
Instance Method Summary collapse
-
#allowed_options ⇒ Enumerable<Symbol>
private
Return allowed options.
-
#matcher ⇒ Matcher
private
Return matcher.
-
#required_options ⇒ Enumerable<Symbol>
private
Return required options.
-
#rule(attribute_name) ⇒ Rule
private
Return rule for attribute name.
-
#rules ⇒ Object
private
Return rules.
Instance Attribute Details
#arguments ⇒ Enumerable<Object> (readonly)
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.
Return arguments
32 33 34 |
# File 'lib/vanguard/builder/nullary.rb', line 32 def arguments @arguments end |
#klass ⇒ Class (readonly)
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.
Return arguments
24 25 26 |
# File 'lib/vanguard/builder/nullary.rb', line 24 def klass @klass end |
#options ⇒ Hash (readonly)
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.
Return options
16 17 18 |
# File 'lib/vanguard/builder/nullary.rb', line 16 def @options end |
Class Method Details
.run(*arguments) ⇒ Enumerable<Rule>
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.
Run builder
93 94 95 |
# File 'lib/vanguard/builder/nullary.rb', line 93 def self.run(*arguments) new(*arguments).rules end |
Instance Method Details
#allowed_options ⇒ Enumerable<Symbol>
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.
Return allowed options
73 74 75 |
# File 'lib/vanguard/builder/nullary.rb', line 73 def self.class::OPTIONS end |
#matcher ⇒ Matcher
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.
Return matcher
52 53 54 |
# File 'lib/vanguard/builder/nullary.rb', line 52 def matcher klass::MATCHER end |
#required_options ⇒ Enumerable<Symbol>
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.
Return required options
83 84 85 |
# File 'lib/vanguard/builder/nullary.rb', line 83 def self.class::REQUIRED_OPTIONS end |
#rule(attribute_name) ⇒ Rule
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.
Return rule for attribute name
42 43 44 |
# File 'lib/vanguard/builder/nullary.rb', line 42 def rule(attribute_name) klass.new(attribute_name, matcher) end |
#rules ⇒ Object
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.
Return rules
60 61 62 63 64 |
# File 'lib/vanguard/builder/nullary.rb', line 60 def rules arguments.map do |attribute_name| rule(attribute_name) end end |