Class: Castle::Commands::Lists::Query

Inherits:
Object
  • Object
show all
Defined in:
lib/castle/commands/lists/query.rb

Overview

Builds the command to query lists

Class Method Summary collapse

Class Method Details

.build(options = {}) ⇒ Castle::Command

Parameters:

  • options (Hash) (defaults to: {})

Returns:



11
12
13
14
15
16
# File 'lib/castle/commands/lists/query.rb', line 11

def build(options = {})
  options[:filters]&.each { |f| Castle::Validators::Present.call(f, %i[field op value]) }
  Castle::Validators::Present.call(options[:sort], %i[field order]) if options[:sort]

  Castle::Command.new('lists/query', options, :post)
end