Module: Card::Set::I18nScope

Included in:
Card::Set
Defined in:
card/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



16
17
18
19
# File 'card/lib/card/set/i18n_scope.rb', line 16

def mod_name backtrace
  parts = path_parts backtrace
  mod_from_parts parts, path_set_index(parts)
end

#scope(backtrace) ⇒ Object

return scope for I18n



7
8
9
10
11
12
13
# File 'card/lib/card/set/i18n_scope.rb', line 7

def scope backtrace
  return "lib" unless (parts = path_parts backtrace)

  index = path_set_index parts
  mod = mod_from_parts parts, index
  mod || "lib"
end