Class: DynamicScaffold::Config
- Inherits:
-
Object
- Object
- DynamicScaffold::Config
- Defined in:
- lib/dynamic_scaffold/config.rb
Instance Attribute Summary collapse
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
-
#form ⇒ Object
readonly
Returns the value of attribute form.
-
#list ⇒ Object
readonly
Returns the value of attribute list.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(model, controller) ⇒ Config
constructor
A new instance of Config.
- #scope(parameter_names = nil) ⇒ Object
- #vars(name = nil, &block) ⇒ Object
Constructor Details
#initialize(model, controller) ⇒ Config
Returns a new instance of Config.
123 124 125 126 127 128 129 130 |
# File 'lib/dynamic_scaffold/config.rb', line 123 def initialize(model, controller) @model = model @controller = controller @form = FormBuilder.new(self) @list = ListBuilder.new(self) @title = Title.new(self) @vars = Vars.new(self) end |
Instance Attribute Details
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
122 123 124 |
# File 'lib/dynamic_scaffold/config.rb', line 122 def controller @controller end |
#form ⇒ Object (readonly)
Returns the value of attribute form.
122 123 124 |
# File 'lib/dynamic_scaffold/config.rb', line 122 def form @form end |
#list ⇒ Object (readonly)
Returns the value of attribute list.
122 123 124 |
# File 'lib/dynamic_scaffold/config.rb', line 122 def list @list end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
122 123 124 |
# File 'lib/dynamic_scaffold/config.rb', line 122 def model @model end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
122 123 124 |
# File 'lib/dynamic_scaffold/config.rb', line 122 def title @title end |
Instance Method Details
#scope(parameter_names = nil) ⇒ Object
141 142 143 144 |
# File 'lib/dynamic_scaffold/config.rb', line 141 def scope(parameter_names = nil) @scope = parameter_names unless parameter_names.nil? @scope end |
#vars(name = nil, &block) ⇒ Object
132 133 134 135 136 137 138 139 |
# File 'lib/dynamic_scaffold/config.rb', line 132 def vars(name = nil, &block) if block_given? raise ArgumentError, 'Missing var name.' if name.nil? @vars._register(name, block) else @vars end end |