fluke/devops-service/app/api3/parsers/key.rb

20 lines
546 B
Ruby
Raw Normal View History

2015-07-30 15:37:43 +03:00
require_relative "request_parser"
module Devops
2018-04-04 22:44:39 +03:00
module API3
2015-07-30 15:37:43 +03:00
module Parser
class KeyParser < RequestParser
def create
key = create_object_from_json_body
fname = check_filename(key["file_name"], "Parameter 'file_name' should be a not empty string")
2015-07-30 15:37:43 +03:00
kname = check_string(key["key_name"], "Parameter 'key_name' should be a not empty string")
content = check_string(key["content"], "Parameter 'content' should be a not empty string")
key
end
end
end
end
end