Class: SolidusGraphqlApi::Queries::CompletedOrdersQuery
- Inherits:
-
Object
- Object
- SolidusGraphqlApi::Queries::CompletedOrdersQuery
- Defined in:
- lib/solidus_graphql_api/queries/completed_orders_query.rb
Instance Attribute Summary collapse
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(user:) ⇒ CompletedOrdersQuery
constructor
A new instance of CompletedOrdersQuery.
Constructor Details
#initialize(user:) ⇒ CompletedOrdersQuery
Returns a new instance of CompletedOrdersQuery.
8 9 10 |
# File 'lib/solidus_graphql_api/queries/completed_orders_query.rb', line 8 def initialize(user:) @user = user end |
Instance Attribute Details
#user ⇒ Object (readonly)
Returns the value of attribute user.
6 7 8 |
# File 'lib/solidus_graphql_api/queries/completed_orders_query.rb', line 6 def user @user end |
Instance Method Details
#call ⇒ Object
12 13 14 15 16 |
# File 'lib/solidus_graphql_api/queries/completed_orders_query.rb', line 12 def call return [] unless user user.orders.complete.order :id end |