Class: Footnotes::Notes::QuerySubscriberNotifactionEvent
- Inherits:
-
Object
- Object
- Footnotes::Notes::QuerySubscriberNotifactionEvent
- Defined in:
- lib/rails-footnotes/notes/queries_note.rb
Instance Attribute Summary collapse
-
#event ⇒ Object
readonly
Returns the value of attribute event.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#trace ⇒ Object
readonly
Returns the value of attribute trace.
Instance Method Summary collapse
-
#initialize(event, ctrace) ⇒ QuerySubscriberNotifactionEvent
constructor
A new instance of QuerySubscriberNotifactionEvent.
- #type ⇒ Object
Constructor Details
#initialize(event, ctrace) ⇒ QuerySubscriberNotifactionEvent
Returns a new instance of QuerySubscriberNotifactionEvent.
82 83 84 |
# File 'lib/rails-footnotes/notes/queries_note.rb', line 82 def initialize(event, ctrace) @event, @ctrace, @query = event, ctrace, event.payload[:sql] end |
Instance Attribute Details
#event ⇒ Object (readonly)
Returns the value of attribute event.
79 80 81 |
# File 'lib/rails-footnotes/notes/queries_note.rb', line 79 def event @event end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
79 80 81 |
# File 'lib/rails-footnotes/notes/queries_note.rb', line 79 def query @query end |
#trace ⇒ Object (readonly)
Returns the value of attribute trace.
79 80 81 |
# File 'lib/rails-footnotes/notes/queries_note.rb', line 79 def trace @trace end |
Instance Method Details
#type ⇒ Object
90 91 92 93 |
# File 'lib/rails-footnotes/notes/queries_note.rb', line 90 def type return @type if @type @type = self.query.match(/^(select|insert|update|delete|alter)\b/i) || 'Unknown' end |