Class: Bugwatch::ReportBuilder
- Inherits:
-
Object
- Object
- Bugwatch::ReportBuilder
- Defined in:
- lib/bugwatch/report_builder.rb
Constant Summary collapse
- VALID_CATEGORIES =
%w[ui behavior performance other].freeze
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(title, category: "other", severity: "warning", tags: {}, config: Bugwatch.configuration) ⇒ ReportBuilder
constructor
A new instance of ReportBuilder.
Constructor Details
#initialize(title, category: "other", severity: "warning", tags: {}, config: Bugwatch.configuration) ⇒ ReportBuilder
Returns a new instance of ReportBuilder.
7 8 9 10 11 12 13 |
# File 'lib/bugwatch/report_builder.rb', line 7 def initialize(title, category: "other", severity: "warning", tags: {}, config: Bugwatch.configuration) @title = title.to_s @category = VALID_CATEGORIES.include?(category.to_s) ? category.to_s : "other" @severity = severity.to_s @tags = || {} @config = config end |
Instance Method Details
#build ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/bugwatch/report_builder.rb', line 15 def build { issue_type: "manual", category: @category, exception: exception_payload, app: app_payload, user: UserContext.get, breadcrumbs: BreadcrumbCollector.all, tags: @tags, severity: @severity } end |