Class: ActionWidget::Base
- Inherits:
-
Object
- Object
- ActionWidget::Base
- Includes:
- SmartProperties
- Defined in:
- lib/action_widget/base.rb
Instance Method Summary collapse
-
#initialize(view, *args) ⇒ Base
constructor
A new instance of Base.
- #render ⇒ Object
Constructor Details
#initialize(view, *args) ⇒ Base
Returns a new instance of Base.
7 8 9 10 |
# File 'lib/action_widget/base.rb', line 7 def initialize(view, *args) @view = view super(*args) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object (protected)
22 23 24 25 26 27 |
# File 'lib/action_widget/base.rb', line 22 def method_missing(method, *args, &block) view.send(method, *args, &block) rescue NoMethodError # Double check - the NoMethodError might have occurred somewhere else. view.respond_to?(method) ? raise : super end |
Instance Method Details
#render ⇒ Object
12 13 14 |
# File 'lib/action_widget/base.rb', line 12 def render raise NotImplementedError, "#{self.class} must implement #render" end |