Class: Hash

Inherits:
Object show all
Includes:
Sink
Defined in:
lib/coroutines.rb

Instance Method Summary collapse

Methods included from Sink

#<=, #close, #in_connect, #input_map, #input_reduce, #input_reject, #input_select

Instance Method Details

#<<(args) ⇒ Object

:call-seq:

hash << [key, value] -> hash

Equivalent to hash = value, but allows chaining:

{} << [1, "one"] << [2, "two"] << [3, "three"]  #=> {1=>"one", 2=>"two", 3=>"three"}


84
85
86
87
# File 'lib/coroutines.rb', line 84

def <<(args)
	self[args[0]] = args[1]
	self
end