omnievent 0.1.0.pre4 → 0.1.0.pre5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/omnievent/version.rb +1 -1
- data/lib/omnievent.rb +10 -16
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fe7bcccfdc17aa7d63acd4c44143de5006e7cee9c142078656751bc3a5641fe
|
4
|
+
data.tar.gz: 7be7b177ae90c1eb8d3490e6563956c7d3f1ac702d59e108058c1eac70d4f696
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba6ca77f917e16246ec0bb3d80186b9ae3fb515b4b4bc1947688cd5f2cd51bbf06abe88adaa557448f00c89fd12467c5bebf9f04852f6d92cae6773a12060230
|
7
|
+
data.tar.gz: 43ebe3948021f40fa946c2bc5a7d200da65fd96754425bda2d378e6fa06dbdb94bfe1a051c53ed3605edfe9593b6a17ede5448065e61c696e5e1097a0d1f6150
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
omnievent (0.1.0.
|
4
|
+
omnievent (0.1.0.pre5)
|
5
5
|
hashie (>= 3.4.6)
|
6
6
|
iso-639 (~> 0.3.5)
|
7
7
|
tzinfo (~> 2.0)
|
@@ -21,7 +21,7 @@ GEM
|
|
21
21
|
hashie (5.0.0)
|
22
22
|
i18n (1.12.0)
|
23
23
|
concurrent-ruby (~> 1.0)
|
24
|
-
iso-639 (0.3.
|
24
|
+
iso-639 (0.3.6)
|
25
25
|
json (2.6.2)
|
26
26
|
minitest (5.16.3)
|
27
27
|
parallel (1.22.1)
|
data/lib/omnievent/version.rb
CHANGED
data/lib/omnievent.rb
CHANGED
@@ -57,44 +57,38 @@ module OmniEvent
|
|
57
57
|
|
58
58
|
# List events.
|
59
59
|
def list_events(provider = nil, opts = {})
|
60
|
-
|
60
|
+
raise ArgumentError, "You need to pass a provider name as the first argument." unless provider
|
61
61
|
|
62
62
|
strategy_instance(provider).request(:list_events, opts)
|
63
63
|
end
|
64
64
|
|
65
65
|
# Create event.
|
66
66
|
def create_event(provider = nil, opts = {})
|
67
|
-
|
67
|
+
raise ArgumentError, "You need to pass a provider name as the first argument." unless provider
|
68
|
+
raise ArgumentError, "You need to pass an :event in opts." unless opts_has_event?(opts)
|
69
|
+
raise ArgumentError, "Event is not valid." unless opts[:event].valid?
|
68
70
|
|
69
71
|
strategy_instance(provider).request(:create_event, opts)
|
70
72
|
end
|
71
73
|
|
72
74
|
# Update event.
|
73
75
|
def update_event(provider = nil, opts = {})
|
74
|
-
|
76
|
+
raise ArgumentError, "You need to pass a provider name as the first argument." unless provider
|
77
|
+
raise ArgumentError, "You need to pass an :event in opts." unless opts_has_event?(opts)
|
75
78
|
|
76
79
|
strategy_instance(provider).request(:update_event, opts)
|
77
80
|
end
|
78
81
|
|
79
82
|
# Destroy event.
|
80
83
|
def destroy_event(provider = nil, opts = {})
|
81
|
-
validate_event_args(provider, opts)
|
82
|
-
|
83
|
-
strategy_instance(provider).request(:destroy_event, opts)
|
84
|
-
end
|
85
|
-
|
86
|
-
def validate_provider_arg(provider)
|
87
84
|
raise ArgumentError, "You need to pass a provider name as the first argument." unless provider
|
88
|
-
|
85
|
+
raise ArgumentError, "You need to pass an :event in opts." unless opts_has_event?(opts)
|
89
86
|
|
90
|
-
|
91
|
-
validate_provider_arg(provider)
|
92
|
-
|
93
|
-
raise ArgumentError, "You need to pass a valid as :event in opts." unless opts_have_valid_event?(opts)
|
87
|
+
strategy_instance(provider).request(:destroy_event, opts)
|
94
88
|
end
|
95
89
|
|
96
|
-
def
|
97
|
-
opts[:event]
|
90
|
+
def opts_has_event?(opts)
|
91
|
+
opts[:event]&.is_a?(OmniEvent::EventHash)
|
98
92
|
end
|
99
93
|
|
100
94
|
def strategy_instance(provider)
|