class ParamsReady::Restriction::Allowlist

Public Class Methods

default() click to toggle source
# File lib/params_ready/restriction.rb, line 190
def self.default
  Everything
end

Public Instance Methods

==(other) click to toggle source
# 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) click to toggle source
# File lib/params_ready/restriction.rb, line 194
def name_permitted?(name)
  name_listed?(name)
end
permit(*args) click to toggle source
# File lib/params_ready/restriction.rb, line 198
def permit(*args)
  self.class.permit(*args)
end

Protected Instance Methods

restriction_list_for_name(name) click to toggle source
# File lib/params_ready/restriction.rb, line 211
def restriction_list_for_name(name)
  if @restriction.is_a? Regexp
    self.class.default
  else
    @restriction[name]
  end
end