Class: Secret_Hash
- Inherits:
-
Object
- Object
- Secret_Hash
- Defined in:
- lib/hash.rb
Instance Attribute Summary collapse
-
#hash ⇒ Object
Returns the value of attribute hash.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
-
#initialize(hash:) ⇒ Secret_Hash
constructor
A new instance of Secret_Hash.
Constructor Details
#initialize(hash:) ⇒ Secret_Hash
4 5 6 |
# File 'lib/hash.rb', line 4 def initialize(hash:) @hash = hash end |
Instance Attribute Details
#hash ⇒ Object
Returns the value of attribute hash.
2 3 4 |
# File 'lib/hash.rb', line 2 def hash @hash end |
Instance Method Details
#[](key) ⇒ Object
8 9 10 |
# File 'lib/hash.rb', line 8 def [](key) @hash[key] end |
#[]=(key, value) ⇒ Object
12 13 14 15 16 |
# File 'lib/hash.rb', line 12 def []=(key, value) raise "No writing please" @hash[key] = value end |