Class: Yapt::Comment
- Inherits:
-
Object
- Object
- Yapt::Comment
- Defined in:
- lib/yapt/comment.rb
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Class Method Summary collapse
Instance Method Summary collapse
- #commenter ⇒ Object
- #created_at_display ⇒ Object
-
#initialize(data) ⇒ Comment
constructor
A new instance of Comment.
- #time_display(time) ⇒ Object
Constructor Details
#initialize(data) ⇒ Comment
Returns a new instance of Comment.
9 10 11 |
# File 'lib/yapt/comment.rb', line 9 def initialize(data) @raw = data end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
8 9 10 |
# File 'lib/yapt/comment.rb', line 8 def raw @raw end |
Class Method Details
Instance Method Details
#commenter ⇒ Object
20 21 22 |
# File 'lib/yapt/comment.rb', line 20 def commenter @commenter ||= Member.find(person_id) end |
#created_at_display ⇒ Object
24 25 26 |
# File 'lib/yapt/comment.rb', line 24 def created_at_display time_display(created_at) end |
#time_display(time) ⇒ Object
28 29 30 |
# File 'lib/yapt/comment.rb', line 28 def time_display(time) Time.parse(time).strftime("%a %d %b %I:%M") end |