Class: QueryTrack::Notifications::Custom
- Inherits:
-
Object
- Object
- QueryTrack::Notifications::Custom
- Defined in:
- lib/query_track/notifications/custom.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(code, duration) ⇒ Custom
constructor
A new instance of Custom.
Constructor Details
#initialize(code, duration) ⇒ Custom
Returns a new instance of Custom.
6 7 8 9 |
# File 'lib/query_track/notifications/custom.rb', line 6 def initialize(code, duration) @code = code.strip @duration = duration end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
4 5 6 |
# File 'lib/query_track/notifications/custom.rb', line 4 def code @code end |
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
4 5 6 |
# File 'lib/query_track/notifications/custom.rb', line 4 def duration @duration end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/query_track/notifications/custom.rb', line 11 def call return unless QueryTrack::Settings.config.notifications.custom_handler trace = QueryTrack::Trace.new(caller).call QueryTrack::Settings.config.notifications.custom_handler.call(code, duration, trace) end |