Sha256: 392b4d81fbec71b36a1417b5a2ef0123e5288a9c2f5327bcf3d9035fc026a98b
Contents?: true
Size: 666 Bytes
Versions: 33
Compression:
Stored size: 666 Bytes
Contents
module HoboTypeHelper extend HoboHelperBase protected def type_id(type=nil) type ||= (this.is_a?(Class) && this) || this_type || this.class HoboFields.to_name(type) || type.name.to_s.underscore.gsub("/", "__") end def type_and_field(*args) type, field = args.empty? ? [this_parent.class, this_field] : args "#{type.typed_id}_#{field}" if type.respond_to?(:typed_id) end def model_id_class(object=this, attribute=nil) object.respond_to?(:typed_id) ? "model::#{typed_id(object, attribute).to_s.dasherize}" : "" end def css_data(name, *args) "#{name.to_s.dasherize}::#{args * '::'}" end end
Version data entries
33 entries across 33 versions & 1 rubygems