Demonstrate partially-lower-case acronyms in docs

It's not immediately obvious that acronyms containing lower-case characters, like "OpenGL", are handled correctly.

This updates the example in the documentation to use a normal acronym, and a partially lower-case one.
This commit is contained in:
Tom Dalling 2020-09-14 16:19:31 +10:00 committed by GitHub
parent b697c4ccce
commit c91fa96339
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -64,9 +64,9 @@ inflector.pluralize("dry-inflector") # => "dry-inflector"
require "dry/inflector"
inflector = Dry::Inflector.new do |inflections|
inflections.acronym "HTTP", "XML"
inflections.acronym "API", "OpenGL"
end
inflector.underscore("XMLHTTPRequest") # => "xml_http_request"
inflector.camelize("xml_http_request") # => "XMLHTTPRequest"
inflector.camelize("opengl_api") # => "OpenGLAPI"
inflector.underscore("OpenGLAPI") # => "opengl_api"
```