Module: Staticky::Resources::Plugins::Phlex::InstanceMethods

Defined in:
lib/staticky/resources/plugins/phlex.rb

Instance Method Summary collapse

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

#componentObject

Raises:

  • (ArgumentError)


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