call_action 1.3.1 → 2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- metadata +3 -40
- data/.gitignore +0 -18
- data/README.md +0 -1
- data/call_action-1.2.0.gem +0 -0
- data/call_action-1.2.1.gem +0 -0
- data/call_action-1.2.2.gem +0 -0
- data/call_action-1.2.3.gem +0 -0
- data/call_action-1.2.4.gem +0 -0
- data/call_action-1.2.5.gem +0 -0
- data/call_action-1.2.6.gem +0 -0
- data/call_action-1.2.7.gem +0 -0
- data/call_action-1.2.8.gem +0 -0
- data/lib/call_action.rb +0 -90
- data/lib/configuration.rb +0 -8
- data/lib/contact.rb +0 -17
- data/lib/generators/install_generator.rb +0 -11
- data/lib/generators/templates/initializer.rb +0 -4
- data/lib/install_generator.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a21dfd35b73997aba19b12aa9c19f5ac1a8a5ca
|
4
|
+
data.tar.gz: 8dc7b86e224b521fe99aabd1d0c3fa434fe5e837
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 528e9da23d40df5c3d6708432f496bac930b39079d69733f296cecf9e3bcf5163d9e63ca34a1d35fbbd84d6b8d65fc51369d7a77f24b0a9283025581a2638d43
|
7
|
+
data.tar.gz: db9686e8f658c75f540c4d3e5dfa4dd59c1bc1a82005a5ae4ec12f8fe4167ea299b4ad7d9b24ac90f912ef109ea8da583218bab87804ff5ef9df646f12583499
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: call_action
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: '2.0'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shahzad Tariq
|
@@ -9,51 +9,14 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2017-05-03 00:00:00.000000000 Z
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: railties
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - '>='
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '3.2'
|
20
|
-
- - <
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '5'
|
23
|
-
type: :runtime
|
24
|
-
prerelease: false
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
requirements:
|
27
|
-
- - '>='
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '3.2'
|
30
|
-
- - <
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '5'
|
12
|
+
dependencies: []
|
33
13
|
description: Ruby wrapper for CallAction API to be used within Ruby On Rails (RoR)
|
34
14
|
and other Ruby based frameworks
|
35
15
|
email: m.shahzad.tariq@hotmaul.com
|
36
16
|
executables: []
|
37
17
|
extensions: []
|
38
18
|
extra_rdoc_files: []
|
39
|
-
files:
|
40
|
-
- .gitignore
|
41
|
-
- README.md
|
42
|
-
- call_action-1.2.0.gem
|
43
|
-
- call_action-1.2.1.gem
|
44
|
-
- call_action-1.2.2.gem
|
45
|
-
- call_action-1.2.3.gem
|
46
|
-
- call_action-1.2.4.gem
|
47
|
-
- call_action-1.2.5.gem
|
48
|
-
- call_action-1.2.6.gem
|
49
|
-
- call_action-1.2.7.gem
|
50
|
-
- call_action-1.2.8.gem
|
51
|
-
- lib/call_action.rb
|
52
|
-
- lib/configuration.rb
|
53
|
-
- lib/contact.rb
|
54
|
-
- lib/generators/install_generator.rb
|
55
|
-
- lib/generators/templates/initializer.rb
|
56
|
-
- lib/install_generator.rb
|
19
|
+
files: []
|
57
20
|
homepage: https://callaction.co/documentation/developers/api/v1/index.html
|
58
21
|
licenses:
|
59
22
|
- MIT
|
data/.gitignore
DELETED
data/README.md
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
CallAction
|
data/call_action-1.2.0.gem
DELETED
Binary file
|
data/call_action-1.2.1.gem
DELETED
Binary file
|
data/call_action-1.2.2.gem
DELETED
Binary file
|
data/call_action-1.2.3.gem
DELETED
Binary file
|
data/call_action-1.2.4.gem
DELETED
Binary file
|
data/call_action-1.2.5.gem
DELETED
Binary file
|
data/call_action-1.2.6.gem
DELETED
Binary file
|
data/call_action-1.2.7.gem
DELETED
Binary file
|
data/call_action-1.2.8.gem
DELETED
Binary file
|
data/lib/call_action.rb
DELETED
@@ -1,90 +0,0 @@
|
|
1
|
-
require "net/http"
|
2
|
-
require 'contact'
|
3
|
-
require "json"
|
4
|
-
require "uri"
|
5
|
-
|
6
|
-
class CallAction
|
7
|
-
|
8
|
-
attr_accessor :token, :base_url, :api_version, :headers
|
9
|
-
attr_writer :configuration
|
10
|
-
|
11
|
-
def self.configuration
|
12
|
-
@configuration ||= Configuration.new
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.reset
|
16
|
-
@configuration = Configuration.new
|
17
|
-
end
|
18
|
-
|
19
|
-
def self.configure
|
20
|
-
yield(configuration)
|
21
|
-
end
|
22
|
-
|
23
|
-
# Initializer
|
24
|
-
def initialize headers = {}
|
25
|
-
@token = CallAction.configuration.auth_token
|
26
|
-
@api_version = CallAction.configuration.api_version
|
27
|
-
@base_url = "https://callaction.co/api/"
|
28
|
-
@headers = {"Accept" => "application/json", "Content-Type" => "application/json", "X-AUTH-TOKEN" => @token}.merge(headers)
|
29
|
-
end
|
30
|
-
|
31
|
-
# To test installation
|
32
|
-
def self.hi
|
33
|
-
puts "Hello world!"
|
34
|
-
end
|
35
|
-
|
36
|
-
# To get list of all contacts
|
37
|
-
def contacts
|
38
|
-
url = URI.parse("#{@base_url}#{@api_version}/contacts")
|
39
|
-
request = Net::HTTP::Get.new(url.request_uri)
|
40
|
-
|
41
|
-
@headers.each {|k, v| request[k] = v }
|
42
|
-
|
43
|
-
response = Net::HTTP.start(url.hostname, url.port, :use_ssl => url.scheme == 'https') do |http|
|
44
|
-
http.request(request)
|
45
|
-
end
|
46
|
-
|
47
|
-
JSON.parse(response.body)["contacts"].collect {|contact| Contact.new contact }
|
48
|
-
end
|
49
|
-
|
50
|
-
def activities contact_id
|
51
|
-
url = URI.parse("#{@base_url}#{@api_version}/contacts/#{contact_id}/activity")
|
52
|
-
request = Net::HTTP::Get.new(url.request_uri)
|
53
|
-
|
54
|
-
@headers.each {|k, v| request[k] = v }
|
55
|
-
|
56
|
-
response = Net::HTTP.start(url.hostname, url.port, :use_ssl => url.scheme == 'https') do |http|
|
57
|
-
http.request(request)
|
58
|
-
end
|
59
|
-
|
60
|
-
JSON.parse(response.body)["activities"]
|
61
|
-
end
|
62
|
-
|
63
|
-
def channels
|
64
|
-
url = URI.parse("#{@base_url}#{@api_version}/channels")
|
65
|
-
request = Net::HTTP::Get.new(url.request_uri)
|
66
|
-
|
67
|
-
@headers.each {|k, v| request[k] = v }
|
68
|
-
|
69
|
-
response = Net::HTTP.start(url.hostname, url.port, :use_ssl => url.scheme == 'https') do |http|
|
70
|
-
http.request(request)
|
71
|
-
end
|
72
|
-
|
73
|
-
JSON.parse(response.body)["channels"]
|
74
|
-
end
|
75
|
-
|
76
|
-
def sources
|
77
|
-
url = URI.parse("#{@base_url}#{@api_version}/sources")
|
78
|
-
request = Net::HTTP::Get.new(url.request_uri)
|
79
|
-
|
80
|
-
@headers.each {|k, v| request[k] = v }
|
81
|
-
|
82
|
-
response = Net::HTTP.start(url.hostname, url.port, :use_ssl => url.scheme == 'https') do |http|
|
83
|
-
http.request(request)
|
84
|
-
end
|
85
|
-
|
86
|
-
JSON.parse(response.body)["sources"]
|
87
|
-
end
|
88
|
-
|
89
|
-
|
90
|
-
end
|
data/lib/configuration.rb
DELETED
data/lib/contact.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
class Contact
|
2
|
-
|
3
|
-
def initialize(hash)
|
4
|
-
hash.each do |k,v|
|
5
|
-
self.instance_variable_set("@#{k}", v.is_a?(Hash) ? Hashit.new(v) : v)
|
6
|
-
self.class.send(:define_method, k, proc{self.instance_variable_get("@#{k}")})
|
7
|
-
self.class.send(:define_method, "#{k}=", proc{|v| self.instance_variable_set("@#{k}", v)})
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
|
12
|
-
def activities
|
13
|
-
call_action = CallAction.new
|
14
|
-
call_action.activities self.id
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
module CallAction
|
2
|
-
module Generators
|
3
|
-
class InstallGenerator < Rails::Generators::NamedBase
|
4
|
-
source_root File.expand_path("../templates", __FILE__)
|
5
|
-
|
6
|
-
def copy_initializer_file
|
7
|
-
copy_file "initializer.rb", "config/initializers/call_action.rb"
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
data/lib/install_generator.rb
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
module CallAction
|
2
|
-
module Generators
|
3
|
-
class InstallGenerator < Rails::Generators::Base
|
4
|
-
source_root File.expand_path("../templates", __FILE__)
|
5
|
-
|
6
|
-
def copy_initializer_file
|
7
|
-
copy_file "initializer.rb", "config/initializers/call_action.rb"
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|