Class: Graphql::Generators::TypeGeneratorBase::NormalizedField

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/graphql/type_generator.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, type_expr, null) ⇒ NormalizedField


86
87
88
89
90
# File 'lib/generators/graphql/type_generator.rb', line 86

def initialize(name, type_expr, null)
  @name = name
  @type_expr = type_expr
  @null = null
end

Instance Method Details

#to_rubyObject


92
93
94
# File 'lib/generators/graphql/type_generator.rb', line 92

def to_ruby
  "field :#{@name}, #{@type_expr}, null: #{@null}"
end