Class: Deimos::SchemaField

Inherits:
Object
  • Object
show all
Defined in:
lib/deimos/schema_backends/base.rb

Overview

Represents a field in the schema.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, type, enum_values = [], default = :no_default) ⇒ SchemaField

Returns a new instance of SchemaField.

Parameters:

  • name (String)
  • type (Object)
  • enum_values (Array<String>) (defaults to: [])
  • default (Object) (defaults to: :no_default)


19
20
21
22
23
24
# File 'lib/deimos/schema_backends/base.rb', line 19

def initialize(name, type, enum_values=[], default=:no_default)
  @name = name
  @type = type
  @enum_values = enum_values
  @default = default
end

Instance Attribute Details

#defaultObject

Returns:

  • (Object)


13
14
15
# File 'lib/deimos/schema_backends/base.rb', line 13

def default
  @default
end

#enum_valuesArray<String>

Returns:

  • (Array<String>)


11
12
13
# File 'lib/deimos/schema_backends/base.rb', line 11

def enum_values
  @enum_values
end

#nameString

Returns:

  • (String)


7
8
9
# File 'lib/deimos/schema_backends/base.rb', line 7

def name
  @name
end

#typeString

Returns:

  • (String)


9
10
11
# File 'lib/deimos/schema_backends/base.rb', line 9

def type
  @type
end