Class: MailDiode::ComponentSettings
- Inherits:
-
Object
- Object
- MailDiode::ComponentSettings
- Defined in:
- lib/settings.rb
Instance Method Summary collapse
- #add(new_setting) ⇒ Object
- #each ⇒ Object
- #get_setting(key) ⇒ Object
-
#initialize ⇒ ComponentSettings
constructor
A new instance of ComponentSettings.
Constructor Details
#initialize ⇒ ComponentSettings
Returns a new instance of ComponentSettings.
29 30 31 |
# File 'lib/settings.rb', line 29 def initialize @settings = [] end |
Instance Method Details
#add(new_setting) ⇒ Object
33 34 35 |
# File 'lib/settings.rb', line 33 def add(new_setting) @settings << new_setting end |
#each ⇒ Object
37 38 39 40 41 |
# File 'lib/settings.rb', line 37 def each @settings.each do | setting | yield setting end end |
#get_setting(key) ⇒ Object
43 44 45 46 47 48 49 50 |
# File 'lib/settings.rb', line 43 def get_setting(key) each do | setting | if(setting.key == key) return setting end end return nil end |