Class: ParamsReady::Restriction::Denylist
Instance Attribute Summary
#restriction
Class Method Summary
collapse
Instance Method Summary
collapse
blanket_permission, #delegate, #everything?, #for_children, from_array, #hash, #initialize, instance, #name_listed?, permit, permit_all, #permit_all, #permitted?, prohibit, #restriction_list_for, #to_restriction
Class Method Details
.default ⇒ Object
221
222
223
|
# File 'lib/params_ready/restriction.rb', line 221
def self.default
Nothing
end
|
Instance Method Details
#name_permitted?(name) ⇒ Boolean
225
226
227
228
229
230
231
232
233
|
# File 'lib/params_ready/restriction.rb', line 225
def name_permitted?(name)
return true unless name_listed?(name)
return false unless @restriction.is_a?(Hash)
return true if @restriction[name].is_a?(Array)
return true if @restriction[name].is_a?(Symbol)
return true if @restriction[name] == self.class.default
false
end
|
#prohibit(*args) ⇒ Object
235
236
237
|
# File 'lib/params_ready/restriction.rb', line 235
def prohibit(*args)
self.class.prohibit(*args)
end
|