Class: Webhookdb::ServiceIntegration::Stats
- Inherits:
-
Object
- Object
- Webhookdb::ServiceIntegration::Stats
- Defined in:
- lib/webhookdb/service_integration.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
- #as_json(*_o) ⇒ Object
- #display_headers ⇒ Object
-
#initialize(message, data) ⇒ Stats
constructor
A new instance of Stats.
Constructor Details
#initialize(message, data) ⇒ Stats
Returns a new instance of Stats.
162 163 164 165 |
# File 'lib/webhookdb/service_integration.rb', line 162 def initialize(, data) @message = @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
160 161 162 |
# File 'lib/webhookdb/service_integration.rb', line 160 def data @data end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
160 161 162 |
# File 'lib/webhookdb/service_integration.rb', line 160 def @message end |
Instance Method Details
#as_json(*_o) ⇒ Object
179 180 181 |
# File 'lib/webhookdb/service_integration.rb', line 179 def as_json(*_o) return @data.merge(message: @message, display_headers: self.display_headers) end |
#display_headers ⇒ Object
167 168 169 170 171 172 173 174 175 176 177 |
# File 'lib/webhookdb/service_integration.rb', line 167 def display_headers return [ [:count_last_7_days_formatted, "Count Last 7 Days"], [:success_last_7_days_formatted, "Successful Last 7 Days"], [:success_last_7_days_percent_formatted, "Successful Last 7 Days %"], [:rejected_last_7_days_formatted, "Rejected Last 7 Days"], [:rejected_last_7_days_percent_formatted, "Rejected Last 7 Days %"], [:successful_of_last_10_formatted, "Successful Of Last 10 Webhooks"], [:rejected_of_last_10_formatted, "Rejected Of Last 10 Webhooks"], ] end |