Module: SObjectModel

Defined in:
lib/sobject_model.rb,
lib/sobject_model/schema.rb,
lib/sobject_model/generator.rb,
lib/sobject_model/rest/http.rb,
lib/sobject_model/adapter/sf.rb,
lib/sobject_model/dml_methods.rb,
lib/sobject_model/rest/client.rb,
lib/sobject_model/rest/errors.rb,
lib/sobject_model/adapter/base.rb,
lib/sobject_model/adapter/rest.rb,
lib/sobject_model/base_methods.rb,
lib/sobject_model/query_methods.rb,
lib/sobject_model/query_condition.rb,
lib/sobject_model/class_definition.rb,
lib/sobject_model/rest/query_result.rb

Defined Under Namespace

Modules: Adapter, BaseMethods, DmlMethods, QueryMethods, Rest Classes: ClassDefinition, Generator, Schema

Class Method Summary collapse

Class Method Details

.connect(api_type, options = {}) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/sobject_model.rb', line 7

def self.connect(api_type, options = {})
  @connection = case api_type.to_s.upcase
                when 'REST'
                  client = Rest::Client.new(**options)
                  Adapter::Rest.new(client)
                when 'CLI/SF'
                  Adapter::Sf.new(sf, **options)
                end
end

.connectionObject



17
18
19
# File 'lib/sobject_model.rb', line 17

def self.connection
  @connection
end

.connection=(connector) ⇒ Object



25
26
27
# File 'lib/sobject_model.rb', line 25

def self.connection=(connector)
  @connection = connector
end

.generate(*sobject_types) ⇒ Object



29
30
31
32
# File 'lib/sobject_model.rb', line 29

def self.generate(*sobject_types)
  generator = Generator.new(connection)
  generator.generate(*sobject_types)
end

.generated_classesObject



21
22
23
# File 'lib/sobject_model.rb', line 21

def self.generated_classes
  @generated_classes ||= []
end