Sha256: e180ce7446126e7252e9ed36c5b4a3a15b524982fa45c50bad0a57f61e20247b

Contents?: true

Size: 544 Bytes

Versions: 8

Compression:

Stored size: 544 Bytes

Contents

require "hiccup/serializers/ical"
require "active_support/concern"


module Hiccup
  module Serializable
    module Ical
      extend ActiveSupport::Concern


      def to_ical
        ical_serializer.dump(self)
      end


      module ClassMethods

        def from_ical(ics)
          ical_serializer.load(ics)
        end

        def ical_serializer
          @ical_serializer ||= Serializers::Ical.new(self)
        end

      end


    private


      def ical_serializer
        self.class.ical_serializer
      end


    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
hiccup-0.6.1 lib/hiccup/serializable/ical.rb
hiccup-0.6.0 lib/hiccup/serializable/ical.rb
hiccup-0.5.20 lib/hiccup/serializable/ical.rb
hiccup-0.5.19 lib/hiccup/serializable/ical.rb
hiccup-0.5.18 lib/hiccup/serializable/ical.rb
hiccup-0.5.17 lib/hiccup/serializable/ical.rb
hiccup-0.5.16 lib/hiccup/serializable/ical.rb
hiccup-0.5.15 lib/hiccup/serializable/ical.rb