Class: Rbexy::Nodes::XmlAttr

Inherits:
Object
  • Object
show all
Defined in:
lib/rbexy/nodes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (readonly)

Returns the value of attribute name.



109
110
111
# File 'lib/rbexy/nodes.rb', line 109

def name
  @name
end

#valueObject (readonly)

Returns the value of attribute value.



109
110
111
# File 'lib/rbexy/nodes.rb', line 109

def value
  @value
end

Instance Method Details

#compileObject



116
117
118
# File 'lib/rbexy/nodes.rb', line 116

def compile
  "\"#{name}\": #{value.compile}"
end