Class: Maglove::Widget::Base
- Inherits:
-
Object
- Object
- Maglove::Widget::Base
- Extended by:
- Forwardable
- Defined in:
- lib/maglove/widget.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Instance Method Summary collapse
- #defaults ⇒ Object
- #identifier ⇒ Object
-
#initialize(scope, options = {}) ⇒ Base
constructor
A new instance of Base.
- #render {|_self| ... } ⇒ Object
- #style_string(options, *args, &block) ⇒ Object
- #widget_options ⇒ Object
Constructor Details
#initialize(scope, options = {}) ⇒ Base
Returns a new instance of Base.
16 17 18 19 |
# File 'lib/maglove/widget.rb', line 16 def initialize(scope, = {}) @options = defaults.merge() @scope = scope end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/maglove/widget.rb', line 5 def @options end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
5 6 7 |
# File 'lib/maglove/widget.rb', line 5 def scope @scope end |
Instance Method Details
#defaults ⇒ Object
12 13 14 |
# File 'lib/maglove/widget.rb', line 12 def defaults {} end |
#identifier ⇒ Object
8 9 10 |
# File 'lib/maglove/widget.rb', line 8 def identifier "base" end |
#render {|_self| ... } ⇒ Object
29 30 31 |
# File 'lib/maglove/widget.rb', line 29 def render(&block) yield self if block_given? end |
#style_string(options, *args, &block) ⇒ Object
25 26 27 |
# File 'lib/maglove/widget.rb', line 25 def style_string(, *args, &block) scope.style_string(, *args, &block) end |
#widget_options ⇒ Object
21 22 23 |
# File 'lib/maglove/widget.rb', line 21 def {} end |