Module: Stannum::Messages

Defined in:
lib/stannum/messages.rb,
lib/stannum/messages/default_loader.rb,
lib/stannum/messages/default_strategy.rb

Overview

Namespace for generating messages for Stannum::Errors.

Defined Under Namespace

Classes: DefaultLoader, DefaultStrategy

Class Method Summary collapse

Class Method Details

.locales_pathString

Returns the absolute path to the configured locales.

Returns:

  • (String)

    the absolute path to the configured locales.



12
13
14
# File 'lib/stannum/messages.rb', line 12

def self.locales_path
  File.join(Stannum.gem_path, 'config', 'locales')
end

.strategy#call

Returns the configured strategy for generating messages.

Returns:

  • (#call)

    the configured strategy for generating messages.



17
18
19
# File 'lib/stannum/messages.rb', line 17

def self.strategy
  @strategy ||= DefaultStrategy.new
end

.strategy=(strategy) ⇒ Object

Parameters:

  • strategy (#call)

    The strategy to use to generate error messages.



22
23
24
# File 'lib/stannum/messages.rb', line 22

def self.strategy=(strategy)
  @strategy = strategy
end