Class: Sequel::Postgres::RangeOp

Inherits:
SQL::Wrapper show all
Defined in:
lib/sequel/extensions/pg_range_ops.rb

Overview

The RangeOp class is a simple container for a single object that defines methods that yield Sequel expression objects representing PostgreSQL range operators and functions.

Most methods in this class are defined via metaprogramming, see the pg_range_ops extension documentation for details on the API.

Constant Summary collapse

OPERATORS =
{
  :contains => ["(".freeze, " @> ".freeze, ")".freeze].freeze,
  :contained_by => ["(".freeze, " <@ ".freeze, ")".freeze].freeze,
  :left_of => ["(".freeze, " << ".freeze, ")".freeze].freeze,
  :right_of => ["(".freeze, " >> ".freeze, ")".freeze].freeze,
  :ends_before => ["(".freeze, " &< ".freeze, ")".freeze].freeze,
  :starts_after => ["(".freeze, " &> ".freeze, ")".freeze].freeze,
  :adjacent_to => ["(".freeze, " -|- ".freeze, ")".freeze].freeze,
  :overlaps => ["(".freeze, " && ".freeze, ")".freeze].freeze,
}
FUNCTIONS =
%w'lower upper isempty lower_inc upper_inc lower_inf upper_inf'

Instance Attribute Summary

Attributes inherited from SQL::Wrapper

#value

Instance Method Summary collapse

Methods inherited from SQL::Wrapper

#initialize

Methods included from HStoreOpMethods

#hstore

Methods included from ArrayOpMethods

#pg_array

Methods included from JSONOpMethods

#pg_json, #pg_jsonb

Methods included from PGRowOp::ExpressionMethods

#pg_row

Methods included from SQL::SubscriptMethods

#sql_subscript

Methods included from SQL::StringMethods

#ilike, #like

Methods included from SQL::OrderMethods

#asc, #desc

Methods included from SQL::NumericMethods

#+

Methods included from SQL::ComplexExpressionMethods

#extract, #sql_boolean, #sql_number, #sql_string

Methods included from SQL::CastMethods

#cast, #cast_numeric, #cast_string

Methods included from SQL::BooleanMethods

#~

Methods included from SQL::AliasMethods

#as

Methods inherited from SQL::Expression

#==, attr_reader, #eql?, #hash, inherited, #inspect, #lit, #sql_literal

Constructor Details

This class inherits a constructor from Sequel::SQL::Wrapper

Instance Method Details

#pg_rangeObject

Return the receiver.



91
92
93
# File 'lib/sequel/extensions/pg_range_ops.rb', line 91

def pg_range
  self
end