Class: StatusPageRuby::Services::PullStatuses
- Inherits:
-
Object
- Object
- StatusPageRuby::Services::PullStatuses
- Defined in:
- lib/status_page_ruby/services/pull_statuses.rb
Instance Attribute Summary collapse
-
#status_repository ⇒ Object
readonly
Returns the value of attribute status_repository.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(status_repository) ⇒ PullStatuses
constructor
A new instance of PullStatuses.
Constructor Details
#initialize(status_repository) ⇒ PullStatuses
Returns a new instance of PullStatuses.
6 7 8 |
# File 'lib/status_page_ruby/services/pull_statuses.rb', line 6 def initialize(status_repository) @status_repository = status_repository end |
Instance Attribute Details
#status_repository ⇒ Object (readonly)
Returns the value of attribute status_repository.
4 5 6 |
# File 'lib/status_page_ruby/services/pull_statuses.rb', line 4 def status_repository @status_repository end |
Instance Method Details
#call ⇒ Object
10 11 12 13 14 |
# File 'lib/status_page_ruby/services/pull_statuses.rb', line 10 def call fetch_statuses.tap do |statuses| status_repository.create_batch(statuses) unless statuses.empty? end end |