Class: WCC::Contentful::SimpleClient::Management
- Inherits:
-
WCC::Contentful::SimpleClient
- Object
- WCC::Contentful::SimpleClient
- WCC::Contentful::SimpleClient::Management
- Defined in:
- lib/wcc/contentful/simple_client.rb
Constant Summary
Constants inherited from WCC::Contentful::SimpleClient
Instance Method Summary collapse
- #content_types(space: nil, **query) ⇒ Object
-
#initialize(management_token:, **options) ⇒ Management
constructor
A new instance of Management.
Methods inherited from WCC::Contentful::SimpleClient
Constructor Details
#initialize(management_token:, **options) ⇒ Management
Returns a new instance of Management.
158 159 160 161 162 163 164 165 |
# File 'lib/wcc/contentful/simple_client.rb', line 158 def initialize(management_token:, **) super( api_url: [:api_url] || 'https://api.contentful.com', space: [:space] || '/', access_token: management_token, ** ) end |
Instance Method Details
#content_types(space: nil, **query) ⇒ Object
167 168 169 170 171 172 173 |
# File 'lib/wcc/contentful/simple_client.rb', line 167 def content_types(space: nil, **query) space ||= @space raise ArgumentError, 'please provide a space ID' if space.nil? resp = get("/spaces/#{space}/content_types", query) resp.assert_ok! end |