Sha256: 7df5befe1e5d77bacf59bdbfe10798c52b1e073207dea382c1ad2a2bd7506b86

Contents?: true

Size: 702 Bytes

Versions: 1

Compression:

Stored size: 702 Bytes

Contents

module Caramelize
  class Page
  
    attr_accessor :title, :body, :id, :markup, :latest, :time, :message, :author, :author_name
  
    def initialize page={}
      @id =      page[:id]
      @title =   page[:title] ? page[:title] : ""
      @body =    page[:body] ? page[:body] : ""
      @syntax =  page[:markup]
      @latest =  page[:latest] ? page[:latest] : false
      @time =    page[:time] ? page[:time] : Time.now
      @message = page[:message] ? page[:message] : ""
      @author =  page[:author]
      @author_name =  page[:author_name]
    end
    
    def latest?
      @latest
    end
    
    def set_latest
      @latest = true
    end
    
    def to_s
      @title
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
caramelize-0.2.0 lib/caramelize/page.rb