Class: Sanity::Groqify

Inherits:
Object
  • Object
show all
Defined in:
lib/sanity/groqify.rb

Constant Summary collapse

RESERVED =
Sanity::Groq::Filter::RESERVED |
Sanity::Groq::Slice::RESERVED |
Sanity::Groq::Order::RESERVED |
Sanity::Groq::Select::RESERVED

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Groqify

Returns a new instance of Groqify.



23
24
25
# File 'lib/sanity/groqify.rb', line 23

def initialize(**args)
  @args = args
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



21
22
23
# File 'lib/sanity/groqify.rb', line 21

def args
  @args
end

Class Method Details

.call(**args) ⇒ Object



11
12
13
# File 'lib/sanity/groqify.rb', line 11

def call(**args)
  new(**args).call
end

Instance Method Details

#callObject



27
28
29
# File 'lib/sanity/groqify.rb', line 27

def call
  "*[#{filter}] #{order} #{slice} #{select}".strip
end