Class: FYT::Builder

Inherits:
Base
  • Object
show all
Defined in:
lib/fyt/builder.rb

Overview

processes the Youtube feed

Instance Method Summary collapse

Methods inherited from Base

#logger

Constructor Details

#initialize(source_feed, storage, server_prefix, proxy) ⇒ Builder

Returns a new instance of Builder.



5
6
7
8
9
10
11
# File 'lib/fyt/builder.rb', line 5

def initialize(source_feed, storage, server_prefix, proxy)
  @source_feed = source_feed
  @storage = storage
  @server_prefix = server_prefix
  @proxy = proxy
  @maker = RSS::Maker['2.0'].new
end

Instance Method Details

#buildObject



13
14
15
16
17
18
19
20
# File 'lib/fyt/builder.rb', line 13

def build
  add_channel_data(@source_feed.link.href, @source_feed.title.content)
  add_image(@source_feed.author.uri.content, @source_feed.title.content)

  build_items

  @maker.to_feed
end