Class: Haml::AttributeCompiler::AttributeValue
- Inherits:
-
Struct
- Object
- Struct
- Haml::AttributeCompiler::AttributeValue
- Defined in:
- lib/haml/attribute_compiler.rb
Overview
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#to_literal ⇒ String
A Ruby literal of value.
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key
10 11 12 |
# File 'lib/haml/attribute_compiler.rb', line 10
def key
@key
end
|
#type ⇒ Object
Returns the value of attribute type
10 11 12 |
# File 'lib/haml/attribute_compiler.rb', line 10
def type
@type
end
|
#value ⇒ Object
Returns the value of attribute value
10 11 12 |
# File 'lib/haml/attribute_compiler.rb', line 10
def value
@value
end
|
Instance Method Details
#to_literal ⇒ String
Returns 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
|