Sha256: 80171ba1b0533d6a8db98d04ba33dc9110798a238a3340b729ac43883f2888d9

Contents?: true

Size: 391 Bytes

Versions: 5

Compression:

Stored size: 391 Bytes

Contents

module Rooftop
  module Post
    def self.included(base)
      base.include Rooftop::Base
      base.include Rooftop::Nested
      base.include Rooftop::Preview
      base.extend ClassMethods
    end

    module ClassMethods
      def post_type=(type)
        Rooftop.configuration.post_type_mapping.merge!(type => self)
        self.api_endpoint = type.pluralize
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rooftop-0.1.4.1 lib/rooftop/post.rb
rooftop-0.1.4 lib/rooftop/post.rb
rooftop-0.1.3 lib/rooftop/post.rb
rooftop-0.1.2 lib/rooftop/post.rb
rooftop-0.1.1 lib/rooftop/post.rb