Class: Contentful::Locale
- Inherits:
-
BaseResource
- Object
- BaseResource
- Contentful::Locale
- Defined in:
- lib/contentful/locale.rb
Overview
A Locale definition as included in Space Read more about Localization at www.contentful.com/developers/documentation/content-delivery-api/#i18n
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#default ⇒ Object
readonly
Returns the value of attribute default.
-
#fallback_code ⇒ Object
readonly
Returns the value of attribute fallback_code.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from BaseResource
Instance Method Summary collapse
-
#initialize(item) ⇒ Locale
constructor
A new instance of Locale.
Methods inherited from BaseResource
Constructor Details
#initialize(item) ⇒ Locale
Returns a new instance of Locale
9 10 11 12 13 14 |
# File 'lib/contentful/locale.rb', line 9 def initialize(item, *) @code = item.fetch('code', nil) @name = item.fetch('name', nil) @default = item.fetch('default', false) @fallback_code = item.fetch('fallbackCode', nil) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code
7 8 9 |
# File 'lib/contentful/locale.rb', line 7 def code @code end |
#default ⇒ Object (readonly)
Returns the value of attribute default
7 8 9 |
# File 'lib/contentful/locale.rb', line 7 def default @default end |
#fallback_code ⇒ Object (readonly)
Returns the value of attribute fallback_code
7 8 9 |
# File 'lib/contentful/locale.rb', line 7 def fallback_code @fallback_code end |
#name ⇒ Object (readonly)
Returns the value of attribute name
7 8 9 |
# File 'lib/contentful/locale.rb', line 7 def name @name end |