Class: Rgviz::MemoryExecutor::SimpleOrderedHash
- Inherits:
-
Object
- Object
- Rgviz::MemoryExecutor::SimpleOrderedHash
- Defined in:
- lib/rgviz/memory_executor.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #each ⇒ Object
-
#initialize ⇒ SimpleOrderedHash
constructor
A new instance of SimpleOrderedHash.
Constructor Details
#initialize ⇒ SimpleOrderedHash
Returns a new instance of SimpleOrderedHash.
599 600 601 602 |
# File 'lib/rgviz/memory_executor.rb', line 599 def initialize @keys = [] @hash = Hash.new end |
Instance Method Details
#[](key) ⇒ Object
604 605 606 |
# File 'lib/rgviz/memory_executor.rb', line 604 def [](key) @hash[key] end |
#[]=(key, value) ⇒ Object
608 609 610 611 612 613 |
# File 'lib/rgviz/memory_executor.rb', line 608 def []=(key, value) if !@keys.include?(key) @keys << key end @hash[key] = value end |
#each ⇒ Object
615 616 617 618 619 |
# File 'lib/rgviz/memory_executor.rb', line 615 def each @keys.each do |key| yield key, @hash[key] end end |