class Redd::Objects::Listing
A collection of reddit things. @see www.reddit.com/dev/api#listings
Attributes
after[R]
@!attribute [r] after @return [String] The id of the object after the listing.
before[R]
@!attribute [r] before @return [String] The id of the object before the listing.
Public Class Methods
new(client, attributes)
click to toggle source
@param [Clients::Base] client The client to expand the comments with. @param [{:before => String, :after => String,
:children => Array<Hash>}] attributes The data to initialize the class with.
@todo Only call Clients::Base#object_from_body when item is being
accessed.
# File lib/redd/objects/listing.rb, line 20 def initialize(client, attributes) @before = attributes[:before] @after = attributes[:after] attributes[:children].each do |child| self << (client.object_from_body(child) || child) end end