Class: Ecoportal::API::GraphQL::Logic::QueryArray
- Inherits:
-
Logic::Query
- Object
- Logic::Query
- Ecoportal::API::GraphQL::Logic::QueryArray
show all
- Includes:
- Enumerable
- Defined in:
- lib/ecoportal/api/graphql/logic/query_array.rb
Instance Method Summary
collapse
Instance Method Details
#each(item_block: nil, **kargs, &block) ⇒ Object
8
9
10
11
12
13
14
|
# File 'lib/ecoportal/api/graphql/logic/query_array.rb', line 8
def each(item_block: nil, **kargs, &block)
return to_enum(:each, item_block: connection_block, **kargs) unless block
query(**kargs, &item_block).each do |item|
yield(item) if block_given?
end
end
|
#response_class ⇒ Object
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/ecoportal/api/graphql/logic/query_array.rb', line 16
def response_class
return array_class if respond_to?(:array_class)
@response_class ||= self.class.new_class(
item_class,
inherits: Ecoportal::API::Common::Content::CollectionModel
) do |klass|
klass.klass = item_class
end
end
|