Module: Haml::ObjectRef
- Defined in:
- lib/haml/object_ref.rb,
ext/haml/haml.c
Class Method Summary collapse
Class Method Details
.parse(args)
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/haml/object_ref.rb', line 5
def parse(args)
object, prefix = args
return {} unless object
suffix = underscore(object.class)
{
'class' => [prefix, suffix].compact.join('_'),
'id' => [prefix, suffix, object.id || 'new'].compact.join('_'),
}
end
|