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.
208 209 210 |
# File 'lib/filigree/match.rb', line 208 def call(*pattern) DestructuringPattern.new(self, Filigree::wrap_pattern_elements(pattern)) end |