Sha256: 7f098b8209f76177d7b6ab58fbf2e209609945f5acaa25d4b8ec7411360c2e81

Contents?: true

Size: 493 Bytes

Versions: 46

Compression:

Stored size: 493 Bytes

Contents

module Gaku::ClassNameDetector

  def class_name
    "Gaku::#{controller_name.classify}"
  end

  def class_name_minus_enrollment
    "Gaku::#{controller_name.classify.split('Enrollment').first}"
  end

  def class_name_underscored
    controller_name.classify.split('Enrollment').first.underscore
  end

  def class_name_underscored_plural
    class_name_underscored.pluralize
  end

  def enrollment_param
    "#{controller_name.classify.split('Enrollment').first.underscore}_id"
  end

end

Version data entries

46 entries across 39 versions & 3 rubygems

Version Path
gaku_core-0.0.3 lib/gaku/class_name_detector.rb
gaku-0.0.3 core/lib/gaku/class_name_detector.rb
gaku-0.0.2 core/lib/gaku/class_name_detector.rb
gaku_core-0.0.2 lib/gaku/class_name_detector.rb
gaku-0.0.1 core/lib/gaku/class_name_detector.rb
gaku_core-0.0.1 lib/gaku/class_name_detector.rb