plate_api 1.2.4 → 1.2.8
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/.gitignore +2 -0
- data/Dockerfile +6 -0
- data/Gemfile.lock +2 -2
- data/README.md +6 -0
- data/lib/plate_api/get_request.rb +15 -2
- data/lib/plate_api/object_handler.rb +52 -23
- data/lib/plate_api/plate_object/base.rb +74 -52
- data/lib/plate_api/request.rb +13 -15
- data/lib/plate_api/response_error.rb +5 -0
- data/lib/plate_api/version.rb +1 -1
- data/lib/plate_api.rb +1 -1
- metadata +3 -3
- data/.byebug_history +0 -48
- data/lib/plate_api/error.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 600f799a54373ccf8b006bddb1d97e268d2ec9a427551fce6022bf1faed41e67
|
4
|
+
data.tar.gz: 775cbeedcfe25f9c77705388403be50a030b6c1350c46195026ad00e148a234f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4628865a07f17d67dc5bce69462f007a01143a46039bd133b30e9f16bccde2f925e4bd94416d5ab473d0a9fe8744f08a02b4b5ce37a82eeaa9c04f7516a6e88b
|
7
|
+
data.tar.gz: e6b6f0e6a65b2e4c3d7e1d56a38b1498a0631a58365ba3eef10cfde24fe77c98cbbec264c743a83dd0a1e2d290219096593b8ba47b0884c58a829d098ac1993a
|
data/.gitignore
CHANGED
data/Dockerfile
ADDED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
plate_api (1.2.
|
4
|
+
plate_api (1.2.8)
|
5
5
|
faraday (~> 1.0.1)
|
6
6
|
mime-types (~> 3.3.1)
|
7
7
|
|
@@ -32,7 +32,7 @@ GEM
|
|
32
32
|
concurrent-ruby (~> 1.0)
|
33
33
|
mime-types (3.3.1)
|
34
34
|
mime-types-data (~> 3.2015)
|
35
|
-
mime-types-data (3.
|
35
|
+
mime-types-data (3.2022.0105)
|
36
36
|
minitest (5.14.1)
|
37
37
|
multipart-post (2.1.1)
|
38
38
|
public_suffix (4.0.5)
|
data/README.md
CHANGED
@@ -145,6 +145,12 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
145
145
|
|
146
146
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
147
147
|
|
148
|
+
## Run Specs with Docker
|
149
|
+
```bash
|
150
|
+
docker build -t plate_api_gem .
|
151
|
+
docker run --rm -v $(pwd):/plate_api -it plate_api_gem rspec
|
152
|
+
```
|
153
|
+
|
148
154
|
## License
|
149
155
|
|
150
156
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
@@ -3,14 +3,27 @@ module PlateApi
|
|
3
3
|
def initialize(public_key, secret, path, parameters={}, custom_server=nil)
|
4
4
|
super(public_key, secret, "GET", path, custom_server)
|
5
5
|
|
6
|
-
|
7
|
-
@url_parameters = sorted_params.map{|x| "#{x[0]}=#{x[1]}"}.join("&")
|
6
|
+
@url_parameters = build_url_parameters(parameters)
|
8
7
|
end
|
9
8
|
|
10
9
|
def url_path
|
11
10
|
"#{@path}?#{@url_parameters}"
|
12
11
|
end
|
13
12
|
|
13
|
+
# Translate a Hash of url parameters to a query string
|
14
|
+
def build_url_parameters(parameters)
|
15
|
+
sorted_params = parameters.to_a.sort_by{|x| x[0]}
|
16
|
+
query_string = sorted_params.map do |key, value|
|
17
|
+
if value.is_a? Array
|
18
|
+
value.map{|subvalue| "#{key}[]=#{subvalue}"}.join("&")
|
19
|
+
else
|
20
|
+
"#{key}=#{value}"
|
21
|
+
end
|
22
|
+
end.join("&")
|
23
|
+
|
24
|
+
query_string
|
25
|
+
end
|
26
|
+
|
14
27
|
def url_parameters
|
15
28
|
@url_parameters
|
16
29
|
end
|
@@ -7,38 +7,42 @@ module PlateApi
|
|
7
7
|
def initialize(handling_class, api_connector)
|
8
8
|
raise ArgumentError, "`handling_class` given for #new is not valid" unless handling_class
|
9
9
|
raise ArgumentError, "`api_connector` given for #new is not valid" unless api_connector
|
10
|
+
|
10
11
|
@handling_class = handling_class
|
11
12
|
@api_connector = api_connector
|
12
13
|
end
|
13
14
|
|
14
15
|
def find(id)
|
15
16
|
raise ArgumentError, "`id` given for #find is not valid" unless id
|
17
|
+
|
16
18
|
result = @api_connector.get(resource_path(id))
|
17
19
|
if result["data"]
|
18
|
-
|
20
|
+
new_object(result["data"])
|
19
21
|
else
|
20
|
-
raise
|
22
|
+
raise ResponseError, result
|
21
23
|
end
|
22
24
|
end
|
23
25
|
|
24
26
|
def update(id, attributes)
|
25
27
|
raise ArgumentError, "`id` given for #update is not valid" unless id
|
26
|
-
raise ArgumentError, "`attributes` given for #update is not valid" unless attributes.is_a?
|
27
|
-
|
28
|
+
raise ArgumentError, "`attributes` given for #update is not valid" unless attributes.is_a?(Hash)
|
29
|
+
|
30
|
+
result = @api_connector.put(resource_path(id), { "data" => attributes })
|
28
31
|
|
29
32
|
if result["data"]
|
30
|
-
|
33
|
+
new_object(result["data"])
|
31
34
|
else
|
32
|
-
raise
|
35
|
+
raise ResponseError, result
|
33
36
|
end
|
34
37
|
end
|
35
38
|
|
36
|
-
def create(parent, attributes, create_method
|
39
|
+
def create(parent, attributes, create_method = :post)
|
37
40
|
raise ArgumentError, "`parent` given for #create is not valid" unless parent
|
38
|
-
raise ArgumentError, "`attributes` given for #create is not valid" unless attributes.is_a?
|
41
|
+
raise ArgumentError, "`attributes` given for #create is not valid" unless attributes.is_a?(Hash)
|
42
|
+
|
39
43
|
parameters = case create_method
|
40
44
|
when :post
|
41
|
-
{"data" => attributes}
|
45
|
+
{ "data" => attributes }
|
42
46
|
when :post_multipart
|
43
47
|
attributes
|
44
48
|
end
|
@@ -46,45 +50,70 @@ module PlateApi
|
|
46
50
|
result = @api_connector.send(create_method, collection_path(parent.class, parent.id), parameters)
|
47
51
|
|
48
52
|
if result["data"]
|
49
|
-
|
53
|
+
new_object(result["data"])
|
50
54
|
else
|
51
|
-
raise
|
55
|
+
raise ResponseError, result
|
52
56
|
end
|
53
57
|
end
|
54
58
|
|
55
59
|
def delete(id)
|
56
60
|
raise ArgumentError, "`id` given for #find is not valid" unless id
|
61
|
+
|
57
62
|
result = @api_connector.delete(resource_path(id))
|
58
63
|
if result["data"]
|
59
|
-
|
64
|
+
new_object(result["data"])
|
60
65
|
else
|
61
|
-
raise
|
66
|
+
raise ResponseError, result
|
62
67
|
end
|
63
68
|
end
|
64
69
|
|
65
|
-
def index(parent_class, parent_id, extra_params={})
|
70
|
+
def index(parent_class, parent_id, extra_params = {}, return_raw = false)
|
66
71
|
raise ArgumentError, "`parent_id` given for #index is not valid" unless parent_id
|
67
72
|
raise ArgumentError, "`parent_class` given for #index is not valid" unless parent_class
|
68
73
|
|
69
74
|
result = @api_connector.get(collection_path(parent_class, parent_id), extra_params)
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
75
|
+
raise ResponseError, result unless result["data"]
|
76
|
+
return result if return_raw
|
77
|
+
|
78
|
+
result["data"].map { |x| new_object(x) }
|
79
|
+
end
|
80
|
+
|
81
|
+
def index_block(parent_class, parent_id, extra_params = {}, &block)
|
82
|
+
extra_params[:page] = extra_params.delete("page") if extra_params["page"]
|
83
|
+
extra_params[:page] = 1 unless extra_params[:page]
|
84
|
+
|
85
|
+
pagination = index_block_iteration(parent_class, parent_id, extra_params, &block)
|
86
|
+
return unless pagination
|
87
|
+
|
88
|
+
while pagination["page"] < pagination["total_pages"]
|
89
|
+
extra_params.merge!(page: (pagination["page"] + 1))
|
90
|
+
pagination = index_block_iteration(parent_class, parent_id, extra_params, &block)
|
91
|
+
break unless pagination
|
74
92
|
end
|
75
93
|
end
|
76
94
|
|
77
95
|
def index_total_count(parent)
|
78
96
|
result = @api_connector.get(collection_path(parent.class, parent.id), per_page: 1)
|
79
97
|
if result["meta"]
|
80
|
-
|
98
|
+
result["meta"]["pagination"]["total_records"]
|
81
99
|
else
|
82
|
-
raise
|
100
|
+
raise ResponseError, result
|
83
101
|
end
|
84
102
|
end
|
85
103
|
|
86
104
|
private
|
87
105
|
|
106
|
+
def index_block_iteration(parent_class, parent_id, params)
|
107
|
+
result = index(parent_class, parent_id, params, true)
|
108
|
+
objects = result["data"].map { |x| new_object(x) }
|
109
|
+
meta = result["meta"]
|
110
|
+
yield(objects, meta)
|
111
|
+
|
112
|
+
# Returns pagination metadata so it can be used to
|
113
|
+
# iterate through the pages.
|
114
|
+
meta["pagination"] if meta
|
115
|
+
end
|
116
|
+
|
88
117
|
# Construct a new object of @handling_class, given a succesful api_response
|
89
118
|
def new_object(api_response)
|
90
119
|
@handling_class.new(
|
@@ -99,15 +128,15 @@ module PlateApi
|
|
99
128
|
"#{@handling_class.api_name}/#{id}"
|
100
129
|
end
|
101
130
|
|
102
|
-
def collection_path(parent_class=nil, parent_id=nil)
|
103
|
-
if (parent_class
|
131
|
+
def collection_path(parent_class = nil, parent_id = nil)
|
132
|
+
if (!parent_class.nil?) ^ (!parent_id.nil?)
|
104
133
|
raise ArgumentError, "An invalid combination `parent_class` and `parent_id` is given. Provide both or none."
|
105
134
|
end
|
106
135
|
|
107
136
|
if parent_class
|
108
137
|
"#{parent_class.api_name}/#{parent_id}/#{@handling_class.api_name}"
|
109
138
|
else
|
110
|
-
|
139
|
+
@handling_class.api_name.to_s
|
111
140
|
end
|
112
141
|
end
|
113
142
|
end
|
@@ -6,7 +6,7 @@ module PlateApi::PlateObject
|
|
6
6
|
HasOneRelations = {}
|
7
7
|
HasManyRelations = {}
|
8
8
|
|
9
|
-
def initialize(id, attributes, relations, object_handler=nil)
|
9
|
+
def initialize(id, attributes, relations, object_handler = nil)
|
10
10
|
@id = id
|
11
11
|
@object_handler = object_handler
|
12
12
|
initialize_state(attributes, relations)
|
@@ -17,24 +17,27 @@ module PlateApi::PlateObject
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def reload
|
20
|
-
raise ArgumentError
|
20
|
+
raise ArgumentError, "No object_handler is set." unless @object_handler
|
21
|
+
|
21
22
|
reinitialize(@object_handler.find(@id))
|
22
|
-
|
23
|
+
self
|
23
24
|
end
|
24
25
|
|
25
26
|
def update(attributes)
|
26
|
-
raise ArgumentError
|
27
|
-
raise ArgumentError
|
27
|
+
raise ArgumentError, "Input `attributes` is not a Hash" unless attributes.is_a?(Hash)
|
28
|
+
raise ArgumentError, "No object_handler is attached to this object" unless @object_handler
|
29
|
+
|
28
30
|
if new_object = @object_handler.update(@id, attributes)
|
29
31
|
reinitialize(new_object)
|
30
32
|
else
|
31
|
-
raise ArgumentError
|
33
|
+
raise ArgumentError, "The update was unsuccesful."
|
32
34
|
end
|
33
|
-
|
35
|
+
self
|
34
36
|
end
|
35
37
|
|
36
38
|
def delete
|
37
|
-
raise ArgumentError
|
39
|
+
raise ArgumentError, "No object_handler is attached to this object" unless @object_handler
|
40
|
+
|
38
41
|
@object_handler.delete(@id)
|
39
42
|
end
|
40
43
|
|
@@ -46,18 +49,25 @@ module PlateApi::PlateObject
|
|
46
49
|
to_s
|
47
50
|
end
|
48
51
|
|
49
|
-
def method_missing(
|
50
|
-
if attributes[
|
51
|
-
|
52
|
-
elsif attributes["content"] && attributes["content"][
|
53
|
-
|
52
|
+
def method_missing(method_name, *args, &block)
|
53
|
+
if attributes[method_name.to_s]
|
54
|
+
attributes[method_name.to_s]
|
55
|
+
elsif attributes["content"] && attributes["content"][method_name.to_s]
|
56
|
+
attributes["content"][method_name.to_s]["value"]
|
54
57
|
else
|
55
58
|
super
|
56
59
|
end
|
57
60
|
end
|
58
61
|
|
62
|
+
def respond_to_missing?(method_name, include_private = false)
|
63
|
+
return true if attributes[method_name.to_s]
|
64
|
+
return true if attributes["content"] && attributes["content"][method_name.to_s]
|
65
|
+
|
66
|
+
super
|
67
|
+
end
|
68
|
+
|
59
69
|
def ==(other)
|
60
|
-
|
70
|
+
other.id == @id && other.class == self.class
|
61
71
|
end
|
62
72
|
|
63
73
|
private
|
@@ -72,56 +82,68 @@ module PlateApi::PlateObject
|
|
72
82
|
@relations = relations
|
73
83
|
end
|
74
84
|
|
75
|
-
def
|
76
|
-
HasOneRelations[self.name] ||= {}
|
77
|
-
self.attr_accessor "#{name}_id"
|
78
|
-
HasOneRelations[self.name][name.to_s] = klass
|
79
|
-
define_has_one_method(name, klass)
|
80
|
-
end
|
85
|
+
def set_relation_ids(relations_attributes)
|
86
|
+
HasOneRelations[self.class.name] ||= {}
|
81
87
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
88
|
+
return unless relations_attributes
|
89
|
+
|
90
|
+
self.class::HasOneRelations[self.class.name].keys.each do |relation_name|
|
91
|
+
val = relations_attributes["#{relation_name}_id"]
|
92
|
+
if val
|
93
|
+
send("#{relation_name}_id=", val)
|
94
|
+
end
|
87
95
|
end
|
88
96
|
end
|
89
97
|
|
90
|
-
|
91
|
-
|
92
|
-
HasManyRelations[self.name][plural_name.to_s] = klass
|
93
|
-
define_has_many_methods(plural_name, klass)
|
94
|
-
define_create_method(singular_name, klass) if define_create_method
|
95
|
-
end
|
98
|
+
class << self
|
99
|
+
private
|
96
100
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
101
|
+
def has_one(name, klass)
|
102
|
+
HasOneRelations[self.name] ||= {}
|
103
|
+
attr_accessor("#{name}_id")
|
104
|
+
HasOneRelations[self.name][name.to_s] = klass
|
105
|
+
define_has_one_method(name, klass)
|
102
106
|
end
|
103
107
|
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
+
def define_has_one_method(name, klass)
|
109
|
+
define_method(name.to_s) do
|
110
|
+
id = send("#{name}_id")
|
111
|
+
return nil unless id
|
112
|
+
|
113
|
+
@object_handler.api_connector.handler(Object.const_get(klass)).find(id)
|
114
|
+
end
|
108
115
|
end
|
109
|
-
end
|
110
116
|
|
111
|
-
|
112
|
-
|
113
|
-
|
117
|
+
def has_many(plural_name, singular_name, klass, define_create_method = false)
|
118
|
+
HasManyRelations[name] ||= {}
|
119
|
+
HasManyRelations[name][plural_name.to_s] = klass
|
120
|
+
define_has_many_methods(plural_name, klass)
|
121
|
+
define_create_method(singular_name, klass) if define_create_method
|
114
122
|
end
|
115
|
-
end
|
116
123
|
|
117
|
-
|
118
|
-
|
124
|
+
def define_has_many_methods(plural_name, klass)
|
125
|
+
define_method(plural_name.to_s) do |params = {}|
|
126
|
+
@object_handler.api_connector.handler(
|
127
|
+
Object.const_get(klass)
|
128
|
+
).index(self.class, @id, params)
|
129
|
+
end
|
119
130
|
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
131
|
+
define_method("#{plural_name}_total_count") do
|
132
|
+
@object_handler.api_connector.handler(
|
133
|
+
Object.const_get(klass)
|
134
|
+
).index_total_count(self)
|
135
|
+
end
|
136
|
+
|
137
|
+
define_method("all_#{plural_name}") do |params = {}, &block|
|
138
|
+
@object_handler.api_connector.handler(
|
139
|
+
Object.const_get(klass)
|
140
|
+
).index_block(self.class, @id, params, &block)
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
def define_create_method(singular_name, klass)
|
145
|
+
define_method("create_#{singular_name}") do |create_attributes|
|
146
|
+
@object_handler.api_connector.handler(Object.const_get(klass)).create(self, create_attributes)
|
125
147
|
end
|
126
148
|
end
|
127
149
|
end
|
data/lib/plate_api/request.rb
CHANGED
@@ -12,9 +12,9 @@ module PlateApi
|
|
12
12
|
HttpAdapter = Faraday.default_adapter
|
13
13
|
|
14
14
|
def initialize(public_key, secret, method, path, custom_server = nil)
|
15
|
-
base_api_endpoint = custom_server
|
15
|
+
base_api_endpoint = custom_server || DefaultApiBaseEndpoint
|
16
16
|
|
17
|
-
@connection = ::Faraday.new(url: base_api_endpoint) do |faraday|
|
17
|
+
@connection = ::Faraday.new(url: base_api_endpoint, request: { timeout: 900 }) do |faraday|
|
18
18
|
extra_builder_options(faraday)
|
19
19
|
faraday.adapter HttpAdapter
|
20
20
|
end
|
@@ -33,12 +33,12 @@ module PlateApi
|
|
33
33
|
extra_request_options(request)
|
34
34
|
end
|
35
35
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
36
|
+
case response_type
|
37
|
+
when :raw
|
38
|
+
response.body
|
39
|
+
when :json
|
40
|
+
JSON.parse(response.body)
|
41
|
+
end
|
42
42
|
end
|
43
43
|
|
44
44
|
def request_date
|
@@ -50,9 +50,9 @@ module PlateApi
|
|
50
50
|
"#{@connection.host}\n" +
|
51
51
|
"#{@connection.path_prefix}/#{@path}\n" +
|
52
52
|
"#{url_parameters}\n" +
|
53
|
-
|
53
|
+
request_date.to_s
|
54
54
|
signature = Base64.strict_encode64(OpenSSL::HMAC.digest("SHA512", @secret, string_to_sign))
|
55
|
-
|
55
|
+
"hmac #{@public_key}:#{signature}"
|
56
56
|
end
|
57
57
|
|
58
58
|
private
|
@@ -65,14 +65,12 @@ module PlateApi
|
|
65
65
|
""
|
66
66
|
end
|
67
67
|
|
68
|
-
def extra_request_options(request)
|
69
|
-
end
|
68
|
+
def extra_request_options(request); end
|
70
69
|
|
71
|
-
def extra_builder_options(request)
|
72
|
-
end
|
70
|
+
def extra_builder_options(request); end
|
73
71
|
|
74
72
|
def strip_path(path)
|
75
|
-
path.gsub(
|
73
|
+
path.gsub(%r{^/|/$}, "")
|
76
74
|
end
|
77
75
|
end
|
78
76
|
end
|
data/lib/plate_api/version.rb
CHANGED
data/lib/plate_api.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plate_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Kortleven
|
@@ -161,10 +161,10 @@ executables: []
|
|
161
161
|
extensions: []
|
162
162
|
extra_rdoc_files: []
|
163
163
|
files:
|
164
|
-
- ".byebug_history"
|
165
164
|
- ".gitignore"
|
166
165
|
- ".rspec"
|
167
166
|
- ".travis.yml"
|
167
|
+
- Dockerfile
|
168
168
|
- Gemfile
|
169
169
|
- Gemfile.lock
|
170
170
|
- LICENSE.txt
|
@@ -175,7 +175,6 @@ files:
|
|
175
175
|
- lib/plate_api.rb
|
176
176
|
- lib/plate_api/connector.rb
|
177
177
|
- lib/plate_api/delete_request.rb
|
178
|
-
- lib/plate_api/error.rb
|
179
178
|
- lib/plate_api/get_request.rb
|
180
179
|
- lib/plate_api/object_handler.rb
|
181
180
|
- lib/plate_api/plate_object/attachment.rb
|
@@ -196,6 +195,7 @@ files:
|
|
196
195
|
- lib/plate_api/post_request.rb
|
197
196
|
- lib/plate_api/put_request.rb
|
198
197
|
- lib/plate_api/request.rb
|
198
|
+
- lib/plate_api/response_error.rb
|
199
199
|
- lib/plate_api/version.rb
|
200
200
|
- plate_api.gemspec
|
201
201
|
homepage:
|
data/.byebug_history
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
c
|
2
|
-
MimeMagic.by_path(@full_path)
|
3
|
-
MimemMagic.by_path(@full_path)
|
4
|
-
@file
|
5
|
-
@full_path
|
6
|
-
c
|
7
|
-
attributes
|
8
|
-
m
|
9
|
-
c
|
10
|
-
attributes
|
11
|
-
m
|
12
|
-
c;m
|
13
|
-
m
|
14
|
-
c
|
15
|
-
m
|
16
|
-
c
|
17
|
-
attributes
|
18
|
-
s
|
19
|
-
up
|
20
|
-
s
|
21
|
-
up
|
22
|
-
s
|
23
|
-
new_object.attributes
|
24
|
-
c
|
25
|
-
new_object.attributes
|
26
|
-
new_object
|
27
|
-
c
|
28
|
-
full_path
|
29
|
-
c
|
30
|
-
n
|
31
|
-
val.is_a? File
|
32
|
-
val
|
33
|
-
c
|
34
|
-
val.is_a? File
|
35
|
-
val
|
36
|
-
parameters
|
37
|
-
c
|
38
|
-
site.id
|
39
|
-
site = subject.find(5)
|
40
|
-
c
|
41
|
-
site.class.superclass
|
42
|
-
site.class.methods
|
43
|
-
site.class
|
44
|
-
site.methods.class
|
45
|
-
site.methods - Object.methods
|
46
|
-
site.methods
|
47
|
-
site.id
|
48
|
-
site = subject.find(5)
|