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