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
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
109 110 111 112 113 114 115 116 |
# File 'lib/wcc/contentful/simple_client.rb', line 109 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
118 119 120 121 122 123 124 |
# File 'lib/wcc/contentful/simple_client.rb', line 118 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 |