Class: Sanity::Groq::Select
- Inherits:
-
Object
- Object
- Sanity::Groq::Select
- Defined in:
- lib/sanity/groq/select.rb
Constant Summary collapse
- RESERVED =
%i[select]
Instance Attribute Summary collapse
-
#select ⇒ Object
readonly
Returns the value of attribute select.
-
#val ⇒ Object
readonly
Returns the value of attribute val.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(**args) ⇒ Select
constructor
A new instance of Select.
Constructor Details
Instance Attribute Details
#select ⇒ Object (readonly)
Returns the value of attribute select.
16 17 18 |
# File 'lib/sanity/groq/select.rb', line 16 def select @select end |
#val ⇒ Object (readonly)
Returns the value of attribute val.
16 17 18 |
# File 'lib/sanity/groq/select.rb', line 16 def val @val end |
Class Method Details
.call(**args) ⇒ Object
9 10 11 |
# File 'lib/sanity/groq/select.rb', line 9 def call(**args) new(**args).call end |
Instance Method Details
#call ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/sanity/groq/select.rb', line 26 def call return unless select Array.wrap(select).each_with_index do |x, idx| val << "#{idx.positive? ? "," : ""} #{x}" end "{ #{val.strip} }" end |