Class: SyntaxTree::Haml::Tag::HashAttributesPart

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#valuesObject

Returns the value of attribute values

Returns:

  • (Object)

    the current value of values



70
71
72
# File 'lib/syntax_tree/haml/tag.rb', line 70

def values
  @values
end

Instance Method Details

#format(q, align) ⇒ Object



71
72
73
# File 'lib/syntax_tree/haml/tag.rb', line 71

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

#lengthObject



75
76
77
78
79
# File 'lib/syntax_tree/haml/tag.rb', line 75

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