Sha256: dda2eede49131d02e69005faeea513a853c6d227c0bd52c0395692ff3ae3b820
Contents?: true
Size: 998 Bytes
Versions: 9
Compression:
Stored size: 998 Bytes
Contents
module Ecoportal module API class GraphQL module Logic class QueryArray < Ecoportal::API::GraphQL::Logic::Query include Enumerable def each(item_block: nil, **kargs, &block) return to_enum(:each, **kargs, item_block: connection_block) unless block query(**kargs, &item_block).each do |item| yield(item) if block_given? end end 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 private def basic_block raise "Missuse. You have to implement 'basic_block' private method in the child class" end end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems