Sha256: e434da5f70301cbaa6391530bc7d0cafbfe1ec3ccc0c591eee1cc92422051372

Contents?: true

Size: 477 Bytes

Versions: 38

Compression:

Stored size: 477 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 = {})
      as_json.to_json(options)
    end

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

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
timber-2.0.2 lib/timber/context.rb
timber-2.0.1 lib/timber/context.rb
timber-2.0.0 lib/timber/context.rb
timber-1.1.14 lib/timber/context.rb
timber-1.1.13 lib/timber/context.rb
timber-1.1.12 lib/timber/context.rb
timber-1.1.11 lib/timber/context.rb
timber-1.1.10 lib/timber/context.rb
timber-1.1.9 lib/timber/context.rb
timber-1.1.8 lib/timber/context.rb
timber-1.1.7 lib/timber/context.rb
timber-1.1.6 lib/timber/context.rb
timber-1.1.5 lib/timber/context.rb
timber-1.1.4 lib/timber/context.rb
timber-1.1.3 lib/timber/context.rb
timber-1.1.2 lib/timber/context.rb
timber-1.1.1 lib/timber/context.rb
timber-1.1.0 lib/timber/context.rb