module Paradocs::Whitelist

Constants

EMPTY
FILTERED

Example

class Foo
  include Paradocs::DSL
  include Paradocs::Whitelist

  schema(:test) do
    field(:title).type(:string).whitelisted
    field(:age).type(:integer).default(20)
  end
end

foo    = Foo.new
schema = foo.class.schema(:test)
params = {title: "title", age: 25}
foo.filter!(params, schema) # => {title: "title", age: "[FILTERED]"}

Public Class Methods

included(base) click to toggle source
# File lib/paradocs/whitelist.rb, line 22
def self.included(base)
  base.include(ClassMethods)
end