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



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

def key
  @key
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



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

def type
  @type
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



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

def value
  @value
end

Instance Method Details

#to_literalString

Returns A Ruby literal of value.

Returns:

  • (String)

    A Ruby literal of value.



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

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