Class: ContextIO::Source
Instance Attribute Summary collapse
#api_attributes, #primary_key, #resource_url
Instance Method Summary
collapse
Instance Attribute Details
#use_ssl? ⇒ Boolean
19
20
21
|
# File 'lib/contextio/source.rb', line 19
def use_ssl?
use_ssl
end
|
Instance Method Details
#delete ⇒ Object
43
44
45
|
# File 'lib/contextio/source.rb', line 43
def delete
api.request(:delete, resource_url)['success']
end
|
#sync!(options = {}) ⇒ Object
57
58
59
|
# File 'lib/contextio/source.rb', line 57
def sync!(options={})
api.request(:post, "#{resource_url}/sync", options)['success']
end
|
#sync_data ⇒ Object
47
48
49
50
51
52
53
54
55
|
# File 'lib/contextio/source.rb', line 47
def sync_data
return @sync_data if @sync_data
sync_hashes = api.request(:get, "#{resource_url}/sync")
@sync_data = ContextIO::SourceSyncData.new(label, sync_hashes)
return @sync_data
end
|
#update(options = {}) ⇒ Object
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/contextio/source.rb', line 29
def update(options={})
it_worked = api.request(:post, resource_url, options)['success']
if it_worked
options.each do |key, value|
key = key.to_s.gsub('-', '_')
instance_variable_set("@#{key}", value)
end
end
it_worked
end
|