conflict-calendars 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -4
- data/lib/conflict/calendars/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: b8cc57f33fbe6be46bcb6def4f390207edfe2b88
|
4
|
+
data.tar.gz: e2aa7a48cd39b93de2e7718c41b536a02726d208
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99531c84f844f4eb904a9e0631598c71c1790513eb5b073d5203af3a97906ecb20d5d8bfca692afff5c1c18124c6a9ac2791c3105743a7fae0480747e66e53c1
|
7
|
+
data.tar.gz: c55cf5fb3c8e6edadab323f1bc58bc0d361a27a384be5950542c27201a28764e4c7717432556341d34cd02b2cb85c8d3e19502aa30ceff75eaaa30eecad8dd31
|
data/README.md
CHANGED
@@ -19,8 +19,13 @@ Or install it yourself as:
|
|
19
19
|
$ gem install conflict-calendars
|
20
20
|
|
21
21
|
## Usage
|
22
|
+
First you should require the library
|
22
23
|
|
23
|
-
|
24
|
+
```ruby
|
25
|
+
require "conflict/calendars"
|
26
|
+
```
|
27
|
+
|
28
|
+
Then you can create Ccs::Calendar object by this way
|
24
29
|
|
25
30
|
```ruby
|
26
31
|
calendar_A = Ccs::Calendar.new("enter the name of calendar",Time.new(2016,12,10,8,0),Time.new(2016,12,10,13,0)
|
@@ -30,7 +35,7 @@ calendar_A = Ccs::Calendar.new("enter the name of calendar",Time.new(2016,12,10,
|
|
30
35
|
calendar_B = Ccs::Calendar.new(Time.new(2016,12,10,9,0),Time.new(2016,12,10,10,30))
|
31
36
|
#=> #<Ccs::Calendar:0x007fa36c55bf38 @name=nil, @start_time=2016-12-10 09:00:00 +0800, @end_time=2016-12-10 10:30:00 +0800>
|
32
37
|
```
|
33
|
-
|
38
|
+
Then you can find the conflicts by this way
|
34
39
|
|
35
40
|
```ruby
|
36
41
|
conflicts = Ccs::Conflicts.new(calendar_A,calendar_B)
|
@@ -39,8 +44,7 @@ conflicts.each do |conflict|
|
|
39
44
|
p conflict #=> #<Set: {#<Ccs::Calendar:0x007fb..>, #<Ccs::Calendar:0x007fc..>} >
|
40
45
|
end
|
41
46
|
```
|
42
|
-
Now, you
|
43
|
-
So, you can do that :
|
47
|
+
Now, you know there are exist two calendars that conflict in the same set. So, you can get each information of calendar by this way :
|
44
48
|
|
45
49
|
```ruby
|
46
50
|
conflict.each do |calendar|
|