Sha256: fc34c60d5e2457648f6a13925aa317c9a63172b08eb542d9833e850c4b57398b
Contents?: true
Size: 1.3 KB
Versions: 19
Compression:
Stored size: 1.3 KB
Contents
require_relative 'resource' require_relative 'resource/environment_aware' module Contentful module Management # Resource class for Locale. class Locale include Contentful::Management::Resource include Contentful::Management::Resource::SystemProperties include Contentful::Management::Resource::Refresher include Contentful::Management::Resource::EnvironmentAware property :code, :string property :name, :string property :publish, :boolean property :default, :boolean property :optional, :boolean property :fallbackCode, :string property :contentDeliveryApi, :boolean property :contentManagementApi, :boolean # @private def self.create_attributes(_client, attributes) { 'name' => attributes.fetch(:name), 'code' => attributes.fetch(:code), 'optional' => attributes.fetch(:optional, false), 'fallbackCode' => attributes.fetch(:fallback_code, nil) } end protected def query_attributes(attributes) { name: name, code: code, optional: optional, fallbackCode: fallback_code }.merge( attributes.each_with_object({}) { |(k, v), result| result[k.to_sym] = v } ) end end end end
Version data entries
19 entries across 19 versions & 1 rubygems