Module: Interpret

Defined in:
lib/interpret.rb,
lib/interpret/engine.rb,
lib/interpret/logger.rb,
lib/interpret/version.rb,
app/models/interpret/ability.rb,
app/models/interpret/translation.rb,
app/helpers/interpret/interpret_helper.rb,
app/models/interpret/expiration_observer.rb,
app/controllers/interpret/translations_controller.rb

Defined Under Namespace

Modules: InterpretHelper Classes: Ability, BaseController, Engine, ExpirationObserver, InterpretLogger, MissingTranslationsController, SearchController, ToolsController, Translation, TranslationsController

Constant Summary collapse

VERSION =
"1.1.2"
@@parent_controller =
"application_controller"
@@registered_envs =
[:production, :staging]
@@soft =
true
@@black_list =
[]
@@current_user =
"current_user"
@@ability =
"interpret/ability"

Class Method Summary collapse

Class Method Details

.abilityObject



35
36
37
38
39
40
41
# File 'lib/interpret.rb', line 35

def self.ability
  unless @@ability.is_a?(Class)
    @@ability.classify.constantize
  else
    @@ability
  end
end

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Interpret)

    the object that the method was called on



23
24
25
# File 'lib/interpret.rb', line 23

def self.configure
  yield self
end

.fixed_blacklistObject



27
28
29
# File 'lib/interpret.rb', line 27

def self.fixed_blacklist
  @@black_list.select{|x| !x.include?("*")}
end

.wild_blacklistObject



31
32
33
# File 'lib/interpret.rb', line 31

def self.wild_blacklist
  @@black_list.select{|x| x.include?("*")}.map{|x| x.gsub("*", "")}
end