Sha256: 003fa5b91563ad88c180651bbe346e809f784988ae2e40bfcf4bab5ffee592da

Contents?: true

Size: 654 Bytes

Versions: 66

Compression:

Stored size: 654 Bytes

Contents

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

class String
  include HeadingHelper
  # Space4
  SPACE4 = '    '

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

  private
    def to_space4(heading)
      to_head(heading, SPACE4)
    end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
tbpgr_utils-0.0.96 lib/open_classes/string/to_space4_heading.rb
tbpgr_utils-0.0.95 lib/open_classes/string/to_space4_heading.rb
tbpgr_utils-0.0.94 lib/open_classes/string/to_space4_heading.rb
tbpgr_utils-0.0.93 lib/open_classes/string/to_space4_heading.rb
tbpgr_utils-0.0.92 lib/open_classes/string/to_space4_heading.rb
tbpgr_utils-0.0.91 lib/open_classes/string/to_space4_heading.rb
tbpgr_utils-0.0.90 lib/open_classes/string/to_space4_heading.rb
tbpgr_utils-0.0.89 lib/open_classes/string/to_space4_heading.rb
tbpgr_utils-0.0.88 lib/open_classes/string/to_space4_heading.rb
tbpgr_utils-0.0.87 lib/open_classes/string/to_space4_heading.rb
tbpgr_utils-0.0.86 lib/open_classes/string/to_space4_heading.rb
tbpgr_utils-0.0.85 lib/open_classes/string/to_space4_heading.rb
tbpgr_utils-0.0.84 lib/open_classes/string/to_space4_heading.rb
tbpgr_utils-0.0.83 lib/open_classes/string/to_space4_heading.rb
tbpgr_utils-0.0.82 lib/open_classes/string/to_space4_heading.rb
tbpgr_utils-0.0.81 lib/open_classes/string/to_space4_heading.rb
tbpgr_utils-0.0.80 lib/open_classes/string/to_space4_heading.rb
tbpgr_utils-0.0.79 lib/open_classes/string/to_space4_heading.rb
tbpgr_utils-0.0.78 lib/open_classes/string/to_space4_heading.rb
tbpgr_utils-0.0.77 lib/open_classes/string/to_space4_heading.rb