Module: Phrasing

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

Defined Under Namespace

Modules: Implementation, Rails

Constant Summary collapse

WHITELIST =
"PhrasingPhrase.value"
VERSION =
"3.0.3"
@@route =
'phrasing'

Class Method Summary collapse

Class Method Details

.is_whitelisted?(klass, attribute) ⇒ Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/phrasing.rb', line 46

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

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

Yields:

  • (_self)

Yield Parameters:

  • _self (Phrasing)

    the object that the method was called on



28
29
30
# File 'lib/phrasing.rb', line 28

def self.setup
  yield self
end

.whitelistObject



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

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

.whitelist=(whitelist) ⇒ Object



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

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