Module: Restfulie::Client::Feature::History

Defined in:
lib/restfulie/client/feature/history.rb

Instance Method Summary collapse

Instance Method Details

#history(number) ⇒ Object



11
12
13
# File 'lib/restfulie/client/feature/history.rb', line 11

def history(number)
  snapshots[snapshots.size + number] || raise("Undefined snapshot for #{number}, only containing #{@snapshots.size} snapshots.")
end

#make_snapshot(request) ⇒ Object



15
16
17
18
# File 'lib/restfulie/client/feature/history.rb', line 15

def make_snapshot(request)
  snapshots.shift if snapshot_full?
  snapshots << request
end

#max_to_remindObject



7
8
9
# File 'lib/restfulie/client/feature/history.rb', line 7

def max_to_remind
  10
end

#snapshotsObject



3
4
5
# File 'lib/restfulie/client/feature/history.rb', line 3

def snapshots
  @snapshots ||= []
end