Class: DangerBoss::AlertService
- Inherits:
-
Object
- Object
- DangerBoss::AlertService
- Defined in:
- lib/danger_boss/alert_service.rb
Instance Attribute Summary collapse
-
#driver ⇒ Object
readonly
Returns the value of attribute driver.
Instance Method Summary collapse
- #all(params: {}) ⇒ Object
-
#initialize(driver:) ⇒ AlertService
constructor
A new instance of AlertService.
Constructor Details
#initialize(driver:) ⇒ AlertService
Returns a new instance of AlertService.
7 8 9 |
# File 'lib/danger_boss/alert_service.rb', line 7 def initialize(driver:) @driver = driver end |
Instance Attribute Details
#driver ⇒ Object (readonly)
Returns the value of attribute driver.
5 6 7 |
# File 'lib/danger_boss/alert_service.rb', line 5 def driver @driver end |
Instance Method Details
#all(params: {}) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/danger_boss/alert_service.rb', line 11 def all(params: {}) driver.get(path: 'alerts', params: params) do |m| m.success do |raw_alerts| raw_alerts.map {|alert| Alert.new(alert)} end m.failure do |error| raise error end end end |