brick_ftp 0.5.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -3
- data/lib/brick_ftp/api/authentication/session.rb +1 -1
- data/lib/brick_ftp/api/base.rb +27 -5
- data/lib/brick_ftp/api/folder.rb +1 -0
- data/lib/brick_ftp/api_component.rb +1 -1
- data/lib/brick_ftp/api_definition.rb +0 -1
- data/lib/brick_ftp/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: f4ceed2165ffe939ec9fa8d08932469060f5ac76
|
4
|
+
data.tar.gz: baca3f3769711375adede57195a0d62421b3bc8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52eb974b0c1a30f5248e7fdb394dc0fd85da3b1499202694825d5ec845eeb27851a502808073ac759a4ff092f9caa1a8ab2fa9d22a2759ba8415c874db35ef6f
|
7
|
+
data.tar.gz: 4e2bb88fe63df32dd2dd781ff3e7537caaf01d7df694189128e5838e1aeb995b19c2af439ac1f2cb4a0ad0706b2262ee58af0758ebdd05604dd55252752fa5c6
|
data/CHANGELOG.md
CHANGED
@@ -2,20 +2,39 @@ Changelog
|
|
2
2
|
====
|
3
3
|
|
4
4
|
|
5
|
-
[unreleased](https://github.com/koshigoe/brick_ftp/compare/v0.
|
5
|
+
[unreleased](https://github.com/koshigoe/brick_ftp/compare/v0.6.0...master)
|
6
6
|
----
|
7
7
|
|
8
|
-
[Full Changelog](https://github.com/koshigoe/brick_ftp/compare/v0.
|
8
|
+
[Full Changelog](https://github.com/koshigoe/brick_ftp/compare/v0.6.0...master)
|
9
9
|
|
10
10
|
### Enhancements:
|
11
11
|
|
12
12
|
### Fixed Bugs:
|
13
13
|
|
14
|
+
### Breaking Changes:
|
15
|
+
|
16
|
+
|
17
|
+
[v0.6.0](https://github.com/koshigoe/brick_ftp/compare/v0.5.1...v0.6.0)
|
18
|
+
----
|
19
|
+
|
20
|
+
[Full Changelog](https://github.com/koshigoe/brick_ftp/compare/v0.5.1...v0.6.0)
|
21
|
+
|
22
|
+
### Enhancements:
|
23
|
+
|
24
|
+
### Fixed Bugs:
|
25
|
+
|
26
|
+
### Breaking Changes:
|
27
|
+
|
28
|
+
- [#72](https://github.com/koshigoe/brick_ftp/pull/72) Improve accessor of API properties
|
29
|
+
- Cannot access some API properties named same as methods of Ruby's Object.
|
30
|
+
- e.g. `send` property of [File Uploading](https://brickftp.com/docs/rest-api/file-uploading/)
|
31
|
+
- Use `#properties` to access properties
|
32
|
+
|
14
33
|
|
15
34
|
[v0.5.1](https://github.com/koshigoe/brick_ftp/compare/v0.5.0...v0.5.1)
|
16
35
|
----
|
17
36
|
|
18
|
-
[Full Changelog](https://github.com/koshigoe/brick_ftp/compare/v0.5.0...
|
37
|
+
[Full Changelog](https://github.com/koshigoe/brick_ftp/compare/v0.5.0...v0.5.1)
|
19
38
|
|
20
39
|
### Enhancements:
|
21
40
|
|
data/lib/brick_ftp/api/base.rb
CHANGED
@@ -39,8 +39,12 @@ module BrickFTP
|
|
39
39
|
new(data.symbolize_keys)
|
40
40
|
end
|
41
41
|
|
42
|
+
# @return [Hash{String => Object}] Key Value pairs of API properties
|
43
|
+
attr_reader :properties
|
44
|
+
|
42
45
|
def initialize(params = {})
|
43
|
-
|
46
|
+
@properties = {}
|
47
|
+
params.each { |k, v| write_property(k, v) }
|
44
48
|
end
|
45
49
|
|
46
50
|
def update(params = {})
|
@@ -51,7 +55,7 @@ module BrickFTP
|
|
51
55
|
self.class.api_path_for(:update, self),
|
52
56
|
params: self.class.api_component_for(:update).except_path_and_query(params)
|
53
57
|
)
|
54
|
-
data.each { |k, v|
|
58
|
+
data.each { |k, v| write_property(k, v) }
|
55
59
|
|
56
60
|
self
|
57
61
|
end
|
@@ -69,17 +73,35 @@ module BrickFTP
|
|
69
73
|
end
|
70
74
|
|
71
75
|
def as_json
|
72
|
-
self.class.attributes.each_with_object({}) { |name, res| res[name] =
|
76
|
+
self.class.attributes.each_with_object({}) { |name, res| res[name] = read_property(name) }
|
73
77
|
end
|
74
78
|
|
75
79
|
def to_json
|
76
80
|
as_json.to_json
|
77
81
|
end
|
78
82
|
|
83
|
+
def write_property(key, value)
|
84
|
+
properties[key.to_s] = value
|
85
|
+
end
|
86
|
+
|
87
|
+
def read_property(key)
|
88
|
+
properties[key.to_s]
|
89
|
+
end
|
90
|
+
|
91
|
+
def delete_property(key)
|
92
|
+
properties.delete(key.to_s)
|
93
|
+
end
|
94
|
+
|
79
95
|
private
|
80
96
|
|
81
|
-
def
|
82
|
-
|
97
|
+
def respond_to_missing?(method_name, _include_private)
|
98
|
+
self.class.attributes.include?(method_name.to_sym)
|
99
|
+
end
|
100
|
+
|
101
|
+
def method_missing(method_name, *args)
|
102
|
+
super unless self.class.attributes.include?(method_name.to_sym)
|
103
|
+
|
104
|
+
read_property(method_name)
|
83
105
|
end
|
84
106
|
end
|
85
107
|
end
|
data/lib/brick_ftp/api/folder.rb
CHANGED
@@ -68,7 +68,7 @@ module BrickFTP
|
|
68
68
|
when BrickFTP::API::Base
|
69
69
|
keys = path_variables(params) + query_keys
|
70
70
|
keys.each_with_object({}) do |key, res|
|
71
|
-
res[key] = params.
|
71
|
+
res[key] = params.read_property(key)
|
72
72
|
end
|
73
73
|
else
|
74
74
|
keys = path_variables(params) + query_keys
|
data/lib/brick_ftp/version.rb
CHANGED