Module: Yamori

Defined in:
lib/yamori.rb,
lib/yamori/schema.rb,
lib/yamori/generator.rb,
lib/yamori/rest/http.rb,
lib/yamori/dml_methods.rb,
lib/yamori/rest/client.rb,
lib/yamori/rest/errors.rb,
lib/yamori/adapter/base.rb,
lib/yamori/adapter/rest.rb,
lib/yamori/base_methods.rb,
lib/yamori/query_methods.rb,
lib/yamori/query_condition.rb,
lib/yamori/class_definition.rb,
lib/yamori/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



6
7
8
9
10
11
12
# File 'lib/yamori.rb', line 6

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

.connectionObject



14
15
16
# File 'lib/yamori.rb', line 14

def self.connection
  @connection
end

.connection=(connector) ⇒ Object



18
19
20
# File 'lib/yamori.rb', line 18

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

.generate(*sobject_types) ⇒ Object



22
23
24
25
# File 'lib/yamori.rb', line 22

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