Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/news/article.rb
Overview
Add a method to general String class
Constant Summary
- SPECIAL =
Special rules for some headers
Hash.new
Instance Method Summary (collapse)
-
- (String) canonical
Change a header name to conform to RFC rules about capitalization.
Instance Method Details
- (String) canonical
Change a header name to conform to RFC rules about capitalization
32 33 34 |
# File 'lib/news/article.rb', line 32 def canonical self.split(%r{([_-])}).map {|i| SPECIAL[i] || i.capitalize }.join('') end |