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: [])


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

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 the value of attribute default.



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

def default
  @default
end

#enum_valuesObject

Returns the value of attribute enum_values.



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

def enum_values
  @enum_values
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#typeObject

Returns the value of attribute type.



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

def type
  @type
end