Class: Jbr::Client
Constant Summary collapse
- LOOKUP =
<<~GRAPHQL.freeze query($searchTerm: String!) { clientPhones(searchTerm: $searchTerm) { nodes { client { id updatedAt } } } } GRAPHQL
- CREATE =
<<~GRAPHQL.freeze mutation($input: ClientCreateInput!) { clientCreate(input: $input) { client { id } userErrors { message } } } GRAPHQL
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
-
#create_with(params = {}) ⇒ Client
Create a client instance with the provided attributes.
- #find_or_create_by(phone:) ⇒ Object
Methods inherited from Resource
Constructor Details
This class inherits a constructor from Jbr::Resource
Instance Method Details
#create_with(params = {}) ⇒ Client
Create a client instance with the provided attributes.
22 23 24 |
# File 'lib/jbr/client.rb', line 22 def create_with(params = {}) self.tap { @create_params = params } end |
#find_or_create_by(phone:) ⇒ Object
26 27 28 29 |
# File 'lib/jbr/client.rb', line 26 def find_or_create_by(phone:) find_by_phone(phone) || create self end |