Class: TinyPress::Post
- Inherits:
-
Object
- Object
- TinyPress::Post
- Defined in:
- lib/tinypress/post.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#publish ⇒ Object
readonly
Returns the value of attribute publish.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(title, description, date, publish, body) ⇒ Post
constructor
Public: Create a new instance of Post.
-
#publish? ⇒ Boolean
Public: Indicates if this Post should be published.
Constructor Details
#initialize(title, description, date, publish, body) ⇒ Post
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.
14 15 16 17 18 19 20 |
# 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 |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
3 4 5 |
# File 'lib/tinypress/post.rb', line 3 def body @body end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
3 4 5 |
# File 'lib/tinypress/post.rb', line 3 def date @date end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
3 4 5 |
# File 'lib/tinypress/post.rb', line 3 def description @description end |
#publish ⇒ Object (readonly)
Returns the value of attribute publish.
3 4 5 |
# File 'lib/tinypress/post.rb', line 3 def publish @publish end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
3 4 5 |
# File 'lib/tinypress/post.rb', line 3 def title @title end |
Instance Method Details
#publish? ⇒ Boolean
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.
29 30 31 |
# File 'lib/tinypress/post.rb', line 29 def publish? @publish end |