Proto::Generator::NamingPolicy
NamingPolicy converts proto identifiers to Crystal identifiers.
Rules (matching protoc-gen-go / protoc-gen-python conventions adapted for Crystal):
- package "foo.bar_baz" → module Foo::BarBaz
- message "HelloRequest" → class HelloRequest (already CamelCase)
- enum "Status" → enum Status
- enum value "STATUS_OK" → STATUS_OK (kept as-is, Crystal enums use SCREAMING_SNAKE)
- field "my_field" → property my_field (snake_case, kept)
Class methods
proto fully-qualified type ".foo.bar.Baz.Inner" → "Foo::Bar::Baz::Inner"
Convert a proto message/enum name (already CamelCase) to a Crystal class/enum name. Nested names are NOT joined here — the caller passes the leaf name.