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



16
17
18
19
20
# File 'lib/comable/sample.rb', line 16

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



10
11
12
13
14
# File 'lib/comable/sample.rb', line 10

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

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



4
5
6
# File 'lib/comable/sample.rb', line 4

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