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.
40 41 42 |
# File 'lib/contentful/management/environment.rb', line 40 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.
51 52 53 |
# File 'lib/contentful/management/environment.rb', line 51 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.
87 88 89 |
# File 'lib/contentful/management/environment.rb', line 87 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.
96 97 98 |
# File 'lib/contentful/management/environment.rb', line 96 def content_types EnvironmentContentTypeMethodsFactory.new(self) end |
#default_locale ⇒ String
Retrieves Default Locale for current Environment and leaves it cached
144 145 146 |
# File 'lib/contentful/management/environment.rb', line 144 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.
123 124 125 |
# File 'lib/contentful/management/environment.rb', line 123 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.
78 79 80 |
# File 'lib/contentful/management/environment.rb', line 78 def entries EnvironmentEntryMethodsFactory.new(self) end |
#environment_id ⇒ Object
Gets the environment ID
137 138 139 |
# File 'lib/contentful/management/environment.rb', line 137 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
152 153 154 155 156 157 |
# File 'lib/contentful/management/environment.rb', line 152 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.
105 106 107 |
# File 'lib/contentful/management/environment.rb', line 105 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.
132 133 134 |
# File 'lib/contentful/management/environment.rb', line 132 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.
114 115 116 |
# File 'lib/contentful/management/environment.rb', line 114 def ui_extensions EnvironmentUIExtensionMethodsFactory.new(self) end |