Class: DMatch::Var

Inherits:
Object show all
Includes:
Predicated
Defined in:
lib/destructure/types.rb

Direct Known Subclasses

Splat

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Predicated

#test

Constructor Details

#initialize(name = nil, &pred) ⇒ Var

Returns a new instance of Var.



21
22
23
24
# File 'lib/destructure/types.rb', line 21

def initialize(name=nil, &pred)
  @name = name
  self.pred = pred
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



19
20
21
# File 'lib/destructure/types.rb', line 19

def name
  @name
end