Class: Hypostasis::Key
- Inherits:
-
Object
- Object
- Hypostasis::Key
- Defined in:
- lib/hypostasis/key.rb
Instance Method Summary collapse
- #[](index) ⇒ Object
- #first ⇒ Object
-
#initialize(key_path, value = nil) ⇒ Key
constructor
A new instance of Key.
- #last ⇒ Object
Constructor Details
#initialize(key_path, value = nil) ⇒ Key
Returns a new instance of Key.
2 3 4 |
# File 'lib/hypostasis/key.rb', line 2 def initialize(key_path, value = nil) @key_path = key_path end |
Instance Method Details
#[](index) ⇒ Object
14 15 16 |
# File 'lib/hypostasis/key.rb', line 14 def [](index) unpack_tuple(decomposed_key[index.to_i]) end |
#first ⇒ Object
6 7 8 |
# File 'lib/hypostasis/key.rb', line 6 def first unpack_tuple(decomposed_key.first) end |
#last ⇒ Object
10 11 12 |
# File 'lib/hypostasis/key.rb', line 10 def last unpack_tuple(decomposed_key.last) end |