Class: Castle::Commands::ListItems::Query
- Inherits:
-
Object
- Object
- Castle::Commands::ListItems::Query
- Defined in:
- lib/castle/commands/list_items/query.rb
Overview
Builds the command to query list items
Class Method Summary collapse
Class Method Details
.build(options = {}) ⇒ Castle::Command
11 12 13 14 15 16 17 18 19 |
# File 'lib/castle/commands/list_items/query.rb', line 11 def build( = {}) Castle::Validators::Present.call(, %i[list_id]) [:filters]&.each { |f| Castle::Validators::Present.call(f, %i[field op value]) } Castle::Validators::Present.call([:sort], %i[field order]) if [:sort] list_id = .delete(:list_id) Castle::Command.new("lists/#{list_id}/items/query", , :post) end |