Sha256: 1b1dd6841ca0dda999ec021d717b181081845a5179b1df8b90aa74c780446534

Contents?: true

Size: 650 Bytes

Versions: 35

Compression:

Stored size: 650 Bytes

Contents

# encoding: utf-8
require 'active_support/core_ext/object/inclusion'
require 'open_classes/string/heading_helper'

class String
  include HeadingHelper
  # Tab
  TAB = "\t"

  # create heading string with Emmet-like syntax.
  #
  # ==== Examples
  #
  # > case
  #
  #   'hoge>hige'.to_tab_heading # => 'hoge\n\thige'
  #
  # + case
  #
  #   'hoge+hige'.to_tab_heading # => 'hoge\nhige'
  #
  # ^ case
  #
  #   'hoge>hige^hege'.to_tab_heading # => 'hoge\n\thige\nhege'
  #
  def to_tab_heading
    heading = to_heading
    to_tab heading
  end

  private
  def to_tab(heading)
    to_head(heading, TAB)
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
tbpgr_utils-0.0.151 lib/open_classes/string/to_tab_heading.rb
tbpgr_utils-0.0.150 lib/open_classes/string/to_tab_heading.rb
tbpgr_utils-0.0.149 lib/open_classes/string/to_tab_heading.rb
tbpgr_utils-0.0.148 lib/open_classes/string/to_tab_heading.rb
tbpgr_utils-0.0.147 lib/open_classes/string/to_tab_heading.rb
tbpgr_utils-0.0.146 lib/open_classes/string/to_tab_heading.rb
tbpgr_utils-0.0.145 lib/open_classes/string/to_tab_heading.rb
tbpgr_utils-0.0.144 lib/open_classes/string/to_tab_heading.rb
tbpgr_utils-0.0.143 lib/open_classes/string/to_tab_heading.rb
tbpgr_utils-0.0.142 lib/open_classes/string/to_tab_heading.rb
tbpgr_utils-0.0.141 lib/open_classes/string/to_tab_heading.rb
tbpgr_utils-0.0.140 lib/open_classes/string/to_tab_heading.rb
tbpgr_utils-0.0.139 lib/open_classes/string/to_tab_heading.rb
tbpgr_utils-0.0.138 lib/open_classes/string/to_tab_heading.rb
tbpgr_utils-0.0.137 lib/open_classes/string/to_tab_heading.rb
tbpgr_utils-0.0.136 lib/open_classes/string/to_tab_heading.rb
tbpgr_utils-0.0.135 lib/open_classes/string/to_tab_heading.rb
tbpgr_utils-0.0.134 lib/open_classes/string/to_tab_heading.rb
tbpgr_utils-0.0.133 lib/open_classes/string/to_tab_heading.rb
tbpgr_utils-0.0.132 lib/open_classes/string/to_tab_heading.rb