Sha256: 85165444c1a95da8f19e976063ac1f24389dc996b5568ae7ae36630572776c90

Contents?: true

Size: 321 Bytes

Versions: 34

Compression:

Stored size: 321 Bytes

Contents

module Tramway::ClassNameHelpers
  def model_class_name(class_name)
    class_name.constantize
  end

  def decorator_class_name(class_name = -> { model_class }.call)
    "#{class_name}Decorator".constantize
  end

  def form_class_name(class_name = -> { model_class }.call)
    "#{class_name}Form".constantize
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
tramway-core-1.13.1.1 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.13.1 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.13.0.2 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.13.0.1 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.13 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.12.1 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.12.0.2 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.12.0.1 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.12 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.11.2.1 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.11.2 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.11.1 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.11 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.10.3.1 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.10.3 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.10.2.3 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.10.2.2 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.10.2.1 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.10.2 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.10.1 lib/tramway/helpers/class_name_helpers.rb