Class: PostProxy::Comment
Instance Attribute Summary collapse
-
#author_avatar_url ⇒ Object
Returns the value of attribute author_avatar_url.
-
#author_external_id ⇒ Object
Returns the value of attribute author_external_id.
-
#author_username ⇒ Object
Returns the value of attribute author_username.
-
#body ⇒ Object
Returns the value of attribute body.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#external_id ⇒ Object
Returns the value of attribute external_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#is_hidden ⇒ Object
Returns the value of attribute is_hidden.
-
#like_count ⇒ Object
Returns the value of attribute like_count.
-
#parent_external_id ⇒ Object
Returns the value of attribute parent_external_id.
-
#permalink ⇒ Object
Returns the value of attribute permalink.
-
#platform_data ⇒ Object
Returns the value of attribute platform_data.
-
#posted_at ⇒ Object
Returns the value of attribute posted_at.
-
#replies ⇒ Object
Returns the value of attribute replies.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(**attrs) ⇒ Comment
constructor
A new instance of Comment.
Methods inherited from Model
Constructor Details
#initialize(**attrs) ⇒ Comment
Returns a new instance of Comment.
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 |
# File 'lib/postproxy/types.rb', line 299 def initialize(**attrs) @external_id = nil @author_avatar_url = nil @author_external_id = nil @parent_external_id = nil @like_count = 0 @is_hidden = false @permalink = nil @platform_data = nil @replies = [] super @posted_at = parse_time(@posted_at) @created_at = parse_time(@created_at) @replies = (@replies || []).map do |r| r.is_a?(Comment) ? r : Comment.new(**r.transform_keys(&:to_sym)) end end |
Instance Attribute Details
#author_avatar_url ⇒ Object
Returns the value of attribute author_avatar_url.
294 295 296 |
# File 'lib/postproxy/types.rb', line 294 def @author_avatar_url end |
#author_external_id ⇒ Object
Returns the value of attribute author_external_id.
294 295 296 |
# File 'lib/postproxy/types.rb', line 294 def @author_external_id end |
#author_username ⇒ Object
Returns the value of attribute author_username.
294 295 296 |
# File 'lib/postproxy/types.rb', line 294 def @author_username end |
#body ⇒ Object
Returns the value of attribute body.
294 295 296 |
# File 'lib/postproxy/types.rb', line 294 def body @body end |
#created_at ⇒ Object
Returns the value of attribute created_at.
294 295 296 |
# File 'lib/postproxy/types.rb', line 294 def created_at @created_at end |
#external_id ⇒ Object
Returns the value of attribute external_id.
294 295 296 |
# File 'lib/postproxy/types.rb', line 294 def external_id @external_id end |
#id ⇒ Object
Returns the value of attribute id.
294 295 296 |
# File 'lib/postproxy/types.rb', line 294 def id @id end |
#is_hidden ⇒ Object
Returns the value of attribute is_hidden.
294 295 296 |
# File 'lib/postproxy/types.rb', line 294 def is_hidden @is_hidden end |
#like_count ⇒ Object
Returns the value of attribute like_count.
294 295 296 |
# File 'lib/postproxy/types.rb', line 294 def like_count @like_count end |
#parent_external_id ⇒ Object
Returns the value of attribute parent_external_id.
294 295 296 |
# File 'lib/postproxy/types.rb', line 294 def parent_external_id @parent_external_id end |
#permalink ⇒ Object
Returns the value of attribute permalink.
294 295 296 |
# File 'lib/postproxy/types.rb', line 294 def permalink @permalink end |
#platform_data ⇒ Object
Returns the value of attribute platform_data.
294 295 296 |
# File 'lib/postproxy/types.rb', line 294 def platform_data @platform_data end |
#posted_at ⇒ Object
Returns the value of attribute posted_at.
294 295 296 |
# File 'lib/postproxy/types.rb', line 294 def posted_at @posted_at end |
#replies ⇒ Object
Returns the value of attribute replies.
294 295 296 |
# File 'lib/postproxy/types.rb', line 294 def replies @replies end |
#status ⇒ Object
Returns the value of attribute status.
294 295 296 |
# File 'lib/postproxy/types.rb', line 294 def status @status end |