Module: SfCli::Sf::Lightning::Generate
- Included in:
- Core
- Defined in:
- lib/sf_cli/sf/lightning/generate.rb
Instance Method Summary collapse
-
#generate_component(name, type: nil, output_dir: nil, template: nil, api_version: nil, raw_output: false) ⇒ Array
Generate an Apex class.
Instance Method Details
#generate_component(name, type: nil, output_dir: nil, template: nil, api_version: nil, raw_output: false) ⇒ Array
Generate an Apex class
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/sf_cli/sf/lightning/generate.rb', line 15 def generate_component(name, type: nil, output_dir: nil, template: nil, api_version: nil, raw_output: false) flags = { :"name" => name, :"output-dir" => output_dir, :"type" => type, :"template" => template, :"api-version" => api_version, } switches = { } command_output_format = raw_output ? :human : :json redirect_type = raw_output ? nil : :null_stderr action = __method__.to_s.tr('_', ' ') output = exec(action, flags: flags, switches: switches, redirection: redirect_type, raw_output: raw_output, format: command_output_format) return output if raw_output output['result']['created'] end |