Skip to content

Commit 7ff9d42

Browse files
authored
Merge pull request #371 from appwrite/fix-ruby-204
Fix ruby response types
2 parents 382e6c9 + ad7e2ba commit 7ff9d42

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

templates/ruby/lib/container/client.rb.twig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,11 @@ module {{ spec.title | caseUcfirst }}
161161
raise Appwrite::Exception.new(response.body, response.code, response)
162162
end
163163

164-
return response.body if response.body_permitted?
164+
if response.respond_to?("body_permitted?")
165+
return response.body if response.body_permitted?
166+
end
167+
168+
return response
165169
end
166170

167171
def encode_form_data(value, key=nil)

templates/ruby/lib/container/services/service.rb.twig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
module {{spec.title | caseUcfirst}}
44
class {{ service.name | caseUcfirst }} < Service
55

6-
include Models
76
{% for method in service.methods %}
87
{{ method.description | rubyComment }}
98
#
@@ -47,7 +46,7 @@ module {{spec.title | caseUcfirst}}
4746
params: params,
4847
headers: headers,
4948
{% if method.responseModel and method.responseModel != 'any' %}
50-
response_type: {{method.responseModel | caseUcfirst}}
49+
response_type: Models::{{method.responseModel | caseUcfirst}}
5150
{% endif %}
5251
)
5352
end

0 commit comments

Comments
 (0)