Sha256: 0f8e253c6f3be1ebff659eddbeaf42d16269d49622f5ba8ef94529b121d634e9
Contents?: true
Size: 904 Bytes
Versions: 99
Compression:
Stored size: 904 Bytes
Contents
class FyipeTimelineManager def initialize(options) @options = options @timeLineStack = [] end def addToTimeline(item) addItemToTimeline(item) end # return the timeline def getTimeline() return @timeLineStack end # clear the timeline def clearTimeline() @timeLineStack = [] end private def addItemToTimeline(item) # get the size of the stack if (@options[:maxTimeline] != nil && (@timeLineStack.length() == @options[:maxTimeline].to_i)) return # It discards new timeline update once maximum is reached end # add time to it # current date and time time = Time.now now = time.inspect item["timestamp"] = now # add a new item to the stack @timeLineStack.append(item) return true end end
Version data entries
99 entries across 99 versions & 1 rubygems