Class: Rubino::API::Operations::OAuth::Connections::ListOperation
- Inherits:
-
Object
- Object
- Rubino::API::Operations::OAuth::Connections::ListOperation
- Defined in:
- lib/rubino/api/operations/oauth/connections/list_operation.rb
Overview
GET /v1/oauth/connections Lists stored OAuth connections through Serializer, which strips tokens and other secret fields before they leave the API.
Class Method Summary collapse
Instance Method Summary collapse
- #call(_request) ⇒ Object
-
#initialize(repository: nil) ⇒ ListOperation
constructor
Accepts an alternate connection repository for tests.
Constructor Details
#initialize(repository: nil) ⇒ ListOperation
Accepts an alternate connection repository for tests.
17 18 19 |
# File 'lib/rubino/api/operations/oauth/connections/list_operation.rb', line 17 def initialize(repository: nil) @repository = repository end |
Class Method Details
.call(request) ⇒ Object
12 13 14 |
# File 'lib/rubino/api/operations/oauth/connections/list_operation.rb', line 12 def self.call(request) new.call(request) end |
Instance Method Details
#call(_request) ⇒ Object
21 22 23 24 |
# File 'lib/rubino/api/operations/oauth/connections/list_operation.rb', line 21 def call(_request) connections = repository.list.map { |c| Serializer.call(c) } [200, connections] end |