Class: GraphQL::SmartSelect::Assosiations
- Inherits:
-
Object
- Object
- GraphQL::SmartSelect::Assosiations
- Defined in:
- lib/graphql/smart_select/assosiations.rb
Overview
Provide methods to expose foreign keys for belongs_to and has_one assosiations
Instance Attribute Summary collapse
-
#query_fields ⇒ Object
readonly
Returns the value of attribute query_fields.
-
#relation ⇒ Object
readonly
Returns the value of attribute relation.
Instance Method Summary collapse
- #expose ⇒ Object
-
#initialize(relation, query_fields) ⇒ Assosiations
constructor
A new instance of Assosiations.
Constructor Details
#initialize(relation, query_fields) ⇒ Assosiations
Returns a new instance of Assosiations.
12 13 14 15 |
# File 'lib/graphql/smart_select/assosiations.rb', line 12 def initialize(relation, query_fields) @relation = relation @query_fields = query_fields end |
Instance Attribute Details
#query_fields ⇒ Object (readonly)
Returns the value of attribute query_fields.
10 11 12 |
# File 'lib/graphql/smart_select/assosiations.rb', line 10 def query_fields @query_fields end |
#relation ⇒ Object (readonly)
Returns the value of attribute relation.
10 11 12 |
# File 'lib/graphql/smart_select/assosiations.rb', line 10 def relation @relation end |
Instance Method Details
#expose ⇒ Object
17 18 19 |
# File 'lib/graphql/smart_select/assosiations.rb', line 17 def expose assosiations_keys end |