Answer the question
In order to leave comments, you need to log in
Can the following code work?
There is a class method with a declaration
def create(time: nil, user: nil, event: nil, status: nil, user_ip: nil)
body = YAML.load(yaml_body)
success, status = SomeLib::SomePart::SomeClass.create(body)
{"eventMillis"=>"12340981201", "userLogin"=>"someUser", "typeCode"=>"USR_AUTH", "resultCode"=>"SUCCESS", "ipAddress"=>"127.0.0.1"}
Answer the question
In order to leave comments, you need to log in
Can not. Or the keys in the hash should be named the same as the parameters:
Or you have to manually describe each parameter:
success, status = SomeLib::SomePart::SomeClass.create(time: body['eventMillis'], user: body['userLogin'], event: body['typeCode'], status: body['resultCode'], user_ip: body['ipAddress'])
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question