Method: ROM::Options::Option#initialize
- Defined in:
- lib/rom/support/options.rb
#initialize(name, options = {}) ⇒ Option
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 Option.
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/rom/support/options.rb', line 47 def initialize(name, = {}) @name = name @reader = .fetch(:reader) { false } # Prepares transformations applied by [#transform] add_coercer [:coercer] add_default [:default] if .key? :default add_type_checker [:type] add_value_checker [:allow] add_reader if reader end |