Class: TurboChat::Configuration::ModeSettings
- Inherits:
-
Object
- Object
- TurboChat::Configuration::ModeSettings
- Defined in:
- lib/turbo_chat/configuration.rb
Class Attribute Summary collapse
-
.mode_attributes ⇒ Object
readonly
Returns the value of attribute mode_attributes.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(defaults = {}) ⇒ ModeSettings
constructor
A new instance of ModeSettings.
Constructor Details
#initialize(defaults = {}) ⇒ ModeSettings
Returns a new instance of ModeSettings.
40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/turbo_chat/configuration.rb', line 40 def initialize(defaults = {}) self.class.mode_attributes.each do |attribute| instance_variable_set("@#{attribute}", nil) end defaults.each do |attribute, value| next unless respond_to?("#{attribute}=") public_send("#{attribute}=", TurboChat::Configuration.resolve_default_value(value)) end end |
Class Attribute Details
.mode_attributes ⇒ Object (readonly)
Returns the value of attribute mode_attributes.
30 31 32 |
# File 'lib/turbo_chat/configuration.rb', line 30 def mode_attributes @mode_attributes end |
Class Method Details
.configure_attributes(attributes) ⇒ Object
32 33 34 35 |
# File 'lib/turbo_chat/configuration.rb', line 32 def configure_attributes(attributes) @mode_attributes = attributes attr_accessor(*attributes) end |