Class: Sanity::Http::Where

Inherits:
Object
  • Object
show all
Includes:
Query
Defined in:
lib/sanity/http/where.rb

Instance Attribute Summary collapse

Attributes included from Query

#resource_klass, #serializer

Instance Method Summary collapse

Methods included from Query

#call, included, #result_wrapper

Constructor Details

#initialize(**args) ⇒ Where

Returns a new instance of Where.



15
16
17
18
19
20
21
22
23
24
# File 'lib/sanity/http/where.rb', line 15

def initialize(**args)
  super
  @groq = args.delete(:groq) || ""
  @variables = args.delete(:variables) || {}
  @use_post = args.delete(:use_post) || false

  @groq_attributes = args.except(
    :groq, :use_post, :resource_klass, :serializer, :result_wrapper
  )
end

Instance Attribute Details

#groqObject (readonly)

Returns the value of attribute groq.



13
14
15
# File 'lib/sanity/http/where.rb', line 13

def groq
  @groq
end

#groq_attributesObject (readonly)

Returns the value of attribute groq_attributes.



13
14
15
# File 'lib/sanity/http/where.rb', line 13

def groq_attributes
  @groq_attributes
end

#use_postObject (readonly)

Returns the value of attribute use_post.



13
14
15
# File 'lib/sanity/http/where.rb', line 13

def use_post
  @use_post
end

#variablesObject (readonly)

Returns the value of attribute variables.



13
14
15
# File 'lib/sanity/http/where.rb', line 13

def variables
  @variables
end