Class: Thron::Gateway::ContentList
- Defined in:
- lib/thron/gateway/content_list.rb
Constant Summary collapse
- PACKAGE =
Package.new(:xcontents, :resources, self.service_name)
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Session
Methods included from Pageable
Methods inherited from Base
#check_session, client_id, #client_id, service_name
Methods included from Routable
Constructor Details
This class inherits a constructor from Thron::Gateway::Session
Class Method Details
Instance Method Details
#show_contents(options = {}) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/thron/gateway/content_list.rb', line 17 def show_contents( = {}) category_id = [:category_id] locale = [:locale] criteria = .fetch(:criteria) { {} } recursive = .fetch(:recursive) { true } order_by = .fetch(:order_by) { 'contentName_A' } limit = [:limit].to_i offset = [:offset].to_i query = { clientId: client_id, categoryId: category_id, locale: locale, searchOnSubCategories: recursive, orderBy: order_by, numberOfResult: limit, offset: offset }.merge(criteria) route(to: __callee__, query: query, token_id: token_id) do |response| response.body = Entity::Base::factory(response.body.fetch('contents') { [] }) end end |