Sha256: 9e4a65c1c3015d4e68132595a444a7a2bfecbe2edc6869264fd82135420e8cf0

Contents?: true

Size: 365 Bytes

Versions: 1

Compression:

Stored size: 365 Bytes

Contents

require 'time'

module EPUBInfo
  module Models
    class Date
      attr_accessor :time, :event

      def initialize(node)
        self.time = Time.parse(node.content)
        self.event = node.attribute('event').content rescue nil
      end

      def to_hash
        {
          :time => @time,
          :event => @event
        }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
epubinfo-0.2.2 lib/epubinfo/models/date.rb