Class: Pitchfork::SharedMemory::Field
- Inherits:
-
Object
- Object
- Pitchfork::SharedMemory::Field
- Defined in:
- lib/pitchfork/shared_memory.rb
Instance Method Summary collapse
-
#initialize(offset) ⇒ Field
constructor
A new instance of Field.
- #value ⇒ Object
- #value=(value) ⇒ Object
Constructor Details
#initialize(offset) ⇒ Field
Returns a new instance of Field.
33 34 35 36 |
# File 'lib/pitchfork/shared_memory.rb', line 33 def initialize(offset) @drop = PAGES.fetch(offset / MemoryPage::SLOTS) @offset = offset % MemoryPage::SLOTS end |
Instance Method Details
#value ⇒ Object
38 39 40 |
# File 'lib/pitchfork/shared_memory.rb', line 38 def value @drop[@offset] end |
#value=(value) ⇒ Object
42 43 44 |
# File 'lib/pitchfork/shared_memory.rb', line 42 def value=(value) @drop[@offset] = value end |