Module: Card::Set::I18nScope

Included in:
Card::Set
Defined in:
lib/card/set/i18n_scope.rb

Instance Method Summary collapse

Instance Method Details

#mod_name(backtrace) ⇒ Object

extract the mod name from the path of a set's tmp file



11
12
13
14
# File 'lib/card/set/i18n_scope.rb', line 11

def mod_name backtrace
  parts = path_parts backtrace
  parts[path_mod_index(parts)]
end

#scope(backtrace) ⇒ Object

return scope for I18n



5
6
7
8
# File 'lib/card/set/i18n_scope.rb', line 5

def scope backtrace
  parts = set_path_parts backtrace
  "mod.#{parts.first}.set.#{parts[1..-1].join '.'}"
end