Class: ParamsReady::Restriction::Allowlist

Inherits:
ParamsReady::Restriction show all
Defined in:
lib/params_ready/restriction.rb

Instance Attribute Summary

Attributes inherited from ParamsReady::Restriction

#restriction

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ParamsReady::Restriction

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

Constructor Details

This class inherits a constructor from ParamsReady::Restriction

Class Method Details

.defaultObject



190
191
192
# File 'lib/params_ready/restriction.rb', line 190

def self.default
  Everything
end

Instance Method Details

#==(other) ⇒ Object



202
203
204
205
206
207
# File 'lib/params_ready/restriction.rb', line 202

def ==(other)
  return false unless other.is_a? self.class
  return true if object_id == other.object_id

  restriction == other.restriction
end

#name_permitted?(name) ⇒ Boolean

Returns:

  • (Boolean)


194
195
196
# File 'lib/params_ready/restriction.rb', line 194

def name_permitted?(name)
  name_listed?(name)
end

#permit(*args) ⇒ Object



198
199
200
# File 'lib/params_ready/restriction.rb', line 198

def permit(*args)
  self.class.permit(*args)
end