Class: String
- Inherits:
-
Object
- Object
- String
- Includes:
- Apache::Apachify
- Defined in:
- lib/apache/apachify.rb
Overview
Ruby strings
Instance Method Summary collapse
- #commentize ⇒ Object
- #headerize ⇒ Object
- #quoteize ⇒ Object (also: #blockify)
- #replace_placeholderize(opts) ⇒ Object
Methods included from Apache::Apachify
Instance Method Details
#commentize ⇒ Object
30 31 32 |
# File 'lib/apache/apachify.rb', line 30 def commentize self.split("\n") end |
#headerize ⇒ Object
40 41 42 |
# File 'lib/apache/apachify.rb', line 40 def headerize "#{self.quoteize}" end |
#quoteize ⇒ Object 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 |