Module: Phrasing

Defined in:
lib/phrasing.rb,
lib/phrasing.rb,
lib/phrasing/version.rb,
lib/phrasing/serializer.rb,
lib/phrasing/implementation.rb

Defined Under Namespace

Modules: Implementation, Rails, Serializer

Constant Summary collapse

WHITELIST =
"PhrasingPhrase.value"
VERSION =
"3.2.7"
@@parent_controller =
"ApplicationController"
@@route =
'phrasing'

Class Method Summary collapse

Class Method Details

.is_whitelisted?(klass, attribute) ⇒ Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/phrasing.rb', line 59

def self.is_whitelisted?(klass,attribute)
  allow_update_on_all_models_and_attributes == true or whitelist.include? "#{klass}.#{attribute}"
end

.logObject



32
33
34
# File 'lib/phrasing.rb', line 32

def self.log
  @@log
end

.log=(log_value) ⇒ Object



36
37
38
39
# File 'lib/phrasing.rb', line 36

def self.log=(log_value)
  @@log = log_value
  suppress_log if log_value == false
end

.setup {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Phrasing)

    the object that the method was called on



41
42
43
# File 'lib/phrasing.rb', line 41

def self.setup
  yield self
end

.whitelistObject



47
48
49
50
51
52
53
# File 'lib/phrasing.rb', line 47

def self.whitelist
  if defined? @@whitelist
    @@whitelist + [WHITELIST]
  else
    [WHITELIST]
  end
end

.whitelist=(whitelist) ⇒ Object



55
56
57
# File 'lib/phrasing.rb', line 55

def self.whitelist=(whitelist)
  @@whitelist = whitelist
end