gaah 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gaah/calendar/event.rb +4 -0
- data/lib/gaah/calendar/who.rb +18 -1
- data/lib/gaah/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ea5814be5a5b1a53d0060fed0d51b38a02f0267
|
4
|
+
data.tar.gz: 076f1a0247b8a0397f405463301cfd2091e7aaf2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2d596826b4412c222db73ee23a8b2c5d90be60096fed38a6e7c2f46b926797e68c82fcb6ccbde72b54564d6f5d31ae53dc5ede996b7984a5f1262de58978014
|
7
|
+
data.tar.gz: d2733ae22804d8858821ec912beb26cbac7920f2839616625b2cebc8484123895e1935a7f8204ea22d72d22ad62cf85fc0ca57bcd7bcf702a183cdd762dd6a52
|
data/lib/gaah/calendar/event.rb
CHANGED
data/lib/gaah/calendar/who.rb
CHANGED
@@ -1,10 +1,27 @@
|
|
1
1
|
module Gaah
|
2
2
|
module Calendar
|
3
3
|
class Who
|
4
|
-
attr_reader :name, :email
|
4
|
+
attr_reader :name, :email, :resource
|
5
5
|
def initialize(json)
|
6
6
|
@name = json['displayName'].to_s
|
7
7
|
@email = json['email'].to_s
|
8
|
+
@resource = !!json['resource']
|
9
|
+
end
|
10
|
+
|
11
|
+
def type
|
12
|
+
case
|
13
|
+
when is_resource? then "resource"
|
14
|
+
when is_calendar? then "calendar"
|
15
|
+
else "user"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def is_resource?
|
20
|
+
resource || email.end_with?('@resource.calendar.google.com')
|
21
|
+
end
|
22
|
+
|
23
|
+
def is_calendar?
|
24
|
+
email.end_with?('@group.calendar.google.com')
|
8
25
|
end
|
9
26
|
|
10
27
|
def catch_all_user?
|
data/lib/gaah/version.rb
CHANGED