Class: GraphitiGraphQL::Federation::FederatedRelationship
- Inherits:
-
Object
- Object
- GraphitiGraphQL::Federation::FederatedRelationship
- Defined in:
- lib/graphiti_graphql/federation/federated_relationship.rb
Instance Attribute Summary collapse
-
#foreign_key ⇒ Object
readonly
Returns the value of attribute foreign_key.
-
#local_resource_class ⇒ Object
readonly
Returns the value of attribute local_resource_class.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#params_block ⇒ Object
readonly
Returns the value of attribute params_block.
Instance Method Summary collapse
- #belongs_to? ⇒ Boolean
- #has_many? ⇒ Boolean
-
#initialize(kind, name, local_resource_class, foreign_key) ⇒ FederatedRelationship
constructor
A new instance of FederatedRelationship.
- #params(&blk) ⇒ Object
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_key ⇒ Object (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_class ⇒ Object (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 |
#name ⇒ Object (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_block ⇒ Object (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
17 18 19 |
# File 'lib/graphiti_graphql/federation/federated_relationship.rb', line 17 def belongs_to? @kind == :belongs_to end |
#has_many? ⇒ 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 |