Class: Rbexy::Nodes::XmlAttr
- Inherits:
-
Object
- Object
- Rbexy::Nodes::XmlAttr
- Defined in:
- lib/rbexy/nodes.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #compile ⇒ Object
-
#initialize(name, value) ⇒ XmlAttr
constructor
A new instance of XmlAttr.
Constructor Details
#initialize(name, value) ⇒ XmlAttr
Returns a new instance of XmlAttr.
111 112 113 114 |
# File 'lib/rbexy/nodes.rb', line 111 def initialize(name, value) @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
109 110 111 |
# File 'lib/rbexy/nodes.rb', line 109 def name @name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
109 110 111 |
# File 'lib/rbexy/nodes.rb', line 109 def value @value end |
Instance Method Details
#compile ⇒ Object
116 117 118 |
# File 'lib/rbexy/nodes.rb', line 116 def compile "\"#{name}\": #{value.compile}" end |