Sha256: c2368515d2611ae9408789f664a3b85f8bc4a759dcb4696d746d00b4cad1e120

Contents?: true

Size: 310 Bytes

Versions: 1

Compression:

Stored size: 310 Bytes

Contents

# frozen_string_literal: true

class ApplicationComponent < ViewComponent::Base
  def identifier
    klass = self.class

    klass.name
      .tableize
      .singularize
      .gsub("/", "--")
      .gsub("_", "-")
  end

  def sanitize(string)
    string
      .strip
      .gsub(/\s{2,}|\n/, " ")
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
material_view_components-0.1.1 app/components/application_component.rb