Class: Formalist::Validation::ValueRulesCompiler
- Inherits:
-
Object
- Object
- Formalist::Validation::ValueRulesCompiler
- Defined in:
- lib/formalist/validation/value_rules_compiler.rb
Instance Attribute Summary collapse
-
#target_name ⇒ Object
readonly
Returns the value of attribute target_name.
Instance Method Summary collapse
- #call(ast) ⇒ Object
-
#initialize(target_name) ⇒ ValueRulesCompiler
constructor
A new instance of ValueRulesCompiler.
Constructor Details
#initialize(target_name) ⇒ ValueRulesCompiler
Returns a new instance of ValueRulesCompiler.
6 7 8 |
# File 'lib/formalist/validation/value_rules_compiler.rb', line 6 def initialize(target_name) @target_name = target_name end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object (private)
79 80 81 |
# File 'lib/formalist/validation/value_rules_compiler.rb', line 79 def method_missing(name, *args) [] end |
Instance Attribute Details
#target_name ⇒ Object (readonly)
Returns the value of attribute target_name.
4 5 6 |
# File 'lib/formalist/validation/value_rules_compiler.rb', line 4 def target_name @target_name end |
Instance Method Details
#call(ast) ⇒ Object
10 11 12 |
# File 'lib/formalist/validation/value_rules_compiler.rb', line 10 def call(ast) ast.map { |node| visit(node) }.reduce([], :concat).each_slice(2).to_a end |