module WhereableClause::ConditionIn

Public Instance Methods

to_h() click to toggle source

Hash for in operator

# File lib/whereable_clause.rb, line 63
def to_h
  if opt.empty?
    {
      eq: {
        column: column.to_s,
        literal: literal.to_s,
      },
    }
  else
    {
      in: {
        column: column.to_s,
        literals: [literal.to_s] + opt.elements.map { |o| o.literal.to_s },
      },
    }
  end
end