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_manager) ⇒ Builder

Returns a new instance of Builder.



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

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

Instance Method Details

#buildObject



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

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