Sha256: 64a48378ba245fd32727fad1c74a2f1cea73fb717f9b59aa14665f71f4029d34

Contents?: true

Size: 497 Bytes

Versions: 1

Compression:

Stored size: 497 Bytes

Contents

module Timber
  # Base class for all `Timber::Contexts::*` classes.
  # @private
  class Context
    class << self
      def keyspace
        @keyspace || raise(NotImplementedError.new)
      end
    end

    def keyspace
      self.class.keyspace
    end

    def as_json(options = {})
      raise NotImplementedError.new
    end

    def to_json(options = {})
      Util::Hash.compact(as_json).to_json(options)
    end

    def to_msgpack(*args)
      as_json.to_msgpack(*args)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
timber-1.0.13 lib/timber/context.rb