Module: NCore::Identity::ClassMethods

Defined in:
lib/ncore/identity.rb

Instance Method Summary collapse

Instance Method Details

#attrib_nameObject Also known as: json_root



14
15
16
# File 'lib/ncore/identity.rb', line 14

def attrib_name
  class_name.underscore
end

#class_nameObject



6
7
8
# File 'lib/ncore/identity.rb', line 6

def class_name
  self.name.split('::')[-1]
end

#i18n_scopeObject



19
20
21
# File 'lib/ncore/identity.rb', line 19

def i18n_scope
  module_parent::Api.i18n_scope
end

#model_nameObject

make NCore::SomeResource.model_name do the right thing



24
25
26
# File 'lib/ncore/identity.rb', line 24

def model_name
  ::ActiveModel::Name.new(self, nil, ::ActiveSupport::Inflector.demodulize(self))
end

#module_nameObject



10
11
12
# File 'lib/ncore/identity.rb', line 10

def module_name
  self.name.split('::')[0..-2].join('::')
end