Class: ChangelogGenerator::TextFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/changelog_generator/text_formatter.rb

Class Method Summary collapse

Class Method Details

.text_formatter(string) ⇒ Object

Determines the type of text formatting wanted from the provided parameter string for formatting Params:

string

The string representation of the text formatting desired



7
8
9
10
11
12
13
14
15
# File 'lib/changelog_generator/text_formatter.rb', line 7

def self.text_formatter(string)
  if string.casecmp("slack") == 0
    return :slack
  elsif string.casecmp("markdown") == 0 or string.casecmp("md") == 0 or string.casecmp("mkd") == 0 or string.casecmp("mdown") == 0
    return :markdown
  else
    abort "Invalid formatting style provided. Available formatting options are: Slack, or Markdown"
  end
end