Class: Threads::API::Thread::List

Inherits:
Object
  • Object
show all
Defined in:
lib/threads/api/thread.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ List

Returns a new instance of List.



9
10
11
12
13
14
# File 'lib/threads/api/thread.rb', line 9

def initialize(json)
  @threads = json["data"].map { |t| Threads::API::Thread.new(t) }

  @before = json.dig("paging", "cursors", "before")
  @after = json.dig("paging", "cursors", "after")
end

Instance Attribute Details

#afterObject (readonly)

Returns the value of attribute after.



7
8
9
# File 'lib/threads/api/thread.rb', line 7

def after
  @after
end

#beforeObject (readonly)

Returns the value of attribute before.



7
8
9
# File 'lib/threads/api/thread.rb', line 7

def before
  @before
end

#threadsObject (readonly)

Returns the value of attribute threads.



7
8
9
# File 'lib/threads/api/thread.rb', line 7

def threads
  @threads
end