Sha256: 0d1850fb914815192d77f6c148a6981169064758c7cf057b719c6cadbe8ff9fe

Contents?: true

Size: 596 Bytes

Versions: 36

Compression:

Stored size: 596 Bytes

Contents

module Raven
  class Interface
    def initialize(attributes = nil)
      attributes.each do |attr, value|
        public_send "#{attr}=", value
      end if attributes

      yield self if block_given?
    end

    def self.inherited(klass)
      name = klass.name.split("::").last.downcase.gsub("interface", "")
      registered[name.to_sym] = klass
      super
    end

    def self.registered
      @@registered ||= {} # rubocop:disable Style/ClassVars
    end

    def to_hash
      Hash[instance_variables.map { |name| [name[1..-1].to_sym, instance_variable_get(name)] }]
    end
  end
end

Version data entries

36 entries across 36 versions & 3 rubygems

Version Path
sentry-raven-3.0.0 lib/raven/interface.rb
sentry-raven-2.13.0 lib/raven/interface.rb
sentry-raven-2.12.3 lib/raven/interface.rb
sentry-raven-2.12.2 lib/raven/interface.rb
sentry-raven-2.12.1 lib/raven/interface.rb
sentry-raven-2.12.0 lib/raven/interface.rb
sentry-raven-2.11.3 lib/raven/interface.rb
sentry-raven-2.11.2 lib/raven/interface.rb
sentry-raven-2.11.1 lib/raven/interface.rb
sentry-raven-2.11.0 lib/raven/interface.rb
sentry-raven-2.10.0 lib/raven/interface.rb
sentry-raven-2.9.0 lib/raven/interface.rb
sentry-raven-2.8.0 lib/raven/interface.rb
sentry-raven-2.7.4 lib/raven/interface.rb
sentry-raven-2.7.3 lib/raven/interface.rb
jones-gem-2.7.2 lib/raven/interface.rb
alec-gem-2.7.2 lib/raven/interface.rb
sentry-raven-2.7.2 lib/raven/interface.rb
sentry-raven-2.7.1 lib/raven/interface.rb
sentry-raven-2.6.3 lib/raven/interface.rb