Module: Cuba::Tools::Widget
- Extended by:
- Widget
- Included in:
- Widget
- Defined in:
- lib/cuba/tools/widget/middleware.rb,
lib/cuba/tools/widget/responder.rb,
lib/cuba/tools/widget/helpers.rb,
lib/cuba/tools/widget/events.rb,
lib/cuba/tools/widget/base.rb,
lib/cuba/tools/widget.rb
Defined Under Namespace
Modules: Helpers Classes: Base, Events, Middleware, Responder
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#load_all(app, req, res) ⇒ Object
Returns the value of attribute load_all.
-
#reset_config ⇒ Object
Returns the value of attribute reset_config.
Instance Method Summary collapse
-
#reset_config! ⇒ Object
Resets the configuration to the default (empty hash).
- #setup {|config| ... } ⇒ Object
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
11 12 13 |
# File 'lib/cuba/tools/widget.rb', line 11 def config @config end |
#load_all(app, req, res) ⇒ Object
Returns the value of attribute load_all.
11 12 13 |
# File 'lib/cuba/tools/widget.rb', line 11 def load_all @load_all end |
#reset_config ⇒ Object
Returns the value of attribute reset_config.
11 12 13 |
# File 'lib/cuba/tools/widget.rb', line 11 def reset_config @reset_config end |
Instance Method Details
#reset_config! ⇒ Object
Resets the configuration to the default (empty hash)
22 23 24 25 26 27 |
# File 'lib/cuba/tools/widget.rb', line 22 def reset_config! @config = OpenStruct.new({ url_path: '/widgets', widgets: {} }) end |
#setup {|config| ... } ⇒ Object
13 14 15 |
# File 'lib/cuba/tools/widget.rb', line 13 def setup yield config end |