Module: StreamGrabberHelper

Defined in:
app/helpers/stream_grabber_helper.rb

Instance Method Summary collapse

Instance Method Details

#generate_stream_list(num = 15, *args) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
# File 'app/helpers/stream_grabber_helper.rb', line 2

def generate_stream_list(num=15, *args)
  if args.present?
    css_class = args.first[:class]
    css_id = args.first[:id]
  end

  data = StreamGrabber.grab(num).inject([]){ |memo,acc| memo << (:li,raw(acc[1][1]), :class => acc[1][0]) }

   :ol, {:class => css_class || 'activity_list', :id => css_id || 'stream_grabber'} do 
    raw(data.join("\n"))
  end
end