require 'api' def swap_option_to(list) if list == 'user' opt[:user] = true opt[:app] = false else opt[:user] = false opt[:app] = true end end def parameter_for(object_type) if object_type == 'app' { object: {api_key: 'an api_key'}, option: {user: false,app: true} } else {object: {login: 'a login',password: 'a password'}, option: {user: true,app: false} } end end def bad_parameter_for(object_type) if object_type == 'user' {object: {login: 'not a login',password: 'not a password'}, option: {user: true,app: false} } else {object: {api_key: 'not an api_key'}, option: {user: false,app: true} } end end