Class: Salgo::Btree::Key
- Inherits:
-
Object
- Object
- Salgo::Btree::Key
- Defined in:
- lib/salgo/btree.rb
Overview
The key value should support >, < and ==.
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#val ⇒ Object
Returns the value of attribute val.
Instance Method Summary collapse
- #<(k) ⇒ Object
- #==(k) ⇒ Object
- #>(k) ⇒ Object
-
#initialize(key, val = true) ⇒ Key
constructor
A new instance of Key.
Constructor Details
#initialize(key, val = true) ⇒ Key
Returns a new instance of Key.
167 168 169 170 |
# File 'lib/salgo/btree.rb', line 167 def initialize(key, val=true) @key = key @val = val end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
164 165 166 |
# File 'lib/salgo/btree.rb', line 164 def key @key end |
#val ⇒ Object
Returns the value of attribute val.
164 165 166 |
# File 'lib/salgo/btree.rb', line 164 def val @val end |
Instance Method Details
#<(k) ⇒ Object
172 173 174 |
# File 'lib/salgo/btree.rb', line 172 def < (k) @key < k.key end |
#==(k) ⇒ Object
180 181 182 |
# File 'lib/salgo/btree.rb', line 180 def == (k) @key == k.key end |
#>(k) ⇒ Object
176 177 178 |
# File 'lib/salgo/btree.rb', line 176 def > (k) @key > k.key end |