Method: ROM::ModelBuilder#initialize

Defined in:
lib/rom/model_builder.rb

#initialize(options = {}) ⇒ ModelBuilder

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 ModelBuilder.



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/rom/model_builder.rb', line 47

def initialize(options = {})
  @name = options[:name]

  if name
    parts = name.split('::')

    @const_name = parts.pop

    @namespace =
      if parts.any?
        Inflector.constantize(parts.join('::'))
      else
        Object
      end
  end
end