Class: Pageflow::React::WidgetType

Inherits:
WidgetType
  • Object
show all
Defined in:
lib/pageflow/react/widget_type.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, role, component_name) ⇒ WidgetType

Returns a new instance of WidgetType.



6
7
8
9
10
# File 'lib/pageflow/react/widget_type.rb', line 6

def initialize(name, role, component_name)
  @name = name
  @role = role
  @component_name = component_name
end

Instance Attribute Details

#component_nameObject (readonly)

Returns the value of attribute component_name.



4
5
6
# File 'lib/pageflow/react/widget_type.rb', line 4

def component_name
  @component_name
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/pageflow/react/widget_type.rb', line 4

def name
  @name
end

#roleObject (readonly)

Returns the value of attribute role.



4
5
6
# File 'lib/pageflow/react/widget_type.rb', line 4

def role
  @role
end

Instance Method Details

#render(template, _) ⇒ Object



16
17
18
# File 'lib/pageflow/react/widget_type.rb', line 16

def render(template, _)
  template.render(File.join('pageflow', 'react', 'widget'), name: name)
end

#rolesObject



12
13
14
# File 'lib/pageflow/react/widget_type.rb', line 12

def roles
  [role]
end