Class: Redd::Object::Listing

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/redd/object/listing.rb

Overview

A listing of various reddit things.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(listing) ⇒ Listing

Returns a new instance of Listing.



21
22
23
24
25
26
# File 'lib/redd/object/listing.rb', line 21

def initialize(listing)
  @kind = listing[:kind]
  @things = listing[:data][:children]
  @after = listing[:data][:after]
  @before = listing[:data][:before]
end

Instance Attribute Details

#afterObject (readonly)

Returns the value of attribute after.



18
19
20
# File 'lib/redd/object/listing.rb', line 18

def after
  @after
end

#beforeObject (readonly)

Returns the value of attribute before.



19
20
21
# File 'lib/redd/object/listing.rb', line 19

def before
  @before
end

#kindObject (readonly)

Returns the value of attribute kind.



17
18
19
# File 'lib/redd/object/listing.rb', line 17

def kind
  @kind
end

#thingsArray (readonly)

Returns A list of things in the listing.

Returns:

  • (Array)

    A list of things in the listing.



15
16
17
# File 'lib/redd/object/listing.rb', line 15

def things
  @things
end