Class: MatchData

Inherits:
Object show all
Defined in:
lib/pattern-match/deconstructor.rb

Class Method Summary collapse

Class Method Details

.deconstruct(val) ⇒ Object



46
47
48
49
# File 'lib/pattern-match/deconstructor.rb', line 46

def deconstruct(val)
  accept_self_instance_only(val)
  val.captures.empty? ? [val[0]] : val.captures
end