Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make rubocop happy #318

Merged
merged 2 commits into from
Dec 29, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/apipie/extractor/writer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ def generate_apis_code(apis)
"List #{name}"
end

code << "api :#{api[:method]}, \"#{api[:path]}\""
code << ", \"#{desc}\"" if desc
code << "api :#{api[:method]}, '#{api[:path]}'"
code << ", '#{desc}'" if desc
code << "\n"
end
return code
Expand All @@ -307,16 +307,16 @@ def generate_params_code(params, indent = "")
desc[:type] = (desc[:type] && desc[:type].first) || Object
code << "#{indent}param"
if name =~ /\W/
code << " :\"#{name}\""
code << " :'#{name}'"
else
code << " :#{name}"
end
code << ", #{desc[:type].inspect}"
if desc[:allow_nil]
code << ", :allow_nil => true"
code << ", allow_nil: true"
end
if desc[:required]
code << ", :required => true"
code << ", required: true"
end
if desc[:nested]
code << " do\n"
Expand All @@ -332,7 +332,7 @@ def generate_params_code(params, indent = "")
def generate_errors_code(errors)
code = ""
errors.sort_by {|e| e[:code] }.each do |error|
code << "error :code => #{error[:code]}\n"
code << "error code: #{error[:code]}\n"
end
code
end
Expand Down