Class: ActionWidget::Base

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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, options = attributes.partition { |name, value| properties.key?(name) }

  @options = Hash[options]
  super(view, Hash[attributes])
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/action_widget/base.rb', line 6

def options
  @options
end

Instance Method Details

#renderObject

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/action_widget/base.rb', line 16

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