Sha256: 9c71d78c3bd2300cad364adc95f4605c68601d3e723bcb884eb7776149d8ee6a

Contents?: true

Size: 440 Bytes

Versions: 2

Compression:

Stored size: 440 Bytes

Contents

module Siteleaf
  class Meta < Entity

    attr_accessor :id, :key, :value, :page_id, :post_id
    protected :id=
    
    def create_endpoint
      if self.page_id
        "pages/#{self.page_id}/meta"
      elsif self.post_id
        "posts/#{self.post_id}/meta"
      end
    end
    
    def post
      Post.find(self.post_id) if self.post_id
    end
    
    def page
      Page.find(self.page_id) if self.page_id
    end
    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
siteleaf-0.8.1 lib/siteleaf/meta.rb
siteleaf-0.8.0 lib/siteleaf/meta.rb