Module: ROM::SQL::Postgres::Types::RangeOperators

Defined in:
lib/rom/sql/extensions/postgres/types/range.rb

Instance Method Summary collapse

Instance Method Details

#adjacent_to(_type, expr, value) ⇒ Object


142
143
144
145
146
# File 'lib/rom/sql/extensions/postgres/types/range.rb', line 142

def adjacent_to(_type, expr, value)
  Attribute[SQL::Types::Bool].meta(
    sql_expr: Sequel.pg_range(expr).adjacent_to(value)
  )
end

#contain(_type, expr, value) ⇒ Object


100
101
102
103
104
# File 'lib/rom/sql/extensions/postgres/types/range.rb', line 100

def contain(_type, expr, value)
  Attribute[SQL::Types::Bool].meta(
    sql_expr: Sequel.pg_range(expr).contains(value)
  )
end

#contained_by(_type, expr, value) ⇒ Object


106
107
108
109
110
# File 'lib/rom/sql/extensions/postgres/types/range.rb', line 106

def contained_by(_type, expr, value)
  Attribute[SQL::Types::Bool].meta(
    sql_expr: Sequel.pg_range(expr).contained_by(value)
  )
end

#ends_before(_type, expr, value) ⇒ Object


136
137
138
139
140
# File 'lib/rom/sql/extensions/postgres/types/range.rb', line 136

def ends_before(_type, expr, value)
  Attribute[SQL::Types::Bool].meta(
    sql_expr: Sequel.pg_range(expr).ends_before(value)
  )
end

#left_of(_type, expr, value) ⇒ Object


118
119
120
121
122
# File 'lib/rom/sql/extensions/postgres/types/range.rb', line 118

def left_of(_type, expr, value)
  Attribute[SQL::Types::Bool].meta(
    sql_expr: Sequel.pg_range(expr).left_of(value)
  )
end

#overlap(_type, expr, value) ⇒ Object


112
113
114
115
116
# File 'lib/rom/sql/extensions/postgres/types/range.rb', line 112

def overlap(_type, expr, value)
  Attribute[SQL::Types::Bool].meta(
    sql_expr: Sequel.pg_range(expr).overlaps(value)
  )
end

#right_of(_type, expr, value) ⇒ Object


124
125
126
127
128
# File 'lib/rom/sql/extensions/postgres/types/range.rb', line 124

def right_of(_type, expr, value)
  Attribute[SQL::Types::Bool].meta(
    sql_expr: Sequel.pg_range(expr).right_of(value)
  )
end

#starts_after(_type, expr, value) ⇒ Object


130
131
132
133
134
# File 'lib/rom/sql/extensions/postgres/types/range.rb', line 130

def starts_after(_type, expr, value)
  Attribute[SQL::Types::Bool].meta(
    sql_expr: Sequel.pg_range(expr).starts_after(value)
  )
end