Class: Contentful::Locale
- Inherits:
-
Object
- Object
- 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.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(json) ⇒ Locale
constructor
A new instance of Locale.
Constructor Details
#initialize(json) ⇒ Locale
Returns a new instance of Locale
7 8 9 10 11 |
# File 'lib/contentful/locale.rb', line 7 def initialize(json) @code = json.fetch('code', nil) @name = json.fetch('name', nil) @default = json.fetch('default', false) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code
5 6 7 |
# File 'lib/contentful/locale.rb', line 5 def code @code end |
#default ⇒ Object (readonly)
Returns the value of attribute default
5 6 7 |
# File 'lib/contentful/locale.rb', line 5 def default @default end |
#name ⇒ Object (readonly)
Returns the value of attribute name
5 6 7 |
# File 'lib/contentful/locale.rb', line 5 def name @name end |