module Contentful::Management::Resource::EnvironmentAware
Mixin for environment aware resources
Public Instance Methods
Source
# File lib/contentful/management/resource/environment_aware.rb, line 9 def environment_id env = sys.fetch(:environment, {}) env_from_sys = case env when ::Hash env.fetch(:id, nil) when ::Contentful::Management::Link, ::Contentful::Management::Environment env.id end return env_from_sys if env_from_sys respond_to?(:content_type) && content_type && content_type.environment_id || 'master' end
Gets the environment ID for the resource.