fomo 0.0.5 → 0.0.6
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
- data/lib/fomo.rb +9 -9
- data/lib/fomo_event.rb +9 -1
- data/lib/fomo_event_basic.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5469081a3a5bd1932369a06f51844f034b69fa8
|
4
|
+
data.tar.gz: d4c698caec7774fed4f5e3e5d4372f55b99e9d75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cebb16e6fd0cb1de367a8cdcaeaff6b3a9c2715190b90c530651ea7eaa63c42f773c7ca7b88b54fb20ac84b132fb58460baa2ec90b9a87cf2c0f7779cc8e8f32
|
7
|
+
data.tar.gz: 8b0dfce03ce21ac3527ec59929d65539a0615eef6d2bcbc8c621560bc8e1e15f136b81c504c901ca869c0b9ba87140c47f35a117832524ddd9c4b7f4523badae
|
data/lib/fomo.rb
CHANGED
@@ -28,7 +28,7 @@ class Fomo
|
|
28
28
|
#
|
29
29
|
def initialize (auth_token)
|
30
30
|
@auth_token = auth_token
|
31
|
-
@version = '0.0.
|
31
|
+
@version = '0.0.6'
|
32
32
|
@endpoint = 'https://www.usefomo.com'
|
33
33
|
end
|
34
34
|
|
@@ -43,7 +43,7 @@ class Fomo
|
|
43
43
|
response = make_request('/api/v1/applications/me/events/' + id.to_s, 'GET')
|
44
44
|
begin
|
45
45
|
j = JSON.parse(response)
|
46
|
-
FomoEvent.new(j['id'], j['created_at'], j['updated_at'], j['message'], j['link'], j['event_type_id'], j['event_type_tag'], j['url'], j['first_name'], j['city'], j['province'], j['country'], j['title'], j['image_url'], j['custom_event_fields_attributes'])
|
46
|
+
FomoEvent.new(j['id'], j['created_at'], j['updated_at'], j['message'], j['link'], j['event_type_id'], j['event_type_tag'], j['url'], j['first_name'], j['email_address'], j['ip_address'], j['city'], j['province'], j['country'], j['title'], j['image_url'], j['custom_event_fields_attributes'])
|
47
47
|
rescue JSON::ParserError => _
|
48
48
|
# String was not valid
|
49
49
|
end
|
@@ -63,7 +63,7 @@ class Fomo
|
|
63
63
|
data = JSON.parse(response)
|
64
64
|
list = []
|
65
65
|
data.each do |j|
|
66
|
-
list.push(FomoEvent.new(j['id'], j['created_at'], j['updated_at'], j['message'], j['link'], j['event_type_id'], j['event_type_tag'], j['url'], j['first_name'], j['city'], j['province'], j['country'], j['title'], j['image_url'], j['custom_event_fields_attributes']))
|
66
|
+
list.push(FomoEvent.new(j['id'], j['created_at'], j['updated_at'], j['message'], j['link'], j['event_type_id'], j['event_type_tag'], j['url'], j['first_name'], j['email_address'], j['ip_address'], j['city'], j['province'], j['country'], j['title'], j['image_url'], j['custom_event_fields_attributes']))
|
67
67
|
end
|
68
68
|
list
|
69
69
|
rescue JSON::ParserError => _
|
@@ -86,7 +86,7 @@ class Fomo
|
|
86
86
|
|
87
87
|
list = []
|
88
88
|
data['events'].each do |j|
|
89
|
-
list.push(FomoEvent.new(j['id'], j['created_at'], j['updated_at'], j['message'], j['link'], j['event_type_id'], j['event_type_tag'], j['url'], j['first_name'], j['city'], j['province'], j['country'], j['title'], j['image_url'], j['custom_event_fields_attributes']))
|
89
|
+
list.push(FomoEvent.new(j['id'], j['created_at'], j['updated_at'], j['message'], j['link'], j['event_type_id'], j['event_type_tag'], j['url'], j['first_name'], j['email_address'], j['ip_address'], j['city'], j['province'], j['country'], j['title'], j['image_url'], j['custom_event_fields_attributes']))
|
90
90
|
end
|
91
91
|
meta = FomoMetaData.new(data['meta']['per_page'].to_i, data['meta']['page'].to_i, data['meta']['total_count'].to_i, data['meta']['total_pages'].to_i)
|
92
92
|
FomoEventsWithMeta.new(list, meta)
|
@@ -112,15 +112,15 @@ class Fomo
|
|
112
112
|
#
|
113
113
|
# Returns an FomoEvent object.
|
114
114
|
#
|
115
|
-
def create_event(event=nil, event_type_id='', event_type_tag='', url='', first_name='', city='', province='', country='', title='', image_url='', custom_event_fields_attributes=[])
|
115
|
+
def create_event(event=nil, event_type_id='', event_type_tag='', url='', first_name='', email_address='', ip_address='', city='', province='', country='', title='', image_url='', custom_event_fields_attributes=[])
|
116
116
|
if event == nil
|
117
|
-
event = FomoEventBasic.new(event_type_id, event_type_tag, url, first_name, city, province, country, title, image_url, custom_event_fields_attributes)
|
117
|
+
event = FomoEventBasic.new(event_type_id, event_type_tag, url, first_name, email_address, ip_address, city, province, country, title, image_url, custom_event_fields_attributes)
|
118
118
|
end
|
119
119
|
|
120
120
|
response = make_request('/api/v1/applications/me/events', 'POST', event)
|
121
121
|
begin
|
122
122
|
j = JSON.parse(response)
|
123
|
-
FomoEvent.new(j['id'], j['created_at'], j['updated_at'], j['message'], j['link'], j['event_type_id'], j['event_type_tag'], j['url'], j['first_name'], j['city'], j['province'], j['country'], j['title'], j['image_url'], j['custom_event_fields_attributes'])
|
123
|
+
FomoEvent.new(j['id'], j['created_at'], j['updated_at'], j['message'], j['link'], j['event_type_id'], j['event_type_tag'], j['url'], j['first_name'], j['email_address'], j['ip_address'], j['city'], j['province'], j['country'], j['title'], j['image_url'], j['custom_event_fields_attributes'])
|
124
124
|
rescue JSON::ParserError => _
|
125
125
|
# String was not valid
|
126
126
|
end
|
@@ -154,7 +154,7 @@ class Fomo
|
|
154
154
|
response = make_request('/api/v1/applications/me/events/' + event.id.to_s, 'PATCH', event)
|
155
155
|
begin
|
156
156
|
j = JSON.parse(response)
|
157
|
-
FomoEvent.new(j['id'], j['created_at'], j['updated_at'], j['message'], j['link'], j['event_type_id'], j['event_type_tag'], j['url'], j['first_name'], j['city'], j['province'], j['country'], j['title'], j['image_url'], j['custom_event_fields_attributes'])
|
157
|
+
FomoEvent.new(j['id'], j['created_at'], j['updated_at'], j['message'], j['link'], j['event_type_id'], j['event_type_tag'], j['url'], j['first_name'], j['email_address'], j['ip_address'], j['city'], j['province'], j['country'], j['title'], j['image_url'], j['custom_event_fields_attributes'])
|
158
158
|
rescue JSON::ParserError => _
|
159
159
|
# String was not valid
|
160
160
|
end
|
@@ -202,4 +202,4 @@ class Fomo
|
|
202
202
|
puts('Unknown method')
|
203
203
|
end
|
204
204
|
end
|
205
|
-
end
|
205
|
+
end
|
data/lib/fomo_event.rb
CHANGED
@@ -35,6 +35,12 @@ class FomoEvent
|
|
35
35
|
# First name of the person on the event. Size range: 0..255
|
36
36
|
attr_accessor :first_name
|
37
37
|
|
38
|
+
# Email address of the person on the event. Size range: 0..255
|
39
|
+
attr_accessor :email_address
|
40
|
+
|
41
|
+
# IP address of the person on the event. Size range: 0..255
|
42
|
+
attr_accessor :ip_address
|
43
|
+
|
38
44
|
# City where the event happened. Size range: 0..255
|
39
45
|
attr_accessor :city
|
40
46
|
|
@@ -54,7 +60,7 @@ class FomoEvent
|
|
54
60
|
attr_accessor :custom_event_fields_attributes
|
55
61
|
|
56
62
|
# Initializes FomoEvent object
|
57
|
-
def initialize(id='', created_at='', updated_at='', message='', link='', event_type_id='', event_type_tag='', url='', first_name='', city='', province='', country='', title='', image_url='', custom_event_fields_attributes = [])
|
63
|
+
def initialize(id='', created_at='', updated_at='', message='', link='', event_type_id='', event_type_tag='', url='', first_name='', email_address='', ip_address='', city='', province='', country='', title='', image_url='', custom_event_fields_attributes = [])
|
58
64
|
@id = id
|
59
65
|
@created_at = created_at
|
60
66
|
@updated_at = updated_at
|
@@ -64,6 +70,8 @@ class FomoEvent
|
|
64
70
|
@event_type_tag = event_type_tag
|
65
71
|
@url = url
|
66
72
|
@first_name = first_name
|
73
|
+
@email_address = email_address
|
74
|
+
@ip_address = ip_address
|
67
75
|
@city = city
|
68
76
|
@province = province
|
69
77
|
@country = country
|
data/lib/fomo_event_basic.rb
CHANGED
@@ -24,6 +24,9 @@ class FomoEventBasic
|
|
24
24
|
# Email address of the person on the event. Size range: 0..255
|
25
25
|
attr_accessor :email_address
|
26
26
|
|
27
|
+
# IP address of the person on the event. Size range: 0..255
|
28
|
+
attr_accessor :ip_address
|
29
|
+
|
27
30
|
# City where the event happened. Size range: 0..255
|
28
31
|
attr_accessor :city
|
29
32
|
|
@@ -43,12 +46,13 @@ class FomoEventBasic
|
|
43
46
|
attr_accessor :custom_event_fields_attributes
|
44
47
|
|
45
48
|
# Initializes FomoEventBasic object
|
46
|
-
def initialize(event_type_id='', event_type_tag='', url='', first_name='', email_address='', city='', province='', country='', title='', image_url='', custom_event_fields_attributes = [])
|
49
|
+
def initialize(event_type_id='', event_type_tag='', url='', first_name='', email_address='', ip_address='', city='', province='', country='', title='', image_url='', custom_event_fields_attributes = [])
|
47
50
|
@event_type_id = event_type_id
|
48
51
|
@event_type_tag = event_type_tag
|
49
52
|
@url = url
|
50
53
|
@first_name = first_name
|
51
54
|
@email_address = email_address
|
55
|
+
@ip_address = ip_address
|
52
56
|
@city = city
|
53
57
|
@province = province
|
54
58
|
@country = country
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fomo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fomo
|
@@ -44,7 +44,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
44
44
|
version: '0'
|
45
45
|
requirements: []
|
46
46
|
rubyforge_project:
|
47
|
-
rubygems_version: 2.
|
47
|
+
rubygems_version: 2.2.2
|
48
48
|
signing_key:
|
49
49
|
specification_version: 4
|
50
50
|
summary: Fomo
|