class Eiwa::Tag::Bag
For simple elements that contain child element_name, value pairs that could plop into a hash nicely
Attributes
values[R]
Public Class Methods
new()
click to toggle source
# File lib/eiwa/tag/bag.rb, line 7 def initialize @values = {} end
Public Instance Methods
[](key)
click to toggle source
# File lib/eiwa/tag/bag.rb, line 11 def [](key) @values[key] end
end_child(child)
click to toggle source
# File lib/eiwa/tag/bag.rb, line 15 def end_child(child) # Don't overwrite, first dupe tends to be authorative one @values[child.tag_name] = child.text unless @values.key?(child.tag_name) end