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.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
Instance Method Summary collapse
-
#initialize(name, role, options = {}) ⇒ WidgetType
constructor
A new instance of WidgetType.
- #insert_point ⇒ Object
- #render(template, entry) ⇒ Object
- #roles ⇒ Object
Methods inherited from WidgetType
#enabled_in_editor?, #enabled_in_preview?, #render_head_fragment, #render_head_fragment_with_configuration, #render_with_configuration, #translation_key
Constructor Details
#initialize(name, role, options = {}) ⇒ 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, = {}) @name = name @role = role @options = 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 |
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/pageflow/react/widget_type.rb', line 4 def @options 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
#insert_point ⇒ Object
16 17 18 |
# File 'lib/pageflow/react/widget_type.rb', line 16 def insert_point @options[:insert_point] || super end |
#render(template, entry) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/pageflow/react/widget_type.rb', line 20 def render(template, entry) template.render(File.join('pageflow', 'react', 'widget'), entry: entry, name: name, server_rendering: [:server_rendering]) end |
#roles ⇒ Object
12 13 14 |
# File 'lib/pageflow/react/widget_type.rb', line 12 def roles [role] end |