Class: Graphiti::ValueObjectAssociation

Inherits:
Object
  • Object
show all
Defined in:
lib/graphiti_gql/graphiti_hax.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, parent_resource_class:, resource_class:, is_array: false, readable: nil, null: true, _alias: nil, deprecation_reason: nil) ⇒ ValueObjectAssociation

Returns a new instance of ValueObjectAssociation.



573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
# File 'lib/graphiti_gql/graphiti_hax.rb', line 573

def initialize(
  name,
  parent_resource_class:,
  resource_class:,
  is_array: false,
  readable: nil,
  null: true,
  _alias: nil,
  deprecation_reason: nil
)
  @name = name
  @parent_resource_class = parent_resource_class
  @resource_class = resource_class
  @readable = readable
  @array = is_array
  @alias = _alias
  @null = null
  @deprecation_reason = deprecation_reason
end

Instance Attribute Details

#aliasObject (readonly)

Returns the value of attribute alias.



566
567
568
# File 'lib/graphiti_gql/graphiti_hax.rb', line 566

def alias
  @alias
end

#deprecation_reasonObject (readonly)

Returns the value of attribute deprecation_reason.



566
567
568
# File 'lib/graphiti_gql/graphiti_hax.rb', line 566

def deprecation_reason
  @deprecation_reason
end

#nameObject (readonly)

Returns the value of attribute name.



566
567
568
# File 'lib/graphiti_gql/graphiti_hax.rb', line 566

def name
  @name
end

#nullObject (readonly)

Returns the value of attribute null.



566
567
568
# File 'lib/graphiti_gql/graphiti_hax.rb', line 566

def null
  @null
end

#parent_resource_classObject (readonly)

Returns the value of attribute parent_resource_class.



566
567
568
# File 'lib/graphiti_gql/graphiti_hax.rb', line 566

def parent_resource_class
  @parent_resource_class
end

#readableObject (readonly)

Returns the value of attribute readable.



566
567
568
# File 'lib/graphiti_gql/graphiti_hax.rb', line 566

def readable
  @readable
end

Instance Method Details

#array?Boolean

Returns:

  • (Boolean)


593
594
595
# File 'lib/graphiti_gql/graphiti_hax.rb', line 593

def array?
  !!@array
end

#resource_classObject



597
598
599
600
# File 'lib/graphiti_gql/graphiti_hax.rb', line 597

def resource_class
  @resource_class ||= Graphiti::Util::Class
    .infer_resource_class(@parent_resource_class, name)
end