Class: TOML::Keyvalue
- Inherits:
-
Object
- Object
- TOML::Keyvalue
- Defined in:
- lib/toml/keyvalue.rb
Instance Method Summary collapse
- #assign(hash, symbolize_keys = false) ⇒ Object
-
#initialize(key, value) ⇒ Keyvalue
constructor
A new instance of Keyvalue.
Constructor Details
#initialize(key, value) ⇒ Keyvalue
Returns a new instance of Keyvalue.
5 6 7 |
# File 'lib/toml/keyvalue.rb', line 5 def initialize(key, value) @key, @value = key, value end |
Instance Method Details
#assign(hash, symbolize_keys = false) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/toml/keyvalue.rb', line 9 def assign(hash, symbolize_keys = false) raise ValueOverwriteError if hash[@key] key = symbolize_keys ? @key.to_sym : @key hash[key] = @value end |