Class: ActionWidget::Base

Inherits:
Object
  • Object
show all
Includes:
SmartProperties
Defined in:
lib/action_widget/base.rb

Instance Method Summary collapse

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

#renderObject

Raises:

  • (NotImplementedError)


12
13
14
# File 'lib/action_widget/base.rb', line 12

def render
  raise NotImplementedError, "#{self.class} must implement #render"
end