Class: ActionWidget::Base
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- ActionWidget::Base
- Includes:
- SmartProperties
- Defined in:
- lib/action_widget/base.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(view, attributes = {}) ⇒ Base
constructor
A new instance of Base.
- #render ⇒ Object
Constructor Details
#initialize(view, attributes = {}) ⇒ Base
Returns a new instance of Base.
8 9 10 11 12 13 14 |
# File 'lib/action_widget/base.rb', line 8 def initialize(view, attributes = {}) properties = self.class.properties attributes, = attributes.partition { |name, value| properties.key?(name) } = Hash[] super(view, Hash[attributes]) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/action_widget/base.rb', line 6 def end |
Instance Method Details
#render ⇒ Object
16 17 18 |
# File 'lib/action_widget/base.rb', line 16 def render raise NotImplementedError, "#{self.class} must implement #render" end |