Sha256: 9f5ef6c8228c32d8635fc0ceba0dd763fd27f97ccebfd78fa240548597ee8051

Contents?: true

Size: 1.01 KB

Versions: 3

Compression:

Stored size: 1.01 KB

Contents

module Feedjira
  module Parser
    class OPMLHead
      include SAXMachine
      include FeedUtilities

      element :title

      element :dateCreated, as: :date_created do |s|
        Time.parse(s)
      end

      element :dateModified, as: :date_modified do |s|
        Time.parse(s)
      end

      element :ownerName, as: :owner_name
      element :ownerEmail, as: :owner_email

      element :ownerId, as: :owner_id do |s|
        URI(s)
      end

      element :docs do |s|
        URI(s)
      end

      element :expansionState, as: :expansion_state do |s|
        s.split(',').map{ |x| x.to_f }
      end

      element :vertScrollState, as: :vert_scroll_state do |s|
        s.to_f
      end

      element :windowTop, as: :window_top do |s|
        s.to_f
      end

      element :windowLeft, as: :window_left do |s|
        s.to_f
      end

      element :windowBottom, as: :window_bottom do |s|
        s.to_f
      end

      element :windowRight, as: :window_right do |s|
        s.to_f
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
feedjira-opml-2.0.4 lib/feedjira/parser/opml_head.rb
feedjira-opml-2.0.3 lib/feedjira/parser/opml_head.rb
feedjira-opml-2.0.2 lib/feedjira/parser/opml_head.rb