Class: Odin::Types::SchemaField
- Inherits:
-
Object
- Object
- Odin::Types::SchemaField
- Defined in:
- lib/odin/types/schema.rb
Overview
Schema field definition
Instance Attribute Summary collapse
-
#computed ⇒ Object
readonly
Returns the value of attribute computed.
-
#conditionals ⇒ Object
readonly
Returns the value of attribute conditionals.
-
#constraints ⇒ Object
readonly
Returns the value of attribute constraints.
-
#default_value ⇒ Object
readonly
Returns the value of attribute default_value.
-
#deprecated ⇒ Object
readonly
Returns the value of attribute deprecated.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#field_type ⇒ Object
readonly
Returns the value of attribute field_type.
-
#immutable ⇒ Object
readonly
Returns the value of attribute immutable.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#nullable ⇒ Object
readonly
Returns the value of attribute nullable.
-
#redacted ⇒ Object
readonly
Returns the value of attribute redacted.
-
#required ⇒ Object
readonly
Returns the value of attribute required.
-
#type_ref ⇒ Object
readonly
Returns the value of attribute type_ref.
Instance Method Summary collapse
-
#initialize(name:, field_type:, required: false, nullable: false, redacted: false, deprecated: false, constraints: [], conditionals: [], default_value: nil, description: nil, computed: false, immutable: false, type_ref: nil) ⇒ SchemaField
constructor
A new instance of SchemaField.
Constructor Details
#initialize(name:, field_type:, required: false, nullable: false, redacted: false, deprecated: false, constraints: [], conditionals: [], default_value: nil, description: nil, computed: false, immutable: false, type_ref: nil) ⇒ SchemaField
Returns a new instance of SchemaField.
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/odin/types/schema.rb', line 116 def initialize(name:, field_type:, required: false, nullable: false, redacted: false, deprecated: false, constraints: [], conditionals: [], default_value: nil, description: nil, computed: false, immutable: false, type_ref: nil) @name = name.freeze @field_type = field_type @required = required @nullable = nullable @redacted = redacted @deprecated = deprecated @constraints = constraints.freeze @conditionals = conditionals.freeze @default_value = default_value @description = description&.freeze @computed = computed @immutable = immutable @type_ref = type_ref&.freeze freeze end |
Instance Attribute Details
#computed ⇒ Object (readonly)
Returns the value of attribute computed.
112 113 114 |
# File 'lib/odin/types/schema.rb', line 112 def computed @computed end |
#conditionals ⇒ Object (readonly)
Returns the value of attribute conditionals.
112 113 114 |
# File 'lib/odin/types/schema.rb', line 112 def conditionals @conditionals end |
#constraints ⇒ Object (readonly)
Returns the value of attribute constraints.
112 113 114 |
# File 'lib/odin/types/schema.rb', line 112 def constraints @constraints end |
#default_value ⇒ Object (readonly)
Returns the value of attribute default_value.
112 113 114 |
# File 'lib/odin/types/schema.rb', line 112 def default_value @default_value end |
#deprecated ⇒ Object (readonly)
Returns the value of attribute deprecated.
112 113 114 |
# File 'lib/odin/types/schema.rb', line 112 def deprecated @deprecated end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
112 113 114 |
# File 'lib/odin/types/schema.rb', line 112 def description @description end |
#field_type ⇒ Object (readonly)
Returns the value of attribute field_type.
112 113 114 |
# File 'lib/odin/types/schema.rb', line 112 def field_type @field_type end |
#immutable ⇒ Object (readonly)
Returns the value of attribute immutable.
112 113 114 |
# File 'lib/odin/types/schema.rb', line 112 def immutable @immutable end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
112 113 114 |
# File 'lib/odin/types/schema.rb', line 112 def name @name end |
#nullable ⇒ Object (readonly)
Returns the value of attribute nullable.
112 113 114 |
# File 'lib/odin/types/schema.rb', line 112 def nullable @nullable end |
#redacted ⇒ Object (readonly)
Returns the value of attribute redacted.
112 113 114 |
# File 'lib/odin/types/schema.rb', line 112 def redacted @redacted end |
#required ⇒ Object (readonly)
Returns the value of attribute required.
112 113 114 |
# File 'lib/odin/types/schema.rb', line 112 def required @required end |
#type_ref ⇒ Object (readonly)
Returns the value of attribute type_ref.
112 113 114 |
# File 'lib/odin/types/schema.rb', line 112 def type_ref @type_ref end |