Class: Contentful::Space
- Inherits:
-
BaseResource
- Object
- BaseResource
- Contentful::Space
- Defined in:
- lib/contentful/space.rb
Overview
Resource class for Space. www.contentful.com/developers/documentation/content-delivery-api/#spaces
Instance Attribute Summary collapse
-
#locales ⇒ Object
readonly
Returns the value of attribute locales.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from BaseResource
Instance Method Summary collapse
-
#initialize(item) ⇒ Space
constructor
A new instance of Space.
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
#locales ⇒ Object (readonly)
Returns the value of attribute locales
8 9 10 |
# File 'lib/contentful/space.rb', line 8 def locales @locales end |
#name ⇒ Object (readonly)
Returns the value of attribute name
8 9 10 |
# File 'lib/contentful/space.rb', line 8 def name @name end |