Module: Mustermann::ToPattern
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/mustermann-3.0.0/lib/mustermann/to_pattern.rb
Overview
Mixin for adding #to_pattern ducktyping to objects.
By default included into String, Symbol, Regexp, Array and Pattern.
Instance Method Summary collapse
-
#to_pattern(**options) ⇒ Mustermann::Pattern
Converts the object into a Pattern.
Instance Method Details
#to_pattern(**options) ⇒ Mustermann::Pattern
Converts the object into a Pattern.
41 42 43 44 45 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/mustermann-3.0.0/lib/mustermann/to_pattern.rb', line 41 def to_pattern(**) input = self if PRIMITIVES.any? { |p| self.is_a? p } input ||= __getobj__ if respond_to?(:__getobj__) Mustermann.new(input || to_s, **) end |