Class: BU::Api

Inherits:
Object
  • Object
show all
Defined in:
lib/bu/api.rb

Instance Method Summary collapse

Constructor Details

#initializeApi

Returns a new instance of Api.



6
7
8
9
10
11
12
# File 'lib/bu/api.rb', line 6

def initialize
  @conn = Faraday.new(url: BU::ROOT) do |f|
    f.request(:url_encoded)
    # f.response(:logger) # for debugging
    f.adapter(Faraday.default_adapter)
  end
end

Instance Method Details

#dashboard(manga) ⇒ Object



14
15
16
17
# File 'lib/bu/api.rb', line 14

def dashboard(manga)
  url = series_url(manga)
  BU::Dashboard.new(url, doc(url))
end