Class: Haml::AttributeCompiler::AttributeValue

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

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#keyObject

Returns the value of attribute key

Returns:

  • (Object)

    the current value of key



9
10
11
# File 'lib/haml/attribute_compiler.rb', line 9

def key
  @key
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



9
10
11
# File 'lib/haml/attribute_compiler.rb', line 9

def type
  @type
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



9
10
11
# File 'lib/haml/attribute_compiler.rb', line 9

def value
  @value
end

Instance Method Details

#to_literalString

Returns A Ruby literal of value.

Returns:

  • (String)

    A Ruby literal of value.



11
12
13
14
15
16
17
18
# File 'lib/haml/attribute_compiler.rb', line 11

def to_literal
  case type
  when :static
    Haml::Util.inspect_obj(value)
  when :dynamic
    value
  end
end