Class: GraphQL::Filter::MergedOnly Private
- Inherits:
-
Object
- Object
- GraphQL::Filter::MergedOnly
- Defined in:
- lib/graphql/filter.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Direct Known Subclasses
Class Method Summary collapse
-
.build(onlies) ⇒ Object
private
Instance Method Summary collapse
-
#call(member, ctx) ⇒ Object
private
-
#initialize(first, second) ⇒ MergedOnly
constructor
private
A new instance of MergedOnly.
Constructor Details
#initialize(first, second) ⇒ MergedOnly
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of MergedOnly
26 27 28 29 |
# File 'lib/graphql/filter.rb', line 26 def initialize(first, second) @first = first @second = second end |
Class Method Details
.build(onlies) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/graphql/filter.rb', line 35 def self.build(onlies) case onlies when 0 nil when 1 onlies[0] else onlies.reduce { |memo, only| self.new(memo, only) } end end |
Instance Method Details
#call(member, ctx) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
31 32 33 |
# File 'lib/graphql/filter.rb', line 31 def call(member, ctx) @first.call(member, ctx) && @second.call(member, ctx) end |