Class: Api2ch::ViewedThreads
- Inherits:
-
Object
- Object
- Api2ch::ViewedThreads
- Defined in:
- lib/api_2ch/methods/viewed_threads.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(board) ⇒ ViewedThreads
constructor
A new instance of ViewedThreads.
Constructor Details
#initialize(board) ⇒ ViewedThreads
Returns a new instance of ViewedThreads.
3 4 5 |
# File 'lib/api_2ch/methods/viewed_threads.rb', line 3 def initialize(board) @board = board end |
Instance Method Details
#call ⇒ Object
7 8 9 10 11 |
# File 'lib/api_2ch/methods/viewed_threads.rb', line 7 def call board_threads = make_request(@board) board_threads['threads'].map { |i| i['subject'].scrub! } board_threads['threads'].sort_by { |i| - i['views'] } end |