Sha256: b317b38e3b4e33655e3a1f2c2b47bc4a240f2a2895bf6aeb8060c1197715c9f4
Contents?: true
Size: 594 Bytes
Versions: 8
Compression:
Stored size: 594 Bytes
Contents
module Siteleaf class Content < Entity attr_accessor :title, :body, :path, :permalink, :visibility, :date, :user_id, :site_id, :metadata attr_reader :id, :filename, :basename, :directory, :url, :sha, :created_at, :updated_at def site Site.find(site_id) if site_id end def draft? visibility == 'draft' end def hidden? visibility == 'hidden' end def visible? visibility == 'visible' end alias_method :published?, :visible? def to_file SourceFile.new(site_id: site_id, name: filename).to_file end end end
Version data entries
8 entries across 8 versions & 1 rubygems