Class: SalesforceBulk2::BatchResult
- Inherits:
-
Hash
- Object
- Hash
- SalesforceBulk2::BatchResult
show all
- Defined in:
- lib/salesforce_bulk2/batch_result.rb
Instance Method Summary
collapse
Constructor Details
#initialize(id, success, created, error) ⇒ BatchResult
Returns a new instance of BatchResult.
3
4
5
6
7
8
|
# File 'lib/salesforce_bulk2/batch_result.rb', line 3
def initialize(id, success, created, error)
self['id'] = id
self['success'] = success
self['created'] = created
self['error'] = error
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
26
27
28
29
30
31
32
|
# File 'lib/salesforce_bulk2/batch_result.rb', line 26
def method_missing method, *args, &block
if has_key? method.to_s
self[method.to_s]
else
super method, *args, &block
end
end
|
Instance Method Details
#created? ⇒ Boolean
14
15
16
|
# File 'lib/salesforce_bulk2/batch_result.rb', line 14
def created?
created
end
|
#error? ⇒ Boolean
10
11
12
|
# File 'lib/salesforce_bulk2/batch_result.rb', line 10
def error?
error.present?
end
|
#respond_to?(method) ⇒ Boolean
34
35
36
37
38
39
40
|
# File 'lib/salesforce_bulk2/batch_result.rb', line 34
def respond_to? method
if has_key? method.to_sym
return true
else
super
end
end
|
#successful? ⇒ Boolean
18
19
20
|
# File 'lib/salesforce_bulk2/batch_result.rb', line 18
def successful?
success
end
|
#updated? ⇒ Boolean
22
23
24
|
# File 'lib/salesforce_bulk2/batch_result.rb', line 22
def updated?
!created && success
end
|