Class: GraphQL::Schema::Printer::TypeKindPrinters::EnumPrinter
- Inherits:
-
Object
- Object
- GraphQL::Schema::Printer::TypeKindPrinters::EnumPrinter
- Extended by:
- DeprecatedPrinter, DescriptionPrinter
- Defined in:
- lib/graphql/schema/printer.rb
Class Method Summary collapse
Methods included from DeprecatedPrinter
Methods included from DescriptionPrinter
Class Method Details
.print(type) ⇒ Object
234 235 236 237 238 239 240 241 242 |
# File 'lib/graphql/schema/printer.rb', line 234 def self.print(type) values = type.values.values.map{ |v| " #{v.name}#{print_deprecated(v)}" }.join("\n") values = type.values.values.map.with_index { |v, i| "#{print_description(v, ' ', i == 0)}"\ " #{v.name}#{print_deprecated(v)}" }.join("\n") "#{print_description(type)}"\ "enum #{type.name} {\n#{values}\n}" end |