Class: Senko::Validator::NoopEvaluationContext
- Inherits:
-
Object
- Object
- Senko::Validator::NoopEvaluationContext
- Defined in:
- lib/senko/validator.rb
Instance Method Summary collapse
- #dynamic_target(anchor) ⇒ Object
- #evaluation_empty? ⇒ Boolean
- #fork(track_evaluation: false) ⇒ Object
-
#initialize(dynamic_scopes = []) ⇒ NoopEvaluationContext
constructor
A new instance of NoopEvaluationContext.
- #item_evaluated?(_location, _index) ⇒ Boolean
- #mark_item(_location, _index) ⇒ Object
- #mark_property(_location, _name) ⇒ Object
- #merge(_child) ⇒ Object
- #pop_dynamic_scope ⇒ Object
- #property_evaluated?(_location, _name) ⇒ Boolean
- #push_dynamic_scope(anchors) ⇒ Object
- #track_evaluation? ⇒ Boolean
Constructor Details
#initialize(dynamic_scopes = []) ⇒ NoopEvaluationContext
Returns a new instance of NoopEvaluationContext.
132 133 134 |
# File 'lib/senko/validator.rb', line 132 def initialize(dynamic_scopes = []) @dynamic_scopes = dynamic_scopes.dup end |
Instance Method Details
#dynamic_target(anchor) ⇒ Object
164 165 166 167 |
# File 'lib/senko/validator.rb', line 164 def dynamic_target(anchor) scope = @dynamic_scopes.find { |candidate| candidate.key?(anchor) } scope&.fetch(anchor) end |
#evaluation_empty? ⇒ Boolean
152 153 154 |
# File 'lib/senko/validator.rb', line 152 def evaluation_empty? true end |
#fork(track_evaluation: false) ⇒ Object
169 170 171 |
# File 'lib/senko/validator.rb', line 169 def fork(track_evaluation: false) track_evaluation ? EvaluationContext.new(@dynamic_scopes) : self.class.new(@dynamic_scopes) end |
#item_evaluated?(_location, _index) ⇒ Boolean
148 149 150 |
# File 'lib/senko/validator.rb', line 148 def item_evaluated?(_location, _index) false end |
#mark_item(_location, _index) ⇒ Object
142 |
# File 'lib/senko/validator.rb', line 142 def mark_item(_location, _index); end |
#mark_property(_location, _name) ⇒ Object
136 |
# File 'lib/senko/validator.rb', line 136 def mark_property(_location, _name); end |
#merge(_child) ⇒ Object
173 |
# File 'lib/senko/validator.rb', line 173 def merge(_child); end |
#pop_dynamic_scope ⇒ Object
160 161 162 |
# File 'lib/senko/validator.rb', line 160 def pop_dynamic_scope @dynamic_scopes.pop end |
#property_evaluated?(_location, _name) ⇒ Boolean
144 145 146 |
# File 'lib/senko/validator.rb', line 144 def property_evaluated?(_location, _name) false end |
#push_dynamic_scope(anchors) ⇒ Object
156 157 158 |
# File 'lib/senko/validator.rb', line 156 def push_dynamic_scope(anchors) @dynamic_scopes << anchors end |
#track_evaluation? ⇒ Boolean
138 139 140 |
# File 'lib/senko/validator.rb', line 138 def track_evaluation? false end |