module ParamsReady::Restriction::Wrapper

Attributes

restriction[R]

Public Instance Methods

delegate(*args) click to toggle source
# File lib/params_ready/restriction.rb, line 8
def delegate(*args)
  return self if @restriction.everything?

  new_restriction = @restriction.delegate(*args)
  clone(restriction: new_restriction)
end
for_children(parameter) click to toggle source
# File lib/params_ready/restriction.rb, line 15
def for_children(parameter)
  return self if @restriction.everything?

  new_restriction = @restriction.for_children parameter
  clone(restriction: new_restriction)
end
permit(*list) click to toggle source
# File lib/params_ready/restriction.rb, line 28
def permit(*list)
  restriction = Restriction.permit(*list)
  return self if @restriction.everything? && restriction.everything?

  clone(restriction: restriction)
end
permit_all() click to toggle source
# File lib/params_ready/restriction.rb, line 22
def permit_all
  return self if @restriction.everything?

  clone(restriction: Restriction.blanket_permission)
end
prohibit(*list) click to toggle source
# File lib/params_ready/restriction.rb, line 35
def prohibit(*list)
  restriction = Restriction.prohibit(*list)
  return self if @restriction.everything? && restriction.everything?

  clone(restriction: restriction)
end
to_restriction() click to toggle source
# File lib/params_ready/restriction.rb, line 42
def to_restriction
  @restriction
end