Sha256: 0da3c3715b96402f4d5dc96d8b7d5f36cd899733fb174c6dad33ef1a7f8d70a1
Contents?: true
Size: 860 Bytes
Versions: 4
Compression:
Stored size: 860 Bytes
Contents
class Linkable AJAX_COMBOBOX_MIN = 5 class << self def linkables @linkables ||= Fullstack::Cms.config.linkables.map {|class_name| class_name.is_a?(Class) ? class_name.name.underscore : class_name.to_s.underscore.singularize } end def linkable_class_names @linkable_class_names ||= linkables.map {|l| l.is_a?(Class) ? l.name : l.to_s.camelize } end def get(class_name) @_linkables_flyweight ||= {} underscored_name = class_name.is_a?(Class) ? class_name.name.underscore : class_name.to_s.underscore.singularize if linkables.include?(underscored_name) @_linkables_flyweight[underscored_name] || (@_linkables_flyweight[underscored_name] = class_name.is_a?(Class) ? class_name : "#{class_name}".camelize.constantize) end end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
fullstack-cms-0.2.4 | app/models/linkable.rb |
fullstack-cms-0.2.3 | app/models/linkable.rb |
fullstack-cms-0.2.2 | app/models/linkable.rb |
fullstack-cms-0.2.1 | app/models/linkable.rb |