Class: Array

Inherits:
Object show all
Defined in:
lib/array_extensions.rb

Instance Method Summary collapse

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

Returns:

  • (Boolean)


16
17
18
# File 'lib/array_extensions.rb', line 16

def lambda?
  first == :lambda
end

#restObject Also known as: cdr

Lisp-style list access



3
4
5
# File 'lib/array_extensions.rb', line 3

def rest
  self[1 .. -1]
end