web_function 0.2.2 → 0.3.0
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/lib/web_function/attribute.rb +29 -0
- data/lib/web_function/endpoint.rb +8 -0
- data/lib/web_function/version.rb +1 -1
- data/lib/web_function.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a2ee660581b58f9c6c0d5596a134fe043a02d3a1f1399cf328016c6d6bab5df
|
4
|
+
data.tar.gz: 617a6485865f6377cb87ae7419a66053fe54328f948543bc1b7bfbdecb15e8d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df4b344637074682b2a56c8d996f3c71a57b57ea22e8683a5a0755c5c0dcdbcdf288a7c62f9e7a9fa522ae58e1a628ecf5f1c395c0d516d3a59cbdcb2d7a7f4d
|
7
|
+
data.tar.gz: d4c0eb92ff33a8957981493804e9def5163335ff7fffd886e03c1fe9d5129de1da39237fa51eee6ac0cff142c024b076c4ddd6b62adf7e952cea7e515b6795a5
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module WebFunction
|
4
|
+
class Attribute
|
5
|
+
def initialize(attribute)
|
6
|
+
@attribute = attribute
|
7
|
+
end
|
8
|
+
|
9
|
+
def name
|
10
|
+
@attribute["name"]
|
11
|
+
end
|
12
|
+
|
13
|
+
def type
|
14
|
+
@attribute["type"]
|
15
|
+
end
|
16
|
+
|
17
|
+
def values
|
18
|
+
@attribute["values"]
|
19
|
+
end
|
20
|
+
|
21
|
+
def flags
|
22
|
+
@attribute["flags"]
|
23
|
+
end
|
24
|
+
|
25
|
+
def docs
|
26
|
+
@attribute["docs"]
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -77,6 +77,14 @@ module WebFunction
|
|
77
77
|
@endpoint["arguments"].map { |argument| Argument.new(argument) }
|
78
78
|
end
|
79
79
|
|
80
|
+
def attributes
|
81
|
+
unless @endpoint["attributes"].is_a?(Array)
|
82
|
+
return []
|
83
|
+
end
|
84
|
+
|
85
|
+
@endpoint["attributes"].map { |attribute| Attribute.new(attribute) }
|
86
|
+
end
|
87
|
+
|
80
88
|
def errors
|
81
89
|
unless @endpoint["errors"].is_a?(Array)
|
82
90
|
return []
|
data/lib/web_function/version.rb
CHANGED
data/lib/web_function.rb
CHANGED
@@ -9,6 +9,7 @@ require_relative "web_function/client"
|
|
9
9
|
require_relative "web_function/package"
|
10
10
|
require_relative "web_function/endpoint"
|
11
11
|
require_relative "web_function/argument"
|
12
|
+
require_relative "web_function/attribute"
|
12
13
|
require_relative "web_function/documented_error"
|
13
14
|
|
14
15
|
module WebFunction
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: web_function
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robin Clart
|
@@ -56,6 +56,7 @@ files:
|
|
56
56
|
- exe/wfn
|
57
57
|
- lib/web_function.rb
|
58
58
|
- lib/web_function/argument.rb
|
59
|
+
- lib/web_function/attribute.rb
|
59
60
|
- lib/web_function/client.rb
|
60
61
|
- lib/web_function/documented_error.rb
|
61
62
|
- lib/web_function/endpoint.rb
|