Class: ActiveGenie::Config::BaseConfig
- Inherits:
-
Object
- Object
- ActiveGenie::Config::BaseConfig
- Defined in:
- lib/active_genie/configs/base_config.rb
Direct Known Subclasses
ExtractorConfig, ListerConfig, LlmConfig, LogConfig, ProvidersConfig, RankerConfig
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize(**args) ⇒ BaseConfig
constructor
A new instance of BaseConfig.
- #to_h ⇒ Object
Constructor Details
#initialize(**args) ⇒ BaseConfig
Returns a new instance of BaseConfig.
6 7 8 9 10 |
# File 'lib/active_genie/configs/base_config.rb', line 6 def initialize(**args) attributes.each do |var| send("#{var}=", args[var] || args[var.to_s]) end end |
Instance Method Details
#attributes ⇒ Object
12 13 14 |
# File 'lib/active_genie/configs/base_config.rb', line 12 def attributes public_methods(false).grep(/=$/).map { |m| m.to_s.delete('=').to_sym } end |
#to_h ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/active_genie/configs/base_config.rb', line 16 def to_h h = {} attributes.each do |var| h[var.to_sym] = send(var) end h end |