Class: String

Inherits:
Object
  • Object
show all
Includes:
Apache::Apachify
Defined in:
lib/apache/apachify.rb

Overview

Ruby strings

Instance Method Summary collapse

Methods included from Apache::Apachify

#apachify

Instance Method Details

#commentizeObject



30
31
32
# File 'lib/apache/apachify.rb', line 30

def commentize
  self.split("\n")
end

#headerizeObject



40
41
42
# File 'lib/apache/apachify.rb', line 40

def headerize
  "#{self.quoteize}"
end

#quoteizeObject Also known as: blockify



34
35
36
# File 'lib/apache/apachify.rb', line 34

def quoteize
  %{"#{self}"}
end

#replace_placeholderize(opts) ⇒ Object



44
45
46
47
48
49
# File 'lib/apache/apachify.rb', line 44

def replace_placeholderize(opts)
  self.gsub(%r{%\{([^\}]+)\}}) do |match|
    key = $1.downcase.to_sym
    opts[key] || ''
  end
end