Class: Lifestream::Stream
- Inherits:
-
Object
- Object
- Lifestream::Stream
- Defined in:
- lib/lifestream/stream.rb
Instance Attribute Summary collapse
-
#channels ⇒ Object
Returns the value of attribute channels.
Instance Method Summary collapse
- #branches ⇒ Object
-
#initialize(channels = []) ⇒ Stream
constructor
A new instance of Stream.
Constructor Details
#initialize(channels = []) ⇒ Stream
Returns a new instance of Stream.
6 7 8 |
# File 'lib/lifestream/stream.rb', line 6 def initialize channels = [] @channels = channels end |
Instance Attribute Details
#channels ⇒ Object
Returns the value of attribute channels.
4 5 6 |
# File 'lib/lifestream/stream.rb', line 4 def channels @channels end |
Instance Method Details
#branches ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/lifestream/stream.rb', line 10 def branches @branches ||= [] return @branches unless @branches.empty? @channels.each do |channel| channel.branches.each { |b| @branches << b } end @branches.sort! { |a,b| a.published_at <=> b.published_at }.reverse! end |