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, options = {})
  @name   = name
  @reader = options.fetch(:reader) { false }
  # Prepares transformations applied by [#transform]
  add_coercer options[:coercer]
  add_default options[:default] if options.key? :default
  add_type_checker options[:type]
  add_value_checker options[:allow]
  add_reader if reader
end