Class: Haml::Buffer

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/ucb_rails/templates/config/initializers/local/haml_buffer.rb

Instance Method Summary collapse

Instance Method Details

#orig_parse_object_refObject



3
# File 'lib/generators/ucb_rails/templates/config/initializers/local/haml_buffer.rb', line 3

alias_method :orig_parse_object_ref, :parse_object_ref

#parse_object_ref(ref) ⇒ Object

Override the method that figures out id/class given something like:

%tag[object]

An object/class can implement :haml_id_and_class_hash and use that rather than the default.



11
12
13
14
15
16
17
18
19
# File 'lib/generators/ucb_rails/templates/config/initializers/local/haml_buffer.rb', line 11

def parse_object_ref(ref)
  object, options = ref

  if object.respond_to?(:haml_attributes)
    object.haml_attributes(options)
  else
    orig_parse_object_ref(ref)
  end
end