Module: GraphqlGrpc::EnumDescriptorExt

Defined in:
lib/graphql_grpc/type_library.rb

Instance Method Summary collapse

Instance Method Details

#to_gql_type(prefix) ⇒ Object



136
137
138
139
140
# File 'lib/graphql_grpc/type_library.rb', line 136

def to_gql_type(prefix)
  "enum #{prefix}#{type_name} {
  #{entries.map(&:first).join("\n  ")}
}"
end

#type_nameObject



131
132
133
134
# File 'lib/graphql_grpc/type_library.rb', line 131

def type_name
  # Take the last 2
  name.split('.')[-2..-1].join('_')
end