Class: Node::Commands::Populate::Product
- Inherits:
-
ShopifyCli::AdminAPI::PopulateResourceCommand
- Object
- CLI::Kit::BaseCommand
- ShopifyCli::Command
- ShopifyCli::SubCommand
- ShopifyCli::AdminAPI::PopulateResourceCommand
- Node::Commands::Populate::Product
- Defined in:
- lib/project_types/node/commands/populate/product.rb
Constant Summary
Constants inherited from ShopifyCli::AdminAPI::PopulateResourceCommand
ShopifyCli::AdminAPI::PopulateResourceCommand::DEFAULT_COUNT
Instance Attribute Summary
Attributes inherited from ShopifyCli::AdminAPI::PopulateResourceCommand
Attributes inherited from ShopifyCli::Command
Instance Method Summary collapse
Methods inherited from ShopifyCli::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::SubCommand
Methods inherited from ShopifyCli::Command
call, call_help, #initialize, options, prerequisite_task, run_prerequisites, subcommand, subcommand_registry
Methods included from ShopifyCli::Feature::Set
Constructor Details
This class inherits a constructor from ShopifyCli::Command
Instance Method Details
#defaults ⇒ Object
9 10 11 12 13 14 |
# File 'lib/project_types/node/commands/populate/product.rb', line 9 def defaults { title: ShopifyCli::Helpers::Haikunator.title, variants: [{ price: price }], } end |
#message(data) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/project_types/node/commands/populate/product.rb', line 16 def (data) ret = data['productCreate']['product'] id = ShopifyCli::API.gid_to_id(ret['id']) @ctx.( 'node.populate.product.added', ret['title'], ShopifyCli::Project.current.env.shop, admin_url, id ) end |