Sha256: 6b390c6aa36247415da5fcf162f47bbec9451ae4f20b727d0145497a7bd8148e

Contents?: true

Size: 616 Bytes

Versions: 16

Compression:

Stored size: 616 Bytes

Contents

def init
  super
  return unless show_api_marker_section?

  if sections.first
    sections.first.place(:api_marker).before(:private)
  else
    sections :index, [:api_marker]
  end
end

def api_marker
  return if object.type == :root

  erb(:private) unless ['public', 'private'].include? api_text
end

private

def api_text
  api_text = object.has_tag?(:api) && object.tag(:api).text
  api_text = 'public' if object.has_tag?(:public)
  api_text
end

def show_api_marker_section?
  return false if object.type == :root

  case api_text
  when 'public'
    false
  when 'private'
    false
  else
    true
  end
end

Version data entries

16 entries across 14 versions & 2 rubygems

Version Path
reek-6.0.2 docs/templates/default/docstring/setup.rb
reek-6.0.1 docs/templates/default/docstring/setup.rb
reek-6.0.0 docs/templates/default/docstring/setup.rb
reek-5.6.0 docs/templates/default/docstring/setup.rb
reek-5.5.0 docs/templates/default/docstring/setup.rb
reek-5.4.1 docs/templates/default/docstring/setup.rb
reek-5.4.0 docs/templates/default/docstring/setup.rb
reek-5.3.2 docs/templates/default/docstring/setup.rb
reek-5.3.1 docs/templates/default/docstring/setup.rb
reek-5.3.0 docs/templates/default/docstring/setup.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/docs/templates/default/docstring/setup.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/docs/templates/default/docstring/setup.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/docs/templates/default/docstring/setup.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/docs/templates/default/docstring/setup.rb
reek-5.2.0 docs/templates/default/docstring/setup.rb
reek-5.1.0 docs/templates/default/docstring/setup.rb