Module: Merb::Global::MessageProviders

Includes:
Providers
Included in:
DataMapper
Defined in:
lib/merb_global/message_providers.rb,
lib/merb_global/message_providers/mock.rb,
lib/merb_global/message_providers/yaml.rb,
lib/merb_global/message_providers/sequel.rb,
lib/merb_global/message_providers/gettext.rb,
lib/merb_global/message_providers/data_mapper.rb,
lib/merb_global/message_providers/active_record.rb

Defined Under Namespace

Modules: Base Classes: ActiveRecord, DataMapper, Gettext, Mock, Sequel, Yaml

Class Method Summary collapse

Methods included from Providers

included

Class Method Details

.localedirObject

call-seq:

localedir => localdir

Returns the directory where locales are stored for file-backed providers (such as gettext or yaml)

Returns

localedir<String>>

Directory where the locales are stored



15
16
17
18
19
20
21
22
23
# File 'lib/merb_global/message_providers.rb', line 15

def self.localedir
  localedir =
    if Merb::Global.config :flat
      'locale'
    else
      Merb::Global.config :localedir, File.join('app', 'locale')
    end
  File.join Merb.root, localedir
end

.providerObject

call-seq:

provider => provider

Returns the provider of required type

Returns

provider<Provider>

Returns provider



31
32
33
# File 'lib/merb_global/message_providers.rb', line 31

def self.provider
  @@provider ||= self[Merb::Global.config(:message_provider, 'gettext')]
end