Module: Comable::Sample

Defined in:
lib/comable/sample.rb,
lib/comable/sample/name.rb,
lib/comable/sample/engine.rb,
lib/comable/sample/address.rb,
lib/comable/sample/phone_number.rb

Defined Under Namespace

Modules: Address, Name, PhoneNumber Classes: Engine

Class Method Summary collapse

Class Method Details

.import(filename) ⇒ Object



25
26
27
28
29
# File 'lib/comable/sample.rb', line 25

def import(filename)
  filepath = Rails.root.join("db/samples/#{filename}.rb")
  filepath = "#{default_dir}/#{filename}.rb" unless File.exist?(filepath)
  require File.expand_path(filepath)
end

.import_allObject



19
20
21
22
23
# File 'lib/comable/sample.rb', line 19

def import_all
  definitions.each do |definition|
    import(definition)
  end
end

.translate(key, options = {}) ⇒ Object Also known as: t



13
14
15
# File 'lib/comable/sample.rb', line 13

def translate(key, options = {})
  Comable.translate("sample.#{key}", options)
end