Module: Murlsh::FeedBody

Included in:
AtomBody, M3uBody, RssBody
Defined in:
lib/murlsh/feed_body.rb

Overview

Feed body mixin.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



20
21
22
# File 'lib/murlsh/feed_body.rb', line 20

def config
  @config
end

#feed_urlObject (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

#reqObject (readonly)

Returns the value of attribute req.



21
22
23
# File 'lib/murlsh/feed_body.rb', line 21

def req
  @req
end

#updatedObject (readonly)

Returns the value of attribute updated.



24
25
26
# File 'lib/murlsh/feed_body.rb', line 24

def updated
  @updated
end

#urlsObject (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.

Yields:

  • (build)


12
# File 'lib/murlsh/feed_body.rb', line 12

def each; yield build; end

#feed_titleObject

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