Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/sinatra.rb,
lib/sinatra.rb

Instance Method Summary collapse

Instance Method Details

#to_hashObject



1424
1425
1426
# File 'lib/sinatra.rb', line 1424

def to_hash
  self.inject({}) { |h, (k, v)|  h[k] = v; h }
end

#to_procObject



1427
1428
1429
# File 'lib/sinatra.rb', line 1427

def to_proc
  Proc.new { |*args| args.shift.__send__(self[0], *(args + self[1..-1])) }
end

#to_result(cx, *args) ⇒ Object



1455
1456
1457
# File 'lib/sinatra.rb', line 1455

def to_result(cx, *args)
  self.shift.to_result(cx, *self)
end