Class: Layout::Dictionary
- Inherits:
-
Object
- Object
- Layout::Dictionary
- Includes:
- Enumerable
Overview
This is the interface to a LayOut dictionary. A Dictionary wraps key/value pairs.
Instance Method Summary # collapse
-
#[](key) ⇒ String, ...
The #[] method retrieves the value for a given key.
-
#[]=(key, value) ⇒ Object
The #[]= method sets a value for a given key.
-
#delete_key(key) ⇒ String, ...
The #delete_key method deletes a key/value pair from the dictionary.
-
#each {|key, value| ... } ⇒ Object
The #each_pair method is an alias for #each.
-
#each_key {|key| ... } ⇒ Object
The #each_key method iterates through all of the dictionary keys.
-
#each_pair {|key, value| ... } ⇒ Object
The #each_pair method is an alias for #each.
-
#empty? ⇒ Boolean
The #empty? method checks if the dictionary is empty.
-
#initialize(*args) ⇒ Object
constructor
The #initialize method creates a new Dictionary.
-
#keys ⇒ Array<String>
The #keys method retrieves an array with all of the dictionary keys.
-
#length ⇒ Integer
The #length method retrieves the size (number of elements) of a dictionary.
-
#size ⇒ Integer
The #length method retrieves the size (number of elements) of a dictionary.
-
#values ⇒ Array<Object>
The #values method retrieves an array with all of the dictionary values.
Constructor Details
↑ #initialize ⇒ Layout::Dictionary #initialize(dict) ⇒ Layout::Dictionary
The #initialize method creates a new Layout::Dictionary.
Instance Method Details
↑ #[]=(key, value) ⇒ Object
The #[]= method sets a value for a given key.
Creates a new dictionary entry for the given key if needed.
↑ #delete_key(key) ⇒ String, ...
The #delete_key method deletes a key/value pair from the dictionary.
↑ #each {|key, value| ... } ⇒ Object
The #each_pair method is an alias for #each.
↑ #each_pair {|key, value| ... } ⇒ Object
The #each_pair method is an alias for #each.