class Clearly::Query::Compose::Custom

Public class for creating custom queries.

Public Instance Methods

compose_contains(table, column_name, allowed, value) click to toggle source

Create contains condition. @param [Arel::Table] table @param [Symbol] column_name @param [Array<Symbol>] allowed @param [Object] value @return [Arel::Nodes::Node] condition

# File lib/clearly/query/compose/custom.rb, line 126
def compose_contains(table, column_name, allowed, value)
  validate_table_column(table, column_name, allowed)
  compose_contains_node(table[column_name], value)
end
compose_ends_with(table, column_name, allowed, value) click to toggle source

Create ends_with condition. @param [Arel::Table] table @param [Symbol] column_name @param [Array<Symbol>] allowed @param [Object] value @return [Arel::Nodes::Node] condition

# File lib/clearly/query/compose/custom.rb, line 170
def compose_ends_with(table, column_name, allowed, value)
  validate_table_column(table, column_name, allowed)
  compose_ends_with_node(table[column_name], value)
end
compose_eq(table, column_name, allowed, value) click to toggle source

Create equals condition. @param [Arel::Table] table @param [Symbol] column_name @param [Array<Symbol>] allowed @param [Object] value @return [Arel::Nodes::Node] condition

# File lib/clearly/query/compose/custom.rb, line 20
def compose_eq(table, column_name, allowed, value)
  validate_table_column(table, column_name, allowed)
  compose_eq_node(table[column_name], value)
end
compose_gt(table, column_name, allowed, value) click to toggle source

Create greater than condition. @param [Arel::Table] table @param [Symbol] column_name @param [Array<Symbol>] allowed @param [Object] value @return [Arel::Nodes::Node] condition

# File lib/clearly/query/compose/custom.rb, line 63
def compose_gt(table, column_name, allowed, value)
  validate_table_column(table, column_name, allowed)
  compose_gt_node(table[column_name], value)
end
compose_gteq(table, column_name, allowed, value) click to toggle source

Create greater than or equal condition. @param [Arel::Table] table @param [Symbol] column_name @param [Array<Symbol>] allowed @param [Object] value @return [Arel::Nodes::Node] condition

# File lib/clearly/query/compose/custom.rb, line 105
def compose_gteq(table, column_name, allowed, value)
  validate_table_column(table, column_name, allowed)
  compose_gteq_node(table[column_name], value)
end
compose_in(table, column_name, allowed, values) click to toggle source

Create IN condition. @param [Arel::Table] table @param [Symbol] column_name @param [Array<Symbol>] allowed @param [Array] values @return [Arel::Nodes::Node] condition

# File lib/clearly/query/compose/custom.rb, line 192
def compose_in(table, column_name, allowed, values)
  validate_table_column(table, column_name, allowed)
  compose_in_node(table[column_name], values)
end
compose_lt(table, column_name, allowed, value) click to toggle source

Create less than condition. @param [Arel::Table] table @param [Symbol] column_name @param [Array<Symbol>] allowed @param [Object] value @return [Arel::Nodes::Node] condition

# File lib/clearly/query/compose/custom.rb, line 42
def compose_lt(table, column_name, allowed, value)
  validate_table_column(table, column_name, allowed)
  compose_lt_node(table[column_name], value)
end
compose_lteq(table, column_name, allowed, value) click to toggle source

Create less than or equal condition. @param [Arel::Table] table @param [Symbol] column_name @param [Array<Symbol>] allowed @param [Object] value @return [Arel::Nodes::Node] condition

# File lib/clearly/query/compose/custom.rb, line 84
def compose_lteq(table, column_name, allowed, value)
  validate_table_column(table, column_name, allowed)
  compose_lteq_node(table[column_name], value)
end
compose_not_contains(table, column_name, allowed, value) click to toggle source

Create not contains condition. @param [Arel::Table] table @param [Symbol] column_name @param [Array<Symbol>] allowed @param [Object] value @return [Arel::Nodes::Node] condition

# File lib/clearly/query/compose/custom.rb, line 137
def compose_not_contains(table, column_name, allowed, value)
  validate_table_column(table, column_name, allowed)
  compose_not_contains_node(table[column_name], value)
end
compose_not_ends_with(table, column_name, allowed, value) click to toggle source

Create not ends_with condition. @param [Arel::Table] table @param [Symbol] column_name @param [Array<Symbol>] allowed @param [Object] value @return [Arel::Nodes::Node] condition

# File lib/clearly/query/compose/custom.rb, line 181
def compose_not_ends_with(table, column_name, allowed, value)
  validate_table_column(table, column_name, allowed)
  compose_not_ends_with_node(table[column_name], value)
end
compose_not_eq(table, column_name, allowed, value) click to toggle source

Create not equals condition. @param [Arel::Table] table @param [Symbol] column_name @param [Array<Symbol>] allowed @param [Object] value @return [Arel::Nodes::Node] condition

# File lib/clearly/query/compose/custom.rb, line 31
def compose_not_eq(table, column_name, allowed, value)
  validate_table_column(table, column_name, allowed)
  compose_not_eq_node(table[column_name], value)
end
compose_not_gt(table, column_name, allowed, value) click to toggle source

Create not greater than condition. @param [Arel::Table] table @param [Symbol] column_name @param [Array<Symbol>] allowed @param [Object] value @return [Arel::Nodes::Node] condition

# File lib/clearly/query/compose/custom.rb, line 74
def compose_not_gt(table, column_name, allowed, value)
  compose_lteq(table, column_name, allowed, value)
end
compose_not_gteq(table, column_name, allowed, value) click to toggle source

Create not greater than or equal condition. @param [Arel::Table] table @param [Symbol] column_name @param [Array<Symbol>] allowed @param [Object] value @return [Arel::Nodes::Node] condition

# File lib/clearly/query/compose/custom.rb, line 116
def compose_not_gteq(table, column_name, allowed, value)
  compose_lt(table, column_name, allowed, value)
end
compose_not_in(table, column_name, allowed, values) click to toggle source

Create NOT IN condition. @param [Arel::Table] table @param [Symbol] column_name @param [Array<Symbol>] allowed @param [Array] values @return [Arel::Nodes::Node] condition

# File lib/clearly/query/compose/custom.rb, line 203
def compose_not_in(table, column_name, allowed, values)
  validate_table_column(table, column_name, allowed)
  compose_not_in_node(table[column_name], values)
end
compose_not_lt(table, column_name, allowed, value) click to toggle source

Create not less than condition. @param [Arel::Table] table @param [Symbol] column_name @param [Array<Symbol>] allowed @param [Object] value @return [Arel::Nodes::Node] condition

# File lib/clearly/query/compose/custom.rb, line 53
def compose_not_lt(table, column_name, allowed, value)
  compose_gteq(table, column_name, allowed, value)
end
compose_not_lteq(table, column_name, allowed, value) click to toggle source

Create not less than or equal condition. @param [Arel::Table] table @param [Symbol] column_name @param [Array<Symbol>] allowed @param [Object] value @return [Arel::Nodes::Node] condition

# File lib/clearly/query/compose/custom.rb, line 95
def compose_not_lteq(table, column_name, allowed, value)
  compose_gt(table, column_name, allowed, value)
end
compose_not_range(table, column_name, allowed, value) click to toggle source

Create NOT IN condition using from (inclusive) and to (exclusive). @param [Arel::Table] table @param [Symbol] column_name @param [Array<Symbol>] allowed @param [Object] value @return [Arel::Nodes::Node] condition

# File lib/clearly/query/compose/custom.rb, line 260
def compose_not_range(table, column_name, allowed, value)
  validate_table_column(table, column_name, allowed)
  compose_not_range_node(table[column_name], value)
end
compose_not_regex(table, column_name, allowed, value) click to toggle source

Create negated regular expression condition. Not available just now, maybe in Arel 6? @param [Arel::Table] table @param [Symbol] column_name @param [Array<Symbol>] allowed @param [Object] value @return [Arel::Nodes::Node] condition

# File lib/clearly/query/compose/custom.rb, line 226
def compose_not_regex(table, column_name, allowed, value)
  validate_table_column(table, column_name, allowed)
  compose_not_regex_node(table[column_name], value)
end
compose_not_starts_with(table, column_name, allowed, value) click to toggle source

Create not starts_with condition. @param [Arel::Table] table @param [Symbol] column_name @param [Array<Symbol>] allowed @param [Object] value @return [Arel::Nodes::Node] condition

# File lib/clearly/query/compose/custom.rb, line 159
def compose_not_starts_with(table, column_name, allowed, value)
  validate_table_column(table, column_name, allowed)
  compose_not_starts_with_node(table[column_name], value)
end
compose_null(table, column_name, allowed, value) click to toggle source

Create null comparison. @param [Arel::Table] table @param [Symbol] column_name @param [Array<Symbol>] allowed @param [Boolean] value @return [Arel::Nodes::Node] condition

# File lib/clearly/query/compose/custom.rb, line 237
def compose_null(table, column_name, allowed, value)
  validate_table_column(table, column_name, allowed)
  validate_boolean(value)
  compose_null_node(table[column_name], value)
end
compose_range(table, column_name, allowed, value) click to toggle source

Create IN condition using from (inclusive) and to (exclusive). @param [Arel::Table] table @param [Symbol] column_name @param [Array<Symbol>] allowed @param [Object] value @return [Arel::Nodes::Node] condition

# File lib/clearly/query/compose/custom.rb, line 249
def compose_range(table, column_name, allowed, value)
  validate_table_column(table, column_name, allowed)
  compose_range_node(table[column_name], value)
end
compose_regex(table, column_name, allowed, value) click to toggle source

Create regular expression condition. @param [Arel::Table] table @param [Symbol] column_name @param [Array<Symbol>] allowed @param [Object] value @return [Arel::Nodes::Node] condition

# File lib/clearly/query/compose/custom.rb, line 214
def compose_regex(table, column_name, allowed, value)
  validate_table_column(table, column_name, allowed)
  compose_regex_node(table[column_name], value)
end
compose_starts_with(table, column_name, allowed, value) click to toggle source

Create starts_with condition. @param [Arel::Table] table @param [Symbol] column_name @param [Array<Symbol>] allowed @param [Object] value @return [Arel::Nodes::Node] condition

# File lib/clearly/query/compose/custom.rb, line 148
def compose_starts_with(table, column_name, allowed, value)
  validate_table_column(table, column_name, allowed)
  compose_starts_with_node(table[column_name], value)
end