Class: Normatron::Configuration
- Inherits:
-
Object
- Object
- Normatron::Configuration
- Defined in:
- lib/normatron/configuration.rb
Instance Attribute Summary collapse
-
#default_filters ⇒ Object
Returns the value of attribute default_filters.
-
#filters ⇒ Object
Returns the value of attribute filters.
Instance Method Summary collapse
- #add_orm(extension) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/normatron/configuration.rb', line 8 def initialize @default_filters = { blank: nil, squish: nil } @filters = {} @filters[:ascii] = Normatron::Filters::AsciiFilter @filters[:blank] = Normatron::Filters::BlankFilter @filters[:camelize] = Normatron::Filters::CamelizeFilter @filters[:capitalize] = Normatron::Filters::CapitalizeFilter @filters[:chomp] = Normatron::Filters::ChompFilter @filters[:dasherize] = Normatron::Filters::DasherizeFilter @filters[:downcase] = Normatron::Filters::DowncaseFilter @filters[:dump] = Normatron::Filters::DumpFilter @filters[:keep] = Normatron::Filters::KeepFilter @filters[:remove] = Normatron::Filters::RemoveFilter @filters[:squeeze] = Normatron::Filters::SqueezeFilter @filters[:squish] = Normatron::Filters::SquishFilter @filters[:strip] = Normatron::Filters::StripFilter @filters[:swapcase] = Normatron::Filters::SwapcaseFilter @filters[:titleize] = Normatron::Filters::TitleizeFilter @filters[:underscore] = Normatron::Filters::UnderscoreFilter @filters[:upcase] = Normatron::Filters::UpcaseFilter end |
Instance Attribute Details
#default_filters ⇒ Object
Returns the value of attribute default_filters.
5 6 7 |
# File 'lib/normatron/configuration.rb', line 5 def default_filters @default_filters end |
#filters ⇒ Object
Returns the value of attribute filters.
6 7 8 |
# File 'lib/normatron/configuration.rb', line 6 def filters @filters end |
Instance Method Details
#add_orm(extension) ⇒ Object
31 32 33 |
# File 'lib/normatron/configuration.rb', line 31 def add_orm(extension) extension::ORM_CLASS.send(:include, extension) end |