Module: Phrasing
- Defined in:
- lib/phrasing.rb,
lib/phrasing/string.rb,
lib/phrasing/version.rb,
lib/phrasing/serializer.rb,
lib/phrasing/rails/engine.rb
Defined Under Namespace
Modules: Rails, Serializer
Classes: String
Constant Summary
collapse
- WHITELIST =
"PhrasingPhrase.value"
- VERSION =
'4.4.0'.freeze
- @@allow_update_on_all_models_and_attributes =
false
- @@route =
'phrasing'
- @@parent_controller =
"ApplicationController"
Class Method Summary
collapse
Class Method Details
.setup {|_self| ... } ⇒ Object
18
19
20
|
# File 'lib/phrasing.rb', line 18
def self.setup
yield self
end
|
.whitelist ⇒ Object
24
25
26
27
28
29
30
|
# File 'lib/phrasing.rb', line 24
def self.whitelist
if defined? @@whitelist
@@whitelist + [WHITELIST]
else
[WHITELIST]
end
end
|
.whitelist=(whitelist) ⇒ Object
32
33
34
|
# File 'lib/phrasing.rb', line 32
def self.whitelist=(whitelist)
@@whitelist = whitelist
end
|
.whitelisted?(klass, attribute) ⇒ Boolean
36
37
38
|
# File 'lib/phrasing.rb', line 36
def self.whitelisted?(klass, attribute)
allow_update_on_all_models_and_attributes == true || whitelist.include?("#{klass}.#{attribute}")
end
|