Class: HasHelpers::Resource

Inherits:
ApplicationRecord show all
Defined in:
app/models/has_helpers/resource.rb

Defined Under Namespace

Modules: NotePresenter Classes: ActionPresenter, CellPresenter, EmailPresenter, FormPresenter, InfoCollectionPresenter, InfoPresenter, ListPresenter, RowPresenter, TagPresenter

Instance Method Summary collapse

Instance Method Details

#formatted_nameObject



34
35
36
# File 'app/models/has_helpers/resource.rb', line 34

def formatted_name
  (alias_name || name).demodulize.titleize.pluralize
end

#klass(safe: false) ⇒ Object



26
27
28
# File 'app/models/has_helpers/resource.rb', line 26

def klass(safe: false)
  @klass ||= safe ? name.safe_constantize : name.constantize
end

#resourcesObject



30
31
32
# File 'app/models/has_helpers/resource.rb', line 30

def resources
  nested_resources
end