Class: Consumer::PositionStore::Substitute::PositionStore

Inherits:
Object
  • Object
show all
Includes:
Consumer::PositionStore
Defined in:
lib/consumer/position_store/substitute.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Consumer::PositionStore

included

Instance Attribute Details

#get_positionObject

Returns the value of attribute get_position.



11
12
13
# File 'lib/consumer/position_store/substitute.rb', line 11

def get_position
  @get_position
end

#put_positionObject

Returns the value of attribute put_position.



12
13
14
# File 'lib/consumer/position_store/substitute.rb', line 12

def put_position
  @put_position
end

Instance Method Details

#getObject



14
15
16
# File 'lib/consumer/position_store/substitute.rb', line 14

def get
  get_position
end

#put(position) ⇒ Object



18
19
20
# File 'lib/consumer/position_store/substitute.rb', line 18

def put(position)
  self.put_position = position
end

#put?(expected_position = nil) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
25
26
27
28
# File 'lib/consumer/position_store/substitute.rb', line 22

def put?(expected_position=nil)
  if expected_position.nil?
    put_position ? true : false
  else
    put_position == expected_position
  end
end