Class: AdminWidgets::ScopesWidget::Scope
- Inherits:
-
BaseWidget
- Object
- Erector::Widget
- BaseWidget
- AdminWidgets::ScopesWidget::Scope
- Defined in:
- lib/admin_widgets/scopes_widget.rb
Overview
Helper classes
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
-
#parent ⇒ Object
Returns the value of attribute parent.
Instance Method Summary collapse
- #content ⇒ Object
- #current? ⇒ Boolean
-
#initialize(parent, name, options = {}) ⇒ Scope
constructor
A new instance of Scope.
- #params ⇒ Object
Methods inherited from BaseWidget
#capture, #content_block, #helper, #method_missing, #root
Methods included from Memoization
Methods included from Delegation
Constructor Details
#initialize(parent, name, options = {}) ⇒ Scope
Returns a new instance of Scope.
35 36 37 |
# File 'lib/admin_widgets/scopes_widget.rb', line 35 def initialize(parent, name, = {}) super .merge(:parent => parent, :name => name) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class AdminWidgets::BaseWidget
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
33 34 35 |
# File 'lib/admin_widgets/scopes_widget.rb', line 33 def name @name end |
#options ⇒ Object
Returns the value of attribute options.
33 34 35 |
# File 'lib/admin_widgets/scopes_widget.rb', line 33 def @options end |
#parent ⇒ Object
Returns the value of attribute parent.
33 34 35 |
# File 'lib/admin_widgets/scopes_widget.rb', line 33 def parent @parent end |
Instance Method Details
#content ⇒ Object
56 57 58 |
# File 'lib/admin_widgets/scopes_widget.rb', line 56 def content rawtext helper.link_to(full_label, params, :class => css_class) end |
#current? ⇒ Boolean
48 49 50 |
# File 'lib/admin_widgets/scopes_widget.rb', line 48 def current? (current_scope.nil? && default) || (current_scope.to_s == name.to_s) end |
#params ⇒ Object
52 53 54 |
# File 'lib/admin_widgets/scopes_widget.rb', line 52 def params parent.params.merge(:scope => scope) end |