Class: TallyGem::Post
- Inherits:
-
Object
- Object
- TallyGem::Post
- Defined in:
- lib/tallygem/posts/post.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#id ⇒ Object
Returns the value of attribute id.
-
#number ⇒ Object
Returns the value of attribute number.
-
#text ⇒ Object
Returns the value of attribute text.
-
#votes ⇒ Object
Returns the value of attribute votes.
Instance Method Summary collapse
-
#initialize(id, number, author, text) ⇒ Post
constructor
A new instance of Post.
Constructor Details
#initialize(id, number, author, text) ⇒ Post
Returns a new instance of Post.
6 7 8 9 10 11 12 |
# File 'lib/tallygem/posts/post.rb', line 6 def initialize(id, number, , text) @id = id @number = number @author = @text = text @votes = TallyGem::PostParser.instance.parse(text).to_a end |
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author.
5 6 7 |
# File 'lib/tallygem/posts/post.rb', line 5 def @author end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/tallygem/posts/post.rb', line 5 def id @id end |
#number ⇒ Object
Returns the value of attribute number.
5 6 7 |
# File 'lib/tallygem/posts/post.rb', line 5 def number @number end |
#text ⇒ Object
Returns the value of attribute text.
5 6 7 |
# File 'lib/tallygem/posts/post.rb', line 5 def text @text end |
#votes ⇒ Object
Returns the value of attribute votes.
5 6 7 |
# File 'lib/tallygem/posts/post.rb', line 5 def votes @votes end |