nexmo_api_specification 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nexmo_api_specification/definition.rb +10 -3
- data/lib/nexmo_api_specification/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: dadfb662ccca53136d5633ccf5103d55a2dfd2df
|
4
|
+
data.tar.gz: ddb4598412e3f676ef19927bb29213a8e7d2399f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df673e9af6e55ce517e6003d55c0c9f89791a0ca788e10a2e94590c6f1755ed8dc7593af90e64071b5ef08edd51ec97ff1e57309b4497bb5e25b23fc9f969007
|
7
|
+
data.tar.gz: dc63c24a5c5207d3d8a25e7f7bebc878ab360acc4d8590408a80f4554c4741d7857d40c7842fa699b48c5ccd86c2697aafec77d632fa3b04d1bf16ff0b890e49
|
@@ -1,13 +1,20 @@
|
|
1
1
|
module NexmoApiSpecification
|
2
2
|
module Definition
|
3
3
|
def self.load(definition)
|
4
|
-
|
5
|
-
|
6
|
-
File.read path
|
4
|
+
return false unless exists?(definition)
|
5
|
+
File.read(path(definition))
|
7
6
|
end
|
8
7
|
|
9
8
|
def self.load!(definition)
|
10
9
|
load(definition) || raise('Definition does not exist')
|
11
10
|
end
|
11
|
+
|
12
|
+
def self.path(definition)
|
13
|
+
File.join NexmoApiSpecification.root, "#{definition}.yml"
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.exists?(definition)
|
17
|
+
File.exist? path(definition)
|
18
|
+
end
|
12
19
|
end
|
13
20
|
end
|