class TinyPress::Post

Attributes

body[R]
date[R]
description[R]
publish[R]
title[R]

Public Class Methods

new( title, description, date, publish, body ) click to toggle source

Public: Create a new instance of Post.

title - A String that represents the Post's title. description - A short String description of the Post. date - A Date object that indicates when this Post was written. publish - A Boolean value indicating if this post should be published body - A String representing the body of the post

Returns an instance of Post.

# File lib/tinypress/post.rb, line 14
def initialize( title, description, date, publish, body )
    @title          = title
    @description    = description
    @date           = date
    @publish        = publish
    @body           = body
end

Public Instance Methods

publish?() click to toggle source

Public: Indicates if this Post should be published.

Examples

print post if post.publish?

Returns true if this Post should be published, otherwise returns false.

# File lib/tinypress/post.rb, line 29
def publish?
    @publish
end