Class: Pacer::Graph::HashIndex
- Inherits:
-
Object
- Object
- Pacer::Graph::HashIndex
- Defined in:
- lib/pacer/graph/hash_index.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #count(key, value) ⇒ Object
- #get(key, value) ⇒ Object
-
#initialize(element_type, name) ⇒ HashIndex
constructor
A new instance of HashIndex.
- #put(key, value, element) ⇒ Object
Constructor Details
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/pacer/graph/hash_index.rb', line 3 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
3 4 5 |
# File 'lib/pacer/graph/hash_index.rb', line 3 def type @type end |
Instance Method Details
#count(key, value) ⇒ Object
21 22 23 |
# File 'lib/pacer/graph/hash_index.rb', line 21 def count(key, value) data[key][value].count end |
#get(key, value) ⇒ Object
13 14 15 |
# File 'lib/pacer/graph/hash_index.rb', line 13 def get(key, value) Pacer::Pipes::EnumerablePipe.new data[key][value] end |
#put(key, value, element) ⇒ Object
17 18 19 |
# File 'lib/pacer/graph/hash_index.rb', line 17 def put(key, value, element) data[key][value] << element end |