Class: SyntaxTree::Haml::Format::PrefixPart

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#prefixObject

Returns the value of attribute prefix

Returns:

  • (Object)

    the current value of prefix



215
216
217
# File 'lib/syntax_tree/haml/format.rb', line 215

def prefix
  @prefix
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



215
216
217
# File 'lib/syntax_tree/haml/format.rb', line 215

def value
  @value
end

Instance Method Details

#format(q, align) ⇒ Object



216
217
218
# File 'lib/syntax_tree/haml/format.rb', line 216

def format(q, align)
  q.text("#{prefix}#{value}")
end

#lengthObject



220
221
222
# File 'lib/syntax_tree/haml/format.rb', line 220

def length
  prefix.length + value.length
end