class StringDoc::MetaAttributes
Lets two or more node's attributes to be manipulated together. Used by {StringDoc::MetaNode}.
@api private
Public Class Methods
new(attributes)
click to toggle source
# File lib/string_doc/meta_attributes.rb, line 8 def initialize(attributes) @attributes = attributes end
Public Instance Methods
[](key)
click to toggle source
# File lib/string_doc/meta_attributes.rb, line 18 def [](key) @attributes[0][key] end
[]=(key, value)
click to toggle source
# File lib/string_doc/meta_attributes.rb, line 12 def []=(key, value) @attributes.each do |attributes| attributes[key] = value end end
delete(key)
click to toggle source
# File lib/string_doc/meta_attributes.rb, line 22 def delete(key) @attributes.each do |attributes| attributes.delete(key) end end
each(&block)
click to toggle source
# File lib/string_doc/meta_attributes.rb, line 34 def each(&block) @attributes.each do |attributes| attributes.each(&block) end end
key?(key)
click to toggle source
# File lib/string_doc/meta_attributes.rb, line 28 def key?(key) @attributes.any? { |attributes| attributes.key?(key) } end
wrap(&block)
click to toggle source
@api private
# File lib/string_doc/meta_attributes.rb, line 41 def wrap(&block) @attributes.each do |attributes| attributes.wrap(&block) end end