Sha256: c38437d01e64f95a526268e0b801d0bf68bd50698bbc9726510a53337c5453e7

Contents?: true

Size: 265 Bytes

Versions: 1

Compression:

Stored size: 265 Bytes

Contents

module Space2underscore
  class Underscore
    def initialize(sentence)
      @sentence = sentence
    end

    def convert
      if @sentence.length == 1
        @sentence[0].strip.gsub(/\s/, '_')
      else
        @sentence.join('_')
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
space2underscore-0.5.2 lib/space2underscore/underscore.rb