Class: Sentry::Interface

Inherits:
Object show all
Defined in:
lib/sentry/interface.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.inherited(klass) ⇒ Object



3
4
5
6
7
# File 'lib/sentry/interface.rb', line 3

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

.registeredObject



9
10
11
# File 'lib/sentry/interface.rb', line 9

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

Instance Method Details

#to_hashObject



13
14
15
# File 'lib/sentry/interface.rb', line 13

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