Class: SfCli::Sf::Model::SfCommandConnection
- Inherits:
-
Object
- Object
- SfCli::Sf::Model::SfCommandConnection
- Defined in:
- lib/sf_cli/sf/model/sf_command_connection.rb
Overview
Connection object to access Salesforce based on Sf command
Instance Attribute Summary collapse
-
#instance_url ⇒ Object
readonly
Returns the value of attribute instance_url.
-
#target_org ⇒ Object
readonly
Returns the value of attribute target_org.
Instance Method Summary collapse
-
#exec_query(soql, format: nil, bulk: false, wait: nil, model_class: nil) ⇒ Object
Sf command style query interface for Model module.
-
#initialize(target_org: nil, instance_url: nil) ⇒ SfCommandConnection
constructor
A new instance of SfCommandConnection.
- #open ⇒ Object
Constructor Details
#initialize(target_org: nil, instance_url: nil) ⇒ SfCommandConnection
Returns a new instance of SfCommandConnection.
20 21 22 23 24 25 26 |
# File 'lib/sf_cli/sf/model/sf_command_connection.rb', line 20 def initialize(target_org: nil, instance_url: nil) @sf_org = ::SfCli::Sf::Org::Core.new @sf_data = ::SfCli::Sf::Data::Core.new @sf_sobject = ::SfCli::Sf::Sobject::Core.new @target_org = target_org @instance_url = instance_url end |
Instance Attribute Details
#instance_url ⇒ Object (readonly)
Returns the value of attribute instance_url.
12 13 14 |
# File 'lib/sf_cli/sf/model/sf_command_connection.rb', line 12 def instance_url @instance_url end |
#target_org ⇒ Object (readonly)
Returns the value of attribute target_org.
12 13 14 |
# File 'lib/sf_cli/sf/model/sf_command_connection.rb', line 12 def target_org @target_org end |
Instance Method Details
#exec_query(soql, format: nil, bulk: false, wait: nil, model_class: nil) ⇒ Object
Sf command style query interface for Model module
For query details, see sf data query
40 41 42 |
# File 'lib/sf_cli/sf/model/sf_command_connection.rb', line 40 def exec_query(soql, format: nil, bulk: false, wait: nil, model_class: nil) sf_data.query(soql, target_org: target_org, format: format, bulk: bulk, wait: wait, model_class: model_class) end |
#open ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/sf_cli/sf/model/sf_command_connection.rb', line 28 def open if ENV['SF_ACCESS_TOKEN'] sf_org.login_access_token target_org: target_org, instance_url: instance_url else sf_org.login_web target_org: target_org, instance_url: instance_url end end |