nexmo_api_specification 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +26 -0
- data/lib/nexmo_api_specification/definition.rb +5 -1
- 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: ce4c29efbf7317e8bd615b119dbfebdb322a012b
|
4
|
+
data.tar.gz: e573dc3bab14927ff7df0ef9e56bcd23f0960740
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bffbb96880bf25cb7b5ace8be585a43c9de1c9e3a6b2e245d8a964a377b6e9d45d67c79b6acc0d835104e27f9f71f26a5b36007d8792cbcbc3006329a95d314
|
7
|
+
data.tar.gz: 165fac5f5b36286eced7bf6be50575a3847d098c1e98e468c2d32fc58be60123f3b808a7232d6b1dd4d4f0c64cebfe3b3a1a6da603711441d4a1e1714b2b571b
|
data/README.md
CHANGED
@@ -43,6 +43,32 @@ These definitions provide a single point of truth that can be used end-to-end ca
|
|
43
43
|
- [Swagger Parser](https://github.com/swagger-api/swagger-parser) - Standalone library for parsing OAS3 definitions from Java
|
44
44
|
- [Nexmo Developer](https://github.com/Nexmo/nexmo-developer) - Nexmo Developer has it's own OAS3 definition parser and API reference UI.
|
45
45
|
|
46
|
+
## Consuming
|
47
|
+
|
48
|
+
These API Specifications can be made available as packages. See below for the currently available packages and instructions on how to consume them.
|
49
|
+
|
50
|
+
### Ruby
|
51
|
+
|
52
|
+
##### Install the Gem
|
53
|
+
|
54
|
+
```
|
55
|
+
$ gem install nexmo_api_specification
|
56
|
+
```
|
57
|
+
|
58
|
+
or add it to your GemFile and run `bundle install`
|
59
|
+
|
60
|
+
```
|
61
|
+
gem 'nexmo_api_specification', '0.1.1'
|
62
|
+
```
|
63
|
+
|
64
|
+
##### Usage
|
65
|
+
|
66
|
+
Get a definition file:
|
67
|
+
|
68
|
+
```ruby
|
69
|
+
NexmoApiSpecification::Definition.load(:sms)
|
70
|
+
```
|
71
|
+
|
46
72
|
## Contributing
|
47
73
|
|
48
74
|
Contributions are welcome, please follow [GitHub Flow](https://guides.github.com/introduction/flow/index.html)
|
@@ -2,8 +2,12 @@ module NexmoApiSpecification
|
|
2
2
|
module Definition
|
3
3
|
def self.load(definition)
|
4
4
|
path = File.join NexmoApiSpecification.root, "#{definition}.yml"
|
5
|
-
|
5
|
+
return false unless File.exist? path
|
6
6
|
File.read path
|
7
7
|
end
|
8
|
+
|
9
|
+
def self.load!(definition)
|
10
|
+
load(definition) || raise('Definition does not exist')
|
11
|
+
end
|
8
12
|
end
|
9
13
|
end
|