Class: SyntaxTree::Haml::Format::HashAttributesPart

Inherits:
Struct
  • Object
show all
Defined in:
lib/syntax_tree/haml/format.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#values ⇒ Object

Returns the value of attribute values

Returns:

  • (Object) —

    the current value of values



232
233
234
# File 'lib/syntax_tree/haml/format.rb', line 232

def values
  @values
end

Instance Method Details

#format(q, align) ⇒ Object



233
234
235
# File 'lib/syntax_tree/haml/format.rb', line 233

def format(q, align)
  format_value(q, values)
end

#length ⇒ Object



237
238
239
240
241
# File 'lib/syntax_tree/haml/format.rb', line 237

def length
  values.sum do |key, value|
    key.length + (value.is_a?(String) ? value : value.to_s).length + 3
  end
end