Exception: QuoteSql::Error

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/quote_sql.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(quote_sql, errors) ⇒ Error



154
155
156
157
# File 'lib/quote_sql.rb', line 154

def initialize(quote_sql, errors)
  @object = quote_sql
  @errors = errors
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



159
160
161
# File 'lib/quote_sql.rb', line 159

def errors
  @errors
end

#objectObject (readonly)

Returns the value of attribute object.



159
160
161
# File 'lib/quote_sql.rb', line 159

def object
  @object
end

Instance Method Details

#messageObject

def inspect

super + errors.flat_map { [_1.inspect, _1.backtrace] }

end



169
170
171
# File 'lib/quote_sql.rb', line 169

def message
  super + %Q@<QuoteSql #{sql} #{@object.errors.inspect}>@
end

#sqlObject



161
162
163
# File 'lib/quote_sql.rb', line 161

def sql
  @object.original.inspect
end