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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 287f7c3f2ca94996a1b786c6f788501a62748855
4
- data.tar.gz: af476cf2943ef05c0ffb67557a5d89b587dc2448
3
+ metadata.gz: 7ea5814be5a5b1a53d0060fed0d51b38a02f0267
4
+ data.tar.gz: 076f1a0247b8a0397f405463301cfd2091e7aaf2
5
5
  SHA512:
6
- metadata.gz: e7b2c3134ce2238b372e867746789c528fadb6e3ef56daa5a13502ec46762d94e0570f7f69384bb67f688b383821c5c6eca69e642bb0ac4fb0697d37f8680ac0
7
- data.tar.gz: 8a83de8aa155bdcc60d0bef93cbf65674feabe262c0b85493d71a17f76e33643180a2287054c9dcf35cc568dcd4933ee50349b87dc0ddcc7827d144886c63997
6
+ metadata.gz: b2d596826b4412c222db73ee23a8b2c5d90be60096fed38a6e7c2f46b926797e68c82fcb6ccbde72b54564d6f5d31ae53dc5ede996b7984a5f1262de58978014
7
+ data.tar.gz: d2733ae22804d8858821ec912beb26cbac7920f2839616625b2cebc8484123895e1935a7f8204ea22d72d22ad62cf85fc0ca57bcd7bcf702a183cdd762dd6a52
@@ -38,6 +38,10 @@ module Gaah
38
38
  }.to_json
39
39
  end
40
40
 
41
+ def resources
42
+ who.select(&:is_resource?)
43
+ end
44
+
41
45
  # V2 -> V3
42
46
  def author; creator; end
43
47
  def content; description; end
@@ -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?
@@ -1,3 +1,3 @@
1
1
  module Gaah
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gaah
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hwan-Joon Choi