Class: MangaPlus::Api::TitleDetailView

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

Constant Summary collapse

URL =
API + '/title_detail?title_id=%s'

Instance Method Summary collapse

Constructor Details

#initialize(title_id) ⇒ TitleDetailView

Returns a new instance of TitleDetailView.



49
50
51
# File 'lib/manga_plus/api.rb', line 49

def initialize(title_id)
  @title_id = title_id
end

Instance Method Details

#callObject



53
54
55
56
57
# File 'lib/manga_plus/api.rb', line 53

def call
  protobuf = HTTParty.get(URL % @title_id).body
  response = MangaPlus::Response.decode(protobuf).to_h
  response.dig(:success, :titleDetailView)
end