Skip to content

Commit d576663

Browse files
takahashimLeFnord
andauthored
Remove unused methods in GrapeSwagger::DocMethods::BuildModelDefinition (#856)
Co-authored-by: peter scholz <[email protected]>
1 parent c3a4bb3 commit d576663

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

lib/grape-swagger/doc_methods/build_model_definition.rb

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,9 @@ module GrapeSwagger
44
module DocMethods
55
class BuildModelDefinition
66
class << self
7-
def build(model, properties, required, other_def_properties = {})
7+
def build(_model, properties, required, other_def_properties = {})
88
definition = { type: 'object', properties: properties }.merge(other_def_properties)
99

10-
if required.nil?
11-
required_attrs = required_attributes(model)
12-
definition[:required] = required_attrs unless required_attrs.blank?
13-
end
14-
1510
definition[:required] = required if required.is_a?(Array) && required.any?
1611

1712
definition
@@ -67,20 +62,6 @@ def parse_refs_and_models(refs_or_models, model)
6762
end
6863
end
6964
end
70-
71-
private
72-
73-
def required_attributes(model)
74-
parse_entity(model) || parse_representable(model)
75-
end
76-
77-
def parse_entity(model)
78-
return unless model.respond_to?(:documentation)
79-
end
80-
81-
def parse_representable(model)
82-
return unless model.respond_to?(:map)
83-
end
8465
end
8566
end
8667
end

0 commit comments

Comments
 (0)