Class: ViewComponent::DocsBuilderComponent::Section

Inherits:
Struct
  • Object
show all
Defined in:
lib/view_component/docs_builder_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(heading: nil, methods: [], error_klasses: [], show_types: true) ⇒ Section

Returns a new instance of Section.



6
7
8
9
10
# File 'lib/view_component/docs_builder_component.rb', line 6

def initialize(heading: nil, methods: [], error_klasses: [], show_types: true)
  methods.sort_by! { |method| method[:name] }
  error_klasses.sort!
  super
end

Instance Attribute Details

#error_klassesObject

Returns the value of attribute error_klasses

Returns:

  • (Object)

    the current value of error_klasses



5
6
7
# File 'lib/view_component/docs_builder_component.rb', line 5

def error_klasses
  @error_klasses
end

#headingObject

Returns the value of attribute heading

Returns:

  • (Object)

    the current value of heading



5
6
7
# File 'lib/view_component/docs_builder_component.rb', line 5

def heading
  @heading
end

#methodsObject

Returns the value of attribute methods

Returns:

  • (Object)

    the current value of methods



5
6
7
# File 'lib/view_component/docs_builder_component.rb', line 5

def methods
  @methods
end

#show_typesObject

Returns the value of attribute show_types

Returns:

  • (Object)

    the current value of show_types



5
6
7
# File 'lib/view_component/docs_builder_component.rb', line 5

def show_types
  @show_types
end