Class: Api2ch::Threads
- Inherits:
-
Object
- Object
- Api2ch::Threads
- Defined in:
- lib/api_2ch/methods/threads.rb
Instance Method Summary collapse
- #call ⇒ Object
- #full ⇒ Object
-
#initialize(board, page) ⇒ Threads
constructor
A new instance of Threads.
Constructor Details
#initialize(board, page) ⇒ Threads
Returns a new instance of Threads.
3 4 5 6 |
# File 'lib/api_2ch/methods/threads.rb', line 3 def initialize(board, page) @board = board @page = page end |
Instance Method Details
#call ⇒ Object
13 14 15 16 |
# File 'lib/api_2ch/methods/threads.rb', line 13 def call response = HTTParty.get("#{BASE_URL}#{@board}/threads.json") JSON.parse(response.body) end |
#full ⇒ Object
8 9 10 11 |
# File 'lib/api_2ch/methods/threads.rb', line 8 def full response = HTTParty.get("#{BASE_URL}#{@board}/#{@page}.json") JSON.parse(response.body) end |