Class: GraphitiGraphQL::Federation::FederatedRelationship

Inherits:
Object
  • Object
show all
Defined in:
lib/graphiti_graphql/federation/federated_relationship.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(kind, name, local_resource_class, foreign_key) ⇒ FederatedRelationship

Returns a new instance of FederatedRelationship.



6
7
8
9
10
11
# File 'lib/graphiti_graphql/federation/federated_relationship.rb', line 6

def initialize(kind, name, local_resource_class, foreign_key)
  @kind = kind
  @name = name
  @local_resource_class = local_resource_class
  @foreign_key = foreign_key
end

Instance Attribute Details

#foreign_keyObject (readonly)

Returns the value of attribute foreign_key.



4
5
6
# File 'lib/graphiti_graphql/federation/federated_relationship.rb', line 4

def foreign_key
  @foreign_key
end

#local_resource_classObject (readonly)

Returns the value of attribute local_resource_class.



4
5
6
# File 'lib/graphiti_graphql/federation/federated_relationship.rb', line 4

def local_resource_class
  @local_resource_class
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/graphiti_graphql/federation/federated_relationship.rb', line 4

def name
  @name
end

#params_blockObject (readonly)

Returns the value of attribute params_block.



4
5
6
# File 'lib/graphiti_graphql/federation/federated_relationship.rb', line 4

def params_block
  @params_block
end

Instance Method Details

#belongs_to?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/graphiti_graphql/federation/federated_relationship.rb', line 17

def belongs_to?
  @kind == :belongs_to
end

#has_many?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/graphiti_graphql/federation/federated_relationship.rb', line 13

def has_many?
  @kind == :has_many
end

#params(&blk) ⇒ Object



21
22
23
# File 'lib/graphiti_graphql/federation/federated_relationship.rb', line 21

def params(&blk)
  @params_block = blk
end