Class: ShopifyCLI::Commands::Populate::Customer

Inherits:
AdminAPI::PopulateResourceCommand show all
Defined in:
lib/shopify_cli/commands/populate/customer.rb

Constant Summary

Constants inherited from AdminAPI::PopulateResourceCommand

AdminAPI::PopulateResourceCommand::DEFAULT_COUNT

Instance Attribute Summary

Attributes inherited from AdminAPI::PopulateResourceCommand

#input

Attributes inherited from ShopifyCLI::Command

#ctx, #options

Instance Method Summary collapse

Methods inherited from AdminAPI::PopulateResourceCommand

#admin_url, #call, call, #completion_message, #display_parent_extended_help, #display_parent_help, help, #input_options, #populate, #price, #resource_options, #run_mutation, #schema

Methods inherited from ShopifyCLI::Command::SubCommand

call

Methods inherited from ShopifyCLI::Command

call, call_help, check_node_version, check_ruby_version, check_version, #initialize, options, prerequisite_task, recommend_default_node_range, recommend_default_ruby_range, recommend_node, recommend_ruby, run_prerequisites, subcommand, subcommand_registry

Methods included from Feature::Set

#hidden?, #hidden_feature

Constructor Details

This class inherits a constructor from ShopifyCLI::Command

Instance Method Details

#defaultsObject



9
10
11
12
13
14
15
# File 'lib/shopify_cli/commands/populate/customer.rb', line 9

def defaults
  first_name, last_name = ShopifyCLI::Helpers::Haikunator.name
  {
    firstName: first_name,
    lastName: last_name,
  }
end

#message(data) ⇒ Object



17
18
19
20
21
# File 'lib/shopify_cli/commands/populate/customer.rb', line 17

def message(data)
  ret = data["customerCreate"]["customer"]
  id = ShopifyCLI::API.gid_to_id(ret["id"])
  @ctx.message("core.populate.customer.added", ret["displayName"], @shop, admin_url, id)
end