class MarkyMarkdown::Helpers

Public Class Methods

count_occurences_for(key, body) click to toggle source
# File lib/marky_markdown.rb, line 51
def self.count_occurences_for(key, body)
  length = key.length
  body.count(key) / length
end
shorten_str(str) click to toggle source
# File lib/marky_markdown.rb, line 37
def self.shorten_str(str)
  str.slice(str.index('#') + 1..(str.index('$') - 1))
rescue StandardError => e
  puts e.message
  puts e.backtrace.inspect
end
split_str_by_returns(str) click to toggle source
# File lib/marky_markdown.rb, line 44
def self.split_str_by_returns(str)
  str.split("\r\n")
rescue StandardError => e
  puts e.message
  puts e.backtrace.inspect
end