Sha256: af1b6b2ba9718bc5245e2bca986217f388048cb6c347524e1a758a169d87458d

Contents?: true

Size: 701 Bytes

Versions: 39

Compression:

Stored size: 701 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
  case api_text
  when 'public'
    # erb(:public_api_marker)
  when 'private'
    # Let section 'private' handle this.
  else
    erb(:private)
  end
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

39 entries across 39 versions & 1 rubygems

Version Path
reek-4.5.2 docs/templates/default/docstring/setup.rb
reek-4.5.1 docs/templates/default/docstring/setup.rb
reek-4.5.0 docs/templates/default/docstring/setup.rb
reek-4.4.2 docs/templates/default/docstring/setup.rb
reek-4.4.1 docs/templates/default/docstring/setup.rb
reek-4.4.0 docs/templates/default/docstring/setup.rb
reek-4.3.0 docs/templates/default/docstring/setup.rb
reek-4.2.5 docs/templates/default/docstring/setup.rb
reek-4.2.4 docs/templates/default/docstring/setup.rb
reek-4.2.3 docs/templates/default/docstring/setup.rb
reek-4.2.2 docs/templates/default/docstring/setup.rb
reek-4.2.1 docs/templates/default/docstring/setup.rb
reek-4.2.0 docs/templates/default/docstring/setup.rb
reek-4.1.1 docs/templates/default/docstring/setup.rb
reek-4.1.0 docs/templates/default/docstring/setup.rb
reek-4.0.5 docs/templates/default/docstring/setup.rb
reek-4.0.4 docs/templates/default/docstring/setup.rb
reek-4.0.3 docs/templates/default/docstring/setup.rb
reek-4.0.2 docs/templates/default/docstring/setup.rb
reek-4.0.1 docs/templates/default/docstring/setup.rb