Module: SfCli::Console::Commands

Defined in:
lib/sf_cli/console/commands.rb

Overview

Developer Console commands

Instance Method Summary collapse

Instance Method Details

#apex(apex_code = nil) ⇒ Object



16
17
18
19
20
# File 'lib/sf_cli/console/commands.rb', line 16

def apex(apex_code = nil)
  return sf.apex.run target_org: target_org if apex_code.nil?

  sf.apex.run target_org: target_org, file: StringIO.new(apex_code)
end

#orgsObject



29
30
31
32
33
# File 'lib/sf_cli/console/commands.rb', line 29

def orgs
  conf.inspect_mode = false
  system 'sf org list'
  conf.inspect_mode = true
end

#query(_soql) ⇒ Object



22
23
24
25
26
27
# File 'lib/sf_cli/console/commands.rb', line 22

def query(_soql)
  soql = _soql.is_a?(SfCli::Sf::Model::QueryMethods::QueryCondition) ? _soql.to_soql : _soql
  conf.inspect_mode = false
  puts sf.data.query(soql, format: :human, target_org: target_org)
  conf.inspect_mode = true
end

#target_orgObject



12
13
14
# File 'lib/sf_cli/console/commands.rb', line 12

def target_org
  @target_org
end