Class: Hanamismith::Builders::HTMX

Inherits:
Object
  • Object
show all
Defined in:
lib/hanamismith/builders/htmx.rb

Overview

Builds project skeleton for HTMX library.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration, builder: Rubysmith::Builder) ⇒ HTMX

Returns a new instance of HTMX.



13
14
15
16
# File 'lib/hanamismith/builders/htmx.rb', line 13

def initialize configuration, builder: Rubysmith::Builder
  @configuration = configuration
  @builder = builder
end

Class Method Details

.callObject



11
# File 'lib/hanamismith/builders/htmx.rb', line 11

def self.call(...) = new(...).call

Instance Method Details

#callObject



18
19
20
21
22
# File 'lib/hanamismith/builders/htmx.rb', line 18

def call
  path = "%project_name%/public/javascripts/htmx.js.erb"
  builder.call(configuration.merge(template_path: path)).render
  configuration
end