Class: RubyNext::Language::Rewriters::Predicates::CaseIn
- Inherits:
-
Base
- Object
- Base
- RubyNext::Language::Rewriters::Predicates::CaseIn
show all
- Defined in:
- lib/ruby-next/language/rewriters/2.7/pattern_matching.rb
Overview
rubocop:enable Style/MethodMissingSuper rubocop:enable Style/MissingRespondToMissing
Instance Attribute Summary
Attributes inherited from Base
#count, #current_path, #predicates_by_path, #store, #terminated
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #pop, #pred?, #predicate_clause, #process, #push, #read_pred, #reset!, #terminate!, #write_pred
Instance Method Details
#array_deconstructed(node) ⇒ Object
208
209
210
|
# File 'lib/ruby-next/language/rewriters/2.7/pattern_matching.rb', line 208
def array_deconstructed(node)
predicate_clause(:array_deconstructed, node)
end
|
#array_size(node, size) ⇒ Object
204
205
206
|
# File 'lib/ruby-next/language/rewriters/2.7/pattern_matching.rb', line 204
def array_size(node, size)
predicate_clause(:"array_size_#{size}", node)
end
|
#const(node, const) ⇒ Object
196
197
198
|
# File 'lib/ruby-next/language/rewriters/2.7/pattern_matching.rb', line 196
def const(node, const)
node
end
|
#hash_deconstructed(node, keys) ⇒ Object
212
213
214
|
# File 'lib/ruby-next/language/rewriters/2.7/pattern_matching.rb', line 212
def hash_deconstructed(node, keys)
predicate_clause(:"hash_deconstructed_#{keys.join("_p_")}", node)
end
|
#hash_keys(node, keys) ⇒ Object
220
221
222
223
224
|
# File 'lib/ruby-next/language/rewriters/2.7/pattern_matching.rb', line 220
def hash_keys(node, keys)
keys = keys.map { |key| key.is_a?(::Parser::AST::Node) ? key.children.first : key }
predicate_clause(:"hash_keys_#{keys.join("_p_")}", node)
end
|
#respond_to_deconstruct(node) ⇒ Object
200
201
202
|
# File 'lib/ruby-next/language/rewriters/2.7/pattern_matching.rb', line 200
def respond_to_deconstruct(node)
predicate_clause(:respond_to_deconstruct, node)
end
|
#respond_to_deconstruct_keys(node) ⇒ Object
216
217
218
|
# File 'lib/ruby-next/language/rewriters/2.7/pattern_matching.rb', line 216
def respond_to_deconstruct_keys(node)
predicate_clause(:respond_to_deconstruct_keys, node)
end
|