Class: MailDiode::ComponentSettings

Inherits:
Object
  • Object
show all
Defined in:
lib/settings.rb

Instance Method Summary collapse

Constructor Details

#initializeComponentSettings

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

#eachObject



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