Sha256: 54b3d60753bf38cafa12324f8c823e59f59718bc1ea886645718e96858f35381

Contents?: true

Size: 557 Bytes

Versions: 10

Compression:

Stored size: 557 Bytes

Contents

require_relative 'temporal_node'

module ConceptQL
  module Nodes
    class During < TemporalNode
      def where_clause
        if inclusive?
          Sequel.expr(Sequel.expr(Proc.new { r__start_date <= l__start_date}).&(Sequel.expr( Proc.new { l__start_date <= r__end_date })))
            .|(Sequel.expr(Proc.new { r__start_date <= l__end_date}).&(Sequel.expr( Proc.new { l__end_date <= r__end_date })))
        else
          [Proc.new { r__start_date <= l__start_date}, Proc.new { l__end_date <= r__end_date }]
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
conceptql-0.1.1 lib/conceptql/nodes/during.rb
conceptql-0.1.0 lib/conceptql/nodes/during.rb
conceptql-0.0.9 lib/conceptql/nodes/during.rb
conceptql-0.0.8 lib/conceptql/nodes/during.rb
conceptql-0.0.7 lib/conceptql/nodes/during.rb
conceptql-0.0.6 lib/conceptql/nodes/during.rb
conceptql-0.0.5 lib/conceptql/nodes/during.rb
conceptql-0.0.4 lib/conceptql/nodes/during.rb
conceptql-0.0.3 lib/conceptql/nodes/during.rb
conceptql-0.0.1 lib/conceptql/nodes/during.rb