Class: Mxrb::TeamServer::ProjectsApi
- Inherits:
-
Object
- Object
- Mxrb::TeamServer::ProjectsApi
- Defined in:
- lib/mxrb/team_server.rb
Overview
Read-only paginated client for Mendix's official Projects API.
Constant Summary collapse
- BASE =
'https://projects-api.home.mendix.com/v2/projects?limit=100'- HOST =
'projects-api.home.mendix.com'- MAX_PAGES =
100
Instance Method Summary collapse
- #all ⇒ Object
-
#initialize(credentials: Credentials.new, client: OfficialMarketplace::HttpClient.new) ⇒ ProjectsApi
constructor
A new instance of ProjectsApi.
Constructor Details
#initialize(credentials: Credentials.new, client: OfficialMarketplace::HttpClient.new) ⇒ ProjectsApi
Returns a new instance of ProjectsApi.
344 345 346 347 |
# File 'lib/mxrb/team_server.rb', line 344 def initialize(credentials: Credentials.new, client: OfficialMarketplace::HttpClient.new) @credentials = credentials @client = client end |
Instance Method Details
#all ⇒ Object
349 350 351 352 353 354 355 |
# File 'lib/mxrb/team_server.rb', line 349 def all projects = [] each_page { projects.concat(Array(_1['items'])) } projects.freeze rescue MarketplaceError => e raise TeamServerError, e. end |