module Filigree::Destructurable
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.
Public Instance Methods
call(*pattern)
click to toggle source
The instance method that generates a destructuring pattern.
@param [Object] pattern Sub-patterns used to match the destructured elements of the object.
@return [DestructuringPattern]
# File lib/filigree/match.rb, line 204 def call(*pattern) DestructuringPattern.new(self, Filigree::wrap_pattern_elements(pattern)) end