Class: Pageflow::React::WidgetType
- Inherits:
-
WidgetType
- Object
- WidgetType
- Pageflow::React::WidgetType
- Defined in:
- lib/pageflow/react/widget_type.rb
Instance Attribute Summary collapse
-
#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) ⇒ WidgetType
constructor
A new instance of WidgetType.
- #render(template, _) ⇒ Object
- #roles ⇒ Object
Methods inherited from WidgetType
#enabled_in_editor?, #enabled_in_preview?, #render_head_fragment, #translation_key
Constructor Details
#initialize(name, role) ⇒ WidgetType
Returns a new instance of WidgetType.
6 7 8 9 |
# File 'lib/pageflow/react/widget_type.rb', line 6 def initialize(name, role) @name = name @role = role end |
Instance Attribute Details
#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
15 16 17 |
# File 'lib/pageflow/react/widget_type.rb', line 15 def render(template, _) template.render(File.join('pageflow', 'react', 'widget'), name: name) end |
#roles ⇒ Object
11 12 13 |
# File 'lib/pageflow/react/widget_type.rb', line 11 def roles [role] end |