Class: Array
Instance Method Summary collapse
-
#call(*args) ⇒ Object
Treat the array as a lambda and call it with given args.
-
#lambda? ⇒ Boolean
Simple predicate for convenience.
-
#rest ⇒ Object
(also: #cdr)
Lisp-style list access.
Instance Method Details
#call(*args) ⇒ Object
Treat the array as a lambda and call it with given args
11 12 13 |
# File 'lib/array_extensions.rb', line 11 def call(*args) BusScheme::eval_lambda(self, args) end |
#lambda? ⇒ Boolean
Simple predicate for convenience
16 17 18 |
# File 'lib/array_extensions.rb', line 16 def lambda? first == :lambda end |
#rest ⇒ Object Also known as: cdr
Lisp-style list access
3 4 5 |
# File 'lib/array_extensions.rb', line 3 def rest self[1 .. -1] end |