Sha256: 38ee4dd5bbbf4fc9f7816f438ce7e55a1f3fa17a4e8866bfd9aea9c2b027d7f0

Contents?: true

Size: 459 Bytes

Versions: 17

Compression:

Stored size: 459 Bytes

Contents

# frozen_string_literal: true

module Ariadne
  module ViewComponent
    module StyleVariants
      module ClassMethods
        # Returns the name of the default style set based on the class name:
        #  MyComponent::Component => my_component
        #  Namespaced::MyComponent => my_component
        def default_style_name
          @default_style_name ||= name.split("::")[-2].underscore.presence || "component"
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
ariadne_view_components-0.0.80.3 app/lib/ariadne/view_component/style_variants.rb
ariadne_view_components-0.0.79.2 app/lib/ariadne/view_component/style_variants.rb
ariadne_view_components-0.0.79.1 app/lib/ariadne/view_component/style_variants.rb
ariadne_view_components-0.0.79 app/lib/ariadne/view_component/style_variants.rb
ariadne_view_components-0.0.78 app/lib/ariadne/view_component/style_variants.rb
ariadne_view_components-0.0.77 app/lib/ariadne/view_component/style_variants.rb
ariadne_view_components-0.0.76.1 app/lib/ariadne/view_component/style_variants.rb
ariadne_view_components-0.0.76 app/lib/ariadne/view_component/style_variants.rb
ariadne_view_components-0.0.75 app/lib/ariadne/view_component/style_variants.rb
ariadne_view_components-0.0.74.1 app/lib/ariadne/view_component/style_variants.rb
ariadne_view_components-0.0.74 app/lib/ariadne/view_component/style_variants.rb
ariadne_view_components-0.0.73 app/lib/ariadne/view_component/style_variants.rb
ariadne_view_components-0.0.72 app/lib/ariadne/view_component/style_variants.rb
ariadne_view_components-0.0.71 app/lib/ariadne/view_component/style_variants.rb
ariadne_view_components-0.0.70 app/lib/ariadne/view_component/style_variants.rb
ariadne_view_components-0.0.69 app/lib/ariadne/view_component/style_variants.rb
ariadne_view_components-0.0.68 app/lib/ariadne/view_component/style_variants.rb