Class: Array

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

Overview

Ruby arrays

Instance Method Summary collapse

Instance Method Details

#apachifyObject

Apachify all the elements within this array



83
84
85
# File 'lib/apache/apachify.rb', line 83

def apachify
  self.collect(&:apachify)
end

#blockifyObject



95
96
97
# File 'lib/apache/apachify.rb', line 95

def blockify
  self.quoteize * " "
end

#headerizeObject



101
102
103
# File 'lib/apache/apachify.rb', line 101

def headerize
  "#{self.first.quoteize} #{self.last}"
end

#quoteizeObject



87
88
89
# File 'lib/apache/apachify.rb', line 87

def quoteize
  self.collect(&:quoteize)
end

#quoteize!Object



91
92
93
# File 'lib/apache/apachify.rb', line 91

def quoteize!
  self.collect!(&:quoteize)
end

#rewrite_cond_optionifyObject



105
106
107
108
109
110
111
112
113
# File 'lib/apache/apachify.rb', line 105

def rewrite_cond_optionify
  self.collect do |opt|
    {
      :or => 'OR',
      :case_insensitive => 'NC',
      :no_vary => 'NV'
    }[opt]
  end
end

#rewrite_option_listifyObject



115
116
117
# File 'lib/apache/apachify.rb', line 115

def rewrite_option_listify
  (!self.empty?) ? "[#{self * ','}]" : nil
end