Module: Staticky::Resources::Plugins::Phlex::InstanceMethods
- Defined in:
- lib/staticky/resources/plugins/phlex.rb
Instance Method Summary collapse
- #build(view_context: ViewContext.new(self)) ⇒ Object
- #component ⇒ Object
- #component=(component) ⇒ Object
Instance Method Details
#build(view_context: ViewContext.new(self)) ⇒ Object
33 34 35 |
# File 'lib/staticky/resources/plugins/phlex.rb', line 33 def build(view_context: ViewContext.new(self)) component.call(view_context:) end |
#component ⇒ Object
27 28 29 30 31 |
# File 'lib/staticky/resources/plugins/phlex.rb', line 27 def component return @component if defined?(@component) raise ArgumentError, "component is required" end |
#component=(component) ⇒ Object
23 24 25 |
# File 'lib/staticky/resources/plugins/phlex.rb', line 23 def component=(component) @component = component end |