Module: Filigree::Destructurable
- Included in:
- Array
- Defined in:
- lib/filigree/match.rb
Overview
A module indicating that an object may be destructured. The including class must define the ‘destructure` instance method, which takes one argument specifying the number of pattern elements it is being matched against.
Instance Method Summary collapse
-
#call(*pattern) ⇒ DestructuringPattern
The instance method that generates a destructuring pattern.
Instance Method Details
#call(*pattern) ⇒ DestructuringPattern
The instance method that generates a destructuring pattern.
180 181 182 |
# File 'lib/filigree/match.rb', line 180 def call(*pattern) DestructuringPattern.new(self, *pattern) end |