Sha256: 6bd695f488b25df0323315e67ba5bd538dea86ad1e5bd9076a9236f33d8fa20f
Contents?: true
Size: 1.17 KB
Versions: 45
Compression:
Stored size: 1.17 KB
Contents
require 'flydata/source' require 'flydata/source/component' require 'flydata/source/errors' module Flydata module Source class SourcePos < Component def self.inherited(child_class) Source.register(child_class, self) end def initialize(source) super(source) end #attr_reader :Should not use any attr_reader/attr_accessor if the variable is Source dependent # Public Interface: Create source pos # # Returns a context-dependent position object that has the following methods: # (includeng Comparable mixin is preferable) # - all comparison operators (<=>, <, <=, >=, >, ==, !=) # - to_s # def create_source_pos(source_pos_str) raise UnsupportedSourceError, "subclass must implement" end # Public Interface: Back to last known safe source pos # # Returns a source position object # # A source pos may not be restart-able from the very position because # there may be preceding records necessary to restart the source log # playback. This method returns such a 'safe' position from which # the source log can be played back. # def resume_pos(source_pos) raise UnsupportedSourceError, "subclass must implement" end end end end
Version data entries
45 entries across 45 versions & 1 rubygems