Module: Plato::Repo::Sanitize
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, value) ⇒ Object
186
187
188
189
|
# File 'lib/plato/repo.rb', line 186
def method_missing(method, value)
warn "Warning: not sanitizing #{method}."
value.to_s
end
|
Instance Method Details
#body(body) ⇒ Object
182
183
184
|
# File 'lib/plato/repo.rb', line 182
def body(body)
body end
|
174
175
176
|
# File 'lib/plato/repo.rb', line 174
def ()
.gsub(/(\r|\n)/) {|m| {"\r" => '\r', "\n" => '\n'}[m] }
end
|
#path_elem(elem) ⇒ Object
178
179
180
|
# File 'lib/plato/repo.rb', line 178
def path_elem(elem)
elem.to_s.gsub(/\s+/, '_').gsub(/[^a-zA-Z0-9_-]/,'')
end
|