Sha256: e591030cefd7cc45be6a2b006c7a183a59f8839e0c13def4e9acc3835f1ccc7b
Contents?: true
Size: 1.32 KB
Versions: 1
Compression:
Stored size: 1.32 KB
Contents
module Awis module API class CategoryBrowse < Base DEFAULT_RESPONSE_GROUP = %w(categories related_categories language_categories letter_bars).freeze def load_request_uri(arguments = {}) validation_arguments!(arguments) super(params) end private def before_validation_arguments(arguments) raise ArgumentError, "Invalid arguments. should be like { path: 'Top/Arts' }" unless arguments.is_a?(Hash) raise ArgumentError, "Invalid arguments. the path must be configured." unless arguments.has_key?(:path) end def validation_arguments!(arguments) before_validation_arguments(arguments) @arguments = arguments @arguments[:response_group] = Array(arguments.fetch(:response_group, DEFAULT_RESPONSE_GROUP)) @arguments[:descriptions] = arguments.fetch(:descriptions, true) end def params { "Action" => action_name, "ResponseGroup" => response_groups, "Path" => arguments[:path], "Descriptions" => descriptions_params } end def response_groups arguments[:response_group].sort.map { |group| camelize(group) }.join(",") end def descriptions_params arguments[:descriptions].to_s.capitalize end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
awis-sdk-ruby-0.0.7 | lib/awis/api/category_browse.rb |