Class: Trane::FieldNode

Inherits:
Data
  • Object
show all
Defined in:
lib/trane/field_node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, type: nil, extra: false, format: nil, array_of: nil, required: nil, enum: nil, children: []) ⇒ FieldNode

Returns a new instance of FieldNode.



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/trane/field_node.rb', line 5

def initialize(name:, type: nil, extra: false, format: nil, array_of: nil, required: nil, enum: nil, children: [])
  super(
    name: name.to_sym,
    type: type&.to_sym,
    extra: extra,
    format: format&.to_sym,
    array_of: array_of&.to_sym,
    required: required,
    enum: enum&.freeze,
    children: children.freeze
  )
end

Instance Attribute Details

#array_ofObject (readonly)

Returns the value of attribute array_of

Returns:

  • (Object)

    the current value of array_of



4
5
6
# File 'lib/trane/field_node.rb', line 4

def array_of
  @array_of
end

#childrenObject (readonly)

Returns the value of attribute children

Returns:

  • (Object)

    the current value of children



4
5
6
# File 'lib/trane/field_node.rb', line 4

def children
  @children
end

#enumObject (readonly)

Returns the value of attribute enum

Returns:

  • (Object)

    the current value of enum



4
5
6
# File 'lib/trane/field_node.rb', line 4

def enum
  @enum
end

#extraObject (readonly)

Returns the value of attribute extra

Returns:

  • (Object)

    the current value of extra



4
5
6
# File 'lib/trane/field_node.rb', line 4

def extra
  @extra
end

#formatObject (readonly)

Returns the value of attribute format

Returns:

  • (Object)

    the current value of format



4
5
6
# File 'lib/trane/field_node.rb', line 4

def format
  @format
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



4
5
6
# File 'lib/trane/field_node.rb', line 4

def name
  @name
end

#requiredObject (readonly)

Returns the value of attribute required

Returns:

  • (Object)

    the current value of required



4
5
6
# File 'lib/trane/field_node.rb', line 4

def required
  @required
end

#typeObject (readonly)

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



4
5
6
# File 'lib/trane/field_node.rb', line 4

def type
  @type
end