Class: Montague::API::Publisher
- Defined in:
- lib/montague/api/publisher.rb
Overview
Publisher API
Instance Method Summary collapse
- #find_by_id(id) ⇒ Montague::Model::PublisherReport
- #find_by_name(text:, filter: :all) ⇒ Montague::Model::PublishersReport
-
#initialize(config = {}) ⇒ Publisher
constructor
A new instance of Publisher.
Constructor Details
#initialize(config = {}) ⇒ Publisher
Returns a new instance of Publisher.
10 11 12 |
# File 'lib/montague/api/publisher.rb', line 10 def initialize(config = {}) super end |
Instance Method Details
#find_by_id(id) ⇒ Montague::Model::PublisherReport
16 17 18 19 20 |
# File 'lib/montague/api/publisher.rb', line 16 def find_by_id(id) url = "#{@config[:api_url]}?id=#{id}#{common_parameters}" response = HTTP.get URI.encode(url) publisher_report response end |
#find_by_name(text:, filter: :all) ⇒ Montague::Model::PublishersReport
28 29 30 31 32 |
# File 'lib/montague/api/publisher.rb', line 28 def find_by_name(text:, filter: :all) url = "#{@config[:api_url]}?pub=#{text}&qtype=#{filter}#{common_parameters}" response = HTTP.get URI.encode(url) publishers_report response end |