ragoon 0.2.1 → 0.2.2
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/README.md +3 -3
- data/lib/ragoon/services/schedule.rb +21 -5
- data/lib/ragoon/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: b68e19f10c0d94b8449fc5343a2a6e494192a95c
|
4
|
+
data.tar.gz: a1a42d79bf60a34ff1092b4d12e1bd58eee7a683
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b7cfb9605a801b1444d1b4d4faadee8612ba0c4d911091b6b47833a251d5deb85cb57dca93aa9c31c5519a2e1ca143e96bdce59d5e746b200d86f21021eba29
|
7
|
+
data.tar.gz: f8afef1240b59df88a49a976eac2a57a0ce4811ce0e4c7ee32f6d07282012caa19cdfc8fcf2ba4e10a6c06385e9b7655d8a18b4fd965332bcf50951a1d207cf3
|
data/README.md
CHANGED
@@ -11,9 +11,9 @@ service = Ragoon::Services::Schedule.new
|
|
11
11
|
events = service.schedule_get_event
|
12
12
|
|
13
13
|
=> [
|
14
|
-
{:title=>"予定あり", :period=>"13:00〜14:00", :facility=>""},
|
15
|
-
{:title=>"セクションMTG", :period=>"15:00〜15:30", :facility=>["会議室"]},
|
16
|
-
{:title=>"予定あり", :period=>"終日", :facility=>""}
|
14
|
+
{:title=>"予定あり", :period=>"13:00〜14:00", :plan=>"作業", :facility=>""},
|
15
|
+
{:title=>"セクションMTG", :period=>"15:00〜15:30", :plan=>"社内MTG", :facility=>["会議室"]},
|
16
|
+
{:title=>"予定あり", :period=>"終日", :plan=>"", :facility=>""}
|
17
17
|
]
|
18
18
|
|
19
19
|
```
|
@@ -37,16 +37,32 @@ class Ragoon::Services::Schedule < Ragoon::Services
|
|
37
37
|
if event[:allday] == 'true'
|
38
38
|
'終日'
|
39
39
|
else
|
40
|
-
|
40
|
+
case event[:event_type]
|
41
|
+
when 'normal'
|
42
|
+
period = event.children.xpath('ev:datetime', ev: "http://schemas.cybozu.co.jp/schedule/2008").first
|
43
|
+
return '' if period.nil?
|
44
|
+
start_time = parse_event_time(period[:start])
|
45
|
+
end_time = event[:start_only] == 'true' ? '' : parse_event_time(period[:end])
|
46
|
+
when 'repeat'
|
47
|
+
repeat_info = event.xpath('ev:repeat_info', ev: 'http://schemas.cybozu.co.jp/schedule/2008').first
|
48
|
+
return '' if repeat_info.nil?
|
49
|
+
period = repeat_info.xpath('ev:condition', ev: 'http://schemas.cybozu.co.jp/schedule/2008').first
|
50
|
+
return '' if period.nil?
|
51
|
+
start_time = parse_event_time(period[:start_time])
|
52
|
+
end_time = event[:start_only] == 'true' ? '' : parse_event_time(period[:end_time])
|
53
|
+
else
|
54
|
+
return ''
|
55
|
+
end
|
41
56
|
|
42
|
-
return '' if period.nil?
|
43
|
-
|
44
|
-
start_time = Time.parse(period[:start]).localtime.strftime('%R')
|
45
|
-
end_time = event[:start_only] == 'true' ? '' : Time.parse(period[:end]).localtime.strftime('%R')
|
46
57
|
"#{start_time}〜#{end_time}"
|
47
58
|
end
|
48
59
|
end
|
49
60
|
|
61
|
+
|
62
|
+
def parse_event_time(time)
|
63
|
+
Time.parse(time).localtime.strftime('%R')
|
64
|
+
end
|
65
|
+
|
50
66
|
def default_options(action_name)
|
51
67
|
case action_name
|
52
68
|
when 'ScheduleGetEvents'
|
data/lib/ragoon/version.rb
CHANGED