Class: StringDoc::MetaAttributes Private

Inherits:
Object
  • Object
show all
Defined in:
lib/string_doc/meta_attributes.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Lets two or more node’s attributes to be manipulated together. Used by MetaNode.

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ MetaAttributes

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of MetaAttributes.



8
9
10
# File 'lib/string_doc/meta_attributes.rb', line 8

def initialize(attributes)
  @attributes = attributes
end

Instance Method Details

#[](key) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



18
19
20
# File 'lib/string_doc/meta_attributes.rb', line 18

def [](key)
  @attributes[0][key]
end

#[]=(key, value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



12
13
14
15
16
# File 'lib/string_doc/meta_attributes.rb', line 12

def []=(key, value)
  @attributes.each do |attributes|
    attributes[key] = value
  end
end

#delete(key) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



22
23
24
25
26
# File 'lib/string_doc/meta_attributes.rb', line 22

def delete(key)
  @attributes.each do |attributes|
    attributes.delete(key)
  end
end

#each(&block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



34
35
36
37
38
# File 'lib/string_doc/meta_attributes.rb', line 34

def each(&block)
  @attributes.each do |attributes|
    attributes.each(&block)
  end
end

#key?(key) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


28
29
30
31
32
# File 'lib/string_doc/meta_attributes.rb', line 28

def key?(key)
  @attributes.any? { |attributes|
    attributes.key?(key)
  }
end

#wrap(&block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



41
42
43
44
45
# File 'lib/string_doc/meta_attributes.rb', line 41

def wrap(&block)
  @attributes.each do |attributes|
    attributes.wrap(&block)
  end
end