Sha256: e7e156bd21208efa8f5bff77e4a10c1c9cccc08507422178273a49b971f7b973

Contents?: true

Size: 455 Bytes

Versions: 11

Compression:

Stored size: 455 Bytes

Contents

module Siteleaf
  class Post < Page

    attr_accessor :taxonomy
    
    def self.all
      result = Client.get "#{self.endpoint}"
      result.map { |r| self.new(r) } if result
    end
    
    def self.find(id)
      result = Client.get "#{self.endpoint}/#{id}"
      self.new(result) if result
    end
    
    def create_endpoint
      "pages/#{self.parent_id}/posts"
    end
    
    def parent
      Page.find(self.parent_id)
    end
    
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
siteleaf-0.9.12 lib/siteleaf/post.rb
siteleaf-0.9.11 lib/siteleaf/post.rb
siteleaf-0.9.10 lib/siteleaf/post.rb
siteleaf-0.9.9 lib/siteleaf/post.rb
siteleaf-0.9.8 lib/siteleaf/post.rb
siteleaf-0.9.7 lib/siteleaf/post.rb
siteleaf-0.9.6 lib/siteleaf/post.rb
siteleaf-0.9.5 lib/siteleaf/post.rb
siteleaf-0.9.3 lib/siteleaf/post.rb
siteleaf-0.9.2 lib/siteleaf/post.rb
siteleaf-0.9.1 lib/siteleaf/post.rb