Class: Contentful::Locale

Inherits:
BaseResource show all
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

Attributes inherited from BaseResource

#default_locale, #raw, #sys

Instance Method Summary collapse

Methods inherited from BaseResource

#==, #reload

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

#codeObject (readonly)

Returns the value of attribute code



7
8
9
# File 'lib/contentful/locale.rb', line 7

def code
  @code
end

#defaultObject (readonly)

Returns the value of attribute default



7
8
9
# File 'lib/contentful/locale.rb', line 7

def default
  @default
end

#fallback_codeObject (readonly)

Returns the value of attribute fallback_code



7
8
9
# File 'lib/contentful/locale.rb', line 7

def fallback_code
  @fallback_code
end

#nameObject (readonly)

Returns the value of attribute name



7
8
9
# File 'lib/contentful/locale.rb', line 7

def name
  @name
end