class SQB::WhereDSL

Attributes

hash[R]

Public Class Methods

new() click to toggle source
# File lib/sqb/where_dsl.rb, line 6
def initialize
  @hash = {}
end

Public Instance Methods

method_missing(name, value = nil) click to toggle source
# File lib/sqb/where_dsl.rb, line 10
def method_missing(name, value = nil)
  if name =~ /(.*)\=\z/
    attribute_name = $1
    @hash[attribute_name.to_sym] ||= {}
    @hash[attribute_name.to_sym][:equal] = value
  else
    @hash[name.to_sym] ||= {}
    attribute = PositiveAttribute.new(name.to_sym, @hash)
  end
end