Class: Api2ch::Threads

Inherits:
Object
  • Object
show all
Defined in:
lib/api_2ch/methods/threads.rb

Instance Method Summary collapse

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

#callObject



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

#fullObject



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