Sha256: 2900c415d511c13c898794b047e97e5e25acea683e510c5cd36348073e29b91b

Contents?: true

Size: 1002 Bytes

Versions: 11

Compression:

Stored size: 1002 Bytes

Contents

module Rapa
  module Queries
    class SearchItemsQuery < BaseQuery
      SEARCH_INDEX_DEFAULT = "All"
      OPERATION = "ItemSearch"

      property :BrowseNode
      property :ItemPage
      property :Keywords
      property :Power
      property :SearchIndex

      # @return [String, nil]
      def BrowseNode
        if options[:browse_node_id]
          options[:browse_node_id].to_s
        end
      end

      # @return [String, nil]
      def ItemPage
        if options[:item_page]
          options[:item_page].to_s
        end
      end

      # @return [String, nil]
      def Keywords
        if options[:keywords] && options[:keywords].any?
          options[:keywords].join(",")
        end
      end

      # @note Override
      def Operation
        OPERATION
      end

      # @return [String, nil]
      def Power
        options[:power]
      end

      # @return [String]
      def SearchIndex
        options[:search_index] || SEARCH_INDEX_DEFAULT
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rapa-0.6.0 lib/rapa/queries/search_items_query.rb
rapa-0.5.7 lib/rapa/queries/search_items_query.rb
rapa-0.5.6 lib/rapa/queries/search_items_query.rb
rapa-0.5.5 lib/rapa/queries/search_items_query.rb
rapa-0.5.4 lib/rapa/queries/search_items_query.rb
rapa-0.5.3 lib/rapa/queries/search_items_query.rb
rapa-0.5.2 lib/rapa/queries/search_items_query.rb
rapa-0.5.1 lib/rapa/queries/search_items_query.rb
rapa-0.5.0 lib/rapa/queries/search_items_query.rb
rapa-0.4.3 lib/rapa/queries/search_items_query.rb
rapa-0.4.2 lib/rapa/queries/search_items_query.rb