Sha256: d668abc01ac3e87b1f38b1b0ced5318c250820218e9719f338fece78c38f18d4
Contents?: true
Size: 747 Bytes
Versions: 3
Compression:
Stored size: 747 Bytes
Contents
module JpQuest # インデントを扱うモジュール module IndentHelper # インデントを数える # # @param [String] unstripped_line stripされていない行 # @return [Integer] インデントの数 def count_indent(unstripped_line) unstripped_line.length - unstripped_line.lstrip.length end # インデントを作成 # # @param [Integer] indent インデント数 # @return [String] インデント def create_indent(indent) " " * indent end # 中間行のインデントを作成 # # @param [Integer] indent インデント数 # @return [String] 中間行のインデント def middle_indent(indent) " " * (indent + 1) end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
jp_quest-0.3.2 | lib/jp_quest/util/indent_helper.rb |
jp_quest-0.3.1 | lib/jp_quest/util/indent_helper.rb |
jp_quest-0.3.0 | lib/jp_quest/util/indent_helper.rb |