Class: Scheming::Attribute

Inherits:
Object
  • Object
show all
Defined in:
lib/scheming/attribute.rb

Overview

Attribute

Defined Under Namespace

Classes: List, ListBuilder

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(field_name:, type:, is_required: true) ⇒ Attribute

Returns a new instance of Attribute.

Parameters:



17
18
19
20
21
22
23
24
25
26
# File 'lib/scheming/attribute.rb', line 17

def initialize(
  field_name:,
  type:,
  is_required: true
)
  @field_name = field_name
  @type = type
  @is_required = is_required
  freeze
end

Instance Attribute Details

#field_nameSymbol (readonly)

Returns:

  • (Symbol)


7
8
9
# File 'lib/scheming/attribute.rb', line 7

def field_name
  @field_name
end

#is_requiredBoolean (readonly)

Returns:

  • (Boolean)


13
14
15
# File 'lib/scheming/attribute.rb', line 13

def is_required
  @is_required
end

#typeScheming::Type::Base (readonly)



10
11
12
# File 'lib/scheming/attribute.rb', line 10

def type
  @type
end