Class: Threads::API::Thread::List
- Inherits:
-
Object
- Object
- Threads::API::Thread::List
- Defined in:
- lib/threads/api/thread.rb
Instance Attribute Summary collapse
-
#after ⇒ Object
readonly
Returns the value of attribute after.
-
#before ⇒ Object
readonly
Returns the value of attribute before.
-
#threads ⇒ Object
readonly
Returns the value of attribute threads.
Instance Method Summary collapse
-
#initialize(json) ⇒ List
constructor
A new instance of List.
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
#after ⇒ Object (readonly)
Returns the value of attribute after.
7 8 9 |
# File 'lib/threads/api/thread.rb', line 7 def after @after end |
#before ⇒ Object (readonly)
Returns the value of attribute before.
7 8 9 |
# File 'lib/threads/api/thread.rb', line 7 def before @before end |
#threads ⇒ Object (readonly)
Returns the value of attribute threads.
7 8 9 |
# File 'lib/threads/api/thread.rb', line 7 def threads @threads end |