Class: Footnotes::Extensions::Sql

Inherits:
Object
  • Object
show all
Defined in:
lib/rails-footnotes/notes/queries_note.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, name, time, query, explain) ⇒ Sql

Returns a new instance of Sql.



130
131
132
133
134
135
136
137
138
139
140
# File 'lib/rails-footnotes/notes/queries_note.rb', line 130

def initialize(type, name, time, query, explain)
  @type = type
  @name = name
  @time = time
  @query = query
  @explain = explain

  # Strip, select those ones from app and reject first two, because they
  # are from the plugin
  @trace = Kernel.caller.collect(&:strip).select{|i| i.gsub!(/^#{Rails.root}\//im, '') }[2..-1]
end

Instance Attribute Details

#explainObject

Returns the value of attribute explain.



128
129
130
# File 'lib/rails-footnotes/notes/queries_note.rb', line 128

def explain
  @explain
end

#nameObject

Returns the value of attribute name.



128
129
130
# File 'lib/rails-footnotes/notes/queries_note.rb', line 128

def name
  @name
end

#queryObject

Returns the value of attribute query.



128
129
130
# File 'lib/rails-footnotes/notes/queries_note.rb', line 128

def query
  @query
end

#timeObject

Returns the value of attribute time.



128
129
130
# File 'lib/rails-footnotes/notes/queries_note.rb', line 128

def time
  @time
end

#traceObject

Returns the value of attribute trace.



128
129
130
# File 'lib/rails-footnotes/notes/queries_note.rb', line 128

def trace
  @trace
end

#typeObject

Returns the value of attribute type.



128
129
130
# File 'lib/rails-footnotes/notes/queries_note.rb', line 128

def type
  @type
end