Sha256: d916f541f5cdbd8df8b11343d8ca270d201f242ad01b5961a2611d967de31427

Contents?: true

Size: 613 Bytes

Versions: 17

Compression:

Stored size: 613 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

17 entries across 17 versions & 1 rubygems

Version Path
reek-5.0.2 docs/templates/default/docstring/setup.rb
reek-5.0.1 docs/templates/default/docstring/setup.rb
reek-5.0.0 docs/templates/default/docstring/setup.rb
reek-4.8.2 docs/templates/default/docstring/setup.rb
reek-4.8.1 docs/templates/default/docstring/setup.rb
reek-4.8.0 docs/templates/default/docstring/setup.rb
reek-4.7.3 docs/templates/default/docstring/setup.rb
reek-4.7.2 docs/templates/default/docstring/setup.rb
reek-4.7.1 docs/templates/default/docstring/setup.rb
reek-4.7.0 docs/templates/default/docstring/setup.rb
reek-4.6.2 docs/templates/default/docstring/setup.rb
reek-4.6.1 docs/templates/default/docstring/setup.rb
reek-4.6.0 docs/templates/default/docstring/setup.rb
reek-4.5.6 docs/templates/default/docstring/setup.rb
reek-4.5.5 docs/templates/default/docstring/setup.rb
reek-4.5.4 docs/templates/default/docstring/setup.rb
reek-4.5.3 docs/templates/default/docstring/setup.rb