Class: Contentful::Management::Environment
- Inherits:
-
Object
- Object
- Contentful::Management::Environment
- Includes:
- Resource, Resource::Refresher, Resource::SystemProperties
- Defined in:
- lib/contentful/management/environment.rb
Overview
Resource class for Environment.
Instance Attribute Summary
Attributes included from Resource::SystemProperties
Attributes included from Resource
#client, #properties, #raw_object, #request
Class Method Summary collapse
-
.create(client, space_id, attributes = {}) ⇒ Contentful::Management::Environment
Creates an environment.
-
.find(client, space_id, environment_id) ⇒ Contentful::Management::Environment
Finds an environment by ID.
Instance Method Summary collapse
-
#assets ⇒ Contentful::Management::EnvironmentAssetMethodsFactory
Allows manipulation of assets in context of the current environment Allows listing all assets for the current environment, creating new and finding one by ID.
-
#content_types ⇒ Contentful::Management::EnvironmentContentTypeMethodsFactory
Allows manipulation of content types in context of the current environment Allows listing all content types for the current environment, creating new and finding one by ID.
-
#default_locale ⇒ String
Retrieves Default Locale for current Environment and leaves it cached.
-
#editor_interfaces ⇒ Contentful::Management::EnvironmentEditorInterfaceMethodsFactory
Allows manipulation of editor interfaces in context of the current environment Allows listing of editor interfaces for the current environment.
-
#entries ⇒ Contentful::Management::EnvironmentEntryMethodsFactory
Allows manipulation of entries in context of the current environment Allows listing all entries for the current environment, creating new and finding one by ID.
-
#environment_id ⇒ Object
Gets the environment ID.
-
#find_locale ⇒ String
Finds Default Locale Code for current Space This request makes an API call to the Locale endpoint.
-
#locales ⇒ Contentful::Management::EnvironmentLocaleMethodsFactory
Allows manipulation of locales in context of the current environment Allows listing all locales for the current environment, creating new and finding one by ID.
-
#tags ⇒ Contentful::Management::EnvironmentTagMethodsFactory
Allows manipulation of tags in context of the current environment Allows listing all tags for the current environment, creating new and finding one by ID.
-
#ui_extensions ⇒ Contentful::Management::EnvironmentUIExtensionMethodsFactory
Allows manipulation of UI extensions in context of the current environment Allows listing all UI extensions for the current environment, creating new and finding one by ID.
Methods included from Resource::Refresher
Methods included from Resource
#array?, #destroy, #fields, #nested_locale_fields?, #resource?, #save, #sys, #update
Class Method Details
.create(client, space_id, attributes = {}) ⇒ Contentful::Management::Environment
Creates an environment.
38 39 40 |
# File 'lib/contentful/management/environment.rb', line 38 def self.create(client, space_id, attributes = {}) super(client, space_id, nil, attributes) end |
.find(client, space_id, environment_id) ⇒ Contentful::Management::Environment
Finds an environment by ID.
49 50 51 |
# File 'lib/contentful/management/environment.rb', line 49 def self.find(client, space_id, environment_id) super(client, space_id, nil, environment_id) end |
Instance Method Details
#assets ⇒ Contentful::Management::EnvironmentAssetMethodsFactory
Allows manipulation of assets in context of the current environment Allows listing all assets for the current environment, creating new and finding one by ID.
85 86 87 |
# File 'lib/contentful/management/environment.rb', line 85 def assets EnvironmentAssetMethodsFactory.new(self) end |
#content_types ⇒ Contentful::Management::EnvironmentContentTypeMethodsFactory
Allows manipulation of content types in context of the current environment Allows listing all content types for the current environment, creating new and finding one by ID.
94 95 96 |
# File 'lib/contentful/management/environment.rb', line 94 def content_types EnvironmentContentTypeMethodsFactory.new(self) end |
#default_locale ⇒ String
Retrieves Default Locale for current Environment and leaves it cached
142 143 144 |
# File 'lib/contentful/management/environment.rb', line 142 def default_locale self.found_locale ||= find_locale end |
#editor_interfaces ⇒ Contentful::Management::EnvironmentEditorInterfaceMethodsFactory
Allows manipulation of editor interfaces in context of the current environment Allows listing of editor interfaces for the current environment.
121 122 123 |
# File 'lib/contentful/management/environment.rb', line 121 def editor_interfaces EnvironmentEditorInterfaceMethodsFactory.new(self) end |
#entries ⇒ Contentful::Management::EnvironmentEntryMethodsFactory
Allows manipulation of entries in context of the current environment Allows listing all entries for the current environment, creating new and finding one by ID.
76 77 78 |
# File 'lib/contentful/management/environment.rb', line 76 def entries EnvironmentEntryMethodsFactory.new(self) end |
#environment_id ⇒ Object
Gets the environment ID
135 136 137 |
# File 'lib/contentful/management/environment.rb', line 135 def environment_id id end |
#find_locale ⇒ String
Finds Default Locale Code for current Space This request makes an API call to the Locale endpoint
150 151 152 153 154 155 |
# File 'lib/contentful/management/environment.rb', line 150 def find_locale locale = locales.all.detect(&:default) return locale.code if locale default_locale end |
#locales ⇒ Contentful::Management::EnvironmentLocaleMethodsFactory
Allows manipulation of locales in context of the current environment Allows listing all locales for the current environment, creating new and finding one by ID.
103 104 105 |
# File 'lib/contentful/management/environment.rb', line 103 def locales EnvironmentLocaleMethodsFactory.new(self) end |
#tags ⇒ Contentful::Management::EnvironmentTagMethodsFactory
Allows manipulation of tags in context of the current environment Allows listing all tags for the current environment, creating new and finding one by ID.
130 131 132 |
# File 'lib/contentful/management/environment.rb', line 130 def EnvironmentTagMethodsFactory.new(self) end |
#ui_extensions ⇒ Contentful::Management::EnvironmentUIExtensionMethodsFactory
Allows manipulation of UI extensions in context of the current environment Allows listing all UI extensions for the current environment, creating new and finding one by ID.
112 113 114 |
# File 'lib/contentful/management/environment.rb', line 112 def ui_extensions EnvironmentUIExtensionMethodsFactory.new(self) end |