Class: KudagoClient::Entities::Comment
- Inherits:
-
Object
- Object
- KudagoClient::Entities::Comment
- Defined in:
- lib/kudago_client/entities/comment.rb
Defined Under Namespace
Classes: User
Instance Attribute Summary collapse
-
#date_posted ⇒ Object
Returns the value of attribute date_posted.
-
#id ⇒ Object
Returns the value of attribute id.
-
#is_deleted ⇒ Object
Returns the value of attribute is_deleted.
-
#lang ⇒ Object
Returns the value of attribute lang.
-
#replies_count ⇒ Object
Returns the value of attribute replies_count.
-
#reply_to ⇒ Object
Returns the value of attribute reply_to.
-
#text ⇒ Object
Returns the value of attribute text.
-
#thread ⇒ Object
Returns the value of attribute thread.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(lang:, id: nil, date_posted: nil, text: nil, user: nil, is_deleted: false, replies_count: 0, reply_to: nil, thread: nil) ⇒ Comment
constructor
A new instance of Comment.
Constructor Details
#initialize(lang:, id: nil, date_posted: nil, text: nil, user: nil, is_deleted: false, replies_count: 0, reply_to: nil, thread: nil) ⇒ Comment
Returns a new instance of Comment.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/kudago_client/entities/comment.rb', line 12 def initialize(lang:, id: nil, date_posted: nil, text: nil, user: nil, is_deleted: false, replies_count: 0, reply_to: nil, thread: nil) @lang = lang @id = id @text = text @is_deleted = is_deleted @replies_count = replies_count @reply_to = reply_to @thread = thread @date_posted = Time.at(date_posted).to_datetime if date_posted.present? @user = User.new(user[:name], user[:avatar]) if user.present? end |
Instance Attribute Details
#date_posted ⇒ Object
Returns the value of attribute date_posted.
10 11 12 |
# File 'lib/kudago_client/entities/comment.rb', line 10 def date_posted @date_posted end |
#id ⇒ Object
Returns the value of attribute id.
10 11 12 |
# File 'lib/kudago_client/entities/comment.rb', line 10 def id @id end |
#is_deleted ⇒ Object
Returns the value of attribute is_deleted.
10 11 12 |
# File 'lib/kudago_client/entities/comment.rb', line 10 def is_deleted @is_deleted end |
#lang ⇒ Object
Returns the value of attribute lang.
10 11 12 |
# File 'lib/kudago_client/entities/comment.rb', line 10 def lang @lang end |
#replies_count ⇒ Object
Returns the value of attribute replies_count.
10 11 12 |
# File 'lib/kudago_client/entities/comment.rb', line 10 def replies_count @replies_count end |
#reply_to ⇒ Object
Returns the value of attribute reply_to.
10 11 12 |
# File 'lib/kudago_client/entities/comment.rb', line 10 def reply_to @reply_to end |
#text ⇒ Object
Returns the value of attribute text.
10 11 12 |
# File 'lib/kudago_client/entities/comment.rb', line 10 def text @text end |
#thread ⇒ Object
Returns the value of attribute thread.
10 11 12 |
# File 'lib/kudago_client/entities/comment.rb', line 10 def thread @thread end |
#user ⇒ Object
Returns the value of attribute user.
10 11 12 |
# File 'lib/kudago_client/entities/comment.rb', line 10 def user @user end |