Class: ConsadoleAggregator::News::SiteBuilder
- Inherits:
-
Object
- Object
- ConsadoleAggregator::News::SiteBuilder
- Defined in:
- lib/consadole_aggregator/news.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #build ⇒ Object
- #filter_article(&block) ⇒ Object
-
#initialize(name) ⇒ SiteBuilder
constructor
A new instance of SiteBuilder.
- #parse_article(&block) ⇒ Object
- #parse_list(&block) ⇒ Object
- #resource(&block) ⇒ Object
Constructor Details
#initialize(name) ⇒ SiteBuilder
Returns a new instance of SiteBuilder.
29 30 31 |
# File 'lib/consadole_aggregator/news.rb', line 29 def initialize name @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
27 28 29 |
# File 'lib/consadole_aggregator/news.rb', line 27 def name @name end |
Instance Method Details
#build ⇒ Object
38 39 40 41 42 43 44 45 |
# File 'lib/consadole_aggregator/news.rb', line 38 def build site = Site.new @name site.resource = @resource if @resource site.list_parser = @parse_list if @parse_list site.article_filter = @filter_article if @filter_article site.article_parser = @parse_article if @parse_article site end |
#filter_article(&block) ⇒ Object
35 |
# File 'lib/consadole_aggregator/news.rb', line 35 def filter_article █ @filter_article = block; end |
#parse_article(&block) ⇒ Object
36 |
# File 'lib/consadole_aggregator/news.rb', line 36 def parse_article █ @parse_article = block; end |
#parse_list(&block) ⇒ Object
34 |
# File 'lib/consadole_aggregator/news.rb', line 34 def parse_list █ @parse_list = block; end |
#resource(&block) ⇒ Object
33 |
# File 'lib/consadole_aggregator/news.rb', line 33 def resource █ @resource = block; end |