lib/feedjira/parser/opml_head.rb in feedjira-opml-1.0.3 vs lib/feedjira/parser/opml_head.rb in feedjira-opml-2.0.0
- old
+ new
@@ -3,20 +3,45 @@
class OPMLHead
include SAXMachine
include FeedUtilities
element :title
- element :dateCreated, as: :date_created
- element :dateModified, as: :date_modified
+
+ 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
element :docs
- element :expansionState, as: :expansion_state
- element :vertScrollState, as: :vert_scroll_state
- element :windowTop, as: :window_top
- element :windowLeft, as: :window_left
- element :windowBottom, as: :window_bottom
- element :windowRight, as: :window_right
+
+ 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