Sha256: 4e671d5276b2681cc2bea2c88ee43f9602407b456a2e31361adb342521706917

Contents?: true

Size: 499 Bytes

Versions: 15

Compression:

Stored size: 499 Bytes

Contents

module CloudSesame
  module Query
    module AST
      class Root < MultiExpressionOperator
        SYMBOL = :and # default operator for root

        def compile
          more_than_one_child? ? super : children.compile
        end

        def more_than_one_child?
          children.size > 1
        end

        private

        def create_children
          array = FieldArray.new(context[:defaults] || [])
          array._scope = self
          array
        end

      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
CloudSesame-0.6.8 lib/cloud_sesame/query/ast/root.rb
CloudSesame-0.6.7 lib/cloud_sesame/query/ast/root.rb
CloudSesame-0.6.6 lib/cloud_sesame/query/ast/root.rb
CloudSesame-0.6.5 lib/cloud_sesame/query/ast/root.rb
CloudSesame-0.6.4 lib/cloud_sesame/query/ast/root.rb
CloudSesame-0.6.3 lib/cloud_sesame/query/ast/root.rb
CloudSesame-0.6.2 lib/cloud_sesame/query/ast/root.rb
CloudSesame-0.6.1 lib/cloud_sesame/query/ast/root.rb
CloudSesame-0.6.0 lib/cloud_sesame/query/ast/root.rb
CloudSesame-0.5.5 lib/cloud_sesame/query/ast/root.rb
CloudSesame-0.5.4 lib/cloud_sesame/query/ast/root.rb
CloudSesame-0.5.3 lib/cloud_sesame/query/ast/root.rb
CloudSesame-0.5.2 lib/cloud_sesame/query/ast/root.rb
CloudSesame-0.5.1 lib/cloud_sesame/query/ast/root.rb
CloudSesame-0.5.0 lib/cloud_sesame/query/ast/root.rb