Class: Tableling::Configuration
- Inherits:
-
Object
- Object
- Tableling::Configuration
- Defined in:
- lib/tableling-rails/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.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/tableling-rails/config.rb', line 7 def initialize model, = {}, &block @model = model @views = [] @settings = Settings.new Tableling.settings extend @settings.dsl instance_eval &block if block @frozen = true end |
Instance Attribute Details
#model ⇒ Object (readonly)
Returns the value of attribute model.
5 6 7 |
# File 'lib/tableling-rails/config.rb', line 5 def model @model end |
#settings ⇒ Object (readonly)
Returns the value of attribute settings.
5 6 7 |
# File 'lib/tableling-rails/config.rb', line 5 def settings @settings end |
Instance Method Details
#default_view(options = {}, &block) ⇒ Object
25 26 27 |
# File 'lib/tableling-rails/config.rb', line 25 def default_view = {}, &block view :default, , &block end |
#process(params) ⇒ Object
29 30 31 32 |
# File 'lib/tableling-rails/config.rb', line 29 def process params raise ConfigurationError, "You must specify a default view" unless view(:default) view(:default).process params end |