Inflector customizations for codegen
This commit is contained in:
parent
7b6fa357f6
commit
df3e9a3c32
|
@ -25,12 +25,20 @@ require 'addressable/uri'
|
||||||
|
|
||||||
module Google
|
module Google
|
||||||
module Apis
|
module Apis
|
||||||
|
|
||||||
# @private
|
# @private
|
||||||
class Generator
|
class Generator
|
||||||
|
|
||||||
# Helper for picking names for methods, properties, types, etc. Performs various normaliations
|
# Helper for picking names for methods, properties, types, etc. Performs various normaliations
|
||||||
# as well as allows for overriding individual names from a configuration file for cases
|
# as well as allows for overriding individual names from a configuration file for cases
|
||||||
# where algorithmic approaches produce poor APIs.
|
# where algorithmic approaches produce poor APIs.
|
||||||
class Names
|
class Names
|
||||||
|
ActiveSupport::Inflector.inflections do |inflections|
|
||||||
|
puts "Customizing inflections..."
|
||||||
|
u = inflections.uncountable('send_as', 'as')
|
||||||
|
puts u
|
||||||
|
end
|
||||||
|
|
||||||
include Google::Apis::Core::Logging
|
include Google::Apis::Core::Logging
|
||||||
include NameHelpers
|
include NameHelpers
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue