Class: SyntaxTree::Haml::Tag::PrefixPart

Inherits:
Struct
  • Object
show all
Defined in:
lib/syntax_tree/haml/tag.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



33
34
35
# File 'lib/syntax_tree/haml/tag.rb', line 33

def prefix
  @prefix
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



33
34
35
# File 'lib/syntax_tree/haml/tag.rb', line 33

def value
  @value
end

Instance Method Details

#format(q, align) ⇒ Object



34
35
36
# File 'lib/syntax_tree/haml/tag.rb', line 34

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

#lengthObject



38
39
40
# File 'lib/syntax_tree/haml/tag.rb', line 38

def length
  prefix.length + value.length
end