Class: SfCli::Sf::Sobject::Core

Inherits:
Object
  • Object
show all
Includes:
Core::Base
Defined in:
lib/sf_cli/sf/sobject/core.rb

Overview

Instance Attribute Summary

Attributes included from Core::Base

#varbose

Instance Method Summary collapse

Instance Method Details

#describe(object_type, target_org: nil) ⇒ Object

returns a hash object containing the Salesforce object schema. (equivalent to sf sobject describe)

objectType — object type (ex: Account)
target_org — an alias of paticular org, not default one

For more command details, see the command reference



21
22
23
24
25
26
27
28
# File 'lib/sf_cli/sf/sobject/core.rb', line 21

def describe(object_type, target_org: nil)
  flags    = {
    :"sobject"    => object_type,
    :"target-org" => target_org,
  }
  json = exec(__method__, flags: flags, redirection: :null_stderr)
  json['result']
end

#list(object_type, target_org: nil) ⇒ Object

returns a list of Salesforce object API name. (equivalent to sf sobject list)

object_type — all or custom
target_org — an alias of paticular org, not default one

For more command details, see the command reference



37
38
39
40
41
42
43
44
# File 'lib/sf_cli/sf/sobject/core.rb', line 37

def list(object_type, target_org: nil)
  flags    = {
    :"sobject"    => (object_type.to_sym == :custom ? :custom : :all),
    :"target-org" => target_org,
  }
  json = exec(__method__, flags: flags, redirection: :null_stderr)
  json['result']
end