Sha256: 6beadd004ea47cb8f8fb3fe4ede89099b84ae5ec1dc38943f13085460f356fd3

Contents?: true

Size: 430 Bytes

Versions: 9

Compression:

Stored size: 430 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
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
timber-1.0.12 lib/timber/context.rb
timber-1.0.11 lib/timber/context.rb
timber-1.0.10 lib/timber/context.rb
timber-1.0.9 lib/timber/context.rb
timber-1.0.8 lib/timber/context.rb
timber-1.0.7 lib/timber/context.rb
timber-1.0.6 lib/timber/context.rb
timber-1.0.5 lib/timber/context.rb
timber-1.0.4 lib/timber/context.rb