Sha256: 0089e0effbc706be063dc167f7a0b66af30857c853149894216f70aaa1be1eae
Contents?: true
Size: 669 Bytes
Versions: 15
Compression:
Stored size: 669 Bytes
Contents
module Contentful module Management module Resource # Mixin for environment aware resources module EnvironmentAware # Gets the environment ID for the resource. 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 end end end end
Version data entries
15 entries across 15 versions & 1 rubygems