Class: Api2ch::NewThreads
- Inherits:
-
Object
- Object
- Api2ch::NewThreads
- Defined in:
- lib/api_2ch/methods/new_threads.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(board) ⇒ NewThreads
constructor
A new instance of NewThreads.
Constructor Details
#initialize(board) ⇒ NewThreads
Returns a new instance of NewThreads.
3 4 5 |
# File 'lib/api_2ch/methods/new_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/new_threads.rb', line 7 def call response = HTTParty.get("#{BASE_URL}#{@board}/catalog_num.json") json = JSON.parse(response.body) json['threads'] end |