Class: SocialStream::Views::List

Inherits:
Array
  • Object
show all
Defined in:
lib/social_stream/views/list.rb

Instance Method Summary collapse

Instance Method Details

#insert_after(key, obj) ⇒ Object



10
11
12
13
14
# File 'lib/social_stream/views/list.rb', line 10

def insert_after key, obj
  position = index{ |i| i[:key] == key } + 1

  insert position, obj
end

#insert_before(key, obj) ⇒ Object



4
5
6
7
8
# File 'lib/social_stream/views/list.rb', line 4

def insert_before key, obj
  position = index{ |i| i[:key] == key }

  insert position, obj
end