Class: Hamlit::HamlParser::DynamicAttributes

Inherits:
Struct
  • Object
show all
Defined in:
lib/hamlit/parser/haml_parser.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#old=(value) ⇒ Object

Sets the attribute old

Parameters:

  • value (Object)

    the value to set the attribute old to.

Returns:

  • (Object)

    the newly set value



212
213
214
# File 'lib/hamlit/parser/haml_parser.rb', line 212

def old=(value)
  @old = value
end

Instance Method Details

#to_literalObject

This will be a literal for Haml::Buffer#attributes’s last argument, ‘attributes_hashes`.



222
223
224
# File 'lib/hamlit/parser/haml_parser.rb', line 222

def to_literal
  [new, stripped_old].compact.join(', ')
end