Class: Typ::Is::Array
Class Method Summary collapse
Methods inherited from Typ::Is
Constructor Details
This class inherits a constructor from Typ::Is
Class Method Details
.[](array) ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/typ.rb', line 54 def [] array check = if array[0].is_a?(Symbol) method, *arguments = array -> receiver { receiver.send method, *arguments } elsif array[1].is_a?(Symbol) receiver, method = array -> argument { receiver.send method, argument } else fail "not sure how to handle #{array} yet" end gate = Class.new self gate.check = check gate end |