Class: OpenApiAnnotator::Field

Inherits:
Struct
  • Object
show all
Defined in:
lib/open_api_annotator/field.rb

Direct Known Subclasses

Association, Attribute

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



2
3
4
# File 'lib/open_api_annotator/field.rb', line 2

def name
  @name
end

#nullableObject

Returns the value of attribute nullable

Returns:

  • (Object)

    the current value of nullable



2
3
4
# File 'lib/open_api_annotator/field.rb', line 2

def nullable
  @nullable
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



2
3
4
# File 'lib/open_api_annotator/field.rb', line 2

def type
  @type
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


3
4
5
6
7
8
9
# File 'lib/open_api_annotator/field.rb', line 3

def valid?
  return false if name.nil?
  return false if type.nil?
  return false if nullable.nil?

  true
end