Skip to content

Instantly share code, notes, and snippets.

@joemsak
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joemsak/e6fbd02ecea9f8a46403 to your computer and use it in GitHub Desktop.
Save joemsak/e6fbd02ecea9f8a46403 to your computer and use it in GitHub Desktop.
module Eader
class Document
attr_reader :doc
def initialize(path)
file = open(path)
@doc = xml_doc_class.parse(file)
end
def series
doc.css('dsc c01').map do |c|
if c['level'] == 'series'
Item.new(c)
end
end.compact
end
#...
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment