Sha256: edd260d7efc8d58e082f6f006ddb9fff1e3ff62c505fdb1e9bdfdf3383668978
Contents?: true
Size: 900 Bytes
Versions: 4
Compression:
Stored size: 900 Bytes
Contents
# frozen-string-literal: true require 'set' module Leftovers module MatcherBuilders module NodeType def self.build(types_pattern) ::Leftovers::MatcherBuilders::Or.each_or_self(types_pattern) do |type| case type when 'Symbol' then ::Leftovers::Matchers::NodeType.new(:sym) when 'String' then ::Leftovers::Matchers::NodeType.new(:str) when 'Integer' then ::Leftovers::Matchers::NodeType.new(:int) when 'Float' then ::Leftovers::Matchers::NodeType.new(:float) # these would be neat but i can't think of a use-case # when 'Array' then :array # when 'Hash' then :hash # when 'Method' then Set[:send, :csend, :def] # when 'Constant' then Set[:const, :class, :module] # :nocov: else raise # :nocov: end end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems