Sha256: d5eeb21cae4d4f8b8709f9c0237f54f8810e49fd4f841b03c971b993e5288582

Contents?: true

Size: 507 Bytes

Versions: 1

Compression:

Stored size: 507 Bytes

Contents

module FootStats
  class Stream
    attr_reader :key

    def initialize(key)
      @key = key
    end

    # Stores latest payload
    def store(value)
      payload_store[@key] = value
    end

    # Verifies if payload is up-to-date
    #
    # @return [String]
    #
    def updated?(new_payload)
      payload != new_payload
    end

    # Access payload store
    def payload
      payload_store[@key]
    end

    protected
    def payload_store
      FootStats::Setup.payload_store
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
foot_stats-0.1.0 lib/foot_stats/stream.rb