Sha256: b73bc8ee16d11d8c851d37ffe43991f06461e9e7cfcc2a717b5d8926e33be422
Contents?: true
Size: 583 Bytes
Versions: 7
Compression:
Stored size: 583 Bytes
Contents
module Raven class Interface def initialize(attributes = nil) attributes&.each do |attr, value| public_send "#{attr}=", value end 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
7 entries across 7 versions & 1 rubygems