Sha256: e0a39041cff3e2e3c240ef997e2b2187477f45264e467541d4bb4c3cdedebcb6

Contents?: true

Size: 542 Bytes

Versions: 43

Compression:

Stored size: 542 Bytes

Contents

require_relative 'base_resource'
require_relative 'locale'

module Contentful
  # Resource class for Space.
  # https://www.contentful.com/developers/documentation/content-delivery-api/#spaces
  class Space < BaseResource
    attr_reader :name, :locales

    def initialize(item, *)
      super

      @name = item.fetch('name', nil)
      @locales = item.fetch('locales', []).map { |locale| Locale.new(locale) }
    end

    # @private
    def reload(client = nil)
      return client.space unless client.nil?

      false
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
contentful-2.17.1 lib/contentful/space.rb
contentful-2.17.0 lib/contentful/space.rb
contentful-2.16.3 lib/contentful/space.rb
contentful-2.16.2 lib/contentful/space.rb
contentful-2.16.1 lib/contentful/space.rb
contentful-2.16.0 lib/contentful/space.rb
contentful-2.15.4 lib/contentful/space.rb
contentful-2.15.3 lib/contentful/space.rb
contentful-2.15.2 lib/contentful/space.rb
contentful-2.15.1 lib/contentful/space.rb
contentful-2.15.0 lib/contentful/space.rb
contentful-2.14.0 lib/contentful/space.rb
contentful-2.13.3 lib/contentful/space.rb
contentful-2.13.2 lib/contentful/space.rb
contentful-2.13.1 lib/contentful/space.rb
contentful-2.13.0 lib/contentful/space.rb
contentful-2.12.0 lib/contentful/space.rb
contentful-2.11.1 lib/contentful/space.rb
contentful-2.11.0 lib/contentful/space.rb
contentful-2.10.1 lib/contentful/space.rb