Class: ROM::Configurable::Settings Private
- Inherits:
-
Object
- Object
- ROM::Configurable::Settings
- Includes:
- Enumerable
- Defined in:
- lib/rom/support/configurable/settings.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A settings map
Instance Attribute Summary collapse
- #elements ⇒ Object readonly private
Instance Method Summary collapse
- #<<(setting) ⇒ Object private
- #[](name) ⇒ Object private
- #each(&block) ⇒ Object private
-
#initialize(elements = EMPTY_ARRAY) ⇒ Settings
constructor
private
A new instance of Settings.
- #key?(name) ⇒ Boolean private
- #keys ⇒ Object private
- #pristine ⇒ Object private
Constructor Details
#initialize(elements = EMPTY_ARRAY) ⇒ Settings
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Settings.
19 20 21 |
# File 'lib/rom/support/configurable/settings.rb', line 19 def initialize(elements = EMPTY_ARRAY) initialize_elements(elements) end |
Instance Attribute Details
#elements ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
16 17 18 |
# File 'lib/rom/support/configurable/settings.rb', line 16 def elements @elements end |
Instance Method Details
#<<(setting) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 27 |
# File 'lib/rom/support/configurable/settings.rb', line 24 def <<(setting) elements[setting.name] = setting self end |
#[](name) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
30 31 32 |
# File 'lib/rom/support/configurable/settings.rb', line 30 def [](name) elements[name] end |
#each(&block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
45 46 47 |
# File 'lib/rom/support/configurable/settings.rb', line 45 def each(&block) elements.values.each(&block) end |
#key?(name) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
35 36 37 |
# File 'lib/rom/support/configurable/settings.rb', line 35 def key?(name) keys.include?(name) end |
#keys ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
40 41 42 |
# File 'lib/rom/support/configurable/settings.rb', line 40 def keys elements.keys end |
#pristine ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
50 51 52 |
# File 'lib/rom/support/configurable/settings.rb', line 50 def pristine self.class.new(map(&:pristine)) end |