Class: DMatch::Pred
- Includes:
- Predicated
- Defined in:
- lib/destructure/types.rb
Instance Method Summary collapse
-
#initialize(pred_callable = nil, &pred_block) ⇒ Pred
constructor
A new instance of Pred.
Methods included from Predicated
Constructor Details
#initialize(pred_callable = nil, &pred_block) ⇒ Pred
Returns a new instance of Pred.
72 73 74 75 |
# File 'lib/destructure/types.rb', line 72 def initialize(pred_callable=nil, &pred_block) raise 'Cannot specify both a callable and a block' if pred_callable && pred_block self.pred = pred_callable || pred_block end |