Module: DataMapper::Sanitizer

Defined in:
lib/dm-sanitizer.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.default_optionsObject



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/dm-sanitizer.rb', line 11

def default_options
  {
    :mode_definitions  => {
      :default      => Sanitize::Config::DEFAULT,
      :restricted   => Sanitize::Config::RESTRICTED,
      :basic        => Sanitize::Config::BASIC,
      :relaxed      => Sanitize::Config::RELAXED
    },
    :default_mode   => :default,
    :with_dirty     => false,
    :property_types => [DataMapper::Property::String, DataMapper::Property::Text]
  }
end

.included(receiver) ⇒ Object



101
102
103
104
105
# File 'lib/dm-sanitizer.rb', line 101

def self.included(receiver)
  receiver.extend( ClassMethods )
  receiver.send( :include, InstanceMethods )
  receiver.send( :sanitize )
end