Class: Filtrum::Configuration
- Inherits:
-
Object
- Object
- Filtrum::Configuration
- Defined in:
- lib/filtrum/config.rb
Instance Attribute Summary collapse
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
Instance Method Summary collapse
- #default_view(options = {}, &block) ⇒ Object
-
#initialize(model, options = {}, &block) ⇒ Configuration
constructor
A new instance of Configuration.
- #process(params) ⇒ Object
- #view(name, options = {}, &block) ⇒ Object
Constructor Details
#initialize(model, options = {}, &block) ⇒ Configuration
Returns a new instance of Configuration.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/filtrum/config.rb', line 6 def initialize model, = {}, &block @model = model @views = [] @settings = Settings.new Filtrum.settings extend @settings.dsl instance_eval &block if block @frozen = true end |
Instance Attribute Details
#model ⇒ Object (readonly)
Returns the value of attribute model.
4 5 6 |
# File 'lib/filtrum/config.rb', line 4 def model @model end |
#settings ⇒ Object (readonly)
Returns the value of attribute settings.
4 5 6 |
# File 'lib/filtrum/config.rb', line 4 def settings @settings end |
Instance Method Details
#default_view(options = {}, &block) ⇒ Object
24 25 26 |
# File 'lib/filtrum/config.rb', line 24 def default_view = {}, &block view :default, , &block end |
#process(params) ⇒ Object
28 29 30 31 |
# File 'lib/filtrum/config.rb', line 28 def process params raise ConfigurationError, "You must specify a default view" unless view(:default) view(:default).process params end |