Module: Murlsh::FeedBody
Overview
Feed body mixin.
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#feed_url ⇒ Object
readonly
Returns the value of attribute feed_url.
-
#req ⇒ Object
readonly
Returns the value of attribute req.
-
#updated ⇒ Object
readonly
Returns the value of attribute updated.
-
#urls ⇒ Object
readonly
Returns the value of attribute urls.
Instance Method Summary collapse
-
#each {|build| ... } ⇒ Object
Yield body for Rack.
-
#feed_title ⇒ Object
Build feed title.
- #initialize(config, req, feed_url, urls) ⇒ Object
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
20 21 22 |
# File 'lib/murlsh/feed_body.rb', line 20 def config @config end |
#feed_url ⇒ Object (readonly)
Returns the value of attribute feed_url.
22 23 24 |
# File 'lib/murlsh/feed_body.rb', line 22 def feed_url @feed_url end |
#req ⇒ Object (readonly)
Returns the value of attribute req.
21 22 23 |
# File 'lib/murlsh/feed_body.rb', line 21 def req @req end |
#updated ⇒ Object (readonly)
Returns the value of attribute updated.
24 25 26 |
# File 'lib/murlsh/feed_body.rb', line 24 def updated @updated end |
#urls ⇒ Object (readonly)
Returns the value of attribute urls.
23 24 25 |
# File 'lib/murlsh/feed_body.rb', line 23 def urls @urls end |
Instance Method Details
#each {|build| ... } ⇒ Object
Yield body for Rack.
12 |
# File 'lib/murlsh/feed_body.rb', line 12 def each; yield build; end |
#feed_title ⇒ Object
Build feed title.
15 16 17 18 |
# File 'lib/murlsh/feed_body.rb', line 15 def feed_title result = "#{config['page_title']}" req['q'] ? "#{result} /#{req['q']}" : result end |
#initialize(config, req, feed_url, urls) ⇒ Object
6 7 8 9 |
# File 'lib/murlsh/feed_body.rb', line 6 def initialize(config, req, feed_url, urls) @config, @req, @feed_url, @urls = config, req, feed_url, urls @updated = nil end |