Class: Contentful::Locale

Inherits:
Object
  • Object
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

Instance Method Summary collapse

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

#codeObject (readonly)

Returns the value of attribute code



5
6
7
# File 'lib/contentful/locale.rb', line 5

def code
  @code
end

#defaultObject (readonly)

Returns the value of attribute default



5
6
7
# File 'lib/contentful/locale.rb', line 5

def default
  @default
end

#nameObject (readonly)

Returns the value of attribute name



5
6
7
# File 'lib/contentful/locale.rb', line 5

def name
  @name
end