Sha256: c0a3b2a6c14d81387ac840b4577cf8f1cac123d00b1c6d4b6372ecccb40d871a
Contents?: true
Size: 489 Bytes
Versions: 67
Compression:
Stored size: 489 Bytes
Contents
class Udongo::ObjectPath def self.find(object) unless object.is_a?(Array) return cleanup("#{object.class.name.underscore}_path") end object.map do |item| item.is_a?(Symbol) ? "#{item}" : cleanup(item.class.name.underscore) end.join('_') << '_path' end def self.remove_symbols(object) return object unless object.is_a?(Array) object.select { |o| !o.is_a?(Symbol) } end def self.cleanup(value) value.to_s.gsub('_decorator', '') end end
Version data entries
67 entries across 67 versions & 1 rubygems