Class: Redd::Models::MoreComments

Inherits:
Model
  • Object
show all
Defined in:
lib/redd/models/more_comments.rb

Overview

An object that represents a bunch of comments that need to be expanded.

Instance Attribute Summary collapse

Attributes inherited from Model

#client

Instance Method Summary collapse

Methods inherited from Model

#initialize

Constructor Details

This class inherits a constructor from Redd::Models::Model

Instance Attribute Details

#childrenArray<String> (readonly)

Returns the unexpanded comments.

Returns:

  • (Array<String>)

    the unexpanded comments


44
# File 'lib/redd/models/more_comments.rb', line 44

property :children

#countInteger (readonly)

Returns the comments under this object.

Returns:

  • (Integer)

    the comments under this object


24
# File 'lib/redd/models/more_comments.rb', line 24

property :count

#depthInteger (readonly)

Returns the depth.

Returns:

  • (Integer)

    the depth


40
# File 'lib/redd/models/more_comments.rb', line 40

property :depth

#idString (readonly)

Returns the object id.

Returns:

  • (String)

    the object id


32
# File 'lib/redd/models/more_comments.rb', line 32

property :id

#nameString (readonly)

Returns the object fullname.

Returns:

  • (String)

    the object fullname


28
# File 'lib/redd/models/more_comments.rb', line 28

property :name

#parent_idString (readonly)

Returns the parent fullname.

Returns:

  • (String)

    the parent fullname


36
# File 'lib/redd/models/more_comments.rb', line 36

property :parent_id

Instance Method Details

#expand(link:) ⇒ Listing<Comment, MoreComments>

Expand the object's children into a listing of Comments and MoreComments.

Parameters:

  • link (Submission)

    the submission the object belongs to

Returns:


12
13
14
# File 'lib/redd/models/more_comments.rb', line 12

def expand(link:)
  expand_recursive(link: link, lookup: {})
end

#to_aArray<String> Also known as: to_ary

Returns an array representation of self.

Returns:

  • (Array<String>)

    an array representation of self


17
18
19
# File 'lib/redd/models/more_comments.rb', line 17

def to_a
  read_attribute(:children)
end