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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 19180881737875d48459d871d3d3142f32e121e7e0101a7f463458cbb6399e7c
4
- data.tar.gz: e1f501c3c8464c88dcb964a972dfb750aa5bd19a9edb44c7028cc1779023256a
3
+ metadata.gz: 1a2ee660581b58f9c6c0d5596a134fe043a02d3a1f1399cf328016c6d6bab5df
4
+ data.tar.gz: 617a6485865f6377cb87ae7419a66053fe54328f948543bc1b7bfbdecb15e8d6
5
5
  SHA512:
6
- metadata.gz: 722f978f1445ef103223848a2a6133adf7eda947d058c69e9307d15802084e37a987ee62fe214f263da0e9cf7569338373b469a577ccb4a211f4be807e60a0f4
7
- data.tar.gz: bc1e23d6e55a71b23d0c31c5670368c6c003adc531bbf53999c91f7ac77b12ce1dae682c8a21cfdf168f71a3d4b840dfb5eb7eaab6ce6fa3312d5122e3516a89
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 []
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WebFunction
4
- VERSION = "0.2.2"
4
+ VERSION = "0.3.0"
5
5
  end
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.2.2
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