Module: Contentful::Management::Resource::EnvironmentAware
- Included in:
- Asset, ContentType, EditorInterface, Entry, Locale, Snapshot, UIExtension
- Defined in:
- lib/contentful/management/resource/environment_aware.rb
Overview
Mixin for environment aware resources
Instance Method Summary collapse
-
#environment_id ⇒ Object
Gets the environment ID for the resource.
Instance Method Details
#environment_id ⇒ Object
Gets the environment ID for the resource.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/contentful/management/resource/environment_aware.rb', line 7 def environment_id env = sys.fetch(:environment, {}) case env when ::Hash env.fetch(:id, 'master') when ::Contentful::Management::Link env.id else 'master' end end |