Class: Rack::DevInsight::Result::Sql::Queries
- Inherits:
-
Object
- Object
- Rack::DevInsight::Result::Sql::Queries
- Defined in:
- lib/rack/dev_insight/result/sql/queries.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #add(statement, binds, backtrace, duration) ⇒ Object
- #attributes ⇒ Object
-
#initialize ⇒ Queries
constructor
A new instance of Queries.
Constructor Details
#initialize ⇒ Queries
Returns a new instance of Queries.
13 14 15 16 |
# File 'lib/rack/dev_insight/result/sql/queries.rb', line 13 def initialize @id = 0 @data = [] end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
11 12 13 |
# File 'lib/rack/dev_insight/result/sql/queries.rb', line 11 def id @id end |
Instance Method Details
#add(statement, binds, backtrace, duration) ⇒ Object
18 19 20 |
# File 'lib/rack/dev_insight/result/sql/queries.rb', line 18 def add(statement, binds, backtrace, duration) @data << Query.new(@id += 1, statement, binds, backtrace.map(&:to_h), duration) end |
#attributes ⇒ Object
22 23 24 |
# File 'lib/rack/dev_insight/result/sql/queries.rb', line 22 def attributes @data.map(&:to_h) end |