Module: Positionable

Extended by:
ActiveSupport::Concern
Defined in:
app/models/positionable.rb

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

MAX_POS =

maximum 2 bytes integer

32768

Class Method Summary collapse

Class Method Details

.get(class_name) ⇒ Object



23
24
25
26
27
# File 'app/models/positionable.rb', line 23

def get(class_name)
  @_positionable_flyweight ||= {}
  underscored_name = class_name.is_a?(Class) ? class_name.name.underscore : class_name.to_s.underscore.singularize
  @_positionable_flyweight[underscored_name] || (@_positionable_flyweight[underscored_name] = class_name.is_a?(Class) ? class_name : "#{underscored_name}".camelize.constantize)
end