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.24 lib/timber/context.rb
timber-2.0.23 lib/timber/context.rb
timber-2.0.22 lib/timber/context.rb
timber-2.0.21 lib/timber/context.rb
timber-2.0.20 lib/timber/context.rb
timber-2.0.19 lib/timber/context.rb
timber-2.0.17 lib/timber/context.rb
timber-2.0.16 lib/timber/context.rb
timber-2.0.15 lib/timber/context.rb
timber-2.0.14 lib/timber/context.rb
timber-2.0.12 lib/timber/context.rb
timber-2.0.11 lib/timber/context.rb
timber-2.0.10 lib/timber/context.rb
timber-2.0.9 lib/timber/context.rb
timber-2.0.8 lib/timber/context.rb
timber-2.0.7 lib/timber/context.rb
timber-2.0.6 lib/timber/context.rb
timber-2.0.5 lib/timber/context.rb
timber-2.0.4 lib/timber/context.rb
timber-2.0.3 lib/timber/context.rb