Class: Kangaru::Configurator

Inherits:
Object
  • Object
show all
Includes:
Attributable, Validatable
Defined in:
lib/kangaru/configurator.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Validatable

#errors, #valid?, #validate

Methods included from Concern

#append_features, #class_methods, #included

Methods included from Attributable

#initialize, #merge!

Class Method Details

.keyObject



8
9
10
11
12
13
# File 'lib/kangaru/configurator.rb', line 8

def self.key
  to_s.gsub(/^.*::(?!.*::)/, "")
      .delete_suffix("Configurator")
      .to_snakecase
      .to_sym
end

Instance Method Details

#serialiseObject



15
16
17
18
19
# File 'lib/kangaru/configurator.rb', line 15

def serialise
  self.class.attributes.to_h do |setting|
    [setting, send(setting)]
  end.compact
end