SFDO-API 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/SFDO-API.gemspec +1 -0
- data/lib/SFDO/API.rb +42 -0
- data/lib/SFDO/API/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c5ac4fce7bcb1811b8411e06b3c4093cd3c1e30
|
4
|
+
data.tar.gz: ae55da93d0e74c8e93b1485da7f71c7b3350c69f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: beaa7d440863531e632663e60ae8d874fed6eb99f859dc85866d1509dce58efeebbf11385c3569ade3eaf8d28790a95aa2b1beada840611c86cfe1c0d805f5bd
|
7
|
+
data.tar.gz: feb8a9545e9a9ad8f47de19e949e5ec2f96135dafce7c38388556b948bb91878c6c9e1ff32f052c5f4fde748d90aebcd9053d431fcd599268c679c54afb2fd2f
|
data/SFDO-API.gemspec
CHANGED
data/lib/SFDO/API.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'SFDO/API/version'
|
2
|
+
require 'pry'
|
2
3
|
|
3
4
|
module SfdoAPI
|
4
5
|
|
@@ -35,6 +36,13 @@ module SfdoAPI
|
|
35
36
|
valid
|
36
37
|
end
|
37
38
|
|
39
|
+
def get_org_objects()
|
40
|
+
#binding.pry
|
41
|
+
@org_objects ||= api_client do
|
42
|
+
@api_client.describe
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
38
46
|
def get_object_describe(object_name)
|
39
47
|
api_client do
|
40
48
|
@description = @api_client.get("/services/data/v35.0/sobjects/#{object_name}/describe")
|
@@ -50,6 +58,40 @@ module SfdoAPI
|
|
50
58
|
required.select(&:required)
|
51
59
|
end
|
52
60
|
end
|
61
|
+
|
62
|
+
def delete(type, obj_id)
|
63
|
+
api_client do
|
64
|
+
@api_client.destroy(type, obj_id)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def delete_all(obj_type, id)
|
69
|
+
api_client do
|
70
|
+
#p "id is " + id.inspect
|
71
|
+
#@api_client.destroy(obj_type, id)
|
72
|
+
id.each(&:destroy)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
# Given that the developer calls 'delete_contact(id)'
|
77
|
+
# When 'contact' is a valid object
|
78
|
+
# Then this method_missing method, will translate 'delete_contact' into "generic_delete('contact', id)"
|
79
|
+
|
80
|
+
def method_missing(method_called, *args, &block)
|
81
|
+
breakdown = method_called.to_s.split('_')
|
82
|
+
obj_type = breakdown.last.capitalize
|
83
|
+
case method_called.to_s
|
84
|
+
when /^delete_all_/
|
85
|
+
delete_all obj_type, *args
|
86
|
+
when /^delete_one/
|
87
|
+
delete obj_type, *args
|
88
|
+
when /^create_/
|
89
|
+
#TODO
|
90
|
+
else
|
91
|
+
super.method_missing
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
53
95
|
end
|
54
96
|
# INCLUDE HERE RATHER THAN IN THE PRODUCT-SPECIFIC CODE USING THIS GEM
|
55
97
|
include SfdoAPI
|
data/lib/SFDO/API/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: SFDO-API
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris McMahon
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-06-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -39,6 +39,20 @@ dependencies:
|
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '10.0'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: pry
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
type: :runtime
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
42
56
|
- !ruby/object:Gem::Dependency
|
43
57
|
name: restforce
|
44
58
|
requirement: !ruby/object:Gem::Requirement
|