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.10 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.9.9.3 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.9.9.2 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.9.9.1 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.9.9 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.9.8.1 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.9.8 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.9.7 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.9.6.1 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.9.6 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.9.5 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.9.4 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.9.3 lib/tramway/helpers/class_name_helpers.rb
tramway-core-1.9.2.1 lib/tramway/helpers/class_name_helpers.rb