Class: Contentful::Space

Inherits:
BaseResource show all
Defined in:
lib/contentful/space.rb

Overview

Instance Attribute Summary collapse

Attributes inherited from BaseResource

#default_locale, #raw, #sys

Instance Method Summary collapse

Methods inherited from BaseResource

#==

Constructor Details

#initialize(item) ⇒ Space

Returns a new instance of Space



10
11
12
13
14
15
# File 'lib/contentful/space.rb', line 10

def initialize(item, *)
  super

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

Instance Attribute Details

#localesObject (readonly)

Returns the value of attribute locales



8
9
10
# File 'lib/contentful/space.rb', line 8

def locales
  @locales
end

#nameObject (readonly)

Returns the value of attribute name



8
9
10
# File 'lib/contentful/space.rb', line 8

def name
  @name
end