Module: Maguire

Defined in:
lib/maguire.rb,
lib/maguire/hash.rb,
lib/maguire/locale.rb,
lib/maguire/version.rb,
lib/maguire/currency.rb,
lib/maguire/data_set.rb

Defined Under Namespace

Modules: Hash Classes: Currency, DataSet, Locale

Constant Summary collapse

VERSION =
'0.2.3'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.data_pathsObject

Returns the value of attribute data_paths.



15
16
17
# File 'lib/maguire.rb', line 15

def data_paths
  @data_paths
end

.default_localeObject

Returns the value of attribute default_locale.



15
16
17
# File 'lib/maguire.rb', line 15

def default_locale
  @default_locale
end

.locale_pathsObject

Returns the value of attribute locale_paths.



15
16
17
# File 'lib/maguire.rb', line 15

def locale_paths
  @locale_paths
end

.root_pathObject

Returns the value of attribute root_path.



15
16
17
# File 'lib/maguire.rb', line 15

def root_path
  @root_path
end

Class Method Details

.format(money, options = {}) ⇒ Object



30
31
32
33
34
# File 'lib/maguire.rb', line 30

def format(money, options={})
  locale = Locale.lookup(options[:locale] || Maguire.default_locale)

  locale.format(money[:value], money[:currency], options)
end

.reset_data_pathsObject



17
18
19
20
21
22
23
# File 'lib/maguire.rb', line 17

def reset_data_paths
  data_paths.clear
  data_paths <<
    root_path + 'iso_data/seed_layer'   <<
    root_path + 'iso_data/patch_layer' <<
    root_path + 'iso_data/symbol_layer'
end

.reset_locale_pathsObject



25
26
27
28
# File 'lib/maguire.rb', line 25

def reset_locale_paths
  locale_paths.clear
  locale_paths << root_path + 'locale'
end