Class: LocoMotion::BasicComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
lib/loco_motion/basic_component.rb

Overview

The BasicComponent class is used for all slots that don't provide a component so that users can pass in all of the same CSS and HTML options that a standard component would have.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.nameObject

Hard-coded so ViewComponent's template/sidecar lookup keeps resolving to BasicComponent's own view when this class is used as the default component for slots that don't specify one.



20
21
22
# File 'lib/loco_motion/basic_component.rb', line 20

def self.name
  "BasicComponent"
end

Instance Method Details

#callObject

Renders the component's root part, yielding the block content into it.



11
12
13
14
15
# File 'lib/loco_motion/basic_component.rb', line 11

def call
  part(:component) do
    content
  end
end