Sha256: 263581e5c143b59c6c225a2fd858e8af9a2280169e9816329effbbb5d5cbf3e9

Contents?: true

Size: 866 Bytes

Versions: 3

Compression:

Stored size: 866 Bytes

Contents

require_relative 'resource'

module Contentful
  module Management
    # Resource class for Locale.
    class Locale
      include Contentful::Management::Resource
      include Contentful::Management::Resource::SystemProperties
      include Contentful::Management::Resource::Refresher

      property :code, :string
      property :name, :string
      property :contentManagementApi, :boolean
      property :contentDeliveryApi, :boolean
      property :publish, :boolean
      property :default, :boolean

      # @private
      def self.create_attributes(_client, attributes)
        {
          'name' => attributes.fetch(:name),
          'code' => attributes.fetch(:code)
        }
      end

      protected

      def query_attributes(attributes)
        attributes.each_with_object({}) { |(k, v), result| result[k.to_sym] = v }
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
contentful-management-1.1.0 lib/contentful/management/locale.rb
contentful-management-1.0.1 lib/contentful/management/locale.rb
contentful-management-1.0.0 lib/contentful/management/locale.rb