Class: ViewComponent::Form::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/view_component/form/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



8
9
10
11
12
13
14
15
16
17
# File 'lib/view_component/form/configuration.rb', line 8

def initialize
  @parent_component = "ViewComponent::Base"
  @lookup_chain = [
    lambda do |component_name, namespaces: []|
      namespaces.lazy.map do |namespace|
        "#{namespace}::#{component_name.to_s.camelize}Component".safe_constantize
      end.find(&:itself)
    end
  ]
end

Instance Attribute Details

#lookup_chainObject

Returns the value of attribute lookup_chain.



6
7
8
# File 'lib/view_component/form/configuration.rb', line 6

def lookup_chain
  @lookup_chain
end

#parent_componentObject

Returns the value of attribute parent_component.



6
7
8
# File 'lib/view_component/form/configuration.rb', line 6

def parent_component
  @parent_component
end