Class: Pageflow::React::WidgetType
- Inherits:
-
WidgetType
- Object
- WidgetType
- Pageflow::React::WidgetType
- Defined in:
- lib/pageflow/react/widget_type.rb
Instance Attribute Summary collapse
-
#component_name ⇒ Object
readonly
Returns the value of attribute component_name.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
Instance Method Summary collapse
-
#initialize(name, role, component_name) ⇒ WidgetType
constructor
A new instance of WidgetType.
- #render(template, _) ⇒ Object
- #roles ⇒ Object
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_name ⇒ Object (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 |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/pageflow/react/widget_type.rb', line 4 def name @name end |
#role ⇒ Object (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 |
#roles ⇒ Object
12 13 14 |
# File 'lib/pageflow/react/widget_type.rb', line 12 def roles [role] end |