Sha256: 1d4ef5716a6c793c407fec1960cadac9935a7261c9a85926fc547b96cc601d7e

Contents?: true

Size: 707 Bytes

Versions: 6

Compression:

Stored size: 707 Bytes

Contents

module Murlsh

  # Feed body mixin.
  module FeedBody

    # Content types to add an enclosure for.
    EnclosureContentTypes = %w{
      application/pdf
      audio/mpeg
      image/gif
      image/jpeg
      image/png
      }

    def initialize(config, req, feed_url, urls)
      @config, @req, @feed_url, @urls = config, req, feed_url, urls
      @updated = nil
    end

    # Yield body for Rack.
    def each; yield build; end

    # Build feed title.
    def feed_title
      result = "#{config['page_title']}"
      req['q'] ? "#{result} /#{req['q']}" : result
    end

    attr_reader :config
    attr_reader :req
    attr_reader :feed_url
    attr_reader :urls
    attr_reader :updated
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
murlsh-1.8.0 lib/murlsh/feed_body.rb
murlsh-1.7.1 lib/murlsh/feed_body.rb
murlsh-1.7.0 lib/murlsh/feed_body.rb
murlsh-1.6.1 lib/murlsh/feed_body.rb
murlsh-1.6.0 lib/murlsh/feed_body.rb
murlsh-1.5.0 lib/murlsh/feed_body.rb