Class: SObjectModel::Schema::Field

Inherits:
Object
  • Object
show all
Defined in:
lib/sobject_model/schema.rb

Constant Summary collapse

PicklistValue =
Data.define(:active, :default_value, :label, :valid_for, :value)

Instance Method Summary collapse

Constructor Details

#initialize(field) ⇒ Field

Returns a new instance of Field.



300
301
302
# File 'lib/sobject_model/schema.rb', line 300

def initialize(field)
  @field = field
end

Instance Method Details

#aggregatable?Boolean

Returns:

  • (Boolean)


304
305
306
# File 'lib/sobject_model/schema.rb', line 304

def aggregatable?
  field["aggregatable"]
end

#ai_prediction_field?Boolean

Returns:

  • (Boolean)


308
309
310
# File 'lib/sobject_model/schema.rb', line 308

def ai_prediction_field?
  field["aiPredictionField"]
end

#autoNumber?Boolean

Returns:

  • (Boolean)


312
313
314
# File 'lib/sobject_model/schema.rb', line 312

def autoNumber?
  field["autoNumber"]
end

#byteLengthObject



316
317
318
# File 'lib/sobject_model/schema.rb', line 316

def byteLength
  field["byteLength"]
end

#calculated?Boolean

Returns:

  • (Boolean)


320
321
322
# File 'lib/sobject_model/schema.rb', line 320

def calculated?
  field["calculated"]
end

#calculated_formulaObject



324
325
326
# File 'lib/sobject_model/schema.rb', line 324

def calculated_formula
  field["calculatedFormula"]
end

#cascade_delete?Boolean

Returns:

  • (Boolean)


328
329
330
# File 'lib/sobject_model/schema.rb', line 328

def cascade_delete?
  field["cascadeDelete"]
end

#case_sensitiveObject



332
333
334
# File 'lib/sobject_model/schema.rb', line 332

def case_sensitive
  field["caseSensitive"]
end

#compound_field_nameObject



336
337
338
# File 'lib/sobject_model/schema.rb', line 336

def compound_field_name
  field["compoundFieldName"]
end

#controller_nameObject



340
341
342
# File 'lib/sobject_model/schema.rb', line 340

def controller_name
  field["controllerName"]
end

#createable?Boolean

Returns:

  • (Boolean)


344
345
346
# File 'lib/sobject_model/schema.rb', line 344

def createable?
  field["createable"]
end

#custom?Boolean

Returns:

  • (Boolean)


348
349
350
# File 'lib/sobject_model/schema.rb', line 348

def custom?
  field["custom"]
end

#default_valueObject



352
353
354
# File 'lib/sobject_model/schema.rb', line 352

def default_value
  field["defaultValue"]
end

#default_value_formulaObject



356
357
358
# File 'lib/sobject_model/schema.rb', line 356

def default_value_formula
  field["defaultValueFormula"]
end

#defaulted_on_create?Boolean

Returns:

  • (Boolean)


360
361
362
# File 'lib/sobject_model/schema.rb', line 360

def defaulted_on_create?
  field["defaultedOnCreate"]
end

#dependent_picklist?Boolean

Returns:

  • (Boolean)


364
365
366
# File 'lib/sobject_model/schema.rb', line 364

def dependent_picklist?
  field["dependentPicklist"]
end

#deprecated_and_hidden?Boolean

Returns:

  • (Boolean)


368
369
370
# File 'lib/sobject_model/schema.rb', line 368

def deprecated_and_hidden?
  field["deprecatedAndHidden"]
end

#digitsObject



372
373
374
# File 'lib/sobject_model/schema.rb', line 372

def digits
  field["digits"]
end

#display_location_in_decimal?Boolean

Returns:

  • (Boolean)


376
377
378
# File 'lib/sobject_model/schema.rb', line 376

def display_location_in_decimal?
  field["displayLocationInDecimal"]
end

#encrypted?Boolean

Returns:

  • (Boolean)


380
381
382
# File 'lib/sobject_model/schema.rb', line 380

def encrypted?
  field["encrypted"]
end

#external_id?Boolean

Returns:

  • (Boolean)


384
385
386
# File 'lib/sobject_model/schema.rb', line 384

def external_id?
  field["externalId"]
end

#extra_type_infoObject



388
389
390
# File 'lib/sobject_model/schema.rb', line 388

def extra_type_info
  field["extraTypeInfo"]
end

#filterable?Boolean

Returns:

  • (Boolean)


392
393
394
# File 'lib/sobject_model/schema.rb', line 392

def filterable?
  field["filterable"]
end

#filtered_lookup_infoObject



396
397
398
# File 'lib/sobject_model/schema.rb', line 396

def filtered_lookup_info
  field["filteredLookupInfo"]
end

#formula_treat_null_number_as_zero?Boolean

Returns:

  • (Boolean)


400
401
402
# File 'lib/sobject_model/schema.rb', line 400

def formula_treat_null_number_as_zero?
  field["formulaTreatNullNumberAsZero"]
end

#groupable?Boolean

Returns:

  • (Boolean)


404
405
406
# File 'lib/sobject_model/schema.rb', line 404

def groupable?
  field["groupable"]
end

#high_scale_number?Boolean

Returns:

  • (Boolean)


408
409
410
# File 'lib/sobject_model/schema.rb', line 408

def high_scale_number?
  field["highScaleNumber"]
end

#html_formatted?Boolean

Returns:

  • (Boolean)


412
413
414
# File 'lib/sobject_model/schema.rb', line 412

def html_formatted?
  field["htmlFormatted"]
end

#id_lookup?Boolean

Returns:

  • (Boolean)


416
417
418
# File 'lib/sobject_model/schema.rb', line 416

def id_lookup?
  field["idLookup"]
end

#inline_help_textObject



420
421
422
# File 'lib/sobject_model/schema.rb', line 420

def inline_help_text
  field["inlineHelpText"]
end

#labelObject



424
425
426
# File 'lib/sobject_model/schema.rb', line 424

def label
  field["label"]
end

#lengthObject



428
429
430
# File 'lib/sobject_model/schema.rb', line 428

def length
  field["length"]
end

#maskObject



432
433
434
# File 'lib/sobject_model/schema.rb', line 432

def mask
  field["mask"]
end

#mask_typeObject



436
437
438
# File 'lib/sobject_model/schema.rb', line 436

def mask_type
  field["maskType"]
end

#nameObject



440
441
442
# File 'lib/sobject_model/schema.rb', line 440

def name
  field["name"]
end

#name_field?Boolean

Returns:

  • (Boolean)


444
445
446
# File 'lib/sobject_model/schema.rb', line 444

def name_field?
  field["nameField"]
end

#name_pointing?Boolean

Returns:

  • (Boolean)


448
449
450
# File 'lib/sobject_model/schema.rb', line 448

def name_pointing?
  field["namePointing"]
end

#nillable?Boolean

Returns:

  • (Boolean)


452
453
454
# File 'lib/sobject_model/schema.rb', line 452

def nillable?
  field["nillable"]
end

#permissionable?Boolean

Returns:

  • (Boolean)


456
457
458
# File 'lib/sobject_model/schema.rb', line 456

def permissionable?
  field["permissionable"]
end

#picklist_valuesObject



462
463
464
465
466
467
468
469
470
471
472
# File 'lib/sobject_model/schema.rb', line 462

def picklist_values
  field["picklistValues"].map do |value|
    PicklistValue.new(
      active:        value['active'],
      default_value: value['defaultValue'],
      label:         value['label'],
      valid_for:     value['validFor'],
      value:         value['value'],
    )
  end
end

#polymorphic_foreign_key?Boolean

Returns:

  • (Boolean)


474
475
476
# File 'lib/sobject_model/schema.rb', line 474

def polymorphic_foreign_key?
  field["polymorphicForeignKey"]
end

#precisionObject



478
479
480
# File 'lib/sobject_model/schema.rb', line 478

def precision
  field["precision"]
end

#query_by_distance?Boolean

Returns:

  • (Boolean)


482
483
484
# File 'lib/sobject_model/schema.rb', line 482

def query_by_distance?
  field["queryByDistance"]
end

#reference_target_fieldObject



486
487
488
# File 'lib/sobject_model/schema.rb', line 486

def reference_target_field
  field["referenceTargetField"]
end

#reference_toObject



490
491
492
# File 'lib/sobject_model/schema.rb', line 490

def reference_to
  field["referenceTo"]
end

#relationship_nameObject



494
495
496
# File 'lib/sobject_model/schema.rb', line 494

def relationship_name
  field["relationshipName"]
end

#relationship_orderObject



498
499
500
# File 'lib/sobject_model/schema.rb', line 498

def relationship_order
  field["relationshipOrder"]
end

#restricted_deleteObject



502
503
504
# File 'lib/sobject_model/schema.rb', line 502

def restricted_delete
  field["restrictedDelete"]
end

#restricted_picklist?Boolean

Returns:

  • (Boolean)


506
507
508
# File 'lib/sobject_model/schema.rb', line 506

def restricted_picklist?
  field["restrictedPicklist"]
end

#scaleObject



510
511
512
# File 'lib/sobject_model/schema.rb', line 510

def scale
  field["scale"]
end

#search_prefilterable?Boolean

Returns:

  • (Boolean)


514
515
516
# File 'lib/sobject_model/schema.rb', line 514

def search_prefilterable?
  field["searchPrefilterable"]
end

#soapTypeObject



518
519
520
# File 'lib/sobject_model/schema.rb', line 518

def soapType
  field["soapType"]
end

#sortable?Boolean

Returns:

  • (Boolean)


522
523
524
# File 'lib/sobject_model/schema.rb', line 522

def sortable?
  field["sortable"]
end

#to_hObject



542
543
544
# File 'lib/sobject_model/schema.rb', line 542

def to_h
  field
end

#typeObject



526
527
528
# File 'lib/sobject_model/schema.rb', line 526

def type
  field["type"]
end

#unique?Boolean

Returns:

  • (Boolean)


530
531
532
# File 'lib/sobject_model/schema.rb', line 530

def unique?
  field["unique"]
end

#updateable?Boolean

Returns:

  • (Boolean)


534
535
536
# File 'lib/sobject_model/schema.rb', line 534

def updateable?
  field["updateable"]
end

#write_Requires_Master_Read?Boolean

Returns:

  • (Boolean)


538
539
540
# File 'lib/sobject_model/schema.rb', line 538

def write_Requires_Master_Read?
  field["writeRequiresMasterRead"]
end