Sha256: 5769c767afc5cd1b5cf714930dc287aa5f5c038a92663102b5e207c3e5ed15f8

Contents?: true

Size: 622 Bytes

Versions: 2

Compression:

Stored size: 622 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 grammar.
  #
  # ==== 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

2 entries across 2 versions & 1 rubygems

Version Path
tbpgr_utils-0.0.50 lib/open_classes/string/to_tab_heading.rb
tbpgr_utils-0.0.49 lib/open_classes/string/to_tab_heading.rb