Class: Pitchfork::SharedMemory::Field

Inherits:
Object
  • Object
show all
Defined in:
lib/pitchfork/shared_memory.rb

Instance Method Summary collapse

Constructor Details

#initialize(offset) ⇒ Field

Returns a new instance of Field.



35
36
37
38
# File 'lib/pitchfork/shared_memory.rb', line 35

def initialize(offset)
  @drop = DROPS.fetch(offset / PER_DROP)
  @offset = offset % PER_DROP
end

Instance Method Details

#valueObject



40
41
42
# File 'lib/pitchfork/shared_memory.rb', line 40

def value
  @drop[@offset]
end

#value=(value) ⇒ Object



44
45
46
# File 'lib/pitchfork/shared_memory.rb', line 44

def value=(value)
  @drop[@offset] = value
end