Class: ROM::Options::Definitions Private
- Inherits:
-
Object
- Object
- ROM::Options::Definitions
- Defined in:
- lib/rom/support/options.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.
Manage all available options
Instance Method Summary collapse
- #define(option) ⇒ Object private
-
#initialize ⇒ Definitions
constructor
private
A new instance of Definitions.
- #initialize_copy(source) ⇒ Object private
- #names ⇒ Object private
- #process(object, options) ⇒ Object private
Constructor Details
#initialize ⇒ Definitions
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 Definitions.
83 84 85 |
# File 'lib/rom/support/options.rb', line 83 def initialize @options = {} end |
Instance Method Details
#define(option) ⇒ 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.
92 93 94 |
# File 'lib/rom/support/options.rb', line 92 def define(option) @options[option.name] = option end |
#initialize_copy(source) ⇒ 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.
87 88 89 90 |
# File 'lib/rom/support/options.rb', line 87 def initialize_copy(source) super @options = @options.dup end |
#names ⇒ 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.
112 113 114 |
# File 'lib/rom/support/options.rb', line 112 def names @options.keys end |
#process(object, options) ⇒ 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.
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/rom/support/options.rb', line 96 def process(object, ) () each do |name, option| if option.default? && !.key?(name) [name] = option.default_value(object) end if .key?(name) validate_option_value(option, name, [name]) end option.assign_reader_value(object, [name]) if option.reader? end end |