Class: CoachZed::FeedWriter

Inherits:
Object
  • Object
show all
Defined in:
lib/coach_zed/feed_writer.rb

Instance Method Summary collapse

Constructor Details

#initialize(schedule:, start_date:, existing_feed_content: nil) ⇒ FeedWriter

Returns a new instance of FeedWriter.



8
9
10
11
12
# File 'lib/coach_zed/feed_writer.rb', line 8

def initialize(schedule:, start_date:, existing_feed_content: nil)
  @schedule = schedule
  @start_date = start_date
  @existing_feed_content = existing_feed_content
end

Instance Method Details

#buildObject



14
15
16
17
18
19
20
# File 'lib/coach_zed/feed_writer.rb', line 14

def build
  if existing_feed_content
    append_to_existing_feed(existing_feed_content)
  else
    fresh_feed
  end
end