query
stringlengths 7
9.55k
| document
stringlengths 10
363k
| metadata
dict | negatives
sequencelengths 0
101
| negative_scores
sequencelengths 0
101
| document_score
stringlengths 3
10
| document_rank
stringclasses 102
values |
---|---|---|---|---|---|---|
POST /service_users POST /service_users.json | def create
@service_user = ServiceUser.new(service_user_params)
if @service_user.save
render json: @service_user, status: :created, location: @service_user
else
render json: @service_user.errors, status: :unprocessable_entity
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def post_users(users)\n self.class.post('https://api.yesgraph.com/v0/users', {\n :body => users.to_json,\n :headers => @options,\n })\n end",
"def CreateUser params = {}\n \n APICall(path: 'users.json',method: 'POST',payload: params.to_json)\n \n end",
"def create_user\n params = {\n :client_id => Swiftype.platform_client_id,\n :client_secret => Swiftype.platform_client_secret\n }\n post(\"users.json\", params)\n end",
"def create\n @user = @application.users.create(user_params)\n\n if @user.valid?\n render json: @user, status: :created, location: api_application_user_path(@application,@user)\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def create_user(params:)\n parse(JSON.parse(connection.post(\"users\", params.to_json).body))\n end",
"def user_create(username, email, password, tenant_id)\n\t\n\t\tuser = {\"user\" => {\"name\" => username, \"email\" => email, \"enabled\" => true, \"password\" => password, \"tenantid\" => tenant_id}}\n\t\n\t\tjson_string = JSON.generate(user)\n\t\n\t\tpost_call = Curl::Easy.http_post(\"#{@ip_address}:#{@port_2}/v2.0/users\", json_string\n\t\t) do |curl|\n\t\t\tcurl.headers['x-auth-token'] = @token\n\t\t\tcurl.headers['Content-Type'] = 'application/json'\n\t\tend\n\t\t\t\t\t\t\t\t\t \n\t\tparsed_json = JSON.parse(post_call.body_str)\n\t\t\n\t\tputs parsed_json\n\t\treturn parsed_json\n\tend",
"def post body=nil, headers={}\n @connection.post \"users.json\", body, headers\n end",
"def create\n user = User.create(user_params) \n render json: user, status: :created\n end",
"def create(options = {})\n request(:post, '/users.json', default_params(options))\n end",
"def create\n\t\t@user = User.new(users_params)\n\t\tif @user.save\n\t\t\tjson_response(@user, \"User is created Successfully.\")\n\t\telse\n\t\t\trender json: {message: @user.errors.full_messages.join(\" \")}, status: 400\n\t\tend\t\t\n\tend",
"def index\n @service_users = ServiceUser.all\n render json: @service_users\n end",
"def create\n @user = current_user.users.build(user_params)\n\n if @user.save\n render json: @user\n else\n @user_items = []\n end\n end",
"def create\n user = User.new(\n username: user_params[:username],\n password: user_params[:password])\n if user.save\n create_example_collection(user)\n render json: user, except: [:password_digest, :created_at, :updated_at]\n else\n render json: {errors: user.errors.full_messages}\n end\n end",
"def create\n r = @api.create_user(user_params)\n respond_to do |format|\n if r.code == 201\n format.html { redirect_to users_url, notice: 'User was successfully created.' }\n else\n response = JSON.parse(r.body)\n format.html { redirect_to users_url, alert: response['message']}\n end\n end\n end",
"def create\n @user = User.new(form_params)\n\n respond_to do |format|\n if @user.save\n format.json { render json: { users: @user }, status: :created }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_user(name, value)\n self.class.post(\"/users/#{name}\",\n body: value,\n headers: {\n 'Content-Type' => 'application/json; charset=UTF-8',\n Connection: 'keep-alive',\n Accept: 'application/json, text/plain, */*'\n })\n end",
"def create\n\n up = user_params\n\n if up[:name].present?\n up[:first_name] = up[:name].split(' ')[0]\n up[:last_name] = up[:name].split(' ')[1]\n up.delete :name\n end\n @user = User.new(up)\n\n respond_to do |format|\n if @user.save\n # render json: {user: user, token: token}\n\n format.html { redirect_to @user, notice: 'User was successfully created.' }\n format.json { render :show, status: :created, location: api_user_url(@user)}\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post_accounts(json_hash)\n @options = {:path => '/users.json',\n :body => json_hash[:json]}.merge(@options)\n\n request(\n :expects => 201,\n :method => :post,\n :body => @options[:body]\n )\n end",
"def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def mf_api_manually_add_user\n\n # Create new User\n user = User.new\n\n # Populate User\n user.clientid = params[:client_id]\n user.email = params[:email]\n\n user.save\n\n response = {\n success: true,\n message: 'New User Created!'\n }\n\n render json: response\n\n end",
"def create\n user = User.new(user_params)\n if user.save\n render json: user\n else\n render json: {errors: \"Cannot create user\"}, :status => 420\n end\n end",
"def create\n # render json: params\n render json: Users.create(params[\"user\"])\n end",
"def user_new_user(email, password, username, opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: UserApi#user_new_user ...\"\n end\n\n # verify the required parameter 'email' is set\n fail \"Missing the required parameter 'email' when calling user_new_user\" if email.nil?\n\n # verify the required parameter 'password' is set\n fail \"Missing the required parameter 'password' when calling user_new_user\" if password.nil?\n\n # verify the required parameter 'username' is set\n fail \"Missing the required parameter 'username' when calling user_new_user\" if username.nil?\n\n # resource path\n path = \"/user\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json', 'application/x-www-form-urlencoded']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n form_params[\"email\"] = email\n form_params[\"password\"] = password\n form_params[\"username\"] = username\n form_params[\"firstname\"] = opts[:'firstname'] if opts[:'firstname']\n form_params[\"lastname\"] = opts[:'lastname'] if opts[:'lastname']\n form_params[\"acceptsTOS\"] = opts[:'accepts_tos'] if opts[:'accepts_tos']\n form_params[\"referrerID\"] = opts[:'referrer_id'] if opts[:'referrer_id']\n form_params[\"country\"] = opts[:'country'] if opts[:'country']\n\n # http body (model)\n post_body = nil\n\n\n auth_names = []\n result = @api_client.call_api(:POST, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'User')\n if Configuration.debugging\n Configuration.logger.debug \"API called: UserApi#user_new_user. Result: #{result.inspect}\"\n end\n return result\n end",
"def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def create\n\n puts '-----------------------create in user controller'\n\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n\n end",
"def create\n user_details = params.permit(:first_name, :last_name, :email)\n success = User.create(user_details)\n\n render json: { success: success }\n end",
"def create\n @user = User.new(user_params)\n\n isSaveUser = UserService.createUser(@user)\n respond_to do |format|\n if isSaveUser\n format.html { redirect_to users_path, notice: Messages::CREATE_SUCCESSFUL }\n format.json { render :index, status: :created, location: @user }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(user_params(params))\n \n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def create\n user= User.create(user_params)\n render json: user\n end",
"def create\n @user = User.new user_params(params[:user])\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def create\n @user = User.new user_params(params[:user])\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def create\n user = User.new(user_params)\n render json: { status: 200, msg: 'User was created.', data: \"User Id #{user.id}\" } if user.save\n end",
"def create\n user = User.new(@user_info)\n if user.save && user.errors.empty?\n render json: { status: 200, data: UserSerializer.new(user).as_json }\n else\n render json: { status: 400, error: user.errors.full_messages }\n end\n end",
"def create(options = {})\n params.required(:login, :email, :password).accepts(:first_name, :last_name, :group_id).validate!(options)\n request(:post, '/users.json', default_params(options))\n end",
"def create\n @user = User.new(user_params(params))\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def create\n @user = User.new(user_params(params))\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def create\n @user = User.new(user_params)\n if @user.save\n render json: { user: @user, success: 'User registration successful' }\n else\n render json: { error: 'User registration unsuccessful' }\n end\n end",
"def publish_to_users\n data = { users: users }.merge!(payload)\n client.post('publishes/users', data)\n end",
"def create\n user = User.create(user_params)\n if user.valid?\n render json: user\n else\n render json: user.errors, status: :unprocessable_entity\n end\n end",
"def create\n @users = User.new(params[:user])\n\n respond_to do |format|\n if @users.save\n format.html { redirect_to @users, notice: 'Regist was successfully created.' }\n format.json { render json: @users, status: :created, location: @users }\n else\n format.html { render action: \"new\" }\n format.json { render json: @users.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user.as_json(only: [:email, :authentication_token]), status: :created\n else\n head(:unprocessable_entity)\n end\n end",
"def create\n @user = User.new(user_params)\n\n respond_to do |format|\n if @user.save\n format.json { render json: @user }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @service = current_user.services.build(service_params)\n respond_to do |format|\n if @service.save\n format.html { redirect_to dashboard_path, notice: 'Service was successfully created.' }\n format.json { render :show, status: :created, location: @service }\n else\n format.html { render :new }\n format.json { render json: @service.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_user(options = {})\n post :create, {:user => { :name => 'quire', :point_value => \"2\", :login => 'quire', :email => '[email protected]',\n :password => 'quire', :password_confirmation => 'quire' }.merge(options)}, {:user_id => \"1\"}\n end",
"def create_user(user,pass,firstname,lastname,sso_provider)\n\n # test_user = '[email protected]'\n # pass = 'akbvgdrz77'\n # firstname = 'J'\n # lastname = 'T'\n\n values = \"{\\\"writerId\\\": \\\"#{@writer_id}\\\", \\\"email\\\": \\\"#{user}\\\", \\\"password\\\": \\\"#{pass}\\\", \\\"firstName\\\": \\\"#{firstname}\\\", \\\"lastName\\\": \\\"#{lastname}\\\", \\\"ssoProvider\\\": \\\"#{sso_provider}\\\"}\"\n\n headers = {:x_storageapi_token => @kbc_api_token, :accept => :json, :content_type => :json}\n\n begin\n response = RestClient.post \"#{@api_endpoint}/users\", values, headers\n\n rescue Exception => msg\n\n puts msg\n #manager.clean_csv(variable_file,message)\n #manager.set_existing_variable_bulk(variable_file,$gd_pid)\n #puts message\n end\n\n return response\n\n end",
"def create\n\t\t@user = User.new(user_params)\n\t\tif @user.save\n\t\t\trender json: @user, status: :created, location: @user\n\t\telse\n\t\t\trender json: @user.errors, status: :unprocessable_entity\n\t\tend\n\tend",
"def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update \n if @service_user.update(service_user_params) \n render json: @service_user, status: :ok, location: @service_user\n else\n render json: @service_user.errors, status: :unprocessable_entity\n end\n end",
"def create\n @user = User.new(user_params)\n \n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def addservice\n\n @service = ServiceProvider.find_by(username: params[:serviceprovider][:username]);\n permitted = params[:serviceprovider].permit( :description, :category_id);\n @service.services.create(permitted);\n\n render json: @service\n\n\nend",
"def create\n user = User.create(user_params)\n render json: user, message: 'user succefully create', status: 200\n end",
"def users_post\n params = Rack::Request.new(@env).POST\n phone = params['phone']\n key = params['key']\n\n if phone_valid?(phone) && uuid_valid?(key)\n # Validate picture_id, first_name, last_name, and email\n picture_id = params['picture_id']\n error = picture_id_invalid_response!(picture_id)\n return error if error\n\n first_name = params['first_name']\n error = name_invalid_response!('First', first_name)\n return error if error\n\n last_name = params['last_name']\n error = name_invalid_response!('Last', last_name)\n return error if error\n\n email = params['email']\n error = email_invalid_response!(email)\n return error if error\n\n $pg.with do |pg|\n pg.exec_params('SELECT * FROM users_post($1, $2, $3, $4, $5)', [phone, key, first_name, last_name, email]) do |r|\n if r.num_tuples == 1\n user_id = r.getvalue(0, 0)\n body = {access_token: build_access_token(user_id, key)}\n if picture_id\n fields = Aws::S3::Resource.new.bucket('acani-chats').presigned_post({\n acl: 'public-read',\n content_length_range: 0..3145728,\n content_type: 'image/jpeg',\n key: \"users/#{user_id}/#{picture_id}.jpg\"\n }).fields\n body[:fields] = fields\n end\n return [201, body.to_json]\n end\n end\n end\n end\n set_www_authenticate_header\n [401, '{\"message\":\"Incorrect phone or key.\"}']\n end",
"def create\n result = access_token.post('/api/v1/users/create', {:email=>params[:email],:psw=>params[:password],:psw_conf=>params[:password_conf],:inbox=>params[:inbox]})\n display_api_response result\n respond_with(\"\",:location => :back)\n end",
"def create\n user = User.new(user_params)\n if user.save\n render :json => user, :status => :created\n else\n render :json => {:ok => false, :message => user.errors}, :status => :unprocessable_entity\n end\n end",
"def create_user\n @user = User.new(user_params)\n if @user.save\n render json: UserSerializer.new(@user).serialized_json\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def create\n user = User.new(user_params)\n if user.save\n render json: {status: \"Se creo el usuario\"}, status: :ok\n else\n render json: {status: \"Error al crear el usuario\", errors: user.errors }, status: :unprocessable_entity\n end\n end",
"def create_user(options = {})\n post \"/users\", options\n end",
"def create\n @user = User.create user_params\n \n if @user.save\n respond_with(@user) do |format|\n format.json {render}\n end\n end\n end",
"def create\n user = User.create!(user_params) # will raise an error if creation fails\n # call the authentication service\n auth_token = AuthenticateUser.new(user.email, user.password).call\n response = { message: Message.account_created, auth_token: auth_token}\n json_response(response, :created)\n end",
"def create\n @service = Service.new(params[:service])\n\n respond_to do |format|\n @service.user_id = current_user.account_id\n if @service.save\n format.html { redirect_to @service, notice: 'Service was successfully created.' }\n format.json { render json: @service, status: :created, location: @service }\n else\n format.html { render action: \"new\" }\n format.json { render json: @service.errors, status: :unprocessable_entity }\n end\n end\n end",
"def save_user\n client = create_db_client\n client.query(\"INSERT INTO users(name, email, password, bio) VALUES('#{@name}', '#{@email}', '#{@password}', '#{@bio}')\")\n \n id = client.last_id\n rawData = client.query(\"SELECT * FROM users WHERE id='#{id}'\")\n users = Array.new\n rawData.each do |data|\n user = {:id => data[\"id\"], :name => data[\"name\"] ,:email => data[\"email\"], :password => data[\"password\"], :bio => data[\"bio\"]}\n users << user\n end\n response = Response.new('success', 'success input user', users)\n return response.response_api\n end",
"def add_user_for_tenant(args = {}) \n post(\"/tenants.json/#{args[:tenantId]}/users\", args)\nend",
"def create\n\t\tputs user_params\n\t\tuser = User.new(user_params)\n\t\tif user.save\n\t\t\trender json: { user: user, status: :success }\n\t\telse\n\t\t\trender json: { status: :failure, errors: user.errors.full_messages.join('') }\n\t\tend\n\tend",
"def create\n user_response = API::V1::Users.authenticate params.as_json\n if user_response.success?\n json = HashWithIndifferentAccess.new(user_response.parsed_response)\n auth_response = API::V1::Auth.issue json[:data]\n respond_with auth_response.body, auth_response.code\n else\n respond_with nil, :unauthorized\n end\n end",
"def create\n\t\tnew_user = User.new(user_params)\n\t\tif new_user.save\n\t\t render status: 200, json: {\n\t\t \tstatus: 200,\n\t\t message:\"New User Created\",\n\t\t response: {\n\t\t name: new_user.name,\n\t\t email: new_user.email,\n\t\t id: new_user.id,\n\t\t facebook_id: new_user.facebook_id,\n\t\t device_id: new_user.device_id,\n\t\t authentication_token: new_user.authentication_token\n\t\t }\n\t\t \n\t\t }.to_json\n\t\telse\n\t\t render status: 404, json: {\n\t\t \tstatus: 404,\n\t\t errors: new_user.errors\n\t\t }.to_json\n\t\tend\n\tend",
"def post_users_with_http_info(users, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: UsersApi.post_users ...'\n end\n # verify the required parameter 'users' is set\n if @api_client.config.client_side_validation && users.nil?\n fail ArgumentError, \"Missing the required parameter 'users' when calling UsersApi.post_users\"\n end\n # resource path\n local_var_path = '/users'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(users) \n\n # return_type\n return_type = opts[:return_type] || 'User' \n\n # auth_names\n auth_names = opts[:auth_names] || ['Bearer']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UsersApi#post_users\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create_users(accountId, model) path = \"/api/v2/accounts/#{accountId}/users\"\n post(path, model, {}, AvaTax::VERSION) end",
"def create(user_id:, email: nil, phone: nil, password: nil, name: nil)\n path = '/users'\n\n if user_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"userId\"')\n end\n\n params = {\n userId: user_id,\n email: email,\n phone: phone,\n password: password,\n name: name,\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'POST',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::User\n )\n end",
"def create\n @user = User.new(user_params)\n\n if @user.save\n \tdata = { data: @user, status: :created, message: \"User was successfully created.\" }\n render :json => data\n else\n \tdata = { data: @user.errors, status: :unprocessable_entity }\n render :json => data\n end\n end",
"def create\n user = User.create(user_params)\n if user.save\n render json: user\n else\n render json: user.errors, status: :bad\n end\n end",
"def create\n @user = User.new(user_params)\n\n if @user.save\n render json: UserSerializer.new(@user).serialized_json\n else\n render json: { error: I18n.t('user_create_error') }, status: :unprocessable_entity\n end\n end",
"def create\n @user = User.new(params[:user])\n @user.status = 'active'\n\n respond_to do |format|\n if @user.save\n format.json { render :json => @user, :status => :created }\n format.html { redirect_to(users_path) }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @api_user = ApiUser.new(api_user_params)\n\n if @api_user.save\n render json: @api_user, status: :created, location: @api_user\n else\n render json: @api_user.errors, status: :unprocessable_entity\n end\n end",
"def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def create_usr\n user_reg = MobileUser.api(params[:usr_crt])\n render json: {errorMessage: user_reg[0], status: user_reg[1]}, status: 201\n end",
"def create\n user = User.new(user_params)\n\n respond_to do |format|\n if user.save\n render json: user, status: :ok\n else\n format.json { render json: user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n user = User.create(user_params)\n if user.valid?\n user.username.downcase\n @token = issue_token(user)\n list = List.create(name: user.username)\n list.user_id = user.id\n user.save\n list.save\n render json: { user: UserSerializer.new(user), jwt: @token }, status: :created \n else \n render json: { error: user.errors.full_messages }, status: :not_acceptable\n end \n end",
"def add_users(resource, users)\n users.each do |u|\n begin\n resource.add_user({ :user_name => u })\n rescue Aws::IAM::Errors::NoSuchEntity\n puts Colors.red(\"\\tNo such user #{u}!\")\n end\n end\n end",
"def create_user(body)\n post 'create_user', body\n end",
"def create\n\t\tresp = {} \n user = User.create(user_params)\n \tif user.valid?\n if user.save\n return render :json => user.as_json\n end\n end\n render json: user.errors.full_messages \n\tend",
"def create\n user = User.create!(user_params)\n auth_token = AuthenticateUser.new(user.email, user.password).call\n response = { message: Message.account_created, auth_token: auth_token , uid: user.id }\n json_response(response, :created)\n end",
"def add_user(user_data, name = nil, opts = { :client => GoodData.connection })\n generated_pass = rand(10E10).to_s\n domain_name = name || user_data[:domain]\n user_data = user_data.to_hash\n data = {\n :login => user_data[:login] || user_data[:email],\n :firstName => user_data[:first_name] || 'FirstName',\n :lastName => user_data[:last_name] || 'LastName',\n :password => user_data[:password] || generated_pass,\n :verifyPassword => user_data[:password] || generated_pass,\n :email => user_data[:email] || user_data[:login]\n }\n\n # Optional authentication modes\n tmp = user_data[:authentication_modes]\n if tmp\n if tmp.is_a? Array\n data[:authenticationModes] = tmp\n elsif tmp.is_a? String\n data[:authenticationModes] = [tmp]\n end\n end\n\n # Optional company\n tmp = user_data[:company_name]\n tmp = user_data[:company] if tmp.nil? || tmp.empty?\n data[:companyName] = tmp if tmp && !tmp.empty?\n\n # Optional country\n tmp = user_data[:country]\n data[:country] = tmp if tmp && !tmp.empty?\n\n # Optional phone number\n tmp = user_data[:phone]\n tmp = user_data[:phone_number] if tmp.nil? || tmp.empty?\n data[:phoneNumber] = tmp if tmp && !tmp.empty?\n\n # Optional position\n tmp = user_data[:position]\n data[:position] = tmp if tmp && !tmp.empty?\n\n # Optional sso provider\n tmp = user_data[:sso_provider]\n data['ssoProvider'] = tmp if tmp && !tmp.empty?\n\n # Optional timezone\n tmp = user_data[:timezone]\n data[:timezone] = tmp if tmp && !tmp.empty?\n\n c = client(opts)\n\n # TODO: It will be nice if the API will return us user just newly created\n begin\n url = \"/gdc/account/domains/#{domain_name}/users\"\n response = c.post(url, :accountSetting => data)\n rescue RestClient::BadRequest\n raise GoodData::UserInDifferentDomainError, \"User #{data[:login]} is already in different domain\"\n end\n\n url = response['uri']\n raw = c.get url\n\n # TODO: Remove this hack when POST /gdc/account/domains/{domain-name}/users returns full profile\n raw['accountSetting']['links'] = {} unless raw['accountSetting']['links']\n raw['accountSetting']['links']['self'] = response['uri'] unless raw['accountSetting']['links']['self']\n c.create(GoodData::Profile, raw)\n end",
"def add_user(opts)\n generated_pass = rand(10E10).to_s\n data = {\n :login => opts[:login] || opts[:email],\n :firstName => opts[:first_name] || 'FirstName',\n :lastName => opts[:last_name] || 'LastName',\n :password => opts[:password] || generated_pass,\n :verifyPassword => opts[:password] || generated_pass,\n :email => opts[:email] || opts[:login]\n }\n\n # Optional authentication modes\n tmp = opts[:authentication_modes]\n if tmp\n if tmp.is_a? Array\n data[:authenticationModes] = tmp\n elsif tmp.is_a? String\n data[:authenticationModes] = [tmp]\n end\n end\n\n # Optional company\n tmp = opts[:company_name]\n tmp = opts[:company] if tmp.nil? || tmp.empty?\n data[:companyName] = tmp if tmp && !tmp.empty?\n\n # Optional country\n tmp = opts[:country]\n data[:country] = tmp if tmp && !tmp.empty?\n\n # Optional phone number\n tmp = opts[:phone]\n tmp = opts[:phone_number] if tmp.nil? || tmp.empty?\n data[:phoneNumber] = tmp if tmp && !tmp.empty?\n\n # Optional position\n tmp = opts[:position]\n data[:position] = tmp if tmp && !tmp.empty?\n\n # Optional sso provider\n tmp = opts[:sso_provider]\n data['ssoProvider'] = tmp if tmp && !tmp.empty?\n\n # Optional timezone\n tmp = opts[:timezone]\n data[:timezone] = tmp if tmp && !tmp.empty?\n\n c = client(opts)\n\n # TODO: It will be nice if the API will return us user just newly created\n url = \"/gdc/account/domains/#{opts[:domain]}/users\"\n response = c.post(url, :accountSetting => data)\n\n url = response['uri']\n raw = c.get url\n\n # TODO: Remove this hack when POST /gdc/account/domains/{domain-name}/users returns full profile\n raw['accountSetting']['links'] = {} unless raw['accountSetting']['links']\n raw['accountSetting']['links']['self'] = response['uri'] unless raw['accountSetting']['links']['self']\n\n c.create(GoodData::Profile, raw)\n end",
"def users_api_create_with_http_info(email, password, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UsersAPIApi#users_api_create ...\"\n end\n \n # verify the required parameter 'email' is set\n fail \"Missing the required parameter 'email' when calling users_api_create\" if email.nil?\n \n # verify the required parameter 'password' is set\n fail \"Missing the required parameter 'password' when calling users_api_create\" if password.nil?\n \n # resource path\n path = \"/users\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'email'] = email\n query_params[:'password'] = password\n query_params[:'name'] = opts[:'name'] if opts[:'name']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = []\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = []\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'User')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UsersAPIApi#users_api_create\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create\n # Insert new user in database\n user = User.new(user_params)\n\n if user.save\n # On success, send token information to authenticate user\n token = create_token(user.id, user.username)\n render json: {status: 200, token: token, user: user}\n # render json: @user, status: :created, location: @user\n else\n render json: user.errors, status: :unprocessable_entity\n end\n end",
"def create\n @user = User.new(user_params)\n if @user.save\n render :ok, json: @user.to_json\n else\n @errors = @user.errors.full_messages\n render json: { message: @errors }, status: :unauthorized\n end\n end",
"def create\n group_ids = params[\"group_id\"]\n org_id = params[:organization_id]\n @user = User.new(full_name: params[:full_name], password: params[:password], password_confirmation: params[:password], email: params[:email], status: params[:status], staff_number: params[:employee_id], career_path: params[:career_path], team_leader_id: nil)\n @user.user_group_ids = group_ids\n @user.organization_id = org_id\n\n respond_to do |format|\n if @user.save\n format.json { render json: @user }\n else\n format.json { render json: @user.errors.messages, status: :unprocessable_entity }\n end\n end\n end",
"def new_user(username, password, full_name, email)\n representation = form_encoded({ \"user[name]\" => username,\n \"user[password]\" => password,\n \"user[full_name]\" => full_name,\n \"user[email]\" => email }) \n puts representation\n begin\n response = open(@service_root + '/users', :method => :post, \n :body => representation)\n puts \"User #{username} created at #{response.meta['location']}\"\n rescue OpenURI::HTTPError => e\n response_code = e.io.status[0].to_i\n if response_code == \"409\" # Conflict\n puts \"Sorry, there's already a user called #{username}.\"\n else\n raise e\n end\n end\n end",
"def create\n user = User.create!(user_params)\n session[:user_id] = user.id\n render json: user, status: :created\n end",
"def create\n @user = User.new(params[:user])\n\n if @user.save\n respond_to do |format|\n format.json { render :json => @user.to_json, :status => 200 }\n format.xml { head :ok }\n format.html { redirect_to :action => :index }\n end\n else\n respond_to do |format|\n format.json { render :text => \"Could not create user\", :status => :unprocessable_entity } # placeholder\n format.xml { head :ok }\n format.html { render :action => :new, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n user = User.new(user_params)\n if user.save\n render json: {status: 200, msg: 'User was created.'}\n else\n render json: {errors: user.errors.messages}\n end\n end",
"def create\n @user = User.new(user_params)\n @user.email = params[:email].downcase\n if @user.save\n render json: @user, status: 200\n else\n render json: { errors: @user.errors.full_messages }, status: 400\n end\n end",
"def create\n @user_user = User::User.new(user_user_params)\n\n respond_to do |format|\n if @user_user.save\n format.html { redirect_to @user_user, notice: 'User was successfully created.' }\n format.json { render :show, status: :created, location: @user_user }\n else\n format.html { render :new }\n format.json { render json: @user_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_user(attributes)\n post(\"/v1/users\", attributes)\n end",
"def create\n logger.debug user_params\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :ok\n else\n render json: @user.errors, status: :not_acceptable\n end\n end",
"def create\n @user = User.new(\n first_name: params[:first_name],\n last_name: params[:last_name],\n birth_date: params[:birth_date],\n height: params[:height],\n weight: params[:weight],\n user_name: params[:user_name],\n password: params[:password],\n password_confirmation: params[:password_confirmation],\n facebook_url: params[:facebook_url],\n twitter_url: params[:twitter_url],\n instagram_url: params[:instagram_url],\n address: params[:address],\n email: params[:email]\n ) \n if @user.save!\n render 'successful.json.jb', status: :created\n else\n render 'unsuccessful.json.jb', status: :bad_request\n end\n end",
"def create_user_and_login \n\t\tinsert_into :users, {\n\t\t\tid: 1 ,\n\t\t\tfirst_name: 'First',\n\t\t\tlast_name: 'Last',\n\t\t\tlogin: 'login',\n\t\t\tpassword: 'password',\n\t\t\trole_id: 1,\n\t\t\tuid: \"a\"\n\t\t}\n\n\t\tproxy.post( 'http://my.ownet/api/session',{\n\t\t\tlogin: 'login',\n\t\t\tpassword: 'password'\n\t\t}.to_json)\n\tend",
"def create\n @service = Service.new(service_params)\n @service.user_id = current_user.username\n @service.nombre = @service.nombre.upcase\n @service.tipo = @service.tipo.upcase\n @service.descripcion = @service.descripcion.upcase\n @service.ubicacion = @service.ubicacion.upcase\n\n respond_to do |format|\n if @service.save\n format.html { redirect_to services_url, notice: 'Service was successfully created.' }\n format.json { render :show, status: :created, location: @service }\n else\n format.html { render :new }\n format.json { render json: @service.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.69557995",
"0.69329315",
"0.68204945",
"0.66121256",
"0.6599712",
"0.65780985",
"0.65528244",
"0.6496241",
"0.64708954",
"0.6467669",
"0.64611936",
"0.64590675",
"0.6458734",
"0.64414996",
"0.64404505",
"0.63847053",
"0.6379412",
"0.63675886",
"0.6324089",
"0.632226",
"0.6284024",
"0.62775934",
"0.6274841",
"0.6272965",
"0.6272965",
"0.6272965",
"0.6253985",
"0.62519956",
"0.6245419",
"0.6245147",
"0.62348753",
"0.6232112",
"0.6232112",
"0.6211859",
"0.62096375",
"0.62039536",
"0.62038916",
"0.62038916",
"0.62032986",
"0.6202137",
"0.61945456",
"0.6188608",
"0.61612695",
"0.6158791",
"0.6158158",
"0.61463314",
"0.61403686",
"0.6138981",
"0.6129665",
"0.6128369",
"0.61265445",
"0.6125617",
"0.612087",
"0.611753",
"0.6116966",
"0.6112156",
"0.6103811",
"0.60979843",
"0.60933656",
"0.6086458",
"0.60816383",
"0.6080762",
"0.6080096",
"0.6079987",
"0.6079129",
"0.60755724",
"0.6068122",
"0.60583544",
"0.6057549",
"0.60535127",
"0.60510963",
"0.6043711",
"0.6041732",
"0.6028322",
"0.6023766",
"0.60212755",
"0.60183376",
"0.6016024",
"0.6009387",
"0.599814",
"0.59979236",
"0.59933746",
"0.59924906",
"0.59808433",
"0.59802085",
"0.59778345",
"0.59765303",
"0.5971869",
"0.5970847",
"0.5968079",
"0.5964375",
"0.5948883",
"0.59378195",
"0.5935405",
"0.5928963",
"0.59277964",
"0.59210414",
"0.59160334",
"0.5914436",
"0.59060097"
] | 0.7580152 | 0 |
PATCH/PUT /service_users/1 PATCH/PUT /service_users/1.json | def update
if @service_user.update(service_user_params)
render json: @service_user, status: :ok, location: @service_user
else
render json: @service_user.errors, status: :unprocessable_entity
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n user = @user_service.update_user(params[:id])\n render json: user, status: :ok\n end",
"def UpdateUser params = {}\n \n APICall(path: 'users.json',method: 'PUT',payload: params.to_json)\n \n end",
"def update\n render json: User.update(params[\"id\"], params[\"user\"])\n end",
"def update_users_password(args = {}) \n put(\"/users.json/backoffice/#{args[:userId]}/password/#{args[:password]}\", args)\nend",
"def update_users_password(args = {}) \n put(\"/users.json/backoffice/#{args[:userId]}/password/#{args[:password]}\", args)\nend",
"def update\n render json: Users.update(params[\"id\"], params[\"user\"])\n end",
"def updateUser\n options = {\n :body => params.to_json,\n :headers => {\n 'Content-Type' => 'application/json',\n 'Authorization' => request.headers['Authorization']\n }\n }\n results = HTTParty.put(\"http://192.168.99.101:4051/users/\"+@current_user[\"id\"].to_s, options)\n render json: results.parsed_response, status: results.code\n end",
"def modify_user(user)\n query_api_object Model::User, '/rest/user', user.to_hash, 'PUT'\n end",
"def update_user(options)\n patch(\"/user\", options, 3)\n end",
"def update_current_logged_in_user(args = {}) \n put(\"/users.json/current\", args)\nend",
"def update\n if @api_v1_user.update(api_v1_user_params)\n head :no_content\n else\n render json: @api_v1_user.errors, status: :unprocessable_entity\n end\n end",
"def update \n user = User.find(params[:id])\n # byebug\n user.update(user_params)\n\n render json: user\n end",
"def update_user_for_tenant(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/{tenantId}/users/{userId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update_current_logged_in_users_password(args = {}) \n put(\"/users.json/current/password\", args)\nend",
"def update_current_logged_in_users_password(args = {}) \n id = args['id']\n temp_path = \"/users.json/current/password\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"userId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update\n user = User.find_by(id: params[:id])\n user.update(user_params)\n render json: user\n end",
"def update\n if user.update(user_params)\n render json: user\n else\n render json: {errors: \"Cannot create user\"}, :status => 420\n end\n end",
"def update_many\n if @users.update_all(user_params)\n render json: @users, status: :ok, location: users_url\n else\n render json: @users.errors, status: :unprocessable_entity\n end\n end",
"def update\n \trespond_to do |format|\n if @user.update(user_params)\n format.json { render json: @user }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n\t \t\n end",
"def update\n user = User.find(params[:id])\n\n # Use update with user_params to do a mass-assignment update and save. \n if user.update_attributes(user_params)\n render json: user\n else \n render json: user.errors.full_messages, status: :unprocessable_entity\n end\n end",
"def modify_user(user)\n query_api_object User, \"/rest/user\", user.dump(), \"PUT\"\n end",
"def update\n respond_to do |format|\n if @engaged_user_service.update(engaged_user_service_params)\n format.html { redirect_to @engaged_user_service, notice: 'Engaged user service was successfully updated.' }\n format.json { render :show, status: :ok, location: @engaged_user_service }\n else\n format.html { render :edit }\n format.json { render json: @engaged_user_service.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n #@service is already loaded and authorized\n\n respond_to do |format|\n @service.user_id = current_user.account_id\n if @service.update_attributes(params[:service])\n format.html { redirect_to @service, notice: 'Service was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @service.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @user.id == current_api_user.id\n if @user.update(user_params)\n render json: @user.as_json(except: [:updated_at]), status: :ok\n else\n render json: @user.errors, status: :bad_request\n end\n else\n render json: '', status: :forbidden\n end\n end",
"def update\n user = User.find(params[:id])\n if user.update(params_user)\n render json: user, status: 200\n else\n render json: user.errors, status: 422\n end\n\n end",
"def update \n @current_user.update(user_params)\n render json: @current_user\n end",
"def update\n if @user.update(user_params)\n render json: @user\n else\n render json: {error: \"Could not update user\"}\n end\n end",
"def update\n user = find_user\n user.update!(user_params)\n render json: user\n end",
"def update_current_logged_in_user(args = {}) \n id = args['id']\n temp_path = \"/users.json/current\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"userId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def patch_user(user_id, body)\n raise Auth0::MissingUserId, 'Must supply a valid user_id' if user_id.to_s.empty?\n raise Auth0::InvalidParameter, 'Must supply a valid body' if body.to_s.empty? || body.empty?\n path = \"#{users_path}/#{user_id}\"\n patch(path, body)\n end",
"def update\n user = User.find(params[:id])\n user.update(user_params)\n if user.valid?\n render json: user\n else\n render json: user.errors\n end\n end",
"def update\n begin\n user = User.find(params[:user_id])\n if user.update(user_params)\n render json: { users: user }, status: :ok\n else\n render json: { errors: user.errors.messages }, status: 422\n end\n rescue => e\n render json: { errors: e.message }, status: 404\n end\n end",
"def user_update_me(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: UserApi#user_update_me ... opts: #{opts}\"\n end\n\n # resource path\n path = \"/user\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json', 'application/x-www-form-urlencoded']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n form_params[\"firstname\"] = opts[:'firstname'] if opts[:'firstname']\n form_params[\"lastname\"] = opts[:'lastname'] if opts[:'lastname']\n form_params[\"oldPassword\"] = opts[:'old_password'] if opts[:'old_password']\n form_params[\"newPassword\"] = opts[:'new_password'] if opts[:'new_password']\n form_params[\"newPasswordConfirm\"] = opts[:'new_password_confirm'] if opts[:'new_password_confirm']\n form_params[\"country\"] = opts[:'country'] if opts[:'country']\n form_params[\"pgpPubKey\"] = opts[:'pgp_pub_key'] if opts[:'pgp_pub_key']\n\n # http body (model)\n post_body = nil\n\n\n auth_names = []\n result = @api_client.call_api(:PUT, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'User')\n if Configuration.debugging\n Configuration.logger.debug \"API called: UserApi#user_update_me. Result: #{result.inspect}\"\n end\n return result\n end",
"def update\n respond_to do |format|\n if @user\n @user.active = false\n @user.pending = false\n @user.save\n end\n format.json { render json: {:status => :ok}}\n end\n end",
"def update\n respond_to do |format|\n if @user.update(form_params)\n format.json { render json: { users: @user }, status: :ok, location: @user }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def mf_api_user_update_tags\n\n # Get User From DB with client_id\n user = User.where(clientid: params[:client_id]).first\n\n # If user not found, return error response\n if user.empty?\n response = {\n success: false,\n message: 'User with ClientID not found'\n }\n\n render json: response\n end\n\n # Get the Infusionsoft contact info\n contact = Infusionsoft.data_load('Contact', user.clientid, [:Groups])\n\n # Update User Tags\n user.put('', {\n :client_tags => contact['Groups']\n })\n\n\n response = {\n success: true,\n message: 'User Tags Updated'\n }\n\n render json: response\n\n end",
"def update\n if @user.update(user_params)\n render json: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n if @user.update(user_params)\n render json: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user = User.find(params[:id])\n @user.name = params[:name]\n @user.email = params[:email]\n @user.password = params[:password]\n @user.photo = params[:photo]\n @user.role = params[:type]\n @user.save\n render json:@user\n end",
"def update\n @user = User.find(params[:id])\n @user.update(user_params)\n render json: @current_user\n end",
"def update \n user = User.where(:id => current_user.user)\n if user.update(user_params)\n render :json => {:user => user }\n else\n render :json => {:error => user.errors.full_messages.first}\n end\nend",
"def update\n user = User.find(params[:id])\n render json: { status: 200, msg: 'User details have been updated.' } if user.update(user_params)\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update(user_params)\n render json:@user\n else\n render json: { error: {code: 404, message: 'Invalid user' }}, status: :not_found\n end\n end",
"def update\n @user = selected_user\n if @user.update(users_params)\n render 'api/users/show'\n else\n render json: @user.errors.full_messages, status: 422\n end\n end",
"def update\n if @user.update(user_params)\n render json: @user, status: 200\n else\n render json: @user.errors, status: 422\n end\n end",
"def update\n @user = current_api_user\n unless @user.update(user_params)\n render json: { error: @user.errors.full_messages.to_sentence }, status: :not_found\n end\n end",
"def update_users_password_by_e_mail(args = {}) \n put(\"/users.json/backoffice/email/#{args[:email]}/password/#{args[:password]}\", args)\nend",
"def update_users_password_by_e_mail(args = {}) \n put(\"/users.json/backoffice/email/#{args[:email]}/password/#{args[:password]}\", args)\nend",
"def update\n @user = User.find(params[:id])\n\n if @user.update_attributes(params[:user])\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update_attributes(params[:user])\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n\t\tif @user.update(users_params)\n \t\tjson_response(@user, \"User Update Successfully.\")\n \telse\n \t\trender json: {message: @user.errors.full_messages.join(\" \")}, status: 400\n \tend\n\tend",
"def update\n @api_user = ApiUser.find(params[:id])\n\n if @api_user.update(api_user_params)\n head :no_content\n else\n render json: @api_user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update user_params(params[:user])\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user.update(user_params_update)\n json_response(@user)\n end",
"def update_user\n end",
"def update\n @user = User.find(params[:id])\n @user.name = params[:name]\n @user.email = params[:email]\n @user.password = params[:password]\n @user.photo = params[:photo]\n @user.save\n render json:@user\n end",
"def update_name(user_id:, name:)\n path = '/users/{userId}/name'\n .gsub('{userId}', user_id)\n\n if user_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"userId\"')\n end\n\n if name.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"name\"')\n end\n\n params = {\n name: name,\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'PATCH',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::User\n )\n end",
"def update\n respond_to do |format|\n if @v1_user.update(v1_user_params)\n format.html { redirect_to @v1_user, notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok, location: @v1_user }\n else\n format.html { render :edit }\n format.json { render json: @v1_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = current_org.users.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'user was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\t\tuser = User.find(params[:id])\n if user\n if @current_user.id == user.id\n \n user.encrypted_password = nil if params[:password]\n user.password = params[:password] if params[:password]\n user.password_confirmation = params[:password_confirmation] if params[:password]\n user.first_name = params[:first_name] if params[:first_name]\n user.last_name = params[:last_name] if params[:last_name]\n \n if user.save()\n payload = {\n error: false,\n id: user.id\n }\n render status: 200, json: payload\n else\n errors = []\n user.errors.keys.each do |key|\n errors << {field: key, message: user.errors.full_messages_for(key).first}\n end\n payload = {\n error: true,\n errors: errors\n }\n render status: 200, json: payload\n end\n else\n render status: 403\n end\n else\n render status: 404\n end\n\tend",
"def update\n if @user.update(user_params)\n render json: @user, status: :ok\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update(params[:user])\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if user.update(user_params)\n render json: user, status: :ok\n else\n format.json { render json: user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n service.update(service_params)\n\n respond_with(service)\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes_from_api(params[:user])\n format.html { redirect_to @user, :notice => 'User was successfully updated.' }\n format.json { render_for_api :user, :json => @user }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_user\n user = current_user\n if user.update(update_params)\n render json: { status: { updated: \"Ok\" } }\n else\n render json: user.errors.full_messages\n end\n end",
"def update(context, name, should)\n res = context.transport.put_request(context, \"security/users/#{name}\", keys_to_camelcase(should))\n\n context.err(name, res.body) unless res.success?\n end",
"def update\n @user = User.find(params[:id]) \n \n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to users_url, notice: 'User #{@user.name} was successfully created.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if current_user.update(user_params)\n format.json {\n render json: {\n status: 'success',\n data: current_user\n },\n status: :ok\n }\n else\n format.json { render json: current_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { render action: \"edit\"}\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n \n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update(user_params(params[:user]))\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update_user\n @user = User.find(params[:id])\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status :unprocessable_entity\n end\n end",
"def update\n if @service.update(service_params)\n render json: @service, status: :ok, location: @service\n else\n render json: @service.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user.update(user_params)\n respond_with @user\n end",
"def users_id_patch_with_http_info(id, user_mod_req, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: UsersApi.users_id_patch ...'\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling UsersApi.users_id_patch\"\n end\n # verify the required parameter 'user_mod_req' is set\n if @api_client.config.client_side_validation && user_mod_req.nil?\n fail ArgumentError, \"Missing the required parameter 'user_mod_req' when calling UsersApi.users_id_patch\"\n end\n # resource path\n local_var_path = '/users/{id}'.sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(user_mod_req)\n auth_names = ['BrainPortalSession']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'User')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UsersApi#users_id_patch\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def test_user_update\n new_data = {\n 'OrgDefinedId' => 'ruby-test',\n 'FirstName' => 'Test-User',\n 'MiddleName' => 'changed',\n 'LastName' => 'Test',\n 'ExternalEmail' => nil, # Predefines user data, in the case that\n 'UserName' => 'test-ruby-user1234', # there is are variables left out in the JSON\n 'Activation' => {\n 'IsActive' => true\n }\n }\n user_id = get_user_by_username(new_data['UserName'])['UserId']\n update_user_data(user_id, new_data)\n end",
"def update\n\t\tif @user.update(user_params)\n\t\t\trender json: @user\n\t\telse\n\t\t\trender json: @user.errors, status: :unprocessable_entity\n\t\tend\n\tend",
"def update\n @user = current_user\n if @user.update(update_user_params)\n render 'api/v1/users/show'\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n\n @user = self.current_user\n @user.update_attributes(params)\n \n rescue => ex\n @user.reload\n handle_exception(ex)\n ensure\n respond_to do |format|\n format.json \n end\n end",
"def update\n @user = User.find(current_identity.user_id)\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if params.include?(:phone_number) and params.include?(:name) and params.include?(:address) and params.include?(:email) and params.include?(:description)\n phone_number = params[:phone_number]\n name = params[:name]\n address = params[:address]\n email = params[:email]\n description = params[:description]\n render json: update_user(phone_number, email, address, name, description)\n else\n result = {:success => false, :message => 'please check the paramaters'}\n render json: result\n end\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user = User.find(params[:id])\n @user.update_attributes(params[:user])\n respond_with @user\n end",
"def update\n @user = User.find(params[:id])\n @user.update_attributes(params[:user])\n respond_with @user\n end",
"def update\n user = User.find(params[:id])\n if @current_user._id == user._id\n if params[:user][:current_password]\n if @current_user.authenticate(params[:user][:current_password])\n if params[:user][:password] == params[:user][:password_confirmation]\n @current_user.update!(params.require(:user).permit(:password))\n auditLog(@current_user, nil, :UPDATE_COMPANY_USER, \"User: #{@current_user.name}/#{@current_user.email} password updated\")\n render json: { user: @current_user, token: @current_user.auth_token }, methods: [:type, :firstName, :lastName]\n else\n render :json => {error: I18n.t(:passwords_dont_match)}, :status => :bad_request\n end\n else\n render :json => {error: I18n.t(:invalid_pw)}, :status => :bad_request\n end\n else\n\n if @current_user.name != params[:user][:name].to_s || @current_user.email != params[:user][:email].to_s.downcase\n oldName = @current_user.name\n oldEmail = @current_user.email\n @current_user.assign_attributes(params.require(:user).permit(:name, :email))\n if @current_user.valid?\n @current_user.save\n render json: { user: @current_user, token: @current_user.auth_token }, methods: [:type, :firstName, :lastName]\n else\n render :json => {error: \"A user with that email already exists on our system. Please choose another email address.\"}, :status => :bad_request\n end\n else\n render json: { user: @current_user, token: @current_user.auth_token }, methods: [:type, :firstName, :lastName]\n end\n end\n else\n render :json => {error: I18n.t(:invalid_user)}, :status => :unauthorized\n end\n end",
"def update\n @user = User.find(params[:id])\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to v1_resources_users_path(username: @user.username), notice: 'User was updated.' }\n format.json { render json: @user, status: :ok }\n else\n format.html { render(file: Rails.root.join('public', '422'), :formats => [:html], status: 422, layout: false) }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def custom_update\n user = User.find(params[:id])\n user.update_attributes(params[:user])\n render :text => true\n end",
"def update\n respond_to do |format|\n @user = ContactService.update(@user, user_params, current_user, root_user)\n @profile = @user.profile\n if @user.errors.empty?\n format.html { redirect_to params[:original_url].presence || contacts_url, notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok, location: @user }\n else\n format.html do\n if @user.errors[:existing].any?\n @user.skip_existing_checking = true\n render :add_existing_contact\n else\n render :edit\n end\n end\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n UserComposite.new( user_params.merge(id: params[:id]) ).update!\n render json: StatusSerializer.new(:accepted), status: :accepted\n rescue ActiveRecord::RecordInvalid => ex\n render json: UserSerializer.new( ex.record ), status: :unprocessable_entity\n end",
"def update\n @todo = Todo.find(params[:todo][:id])\n if @todo.update_attributes(user_params)\n render json: @todo\n else\n render nothing: true, status: :bad_request\n end\n end",
"def update\n user = User.find(params[:id])\n if user.update(user_params)\n render json: {\n status: 'OK',\n msg: 'User details have been updated.',\n error: 'nil'\n }, status: :accepted\n else\n not_good(406)\n end\n end",
"def update_user(user, options = {})\n put \"/users/#{user}\", options\n end",
"def update\n respond_to do |format|\n if @service.update(service_params)\n format.html { redirect_to [current_user,@service], notice: 'Service was successfully updated.' }\n format.json { render :show, status: :ok, location: @service }\n else\n format.html { render :edit }\n format.json { render json: @service.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(id, params = {})\n request(:put, \"/users/#{id}\", body: params)\n end",
"def update\n @user = get_user(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to root_url, notice: \"User #{@user.login_name} was successfully updated.\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update(user_params(params))\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update(user_params(params))\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n user_params.delete(:password) if user_params[:password].nil? || user_params[:password] == \"\"\n r = @api.update_user(params[:id], user_params)\n respond_to do |format|\n if r.code == 204\n format.html { redirect_to users_url, notice: 'User was successfully updated.' }\n else\n response = JSON.parse(r.body)\n format.html { redirect_to users_url, alert: response['message']}\n end\n end\n end"
] | [
"0.69742674",
"0.67773587",
"0.67094237",
"0.670239",
"0.670239",
"0.66780007",
"0.65648985",
"0.6509665",
"0.6477369",
"0.6437504",
"0.64248335",
"0.63967645",
"0.6326177",
"0.63003695",
"0.6294038",
"0.629348",
"0.62759894",
"0.62737566",
"0.6265825",
"0.626577",
"0.6263258",
"0.6259776",
"0.62570566",
"0.62413245",
"0.62193394",
"0.6215906",
"0.61996865",
"0.61932814",
"0.6191609",
"0.6189502",
"0.6187069",
"0.6181829",
"0.616765",
"0.61635375",
"0.6162775",
"0.6160379",
"0.6148881",
"0.6148881",
"0.6130247",
"0.612091",
"0.61184245",
"0.61165",
"0.61105996",
"0.6110555",
"0.610393",
"0.6097744",
"0.6096608",
"0.6096608",
"0.60935193",
"0.60935193",
"0.6088194",
"0.6080633",
"0.6068992",
"0.60649925",
"0.606009",
"0.60538274",
"0.60476416",
"0.60222715",
"0.60217905",
"0.6010147",
"0.6006531",
"0.60041136",
"0.6002883",
"0.59995604",
"0.59989095",
"0.59918225",
"0.59911674",
"0.59855443",
"0.5980913",
"0.59807557",
"0.5976908",
"0.5970642",
"0.59642726",
"0.59603685",
"0.59573525",
"0.5956579",
"0.5952999",
"0.5952139",
"0.59470296",
"0.59417254",
"0.59396815",
"0.59393233",
"0.59393233",
"0.59335184",
"0.59335184",
"0.59295124",
"0.5922563",
"0.59173906",
"0.5915883",
"0.5915532",
"0.5914962",
"0.5909446",
"0.5898404",
"0.5898225",
"0.5894367",
"0.58927506",
"0.5892301",
"0.58920085",
"0.58920085",
"0.58905685"
] | 0.7038933 | 0 |
DELETE /service_users/1 DELETE /service_users/1.json | def destroy
@service_user.destroy
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def DeleteUser id\n \n APICall(path: \"users/#{id}.json\",method: 'DELETE')\n \n end",
"def delete_user_for_tenant(args = {}) \n delete(\"/tenants.json/#{args[:tenantId]}/users/#{args[:userId]}\", args)\nend",
"def delete(id)\n request(:delete, \"/users/#{id}.json\")\n end",
"def remove_user\n query_api '/rest/user', nil, 'DELETE'\n end",
"def delete\n render json: User.delete(params[\"id\"])\n end",
"def delete\n @user.destroy\n respond_to do |format|\n format.html { redirect_to v1_resources_users_all_path, notice: 'User was deleted.' }\n format.json { head :no_content }\n end\n end",
"def user_management_delete_user id\n # the base uri for api requests\n query_builder = Configuration.BASE_URI.dup\n\n # prepare query string for API call\n query_builder << \"/v1/users\"\n\n # process optional query parameters\n query_builder = APIHelper.append_url_with_query_parameters query_builder, {\n \"id\" => id,\n \"client_id\" => @client_id,\n \"client_secret\" => @client_secret,\n }\n\n # validate and preprocess url\n query_url = APIHelper.clean_url query_builder\n\n # prepare headers\n headers = {\n \"user-agent\" => \"IAMDATA V1\",\n \"accept\" => \"application/json\"\n }\n\n # invoke the API call request to fetch the response\n response = Unirest.delete query_url, headers:headers\n\n # Error handling using HTTP status codes\n if response.code == 404\n raise APIException.new \"Not found\", 404, response.raw_body\n elsif response.code == 401\n raise APIException.new \"Unauthorized\", 401, response.raw_body\n elsif !(response.code.between?(200,206)) # [200,206] = HTTP OK\n raise APIException.new \"HTTP Response Not OK\", response.code, response.raw_body\n end\n\n response.body\n end",
"def delete_user\n service_response = AdminManagement::Users::DeleteUser.new(params).perform\n render_api_response(service_response)\n end",
"def user_delete(user_id)\n\t\tdelete_call = Curl::Easy.http_delete(\"#{@ip_address}:#{@port_2}/v2.0/users/#{user_id}\"\n\t\t) do |curl|\n\t\t\tcurl.headers['x-auth-token'] = @token\n\t\t\tcurl.headers['userId'] = user_id\n\t\tend\n\t\n\tend",
"def delete\n render json: Users.delete(params[\"id\"])\n end",
"def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to user_services_url(@user), notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete(user_id:)\n path = '/users/{userId}'\n .gsub('{userId}', user_id)\n\n if user_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"userId\"')\n end\n\n params = {\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'DELETE',\n path: path,\n headers: headers,\n params: params,\n )\n end",
"def call(id)\n client.delete(\"/api/rest/v1/users/#{id}.json\")\n true\n end",
"def destroy\n @v1_user.destroy\n respond_to do |format|\n format.html { redirect_to v1_users_url, notice: 'User was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n @user = User.find(params[:id])\n @user.rvsps.delete_all()\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @engaged_user_service.destroy\n respond_to do |format|\n format.html { redirect_to engaged_user_services_url, notice: 'Engaged user service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = V1::User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(v1_users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n render json:@user\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n render json:@user\n end",
"def destroy\n debugger\n @user.destroy\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def delete_users\n delete(users_path)\n end",
"def destroy\n @user = User.find_by_id_or_username params[:id]\n @user.destroy\n render api_delete @user\n end",
"def destroy\n @user = User.find(params[:user_uuid])\n @user.destroy\n head :ok\n end",
"def delete_user\n @user = User.find(params[:id])\n if @user.destroy\n render :json => @user\n else\n render :json => @user.errors.full_messages\n end\n end",
"def destroy\n \"\"\"\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n \"\"\"\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @user.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find_by_id(params[:id])\n @user.destroy\n render :json=>{:status =>t('users.destroy.success')}\n end",
"def destroy\n @user = User.find_by_id(params[:id])\n @user.destroy\n render :json=>{:status =>t('users.destroy.success')}\n end",
"def destroy\n HerosUsers.destroy_all(:user_id => @user.id)\n @user.destroy\n respond_to do |format|\n format.html { redirect_to users_url, notice: 'User was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_user.destroy\n\n head :no_content\n end",
"def delete user_id, options={}, headers={}\n @connection.delete \"users/#{user_id}.json\", options, headers\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n \n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = user.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user.destroy\n format.json { head :no_content }\n end",
"def destroy\n #@service is already loaded and authorized\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to services_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n User.cascade_delete(@user)\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n # not_found unless @user\n # @user = User.get(params[:id]) || not_found\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user=User.find(params[:id])\n @user.destroy\n \n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n user = User.find(params[:id]) # from url, nothing to do with table\n user.destroy\n render json: user\n end",
"def destroy\n user = User.find(params[:id])\n if user.destroy\n render json: user\n else\n render json: user.errors\n end\n end",
"def delete_user\n client.delete(user)\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:user_id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = Foswipe::User.find(params[:id])\n @user.destroy\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to dm_core.admin_users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.json { head :ok }\n end\n end",
"def destroy\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_path }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end"
] | [
"0.7489978",
"0.7185733",
"0.7168934",
"0.7121226",
"0.7101466",
"0.70768374",
"0.70529085",
"0.7050356",
"0.7033383",
"0.7012725",
"0.70116836",
"0.6996039",
"0.6969302",
"0.6953669",
"0.6939896",
"0.6936382",
"0.6932784",
"0.69278187",
"0.69278187",
"0.69192696",
"0.69159335",
"0.6901143",
"0.6899279",
"0.6879273",
"0.68684393",
"0.685743",
"0.6851354",
"0.68219143",
"0.68219143",
"0.6821358",
"0.6820155",
"0.681145",
"0.6810246",
"0.6806032",
"0.6799378",
"0.67985946",
"0.67946345",
"0.6784278",
"0.6776676",
"0.6776307",
"0.677538",
"0.67686754",
"0.6767236",
"0.67618066",
"0.67618066",
"0.67618066",
"0.67618066",
"0.67618066",
"0.67618066",
"0.67618066",
"0.67618066",
"0.67618066",
"0.67618066",
"0.67618066",
"0.67618066",
"0.67618066",
"0.67618066",
"0.67618066",
"0.67618066",
"0.67618066",
"0.6760887",
"0.67532593",
"0.6752615",
"0.67509806",
"0.6750611",
"0.6750611",
"0.67504305",
"0.6748304",
"0.67463136",
"0.673547",
"0.673547",
"0.673547",
"0.673547",
"0.673547",
"0.673547",
"0.673547",
"0.673547",
"0.673547",
"0.673547",
"0.673547",
"0.673547",
"0.673547",
"0.673547",
"0.673547",
"0.673547",
"0.673547",
"0.673547",
"0.673547",
"0.673547",
"0.673547",
"0.673547",
"0.673547",
"0.673547",
"0.673547",
"0.673547",
"0.673547",
"0.673547",
"0.673547",
"0.673547",
"0.673547"
] | 0.71482563 | 3 |
Use callbacks to share common setup or constraints between actions. | def set_service_user
@service_user = ServiceUser.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def setup_handler\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend"
] | [
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576",
"0.53124547",
"0.529654",
"0.5296262",
"0.52952296",
"0.52600986",
"0.52442724",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.5232394",
"0.523231",
"0.5227454",
"0.52226824",
"0.52201617",
"0.5212327",
"0.52079266",
"0.52050185",
"0.51754695",
"0.51726824",
"0.51710224",
"0.5166172",
"0.5159343",
"0.51578903",
"0.51522785",
"0.5152022",
"0.51518047",
"0.51456624",
"0.51398855",
"0.5133759",
"0.5112076",
"0.5111866",
"0.5111866",
"0.5110294",
"0.5106169",
"0.509231",
"0.50873137",
"0.5081088",
"0.508059",
"0.50677156",
"0.50562143",
"0.5050554",
"0.50474834",
"0.50474834",
"0.5036181",
"0.5026331",
"0.5022976",
"0.5015441",
"0.50121695",
"0.5000944",
"0.5000019",
"0.4996878",
"0.4989888",
"0.4989888",
"0.49864885",
"0.49797225",
"0.49785787",
"0.4976161",
"0.49683493",
"0.4965126",
"0.4958034",
"0.49559742",
"0.4954353",
"0.49535993",
"0.4952725",
"0.49467874",
"0.49423352",
"0.49325448",
"0.49282882",
"0.49269363",
"0.49269104",
"0.49252945",
"0.4923091",
"0.49194667",
"0.49174926",
"0.49173003",
"0.49171105",
"0.4915879",
"0.49155936"
] | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def service_user_params
params.require(:service_user).permit(:service_id, :user_id, :position, :approved, :expiration_date, :active, :vehicle_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def filtering_params\n params.permit(:email)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def url_whitelist; end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] | [
"0.6978086",
"0.6780264",
"0.6742658",
"0.6738813",
"0.67338693",
"0.65908474",
"0.6501793",
"0.6495506",
"0.64796513",
"0.64755446",
"0.6454826",
"0.6437561",
"0.6377127",
"0.63722163",
"0.6364058",
"0.63178706",
"0.62979764",
"0.62968165",
"0.62913024",
"0.6289789",
"0.6289145",
"0.62875307",
"0.6280997",
"0.62420976",
"0.62388235",
"0.6216686",
"0.62122375",
"0.6208949",
"0.619173",
"0.6176307",
"0.6173907",
"0.6170346",
"0.616111",
"0.6150513",
"0.6150023",
"0.61446756",
"0.6120429",
"0.6112975",
"0.6104845",
"0.6102966",
"0.6087884",
"0.6079323",
"0.60699135",
"0.60602236",
"0.60191786",
"0.60170597",
"0.60100305",
"0.6009527",
"0.60052776",
"0.60052776",
"0.600042",
"0.5999317",
"0.59933805",
"0.5991528",
"0.5991221",
"0.5990094",
"0.5979497",
"0.5966058",
"0.5958738",
"0.59579456",
"0.5957759",
"0.5956938",
"0.5951788",
"0.59511644",
"0.59423065",
"0.59373474",
"0.59361076",
"0.59361076",
"0.59331447",
"0.5928005",
"0.5924882",
"0.5924011",
"0.59169155",
"0.5908037",
"0.5907541",
"0.59061426",
"0.59056246",
"0.5897408",
"0.58960444",
"0.58951247",
"0.5893136",
"0.5892312",
"0.5890385",
"0.58853275",
"0.58801144",
"0.58784765",
"0.5872648",
"0.58682626",
"0.5867028",
"0.58661693",
"0.586578",
"0.58643955",
"0.5863193",
"0.58609086",
"0.5859997",
"0.5858935",
"0.5858632",
"0.5853379",
"0.5852741",
"0.584806",
"0.5847703"
] | 0.0 | -1 |
A caching oneofeachsort constructor. ==== Parameters kind Class name (string) of a scheduled resource. rid Id (string), selecting a resource instance. The two are combined and used as a unique tag in the DOM as id and class attributes as well as in server code. | def get_for( kind, rid )
tag = compose_tag( kind, rid )
# config[:rsrc_of_tag][ tag ] || self.new( kind, rid )
rsrc_of_tag[ tag ] || new( kind, rid )
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(rid)\n @rid = rid\n @units = rid[1..-1].to_i\n @free = @units\n @waiting_list = []\n @@resources[rid] = self\n end",
"def sort(&block)\n self.class.new(super(&block), type: @type, api_client: @api_client)\n end",
"def sort_results(results)\n case @metadata[:sort]\n when \"new\"\n results.sort_by do |c|\n [c.set.regular? ? 0 : 1, -c.release_date_i, c.default_sort_index]\n end\n when \"old\"\n results.sort_by do |c|\n [c.set.regular? ? 0 : 1, c.release_date_i, c.default_sort_index]\n end\n when \"newall\"\n results.sort_by do |c|\n [-c.release_date_i, c.default_sort_index]\n end\n when \"oldall\"\n results.sort_by do |c|\n [c.release_date_i, c.default_sort_index]\n end\n when \"cmc\"\n results.sort_by do |c|\n [c.cmc ? 0 : 1, -c.cmc.to_i, c.default_sort_index]\n end\n when \"pow\"\n results.sort_by do |c|\n [c.power ? 0 : 1, -c.power.to_i, c.default_sort_index]\n end\n when \"tou\"\n results.sort_by do |c|\n [c.toughness ? 0 : 1, -c.toughness.to_i, c.default_sort_index]\n end\n when \"rand\"\n results.sort_by do |c|\n [Digest::MD5.hexdigest(@query_string + c.name), c.default_sort_index]\n end\n when \"number\"\n results.sort_by do |c|\n [c.set.name, c.number.to_i, c.number, c.default_sort_index]\n end\n when \"color\"\n results.sort_by do |c|\n [COLOR_ORDER.fetch(c.colors), c.default_sort_index]\n end\n when \"ci\"\n results.sort_by do |c|\n [COLOR_ORDER.fetch(c.color_identity), c.default_sort_index]\n end\n when \"rarity\"\n results.sort_by do |c|\n [-c.rarity_code, c.default_sort_index]\n end\n else # \"name\" or unknown key\n results.sort_by(&:default_sort_index)\n end\n end",
"def sort_entries=(_arg0); end",
"def initialize(entries, comparator)\n @entries = entries.sort_by(&comparator)\n @comparator = comparator\n end",
"def initialize(ids, type)\n @ids = ids.uniq\n @type = type\n end",
"def object_class_from_kind(kind)\n case kind\n when 't1'\n RedditKit::Comment\n when 't2'\n RedditKit::User\n when 't3'\n RedditKit::Link\n when 't4'\n RedditKit::PrivateMessage\n when 't5'\n RedditKit::Subreddit\n when 'LabeledMulti'\n RedditKit::Multireddit\n when 'LabeledMultiDescription'\n RedditKit::MultiredditDescription\n when 'modaction'\n RedditKit::ModeratorAction\n end\n end",
"def first\n self.class.where(id: rid).chronological.first\n end",
"def initialize()\r\n @entries = Set.new\r\n @entries_by_date = {}\r\n end",
"def sort_class_for(collection, attribute)\n return nil unless collection.sort_attribute == attribute.to_s\n if collection.sort_order.downcase == 'asc'\n ::Mincer.config.sorting.asc_class\n elsif collection.sort_order.downcase == 'desc'\n ::Mincer.config.sorting.desc_class\n else\n ''\n end\n end",
"def new_by(*args, &blk)\n new(*args).order_by(&blk)\n end",
"def sort_entries; end",
"def kind; end",
"def kind; end",
"def kind; end",
"def kind; end",
"def kind; end",
"def kind; end",
"def kind() @tag.sub( /_.*/, '' ) end",
"def kind() @tag.sub( /_.*/, '' ) end",
"def initialize\n @by_class = {}\n end",
"def sort!\n sort_if_needed\n self\n end",
"def own_class_method_objects sort: true\n class_method_objects false, sort: sort\n end",
"def crumbs_by\n crumb_or_custom_class.all(:creator_id => self[Redcrumbs.creator_primary_key], :order => [:created_at.desc])\n end",
"def sort!\n\t\tquick!(self, 1, length)\n\tend",
"def load_objects(dir_name, kind, klass)\n files(dir_name).map do |filename|\n # Read and parse data\n meta, content = *parse_file(filename, kind)\n\n # Get attributes\n attributes = {\n :filename => filename,\n :extension => File.extname(filename)[1..-1],\n :file => Nanoc3::Extra::FileProxy.new(filename)\n }.merge(meta)\n\n # Get actual identifier\n identifier = filename_to_identifier(filename, dir_name)\n\n # Get mtime\n mtime = File.stat(filename).mtime\n\n # Build item\n klass.new(content, attributes, identifier, mtime)\n end\n end",
"def sort_obj\n [@name, @version, Gem::Platform.sort_priority(@new_platform)]\n end",
"def initialize(attrs, collection_name, klass, client, id, method_name, method_options)\n @attrs = attrs\n @client = client\n\t\t\t@id = id\n @method_name = method_name\n @method_options = method_options\n @collection = Array(attrs[:data]).map do |item|\n if klass\n klass.fetch_or_new(item)\n else\n item\n end\n end\n class_eval do\n alias_method(:data, :collection)\n end\n end",
"def s_idsort; det.link(:text, 'ID'); end",
"def first\n self.class.where(:id => rid).order('lower(validity)').first\n end",
"def chronological\n wrap(\n sort do |a, b|\n Time.parse(a['created_at']) <=> Time.parse(b['created_at'])\n end,\n )\n end",
"def get_sort(collection, params)\n if params[:sort] && sort = cached_source(params[:sort])\n collection.joins(:results)\n .where(\"results.source_id = ?\", sort.id)\n .order(\"results.total DESC\")\n elsif params[:sort] == \"created_at\"\n collection.order(\"works.created_at ASC\")\n else\n collection.order(\"works.issued_at DESC\")\n end\n end",
"def initialize(collection={}, model = Occi::Model.new)\n collection = Hashie::Mash.new(collection) unless collection.kind_of? Occi::Collection\n\n @kinds = Occi::Core::Kinds.new\n @mixins = Occi::Core::Mixins.new\n @actions = Occi::Core::Actions.new\n @resources = Occi::Core::Resources.new\n @links = Occi::Core::Links.new\n\n @kinds.merge collection.kinds.to_a.collect { |kind| Occi::Core::Kind.new(kind.scheme, kind.term, kind.title, kind.attributes, kind.related, kind.actions, kind.location) }\n @mixins.merge collection.mixins.to_a.collect { |mixin| Occi::Core::Mixin.new(mixin.scheme, mixin.term, mixin.title, mixin.attributes, mixin.depends, mixin.actions, mixin.location, mixin.applies) }\n @actions.merge collection.actions.to_a.collect { |action| Occi::Core::Action.new(action.scheme, action.term, action.title, action.attributes) }\n @resources.merge collection.resources.to_a.collect { |resource| Occi::Core::Resource.new(resource.kind, resource.mixins, resource.attributes, resource.actions, resource.links, resource.location) }\n @links.merge collection.links.to_a.collect { |link| Occi::Core::Link.new(link.kind, link.mixins, link.attributes, link.actions, link.rel, link.target, link.source, link.location) }\n @action = Occi::Core::ActionInstance.new(collection.action.action, collection.action.attributes) if collection.action\n\n self.model = model if model\n end",
"def as_resource(options = {})\n links = self_link\n\n if is_collection?\n links[:web] = {\n :href => \"#{@@web_url}/#{pk}\"\n }\n end\n \n resource = {\n :id => pk,\n :accession => objectnumber,\n :sort_number => sortnumber,\n :sort_title => sort_title,\n :sort_name => sort_name,\n :constituents => constituents.map {\n |c| c.as_resource({'no_objects' => true, 'no_bio' => true})\n },\n :titles => titles.as_resource,\n :series => series == nil ? nil : series.as_resource,\n :dates => date_resource(datebegin, dateend, dated),\n :sites => sites.count > 0 ? sites.map {\n |s| s.as_resource({'no_objects' => true})} : nil,\n :movements => movements.count > 0 ? movements.map {\n |m| m.as_resource({'no_objects' => true})} : nil,\n :acquisition => acquisition != nil ? \n acquisition.as_resource({'no_objects' => true}) : nil,\n :exhibitions => exhibitions.count > 0 ? exhibitions.map {\n |e| {\n :location => location(e.pk) != nil ? location(e.pk).as_resource : nil,\n :exhibition => e.as_resource({'no_objects' => true})\n }\n } : nil,\n :edition => edition,\n :medium => medium,\n :dimensions => dimensions,\n :credit => creditline,\n :has_essay => has_essay?,\n :has_extended_label => has_essay?,\n :copyright => copyright,\n :current_location => current_location == nil ? \n nil : current_location.as_resource,\n :media => media.count > 0 ? media.map { |m|\n m.as_resource\n } : nil,\n :object_types => object_types.count > 0 ? object_types.map { |t|\n t.as_resource({'no_objects' => true})\n } : nil,\n :permanent_collection => permanent_collection?,\n :recent_acquisition => is_recent_acquisition?,\n :_links => links\n }\n\n if options['no_essay'] != 'true'\n resource[:essay] = essay\n resource[:extended_label] = extended_label\n end\n\n return resource\n end",
"def initialize sort_order = nil\n self.sort_order = sort_order\n end",
"def initialize(params={})\n name = init_collection_name params[:define_collection_name]\n @@_collection[self.class.name] ||= Schema.instance.get_collection(name)\n @id = params[:id] if params[:id]\n @__ref_value__ = '\"*\"'\n\n # @event_types = params[:event_types] ? params[:event_types] : []\n # @relation_kinds = params[:graphs] ? params[:graphs] : []\n\n @@_cache[self.class.name] ||= SimpleCacheRequest.new(ocollection)\n @@cache_store ||= SimpleCacheStore.instance\n end",
"def initialize(site, sort='count')\n @params = {url: site, sort: sort, of: 0*20}\n end",
"def index\n\n #the following sort order items are sorted by the model\n unless params[:id].nil?\n case true\n when params[:id] == \"model\"\n Classified.set_order_var( \" makes.name , models.name ASC \")\n @classifieds = Classified.available_sorted\n when params[:id] == \"stock_code\"\n Classified.set_order_var( params[:id] << \" ASC\")\n @classifieds = Classified.available_sorted\n when params[:id] == \"price_in_cents\"\n Classified.set_order_var( params[:id] << \" DESC\")\n @classifieds = Classified.available_sorted\n when params[:id] == \"colour\"\n Classified.set_order_var( params[:id] << \" ASC\")\n @classifieds = Classified.available_sorted\n when params[:id] == \"days_in_stock\"\n Classified.set_order_var( params[:id] << \" DESC \" )\n @classifieds = Classified.available_sorted\n when params[:id] == \"mileage\"\n Classified.set_order_var( params[:id] << \" DESC \" )\n @classifieds = Classified.available_sorted\n when params[:id] == \"views\" || params[:id] == \"forms_sent\" || params[:id] == \"conversions\"\n @classifieds = Classified.available\n end\n else\n Classified.set_order_var(\"\")\n @classifieds = Classified.available\n end\n\n\n #the following params[:id] values cause the array to be sorted as the values\n # to be sorted are added to the array programmatically\n unless params[:id].nil?\n case true\n when params[:id] == \"views\" \n @classifieds.sort! {|a, b| a.stats_count <=> b.stats_count}\n @classifieds.reverse!\n when params[:id] == \"forms_sent\"\n @classifieds.sort! {|a, b| a.form_count <=> b.form_count}\n @classifieds.reverse!\n when params[:id] == \"conversions\"\n @classifieds.sort! {|a, b| a.conversions.to_f <=> b.conversions.to_f}\n @classifieds.reverse!\n end\n end\n #@classifieds.reverse!\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @classifieds }\n end\n end",
"def sort_result_by(type = SortOption::ALPHABETICAL_CONST)\r\n find('div.resultList')\r\n page.execute_script(\"$('div.resultList div div select:first').css('display','block')\")\r\n element = find(:xpath, \".//select[@class='input-medium-sort-by requester chzn-done']\")\r\n id = element[:id]\r\n select type, from: id\r\n end",
"def initialize\n @schedule = []\n\n # pass self to the construction block and let the project load it's days\n # into the schedule\n yield(self)\n\n deduplicate\n sort\n assign_types\n end",
"def grouped_by_kind\n grouped = Hash.new {|h,k| h[k] = [] }\n all.each { |r| grouped[r.kind] << r }\n grouped\n end",
"def new\n\t\t@sort = Sort.new\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml { render :xml => @sort }\n\t\tend\n\tend",
"def initialize(attrs = {})\n # Tipo de Arma\n @kind = attrs[:tpArma]\n # Serie\n @serie = attrs[:nSerie]\n # Cano\n @barrel = attrs[:nCano]\n # Descricao\n @description = attrs[:descr]\n end",
"def index\n sort = case params[:sort]\n when \"title\" then \"title\"\n when \"started\" then \"started\"\n when \"done\" then \"done\"\n when \"initial_estimate\" then \"initial_estimate\"\n when \"title_reverse\" then \"title DESC\"\n when \"started_reverse\" then \"started DESC\"\n when \"done_reverse\" then \"done DESC\"\n when \"initial_estimate_reverse\" then \"initial_estimate DESC\"\n else \"title\"\n end\n \n @tasks = Task.all :order => sort\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :partial => \"tasks_list\", :layout => false }\n end\n end",
"def index\n @tickettypes = Define.where( :usetype => 'tickettype' ).order(\"sort asc, updated_at desc\")\n @tickettype = Define.new\n\n respond_to do |format|\n format.html # index.html.erb\n end\nend",
"def sti_list(klass)\n (klass.descendants << klass).sort_by(&:name)\n end",
"def initialize(cult,follower, date = Time.now.strftime(\"%Y/%m/%d\") )\n @cult = cult \n @follower = follower\n @@all << self\n @date = date\n\nend",
"def kind\n self.name.underscore.to_sym\n end",
"def kind\n self.name.underscore.to_sym\n end",
"def index\n if params[:sorttype] == 'programming'\n @tasks = Task.where(:status => \"todo\").where(:job_type => \"Programming\").page params[:page]\n if params[:sort] == 'updated_at'\n @tasks = @tasks.order(\"updated_at ASC\")\n elsif params[:sort] == 'name'\n @tasks = @tasks.order(\"LOWER(title) DESC\")\n elsif params[:sort] == 'name_reverse'\n @tasks = @tasks.order(\"LOWER(title) ASC\")\n else\n @tasks = @tasks.order(\"created_at ASC\")\n end\n elsif params[:sorttype] == 'music'\n @tasks = Task.where(:status => \"todo\").where(:job_type => \"Music\").page params[:page]\n if params[:sort] == 'updated_at'\n @tasks = @tasks.order(\"updated_at ASC\")\n elsif params[:sort] == 'name'\n @tasks = @tasks.order(\"LOWER(title) DESC\")\n elsif params[:sort] == 'name_reverse'\n @tasks = @tasks.order(\"LOWER(title) ASC\")\n else\n @tasks = @tasks.order(\"created_at ASC\")\n end\n elsif params[:sorttype] == 'art'\n @tasks = Task.where(:status => \"todo\").where(:job_type => \"Art\").page params[:page]\n if params[:sort] == 'updated_at'\n @tasks = @tasks.order(\"updated_at ASC\")\n elsif params[:sort] == 'name'\n @tasks = @tasks.order(\"LOWER(title) DESC\")\n elsif params[:sort] == 'name_reverse'\n @tasks = @tasks.order(\"LOWER(title) ASC\")\n else\n @tasks = @tasks.order(\"created_at ASC\")\n end\n elsif params[:sorttype] == 'story'\n @tasks = Task.where(:status => \"todo\").where(:job_type => \"Story\").page params[:page]\n if params[:sort] == 'updated_at'\n @tasks = @tasks.order(\"updated_at ASC\")\n elsif params[:sort] == 'name'\n @tasks = @tasks.order(\"LOWER(title) DESC\")\n elsif params[:sort] == 'name_reverse'\n @tasks = @tasks.order(\"LOWER(title) ASC\")\n else\n @tasks = @tasks.order(\"created_at ASC\")\n end\n elsif params[:sorttype] == 'level'\n @tasks = Task.where(:status => \"todo\").where(:job_type => \"Level\").page params[:page]\n if params[:sort] == 'updated_at'\n @tasks = @tasks.order(\"updated_at ASC\")\n elsif params[:sort] == 'name'\n @tasks = @tasks.order(\"LOWER(title) DESC\")\n elsif params[:sort] == 'name_reverse'\n @tasks = @tasks.order(\"LOWER(title) ASC\")\n else\n @tasks = @tasks.order(\"created_at ASC\")\n end\n elsif params[:sorttype] == 'puzzles'\n @tasks = Task.where(:status => \"todo\").where(:job_type => \"Puzzles\").page params[:page]\n if params[:sort] == 'updated_at'\n @tasks = @tasks.order(\"updated_at ASC\")\n elsif params[:sort] == 'name'\n @tasks = @tasks.order(\"LOWER(title) DESC\")\n elsif params[:sort] == 'name_reverse'\n @tasks = @tasks.order(\"LOWER(title) ASC\")\n else\n @tasks = @tasks.order(\"created_at ASC\")\n end\n elsif params[:sorttype] == 'misc'\n @tasks = Task.where(:status => \"todo\").where(:job_type => \"Miscellaneous\").page params[:page]\n if params[:sort] == 'updated_at'\n @tasks = @tasks.order(\"updated_at ASC\")\n elsif params[:sort] == 'name'\n @tasks = @tasks.order(\"LOWER(title) DESC\")\n elsif params[:sort] == 'name_reverse'\n @tasks = @tasks.order(\"LOWER(title) ASC\")\n else\n @tasks = @tasks.order(\"created_at ASC\")\n end\n else\n @tasks = Task.where(:status => \"todo\").page params[:page]\n if params[:sort] == 'updated_at'\n @tasks = @tasks.order(\"updated_at ASC\")\n elsif params[:sort] == 'name'\n @tasks = @tasks.order(\"LOWER(title) DESC\")\n elsif params[:sort] == 'name_reverse'\n @tasks = @tasks.order(\"LOWER(title) ASC\")\n else\n @tasks = @tasks.order(\"created_at ASC\")\n end\n end\n end",
"def sort\n @entries = DependencySorter.new(@entries).sorted_items\n end",
"def initialize(make, model, classification, owner)\n @make = make\n @model = model\n @classification = classification\n @owner = owner\n @@all << self\n end",
"def each( args )\n\t\tsortby = args.select{ |v| v =~ /^[\\+\\-].*$/ }\n\t\tfilters = args-sortby\n\t\tstatuses = filters.select{ |i| @options.status.include?( i ) }\n\t\t#statuses = filters.select{ |i| @tags.include?( i ) }\n\t\tif statuses.length > 0\n\t\t\tfiltered = @cache.select{ |i| statuses.include?( i.data.status ) }\n\t\telse\n\t\t\tfiltered = @cache\n\t\tend\n\t\tsorted = filtered\n\t\tif sortby.length > 0\n\t\t\tsort = sortby[0][1, 100]\n\t\t\tdir = '+'==sortby[0][0,1] ? 1 : -1\n\t\t\tputs \"#{dir} #{sort} #{sortby[0][0]}\"\n\t\t\tsorted = filtered.sort{ |a,b| dir * (a.data.send( sort )<=> b.data.send( sort )) } \n\t\tend\n\t\tsorted.each do |i|\n\t\t\tyield( i )\n\t\tend\n\tend",
"def initialize(title, presenter, date_time, time, genre, venue, link)\n @title = title\n @presenter = presenter\n @date_time = []\n @date_time << date_time\n @genre = genre\n @venue = venue\n @link = link\n @@all << self\n end",
"def initialize(direct)\n\n super direct\n\n @members_by_id = @direct.members\n .map { |member| [member.id, Member.new(member)] }\n .to_h\n\n @lists_by_id = @direct.lists\n .select { |trello_list| trello_list.name =~ ALL_LISTS_RE }\n .map { |trello_list| [trello_list.id, List.new(self, trello_list)] }\n .to_h\n\n @cards_by_id = @lists_by_id.values\n .map { |list| list.cards }\n .flatten\n .map { |card| [card.id, card] }\n .to_h\n\n @cards_by_member_id = @cards_by_id.values.each_with_object({}) { |card, all|\n card.members.each { |member|\n all[member.id] ||= []\n all[member.id] << card\n }\n }\n\n end",
"def set_sort_type\n @sort_type = SortType.find(params[:id])\n end",
"def resources_by_type(ast)\n result = Hash.new{|hash, key| hash[key] = Array.new}\n find_resources(ast).each{|resource| result[resource_type(resource)] << resource}\n result\n end",
"def resources_by_type(ast)\n result = Hash.new{|hash, key| hash[key] = Array.new}\n find_resources(ast).each{|resource| result[resource_type(resource)] << resource}\n result\n end",
"def sort_by(ivar=:created, opts={})\n \n ivars = {\n :id => :@id,\n :screen_name => :@screen_name,\n :sn => :@screen_name,\n :time => :@created_at,\n :created => :@created_at,\n :name => :@name,\n :favorites => :@favourites_count,\n :statuses => :@statuses_count,\n :followers => :@followers_count,\n :following => :@following\n }\n\n page = opts[:page] ? opts[:page] : 1\n page_size = opts[:page_size] ? opts[:page_size] : 10\n dir = opts[:dir] ? opts[:dir] : :desc\n\n if ! ivars[ivar]\n raise ArgumentError, \"#{ivar} is not a valid argument for sort_by.\"\n else\n output = all.sort do |x,y|\n y.info.instance_variable_get(ivars[ivar]) <=> x.info.instance_variable_get(ivars[ivar])\n end\n output.reverse! if dir == :asc\n starts, ends = ((page_size * page) - page_size), (page_size * page)\n \n return output[starts, ends]\n end\n end",
"def sort_id\n self.id\n end",
"def initialize(id, name)\n self.src_id = id\n self.src_name = name\n self.categories = ({})\n self.num_previous_wrs = 0\n self.num_submitted_runs = 0\n self.total_time_overall = 0\n end",
"def initialize(filename, size, md5, kind)\n @filename = filename\n @size = size\n @md5 = md5\n @kind = kind\n end",
"def set_sorting\n @sorting = Sorting.find(params[:id])\n end",
"def set_kind\n @kind = Kind.find(params[:id])\n end",
"def as_resource()\n # Titles might have NULL, 0 (not assigned), or 7 (multiple) as \n # the language. Return nil for all of these\n resource = {\n :title => title,\n :language => [nil, 0, 7].include?(languageid) ? nil : \n languages.codes.language_code,\n :type => titletypes.titletype,\n :order => displayorder,\n :prepend => nil,\n :append => nil\n }\n\n # These titletypes are use to indicate the phrasing of a series \n # title\n #\n # 7 = from the series X\n # 15 = from the X series \n # 16 = from X\n #\n # We'll break that up into a phrase to prepend and/or append to the \n # title when it is displayed\n if [7, 15, 16].include?(titletypeid)\n resource[:type] = \"Series\"\n phrase = titletypes.titletype.match(/\\((.+)\\)/)\n if phrase == nil\n raise UnknownSeriesFormatError, \"Cannot parse series title format \\\"#{collection_tms_titletypes.titletype}\\\"\"\n end\n\n affixes = phrase[1].match(/^(.+)?(X)(.+)?$/)\n if affixes[1] != nil\n resource[:prepend] = affixes[1].strip\n end\n\n if affixes[3] != nil\n resource[:append] = affixes[3].strip\n end\n end\n \n resource\n end",
"def get_sort_cat\n \t\tif @sort == 'data'\n \t\t\treturn 'created_at'\n \t\telsif @sort == 'cheapest'\n \t\t\treturn 'price'\n \t\telse\n \t\t\treturn 'price desc' \t\t\n \t\tend\n \tend",
"def initialize\n @title\n @@all << self\n end",
"def initialize(title, kind, date = nil)\n @title = title\n @kind = kind\n @date = date\n @table_name = nil\n @total_pot = 0.0\n @rake = 0.0\n @blinds_amounts = { :bb => 0, :sb => 0, :ante => 0 }\n @max_players = 0\n @button_seat = -1\n @actions = []\n @players = []\n @events = []\n @summary_events = []\n @hero = nil\n @limit = 'NL'\n end",
"def index\n puts \"params are #{params}\"\n sortby = params[\"sort\"]\n puts \"sort is #{sortby} is it an attribute? #{PaldemicFile.has_attribute? sortby}\"\n #if nothing is passed in, default to total_votes\n sortby ||= \"total_votes\"\n @paldemic_files = PaldemicFile.all\n if(!PaldemicFile.method_defined? sortby) && (!PaldemicFile.has_attribute? sortby)\n #if what is passed in is total gargbage , total votes\n puts \"couldn't find #{sortby} so using total votes instead\"\n sortby ||= \"total_votes\"\n end\n reverse = params[\"reverse\"] == \"true\"\n puts \"reverse is #{reverse}\"\n @paldemic_files = PaldemicFile.sortShenanigans(@paldemic_files, sortby,reverse)\n\n end",
"def sort_links\n resource_service.sortable_fields.collect do |key,value|\n \tlink_to key, params.dup.update(:sort => key), :class => ((params[:sort].to_s==key.to_s) ? 'current' : '')\n end.join(' | ')\n end",
"def initialize\n self.title = nil\n self.url = nil\n self.description = nil\n self.updated_at = nil\n self.entries = []\n end",
"def comparable_runs(timing, run)\n case timing\n when Run::REAL\n Run.where(\n id: runs.select('realtime_duration_ms, MAX(id) AS id')\n .group(:realtime_duration_ms)\n .where(category: run.category)\n .map(&:id)\n ).order(realtime_duration_ms: :asc)\n when Run::GAME\n Run.where(\n id: runs.select('gametime_duration_ms, MAX(id) AS id')\n .group(:gametime_duration_ms)\n .where(category: run.category)\n .map(&:id)\n ).order(gametime_duration_ms: :asc)\n end\n end",
"def initialize (attributes = {})\n @id = attributes[:id]\n @title = attributes[:title]\n @description = attributes[:description]\n @file = attributes[:file]\n @owner_id = attributes[:owner_id]\n if !attributes[:date].blank?\n @date = attributes[:date]#milliseconds passed since epoch Jan/1/1970\n else\n @date = Util.date_to_epoch(Time.now.strftime(I18n.t(:date_format_ruby)))\n end\n end",
"def initialize(kind, klass_name, klass)\n @kind = kind\n @klass_name = klass_name\n @klass = klass\n end",
"def tie_breaking_sort\n { \"content_id\" => { order: \"asc\" } }\n end",
"def sort\n self[:sort]\n end",
"def index\n if params[\"sort\"] == 'name'\n @tasks = Task.all.order('title ASC')\n elsif params[:sort] == 'created_at'\n @tasks = Task.all.order(:created_at)\n else\n @tasks = Task.all.order('title ASC')\n end\n end",
"def find_sorted_entries_by_timelimit(section, oldest,limit)\n # entries = record.send(section).any_of([:time.gt => e], [:start_time.gt => e]).limit(limit)\n entries = send(section).timelimit(oldest).limit(limit)\n now = Time.now\n recs = entries.to_a\n recs.sort! do |x, y|\n t1 = x.time || x.start_time || now.to_i\n t2 = y.time || y.start_time || now.to_i\n t2 <=> t1\n end\n recs\n end",
"def test_ut_t2_ars_arc_004\n create_ars_data(15)\n # sort with id\n arss = AnalyzeRuleConfig.paginate_ars(1,\"id\",\"ASC\" )\n if arss[1].id <= arss[2].id\n assert true\n else\n assert false\n end \n # sort with name\n arss = AnalyzeRuleConfig.paginate_ars(1,\"name\",\"ASC\" )\n if arss[1].name <= arss[2].name\n assert true\n else\n assert false\n end\n # sort with description\n arss = AnalyzeRuleConfig.paginate_ars(1,\"description\",\"ASC\" )\n if arss[1].description <= arss[2].description\n assert true\n else\n assert false\n end\n # sort with created at\n arss = AnalyzeRuleConfig.paginate_ars(1,\"created_at\",\"ASC\" )\n if arss[1].created_at <= arss[2].created_at\n assert true\n else\n assert false\n end\n # sort with updated at\n arss = AnalyzeRuleConfig.paginate_ars(1,\"updated_at\",\"ASC\" )\n if arss[1].updated_at <= arss[2].updated_at\n assert true\n else\n assert false\n end\n end",
"def sort_class_helper(param, style_asc = 'ascendente', style_desc = 'descendente')\n result = \"class=\\\"#{style_asc}\\\"\".html_safe if params[:sort] == param\n result = \"class=\\\"#{style_desc}\\\"\".html_safe if params[:sort] == param + \" DESC\"\n return result\n end",
"def initialize\n @formato = \"--format=pretty\"\n @orden = \"--sort=asc\"\n @archivoRuta = nil;\n end",
"def set_sorteio\n @sorteio = Sorteio.find(params[:id])\n end",
"def by_priority; end",
"def get_full_resource(kind, id, aggkind)\n resource = retrieve_resource(kind, id)\n\n if OZones.is_error?(resource)\n return [404, resource.to_json]\n end\n\n # TODO build the vdc retrieval\n\n if kind == \"zone\"\n client = OpenNebula::Client.new(\n resource.onename + \":\" + resource.onepass,\n resource.endpoint,\n false)\n\n simple_pool = case aggkind\n when \"host\" then OpenNebulaJSON::HostPoolJSON.new(client)\n when \"image\" then OpenNebulaJSON::ImagePoolJSON.new(client)\n when \"user\" then OpenNebulaJSON::UserPoolJSON.new(client)\n when \"vm\" then OpenNebulaJSON::VirtualMachinePoolJSON.new(client)\n when \"vn\",\"vnet\" then OpenNebulaJSON::VirtualNetworkPoolJSON.new(client)\n when \"template\",\"vmtemplate\" then OpenNebulaJSON::TemplatePoolJSON.new(client)\n else\n error = OZones::Error.new(\n \"Error: #{aggkind} aggregated pool for #{kind} #{id} not supported\")\n return [404, error.to_json]\n end\n\n simple_pool.info\n\n return [200, simple_pool.to_json]\n end\n end",
"def sort_files!; end",
"def new\n @entry = @class.new\n @name = @class.name.underscore.humanize.split.map(&:capitalize).join(' ')\n end",
"def new\n\n @searcher = @searcher_klass.constantize.new\n unless @searcher.cache_params_variable_name.blank?\n cached_search_params = get_cached_objects(@searcher.cache_params_variable_name)\n @searcher = @searcher_klass.constantize.new(cached_search_params) unless cached_search_params.blank?\n end\n @searcher.user = current_user\n\n cached_list = get_cached_objects(@searcher.cache_variable_name)\n if cached_list.blank?\n @data = []\n else\n @data = @searcher.cached_data(cached_list)\n end\n\n # check that an order param was provided otherwise use asset_tag as the default\n params[:sort] ||= @searcher.default_sort\n\n respond_to do |format|\n format.html # new.html.haml this had been an erb and is now an haml the change should just be caught\n format.json {\n render :json => {\n :total => @data.count,\n :rows => @data.order(\"#{params[:sort]} #{params[:order]}\").limit(params[:limit]).offset(params[:offset]).as_json(user: current_user, include_early_disposition: false)\n }\n }\n end\n end",
"def foreach_recent_tag\n CollectionWrapper.new(current_group.tags.desc(:used_at).page(params[:tags_page]).per(25), TagWrapper, view_context)\n end",
"def test_ut_t2_ars_arc_005\n create_ars_data(15)\n #sort with id\n arss = AnalyzeRuleConfig.paginate_ars(1,\"id\",\"DESC\" )\n if arss[1].id >= arss[2].id\n assert true\n else\n assert false\n end\n #sort with name\n arss = AnalyzeRuleConfig.paginate_ars(1,\"name\",\"DESC\" )\n if arss[1].name >= arss[2].name\n assert true\n else\n assert false\n end\n #sort with description\n arss = AnalyzeRuleConfig.paginate_ars(1,\"description\",\"DESC\" )\n if arss[1].description >= arss[2].description\n assert true\n else\n assert false\n end\n #sort with created at\n arss = AnalyzeRuleConfig.paginate_ars(1,\"created_at\",\"DESC\" )\n if arss[1].created_at >= arss[2].created_at\n assert true\n else\n assert false\n end\n #sort with updated at\n arss = AnalyzeRuleConfig.paginate_ars(1,\"updated_at\",\"DESC\" )\n if arss[1].updated_at >= arss[2].updated_at\n assert true\n else\n assert false\n end\n end",
"def set_kind(kind)\n\t\tend",
"def sort_by!( & block )\n\n return to_enum unless block_given?\n\n new_local_sort_order = [ ]\n @internal_array.size.times { |this_time| new_local_sort_order.push( this_time ) }\n new_local_sort_order.sort_by! { |this_index| block.call( @internal_array[ this_index ] ) }\n\n reorder_from_sort( new_local_sort_order )\n\n return self\n\n end",
"def index\n @tasks = Task.sort(params[:sort])\n \n @numRows = 0\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tasks }\n end\n end",
"def collection(objectName)\n Hirsute::Collection.new(objectName)\nend",
"def initialize(klass, resource_path)\n url = \"#{ApiClient.config.path}#{resource_path}\"\n @collection = ApiClient::Parser.response(ApiClient::Dispatcher.get(url), url)\n @collection.map! do |attributes|\n klass.new(attributes)\n end\n end",
"def sorting\n @records = Record.all #Get existing records\n @sortType = params[:sortType] #Get parameters from the form on index\n @sortField = params[:sortField]\n\n @limit = params[:sortNum].to_i # params must be converted from string\n\n if @sortType == \"Decending\" # check if sort direction is decending\n case @sortField #check what header to sort by\n when \"id\" # when table header is ID sort by ID descending\n @sortedSet = Record.order(id: :desc).limit(@limit)\n when \"REF_DATE\"\n @sortedSet = Record.order(REF_DATE: :desc).limit(@limit)\n when \"GEO\"\n @sortedSet = Record.order(GEO: :desc).limit(@limit)\n when \"DGUID\"\n @sortedSet = Record.order(DGUID: :desc).limit(@limit)\n when \"Sex\"\n @sortedSet = Record.order(Sex: :desc).limit(@limit)\n when \"Age_group\"\n @sortedSet = Record.order(Age_group: :desc).limit(@limit)\n when \"Student_response\"\n @sortedSet = Record.order(Student_response: :desc).limit(@limit)\n when \"UOM\"\n @sortedSet = Record.order(UOM: :desc).limit(@limit)\n when \"UOM_ID\"\n @sortedSet = Record.order(UOM_ID: :desc).limit(@limit)\n when \"SCALAR_FACTOR\"\n @sortedSet = Record.order(SCALAR_FACTOR: :desc).limit(@limit)\n when \"SCALAR_ID\"\n @sortedSet = Record.order(SCALAR_ID: :desc).limit(@limit)\n when \"VECTOR\"\n @sortedSet = Record.order(VECTOR: :desc).limit(@limit)\n when \"COORDINATE\"\n @sortedSet = Record.order(COORDINATE: :desc).limit(@limit)\n when \"VALUE\"\n @sortedSet = Record.order(VALUE: :desc).limit(@limit)\n when \"STATUS\"\n @sortedSet = Record.order(STATUS: :desc).limit(@limit)\n when \"SYMBOL\"\n @sortedSet = Record.order(SYMBOL: :desc).limit(@limit)\n when \"TERMINATED\"\n @sortedSet = Record.order(TERMINATED: :desc).limit(@limit)\n when \"DECIMALS\"\n @sortedSet = Record.order(DECIMALS: :desc).limit(@limit)\n \n end # end case/when\n else # if not decending its ascending\n case @sortField # check header to sort by\n when \"id\" # when table header is ID sort by ID ascending\n @sortedSet = Record.order(id: :asc).limit(@limit)\n when \"REF_DATE\"\n @sortedSet = Record.order(REF_DATE: :asc).limit(@limit)\n when \"GEO\"\n @sortedSet = Record.order(GEO: :asc).limit(@limit)\n when \"DGUID\"\n @sortedSet = Record.order(DGUID: :asc).limit(@limit)\n when \"Sex\"\n @sortedSet = Record.order(Sex: :asc).limit(@limit)\n when \"Age_group\"\n @sortedSet = Record.order(Age_group: :asc).limit(@limit)\n when \"Student_response\"\n @sortedSet = Record.order(Student_response: :asc).limit(@limit)\n when \"UOM\"\n @sortedSet = Record.order(UOM: :asc).limit(@limit)\n when \"UOM_ID\"\n @sortedSet = Record.order(UOM_ID: :asc).limit(@limit)\n when \"SCALAR_FACTOR\"\n @sortedSet = Record.order(SCALAR_FACTOR: :asc).limit(@limit)\n when \"SCALAR_ID\"\n @sortedSet = Record.order(SCALAR_ID: :asc).limit(@limit)\n when \"VECTOR\"\n @sortedSet = Record.order(VECTOR: :asc).limit(@limit)\n when \"COORDINATE\"\n @sortedSet = Record.order(COORDINATE: :asc).limit(@limit)\n when \"VALUE\"\n @sortedSet = Record.order(VALUE: :asc).limit(@limit)\n when \"STATUS\"\n @sortedSet = Record.order(STATUS: :asc).limit(@limit)\n when \"SYMBOL\"\n @sortedSet = Record.order(SYMBOL: :asc).limit(@limit)\n when \"TERMINATED\"\n @sortedSet = Record.order(TERMINATED: :asc).limit(@limit)\n when \"DECIMALS\"\n @sortedSet = Record.order(DECIMALS: :asc).limit(@limit) \n end\n end\n \n end",
"def sort_name\n sort_constituent\n end",
"def comparison\n @comparison ||= Comparison.new(entries, comparator)\n end",
"def ar_resource\n return unless type && id\n return unless self.class.union_models.include?(type.to_sym)\n\n klass = type.classify.constantize rescue nil\n return unless klass\n klass.find_by_id(id)\n end",
"def title(sym)\n\t\t@newClass = Object.const_set(sym, Class.new)\n\t\[email protected]_eval %{require 'yaml'\n\t\t\t\t\t\t\t\t\tdef self.load_from_file(filename)\n\t\t\t\t\t\t\t\t\t\tarr = YAML::load(File.open(filename)).values[0]\n\t\t\t\t\t\t\t\t\t\tret = Array.new\n\t\t\t\t\t\t\t\t\t\tarr.each do |n|\n\t\t\t\t\t\t\t\t\t\t\tbegin\n\t\t\t\t\t\t\t\t\t\t\t\tobj = self.new(n)\n\t\t\t\t\t\t\t\t\t\t\t\tret << obj\n\t\t\t\t\t\t\t\t\t\t\trescue\n\t\t\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\t\t\t#p ret\n\t\t\t\t\t\t\t\t\t\treturn ret\n\t\t\t\t\t\t\t\t\tend\n\t\t\t}\n\t\[email protected]_eval %{\n\t\t\t\t\t\t\t\t\tdef initialize(args)\n\t\t\t\t\t\t\t\t\t\targs.each do |arg|\n\t\t\t\t\t\t\t\t\t\t\tself.method(\"#\\{arg[0]\\}=\").call(arg[1])\n\t\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\t\t\t}\n\t\t#puts @newClass\n end",
"def initialize(name, owner)\n self.id # The database id of the object\n self.name = name # The displayed name of the object\n self.owner = owner || id # The owner of the object or itself.\n self.desc = \"\" # The description of the object\n self.created_on = Time.now\n self.updated_on = created_on.dup\n end"
] | [
"0.51968104",
"0.49895275",
"0.49558535",
"0.49337053",
"0.4865296",
"0.48290372",
"0.4804697",
"0.47877425",
"0.4701948",
"0.46995306",
"0.46876076",
"0.46830395",
"0.46826968",
"0.46826968",
"0.46826968",
"0.46826968",
"0.46826968",
"0.46826968",
"0.46802667",
"0.46802667",
"0.46350527",
"0.46268696",
"0.4609375",
"0.45883712",
"0.45667407",
"0.45351192",
"0.45328203",
"0.4520868",
"0.45200196",
"0.45200077",
"0.45070332",
"0.45066378",
"0.45037746",
"0.45007598",
"0.44777358",
"0.44735432",
"0.44636706",
"0.4461312",
"0.44598678",
"0.44560403",
"0.4434939",
"0.44072524",
"0.43972313",
"0.43893948",
"0.4388431",
"0.43752527",
"0.43699414",
"0.4352371",
"0.4352371",
"0.43498874",
"0.43474695",
"0.43455705",
"0.43440288",
"0.43350843",
"0.43350187",
"0.43270904",
"0.4321149",
"0.4321149",
"0.43180826",
"0.43168864",
"0.43149263",
"0.43113983",
"0.430595",
"0.43057066",
"0.43032527",
"0.42957544",
"0.42917782",
"0.42868638",
"0.42865553",
"0.42847735",
"0.42833748",
"0.42812213",
"0.42786655",
"0.42747077",
"0.42704973",
"0.4263529",
"0.4263449",
"0.42618647",
"0.4260985",
"0.42492163",
"0.42436293",
"0.42420715",
"0.4240885",
"0.42383605",
"0.42382744",
"0.42375335",
"0.42359227",
"0.42349046",
"0.42317224",
"0.42271897",
"0.42243072",
"0.4222406",
"0.42128876",
"0.42123848",
"0.42077932",
"0.4207013",
"0.4206979",
"0.42042947",
"0.42008892",
"0.4200023"
] | 0.5407648 | 0 |
==== Returns String The class name of the scheduled resource. | def kind() @tag.sub( /_.*/, '' ) end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resource_name\n \"#{self.class.to_s.split(\"::\").last.downcase}s\"\n end",
"def resource_class_name\n @resource_class_name ||= resource_name.classify.constantize\n end",
"def resource_class\n (self.class.name.split('::').last || '').downcase\n end",
"def resource_as_constant_name\n if klass_or_instance.is_a?(Class)\n klass_or_instance.name\n else\n klass_or_instance.class.name\n end\n end",
"def resource_name\n resource_class.slice(0,1).downcase + resource_class.slice(1,resource_class.length)\n end",
"def qualified_resource_name\n @qualified_resource_name ||=\n begin\n @resource_class.name.split('::').map do |str|\n tools.string.underscore(str)\n end.join('-')\n end # name\n end",
"def resource_class\n class_name\n end",
"def modularized_class\n \"NameDrop::Resources::#{resource_class_name}\".constantize\n end",
"def resource_class\n @resource_class ||= self.class.to_s.split(\":\").last\n end",
"def resource_name\n resource_class.resource_name\n end",
"def getScheduledJobObjName\r\n\t\t return \"mfiforce__Scheduled_Job__c\"\r\n\t\tend",
"def get_resource_class\n \tresource_name.classify.constantize\n end",
"def resource_class\n @resource_class ||= resource_name.classify.constantize\n end",
"def resource_class\n @resource_class ||= resource_name.classify.constantize\n end",
"def resource_class\n @resource_class ||= resource_name.classify.constantize\n end",
"def resource_class\n @resource_class ||= resource_name.classify.constantize\n end",
"def resource_class\n\t\t\t\t@resource_class ||= resource_name.classify.constantize\n\t\t\tend",
"def resource_klass_name\n resource_name.classify\n end",
"def resource_class\n # TODO does this need to have draft?\n @resource_class ||= resource_name.classify.constantize\n end",
"def class_of_resource\n @class_of_resource ||= resource_name.classify.constantize\n end",
"def resource_class\n @resource_class ||= resource_name.classify.constantize\n end",
"def resource_class\n @resource_class ||= resource_name.classify.constantize\n end",
"def resource_class\n @resource_class ||= resource_name.classify.constantize\n end",
"def resource\n self.class.to_s.split('::').last.downcase\n end",
"def resource_class\n\n ActiveSupport::Dependencies.constantize(resource_class_name)\n\n end",
"def resource_klass\n resource_klass_name.constantize\n end",
"def resource_class\n case class_name\n when false then\n name.to_sym\n when String then\n class_name.constantize\n else\n raise ArgumentError, \"unexpected class_name: #{class_name}\"\n end\n end",
"def resource_name\n resource_module.to_s.demodulize\n end",
"def resource_class\n case @options[:class]\n when false\n name.to_sym\n when nil\n namespaced_name.to_s.camelize.constantize\n when String\n @options[:class].constantize\n else\n @options[:class]\n end\n end",
"def resource_class\n @resource_class ||= resource_class_name.constantize\n end",
"def resource_name\n resources_name.singularize\n end",
"def resource_klass(name)\n eval('RedboothRuby::' + camelize(name)) rescue nil\n end",
"def resource_class(klassname)\n contract_namespaces.each do |ns|\n begin\n return \"#{ns}::#{klassname}\".constantize\n rescue;end\n end\n end",
"def name\n 'always_be_scheduling'\n end",
"def name\n 'always_be_scheduling'\n end",
"def resource_name\n @resource_name ||= self.class.to_s.underscore.gsub(%r{.*/([^/]+)\\z}, '\\1')\n end",
"def resource_name\n self.class.name.ns_underscore.pluralize\n end",
"def resource_name\n @@resource_name ||= self.class.to_s.split('::').last.gsub('Controller', '').singularize.underscore\n end",
"def resources_name\n self.class.resources_name\n end",
"def published_resource_class\n @published_resource_class ||= resource_name.classify.pluralize.constantize\n end",
"def localized_resource_class_name(resource)\n resource_class = ::Link2::Support.find_resource_class(resource)\n resource_name = ::Link2::Support.human_name_for(resource_class) rescue resource_class.to_s.humanize\n resource_name.underscore\n end",
"def type_as_class(resource_name)\n\t resource_name.singularize.capitalize.constantize\n\tend",
"def resource_name\n current_definition.resource_name\n end",
"def resource_name\n resource.name.singularize.underscore\n end",
"def resource_module\n klass.name.to_s.split('::')[0..-3].join('::').constantize\n end",
"def resource_name\n @resource_name ||= controller_name.singularize\n end",
"def resource_name\n @resource_name ||= controller_name.singularize\n end",
"def name\n @class_name\n end",
"def resource_name\n resource[:name].gsub(/\\s/, '_').downcase.singularize\n end",
"def class_name\n self.class.to_s.split('::').last\n end",
"def resource_name\n @resource_name ||= self.controller_name.singularize\n end",
"def resource_name\n @resource_name ||= self.controller_name.singularize\n end",
"def resource_klass\n @resource_klass ||= resource_name.classify.constantize\n end",
"def enclosing_resource_name\n enclosing_resource.class.name.underscore\n end",
"def resource_name\n return @resource_name\n end",
"def resource_name\n return @resource_name\n end",
"def resource_name\n return @resource_name\n end",
"def resource_name\n @resource_name ||= self.controller_name.singularize\n end",
"def resource_name\n @resource_name ||= self.controller_name.singularize\n end",
"def resource_name\n name.ns_underscore.pluralize\n end",
"def name\n @resource.name\n end",
"def resource_class\n resource_finder.is_a?(Class) ? resource_finder : resource_finder.name.classify.constantize\n end",
"def resource_name\n name.to_s.chomp('Controller').demodulize.singularize\n end",
"def resource_class\n name = controller.controller_name\n return \"active\" if name == \"resources\"\n end",
"def resource_name\n @resource_name ||= self.controller_name.singularize\n end",
"def class_name\n self.class.class_name\n end",
"def resource_name\n\t\t\t\t@resource_name ||= self.controller_name.singularize\n\t\t\tend",
"def getMeetingScheduleObjName\r\n\t\t\treturn \"mfiforce__Meeting_Schedule__c\"\r\n\t\tend",
"def resource_class\n @resource_class ||= begin\n resource_parts = params[:namespaces] ? params[:namespaces].split('/') : []\n resource_parts << params[:resource_name]\n resource_parts.map(&:classify).join('::').constantize\n end\n end",
"def getRepaymentScheduleObjName\r\n\t\t\treturn \"mfiforce__Repayment_Schedule__c\"\r\n\t\tend",
"def resource_name\n @resource_name ||= controller_name.singularize\n end",
"def qualified_name\n self.class.name\n end",
"def resource_class\n resource_specification.klass\n end",
"def class_name\n self.class.name.split(\"::\").last\n end",
"def resource_class\n @resource_class ||= self.controller_name.singularize.classify.constantize\n end",
"def resource_name\n @resource_name ||= self.controller_name.singularize\n end",
"def resource_name\n @resource_name ||= self.controller_name.singularize\n end",
"def resource_name\n @resource_name ||= self.controller_name.singularize\n end",
"def task_class_name\n \"#{process_definition_key}::#{activity_id}\"\n end",
"def resource_human_name\n resource_class.model_name.human\n end",
"def resource_instance_name #:nodoc:\n self.resources_configuration[:self][:instance_name]\n end",
"def resource_name\n @resource_name ||= model_name.element.pluralize\n end",
"def resource_name\n @resource_name ||= get_resource_name\n end",
"def resource_to_class(resource)\n BlockScore::Util.to_constant(\"BlockScore::#{BlockScore::Util.to_camelcase(resource.to_s)}\")\nend",
"def resource_name\n @resource_name ||= plural_resource_name.singularize\n end",
"def name\n self.class.to_s.split('::').last\n end",
"def resource_name\n @resource_name ||= singular_resource_name.pluralize\n end",
"def resource_name\n @resource_name\n end",
"def class_name\n self.class.to_s\n end",
"def class_name\n self.class.to_s\n end",
"def resource_name\n controller_name.demodulize.singularize\n end",
"def resource_name\n controller_name.demodulize.singularize\n end",
"def resource_name\n controller_name.demodulize.singularize\n end",
"def resource_name\n @resource_name ||= Inflection.plural(singular_resource_name)\n end",
"def class_name\n self.class.name.split(\"::\").last.downcase\n end",
"def set_resource_class_name\n @resource_class_name = 'Event'\n end",
"def display_name\n job_class\n end",
"def className\r\n self.class.to_s\r\n end",
"def resource_model\n \"::#{resource_name}\".constantize\n end",
"def resource_name\n resource_specification.name\n end",
"def classname\n @classname ||= self.class.name.split(\"::\")[1..-1].join(\"::\")\n end"
] | [
"0.768872",
"0.7485516",
"0.7386417",
"0.73078805",
"0.71952116",
"0.7189275",
"0.7146249",
"0.71236235",
"0.711776",
"0.71126056",
"0.7102673",
"0.7033048",
"0.699981",
"0.699981",
"0.699981",
"0.69858253",
"0.6944261",
"0.69277024",
"0.6926903",
"0.6926715",
"0.69088984",
"0.69088984",
"0.69088984",
"0.6898593",
"0.6892735",
"0.68675",
"0.6822855",
"0.6770118",
"0.67693496",
"0.67552507",
"0.67151344",
"0.6705353",
"0.6702727",
"0.6692995",
"0.6692995",
"0.66652477",
"0.66556823",
"0.66432416",
"0.66412455",
"0.6626076",
"0.6615077",
"0.66146064",
"0.65603775",
"0.6554026",
"0.65464216",
"0.6532111",
"0.6532111",
"0.64993286",
"0.6493796",
"0.64917636",
"0.6477864",
"0.6477864",
"0.647298",
"0.6438831",
"0.64278877",
"0.64278877",
"0.64278877",
"0.6425207",
"0.6425207",
"0.6412284",
"0.64027244",
"0.64023304",
"0.63993144",
"0.63973755",
"0.6392048",
"0.6385669",
"0.6379004",
"0.63750136",
"0.6373661",
"0.6370679",
"0.63674235",
"0.6365035",
"0.6361187",
"0.6360389",
"0.63314945",
"0.6309525",
"0.6309525",
"0.6309525",
"0.630568",
"0.6292521",
"0.6271027",
"0.6259263",
"0.62527364",
"0.62426186",
"0.62414896",
"0.6230127",
"0.62264377",
"0.6216258",
"0.6205834",
"0.6205834",
"0.6204621",
"0.6204621",
"0.6204621",
"0.6195486",
"0.61937773",
"0.6193741",
"0.61905825",
"0.61774",
"0.61743903",
"0.61498463",
"0.61481625"
] | 0.0 | -1 |
==== Returns String The rid (abstract id) of the ScheduledResource. | def sub_id() @tag.sub( /.*_/, '' ) end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rid\n \"rId#{ndx + 1}\"\n end",
"def resource_id\n return \"%s:%s\" % [self.resource_type, self.id]\n end",
"def rrid\n \"#\" + rid\n end",
"def resource_id\n send self.class.resource_id\n end",
"def rid\n begin\n \"#{@metadata[:cluster]}:#{@metadata[:record]}\"\n rescue\n \"0:0\"\n end\n end",
"def resource_id\n @arn\n end",
"def resource_id\n return @resource_id\n end",
"def resource_id\n return @resource_id\n end",
"def resource_id\n return @resource_id\n end",
"def resource_id\n\t\t\t\t\treturn self.send(self.class.resource_id_column)\n\t\t\t\tend",
"def physical_resource_id\n \"#{self.class.name.split('::').last}-#{Carnivore.uuid}\"\n end",
"def id\n special_attribute('@rid'.freeze)\n end",
"def identifier\n rdf_resource\n end",
"def rid\n @rid ||= @node.search('RID/listEntry').map(&:inner_text)\n end",
"def rid\n @rid ||= select { |type,value| type == :rid }.map do |(type,value)|\n value\n end\n end",
"def rp_id; end",
"def name\n record.resource_id\n end",
"def resource_id(res)\n if res.is_a?(String)\n return res.split(/\\//).last.to_i\n else\n return res.href.split(/\\//).last.to_i\n end\n end",
"def get_resource_type_identifier(type)\n get_type_identifier(type, Occi::Core::Resource.kind)\n end",
"def get_identifier\n return @task_arn\n end",
"def r(resource_type, resource_name)\n resources.getIdentifier(resource_name.to_s, resource_type.to_s,\n activity.getApplicationInfo.packageName)\n end",
"def get_resource_type()\n return RedXmlResource::TYPE\n end",
"def rid\n\t\treturn get_tlv_value(TLV_TYPE_REQUEST_ID)\n\tend",
"def rid\n\t\treturn get_tlv_value(TLV_TYPE_REQUEST_ID)\n\tend",
"def stringify_rid(record)\n record.getIdentity.toString\n end",
"def resource_name\n return @resource_name\n end",
"def resource_name\n return @resource_name\n end",
"def resource_name\n return @resource_name\n end",
"def rid(prefix = '')\n page_hash = Digest::MD5.hexdigest(request.path)\n @rid_seq ||= 0\n @rid_seq += 1\n \"rid#{page_hash}#{@rid_seq}\"\n end",
"def urn\n return @urn\n end",
"def scribd_id\n @attributes[:id]\n end",
"def identifier\n @record.uri.to_s\n end",
"def resource_id(prefix)\n if default_config?\n [prefix, project, node_type, node_name]\n else\n [prefix, project, configuration, node_type, node_name]\n end.compact.join(\"_\").tr(\"-\", '_').tr(\"/\", \"_\")\n end",
"def resource_id(prefix)\n if default_config?\n [prefix, project, node_type, node_name]\n else\n [prefix, project, configuration, node_type, node_name]\n end.compact.join(\"_\").tr(\"-\", '_').tr(\"/\", \"_\")\n end",
"def id\n \"p-#{resource.id}\"\n end",
"def short\n rid\n end",
"def resource_id=(value)\n @resource_id = value\n end",
"def resource_id=(value)\n @resource_id = value\n end",
"def resource_id=(value)\n @resource_id = value\n end",
"def identity_resource_identifier\n return @identity_resource_identifier\n end",
"def resource_uri\n \"#{resource_name}/#{uid}\"\n end",
"def rrtype\n @attributes[:rrtype]\n end",
"def resource identifier\n Resource.new(Conjur::Authz::API.host, credentials)[self.class.parse_resource_id(identifier).join('/')]\n end",
"def rdf_seek_id\n rdf_resource.to_s\n end",
"def srid\n @zfactory.srid\n end",
"def resource_name\n resource_class.resource_name\n end",
"def amazon_resource_id\n return @amazon_resource_id\n end",
"def resource_id\n self.end_user_login\n end",
"def urn_id; :id end",
"def urn_id; :id end",
"def rId\n pivot_table.relationships.for(self).Id\n end",
"def resource_name\n resource_specification.name\n end",
"def subject\n adapter.id_to_uri(resource.id) if resource.try(:id)\n end",
"def recipe_id(arg=nil)\n if Integer(arg) < 0 then raise RangeError end\n if arg.is_a?(Integer)\n converted_arg = arg.to_s\n else\n converted_arg = arg\n end\n set_or_return(\n :recipe_id,\n converted_arg,\n :kind_of => [ String ]\n )\n\n @cron_resource.command \"rs_run_recipe -i #{converted_arg}\" if arg\n end",
"def id_to_resource_uri\n @id_to_resource_uri ||= lambda { |id, _graph| ActiveFedora::Base.translate_id_to_uri.call(id) }\n end",
"def qualified_resource_name\n @qualified_resource_name ||=\n begin\n @resource_class.name.split('::').map do |str|\n tools.string.underscore(str)\n end.join('-')\n end # name\n end",
"def resource_name\n current_definition.resource_name\n end",
"def id\n new_resource.bucket_name || new_resource.name\n end",
"def rp_key\r\n self.class.rp_key\r\n end",
"def resource\n\t\tself.split('__')[0]\n\tend",
"def resource_name\n @resource_name ||= self.class.to_s.underscore.gsub(%r{.*/([^/]+)\\z}, '\\1')\n end",
"def resource_name\n @resource_name ||= get_resource_name\n end",
"def id_of(resource_type, resource_name)\n output_of(resource_type, resource_name, :id)\n end",
"def id\n Resource::ALL\n end",
"def id\n Resource::ALL\n end",
"def resource_item_name\n current_definition.resource_item_name\n end",
"def id\n @rf['id']\n end",
"def resource_name\n \"#{self.class.to_s.split(\"::\").last.downcase}s\"\n end",
"def reg_id\n @reg_id ||= StudentResource.find_by_system_key(system_key, false)\n end",
"def get_rca_for_current_brd\n if is_broadcaster?\n sql = \"SELECT dg_rca.title FROM data_gateway as dg INNER JOIN data_group_rca as dg_rca on dg_rca.id = dg.rca_id\n WHERE dg.broadcast_id = #{self.sys_user_resource_broadcasts.first.broadcast_id} limit 1 \"\n rca_name = ActiveRecord::Base.connection.execute(sql).to_a\n rca_name = rca_name[0].present? && rca_name[0][0].present? ? rca_name[0][0] : \"null\"\n else\n \"null\"\n end\n end",
"def enhanced_monitoring_resource_arn\n data[:enhanced_monitoring_resource_arn]\n end",
"def resource_id_column\n\t\t\t\t\t\traise \"Not implemented.\"\n\t\t\t\t\tend",
"def get_rider\n RideShare::Rider.find(rider_id)\n end",
"def result_id_suffix\n resource_class.name.demodulize\n end",
"def get_resource_key(res_id, xml_format=false)\n if res_id.is_a? String\n res_id = res_id.hex\n end\n\n # R.id integers are a concatenation of package_id, type_id, and entry index\n res_package = (res_id >> 24) & 0xFF\n res_type = (res_id >> 16) & 0xFF\n res_index = res_id & 0xFFFF\n\n package_element = @packages[res_package]\n if package_element == nil\n # This is not a resource we can parse\n return nil\n end\n\n res_spec = package_element.type_data[res_type-1]\n if res_spec == nil\n puts \"Could not find ResTypeSpec for #{res_package} #{res_type}\" if DEBUG\n return nil\n end\n\n entry = res_spec.types.entries[res_index]\n if entry == nil\n # There is no entry in our table for this resource\n puts \"Could not find #{res_spec.types.id} ResType chunk\" if DEBUG\n return nil\n end\n\n if xml_format\n return \"@#{res_spec.id}/#{entry.values[0].key}\"\n else\n return \"R.#{res_spec.id}.#{entry.values[0].key}\"\n end\n end",
"def provider_resource_id\n return @provider_resource_id\n end",
"def get_rebill_id()\n return @RESPONSE_HASH['REBID']\n end",
"def id\n @id || self.class.name.underscore.split('/').last #gsub('/', '_')\n end",
"def name\n parent_uri = self.parent.uri.to_s\n if not parent_uri.end_with?(\"/ROs/\")\n # Evil hack\n parent_uri += \"/ROs/\"\n end\n return URI.parse(parent_uri).route_to(self.uri.to_s).to_s\n end",
"def resource_id_param\n params[:id]\n end",
"def getRepaymentScheduleObjName\r\n\t\t\treturn \"mfiforce__Repayment_Schedule__c\"\r\n\t\tend",
"def bare_identifier\n resource.identifier_str.gsub(/^doi:/, '')\n end",
"def resource_name\n @resource_name\n end",
"def persistent_resource_id(resource)\n # FIXME: this contains some duplication of Seek::Rdf::RdfGeneration#rdf_resource - however not every model includes that Module at this time.\n # ... its also a bit messy handling the version\n url = if resource.is_a_version?\n polymorphic_url(resource.parent, version: resource.version, **Seek::Config.site_url_options)\n else\n polymorphic_url(resource, **Seek::Config.site_url_options)\n end\n\n content_tag :p, class: :id do\n content_tag(:strong) do\n t('seek_id') + ':'\n end + ' ' + link_to(url, url)\n end\n end",
"def identifier(resource_type, name)\n raise NotImplementedError, :identifier\n end",
"def display_resource(rainwork)\n \"RW \\\"#{rainwork.name}\\\"\"\n end",
"def last\n self.class.where(id: rid).chronological.last\n end",
"def parent_resource_name(params)\n parent_resource_param(params).to_s.gsub(/\\_id/, '').pluralize\n end",
"def resource_name\n @resource_name ||= model_name.element.pluralize\n end",
"def rdn\n\t\treturn self.split_dn( 2 ).first\n\tend",
"def get_resource(id)\n raise 'To be implemented in child classes'\n end",
"def obj_id\n uri.split('/').last\n end",
"def obj_id\n uri.split('/').last\n end",
"def resource\n self.class.to_s.split('::').last.downcase\n end",
"def uri\n Util.join_uri(self.class.uri, self.id)\n end",
"def rdf_resource\n if creator\n creator.rdf_resource\n elsif orcid\n RDF::Resource.new(orcid)\n else\n RDF::Resource.new(ROCrate::Person.format_id(name))\n end\n end",
"def resource_item_name\n resource_name.to_s.singularize.to_sym\n end",
"def node_id\n jid.resource\n end",
"def local_rid; end",
"def uri_id\n raise NotImplementedError.new('You must implement uri_id')\n end",
"def resource_reference\n return @resource_reference\n end"
] | [
"0.7154267",
"0.70218146",
"0.6916988",
"0.6863483",
"0.6805653",
"0.66547024",
"0.6652975",
"0.6652975",
"0.6652975",
"0.66459346",
"0.66241854",
"0.6465694",
"0.6400273",
"0.63534725",
"0.62671375",
"0.6082888",
"0.6006119",
"0.59855133",
"0.59560764",
"0.59443474",
"0.5926228",
"0.5920578",
"0.5902914",
"0.5902914",
"0.5895816",
"0.58786213",
"0.58786213",
"0.58786213",
"0.5866659",
"0.58593416",
"0.5842184",
"0.58357626",
"0.5834301",
"0.5834301",
"0.5814506",
"0.5806509",
"0.580485",
"0.580485",
"0.580485",
"0.5774019",
"0.5729624",
"0.56992424",
"0.56761765",
"0.5675703",
"0.5660414",
"0.56572515",
"0.56505114",
"0.56494975",
"0.5648476",
"0.5648476",
"0.5621899",
"0.56136715",
"0.56136453",
"0.55970067",
"0.55904436",
"0.5585881",
"0.5583806",
"0.5567283",
"0.55520946",
"0.5539568",
"0.55386406",
"0.5535497",
"0.5532111",
"0.55320513",
"0.55320513",
"0.5523168",
"0.5512668",
"0.5510652",
"0.5497495",
"0.54854596",
"0.5477872",
"0.54622215",
"0.5454604",
"0.5454509",
"0.54403883",
"0.5424936",
"0.5410844",
"0.54106617",
"0.5406553",
"0.5403981",
"0.54007477",
"0.539853",
"0.53969127",
"0.5389691",
"0.53790504",
"0.5374222",
"0.5367098",
"0.5365908",
"0.53592336",
"0.53517085",
"0.5349428",
"0.53464",
"0.53464",
"0.5343516",
"0.53357905",
"0.5328641",
"0.5316664",
"0.53162515",
"0.531517",
"0.5312287",
"0.5312246"
] | 0.0 | -1 |
==== Returns String CSS classes automatically generated for the DOM row representing this SchedResource. | def css_classes_for_row(); "rsrcRow #{self.kind}row #{@tag}row #{self.kind}Row #{@tag}Row" end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def css_classes_for_row(); \"rsrcRow #{self.kind}row #{@tag}row\" end",
"def css_classes\n classes= [\"row\"]\n unless @element.content_by_name(:classi_css).essence.body.nil?\n classes << @element.content_by_name(:classi_css).essence.body\n end\n classes #todo estrapolare valori da options\n end",
"def grid_row_css_class\n \"#{grid_row_model_type}-grid-item\"\n end",
"def css_class\n end",
"def css_class\n result = [self.project.try(:css_class), self.try(:format).try(:css_class)].join(' ')\n result = 'other' unless CSS_CLASSES.include?(result)\n result += ' invisible' unless self.is_visible\n result\n end",
"def css_classes\n s = 'journal'\n s << ' has-notes' unless notes.blank?\n s << ' has-details' unless hr_change_details.blank?\n s\n end",
"def grid_css_class\n \"#{grid_row_model_type}-grid\"\n end",
"def css_classes\n [\n \"version-#{status}\"\n ].join(' ')\n end",
"def css_class\n @css_class ||= [\"project\", status.gsub(' ','-').downcase, (hideable? ? \"hideable\" : nil)].compact.join(\" \")\n end",
"def render\n res = { content: fields, data: { csv_row_index: @csv_row.row_index } }\n format.add_class res, row_css_classes\n res\n end",
"def css_class *a; CssString.new a.flatten.unshift(self).join '.' end",
"def css_classes\n css_classes = []\n css_classes << 'not-read' unless read\n css_classes << 'important' if important\n css_classes.join(' ')\n end",
"def css_classes\n s = \"meeting status-#{status}\"\n s << ' created-by-me' if User.current.logged? && author_id == User.current.id\n s\n end",
"def css_class_names\n @css_class_names ||= []\n end",
"def css_class\n @css_class ||= \"project #{status.gsub(' ','-').downcase}\"\n end",
"def css_class name\n attr \".#{name}\"\n end",
"def html_classes; end",
"def make_class(klass)\n %Q{\n <td class=\"class_item\" colspan=\"#{klass.intervals}\">\n <p>#{klass.name} - #{klass.location}</p>\n <p>#{klass.type}</p>\n </td>}\n end",
"def strclass() @records.get_data(GRT_STRCLASS); end",
"def css_class\n case id\n when 0 # Cancelado - yellow\n 'warning'\n when 1 # Enviado - red\n 'danger'\n when 2 # Recibido - blue\n 'active'\n when 3 # Confirmado - gray\n 'info'\n when 4 # Efectuado - green\n 'success'\n end\n end",
"def component_css_class\n ''\n end",
"def list_row_class(record)\n if record.is_a?(Client)\n record.client_status.status\n elsif record.is_a?(Url)\n record.url_status.status\n end\n end",
"def render_document_class(document = @document)\n document_classes = super(document) ? [super(document)] : []\n if homegrown_content?(document)\n document_classes << \"homegrown\"\n end\n return document_classes.join(' ')\n end",
"def render_document_class(document = @document)\n document_classes = super(document) ? [super(document)] : []\n if homegrown_content?(document)\n document_classes << \"homegrown\"\n end\n return document_classes.join(' ')\n end",
"def classes\n [\n @classes,\n helpers.render_document_class(@document),\n 'document',\n (\"document-position-#{@counter}\" if @counter)\n ].compact.flatten\n end",
"def classes\n [\n @classes,\n helpers.render_document_class(@document),\n 'document',\n (\"document-position-#{@counter}\" if @counter)\n ].compact.flatten\n end",
"def get_classes\n (attr['class'] || '').downcase.split(' ').sort\n end",
"def css_classes(user=User.current)\n s = \"pull #{priority.try(:css_classes)}\"\n s << ' closed' if closed?\n s << ' created-by-me' if author_id == user.id\n s << ' assigned-to-me' if assigned_to_id == user.id\n s << ' assigned-to-my-group' if user.groups.any? {|g| g.id == assigned_to_id}\n end",
"def classes\n [\n @classes,\n @view_context.render_document_class(@document),\n 'document',\n (\"document-position-#{@counter}\" if @counter)\n ].compact.flatten\n end",
"def class_name\n element.attribute_value \"class\"\n end",
"def classes()\n return @driver.get_sc_core_query_element_classes(@handle, @index)\n end",
"def style_for(column,present)\r\n if(present == true)\r\n class_value = \"imported\"\r\n else\r\n method_to_call = \"#{column}_data_origin\"\r\n begin\r\n case self.details[method_to_call.to_sym]\r\n when Origins::IMPORTED\r\n class_value = \"ocr_data imported\"\r\n when Origins::CERTAIN\r\n class_value = \"ocr_data certain\"\r\n when Origins::UNCERTAIN\r\n class_value = \"ocr_data uncertain\"\r\n when Origins::BLANK\r\n class_value = \"ocr_data blank\"\r\n else\r\n class_value = \"ocr_data blank\"\r\n end\r\n rescue NoMethodError\r\n # Nothing matched, assign default\r\n Origins::BLANK\r\n end\r\n end\r\n class_value \r\n end",
"def id_and_class(options = {}) # change to {}\n\t\tids = [\"id='td_#{self.cell_id(options[:number])}' class='#{self.class_name} #{options[:outer_span]}\"]\n\t\tids << \" \" << options[:target] if options[:target]\n\t\t(ids << \"'\").join\n\t\t# end\n\tend",
"def css_classes(mod)\n if mod.respond_to?(:css_classes)\n return mod.css_classess\n else\n mod.class.name.underscore\n end\n end",
"def status_to_css_classes(status)\n case status\n when 'passing'\n { 'cell' => 'status-passing', 'icon' => 'check', 'type' => 'fas', 'text' => 'text-success' }\n when 'failing'\n { 'cell' => 'status-failing', 'icon' => 'times', 'type' => 'fas', 'text' => 'text-danger' }\n when 'errored'\n { 'cell' => 'status-errored', 'icon' => 'exclamation', 'type' => 'fas', 'text' => 'text-warning' }\n else\n { 'cell' => 'status-not-started', 'icon' => 'circle', 'type' => 'far', 'text' => 'text-info' }\n end\n end",
"def css_class(feature)\n \"#{css_class_prefix}_#{feature.to_s}\"\n end",
"def field_class\n css = (options[:class]||\"\").split(' ')\n css << 'exergue' if exergue\n css << 'warning' if warning\n css.join(' ')\n end",
"def css_class value\n value.to_s.strip.downcase.gsub(' ','') # TODO update to strip out all non alphanumeric characters\n end",
"def xf_attr_row(row)\n row_style = @row_styles[(row+1).to_s][:style]\n return @workbook.get_style_attributes(@workbook.get_style(row_style))\n end",
"def css_classes_for(classname)\n css_classes_for_map classname, mapping\n end",
"def render\n if invisible?\n ''\n else\n col_renders = nodes.reject(&:invisible?).map(&:render).join(\"\\n<!-- End Col -->\\n\")\n <<-HTML\n <div class=\"#{row_class}\">\n #{col_renders}\n </div>\n HTML\n end\n end",
"def printCSS\r\n css=\"<style type=\\\"text/css\\\">\\n\" \r\n @concreteInterfaceIds.each do\r\n |concrete_interface|\r\n concrete_interface = SWUI::ConcreteInterface.find_by.interface_name(concrete_interface).execute.first.concrete_interface_code.first\r\n css << concrete_interface\r\n css << \"\\n\"\r\n end\r\n @ajaxcontrolIds.each do\r\n |ajaxcontrolId|\r\n ajaxcontrol = SWUI::RichControl.find_by.concrete_widget_name(ajaxcontrolId).execute.first\r\n cssCode = ajaxcontrol.cssCode.first\r\n css << \"#{cssCode}\\n\"\r\n end\r\n css << \"</style>\\n\"\r\n return css\r\n end",
"def list_css_class\n \"#{model_type}-list\"\n end",
"def cellClass\n ElementTableViewCell\n end",
"def get_container_class( current_piece )\n css_classes = current_piece.effects.join(' ') # current_piece.piece_selector + ' ' + current_piece.as_child_selector + ' ' +\n # how many columns are there?\n # handling data iteration?\n # Rails.logger.debug \"current_piece=#{current_piece.id},#{current_piece.title}, current_piece.is_container?=#{current_piece.is_container?}, current_piece.template.running_data_sources.present?=#{current_piece.template.running_data_sources.present?}\"\n if current_piece.is_container?\n running_data_item = current_piece.template.running_data_item\n if running_data_item.present?\n current_page = current_piece.template.page_generator.current_page_tag\n column_count = current_piece.template.running_data_source_sction_piece.column_count\n i = current_piece.template.running_data_item_index\n #Rails.logger.debug \"i=#{i}, column_count=#{column_count}, current_piece.template.running_data_source_sction_piece=#{current_piece.template.running_data_source_sction_piece.id}\"\n css_classes << ' data_first' if column_count>0 && i==0\n css_classes << ' data_last' if column_count>0 && ((i+1)%column_count==0)\n css_classes << \" data_#{i+1}\"\n\n case running_data_item.model\n when Spree::Taxon\n css_classes << ' data_current' if running_data_item.current?\n css_classes << ' data_current_ancestor' if current_page.ancestor_ids.include?(running_data_item.id)\n when Spree::Product\n when Spree::Post\n end\n\n end\n end\n if current_piece.parent.effects.present?\n css_classes << \" child_#{current_piece.nth_of_siblings}\"\n end\n\n css_classes\n end",
"def dom_class\n\t\tnode['class']\n\tend",
"def ticket_css_class(ticket)\n return 'ticket-closed' if ticket.closed?\n return 'ticket-in-progress' if ticket.in_progress?\n return nil\n end",
"def dom_class\n node['class']\n end",
"def ruby_to_css_class(ruby_name)\n return \"\" unless ruby_name\n ruby_name.to_s.gsub('_','-')\n end",
"def css_render\n css_list.join(\"\\n\")\n end",
"def css_class(hay, needle); end",
"def css_class(name_prefix='')\n\t\t\"#{name_prefix}list\"\n\tend",
"def css_class\n \"flag-status #{state_name}\"\n end",
"def table_class\n \"calendar #{options[:table_class]}\\\" data-calendar-year=\\\"#{year}\\\" data-calendar-month=\\\"#{month}\\\" data-year-start=\\\"1994\\\" data-year-end=\\\"#{Time.now.year}\\\" data-year-select=\\\"#{year_select?}\\\"\"\n end",
"def get_existing_css_classes(link)\n link[\"class\"].to_s\n end",
"def as_css_background_with_class(klass=nil)\n klass=File.basename(@file_path).tr('.','_') unless klass\n \".#{klass} {\\n #{self.as_css_background}\\n}\"\n end",
"def add_class c\n each do |q|\n str = q.get_attribute(\"class\")\n\n if str.empty?\n str = c.to_s\n else\n str = str+\" #{c}\"\n end\n \n q.set_attribute(\"class\",str)\n end\n end",
"def get_row_style(row)\n if @row_styles[(row+1).to_s].nil?\n @row_styles[(row+1).to_s] = {}\n @row_styles[(row+1).to_s][:style] = '0'\n @workbook.fonts['0'][:count] += 1\n end\n return @row_styles[(row+1).to_s][:style]\n end",
"def row_dimension_class\n @row_dimension_class ||= fact_class.dimension_class(self.row_dimension_name)\n end",
"def row_class\n fraction_class(\n object.listener_ticket_limit,\n object.listener_tickets.size\n ) \n end",
"def to_css\n styles = []\n %w( chessboard mini-chessboard ).each do |board_class|\n if light_square_color\n styles << \"\n .#{board_class} .square.light {\n background: #{light_square_color} !important;\n }\n .#{board_class} .square .square-label.dark {\n color: #{light_square_color} !important;\n }\n .cg-wrap.orientation-white coords.ranks coord:nth-child(2n + 1) {\n color: #{light_square_color} !important;\n }\n .cg-wrap.orientation-white coords.files coord:nth-child(2n + 1) {\n color: #{light_square_color} !important;\n }\n .cg-wrap.orientation-black coords.ranks coord:nth-child(2n) {\n color: #{light_square_color} !important;\n }\n .cg-wrap.orientation-black coords.files coord:nth-child(2n) {\n color: #{light_square_color} !important;\n }\n \"\n end\n if dark_square_color\n styles << \"\n .#{board_class} .square.dark {\n background: #{dark_square_color} !important;\n }\n .#{board_class} .square .square-label.light {\n color: #{dark_square_color} !important;\n }\n .cg-wrap.orientation-white coords.ranks coord:nth-child(2n) {\n color: #{dark_square_color} !important;\n }\n .cg-wrap.orientation-white coords.files coord:nth-child(2n) {\n color: #{dark_square_color} !important;\n }\n .cg-wrap.orientation-black coords.ranks coord:nth-child(2n + 1) {\n color: #{dark_square_color} !important;\n }\n .cg-wrap.orientation-black coords.files coord:nth-child(2n + 1) {\n color: #{dark_square_color} !important;\n }\n \"\n end\n if light_square_color || dark_square_color\n board_svg = %(\n <?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:x=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 0 8 8\" shape-rendering=\"crispEdges\">\n <g id=\"a\">\n <g id=\"b\">\n <g id=\"c\">\n <g id=\"d\">\n <rect width=\"1\" height=\"1\" fill=\"#{light_square_color || \"#F3E4CF\"}\" id=\"e\"/>\n <use x=\"1\" y=\"1\" href=\"#e\" x:href=\"#e\"/>\n <rect y=\"1\" width=\"1\" height=\"1\" fill=\"#{dark_square_color || \"#CEB3A2\"}\" id=\"f\"/>\n <use x=\"1\" y=\"-1\" href=\"#f\" x:href=\"#f\"/>\n </g>\n <use x=\"2\" href=\"#d\" x:href=\"#d\"/>\n </g>\n <use x=\"4\" href=\"#c\" x:href=\"#c\"/>\n </g>\n <use y=\"2\" href=\"#b\" x:href=\"#b\"/>\n </g>\n <use y=\"4\" href=\"#a\" x:href=\"#a\"/>\n </svg>\n ).strip\n base64_board_svg = Base64.encode64(board_svg).gsub(/\\n/, '').strip\n styles << \"\n cg-board {\n background-image: url('data:image/svg+xml;base64,#{base64_board_svg}');\n }\n \"\n end\n if selected_square_color\n styles << \"\n .#{board_class} .square[data-selected] {\n background: #{selected_square_color} !important;\n }\n cg-board square.selected {\n background: #{selected_square_color} !important;\n }\n \"\n end\n if opponent_from_square_color\n styles << \"\n .#{board_class} .square[data-from] {\n background: #{opponent_from_square_color} !important;\n }\n .#{board_class} .square.move-from {\n background: #{opponent_from_square_color} !important;\n }\n cg-board square.last-move.move-from {\n background-color: #{opponent_from_square_color} !important;\n }\n \"\n end\n if opponent_to_square_color\n styles << \"\n .#{board_class} .square[data-to] {\n background: #{opponent_to_square_color} !important;\n }\n .#{board_class} .square.move-to {\n background: #{opponent_to_square_color} !important;\n }\n cg-board square.last-move.move-to {\n background-color: #{opponent_to_square_color} !important;\n }\n \"\n end\n end\n return unless styles.length > 0\n styles.join(\"\\n\").html_safe\n end",
"def strclass_record() @records.get(GRT_STRCLASS); end",
"def emit_page_classes\n @page_classes ||= default_page_classes\n @page_classes.flatten!\n @page_classes.compact_blank!\n @page_classes.map! { |c| c.to_s.gsub(/[^a-z_0-9-]/i, '_') }\n @page_classes.uniq!\n @page_classes.join(' ')\n end",
"def comp_class\n @xml += '<class> '\n while @i < @tokens.length\n case @tokens[@i].val\n when 'static', 'field'\n comp_class_var_dec\n next\n when 'constructor', 'function', 'method'\n comp_subroutine\n next\n else\n comp_line\n end\n end\n @xml += '</class> '\n @xml\n end",
"def css_classes_for(*args)\n return nil if args.empty?\n\n conditions = args.extract_options!\n classes = args.dup\n conditions.each { |clas, condition| classes << clas if condition }\n classes.join(\" \")\n end",
"def column_classes(fields_array, index, additional_class_names=nil)\n classes = (index == 0 ? @options[:first_column_class] : '')\n classes += (index == fields_array.length - 1 ? @options[:last_column_class] : '')\n if additional_class_names\n classes += \" \" + additional_class_names\n end\n classes\n end",
"def status_to_css_classes(status)\n classes = {}\n\n case status\n when 'Passing'\n classes['cell'] = 'status-passing'\n classes['icon'] = 'fa-check'\n when 'Failing'\n classes['cell'] = 'status-failing'\n classes['icon'] = 'fa-times'\n when 'Incomplete'\n classes['cell'] = 'status-not-started'\n classes['icon'] = 'fa-circle-o'\n when 'Not_started'\n classes['cell'] = 'status-not-started'\n classes['icon'] = 'fa-circle-o'\n end\n\n classes\n end",
"def get_css_class\n live_value = get_value GenericForm::VALUE_TYPE_LIVE\n\n if @form.get_data(GenericForm::VALUE_TYPE_VOLATILE) == nil\n value = get_value GenericForm::VALUE_TYPE_SAVED\n else\n value = get_value GenericForm::VALUE_TYPE_VOLATILE\n end\n\n changed = live_value != value\n\n ['config_field', get_data_type, get_html_type, @form.name, @screen.name, @name, changed ? 'changed' : '', @error == '' ? '' : 'error'].join(' ').strip\n end",
"def task_row_tr_tag(task)\n class_name += \"selected\" if task.id == session[:last_task_id]\n class_name += \" unread\" if task.unread?(current_user)\n class_name += \" unassigned\" if task.users.count == 0\n\n return tag(:tr, {\n :id => \"task_row_#{ task.task_num }\",\n :class => class_name,\n :onclick => \"showTaskInPage(#{ task.task_num}); return false;\"\n }, true)\n end",
"def css_classes\n [\n super,\n (NfgUi::Components::Foundations::Icon::LEFT_ICON_SPACER_CSS_CLASS if add_left_icon_css_spacer_class?),\n (NfgUi::Components::Foundations::Icon::RIGHT_ICON_SPACER_CSS_CLASS if add_right_icon_css_spacer_class?)\n ].join(' ').squish\n end",
"def body_class\n [\n params[:action],\n controller_path.gsub(SLASH, '__'),\n current_resources_name.try(:gsub, COLONS, '__'),\n content_for(:custom_body_class)\n ].compact.join SPACE\n end",
"def css_class_standard(hay, needle); end",
"def integrated_slat_action_link_css_classes\n [\n (\"text-#{theme}\" if theme),\n 'd-block'\n ].join(' ').squish\n end",
"def table_content\n table activity_rows do\n row(0).font_style = :bold\n self.header = true\n self.row_colors = ['DDDDDD', 'FFFFFF']\n self.column_widths = [65, 175, 75, 85, 75, 65]\n style(column(3), align: :right)\n style(column(4), align: :right)\n style(column(5), align: :right)\n end\n end",
"def grid_container_css_class\n \"#{model_type}-grid-container\"\n end",
"def add_class class_name\n each do |el|\n next unless el.respond_to? :get_attribute\n classes = el.get_attribute('class').to_s.split(\" \")\n el.set_attribute('class', classes.push(class_name).uniq.join(\" \"))\n end\n self\n end",
"def ug_resource_details_table_rows\n ug_resources_details_table.rows_text[1..-2]\n end",
"def dwc_occurrence_table_header_tag\n content_tag(:tr, CollectionObject::DwcExtensions::DWC_OCCURRENCE_MAP.keys.collect{|k| content_tag(:th, k)}.join.html_safe, class: [:error])\n end",
"def content_button_td_styles\n \"padding: 5px 10px; background: #08C; border: 1px solid #002A80; border-color: #3CF #002A80 #002A80 #3CF;\"\n end",
"def render_row (class_prefix, key=nil, value=nil, tooltip=nil)\n\n row_id = if key\n \"r\" + (key.to_s + value.to_s).hash.to_s\n else\n nil\n end\n\n unless key\n key = \" \"\n value = \" \"\n end\n\n key = h(key)\n value = h(value) unless value.to_s[0, 1] == '<'\n\n s = \"\"\n s << \"<div\"\n s << \" class='#{class_prefix}_entry'\"\n\n if row_id\n s << \" id='#{row_id}'\"\n s << \" onmouseover=\\\"\"+omover(row_id, \"#{class_prefix}_entry_over\")+\"\\\"\"\n s << \" onmouseout=\\\"\"+omout(row_id, \"#{class_prefix}_entry_over\")+\"\\\"\"\n end\n\n s << \">\"\n s << \"<div class='#{class_prefix}_key'\"\n s << \" title='#{tooltip}'\" if tooltip\n s << \">#{key}</div>\"\n s << \"<div class='#{class_prefix}_value'>#{value}</div>\"\n s << \"<div style='clear:both;'></div>\"\n s << \"</div>\"\n\n s\n end",
"def getStyledClassName(className)\r\n return CodeNameStyling.getStyled(className, @langProfile.classNameStyle)\r\n end",
"def input_html_classes; end",
"def edifice_body_classes\n %(c_#{view_path} v_#{view_name} l_#{layout_name}).html_safe\n end",
"def class_name\n %x{\n var first = self[0];\n return (first && first.className) || \"\";\n }\n end",
"def css_class(name_prefix='')\n\t\t\"#{name_prefix}group\"\n\tend",
"def generic_resources_table_rows\n # Remove hidden column inside table\n expand(account_details_icon)\n output = generic_resources_table.rows_text.map{ |row| row[0..3] }\n output[2] = output[2] + ['','']\n output\n end",
"def to_s\n \"#<#{classname}>\"\n end",
"def grid_row_model_class\n row_model_class\n end",
"def grid_row_model_class\n row_model_class\n end",
"def klass\n @properties.map { |symbol|\n symbol.to_s\n }.join(\" \") unless @properties.empty?\n end",
"def classes\n kwattr_values(\"class\")\n end",
"def classes\n @class_list ||= Element::Classes.new(self)\n end",
"def theme_css_class_prefix\n 'text-'\n end",
"def scaffold_table_class(type)\n @scaffold_table_classes ||= {}\n @scaffold_table_classes[type] ||= SCAFFOLD_OPTIONS[:table_classes][type]\n end",
"def new_row(chunk)\n new_class = {\n '-' => '',\n '+' => 'ins',\n '=' => 'unchanged',\n '!' => 'ins'\n }[chunk.action]\n [new_class.empty?, chunk.new_element.map { |el| %(<td class=\"#{new_class}\">#{el}</td>) }]\n end",
"def map_objectName_className(ui_file)\n doc = REXML::Document.new File.new ui_file\n mapping = Hash.new\n REXML::XPath.each( doc, \"//widget\")do |ele|\n mapping[ele.attributes[\"name\"]] = ele.attributes[\"class\"]\n end\n mapping\n end",
"def css_classes_for_map(classname, mapping)\n css = mapping[classname]\n css.class == String ? css_classes_for_map(css, mapping) : (css || [])\n end",
"def header_class(header)\n if @sort == header then 'hilite' end\n end",
"def to_s\n css = \"#{@name} {\\n\"\n @properties.each_pair { |k, v| css += \" #{k}: #{v};\\n\" }\n css += \"}\\n\\n\"\n @children.each { |c| css += c.to_s }\n css\n end",
"def attributes\n final_class_names = css_class_names\n final_styles = css_styles\n\n ret = @attributes.map do |key,value|\n\n # if the css class or css style is declared, replace the current\n # set coming from the view_helper\n if key.to_sym == :class && value\n final_class_names = value\n nil\n elsif key.to_sym == :style && value\n final_styles = value\n nil\n else\n value ? %(#{key}=\"#{value}\") : nil\n end\n end\n\n # add in class names\n final_class_names = [final_class_names].flatten\n final_class_names << @item_id\n final_class_names.compact!\n unless final_class_names.empty?\n ret << %(class=\"#{final_class_names.uniq * ' '}\")\n end\n\n # add in styles\n unless final_styles.nil?\n final_styles = [final_styles].flatten\n final_styles.compact!\n ret << %(style=\"#{final_styles.uniq * ' '}\") unless final_styles.empty?\n end\n\n ret.compact * ' '\n end"
] | [
"0.8176047",
"0.7195995",
"0.6565542",
"0.6363355",
"0.6196096",
"0.61606354",
"0.6089686",
"0.603053",
"0.60292846",
"0.6017251",
"0.5993414",
"0.5990317",
"0.5970405",
"0.5847365",
"0.5805924",
"0.58026206",
"0.57095754",
"0.5702482",
"0.56894624",
"0.5634108",
"0.56287485",
"0.56136036",
"0.5592118",
"0.5592118",
"0.55495864",
"0.55495864",
"0.55021054",
"0.5475572",
"0.54625285",
"0.54540503",
"0.5451996",
"0.5431232",
"0.5429827",
"0.5414408",
"0.54088604",
"0.5408706",
"0.53859776",
"0.53854567",
"0.53811204",
"0.5346035",
"0.5328501",
"0.5319071",
"0.53184676",
"0.5314752",
"0.529616",
"0.52836823",
"0.5278285",
"0.5278262",
"0.52609557",
"0.52460283",
"0.52296907",
"0.52197397",
"0.5217089",
"0.52045774",
"0.5200512",
"0.5191965",
"0.518473",
"0.51549864",
"0.51532537",
"0.51507986",
"0.5136269",
"0.513467",
"0.5109972",
"0.510981",
"0.5102578",
"0.5100751",
"0.5097504",
"0.5092422",
"0.5069881",
"0.5038334",
"0.5013362",
"0.5005493",
"0.50034875",
"0.49833605",
"0.4983122",
"0.49755624",
"0.496791",
"0.49640614",
"0.49506456",
"0.4944267",
"0.4941004",
"0.49367252",
"0.49324605",
"0.49230668",
"0.49228483",
"0.49173513",
"0.4911859",
"0.4909034",
"0.4909034",
"0.49087706",
"0.49025318",
"0.49020505",
"0.4888834",
"0.48731527",
"0.48690766",
"0.48564562",
"0.48467463",
"0.48431486",
"0.48375672",
"0.4835307"
] | 0.82030976 | 0 |
GET /form_templates GET /form_templates.json | def index
@form_templates = FormTemplate.where(:is_current => true)
respond_to do |format|
format.html # index.html.erb
format.json { render json: @form_templates }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @form_templates = FormTemplate.all\n end",
"def form_templates\n FormTemplate.where(lecturer_id: @id)\n end",
"def templates\n response = get \"storage/template\"\n data = JSON.parse response.body\n data\n end",
"def templates\n response = get 'templates'\n response.map{|item| Hashie::Mash.new(item)}\n end",
"def form_json\n render template: 'utils/form_json'\n end",
"def list\n @client.call(method: :get, path: 'templates')\n end",
"def list\n @client.make_request :get, templates_path\n end",
"def get_templates(opts={})\n path = '/template/list'\n opts[:query] = create_search_string(opts[:query]) if opts[:query]\n query = create_query_string(opts, [:page, :page_size, :query])\n path += query\n HelloSign::Resource::ResourceArray.new get(path, opts), 'templates', HelloSign::Resource::Template\n end",
"def index\n @template_form_fields = TemplateFormField.all\n end",
"def index\n @templates = Template.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @templates }\n end\n end",
"def get_job_templates\n dprint \"get /api/v1/job_templates\"\n resp = @rest['/api/v1/job_templates'].get\n dprint resp\n # ruby's implicit return\n JSON.parse(resp)[\"results\"]\n end",
"def index\n @question_templates = QuestionTemplate.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @question_templates }\n end\n end",
"def mcget_templates\n # setup_mcapi.folders.list(\"template\")\n setup_mcapi.templates.list({user: true},{include_drag_and_drop: true})\n end",
"def template_use_case\n @use_case_template = UseCaseTemplate.find(params[:use_case_template_id])\n @json_obj = JSON.parse(@use_case_template.template_form)\n\n respond_to do |format|\n format.js {render 'template_form'}\n end\n end",
"def show\n respond_ok \"template\", @templates\n end",
"def details\n response = CreateSend.get \"/templates/#{template_id}.json\", {}\n Hashie::Mash.new(response)\n end",
"def index\n @exercise_templates = ExerciseTemplate.all\n render json: @exercise_templates\n end",
"def create_template_lists(options = {})\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/template/lists.json'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare form parameters.\r\n _parameters = {\r\n 'type' => options['type'],\r\n 'page' => options['page'],\r\n 'pagesize' => options['pagesize'],\r\n 'Shortcode' => options['shortcode']\r\n }\r\n _parameters = APIHelper.form_encode_parameters(_parameters)\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n parameters: _parameters\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end",
"def templates(params = {})\n @api.get(\"#{@api.path}/List/#{@id}/Templates\", params: params)\n end",
"def index\n @request_templates = RequestTemplate.all\n end",
"def details\n response = get \"/templates/#{template_id}.json\", {}\n Hashie::Mash.new(response)\n end",
"def index\n @templates = @firm.templates\n @template = Template.new\n end",
"def index\n @admin_templates = Template.order('id desc').page(params[:page]).per(10)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_templates }\n end\n end",
"def get_driver_templates\n @client.raw('get', '/content/email-templates/driver/templates')\n end",
"def templates; end",
"def index\n if params[:name]\n @template = Template.find_by_name(params[:name])\n if @template\n respond_ok \"template\", @template\n else\n respond_err \"template\", Template.new, \"i18> No template found\"\n end\n else\n @templates = Template.all\n if [email protected]?\n respond_ok \"template\", @templates\n else\n respond_err \"template\", @templates, \"i18> No template found\"\n end\n end\n end",
"def new\n @admin_template = Template.new\n @admin_template.build_template_content\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_template }\n end\n end",
"def list_templates(type)\n res = http_get(:uri=>\"/editor/#{type}/templates\", :fields=>x_cookie)\n end",
"def index\n @templates = Template.all\n end",
"def index\n @templates = Template.all\n end",
"def index\n @templates = Template.all\n end",
"def get_templates(limit = 100, offset = 0)\n params = { :limit => limit, :offset => offset }\n\n request :get, \"/v3/templates.json\", params\n end",
"def possible_templates\n\t\tif !params[:funder].nil? && params[:funder] != \"\" && params[:funder] != \"undefined\" then\n\t\t\tfunder = Organisation.find(params[:funder])\n\t\telse\n\t\t\tfunder = nil\n\t\tend\n\t\tif !params[:institution].nil? && params[:institution] != \"\" && params[:institution] != \"undefined\" then\n\t\t\tinstitution = Organisation.find(params[:institution])\n\t\telse\n\t\t\tinstitution = nil\n\t\tend\n\t\ttemplates = {}\n\t\tunless funder.nil? then\n\t\t\tfunder.published_templates.each do |t|\n\t\t\t\ttemplates[t.id] = t.title\n\t\t\tend\n\t\tend\n\t\tif templates.count == 0 && !institution.nil? then\n\t\t\tinstitution.published_templates.each do |t|\n\t\t\t\ttemplates[t.id] = t.title\n\t\t\tend\n\t\t\tinstitution.children.each do |o|\n\t\t\t\to.published_templates.each do |t|\n\t\t\t\t\ttemplates[t.id] = t.title\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\trespond_to do |format|\n\t\t\tformat.json { render json: templates.to_json }\n\t\tend\n\tend",
"def templates\n return self.class.get('/templates').parsed_response.map do |template|\n Template.new(template['template_id'], template['name'])\n end\n end",
"def index\n @templates = ::Template.all\n end",
"def index\n @email_templates = EmailTemplate.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @email_templates }\n end\n end",
"def editor_templates (type, uuid)\n res = http_get(:uri=>\"/editor/#{type}/templates/#{uuid}\", :fields=>x_cookie)\n end",
"def list_templates(args = {})\n filter = args[:filter] || 'featured'\n params = {\n 'command' => 'listTemplates',\n 'templateFilter' => filter\n }\n params['projectid'] = args[:project_id] if args[:project_id]\n params['zoneid'] = args[:zone_id] if args[:zone_id]\n \n json = send_request(params)\n json['template'] || []\n end",
"def index\n @question_templates = QuestionTemplate.all\n end",
"def get_course_templates_schema\n path = \"/d2l/api/lp/#{$lp_ver}/coursetemplates/schema\"\n _get(path)\n # This action returns a JSON array of SchemaElement blocks.\nend",
"def new\n @template = Template.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @template }\n end\n end",
"def show\n @form_template = FormTemplate.find(params[:id])\n\n # Preserve previous form templates' contents when they are edited\n # So that the previously filled forms relying on them will not be broken\n if !@form_template.ror_contents or\n @form_template.ror_contents != raw_form_to_ror_form(@form_template.contents)\n\n if not (@form_template.filled_forms.nil? or @form_template.filled_forms.empty?)\n @form_template.update_attributes(:is_current => false)\n @form_template = FormTemplate.new(@form_template.attributes)\n @form_template[:created_at] = nil\n @form_template[:updated_at] = nil\n @form_template[:is_current] = true\n end\n\n @form_template.ror_contents = raw_form_to_ror_form(@form_template.contents)\n @form_template.save\n end\n\n @filled_form = @form_template.filled_forms.build\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @form_template }\n end\n end",
"def index\n @my_templates = MyTemplate.all\n end",
"def index\n @message_templates = @company.message_templates\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @message_templates }\n end\n end",
"def index\n authorize! :manage, :all\n @question_templates = QuestionTemplate.all\n end",
"def template_params\n params.require(:template).permit(:name, elements: [:type, :ordinal])\n end",
"def guardian_sms_templates\n path = \"#{guardian_factors_path}/sms/templates\"\n get(path)\n end",
"def index\n @templates = EmailTemplate.all\n end",
"def create\n @form_template = FormTemplate.new(form_template_params)\n\n respond_to do |format|\n if @form_template.save\n format.html { redirect_to @form_template, notice: 'Formularvorlage wurde erfolgreich angelegt' }\n format.json { render :show, status: :created, location: @form_template }\n else\n format.html { render :new }\n format.json { render json: @form_template.errors, status: :unprocessable_entity }\n end\n end\n end",
"def template_params\n params.fetch(:template, {}).permit([:title, :data])\n end",
"def template_params\n params.require(:template).permit(:name, :content)\n end",
"def index\n @template = Template.find(params[:template_id])\n @template_parameters = TemplateParameter.where(template_id: params[:template_id])\n end",
"def config_templates\r\n ConfigTemplatesController.instance\r\n end",
"def show\n redirect_to edit_request_path(@request) if current_user.admin? && @request.pending?\n @request_templates = RequestTemplate.all\n end",
"def new\n @email_template = EmailTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @email_template }\n end\n end",
"def new\n @email_template = EmailTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @email_template }\n end\n end",
"def new\n @project_template = ProjectTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project_template }\n end\n end",
"def templates\n wayfinder.decorated_templates\n end",
"def set_form_template\n @form_template = FormTemplate.find(params[:id])\n end",
"def template_params\n params.require(:template).permit(:name, :path, elements: [:key, :type, :content])\n end",
"def template_params\n params.require(:template).permit(:name)\n end",
"def new\n @gift_template = GiftTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gift_template }\n end\n end",
"def index\n @template_fields = TemplateField.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @template_fields }\n end\n end",
"def new\n @invoice_template = InvoiceTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice_template }\n end\n end",
"def index\n @invitation_templates = InvitationTemplate.all\n end",
"def index\n authorize @organization, :show_templates?\n @survey_templates = @organization.survey_templates\n end",
"def index\n @product_templates = ProductTemplate.all\n end",
"def index\n @node_templates = NodeTemplate.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @node_templates }\n end\n end",
"def new\n @newsletters_template = Newsletters::Template.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newsletters_template }\n end\n end",
"def search_templates_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TextMagicApi.search_templates ...'\n end\n # resource path\n local_var_path = '/api/v2/templates/search'\n\n # query parameters\n query_params = {}\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'ids'] = opts[:'ids'] if !opts[:'ids'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'content'] = opts[:'content'] if !opts[:'content'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SearchTemplatesPaginatedResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TextMagicApi#search_templates\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def get_templates(name)\n raise('wrong type: String required') unless name.is_a?(String)\n raise('wrong value: name must be valid') unless !name.nil? && !name.empty?\n\n r = @client.post({\n 'action' => 'gettemplate',\n 'object' => 'htpl',\n 'values' => name,\n }.to_json)\n\n templates = []\n JSON.parse(r)['result'].each do |data|\n host_template = ::Centreon::HostTemplate.new\n host_template.id = data['id'].to_i\n host_template.name = data['name']\n templates << host_template\n end\n\n templates\n end",
"def templates_path\n @templates_path\n end",
"def index\n @templates = Spree::Template.all\n end",
"def template_params\n params.require(:template).permit(:content)\n end",
"def cft_list\n @client.make_request :get, templates_path('cft')\n end",
"def templates\n @templates ||= TemplateFinder.new(path, types)\n end",
"def find_templates(name, prefix, partial, details)\n conditions = {\n path: normalize_path(name, prefix),\n locale: normalize_array(details[:locale]).first,\n format: normalize_array(details[:formats]).first,\n handler: normalize_array(details[:handlers]),\n partial: partial || false\n }\n\n ::Page.visible(user_sign_in_status).where(conditions).map do |record|\n initialize_template(record)\n end\n end",
"def get_available_template_types\n\t\tskin = @params['from']\n\t\tskin_dir = File.join(THEMES, skin)\n\t\toptions = []\n\t\tif File.exists? File.join(skin_dir, \"templates\", \"skin.liquid\")\n\t\t\toptions << create_checkbox(\"functions\", \"rooms\", \"Rooms\", \"validate-one-required\")\n\t\tend\n\t\tif File.exists? File.join(skin_dir, \"templates\", \"tickets\")\n\t\t\toptions << create_checkbox(\"functions\", \"events\", \"Events\", \"validate-one-required\")\n\t\tend\n\t\tif File.exists? File.join(skin_dir, \"templates\", \"vouchers\")\n\t\t options << create_checkbox(\"functions\", \"vouchers\", \"Vouchers\", \"validate-one-required\")\n\t\tend\n\t\toptions = options.join(\"<br />\")\n\t\trender :text => options\n\tend",
"def new\n @message_template = @company.message_templates.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message_template }\n end\n end",
"def show\n @admin_template = Template.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_template }\n end\n end",
"def get_template(template); end",
"def templates\n @templates ||= EbanqApi::Templates.new(self)\n end",
"def index\n @score_templates = ScoreTemplate.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @score_templates }\n end\n end",
"def new\n @question_template = QuestionTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @question_template }\n end\n end",
"def index\n @templates = Template.order(:name).page params[:page]\n end",
"def get_template\n @template\n end",
"def index\n @bulk_message_templates = BulkMessageTemplate.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bulk_message_templates }\n end\n end",
"def retrieve_all_template_info\n puts \"Retrieving all template ids and names for #{@primary_username} ...\"\n puts\n\n uri = URI(@config['endpoint'])\n\n # Retrieve templates\n http = Net::HTTP.new( uri.host,uri.port )\n http.use_ssl = true\n request = Net::HTTP::Get.new( uri.request_uri )\n request.basic_auth(@primary_username, @primary_password)\n\n response = http.request( request )\n templates = JSON.parse( response.body )\n\n # Create template_id array\n @template_array = Array.new\n\n # Create a template hash w/ name and id for each template found\n templates['templates'].each do |t|\n @template_array.push({:id => t['id'], :name => t['name']})\n end\n\n # Return constructed temmplate array\n return template_array\n end",
"def get_policy_templates\n @command = :get_policy_templates\n # get the policy templates from the RESTful API (as an array of objects)\n uri = URI.parse @uri_string + '/templates'\n result = hnl_http_get(uri)\n unless result.blank?\n # convert it to a sorted array of objects (from an array of hashes)\n sort_fieldname = 'template'\n result = hash_array_to_obj_array(expand_response_with_uris(result), sort_fieldname)\n end\n # and print the result\n print_object_array(result, \"Policy Templates:\", :style => :table)\n end",
"def index\n @doc_templates = DocTemplate.all\n end",
"def templates\n state(metrics: \"metadata\").dig(\"metadata\", \"templates\")\n end",
"def new\n @admin_template_software = TemplateSoftware.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_template_software }\n end\n end",
"def index\n @_templates = @site.templates.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @_templates }\n end\n end",
"def new\n @template = Template.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @template }\n end\n end",
"def index\n @survey_item_templates = SurveyItemTemplate.all\n end",
"def new\n @admin_kpi_template = Admin::KpiTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_kpi_template }\n end\n end",
"def index\n\t\t@forms = @client.forms.all\n\n\t\trespond_to do |format|\n \t\tformat.html # index.html.erb\n \t\tformat.json { render json: @forms }\n \tend\n\tend",
"def templates\n @conn.templates\n end",
"def index\n @templates = Template.includes(:template_elements).all\n end",
"def show\n @template = Template.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @template }\n end\n end"
] | [
"0.7324039",
"0.71069056",
"0.70216703",
"0.6924033",
"0.6899663",
"0.68102884",
"0.6769081",
"0.6629335",
"0.6546098",
"0.6534867",
"0.6531811",
"0.64924777",
"0.6423376",
"0.6407678",
"0.6398074",
"0.6396821",
"0.6366459",
"0.6353628",
"0.6345521",
"0.632177",
"0.630982",
"0.62963563",
"0.6234918",
"0.6228811",
"0.62222534",
"0.61872977",
"0.6165109",
"0.61559856",
"0.6155201",
"0.6155201",
"0.6155201",
"0.6133691",
"0.6116164",
"0.6115382",
"0.61148524",
"0.60907894",
"0.60844487",
"0.6056503",
"0.605198",
"0.60445595",
"0.60151297",
"0.60142386",
"0.6010786",
"0.5984268",
"0.5964714",
"0.5956438",
"0.59362423",
"0.59319055",
"0.59241706",
"0.5910559",
"0.5897912",
"0.58976173",
"0.5897048",
"0.58894426",
"0.58792025",
"0.58792025",
"0.5871282",
"0.58660483",
"0.58637315",
"0.58589506",
"0.5858618",
"0.58503443",
"0.58461183",
"0.58417267",
"0.5840293",
"0.5839007",
"0.5829906",
"0.5827086",
"0.58235973",
"0.5821529",
"0.581721",
"0.5815294",
"0.58104235",
"0.5808648",
"0.5804049",
"0.5797036",
"0.579554",
"0.5793048",
"0.5791473",
"0.576958",
"0.5768144",
"0.576428",
"0.57598364",
"0.57556325",
"0.574236",
"0.57417023",
"0.5741672",
"0.5741336",
"0.5734259",
"0.5733156",
"0.5732574",
"0.57314",
"0.57291865",
"0.57270646",
"0.5723178",
"0.57228196",
"0.5722197",
"0.5711735",
"0.5707325",
"0.5704096"
] | 0.70837295 | 2 |
GET /form_templates/1 GET /form_templates/1.json | def show
@form_template = FormTemplate.find(params[:id])
# Preserve previous form templates' contents when they are edited
# So that the previously filled forms relying on them will not be broken
if !@form_template.ror_contents or
@form_template.ror_contents != raw_form_to_ror_form(@form_template.contents)
if not (@form_template.filled_forms.nil? or @form_template.filled_forms.empty?)
@form_template.update_attributes(:is_current => false)
@form_template = FormTemplate.new(@form_template.attributes)
@form_template[:created_at] = nil
@form_template[:updated_at] = nil
@form_template[:is_current] = true
end
@form_template.ror_contents = raw_form_to_ror_form(@form_template.contents)
@form_template.save
end
@filled_form = @form_template.filled_forms.build
respond_to do |format|
format.html # show.html.erb
format.json { render json: @form_template }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @form_templates = FormTemplate.all\n end",
"def index\n @form_templates = FormTemplate.where(:is_current => true)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @form_templates }\n end\n end",
"def form_json\n render template: 'utils/form_json'\n end",
"def form_templates\n FormTemplate.where(lecturer_id: @id)\n end",
"def templates\n response = get \"storage/template\"\n data = JSON.parse response.body\n data\n end",
"def template_use_case\n @use_case_template = UseCaseTemplate.find(params[:use_case_template_id])\n @json_obj = JSON.parse(@use_case_template.template_form)\n\n respond_to do |format|\n format.js {render 'template_form'}\n end\n end",
"def details\n response = CreateSend.get \"/templates/#{template_id}.json\", {}\n Hashie::Mash.new(response)\n end",
"def details\n response = get \"/templates/#{template_id}.json\", {}\n Hashie::Mash.new(response)\n end",
"def list\n @client.make_request :get, templates_path\n end",
"def index\n @template_form_fields = TemplateFormField.all\n end",
"def index\n @templates = Template.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @templates }\n end\n end",
"def index\n @exercise_templates = ExerciseTemplate.all\n render json: @exercise_templates\n end",
"def list\n @client.call(method: :get, path: 'templates')\n end",
"def index\n @question_templates = QuestionTemplate.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @question_templates }\n end\n end",
"def new\n @admin_template = Template.new\n @admin_template.build_template_content\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_template }\n end\n end",
"def index\n @admin_templates = Template.order('id desc').page(params[:page]).per(10)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_templates }\n end\n end",
"def templates\n response = get 'templates'\n response.map{|item| Hashie::Mash.new(item)}\n end",
"def index\n @templates = @firm.templates\n @template = Template.new\n end",
"def get_job_templates\n dprint \"get /api/v1/job_templates\"\n resp = @rest['/api/v1/job_templates'].get\n dprint resp\n # ruby's implicit return\n JSON.parse(resp)[\"results\"]\n end",
"def new\n @template = Template.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @template }\n end\n end",
"def index\n if params[:name]\n @template = Template.find_by_name(params[:name])\n if @template\n respond_ok \"template\", @template\n else\n respond_err \"template\", Template.new, \"i18> No template found\"\n end\n else\n @templates = Template.all\n if [email protected]?\n respond_ok \"template\", @templates\n else\n respond_err \"template\", @templates, \"i18> No template found\"\n end\n end\n end",
"def new\n @project_template = ProjectTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project_template }\n end\n end",
"def show\n respond_ok \"template\", @templates\n end",
"def index\n @request_templates = RequestTemplate.all\n end",
"def index\n @templates = Template.all\n end",
"def index\n @templates = Template.all\n end",
"def index\n @templates = Template.all\n end",
"def get_templates(opts={})\n path = '/template/list'\n opts[:query] = create_search_string(opts[:query]) if opts[:query]\n query = create_query_string(opts, [:page, :page_size, :query])\n path += query\n HelloSign::Resource::ResourceArray.new get(path, opts), 'templates', HelloSign::Resource::Template\n end",
"def show\n @admin_template = Template.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_template }\n end\n end",
"def mcget_templates\n # setup_mcapi.folders.list(\"template\")\n setup_mcapi.templates.list({user: true},{include_drag_and_drop: true})\n end",
"def set_form_template\n @form_template = FormTemplate.find(params[:id])\n end",
"def index\n @templates = ::Template.all\n end",
"def show\n @template = Template.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @template }\n end\n end",
"def new\n @gift_template = GiftTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gift_template }\n end\n end",
"def new\n @invoice_template = InvoiceTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice_template }\n end\n end",
"def index\n @my_templates = MyTemplate.all\n end",
"def show\n @template = Template.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @template }\n end\n end",
"def index\n @question_templates = QuestionTemplate.all\n end",
"def new\n @admin_kpi_template = Admin::KpiTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_kpi_template }\n end\n end",
"def index\n @email_templates = EmailTemplate.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @email_templates }\n end\n end",
"def new\n @email_template = EmailTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @email_template }\n end\n end",
"def new\n @email_template = EmailTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @email_template }\n end\n end",
"def new\n @admin_template_software = TemplateSoftware.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_template_software }\n end\n end",
"def index\n @template = Template.find(params[:template_id])\n @template_parameters = TemplateParameter.where(template_id: params[:template_id])\n end",
"def templates(params = {})\n @api.get(\"#{@api.path}/List/#{@id}/Templates\", params: params)\n end",
"def show\n @project_template = ProjectTemplate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project_template }\n end\n end",
"def new\n @template = Template.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @template }\n end\n end",
"def create_template_lists(options = {})\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/template/lists.json'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare form parameters.\r\n _parameters = {\r\n 'type' => options['type'],\r\n 'page' => options['page'],\r\n 'pagesize' => options['pagesize'],\r\n 'Shortcode' => options['shortcode']\r\n }\r\n _parameters = APIHelper.form_encode_parameters(_parameters)\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n parameters: _parameters\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end",
"def new\n @newsletters_template = Newsletters::Template.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newsletters_template }\n end\n end",
"def new\n @question_template = QuestionTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @question_template }\n end\n end",
"def index\n @message_templates = @company.message_templates\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @message_templates }\n end\n end",
"def get_course_templates_schema\n path = \"/d2l/api/lp/#{$lp_ver}/coursetemplates/schema\"\n _get(path)\n # This action returns a JSON array of SchemaElement blocks.\nend",
"def new\n @template_task = TemplateTask.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @template_task }\n end\n end",
"def new\n @message_template = @company.message_templates.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message_template }\n end\n end",
"def editor_templates (type, uuid)\n res = http_get(:uri=>\"/editor/#{type}/templates/#{uuid}\", :fields=>x_cookie)\n end",
"def get_template(template); end",
"def list_templates(type)\n res = http_get(:uri=>\"/editor/#{type}/templates\", :fields=>x_cookie)\n end",
"def templates; end",
"def get_template\n @template\n end",
"def index\n @product_templates = ProductTemplate.all\n end",
"def new\n @template_package = TemplateAuthor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @template_package }\n end\n end",
"def index\n @survey_item_templates = SurveyItemTemplate.all\n end",
"def new\n @page_template = PageTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page_template }\n end\n end",
"def show\n @question_template = QuestionTemplate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @question_template }\n end\n end",
"def index\n @node_templates = NodeTemplate.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @node_templates }\n end\n end",
"def get_driver_templates\n @client.raw('get', '/content/email-templates/driver/templates')\n end",
"def index\n @templates = EmailTemplate.all\n end",
"def index\n authorize! :manage, :all\n @question_templates = QuestionTemplate.all\n end",
"def create\n @form_template = FormTemplate.new(form_template_params)\n\n respond_to do |format|\n if @form_template.save\n format.html { redirect_to @form_template, notice: 'Formularvorlage wurde erfolgreich angelegt' }\n format.json { render :show, status: :created, location: @form_template }\n else\n format.html { render :new }\n format.json { render json: @form_template.errors, status: :unprocessable_entity }\n end\n end\n end",
"def get_templates(limit = 100, offset = 0)\n params = { :limit => limit, :offset => offset }\n\n request :get, \"/v3/templates.json\", params\n end",
"def config_templates\r\n ConfigTemplatesController.instance\r\n end",
"def new\n @inventory_template = InventoryTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.js\n format.json { render json: @inventory_template }\n end\n end",
"def show\n redirect_to edit_request_path(@request) if current_user.admin? && @request.pending?\n @request_templates = RequestTemplate.all\n end",
"def index\n @item_templates = ItemTemplate.all\n end",
"def index\n @score_templates = ScoreTemplate.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @score_templates }\n end\n end",
"def select_template\n templatelist = []\n templatelist\n end",
"def get_templates(name)\n raise('wrong type: String required') unless name.is_a?(String)\n raise('wrong value: name must be valid') unless !name.nil? && !name.empty?\n\n r = @client.post({\n 'action' => 'gettemplate',\n 'object' => 'htpl',\n 'values' => name,\n }.to_json)\n\n templates = []\n JSON.parse(r)['result'].each do |data|\n host_template = ::Centreon::HostTemplate.new\n host_template.id = data['id'].to_i\n host_template.name = data['name']\n templates << host_template\n end\n\n templates\n end",
"def index\n @templates = Template.order(:name).page params[:page]\n end",
"def index\n @bulk_message_templates = BulkMessageTemplate.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bulk_message_templates }\n end\n end",
"def new\n @bulk_message_template = BulkMessageTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bulk_message_template }\n end\n end",
"def template_params\n params.require(:template).permit(:name, elements: [:type, :ordinal])\n end",
"def template(name)\n @conn.templates.get(name)\n end",
"def index\n @templates = Template.includes(:template_elements).all\n end",
"def new\n @purchase_template = PurchaseTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @purchase_template }\n end\n end",
"def index\n @invitation_templates = InvitationTemplate.all\n end",
"def index\n @templates = Spree::Template.all\n end",
"def get_content_template(id)\n @client.raw('get', \"/content/templates/#{id}\")\n end",
"def template_details(template_id)\n @api.get(\"#{@api.path}/List/#{@id}/Templates/#{template_id}\")\n end",
"def index\n @doc_templates = DocTemplate.all\n end",
"def new\n @print_template = PrintTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @print_template }\n end\n end",
"def templates\n return self.class.get('/templates').parsed_response.map do |template|\n Template.new(template['template_id'], template['name'])\n end\n end",
"def index\n\t\t@forms = @client.forms.all\n\n\t\trespond_to do |format|\n \t\tformat.html # index.html.erb\n \t\tformat.json { render json: @forms }\n \tend\n\tend",
"def template\n @template\n end",
"def index\n @template_fields = TemplateField.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @template_fields }\n end\n end",
"def templates_path\n @templates_path\n end",
"def retrieve_single_template( template_id )\n puts \"Retrieving template id #{template_id}.\"\n\n uri = URI(@config['endpoint'] + '/' + template_id)\n\n # Retrieve templates\n http = Net::HTTP.new( uri.host,uri.port )\n http.use_ssl = true\n request = Net::HTTP::Get.new( uri.request_uri )\n request.basic_auth(@primary_username, @primary_password)\n\n response = http.request( request )\n template = JSON.parse( response.body )\n end",
"def index\n @templates = Template.all\n\n \n\n\n @templates.each do |template|\n\n if template.templateVersion.nil?\n\n logger.info \"NIL VERSION: \" + template.id.to_s\n else\n logger.info \"VERSION: \" + template.templateVersion.to_s\n end\n\n template.fields = template.getFieldsNames.join(\",\");\n\n\n end\n end",
"def show\n @invoice_template = InvoiceTemplate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @invoice_template }\n end\n end",
"def template_params\n params.require(:template).permit(:name)\n end",
"def show\n @admin_template_software = TemplateSoftware.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_template_software }\n end\n end"
] | [
"0.7255488",
"0.7147867",
"0.68611133",
"0.684872",
"0.68084496",
"0.65847546",
"0.65817285",
"0.6574959",
"0.65309227",
"0.65224755",
"0.6520631",
"0.651479",
"0.6492878",
"0.6476686",
"0.6460299",
"0.6403384",
"0.63954026",
"0.6393296",
"0.6359617",
"0.6331609",
"0.63021845",
"0.6297714",
"0.6282026",
"0.6278492",
"0.62236756",
"0.62236756",
"0.62236756",
"0.62072605",
"0.6192297",
"0.6183996",
"0.61589164",
"0.61547905",
"0.61498785",
"0.61275446",
"0.61174905",
"0.6116099",
"0.6110739",
"0.61057144",
"0.60753036",
"0.60717124",
"0.60627013",
"0.60627013",
"0.60597795",
"0.605807",
"0.60580385",
"0.6032582",
"0.60274",
"0.60069734",
"0.6001279",
"0.59797883",
"0.59745353",
"0.59728825",
"0.59727335",
"0.5971004",
"0.59666204",
"0.5954426",
"0.5949186",
"0.5927697",
"0.5926645",
"0.5911324",
"0.5909384",
"0.5902717",
"0.5899702",
"0.5895291",
"0.58883506",
"0.58767384",
"0.5872855",
"0.58583295",
"0.58550555",
"0.58533555",
"0.583483",
"0.5831658",
"0.58213013",
"0.5820264",
"0.58183986",
"0.5802859",
"0.5787548",
"0.578439",
"0.57815975",
"0.5780029",
"0.57786846",
"0.5774944",
"0.57645595",
"0.57541466",
"0.5753206",
"0.5752777",
"0.57500803",
"0.5746368",
"0.57445467",
"0.5736697",
"0.57338864",
"0.5733609",
"0.57271695",
"0.57230926",
"0.5721378",
"0.57170594",
"0.571643",
"0.571231",
"0.5707373",
"0.5706877"
] | 0.63436276 | 19 |
def fibonacci(n) current_num = 1 index 0 current_num_next = 1 index 1 count = 1 loop do p current_num = current_num + current_num_next index 2 = index 0+index 1 = 2 p current_num_next = current_num_next + current_num index 3, current_num = current_num_next + current_num index 4 is 5, index 2 + index 3 current_num_next = current_num + current_num_next index 5 is 8, index 3 + index 4 = 3+5 current_num = current_num_next + current_num index 6 is 13 count += 2 break if count > n end current_num end 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 | def fibonacci(n)
current_num = 1
current_num_next = 1
sum = current_num + current_num_next
count = 2
loop do
current_num = current_num_next
current_num_next = sum
sum = current_num + current_num_next
# puts "sum is #{sum} and current value is #{current_num} and current next is #{current_num_next}"
count += 1
break if count > n - 2
end
sum
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fibonacci(n)\n raise ArgumentError, \"n must be an integer greater than 0\" unless n && n >= 0\n current = 0\n one_before = 0\n two_before = 0\n i = 0\n while i <= n\n if i == 1\n current = 1\n else\n two_before = one_before\n one_before = current\n current = one_before + two_before\n end\n i += 1\n end\n return current\nend",
"def fibonacci(n)\n if n == 0\n 0\n elsif n == 1\n 1\n else\n before_previous = 0\n previous = 1\n actual = nil\n (2..n).each do\n actual = previous + before_previous\n before_previous = previous\n previous = actual\n end\n actual\n end\nend",
"def fibonacci(n)\n fibb = []\n fibb[0], fibb[1], fibb[2] = 0, 1, 1\n (3).upto(n) do |i|\n fibb[i] = fibb[i - 2] + fibb[i - 1]\n end\n fibb[n]\n end",
"def fibonacci(n)\n raise ArgumentError if n == nil || n < 0 || n.class != Integer\n return n if n < 2\n\n if n >= 2\n current_value= 0\n previous_value = 1\n next_value = 0\n number = n - 1\n\n number.times do \n next_value = current_value + previous_value \n current_value = previous_value \n previous_value = next_value\n end\n end\n \n return next_value\nend",
"def fib (n)\n # return appropriate starter values if n is 0 or 1\n if n == 0 \n return 0\n elsif n == 1\n return 1\n end\n # set up initial constants\n prevNum = 0\n currNum = 1\n # Loop through fibonacci numbers, starting at index 2.\n 2.upto(n) do\n nextNum = prevNum + currNum\n prevNum = currNum\n currNum = nextNum\n end\n return currNum\nend",
"def fib(n)\n # edge cases:\n if n < 0\n raise Exception, 'Index was negative. No such thing as a negative index in a series.'\n elsif n == 0 || n == 1\n return n\n end\n\n # we'll be building the fibonacci series from the bottom up\n # so we'll need to track the previous 2 numbers at each step\n prev_prev = 0\n prev = 1\n current = prev + prev_prev\n\n # since we already initialized up to the 2nd number in the series\n # we take n - 2 steps ahead to reach n (.times is exclusive)\n (n - 1).times do\n current = prev + prev_prev\n prev_prev = prev\n prev = current\n end\n\n current\nend",
"def fibonacci(n)\n \n return 'not valid' if n <= 0\n arr = [0,1,1]\n return arr[n-1] if n <= 3\n\n initial_number = 0\n next_number = 1\n i = 2\n\n\n \n \n while i < n \n sum = initial_number + next_number \n initial_number = next_number\n next_number = sum\n i += 1\n end\n return sum \n\nend",
"def fibonacci(n)\n return 1 if n <= 2\n num1, num2 = [1, 1]\n index = 2\n while n > index\n running_total = num1 + num2\n num1, num2 = num2, running_total\n n -= 1\n end\n running_total\nend",
"def fib_iterative(n)\n\tnum = 0\n\tnext_num = 1\n\tpositions = 1..n\n\tpositions.each do |position|\n\t\tnum = next_num\n\t\tnext_num = next_num + num\n\tend\n\tretun num\nend",
"def fibonacci(n)\n if n == 0 || n == 1\n return n\n end\n\n first = 0\n second = 1\n current = 1\n\n while n > 2\n first = second\n second = current\n current = first + second\n n -= 1\n end\n\n return current\nend",
"def fib(n)\n return 1 if n <= 2\n \n fib_index = 3\n a, b = 1, 1\n \n while fib_index <= n\n c = a + b\n a = b\n b = c\n fib_index += 1\n end\n \n c\nend",
"def fibonacci_number(n)\n #define nth Fibonacci term\n fibonacci_lst=[0,1] #F1=1,F2=1\n for i in 2..n\n fibonacci_lst[i]=fibonacci_lst[i-1]+fibonacci_lst[i-2]\n end\n return fibonacci_lst[n]\nend",
"def nth_fibonacci(n)\n result = [0,1]\n\n for i in 1..n-1\n result[i+1] = result[i] + result[i-1]\n end\n\n return result[n]\nend",
"def fibonacci(n)\n if n == nil || n < 0\n raise ArgumentError\n elsif n == 0\n return 0\n elsif n == 1\n return 1\n end\n\n first = 0\n second = 1\n\n index = 1\n while index < n\n holder = first + second\n first = second\n second = holder\n index += 1\n end\n return holder\nend",
"def fibs (n) #Non-recursive\n\n\t# n = number of Fibonacci sequence members.\n\t# 0, 1, 1, 2, 3, 5, 8, 13, ..\t\n\tfib_seq = []\n\t(0..n).each do |i|\n\t\tif i == 0\n\t\t\tfib_seq << 0\n\t\telsif i == 1\n\t\t\tfib_seq << 1\n\t\telse\n\t\t\tfib_seq << fib_seq[i-2] + fib_seq[i-1]\n\t\tend\n\tend\n\tfib_seq\nend",
"def nth_fibonacci(n)\n return 0 if n == 1\n sequence = [1]\n (n - 2).times do\n current_number, last_number = sequence.last(2)\n sequence << current_number + (last_number || 0)\n end\n\n sequence.last\nend",
"def iterative_nth_fib(n)\n return 1 if n <= 2\n a = 1\n b = 1\n i = 3\n while i <= n\n new_a = b\n b = a + b\n a = new_a\n i += 1\n end\n b\nend",
"def fibonacci(n)\n raise ArgumentError, \"Not an integer larger than 0\" if !n || n < 0\n\n fib_array = [0, 1]\n i = 0\n\n if n == 0\n return 0\n elsif n == 1\n return 1\n else\n until i == (n - 1)\n fib_array << fib_array[i] + fib_array[i + 1]\n i += 1\n end\n end\n return fib_array[n]\nend",
"def fibonacci(n)\n if n.nil?\n raise ArgumentError.new(\"Invalid\")\n elsif n < 0\n raise ArgumentError.new(\"Invalid\")\n end\n\n return 0 if n == 0\n\n num_one = 0\n num_two = 1\n fib_n = 1\n\n count = n - 1\n\n count.times do\n fib_n = num_one + num_two\n num_one = num_two\n num_two = fib_n\n end\n\n return fib_n\nend",
"def fibonaci(n)\n\tfi= [1, 1]\n\t(n-1).times do\n\t\tfi << fi[1]+fi.shift\n\tend\n\treturn fi[0]\nend",
"def fibonacci(n)\n if n <= 2\n 1\n else\n previous, sum = [1, 1]\n 3.upto(n) do\n previous, sum = [sum, previous + sum]\n end\n sum\n end\nend",
"def fibonacci_iterative(n)\n return 0 if n == 0\n fib_sequence = [0,1]\n index = 1\n until n == index\n fib_sequence << fib_sequence[index] + fib_sequence[index-1]\n index += 1\n end\n fib_sequence.last\nend",
"def fibonacci(n)\n fibonacci_num = 0\n prior_num = 0\n current_num = 1\n\n if !n || n < 0\n raise ArgumentError\n elsif n == 0 || n == 1\n return n\n else \n (n-1).times do\n fibonacci_num = prior_num + current_num\n prior_num = current_num\n current_num = fibonacci_num\n end\n return current_num\n end\nend",
"def fibonacci(n)\n num1, num2 = 1, 1\n counter = 2\n loop do\n break if counter >= n\n num2, num1 = num2 + num1, num2\n counter += 1\n end\n num2\nend",
"def nthFibonacci (n)\n \n if n == 0\n return 0\n end\n\n i = 0\n\n sequence = Array.new\n\n sequence.push(i)\n\n i += 1\n\n sequence.push(i)\n\n while i < n do\n sequence[i+1] = (sequence[-1]) + (sequence[-2])\n\n i += 1\n end\n\n sequence[-1]\nend",
"def nthFibonacci (n)\n # Your code here\n fArr = []\n a = 0\n b = 1\n if n == 0\n fArr << 0\n elsif n == 1\n fArr << 0\n elsif n > 1\n fArr << 0\n while fArr.size < n+1 do\n fArr << b\n a,b = b,a+b\n end\n end\n return fArr[n]\nend",
"def fibonacci(n)\n fib1 = 0\n fib2 = 0\n fib = 0\n\n (1..n).each do |num|\n if num <= 2\n fib = 1\n fib1 = 1\n fib2 = 1\n else\n fib1 = fib2\n fib2 = fib\n fib = fib1 + fib2\n end\n end\n\n fib\nend",
"def fib(n)\n current_value = 0\n next_value = 1\n\n n.times do |i|\n current_value, next_value = next_value, current_value + next_value\n end\n\n return current_value\nend",
"def fibonacci(n)\n first = 0\n second = 1\n current = 1\n\n raise ArgumentError.new(\"n must be a positve number\") if n.nil? || n < 0\n return n if n == 0 || n == 1\n\n while n > 2\n first = second\n second = current\n current = first + second\n n -= 1\n end\n\n return current\nend",
"def fibonacci(n)\n # raise NotImplementedError\n raise ArgumentError if n < 0 || n == nil #error if negative\n\n i = 0\n fib_array = [0, 1] #all fibonacci sequences begin with 0 and 1\n until fib_array.length == n+1 #until the correct index is reached\n fib_array.push fib_array[i] + fib_array[i+1]\n i += 1\n end\n return fib_array[n] #return number at requested index\nend",
"def fib(n) \n if n == 0\n return 0\n else\n\tfib_0 = 0\n\tfib_1 = 1\n\t(1..(n-1)).each do \n\t\ttemp = fib_0\n\t\tfib_0 = fib_1\n\t\tfib_1 = temp + fib_1\n\t\t\n\tend\n\treturn fib_1\n end\nend",
"def fibonacciIterative(n)\n\ti = 1\n\tfib = 1\n\tprev_one = 1\n\tprev_two = 0\n\twhile i<n\n\t\tfib = prev_one + prev_two\n\t\tprev_two = prev_one\n\t\tprev_one = fib\n\t\ti+=1\n\tend\n\treturn fib\nend",
"def fibonacci(num)\n fib_nums = []\n (0...num).each do |i|\n if i == 0 || i == 1\n fib_nums << 1\n next\n end\n fib_nums << fib_nums[i-2] + fib_nums[i-1]\n end\n return fib_nums\nend",
"def fib(n)\n if n == 0\n return 0\n elsif n == 1\n return 1\n end\n\n last = 1\n next_to_last = 0\n i = 2\n\n while i <=n\n cur_fib = last + next_to_last\n next_to_last = last\n last = cur_fib\n i +=1\n end\n return cur_fib\nend",
"def fibonacci(n)\n return 1 if n <= 2\n n1, n2 = [1, 1]\n 3.upto(n) { n1, n2 = [n2, n1 + n2] }\n n2\nend",
"def fibonacci(n)\n result = []\n i = 1\n while i <= n\n if i == 1 || i == 2\n result << 1\n else\n result << result[i - 3] + result[i - 2]\n end\n i += 1\n end\n result.last\nend",
"def nth_fibonacci(n) \n if n == 1\n return 0\n elsif n == 2\n return 1\n end\n return nth_fibonacci(n-1) + nth_fibonacci(n-2)\nend",
"def fibs(n)\n result = []\n penultimate = 0\n last = 1\n ## skips iteration if n = 0\n 1.upto(n) do |num|\n if num == 1\n result << penultimate\n elsif num == 2\n result << last\n else\n next_num = penultimate + last\n penultimate = last\n last = next_num\n result << next_num\n end\n end\n return result\nend",
"def nthFibonacci(n)\r\n if n == 1\r\n return 1\r\n\r\n elsif n == 2\r\n return 1\r\n\r\n else n > 2\r\n n = nthFibonacci(n-1) + nthFibonacci(n-2)\r\n end\r\nend",
"def fib(n)\n prev_fib = 0\n curr_fib = 1\n\n return 0 if n == 0\n return 1 if n == 1\n\n (n - 1).times do\n new_fib = prev_fib + curr_fib\n prev_fib = curr_fib\n curr_fib = new_fib\n end\n\n return curr_fib\nend",
"def fibonacci_iter(n)\n first_prev = 1\n second_prev = 0\n fib_num = 0\n\n (n-2).times do \n fib_num = first_prev + second_prev\n second_prev = first_prev\n first_prev = fib_num\n end\n\n fib_num\nend",
"def fibonacci(n)\n seq = [0,1]\n i = 2\n while i <= n\n seq << (seq[i-1] + seq[i-2])\n i+=1\n end\n return seq[n]\nend",
"def nthFibonacci (n)\r\n num = n.to_i\r\n fibonacci_sequence = Array.new\r\n case num\r\n when 0 \r\n fibonacci_sequence << 0\r\n when 1\r\n fibonacci_sequence << [0,1]\r\n else\r\n fibonacci_sequence[0] = 0\r\n fibonacci_sequence[1] = 1\r\n i = 1\r\n while i < num\r\n i+= 1\r\n fibonacci_sequence[i] = fibonacci_sequence[i-1] + fibonacci_sequence[i-2] \r\n end\r\n end\r\n return fibonacci_sequence\r\nend",
"def fib(n)\n a = 0\n b = 1\n\n while n > 0\n old_b = b\n b = a + b\n a = old_b\n n -= 1\n end\n\n b\n end",
"def fibonacci(n)\n if n == 0\n 1\n elsif n == 1\n 1\n else\n fibonacci(n-2) + fibonacci(n-1)\n end\nend",
"def nthFibonacci (n)\r\n # Your code here\r\n a = 0\r\n b = 1\r\n n.times do\r\n temp = a\r\n a = b\r\n b = temp + b\r\n end\r\n return a\r\nend",
"def fibonacci(n)\n fib = [1, 1]\n while fib.size < n\n fib << fib[-1] + fib[-2]\n end\n fib.last % 10\nend",
"def iter_fib(n)\n return n if n == 0 || n == 1\n\n two_before = 0\n one_before = 1\n\n for i in 2..n\n current = two_before + one_before\n two_before = one_before\n one_before = current\n end\n one_before\nend",
"def fibonacci(n)\n\treturn 0 if n == 0\n\treturn 1 if n == 1\n\tfibonacci(n-1) + fibonacci(n-2)\nend",
"def get_fibonacci(num)\n f = [0,1]\n for i in (2..num)\n f << (f[-1] + f[-2])\n end\n if num == 0\n f = 0\n end\n f[-1]\nend",
"def fibonacci(n)\n return 0 if n == 1\n return 1 if n == 2\n return fibonacci(n-1)+fibonacci(n-2)\nend",
"def fibonacci(n)\n return 1 if n <= 2\n num1 = 1\n num2 = 1\n new_num = 0\n (n-2).times do\n new_num = num1 + num2\n num1 = num2\n num2 = new_num\n end\n new_num\nend",
"def fibonacci_sequence(n)\n counter = 1\n fib_sum = 1\n previous = [1]\n if n == 1 || n == 2\n return 1\n else \n until counter == n - 1\n previous << fib_sum\n fib_sum += previous[counter - 1] \n counter += 1\n end\n return fib_sum\n end\nend",
"def fibonacci(n)\n\tif n == 0 || n == 1\n\t\treturn 1\n\telse\n\t\treturn fibonacci(n-1) + fibonacci(n-2)\n\tend\nend",
"def fibonacci2(n)\n return 0 if n == 0\n return 1 if n == 1 || n == 2\n last = 0\n lastlast = 1\n current = 0\n n.times do\n current = last + lastlast\n lastlast = last\n last = current\n end\n current\nend",
"def fib_iter(n)\n curr_num, next_num = 0, 1\n (n).times do\n curr_num, next_num = next_num, curr_num + next_num\n end\n curr_num\nend",
"def fibonacci(n)\n return 0 if n == 0\n return 1 if n == 1\n\n fibonacci(n - 1) + fibonacci(n - 2)\nend",
"def fib(n)\n if n == 0 || n == 1\n return n\n end\n\n number1 = 0\n number2 = 1\n number3 = 0\n\n (2..n).each do |index|\n number3 = number1 + number2\n number1 = number2\n number2 = number3\n end\n\n return number3\nend",
"def fibonacci(n)\n if n == nil || n < 0\n return raise ArgumentError\n end\n if n == 0\n return n\n end\n arr = [1,1]\n y = 1\n x = 1\n until y == n do\n x = arr[0] + arr[1]\n arr[0] = arr[1]\n arr[1] = x\n y += 1\n end\n return arr[0]\nend",
"def fib(n)\n return fib_num[n] if fib_num[n]\n\n fib_num[n - 2] = fib(n - 2) unless fib_num[n - 2]\n fib_num[n - 1] = fib(n - 1) unless fib_num[n - 1]\n\n return (fib_num[n - 2] + fib_num[n - 1])\n end",
"def fibonacci(n)\n n = fibonacci( n - 1 ) + fibonacci( n - 2 ) if n > 1\n n\nend",
"def fibonacci(n)\n if n <= 2\n 1\n else\n fibonacci(n - 1) + fibonacci(n - 2)\n end\nend",
"def fibonacci(n)\n raise ArgumentError if n.nil? || n < 0\n return 0 if n == 0\n return 1 if n == 1\n\n a = 0\n b = 1\n i = 2\n\n while i <= n\n c = a + b\n a = b\n b = c\n i += 1\n end\n return c\n\nend",
"def fibonacci(n)\n fibo_array = [0, 1]\n if n > 1\n (n-1).times do |i|\n fibo_array.push(fibo_array[i] + fibo_array[i + 1])\n end\n end\n fibo_array[n]\nend",
"def fibonacci(n)\n if n == 1 || n == 2\n 1\n else\n fibonacci(n-1) + fibonacci(n-2)\n end\nend",
"def fibonacci(n)\r\n if n == 0\r\n return 0\r\n elsif n == 1\r\n return 1\r\n else\r\n return fibonacci(n-1) + fibonacci(n-2)\r\n end\r\nend",
"def fibonacci(n)\n raise ArgumentError if n == nil\n raise ArgumentError if n < 0\n\n i = 0\n k = 0\n m = 0\n j = 1\n\n until i > n\n k = k + m\n m = j\n j = k\n i += 1\n end\n\n return k\nend",
"def fib(n)\n\n fib_array = []\n first = 0\n second = 1\n\n if n == 0\n fib_array << nil\n elsif n == 1\n fib_array << 0\n else\n fib_array << 0\n fib_array << 1\n if n >= 3\n (3..n).each do # Due to the zero index of\n # Ruby, we use 3 here to represent the\n # numbers after 0, 1, 1\n\n next_number = (first + second)\n first = second\n fib_array << second = next_number\n\n end\n end\n end\n return fib_array\n\nend",
"def nthFibonacci (n)\r\n # Your code here\r\n f = [0, 1, 1, 2, 3, 5, 8]\r\n if n < 7\r\n return f[n]\r\n end\r\n\r\n t = 6\r\n fn = 8\r\n\r\n while t < n\r\n fn = (fn * PHI).round(0)\r\n t += 1\r\n end\r\n\r\n return fn\r\nend",
"def fibonacci2(n)\n sum = 1\n first_prev = 1\n second_prev = 1\n 3.upto(n) do |num|\n sum = first_prev + second_prev\n first_prev = second_prev\n second_prev = sum\n end\n sum\nend",
"def fibonacci(n)\n raise ArgumentError if n == nil\n raise ArgumentError if n < 0\n return 0 if n == 0\n i = 1\n x = 0\n y = 1\n z = 1\n until i == n\n z = x + y\n x = y\n y = z\n i += 1\n end\n return z\nend",
"def fibonacci(n)\n ary = [0, 1]\n (n - 1).times { |_| ary << ary[-2] + ary[-1] }\n ary.pop\nend",
"def fibonacci_basic(n)\n arr = [1, 1]\n return 1 if n == 1\n until arr.size == n\n arr << arr[-1] + arr[-2]\n end\n arr.last\nend",
"def fibonacci(n)\n if n == nil || n < 0\n raise ArgumentError\n elsif n == 0\n return 0\n elsif n==1\n return 1\n\n end\n\n x = 0\n y = 1\n result = 0\n\n (n-1).times do\n result = x + y\n x = y\n y = result\n\n end\n\n return result\n\nend",
"def fibonacci(n)\n fib_array = []\n fib_index = 1\n a, b = 1, 1\n while fib_index <= n\n c = a\n a = b\n b = c + b\n fib_array << c\n fib_index += 1\n end\n return fib_array\nend",
"def fib_iterate(n)\n\n fib_nums = []\n i = 0\n fib_nums << 0 if n > 0\n fib_nums << 1 if n > 1\n while i < n\n if i > 1\n fib_nums << fib_nums[i-1] + fib_nums[i-2]\n end\n i+= 1\n end\n\n fib_nums\nend",
"def fib(n)\n return 0 if n == 0\n return 1 if n == 1\n \n\n fib(n - 1) + fib(n - 2)\nend",
"def fibonacci(n)\n answer = 0\n (1..n).each do |i|\n answer += i\n end\nend",
"def fibonacci(num)\n array = [1,1]\n n = 0\n\n num.times do\n array << array[n] + array[n + 1]\n n += 1\n end\n\n array[n - 1]\nend",
"def fibonacci(num)\n array = [1,1]\n n = 0\n\n num.times do\n array << array[n] + array[n + 1]\n n += 1\n end\n\n array[n - 1]\nend",
"def fibo(n)\n a, b, c = 0, 0, 0\n for i in 1..n\n c, b = b, a\n a = i== 1 ? 1 : b + c\n end\n return a\nend",
"def fibonacci(n)\n return 1 if n == 1\n return 1 if n == 2\n fibonacci(n - 1) + fibonacci(n - 2)\nend",
"def fib(n)\n if n == 0 || n == 1\n return n\n else\n fib(n - 1) + fib(n - 2)\n end\n end",
"def fib(n)\n \n seq = []\n idx = 0\n loop do \n \n if idx == 0 \n seq.push(0) \n elsif idx == 1\n seq.push(1) \n else\n seq[idx] = seq[idx-1] + seq[idx-2]\n end\n\n break if idx == n\n idx +=1\n end\n\n return seq\n\nend",
"def fib(n)\n return 0 if n == 0\n return 1 if n == 1\n\n return fib(n-1) + fib(n-2)\nend",
"def fibonacci n\n first = 0\n second = 1\n n.times do\n third = first + second\n first = second\n second = third\n end\n first\nend",
"def fibo_finder(n)\n start = [0,1]\n n.times {|i| start[i + 2] = start[i] + start[i + 1]}\n start[n]\nend",
"def nthFibonacci(n)\r\n fibonacci = []\r\n a = 0 \r\n b = 1\r\n\r\n while n >= fibonacci.length\r\n fibonacci.push(a)\r\n fibonacci.push(b)\r\n a = a + b\r\n b = a + b\r\n end\r\n return fibonacci[n]\r\nend",
"def fibs(n)\n\toutput = []\n\t(0..n).each do |num|\n\t\tif num < 2\n\t\t\toutput << num\n\t\telse\n\t\t\toutput << output[num - 2] + output[num - 1]\n\t\tend\n\tend\n\tprint output, \"\\n\\n\"\nend",
"def fibonacci(n)\n return [0,1].take(n) if n <= 2\n fib_seq = fibonacci(n-1)\n last_ele = fib_seq[-1] + fib_seq[-2]\n fib_seq << last_ele\nend",
"def fibonacci(n)\n if n < 2\n n\n else\n fibonacci(n - 1) + fibonacci(n - 2)\n end\nend",
"def fibonacci(n)\r\n return [] if n < 1\r\n return [1] if n == 1\r\n vet = [0, 1]\r\n (n - 2).times{vet << vet[vet.size-1] + vet[vet.size-2]}\r\n return vet\r\nend",
"def fibonacci(number)\n return 1 if number == 1 || number == 2\n \n fib_array = [1, 1]\n\n 3.upto(number) do |num|\n fib_array << (fib_array[num-2] + fib_array[num-3]) \n end\n\n fib_array[number-2] + fib_array[number-3]\nend",
"def fib(n)\n return n if n < 2\n f0, f1 = 0, 1\n (n-1).times { f0, f1 = f1, f0+f1 }\n f1\nend",
"def fib(n)\n fib_0 = 0\n fib_1 = 1\n (0...n).each do \n temp = fib_0\n fib_0 = fib_1\n fib_1 = temp + fib_1\n end\n return fib_1\nend",
"def fibonacci(n)\n if n < 3\n 1\n else\n fibonacci(n-1) + fibonacci(n-2)\n end\nend",
"def fib(n)\n # your implementation here\n if n==0 then\n 1\n elsif n==1 then\n 1\n else \n fib(n-2) + fib(n-1)\n end\nend",
"def fib_itera(n)\n a, b = 0, 1\n \n if n == 0\n return 0\n elsif n == 1\n return 1\n end\n i = 1\n while i < n\n result = a + b\n a = b\n b = result\n i += 1 \n end\n\n result\nend",
"def fibonacci(n)\n return 1 if n <= 2\n fibonacci(n - 1 ) + fibonacci(n - 2)\nend",
"def fibonacci(n)\n fib = [1, 1]\n while fib.size < n\n fib << fib[-1] + fib[-2]\n end\n fib.last\nend"
] | [
"0.8915964",
"0.88393056",
"0.8791971",
"0.87730473",
"0.8765919",
"0.8696584",
"0.868194",
"0.8679762",
"0.86745274",
"0.86401296",
"0.8619857",
"0.86177707",
"0.8591837",
"0.85897076",
"0.8580005",
"0.85719764",
"0.8570753",
"0.85679847",
"0.85661715",
"0.8557604",
"0.8548108",
"0.8544057",
"0.8537924",
"0.85348123",
"0.85285854",
"0.85201603",
"0.85192585",
"0.85186243",
"0.84909904",
"0.84886587",
"0.8487023",
"0.8482851",
"0.8480148",
"0.84631264",
"0.84589314",
"0.8448083",
"0.84449357",
"0.8437887",
"0.84370255",
"0.8432861",
"0.842633",
"0.8425789",
"0.8422022",
"0.84153074",
"0.8413596",
"0.8412624",
"0.8411983",
"0.84115523",
"0.8411429",
"0.8410639",
"0.8409645",
"0.84043473",
"0.8397751",
"0.8397478",
"0.83966285",
"0.8387764",
"0.8385939",
"0.8383024",
"0.8371464",
"0.8366611",
"0.8365558",
"0.8360975",
"0.8360695",
"0.8351063",
"0.83488137",
"0.83438796",
"0.8343767",
"0.8342906",
"0.8341823",
"0.8340951",
"0.833986",
"0.83371943",
"0.83371335",
"0.83340955",
"0.8332528",
"0.83300894",
"0.8329928",
"0.8328953",
"0.8324519",
"0.8324519",
"0.83198893",
"0.8317976",
"0.83127594",
"0.8312387",
"0.8312302",
"0.8311779",
"0.83092517",
"0.83075374",
"0.8305293",
"0.82983345",
"0.82972556",
"0.82936835",
"0.8292627",
"0.8290848",
"0.82885295",
"0.8285846",
"0.8285469",
"0.8281974",
"0.8279761",
"0.8275939"
] | 0.8424063 | 42 |
GET /guides GET /guides.xml | def index
@guides = Guide.all
#@guide = Guide.find(params[:guide]) rescue nil
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @guides }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @guide = Guide.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @guide }\n end\n end",
"def index\n @guides = Guide.all\n end",
"def index\n @guides = Guide.all\n end",
"def index\n @guides = Guide.page(1)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: {:guides => @guides.as_json} }\n end\n end",
"def guides\n @guides ||= Guides::GuidesRetriever.get_guides(action).input\n end",
"def guides\n @guides ||= Guides::GuidesRetriever.get_guides(action)\n end",
"def index\n @strategy_guides = StrategyGuide.all\n \n respond_with(@strategy_guides)\n end",
"def index\n @guides = Guide.paginate(:page => params[:page], :per_page => per_page).order(sort_column + ' ' + sort_direction)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @guides }\n end\n end",
"def show\n @breadcrumb = 'read'\n @guide = Guide.find(params[:id])\n @subguides = @guide.subguides.paginate(:page => params[:page], :per_page => per_page).order('sort_order')\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @guide }\n end\n end",
"def show\n @guide = Guide.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @guide.as_json(:root => true) }\n end\n end",
"def new\n @guide = Guide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @guide }\n end\n end",
"def index\n @guides = search(guides_search_params)\n end",
"def index\n @remission_guides = RemissionGuide.all\n end",
"def index\n @guidelines = Guideline.all\n end",
"def index\n @guidelines = Guideline.all\n end",
"def url_api\n Guidebox\n end",
"def show_guide(topic)\n if guides[topic]\n analytics.event('Guide', 'known_topic', label: topic)\n\n begin\n guide = Bolt::Util.read_yaml_hash(guides[topic], 'guide')\n rescue SystemCallError => e\n raise Bolt::FileError(\"#{e.message}: unable to load guide page\", filepath)\n end\n\n # Make sure both topic and guide keys are defined\n unless (%w[topic guide] - guide.keys).empty?\n msg = \"Guide file #{guides[topic]} must have a 'topic' key and 'guide' key, but has #{guide.keys} keys.\"\n raise Bolt::Error.new(msg, 'bolt/invalid-guide')\n end\n\n outputter.print_guide(**Bolt::Util.symbolize_top_level_keys(guide))\n else\n analytics.event('Guide', 'unknown_topic', label: topic)\n outputter.print_message(\"Did not find guide for topic '#{topic}'.\\n\\n\")\n list_topics\n end\n 0\n end",
"def index\n @servingguides = Servingguide.all\n \n end",
"def show\n @guide = Guide.all.find(params[:id])\n \n respond_to do |format|\n format.html\n format.json\n format.pdf { render pdf: \"Show\",\n :page_size => 'A4',\n :dpi => '300',\n :margin => {:top => 0,\n :bottom => 0,\n :left => 0,\n :right => 0},\n :margin => {\n :top => 30,\n :bottom => 0\n },\n template: 'guides/show',\n layout: 'pdf.html'\n }\n end\n end",
"def index\n @guides_texts = Guides::Text.all\n end",
"def index\n @guides_texts = Guides::Text.all\n end",
"def newsfeed_guides_link\n $tracer.trace(__method__)\n return ToolTag.new(div.className(\"/tabs/\").a.at(3).innerText(\"/guides/\"), __method__)\n end",
"def show\n @faq = Faq.get(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @faq }\n end\n end",
"def index\n @survival_guides = SurvivalGuide.all\n end",
"def show\n @tutorials = Tutorials.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tutorials }\n end\n end",
"def set_guide\n @guide = Guide.find(params[:id])\n end",
"def new\n @guide = Guide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guide.as_json(:root => true) }\n end\n end",
"def index\n @guidebooks = Guidebook.all\n end",
"def show\n @howto = Howto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @howto }\n end\n end",
"def set_guide\n @guide = Guide.find(params[:id])\n end",
"def set_guide\n @guide = Guide.find(params[:id])\n end",
"def set_guide\n @guide = Guide.find(params[:id])\n end",
"def index \n ip_addr = request.env['REMOTE_ADDR'] \n @browse_by = [[\"Browse By\",''],[\"Guides\",'1'],[\"Places\",'2']]\n @characteristics = [\"Latest\",'1'],[\"Most Popular\",'2'],[\"Highest Rated\",'3'],[\"Stress Factor\",'4']\n @notice = notice\n @guides = Guide.where(\"publish=?\",true).order(\"CREATED_AT DESC\")\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @guides }\n end\n end",
"def guides\n @guides ||= begin\n root_path = File.expand_path(File.join(__dir__, '..', '..', 'guides'))\n files = Dir.children(root_path).sort\n\n files.each_with_object({}) do |file, guides|\n next if file !~ /\\.(yaml|yml)\\z/\n # The \".*\" here removes any suffix\n topic = File.basename(file, \".*\")\n guides[topic] = File.join(root_path, file)\n end\n rescue SystemCallError => e\n raise Bolt::FileError.new(\"#{e.message}: unable to load guides directory\", root_path)\n end\n end",
"def show\n @assembly_guide = AssemblyGuide.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @assembly_guide }\n end\n end",
"def index\n @tutorials = Tutorials.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tutorials }\n end\n end",
"def new\n @breadcrumb = 'create'\n @guide = Guide.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guide }\n end\n end",
"def new\n @guide = @item.guides.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guide }\n end\n end",
"def show\n @guide = Guide.find(params[:id])\n @comment = Comment.new\n end",
"def show\n @helocagree = Helocagree.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @helocagree }\n end\n end",
"def update\n @guide = Guide.find(params[:id])\n\n respond_to do |format|\n if @guide.update_attributes(params[:guide])\n flash[:notice] = 'Guide was successfully updated.'\n format.html { redirect_to(@guide) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @guide.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n\t\t@user=User.find_by_id(@current_user)\n @tour_guides = TourGuide.all\n end",
"def helps(id)\n helps_data(request(\"needs/helps/#{id}.xml\", :auth => true))\n end",
"def docs api\n\t\tget_html \"#{@options[:docs]}/#{@apis[api][:url]}.htm\"\n\tend",
"def index \n @browse_by = [[\"Browse By\",''],[\"Guides\",'1'],[\"Places\",'2']]\n @characteristics = [\"Latest\",'1'],[\"Most Popular\",'2'],[\"Highest Rated\",'3'],[\"Stress Factor\",'4']\n @notice = notice\n @guides = Guide.order(\"CREATED_AT DESC\").all \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @guides }\n end\n end",
"def set_guide\n @guide = Guide.where(:id => params[:id]).first\n end",
"def show\n @guide = Guide.find(params[:id])\n @location = Location.new\n if !(params[:ajax])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @guide }\n end\n end\n end",
"def index\n @tutorials = Tutorial.all\n @title = \"A collection of Ruby on Rails tutorials\"\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tutorials }\n end\n end",
"def create\n @guide = Guide.new(params[:guide])\n @guide.secret_code = Guide.secret_code\n\n respond_to do |format|\n if @guide.save\n flash[:notice] = 'Guide was successfully created.'\n format.html { redirect_to(guides_path) }\n format.xml { render :xml => @guide, :status => :created, :location => @guide }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @guide.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n @ideas = current_user.ideas\n #@user.ideas\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ideas }\n end\n end",
"def index\n @labs = @course.labs.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @labs }\n end\n end",
"def xml(options = {})\n http = Net::HTTP.new(Picasa.host, 443)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n path = Picasa.path(options)\n response = http.get(path, auth_header)\n if response.code =~ /20[01]/\n response.body\n elsif response.code.to_i == 403\n raise RubyPicasa::PicasaError, \"Authentication failed. You may need to refresh your access token.\"\n end\n end",
"def destroy\n @guide = Guide.find(params[:id])\n @guide.destroy\n\n respond_to do |format|\n format.html { redirect_to(guides_url) }\n format.xml { head :ok }\n end\n end",
"def questions\n self.class.get(\"/2.2/questions\", @options)\n end",
"def index\n @compares = @chapter.compares\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @compares }\n end\n end",
"def create\n @guide = Guide.new(guide_params)\n\n respond_to do |format|\n if @guide.save\n format.html { redirect_to @guide, notice: 'Guide was successfully created.' }\n format.json { render :show, status: :created, location: @guide }\n else\n format.html { render :new }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @guide = Guide.new(guide_params)\n\n respond_to do |format|\n if @guide.save\n format.html { redirect_to @guide, notice: 'Guide was successfully created.' }\n format.json { render :show, status: :created, location: @guide }\n else\n format.html { render :new }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @manual = Manual.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @manual }\n end\n end",
"def show\n @lab = @course.labs.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @lab }\n end\n end",
"def about\n respond_to do |format|\n format.html # about.html.erb\n format.xml { render :xml => nil }\n end\n end",
"def guides\n people.select{|person| person.guide }\n end",
"def show\n @idea = Idea.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @idea }\n end\n end",
"def create \n @guide = Guide.new(params[:guide])\n respond_to do |format|\n if @guide.save\n format.html { redirect_to guide_url(@guide), notice: 'Guide was successfully created.' }\n format.json { render json: @guide, status: :created, location: @guide }\n else\n format.html { render action: \"new\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @offlearn = Offlearn.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @offlearn }\n end\n end",
"def show\n @question = Question.find(params[:id])\n check_forged_path\n\n respond_to do |format|\n format.html # show.rhtml\n format.json { render :json => @question.to_json }\n format.xml { render :xml => @question.to_xml(:methods => [:purpose]) }\n end\n end",
"def show\n @education = Education.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @education }\n end\n end",
"def show\n @lesson = Lesson.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lesson }\n end\n end",
"def new\n @tutorials = Tutorials.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tutorials }\n end\n end",
"def show\n @correspondence = Correspondence.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @correspondence }\n end\n end",
"def get_program_guide(options = {})\n # Default start time for EPG information is the current time\n default_guide_start = Time.now\n\n # Default to 4 hours\n default_guide_duration = 60 * 60 * 4\n \n default_options = { :start_time => default_guide_start,\n :end_time => default_guide_start + default_guide_duration,\n :num_of_channels => 5,\n :start_chan_id => 1,\n :details => 1 }\n \n options = default_options.merge(options)\n \n query_string = \"StartTime=#{MythTV::Utils.format_time(options[:start_time], :delimited)}\"\n query_string += \"&EndTime=#{MythTV::Utils.format_time(options[:end_time], :delimited)}\"\n query_string += \"&NumOfChannels=#{options[:num_of_channels]}\"\n query_string += \"&StartChanId=#{options[:start_chan_id]}\"\n query_string += \"&Details=#{options[:details]}\"\n \n url = URI::HTTP.build( { :host => @host,\n :port => @status_port,\n :path => \"/Myth/GetProgramGuide\",\n :query => query_string } )\n \n @log.debug \"URL: #{url}\"\n # Make a GET request, and store the image data returned\n Net::HTTP.get(url)\n end",
"def new\n @howto = Howto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @howto }\n end\n end",
"def navlistbar_guides_link\n $tracer.trace(__method__)\n return ToolTag.new(li.className(\"/take-part/\").div.className(\"/subnav/\").ul.className(\"/dropdown/\").a(\"/Guides/\"), __method__)\n end",
"def show\n @course_degree = CourseDegree.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @course_degree }\n end\n end",
"def show\n @learn = Learn.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @learn }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @exam_candidate }\n end\n end",
"def show\n @alternatives_set = AlternativesSet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @alternatives_set }\n end\n end",
"def show\n @lecture = Lecture.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lecture }\n end\n end",
"def index\n @options = @question.options.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @options }\n end\n end",
"def show\n @book = Book.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @book.to_xml(:include => { :keywords => {}, :sb_keywords => {}, :targetgroup => {}, :agegroup => {}, :signum => {}, :editions => { :include => { :descriptions => { :include => { :user => { :except => [:email, :password_hash]}}}}}, :assessments => {}, :taggings => { :include => :tag } }) } \n end\n end",
"def get_xml\n response = @api.request(:get, @location, type: 'xml')\n response.body if response.status == 200\n end",
"def show\n @hr_attendence = Hr::Attendence.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hr_attendence }\n end\n end",
"def show\n @attend = Attend.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @attend }\n end\n end",
"def show\n @chapter = @book.chapters.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @chapter }\n end\n end",
"def api_xml(path,method=:get,options={})\n xml_message(amee,\"/data\"+path,method,options)\n end",
"def show\n @ref = Ref.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ref }\n end\n end",
"def show\n @examination_kind = ExaminationKind.find(params[:id])\n respond_to do |format|\n format.xml { render :xml => @examination_kind }\n end\n end",
"def update\n @guide = Guide.find(params[:id])\n\n respond_to do |format|\n if @guide.update_attributes(params[:guide])\n format.html { redirect_to @guide, notice: 'Guide was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @guide = Guide.find(params[:id])\n\n respond_to do |format|\n if @guide.update_attributes(params[:guide])\n format.html { redirect_to @guide, notice: 'Guide was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @guide = Guide.find(params[:id])\n\n respond_to do |format|\n if @guide.update_attributes(params[:guide])\n format.html { redirect_to @guide, notice: 'Guide was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @question_topic = QuestionTopic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @question_topic }\n end\n end",
"def new\n @faq = Faq.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @faq }\n end\n end",
"def set_guides_text\n @guides_text = Guides::Text.find(params[:id])\n end",
"def show\n @question = Question.find(params[:id])\n\n respond_to do |format|\n format.html\n format.xml {render :xml => @question}\n end\n end",
"def show\n @question = Question.find(params[:id])\n\n respond_to do |format|\n format.html\n format.xml {render :xml => @question}\n end\n end",
"def config\n respond_to { |format| format.xml }\n end",
"def show\n @documentation = Documentation.find(params[:id])\n @documentations = Documentation.find(:all)\n \n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @documentation }\n end\n end",
"def index\n @preferences = Preference.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @preferences }\n end\n end",
"def list_topics\n outputter.print_topics(guides.keys)\n 0\n end",
"def show\n @question = Question.find(params[:id])\n @course = @question.course\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @question }\n end\n end",
"def index\n @correspondences = Correspondence.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @correspondences }\n end\n end"
] | [
"0.70598155",
"0.6992941",
"0.6992941",
"0.6924859",
"0.68683624",
"0.6856749",
"0.6697979",
"0.6521598",
"0.6516481",
"0.64622706",
"0.6341066",
"0.63265914",
"0.62710315",
"0.6122782",
"0.6122782",
"0.60242474",
"0.5974404",
"0.59562284",
"0.58663464",
"0.5766668",
"0.5766668",
"0.57515806",
"0.571202",
"0.56935114",
"0.5691461",
"0.56686836",
"0.5659642",
"0.56406873",
"0.56393707",
"0.5628564",
"0.5628564",
"0.5628564",
"0.5627965",
"0.55990624",
"0.5560416",
"0.55496925",
"0.5545464",
"0.5544091",
"0.55341214",
"0.55150175",
"0.5510082",
"0.55053914",
"0.54983246",
"0.5496308",
"0.5494471",
"0.54764014",
"0.5464531",
"0.54548484",
"0.54444605",
"0.54413664",
"0.5433953",
"0.54290766",
"0.5413812",
"0.5411903",
"0.54052913",
"0.5380627",
"0.5380627",
"0.5368688",
"0.535818",
"0.535084",
"0.5303958",
"0.52886593",
"0.52850896",
"0.5278564",
"0.5275008",
"0.52459204",
"0.52406406",
"0.52375907",
"0.52361834",
"0.5235963",
"0.52323824",
"0.5230291",
"0.5226796",
"0.5222138",
"0.5222077",
"0.52162486",
"0.52081907",
"0.5197873",
"0.5193501",
"0.5191974",
"0.5180172",
"0.51789266",
"0.5177147",
"0.5170852",
"0.51707673",
"0.51689446",
"0.5168926",
"0.5168926",
"0.5168926",
"0.51628387",
"0.51583225",
"0.5158019",
"0.5152465",
"0.5152465",
"0.51493573",
"0.5147559",
"0.51453406",
"0.5144306",
"0.5138209",
"0.5133386"
] | 0.73859346 | 0 |
GET /guides/1 GET /guides/1.xml | def show
@guide = Guide.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @guide }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @guides = Guide.all\n #@guide = Guide.find(params[:guide]) rescue nil\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @guides }\n end\n end",
"def index\n @guides = Guide.page(1)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: {:guides => @guides.as_json} }\n end\n end",
"def index\n @guides = Guide.all\n end",
"def index\n @guides = Guide.all\n end",
"def guides\n @guides ||= Guides::GuidesRetriever.get_guides(action).input\n end",
"def show\n @breadcrumb = 'read'\n @guide = Guide.find(params[:id])\n @subguides = @guide.subguides.paginate(:page => params[:page], :per_page => per_page).order('sort_order')\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @guide }\n end\n end",
"def new\n @guide = Guide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @guide }\n end\n end",
"def guides\n @guides ||= Guides::GuidesRetriever.get_guides(action)\n end",
"def show\n @guide = Guide.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @guide.as_json(:root => true) }\n end\n end",
"def index\n @strategy_guides = StrategyGuide.all\n \n respond_with(@strategy_guides)\n end",
"def index\n @guides = Guide.paginate(:page => params[:page], :per_page => per_page).order(sort_column + ' ' + sort_direction)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @guides }\n end\n end",
"def index\n @remission_guides = RemissionGuide.all\n end",
"def show\n @guide = Guide.all.find(params[:id])\n \n respond_to do |format|\n format.html\n format.json\n format.pdf { render pdf: \"Show\",\n :page_size => 'A4',\n :dpi => '300',\n :margin => {:top => 0,\n :bottom => 0,\n :left => 0,\n :right => 0},\n :margin => {\n :top => 30,\n :bottom => 0\n },\n template: 'guides/show',\n layout: 'pdf.html'\n }\n end\n end",
"def index\n @guidelines = Guideline.all\n end",
"def index\n @guidelines = Guideline.all\n end",
"def index\n @guides = search(guides_search_params)\n end",
"def show_guide(topic)\n if guides[topic]\n analytics.event('Guide', 'known_topic', label: topic)\n\n begin\n guide = Bolt::Util.read_yaml_hash(guides[topic], 'guide')\n rescue SystemCallError => e\n raise Bolt::FileError(\"#{e.message}: unable to load guide page\", filepath)\n end\n\n # Make sure both topic and guide keys are defined\n unless (%w[topic guide] - guide.keys).empty?\n msg = \"Guide file #{guides[topic]} must have a 'topic' key and 'guide' key, but has #{guide.keys} keys.\"\n raise Bolt::Error.new(msg, 'bolt/invalid-guide')\n end\n\n outputter.print_guide(**Bolt::Util.symbolize_top_level_keys(guide))\n else\n analytics.event('Guide', 'unknown_topic', label: topic)\n outputter.print_message(\"Did not find guide for topic '#{topic}'.\\n\\n\")\n list_topics\n end\n 0\n end",
"def url_api\n Guidebox\n end",
"def newsfeed_guides_link\n $tracer.trace(__method__)\n return ToolTag.new(div.className(\"/tabs/\").a.at(3).innerText(\"/guides/\"), __method__)\n end",
"def set_guide\n @guide = Guide.find(params[:id])\n end",
"def set_guide\n @guide = Guide.find(params[:id])\n end",
"def set_guide\n @guide = Guide.find(params[:id])\n end",
"def set_guide\n @guide = Guide.find(params[:id])\n end",
"def set_guide\n @guide = Guide.where(:id => params[:id]).first\n end",
"def show\n @howto = Howto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @howto }\n end\n end",
"def index\n @servingguides = Servingguide.all\n \n end",
"def new\n @guide = Guide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guide.as_json(:root => true) }\n end\n end",
"def new\n @breadcrumb = 'create'\n @guide = Guide.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guide }\n end\n end",
"def show\n @faq = Faq.get(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @faq }\n end\n end",
"def show\n @tutorials = Tutorials.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tutorials }\n end\n end",
"def new\n @guide = @item.guides.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guide }\n end\n end",
"def update\n @guide = Guide.find(params[:id])\n\n respond_to do |format|\n if @guide.update_attributes(params[:guide])\n flash[:notice] = 'Guide was successfully updated.'\n format.html { redirect_to(@guide) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @guide.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n @guides_texts = Guides::Text.all\n end",
"def index\n @guides_texts = Guides::Text.all\n end",
"def show\n @guide = Guide.find(params[:id])\n @comment = Comment.new\n end",
"def destroy\n @guide = Guide.find(params[:id])\n @guide.destroy\n\n respond_to do |format|\n format.html { redirect_to(guides_url) }\n format.xml { head :ok }\n end\n end",
"def show\n @assembly_guide = AssemblyGuide.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @assembly_guide }\n end\n end",
"def index \n ip_addr = request.env['REMOTE_ADDR'] \n @browse_by = [[\"Browse By\",''],[\"Guides\",'1'],[\"Places\",'2']]\n @characteristics = [\"Latest\",'1'],[\"Most Popular\",'2'],[\"Highest Rated\",'3'],[\"Stress Factor\",'4']\n @notice = notice\n @guides = Guide.where(\"publish=?\",true).order(\"CREATED_AT DESC\")\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @guides }\n end\n end",
"def index\n @survival_guides = SurvivalGuide.all\n end",
"def create\n @guide = Guide.new(params[:guide])\n @guide.secret_code = Guide.secret_code\n\n respond_to do |format|\n if @guide.save\n flash[:notice] = 'Guide was successfully created.'\n format.html { redirect_to(guides_path) }\n format.xml { render :xml => @guide, :status => :created, :location => @guide }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @guide.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n @tutorials = Tutorials.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tutorials }\n end\n end",
"def index\n @tutorials = Tutorial.all\n @title = \"A collection of Ruby on Rails tutorials\"\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tutorials }\n end\n end",
"def create\n @guide = Guide.new(guide_params)\n\n respond_to do |format|\n if @guide.save\n format.html { redirect_to @guide, notice: 'Guide was successfully created.' }\n format.json { render :show, status: :created, location: @guide }\n else\n format.html { render :new }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @guide = Guide.new(guide_params)\n\n respond_to do |format|\n if @guide.save\n format.html { redirect_to @guide, notice: 'Guide was successfully created.' }\n format.json { render :show, status: :created, location: @guide }\n else\n format.html { render :new }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @guidebooks = Guidebook.all\n end",
"def new\n @howto = Howto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @howto }\n end\n end",
"def show\n @guide = Guide.find(params[:id])\n @location = Location.new\n if !(params[:ajax])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @guide }\n end\n end\n end",
"def helps(id)\n helps_data(request(\"needs/helps/#{id}.xml\", :auth => true))\n end",
"def docs api\n\t\tget_html \"#{@options[:docs]}/#{@apis[api][:url]}.htm\"\n\tend",
"def show\n @manual = Manual.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @manual }\n end\n end",
"def show\n @lab = @course.labs.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @lab }\n end\n end",
"def show\n @helocagree = Helocagree.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @helocagree }\n end\n end",
"def create \n @guide = Guide.new(params[:guide])\n respond_to do |format|\n if @guide.save\n format.html { redirect_to guide_url(@guide), notice: 'Guide was successfully created.' }\n format.json { render json: @guide, status: :created, location: @guide }\n else\n format.html { render action: \"new\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index \n @browse_by = [[\"Browse By\",''],[\"Guides\",'1'],[\"Places\",'2']]\n @characteristics = [\"Latest\",'1'],[\"Most Popular\",'2'],[\"Highest Rated\",'3'],[\"Stress Factor\",'4']\n @notice = notice\n @guides = Guide.order(\"CREATED_AT DESC\").all \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @guides }\n end\n end",
"def index\n\t\t@user=User.find_by_id(@current_user)\n @tour_guides = TourGuide.all\n end",
"def new\n @tutorials = Tutorials.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tutorials }\n end\n end",
"def guides\n @guides ||= begin\n root_path = File.expand_path(File.join(__dir__, '..', '..', 'guides'))\n files = Dir.children(root_path).sort\n\n files.each_with_object({}) do |file, guides|\n next if file !~ /\\.(yaml|yml)\\z/\n # The \".*\" here removes any suffix\n topic = File.basename(file, \".*\")\n guides[topic] = File.join(root_path, file)\n end\n rescue SystemCallError => e\n raise Bolt::FileError.new(\"#{e.message}: unable to load guides directory\", root_path)\n end\n end",
"def index\n @compares = @chapter.compares\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @compares }\n end\n end",
"def show\n @lesson = Lesson.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lesson }\n end\n end",
"def index\n @labs = @course.labs.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @labs }\n end\n end",
"def about\n respond_to do |format|\n format.html # about.html.erb\n format.xml { render :xml => nil }\n end\n end",
"def user_guides_label\n $tracer.trace(__method__)\n return ToolTag.new(div.className(\"tabs\").innerText(\"/guides/\"), __method__)\n end",
"def navlistbar_guides_link\n $tracer.trace(__method__)\n return ToolTag.new(li.className(\"/take-part/\").div.className(\"/subnav/\").ul.className(\"/dropdown/\").a(\"/Guides/\"), __method__)\n end",
"def set_guides_text\n @guides_text = Guides::Text.find(params[:id])\n end",
"def update\n @guide = Guide.find(params[:id])\n\n respond_to do |format|\n if @guide.update_attributes(params[:guide])\n format.html { redirect_to @guide, notice: 'Guide was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @guide = Guide.find(params[:id])\n\n respond_to do |format|\n if @guide.update_attributes(params[:guide])\n format.html { redirect_to @guide, notice: 'Guide was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @guide = Guide.find(params[:id])\n\n respond_to do |format|\n if @guide.update_attributes(params[:guide])\n format.html { redirect_to @guide, notice: 'Guide was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new \n @how_to = HowTo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @how_to }\n end\n end",
"def download_progguide(prog_guide_url)\n return download_data(\"http://www.channel4.com#{prog_guide_url}\")\n end",
"def show\n @research = Research.find(params[:id])\n @page_title = \"Hello Congress research request: \" + @research.name\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @research.to_xml(:except => [:email]) }\n end\n end",
"def show\n @idea = Idea.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @idea }\n end\n end",
"def new\n @faq = Faq.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @faq }\n end\n end",
"def show\n @documentation = Documentation.find(params[:id])\n @documentations = Documentation.find(:all)\n \n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @documentation }\n end\n end",
"def set_guidebook\n @guidebook = Guidebook.find(params[:id])\n end",
"def create\n @guide = Guide.new(guide_params)\n\n respond_to do |format|\n action_message_for('new')\n if create_guide\n format.html { redirect_to redirect_target(@guide), flash: @feedback_flash }\n format.json { render :show, status: :created, location: @guide }\n else\n 1.times { @guide.sections.new }\n 1.times { @guide.sections.new } if @guide.subtype == 'detailed_guide' && @guide.sections.size < 2\n format.html { render :new }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def get_program_guide(options = {})\n # Default start time for EPG information is the current time\n default_guide_start = Time.now\n\n # Default to 4 hours\n default_guide_duration = 60 * 60 * 4\n \n default_options = { :start_time => default_guide_start,\n :end_time => default_guide_start + default_guide_duration,\n :num_of_channels => 5,\n :start_chan_id => 1,\n :details => 1 }\n \n options = default_options.merge(options)\n \n query_string = \"StartTime=#{MythTV::Utils.format_time(options[:start_time], :delimited)}\"\n query_string += \"&EndTime=#{MythTV::Utils.format_time(options[:end_time], :delimited)}\"\n query_string += \"&NumOfChannels=#{options[:num_of_channels]}\"\n query_string += \"&StartChanId=#{options[:start_chan_id]}\"\n query_string += \"&Details=#{options[:details]}\"\n \n url = URI::HTTP.build( { :host => @host,\n :port => @status_port,\n :path => \"/Myth/GetProgramGuide\",\n :query => query_string } )\n \n @log.debug \"URL: #{url}\"\n # Make a GET request, and store the image data returned\n Net::HTTP.get(url)\n end",
"def create\n @breadcrumb = 'create'\n @guide = Guide.new(params[:guide])\n @guide.created_by = current_user.id if !current_user.nil?\n \n respond_to do |format|\n if @guide.save\n format.html { redirect_to @guide, notice: crud_notice('created', @guide) }\n format.json { render json: @guide, status: :created, location: @guide }\n else\n format.html { render action: \"new\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @preference = Preference.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @preference }\n end\n end",
"def show\n @checklist = Checklist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @checklist }\n end\n end",
"def show\n @ref = Ref.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ref }\n end\n end",
"def show\n @offlearn = Offlearn.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @offlearn }\n end\n end",
"def xml(options = {})\n http = Net::HTTP.new(Picasa.host, 443)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n path = Picasa.path(options)\n response = http.get(path, auth_header)\n if response.code =~ /20[01]/\n response.body\n elsif response.code.to_i == 403\n raise RubyPicasa::PicasaError, \"Authentication failed. You may need to refresh your access token.\"\n end\n end",
"def xml(id)\n http.get(\"/nfse/#{id}/xml\") do |response|\n response.headers.fetch(\"Location\") { \"\" }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @helppage }\n end\n end",
"def index\n @guides = Guide.all\n if guide_params[:search]\n puts Category.where(\"name LIKE ?\",\"%#{guide_params[:search]}%\" )\n else\n @top_guides = GuideRating.rate_desc.where(guide_id: not_self_guide_category_ids).pluck(:guide_id).uniq.map{|x| Guide.find(x)}\n @popular_incountry = popular_merge(country,nil)\n @world_popular_guide_category= Category.joins(guides: :profile).distinct_country(all_countries)\n\n if !@top_guides.empty?\n @first_category = @top_guides[0].category\n @first_category_name_guide = @first_category.name\n @first_category_guide= @guides.includes(:category,profile: :user).where(:category_id => @first_category.id).where.not(:profile_id => current_profile_id)\n else\n @first_category_name_guide = \"None\"\n @first_category_guide = []\n end\n end\n end",
"def show\n @correspondence = Correspondence.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @correspondence }\n end\n end",
"def set_guides_text\n @guides_text = Guides::Text.find(params[:id])\n end",
"def index\n @lessons = Lesson.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @lessons }\n end\n end",
"def show\n @question = Question.find(params[:id])\n\n respond_to do |format|\n format.html\n format.xml {render :xml => @question}\n end\n end",
"def show\n @question = Question.find(params[:id])\n\n respond_to do |format|\n format.html\n format.xml {render :xml => @question}\n end\n end",
"def update\n respond_to do |format|\n if @guide.update(guide_params)\n format.html { redirect_to @guide, notice: 'Guide was successfully updated.' }\n format.json { render :show, status: :ok, location: @guide }\n else\n format.html { render :edit }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @guide.update(guide_params)\n format.html { redirect_to @guide, notice: 'Guide was successfully updated.' }\n format.json { render :show, status: :ok, location: @guide }\n else\n format.html { render :edit }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n respond_to do |format|\n format.html do\n @taxon_links = TaxonLink.by_taxon(@guide_taxon.taxon)\n @machine_tags = @guide_taxon.tag_list.select{|t| t =~ /=/}\n @grouped_machine_tags = @machine_tags.inject({}) do |memo, tag|\n predicate, value = tag.split('=')\n memo[predicate] ||= []\n memo[predicate] << value\n memo[predicate] = memo[predicate].sort.uniq\n memo\n end\n @next = @guide.guide_taxa.order(\"position ASC, id ASC\").where(\"(position > 0 AND position > ?) OR id > ?\", @guide_taxon.position, @guide_taxon.id).first\n @prev = @guide.guide_taxa.order(\"position ASC, id ASC\").where(\"(position > 0 AND position < ?) OR id < ?\", @guide_taxon.position, @guide_taxon.id).last\n end\n format.json { render json: @guide_taxon.as_json(:root => true,\n :methods => [:guide_photo_ids, :guide_section_ids, :guide_range_ids]) }\n format.xml\n end\n end",
"def show\n @question = Question.find(params[:id])\n check_forged_path\n\n respond_to do |format|\n format.html # show.rhtml\n format.json { render :json => @question.to_json }\n format.xml { render :xml => @question.to_xml(:methods => [:purpose]) }\n end\n end",
"def show\n @question_topic = QuestionTopic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @question_topic }\n end\n end",
"def create\n @guide = Guide.new(params[:guide])\n @guide.user = current_user\n\n respond_to do |format|\n if @guide.save\n create_default_guide_taxa\n format.html { redirect_to @guide, notice: 'Guide was successfully created.' }\n format.json { render json: @guide.as_json(:root => true), status: :created, location: @guide }\n else\n format.html { render action: \"new\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def documentation_url; end",
"def show\n @learn = Learn.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @learn }\n end\n end",
"def index\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @topics }\n end\n end",
"def show\n @examination_kind = ExaminationKind.find(params[:id])\n respond_to do |format|\n format.xml { render :xml => @examination_kind }\n end\n end"
] | [
"0.7418233",
"0.69884825",
"0.6918407",
"0.6918407",
"0.6605223",
"0.6602563",
"0.6577677",
"0.6567486",
"0.6507739",
"0.6470245",
"0.6462822",
"0.6149771",
"0.61297476",
"0.61230266",
"0.61230266",
"0.6112914",
"0.6071439",
"0.60630757",
"0.6047497",
"0.5966256",
"0.5891714",
"0.5891714",
"0.5891714",
"0.5864",
"0.5851844",
"0.5838555",
"0.5838102",
"0.5803249",
"0.57792294",
"0.5777833",
"0.5728954",
"0.5725003",
"0.5712198",
"0.5712198",
"0.56791735",
"0.5675035",
"0.5655128",
"0.56449413",
"0.56444716",
"0.56278366",
"0.5616914",
"0.5614381",
"0.5596549",
"0.5596549",
"0.55884534",
"0.55846334",
"0.55762607",
"0.5575126",
"0.5568836",
"0.5550119",
"0.55467445",
"0.553812",
"0.5527291",
"0.5513523",
"0.54757035",
"0.54564995",
"0.54540807",
"0.5437894",
"0.542635",
"0.54236394",
"0.5413927",
"0.53990525",
"0.5388528",
"0.5376857",
"0.53699476",
"0.53699476",
"0.53699476",
"0.5362385",
"0.53593254",
"0.53568465",
"0.5349105",
"0.5343957",
"0.53423893",
"0.5341835",
"0.53388846",
"0.53339094",
"0.53287196",
"0.52900475",
"0.5287685",
"0.5283531",
"0.5279943",
"0.527681",
"0.5276335",
"0.5275921",
"0.52717364",
"0.5267475",
"0.52574337",
"0.52572215",
"0.5254792",
"0.5254792",
"0.52495706",
"0.52495706",
"0.52409595",
"0.52391547",
"0.52377313",
"0.52287745",
"0.521942",
"0.5210725",
"0.52106184",
"0.52078575"
] | 0.7161179 | 1 |
GET /guides/new GET /guides/new.xml | def new
@guide = Guide.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @guide }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @breadcrumb = 'create'\n @guide = Guide.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guide }\n end\n end",
"def new\n @guide = Guide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guide.as_json(:root => true) }\n end\n end",
"def new\n @howto = Howto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @howto }\n end\n end",
"def new\n @guide = @item.guides.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guide }\n end\n end",
"def new\n @tutorials = Tutorials.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tutorials }\n end\n end",
"def new \n @how_to = HowTo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @how_to }\n end\n end",
"def new\n @ref = Ref.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ref }\n end\n end",
"def new\n @faq = Faq.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @faq }\n end\n end",
"def new\n @idea = Idea.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @idea }\n end\n end",
"def new\n @idea = Idea.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @idea }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end",
"def create\n @guide = Guide.new(params[:guide])\n @guide.secret_code = Guide.secret_code\n\n respond_to do |format|\n if @guide.save\n flash[:notice] = 'Guide was successfully created.'\n format.html { redirect_to(guides_path) }\n format.xml { render :xml => @guide, :status => :created, :location => @guide }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @guide.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @tutorial = Tutorial.new\n\t@title = \"New tutorial\"\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tutorial }\n end\n end",
"def new\n respond_to do |format|\n format.html { render :layout => 'application' }\n format.xml { render :xml => @recommand }\n end\n end",
"def create \n @guide = Guide.new(params[:guide])\n respond_to do |format|\n if @guide.save\n format.html { redirect_to guide_url(@guide), notice: 'Guide was successfully created.' }\n format.json { render json: @guide, status: :created, location: @guide }\n else\n format.html { render action: \"new\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @topic }\n end\n end",
"def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @topic }\n end\n end",
"def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @topic }\n end\n end",
"def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @topic }\n end\n end",
"def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @topic }\n end\n end",
"def new\n @lesson = Lesson.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lesson }\n end\n end",
"def new\n @idea = @current_user.ideas.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @idea }\n end\n end",
"def new\n @topic = Topic.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @topic }\n end\n end",
"def new\n @documentation = Documentation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @documentation }\n end\n end",
"def new\n @proposal = Proposal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @proposal }\n end\n end",
"def new\n @proposal = Proposal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @proposal }\n end\n end",
"def new\n @doc = Doc.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @doc }\n end\n end",
"def new\n @lecture = Lecture.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lecture }\n end\n end",
"def create\n @guide = Guide.new(guide_params)\n\n respond_to do |format|\n if @guide.save\n format.html { redirect_to @guide, notice: 'Guide was successfully created.' }\n format.json { render :show, status: :created, location: @guide }\n else\n format.html { render :new }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @guide = Guide.new(guide_params)\n\n respond_to do |format|\n if @guide.save\n format.html { redirect_to @guide, notice: 'Guide was successfully created.' }\n format.json { render :show, status: :created, location: @guide }\n else\n format.html { render :new }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @guide = Guide.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @guide }\n end\n end",
"def new\n respond_to do |format|\n format.html\n format.xml\n end\n end",
"def create\n @breadcrumb = 'create'\n @guide = Guide.new(params[:guide])\n @guide.created_by = current_user.id if !current_user.nil?\n \n respond_to do |format|\n if @guide.save\n format.html { redirect_to @guide, notice: crud_notice('created', @guide) }\n format.json { render json: @guide, status: :created, location: @guide }\n else\n format.html { render action: \"new\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n \n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @topic }\n end\n end",
"def index\n @guides = Guide.all\n #@guide = Guide.find(params[:guide]) rescue nil\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @guides }\n end\n end",
"def new\n @discovery = Discovery.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @discovery }\n end\n end",
"def new\n @good = Good.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @good }\n end\n end",
"def new\n @question_topic = QuestionTopic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question_topic }\n end\n end",
"def new\n\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @topic }\n end\n end",
"def new\n @hack_tag_follow = HackTagFollow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @hack_tag_follow }\n end\n end",
"def create\n @guide = Guide.new(guide_params)\n\n respond_to do |format|\n action_message_for('new')\n if create_guide\n format.html { redirect_to redirect_target(@guide), flash: @feedback_flash }\n format.json { render :show, status: :created, location: @guide }\n else\n 1.times { @guide.sections.new }\n 1.times { @guide.sections.new } if @guide.subtype == 'detailed_guide' && @guide.sections.size < 2\n format.html { render :new }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @manual = Manual.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @manual }\n end\n end",
"def new\n @question = @keyword.question_sheet.elements.new\n\n respond_to do |wants|\n wants.html # new.html.erb\n wants.xml { render :xml => @question }\n end\n end",
"def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @question }\n end\n end",
"def faq_new\n @article = Article.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @article }\n end\n end",
"def new\n\t\t@path = [link_to_ideas, link_to_new_idea]\n\t\t@subnavigation = [active_link_to_new_idea,link_to_show_all_ideas(\"Alle Ideen\", \"title\", \"ASC\", \"\", 0, 30)]\n\n @idea = Idea.new\n\t\t@categories = Category.find(:all)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @idea }\n end\n end",
"def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @get_started_page }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.haml\n format.xml { render :xml => @school }\n end\n end",
"def new\n @matter = Matter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @matter }\n end\n end",
"def new\n @thesis_proposal = ThesisProposal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @thesis_proposal }\n end\n end",
"def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end",
"def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end",
"def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end",
"def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end",
"def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end",
"def new\n @qa = Qa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @qa }\n end\n end",
"def new\n @qa = Qa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @qa }\n end\n end",
"def new\n @helocagree = Helocagree.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @helocagree }\n end\n end",
"def new\n @docent = Docent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @docent }\n end\n end",
"def new\n @want = Want.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @want }\n end\n end",
"def new\n @question = Question.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end",
"def new\n @bookmark = Bookmark.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bookmark }\n end\n end",
"def new\n @bookmark = Bookmark.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bookmark }\n end\n end",
"def new\n @college = College.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @college }\n end\n end",
"def new\n @goal = Mg::Goal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @goal }\n end\n end",
"def new\n @court = Court.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @court }\n end\n end",
"def new\n @assembly_guide = AssemblyGuide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @assembly_guide }\n end\n end",
"def new\n @bookmark = Bookmark.new(:tags => [Tag.new])\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bookmark }\n end\n end",
"def new\n @offlearn = Offlearn.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @offlearn }\n end\n end",
"def new\n @rails_url = RailsUrl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rails_url }\n end\n end",
"def new\n @education = Education.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @education }\n end\n end",
"def new\n @url_migration = UrlMigration.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @url_migration }\n end\n end",
"def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @course }\n end\n end",
"def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @course }\n end\n end",
"def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @course }\n end\n end",
"def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @course }\n end\n end",
"def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @course }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @school }\n end\n end",
"def new\n @normal_example = NormalExample.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @normal_example }\n end\n end",
"def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @faq_category }\n end\n end",
"def new\n @secretary = Secretary.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @secretary }\n end\n end",
"def new\n @needle = Needle.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @needle }\n end\n end",
"def new\n @bookmarklet = Bookmarklet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bookmarklet }\n end\n end",
"def new\n @conseq = Conseq.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @conseq }\n end\n end",
"def new\n @node = Node.scopied.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end",
"def new\n @research = Research.new\n @page_title = \"Request research from White House 2 members\"\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @research.to_xml(:except => [:email]) }\n end\n end",
"def new\n @course = Course.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @course }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml \n end\n end",
"def new\n @example_section = ExampleSection.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @example_section }\n end\n end",
"def new\n @college_note = CollegeNote.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @college_note }\n end\n end",
"def new\n @bookfair = Bookfair.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bookfair }\n end\n end",
"def new\n @people = People.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @people }\n end\n end"
] | [
"0.7520714",
"0.72318053",
"0.7169528",
"0.71011454",
"0.70143276",
"0.6949339",
"0.67203784",
"0.6715671",
"0.66570854",
"0.66430396",
"0.66342527",
"0.6622123",
"0.6617106",
"0.65912956",
"0.6591135",
"0.65655416",
"0.65655416",
"0.65655416",
"0.65655416",
"0.65655416",
"0.656368",
"0.65488136",
"0.6542522",
"0.6541969",
"0.6528538",
"0.6528538",
"0.65037507",
"0.65026253",
"0.65024984",
"0.65024984",
"0.6502064",
"0.6482264",
"0.64818907",
"0.6481815",
"0.64762",
"0.64747494",
"0.6473619",
"0.64714915",
"0.64698935",
"0.64688975",
"0.6467979",
"0.6467745",
"0.64561594",
"0.644867",
"0.6439644",
"0.6433074",
"0.64058274",
"0.6405385",
"0.6388368",
"0.63833976",
"0.6381664",
"0.6381664",
"0.6381664",
"0.6381664",
"0.6381664",
"0.63797426",
"0.63797426",
"0.6378377",
"0.63773507",
"0.63757217",
"0.63720703",
"0.63666695",
"0.63666695",
"0.6365927",
"0.6363913",
"0.63607025",
"0.6358188",
"0.63436145",
"0.63389623",
"0.633266",
"0.63274986",
"0.6326362",
"0.63205504",
"0.63205504",
"0.63205504",
"0.63205504",
"0.63205504",
"0.6318981",
"0.6318981",
"0.6318981",
"0.6318981",
"0.6318981",
"0.6318981",
"0.6318981",
"0.6318981",
"0.6317529",
"0.63130575",
"0.631283",
"0.6303084",
"0.63022006",
"0.63017124",
"0.6301231",
"0.63005745",
"0.6293398",
"0.6292237",
"0.6287452",
"0.6284417",
"0.6282972",
"0.6282914",
"0.62825435"
] | 0.7868487 | 0 |
POST /guides POST /guides.xml | def create
@guide = Guide.new(params[:guide])
@guide.secret_code = Guide.secret_code
respond_to do |format|
if @guide.save
flash[:notice] = 'Guide was successfully created.'
format.html { redirect_to(guides_path) }
format.xml { render :xml => @guide, :status => :created, :location => @guide }
else
format.html { render :action => "new" }
format.xml { render :xml => @guide.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @guide = Guide.new(guide_params)\n\n respond_to do |format|\n if @guide.save\n format.html { redirect_to @guide, notice: 'Guide was successfully created.' }\n format.json { render :show, status: :created, location: @guide }\n else\n format.html { render :new }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @guide = Guide.new(guide_params)\n\n respond_to do |format|\n if @guide.save\n format.html { redirect_to @guide, notice: 'Guide was successfully created.' }\n format.json { render :show, status: :created, location: @guide }\n else\n format.html { render :new }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create \n @guide = Guide.new(params[:guide])\n respond_to do |format|\n if @guide.save\n format.html { redirect_to guide_url(@guide), notice: 'Guide was successfully created.' }\n format.json { render json: @guide, status: :created, location: @guide }\n else\n format.html { render action: \"new\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @guide = Guide.new(params[:guide])\n @guide.user = current_user\n\n respond_to do |format|\n if @guide.save\n create_default_guide_taxa\n format.html { redirect_to @guide, notice: 'Guide was successfully created.' }\n format.json { render json: @guide.as_json(:root => true), status: :created, location: @guide }\n else\n format.html { render action: \"new\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @guide = Guide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @guide }\n end\n end",
"def create\n @guide = Guide.new(guide_params)\n\n respond_to do |format|\n action_message_for('new')\n if create_guide\n format.html { redirect_to redirect_target(@guide), flash: @feedback_flash }\n format.json { render :show, status: :created, location: @guide }\n else\n 1.times { @guide.sections.new }\n 1.times { @guide.sections.new } if @guide.subtype == 'detailed_guide' && @guide.sections.size < 2\n format.html { render :new }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def guide_params\n params.require(:guide).permit(:id, :preamble_id, :text, :postscript_id)\n end",
"def create\n @breadcrumb = 'create'\n @guide = Guide.new(params[:guide])\n @guide.created_by = current_user.id if !current_user.nil?\n \n respond_to do |format|\n if @guide.save\n format.html { redirect_to @guide, notice: crud_notice('created', @guide) }\n format.json { render json: @guide, status: :created, location: @guide }\n else\n format.html { render action: \"new\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @guide = @item.guides.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guide }\n end\n end",
"def index\n @guides = Guide.all\n #@guide = Guide.find(params[:guide]) rescue nil\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @guides }\n end\n end",
"def guide_params\n params.require(:guide).permit(:title, :description, :steps, :source)\n end",
"def create\n @guide = Guide.new(params[:guide])\n respond_to do |format|\n if @guide.save\n params[:user_name] = nil\n format.html { redirect_to guide_url(@guide), notice: 'Guide was successfully created.' }\n format.json { render json: @guide, status: :created, location: @guide }\n else\n format.html { render action: \"new\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n @guide_post = GuidePost.new(params[:guide_post])\n\n respond_to do |format|\n if @guide_post.save\n format.html { redirect_to @guide_post, notice: 'Guide post was successfully created.' }\n format.json { render json: @guide_post, status: :created, location: @guide_post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @guide_post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @scholarship_guide = ScholarshipGuide.new(scholarship_guide_params)\n\n respond_to do |format|\n if @scholarship_guide.save\n format.html { redirect_to @scholarship_guide, notice: 'Scholarship guide was successfully created.' }\n format.json { render :show, status: :created, location: @scholarship_guide }\n else\n format.html { render :new }\n format.json { render json: @scholarship_guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @guideline = Guideline.new(guideline_params)\n\n respond_to do |format|\n if @guideline.save\n format.html { redirect_to @guideline, notice: \"Guideline was successfully created.\" }\n format.json { render :show, status: :created, location: @guideline }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @guideline.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @guide = Guide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guide.as_json(:root => true) }\n end\n end",
"def guides\n @guides ||= Guides::GuidesRetriever.get_guides(action).input\n end",
"def guide_params\n params.require(:guide).permit(:company, :address, :patient, :doctor, :date, :hour, :specialty, :exam, :document, :passport, :value, :registration)\n end",
"def guide_params\n params.require(:guide).permit(:name, :password, :date, :language, :address, :email, :image, :rating)\n end",
"def index\n @guides = Guide.all\n end",
"def index\n @guides = Guide.all\n end",
"def guide_params\n params[:guide].permit(:subtype,\n :call_to_action_type,\n :call_to_action_label,\n :call_to_action_content,\n :call_to_action_reason,\n :contact_name,\n :contact_email,\n :contact_phone,\n :featured_image,\n :featured_image_alt,\n :featured_image_caption,\n :object_title,\n :object_embed_code,\n sections_attributes: [:id,\n :title,\n :body_content,\n :_destroy],\n content_item_attributes: [:id,\n :as_a,\n :i_need,\n :so_that,\n :title,\n :summary,\n :status,\n :organisation_id,\n associated_org_ids: [],\n label_ids: []]\n )\n end",
"def create\n @guide = @item.guides.build(guide_params)\n\n respond_to do |format|\n if @guide.save\n format.any(:html, :mobile) { redirect_to [@item, @guide], notice: \"Guide was successfully created.\" }\n format.json { render json: @guide, status: :created, location: [@item, @guide] }\n format.js { render :form }\n else\n format.any(:html, :mobile) { render action: \"new\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n format.js { render :form }\n end\n end\n end",
"def index\n @guides = Guide.page(1)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: {:guides => @guides.as_json} }\n end\n end",
"def create\n @servingguide = Servingguide.new(servingguide_params)\n\n respond_to do |format|\n if @servingguide.save\n format.html { redirect_to @servingguide, notice: 'Servingguide was successfully created.' }\n format.json { render :show, status: :created, location: @servingguide }\n else\n format.html { render :new }\n format.json { render json: @servingguide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @guide_section = GuideSection.new(guide_section_params)\n\n respond_to do |format|\n if @guide_section.save\n format.html { redirect_to guide_sections_url, notice: 'Guide section was successfully created.' }\n format.json { render :show, status: :created, location: @guide_section }\n else\n format.html { render :new }\n format.json { render json: @guide_section.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @guide = Guide.find(params[:id])\n @guide.destroy\n\n respond_to do |format|\n format.html { redirect_to(guides_url) }\n format.xml { head :ok }\n end\n end",
"def create\n @assembly_guide = AssemblyGuide.new(params[:assembly_guide])\n\n respond_to do |format|\n if @assembly_guide.save\n format.html { redirect_to @assembly_guide, notice: 'Assembly guide was successfully created.' }\n format.json { render json: @assembly_guide, status: :created, location: @assembly_guide }\n else\n format.html { render action: \"new\" }\n format.json { render json: @assembly_guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @breadcrumb = 'create'\n @guide = Guide.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guide }\n end\n end",
"def create\n @guidebook = Guidebook.new(guidebook_params)\n\n respond_to do |format|\n if @guidebook.save\n format.html { redirect_to @guidebook, notice: 'Guidebook was successfully created.' }\n format.json { render :show, status: :created, location: @guidebook }\n else\n format.html {\n flash[:errors] = @guidebook.errors\n flash[:opened] = true\n redirect_to guidebooks_organizer_path(guidebook_params[:organizer] || guidebook_params[:organizer_id]),\n notice: t('tours_controller_create_notice_two')\n }\n format.json { render json: @guidebook.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @guide = Guide.find(params[:id])\n\n respond_to do |format|\n if @guide.update_attributes(params[:guide])\n flash[:notice] = 'Guide was successfully updated.'\n format.html { redirect_to(@guide) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @guide.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def guides\n @guides ||= Guides::GuidesRetriever.get_guides(action)\n end",
"def guidebook_params\n\n split_val = \";\"\n organizer = params[:guidebook][:organizer_id] || params[:guidebook][:organizer]\n\n\n if organizer.class == String\n new_organizer = Organizer.find_by_name(organizer)\n\n unless new_organizer.nil?\n new_user = new_organizer.user\n params[:guidebook][:user] = new_user\n params[:guidebook][:organizer] = new_organizer\n end\n end\n\n if params[:guidebook][:tags] == \"\" or params[:guidebook][:tags].nil?\n params[:guidebook][:tags] = []\n else\n tags_to_array = params[:guidebook][:tags].split(split_val)\n tags = []\n tags_to_array.each do |t|\n tags.push Tag.find_or_create_by(name: t)\n end\n params[:guidebook][:tags] = tags\n end\n\n if params[:guidebook][:languages] == \"\" or params[:guidebook][:languages].nil?\n params[:guidebook][:languages] = []\n else\n langs_to_array = params[:guidebook][:languages].split(split_val)\n langs = []\n langs_to_array.each do |l|\n langs.push Language.find_or_create_by(name: l)\n end\n params[:guidebook][:languages] = langs\n end\n\n pkg_attr = params[:guidebook][:packages]\n\n if !pkg_attr.nil?\n post_data = []\n pkg_attr.each do |p|\n included_array = p[1][\"included\"].split(split_val)\n post_data.push Package.create(name: p[1][\"name\"], value: p[1][\"value\"], percent: p[1][\"percent\"], description: p[1][\"description\"], included: included_array)\n end\n params[:guidebook][:packages] = post_data\n end\n\n if params[:guidebook][:included] == \"\" or params[:guidebook][:included].nil?\n params[:guidebook][:included] = []\n else\n included_to_array = params[:guidebook][:included].split(split_val)\n included = []\n included_to_array.each do |i|\n included.push i\n end\n params[:guidebook][:included] = included\n end\n\n if params[:guidebook][:nonincluded] == \"\" or params[:guidebook][:nonincluded].nil?\n params[:guidebook][:nonincluded] = []\n else\n nonincluded_to_array = params[:guidebook][:nonincluded].split(split_val)\n nonincluded = []\n nonincluded_to_array.each do |i|\n nonincluded.push i\n end\n params[:guidebook][:nonincluded] = nonincluded\n end\n\n current_category = params[:guidebook][:category]\n\n if current_category == \"\" or current_category.nil?\n params[:guidebook][:category] = Category.find_or_create_by(name: 'Outras')\n else\n begin\n params[:guidebook][:category] = Category.find(current_category)\n rescue => e\n params[:guidebook][:category] = Category.find_or_create_by(name: current_category)\n end\n end\n\n params[:guidebook][:currency] = \"BRL\"\n\n # unpermitted params error even with all params provided\n #params.require(:guidebook).permit(:title, :currency, :picture, :organizer_id, :file, :value, :description, :status, :category_id, user: [:id, :name], organizer: [:id, :name], tags: [:id, :name], languages: [:id, :name], category: [:id, :name], packages_attributes: [:id, :name, :value, :description, :percent, :included], wheres_attributes: [:id, :name, :place_id, :background_id, :lat, :long, :city, :state, :country, :postal_code, :address, :google_id, :url], included: [], nonincluded: []).merge(params[:guidebook])\n params.require(:guidebook).permit!\n end",
"def show\n @guide = Guide.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @guide }\n end\n end",
"def set_guide\n @guide = Guide.find(params[:id])\n end",
"def study_guide_params\n params.require(:study_guide).permit(:name)\n end",
"def create\n @survival_guide = SurvivalGuide.new(survival_guide_params)\n\n respond_to do |format|\n if @survival_guide.save\n format.html { redirect_to @survival_guide, notice: 'Survival guide was successfully created.' }\n format.json { render :show, status: :created, location: @survival_guide }\n else\n format.html { render :new }\n format.json { render json: @survival_guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def survival_guide_params\n params.require(:survival_guide).permit(:guide_title, :guide_para1, :guide_para2)\n end",
"def set_guide\n @guide = Guide.find(params[:id])\n end",
"def set_guide\n @guide = Guide.find(params[:id])\n end",
"def set_guide\n @guide = Guide.find(params[:id])\n end",
"def create\n @remission_guide = RemissionGuide.new(remission_guide_params)\n @remission_guide.date = Time.now\n respond_to do |format|\n if @remission_guide.save\n update_credit_and_pending\n format.html {\n flash[:notice] = 'La Guía de Remisión se creó satisfactoriamente.'\n redirect_to remission_guides_path\n }\n format.json { render :show, status: :created, location: @remission_guide }\n else\n format.html { \n flash[:error] = @remission_guide.errors\n redirect_to new_remission_guide_path\n }\n format.json { render json: @remission_guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @strategy_guides = StrategyGuide.all\n \n respond_with(@strategy_guides)\n end",
"def post(xmldoc)\n headers = {'Content-Type' => 'text/xml'}\n check_response( @httpcli.post(@endpoint, xmldoc, headers) )\n end",
"def index\n @guides = Guide.paginate(:page => params[:page], :per_page => per_page).order(sort_column + ' ' + sort_direction)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @guides }\n end\n end",
"def update\n respond_to do |format|\n if @guide.update(guide_params)\n format.html { redirect_to @guide, notice: 'Guide was successfully updated.' }\n format.json { render :show, status: :ok, location: @guide }\n else\n format.html { render :edit }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @guide.update(guide_params)\n format.html { redirect_to @guide, notice: 'Guide was successfully updated.' }\n format.json { render :show, status: :ok, location: @guide }\n else\n format.html { render :edit }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @guide = Guide.find(params[:id])\n\n respond_to do |format|\n if @guide.update_attributes(params[:guide])\n format.html { redirect_to @guide, notice: 'Guide was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @guide = Guide.find(params[:id])\n\n respond_to do |format|\n if @guide.update_attributes(params[:guide])\n format.html { redirect_to @guide, notice: 'Guide was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @guide = Guide.find(params[:id])\n\n respond_to do |format|\n if @guide.update_attributes(params[:guide])\n format.html { redirect_to @guide, notice: 'Guide was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @remission_guides = RemissionGuide.all\n end",
"def create\n @faq = Faq.new(params[:faq])\n\n respond_to do |format|\n if @faq.save\n flash[:notice] = 'Faq was successfully created.'\n format.html { redirect_to(@faq) }\n format.xml { render :xml => @faq, :status => :created, :location => @faq }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @faq.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create(doc_client,course_name)\n @doc_client=doc_client\n body=<<-EOF\n<?xml version='1.0' encoding='UTF-8'?>\n<entry xmlns=\"http://www.w3.org/2005/Atom\">\n<category scheme=\"http://schemas.google.com/g/2005#kind\"\nterm=\"http://schemas.google.com/docs/2007#spreadsheet\"/>\n<title>#{course_name}</title>\n</entry>\nEOF\n @doc_feed=@doc_client.post('http://docs.google.com/feeds/documents/private/full',body) \n puts @doc_feed\n \n end",
"def guideline_params\n params.require(:guideline).permit(:test, :semester, :year, :size_mb, :description)\n end",
"def create\n @guide_trip = GuideTrip.new(guide_trip_params)\n\n respond_to do |format|\n if @guide_trip.save\n format.html { redirect_to @guide_trip, notice: 'Guía turístico fue creado satisfactoriamente.' }\n format.json { render :show, status: :created, location: @guide_trip }\n else\n format.html { render :new }\n format.json { render json: @guide_trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @guides = search(guides_search_params)\n end",
"def guideline_params\n params.require(:guideline).permit(:description, :text, :brand_id)\n end",
"def create\n @tutorials = Tutorials.new(params[:tutorials])\n\n respond_to do |format|\n if @tutorials.save\n flash[:notice] = 'Tutorials was successfully created.'\n format.html { redirect_to(@tutorials) }\n format.xml { render :xml => @tutorials, :status => :created, :location => @tutorials }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @tutorials.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @guideline = Guideline.new(guideline_params)\n\n respond_to do |format|\n if @guideline.save\n format.html { redirect_to user_brand_path(current_user, @guideline.brand_id), notice: 'Guideline was successfully saved.' }\n format.json { render json: @guideline, status: :created, location: user_brand_path(current_user, @guideline.brand_id)}\n else\n format.html { redirect_to user_brand_path(current_user, @guideline.brand_id), notice: 'Guideline was not saved.' }\n format.json { render json: @guideline.errors, status: :unprocessable_entity }\n end\n end\n end",
"def guide_item_params\n params.require(:guide_item).permit(:section_id, :anchor, :label, :ordinal, :heading, :body, :public)\n end",
"def guides_text_params\n params.require(:guides_text).permit(:title, :content, :user_id, :published_at)\n end",
"def show\n @guide = Guide.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @guide.as_json(:root => true) }\n end\n end",
"def postIdea(community_id, idea_title, category_id, tags, params)\n\n url_base = \"#{getURIBase}/api/v1/communities/#{community_id}/ideas\"\n\n headers = Hash.new\n headers['Content-Type'] = 'application/json'\n\n parameters = Hash.new\n parameters['title'] = idea_title\n parameters['category_id'] = category_id.to_i\n parameters['tags'] = tags.nil? ? '' : tags\n parameters['post_anonymously'] = false\n\n # if no params were sent then no need to add an empty hash\n unless params.nil? or params == ''\n parameters['template_fields'] = APIClientWrapper.new.__parseStringToHash__(params)\n end\n\n makePostCall(url_base, headers, parameters)\n end",
"def new\n @howto = Howto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @howto }\n end\n end",
"def create\n params[:idea][:tags] = params[:idea][:tags].collect { |tag| Tag.find(tag) }\n\n @idea = @current_user.ideas.create(params[:idea])\n\n respond_to do |format|\n if @idea.save\n format.html { redirect_to(@idea, :notice => 'Idea was successfully created.') }\n format.xml { render :xml => @idea, :status => :created, :location => @idea }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @idea.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def delete\n @guide = Guide.find(params[:id])\n @guide.destroy\n respond_to do |format|\n format.html { redirect_to guides_url }\n format.json { head :no_content }\n end\n end",
"def create\n @agreement = Agreement.new(agreement_params)\n\n respond_to do |format|\n if @agreement.save\n format.html { redirect_to @agreement, notice: 'Certificado criado com sucesso.' }\n format.json { render :show, status: :created, location: @agreement }\n else\n format.html { render :new }\n format.json { render json: @agreement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @guide = Guide.find(params[:id])\n @guide.destroy\n\n respond_to do |format|\n format.html { redirect_to guides_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @guide = Guide.find(params[:id])\n @guide.destroy\n\n respond_to do |format|\n format.html { redirect_to guides_url }\n format.json { head :no_content }\n end\n end",
"def create\n @faq = Faq.new(params[:faq])\n flash[:notice] = 'Faq was successfully created.' if @faq.save\n respond_with(@faq)\n end",
"def guide_section_params\n params.require(:guide_section).permit(:title)\n end",
"def index\n @guidelines = Guideline.all\n end",
"def index\n @guidelines = Guideline.all\n end",
"def guide_trip_params\n params.require(:guide_trip).permit(:id_guide_trip, :id_trip, :id_guide)\n end",
"def create\n @howto = Howto.new(params[:howto])\n\n respond_to do |format|\n if @howto.save\n flash[:notice] = 'Howto was successfully created.'\n format.html { redirect_to(@howto) }\n format.xml { render :xml => @howto, :status => :created, :location => @howto }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @howto.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_guide\n @guide = Guide.where(:id => params[:id]).first\n end",
"def new \n @how_to = HowTo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @how_to }\n end\n end",
"def set_guides_text\n @guides_text = Guides::Text.find(params[:id])\n end",
"def new\n @faq = Faq.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @faq }\n end\n end",
"def new\n @assembly_guide = AssemblyGuide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @assembly_guide }\n end\n end",
"def new\n @tutorials = Tutorials.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tutorials }\n end\n end",
"def post #:doc:\n end",
"def create\n @guide_item = Guide::Item.new(guide_item_params)\n\n respond_to do |format|\n if @guide_item.save\n format.html { redirect_to @guide_item, notice: \"Item was successfully created.\" }\n format.json { render :show, status: :created, location: @guide_item }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @guide_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @set_aside = SetAside.new(set_aside_params)\n\n respond_to do |format|\n if @set_aside.save\n format.html { redirect_to @set_aside, notice: 'Set aside was successfully created.' }\n format.json { render action: 'show', status: :created, location: @set_aside }\n else\n format.html { render action: 'new' }\n format.json { render json: @set_aside.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create(name=\"Default Name\", age=\"50\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <name>#{name}</name>\r\n <age>#{age}</age>\r\n </person>\"\r\n \r\n request = Net::HTTP::Post.new(@url)\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n response.body \r\n end",
"def destroy\n @guide.destroy\n respond_to do |format|\n format.html { redirect_to guides_url, notice: 'Guide was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def create\n @manual = Manual.new(params[:manual])\n\n respond_to do |format|\n if @manual.save\n format.html { redirect_to(@manual, :notice => 'Manual was successfully created.') }\n format.xml { render :xml => @manual, :status => :created, :location => @manual }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @manual.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @learn = Learn.new(params[:learn])\n\n respond_to do |format|\n if @learn.save\n format.html { redirect_to @learn, notice: 'Learn was successfully created.' }\n format.json { render json: @learn, status: :created, location: @learn }\n else\n format.html { render action: \"new\" }\n format.json { render json: @learn.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @knowledge = Knowledge.new(knowledge_params)\n\n respond_to do |format|\n if @knowledge.save\n format.html { redirect_to knowledges_path , notice: 'Área do conhecimento cadastrada com sucesso.' }\n format.json { render :show, status: :created, location: @knowledge }\n else\n format.html { render :new }\n format.json { render json: @knowledge.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @knowledge = current_user.knowledges.new(params[:knowledge])\n\n respond_to do |format|\n if @knowledge.save\n format.html { redirect_to @knowledge, notice: 'Knowledge was successfully created.' }\n format.json { render json: @knowledge, status: :created, location: @knowledge }\n else\n format.html { render action: \"new\" }\n format.json { render json: @knowledge.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @strategy_guide = StrategyGuide.new(params[:strategy_guide])\n @strategy_guide.user = current_user\n\n if @strategy_guide.save\n redirect_to(new_strategy_guide_skill_build_path(@strategy_guide.id))\n else\n render :action => \"new\"\n end\n \n end",
"def set_guides_text\n @guides_text = Guides::Text.find(params[:id])\n end",
"def create\n @question_topic = QuestionTopic.new(params[:question_topic])\n\n respond_to do |format|\n if @question_topic.save\n format.html { redirect_to(@question_topic, :notice => 'Question topic was successfully created.') }\n format.xml { render :xml => @question_topic, :status => :created, :location => @question_topic }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @question_topic.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def faq_new\n @article = Article.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @article }\n end\n end",
"def post(uri, xml)\r\n req = Net::HTTP::Post.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end",
"def create\n @question_learned = QuestionLearned.new(question_learned_params)\n\n respond_to do |format|\n if @question_learned.save\n format.html { redirect_to @question_learned, notice: 'Question learned was successfully created.' }\n format.json { render action: 'show', status: :created, location: @question_learned }\n else\n format.html { render action: 'new' }\n format.json { render json: @question_learned.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @guide.destroy\n respond_to do |format|\n format.html { redirect_to guides_url, notice: 'Guide was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def post(url_variables:, body:)\n ensure_service_document\n\n end",
"def new\n @guide = Guide.new\n @stress_factor = [['1/10','1/10'],['2/10','2/10'],['3/10','3/10'],['4/10','4/10'],['5/10','5/10'],['6/10','6/10'],['7/10','7/10'],['8/10','8/10'],['9/10','9/10'],['10/10','10/10']]\n @pacing = [['Pacing Schmacing','Pacing Schmacing'],['Lazy','Lazy'],['Stay On Course','Stay On Course'],['Wha','Wha']]\n @category = [['Foodles','Foodles'],['Night Life','Night Life'],['Shopping','Shopping'],['Style','Style'],['Culture','Culture'],['Must See','Must See'],['Cheapo','Cheapo'],['Artsy','Artsy']]\n #render :html => \"new.html.haml\"\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guide }\n end\n end",
"def create\n @guides_text = Guides::Text.new(guides_text_params)\n @guides_text.user = current_user\n @guides_text.published_at = Time.now\n respond_to do |format|\n if @guides_text.save\n format.html { redirect_to @guides_text, notice: 'Text was successfully created.' }\n format.json { render :show, status: :created, location: @guides_text }\n else\n format.html { render :new }\n format.json { render json: @guides_text.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.6557796",
"0.6557796",
"0.6543405",
"0.63241917",
"0.62806326",
"0.6214812",
"0.61328715",
"0.6132308",
"0.6121283",
"0.6046019",
"0.6025866",
"0.60048467",
"0.5966775",
"0.5929379",
"0.5913038",
"0.5876413",
"0.5833023",
"0.582743",
"0.58205765",
"0.5807726",
"0.5807726",
"0.576402",
"0.5696207",
"0.5685206",
"0.5674096",
"0.5670415",
"0.5649824",
"0.56458443",
"0.56398416",
"0.56321186",
"0.5612331",
"0.55515784",
"0.55490106",
"0.5542955",
"0.55186874",
"0.54604423",
"0.54434615",
"0.54347897",
"0.54347044",
"0.54347044",
"0.54347044",
"0.5427017",
"0.54268944",
"0.54088074",
"0.5391904",
"0.53905296",
"0.53905296",
"0.53470474",
"0.53470474",
"0.53470474",
"0.53443074",
"0.5342035",
"0.5332885",
"0.52850497",
"0.52811337",
"0.5263876",
"0.52566266",
"0.5256142",
"0.52559334",
"0.5255721",
"0.52492034",
"0.5241625",
"0.5222442",
"0.52214783",
"0.5205693",
"0.51794225",
"0.5179279",
"0.5168204",
"0.5168204",
"0.5168058",
"0.5166563",
"0.51593524",
"0.51593524",
"0.51584905",
"0.51522774",
"0.51522",
"0.514271",
"0.51341975",
"0.5123231",
"0.51194555",
"0.5111997",
"0.51091254",
"0.51025236",
"0.5097892",
"0.50603944",
"0.5056602",
"0.5048683",
"0.50479263",
"0.50450104",
"0.50404817",
"0.50370073",
"0.5036262",
"0.50319445",
"0.50239605",
"0.50195324",
"0.50164676",
"0.5015493",
"0.50148547",
"0.5009701",
"0.5007053"
] | 0.6618626 | 0 |
PUT /guides/1 PUT /guides/1.xml | def update
@guide = Guide.find(params[:id])
respond_to do |format|
if @guide.update_attributes(params[:guide])
flash[:notice] = 'Guide was successfully updated.'
format.html { redirect_to(@guide) }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @guide.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @guide = Guide.find(params[:id])\n\n respond_to do |format|\n if @guide.update_attributes(params[:guide])\n format.html { redirect_to @guide, notice: 'Guide was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @guide = Guide.find(params[:id])\n\n respond_to do |format|\n if @guide.update_attributes(params[:guide])\n format.html { redirect_to @guide, notice: 'Guide was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @guide = Guide.find(params[:id])\n\n respond_to do |format|\n if @guide.update_attributes(params[:guide])\n format.html { redirect_to @guide, notice: 'Guide was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @guide.update(guide_params)\n format.html { redirect_to @guide, notice: 'Guide was successfully updated.' }\n format.json { render :show, status: :ok, location: @guide }\n else\n format.html { render :edit }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @guide.update(guide_params)\n format.html { redirect_to @guide, notice: 'Guide was successfully updated.' }\n format.json { render :show, status: :ok, location: @guide }\n else\n format.html { render :edit }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @breadcrumb = 'update'\n @guide = Guide.find(params[:id])\n @guide.updated_by = current_user.id if !current_user.nil?\n \n respond_to do |format|\n if @guide.update_attributes(params[:guide])\n format.html { redirect_to @guide,\n notice: (crud_notice('updated', @guide) + \"#{undo_link(@guide)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_guide\n @guide = Guide.find(params[:id])\n end",
"def set_guide\n @guide = Guide.find(params[:id])\n end",
"def set_guide\n @guide = Guide.find(params[:id])\n end",
"def set_guide\n @guide = Guide.find(params[:id])\n end",
"def create\n @guide = Guide.new(params[:guide])\n @guide.secret_code = Guide.secret_code\n\n respond_to do |format|\n if @guide.save\n flash[:notice] = 'Guide was successfully created.'\n format.html { redirect_to(guides_path) }\n format.xml { render :xml => @guide, :status => :created, :location => @guide }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @guide.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_guide\n @guide = Guide.where(:id => params[:id]).first\n end",
"def update\n respond_to do |format|\n if @guideline.update(guideline_params)\n format.html { redirect_to @guideline, notice: \"Guideline was successfully updated.\" }\n format.json { render :show, status: :ok, location: @guideline }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @guideline.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @guide = Guide.find(params[:id])\n @guide.destroy\n\n respond_to do |format|\n format.html { redirect_to(guides_url) }\n format.xml { head :ok }\n end\n end",
"def index\n @guides = Guide.all\n #@guide = Guide.find(params[:guide]) rescue nil\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @guides }\n end\n end",
"def update\n respond_to do |format|\n if @scholarship_guide.update(scholarship_guide_params)\n format.html { redirect_to @scholarship_guide, notice: 'Scholarship guide was successfully updated.' }\n format.json { render :show, status: :ok, location: @scholarship_guide }\n else\n format.html { render :edit }\n format.json { render json: @scholarship_guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create \n @guide = Guide.new(params[:guide])\n respond_to do |format|\n if @guide.save\n format.html { redirect_to guide_url(@guide), notice: 'Guide was successfully created.' }\n format.json { render json: @guide, status: :created, location: @guide }\n else\n format.html { render action: \"new\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @guide = Guide.new(guide_params)\n\n respond_to do |format|\n if @guide.save\n format.html { redirect_to @guide, notice: 'Guide was successfully created.' }\n format.json { render :show, status: :created, location: @guide }\n else\n format.html { render :new }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @guide = Guide.new(guide_params)\n\n respond_to do |format|\n if @guide.save\n format.html { redirect_to @guide, notice: 'Guide was successfully created.' }\n format.json { render :show, status: :created, location: @guide }\n else\n format.html { render :new }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end",
"def update\n @assembly_guide = AssemblyGuide.find(params[:id])\n\n respond_to do |format|\n if @assembly_guide.update_attributes(params[:assembly_guide])\n format.html { redirect_to @assembly_guide, notice: 'Assembly guide was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @assembly_guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_guidebook\n @guidebook = Guidebook.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @guidebook.update(guidebook_params)\n format.html { redirect_to @guidebook, notice: 'Guidebook was successfully updated.' }\n format.json { render :show, status: :ok, location: @guidebook }\n else\n format.html {\n puts @guidebook.errors.inspect\n render :edit\n }\n format.json { render json: @guidebook.errors, status: :unprocessable_entity }\n end\n end\n end",
"def guide_params\n params.require(:guide).permit(:id, :preamble_id, :text, :postscript_id)\n end",
"def index\n @guides = Guide.all\n end",
"def index\n @guides = Guide.all\n end",
"def update\n respond_to do |format|\n if @guide.update_attributes(guide_params)\n format.any(:html, :mobile) { redirect_to [@item, @guide], notice: \"Guide was successfully updated.\" }\n format.json { render json: @guide }\n format.js { render :form }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n format.js { render :form }\n end\n end\n end",
"def update\n respond_to do |format|\n if @guide_section.update(guide_section_params)\n format.html { redirect_to guide_sections_url, notice: 'Guide section was successfully updated.' }\n format.json { render :show, status: :ok, location: @guide_section }\n else\n format.html { render :edit }\n format.json { render json: @guide_section.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end",
"def update\n respond_to do |format|\n if @servingguide.update(servingguide_params)\n format.html { redirect_to @servingguide, notice: 'Servingguide was successfully updated.' }\n format.json { render :show, status: :ok, location: @servingguide }\n else\n format.html { render :edit }\n format.json { render json: @servingguide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def guide_params\n params.require(:guide).permit(:title, :description, :steps, :source)\n end",
"def update\n respond_to do |format|\n if @tourguide.update(tourguide_params)\n format.html { redirect_to @tourguide, notice: 'Tourguide was successfully updated.' }\n format.json { render :show, status: :ok, location: @tourguide }\n else\n format.html { render :edit }\n format.json { render json: @tourguide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @guide = Guide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @guide }\n end\n end",
"def update\n respond_to do |format|\n if @remission_guide.update(remission_guide_params)\n format.html { \n flash[:notice] = 'La Guía de Remisión se actualizó satisfactoriamente.'\n redirect_to remission_guides_path\n }\n format.json { render :show, status: :ok, location: @remission_guide }\n else\n format.html { render :edit }\n format.json { render json: @remission_guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_guideline\n @guideline = Guideline.find(params[:id])\n end",
"def set_guideline\n @guideline = Guideline.find(params[:id])\n end",
"def create\n @guide = Guide.new(params[:guide])\n @guide.user = current_user\n\n respond_to do |format|\n if @guide.save\n create_default_guide_taxa\n format.html { redirect_to @guide, notice: 'Guide was successfully created.' }\n format.json { render json: @guide.as_json(:root => true), status: :created, location: @guide }\n else\n format.html { render action: \"new\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @guide = Guide.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @guide }\n end\n end",
"def update\n respond_to do |format|\n action_message_for(@guide.content_item.status)\n if update_guide\n format.html { redirect_to redirect_target(@guide), flash: @feedback_flash }\n format.json { render :show, status: :ok, location: @guide }\n else\n 1.times { @guide.sections.new } if @guide.subtype == 'detailed_guide'\n @guide.content_item.status = session[:content_item_status]\n format.html { render :edit }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @guide = @item.guides.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guide }\n end\n end",
"def update\n respond_to do |format|\n if @guides_text.update(guides_text_params)\n format.html { redirect_to @guides_text, notice: 'Text was successfully updated.' }\n format.json { render :show, status: :ok, location: @guides_text }\n else\n format.html { render :edit }\n format.json { render json: @guides_text.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_study_guide\n @study_guide = StudyGuide.find(params[:id])\n end",
"def guides\n @guides ||= Guides::GuidesRetriever.get_guides(action).input\n end",
"def update\n respond_to do |format|\n if @survival_guide.update(survival_guide_params)\n format.html { redirect_to @survival_guide, notice: 'Survival guide was successfully updated.' }\n format.json { render :show, status: :ok, location: @survival_guide }\n else\n format.html { render :edit }\n format.json { render json: @survival_guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @guide = Guide.new(guide_params)\n\n respond_to do |format|\n action_message_for('new')\n if create_guide\n format.html { redirect_to redirect_target(@guide), flash: @feedback_flash }\n format.json { render :show, status: :created, location: @guide }\n else\n 1.times { @guide.sections.new }\n 1.times { @guide.sections.new } if @guide.subtype == 'detailed_guide' && @guide.sections.size < 2\n format.html { render :new }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @guide = Guide.new(params[:guide])\n respond_to do |format|\n if @guide.save\n params[:user_name] = nil\n format.html { redirect_to guide_url(@guide), notice: 'Guide was successfully created.' }\n format.json { render json: @guide, status: :created, location: @guide }\n else\n format.html { render action: \"new\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @guide = Guide.find(params[:id])\n @guide.destroy\n\n respond_to do |format|\n format.html { redirect_to guides_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @guide = Guide.find(params[:id])\n @guide.destroy\n\n respond_to do |format|\n format.html { redirect_to guides_url }\n format.json { head :no_content }\n end\n end",
"def update\n respond_to do |format|\n if @guideline.update(guideline_params)\n format.html { redirect_to brand_path(@guideline.brand_id), notice: 'Guideline was successfully updated.' }\n format.json { render :show, status: :ok, location: @guideline }\n else\n format.html { render :edit }\n format.json { render json: @guideline.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_guide_section\n @guide_section = GuideSection.find(params[:id])\n end",
"def update\n @tutorials = Tutorials.find(params[:id])\n\n respond_to do |format|\n if @tutorials.update_attributes(params[:tutorials])\n flash[:notice] = 'Tutorials was successfully updated.'\n format.html { redirect_to(@tutorials) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tutorials.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @breadcrumb = 'create'\n @guide = Guide.new(params[:guide])\n @guide.created_by = current_user.id if !current_user.nil?\n \n respond_to do |format|\n if @guide.save\n format.html { redirect_to @guide, notice: crud_notice('created', @guide) }\n format.json { render json: @guide, status: :created, location: @guide }\n else\n format.html { render action: \"new\" }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_guides_text\n @guides_text = Guides::Text.find(params[:id])\n end",
"def update\n @faq = Faq.find(params[:id])\n\n respond_to do |format|\n if @faq.update_attributes(params[:faq])\n flash[:notice] = 'Faq was successfully updated.'\n format.html { redirect_to(@faq) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @faq.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @faq = Faq.find(params[:id])\n\n respond_to do |format|\n if @faq.update_attributes(params[:faq])\n flash[:notice] = 'Faq was successfully updated.'\n format.html { redirect_to(@faq) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @faq.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def guide_params\n params[:guide].permit(:subtype,\n :call_to_action_type,\n :call_to_action_label,\n :call_to_action_content,\n :call_to_action_reason,\n :contact_name,\n :contact_email,\n :contact_phone,\n :featured_image,\n :featured_image_alt,\n :featured_image_caption,\n :object_title,\n :object_embed_code,\n sections_attributes: [:id,\n :title,\n :body_content,\n :_destroy],\n content_item_attributes: [:id,\n :as_a,\n :i_need,\n :so_that,\n :title,\n :summary,\n :status,\n :organisation_id,\n associated_org_ids: [],\n label_ids: []]\n )\n end",
"def set_scholarship_guide\n @scholarship_guide = ScholarshipGuide.find(params[:id])\n end",
"def set_guide_item\n @guide_item = Guide::Item.find(params[:id])\n end",
"def delete\n @guide = Guide.find(params[:id])\n @guide.destroy\n respond_to do |format|\n format.html { redirect_to guides_url }\n format.json { head :no_content }\n end\n end",
"def set_servingguide\n @servingguide = Servingguide.find(params[:id])\n end",
"def index\n @guides = Guide.page(1)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: {:guides => @guides.as_json} }\n end\n end",
"def create\n @scholarship_guide = ScholarshipGuide.new(scholarship_guide_params)\n\n respond_to do |format|\n if @scholarship_guide.save\n format.html { redirect_to @scholarship_guide, notice: 'Scholarship guide was successfully created.' }\n format.json { render :show, status: :created, location: @scholarship_guide }\n else\n format.html { render :new }\n format.json { render json: @scholarship_guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @guide_item.update(guide_item_params)\n format.html { redirect_to @guide_item, notice: \"Item was successfully updated.\" }\n format.json { render :show, status: :ok, location: @guide_item }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @guide_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @guide = Guide.find(params[:id])\n\n respond_to do |format|\n if @guide.destroy\n format.html { redirect_to guides_url,\n notice: (crud_notice('destroyed', @guide) + \"#{undo_link(@guide)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { redirect_to guides_url, alert: \"#{@guide.errors[:base].to_s}\".gsub('[\"', '').gsub('\"]', '') }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_guides_text\n @guides_text = Guides::Text.find(params[:id])\n end",
"def update\n @learn = Learn.find(params[:id])\n\n respond_to do |format|\n if @learn.update_attributes(params[:learn])\n flash[:notice] = 'Learn was successfully updated.'\n format.html { redirect_to(@learn) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @learn.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def put(id:, url_variables:, body:)\n ensure_service_document\n end",
"def update\n respond_to do |format|\n if @guide_taxon.update(params[:guide_taxon])\n format.html { redirect_to @guide_taxon, notice: 'Guide taxon was successfully updated.' }\n format.json { render :json => @guide_taxon.as_json(:root => true, :methods => [:html]) }\n else\n format.html do\n load_data_for_edit\n render action: \"edit\"\n end\n format.json { render json: @guide_taxon.errors.full_messages, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @howto = Howto.find(params[:id])\n\n respond_to do |format|\n if @howto.update_attributes(params[:howto])\n flash[:notice] = 'Howto was successfully updated.'\n format.html { redirect_to(@howto) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @howto.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def guide_params\n params.require(:guide).permit(:name, :password, :date, :language, :address, :email, :image, :rating)\n end",
"def guides\n @guides ||= Guides::GuidesRetriever.get_guides(action)\n end",
"def create\n @guideline = Guideline.new(guideline_params)\n\n respond_to do |format|\n if @guideline.save\n format.html { redirect_to @guideline, notice: \"Guideline was successfully created.\" }\n format.json { render :show, status: :created, location: @guideline }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @guideline.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @set_aside.update(set_aside_params)\n format.html { redirect_to @set_aside, notice: 'Set aside was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @set_aside.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @need_help = NeedHelp.find(params[:id])\n\n respond_to do |format|\n if @need_help.update_attributes(params[:need_help])\n format.json {head :no_content}\n else\n format.json {render json: @need_help.errors, status: :unprocessable_entity}\n end\n end\n end",
"def create\n @servingguide = Servingguide.new(servingguide_params)\n\n respond_to do |format|\n if @servingguide.save\n format.html { redirect_to @servingguide, notice: 'Servingguide was successfully created.' }\n format.json { render :show, status: :created, location: @servingguide }\n else\n format.html { render :new }\n format.json { render json: @servingguide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def test_should_update_link_via_API_XML\r\n get \"/logout\"\r\n put \"/links/1.xml\", :link => {:user_id => 1,\r\n :title => 'API Link 1',\r\n :url => 'http://www.api.com'}\r\n assert_response 401\r\n end",
"def update options={}\n client.put(\"/#{id}\", options)\n end",
"def update\n @faq.update(faqs_params)\n json_response(@faq)\n end",
"def update\n @idea = Idea.find(params[:id])\n\n\t\t\n\t\trespond_to do |format|\n if @idea.update_attributes(params[:idea])\n flash[:notice] = 'Idea was successfully updated.'\n format.html { redirect_to(@idea) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @idea.errors, :status => :unprocessable_entity }\n end\n end\n\n end",
"def destroy\n @guide.destroy\n respond_to do |format|\n format.html { redirect_to guides_url, notice: 'Guide was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def update\n @idea = Idea.find(params[:id])\n\n respond_to do |format|\n if @idea.update_attributes(params[:idea])\n format.html { redirect_to(@idea, :notice => 'Idea was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @idea.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @idea = Idea.find(params[:id])\n\n respond_to do |format|\n if @idea.update_attributes(params[:idea])\n format.html { redirect_to(@idea, :notice => 'Idea was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @idea.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @idea = Idea.find(params[:id])\n\n respond_to do |format|\n if @idea.update_attributes(params[:idea])\n format.html { redirect_to(@idea, :notice => 'Idea was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @idea.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @idea = Idea.find(params[:id])\n\n respond_to do |format|\n if @idea.update_attributes(params[:idea])\n format.html { redirect_to(@idea, :notice => 'Idea was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @idea.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n @strategy_guides = StrategyGuide.all\n \n respond_with(@strategy_guides)\n end",
"def update\n @faq = Faq.find(params[:id])\n\n respond_to do |format|\n if @faq.update_attributes(params[:faq])\n format.html { redirect_to @faq, notice: 'FAQ atualizada com sucesso.' }\n format.json { head :no_content }\n else\n @subjects = Subject.all\n format.html { render action: \"edit\" }\n format.json { render json: @faq.errors, status: :unprocessable_entity }\n end\n end\n end",
"def guide_params\n params.require(:guide).permit(:company, :address, :patient, :doctor, :date, :hour, :specialty, :exam, :document, :passport, :value, :registration)\n end",
"def update\n @strategy_guide = StrategyGuide.find(params[:id])\n @strategy_guide.user = current_user\n \n if @strategy_guide.update_attributes(params[:strategy_guide])\n if @strategy_guide.skill_build.nil?\n redirect_to(new_strategy_guide_skill_build_path(@strategy_guide.id))\n else\n redirect_to(edit_strategy_guide_skill_build_path(@strategy_guide.id, @strategy_guide.skill_build.id))\n end\n else\n @heroes = Hero.ordered.map { |hero| [hero.name, hero.id] }\n @hero_pros = @strategy_guide.hero_pros\n @hero_cons = @strategy_guide.hero_cons\n render :action => \"edit\"\n end\n \n end",
"def put(path, doc = nil, options = {})\n execute('PUT', path, options, doc)\n end",
"def update\n @exam = Exam.find(params[:id])\n\n respond_to do |format|\n if @exam.update_attributes(params[:exam])\n flash[:notice] = 'Exam was successfully updated.'\n format.html { redirect_to(@exam) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @exam.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n @guidelines = Guideline.all\n end",
"def index\n @guidelines = Guideline.all\n end",
"def guide_item_params\n params.require(:guide_item).permit(:section_id, :anchor, :label, :ordinal, :heading, :body, :public)\n end",
"def show\n @guide = Guide.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @guide.as_json(:root => true) }\n end\n end",
"def new\n @guide = Guide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guide.as_json(:root => true) }\n end\n end",
"def destroy\n @guide.destroy\n respond_to do |format|\n format.html { redirect_to guides_url, notice: 'Guide was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.json { render :json => 'Question updated OK' }\n format.xml { head :ok }\n else\n format.json { render :json => @question.errors }\n format.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to(@question) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @question.errors,\n :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @guide_trip.update(guide_trip_params)\n format.html { redirect_to @guide_trip, notice: 'Guía turístico fue modificado satisfactoriamente.' }\n format.json { render :show, status: :ok, location: @guide_trip }\n else\n format.html { render :edit }\n format.json { render json: @guide_trip.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @faq = Faq.find(params[:id])\n flash[:notice] = 'Faq was successfully updated.' if @faq.update_attributes(params[:faq])\n respond_with(@faq)\n end"
] | [
"0.6701984",
"0.6701984",
"0.6701984",
"0.65662766",
"0.65662766",
"0.6279573",
"0.6208056",
"0.616738",
"0.616738",
"0.616738",
"0.59983474",
"0.5938671",
"0.59382033",
"0.5931679",
"0.58618623",
"0.5858754",
"0.5856399",
"0.58433574",
"0.58433574",
"0.58200014",
"0.58076984",
"0.57506627",
"0.56986886",
"0.56908935",
"0.56786627",
"0.56786627",
"0.5671059",
"0.56691444",
"0.5665813",
"0.56621045",
"0.56566346",
"0.5640498",
"0.5625924",
"0.5624564",
"0.56124973",
"0.56124973",
"0.56085074",
"0.55871904",
"0.5580346",
"0.5566364",
"0.55201995",
"0.55166036",
"0.5505923",
"0.5504863",
"0.5492051",
"0.5490883",
"0.54833156",
"0.54833156",
"0.5482026",
"0.5468422",
"0.5461052",
"0.54608685",
"0.54439294",
"0.5442976",
"0.5442976",
"0.54363716",
"0.54360485",
"0.54188985",
"0.5403269",
"0.54001564",
"0.5399618",
"0.53878766",
"0.53792876",
"0.5354329",
"0.5344065",
"0.53424644",
"0.5323516",
"0.5308815",
"0.52926636",
"0.52723384",
"0.5272322",
"0.5268368",
"0.5266795",
"0.5266667",
"0.523846",
"0.5184695",
"0.51827216",
"0.51817036",
"0.51695603",
"0.51691204",
"0.5168243",
"0.5168243",
"0.5168243",
"0.5168243",
"0.51571184",
"0.5145856",
"0.51373875",
"0.5128475",
"0.5127878",
"0.5120988",
"0.5118389",
"0.5118389",
"0.5118291",
"0.5118108",
"0.5115597",
"0.51142144",
"0.51141053",
"0.5105094",
"0.5102036",
"0.50877976"
] | 0.6925337 | 0 |
DELETE /guides/1 DELETE /guides/1.xml | def destroy
@guide = Guide.find(params[:id])
@guide.destroy
respond_to do |format|
format.html { redirect_to(guides_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n @guide = Guide.find(params[:id])\n @guide.destroy\n respond_to do |format|\n format.html { redirect_to guides_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @guide = Guide.find(params[:id])\n @guide.destroy\n\n respond_to do |format|\n format.html { redirect_to guides_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @guide = Guide.find(params[:id])\n @guide.destroy\n\n respond_to do |format|\n format.html { redirect_to guides_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @guide.destroy\n respond_to do |format|\n format.html { redirect_to :delete, flash: { message: 'Guide was successfully deleted.' } }\n format.json { head :no_content }\n end\n end",
"def destroy\n @guide.destroy\n respond_to do |format|\n format.html { redirect_to guides_url, notice: 'Guide was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @guide.destroy\n respond_to do |format|\n format.html { redirect_to guides_url, notice: 'Guide was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @guide = Guide.find(params[:id])\n\n respond_to do |format|\n if @guide.destroy\n format.html { redirect_to guides_url,\n notice: (crud_notice('destroyed', @guide) + \"#{undo_link(@guide)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { redirect_to guides_url, alert: \"#{@guide.errors[:base].to_s}\".gsub('[\"', '').gsub('\"]', '') }\n format.json { render json: @guide.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @helocagree = Helocagree.find(params[:id])\n @helocagree.destroy\n\n respond_to do |format|\n format.html { redirect_to(helocagrees_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @assembly_guide = AssemblyGuide.find(params[:id])\n @assembly_guide.destroy\n\n respond_to do |format|\n format.html { redirect_to assembly_guides_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @guideline.destroy\n respond_to do |format|\n format.html { redirect_to guidelines_url, notice: 'Guideline was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @guideline.destroy\n respond_to do |format|\n format.html { redirect_to guidelines_url, notice: \"Guideline was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @remission_guide.destroy\n respond_to do |format|\n format.html { \n flash[:notice] = 'La Guía de Remisión se eliminó satisfactoriamente.'\n redirect_to remission_guides_path\n }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exam = Exam.find(params[:id])\n @exam.destroy\n\n respond_to do |format|\n format.html { redirect_to(exams_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"def destroy\n @guidebook.destroy\n respond_to do |format|\n format.html { redirect_to guidebooks_url, notice: 'Guidebook was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @guide_section.destroy\n respond_to do |format|\n format.html { redirect_to guide_sections_url, notice: 'Guide section was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @learn = Learn.find(params[:id])\n @learn.destroy\n\n respond_to do |format|\n format.html { redirect_to(learns_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @guide_taxon.destroy\n\n respond_to do |format|\n format.html { redirect_to edit_guide_url(@guide_taxon.guide_id), notice: \"Taxon removed\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @howto = Howto.find(params[:id])\n @howto.destroy\n\n respond_to do |format|\n format.html { redirect_to(howtos_url) }\n format.xml { head :ok }\n end\n end",
"def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"def destroy\n @guides_text.destroy\n respond_to do |format|\n format.html { redirect_to guides_texts_url, notice: 'Text was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @scholarship_guide.destroy\n respond_to do |format|\n format.html { redirect_to scholarship_guides_url, notice: 'Scholarship guide was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @manual = Manual.find(params[:id])\n @manual.destroy\n\n respond_to do |format|\n format.html { redirect_to(manuals_url) }\n format.xml { head :ok }\n end\n end",
"def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"def destroy\n @survival_guide.destroy\n respond_to do |format|\n format.html { redirect_to survival_guides_url, notice: 'Survival guide was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tutorials = Tutorials.find(params[:id])\n @tutorials.destroy\n\n respond_to do |format|\n format.html { redirect_to(tutorials_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @helibasis = Helibase.find(params[:id])\n @helibasis.destroy\n\n respond_to do |format|\n format.html { redirect_to(helibases_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @idea = Idea.find(params[:id])\n @idea.destroy\n\n respond_to do |format|\n format.html { redirect_to(ideas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @idea = Idea.find(params[:id])\n @idea.destroy\n\n respond_to do |format|\n format.html { redirect_to(ideas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @idea = Idea.find(params[:id])\n @idea.destroy\n\n respond_to do |format|\n format.html { redirect_to(ideas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @how_to = HowTo.find(params[:id])\n @how_to.destroy\n\n respond_to do |format|\n @status = admin_course_tutorials_url(@course)\n format.html { redirect_to(admin_course_tutorials_url(@course)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @strategy_guide = StrategyGuide.find(params[:id])\n @strategy_guide.destroy\n\n redirect_to(strategy_guides_url)\n end",
"def destroy\n @normal_example = NormalExample.find(params[:id])\n @normal_example.destroy\n\n respond_to do |format|\n format.html { redirect_to(normal_examples_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @faq = Faq.find(params[:id])\n @faq.destroy\n\n respond_to do |format|\n format.html { redirect_to(faqs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @faq = Faq.find(params[:id])\n @faq.destroy\n\n respond_to do |format|\n format.html { redirect_to(faqs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @ref = Ref.find(params[:id])\n @ref.destroy\n\n respond_to do |format|\n format.html { redirect_to(refs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tourguide.destroy\n respond_to do |format|\n format.html { redirect_to tourguides_url, notice: 'Tourguide was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @guide.destroy\n\n respond_to do |format|\n format.html { redirect_to @item, notice: \"Guide was successfully deleted.\" }\n format.mobile { redirect_to item_guides_path(@item), notice: \"Guide was successfully deleted.\" }\n format.json { head :no_content }\n format.js\n end\n end",
"def destroy\n @example_section = ExampleSection.find(params[:id])\n @example_section.destroy\n\n respond_to do |format|\n format.html { redirect_to(example_sections_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @correspondence = Correspondence.find(params[:id])\n @correspondence.destroy\n\n respond_to do |format|\n format.html { redirect_to(correspondences_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @doc = Doc.find(params[:id])\n @doc.destroy\n\n respond_to do |format|\n format.html { redirect_to(docs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @doc = Doc.find(params[:id])\n @doc.destroy\n\n respond_to do |format|\n format.html { redirect_to(docs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @offlearn = Offlearn.find(params[:id])\n @offlearn.destroy\n\n respond_to do |format|\n format.html { redirect_to(offlearns_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @auto1h_fold_change = Auto1hFoldChange.find(params[:id])\n @auto1h_fold_change.destroy\n\n respond_to do |format|\n format.html { redirect_to(auto1h_fold_changes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @idea = Idea.find(params[:id])\n @idea.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_ideas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @guide_post = GuidePost.find(params[:id])\n @guide_post.destroy\n\n respond_to do |format|\n format.html { redirect_to current_user, notice: 'Your post has been deleted.' }\n format.json { head :ok }\n end\n end",
"def destroy\n @servingguide.destroy\n respond_to do |format|\n format.html { redirect_to servingguides_url, notice: 'Servingguide was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @diaque = Diaque.find(params[:id])\n @diaque.destroy\n\n respond_to do |format|\n format.html { redirect_to(diaquen_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @adqui = Adqui.find(params[:id])\n @adqui.destroy\n\n respond_to do |format|\n format.html { redirect_to(adquis_url) }\n format.xml { head :ok }\n end\n end",
"def delete_demo(id)\n delete_record \"/demos/#{id}\"\n end",
"def destroy\n @idea = Idea.find(params[:id])\n \[email protected]\n \trespond_to do |format|\n \tformat.html { redirect_to(ideas_url) }\n \tformat.xml { head :ok }\n\t\t\tend\n end",
"def destroy\n @guide_item.destroy\n respond_to do |format|\n format.html { redirect_to guide_items_url, notice: \"Item was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tour_guide = TourGuide.find_by_id(params[:id])\n if @tour_guide.present?\n @tour_guide.destroy\n render :json=>{:response=>\"success\"}\n\t\tend\n end",
"def destroy\n @faq.destroy\n head :no_content\n end",
"def destroy\n @aisle = Aisle.find(params[:id])\n @aisle.destroy\n\n respond_to do |format|\n format.html { redirect_to(aisles_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @exam_candidate.destroy\n\n respond_to do |format|\n format.html { redirect_to(candidates_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @config_xml = ConfigXml.find(params[:id])\n @config_xml.destroy\n\n respond_to do |format|\n format.html { redirect_to(config_xmls_url) }\n format.xml { head :ok }\n end\n rescue ActiveRecord::RecordNotFound => e\n prevent_access(e)\n end",
"def destroy\n @recommended_link.destroy\n\n head :no_content\n end",
"def deletepublish\n @question = Publishquiz.find(:all, :conditions=>\"question_id=\"+params[:question]+\" and quiz_id=\"+session[:quizid])\n @question[0].destroy\n\n respond_to do |format|\n format.html { redirect_to(questions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @beat = Beat.find(params [:id])\n @beat.destroy\n\n respond_to do |format|\n format.html { redirect_to post_comment_url(@lesson) }\n format.xml { head :ok }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @advertise = Advertise.find(params[:id])\n @advertise.destroy\n\n respond_to do |format|\n format.html { redirect_to(advertises_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @absence_request = AbsenceRequest.find(params[:id])\n @absence_request.destroy\n\n respond_to do |format|\n format.html { redirect_to(absence_requests_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @documentation = Documentation.find(params[:id])\n @documentation.destroy\n\n respond_to do |format|\n format.html { redirect_to(documentations_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n Iterable.request(conf, base_path).delete\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def destroy\n @attend = Attend.find(params[:id])\n @attend.destroy\n\n respond_to do |format|\n format.html { redirect_to(attends_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @associate = Associate.find(params[:id])\n @associate.destroy\n\n respond_to do |format|\n format.html { redirect_to(associates_url) }\n format.xml { head :ok }\n end\n end",
"def delete(id)\r\n connection.delete(\"/#{@doctype}[@ino:id=#{id}]\")\r\n end",
"def destroy\n @student_correspondence = StudentCorrespondence.find(params[:id])\n @student_correspondence.destroy\n\n respond_to do |format|\n format.html { redirect_to(student_correspondences_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @diagram = Diagram.find(params[:id])\n @diagram.destroy\n\n respond_to do |format|\n format.html { redirect_to(diagrams_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @adjunto = Adjunto.find(params[:id])\n @adjunto.destroy\n\n respond_to do |format|\n format.html { redirect_to(adjuntos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @checklist = Checklist.find(params[:id])\n @checklist.destroy\n\n respond_to do |format|\n format.html { redirect_to(checklists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @certificado = Certificado.find(params[:id])\n @certificado.destroy\n\n respond_to do |format|\n format.html { redirect_to(certificados_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @genome_reference = GenomeReference.find(params[:id])\n @genome_reference.destroy\n\n respond_to do |format|\n format.html { redirect_to(genome_references_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @dataset.destroy\n\n respond_to do |wants|\n wants.html { redirect_to(datasets_url) }\n wants.xml { head :ok }\n end\n end",
"def destroy\n @test_guide_scenario_sa.destroy\n head :no_content\n end",
"def destroy\n @recommand = Recommand.find(params[:id])\n @recommand.destroy\n\n respond_to do |format|\n format.html { redirect_to(recommands_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @docent = Docent.find(params[:id])\n @docent.destroy\n\n respond_to do |format|\n format.html { redirect_to(docents_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @thesis_proposal = ThesisProposal.find(params[:id])\n @thesis_proposal.destroy\n\n respond_to do |format|\n format.html { redirect_to(thesis_proposals_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @questionnaire = Questionnaire.find(params[:id])\n @questionnaire.destroy\n\n respond_to do |format|\n format.html { redirect_to questionnaires_url }\n format.xml { head :ok }\n end\n end",
"def delete\n @client.delete_document(@path)\n end",
"def delete\n end",
"def destroy\n @clique = Clique.find(params[:id])\n @clique.destroy\n\n respond_to do |format|\n format.html { redirect_to(cliques_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @qa = Qa.find(params[:id])\n @qa.destroy\n\n respond_to do |format|\n format.html { redirect_to(qas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @qa = Qa.find(params[:id])\n @qa.destroy\n\n respond_to do |format|\n format.html { redirect_to(qas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @learn = Learn.find(params[:id])\n @learn.destroy\n\n respond_to do |format|\n format.html { redirect_to learns_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cheque = Cheque.find(params[:id])\n @cheque.destroy\n\n respond_to do |format|\n format.html { redirect_to(cheques_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @seta = Seta.find(params[:id])\n @seta.destroy\n\n respond_to do |format|\n format.html { redirect_to(setas_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n request(:delete)\n end",
"def destroy\n @descriptor_especifico = DescriptorEspecifico.find(params[:id])\n @descriptor_especifico.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_descriptor_especificos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @doc_type_am_configuration = DocTypeAmConfiguration.find(params[:id])\n @doc_type_am_configuration.destroy\n\n respond_to do |format|\n format.html { redirect_to doc_type_am_configurations_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @documento = @externo.documentos.find(params[:id])\n @documento.destroy\n\n respond_to do |format|\n format.html { redirect_to(documentos_url(@externo)) }\n format.xml { head :ok }\n end\n end",
"def delete_analysis(analysis_id); rest_delete(\"#{link('analyses')}/#{analysis_id}\"); nil; end",
"def destroy\n @alfresco = Alfresco.find(params[:id])\n @alfresco.destroy\n\n respond_to do |format|\n format.html { redirect_to(alfrescos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @dossier = Dossier.find(params[:id])\n @dossier.destroy\n\n respond_to do |format|\n format.html { redirect_to(\"/\") }\n format.xml { head :ok }\n end\n end",
"def destroy\n @test_guide_scenario.destroy\n head :no_content\n end"
] | [
"0.732782",
"0.7136434",
"0.7136434",
"0.6936058",
"0.68661547",
"0.6835519",
"0.6800889",
"0.66710484",
"0.6670409",
"0.66461945",
"0.66392195",
"0.6592145",
"0.6491167",
"0.64827716",
"0.64777905",
"0.64656806",
"0.646292",
"0.64600325",
"0.6432149",
"0.6429656",
"0.63726443",
"0.63581043",
"0.63572097",
"0.6341082",
"0.6333024",
"0.6298666",
"0.6287146",
"0.6287006",
"0.6287006",
"0.6287006",
"0.6278031",
"0.62747836",
"0.6269482",
"0.62667954",
"0.62666285",
"0.62580985",
"0.6250579",
"0.6249592",
"0.6249373",
"0.6246654",
"0.6224782",
"0.6224782",
"0.6209456",
"0.6208024",
"0.61998826",
"0.61915535",
"0.61801",
"0.6178945",
"0.6177609",
"0.6160803",
"0.6156762",
"0.6145419",
"0.61409926",
"0.61405605",
"0.613979",
"0.61327493",
"0.612513",
"0.61200666",
"0.61093515",
"0.6106564",
"0.6099913",
"0.60974264",
"0.609729",
"0.6096193",
"0.60897917",
"0.6087246",
"0.6087246",
"0.6087246",
"0.6087246",
"0.6076112",
"0.6074665",
"0.6073191",
"0.6071738",
"0.6068152",
"0.6063803",
"0.6061216",
"0.60586673",
"0.6055078",
"0.60538876",
"0.6049699",
"0.604521",
"0.6043365",
"0.60392386",
"0.6036006",
"0.60343945",
"0.6033678",
"0.60301244",
"0.60298496",
"0.60298496",
"0.602782",
"0.6025891",
"0.60250646",
"0.6022178",
"0.6021533",
"0.60179746",
"0.60149705",
"0.6013726",
"0.60037607",
"0.59993786",
"0.5998979"
] | 0.7685157 | 0 |
validates :description_category, :image, :service_fee, presence:true | def name
description_category
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate\n super\n errors.add(:name, \"can't be empty\") if name.blank?\n errors.add(:category_id, \"can't be empty\") if category_id.blank?\n errors.add(:price, \"can't be empty\") if price.blank?\n end",
"def validate!\n if identifier.to_s.empty?\n raise ValidationError.new(\"identifier is required\")\n elsif caption.to_s.empty?\n raise ValidationError.new(\"a change in the image caption is required\")\n else\n true\n end\n end",
"def validate\n\tvalidate_unexpected_assets_not_present && validate_expected_asset_present && validate_snippet_and_description\nend",
"def validate\n !discount_code.nil? && discount.nil? ? raise(InvalidDiscountCode, \"There is no discount with that code\") : true\n end",
"def valid?\n return false if @summary.nil?\n return false if @summary.to_s.length > 100\n record_type_validator = EnumAttributeValidator.new('String', [\"ServiceTicket\", \"ProjectTicket\", \"ProjectIssue\"])\n return false unless record_type_validator.valid?(@record_type)\n return false if !@wbs_code.nil? && @wbs_code.to_s.length > 50\n return false if @company.nil?\n return false if !@site_name.nil? && @site_name.to_s.length > 50\n return false if !@address_line1.nil? && @address_line1.to_s.length > 50\n return false if !@address_line2.nil? && @address_line2.to_s.length > 50\n return false if [email protected]? && @city.to_s.length > 50\n return false if !@state_identifier.nil? && @state_identifier.to_s.length > 50\n return false if [email protected]? && @zip.to_s.length > 12\n return false if !@contact_phone_number.nil? && @contact_phone_number.to_s.length > 20\n return false if !@contact_phone_extension.nil? && @contact_phone_extension.to_s.length > 15\n return false if !@contact_email_address.nil? && @contact_email_address.to_s.length > 250\n severity_validator = EnumAttributeValidator.new('String', [\"Low\", \"Medium\", \"High\"])\n return false unless severity_validator.valid?(@severity)\n impact_validator = EnumAttributeValidator.new('String', [\"Low\", \"Medium\", \"High\"])\n return false unless impact_validator.valid?(@impact)\n return false if !@external_x_ref.nil? && @external_x_ref.to_s.length > 100\n return false if !@po_number.nil? && @po_number.to_s.length > 50\n return false if !@automatic_email_cc.nil? && @automatic_email_cc.to_s.length > 1000\n sub_billing_method_validator = EnumAttributeValidator.new('String', [\"ActualRates\", \"FixedFee\", \"NotToExceed\", \"OverrideRate\"])\n return false unless sub_billing_method_validator.valid?(@sub_billing_method)\n knowledge_base_link_type_validator = EnumAttributeValidator.new('String', [\"ServiceTicket\", \"ProjectTicket\", \"ProjectIssue\", \"KnowledgeBaseArticle\", \"Time\", \"Activity\"])\n return false unless knowledge_base_link_type_validator.valid?(@knowledge_base_link_type)\n bill_time_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_time_validator.valid?(@bill_time)\n bill_expenses_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_expenses_validator.valid?(@bill_expenses)\n bill_products_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_products_validator.valid?(@bill_products)\n predecessor_type_validator = EnumAttributeValidator.new('String', [\"Ticket\", \"Phase\"])\n return false unless predecessor_type_validator.valid?(@predecessor_type)\n return true\n end",
"def valid?\n return false if @id.nil?\n return false if @title.nil?\n return false if @title.to_s.length < 1\n return false if @image.nil?\n return false if @image.to_s.length < 1\n return false if @image_type.nil?\n return false if @image_type.to_s.length < 1\n return false if @servings.nil?\n return false if @ready_in_minutes.nil?\n return false if @license.nil?\n return false if @license.to_s.length < 1\n return false if @source_name.nil?\n return false if @source_name.to_s.length < 1\n return false if @source_url.nil?\n return false if @source_url.to_s.length < 1\n return false if @spoonacular_source_url.nil?\n return false if @spoonacular_source_url.to_s.length < 1\n return false if @aggregate_likes.nil?\n return false if @health_score.nil?\n return false if @spoonacular_score.nil?\n return false if @price_per_serving.nil?\n return false if @cheap.nil?\n return false if @credits_text.nil?\n return false if @credits_text.to_s.length < 1\n return false if @dairy_free.nil?\n return false if @gaps.nil?\n return false if @gaps.to_s.length < 1\n return false if @gluten_free.nil?\n return false if @instructions.nil?\n return false if @ketogenic.nil?\n return false if @low_fodmap.nil?\n return false if @sustainable.nil?\n return false if @vegan.nil?\n return false if @vegetarian.nil?\n return false if @very_healthy.nil?\n return false if @very_popular.nil?\n return false if @whole30.nil?\n return false if @weight_watcher_smart_points.nil?\n return false if !@extended_ingredients.nil? && @extended_ingredients.length < 0\n return false if @summary.nil?\n return false if @summary.to_s.length < 1\n true\n end",
"def validate\n if( title =~ /^hc12/ || title =~ /^bthfck2/ )\n errors.add_to_base(\"Titles which begin with 'hc12' or 'bthfck2' are reserved!\" )\n end\n \n if( title =~ /[^\\s^_A-Z^a-z^0-9^-]/ )\n errors.add_to_base(\"Only digits, characters, '-' and blanks are allowed for the title!\")\n end\n\n if( ( bundle = Bundle.find_by_title(title) ) != nil )\n if( bundle.created_by_user_id != user_id )\n errors.add_to_base(\"This title is already used! Choose another one.\")\n end\n end\n \n if content_type\n unless( content_type =~ /^image\\/(png)|(jpeg)|(gif)/i )\n errors.add_to_base(\"Images must have the format jpg, png or gif\")\n end\n \n unless was_upload_successful\n errors.add_to_base(\"Image file is too big. It must be smaller then 300K\")\n end\n \n end\n \n end",
"def validate\n if self.filename.nil?\n errors.add_to_base(\"You must choose an image to upload\")\n else\n [:size, :content_type].each do |attr_name|\n enum = attachment_options[attr_name]\n\n unless enum.nil? || enum.include?(send(attr_name))\n errors.add_to_base(\"Images should be smaller than #{MAX_SIZE_IN_MB} MB in size\") if attr_name == :size\n errors.add_to_base(\"Your image must be either a JPG, PNG or GIF\") if attr_name == :content_type\n end\n end\n end\n end",
"def validate_upload\n validate_image_length\n validate_image_type\n validate_image_md5sum\n validate_image_name\n end",
"def validate\n validates_presence([:title, :body])\n end",
"def validate #:doc:\n errors.add(:price, \"should be positive\") unless price.nil? || price >= 0.01\n end",
"def valid_attributes\n #params.require(:cocktail).permit( :name, :address, :phone_number, :category)\n end",
"def valid?\n return false if !@adwords_grouping.nil? && @adwords_grouping.to_s.length > 50\n return false if !@adwords_label1.nil? && @adwords_label1.to_s.length > 50\n return false if !@adwords_label2.nil? && @adwords_label2.to_s.length > 50\n return false if !@adwords_label3.nil? && @adwords_label3.to_s.length > 50\n return false if !@adwords_label4.nil? && @adwords_label4.to_s.length > 50\n return false if !@adwords_label5.nil? && @adwords_label5.to_s.length > 50\n return false if !@age_group.nil? && @age_group.to_s.length > 5\n return false if !@book_author.nil? && @book_author.to_s.length > 50\n return false if !@book_format.nil? && @book_format.to_s.length > 50\n return false if !@book_isbn.nil? && @book_isbn.to_s.length > 20\n return false if !@book_publisher.nil? && @book_publisher.to_s.length > 50\n return false if !@category_description.nil? && @category_description.to_s.length > 1000\n return false if [email protected]? && @color.to_s.length > 20\n return false if [email protected]? && @condition.to_s.length > 15\n return false if !@custom_label0.nil? && @custom_label0.to_s.length > 50\n return false if !@custom_label1.nil? && @custom_label1.to_s.length > 50\n return false if !@custom_label2.nil? && @custom_label2.to_s.length > 50\n return false if !@custom_label3.nil? && @custom_label3.to_s.length > 50\n return false if !@custom_label4.nil? && @custom_label4.to_s.length > 50\n return false if [email protected]? && @gender.to_s.length > 6\n return false if !@google_product_category.nil? && @google_product_category.to_s.length > 250\n return false if !@music_artist.nil? && @music_artist.to_s.length > 50\n return false if !@music_format.nil? && @music_format.to_s.length > 5\n return false if !@product_type.nil? && @product_type.to_s.length > 10\n return false if !@promotion_id1.nil? && @promotion_id1.to_s.length > 30\n return false if !@promotion_id10.nil? && @promotion_id10.to_s.length > 30\n return false if !@promotion_id2.nil? && @promotion_id2.to_s.length > 30\n return false if !@promotion_id3.nil? && @promotion_id3.to_s.length > 30\n return false if !@promotion_id4.nil? && @promotion_id4.to_s.length > 30\n return false if !@promotion_id5.nil? && @promotion_id5.to_s.length > 30\n return false if !@promotion_id6.nil? && @promotion_id6.to_s.length > 30\n return false if !@promotion_id7.nil? && @promotion_id7.to_s.length > 30\n return false if !@promotion_id8.nil? && @promotion_id8.to_s.length > 30\n return false if !@promotion_id9.nil? && @promotion_id9.to_s.length > 30\n return false if !@search_lowest_url.nil? && @search_lowest_url.to_s.length > 250\n return false if [email protected]? && @size.to_s.length > 20\n return false if !@video_director.nil? && @video_director.to_s.length > 50\n return false if !@video_format.nil? && @video_format.to_s.length > 5\n return false if !@video_rating.nil? && @video_rating.to_s.length > 5\n return false if !@video_starring.nil? && @video_starring.to_s.length > 150\n true\n end",
"def validate_images_alt_present\n errors.add('body', I18n.t('drgcms.img_alt_not_present')) unless DcPage.images_alt_present?(self.body)\nend",
"def validate_not_all_mandatory\n errors.add(:service_codes, :invalid_cafm_helpdesk_billable) if (service_codes - self.class::MANDATORY_SERVICES).empty?\n end",
"def valid?\n return false if @name.nil?\n return false if @name.to_s.length > 50\n header_logo_position_validator = EnumAttributeValidator.new('String', [\"LeftSide\", \"RightSide\", \"Center\"])\n return false unless header_logo_position_validator.valid?(@header_logo_position)\n header_address_position_validator = EnumAttributeValidator.new('String', [\"LeftSide\", \"RightSide\", \"Center\"])\n return false unless header_address_position_validator.valid?(@header_address_position)\n return false if !@header_title_caption.nil? && @header_title_caption.to_s.length > 50\n header_title_position_validator = EnumAttributeValidator.new('String', [\"LeftSide\", \"RightSide\", \"Center\"])\n return false unless header_title_position_validator.valid?(@header_title_position)\n header_title_font_validator = EnumAttributeValidator.new('String', [\"Regular\", \"RegularBold\", \"Large\", \"LargeBold\", \"ExtraLarge\", \"ExtraLargeBold\"])\n return false unless header_title_font_validator.valid?(@header_title_font)\n return false if !@header_terms_caption.nil? && @header_terms_caption.to_s.length > 50\n return false if !@header_due_date_caption.nil? && @header_due_date_caption.to_s.length > 50\n return false if !@header_po_number_caption.nil? && @header_po_number_caption.to_s.length > 50\n return false if !@header_reference_caption.nil? && @header_reference_caption.to_s.length > 50\n return false if !@header_account_caption.nil? && @header_account_caption.to_s.length > 50\n return false if !@header_tax_id_caption.nil? && @header_tax_id_caption.to_s.length > 50\n return false if !@header_ship_to_caption.nil? && @header_ship_to_caption.to_s.length > 50\n return false if !@serivce_header_ticket_number_caption.nil? && @serivce_header_ticket_number_caption.to_s.length > 50\n return false if !@service_header_company_name_caption.nil? && @service_header_company_name_caption.to_s.length > 50\n return false if !@service_header_summary_caption.nil? && @service_header_summary_caption.to_s.length > 50\n return false if !@service_header_contact_name_caption.nil? && @service_header_contact_name_caption.to_s.length > 50\n return false if !@service_header_detail_description_caption.nil? && @service_header_detail_description_caption.to_s.length > 50\n return false if !@service_header_resolution_caption.nil? && @service_header_resolution_caption.to_s.length > 50\n return false if !@service_header_amount_caption.nil? && @service_header_amount_caption.to_s.length > 50\n return false if !@service_header_billing_method_caption.nil? && @service_header_billing_method_caption.to_s.length > 50\n return false if !@project_header_project_name_caption.nil? && @project_header_project_name_caption.to_s.length > 50\n return false if !@project_header_company_name_caption.nil? && @project_header_company_name_caption.to_s.length > 50\n return false if !@project_header_original_downpayment_caption.nil? && @project_header_original_downpayment_caption.to_s.length > 50\n return false if !@project_header_contact_name_caption.nil? && @project_header_contact_name_caption.to_s.length > 50\n return false if !@project_header_amount_caption.nil? && @project_header_amount_caption.to_s.length > 50\n return false if !@project_header_billing_method_caption.nil? && @project_header_billing_method_caption.to_s.length > 50\n return false if !@project_header_billing_type_caption.nil? && @project_header_billing_type_caption.to_s.length > 50\n return true\n end",
"def validate_create_post(params)\n params[\"content\"].length < 500 and params[\"tags\"] and params[\"image\"]\n end",
"def valid?\n return false if @name.nil?\n return false if @name.to_s.length > 50\n return false if @prefix_suffix_option.nil?\n prefix_suffix_option_validator = EnumAttributeValidator.new('String', [\"Prefix\", \"Suffix\"])\n return false unless prefix_suffix_option_validator.valid?(@prefix_suffix_option)\n return false if !@invoice_pre_suffix.nil? && @invoice_pre_suffix.to_s.length > 5\n application_units_validator = EnumAttributeValidator.new('String', [\"Amount\", \"Hours\", \"Incidents\"])\n return false unless application_units_validator.valid?(@application_units)\n application_cycle_validator = EnumAttributeValidator.new('String', [\"Contract2Weeks\", \"Contract4Weeks\", \"ContractYear\", \"CalendarMonth\", \"CalendarQuarter\", \"CalendarWeek\", \"ContractQuarter\", \"CalendarYear\"])\n return false unless application_cycle_validator.valid?(@application_cycle)\n return false if @employee_comp_rate.nil?\n employee_comp_rate_validator = EnumAttributeValidator.new('String', [\"Actual\", \"Hourly\"])\n return false unless employee_comp_rate_validator.valid?(@employee_comp_rate)\n return false if @employee_comp_not_exceed.nil?\n employee_comp_not_exceed_validator = EnumAttributeValidator.new('String', [\"Billing\", \"Percent\", \"Amount\"])\n return false unless employee_comp_not_exceed_validator.valid?(@employee_comp_not_exceed)\n return false if @invoicing_cycle.nil?\n invoicing_cycle_validator = EnumAttributeValidator.new('String', [\"CalendarYear\", \"ContractYear\"])\n return false unless invoicing_cycle_validator.valid?(@invoicing_cycle)\n return false if !@invoice_description.nil? && @invoice_description.to_s.length > 4000\n return false if @bill_time.nil?\n bill_time_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_time_validator.valid?(@bill_time)\n return false if @bill_expenses.nil?\n bill_expenses_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_expenses_validator.valid?(@bill_expenses)\n return false if @bill_products.nil?\n bill_products_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_products_validator.valid?(@bill_products)\n return true\n end",
"def description_presence\n return if self[:description].present?\n\n self.flag_type = self[:flag_type].try(:to_i)\n\n case self.flag_type\n when FLAG_TYPE['terms_of_use_violation']\n errors.add(:description, I18n.t(\"image_flag.missing_description_terms_of_use_violation\"))\n when FLAG_TYPE['copyright']\n errors.add(:description, I18n.t(\"image_flag.missing_description_copyright\"))\n else\n errors.add(:description, \"Unknown violation type!\")\n end\n end",
"def validates_as_attachment\n validates_presence_of :size, :content_type, :filename\n validate :attachment_attributes_valid?\n end",
"def validation; end",
"def validation; end",
"def validates_price\n if price.zero?\n errors.add(:display_price, \"cannot be zero\")\n end\n\n nil\n end",
"def total_fee_is_valid\n errors.add(:total_fee,'The total fee is invalid.') unless total_fee_is_valid?\n end",
"def valid_non_transportation_line_item\n lb_return = true\n if non_ts_service == \"Y\"\n if service_date.blank?\n errors.add(:service_date, \"is required.\")\n lb_return = false\n end\n\n if actual_cost.blank?\n errors.add(:actual_cost, \"is required.\")\n lb_return = false\n end\n end\n return lb_return\n end",
"def valid?\n return false if @id.nil?\n return false if @id !~ Regexp.new(/^bck_[a-zA-Z0-9]+$/)\n return false if @auto_reorder.nil?\n return false if @threshold_amount.nil?\n return false if @url.nil?\n return false if @url.to_s.length > 2083\n return false if @url.to_s.length < 1\n return false if @raw_url.nil?\n return false if @raw_url.to_s.length > 2083\n return false if @raw_url.to_s.length < 1\n return false if @front_original_url.nil?\n return false if @front_original_url.to_s.length > 2083\n return false if @front_original_url.to_s.length < 1\n return false if @back_original_url.nil?\n return false if @back_original_url.to_s.length > 2083\n return false if @back_original_url.to_s.length < 1\n return false if @thumbnails.nil?\n return false if @available_quantity.nil?\n return false if @allocated_quantity.nil?\n return false if @onhand_quantity.nil?\n return false if @pending_quantity.nil?\n return false if @projected_quantity.nil?\n return false if @buckslip_orders.nil?\n return false if @buckslip_orders.length < 0\n return false if @stock.nil?\n stock_validator = EnumAttributeValidator.new('String', [\"text\", \"cover\"])\n return false unless stock_validator.valid?(@stock)\n return false if @weight.nil?\n weight_validator = EnumAttributeValidator.new('String', [\"80#\"])\n return false unless weight_validator.valid?(@weight)\n return false if @finish.nil?\n finish_validator = EnumAttributeValidator.new('String', [\"gloss\", \"matte\"])\n return false unless finish_validator.valid?(@finish)\n return false if @status.nil?\n status_validator = EnumAttributeValidator.new('String', [\"processed\", \"rendered\"])\n return false unless status_validator.valid?(@status)\n return false if @object.nil?\n object_validator = EnumAttributeValidator.new('String', [\"buckslip\"])\n return false unless object_validator.valid?(@object)\n return false if @description.to_s.length > 255\n size_validator = EnumAttributeValidator.new('String', [\"8.75x3.75\"])\n return false unless size_validator.valid?(@size)\n true\n end",
"def the_event_must_have_at_least_one_description\n if des_es.empty? && des_eu.empty? && des_en.empty? && des_fr.empty?\n errors.add(:des_es, \"Please fill in the desciption at least in one language\")\n end\n if title_es.empty? && title_eu.empty? && title_en.empty? && title_fr.empty?\n errors.add(:des_es, \"Please fill in the desciption at least in one language\")\n end\n end",
"def check_title_and_description(params)\n if params[:title] == nil\n @errors << \"Title can't be empty\"\n end\n if params[:description] == nil\n @errors << \"You need to add description\"\n elsif params[:description].length < 20\n @errors << \"description can't be less than 20 characters\"\n end\nend",
"def valid?\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n if @total_servicos.nil?\n return false\n end\n\n \n \n \n \n \n if @total_parcelado_nacionais.nil?\n return false\n end\n\n \n \n \n \n \n if @total_parcelado_internacionais.nil?\n return false\n end\n\n \n \n \n \n end",
"def image_presence\n errors.add(:image, \"Image must be attached.\") unless image.attached?\n end",
"def description_present\n if description.blank?\n errors.add(:description, \"Can't be empty\")\n end\n end",
"def valid?\n return false if @id.nil?\n return false if @id !~ Regexp.new(/^chk_[a-zA-Z0-9]+$/)\n return false if @to.nil?\n return false if [email protected]? && @description.to_s.length > 255\n mail_type_validator = EnumAttributeValidator.new('String', [\"usps_first_class\"])\n return false unless mail_type_validator.valid?(@mail_type)\n return false if [email protected]? && @memo.to_s.length > 40\n return false if !@check_number.nil? && @check_number > 500000000\n return false if !@check_number.nil? && @check_number < 1\n return false if [email protected]? && @message.to_s.length > 400\n return false if @amount.nil?\n return false if @amount > 999999.99\n return false if @bank_account.nil?\n return false if !@check_bottom_template_id.nil? && @check_bottom_template_id !~ Regexp.new(/^tmpl_[a-zA-Z0-9]+$/)\n return false if !@attachment_template_id.nil? && @attachment_template_id !~ Regexp.new(/^tmpl_[a-zA-Z0-9]+$/)\n return false if !@check_bottom_template_version_id.nil? && @check_bottom_template_version_id !~ Regexp.new(/^vrsn_[a-zA-Z0-9]+$/)\n return false if !@attachment_template_version_id.nil? && @attachment_template_version_id !~ Regexp.new(/^vrsn_[a-zA-Z0-9]+$/)\n return false if @url.nil?\n return false if @url !~ Regexp.new(/^https:\\/\\/(lob-assets|lob-assets-staging)\\.com\\/(letters|postcards|bank-accounts|checks|self-mailers|cards)\\/[a-z]{3,4}_[a-z0-9]{15,16}(\\.pdf|_thumb_[a-z]+_[0-9]+\\.png)\\?(version=[a-z0-9-]*&)?expires=[0-9]{10}&signature=[a-zA-Z0-9_-]+$/)\n return false if @carrier.nil?\n carrier_validator = EnumAttributeValidator.new('String', [\"USPS\"])\n return false unless carrier_validator.valid?(@carrier)\n return false if @object.nil?\n object_validator = EnumAttributeValidator.new('String', [\"check\"])\n return false unless object_validator.valid?(@object)\n return false if @date_created.nil?\n return false if @date_modified.nil?\n true\n end",
"def valid?\n type_validator = EnumAttributeValidator.new('String', ['string', 'number', 'boolean', 'date', 'address', 'country', 'email', 'url', 'image', 'signature', 'barcode', 'combined'])\n return false unless type_validator.valid?(@type)\n image_gravity_validator = EnumAttributeValidator.new('String', ['NorthWest', 'North', 'NorthEast', 'West', 'Center', 'East', 'SouthWest', 'South', 'SouthEast'])\n return false unless image_gravity_validator.valid?(@image_gravity)\n overflow_validator = EnumAttributeValidator.new('String', ['shrink_to_fit', 'truncate'])\n return false unless overflow_validator.valid?(@overflow)\n return false if [email protected]? && @id < 0\n image_scale_type_validator = EnumAttributeValidator.new('String', ['fit', 'fill', 'stretch'])\n return false unless image_scale_type_validator.valid?(@image_scale_type)\n return false if [email protected]? && @height < 0\n v_alignment_validator = EnumAttributeValidator.new('String', ['bottom', 'center', 'top'])\n return false unless v_alignment_validator.valid?(@v_alignment)\n return false if !@shape_border_width.nil? && @shape_border_width < 0\n return false if !@comb_number_of_cells.nil? && @comb_number_of_cells < 0\n shape_type_validator = EnumAttributeValidator.new('String', ['square', 'rectangle', 'circle', 'ellipse'])\n return false unless shape_type_validator.valid?(@shape_type)\n display_type_validator = EnumAttributeValidator.new('String', ['text', 'check', 'qrcode', 'barcode', 'image', 'shape'])\n return false unless display_type_validator.valid?(@display_type)\n return false if !@multiline_lines.nil? && @multiline_lines < 0\n return false if !@font_size.nil? && @font_size < 0\n return false if [email protected]? && @page < 1\n alignment_validator = EnumAttributeValidator.new('String', ['left', 'center', 'right'])\n return false unless alignment_validator.valid?(@alignment)\n check_character_validator = EnumAttributeValidator.new('String', ['✓', '✔', '✖', '✗', '✘'])\n return false unless check_character_validator.valid?(@check_character)\n return false if [email protected]? && @rotation > 3.6E+2\n return false if [email protected]? && @rotation < 0\n string_condition_type_validator = EnumAttributeValidator.new('String', ['equals', 'contains', 'starts_with', 'ends_with', 'regex'])\n return false unless string_condition_type_validator.valid?(@string_condition_type)\n return false if !@decimal_places.nil? && @decimal_places < 0\n return false if [email protected]? && @width < 0\n return false if [email protected]? && @x < 0\n return false if [email protected]? && @y < 0\n number_condition_type_validator = EnumAttributeValidator.new('String', ['equals', 'range', 'gte', 'gt', 'lte', 'lt'])\n return false unless number_condition_type_validator.valid?(@number_condition_type)\n return false if [email protected]? && @opacity > 1\n return false if [email protected]? && @opacity < 0\n true\n end",
"def design_data_filled_in?\n !self.description.blank? && \n !self.platform.blank? && \n !self.product_type.blank? && \n !self.project.blank? &&\n !self.design_directory.blank? &&\n !self.incoming_directory.blank?\n end",
"def validate_job_seeker_photo\r\n if not self.photo_file_name .blank?\r\n if not self.photo_content_type.match(/image|png|jpg|jpeg|gif/)\r\n errors.add(\"Photo\",\"Only image file allowed\")\r\n end\r\n end\r\n end",
"def valid?\n return false if @address1.nil?\n return false if @address1.to_s.length > 100\n return false if @address1.to_s.length < 1\n return false if [email protected]? && @address2.to_s.length > 100\n return false if @amount.nil?\n return false if @amount > 10000000\n return false if @amount < 1\n return false if !@business_description.nil? && @business_description.to_s.length > 500\n business_type_validator = EnumAttributeValidator.new('String', [\"corporate\", \"individual\"])\n return false unless business_type_validator.valid?(@business_type)\n return false if !@corporate_number.nil? && @corporate_number !~ Regexp.new(/^\\\\d{13}$/)\n return false if @email.nil?\n return false if @end_date.nil?\n return false if @prefecture.nil?\n prefecture_validator = EnumAttributeValidator.new('String', [\"北海道\", \"青森県\", \"岩手県\", \"宮城県\", \"秋田県\", \"山形県\", \"福島県\", \"茨城県\", \"栃木県\", \"群馬県\", \"埼玉県\", \"千葉県\", \"東京都\", \"神奈川県\", \"新潟県\", \"富山県\", \"石川県\", \"福井県\", \"山梨県\", \"長野県\", \"岐阜県\", \"静岡県\", \"愛知県\", \"三重県\", \"滋賀県\", \"京都府\", \"大阪府\", \"兵庫県\", \"奈良県\", \"和歌山県\", \"鳥取県\", \"島根県\", \"岡山県\", \"広島県\", \"山口県\", \"徳島県\", \"香川県\", \"愛媛県\", \"高知県\", \"福岡県\", \"佐賀県\", \"長崎県\", \"熊本県\", \"大分県\", \"宮崎県\", \"鹿児島県\", \"沖縄県\"])\n return false unless prefecture_validator.valid?(@prefecture)\n return false if [email protected]? && @remark.to_s.length > 500\n return false if !@representative_name.nil? && @representative_name.to_s.length > 30\n return false if @tel.nil?\n return false if @tel !~ Regexp.new(/^0((\\\\d{1,2}-?\\\\d{1,4}|\\\\d{3,4}-?\\\\d{1,2})-?\\\\d{4}|120-?\\\\d{3}-?\\\\d{3})$/)\n return false if [email protected]? && @url.to_s.length > 500\n return false if @zip_code.nil?\n return false if @zip_code !~ Regexp.new(/^\\\\d{3}-?\\\\d{4}$/)\n return true\n end",
"def valid_attributes\n { :free => false,\n :details => nil,\n :expense_item_id => @exp.id\n }\n end",
"def check_file_size\n valid?\n errors[:image_file_size].blank?\n end",
"def is_valid?(feature)\n !feature.description.blank?\n end",
"def fee_for_additional_materials_is_valid\n errors.add(:fee_for_additional_materials, 'The fee for additional materials is invalid.') unless fee_for_additional_materials_is_valid?\n end",
"def validate\r\n\r\n end",
"def valid?\n return false if @id.nil?\n return false if @id !~ Regexp.new(/^psc_[a-zA-Z0-9]+$/)\n carrier_validator = EnumAttributeValidator.new('String', [\"USPS\"])\n return false unless carrier_validator.valid?(@carrier)\n return false if !@front_template_id.nil? && @front_template_id !~ Regexp.new(/^tmpl_[a-zA-Z0-9]+$/)\n return false if !@back_template_id.nil? && @back_template_id !~ Regexp.new(/^tmpl_[a-zA-Z0-9]+$/)\n return false if !@front_template_version_id.nil? && @front_template_version_id !~ Regexp.new(/^vrsn_[a-zA-Z0-9]+$/)\n return false if !@back_template_version_id.nil? && @back_template_version_id !~ Regexp.new(/^vrsn_[a-zA-Z0-9]+$/)\n object_validator = EnumAttributeValidator.new('String', [\"postcard\"])\n return false unless object_validator.valid?(@object)\n return false if @url.nil?\n return false if @url !~ Regexp.new(/^https:\\/\\/(lob-assets|lob-assets-staging)\\.com\\/(letters|postcards|bank-accounts|checks|self-mailers|cards)\\/[a-z]{3,4}_[a-z0-9]{15,16}(\\.pdf|_thumb_[a-z]+_[0-9]+\\.png)\\?(version=[a-z0-9-]*&)?expires=[0-9]{10}&signature=[a-zA-Z0-9_-]+$/)\n return false if [email protected]? && @description.to_s.length > 255\n true\n end",
"def validate\n \n \n end",
"def picture_validation\n if picture.attached?\n if picture.blob.byte_size > 2000000\n picture.purge\n errors[:base] << 'Maksymalny rozmiar logo klanu to 2MB'\n elsif !picture.blob.content_type.starts_with?('image/')\n picture.purge\n errors[:base] << 'Zły format'\n end\n else\n errors[:base] << 'Logo klanu jest obowiązkowe.'\n end\n end",
"def validates_attachment_presence name, options = {}\n message = options[:message] || \"must be set.\"\n attachment_definitions[name][:validations] << [:presence, {:message => message,\n :if => options[:if],\n :unless => options[:unless]}]\n end",
"def valid_with_credit_card?\n self.valid?\n errors.add(:credit_card, \"can't be blank\") if self.credit_card == \"0\" || \n self.credit_card.blank?\n\n errors.add(:cvv, \"can't be blank\") if self.cvv == \"0\" || \n self.cvv.blank?\n\n self.expiration_date = DateTime.new(self.card_year.to_i, self.card_month.to_i).end_of_month\n\n errors.add(:expiration_date, \"can't be in past\") if self.expiration_date < Time.now\n\n end",
"def service_category_params\n params[:service_category].permit(:title, :permalink, :image)\n end",
"def valid?\n return false if !@external_id.nil? && @external_id.to_s.length > 64\n return false if !@first_name.nil? && @first_name.to_s.length > 128\n return false if @last_name.nil?\n return false if @last_name.to_s.length > 64\n return false if @last_name.to_s.length < 1\n return false if !@middle_name.nil? && @middle_name.to_s.length > 64\n gender_validator = EnumAttributeValidator.new('String', [\"M\", \"F\"])\n return false unless gender_validator.valid?(@gender)\n return false if [email protected]? && @language.to_s.length > 32\n return false if [email protected]? && @phone.to_s.length > 64\n return false if [email protected]? && @email.to_s.length > 128\n return false if !@doc_type.nil? && @doc_type.to_s.length > 32\n return false if !@doc_issuer_info.nil? && @doc_issuer_info.to_s.length > 256\n return false if !@doc_series.nil? && @doc_series.to_s.length > 64\n return false if !@doc_number.nil? && @doc_number.to_s.length > 64\n return false if !@department_code.nil? && @department_code.to_s.length > 64\n return false if !@department_name.nil? && @department_name.to_s.length > 256\n return false if !@building_no.nil? && @building_no.to_s.length > 8\n return false if [email protected]? && @city.to_s.length > 32\n return false if !@country_code.nil? && @country_code.to_s.length > 8\n return false if !@country_name.nil? && @country_name.to_s.length > 64\n return false if [email protected]? && @district.to_s.length > 64\n return false if !@flat_no.nil? && @flat_no.to_s.length > 8\n return false if !@house_no.nil? && @house_no.to_s.length > 16\n return false if [email protected]? && @region.to_s.length > 64\n return false if !@room_no.nil? && @room_no.to_s.length > 8\n return false if !@settlement_type.nil? && @settlement_type.to_s.length > 32\n return false if [email protected]? && @street.to_s.length > 64\n return false if !@raw_address.nil? && @raw_address.to_s.length > 512\n true\n end",
"def validate\n end",
"def validate\n end",
"def validate\n end",
"def valid?\n return false if @category.nil?\n return false if @institution_name.nil?\n return false if @name.nil?\n return false if @offer_link.nil?\n true\n end",
"def validate\n errors.add_to_base \"Enter atleast one product\" if items.empty?\n end",
"def validate\n assert_present :name\n assert_url :image\n end",
"def validate_image_values\n %w[l m s o].each do |size|\n field = \"size_#{size}\"\n value = send(field)\n next if value.blank?\n\n a = value.strip.split(/x|\\+/)\n a[0, 2].each { |e| errors.add(field, I18n.t('drgcms.not_valid')) unless e.to_i > 0 }\n end\nend",
"def valid_create?\n param! :sku_id, Integer, blank: false\n param! :price, Float, blank: false\n param! :discount, Float, blank: false\n end",
"def validations\n {}\n end",
"def validate\n\n end",
"def receipt_params\n params.require(:receipt).permit(:description, :image)\n end",
"def validate\n end",
"def validate\n end",
"def validate\n end",
"def valid_file\n\n filename = self.file.original_filename\n content_type = self.file.content_type\n\n #The upload should be nonempty.\n if filename == nil\n errors.add_to_base(\"Please enter an image filename\")\n return false\n end\n\n #The upload should have file suffix\n unless filename =~ /\\.(jpg)|(jpeg)|(png)|(gif)$/i\n errors.add_to_base(\"Please use image file with a filename suffix\")\n return false\n end\n\n #The file should be an image file.\n unless content_type =~ /^image/\n errors.add(:content_type, \"is not a recognized format\")\n return false\n end\n return true\n end",
"def publishing_requirements\n\t\tif is_published\n\t\t\terrors.add :first_name, I18n.t('models.profile.name_and_company.missing') if (first_name.blank? || last_name.blank?) && company_name.blank?\n\t\t\terrors.add :category, I18n.t('models.profile.category.missing') if categories.blank?\n\t\tend\n\tend",
"def validate_required\n [\n :project_name,\n :status,\n :requester_id,\n :subject_expert_id,\n :sponsor_id,\n :vision,\n :goal,\n :description,\n :scope,\n :advice_required,\n :program_id,\n :train_id,\n :funding_method,\n :cost_center,\n :funding_status,\n :budget_allocated,\n :priority,\n :start_date,\n :end_date,\n :risk_rating,\n :risks,\n :projected_revenue,\n ].each do |field|\n if self.attributes[field.to_s].nil? || self.attributes[field.to_s].blank?\n # intentionally vague!\n add_validation 'All fields are required to perform further validations'\n return false\n end\n end\n true\n end",
"def valid_file\n\n filename = self.file.original_filename\n content_type = self.file.content_type\n\n #The upload should be nonempty.\n if filename == nil\n errors.add(:base, \"Please enter an image filename\")\n return false\n end\n\n #The upload should have file suffix.\n unless filename =~ /\\.(jpg)|(jpeg)|(png)|(gif)$/i\n errors.add(:base, \"Please use image file with a filename suffix\")\n return false\n end\n\n #The file should be an image file.\n unless content_type =~ /^image/\n errors.add(:content_type, \"is not a recognized format\")\n return false\n end\n return true\n end",
"def valida_titulo\n errors.add_to_base 'avisotitulo' if tituloes.blank? and titulofr.blank? \nend",
"def validations\n valid_page_number? if page_number\n valid_period_name? if period_param\n valid_date? if date_param\n end",
"def validate\n if filename.nil?\n errors.add_to_base(\"You must choose a file to upload\")\n else\n # Images should only be GIF, JPEG, or PNG\n enum = attachment_options[:content_type]\n unless enum.nil? || enum.include?(send(:content_type))\n errors.add_to_base(\"You can only upload images (GIF, JPEG, or PNG)\")\n end\n # Images should be less than UPLOAD_LIMIT MB.\n enum = attachment_options[:size]\n unless enum.nil? || enum.include?(send(:size))\n msg = \"Images should be smaller than #{UPLOAD_LIMIT} MB\"\n errors.add_to_base(msg)\n end\n end\n end",
"def valid?\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n if @metadata.nil?\n return false\n end\n\n \n \n \n \n \n \n \n \n end",
"def validate\n errors.add(:post_office, \"- must be filled for postalcode #{self.postal_code}\") if self.post_office.blank? && !self.postal_code.blank?\n errors.add(:postal_code, \"- must be filled for #{self.post_office}\") if self.postal_code.blank? && !self.post_office.blank? \n errors.add_to_base(\"- Person must have at least one phonenumber\") if (self.phone_home.blank? && self.phone_cell.blank? && self.phone_work.blank?) \n end",
"def is_valid; end",
"def validate\n unless attachment.errors.empty?\n # uncomment this to get rid of the less-than-useful interrim messages\n # errors.clear \n errors.add :attachment, \"Paperclip returned errors for file '#{attachment_file_name}' - check ImageMagick installation or image source file.\"\n false\n end\n end",
"def additional_controls # \n if kats.nil? or kats.size == 0\n# errors.add('kats', 'At least one category should be selected!')\n end\n if text_over\n errors.add('css_over', 'helpers.help.rotator.css_over_error') if css_over.blank?\n errors.add('picture', 'helpers.help.rotator.picture_error') if picture.blank?\n end\nend",
"def validate\n end",
"def validate_build\n end",
"def valid?\n @errors << :title if [email protected]_a?(String) || @title.empty?\n @errors << :author if [email protected]_a?(String) || @author.empty?\n @errors << :release_date unless @release_date.is_a?(Date)\n @errors << :publisher if [email protected]_a?(String) || @publisher.empty?\n @errors << :isbn unless @isbn.is_a?(Integer) && @isbn < 10**10 && @isbn >= 10**9\n \n @errors.empty?\n end",
"def extra_validations\n success\n end",
"def good_params\n params.require(:good).permit(:name, :description,:avatar, :price, :user_id, :category_id, :sub_category_id, :deadline)\n end",
"def validate; end",
"def validate; end",
"def validate; end",
"def validate; end",
"def validate_mandatory_fields\n validate_for_card unless self.cc_number.blank?\n validate_for_transaction_tag unless self.transaction_tag.blank?\n validate_for_track1 unless self.track1.blank?\n validate_for_track2 unless self.track2.blank?\n end",
"def test_validate_patient_name_and_account_number_by_giving_invalid_data\n image_type_record = ImageType.new\n image_type_record.patient_first_name = \"RAJ.jk*-9\"\n image_type_record.patient_last_name = \"C)C.9-\"\n image_type_record.patient_account_number= \"gh.gh-&&89\"\n image_type_record.image_type = \"EOB\"\n image_type_record.save\n assert !image_type_record.valid?, image_type_record.errors.full_messages.to_s\n end",
"def validate\n # add errors if not validate\n end",
"def is_valid\n\tend",
"def is_valid\n\tend",
"def valid?\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n end",
"def valid_image_data?\n\n #There should be image data.\n unless self.data?\n errors.add(:base, \"No image data.\")\n return false\n end\n\n #There should be large thumbnail data.\n unless self.large_thumb?\n errors.add(:base, \"No large thumbnail image data.\")\n return false\n end\n\n #There should be small thumbnail data.\n unless self.small_thumb?\n errors.add(:base, \"No small thumbnail image data.\")\n return false\n end\n\n return true\n end",
"def valid?\n return false if @class_id.nil?\n class_id_validator = EnumAttributeValidator.new('String', [\"asset.DeviceContractInformation\"])\n return false unless class_id_validator.valid?(@class_id)\n return false if @object_type.nil?\n object_type_validator = EnumAttributeValidator.new('String', [\"asset.DeviceContractInformation\"])\n return false unless object_type_validator.valid?(@object_type)\n contract_status_validator = EnumAttributeValidator.new('String', [\"Unknown\", \"Not Covered\", \"Active\", \"Expiring Soon\"])\n return false unless contract_status_validator.valid?(@contract_status)\n contract_status_reason_validator = EnumAttributeValidator.new('String', [\"\", \"Line Item Expired\", \"Line Item Terminated\"])\n return false unless contract_status_reason_validator.valid?(@contract_status_reason)\n device_type_validator = EnumAttributeValidator.new('String', [\"None\", \"CiscoUcsServer\", \"CiscoUcsFI\", \"CiscoUcsChassis\", \"CiscoNexusSwitch\"])\n return false unless device_type_validator.valid?(@device_type)\n platform_type_validator = EnumAttributeValidator.new('String', [\"\", \"APIC\", \"DCNM\", \"UCSFI\", \"UCSFIISM\", \"IMC\", \"IMCM4\", \"IMCM5\", \"IMCRack\", \"UCSIOM\", \"HX\", \"HyperFlexAP\", \"IWE\", \"UCSD\", \"IntersightAppliance\", \"IntersightAssist\", \"PureStorageFlashArray\", \"UCSC890\", \"NetAppOntap\", \"NetAppActiveIqUnifiedManager\", \"EmcScaleIo\", \"EmcVmax\", \"EmcVplex\", \"EmcXtremIo\", \"VmwareVcenter\", \"MicrosoftHyperV\", \"AppDynamics\", \"Dynatrace\", \"NewRelic\", \"ServiceNow\", \"ReadHatOpenStack\", \"CloudFoundry\", \"MicrosoftAzureApplicationInsights\", \"OpenStack\", \"MicrosoftSqlServer\", \"Kubernetes\", \"AmazonWebService\", \"AmazonWebServiceBilling\", \"MicrosoftAzureServicePrincipal\", \"MicrosoftAzureEnterpriseAgreement\", \"DellCompellent\", \"HPE3Par\", \"RedHatEnterpriseVirtualization\", \"NutanixAcropolis\", \"HPEOneView\", \"ServiceEngine\", \"HitachiVirtualStoragePlatform\", \"IMCBlade\", \"TerraformCloud\", \"TerraformAgent\", \"CustomTarget\", \"AnsibleEndpoint\", \"HTTPEndpoint\", \"SSHEndpoint\", \"CiscoCatalyst\"])\n return false unless platform_type_validator.valid?(@platform_type)\n state_contract_validator = EnumAttributeValidator.new('String', [\"Update\", \"OK\", \"Failed\", \"Retry\"])\n return false unless state_contract_validator.valid?(@state_contract)\n true\n end",
"def validate_upload?\n upload? || review? || published? || unpublished_changes?\n end",
"def validate\n validate_inclusion_of(:service_type, SERVICE_TYPES)\n end",
"def set_validations_and_filters\n validates_length_of :numero_publicacion, :in => 6..12, :allow_nil => true, :allow_blank => true\n validates_presence_of :fecha_solicitud, :numero_gaceta\n validates_format_of :numero_solicitud, :with => /^\\d+-\\d{4}/\n validates_uniqueness_of :numero_solicitud#, :scope => :parent_id\n #validates_presence_of :numero_publicacion, :numero_gaceta\n end",
"def valid?\n return false if @aperture_value.nil?\n return false if @brightness_value.nil?\n return false if !@cfa_pattern.nil? && @cfa_pattern !~ Regexp.new(/^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/)\n return false if !@components_configuration.nil? && @components_configuration !~ Regexp.new(/^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/)\n return false if @compressed_bits_per_pixel.nil?\n return false if !@device_setting_description.nil? && @device_setting_description !~ Regexp.new(/^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/)\n return false if @digital_zoom_ratio.nil?\n return false if !@exif_version.nil? && @exif_version !~ Regexp.new(/^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/)\n return false if @exposure_bias_value.nil?\n return false if @exposure_index.nil?\n return false if @exposure_time.nil?\n return false if @f_number.nil?\n return false if @flash_energy.nil?\n return false if !@flashpix_version.nil? && @flashpix_version !~ Regexp.new(/^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/)\n return false if @focal_length.nil?\n return false if @focal_length_in35_mm_film.nil?\n return false if @focal_plane_x_resolution.nil?\n return false if @focal_plane_y_resolution.nil?\n return false if @gps_altitude.nil?\n return false if !@gps_area_information.nil? && @gps_area_information !~ Regexp.new(/^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/)\n return false if @gpsdop.nil?\n return false if @gps_dest_bearing.nil?\n return false if @gps_dest_distance.nil?\n return false if @gps_differential.nil?\n return false if @gps_img_direction.nil?\n return false if !@gps_processing_method.nil? && @gps_processing_method !~ Regexp.new(/^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/)\n return false if @gps_speed.nil?\n return false if !@gps_version_id.nil? && @gps_version_id !~ Regexp.new(/^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/)\n return false if @gamma.nil?\n return false if @iso_speed.nil?\n return false if @iso_speed_latitude_yyy.nil?\n return false if @iso_speed_latitude_zzz.nil?\n return false if @photographic_sensitivity.nil?\n return false if !@maker_note_raw_data.nil? && @maker_note_raw_data !~ Regexp.new(/^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/)\n return false if @max_aperture_value.nil?\n return false if [email protected]? && @oecf !~ Regexp.new(/^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/)\n return false if @pixel_x_dimension.nil?\n return false if @pixel_y_dimension.nil?\n return false if @recommended_exposure_index.nil?\n return false if @scene_type.nil?\n return false if @sensitivity_type.nil?\n return false if @sharpness.nil?\n return false if @shutter_speed_value.nil?\n return false if !@spatial_frequency_response.nil? && @spatial_frequency_response !~ Regexp.new(/^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/)\n return false if @standard_output_sensitivity.nil?\n return false if @subject_distance.nil?\n true\n end",
"def is_valid?\n end",
"def valid?\n return false if @name.nil?\n return false if @value.nil?\n return false if @timestamp.nil?\n return false if @source_id.nil?\n return false if @source_label.nil?\n return false if @source.nil?\n source_validator = EnumAttributeValidator.new('String', [\"IMPORT\", \"API\", \"FORM\", \"ANALYTICS\", \"MIGRATION\", \"SALESFORCE\", \"INTEGRATION\", \"CONTACTS_WEB\", \"WAL_INCREMENTAL\", \"TASK\", \"EMAIL\", \"WORKFLOWS\", \"CALCULATED\", \"SOCIAL\", \"BATCH_UPDATE\", \"SIGNALS\", \"BIDEN\", \"DEFAULT\", \"COMPANIES\", \"DEALS\", \"ASSISTS\", \"PRESENTATIONS\", \"TALLY\", \"SIDEKICK\", \"CRM_UI\", \"MERGE_CONTACTS\", \"PORTAL_USER_ASSOCIATOR\", \"INTEGRATIONS_PLATFORM\", \"BCC_TO_CRM\", \"FORWARD_TO_CRM\", \"ENGAGEMENTS\", \"SALES\", \"HEISENBERG\", \"LEADIN\", \"GMAIL_INTEGRATION\", \"ACADEMY\", \"SALES_MESSAGES\", \"AVATARS_SERVICE\", \"MERGE_COMPANIES\", \"SEQUENCES\", \"COMPANY_FAMILIES\", \"MOBILE_IOS\", \"MOBILE_ANDROID\", \"CONTACTS\", \"ASSOCIATIONS\", \"EXTENSION\", \"SUCCESS\", \"BOT\", \"INTEGRATIONS_SYNC\", \"AUTOMATION_PLATFORM\", \"CONVERSATIONS\", \"EMAIL_INTEGRATION\", \"CONTENT_MEMBERSHIP\", \"QUOTES\", \"BET_ASSIGNMENT\", \"QUOTAS\", \"BET_CRM_CONNECTOR\", \"MEETINGS\", \"MERGE_OBJECTS\", \"RECYCLING_BIN\", \"ADS\", \"AI_GROUP\", \"COMMUNICATOR\", \"SETTINGS\", \"PROPERTY_SETTINGS\", \"PIPELINE_SETTINGS\", \"COMPANY_INSIGHTS\", \"BEHAVIORAL_EVENTS\", \"PAYMENTS\", \"GOALS\", \"PORTAL_OBJECT_SYNC\", \"APPROVALS\", \"FILE_MANAGER\", \"MARKETPLACE\", \"INTERNAL_PROCESSING\", \"FORECASTING\", \"SLACK_INTEGRATION\", \"CRM_UI_BULK_ACTION\", \"WORKFLOW_CONTACT_DELETE_ACTION\"])\n return false unless source_validator.valid?(@source)\n return false if @selected_by_user.nil?\n return false if @selected_by_user_timestamp.nil?\n return false if @source_vid.nil?\n return false if @source_metadata.nil?\n return false if @request_id.nil?\n true\n end",
"def validate()\n errors.add(:nombre, \"debe ser positivo\") if nombre.nil?\n end",
"def valid?\n end",
"def valid?\n end",
"def valid?\n end"
] | [
"0.65540177",
"0.64090073",
"0.6288335",
"0.6219141",
"0.62117827",
"0.6165551",
"0.61579746",
"0.61492026",
"0.61442524",
"0.6098558",
"0.60727084",
"0.60497963",
"0.60158134",
"0.6005152",
"0.60040003",
"0.5975477",
"0.5954448",
"0.5950787",
"0.5946185",
"0.5926829",
"0.59149396",
"0.59149396",
"0.58887887",
"0.5877523",
"0.5875284",
"0.5873371",
"0.587252",
"0.58638084",
"0.5862572",
"0.58486956",
"0.5847344",
"0.58450997",
"0.5819131",
"0.58085257",
"0.58065456",
"0.5804829",
"0.57862985",
"0.57807326",
"0.57638013",
"0.57571614",
"0.5755426",
"0.5752523",
"0.5749507",
"0.5739867",
"0.5735482",
"0.5728771",
"0.5718492",
"0.5716546",
"0.5708996",
"0.5708996",
"0.5708996",
"0.5704769",
"0.5702429",
"0.56870306",
"0.5682907",
"0.5678312",
"0.5674536",
"0.5665207",
"0.5663628",
"0.5663216",
"0.5663216",
"0.5663216",
"0.5660573",
"0.5658372",
"0.5654779",
"0.565259",
"0.56495845",
"0.56465477",
"0.5638313",
"0.5628917",
"0.56282705",
"0.56249386",
"0.561992",
"0.5614509",
"0.5611921",
"0.5611215",
"0.5611045",
"0.56088173",
"0.5602032",
"0.5601197",
"0.5601197",
"0.5601197",
"0.5601197",
"0.5598999",
"0.5595519",
"0.55940944",
"0.559368",
"0.559368",
"0.5592943",
"0.5592609",
"0.5590919",
"0.55876625",
"0.5584188",
"0.55811524",
"0.5579395",
"0.55784863",
"0.55776644",
"0.556871",
"0.55670947",
"0.55670947",
"0.55670947"
] | 0.0 | -1 |
numero di donazioni effettuate TORTONESI | def number_of_donations(campaign)
campaign.donations.count
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def posti_disponibili\n self.vehicle.posti - self.n_passeggeri\n end",
"def indice_masa_corporal\n\t\t(peso / (talla * talla) * 10000).round(1)\n\tend",
"def num_tankoubon; end",
"def duns_number; end",
"def num_nulos\n t = @filas*@columnas\n nn = 0\n \n @filas.times do |i|\n nn += @pos[i].size\n i += 1\n end\n\n n = t - nn\n n.to_f/t.to_f\n end",
"def getNbRecompense\n return 0\n end",
"def verificaesonitre (primo, secondo, terzo)\n\tesonicomuni=0\n\t#se il secondo e il terzo includono lo stesso esone lo conto come comune\n\tprimo.each do |v|\n\t\tif secondo.include?(v) then\n\t\t\tif terzo.include?(v) then \n\t\t\t\tesonicomuni=esonicomuni+1\n\t\t\tend\n\t\tend\t\t\t\t\t\n\tend\n\tprimosecondo=0\n\tprimo.each do |v|\n\t\tif secondo.include?(v) then\n\t\t\tif terzo.include?(v)==false then \n\t\t\t\tprimosecondo=primosecondo+1\n\t\t\tend\n\t\tend\t\t\t\t\t\n\tend\n\tsecondoterzo=0\n\tsecondo.each do |v|\n\t\tif terzo.include?(v) then\n\t\t\tif primo.include?(v)==false then \n\t\t\t\tsecondoterzo=secondoterzo+1\n\t\t\tend\n\t\tend\t\t\t\t\t\n\tend\n\tprimoterzo=0\n\tprimo.each do |v|\n\t\tif terzo.include?(v) then\n\t\t\tif secondo.include?(v)==false then \n\t\t\t\tprimoterzo=primoterzo+1\n\t\t\tend\n\t\tend\t\t\t\t\t\n\tend\n\t#il numero di esoni totali è così calcolato\n\tesoni=esonicomuni+primosecondo+secondoterzo+primoterzo+(primo.length-esonicomuni-primosecondo-primoterzo)+(secondo.length-esonicomuni-primosecondo-secondoterzo)+(terzo.length-secondoterzo-esonicomuni-primoterzo)\n\treturn esoni\nend",
"def hidratos_carbono\r\n hc = 0\r\n @lista_alimentos.each do |i|\r\n hc += i.carbohidratos\r\n end\r\n return hc\r\n end",
"def door_count; end",
"def totalHidratos\n\t\thidr = 0\n\t\ttotal = 0\n\t\[email protected] do |alimento|\n\t\t\thidr += alimento.carbohidratos\n\t\tend\n\t\treturn hidr.round(2)\n\tend",
"def numarulTotalDePersoane()\n @@instantePersoana += 1\n puts \"Numarul total de persoane: #@@instantePersoana\"\n end",
"def dinosaurii_count\n @@count += 1\n end",
"def ncolazione\n self.attributes_before_type_cast['colazione'].to_i\n end",
"def combien_de_PDR()\n return @nb_point_de_retour\n end",
"def number_of_exons\n unless defined?(@number_of_exons)\n @number_of_exons = field_fetch('Number of exons', @d0).to_i\n end\n @number_of_exons\n end",
"def buscar_cruces_pendientes\n cruces = Marca.all(:select => \"id\", :conditions => [\n \"marcas.importacion_id = ? AND marcas.propia = ? AND marcas.tipo_signo_id NOT IN (?)\", \n self.id, false, TipoSigno.descartadas_cruce\n ]).size\n\n cruces - self.consultas.size\n end",
"def how_many\n return @@total_samurais\n end",
"def terreno\n\t\treturn @terreno*@cantidad\n\tend",
"def calculo_valor_energetico\n\t\t\t(@carbohidratos*4) + (@lipidos*9) + (@proteinas*4)\n\t\tend",
"def moverPrimasADespacho(cantidad_lotes)\n\t\n\nend",
"def porc_grasa\n\t\t(1.2 * self.indice_masa_corporal + 0.23 * edad - 10.8 * sexo - 5.4).round(1)\n\tend",
"def uno_mas\n\t\t@edad += 1\n\t\tif @edad < EDAD_MAXIMA\n\t\t\t@altura += @inc_alt\n\t\t\t@contador += prod_nar if @edad >= @ini_fru\n\t\telse\n\t\t\tmuere\n\t\tend\n\t\t@edad\n\tend",
"def num_oxygen\n @num_oxygen ||= total_atoms :O\n end",
"def porcentajegrasa\n\t\t1.2 * imc + 0.23 * @edad - 10.8 * @sexo - 5.4\n\tend",
"def kcallipidos\n\t\t\t@lipidos * 9\n\t\tend",
"def reduceOreCount(tier)\r\n @oreRemaining[tier]-=1\r\n @oreRemainingPara[tier].clear{ para(@ore[tier].to_s + \" \" + @oreName[tier].to_s + \" \", strong(\"x\" + @oreRemaining[tier].to_s), @style_orecount) }\r\nend",
"def calculo \n self.minutos_reales = 5 * 480 #cantidad de OPERARIOS * Jornada de Trabajo(Turnos)\n self.costo_minuto = 89 #Costo Real por minuto\n self.otros_costos = 540 * 89 #Tiempo Total(Minutos) * Costo Real por Minutos\n self.costo_mano_obra = 420 * 5 * 89 # Jornada Minutos * Cantidad Operarios * Costo Real por minutos \n self.manoObraPlaneada = 650.000 * 5 # Salario Total * Cantidad de operarios \n end",
"def terrenos\r\n terreno = 0\r\n @lista_alimentos.each do |i|\r\n terreno += i.terreno\r\n end\r\n return terreno\r\n end",
"def totalLipidos\n\t\tlip = 0\n\t\ttotal = 0\n\t\[email protected] do |alimento|\n\t\t\tlip += alimento.lipidos\n\t\tend\n\t\treturn lip.round(2)\n\t\n\tend",
"def cantidad_casas_hoteles\n aux = 0\n \n @propiedades.each do |i|\n aux += i.cantidad_casas_hoteles\n end\n \n return aux\n end",
"def vrat_celkovy_soucet_vah\n soucet = 0\n @pole_vah.each do |prvek| \n soucet += prvek.to_i\n end\n return soucet\n end",
"def calorie_count\n @sugar_amount * CALORIES_PER_SUGAR_GRAM +\n @flour_amount * CALORIES_PER_FLOUR_GRAM\n end",
"def num_nulos\n total = @filas*@columnas\n cont = 0\n for i in 0...@filas\n for j in 0...@columnas\n if(@pos[i][j] != 0)\n cont += 1\n end\n end\n end\n res = total - cont\n res.to_f/total.to_f\n end",
"def number_of_cases\n fee_quantity_for('BANOC') + 1\n end",
"def increment_dracula\n @count_dracula += 1\n @total_count += 1\n end",
"def porcentaje_carbohidratos\n recorrido = lista_alimentos.head\n acumulador = 0\n porcentaje = 0\n\n while recorrido != nil\n acumulador = acumulador + recorrido.value.proteinas + recorrido.value.carbohidratos + recorrido.value.lipidos\n porcentaje = porcentaje + recorrido.value.carbohidratos\n\n recorrido = recorrido.next\n end\n\n ((porcentaje * 100)/acumulador).round(2)\n end",
"def seuil()\n\t\treturn 0\n\tend",
"def ContarHijos(menu,padreid)\n @opcionMenus = OpcionMenu.all \n @son=0\n @i=1\n @opcionMenus.each do |arbol| \n \tif arbol.menu_id.to_i==menu.id.to_i and arbol.padre_id.to_i==padreid.to_i\n \t @son=@son+1\n \t @i=@i+1;\n \tend\n end\n return @son \n end",
"def porcentaje_graso\n (1.2*calcular_imc)+(0.23*@edad)-(10.8*@sexo)-5.4\n end",
"def get_energia_lipidos\n\t\t\t\t@lipidos * 9\n\t\t\tend",
"def segundoDigitoMenor(clave)\n\tcadena_digito = clave.to_s\n\treturn (cadena_digito[1]).to_i\nend",
"def un_evalute_tuan_orders_num\n count=0\n self.orders.each do |order|\n if order.tuangou and order.current_order_status.value >1 and order.current_order_status.value<64 and order.product_rank==-2\n count+=1\n end\n end\n count\n end",
"def carne\n\t\tcerdo = Alimento.new(\"Cerdo\", 21.5, 0.0, 6.3, 7.6, 11.0)\n\t\tcordero = Alimento.new(\"Cordero\",18.0,0.0,3.1,50.0,164.0)\n\t\tvaca = Alimento.new(\"Carne de vaca\", 21.1,0.0,3.1,50.0,164.0)\n\t\tpollo = Alimento.new(\"Pollo\",20.6,0.0,5.6,5.7,7.1)\n\t\tsuma = 0\n\n\t\t[cerdo,cordero,vaca,pollo].each do |i|\n\t\t\tif (@alimentos.find_index { |x| x == i } != nil)\n\t\t\t\tsuma += @gramos[@alimentos.find_index { |x| x == i }].valor\n\t\t\tend\t\t\n\t\tend\n\n\t\treturn suma >= (gramos_total * 0.45)\n\tend",
"def terreno\n grtotal = 0\n sum = 0\n\t\t#recorre las dos listas a la vez para sacar el terreno\n #usado de cada ingrediente segun el peso de este\n @lista.zip(@listagr).each do |normal, gr|\n cant = gr/1000.0\n sum += normal.terreno*cant\n end\n @terreno = sum\n\n end",
"def huella_nutricional\n numero1 = self.calculo_valor_calorico_total\n numero2 = self.calculo_emisiones_diarias\n\n if numero1 < 670\n ienergia = 1\n elsif numero1 <=830\n ienergia = 2\n else\n ienergia = 3\n end\n\n if numero2 < 800\n icarbono = 1\n elsif numero2 <= 1200\n icarbono = 2\n else\n icarbono = 3\n end\n\n media = (ienergia + icarbono)/2\n end",
"def recuperationNbEtape()\n\t\t@[email protected]()\n\tend",
"def recuperationNbEtape()\n\t\t@[email protected]()\n\tend",
"def carbohidratos\n\t\treturn @carbohidratos*@cantidad\n\tend",
"def total_nutrientes\n\t\ti = 0\n\t\tproteinas = carbohidratos = lipidos = 0.0\n\t\twhile i < @lista_alimentos.size do\n\t\t\tproteinas += (@lista_alimentos[i].proteinas)*(@lista_cantidades[i])\n\t\t\tcarbohidratos += (@lista_alimentos[i].carbohidratos)*(@lista_cantidades[i])\n\t\t\tlipidos += (@lista_alimentos[i].lipidos)*(@lista_cantidades[i])\n\t\t i+= 1\n\t\tend\n\t\treturn proteinas + lipidos + carbohidratos\n\tend",
"def dinosaur_count\n @@count += 1\n end",
"def calculate_nicotin\n (Smoke.by_user(self.id).sum(:counted) * cigaret_nicotin).convert_to('milligram')\n .to_i\n .round(2)\n end",
"def por_lipidos\n\t\taux_lipidos = 0.0\n\t\ti = 1\n\t\twhile i < @lista_alimentos.size do\n\t\t\taux_lipidos += @lista_alimentos[i].lipidos * @lista_cantidades[i]\n\t\t\ti+=1\n\t\tend\n\t\treturn ((aux_lipidos/total_nutrientes)*100.0).round(2)\n\tend",
"def modificar_cruces_pendientes(cant)\n unless self.importacion.nil?\n pend = self.importacion.cruces_pendientes\n self.importacion.update_attributes(:cruces_pendientes => (pend + cant) )\n end\n end",
"def porcentaje_lipidos\n recorrido = lista_alimentos.head\n acumulador = 0\n porcentaje = 0\n\n while recorrido != nil\n acumulador = acumulador + recorrido.value.proteinas + recorrido.value.carbohidratos + recorrido.value.lipidos\n porcentaje = porcentaje + recorrido.value.lipidos\n\n recorrido = recorrido.next\n end\n\n ((porcentaje * 100)/acumulador).round(2)\n end",
"def dof\n @grid.number_of(0)\n end",
"def imprime_quantos_filhos()\n count = 0\n if self.esq != -1\n count+= 1\n end\n if self.dir != -1\n count+= 1\n end\n return count\n end",
"def get_usoterreno\n aux = 0.0\n @contenido.each do |alimento|\n aux += alimento.ground\n end\n @usoterreno = aux\n end",
"def robot_counter\n\n\tend",
"def descuento_sueldo(sueldo, tipo_obrero)\n\tif tipo_obrero == 'o'\n\t\tsueldo - (sueldo * 0.12) #OCURRE A\n\telse\n\t\tsueldo - (sueldo * 0.15) #OCURRE B\n\tend\nend",
"def natural_bonus\n 0\n end",
"def nbAreteSimple\n nbSimple = 0\n @aretes.each { |x|\n x.estDouble == false ? nbSimple += 1 : false\n }\n return nbSimple\nend",
"def calculo_emisiones_diarias\n recorrido = lista_alimentos.head\n cantidad = lista_cantidades.head\n\n while (recorrido != nil && cantidad != nil)\n @emisiones_diarias = @emisiones_diarias + ((recorrido.value.gei * cantidad.value)/1000)\n\n recorrido = recorrido.next\n cantidad = cantidad.next\n end\n\n @emisiones_diarias\n end",
"def add_new_dado\n\t\t@dado += 1\n\tend",
"def get_valor_energetico\n \n return ((@proteinas + @glucidos) * 4 + @lipidos * 9).round(1)\n \n \n end",
"def panier_en_vente\n \t@paniers_ = Panier.where('revendeur_id = ? AND deleted = 0', self.id)\n \t@paniers= []\n \t@paniers_.each do |panier|\n \t\tif panier.has_declinaison\n \t\t\t@paniers << panier\n \t\tend\n \tend\n \t\n \treturn @paniers.count\n end",
"def actualiza_atributos_diariodets \n sum_debe = 0\n sum_haber = 0\n sum_debe_sec = 0\n sum_haber_sec = 0\n item_max = 0\n idcuenta_ajuste_dif_cambio = 709 #Catalogo.find_by(id: Catalogo::ID_CTA_AJUSTE_DIF_CAMBIO)\n\n set_datos_segun_conf\n\n if self.origenasiento_id == 1 # si es manual actualiza columnas debe, haber...\n diariodets.each do |child| \n if child.ajuste.blank? or child.ajuste == '0'\n cod_moneda_trasac = Moneda.find_by(id:child.moneda_id).codigo \n child.tcori = self.tc\n child.ajuste = '0' \n if cod_moneda_trasac == Moneda::CODIGO_SYS[:nal]\n child.debe = (child.debeori).round(2) \n child.haber = (child.haberori).round(2) \n child.debesec = (child.debeori/Conta::TCV_CONST).round(2) \n child.habersec = (child.haberori/Conta::TCV_CONST).round(2) \n child.tcsec = child.tcori\n else\n if cod_moneda_trasac == Moneda::CODIGO_SYS[:sec]\n tc_transac = 0\n if Conta::TCV_CONST != child.tcori\n tc_transac = child.tcori\n else\n tc_transac = Conta::TCV_CONST\n end\n child.tcsec = tc_transac\n\n child.debe = (child.debeori*tc_transac).round(2) \n child.haber = (child.haberori*tc_transac).round(2) \n\n child.debesec = (child.debeori).round(2) \n child.habersec = (child.haberori).round(2) \n end #cod_moneda_trasac = Moneda::CODIGO_SYS[:sec]\n end #cod_moneda_trasac = Moneda::CODIGO_SYS[:nal]\n if item_max < child.item\n item_max = child.item\n end \n sum_debe = sum_debe + child.debe\n sum_haber = sum_haber + child.haber\n sum_debe_sec = sum_debe_sec + child.debesec\n sum_haber_sec = sum_haber_sec + child.habersec\n end #if child.ajuste.blank? or child.ajuste == '0'\n end #end diariodets.each do |child|\n\n ###\n ###cuadre global\n if (sum_debe != sum_haber) or (sum_debe_sec != sum_haber_sec)\n ajuste = 0\n ajuste_sec = 0 \n ajuste = sum_debe - sum_haber\n ajuste_sec = sum_debe_sec - sum_haber_sec \n if ajuste != 0 \n if ajuste > 0\n item_max = item_max + 1\n diariodets.build(:item => item_max, :catalogo_id => idcuenta_ajuste_dif_cambio, :tlaux1 => \"0\", :tlaux2 => \"0\", :codtlaux1 => \"\", :codtlaux2 => \"\", :debe => 0, :haber => ajuste, :debesec => 0, :habersec => 0, :debeori => 0, :haberori => ajuste, :tcori => self.tc, :glosa => 'AJUSTE AUTOMATICO POR CUADRE', :esdebito => false, :monto => ajuste, :ajuste => \"1\", :oficina_id => Oficina.id_oficina_nacional, :libauxdet_id => 0, :moneda_id => 1)\n else\n ajuste = ajuste * (-1)\n item_max = item_max + 1\n diariodets.build(:item => item_max, :catalogo_id => idcuenta_ajuste_dif_cambio, :tlaux1 => \"0\", :tlaux2 => \"0\", :codtlaux1 => \"\", :codtlaux2 => \"\", :debe => ajuste, :haber => 0, :debesec => 0, :habersec => 0, :debeori => ajuste, :haberori => 0, :tcori => self.tc, :glosa => 'AJUSTE AUTOMATICO POR CUADRE', :esdebito => false, :monto => ajuste_sec, :ajuste => \"1\", :oficina_id => Oficina.id_oficina_nacional, :libauxdet_id => 0, :moneda_id => 1)\n end#end ajuste > 0\n end# end ajuste != 0 \n if ajuste_sec != 0\n if ajuste_sec > 0\n item_max = item_max + 1\n diariodets.build(:item => item_max, :catalogo_id => idcuenta_ajuste_dif_cambio, :tlaux1 => \"0\", :tlaux2 => \"0\", :codtlaux1 => \"\", :codtlaux2 => \"\", :debe => 0, :haber =>0 , :debesec => 0, :habersec => ajuste_sec, :debeori => 0, :haberori => ajuste_sec, :tcori => self.tc, :glosa => 'AJUSTE AUTOMATICO POR CUADRE', :esdebito => false, :monto => ajuste_sec, :ajuste => \"1\", :oficina_id => Oficina.id_oficina_nacional, :libauxdet_id => 0, :moneda_id => 2)\n else\n ajuste_sec = ajuste_sec * (-1)\n item_max = item_max + 1\n diariodets.build(:item => item_max, :catalogo_id => idcuenta_ajuste_dif_cambio, :tlaux1 => \"0\", :tlaux2 => \"0\", :codtlaux1 => \"\", :codtlaux2 => \"\", :debe => 0, :haber => 0, :debesec => ajuste_sec, :habersec => 0, :debeori => ajuste_sec, :haberori => 0, :tcori => self.tc, :glosa => 'AJUSTE AUTOMATICO POR CUADRE', :esdebito => false, :monto => ajuste_sec, :ajuste => \"1\", :oficina_id => Oficina.id_oficina_nacional, :libauxdet_id => 0, :moneda_id => 2) \n end#end ajuste_sec > 0\n end# end ajuste_sec != 0 \n end #(sum_debe != sum_haber) or (sum_debe_sec != sum_haber_sec)\n end#if self.tipocomprobante_id != 5 # si es automatico no aplica lo siguiente \n end",
"def credibilidade_positiva\n\t\tcredibilidade_pontos.where(\"valor > 0\").count\n\tend",
"def imc\n\t\tnum = (@peso/(@talla*@talla)).round(2)\n\t\tif num < 18.5\n\t\t\tnum #- Bajo peso\"\n\t\telsif num > 18.5 and num < 24.9\n\t\t\tnum #- Adecuado\"\n\t\telsif num > 25.0 and num < 29.9\n\t\t\tnum #- Sobrepeso\"\n\t\telsif num > 30.0 and num < 34.9\n\t\t\tnum #Obesidad grado 1\"\n\t\telsif num > 35.0 and num < 39.9\n\t\t\tnum #- Obesidad grado 2\"\n\t\telsif num > 40\n\t\t\tnum #- Obesidad grado 2\"\n\t\tend\t\t\t\n\tend",
"def valor_calorico\n if eficiencia_energetica() < 670\n return 1\n end\n if eficiencia_energetica() > 830\n return 3\n else\n return 2\n end\n end",
"def count_no\n rsvp.no.count\n end",
"def get_nbre_connexion\n session[:sos_note_nbre_connexion]? session[:sos_note_nbre_connexion] : 0\n end",
"def num_nitro\n @num_nitro ||= total_atoms :N\n end",
"def vrat_soucet_vah(jedinec)\n soucet = 0\n citac = 0\n jedinec.each do |prvek| \n if(prvek)then\n soucet += @pole_vah[citac].to_i\n end\n citac +=1\n end\n return soucet\n end",
"def dieta_terreno(gramos)\n\n aux = @head\n suma_terreno = 0\n i = 0\n while (!aux.nil?)\n suma_terreno += aux[:value].auxiliar2(gramos[i])\n aux = aux[:next]\n i = i+1\n end\n return suma_terreno.round(2)\n\n end",
"def valor_energetico\n @proteinas * 4.0 + @carbohidratos * 4.0 + @lipidos * 9.0\n end",
"def test_03_dada_una_caja_de_ahorros_cuyo_saldo_es_200_pesos_si_extraigo_100_pesos_su_nuevo_saldo_debe_ser_100_pesos\n @una_caja_de_ahorros_nueva.depositar 200.pesos\n\n @una_caja_de_ahorros_nueva.extraer 100.pesos\n\n assert_equal 100.pesos, @una_caja_de_ahorros_nueva.saldo\n end",
"def lots_count\t\t\n lots.count\n end",
"def huella\n\t\tindice1 = 0\n\t\t#dependiendo del vct de cada ingrediente, se le pone un indice\n\t\tif vct < 670\n\t\t\tindice1 = 1\n\t\t\t\n\t\telsif vct > 830\n\t\t\tindice1 = 3\n\t\telse \n\t\t\tindice1 = 2\n\t\tend \n\t\tindice2 = 0\n\t\t#dependiendo de los gases emitidos de cada ingrediente, \n\t\t#se le pone un indice\n\t\tif emisiones < 800\n\t\t\tindice2 = 1\n\t\telsif emisiones > 1200\n\t\t\tindice2 = 3\n\t\telse \n\t\t\tindice2 = 2\n\t\tend\n\t\t#hace la media de los indices sacados\n\t\tindiceres = (indice1+indice2)/2\n\t\t\n\n\tend",
"def test_04_dada_una_caja_de_ahorros_cuyo_saldo_es_200_pesos_si_extraigo_300_pesos_su_saldo_no_debe_variar\n @una_caja_de_ahorros_nueva.depositar 200.pesos\n @una_caja_de_ahorros_nueva.extraer 300.pesos\n assert_equal 200.pesos, @una_caja_de_ahorros_nueva.saldo\n end",
"def valor_energetico\n (@proteinas * 4) + (@glucidos * 4) + (@grasas * 9)\n end",
"def kcalglucidos\n\t\t\t@carbohidratos * 4\n\t\tend",
"def rentas\n profesion ? 1 : 0\n end",
"def totalProteina \n\t\tprot = 0\n\t\ttotal = 0\n\t\[email protected] do |alimento|\n\t\t\tprot += alimento.proteinas\n\t\tend\n\t\treturn prot.round(2)\n\tend",
"def hidratosIR\n\t\t((valorEnergeticoKJ.to_f*260)/8400).round(2)\n\tend",
"def secuenciasugerida \n #recupera los hijos del padre de la cuenta a crear \n\t\thijos = Catalogo.where(\"padre_id = ? AND activo = ?\", idcuenta, true)\n\n #configuracion del nivel a crear\n\t\tidnivel = Catalogo.find_by(id: idcuenta).nivel_id\n\t\tnivelh = Nivel.find_by(id: idnivel).numnivel + 1\n\n nivel = Nivel.find_by(numnivel: nivelh)\n nrodigitos = nivel.nrodigitos\n nrodigitostotal = nivel.nrodigitostotal\n digito = 0\n aux = 0\n\n hijos.each do |e|\n \taux = e.codigo.last(nrodigitos).to_i\n \t\tif digito < aux\n\t\t\t\tdigito = aux\n \t\tend\n \tend\n \tdigito = digito + 1\n \tc =\"\"\n \tnrodigitos.times { c = c + \"0\" }\n \tc = c.to_s + digito.to_s \t\n \t\t\n #codigo sugerido\n \treturn c.last(nrodigitos).to_s\n\tend",
"def donizetti; end",
"def salta_il_primo\n self.drop 1\n end",
"def hidratos \n\t\t@hidratos = @azucares + @polialcoles + @almidon\n\t\treturn @hidratos\n\tend",
"def grasa\n\t\t1.2 * imc + 0.23 * @edad - 10.8 * ( sexo ? 1 : 0) - 5.4\n\tend",
"def shield_bonus\n 0\n end",
"def calculoDiametro(raio)\n return raio * 2\nend",
"def gera_posicao\n r = 0\n i = nil\n while 1\n r = rand(2**30 - 1)\n next if r.zero?\n break unless Eleitor.exists?(r)\n end\n self.numero = r\n end",
"def deflection_bonus\n 0\n end",
"def test_05_dada_una_caja_de_ahorros_con_cantidad_de_extracciones_mensuales_igual_a_5_si_hago_una_extraccion_su_saldo_y_sus_extracciones_mensuales_no_deben_variar\n @una_caja_de_ahorros_nueva.depositar 200.pesos\n 5.times { @una_caja_de_ahorros_nueva.extraer 10.pesos }\n\n cantidad_de_extracciones_mensuales_inicial = @una_caja_de_ahorros_nueva.cantidad_de_extracciones_mensuales\n saldo_inicial = @una_caja_de_ahorros_nueva.saldo\n\n @una_caja_de_ahorros_nueva.extraer 10.pesos\n\n assert_equal saldo_inicial, @una_caja_de_ahorros_nueva.saldo\n assert_equal cantidad_de_extracciones_mensuales_inicial, @una_caja_de_ahorros_nueva.cantidad_de_extracciones_mensuales\n end",
"def tiempo!\n @tiempo +=1\n if @tiempo > 4\n 5.times do\n new_torta = Torta.new\n @tortas << new_torta\n end\n end\n end",
"def horas_porasignar(asig_id,solucion)\n # horas requeridas de esta materia en este curso\n req = self.horas_por_semanas.where(:asignatura_id => asig_id).last.horasporsemana\n #horas ya agendadas en esta materia\n agend = solucion.sol_cursos.where(:curso_id => self.id, :asignatura_id => asig_id).count\n return(req-agend) \n end",
"def count_no\n rsvp.no.count\n end",
"def huella_carbono\n if geidiario() < 800\n return 1\n end\n if geidiario() > 1200\n return 3\n else\n return 2\n end\n end",
"def numero_orientaciones\n (self.id) ?Audiencia.count(:id, :conditions => [\"persona_id = ?\", self.id]) : 0\n end",
"def eob_count\r\n count = count_of_insurance_eobs\r\n if count == 0\r\n count = count_of_patpay_eobs\r\n end\r\n count\r\n end",
"def no_unison(count, i) \n if @note1 == @note2\n if DIATONIC_SCALE[i] == Scales::FA or DIATONIC_SCALE[i] == Scales::DO\n count += 1\n else\n count += 2\n end\n i += 1\n end\n [count, i]\n end"
] | [
"0.65203077",
"0.6343386",
"0.63206774",
"0.63063765",
"0.61632234",
"0.61566365",
"0.6133199",
"0.6116389",
"0.61131614",
"0.606355",
"0.60525197",
"0.60343015",
"0.59852093",
"0.59093153",
"0.589849",
"0.58674794",
"0.5808502",
"0.5800364",
"0.579633",
"0.57778865",
"0.5773915",
"0.5773217",
"0.5756114",
"0.57348263",
"0.57348204",
"0.5720721",
"0.5714696",
"0.56933004",
"0.56893444",
"0.5668462",
"0.5643592",
"0.56422937",
"0.56399554",
"0.5637414",
"0.5597503",
"0.55822873",
"0.55736125",
"0.5571058",
"0.5559613",
"0.55535835",
"0.5537796",
"0.55349725",
"0.5523444",
"0.5514018",
"0.5510816",
"0.5510652",
"0.5510652",
"0.550258",
"0.55021614",
"0.5491634",
"0.5482142",
"0.5479111",
"0.5476799",
"0.54649115",
"0.546427",
"0.54604745",
"0.54558593",
"0.5447352",
"0.5446831",
"0.54338825",
"0.54305214",
"0.5427732",
"0.54246664",
"0.5424119",
"0.5421513",
"0.5414537",
"0.54144204",
"0.54130334",
"0.5409615",
"0.5409487",
"0.5396685",
"0.5394489",
"0.53928834",
"0.5387314",
"0.53825563",
"0.53802323",
"0.53742427",
"0.5370622",
"0.53651917",
"0.53639275",
"0.5362837",
"0.53561676",
"0.53513116",
"0.5349723",
"0.5346676",
"0.53355956",
"0.53314245",
"0.53275746",
"0.53267133",
"0.5322479",
"0.53178126",
"0.5316992",
"0.5314323",
"0.5312145",
"0.5307139",
"0.5306239",
"0.5303266",
"0.53029597",
"0.5301813",
"0.53017443",
"0.5301183"
] | 0.0 | -1 |
envelope_id is Docusign Envelope's id, not id of Envelope model | def initialize(envelope_id, user_id, loan_id)
@envelope_id = envelope_id
@user = User.find_by_id(user_id)
@loan = Loan.find_by_id(loan_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_envelope\n @envelope = Envelope.find(params[:id])\n end",
"def set_envelope\n @envelope = Envelope.find(params[:id])\n end",
"def envelope\n Hancock::Request.send_get_request(\"/envelopes/#{envelope_id}\")\n end",
"def create\n @envelope = Envelope.new(params[:envelope].merge({:account_id => Docusign::Config[:account_id]}))\n\n respond_to do |format|\n if @envelope.save\n flash[:notice] = 'Envelope was successfully created.'\n format.html { redirect_to(@envelope) }\n format.xml { render :xml => @envelope, :status => :created, :location => @envelope }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @envelope.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def envelope\n get_meta(:envelope)\n end",
"def set_user_envelope\n @user_envelope = UserEnvelope.find(params[:id])\n end",
"def on_envelope(envelope)\n pass envelope\n end",
"def update\n respond_to do |format|\n if @envelope.update(envelope_params)\n format.html { redirect_to @envelope, notice: 'Envelope was successfully updated.' }\n format.json { render :show, status: :ok, location: @envelope }\n else\n format.html { render :edit }\n format.json { render json: @envelope.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_envelope_group\n @envelope_group = EnvelopeGroup.find(params[:id])\n end",
"def get_status(envelope_id)\n\t\tresponse = DocuSignSignatory::HTTP.get(\"#{self.url}/#{envelope_id}\")\n\t\treturn DocuSignSignatory::Model::EnvelopeStatus.new(JSON.parse(response.body))\n\tend",
"def envelope_params\n params[:envelope]\n end",
"def update\n @envelope = Envelope.find(params[:id])\n\n respond_to do |format|\n if @envelope.update_attributes(params[:envelope])\n flash[:notice] = 'Envelope was successfully updated.'\n format.html { redirect_to(@envelope) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @envelope.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @envelope = Envelope.new(envelope_params)\n\n respond_to do |format|\n if @envelope.save\n format.html { redirect_to @envelope, notice: 'Envelope was successfully created.' }\n format.json { render :show, status: :created, location: @envelope }\n else\n format.html { render :new }\n format.json { render json: @envelope.errors, status: :unprocessable_entity }\n end\n end\n end",
"def envelope_params\n params.require(:envelope).permit(:name)\n end",
"def destroy\n @envelope = Envelope.find(params[:id])\n @envelope.destroy\n\n respond_to do |format|\n format.html { redirect_to(envelopes_url) }\n format.xml { head :ok }\n end\n end",
"def update\n respond_to do |format|\n if @envelope.update_attributes(params[:envelope])\n format.html { redirect_to @envelope, notice: 'Envelope was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @envelope.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @envelope = Envelope.new(params[:envelope])\n\n respond_to do |format|\n if @envelope.save\n format.html { redirect_to @envelope, notice: 'Envelope was successfully created.' }\n format.json { render json: @envelope, status: :created, location: @envelope }\n else\n format.html { render action: \"new\" }\n format.json { render json: @envelope.errors, status: :unprocessable_entity }\n end\n end\n end",
"def user_envelope_params\n params.require(:user_envelope).permit(:amount, :user_id, :envelope_id)\n end",
"def envelope_identity\n @envelop_identity ||= self.class.strhex(@address[-2]) if @address\n end",
"def invoice_id\n @invoice_id if @invoice_id\n end",
"def create_docusign_envelope(box_doc_id)\n\n box_user = user_client\n\n box_file = box_user.file_from_id(box_doc_id)\n raw_file = box_user.download_file(box_file)\n temp_file = Tempfile.open(\"box_doc_\", Rails.root.join('tmp'), :encoding => 'ascii-8bit')\n\n begin\n temp_file.write(raw_file)\n temp_file.close\n\n puts \"doc client\"\n ap DOCUSIGN_CLIENT\n envelope = DOCUSIGN_CLIENT.create_envelope_from_document(\n email: {\n subject: \"Signature Requested\",\n body: \"Please electronically sign this document.\"\n },\n # If embedded is set to true in the signers array below, emails\n # don't go out to the signers and you can embed the signature page in an\n # iFrame by using the client.get_recipient_view method\n signers: [\n {\n embedded: true,\n name: 'Marcus Doe',\n email: '[email protected]',\n role_name: 'Client',\n sign_here_tabs: [{anchor_string: \"Signature:\", anchor_x_offset: '100', anchor_y_offset: '0'}]\n }\n ],\n files: [\n {path: temp_file.path, name: \"#{box_file.name}\"}\n ],\n status: 'sent'\n )\n\n session[envelope[\"envelopeId\"]] = {box_doc_id: box_file.id, box_doc_name: box_file.name}\n rescue => ex\n puts \"Error in creating envo\"\n ensure\n temp_file.delete\n end\n\n envelope\n end",
"def destroy\n @envelope.destroy\n respond_to do |format|\n format.html { redirect_to envelopes_url, notice: 'Envelope was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def index\n @envelopes = Envelope.all\n end",
"def configure_envelopes_api\n access_token = ENV['DOCUSIGN_ACCESS_TOKEN_TEMP']\n #Client API Config\n base_path = 'http://demo.docusign.net/restapi'\n configuration = DocuSign_eSign::Configuration.new\n configuration.host = base_path\n api_client = DocuSign_eSign::ApiClient.new(configuration)\n api_client.default_headers[\"Authorization\"] = \"Bearer \" + access_token\n envelopes_api = DocuSign_eSign::EnvelopesApi.new(api_client)\n end",
"def document(document_id)\n Hancock::Request.send_get_request(\"/envelopes/#{envelope_id}/documents/#{document_id}\")\n end",
"def id\n object.evss_id\n end",
"def show\n @envelope = Envelope.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @envelope }\n end\n end",
"def build_test_envelope\n Docusign::Envelope.new.tap do |e|\n doc = Docusign::Document.new\n tabs = doc.tabs do |d| \n d.tab :name => 'Make'\n d.tab :name => 'Model'\n d.tab :name => 'VIN'\n end\n \n e.tabs = tabs\n \n e.recipients = [\n Docusign::Recipient.new.tap do |r|\n r.template_required = true\n r.type = Docusign::RecipientTypeCode::Signer\n r.template_locked = true\n r.role_name = 'Insured'\n r.user_name = \"Mike Borozdin\"\n end\n ]\n end\n end",
"def _id; @doc['_id']; end",
"def _id; @doc['_id']; end",
"def getDocumentId() \n @obj.getDocumentId() \n end",
"def destroy\n @envelope.destroy\n\n respond_to do |format|\n format.html { redirect_to :root }\n format.json { head :ok }\n end\n end",
"def document_id\n id\n end",
"def invoice\n params['TxId']\n end",
"def add_envelope(message)\n #puts \"Adding envelope\"\n generator.wrap(message)\n end",
"def update_status_from_docusign\n current_status = Docusign::CheckEnvelopeStatus.new(envelope.envelope_id).call\n envelope.update(status: current_status) if current_status\n end",
"def envelope(data)\n return data if options[:envelope].blank?\n { options[:envelope].to_s => data }\n end",
"def envelope\r\n Envelope.from_points(bounding_box,srid,with_z)\r\n end",
"def actor_signature_id\n self.id\n end",
"def get_recipients(envelope_id)\n\t\tresponse = DocuSignSignatory::HTTP.get(\"#{self.url}/#{envelope_id}/recipients\")\n\t\treturn JSON.parse(response.body)\n\tend",
"def embedded_response\n utility = DocusignRest::Utility.new\n\n if params[:event] == \"signing_complete\"\n if @loan.secondary_borrower && @loan.secondary_borrower.user.id != params[:user_id]\n recipient_view = DocusignRest::Client.new.get_recipient_view(\n envelope_id: params[:envelope_id],\n name: \"#{@loan.secondary_borrower.user.first_name} #{@loan.secondary_borrower.user.last_name}\",\n email: @loan.secondary_borrower.user.email,\n return_url: embedded_response_electronic_signature_index_url(\n loan_id: params[:loan_id],\n envelope_id: params[:envelope_id],\n user_id: @loan.secondary_borrower.user.id\n )\n )\n\n return redirect_to recipient_view[\"url\"] if recipient_view\n end\n\n @loan.submitted!\n rental_properties = Property.where(is_primary: false, is_subject: false, loan: @loan)\n @loan.borrower.update(other_properties: JSON.dump(rental_properties.as_json(Property.json_options))) if rental_properties.present?\n\n # TODO: why call two services below:\n Docusign::MapEnvelopeToLenderDocument.new(params[:envelope_id], params[:user_id], params[:loan_id]).delay.call\n RatesComparisonServices::Base.new(params[:loan_id], params[:user_id]).call\n render text: utility.breakout_path(\"/my/dashboard/#{params[:loan_id]}\"), content_type: 'text/html'\n elsif params[:event] == \"ttl_expired\"\n # the session has been expired\n else\n render text: utility.breakout_path(\"/my/dashboard/#{params[:loan_id]}\"), content_type: 'text/html'\n end\n end",
"def other_claim_related_id\n end",
"def envelopes(from_date, options = {})\n Docusigner::Envelope.find(:all, :params => options.reverse_merge({:account_id => id, :from_date => from_date}))\n end",
"def id\n\t\t\t\treturn self.venue['id'].to_i\n\t\t\tend",
"def id\n self.doc_id\n end",
"def envelope_key\n 'billing_request_flows'\n end",
"def new\n @envelope = Envelope.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @envelope }\n end\n end",
"def subscription_id\n @event.attributes[:subscription_id]\n end",
"def set_incominginvoice\n @incominginvoice = Incominginvoice.find(params[:id])\n end",
"def agreement_documents(agreement_id, recipient_email, format, version_id=nil)\n result = Echochamber::Request.agreement_documents(token, agreement_id, recipient_email, format, version_id)\n end",
"def create\n return render nothing: true, status: 200 if Rails.env.test?\n RateServices::UpdateLoanDataFromSelectedRate.call(params[:id], params[:fees], lender_params, params[:thirty_fees], params[:prepaid_fees])\n @loan.reload\n\n envelope = Docusign::CreateEnvelopeService.new.call(current_user, @loan)\n recipient_view = DocusignRest::Client.new.get_recipient_view(\n envelope_id: envelope['envelopeId'],\n name: \"#{current_user.first_name} #{current_user.last_name}\",\n email: current_user.email,\n return_url: embedded_response_electronic_signature_index_url(\n loan_id: params[:id],\n envelope_id: envelope['envelopeId'],\n user_id: current_user.id\n )\n )\n\n if recipient_view\n render json: {message: recipient_view}, status: 200\n else\n render json: {message: t(\"errors.iframe_render_error\")}, status: 500\n end\n end",
"def envelope\n raise Error::UnsupportedOperation, \"Method Geometry#envelope not defined.\"\n end",
"def set_contract_document\n @contract_document = ContractDocument.find(params[:id])\n end",
"def name\r\n return \"AedgK12EnvelopeAndEntryInfiltration\"\r\n end",
"def id\r\n @ole.txn_id\r\n end",
"def envelope_key\n 'mandate_imports'\n end",
"def document_id\n version_id\n end",
"def id\n reply.documents[0][ID]\n end",
"def redirect_preview_url\n @agreement = Agreement.find(params[:id])\n preview_url = @agreement.preview_url\n envelope_id = @agreement.envelope_id\n\n #env variables\n access_token = ENV['DOCUSIGN_ACCESS_TOKEN_TEMP']\n account_id = ENV['DOCUSIGN_ACCOUNT_ID']\n\n #Add access token to header\n response.headers[\"Authorization\"] = \"Bearer \" + access_token\n\n #Create Random API Call\n envelopes_api = configure_envelopes_api\n envelope_ids_request = DocuSign_eSign::EnvelopeIdsRequest.new(\n envelopeIds: [envelope_id.to_s]\n )\n\n options = DocuSign_eSign::ListStatusOptions.new\n options.from_date = (Date.today - 1).strftime(\"%Y/%m/%d\")\n\n begin\n results = envelopes_api.list_status(account_id, envelope_ids_request, options)\n puts results\n rescue DocuSign_eSign::ApiError => e\n puts e\n end\n\n redirect_to preview_url\n end",
"def request_id; end",
"def inbox_id\n @attributes[:inbox_id]\n end",
"def _appointment_request_id\n appointment_request_id\n end",
"def envelope_key\n 'redirect_flows'\n end",
"def show\n @transactions = @envelope.transactions if @envelope.present?\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @envelope }\n end\n end",
"def set_oa_sent_document\n @oa_sent_document = Oa::SentDocument.find(params[:id])\n end",
"def get_doc_id(notification)\n notification[\"id\"]\nend",
"def new\n @envelope = Envelope.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @envelope }\n end\n end",
"def set_envelope( val )\n @raw_envelope = val\n @envelope = Mail::Envelope.new( val )\n end",
"def id\n @document.fetch('id')\n end",
"def transaction_id\n params['subscr_id']\n end",
"def order_docusign\n\n fileId = params[:file_id]\n envelope_response = create_docusign_envelope(fileId)\n\n # set up docusign view, fetch url\n recipient_view = DOCUSIGN_CLIENT.get_recipient_view(\n envelope_id: envelope_response[\"envelopeId\"],\n name: \"Marcus Doe\",\n email: \"[email protected]\",\n return_url: docusign_response_order_url(envelope_response[\"envelopeId\"])\n )\n\n @url = recipient_view[\"url\"]\n end",
"def set_goods_signing\n @goods_signing = GoodsSigning.detail_by_id params[:id]\n end",
"def invoice\n\tparams['invoice']\n end",
"def voicemail(id)\n self.helper('voicemail',id)\n return @doc.to_s\n end",
"def set_adverse_event\n @adverse_event = AdverseEvent.find(params[:id])\n end",
"def id\n doc['_id']\n end",
"def transaction_id\r\n params['PayRef'] \r\n end",
"def record_id\n doc['record_id']\n end",
"def invoice\n @ipn['invoice']\n end",
"def recipients\n Hancock::Request.send_get_request(\"/envelopes/#{envelope_id}/recipients\")\n end",
"def key_id; end",
"def set_cert_signing_request\n @csr = CertSigningRequest.find(params[:id])\n end",
"def invoice\n SalesEngine::Invoice.find_by_id(self.invoice_id)\n end",
"def endorsement_certificate\n @ecert\n end",
"def invoice\n params['txnid']\n end",
"def invoice\n params['txnid']\n end",
"def set_invoice\n # @invoice = Invoice.find(params[:id])\n end",
"def company_id\n self.dig_for_string(\"agentSummary\", \"office\", \"companyId\")\n end",
"def endorsement_certificate\n \n end",
"def message_id; @message_impl.getMessageId; end",
"def set_document_tag\n @issuer_document_tag = IssuerDocumentTag.find(params[:id])\n end",
"def response_id\n self['id']\n end",
"def id\n @message[:id]\n end",
"def get_invoice_by_id(invoice_id)\n get_invoice(invoice_id)\n end",
"def destroy\n @invoice = current_organization.invoices.find(params[:id])\n @invoice.destroy\n \n redirect_to(invoices_url)\n end",
"def invoice\n params['invoice']\n end",
"def invoice\n params['invoice']\n end",
"def agreement_info(agreement_id)\n Echochamber::Request.agreement_info(token, agreement_id)\n end",
"def audience\n @campaign = Campaign.find(params[:id])\n end",
"def set_invoice\n @invoice = Mjbook::Invoice.where(:id => params[:id]).first\n end",
"def compound_id\n \"#{self.exhibit_id}-#{self.id}\"\n end"
] | [
"0.76314896",
"0.76314896",
"0.7184735",
"0.6776781",
"0.64655334",
"0.6435949",
"0.6395554",
"0.6277619",
"0.6240799",
"0.62350273",
"0.6221541",
"0.61814845",
"0.6115929",
"0.60948414",
"0.6094628",
"0.6092403",
"0.6077406",
"0.6011774",
"0.59982336",
"0.587575",
"0.57758236",
"0.57503206",
"0.5737291",
"0.5728662",
"0.5709158",
"0.56824493",
"0.56430244",
"0.5611352",
"0.5593067",
"0.5593067",
"0.55634946",
"0.5559493",
"0.55583173",
"0.553861",
"0.5526488",
"0.54703134",
"0.5460996",
"0.54532206",
"0.5417552",
"0.5413495",
"0.540395",
"0.53205943",
"0.53149015",
"0.53080237",
"0.5305583",
"0.52902025",
"0.5285132",
"0.5260344",
"0.5257942",
"0.5230962",
"0.52260643",
"0.5221861",
"0.52082115",
"0.5206127",
"0.52030164",
"0.519519",
"0.51895976",
"0.5186747",
"0.5165682",
"0.5163463",
"0.51283187",
"0.5124622",
"0.51219845",
"0.50960886",
"0.50812805",
"0.50745434",
"0.50739783",
"0.5056957",
"0.5050225",
"0.5044952",
"0.5037964",
"0.50261164",
"0.50234425",
"0.50209665",
"0.50034165",
"0.49963933",
"0.49953815",
"0.49933234",
"0.49839187",
"0.4973859",
"0.49736917",
"0.49712554",
"0.496869",
"0.49559113",
"0.4949173",
"0.4945994",
"0.49440765",
"0.49271938",
"0.4922537",
"0.49056795",
"0.49050456",
"0.49025849",
"0.4901187",
"0.4897865",
"0.48961848",
"0.4891778",
"0.4891778",
"0.48917577",
"0.4886578",
"0.48839247",
"0.48821232"
] | 0.0 | -1 |
Gets the user input, converts it to integer and checks if its within 18. If its not within that range, the method calls itself again. | def input_range
input = STDIN.getch
print input
sleep(0.17) #to see player input on console
if input.to_i>0 && input.to_i<9
$col = input.to_i-1
elsif input == "x"
print "\n\n\n"
exit
else
print "\n\n\tWrong input! Press key between 1 and 8.\n\n\tPlayer ", $x_or_o, " > "
input_range()
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def age_validator\n puts \"whats your characters age\" \n age = gets.strip.to_i \n until age > 16 #checks to see if age is a number \n begin \n if age >! 16\n end\n rescue #rescues if there is an error because its not an integer \n puts \"Input must be a valid number above 16, Try Again\"\n age = gets.strip.to_i\n end\n end\n return age\nend",
"def valid_recipe_choice(input)\n input.to_i.between?(1,10)\n end",
"def find_your_age\n\tputs(\"How old are you?\")\n\tuser_age = gets.strip.to_i\n\tif user_age >= 21\n\t\tputs(\"Yay, have a beer!\")\n\telse\n\t\tputs(\"Nay, don't have a beer!\")\n\tend\n\tputs(\"And that's all folks!\")\nend",
"def range\n puts \"Now that we have your location, how many miles are you willing to drive? Please enter a milage from the following list (25, 50, 75, 100, 150, 200, 250, 300, any:\"\n @range = gets.strip\n if @range.include?(25, 50, 75, 100, 150, 200, 250, 300, \"any\")\n puts \"Thank you!\"\n else\n puts \"Please choose a value from the following list (25, 50, 75, 100, 150, 200, 250, 300, any):\"\n @range\n end\n end",
"def enter_age(age)\n # Do a loop until user inputs correct value\n while true do\n puts \"Please enter age\"\n age = gets.chomp.to_i\n age < 18 || age > 99 ? \"Not valid\" : break\n end\n age\n end",
"def check_age(age)\n if age == \"quit\"\n puts \"bye!\"\n else\n age = age.to_i\n case age\n when 0...18\n puts \"You can do nothing\"\n when 18...21\n puts \"I can vote\"\n puts \"I can smoke\"\n when 21...25\n puts \"I can vote\"\n puts \"I can smoke\"\n puts \"I can drink\"\n when 25..100\n puts \"I can vote\"\n puts \"I can smoke\"\n puts \"I can drink\"\n puts \"I can rent a car\"\n else\n puts \"hmm?\"\n puts age == 12\n end\n\n puts \"\\nHow old are you?\"\n check_age(gets.chomp)\n end\nend",
"def valid_choice(range)\n choice = gets.chomp.to_i\n until (1..range).include?(choice)\n print \"Please enter a valid choice: \"\n choice = gets.chomp.to_i\n end\n return choice\nend",
"def choice(range)\n input = \"\"\n loop do\n input = gets.chom\n if (input.to_i <= (range - 1)) && integer?(input)\n break\n elsif input == 'a'\n break\n else\n print 'chosen number is not within the range. '\n + 'Please choose again witch correct number: '\n end\n end\n input\nend",
"def gold_room()\n\tputs \"This room is full of gold. How much do you take?\"\n\tprompt; next_move = gets.chomp\n\n\tif next_move.to_i.to_s == next_move # check if the input is a number, convert to string and compare with the original input\n\t\thow_much = next_move.to_i()\n\telse\n\t\tdead(\"Man, learn to type a number.\")\n\tend\n\n\tif how_much < 50\n\t\tputs \"Nice, you're not greedy, you win!\"\n\t\tProcess.exit(0)\n\telse\n\t\tdead(\"You greedy bastard!\")\n\tend\n\nend",
"def check_times(input, input_int)\n if input_int < 8\n puts \"You must book after 08:00\"\n elsif input_int > 15\n puts \"You must book before 15:00\"\n else\n times = Times.new.parsing_file\n booking = Booking.new.book_slot(input, times)\n end\nend",
"def num_range()\n puts \"Enter a number: \"\n num = gets.chomp.to_i\n if num < 0\n \"#{num} is less than 0, please enter a positive number!\"\n elsif num <= 50\n \"#{num} is between 0 and 50\"\n elsif num <= 100\n \"#{num} is between 50 and 100\"\n else\n \"#{num} is greater than 100\"\n end\nend",
"def int_input(s = \"\\nPlease select an option:\".yellow.bold, limits = [1, 100])\n puts s\n user_input = gets.chomp\n #if user types 'exit', exit the application\n if user_input.downcase == \"exit\"\n exit()\n end\n\n #if user input is within allowed range, return it, otherwise, ask for it again\n if user_input.to_i >= limits[0] and user_input.to_i <= limits[1]\n return user_input.to_i\n else\n puts(\"Invalid input, please enter an integer value coresponding to an option, or type 'exit' to exit application:\".red.bold)\n sleep(1)\n return int_input(s, limits)\n end\n end",
"def character_request(number)\n loop do\n puts \"Would you like to see the cast? If so, please enter the corresponding number!\"\n input = gets.chomp\n\n if input.to_i <= number && input.to_i > 0\n return input.to_i\n else\n puts \"Invalid Input!\"\n end\n\nend\nend",
"def get_user_input(question, range = nil)\n print \"\\n#{question} : \"\n user_response = gets.chomp\n\n if range === nil then\n # check whether the user input is empty\n while user_response.empty? do\n print \"\\nError! You entered a wrong input!\" +\n \"\\n#{question} : \"\n user_response = gets.chomp\n end\n else\n # check whether the user input is an integer and also it is within the given range\n unless user_response.to_i.is_a?(Integer) && user_response.to_i.between?(0, range - 1)\n print \"\\nError! You entered a wrong input!\" +\n \"\\n#{question} : \"\n user_response = gets.chomp\n end\n end\n\n user_response\n end",
"def get_goal(avg)\n puts \"Your daily intake should be around #{avg}\"\n puts \"What is your goal?\"\n goal = (gets.chomp).to_i\n# Warn user if goal is over +- 200 \n if goal > (avg + 200)\n puts \"Your goal is above the daily average\"\n elsif goal < (avg - 200)\n puts \"Your goal is below the daily average\"\n else\n puts \"Good goal! You can do it!\"\n end\n goal\nend",
"def verify(x)\n\ty = 1\n\twhile y == 1\n\t\tif x.is_a?(Integer) && x > 0 && x < 10 #need to fix this. Still able to take non integers like 1.5\n\t\t\treturn x\n\t\t\ty-=1\n\t\telse\n\t\t\tputs \"Try again - number must be 1 through 10 and an integer\"\n\t\t\tx = gets.chomp.to_i\n\t\tend\n\tend\nend",
"def gold_room\n puts \"This room is full of gold. How much do you take?\"\n\n print \"> \"\n choice = $stdin.gets.chomp\n\n if choice.include?('0') || choice.include?('1')\n how_much = choice.to_i\n else\n dead(\"Man, learn to type a number.\")\n end\n\n if how_much < 50\n puts \"Nice, you're not greedy, you win!\"\n exit(0)\n else\n dead(\"You greedy bastard!\")\n end\nend",
"def receive_int(question, min, max)\n answer = receive_answer(question)\n while answer != answer.to_i.to_s or\n (answer == answer.to_i.to_s and (answer.to_i < min or answer.to_i > max))\n puts \"Please enter an integer between #{min} and #{max}.\"\n answer = receive_answer(question)\n end\n return answer.to_i\nend",
"def choose_number\n\t\tputs \"Choose a number between 1-10\"\n\t\t$input = gets.chomp.to_i\n\t\tif $input > 10 || $input < 1\n\t\t\tputs \"Invalid number. Please use a number between 1-10\"\n\t\t\tchoose_number\n\t\tend\n\tend",
"def valid_input?(input)\n if input.between?(0, 8) == true\n return true\n else \n return false;\n end \n end",
"def cheat\n puts 'What number do you want to roll?'\n\tnumber = gets.chomp.to_i\n\tif number >= 1 && number <= 6\n\t @number_showing = number\n\telse\n\t puts 'Cheater!!!'\n end\n @number_showing\t\n end",
"def check_number\n puts \"Enter a number...\"\n number = gets.chomp.to_i\n if(number >= 0 && number <= 50)\n puts \"between 0 and 50\"\n elsif(number >= 51 && number <=100)\n puts \"between 51 and 100\"\n elsif(number > 100)\n puts \"greater than 100\"\n else\n puts \"something else\"\n end\nend",
"def validate_concert_number_input\n input = gets.chomp\n # if user makes an accetable concert choice, they are walked through ticket purchase options.\n if input.to_i > 0 && input.to_i < Concert.count\n input.to_i\n elsif input == \"exit\"\n exit_screen\n else\n unrecognized_input\n end\n end",
"def number_validation (input)\n eval_num = nil \n until eval_num == \"Pass\" do\n # transforms a copy of the user input to check against the original value\n input_v = input.to_f*100\n input_v = input_v.to_i.to_s\n input_w = input.delete(\".\")\n if input == input.to_f.to_s\n eval_num = \"Pass\"\n elsif input == input.to_i.to_s\n eval_num = \"Pass\"\n elsif input_v == input_w \n eval_num = \"Pass\"\n else\n print \"Oh nos! You entered some non-number character. Enter a new one: \"\n input = gets.chomp\n end\n end \n return input\nend",
"def user_number\n puts 'enter your number'\n numb1 = gets.chomp!.to_i\n if numb1 <= 50\n puts 'your number is equal to or less than 50'\n elsif numb1 == 51\n puts 'you number must be 51'\n elsif numb1 <= 100\n puts 'you number is equal to or less than 100'\n else\n 'puts you got a high number'\n end\n end",
"def ask\n question = 'Enter a number between 0 to 100'\n puts question\n number = gets.to_i\n between(number)\nend",
"def guess\n number = 22\n guess = gets.to_i\n if guess > number\n p 'too high!'\n guess\n elsif guess < number\n p 'too low!'\n guess\n else\n p 'you got it.'\n end\nend",
"def ask_user\n puts 'enter a number:'\n input = gets.chomp.to_i\n check_num(input)\n end",
"def choose_vehicle_price\n puts \"Enter new price\"\n @new_price = gets.chomp.to_i\n if !@new_price.is_a? Numeric\n puts Rainbow(\"This value is invalid. Please try again.\").red.bold\n choose_vehicle_price\n end\nend",
"def check_num(input)\n @num_attempts += 1\n if input == @secret_num\n @game_over = true\n puts 'you win'\n elsif input > @secret_num\n puts 'too big'\n else\n puts 'too small'\n end\n end",
"def validate(input_selection, num_stops, msg)\n puts \"you selected #{input_selection}\"\n puts \"there are #{num_stops} on this line\"\n\n if input_selection.between?(1, num_stops)\n bool = 1\n puts \" in first if: i.sel = #{input_selection} and numstops = #{num_stops}\"\n else\n bool = 0\n puts \"else returned boo = 0\"\n end\n while bool > 0\n puts \"Error, Invalid Entry\"\n puts \"#{msg}\"\n try_again = gets.chomp.to_i\n if try_again.between?(1, num_stops)\n bool = 0\n puts \"bool = 0 in nested if statement\"\n else\n bool = 1\n end\n end\n\n #return input_selection\nend",
"def gold_room\n puts \"This room is full of gold. How much do you take?\"\n\n print \"> \"\n choice = $stdin.gets.chomp\n\n # this line has a bug, so fix it\n if choice.include?(\"0\") # Write a regular expression here\n how_much = choice.to_i\n else\n dead(\"Man, learn to type a number.\")\n end\n\n if how_much < 50\n puts \"Nice, you're not greedy, you win!\"\n exit(0)\n else\n dead(\"You greedy bastard!\")\n end\nend",
"def valid?(value)\n return value >= 0 && value <= 19\n end",
"def num_check(num)\n until num.to_i.to_s == num\n puts \"Invalid entry. Please entere an integer.\"\n num = gets.chomp.to_i\n end\n return num.to_i\nend",
"def check_vote_age(age)\n if age >= 18\n puts \"You are eligible to vote\"\n else\n puts \"You are not eligible to vote.\"\n end\nend",
"def num_check (num)\n if\n num >= 1 && num <=10\n puts \"Valid\"\n else\n puts \"Invalid\"\n end\nend",
"def check_input_range\n if @position > 9 || @position < 1\n return false\n else return true\n end\n end",
"def mag_input(number)\n if number<=50\n return 'Number less than 50....weak'\n elsif number<=100\n return 'Number between 50 and 100...not bad'\n else\n return 'Dude...follow the rules. Number is too big.'\n end\nend",
"def number_range(num)\n if num < 0\n puts \"Please enter a positive number only\"\n elsif num <= 50\n puts \"Range 0 - 50\"\n elsif num <= 100\n puts \"Range 51 - 100\"\n else\n puts \"Above 100\"\n end\nend",
"def prompt_i(lower, upper)\n loop do\n print \"[Enter an integer in the range #{lower}-#{upper}]\"\n print \"> \"\n input_str = @input.gets\n if input_str.nil?\n raise \"No input left (must be automated input)\"\n end\n input_str = input_str.chomp\n input_int = input_str.to_i\n if input_int.between?(lower, upper)\n return input_int\n else\n print \"[Invalid integer range]\"\n end\n end\n end",
"def valid_input?(input)\n input.between?(1,Anime.all.size)\n #input <= 1 && >= 10\n end",
"def ask_for_guess(min, max)\n puts \"Guess a number #{min} to #{max}?\"\n\n guess = gets.to_i\n while guess < min or guess > max\n puts \"Your number must be greater than #{min} and less than #{max}. Guess again.\"\n guess = gets.to_i\n end\n \n guess\nend",
"def under_13?\n age.nil? || age.to_i < 13\n end",
"def valid_move?(input)\n puts \"#{input}\"\n input.to_i.between?(1,9) && !taken?(input)\n end",
"def input_valid?(input)\n begin\n input = Integer(input)\n rescue ArgumentError\n return false\n end\n\n input.between?(0, 9) ? true : false\n end",
"def pick_filter(min, max, add_quit = true)\n guide_msg = \"Valid values are from #{min} to #{max}\"\n if add_quit\n guide_msg += \" or 'q' to quit\"\n end\n retval = nil\n entered_valid = false\n atmps = 0\n integer_pattern = /[0-9]+/\n while ! entered_valid do\n user_input = $stdin.gets.chomp.downcase\n if (user_input == 'q' && add_quit) || (atmps > 7)\n puts \"Exiting!\"\n exit(0)\n end\n if user_input =~ integer_pattern\n entered_value = user_input.to_i\n if entered_value >= min && entered_value <= max\n retval = entered_value\n entered_valid = true\n end\n end\n if ! entered_valid\n puts guide_msg\n end\n atmps += 1\n end\n return retval\n end",
"def check_age(age)\n\traise ArgumentError, \"Enter Positive Number\" unless age >0\nend",
"def validadorChute(chute)\n if chute == \"0\"\n return true\n elsif chute.to_i > 0 && chute.to_i <= 100\n return true\n else\n return false\n end\nend",
"def gold_room()\n puts \"This room is full of gold. How much do you take?\"\n\n next_move = prompt\n\n if numeric?(next_move)\n how_much = next_move.to_i()\n else\n dead(\"Man, learn to type a number.\")\n end\n\n if how_much < 50\n puts \"Nice, you're not greedy. You win!\"\n Process.exit(0)\n else\n dead(\"You greedy bastard\")\n end\nend",
"def choose_city\n puts \" \"\n puts \"Please enter the number of the city you would like to learn more about 1-17 and hit enter.\"\n puts \" \"\n \n input = gets.strip.to_i \n \n if input.between?(1,17)\n category = input-1\n display_city_desc (category)\n submenu\n else\n puts \"Invalid number.\"\n list_cities\n choose_city\n end \n end",
"def secret_number\n guess = Integer gets rescue nil\n if guess < 5\n puts \"too low\"\n elsif guess > 5\n puts \"too high\"\n else\n puts \"wowowow\"\n end\n end",
"def check_position_int(input)\n step = input[:step]\n position = step[:position].to_i\n\n if (1..9).include?(position)\n Success(input)\n else\n Failure('Position should be in interval 1..9')\n end\n end",
"def gold_room\n puts \"This room is full of gold. How much do you take?\"\n\n print \"> \"\n # This will get input from the user and do something with it. The $stdin doesn't appear to be necessary but is needed when you're passing arguments in via the terminal so I'm happy to try and get into the habit of using it so I can use it as default.\n choice = $stdin.gets.chomp\n\n# if the choice gotten from the line above includes a 0 or a 1, it will go to the next method how_much and change the number from a string which is gained from the gets (get a string) to an integer\n if choice.include?(\"0\") || choice.include?(\"1\")\n how_much = choice.to_i\n# If the choice doesn't contain a 0 or 1 or is anything else it will call the method dead. The man learn to type... will be fed into the parameter why and return \"Man learn to...\" \" Good job\"\n else\n dead(\"Man, learn to type a number.\")\n end\n# If your input was a number containing 0 or 1 and any other numbers, it will have been turned to an integer above and if it's less than 50 it will output the \"Nice not greedy... \" and end the script\n if how_much < 50\n puts \"Nice, you're not greedy, you win!\"\n exit(0)\n # IF your number was greater than 50 then it runs the dead method and feeds the \"greedy bastard\" into the why parameter outputting \"greedy bastard\" \"Good job\"\n else\n dead(\"You greedy bastard!\")\n end\nend",
"def number_check(number)\n if number < 0\n puts \"Your number is less than 0\"\n elsif number <= 50\n puts \"Your number is between 0 and 50\"\n elsif number <= 100\n puts \"Your number is between 50 and 100\"\n else\n puts \"Your number is greater than 100\"\n end\nend",
"def verify(input)\n until number_check(input)\n puts \"Please enter a number!\"\n input = gets.chomp\n end\n return input.to_f\nend",
"def evaluate_number(number)\n if number >= 0 && number <= 50\n puts \"Your number is between 0 and 50\"\n elsif number > 50 && number <= 100\n puts \"Your number is between 51 and 100\"\n elsif number > 100\n puts \"Exercise is written poorly and says to report back if number is over 100.\"\n else\n puts \"You did not enter a number between 0 and 100.\"\n end\nend",
"def get_character_choice\n puts \"Please choose 1-5 to learn more about that character or type 'Let it go' to exit.\"\n input = gets.chomp\n if input.to_i.between?(1,5)\n display_character_info(input) \n start \n elsif input == \"Let it go\"\n exit_prg \n end \n end",
"def valid_move?(input)\n !taken?(input) && input.to_i.between?(1, 9)\n end",
"def num_range ()\n puts \"Enter number\"\n number = gets.chomp.to_i\n case \n when number < 0\n puts \"Nope\"\n when number <= 50\n puts \"Between 0 and 50\"\n when number <= 100\n puts \"between 50 and 100\"\n else\n puts \"Over 100\"\n end\nend",
"def take_booking\n puts \"How many people will be in your party?\"\n answerBooking = gets.chomp.to_i\n\n if @capacity >= answerBooking\n true\n @capacity = @capacity - answerBooking\n # Test to see if capacity counter is working # puts \"we have #{@capacity} left\"\n else\n false\n puts \"We cannot fit that many people at this point in time.\"\n puts \"The maximum number of dinners is #{@capacity}\"\n end\n # what time\n end",
"def check(number1)\n\ncase\n\nwhen number1 < 0\n puts \"please enter a positive number\"\nwhen number1 > 100\n puts \"please enter a number below 100\"\nwhen number1 >50\n puts \"your number is between 51 and 100\"\nelse\n puts \"your number is between 0 and 50\"\nend\nend",
"def validate_round(input)\n if input < 1 || input > 10\n false\n else\n true\n end\n end",
"def is_of_age? age, minimum_age\n check = (minimun_age.to_i) - (age.to_i)\n check >= 0\nend",
"def check_answer_input(range) #this method both prints and checks the answer\r\n\r\n\tequation = new_equation(range)\r\n\tanswer = false\r\n\r\n\twhile answer == false\r\n\t\tputs equation\r\n\t\tresult = eval equation\r\n\t\tputs \"{answer: #{result}}\"\r\n\t\tanswer_user = gets.chomp\r\n\r\n\t\tif answer_user.downcase == \"q\" #make a new method for if ??? - yes, I would make a new method\r\n\t\t\texit\r\n\t\telsif answer_user.to_i == result\r\n\t\t\tputs \"Correct!\"\r\n\t\t\tcheck_answer_input(range)\r\n\t\telse\r\n\t\t\tputs \"Try again\"\r\n\t\tend\r\n\tend\r\nend",
"def initialization_round?\n gets.to_i < 0\nend",
"def check_valid_gid(answer)\n correct = 1\n if answer.match(/[A-z]/)\n correct = 0\n else\n if Integer(answer) < 10\n correct = 0\n puts \"GID must be greater than 10\"\n end\n end\n return correct\nend",
"def get_user_age\n # chomp removes the end of line character\n user_input = gets.chomp\n user_input.to_i\nend",
"def num_between_if number\n if number >= 0 && number <= 50\n puts \"#{number} is between 0 and 50\"\n elsif number >= 51 && number <= 100\n puts \"#{number} is between 51 and 100\"\n elsif number > 100\n puts \"Hey, wait a minute, #{number} is greater than 100!\"\n else\n puts \"Hey, what's the big deal, #{number} is less than 0!\"\n end\nend",
"def get_number\nprint \"What number do you want to check? \"\n@number = gets.to_i\nend",
"def check_if_over_17(hand_total)\n if hand_total[1] === 999\n if hand_total[0] >= 17\n return true\n end\n\n else\n if hand_total[0] >= 17 || hand_total[1] >= 17\n return true\n end\n\n end\n\n return false\n\nend",
"def mildconfusion number\t\n\nif number < 50\n\tputs \"Your number is is between 0 and 50\"\n\t\n\telsif number > 51 && number < 100\n\t\tputs \"Your number is between 51 and 100\"\n\t\t\n\telsif number > 100\n\t\tputs \"Your number is greater than 100\"\n\t\t\n\tend\nend",
"def check_num(num)\n@num_attempts+=1\n\nif num==@secret_num\n@game_over=true\np \"you win\"\nelsif num>=@secret_num\n p \"too big\"\nelse\n p \"too small\"\nend\n\nend",
"def is_valid_input(input)\n return (input.to_i.to_s == input) && ((1..100).to_a.count(input.to_i) > 0)\nend",
"def valid_input?(input)\n return false unless input =~ /\\A\\d+\\Z/\n return false unless input.to_i > 0 and input.to_i < 4000\n true\n end",
"def numbers(number) \n if number <= 50\n puts \"Your input value is #{number}. That number is between 0 and 50.\"\n elsif number > 50 && number <= 100 \n puts \"Your input value is #{number}. That number is between 51 and 100.\"\n else number > 100 \n puts \"Your input value is #{number}. That number is over 100.\"\n end\nend",
"def input_test(input)\n if input =~ /[a-zA-Z]+/ || input.to_i.between?(1, 4999) == false\n return false\n else\n return true\n end\n end",
"def is_of_age? age, minimum_age\n if age.to_i < minimum_age.to_i\n return false\n else\n return true\n end\nend",
"def gold_room()\n puts \"This room is full of gold. How much do you take?\"\n\n prompt; next_move = gets.chomp \n=begin\n if next_move.include? \"0\" or next_move.include? \"1\"\n how_much = next_move.to_i()\n else\n dead(\"Man, learn to type a number.\")\n end\n\n if how_much < 50\n puts \"Nice, you're not greedy, you win!\"\n Process.exit(0)\n else\n dead(\"You greedy bastard!\")\n end\n=end \n\n#Q5.\n if is_i?(next_move) == true\n how_much = next_move.to_i()\n \n if how_much < 50\n puts \"Nice, you're not greedy, you win!\"\n Process.exit(0)\n else\n dead(\"You greedy bastard!\")\n end\n else\n dead(\"Man, learn to type a number.\")\n end\nend",
"def num_checker2\n puts \"Please choose a number\"\n num = 0\n num = gets.chomp.to_i\n case\n when num <= 50\n puts \"Number is 0-50\"\n when num <= 100\n puts \"Number is 51-100\"\n else\n puts \"Number is 100+\"\n end\nend",
"def valid_guess(guess) \n\twhile guess < 1 || guess > 10 \n\t\tputs \"Oops! Invalid number. Please guess a number between 1 and 10. What's your guess?\"\n\t\tguess = gets.to_i\n\tend\n\tok_guess = guess\nend",
"def validate_input(input)\n if(input < 1)\n return false\n end\n return true\n end",
"def function(age)\n\n\tif (age >= \"21\")\n\t\tputs(\"Yay, have a beer!\")\n\telse\n\t\tputs(\"Nay, don't have a beer.\")\n\tend\n\nend",
"def is_a_teenager?(num)\n num > 12 && num < 20\nend",
"def age_check(years)\n if years >= 21\n \tputs \"Cool, be right back with that.\"\n end\n\n if years < 21\n \tputs \"You got #{21 - years} years to go, dude.\"\n end\n end",
"def check_age(age)\n raise ArgumentError, \"Enter Positive Number\" unless age > 0\nend",
"def numrange(num)\n if num < 0\n puts \"Your number is negative\"\n elsif num <51\n puts \"Your number is between 0 and 50 inclusive\"\n elsif num <101\n puts \"Your number is between 51 and 100 inclusive\"\n else\n puts \"Your number is greater than 100\"\n end\nend",
"def get_round\n puts 'How many rounds would you like to play? (min. 1, max. 10)'\n input = gets.to_i\n validation = validate_round(input)\n if validation == true\n input\n else\n puts \"I'm sorry, that's an invalid input. Please try again.\"\n get_round\n end\n end",
"def check_range(a)\n answer = case \n when (0 < a) && (a<= 50)\n \"Number is between 0 to 50\"\n when (51 < a) && (a <= 100)\n \"Number is between 51 to 100\"\n when (100 < a )\n \"Number is above 100\" \n else\n \"invalid\" \n end\n answer\nend",
"def get_puzzle_number\n\tputs \"What puzzle(s) would you like to solve today?\"\n\tputs \"---------------------------------------------\"\n\tputs \"Please enter a number from 1-15\"\n\tinput = gets.chomp\n\ttry_again_check(input)\nend",
"def check_number(num)\n if num < 0 || num > 100\n puts \"Your number has to be between 0 and 100\"\n elsif num <= 50\n puts \"#{num} is between 0 and 50\"\n elsif num <= 100\n puts \"#{num} is beween 51 and 100\"\n end\nend",
"def get_quiz_length\n\tprint \"Enter quiz length (1 to 50): \"\n\tquiz_length = gets.chomp.to_i\n\n\tuntil quiz_length >= 1 && quiz_length <= 50\n\t\tif quiz_length < 1\n\t\t\tputs \"\\nSorry, #{quiz_length} is too low. Quiz length must be between 1 and 50, inclusive. Enter replay length: \"\n\t\t\tquiz_length = gets.chomp.to_i\n\t\telsif quiz_length > 50\n\t\t\tputs \"\\nSorry, #{quiz_length} is too high. Quiz length must be between 1 and 50, inclusive. Enter replay length: \"\n\t\t\tquiz_length = gets.chomp.to_i\n\t\tend\n\tend\n\tputs \"#{quiz_length} is a great choice!\"\n\treturn quiz_length\nend",
"def below_ten(num4)\n if num4 <= 10 && num4 >= 1\n p 'Valid'\n else\n p 'Invalid'\n end\nend",
"def valid_move?(input)\r\n input = input.to_i\r\n !(take?(input)) && input.between?(1, 9)\r\n end",
"def check_num(num)\n if num < 0\n puts \"Please enter a positive number \"\n elsif num >= 0 && num <= 50\n puts \"#{num} is between 0 and 50\"\n elsif num > 50 && num <= 100\n puts \"#{num} is between 50 and 100\" \n else\n puts \"#{num} is above 100\"\n end\nend",
"def between_numbers\n puts \"I MUST NUMBER GETS BETWEEN 0-100\"\n number = gets.chomp\n if number.to_f.to_s == number || number.to_f.to_s == number + \".0\" #check if number\n number = number.to_i\n case\n when number < 0 \n puts \"LESS THAN ZERO IS NOT BETWEEN 0-100. PERHAPS REMEDIAL READING FOR YOU?\"\n when number > 100\n puts \"THAT IS MORE THAN 100. THAT IS NOT WHAT WAS DEMANDED. NO WONDER YOUR SPECIES FAILS.\"\n when (0..50) === number\n puts \"IT IS IMPORTANT THAT YOU KNOW THAT YOUR NUMBER IS BETWEEN 0 AND 50.\"\n when (51..100) === number\n puts \"IT IS IMPORTANT THAT YOU KNOW THAT YOUR NUMBER IS BETWEEN 51 AND 100\"\n else puts \"wut\"\n end\n else puts \"NUMBER YOU ASS I CAN DO NOTHING WITH YOUR WORTHLESS STRING I'M OUT\"\n end\nend",
"def get_integer(prompt, min, max)\n expression = /[0-9]+/\n # Repeat until number within range\n number = 0 \n input = \"\" \n while number < min || number > max || input == \"\"\n # Repeat until valid number\n input = \"\"\n while input.match(expression).to_s != input || input == \"\" \n print prompt\n input = gets.chomp\n puts \"This is not a valid number!\" if input.match(expression).to_s != input || input == \"\"\n end\n number = input.to_i\n puts \"Number is too large. Maximum is #{max}.\" if number > max\n puts \"Number is too small. Minimum is #{min}.\" if number < min\n end\n return number\nend",
"def define_size_of_menu (max_valid)\n print \"How many itens would you like to see on your menu? \"\n num_of_itens = gets.chomp.to_i\n while num_of_itens < 1 || num_of_itens > max_valid\n puts \"Number invalid. Please choose from 1 to #{max_valid} itens \"\n print \"So how many itens would you like to see on your menu? \"\n num_of_itens = gets.chomp.to_i\n end\n return num_of_itens\nend",
"def get_num()\n\tp \"Give us a number, precious. But make it between 0 and 100\"\n\tnum = gets.chomp.to_i\n\tcase num\n\twhen 0..50\n\t\tputs \"the number is between 0 and 50!!\"\n\twhen 51..100\n\t\tputs \"the number is between 51 and 100!!\"\n\telse\n\t\tputs \"filthy hobbitses!! a number between 0 and 100, precious, that's what we said.\"\n\t\tget_num()\n\tend\nend",
"def where_are_you_at?\n puts \"\"\n puts Rainbow(\"*\").blue * 70\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"We are going to ask you a few basic questions, and suggest an\"\n puts \"activity for you based on your answers. This won't take long.\"\n puts \"\"\n puts \"\"\n puts \"Where are you?\"\n puts \"\"\n puts \" 1. Home\"\n puts \" 2. Work\"\n puts \" 3. Somewhere else\"\n puts \"\"\n puts \"Please enter a number.\"\n puts \"\"\n user_response = gets.strip\n self.quit if user_response == \"quit\"\n if user_response == \"1\"\n self.limit_place = \"home\"\n elsif user_response == \"2\"\n self.limit_place = \"work\"\n elsif user_response == \"3\"\n self.limit_place = \"not work or home\"\n else\n self.what_was_that?\n self.where_are_you_at?\n end\n self.how_much_time?\n puts \"\"\n end",
"def take_turn player\n puts \"#{player}, It is your turn. What position on the board would you like to mark?\"\n int_input = false\n @position = gets.to_i\n while int_input == false do\n if check_integer == false\n puts \"Input was invalid. Please try again\"\n @position = gets.to_i\n elsif check_input_range == false \n puts \"Position doesn't exist on the board. Please try again\"\n @position = gets.to_i\n else int_input = true\n end\n end\n return @position\n end",
"def how_much_longer_to_retirement\n puts \"What is your age?\"\n current_age = gets.to_i\n\n puts \"What age would you like to retire?\"\n retirement_age = gets.to_i\n\n years_to_retirement = retirement_age - current_age\n year_of_retirement = 2020 + years_to_retirement\n\n puts \"It's 2020. You will retire in #{year_of_retirement}.\"\n puts \"You only have #{years_to_retirement} years of work to go!\"\nend"
] | [
"0.71028554",
"0.6831317",
"0.6798423",
"0.6696665",
"0.6660528",
"0.6623562",
"0.65640444",
"0.65100974",
"0.6383505",
"0.6362689",
"0.63162106",
"0.6312973",
"0.62666917",
"0.625564",
"0.62399954",
"0.620319",
"0.61906004",
"0.6157034",
"0.6141155",
"0.6115535",
"0.6108404",
"0.6103178",
"0.60949",
"0.60732454",
"0.60707146",
"0.6063714",
"0.6042087",
"0.60326064",
"0.60125697",
"0.6012066",
"0.6003089",
"0.6001577",
"0.5991646",
"0.59774464",
"0.5954778",
"0.5944908",
"0.59301376",
"0.5929831",
"0.59258616",
"0.5920449",
"0.5913081",
"0.5912142",
"0.59064096",
"0.5896744",
"0.5887982",
"0.5873318",
"0.58718044",
"0.5854702",
"0.5841711",
"0.5818772",
"0.5803989",
"0.5799303",
"0.57944924",
"0.57941437",
"0.5788589",
"0.5784464",
"0.578238",
"0.5780128",
"0.5776321",
"0.5771995",
"0.57713515",
"0.5771117",
"0.57685125",
"0.57685006",
"0.5757365",
"0.574764",
"0.5744764",
"0.5741734",
"0.5738265",
"0.57358706",
"0.57347757",
"0.57315814",
"0.57228196",
"0.57117707",
"0.57092696",
"0.5705007",
"0.5697572",
"0.5690135",
"0.56885505",
"0.56882036",
"0.568759",
"0.5683626",
"0.5681366",
"0.56730497",
"0.566798",
"0.5667663",
"0.5665286",
"0.565665",
"0.56564957",
"0.56558156",
"0.56531507",
"0.5647086",
"0.5642225",
"0.56360275",
"0.56349564",
"0.56328624",
"0.5629234",
"0.56224483",
"0.5621892",
"0.56155324",
"0.5615121"
] | 0.0 | -1 |
Gets the input from player, decides which players turn it is and gets the updated game board from class "Move". In case there is no empty space in the chosen column the player can choose a different one. | def move_maker
GameBoard.print_game_board($game_board)
$move_counter+=1
$x_or_o = if $move_counter.even? then "o" else "x" end
print "\n --> Press key 1-8 to pick a column\n\n\tPlayer ", $x_or_o, " > "
input_range()
if Move.check_move == "column complete"
print "\n\n\tChoose different column!"
$move_counter-=1
sleep(1)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def input_move(column, player)\n placed = false\n return false unless (1..width).include?(column)\n\n grid.reverse_each do |row|\n if row[column - 1] == empty_cell && placed == false\n row[column - 1] = player\n placed = true\n end\n end\n placed\n end",
"def get_move_column\r\n puts \"Make your move, player #{@game_token}. Which column (0-6)?\"\r\n print \"> \"\r\n move = gets.chomp.to_i\r\n until (0..6).include?(move)\r\n puts \"Nope, try again. 0-6 only, please!\"\r\n print \"> \"\r\n move = gets.chomp.to_i\r\n end\r\n move\r\n end",
"def ask_player_for_move(player)\n print \"#{player} - enter your next move (row, column): \"\n row_col = gets.chomp\n row, col = row_col.split(\",\").map {|row_or_col| row_or_col.to_i }\n end",
"def get_player_move\n\t\tplayer_input = \"\"\n\t\tloop do\n \t\tputs \"Enter your move in form (Row A-C)(Col 1-3)\"\n \tplayer_input = gets.chomp\n \tbreak if BOARD.include?(player_input)\n \tend\n\t\tplayer_input.to_sym\n\tend",
"def player_option(board,player)\n\n puts \" Indique la columna donde desea jugar\".yellow\n option=gets.chomp.to_i\n option=option-1\n last=5\n\n if (option<0)then\n puts \"Opcion invalida, seleccione otra columna\".red\n else\n while last > -1\n if (board[last][option]==\" \") then\n board[last][option]= player\n break\n else\n last=last-1\n end\n\n if (last < 0) then\n puts \"Opcion invalida, seleccione otra columna\".red\n end\n \n end \n end\n return (board)\n end",
"def ask_player_for_move(current_player)\n\n # Player has not made a valid move yet\n played = false\n move = -1\n\n # Keep processing until a valid move is obtained\n while not played\n \n loop do\n\n # Ask the player for a move\n puts \"Player \" + current_player + \": Enter a move (1-9):\"\n\n # Get the player's response, convert the string to an integer\n move = gets.to_i - 1\n\n # Stop looping if the move is in range\n break if (move >= 0 and move <= 8)\n\n end\n\n # ----------------------------------------\n # Column Index ->\n # 0 1 2\n # +- - - - - -+\n # | 1 | 2 | 3 | 0 Row Index\n # +- - - - - -+ |\n # | 4 | 5 | 6 | 1 v\n # +- - - - - -+\n # | 7 | 8 | 9 | 2\n # +- - - - - -+\n #\n # move = \"8\".to_i - 1 = 8 - 1 = 7\n # @board.size = 3\n # col = 7 % 3 = 1\n # row = (7 - 1) / 3 = 6 / 3 = 2\n # (row, col) = (2, 1) = cell #8\n # ----------------------------------------\n\n # Convert the number 1-9 into a column 0-2\n # i.e., determine the column index\n column = move % @board.size\n\n # Convert it into a row\n # i.e., determine the row index\n row = (move - column) / @board.size\n\n # Valid position; i.e., valid coordinates?\n # (3. Make sure the move is valid)\n if validate_position(row, column)\n\n # Yes, move the player's piece to this position\n # (4. Store the current move)\n @board[row][column] = current_player\n\n # Success, the player's turn is complete\n played = true\n\n end\n\n end\n\n end",
"def turn\n input = current_player.move(board)\n\n if board.valid_move?(input)\n board.update(input, current_player)\n board.display\n else\n turn\n end\n end",
"def run\n while(!@game_over)\n valid_input = false\n input_column = -1\n \n display_board\n puts \">>> Player #{@player}'s turn.\"\n \n # Repeatedly prompts the user for input until valid input is given\n while(!valid_input)\n input_column = prompt\n \n # Requests input again if the input given is invalid\n valid_input = true if((0..6).include? input_column)\n if(!valid_input)\n puts \"Invalid input! Please try again.\"\n next\n end\n \n # Requests input again if the specified column is already full\n valid_insertion = insert_at(input_column, @player)\n if(!valid_insertion)\n puts \"\\nERROR: The column is already full! Please try again.\" \n valid_input = false\n end\n end\n \n # Check to see if game is won\n break if(win_condition_met?(@player))\n \n # Swap players after each turn\n if(@player == 1)\n @player = 2\n elsif(@player == 2)\n @player = 1\n end\n \n end\n \n display_board\n puts \">>> Player #{@player} has won!!! <<<\"\n end",
"def player_move\n\t \tvalid_move = false\n\t \twhile !valid_move\n\t \t\tdisplay_game\n\t \t\trow_choice = 0\n\t \t\tstick_choice = 0\n\t\t # get the user selections\n\t\t valid_input = false\n\t\t puts \"Enter the row (1-#{@current_config.length}): \"\n\t\t row_choice = gets.chomp.to_i - 1\n\t\t puts \"Enter the number of sticks (1-#{@current_config[row_choice]}): \"\n\t\t stick_choice = gets.chomp.to_i \n\t\t valid_move = validate_move row_choice, stick_choice, true # validate selections\n\t \tend\n\tend",
"def turn\n # move_value = current_player.move(board)\n # if !board.valid_move? move_value\n # turn\n # else\n # board.update(move_value, current_player)\n # move_value\n # end\n # end\n\n input = current_player.move(board)\n if board.valid_move?(input)\n board.update(input, current_player)\n board.display\n else\n turn\n end\n end",
"def play choice, player\n puts \"#{player}'s turn\"\n print \"Enter the input: \"\n input = gets.chomp.split(\",\")\n valid_input_arr = input.filter { |item| item.to_i <= 3 && item.to_i > 0 }\n while input.length != valid_input_arr.length\n puts \"wrong format! Insert the entries in the form: x, y. (where x => row, y => column)\"\n print \"Enter the input: \"\n input = gets.chomp.split(\",\")\n valid_input_arr = input.filter { |item| item.to_i <= 3 && item.to_i > 0 }\n end\n @board[(input[0].to_i) - 1][(input[1].to_i) - 1] = choice\n display_board\n end",
"def player_turn(player)\n\t\tputs \"it is \" + player + \"'s turn!\"\n\t\tinput = ask(\"Choose a column (1-7): \", Integer){ |q| q.in = 1..7}\n\t\tplayer_column = input - 1 #subtracted 1 so that it corresponds with the right array index, but still allows a human experience\n\t\tif self.mark_column(player_column, player)\n\t\t\tself.render\n\t\t\t##### check wins #####\n\t\t\tif self.check_wins(player_column, player)\n\t\t\t\treturn puts player + \" has won!\"\n\t\t\tend\n\t\t\t# if no one wins, start the next player\n\t\t\tif player === 'x'\n\t\t\t\tplayer_turn('o')\n\t\t\telse\n\t\t\t\tplayer_turn('x')\n\t\t\tend\n\t\telse\n\t\t\tputs \"this column is full\"\n\t\t\tplayer_turn(player)\n\t\tend\n\tend",
"def enter_move(color)\n puts \"Select a column (1-7): \"\n move = gets.chomp.upcase\n move = move.to_i - 1\n until move >= 0 && move <= 6 && @board[move].include?(0)\n puts \"Not a column\"\n move = gets.chomp.upcase\n move = move.to_i - 1\n end\n input_move(move, color)\n end",
"def player_move\n player_position = gets.chomp\n player_position = player_position.split(' ')\n if player_position[0] == 'flag'\n flag_map(player_position[1], player_position[2])\n elsif player_position[0] == 'unflag'\n unflag_map(player_position[1], player_position[2])\n else\n player_choice(player_position[0], player_position[1])\n end\n display_board\n \n show_board if game_over == true \n\n end",
"def computer_input(board)\n row_col = computer_choose_random(board)\n row_col = [1, 1] if field_empty?([1, 1], board)\n unless computer_choose_defensive(board).none?\n row_col = computer_choose_defensive(board)\n end\n unless computer_choose_aggressive(board).none?\n row_col = computer_choose_aggressive(board)\n end\n row_col\nend",
"def turn\n input = current_player.move(board)\n if board.valid_move?(input)\n board.update(input, current_player)\n board.display\n else\n board.display\n turn\n end\n end",
"def update(user_input, player)\n if valid_move?(user_input) == true\n cells[user_input.to_i - 1] = player.token\n end # if - valid_move?\n end",
"def get_move\n display_position(@current_state)\n return nil if done?(@current_state)\n pending = true\n height = current_position.length\n width = current_position[0].length\n while pending\n puts\n print \"Enter move as row, column: \"\n move = gets.chomp.split(\",\")\n # Check to make sure move is legal\n if move.length != 2\n puts \"You need to enter two coordinates.\"\n else\n row = move[0].to_i\n column = move[1].to_i\n if row < 0 || row > height - 1\n puts \"Row must be between 0 and #{height - 1}\"\n elsif column < 0 || column > width - 1\n puts \"Column must be between 0 and #{width - 1}\"\n elsif current_position[row][column] == 0\n puts \"That cell has already been chomped!\"\n else\n # It's a legal move\n pending = false\n end\n end\n end\n # Make the move\n make_move([row, column])\n end",
"def player_guess\n puts \"Please enter the row you think the ship is in:\"\n @row_input = gets.chomp\n puts \"Please enter the column you think the ship is in:\"\n @column_input = gets.chomp\nend",
"def turn(board)\n puts \"Please enter 1-9:\"\n user_input = gets.strip\n arr_index = input_to_index(user_input)\n position = current_player(board)\n\n if !valid_move?(board, arr_index)\n puts \"Please enter a different option\"\n user_input = gets.strip\n else\n move(board, arr_index, position)\n display_board(board)\n end\n\nend",
"def choose_move\n puts \"#{current_player}, select a cell to place your #{whose_turn}. Select a number between 1 - 9.\"\n move = gets.chomp.to_i\n puts\n\n # If move is valid and is not taken, then create a key-value pair in @taken: number => X or O.\n if valid_move?(move) && !taken?(move)\n @taken[move] = whose_turn\n update_board(move)\n # When it is not a valid move and the cell is not taken\n elsif !valid_move?(move) && !taken?(move)\n puts \"That is not a valid choice. Please select a number between 1 and 9.\"\n \t# When it is a valid move and the cell is taken \n elsif valid_move?(move) && taken?(move)\n puts \"That one has already been taken. Please select another cell.\"\n end\n end",
"def turn\n puts \"Please enter 1-9:\"\n user_input = gets.strip\n user_input = input_to_index(user_input)\n if valid_move?(user_input)\n move(user_input, current_player)\n else \n turn\n end\n display_board\nend",
"def move(board)\n board.display_board\n print \"Enter move for Player #{@id.to_s} (#{@piece}): \"\n position = gets.to_i\n return {position: position, piece: @piece} if board.valid_position?(position)\n puts \"Invalid position.\"\n move(board)\n end",
"def choose_column\n available_cols = board.available_columns\n loop do\n puts \"#{@light_turn ? LIGHT : DARK}'s turn.\"\n puts \"Please choose a column from (#{available_cols.join(\", \")})\"\n col = gets.chomp.to_i\n return col if available_cols.include? col \n end\n end",
"def turn\n character = current_player\nputs \"Please enter 1-9:\"\nuser_input = gets.strip\nuser_input = user_input.to_i\nindex = input_to_index(user_input)\n if valid_move?(index) == true\n move(index, character)\n display_board\n else \n turn\n end\nend",
"def turn\r\n current_player = self.current_player\r\n #Ask the user for, and obtain, their move, a position between 1-9.\r\n print \"#{current_player}, enter your move (1-9): \"\r\n move_index = gets.chomp\r\n print \"\\n\"\r\n \r\n #Translate user input to valid index\r\n move_index = self.input_to_index(move_index)\r\n \r\n #Check if user input is valid move\r\n valid = false\r\n while !valid do\r\n if self.valid_move?(move_index)\r\n #If valid, make the move and display the board.\r\n self.move(move_index, current_player)\r\n self.display_board\r\n valid = true\r\n else\r\n #If invalid, ask for a new move until a valid move is received.\r\n puts \"That is not a valid move.\"\r\n print \"#{current_player}, enter your move (1-9): \"\r\n move_index = gets.chomp\r\n print \"\\n\"\r\n move_index = self.input_to_index(move_index)\r\n end\r\n end\r\n end",
"def turn \n player = current_player\n puts \"Player '#{player}' enter a move [1-9]\"\n input = gets.chomp \n index = input_to_index(input)\n if valid_move?(index)\n move(index,player)\n display_board\n else \n turn\n end\n end",
"def turn\n #asks for user input, converts input to integer\n puts \"Enter the position you like to play (1-9): \"\n user_input = gets.strip\n\n #if move is valid, accepts move as index and displays new board\n if valid_move?(user_input)\n token=current_player\n move(user_input, token)\n display_board\n else\n turn\n end\n end",
"def ask_player_for_move(current_player)\n played=false\n while not played\n puts \"player\" +current_player +\"where would you like to play your move:=\"\n move=gets.to_i-1\n col= move % @board.size\n row=(move-col) / @board.size\n\n if validate_position(row,col)\n @board[row][col]=current_player\n played=true\n end\n end\n end",
"def turn\n display_board\n puts \"Please enter 1-9:\"\n input = gets.strip\n if !valid_move?(input)\n turn\n end\n move(input, current_player)\n display_board\nend",
"def turn(board)\n puts \"Make your move, enter a grid value from 1 - 9: \"\n input = gets.strip\n index = input_to_index(input)\n value = current_player(board)\n if valid_move?(board, index)\n move(board, index, value)\n else\n turn(board)\n end\n display_board(board)\nend",
"def check_columns_for_winner\n # @player = nil\n if board[0][0] == board[1][0] and board[1][0] == board[2][0] and not board[0][0] == nil\n @player = board[0][0]\n elsif board[0][1] == board[1][1] and board[1][1] == board[2][1] and not board[0][1] == nil\n @player = board[0][1]\n elsif board[0][2] == board[1][2] and board[1][2] == board[2][2] and not board[0][2] == nil\n @player = board[0][2]\n end\n end",
"def turn\n puts \"Please enter 1-9:\"\n position = gets.chomp\n\n while !valid_move?(position)\n puts \"Please enter 1-9:\"\n position = gets.chomp\n end\n\n move(position, player_move = current_player)\n\n display_board\n end",
"def turn\n move_input = current_player.move\n if !board.valid_move?(move_input) # if #valid_move false\n puts \"That is not a valid move. Please try again.\\n\"\n turn\n else\n board.update(move_input,current_player)\n board.display\n end\n end",
"def turn\n # If I set @board = [\"o\", \"o\", \"o\", \"o\", nil, nil, nil, \"x\", \"x\"]\n # the moves method would return 6, b/c 6 spaces have values, and 3 are nil\n if @board.moves.to_i.even? == true\n current_player = @player[0]\n # if moves is an even number set current_player equal to the first object in @players\n # @players = [\"X\", \"O\"]\n elsif \n current_player = @player[1]\n end\n current_player\n # for our example this would return \"X\", if the moves method returned an odd number it would be \"O\"\n end",
"def choose_move\n choose_move_when_in_check\n #update to be player specific\n choose_piece_to_move\n which_piece_selected\n choose_where_to_move\n end",
"def choose(player)\n done = false\n until done do\n \n puts \"Player \"+player.to_s+\", choose a row (0-2)\"\n row = gets.chomp.to_i\n redo if invalid?(row)\n \n puts \"Player \"+player.to_s+\", choose a column (0-2)\"\n col = gets.chomp.to_i\n redo if invalid?(col)\n \n if $game_board[row][col]\n puts \"That square [#{row},#{col}] is already used. Try again.\"\n redo\n end \n \n $game_board[row][col] = player\n done = true\n end\nend",
"def turn\n puts \"Choose a spot between 1-9\"\n spot = gets.strip\n #calls #input_to_index, #valid_move?, and #current_player\n #makes valid moves and displays the board\n #loop back spot/input if/else statement to ask for input again after a failed validation\n spot = input_to_index(spot)\n if valid_move?(spot)\n move(spot, current_player)\n else\n turn\n end\n display_board\n end",
"def mark_input (board, input, player_choice)\n row_input, column_input = split_input(input)[0], split_input(input)[1]\n board[row_input][column_input] = player_choice\n return board\n end",
"def player1_turn \n while true\n puts \"Player 1's turn 'X' \\n Please choose a square ( in the form of a matrix cell):\"\n row1, col1 = gets.chomp.split(\" \")\n if row1==\"q\" || row1==\"quit\" || col1==\"q\" || col1==\"quit\"\n exit\n end\n row1=number_or_nil(row1)\n col1=number_or_nil(col1)\n #choice1 = @spots[row1][col1]\n if (0..@size-1).include?(row1) && (0..@size-1).include?(col1)\n break\n else\n puts \"chose according to the already selected size and must be an integer\"\n end\n end\n row1=row1.to_i\n col1=col1.to_i\n if check_if_spot_is_valid(@spots[row1][col1])\n @spots[row1][col1] = \"X\"\n @score[row1]+=1 #incrementing for the chosen row\n @score[@size+col1]+=1 #incrementing for the chosen column\n if(row1 == col1) #incrementing for the chosen diagonal (if only)\n @score[2*@size]+=1\n end\n if(@size-1-col1 == row1) #incrementing for the chosen anti diag ( if only)\n @score[2*@size+1]+=1\n end\n\t system \"cls\"\n\t puts \"----- Player 1-----\"\n game_status\n @@taken+=1\n else \n puts \"already taken chose some other spot\"\n player1_turn\n end\n check_for_winner\n end",
"def turn\n move = self.current_player.move(self.board)\n # binding.pry\n if self.board.valid_move?(move)\n self.board.update(move, self.current_player)\n else\n puts \"Invalid entry. Please enter a valid space number 1-9.\"\n self.turn\n end\n end",
"def player_turn(turn)\n get_player_input\n compare_guesses\n update_board(turn)\n system 'clear'\n display_board(turn)\n end",
"def ask_input\n\t\tputs \"Take a look at the board, please.\"\n\t\[email protected]_board\n\t\tputs \"#{@player1.name}, make your move please (pick a number from 1 to 9).\"\n\t\tmove = gets.chomp\n\n\t\tif move == \"a1\"\n\t\t \[email protected][move] = @player1.mark\n\t\t \[email protected]_board\n\t\t \ttaking_turns\n\t\t \t\n\t\t# elsif move == \"a2\"\n\t\t# \[email protected][move] = @player1.mark\n\t\t# \[email protected]_board\n\t\t# \task_input\n\t\t# elsif move == \"a3\"\n\t\t# \[email protected][move] = @player1.mark\n\t\t# \[email protected]_board\n\t\t# \task_input\n\t\t end\n\tend",
"def get_full_move\n puts \"Action Types: E to explore a tile and F to toggle a flag\".white.bold\n puts \"Enter a row, column, and action type separated by spaces:\".white.bold\n input = gets.chomp.split\n pos, action = input[0..1].map { | num | num.to_i - 1 }, input[-1]\n until valid_pos?(pos) && valid_action?(action)\n system(\"clear\")\n @board.render\n puts \"Full moves need a row, column and action type\".light_red.bold\n puts \"Action Types: E to explore a tile and F to toggle a flag\".white.bold\n puts \"Enter a row, column, and action type separated by spaces:\".white.bold\n input = gets.chomp.split\n pos, action = input[0..1].map { | num | num.to_i - 1 }, input[-1]\n end\n input\n end",
"def turn \n puts \"Make a move compadre\"\n input = gets.strip\n location = input_to_index(input)\n if valid_move?(location)\n tictac = current_player\n move(location, tictac)\n display_board\n else\n turn\n end\n end",
"def turns\n puts \"#{@p1_name} your move?\"\n p1_move = gets.chomp\n @board[p1_move] = @p1\n puts \"#{@p2_name} where will your move be? Remember the last move occupied position #{p1_move}\"\n p2_move = gets.chomp\n @board[p2_move] = @p2\nend",
"def get_user_input\n loop do\n puts @current_player ? \"Player 1's turn\" : \"Player 2's turn\"\n\n input = CLI.ask \"Please enter a valid column from 1 to 7:\"\n case input\n when /^[1-7]$/\n return input.to_i\n else\n puts \"INVALID INPUT!\"\n puts\n next\n end\n end\n end",
"def turn\n choice = current_player.move(board)\n if board.valid_move?(choice)\n board.update(choice, current_player)\n end\n end",
"def turn\n puts \"Please enter 1-9:\"\n user_input = gets.strip\n index = input_to_index(user_input)\n if valid_move?(index) == true\n move(index, current_player)\n else\n turn\n end\n display_board\n end",
"def player_turn\n begin\n puts \"Please choose a space (1 - 9)\"\n player_move = gets.chomp.to_i\n end until player_move.class == Fixnum && ((1..9).to_a).include?(player_move) && @active_spaces[player_move] == \" \"\n self.active_spaces[player_move] = \"X\"\n puts \"You chose space #{player_move}!\"\n game_board.show_board\n end",
"def take_a_turn\n puts \"Select a position on the board from 1 to 9: \"\n user_input = gets.chomp\n user_input = input_to_index(user_input)\n was_valid_move = valid_move? user_input\n\n if was_valid_move\n @board[user_input] = @current_player\n @turns_taken += 1\n @current_player = @current_player == \"X\" ? \"O\" : \"X\" \n else\n if position_taken? user_input \n puts \"That position is taken!\" \n else \n \"Invalid move!\"\n end\n end\n end",
"def update(input, player)\n input = input.to_i\n\t\tif valid_move?(input) # Check for a valid move\n\t\t\t cells[input-1] = player.token # Update the cell of the board with the player's token\n\t\tend\n\tend",
"def play\n # To start, the method takes two arguments, the players and board array. \n while @board.winner == false\n # Then I set up a while loop that will keep going until there is no winner.\n @board.display_board\n # I started by calling the display_board method (from the Board Class) to show \n # the array in the traditional Tic-Tac-Toe formatting. \n cell_prompt\n # I Prompt the Player to make their selection. \n get_move\n # Here is where the Player imputs their selection. \n @board.update_cell\n # Update_cell (from the Board Class) will take the Player's input and update the value of the object at the \n # corresponding Board[index]. \n if @board.winner == true \n puts @board.winner\n break\n # This ends the loop if there has been a winner.\n elsif @board.draw == true\n break\n # This ends the loop if the match is a draw. \n end\n end\n # Otherwise, the loop keeps going. \n end",
"def make_move(x, y, player)\n\n\tp = tokenize(player)\n\tcase y\n\twhen 1\n\t\trow = $row3\n\twhen 2\n\t\trow = $row2\n\twhen 3\n\t\trow = $row1\n\tend \n\n\ttarget = row[x-1] if x == 1\n\ttarget = row[x] if x == 2\n\ttarget = row[x+1] if x == 3\n\n\tif target != \" \"\n\t\traise NoMethodError\n\telse \n\t\tputs \"#{$current_player} moved to (#{x},#{y})!\"\n\t\trow[x-1] = p if x == 1\n\t\trow[x] = p if x == 2\n\t\trow[x+1] = p if x == 3\n\t\tprint_board\n\tend \nend",
"def input_move(db, cur_position)\r\n\tprint \"Enter a move for #{cur_player(db, cur_position)} in standard chess notation, or HELP for help: \"\r\n\tmove = gets.chomp.downcase\r\n\treturn move\r\nend",
"def get_moves_2(piece, board)\n valid_col = case piece.name\n when ?A then 3\n when ?B then 5\n when ?C then 7\n when ?D then 9\n else 11\n end\n moves = []\n\n # If in hallway\n if piece.row == 1\n cols = valid_col < piece.col ? (valid_col...piece.col).to_a : (piece.col+1..valid_col).to_a\n if cols.count{|c| board[[1, c]] == ?.} == cols.length\n if board[[2, valid_col]] == ?. && board[[3, valid_col]] == piece.name && board[[4, valid_col]] == piece.name && board[[5, valid_col]] == piece.name\n moves << [[2, valid_col], (cols.count + 1) * piece.cost]\n elsif board[[2, valid_col]] == ?. && board[[3, valid_col]] == ?. && board[[4, valid_col]] == piece.name && board[[5, valid_col]] == piece.name\n moves << [[3, valid_col], (cols.count + 2) * piece.cost]\n elsif board[[2, valid_col]] == ?. && board[[3, valid_col]] == ?. && board[[4, valid_col]] == ?. && board[[5, valid_col]] == piece.name\n moves << [[4, valid_col], (cols.count + 3) * piece.cost]\n elsif board[[2, valid_col]] == ?. && board[[3, valid_col]] == ?. && board[[4, valid_col]] == ?. && board[[5, valid_col]] == ?.\n moves << [[5, valid_col], (cols.count + 4) * piece.cost]\n end\n end\n # If right column and something is underneath and nothing above\n # If in wrong column completely and nothing above\n elsif piece.row >= 2\n below = (piece.row+1..5).to_a\n above = (2..piece.row-1).to_a\n if ((piece.col == valid_col && below.count{|c| board[[c, piece.col]] != piece.name} != 0 && below.length != 0) || (piece.col != valid_col)) && (above.count{|c| board[[c, piece.col]] == ?.} == above.length)\n 2.times do |t|\n dir = t == 0 ? -1 : 1\n curr = piece.col\n steps = 1 + above.length\n while board[[1, curr]] == ?.\n moves << [[1, curr], steps * piece.cost] if ![3, 5, 7, 9].include?(curr)\n steps += 1\n curr += dir\n end\n end\n end\n end\n moves\nend",
"def turn\r\n puts \"Please enter 1-9:\"\r\n user_input = gets.strip\r\n user_move = input_to_index(user_input)\r\n \r\n if valid_move?(user_move)\r\n move(user_move,current_player)\r\n display_board\r\n else\r\n turn\r\n end\r\n end",
"def prompt_legal_move\n col = current_player.move\n while @board.col_full?(col)\n display_invalid_move_error\n col = current_player.move\n end\n return col\n end",
"def display_game_board(player)\r\n \r\n move = \"\" #Assign a default value\r\n \r\n loop do #Loop forever\r\n \r\n Console_Screen.cls #Clear the display area\r\n \r\n #Display the game board\r\n puts \"\\t\\t\\tWelcome to the Ruby Tic-Tac-Toe Game! \" +\r\n \"\\n\\n\\n\\n\"\r\n puts \"\\t\\t\\t 1 2 3\\n\" \r\n puts \"\\t\\t\\t | |\"\r\n puts \"\\t\\t\\t A #{$A1} | #{$A2} | #{$A3}\"\r\n puts \"\\t\\t\\t | |\"\r\n puts \"\\t\\t\\t ---------------------\"\r\n puts \"\\t\\t\\t | |\"\r\n puts \"\\t\\t\\t B #{$B1} | #{$B2} | #{$B3}\"\r\n puts \"\\t\\t\\t | |\"\r\n puts \"\\t\\t\\t ---------------------\"\r\n puts \"\\t\\t\\t | |\"\r\n puts \"\\t\\t\\t C #{$C1} | #{$C2} | #{$C3}\"\r\n puts \"\\t\\t\\t | |\"\r\n \r\n #Prompt the player to enter a move\r\n print \"\\n\\n\\n\\n\\nPlayer \" + player + \"'s turn. \" +\r\n \"Please enter your move: \"\r\n \r\n move = STDIN.gets #Collect the player's move\r\n move.chop! #Remove the end of line marker\r\n move = move.upcase #Convert to uppercase\r\n\r\n #user enters \"H\" as hidden cheat to display statistics\r\n if move == \"H\"\r\n puts display_statistics\r\n end\r\n\r\n #user enters \"M\" to load wikipedia instructions page\r\n if move == \"M\"\r\n puts display_wikipedia\r\n end\r\n\r\n #Terminate the loop if a valid move was entered\r\n if move.length == 2 then #Must be at 2 character long\r\n if move =~ /[A-C][1-3]/i #Must be A1, A2, A3, B1, \r\n #B2, B3, C1, C2, or C3\r\n #Call method responsible for determining if the \r\n #board square was available \r\n validMove = validate_player_move(move) \r\n if validMove == true #The move was valid \r\n break #Terminate the execution of the loop\r\n else\r\n #display_error method\r\n display_error\r\n end\r\n else\r\n #display_error method\r\n display_error\r\n end\r\n else\r\n #display_error method\r\n display_error\r\n end\r\n\r\n end\r\n \r\n return move #Return the player's move back to the\r\n #calling statement\r\n \r\n end",
"def turn\n \n choice = current_player.move(board)\n if board.valid_move?(choice)\n board.update(choice, current_player)\n else\n turn\n end\n end",
"def play\n welcome\n loop do\n #lines 17-19 are my favorite\n until @game_board.drop_token(@current_player.get_move_column,@current_player.game_token) do \n puts \"Column full! Please choose another column!\"\n binding.pry\n print \">\"\n end\n @game_board.board_render\n swap_players\n end\n end",
"def start_game\r\n # Read the file that contains game instructions and display on the console\r\n File.open(File.join(File.dirname(__FILE__),\"instructions.txt\")).each do |line|\r\n puts line\r\n end\r\n # Select player 1 and 2 as human or computer. If human provide a name for identification\r\n player_1 = ask(\"Player 1 option? \",Integer){|q| q.in = 1..3}\r\n if player_1 == 2\r\n player_1_name = ask(\"Name? \") { |q| q.validate = /\\w+\\Z/ }\r\n player_1_obj = Player.new(player_1_name)\r\n else\r\n player_1_obj = Player.new()\r\n end\r\n\r\n player_2 = ask(\"Player 2 option? \",Integer){|q| q.in = 1..3}\r\n if player_2 == 2\r\n player_2_name = ask(\"Name? \") { |q| q.validate = /\\w+\\Z/ }\r\n player_2_obj = Player.new(player_2_name)\r\n else\r\n player_2_obj = Player.new()\r\n end\r\n # Create an array with two player objects. Each player gets a token which is same as his index in the array\r\n players = Array.new(2){Player.new}\r\n players[0] = player_1_obj\r\n players[1] = player_2_obj\r\n # Create a new game board\r\n new_board = Board.new()\r\n puts \" To start, please select a column between 1-7\"\r\n turn = 1 # used to keep track of maximum number of turns in the game which is 7*6\r\n game_over_flag = 0 # set to 1 if game is over either by a win or a tie\r\n while(turn <= 42)\r\n players.each_with_index do |player,player_token|\r\n puts \"Player #{player.name} turn\"\r\n if player.name.eql?(\"Computer\")\r\n # currently the computer takes a random move. This can be replaced with the calculate_winning_move() method\r\n # by implementing an algorithm to calculate the best move\r\n player_selection = rand(7)\r\n else\r\n # Take human player's column selection. reduce it by 1 because array indices start with 0\r\n player_selection = ask(\"Column? \", Integer) { |q| q.in = 1..7 }\r\n end\r\n player_column = player_selection-1\r\n # call make_move which makes a move on behalf of player and checks if the move has made the player win\r\n win_flag = new_board.make_move(player_token,player_column)\r\n turn += 1\r\n if win_flag\r\n puts \"Game over : Player #{player.name} won\"\r\n game_over_flag = 1\r\n end\r\n if turn == 42\r\n puts \"Game over : Its a tie!!\"\r\n game_over_flag = 1\r\n end\r\n # if the game over flag is set, check if the players want to restart with a new game or end the game\r\n if game_over_flag == 1\r\n new_game = ask(\"Do you want to start new game ?(yes/no)\"){|q| q.validate = /(yes|no)\\Z/}\r\n if new_game.eql?('yes')\r\n start_game()\r\n else\r\n puts \"See you.Have a good day!!\"\r\n end\r\n return\r\n end\r\n end\r\nend\r\nend",
"def pick_player\n \n puts \"Let's play Tic Tac Toe!\"\n puts \"But first, let's get acquainted. I am your computer #{Socket.gethostname}\"\n puts \"What's your name?\n \"\n\n # if you don't pick a name we'll pick a greeting for you\n @player = gets.chomp\n if @player == ''\n @player = 'Human friend'\n end\n \n # getting cracking already\n clr \n puts \"A pleaure to see you, #{@player}.\"\n puts \"Please choose if you want to play as X or O\"\n puts \"by pressing the corresponding key on your keyboard.\n \"\n input = ''\n until input == \"x\" || input ==\"o\" do\n input = gets.chomp.upcase\n if input == \"X\" || input == \"O\"\n @marker = input\n puts \"Thanks #{@player}, you picked #{@marker}, what's your move?\\n\"\n new_board\n make_move\n else\n puts \"that's not an X or an O. Try again\"\n end\n end\n end",
"def player board_new\n\tputs \"Player turn: \\n\n\tPlease Select a board option 1-9\"\n\tanswer_player = gets.chomp\n\twhile true\n\t\tif answer_player == \"1\"\n\t\t\t# key = @board_index[0][0]\n\t\t\t# puts @board_index[0][0]\n\t\t\t# puts key\n\t\t\ttrash = @board_index.at(0).at(0)\n\t\t\tdelete_if(trash.include?(1))\n\n\t\t\t# delete.at(0).insert(0, \"X\")\n\t\t\t# @board_index.insert(key, \"X\")\n\t\t\t# @board_index.insert(0 0, \"X\")\n\t\t\t@board1\n\t\t\t\n\n\t\t\tputs \"| #{@board_index [0] [0]} | #{@board_index [1] [0]} | #{@board_index [2] [0]} |\"\n\t\t\tputs \"| #{@board_index [0] [1]} | #{@board_index [1] [1]} | #{@board_index [2] [1]} |\"\n\t\t\tputs \"| #{@board_index [0] [2]} | #{@board_index [1] [2]} | #{@board_index [2] [2]} |\"\n\t\t\tbreak\n\t\telsif answer_player == \"2\"\n\t\telsif answer_player == \"3\"\n\t\telsif answer_player == \"4\"\n\t\telsif answer_player == \"5\"\n\t\telsif answer_player == \"6\"\n\t\telsif answer_player == \"7\"\n\t\telsif answer_player == \"8\"\n\t\telsif answer_player == \"9\"\t\n\t\telse \n\t\t\tputs \"That is not a valid option\"\n\t\tend\n\tend\n\n\n\n\nend",
"def make_move(board)\n puts \"Opponent is thinking...\\n\"\n minimax(board, @char, 0)\n if board.update('O', @choice[0], @choice[1])\n board.draw\n puts \"Opponent chose coordinates (#{@choice[0]+1}, #{@choice[1]+1})\\n\"\n else\n puts \"Something went wrong. The opponent made an illegal move.\\n\"\n end\n end",
"def get_player_selection(board)\n begin # check if the selection is valid\n player_choice = gets.chomp.to_i\n is_valid = get_empty_positions(board).include? player_choice\n if !is_valid\n puts \"Invalid selection! Please select empty squares that are displayed by numeric values only! \"\n end\n end until is_valid\n board[player_choice] = 'X'\nend",
"def turn\n puts \"Please enter 1-9:\"\n input = gets.strip\n index = input_to_index(input)\n char = current_player\n if valid_move?(index)\n move(index, char)\n display_board\n else\n turn\n end\nend",
"def turn\n puts \"Please enter 1-9:\"\n input = gets.strip\n index = input_to_index(input)\n char = current_player\n if valid_move?(index)\n move(index, char)\n display_board\n else\n turn\n end\nend",
"def turn\n choice = current_player.move(board)\n if board.valid_move?(choice)\n board.update(choice, current_player)\n else\n turn\n end\n end",
"def turn\n choice = current_player.move(board)\n if board.valid_move?(choice)\n board.update(choice, current_player)\n else\n turn\n end\n end",
"def move(user_input, character = \"X\")\n @board[user_input] = character\n end",
"def get_moves(piece, board)\n valid_col = case piece.name\n when ?A then 3\n when ?B then 5\n when ?C then 7\n when ?D then 9\n else 11\n end\n moves = []\n\n # If in hallway\n if piece.row == 1\n cols = valid_col < piece.col ? (valid_col...piece.col).to_a : (piece.col+1..valid_col).to_a\n if cols.count{|c| board[[1, c]] == ?.} == cols.length\n if board[[2, valid_col]] == ?.\n if board[[3, valid_col]] == ?.\n moves << [[3, valid_col], (cols.count + 2) * piece.cost]\n elsif board[[3, valid_col]] == piece.name\n moves << [[2, valid_col], (cols.count + 1) * piece.cost]\n end\n end\n end\n # If not in its column (can never stand in hallway anf column at same time)\n elsif (piece.col == valid_col && piece.row == 2 && board[[piece.row + 1, piece.col]] != piece.name) || (piece.col != valid_col && piece.row == 2)\n 2.times do |t|\n dir = t == 0 ? -1 : 1\n curr = piece.col\n steps = 1\n while board[[1, curr]] == ?.\n moves << [[1, curr], steps * piece.cost] if ![3, 5, 7, 9].include?(curr)\n steps += 1\n curr += dir\n end\n end\n elsif piece.row == 3 && piece.col != valid_col && board[[2, piece.col]] == ?.\n 2.times do |t|\n dir = t == 0 ? -1 : 1\n curr = piece.col\n steps = 2\n while board[[1, curr]] == ?.\n moves << [[1, curr], steps * piece.cost] if ![3, 5, 7, 9].include?(curr)\n steps += 1\n curr += dir\n end\n end\n end\n moves\nend",
"def prompt_movement\n mov = 0\n\tloop do\n\t print \"\\n#{@cur_player.name}, choose your movement (1-7): \"\n\t mov = gets.chomp.to_i\n\t if (1..7).include? mov\n\t break if @board.is_available? mov\n\t\t puts \"That column is totally full! Try other choice...\" \n\t else\n\t\tputs \"Invalid choice! Try again..\" \n\t end\n\tend\n\tmov \n end",
"def turn(board)\n player = current_player(board)\n puts \"Player #{player}, Please enter 1-9:\"\n input = gets.strip\n index = input_to_index(input)\n\n is_valid = false\n until is_valid\n if valid_move?(board, index)\n move(board, index, player)\n display_board(board)\n is_valid = true\n else\n puts \"Invalid Selection! Please enter 1-9:\"\n input = gets.strip\n index = input_to_index(input)\n end\n end\nend",
"def move(board)\n\t\tmove = 0 # Variable to hold the Computer player's selected move\n\t\tposition = 0\n\t\tplace = 0\n\t\tedge = 0\n\t\tcorner = 0\n\t\tcomputer_move = [] # Array to hold the moves available to the current Computer player\n\t\tvalid_moves = [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"] # Defines allowed moves in a Tic Tac Toe game\n\t\t# Bring in some artificial intelligence\n\t\tposition = ai_block_win(board)\n\t\tplace = ai_best_moves(board)\n\t\tedge = ai_strategy_edges(board)\n\t\tcorner = ai_strategy_corners(board)\n\t\t# End artificial intelligence\n\t\tvalid_moves.each_with_index do |a,i| # Checks which of its valid moves are available to the Computer player\n\t\t\tif board.valid_move?(a)\n\t\t\t\tcomputer_move << ((i + 1).to_s) # If the move is valid add it to the available moves array\n\t\t\tend\n\t\tend\n\t\tif position != nil && !position.empty? && board.valid_move?(position[0][0]) # If move is valid and not nil or empty move takes position\n\t\t\tmove = position[0]\n\t\telsif edge != nil # If move returned by edge exists\n\t\t\tmove = edge\n\t\telsif corner != nil # If move returned by corner exists\n\t\t\tmove = corner\n\t\telsif place != nil # If move returned by place exists\n\t\t\tmove = place\n\t\telse\n\t\t\tmove = computer_move.sample # Take a random move from the available moves array if no other moves valid\n\t\tend\n\t\tmove # Return the move to be made to #game\n\tend",
"def turn(board)\n puts \"Please enter 1-9:\"\n input = gets.strip\n if valid_move?(board, input)\n player = current_player(board)\n move(board, input, player)\n else\n turn(board)\n end\n\n display_board(board)\nend",
"def ask_player_for_move(current_player)\n puts\n puts \"#{@current_player.name}, it's your move:\"\n @move = gets.chomp.capitalize.to_s\n # puts @move\n self.validate_move(@move)\n next_turn\n end",
"def tictactoe()\r\n\tcur = {row1: [\" \",\" \",\" | \",\" \",\" | \",\" \",\" \"], space1: [\"-----------\"], row2: [\" \",\" \",\" | \",\" \",\" | \",\" \",\" \"], space: [\"-----------\"], row3: [\" \",\" \",\" | \",\" \",\" | \",\" \",\" \"]}\r\n\t$columns = [nil,1,3,5]\r\n\t$x_o = true\r\n\t$foundWin = false\r\n\tplayernumber = 2.to_s\r\n\tcounter = 0\r\n\tprint \"Instructions: Input a column and row when prompted seperated by a single comma. ('2 2')\\n\"\r\n\twhile $foundWin == false and counter < 9 do #while no one has won, do turns\r\n\t\tprintBoard(cur)\r\n\t\tprint \"Player 1's (X) turn. Input: \" #start player 1's turn\r\n\t\tplayer1Input = gets.chomp.split(' ')\r\n\t\twhile player1Input[0] == nil or player1Input[1] == nil\r\n\t\t\tprint \"Move was not valid. Please try again: \"\r\n\t\t\tplayer1Input = gets.chomp.split(' ')\r\n\t\t\tplayer1C = player1Input[0].to_i\r\n\t\t\tplayer1R = player1Input[1].to_i\r\n\t\tend\r\n\t\tplayer1C = player1Input[0].to_i\r\n\t\tplayer1R = player1Input[1].to_i\r\n\t\tif moveValid?(cur,player1C,player1R,$x_o) == false\r\n\t\t\twhile moveValid?(cur,player1C,player1R,$x_o) == false\r\n\t\t\t\tprint \"Move was not valid. Please try again: \"\r\n\t\t\t\tplayer1Input = gets.chomp.split(' ')\r\n\t\t\t\tplayer1C = player1Input[0].to_i\r\n\t\t\t\tplayer1R = player1Input[1].to_i\r\n\t\t\tend\r\n\t\tend #all above this end is making sure input is valid from user, next is placing the x and determining if it is a win\r\n\t\tplaceXO(cur,player1C,player1R,$x_o)\r\n\t\tcounter += 1\r\n\t\tif counter > 8 and $fondWin == false\r\n\t\t\t$tie = true\r\n\t\t\tbreak\r\n\t\tend\r\n\t\tdidWin(cur,player1C,player1R,$x_o)\r\n\t\tif $foundWin == true #check if move was winning move, if so, break while loop\r\n\t\t\tbreak\r\n\t\tend\r\n\t\tswitchTurn() #starting player 2's turn, do everything I did for player 1 except for player 2\r\n\t\t#next turn\r\n\t\tprintBoard(cur)\r\n\t\tprint \"Player 2's (O) turn. Input: \"\r\n\t\tplayer2Input = gets.chomp.split(' ')\r\n\t\twhile player2Input[0] == nil or player2Input[1] == nil\r\n\t\t\tprint \"Move was not valid. Please try again: \"\r\n\t\t\tplayer2Input = gets.chomp.split(' ')\r\n\t\t\tplayer2C = player2Input[0].to_i\r\n\t\t\tplayer2R = player2Input[1].to_i\r\n\t\tend\r\n\t\tplayer2C = player2Input[0].to_i\r\n\t\tplayer2R = player2Input[1].to_i\r\n\t\tif moveValid?(cur,player2C,player2R,$x_o) == false\r\n\t\t\twhile moveValid?(cur,player2C,player2R,$x_o) == false\r\n\t\t\t\tprint \"Move was not valid. Please try again: \"\r\n\t\t\t\tplayer2Input = gets.chomp.split(' ')\r\n\t\t\t\tplayer2C = player2Input[0].to_i\r\n\t\t\t\tplayer2R = player2Input[1].to_i\r\n\t\t\tend\r\n\t\tend\r\n\t\tplaceXO(cur,player2C,player2R,$x_o)\r\n\t\tcounter += 1\r\n\t\tdidWin(cur,player2C,player2R,$x_o)\r\n\t\tswitchTurn()\r\n\t\t#no need to check if won, while loop will automatically do that for us at the loop\r\n\tend\r\n\tprint \"\\n\"\r\n\tprint \"\r\n\t╔═══╗─────────────╔╗───╔╗───╔╗\r\n\t║╔═╗║────────────╔╝╚╗──║║──╔╝╚╗\r\n\t║║─╚╬══╦═╗╔══╦═╦═╩╗╔╬╗╔╣║╔═╩╗╔╬╦══╦═╗╔══╗\r\n\t║║─╔╣╔╗║╔╗╣╔╗║╔╣╔╗║║║║║║║║╔╗║║╠╣╔╗║╔╗╣══╣\r\n\t║╚═╝║╚╝║║║║╚╝║║║╔╗║╚╣╚╝║╚╣╔╗║╚╣║╚╝║║║╠══║\r\n\t╚═══╩══╩╝╚╩═╗╠╝╚╝╚╩═╩══╩═╩╝╚╩═╩╩══╩╝╚╩══╝\r\n\t──────────╔═╝║\r\n\t──────────╚══╝\\n\" #print the awesome congrats ASCII code (I got it off the internet, just sayin)\r\n\tprintBoard(cur)\r\nend",
"def turn(board)\n puts \"Please enter 1-9:\"\n input = gets.strip\n if valid_move?(board, input)\n player_character = current_player(board)\n move(board, input, player_character)\n else\n turn(board)\n end\n display_board(board)\nend",
"def turn\n puts \"Please enter 1-9:\"\n user_input = gets.chomp\n user_input = input_to_index( user_input )\n if valid_move?( user_input ) == true\n puts \"Valid move was made\"\n character = current_player\n move( user_input, character )\n display_board\n else\n while valid_move?( user_input ) == false\n puts \"Please enter a valid move: \"\n user_input = gets.chomp\n user_input = input_to_index( user_input )\n end\n if valid_move?( user_input ) == true\n puts \"Valid move was made\"\n character = current_player\n move( user_input, character )\n display_board\n end\n end\n end",
"def play(player)\n puts \"#{player.name}, please choose a boardcase:\"\n print \"=>\"\n move = gets.chomp.to_s\n while !(@board_game.hash_board.has_key?(move)) || @board_game.hash_board[move] != \" \"\n puts \"You need to choose a valid & existing boardcase!\"\n move = gets.chomp.to_s\n end\n @board_game.hash_board[move] = player.symbol\n end",
"def turn\n\nputs \"Please enter 1-9:\"\nposition = gets.chomp\n\n if valid_move?(position) == false\n turn\n else\n move(position, current_player)\n display_board\n end\n\nend",
"def turn\n puts \"Please enter 1-9:\"\n move = current_player.move(@board);\n if @board.valid_move?(move)\n @board.update(move, current_player);\n @board.display;\n else\n turn;\n end\n end",
"def turn\n puts \"Please enter 1-9: \"\n position = gets.chomp\n if valid_move?(position)\n move(position, current_player)\n else\n turn\n end\n display_board\n end",
"def turn\n puts \"Please enter 1-9:\"\n input = gets.strip\n index = input_to_index(input)\n is_valid = valid_move?(index)\n if is_valid === true\n current_turn = current_player\n move(index,current_turn)\n display_board\n else\n puts 'Please enter correct input'\n puts \"Please enter 1-9:\"\n input = gets.strip\n end\n end",
"def turn()\n player = current_player()\n puts \"Player #{player}, Please enter 1-9:\"\n input = gets.strip\n index = input_to_index(input)\n\n is_valid = false\n until is_valid\n if valid_move?(index)\n move(index, player)\n display_board()\n is_valid = true\n else\n puts \"Invalid Selection! Please enter 1-9:\"\n input = gets.strip\n index = input_to_index(input)\n end\n end\n end",
"def turn(board)\n puts \"Please enter 1-9:\"\n user_input = gets.strip\n index = input_to_index(user_input)\n if valid_move?(board, index)\n move(board, index, character = current_player(board))\n display_board(board)\n else\n turn(board)\n end\nend",
"def turn(board)\n player = current_player(board)\n got_valid = false\n puts \"Please choose a position between 1-9:\"\n while got_valid == false\n user_input = gets.strip\n position = input_to_index(user_input)\n if valid_move?(board, position)\n move(board, position, player)\n display_board(board)\n got_valid = true\n end\n end\nend",
"def turn\n puts \"Please enter 1-9:\"\n user_input = gets.strip\n index = input_to_index(user_input)\n\n until valid_move?(index)\n puts \"Invalid Move! Try again.\"\n user_input = gets.strip\n index = input_to_index(user_input)\n\n end\n\n move(index, current_player)\n display_board\n end",
"def turn(board)\n \n current_player = current_player(board)\n \n puts \"Please enter 1-9:\"\n input = gets.strip\n index = input_to_index(input)\n if valid_move?(board, index)\n move(board, index, current_player)\n display_board(board)\n else\n turn(board)\n end\nend",
"def valid_move\n display_current_turn\n \tcol = prompt_legal_move\n \treturn col, @turn%2\n end",
"def turn(board)\n puts \"Please enter 1-9:\"\n input = gets.strip\n if valid_move?(board,input)\n move(board,input,current_player(board))\n else\n turn(board)\n end\n display_board(board)\nend",
"def take_turn\n puts \"#{player.name}'s turn. Enter 0-9:\"\n input = gets.strip\n if board.valid_move?(input)\n board.move(input, player)\n else\n puts \"Please enter valid move:\"\n take_turn(board, player)\n end\n board.display\n end",
"def input_board\r\n print \"Enter your board with no spaces (ex: CUTERUBYCUBEKOAN): \"\r\n line = gets.chomp\r\n if line.length != 16 then\r\n puts \"You input the board incorrectly.\"\r\n return\r\n end\r\n @board = line.to_s\r\n to_s\r\nend",
"def turn\n puts \"Please enter 1-9:\"\n input = gets.strip\n index = input_to_index(input)\n if valid_move?(index)\n move(index, current_player)\n display_board\n else\n turn\n end\nend",
"def turn\n puts \"Please enter 1-9:\"\n input = gets.strip\n index = input_to_index(input)\n if valid_move?(index)\n move(index,current_player)\n display_board\n else\n turn\n end\n end",
"def turn(board)\n puts \"Please enter 1-9:\"\n input = gets.strip\n index = input_to_index(input)\n if valid_move?(board, index)\n value = current_player(board)\n move(board, index, value)\n display_board(board)\n else\n turn(board)\n end\nend",
"def turn\n puts \"Please enter 1-9:\"\n input = gets.strip\n position = input_to_index(input)\n\n if valid_move?(position)\n player = current_player\n move(position, player)\n display_board\n else\n turn\n end\n end",
"def move(board, input, team = \"X\")\n board[input.to_i - 1] = team\n return board\nend",
"def move_valid?\n @board.first_disk = 0\n\n #determine disk piece to be moved\n @board.board.each do |row, arr|\n if arr[@player.from] != 0\n @board.first_disk = arr[@player.from]\n break\n end\n end\n\n #determine the highest disk available in that column\n @board.board.each do |row, arr|\n if arr[@player.to] != 0\n @board.second_disk = arr[@player.to]\n break\n else\n @board.second_disk = arr[@player.to]\n end\n end\n\n #conditional test to see if move is valid\n if @board.first_disk == 0\n puts \"No disks in this column, try again\"\n get_input\n elsif @board.second_disk == 0 || @board.first_disk < @board.second_disk\n move_disk\n else\n puts \"Move is invalid\"\n puts \"Please check the rules and input a new move\"\n get_input\n end\n end"
] | [
"0.7241283",
"0.71871006",
"0.71244305",
"0.7101226",
"0.6996138",
"0.69946074",
"0.692669",
"0.6914754",
"0.68970037",
"0.6886457",
"0.68770593",
"0.6841837",
"0.6835599",
"0.67981994",
"0.6764569",
"0.67413205",
"0.671001",
"0.6677614",
"0.6635272",
"0.6608262",
"0.6605565",
"0.65964943",
"0.659011",
"0.6585673",
"0.6584497",
"0.6572101",
"0.6570109",
"0.6563273",
"0.654046",
"0.65375346",
"0.6529988",
"0.65191853",
"0.6518453",
"0.6506159",
"0.65025043",
"0.650093",
"0.6500427",
"0.650036",
"0.64864284",
"0.64844346",
"0.64817834",
"0.64810455",
"0.6474869",
"0.6471032",
"0.64682126",
"0.64676094",
"0.64651275",
"0.64592",
"0.64570093",
"0.64442444",
"0.64421034",
"0.6436551",
"0.64281696",
"0.6418883",
"0.64186937",
"0.64165825",
"0.6416254",
"0.64137787",
"0.6408802",
"0.64036417",
"0.6399087",
"0.6397518",
"0.6395433",
"0.6391011",
"0.63887596",
"0.637145",
"0.63694036",
"0.63694036",
"0.6368952",
"0.6368952",
"0.63569146",
"0.63546896",
"0.63468236",
"0.63399106",
"0.6339886",
"0.6333566",
"0.6332177",
"0.63306546",
"0.6321124",
"0.6318433",
"0.63179314",
"0.63154167",
"0.630894",
"0.6304937",
"0.6304839",
"0.6290641",
"0.6285538",
"0.62815076",
"0.627839",
"0.62684745",
"0.62641865",
"0.6261685",
"0.62499714",
"0.6244567",
"0.62427884",
"0.62403715",
"0.62364894",
"0.6234996",
"0.6230258",
"0.62294376"
] | 0.72193974 | 1 |
Generator Code. Remember this is just supedup Thor so methods are executed in order | def copy_files
copy_file 'initializer.rb', 'config/initializers/kono_utils.rb'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generators; end",
"def generators; end",
"def generate; end",
"def generate; end",
"def generate!\n generator.invoke_all\n end",
"def generate\n end",
"def generate_next\n @block.call(@so_far)\n end",
"def process\n self.generate\n end",
"def generate\n end",
"def generators(&blk); end",
"def generators(&blk); end",
"def next()\n \n end",
"def next()\n \n end",
"def generate\n super\n end",
"def generate\n raise NotImplementedError\n end",
"def generate\n raise NotImplementedError\n end",
"def generate_me(generator)\n generator.generate self\n end",
"def generate\n raise \"must implement\"\n end",
"def generators=(_arg0); end",
"def kid_generator=(_arg0); end",
"def kid_generator=(_arg0); end",
"def next() end",
"def next() end",
"def yield; end",
"def generate\n throw \"override me before innocent kittens are hurt!\"\n end",
"def generated\n end",
"def generate\n conflict? ? self.next : normalized\n end",
"def generate_comprehensive\n\n end",
"def test_class\n while @traversal.continue_generation?\n yield produce_test \n end\n end",
"def initial_generate\n \n end",
"def generate *args\n generator = generator_for *args\n generator.generate\n end",
"def generate *args\n generator = generator_for *args\n generator.generate\n end",
"def next\n end",
"def next\n end",
"def processor; end",
"def generate\n map(&:generate)\n end",
"def run\n yield\n end",
"def generate\n generators.each do |generator|\n start = Time.now\n generator.generate(self)\n Jekyll.logger.debug \"Generating:\",\n \"#{generator.class} finished in #{Time.now - start} seconds.\"\n end\n nil\n end",
"def i_generate\n yield 1\n yield 2\nend",
"def get_next\n\t\t\n\tend",
"def next!() end",
"def each # And define each on top of next\n loop {yield self.next }\n end",
"def next\n\t\tend",
"def generate(*args)\n raise \"Method 'generate' not implemented for #{self.class.name}\"\n end",
"def generate\n generate_header\n generate_content\n #not_dirty\n end",
"def regenerator; end",
"def generator\n @app.generator\nend",
"def gen\n @genFlag = true\n res = ln((@overrideFlag ? '@Override ' : '') + 'public '+ (@static ? 'static ' : '') + @type + ' ' + @name + '(' +\n @args.collect {|var| (var.className.nil? ? var.type : var.className.name) + (var.instance_of?(Arr) ? '[]' * var.ndim : '') + ' ' + var.name}.join(', ') +\n ') {') + \"\\n\"\n shift(1)\n res+=ln('if ('+@args[0].name+'.length > 0) FuzzerUtils.seed('+rand(100000000).to_s+' + Long.parseLong('+@args[0].name+'[0]));') if @mainTestFlag and $conf.outer_control\n res+=ln('instanceCount++;') if @constructorFlag\n res += @context.genDeclarations() if !@mainFlag # no declarations should be generated for main method\n @rootStmt.nestedStmts['body'].each {|st| res += st.gen()} if !@mainFlag # no statements should be generated for main method\n res += ln('FuzzerUtils.joinThreads();') if @mainTestFlag && $run_methods>0\n res += (@mainTestFlag ? @context.genResPrint() + @methClass.context.genResPrint() : '')\n res += (!(@mainTestFlag||@mainFlag) ? genEnding() : '')\n glob = (@mainTestFlag ? @methClass.genGlobCheckSums() : '')\n#main method:\n if @mainFlag \n res += ln(\"try {\")\n shift(1)\n res += ln(@methClass.name + \" _instance = new \" + @methClass.name + \"();\")\n res += ln(\"for (int i = 0; i < \" + $conf.mainTest_calls_num.to_s + \"; i++ ) {\")\n shift(1)\n res += ln(\"_instance.\" + @methClass.methMainTest.name + \"(\" + @args[0].name + \");\")\n shift(-1)\n res += ln(\"}\")\n if ($conf.time_sleep_complete_tier1 > 0)\n res += ln(\"try {\") + ln(\"Thread.sleep(\" + $conf.time_sleep_complete_tier1.to_s + \");\") + ln(\" } catch (InterruptedException ie) {\") \n shift(1)\n res += ln(\"ie.printStackTrace();\") \n shift(-1)\n res += ln(\"}\")\n end\n if $conf.mainTest_calls_num_tier2 > 0\n res += ln(\"for (int i = 0; i < \" + $conf.mainTest_calls_num_tier2.to_s + \"; i++ ) {\")\n\n shift(1)\n res += ln(\"_instance.\" + @methClass.methMainTest.name + \"(\" + @args[0].name + \");\")\n shift(-1)\n res = res + ln(\"}\")\n end\n shift(-1)\n res += ln(\" } catch (Exception ex) {\")\n shift(1)\n res += ln(\"FuzzerUtils.out.println(ex.getClass().getCanonicalName());\")\n shift(-1)\n res += ln(\" }\")\n\n end\n \n res += \"\\n\" + glob unless glob.empty?\n\n shift(-1)\n res + ln(\"}\")\n end",
"def bulk_generate\n\n end",
"def gen(&blk)\n IniParse::Generator.new.gen(&blk)\n end",
"def kid_generator; end",
"def kid_generator; end",
"def kid_generator; end",
"def each # And define each on top of next\n loop { yield self.next }\n end",
"def generate\n instance_eval(&action) if action\n end",
"def each\n# And define each on top of next\nloop { yield self.next }\nend",
"def each\n# And define each on top of next\nloop { yield self.next }\nend",
"def run() end",
"def generate(&block)\n g = Verneuil::Generator.new\n block.call(g)\n g.program\nend",
"def generate(*args)\n @app.log << \"generate #{args.inspect[1..-2]}\"\n @app.generator(*args).generate\nend",
"def generate\n classes = registry.all(:class)\n classes.each do |c|\n data = methods(c)\n output(data, c.to_s)\n end\n end",
"def generate\n populate\n @parlour.send(@mode)\n end",
"def start_generation\n Nanite.request(\"/nanny/generate\", self.id)\n end",
"def filter_generator; end",
"def dummy_generator(result)\n Object.new.tap { |o| o.define_singleton_method(:generate) { |*args| result } }\n end",
"def yield\n @eff.yield.perform\n end",
"def met\n yield 1\n puts \"This is method\"\n yield 2\nend",
"def next_generation!\n @grid = next_generation\n end",
"def start\n yield\n end",
"def generate\n instance_eval( &LeftBishop )\n instance_eval( &RightBishop )\n instance_eval( &LeftRook )\n instance_eval( &SoleKing )\n instance_eval( &RightRook )\n instance_eval( &SoleQueen )\n rescue ExhaustedError\n end",
"def pre_loop; end",
"def each\n\t\tyield \"piaza\"\n\t\tyield \"spaghetti\"\n\t\tyield \"salad\"\n\t\tyield \"water\"\n\tend",
"def pipelined\n yield\n end",
"def generator\n unless @generator\n @doc.xpath(\"xmlns:generator\").each do |generator|\n @generator = Generator.new(generator)\n end \n end\n \n return generator\n end",
"def next_result()\n #This is a stub, used for indexing\n end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def through; end",
"def generators\n @generators ||= {}\n end",
"def each\n @gens.each { |g| g.rewind }\n\n loop do\n count = 0\n\n ret = @gens.map { |g|\n if g.end?\n count += 1\n nil\n else\n g.next\n end\n }\n\n if count == @gens.size\n break\n end\n\n yield ret\n end\n\n self\n end",
"def metodo\n\tyield('hola', 99)\nend",
"def next\n raise NotImplementedError\n end",
"def next\n raise NotImplementedError\n end",
"def get_iterator\n\t\tend",
"def next\n @next\n end",
"def generators\n @generators ||= []\n end",
"def generators\n @generators ||= []\n end",
"def runs; end",
"def yieldStat\n yield 5\n puts \"You are in the method test\"\n yield 100\nend",
"def run_generate(checksums); end",
"def run_this_for_me\n\tyield\nend",
"def gen_washing\r\r\n end",
"def app_generators; end",
"def iterate\n raise \"You should implement this\"\n end"
] | [
"0.729359",
"0.729359",
"0.72033226",
"0.72033226",
"0.7152807",
"0.7085607",
"0.7074787",
"0.69549644",
"0.6915871",
"0.69113964",
"0.69113964",
"0.69032913",
"0.69032913",
"0.67924577",
"0.6611314",
"0.6611213",
"0.65883774",
"0.65796053",
"0.6540793",
"0.65272987",
"0.65272987",
"0.65204924",
"0.65204924",
"0.6448413",
"0.6423407",
"0.64179635",
"0.6414087",
"0.64007485",
"0.6390928",
"0.63591003",
"0.63378835",
"0.63378835",
"0.6310015",
"0.6310015",
"0.6270043",
"0.6209191",
"0.61887276",
"0.618858",
"0.6185438",
"0.6141061",
"0.61136967",
"0.60978127",
"0.6081897",
"0.6019415",
"0.59958804",
"0.5994232",
"0.5987675",
"0.5976763",
"0.5966313",
"0.5955399",
"0.59075284",
"0.59075284",
"0.59075284",
"0.59039235",
"0.58717334",
"0.5866374",
"0.5866374",
"0.58581597",
"0.5852039",
"0.58489186",
"0.5816034",
"0.5789228",
"0.5776493",
"0.57567203",
"0.57323146",
"0.57289845",
"0.571989",
"0.5718619",
"0.5714765",
"0.57110786",
"0.57082397",
"0.57073724",
"0.56937146",
"0.56798005",
"0.56750375",
"0.5674393",
"0.5674393",
"0.5674393",
"0.5674393",
"0.5674393",
"0.5674393",
"0.5674393",
"0.5674393",
"0.5674393",
"0.5668314",
"0.5656827",
"0.5654633",
"0.5639257",
"0.563647",
"0.563647",
"0.56344134",
"0.56246424",
"0.5618962",
"0.5618962",
"0.56186646",
"0.56092685",
"0.5607289",
"0.56026393",
"0.55928475",
"0.55814785",
"0.5567278"
] | 0.0 | -1 |
Find token by representation of the token | def token_from_representation(repr)
token = Token.first(:token => repr)
if token.nil?
give_error(400, ERROR_USER_TOKEN_NOT_FOUND, "Token not found.").to_json
end
if !token.valid?
give_error(400, ERROR_USER_TOKEN_EXPIRED, "Token has expired.").to_json
end
return token
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_by_token(name, token)\n token = find_token(:name => \"#{name}\", :token => token)\n token.object if token\n end",
"def find_by_token(name, hash)\n token = find_token(name: name.to_s, token: hash)\n return unless token\n token.tokenizable\n end",
"def find_token(token_string)\n raise NotImplementedError\n end",
"def find_by_valid_token(name, token)\n token = find_token(:name => name.to_s, :token => token)\n return token.object if token && token.valid_for_use?\n end",
"def find_token(*args)\n if args.first.kind_of?(Hash)\n options = args.first\n else\n options = {\n name: args.first,\n token: args.last\n }\n end\n\n options.merge!(name: options[:name].to_s, tokenizable_type: self.name)\n Token.where(options).includes(:tokenizable).first\n end",
"def find_token_by_name(name)\n self.tokens.where(name: name.to_s).first\n end",
"def find_by_token(token)\n begin\n find(decode_token(token))\n rescue Hashids::InputError\n # controller should handle not found when we can't decode bad token\n return find(nil)\n end\n end",
"def find_by_valid_token(name, hash)\n token = find_token(name: name.to_s, token: hash)\n return if !token || token.expired?\n token.tokenizable\n end",
"def find_token\n shift_token || find_regex_token || find_string_token\n end",
"def token(name)\n self.token_codes.where(name: name.to_s).first\n end",
"def find_token(*args)\n body, list = _extract_token_search_args(args)\n lexed = lex(body)\n lexed.find.with_index do |tok, idx|\n is_token = list.include?(tok[1])\n is_not_symbol = idx == 0 || lexed[idx-1][1] != :on_symbeg\n is_token && is_not_symbol\n end\n end",
"def token_from_representation(repr)\n token = Token.first(:token => repr)\n if token.nil?\n give_error(400, ERROR_USER_TOKEN_NOT_FOUND, \"Token not found.\").to_json\n end\n \n return token\n end",
"def detect(token)\n\tTokenTypes.each do |type, matcher|\n\t\tif token =~ matcher\n\t\t\treturn { :token => token, :type => type }\n\t\tend\n\tend\n\traise ArgumentError.new \"Unknown token type for #{token}\"\nend",
"def from_token(token)\n self[token]\n end",
"def token_from(data)\n extract_from(data, /Token token='(.+)'/).first rescue nil\n end",
"def find_by_plaintext_token(attr, token)\n token = token.to_s\n\n find_by(attr => hashed_or_plain_token(token)) ||\n find_by_fallback_token(attr, token)\n end",
"def convert_tok(token)\n\t\tif token.to_i.to_s == token\n\t\t\treturn Integer(token)\n\t\telsif token.to_f.to_s == token\n\t\t\treturn Float(token)\n\t\telse\n\t\t\ttoken.to_sym\n\t\tend\n\tend",
"def decode(token)\n \n end",
"def find_by_token(encoded)\n token = Token.new(encoded: encoded)\n if token.valid?\n uid = token.payload[:uid] if token.payload\n User.find_by_id(uid)\n end\n end",
"def token(tokenname)\n @tokens[tokenname.to_sym]\n end",
"def find_by_token_for!(purpose, token)\n token_definitions.fetch(purpose).resolve_token(token) { |id| find(id) } ||\n (raise ActiveSupport::MessageVerifier::InvalidSignature)\n end",
"def getTokenKind()\n $tokens.at(0)\nend",
"def scan_for_t(token); end",
"def token(content, kind); end",
"def racc_read_token(t, tok, val); end",
"def token\n return @children['token'][:value]\n end",
"def token\n @token.present? ? @token : token_hash\n end",
"def token\n @token\n end",
"def to_param\n token\n end",
"def token\n @token\n end",
"def find(*args)\n if args[0].is_a?(String) && args[0].length == has_token_id_options[:length]\n record = find_by_token(args[0])\n end\n record || super(*args)\n end",
"def token\n @attributes[:token]\n end",
"def get_operation token\n OPERATOR_MAP[token]\n end",
"def convert_buffer_to_token(token_type); end",
"def atom(token)\n\tif token =~ /^[0-9]+$/\n\t\treturn token.to_i\n\telsif token =~ /^[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?$/\n\t\treturn token.to_f\n\telse\n\t\treturn token.to_sym\n\tend\nend",
"def decode(token)\n #return which user is this token???\n JWT.decode(token, secret_key, true, { algorithm: 'HS256' })[0]\n end",
"def translate_token(term)\n inverted_map = serializer.new(nil).inverted_activity_label_map\n inverted_map.select{|k,_v| k.match(/#{Regexp.escape(term)}/i)}.values\n end",
"def text_token(text, kind); end",
"def text_token(text, kind); end",
"def get_token(tag, tokens)\n tokens.each do |key, value|\n if tag.index(key) != nil then\n return value\n end\n end\n\n return nil\n end",
"def fetch_token(source_part)\n chars = source_part.split(//)\n if (['(', ')'].include?(chars[0]))\n [chars[0], chars[1..-1].join]\n elsif chars[0] == '\"'\n end_quot_pos = chars[1..-1].index {|c| c == '\"'}\n [chars[1..end_quot_pos].join, chars[end_quot_pos+2..-1].join]\n elsif chars[0] == '-'\n chars = chars[1..-1].join.strip.split(//)\n num_str = \"\"\n chars.each {|c|\n if (%w(0 1 2 3 4 5 6 7 8 9)).include?(c)\n num_str << c\n elsif ['(', ')', ' '].include?(c)\n break\n else\n raise \"unexpected token '#{c}'\"\n end\n }\n if num_str.blank?\n raise \"invalid token : -\"\n end\n\n [- num_str.to_i, chars[num_str.length..-1].join]\n elsif %w(0 1 2 3 4 5 6 7 8 9).include?(chars[0])\n num_str = \"\"\n chars.each {|c|\n if (%w(0 1 2 3 4 5 6 7 8 9)).include?(c)\n num_str << c\n elsif ['(', ')', ' '].include?(c)\n break\n else\n raise \"unexpected token '#{c}'\"\n end\n }\n\n [num_str.to_i, chars[num_str.length..-1].join]\n else\n\n token = \"\"\n chars.each {|c|\n if ['(', ')', ' '].include?(c)\n break\n else\n token << c\n end\n }\n\n [token.to_sym, chars[token.length..-1].join]\n end\nend",
"def token\n @data[:token]\n end",
"def use_token relation, token\n id, challenger = parse_token token\n model = relation.find(id)\n model if matches? model, challenger\n rescue ActiveRecord::RecordNotFound\n nil\n end",
"def find_by_token_for(purpose, token)\n raise UnknownPrimaryKey.new(self) unless primary_key\n token_definitions.fetch(purpose).resolve_token(token) { |id| find_by(primary_key => id) }\n end",
"def token_type; end",
"def to_s\n token\n end",
"def humanize_token_direct(token, value, select=\"name\")\n token_info = SiteConstants::ordered_hash(token)[value]\n return token_info[select] if token_info && value\n end",
"def find_by_case_insensitive_token(token)\n return if token.nil?\n where(\"lower(#{token_with_table_name}) = ?\", token.downcase).first\n end",
"def scout_token \n\treturn $tokens[$index].type\nend",
"def get_token(string)\n case string\n when /'(\\S+)/\n $1\n when *$token_table.keys\n $token_table[string]\n when $pats[:int]\n $&.to_i\n when /\\A\n \\[\n (.*)\n \\]\n \\Z/x\n a = $1.split(/\\s*,\\s*/)\n a.collect{|elem| get_token(elem)}\n else\n string\n end\nend",
"def token\n ready_token\n\n i = @buffer.index(/[\\[\\]()<>{}\\s\\/]/) || @buffer.size\n\n token_chars =\n if i == 0 and @buffer[i,2] == \"<<\" then 2\n elsif i == 0 and @buffer[i,2] == \">>\" then 2\n elsif i == 0 then 1\n else i\n end\n\n strip_space = !(i == 0 and @buffer[0,1] == '(')\n tok = head(token_chars, strip_space)\n\n if tok == \"\"\n nil\n elsif tok[0,1] == \"%\"\n @buffer = \"\"\n token\n else\n tok\n end\n end",
"def find_literal(literal)\n @literals_map[literal]\n end",
"def match token, stream: @stream\n matched = match_specification stream, grammar[token], token\n matched\n end",
"def to_param\n self.token\n end",
"def getTokenKind()\r\n return @curr_token.id\r\n end",
"def match_token (exp, token)\n\tputs \"Leaf token received: #{token.value}\"\n\tputs \"\\tExpecting token of type: #{exp}\"\n\n\tif exp == token.type\n\t\tputs \"\\t\\tShiny. Got #{token.type}!\"\n\t\t$cst.add_leaf(token.value, token)\n\t\t\n\t\t# To try to make this auto-managed\n\t\t$index = $index + 1\n\t\t\n\telse\n\t\traise FaultyTokenError.new(exp, token)\n\tend\nend",
"def validate_token(klass, token, options = {})\n return nil if token.blank?\n return nil unless token =~ /\\;/\n\n uid, token = token.split ';'\n if object = klass.find_by_id(uid) # , authentication_find_options[klass] || {}\n return object if object.authenticate(token)\n end\n nil\n end",
"def next()\n if @ss.scan_until(token_re)\n term = @ss.matched\n term_end = @ss.pos\n term_start = term_end - term.size\n else\n return nil\n end\n\n return Token.new(normalize(term), term_start, term_end)\n end",
"def token\n item = read\n return item['token'] if item['token']\n token_reset\n read['token']\n end",
"def token(resource)\n if Gem.win_platform?\n token_windows(resource)\n else\n token_nix(resource)\n end\n end",
"def match_token(token)\n return true\n end",
"def grabToken(astring)\r\n if astring =~ /([0-9a-fA-F]{32})/\r\n return $1\r\n end\r\n return nil\r\n end",
"def get_token\n\t\tt = Token.new\n\t\tcase @src[@lineno][@linepos]\n\t\t\twhen ' ' then\n\t\t\t\tskip_whitespace\n\t\t\twhen '\\f' then #less likely to see this\n\t\t\t\tskip_whitespace\n\t\t\twhen '\\t' then\n\t\t\t\tskip_whitespace\n\t\t\twhen '\\v' then\n\t\t\t\tskip_whitespace\n\t\t\twhen '0'..'9' then\n\t\t\t\tt = parse_number\n\t\t\twhen 'A-Z' then\n\t\t\t\tt = parse_name\n\t\t\twhen 'a-z' then\n\t\t\t\tparse_name\n\t\t\twhen '_' then\n\t\t\t\tt = parse_name\n\t\t\twhen /[~!$%\\^&*()-+=|{}\\[\\]\\:;\\/?<>,.]/ then #very much check\n\t\t\t\tt = parse_operator\n\t\t\twhen '\"' then\n\t\t\t\tt = parse_string\n\t\tend\n\tend",
"def token; end",
"def token; end",
"def token; end",
"def token; end",
"def token; end",
"def token; end",
"def get_token_text_and_type_as_target_label(generator, text, token_type)\n name = generator.attr_grammar.get_token_display_name(token_type)\n # If name is a literal, return the token type instead\n if ((name.char_at(0)).equal?(Character.new(?\\'.ord)))\n return String.value_of(token_type)\n end\n text_equivalent = (text).nil? ? name : text\n if (text_equivalent.char_at(0) >= Character.new(?0.ord) && text_equivalent.char_at(0) <= Character.new(?9.ord))\n return text_equivalent\n else\n return RJava.cast_to_string(generator.attr_grammar.attr_name + Grammar.attr_grammar_type_to_file_name_suffix[generator.attr_grammar.attr_type]) + \"_\" + text_equivalent\n end\n end",
"def find_valid_token(name, token)\n token = find_token(name, token)\n return unless token\n !token.expired? && token\n end",
"def to_s\n token_type\n end",
"def scan_for_at(token); end",
"def scan_for_in(token); end",
"def get_token\n if params.has_key?(:token) && params[:token] != ''\n return params[:token]\n end\n return nil if !request || !request.headers\n token_response = request.headers['Authorization']\n return nil if !token_response\n token_response[/^Token (.*)/,1]\n end",
"def test_finding_a_token\n assert_equal \"returns\", @vtree.get_token(\"current\\t\\treturns the current\", 16)\n end",
"def token_key\n @token_key\n end",
"def find_by_token!(token)\n record = find_by_token(token)\n raise ActiveRecord::RecordNotFound, \"Could not find #{self.name} with token #{token.inspect}\" if record.nil?\n record\n end",
"def find_literal(what)\n idx = @literals.index(what)\n return idx if idx\n add_literal(what)\n end",
"def decode(token)\n JWT.decode(token, secret_key, true, {algorithm: 'HS256'})[0]\n end",
"def to_param\n\t\tself.token\n\tend",
"def decode(token)\n JWT.decode(token, secret_key, true, {algorithm: \"HS256\"})[0]\n end",
"def token(value)\n merge(token: value.to_s)\n end",
"def token(value)\n merge(token: value.to_s)\n end",
"def token(value)\n merge(token: value.to_s)\n end",
"def token(value)\n merge(token: value.to_s)\n end",
"def token(value)\n merge(token: value.to_s)\n end",
"def token(value)\n merge(token: value.to_s)\n end",
"def token(value)\n merge(token: value.to_s)\n end",
"def token(value)\n merge(token: value.to_s)\n end",
"def token(value)\n merge(token: value.to_s)\n end",
"def token(value)\n merge(token: value.to_s)\n end",
"def token(value)\n merge(token: value.to_s)\n end",
"def token(value)\n merge(token: value.to_s)\n end",
"def token(value)\n merge(token: value.to_s)\n end",
"def token(value)\n merge(token: value.to_s)\n end",
"def token(value)\n merge(token: value.to_s)\n end",
"def token(value)\n merge(token: value.to_s)\n end",
"def getTokenDecode( token)\n params = Hash.new\n params['token'] = token\n return doCurl(\"get\",\"/token/decode\",params)\n end",
"def decode(token)\n JWT.decode(token, secret_key, true, { algorithm: 'HS256' })[0]\n end"
] | [
"0.7645852",
"0.75471294",
"0.73778474",
"0.7325185",
"0.709276",
"0.69753987",
"0.6929651",
"0.6843774",
"0.6813446",
"0.6757426",
"0.6743082",
"0.6701397",
"0.6475134",
"0.6425502",
"0.6350223",
"0.63098097",
"0.62975806",
"0.6294065",
"0.62726057",
"0.62498236",
"0.6223285",
"0.6215815",
"0.6188994",
"0.6108459",
"0.609201",
"0.60145354",
"0.60060036",
"0.59838337",
"0.59737927",
"0.5957007",
"0.5947221",
"0.5939832",
"0.5937206",
"0.5928758",
"0.5922979",
"0.5921933",
"0.59148073",
"0.5913813",
"0.5913813",
"0.5902313",
"0.58930284",
"0.583624",
"0.57789266",
"0.57785636",
"0.57522875",
"0.5747302",
"0.5726374",
"0.5701029",
"0.56917477",
"0.5682679",
"0.5681221",
"0.5679105",
"0.56738",
"0.56626606",
"0.5659642",
"0.56301415",
"0.56223994",
"0.5621836",
"0.56214875",
"0.5589086",
"0.5575637",
"0.55679375",
"0.55625343",
"0.5543815",
"0.5543815",
"0.5543815",
"0.5543815",
"0.5543815",
"0.5543815",
"0.55129254",
"0.55060196",
"0.5499213",
"0.5497667",
"0.5494851",
"0.54847026",
"0.5478057",
"0.54735976",
"0.5468428",
"0.54598325",
"0.5457137",
"0.54508084",
"0.543307",
"0.54316103",
"0.54316103",
"0.54316103",
"0.54316103",
"0.54316103",
"0.54316103",
"0.54316103",
"0.54316103",
"0.54316103",
"0.54316103",
"0.54316103",
"0.54316103",
"0.54316103",
"0.54316103",
"0.54316103",
"0.54316103",
"0.5429465",
"0.5428766"
] | 0.64062595 | 14 |
Returns the collection provided to the render call if present. | def collection
@options[:collection] if @options.key?(:collection)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def render_collection(collection = nil, options = nil)\n collection ||= @collection\n options ||= @collection_options || {}\n \n # to inherit to \"render_pure_collection\"\n @collection = collection\n @collection_options = options \n collection_template = options.delete(:collection_template) || @response_template || \"shared/collection\"\n render :partial => collection_template,\n :locals => {:collection => collection}.merge(options) \n end",
"def collection\n components.values.last[:collection]\n end",
"def collection\n @collector.collection\n end",
"def collection\n instance_variable_get(collection_name) || set_collection(find_collection)\n end",
"def collection\n self.class.collection\n end",
"def collection\n self.class.collection\n end",
"def collection\n @collection.is_a?(Proc) ? @collection.call : @collection\n end",
"def getCollection\n return @coll\n end",
"def collection\n @collection ||= load_collection\n end",
"def present_collection(collection = resource); nil; end",
"def collection\n klass.collection\n end",
"def collection\n Rails.logger.info \"XXXXX COLLECTION NAME #{collection_hash['collection name']}\"\n\n @collection ||= CollectionCreator.find_or_create_collection(\n collection_hash['collection name'],\n collection_hash['unit name'],\n collection_hash['collection description'],\n submitter_user_key\n )\n end",
"def collection\n klass.collection\n end",
"def collection\n action_name == 'show' ? @presenter : @collection\n end",
"def resource_collection\n run_context && run_context.resource_collection\n end",
"def render_collection_only(collection = nil, options = nil)\n collection ||= @collection\n options ||= {}\n @collection_options and options.merge! @collection_options\n content_tag :div, :id => (options[:working_div] || \"working_div\"), :class => \"op-set\" do \n render_pure_collection(collection, options)\n end\n end",
"def find_collection\n @collection = Collection.find(params[:id])\n end",
"def collection\n if @collection.kind_of? Proc\n @collection = @collection.call\n ensure_indices if @collection.kind_of? Mongo::Collection\n end\n return @collection\n end",
"def get_collection_ivar #:nodoc:\n if instance_variable_defined?(:\"@#{resource_collection_name}\")\n instance_variable_get(\"@#{resource_collection_name}\")\n else\n nil\n end\n end",
"def collection_from_options\n if options[:collection].is_a?(Proc)\n template.instance_exec(&options[:collection])\n else\n super\n end\n end",
"def collection\n @collection ||= Collection.load(self.collection_url)\n end",
"def collection\n get_collection_ivar || begin\n set_collection_ivar class_name.all\n end\n end",
"def collection\n @collection ||= PublicEarth::Db::Collection.find_by_id!(collection_id)\n end",
"def collection\n return nil unless collection_member?\n @collection ||= SolrDocument.new(\n Blacklight.solr.select(\n :params => {\n :fq => \"#{SolrDocument.unique_key}:\\\"#{self[blacklight_config.collection_member_identifying_field].first}\\\"\"\n }\n )[\"response\"][\"docs\"].first\n )\n end",
"def collection; @opts['collection'] end",
"def collection_of(template)\n collection template.templateName\nend",
"def collection?\n @resource.collection?\n end",
"def collection\n if @collection.empty? && @loaded == false\n @collection = forward( :\"#{@key}_fetch!\" ) || @collection || []\n @loaded = true\n end\n\n @collection\n end",
"def collection\n @collection ||= collection_values\n end",
"def find\n\t\tif defined?(@collection)\n\t\t\treturn @collection.find\n \tend\n\tend",
"def is_collection?\n @is_collection\n end",
"def collections\n respond_to?(:articleHasCollection) ? articleHasCollection : []\n end",
"def get_collection(name)\n @data[name]\n end",
"def collection_data\n @collection && @collection['data']\n end",
"def [](collection_name)\n collection(collection_name)\n end",
"def set_collection\n @collection = user_collections.detect{ |c| c.id.to_s == params[:id] }\n end",
"def collection\n attr_name = \"@\" + self.resources_configuration[:self][:collection_name].to_s\n unless instance_variable_get(attr_name)\n col = end_of_association_chain\n col = col.sorted(params[:sort], default_sort)\n col = col.page(params[:page])\n instance_variable_set(attr_name, col)\n end\n instance_variable_get(attr_name)\n end",
"def resource_collection\n @resource_collection ||= @run_context.resource_collection\n end",
"def resource_type\n :collection if collection?\n end",
"def resource_type\n :collection if collection?\n end",
"def get_collection(collection)\n filter_params = params[:filter] ? params[:filter].permit(self.class::DEFAULT_FIELDS) : {}\n if params[:filter].present? && filter_params.empty?\n render 'shared/http_status', locals: { code: '422', message:\n 'Invalid or malformed parameter values' }, status: :unprocessable_entity\n false\n else\n collection.order('id').where(filter_params)\n end\n end",
"def current_users_collections\n if current_user.respond_to?(:collections)\n current_user.collections.to_a\n else\n Collection.all\n end\n end",
"def collection(collection_name)\n default_scope.collection(collection_name)\n end",
"def collection\n feature_id = nil\n if params[:feature_id]\n feature_id = params[:feature_id]\n elsif params[:id]\n feature_id = object.feature_id\n end\n if params[:filter].blank? && !feature_id.blank?\n search_results = parent_object.definitions\n elsif !params[:filter].blank?\n search_results = Definition.search(params[:filter])\n search_results = search_results.where(:feature_id => feature_id) if feature_id\n else\n search_results = []\n end\n @collection = search_results.empty? ? search_results : search_results.page(params[:page])\n end",
"def collection(collection, options = {})\n respond_with_object_and_type collection, options, :collection, false\n end",
"def collection_or_multi_id_collection\n if multi_ids_request?\n selector = {multi_id_key => multi_ids}\n set_collection(resource_class.in(selector))\n else\n collection\n end\n end",
"def collection\n document._root.collection\n end",
"def type\n \"collection\"\n end",
"def model\n options.key?(:collection) ? call(:collection).klass : collection\n end",
"def is_collection\n return self.resource_type == Resource::LEARNING_COLLECTION;\n end",
"def source_collection\n collection = Collection.find(object.source_collection_id) if object.source_collection_id\n return collection.title unless collection.nil?\n end",
"def set_collection\n @collection = Collection.friendly.find(params[:id])\n end",
"def render(*args, &block)\n options = args.extract_options!\n paginated = options.delete(:paginate)\n size = options.delete(:size) { Paginate::Config.size }\n\n return super(*[*args, options], &block) unless paginated\n\n collection = options.delete(:collection) { args.shift }\n collection = collection[0, size]\n\n super(collection, *[*args, options], &block)\n end",
"def display_associated_collection(collection)\n empty_message = \n # If they're equal and it can be read, it's valid; can wrap this into a if class with the latter, but nah.\n if technology_profiles == collection #&& read_attribute(collection)\n \"This project doesn't have a technology profile generated (yet).\"\n elsif photos == collection #&& read_attribute(collection)\n 'No photos regarding this project are available.'\n end\n\n if collection.any?\n return render collection \n else\n return content_tag(:p, empty_message)\n end\n\n end",
"def collection_data\n @model || []\n end",
"def base_collection\n @base_collection ||= resource_model.all\n end",
"def collection_params\n params[:collection]\n end",
"def get_parent_collection()\n return XMLDBApi::RedCollection.new(@db_id, @coll_service.get_collection_id, @coll_service.get_collection_name)\n end",
"def collection\n resource_class.all\n end",
"def get_collection_id()\r\n return @coll_id\r\n end",
"def prepare_collection!(_wrapper, _element, options)\n options[:collection] = true\n options[:render_empty] = render_empty?\n end",
"def set_collection\n @collection = Collection.friendly.find params[:id]\n end",
"def collection\n database[collection_name]\n end",
"def orchestrate_collection_name\n ocollection\n end",
"def orchestrate_collection_name\n ocollection\n end",
"def set_collection\n @collection = Collection.find(params[:id])\n end",
"def set_collection\n @collection = Collection.find(params[:id])\n end",
"def set_collection\n @collection = Collection.find(params[:id])\n end",
"def collection\n @collection ||= google_session.collection_by_title('riskcovry_uploads')\n end",
"def collection_representer_klass\n resource_module::Representer::Collection\n end",
"def collection\n @user = User.find params[:id]\n\t if (@user.id == current_user_or_guest_id)\n response_service.title = \"My Whole Collection\"\n @empty_msg = \"Nothing here yet...but that's what the #{view_context.link_to_submit 'Cookmark Button', '/popup/starting_step2'} is for!\".html_safe\n @active_menu = :collections\n else\n response_service.title = \"#{@user.handle}'s Collection\"\n @empty_msg = \"They haven't collected anything?!? Why not Share something with them?\"\n @active_menu = :friends\n end\n smartrender unless do_stream UserCollectionCache\n end",
"def member_of_collections\n return [] unless model.respond_to?(:member_of_collection_ids)\n wayfinder.decorated_collections\n end",
"def render_for_api model\n if model.respond_to?(:each)\n begin\n # try to render collection template\n collection_name = model.first.class.model_name.collection\n render_to_string(partial: \"api/#{collection_name}.json\", locals: {collection_name.to_sym => model})\n rescue\n # fallback to array render\n \"[#{model.map(&method(:render_for_api)).join(',')}]\"\n end\n else\n render_to_string(model)\n end\n end",
"def make_collection\n @resource.make_collection\n end",
"def collection?\n true\n end",
"def set_collection\n @collection = User.find(current_user.id).collections.find(params[:id])\n end",
"def col\n volatile[:collection] ||= Collection.find(collection_id)\n end",
"def render_collection( resources, presenter: nil, pagination: :auto, **context, &block )\n render json: json_collection( resources, presenter, pagination: pagination, **context, &block )\n end",
"def collection\n get_collection_ivar || begin\n c = end_of_association_chain\n set_collection_ivar(c.respond_to?(:scoped) ? c.scoped : c.all)\n end\n end",
"def collection\n @collection ||= end_of_association_chain.paginate :conditions => 'visible = 1', :page => params[:page], :per_page => 21, :order => 'created_at DESC'\n \n @page_title = 'Shared Photos'\n @page_description = \"Click on a photo to see it's original resolution. Use the next and previous links to move through the list of photos.\"\n @feed_url = formatted_photos_url(:rss)\n \n return @collection\n end",
"def index\n @collections = current_user.collections\n end",
"def set_collection\n @collection = Collection.find(params[:id])\n end",
"def set_collection\n @collection = Collection.find(params[:id])\n end",
"def subcollections\n respond_to?(:collectionHasSubcollection) ? collectionHasSubcollection : []\n end",
"def set_collection\n @collection = Collection.find(params[:id])\n end",
"def set_collection\n @collection = Collection.find(params[:id])\n end",
"def set_collection\n @collection = Collection.find(params[:id])\n end",
"def set_collection\n @collection = Collection.find(params[:id])\n end",
"def member_collections\n collections\n end",
"def collection?\n false\n end",
"def collection?\n false\n end",
"def collection?\n false\n end",
"def resource_collection\n client.run_status.run_context.resource_collection\n end",
"def is_collection?\n contexts.flag11 == 1\n end",
"def collection\n return @client.api_helper.collection(\"items\")\n end",
"def collection?\n false\n end",
"def current_collection() instance_variable_get(\"@#{resource_plural}\") end",
"def set_collection\n @collection = current_user.collections.find(params[:id])\n end",
"def set_collection\n @collection = current_user.collections.find_by(id: params[:id]) if current_user\n end",
"def get_collection_by_url(url)\n\t\tdirs_name = url.split(\"/\")\n\t\tcollection = @session.root_collection\n\t\tdirs_name.each do |dir_name|\n\t\t\tcollection = collection.subcollection_by_title(dir_name)\n\t\tend\n\t\tcollection\n\tend"
] | [
"0.6769171",
"0.674476",
"0.6706905",
"0.66703516",
"0.66332984",
"0.66332984",
"0.65951645",
"0.6593896",
"0.6576815",
"0.65488607",
"0.6536653",
"0.6511331",
"0.6510969",
"0.6461943",
"0.6426802",
"0.6376298",
"0.6344552",
"0.6261289",
"0.62583977",
"0.62370044",
"0.6225864",
"0.62027085",
"0.61962324",
"0.61909163",
"0.61594373",
"0.61532044",
"0.61391544",
"0.6091254",
"0.60891205",
"0.6072401",
"0.6045693",
"0.6034289",
"0.60283124",
"0.6013299",
"0.6012883",
"0.60043454",
"0.59957176",
"0.5960509",
"0.59449685",
"0.59449685",
"0.5941175",
"0.5938799",
"0.5927393",
"0.58816785",
"0.5881259",
"0.58713895",
"0.58636755",
"0.5858978",
"0.58545315",
"0.58473104",
"0.58442867",
"0.58374757",
"0.5833143",
"0.5829922",
"0.58227974",
"0.58080286",
"0.5806805",
"0.58042276",
"0.5801019",
"0.57982427",
"0.5795058",
"0.578533",
"0.5784542",
"0.57820755",
"0.57820755",
"0.5768383",
"0.5768383",
"0.5768383",
"0.57529163",
"0.57495075",
"0.5744987",
"0.57375133",
"0.5726381",
"0.5716289",
"0.57157123",
"0.5693294",
"0.568535",
"0.56836784",
"0.5682404",
"0.567687",
"0.56750196",
"0.5674602",
"0.5674602",
"0.5672748",
"0.5670196",
"0.5670196",
"0.5670196",
"0.5670196",
"0.5656124",
"0.5653394",
"0.5653394",
"0.5653394",
"0.5648269",
"0.56437224",
"0.563964",
"0.5637337",
"0.5632941",
"0.56300515",
"0.5629165",
"0.56276023"
] | 0.6595546 | 6 |
def new end def create end | def show
path = params[:path]
@page = Page.find(:path => path)
if @page
respond_to do |format|
format.html do
@page.layout_template && self.class.layout(@page.layout_template)
end
format.xml do
@pages = @page.children
render :action => "index"
end
end
else
error
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\r\n\r\n end",
"def create; end",
"def create; end",
"def create; end",
"def create; end",
"def new \n end",
"def new \n end",
"def create\r\n end",
"def new\r\n end",
"def new\r\n end",
"def new\n\n end",
"def new\n\n end",
"def new\r\n \r\n end",
"def new\n\t\t\n\tend",
"def new\n\t\t\n\tend",
"def create\n end",
"def new\nend",
"def new\nend",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end",
"def new\n end"
] | [
"0.84706765",
"0.84688497",
"0.84688497",
"0.84688497",
"0.84688497",
"0.8412551",
"0.8412551",
"0.83974195",
"0.835175",
"0.835175",
"0.8349549",
"0.8349549",
"0.8337779",
"0.8316584",
"0.8316584",
"0.83123124",
"0.8308001",
"0.8308001",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539",
"0.8293539"
] | 0.0 | -1 |
GET /instituicao_responsavels GET /instituicao_responsavels.json | def index
@instituicao_responsavels = InstituicaoResponsavel.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @sesions = Sesion.where(entidad_paraestatal_id: @entidad_paraestatal.id).all\n @suplente = Suplente.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sesions }\n end\n end",
"def index\n @instituicoes = Instituicao.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @instituicoes }\n end\n end",
"def index\n @soils = Soil.where(:field_id => session[:field_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @soils }\n end\n end",
"def index\n @status_de_la_inscripcions = StatusDeLaInscripcion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_de_la_inscripcions }\n end\n end",
"def index\n @socios = Socio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @socios }\n end\n end",
"def index\n @peticion_servicio_tis = Peticion::ServicioTi.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @peticion_servicio_tis }\n end\n end",
"def index\n\n if params[:ventas_seguimiento]\n cliente_id = params[:ventas_seguimiento][:cliente_id]\n @ventas_seguimientos = Ventas::Seguimiento.where(\"cliente_id = ?\",cliente_id).order(\"created_at DESC\").paginate(:page => params[:page], :per_page => 5)\n @seguimientos = Ventas::Seguimiento.new(:cliente_id => cliente_id)\n else\n @ventas_seguimientos = Ventas::Seguimiento.order(\"created_at DESC\").paginate(:page => params[:page], :per_page => 5)\n @seguimientos = Ventas::Seguimiento.new\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ventas_seguimientos }\n end\n end",
"def index\n logement = Logement.find_by(id:params[:logement_id])\n equipement = logement.equi_securites[0].title\n equipements = logement.equi_securites[0]\n\n render json: {\n securites:equipement,\n fichier:equipements\n }\n end",
"def index\n @status_del_admitidos = StatusDelAdmitido.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_del_admitidos }\n end\n end",
"def index\n @responsibilities = Responsibility.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @responsibilities }\n end\n end",
"def index\n @status_de_interes_de_prospecto_validados = StatusDeInteresDeProspectoValidado.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_de_interes_de_prospecto_validados }\n end\n end",
"def show\n render json: @responsavel\n end",
"def index\n @establecimientos = Establecimiento.all\n respond_to do |format|\n format.json { \n\n if (params[:appkey].eql? appkey) #si el appkey es correcto\n\n ests = @establecimientos.map { |establecimiento| { :nombre_establecimiento => establecimiento.nombre, :id => establecimiento.id, \n :descripcion => establecimiento.descripcion, :longitud => establecimiento.longitud,\n :latitud => establecimiento.latitud, :direccion => establecimiento.direccion, :imagen => establecimiento.foto.url(:small),\n :eventos => establecimiento.eventos.map { |evento| { :nombre => evento.nombre } } } } \n render json: ests\n else\n render json: {:error => \"No autorizado\"}\n end\n\n\n\n }\n format.html { redirect_to :controller=>'login', :action=>'login' } #solo el app movil puede revisar toda la lista de establecimientos.\n end\n end",
"def index\n @interno_unidads = InternoUnidad.all\n render json: @interno_unidads\n end",
"def index\n @ativo_outros = AtivoOutro.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ativo_outros }\n end\n end",
"def index\n @asociados = Asociado.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @asociados }\n end\n end",
"def index\n @vehicule_persos = VehiculePerso.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @vehicule_persos }\n end\n end",
"def index\n @horas_disponibles = HorasDisponible.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @horas_disponibles }\n end\n end",
"def index\n @status_de_la_notificacions = StatusDeLaNotificacion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_de_la_notificacions }\n end\n end",
"def index\r\n @salles = Salle.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @salles }\r\n end\r\n end",
"def index\n @reprogramaciones = Reprogramacion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reprogramaciones }\n end\n end",
"def index\n @holidays = Holiday.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @holidays }\n end\n end",
"def semesters\n uni_year = UniYear.find_by_id(params[:uni_year_id])\n @semesters = uni_year ? uni_year.semesters : []\n \n respond_to do |format|\n format.json { render json: @semesters }\n end\n end",
"def search\n @instrumentos = Instrumento.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @salas }\n end\n end",
"def index\n @registrations = Tournament.find(params[:tournament_id]).registrations\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @registrations }\n end\n end",
"def index\r\n# @asistencias = Asistencia.all\r\n seccion = params[:seccion_id]\r\n if params[:seccion_id].nil?\r\n fecha = Date.current\r\n else\r\n fecha = params[:fecha].to_date\r\n end\r\n \r\n @asistencias = Asistencia.por_seccion_fecha(anio_escolar.id, seccion, fecha).salida\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @asistencias }\r\n end\r\n end",
"def show\n @solicitud_servicio = SolicitudServicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @solicitud_servicio }\n end\n end",
"def index\n @periodo_para_ingresars = PeriodoParaIngresar.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @periodo_para_ingresars }\n end\n end",
"def index\n @snps = Snp.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @snps }\n end\n end",
"def display\n @reservas = Reserva.order(fecha_inicio_estadia: :desc)\n render json: @reservas, include: [:cliente, :habitacion]\n end",
"def index\n @preparatoria_o_universidad_de_origens = PreparatoriaOUniversidadDeOrigen.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @preparatoria_o_universidad_de_origens }\n end\n end",
"def index\n @solicitacoes_avaliacoes_servicos = SolicitacoesAvaliacoesServico.all\n end",
"def index\n @frais_repas = FraisRepa.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @frais_repas }\n end\n end",
"def index\n @solicitudes = Solicitud.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @solicitudes }\n end\n end",
"def index\n @pedido_responsabilidades = PedidoResponsabilidade.all\n end",
"def index\n @ofertas = Oferta.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ofertas }\n end\n end",
"def index\n @expedientes = Expediente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expedientes }\n end\n end",
"def index\n @programa_de_interes = ProgramaDeIntere.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programa_de_interes }\n end\n end",
"def index\n @one_reg_institutions = OneRegInstitution.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @one_reg_institutions }\n end\n end",
"def index\n render json: @fiestas\n end",
"def show\n @sabio = Sabio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sabio }\n end\n end",
"def index\n @ultimo_grado_de_estudios = UltimoGradoDeEstudio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ultimo_grado_de_estudios }\n end\n end",
"def index\n @solicitacoes = Solicitacao.all\n end",
"def index\n @powiadomienia = Powiadomienie.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @powiadomienia }\n end\n end",
"def consulta\n fiesta = Fiesta.all\n render json: fiesta\n end",
"def index\n @patrocinios = Patrocinio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @patrocinios }\n end\n end",
"def index\n @itineraires = Itineraire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @itineraires }\n end\n end",
"def index\n @palestrantes = Palestrante.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @palestrantes }\n end\n end",
"def index\n @sightings = Sighting.all\n render json: @sightings\n end",
"def index\n sighting = Sighting.all \n render json: SightingSerializer.new(sighting)\n end",
"def index\n @essays = Essay.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @essays }\n end\n end",
"def index\n @cooperativas = Cooperativa.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @cooperativas }\n end\n end",
"def index\n @repas = Repa.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @repas }\n end\n end",
"def index\n @finalidad_cultivos = FinalidadCultivo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @finalidad_cultivos }\n end\n end",
"def index\n params[:page] ||= 1\n params[:per_page] ||= 10\n\n saloons = Saloon.all.paginate(page: params[:page], per_page: params[:per_page])\n\n render_success(data: saloons, each_serializer: SaloonSerializer)\n end",
"def index\n @solicitacao_pontuals = SolicitacaoPontual.all\n end",
"def index\n @points_spents = PointsSpent.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @points_spents }\n end\n end",
"def index\n @adversaires = Adversaire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @adversaires }\n end\n end",
"def index\n @empresas = Empresa.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @empresas }\n end\n end",
"def index\n @survey_answer_items = SurveyAnswerItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @survey_answer_items }\n end\n end",
"def index\n @dossiers = Dossier.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dossiers }\n end\n end",
"def index\n @socio_serasas = SocioSerasa.all\n end",
"def index\n @service_bookings = ServiceBooking.all\n\n render json: @service_bookings\n end",
"def index\n slip = Slip.all\n render json: {salary_computations:slip.as_json(except: [:id])}\n end",
"def index\n @surveys = Survey.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @surveys }\n end\n end",
"def index\n @surveys = Survey.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @surveys }\n end\n end",
"def index\n @dia_eventos = DiaEvento.all\n render json: @dia_eventos\n end",
"def index\n @rsvps = Rsvp.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rsvps }\n end\n end",
"def index\n @surveys = Survey.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @surveys }\n end\n end",
"def index\n @service_emails = ServiceEmail.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @service_emails }\n end\n end",
"def index\r\n @imobiliarias = Imobiliaria.all\r\n\r\n respond_to do |format|\r\n # format.html # index.html.erb\r\n format.json { render json: @imobiliarias }\r\n end\r\n end",
"def index\n @pedidos = Pedido.find(:all, :conditions => [\"cliente_id=?\", session[:usuario_id]])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pedidos }\n end\n end",
"def index\n @registries = Registry.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @registries }\n end\n end",
"def index\n # Si se filtró, lo que pidieron, si no lo que está\n # en la sesión, y si no este mes.\n unless params[:periodo].nil?\n session[:periodo_ps] = params[:periodo]\n else\n session[:periodo_ps] ||= 'este_mes'\n end\n\n case session[:periodo_ps]\n when 'este_mes'\n desde = Date.today.at_beginning_of_month\n hasta = Date.today.at_end_of_month\n \n @semanas = Semana.where(\" hasta > :desde and desde < :hasta \", :desde => desde, :hasta => hasta)\n when 'este_y_prox'\n desde = Date.today.at_beginning_of_month\n hasta = Date.today.next_month.at_end_of_month\n \n @semanas = Semana.where(\" hasta > :desde and desde < :hasta \", :desde => desde, :hasta => hasta)\n when 'todos' \n @semanas = Semana.all\n end\n \n @usuarios = Usuario.where(:carga_planificacion => true)\n \n @planificaciones_semanales = PlanificacionSemanal.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @planificaciones_semanales }\n end\n end",
"def index\n @susu_memberships = SusuMembership.page(params[:page]).per(params[:per])\n\n render json: @susu_memberships\n end",
"def index\n begin\n @holidaytypes = Holidaytype.where({:isactive=>1})\n @clean_types = @@stripper.activeRecordData(@holidaytypes)\n @@request_result[:success] = true\n @@request_result[:data] = @clean_types\n @@request_result[:metaData] = @@meta_data.create(@holidaytypes)\n rescue Exception => e\n @@request_result[:errmsg] = e.message\n end\n render json: @@request_result\n end",
"def index\n @slams = Slam.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @slams }\n end\n end",
"def index\n @plan_de_venta = PlanDeVentum.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @plan_de_venta }\n end\n end",
"def index\n @sulabh_addresses = SulabhAddress.all\n\trespond_to do |format|\n\t\tformat.js\n\t\tformat.html\n\tend \n end",
"def index\n @status_del_tramite_de_becas = StatusDelTramiteDeBeca.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_del_tramite_de_becas }\n end\n end",
"def index\n @solicituds = Solicitud.all\n end",
"def index\n @solicituds = Solicitud.all\n end",
"def show\n @ventas_seguimiento = Ventas::Seguimiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ventas_seguimiento }\n end\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pushup_reminders }\n end\n end",
"def index\n @output_surveys = OutputSurvey.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @output_surveys }\n end\n end",
"def index\n @solicitadors = Solicitador.all\n end",
"def index\n @deporte_usuarios = DeporteUsuario.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @deporte_usuarios }\n end\n end",
"def show\n @respuesta = Respuesta.find(params[:id])\n\n render json: @respuesta\n end",
"def index\n @tipo_usuarios = TipoUsuario.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tipo_usuarios }\n end\n end",
"def index\n \n @shareables = Shareable.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shareables }\n end\n end",
"def informacoes\n empregado = Empregado.find(params[:empregado_id])\n solicitacoes = Solicitacao.where(empregado_id: parametros[:empregado_id], mes_ano: parametros[:mes_ano])\n valor_ja_solicitado = solicitacoes.sum(&:valor)\n salario_disponivel = (empregado.salario || 0) - valor_ja_solicitado - solicitacoes.sum(&:taxa) # FIXME Romuloset - taxas\n\n render json: {\n valor_ja_solicitado: valor_ja_solicitado,\n salario_disponivel: salario_disponivel\n }\n end",
"def index\n @respuestas = Respuesta.all\n end",
"def index\n @issuing_institutions = IssuingInstitution.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @issuing_institutions }\n end\n end",
"def index\n @offices = Office.all\n json_response(@offices)\n end",
"def index\n @solicitacao_enviadas = SolicitacaoEnviada.all\n end",
"def index\n @profesors = Profesor.all\n # if @profesors!= nil\n#render json: @profesors\n#else\n# @profesors= '{\"exito\",false,\"no se encontraron profesores\"}'\n\n render json: @profesors\n # end\n end",
"def index\n @invites = Invite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @invites }\n end\n end",
"def index\n @invites = Invite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @invites }\n end\n end",
"def index\n @invites = Invite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @invites }\n end\n end",
"def show\n @serv_adicionale = ServAdicionale.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @serv_adicionale }\n end\n end"
] | [
"0.64445686",
"0.6441958",
"0.6382819",
"0.6294997",
"0.62898296",
"0.6272282",
"0.61052346",
"0.6098689",
"0.60829616",
"0.6068272",
"0.6057521",
"0.60361946",
"0.6019912",
"0.60100704",
"0.59947616",
"0.59881955",
"0.5979414",
"0.59651655",
"0.5959119",
"0.5937477",
"0.5898528",
"0.5897464",
"0.58941084",
"0.5884791",
"0.58845955",
"0.587946",
"0.5875859",
"0.58704364",
"0.5869842",
"0.5869198",
"0.5866292",
"0.5862955",
"0.5846008",
"0.58372754",
"0.58350945",
"0.5834337",
"0.58295536",
"0.5819487",
"0.5811737",
"0.5802801",
"0.5794615",
"0.57819504",
"0.57761174",
"0.5766605",
"0.5766148",
"0.57657003",
"0.5761144",
"0.5758375",
"0.57530254",
"0.5748823",
"0.5741955",
"0.5739623",
"0.573736",
"0.5737116",
"0.57370055",
"0.57336056",
"0.57334566",
"0.57316196",
"0.5730904",
"0.57280284",
"0.5726743",
"0.5725559",
"0.57240474",
"0.57196707",
"0.57148594",
"0.57148594",
"0.5714728",
"0.5714606",
"0.5714325",
"0.571259",
"0.5711908",
"0.5711074",
"0.5710674",
"0.5710202",
"0.57101214",
"0.5707352",
"0.57001424",
"0.5694751",
"0.56914026",
"0.5689128",
"0.5685553",
"0.5685338",
"0.5682751",
"0.56800455",
"0.5679747",
"0.5677168",
"0.5676984",
"0.567213",
"0.5671428",
"0.5670875",
"0.5661524",
"0.5661052",
"0.56602263",
"0.5657806",
"0.5656739",
"0.56546277",
"0.56516",
"0.56516",
"0.56516",
"0.5650181"
] | 0.700344 | 0 |
GET /instituicao_responsavels/1 GET /instituicao_responsavels/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @instituicao_responsavels = InstituicaoResponsavel.all\n end",
"def index\n @instituicoes = Instituicao.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @instituicoes }\n end\n end",
"def index\n @status_de_la_inscripcions = StatusDeLaInscripcion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_de_la_inscripcions }\n end\n end",
"def index\n @peticion_servicio_tis = Peticion::ServicioTi.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @peticion_servicio_tis }\n end\n end",
"def index\n logement = Logement.find_by(id:params[:logement_id])\n equipement = logement.equi_securites[0].title\n equipements = logement.equi_securites[0]\n\n render json: {\n securites:equipement,\n fichier:equipements\n }\n end",
"def show\n @solicitud_servicio = SolicitudServicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @solicitud_servicio }\n end\n end",
"def index\n\n if params[:ventas_seguimiento]\n cliente_id = params[:ventas_seguimiento][:cliente_id]\n @ventas_seguimientos = Ventas::Seguimiento.where(\"cliente_id = ?\",cliente_id).order(\"created_at DESC\").paginate(:page => params[:page], :per_page => 5)\n @seguimientos = Ventas::Seguimiento.new(:cliente_id => cliente_id)\n else\n @ventas_seguimientos = Ventas::Seguimiento.order(\"created_at DESC\").paginate(:page => params[:page], :per_page => 5)\n @seguimientos = Ventas::Seguimiento.new\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ventas_seguimientos }\n end\n end",
"def show\n @respuesta = Respuesta.find(params[:id])\n\n render json: @respuesta\n end",
"def index\n @sesions = Sesion.where(entidad_paraestatal_id: @entidad_paraestatal.id).all\n @suplente = Suplente.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sesions }\n end\n end",
"def index\n @status_del_admitidos = StatusDelAdmitido.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_del_admitidos }\n end\n end",
"def index\n @socios = Socio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @socios }\n end\n end",
"def index\n @status_de_la_notificacions = StatusDeLaNotificacion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_de_la_notificacions }\n end\n end",
"def show\n @instituicao = Instituicao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @instituicao }\n end\n end",
"def index\n @interno_unidads = InternoUnidad.all\n render json: @interno_unidads\n end",
"def index\n @horas_disponibles = HorasDisponible.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @horas_disponibles }\n end\n end",
"def index\n @ofertas = Oferta.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ofertas }\n end\n end",
"def index\n @status_de_interes_de_prospecto_validados = StatusDeInteresDeProspectoValidado.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_de_interes_de_prospecto_validados }\n end\n end",
"def show\n @serv_adicionale = ServAdicionale.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @serv_adicionale }\n end\n end",
"def show\n @servicio = Servicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @servicio }\n end\n end",
"def dame_institucion\n i = Metamares::Institucion.new\n i.nombre_institucion = params[:nombre_institucion]\n\n respond_to do |format|\n format.json { render json: i.busca_institucion.map{ |i| { id: i.id, value: i.nombre_institucion } } }\n format.html { @institucion = i }\n end\n end",
"def index\n @soils = Soil.where(:field_id => session[:field_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @soils }\n end\n end",
"def index\n @vehicule_persos = VehiculePerso.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @vehicule_persos }\n end\n end",
"def index\n @asociados = Asociado.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @asociados }\n end\n end",
"def index\n @cooperativas = Cooperativa.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @cooperativas }\n end\n end",
"def show\n render json: @responsavel\n end",
"def index\n @one_reg_institutions = OneRegInstitution.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @one_reg_institutions }\n end\n end",
"def show\n @empresa_servicio = EmpresaServicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @empresa_servicio }\n end\n end",
"def index\n @responsibilities = Responsibility.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @responsibilities }\n end\n end",
"def show\n @calificacion_servicio = CalificacionServicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @calificacion_servicio }\n end\n end",
"def show\n @respuesta = Respuesta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @respuesta }\n end\n end",
"def index\n @ativo_outros = AtivoOutro.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ativo_outros }\n end\n end",
"def show\n @ventas_seguimiento = Ventas::Seguimiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ventas_seguimiento }\n end\n end",
"def index\n @programa_de_interes = ProgramaDeIntere.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programa_de_interes }\n end\n end",
"def show\n @sabio = Sabio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sabio }\n end\n end",
"def index\n @periodo_para_ingresars = PeriodoParaIngresar.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @periodo_para_ingresars }\n end\n end",
"def show\n @status_de_la_inscripcion = StatusDeLaInscripcion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status_de_la_inscripcion }\n end\n end",
"def index\n @repas = Repa.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @repas }\n end\n end",
"def index\n @reprogramaciones = Reprogramacion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reprogramaciones }\n end\n end",
"def show\n @sitio_entrega = SitioEntrega.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sitio_entrega }\n end\n end",
"def index\n @frais_repas = FraisRepa.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @frais_repas }\n end\n end",
"def index\n @expedientes = Expediente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expedientes }\n end\n end",
"def index\n @preparatoria_o_universidad_de_origens = PreparatoriaOUniversidadDeOrigen.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @preparatoria_o_universidad_de_origens }\n end\n end",
"def show\n @selecao = Selecao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @selecao }\n end\n end",
"def index\n @uchronias = Uchronia.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @uchronias }\n end\n end",
"def index\n @establecimientos = Establecimiento.all\n respond_to do |format|\n format.json { \n\n if (params[:appkey].eql? appkey) #si el appkey es correcto\n\n ests = @establecimientos.map { |establecimiento| { :nombre_establecimiento => establecimiento.nombre, :id => establecimiento.id, \n :descripcion => establecimiento.descripcion, :longitud => establecimiento.longitud,\n :latitud => establecimiento.latitud, :direccion => establecimiento.direccion, :imagen => establecimiento.foto.url(:small),\n :eventos => establecimiento.eventos.map { |evento| { :nombre => evento.nombre } } } } \n render json: ests\n else\n render json: {:error => \"No autorizado\"}\n end\n\n\n\n }\n format.html { redirect_to :controller=>'login', :action=>'login' } #solo el app movil puede revisar toda la lista de establecimientos.\n end\n end",
"def index\n @status_del_tramite_de_becas = StatusDelTramiteDeBeca.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_del_tramite_de_becas }\n end\n end",
"def index\n @status_ref_pago_inscs = StatusRefPagoInsc.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_ref_pago_inscs }\n end\n end",
"def set_instituicao_responsavel\n @instituicao_responsavel = InstituicaoResponsavel.find(params[:id])\n end",
"def show\n @observacao_vocacionada = ObservacaoVocacionada.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @observacao_vocacionada }\n end\n end",
"def index\n @itineraires = Itineraire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @itineraires }\n end\n end",
"def display\n @reservas = Reserva.order(fecha_inicio_estadia: :desc)\n render json: @reservas, include: [:cliente, :habitacion]\n end",
"def index\n @dia_eventos = DiaEvento.all\n render json: @dia_eventos\n end",
"def index\n @patrocinios = Patrocinio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @patrocinios }\n end\n end",
"def index\r\n# @asistencias = Asistencia.all\r\n seccion = params[:seccion_id]\r\n if params[:seccion_id].nil?\r\n fecha = Date.current\r\n else\r\n fecha = params[:fecha].to_date\r\n end\r\n \r\n @asistencias = Asistencia.por_seccion_fecha(anio_escolar.id, seccion, fecha).salida\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @asistencias }\r\n end\r\n end",
"def index\n @holidays = Holiday.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @holidays }\n end\n end",
"def show\n @sezione = Sezione.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sezione }\n end\n end",
"def show\n @soiree = Soiree.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @soiree }\n end\n end",
"def index\r\n @imobiliarias = Imobiliaria.all\r\n\r\n respond_to do |format|\r\n # format.html # index.html.erb\r\n format.json { render json: @imobiliarias }\r\n end\r\n end",
"def consulta\n fiesta = Fiesta.all\n render json: fiesta\n end",
"def index\n @ultimo_grado_de_estudios = UltimoGradoDeEstudio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ultimo_grado_de_estudios }\n end\n end",
"def show\n @sitio = Sitio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sitio }\n end\n end",
"def index\n @registrations = Tournament.find(params[:tournament_id]).registrations\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @registrations }\n end\n end",
"def index\n @plan_de_venta = PlanDeVentum.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @plan_de_venta }\n end\n end",
"def index\n @finalidad_cultivos = FinalidadCultivo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @finalidad_cultivos }\n end\n end",
"def index\n @powiadomienia = Powiadomienie.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @powiadomienia }\n end\n end",
"def show\n @pessoa_receber = PessoaReceber.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @pessoa_receber }\n end\n end",
"def index\n render json: @fiestas\n end",
"def index\n @integrantes = Integrante.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @integrantes }\n end\n end",
"def index\r\n @respuesta = Respuestum.all\r\n end",
"def show\n @repuesto = Repuesto.find(params[:id])\n respond_to do |format|\n format.html { render :show }\n format.json { render json: @repuesto.to_json }\n end\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pushup_reminders }\n end\n end",
"def show\n @seguro = Seguro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @seguro }\n end\n end",
"def index\n @dossiers = Dossier.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dossiers }\n end\n end",
"def index\n @empresas = Empresa.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @empresas }\n end\n end",
"def index\n @ores = Ore.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ores }\n end\n end",
"def show\n @safra_verdoso = SafraVerdoso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @safra_verdoso }\n end\n end",
"def index\n @registro_videoconferencia = RegistroVideoconferencium.all\n render json: @registro_videoconferencia\n end",
"def index\n @pedidos = Pedido.find(:all, :conditions => [\"cliente_id=?\", session[:usuario_id]])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pedidos }\n end\n end",
"def index\n @pagamentos = Pagamento.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pagamentos }\n end\n end",
"def index\n @institutos = Instituto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @institutos }\n end\n end",
"def index\n @interruptions = Interruption.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @interruptions }\n end\n end",
"def index\n @palestrantes = Palestrante.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @palestrantes }\n end\n end",
"def index\n @unidade_medidas = UnidadeMedida.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @unidade_medidas }\n end\n end",
"def show\n @indicativo = Indicativo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @indicativo }\n end\n end",
"def show\n @sugerencia = Sugerencia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @sugerencia }\n end\n end",
"def index\n @premios = Premio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @premios }\n end\n end",
"def show\n @osoba = Osoba.find(params[:id])\n\n render json: @osoba\n end",
"def index\n @tipo_usuarios = TipoUsuario.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tipo_usuarios }\n end\n end",
"def index\n @adversaires = Adversaire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @adversaires }\n end\n end",
"def index\n @assuntos = Assunto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @assuntos }\n end\n end",
"def index\r\n @salles = Salle.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @salles }\r\n end\r\n end",
"def show\n @horas_disponible = HorasDisponible.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @horas_disponible }\n end\n end",
"def index\n @registries = Registry.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @registries }\n end\n end",
"def index\n @ruas = Rua.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ruas }\n end\n end",
"def index\n #@users = User.all\n @respuesta = Consulta.new(300,params[0])\n\n respond_to do |format|\n format.json { render json: @respuesta }\n \n end\n end",
"def index\n @curriculum_vitaes = findable_curriculum_vitaes.all\n respond_to do |format|\n format.html {}\n format.json { render json: @curriculum_vitaes }\n end\n end",
"def show\n @solicitud = Solicitud.find(params[:id])\n @respuestas=SolicitudRespuesta.find(:all,:select=>:usuario_id,:conditions=>{:solicitud_id=>params[:id]}).map(&:usuario_id)\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @solicitud }\n end\n end",
"def index\n @calificaciones = Calificacion.order('created_at DESC').all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @calificaciones }\n end\n end",
"def index\n @recipies = Recipy.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recipies }\n end\n end",
"def index\n @deporte_usuarios = DeporteUsuario.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @deporte_usuarios }\n end\n end",
"def show\n @status_de_la_notificacion = StatusDeLaNotificacion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status_de_la_notificacion }\n end\n end"
] | [
"0.69806325",
"0.6805434",
"0.6589629",
"0.645523",
"0.6402247",
"0.6369921",
"0.63497525",
"0.63427854",
"0.63418436",
"0.6335533",
"0.63314253",
"0.63141507",
"0.62701905",
"0.6267739",
"0.6264664",
"0.6252689",
"0.62477833",
"0.62396085",
"0.62174124",
"0.62150836",
"0.6210533",
"0.61961216",
"0.617",
"0.6165358",
"0.6162802",
"0.6159961",
"0.61539876",
"0.6149376",
"0.6145561",
"0.6140369",
"0.6134495",
"0.6131044",
"0.612296",
"0.611996",
"0.6119538",
"0.6109688",
"0.6095556",
"0.6075941",
"0.6070586",
"0.6068675",
"0.6062231",
"0.6054611",
"0.60420454",
"0.60336375",
"0.6029483",
"0.60258514",
"0.6015146",
"0.60045415",
"0.59989494",
"0.5995773",
"0.59953874",
"0.5993678",
"0.5991412",
"0.5980307",
"0.59778273",
"0.59650457",
"0.59620655",
"0.5960118",
"0.59520966",
"0.59520227",
"0.59457",
"0.59436154",
"0.5939457",
"0.59366566",
"0.593623",
"0.592883",
"0.5922342",
"0.5919489",
"0.59179586",
"0.590837",
"0.590615",
"0.59004754",
"0.5898444",
"0.58979326",
"0.5896828",
"0.5893809",
"0.58802456",
"0.5878432",
"0.587697",
"0.58671534",
"0.5864009",
"0.5862977",
"0.58625084",
"0.58607304",
"0.5850355",
"0.58487105",
"0.5844522",
"0.5843599",
"0.58403563",
"0.5839915",
"0.5839464",
"0.5834068",
"0.5831719",
"0.58314234",
"0.5830146",
"0.5825534",
"0.5820713",
"0.58174217",
"0.5809788",
"0.58050764",
"0.58048093"
] | 0.0 | -1 |
POST /instituicao_responsavels POST /instituicao_responsavels.json | def create
@instituicao_responsavel = InstituicaoResponsavel.new(instituicao_responsavel_params)
respond_to do |format|
if @instituicao_responsavel.save
format.html { redirect_to @instituicao_responsavel, notice: 'Instituicao responsavel was successfully created.' }
format.json { render :show, status: :created, location: @instituicao_responsavel }
else
format.html { render :new }
format.json { render json: @instituicao_responsavel.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @responsavel = Responsavel.new(responsavel_params)\n\n if @responsavel.save\n render json: @responsavel, status: :created, location: @responsavel\n else\n render json: @responsavel.errors, status: :unprocessable_entity\n end\n end",
"def socio_economico_submit\n\n # responding for the first time\n if not session[:current_response_id]\n current_response = nil\n # preparing the object to store the surveys and requests data\n json_response = { 'surveys' => [], 'requests' => [] }\n else\n current_response = FormResponse.find(session[:current_response_id])\n json_response = JSON.parse current_response.json_response\n end\n\n # appending the new response to the array of surveys\n surveys_number = json_response['surveys'].size\n json_response['surveys'] = [] if surveys_number == 0\n json_response['surveys'].push(\n params.merge({\n :attempt => (surveys_number + 1),\n :sent_at => Time.zone.now\n })\n )\n\n if current_response\n current_response.update({\n json_response: json_response.to_json\n })\n else\n # the response must be created only in this form\n # and not in the request form!\n current_response = FormResponse.create({\n form_id: Form.where(reference_model: 'FormVagasRemanescentes').first.id,\n user: current_user.email,\n json_response: json_response.to_json\n })\n\n # storing the response id in session to access it\n # from the other form, the request form\n session[:current_response_id] = current_response.id\n end\n\n redirect_to action: 'pedido'\n end",
"def create\n @respuesta = Respuesta.new(params[:respuesta])\n\n if @respuesta.save\n render json: @respuesta, status: :created, location: @respuesta\n else\n render json: @respuesta.errors, status: :unprocessable_entity\n end\n end",
"def index\n @instituicao_responsavels = InstituicaoResponsavel.all\n end",
"def create\n @situacao_reserva = SituacaoReserva.new(situacao_reserva_params)\n @situacao_reservas = SituacaoReserva.all.paginate(page: params[:page], per_page: 5)\n @action = { title: \"Nova\", button: \"Salvar\"}\n\n respond_to do |format|\n if @situacao_reserva.save\n format.html { redirect_to action: \"new\", notice: 'Situação reserva criada com sucesso..' }\n format.json { render :show, status: :created, location: @situacao_reserva }\n else\n format.html { render :new }\n format.json { render json: @situacao_reserva.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @sindicato = Sindicato.new(sindicato_params)\n\n respond_to do |format|\n if @sindicato.save\n format.html { redirect_to @sindicato, notice: 'Sindicato fue creado exitosamente.' }\n format.json { render :show, status: :created, location: @sindicato }\n else\n format.html { render :new }\n format.json { render json: @sindicato.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @solicitacoes_avaliacoes_servico = SolicitacoesAvaliacoesServico.new(solicitacoes_avaliacoes_servico_params)\n\n respond_to do |format|\n if @solicitacoes_avaliacoes_servico.save\n format.html { redirect_to @solicitacoes_avaliacoes_servico, notice: 'Solicitacoes avaliacoes servico was successfully created.' }\n format.json { render action: 'show', status: :created, location: @solicitacoes_avaliacoes_servico }\n else\n format.html { render action: 'new' }\n format.json { render json: @solicitacoes_avaliacoes_servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @solicitacao_repass = SolicitacaoRepasse.new(solicitacao_repasse_params)\n @entregas_externas = EntregaExterna.all\n @entregas_externas_usuario = []\n @entregas_externas.each { |entrega|\n if !@current_user.isMorador || entrega.encomenda.usuario.id == @current_user.id\n @entregas_externas_usuario.push(entrega)\n end\n }\n\n respond_to do |format|\n if @solicitacao_repass.save\n format.html { redirect_to @solicitacao_repass, notice: \"Solicitacao repasse was successfully created.\" }\n format.json { render :show, status: :created, location: @solicitacao_repass }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @solicitacao_repass.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @sabio = Sabio.new(params[:sabio])\n\n respond_to do |format|\n if @sabio.save\n format.html { redirect_to @sabio, notice: 'El Sabio a sido creado exitosamente.' }\n format.json { render json: @sabio, status: :created, location: @sabio }\n else\n format.html { render action: \"new\" }\n format.json { render json: @sabio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def instituicao_responsavel_params\n params.require(:instituicao_responsavel).permit(:instituicao_id, :nome, :inseridoPor, :dataDeInsercao, :atualizadoPor, :dataDeAtualizacao)\n end",
"def create\n @response = Response.new\n \n reason = Reason.new\n reason.why = params[:response][:reason][:why]\n reason.critique = params[:response][:reason][:critique]\n @response.reasons = [reason]\n\n @response.who = params[:response][:who]\n @response.ip_address = request.remote_ip\n @response.user_agent = request.env['HTTP_USER_AGENT']\n\n respond_to do |format|\n if @response.save\n format.html { redirect_to root_url, notice: 'Your response was successfully submitted! Thanks for taking the time to affect change in our government.' }\n format.json { render json: @response, status: :created, location: @response }\n else\n format.html { render action: \"new\" }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @sinh_vien = SinhVien.new(params[:sinh_vien])\n\n respond_to do |format|\n if @sinh_vien.save \n format.json { render json: @sinh_vien, status: :created, location: @sinh_vien }\n else \n format.json { render json: @sinh_vien.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @sprint.save\n\n respond_with(@sprint)\n end",
"def create\n\n respond_to do |format|\n if @especialidad.save\n format.html { redirect_to @especialidad, notice: 'Servicio creado exitosamente.' }\n format.json { render :show, status: :created, location: @especialidad }\n else\n format.html { render :new }\n format.json { render json: @especialidad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @payment = Payment.new(payment_params)\n url = 'http://localhost/servicio/Despachador.php'\n parametros = {params: {\n \"servicio\" => 8,\n \"numtarjeta\" => payment_params[:card_number],\n \"cedtitular\" => \"V#{payment_params[:identification]}\",\n \"mesexpiracion\" => payment_params[:expiration_month],\n \"annoexpiracion\" => payment_params[:expiration_year],\n \"codseguridad\" => payment_params[:security_code],\n \"monto\" => payment_params[:amount]\n }}\n\n # \"servicio\" => 4,\n # \"numtarjeta\" => 1234567898765432,\n # \"cedtitular\" => 20296530,\n # \"mesexpiracion\" => 8,\n # \"annoexpiracion\" => 17,\n # \"codseguridad\" => 301,\n # \"monto\" => 3000\n # }}\n resultado = ActiveSupport::JSON.decode(RestClient.get(url, parametros))\n respond_to do |format|\n if resultado[\"exito\"] == \"true\"\n\n if @payment.save\n puts \"entro al save\"\n format.html { redirect_to new_organization_path, notice: 'Su pago ha sido procesado satisfactoriamente' }\n format.json { render :show, status: :created, location: @payment }\n else\n format.html { render :new }\n format.json { render json: @payment.errors, status: :unprocessable_entity }\n end\n\n else\n format.html { render :new , notice: 'Hubo un problema con su solicitud, consulte a su banco para mas informacion'}\n format.json { render json: @payment.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"def create\n @seihinn = Seihinn.new(seihinn_params)\n\n respond_to do |format|\n if @seihinn.save\n format.html { redirect_to @seihinn, notice: \"Seihinn was successfully created.\" }\n format.json { render :show, status: :created, location: @seihinn }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @seihinn.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @siritori = Siritori.new(siritori_params)\n\n respond_to do |format|\n if @siritori.save\n format.html { redirect_to @siritori, notice: 'Siritori was successfully created.' }\n format.json { render :show, status: :created, location: @siritori }\n else\n format.html { render :new }\n format.json { render json: @siritori.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\r\n @sivic_pessoa = SivicPessoa.new(sivic_pessoa_params)\r\n\r\n respond_to do |format|\r\n if @sivic_pessoa.save\r\n format.html { redirect_to @sivic_pessoa, notice: 'Registro inserido com sucesso.' }\r\n format.json { render action: 'show', status: :created, location: @sivic_pessoa }\r\n else\r\n format.html { render action: 'new' }\r\n format.json { render json: @sivic_pessoa.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\n \n\n respond_to do |format|\n if @consultorio.save\n format.html { redirect_to @consultorio, notice: 'Consultorio creado exitosamente.' }\n format.json { render :show, status: :created, location: @consultorio }\n else\n format.html { render :new }\n format.json { render json: @consultorio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @palabra = Palabra.new(params[:palabra])\n @palabra.significados = params[:significados] \n respond_to do |format|\n if @palabra.save\n format.html { redirect_to @palabra, notice: 'La palabra fue guardada correctamente.' }\n format.json { render json: @palabra, status: :created, location: @palabra }\n else\n format.html { render action: \"new\" }\n format.json { render json: @palabra.errors, status: :unprocessable_entity }\n end\n end\n end",
"def criar_sobrevivente\n @suvivor = Sobrevivente.create(\n name: params[:name], genero: params[:genero], idade: params[:idade],\n lat: params[:lat], lon: params[:lon],\n agua: params[:agua], comida: params[:comida], medicamento: params[:medicamento],\n municao: params[:municao]\n )\n render json: @suvivor\n end",
"def create\n @safra_averiado = SafraAveriado.new(params[:safra_averiado])\n\n respond_to do |format|\n if @safra_averiado.save\n format.html { redirect_to @safra_averiado, notice: 'Safra averiado was successfully created.' }\n format.json { render json: @safra_averiado, status: :created, location: @safra_averiado }\n else\n format.html { render action: \"new\" }\n format.json { render json: @safra_averiado.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @serv_adicionale = ServAdicionale.new(params[:serv_adicionale])\n\n respond_to do |format|\n if @serv_adicionale.save\n format.html { redirect_to @serv_adicionale, notice: 'Serv adicionale was successfully created.' }\n format.json { render json: @serv_adicionale, status: :created, location: @serv_adicionale }\n else\n format.html { render action: \"new\" }\n format.json { render json: @serv_adicionale.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @Empresa = Empresa.find(params[:empresa_id])\n p simulacion_params[:id]\n if simulacion_params[:id]!=nil\n respond_to do |format| \n format.html { render json: 1 and return}\n end\n end\n [email protected](simulacion_params)\n respond_to do |format|\n if simulacion.save\n format.html { render json: {simulacion:simulacion}}\n else\n format.html { render action: simulacion.errors }\n end\n end\n end",
"def create\n question_response = QuestionResponse.build_response_essay(current_user, params)\n\n if question_response.try :save\n render json: { message: \"answer saved\" }\n else\n render json: { message: \"error\" }, status: :unprocessable_entity\n end\n end",
"def create\n @asistencia_domingo = AsistenciaDomingo.new(asistencia_domingo_params)\n\n asistencia_reunion_evangelist_id = asistencia_reunion_evangelist_param[:asistencia_reunion_evangelist_id]\n asistencia_reunion_planificacion_id = asistencia_reunion_planificacion_param[:asistencia_reunion_planificacion_id]\n\n if @asistencia_domingo.save\n redirect_to controller: 'reporte_semanal_celulas', action: 'new', asistencia_domingo_id: @asistencia_domingo.id, asistencia_reunion_evangelist_id: asistencia_reunion_evangelist_id, asistencia_reunion_planificacion_id: asistencia_reunion_planificacion_id , notice: 'Asistencia domingos was successfully created.'\n return\n end\n\n respond_to do |format|\n if !@asistencia_domingo.save\n format.html { render :new }\n format.json { render json: @asistencia_domingo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @solicitud_servicio = SolicitudServicio.new(params[:solicitud_servicio])\n\n respond_to do |format|\n if @solicitud_servicio.save\n format.html { redirect_to @solicitud_servicio, notice: 'Solicitud servicio was successfully created.' }\n format.json { render json: @solicitud_servicio, status: :created, location: @solicitud_servicio }\n else\n format.html { render action: \"new\" }\n format.json { render json: @solicitud_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @sesions = Sesion.where(entidad_paraestatal_id: @entidad_paraestatal.id).all\n @suplente = Suplente.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sesions }\n end\n end",
"def index\n begin\n @holidaytypes = Holidaytype.where({:isactive=>1})\n @clean_types = @@stripper.activeRecordData(@holidaytypes)\n @@request_result[:success] = true\n @@request_result[:data] = @clean_types\n @@request_result[:metaData] = @@meta_data.create(@holidaytypes)\n rescue Exception => e\n @@request_result[:errmsg] = e.message\n end\n render json: @@request_result\n end",
"def create\n @pedido_responsabilidade = PedidoResponsabilidade.new(pedido_responsabilidade_params)\n if (@permissao_novo && Laboratorio.find(@pedido_responsabilidade.id_laboratorio).responsavel == nil)\n @pedido_responsabilidade.id_docente = current_user.id\n respond_to do |format|\n if @pedido_responsabilidade.save\n format.html { redirect_to account_path, notice: 'Pedido responsabilidade was successfully created.' }\n format.json { render :show, status: :created, location: @pedido_responsabilidade }\n else\n format.html { render :new }\n format.json { render json: @pedido_responsabilidade.errors, status: :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n format.html { redirect_to account_path, notice: 'Não foi possível solicitar responsabilidade.' }\n format.json { head :no_content }\n end\n end\n end",
"def create\n @estacionamiento = Estacionamiento.new(estacionamiento_params)\n @lista_departamentos = Ubigeo.find_by_sql(\"select distinct idDepartamento, Departamento from ubigeos\")\n @lista_provincias = Ubigeo.find_by_sql(\"select distinct idProvincia, Provincia from ubigeos\")\n @lista_distritos = Ubigeo.find_by_sql(\"select distinct idDistrito, Distrito from ubigeos\")\n @serv_adicinales = ServAdicinale.all\n\n respond_to do |format|\n if @estacionamiento.save\n format.html { redirect_to @estacionamiento, notice: 'Estacionamiento was successfully created.' }\n format.json { render :show, status: :created, location: @estacionamiento }\n else\n format.html { render :new }\n format.json { render json: @estacionamiento.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @respuesta = Respuesta.new(params[:respuesta])\n\n respond_to do |format|\n if @respuesta.save\n format.html { redirect_to @respuesta, notice: 'Respuesta was successfully created.' }\n format.json { render json: @respuesta, status: :created, location: @respuesta }\n else\n format.html { render action: \"new\" }\n format.json { render json: @respuesta.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\r\n @sivic_profissao = SivicProfissao.new(sivic_profissao_params)\r\n\r\n respond_to do |format|\r\n if @sivic_profissao.save\r\n format.html { redirect_to @sivic_profissao, notice: 'Sivic profissao was successfully created.' }\r\n format.json { render action: 'show', status: :created, location: @sivic_profissao }\r\n else\r\n format.html { render action: 'new' }\r\n format.json { render json: @sivic_profissao.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\n @solicitud = Solicitud.new(solicitud_params)\n\n respond_to do |format|\n if @solicitud.save\n format.html { redirect_to @solicitud, notice: \"Solicitud was successfully created.\" }\n format.json { render :show, status: :created, location: @solicitud }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @solicitud.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @solicitudrecurso = Solicitudrecurso.new\n @solicitudrecurso.tipo=params[:tipo]\n @solicitudrecurso.fechasol=Date.today\n @solicitudrecurso.horaini=params[:horai]\n @solicitudrecurso.horafin=params[:horaf]\n @solicitudrecurso.fechareserva=session[:fechares]\n @solicitudrecurso.usuario_id=session[:user_id]\n @solicitudrecurso.motivos=params[:motivos]\n nombrecomp = params[:usuario].to_s.split(', ')\n @solicitudrecurso.usuario_id = Usuario.where(\"nombre = :nombre and apellidos = :apellidos\", {:nombre => nombrecomp[1], :apellidos => nombrecomp[0]}).first.id\n \n \n if @solicitudrecurso.save\n familia=Recurso.find_by_identificador(@solicitudrecurso.tipo).descripcion\n @recs=Recurso.where( 'descripcion = ? and disponible = ?',familia,\"t\").to_a\n @[email protected] {|r| r.identificador}\n #session[:fechares]=params[:fecha]\n dia=formato_europeo(session[:fechares])\n #alreves=session[:fechares].to_s.split('-')\n #dia=alreves[2]+\"-\"+alreves[1]+\"-\"+alreves[0]\n @reservas = Solicitudrecurso.where('tipo in (?) and fechareserva = ?', @ids,dia).to_a\n\n respond_to do |format|\n format.js\n end\n \n end\n \n\n end",
"def create\r\n @sivic_rede = SivicRede.new(sivic_rede_params)\r\n\r\n respond_to do |format|\r\n if @sivic_rede.save\r\n format.html { redirect_to @sivic_rede, notice: 'Rede inserida com sucesso.' }\r\n format.json { render action: 'show', status: :created, location: @sivic_rede }\r\n else\r\n format.html { render action: 'new' }\r\n format.json { render json: @sivic_rede.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\r\n\r\n respond_to do |format|\r\n if @sepi_programa.save\r\n format.html { redirect_to @sepi_programa, notice: 'Se añadió un programa de SEPI correctamente.' }\r\n format.json { render :show, status: :created, location: @sepi_programa }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @sepi_programa.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\n @servicerequest = Servicerequest.new(servicerequest_params)\n @servicerequest.user_id = current_user.username\n @servicerequest.specification_id = session[:specification_sel_id]\n @servicerequest.seccion = @servicerequest.seccion.upcase\n @servicerequest.contacto_int = @servicerequest.contacto_int.upcase\n @servicerequest.correo_int = @servicerequest.correo_int.upcase\n @servicerequest.observacion = @servicerequest.observacion.upcase\n respond_to do |format|\n if @servicerequest.save\n format.html { redirect_to @servicerequest, notice: 'Service request was successfully created.' }\n format.json { render :show, status: :created, location: @servicerequest}\n else\n format.html { render :new }\n format.json { render json: @servicerequest.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @solicitacao_enviada = SolicitacaoEnviada.new(solicitacao_enviada_params)\n\n respond_to do |format|\n if @solicitacao_enviada.save\n format.html { redirect_to @solicitacao_enviada, notice: 'Solicitacao enviada was successfully created.' }\n format.json { render :show, status: :created, location: @solicitacao_enviada }\n else\n format.html { render :new }\n format.json { render json: @solicitacao_enviada.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @resi = Resi.new(resi_params)\n\n respond_to do |format|\n if @resi.save\n format.html { redirect_to @resi, notice: 'Resi was successfully created.' }\n format.json { render :show, status: :created, location: @resi }\n else\n format.html { render :new }\n format.json { render json: @resi.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @sesiune = Sesiune.new(sesiune_params)\n\n respond_to do |format|\n if @sesiune.save\n\n # duplic temele si domeniile din ultima sesiune si le adaug in baza de date cu sesiune_id asta pe care tocmai am creat-o\n @ultima_sesiune = Sesiune.where(este_deschisa: false).last\n Domeniu.where(sesiune_id: @ultima_sesiune.id).each do |dom|\n nou_dom = Domeniu.create(nume: dom.nume, descriere: dom.descriere, user_id: dom.user_id, sesiune_id: @sesiune.id)\n Tema.where(sesiune_id: @ultima_sesiune.id).where(domeniu_id: dom.id).each do |tema|\n Tema.create(nume: tema.nume, descriere: tema.descriere, domeniu_id: nou_dom.id, este_libera: true, user_id: tema.user_id, sesiune_id: @sesiune.id)\n # ce faci dc user_id-ul temei este un student care a terminat? si th i se desfiinteaza contul?\n end\n end\n\n format.html { redirect_to controlPanel_path, notice: 'Sesiune was successfully created.' }\n format.json { render action: 'show', status: :created, location: @sesiune }\n else\n format.html { render action: 'new' }\n format.json { render json: controlPanel_path.errors, status: :unprocessable_entity }\n end\n end\n end",
"def asignar_cliente\n @usuario = Usuario.find(params[:responsable])\n @clientes = params[:cliente]\n respond_to do |format|\n if @usuario.responsable? or @usuario.transcriptor?\n for cliente in @clientes.values\n nuevo = Cliente.create(:usuario_id => @usuario.id, :cliente_id => cliente)\n @usuario.clientes << nuevo\n end \n format.html { redirect_to @usuario, notice: 'Clientes asignados satisfactoriamente'}\n else \n format.html { redirect_to update_usuario_path, notice: 'Error en servidor. Intente más tarde' }\n end\n end\n end",
"def create\n @solicitador = Solicitador.new(solicitador_params)\n\n respond_to do |format|\n if @solicitador.save\n format.html { redirect_to @solicitador, notice: 'Solicitador was successfully created.' }\n format.json { render :show, status: :created, location: @solicitador }\n else\n format.html { render :new }\n format.json { render json: @solicitador.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n respond_to do |format|\n if @himalaya.save\n UserMailer.reserva_confirmation(@himalaya).deliver\n format.html { redirect_to @himalaya, notice: \"Gracias #{@himalaya.nombre} por reserva.| Datos de reserva envia en su correo electronico\" }\n format.json { render json: @himalaya, status: :created, location: @himalaya }\n else\n format.html { render action: \"new\" }\n format.json { render json: @himalaya.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @soiree = Soiree.new(soiree_params)\n\n respond_to do |format|\n if @soiree.save\n format.html { redirect_to @soiree, notice: 'Votre évènement a bien été créé.' }\n format.json { render :show, status: :created, location: @soiree }\n else\n format.html { render :new }\n format.json { render json: @soiree.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @exemplaresproduto = Exemplaresproduto.new(exemplaresproduto_params)\n\n respond_to do |format|\n if @exemplaresproduto.save\n format.html { redirect_to @exemplaresproduto, notice: 'Exemplaresproduto was successfully created.' }\n format.json { render :show, status: :created, location: @exemplaresproduto }\n else\n format.html { render :new }\n format.json { render json: @exemplaresproduto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @respuesta = Respuesta.new(respuesta_params)\n\n respond_to do |format|\n if @respuesta.save\n format.html { redirect_to @respuesta, notice: 'Respuesta was successfully created.' }\n format.json { render :show, status: :created, location: api_v1_respuesta_url(@respuesta) }\n else\n format.html { render :new }\n format.json { render json: @respuesta.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @response = Response.new(response_params)\n\n respond_to do |format|\n if @response.save\n format.html { redirect_to survey_responses_path(@survey), notice: 'Thanks for your response!' }\n format.json { render :show, status: :created, location: @response }\n else\n format.html { render :new }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @suscriber = Suscriber.new(suscriber_params)\n\n respond_to do |format|\n if @suscriber.save\n format.html { redirect_to suscribe_path, notice: t(:suscribed) }\n format.json { render :show, status: :created, location: suscribe_path }\n else\n format.html { redirect_to suscribe_path, alert: t(:suscriber_exist)}\n format.json { render json: @suscriber.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @souvenir = Souvenir.new(souvenir_params)\n\n respond_to do |format|\n if @souvenir.save\n format.html { redirect_to @souvenir, notice: 'Souvenir was successfully created.' }\n format.json { render :show, status: :created, location: @souvenir }\n else\n format.html { render :new }\n format.json { render json: @souvenir.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n puts \"within create method of wells_fargo_srp_sheets with params: #{wells_fargo_srp_sheet_params.inspect}\"\n @wells_fargo_srp_sheet = WellsFargoSrpSheet.new(wells_fargo_srp_sheet_params)\n\n respond_to do |format|\n puts \"the format is:#{format}\"\n puts 'about to save'\n begin\n if @wells_fargo_srp_sheet.save\n format.html { redirect_to @wells_fargo_srp_sheet, notice: 'Wells fargo srp sheet was successfully created.' }\n format.json { render :show, status: :created, location: @wells_fargo_srp_sheet }\n else\n format.html { render :new }\n format.json { render json: @wells_fargo_srp_sheet.errors, status: :unprocessable_entity }\n end\n rescue Exception=>ex\n puts \"Exception in create controller method:#{ex.message}\"\n puts ex.backtrace\n end\n end\n end",
"def create\n if OpinionReport.where(opinion_report_params).count > 0\n render json: {\n status: \"Error\",\n message: \"Ya se ha enviado un reporte sobre esta opinión\"\n }.to_json\n else \n @opinion_report = OpinionReport.new(opinion_report_params)\n if @opinion_report.save\n render json: {\n status: \"Exito\",\n message: \"Se ha enviado la denuncia satisfactoriamente\"\n }.to_json\n else\n format.json { render json: @opinion_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n \n respond_to do |format|\n \n if !params[:questions].nil? \n params[:questions].each {\n |q| \n type = Question.find_by_id(q[0]).question_type\n answer = (type == 2 ? Answer.find_by_id(q[1]).correct : nil)\n Response.new( \n {\n \"question_id\" => q[0],\n \"answer_id\" => type == 2 ? q[1] : nil,\n \"text\" => type == 1 ? q[1] : nil,\n \"user_id\" => current_user.id,\n \"question_group_id\" => params[:response][:question_group_id],\n \"correct\" => answer\n }\n ).save\n }\n format.html { redirect_to '/responses', notice: 'Your responses were successfully saved.' }\n else\n @response = Response.new(params[:response])\n if @response.save\n format.html { redirect_to @response, notice: 'Response was successfully created.' }\n format.json { render json: @response, status: :created, location: @response }\n end\n end\n end\n end",
"def create\n monthly_slip(params)\n # secure valid input\n return render json: { msg: \"input valid number\" } unless @annual_salary > 0\n @timestamp = DateTime.now\n slip = Slip.new({\n \"time_stamp\" => @timestamp,\n \"annual_salary\" => @annual_salary,\n \"employee_name\" => @employee_name,\n \"monthly_income_tax\" => @monthly_income_tax,\n })\n if slip.save\n render json: { status: \"SUCCESS\", message: \"Saved Infotmation\", data: slip }, status: :ok\n else\n render json: { status: \"ERROR\", message: \"Information not saved\", data: slip.errors }, status: :unprocessable_entity\n end\n end",
"def create\n @soatseguro = Soatseguro.new(soatseguro_params)\n\n respond_to do |format|\n if @soatseguro.save\n format.html { redirect_to @soatseguro, notice: 'Soatseguro was successfully created.' }\n format.json { render :show, status: :created, location: @soatseguro }\n else\n format.html { render :new }\n format.json { render json: @soatseguro.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @spice = Spice.new(spice_params)\n\n if @spice.save\n render json: @spice, status: :created\n else\n render json: @spice.errors, status: :unprocessable_entity\n end\n end",
"def create\n\n @survey_response = SurveyResponse.new(survey_response_params)\n\n respond_to do |format|\n if @survey_response.save\n format.html { redirect_to survey_responses_path, notice: 'Survey response was successfully created.' }\n format.json { render :index, status: :created, location: @survey_response }\n else\n format.html { render :new }\n format.json { render json: @survey_response.errors, status: :unprocessable_entity }\n end\n end\n \n end",
"def create_ofertas\n\n\n\n arr_ofertas = []\n params.select { |par, val| par.starts_with?('oferta') && val.present? }.each do |puja|\n mid = puja.first.delete('oferta_')\n eliminar = params[\"delflag#{mid}\"] == '1'\n oferta = Oferta.new :mercado_id => mid, :seleccion_id => current_user.current_seleccion(session).id, :valor => puja.last.to_f, :estado => Oferta::PENDIENTE\n oferta.estado = Oferta::CANCELADA if eliminar\n\n oferta = oferta.save_if_valid\n arr_ofertas << I18n.t('mercado.oferta.oferta_creada', {:jugador => oferta.mercado.jugador.nombre, :valor => oferta.valor})\n end\n\n flash.now[:notice] = arr_ofertas.join '<br/>'\n\n # actualizamos los datos\n datos_ofertas\n\n respond_to do |format|\n format.js\n end\n\n end",
"def create\n @socio_irpj = SocioIrpj.new(socio_irpj_params)\n\n respond_to do |format|\n if @socio_irpj.save\n format.html { redirect_to @socio_irpj, notice: 'Socio irpj was successfully created.' }\n format.json { render action: 'show', status: :created, location: @socio_irpj }\n else\n format.html { render action: 'new' }\n format.json { render json: @socio_irpj.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @reporter_suscription = Reporter::Suscription.new(reporter_suscription_params)\n\n respond_to do |format|\n if @reporter_suscription.save\n format.html { redirect_to @reporter_suscription, notice: 'Suscription was successfully created.' }\n format.json { render :show, status: :created, location: @reporter_suscription }\n else\n format.html { render :new }\n format.json { render json: @reporter_suscription.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @servidor = Servidor.new(servidor_params)\n\n respond_to do |format|\n if @servidor.save\n format.html { redirect_to servidores_path, success: 'Servidor cadastrado com sucesso.' }\n format.json { render :show, status: :created, location: @servidor }\n else\n format.html { render :new }\n format.json { render json: @servidor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @socio = Socio.new(params[:socio])\n\n respond_to do |format|\n if @socio.save\n format.html { redirect_to @socio, :notice => 'Socio cadastrado com sucesso.' }\n format.json { render :json => @socio, :status => :created, :location => @socio }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @socio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @soiree = Soiree.new(params[:soiree])\n\n respond_to do |format|\n if @soiree.save\n format.html { redirect_to @soiree, notice: 'Soiree was successfully created.' }\n format.json { render json: @soiree, status: :created, location: @soiree }\n else\n format.html { render action: \"new\" }\n format.json { render json: @soiree.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @solicitacao = Solicitacao.new(solicitacao_params)\n\n respond_to do |format|\n if @solicitacao.save\n format.html { redirect_to @solicitacao, notice: 'Solicitacao was successfully created.' }\n format.json { render :show, status: :created, location: @solicitacao }\n else\n format.html { render :new }\n format.json { render json: @solicitacao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\r\n @sivic_escolaridade = SivicEscolaridade.new(sivic_escolaridade_params)\r\n\r\n respond_to do |format|\r\n if @sivic_escolaridade.save\r\n format.html { redirect_to @sivic_escolaridade, notice: 'Registro inserido com sucesso.' }\r\n format.json { render action: 'show', status: :created, location: @sivic_escolaridade }\r\n else\r\n format.html { render action: 'new' }\r\n format.json { render json: @sivic_escolaridade.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\n @exercicio_serie = ExercicioSerie.new(exercicio_serie_params)\n\n respond_to do |format|\n if @exercicio_serie.save\n format.html { redirect_to @exercicio_serie, notice: 'O Exercício da Série foi criado com sucesso.' }\n format.json { render :show, status: :created, location: @exercicio_serie }\n else\n format.html { render :new }\n format.json { render json: @exercicio_serie.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @selecao = Selecao.new(params[:selecao])\n\n respond_to do |format|\n if @selecao.save\n format.html { redirect_to @selecao, notice: 'Selecao was successfully created.' }\n format.json { render json: @selecao, status: :created, location: @selecao }\n else\n format.html { render action: \"new\" }\n format.json { render json: @selecao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @simulado = Simulado.new(simulado_params)\n\n respond_to do |format|\n if @simulado.save\n format.html { redirect_to @simulado, notice: 'Simulado was successfully created.' }\n format.json { render :show, status: :created, location: @simulado }\n else\n format.html { render :new }\n format.json { render json: @simulado.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @recurso_servidor = RecursoServidor.new(recurso_servidor_params)\n\n respond_to do |format|\n if @recurso_servidor.save\n format.html { redirect_to @recurso_servidor, notice: 'Recurso solicitado com sucesso.' }\n format.json { render :show, status: :created, location: @recurso_servidor }\n else\n format.html { render :new }\n format.json { render json: @recurso_servidor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @responsable_etablissement = ResponsableEtablissement.new(responsable_etablissement_params)\n\n respond_to do |format|\n if @responsable_etablissement.save\n format.html { redirect_to @responsable_etablissement, notice: 'Responsable etablissement was successfully created.' }\n format.json { render :show, status: :created, location: @responsable_etablissement }\n else\n format.html { render :new }\n format.json { render json: @responsable_etablissement.errors, status: :unprocessable_entity }\n end\n end\n\n # PATCH/PUT /responsable_etablissements/1\n # PATCH/PUT /responsable_etablissements/1.json\n def update\n respond_to do |format|\n if @responsable_etablissement.update(responsable_etablissement_params)\n format.html { redirect_to @responsable_etablissement, notice: 'Responsable etablissement was successfully updated.' }\n format.json { render :show, status: :ok, location: @responsable_etablissement }\n else\n format.html { render :edit }\n format.json { render json: @responsable_etablissement.errors, status: :unprocessable_entity }\n end\n end\n end\n\n # DELETE /responsable_etablissements/1\n # DELETE /responsable_etablissements/1.json\n def destroy\n @responsable_etablissement.destroy\n respond_to do |format|\n format.html { redirect_to responsable_etablissements_url, notice: 'Responsable etablissement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end\n\n private\n # Use callbacks to share common setup or constraints between actions.\n def set_responsable_etablissement\n @responsable_etablissement = ResponsableEtablissement.find(params[:id])\n end\n\n # Never trust parameters from the scary internet, only allow the white list through.\n def responsable_etablissement_params\n params.require(:responsable_etablissement).permit(:pseudo, :mdp, :nom, :prenom, :mail, :fonction, :tel, :etablissement_id)\n end\nend",
"def create\n @response = Response.new(params[:response])\n @response.ip_address = request.remote_ip\n @response.survey_id = @survey.id\n @response.user_id = current_user\n \n for param in params do\n if param[0] =~ /^question_id_/\n # handle all question parameters\n # $' represents the value of the question_id\n if param[1].is_a? Hash\n # Valid keys include country, option, year, month, day and numeric option_id\n if param[1].has_key? \"year\" && \"month\" && \"day\"\n # concat year, month and day into one answer\n @response.answers.build(:question_id => $', :answer => Date.new(param[1][\"year\"].to_i, param[1][\"month\"].to_i, param[1][\"day\"].to_i) )\n elsif param[1].has_key? \"option\"\n # look up option id for radio & select questions and build answer\n option_id = Option.find_by_label_and_question_id(param[1][\"option\"], $').id\n @response.answers.build(:question_id => $', :answer => param[1][\"option\"], :option_id => option_id)\n elsif param[1].has_key? \"country\"\n # build country answer\n @response.answers.build(:question_id => $', :answer => param[1][\"country\"])\n else\n # build checkbox and likert answers\n param[1].each do |key, value|\n @response.answers.build(:question_id => $', :answer => value, :option_id => key) unless value == \"0\"\n end\n end\n else\n # build answer without option ie text, textarea\n @response.answers.build(:question_id => $', :answer => param[1] ) #unless param[1].blank?\n end \n end\n if param[0] == 'token'\n @response.survey.update_invitation(param[1])\n end\n end\n\n respond_to do |format|\n if @response.save!\n flash[:notice] = 'Response was successfully created.'\n format.html { redirect_to([@survey, @response]) }\n format.xml { render :xml => @response, :status => :created, :location => @response }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @response.errors, :status => :unprocessable_entity }\n end\n end\n rescue ActiveRecord::RecordInvalid => invalid\n render :action => \"new\"\n end",
"def create\n @solicitud = Solicitud.new(solicitud_params)\n\n respond_to do |format|\n if @solicitud.save\n format.html { redirect_to @solicitud, notice: 'Solicitud was successfully created.' }\n format.json { render action: 'show', status: :created, location: @solicitud }\n else\n format.html { render action: 'new' }\n format.json { render json: @solicitud.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @inspection_schedule = InspectionSchedule.new(inspection_schedule_savable_params)\n\n respond_to do |format|\n if @inspection_schedule.save\n format.html { redirect_to @inspection_schedule, notice: 'InspectionSchedule was successfully created.' }\n format.json { render :show, status: :created, location: @inspection_schedule }\n else\n format.html { render :new }\n format.json { render json: @inspection_schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n pessoa = SivicPessoa.find params[:sivic_discipulo][:sivic_pessoa_id] rescue nil\n\n\n # debugger\n if pessoa\n @sivic_discipulo = SivicDiscipulo.new(sivic_discipulo_params_normal)\n @sivic_discipulo.sivic_pessoa.sivic_situacaodiscipulo_id = params[:sivic_discipulo][:sivic_pessoa_attributes][:sivic_situacaodiscipulo_id]\n @sivic_discipulo.sivic_pessoa_id = pessoa.id\n else\n @sivic_discipulo = SivicDiscipulo.new(sivic_discipulo_params_netested) \n end\n \n #codigo = geracodigo(@sivic_discipulo.sivic_pessoa.sivic_igreja_id)\n #@sivic_discipulo.NUMR_Codigo = codigo \n \n respond_to do |format|\n\n # debugger\n\n if @sivic_discipulo.save \n format.html { redirect_to @sivic_discipulo, notice: 'Registro inserido com sucesso.' }\n format.json { render action: 'show', status: :created, location: @sivic_discipulo }\n else\n if @sivic_discipulo.sivic_pessoa_id\n @sivic_pessoa_evolucao = SivicPessoa.find(@sivic_discipulo.sivic_pessoa_id)\n else\n @sivic_pessoa_evolucao = SivicPessoa.new\n end\n\n format.html { render action: 'new' }\n format.json { render json: @sivic_discipulo.errors, status: :unprocessable_entity}\n \n end \n end\n\n end",
"def create\n @vas_response = VasResponse.new(vas_response_params)\n\n respond_to do |format|\n if @vas_response.save\n format.html { redirect_to @vas_response, notice: 'Vas response was successfully created.' }\n format.json { render :show, status: :created, location: @vas_response }\n else\n format.html { render :new }\n format.json { render json: @vas_response.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @souscripteur = Souscripteur.new(souscripteur_params)\n\n respond_to do |format|\n if @souscripteur.save\n format.html { redirect_to @souscripteur, notice: 'Souscripteur was successfully created.' }\n format.json { render :show, status: :created, location: @souscripteur }\n else\n format.html { render :new }\n format.json { render json: @souscripteur.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @selecciones = Seleccion.where(\"cliente_id = ?\",usuario_actual.id)\n @peso_total = Seleccion.peso_total(usuario_actual.id)\n @precio_total = Seleccion.precio_total(usuario_actual.id)\n @tarjetas = usuario_actual.tdc\n \n #Cobro en el banco\n client = Savon::Client.new(\"http://localhost:3001/servicios/wsdl\")\n tdc = Tarjeta.where(\"id = ? AND cliente_id = ?\",params[:orden][:tarjeta_id],usuario_actual.id)\n total_pagar = params[:orden][:total]\n pago = '<Message>\n <Request>\n <numero_tdc>'+tdc.numero+'</numero_tdc>\n <nombre_tarjetahabiente>'+tdc.tarjetahabiente+'</nombre_tarjetahabiente>\n <fecha_vencimiento>'+tdc.mes_vencimiento+'/'+tdc.ano_vencimiento+'</fecha_vencimiento>\n <codigo_seguridad>'+tdc.codigo+'</codigo_seguridad>\n <tipo_tarjeta>'+tdc.tipo+'</tipo_tarjeta>\n <direccion_cobro>'+tdc.direccion+'</direccion_cobro>\n <total_pagar>'+total_pagar+'</total_pagar>\n <cuenta_receptora>'+cuenta_receptora+'</cuenta_receptora>\n </Request>\n </Message>'\n #response = client.request :verificar_pago, body: { \"value\" => pago } \n #if response.success?\n # data = response.to_hash[:verificar_pago_response][:value][:response].first\n # @respuesta = XmlSimple.xml_in(data)\n #end\n\n #NAMESPACE = 'pagotdc'\n #URL = 'http://localhost:8080/'\n #banco = SOAP::RPC::Driver.new(URL, NAMESPACE)\n #banco.add_method('verificar_pago', 'numero_tdc', 'nombre_tarjetahabiente', 'fecha_vencimiento', 'codigo_seguridad', 'tipo_tarjeta', 'direccion_cobro', 'total_pagar', 'cuenta_receptora')\n #\n \n #respuesta = banco.verificar_pago(tdc.numero, tdc.tarjetahabiente, tdc.mes_vencimiento.to_s+'/'+tdc.ano_vencimiento.to_s, tdc.codigo, tdc.tipo, params[:orden][:total], tdc.direccion)\n \n if true #respuesta.ack.eql?(0)\n params[:orden][:cliente_id] = usuario_actual.id\n params[:orden][:total] = Seleccion.precio_total(usuario_actual.id)\n params[:orden][:fecha_entrega] = \"0000-00-00\"\n @orden = Orden.new(params[:orden])\n \n if @orden.save\n @selecciones = Seleccion.where(\"cliente_id = ?\",usuario_actual.id)\n @selecciones.each do |seleccion|\n p = Producto.find(seleccion.producto_id)\n @venta = Venta.new(:producto_id=>p.id, \n :orden_id=>@orden.id,\n :categoria_id=>p.categoria_id, \n :cantidad=>seleccion.cantidad,\n :costo=>p.precio)\n @venta.save\n end\n \n Seleccion.vaciar_carro(usuario_actual.id)\n respond_to do |format|\n format.html { redirect_to ver_ordenes_path, notice: 'Orden generada correctamente.' }\n end\n else\n respond_to do |format|\n format.html { render action: \"new\" }\n end\n end\n else\n respond_to do |format|\n format.html { render action: \"new\", notice: respuesta.mensaje }\n end\n end\n end",
"def create\n @situacoes_juridica = SituacoesJuridica.new(params[:situacoes_juridica])\n\n respond_to do |format|\n if @situacoes_juridica.save\n format.html { redirect_to(@situacoes_juridica, :notice => 'Situação jurídica cadastrada com sucesso.') }\n format.xml { render :xml => @situacoes_juridica, :status => :created, :location => @situacoes_juridica }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @situacoes_juridica.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @socio_serasa = SocioSerasa.new(socio_serasa_params)\n\n respond_to do |format|\n if @socio_serasa.save\n format.html { redirect_to @socio_serasa, notice: 'Socio serasa was successfully created.' }\n format.json { render action: 'show', status: :created, location: @socio_serasa }\n else\n format.html { render action: 'new' }\n format.json { render json: @socio_serasa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @asiento_de_servicio = AsientoDeServicio.new(asiento_de_servicio_params)\n\n respond_to do |format|\n if @asiento_de_servicio.save\n format.html { redirect_to @asiento_de_servicio, notice: 'Asiento de servicio was successfully created.' }\n format.json { render :show, status: :created, location: @asiento_de_servicio }\n else\n format.html { render :new }\n format.json { render json: @asiento_de_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\r\n @sivic_celula = SivicCelula.new(sivic_celula_params)\r\n\r\n respond_to do |format|\r\n if @sivic_celula.save\r\n format.html { redirect_to @sivic_celula, notice: 'Registro inserido com sucesso.' }\r\n format.json { render action: 'show', status: :created, location: @sivic_celula }\r\n else\r\n format.html { render action: 'new' }\r\n format.json { render json: @sivic_celula.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\n respond_with []\n end",
"def create\n @sinistro = Sinistro.new(sinistro_params)\n\n respond_to do |format|\n if @sinistro.save\n format.html { redirect_to @sinistro, notice: 'Sinistro was successfully created.' }\n format.json { render :show, status: :created, location: @sinistro }\n else\n format.html { render :new }\n format.json { render json: @sinistro.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @sitio_entrega = SitioEntrega.new(params[:sitio_entrega])\n\n respond_to do |format|\n if @sitio_entrega.save\n format.html { redirect_to @sitio_entrega, notice: 'Sitio entrega was successfully created.' }\n format.json { render json: @sitio_entrega, status: :created, location: @sitio_entrega }\n else\n format.html { render action: \"new\" }\n format.json { render json: @sitio_entrega.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @sesion = Sesion.where(entidad_paraestatal_id: @entidad_paraestatal.id).new(params[:sesion])\n\n respond_to do |format|\n if @sesion.save\n format.html { redirect_to [@entidad_paraestatal,@sesion], notice: 'Sesion was successfully created.' }\n format.json { render json: @sesion, status: :created, location: [@entidad_paraestatal,@sesion] }\n else\n format.html { render action: \"new\" }\n format.json { render json: @sesion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @spaethi = Spaethi.new(params[:spaethi])\n\n respond_to do |format|\n if @spaethi.save\n format.html { redirect_to @spaethi, notice: 'Spaethi was successfully created.' }\n format.json { render json: @spaethi, status: :created, location: @spaethi }\n else\n format.html { render action: \"new\" }\n format.json { render json: @spaethi.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_situacao\n logger.debug \"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ\"\n\n id_busca = params[:id]\n @os_id = params[:os_id]\n @os_tarefa = OsTarefa.find(id_busca)\n @os_tarefa.situacao=params[:situacao]\n @ordem_servico = OrdemServico.find(@os_id)\n logger.debug \"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ\"\n\n if @os_tarefa.situacao=='REJEITADA'\n @os_tarefa.ordem_servico_pagamento= nil\n @os_tarefa.situacao=OsTarefa.situacoes[2]\n else\n @os_tarefa.ordem_servico_pagamento= @ordem_servico\n @os_tarefa.situacao=OsTarefa.situacoes[0]\n end\n @os_tarefa.save\n respond_to do |format|\n\n format.json { head :no_content }\n format.js { render :layout => false }\n\n end\n end",
"def add_snack\n response = RestClient.post SNACKS_URL, {name: @suggestion.name, location: @suggestion.location}.to_json, content_type: :json\n logger.debug \"web service response code => #{response.code}\"\n if response.code != 200\n flash[:notice] = \"Error: #{response.code} while communicating with services, please try again later.\"\n end\n parsed = JSON.parse(response) \n end",
"def dame_institucion\n i = Metamares::Institucion.new\n i.nombre_institucion = params[:nombre_institucion]\n\n respond_to do |format|\n format.json { render json: i.busca_institucion.map{ |i| { id: i.id, value: i.nombre_institucion } } }\n format.html { @institucion = i }\n end\n end",
"def create\n @invoice = Invoice.new(invoice_params)\n #@invoice.type_invoice = 'Venda'\n\n respond_to do |format|\n @invoice.status = 'ABERTA'\n @invoice.form_receipt = 'NÃO INFORMADO'\n @invoice.installments = '1'\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Criado com sucesso.' }\n format.json { render :show, status: :created, location: @invoice }\n #sweetalert_success('Dados cadastrados com sucesso!', 'Sucesso!', useRejections: false)\n else\n format.html { render :new }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\r\n @sivic_fornecedor = SivicFornecedor.new(sivic_fornecedor_params)\r\n\r\n respond_to do |format|\r\n if @sivic_fornecedor.save\r\n format.html { redirect_to @sivic_fornecedor, notice: 'Registro inserido com sucesso.' }\r\n format.json { render action: 'show', status: :created, location: @sivic_fornecedor }\r\n else\r\n format.html { render action: 'new' }\r\n format.json { render json: @sivic_fornecedor.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\n @servico = Servico.new(servico_params)\n @servico.status = 1\n\n respond_to do |format|\n if @servico.save\n if (params[:modal])\n format.html { redirect_to '/profissional_servicos/new', notice: 'Serviço cadastrado com sucesso.' }\n else\n format.html { redirect_to servicos_url, notice: 'Serviço cadastrado com sucesso.' }\n end\n format.json { render :show, status: :created, location: @servico }\n else\n format.html { render :new }\n format.json { render json: '{\"msg\":\"Este já tem cadastro!\"}', status: :unprocessable_entity }\n end\n end\n end",
"def create\n @response = Response.new(response_params)\n\n respond_to do |format|\n if @response.save\n format.html { redirect_to thanks_path, notice: 'Your response was successfully saved.' }\n format.json { render :show, status: :created, location: @response }\n else\n format.html { render :new }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n authorize! :create_almacen,Sigesp::Solicitud \n unidad = session['unidad'] \n return render json: { unidad: \"Esta Unidad Administrativa no tiene Numero de Control \" }, status: :unprocessable_entity if Sigesp::CtrlRequisicion.control_compra(unidad).nil?\n\n @solicitudes = Sigesp::Solicitud.crear_solicitudes_almacen(sigesp_solicitud_alamcen_params)\n @grupoSolicitud = SolicitudGrupo.new\n @solicitudes.each do |solicitud|\n @grupoSolicitud.solicitudes << solicitud \n end\n if @grupoSolicitud.valid? \n @grupoSolicitud.guardar(unidad,current_usuario)\n return render json: { url: sigesp_solicitudsalmacen_path(@grupoSolicitud.solicitudes[0])} \n else\n return render json:@grupoSolicitud.errors ,status: :unprocessable_entity\n end \n end",
"def create\n @plan_quirurgico = PlanQuirurgico.new(plan_quirurgico_params)\n @plan_quirurgico.servicios = params[:servicios]\n @plan_quirurgico.estatus = \"En Proceso\"\n puts params\n puts @plan_quirurgico.examen \n respond_to do |format|\n if @plan_quirurgico.save\n format.html { redirect_to @plan_quirurgico, notice: 'El plan quirurgico fue registrado exitosamente.' }\n format.json { render :show, status: :created, location: @plan_quirurgico }\n else\n format.html { render :new }\n format.json { render json: @plan_quirurgico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @sugestao = Sugestao.new(sugestao_params)\n\n respond_to do |format|\n if @sugestao.save\n format.html { redirect_to @sugestao, notice: 'Sugestão salva com sucesso.' }\n format.json { render :show, status: :created, location: @sugestao }\n else\n format.html { render :new }\n format.json { render json: @sugestao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @laboratorio = Laboratorio.new(laboratorio_params)\n get_responsavel\n puts \"O responsavel é: #{@laboratorio.responsavel_id}\"\n if (@responsavel != \"sem_responsavel\")\n @laboratorio.docentes << Docente.find(@laboratorio.responsavel_id)\n puts \"Add relação entre #{@laboratorio.nome} e #{Docente.find(@laboratorio.responsavel_id).user.nome}\"\n end\n respond_to do |format|\n if @laboratorio.save\n format.html { redirect_to @laboratorio, notice: 'Laboratorio was successfully created.' }\n format.json { render :show, status: :created, location: @laboratorio }\n else\n format.html { render :new }\n format.json { render json: @laboratorio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @siren = Siren.new(siren_params)\n\n respond_to do |format|\n if @siren.save\n format.html { redirect_to @siren, notice: 'Siren was successfully created.' }\n format.json { render :show, status: :created, location: @siren }\n else\n format.html { render :new }\n format.json { render json: @siren.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @instituicao_responsavel.destroy\n respond_to do |format|\n format.html { redirect_to instituicao_responsavels_url, notice: 'Instituicao responsavel was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def create\r\n @sivic_alunoaula = SivicAlunoaula.new(sivic_alunoaula_params)\r\n\r\n respond_to do |format|\r\n if @sivic_alunoaula.save\r\n format.html { redirect_to @sivic_alunoaula, notice: 'Sivic alunoaula was successfully created.' }\r\n format.json { render action: 'show', status: :created, location: @sivic_alunoaula }\r\n else\r\n format.html { render action: 'new' }\r\n format.json { render json: @sivic_alunoaula.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end"
] | [
"0.59326315",
"0.5861852",
"0.58400804",
"0.5814467",
"0.5713281",
"0.56878877",
"0.5680321",
"0.5634274",
"0.5634042",
"0.5631347",
"0.5604365",
"0.55902904",
"0.55887616",
"0.55870575",
"0.5556952",
"0.55400854",
"0.5523738",
"0.551276",
"0.55069256",
"0.5501102",
"0.54874116",
"0.54844964",
"0.54787886",
"0.54661655",
"0.5462454",
"0.5460458",
"0.5460111",
"0.5441933",
"0.544005",
"0.5432242",
"0.54178053",
"0.54140216",
"0.5413889",
"0.5413614",
"0.54132646",
"0.5410437",
"0.5408616",
"0.53989685",
"0.53959423",
"0.5391545",
"0.5356649",
"0.5353569",
"0.5346435",
"0.5336136",
"0.53305894",
"0.532478",
"0.5318104",
"0.5317514",
"0.53166497",
"0.53024775",
"0.53015834",
"0.530068",
"0.5296999",
"0.5296181",
"0.52959955",
"0.52932495",
"0.52925277",
"0.52917045",
"0.5289198",
"0.52772915",
"0.5277285",
"0.5275883",
"0.52756494",
"0.52738875",
"0.5271501",
"0.5270992",
"0.52707416",
"0.5267127",
"0.52587444",
"0.52572256",
"0.525384",
"0.52515703",
"0.5248976",
"0.52479297",
"0.52457976",
"0.52440834",
"0.5241668",
"0.5237166",
"0.52362704",
"0.5234696",
"0.52323145",
"0.52310514",
"0.5230156",
"0.52293384",
"0.5227038",
"0.5227035",
"0.5226225",
"0.52257156",
"0.5220859",
"0.52157414",
"0.52143335",
"0.52142036",
"0.5212917",
"0.5212331",
"0.52041024",
"0.5201466",
"0.5201328",
"0.51998967",
"0.5193127",
"0.5188544"
] | 0.6215593 | 0 |
PATCH/PUT /instituicao_responsavels/1 PATCH/PUT /instituicao_responsavels/1.json | def update
respond_to do |format|
if @instituicao_responsavel.update(instituicao_responsavel_params)
format.html { redirect_to @instituicao_responsavel, notice: 'Instituicao responsavel was successfully updated.' }
format.json { render :show, status: :ok, location: @instituicao_responsavel }
else
format.html { render :edit }
format.json { render json: @instituicao_responsavel.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @responsavel = Responsavel.find(params[:id])\n\n if @responsavel.update(responsavel_params)\n head :no_content\n else\n render json: @responsavel.errors, status: :unprocessable_entity\n end\n end",
"def update\n @respuesta = Respuesta.find(params[:id])\n\n if @respuesta.update(params[:respuesta])\n head :no_content\n else\n render json: @respuesta.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @solicitacoes_avaliacoes_servico.update(solicitacoes_avaliacoes_servico_params)\n format.html { redirect_to @solicitacoes_avaliacoes_servico, notice: 'Solicitacoes avaliacoes servico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @solicitacoes_avaliacoes_servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @repuesto_servicio.update(repuesto_servicio_params)\n format.html { redirect_to @repuesto_servicio, notice: 'Repuesto o servicio fue actualizado con éxito.' }\n format.json { render :show, status: :ok, location: @repuesto_servicio }\n else\n format.html { render :edit }\n format.json { render json: @repuesto_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sivic_discipulo.update(sivic_discipulo_params_netested)\n format.html { redirect_to @sivic_discipulo, notice: 'Registro alterado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sivic_discipulo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def activo_update\n respond_to do |format|\n activo = params[:laboratorio][:activo]\n id = params[:id]\n Laboratorio.where(id: id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end",
"def activo_update\n respond_to do |format|\n activo = params[:presentacion][:activo]\n id = params[:id]\n Presentacion.where(id: id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end",
"def update\n respond_to do |format|\n if @servico.update(servico_params)\n format.html { redirect_to servicos_url, notice: 'Serviço atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @servico }\n else\n format.html { render :edit }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @clientes_servico.update(clientes_servico_params)\n format.html { redirect_to @clientes_servico, notice: 'Clientes servico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @clientes_servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @respuesta = Respuesta.find(params[:id])\n\n respond_to do |format|\n if @respuesta.update_attributes(params[:respuesta])\n format.html { redirect_to @respuesta, notice: 'Respuesta was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @respuesta.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @responsible.update(responsible_params)\n format.html { redirect_to @responsible, notice: 'Responsavel editado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @responsible.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n respond_to do |format|\r\n if @sivic_pessoa.update(sivic_pessoa_params)\r\n format.html { redirect_to @sivic_pessoa, notice: 'Registro alterado com sucesso.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_pessoa.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n @servicio = Servicio.find(params[:id])\n\n respond_to do |format|\n if @servicio.update_attributes(params[:servicio])\n format.html { redirect_to @servicio, :notice => 'Servicio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @servicio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipoapreensao.update(tipoapreensao_params)\n format.html { redirect_to @tipoapreensao, notice: 'Tipoapreensao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tipoapreensao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @solicitud_servicio = SolicitudServicio.find(params[:id])\n\n respond_to do |format|\n if @solicitud_servicio.update_attributes(params[:solicitud_servicio])\n format.html { redirect_to @solicitud_servicio, notice: 'Solicitud servicio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @solicitud_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @registro_servicio.update(registro_servicio_params)\n format.html { redirect_to @registro_servicio, notice: 'Servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @registro_servicio }\n else\n format.html { render :edit }\n format.json { render json: @registro_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sindicato.update(sindicato_params)\n format.html { redirect_to @sindicato, notice: 'Sindicato fue actualizado exitosamente.' }\n format.json { render :show, status: :ok, location: @sindicato }\n else\n format.html { render :edit }\n format.json { render json: @sindicato.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if (@permissao_existente && Laboratorio.find(@pedido_responsabilidade.id_laboratorio).responsavel == nil)\n respond_to do |format|\n if @pedido_responsabilidade.update(pedido_responsabilidade_params)\n format.html { redirect_to account_path, notice: 'Pedido responsabilidade was successfully updated.' }\n format.json { render :show, status: :ok, location: @pedido_responsabilidade }\n else\n format.html { render :edit }\n format.json { render json: @pedido_responsabilidade.errors, status: :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n format.html { redirect_to account_path, notice: 'Não foi possivel editar solicitação de responsabilidade.' }\n format.json { head :no_content }\n end\n end\n end",
"def update\n respond_to do |format|\n if @responsable_etablissement.update(responsable_etablissement_params)\n format.html { redirect_to @responsable_etablissement, notice: 'Responsable etablissement was successfully updated.' }\n format.json { render :show, status: :ok, location: @responsable_etablissement }\n else\n format.html { render :edit }\n format.json { render json: @responsable_etablissement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n set_funcionario\n if @ordem_servico.update(ordem_servico_params)\n format.html { redirect_to @ordem_servico, notice: t('messages.cadastro_atualizado') }\n format.json { render :show, status: :ok, location: @ordem_servico }\n else\n format.html { render :edit }\n format.json { render json: @ordem_servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize! :update_almacen,Sigesp::Solicitud\n if @sigesp_solicitud.update(sigesp_solicitud_alamcen_params)\n return render json: { url: sigesp_solicitudsalmacen_path(@sigesp_solicitud)} \n else\n return render json:@sigesp_solicitud.errors ,status: :unprocessable_entity\n end \n end",
"def update\n respond_to do |format|\n if @recurso_servidor.update(recurso_servidor_params)\n format.html { redirect_to @recurso_servidor, notice: 'Recurso servidor was successfully updated.' }\n format.json { render :show, status: :ok, location: @recurso_servidor }\n else\n format.html { render :edit }\n format.json { render json: @recurso_servidor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_with []\n end",
"def update\n respond_to do |format|\n if @solicitud.update(solicitud_params)\n format.html { redirect_to @solicitud, notice: 'Solicitud was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @solicitud.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @servidor.update(servidor_params)\n format.html { redirect_to @servidor, notice: 'Servidor atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @servidor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipo_de_servicio.update(tipo_de_servicio_params)\n format.html { redirect_to @tipo_de_servicio, notice: 'Tipo de servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipo_de_servicio }\n else\n format.html { render :edit }\n format.json { render json: @tipo_de_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @calificacion_servicio = CalificacionServicio.find(params[:id])\n\n respond_to do |format|\n if @calificacion_servicio.update_attributes(params[:calificacion_servicio])\n format.html { redirect_to @calificacion_servicio, notice: 'Calificacion servicio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @calificacion_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @sinh_vien = SinhVien.find(params[:id])\n\n respond_to do |format|\n if @sinh_vien.update_attributes(params[:sinh_vien]) \n format.json { head :no_content }\n else \n format.json { render json: @sinh_vien.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @exemplaresproduto.update(exemplaresproduto_params)\n format.html { redirect_to @exemplaresproduto, notice: 'Exemplaresproduto was successfully updated.' }\n format.json { render :show, status: :ok, location: @exemplaresproduto }\n else\n format.html { render :edit }\n format.json { render json: @exemplaresproduto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @servico_pacote.update(servico_pacote_params)\n format.html { redirect_to @servico_pacote, notice: 'Pacote was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @servico_pacote.errors, status: :unprocessable_entity }\n end\n end\n end",
"def actualizacion \n fiesta.update (params[:id]) \n render json: fiesta\n end",
"def update\n respond_to do |format|\n if @servico_evento.update(servico_evento_params)\n format.html { redirect_to @servico_evento, notice: 'Evento was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @servico_evento.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @solicitacao.update(solicitacao_params)\n format.html { redirect_to @solicitacao, notice: 'Solicitacao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @solicitacao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n respond_to do |format|\r\n if @sivic_profissao.update(sivic_profissao_params)\r\n format.html { redirect_to @sivic_profissao, notice: 'Sivic profissao was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_profissao.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n respond_to do |format|\n if @solicitacao_tipo.update(solicitacao_tipo_params)\n format.html { redirect_to @solicitacao_tipo, notice: 'Solicitacao tipo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @solicitacao_tipo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n respond_to do |format|\r\n if @sivic_contcelula.update(sivic_contcelula_params)\r\n format.html { redirect_to @sivic_contcelula, notice: 'Sivic contcelula was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_contcelula.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n respond_to do |format|\n if @socio_irpj.update(socio_irpj_params)\n format.html { redirect_to @socio_irpj, notice: 'Socio irpj was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @socio_irpj.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @formulary = Formulary.find(params[:id])\n\n respond_to do |format|\n if @formulary.update_attributes(params[:formulary])\n format.html { redirect_to @formulary, notice: 'Formulario actualizado exitosamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @formulary.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @os_nivel_servico.update(os_nivel_servico_params)\n format.html { redirect_to @os_nivel_servico, notice: 'Os nivel servico foi atualizado(a)' }\n format.json { render :show, status: :ok, location: @os_nivel_servico }\n else\n format.html { render :edit }\n format.json { render json: @os_nivel_servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tarifas_servicio.update(tarifas_servicio_params)\n format.html { redirect_to tarifas_servicios_url, notice: 'Tarifas servicio Se ha actualizado correctamente..' }\n format.json { render :show, status: :ok, location: @tarifas_servicio }\n else\n format.html { render :edit }\n format.json { render json: @tarifas_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @asiento_de_servicio.update(asiento_de_servicio_params)\n format.html { redirect_to @asiento_de_servicio, notice: 'Asiento de servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @asiento_de_servicio }\n else\n format.html { render :edit }\n format.json { render json: @asiento_de_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tb_servicio.update(tb_servicio_params)\n format.html { redirect_to @tb_servicio, notice: 'Tb servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @tb_servicio }\n else\n format.html { render :edit }\n format.json { render json: @tb_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n respond_to do |format|\r\n if @sivic_permissao.update(sivic_permissao_params)\r\n format.html { redirect_to @sivic_permissao, notice: 'Sivic permissao was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_permissao.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\r\n respond_to do |format|\r\n if @sivic_participantecelula.update(sivic_participantecelula_params)\r\n format.html { redirect_to @sivic_participantecelula, notice: 'Registro alterado com sucesso.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_participantecelula.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n @serv_adicionale = ServAdicionale.find(params[:id])\n\n respond_to do |format|\n if @serv_adicionale.update_attributes(params[:serv_adicionale])\n format.html { redirect_to @serv_adicionale, notice: 'Serv adicionale was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @serv_adicionale.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @os_entregavel.update(os_entregavel_params)\n if @os_entregavel.ordem_servico.id!=nil\n format.html { redirect_to \"/ordem_servicos/\"+@os_entregavel.ordem_servico.id.to_s, notice: 'Os entregavel foi atualizado(a)' }\n format.json { head :no_content }\n else\n format.html { redirect_to @os_entregavel, notice: 'Os entregavel foi atualizado(a)' }\n format.json { render :show, status: :ok, location: @os_entregavel }\n end\n else\n format.html { render :edit }\n format.json { render json: @os_entregavel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @selecao = Selecao.find(params[:id])\n\n respond_to do |format|\n if @selecao.update_attributes(params[:selecao])\n format.html { redirect_to @selecao, notice: 'Selecao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @selecao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update \n retorno = {erro: \"322\" ,body: \"\"}\n if @usuario.update(valid_request?)\n retorno = {erro: \"000\", body: {evento_id: @usuario.id, usuario_nome: @usuario.nome}}\n end\n render json: retorno.to_json\n end",
"def update\n @consulta = Consulta.find(params[:id])\n\n if @consulta.update(params[:consulta])\n head :no_content\n else\n render json: @consulta.errors, status: :unprocessable_entity\n end\n end",
"def update\r\n respond_to do |format|\r\n if @sivic_celula.update(sivic_celula_params)\r\n format.html { redirect_to @sivic_celula, notice: 'Registro alterado com sucesso.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_celula.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n\n @empresa_servicio = EmpresaServicio.find(params[:id])\n respond_to do |format|\n if @empresa_servicio.update_attributes(params[:empresa_servicio])\n\n format.html { redirect_to empresa_empresa_servicios_path, notice: \"Los datos del servicio fueron actualizados para la empresa #{@empresa_servicio.empresa.nombre_empresa}\"}\n \n else\n format.html { render action: \"edit\" }\n format.json { render json: @empresa_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n activo = params[:lab_far][:activo]\n farmacia_id = session[:farmacia_id]\n id = params[:id]\n LabFar.where(laboratorio_id: id, farmacium_id:farmacia_id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end",
"def update\n pai = params[:pai] ? Conta.find_by_id(params[:pai]): nil\n \n respond_to do |format|\n if @conta.update(nome: conta_params[:nome], status: conta_params[:status], pai: pai) \n #format.json { render :show, status: :ok, location: @conta }\n format.json { render json: @conta.to_json, status: :ok }\n else \n format.json { render json: @conta.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @paciente_serviciocomplementario.update(paciente_serviciocomplementario_params)\n format.html {redirect_to @paciente_serviciocomplementario, notice: 'Paciente serviciocomplementario was successfully updated.'}\n format.json {render :show, status: :ok, location: @paciente_serviciocomplementario}\n else\n format.html {render :edit}\n format.json {render json: @paciente_serviciocomplementario.errors, status: :unprocessable_entity}\n end\n end\n end",
"def update\r\n respond_to do |format|\r\n if @sivic_contabanco.update(sivic_contabanco_params)\r\n format.html { redirect_to @sivic_contabanco, notice: 'Registro alterado com sucesso.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_contabanco.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n respond_to do |format|\n puts \"HACE ALGOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO\"\n if !params[:reserva][:tipo_reserva].blank?\n @tipo_reserva = TipoReserva.find(params[:reserva][:tipo_reserva])\n @reserva.tipo_reserva = @tipo_reserva\n end\n\n if !params[:reserva][:habitacion].blank?\n @habitacion = Habitacion.find(params[:reserva][:habitacion])\n @reserva.habitacion = @habitacion\n end\n\n if !params[:reserva][:cliente].blank?\n @cliente = Cliente.find(params[:reserva][:cliente])\n @reserva.cliente = @cliente\n end\n if !params[:reserva][:confirmada].blank?\n @reserva.confirmada = params[:reserva][:confirmada]\n end\n if @reserva.update(reserva_params)\n format.html { redirect_to reservas_url, notice: 'Reserva modificada con exito.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @reserva.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @observ.update(observ_params)\n format.html { redirect_to :back }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @observ.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @palabra = Palabra.find(params[:id])\n @palabra.significados = params[:significados] \n respond_to do |format|\n if @palabra.update_attributes(params[:palabra])\n format.html { redirect_to @palabra, notice: 'La Palabra fue actualizada correctamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @palabra.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @datos_insumos_reactivo.update(datos_insumos_reactivo_params)\n format.html { redirect_to @datos_insumos_reactivo, notice: 'Datos insumos reactivo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @datos_insumos_reactivo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @sabio = Sabio.find(params[:id])\n\n respond_to do |format|\n if @sabio.update_attributes(params[:sabio])\n format.html { redirect_to @sabio, notice: 'El Sabio fue actualizado.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sabio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @repuesto.update(repuesto_params)\n format.html { redirect_to @repuesto, notice: 'Repuesto was successfully updated.' }\n format.json { render :show, status: :ok, location: @repuesto }\n else\n format.html { render :edit }\n format.json { render json: @repuesto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @pagos_servicio.update(pagos_servicio_params)\n format.html { redirect_to @pagos_servicio, notice: 'Pagos servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @pagos_servicio }\n else\n format.html { render :edit }\n format.json { render json: @pagos_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @osoba = Osoba.find(params[:id])\n\n if @osoba.update(params[:osoba])\n head :no_content\n else\n render json: @osoba.errors, status: :unprocessable_entity\n end\n end",
"def pro_farm_update\n respond_to do |format|\n activo = params[:pro_far][:activo_produc]\n farmacia_id = session[:farmacia_id]\n id = params[:id]\n ProFar.where(producto_id: id, farmacium_id:farmacia_id).update_all(activo_produc: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end",
"def update\n @sitio_entrega = SitioEntrega.find(params[:id])\n\n respond_to do |format|\n if @sitio_entrega.update_attributes(params[:sitio_entrega])\n format.html { redirect_to @sitio_entrega, notice: 'Sitio entrega was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sitio_entrega.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if (Servicio.where(id: especialidad_params[:servicio_id]).select(:enable).first.enable)\n if @especialidad.update(especialidad_params)\n format.html { redirect_to @especialidad, notice: 'Servicio actualizado exitosamente.' }\n format.json { render :show, status: :ok, location: @especialidad }\n else\n format.html { render :edit }\n format.json { render json: @especialidad.errors, status: :unprocessable_entity }\n end\n else\n format.html { render :edit }\n format.json { render json: @especialidad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @consultorio.update(consultorio_params)\n format.html { redirect_to @consultorio, notice: 'Consultorio actualizado exitosamente.' }\n format.json { render :show, status: :ok, location: @consultorio }\n else\n format.html { render :edit }\n format.json { render json: @consultorio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @safra_verdoso = SafraVerdoso.find(params[:id])\n\n respond_to do |format|\n if @safra_verdoso.update_attributes(params[:safra_verdoso])\n format.html { redirect_to \"/safra_produtos/#{@safra_verdoso.safra_produto_id}/descontos\"}\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @safra_verdoso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @prueba_json.update(prueba_json_params)\n format.html { redirect_to @prueba_json, notice: 'Prueba json was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @prueba_json.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @servidor.update(servidor_params)\n format.html { redirect_to servidores_path, success: 'Servidor atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @servidor }\n else\n format.html { render :edit }\n format.json { render json: @servidor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n respond_to do |format|\r\n if @sivic_banco.update(sivic_banco_params)\r\n format.html { redirect_to @sivic_banco, notice: 'Registro alterado com sucesso.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_banco.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def activo_update\n respond_to do |format|\n activo = params[:producto][:activo]\n id = params[:id]\n Producto.where(id: id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end",
"def update\n respond_to do |format|\n if @solicitud.update(solicitud_params)\n format.html { redirect_to @solicitud, notice: \"Solicitud was successfully updated.\" }\n format.json { render :show, status: :ok, location: @solicitud }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @solicitud.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @orgao_impressora.update(orgao_impressora_params)\n format.html { redirect_to @orgao_impressora, notice: 'Órgão impressora atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @orgao_impressora.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @resi.update(resi_params)\n format.html { redirect_to @resi, notice: 'Resi was successfully updated.' }\n format.json { render :show, status: :ok, location: @resi }\n else\n format.html { render :edit }\n format.json { render json: @resi.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @servicerequest.update(servicerequest_params)\n @servicerequest.seccion = @servicerequest.seccion.upcase\n @servicerequest.contacto_int = @servicerequest.contacto_int.upcase\n @servicerequest.correo_int = @servicerequest.correo_int.upcase\n @servicerequest.observacion = @servicerequest.observacion.upcase\n respond_to do |format|\n if @servicerequest.save\n format.html { redirect_to servicerequests_url, notice: 'Service request was successfully updated.' }\n format.json { render :show, status: :ok, location: @servicerequest }\n else\n format.html { render :edit }\n format.json { render json: @servicerequest.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @solicitacao_enviada.update(solicitacao_enviada_params)\n format.html { redirect_to @solicitacao_enviada, notice: 'Solicitacao enviada was successfully updated.' }\n format.json { render :show, status: :ok, location: @solicitacao_enviada }\n else\n format.html { render :edit }\n format.json { render json: @solicitacao_enviada.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n respond_to do |format|\r\n if @respuestum.update(respuestum_params)\r\n format.html { redirect_to @respuestum, notice: 'Respuestum was successfully updated.' }\r\n format.json { render :show, status: :ok, location: @respuestum }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @respuestum.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n respond_to do |format|\n if @reminder.update(reminder_params_parsed)\n format.html { redirect_to reminders_path, notice: 'Lembrete atualizado com sucesso' }\n format.json { render :index, status: :ok, location: @reminder }\n else\n format.html { render :edit }\n format.json { render json: @reminder.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @consulta.update(consulta_params)\n format.html { redirect_to paciente_consultas_path, notice: 'Consulta foi editada com sucesso.' }\n format.json { render :show, status: :ok, location: @consulta }\n else\n format.html { render :edit }\n format.json { render json: @consulta.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @responder = Responder.find(params[:id])\n\n respond_to do |format|\n if @responder.update_attributes(params[:responder])\n format.html { redirect_to @responder, :notice => 'Responder was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @responder.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipo_de_imposto.update(tipo_de_imposto_params)\n format.html { redirect_to @empresa, notice: 'Tipo de imposto actualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @tipo_de_imposto }\n else\n format.html { render :edit }\n format.json { render json: @tipo_de_imposto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @objeto.update(requisito_params)\n format.html { redirect_to @objeto, notice: \"Requisito was successfully updated.\" }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @solicitudinforme.update(solicitudinforme_params)\n format.html { redirect_to @solicitudinforme, notice: 'Solicitudinforme was successfully updated.' }\n format.json { render :show, status: :ok, location: @solicitudinforme }\n else\n format.html { render :edit }\n format.json { render json: @solicitudinforme.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @solicitacao_repass.update(solicitacao_repasse_params)\n format.html { redirect_to @solicitacao_repass, notice: \"Solicitacao repasse was successfully updated.\" }\n format.json { render :show, status: :ok, location: @solicitacao_repass }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @solicitacao_repass.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @responder.update(responder_params)\n format.html { redirect_to @responder, notice: 'Responder was successfully updated.' }\n format.json { render :show, status: :ok, location: @responder }\n else\n format.html { render :edit }\n format.json { render json: @responder.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n respond_to do |format|\r\n if @sivic_fornecedor.update(sivic_fornecedor_params)\r\n format.html { redirect_to @sivic_fornecedor, notice: 'Registro alterado com sucesso.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_fornecedor.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\r\n respond_to do |format|\r\n if @sivic_rede.update(sivic_rede_params)\r\n format.html { redirect_to @sivic_rede, notice: 'Rede foi alterada com sucesso.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_rede.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n respond_to do |format|\n if @socio_dados_banco.update(socio_dados_banco_params)\n format.html { redirect_to @socio_dados_banco, notice: 'Socio dados banco was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @socio_dados_banco.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @formulary.update(formulary_params)\n format.html { redirect_to formularies_url, alert: I18n.t('activerecord.models.formulary') + I18n.t('helpers_locale.models.updated') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @formulary.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @pessoa_receber = PessoaReceber.find(params[:id])\n\n respond_to do |format|\n if @pessoa_receber.update_attributes(params[:pessoa_receber])\n format.html { redirect_to @pessoa_receber, :notice => 'Pessoa receber was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @pessoa_receber.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n turno_fijo_viejo = @turnos_fijo.dup\n respond_to do |format|\n if @turnos_fijo.update(turnos_fijo_params)\n Auditorium.GenerarAuditoria(\"Modifiacion Turno Fijo\", current_user.email, turno_fijo_viejo, @turnos_fijo)\n format.html { redirect_to @turnos_fijo, notice: 'Turnos fijo was successfully updated.' }\n format.json { render :show, status: :ok, location: @turnos_fijo }\n else\n format.html { render :edit }\n format.json { render json: @turnos_fijo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @consulta_viaje.update(consulta_viaje_params)\n format.html { redirect_to @consulta_viaje, notice: 'Consulta viaje was successfully updated.' }\n format.json { render :show, status: :ok, location: @consulta_viaje }\n else\n format.html { render :edit }\n format.json { render json: @consulta_viaje.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @veiculo = Veiculo.find(params[:id])\n\n respond_to do |format|\n if @veiculo.update_attributes(params[:veiculo])\n format.html { redirect_to @veiculo, :notice => 'Veiculo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @veiculo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\r\n respond_to do |format|\r\n if @sivic_ministerio.update(sivic_ministerio_params)\r\n format.html { redirect_to @sivic_ministerio, notice: 'Registro alterado com sucesso.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_ministerio.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n respond_to do |format|\n if @solicitud.update(solicitud_params)\n format.html { redirect_to @solicitud, notice: 'Solicitud was successfully updated.' }\n format.json { render :show, status: :ok, location: @solicitud }\n else\n format.html { render :edit }\n format.json { render json: @solicitud.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @setbreak.update(setbreak_params)\n format.json { respond_with_bip @setbreak }\n else\n format.json { respond_with_bip @setbreak }\n end\n end\n end",
"def update\r\n respond_to do |format|\r\n if @sivic_escolaridade.update(sivic_escolaridade_params)\r\n format.html { redirect_to @sivic_escolaridade, notice: 'Registro alterado com sucesso.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_escolaridade.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n respond_to do |format|\n if @solicitacao_pontual.update(solicitacao_pontual_params)\n format.html { redirect_to @solicitacao_pontual, notice: 'Solicitacao pontual was successfully updated.' }\n format.json { render :show, status: :ok, location: @solicitacao_pontual }\n else\n format.html { render :edit }\n format.json { render json: @solicitacao_pontual.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @contas_receber.update(contas_receber_params)\n format.html { redirect_to @contas_receber, notice: 'Contas a receber alterado com sucesso.' }\n format.json { render :show, status: :ok, location: @contas_receber }\n else\n format.html { render :edit }\n format.json { render json: @contas_receber.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.679326",
"0.66887605",
"0.66880244",
"0.66590905",
"0.6619809",
"0.66090274",
"0.65979487",
"0.6551703",
"0.65102464",
"0.6492523",
"0.64729017",
"0.64688945",
"0.6468718",
"0.6456326",
"0.64464116",
"0.6439797",
"0.6439195",
"0.6427364",
"0.6415493",
"0.6387728",
"0.6375685",
"0.637233",
"0.63716316",
"0.6362937",
"0.6358045",
"0.63530576",
"0.6349421",
"0.63459593",
"0.6343455",
"0.63412946",
"0.63358915",
"0.632945",
"0.6325548",
"0.63242155",
"0.6322411",
"0.6316117",
"0.6313358",
"0.6309765",
"0.6299061",
"0.6298941",
"0.6298861",
"0.62944984",
"0.6283599",
"0.6279433",
"0.627935",
"0.627606",
"0.62760067",
"0.62744737",
"0.62718487",
"0.62681484",
"0.626368",
"0.62548316",
"0.6251227",
"0.62458736",
"0.62455606",
"0.6239805",
"0.62363607",
"0.62345815",
"0.6230938",
"0.6222646",
"0.62188005",
"0.6216664",
"0.62155944",
"0.6213804",
"0.62051564",
"0.62045944",
"0.620077",
"0.6198808",
"0.6193896",
"0.619336",
"0.6191827",
"0.61916405",
"0.6185202",
"0.61809504",
"0.6176664",
"0.61703247",
"0.61690307",
"0.61680615",
"0.6167713",
"0.61676633",
"0.61662114",
"0.61646837",
"0.61635906",
"0.61635387",
"0.61583215",
"0.61468434",
"0.61434567",
"0.6141276",
"0.61411196",
"0.6140594",
"0.61382127",
"0.61372864",
"0.6136965",
"0.6135879",
"0.613454",
"0.6133319",
"0.61332893",
"0.6132793",
"0.61321765",
"0.6126147"
] | 0.69480276 | 0 |
DELETE /instituicao_responsavels/1 DELETE /instituicao_responsavels/1.json | def destroy
@instituicao_responsavel.destroy
respond_to do |format|
format.html { redirect_to instituicao_responsavels_url, notice: 'Instituicao responsavel was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @respuesta = Respuesta.find(params[:id])\n @respuesta.destroy\n\n respond_to do |format|\n format.html { redirect_to respuestas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @solicitud.destroy\n respond_to do |format|\n format.html { redirect_to solicitudes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @asignatura.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @respuestum.destroy\n respond_to do |format|\n format.html { redirect_to comentarios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @datos_insumos_reactivo.destroy\n respond_to do |format|\n format.html { redirect_to datos_insumos_reactivos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sindicato.destroy\n respond_to do |format|\n format.html { redirect_to sindicatos_url, notice: 'Sindicato fue eliminado exitosamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @solicitud_servicio = SolicitudServicio.find(params[:id])\n @solicitud_servicio.destroy\n\n respond_to do |format|\n format.html { redirect_to solicitudes_servicios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sinh_vien = SinhVien.find(params[:id])\n @sinh_vien.destroy\n\n respond_to do |format| \n format.json { head :no_content }\n end\n end",
"def destroy\n @serv_adicionale = ServAdicionale.find(params[:id])\n @serv_adicionale.destroy\n\n respond_to do |format|\n format.html { redirect_to serv_adicionales_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @repuestum = Repuestum.find(params[:id])\n @repuestum.destroy\n\n respond_to do |format|\n format.html { redirect_to repuesta_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @solicitud.destroy\n respond_to do |format|\n format.html { redirect_to solicituds_url, notice: \"Solicitud was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @solicitud.destroy\n respond_to do |format|\n format.html { redirect_to solicituds_url, notice: 'Solicitud was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @clientes_servico.destroy\n respond_to do |format|\n format.html { redirect_to clientes_servicos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @respuesta = Respuesta.find(params[:id])\n @respuesta.destroy\n\n head :no_content\n end",
"def destroy\n @servicio = Servicio.find(params[:id])\n @servicio.destroy\n\n respond_to do |format|\n format.html { redirect_to servicios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @sivic_contcelula.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_contcelulas_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\r\n @respuestum.destroy\r\n respond_to do |format|\r\n format.html { redirect_to respuesta_url, notice: 'Respuestum was successfully destroyed.' }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @especialidad.destroy\n respond_to do |format|\n format.html { redirect_to especialidads_url, notice: 'Servicio eliminado exitosamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @humanidades1 = Humanidades1.find(params[:id])\n @humanidades1.destroy\n\n respond_to do |format|\n format.html { redirect_to humanidades1s_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sitio_entrega = SitioEntrega.find(params[:id])\n @sitio_entrega.destroy\n\n respond_to do |format|\n format.html { redirect_to sitio_entregas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @sivic_relatorioscelula.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_relatorioscelulas_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @instituicao = Instituicao.find(params[:id])\n @instituicao.destroy\n\n respond_to do |format|\n format.html { redirect_to instituicoes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sabio = Sabio.find(params[:id])\n @sabio.destroy\n\n respond_to do |format|\n format.html { redirect_to sabios_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @sivic_discipulo.destroy\n respond_to do |format|\n format.html { redirect_to sivic_discipulos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @solicitacao_repass.destroy\n respond_to do |format|\n format.html { redirect_to solicitacao_repasses_url, notice: \"Solicitacao repasse was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @responsable_etablissement.destroy\n respond_to do |format|\n format.html { redirect_to responsable_etablissements_url, notice: 'Responsable etablissement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @servico_pacote.destroy\n respond_to do |format|\n format.html { redirect_to servico_pacotes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @instancium.destroy\n respond_to do |format|\n format.html { redirect_to instancia_url, notice: 'Instancium was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ordem_servico.destroy\n respond_to do |format|\n format.html { redirect_to ordem_servicos_url, notice: t('messages.cadastro_removido') }\n format.json { head :no_content }\n end\n end",
"def destroy\n @trein_consul_comercial.destroy\n respond_to do |format|\n format.html { redirect_to trein_consul_comercials_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @consultorio.destroy\n respond_to do |format|\n format.html { redirect_to consultorios_url, notice: 'Consultorio eliminado exitosamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_plan.destroy\n respond_to do |format|\n msg = { :status => \"ok\", :message => \"Eliminado!\" }\n format.json { render :json => msg }\n end\n end",
"def destroy\n @observacao_vocacionada = ObservacaoVocacionada.find(params[:id])\n @observacao_vocacionada.destroy\n\n respond_to do |format|\n format.html { redirect_to observacao_vocacionadas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @servico_evento.destroy\n respond_to do |format|\n format.html { redirect_to servico_eventos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tb_solicitud.destroy\n respond_to do |format|\n format.html { redirect_to tb_solicituds_url, notice: 'Tb solicitud was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @calificacion_servicio = CalificacionServicio.find(params[:id])\n @calificacion_servicio.destroy\n\n respond_to do |format|\n format.html { redirect_to calificaciones_servicios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @humanidades2 = Humanidades2.find(params[:id])\n @humanidades2.destroy\n\n respond_to do |format|\n format.html { redirect_to humanidades2s_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @asignatura = Asignatura.find(params[:id])\n @asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to asignaturas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @asignatura = Asignatura.find(params[:id])\n @asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to asignaturas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @reconocimiento = Reconocimiento.find(params[:id])\n @reconocimiento.destroy\n\n respond_to do |format|\n format.html { redirect_to reconocimientos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @rescate.destroy\n respond_to do |format|\n format.html { redirect_to rescates_url, notice: 'Rescate fue eleminado' }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @sivic_escolaridade.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_escolaridades_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n# redirect_to activacionclientets_path # ted esto para evitar que borren por la web. ok. Que valla al index. provisional ok.\n \n #@activacionclientet.destroy\n respond_to do |format|\n format.html { redirect_to activacionclientets_url, notice: 'Activacionclientes no se puede eliminar por esta via. Contacte el administrador.' } # ted esto para evitar que borren por la web\n format.json { head :no_content }\n end\n end",
"def destroy\n @uchronia = Uchronia.find(params[:id])\n @uchronia.destroy\n\n respond_to do |format|\n format.html { redirect_to uchronias_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @asiento_de_servicio.destroy\n respond_to do |format|\n format.html { redirect_to asiento_de_servicios_url, notice: 'Asiento de servicio was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @indicativo = Indicativo.find(params[:id])\n @indicativo.destroy\n\n respond_to do |format|\n format.html { redirect_to indicativos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exura = Exura.find(params[:id])\n @exura.destroy\n\n respond_to do |format|\n format.html { redirect_to exuras_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @prueba_json.destroy\n respond_to do |format|\n format.html { redirect_to prueba_jsons_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @entrada_inventario = EntradaInventario.find(params[:id])\n @entrada_inventario.destroy\n\n respond_to do |format|\n format.html { redirect_to entrada_inventarios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @sivic_rede.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_redes_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @os_nivel_servico.destroy\n respond_to do |format|\n format.html { redirect_to os_nivel_servicos_url, notice: 'Os nivel servico foi excluído(a)' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @centre_de_responsabilite.destroy\n respond_to do |format|\n format.html { redirect_to centres_de_responsabilite_url, notice: 'Centre de responsabilite was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @soiree = Soiree.find(params[:id])\n @soiree.destroy\n\n respond_to do |format|\n format.html { redirect_to soirees_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @presentacion.destroy\n respond_to do |format|\n msg = { :status => \"ok\", :message => \"Eliminado!\" }\n format.json { render :json => msg }\n end\n end",
"def destroy\n @recurso_servidor.destroy\n respond_to do |format|\n format.html { redirect_to recurso_servidors_url, notice: 'Recurso servidor was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @asignarmultiplebeneficio.destroy\n respond_to do |format|\n format.html { redirect_to asignarmultiplebeneficios_url, notice: 'Asignarmultiplebeneficio was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @asignarmultiplebeneficio.destroy\n respond_to do |format|\n format.html { redirect_to asignarmultiplebeneficios_url, notice: 'Asignarmultiplebeneficio was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @selecao = Selecao.find(params[:id])\n @selecao.destroy\n\n respond_to do |format|\n format.html { redirect_to selecaos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @asociado = Asociado.find(params[:id])\n @asociado.destroy\n\n respond_to do |format|\n format.html { redirect_to asociados_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @tipo_convenio = TipoConvenio.find(params[:id])\n @tipo_convenio.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_convenios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @solicitudinforme.destroy\n respond_to do |format|\n format.html { redirect_to solicitudinformes_url, notice: 'Solicitudinforme was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tarifas_servicio.destroy\n respond_to do |format|\n format.html { redirect_to tarifas_servicios_url, notice: 'Tarifas servicio Fue destruido con éxito.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @reminder.destroy\n respond_to do |format|\n format.html { redirect_to reminders_url, notice: 'Lembrete excluido com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @indicacao = Indicacao.find(params[:id])\n @indicacao.destroy\n\n respond_to do |format|\n format.html { redirect_to indicacoes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @consultum.destroy\n respond_to do |format|\n format.html { redirect_to consulta_url, notice: 'Consulta foi excluída com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @apoio_educacioanl.destroy\n respond_to do |format|\n format.html { redirect_to apoio_educacioanls_url, notice: 'Apoio educacioanal foi excluído com Sucesso !' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sejour.destroy\n respond_to do |format|\n format.html { redirect_to sejours_url, notice: 'Sejour was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @interno_unidad.destroy\n respond_to do |format|\n format.html { redirect_to interno_unidads_url, notice: 'Interno unidad was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @consulta_viaje.destroy\n respond_to do |format|\n format.html { redirect_to consulta_viajes_url, notice: 'Consulta viaje was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @apuesta_detail = ApuestaDetail.find(params[:id])\n @apuesta_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to apuesta_details_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @consulta.destroy\n respond_to do |format|\n format.html { redirect_to paciente_consultas_path, notice: 'Consulta foi deletada com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cargo_eleicao = CargoEleicao.find(params[:id])\n @cargo_eleicao.destroy\n\n respond_to do |format|\n format.html { redirect_to cargo_eleicaos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @unidad.destroy\n respond_to do |format|\n format.html { redirect_to unidades_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sugerencia = Sugerencia.find(params[:id])\n @sugerencia.destroy\n\n respond_to do |format|\n format.html { redirect_to sugerencias_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @responsavel.destroy\n\n head :no_content\n end",
"def destroy\n @requerimiento = Requerimiento.find(params[:id])\n @requerimiento.destroy\n\n respond_to do |format|\n format.html { redirect_to requerimientos_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @periodic.destroy\n respond_to do |format|\n format.html { redirect_to periodics_url, notice: 'Periódico excluido com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @relogio = Relogio.find(params[:id])\n @relogio.destroy\n\n respond_to do |format|\n format.html { redirect_to relogios_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @tipo_de_servicio.destroy\n respond_to do |format|\n format.html { redirect_to tipo_de_servicios_url, notice: 'Tipo de servicio was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @solicitante.destroy\n respond_to do |format|\n format.html { redirect_to solicitantes_url, notice: 'Solicitante was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @sivic_contabanco.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_contabancos_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @responder = Responder.find(params[:id])\n @responder.destroy\n\n respond_to do |format|\n format.html { redirect_to responders_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @institucion.destroy\n respond_to do |format|\n format.html { redirect_to institucions_url, notice: 'Empresa se ha eliminado correctamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @sivic_alunoaula.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_alunoaulas_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @sezione = Sezione.find(params[:id])\n @sezione.destroy\n\n respond_to do |format|\n format.html { redirect_to sezioni_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @solicitacao_pontual.destroy\n respond_to do |format|\n format.html { redirect_to solicitacao_pontuals_url, notice: 'Solicitacao pontual was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @datosgenerale.destroy\n respond_to do |format|\n format.html { redirect_to datosgenerales_url }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @sivic_celula.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_celulas_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @socio.destroy\n respond_to do |format|\n format.html { redirect_to socios_url, notice: 'Socio removido com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @consultorio_n.destroy\n respond_to do |format|\n format.html { redirect_to consultorio_ns_url, notice: 'Consultorio n was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @resa.destroy\n respond_to do |format|\n format.html { redirect_to resas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tipo_consulta.destroy\n respond_to do |format|\n format.html { redirect_to tipo_consultas_url, notice: 'Tipo consulta was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @fulcliente = Fulcliente.find(params[:id])\n @fulcliente.destroy\n\n respond_to do |format|\n format.html { redirect_to fulclientes_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @informacao_ged.destroy\n respond_to do |format|\n format.html { redirect_to informacoes_ged_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @solicitud_horario.destroy\n respond_to do |format|\n format.html { redirect_to solicitud_horarios_url, notice: 'Solicitud horario was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @habito.destroy\n respond_to do |format|\n format.html { redirect_to index_habito_path(params[:paciente_id]), notice: 'Se elimino el registro' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @servidor.destroy\n respond_to do |format|\n format.html { redirect_to servidores_path, notice: 'Servidor excluído com sucesso!' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @socio_dados_banco.destroy\n respond_to do |format|\n format.html { redirect_to socio_dados_bancos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @estado_remate.destroy\n respond_to do |format|\n format.html { redirect_to estado_remates_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @datos_estudiante.destroy\n respond_to do |format|\n format.html { redirect_to datos_estudiantes_url, notice: 'Datos estudiante was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] | [
"0.73260534",
"0.72820103",
"0.7275473",
"0.72617584",
"0.72312665",
"0.719863",
"0.7193515",
"0.7177237",
"0.71733046",
"0.7170895",
"0.715135",
"0.71462196",
"0.71351576",
"0.71317315",
"0.71282184",
"0.7124477",
"0.71229243",
"0.71178937",
"0.71083856",
"0.71040034",
"0.71036124",
"0.70957524",
"0.7078479",
"0.7075815",
"0.7070951",
"0.7051403",
"0.70433944",
"0.70427644",
"0.7035996",
"0.70342684",
"0.7031814",
"0.7031008",
"0.70179343",
"0.7016255",
"0.7016162",
"0.7015821",
"0.70094305",
"0.70083904",
"0.70083904",
"0.70077145",
"0.70068896",
"0.7001032",
"0.6998917",
"0.69910675",
"0.6989035",
"0.69872594",
"0.6982081",
"0.6979832",
"0.6978522",
"0.6978414",
"0.69769114",
"0.6973813",
"0.6970825",
"0.69694376",
"0.69685376",
"0.69674236",
"0.69674236",
"0.696684",
"0.6965253",
"0.69599974",
"0.6957336",
"0.6957316",
"0.69563556",
"0.6955997",
"0.6955298",
"0.6954801",
"0.6952963",
"0.69521785",
"0.6948919",
"0.69484854",
"0.69481874",
"0.69475913",
"0.69449794",
"0.6944612",
"0.6942682",
"0.69416213",
"0.69373935",
"0.6936686",
"0.6936147",
"0.6935881",
"0.6934935",
"0.6934889",
"0.69332653",
"0.692627",
"0.69254404",
"0.69226277",
"0.6922113",
"0.69210917",
"0.6920134",
"0.69185394",
"0.69180864",
"0.6917839",
"0.6915665",
"0.69139576",
"0.69135725",
"0.6913311",
"0.6912878",
"0.69112974",
"0.69099045",
"0.6909884"
] | 0.75338024 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_instituicao_responsavel
@instituicao_responsavel = InstituicaoResponsavel.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def setup_handler\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def workflow\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def default_action; end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend"
] | [
"0.6163927",
"0.6046165",
"0.59465253",
"0.59167755",
"0.58904207",
"0.58346355",
"0.577713",
"0.5703502",
"0.5703502",
"0.56531286",
"0.56215113",
"0.54224145",
"0.5410795",
"0.5410795",
"0.5410795",
"0.53924775",
"0.5379919",
"0.53580743",
"0.53401667",
"0.53397506",
"0.5332605",
"0.5312215",
"0.5296594",
"0.52965283",
"0.52957606",
"0.5259903",
"0.52443177",
"0.523896",
"0.523896",
"0.523896",
"0.523896",
"0.523896",
"0.52329034",
"0.52322394",
"0.5227445",
"0.5222394",
"0.5220348",
"0.5212759",
"0.5207747",
"0.5205933",
"0.5176468",
"0.5173833",
"0.5171983",
"0.51663405",
"0.5159596",
"0.5158247",
"0.51526845",
"0.5152398",
"0.5151361",
"0.5145775",
"0.5140135",
"0.51338995",
"0.51127726",
"0.5112607",
"0.5112607",
"0.5110613",
"0.51067513",
"0.5092337",
"0.508788",
"0.5081578",
"0.5080434",
"0.50679874",
"0.50567716",
"0.5051213",
"0.5048352",
"0.5048352",
"0.5035347",
"0.5026666",
"0.5023127",
"0.5016081",
"0.50129867",
"0.5000684",
"0.4999752",
"0.49979812",
"0.499026",
"0.499026",
"0.49866846",
"0.49800366",
"0.49795717",
"0.49771172",
"0.4968475",
"0.4965813",
"0.4958072",
"0.49561292",
"0.4954901",
"0.49536785",
"0.4953058",
"0.49468648",
"0.49424478",
"0.4932989",
"0.49291888",
"0.49273813",
"0.49271655",
"0.4925948",
"0.49236968",
"0.49203572",
"0.49181753",
"0.49173692",
"0.4916862",
"0.49161318",
"0.49155986"
] | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def instituicao_responsavel_params
params.require(:instituicao_responsavel).permit(:instituicao_id, :nome, :inseridoPor, :dataDeInsercao, :atualizadoPor, :dataDeAtualizacao)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def filtering_params\n params.permit(:email)\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def url_whitelist; end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] | [
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",
"0.62894756",
"0.6283177",
"0.6242471",
"0.62382483",
"0.6217549",
"0.6214457",
"0.6209053",
"0.6193042",
"0.6177802",
"0.6174604",
"0.61714715",
"0.6161512",
"0.6151757",
"0.6150663",
"0.61461",
"0.61213595",
"0.611406",
"0.6106206",
"0.6105114",
"0.6089039",
"0.6081015",
"0.6071004",
"0.60620916",
"0.6019971",
"0.601788",
"0.6011056",
"0.6010898",
"0.6005122",
"0.6005122",
"0.6001556",
"0.6001049",
"0.59943926",
"0.5992201",
"0.59909594",
"0.5990628",
"0.5980841",
"0.59669393",
"0.59589154",
"0.5958826",
"0.5957911",
"0.5957385",
"0.5953072",
"0.59526145",
"0.5943361",
"0.59386164",
"0.59375334",
"0.59375334",
"0.5933856",
"0.59292704",
"0.59254247",
"0.5924164",
"0.59167904",
"0.59088355",
"0.5907542",
"0.59064597",
"0.5906243",
"0.5898226",
"0.589687",
"0.5896091",
"0.5894501",
"0.5894289",
"0.5891739",
"0.58860534",
"0.5882406",
"0.587974",
"0.58738774",
"0.5869024",
"0.58679986",
"0.5867561",
"0.5865932",
"0.5864461",
"0.58639693",
"0.58617616",
"0.5861436",
"0.5860451",
"0.58602303",
"0.5854586",
"0.58537364",
"0.5850427",
"0.5850199"
] | 0.0 | -1 |
20 days possible states are :normal, :warn, :urgent | def todo_state
return :normal if !self.wip_total
return :urgent if self.wip_total > WIP_TOTAL_URGENT
return :warn if self.wip_total > WIP_TOTAL_WARN
return :normal if !self.lane
return :urgent if self.lane.urgent_limit and self.wip_current > self.lane.urgent_limit
return :warn if self.lane.warn_limit and self.wip_current > self.lane.warn_limit
return :normal
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def all_day ; true ; end",
"def set_day_if_discarded; end",
"def threshold_for_offline\n 8.days\n end",
"def left_to_state(left)\n if left <= DANGER_DAYS\n 'danger'\n elsif left <= WARNING_DAYS\n 'warning'\n else\n 'good'\n end\nend",
"def warning_state\n super\n end",
"def warning\n state(\"warning\")\n end",
"def age_checker\n\t\tif @age > 3\n\t\t\tputs \"These have expired and may have degraded\"\n\t\tend\n\tend",
"def run_warned; end",
"def happiness\n @happiness = 10 if@happiness > 10\n @happiness = 0 if @happiness < 0\n @happiness\n end",
"def set_default\n self.state ||= :new\n self.days ||= 365\n end",
"def have_you_been_bad\n # Shut off overnight\n if Time.now.hour.between?(23,7)\n # Dry this up\n time_not_moving = @api_methods.time_not_moving(\"Now\", @user)\n time_lightly_active = @api_methods.lightly_active_minutes(@user)\n time_fairly_active = @api_methods.fairly_active_minutes(@user)\n very_active_minutes = @api_methods.very_active_minutes(@user)\n floors = @api_methods.floors(@user)\n steps = @api_methods.steps (@user)\n\n check_target(@user, @user.sedentary_target, time_not_moving)\n check_target(@user, @user.fairly_active_target, time_fairly_active)\n check_target(@user, @user.lightly_active_target, time_lightly_active)\n check_target(@user, @user.very_active_target, very_active_minutes)\n check_target(@user, @user.floor_target, floors)\n check_target(@user, @user.steps_target, steps)\n end\n end",
"def set_default\n self.state ||= :active\n self.validity_days ||= 14\n end",
"def happiness\n if @happiness > 10\n @happiness = 10\n elsif @happiness < 0\n @happiness = 0\n else\n @happiness\n end\n end",
"def thirty \n now = Date.today\n end_date = Date.today + 30\n dates = (now...end_date).to_a\n create_log(dates) \n end",
"def warn_invalid_date; end",
"def states\n [\n ['0', 'EMERGENCY_SHUTDOWN',\n 'State machine has a bug, cannot be trusted']\n ]\n end",
"def check_possible_times\n @possible_times = Event::POSSIBLE_TIMES_CONST\n end",
"def check_daily_limit\n # unless self.user.glucose_levels.of_date(Date.today).count < GlucoseLevel::DAILY_LIMIT\n unless GlucoseLevel.where(user: self.user).of_date(Date.today).count < GlucoseLevel::DAILY_LIMIT\n self.errors.add(:value, \"Daily limit exeeds, You cannot create a new entry today\")\n end\n end",
"def storm_severity\n rand(0.2..0.4)\n end",
"def days_late\n\t\tdays = []\n\t\t(1..5).each do |ago|\n\t\t\tr = runs.where(date: Date.today - ago).first\n\t\t\tlate = r.days_late == 0 ? 'On time' : r.days_late if r\n\t\t\tlate ||= 'NO LOG'\n\t\t\tdays << late\n\t\tend\n\t\tdays\n\tend",
"def reason; end",
"def reason; end",
"def check_special_states\n # if Tons of Add-ons is there\n if $tons_version != nil\n # if version is sufficient and using Auto-Revive\n if $tons_version >= 1.6 && $game_system.AUTO_REVIVE\n # for each actor\n $BlizzABS.battlers.each {|actor|\n # if battler exists and dead and having Auto-Revive\n if actor.battler != nil && actor.battler.hp == 0 &&\n AUTO_REVIVE_IDS.any? {|i| actor.battler.states.include?(i)}\n # execute\n actor.battler.hp += actor.battler.maxhp / 5\n # remove Auto-Revive and Dead\n (AUTO_REVIVE_IDS + [DEAD_ID]).each {|i|\n actor.battler.remove_state(i)}\n # set animation\n actor.animation_id = REVIVE_ANIMATION_ID\n # set revival text\n actor.battler.damage = REVIVE_TEXT\n # display text\n actor.battler.damage_pop = true\n end}\n end\n # if version is sufficient and using Fury Status\n if $tons_version >= 6.41 && $game_system.FURY_STATUS\n # execute Fury Status change\n BlizzCFG.fury_execution\n end\n end\n end",
"def reservation_state(base = self.date_from)\n\t\t\t\t\t@reservation_states = {} if @reservation_state.nil?\n\t\t\t\t\t@reservation_state_behaviors = {} if @reservation_state_behaviors.nil?\n\t\t\t\t\tif @reservation_states[base.to_s].nil?\n\t\t\t\t\t\t\n\t\t\t\t\t\t# Now\n\t\t\t\t\t\tnow = Time.current\n\t\t\t\t\t\t\n\t\t\t\t\t\t# States\n\t\t\t\t\t\treservation_states = config(:reservation_states)\n\n\t\t\t\t\t\t# Break times\n\t\t\t\t\t\tif config(:reservation_state_policy) == \"time_fixed\"\n\t\t\t\t\t\t\tbreak_times = []\n\t\t\t\t\t\t\treservation_states.reverse_each_with_index do |reservation_state_spec, index|\n\t\t\t\t\t\t\t\tif index != 0 # Do not consider first state\n\t\t\t\t\t\t\t\t\tstate_name = reservation_state_spec[:name]\n\t\t\t\t\t\t\t\t\ttime_fixed = self.send(\"time_fixed_#{state_name}\")\n\t\t\t\t\t\t\t\t\tif time_fixed\n\t\t\t\t\t\t\t\t\t\tbreak_times << time_fixed\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\tbreak_times << break_times.last\n\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tbreak_times = [self.datetime_from(base)]\n\t\t\t\t\t\t\treservation_states.reverse_each_with_index do |reservation_state_spec, index|\n\t\t\t\t\t\t\t\tif index != 0 && index != (reservation_states.length - 1) # Do not consider first and last state\n\t\t\t\t\t\t\t\t\tstate_name = reservation_state_spec[:name]\n\t\t\t\t\t\t\t\t\ttime_window = self.send(\"time_window_#{state_name}\")\n\t\t\t\t\t\t\t\t\tif time_window\n\t\t\t\t\t\t\t\t\t\tbreak_times << (break_times.last - time_window.days_since_new_year.days - time_window.seconds_since_midnight.seconds)\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\tbreak_times << break_times.last\n\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\t\t\n\t\t\t\t\t\t# State recognititon\n\t\t\t\t\t\treservation_states.each_with_index do |reservation_state_spec, index|\n\t\t\t\t\t\t\tif index < reservation_states.length - 1\n\t\t\t\t\t\t\t\tif !break_times[reservation_states.length - 2 - index].nil? && now < break_times[reservation_states.length - 2 - index]\n\t\t\t\t\t\t\t\t\t@reservation_states[base.to_s] = reservation_state_spec[:name].to_sym\n\t\t\t\t\t\t\t\t\t@reservation_state_behaviors[base.to_s] = reservation_state_spec[:behavior].to_sym\n\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\telse # Last fallback state\n\t\t\t\t\t\t\t\t@reservation_states[base.to_s] = reservation_state_spec[:name].to_sym\n\t\t\t\t\t\t\t\t@reservation_state_behaviors[base.to_s] = reservation_state_spec[:behavior].to_sym\n\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\t\treturn @reservation_states[base.to_s]\n\t\t\t\tend",
"def w_day; end",
"def _reservation_state(base)\n\t\t\t\t\t\n\t\t\t\t\t# Now\n\t\t\t\t\tnow = Time.current\n\t\t\t\t\t\n\t\t\t\t\t# States\n\t\t\t\t\treservation_states = config(:reservation_states)\n\n\t\t\t\t\t# Break times\n\t\t\t\t\tif config(:reservation_state_policy) == \"time_fixed\"\n\t\t\t\t\t\tbreak_times = []\n\t\t\t\t\t\treservation_states.reverse_each_with_index do |reservation_state_spec, index|\n\t\t\t\t\t\t\tif index != 0 # Do not consider first state\n\t\t\t\t\t\t\t\treservation_state_name = reservation_state_spec[:name]\n\t\t\t\t\t\t\t\ttime_fixed = self.send(\"time_fixed_#{reservation_state_name}\")\n\t\t\t\t\t\t\t\tif time_fixed\n\t\t\t\t\t\t\t\t\tbreak_times << time_fixed\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tbreak_times << break_times.last\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\telse\n\t\t\t\t\t\tbreak_times = [base]\n\t\t\t\t\t\treservation_states.reverse_each_with_index do |reservation_state_spec, index|\n\t\t\t\t\t\t\tif index != 0 && index != (reservation_states.length - 1) # Do not consider first and last reservation_state\n\t\t\t\t\t\t\t\treservation_state_name = reservation_state_spec[:name]\n\t\t\t\t\t\t\t\ttime_window = self.send(\"time_window_#{reservation_state_name}\")\n\t\t\t\t\t\t\t\tif time_window\n\t\t\t\t\t\t\t\t\tbreak_times << (break_times.last - time_window.days_since_new_year.days - time_window.seconds_since_midnight.seconds)\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tbreak_times << break_times.last\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\n\t\t\t\t\t# State recognititon\n\t\t\t\t\tresult_reservation_state = nil\n\t\t\t\t\tresult_reservation_state_behavior = nil\n\t\t\t\t\treservation_states.each_with_index do |reservation_state_spec, index|\n\t\t\t\t\t\tif index < reservation_states.length - 1\n\t\t\t\t\t\t\tif !break_times[reservation_states.length - 2 - index].nil? && now < break_times[reservation_states.length - 2 - index]\n\t\t\t\t\t\t\t\tresult_reservation_state = reservation_state_spec[:name].to_sym\n\t\t\t\t\t\t\t\tresult_reservation_state_behavior = reservation_state_spec[:behavior].to_sym\n\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\telse # Last fallback state\n\t\t\t\t\t\t\tresult_reservation_state = reservation_state_spec[:name].to_sym\n\t\t\t\t\t\t\tresult_reservation_state_behavior = reservation_state_spec[:behavior].to_sym\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\t\t\n\t\t\t\t\treturn [result_reservation_state, result_reservation_state_behavior]\n\t\t\t\tend",
"def occasional_status(message)\n @last_printed_occasional_status ||= Time.now.to_i - 5\n now = Time.now.to_i\n if now - @last_printed_occasional_status > 2\n status_message(message)\n @last_printed_occasional_status = Time.now.to_i\n end\n end",
"def default_run\n self.level = :full\n self.day = \"first sun\"\n self.time = '04:00'\n end",
"def d_day_notice\n charge_start_date.between?(Time.zone.today - 6.days, Time.zone.today)\n end",
"def anatomy_past_tense; end",
"def flags\n ( (override ? 1 : 0) << 7) | read_attribute(:days_of_week)\n end",
"def absolved?(date = Date.today)\n disert_theme && disert_theme.defense_passed?(date.to_date)\n end",
"def encounter_balloon_wait\n TH::Encounter_Alert::Balloon_Wait\n end",
"def _libnotify_urgency(type)\n case type\n when 'failed'\n :normal\n else\n :low\n end\n end",
"def check_status\n #binding.pry #TODO: set date_activated/ date_inactive\n return\n end",
"def next_alert_time\n false\n end",
"def availdays(av)\n avail_day_1=false\n avail_day_1=true if (av&1)==1\n end",
"def low_cost_travel_days\n @low_cost_travel_days ||= count_days(:low, :travel)\n end",
"def status_age\n super\n end",
"def low_cost_full_days\n @low_cost_full_days ||= count_days(:low, :full)\n end",
"def check_deadline\n true\n end",
"def validate_random_day(name, value)\n now = Time.new\n if rand(0...7) == now.wday\n add_validation name + ' ' + value + ' is not considered on ' + now.strftime(\"%A\") + '. Try another time'\n end\n end",
"def set_grace_period_defaultee_status\n if self.group_loan_backlogs.where(:is_paid => false).count != 0 \n self.is_defaultee = true \n self.save \n end\n end",
"def power_outage\n event_display(\"There has been a city-wide power outage!\\n All the computers are down- no studying for today!\")\n group_event_hash_creator({technical_skills: -1})\n end",
"def interesting_date\n marked_as_fast_growing_at\n end",
"def tired\t\r\n\tif $hours_asleep >= 8 then\r\n\t $hours_asleep = 0\r\n \t\treturn false\r\n \telse\r\n \t\t$hours_asleep += 1\r\n \t\treturn true\r\n \tend \t\t\r\nend",
"def check_day_coverage\n #Create a hash to count the day-of-week settings from all profiles\n week = {}; DAYS.each { |d,name| week[d] = 0 }\n\n # Only check profiles that are not marked for destruction\n non_destroyed_profiles = profiles.select {|p| not p.marked_for_destruction?}.compact\n \n #count 'em\n non_destroyed_profiles.each do |p|\n DAYS.each {|d,name| week[d] += 1 if p.send(d) }\n end\n\n week.each do |day, count|\n if count == 0\n create_profile_set_error(\"<b>#{DAYS[day]}</b> is not set\")\n elsif count > 1\n create_profile_set_error(\"<b>#{DAYS[day]}</b> is set in multiple profiles\")\n end\n end\n end",
"def allDay\n false\n end",
"def assess_situation(d, s, b)\n danger_level = d\n save_the_day = s\n bad_excuse = b\n if danger_level > 50\n puts \"#{bad_excuse}\"\n elsif danger_level <= 50 && danger_level >= 10\n puts \"#{save_the_day}\"\n else\n puts \"Meh. Hard pass.\"\n end\nend",
"def delayed_or_advanced_days(in_resources)\n\t\t# El indicador que posee un avance real más cercano al actual\n\t\taux_progress = real_progress_function(Date.today, in_resources)\n\n\t\tif !in_resources\n\t\t\ti = indicators.min_by { |x| (x.expected_days_progress - aux_progress).abs }\n\t\telse\n\t\t\ti = indicators.min_by { |x| (x.expected_resources_progress - aux_progress).abs }\n\t\tend\n\t\t# devolvemos la diferencia en dias de la fecha del indicador con la de hoy\n\t\tif i\n\t\t\treturn (i.date.to_date - Date.today).to_i\n\t\telse\n\t\t\treturn 0\n\t\tend\n\tend",
"def determined_billed\n if Random.rand(10) == 1\n self.status = 'failed'\n else\n self.status = 'billed'\n end\n end",
"def late_or_wait?\n return 'paid' if self.paid > 0\n return 'late' if self.deadline < MyDate.today\n return 'wait' if self.deadline >= MyDate.today\n end",
"def lost?\n book.status=\"lost\" if Time.now > (book.due_date + (30*24*60*60))\n end",
"def trigger_setting_was_under_15_at_dx\n\t\tlogger.debug \"DEBUG: calling update_patient_was_under_15_at_dx from \"<<\n\t\t\t\"StudySubject:#{self.id}\"\n\t\tlogger.debug \"DEBUG: DOB changed from:#{dob_was}:to:#{dob}\"\n\t\tupdate_patient_was_under_15_at_dx\n\tend",
"def celebrate_birthday\n\t\t@age += 1\n\t\tabout(true)\n\tend",
"def check_state\n EM.stop if @setup.report_state.content =~ /operational|stranded/\n end",
"def coming_soon\n end",
"def coming_soon\n end",
"def drink_blood\n @drank_blood_today = true\n end",
"def tired\t\n\tif $hours_asleep >= 8 then\n\t $hours_asleep = 0\n \t\treturn false\n \telse\n \t\t$hours_asleep += 1\n \t\treturn true\n \tend \t\t\nend",
"def action_daily\n # ToDo: Change the hard coded report to a Report setting, or client base\n raise 'Hard coded report implementation' unless RAILS_ENV =~ /susbkk/\n end",
"def all_actual_meetings\n # Exceptions are positive (Tue/Thu class meeting on Wed)\n # or negative (Tue/Thu class doesn't meet on Tue)\n positive_exceptions = exceptions_as_dates - all_potential_meetings\n all_potential_meetings - exceptions_as_dates + positive_exceptions\n end",
"def continuious_overstay?\n no_days_continuous_in_schengen > 90\n end",
"def ccat_old_not_started_errata\n Errata.find(11129)\n end",
"def trigger_setting_was_under_15_at_dx\n\t\tlogger.debug \"DEBUG: calling update_patient_was_under_15_at_dx from \"<<\n\t\t\t\"StudySubject:#{self.attributes['id']}\"\n\t\tlogger.debug \"DEBUG: DOB changed from:#{dob_was}:to:#{dob}\"\n\t\tupdate_patient_was_under_15_at_dx\n\tend",
"def wday() end",
"def schengen_overstay?\n return schengen_days > 90 if schengen_days\n true\n end",
"def default_values\n\t\t\tself.approved \t\t\t= false\n\t\t\tself.slot_minutes \t= 30\n\t\t\tself.office_hour_start = Time.parse('08:00 UTC')\n\t\t\tself.office_hour_end = Time.parse('16:00 UTC')\n\t\t\tself.monday \t\t\t\t= false\n\t\t\tself.tuesday\t\t\t\t= false\n\t\t\tself.wednesday \t\t= false\n\t\t\tself.thursday \t\t\t= false\n\t\t\tself.friday\t\t\t\t\t= false\n\t\t\tself.saturday\t\t\t\t= false\n\t\t\tself.sunday\t\t\t\t\t= false\n\t\t\tnil\n\t\tend",
"def notify?\n recent? || (aging? && rand(5) < 3) || rand(5) == 0\n end",
"def known_states; end",
"def known_states; end",
"def known_states; end",
"def one_year_passes\n passage_of_time\n puts \"Your #{@type} tree is: #{@age} years old.\" if !@dead\n end",
"def stale_state\n end",
"def offenses_to_check; end",
"def age_restriction\n rating = nil\n if game.rating == \"Adults (18+)\"\n rating = Time.now.year - 18 #only the year is left, how to keep the whole date\n \n elsif game.rating == \"Mature (17+)\"\n rating = Time.now.year - 17\n \n elsif game.rating == \"Teen (13+)\"\n rating = Time.now.year - 13\n \n elsif game.rating == \"Everyone (10+)\"\n rating = Time.now.year - 10\n end\n \"You are not old enough to review this game\" if user.birthday.split.first.to_i > rating unless game.rating == \"Everyone\"\n end",
"def report_scheduler_state(state)\n super if defined? super\n end",
"def daily_limit_check\n errors.add(:base, \"Glucose Level can not be added more than 4 times a day.\") if GlucoseLevel.where(:user_id => user_id, :registered_date => registered_date).size >= 4\n end",
"def check_schedule(range_of_days)\n\tif 1 > range_of_days.to_i\n\t\traise \"The schedule of the diary must last for at least one day.\"\n\telsif 40 < range_of_days.to_i\n\t\traise \"Save paper! Don't generate schedule for >40 days.\"\n\tend\n\t\n\t# Set the duration of the food diary\n\t$duration = range_of_days.to_i\nend",
"def makeDays\n\t\thowManyDaysAgo = (rand()*CONFERENCE_START).round(0)+18\n\t\tlengthDays = (rand()*CONFERENCE_DAYS_MAX_DIFF).round() + CONFERENCE_DAYS_BASIC\n\t\t@startDate = (Date.today-howManyDaysAgo)\n\t\t@endDate = (Date.today-howManyDaysAgo+lengthDays)\n\t\t# That's the end of fields you want to print\t\n\t\t@days = Array.new\n\t\t(howManyDaysAgo-lengthDays..howManyDaysAgo).each{|x| @days << (CDay.new((Date.today-x), self))\t}\n\t\[email protected]! # If we want them in correct order\n\t\t# Discounts, some weird stuff may happen here, like functional programming\n\t\t@discounts = Array.new\n\t\tdays = DISCOUNT_DAYS.map{|x| x+((rand()-0.5)*DISCOUNT_DAYS_MAX_DIFF).round(0)}\n\t\tammounts = DISCOUNT_AMMOUNTS.map{|x| x+((rand()-0.5)*DISCOUNT_AMMOUNTS_MAX_DIFF).round(2)}\n\t\t(0..2).each{|x| @discounts << Discount.new(((@startDate)-days[x].to_i-1), ((@startDate)-days[x+1].to_i), self, ammounts[x])}\n\tend",
"def send_today?\n day_today = (Date.today - @config['start_date']).round\n (day_today % 28) < 21\nend",
"def random_status!\n \n choice = [:new, :needs_review, :needs_interview, :needs_interview, :needs_code_interview, :needs_decision, :needs_payment, :committed, :rejected, :rejected, :rejected, :rejected, :wont_attend, :wont_attend].sample\n return if choice == :new\n\n #convention: after setting the state, return if the choice equals that.\n self.mark_as_needs_review\n return if choice == :needs_review\n\n self.mark_as_needs_interview\n\n if choice == :needs_interview\n return\n elsif choice == :needs_code_interview\n self.mark_as_needs_code_interview\n return\n end\n\n self.mark_as_needs_decision\n return if choice == :needs_decision\n\n self.mark_as_accepted\n\n return if choice == :needs_payment\n \n self.mark_as_committed\n\n return if choice == :committed\n\n \n\n if choice == :rejected\n self.mark_as_rejected\n return\n elsif choice == :rejected\n self.mark_as_wont_attend\n return\n end\n\n #add rejected and wont_attend later.\n # if choice == :needs_decision_from_interview\n # self.mark_as_needs_decision_from_interview\n # return\n # elsif choice == :needs_decision_from_code_interview\n # self.mark_as_needs_code_interview\n # self.mark_as_needs_decision_from_code_interview\n # return\n # end\n \n end",
"def make_hungry\n if @hungry\n @hungry = false\n else\n @hungry = true\n end\n end",
"def trigger_setting_was_under_15_at_dx\n\t\tlogger.debug \"DEBUG: calling update_patient_was_under_15_at_dx from StudySubject:#{self.attributes['id']}\"\n\t\tlogger.debug \"DEBUG: DOB changed from:#{dob_was}:to:#{dob}\"\n\t\tupdate_patient_was_under_15_at_dx\n\tend",
"def times_walked_to(state); end",
"def warn_when(action)\n configuration[action] = :warn\n end",
"def assess_status(summary)\n birth = summary[:patient].birth_date\n age = summary[:patient].age_years\n imms = summary.keys\n imms.delete(:patient)\n imms.each do |imm|\n summary[imm][:next] = imm + ': none'\n end\n summary[:age] = age\n\n # HIB\n next_dose = nil\n count = summary['hib'][:count]\n since = summary['hib'][:since]\n last = summary['hib'][:last]\n if since.nil?\n age_at_last = nil\n else\n age_at_last = age - (since/365) # This is age in years at the last Hib dose\n end\n case count\n when 0\n next_dose = Date.today if age.between?(6/52, 5)\n\n when 1\n # Interval = 4 weeks if first dose at < 12 months\n next_dose = last + 28 if ( age < 5 && age_at_last < 1 )\n # Interval = 8 weeks (as final dose) if first dose administered at age 12-14 months\n next_dose = last + 56 if ( age < 5 && age_at_last.between?(1, 1.25))\n\n when 2\n # Interval = 4 weeks if current age < 12 months\n next_dose = last + 28 if ( age < 5 && age_at_last < 1 )\n # Interval = 8 weeks current age > 12 months and second dose administered at age < 15 months\n next_dose = last + 56 if ( age.between?(1, 5) && age_at_last < 1.25)\n\n when 3\n next_dose = birth + 455 # 15 months of age\n next_dose = last + 56 if ( age.between?(1.25, 5) && age_at_last < 1 )\n end\n if next_dose\n next_dose = today.to_date if next_dose < today\n date_s = next_dose.to_s\n date_s = 'today' if next_dose == today\n else\n date_s = 'none'\n end\n summary = update_next_dose(summary, 'hib', next_dose)\n\n # Meningococcus\n next_dose = ''\n since = summary['mening'][:since]\n if since.nil? || since > 730 # if no previous immunization or imm > 2 years ago\n next_dose = today\n next_dose = birth + 0.75*365 if age < 0.75 # if less than nine months old, set next dose to when age is 9 months\n else\n next_dose = last + 730\n end\n summary = update_next_dose(summary, 'mening', next_dose)\n\n # Polio\n next_dose = ''\n count = summary['opv'][:count]\n since = summary['opv'][:since]\n last = summary['opv'][:last]\n if since.nil?\n age_at_last = nil\n else\n age_at_last = age - (since/365) # This is age in years at the last Hib dose\n end\n case count\n when 0\n next_dose = birth + 42 # first dose due at 6 weeks\n when 1..2\n next_dose = last + 28\n when 3\n if age_at_last < 4 # \"fourth dose not needed if third given at older than 4 years of age\"\n next_dose = last + 28\n next_dose = birth + (365*4) if (next_dose < birth + 365*4) # fourth dose given at min 4 years old (check Nigeria policy**\n end\n end\n summary = update_next_dose(summary, 'opv', next_dose)\n\n # DPT\n next_dose = ''\n count = summary['dpt'][:count]\n since = summary['dpt'][:since]\n last = summary['dpt'][:last]\n if since.nil?\n age_at_last = nil\n else\n age_at_last = age - (since/365) # This is age in years at the last dose\n end\n case count\n when 0\n next_dose = birth + 42 # first dose due at 6 weeks\n when 1..2\n next_dose = last + 28\n when 3\n next_dose = last + 183 # Six month interval to fourth dose -- is fourth dose given here? When, at 9 mo?\n when 4\n if age_at_last < 4 # \"fourth dose not needed if third given at older than 4 years of age\"\n next_dose = last + 183\n next_dose = birth + (365*4) if (next_dose < birth + 365*4) # fourth dose given at min 4 years old (check Nigeria policy**\n end\n end\n summary = update_next_dose(summary, 'dpt', next_dose)\n\n # After all the immunizations are assessed and next dose dates calculated\n return summary\n end",
"def allDay\n FALSE\n end",
"def show_state\n if @life_points <= 0\n puts \"#{@name} is dead... \\n...Monde de merde...\"\n else\n puts \"#{@name} has #{@life_points} life points left.\"\n end\n end",
"def low_frequency\n log \"Updating event status\"\n M2mhub::Event.open_or_recently_closed.each(&:update_status!)\n log \"Finished\"\n true\n end",
"def pre_initiation_date_status\n 'Pre-announcement'\n end",
"def outdated; end",
"def advance_day\r\n\t\t@day += 1\r\n\t\t@cash_previous = @cash\r\n\t\tpay_workers\r\n\t\tdaily_sales\r\n\t\tdaily_thievery\r\n\t\tdaily_consequences\r\n\t\tif @cash <= 0\r\n\t\t\tputs \"*\"*50\r\n\t\t\tputs \"You ran out of money. Game over.\"\r\n\t\t\t@active = false\r\n\t\t\treturn\r\n\t\telsif @inventory <= 0\r\n\t\t\tputs \"*\"*50\r\n\t\t\tputs \"You ran out of inventory. Game over.\"\r\n\t\t\t@active = false\r\n\t\t\treturn\r\n\t\telsif rand(100) == 0\r\n\t\t\tputs \"*\"*50\r\n\t\t\tputs \"You got caught by cops. Game over.\"\r\n\t\t\t@active = false\r\n\t\t\treturn\r\n\t\tend\r\n\t\toperations\r\n\tend",
"def livia_date_effect(new_date)\n if new_date\n days= (Time.zone.now.to_date - new_date.to_date).to_i\n weekend = new_date.wday\n add_class = ((weekend == 0) || (weekend == 6))? \"weekend\" : \"\"\n \n if days ==0\n return %Q{\n <span style=\"color: #F88158\" class=\"blink #{add_class}\">#{new_date.to_time.strftime('%m/%d/%y') if new_date}</span>\n }\n elsif days > 0\n return %Q{\n <span class=\"#{add_class} red_text\"%>#{new_date.to_time.strftime('%m/%d/%y') if new_date}</span>\n }\n else\n return %Q{\n <span class=\"#{add_class}\">#{new_date.to_time.strftime('%m/%d/%y') if new_date}</span>\n }\n end\n else\n return ''\n end\n end",
"def days_validation\n @start_cycle = @vote_setting.start_cycle.to_date \n @end_cycle = @vote_setting.end_cycle.to_date\n @days_count = (@end_cycle - @start_cycle).round\n end",
"def predicted_deaths\r\n # predicted deaths is solely based on population density\r\n case @population_density \r\n inf = 1.0/0\r\n when 200..inf \r\n number_of_deaths = (@population * 0.4).floor\r\n when 150...200\r\n number_of_deaths = (@population * 0.3).floor\r\n when 100...150\r\n number_of_deaths = (@population * 0.2).floor\r\n when 50...100\r\n number_of_deaths = (@population * 0.1).floor\r\n else\r\n number_of_deaths = (@population * 0.05).floor\r\n end\r\n\r\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak\"\r\n\r\n end",
"def validity_period\n super\n end",
"def get_eligible\n #older than 1 day, not older than X date (whenever they get these cards).\nend",
"def predicted_deaths\r\n # predicted deaths is solely based on population density\r\n# if @population_density >= 200\r\n# @number_of_deaths = (@population * 0.4).floor\r\n# elsif @population_density >= 150\r\n# @number_of_deaths = (@population * 0.3).floor\r\n# elsif @population_density >= 100\r\n# @number_of_deaths = (@population * 0.2).floor\r\n# elsif @population_density >= 50\r\n# @number_of_deaths = (@population * 0.1).floor\r\n# else\r\n# @number_of_deaths = (@population * 0.05).floor\r\n# end\r\n case @population_density\r\n when 0...49 then @number_of_death = (@population * 0.05).floor\r\n when 50...99 then @number_of_death=(@population * 0.1).floor\r\n when 100...149 then @number_of_death=(@population * 0.2).floor\r\n when 150...200 then @number_of_death=(@population * 0.3).floor\r\n else @number_of_death=(@population * 0.4).floor\r\n end \r\n print \"#{@state} will lose #{@number_of_death} people in this outbreak\"\r\n\r\n end",
"def filter_repeated\n reset_api_settings!\n if @event['check']['name'] == 'keepalive'\n # Keepalives are a special case because they don't emit an interval.\n # They emit a heartbeat every 20 seconds per\n # http://sensuapp.org/docs/0.12/keepalives\n interval = 20\n else\n interval = @event['check']['interval'].to_i || 0\n end\n alert_after = @event['check']['alert_after'].to_i || 0\n\n if self.class.name =~ /Pagerduty/ && @event['check']['page_after']\n alert_after = @event['check']['page_after'].to_i\n end\n\n # nil.to_i == 0\n # 0 || 1 == 0\n realert_every = ( @event['check']['realert_every'] || 1 ).to_i \n # realert_every can't be 0 because of potential ZeroDivisionError below\n realert_every = -1 if realert_every == 0\n\n initial_failing_occurrences = interval > 0 ? (alert_after / interval) : 0\n number_of_failed_attempts = @event['occurrences'] - initial_failing_occurrences\n\n # sensu 0.26+ only, else never make occurrences_watermark actionable\n # https://github.com/Yelp/sensu_handlers/issues/103\n # this hack takes care of scenario\n # when event has triggered at action == create\n # but did not resolve the corresponding event when action == resolve.\n # occurrences_watermark > initial_failing_occurrences prove enough occurrences\n # of the event that triggered create and hence it is safe to filter the event to resolve handler action.\n if (@event.key?('occurrences_watermark') &&\n @event['occurrences_watermark'] > initial_failing_occurrences &&\n @event['action'] == 'resolve')\n return\n end\n\n # Don't bother acting if we haven't hit the \n # alert_after threshold\n if number_of_failed_attempts < 1\n bail \"Not failing long enough, only #{number_of_failed_attempts} after \" \\\n \"#{initial_failing_occurrences} initial failing occurrences\"\n # If we have an interval, and this is a creation event, that means we are\n # an active check\n # Lets also filter based on the realert_every setting\n elsif interval > 0 and @event['action'] == 'create' \n # Special case of exponential backoff\n if realert_every == -1\n # If our number of failed attempts is an exponent of 2\n if power_of_two?(number_of_failed_attempts)\n # Then This is our MOMENT!\n return nil\n else\n bail \"not on a power of two: #{number_of_failed_attempts}\"\n end\n elsif (number_of_failed_attempts - 1) % realert_every != 0\n # Now bail if we are not in the realert_every cycle\n bail \"only handling every #{realert_every} occurrences, and we are at\" \\\n \" #{number_of_failed_attempts}\"\n end\n end\n end"
] | [
"0.58318627",
"0.5796542",
"0.5743867",
"0.5739495",
"0.5440411",
"0.5430141",
"0.5415253",
"0.5409522",
"0.5377407",
"0.53723675",
"0.5368352",
"0.5351271",
"0.5350276",
"0.53190815",
"0.52521896",
"0.5251513",
"0.52367383",
"0.5236585",
"0.52113044",
"0.5200838",
"0.51852196",
"0.51852196",
"0.5179202",
"0.5174249",
"0.517158",
"0.5150998",
"0.51461256",
"0.51322424",
"0.51293445",
"0.5128332",
"0.5125573",
"0.51169246",
"0.5103289",
"0.5096083",
"0.5094475",
"0.5091819",
"0.5091759",
"0.50876933",
"0.5083559",
"0.5076232",
"0.5058817",
"0.5052009",
"0.50503147",
"0.50350654",
"0.50320464",
"0.50265133",
"0.5024595",
"0.5021493",
"0.5014099",
"0.5012287",
"0.49993536",
"0.49972922",
"0.49958438",
"0.49927598",
"0.49889642",
"0.49877024",
"0.49862602",
"0.49862602",
"0.4982068",
"0.49799168",
"0.4979512",
"0.49747548",
"0.49711862",
"0.49654433",
"0.4960616",
"0.49589992",
"0.49572954",
"0.4954954",
"0.4954523",
"0.4954375",
"0.4954375",
"0.4954375",
"0.4953464",
"0.49391904",
"0.493676",
"0.49348557",
"0.49346477",
"0.4924085",
"0.49173853",
"0.49124837",
"0.49082068",
"0.4903978",
"0.49031612",
"0.4891484",
"0.48889554",
"0.48832184",
"0.48825675",
"0.4875204",
"0.48737365",
"0.48732498",
"0.4871081",
"0.48693132",
"0.485957",
"0.48595154",
"0.48559883",
"0.4847917",
"0.48453507",
"0.48414594",
"0.48402297",
"0.48382467"
] | 0.5296324 | 14 |
wip counters needed to determine the current and the overall WIP wip_current for the current lane wip_total for all lanes | def update_time_counters
unless changed? and !changes["lane_id"].nil?
self.current_lane_entry = Time.now if self.new_record? && self.lane && self.lane.counts_wip
return
end
old_lane_id,new_lane_id = changes["lane_id"]
old_lane = Lane.new(old_lane_id) if old_lane_id
new_lane = Lane.new(new_lane_id)if new_lane_id
# add the time spent in the old_lane to the wip_total
if old_lane and current_lane_entry #and old_lane.counts_wip # not_needed?
self.wip_total ||= 0
self.wip_total += (Time.now - self.current_lane_entry)
self.current_lane_entry=nil
end
# start new counter for the new lane, if needed
if new_lane and new_lane.counts_wip
self.current_lane_entry=Time.now
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def todo_state\n return :normal if !self.wip_total\n return :urgent if self.wip_total > WIP_TOTAL_URGENT\n return :warn if self.wip_total > WIP_TOTAL_WARN\n\n return :normal if !self.lane\n return :urgent if self.lane.urgent_limit and self.wip_current > self.lane.urgent_limit\n return :warn if self.lane.warn_limit and self.wip_current > self.lane.warn_limit\n return :normal\n end",
"def calculate_open_weeks\n @timeline_week_count - blackout_weeks_count - @course.weeks.count\n end",
"def lift_total\n # binding.pry\n lifters.map { |lifter| lifter.lift_total }.sum\n end",
"def calculate_week_power_for\n dates, totals = consolidate_week\n\n weekPowerCount = 0\n\n totals.each do |index, total|\n weekPowerCount+=total\n end\n\n weekPowerCount\n end",
"def wip\n end",
"def total_lift\n lifters.map{|lifter| lifter.lift_total}.sum\n end",
"def total_lift\n sum = 0\n lifters_gym.map do |lifter|\n sum += lifter.lift_total\n end\n end",
"def combined_lift_total\n clt = 0\n Membership.all.select do |membership_instance|\n if membership_instance.gym == self\n clt += membership_instance.member.lift_total\n end\n end\n clt\n end",
"def current_power_usage\n begin\n power_being_used = 0.0\n\n (1..3).each do |ipdp|\n (1..4).each do |ap|\n power_reading = @xml.xpath(\"//XMLdata//info8_IPDP#{ipdp}_ap#{ap}\")[0].content.to_f\n power_being_used += power_reading #in Watts\n end\n end\n \n return power_being_used/1000.0 #in KW\n\n rescue #If something is wrong with the data\n return 0.0\n end\n end",
"def combined_lift_total\n gym_lifters.map {|lifter| lifter.lift_total}.sum / gym_lifters.count\n end",
"def current_week\n standings = Standing.all.order(:wins).reverse\n\n user_standing_index = nil\n standings.each_with_index do |st, index|\n user_standing_index = index if st.user_id == current_user.id\n end\n\n ahead_user_standings = standings[user_standing_index - 1]\n behind_user_standings = standings[user_standing_index + 1]\n\n ahead_user = User.find(ahead_user_standings.user_id)\n behind_user = User.find(behind_user_standings.user_id)\n\n @user_standing = {\n place: user_standing_index + 1,\n wins: standings[user_standing_index].wins\n }\n\n @current_week = Week.last\n games = Game.where(week_id: @current_week.id)\n @games = games.order(:game_finished, :date, :start_time)\n\n if games.order(updated_at: :desc).first\n @last_upd = games.order(updated_at: :desc).first.updated_at\n else\n @last_upd = @current_week.updated_at\n end\n\n @correct = 0\n ahead_correct = 0\n behind_correct = 0\n\n @picks = {}\n @games.each do |g|\n user_pick = g.picks.where(user_id: current_user.id)\n ahead_pick = g.picks.where(user_id: ahead_user.id)\n behind_pick = g.picks.where(user_id: behind_user.id)\n\n pick_count = g.picks.count.to_f\n away_count = g.picks.where(away_home: 'away').count.to_f\n home_count = g.picks.where(away_home: 'home').count.to_f\n\n if away_count > home_count\n field = \"#{g.away} (#{(away_count / pick_count) * 100}%)\"\n elsif home_count > away_count\n field = \"#{g.home} (#{(home_count / pick_count) * 100}%)\"\n else\n field = 'split 50/50'\n end\n\n if user_pick[0] != nil\n if user_pick[0].pick\n @picks[user_pick[0].game_id] = { \n :pick => user_pick[0].pick, \n :away_home => user_pick[0].away_home,\n :field => field\n }\n end\n\n if user_pick[0].tbreak_pts != nil\n @tbreak_pts = user_pick[0].tbreak_pts\n end\n\n if g[:game_finished] == true\n @correct += 1 if user_pick[0].away_home == g.winner\n ahead_correct += 1 if ahead_pick[0].away_home == g.winner\n behind_correct += 1 if behind_pick[0].away_home == g.winner\n end\n end\n end\n\n @ahead = {\n user: ahead_user.username,\n wins: ahead_user_standings.wins,\n correct_this_week: ahead_correct\n }\n\n @behind = {\n user: behind_user.username,\n wins: behind_user_standings.wins,\n correct_this_week: behind_correct\n }\n end",
"def lift_total_for_gym\n total = 0\n lifters.each do |lifter|\n total += lifter.lift_total\n end\n total\n end",
"def lifters_lift_total\n gym_lift_totals = lifters.map {|lifter| lifter.lift_total}\n gym_lift_totals.reduce {|total, lift_total| total + lift_total}\n end",
"def get_total_wages\n self.get_base_wages + self.get_manager_wages\n end",
"def calculate!\n ov = self[:overall]\n ov[:high_night] = {}\n ov[:winners] = {}\n\n self.each do |player_id, st|\n next if player_id == :overall\n\n ## calculate computed stats for player\n st[:nights] += st[:dates].keys.length # if st[:nights] == 0\n st[:high_night] = st[:dates].values.max\n st[:gold_stars] = 1 if st[:nights] == 29\n st[:warps_per_game] = 1.0 * st[:warps] / st[:games] rescue 0\n st[:warps_per_night] = 1.0 * st[:warps] / st[:nights] rescue 0\n st[:games_per_night] = 1.0 * st[:games] / st[:nights] rescue 0\n st[:wins_per_night] = 1.0 * st[:wins] / st[:nights] rescue 0\n st[:wins_per_game] = 1.0 * st[:wins] / st[:games] rescue 0\n\n ## accumulate overall stats\n [:warps, :wins, :cfbs,\n :mystery_factors, :gold_stars]. each do |field|\n ov[field] += st[field]\n end\n [:wimps, :come_ons].each do |field|\n if st[field]\n ov[field] ||= 0\n ov[field] += st[field]\n end\n end\n # nights won calculation\n st[:dates].each do |date,warps|\n ov[:dates][date] += warps\n hnd = ov[:high_night][date] ||= {:players => [], :warps => 0}\n if hnd[:warps] < warps\n hnd[:players] = [player_id]\n hnd[:warps] = warps\n elsif hnd[:warps] == warps\n hnd[:players].push(player_id)\n end\n end\n end\n\n ## update overall computed stats\n st = self[:overall]\n ov[:games] = ov[:wins]\n ov[:nights] = ov[:dates].keys.length\n ov[:nights] = 29 if ov[:nights] == 0 ## provide sane default\n ov[:nights] = ov[:nights_real] if ov[:nights_real]\n ov[:warps_per_game] = 1.0 * ov[:warps] / ov[:games] rescue 0\n ov[:warps_per_night] = 1.0 * ov[:warps] / ov[:nights] rescue 0\n ov[:games_per_night] = 1.0 * ov[:games] / ov[:nights] rescue 0\n ov[:high_night].each do |date,h|\n h[:players].each {|p| self[p][:nights_won] += 1}\n end\n\n ## determine per-stat winners\n # fuck everyone but the top 50 OR those with 50+ warps\n # the 51 below is not a bug\n sorted_players = self.keys.sort{|a,b| self[b][:warps] <=> self[a][:warps]}\n fifty_plus = self.keys.select{|p| self[p][:warps] >= 50}\n eligible = (sorted_players[0..51] | fifty_plus).\n inject(Hash.new(false)) {|acc,p| acc.merge(p => true)}\n [:warps, :games, :nights, :wins, :nights_won, :cfbs,\n :come_ons, :wimps, :warps_per_game, :warps_per_night,\n :games_per_night, :wins_per_game, :high_night].each do |field|\n owf = ov[:winners][field] = {:players => [], :value => 0}\n self.each do |player, st|\n next if player == :overall\n next unless eligible[player]\n if st[field].to_f > owf[:value]\n owf[:players] = [player]\n owf[:value] = st[field]\n elsif st[field] == owf[:value]\n owf[:players].push(player)\n end\n end\n end\n\n ## mark per-stat winners\n ov[:winners].each do |field, win|\n win[:players].each do |player|\n self[player][:winner][field] = true\n end\n end\n\n self\n end",
"def lift_total\n # lifters.reduce(0) do |total, lifter|\n # total += lifter.lift_total\n # total\n lifers.sum { |lifter| lifter.lift_total }\n end",
"def lift_total\n all_lifters.reduce(0){ |total, lifttot| \n total + lifttot.lift_total}\n end",
"def lift_total_for_gym\n total = 0\n self.lifters.each do |lifter|\n total += lifter.lift_total\n end\n total\n end",
"def test_increment_counters\n map = create_towns\n p1 = Prospector::new map[0]\n ret = [1, 1]\n p1.increment_counters ret\n assert_equal p1.return_rr, 1\n assert_equal p1.return_fr, 1\n assert_equal p1.return_days, 1\n end",
"def climb_count\n self.climbs.inject(0) do |sum, climb|\n sum += climb.block_1 if climb.block_1\n sum += climb.block_2 if climb.block_2\n sum += climb.block_3 if climb.block_3\n sum += climb.block_4 if climb.block_4\n sum\n end\n end",
"def lift_totals\n lifters.sum do |lifter|\n lifter.lift_total\n end\n end",
"def poll_cycle\n\n puts \"---------------------\"\n puts \"#{host}\"\n puts \"---------------------\"\n data = twemproxy_data()\n\n summary_ejections = 0\n summary_client_connections = 0\n summary_requests = 0\n summary_server_connections = 0\n summary_server_errors = 0\n summary_in_queue = 0\n summary_out_queue = 0\n summary_servers = 0\n data.keys.find_all{|k| data[k].is_a?(Hash)}.each do |pool|\n summary_client_connections += metric_total(\"client connections/#{pool}\", data[pool]['client_connections'], \"connections\")\n summary_ejections += metric_total(\"server ejections/#{pool}\", data[pool]['server_ejects'], \"ejects\")\n\n data[pool].keys.find_all{|k| data[pool][k].is_a?(Hash)}.each do |server|\n summary_servers += 1\n summary_requests += metric_value(\"server requests/#{pool}/#{server}\", data[pool][server]['requests'], \"requests\")\n summary_server_connections += metric_total(\"server connections/#{pool}/#{server}\", data[pool][server]['server_connections'], \"connections\")\n summary_server_errors += metric_value(\"server errors/#{pool}/#{server}\", data[pool][server]['server_err'], \"errors\")\n summary_in_queue += metric_total(\"in queue/#{pool}/#{server}\", data[pool][server]['in_queue'], \"ops\")\n summary_out_queue += metric_total(\"out queue/#{pool}/#{server}\", data[pool][server]['out_queue'], \"ops\")\n metric_value(\"request bytes/#{pool}/#{server}\", data[pool][server]['request_bytes'], \"bytes\")\n metric_value(\"response bytes/#{pool}/#{server}\", data[pool][server]['response_bytes'], \"bytes\")\n end\n end\n\n metric_total \"total ejections\", summary_ejections, \"ejects\"\n metric_total \"total client connections\", summary_client_connections, \"connections\"\n metric_total \"total server requests\", summary_requests, \"requests\"\n metric_total \"total server connections\", summary_server_connections, \"connections\"\n metric_total \"total server errors\", summary_server_errors, \"errors\"\n metric_total \"total in queue\", summary_in_queue, \"ops\"\n metric_total \"total out queue\", summary_out_queue, \"ops\"\n metric_total \"total servers\", summary_servers, \"servers\"\n metric_total \"percent up\", (((summary_servers - summary_ejections) / summary_servers) * 100.0), \"%\"\n end",
"def cloudwatch_monitor_info(id, onevm, cw_mon_time)\n cw=Aws::CloudWatch::Client.new\n\n # CPU\n begin\n cpu = get_cloudwatch_metric(cw,\n \"CPUUtilization\",\n cw_mon_time,\n [\"Average\"],\n \"Percent\",\n id)\n if cpu[:datapoints].size != 0\n cpu = cpu[:datapoints][-1][:average]\n else\n cpu = onevm[\"MONITORING/CPU\"] || 0\n end\n cpu = cpu.to_f.round(2).to_s\n rescue => e\n OpenNebula::log_error(e.message)\n end\n\n # NETTX\n nettx = 0\n begin\n nettx_dp = get_cloudwatch_metric(cw,\n \"NetworkOut\",\n cw_mon_time,\n [\"Sum\"],\n \"Bytes\",\n id)[:datapoints]\n previous_nettx = onevm[\"/VM/MONITORING/NETTX\"]\n nettx = previous_nettx ? previous_nettx.to_i : 0\n\n nettx_dp.each{|dp|\n nettx += dp[:sum].to_i\n }\n rescue => e\n OpenNebula::log_error(e.message)\n end\n\n # NETRX\n netrx = 0\n begin\n netrx_dp = get_cloudwatch_metric(cw,\n \"NetworkIn\",\n cw_mon_time,\n [\"Sum\"],\n \"Bytes\",\n id)[:datapoints]\n previous_netrx = onevm[\"/VM/MONITORING/NETRX\"]\n netrx = previous_netrx ? previous_netrx.to_i : 0\n\n netrx_dp.each{|dp|\n netrx += dp[:sum].to_i\n }\n rescue => e\n OpenNebula::log_error(e.message)\n end\n\n \"CPU=#{cpu.to_s} NETTX=#{nettx.to_s} NETRX=#{netrx.to_s} \"\n end",
"def accumulated_power_used\n power_total = 0.0\n\n begin\n (1..3).each do |ipdp|\n (1..4).each do |eg|\n power_reading = @xml.xpath(\"//XMLdata//info8_IPDP#{ipdp}_eg#{eg}\")[0].content.to_f\n #$stderr.puts \"Power Reading Phase #{ipdp} Socket #{eg} Energy #{power_reading}KJ\"\n power_total += power_reading\n end\n end\n return power_total/3600.0\n \n rescue #If something is wrong with the data\n return 0.0\n end\n end",
"def get_base_wages\n events_worked = Distribution.get_events_worked(self.id)\n set_of_events = Event.events_worked_to_objects(events_worked)\n Event.calc_wages_for_set_of_events(set_of_events)\n end",
"def increment_wags!\n user.increment!(:wags) if report_type == 'found'\n end",
"def wind\r\n\tcoldest = 1000\r\n\tci = 0\r\n\twarmest = -1000\r\n\twi = 0\r\n\t## find the coldest and the hottest positions indexes\r\n\[email protected]_with_index do |p,index|\r\n\t if p.temperature < coldest\r\n\t coldest = p.temperature\r\n\t\tci = index\r\n\t end\r\n\t if p.temperature >= warmest\r\n\t warmest = p.temperature\r\n\t\twi = index\r\n\t end\r\n\tend\r\n\t## puts \"#{coldest} : #{ci}\"\r\n\t## puts \"#{warmest} : #{wi}\"\r\n\t\r\n\t@positions[ci].temperature += 10\r\n\t\r\n\t\r\n\t##################################\r\n\t# left_over = @positions[ci].water_bank % 9\r\n\t# amount_for_each = @positions[ci].water_bank / 9\r\n\tn = check_neighbours(ci)\r\n\tn.each_with_index do |ni,index|\r\n\t ni.temperature += 2\r\n\t # ni.water_bank += amount_for_each \r\n\t # @positions[ci].water_bank -= amount_for_each \r\n\tend\r\n\t\r\n\t@positions[wi].temperature -= 10\r\n\t# left_over = @positions[wi].water_bank % 9\r\n\t# amount_for_each = @positions[wi].water_bank / 9\r\n n = check_neighbours(wi)\r\n\tn.each_with_index do |ni,index|\r\n\t ni.temperature -= 2\r\n\t # ni.water_bank += amount_for_each \r\n\t # @positions[wi].water_bank -= amount_for_each \r\n\tend\r\n\t####################################\r\n\t\r\n\t# gets the water banks, starting from the coldest\r\n\tstart = ci\r\n\ts = []\r\n\t#from coldest position to last position\r\n\t[*start...(@width*@height)].each do |i|\r\n\t s << @positions[i].water_bank\r\n\tend\r\n\t# from 0 (or first position) to the coldest position\r\n\tif start > 0\r\n\t [*0..(start-1)].each do |i|\r\n\t s << @positions[i].water_bank\r\n\t end\r\n\tend\r\n\t\r\n\t# then starting fromt he warmest replacing the water banks with the previously collected\r\n\tstart = wi\r\n\t#from warmest position to last position\r\n\t[*start...(@width*@height)].each do |i|\r\n\t @positions[i].water_bank = s[i]\r\n\tend\r\n\t# from first position to warmest position\r\n\tif start > 0\r\n\t [*0..(start-1)].each do |i|\r\n\t @positions[i].water_bank = s[i]\r\n\t end\r\n\tend\r\n\t\r\n\tif @log == true\r\n\t @logger.write \"wind\"\r\n\tend\r\n end",
"def setup4dashboard\n # DST\n count = 0\n count += 1 if @is_unclear_dst == true\n # Guard\n count += 1 if @is_unclear_guard == true\n count += 1 if @inconsistent_policy == true\n\n return count\n end",
"def place_mine_indicators\n @board.each_with_index do |r, row|\n r.each_with_index do |_c, col|\n unless @board[row][col].is_a_mine\n count = 0\n if row - 1 >= 0\n count += 1 if col - 1 >= 0 && @board[row - 1][col - 1].is_a_mine\n count += 1 if @board[row - 1][col].is_a_mine\n count += 1 if col + 1 < @board.size && @board[row - 1][col + 1].is_a_mine\n end\n count += 1 if col - 1 >= 0 && @board[row][col - 1].is_a_mine\n count += 1 if col + 1 < @board.size && @board[row][col + 1].is_a_mine\n if row + 1 < @board.size\n count += 1 if col - 1 >= 0 && @board[row + 1][col - 1].is_a_mine\n count += 1 if @board[row + 1][col].is_a_mine\n count += 1 if col + 1 < @board.size && @board[row + 1][col + 1].is_a_mine\n end\n @board[row][col].set_value(count)\n end\n end\n end\n end",
"def wip_list\n ENV.fetch('WIP', '').split(',')\n end",
"def view_current_trips\n @trips = Request.all\n @count = Request.count\n @trips.each do |trip|\n @curLoc = trip.currentLoc\n @destination = trip.destination\n end\n end",
"def init_counters\n calculate_ratio_sum\n calculate_proxies_needed\n end",
"def total_points\n\n points = 0\n wattball_matches_as_team1.each do |match|\n points += match.points(1) || 0\n end\n\n wattball_matches_as_team2.each do |match|\n points += match.points(2) || 0\n end\n\n points\n end",
"def current_week_kwh_usage\n total_week_kwh_usage_until(Time.now.utc.to_date).round(2)\n end",
"def total\n wins + losses\n end",
"def inverter_mppt_Calculate\n inverter_watt = ((@panels_no*@panel_wt)/0.7).ceil(3)\n @sys_circuits = 1\n if inverter_watt > 2500\n @sys_circuits = (((inverter_watt/2500)+0.4).ceil(1)).round()\n @sys_circuits += 1 if @sys_circuits.odd?\n inverter_watt = (inverter_watt/@sys_circuits).ceil(3)\n end\n inverter_watt = 1000 if inverter_watt < 1000\n mppt_amp = ((@panels_no*@panel_wt*1.25)/(@battery_voltage*2)).ceil()\n mppt_amp = mppt_amp / @sys_circuits if @sys_circuits > 1\n \n {\"inverter_watt\" => inverter_watt.ceil(-2), \"inverters_num\" => @sys_circuits, \"mppt_amp\" => mppt_amp.ceil(-1), \"mppts_num\" => @sys_circuits}\n end",
"def availability_summary #This should be changed to availability_summary_count\n unavailable = 0\n available = 0\n awaiting = 0\n\n self.cached_teamsheet_entries.each do |tse|\n if tse.response_status == 0\n unavailable += 1\n elsif tse.response_status == 1\n available += 1\n elsif tse.response_status == 2\n awaiting += 1\n end\n end\n\n { unavailable: unavailable, available: available, awaiting: awaiting }\n end",
"def test_total_weight\n assert_equal(0 , @wp00.total_weight)\n assert_equal(384, @wp01.total_weight)\n assert_equal(576, @wp02.total_weight)\n end",
"def calculate_winnings\n result = 0\n self.bookings.each do |booking|\n if booking.match.status == \"FINISHED\"\n if booking.won\n result += booking.stake * booking.odd.odds\n else\n booking.stake ? result -= booking.stake : result\n end\n end\n end\n return result.round(2)\n end",
"def index\n @whips = Whip.all\n end",
"def trips_stats \n @all = current_user.trip_requests.trips.count\n @completed = current_user.trip_requests.trips.completed.count\n @cancelled = current_user.trip_requests.trips.cancelled.count\n @pending = current_user.trip_requests.trips.pending.count\n @on_going = current_user.trip_requests.trips.on_going.count\n @active = current_user.trip_requests.trips.active.count\n @monthly_successful = current_user.trip_requests.completed.trips.group_by_month(:created_at, format: \"%b\", reverse:true).count\n @monthly_pending = current_user.trip_requests.pending.trips.group_by_month(:created_at, format: \"%b\", reverse:true).count\n @response = { all: @all, completed: @completed, cancelled: @cancelled, active: @active, monthly_pending:@monthly_pending, monthly_successful:@monthly_successful, pending: @pending, on_going: @on_going }\n json_response(@response)\n end",
"def robot_counter\n\n\tend",
"def instructions_counter\n @instructions_counter\n end",
"def tiles_remaining\n @default_tiles.values.inject(0, :+)\n end",
"def update_wp_count\n #credit for this approach: http://blog.eldoy.com/posts/14-Custom-counter-cache-column\n self.posted_by.update_attribute :water_points_count, self.posted_by.water_points.visible.count\n end",
"def moneys_total\n moneys_total = 0\n mini_maps.each do |map|\n moneys_total += map.moneys_total\n end\n return moneys_total\n end",
"def total_timesheet\n if self.shifts.any?\n hours = self.shifts.sum(:time_worked)\n if hours > 40\n self.reg_hours = 40\n self.ot_hours = hours - 40\n ot_rate = job.pay_rate * 1.5\n self.gross_pay = job.pay_rate * self.reg_hours + self.ot_hours * ot_rate\n else\n pay = job.pay_rate * hours\n self.reg_hours = hours\n self.ot_hours = 0\n self.gross_pay = pay\n self.total_bill = pay * job.mark_up\n \n end\n end\n end",
"def overall_WLR\n overall_losses = 0\n overall_wins = 0\n @player_champs_list.each do |champ|\n overall_losses += champ.total_losses\n overall_wins += champ.total_wins\n end\n overall_losses > 0 ? (overall_wins.to_f / overall_losses).round(2) : overall_wins.to_f\n end",
"def stat\n each_with_object(Hash.new(0)) { |c, o| o[c] += 1 }\n end",
"def all_weeks\n @all_weeks ||=\n data_points.each_with_object(Hash.new(0)) { |feed, all_weeks|\n all_weeks[feed.occurred_on.beginning_of_week(week_start_day)] += feed.send(field)\n }\n end",
"def calculated_wounds\n wound_th = brawn\n wound_th += race.wound_threshold if race && race.wound_threshold\n # Then increase based on selected talents.\n talent_alterations.each do |_talent_id, stat|\n stat.each do |type, value|\n wound_th += value if type == :wound\n end\n end\n wound_th\n end",
"def compute_state # {{{\n\n player_moves = []\n ki_moves = []\n\n player_moves = self.get_moves_as_hash true\n ki_moves = self.get_moves_as_hash false\n\n return WON if has_winning_combination player_moves\n return LOST if has_winning_combination ki_moves\n\n return DRAWN if player_moves.count + ki_moves.count == 3*3\n\n RUNNING\n end",
"def determine_win\n\t\t@win_combos.each do |combo|\n\t\t\tp1 = (@p1_spaces & combo).length\n\t\t\tp2 = (@p2_spaces & combo).length\n\n\t\t\tif p1 == 3\n\t\t\t\treturn 1\n\t\t\t\tp1.games_won += 1\n\t\t\telsif p2 == 3\n\t\t\t\treturn 2\n\t\t\t\tp2.games_won += 1\n\t\t\tend\n\t\tend\n\t\t0\n\tend",
"def concurrent_count\n debug(\"Getting puppet status\")\n\n running = 0\n\n @puppet.status do |resp|\n begin\n running += resp[:body][:data][:running].to_i\n rescue Exception => e\n debug(\"Failed to get node status: #{e}, continuing\")\n end\n end\n\n running\nend",
"def live_neighbor_count(cell, live_cells)\n (neighborhood(cell) & live_cells).count\nend",
"def track_wire(instructions)\n pt = [0,0]\n points = {}\n moves = 0\n instructions.each do |str|\n direction = str[0]\n steps = str.slice(/\\d+/).to_i\n while steps > 0 do\n moves += 1\n pt[0] += @compass[direction][0]\n pt[1] += @compass[direction][1]\n # add first crossing only (lowest steps wins)\n if !points.has_key? pt\n points[pt.dup] = moves\n end\n steps -= 1\n end\n # break if moves > 5000\n end\n points\nend",
"def wins_losses\n GAME_INFO.each do |game|\n @team_records.each do |team|\n if game[:home_team] == team.name && game[:home_score] > game[:away_score] #refactor later\n team.wins += 1\n elsif game[:home_team] == team.name && game[:home_score] < game[:away_score]\n team.losses += 1\n end\n end\n end\n\n GAME_INFO.each do |game|\n @team_records.each do |team|\n if game[:away_team] == team.name && game[:away_score] > game[:home_score] #refactor later\n team.wins += 1\n elsif game[:away_team] == team.name && game[:away_score] < game[:home_score]\n team.losses += 1\n end\n end\n end\n\n end",
"def tiles_remaining\n # still not sure why or how this is working. TODO: may take out later\n total_num_tiles = @default_set.inject(0) { |letter, letter_quantity| letter += letter_quantity[1] }\n p \"++++TEST++++\"\n p total_num_tiles\n return total_num_tiles\n end",
"def counters\n {\n files: files_count,\n apps: apps_count,\n workflows: workflows_count,\n jobs: jobs_count,\n members: members_count,\n }\n end",
"def workspace_unread_count\n unread = 0\n workspaces = WorkspaceLancer.or(\n { employer_username: self.username },\n { freelancer_username: self.username },\n { service_provider_username: self.username }\n )\n\n\n # Count each message as unread\n if workspaces.any?\n workspaces.each do |w|\n u = w.events.where(\n read: false,\n :member_id.ne => self.id\n ).count\n\n unread = unread + u\n end\n end\n\n return unread\n end",
"def count_stuff\n @members.each do |member|\n if member.active\n @active += 1\n if member.paymentstatus && member.membershipyear.to_i == Time.now.year.to_i\n @paidthisyear += 1\n end\n\n if !member.membergroup.onetimefee || member.membershipyear.to_i == Time.now.year.to_i\n @total += member.membergroup.fee\n end\n\n if @membergroups[member.membergroup.name.to_sym]\n @membergroups[member.membergroup.name.to_sym] = @membergroups[member.membergroup.name.to_sym] + 1\n else\n @membergroups[member.membergroup.name.to_sym] = 1\n end\n\n if @municipalities[member.municipality.to_sym]\n @municipalities[member.municipality.to_sym] = @municipalities[member.municipality.to_sym] + 1\n else\n @municipalities[member.municipality.to_sym] = 1\n end\n\n else\n @deleted += 1\n end\n\n end\n @municipalities = @municipalities.sort_by { |key, value| value }.reverse\n end",
"def net_weight(net)\n res = 0\n if net[\"use_vlan\"] then res += 1 end\n if net[\"use_bridge\"] then res += 1 end\n res\nend",
"def total_workouts\n set_sport_by_user.count || 0\n end",
"def additional_z\n return 0 if [:idle, :hurt, :covered].include?(battle_phase) \n return 1 if covering\n return 2\n # Active battler displayed above another (increment by 2)\n end",
"def timer_checkpoints\n t = self.time_remaining\n if @timer_checkpoint_hash[30] < 3 && t <= 40\n @timer_checkpoint_hash[30] += 1\n tab; \"#{@time_remaining} seconds left.\\n\".typing\n elsif @timer_checkpoint_hash[120] == 0 && t.between?(60, 140)\n @timer_checkpoint_hash[120] += 1\n tab; \"Cutting it close, #{codename}\".typing\n elsif @timer_checkpoint_hash[180] == 0 && t.between?(140, 180)\n @timer_checkpoint_hash[180] += 1\n tab; \"3 minutes. Finish the job.\\n\".typing\n elsif @timer_checkpoint_hash[240] == 0 && t.between?(200, 240)\n @timer_checkpoint_hash[240] += 1\n tab; \"Doing good. 4 minutes left.\\n\".typing\n end\n end",
"def cfp_weeks\n result = 0\n if call_for_papers\n result = call_for_papers.weeks\n end\n result\n end",
"def link_statistics(iface, net_counters)\n so = shell_out(\"ip -d -s link\")\n tmp_int = nil\n on_rx = true\n xdp_mode = nil\n so.stdout.lines do |line|\n if line =~ IPROUTE_INT_REGEX\n tmp_int = $2\n iface[tmp_int] ||= Mash.new\n net_counters[tmp_int] ||= Mash.new\n end\n\n if /^\\s+(ip6tnl|ipip)/.match?(line)\n iface[tmp_int][:tunnel_info] = {}\n words = line.split\n words.each_with_index do |word, index|\n case word\n when \"external\"\n iface[tmp_int][:tunnel_info][word] = true\n when \"any\", \"ipip6\", \"ip6ip6\"\n iface[tmp_int][:tunnel_info][:proto] = word\n when \"remote\",\n \"local\",\n \"encaplimit\",\n \"hoplimit\",\n \"tclass\",\n \"flowlabel\",\n \"addrgenmode\",\n \"numtxqueues\",\n \"numrxqueues\",\n \"gso_max_size\",\n \"gso_max_segs\"\n iface[tmp_int][:tunnel_info][word] = words[index + 1]\n end\n end\n end\n\n if line =~ /(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)/\n int = on_rx ? :rx : :tx\n net_counters[tmp_int][int] ||= Mash.new\n net_counters[tmp_int][int][:bytes] = $1\n net_counters[tmp_int][int][:packets] = $2\n net_counters[tmp_int][int][:errors] = $3\n net_counters[tmp_int][int][:drop] = $4\n if int == :rx\n net_counters[tmp_int][int][:overrun] = $5\n else\n net_counters[tmp_int][int][:carrier] = $5\n net_counters[tmp_int][int][:collisions] = $6\n end\n\n on_rx = !on_rx\n end\n\n if line =~ /qlen (\\d+)/\n net_counters[tmp_int][:tx] ||= Mash.new\n net_counters[tmp_int][:tx][:queuelen] = $1\n end\n\n if line =~ /vlan id (\\d+)/ || line =~ /vlan protocol ([\\w\\.]+) id (\\d+)/\n if $2\n tmp_prot = $1\n tmp_id = $2\n else\n tmp_id = $1\n end\n iface[tmp_int][:vlan] ||= Mash.new\n iface[tmp_int][:vlan][:id] = tmp_id\n iface[tmp_int][:vlan][:protocol] = tmp_prot if tmp_prot\n\n vlan_flags = line.scan(/(REORDER_HDR|GVRP|LOOSE_BINDING)/)\n if vlan_flags.length > 0\n iface[tmp_int][:vlan][:flags] = vlan_flags.flatten.uniq\n end\n end\n\n # https://rubular.com/r/JRp6lNANmpcLV5\n if line =~ /\\sstate (\\w+)/\n iface[tmp_int][\"state\"] = $1.downcase\n end\n\n if line.include?(\"xdp\")\n mode = line.scan(/\\s(xdp|xdpgeneric|xdpoffload|xdpmulti)\\s/).flatten[0]\n # Fetches and sets the mode from the first line.\n unless mode.nil?\n iface[tmp_int][:xdp] = {}\n if mode.eql?(\"xdp\")\n # In case of xdpdrv, mode is xdp,\n # to keep it consistent, keeping mode as xdpdrv.\n mode = \"xdpdrv\"\n end\n xdp_mode = mode\n iface[tmp_int][:xdp][:attached] = []\n end\n\n if line =~ %r{prog/(\\w+) id (\\d+) tag (\\w+)}\n mode = $1.eql?(\"xdp\") ? xdp_mode : $1\n iface[tmp_int][:xdp][:attached] << {\n mode: mode,\n id: $2,\n tag: $3,\n }\n end\n end\n end\n iface\n end",
"def total_weeks\n week_split.size\n end",
"def updateStats\n \n totalDays = 0\n\n @week.days.each do |day|\n if day.wr\n totalDays += 1\n updateTempValues(day.oTotal, day.dTotal)\n end\n end\n\n assignStats(totalDays)\n\n end",
"def static_ip_score; end",
"def lift_total \n @@all.map do |lift| \n lift.lift_total\n \n end\n end",
"def compute_check_counts\n \n self.new_design_self_check_count = 0\n self.new_design_peer_check_count = 0\n self.bareboard_design_self_check_count = 0\n self.bareboard_design_peer_check_count = 0\n \n self.each_check do |check|\n \n if check.new_design_check?\n self.new_design_self_check_count += 1 if check.is_self_check?\n self.new_design_peer_check_count += 1 if check.is_peer_check?\n end\n \n if check.bare_board_design_check?\n self.bareboard_design_self_check_count += 1 if check.is_self_check?\n self.bareboard_design_peer_check_count += 1 if check.is_peer_check?\n end\n \n end\n \n self.save\n \n end",
"def lift_total\n lifters.sum{|lifter| lifter.lift_total}\nend",
"def count_traps(x, y)\n total = 0\n total += 1 if within_boundaries?(x-1,y-1) && @board[x-1][y-1].value == \"O\"\n total += 1 if within_boundaries?(x-1,y) && @board[x-1][y].value == \"O\"\n total += 1 if within_boundaries?(x-1,y+1) && @board[x-1][y+1].value == \"O\"\n total += 1 if within_boundaries?(x,y+1) && @board[x][y+1].value == \"O\"\n total += 1 if within_boundaries?(x+1,y+1) && @board[x+1][y+1].value == \"O\"\n total += 1 if within_boundaries?(x+1,y) && @board[x+1][y].value == \"O\"\n total += 1 if within_boundaries?(x+1,y-1) && @board[x+1][y-1].value == \"O\"\n total += 1 if within_boundaries?(x,y-1) && @board[x][y-1].value == \"O\"\n total\n end",
"def availableWins(userId)\n return availableWinsByDivision(userId, nil, nil)\n end",
"def ip_statistics\n super\n end",
"def week_1_total\n total = 0\n rostered_players.each do |rostered_player|\n total += rostered_player.player.week_1_score\n end\n return total\n end",
"def calc_stats\n #puts \"bad_biz = #{@bad_business_records.length}\"\n #puts \"bad_user = #{@bad_user_records.length}\"\n #puts \"good_biz = #{@good_business_records.length}\"\n #puts \"good_user = #{@good_user_records.length}\"\n \n @total_rec_cnt = @bad_business_records.length + @bad_user_records.length +\n\t @good_business_records.length + @good_user_records.length\n @well_formed_rec_cnt = @good_business_records.length + @good_user_records.length\n @malformed_rec_cnt = @bad_business_records.length + @bad_user_records.length\n @biz_rec_cnt = @businesses.length\n @user_rec_cnt = @users.length\n end",
"def new_counter\n { current_load: 0, last_request_made_at: 0 }\n end",
"def fwd_count; @fwd_map.count; end",
"def get_progresses\n if @all_count > 0\n @progress_ch = 100 * @memorized_count_ch / @all_count\n @progress_ja = 100 * @memorized_count_ja / @all_count\n else\n @progress_ch = 0\n @progress_ja = 0\n end\n end",
"def monitor_poll_vm\n reset_monitor\n\n return unless @vm.get_vm_id\n\n @state = state_to_c(@vm['summary.runtime.powerState'])\n\n if @state != VM_STATE[:active]\n reset_monitor\n return\n end\n\n cpu_mhz = @vm['runtime.host.summary.hardware.cpuMhz'].to_f\n\n @monitor[:used_memory] = @vm['summary.quickStats.hostMemoryUsage'] *\n 1024\n\n used_cpu = @vm['summary.quickStats.overallCpuUsage'].to_f / cpu_mhz\n used_cpu = (used_cpu * 100).to_s\n @monitor[:used_cpu] = format('%.2f', used_cpu).to_s\n\n # Check for negative values\n @monitor[:used_memory] = 0 if @monitor[:used_memory].to_i < 0\n @monitor[:used_cpu] = 0 if @monitor[:used_cpu].to_i < 0\n\n guest_ip_addresses = []\n unless @vm['guest.net'].empty?\n @vm['guest.net'].each do |net|\n next unless net.ipConfig\n next if net.ipConfig.ipAddress.empty?\n\n net.ipConfig.ipAddress.each do |ip|\n guest_ip_addresses << ip.ipAddress\n end\n end\n end\n\n @guest_ip_addresses = guest_ip_addresses.join(',')\n\n pm = @vm['_connection'].serviceInstance.content.perfManager\n\n provider = pm.provider_summary(@vm.item)\n\n refresh_rate = provider.refreshRate\n\n stats = {}\n\n if @one_vm['MONITORING/LAST_MON'] &&\n @one_vm['MONITORING/LAST_MON'].to_i != 0\n # Real time data stores max 1 hour. 1 minute has 3 samples\n interval = (Time.now.to_i -\n @one_vm['MONITORING/LAST_MON'].to_i)\n\n # If last poll was more than hour ago get 3 minutes,\n # else calculate how many samples since last poll\n if interval > 3600\n samples = 9\n else\n samples = (interval / refresh_rate) + 1\n end\n samples > 0 ? max_samples = samples : max_samples = 1\n\n stats = pm.retrieve_stats(\n [@vm.item],\n ['net.transmitted', 'net.bytesRx', 'net.bytesTx',\n 'net.received', 'virtualDisk.numberReadAveraged',\n 'virtualDisk.numberWriteAveraged', 'virtualDisk.read',\n 'virtualDisk.write'],\n interval => refresh_rate, max_samples => max_samples\n ) rescue {}\n else\n # First poll, get at least latest 3 minutes = 9 samples\n stats = pm.retrieve_stats(\n [@vm.item],\n ['net.transmitted', 'net.bytesRx', 'net.bytesTx',\n 'net.received', 'virtualDisk.numberReadAveraged',\n 'virtualDisk.numberWriteAveraged', 'virtualDisk.read',\n 'virtualDisk.write'],\n interval => refresh_rate, max_samples => 9\n ) rescue {}\n end\n\n if !stats.empty? && !stats.first[1][:metrics].empty?\n metrics = stats.first[1][:metrics]\n\n nettx_kbpersec = 0\n if metrics['net.transmitted']\n metrics['net.transmitted'].each do |sample|\n nettx_kbpersec += sample if sample > 0\n end\n end\n\n netrx_kbpersec = 0\n if metrics['net.bytesRx']\n metrics['net.bytesRx'].each do |sample|\n netrx_kbpersec += sample if sample > 0\n end\n end\n\n read_kbpersec = 0\n if metrics['virtualDisk.read']\n metrics['virtualDisk.read'].each do |sample|\n read_kbpersec += sample if sample > 0\n end\n end\n\n read_iops = 0\n if metrics['virtualDisk.numberReadAveraged']\n metrics['virtualDisk.numberReadAveraged'].each do |sample|\n read_iops += sample if sample > 0\n end\n end\n\n write_kbpersec = 0\n if metrics['virtualDisk.write']\n metrics['virtualDisk.write'].each do |sample|\n write_kbpersec += sample if sample > 0\n end\n end\n\n write_iops = 0\n if metrics['virtualDisk.numberWriteAveraged']\n metrics['virtualDisk.numberWriteAveraged'].each do |sample|\n write_iops += sample if sample > 0\n end\n end\n\n else\n nettx_kbpersec = 0\n netrx_kbpersec = 0\n read_kbpersec = 0\n read_iops = 0\n write_kbpersec = 0\n write_iops = 0\n end\n\n # Accumulate values if present\n if @one_item && @one_item['MONITORING/NETTX']\n previous_nettx = @one_item['MONITORING/NETTX'].to_i\n else\n previous_nettx = 0\n end\n\n if @one_item && @one_item['MONITORING/NETRX']\n previous_netrx = @one_item['MONITORING/NETRX'].to_i\n else\n previous_netrx = 0\n end\n\n if @one_item && @one_item['MONITORING/DISKRDIOPS']\n previous_diskrdiops = @one_item['MONITORING/DISKRDIOPS'].to_i\n else\n previous_diskrdiops = 0\n end\n\n if @one_item && @one_item['MONITORING/DISKWRIOPS']\n previous_diskwriops = @one_item['MONITORING/DISKWRIOPS'].to_i\n else\n previous_diskwriops = 0\n end\n\n if @one_item && @one_item['MONITORING/DISKRDBYTES']\n previous_diskrdbytes = @one_item['MONITORING/DISKRDBYTES'].to_i\n else\n previous_diskrdbytes = 0\n end\n\n if @one_item && @one_item['MONITORING/DISKWRBYTES']\n previous_diskwrbytes = @one_item['MONITORING/DISKWRBYTES'].to_i\n else\n previous_diskwrbytes = 0\n end\n\n @monitor[:nettx] = previous_nettx +\n (nettx_kbpersec * 1024 * refresh_rate).to_i\n @monitor[:netrx] = previous_netrx +\n (netrx_kbpersec * 1024 * refresh_rate).to_i\n\n @monitor[:diskrdiops] = previous_diskrdiops + read_iops\n @monitor[:diskwriops] = previous_diskwriops + write_iops\n @monitor[:diskrdbytes] = previous_diskrdbytes +\n (read_kbpersec * 1024 * refresh_rate).to_i\n @monitor[:diskwrbytes] = previous_diskwrbytes +\n (write_kbpersec * 1024 * refresh_rate).to_i\n end",
"def index\n @workouts = Workout.where(user_id: current_user).order(\"created_at desc\").paginate(:page => params[:page], :per_page => 10)\n @workouts_all_length = Workout.where(user_id: current_user).sum(:workout_length)\n end",
"def calculate_timeline_week_count\n ((@course.timeline_end.to_date - @beginning_of_first_week).to_f / 7).ceil\n end",
"def count_electoral_college\n @swing_states.each do |row|\n @swing_votes += @polls[row[0]][0]\n end\n @clinton_states.each do |row|\n @clinton_votes += @polls[row[0]][0]\n end\n @trump_states.each do |row|\n @trump_votes += @polls[row[0]][0]\n end\n end",
"def collecting_areas\n @open_counts = Admin::DigitizationQueueItem.open_status.group(:collecting_area).count\n end",
"def monitor\n @summary = @vm.summary\n @state = state_to_c(@summary.runtime.powerState)\n\n if @state != 'a'\n @used_cpu = 0\n @used_memory = 0\n\n @net_rx = 0\n @net_tx = 0\n\n return\n end\n\n @used_memory = @summary.quickStats.hostMemoryUsage * 1024\n\n host = VIDriver::host\n cpuMhz = host.cpuMhz.to_f\n @used_cpu =\n ((@summary.quickStats.overallCpuUsage.to_f / cpuMhz) * 100).to_s\n @used_cpu = sprintf('%.2f',@used_cpu).to_s\n\n vm_stats = VIDriver::retrieve_stats([@vm],\n [\"net.packetsRx\",\"net.packetsTx\"])\n @net_rx = 0\n @net_tx = 0\n\n if vm_stats[@vm] && vm_stats[@vm][:metrics]\n if vm_stats[@vm][:metrics][\"net.packetsRx\"]\n @net_rx = vm_stats[@vm][:metrics][\"net.packetsRx\"].first\n end\n\n if vm_stats[@vm][:metrics][\"net.packetsTx\"]\n @net_tx = vm_stats[@vm][:metrics][\"net.packetsTx\"].first\n end\n end\n\n # Check for negative values\n @used_memory = 0 if @used_memory.to_i < 0\n @used_cpu = 0 if @used_cpu.to_i < 0\n @net_rx = 0 if @net_rx.to_i < 0\n @net_tx = 0 if @net_tx.to_i < 0\n end",
"def update_game_won_count(game_count, game_status)\n player_score = game_status[:player_hand]\n dealer_score = game_status[:dealer_hand]\n status = game_status[:current_game_status]\n\n if dealer_score > player_score && dealer_score <= MAX_HAND_VALUE\n game_count[:dealer_wins] += 1\n elsif status.include?('busted') && dealer_score <= MAX_HAND_VALUE\n game_count[:dealer_wins] += 1\n elsif player_score > dealer_score && player_score <= MAX_HAND_VALUE\n game_count[:player_wins] += 1\n elsif player_score <= MAX_HAND_VALUE && dealer_score > MAX_HAND_VALUE\n game_count[:player_wins] += 1\n end\nend",
"def show\n @yfcase = Yfcase.find(params[:id])\n # 地坪總面積 (平方公尺)\n @landtotalarea = @yfcase.lands.map{ |n| [n.land_area.to_f * (n.land_holding_point_personal.to_f / n.land_holding_point_all.to_f)] }.flatten.sum\n \n # 建坪\n \n if @yfcase.builds.where(\"build_type_use = ?\",\"0公設\").present?\n # 找到第一筆非公設(notPU)的個人持分(build_holding_point_personal)\n @[email protected](\"build_type_use = ?\",\"0公設\").first.build_holding_point_personal\n # 找到第一筆非公設(notPU)的個人持分(build_holding_point_all)\n @[email protected](\"build_type_use = ?\",\"0公設\").first.build_holding_point_all\n # 建坪總面積 (平方公尺)-有公設 (計算\"0公設\"的總面積)\n @withBuildTotalArea = @yfcase.builds.where(\"build_type_use = ?\",\"0公設\").map { |n| [n.build_area.to_f * ((n.build_holding_point_personal.to_f * @notPU_HP_personal.to_f) / (n.build_holding_point_all.to_f * @notPU_HP_all.to_f))] }.flatten.sum \n else\n @withBuildTotalArea = 0\n end\n \n if @yfcase.builds.where(\"build_type_use = ?\",\"12增建(持分後坪數打對折)\").count >0\n # 建坪總面積 (平方公尺)-有增建 (計算\"12增建(持分後坪數打對折)\"的總面積)\n @addBuildTotalArea = @yfcase.builds.where(\"build_type_use = ?\",\"12增建(持分後坪數打對折)\").map { |n| [n.build_area.to_f * ((n.build_holding_point_personal.to_f) / (n.build_holding_point_all.to_f))] }.flatten.sum * 0.5\n else\n @addBuildTotalArea = 0\n end\n \n if @yfcase.builds.where.not(\"build_type_use = ? OR build_type_use = ?\", \"0公設\",\"12增建(持分後坪數打對折)\").count > 0\n # 建坪總面積 (平方公尺)-無公設 (計算不含\"0公設\"及\"12增建(持分後坪數打對折)\"的總面積)\n @withoutBuildTotalArea = @yfcase.builds.where.not(\"build_type_use = ? OR build_type_use = ?\", \"0公設\",\"12增建(持分後坪數打對折)\").map { |n| [n.build_area.to_f * (n.build_holding_point_personal.to_f / n.build_holding_point_all.to_f)] }.flatten.sum \n else\n @withoutBuildTotalArea = 0\n end \n \n # 坪價(萬)\n @pingprice1 = @yfcase.floor_price_1.to_f / ((@withoutBuildTotalArea+@withBuildTotalArea+@addBuildTotalArea)*0.3025).to_f\n @pingprice2 = @yfcase.floor_price_2.to_f / ((@withoutBuildTotalArea+@withBuildTotalArea+@addBuildTotalArea)*0.3025).to_f\n @pingprice3 = @yfcase.floor_price_3.to_f / ((@withoutBuildTotalArea+@withBuildTotalArea+@addBuildTotalArea)*0.3025).to_f\n @pingprice4 = @yfcase.floor_price_4.to_f / ((@withoutBuildTotalArea+@withBuildTotalArea+@addBuildTotalArea)*0.3025).to_f\n\n # 時價(萬)\n\n marketpricecount = @yfcase.objectbuilds.count\n [email protected] { |n| [(testvalue(n.total_price.to_f / n.build_area.to_f ,n.plusa,n.plusb))] }.flatten\n @marketprice = marketpricesum.map!{|e| e.to_f}.sum.fdiv(marketpricesum.size)\n respond_to do |format|\n format.html\n format.json\n format.pdf {render template:'yfcases/deedtax', pdf: 'Deedtax'}\n end\n # respond_to do |format|\n # format.html\n # format.pdf do \n # pdf = YfcasePdf.new(@yfcase)\n # send_data pdf.render, \n # filename: \"yfcase_#{@yfcase.case_number}.pdf\",\n # type: \"application/pdf\",\n # disposition: \"inline\"\n # end\n # end \n end",
"def index\n @won_counts = WonCount.all\n end",
"def score\n self.tiles.inject(0){|sum,num| sum+=TileBag.points_for(num)}\n end",
"def totalLipidos\n\t\tlip = 0\n\t\ttotal = 0\n\t\[email protected] do |alimento|\n\t\t\tlip += alimento.lipidos\n\t\tend\n\t\treturn lip.round(2)\n\t\n\tend",
"def num_non_responsive\n @hops.find_all { |hop| !hop.ping_responsive }.size\n end",
"def calculate_calories_burned\n type = activity.activity_type\n user_weight = user.recent_most_weight.value\n user_weight = user_weight < 1 || user_weight.nil? ? 0 : user_weight\n # Our global intensity multipler\n intensity = 1 + (activity.intensity / 10)\n\n case type\n\n when 0 # Weight lifting\n self.calories = 0 and return true if work == 0\n # Calculate the joules expended\n joules = (self.work / 1000) * 9.81 * 0.75\n # Calories per rep\n per_rep = (joules * 0.000239006) * 5 # Times 5 here because 5 * 20 = 100; Muscles are roughly 20% efficient\n # Multiplier for heart rate elevation and work intensity. Default is 1.5\n # if we don't know their weight\n multiplier = user_weight == 0 ? 1.5 : 3.5 * (self.work / user_weight)\n # The full formula\n calories_burned = per_rep * reps * multiplier * intensity\n self.calories = calories_burned.round(2)\n\n when 1 # Timed things\n # Altering our intensity to work in the formula at\n # http://ask.metafilter.com/48652/Walking-formula\n intensity = intensity / 100\n intensity = intensity < 0.015 ? 0.015 : intensity\n # Convert user_weight to pounds from grams\n user_weight = user_weight * 0.00220462\n # Work here will be time in seconds\n self.calories = (intensity * user_weight * (work / 60)).round(2)\n\n when 2 # Distance\n # Credit: NET calories burned per miles as listed at\n # https://www.checkyourmath.com/convert/length/miles_mm.php\n #\n # Find our intensity. Basic running is .65, walking is .3, sprinting is\n # all the way at .8\n intensity = intensity - 1\n intensity = intensity < 0.2 ? 0.2 : intensity\n intensity = intensity > 0.8 ? 0.8 : intensity\n # Convert their weight to pounds\n user_weight = user_weight * 0.00220462\n # Convert the unit of work from mm to miles\n work_in_miles = self.work * 0.00000062\n # And finally\n self.calories = (intensity * user_weight * work_in_miles).round(2)\n\n when 3 # Repetitions\n # A VERY simple and dirty calculation here. Basically, any of these reps\n # are going to be bodyweight, ranging from ridiculously easy for even the\n # most out of shape people (like a simple crunch), to something difficult\n # for even professional athletes (dragon flags). So we'll have a baseline\n # of 1 calorie, and range up to 6 per repetition depending on the exercise's\n # intensity\n intensity = (activity.intensity / 2).round\n intensity = intensity < 1 ? 1 : intensity\n self.calories = intensity * self.reps\n else\n\n self.calories = 0\n end\n end",
"def total\n @total ||= (\n tally = 0\n each do |w|\n tally += w.count\n end\n tally\n )\n end",
"def update_project_stats\n self.critical_count = tasks.select { |t| t.critical? }.length\n self.normal_count = tasks.select { |t| t.normal? }.length\n self.low_count = tasks.select { |t| t.low? }.length\n self.open_tasks = nil\n self.total_tasks = nil\n end",
"def totalpp\n movedata = PBMoveData.new(@id)\n tpp = movedata.totalpp\n return tpp+(tpp*@ppup/5).floor\n end",
"def chip_total(chips)\n\t\tchips = chips.to_i\n\t\t# sum each value in total\n\t\t# return chips WON/lost\n\t\tchips_won_or_lost = chips.to_i\n\t\treturn chips_won_or_lost\n\tend",
"def total_water\r\n t = 0\r\n @positions.each_with_index do | p,index |\r\n\t t += p.water_content\r\n\t t += p.water_bank\r\n\tend\r\n\tt\r\n end",
"def gray_boomcity_tile_potential_count\n gray_boomcity_tile_count +\n [gray_double_boomcity_tile_count, @pending_gray_boom_tile_lays[:double_boom].size].min\n end"
] | [
"0.6004532",
"0.5483743",
"0.5440018",
"0.54042023",
"0.5348764",
"0.53287613",
"0.5327676",
"0.53036803",
"0.52771705",
"0.5273418",
"0.5257424",
"0.5248349",
"0.52202415",
"0.5163862",
"0.51202404",
"0.51176995",
"0.50591147",
"0.50305265",
"0.5018177",
"0.50074327",
"0.4999463",
"0.499231",
"0.49808338",
"0.494847",
"0.4933656",
"0.49250478",
"0.4915769",
"0.49144572",
"0.48842394",
"0.4873563",
"0.4870874",
"0.48697063",
"0.4863195",
"0.4861916",
"0.4828189",
"0.48222044",
"0.4818517",
"0.48077005",
"0.48067153",
"0.47881207",
"0.4778575",
"0.4778112",
"0.4775365",
"0.4760184",
"0.47439402",
"0.4740293",
"0.47270882",
"0.47258407",
"0.47239524",
"0.47172254",
"0.47105938",
"0.47082463",
"0.47048864",
"0.47048548",
"0.47028628",
"0.4700982",
"0.4700539",
"0.46957576",
"0.4693878",
"0.4689351",
"0.4688063",
"0.4686556",
"0.46820092",
"0.4681183",
"0.46755534",
"0.4674006",
"0.46730956",
"0.4669375",
"0.46689636",
"0.4661386",
"0.466113",
"0.4660887",
"0.4649508",
"0.46470535",
"0.4645744",
"0.46456832",
"0.46433374",
"0.46286258",
"0.4624038",
"0.46235514",
"0.46168396",
"0.46131283",
"0.46101302",
"0.45984524",
"0.45978522",
"0.45953247",
"0.45940277",
"0.45928714",
"0.45922628",
"0.4588571",
"0.45869485",
"0.4584769",
"0.45808446",
"0.45692185",
"0.45676675",
"0.45664248",
"0.45649785",
"0.45627046",
"0.45585737",
"0.4558405"
] | 0.6598777 | 0 |
Set the value of a property | def []=(prop, value)
@prototype.set(prop, value)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set(property, value)\n self.send(\"#{property}=\".to_sym, value)\n end",
"def set_property(key, value)\n end",
"def set_Property(value)\n set_input(\"Property\", value)\n end",
"def intersys_set(property, value)\n intersys_property(property).set(value)\n end",
"def assign_property(name, value); end",
"def set_property(property_name, value)\n command(\"set_property\", property_name, value)\n end",
"def property(name, value)\n @resource.set_property name, value\n end",
"def set_property(*args)\n return unless alive?\n\n command \"set_property\", *args\n end",
"def set_property(name, value)\n $NEO_LOGGER.debug{\"set property '#{name}'='#{value}'\"} \n old_value = get_property(name)\n\n if value.nil?\n remove_property(name)\n elsif self.class.marshal?(name)\n @internal_node.set_property(name, Marshal.dump(value).to_java_bytes)\n else\n @internal_node.set_property(name, value)\n end\n\n if (name != 'classname') # do not want events on internal properties\n event = PropertyChangedEvent.new(self, name.to_sym, old_value, value)\n self.class.fire_event(event)\n end\n end",
"def set_property(ctx,object,propertyName,value,attributes,exception)\n JS::Lib.JSObjectSetProperty(ctx,object,propertyName,value,attributes,exception)\n end",
"def set_property(name, value)\n @properties[name] = value\n end",
"def set_property(property_name, value)\n object = get()\n object[property_name] = value\n set(object)\n end",
"def []=(property, value); end",
"def []=(prop)\n set_property(prop)\n end",
"def []=(property, value)\n root[property] = value\n end",
"def set_property!(property_name, value)\n set_property(property_name, value).data!\n end",
"def set_property( name, value )\n ( @properties ||= Hash.new )[ name ] = value\n end",
"def set_property(key, value)\n @data[key] = value\n end",
"def []=(property_name, value)\n properties[property_name.to_s].value = value\n end",
"def setting(property, value)\n\t\tproperty + ':' + value + ';'\n\tend",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property(propertyName,value,attributes = nil,exception = nil)\n propertyName = JS::String.create_with_utf8cstring(propertyName)\n value = JS::Value.from_ruby(context,value)\n res = super(context,self,propertyName,value,attributes,exception)\n return res\n end",
"def set_property\n @property = Property.find_by(id: params[:id])\n end",
"def set_ant_property(key, value)\n instance_eval(\"@%s = '%s'\" % [ key.to_s, value.to_s ])\n end",
"def set live_property, *data\n #puts \"set #{live_property} = #{data.inspect}\"\n attribute, variable = attribute_for live_property\n value = data.first\n\n # We rely on get() initializing an instance variable to determine\n # if we're actually setting a property or just handling the results of a call()\n if instance_variables.include? variable.to_sym\n instance_variable_set variable, value\n end\n\n if attribute == :live_id and not exists?\n @object_not_found_callback.call(@object_path) if @object_not_found_callback\n else\n callback = @callbacks[attribute]\n callback.call(*data) if callback\n end\n end",
"def []=(property, value)\n if self.class.translation_exists? property\n send(\"#{property}=\", value)\n elsif self.class.transformation_exists? property\n super property, self.class.transformed_property(property, value)\n elsif property_exists? property\n super\n end\n end",
"def []=(property, value)\n if self.class.translations.include? property.to_sym\n send(\"#{property}=\", value)\n elsif property_exists? property\n super\n end\n end",
"def set_property(key, value)\n p=property(key)\n unless p\n p=characteristic_properties.build(:kee => key)\n end\n if (value.is_a?(Fixnum) || value.is_a?(Float))\n p.value=value.to_f\n else\n p.text_value=value.to_s\n end\n p\n end",
"def set_property(name, data)\n ensure_valid\n prop = self.class.properties[name]\n raise \"No such property #{name}\" if not prop\n property_cache[name] = prop.set(@model, @path, data)\n end",
"def set_property\n @property = current_client.properties.find(params[:id])\n end",
"def set_raw_property_value(name, value)\n @property_values[name] = value\n end",
"def set_property(kid, v)\n if @property_description && desc = @property_description[kid]\n if desc.accessible? v\n self[desc.name] = v\n elsif desc.convertable? v\n self[desc.name] = desc.convert v\n else\n raise ArgumentError.new \"#{kid} should be #{desc.type}.\"\n end\n else\n self[kid] = v\n end\n end",
"def value=(should)\n @property_hash[:value] = should\n end",
"def set_property( propname, value )\n params = { 'value' => value }\n resp = conn.put('/users/'+name+'/props/'+propname+'/', params)\n \n case resp.code.to_i\n when 200\n return JSON.parse( resp.body )\n when 201\n return\n when 404\n raise RestAuthResourceNotFound.new( resp )\n else\n raise RestAuthUnknownStatus.new( resp )\n end\n end",
"def set_property\n @property = Property.friendly.find(params[:id])\n end",
"def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"def set_property\n @property = Property.all\n end",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property\n @property = Property.find(params[:id])\n end",
"def set_property_value(name, value)\n property = get_property(name)\n \n # Throw error if property doesn't exist\n if property.nil?\n raise StandardError.new(\"Property does not exist: #{name}\")\n end\n\n # Throw error if property is not valid\n if !property.valid_input?(self, value)\n raise StandardError.new(\"Invalid #{property.type} value for '#{name}': '#{value}'\")\n end\n\n # Set the property value\n property.set_value(self, value)\n end",
"def set_attribute_property(id, attribute, property, value)\n\t\to = getObject(id)\n\t\tif (o != nil && o.respond_to?(:[]))\n\t\t\tif (o[attribute] != nil)\n\t\t\t\tif (o[attribute].include?(property))\n\t\t\t\t\to[attribute] = o[attribute].gsub(/#{property}\\:.*(\\;|$)/, setting(property, value))\n\t\t\t\telse\n\t\t\t\t\ts = o[attribute]\n\t\t\t\t\tif (s[-1, 1] != ';') \n\t\t\t\t\t\ts += ';'\n\t\t\t\t\tend\n\t\t\t\t\to[attribute] = s + setting(property, value)\n\t\t\t\tend\n\t\t\telse\n\t\t\t\to[attribute] = setting(property, value)\n\t\t\tend\n\t\telse\n\t\t\tputs \"Could not find object with id = #{id}\"\n\t\tend\n\tend",
"def set(object, value); end",
"def set_property(name, value)\n # let Resource handle DAV properties\n if name[:ns_href] == DAV_NAMESPACE\n super\n else\n set_custom_props name, value\n end\n end",
"def []=(key, value)\n validate_property!(value)\n\n set_property(key, value)\n end",
"def attribute_set(name, value)\n properties[name].set(self, value)\n end",
"def set_property(property_name, property_value, secret)\n if !valid_secret?(secret)\n return BAD_SECRET_MSG\n end\n\n Djinn.log_info(\"Attempting to set @#{property_name} to #{property_value}\")\n\n name_with_at_sign = \"@#{property_name}\"\n begin\n instance_variable_set(name_with_at_sign, property_value)\n rescue NameError\n Djinn.log_info(\"Failed to set @#{property_name}\")\n return KEY_NOT_FOUND\n end\n\n Djinn.log_info(\"Successfully set @#{property_name} to #{property_value}\")\n return 'OK'\n end",
"def property(key, value)\n @properties_from_attributes[key.to_sym] = value\n end",
"def set_property\n @property = current_store.properties.find(params[:id])\n end",
"def create_localised_property_setter(property)\n property_name = property.name\n class_eval <<-EOS\n def #{property_name}=(value)\n write_localised_attribute('#{property_name}', value)\n end\n EOS\n end",
"def set(resource, value)\n value = set_value(resource, input_to_stored_value(resource, value))\n\n if options.key?(:deprecated)\n Chef.deprecated(:property, options[:deprecated])\n end\n\n if value.nil? && required?(resource_action(resource))\n raise Chef::Exceptions::ValidationFailed, \"#{name} is a required property\"\n else\n value\n end\n end",
"def set_property(key, value)\n new_repr = Representation.new(repr.href,\n repr.properties.merge(key => value),\n repr.all_links,\n repr.hal_client)\n\n self.class.new(new_repr, orig_repr)\n end",
"def []=(key, value)\n k = key.to_s\n old_value = self[key]\n\n if value.nil?\n delete_property(k)\n elsif @_wrapper and @_wrapper.class.marshal?(key)\n setProperty(k, Marshal.dump(value).to_java_bytes)\n else\n value = java.lang.Double.new(value) if value.is_a? Float\n setProperty(k, value)\n end\n\n if (@_wrapper and k[0, 1] != '_') # do not want events on internal properties\n @_wrapper.class.indexer.on_property_changed(@_wrapper, k) if @_wrapper.class.respond_to? :indexer\n Neo4j.event_handler.property_changed(@_wrapper, k, old_value, value)\n end\n\n end",
"def set k,v=nil,&b\n\t if !v and b\n\t v = b\n\t end\n\t JS::Object.get(\"Ruby.JsObj.set_property\").call(@object,k,v)\n\t end",
"def []=(key, val)\n @properties[key] = val\n end",
"def []=(key, value)\n @properties[key] = value\n end",
"def []=(key, value)\n @properties[key] = value\n end",
"def []=(term_or_property, value)\n self[term_or_property].set(value)\n end",
"def set(value)\n value\n end",
"def set_property(name, value)\n Config::Collection.set(name, value)\n end",
"def property_set sym, val\n oldvalue = instance_variable_get \"@#{sym}\"\n tmp = val.size == 1 ? val[0] : val\n newvalue = tmp\n if oldvalue.nil? || @_object_created.nil?\n #@#{sym} = tmp\n instance_variable_set \"@#{sym}\", tmp\n end\n return(self) if oldvalue.nil? || @_object_created.nil?\n\n if oldvalue != newvalue\n # trying to reduce calls to fire, when object is being created\n begin\n @property_changed = true\n fire_property_change(\"#{sym}\", oldvalue, newvalue) if !oldvalue.nil?\n #@#{sym} = tmp\n instance_variable_set \"@#{sym}\", tmp\n #@config[\"#{sym}\"]=@#{sym}\n rescue PropertyVetoException\n $log.warn \"PropertyVetoException for #{sym}:\" + oldvalue.to_s + \"-> \"+ newvalue.to_s\n end\n end # if old\n self\n end",
"def []=(k, v)\n @property[k.to_s] = v\n end",
"def set_value(owner, value)\n if value.nil?\n raw_value = nil\n else\n raw_value = case type\n when 'string' then value.to_s\n when 'integer' then value.to_i\n when 'decimal' then value.to_f\n when 'length' then value.to_i\n when 'color' then value[1..-1].to_i(16)\n when 'percent' then value.to_f/100\n end\n end\n\n owner.set_raw_property_value(name, raw_value)\n end",
"def set_value(owner, value)\n values = value.to_s.split(/ +/)\n \n @properties.each_index do |index|\n break if index > values.length-1\n subproperties = @properties[index]\n\n subproperties.each do |subproperty|\n owner.set_property_value(subproperty, values[index])\n end\n end\n end",
"def prop(name, value, recurse = false)\n @ctx.propset(name, SvnFixture.svn_prop(value), @clean_path, recurse)\n end",
"def create_property_setter(property)\n property_name = property.name\n class_eval <<-EOS\n def #{property_name}=(value)\n self['#{property_name}'] = value\n cast_property_by_name('#{property_name}')\n end\n EOS\n\n if property.alias\n class_eval <<-EOS\n alias #{property.alias.to_sym}= #{property_name.to_sym}=\n EOS\n end\n end",
"def property(key, value)\n if @current_attribute.properties.key?(key.to_sym)\n raise \"attribute #{key} already defined\"\n end\n state_depth_must_be(States::ATTRIBUTE)\n @current_attribute.properties[key.to_sym] = value\n end",
"def relationship_set_property id, name, value\n headers = {\n 'Accept' => 'application/json; charset=UTF-8',\n }\n\n put_request 'relationship/' + id + '/properties/' + name, value, headers\n end",
"def set_value( value )\n @value = value \n end",
"def set!(path, value)\n setProperty path, value\n save if respond_to? :save # Only Configuration can save\n value\n end",
"def set_property_at_index(propertyIndex,value,exception = nil)\n value = JS::Value.from_ruby(context,value)\n res = super(context,self,propertyIndex,value,exception)\n return res\n end",
"def set_property(tokens, value)\n property_owner_token = tokens.shift\n\n property_owner = get_property_owner property_owner_token\n\n validate_type [String, SdArray], property_owner\n\n case property_owner\n when String then set_string_property property_owner, tokens.shift, value\n when SdArray then set_array_property property_owner, tokens.shift, value\n end\n\n if property_owner_token.sub_type == Token::VAR_ARE\n @are = property_owner\n elsif property_owner_token.sub_type == Token::VARIABLE\n @current_scope.set_variable property_owner_token.content, property_owner\n end\n end",
"def value=(value)\n @object.instance_variable_set(:\"@#{@name}\",coerce(value))\n end",
"def set(value)\n @value = value\n #info(@name, ' = ', value.inspect, '(type:', value.class,')')\n info(\"#{@name} = #{value.inspect} (#{value.class})\")\n @changeListeners.each { |l|\n l.call(value)\n }\n TraceState.property(@name, :set, {'value' => value.inspect})\n end",
"def set(value)\n @value = value\n #info(@name, ' = ', value.inspect, '(type:', value.class,')')\n info('value = ', value.inspect, ' (',value.class,')')\n @changeListeners.each { |l|\n l.call(value)\n }\n TraceState.property(@name, :set, {'value' => value.inspect})\n end"
] | [
"0.82450175",
"0.8231292",
"0.80921656",
"0.80406284",
"0.7989122",
"0.7975242",
"0.78739625",
"0.78630817",
"0.77419573",
"0.77218795",
"0.7704562",
"0.7686469",
"0.7630605",
"0.7624287",
"0.7615933",
"0.7607973",
"0.74367213",
"0.7417343",
"0.7409318",
"0.74092907",
"0.73819125",
"0.73819125",
"0.73819125",
"0.73819125",
"0.73819125",
"0.73819125",
"0.73819125",
"0.73819125",
"0.73819125",
"0.73819125",
"0.73819125",
"0.73819125",
"0.73819125",
"0.73819125",
"0.73819125",
"0.73819125",
"0.73819125",
"0.73819125",
"0.73819125",
"0.73819125",
"0.73819125",
"0.73819125",
"0.73819125",
"0.73819125",
"0.73819125",
"0.7374605",
"0.735971",
"0.7339004",
"0.7329935",
"0.7276069",
"0.7271851",
"0.7268294",
"0.7211282",
"0.72098285",
"0.7188093",
"0.7177395",
"0.7169524",
"0.7166021",
"0.712628",
"0.7116439",
"0.7115554",
"0.7101741",
"0.7101741",
"0.7101741",
"0.7101741",
"0.7085395",
"0.70743656",
"0.7048501",
"0.7047412",
"0.704226",
"0.70305693",
"0.70262307",
"0.6974042",
"0.6970658",
"0.6943056",
"0.69402504",
"0.6937964",
"0.69360095",
"0.68974036",
"0.6893785",
"0.6873191",
"0.6873191",
"0.684066",
"0.6824227",
"0.68086165",
"0.68053323",
"0.6803517",
"0.678411",
"0.6778376",
"0.6770448",
"0.676582",
"0.675395",
"0.6748671",
"0.6742268",
"0.67216915",
"0.6718374",
"0.6717544",
"0.6715082",
"0.66818964",
"0.66434044"
] | 0.7312588 | 49 |
Data description for Dymo model M25 => [0] Unknown 3 => [1] Stability (2 when at 0, 3 when getting stable, 4 when stable, 5 when negative, 6 when too much weight) => [2] Mode (lbs = 11, kg = 2) => [3] Scale factor => [45] 16 bit weight | def initialize(raw_data)
raise Scale::Error, "Invalid data" unless raw_data.size == 6
self.raw_stability = raw_data[1]
self.raw_mode = raw_data[2]
self.raw_scale_factor = raw_data[3]
self.raw_weight = (raw_data[5] << 8 | (raw_data[4] & 0xFF)) * 1.0
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def modeler_description\n return \"This measure will demonstrate how EMS functions can be used to demonstrate how information from a sizing run can be used to select HVAC equipment from nominal product sizes where unit total capacity is directly related to the unit supply airflow (1 ton = 1200 cfm, 1.5 ton = 1600 cfm, etc.) of commercial packaged single-zone HVAC air systems. This measure is designed to work on AirLoops with packaged DX cooling equipment only. EMS functions will be used to extract the design supply airflow generated from system auto-sizing calculations. An interval variable is used to override the Sizing:System - 'Intermediate Air System Main Supply Volume Flow Rate' value variable. This measure approximates the manner that appropriate ‘real world’ equipment selections are made by HVAC design engineers. The table below will be used to map to the Maximum Flow rate of the packaged unit Fan:ConstantVolume object.\"\n end",
"def modeler_description\n return \"Assume that the starting point technology is primarily 90.1-2013 T8 lighting, with an efficacy of 90 lm/W. According to Table 5.2, LED Efficacy Improvement, in (1), 2015 LED luminaire efficacy is 145 lm/W. Calculate the total lighting power of the model and divide by this initial efficacy to determine the total number of lumens needed. Assuming that this same number of lumens should be provided by LED lighting, divide by the LED efficacy to determine the total wattage of LEDs that would be necessary to achieve the same lighting. Reduce the overall building lighting power by the resulting multiplier. IE new LPD = old LPD * (1 - 90 lm/W /145 lm/W). This is a very crude estimate of the impact of current LED technology. In order to perform a more nuanced analysis, lighting in the prototype buildings should be broken down by use type (general space lighting, task lighting, etc.) and by currently assumed technology (T12, T8, metal halide, etc.). If this breakdown were available, each type of lighting could be modified according to its own efficacy characteristics. Additionally, this measure does not account for the impact of LEDs on outdoor lighting.\"\n end",
"def modeler_description\n 'This measure changes the Layer 0 properties of Thickness, Density, Thermal Absorptance, Solar Absorptance, Visible Absoptance, Thermal Conductivity, Specific Heat.'\n end",
"def modeler_description\r\n return \"For each model, find every DX cooling and heating coil and increase the COP to 6. Since very little information about this technology is available, do not change performance curves or upper/lower operating temperature limits.\"\r\n end",
"def modeler_description\n return 'For each model, find every DX cooling and heating coil and increase the COP to 6. Since very little information about this technology is available, do not change performance curves or upper/lower operating temperature limits.'\n end",
"def modeler_description\n 'For the most part consumption data comes from the tabular EnergyPlus results, however there are a few requests added for time series results. Space type and loop details come from the OpenStudio model. The code for this is modular, making it easy to use as a template for your own custom reports. The structure of the report uses bootstrap, and the graphs use dimple js.'\n end",
"def modeler_description\n return \"This measure will demonstrate how an OpenStudio measure calling EMS functions can be used to model the performance of HVAC equipment that cannot be represented well by using single “standard” performance curve objects (cubic, quadratic, biquadratic, etc.) For example, properly characterizing some HVAC equipment objects requires using different performance curves that cover operation of different parts of the performance regime. This measure will alter (overwrite) the Coil Cooling DX Single Speed Cooling Capacity as a function of temperature performance curve object and attributes used by the simulation if the outdoor air temperature falls below a user defined threshold. This measure allows the user to define the biquadratic curve coefficients associated with the Coil Cooling DX Single Speed Cooling Capacity.\"\n end",
"def modeler_description\r\n return \"E+ measure to popolate the Kiva settings values\"\r\n end",
"def modeler_description\r\n return \"This measure imports 8760 chilled water and hot water demand profiles for use in the LoadProfilePlant. The source is a csv file with seven columns titles: timestep, chw_supply_temp_f, chw_flow_frac, chw_load_w, hw_supply_temp_f, hw_flow_frac, hw_load_w.\"\r\n end",
"def modeler_description\n return \"Each DX cooling coil in the model is replaced by a membrane heat pump. To represent the membrane heat pump, the DX cooling coil COP is increased to 7.62 (26 EER). Additionally, add a water use equipment object to account for the 3 gallons of water used per ton*hr of sensible cooling process.\"\n end",
"def modeler_description\n return \"A measure that will take Annual Building Utilty Performance tables, Demand End use Components summary table, Source Energy End Use Components Summary and produce an output Json\"\n end",
"def modeler_description\n return 'This energy efficiency measure (EEM) replaces all cooling tower objects in a model of the following types: (OS:CoolingTowerPerformanceCoolTools, OS:CoolingTowerPerformanceYorkCalc, OS:CoolingTowerSingleSpeed, OS:CoolingTowerTwoSpeed, or OS:CoolingTowerVariableSpeed) with a new OS:CoolingTower:VariableSpeed object. If an existing cooling tower is already configured for variable speed, the measure will inform the user. When replacing an existing tower object, the following values from the existing tower configuration will be reused: Design Inlet Air Wet Bulb Temp, Design Approach Temperature, Design Range Temperature, Design Water Flow Rate, Design Air Flow Rate, Design Fan Power, Fraction of Tower Capacity in the Free Convection Regime, Basin Heater Capacity, Basin Heater Setpoint Temperature, Basin Heater Operating Schedule, Number of Cells, Cell Control, Cell Minimum and Maximum Water Flow Rate Fractions and Sizing Factor. A performance curve relating fan power to tower airflow rates is used. The curve assumes the fan power ratio is directly proportional to the air flow rate ratio cubed. A Minimum Air Flow Rate Ratio of 20% will be set. To model minimal but realistic water consumption, the Evaporation Loss Mode for new Tower objects will be set to ?Saturated Exit? and Drift Loss Percent will be set to a value of 0.05% of the Design Water Flow. Blowdown water usage will be based on maintaining a Concentration Ratio of 3.0.'\n end",
"def modeler_description\n return \"The measure loops through the heating and cooling thermostat schedules associated each thermal zone. The existing heating and cooling schedules are cloned, and the all run period profiles are then modified by adding a +1.5 deg F shift to the all values of the cooling thermostat schedule and a -1.5 degree F shift to all values of the heating thermostat schedule. Design Day profiles are not modified. The modified thermostat schedules are then assigned to the thermal zone. For each Thermal Zone, ASHRAE 55 Thermal Comfort Warnings is also enabled. Zone Thermal Comfort ASHRAE 55 Adaptive Model 90% Acceptability Status output variables is also added to the model.\"\n end",
"def modeler_description\n return \"This EEM adds EMS logic to the model that actuates the condenser loop setpoint manager. The added logic first checks the outdoor air wet-bulb temperature (OAWBT). If OAWBT is between 14.3C and 22.7C then the condenser loop setpoint temperature is set to OAWBT + 4C. If the OAWBT is above 22.7C, the condenser loop setpoint temperature is set to 26.7C. If the OAWBT is below 14.3C, the condenser loop setpoint temperature is set to 18.3C.\"\n end",
"def modeler_description\n return 'This measure receives the power density level from the user. Then it looks for refrigerated display cases; it loops through them; it checks the current power density of each case and it substitute it with the level chosen by the user.'\n end",
"def modeler_description\n return \"This measure will replicate the functionality described in the EnergyPlus Energy Management System Application Guide, Example 2., based on user input.\"\n end",
"def modeler_description\n return 'This measure uses 4 loops to model the waste water heat pump. The WW-Water Connections loop records the waste water temperature and flow rate with EMS controls. The Waste Water Heat Pump loop models the flow from the tank to the heat pump. The Service Preheat Water loop heats up the water to a target supply temperature. The Service Hot Water Loop connects to water use objects.'\n end",
"def modeler_description\n return \"This measure will demonstrate how an OpenStudio measure calling EMS functions can be used to override specified thermostat control logic and set alternate modes of operation. This EMS measure sets a specific (user defined) indoor VRF terminal unit to operate at a specific (user-defined) part load ratio, constrained by operate minimum and maximum outdoor temperature limits of the paired condenser unit. The main input objects that implement this example are the variable refrigerant flow actuators that control the VRF system and specific terminal unit. Note that the terminal unit PLR can be controlled without controlling the mode of the VRF condenser, however, the specific terminal unit will operate in whatever mode the existing operation control scheme chooses. This example program simply “sets” the operating mode and PLR, other more complex control algorithms can be developed by the user as needed\"\n end",
"def modeler_description\n return 'Calculate thermal capacitance and UA for surfaces, furniture, and spaces.'\n end",
"def modeler_description\n return \"This measure will demonstrate how common warnings generated in .err files can be ‘trapped’ and eliminated by applying conditional logic in an OpenStudio EMS program. In this case, the warning we want to eliminate relates to improper cooling tower operation, and the warning states that the tower temperature is operating below a low temperature limit. The measure will use an EMS program that checks to see if the outdoor temperature is below the allowable temperature for a cooing tower to operate. If this is true, the operation of the plant loop belonging to the cooling tower will be disabled. To properly disable the plant loop, both the loop equipment flow control objects (the condenser pump) and the parent loop itself will be disabled. The loop pump will be disabled by setting an EMS Actuator variable representing the pump mass flow rate to a value of zero. The plant loop object will be disabled by setting the On/Off supervisory control to a value of Off.\"\n end",
"def modeler_description\n return \"This measure adds active or passive chilled beam units to selected conditioned thermal zones. In addition the user can select an existing air loop to serve active beams, or create a new Dual Wheel DOAS. Users can also select an existing chilled water loop to provide chilled water to beams, or create a new high temperature chiller water loop. Users are highly encouraged to review and modify the control strategies that this measure creates, such that it reflects their modeling scenario of interest.\"\n end",
"def modeler_description\n return \"This measure loops through space types in the model and adjusts the lighting power per area (W/ft2) or lighting power per person (W/person) for affected space types. The measure is not currently able to change the lighting power is specified using the Lighting Level (W) input option.\"\n end",
"def modeler_description\n return 'HVAC system creation logic uses [openstudio-standards](https://github.com/NREL/openstudio-standards) and efficiency values are defined in the openstudio-standards Standards spreadsheet under the *NREL ZNE Ready 2017* template.'\n end",
"def modeler_description\n return 'This measure has optional arguments to apply recommendations from different sections of the Zero Energy Multifamily Design Guide.'\n end",
"def modeler_description\n return \"This measure loops through output_variables, EMS:output_variables and ExternalInterface objects and will create the variables.cfg xml file for BCVTB.\n Those variables need to be in cfg file, being used for data exchange.\"\n end",
"def modeler_description\n return \"This measure will demonstrate how an OpenStudio measure calling EMS functions can be used to investigate dynamic envelope technologies such as emulating thermochromic window performance using EMS actuators and control types. This measure will replace the construction description of a user-selected window based on the outside surface temperature of that window, evaluated at each timestep\"\n end",
"def modeler_description\n return 'This method calculates the annualized coefficient of performance (Btu out / Btu in) of equipment in the model from the annual simulation. This is used in Scout as the equipment efficiency for the technology competition categories.'\n end",
"def modeler_description\n return \"Reads the Boiler Nominal Capacity from an EnergyPlus .eio file and hardsizes the Nominal Capacity of the Boiler to this value.\"\n end",
"def modeler_description\n return \"This EEM adds EMS logic to the model for each AirLoopHVAC:Unitary:HeatPump:AirToAir or CoilCoolingDXSingleSpeed objects found. The added logic first defines fan speed modifier values based on the unit mode (0.9 for heating, 0.9 for cooling, 0.75 for economizing, 0.4 for ventilation) and a fan power exponent (2.2). The code then checks the heating and cooling runtime fractions and the outdoor air (OA) mass flow rate at each time step. The runtime fractions and OA mass flow rate values are used to determine the percentage of the time step that the unit spends in each mode (heating, cooling, economizing, or ventilation). The mode percentages are then used with the fan speed modifiers and fan power exponent value to calculate a weighted average fan pressure rise for the entire time step. Note that this will affect the fan power for the time step, but does not change the fan flow rate and thus will not affect zone thermal or comfort performance. The measure is run using the BeginTimestepBeforePredictor calling point. As such, fan pressure rise lags changes in the cooling and heating runtime fractions by a time step. Changing the calling point was observed to affect the energy savings associated with this measure (up to 0.5% of total building energy use), but did not remedy the lag issue.\"\n end",
"def modeler_description\n return \"OS Version of HVACTemplate:System:PackagedVAV. Input values in this measure will generate Packaged VAV system. Another template measure HVACTemplate:Zone:VAV, or HVACTemplate:Zone:VAV:FanPowered, or HVACTemplate:Zone:VAV:HeatAndCool should be applied after applying this measure. \"\n end",
"def modeler_description\n return \"Multipliers for LPD, EPD, and people densities.\"\n end",
"def modeler_description\n return \"This measure takes the user selected standards space type and sets the interior lighting and equipment load definitions subcategory to match the space type name. \"\n end",
"def modeler_description\n return \"At each simulation time step, check the damper position for each VAV terminal on the airloop. Reset the fan pressure rise to the max damper position divided by 0.95, down to a minimum of 50% of the design pressure rise.\"\n end",
"def modeler_description\n return \"Grey water tank overflow will be dirrected to drainage. \"\n end",
"def modeler_description\n return 'This measure loops through the thermal zones in all air loops. It then selects the thermal zone area and then calculates the minimum flow rate of 0.4 cfm/sf. If the zone has an AirTerminalSingleDuct VAVReheat & AirTerminalSingleDuctVAVNoReheat terminal unit the measure changes the zone minimum air flow method to fixed flow rate and applies the calculated minimum flow rate.'\n end",
"def modeler_description\n return ['Adds', 'the', 'properties', 'for', 'the', 'MoisturePenetrationDepthConductionTransferFunction', 'or', 'effective', 'moisture', 'penetration', 'depth', '(EMPD)', 'Heat', 'Balance', 'Model', 'with', 'inputs', 'for', 'penetration', 'depths.', \"\\n\\n\", 'Leaving', 'Change', 'heat', 'balance', 'algorithm?', 'blank', 'will', 'use', 'the', 'current', 'OpenStudio', 'heat', 'balance', 'algorithm', 'setting.', \"\\n\\n\", 'At', 'least', '1', 'interior', 'material', 'needs', 'to', 'have', 'moisture', 'penetration', 'depth', 'properties', 'set', 'to', 'use', 'the', 'EMPD', 'heat', 'balance', 'algorithm.'].join(' ')\n end",
"def modeler_description\n return 'Find the exterior lighting template for the building, and assume the existing efficiency level in the model (low, medium, high). Find the desing level and multiplier for each category of the exterior lighting definition. Apply the lighting upgrades by reducing the design level associated with each outdoor lighting category by a percent (depends on starting and target efficiency levels).'\n end",
"def modeler_description\n return \"The default space types in the measure inputs are automatically filled by the spaces' standard space types. User can overwrite the default assumptions in the library.csv file in the measure's resources folder.\"\n end",
"def modeler_description\n return \"Change water heater efficiency and fuel type.\"\n end",
"def modeler_description\n return 'This measure is used to calibrate the BRICR baseline model.'\n end",
"def modeler_description\n return \"Calculates and assigns material layer properties of wood stud constructions for 1) above-grade walls between finished space and outside, and 2) above-grade walls between attics under insulated roofs and outside. If the walls have an existing construction, the layers (other than exterior finish, wall sheathing, and wall mass) are replaced. This measure is intended to be used in conjunction with Exterior Finish, Wall Sheathing, and Exterior Wall Mass measures.\"\n end",
"def modeler_description\n return \"Calculates and assigns material layer properties of wood stud constructions for 1) above-grade walls between finished space and outside, and 2) above-grade walls between attics under insulated roofs and outside. If the walls have an existing construction, the layers (other than exterior finish, wall sheathing, and wall mass) are replaced. This measure is intended to be used in conjunction with Exterior Finish, Wall Sheathing, and Exterior Wall Mass measures.\"\n end",
"def modeler_description\n return \"For each light in the model, reduce the lighting fraction by the user specified amount. The default reduction of 15% comes from ASHRAE 90.1-2010 Table G3.2, as wireless occupancy sensors should be able to control groups of lights at a more granular level, as opposed to the standard 10% reduction for large, open spaces.\"\n end",
"def modeler_description\n return 'This measure receives the fan motor level from the user. Then it looks for refrigerated walk-ins; it loops through them; it checks the current fan power of each walk-in and it substitutes it with the level chosen by the user.'\n end",
"def modeler_description\n return 'This measure swaps old cases with 2017 code compliant cases and more efficient ones.'\n end",
"def modeler_description\n return 'shift or/and adjust heaing and cooling setpoint'\n end",
"def convert_model!\n tag! \"models\" do\n out! \"<!-- this is very poorly decoded part -->\"\n out_ofs! \"model\"\n convert_s!\n if @version == 74\n header_size = 37\n elsif @version == 84 or @version == 85 or @version == 86\n header_size = 50\n else\n header_size = 74\n end\n exp_header_size = @data[@ofs,1000].index(\"Variant\")\n if exp_header_size\n out! \"<!-- model expected header size #{header_size}/#{exp_header_size-6} -->\"\n else\n out! \"<!-- model expected header size #{header_size}/unknown -->\"\n end\n convert_data! header_size, \"model header data\"\n\n model_count = get_i\n out! \"<i>#{model_count}</i><!-- model count -->\"\n model_count.times do\n tag! \"model\" do\n convert_s! \"mesh path?\"\n convert_s! \"mesh name?\"\n if @version <= 77\n convert_data! 21, \"some model data or anim header or sth\"\n elsif @version == 84 or @version == 85 or @version == 86\n convert_data! 29, \"some model data or anim header or sth\"\n else\n convert_data! 1, \"some model data or anim header or sth\"\n end\n convert_ix! \"anim count or something?\" # assume 1, crashes otherwise\n convert_s! \"anim name?\"\n convert_s! \"anim path?\"\n convert_data! 4, \"rest of anim stuff or sth\"\n out_ofs! \"end of model data\"\n end\n end\n end\n end",
"def modeler_description\n return 'The measure performs the following functions: (1) IDs all chillers, (2) Locates their performance curves and outputs the data, (3) Adds reporting variables for chiller-related data.'\n end",
"def modeler_description\n return 'Modify the cooling setpoint of the HVAC system during a DR event'\n end",
"def modeler_description\n return \"This measure asks the user which existing conditioned thermal zones to convert to be served by an Autosized ZoneHVACIdealLoadsAirSystems from a choice list. The choice list will only be populated by Thermal zones which are (1) conditioned and (2) served only by ZoneHVAC Equipment objects, which this measure will delete. The measure configures the ZoneHVACIdealLoadsAirSystems with user-defined values for the supply airflow rates (cfm/ft2), leaving air temperature (Deg F) and leaving air humidity ratios (lb H2O / lb dry air) for both cooling and heating modes.\"\n end",
"def modeler_description\n return \"This energy efficiency measure (EEM) loops through all Controller:OutdoorAir objects and adds sensor faults to economizer sensor nodes. As appropriate, sensor drifts for return and outside air temperature and enthalpy are added to the model, based on the 'Economizer Control Type' setting. If the Economizer Control Type is set to 'No Economizer', no actions are taken. Drift limits are hard coded to reasonable values for sensor quality based on published ASHRAE documentation.\"\n end",
"def modeler_description\n return 'The goal of this measure is to create a single space type that represents the loads and schedules of a collection of space types in a model. When possible the measure will create mulitple load instances of a specific type in the resulting blended space type. This allows the original schedules to be used, and can allow for down stream EE measures on specific internal loads. Design Ventilation Outdoor Air objects will have to be merged into a single object. Will try to maintain the load design type (power, per area, per person) when possible. Need to account for zone multipliers when createding blended internal loads. Also address what happens to daylighting control objets. Original space types will be left in the model, some may still be assigned to spaces not included in the building area.'\n end",
"def modeler_description\n 'NOTE: This will load and respond slowly in the OS app, especially if you select * on a variable with many possible keys or you select timestep data. Suggest you open it in a web browser like Chrome instead.'\n end",
"def modeler_description\n return 'Cooling Setpoints Hourly Adjusted by Degrees. Determines optimal cooling temperature ranges for load shaping of baseline load to meet the demand response of the target load'\n end",
"def modeler_description\n return \"This EEM adds EMS logic to the model that actuates the infiltration, HVAC operation, cooling set point, and heating set point schedules. The measure first identifies the schedule HVAC stopping point by day of week (Saturday, Sunday, and Weekdays). Early HVAC system shutoff is determined entirely by the outdoor air temperature (OAT). If the OAT is less than or equal to 2C or greater than or equal to 18C, then no action is taken. The HVAC system is shut off one hour early when the OAT is between 12C and 18C. The HVAC system shut off time varies linearly with OAT from one hour to zero hours between 12C and 2C, and between 18C and 28C. AvailabilityManager:OptimumStart objects are inserted for each HVAC system in the model and use the AdaptiveASHRAE algorithm to dynamically adjust HVAC startup time each day.\"\n end",
"def modeler_description\n return \"Any supply components or baseboard convective electrics/waters are removed from any existing air/plant loops or zones. Any existing air/plant loops are also removed. A heating DX coil, cooling DX coil, electric supplemental heating coil, and an on/off supply fan are added to a unitary air loop. The unitary air loop is added to the supply inlet node of the air loop. This air loop is added to a branch for the living zone. A diffuser is added to the branch for the living zone as well as for the finished basement if it exists.\"\n end",
"def modeler_description\n return 'This measure loops through all Thermal zones connected to Airloops having an Outdoor Air Controller object, and determines a space-weighted occupancy schedule for each attached thermal zone. The resulting occupancy schedules for each thermal zone are stepped through from hour 0 to hour 24. An airloop is considered occupied during a time period if all thermal zones representing occupancy associated with an air loop have a current occupancy value that is greater than 5% of the annual peak occupancy value. The measure generates a new minimum outdoor air schedule having values of 0 where the all connected thermal zones have less than 5% occupancy and values of 1.0 for all other hours. Finally, the measure examines all Zone HVAC Equipment objects associated with an airloop. If Zone HVAC equipment object of type Four Pipe Fan Coil Unit or Unit Ventilator are found, the occupancy patterns associated with the thermal zone are analyzed and outside air schedules are assigned to allow design outside air levels when the thermal zone is occupied by more than 5 percent of thermal zone peak occupancy, otherwise shit the outside air damper of the Zone HVAC Equipment object completely.'\n end",
"def modeler_description\n return 'This measure will clone all of the schedules that are used as electric equipment power setting for each zone. Then the schedules are adjusted by a specified percentage during a specified time period. If the measure is applied throughout the entire building, the reduction value can be separately defined based on whether this space type is occupied or not.'\n end",
"def modeler_description\n 'Change exterior walls by altering the thermal resistance, density, and solar absorptance of the wall constructions by a Percent Change'\n end",
"def modeler_description\n 'It will be used for calibration maximum flow rate, efficiency, pressure rise and motor efficiency. User can choose between a SINGLE Fan or ALL the Fans.'\n end",
"def modeler_description\n return \"Reduces runtime fraction of lights by user-specified amount during the user-specified time period (typically daytime). This is an attempt to represent the impact of using the light collected on the roof instead of electric lighting. This modeling approach does not capture the impact of using a PV cell to turn the IR spectrum of the captured light into electricity.\"\n end",
"def modeler_description\n return 'This measure receives the AntiSweat heater Control from the user. Then it looks for refrigerated display cases; it loops through them; it checks the current AntiSweat heater Control of each case and it substitute it with the one chosen by the user.'\n end",
"def model_speed\n return \"10 Gbps\" if is_qlogic_57810?\n return \"10 Gbps\" if is_qlogic_57840?\n\n # Broadcom / QLogic 57800 is a 2x10Gb, 2x1Gb NIC\n return \"10 Gbps\" if (is_qlogic_57800? || is_intel_x520_i350? || is_intel_x710_i350?) && port.between?(1, 2)\n return \"1000 Mbps\" if (is_qlogic_57800? || is_intel_x520_i350? || is_intel_x710_i350?) && port.between?(3, 4)\n\n return \"10 Gbps\" if is_intel_x520?\n\n return \"10 Gbps\" if is_intel_x710?\n\n return \"25 Gbps\" if is_mellanox_connect_x_4_lx?\n\n return \"100 Gbps\" if is_mellanox_connect_x_5_lx?\n\n nil\n end",
"def modeler_description\r\n return \"This measure loops through the existing airloops, looking for loops that have a constant speed fan. (Note that if an object such as an AirloopHVAC:UnitarySystem is present in the model, that the measure will NOT identify that loop as either constant- or variable-speed, since the fan is located inside the UnitarySystem object.) The user can designate which constant-speed airloop they'd like to apply the measure to, or opt to apply the measure to all airloops. The measure then replaces the supply components on the airloop with an AirloopHVAC:UnitarySystem object. Any DX coils added to the UnitarySystem object are of the type CoilCoolingDXMultiSpeed / CoilHeatingDXMultiSpeed, with the number of stages set to either two or four, depending on user input. If the user opts for a gas furnace, an 80% efficient CoilHeatingGas object is added. Fan properties (pressure rise and total efficiency) are transferred automatically from the existing (but deleted) constant speed fan to the new variable-speed fan. Currently, this measure is only applicable to the Standalone Retail DOE Prototype building model, but it has been structured to facilitate expansion to other models with a minimum of effort.\"\r\n end",
"def modeler_description\n return 'This can be used in apply measure now, or can be used in a parametric workflow to load in any custom user profiles or floor/ceiling values.'\n end",
"def modeler_description\n return \"This is intended to run on an empty model. It will create the proper model associate it with the proper weather file, and add in necessary output requests. Internally to the measure the test case argument will be mapped to the proper inputs needed to assemble the model. The measure will make some objects on the fly, other objects will be pulled from existing data resources. This measure creates cases described all of section 5.3.\"\n end",
"def modeler_description\n return 'This measure uses the EnergyPlus Energy Management System to log and report emissions based on user-provided future and historical years as well as future, historical hourly, and historical annual subregions.'\n end",
"def modeler_description\n return \"NOTE: This will load and respond slowly in the OS app, especially if you select * on a variable with many possible keys or you select timestep data. Suggest you open it in a web browser like Chrome instead.\"\n end",
"def modeler_description\n return 'Find the interior lighting template for the building, and assume the existing efficiency level in the model (low, medium, high, very high). Find the LPD and LPD fractions for each space type. Apply the lighting upgrades by reducing the LPD associated with compact lighting by a percent (depends on starting and target efficiency levels).'\n end",
"def modeler_description\n return 'This a test measure in relation with https://github.com/NREL/OpenStudio/issues/4156'\n end",
"def modeler_description\n return \"This uses the OpenStudio::Model::Space::fromFloorPrint method, and is very much like the Create Spaaces From Diagram tool in the OpenStudio SketchUp plugin, but lets you draw teh diagram in the tool of your choice, and then imports it into the OpenStudio application via a measure.\"\n end",
"def modeler_description\n return 'Not sure how I will handle arguments. Maybe lump together all spaces on same sotry that have the same multilier value. This will have variable number of arguments basd on the model pased in. Alternative is to either only allo w one group to be chosen at at time, or allow a comlex string that describes everything. Also need to see how to define shirting. There is an offset but it may be above and below and may not be equal. In Some cases a mid floor is halfway betwen floors which makes just copying the base surfaces as shading multiple times probemeatic, since there is overlap. It coudl be nice to stretch one surface over many stories. If I check for vertial adn orthogonal surface that may work fine. '\n end",
"def modeler_description\n 'Change R-value of Insulation Layer for Construction By a Multiplier'\n end",
"def modeler_description\n return \"Each zone is given a ZoneControl:Thermostat:ThermalComfort object with heating and cooling schedules set to a Predicted Mean Vote (PMV) of -0.5 during heating and +0.5 during cooling. This object will set the heating and cooling setpoints such that 90% of the occupants are comfortable. This control is applied 8am-6pm on weekdays. During the rest of the time, the building follows the current setpoints. It is not applied to zones without people.\"\n end",
"def modeler_description\n return 'Thermostat offset fault. A positive value means the zone air temperature reading is higher than the actual value. A negative value means the reading is lower than the actual value. A “0.0” value means no offset. Default is 2.0. The units are in degrees Celsius.'\n end",
"def modeler_description\n return \"Adds simple PV object for BIPV implementation. Implement thermochromic window with switching temperature definition. Implement power conversion efficiency difference betwee light and dark state windows.\"\n end",
"def modeler_description\n return \"Any generators and electric load center distribution objects are removed. An electric load center distribution object is added with a track schedule equal to the hourly output from SAM. A micro turbine generator object is add to the electric load center distribution object. The fuel used to make the electricity is zeroed out.\"\n end",
"def modeler_description\n 'Run a simulation to autosize HVAC equipment and then apply these autosized values back to the model.'\n end",
"def modeler_description\n return 'Replace this text with an explanation for the energy modeler specifically. It should explain how the measure is modeled, including any requirements about how the baseline model must be set up, major assumptions, citations of references to applicable modeling resources, etc. The energy modeler should be able to read this description and understand what changes the measure is making to the model and why these changes are being made. Because the Modeler Description is written for an expert audience, using common abbreviations for brevity is good practice.'\n end",
"def modeler_description\n return 'Replace this text with an explanation for the energy modeler specifically. It should explain how the measure is modeled, including any requirements about how the baseline model must be set up, major assumptions, citations of references to applicable modeling resources, etc. The energy modeler should be able to read this description and understand what changes the measure is making to the model and why these changes are being made. Because the Modeler Description is written for an expert audience, using common abbreviations for brevity is good practice.'\n end",
"def modeler_description\n return \"Replace this text with an explanation for the energy modeler specifically. It should explain how the measure is modeled, including any requirements about how the baseline model must be set up, major assumptions, citations of references to applicable modeling resources, etc. The energy modeler should be able to read this description and understand what changes the measure is making to the model and why these changes are being made. Because the Modeler Description is written for an expert audience, using common abbreviations for brevity is good practice.\"\n end",
"def modeler_description\n return 'This measure only allows for one feature_report per simulation. If multiple features are simulated in a single simulation, a new measure must be written to disaggregate simulation results to multiple features.'\n end",
"def modeler_description\n return 'This measure assigns load and flow information to a selected plant loop load profile.'\n end",
"def modeler_description\n return \"Make an array of the spaces that meet the criteria. Locate the sensor x and y values by averaging the min and max X and Y values from floor surfaces in the space. If a space already has a daylighting control, do not add a new one and leave the original in place. Warn the user if the space isn't assigned to a thermal zone, or if the space doesn't have any translucent surfaces. Note that the cost is added to the space not the sensor. If the sensor is removed at a later date, the cost will remain.\"\n end",
"def modeler_description\n return \"WARNING: This measure puts in output variables with reporting frequency 'RunPeriod'.\n Make sure 'Run Simulation for Sizing Periods' is set to 'false' in 'OS:SimulationControl'.\"\n end",
"def modeler_description\n 'It will be used for calibration of WaterHeaterMixed. User can choose between a SINGLE WaterHeaterMixed or ALL the WaterHeaterMixed objects.'\n end",
"def modeler_description\n return \"For any thermal zones having zone equipment objects of type Fan:ZoneExhaust, this energy efficiency measure (EEM) maps the schedule used to define the availability of the associated Air Loop to the Availability Schedule attribute of the zone exhaust fan object. \"\n end",
"def modeler_description\n return \"It will be used for calibration of inlet water temperatures, inlet and outlet air temperatures and design flowrates. User can choose between a SINGLE coil or ALL the Coils.\"\n end",
"def modeler_description\n return 'This measure is based off of the ResidentialGeometryCreateFromFloorspaceJS measure on the OpenStudio-Buildstock repository'\n end",
"def modeler_description\n return 'File:measure.rb, resources/original_schedule.csv, resources/ScheduleGenerator.rb. There are two steps to implement the measure. First, a modeler generates an hourly baseline schedule of the interest by running the model. A previously generated schedule is also available in the resources/original_schedule.csv. The selected schedules are available for three building types (medium office detailed, large office detailed, and retail stand alone) in two vintages (post-1980 and 2010) and a big box retail model in 2010 vintage. The big box retail model is only available in an EnergyPlus model, which this measure is not applicable. Second, a modeler loads the model and runs the measure by selecting \"Apply Measure Now\" under the menu \"Components & Measure\" in the top bar of OpenStudio GUI. The measure is located under \"Whole Building\" >> \"Whole Building Schedules\".'\n end",
"def modeler_description\n return \"The measure loops through the AirLoops associated with the model, and determines an occupancy weighted schedule with values of 1 or 0 based on the percent of peak occupancy at the timestep being above or below a set threshold value of 5 percent. The resulting occupancy schedule is applied to the airloop attribute for the availability schedule. The measure then loops through all thermal zones, examining if there are zone equipment objects attached. If there are one or more zone equipment object attached to the zone, a thermal zone occupancy weighted schedule with values of 1 or 0 based on the percent of peak occupancy at the timestep being above or below a set threshold value of 5 percent is generated. The schedule is then assigned to the availability schedule of the associated zone equipment. To prevent energy use by any corresponding plant loops, the pump control type attribute of Constant or Variable speed pump objects in the model are set to intermittent. The measure them adds heating and cooling unmet hours and Simplified ASHRAE Standard 55 warning reporting variable to each thermal zone. \"\n end",
"def modeler_description\n return \"The difference between actual spaces and effective spaces takes into account the zone multipliers. The goal was to get average floor area assuming that each space represents a room vs. a collection of rooms. This was used to help determine average space sizes of different space types from the prototype buildings. In some cases I had to manaually adjust for where a space didn't map to a single room.\"\n end",
"def modeler_description\n return 'Multiplies cost value by cost multiplier.'\n end",
"def find_mos_models description\n models = {}\n description.downcase.each_line{|l|\n if l =~ /(^ *)([m]\\S*) (\\([^\\)]*\\)) +(\\S+) +(.*)$/\n parms, = parse_parameters $5\n models[$4] ||= []\n models[$4] << {'l'=> parm_eval(parms['l']),\n 'w'=> parm_eval2(parms['w'], parms[NUMBER_OF_FINGERS])}\n end\n }\n models.each_value{|v| v.uniq!}\n end",
"def modeler_description\n return \"Each window in the building is assigned a thermochromic window construction and a shading control. The shading control is set to increase the window tint to meet the daylighting setpoint in the zone. If the zone already has daylighting controls, the setpoints from those controls are used. If the zone does not have controls, new controls are added at the center of the zone with a setpoint of 500 lux. These controls are only used for changing the window tint; they are not used to control the interior lighting.\"\n end",
"def modeler_description\n return 'Currently this is just setup for design level calculation method, but it could be extended as needed..'\n end",
"def modeler_description\n return 'Daylighting controls will physically add in daylighting controls to spaces in the building, while occupancy control will reduce lighting schedules by 10%.'\n end",
"def modeler_description\n return \"Any heating components or baseboard convective electrics/waters are removed from any existing air/plant loops or zones. A boiler along with constant speed pump and water baseboard coils are added to a hot water plant loop.\"\n end",
"def detail_material\n mass * material.price_per_kg / 1000\n end",
"def get_info \n \"#{@model}, #{@wheels}, #{@current_speed}\"\n end",
"def get_info\n \"The #{@model} bike has #{@wheels} wheels and a #{@frame_size}cm frame.\"\n end"
] | [
"0.6518598",
"0.6516782",
"0.64116484",
"0.6307434",
"0.6243534",
"0.62093925",
"0.62065464",
"0.61836827",
"0.614624",
"0.61438143",
"0.613039",
"0.61167514",
"0.6100191",
"0.605614",
"0.60561186",
"0.6036423",
"0.60015625",
"0.59511024",
"0.5920326",
"0.5914699",
"0.5890937",
"0.5887655",
"0.5883308",
"0.5866369",
"0.5816571",
"0.5809592",
"0.578335",
"0.5769307",
"0.5769243",
"0.5754605",
"0.5750288",
"0.5701545",
"0.5688586",
"0.5680948",
"0.56740004",
"0.5663372",
"0.56587225",
"0.5615913",
"0.5612648",
"0.55995643",
"0.55980736",
"0.55980736",
"0.55802673",
"0.55723715",
"0.5566938",
"0.55583024",
"0.555066",
"0.5532601",
"0.55325407",
"0.552807",
"0.5498408",
"0.5490115",
"0.5471492",
"0.5466147",
"0.5462477",
"0.54621905",
"0.5455734",
"0.54479486",
"0.5447607",
"0.5437234",
"0.5431826",
"0.54287654",
"0.5416125",
"0.54133266",
"0.54127944",
"0.5401459",
"0.5386648",
"0.53663874",
"0.53661436",
"0.5365598",
"0.53542125",
"0.5353881",
"0.5344899",
"0.53403765",
"0.53399897",
"0.53362405",
"0.5330904",
"0.5308791",
"0.5305917",
"0.5305917",
"0.53045374",
"0.5299712",
"0.52952796",
"0.52914655",
"0.52800316",
"0.52726537",
"0.5266574",
"0.5250228",
"0.52435523",
"0.52385986",
"0.52378654",
"0.51981574",
"0.5191194",
"0.5184086",
"0.5180321",
"0.5166711",
"0.5156695",
"0.51529497",
"0.51380163",
"0.5137359",
"0.5133855"
] | 0.0 | -1 |
name isn't mandatory on signup, so fall back to email | def identifier
unless full_name.blank?
full_name
else
email.split('@').join(' from ')
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name_or_email\n self.name.blank? ? self.email : self.name\n end",
"def name_or_email\n if name.present?\n name\n else\n email\n end\n end",
"def name_or_email\n name.blank?? email : name\n end",
"def name\n username || email\n end",
"def name\n username || email\n end",
"def display_name\n name || email\n end",
"def display_name\n name || email\n end",
"def display_name\n self.name.blank? ? self.email : self.name\n end",
"def assert_name(name=nil)\n if name && (self.pre_registered? || self.creation_pending?) && name != email\n self.name = name\n save!\n end\n self\n end",
"def email_name=(name)\n unless name.blank?\n @email_name = name\n self.email = \"#{name}@#{self.email_domain}\" if self.email_domain\n end\n end",
"def signup_with_email\n @status, @msg, @data = UserValidator.signup_with_email(params)\n @status, @msg, @data = UserManager.signup_with_email(params) if @status\n end",
"def name\n email\n end",
"def name\n email\n end",
"def name\n\t\temail\n\tend",
"def name_and_email\n email_address = Notifier.unprettify(self.email)\n self.name.blank? ? email_address : \"\\\"#{self.name}\\\" <#{email_address}>\"\n end",
"def name\n if first_name && last_name\n return \"#{first_name} #{last_name}\"\n else\n return email\n end\n end",
"def name(use_email = true)\n if (firstname.blank? && surname.blank?) || use_email\n email\n else\n name = \"#{firstname} #{surname}\"\n name.strip\n end\n end",
"def ensure_username\n if self.username != \"\"\n self.username \n else\n self.username = \"user#{((self.email).hash).to_s[0,6]}\"\n end\n end",
"def name_and_email\r\n if email\r\n return \"#{self.entire_full_name} <#{self.email}>\"\r\n else\r\n return nil\r\n end\r\n end",
"def signup_params\n params.permit(:email, :password, :name)\n end",
"def username_or_email\n user.try(:name) || email\n end",
"def fallback_name\n users_data['email'].split('@').first.parameterize.titleize\n end",
"def sign_up(name:, user_name:)\n user_name = user_name.downcase\n return SYNTAX_ERROR if include_punctuation?(user_name)\n return TOO_LONG_ERROR if too_long?(user_name)\n return TOO_SHORT_ERROR if too_short?(user_name)\n\n @user_class.add(name: name, user_name: user_name)\n end",
"def newsignup(email)\n @greeting = \"Hi\"\n @email = email['email']\n mail(to: @email, subject: \"You've signed up\")\n end",
"def email\n if self[:email] && !@email_name\n self[:email]\n elsif self.email_name && self.email_domain\n self[:email] = \"#{self.email_name}@#{self.email_domain}\"\n end\n end",
"def display_name\n email\n end",
"def find_name_or_email\n if self.first_name.present? && self.last_name.present?\n self.first_name + \" \" + self.last_name\n else\n self.name || self.email\n end\n end",
"def email_with_name\n \"#{name} <#{email}>\"\n end",
"def email_with_name\n \"#{name} <#{email}>\"\n end",
"def email_with_name\n \"#{name} <#{email}>\"\n end",
"def name\n [first_name, last_name].compact.join(\" \").presence || email\n end",
"def name\n\t return self.email\n\tend",
"def email_required?; false end",
"def signup!(params)\n self.email = params[:user][:email]\n self.name = params[:user][:name]\n self.password = params[:user][:password]\n #save_without_session_maintenance\n end",
"def name\n if self[:name].blank?\n (self[:email] || \"\").split('@')[0].split('.').map(&:capitalize).join(' ')\n else\n self[:name]\n end\n end",
"def signup_confirmation(user_name, user_email)\n @user_name = user_name\n @user_email = user_email\n mail to: user_email, subject: \"Dum dum de dum... get started with Bridled!\"\n end",
"def display_name\n if !self.first_name.blank?\n self.first_name\n elsif !self.name.blank?\n self.name\n elsif !self.provider_username.blank?\n self.provider_username\n else\n self.email\n end\n end",
"def to_s\n name || email\n end",
"def ensure_username\n return unless username.blank?\n\n self.username = email.gsub(/@.*$/, '')\n end",
"def check_create_user_name_is_valid\n return self.name != \"\" ? true : false\n end",
"def new_user(user_name, email)\n @user_name = user_name\n @email = email\n\n mail to: \"Susie Ye <[email protected]>\", subject: \"Free User: #{email}\"\n end",
"def validate_name?\n # if you create user from admin interface(or as a team member), then \"name\" param is provided, it is present or blank - not nil\n !name.nil?\n end",
"def name\n \"#{self.class.name.titleize}: #{user.email rescue 'unknown user'}\"\n end",
"def signup\n end",
"def signup\n end",
"def welcome_name\n if profile.nil? or (profile.user_first_name.nil? and profile.user_last_name.nil?)\n email \n else\n self.full_name\n end\n end",
"def auth_has_email_with_any_name?(info)\n return false unless info['email']\n return true if auth_info_has_any_name?(info) == true\n end",
"def name(use_email = true)\n if (firstname.blank? && surname.blank?) || use_email then\n return email\n else\n name = \"#{firstname} #{surname}\"\n return name.strip\n end\n end",
"def name_display\n if first_name || last_name\n \"#{first_name} #{last_name}\".strip\n else\n email\n end\n end",
"def signup(email)\n \n @greeting = \"Hi\"\n\n mail to: email\n end",
"def email; default_profile.try :email; end",
"def email\n if self.alternate_email.blank?\n if self.alumni?\n \"#{self.username}@alumni.calvin.edu\"\n else\n \"#{self.username}@students.calvin.edu\"\n end\n else\n self.alternate_email\n end\n end",
"def signup(email)\n @email = email\n \n mail :to => \"[email protected]\", :cc => KMCD_EMAIL, \n :subject => \"New signup for RailsDojo.com\"\n end",
"def user_email\n msg['email'] || entry['email'] || reject['email']\n end",
"def signup_user(name=nil)\n if name.nil?\n puts \"Please enter your name to signup\"\n name = CLI.gets_with_quit\n end\n if self.user_exists(name)\n message = \"Sorry that name is already taken :(\"\n options = [ \"Go To Login\", \"Try Again\", \"Back to Main Menu\"]\n choice = PROMPT.select(message, options)\n case options.index(choice)\n when 0 then self.login_user\n when 1 then self.signup_user\n when 2 then CLI.start\n end\n else\n password = PROMPT.mask(\"Enter your password:\")\n user = User.create(name: name)\n user.set_password = password\n CLI.active_user = user\n end\n end",
"def email_with_name\n \"#{full_name} <#{email.to_s}>\"\n end",
"def signup\n\n\t\temail = params[:email] # Extract the email from the params of the signup form\n\t\ttimezone = params[:timezone] # Extract the timezone from the params of the signup form\n\n\t\t@url = uniqueUrlKeyGenerator # Generate a unique url key\n\t\told_user = User.find_by_email(email)\n\n\t\t# If user exists\n\t\tif !old_user.nil?\n\t\t # If user is not registered\n\t\t if !old_user.registered?\n\t\t # Send welcome email again and save him\n\t\t old_user.sendWelcomeEmail\n\t\t old_user.save\n\t\t end\n\t\tend\n\n\t\t# Find the user in the user db with the same email as extracted in the params\n\t\tcheck_users = User.find_by_email(email)\n\n\t\t#create a new PotentialUser object with the extarcted email, timezone and url key\n\t\tuser = User.new(email: email, url: @url, timezone: timezone, day: 1, registered: false)\n\n\t\t# If no such user exists\n\t\tif check_users.nil?\n\n\t\t#If the new user is valid and can be saved\n\t\t if user.save\n\t\t user.sendWelcomeEmail\n\t\t @title = \"Thank you for signing up\"\n\t\t @result = \"A confirmation email with instructions has been sent to you\"\n\t\t @result2 = \"Your unique access key is: \" + @url\n\n\t\t#If not valid\n\t\t else\n\t\t #Set @result as the error message\n\t\t @title = \"Looks like something went wrong ...\"\n\t\t @result = \"Email #{user.errors[:email][0]}.\".html_safe\n\t\t end\n\n\t\t#User by this email already exists\n\t\telse\n\n\t\t if !check_users.registered?\n\t\t\t # Result instance variable for the view\n\t\t\t @title = \"Looks like something went wrong ...\"\n\t\t\t @result = \"User by this email already exists, but we sent another confirmation email just in case\"\n\t\t\t else\n\t\t\t @title = \"Looks like something went wrong ...\"\n\t\t\t @result = \"User by this email already exists\"\n\t\t end\n\n\tend\n\n\t\t# Respond to only javascript, set for AJAX\n\t\trespond_to do |format|\n\t\t\tformat.js\n\t\tend\n\tend",
"def signup(new_user)\n mail(to: new_user.email, subject: \"Congratulations on Signing up!\")\n end",
"def display_name\n self.email\n end",
"def display_name\n first_name.blank? || last_name.blank? ? email : first_name + \" \" + last_name\n end",
"def display_name\n return \"#{first_name} #{last_name}\".strip if first_name\n return email\n end",
"def email\n user.present? ? user.email : self[:email]\n end",
"def signup!(params)\n self.username = params[:user][:username]\n self.email = params[:user][:email]\n save_without_session_maintenance\n end",
"def signup!(params)\n self.username = params[:user][:username]\n self.email = params[:user][:email]\n save_without_session_maintenance\n end",
"def send_signup_email(name, email, body)\n \t\t@name = name\n\t\t@email = email\n\t\t@body = body\n\n \t\tmail( :to => email,\n \t\t :subject => 'Thanks for signing up for our amazing app' )\n \tend",
"def add_email_or_username(username_or_email)\n\t\temail_or_username_field.set(username_or_email)\n\tend",
"def valid_user_or_email!\n return unless @user.blank? && @extra['email'].blank?\n\n @success = false\n @error = 'Error: user name or extra email must be present'\n end",
"def email_required?\n false\n end",
"def signup(params)\n if self.is_client?\n user = self.employees.create!(name: params[:name],last_name: params[:last_name],\n email: params[:email],password: params[:password],password_confirmation: params[:password_confirmation])\n GroupsUser.create!(user_id: user.id,group_id: params[:group_id])\n user\n else\n user = self.clients.create!(name: params[:name],email: params[:email],password: params[:password],\n password_confirmation: params[:password_confirmation])\n end\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n false\n end",
"def email_required?\n true\n end"
] | [
"0.76586074",
"0.75714576",
"0.7449726",
"0.7119772",
"0.71195257",
"0.7086814",
"0.7086814",
"0.70684296",
"0.69923794",
"0.6960828",
"0.6941891",
"0.6921003",
"0.6921003",
"0.6914869",
"0.68006814",
"0.6759951",
"0.6755081",
"0.6708651",
"0.6703954",
"0.6700805",
"0.66796386",
"0.66776127",
"0.6659797",
"0.665637",
"0.6648814",
"0.66450644",
"0.66423476",
"0.66146624",
"0.66146624",
"0.66146624",
"0.66014755",
"0.6588744",
"0.65670276",
"0.6554199",
"0.65527856",
"0.65516317",
"0.6540537",
"0.6537011",
"0.6507783",
"0.64980423",
"0.64978415",
"0.6486055",
"0.64815784",
"0.6478946",
"0.6478946",
"0.64788103",
"0.64730895",
"0.647224",
"0.6471633",
"0.6471294",
"0.64637184",
"0.6454196",
"0.645322",
"0.6451674",
"0.6451469",
"0.6448654",
"0.6444274",
"0.6441979",
"0.64261967",
"0.63867426",
"0.6380003",
"0.6376361",
"0.63642466",
"0.63642466",
"0.636078",
"0.63607466",
"0.6359403",
"0.63525",
"0.63248223",
"0.6320499",
"0.6315042",
"0.6315042",
"0.6315042",
"0.6315042",
"0.6315042",
"0.6315042",
"0.6315042",
"0.6315042",
"0.6315042",
"0.6315042",
"0.6315042",
"0.6315042",
"0.6315042",
"0.6315042",
"0.6315042",
"0.6315042",
"0.6315042",
"0.6315042",
"0.6315042",
"0.6315042",
"0.6315042",
"0.6315042",
"0.6315042",
"0.6315042",
"0.6315042",
"0.6315042",
"0.6315042",
"0.6315042",
"0.6315042",
"0.6315042",
"0.6313245"
] | 0.0 | -1 |
Generate a list of PublicationIdentifiers. | def id_list(item, **opt)
id_split(item).map! { |v| id_obj(v, **opt) }.compact
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_identifiers\n identifiers = publication_identifiers.map{|pi| pi.identifier_value}\n identifiers.push(self.isbn) unless !self.isbn\n identifiers.push(self.issn) unless !self.issn\n identifiers.push(self.eissn) unless !self.eissn\n identifiers.push(self.article_number) unless !self.article_number\n return identifiers\n end",
"def list_ids\n @documents.keys\n end",
"def generate\n parts = objs.map { |obj| identifier_name_for obj }\n compose_identifier_parts parts\n end",
"def policy_list_uids\n\t\t\tpost= { \"token\" => @token }\n\t\t\tdocxml = nil\n\t\t\tdocxml=nessus_request('policy/list', post)\n\t\t\tif docxml.nil?\n\t\t\t\treturn\n\t\t\tend\n\t\t\tpids=Array.new\n\t\t\tdocxml.root.elements['contents'].elements['policies'].each_element('//policy') { |policy|\n\t\t\t\tpids.push(policy.elements['policyID'].text) }\n\t\t\treturn pids\n\t\tend",
"def policy_list_uids\r\n\t\tpost= { \"token\" => @token } \r\n\t\tdocxml=nessus_request('policy/list', post)\r\n\t\tpids=Array.new\r\n\t\tdocxml.root.elements['contents'].elements['policies'].each_element('//policy') { |policy| \r\n\t\t\tpids.push(policy.elements['policyID'].text) }\r\n\t\treturn pids\r\n\tend",
"def extract_ids\n # no-op\n end",
"def person_ids\n persons = Person.find_all_from_identifier(source: 'xkonto', identifier: username)\n return nil if persons.blank?\n return persons.map(&:id)\n end",
"def get_pubs(suggestions)\n pub_ids = suggestions.join(',')\n JSON.parse(client.publication_items(pub_ids, 'json'))\n end",
"def identifier_list(*ids, separator: /\\s*,\\s*/, **)\n ids = ids.flat_map { |v| v.is_a?(String) ? v.strip.split(separator) : v }\n ids.map! { |v| v.is_a?(ApplicationRecord) ? v.id : v }\n ids.map! { |v| positive(v) || v }.compact_blank!\n end",
"def index\n @publication_names = PublicationName.all\n end",
"def record_ids(opts = {})\n opts = opts.merge(@opts)\n client.list_identifiers(opts).full.lazy.flat_map(&:identifier)\n end",
"def author_identities_set\n author_identities.map do |ident|\n normalize_author_identity(ident.first_name, ident.middle_name || 'None',\n ident.last_name, ident.institution || 'None')\n end.to_s\n end",
"def identifier_uris\n return @identifier_uris\n end",
"def publications\r\n params = {\r\n method: :get,\r\n url: '/report/publications',\r\n params: {\r\n reportUUID: @uuid\r\n }\r\n }\r\n @session.request(params).perform!\r\n end",
"def affiliation\n []\n end",
"def identifiers\n {'issn' => @issn, 'eissn' => @eissn, 'isbn' => @isbn, 'eisbn' => @eisbn, 'oclc' => @oclc, 'lccn' => @lccn, 'doi' => @doi,\n 'svc_specific_id_1' => @svc_specific_id_1, 'svc_specific_id_2' => @svc_specific_id_2, 'svc_specific_id_3' => @svc_specific_id_3}\n end",
"def prisoner_ids\n @prisoner_ids || prisoners.collect{|p| p.id}\n end",
"def publications_data\n list = []\n target_div = self.div(:class=>\"s3d-contentpage-title\", :text=>\"Publications\").parent.parent.div(:id=>\"displayprofilesection_body\")\n target_div.divs(:id=>\"displayprofilesection_sections_publications\").each do |div|\n hash = {}\n div.divs(:class=>\"displayprofilesection_field\").each { |subdiv| hash.store(subdiv.span(:class=>\"s3d-input-label\").text, subdiv.span(:class=>\"field_value\").text) }\n list << hash\n end\n return list\n end",
"def asset_ids(id)\n monograph = Hyrax::PresenterFactory.build_for(ids: [id], presenter_class: Hyrax::MonographPresenter, presenter_args: nil).first\n return if monograph.blank?\n\n docs = monograph.ordered_member_docs\n return if docs.blank?\n\n ids = []\n docs.each do |doc|\n fp = Hyrax::FileSetPresenter.new(doc, nil)\n next if fp.featured_representative?\n next if fp.id == monograph.representative_id\n next if Sighrax.tombstone?(Sighrax.from_presenter(fp))\n ids << fp.id\n end\n\n ids.join(\",\")\n end",
"def get_citation_exports_list(id_list: [], format: 'all')\n citations = []\n if id_list.any?\n id_list.each { |id|\n dbid = id.split('__',2).first\n accession = id.split('__',2).last\n citations.push get_citation_exports(dbid: dbid, an: accession, format: format)\n }\n end\n citations\n end",
"def identifiers_from_params(params_in:)\n # params_in = params_in.to_h.with_indifferent_access\n return [] unless params_in[:org_id].present? &&\n params_in[:org_id].is_a?(String)\n\n hash = org_hash_from_params(params_in: params_in)\n return [] unless hash.present?\n\n OrgSelection::HashToOrgService.to_identifiers(hash: hash)\n end",
"def ids\n (1..get_item_count).map do |index|\n get_item_identifier index\n end\n end",
"def idlist(objects)\n safe_join(objects.collect {|o| o.id}, ',')\n end",
"def publishers\n editions.map {|edition| edition.publisher}.uniq\n end",
"def people_for_publication(publication_version_id:)\n p2ps = People2publication.where(publication_version_id: publication_version_id).order(position: :asc)\n people = p2ps.map do |p2p|\n person = Person.where(id: p2p.person_id).first.as_json\n department_ids = Departments2people2publication.where(people2publication_id: p2p.id).order(updated_at: :desc).select(:department_id)\n\n departments = Department.where(id: department_ids)\n person['departments'] = departments.as_json\n\n presentation_string = Person.where(id: p2p.person_id).first.presentation_string(departments.map{|d| I18n.locale == :en ? d.name_en : d.name_sv}.uniq[0..1])\n person['presentation_string'] = presentation_string\n\n person\n end\n\n return people\n end",
"def approver_id_list(resource)\n id_list(resource, approver_request_ids)\n end",
"def get_presentation_ids(base_url)\n ids_arr=[]\n get_page(base_url)\n grid = @wait.until{@driver.find_element(:id,\"presentation_grid\")}\n presentation_list = @driver.find_elements(:css, \".presentation_wrap\")\n\n presentation_list.each do |presentation|\n presentation_id = presentation.attribute(\"id\")\n presentation_id.slice! \"p_\"\n ids_arr.push(presentation_id)\n end\n return ids_arr\nend",
"def identifiers\n return [] if __getobj__.blank?\n\n __getobj__.identifier if __getobj__.respond_to?(:identifier)\n end",
"def index\n @publications = Publication.all\n end",
"def index\n @publications = Publication.all\n end",
"def index\n @publications = Publication.all\n end",
"def index\n @publications = Publication.all\n end",
"def generate_ids\n hex_str = SecureRandom.hex(32)\n bytes = hex_str.scan(/.{1,2}/).map do |h|\n Integer(h, 16)\n end\n @doc_id = xtext(bytes[0, 16])\n @rev_id = xtext(bytes[16, 16])\n @attributes[:ID] = list([@doc_id, @rev_id])\n end",
"def identities\n identities = []\n @known_identities = Hash.new\n\n ensure_agent\n if @agent\n @agent.identities.each do |key|\n identities.push key\n @known_identities[ key ] = { :from => :agent }\n end\n end\n\n @key_files.each do |file|\n if @key_existence_tester.readable?( file )\n begin\n key = @keys.load_public_key( file + \".pub\" )\n identities.push key\n @known_identities[ key ] = { :from => :file, :file => file }\n rescue Exception => e\n @log.warn \"could not load public key file \" +\n \"'#{file}.pub' (#{e.message} [#{e.class}])\" if @log.warn?\n end\n end\n end\n\n identities\n end",
"def index\n @identifiers = Identifier.all\n end",
"def index\n @identifiers = Identifier.all\n end",
"def index\n @digital_object_identifiers = DigitalObjectIdentifier.all\n end",
"def identifiers(ident, prefix='')\n identify(ident).map{|sym| \"#{prefix}#{sym}\"}\n end",
"def generate_pub_list(publications)\n # sorting bibliography, first on how many files (notes etc), and then on citekey\n # it's weird [0][1] because in the sort above, it gets transformed first to a hash and then to an array. don't ask me :)\n # this way of trying to sort on two different criteria is not perfect, but mostly works\n \n # make hash if bibtex, if array leave alone, this allows for sorting\n pubs = publications.class == BibTeX::Bibliography ? publications.to_hash.sort[0][1] : publications\n\n pubsort = pubs.sort do |x,y| \n if debrace(y[:hasfiles]).to_s.strip.size == debrace(x[:hasfiles]).to_s.strip.size\n x[:key].to_s <=> y[:key].to_s\n else\n debrace(y[:hasfiles]).to_s <=> debrace(x[:hasfiles]).to_s\n end\n end\n\n # adding each item to the HTML output, properly formatted\n outcit = ''\n pubsort.each do |item| \n link = item[:hasfiles].to_s.index(\"H\") ? \"<a href = '/wiki/ref:#{item[:key]}'>\" : \"\" # only link if ref exists\n outcit << \"<tr><td>#{link}#{item[:key]}</a></td><td>#{debrace(item[:hasfiles]).split(\"\").join(\"</td><td> \")}</td><td>#{debrace(item[:cit])}</td></tr>\\n\"\n end\n return outcit\nend",
"def owner_id_list(resource)\n id_list(resource, owner_request_ids)\n end",
"def representation_ids\n (Array.wrap(representations) + Array.wrap(additional_representation)).uniq.delete_if(&:empty?)\n end",
"def people_for_publication(publication_version_id:)\n p2ps = People2publication.where(publication_version_id: publication_version_id).order(position: :asc)\n people = p2ps.map do |p2p|\n # Use unscoped to ignore the default scope deleted_at: nil for person to avoid crash.\n # TODO: Remove default scope\n person = Person.unscoped.where(id: p2p.person_id).first.as_json\n\n departments = Department.includes(:departments2people2publications).where(\"departments2people2publications.people2publication_id = ?\", p2p.id).order(\"departments2people2publications.position asc\")\n person['departments'] = departments.as_json(skip_children: true)\n\n presentation_string = Person.where(id: p2p.person_id).first.presentation_string(departments.map{|d| I18n.locale == :en ? d.name_en : d.name_sv}.uniq[0..1])\n person['presentation_string'] = presentation_string\n\n person\n end\n\n return people\n end",
"def ids\n pluck(:id)\n end",
"def get_denotation_ids(project_id = nil, span = nil)\n\t\tdenotations.in_project(project_id).in_span(span).pluck(:id)\n\tend",
"def identities\n results = @ordered.keys.sort\n return results\n end",
"def identities\n \n return ::IdentifiesAs.object_identities( self ) \n \n end",
"def ids\n @ids ||= []\n end",
"def agg_pubkeys\n index = latest_agg_pubkey_index\n (index + 1).times.map { |i| agg_pubkey(i) }\n end",
"def canonical_instance_identifiers(opennebula_instance)\n fail 'Instance object not provided!' unless opennebula_instance\n identifiers = []\n\n identifiers << opennebula_instance['USER_TEMPLATE/OCCI_ID']\n identifiers << opennebula_instance['NAME']\n identifiers << opennebula_instance['ID'].to_s\n identifiers.compact!\n\n Egi::Fedcloud::Vmhound::Log.debug \"[#{self.class}] Assigning instance IDs \" \\\n \"#{identifiers.inspect} to #{opennebula_instance['ID'].inspect}\"\n identifiers\n end",
"def validate_identifiers(value)\n ids = []\n errors = []\n PublicationIdentifier.object_map(value).each_pair do |term, id|\n if id&.valid?\n ids << id.to_s\n elsif id\n errors << \"#{id.to_s.inspect} is not a valid #{id.type.upcase}\" # TODO: I18n\n else\n errors << \"#{term.inspect} is not a standard identifier\" # TODO: I18n\n end\n end\n { valid: errors.blank?, ids: ids, errors: errors}\n end",
"def num_creator_2()\n\tlist_of_pandigs = [1,21,321,4321,54321,654321,7654321,87654321,987654321]\n\tlist_of_all_permutations = []\n\n\tlist_of_pandigs.each do |pandig|\n\t\ttemp_list = []\n\t\tpandig.to_s.each_char do |char|\n\t\t\ttemp_list << char.to_i\n\t\t\tlist_of_all_permutations << temp_list.permutation(temp_list.count).to_a\n\t\tend\n\tend\n\tclean_list = []\n\n\tlist_of_all_permutations.each do |perm|\n\t\tperm.each do |perm2|\n\t\t\t# if is_pandigital(perm2, pandigidictcreator()) == true\n\t\t\t\tclean_list << perm2.join()\n\t\t\t# end\n\t\tend\n\t\t# p perm\n\tend\n\treturn clean_list\nend",
"def pub_hash_reject\n pub_ids = publication.pub_hash[:identifier] || []\n pub_ids.reject { |id| id[:type] == identifier_type }\n end",
"def email_ids\n []\n end",
"def identifiers\n ret = {}\n ret['issn'] = @issn unless @issn.nil? or @issn == ''\n ret['eissn'] = @eissn unless @eissn.nil? or @eissn == ''\n ret['isbn'] = @isbn unless @isbn.nil? or @isbn == ''\n ret['eisbn'] = @eisbn unless @eisbn.nil? or @eisbn == ''\n ret['oclc'] = @oclc unless @oclc.nil? or @oclc == ''\n ret['lccn'] = @lccn unless @lccn.nil? or @lccn == ''\n ret['doi'] = @doi unless @doi.nil? or @doi == ''\n ret['pmid'] = @pmid unless @pmid.nil? or @pmid == ''\n ret['coden'] = @coden unless @coden.nil? or @coden == ''\n ret['sici'] = @sici unless @sici.nil? or @sici == ''\n ret['bici'] = @bici unless @bici.nil? or @bici == ''\n ret['document_id'] = @document_id unless @document_id.nil? or @document_id == ''\n ret['dissertation_number'] = @dissertation_number unless @dissertation_number.nil? or @dissertation_number == ''\n ret['bibcode'] = @bibcode unless @bibcode.nil? or @bibcode == ''\n ret['eric'] = @eric unless @eric.nil? or @eric == ''\n ret['oai'] = @oai unless @oai.nil? or @oai == ''\n ret['nbn'] = @nbn unless @nbn.nil? or @nbn == ''\n ret['hdl'] = @hdl unless @hdl.nil? or @hdl == '' \n ret['naxos'] = @naxos unless @naxos.nil? or @naxos == '' \n ret\n end",
"def property_ids\n result = Array.new\n self.properties.each do |p|\n result << p.id\n end\n result\n end",
"def attach_identifiers(provenance:, affiliation:, result: {}, json: {})\n return affiliation unless affiliation.new_record?\n\n ror_prov = Provenance.where(name: 'ror').first\n\n # First use any identifiers returned by ROR\n if ror_prov.present? && result.present? && (result[:ror].present? || result[:fundref].present?)\n if result[:ror].present?\n affiliation.identifiers << ::Identifier.find_or_initialize_by(\n provenance: ror_prov, category: 'ror', descriptor: 'is_identified_by',\n value: \"https://ror.org/#{result[:ror]}\", identifiable_type: 'Affiliation'\n )\n end\n if result[:fundref].present?\n affiliation.identifiers << ::Identifier.find_or_initialize_by(\n provenance: ror_prov, category: 'fundref', descriptor: 'is_identified_by',\n value: \"https://api.crossref.org/funders/#{result[:fundref]}\",\n identifiable_type: 'Affiliation'\n )\n end\n end\n\n # Otherwise take any identifiers passed in the JSON\n id = json.fetch(:affiliation_id, json.fetch(:funder_id, {}))\n if id.present? && id[:identifier].present?\n identifier = Api::V0::Deserialization::Identifier.deserialize(\n provenance: provenance, identifiable: affiliation, json: id\n )\n affiliation.identifiers << identifier if identifier.present? && identifier.new_record?\n end\n affiliation\n end",
"def minionList\n self['minions'].transform_values {|v| v.pub_key }\n end",
"def kenim_ids\n @kenim_ids = []\n kenim.each do |k|\n @kenim_ids.push( k._id )\n end\n return @kenim_ids\n end",
"def get_all_pdfs\n r = Array.new\n \n p_list = get_party_list(Start_Uri)\n p_list.each do |l1|\n a_list = get_alphabet_list(Parent_Uri + \"/\" + l1[0])\n a_list.each do |l2|\n m_list = get_member_list(Parent_Uri + \"/\" + l2[0])\n m_list.each do |l3|\n l3[0] = Parent_Uri + \"/\" + l3[0]\n l3[2] = l1[1]\n r += [l3]\n end\n end\n end\n\n return r\n end",
"def index\n @exp_entry_identifiers = ExpEntryIdentifier.all\n end",
"def pseud_associations(pseuds)\n puts \" collecting pseud associations\"\n x = []\n pseuds.each do |p|\n print \".\"; STDOUT.flush\n x << p\n x << p.user\n x << p.user.preference\n end\n x\nend",
"def get_affiliations\n affiliations\n end",
"def build_bibliography_list\n result = []\n @citations.each_with_index do |ref, index|\n result << build_bibliography_item(ref, index)\n result << ''\n end\n result\n end",
"def ids\n @ids ||= term.list_ids.sort\n end",
"def personal_creators\n result_array = []\n\n first_names = self.personal_name.name_part_given\n last_names = self.personal_name.name_part_family\n\n names = first_names.zip(last_names)\n\n # NB: When accessing nested arrays of form [[first, second], [first, second]]\n # that are all of even length, array.each do |first, second| grabs both elements\n # out of each nested array in sequence. Did not know this until I looked it up.\n names.each do |first, last|\n result_array << Hash[first: first, last: last]\n end\n\n return result_array\n end",
"def dids_911\n dids_911_list ? dids_911_list.collection : []\n end",
"def ids; @docs.keys end",
"def public_ips\n hwaddr = self.hwaddr\n Hash[\n Meta.connection do\n Meta.interface(hwaddr, 'ipv4-associations/', not_found: '', cache: false).lines.map do |public_ip|\n public_ip.strip!\n unless private_ip = Meta.interface(hwaddr, \"ipv4-associations/#{public_ip}\", not_found: nil, cache: false)\n raise Errors::MetaBadResponse\n end\n [ private_ip, public_ip ]\n end\n end\n ]\n end",
"def index\n @publications = Publication.all.order(:pub_name)\n end",
"def publications\n @publications = Publication.all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @administration }\n end\n end",
"def get_author_list(record)\n author_list = []\n authors_primary = record.find { |f| f.tag == '100' }\n begin\n author_primary = authors_primary.find { |s| s.code == 'a' }.value unless authors_primary.nil?\n rescue StandardError\n ''\n end\n author_list.push(clean_end_punctuation(author_primary)) unless author_primary.nil?\n authors_secondary = record.find_all { |f| f.tag == '700' }\n authors_secondary&.each do |l|\n unless l.find { |s| s.code == 'a' }.nil?\n author_list.push(clean_end_punctuation(l.find { |s| s.code == 'a' }.value)) unless l.find { |s| s.code == 'a' }.value.nil?\n end\n end\n author_list.uniq!\n author_list\n end",
"def fetchIDs\n\n\tFile.open(ARGV[0].to_s, \"r\") do |file|\n\n\t\t\n\t\tbook = Hash.new\n\n\t\tfile.each_line do |line|\n\n\t\t\tcontainer = Array.new\n\n\t\t\tif line.include? \"Name\"\n\n\t\t\t\tcontainer = line.split(\";\")\n\t\t\t\tcontainer.map { |e| book[\"#{e.gsub!(\"Name=\", \"\")}\"] = line if e.include? \"Name=\" } \n\n\t\t\telse\n\t\t\t\tnext\n\t\t\tend\t\n\t\tend\n\n\t\t#puts book.inspect\n\t\tfile_write(\"Helicoverpa.out\", book)\n\tend\t\t\nend",
"def public_keys\n @public_keys\n end",
"def all_school_ids\n PerDistrict.new.school_definitions_for_import.map { |school| school[\"local_id\"] }\n end",
"def id_split(item)\n case item\n when Array then array = item.flat_map { |v| id_split(v) }\n when String then array = item.split(/[ \\t]*[,;\\n]+[ \\t]*/)\n when PublicationIdentifier then array = Array.wrap(item)\n else array = Array.wrap(item).map(&:to_s)\n end\n array.compact_blank!\n end",
"def list_object_ids(output_path, after_timestamp = nil)\n # Capture time in UTC, as snapshot of starting point for ids\n # (back dated a minute to ensure no changes get lost between now and when the query executes)\n start_time = (Time.now - 60).utc.iso8601.gsub!(/:/, '_')\n # Start list file for IDs, in file named with starting point timestamp\n filename = \"id_list_#{start_time}.txt\"\n file_path = File.join(output_path, filename)\n File.open(file_path, 'w') do |file|\n BASE_QUERIES.each do |base_query|\n record_paged_type_query(file, base_query, after_timestamp)\n end\n end\n file_path\n end",
"def client_application_publisher_ids\n return @client_application_publisher_ids\n end",
"def recording_producer_ids\n param_role_extractor(:recording_contributors, :producers)\n end",
"def initialize(collection)\n @identifiers = collection\n end",
"def ids\n @keys ||= []\n end",
"def parse_years_publications year_publications, year\n\t\[email protected]('div.spis-tresci').each do |link|\n\t\t\tpublication_contributions = []\n\t\t\tedition_name = parse_publication_data link, publication_contributions\n\t\t\t\n\t\t\tedition = Publication.new(edition_name, publication_contributions, year)\n\t\t\tyear_publications.push(edition)\n\t\tend\n\tend",
"def identifiers; end",
"def identifiers\n @r.keys.select { |k| k.to_s.start_with? 'identifier__' }.map do |k|\n {\n scheme: k.to_s.sub('identifier__', ''),\n identifier: @r.delete(k),\n }\n end\n end",
"def publications\n typed_exec(<<-SQL)\n SELECT\n pubname::TEXT AS name,\n usename::TEXT AS owner,\n puballtables,\n pubinsert,\n pubupdate,\n pubdelete\n FROM\n pg_publication\n JOIN pg_user ON pubowner = usesysid\n SQL\n end",
"def public_pages\n list = []\n self.div(:id=>\"lhnavigation_public_pages\").links.each do |link|\n list << link.text\n end\n return list\n end",
"def list\n specs = Array.new\n @public_holiday_specifications.each { |phs| specs << phs.to_s }\n specs\n end",
"def member_object_ids\n return [] unless id\n member_objects.map(&:id)\n end",
"def monograph_noid(args = {})\n case\n when args.include?(:identifier)\n identifier_list = [ args[:identifier] ]\n when args.include?(:identifier_list)\n identifier_list = args[:identifier_list]\n else\n return \"\"\n end\n\n # Attempt to retrieve the NOID for the specified identifier\n id2noid_list = {}\n identifier_list.each do |identifier|\n id2noid_list[identifier] = []\n\n # Try each type until success\n [\"isbn\", \"identifier\", \"doi\"].each do |t|\n case\n when t == \"doi\", identifier.start_with?(@@DOI_PREFIX)\n id = identifier.delete_prefix(@@DOI_PREFIX)\n else\n id = identifier\n end\n begin\n response = connection.get(\"noids?#{t}=#{id}\")\n rescue StandardError => e\n e.message\n end\n\n unless response.nil? or !response.success? or response.body.empty?\n id2noid_list[identifier] = response.body.collect { |b| b['id'] }\n break\n end\n end\n end\n return id2noid_list\n end",
"def wp_parse_id_list(list)\n list = wp_parse_list list\n list.map{|i| i.to_i.abs}.uniq\n end",
"def identifiers\n request[:ids]\n end",
"def libraries_id_array\n staff_member_library_ids = []\n self.library.each do |l|\n staff_member_library_ids << l.id\n end\n staff_member_library_ids\n end",
"def workflow_ids\n approval_access = RBAC::Access.new('workflows', 'approve').process\n approval_access.send(:generate_ids)\n\n Rails.logger.info(\"Accessible workflows: #{approval_access.id_list}\")\n\n approval_access.id_list\n end",
"def account_ids()\n return [1, 2]\n end",
"def callout_ids(li_ordinal)\n current_list.inject([]) {|collector, element|\n collector << element[:id] if element[:ordinal] == li_ordinal\n collector\n } * ' '\n end",
"def get_exercises_list\n exercises_list = []\n inst_sections.each do |inst_section|\n exercises_ids = inst_section.inst_book_section_exercises.collect(&:inst_exercise_id).compact\n exercises_objs = InstExercise.where(id: exercises_ids)\n exercises_list.concat exercises_objs.collect(&:short_name)\n end\n return exercises_list\n end",
"def identifiers(filter = Set.new)\n list(filter).entities.map { |ent| ent['occi.core.id'] }\n end",
"def EmpList2014()\n\t\tputs \"\"\n\t\tputs \"Generating List of Persons hired in the year 2014\\n\"\n\t\tcount = @id.size\n\t\tyeartocompare = 2014\n\t\tif(count > 0)\n\t\t\twhile count > 0 do\n\t\t\t\tcount = count-1\t\t\n\t\t\t\tif Date.parse(@hiredate[count].to_s).year == yeartocompare\n\t\t\t\t\t$EmpList2014.push(@id[count])\n\t\t\t\tend\t\n\t\t\tend\n\t\tend\t\n\tend",
"def index\n @sample_identifiers = SampleIdentifier.all\n end",
"def associates_list()\n\t\tassocs = Contract.associates_for(current_user()).all.inject([]) \\\n\t\t\t{ |ret, assoc| ret << ([assoc.username, assoc.id] unless assoc.id == 2) }.compact\n\tend",
"def system_identifiers\n @system_identifiers ||= begin\n skip_key = false\n data = run \"#{utility(:gpg)} #{base_options} \" \\\n \"--with-colons --fixed-list-mode --fingerprint\"\n data.lines.map do |line|\n line.strip!\n\n # process public key record\n if line =~ %r{^pub:}\n validity, keyid, capabilities = line.split(\":\").values_at(1, 4, 11)\n # skip keys marked as revoked ('r'), expired ('e'),\n # invalid ('i') or disabled ('D')\n if validity[0, 1] =~ %r{(r|e|i)} || capabilities =~ %r{D}\n skip_key = true\n next nil\n else\n skip_key = false\n # return both the long and short id\n next [keyid[-8..-1], keyid]\n end\n else\n # wait for the next valid public key record\n next if skip_key\n\n # process UID records for the current public key\n if line =~ %r{^uid:}\n validity, userid = line.split(\":\").values_at(1, 9)\n # skip records marked as revoked ('r'), expired ('e')\n # or invalid ('i')\n if validity !~ %r{(r|e|i)}\n # return the last email found in user id string,\n # since this includes user supplied comments.\n # return nil if no email found.\n email = nil\n str = userid\n while (match = str.match(%r{<.+?@.+?>}))\n email = match[0]\n str = match.post_match\n end\n next email\n end\n # return public key's fingerprint\n elsif line =~ %r{^fpr:}\n next line.split(\":\")[9]\n end\n\n nil # ignore any other lines\n end\n end.flatten.compact\n end\n end"
] | [
"0.70074755",
"0.5659676",
"0.5622354",
"0.5557195",
"0.5547024",
"0.54839015",
"0.54727125",
"0.5467094",
"0.541205",
"0.53949416",
"0.53366274",
"0.5295723",
"0.52737874",
"0.5268007",
"0.52506",
"0.52141464",
"0.5203304",
"0.5198751",
"0.5194605",
"0.5186757",
"0.5181994",
"0.51759416",
"0.5166447",
"0.5151769",
"0.51309144",
"0.5125037",
"0.5103369",
"0.5103076",
"0.5102535",
"0.5102535",
"0.5102535",
"0.5102535",
"0.5095031",
"0.50828207",
"0.5075246",
"0.5075246",
"0.5071496",
"0.50587785",
"0.50474185",
"0.50419825",
"0.50298053",
"0.5024698",
"0.50169677",
"0.50121146",
"0.500929",
"0.49954605",
"0.49945006",
"0.49916938",
"0.49795395",
"0.49681768",
"0.49648383",
"0.4938301",
"0.49332348",
"0.49318227",
"0.49186125",
"0.4915043",
"0.48987824",
"0.48986775",
"0.48908186",
"0.4879383",
"0.48778364",
"0.4873512",
"0.48658735",
"0.4865872",
"0.48620138",
"0.48458976",
"0.4845547",
"0.48437795",
"0.48283783",
"0.48242855",
"0.48230642",
"0.48182875",
"0.48083702",
"0.48049337",
"0.4800379",
"0.4796932",
"0.47950438",
"0.47789985",
"0.47732374",
"0.47690454",
"0.47672817",
"0.47657165",
"0.47636965",
"0.47540054",
"0.47509465",
"0.47444963",
"0.47412103",
"0.47388935",
"0.47378904",
"0.4736578",
"0.4728298",
"0.47247943",
"0.47231266",
"0.47226486",
"0.4722023",
"0.47203314",
"0.47186995",
"0.47179747",
"0.47161984",
"0.47114924"
] | 0.492727 | 54 |
Analyze a string into individual items. | def id_split(item)
case item
when Array then array = item.flat_map { |v| id_split(v) }
when String then array = item.split(/[ \t]*[,;\n]+[ \t]*/)
when PublicationIdentifier then array = Array.wrap(item)
else array = Array.wrap(item).map(&:to_s)
end
array.compact_blank!
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse(str)\n read_items(tokenize(str))\n end",
"def create_items(string)\r\n item_list = {}\r\n string.split(\" \").each { |item| item_list[item] = 1 }\r\n item_list\r\nend",
"def process(items) \n out = []\n \n if items.is_a?(Array)\n items.each do |item|\n out << item.scan(@regex).flatten\n end\n \n elsif items.is_a?(String)\n out = items.scan(@regex).flatten#{|m| m.to_s}\n \n else\n out = items\n end\n \n out.flatten\n end",
"def analyze(str)\n Heuristics.analyze(str, self)\n end",
"def each(&block) # :yield: item\n each_str do |str|\n # yield entry\n yield str_to_entry(str)\n end\n end",
"def each # The Enumerable methods we will be calling this\n\t\tstring.split(\" \").each do |word| # split the string into words (split it on space characters) and process each word\n\t\t\tyield word # Yield the current word to the block that was passed to \"each\"\n\t\tend\n\tend",
"def each \n\t\tstring.split(\" \").each do |word|\n\t\t\tyield word\n\t\tend\n\tend",
"def analyze(str_token, matches)\n @str_token = str_token\n @matches = matches\n @advance_entity_value = nil\n matches << create_entity_item if valid_entity?\n matches\n end",
"def parse str\n self.ss = scanner_class.new str\n self.state ||= nil\n\n do_parse\n end",
"def parse str\n self.ss = scanner_class.new str\n self.state ||= nil\n\n do_parse\n end",
"def parse str\n self.ss = scanner_class.new str\n self.state ||= nil\n\n do_parse\n end",
"def parse str\n self.ss = scanner_class.new str\n self.state ||= nil\n\n do_parse\n end",
"def analyse_string(text)\n current_words = Array.new(depth)\n text_array = split_text_to_array(text)\n until text_array.empty?\n next_word = text_array.shift\n add_words(current_words.dup, next_word)\n current_words.push next_word\n current_words.shift\n end\n end",
"def create_list_of(string_of_items)\n\tary_of_items = string_of_items.split(' ')\n\titem_list = {}\n\tary_of_items.each {|x| item_list[x] = 1}\n\tprint_list(item_list)\nend",
"def parse (str)\n result = []\n i = 0\n\n str.chars.each { |x|\n case x\n when \"i\"\n i += 1\n when \"d\"\n i -= 1\n when \"s\"\n i = i * i\n when \"o\"\n result.push(i)\n end\n }\n return result\nend",
"def process_string(str)\r\n process(StringSource.new(str))\r\n end",
"def parse(str); end",
"def parse_input(input)\n input.split(\"\\n\").map{|name| parse_name(name) }\nend",
"def match_and_parse(string)\n meme = match(string)\n if meme.nil?\n return meme\n end\n bits = parse(meme, string)\n [meme, bits]\n end",
"def many\n ->string, position {\n pos = position\n rets = []\n loop do\n case ret = parse(string, pos)\n when Pass\n rets << ret.matched\n pos = ret.position\n else\n return Pass.new(rets, pos)\n end\n end\n \n }.extend Parsable\n end",
"def create_a_list(string_of_items)\n qty = 1\n grocery_hash = Hash.new\n string_of_items.split(\" \").each do |x|\n grocery_hash[x] = qty\n end\n grocery_hash\nend",
"def parse(text); end",
"def subparse( str )\n parse( str )\n end",
"def each\n @string.split(\" \").each do |word|\n yield word\n end\n end",
"def grocery_itemizer(grocery_string)\n\n\tgroceries = {}\n\n\titemized_array = grocery_string.split\n\n\titemized_array.each do |food|\n\t\tgroceries[food] = 1\n\tend \n\n\treturn groceries\n\nend",
"def create_list(string_of_items)\n hash_of_items = {}\n array_of_items = string_of_items.split(\" \")\n \n array_of_items.each do |item|\n hash_of_items[item] = 1\n end\n hash_of_items\nend",
"def list_it(string) # string = \"this is a 5 worder\"\n string.to_textual.scan(/[\\w'']+/) # => [\"this\", \"is\", \"a\", \"five\", \"worder\"]\n end",
"def each\n string.split(' ').each do |word|\n yield word\n end\n end",
"def each\n string.split(\" \").each do |word|\n yield word\n end\n end",
"def each\n string.split(\" \").each do |word|\n yield word\n end\n end",
"def each\n string.split(\" \").each do |word|\n yield word\n end\n end",
"def grab_all_sins(string)\n # TODO how do we >> strings into the array, but not just one. \n # we need all the possible iterations of regex \n string.scan(SIN_NUMBER) \nend",
"def parse(string)\n data_type, required, name, options_and_description = string.match(/\\A\\[(\\S*)\\](!)?\\s*([\\w\\[\\]]*)\\s*(.*)\\Z/).captures\n allow_multiple = name.gsub!('[]', '')\n\n options, description = options_and_description.match(/\\A(\\[.*\\])?(.*)\\Z/).captures\n options = options ? options.gsub(/\\[?\\]?\\s?/, '').split(',') : []\n\n @name = name\n @description = description\n @type = Type.new([data_type])\n @is_required = required.present?\n @allow_multiple = allow_multiple.present?\n @options = options\n end",
"def parse str\n self.ss = scanner_class.new str\n self.lineno = 1\n self.start_of_current_line_pos = 0\n self.state ||= nil\n\n do_parse\n end",
"def parse str\n self.ss = scanner_class.new str\n self.lineno = 1\n self.start_of_current_line_pos = 0\n self.state ||= nil\n\n do_parse\n end",
"def parse_all\n @raw_string.split( \"\\n\" ).each do |line|\n parse_line( line )\n end\n @all.values\n end",
"def create_list(string)\n\t groceries = string.split(\" \")\n\t list_items = Hash.new\n\t groceries.each do |items|\n\t \tlist_items[items] = 1\n\t end\n list_items\nend",
"def parse_line(str)\n _, color, rest = str.match(/^([\\w\\s]+) bags contain (.+)\\.$/).to_a\n containments = str.scan(/(\\d+) ([\\w\\s]+) bags?/).map { |count, color| Containment.new(color, count.to_i) }\n add(color, containments)\n end",
"def parse str = nil, type = nil\n if str and !str.empty? \n str.split( get_separator( type ) )\n elsif @items and [email protected]?\n @items\n else\n raise ArgumentError.new \"Bad parameter passed to method!\"\n end\n end",
"def parseBeatString(str)\n pattern = []\n scanner = StringScanner.new(str)\n until scanner.pos == str.length\n checkStringElement(scanner, pattern)\n end\n pattern\nend",
"def create_list(items_string)\r\n\titems_array = items_string.split(' ')\r\n\titems_hash = Hash.new\r\n\titems_array.each do |item|\r\n\t\titems_hash[item] = 1\r\n\tend\r\n\treturn items_hash\r\nend",
"def parseBeatString(str)\n pattern = []\n scanner = StringScanner.new(str)\n until scanner.pos == str.length\n checkStringElement(scanner, pattern)\n end\n pattern.ring\nend",
"def create_list(items)\n list = {}\n arr = items.split(' ')#split string into indivdual strings\n arr.each do |item| list[item] = 1 end #iterate over arr in order to pass each string into the list\n \tlist \nend",
"def parse(string, usage)\n companion.parse(string, usage)\n end",
"def get_parse(s);end",
"def parse_inventory(items)\n item_count = Hash.new\n items.split(',').each do |item|\n item = item.split(' ')\n item[1] = pluralize(item[1])\n item_count[item[1]] = item[0]\n end\n item_count\n end",
"def from_string(input)\n values = input.split(' ', 4)\n self.usage = values[0].to_i\n self.selector = values[1].to_i\n self.matching_type = values[2].to_i\n self.data = values[3]\n verify\n end",
"def parse(string)\n string.gsub!(\"\\n\", ' ')\n data_type, required, name, options_and_description = string.match(/\\A\\[(\\S*)\\](!)?\\s*([\\w\\[\\]]*)\\s*(.*)\\Z/).captures\n allow_multiple = name.gsub!('[]', '')\n options, description = options_and_description.match(/\\A(\\[.*\\])?(.*)\\Z/).captures\n options = options ? options.gsub(/\\[?\\]?\\s?/, '').split(',') : []\n\n @id = name\n @description = description if description.present?\n @type = Type.new([data_type])\n @required = required\n @options = options\n end",
"def from(string)\n return unless string.present?\n names = Grammar::NgramFactory.new(string).omnigrams\n names = names.map{|g| g.join ' '} << string\n names = names.uniq - Grammar::LanguageHelper::IDENTIFIERS\n objects = names.map do |name|\n name = (name.split(/\\s+/) - Grammar::LanguageHelper::IDENTIFIERS).compact.join(' ')\n if name.present? && found = like(name) || found = where(name: name).first\n result = SearchResult.new(term: name, result: found)\n end\n end.compact\n objects = objects.select{|obj| obj.result.present?}.uniq || []\n objects.sort{|b,a| b.term.length <=> a.term.length}.map(&:result).last\n end",
"def get_items\n @fdata.scan(SUB_ITEM_REGEXP)\n end",
"def create_list(items_str)\r\n items_hash={}\r\n items_array=items_str.split(\" \")\r\n items_array.each do |it|\r\n items_hash[it]=1\r\n end\r\n print_list(items_hash)\r\nend",
"def process_item_list(item)\n aux_item = item.strip\n\n # remove start [\n if aux_item.start_with?('[')\n aux_item = aux_item[1..aux_item.length]\n end\n\n # remove end ]\n if aux_item.end_with?(']')\n aux_item = aux_item[0..aux_item.length-2]\n end\n\n aux_item\n end",
"def process!(line)\n index!(get_words(clean(line)))\n end",
"def _perform(text)\n lines = text.split(\"\\n\")\n lines.map! {|line|\n line.gsub(/\\[\\[(.)+\\]\\]/i){|found|\n /\\[\\[([a-z_]*): ([a-z_]*)\\]\\]/i =~ found\n _perform(self.send($1.to_sym, $2))\n }\n }\n lines.join(\"\\n\")\n end",
"def list_creation(items_string)\r\n\tshopping_list = {}\r\n\tintit_list = items_string.split(' ')\r\n\tintit_list.each do|item|\r\n\t\tshopping_list[item] = 1\r\n\tend\r\n\tshopping_list\r\nend",
"def do_parse(string)\n raise 'This method should implement a string to hash parser'\n end",
"def new_list (string)\nitem_hash= hash.new\nitem_array = string.split\nitem_array.each do |item|\n item_hash[item] = 1\nend\nitem_hash\nend",
"def extract(str)\n [str]\n end",
"def extract_string(range, strscan); end",
"def stats_from_string(str, number)\n # puts \"\\nStart array: #{str}\\n\\n\"\n a = str.split.sort\n results = {}\n a.each { |c| results[c] = (results[c] || 0) + 1 }\n results['total'] = a.count\n puts \"Occurance in strip #{number}: #{results}\"\n results.each { |key, val| results[key] = \"#{val} / #{results['total']}.0\" }\n # puts \"Probability: #{results}\"\n results\nend",
"def space_separated(str: raise)\n\tfirst_index = 0\n\tlast_index = 0\n\tresults = []\n\n\tstr.size.times do\n\t\tcheck_string = str[first_index..last_index]\n\t\tif DICTIONARY[check_string]\n\t\t\tresults << check_string\n\t\t\tfirst_index = last_index += 1\n\t\t\tlast_index = first_index\n\t\telse\n\t\t\tlast_index += 1\n\t\tend\n\tend\n\n\tputs results.join(\" \")\nend",
"def processraw str, keys\n str.readlines.collect do |l|\n spltline = l.chomp.split \"|\"\n returning Hash.new do |h|\n keys.each_index do |i|\n h[keys[i]] = spltline[i] unless keys[i] == :ignore\n end\n end\n end\n end",
"def processString(str)\n\t\tif isHash?(str) then\n\t\t\treturn { :type => 'phrase', :result => phraseForHash(str) }\n\t\telsif(isHyphenated?(str)) then\n\t\t\tterms = dehyphenatePhrase(str)\n\t\t\treturn { :type => 'hash', :result => hashForPhrase(terms) } unless terms.nil?\n\t\t\treturn { :type => 'unreadable' }\n\t\telse\n\t\t\tterms = str.split(' ')\n\t\t\treturn { :type => 'hash', :result => hashForPhrase(terms) } if phraseLength == terms.length\n\t\t\treturn { :type => 'unreadable' }\n\t\tend\n\tend",
"def check(str)\n [*str].each { |s| @parts.push(check: s) }\n end",
"def parse str = nil\n if str and !str.empty? \n str.split( _separator )\n elsif @items and [email protected]?\n @items\n else\n raise ArgumentError.new \"Bad parameter passed to method!\"\n end\n end",
"def analysis\n @str = params[:text] ||= '解析対象の文字列'\n @words = Tag.counter(Tag.generate(@str))\n end",
"def process\n out = ''\n @filtered.each do |line|\n p = Parser.new(line)\n out += p.process\n end\n out\n end",
"def analyse(string = nil)\n raise(ArgumentError, 'Lexer: failed to start analysis: no source given!') unless\n string || @scanner\n\n self.data = string || @scanner.string\n\n until @scanner.eos?\n send(\"parse_#{MODE[@mode]}\")\n end\n\n push([false, '$end'])\n end",
"def many1\n ->string, position {\n ret = parse(string, position)\n return ret unless ret.pass?\n rest = many.parse string, ret.position\n Pass.new [ret.matched, *rest.matched], rest.position\n }.extend Parsable\n end",
"def parse_text\n text.split(\"\\n\").map { |r| r.scan(/.../) } \n end",
"def string_parser(string_input)\n string_input.lines.each.with_index(1) do | line, index |\n puts \"Line #{index}: #{line}\"\n end\nend",
"def parse(string)\n @input_string = string\n if string.empty?\n self.puts \"Please enter an action.\"\n return\n end # if\n \n words = self.tokenize string\n tokens = Array.new\n \n until words.empty?\n action = words.join(\"_\")\n logger.debug \"#{self.class}: action = #{action}, rest = #{words.inspect}\"\n \n actions = self.leaf.list_all_actions + self.leaf.list_all_aliases\n \n if actions.include? action\n @input_action = @input_string.match(/^#{words.join(\" \")}/i).to_a.first\n @input_args = @input_string.gsub(/^#{@input_action} /i, \"\")\n \n self.leaf.execute_action(action, *tokens)\n return\n end # if\n \n tokens.unshift words.pop\n end # while\n \n self.missing_action(string, [])\n end",
"def string_to_characters(string)\n split_the_string = string.split(//) #take the string, return an array of characters\n result = item_counts(split_the_string) #feed this into the array counting method\nend",
"def words_from_string(string) \t\t\t# downcase returns a lowercase version of a string\n\tstring.downcase.scan(/[\\w']+/)\t\t# scan returns an array of substrings that match a pattern\n\tend",
"def create_list(items_string, quantity = 0)\n list = {}\n items = items_string.split(\" \")\n items.each do |item|\n list[item] = quantity\n end\n list\nend",
"def groceries(string)\n list = {}\n string.split(\" \").each do |item|\n list[item] = 1\n end\n format_list(list)\n list\nend",
"def parse_text(text)\n\n end",
"def analyze(s)\n @lines.push(s)\n return if s == \"\"\n tokens = string_to_symbol_array(s)\n paste_subject(tokens)\n pattern = get_pattern(tokens)\n type, _ = pattern\n \n case type\n when :set_subject\n _, @subject = pattern\n \"OK, lets talk about #{@subject}\"\n\n when :what_is_question\n _, @subject = pattern\n definition = what_is?(@subject)\n if definition != :not_defined\n \"#{a_or_an(@subject).capitalize} #{@subject} is #{a_or_an(definition)} #{definition}\"\n else\n \"I don't know\"\n end\n \n when :what_has_question\n _, @subject = pattern\n components = what_has?(@subject)\n first_part = \"#{a_or_an(@subject).capitalize} #{@subject} has \"\n if components.size == 0\n second_part = \"nothing\"\n else\n a = []\n components.each do |c|\n nr = c[:count]\n name = c[:component]\n if nr == 1\n a.push(\"one #{name}\")\n else\n a.push(\"#{nr} #{pluralis(name)}\")\n end\n end\n second_part = a.join(\", \")\n end\n return first_part + second_part\n \n when :is_a_question\n _, @subject, object = pattern\n is?(@subject, object) ? \"Yes\" : \"No\"\n \n when :has_a_question\n _, @subject, object = pattern\n has?(@subject, object) ? \"Yes\" : \"No\"\n \n when :define_class\n _, @subject, definition = pattern\n if @subject == :noun then return \"A noun must be a noun\" end\n @classes[@subject] = definition\n if what_is?(definition) == :not_defined\n \"OK, what is #{a_or_an(definition)} #{definition}?\"\n else\n \"OK\"\n end\n \n when :define_component\n _, @subject, count, component = pattern\n #puts \"Count: #{count}, component: #{component}\"\n if @components.has_key?(@subject)\n @components[@subject].push({ :component => component, :count => count })\n else\n a = []\n a.push({ :component => component, :count => count })\n @components[@subject] = a\n end\n if what_is?(component) == :not_defined\n \"OK, what is #{a_or_an(component)} #{component}?\"\n else\n \"OK\"\n end\n \n when :dont_understand\n \"I didn't understand that\"\n \n else\n throw \"Did not understand pattern #{pattern}\"\n end\n end",
"def create_list(string)\n\tlist = {}\n\titems_list = string.split(\" \")\n\titems_list.each do |items|\n\t\tlist[items.to_sym] = 1\n\tend\n\tlist\nend",
"def parse_input(input)\n\tinput.split(\" \")\nend",
"def parse(string)\n @stack = [ ParseContainerTag.new { |t| Utility.array_to_s(t.contents) } ]\n tokenize(string)\n stack_up\n @stack.last.to_s\n end",
"def scan(pattern, &blk)\n @string.scan(pattern, &blk)\n end",
"def scan(pattern, &blk)\n @string.scan(pattern, &blk)\n end",
"def parse_types(string)\n types = []\n letters = ['F', 'I', 'L', 'N', 'P', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']\n letters.each_with_index { |letter,index| \n if string.upcase.include?(letter)\n types << index\n end\n }\n types\n end",
"def initial_list(string_of_items)\n grocery_list = {}\n quantity = 1\n items_array = string_of_items.split(\" \")\n items_array.each do |item|\n grocery_list.store(item, quantity)\n end\n grocery_list\nend",
"def process str\n str.each_char do |char|\n # route each character to its state handler\n send(@state, char)\n end\n end",
"def split_by_keywords(affi_string)\n # get the indexes of each element found\n # separate the string using the indexes\n kw_indexes = {} #kewrds array of indexes and lengths\n found_inst = found_country = nil\n\n found_inst = get_institution(affi_string)\n if found_inst != nil then\n kw_indexes[affi_string.index(found_inst)] = found_inst.length\n end\n\n if found_inst == nil then\n found_inst = get_institution_synonym(affi_string)\n if found_inst != nil then\n kw_indexes[affi_string.index(found_inst)] = found_inst.length\n end\n end\n\n found_country = get_country(affi_string)\n if found_country != nil then\n kw_indexes[affi_string.index(found_country)] = found_country.length\n end\n\n found_country_synonym = get_country_synonym(affi_string)\n if found_country_synonym != nil then\n cleared_affi_string = country_exclude(affi_string)\n kw_indexes[cleared_affi_string.index(found_country_synonym)] = found_country_synonym.length\n end\n\n found_faculty = get_faculty(affi_string)\n if found_faculty != nil then\n kw_indexes[affi_string.index(found_faculty)] = found_faculty.length\n end\n\n found_workgroup = get_workgroup(affi_string)\n if found_workgroup != nil then\n kw_indexes[affi_string.index(found_workgroup)] = found_workgroup.length\n end\n\n found_department = get_department(affi_string)\n print \"\\n**\"+found_department.to_s\n if found_department != nil then\n kw_indexes[affi_string.index(found_department)] = found_department.length\n end\n\n affiliation_array = []\n prev_split = 0\n if kw_indexes.count > 0 then\n temp_affi = affi_string\n # Order the indexes to break the affistring in its original order\n kw_indexes = kw_indexes.sort.to_h\n kw_indexes.keys.each do |kw_idx|\n # if the first index 0 make it the first element of the return array\n if affiliation_array == [] and kw_idx == 0 then\n affiliation_array = [temp_affi[kw_idx, kw_indexes[kw_idx]]]\n elsif affiliation_array == [] then\n affiliation_array = [temp_affi[..kw_idx-1]]\n affiliation_array.append(temp_affi[kw_idx, kw_indexes[kw_idx]])\n elsif prev_split < kw_idx then\n affiliation_array.append(temp_affi[prev_split..kw_idx-1].strip)\n affiliation_array.append(temp_affi[kw_idx,kw_indexes[kw_idx]])\n else\n affiliation_array.append(temp_affi[kw_idx,kw_indexes[kw_idx]])\n end\n prev_split = kw_idx + kw_indexes[kw_idx] + 1\n end\n end\n # strip and remove trailing commas in one place instead of with every\n # assignment\n indx = 0\n while indx < affiliation_array.count do\n affiliation_array[indx] = affiliation_array[indx].strip.chomp(\",\").chomp(\";\")\n indx +=1\n end\n # remove leftover nulls\n affiliation_array.delete(\"\")\n return affiliation_array\nend",
"def search(list)\n count = 0\n list.each_line do |string|\n count += 1 if is_a_nice_string?(string)\n end\n count\nend",
"def map_words(input)\n results = []\n input.split.each do |word|\n results << yield(word)\n end\n results\nend",
"def create_list(item_string)\r\n items = item_string.split\r\n grocery_list = {}\r\n items.each do |item|\r\n grocery_list[item] = 1\r\n end\r\n grocery_list\r\nend",
"def add_multiple(string,string_q, hash)\n quantity = string_q.split(\" \")\n n = 0\n string.split(\" \").each do |food|\n add(food, quantity[n], hash)\n n = n + 1\n end\nend",
"def madlib(string)\n names = {}\n string.gsub /\\(\\(.*?\\)\\)/ do |token|\n a, b = *token[2...-2].split(':')\n if names.has_key? a\n names[a]\n elsif b\n names[a] = input(b)\n else\n input(a)\n end\n end\nend",
"def scan_text(&block)\n scan_all(text_criteria, &block)\n end",
"def create_list(string_of_items)\n grocery_list = {}\n grocery_items = string_of_items.split\n grocery_items.each do |item, quantity|\n grocery_list[item] = 1\n end \n return grocery_list\nend",
"def tokenizer(string)\n items = []\n while string.size > 0\n if TOKENS.keys.include?(string[0,1])\n end_index = string.index(TOKENS[string[0,1]], 1)\n raise \"bad end_index for #{string}\" if not end_index\n item = string[0..end_index]\n items << item\n string = string[end_index+1..-1]\n while item.count(item[0,1]) > item.count(TOKENS[item[0,1]])\n end_index = string.index(TOKENS[item[0,1]])\n item << string[0..end_index]\n string = string[end_index+1..-1]\n end\n else\n end_index = string.index(/([\\[({<&*#\"'^\\s]|\\z)/, 1)\n item = string[0..end_index-1].strip\n items << item if not item.empty?\n string = string[end_index..-1]\n end\n end\n items\n end",
"def create_list(string)\r\n list = {}\r\n string.split(' ').each {|item| list[item] = 1}\r\n list\r\nend",
"def normalise_string(string)\n # Is it already one of the methods? If so, easy. If not, split and parse.\n if string == \"_\"\n []\n elsif Col::DB.method? string\n [ string.intern ]\n elsif (1..4).include? string.size # say: \"g\", \"gb\", \"gbow\"\n color, style, backg = extract(string)\n color = Col::DB.color(color) # 'g' -> :green\n style = Col::DB.style(style) # 'b' -> :bold\n backg = Col::DB.background(backg) # 'ow' -> :on_white\n [ color, style, backg ].compact # remove nil elements\n else\n raise Col::Error, \"Invalid item: #{string.inspect}\"\n end\n rescue Col::Error => e\n raise Col::Error, \"Invalid item: #{string.inspect} (#{e.message})\"\n end",
"def parse(s)\n s = clean(s)\n\n words = s.split(' ')\n\n result = []\n\n while !words.empty?\n if words[0] =~ URL_REGEX\n # <url> <text>\n result << {url: read_url(words), text: trim_to_nil(read_text(words))}\n else\n # <text> <url> [<accessed note>]\n entry = read_text(words)\n url = read_url(words)\n accessed_note = read_accessed_note(words)\n if accessed_note\n entry += ' ' + accessed_note\n end\n\n result << {url: url, text: trim_to_nil(entry)}\n end\n end\n\n result\n end",
"def parse_items(items)\n hash = Hash.new\n items.split(',').each { |x| hash[x.split(' ')[1]] = x.split(' ')[0] }\n hash\n end",
"def split_into_flow\n res = []\n current_attr = 0\n\n str_len = @str.length\n\n # skip leading invisible text\n i = 0\n i += 1 while i < str_len and @str[i].chr == \"\\0\"\n start_pos = i\n\n # then scan the string, chunking it on attribute changes\n while i < str_len\n new_attr = @attrs[i]\n if new_attr != current_attr\n if i > start_pos\n res << copy_string(start_pos, i)\n start_pos = i\n end\n\n res << change_attribute(current_attr, new_attr)\n current_attr = new_attr\n\n if (current_attr & @attributes.regexp_handling) != 0 then\n i += 1 while\n i < str_len and (@attrs[i] & @attributes.regexp_handling) != 0\n\n res << RDoc::Markup::RegexpHandling.new(current_attr,\n copy_string(start_pos, i))\n start_pos = i\n next\n end\n end\n\n # move on, skipping any invisible characters\n begin\n i += 1\n end while i < str_len and @str[i].chr == \"\\0\"\n end\n\n # tidy up trailing text\n if start_pos < str_len\n res << copy_string(start_pos, str_len)\n end\n\n # and reset to all attributes off\n res << change_attribute(current_attr, 0) if current_attr != 0\n\n res\n end",
"def parse line\n normalize(@lexer.tokenize(line)).select { |t| t.is_a? String }\n end"
] | [
"0.6571353",
"0.61324406",
"0.6012022",
"0.6001111",
"0.57708174",
"0.5721283",
"0.5712482",
"0.5700286",
"0.55848926",
"0.55848926",
"0.55848926",
"0.55848926",
"0.55169004",
"0.55021626",
"0.5498174",
"0.5491798",
"0.54896516",
"0.5487206",
"0.54256153",
"0.5390878",
"0.5385421",
"0.53608274",
"0.53247344",
"0.5318745",
"0.5316297",
"0.530816",
"0.53011245",
"0.53009313",
"0.5294325",
"0.5294325",
"0.5294325",
"0.5287211",
"0.5286688",
"0.5285693",
"0.5285693",
"0.5275839",
"0.5269905",
"0.5257519",
"0.5255244",
"0.5247704",
"0.5241359",
"0.5233581",
"0.52279437",
"0.52277637",
"0.5227331",
"0.5226443",
"0.52226204",
"0.5221052",
"0.52121437",
"0.5191817",
"0.5191348",
"0.51754177",
"0.5170209",
"0.516098",
"0.51579005",
"0.51543325",
"0.51532835",
"0.514773",
"0.5136083",
"0.5136024",
"0.51354414",
"0.51329666",
"0.51170737",
"0.5115071",
"0.5107732",
"0.51046777",
"0.5101263",
"0.50959945",
"0.50875354",
"0.5076345",
"0.50760293",
"0.5075279",
"0.5074458",
"0.5067089",
"0.50653255",
"0.5060525",
"0.50579065",
"0.5056817",
"0.5054493",
"0.5052156",
"0.5049454",
"0.5040962",
"0.5040962",
"0.5034539",
"0.5022138",
"0.50144696",
"0.5008929",
"0.50028443",
"0.5002267",
"0.50014865",
"0.4994278",
"0.49932128",
"0.49760646",
"0.4970222",
"0.49629578",
"0.4962634",
"0.4959152",
"0.49542788",
"0.49517655",
"0.49499398",
"0.49469724"
] | 0.0 | -1 |
Transform a type/ID pair. | def id_obj(type, id = nil, copy: false, **)
# noinspection RubyMismatchedReturnType
if type.is_a?(PublicationIdentifier)
Log.warn("#{__method__}: ignoring id #{id.inspect}") if id
copy ? type.dup : type
elsif id.is_a?(PublicationIdentifier)
Log.warn("#{__method__}: ignoring type #{type.inspect}") if type
copy ? id.dup : id
elsif type.is_a?(Array)
Log.warn("#{__method__}: ignoring id #{id.inspect}") if id
id = type.compact.join(':')
PublicationIdentifier.cast(id, invalid: true)
else
id = [type, id].compact.join(':')
PublicationIdentifier.cast(id, invalid: true)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def input_id_from_type(type); end",
"def convert_xid(type, id)\n map = {:gid => :group, :uid => :user}\n raise ArgumentError, \"Invalid id type #{type}\" unless map.include?(type)\n ret = Puppet::Util.send(type, id)\n if ret == nil\n raise Puppet::Error, \"Invalid #{map[type]}: #{id}\"\n end\n ret\n end",
"def transform_keys(type)\n @_transform_keys = type.to_sym\n end",
"def redoxify_keys\n transform_keys do |key|\n key = key[0..-1]\n next 'IDType' if %w[id_type IDType].include? key\n next key if key =~ /^([A-Z]{1}[a-z]+)+/\n next key.upcase if key =~ /^[A-Za-z]{2,3}$/\n key.split('_').map(&:capitalize).join\n end\n end",
"def type_id\n\t\ttypes_id = [self.type1, self.type2]\n\t\treturn types_id\n\tend",
"def convert_to_tag(type)\n meth = :\"format_#{type}\"\n if respond_to?(meth, true)\n send(meth)\n else\n _format_input(type)\n end\n end",
"def normalize(type); end",
"def mapped_id\n input_hash = { type => cardname }\n map_card.import_item_class.new(input_hash).map_field type, cardname\n end",
"def apply_type(value)\n converter = self.converter\n value.inject(new_collection) do |hash, keyval|\n hash[keyval[0]] = converter.decode(keyval[1])\n hash\n end\n end",
"def typecast\n @typecast ||= Settler.typecast_for(key)\n end",
"def input_id_from_type(type)\n id = input_name_from_type(type).gsub(/([\\[(])|(\\]\\[)/, \"_\").gsub(/[\\])]/, \"\")\n id = @options[:namespace] + \"_\" + id if @options[:namespace]\n\n id\n end",
"def map_type type\n type\n end",
"def map_type type\n type\n end",
"def value_transform value, type\n return nil if value.nil? || value.to_s.size == 0\n case type\n when :integer then value.to_i\n when :autoincrement then value.to_i\n when :string then value.to_s\n when :float then value.to_f\n when :bool then value.to_s\n when :symbol then value.to_s\n when :marshal then Marshal.dump(value)\n when :array then Yajl::Encoder.encode(value)\n when :hash then Yajl::Encoder.encode(value)\n when :time then Time.parse(value.to_s).strftime(\"%Y.%m.%d %H:%M:%S\")\n when :date then Date.parse(value.to_s).strftime(\"%Y-%m-%d\")\n else value\n end\n end",
"def transform_simple_types(types)\n @types ||= {}\n types.each do |type|\n @types[type.name.to_sym] = type\n end\n end",
"def get_typename_from_id(id)\n case id.chars[0]\n when 'T'\n 'trackId'\n when 'A'\n 'artistId'\n when 'B'\n 'albumId'\n when 'L'\n 'curatedStationId'\n else\n 'stationId'\n end\n end",
"def transform_id fields,row\n return row unless fields[@id]\n i = fields[@id]\n /(?<id>\\w+)@.*/ =~ row[i]\n row[i] = id if id\n return row\n end",
"def cast_types; end",
"def map_integer(ident, &block) ; map_primitive(:integer, ident, &block) ; end",
"def convert_type(type)\n return TYPE_CONVERTER[type]\n end",
"def identifier_type_mapping_obj\n return nil if identifier_type.blank?\n\n IdentifierTypesToMapping[identifier_type]\n end",
"def structure_id\n structure_before_type_cast\n end",
"def fk_to_type(fk)\n fk[-8..-1] == \"_type_id\" ? fk.remove(\"_type_id\") : fk.remove(\"_id\")\n end",
"def __convert(key); end",
"def make_id_to_stanza\n build_hash('id', nil)\n end",
"def udid2(udid2)\n tab_hash = udid2.split(';')\n @type = tab_hash[0]\n\n return 'error_type' if @type != @@type\n\n @mode = tab_hash[1]\n\n if @mode == 'h' && tab_hash.length == 4\n @hash = tab_hash[2]\n @number = tab_hash[3]\n elsif @mode == 'c' && tab_hash.length == 8\n to_udid2 tab_hash[2],tab_hash[3], tab_hash[4], tab_hash[5][1..6], tab_hash[6]\n else\n return 'error mode'\n end\n\n end",
"def convert__id(v, opts = {})\n to_oid(v, opts[:id])\n end",
"def id_to_cast!\n @id_to_cast = make_id_to_cast\n self\n end",
"def from_id(id, type=DEFAULT_ID_TYPE)\n case type\n when :inchikey\n url = \"http://www.chemspider.com/InChI.asmx/InChIKeyToInChI?inchi_key=\" + URI::encode(id)\n doc_string = retrieve_info_from_url(url)\n doc = REXML::Document.new( doc_string )\n inchi_string = doc.root.children.first.to_s\n raise(ArgumentError, \"did not retrieve a valid inchi string\") unless inchi_string[/^InChI=/]\n from_string(inchi_string, :inchi)\n when :lmid # lipidmaps id\n url = \"http://www.lipidmaps.org/data/LMSDRecord.php?OutputType=SDF&Mode=File&LMID=\" + id\n doc_string = retrieve_info_from_url(url)\n from_string(doc_string, :sdf)\n end\n end",
"def toid(value)\n merge(toid: value.to_s)\n end",
"def convert_to(value, type, path = nil)\n path = Path.new(path) unless path.kind_of?(Path)\n case type.object_id\n when Integer.object_id\n raise Error.new(Error::WrongType, path) unless value.respond_to?(:to_i)\n value.to_i\n when Float.object_id\n raise Error.new(Error::WrongType, path) unless value.respond_to?(:to_f)\n value.to_f\n when Array.object_id\n # FIXME: Should allow more flexible kinds of lists (with spaces).\n value.to_s.split\n when String.object_id\n value.to_s\n else\n raise Error.new(Error::WrongType, path) unless type.respond_to?(:from_str)\n type.from_str(value)\n end\n end",
"def conv_itype(itype)\n case itype\n when 'concept' : itype\n when 'query_doctrack' : 'query'\n else 'document'\n end\nend",
"def convert_id(token_ct)\n case token_ct\n when \"break\"\n return Tokenable::TK_BREAK\n when \"char\"\n return Tokenable::TK_CHAR\n when \"double\"\n return Tokenable::TK_DOUBLE\n when \"else\"\n return Tokenable::TK_ELSE\n when \"for\"\n return Tokenable::TK_FOR\n when \"if\"\n return Tokenable::TK_IF\n when \"int\"\n return Tokenable::TK_INT\n when \"return\"\n return Tokenable::TK_RETURN\n when \"struct\"\n return Tokenable::TK_STRUCT\n when \"void\"\n return Tokenable::TK_VOID\n when \"while\"\n return Tokenable::TK_WHILE\n else\n return Tokenable::TK_ID\n end\n end",
"def id_mapping_types\n @id_mapping_types ||= extract_classes_with_true(:track_imported_ids, configuration)\n end",
"def convert_id(opts)\n opts = opts.clone\n req = build_soap! do |type, builder|\n if(type == :header)\n else\n builder.nbuild.ConvertId {|x|\n }\n end\n end\n do_soap_request(req)\n end",
"def normalize_id(a)\n case a\n when Integer\n a\n when Array\n a.map{ |e| normalize_id(e) }\n else\n normalize(a).id\n end\n end",
"def canonicalize(type)\n canonicalize_hash(@typedefs, type)\n end",
"def MapOracleToOSSCR_RelationshipSubjObjType(type)\n type.gsub!(\"PERSON\",\"INDIVIDUAL\") if (type==\"PERSON\")\n type.gsub!(\"ORGANIZATION\",\"INSTITUTION\") if (type==\"ORGANIZATION\")\n return type\nend",
"def type_id\n @type_id ||= extract_int(@content[0...TYPE_SIZE])\n end",
"def type1s_attributes=(attributes)\n attributes.each do |key, attribute_collection|\n unless attribute_collection.has_key? 'id'\n Type1.transaction do\n type1 = Type1.find_or_create_by!(attribute_collection)\n type1s << type1 unless type1s.include? type1\n attributes[key]['id'] = type1.id.to_s\n end\n end\n end\n super\n end",
"def type_cast(value, type = self.type)\n case type\n when :counter\n type_cast(value, :integer).to_i\n when :integer\n Kernel::Integer(value) rescue nil if value\n when :float\n Kernel::Float(value) rescue nil if value\n when :timestamp\n value = type_cast(value, :integer)\n Time.at(value) if value\n else\n value\n end\n end",
"def type1s_attributes=(attributes)\n attributes.each do |key, attribute_collection|\n next if attribute_collection.has_key? 'id'\n\n Type1.transaction do\n type1 = Type1.find_or_create_by!(attribute_collection)\n type1s << type1 unless type1s.include? type1\n attributes[key]['id'] = type1.id.to_s\n end\n end\n super\n end",
"def type_id(test_case)\n type_ids = [1]\n if ENV['TYPE_MAPPING_FILE'] && File.exists?(ENV['TYPE_MAPPING_FILE'])\n type_mappings = YAML.load(File.read(ENV['TYPE_MAPPING_FILE']))\n type_ids += test_case.tags.select{|tag| tag.name =~/type/}.map{|t| type_mappings.index_of(/type_(\\S+)/.match(t.name)[1])+1}\n else\n type_ids << 7 if test_case.tags.any?{|tag| tag.name =~/manual/}\n type_ids << 13 if test_case.tags.any?{|tag| tag.name =~/on_hold/}\n end\n type_ids.sort.last\n end",
"def to_global_id(type_name, id)\n Base64.strict_encode64(\"#{type_name}-#{id}\")\n end",
"def transform(parsed_query)\n parsed_query.inject({}) do |all, (key, value)|\n if node = MAP[key]\n field = node[:field]\n all[field] = convert(value, node[:type])\n end\n all\n end\n end",
"def mapping(name, pairs)\n transforms[name.to_sym] = construct_mapping(pairs)\n end",
"def make_id_to_name\n build_hash('id', 'name')\n end",
"def make_name_to_id\n build_hash('name', 'id')\n end",
"def convert_to_ruby_types(hash) \n hash.keys.each do |key|\n value = hash[key]\n next unless value # Leave nils as nils\n case key\n when 'uid', 'aid'; hash[key] = value.to_i\n when 'created_at'; hash[key] = DateTime.parse(value)\n when 'deleted'; hash[key] = value == 't'\n when 'value'; hash[key] = BigDecimal.new(value)\n when 'count'; hash[key] = value.to_i\n when 'period'\n value =~ /\"(.*?)\",\"(.*?)\"/\n hash[key] = [DateTime.parse($1), DateTime.parse($2)]\n end\n end\n hash\nend",
"def typecast_value(type, value)\n if value.is_a?(ActiveAttr::MultiAttr)\n typecast_multiattr(type, value)\n elsif typecaster = TYPECASTERS[type]\n typecaster.new.call(value)\n end\n end",
"def transform\r\n trans(:class => SimpleXMIMetaModel::UML::Clazz)\r\n end",
"def determine_type(xml)\n id_element = xml.scan(/<id.*?\\/id/).first\n matches = id_element.scan(TYPE_MATCH).flatten\n\n matches.join '_'\n end",
"def value_with_typecast\n if values == \"boolean\"\n value == \"true\" ? true : false\n elsif values.is_a?(Hash) && values[\"ids\"] == \"id\"\n value.to_i\n else\n value\n end\n end",
"def typed_id\n self.class.name + ':' + self.id.to_s\n end",
"def convert_data_field_codes_to_id_strings!\n self.data = convert_data_field_codes_to_id_strings(self.data)\n end",
"def convert_data_field_codes_to_id_strings!\n self.data = convert_data_field_codes_to_id_strings(self.data)\n end",
"def to_id\n\t\treturn self.\n\t\t\tgsub(\"::\", \"\").\n\t\t\tgsub(/([A-Z]+)([A-Z][a-z])/,'\\1_\\2').\n\t\t\tgsub(/([a-z\\d])([A-Z])/,'\\1_\\2').\n\t\t\tdowncase.\n\t\t\tgsub(\"_\", \"-\")\n\tend",
"def extract_id_line model_attributes, line,item,dtypes\n #look if id is mapped to another field\n id_keys = model_attributes.to_hash.keys\n #hotfix..bad performance\n id_keys.map!{|k| k.to_s }\n id_key= id_keys.select{|k| k =~/^(ID|id|iD|Id)$/ }\n if id_key.empty?\n line[:id] = item.id\n else\n line[:id] = eval(\"item.#{model_attributes[id_key[0].to_sym]}\")\n #set the correct datatype for it\n dtypes[\"id\"]= dtypes[id_key[0]]\n #remove the id line\n line.delete id_key[0]\n end\n end",
"def coerce_to(klazz)\n api.read_uuid(uuid, CoercionHandler.new(api, klazz))\n end",
"def coerce(first, second)\n @map[[first.class, second.class]].call(first, second)\n end",
"def normalize_link_id(id); end",
"def map_image_id(image)\n name, _ = image.name.split(/ \\d/, 2)\n other = image.name.gsub(Regexp.new(\"^#{name} ?\"), '')\n version, extra = other.split(/ +/, 2)\n [name, { version => { :id => image.id, :extra => extra } } ]\n end",
"def determine_type_formula(id_array) #(item1, item2)\n type_array = id_array.collect {|id| $data_items[id].mix_type }\n type_values = type_array.collect {|type| get_mix_type_value(type) }\n type_values.sort!\n return @type_formula[type_values]\n end",
"def typecast_attributes\n @attributes.each_pair do |name,value|\n # skip primary key columns\n # ajay Singh --> skip the loop if attribute is null (!name.present?)\n next if (name == \"id\") or (!name.present?)\n attr_type = attr_type_for(name)\n \n # empty attributes should stay empty (e.g. an empty int field shouldn't be typecast as 0)\n if [:datetime, :datetimecombo, :int].include? attr_type && (value.nil? || value == '')\n @attributes[name] = nil\n next\n end\n \n case attr_type\n when :bool\n @attributes[name] = (value == \"1\")\n when :datetime, :datetimecombo\n begin\n @attributes[name] = DateTime.parse(value)\n rescue\n @attributes[name] = value\n end\n when :int\n @attributes[name] = value.to_i\n end\n end\n @attributes\n end",
"def make_all!\n id_to_name!.id_to_cast!.id_to_stanza!.name_to_id!\n end",
"def convert_to(ary, type)\n new = []\n ary.each_index do |row|\n new << ary[row].collect {|elem| elem.send(type)}\n end\n new\n end",
"def coerce_type_to_symbol\n @type = @type.to_sym\n end",
"def name_and_id_from_options(options, type) #:nodoc:\n options[:name] = (options[:prefix] || DEFAULT_PREFIX) + (options[:discard_type] ? '' : \"[#{type}]\")\n options[:id] = options[:name].gsub(/([\\[\\(])|(\\]\\[)/, '_').gsub(/[\\]\\)]/, '').gsub(/\\./, '_').gsub(/_+/, '_')\n end",
"def convert_ids(list, input, output)\n begin\n ids = fetch_conversion_job(create_conversion_job(list, input, output))\n ids = ids.split(\"\\n\")\n rescue StandardError => e\n puts e.message, e.backtrace\n retry\n end\n result = {}\n ids.drop(1).each do |id|\n id = id.split(\"\\t\")\n id.drop(1).each do |i|\n result[id[0]] ||= []\n result[id[0]] += i.split(';').map(&:strip).map { |x| (x.empty? || x =~ /^-$/) ? nil : x.upcase }\n end\n end\n result\n end",
"def make_id\n \"#{self.class.name.downcase}#{id}\"\n end",
"def name_and_id_from_options(options, type) #:nodoc:\n options[:name] = (options[:prefix] || DEFAULT_PREFIX) + (options[:discard_type] ? '' : \"[#{type}]\")\n options[:id] = options[:name].gsub(/([\\[\\(])|(\\]\\[)/, '_').gsub(/[\\]\\)]/, '').gsub(/\\./, '_').gsub(/_+/, '_')\n end",
"def id_type(arg = nil)\n set_or_return(\n :id_type, arg,\n :kind_of => String,\n :equal_to => check_pairs.values.flatten.uniq,\n :default => check_pairs[check_type].first,\n :callbacks => {\n 'is a valid id_type for check_type' => lambda do |spec|\n check_pairs[check_type].include?(spec) || check_type == 'system'\n end,\n }\n )\n end",
"def transform(value, instance); end",
"def mapping(value)\n case value\n when :accession_number\n :identifier\n when :reference\n :part_of\n else\n value\n end\n end",
"def link_type(hash1, hash2)\n return hash1 if hash2.nil?\n return hash2 if hash1.nil?\n\n current = hash1\n\n while current.has_key?('.subtype')\n current = current['.subtype']\n end\n current['.subtype'] = hash2\n return hash1\nend",
"def link_type(hash1, hash2)\n return hash1 if hash2.nil?\n return hash2 if hash1.nil?\n\n current = hash1\n\n while current.has_key?('.subtype')\n current = current['.subtype']\n end\n current['.subtype'] = hash2\n return hash1\nend",
"def type2type(type)\n case type\n when :char, :int8\n Fiddle::TYPE_CHAR\n when :uchar, :uint8\n -Fiddle::TYPE_CHAR\n when :short, :int16\n Fiddle::TYPE_SHORT\n when :ushort, :uint16\n -Fiddle::TYPE_SHORT\n when :int, :int32\n Fiddle::TYPE_INT\n when :uint, :uint32\n -Fiddle::TYPE_INT\n when :bool\n Fiddle::TYPE_INT\n when :long\n Fiddle::TYPE_LONG\n when :ulong\n -Fiddle::TYPE_LONG\n when :long_long, :int64\n Fiddle::TYPE_LONG_LONG\n when :ulong_long, :uint64\n -Fiddle::TYPE_LONG_LONG\n when :float\n Fiddle::TYPE_FLOAT\n when :double\n Fiddle::TYPE_DOUBLE\n when :size_t\n Fiddle::TYPE_SIZE_T\n when :string, :pointer\n Fiddle::TYPE_VOIDP\n when :void\n Fiddle::TYPE_VOID\n else\n raise \"unknown type #{type}\"\n end\n end",
"def setup_type_convertor_map\n super\n @type_convertor_map[Java::JavaSQL::Types::INTEGER] = @type_convertor_map[Java::JavaSQL::Types::BIGINT]\n @basic_type_convertor_map[Java::JavaSQL::Types::INTEGER] = @basic_type_convertor_map[Java::JavaSQL::Types::BIGINT]\n @type_convertor_map[Java::JavaSQL::Types::DATE] = lambda do |r, i|\n if v = r.getString(i)\n Sequel.string_to_date(v)\n end\n end\n @type_convertor_map[Java::JavaSQL::Types::BLOB] = lambda do |r, i|\n if v = r.getBytes(i)\n Sequel::SQL::Blob.new(String.from_java_bytes(v))\n elsif !r.wasNull\n Sequel::SQL::Blob.new('')\n end\n end\n end",
"def typecast_ot_to_ot(ot)\n hash = {}\n ot.each do |k,v|\n tc = self.class.typecasts[k]\n hash[k] = (tc && tc[:ot_as]) ? typecast(tc[:ot_as], v) : v\n end\n hash\n end",
"def convert\n unless should_convert?\n return { _existing_object_id: array.object_id }\n end\n\n dumped_ids << array.object_id\n\n result = array.map do |item|\n UniversalDumper.convert(item, dumped_ids)\n end\n\n {\n _old_object_id: array.object_id,\n _object_data: result\n }\n end",
"def to_key\n key = id\n [key] if key\n end",
"def transform_values!; end",
"def transform\n {\n 'name' => names,\n 'org' => org,\n 'other' => other_data,\n 'associates' => associates,\n 'xref' => xref,\n\n # these are lists with zero or more members; duplicates allowed; member order is arbitrary (so we pick\n # a standardized order for list comparison purposes)\n 'phones' => phones,\n 'addresses' => addresses,\n 'emails' => emails,\n 'links' => links\n }.reject {|k,v| v.nil? || v.empty?}\n end",
"def convert_key(key); end",
"def convert_key(key); end",
"def convert_key(key); end",
"def id2(index)\n i = get_field_index_by_external_id(index,@fields[:id_2])\n fields(index, i).to_i unless i.nil?\n end",
"def address_as_ids(type)\n ad = address(type)\n begin\n ad.nil? ? nil : \"#{ad.country.id}$#{ad.city.id}$#{ad.street1}$#{ad.street2}$#{ad.address_type}\"\n rescue\n \"0$0$0$0$0\"\n end\n end",
"def setpostypeid(value)\r\n setvalue(SVTags::POS_TYPE_ID, value)\r\n end",
"def relay(array, data_type)\n array.map(&:\"to_#{data_type}\")\nend",
"def guess_identifier_type ident\n # Note identifier normalisation in HydraDurham::IdentifierNormalisation.\n # These rules are a little excessive assuming normalisation has been done\n # already since website form identifires shouldn't be present anymore.\n # However it won't hurt to be prepared for those as well.\n rules=[{regex: /^doi:(.*)/i, type: 'DOI', value: '\\1' },\n {regex: /^info:doi\\/(.*)/i, type: 'DOI', value: '\\1' },\n {regex: /^.*dx\\.doi\\.org\\/(.*)/i, type: 'DOI', value: '\\1' },\n {regex: /^ark:(.*)/i, type: 'ARK', value: 'ark:\\1' },\n {regex: /^arxiv:(.*)/i, type: 'arXiv', value: 'arXiv:\\1'},\n {regex: /^.*arxiv\\.org\\/[^\\/]+\\/(.*)/i, type: 'arXiv', value: 'arXiv:\\1'},\n 'issn', 'isbn', 'istc', 'lissn',\n {prefix: 'urn:lsid:', type: 'LSID', keep_prefix: true}, 'pmid',\n {regex: /^purl:(.*)/i, type: 'PURL', value: '\\1'},\n {regex: /(.*([\\W]|^)purl\\W.*)/i, type: 'PURL', value: '\\1'},\n 'upc',\n {prefix: 'urn', type: 'URN', keep_prefix: true}, # urn should be after LSID because LSID also starts with urn\n {regex: /(https?:)(.*)/i, type: 'URL', value: '\\1\\2'} ,\n {regex: /(.*)/, type: 'Handle', value: '\\1'} \n ]\n\n rules.each do |rule|\n if rule.class==String\n rule={ prefix: \"#{rule}:\", type: rule.upcase }\n end\n if rule.key? :regex\n if rule[:regex] =~ ident\n return { id_type: rule[:type], id: (ident.sub rule[:regex], rule[:value])}\n end\n else\n if ident.downcase.start_with?(rule[:prefix])\n if rule[:keep_prefix]\n return { id_type: rule[:type], id: ident }\n else\n return { id_type: rule[:type], id: ident[(rule[:prefix].length) .. -1]}\n end\n end\n end\n end\n end",
"def to_key\n [id.to_s]\n end",
"def translate(record)\n record['id'] = record.delete('_id') if !record.nil?\n Lynr::Model::Dealership.inflate(record)\n end",
"def initialize(type, id)\n @type = type.to_s\n @id = id.to_s\n end",
"def initialize(type, id)\n @type = type.to_s\n @id = id.to_s\n end",
"def convert_keys_to_id(params, *keys_to_change)\n return params if keys_to_change.nil? || params.nil?\n keys_to_change.each do |k|\n v = params.delete(k)\n params[(k.to_s << '_id').to_sym] = v unless v.blank? # resinsert value but with _id added to key\n end\n return params\n end",
"def change_id(attrs)\n if attrs.kind_of?(Hash)\n attrs['id'] = attrs['_id'].to_s\n end\n attrs\n end",
"def normalise_type(type, length)\n\trails_type = case type\n\t when /^Auto ?Counter$/\n\t 'integer'\t # REVISIT: Need to detect surrogate ID fields and handle them correctly\n\n\t when /^Unsigned ?Integer$/,\n\t /^Integer$/,\n\t /^Signed ?Integer$/,\n\t /^Unsigned ?Small ?Integer$/,\n\t /^Signed ?Small ?Integer$/,\n\t /^Unsigned ?Tiny ?Integer$/\n\t length = nil\n\t 'integer'\n\n\t when /^Decimal$/\n\t 'decimal'\n\n\t when /^Fixed ?Length ?Text$/, /^Char$/\n\t 'string'\n\t when /^Variable ?Length ?Text$/, /^String$/\n\t 'string'\n\t when /^Large ?Length ?Text$/, /^Text$/\n\t 'text'\n\n\t when /^Date ?And ?Time$/, /^Date ?Time$/\n\t 'datetime'\n\t when /^Date$/\n\t 'datetime'\n\t when /^Time$/\n\t 'time'\n\t when /^Auto ?Time ?Stamp$/\n\t 'timestamp'\n\n\t when /^Money$/\n\t 'decimal'\n\t when /^Picture ?Raw ?Data$/, /^Image$/, /^Variable ?Length ?Raw ?Data$/, /^Blob$/\n\t 'binary'\n\t when /^BIT$/\n\t 'boolean'\n\t else type # raise \"ActiveRecord type unknown for standard type #{type}\"\n\t end\n\t[rails_type, length]\n end",
"def search_item_ids_to_objects(item_ids, result_type)\n ServiceCatalographer::Mapper.item_ids_to_model_objects(item_ids, result_type)\n end",
"def id_types\n identifiers.map(&:type).uniq\n end"
] | [
"0.6249735",
"0.560366",
"0.5436727",
"0.53246623",
"0.52630454",
"0.5199958",
"0.5194698",
"0.5185302",
"0.5181757",
"0.51506406",
"0.51489824",
"0.5140712",
"0.5140712",
"0.5129856",
"0.5127464",
"0.51192814",
"0.5117716",
"0.5096962",
"0.5059687",
"0.505819",
"0.50546414",
"0.5053294",
"0.5042271",
"0.5022756",
"0.5013453",
"0.49769652",
"0.4968318",
"0.49666613",
"0.49508506",
"0.49403504",
"0.49271744",
"0.4923288",
"0.4922478",
"0.4919442",
"0.49173394",
"0.49055275",
"0.487178",
"0.48692963",
"0.48240697",
"0.4818818",
"0.48173603",
"0.48104948",
"0.4792638",
"0.4784156",
"0.47829366",
"0.47659305",
"0.47319227",
"0.47304416",
"0.47173116",
"0.47148687",
"0.47134712",
"0.47120696",
"0.47081444",
"0.47006306",
"0.46732855",
"0.46732855",
"0.4658599",
"0.46559846",
"0.4653098",
"0.46389887",
"0.46306917",
"0.46254984",
"0.46158302",
"0.4614116",
"0.4611433",
"0.46090552",
"0.4609014",
"0.46036327",
"0.45984662",
"0.45969465",
"0.4596418",
"0.45930186",
"0.45921344",
"0.45914656",
"0.4590206",
"0.45899618",
"0.45848206",
"0.4581739",
"0.45793116",
"0.4570139",
"0.45650083",
"0.45484975",
"0.45371383",
"0.45361188",
"0.45361188",
"0.45361188",
"0.45346427",
"0.45316234",
"0.45269468",
"0.45267835",
"0.45239028",
"0.45214134",
"0.45143616",
"0.4511764",
"0.4511764",
"0.4511019",
"0.45091522",
"0.450736",
"0.450371",
"0.45021072"
] | 0.5013483 | 24 |
Extract and print specified data. | def xml_to_string(xml)
return if xml.nil?
output = $data.each.map do |key, value|
"#{key.to_str}:#{xml.elements[value].text.to_f}"
end
output.join(' ')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def printData()\n puts @data\n end",
"def process_data(data)\n print_headline\n tmp = data.dup\n\n # TELNETコマンドを抽出しダンプする.\n tmp.gsub!(/#{IAC}(\n [#{DONT}#{DO}#{WONT}#{WILL}].|\n #{SB}.(#{IAC}#{IAC}|[^#{IAC}])*#{IAC}#{SE}|\n [#{NOP}-#{GA}#{0.chr}-#{239.chr}]\n )/xon){\n case $1[0].chr\n when DONT; print \"> IAC DONT #{$1[1]}\\n\"\n when DO ; print \"> IAC DO #{$1[1]}\\n\"\n when WONT; print \"> IAC WONT #{$1[1]}\\n\"\n when WILL; print \"> IAC WILL #{$1[1]}\\n\"\n when SB ; print \"> IAC SB #{$1[1]} #{$1[2..-3].dump} IAC SE\\n\"\n else ; print \"> IAC #{$1[1]}\\n\"\n end\n }\n\n # 残りの部分を出力.\n tmp.each { |line| print line.dump, \"\\n\" } if tmp.size > 0\n end",
"def output(data); end",
"def DisplayResults(data)\n\t\n\tputs \"Street Address: #{data[0]}\"\n\tputs \"Last Year Assessed Value: $#{data[1]}\"\n\tputs \"Current Assessed Value: $#{data[2]}\"\n\tputs \"Exemption: $25,000\"\n\tputs \"Taxable Value: $#{data[2]-25000}\"\n\tputs \"Tax Rate (per $1,000): $10.03\"\n\tputs \"Due: $#{data[3]}\"\nend",
"def print_doc(data)\n print \"Documento #{data['id']} Status: #{data['status']} Nível do Sentimento: #{data['sentiment_score']} \\r\\n\"\n print 'Temas encontrados:', \"\\r\\n\"\n data['themes'].nil? or data['themes'].each do |theme|\n print ' ', theme['title'], ' (sentimento: ', theme['sentiment_score'], ')', \"\\r\\n\"\n end\n print 'Entidades encontradas:', \"\\r\\n\"\n data['entities'].nil? or data['entities'].each do |entity|\n print ' ', entity['title'], ' : ', entity['entity_type'], ' (sentimento: ', entity['sentiment_score'], ')', \"\\r\\n\"\n end\n\n print 'Categorias:', \"\\r\\n\"\n data['auto_categories'].nil? or data['auto_categories'].each do |entity|\n print ' ', entity['title'], ' : ', entity['type'], ' (Força: ', entity['strength_score'], ')', \"\\r\\n\"\n\n print 'Subcategorias:', \"\\r\\n\"\n data['categories'].nil? or data['categories'].each do |c|\n print ' ', c['title'], ' : ', entity['type'], ' (Força: ', entity['strength_score'], ')', \"\\r\\n\"\n end\n end\n\n print \"\\r\\n\"\n end",
"def print_contents\n\t\tputs \"Artist: %s\" % [@artist]\n\t\tputs \"Album: %s\" % [@title]\n\t\tputs \"Released: %s\" % [@year]\n\n\t\tif @cd_count > 0\n\t\tputs \"CD(%d): %s\" % [@cd_count, @cd_id]\n\t\tend\n\n\t\tif @tape_count > 0\n\t\tputs \"Tape(%d): %s\" % [@tape_count, @tape_id]\n\t\tend\n\n\t\tif @vinyl_count > 0\n\t\tputs \"Vinyl(%d): %s\" % [@vinyl_count, @vinyl_id]\n\t\tend\n\n\tend",
"def text\n\t\t\t@data[\"extract\"]\n\t\tend",
"def print_data(friendly_name, data)\n if $should_print_friendly\n $stdout.puts \"#{friendly_name} #{data}\"\n else\n $stdout.puts \"#{data}\"\n end\nend",
"def print\n puts @text\n end",
"def print\n puts @subject\n puts @text\n end",
"def show_data(param)\n\tparam.each do |k,v|\n\t\tputs \"#{k} : #{v}\"\n\tend\nend",
"def print_details\n puts \"\"\n puts \"#{@fullname}\"\n puts \"---------\" ' '\n puts \"Date of Birth:#{@dob}\"\n \n puts \"\"\n puts \"Email addresses:\"\n @emails.each do |e|\n puts \"- \" + e.to_s\n end \n \n puts \"\"\n puts \"Phone Numbers:\"\n @phone_numbers.each do |n|\n puts \"- \" + n.to_s\n end\n end",
"def print_details()\n\t$details.each {|k, v| puts \"#{k}: #{v}\"}\nend",
"def print\n unless success?\n return nil\n end\n nlen = \"Name\".length\n clen = \"Craft\".length\n @data['people'].each do |p|\n nlen = p['name'].length > nlen ? p['name'].length : nlen\n clen = p['craft'].length > clen ? p['craft'].length : clen\n end\n\n print_header(nlen, clen)\n @data['people'].each do |p|\n print_line(nlen, p['name'], clen, p['craft'])\n end\n end",
"def detailed\n if (@data.length > 0)\n mygrade = grade || \"\"\n puts \"#{@type}: #{mygrade}\"\n for datum in @data\n puts \"\\t#{datum}\"\n end \n return true\n end\n end",
"def inspect\n \"#{to_s.chomp(\">\")} @data=#{data.inspect}>\"\n end",
"def _print_out data\n\t\tresponse << \"Someone said: #{data}\"\t\t\t\n\tend",
"def show_info()\n\t\tputs \"ID: #{@@id}\"\n\t\tputs \"Name: #{@car_name}\"\n\t\tputs \"Make: #{@@make}\"\n\t\tputs \"Cost: #{calc_total_cost} INR\"\n\t\tputs\n\t\tputs \"Review: #{@review}\"\n\t\tputs \"Rating: #{@rating} stars\"\n\tend",
"def print\n\t\tif self.length == 0\n\t\t\tputs \"empty\"\n\t\telse\n\t\t\tself.full_scan { |item| puts item.data }\n\t\tend\n\tend",
"def print\n\t\tif self.length == 0\n\t\t\tputs \"empty\"\n\t\telse\n\t\t\tself.full_scan { |item| puts item.data }\n\t\tend\n\tend",
"def outputs data\n data.each do |data|\n #puts \"DATA: #{data.inspect}\"\n #puts \" data mapping: #{data.map}\"\n #puts \"-----\"\n data.output\n end\nend",
"def display_data\n\t\t\t\"#{@model} #{@color} #{@horsepower} #{@year} #{@brand} #{@mpg}\"\n\t\tend",
"def show(url_data)\n puts reverse_s(/#_#.+?#_#/m.match(reverse_s(open(\"log/#{url_data[:name]}\").read.to_s)).to_s) + \"\\n\\n\"\n end",
"def print(input, data, message: nil, name: nil)\n _op(:print, input, data, message: message, name: name)\n end",
"def print(input, data, message: nil, name: nil)\n _op(:print, input, data, message: message, name: name)\n end",
"def show\n @data.each do | row |\n row.each do | cell |\n if cell.infected?\n print \"%3s\" % cell.virus.generation\n else\n print \" #{cell.content} \"\n end\n end\n puts\n end\n end",
"def print()\n printf \"\\nAuthor ID: %d affiliation: %s affiliation short: %s country: %s\\n\", self.article_author_id, self.name, self.short_name, self.country\n printf \"\\nAddress: %s, %s, %s, %s, %s\\n\", self.add_01, self.add_02, self.add_03,self.add_04, self.add_05\n end",
"def print()\n puts @node_data.to_s\n end",
"def print_basic_info\n \"Name:#{name}, Occupation:#{occupation}, Sex:#{sex}\"\n end",
"def print_info\n puts \"#{ @name } is the #{ @position } planet from the sun.\\nIt is a #{ @type } planet that is #{ @diameter } miles wide.\\n#{ @name } has #{ @moons } moons.\"\n end",
"def print_planet_data\n\n if validate_planet\n\n # print the moon info\n print \"#{@name} has #{@moons.length} moon(s) and has\"\n\n # rings information\n if @rings\n puts \" rings!\"\n else\n puts \" no rings.\"\n end\n\n # other data here\n puts \"#{@name} is #{@surface_temp} and is as wide as #{@diameter_in_earths} Earth(s)!\"\n puts \"#{@name}'s rate of solar rotation is #{@rate_of_solar_rotation} Earth days.\"\n puts \"It's #{@distance_from_the_sun_in_miles} miles from the sun!\"\n\n end\n end",
"def info\n [@level, @tag, @data]\n end",
"def printProbe\n puts \"Your origin was (#{@x},#{@y},#{@z})\"\n puts \"Traveled #{@traveled_distance}\"\n puts \"Visited #{@visited_stars}\"\n puts \"Explored #{@explored_planets}\"\n puts \"Remaining fuel #{@fuel}\"\n end",
"def print(data, file = nil)\n table = Table.from(data)\n set_columns table.columns\n table.each { |row| add_row row }\n finished\n end",
"def details\n data()\n end",
"def disp_details(d)\n d.each do\n |key,value|\n print key,'=',value,' '\n end\nend",
"def display_details()\n puts \"Customer id is #{@id} \"\n puts \"Customer name is #{@name} \"\n puts \"Customer address is #{@address} \"\n end",
"def extract_data( page )\n strip_tags page[:content]\n\n #extract_concepts( page[:title] , page , LOC_TITLE ) if page[:title] && page[:title] !=~ PTN_EMPTY\n if page[:tag] && page[:tag] !=~ PTN_EMPTY\n page[:tag] = page[:tag].split(SEP_TAG).map{|e|\"[[\"+e+\"]]\"}.join(\";\")\n extract_concepts( page[:tag] , page , LOC_TAG )\n end\n\n extract_concepts( page[:title] , page , LOC_TITLE)\n extract_concepts( page[:content] , page )\n extract_resources( page[:content] , page )\n end",
"def display_planet_details\n puts \"Name: #{@name}, Primary Export: #{@primary_export}, Year-Length: #{@year_length}\"\n end",
"def d(data)\n data.send :display \n \"\\n\".send :display\nend",
"def show_info\n\t\tputs \"Your start station: #{starting_point}\"\n\t\tputs \"Your destination: #{ending_point}\"\n\t\tputs \"Travel time: ___\"\n\t\tputs \"Price: ____\"\n\tend",
"def get_info\n puts @name + ' [ID: ' + @id.to_s + ' @ '+ @@company + ']'\n end",
"def print_data\n response = @quandl_client.get_stock\n abort 'Unable to find data for this search' if response['dataset'].nil? || response['dataset'].empty?\n\n prepare_result(response)\n display_result\n end",
"def print\n\t\tif self.length == 0\n\t\t\tputs \"empty\"\n\t\telse\n\t\t\tself.each { |item| puts item.data }\n\t\tend\n\tend",
"def print_data(data, padding)\n p = \"\"\n (0..padding.length - data.to_s.length).map {p += \" \"}\n print data.to_s + p\n end",
"def output_details(files) \n @stdout.puts\n @stdout.puts \"Details\".bold\n files.each do |t|\n fname = t.path\n @stdout.puts \"File: %s\" % [((t.status == FileData::STATUS_OK) ? fname : fname.red)]\n @stdout.puts \"Includes: %s\" % [format_fds(t.includes)] unless t.includes.empty?\n @stdout.puts \"Included by: %s\" % [format_fds(t.included_by)] unless t.included_by.empty?\n @stdout.puts \"References: %s\" % [format_fds(t.references)] unless t.references.empty?\n @stdout.puts \"Referenced by: %s\" % [format_fds(t.referenced_by)] unless t.referenced_by.empty?\n unless t.status == FileData::STATUS_NOT_FOUND\n # show that part only if file exists\n @stdout.puts \"Size: %s (%d)\" % [format_size(t.size),t.size]\n if (t.docbook)\n @stdout.puts \"Type: DocBook, Version #{t.version}, Tag: #{t.tag}\"\n else\n @stdout.puts \"MIME: #{val_s(t.mime)}\"\n end\n @stdout.puts \"Timestamp: %s\" % [t.ts]\n @stdout.puts \"SHA1: %s\" % [t.checksum]\n end\n @stdout.puts \"Error: %s\" % [t.error_string.to_s.red] unless (t.error_string.nil?) \n @stdout.puts\n end\n end",
"def print(*rest) end",
"def print(*rest) end",
"def print(*rest) end",
"def print(*rest) end",
"def show_details\n print @name.upcase + \": #{@name} has #{@moons} moons and a diameter of #{@diameter} miles.\"\n print \"It is #{@color} in color and associated with the #{@zodiac} zodiac sign.\"\n puts \"#{@name} is #{@distance} miles from the sun and has a solar rotation of #{@rotation} earth days!\"\n end",
"def get_info\n puts \"#{@title} by #{@author} is #{@status}.\"\n if @description\n puts \"#{@title} description: #{@description}.\"\n end\n end",
"def display()\n\t\tputs \"method: #{@method}\"\n\t\tputs \"identifier: #{@identifier}\"\n\t\tputs \"query: #{@query}\"\n\t\tputs \"version: #{@version}\"\n\t\tputs \"---------------- headers ----------------\"\n\t\tputs @headers\n\t\tputs \"---------------- body -------------------\"\n\t\tputs @body\n\tend",
"def visit\r\n cursor = @head\r\n while cursor\r\n puts cursor.data\r\n end\r\n end",
"def print_hash_info(data)\n puts 'Here is your information.'.light_blue\n puts \"#{'Name'.yellow}:#{(data[:github_account]).to_s.light_green}\"\n puts 'Git hub username'.yellow + ':' \"#{data[:github_account]}\".light_green\n puts 'profile picture url'.yellow + ':' \"#{data[:picture_url]}\".light_green\n puts 'about'.yellow + ':' \"#{data[:about]}\".light_green\n puts 'number of conterbutions last'.yellow + ':' \"#{data[:conterbutions]}\".light_green\n puts 'pinned repostitories'.light_blue\n puts \"#{data[:pinned_repos_urls][0]} ,#{data[:pinned_repos_urls][1]},#{data[:pinned_repos_urls][2]}\".light_magenta\n puts \"#{data[:pinned_repos_urls][3]} ,#{data[:pinned_repos_urls][4]},#{data[:pinned_repos_urls][5]}\".light_magenta\nend",
"def print_person\n puts \"Name: #{name}\"\n puts \"Age: #{age} years old\"\n puts \"ID: VCN#{id}\"\n end",
"def print_employee_data\n\n # Define positions.\n box_offsets = [[0, 0], [4.25, 0], [0, -5.5], [4.25, -5.5]]\n starting_x = 0.25\n starting_y = 10.75\n\n # Draw text for each position.\n box_offsets.each do |o|\n box_x = starting_x + o[0]\n box_y = starting_y + o[1]\n print_employee_data_box(box_x, box_y)\n end\n\n end",
"def print_output_head(index)\n puts \"\\nPrinting dataset for %.2f\" %\n (@meta_data.domain_z.lower + (index * @meta_data.domain_z.step))\n puts \"\\n\"\n end",
"def print_details\n puts \"#{self.reader.name} subscribed to #{self.magazine.title} for $#{self.price}\"\n end",
"def print_instruction\n splits = sliced_print_range\n range = parsed_command_of(splits)\n report(range)\n end",
"def print_details\n\n# @stud = [@student_name, @student_about]\n# @coa = [@coach_name, @coach_bio]\n puts \"\\nWorkshop - #{self.date} - Venue: #{self.venue}\"\n puts \"\\nStudents\"\n # puts \"#{self.add_participant(@student_name)}\"\n @student_name.each do |mems|\n puts \"#{mems} - #{@student_about[0]}\"\n end\n #end\n # puts \"Coaches\"\n # @coach_name.each do |memc|\n # puts \"#{memc[0]} - #{memc[1]}\"\n # end\n end",
"def __(data=\"\"); @_undies_output.node(data.to_s); end",
"def print_result(result)\n puts result.solutions\n result.fragments.each do |fragment|\n puts fragment\n end\n end",
"def display_details()\n puts \"Customer name: #@cust_name\"\n puts \"Customer ID: #@cust_id\"\n puts \"Customer address: #@cust_addr\"\n end",
"def print_details\n puts \"#{self.reader.name} subscribed to #{self.magazine.title} for $#{self.price}\"\n end",
"def printData(sheetMembers, newMems, nameChanges, rankChanges, noDates, needPromos)\r\n puts \"New Members\"\r\n puts \":::::::::::::::::::::::\"\r\n newMems.each do |string|\r\n \tputs string\r\n end\r\n puts \"\"\r\n\r\n puts \"No longer in FC\"\r\n puts \":::::::::::::::::::::::\"\r\n sheetMembers.each do |key, member|\r\n \tputs \"#{member.Name}\\tID: #{key}\"\r\n end\r\n puts \"\"\r\n\r\n puts \"Name Changes\"\r\n puts \":::::::::::::::::::::::\"\r\n nameChanges.each do |string|\r\n \tputs string\r\n end\r\n puts \"\"\r\n\r\n puts \"Rank Changes\"\r\n puts \":::::::::::::::::::::::\"\r\n rankChanges.each do |string|\r\n puts string\r\n end\r\n puts \"\"\r\n\r\n puts \"Possibile Promotion Candidates\"\r\n puts \":::::::::::::::::::::::\"\r\n needPromos.each do |string|\r\n puts string\r\n end\r\n puts \"\"\r\n\r\n puts \"In Need of Dates\"\r\n puts \":::::::::::::::::::::::\"\r\n noDates.each do |string|\r\n puts string\r\n end\r\n puts \"\"\r\n return nil\r\nend",
"def output\n puts \"Name: #{@name}\"\n puts \"Email: #{@email}\"\n puts \"Phone: #{@phone}\"\n puts \"Title: #{@title}\"\n end",
"def print_values\n print \"\\nRegister A: #{@register_a}\\tRegister B: #{@register_b}\\n\"\n print \"Zero Bit: #{@zero_bit}\\tOverflow Bit: #{@overflow}\\n\"\n print \"Program Counter: #{@pc}\\n\"\n print \"Memory: #{@memory}\\n\"\n end",
"def print_pq_data\n\t \tresponse = \"\"\n\t \tprice_quotes = pnr_info.pq_data\n\t \tunless price_quotes.blank?\n\t \t\tif price_quotes.is_a?(Array) then\n\t \t\t\ttext_pqs = price_quotes.each {\n\t \t\t\t\t|pq|\n\t \t\t\t\tresponse += extra_info(pq)\n\t \t\t\t}\n\t \t\telse\n\t \t\t\tresponse += extra_info(price_quotes)\n\t \t\tend\n\t \t\tresponse += table_pq_totals(price_quotes)\n\t \tend\n\t \treturn \tresponse\n\t end",
"def cmd_show(value)\n value = nil if value == \"show\"\n\n case\n when value == \"headers\"\n puts \"[+] \" + \"Header Contents\"\n puts \"-\" * \"[+] Body Contents\".length\n\n @context.current_context[0][:headers].map do |hash|\n hash.each do |_key , _val|\n puts \"#{_key}\".green + \":\\n\" + \"#{_val}\".white\n end\n end\n\n when value == \"body\"\n puts \"[+] \" + \"Body Contents\"\n puts \"-\" * \"[+] Body Contents\".length\n\n @context.current_context[0][:body].map do |hash|\n hash.each do |_key , _val|\n puts \"#{_key}\".green + \":\\n\" + \"#{_val}\".white\n end\n end\n when value == \"full_post\"\n puts \"[+] \" + \"Body Contents\"\n puts \"-\" * \"[+] Body Contents\".length\n\n @context.current_context[0][:full_post].map do |element|\n element.map do |hash|\n hash.each do |_key , _val|\n puts \"#{_key}\".green + \":\\t\\t\\t\" + \"#{_val}\".white\n end\n end\n end\n\n else\n pp @context.current_context\n end\n\n end",
"def print_datastructure(object, threshold = ' ')\n out = ''\n if object.is_a?(Yarpler::Models::Relation)\n out << print_relation(object, threshold)\n else\n out << print_object(object, threshold)\n end\n out\n end",
"def print_data\n\n # Print customer information.\n box_height = 0.166667\n y = 8.9\n self.vms_text_box(\"Attn: <strong>PIERRE PAROZ</strong>\", 0.5, y, 3.5, box_height, 10, :normal, :left, :center)\n self.vms_text_box(\"AMEMIC\", 4.5, y, 3.5, box_height, 10, :bold, :left, :center)\n self.vms_text_box(\"Date: <strong>12/13/18</strong>\", 4.5, y, 3.5, box_height, 10, :normal, :right, :center)\n y -= box_height\n self.vms_text_box(\"AMERICAN MICRO PRODUCTS, INC.\", 0.5, y, 3.5, box_height, 10, :bold, :left, :center)\n y -= box_height\n self.vms_text_box(\"4288 ARMSTRONG BLVD\", 0.5, y, 3.5, box_height, 10, :bold, :left, :center)\n self.vms_text_box(\"Phone:\", 4.5, y, 0.75, box_height, 10, :normal, :left, :center)\n self.vms_text_box(\"(513) 732-2674\", 5.15, y, 3.5, box_height, 10, :bold, :left, :center)\n y -= box_height\n self.vms_text_box(\"BATAVIA, OH 45103-1600\", 0.5, y, 3.5, box_height, 10, :bold, :left, :center)\n self.vms_text_box(\"Fax:\", 4.5, y, 0.75, box_height, 10, :normal, :left, :center)\n self.vms_text_box(\"(513) 732-3535\", 5.15, y, 1.5, box_height, 10, :bold, :left, :center)\n self.vms_text_box(\"Ext\", 6.4, y, 0.5, box_height, 10, :normal, :left, :center)\n self.vms_text_box(\"032\", 6.7, y, 1, box_height, 10, :bold, :left, :center)\n y -= (box_height + 0.25)\n\n # Draw quotation box.\n fill_color('000000')\n fill_rectangle([0.25.in, y.in], 8.in, 0.4.in)\n stroke_rectangle([0.25.in, y.in], 8.in, 0.4.in)\n self.vms_text_box(\"VMS Quote # <strong>71295</strong>\", 0.35, y, 3.8, 0.4, 12, :normal, :left, :center, nil, 'ffffff')\n self.vms_text_box(\"Your Request # <strong>Q02I7446</strong>\", 4.35, y, 3.8, 0.4, 10, :normal, :right, :center, nil, 'ffffff')\n y -= 0.4\n fill_color('cccccc')\n fill_rectangle([0.25.in, y.in], 8.in, 0.25.in)\n stroke_rectangle([0.25.in, y.in], 2.in, 0.25.in)\n stroke_rectangle([2.25.in, y.in], 4.5.in, 0.25.in)\n stroke_rectangle([6.75.in, y.in], 1.5.in, 0.25.in)\n self.vms_text_box(\"Part Number\", 0.25, y, 2, 0.25, 10, :bold, :center, :center)\n self.vms_text_box(\"Part Description & Process Specification\", 2.25, y, 4.5, 0.25, 10, :bold, :center, :center)\n self.vms_text_box(\"EAU\", 6.75, y, 1.5, 0.25, 10, :bold, :center, :center)\n quotation_lines = 9\n y -= 0.25\n stroke_rectangle([0.25.in, y.in], 2.in, (quotation_lines * _p(10)).in)\n stroke_rectangle([2.25.in, y.in], 4.5.in, (quotation_lines * _p(10)).in)\n stroke_rectangle([6.75.in, y.in], 1.5.in, (quotation_lines * _p(10)).in)\n self.vms_text_box(\"627591\\n \\n \\n \\n \\n \\n \", 0.35, y, 1.8, quotation_lines * _p(10), 10, :normal, :left, :center)\n self.vms_text_box(\"POLE PIECE\\n\\n12L14 STEEL X 12.3MM OD X 7MM ID\\n& 1.90MM THRU HOLE X 13.9MM LONG\\n\\nZINC-NICKEL (.0003\\\" MINIMUM) &\\nCLEAR TRIVALENT CHROMATE\", 2.35, y, 4.3, quotation_lines * _p(10), 10, :normal, :left, :center)\n self.vms_text_box(\"500,000 PCS\\n \\n \\n \\n \\n \\n \", 6.85, y, 1.3, quotation_lines * _p(10), 10, :normal, :center, :center)\n y -= quotation_lines * _p(10)\n remarks_lines = 4\n stroke_rectangle([0.25.in, y.in], 8.in, (remarks_lines * _p(10)).in)\n self.vms_text_box(\"<em>Remarks:</em>\\nPLEASE NOTE: FORD WSA-M1P87-A1 IS OBSOLETE.\\nUSING FORD WSS-M1P87-B1 FOR PURPOSE OF THIS QUOTATION.\", 0.35, y, 7.8, remarks_lines * _p(10), 10, :normal, :left, :center)\n y -= remarks_lines * _p(10)\n fill_color('000000')\n fill_rectangle([0.25.in, y.in], 8.in, 0.32.in)\n stroke_rectangle([0.25.in, y.in], 8.in, 0.32.in)\n self.vms_text_box(\"Price: <strong>$0.028/each</strong>\", 0.35, y, 3.8, 0.32, 10, :normal, :left, :center, nil, 'ffffff')\n self.vms_text_box(\"Minimum Lot Charge: <strong>$250.00</strong>\", 4.35, y, 3.8, 0.32, 10, :normal, :right, :center, nil, 'ffffff')\n y -= 0.57\n\n fill_color('000000')\n fill_rectangle([0.25.in, y.in], 8.in, 0.4.in)\n stroke_rectangle([0.25.in, y.in], 8.in, 0.4.in)\n self.vms_text_box(\"VMS Quote # <strong>71296</strong>\", 0.35, y, 3.8, 0.4, 12, :normal, :left, :center, nil, 'ffffff')\n self.vms_text_box(\"Your Request # <strong>Q02I7447</strong>\", 4.35, y, 3.8, 0.4, 10, :normal, :right, :center, nil, 'ffffff')\n y -= 0.4\n fill_color('cccccc')\n fill_rectangle([0.25.in, y.in], 8.in, 0.25.in)\n stroke_rectangle([0.25.in, y.in], 2.in, 0.25.in)\n stroke_rectangle([2.25.in, y.in], 4.5.in, 0.25.in)\n stroke_rectangle([6.75.in, y.in], 1.5.in, 0.25.in)\n self.vms_text_box(\"Part Number\", 0.25, y, 2, 0.25, 10, :bold, :center, :center)\n self.vms_text_box(\"Part Description & Process Specification\", 2.25, y, 4.5, 0.25, 10, :bold, :center, :center)\n self.vms_text_box(\"EAU\", 6.75, y, 1.5, 0.25, 10, :bold, :center, :center)\n quotation_lines = 9\n y -= 0.25\n stroke_rectangle([0.25.in, y.in], 2.in, (quotation_lines * _p(10)).in)\n stroke_rectangle([2.25.in, y.in], 4.5.in, (quotation_lines * _p(10)).in)\n stroke_rectangle([6.75.in, y.in], 1.5.in, (quotation_lines * _p(10)).in)\n self.vms_text_box(\"627599\\n \\n \\n \\n \\n \\n \", 0.35, y, 1.8, quotation_lines * _p(10), 10, :normal, :left, :center)\n self.vms_text_box(\"ARMATURE\\n\\n12L14 STEEL X 12.3MM & 10.3MM &\\n4.5MM & 1.90MM OD X 50.05MM LONG\\n\\nZINC-NICKEL (.0003\\\" MINIMUM) &\\nCLEAR TRIVALENT CHROMATE\", 2.35, y, 4.3, quotation_lines * _p(10), 10, :normal, :left, :center)\n self.vms_text_box(\"500,000 PCS\\n \\n \\n \\n \\n \\n \", 6.85, y, 1.3, quotation_lines * _p(10), 10, :normal, :center, :center)\n y -= quotation_lines * _p(10)\n remarks_lines = 4\n stroke_rectangle([0.25.in, y.in], 8.in, (remarks_lines * _p(10)).in)\n self.vms_text_box(\"<em>Remarks:</em>\\nPLEASE NOTE: FORD WSA-M1P87-A1 IS OBSOLETE.\\nUSING FORD WSS-M1P87-B1 FOR PURPOSE OF THIS QUOTATION.\", 0.35, y, 7.8, remarks_lines * _p(10), 10, :normal, :left, :center)\n y -= remarks_lines * _p(10)\n fill_color('000000')\n fill_rectangle([0.25.in, y.in], 8.in, 0.32.in)\n stroke_rectangle([0.25.in, y.in], 8.in, 0.32.in)\n self.vms_text_box(\"Price: <strong>$0.091/each</strong>\", 0.35, y, 3.8, 0.32, 10, :normal, :left, :center, nil, 'ffffff')\n self.vms_text_box(\"Minimum Lot Charge: <strong>$250.00</strong>\", 4.35, y, 3.8, 0.32, 10, :normal, :right, :center, nil, 'ffffff')\n y -= 0.57\n\n return\n\n # Print data table.\n self.vms_text_box(\"LN\", 0.25, 7.95, 0.5, 8 * _p(10), 10, :normal, :center, :top)\n self.vms_text_box(\"627591\\nQuote # <strong>71295</strong>\", 0.8, 7.95, 1.9, 8 * _p(10), 10, :normal, :left, :top)\n self.vms_text_box(\"POLE PIECE\\n\\n12L14 STEEL X 12.3MM OD X 7MM ID\\n& 1.90MM THRU HOLE X 13.9MM LONG\\n\\nZINC-NICKEL (.0003\\\" MINIMUM) &\\nCLEAR TRIVALENT CHROMATE\", 2.8, 7.95, 3.15, 8 * _p(10), 10, :normal, :left, :top)\n self.vms_text_box(\"500,000 PCS\", 6.05, 7.95, 1.15, 8 * _p(10), 10, :normal, :center, :top)\n self.vms_text_box(\".028\\n$/EACH\\n\\n<em>MINIMUM</em>:\\n$250.00\", 7.3, 7.95, 0.9, 8 * _p(10), 10, :normal, :center, :top)\n fill_color('eeeeee')\n fill_rectangle([0.5.in, 6.75.in], 7.5.in, (8 * _p(10)).in)\n stroke_rectangle([0.5.in, 6.75.in], 7.5.in, (8 * _p(10)).in)\n self.vms_text_box(\"PLEASE NOTE: FORD WSA-M1P87-A1 IS OBSOLETE.\\nUSING FORD WSS-M1P87-B1 FOR PURPOSE OF THIS QUOTATION.\\n\\nYOUR REQUEST NUMBER <strong>Q0217446</strong>\\n\\nPLEASE REFER TO OUR QUOTATION NUMBER <strong>71295</strong> ON ALL CORRESPONDENCE OR ORDERS\", 0.5, 6.75, 7.5, 8 * _p(10), 10, :normal, :center, :center)\n self.vms_text_box(\"LN\", 0.25, 5.5, 0.5, 8 * _p(10), 10, :normal, :center, :top)\n self.vms_text_box(\"627599\\nQuote # <strong>71296</strong>\", 0.8, 5.5, 1.9, 8 * _p(10), 10, :normal, :left, :top)\n self.vms_text_box(\"ARMATURE\\n\\n12L14 STEEL X 12.3MM & 10.3MM &\\n4.5MM & 1.9MM OD X 50.05MM LONG\\n\\nZINC-NICKEL (.0003\\\" MINIMUM) &\\nCLEAR TRIVALENT CHROMATE\", 2.8, 5.5, 3.15, 8 * _p(10), 10, :normal, :left, :top)\n self.vms_text_box(\"500,000 PCS\", 6.05, 5.5, 1.15, 8 * _p(10), 10, :normal, :center, :top)\n self.vms_text_box(\".091\\n$/EACH\\n\\n<em>MINIMUM</em>:\\n$250.00\", 7.3, 5.5, 0.9, 8 * _p(10), 10, :normal, :center, :top)\n fill_color('eeeeee')\n fill_rectangle([0.5.in, 4.3.in], 7.5.in, (8 * _p(10)).in)\n stroke_rectangle([0.5.in, 4.3.in], 7.5.in, (8 * _p(10)).in)\n self.vms_text_box(\"PLEASE NOTE: FORD WSA-M1P87-A1 IS OBSOLETE.\\nUSING FORD WSS-M1P87-B1 FOR PURPOSE OF THIS QUOTATION.\\n\\nYOUR REQUEST NUMBER <strong>Q0217447</strong>\\n\\nPLEASE REFER TO OUR QUOTATION NUMBER <strong>71296</strong> ON ALL CORRESPONDENCE OR ORDERS\", 0.5, 4.3, 7.5, 8 * _p(10), 10, :normal, :center, :center)\n\n\n \n end",
"def show_doc(retval_arr)\n message = retval_arr[0]\n table = retval_arr[1]\n \n table.each do |row|\n puts row\n end\n puts\n end",
"def format data\n data\n end",
"def process_projector_information(data)\n\t\tlogger.debug \"-- NEC projector sent a response to a projector information command\"\t\n\n\t\tlamp = 0\n\t\tfilter = 0\t\n\n\t\t#\n\t\t# get lamp usage\n\t\t#\n\t\tshift = 0\n\t\tdata[87..90].each do |byte|\n\t\t\tlamp += byte << shift\n\t\t\tshift += 8\n\t\tend\n\t\t\n\t\t#\n\t\t# get filter usage\n\t\t#\n\t\tshift = 0\n\t\tdata[91..94].each do |byte|\n\t\t\tfilter += byte << shift\n\t\t\tshift += 8\n\t\tend\n\t\t\n\t\tself[:lamp_usage] = [lamp / 3600]\t# Lamp usage in hours\n\t\tself[:filter_usage] = [filter / 3600]\n\tend",
"def output\n puts \"Name: #{@name}\"\n puts \"Address: #{@address}\"\n puts \"City: #{@city}\"\n puts \"State: #{@state}\"\n puts \"Zip: #{@zip}\"\n print \"Phone: \"\n @phone.each do |ph|\n if (!ph.nil?)\n\tprint \"#{ph} \"\n end\n end\n print \"\\n\"\n print \"Fax: \"\n @fax.each do |fx|\n if (!fx.nil?)\n\tprint \"#{fx} \"\n end\n end\n print \"\\n\"\n print \"Email: \"\n @email.each do |em|\n if (!em.nil?)\n\tprint \"#{em} \"\n end\n end\n print \"\\n\"\n end",
"def print_element_info(element)\n print \"\\n\\n\"\n print \"== Element Info ==\\n\"\n print \"tag name: #{element.tag_name}\\n\"\n print \"value: #{element['value']}\\n\"\n print \"text: #{element.text}\\n\"\n print \"location: #{element.location}\\n\"\n print \"\\n\\n\"\n end",
"def extract_text(data_name, options = {})\n if data_element(data_name).nil?\n# unless VALID_DATA_ELEMENTS.has_key?(data_name.to_sym)\n# @log.warn \"Invalid data extract for data field name [#{data_name.to_s}]\"\n puts \"Invalid data extract for data field name [#{data_name.to_s}]\"\n return nil\n end\n row = options[:row] || @current_row\n row = row + options[:add_rows] unless options[:add_rows].nil?\n @current_row = row\n #can not extract data because row not given probably because prompt not found\n if row.nil?\n return nil\n end \n row = row - 1\n \n column = options[:column] || @current_column\n column = column + options[:add_columns] unless options[:add_columns].nil?\n column = column - 1 # external is 1 based\n length = options[:length] || data_element(data_name).length\n\n# length = options[:length] || VALID_DATA_ELEMENTS[data_name.to_sym].length\n ends_with = options[:ends_with]\n line = @document.lines[row]\n field_value = if ends_with\n ends_with = Regexp.escape(ends_with) unless ends_with.class == Regexp\n regexp = Regexp.new(/(.{1,#{200}}?)/.to_s + ends_with.to_s)\n line[(column)..-1] =~ regexp\n $1\n else\n line[(column)..(column + length - 1)] \n end \n # puts \" field #{data_name} = [#{field_value}]\"\n# @log.debug3(\"field #{data_name} = [#{field_value}]\")\n return nil if field_value.nil? # nothing extracted\n value = process_extract_options(data_name, field_value, options)\n return nil if value.nil?\n\n @data[data_name] = value \n\n# @data[data_name]\n end",
"def print\r\n tags.each do |tag|\r\n puts \"#{@@tag_titles[tag]} -> #{value(tag)}\"\r\n end\r\n end",
"def print_info\n self.values.each do |value|\n puts value\n end\n end",
"def print(data, level = 0)\n case data\n when Hash\n data.each do |key, value|\n if value.is_a? Enumerable\n string = \"#{indent_string(level)}#{format_key(key)}:\"\n\n if value.empty?\n puts string + ' ' + empty_value(value)\n else\n puts string\n print(value, level + 1)\n end\n else\n puts \"#{indent_string(level)}#{format_key(key)}: #{format_value(value)}\"\n end\n end\n when Array\n data.each do |value|\n if value.is_a? Enumerable\n string = format_key \"#{indent_string(level)}-\"\n if value.empty?\n puts string + ' ' + empty_value(value)\n else\n puts string\n print(value, level + 1)\n end\n else\n puts \"#{indent_string(level)}#{format_key('-')} #{format_value(value)}\"\n end\n end\n else\n puts \"#{indent_string(level)}#{format_value(data)}\"\n end\n end",
"def process(record)\n $stdout.puts record\n end",
"def showData\n $page = $page +\n \"<dl>\\n\" +\n \" <dt>name\\n\" +\n \" <dd>\" + $name + \"\\n\" +\n \" <dt>organization\\n\" +\n \" <dd>\" + $organization + \"\\n\" +\n \" <dt>email\\n\" +\n \" <dd>\" + $email + \"\\n\" +\n \" <dt>source\\n\" +\n \" <dd>\" + $source + \"\\n\" +\n \" <dt>use\\n\" +\n \" <dd>\" + $use + \"\\n\" +\n \" <dt>notification\\n\" +\n \" <dd>\" + $notification + \"\\n\" +\n \"</dl>\\n\"\nend",
"def output(name, data, undoc = nil)\n @total += data if data.is_a?(Integer) && undoc\n @undocumented += undoc if undoc.is_a?(Integer)\n data =\n if undoc\n (\"%5s (% 5d undocumented)\" % [data, undoc])\n else\n \"%5s\" % data\n end\n log.puts(\"%-12s %s\" % [name + \":\", data])\n end",
"def print_segments\n\t\t# METHOD: after all of the HL7 content has been parsed, print the contents of each segment in a more easily readible format\n\t\t# output for 1 segment looks like:\n\t\t\t\t\t#~ :: Segment: PID\n\t\t\t\t\t#~ PID-0: Segment => PID\n\t\t\t\t\t#~ PID-1: Set ID - PID => 1\n\t\t\t\t\t#~ PID-2: Patient ID => \n\t\t\t\t\t#~ PID-3: Patient Identifier List => [[\"P00057804\", \"\", \"\", \"\", \"PN\"], [\"4009887514\", \"\", \"\", \"AUSHIC\", \"MC\"], [\"SMIAL001\", \"\", \"\", \"\", \"PI\"]]\n\t\t\t\t\t#~ PID-4: Alternate Patient ID - PID => \n\t\t\t\t\t#~ PID-5: Patient Name => [\"SMITH\", \"Alan\", \"Ross\", \"\", \"Mr\"]\n\t\t\t\t\t#~ PID-6: Mother’s Maiden Name => \n\t\t\t\t\t#~ PID-7: Date/Time of Birth => 19770621\n\t\t\t\t\t#~ PID-8: Sex => M\n\t\t\t\t\t#~ PID-9: Patient Alias => \n\t\t\t\t\t#~ PID-10: Race => \n\t\t\t\t\t#~ PID-11: Patient Address => [\"818 Beach Road\", \"\", \"BEECHMERE\", \"\", \"4510\", \"AU\", \"H\"]\n\n\t\t\t# iterate over each segment\n\t\t\t@parsed_content.each do |segment|\n\t\t\t\tseg = segment[0]\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t # eg => \"PID\"\n\t\t\t\t\n\t\t\t\t#get yaml file details\n\t\t\t\tyamlfile = \"hl7specification/#{seg}\"\t\t\t\t\t# for each segment, find the appropriate yaml file (ie one for each segment)\n\t\t\t\tspecs = YAML.load_file(yamlfile)\t\t\t\t\t\t\t# load the yaml file\n\t\t\t\t\n\t\t\t puts \":: #{specs[\"Header\"][\"name\"]} (#{seg})\"\t\t\t# print the text eg \":: Message Header Segment (MSH)\"\n\t\t\t \n\t\t\t # then iterate over each field in the particular segment\n\t\t\t\tsegment.each_with_index do |field, index|\t\t\t\t\t# then for each field...\n\t\t\t\t\tif index > 0 then\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# only if the index is 1 or more (ie the first value is not useful here)\n\t\t\t\t\t\tfld = \"#{seg}-#{index}\"\t\t\t\t\t\t\t\t\t # get the field id => \"PID-5\"\n\t\t\t\t\t\tprint \" #{fld}: \"\t\t\t\t\t\t \t\t\t\t\t\t# on each line print the particular field being queried eg \"PID-5: \"\n\t\t\t\t\t\tfldname = specs[fld][\"name\"]\t\t\t\t\t\t\t\t\t# get the name of the field from the yaml file\n\t\t\t\t\t\tprint \"#{fldname} => \"\t\t\t\t\t\t\t\t\t\t\t\t# print the field name after the field eg \"PID-5: Patient Name\"\n\t\t\t\t\t\tif field.class == String then\t\t\t\t\t\t\t\t\t# if the field class is a string...\n\t\t\t\t\t\t\tputs field\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# then just print (ie add) the value of the string eg \"PID-7: Date/Time of Birth => 19770621\"\n\t\t\t\t\t\telsif field.class == Array then\t\t\t\t\t\t\t\t# otherwise if the field is an array, ie there is lower level structure...\n\t\t\t\t\t\t\tputs field.inspect\t\t\t\t\t\t\t\t\t\t\t\t\t# then print the structure eg \"PID-5 Patient Name => [\"SMITH\", \"Alan\", \"Ross\", \"\", \"Mr\"]\"\n\t\t\t\t\t\tend # << end if field...\n\t\t\t\t\tend # << end if index > 0 \n\t\t\t\tend\t # << end segment.each_with_index\n\t\t\t\tputs\t\n\t\t end\t # << end @parsed_content.each\n\t \n\t end",
"def parse(data); end",
"def print_details(inst)\n print \"ID: \".bold, inst[:id], \" Name: \".bold, inst[:name], \" State: \".bold, inst[:state]\n if inst[:state] == 'running'\n print \", launched at #{inst[:launched]}\"\n elsif inst[:reason]\n print \" via #{inst[:reason]}\"\n end\n puts\n\n if inst[:vpc]\n print \"VPC: \".bold, inst[:vpc], \" Subnet: \".bold, inst[:subnet]\n else\n print \"EC2 Classic\".bold\n end\n print \" Private IP: \".bold, echo_ip( inst[:private_ip] )\n if inst[:vpc] and not inst[:private_ip]\n print \" Public IP is not allocated\".bold\n else\n print \" Public IP: \".bold, echo_ip( inst[:public_ip] )\n end\n puts\n\n print \"EC2 Class: \".bold, inst[:ec2_class], \" [#{inst[:virtualization_type]}]\", \" Arch: \".bold, inst[:arch]\n print \" [Spot]\".bold if inst[:spot]\n print \" [Monitoring]\".bold if inst[:monitoring]\n if inst[:windows]\n print \" [Windows]\".bold\n else\n print \" Keypair: \".bold, inst[:key_pair]\n end\n puts\n\n print \"AMI: \".bold, inst[:ami], \" (#{inst[:ami_desc]})\"\n puts\n\n print \"Security Groups: \".bold, inst[:sec_groups]\n puts\nend",
"def print\n puts <<~RECEIPT\n #{parsed_items.join(\"\\n\")}\n\n Sales Taxes: #{total_sales_tax}\n Total: #{total_price}\n RECEIPT\n end",
"def show\n data, format = [], []\n \n update(:elapsed, (Time.now - @start_time).to_i)\n \n sorted = @data.sort { |a,b| a[1][:order]<=>b[1][:order] }\n sorted.each do |item|\n format << \"#{item[0].to_s.capitalize}: #{item[1][:format]}\"\n data << item[1][:value] \n end\n \n $stdout.printf(format.join(' | ') + \"\\r\", *data)\n $stdout.flush\n end",
"def display_data_universe\n\n end",
"def dump\n puts \"#{self}:\"\n puts\n\n puts \"fil header:\"\n pp fil_header\n puts\n\n puts \"fil trailer:\"\n pp fil_trailer\n puts\n end",
"def print_meta_head\n puts \"\\nDataset: #{@meta_data.name}\"\n end",
"def parse_from_summary(data)\n # \n end",
"def stdout_received(data); end",
"def pp_data(db, table, data = nil)\n if data == nil\n data = view_table(db, table)\n end\n pp_string = ''\n\n data.each do |entry|\n entry.each do |id, val| \n if id.is_a? String\n pp_string += \"#{id}: #{val}\\t| \" \n end \n end\n pp_string += \"\\n\"\n end\n pp_string\nend",
"def display_info\n \n puts \"\\nPlayer Name: #{self.name}\"\n puts \"Current Rank: #{self.rank}\"\n puts \"Position: #{self.position}\"\n puts \"School/Club: #{self.schoolclub}\"\n # binding.pry\n #if there is no class_year, nothing is displayed\n puts \"Year: #{self.class_year}\"\n #\n puts \"Height/Weight: #{self.height}, #{self.weight} \"\n puts \"Age: #{self.age}\"\n puts \"Last rank: #{self.last_rank}\"\n puts \"Scouting Report: #{self.blurb}\"\n puts \"------------------------------------\"\n end",
"def display_details()\n puts \"Numele persoanei: #@nume\"\n puts \"Prenumele persoanei: #@prenume\"\n end",
"def display_details()\n puts \"Numele persoanei: #@nume\"\n puts \"Prenumele persoanei: #@prenume\"\n end",
"def show\n @title = \" - Order#\" + @order.id.to_s\n @print_sections = PrintSection.all\n @order_data = eval(@order.data)\n # parts_arr = []\n # options_arr = []\n\n # strhash = eval(@order.data).with_indifferent_access\n\n # strhash[:part].each do |key, val|\n # parts_arr << Part.find(key)\n # options_arr << Option.find(val[:option])\n # end\n\n # @parts_options = parts_arr.zip(options_arr)\n\n if params[:view] == 'print'\n render action: 'print', :layout => 'application'\n return\n end\n end",
"def display_book_info(book)\n puts \"*\" * 20\n puts \"\"\n puts \"Title: \" + book[\"volumeInfo\"][\"title\"]\n puts \"Snippet: \" + book[\"searchInfo\"][\"textSnippet\"]\n puts \"\"\nend",
"def print_trail_info\n puts \"Rating: #{self.rating}\"\n puts \"Distance: #{self.distance} mi\"\n puts \"Surface Type(s): #{self.surface}\"\n puts \"Brief Description: #{self.info}\\n\"\n puts \"--------------------------------------------------------------------------------\\n\"\n end"
] | [
"0.6886395",
"0.6639123",
"0.64023614",
"0.6360974",
"0.6230373",
"0.61960685",
"0.6167886",
"0.6074729",
"0.6061806",
"0.6008538",
"0.59789824",
"0.59364724",
"0.5907427",
"0.5898483",
"0.5881963",
"0.58070964",
"0.5772384",
"0.57380396",
"0.573097",
"0.573097",
"0.5730963",
"0.5687724",
"0.568635",
"0.56731534",
"0.56731534",
"0.5672144",
"0.5669961",
"0.5668658",
"0.5665902",
"0.5664486",
"0.563839",
"0.5621485",
"0.5619895",
"0.5614774",
"0.5614545",
"0.5604132",
"0.55885506",
"0.5582354",
"0.5542214",
"0.554063",
"0.55361944",
"0.5531317",
"0.5530419",
"0.5510515",
"0.5510203",
"0.54998064",
"0.5481266",
"0.5481266",
"0.5481266",
"0.5481266",
"0.54746926",
"0.5459051",
"0.545209",
"0.54517907",
"0.5449374",
"0.54474306",
"0.5443786",
"0.5442819",
"0.5442032",
"0.5434781",
"0.5434585",
"0.542946",
"0.54225",
"0.54201674",
"0.5418303",
"0.5408435",
"0.53975844",
"0.5394912",
"0.5389784",
"0.53897417",
"0.53886336",
"0.5387688",
"0.5387083",
"0.53821516",
"0.5380401",
"0.53787625",
"0.53778476",
"0.5372427",
"0.53635216",
"0.536023",
"0.53519547",
"0.5349646",
"0.5348012",
"0.5337229",
"0.5330555",
"0.5324945",
"0.53204954",
"0.5319875",
"0.53159803",
"0.5309274",
"0.5306622",
"0.5298342",
"0.5295314",
"0.5291559",
"0.52911973",
"0.5289914",
"0.52889013",
"0.52889013",
"0.5283635",
"0.52836",
"0.5280061"
] | 0.0 | -1 |
Wrte the last values to a file, ready for cacti to eat | def write_last_measurement(line, filename = '/tmp/currentcost')
File.open(filename, "w") do |file|
file.puts Time.now,(line)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_file\n output = (@blocks[:before] + @blocks[:attributes] + @blocks[:after]).join(\"\\n\").strip + \"\\n\"\n File.open(@filename,'w') { |f| f.write(output) } if output != @file\n end",
"def write_last_activity(activity)\n File.open(MAIN_DIR + \"prev_activity\", \"w\") do |file|\n file.syswrite(activity)\n end\nend",
"def last_write\n @file\n end",
"def null_finish\n file.write(\"\\r\" + ' ' * @last_printed_length + \"\\r\")\n end",
"def save\n file = File.new(@file,\"w+\")\n index =0\n while index < @max_lines do\n file.puts @properties[index]\n index +=1\n end\nend",
"def append fi,c\n\tFile.open( fi, \"a\" ) {| f | f.puts c } \nend",
"def write\r\nFile.open('calibration.conf', 'w') { |file| file.write(@@leg_string.chop) }\r\n# CSV.open('calibration.conf.csv', 'w') do |csv_conf|\r\n# @@leg_array.each do |row_array|\r\n# csv_conf = row_array\r\n# end\r\n# end\r\n end",
"def filewrt(file2wrt, data2wrt)\n\toutput = ::File.open(file2wrt, \"a\")\n\tdata2wrt.each_line do |d|\n\t\toutput.puts(d)\n\tend\n\toutput.close\nend",
"def filewrt(file2wrt, data2wrt)\n\toutput = ::File.open(file2wrt, \"a\")\n\tdata2wrt.each_line do |d|\n\t\toutput.puts(d)\n\tend\n\toutput.close\nend",
"def flush_to_file(hit_list)\n File.open($config[:output], 'a') do |file|\n file.puts(hit_list)\n end\nrescue => e\n puts \"Error writing to output file #{$config[:output]}\"\n raise e\nend",
"def save_to_file\n File.open(\"results/#{seq_name}\"+\".txt\", 'w') { |file|\n \n n=1\n \n @actions.each do |a|\n file.puts a.description\n n +=1 \n end\n } \n \n end",
"def file_end(file, output)\n end",
"def file_write(file2wrt, data2wrt)\n if not ::File.exists?(file2wrt)\n ::FileUtils.touch(file2wrt)\n end\n\n output = ::File.open(file2wrt, 'a')\n data2wrt.each_line do |d|\n output.puts(d)\n end\n output.close\n end",
"def stamp_cvs \n @DAS_file.puts \"#{get_t},#{get_psi},#{get_amps}\"\n end",
"def writetofile(filename)\n self.scan() if @filearray == nil\n\n begin\n FileUtils.mkdir_p(File.dirname(filename))\n file = File.open(filename, \"w\")\n @filearray.each do |line|\n firstvalue = true\n newline = \"\"\n line.each do |value|\n if firstvalue == true\n firstvalue = false\n else\n newline = newline +\",\"\n end\n newline = newline + value\n end\n file.puts(newline)\n end\n rescue IOError => e\n #some error occur, dir not writable etc.\n ensure\n file.close unless file == nil\n end\n #copies original file\n FileUtils.cp(@ddy_filepath, \"#{File.dirname(filename)}/#{File.basename(filename,'.epw')}.ddy\")\n FileUtils.cp(@stat_filepath, \"#{File.dirname(filename)}/#{File.basename(filename,'.epw')}.stat\")\n end",
"def write_acct_file (acct_numbers_array, number_acct_fields)\r\n file_name = \"data/accounts\"\r\n output_file = File.open(file_name,\"w\")\r\n \r\n acct_numbers_array.each {|a| output_file.puts a}\r\n output_file.close\r\nend",
"def store_activity_end_time\n File.open(MAIN_DIR + \"prev_end_time\", \"w\") do |timeFile|\n timeFile.syswrite(current_time)\n end\nend",
"def writenewentries(entries)\n lastupdate = getlastupdate\n f = File.open(@outputfile, 'a')\n count = writenewer(f, entries, lastupdate)\n f.close\n count\n end",
"def write; end",
"def write; end",
"def close_write() end",
"def close_write() end",
"def close_write() end",
"def put\n\t\tif @out_file_kind == :sqlite3\n\t\t\tRecordsDatabase.open(@out_file) do |db|\n\t\t\t\tdb.insert_records(@out_items)\n\t\t\tend\n\t\telse\n\t\t\tFile.open(@out_file, \"a\") {|fp| fp.puts to_csv(@out_items)}\n\t\tend\n\t\t#Puts log lines to log file.\n\t\tFile.open(@log_file, \"a\") {|fp| fp.puts @log_lines}\n\tend",
"def write_data\n \n puts \"Writing out new HR data\"\n processed_record =\".\"\n output_file = File.open(OUTPUT_FILE, 'w')\n \n @completed_users.each do |user| \n output_file.puts user.to_s \n STDERR.print processed_record\n end #basic puts but driven to open file\n \n output_file.close #closes\n puts \"\\nCompleted writing out new HR data \\n#{@completed_users.length} records processed\"\n\nend",
"def write_file(log)\n log[:files_revised] += 1\n File.open(@name, \"w\") {|f| f.write(@content) }\n end",
"def save_points_to_file(file_name, options = {operation: 'w'}) # w for write\n record = @fumeology_record\n record = @fumeology_changes if options[:operation] == 'a'\n open(file_name, options[:operation]) do |f|\n record.each do |point|\n line = ''\n point.herb_combination.each do |herb|\n line << \"#{herb}\"\n line << ', ' unless point.herb_combination.last == herb\n end\n f << \"#{line}\\n\"\n end\n end\n file_name\n end",
"def store_results_file\r\n\taFile = File.new(\"./random_number_result.txt\", \"r+\")\r\n\taFile.truncate(0)\r\n\tnumber = generate_random_number\r\n\tputs aFile.syswrite(\"#{number}\")\r\nend",
"def write(val)\n @file.seek(@address)\n @file.putc(val)\n @file.flush\n end",
"def save_to_text(final_location)\n #open the pre-determined file to write on\n location_save = open('last_saved.txt','w')\n\n #Generate the lines for the file\n\t location_save.puts(\"Lunch Location:\"+final_location.name)\n\t location_save.puts(\"Lunch Address:\"+final_location.address)\n\t location_save.puts(\"Cuisine Type:\"+final_location.cuisine)\n\t location_save.puts(\"Healthy?:\"+final_location.healthy)\n\t location_save.puts(\"Halal or Non-halal:\"+final_location.halal)\n\t location_save.puts(\"Price range:\"+final_location.price)\n\n\n #close the file\n location_save.close\nend",
"def flush filename = Filename\r\n #puts self.to_s\r\n File.open(filename,\"w\"){|file|\r\n file.print self.to_s\r\n }\r\n rescue\r\n @logger.fatal \"Cannot save settings to file '#{filename}'\"\r\n raise\r\n end",
"def wrote_occurrence_file(current)\n if current % increment == 0\n info.attributes = {\n percent_complete: 50 + percent(current)/2,\n message: \"Wrote occurrence file for #{current}/#{species_count} species\"\n }\n info.save(path)\n end\n end",
"def file_out(e, fname, log = nil)\n attrs = e.attrs.dup\n \n # Make sure we only have one attribute, not counting time\n time = attrs.delete :time\n event = attrs.delete :event_name\n pkt = attrs.delete :pkt\n unless log or attrs.length == 1\n raise \"File output can only write one selected attribute\"\n end\n \n # Construct our output value\n value = attrs.find { true }.last.to_s\n if attrs.length == 1\n value = time.strftime \"<%Y-%m-%d %H:%M:%S> #{value}\" if time and log\n value << \"\\n\" if log\n else\n value = e.to_s\n end\n \n # Open the file (possibly for append) and write out the content.\n File.open(fname.to_s, (log.nil? ? 'w' : 'a')) { |f| f.print(value) }\n nil\n end",
"def write_file( fname )\n File.open(fname, \"w\") do |f|\n f << TDP.application.result\n end\n TDP.application.result = String.new\n# puts \"...written to #{fname}\"\n end",
"def writeNextStartTimeFile\n fileName = makeSiteFileName\n file = File.new(fileName,\"w+\")\n @startTimeHash.each do |key,value|\n time = Time.now.utc.iso8601\n file.puts(\"#{key}=\" + time)\n end\n file.close()\n end",
"def flush out_file, title=@title\n dump out_file, title\n ensure\n clear\n end",
"def write_to_file(file_name)\n\n file_out = File.new(file_name.to_s, \"w\")\n\n # write each trajectory point with a time offset beginning at launch_time to the traj file\n time_offset = 0\n @trajectory.each do |a_point|\n\n file_out.printf(\"%f,%f,%f,%f,%f,%f,%f,%f,%f,%f\\n\",\n @t_track[time_offset],\n a_point.lat,\n a_point.lng,\n a_point.alt,\n @velocity_vector_track[time_offset][0],\n @velocity_vector_track[time_offset][1],\n @velocity_vector_track[time_offset][2],\n @attitude_vector_track[time_offset][0],\n @attitude_vector_track[time_offset][1],\n @attitude_vector_track[time_offset][2]\n )\n\n\n time_offset += 1\n\n end ## end of @trajectory.each do |a_point|\n\n file_out.close # close traj the file\n\n end",
"def write_info_file\n file_info = File.read(\"setup-info.txt\").split(\"\\n\")\n file_info.delete(\"\")\n\n number_of_people = file_info[0].to_i\n lines_to_keep = file_info.drop(number_of_people * 3 + 1)\n\n string_to_write = \"#{number_of_people}\"\n @residents.each { |resident| string_to_write += \"\\n#{resident.name}\\n#{resident.email}\\n#{resident.chore}\" }\n lines_to_keep.each { |line| string_to_write += \"\\n#{line}\"}\n\n File.write(\"setup-info.txt\", string_to_write)\nend",
"def write_trxn_file(acct_numbers_array, number_trxn_fields)\r\n file_name = \"data/transactions\"\r\n output_file = File.open(file_name,\"w\")\r\n \r\n trxn_start_year = 2015\r\n trxn_end_year= 2015\r\n trxn_start_month = 4\r\n trxn_end_month = 9\r\n trxn_start_day = 01\r\n trxn_end_day = 21\r\n \r\n min_ammt = 0.00\r\n max_ammt = 10000.00\r\n \r\n for i in 1..number_trxn_fields\r\n acct_num = acct_numbers_array.sample\r\n trxn_date = random_date(trxn_start_year,trxn_end_year, trxn_start_month, trxn_end_month, trxn_start_day, trxn_end_day)\r\n deb_cred_indicator = random_debit_credit_indicator()\r\n merch_catg = random_merchant_category()\r\n trxn_amnt = random_ammount(min_ammt,max_ammt)\r\n prch_code = random_purchase_code()\r\n output_file.puts \"#{acct_num}\" + \"\\001\" + \"#{trxn_date}\" + \"\\001\" + \"#{deb_cred_indicator}\" + \"\\001\" + \"#{merch_catg}\" + \"\\001\" + \"#{trxn_amnt}\" + \"\\001\" + \"#{prch_code}\"\r\n end \r\n output_file.close\r\nend",
"def write_file\n \n # if dirty?\n generate\n \n delete_file\n File.open(absolute_path.gsub(/\\.txt$/, \"\"), 'w+') do |f| \n f.write(generated_header)\n f.write(generated_content)\n end\n # not_dirty\n # end\n end",
"def write(file)\n value.each do |item|\n # always write int4 in network order (as per GDSII spec)\n file.write [item].pack('N')\n end\n end",
"def write_tail(f, pos)\n f.seek(0)\n f.write([pos].pack('N'))\n pos\n end",
"def append2JtlTotal\n\t\t@fHdl = File.new( @jtlfile, 'r')\t\t\t\t\t\t\t\t\t\t\t\t# open single service file\n\t\[email protected]\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# skip first line\n\t\t@fhTot = File.new( @jtlTotal, 'a')\t\t\t\t\t\t\t\t\t\t\t# append at the end\n\t\[email protected] @fHdl.gets(nil, FILEMAXLEN)\n\t\[email protected]\n\t\[email protected]\n\tend",
"def tracks_collection_end\n @filehandle << \"\\n\\t</dict>\"\n end",
"def save\n File.open(SaveLocation, 'w') do |file|\n file.puts @value.join(\"\")\n file.puts @progress.join(\"\")\n file.puts @bad_guesses.join(\"\")\n end\n end",
"def >> file_name, i = index\n if ((File.writable? file_name or not File.exists? file_name) and not\n File.directory? (file = File.new(file_name, 'w')))\n buff = @form[i].update_text\n i = 1\n size = buff.length\n buff.each do |line|\n line = line.chop\n line += \"\\n\" unless i == size\n i += 1\n file.write line\n end\n end\n file.close if file\n end",
"def close_write; end",
"def create_goal_file\n File.open(\"Goal/goal#{file_counter}.txt\", 'w') { |file| file.write(\"#{final_name_info}\") }\nend",
"def save\n ole = File.open(@file_name, 'w')\n ole << header\n ole << fat\n @storages.each { |s| ole << s.to_s }\n ole << Array.new((512-(ole.pos % 512)), 0).pack('c*')\n ole << mini_fat\n ole << mini_fat_stream\n ole << fat_stream\n ole.close\n end",
"def write_obj_file output_path\n File.open(output_path, 'w') do |f|\n @vbuffer.each_triple do |a,b,c|\n f.puts \"v #{a} #{b} #{c}\"\n end\n @vnbuffer.each_triple do |a,b,c|\n f.puts \"vn #{a} #{b} #{c}\"\n end\n @fbuffer.each_triple do |a,b,c|\n f.puts \"f #{a+1}//#{a+1} #{b+1}//#{b+1} #{c+1}//#{c+1}\"\n end\n end\n self\n end",
"def write(file=nil)\n file = file.nil? ? @file : file\n File.open(file, 'w+') {|f|\n @lines.each{|line|\n f.write(\"#{line}\\r\\n\")\n }\n }\n end",
"def save_data(rec, table_name, file, stream, divider = '; ', finalizer = nil)\n @current_rev[table_name] = rec.GetValAsLongByIndex(1)\n\n fields = stream.TableSet.FieldList(table_name) #\"deal\"]\n file.puts fields.split(',').map { |f| \"#{f}=#{rec.GetValAsString(f)}\" }.join divider\n file.puts(finalizer) if finalizer\n file.flush\n end",
"def write_array_to_file\n lines = File.new('aperm.txt', 'w+')\n\n @@book_class.each_with_index do | book |\n lines.puts \"#{book.id}/#{book.title}/#{book.author}/#{book.due_date}\"end\n lines.close\n end",
"def write\n File.open(@file, 'a') do |w| \n w.write(\"\\n\"+ @name + \" \" + @path)\n end\n end",
"def write_out(rows)\n File.open(file_name, 'w') do |f|\n f.puts rows\n end\n end",
"def append_idea idea\n open(\"#{FileName}.txt\", 'a') do |file|\n file.puts idea\n end\n\n File.read(\"#{FileName}.txt\")\nend",
"def save\n file = File.new(@file,\"w+\")\n @properties.each {|key,value| file.puts \"#{key}=#{value}\\n\" }\nend",
"def save\n file = File.new(@file,\"w+\")\n @properties.each {|key,value| file.puts \"#{key}=#{value}\\n\" }\n file.close\n end",
"def write_to_file\n file = File.open(@filename_erl,\"a\")\n file.puts @head, @erl, @sig_sub\n file.puts @sub if @@sub_struct_flag\n (file.puts @un_arr.uni_def, @un_arr.uni_func, @un_arr.uni_func_2) if @@union_flag\n (file.puts @un_arr.arr_def, @un_arr.arr_func) if @@dyn_array_flag\n file.close\n File.open(@filename_hrl, \"a\") {|f| f.puts @const, @enum, @hrl}\n end",
"def render(file)\n File.open(file,'w+') do |f|\n values.each do |v|\n f.write(\"#\" + v[:time].to_i.to_s + \"\\n\") if v[:time] and not (v[:time].to_i == 0)\n f.write(v[:cmd] + \"\\n\")\n end\n end\n end",
"def write_to_file\n File.open(config.block_list_path, 'a') do |f|\n block_count = old_newest_block ? (block_list.size - old_newest_block.height - 1) : block_list.size\n block_list = self.block_list.sort{|(k1, v1), (k2, v2)| v1.height <=> v2.height}\n block_list = block_list[(old_newest_block.height + 1)..-1] if old_newest_block\n block_list.each_with_index do |(k, b), index|\n f.write(b.to_payload)\n f.flush\n print \"\\r#{(((index + 1).to_f / block_count) * 100).to_i}% done write parsed block to #{config.block_list_path}.\"\n end\n f.write(newest_block.to_payload)\n puts\n end\n end",
"def write_config()\nafile = File.open(\"cp3nodes.conf\", \"w\")\nafile.puts \"1 127.0.0.1 25500 25501 25502\\n\"\nafile.puts \"2 127.0.0.1 25503 25504 25505\\n\"\nafile.puts \"3 127.0.0.1 25506 25507 25508\\n\"\nafile.close\nend",
"def write!(val)\n if val != nil\n if @buffer[@youngest..-1].any? { |val| val == nil }\n write(val)\n else\n @buffer[@oldest] = val\n @youngest = @oldest\n @oldest = increment_oldest(@buffer.size)\n end\n end\n end",
"def flush\n File.open(path,'a'){|f| f.write @file_content}\n @file_content = ''\n end",
"def save()\n str = \"\"\n @base.each_value do |item|\n if item.is_a?(BasicFood)\n str += item.name + \",b,\" + item.calories\n elsif item.is_a?(Recipe)\n str += item.name + \",r\"\n item.foods.each do |food|\n str += \",\" + food.name \n end\n end\n str += \"\\n\"\n end\n File.open(\"FoodDB.txt\",\"w\").write(str)\n end",
"def file_finished(file, offenses); end",
"def save_to_file\n\t\tFile.open(@output, \"w+\") do |file|\n\t\t\tfile.puts \"[b][align=center]\"\n\t\t\trandomize if @random\n\t\t\t@output_data.each_line { |line| line.delete('\\n') }\n\t\t\tfile.puts @output_data\n\t\t\tfile.puts \"[/align][/b][align=center][sup]Made with [user]kryszanek[/user]'s [url=http://github.com/kryszan/cloudy]cloudy[/url]\\\\m/ [/sup][/align]\"\n\t\tend\n\tend",
"def data_write\n fd = File.new('fraze.dat',\"w\")\n $words.each_index do\n |iw|\n printf(fd,\"%s|%d|%d|%s|%s\\n\",\n $words[iw].fname,\n $words[iw].enlevel,\n $words[iw].czlevel,\n $words[iw].english,\n $words[iw].czech)\n end\n fd.close\n puts \"\\nDatabase stored\"\nend",
"def update_csv(card)\n @deck = Deck.new([card])\n text_to_add = write_csv\n file = File.open(\"./files/#{@filename}.txt\", 'a+')\n file.puts(write_csv)\n file.close\n @deck = @stupid_deck_saver\n\n end",
"def save_wizards\n #open the file for writing\n file = File.open(\"wizards.csv\", \"w\")\n # iterate over the array of save_wizards\n @wizards.each do |wizard|\n wizard_data = [wizard[:name], wizard[:house]]\n csv_line = wizard_data.join(\",\")\n file.puts csv_line\n end\n file.close\nend",
"def file_update\n File.open(\"fasta_files/#{@fasta_file_name}\", \"a\") do |file|\n file.puts \"\\n\"\n file.puts \"Most Frequent Sequences\"\n most_frequent_seq(range = 10).each do |seq|\n file.puts \"Sequence Count: #{seq.last}\"\n file.puts \"Sequence: #{seq.first}\"\n file.puts \"\\n\"\n end\n end\n end",
"def filewrt(file2wrt, data2wrt)\n output = ::File.open(file2wrt, \"ab\")\n if data2wrt\n data2wrt.each_line do |d|\n output.puts(d)\n end\n end\n output.close\n end",
"def clear\n transaction do |y|\n File.open(@file, 'w+'){|f| f.puts({}.to_yaml)}\n end\n end",
"def write_it( output_file, final_content )\n File.open(output_file, \"w\") {|f| f.write( final_content ) }\n end",
"def multiinputapp(uID, athlete, event, college, address)\n newish_file = File.new(\"entrants.txt\", \"a\")\n newish_file.puts uID \n newish_file.puts athlete \n newish_file.puts event\n newish_file.puts college\n newish_file.puts address\n newish_file.close\n\nend",
"def append_mode(line)\n File.open(\"#{file}\",\"a\") {|file| file.puts line}\n end",
"def write_footer(file)\n Record.new(GRT_ENDSTR).write(file)\n end",
"def save(arr, fname)\n f = File.open(fname, 'w') \n begin\n arr.shift\n x = arr.shift\n arr.shift\n y = arr.shift\n f.puts \"#{x} #{y}\"\n end until arr.empty?\n f.close\nend",
"def write_file(file_name)\n path = \"#{TARGET_DIRECTORY}/#{file_name}#{FILE_EXTENSION}\"\n unless false# File.exists? path\n \n # clean up front\n found_content = false\n while !found_content && [email protected]? do\n val = @content.shift\n unless val.strip.empty?\n @content.unshift(val)\n found_content = true\n end\n end\n\n # clean up back\n found_content = false\n while !found_content && [email protected]? do\n val = @content.pop\n unless val.strip.empty?\n @content.push(val)\n found_content = true\n end\n end\n\n return if @content.empty?\n\n puts \"Creating #{file_name}\"\n File.open(path, \"w\") {|f| f.puts @content.join(\"\")}\n end\n @content = []\nend",
"def write \n @histos.each{|h| h.Write}\n end",
"def save()\n str = \"\"\n @log.each_key do |date|\n @log[date].each do |item|\n str += item.to_s() + ',' + item.name + \"\\n\"\n end\n end\n File.open(\"DietLog.txt\",\"w\").write(str)\n end",
"def save_students\n File.open(user_filename, \"w\") do |file|\n @students.each do |student|\n student_data = [student[:name], student[:cohort], student[:hobbies]]\n csv_line = student_data.join(\",\")\n file.puts csv_line\n end\n end\nend",
"def save_tag(tag_vals)\n # strip first line\n # strip last line\n # save to file tag_vals[0]\nend",
"def updateDoneList(fcName)\n logFileName = @instrDir + \"/\" + @completedFCLog\n logFile = File.new(logFileName, \"a\")\n puts \"Adding to log : \" + logFileName + \" FC : \" + fcName.to_s\n logFile.puts fcName\n logFile.close \n end",
"def updateDoneList(fcName)\n logFileName = @instrDir + \"/\" + @completedFCLog\n logFile = File.new(logFileName, \"a\")\n puts \"Adding to log : \" + logFileName + \" FC : \" + fcName.to_s\n logFile.puts fcName\n logFile.close \n end",
"def write_content(file_out)\n file_out.puts(@array)\n end",
"def write(chunk, last_chunk = T.unsafe(nil)); end",
"def write(chunk, last_chunk = T.unsafe(nil)); end",
"def write(chunk, last_chunk = T.unsafe(nil)); end",
"def write(chunk, last_chunk = T.unsafe(nil)); end",
"def save_file_values\n parent = @dataset.parent\n\n @values.fetch(:file_values).each do |file_key, value_map|\n parent_file = parent.public_send(file_key)\n\n any_changes = value_map.any? do |cell, value|\n # Only includes values which are significantly different from the default. This may not\n # be future-proof, but at the time of writing we only edit carriers for which 4DP is\n # sufficient.\n #\n # See https://github.com/quintel/etlocal/issues/315\n value.round(4) != parent_file.get(cell.row, cell.column).round(4)\n end\n\n next unless any_changes\n\n basename = parent_file.path.relative_path_from(parent.dataset_dir)\n\n create_file_from_parent(\n parent_file.path,\n @dataset.dataset_dir.join(basename),\n value_map\n )\n end\n end",
"def write_file\n\n # file_edited is false when there was no match in the whole file and thus no contents have changed.\n if file_edited\n backup_pathname = original_pathname + \".old\"\n FileUtils.cp(original_pathname, backup_pathname, :preserve => true)\n File.open(original_pathname, \"w\") do |newfile|\n contents.each do |line|\n newfile.puts(line)\n end\n newfile.flush\n end\n end\n self.file_edited = false\n end",
"def export_blockchain(my_port)\r\n puts \"Exporting Blockchain...\".blue\r\n $status = \"Exporting Blockchain...\"\r\n file = File.new(\"#{my_port}_blockchain.txt\", \"w\")\r\n $blockchain.length.times do |i|\r\n file.puts \"From: #{$blockchain[i].payer}\"\r\n file.puts \"To: #{$blockchain[i].payee}\"\r\n file.puts \"Amount: #{$blockchain[i].amount}\"\r\n file.puts \"Mined By: #{$blockchain[i].miner}\"\r\n file.puts \"Previous Block Hash: #{$blockchain[i].prev_hash}\"\r\n file.puts \"Block Hash: #{$blockchain[i].hash}\"\r\n file.puts \"Nonce: #{$blockchain[i].nonce}\"\r\n file.puts \"------------------------------------------------------------------------------------------------------------------------\"\r\n end\r\n file.close\r\n puts \"Exported Blockchain\".blue\r\n $status = \"Exported Blockchain\"\r\nend",
"def write_training_file\n file = File.open('./train.data', 'w')\n\n file.puts \"#{@training_headlines.count} #{@number_of_inputs} #{@number_of_outputs}\"\n @training_headlines.find_each do |headline|\n file.puts vectorize_headline(headline).join(' ')\n file.puts vectorized_signs(headline).join(' ')\n file.puts\n file.puts\n end\n\n file.close\n end",
"def save_history(file=DEF_HISTORY_FILE)\n begin\n f = File.new(file, File::CREAT|File::TRUNC|File::RDWR, 0644)\n f.puts(@rundate)\n @currprocstat.each do |username,time|\n f.puts(\"#{username} #{time} #{@currprociowait[username]}\")\n end\n f.close\n rescue => e\n puts \"Cannot save history data: #{e}\"\n end\n end",
"def close_write(*) end",
"def log_input\n File.open('./log/ultimo_registro.txt', 'w+') do |f| \n f.puts Time.now.strftime(\"%Y%m%d-%H:%M\").to_s\n end \n end",
"def save_and_exit(appointments)\n File.open('details.txt', 'w') do |f|\n appointments.each do |element|\n f.puts(\"#{element.doctor_name},#{element.date},#{element.time},#{element.full_name},#{element.dob},#{element.mobile_num}\")\n end\n end\nrescue StandardError => e\n puts \"failed to save #{e}\"\nend",
"def save\n file = File.new(@file, 'w+')\n @properties.each { |key, value| file.puts \"#{key}=#{value}\\n\" }\n end",
"def ingresar_producto(nuevo)\n file = File.open('productos.txt','a')\n file.puts nuevo\n file.close\nend"
] | [
"0.6356724",
"0.62938505",
"0.62356156",
"0.61873424",
"0.61844957",
"0.61325985",
"0.5942598",
"0.5942044",
"0.5942044",
"0.5873646",
"0.5858707",
"0.58343226",
"0.5833711",
"0.58302027",
"0.58269113",
"0.58243334",
"0.58200735",
"0.5815333",
"0.5812547",
"0.5812547",
"0.5797011",
"0.5797011",
"0.5797011",
"0.5763905",
"0.57621527",
"0.57598114",
"0.5708624",
"0.5706118",
"0.5704629",
"0.5678452",
"0.5662928",
"0.5658906",
"0.56574434",
"0.56226236",
"0.5600284",
"0.56001717",
"0.55862725",
"0.5577119",
"0.5576567",
"0.5571038",
"0.55699223",
"0.5563418",
"0.55595976",
"0.55498743",
"0.5544538",
"0.55442506",
"0.55424476",
"0.5538559",
"0.5527003",
"0.55209297",
"0.5520814",
"0.55167615",
"0.55068326",
"0.54999137",
"0.5494302",
"0.54879034",
"0.5486141",
"0.54684436",
"0.5460289",
"0.5452407",
"0.5449465",
"0.5448292",
"0.5445667",
"0.5445512",
"0.54427564",
"0.54335785",
"0.54287636",
"0.5428138",
"0.5427231",
"0.54234815",
"0.5412424",
"0.5411174",
"0.5408376",
"0.54073775",
"0.54061776",
"0.5403828",
"0.53978276",
"0.5392724",
"0.53899837",
"0.5389927",
"0.5382082",
"0.5377073",
"0.53753805",
"0.5361472",
"0.5361472",
"0.53521425",
"0.53515714",
"0.53515714",
"0.53515714",
"0.53515714",
"0.53508735",
"0.5347122",
"0.5345518",
"0.5337776",
"0.53353924",
"0.53336304",
"0.53303695",
"0.5328068",
"0.53272206",
"0.53250515"
] | 0.65162426 | 0 |
This destroy code works but I think it allows any loggedin user to delete another user, not just the admin. | def destroy
@user.destroy
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n if @current_user.id = @user.id\n log_out (@current_user)\n end\n @user.destroy\n if @current_user.admin?\n redirect_to users_url\n else\n redirect_to root_url\n end\n end",
"def destroy\n user = User.find(params[:id])\n # if admin tries to delete himself\n if current_user?(user)\n flash[:error] = \"Admins are not allowed to self destruct\"\n redirect_to users_path\n else\n user.destroy\n flash[:success] = \"User #{user.name} was successfully deleted.\"\n redirect_to users_path\n end\n end",
"def destroy\n if @user.admin == true\n flash[:danger] = \"You cannot delete an admin\"\n redirect_to users_path\n else\n flash[:success] = \"Delete success\"\n Antenna.where(user_id: @user.id).delete_all\n OwnBox.where(user_id: @user.id).delete_all\n OwnDevice.where(user_id: @user.id).delete_all\n @user.destroy\n redirect_to users_path\n end\n end",
"def destroy\n if User.find(params[:id]).admin?\n redirect_to users_url\n else\n User.find(params[:id]).delete\n flash[:sucess] = \"User deleted\"\n redirect_to users_url\n end\n end",
"def destroy\n # allows admin to destroy users w/o being logged out themselves\n if @user.id == current_user.id\n reset_session\n @user.destroy\n flash[:notice] = \"You've successfully deleted your account.\"\n redirect_to preview_path\n else\n @user.destroy\n flash[:notice] = \"User successfully destroyed.\"\n redirect_to last_delete_url\n end\n end",
"def destroy\n UserService.deleteUser(params[:id],current_admin[:id])\n redirect_to users_path\n end",
"def destroy\n @user = User.find(params[:id])\n if @user.tasks.present?\n Task.where(user_id: params[:id]).destroy_all\n end\n if @user.id == current_user.id\n redirect_to admin_users_url, notice: \"You can not delete signed in user\"\n @admin = User.admin\n elsif @admin == 1\n redirect_to admin_users_url, notice: \"Atleast one admin must remain!\"\n else\n @user.destroy\n redirect_to admin_users_url, notice: 'User was successfully destroyed.'\n end\n end",
"def destroy_user(id)\n #TODO:\n # ADD SOME USER LEVEL TO AVOID THESE\n end",
"def destroy\n\n #Make sure only logged in admins can manipulate users\n\n if @loggedinuser && @loggedinuser.authorizationlevel >= 4\n @user = User.find(params[:id])\n if (@user)\n @user.destroy\n end\n redirect_to :action => 'index'\n else\n redirect_to '/'\n end \n end",
"def destroy\n authorize! :destroy, @user, :message => 'You are not authorized to perform this operation.'\n user = User.find(params[:id])\n unless user == current_user\n user.destroy\n redirect_to users_path, :notice => \"User deleted. #{undo_link}\"\n else\n redirect_to users_path, :notice => \"Can't delete yourself.\"\n end\n\n end",
"def destroy\n if current_user && current_user.admin? \n @user = User.find(params[:id])\n @user.destroy\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n else\n flash[:notice] = 'You do not have Admin rights to delete a user'\n redirect_to home_index_path\n end\n end",
"def destroy\n user = User.find(params[:id])\n # Works\n if (current_user == user) && (!current_user.admin?)\n user.destroy\n flash[:success] = \"Your profile and related stories are gone.\"\n # Works\n elsif (current_user == user) && (current_user.admin?)\n flash[:error] = \"Cannot delete own admin account\"\n elsif (current_user != user) && (!current_user.admin?)\n flash[:error] = \"You cannot delete other users.\"\n elsif (current_user != user) && (current_user.admin?)\n user.destroy\n flash[:success] = \"User and related posts destroyed.\"\n end\n redirect_to root_path\n end",
"def destroy\n @user = User.find(params[:id])\n\tif @user.name == session[:name]\t\n\t\treset_session\n\tend\n\tadminCount = User.count(:conditions => [\"admin = ?\", true])\n\tif @user.admin && adminCount == 1\n\t\tflash[:notice] = \"Can't delete last admin\"\n\telse\n\t\[email protected]\t\n\tend\n\n respond_to do |format|\n format.html { redirect_to members_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.delete!\n\n redirect_to admin_users_path\n end",
"def destroy\n @user = User.find(params[:id])\n @user.delete!\n\n redirect_to admin_users_path\n end",
"def destroy\n # Make sure the request came from an admin\n unless session[:admin_id]\n redirect_to_home\n return\n end\n \n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n if is_admin?\n\n if @user.role == \"Super Administrator\"\n flash[:notice] = \"The Super Administrator cannot be deleted\"\n redirect_to @user\n return\n end\n if @user.role == \"Administrator\"\n if !@superadmin_user\n if !(@current_user == @user)\n flash[:notice] = \"Only the super administrator can delete other administrators\"\n redirect_to @user\n return\n end\n end\n end\n else\n if !(@current_user == @user)\n flash[:notice] = \"You do not have permission to delete this user!\"\n redirect_to @current_user\n return\n end\n end\n @posts = Post.where(:user_id => @user.id).all\n #@replies = Reply.where(:user_id => @user.id).all\n @anonymous = User.where(:username => 'Anonymous').first\n @posts.each do |p|\n p.update_attributes(:user_id => @anonymous.id)\n end\n #@replies.each do |r|\n # r.update_attributes(:user_id => @anonymous.id)\n #end\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n # destroy not implemented - only admins may \"purge\" or \"delete\" users\n raise \"This action is not implemented\"\n end",
"def delete_user\n end",
"def destroy\n if user_signed_in? && current_user.admin?\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n else\n redirect_to root_path\n end\n end",
"def destroy\n @user = User.find(params[:id])\n if current_user?(@user)\n redirect_to users_path, notice: \"Admins are not able to delete themselves.\"\n else\n @user.destroy\n flash[:success] = \"User deleted.\"\n redirect_to users_url\n end\n end",
"def destroy\n @user.destroy\n respond_to do |format|\n format.html { redirect_to(admin_users_url) }\n format.xml { head :ok }\n end\n website.add_log(user: current_user, action: \"Deleted user #{@user.name}\")\n end",
"def destroy\n @user = User.find(params[:id])\n\n if @user.id == current_user.id\n redirect_to :back, notice: 'user.delete_self'\n return\n elsif @user.id < current_user.id\n redirect_to :back, notice: 'user.delete_admin_with_smaller_ID'\n return\n end\n\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url, notice: 'user.deleted' }\n format.json { head :no_content }\n end\n end",
"def destroy\n #raise Webapp::NotAllowedError unless has_session?\n #user = User.find(user_session.user_id)\n #@user = get_user_for_update(params[:id])\n @user = User.find(params[:id])\n #raise Webapp::NotAllowedError unless user.admin || user.id == @user.id\n @user.destroy\n \n #loging out\n clear_user_session(params[:id]) if user_session.user_id.to_s == params[:id].to_s \n flash_notice(:user_removed)\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n \n end",
"def destroy\n if current_user.is_an_admin?\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n else\n flash[:error] = \"That action is not permitted.\"\n redirect_back_or_default('/')\n end \n end",
"def destroy\n @user = User.find(params[:id])\n if (session[:user] && session[:user].admin == 1)\n User.destroyCascade(@user)\n end\n \n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n\t\tif(is_admin?)\n\t @user = User.find(params[:id])\n \t \[email protected]\n\t respond_to do |format|\n \t \tformat.html { redirect_to(users_url) }\n \t \tformat.xml { head :ok }\n\t\t\tend\n\t\telse\n\t\t\tredirect_to user_path, notice: 'Access Denied'\n end\n end",
"def delete\n @user = User.find(params[:id])\n @user.destroy if @user!=nil # TODO maybe set status to 0 as deleted instead of removing entry\n flash[:notice] = \"User '#{@user.username}' deleted successfully.\"\n\n # when admin delete himself\n if session[:user_id]== @user.id\n session[:user_id] = nil\n session[:username] = nil\n end\n redirect_to(:action => 'list')\n end",
"def destroy\n if [email protected]_admin && @user.destroy\n flash[:notice] = \"User deleted successfully\"\n else\n flash[:alert] = \"Unable to delete user\"\n end\n redirect_to users_path\n end",
"def destroy\n @user = User.find(params[:id])\n\n # Special-case code that comes from devctm_template that you will want\n # to remove when you use a more sophisticated authorization system\n\n if @user.admin?\n\n # The rationale for not allowing an admin account to be deleted\n # when we have a very simplistic idea of an admin account is to\n # avoid the situation where there no longer is an admin account\n # because of accidental deletion. This may be acceptable for\n # simple apps and this code is easily deleted once it gets in\n # the way.\n\n respond_to do |format|\n format.html do\n flash[:notice] = 'An admin account may not be deleted.'\n redirect_to(admin_users_url)\n end\n format.xml do\n @user.errors.add_to_base('An admin account may not be deleted')\n render :xml => @user.errors, :status => :forbidden\n end\n end\n else\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_users_url) }\n format.xml { head :ok }\n end\n end\n end",
"def destroy\n @user = User.find(params[:id])\n\n if is_admin\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n #format.json { head :ok }\n end\n else\n redirect_to @user\n end \n end",
"def destroy\n @user = User.find(params[:id])\n\n if is_admin\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n #format.json { head :ok }\n end\n else\n redirect_to @user\n end \n end",
"def destroy\n user_to_delete = User.find(params[:id])\n if (current_user?(user_to_delete))\n flash[:error] = \"You cannot delete yourself!\"\n else\n user_to_delete.destroy\n flash[:success] = \"User deleted.\"\n end\n redirect_to users_url \n end",
"def destroy\n if @user != current_user && !current_user.admin?\n render json: ['Not authorized for that action'], status: :unauthorized\n else\n if @user.destroy\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end\n end",
"def destroy\n @user = User.find(params[:id])\n #here session[:ad] holds the id of the logged in admin. and the user is destroyed only if the logged in user is admin. That is the functionality of this method.\n if(session[:ad]!=nil)\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_users_url }\n end\n end",
"def destroy\n deleted = false\n # Não é possível deletar o último super admin\n if @user.can_delete?(current_user)\n @user.destroy\n deleted = true\n end\n\n respond_to do |format|\n if deleted\n format.html { redirect_to admin_users_url, notice: \"Usuário deletado com sucesso!\" }\n else\n format.html { redirect_to admin_users_url, alert: \"Impossível deletar o último SuperAdmin do sistema ou usuário de um aluno!\" }\n end\n format.json { head :no_content }\n end\n end",
"def destroy\n if params[:id] != current_user.id && current_user.is_admin == false\n \traise \"You are not authorized to access this function\"\n end \n @user = User.find(params[:id]).destroy\n respond_with(@user)\n end",
"def destroy\n user = User.find(params[:id])\n if user.role == 'admin'\n user.destroy\n render json: { status: 200, msg: 'User has been deleted.' }\n else\n not_auth\n end\n end",
"def destroy\n restrict('allow only admins') or begin\n @user = User.find_by_id(params[:id])\n if @user.destroy\n respond_to do |format|\n format.html { redirect_to manage_users_url }\n format.xml { head :ok }\n end\n else\n \n end\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.delete\n flash[:notice] = t('users.destroyed')\n redirect_to admin_users_url\n end",
"def destroy\n if @user == current_user or @user.super_admin?\n return redirect_to super_admin_users_path, alert: 'Super Admins cannot be deleted'\n end\n @user.destroy\n respond_to do |format|\n format.html { redirect_to super_admin_users_path, notice: 'Super Admin was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n\n respond_to do |format|\n if session[:user].isadmin? && session[:user].username == @user.username\n flash[:error] = 'Admins cannot delete themselves.'\n format.html { redirect_to @user }\n elsif !session[:user].nil? && !session[:user].isadmin?\n flash[:error] = 'Only admins can delete users.'\n format.html { redirect_to @user }\n else\n @user.destroy\n format.html { redirect_to :action => \"show_all\" }\n format.json { head :no_content }\n end\n end\n end",
"def destroy\n @admin_admin_user = Admin::AdminUser.find(params[:id])\n @admin_admin_user.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_admin_users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n if check_user_write_access\n user.destroy\n\n respond_to do |format|\n format.html { redirect_to :root }\n format.json { head :no_content }\n end\n end\n end",
"def destroy\n if @user.authority == '2'\n flash[:danger] = 'Pre-configured Admin Cannot Be Deleted'\n redirect_to users_path\n elsif @user.email == current_user.email\n flash[:danger] = 'Oops. Don\\'t Delete Yourself'\n redirect_to users_path\n else\n sql = \"delete from histories where email = '#{@user.email}' and (date > '#{Time.now.to_date}' or (date = '#{Time.now.to_date}' and begintime > '#{Time.now.hour}' ))\"\n h = History.find_by_sql(sql)\n @user.destroy\n redirect_to users_path\n flash[:success] = 'User Was Successfully Deleted'\n end\n end",
"def destroy\n @user.destroy\n respond_to do |format|\n if current_user.isAdmin?\n format.html { redirect_to home_admin_path, notice: 'Successfully destroyed.' }\n elsif current_user.isSuperadmin?\n format.html { redirect_to home_superadmin_path, notice: 'Successfully destroyed.' }\n end\n end\n end",
"def destroy\n if current_user == User.find(params[:id])\n redirect_to root_path\n else\n User.find(params[:id]).destroy\n flash[:success] = \"User destroyed.\"\n redirect_to users_path\n end\n end",
"def destroy\n if (!current_groupee.nil? && current_groupee.admin?)\n groupee = Groupee.find_by_username(params[:id])\n #ensures that an admin can not delete another admin\n if !groupee.admin?\n groupee.destroy\n redirect_to groupees_path, :notice => \"Groupee account was deleted\"\n else\n redirect_to groupees_path\n end\n else\n render \"shared/403\"\n end\n end",
"def destroy \n if !current_user.isScrumMasterOrProductOwner?\n if !current_user.isAdmin?\n if current_user.id == @user.id\n borrar\n else\n redirect_to(root_path, notice: \"You can not delete other users\")\n end\n else\n if User.where(:role => \"admin\").count > 1 or @user.role == \"user\"\n borrar\n else\n redirect_to(users_path, notice: \"It is not allowed to delete the admin\")\n end\n end\n else\n redirect_to(root_path, notice: \"It is not allowed to delete users while being a Scrum Master or Product Owner\")\n end\n end",
"def destroy\n @admin_user = AdminUser.find(params[:id])\n @admin_user.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_user = AdminUser.find(params[:id])\n @admin_user.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = current_user\n @user.destroy\n redirect_to root_url\n end",
"def destroy\n @current_user.destroy\n end",
"def destroy\n @user = User.find(params.require(:id))\n\n if @user == current_user\n flash[:alert] = t('users.msg.cannot_delete_yourself')\n raise 'Cannot delete yourself'\n end\n\n # delete user from zabbix\n begin\n @user.zabbix_servers.each do |s|\n z = Zabbix.new(s.fqdn, current_user.email, current_user.encrypted_password)\n z.delete_user(@user.email)\n end\n rescue StandardError => ex\n flash[:alert] = I18n.t('users.msg.error', msg: ex.message)\n raise\n end\n\n # delete user from SkyHopper\n @user.destroy\n\n flash[:notice] = t('users.msg.deleted', name: @user.email)\n redirect_to(action: :index)\n end",
"def destroy\n authorize(@user, :update?)\n\n @user.destroy\n\n redirect_to users_path, notice: t('user.deleted')\n end",
"def destroy\n @user = User.find_by_username(params[:id])\n authorize! :manage, @user\n \n if !current_user.has_role?(:admin)\n redirect_to root_url, alert: \"Only admins allowed.\"\n else\n \n\n respond_to do |format|\n if @user.destroy\n format.html { redirect_to root_url, notice: \"User deleted.\" } \n else\n format.html { redirect_to user_path(@user.username), notice: \"User deactivated.\" } \n end\n end\n end\n end",
"def destroy\n user = @current_user\n if user.destroy\n head :no_content\n else\n head :bad_request\n end\n end",
"def destroy\n\t\[email protected]\n\tend",
"def destroy\n\t\tif $user.id.to_i==params[:id].to_i\n\t\t User.destroy(params[:id])\n\t\t\t$user=nil\n\t\t\t$helper=false\n\t\t\tis_user_logged_in?\n\t\t\tflash[:notice]=\"You deleted your own account\"\n\t\telse\n\t\t\tUser.destroy(params[:id])\n\t\t\tredirect_to \"/users\"\n\t\t\tis_user_logged_in?\n\t\tend\n end",
"def destroy\n @adminuser = Adminuser.find(params[:id])\n @adminuser.destroy\n\n respond_to do |format|\n format.html { redirect_to adminusers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n current_user.destroy\n redirect_to site_root_url\n end",
"def destroy\n user.destroy\n end",
"def destroy\n @user = User.shod(params[:id])\n authorize! :delete, @user\n @user.destroy\n flash[:user_delete] = t('user_delete')\n redirect_to users_path\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = current_org.users.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_path }\n format.json { head :no_content }\n end\n\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n\t\tif @user == current_user\n\t\t\tsession[:user_id] = nil\n\t\t\t@current_ability = nil \n\t\tend\n\t\[email protected]\n\t\tflash[:notice] = \"User was successfully deleted.\"\n\t\tredirect_to root_url\n\tend",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n if current_user == @user\n @user.destroy\n \n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n else\n flash[:error] = \"Naughty naughty. You can't delete other people.\"\n end\n end",
"def destroy\n #first we find the user by its id.\n @user = User.find(params[:id])\n #than we need to check if the user is not trying to delete its self. So, we check if the found user is the logged one.\n if @user == current_user\n #if yes, we display the error message and redirect to INDEX action.\n flash[:error] = \"User can't be deleted\"\n redirect_to users_path\n else\n #if the logged user in not the same as the user to be deleted, we can delete it and display a success message.\n @user.destroy\n flash[:success] = \"User deleted!\"\n redirect_to users_path\n end\n end",
"def destroy\n @useradmin = Useradmin.find(params[:id])\n @useradmin.destroy\n\n respond_to do |format|\n format.html { redirect_to useradmins_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_user.destroy\n respond_to do |format|\n format.html { redirect_to admin_users_url, notice: 'User was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_user.destroy\n respond_to do |format|\n format.html { redirect_to admin_users_url, notice: 'User was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_user.destroy\n respond_to do |format|\n format.html { redirect_to admin_users_url, notice: 'User was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_user.destroy\n respond_to do |format|\n format.html { redirect_to admin_users_url, notice: 'User was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n\t\tcurrent_user\n\t\tcurrent_user.regexpressions.destroy_all\n\t\tcurrent_user.tasks.destroy_all\n\t\tcurrent_user.clouds.destroy_all\n\t\tcurrent_user.platforms.destroy_all\n\t\tcurrent_user.demos.destroy_all\n\t\tcurrent_user.favorites.destroy_all\n\tend",
"def admin_deny_user\n @user.destroy\n redirect_to admin_path, notice: \"User Denied and Account Deleted\"\n end",
"def destroy\n\n if @user.has_role? :superadmin\n respond_to do |format|\n format.html { redirect_to admin_users_url, alert: 'Can\\'t destroy superadmin users.' }\n format.json { render json: 'Can\\'t destroy superadmin users.', status: :unprocessable_entity }\n end\n return\n end\n\n @user.email = @user.email + '.' + @user.id.to_s + '.deleted.com'\n unless @user.save\n respond_to do |format|\n format.html { redirect_to admin_users_url, alert: @user.errors.full_messages().join(', ') }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n return\n end\n @user.destroy\n respond_to do |format|\n format.html { redirect_to admin_users_url, notice: 'User was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n current_user.deleted!\n\n expose current_user\n end",
"def delete_confirm\n return appctrl_not_permitted() unless ( @current_user.admin? )\n\n # Nobody can delete admin accounts. You must assign the admin\n # privilege to someone else, then, since you can't revoke your\n # own admin privileges either, have the new admin change your\n # account type and delete the user record. This is a good way\n # of ensuring that there is always at least one admin.\n\n @record = User.find( params[ :id ] )\n return appctrl_not_permitted() if ( @record.admin? )\n\n @record.destroy()\n\n flash[ :notice ] = 'User and all associated data deleted'\n redirect_to( users_path() )\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to dm_core.admin_users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user.destroy\n respond_with( [ :admin, @user] )\n end",
"def destroy\n\t\tif admin?\n\t\t\[email protected]\n\t\t\tredirect_to users_url\n\t\telsif password == session[:password]\n \t \[email protected]\n\t\t\treset_session\n\t\t\trespond_to do |format|\n \tformat.html { redirect_to '/', notice: 'User was successfully destroyed.' }\n \tformat.json { head :no_content }\n \tend\n\t\telse\n\t\t\trender :edit\n\t\tend\n end",
"def destroy\n if current_user.is_admin?\n @user = User.find(params[:id])\n if @user.is_teacher?\n Query.destroy_all([\"teacher_id = ?\", @user.id])\n else \n Query.destroy_all([\"student_id = ?\", @user.id])\n end\n @user.destroy\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { render :xml => \"success\" }\n end\n else\n respond_to do |format|\n flash[:notice] = 'You cannot do this.'\n format.html { redirect_to(@user) }\n format.xml { render :text => \"error\" }\n end\n end\n end",
"def destroy\n\t\t# Log out before deleting user if logged in as user to be deleted.\n\t\tsession[\"current_user_id\"] = nil if session[\"current_user_id\"] == @user.id\n\n\t\[email protected]\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to users_url }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend",
"def destroy_user\n if !user.blank?\n user.destroy\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @current = User.find(session[:user_id])\n\n unless @current.admin?\n flash[:error] = \"You do not have permission to delete this player!\"\n redirect_to user_path(@user)\n return\n end\n\n unless @user.total_games == 0\n flash[:error] = \"You cannot delete a user with at least 1 recorded game.\"\n redirect_to user_path(@user)\n return\n end\n\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n before_action :authenticate_user\n @user.destroy\n end",
"def destroy\n if session[:admin_user]\n old_user = session[:user]\n session[:user] = session[:admin_user]\n session.delete(:admin_user)\n flash[:success] = \"Logged out <b>#{old_user.username}</b>, returned to <b>#{session[:user].username}</b>\".html_safe\n else\n session[:user] = nil\n flash[:success] = \"You have successfully logged out\"\n end\n redirect_to request.referer || \"/\"\n end",
"def destroy\n\t\tbegin\n\t\t\tif(@user.super)\n\t\t\t\traise \"NO_ACCESS\"\n\t\t\telse\n\t\t\t\[email protected]\n\t\t\t\trespond_to do |format|\n\t\t\t\t\tformat.html { redirect_to users_url, notice: 'User was successfully destroyed.' }\n\t\t\t\tend\n\t\t\tend\n\t\trescue\n\t\t\trender \"error\"\n\t\telse\n\t\tend\n\n\n\tend",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n redirect_to admin_profiles_path\n end",
"def destroy_user\n self.own_children.each do |child|\n unless child.admins.where([\"relations.user_id != ?\", self.id]).any?\n child.destroy_child\n end\n end\n self.destroy\n end",
"def destroy\n @user.destroy\n sign_out if @user == current_user\n redirect_to root_path, notice: \"#{@user.email} deleted\"\n end",
"def destroy\nif current_user\n @user = User.find(params[:id])\n if (current_user.username == 'Administrator')||(current_user.username == @user.username)\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n\telse\n \tredirect_to root_url, :notice => 'Uwaga! Nie masz uprawnień!'\n \tend\n else\n redirect_to :login, :notice => 'Informacja! Zaloguj się aby obejrzeć!'\n end\n end",
"def destroy\n authorize @user\n @user.destroy\n\n head :no_content\n end",
"def destroy\n if session[:admin]\n @current_user = User.find(session[:admin])\n set_user\n else\n reset_session\n flash[:notice] = \"Logged out successfully\"\n if params[:redirect_to]\n redirect_to params[:redirect_to]\n else\n redirect_to action: 'new'\n end\n end\n end",
"def destroy\n @user = User.find(params[:id])\n unless current_user_or_admin\n flash[:warning] = 'Not signed in correctly'\n redirect_to root_url\n else\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end\n end"
] | [
"0.8270667",
"0.8189494",
"0.8188857",
"0.8183297",
"0.8120714",
"0.811421",
"0.8106924",
"0.8075243",
"0.80613667",
"0.8032436",
"0.8028772",
"0.79900986",
"0.7974144",
"0.79613155",
"0.79613155",
"0.7960068",
"0.795053",
"0.7948487",
"0.7942245",
"0.7928578",
"0.7923336",
"0.79194975",
"0.7893678",
"0.7887881",
"0.788672",
"0.78724277",
"0.7860777",
"0.7847773",
"0.78417283",
"0.783966",
"0.7837878",
"0.7837878",
"0.78378755",
"0.783467",
"0.7834123",
"0.7827933",
"0.78165925",
"0.78141266",
"0.7811798",
"0.7804266",
"0.7797662",
"0.7789332",
"0.77664787",
"0.77641153",
"0.77612704",
"0.7747027",
"0.7740507",
"0.77364165",
"0.77327216",
"0.77240807",
"0.772296",
"0.7702674",
"0.7701242",
"0.7697787",
"0.7689462",
"0.7678186",
"0.76759124",
"0.7669236",
"0.76566416",
"0.7651883",
"0.76389605",
"0.7633071",
"0.7623867",
"0.7618875",
"0.76178586",
"0.76178586",
"0.76178586",
"0.76178586",
"0.76151764",
"0.7614668",
"0.76095223",
"0.76061934",
"0.76006204",
"0.7599121",
"0.7596987",
"0.75906",
"0.75906",
"0.75906",
"0.75906",
"0.75848246",
"0.7578896",
"0.7578894",
"0.75768465",
"0.7573885",
"0.7569359",
"0.7569181",
"0.7567911",
"0.7564901",
"0.7563156",
"0.75576466",
"0.75547427",
"0.75544095",
"0.7549543",
"0.75406456",
"0.75392556",
"0.7537469",
"0.7536266",
"0.7536105",
"0.75335085",
"0.75302804",
"0.752045"
] | 0.0 | -1 |
Retrieves the aggregate data. | def get aggregate_alias = nil
if @aggregate_fields.count > 1 && aggregate_alias.nil?
raise ArgumentError, "Required param aggregate_alias for AggregateQuery with multiple aggregate fields"
end
aggregate_alias ||= @aggregate_fields.keys.first
@aggregate_fields[aggregate_alias]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def data\n @data ||= aggregate\n end",
"def data\n @data ||= aggregate(:single)\n end",
"def aggregates\n self.class.instance_variable_get(:@aggregates) || {}\n end",
"def aggregates\n @aggregates\n end",
"def get_aggregate aggregate_query\n ensure_not_closed!\n ensure_service!\n\n return enum_for :get_aggregate, aggregate_query unless block_given?\n\n results = service.run_aggregate_query aggregate_query.parent_path,\n aggregate_query.to_grpc,\n transaction: transaction_or_create\n results.each do |result|\n extract_transaction_from_result! result\n next if result.result.nil?\n yield AggregateQuerySnapshot.from_run_aggregate_query_response result\n end\n end",
"def aggregate\n public_send aggregate_name\n end",
"def get_all\n @data\n end",
"def aggregateData(aggregator)\n @timeStamps = aggregator.aggregate(@timeStamps, ChartDirector::AggregateFirst)\n @highData = aggregator.aggregate(@highData, ChartDirector::AggregateMax)\n @lowData = aggregator.aggregate(@lowData, ChartDirector::AggregateMin)\n @openData = aggregator.aggregate(@openData, ChartDirector::AggregateFirst)\n @closeData = aggregator.aggregate(@closeData, ChartDirector::AggregateLast)\n @volData = aggregator.aggregate(@volData, ChartDirector::AggregateSum)\n end",
"def aggregate\n []\n end",
"def data\n self.class.repository.query(:subject => subject)\n end",
"def all_data\n @data\n end",
"def retrieve_data\n @data_retrieved = nil\n\n @data_retrieved = @meeting.meeting_individual_results.\n includes(:meeting_event, :swimmer, :event_type, :category_type, :gender_type, :team_affiliation, meeting_event: [:heat_type]).\n to_a\n end",
"def get_db_aggregation\n db_data_all = []\n aggregation = @thermostat.readings.pluck('Avg(temperature)', 'Min(temperature)', 'Max(temperature)', 'Avg(humidity)', 'Min(humidity)', 'Max(humidity)', 'Avg(battery_charge)', 'Min(battery_charge)', 'Max(battery_charge)').first\n unless aggregation.empty?\n db_data_all << {\"temperature\" => {\"avg\" => aggregation[0].round(2), \"min\" => aggregation[1], \"max\" => aggregation[2]}}\n db_data_all << {\"humidity\" => {\"avg\" => aggregation[3].round(2), \"min\" => aggregation[4], \"max\" => aggregation[5]}}\n db_data_all << {\"battery_charge\" => {\"avg\" => aggregation[6].round(2), \"min\" => aggregation[7], \"max\" => aggregation[8]}}\n end\n return db_data_all\n end",
"def all\n return @data\n end",
"def all\n return @data\n end",
"def aggregate(request)\n end",
"def aggregate\n data = {}\n data[:path] = self.path\n data[:name] = self.name\n data[:remotes] = self.remotes.map(&:name)\n data[:remote_urls] = self.remotes.map(&:url)\n data[:remote_branches] = self.remote_branches\n data[:project_identifier] = self.identifier\n data\n end",
"def aggregated_ratings\n PropertyRatingService::RatingData.new(self).data\n end",
"def aggregated_ratings\n PropertyRatingService::RatingData.new(self).data\n end",
"def all\n data\n end",
"def aggregate_fields\n cube_class.aggregate_fields\n end",
"def aggregated_over_time_query\n # TODO Remember to implement permitted parameters here\n query = @grouping_class.new(sanitized_attributes, params)\n @aggregated_over_time_data = Rails.cache.fetch(['aggregated_over_time_data', params], expires_in: 1.week) do\n query.aggregated_over_time_data\n end\n\n render json: @aggregated_over_time_data\n end",
"def get_items_content(start=nil,limit=nil)\n # TODO: Stubbed to return all items.\n get_values('aggregates')\n end",
"def data\n retrieve_data\n end",
"def all\n @data\n end",
"def get_items_content(start=nil,limit=nil)\n # TODO: Stubbed to return all items.\n get_values('aggregates')\n end",
"def aggregate\n data_hash = MediaSourceSerializer.new(\n available_sources, is_collection: true\n ).aggregated_hash\n\n unless params_valid?\n data_hash[:errors] = 'One or more specified MediaSources do not exist'\n end\n\n render json: data_hash.to_json\n end",
"def index\n @event_aggs = EventAgg.all\n end",
"def aggregations\n response['aggregations'] ? Hashie::Mash.new(response['aggregations']) : nil\n end",
"def statistics\n JSON.parse @gapi.statistics.to_json\n end",
"def aggregations\n @aggregations ||= AggregationSet.new\n end",
"def data\n @data\n end",
"def process_aggregates\n aggregates = new_collection\n\n unless assessment_group.scoring_type == 2 # do except for scoring type 'grades'\n aggregates.push new_aggregate('score','Total Score',@total_score)\n percentage = @total_score.zero? ? nil : ((@total_score / @total_max) * 100).round(2)\n aggregates.push new_aggregate('percentage','Total Percentage', percentage)\n aggregates.push new_aggregate('grade','Overall Grade',overall_grade_set.grade_string_for(percentage)) if overall_grade_set.present?\n end\n\n aggregates\n end",
"def data\r\n @data\r\n end",
"def data\n @data || set_collection_data\n end",
"def aggregateAndFetchDocuments(collection, aggregateArray)\n return collection.aggregate(aggregateArray)\n end",
"def stats\n return self.endpoint.stats(self.id)\n end",
"def data\n @datas\n end",
"def data\n @data\n end",
"def collection_data\n @collection && @collection['data']\n end",
"def get_data\n\t\texecute unless @result\n\t\treturn get_data_from_result(@result)\n\tend",
"def index\n @collected_data = CollectedDatum.all\n end",
"def retrieve_aggregates\n fail ArgumentError, \"Invalid range type '#{range_type}'\" unless %w(year month week day hour).include? range_type\n scope = LineAggregate.\n where(:function => function).\n where(:range_type => 'normal').\n where(:account => account.try(:to_s)).\n where(:partner_account => partner_account.try(:to_s)).\n where(:code => code.try(:to_s)).\n where(:filter => filter.inspect).\n where(LineAggregate.arel_table[range_type].not_eq(nil))\n @aggregates = scope.each_with_object({}) do |result, hash|\n hash[result.key] = formatted_amount(result.amount)\n end\n end",
"def data\n @data\n end",
"def data\n @data\n end",
"def data\n @data\n end",
"def read ()\n groups_validate\n\n gid = @options[:groupId]\n\n client = GroupsClient.new\n client.api_token = @options[:api_token]\n client.app_url = @options[:app_url]\n\n resp = client.read( gid)\n print_json resp\n end",
"def aggregate\n klass.collection.group(\n :key => field_list,\n :cond => selector,\n :initial => { :count => 0 },\n :reduce => Javascript.aggregate\n )\n end",
"def results\n @dataset.all\n end",
"def data\n data = @objects.try(:map) { |o| o.try(:data) }\n data.try(:compact!) || data\n end",
"def data\n @data\n end",
"def data\n @data\n end",
"def data\n @data\n end",
"def aggregate\n #response = Result.collection.map_reduce(self.map_fn(), _reduce(), :raw => true, :out => {:inline => true}, :query => {:execution_id => id})\n response = Result.where(execution_id: id).map_reduce(self.map_fn(), self.query.reduce).out(inline: true).raw()\n results = response['results']\n if results\n self.aggregate_result = {}\n results.each do |result|\n result = prettify_generated_result(result) if self.query.generated? && result['value']['rereduced']\n self.aggregate_result[result['_id']] = result['value']\n end\n save!\n end\n end",
"def index\n @ga_data = GaDatum.all\n end",
"def results\n get_domain_data\n end",
"def products_aggregate\n quantities = GroupBoxContent.sum(:quantity,group: :product_id)\n quantities.delete_if {|key, value| value == 0 } \n\n products = Product.find(quantities.keys)\n @products_quantities = {}\n products.each do |product|\n @products_quantities[product] = quantities[product.id]\n end\n\n respond_to do |format|\n format.html # products_aggregate.html.erb\n format.json { render json: @groups }\n end\n end",
"def query()\n\t\tval = self.client.sys.registry.query_value(self.hkey, self.name)\n\n\t\tif (val != nil)\n\t\t\tself.data = val.data\n\t\t\tself.type = val.type\n\t\tend\n\n\t\treturn self.data\n\tend",
"def get_data(*args)\n params = args.first || {} # params are optional!\n if !config[:prohibit_read]\n {}.tap do |res|\n # set children to an instance variable in order to access them later\n @records = get_children(params)\n\n # Serialize children\n res[:data] = serialize_data(@records)\n res[:total] = count_records(params) if config[:enable_pagination] && (params[:id].nil? || params[:id] == 'root')\n end\n else\n flash :error => \"You don't have permissions to read data\"\n { :netzke_feedback => @flash }\n end\n end",
"def getItems()\n return mergeWithAPI(@item_json)['data']\n end",
"def store_aggregates\n raise NotImplementedError\n end",
"def data\n self[:data]\n end",
"def fetch_data\n return @data if @data[\"/type/reflect/any_master\"]\n @data = Ken.session.mqlread(FETCH_DATA_QUERY.merge!(:id => id))\n end",
"def load_data!(time_start=nil, time_end=nil, tags = {}, agg = \"sum\", downsample = nil)\n metric_data = metrics(time_start, time_end, tags, agg, downsample).first\n if metric_data then\n self.data = metric_data[:vals]\n self.metadata = metric_data[:tags]\n end\n self.query = { :start => time_start, :end => time_end, :tags => tags, :downsample => downsample }\n end",
"def aggregates\n Rails.cache.fetch(\"aggregates_#{interval}_#{cache_time}\", expires_in: self.cache_time) {\n ActiveRecord::Base.connection.exec_query(\"\n select\n stddev(sum_downvotes) as stddev,\n sum(sum_downvotes) as sum,\n avg(sum_downvotes) as avg,\n avg(n_comments) as n_comments,\n count(*) as n_commenters\n from (\n select\n sum(downvotes) as sum_downvotes,\n count(*) as n_comments\n from comments join users on comments.user_id = users.id\n where\n (comments.created_at >= '#{period}') and\n users.banned_at is null and\n users.deleted_at is null\n GROUP BY comments.user_id\n ) sums;\n \").first.symbolize_keys!\n }\n end",
"def get_data()\t\n\tend",
"def show\n @survey = Survey.find_by_user(params[:id])\n @aggregation = aggregate(@survey)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: {survey: @survey, aggregation: @aggregation}}\n end\n end",
"def data\n @data ||= begin\n event_users = Hash.new do |h, event_name|\n h[event_name] = Set.new\n end\n\n # IDEA: maybe there's a block form if this we can do that yields results as it loads them\n # to go slightly faster\n fetch_results.each do |row|\n event_users[row['name']] << row['user_id']\n\n if row['name'] == Events::IDV_FINAL_RESOLUTION\n if row['identity_verified'] == '1'\n event_users[Results::IDV_FINAL_RESOLUTION_VERIFIED] << row['user_id']\n end\n if row['gpo_verification_pending'] == '1'\n event_users[Results::IDV_FINAL_RESOLUTION_GPO] << row['user_id']\n end\n if row['in_person_verification_pending'] == '1'\n event_users[Results::IDV_FINAL_RESOLUTION_IN_PERSON] << row['user_id']\n end\n if row['fraud_review_pending'] == '1'\n event_users[Results::IDV_FINAL_RESOLUTION_FRAUD_REVIEW] << row['user_id']\n end\n end\n end\n\n event_users.transform_values(&:count)\n end\n end",
"def data(controller)\n records, count = find_records(controller)\n return_data = { :total => count }\n return_data[:records] = records.map { |record| compute_row_for(record, controller) }\n return_data\n end",
"def retrieve_collection\n\n #same as query in products index, query_raw_material_with_relationship, should move to cmd ?\n special_type = ['seeds', 'purchased_clones']\n raw_material_ids = if special_type.include?(type)\n #find parent only one\n Inventory::Catalogue.raw_materials.where(\n key: type,\n ).pluck(:id)\n else\n #find catalogue for other than parent, parent will never have category type\n Inventory::Catalogue.raw_materials.where(\n category: type,\n ).pluck(:id)\n end\n\n if resource_shared?\n item_transactions = Inventory::ItemTransaction.includes(:catalogue, :facility, :facility_strain).where(\n :facility_id.in => @user.facilities,\n :event_type.in => @event_types,\n :catalogue_id.in => raw_material_ids,\n ).order(c_at: :desc)\n else\n item_transactions = Inventory::ItemTransaction.includes(:catalogue, :facility, :facility_strain).where(\n :facility_id => @facility_id,\n :event_type.in => @event_types,\n :catalogue_id.in => raw_material_ids,\n ).order(c_at: :desc)\n end\n\n vi_item_ids = item_transactions.\n where(ref_type: 'Inventory::VendorInvoiceItem').pluck(:ref_id)\n vendor_invoice_items = Inventory::VendorInvoiceItem.\n includes(:invoice).\n in(id: vi_item_ids)\n\n {\n item_transactions: item_transactions,\n vendor_invoice_items: vendor_invoice_items.to_a,\n }\n end",
"def all_data\n total_amounts(:all) + electricity_usages(:all) + gas_usages(:all) + water_usages(:all)\n end",
"def load_aggregate(aggregate_id, clazz = nil)\n load_aggregates([aggregate_id], clazz)[0]\n end",
"def aggregate\n @aggregate ||= klass.build.tap do |aggregate|\n aggregate.instance_variable_set(:@id, id)\n aggregate.instance_variable_set(:@local_version, version)\n aggregate.instance_variable_set(:@persisted_version, version)\n events.each { |event| EventApplicator.apply_event!(aggregate, event) }\n end\n end",
"def to_a\n data.all\n end",
"def get_data(doc)\n snapshots = doc.xpath(\"//Cube[@time]\")\n snapshots.each do |snapshot|\n date_str = snapshot.attr(\"time\")\n date = Date.parse(date_str)\n last_date_processed(date)\n if (date <= @last_date_processed) || @last_date_processed.nil?\n output = {}\n snapshot.children.each do |rate|\n currency = rate.attr('currency')\n rate = rate.attr('rate')\n output[currency] = rate.to_f\n @context.options[:store][date] = output\n end\n end\n end\n end",
"def values\n @data.values\n end",
"def aggregate(query)\n client.search(\n index: name,\n body: query\n )\n end",
"def data(options = {})\n add_required_columns(options[:required_columns])\n @rows ||= aggregate\n end",
"def data\n @data ||= begin\n event_users = Hash.new do |h, uuid|\n h[uuid] = Set.new\n end\n\n # IDEA: maybe there's a block form if this we can do that yields results as it loads them\n # to go slightly faster\n fetch_results.each do |row|\n event_users[row['name']] << row['user_id']\n end\n\n event_users\n end\n end",
"def fetch_data\n parse_data(self.organization.find_data(self.data_path, \n :include => [:url, :name, :description, :picture]))\n end",
"def get_form_aggregates(id, object_id)\n @client.raw('get', \"/content/forms/#{id}/aggregates?object_id=#{object_id}\", options)\n end",
"def statistics\n find(:all, :select => \"title, count(*) AS count, sum(amount) AS sum, avg(amount) AS avg\", :group => :title).map{|stat| stat.attributes}\n end",
"def stats\n @data.info\n end",
"def data\n if @data.nil? && complete_structured_data? then\n @data = Oj.dump(complete_structured_data, mode: :json)\n end\n @data\n end",
"def data\n @location.full_data[:daily][:data][@days_from_current]\n end",
"def results\n response['data']\n end",
"def new_aggregate(type,name, value)\n Models::Aggregate.new(\n :type => type,\n :parent_name => assessment_group.display_name,\n :parent_type => 'AssessmentGroup',\n :name => name,\n :value => value\n )\n end",
"def detail\n result ||= @bucketobjects.map { |bobject| parse(find_object(bobject))}\n { total_objects: @bucketobjects.count, objects: result||{}, total_size: total.to_s(:human_size)}\n end",
"def json_data\n members = self.members.map do |member|\n member.group_json_data(self.id)\n end\n { group: self, members: members, member_split: self.member_split.round(2), total_spend: self.expenses_total.round(2)}\n end",
"def data\n @data ||= {}\n end",
"def data\n @data ||= {}\n end",
"def aggregate\n\n @page_title = _('Aggregate')\n @help_link = 'http://wiki.kolmisoft.com/index.php/Last_Calls#Call_information_representation'\n change_date\n\n #if we have some options preset in session we can retreave them if not new options hash is created.\n session[:aggregate_list_options] ? @options = session[:aggregate_list_options] : @options = {}\n\n params[:page] ? @options[:page] = params[:page].to_i : (@options[:page] = 1 if !@options[:page])\n params[:order_desc] ? @options[:order_desc] = params[:order_desc].to_i : (@options[:order_desc] = 1 if !@options[:order_desc])\n params[:destination_grouping] ? @options[:destination_grouping] = params[:destination_grouping].to_i : (@options[:destination_grouping] = 1 if !@options[:destination_grouping])\n\n # default values for first collumn (selects and fields)\n if !session[:aggregate_list_options] or params[:search].to_i == 1\n (params[:originator] and params[:originator].to_s != \"\") ? @options[:originator] = params[:originator] : @options[:originator] = \"any\"\n (params[:terminator] and params[:terminator].to_s != \"\") ? @options[:terminator] = params[:terminator] : @options[:terminator] = \"any\"\n (params[:prefix] and params[:prefix].to_s != \"\") ? @options[:prefix] = params[:prefix].gsub(/[^0-9]/, \"\") : @options[:prefix] = \"\"\n\n #default values for show/do not show checkboxes and collumns\n (params[:unique_id_show] and params[:unique_id_show].to_s != \"\") ? @options[:unique_id_show] = params[:unique_id_show].to_i : @options[:unique_id_show] = 1\n (params[:destination_show] and params[:destination_show].to_s != \"\") ? @options[:destination_show] = params[:destination_show].to_i : @options[:destination_show] = 1\n (params[:customer_orig_show] and params[:customer_orig_show].to_s != \"\") ? @options[:customer_orig_show] = params[:customer_orig_show].to_i : @options[:customer_orig_show] = 1\n (params[:customer_term_show] and params[:customer_term_show].to_s != \"\") ? @options[:customer_term_show] = params[:customer_term_show].to_i : @options[:customer_term_show] = 1\n (params[:ip_address_orig_show] and params[:ip_address_orig_show].to_s != \"\") ? @options[:ip_address_orig_show] = params[:ip_address_orig_show].to_i : @options[:ip_address_orig_show] = 1\n (params[:ip_address_term_show] and params[:ip_address_term_show].to_s != \"\") ? @options[:ip_address_term_show] = params[:ip_address_term_show].to_i : @options[:ip_address_term_show] = 1\n if can_see_finances?\n (params[:price_orig_show] and params[:price_orig_show].to_s != \"\") ? @options[:price_orig_show] = params[:price_orig_show].to_i : @options[:price_orig_show] = 1\n (params[:price_term_show] and params[:price_term_show].to_s != \"\") ? @options[:price_term_show] = params[:price_term_show].to_i : @options[:price_term_show] = 1\n end\n (params[:billed_time_orig_show] and params[:billed_time_orig_show].to_s != \"\") ? @options[:billed_time_orig_show] = params[:billed_time_orig_show].to_i : @options[:billed_time_orig_show] = 1\n (params[:billed_time_term_show] and params[:billed_time_term_show].to_s != \"\") ? @options[:billed_time_term_show] = params[:billed_time_term_show].to_i : @options[:billed_time_term_show] = 1\n end\n\n @options[:order_by], order_by = agregate_order_by(params, @options)\n\n if (@options[:destination_grouping].to_i == 1 and @options[:order_by] == \"directions.name\") or (@options[:destination_grouping].to_i == 2 and @options[:order_by] == \"destinations.name\")\n order_by = \"\"\n @options[:order_by] = \"\"\n end\n @options[:terminator] != \"any\" ? terminator_cond = @options[:terminator] : terminator_cond = \"\"\n\n # groups by those params that are not in search conditions\n group_by = []\n @options[:destination_grouping].to_i == 1 ? group_by << \"ds.direction_code, ds.prefix\" : group_by << \"ds.direction_code, ds.subcode\"\n cond = []\n\n if @options[:customer_orig_show].to_i == 1 or @options[:customer_term_show].to_i == 1\n group_by << \"dv.user_id\" if @options[:originator] == \"any\"\n group_by << \"p.terminator_id\" if @options[:terminator] == \"any\"\n end\n\n # form condition array for sql\n cond2 = [\"calldate BETWEEN '\" + session_from_datetime + \"' AND '\" + session_till_datetime + \"'\"]\n cond << \"u.owner_id = #{current_user.id}\" if reseller?\n\n cond << \"(u.id = #{q(@options[:originator].to_i)} OR u.owner_id = #{q(@options[:originator].to_i)})\" if @options[:originator] != \"any\"\n cond2 << \"c.prefix LIKE '#{@options[:prefix].gsub(/[^0-9]/, \"\")}%'\" if @options[:prefix].to_s != \"\"\n if terminator_cond.to_s != ''\n cond << \"p.terminator_id = #{terminator_cond.to_s}\"\n else\n cond << \"p.terminator_id > 0\"\n end\n #limit terminators to allowed ones.\n term_ids = current_user.load_terminators_ids\n if term_ids.size == 0\n cond << \"p.terminator_id = 0\"\n else\n cond << \"p.terminator_id IN (#{term_ids.join(\", \")})\"\n end\n\n cond2 << \"NOT (billsec = 0 AND disposition = 'ANSWERED')\"\n # terminator requires other conditions\n\n if reseller?\n originating_billed = SqlExport.replace_price(\"SUM(IF(c.disposition = 'ANSWERED', if(c.user_price is NULL, 0, #{SqlExport.user_price_sql.gsub(\"calls.\", \"c.\")}), 0))\", {:reference => 'originating_billed'})\n originating_billsec = \"SUM(IF(c.disposition = 'ANSWERED', IF(c.user_billsec IS NULL, 0, c.user_billsec), 0)) AS 'originating_billsec'\"\n\n terminator_billed = SqlExport.replace_price(\"SUM(IF(c.disposition = 'ANSWERED', #{SqlExport.reseller_provider_price_sql.gsub(\"calls.\", \"c.\").gsub(\"providers.\", \"p.\")}, 0))\", {:reference => 'terminating_billed'})\n terminator_billsec = \"SUM(IF(c.disposition = 'ANSWERED', c.reseller_billsec, 0)) AS 'terminating_billsec'\"\n else\n # Check if call belongs to resellers user if yes then admins income is reseller perice\n originating_billed = SqlExport.replace_price(\"SUM(IF(u.owner_id = 0 AND c.disposition = 'ANSWERED', if(c.user_price is NULL, 0, #{SqlExport.user_price_sql.gsub(\"calls.\", \"c.\")}), IF(c.reseller_price IS NULL, 0, (c.reseller_price + c.did_inc_price))))\", {:reference => 'originating_billed'})\n originating_billsec = \"SUM(IF(u.owner_id = 0 AND c.disposition = 'ANSWERED', IF(c.user_billsec IS NULL, 0, c.user_billsec), IF(c.reseller_billsec IS NULL, 0, c.reseller_billsec))) AS 'originating_billsec'\"\n\n terminator_billed = SqlExport.replace_price(\"SUM(IF(c.disposition = 'ANSWERED', #{SqlExport.admin_provider_price_sql.gsub(\"calls.\", \"c.\").gsub(\"providers.\", \"p.\")}, 0)) - c.did_prov_price\", {:reference => 'terminating_billed'})\n terminator_billsec = \"SUM(IF(c.disposition = 'ANSWERED', c.provider_billsec, 0)) AS 'terminating_billsec'\"\n end\n\n sql = \"\n SELECT\n #{SqlExport.nice_user_sql(\"u\")},\n c.prefix,\n ds.direction_code AS 'code',\n ds.subcode AS 'subcode',\n ds.name AS 'dest_name',\n u.username AS 'username',\n u.first_name AS 'first_name',\n u.last_name AS 'last_name',\n p.terminator_id AS 'terminator_id',\n\n #{[originating_billed, terminator_billed, originating_billsec, terminator_billsec].join(\",\\n\")},\n\n SUM(IF(c.disposition = 'ANSWERED', c.billsec, 0)) AS 'duration',\n COUNT(*) AS 'total_calls',\n SUM(IF(c.disposition = 'ANSWERED', 1,0)) AS 'answered_calls',\n SUM(IF(c.disposition = 'ANSWERED', 1,0))/COUNT(*)*100 AS 'asr',\n SUM(IF(c.disposition = 'ANSWERED', c.billsec, 0))/SUM(IF(c.disposition = 'ANSWERED', 1,0)) AS 'acd'\n\n FROM (\n SELECT c.*\n FROM calls c FORCE INDEX (calldate)\n WHERE \" + cond2.join(\" AND \")+ \"\n ) c\n\n JOIN providers p ON p.id = c.provider_id\n LEFT JOIN devices dv ON c.src_device_id = dv.id\n LEFT JOIN users u ON u.id = dv.user_id\n LEFT JOIN destinations ds ON ds.prefix = c.prefix\n #{\"LEFT JOIN terminators t ON t.id = p.terminator_id\" if @options[:order_by] == \"terminators.name\"}\n\n WHERE (\" + cond.join(\" AND \")+ \")\n #{group_by.size > 0 ? 'GROUP BY ' +group_by.join(\", \") : ''}\n #{order_by.size > 0 ? 'ORDER BY ' +order_by : ''}\"\n\n # my_debug sql\n\n @result_full = Call.find_by_sql(sql)\n @result = []\n @total_calls = @result_full.size\n # calculate total values of dataset.\n @total = {:billed_orig => 0, :billed_term => 0, :billsec_orig => 0, :billsec_term => 0, :duration => 0, :total_calls => 0, :asr => 0, :acd => 0, :answered_calls => 0}\n @result_full.each { |row|\n @total[:billed_orig] += row.originating_billed.to_d\n @total[:billed_term] += row.terminating_billed.to_d\n @total[:billsec_orig] +=row.originating_billsec.to_d\n @total[:billsec_term] += row.terminating_billsec.to_d\n @total[:duration] += row.duration.to_d\n @total[:total_calls] += row.total_calls.to_i\n @total[:answered_calls] += row.answered_calls.to_i\n }\n @total[:total_calls] == 0 ? @total[:asr] = 0 : @total[:asr] = @total[:answered_calls].to_d/@total[:total_calls].to_d*100\n @total[:answered_calls] == 0 ? @total[:acd] = 0 : @total[:acd] = @total[:duration].to_d / @total[:answered_calls].to_d\n\n # fetch required number of items.\n @result = []\n @total_pages = (@total_calls.to_d / session[:items_per_page].to_d).ceil\n @options[:page] = @total_pages if @options[:page] > @total_pages\n start = session[:items_per_page]*(@options[:page]-1)\n (start..(start+session[:items_per_page])-1).each { |i|\n @result << @result_full[i] if @result_full[i]\n }\n\n session[:aggregate_list_options] = {:page => @options[:page], :order_desc => @options[:order_desc], :destination_grouping => @options[:destination_grouping], :originator => @options[:originator], :terminator => @options[:terminator], :prefix => @options[:prefix], :unique_id_show => @options[:unique_id_show], :destination_show => @options[:destination_show], :customer_orig_show => @options[:customer_orig_show], :customer_term_show => @options[:customer_term_show], :ip_address_orig_show => @options[:ip_address_orig_show], :ip_address_term_show => @options[:ip_address_term_show], :price_orig_show => @options[:price_orig_show], :price_term_show => @options[:price_term_show], :billed_time_orig_show => @options[:billed_time_orig_show], :billed_time_term_show => @options[:billed_time_term_show], :order_by => @options[:order_by]}\n\n #session[:aggregate_list_options] = @options\n # no need to store these 2 in session as they are not options but values from database.\n @options = load_parties(@options)\n\n if @options[:terminator] == \"any\"\n @terminator_providers_count = any_terminator_providers_count(@options[:terminators])\n else\n @terminator_providers_count = terminator_providers_count(@options[:terminators], @options[:terminator])\n end\n\n end",
"def collection\n @collector.collection\n end",
"def data\n raise NotImplementedError\n end",
"def show\n @generic_table_aggregation = GenericTable::Aggregation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @generic_table_aggregation }\n end\n end",
"def show\n @aggregate = Aggregate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @aggregate }\n end\n end",
"def read(opts = {})\n opts = filter_unsupported_options :ext_read, opts\n opts = filter_sort opts \n\n if opts[:limit] != nil \n if opts[:start] != nil\n opts[:offset] = opts.delete :start\n end\n total = get_total_count opts.clone # total must contains the total number of record without limit/offset\n end\n\n list = @active_record_model.find(:all, opts)\n list.each do |r|\n s = r.attributes\n @response.add_data (s.merge get_association_items(r, opts))\n end\n\n @response.add(:total, total || @response.data.length)\n @response.to_hash\n end",
"def get_metadata\n DatasetService.get_metadata self.dataset_id\n end",
"def get_data(startdate, enddate)\n\t\t\n\t\tdate_range = @analytics::DateRange.new(start_date: startdate, end_date: enddate)\n\t\torder_by = @analytics::OrderBy.new(field_name: 'ga:pageviews', sort_order: 'DESCENDING')\n\t\t# metric = @analytics::Metric.new(expression: 'ga:sessions')\n\t\t# metric = @analytics::Metric.new(expression: ['ga:sessions', 'ga:uniquePageviews'])\n\t\t# metric = @analytics::Metric.new\n\t\t# metric.expression = ['ga:sessions', 'ga:uniquePageviews']\n\t\t\n\t\tmetrics = ['ga:pageviews', 'ga:users', 'ga:bounces', 'ga:sessions',\n\t\t\t\t 'ga:avgTimeOnPage', 'ga:newUsers', 'ga:goal1ConversionRate', 'ga:goal1Completions'\n\t\t\t\t ]\n\n\t\t# metrics = ['ga:totalEvents'\n\t\t# \t\t ]\t\t \n\n\n\t\tmetric_type = Array.new\n\t\tmetrics.each do |m|\n\t\t\tmetric = @analytics::Metric.new\n\t\t\tmetric.expression = m\n\t\t\tmetric_type.push(metric)\n\t\tend\n\n\t\tdimensions = ['ga:pagePath', 'ga:pageTitle', 'ga:hostname' ]\n\t\t# dimensions = ['ga:pagePath', 'ga:eventCategory']\n\t\tdimension_type = Array.new\n\t\tdimensions.each do |d|\n\t\t\tdimension = @analytics::Dimension.new\n\t\t\tdimension.name = d\n\t\t\tdimension_type.push(dimension)\n\t\tend\n\n\n\t\t# dimension = @analytics::Dimension.new(name: 'ga:pagePath')\n\n\t\t# dimension_filters = @analytics::DimensionFilterClause.new(\n\t # filters: [\n\t # @analytics::DimensionFilter.new(\n\t # dimension_name: 'ga:pagePath',\n\t # operator: \"IN_LIST\",\n\t # expressions: ['/archives/69839', '/archives/54087', '/archives/68924', '/archives/58437', '/archives/65171', '/archives/64435', '/archives/61533', '/archives/68924',\n\t # \t\t\t\t'/archives/65086', '/archives/64736', '/archives/55244', '/archives/68211'\n\t # ]\n\t # )\n\t # ]\n\t # )\n\n\t\trequest = @analytics::GetReportsRequest.new(\n \t\t\treport_requests: [@analytics::ReportRequest.new(\n \t\t\tview_id: @view_id, \n \t\t\tmetrics: metric_type, \n \t\t\tdimensions: dimension_type,\n \t\t\t# dimension_filter_clauses: [dimension_filters],\n \t\t\t# dimensions: [dimension], \n \t\t\tdate_ranges: [date_range],\n \t\t\torder_bys: [order_by],\n \t\t\tpageSize: 10000\n \t\t\t)]\n\t\t)\n\t\tresponse = @client.batch_get_reports(request)\n\t\tmessageHash = {}\n\n\t\t# handling error \n\t\tif !response.reports.first.data.rows then\n\t\t\t\n\t\t\tkey = \"message\"\n\t\t\tmessageHash[key.to_sym] = \"no data\"\n\t\t \treturn messageHash\n\t\tend\n\n\n\t\tdata_from_google = response.reports.first.data.rows\n\n\t\tkey_array = dimensions + metrics\n\n\t\t# get rid of 'ga:'\n\t\tkey_array.each_with_index do |k, index| \n\t\t\tkey_array[index] = k.gsub(\"ga:\",\"\")\n\t\tend\n\n\t\tkey_array.push('id')\n\t\tkey_array.push('clickCount')\n\n\t\tset_ga_data_array = Array.new\n\n\n\t\tdata_from_google.each_with_index do |r, index|\n\n\t\t\tdatahash = {}\n\t\t\ti = 0;\n\n\t\t\t# setup dimension part\n\t\t\tr.dimensions.each do |d|\n\t\t\t\tdatahash[key_array[i]] = d\n\t\t\t\ti += 1\n\t\t\tend\n\n\t\t\t# setup metrics part\n\t\t\tr.metrics.first.values.each do |m|\n\t\t\t\tdatahash[key_array[i]] = m\n\t\t\t\ti += 1\n\t\t\tend\n\n\t\t\t\n\t\t\t# get aticle data from db\n\t\t\tarticleArr = set_article_data(datahash['hostname'], datahash['pagePath'], startdate, enddate)\n\n\t\t\t# setup id, mcv\n\t\t\tarticleArr.each do |a|\n\t\t\t\tdatahash[key_array[i]] = a\n\t\t\t\ti += 1\n\t\t\tend\n\n\t\t\tset_ga_data_array.push(datahash)\n\n\t\t\t#datahash sample -> { \"pagePath\": \"/archives/69839\", ... , \"goal1Completions\": \"23\", \"id\": 4, \"clickCount\": 0 },\n\t\tend\n\t\t\n\t\treturn set_ga_data_array\n\tend",
"def get_data(*args)\n params = args.first || {} # params are optional!\n params[\"limit\"] = nil if (params.empty? == false and config[:enable_pagination] == false)\n session_name = (config[:item_id].to_s + \"_filter\").to_sym\n if (params[:filter1] || component_session[session_name])\n component_session[session_name] = params[:filter1] || component_session[session_name]\n params[:filter] = component_session[session_name]\n end\n if !config[:prohibit_read]\n {}.tap do |res|\n records = get_records(params)\n res[:data] = records.map{|r| r.netzke_array(columns(:with_meta => true))}\n res[:total] = count_records(params) if config[:enable_pagination]\n end\n else\n flash :error => \"You don't have permissions to read data\"\n { :netzke_feedback => @flash }\n end\n end",
"def stats\n get_charts\n end"
] | [
"0.77936625",
"0.745657",
"0.6882014",
"0.6871705",
"0.6688629",
"0.6534879",
"0.6458202",
"0.64369506",
"0.6357086",
"0.62435645",
"0.62303084",
"0.6165014",
"0.61168534",
"0.6080659",
"0.6080659",
"0.6013445",
"0.59813946",
"0.59762245",
"0.59762245",
"0.5965558",
"0.59603363",
"0.5949814",
"0.5933188",
"0.59148175",
"0.5910839",
"0.5882562",
"0.58593285",
"0.58360195",
"0.5830547",
"0.58291936",
"0.5826247",
"0.580874",
"0.5802902",
"0.5799065",
"0.5792727",
"0.5791159",
"0.5781832",
"0.5754419",
"0.5746201",
"0.57361585",
"0.57280886",
"0.5723673",
"0.5715042",
"0.57052594",
"0.57052594",
"0.57052594",
"0.56612265",
"0.5635903",
"0.562964",
"0.56029123",
"0.5594295",
"0.5594295",
"0.5594295",
"0.55814946",
"0.558102",
"0.5570913",
"0.5559304",
"0.55549455",
"0.55328894",
"0.55273867",
"0.55215913",
"0.5517772",
"0.55175173",
"0.55166113",
"0.55128676",
"0.55099577",
"0.5490336",
"0.54896665",
"0.548767",
"0.548425",
"0.5481182",
"0.54810697",
"0.5458391",
"0.54564565",
"0.5433145",
"0.540356",
"0.54026574",
"0.53985876",
"0.5397043",
"0.53878427",
"0.5386958",
"0.5378727",
"0.5367527",
"0.5355249",
"0.53325033",
"0.53269666",
"0.5326417",
"0.53225446",
"0.53193414",
"0.5317764",
"0.5317764",
"0.531628",
"0.53076637",
"0.53029037",
"0.5301413",
"0.52975136",
"0.5295395",
"0.52926314",
"0.52889687",
"0.52873087",
"0.5286901"
] | 0.0 | -1 |
Show invalid properties with the reasons. Usually used together with valid? | def list_invalid_properties
invalid_properties = Array.new
if @timing.nil?
invalid_properties.push("invalid value for 'timing', timing cannot be nil.")
end
if [email protected]? && @amount < 0
invalid_properties.push("invalid value for 'amount', must be greater than or equal to 0.")
end
if [email protected]? && @quantity < 1
invalid_properties.push("invalid value for 'quantity', must be greater than or equal to 1.")
end
return invalid_properties
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_invalid_properties\n invalid_properties = super\n if @class_id.nil?\n invalid_properties.push('invalid value for \"class_id\", class_id cannot be nil.')\n end\n\n if @object_type.nil?\n invalid_properties.push('invalid value for \"object_type\", object_type cannot be nil.')\n end\n\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = super\n if @class_id.nil?\n invalid_properties.push('invalid value for \"class_id\", class_id cannot be nil.')\n end\n\n if @object_type.nil?\n invalid_properties.push('invalid value for \"object_type\", object_type cannot be nil.')\n end\n\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = super\n if @class_id.nil?\n invalid_properties.push('invalid value for \"class_id\", class_id cannot be nil.')\n end\n\n if @object_type.nil?\n invalid_properties.push('invalid value for \"object_type\", object_type cannot be nil.')\n end\n\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = super\n if @class_id.nil?\n invalid_properties.push('invalid value for \"class_id\", class_id cannot be nil.')\n end\n\n if @object_type.nil?\n invalid_properties.push('invalid value for \"object_type\", object_type cannot be nil.')\n end\n\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = super\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = super\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = super\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = super\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = super\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = super\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = super\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = super\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = super\n if @class_id.nil?\n invalid_properties.push('invalid value for \"class_id\", class_id cannot be nil.')\n end\n\n if @object_type.nil?\n invalid_properties.push('invalid value for \"object_type\", object_type cannot be nil.')\n end\n\n pattern = Regexp.new(/^$|^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/)\n if [email protected]? && @uuid !~ pattern\n invalid_properties.push(\"invalid value for \\\"uuid\\\", must conform to the pattern #{pattern}.\")\n end\n\n pattern = Regexp.new(/^$|^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/)\n if !@vdisk_id.nil? && @vdisk_id !~ pattern\n invalid_properties.push(\"invalid value for \\\"vdisk_id\\\", must conform to the pattern #{pattern}.\")\n end\n\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = super\n if @style.nil?\n invalid_properties.push('invalid value for \"style\", style cannot be nil.')\n end\n\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = super\n if @class_id.nil?\n invalid_properties.push('invalid value for \"class_id\", class_id cannot be nil.')\n end\n\n if @object_type.nil?\n invalid_properties.push('invalid value for \"object_type\", object_type cannot be nil.')\n end\n\n if [email protected]? && @name.to_s.length > 31\n invalid_properties.push('invalid value for \"name\", the character length must be smaller than or equal to 31.')\n end\n\n pattern = Regexp.new(/^[a-zA-Z0-9\\-\\._:]+$/)\n if [email protected]? && @name !~ pattern\n invalid_properties.push(\"invalid value for \\\"name\\\", must conform to the pattern #{pattern}.\")\n end\n\n pattern = Regexp.new(/^$|((^20|5[0-9a-fA-F]{1}):([0-9a-fA-F]{2}:){6}([0-9a-fA-F]{2}))/)\n if !@static_wwpn_address.nil? && @static_wwpn_address !~ pattern\n invalid_properties.push(\"invalid value for \\\"static_wwpn_address\\\", must conform to the pattern #{pattern}.\")\n end\n\n pattern = Regexp.new(/^$|((^20|5[0-9a-fA-F]{1}):([0-9a-fA-F]{2}:){6}([0-9a-fA-F]{2}))/)\n if [email protected]? && @wwpn !~ pattern\n invalid_properties.push(\"invalid value for \\\"wwpn\\\", must conform to the pattern #{pattern}.\")\n end\n\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = super\n if @is_object_icon.nil?\n invalid_properties.push('invalid value for \"is_object_icon\", is_object_icon cannot be nil.')\n end\n\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n if @input_currency.nil?\n invalid_properties.push('invalid value for \"input_currency\", input_currency cannot be nil.')\n end\n\n if @sender.nil?\n invalid_properties.push('invalid value for \"sender\", sender cannot be nil.')\n end\n\n if @recipients.nil?\n invalid_properties.push('invalid value for \"recipients\", recipients cannot be nil.')\n end\n\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = super\n if @index.nil?\n invalid_properties.push('invalid value for \"index\", index cannot be nil.')\n end\n\n if @orientation.nil?\n invalid_properties.push('invalid value for \"orientation\", orientation cannot be nil.')\n end\n\n if @size.nil?\n invalid_properties.push('invalid value for \"size\", size cannot be nil.')\n end\n\n if @type.nil?\n invalid_properties.push('invalid value for \"type\", type cannot be nil.')\n end\n\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = super\n if @direction.nil?\n invalid_properties.push('invalid value for \"direction\", direction cannot be nil.')\n end\n\n if @shape.nil?\n invalid_properties.push('invalid value for \"shape\", shape cannot be nil.')\n end\n\n if @linear_angle.nil?\n invalid_properties.push('invalid value for \"linear_angle\", linear_angle cannot be nil.')\n end\n\n if @is_scaled.nil?\n invalid_properties.push('invalid value for \"is_scaled\", is_scaled cannot be nil.')\n end\n\n if @tile_flip.nil?\n invalid_properties.push('invalid value for \"tile_flip\", tile_flip cannot be nil.')\n end\n\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n if @format.nil?\n invalid_properties.push('invalid value for \"format\", format cannot be nil.')\n end\n\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n invalid_properties\n end"
] | [
"0.76497203",
"0.76497203",
"0.76497203",
"0.76497203",
"0.7637422",
"0.7637422",
"0.7637422",
"0.7637422",
"0.7637422",
"0.7637422",
"0.7637422",
"0.7637422",
"0.7356452",
"0.7334807",
"0.72685325",
"0.7238964",
"0.7231359",
"0.72258264",
"0.7208294",
"0.71760833",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241",
"0.7170241"
] | 0.0 | -1 |
Check to see if the all the properties in the model are valid | def valid?
return false if @timing.nil?
timing_validator = EnumAttributeValidator.new('String', ["immediate", "renewal"])
return false unless timing_validator.valid?(@timing)
return false if [email protected]? && @amount < 0
return false if [email protected]? && @quantity < 1
billing_validator = EnumAttributeValidator.new('String', ["prorated", "full", "zero_amount", "none"])
return false unless billing_validator.valid?(@billing)
compensation_method_validator = EnumAttributeValidator.new('String', ["full_refund", "prorated_refund", "full_credit", "prorated_credit", "none"])
return false unless compensation_method_validator.valid?(@compensation_method)
partial_period_handling_validator = EnumAttributeValidator.new('String', ["bill_full", "bill_prorated", "bill_zero_amount", "no_bill"])
return false unless partial_period_handling_validator.valid?(@partial_period_handling)
return true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def validate_properties\n true\n end",
"def validate_properties\n true\n end",
"def validate\n super\n\n check_optional_property :collection, String\n check_optional_property :create, String\n check_optional_property :delete, String\n check_optional_property :flush, String\n check_optional_property :prefetch, String\n check_optional_property :request_to_query, String\n check_optional_property :resource_to_request_patch, String\n check_optional_property :return_if_object, String\n check_optional_property :self_link, String\n end",
"def valid_attributes?\n true\n end",
"def valid_attributes?\n attribute_errors.empty?\n end",
"def valid?\n return false if @property_code.nil?\n return false if @property_name.nil?\n return false if @location.nil?\n return false if @total_price.nil?\n return false if @min_daily_rate.nil?\n return true\n end",
"def validate_presence_of(klazz, properties)\r\n instance = klazz.new \r\n instance.should_not be_valid\r\n \r\n properties.each do |property| \r\n instance.errors.should be_invalid(property)\r\n err_properties = instance.errors[property]\r\n if err_properties.is_a? Array\r\n err_properties.include?(ActiveRecord::Errors.default_error_messages[:blank]).should be_true\r\n else\r\n err_properties.should == ActiveRecord::Errors.default_error_messages[:blank] \r\n end\r\n end \r\n end",
"def validate_attributes!(attributes)\n invalid_properties = attributes.keys.map(&:to_s) - self.attributes.keys\n raise UndefinedPropertyError, \"Undefined properties: #{invalid_properties.join(',')}\" if invalid_properties.size > 0\n end",
"def model_valid?\n true\n end",
"def model_valid?\n true\n end",
"def valid?\n self.errors = []\n self.content_type.fields.each do |field|\n if field.required\n if self.dynamic_getter(field.name).blank?\n self.errors << field.name\n end\n end\n end\n self.errors.blank?\n end",
"def valid?\n validate\n @model.errors.on(:preferences).blank?\n end",
"def validate_properties\n if @properties.keys.count > 0\n if @properties.key?(:label)\n unless @properties[:label] =~ /^[a-zA-Z][\\w|\\s]*$/\n raise 'property label validation error'\n end\n end\n\n if @properties.key?(:default_aggregate)\n unless @properties[:default_aggregate] =~ /^max$|^min$|^avg$|^count$/i\n raise 'property default_aggregate validation error'\n end\n end\n end\n end",
"def validate_properties\n @properties.each do |property, values|\n valid_values = validate_values(property, values)\n\n if valid_values.is_a?(Array) && valid_values == [] || valid_values.nil?\n @properties.delete(property)\n else\n @properties[property] = valid_values\n end\n end\n end",
"def validate\n valid?\n end",
"def validate_attributes!(attributes)\n return attributes if attributes.blank?\n invalid_properties = attributes.keys.map(&:to_s) - self.attributes.keys\n invalid_properties.reject! { |name| self.respond_to?(\"#{name}=\") }\n fail UndefinedPropertyError, \"Undefined properties: #{invalid_properties.join(',')}\" if !invalid_properties.empty?\n end",
"def is_valid; end",
"def valid?\n # TODO validate nested objects\n output = super\n errors.empty? && output\n end",
"def property_checks\n errors.add(:base, \"You can't have a Thing without properties\") if property_keys.empty?\n\n self.property_keys.each do |key|\n errors.add(:properties, \"'#{key}' is an invalid property for this List\") unless available_property_keys.include?(key)\n end\n end",
"def valid_for_attributes( model, attributes )\n unless model.valid?\n errors = model.errors\n our_errors = Array.new\n errors.each { |attr,error|\n if attributes.include? attr\n our_errors << [attr,error]\n end\n }\n errors.clear\n our_errors.each { |attr,error| errors.add(attr,error) }\n return false unless errors.empty?\n end\n return true\n end",
"def valid?\n type_validator = EnumAttributeValidator.new('String', [\"person\", \"business\"])\n return false unless type_validator.valid?(@type)\n return false if @country.nil?\n return false if @street.nil?\n return false if @postal_code.nil?\n return false if @city.nil?\n return false if @email.nil?\n return false if @ip.nil?\n identification_type_validator = EnumAttributeValidator.new('String', [\"DL\", \"PP\", \"ID\", \"OT\"])\n return false unless identification_type_validator.valid?(@identification_type)\n legal_entity_type_validator = EnumAttributeValidator.new('String', [\"sole_proprietorship\", \"partnership\", \"privately_owned_company\", \"publicly_owned_company\", \"government_owned_entity\", \"trust\", \"ngo\", \"club_and_society\", \"go\", \"other\", \"financial_institution\", \"mto\"])\n return false unless legal_entity_type_validator.valid?(@legal_entity_type)\n nature_of_business_validator = EnumAttributeValidator.new('String', [\"personal\", \"agriculture_and_hunting\", \"forestry\", \"fishing\", \"agricultural_by_products\", \"coal_mining\", \"oil_mining\", \"iron_ore_mining\", \"other_metal_and_diamond_mining\", \"other_mineral_mining\", \"manufacturing_of_food_drink_tobacco\", \"manufacturing_of_textiles_leather_fur_furniture\", \"manufacture_of_wooden_products_furniture\", \"manufacture_of_paper_pulp_allied_products\", \"manufacture_of_chemicals_medical_petroleum_rubber_plastic_products\", \"manufacture_of_pottery_china_glass_stone\", \"manufacture_of_iron_steel_non_ferrous_metals_basic_industries\", \"manufacture_of_metal_products_electrical_and_scientific_engineering\", \"manufacture_of_jewelry_musical_instruments_toys\", \"electricity_gas_and_water\", \"construction\", \"wholesale_trade\", \"retail_trade\", \"catering_incl_hotels\", \"transport_storage\", \"communications\", \"finance_and_holding_companies\", \"insurance\", \"business_services\", \"real_estate_development_investment\", \"central_state_governments\", \"community_services_defence_police_prisons_etc\", \"social_services_education_health_care\", \"personal_services_leisure_services\", \"personal_services_domestic_laundry_repairs\", \"personal_services_embassies_international_organisations\"])\n return false unless nature_of_business_validator.valid?(@nature_of_business)\n return false if @documents.nil?\n gender_validator = EnumAttributeValidator.new('String', [\"M\", \"F\", \"O\"])\n return false unless gender_validator.valid?(@gender)\n true\n end",
"def valid?\n return false if !super\n return false if @index.nil?\n return false if @orientation.nil?\n orientation_validator = EnumAttributeValidator.new('String', ['Horizontal', 'Vertical'])\n return false unless orientation_validator.valid?(@orientation)\n return false if @size.nil?\n size_validator = EnumAttributeValidator.new('String', ['Full', 'Half', 'Quarter'])\n return false unless size_validator.valid?(@size)\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', ['Title', 'Body', 'CenteredTitle', 'Subtitle', 'DateAndTime', 'SlideNumber', 'Footer', 'Header', 'Object', 'Chart', 'Table', 'ClipArt', 'Diagram', 'Media', 'SlideImage', 'Picture'])\n return false unless type_validator.valid?(@type)\n true\n end",
"def validate\n validate_string_attributes\n @relations.map(&:validate)\n end",
"def is_valid?\n end",
"def run_validations\n true\n end",
"def validate\n validate_params\n validate_colour\n validate_coordinates\n validate_dimension\n end",
"def checkAttributeRequirements\n if @valid_attributes.empty?\n @error_text = \"No valid attributes found\"\n return false\n elsif (@mandatory_attributes_from_db & @valid_attributes) != @mandatory_attributes_from_db\n missing_attr = @mandatory_attributes_from_db - (@mandatory_attributes_from_db & @valid_attributes)\n\n x_attr_txt = \"\"\n missing_attr.each {|x_attr| x_attr_txt += x_attr[:name] + \", \"}\n @error_text = \"Mandatory attributes #{x_attr_txt[0..-3]} is/are missing\"\n return false\n end\n\n return true\n end",
"def validations\n {}\n end",
"def validatable?\n true\n end",
"def validate\n validate_params\n validate_coordinates\n validate_colour\n validate_dimension\n end",
"def validate_required\n [\n :project_name,\n :status,\n :requester_id,\n :subject_expert_id,\n :sponsor_id,\n :vision,\n :goal,\n :description,\n :scope,\n :advice_required,\n :program_id,\n :train_id,\n :funding_method,\n :cost_center,\n :funding_status,\n :budget_allocated,\n :priority,\n :start_date,\n :end_date,\n :risk_rating,\n :risks,\n :projected_revenue,\n ].each do |field|\n if self.attributes[field.to_s].nil? || self.attributes[field.to_s].blank?\n # intentionally vague!\n add_validation 'All fields are required to perform further validations'\n return false\n end\n end\n true\n end",
"def validate\n validate_root\n validate_associated\n valid?\n end",
"def validate\n true\n end",
"def valid?\n return false if @id.nil?\n return false if @created.nil?\n return false if @modified.nil?\n return false if @company_name.nil?\n return false if @company_name.to_s.length < 1\n return false if @domain_name.nil?\n return false if @state.nil?\n state_validator = EnumAttributeValidator.new('String', [\"active\", \"deactivated\"])\n return false unless state_validator.valid?(@state)\n return false if @billing_email.nil?\n return false if @application_count.nil?\n return false if @user_count.nil?\n return false if @campaigns_active_count.nil?\n return false if @campaigns_inactive_count.nil?\n true\n end",
"def valid?\n _errors_before = self.errors.dup\n _s = super\n validate_attributes\n _errors_before.each { |e| append_error(_errors_before,e) }\n self.errors.empty?\n end",
"def valid?\n true\n end",
"def validate!\n expected_props, required_props = @properties.keys, @required\n\n unless is_a?(Dialect) || is_a?(Template)\n expected_props = expected_props + INHERITED_PROPERTIES.keys\n end\n\n # It has only expected properties (exclude metadata)\n keys = self.keys - [:\"@context\"]\n keys = keys.reject {|k| k.to_s.include?(':')} unless is_a?(Dialect)\n raise \"#{type} has unexpected keys: #{keys - expected_props}\" unless keys.all? {|k| expected_props.include?(k)}\n\n # It has required properties\n raise \"#{type} missing required keys: #{required_props & keys}\" unless (required_props & keys) == required_props\n\n # Every property is valid\n keys.each do |key|\n value = self[key]\n is_valid = case key\n when :columns\n column_names = value.map(&:name)\n value.is_a?(Array) &&\n value.all? {|v| v.is_a?(Column) && v.validate!} &&\n begin\n # The name properties of the column descriptions must be unique within a given table description.\n column_names = value.map(&:name)\n raise \"Columns must have unique names\" if column_names.uniq != column_names\n true\n end\n when :commentPrefix then value.is_a?(String) && value.length == 1\n when :datatype then value.is_a?(String) && DATATYPES.keys.map(&:to_s).include?(value)\n when :default then value.is_a?(String)\n when :delimiter then value.is_a?(String) && value.length == 1\n when :dialect then value.is_a?(Dialect) && value.validate!\n when :doubleQuote then %w(true false 1 0).include?(value.to_s.downcase)\n when :encoding then Encoding.find(value)\n when :foreignKeys\n # An array of foreign key definitions that define how the values from specified columns within this table link to rows within this table or other tables. A foreign key definition is a JSON object with the properties:\n value.is_a?(Array) && value.all? do |fk|\n raise \"Foreign key must be an object\" unless fk.is_a?(Hash)\n columns, reference = fk['columns'], fk['reference']\n raise \"Foreign key missing columns and reference\" unless columns && reference\n raise \"Foreign key has extra entries\" unless fk.keys.length == 2\n raise \"Foreign key must reference columns\" unless Array(columns).all? {|k| self.columns.any? {|c| c.name == k}}\n raise \"Foreign key reference must be an Object\" unless reference.is_a?(Hash)\n\n if reference.has_key?('resource')\n raise \"Foreign key having a resource reference, must not have a schema\" if reference.has_key?('schema')\n # FIXME resource is a URL of a specific resource (table) which must exist\n elsif reference.has_key?('schema')\n # FIXME schema is a URL of a specific schema which must exist\n end\n # FIXME: columns\n true\n end\n when :format then value.is_a?(String)\n when :header then %w(true false 1 0).include?(value.to_s.downcase)\n when :headerColumnCount, :headerRowCount\n value.is_a?(Numeric) && value.integer? && value > 0\n when :length\n # Applications must raise an error if length, maxLength or minLength are specified and the cell value is not a list (ie separator is not specified), a string or one of its subtypes, or a binary value.\n raise \"Use if minLength or maxLength with length requires separator\" if self[:minLength] || self[:maxLength] && !self[:separator]\n raise \"Use of both length and minLength requires they be equal\" unless self.fetch(:minLength, value) == value\n raise \"Use of both length and maxLength requires they be equal\" unless self.fetch(:maxLength, value) == value\n value.is_a?(Numeric) && value.integer? && value > 0\n when :language then BCP47::Language.identify(value)\n when :lineTerminator then value.is_a?(String)\n when :minimum, :maximum, :minInclusive, :maxInclusive, :minExclusive, :maxExclusive\n value.is_a?(Numeric) ||\n RDF::Literal::Date.new(value).valid? ||\n RDF::Literal::Time.new(value).valid? ||\n RDF::Literal::DateTime.new(value).valid?\n when :minLength, :maxLength\n value.is_a?(Numeric) && value.integer? && value > 0\n when :name then value.is_a?(String) && !name.start_with?(\"_\")\n when :notes then value.is_a?(Array) && value.all? {|v| v.is_a?(Hash)}\n when :null then value.is_a?(String)\n when :predicateUrl then Array(value).all? {|v| RDF::URI(v).valid?}\n when :primaryKey\n # A column reference property that holds either a single reference to a column description object or an array of references.\n Array(value).all? do |k|\n self.columns.any? {|c| c.name == k}\n end\n when :quoteChar then value.is_a?(String) && value.length == 1\n when :required then %w(true false 1 0).include?(value.to_s.downcase)\n when :resources then value.is_a?(Array) && value.all? {|v| v.is_a?(Table) && v.validate!}\n when :schema then value.is_a?(Schema) && value.validate!\n when :separator then value.nil? || value.is_a?(String) && value.length == 1\n when :skipInitialSpace then %w(true false 1 0).include?(value.to_s.downcase)\n when :skipBlankRows then %w(true false 1 0).include?(value.to_s.downcase)\n when :skipColumns then value.is_a?(Numeric) && value.integer? && value >= 0\n when :skipRows then value.is_a?(Numeric) && value.integer? && value >= 0\n when :source then %w(json rdf).include?(value)\n when :\"table-direction\" then %w(rtl ltr default).include?(value)\n when :targetFormat, :templateFormat then RDF::URI(value).valid?\n when :templates then value.is_a?(Array) && value.all? {|v| v.is_a?(Template) && v.validate!}\n when :\"text-direction\" then %w(rtl ltr).include?(value)\n when :title then valid_natural_language_property?(value)\n when :trim then %w(true false 1 0 start end).include?(value.to_s.downcase)\n when :urlTemplate then value.is_a?(String)\n when :@id then @id.valid?\n when :@type then value.to_sym == type\n else\n raise \"?!?! shouldn't get here for key #{key}\"\n end\n raise \"#{type} has invalid #{key}: #{value.inspect}\" unless is_valid\n end\n\n self\n end",
"def valid?\n return false if @subject_property.nil?\n return false if @proprietorship.nil?\n proprietorship_validator = EnumAttributeValidator.new('String', [\"Unknown\", \"Sole\", \"Joint\"])\n return false unless proprietorship_validator.valid?(@proprietorship)\n return false if @surname.nil?\n return false if @forename.nil?\n return false if @middle_name.nil?\n return true\n end",
"def valid?\n return false if @class_id.nil?\n class_id_validator = EnumAttributeValidator.new('String', [\"cond.HclStatusDetail\"])\n return false unless class_id_validator.valid?(@class_id)\n return false if @object_type.nil?\n object_type_validator = EnumAttributeValidator.new('String', [\"cond.HclStatusDetail\"])\n return false unless object_type_validator.valid?(@object_type)\n hardware_status_validator = EnumAttributeValidator.new('String', [\"Missing-Os-Driver-Info\", \"Incompatible-Server-With-Component\", \"Incompatible-Processor\", \"Incompatible-Os-Info\", \"Incompatible-Component-Model\", \"Incompatible-Firmware\", \"Incompatible-Driver\", \"Incompatible-Firmware-Driver\", \"Service-Unavailable\", \"Service-Error\", \"Unrecognized-Protocol\", \"Not-Evaluated\", \"Compatible\"])\n return false unless hardware_status_validator.valid?(@hardware_status)\n reason_validator = EnumAttributeValidator.new('String', [\"Missing-Os-Driver-Info\", \"Incompatible-Server-With-Component\", \"Incompatible-Processor\", \"Incompatible-Os-Info\", \"Incompatible-Component-Model\", \"Incompatible-Firmware\", \"Incompatible-Driver\", \"Incompatible-Firmware-Driver\", \"Service-Unavailable\", \"Service-Error\", \"Unrecognized-Protocol\", \"Not-Evaluated\", \"Compatible\"])\n return false unless reason_validator.valid?(@reason)\n software_status_validator = EnumAttributeValidator.new('String', [\"Missing-Os-Driver-Info\", \"Incompatible-Server-With-Component\", \"Incompatible-Processor\", \"Incompatible-Os-Info\", \"Incompatible-Component-Model\", \"Incompatible-Firmware\", \"Incompatible-Driver\", \"Incompatible-Firmware-Driver\", \"Service-Unavailable\", \"Service-Error\", \"Unrecognized-Protocol\", \"Not-Evaluated\", \"Compatible\"])\n return false unless software_status_validator.valid?(@software_status)\n status_validator = EnumAttributeValidator.new('String', [\"Incomplete\", \"Not-Found\", \"Not-Listed\", \"Validated\", \"Not-Evaluated\"])\n return false unless status_validator.valid?(@status)\n true && super\n end",
"def core_attributes_valid\n core_attributes = [@rateable, @rater, @ratee, @rating_type]\n return if core_attributes.all? { |atr| atr.present? && atr.valid? }\n errors.add('message', 'Not all core attributes present and valid.')\n end",
"def valid?\n super\n errors.empty?\n end",
"def valid?\n \n if @account_id.nil?\n false\n elsif @campaign_id.nil?\n false\n elsif @csp_id.nil?\n false\n elsif @status.nil?\n false\n elsif @create_date.nil?\n false\n elsif @auto_renewal.nil?\n false\n elsif @brand_id.nil?\n false\n elsif @usecase.nil?\n false\n elsif @sub_usecases.nil?\n false\n elsif @description.nil?\n false\n elsif @embedded_link.nil?\n false\n elsif @embedded_phone.nil?\n false\n elsif @affiliate_marketing.nil?\n false\n elsif @number_pool.nil?\n false\n elsif @age_gated.nil?\n false\n elsif @direct_lending.nil?\n false\n elsif @subscriber_optin.nil?\n false\n elsif @subscriber_optout.nil?\n false\n elsif @subscriber_help.nil?\n false\n elsif @sample1.nil?\n false\n elsif @mock.nil?\n false\n else\n list_invalid_properties.length() == 0\n end\n end",
"def valid?(metadata)\n validate.each do |attr|\n return false if metadata[attr.to_sym].nil? || metadata[attr.to_sym].zero?\n end\n end",
"def is_valid\n return true\n end",
"def validate_attrs\n @target.present? && [email protected]? && @actor.present? && @action_key.present?\n end",
"def list_invalid_properties\n invalid_properties = super\n if @class_id.nil?\n invalid_properties.push('invalid value for \"class_id\", class_id cannot be nil.')\n end\n\n if @object_type.nil?\n invalid_properties.push('invalid value for \"object_type\", object_type cannot be nil.')\n end\n\n if [email protected]? && @name.to_s.length > 31\n invalid_properties.push('invalid value for \"name\", the character length must be smaller than or equal to 31.')\n end\n\n pattern = Regexp.new(/^[a-zA-Z0-9\\-\\._:]+$/)\n if [email protected]? && @name !~ pattern\n invalid_properties.push(\"invalid value for \\\"name\\\", must conform to the pattern #{pattern}.\")\n end\n\n pattern = Regexp.new(/^$|((^20|5[0-9a-fA-F]{1}):([0-9a-fA-F]{2}:){6}([0-9a-fA-F]{2}))/)\n if !@static_wwpn_address.nil? && @static_wwpn_address !~ pattern\n invalid_properties.push(\"invalid value for \\\"static_wwpn_address\\\", must conform to the pattern #{pattern}.\")\n end\n\n pattern = Regexp.new(/^$|((^20|5[0-9a-fA-F]{1}):([0-9a-fA-F]{2}:){6}([0-9a-fA-F]{2}))/)\n if [email protected]? && @wwpn !~ pattern\n invalid_properties.push(\"invalid value for \\\"wwpn\\\", must conform to the pattern #{pattern}.\")\n end\n\n invalid_properties\n end",
"def valid_save?\n valid = true\n\n if self.name.nil? || self.name == \"\"\n valid = false\n end\n\n if self.general_info.nil? || self.general_info == \"\"\n valid = false\n end\n\n if self.technical_specs.nil? || self.technical_specs == \"\"\n valid = false\n end\n\n if self.where_to_buy.nil? || self.where_to_buy == \"\"\n valid = false\n end\n\n return valid\n end",
"def valid?\n schema.validate(self)\n end",
"def valid?\n reset_errors\n valid_date?\n valid_user?\n valid_activity_type?\n self.errors.empty?\n end",
"def valid?\n validate\n end",
"def product_attributes_must_not_be_empty\n\n\t\t# Instance\n\t\tproduct = Product.new\n\n\t\tassert product.invalid?\n\t\tassert product.errors[:title].any?\n\t\tassert product.errors[:description].any?\n\t\tassert product.errors[:price].any?\n\t\tassert product.errors[:image_url].any?\n\tend",
"def valid?\n return false if @id.nil?\n return false if @id !~ Regexp.new(/^psc_[a-zA-Z0-9]+$/)\n carrier_validator = EnumAttributeValidator.new('String', [\"USPS\"])\n return false unless carrier_validator.valid?(@carrier)\n return false if !@front_template_id.nil? && @front_template_id !~ Regexp.new(/^tmpl_[a-zA-Z0-9]+$/)\n return false if !@back_template_id.nil? && @back_template_id !~ Regexp.new(/^tmpl_[a-zA-Z0-9]+$/)\n return false if !@front_template_version_id.nil? && @front_template_version_id !~ Regexp.new(/^vrsn_[a-zA-Z0-9]+$/)\n return false if !@back_template_version_id.nil? && @back_template_version_id !~ Regexp.new(/^vrsn_[a-zA-Z0-9]+$/)\n object_validator = EnumAttributeValidator.new('String', [\"postcard\"])\n return false unless object_validator.valid?(@object)\n return false if @url.nil?\n return false if @url !~ Regexp.new(/^https:\\/\\/(lob-assets|lob-assets-staging)\\.com\\/(letters|postcards|bank-accounts|checks|self-mailers|cards)\\/[a-z]{3,4}_[a-z0-9]{15,16}(\\.pdf|_thumb_[a-z]+_[0-9]+\\.png)\\?(version=[a-z0-9-]*&)?expires=[0-9]{10}&signature=[a-zA-Z0-9_-]+$/)\n return false if [email protected]? && @description.to_s.length > 255\n true\n end",
"def valid?\n return false if @class_id.nil?\n class_id_validator = EnumAttributeValidator.new('String', [\"network.ElementSummary\"])\n return false unless class_id_validator.valid?(@class_id)\n return false if @object_type.nil?\n object_type_validator = EnumAttributeValidator.new('String', [\"network.ElementSummary\"])\n return false unless object_type_validator.valid?(@object_type)\n ethernet_switching_mode_validator = EnumAttributeValidator.new('String', [\"end-host\", \"switch\"])\n return false unless ethernet_switching_mode_validator.valid?(@ethernet_switching_mode)\n fc_switching_mode_validator = EnumAttributeValidator.new('String', [\"end-host\", \"switch\"])\n return false unless fc_switching_mode_validator.valid?(@fc_switching_mode)\n management_mode_validator = EnumAttributeValidator.new('String', [\"IntersightStandalone\", \"UCSM\", \"Intersight\"])\n return false unless management_mode_validator.valid?(@management_mode)\n thermal_validator = EnumAttributeValidator.new('String', [\"unknown\", \"ok\", \"upper-non-recoverable\", \"upper-critical\", \"upper-non-critical\", \"lower-non-critical\", \"lower-critical\", \"lower-non-recoverable\"])\n return false unless thermal_validator.valid?(@thermal)\n true && super\n end",
"def valid?\n\t\t\t\ttrue\n\t\t\tend",
"def validate\r\n validate! rescue false\r\n end",
"def validate\n validate_string_attributes\n end",
"def valid?\n self.errors = Mongomatic::Errors.new\n do_callback(:before_validate)\n check_required_fields\n validate\n do_callback(:after_validate)\n self.errors.empty?\n end",
"def valid\n @valid\n end",
"def valid_objects\n all_objects.select { |o| o.valid? }\n end",
"def valid?\n return false if @summary.nil?\n return false if @summary.to_s.length > 100\n record_type_validator = EnumAttributeValidator.new('String', [\"ServiceTicket\", \"ProjectTicket\", \"ProjectIssue\"])\n return false unless record_type_validator.valid?(@record_type)\n return false if !@wbs_code.nil? && @wbs_code.to_s.length > 50\n return false if @company.nil?\n return false if !@site_name.nil? && @site_name.to_s.length > 50\n return false if !@address_line1.nil? && @address_line1.to_s.length > 50\n return false if !@address_line2.nil? && @address_line2.to_s.length > 50\n return false if [email protected]? && @city.to_s.length > 50\n return false if !@state_identifier.nil? && @state_identifier.to_s.length > 50\n return false if [email protected]? && @zip.to_s.length > 12\n return false if !@contact_phone_number.nil? && @contact_phone_number.to_s.length > 20\n return false if !@contact_phone_extension.nil? && @contact_phone_extension.to_s.length > 15\n return false if !@contact_email_address.nil? && @contact_email_address.to_s.length > 250\n severity_validator = EnumAttributeValidator.new('String', [\"Low\", \"Medium\", \"High\"])\n return false unless severity_validator.valid?(@severity)\n impact_validator = EnumAttributeValidator.new('String', [\"Low\", \"Medium\", \"High\"])\n return false unless impact_validator.valid?(@impact)\n return false if !@external_x_ref.nil? && @external_x_ref.to_s.length > 100\n return false if !@po_number.nil? && @po_number.to_s.length > 50\n return false if !@automatic_email_cc.nil? && @automatic_email_cc.to_s.length > 1000\n sub_billing_method_validator = EnumAttributeValidator.new('String', [\"ActualRates\", \"FixedFee\", \"NotToExceed\", \"OverrideRate\"])\n return false unless sub_billing_method_validator.valid?(@sub_billing_method)\n knowledge_base_link_type_validator = EnumAttributeValidator.new('String', [\"ServiceTicket\", \"ProjectTicket\", \"ProjectIssue\", \"KnowledgeBaseArticle\", \"Time\", \"Activity\"])\n return false unless knowledge_base_link_type_validator.valid?(@knowledge_base_link_type)\n bill_time_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_time_validator.valid?(@bill_time)\n bill_expenses_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_expenses_validator.valid?(@bill_expenses)\n bill_products_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_products_validator.valid?(@bill_products)\n predecessor_type_validator = EnumAttributeValidator.new('String', [\"Ticket\", \"Phase\"])\n return false unless predecessor_type_validator.valid?(@predecessor_type)\n return true\n end",
"def validate!\n true\n end",
"def valid?\n return false if @class_id.nil?\n class_id_validator = EnumAttributeValidator.new('String', [\"vnic.FcIf\"])\n return false unless class_id_validator.valid?(@class_id)\n return false if @object_type.nil?\n object_type_validator = EnumAttributeValidator.new('String', [\"vnic.FcIf\"])\n return false unless object_type_validator.valid?(@object_type)\n return false if [email protected]? && @name.to_s.length > 31\n return false if [email protected]? && @name !~ Regexp.new(/^[a-zA-Z0-9\\-\\._:]+$/)\n return false if !@static_wwpn_address.nil? && @static_wwpn_address !~ Regexp.new(/^$|((^20|5[0-9a-fA-F]{1}):([0-9a-fA-F]{2}:){6}([0-9a-fA-F]{2}))/)\n type_validator = EnumAttributeValidator.new('String', [\"fc-initiator\", \"fc-nvme-initiator\", \"fc-nvme-target\", \"fc-target\"])\n return false unless type_validator.valid?(@type)\n return false if [email protected]? && @wwpn !~ Regexp.new(/^$|((^20|5[0-9a-fA-F]{1}):([0-9a-fA-F]{2}:){6}([0-9a-fA-F]{2}))/)\n wwpn_address_type_validator = EnumAttributeValidator.new('String', [\"POOL\", \"STATIC\"])\n return false unless wwpn_address_type_validator.valid?(@wwpn_address_type)\n true && super\n end",
"def valid?\n validate_survivors and validate_items && validate_records\n end",
"def valid?\n return false if @id.nil?\n return false if @next_send.nil?\n return false if @rrule.nil?\n return false if @session.nil?\n return false if @last_sent.nil?\n return false if @contact_name.nil?\n return false if @parameters.nil?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', ['Once', 'Hourly', 'Daily', 'Weekly', 'Monthly', 'Yearly'])\n return false unless type_validator.valid?(@type)\n return false if @summary.nil?\n return false if @text_parameters.nil?\n return false if @first_occurrence.nil?\n return false if @last_occurrence.nil?\n return false if @recipients_count.nil?\n return false if @timezone.nil?\n return false if @completed.nil?\n return false if @avatar.nil?\n return false if @created_at.nil?\n true\n end",
"def valid?\n return false if [email protected]? && @description.to_s.length > 255\n return false if @routing_number.nil?\n return false if @routing_number.to_s.length > 9\n return false if @routing_number.to_s.length < 9\n return false if @account_number.nil?\n return false if @account_number.to_s.length > 17\n return false if @account_type.nil?\n account_type_validator = EnumAttributeValidator.new('String', [\"company\", \"individual\"])\n return false unless account_type_validator.valid?(@account_type)\n return false if @signatory.nil?\n return false if @signatory.to_s.length > 30\n return false if @id.nil?\n return false if @id !~ Regexp.new(/^bank_[a-zA-Z0-9]+$/)\n return false if !@signature_url.nil? && @signature_url !~ Regexp.new(/^https:\\/\\/lob-assets\\.com\\/(letters|postcards|bank-accounts|checks|self-mailers|cards)\\/[a-z]{3,4}_[a-z0-9]{15,16}(\\.pdf|_thumb_[a-z]+_[0-9]+\\.png)\\?(version=[a-z0-9-]*&)?expires=[0-9]{10}&signature=[a-zA-Z0-9_-]+$/)\n return false if @date_created.nil?\n return false if @date_modified.nil?\n return false if @object.nil?\n object_validator = EnumAttributeValidator.new('String', [\"bank_account\"])\n return false unless object_validator.valid?(@object)\n true\n end",
"def valid?\n true\n end",
"def valid?\n true\n end",
"def valid?\n true\n end",
"def valid?\n true\n end",
"def valid?\n return false if @id.nil?\n return false if @account_id.nil?\n return false if @organization_id.nil?\n return false if @product_id.nil?\n return false if @product_rate_plan_id.nil?\n return false if @name.nil?\n type_validator = EnumAttributeValidator.new('String', [\"Subscription\", \"FixedTerm\", \"Trial\"])\n return false unless type_validator.valid?(@type)\n return false if @state.nil?\n state_validator = EnumAttributeValidator.new('String', [\"Trial\", \"Provisioned\", \"Paid\", \"AwaitingPayment\", \"Cancelled\", \"Failed\", \"Expired\"])\n return false unless state_validator.valid?(@state)\n return false if @initial_period_start.nil?\n return false if @trial_end.nil?\n managed_by_validator = EnumAttributeValidator.new('String', [\"BillForward\", \"Stripe\"])\n return false unless managed_by_validator.valid?(@managed_by)\n return false if @version_start.nil?\n return false if @version_number.nil?\n return false if @current_time.nil?\n failed_payment_behaviour_validator = EnumAttributeValidator.new('String', [\"CancelSubscription\", \"None\"])\n return false unless failed_payment_behaviour_validator.valid?(@failed_payment_behaviour)\n return true\n end",
"def validate_fields\n %w[email author].each do |field|\n value = self.send(field)\n abort \"Hoe #{field} value not set. aborting\" if value.nil? or value.empty?\n end\n end",
"def valid?\n return false if @name.nil?\n return false if @name.to_s.length < 1\n return false if @timezone.nil?\n return false if @timezone.to_s.length < 1\n return false if @currency.nil?\n return false if @currency.to_s.length < 1\n case_sensitivity_validator = EnumAttributeValidator.new('String', [\"sensitive\", \"insensitive-uppercase\", \"insensitive-lowercase\"])\n return false unless case_sensitivity_validator.valid?(@case_sensitivity)\n campaign_priority_validator = EnumAttributeValidator.new('String', [\"universal\", \"stackable\", \"exclusive\"])\n return false unless campaign_priority_validator.valid?(@campaign_priority)\n exclusive_campaigns_strategy_validator = EnumAttributeValidator.new('String', [\"listOrder\", \"lowestDiscount\", \"highestDiscount\"])\n return false unless exclusive_campaigns_strategy_validator.valid?(@exclusive_campaigns_strategy)\n default_discount_scope_validator = EnumAttributeValidator.new('String', [\"sessionTotal\", \"cartItems\", \"additionalCosts\"])\n return false unless default_discount_scope_validator.valid?(@default_discount_scope)\n default_discount_additional_cost_per_item_scope_validator = EnumAttributeValidator.new('String', [\"price\", \"itemTotal\", \"additionalCosts\"])\n return false unless default_discount_additional_cost_per_item_scope_validator.valid?(@default_discount_additional_cost_per_item_scope)\n true\n end",
"def valid?\n run_validation\n @errors.empty?\n end",
"def valid?\n MANDATORY_ATTRIBUTES.each{|a| return false unless self[a]}\n true\n end",
"def valid?\n return false if @id.nil?\n return false if @token.nil?\n return false if @tipo.nil?\n tipo_validator = EnumAttributeValidator.new('String', ['fatture', 'proforma', 'ordini', 'preventivi', 'ndc'])\n return false unless tipo_validator.valid?(@tipo)\n return false if @nome.nil?\n return false if @indirizzo_via.nil?\n return false if @indirizzo_cap.nil?\n return false if @indirizzo_citta.nil?\n return false if @indirizzo_provincia.nil?\n return false if @paese.nil?\n lingua_validator = EnumAttributeValidator.new('String', ['it', 'en', 'de'])\n return false unless lingua_validator.valid?(@lingua)\n return false if @piva.nil?\n return false if @cf.nil?\n return false if @numero.nil?\n return false if @valuta.nil?\n return false if @valuta_cambio.nil?\n return false if @prezzi_ivati.nil?\n return false if @importo_netto.nil?\n return false if @importo_iva.nil?\n return false if @importo_totale.nil?\n mostra_totali_validator = EnumAttributeValidator.new('String', ['tutti', 'netto', 'nessuno'])\n return false unless mostra_totali_validator.valid?(@mostra_totali)\n return false if @lista_articoli.nil?\n pa_tipo_cliente_validator = EnumAttributeValidator.new('String', ['PA', 'B2B'])\n return false unless pa_tipo_cliente_validator.valid?(@pa_tipo_cliente)\n pa_tipo_validator = EnumAttributeValidator.new('String', ['ordine', 'convenzione', 'contratto', 'nessuno'])\n return false unless pa_tipo_validator.valid?(@pa_tipo)\n pa_esigibilita_validator = EnumAttributeValidator.new('String', ['I', 'D', 'S', 'N'])\n return false unless pa_esigibilita_validator.valid?(@pa_esigibilita)\n true\n end",
"def valid?\n return false if @name.nil?\n return false if @name.to_s.length > 50\n return false if @prefix_suffix_option.nil?\n prefix_suffix_option_validator = EnumAttributeValidator.new('String', [\"Prefix\", \"Suffix\"])\n return false unless prefix_suffix_option_validator.valid?(@prefix_suffix_option)\n return false if !@invoice_pre_suffix.nil? && @invoice_pre_suffix.to_s.length > 5\n application_units_validator = EnumAttributeValidator.new('String', [\"Amount\", \"Hours\", \"Incidents\"])\n return false unless application_units_validator.valid?(@application_units)\n application_cycle_validator = EnumAttributeValidator.new('String', [\"Contract2Weeks\", \"Contract4Weeks\", \"ContractYear\", \"CalendarMonth\", \"CalendarQuarter\", \"CalendarWeek\", \"ContractQuarter\", \"CalendarYear\"])\n return false unless application_cycle_validator.valid?(@application_cycle)\n return false if @employee_comp_rate.nil?\n employee_comp_rate_validator = EnumAttributeValidator.new('String', [\"Actual\", \"Hourly\"])\n return false unless employee_comp_rate_validator.valid?(@employee_comp_rate)\n return false if @employee_comp_not_exceed.nil?\n employee_comp_not_exceed_validator = EnumAttributeValidator.new('String', [\"Billing\", \"Percent\", \"Amount\"])\n return false unless employee_comp_not_exceed_validator.valid?(@employee_comp_not_exceed)\n return false if @invoicing_cycle.nil?\n invoicing_cycle_validator = EnumAttributeValidator.new('String', [\"CalendarYear\", \"ContractYear\"])\n return false unless invoicing_cycle_validator.valid?(@invoicing_cycle)\n return false if !@invoice_description.nil? && @invoice_description.to_s.length > 4000\n return false if @bill_time.nil?\n bill_time_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_time_validator.valid?(@bill_time)\n return false if @bill_expenses.nil?\n bill_expenses_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_expenses_validator.valid?(@bill_expenses)\n return false if @bill_products.nil?\n bill_products_validator = EnumAttributeValidator.new('String', [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"])\n return false unless bill_products_validator.valid?(@bill_products)\n return true\n end",
"def list_invalid_properties\n invalid_properties = super\n if @class_id.nil?\n invalid_properties.push('invalid value for \"class_id\", class_id cannot be nil.')\n end\n\n if @object_type.nil?\n invalid_properties.push('invalid value for \"object_type\", object_type cannot be nil.')\n end\n\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = super\n if @class_id.nil?\n invalid_properties.push('invalid value for \"class_id\", class_id cannot be nil.')\n end\n\n if @object_type.nil?\n invalid_properties.push('invalid value for \"object_type\", object_type cannot be nil.')\n end\n\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = super\n if @class_id.nil?\n invalid_properties.push('invalid value for \"class_id\", class_id cannot be nil.')\n end\n\n if @object_type.nil?\n invalid_properties.push('invalid value for \"object_type\", object_type cannot be nil.')\n end\n\n invalid_properties\n end",
"def list_invalid_properties\n invalid_properties = super\n if @class_id.nil?\n invalid_properties.push('invalid value for \"class_id\", class_id cannot be nil.')\n end\n\n if @object_type.nil?\n invalid_properties.push('invalid value for \"object_type\", object_type cannot be nil.')\n end\n\n invalid_properties\n end",
"def validate\n end",
"def valid?\n return false if @to.nil?\n return false if @from.nil?\n carrier_validator = EnumAttributeValidator.new('String', [\"USPS\"])\n return false unless carrier_validator.valid?(@carrier)\n return false if @date_created.nil?\n return false if @date_modified.nil?\n return false if @id.nil?\n return false if @id !~ Regexp.new(/^ltr_[a-zA-Z0-9]+$/)\n return false if !@template_id.nil? && @template_id !~ Regexp.new(/^tmpl_[a-zA-Z0-9]+$/)\n return false if !@template_version_id.nil? && @template_version_id !~ Regexp.new(/^vrsn_[a-zA-Z0-9]+$/)\n return false if [email protected]? && @url !~ Regexp.new(/^https:\\/\\/(lob-assets|lob-assets-staging)\\.com\\/(letters|postcards|bank-accounts|checks|self-mailers|cards)\\/[a-z]{3,4}_[a-z0-9]{15,16}(\\.pdf|_thumb_[a-z]+_[0-9]+\\.png)\\?(version=[a-z0-9-]*&)?expires=[0-9]{10}&signature=[a-zA-Z0-9_-]+$/)\n return false if @object.nil?\n object_validator = EnumAttributeValidator.new('String', [\"letter\"])\n return false unless object_validator.valid?(@object)\n return false if [email protected]? && @description.to_s.length > 255\n return false if !@tracking_events.nil? && @tracking_events.length > 0\n address_placement_validator = EnumAttributeValidator.new('String', [\"top_first_page\", \"insert_blank_page\", \"bottom_first_page_center\", \"bottom_first_page\"])\n return false unless address_placement_validator.valid?(@address_placement)\n true\n end",
"def valid_attributes\n {}\n end",
"def valid_attributes\n {}\n end",
"def valid_attributes\n {}\n end",
"def valid_attributes\n {}\n end",
"def valid_attributes\n {}\n end",
"def valid_attributes\n {}\n end",
"def valid_attributes\n {}\n end",
"def valid_attributes\n {}\n end",
"def supports_validations?\n true\n end",
"def valid?\n @errors = self.class.valid_against_schema?(self.class.json_schema, self)\n @errors.empty?\n end",
"def valid?\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n end",
"def valid?\n return false if @first_name.nil?\n return false if @first_name.to_s.length > 30\n return false if !@last_name.nil? && @last_name.to_s.length > 30\n return false if !@address_line1.nil? && @address_line1.to_s.length > 50\n return false if !@address_line2.nil? && @address_line2.to_s.length > 50\n return false if [email protected]? && @city.to_s.length > 50\n return false if [email protected]? && @state.to_s.length > 50\n return false if [email protected]? && @zip.to_s.length > 12\n return false if [email protected]? && @country.to_s.length > 50\n return false if !@security_identifier.nil? && @security_identifier.to_s.length > 184\n return false if [email protected]? && @title.to_s.length > 100\n return false if [email protected]? && @school.to_s.length > 50\n return false if !@nick_name.nil? && @nick_name.to_s.length > 30\n return false if !@significant_other.nil? && @significant_other.to_s.length > 30\n return false if !@portal_password.nil? && @portal_password.to_s.length > 15\n return false if !@portal_security_level.nil? && @portal_security_level > 6.0\n return false if !@portal_security_level.nil? && @portal_security_level < 1.0\n gender_validator = EnumAttributeValidator.new('String', [\"Male\", \"Female\"])\n return false unless gender_validator.valid?(@gender)\n presence_validator = EnumAttributeValidator.new('String', [\"Online\", \"DoNotDisturb\", \"Away\", \"Offline\", \"NoAgent\"])\n return false unless presence_validator.valid?(@presence)\n return true\n end",
"def validated?; end",
"def valid?\n return false if @name.nil?\n return false if @slug.nil?\n return false if @status.nil?\n status_validator = EnumAttributeValidator.new('String', ['enabled', 'disabled'])\n return false unless status_validator.valid?(@status)\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', ['digital', 'physical'])\n return false unless type_validator.valid?(@type)\n return false if @sku.nil?\n return false if @price.nil?\n availability_validator = EnumAttributeValidator.new('String', ['available', 'comingSoon', 'retired'])\n return false unless availability_validator.valid?(@availability)\n stock_status_validator = EnumAttributeValidator.new('String', ['available', 'alert', 'unavailable'])\n return false unless stock_status_validator.valid?(@stock_status)\n return false if @categories.nil?\n true\n end",
"def valid?\n self.valid\n end",
"def validate!\n\t\t\t\treturn true\n\t\t\tend",
"def valid?\n true\n end",
"def valid?\n true\n end",
"def valid?\n true\n end"
] | [
"0.78989387",
"0.78989387",
"0.7097542",
"0.7077744",
"0.7031459",
"0.703038",
"0.69501424",
"0.6869871",
"0.68576187",
"0.68576187",
"0.68280154",
"0.68235457",
"0.682004",
"0.6814453",
"0.67930245",
"0.67521733",
"0.66832304",
"0.6675793",
"0.66681546",
"0.6629595",
"0.6617465",
"0.6607692",
"0.65987355",
"0.6592801",
"0.6583014",
"0.6579285",
"0.6577414",
"0.65584666",
"0.6555042",
"0.65412676",
"0.6536351",
"0.65329516",
"0.65303016",
"0.65302014",
"0.65264887",
"0.65243757",
"0.6521103",
"0.6520529",
"0.6510239",
"0.6497977",
"0.64953005",
"0.6492617",
"0.6490203",
"0.6486868",
"0.6479195",
"0.6472761",
"0.6467466",
"0.64662087",
"0.64597183",
"0.64585143",
"0.6454266",
"0.64525664",
"0.64467776",
"0.6438108",
"0.64316994",
"0.64303964",
"0.642744",
"0.6424936",
"0.6411408",
"0.64060026",
"0.64030236",
"0.64024323",
"0.6398373",
"0.6396846",
"0.638469",
"0.63839316",
"0.63839316",
"0.63839316",
"0.63839316",
"0.6372891",
"0.6366883",
"0.6363971",
"0.6360727",
"0.63599366",
"0.6356294",
"0.6354323",
"0.6354316",
"0.6354316",
"0.6354316",
"0.6354316",
"0.6353269",
"0.63492244",
"0.63444567",
"0.63444567",
"0.63444567",
"0.63444567",
"0.63444567",
"0.63444567",
"0.63444567",
"0.63444567",
"0.63426214",
"0.63397413",
"0.6332967",
"0.6332387",
"0.633085",
"0.6328917",
"0.63259315",
"0.63233054",
"0.63230336",
"0.63230336",
"0.63230336"
] | 0.0 | -1 |
Custom attribute writer method checking allowed values (enum). | def timing=(timing)
validator = EnumAttributeValidator.new('String', ["immediate", "renewal"])
unless validator.valid?(timing)
fail ArgumentError, "invalid value for 'timing', must be one of #{validator.allowable_values}."
end
@timing = timing
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write_attribute_with_enum(attr, value)\n write_attribute_without_enum attr, converted_enum(attr, value)\n end",
"def attr_enum(name, enum, options={}, &block)\n raise ArgumentError, 'enum' unless enum && enum.respond_to?(:values)\n\n options = {\n :enum => enum,\n :validate => true\n }.merge(options)\n\n required = options[:required] == true\n converter = block_given? ? block : Converters.converter_for(:enum, options)\n\n attr_reader_with_converter name, converter, options\n\n validates name,\n :allow_blank => !required,\n :allow_nil => !required,\n :inclusion => { :in => enum.values } if options[:validate]\n\n attr_writer name\n\n add_attr(name, :enum, converter, options)\n end",
"def _attribute_enum?(attr)\n return false unless self.class.respond_to?(:defined_enums)\n self.class.defined_enums.with_indifferent_access.include?(attr)\n end",
"def nature_of_business=(nature_of_business)\n validator = EnumAttributeValidator.new('String', [\"personal\", \"agriculture_and_hunting\", \"forestry\", \"fishing\", \"agricultural_by_products\", \"coal_mining\", \"oil_mining\", \"iron_ore_mining\", \"other_metal_and_diamond_mining\", \"other_mineral_mining\", \"manufacturing_of_food_drink_tobacco\", \"manufacturing_of_textiles_leather_fur_furniture\", \"manufacture_of_wooden_products_furniture\", \"manufacture_of_paper_pulp_allied_products\", \"manufacture_of_chemicals_medical_petroleum_rubber_plastic_products\", \"manufacture_of_pottery_china_glass_stone\", \"manufacture_of_iron_steel_non_ferrous_metals_basic_industries\", \"manufacture_of_metal_products_electrical_and_scientific_engineering\", \"manufacture_of_jewelry_musical_instruments_toys\", \"electricity_gas_and_water\", \"construction\", \"wholesale_trade\", \"retail_trade\", \"catering_incl_hotels\", \"transport_storage\", \"communications\", \"finance_and_holding_companies\", \"insurance\", \"business_services\", \"real_estate_development_investment\", \"central_state_governments\", \"community_services_defence_police_prisons_etc\", \"social_services_education_health_care\", \"personal_services_leisure_services\", \"personal_services_domestic_laundry_repairs\", \"personal_services_embassies_international_organisations\"])\n unless validator.valid?(nature_of_business) || nature_of_business.empty?\n fail ArgumentError, \"invalid value for \\\"nature_of_business\\\", must be one of #{validator.allowable_values}.\"\n end\n @nature_of_business = nature_of_business\n end",
"def valid?\n type_validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n return false unless type_validator.valid?(@type)\n subtype_validator = EnumAttributeValidator.new('String', ['None', 'Across', 'Bottom', 'BottomLeft', 'BottomRight', 'Center', 'Clockwise', 'CounterClockwise', 'GradualAndCycleClockwise', 'GradualAndCycleCounterClockwise', 'Down', 'DownLeft', 'DownRight', 'FontAllCaps', 'FontBold', 'FontItalic', 'FontShadow', 'FontStrikethrough', 'FontUnderline', 'Gradual', 'Horizontal', 'HorizontalIn', 'HorizontalOut', 'In', 'InBottom', 'InCenter', 'InSlightly', 'Instant', 'Left', 'OrdinalMask', 'Out', 'OutBottom', 'OutCenter', 'OutSlightly', 'Right', 'Slightly', 'Top', 'TopLeft', 'TopRight', 'Up', 'UpLeft', 'UpRight', 'Vertical', 'VerticalIn', 'VerticalOut', 'Wheel1', 'Wheel2', 'Wheel3', 'Wheel4', 'Wheel8'])\n return false unless subtype_validator.valid?(@subtype)\n preset_class_type_validator = EnumAttributeValidator.new('String', ['Entrance', 'Exit', 'Emphasis', 'Path', 'MediaCall', 'OLEActionVerbs'])\n return false unless preset_class_type_validator.valid?(@preset_class_type)\n return false if @shape_index.nil?\n trigger_type_validator = EnumAttributeValidator.new('String', ['AfterPrevious', 'OnClick', 'WithPrevious'])\n return false unless trigger_type_validator.valid?(@trigger_type)\n restart_validator = EnumAttributeValidator.new('String', ['Always', 'WhenNotActive', 'Never', 'NotDefined'])\n return false unless restart_validator.valid?(@restart)\n after_animation_type_validator = EnumAttributeValidator.new('String', ['DoNotDim', 'Color', 'HideAfterAnimation', 'HideOnNextMouseClick'])\n return false unless after_animation_type_validator.valid?(@after_animation_type)\n true\n end",
"def enum_attr?(name)\n return false unless @enum_attrs\n @enum_attrs.key?(name)\n end",
"def classy_enum_attr(attribute, options={})\n enum = (options[:class_name] || options[:enum] || attribute).to_s.camelize.constantize\n allow_blank = options[:allow_blank] || false\n allow_nil = options[:allow_nil] || false\n default = ClassyEnum._normalize_default(options[:default], enum)\n\n # Add ActiveRecord validation to ensure it won't be saved unless it's an option\n validates_inclusion_of attribute,\n in: enum,\n allow_blank: allow_blank,\n allow_nil: allow_nil\n\n # Use a module so that the reader methods can be overridden in classes and\n # use super to get the enum value.\n mod = Module.new do\n\n # Define getter method that returns a ClassyEnum instance\n define_method attribute do\n enum.build(read_attribute(attribute), owner: self)\n end\n\n # Define setter method that accepts string, symbol, instance or class for member\n define_method \"#{attribute}=\" do |value|\n value = ClassyEnum._normalize_value(value, default, (allow_nil || allow_blank))\n super(value)\n end\n\n define_method :save_changed_attribute do |attr_name, arg|\n if attribute.to_s == attr_name.to_s && !attribute_changed?(attr_name)\n arg = enum.build(arg)\n current_value = clone_attribute_value(:read_attribute, attr_name)\n\n if arg != current_value\n if respond_to?(:set_attribute_was, true)\n set_attribute_was(attr_name, enum.build(arg, owner: self))\n else\n changed_attributes[attr_name] = enum.build(current_value, owner: self)\n end\n end\n else\n super(attr_name, arg)\n end\n end\n end\n\n include mod\n\n # Initialize the object with the default value if it is present\n # because this will let you store the default value in the\n # database and make it searchable.\n if default.present?\n after_initialize do\n value = read_attribute(attribute)\n\n if (value.blank? && !(allow_blank || allow_nil)) || (value.nil? && !allow_nil)\n send(\"#{attribute}=\", default)\n end\n end\n end\n\n end",
"def is_enum_param(name)\n [\"bookmarkType\", \"order\", \"role\"].include?(name)\n end",
"def valid?\n ENUM.include? @type.downcase.to_sym\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end",
"def set_enum_attrs(subset)\n raise ArgumentError, \"attrs is not a proper subset of available values\" unless subset.all? { |attr| attrs.include? attr }\n @enum_attrs = subset\n end",
"def country=(country)\n validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n unless validator.valid?(country)\n fail ArgumentError, \"invalid value for 'country', must be one of #{validator.allowable_values}.\"\n end\n @country = country\n end",
"def check_option!(name, definition)\n case name\n when :values\n raise AttributorException, \"Allowed set of values requires an array. Got (#{definition})\" unless definition.is_a? ::Array\n when :default\n raise AttributorException, \"Default value doesn't have the correct attribute type. Got (#{definition.inspect})\" unless type.valid_type?(definition) || definition.is_a?(Proc)\n options[:default] = load(definition) unless definition.is_a?(Proc)\n when :description\n raise AttributorException, \"Description value must be a string. Got (#{definition})\" unless definition.is_a? ::String\n when :required\n raise AttributorException, 'Required must be a boolean' unless definition == true || definition == false\n raise AttributorException, 'Required cannot be enabled in combination with :default' if definition == true && options.key?(:default)\n when :required_if\n raise AttributorException, 'Required_if must be a String, a Hash definition or a Proc' unless definition.is_a?(::String) || definition.is_a?(::Hash) || definition.is_a?(::Proc)\n raise AttributorException, 'Required_if cannot be specified together with :required' if options[:required]\n when :example\n unless definition.is_a?(::Regexp) || definition.is_a?(::String) || definition.is_a?(::Array) || definition.is_a?(::Proc) || definition.nil? || type.valid_type?(definition)\n raise AttributorException, \"Invalid example type (got: #{definition.class.name}). It must always match the type of the attribute (except if passing Regex that is allowed for some types)\"\n end\n when :custom_data\n raise AttributorException, \"custom_data must be a Hash. Got (#{definition})\" unless definition.is_a?(::Hash)\n else\n return :unknown # unknown option\n end\n\n :ok # passes\n end",
"def define_active_enum_write_method(attribute)\n class_eval <<-DEF\n def #{attribute}=(arg)\n if arg.is_a?(Symbol)\n super(self.class.active_enum_for(:#{attribute})[arg])\n else\n super\n end\n end\n DEF\n end",
"def check_enum(validation:, key:, schema:)\n return false if !validation[:required] && schema.nil? # Optional and not here, dont check\n return false unless validation[:values]\n return false if validation[:values].include?(schema)\n\n schema = 'nothing' if schema.nil?\n error! key, \"must be one of #{validation[:values].join(', ')}, but was #{schema}\"\n true\n end",
"def should_allow_values_for(attribute, *good_values)\n get_options!(good_values)\n good_values.each do |value|\n matcher = allow_value(value).for(attribute)\n should matcher.description do\n assert_accepts matcher, subject\n end\n end\n end",
"def validate_exclusion_of(attr); end",
"def valid_attribute_types\n\t\treturn self.must_attribute_types |\n\t\t self.may_attribute_types |\n\t\t self.operational_attribute_types\n\tend",
"def valid?\n status_validator = EnumAttributeValidator.new('String', [\"ACTIVE\", \"INACTIVE\"])\n return false unless status_validator.valid?(@status)\n country_validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n return false unless country_validator.valid?(@country)\n currency_validator = EnumAttributeValidator.new('String', [\"UNKNOWN_CURRENCY\", \"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n return false unless currency_validator.valid?(@currency)\n type_validator = EnumAttributeValidator.new('String', [\"PHYSICAL\", \"MOBILE\"])\n return false unless type_validator.valid?(@type)\n return true\n end",
"def update_allowed_values\n self.url_allowed = true if url_required\n self.description_allowed = true if description_required\n self.title_allowed = true if title_required\n\n TagSet::TAG_TYPES.each do |tag_type|\n required = eval(\"#{tag_type}_num_required\") || eval(\"self.#{tag_type}_num_required\") || 0\n allowed = eval(\"#{tag_type}_num_allowed\") || eval(\"self.#{tag_type}_num_allowed\") || 0\n if required > allowed\n eval(\"self.#{tag_type}_num_allowed = required\")\n end\n end\n end",
"def test_valid?\n assert_raise( RuntimeError ) { Tui::Model::Enum.new( 'lab1', { }, 1 ) }\n base = Tui::Model::Enum.new( 'lab1', { 'val1' => '1', 'val99' => '99' }, 'val99' )\n assert_false base.valid?( 1 )\n assert_true base.valid?( \"val1\" )\n ex = assert_raise( RuntimeError ) { base.value = 1; }\n assert_equal( 'Invalid value for model type Tui::Model::Enum!', ex.message )\n end",
"def validate_may_attributes\n\t\thash = (self.entry || {} ).merge( @values )\n\t\tattributes = hash.keys.map( &:to_sym ).uniq\n\t\tvalid_attributes = self.valid_attribute_oids +\n\t\t\tself.operational_attribute_oids +\n\t\t\tIGNORED_OPERATIONAL_ATTRS\n\n\t\tself.log.debug \"Validating MAY attributes: %p against the list of valid OIDs: %p\" %\n\t\t\t[ attributes, valid_attributes ]\n\t\tunknown_attributes = attributes - valid_attributes\n\t\tunknown_attributes.each do |oid|\n\t\t\tself.errors.add( oid, \"is not allowed by entry's objectClasses\" )\n\t\tend\n\tend",
"def allowed_attributes=(_arg0); end",
"def allowed_attributes=(_arg0); end",
"def validate_range(key, value, enum_values)\n values = value.instance_of?(Array) ? value : [value]\n values.each do |v|\n add_templated_error(key, \"'#{v}' is not a valid setting for '#{template.name_for(key)}'\") unless enum_values.include?(v)\n end\n end",
"def valid?\n return false if @class_id.nil?\n class_id_validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n return false unless class_id_validator.valid?(@class_id)\n return false if @object_type.nil?\n object_type_validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n return false unless object_type_validator.valid?(@object_type)\n true\n end",
"def allowed_values(value, pdef)\n if(pdef['AllowedValues'].include?(value))\n true\n else\n \"Not an allowed value: #{pdef['AllowedValues'].join(', ')}\"\n end\n end",
"def allowed_to_write(name)\n # no point allowing attribute writes if we can't save them?\n if allowed_to_save\n name = name.to_s\n validation_methods = self.class.write_validations(name) \n if validation_methods.nil?\n # We haven't registered any filters on this attribute, so allow the write.\n true\n elsif validation_methods.check :accessor => accessor, :model => self\n # One of the authentication methods worked, so allow the write.\n true\n else\n # We had filters but none of them passed. Disallow write.\n false\n end\n else\n false\n end\n end",
"def status_enum=(status)\n write_attribute(:status, status)\n end",
"def setting_attribute_is_allowed?(name, user)\n return false unless user.can_write?(self, name)\n (self.whitelisted_attributes && self.whitelisted_attributes.has_key?( name.to_sym)) ||\n (\n self.attribute_names.include?( name.to_s ) &&\n ( self.blacklisted_attributes.nil? ||\n ! self.blacklisted_attributes.has_key?( name.to_sym ) )\n )\n end",
"def valid?\n return false if !super\n status_validator = EnumAttributeValidator.new('String', ['NotDefined', 'Active', 'Resolved', 'Closed'])\n return false unless status_validator.valid?(@status)\n true\n end",
"def valid?\n MANDATORY_ATTRIBUTES[type].each{|a| return false unless self[a]}\n true\n end",
"def valid?\n return false if !super\n return false if @style.nil?\n style_validator = EnumAttributeValidator.new('String', ['Unknown', 'Percent05', 'Percent10', 'Percent20', 'Percent25', 'Percent30', 'Percent40', 'Percent50', 'Percent60', 'Percent70', 'Percent75', 'Percent80', 'Percent90', 'DarkHorizontal', 'DarkVertical', 'DarkDownwardDiagonal', 'DarkUpwardDiagonal', 'SmallCheckerBoard', 'Trellis', 'LightHorizontal', 'LightVertical', 'LightDownwardDiagonal', 'LightUpwardDiagonal', 'SmallGrid', 'DottedDiamond', 'WideDownwardDiagonal', 'WideUpwardDiagonal', 'DashedUpwardDiagonal', 'DashedDownwardDiagonal', 'NarrowVertical', 'NarrowHorizontal', 'DashedVertical', 'DashedHorizontal', 'LargeConfetti', 'LargeGrid', 'HorizontalBrick', 'LargeCheckerBoard', 'SmallConfetti', 'Zigzag', 'SolidDiamond', 'DiagonalBrick', 'OutlinedDiamond', 'Plaid', 'Sphere', 'Weave', 'DottedGrid', 'Divot', 'Shingle', 'Wave', 'Horizontal', 'Vertical', 'Cross', 'DownwardDiagonal', 'UpwardDiagonal', 'DiagonalCross', 'NotDefined'])\n return false unless style_validator.valid?(@style)\n true\n end",
"def enum?(field)\n !!self.enums[field.to_sym]\n end",
"def currency=(currency)\n validator = EnumAttributeValidator.new('String', [\"UNKNOWN_CURRENCY\", \"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n unless validator.valid?(currency)\n fail ArgumentError, \"invalid value for 'currency', must be one of #{validator.allowable_values}.\"\n end\n @currency = currency\n end",
"def enum_defined_for?(attribute)\n context = self.eh_params[:enum_contexts][attribute.to_s]\n !!(eh_params[:db_codes][context] && eh_params[:db_codes][context][attribute.to_s])\n # Returns true if the indicated attribute has an enum defined\n end",
"def object_type=(object_type)\n validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n unless validator.valid?(object_type)\n fail ArgumentError, \"invalid value for \\\"object_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @object_type = object_type\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', [\"\", \"APIC\", \"DCNM\", \"UCSFI\", \"UCSFIISM\", \"IMC\", \"IMCM4\", \"IMCM5\", \"IMCRack\", \"UCSIOM\", \"HX\", \"HyperFlexAP\", \"IWE\", \"UCSD\", \"IntersightAppliance\", \"IntersightAssist\", \"PureStorageFlashArray\", \"UCSC890\", \"NetAppOntap\", \"NetAppActiveIqUnifiedManager\", \"EmcScaleIo\", \"EmcVmax\", \"EmcVplex\", \"EmcXtremIo\", \"VmwareVcenter\", \"MicrosoftHyperV\", \"AppDynamics\", \"Dynatrace\", \"NewRelic\", \"ServiceNow\", \"ReadHatOpenStack\", \"CloudFoundry\", \"MicrosoftAzureApplicationInsights\", \"OpenStack\", \"MicrosoftSqlServer\", \"Kubernetes\", \"AmazonWebService\", \"AmazonWebServiceBilling\", \"MicrosoftAzureServicePrincipal\", \"MicrosoftAzureEnterpriseAgreement\", \"DellCompellent\", \"HPE3Par\", \"RedHatEnterpriseVirtualization\", \"NutanixAcropolis\", \"HPEOneView\", \"ServiceEngine\", \"HitachiVirtualStoragePlatform\", \"IMCBlade\", \"TerraformCloud\", \"TerraformAgent\", \"CustomTarget\", \"AnsibleEndpoint\", \"HTTPEndpoint\", \"SSHEndpoint\", \"CiscoCatalyst\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end",
"def compliance=(compliance)\n validator = EnumAttributeValidator.new('String', ['Pdf15', 'PdfA1b'])\n unless validator.valid?(compliance)\n fail ArgumentError, 'invalid value for \"compliance\", must be one of #{validator.allowable_values}.'\n end\n @compliance = compliance\n end",
"def supports_polymorphic_enum_handling(attribute_name)\n self.eh_params[:polymorphic_attribute] = \"#{attribute_name}_type\".to_sym\n end",
"def should_deny_values(options)\n klass = self.name.gsub(/Test$/, '').constantize\n\n context \"#{klass}\" do\n options.each_pair do |attribute, values|\n [*values].each do |value|\n display_value = value.class == NilClass ? \"nil\" : \"\\\"#{value}\\\"\"\n \n should \"not allow #{attribute} to be #{display_value}\" do\n instance = get_instance_of(klass)\n instance.send(\"#{attribute}=\", value)\n assert !instance.valid?, \n \"Expected #{klass} to be invalid when #{attribute} is set to #{display_value}\"\n assert instance.errors.on(attribute.to_sym), \n \"Expected errors on #{attribute} when set to #{display_value}\"\n end\n end\n end\n end\n end",
"def enum?\n true\n end",
"def kind=(kind)\n validator = EnumAttributeValidator.new('String', [\"UNKNOWN\", \"USER_CREATED\", \"INTERNAL\"])\n unless validator.valid?(kind)\n fail ArgumentError, \"invalid value for \\\"kind\\\", must be one of #{validator.allowable_values}.\"\n end\n @kind = kind\n end",
"def validate_attribute_syntax\n\t\[email protected] do |attribute, values|\n\t\t\t[ values ].flatten.each do |value|\n\t\t\t\tbegin\n\t\t\t\t\tself.get_converted_attribute( attribute.to_sym, value )\n\t\t\t\trescue => err\n\t\t\t\t\tself.log.error \"validation for %p failed: %s: %s\" %\n\t\t\t\t\t\t[ attribute, err.class.name, err.message ]\n\t\t\t\t\tattrtype = self.find_attribute_type( attribute )\n\t\t\t\t\tself.errors.add( attribute, \"isn't a valid %s value\" %\n\t\t\t\t\t\t[ attrtype.syntax ? attrtype.syntax.desc : attrtype.syntax_oid ] )\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"def valid?\n return false if @name.nil?\n return false if @name.to_s.length > 25\n return false if @based_on.nil?\n based_on_validator = EnumAttributeValidator.new('String', [\"MyCalendar\", \"Customer\", \"AllHours\", \"Custom\"])\n return false unless based_on_validator.valid?(@based_on)\n return false if !@application_order.nil? && @application_order > 32767\n return false if !@application_order.nil? && @application_order < 1\n return false if !@respond_hours.nil? && @respond_hours > 999\n return false if !@respond_hours.nil? && @respond_hours < 0\n return false if !@respond_percent.nil? && @respond_percent > 99999\n return false if !@respond_percent.nil? && @respond_percent < 0\n return false if !@plan_within.nil? && @plan_within > 999\n return false if !@plan_within.nil? && @plan_within < 0\n return false if !@plan_within_percent.nil? && @plan_within_percent > 99999\n return false if !@plan_within_percent.nil? && @plan_within_percent < 0\n return false if !@resolution_hours.nil? && @resolution_hours > 999\n return false if !@resolution_hours.nil? && @resolution_hours < 0\n return false if !@resolution_percent.nil? && @resolution_percent > 99999\n return false if !@resolution_percent.nil? && @resolution_percent < 0\n return true\n end",
"def valid?\n policy_validator = EnumAttributeValidator.new('Object', ['RMF', 'DIACAP', 'Reporting'])\n return false unless policy_validator.valid?(@policy)\n registration_type_validator = EnumAttributeValidator.new('Object', ['Assess and Authorize', 'Assess Only', 'Guest', 'Regular', 'Functional', 'Cloud Service Provider'])\n return false unless registration_type_validator.valid?(@registration_type)\n organization_name_validator = EnumAttributeValidator.new('Object', ['Army', 'Navy', 'Air Force', 'Marines', 'DoD', 'Defense Information Systems Agency'])\n return false unless organization_name_validator.valid?(@organization_name)\n system_type_validator = EnumAttributeValidator.new('Object', ['IS Major Application', 'IS Enclave', 'Platform IT', 'Platform IT System', 'Interconnection', 'AIS Application'])\n return false unless system_type_validator.valid?(@system_type)\n authorization_status_validator = EnumAttributeValidator.new('Object', ['Authority to Operate (ATO)', 'Interim Authority to Operate (IATO)', 'Interim Authority to Test (IATT)', 'Authority to Operate with Conditions (ATO) w/Conditions)', 'Denied Authority to Operate (DATO)', 'Not Yet Authorized', 'Unaccredited', 'Decommissioned'])\n return false unless authorization_status_validator.valid?(@authorization_status)\n confidentiality_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless confidentiality_validator.valid?(@confidentiality)\n integrity_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless integrity_validator.valid?(@integrity)\n availability_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless availability_validator.valid?(@availability)\n mac_validator = EnumAttributeValidator.new('Object', ['I', 'II', 'III'])\n return false unless mac_validator.valid?(@mac)\n dod_confidentiality_validator = EnumAttributeValidator.new('Object', ['Public', 'Sensitive', 'Classified'])\n return false unless dod_confidentiality_validator.valid?(@dod_confidentiality)\n true\n end",
"def enum?\n false\n end",
"def unassignable_value_for(attr)\n case attr.type\n when :integer\n attr.assignable_values.max + 1\n when :string\n assignable_value_for(attr) + '-unassignable'\n else\n raise \"Assignable values for :#{attr.type} attributes not supported\"\n end\n end",
"def define_value_methods!\n self.accepted_values.each do |(name, bit)|\n self.meta_class.class_eval <<-FLAG_METHODS\n\n def #{name}\n ((@value || 0) & #{bit}) != 0\n end\n alias :#{name}? :#{name}\n\n def #{name}=(new_value)\n boolean = self.to_boolean(new_value)\n current = self.#{name}\n if boolean ^ current\n self.value = ((@value || 0) ^ #{bit})\n end\n self.#{name}\n end\n\n FLAG_METHODS\n end\n end",
"def update_enum_attribute(database_id:, collection_id:, key:, elements:, required:, default:)\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'\n .gsub('{databaseId}', database_id)\n .gsub('{collectionId}', collection_id)\n .gsub('{key}', key)\n\n if database_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"databaseId\"')\n end\n\n if collection_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"collectionId\"')\n end\n\n if key.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"key\"')\n end\n\n if elements.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"elements\"')\n end\n\n if required.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"required\"')\n end\n\n if default.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"default\"')\n end\n\n params = {\n elements: elements,\n required: required,\n default: default,\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'PATCH',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::AttributeEnum\n )\n end",
"def replace_enumerations_in_hash(attrs, allow_multiple = true) #:nodoc:\n attrs.each do |attr, value|\n if options = enumerator_options_for(attr, value, allow_multiple)\n attrs.delete(attr)\n attrs.merge!(options)\n end\n end\n end",
"def as_enum\n # Should look like:\n # enum attribute_name: [\"one\", \"two\"]\n\n if is_enum?\n if (enum_options = properties[:enum_options]).present?\n enum_options_as_hash = Frontier::HashSingleLineDecorator.new array_as_hash(enum_options)\n \"enum #{name}: {#{enum_options_as_hash}}\"\n else\n raise(ArgumentError, \"No enum_options provided for attribute: #{name}\")\n end\n else\n raise(ArgumentError, \"Attempting to display field #{name} as enum, but is #{type}\")\n end\n end",
"def validate_marital_status(val)\n unless @valid_marital_statuses.include?(val)\n raise \"Invalid value: #{val}\"\n end\n end",
"def validate_marital_status(val)\n unless @valid_marital_statuses.include?(val)\n raise \"Invalid value: #{val}\"\n end\n end",
"def enumeration?\n @is_enumeration ||= @xml.xpath('./xs:restriction/xs:enumeration', {'xs' => 'http://www.w3.org/2001/XMLSchema'}).length > 0\n end",
"def pa_esigibilita=(pa_esigibilita)\n validator = EnumAttributeValidator.new('String', ['I', 'D', 'S', 'N'])\n unless validator.valid?(pa_esigibilita)\n fail ArgumentError, 'invalid value for \"pa_esigibilita\", must be one of #{validator.allowable_values}.'\n end\n @pa_esigibilita = pa_esigibilita\n end",
"def timeliness_validation_for(attr_names, type)\n super\n attr_names.each { |attr_name| define_timeliness_write_method(attr_name) }\n end",
"def validate_allowed(record)\n unknown = provided(record) - allowed\n\n return if unknown.empty?\n\n record.errors.add(\n options[:attribute],\n \"contains unknown options: #{unknown.join(', ')}\"\n )\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', ['Once', 'Hourly', 'Daily', 'Weekly', 'Monthly', 'Yearly'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end",
"def valid?\n source_validator = EnumAttributeValidator.new('Integer', [\"1\", \"2\"])\n return false unless source_validator.valid?(@source)\n return true\n end",
"def valid?(value)\n return false if self == Enum\n return true if value.equal?(LAZY_VALUE)\n self.values.include?(value.to_s)\n end",
"def smee=(smee)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(smee)\n fail ArgumentError, \"invalid value for \\\"smee\\\", must be one of #{validator.allowable_values}.\"\n end\n @smee = smee\n end",
"def allowed_status\n errors.add(:string, 'must be pending, accepted or declined.') unless %w[pending accepted declined].any?(status)\n end",
"def define_active_enum_write_method_multiple(attribute, column)\n class_eval <<-DEF\n def #{attribute}=(args)\n self.#{column} = args.map do |arg|\n self.class.active_enum_get_id_for_#{attribute}(arg)\n end\n end\n DEF\n end",
"def valid?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"alert\", \"notification\"])\n return false unless type_validator.valid?(@type)\n priority_validator = EnumAttributeValidator.new('String', [\"P1\", \"P2\", \"P3\", \"P4\", \"P5\"])\n return false unless priority_validator.valid?(@priority)\n return true\n end",
"def has_enums?\n !!eh_params[:has_enums]\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', ['active', 'notActive', 'unknown'])\n unless validator.valid?(type)\n fail ArgumentError, %Q'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end",
"def level=(level)\n validator = EnumAttributeValidator.new('String', [\"Unknown\", \"Inline\", \"Block\", \"Row\", \"Cell\"])\n if level.to_i == 0\n unless validator.valid?(level)\n raise ArgumentError, \"invalid value for 'level', must be one of #{validator.allowable_values}.\"\n end\n @level = level\n else\n @level = validator.allowable_values[level.to_i]\n end\n end",
"def mode=(mode)\n validator = EnumAttributeValidator.new('String', [\"default\", \"custom\"])\n unless validator.valid?(mode)\n fail ArgumentError, \"invalid value for 'mode', must be one of #{validator.allowable_values}.\"\n end\n @mode = mode\n end",
"def valid?\n type_validator = EnumAttributeValidator.new('String', ['active', 'notActive', 'unknown'])\n return false unless type_validator.valid?(@type)\n true\n end",
"def allowed_access_levels\n validator = lambda do |field|\n level = public_send(field) || ENABLED # rubocop:disable GitlabSecurity/PublicSend\n not_allowed = level > ENABLED\n self.errors.add(field, \"cannot have public visibility level\") if not_allowed\n end\n\n (FEATURES - %i(pages)).each {|f| validator.call(\"#{f}_access_level\")}\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Paragraph\", \"Character\", \"Table\", \"List\"])\n if type.to_i == 0\n unless validator.valid?(type)\n raise ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n else\n @type = validator.allowable_values[type.to_i]\n end\n end",
"def legal_entity_type=(legal_entity_type)\n validator = EnumAttributeValidator.new('String', [\"sole_proprietorship\", \"partnership\", \"privately_owned_company\", \"publicly_owned_company\", \"government_owned_entity\", \"trust\", \"ngo\", \"club_and_society\", \"go\", \"other\", \"financial_institution\", \"mto\"])\n unless validator.valid?(legal_entity_type) || legal_entity_type.empty?\n fail ArgumentError, \"invalid value for \\\"legal_entity_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @legal_entity_type = legal_entity_type\n end",
"def all_attributes_exists_with_enumerations?(attribute_names)\n exists = all_attributes_exists_without_enumerations?(attribute_names)\n exists ||= attribute_names.all? do |name|\n column_methods_hash.include?(name.to_sym) || reflect_on_enumeration(name)\n end\n end",
"def valid_setters\n methods = ScheduledActivity.instance_methods\n @valid_setters ||= methods.select do |m|\n methods.include?(:\"#{m}=\")\n end\n end",
"def valid?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"ITEM\", \"CATEGORY\", \"ITEM_VARIATION\", \"TAX\", \"DISCOUNT\", \"MODIFIER_LIST\", \"MODIFIER\"])\n return false unless type_validator.valid?(@type)\n return false if @id.nil?\n return false if @id.to_s.length < 1\n return true\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Weekly\", \"BiWeekly\", \"SemiMonthly\", \"Monthly\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end",
"def valid?\n return false if @value.nil?\n change_mode_validator = EnumAttributeValidator.new('String', [\"immediate\", \"delayed\"])\n return false unless change_mode_validator.valid?(@change_mode)\n invoicing_type_validator = EnumAttributeValidator.new('String', [\"Immediate\", \"Aggregated\"])\n return false unless invoicing_type_validator.valid?(@invoicing_type)\n return true\n end",
"def valid?\n type_validator = EnumAttributeValidator.new('String', [\"person\", \"business\"])\n return false unless type_validator.valid?(@type)\n return false if @country.nil?\n return false if @street.nil?\n return false if @postal_code.nil?\n return false if @city.nil?\n return false if @email.nil?\n return false if @ip.nil?\n identification_type_validator = EnumAttributeValidator.new('String', [\"DL\", \"PP\", \"ID\", \"OT\"])\n return false unless identification_type_validator.valid?(@identification_type)\n legal_entity_type_validator = EnumAttributeValidator.new('String', [\"sole_proprietorship\", \"partnership\", \"privately_owned_company\", \"publicly_owned_company\", \"government_owned_entity\", \"trust\", \"ngo\", \"club_and_society\", \"go\", \"other\", \"financial_institution\", \"mto\"])\n return false unless legal_entity_type_validator.valid?(@legal_entity_type)\n nature_of_business_validator = EnumAttributeValidator.new('String', [\"personal\", \"agriculture_and_hunting\", \"forestry\", \"fishing\", \"agricultural_by_products\", \"coal_mining\", \"oil_mining\", \"iron_ore_mining\", \"other_metal_and_diamond_mining\", \"other_mineral_mining\", \"manufacturing_of_food_drink_tobacco\", \"manufacturing_of_textiles_leather_fur_furniture\", \"manufacture_of_wooden_products_furniture\", \"manufacture_of_paper_pulp_allied_products\", \"manufacture_of_chemicals_medical_petroleum_rubber_plastic_products\", \"manufacture_of_pottery_china_glass_stone\", \"manufacture_of_iron_steel_non_ferrous_metals_basic_industries\", \"manufacture_of_metal_products_electrical_and_scientific_engineering\", \"manufacture_of_jewelry_musical_instruments_toys\", \"electricity_gas_and_water\", \"construction\", \"wholesale_trade\", \"retail_trade\", \"catering_incl_hotels\", \"transport_storage\", \"communications\", \"finance_and_holding_companies\", \"insurance\", \"business_services\", \"real_estate_development_investment\", \"central_state_governments\", \"community_services_defence_police_prisons_etc\", \"social_services_education_health_care\", \"personal_services_leisure_services\", \"personal_services_domestic_laundry_repairs\", \"personal_services_embassies_international_organisations\"])\n return false unless nature_of_business_validator.valid?(@nature_of_business)\n return false if @documents.nil?\n gender_validator = EnumAttributeValidator.new('String', [\"M\", \"F\", \"O\"])\n return false unless gender_validator.valid?(@gender)\n true\n end",
"def class_id=(class_id)\n validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n unless validator.valid?(class_id)\n fail ArgumentError, \"invalid value for \\\"class_id\\\", must be one of #{validator.allowable_values}.\"\n end\n @class_id = class_id\n end",
"def allow_value_matcher; end",
"def assert_white_list_setter(clazz, attr, value, whitelist_clazz)\n instance = clazz.new(attr => value)\n assert_kind_of whitelist_clazz, instance.send(attr)\n assert_equal value, instance.send(attr).value\n end",
"def raise_invalid(value)\n if value.is_a?(Numeric)\n raise EnumError, \"#{value.inspect} is out of bounds of #{self.class.name}\"\n else\n raise EnumError, \"#{value.inspect} is not valid for #{self.class.name}\"\n end\n end",
"def valid_parameter_for_conditional_formatting\n [\n :type,\n :format,\n :criteria,\n :value,\n :minimum,\n :maximum,\n :min_type,\n :mid_type,\n :max_type,\n :min_value,\n :mid_value,\n :max_value,\n :min_color,\n :mid_color,\n :max_color,\n :bar_color\n ]\n end",
"def valid_parameter_for_conditional_formatting\n %i[\n type\n format\n criteria\n value\n minimum\n maximum\n stop_if_true\n min_type\n mid_type\n max_type\n min_value\n mid_value\n max_value\n min_color\n mid_color\n max_color\n bar_color\n bar_negative_color\n bar_negative_color_same\n bar_solid\n bar_border_color\n bar_negative_border_color\n bar_negative_border_color_same\n bar_no_border\n bar_direction\n bar_axis_position\n bar_axis_color\n bar_only\n icon_style\n reverse_icons\n icons_only\n icons\n data_bar_2010\n ]\n end",
"def validate_enum_name(name)\n name.gsub(/[-\\s]/, \"_\").sub(/^\\d/, '_\\0')\n end",
"def oil_types=(vals = [])\n if vals.is_a?(Array)\n OilTypes.collect {|t| t[1]}.each do |type|\n if vals.member?(type)\n send(type+\"=\",true)\n else\n send(type+\"=\",false)\n end\n end\n end\n end",
"def sr_iov=(sr_iov)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(sr_iov)\n fail ArgumentError, \"invalid value for \\\"sr_iov\\\", must be one of #{validator.allowable_values}.\"\n end\n @sr_iov = sr_iov\n end",
"def appearance=(appearance)\n validator = EnumAttributeValidator.new('String', [\"Default\", \"BoundingBox\", \"Tags\", \"Hidden\"])\n if appearance.to_i == 0\n unless validator.valid?(appearance)\n raise ArgumentError, \"invalid value for 'appearance', must be one of #{validator.allowable_values}.\"\n end\n @appearance = appearance\n else\n @appearance = validator.allowable_values[appearance.to_i]\n end\n end",
"def validate_entities!(enum)\n unless enum.respond_to?(:each)\n raise Errors::InternalError, 'Validation cannot be performed on non-enumerable objects'\n end\n enum.each(&:valid!)\n enum\n rescue ::Occi::Core::Errors::MandatoryArgumentError, ::Occi::Core::Errors::ValidationError => ex\n logger.error \"Validation failed: #{ex.class} #{ex.message}\"\n raise Errors::ValidationError, ex.message\n end",
"def valid?\n frequency_validator = EnumAttributeValidator.new('String', [\"daily\", \"weekly\", \"monthly\", \"quarterly\", \"yearly\"])\n return false unless frequency_validator.valid?(@frequency)\n return true\n end",
"def attr_bool_writer *symbols\n attr_writer *symbols\n end",
"def should_allow_values(options)\n klass = self.name.gsub(/Test$/, '').constantize\n\n context \"#{klass}\" do\n options.each_pair do |attribute, values|\n [*values].each do |value|\n display_value = value.class == NilClass ? \"nil\" : \"\\\"#{value}\\\"\"\n \n should \"allow #{attribute} to be #{display_value}\" do\n instance = get_instance_of(klass)\n instance.send(\"#{attribute}=\", value)\n assert_nil instance.errors.on(attribute), \n \"Expected no errors when #{attribute} is set to #{display_value}, \n instead found error \\\"#{instance.errors.on(attribute)}\\\".\"\n end\n end\n end\n end\n end",
"def valid_attributes\n {\n name: \"Unlimited\",\n award_title_name: \"10k Unlimited\",\n scoring_class: \"Freestyle\"\n }\n end",
"def gr_append_check? obj\n return false if obj.class!=self.class\n return false if !respond_to(\"each\")\n myEnum=to_enum\n objEnum=obj.to_enum\n while true\n begin\n myEle=myEnum.next\n rescue\n return true\n end\n begin\n objEle=objEnum.next\n rescue\n return false\n end\n return false if myEle!=objEle\n end\n return true\n end",
"def valid?\n only_display_validator = EnumAttributeValidator.new('String', [\"DoNotDisplay\", \"Closed30Days\", \"Closed60Days\", \"Closed90Days\", \"Closed120Days\", \"AllClosed\"])\n return false unless only_display_validator.valid?(@only_display)\n return true\n end",
"def validate( value )\n raise ReadOnlyException.new(self) unless settable?\n @definition.type.validate(value)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_number_value(\"offsetInDays\", @offset_in_days)\n writer.write_enum_value(\"timeBasedAttribute\", @time_based_attribute)\n end",
"def patrol_scrub=(patrol_scrub)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"disabled\", \"Enable at End of POST\", \"enabled\"])\n unless validator.valid?(patrol_scrub)\n fail ArgumentError, \"invalid value for \\\"patrol_scrub\\\", must be one of #{validator.allowable_values}.\"\n end\n @patrol_scrub = patrol_scrub\n end",
"def valid?\n return false if !super\n quartile_method_validator = EnumAttributeValidator.new('String', ['Exclusive', 'Inclusive'])\n return false unless quartile_method_validator.valid?(@quartile_method)\n true\n end",
"def _class=(_class)\n validator = EnumAttributeValidator.new('String', [\"Other\", \"Absolute\", \"Possessory\", \"Qualified\", \"Good\"])\n unless validator.valid?(_class)\n fail ArgumentError, \"invalid value for '_class', must be one of #{validator.allowable_values}.\"\n end\n @_class = _class\n end"
] | [
"0.70875543",
"0.6483564",
"0.64317095",
"0.62286377",
"0.614331",
"0.5812138",
"0.5751908",
"0.57455283",
"0.5738135",
"0.57083595",
"0.57014704",
"0.5678817",
"0.56032133",
"0.55945593",
"0.55489385",
"0.553774",
"0.55357426",
"0.5529098",
"0.54367936",
"0.54300535",
"0.5420408",
"0.53795314",
"0.53784907",
"0.53784907",
"0.5367033",
"0.53525007",
"0.5337012",
"0.5328896",
"0.5324079",
"0.53208035",
"0.5309451",
"0.5301472",
"0.5285689",
"0.52807915",
"0.5269443",
"0.52680445",
"0.5253064",
"0.5209882",
"0.51896185",
"0.5186177",
"0.5170568",
"0.51485497",
"0.5144733",
"0.5138324",
"0.51360923",
"0.5134491",
"0.5133354",
"0.5121478",
"0.51169205",
"0.5109288",
"0.51086056",
"0.51077956",
"0.5095501",
"0.5095501",
"0.50859743",
"0.5083176",
"0.50744486",
"0.50654507",
"0.5065322",
"0.50621974",
"0.5058278",
"0.5051417",
"0.5045062",
"0.5041021",
"0.50379544",
"0.5033133",
"0.5023709",
"0.5019678",
"0.49936485",
"0.4990971",
"0.4984205",
"0.49753803",
"0.49737474",
"0.49708977",
"0.49637735",
"0.49611858",
"0.4960119",
"0.49598032",
"0.49557036",
"0.4954298",
"0.49502325",
"0.49472624",
"0.49459928",
"0.49425325",
"0.49410853",
"0.4938176",
"0.4935045",
"0.49347225",
"0.4927444",
"0.49219123",
"0.49186775",
"0.4917121",
"0.4913468",
"0.49129334",
"0.49121353",
"0.49115235",
"0.49096286",
"0.49081546",
"0.49079478",
"0.49028075",
"0.49024263"
] | 0.0 | -1 |
Custom attribute writer method with validation | def amount=(amount)
if !amount.nil? && amount < 0
fail ArgumentError, "invalid value for 'amount', must be greater than or equal to 0."
end
@amount = amount
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def attr_writer_tag(text); end",
"def allowed_attributes=(_arg0); end",
"def allowed_attributes=(_arg0); end",
"def writer(*args)\n attr_writer(*args)\n args\n end",
"def define_write_method(attr_name)\n evaluate_attribute_method attr_name, \"def #{attr_name}=(new_value);write_attribute('#{attr_name}', new_value);end\", \"#{attr_name}=\"\n end",
"def attr_writer(*vars)\n # avoid tracking attributes that are added by the class_attribute\n # as these are class attributes and not instance attributes.\n tracked_vars = vars.reject {|var| respond_to? var }\n add_tracked_attrs(false, true, *tracked_vars)\n vars.extract_options!\n super\n end",
"def attr_writer(sym, *more) end",
"def is_attribute?; end",
"def validate_exclusion_of(attr); end",
"def register_attributes\n raise \"Not implemented in #{self.class}\"\n end",
"def method_missing(method_name, *args)\n return super unless permitted_attributes.include?(method_name)\n begin\n object.send(:\"#{method_name}=\", args.first)\n rescue => e\n if params.has_key?(method_name)\n message = \"Unable to process value for :#{method_name}, no attribute writer. Be sure to override the automatic setters for all params that do not map straight to a model attribute.\"\n Rails.logger.warn({message: message,\n missing_writer: method_name,\n value: args.first,\n error: e})\n self.errors << {status: 422, message: message}\n else\n raise e\n end\n end\n end",
"def timeliness_validation_for(attr_names, type)\n super\n attr_names.each { |attr_name| define_timeliness_write_method(attr_name) }\n end",
"def create_setter_for(attribute, options)\n setter_method = \"#{attribute}=\"\n\n define_method setter_method do |value|\n if options[:allow_blank] || value != \"\"\n write_attribute(attribute, value)\n end\n end\n end",
"def attr_internal_writer(*attrs)\n attrs.each {|attr_name| attr_internal_define(attr_name, :writer)}\n end",
"def escape_attr input\n escape input, attr_regexp, attr_mapping\n end",
"def make_writer( attrtype )\n\t\tself.log.debug \"Generating an attribute writer for %p\" % [ attrtype ]\n\t\tattrname = attrtype.name\n\t\tif attrtype.single?\n\t\t\tself.log.debug \" attribute is SINGLE, so generating a scalar writer...\"\n\t\t\treturn lambda {|newvalue| self[attrname] = newvalue }\n\t\telse\n\t\t\tself.log.debug \" attribute isn't SINGLE, so generating an array writer...\"\n\t\t\treturn lambda {|*newvalues| self[attrname] = newvalues.flatten }\n\t\tend\n\tend",
"def write_attribute(name, value)\n # Simply check if the accessor is allowed to write the field\n # (if so, go to superclass and do it)\n @bypass_auth ||= false\n if allowed_to_write(name) || @bypass_auth\n super(name, value)\n end\n end",
"def mattr_writer(*syms, &proc)\n receiver = self\n options = syms.extract_options!\n syms.each do |sym|\n raise NameError.new('invalid attribute name') unless sym =~ /^[_A-Za-z]\\w*$/\n class_exec do\n define_singleton_method \"#{sym}=\" do |obj|\n class_variable_set(\"@@#{sym}\", obj)\n end\n end\n\n unless options[:instance_writer] == false || options[:instance_accessor] == false\n class_exec do\n define_method \"#{sym}=\" do |obj|\n receiver.class_variable_set(\"@@#{sym}\", obj)\n end\n end\n end\n send(\"#{sym}=\", proc.call) if proc\n end\n end",
"def write_attribute(attribute, value)\n false\n end",
"def add_attribute attribute\n return attribute unless @document_self\n\n # mainly to check for redefinition of an attribute as a method\n # TODO find a policy for 'attr_reader :foo' + 'def foo=()'\n register = false\n\n key = nil\n\n if attribute.rw.index 'R' then\n key = attribute.pretty_name\n known = @methods_hash[key]\n\n if known then\n known.comment = attribute.comment if known.comment.empty?\n elsif registered = @methods_hash[attribute.pretty_name + '='] and\n RDoc::Attr === registered then\n registered.rw = 'RW'\n else\n @methods_hash[key] = attribute\n register = true\n end\n end\n\n if attribute.rw.index 'W' then\n key = attribute.pretty_name + '='\n known = @methods_hash[key]\n\n if known then\n known.comment = attribute.comment if known.comment.empty?\n elsif registered = @methods_hash[attribute.pretty_name] and\n RDoc::Attr === registered then\n registered.rw = 'RW'\n else\n @methods_hash[key] = attribute\n register = true\n end\n end\n\n if register then\n attribute.visibility = @visibility\n add_to @attributes, attribute\n resolve_aliases attribute\n end\n\n attribute\n end",
"def define_writer_method(mod)\n writer_method_name = \"#{name}=\"\n attribute = self\n\n mod.send(:define_method, writer_method_name) { |value| attribute.set(self, value) }\n mod.send(writer_visibility, writer_method_name)\n\n self\n end",
"def allowed_to_write(name)\n # no point allowing attribute writes if we can't save them?\n if allowed_to_save\n name = name.to_s\n validation_methods = self.class.write_validations(name) \n if validation_methods.nil?\n # We haven't registered any filters on this attribute, so allow the write.\n true\n elsif validation_methods.check :accessor => accessor, :model => self\n # One of the authentication methods worked, so allow the write.\n true\n else\n # We had filters but none of them passed. Disallow write.\n false\n end\n else\n false\n end\n end",
"def assert_attr_writer(obj, method)\n assert_respond_to obj, \"#{method}=\"\nend",
"def add_attribute(name, &block); end",
"def authenticates_writes_to(attr, options={})\n authenticates_access\n @write_validation_map ||= {}\n @write_validation_map[attr.to_s] ||= AuthMethodList.new\n @write_validation_map[attr.to_s].add_method(options)\n end",
"def write_attribute_3(param1, param2)\n\twrite_attribute(param1, param2)\n end",
"def write_attribute(attr_name, value) #:doc:\n @attributes[attr_name] = empty_string_for_number_column?(attr_name, value) ? nil : value\n end",
"def add_writer_tags(klass, new_method, member)\n member_tag = member_tag_for_member(klass, member, :write)\n return_type = return_type_from_tag(member_tag)\n setter_doc_text = member_tag ? member_tag.text : \"Sets the attribute #{member}\"\n new_method.docstring.replace(setter_doc_text)\n new_method.add_tag YARD::Tags::Tag.new(:param, \"the value to set the attribute #{member} to.\", return_type, \"value\")\n new_method.add_tag YARD::Tags::Tag.new(:return, \"the newly set value\", return_type)\n end",
"def print_attribute(*) end",
"def attribute(name); end",
"def add_checked_attribute(clazz, attribute)\r\n eval <<END\r\n class #{clazz}\r\n\r\n def #{attribute}=(value)\r\n raise 'Invalid attribute' unless value\r\n @#{attribute}=value\r\n end\r\n\r\n def #{attribute}\r\n #{attribute}\r\n end\r\n end\r\nEND\r\nend",
"def attr(name); end",
"def is_attribute?(line)\n (line =~ /(\\s+)attr_(writer|reader|accessor)\\s+:[a-zA-Z_0-9]+/) == 0\n end",
"def attribute(name, value)\n\t if !@inStartTag\n\t\traise WriterError.new('attribute outside of tag start')\n\t end\n\t @io << \" #{name}=\\\"#{NQXML.encode(value.to_s)}\\\"\"\n\tend",
"def set_attribute(name, value); end",
"def dataset_writer(*attributes)\n attributes.flatten.each do |attr_name|\n next if method_defined?(\"#{attr_name}=\")\n\n class_eval <<-RUBY, __FILE__, __LINE__ + 1\n def #{attr_name}=(value)\n dataset_set(:#{attr_name}, value)\n end\n RUBY\n end\n end",
"def validated_attribute_names(params); end",
"def require_format_of(attribute)\r\n RequireFormatOf.new(attribute)\r\n end",
"def attr_writer(*fields)\n check_fields(fields)\n added_fields = jiak.data.writable(*fields)\n added_fields.each do |field|\n class_eval <<-EOM\n def #{field}=(val)\n @jiak.object.data.#{field} = val\n self.class.do_auto_update(self)\n end\n EOM\n end\n nil\n end",
"def html_attr(*attrs)\n options = attrs.extract_options!.reverse_merge({\n :level => :super_relaxed\n })\n attrs.each do |att|\n class_eval \"def #{att}=(val); self[:#{att}] = sanitize(val, :#{options[:level]}); end\"\n end\n end",
"def validate_attributes=(new_attribute)\n @validate_attributes = new_attribute\n end",
"def html_attributes(attr); end",
"def instance_write(attr, value)\n setter = :\"#{@name_string}_#{attr}=\"\n instance.send(setter, value) if instance.respond_to?(setter)\n end",
"def valid_xml_attribute(name, options={:level => :warning})\n\t\t\t\tvalidate(\"Invalid XML attribute '#{name}'\", options) { name.to_s.match(/^([^[:punct:]0-9<>]|_)[^<>\"']*/) }\n\t\t\tend",
"def attr_writer(*args)\n sym_args=args_to_sym(args)\n sym_args.each do |value|\n self.instance_eval(\"def #{value}=(arg); @#{value}=arg;end;\")\n end\n \n end",
"def define_writer_method(attribute, method_name, visibility)\n define_method(method_name) { |value| attribute.set(self, value) }\n send(visibility, method_name)\n self\n end",
"def write_attribute(name, val)\n if @embedded_models.include? name\n @embedded_models[name].model = val\n elsif @attribute_objects.include? name\n @attribute_objects[name].value = val\n else\n return false\n end\n\n run_callbacks :attribute_change\n end",
"def valid_attributes\n { \"name\" => \"MyString\" }\n end",
"def valid_attributes\n { \"name\" => \"MyString\" }\n end",
"def valid_attributes\n { body: \"blah\",\n rule_text: 'Something',\n change_description: \"blaa\"}\n end",
"def valid_attributes\n { body: \"blah\",\n rule_text: 'Something',\n change_description: \"blaa\"}\n end",
"def attr; end",
"def attribute(*args)\n define_expressions(Attribute, args)\n end",
"def write_attribute(name, value)\n name = name.to_s\n\n # The attribute already has an unsaved change.\n if attribute_changed?(name)\n old = changed_attributes[name]\n changed_attributes.delete(name) unless field_changed?(name, old, value)\n else\n attribute_will_change(name) if field_changed?(name, old, value)\n end\n\n # Carry on.\n super(name, value)\n end",
"def define_magic_attr(name)\n define_method name do |*attrs|\n raise ArgumentError.new(\"wrong number of arguments\") if attrs.size > 1\n send(\"#{name}=\", attrs.first) if attrs.size == 1\n instance_variable_get(\"@#{name}\")\n end\n\n attr_writer name\n end",
"def configurable_writer(attribute, code=nil, &block)\n if block_given? and not code\n Halcyon.class.send(:define_method, :\"#{attribute}=\", block)\n elsif code and not block_given?\n Halcyon.class.send(:eval, <<-\"end;\")\n def #{attribute.to_s}=(value)\n #{code % [attribute.to_sym.inspect]}\n end\n end;\n else\n raise ArgumentError.new(\"Either a block or a code string should be supplied.\")\n end\n end",
"def method_missing(name, *args, &block)\n if /\\Ahas_validated_(?<type>\\w*)_attribute\\Z/ =~ name\n has_validated_attribute(type, *args, &block)\n else\n super\n end\n end",
"def add_checked_attribute(klass, attribute)\n klass.class_eval do\n define_method attribute do\n instance_variable_get(\"@#{attribute}\")\n end\n\n define_method \"#{attribute}=\" do |value|\n raise 'Invalid attribute' unless value\n \n instance_variable_set(\"@#{attribute}\", value)\n end\n end\nend",
"def method_missing(meth, *args, &blk)\n match = meth.to_s.match(/^([a-zA-Z\\_]+)(=|$)$/)\n if match\n attribute, setter = match[1], !match[2].blank?\n if setter\n write_attribute(attribute, args.first)\n else\n read_attribute(attribute)\n end\n else\n super(meth, *args, &blk)\n end\n end",
"def valid_attributes\n { name: 'do this' }\n end",
"def make_attributes_definitions_or_croak(attrArgs, &attrBlok)\n eye = :'m_attrs_defs'\n\n # Work with attribute as strings\n \n $DEBUG && logger_me(eye, logger_fmt_kls(:attrArgs => attrArgs, :attrBlok => attrBlok))\n\n mustbe_attributes_specification_or_croak(attrArgs, eye, \"attrArgs not attributes_specification\")\n \n #STOPATTRARGSINSUPER\n \n #attrAll = mustbe_not_empty_or_croak(mustbe_array_key_or_nil_or_croak(attrArgs, :all, eye, \"all attributes not array\"), eye, \"all attributes is empty\").map(&:to_s)\n attrAll = mustbe_not_empty_or_croak(mustbe_attributes_specification_all_key_or_croak(attrArgs, :all, eye), eye, \"all attributes is empty\").map(&:to_s)\n \n\n #puts(\"\\n\\n\\nATTR ALL >#{attrAll}<\")\n\n #STOPMAKEATTRSPECSENTRY\n\n attrInc = mustbe_attributes_specification_include_key_or_nil_or_croak(attrArgs, :include, eye) # mustbe all strings\n #puts(\"ATTR INC >#{attrInc.class}< >#{attrInc}< >#{is_value_not_empty?(attrInc)}<\")\n attrInc && mustbe_not_empty_or_croak(attrInc, eye, \"include attributes is empty\")\n\n attrExc = mustbe_attributes_specification_exclude_key_or_nil_or_croak(attrArgs, :exclude, eye) || []\n \n attrMapNom = mustbe_attributes_definitions_key_or_nil_or_croak(attrArgs, :definitions, eye) || {}\n attrMap = attrMapNom && potrubi_util_map_hash_kv(attrMapNom) {|k,v| [k.to_s, v]} # keys all strings\n\n # Ensure all consistent\n \n attrInc && mustbe_subset_or_croak(attrInc, attrAll, eye, \"include attributes contains unknown attributes\")\n mustbe_subset_or_croak(attrExc, attrAll, eye, \"exclude attributes contains unknown attributes\")\n mustbe_subset_or_croak(attrMap.keys, attrAll, eye, \"attribute map contains unknown attributes\")\n \n attrUse = ((attrInc || attrAll) - attrExc).uniq # list of unique attributes to report on\n\n # consolidate \"faked up\" attr specs with ones provided to get the composite attrSpecs\n \n attrDefsNom = potrubi_util_array_to_hash(attrUse).merge(attrMap.select {|k,v| attrUse.include?(k)}) # consolidated \"faked up\" attr specs with ones provided\n\n attrDefs = potrubi_util_map_hash_v(attrDefsNom) do | attrName, attrSpecNom|\n\n attrSpec =\n case attrSpecNom\n when NilClass then {}\n when Hash then\n attrSpecNom.each_with_object({}) do | (verbName, verbSpec), h1 |\n case verbName\n when :pass_thru then h1[:pass_thru] = verbSpec # dont touch; just pass through\n when :event_defaults then # add these to pass_thru\n h1[:pass_thru] = (h1[:pass_thru] || {}).merge(verbName => verbSpec)\n when :map, :select, :metric then\n h1[verbName] = {\n :method_name => \"#{verbName}_#{attrName}_#{rand(1000000)}\", # make a unqiue name\n :method_spec => verbSpec # spec must be valid to dynamic_define_methods\n }\n else\n logic_exception(verbName, eye, \"attrName >#{attrName}< verbName >#{verbName}< value should be impossible\")\n end\n end\n \n else\n logic_exception(attrrSpecNom, eye, \"attrSpecNom value should be impossible\")\n end\n\n attrSpec\n \n end\n \n $DEBUG && logger_mx(eye, logger_fmt_kls(:attrDefs => attrDefs))\n\n mustbe_attributes_definitions_or_croak(attrDefs, eye, \"attrDefs failed contract\")\n\n #STOPMAKEATTRSPECS\n \n end",
"def create_writer(klass, member)\n # We want to convert these members into attributes just like\n # as if they were declared using attr_accessor.\n new_meth = register MethodObject.new(klass, \"#{member}=\", :instance) do |o|\n o.parameters = [['value', nil]]\n o.signature ||= \"def #{member}=(value)\"\n o.source ||= \"#{o.signature}\\n @#{member} = value\\nend\"\n end\n add_writer_tags(klass, new_meth, member)\n klass.attributes[:instance][member][:write] = new_meth\n end",
"def create_setter!\n @target.class_eval <<-EOS\n #{writer_visibility.to_s}\n def #{name}=(value)\n attribute_set(#{name.inspect}, value)\n end\n EOS\n rescue SyntaxError\n raise SyntaxError.new(column)\n end",
"def attribute name, type, conditions= DEFAULT_ATTRIBUTE_CONDITIONS\n RMOF.complete_conditions conditions, DEFAULT_ATTRIBUTE_CONDITIONS\n @attributes= {} unless instance_variable_defined? :@attributes\n @attributes[name]= [name, type, conditions]\n unless method_defined? :__attributes then \n define_method( :__attributes) do \n @attributes\n end \n end\n at= \"@#{name}\".to_sym\n getter= \"#{name}\".to_sym\n setter= \"#{name}=\".to_sym\n completion= \"__complete_#{name}\".to_sym\n define_method( getter) do\n if instance_variable_defined? at then instance_variable_get at\n else conditions[:default]\n end\n end\n define_method( setter) do |val|\n instance_variable_set at, val\n end\n define_method( completion) do\n RMOF.validate( self.send(getter), name, type, conditions)\n end\n end",
"def attr_internal_writer(*attrs)\n attrs.each do |attr|\n module_eval \"def #{attr}=(v) #{attr_internal_ivar_name(attr)} = v end\"\n end\n end",
"def attr_internal_writer(*attrs)\n attrs.each do |attr|\n module_eval \"def #{attr}=(v) #{attr_internal_ivar_name(attr)} = v end\"\n end\n end",
"def create_setter(name, meth)\n define_method(\"#{meth}=\") do |value|\n write_attribute(name, value)\n end\n end",
"def sanitized_allowed_attributes=(attributes); end",
"def sanitized_allowed_attributes=(attributes); end",
"def oattr(name, type)\n case type\n when :custom\n # Do nothing, just register attr below.\n when :writer\n attr_writer name\n else\n raise ArgumentError, \"Unknown type: #{type.inspect}\"\n end\n\n # Register and return.\n name.tap { oattrs << name}\n end",
"def valid_attributes\n { name: \"Expert\" }\n end",
"def attributes(*method_names, **options)\n add_attributes(method_names, **options, strategy: :write_value_using_method_strategy)\n end",
"def []=(attr_name, value)\n writer_method = \"#{attr_name}=\"\n send(writer_method, value) if respond_to?(writer_method)\n end",
"def write_extended_attributes(attrs)\n attrs.each do |k, val|\n self.send((k.to_s + \"=\").to_sym, val) if is_flex_attribute?(k)\n end\n self\n end",
"def valid_attributes\n { \"username\" => \"MyString\" }\n end",
"def cattr_writer(*fields)\n metaclass.send :attr_writer, *fields\n end",
"def write_attribute(attr, value)\n if attribute_encrypted?(attr)\n conductor_for(attr).encrypt(value)\n else\n super(attr, value)\n end\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_number_value(\"offsetInDays\", @offset_in_days)\n writer.write_enum_value(\"timeBasedAttribute\", @time_based_attribute)\n end",
"def define_attribute_method(attr_name, _owner: generated_attribute_methods)\n CodeGenerator.batch(_owner, __FILE__, __LINE__) do |owner|\n attribute_method_matchers.each do |matcher|\n method_name = matcher.method_name(attr_name)\n\n unless instance_method_already_implemented?(method_name)\n generate_method = \"define_method_#{matcher.target}\"\n\n if respond_to?(generate_method, true)\n send(generate_method, attr_name.to_s, owner: owner)\n else\n define_proxy_call true, owner, method_name, matcher.target, attr_name.to_s\n end\n end\n end\n attribute_method_matchers_cache.clear\n end\n end",
"def has_attributes?; end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"isExpirationRequired\", @is_expiration_required)\n writer.write_duration_value(\"maximumDuration\", @maximum_duration)\n end",
"def add_attributes(item)\n [:class, :instance].each do |attr_loc|\n # Grab attributes for the current location (class or instance)\n attrs = item.attributes[attr_loc]\n attrs.each do |name, attribute|\n reader = attribute[:read]\n writer = attribute[:write]\n\n unless reader || writer\n Logging.warn(\"attribute is not readable or writable somehow, skipping\", attribute)\n next\n end\n\n # Get all given types\n yard_types = []\n if reader\n next if @hide_private && reader.visibility == :private\n yard_types += reader.tags('return').flat_map(&:types).compact.reject { |x| x.downcase == 'void' } +\n reader.tags('param').flat_map(&:types)\n end\n if writer\n next if @hide_private && writer.visibility == :private\n yard_types += writer.tags('return').flat_map(&:types).compact.reject { |x| x.downcase == 'void' } +\n writer.tags('param').flat_map(&:types)\n end\n\n # Use untyped if not types specified anywhere, otherwise try to\n # compute Parlour type given all these types\n if yard_types.empty?\n Logging.omit(\"no YARD type given for #{name.inspect}, using untyped\", reader || writer)\n parlour_type = Parlour::Types::Untyped.new\n elsif yard_types.all? { |x| x == 'nil' }\n # Nil attributes are extremely unusual, so just use untyped\n parlour_type = Parlour::Types::Untyped.new\n else\n parlour_type = TypeConverter.yard_to_parlour(\n yard_types, reader || writer, @type_converter_config)\n end\n\n # Generate attribute\n if reader && writer\n kind = :accessor\n elsif reader\n kind = :reader\n elsif writer\n kind = :writer\n end\n\n if @exclude_untyped && parlour_type.is_a?(Parlour::Types::Untyped)\n Logging.omit(\"excluding untyped attribute\", reader || writer, immediate: true)\n next\n end\n\n case @mode\n when :rbi\n @current_object.create_attribute(\n name.to_s,\n kind: kind,\n type: parlour_type,\n class_attribute: (attr_loc == :class)\n ) do |m|\n add_comments(reader || writer, m)\n end\n when :rbs\n if attr_loc == :class\n # RBS doesn't support class attr_accessors so create individual methods\n\n if reader\n @current_object.create_method(\n name.to_s,\n [Parlour::RbsGenerator::MethodSignature.new([], parlour_type)],\n class_method: true\n ) do |m|\n add_comments(reader, m)\n end\n end\n\n if writer\n @current_object.create_method(\n \"#{name}=\",\n [Parlour::RbsGenerator::MethodSignature.new([Parlour::RbsGenerator::Parameter.new(\n \"value\",\n type: parlour_type,\n required: true\n )], parlour_type)],\n class_method: true\n ) do |m|\n add_comments(writer, m)\n end\n end\n else\n @current_object.create_attribute(\n name.to_s,\n kind: kind,\n type: parlour_type,\n ) do |m|\n add_comments(reader || writer, m)\n end\n end\n end\n end\n end\n end",
"def []=(attr_name, value)\r\n if attr_name.is_a?(String) and attr_name != attr_name.split(ID_SEP).first\r\n attr_name = attr_name.split(ID_SEP)\r\n end\r\n\r\n if attr_name.is_a? Array\r\n value = value.split(ID_SEP) if value.is_a? String\r\n unless value.length == attr_name.length\r\n raise \"Number of attr_names and values do not match\"\r\n end\r\n #breakpoint\r\n [attr_name, value].transpose.map {|name,val| write_attribute(name.to_s, val)}\r\n else\r\n write_attribute(attr_name, value)\r\n end\r\n end",
"def attr(symbol, writable=false) end",
"def define_writer!(k, definition)\n define_method(\"#{k}=\") do |value|\n # Recursively convert hash and array of hash to schematized objects\n value = ensure_schema value, definition[:schema]\n\n # Initial value\n instance_variable_set \"@#{k}\", value\n\n # Dirty tracking\n self.changed_attributes ||= Set.new\n self.changed_attributes << k\n end\n end",
"def validate\n validate_string_attributes\n end",
"def write_attribute_with_dynamo(field_name, value)\n if is_dynamo_field?(field_name)\n # Store these guys for now. We don't actually save the field value until the model is saved ( i.e my_supplier.save ).\n # If we were to save the field_value now we wouldn't be able to know the id of the model to link this value to it.\n # @see delay_save\n @all_fields_and_values ||= []\n @all_fields_and_values << {:dynamo_field=>cached_dynamo_field_by_name(field_name), :value=>value}\n end\n # If its a 'normal' attribute let rails write it in the usual way.\n write_attribute_without_dynamo(field_name, value)\n end",
"def define_attr_accessor(attr)\n attr_accessor(attr)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n writer.write_collection_of_object_values(\"attributeMappings\", @attribute_mappings)\n writer.write_boolean_value(\"enabled\", @enabled)\n writer.write_enum_value(\"flowTypes\", @flow_types)\n writer.write_collection_of_object_values(\"metadata\", @metadata)\n writer.write_string_value(\"name\", @name)\n writer.write_string_value(\"@odata.type\", @odata_type)\n writer.write_object_value(\"scope\", @scope)\n writer.write_string_value(\"sourceObjectName\", @source_object_name)\n writer.write_string_value(\"targetObjectName\", @target_object_name)\n writer.write_additional_data(@additional_data)\n end",
"def validate_attribute_syntax\n\t\[email protected] do |attribute, values|\n\t\t\t[ values ].flatten.each do |value|\n\t\t\t\tbegin\n\t\t\t\t\tself.get_converted_attribute( attribute.to_sym, value )\n\t\t\t\trescue => err\n\t\t\t\t\tself.log.error \"validation for %p failed: %s: %s\" %\n\t\t\t\t\t\t[ attribute, err.class.name, err.message ]\n\t\t\t\t\tattrtype = self.find_attribute_type( attribute )\n\t\t\t\t\tself.errors.add( attribute, \"isn't a valid %s value\" %\n\t\t\t\t\t\t[ attrtype.syntax ? attrtype.syntax.desc : attrtype.syntax_oid ] )\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"def valid_attributes\n { }\n end",
"def validatable_attributes(atts, opts)\n am, an, ab, m = opts.values_at(:allow_missing, :allow_nil, :allow_blank, :message)\n Array(atts).each do |a|\n next if am && !values.has_key?(a)\n v = send(a)\n next if an && v.nil?\n next if ab && v.respond_to?(:blank?) && v.blank?\n if message = yield(a, v, m)\n errors.add(a, message)\n end\n end\n end",
"def valid_attributes\n { }\n end",
"def valid_attributes\n { }\n end",
"def attribute_name=(_arg0); end",
"def attribute_name=(_arg0); end",
"def attribute_name=(_arg0); end",
"def require_attr(name)\n send(name).tap do |_|\n raise \"Attribute must be set: #{name}\" if _.nil?\n end\n end",
"def write_attributes(attributes)\n _attributes = attributes.select do |name, value|\n if self.is_dynamic_field?(name)\n self.dynamic_setter(name, value)\n false\n else\n true\n end\n end\n\n super(_attributes)\n end",
"def attribute; end",
"def attribute; end"
] | [
"0.6472992",
"0.6315012",
"0.6315012",
"0.62821025",
"0.6279224",
"0.6211609",
"0.61891466",
"0.6182247",
"0.60683644",
"0.6032628",
"0.5995443",
"0.5988785",
"0.5959885",
"0.5938289",
"0.5931089",
"0.58951056",
"0.5859927",
"0.5851703",
"0.58493423",
"0.58465594",
"0.58328366",
"0.5823013",
"0.5822229",
"0.57850474",
"0.5701491",
"0.5696689",
"0.5682951",
"0.5678094",
"0.566814",
"0.5657499",
"0.56555206",
"0.5642589",
"0.56219065",
"0.5615893",
"0.56105876",
"0.559851",
"0.5598089",
"0.55940455",
"0.5585137",
"0.55848545",
"0.55796933",
"0.5571477",
"0.5567006",
"0.55667996",
"0.55652434",
"0.5562926",
"0.55600035",
"0.55590326",
"0.55590326",
"0.5554599",
"0.5554599",
"0.55407417",
"0.5534935",
"0.5527733",
"0.55271375",
"0.55238813",
"0.5501504",
"0.5497003",
"0.5496233",
"0.54927665",
"0.5464706",
"0.54617554",
"0.5461167",
"0.5451583",
"0.54498726",
"0.54498726",
"0.54359984",
"0.5430996",
"0.5430996",
"0.5426488",
"0.5418467",
"0.54153895",
"0.54107565",
"0.5407886",
"0.5401234",
"0.54008496",
"0.5400268",
"0.53910094",
"0.53827274",
"0.5377731",
"0.5375473",
"0.5374833",
"0.53720397",
"0.5370215",
"0.5363264",
"0.5361161",
"0.5360557",
"0.5351706",
"0.53514725",
"0.53492516",
"0.53459316",
"0.5341237",
"0.5328037",
"0.5328037",
"0.53230566",
"0.53230566",
"0.53230566",
"0.5319575",
"0.531832",
"0.5315559",
"0.5315559"
] | 0.0 | -1 |
Custom attribute writer method with validation | def quantity=(quantity)
if !quantity.nil? && quantity < 1
fail ArgumentError, "invalid value for 'quantity', must be greater than or equal to 1."
end
@quantity = quantity
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def attr_writer_tag(text); end",
"def allowed_attributes=(_arg0); end",
"def allowed_attributes=(_arg0); end",
"def writer(*args)\n attr_writer(*args)\n args\n end",
"def define_write_method(attr_name)\n evaluate_attribute_method attr_name, \"def #{attr_name}=(new_value);write_attribute('#{attr_name}', new_value);end\", \"#{attr_name}=\"\n end",
"def attr_writer(*vars)\n # avoid tracking attributes that are added by the class_attribute\n # as these are class attributes and not instance attributes.\n tracked_vars = vars.reject {|var| respond_to? var }\n add_tracked_attrs(false, true, *tracked_vars)\n vars.extract_options!\n super\n end",
"def attr_writer(sym, *more) end",
"def is_attribute?; end",
"def validate_exclusion_of(attr); end",
"def register_attributes\n raise \"Not implemented in #{self.class}\"\n end",
"def method_missing(method_name, *args)\n return super unless permitted_attributes.include?(method_name)\n begin\n object.send(:\"#{method_name}=\", args.first)\n rescue => e\n if params.has_key?(method_name)\n message = \"Unable to process value for :#{method_name}, no attribute writer. Be sure to override the automatic setters for all params that do not map straight to a model attribute.\"\n Rails.logger.warn({message: message,\n missing_writer: method_name,\n value: args.first,\n error: e})\n self.errors << {status: 422, message: message}\n else\n raise e\n end\n end\n end",
"def timeliness_validation_for(attr_names, type)\n super\n attr_names.each { |attr_name| define_timeliness_write_method(attr_name) }\n end",
"def create_setter_for(attribute, options)\n setter_method = \"#{attribute}=\"\n\n define_method setter_method do |value|\n if options[:allow_blank] || value != \"\"\n write_attribute(attribute, value)\n end\n end\n end",
"def attr_internal_writer(*attrs)\n attrs.each {|attr_name| attr_internal_define(attr_name, :writer)}\n end",
"def escape_attr input\n escape input, attr_regexp, attr_mapping\n end",
"def make_writer( attrtype )\n\t\tself.log.debug \"Generating an attribute writer for %p\" % [ attrtype ]\n\t\tattrname = attrtype.name\n\t\tif attrtype.single?\n\t\t\tself.log.debug \" attribute is SINGLE, so generating a scalar writer...\"\n\t\t\treturn lambda {|newvalue| self[attrname] = newvalue }\n\t\telse\n\t\t\tself.log.debug \" attribute isn't SINGLE, so generating an array writer...\"\n\t\t\treturn lambda {|*newvalues| self[attrname] = newvalues.flatten }\n\t\tend\n\tend",
"def write_attribute(name, value)\n # Simply check if the accessor is allowed to write the field\n # (if so, go to superclass and do it)\n @bypass_auth ||= false\n if allowed_to_write(name) || @bypass_auth\n super(name, value)\n end\n end",
"def mattr_writer(*syms, &proc)\n receiver = self\n options = syms.extract_options!\n syms.each do |sym|\n raise NameError.new('invalid attribute name') unless sym =~ /^[_A-Za-z]\\w*$/\n class_exec do\n define_singleton_method \"#{sym}=\" do |obj|\n class_variable_set(\"@@#{sym}\", obj)\n end\n end\n\n unless options[:instance_writer] == false || options[:instance_accessor] == false\n class_exec do\n define_method \"#{sym}=\" do |obj|\n receiver.class_variable_set(\"@@#{sym}\", obj)\n end\n end\n end\n send(\"#{sym}=\", proc.call) if proc\n end\n end",
"def write_attribute(attribute, value)\n false\n end",
"def add_attribute attribute\n return attribute unless @document_self\n\n # mainly to check for redefinition of an attribute as a method\n # TODO find a policy for 'attr_reader :foo' + 'def foo=()'\n register = false\n\n key = nil\n\n if attribute.rw.index 'R' then\n key = attribute.pretty_name\n known = @methods_hash[key]\n\n if known then\n known.comment = attribute.comment if known.comment.empty?\n elsif registered = @methods_hash[attribute.pretty_name + '='] and\n RDoc::Attr === registered then\n registered.rw = 'RW'\n else\n @methods_hash[key] = attribute\n register = true\n end\n end\n\n if attribute.rw.index 'W' then\n key = attribute.pretty_name + '='\n known = @methods_hash[key]\n\n if known then\n known.comment = attribute.comment if known.comment.empty?\n elsif registered = @methods_hash[attribute.pretty_name] and\n RDoc::Attr === registered then\n registered.rw = 'RW'\n else\n @methods_hash[key] = attribute\n register = true\n end\n end\n\n if register then\n attribute.visibility = @visibility\n add_to @attributes, attribute\n resolve_aliases attribute\n end\n\n attribute\n end",
"def define_writer_method(mod)\n writer_method_name = \"#{name}=\"\n attribute = self\n\n mod.send(:define_method, writer_method_name) { |value| attribute.set(self, value) }\n mod.send(writer_visibility, writer_method_name)\n\n self\n end",
"def allowed_to_write(name)\n # no point allowing attribute writes if we can't save them?\n if allowed_to_save\n name = name.to_s\n validation_methods = self.class.write_validations(name) \n if validation_methods.nil?\n # We haven't registered any filters on this attribute, so allow the write.\n true\n elsif validation_methods.check :accessor => accessor, :model => self\n # One of the authentication methods worked, so allow the write.\n true\n else\n # We had filters but none of them passed. Disallow write.\n false\n end\n else\n false\n end\n end",
"def assert_attr_writer(obj, method)\n assert_respond_to obj, \"#{method}=\"\nend",
"def add_attribute(name, &block); end",
"def authenticates_writes_to(attr, options={})\n authenticates_access\n @write_validation_map ||= {}\n @write_validation_map[attr.to_s] ||= AuthMethodList.new\n @write_validation_map[attr.to_s].add_method(options)\n end",
"def write_attribute_3(param1, param2)\n\twrite_attribute(param1, param2)\n end",
"def write_attribute(attr_name, value) #:doc:\n @attributes[attr_name] = empty_string_for_number_column?(attr_name, value) ? nil : value\n end",
"def add_writer_tags(klass, new_method, member)\n member_tag = member_tag_for_member(klass, member, :write)\n return_type = return_type_from_tag(member_tag)\n setter_doc_text = member_tag ? member_tag.text : \"Sets the attribute #{member}\"\n new_method.docstring.replace(setter_doc_text)\n new_method.add_tag YARD::Tags::Tag.new(:param, \"the value to set the attribute #{member} to.\", return_type, \"value\")\n new_method.add_tag YARD::Tags::Tag.new(:return, \"the newly set value\", return_type)\n end",
"def print_attribute(*) end",
"def attribute(name); end",
"def add_checked_attribute(clazz, attribute)\r\n eval <<END\r\n class #{clazz}\r\n\r\n def #{attribute}=(value)\r\n raise 'Invalid attribute' unless value\r\n @#{attribute}=value\r\n end\r\n\r\n def #{attribute}\r\n #{attribute}\r\n end\r\n end\r\nEND\r\nend",
"def attr(name); end",
"def is_attribute?(line)\n (line =~ /(\\s+)attr_(writer|reader|accessor)\\s+:[a-zA-Z_0-9]+/) == 0\n end",
"def attribute(name, value)\n\t if !@inStartTag\n\t\traise WriterError.new('attribute outside of tag start')\n\t end\n\t @io << \" #{name}=\\\"#{NQXML.encode(value.to_s)}\\\"\"\n\tend",
"def set_attribute(name, value); end",
"def dataset_writer(*attributes)\n attributes.flatten.each do |attr_name|\n next if method_defined?(\"#{attr_name}=\")\n\n class_eval <<-RUBY, __FILE__, __LINE__ + 1\n def #{attr_name}=(value)\n dataset_set(:#{attr_name}, value)\n end\n RUBY\n end\n end",
"def validated_attribute_names(params); end",
"def require_format_of(attribute)\r\n RequireFormatOf.new(attribute)\r\n end",
"def attr_writer(*fields)\n check_fields(fields)\n added_fields = jiak.data.writable(*fields)\n added_fields.each do |field|\n class_eval <<-EOM\n def #{field}=(val)\n @jiak.object.data.#{field} = val\n self.class.do_auto_update(self)\n end\n EOM\n end\n nil\n end",
"def html_attr(*attrs)\n options = attrs.extract_options!.reverse_merge({\n :level => :super_relaxed\n })\n attrs.each do |att|\n class_eval \"def #{att}=(val); self[:#{att}] = sanitize(val, :#{options[:level]}); end\"\n end\n end",
"def validate_attributes=(new_attribute)\n @validate_attributes = new_attribute\n end",
"def html_attributes(attr); end",
"def instance_write(attr, value)\n setter = :\"#{@name_string}_#{attr}=\"\n instance.send(setter, value) if instance.respond_to?(setter)\n end",
"def valid_xml_attribute(name, options={:level => :warning})\n\t\t\t\tvalidate(\"Invalid XML attribute '#{name}'\", options) { name.to_s.match(/^([^[:punct:]0-9<>]|_)[^<>\"']*/) }\n\t\t\tend",
"def attr_writer(*args)\n sym_args=args_to_sym(args)\n sym_args.each do |value|\n self.instance_eval(\"def #{value}=(arg); @#{value}=arg;end;\")\n end\n \n end",
"def define_writer_method(attribute, method_name, visibility)\n define_method(method_name) { |value| attribute.set(self, value) }\n send(visibility, method_name)\n self\n end",
"def write_attribute(name, val)\n if @embedded_models.include? name\n @embedded_models[name].model = val\n elsif @attribute_objects.include? name\n @attribute_objects[name].value = val\n else\n return false\n end\n\n run_callbacks :attribute_change\n end",
"def valid_attributes\n { \"name\" => \"MyString\" }\n end",
"def valid_attributes\n { \"name\" => \"MyString\" }\n end",
"def valid_attributes\n { body: \"blah\",\n rule_text: 'Something',\n change_description: \"blaa\"}\n end",
"def valid_attributes\n { body: \"blah\",\n rule_text: 'Something',\n change_description: \"blaa\"}\n end",
"def attr; end",
"def attribute(*args)\n define_expressions(Attribute, args)\n end",
"def write_attribute(name, value)\n name = name.to_s\n\n # The attribute already has an unsaved change.\n if attribute_changed?(name)\n old = changed_attributes[name]\n changed_attributes.delete(name) unless field_changed?(name, old, value)\n else\n attribute_will_change(name) if field_changed?(name, old, value)\n end\n\n # Carry on.\n super(name, value)\n end",
"def define_magic_attr(name)\n define_method name do |*attrs|\n raise ArgumentError.new(\"wrong number of arguments\") if attrs.size > 1\n send(\"#{name}=\", attrs.first) if attrs.size == 1\n instance_variable_get(\"@#{name}\")\n end\n\n attr_writer name\n end",
"def configurable_writer(attribute, code=nil, &block)\n if block_given? and not code\n Halcyon.class.send(:define_method, :\"#{attribute}=\", block)\n elsif code and not block_given?\n Halcyon.class.send(:eval, <<-\"end;\")\n def #{attribute.to_s}=(value)\n #{code % [attribute.to_sym.inspect]}\n end\n end;\n else\n raise ArgumentError.new(\"Either a block or a code string should be supplied.\")\n end\n end",
"def method_missing(name, *args, &block)\n if /\\Ahas_validated_(?<type>\\w*)_attribute\\Z/ =~ name\n has_validated_attribute(type, *args, &block)\n else\n super\n end\n end",
"def add_checked_attribute(klass, attribute)\n klass.class_eval do\n define_method attribute do\n instance_variable_get(\"@#{attribute}\")\n end\n\n define_method \"#{attribute}=\" do |value|\n raise 'Invalid attribute' unless value\n \n instance_variable_set(\"@#{attribute}\", value)\n end\n end\nend",
"def method_missing(meth, *args, &blk)\n match = meth.to_s.match(/^([a-zA-Z\\_]+)(=|$)$/)\n if match\n attribute, setter = match[1], !match[2].blank?\n if setter\n write_attribute(attribute, args.first)\n else\n read_attribute(attribute)\n end\n else\n super(meth, *args, &blk)\n end\n end",
"def valid_attributes\n { name: 'do this' }\n end",
"def make_attributes_definitions_or_croak(attrArgs, &attrBlok)\n eye = :'m_attrs_defs'\n\n # Work with attribute as strings\n \n $DEBUG && logger_me(eye, logger_fmt_kls(:attrArgs => attrArgs, :attrBlok => attrBlok))\n\n mustbe_attributes_specification_or_croak(attrArgs, eye, \"attrArgs not attributes_specification\")\n \n #STOPATTRARGSINSUPER\n \n #attrAll = mustbe_not_empty_or_croak(mustbe_array_key_or_nil_or_croak(attrArgs, :all, eye, \"all attributes not array\"), eye, \"all attributes is empty\").map(&:to_s)\n attrAll = mustbe_not_empty_or_croak(mustbe_attributes_specification_all_key_or_croak(attrArgs, :all, eye), eye, \"all attributes is empty\").map(&:to_s)\n \n\n #puts(\"\\n\\n\\nATTR ALL >#{attrAll}<\")\n\n #STOPMAKEATTRSPECSENTRY\n\n attrInc = mustbe_attributes_specification_include_key_or_nil_or_croak(attrArgs, :include, eye) # mustbe all strings\n #puts(\"ATTR INC >#{attrInc.class}< >#{attrInc}< >#{is_value_not_empty?(attrInc)}<\")\n attrInc && mustbe_not_empty_or_croak(attrInc, eye, \"include attributes is empty\")\n\n attrExc = mustbe_attributes_specification_exclude_key_or_nil_or_croak(attrArgs, :exclude, eye) || []\n \n attrMapNom = mustbe_attributes_definitions_key_or_nil_or_croak(attrArgs, :definitions, eye) || {}\n attrMap = attrMapNom && potrubi_util_map_hash_kv(attrMapNom) {|k,v| [k.to_s, v]} # keys all strings\n\n # Ensure all consistent\n \n attrInc && mustbe_subset_or_croak(attrInc, attrAll, eye, \"include attributes contains unknown attributes\")\n mustbe_subset_or_croak(attrExc, attrAll, eye, \"exclude attributes contains unknown attributes\")\n mustbe_subset_or_croak(attrMap.keys, attrAll, eye, \"attribute map contains unknown attributes\")\n \n attrUse = ((attrInc || attrAll) - attrExc).uniq # list of unique attributes to report on\n\n # consolidate \"faked up\" attr specs with ones provided to get the composite attrSpecs\n \n attrDefsNom = potrubi_util_array_to_hash(attrUse).merge(attrMap.select {|k,v| attrUse.include?(k)}) # consolidated \"faked up\" attr specs with ones provided\n\n attrDefs = potrubi_util_map_hash_v(attrDefsNom) do | attrName, attrSpecNom|\n\n attrSpec =\n case attrSpecNom\n when NilClass then {}\n when Hash then\n attrSpecNom.each_with_object({}) do | (verbName, verbSpec), h1 |\n case verbName\n when :pass_thru then h1[:pass_thru] = verbSpec # dont touch; just pass through\n when :event_defaults then # add these to pass_thru\n h1[:pass_thru] = (h1[:pass_thru] || {}).merge(verbName => verbSpec)\n when :map, :select, :metric then\n h1[verbName] = {\n :method_name => \"#{verbName}_#{attrName}_#{rand(1000000)}\", # make a unqiue name\n :method_spec => verbSpec # spec must be valid to dynamic_define_methods\n }\n else\n logic_exception(verbName, eye, \"attrName >#{attrName}< verbName >#{verbName}< value should be impossible\")\n end\n end\n \n else\n logic_exception(attrrSpecNom, eye, \"attrSpecNom value should be impossible\")\n end\n\n attrSpec\n \n end\n \n $DEBUG && logger_mx(eye, logger_fmt_kls(:attrDefs => attrDefs))\n\n mustbe_attributes_definitions_or_croak(attrDefs, eye, \"attrDefs failed contract\")\n\n #STOPMAKEATTRSPECS\n \n end",
"def create_writer(klass, member)\n # We want to convert these members into attributes just like\n # as if they were declared using attr_accessor.\n new_meth = register MethodObject.new(klass, \"#{member}=\", :instance) do |o|\n o.parameters = [['value', nil]]\n o.signature ||= \"def #{member}=(value)\"\n o.source ||= \"#{o.signature}\\n @#{member} = value\\nend\"\n end\n add_writer_tags(klass, new_meth, member)\n klass.attributes[:instance][member][:write] = new_meth\n end",
"def create_setter!\n @target.class_eval <<-EOS\n #{writer_visibility.to_s}\n def #{name}=(value)\n attribute_set(#{name.inspect}, value)\n end\n EOS\n rescue SyntaxError\n raise SyntaxError.new(column)\n end",
"def attribute name, type, conditions= DEFAULT_ATTRIBUTE_CONDITIONS\n RMOF.complete_conditions conditions, DEFAULT_ATTRIBUTE_CONDITIONS\n @attributes= {} unless instance_variable_defined? :@attributes\n @attributes[name]= [name, type, conditions]\n unless method_defined? :__attributes then \n define_method( :__attributes) do \n @attributes\n end \n end\n at= \"@#{name}\".to_sym\n getter= \"#{name}\".to_sym\n setter= \"#{name}=\".to_sym\n completion= \"__complete_#{name}\".to_sym\n define_method( getter) do\n if instance_variable_defined? at then instance_variable_get at\n else conditions[:default]\n end\n end\n define_method( setter) do |val|\n instance_variable_set at, val\n end\n define_method( completion) do\n RMOF.validate( self.send(getter), name, type, conditions)\n end\n end",
"def attr_internal_writer(*attrs)\n attrs.each do |attr|\n module_eval \"def #{attr}=(v) #{attr_internal_ivar_name(attr)} = v end\"\n end\n end",
"def attr_internal_writer(*attrs)\n attrs.each do |attr|\n module_eval \"def #{attr}=(v) #{attr_internal_ivar_name(attr)} = v end\"\n end\n end",
"def create_setter(name, meth)\n define_method(\"#{meth}=\") do |value|\n write_attribute(name, value)\n end\n end",
"def sanitized_allowed_attributes=(attributes); end",
"def sanitized_allowed_attributes=(attributes); end",
"def oattr(name, type)\n case type\n when :custom\n # Do nothing, just register attr below.\n when :writer\n attr_writer name\n else\n raise ArgumentError, \"Unknown type: #{type.inspect}\"\n end\n\n # Register and return.\n name.tap { oattrs << name}\n end",
"def valid_attributes\n { name: \"Expert\" }\n end",
"def attributes(*method_names, **options)\n add_attributes(method_names, **options, strategy: :write_value_using_method_strategy)\n end",
"def []=(attr_name, value)\n writer_method = \"#{attr_name}=\"\n send(writer_method, value) if respond_to?(writer_method)\n end",
"def write_extended_attributes(attrs)\n attrs.each do |k, val|\n self.send((k.to_s + \"=\").to_sym, val) if is_flex_attribute?(k)\n end\n self\n end",
"def valid_attributes\n { \"username\" => \"MyString\" }\n end",
"def cattr_writer(*fields)\n metaclass.send :attr_writer, *fields\n end",
"def write_attribute(attr, value)\n if attribute_encrypted?(attr)\n conductor_for(attr).encrypt(value)\n else\n super(attr, value)\n end\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_number_value(\"offsetInDays\", @offset_in_days)\n writer.write_enum_value(\"timeBasedAttribute\", @time_based_attribute)\n end",
"def define_attribute_method(attr_name, _owner: generated_attribute_methods)\n CodeGenerator.batch(_owner, __FILE__, __LINE__) do |owner|\n attribute_method_matchers.each do |matcher|\n method_name = matcher.method_name(attr_name)\n\n unless instance_method_already_implemented?(method_name)\n generate_method = \"define_method_#{matcher.target}\"\n\n if respond_to?(generate_method, true)\n send(generate_method, attr_name.to_s, owner: owner)\n else\n define_proxy_call true, owner, method_name, matcher.target, attr_name.to_s\n end\n end\n end\n attribute_method_matchers_cache.clear\n end\n end",
"def has_attributes?; end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"isExpirationRequired\", @is_expiration_required)\n writer.write_duration_value(\"maximumDuration\", @maximum_duration)\n end",
"def add_attributes(item)\n [:class, :instance].each do |attr_loc|\n # Grab attributes for the current location (class or instance)\n attrs = item.attributes[attr_loc]\n attrs.each do |name, attribute|\n reader = attribute[:read]\n writer = attribute[:write]\n\n unless reader || writer\n Logging.warn(\"attribute is not readable or writable somehow, skipping\", attribute)\n next\n end\n\n # Get all given types\n yard_types = []\n if reader\n next if @hide_private && reader.visibility == :private\n yard_types += reader.tags('return').flat_map(&:types).compact.reject { |x| x.downcase == 'void' } +\n reader.tags('param').flat_map(&:types)\n end\n if writer\n next if @hide_private && writer.visibility == :private\n yard_types += writer.tags('return').flat_map(&:types).compact.reject { |x| x.downcase == 'void' } +\n writer.tags('param').flat_map(&:types)\n end\n\n # Use untyped if not types specified anywhere, otherwise try to\n # compute Parlour type given all these types\n if yard_types.empty?\n Logging.omit(\"no YARD type given for #{name.inspect}, using untyped\", reader || writer)\n parlour_type = Parlour::Types::Untyped.new\n elsif yard_types.all? { |x| x == 'nil' }\n # Nil attributes are extremely unusual, so just use untyped\n parlour_type = Parlour::Types::Untyped.new\n else\n parlour_type = TypeConverter.yard_to_parlour(\n yard_types, reader || writer, @type_converter_config)\n end\n\n # Generate attribute\n if reader && writer\n kind = :accessor\n elsif reader\n kind = :reader\n elsif writer\n kind = :writer\n end\n\n if @exclude_untyped && parlour_type.is_a?(Parlour::Types::Untyped)\n Logging.omit(\"excluding untyped attribute\", reader || writer, immediate: true)\n next\n end\n\n case @mode\n when :rbi\n @current_object.create_attribute(\n name.to_s,\n kind: kind,\n type: parlour_type,\n class_attribute: (attr_loc == :class)\n ) do |m|\n add_comments(reader || writer, m)\n end\n when :rbs\n if attr_loc == :class\n # RBS doesn't support class attr_accessors so create individual methods\n\n if reader\n @current_object.create_method(\n name.to_s,\n [Parlour::RbsGenerator::MethodSignature.new([], parlour_type)],\n class_method: true\n ) do |m|\n add_comments(reader, m)\n end\n end\n\n if writer\n @current_object.create_method(\n \"#{name}=\",\n [Parlour::RbsGenerator::MethodSignature.new([Parlour::RbsGenerator::Parameter.new(\n \"value\",\n type: parlour_type,\n required: true\n )], parlour_type)],\n class_method: true\n ) do |m|\n add_comments(writer, m)\n end\n end\n else\n @current_object.create_attribute(\n name.to_s,\n kind: kind,\n type: parlour_type,\n ) do |m|\n add_comments(reader || writer, m)\n end\n end\n end\n end\n end\n end",
"def []=(attr_name, value)\r\n if attr_name.is_a?(String) and attr_name != attr_name.split(ID_SEP).first\r\n attr_name = attr_name.split(ID_SEP)\r\n end\r\n\r\n if attr_name.is_a? Array\r\n value = value.split(ID_SEP) if value.is_a? String\r\n unless value.length == attr_name.length\r\n raise \"Number of attr_names and values do not match\"\r\n end\r\n #breakpoint\r\n [attr_name, value].transpose.map {|name,val| write_attribute(name.to_s, val)}\r\n else\r\n write_attribute(attr_name, value)\r\n end\r\n end",
"def attr(symbol, writable=false) end",
"def define_writer!(k, definition)\n define_method(\"#{k}=\") do |value|\n # Recursively convert hash and array of hash to schematized objects\n value = ensure_schema value, definition[:schema]\n\n # Initial value\n instance_variable_set \"@#{k}\", value\n\n # Dirty tracking\n self.changed_attributes ||= Set.new\n self.changed_attributes << k\n end\n end",
"def validate\n validate_string_attributes\n end",
"def write_attribute_with_dynamo(field_name, value)\n if is_dynamo_field?(field_name)\n # Store these guys for now. We don't actually save the field value until the model is saved ( i.e my_supplier.save ).\n # If we were to save the field_value now we wouldn't be able to know the id of the model to link this value to it.\n # @see delay_save\n @all_fields_and_values ||= []\n @all_fields_and_values << {:dynamo_field=>cached_dynamo_field_by_name(field_name), :value=>value}\n end\n # If its a 'normal' attribute let rails write it in the usual way.\n write_attribute_without_dynamo(field_name, value)\n end",
"def define_attr_accessor(attr)\n attr_accessor(attr)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n writer.write_collection_of_object_values(\"attributeMappings\", @attribute_mappings)\n writer.write_boolean_value(\"enabled\", @enabled)\n writer.write_enum_value(\"flowTypes\", @flow_types)\n writer.write_collection_of_object_values(\"metadata\", @metadata)\n writer.write_string_value(\"name\", @name)\n writer.write_string_value(\"@odata.type\", @odata_type)\n writer.write_object_value(\"scope\", @scope)\n writer.write_string_value(\"sourceObjectName\", @source_object_name)\n writer.write_string_value(\"targetObjectName\", @target_object_name)\n writer.write_additional_data(@additional_data)\n end",
"def validate_attribute_syntax\n\t\[email protected] do |attribute, values|\n\t\t\t[ values ].flatten.each do |value|\n\t\t\t\tbegin\n\t\t\t\t\tself.get_converted_attribute( attribute.to_sym, value )\n\t\t\t\trescue => err\n\t\t\t\t\tself.log.error \"validation for %p failed: %s: %s\" %\n\t\t\t\t\t\t[ attribute, err.class.name, err.message ]\n\t\t\t\t\tattrtype = self.find_attribute_type( attribute )\n\t\t\t\t\tself.errors.add( attribute, \"isn't a valid %s value\" %\n\t\t\t\t\t\t[ attrtype.syntax ? attrtype.syntax.desc : attrtype.syntax_oid ] )\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"def valid_attributes\n { }\n end",
"def validatable_attributes(atts, opts)\n am, an, ab, m = opts.values_at(:allow_missing, :allow_nil, :allow_blank, :message)\n Array(atts).each do |a|\n next if am && !values.has_key?(a)\n v = send(a)\n next if an && v.nil?\n next if ab && v.respond_to?(:blank?) && v.blank?\n if message = yield(a, v, m)\n errors.add(a, message)\n end\n end\n end",
"def valid_attributes\n { }\n end",
"def valid_attributes\n { }\n end",
"def attribute_name=(_arg0); end",
"def attribute_name=(_arg0); end",
"def attribute_name=(_arg0); end",
"def require_attr(name)\n send(name).tap do |_|\n raise \"Attribute must be set: #{name}\" if _.nil?\n end\n end",
"def write_attributes(attributes)\n _attributes = attributes.select do |name, value|\n if self.is_dynamic_field?(name)\n self.dynamic_setter(name, value)\n false\n else\n true\n end\n end\n\n super(_attributes)\n end",
"def attribute; end",
"def attribute; end"
] | [
"0.6472992",
"0.6315012",
"0.6315012",
"0.62821025",
"0.6279224",
"0.6211609",
"0.61891466",
"0.6182247",
"0.60683644",
"0.6032628",
"0.5995443",
"0.5988785",
"0.5959885",
"0.5938289",
"0.5931089",
"0.58951056",
"0.5859927",
"0.5851703",
"0.58493423",
"0.58465594",
"0.58328366",
"0.5823013",
"0.5822229",
"0.57850474",
"0.5701491",
"0.5696689",
"0.5682951",
"0.5678094",
"0.566814",
"0.5657499",
"0.56555206",
"0.5642589",
"0.56219065",
"0.5615893",
"0.56105876",
"0.559851",
"0.5598089",
"0.55940455",
"0.5585137",
"0.55848545",
"0.55796933",
"0.5571477",
"0.5567006",
"0.55667996",
"0.55652434",
"0.5562926",
"0.55600035",
"0.55590326",
"0.55590326",
"0.5554599",
"0.5554599",
"0.55407417",
"0.5534935",
"0.5527733",
"0.55271375",
"0.55238813",
"0.5501504",
"0.5497003",
"0.5496233",
"0.54927665",
"0.5464706",
"0.54617554",
"0.5461167",
"0.5451583",
"0.54498726",
"0.54498726",
"0.54359984",
"0.5430996",
"0.5430996",
"0.5426488",
"0.5418467",
"0.54153895",
"0.54107565",
"0.5407886",
"0.5401234",
"0.54008496",
"0.5400268",
"0.53910094",
"0.53827274",
"0.5377731",
"0.5375473",
"0.5374833",
"0.53720397",
"0.5370215",
"0.5363264",
"0.5361161",
"0.5360557",
"0.5351706",
"0.53514725",
"0.53492516",
"0.53459316",
"0.5341237",
"0.5328037",
"0.5328037",
"0.53230566",
"0.53230566",
"0.53230566",
"0.5319575",
"0.531832",
"0.5315559",
"0.5315559"
] | 0.0 | -1 |
Custom attribute writer method checking allowed values (enum). | def billing=(billing)
validator = EnumAttributeValidator.new('String', ["prorated", "full", "zero_amount", "none"])
unless validator.valid?(billing)
fail ArgumentError, "invalid value for 'billing', must be one of #{validator.allowable_values}."
end
@billing = billing
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write_attribute_with_enum(attr, value)\n write_attribute_without_enum attr, converted_enum(attr, value)\n end",
"def attr_enum(name, enum, options={}, &block)\n raise ArgumentError, 'enum' unless enum && enum.respond_to?(:values)\n\n options = {\n :enum => enum,\n :validate => true\n }.merge(options)\n\n required = options[:required] == true\n converter = block_given? ? block : Converters.converter_for(:enum, options)\n\n attr_reader_with_converter name, converter, options\n\n validates name,\n :allow_blank => !required,\n :allow_nil => !required,\n :inclusion => { :in => enum.values } if options[:validate]\n\n attr_writer name\n\n add_attr(name, :enum, converter, options)\n end",
"def _attribute_enum?(attr)\n return false unless self.class.respond_to?(:defined_enums)\n self.class.defined_enums.with_indifferent_access.include?(attr)\n end",
"def nature_of_business=(nature_of_business)\n validator = EnumAttributeValidator.new('String', [\"personal\", \"agriculture_and_hunting\", \"forestry\", \"fishing\", \"agricultural_by_products\", \"coal_mining\", \"oil_mining\", \"iron_ore_mining\", \"other_metal_and_diamond_mining\", \"other_mineral_mining\", \"manufacturing_of_food_drink_tobacco\", \"manufacturing_of_textiles_leather_fur_furniture\", \"manufacture_of_wooden_products_furniture\", \"manufacture_of_paper_pulp_allied_products\", \"manufacture_of_chemicals_medical_petroleum_rubber_plastic_products\", \"manufacture_of_pottery_china_glass_stone\", \"manufacture_of_iron_steel_non_ferrous_metals_basic_industries\", \"manufacture_of_metal_products_electrical_and_scientific_engineering\", \"manufacture_of_jewelry_musical_instruments_toys\", \"electricity_gas_and_water\", \"construction\", \"wholesale_trade\", \"retail_trade\", \"catering_incl_hotels\", \"transport_storage\", \"communications\", \"finance_and_holding_companies\", \"insurance\", \"business_services\", \"real_estate_development_investment\", \"central_state_governments\", \"community_services_defence_police_prisons_etc\", \"social_services_education_health_care\", \"personal_services_leisure_services\", \"personal_services_domestic_laundry_repairs\", \"personal_services_embassies_international_organisations\"])\n unless validator.valid?(nature_of_business) || nature_of_business.empty?\n fail ArgumentError, \"invalid value for \\\"nature_of_business\\\", must be one of #{validator.allowable_values}.\"\n end\n @nature_of_business = nature_of_business\n end",
"def valid?\n type_validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n return false unless type_validator.valid?(@type)\n subtype_validator = EnumAttributeValidator.new('String', ['None', 'Across', 'Bottom', 'BottomLeft', 'BottomRight', 'Center', 'Clockwise', 'CounterClockwise', 'GradualAndCycleClockwise', 'GradualAndCycleCounterClockwise', 'Down', 'DownLeft', 'DownRight', 'FontAllCaps', 'FontBold', 'FontItalic', 'FontShadow', 'FontStrikethrough', 'FontUnderline', 'Gradual', 'Horizontal', 'HorizontalIn', 'HorizontalOut', 'In', 'InBottom', 'InCenter', 'InSlightly', 'Instant', 'Left', 'OrdinalMask', 'Out', 'OutBottom', 'OutCenter', 'OutSlightly', 'Right', 'Slightly', 'Top', 'TopLeft', 'TopRight', 'Up', 'UpLeft', 'UpRight', 'Vertical', 'VerticalIn', 'VerticalOut', 'Wheel1', 'Wheel2', 'Wheel3', 'Wheel4', 'Wheel8'])\n return false unless subtype_validator.valid?(@subtype)\n preset_class_type_validator = EnumAttributeValidator.new('String', ['Entrance', 'Exit', 'Emphasis', 'Path', 'MediaCall', 'OLEActionVerbs'])\n return false unless preset_class_type_validator.valid?(@preset_class_type)\n return false if @shape_index.nil?\n trigger_type_validator = EnumAttributeValidator.new('String', ['AfterPrevious', 'OnClick', 'WithPrevious'])\n return false unless trigger_type_validator.valid?(@trigger_type)\n restart_validator = EnumAttributeValidator.new('String', ['Always', 'WhenNotActive', 'Never', 'NotDefined'])\n return false unless restart_validator.valid?(@restart)\n after_animation_type_validator = EnumAttributeValidator.new('String', ['DoNotDim', 'Color', 'HideAfterAnimation', 'HideOnNextMouseClick'])\n return false unless after_animation_type_validator.valid?(@after_animation_type)\n true\n end",
"def enum_attr?(name)\n return false unless @enum_attrs\n @enum_attrs.key?(name)\n end",
"def classy_enum_attr(attribute, options={})\n enum = (options[:class_name] || options[:enum] || attribute).to_s.camelize.constantize\n allow_blank = options[:allow_blank] || false\n allow_nil = options[:allow_nil] || false\n default = ClassyEnum._normalize_default(options[:default], enum)\n\n # Add ActiveRecord validation to ensure it won't be saved unless it's an option\n validates_inclusion_of attribute,\n in: enum,\n allow_blank: allow_blank,\n allow_nil: allow_nil\n\n # Use a module so that the reader methods can be overridden in classes and\n # use super to get the enum value.\n mod = Module.new do\n\n # Define getter method that returns a ClassyEnum instance\n define_method attribute do\n enum.build(read_attribute(attribute), owner: self)\n end\n\n # Define setter method that accepts string, symbol, instance or class for member\n define_method \"#{attribute}=\" do |value|\n value = ClassyEnum._normalize_value(value, default, (allow_nil || allow_blank))\n super(value)\n end\n\n define_method :save_changed_attribute do |attr_name, arg|\n if attribute.to_s == attr_name.to_s && !attribute_changed?(attr_name)\n arg = enum.build(arg)\n current_value = clone_attribute_value(:read_attribute, attr_name)\n\n if arg != current_value\n if respond_to?(:set_attribute_was, true)\n set_attribute_was(attr_name, enum.build(arg, owner: self))\n else\n changed_attributes[attr_name] = enum.build(current_value, owner: self)\n end\n end\n else\n super(attr_name, arg)\n end\n end\n end\n\n include mod\n\n # Initialize the object with the default value if it is present\n # because this will let you store the default value in the\n # database and make it searchable.\n if default.present?\n after_initialize do\n value = read_attribute(attribute)\n\n if (value.blank? && !(allow_blank || allow_nil)) || (value.nil? && !allow_nil)\n send(\"#{attribute}=\", default)\n end\n end\n end\n\n end",
"def is_enum_param(name)\n [\"bookmarkType\", \"order\", \"role\"].include?(name)\n end",
"def valid?\n ENUM.include? @type.downcase.to_sym\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end",
"def set_enum_attrs(subset)\n raise ArgumentError, \"attrs is not a proper subset of available values\" unless subset.all? { |attr| attrs.include? attr }\n @enum_attrs = subset\n end",
"def country=(country)\n validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n unless validator.valid?(country)\n fail ArgumentError, \"invalid value for 'country', must be one of #{validator.allowable_values}.\"\n end\n @country = country\n end",
"def check_option!(name, definition)\n case name\n when :values\n raise AttributorException, \"Allowed set of values requires an array. Got (#{definition})\" unless definition.is_a? ::Array\n when :default\n raise AttributorException, \"Default value doesn't have the correct attribute type. Got (#{definition.inspect})\" unless type.valid_type?(definition) || definition.is_a?(Proc)\n options[:default] = load(definition) unless definition.is_a?(Proc)\n when :description\n raise AttributorException, \"Description value must be a string. Got (#{definition})\" unless definition.is_a? ::String\n when :required\n raise AttributorException, 'Required must be a boolean' unless definition == true || definition == false\n raise AttributorException, 'Required cannot be enabled in combination with :default' if definition == true && options.key?(:default)\n when :required_if\n raise AttributorException, 'Required_if must be a String, a Hash definition or a Proc' unless definition.is_a?(::String) || definition.is_a?(::Hash) || definition.is_a?(::Proc)\n raise AttributorException, 'Required_if cannot be specified together with :required' if options[:required]\n when :example\n unless definition.is_a?(::Regexp) || definition.is_a?(::String) || definition.is_a?(::Array) || definition.is_a?(::Proc) || definition.nil? || type.valid_type?(definition)\n raise AttributorException, \"Invalid example type (got: #{definition.class.name}). It must always match the type of the attribute (except if passing Regex that is allowed for some types)\"\n end\n when :custom_data\n raise AttributorException, \"custom_data must be a Hash. Got (#{definition})\" unless definition.is_a?(::Hash)\n else\n return :unknown # unknown option\n end\n\n :ok # passes\n end",
"def define_active_enum_write_method(attribute)\n class_eval <<-DEF\n def #{attribute}=(arg)\n if arg.is_a?(Symbol)\n super(self.class.active_enum_for(:#{attribute})[arg])\n else\n super\n end\n end\n DEF\n end",
"def check_enum(validation:, key:, schema:)\n return false if !validation[:required] && schema.nil? # Optional and not here, dont check\n return false unless validation[:values]\n return false if validation[:values].include?(schema)\n\n schema = 'nothing' if schema.nil?\n error! key, \"must be one of #{validation[:values].join(', ')}, but was #{schema}\"\n true\n end",
"def should_allow_values_for(attribute, *good_values)\n get_options!(good_values)\n good_values.each do |value|\n matcher = allow_value(value).for(attribute)\n should matcher.description do\n assert_accepts matcher, subject\n end\n end\n end",
"def validate_exclusion_of(attr); end",
"def valid_attribute_types\n\t\treturn self.must_attribute_types |\n\t\t self.may_attribute_types |\n\t\t self.operational_attribute_types\n\tend",
"def valid?\n status_validator = EnumAttributeValidator.new('String', [\"ACTIVE\", \"INACTIVE\"])\n return false unless status_validator.valid?(@status)\n country_validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n return false unless country_validator.valid?(@country)\n currency_validator = EnumAttributeValidator.new('String', [\"UNKNOWN_CURRENCY\", \"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n return false unless currency_validator.valid?(@currency)\n type_validator = EnumAttributeValidator.new('String', [\"PHYSICAL\", \"MOBILE\"])\n return false unless type_validator.valid?(@type)\n return true\n end",
"def update_allowed_values\n self.url_allowed = true if url_required\n self.description_allowed = true if description_required\n self.title_allowed = true if title_required\n\n TagSet::TAG_TYPES.each do |tag_type|\n required = eval(\"#{tag_type}_num_required\") || eval(\"self.#{tag_type}_num_required\") || 0\n allowed = eval(\"#{tag_type}_num_allowed\") || eval(\"self.#{tag_type}_num_allowed\") || 0\n if required > allowed\n eval(\"self.#{tag_type}_num_allowed = required\")\n end\n end\n end",
"def test_valid?\n assert_raise( RuntimeError ) { Tui::Model::Enum.new( 'lab1', { }, 1 ) }\n base = Tui::Model::Enum.new( 'lab1', { 'val1' => '1', 'val99' => '99' }, 'val99' )\n assert_false base.valid?( 1 )\n assert_true base.valid?( \"val1\" )\n ex = assert_raise( RuntimeError ) { base.value = 1; }\n assert_equal( 'Invalid value for model type Tui::Model::Enum!', ex.message )\n end",
"def validate_may_attributes\n\t\thash = (self.entry || {} ).merge( @values )\n\t\tattributes = hash.keys.map( &:to_sym ).uniq\n\t\tvalid_attributes = self.valid_attribute_oids +\n\t\t\tself.operational_attribute_oids +\n\t\t\tIGNORED_OPERATIONAL_ATTRS\n\n\t\tself.log.debug \"Validating MAY attributes: %p against the list of valid OIDs: %p\" %\n\t\t\t[ attributes, valid_attributes ]\n\t\tunknown_attributes = attributes - valid_attributes\n\t\tunknown_attributes.each do |oid|\n\t\t\tself.errors.add( oid, \"is not allowed by entry's objectClasses\" )\n\t\tend\n\tend",
"def allowed_attributes=(_arg0); end",
"def allowed_attributes=(_arg0); end",
"def validate_range(key, value, enum_values)\n values = value.instance_of?(Array) ? value : [value]\n values.each do |v|\n add_templated_error(key, \"'#{v}' is not a valid setting for '#{template.name_for(key)}'\") unless enum_values.include?(v)\n end\n end",
"def valid?\n return false if @class_id.nil?\n class_id_validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n return false unless class_id_validator.valid?(@class_id)\n return false if @object_type.nil?\n object_type_validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n return false unless object_type_validator.valid?(@object_type)\n true\n end",
"def allowed_values(value, pdef)\n if(pdef['AllowedValues'].include?(value))\n true\n else\n \"Not an allowed value: #{pdef['AllowedValues'].join(', ')}\"\n end\n end",
"def allowed_to_write(name)\n # no point allowing attribute writes if we can't save them?\n if allowed_to_save\n name = name.to_s\n validation_methods = self.class.write_validations(name) \n if validation_methods.nil?\n # We haven't registered any filters on this attribute, so allow the write.\n true\n elsif validation_methods.check :accessor => accessor, :model => self\n # One of the authentication methods worked, so allow the write.\n true\n else\n # We had filters but none of them passed. Disallow write.\n false\n end\n else\n false\n end\n end",
"def status_enum=(status)\n write_attribute(:status, status)\n end",
"def setting_attribute_is_allowed?(name, user)\n return false unless user.can_write?(self, name)\n (self.whitelisted_attributes && self.whitelisted_attributes.has_key?( name.to_sym)) ||\n (\n self.attribute_names.include?( name.to_s ) &&\n ( self.blacklisted_attributes.nil? ||\n ! self.blacklisted_attributes.has_key?( name.to_sym ) )\n )\n end",
"def valid?\n return false if !super\n status_validator = EnumAttributeValidator.new('String', ['NotDefined', 'Active', 'Resolved', 'Closed'])\n return false unless status_validator.valid?(@status)\n true\n end",
"def valid?\n MANDATORY_ATTRIBUTES[type].each{|a| return false unless self[a]}\n true\n end",
"def valid?\n return false if !super\n return false if @style.nil?\n style_validator = EnumAttributeValidator.new('String', ['Unknown', 'Percent05', 'Percent10', 'Percent20', 'Percent25', 'Percent30', 'Percent40', 'Percent50', 'Percent60', 'Percent70', 'Percent75', 'Percent80', 'Percent90', 'DarkHorizontal', 'DarkVertical', 'DarkDownwardDiagonal', 'DarkUpwardDiagonal', 'SmallCheckerBoard', 'Trellis', 'LightHorizontal', 'LightVertical', 'LightDownwardDiagonal', 'LightUpwardDiagonal', 'SmallGrid', 'DottedDiamond', 'WideDownwardDiagonal', 'WideUpwardDiagonal', 'DashedUpwardDiagonal', 'DashedDownwardDiagonal', 'NarrowVertical', 'NarrowHorizontal', 'DashedVertical', 'DashedHorizontal', 'LargeConfetti', 'LargeGrid', 'HorizontalBrick', 'LargeCheckerBoard', 'SmallConfetti', 'Zigzag', 'SolidDiamond', 'DiagonalBrick', 'OutlinedDiamond', 'Plaid', 'Sphere', 'Weave', 'DottedGrid', 'Divot', 'Shingle', 'Wave', 'Horizontal', 'Vertical', 'Cross', 'DownwardDiagonal', 'UpwardDiagonal', 'DiagonalCross', 'NotDefined'])\n return false unless style_validator.valid?(@style)\n true\n end",
"def enum?(field)\n !!self.enums[field.to_sym]\n end",
"def currency=(currency)\n validator = EnumAttributeValidator.new('String', [\"UNKNOWN_CURRENCY\", \"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n unless validator.valid?(currency)\n fail ArgumentError, \"invalid value for 'currency', must be one of #{validator.allowable_values}.\"\n end\n @currency = currency\n end",
"def enum_defined_for?(attribute)\n context = self.eh_params[:enum_contexts][attribute.to_s]\n !!(eh_params[:db_codes][context] && eh_params[:db_codes][context][attribute.to_s])\n # Returns true if the indicated attribute has an enum defined\n end",
"def object_type=(object_type)\n validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n unless validator.valid?(object_type)\n fail ArgumentError, \"invalid value for \\\"object_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @object_type = object_type\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', [\"\", \"APIC\", \"DCNM\", \"UCSFI\", \"UCSFIISM\", \"IMC\", \"IMCM4\", \"IMCM5\", \"IMCRack\", \"UCSIOM\", \"HX\", \"HyperFlexAP\", \"IWE\", \"UCSD\", \"IntersightAppliance\", \"IntersightAssist\", \"PureStorageFlashArray\", \"UCSC890\", \"NetAppOntap\", \"NetAppActiveIqUnifiedManager\", \"EmcScaleIo\", \"EmcVmax\", \"EmcVplex\", \"EmcXtremIo\", \"VmwareVcenter\", \"MicrosoftHyperV\", \"AppDynamics\", \"Dynatrace\", \"NewRelic\", \"ServiceNow\", \"ReadHatOpenStack\", \"CloudFoundry\", \"MicrosoftAzureApplicationInsights\", \"OpenStack\", \"MicrosoftSqlServer\", \"Kubernetes\", \"AmazonWebService\", \"AmazonWebServiceBilling\", \"MicrosoftAzureServicePrincipal\", \"MicrosoftAzureEnterpriseAgreement\", \"DellCompellent\", \"HPE3Par\", \"RedHatEnterpriseVirtualization\", \"NutanixAcropolis\", \"HPEOneView\", \"ServiceEngine\", \"HitachiVirtualStoragePlatform\", \"IMCBlade\", \"TerraformCloud\", \"TerraformAgent\", \"CustomTarget\", \"AnsibleEndpoint\", \"HTTPEndpoint\", \"SSHEndpoint\", \"CiscoCatalyst\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end",
"def compliance=(compliance)\n validator = EnumAttributeValidator.new('String', ['Pdf15', 'PdfA1b'])\n unless validator.valid?(compliance)\n fail ArgumentError, 'invalid value for \"compliance\", must be one of #{validator.allowable_values}.'\n end\n @compliance = compliance\n end",
"def supports_polymorphic_enum_handling(attribute_name)\n self.eh_params[:polymorphic_attribute] = \"#{attribute_name}_type\".to_sym\n end",
"def should_deny_values(options)\n klass = self.name.gsub(/Test$/, '').constantize\n\n context \"#{klass}\" do\n options.each_pair do |attribute, values|\n [*values].each do |value|\n display_value = value.class == NilClass ? \"nil\" : \"\\\"#{value}\\\"\"\n \n should \"not allow #{attribute} to be #{display_value}\" do\n instance = get_instance_of(klass)\n instance.send(\"#{attribute}=\", value)\n assert !instance.valid?, \n \"Expected #{klass} to be invalid when #{attribute} is set to #{display_value}\"\n assert instance.errors.on(attribute.to_sym), \n \"Expected errors on #{attribute} when set to #{display_value}\"\n end\n end\n end\n end\n end",
"def enum?\n true\n end",
"def kind=(kind)\n validator = EnumAttributeValidator.new('String', [\"UNKNOWN\", \"USER_CREATED\", \"INTERNAL\"])\n unless validator.valid?(kind)\n fail ArgumentError, \"invalid value for \\\"kind\\\", must be one of #{validator.allowable_values}.\"\n end\n @kind = kind\n end",
"def validate_attribute_syntax\n\t\[email protected] do |attribute, values|\n\t\t\t[ values ].flatten.each do |value|\n\t\t\t\tbegin\n\t\t\t\t\tself.get_converted_attribute( attribute.to_sym, value )\n\t\t\t\trescue => err\n\t\t\t\t\tself.log.error \"validation for %p failed: %s: %s\" %\n\t\t\t\t\t\t[ attribute, err.class.name, err.message ]\n\t\t\t\t\tattrtype = self.find_attribute_type( attribute )\n\t\t\t\t\tself.errors.add( attribute, \"isn't a valid %s value\" %\n\t\t\t\t\t\t[ attrtype.syntax ? attrtype.syntax.desc : attrtype.syntax_oid ] )\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"def valid?\n return false if @name.nil?\n return false if @name.to_s.length > 25\n return false if @based_on.nil?\n based_on_validator = EnumAttributeValidator.new('String', [\"MyCalendar\", \"Customer\", \"AllHours\", \"Custom\"])\n return false unless based_on_validator.valid?(@based_on)\n return false if !@application_order.nil? && @application_order > 32767\n return false if !@application_order.nil? && @application_order < 1\n return false if !@respond_hours.nil? && @respond_hours > 999\n return false if !@respond_hours.nil? && @respond_hours < 0\n return false if !@respond_percent.nil? && @respond_percent > 99999\n return false if !@respond_percent.nil? && @respond_percent < 0\n return false if !@plan_within.nil? && @plan_within > 999\n return false if !@plan_within.nil? && @plan_within < 0\n return false if !@plan_within_percent.nil? && @plan_within_percent > 99999\n return false if !@plan_within_percent.nil? && @plan_within_percent < 0\n return false if !@resolution_hours.nil? && @resolution_hours > 999\n return false if !@resolution_hours.nil? && @resolution_hours < 0\n return false if !@resolution_percent.nil? && @resolution_percent > 99999\n return false if !@resolution_percent.nil? && @resolution_percent < 0\n return true\n end",
"def valid?\n policy_validator = EnumAttributeValidator.new('Object', ['RMF', 'DIACAP', 'Reporting'])\n return false unless policy_validator.valid?(@policy)\n registration_type_validator = EnumAttributeValidator.new('Object', ['Assess and Authorize', 'Assess Only', 'Guest', 'Regular', 'Functional', 'Cloud Service Provider'])\n return false unless registration_type_validator.valid?(@registration_type)\n organization_name_validator = EnumAttributeValidator.new('Object', ['Army', 'Navy', 'Air Force', 'Marines', 'DoD', 'Defense Information Systems Agency'])\n return false unless organization_name_validator.valid?(@organization_name)\n system_type_validator = EnumAttributeValidator.new('Object', ['IS Major Application', 'IS Enclave', 'Platform IT', 'Platform IT System', 'Interconnection', 'AIS Application'])\n return false unless system_type_validator.valid?(@system_type)\n authorization_status_validator = EnumAttributeValidator.new('Object', ['Authority to Operate (ATO)', 'Interim Authority to Operate (IATO)', 'Interim Authority to Test (IATT)', 'Authority to Operate with Conditions (ATO) w/Conditions)', 'Denied Authority to Operate (DATO)', 'Not Yet Authorized', 'Unaccredited', 'Decommissioned'])\n return false unless authorization_status_validator.valid?(@authorization_status)\n confidentiality_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless confidentiality_validator.valid?(@confidentiality)\n integrity_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless integrity_validator.valid?(@integrity)\n availability_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless availability_validator.valid?(@availability)\n mac_validator = EnumAttributeValidator.new('Object', ['I', 'II', 'III'])\n return false unless mac_validator.valid?(@mac)\n dod_confidentiality_validator = EnumAttributeValidator.new('Object', ['Public', 'Sensitive', 'Classified'])\n return false unless dod_confidentiality_validator.valid?(@dod_confidentiality)\n true\n end",
"def enum?\n false\n end",
"def unassignable_value_for(attr)\n case attr.type\n when :integer\n attr.assignable_values.max + 1\n when :string\n assignable_value_for(attr) + '-unassignable'\n else\n raise \"Assignable values for :#{attr.type} attributes not supported\"\n end\n end",
"def define_value_methods!\n self.accepted_values.each do |(name, bit)|\n self.meta_class.class_eval <<-FLAG_METHODS\n\n def #{name}\n ((@value || 0) & #{bit}) != 0\n end\n alias :#{name}? :#{name}\n\n def #{name}=(new_value)\n boolean = self.to_boolean(new_value)\n current = self.#{name}\n if boolean ^ current\n self.value = ((@value || 0) ^ #{bit})\n end\n self.#{name}\n end\n\n FLAG_METHODS\n end\n end",
"def replace_enumerations_in_hash(attrs, allow_multiple = true) #:nodoc:\n attrs.each do |attr, value|\n if options = enumerator_options_for(attr, value, allow_multiple)\n attrs.delete(attr)\n attrs.merge!(options)\n end\n end\n end",
"def update_enum_attribute(database_id:, collection_id:, key:, elements:, required:, default:)\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'\n .gsub('{databaseId}', database_id)\n .gsub('{collectionId}', collection_id)\n .gsub('{key}', key)\n\n if database_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"databaseId\"')\n end\n\n if collection_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"collectionId\"')\n end\n\n if key.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"key\"')\n end\n\n if elements.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"elements\"')\n end\n\n if required.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"required\"')\n end\n\n if default.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"default\"')\n end\n\n params = {\n elements: elements,\n required: required,\n default: default,\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'PATCH',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::AttributeEnum\n )\n end",
"def as_enum\n # Should look like:\n # enum attribute_name: [\"one\", \"two\"]\n\n if is_enum?\n if (enum_options = properties[:enum_options]).present?\n enum_options_as_hash = Frontier::HashSingleLineDecorator.new array_as_hash(enum_options)\n \"enum #{name}: {#{enum_options_as_hash}}\"\n else\n raise(ArgumentError, \"No enum_options provided for attribute: #{name}\")\n end\n else\n raise(ArgumentError, \"Attempting to display field #{name} as enum, but is #{type}\")\n end\n end",
"def validate_marital_status(val)\n unless @valid_marital_statuses.include?(val)\n raise \"Invalid value: #{val}\"\n end\n end",
"def validate_marital_status(val)\n unless @valid_marital_statuses.include?(val)\n raise \"Invalid value: #{val}\"\n end\n end",
"def enumeration?\n @is_enumeration ||= @xml.xpath('./xs:restriction/xs:enumeration', {'xs' => 'http://www.w3.org/2001/XMLSchema'}).length > 0\n end",
"def pa_esigibilita=(pa_esigibilita)\n validator = EnumAttributeValidator.new('String', ['I', 'D', 'S', 'N'])\n unless validator.valid?(pa_esigibilita)\n fail ArgumentError, 'invalid value for \"pa_esigibilita\", must be one of #{validator.allowable_values}.'\n end\n @pa_esigibilita = pa_esigibilita\n end",
"def timeliness_validation_for(attr_names, type)\n super\n attr_names.each { |attr_name| define_timeliness_write_method(attr_name) }\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', ['Once', 'Hourly', 'Daily', 'Weekly', 'Monthly', 'Yearly'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end",
"def validate_allowed(record)\n unknown = provided(record) - allowed\n\n return if unknown.empty?\n\n record.errors.add(\n options[:attribute],\n \"contains unknown options: #{unknown.join(', ')}\"\n )\n end",
"def valid?\n source_validator = EnumAttributeValidator.new('Integer', [\"1\", \"2\"])\n return false unless source_validator.valid?(@source)\n return true\n end",
"def valid?(value)\n return false if self == Enum\n return true if value.equal?(LAZY_VALUE)\n self.values.include?(value.to_s)\n end",
"def smee=(smee)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(smee)\n fail ArgumentError, \"invalid value for \\\"smee\\\", must be one of #{validator.allowable_values}.\"\n end\n @smee = smee\n end",
"def allowed_status\n errors.add(:string, 'must be pending, accepted or declined.') unless %w[pending accepted declined].any?(status)\n end",
"def define_active_enum_write_method_multiple(attribute, column)\n class_eval <<-DEF\n def #{attribute}=(args)\n self.#{column} = args.map do |arg|\n self.class.active_enum_get_id_for_#{attribute}(arg)\n end\n end\n DEF\n end",
"def valid?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"alert\", \"notification\"])\n return false unless type_validator.valid?(@type)\n priority_validator = EnumAttributeValidator.new('String', [\"P1\", \"P2\", \"P3\", \"P4\", \"P5\"])\n return false unless priority_validator.valid?(@priority)\n return true\n end",
"def has_enums?\n !!eh_params[:has_enums]\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', ['active', 'notActive', 'unknown'])\n unless validator.valid?(type)\n fail ArgumentError, %Q'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end",
"def level=(level)\n validator = EnumAttributeValidator.new('String', [\"Unknown\", \"Inline\", \"Block\", \"Row\", \"Cell\"])\n if level.to_i == 0\n unless validator.valid?(level)\n raise ArgumentError, \"invalid value for 'level', must be one of #{validator.allowable_values}.\"\n end\n @level = level\n else\n @level = validator.allowable_values[level.to_i]\n end\n end",
"def mode=(mode)\n validator = EnumAttributeValidator.new('String', [\"default\", \"custom\"])\n unless validator.valid?(mode)\n fail ArgumentError, \"invalid value for 'mode', must be one of #{validator.allowable_values}.\"\n end\n @mode = mode\n end",
"def valid?\n type_validator = EnumAttributeValidator.new('String', ['active', 'notActive', 'unknown'])\n return false unless type_validator.valid?(@type)\n true\n end",
"def allowed_access_levels\n validator = lambda do |field|\n level = public_send(field) || ENABLED # rubocop:disable GitlabSecurity/PublicSend\n not_allowed = level > ENABLED\n self.errors.add(field, \"cannot have public visibility level\") if not_allowed\n end\n\n (FEATURES - %i(pages)).each {|f| validator.call(\"#{f}_access_level\")}\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Paragraph\", \"Character\", \"Table\", \"List\"])\n if type.to_i == 0\n unless validator.valid?(type)\n raise ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n else\n @type = validator.allowable_values[type.to_i]\n end\n end",
"def legal_entity_type=(legal_entity_type)\n validator = EnumAttributeValidator.new('String', [\"sole_proprietorship\", \"partnership\", \"privately_owned_company\", \"publicly_owned_company\", \"government_owned_entity\", \"trust\", \"ngo\", \"club_and_society\", \"go\", \"other\", \"financial_institution\", \"mto\"])\n unless validator.valid?(legal_entity_type) || legal_entity_type.empty?\n fail ArgumentError, \"invalid value for \\\"legal_entity_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @legal_entity_type = legal_entity_type\n end",
"def all_attributes_exists_with_enumerations?(attribute_names)\n exists = all_attributes_exists_without_enumerations?(attribute_names)\n exists ||= attribute_names.all? do |name|\n column_methods_hash.include?(name.to_sym) || reflect_on_enumeration(name)\n end\n end",
"def valid_setters\n methods = ScheduledActivity.instance_methods\n @valid_setters ||= methods.select do |m|\n methods.include?(:\"#{m}=\")\n end\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Weekly\", \"BiWeekly\", \"SemiMonthly\", \"Monthly\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end",
"def valid?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"ITEM\", \"CATEGORY\", \"ITEM_VARIATION\", \"TAX\", \"DISCOUNT\", \"MODIFIER_LIST\", \"MODIFIER\"])\n return false unless type_validator.valid?(@type)\n return false if @id.nil?\n return false if @id.to_s.length < 1\n return true\n end",
"def valid?\n return false if @value.nil?\n change_mode_validator = EnumAttributeValidator.new('String', [\"immediate\", \"delayed\"])\n return false unless change_mode_validator.valid?(@change_mode)\n invoicing_type_validator = EnumAttributeValidator.new('String', [\"Immediate\", \"Aggregated\"])\n return false unless invoicing_type_validator.valid?(@invoicing_type)\n return true\n end",
"def valid?\n type_validator = EnumAttributeValidator.new('String', [\"person\", \"business\"])\n return false unless type_validator.valid?(@type)\n return false if @country.nil?\n return false if @street.nil?\n return false if @postal_code.nil?\n return false if @city.nil?\n return false if @email.nil?\n return false if @ip.nil?\n identification_type_validator = EnumAttributeValidator.new('String', [\"DL\", \"PP\", \"ID\", \"OT\"])\n return false unless identification_type_validator.valid?(@identification_type)\n legal_entity_type_validator = EnumAttributeValidator.new('String', [\"sole_proprietorship\", \"partnership\", \"privately_owned_company\", \"publicly_owned_company\", \"government_owned_entity\", \"trust\", \"ngo\", \"club_and_society\", \"go\", \"other\", \"financial_institution\", \"mto\"])\n return false unless legal_entity_type_validator.valid?(@legal_entity_type)\n nature_of_business_validator = EnumAttributeValidator.new('String', [\"personal\", \"agriculture_and_hunting\", \"forestry\", \"fishing\", \"agricultural_by_products\", \"coal_mining\", \"oil_mining\", \"iron_ore_mining\", \"other_metal_and_diamond_mining\", \"other_mineral_mining\", \"manufacturing_of_food_drink_tobacco\", \"manufacturing_of_textiles_leather_fur_furniture\", \"manufacture_of_wooden_products_furniture\", \"manufacture_of_paper_pulp_allied_products\", \"manufacture_of_chemicals_medical_petroleum_rubber_plastic_products\", \"manufacture_of_pottery_china_glass_stone\", \"manufacture_of_iron_steel_non_ferrous_metals_basic_industries\", \"manufacture_of_metal_products_electrical_and_scientific_engineering\", \"manufacture_of_jewelry_musical_instruments_toys\", \"electricity_gas_and_water\", \"construction\", \"wholesale_trade\", \"retail_trade\", \"catering_incl_hotels\", \"transport_storage\", \"communications\", \"finance_and_holding_companies\", \"insurance\", \"business_services\", \"real_estate_development_investment\", \"central_state_governments\", \"community_services_defence_police_prisons_etc\", \"social_services_education_health_care\", \"personal_services_leisure_services\", \"personal_services_domestic_laundry_repairs\", \"personal_services_embassies_international_organisations\"])\n return false unless nature_of_business_validator.valid?(@nature_of_business)\n return false if @documents.nil?\n gender_validator = EnumAttributeValidator.new('String', [\"M\", \"F\", \"O\"])\n return false unless gender_validator.valid?(@gender)\n true\n end",
"def class_id=(class_id)\n validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n unless validator.valid?(class_id)\n fail ArgumentError, \"invalid value for \\\"class_id\\\", must be one of #{validator.allowable_values}.\"\n end\n @class_id = class_id\n end",
"def assert_white_list_setter(clazz, attr, value, whitelist_clazz)\n instance = clazz.new(attr => value)\n assert_kind_of whitelist_clazz, instance.send(attr)\n assert_equal value, instance.send(attr).value\n end",
"def allow_value_matcher; end",
"def raise_invalid(value)\n if value.is_a?(Numeric)\n raise EnumError, \"#{value.inspect} is out of bounds of #{self.class.name}\"\n else\n raise EnumError, \"#{value.inspect} is not valid for #{self.class.name}\"\n end\n end",
"def valid_parameter_for_conditional_formatting\n [\n :type,\n :format,\n :criteria,\n :value,\n :minimum,\n :maximum,\n :min_type,\n :mid_type,\n :max_type,\n :min_value,\n :mid_value,\n :max_value,\n :min_color,\n :mid_color,\n :max_color,\n :bar_color\n ]\n end",
"def valid_parameter_for_conditional_formatting\n %i[\n type\n format\n criteria\n value\n minimum\n maximum\n stop_if_true\n min_type\n mid_type\n max_type\n min_value\n mid_value\n max_value\n min_color\n mid_color\n max_color\n bar_color\n bar_negative_color\n bar_negative_color_same\n bar_solid\n bar_border_color\n bar_negative_border_color\n bar_negative_border_color_same\n bar_no_border\n bar_direction\n bar_axis_position\n bar_axis_color\n bar_only\n icon_style\n reverse_icons\n icons_only\n icons\n data_bar_2010\n ]\n end",
"def oil_types=(vals = [])\n if vals.is_a?(Array)\n OilTypes.collect {|t| t[1]}.each do |type|\n if vals.member?(type)\n send(type+\"=\",true)\n else\n send(type+\"=\",false)\n end\n end\n end\n end",
"def validate_enum_name(name)\n name.gsub(/[-\\s]/, \"_\").sub(/^\\d/, '_\\0')\n end",
"def sr_iov=(sr_iov)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(sr_iov)\n fail ArgumentError, \"invalid value for \\\"sr_iov\\\", must be one of #{validator.allowable_values}.\"\n end\n @sr_iov = sr_iov\n end",
"def appearance=(appearance)\n validator = EnumAttributeValidator.new('String', [\"Default\", \"BoundingBox\", \"Tags\", \"Hidden\"])\n if appearance.to_i == 0\n unless validator.valid?(appearance)\n raise ArgumentError, \"invalid value for 'appearance', must be one of #{validator.allowable_values}.\"\n end\n @appearance = appearance\n else\n @appearance = validator.allowable_values[appearance.to_i]\n end\n end",
"def validate_entities!(enum)\n unless enum.respond_to?(:each)\n raise Errors::InternalError, 'Validation cannot be performed on non-enumerable objects'\n end\n enum.each(&:valid!)\n enum\n rescue ::Occi::Core::Errors::MandatoryArgumentError, ::Occi::Core::Errors::ValidationError => ex\n logger.error \"Validation failed: #{ex.class} #{ex.message}\"\n raise Errors::ValidationError, ex.message\n end",
"def attr_bool_writer *symbols\n attr_writer *symbols\n end",
"def valid?\n frequency_validator = EnumAttributeValidator.new('String', [\"daily\", \"weekly\", \"monthly\", \"quarterly\", \"yearly\"])\n return false unless frequency_validator.valid?(@frequency)\n return true\n end",
"def valid_attributes\n {\n name: \"Unlimited\",\n award_title_name: \"10k Unlimited\",\n scoring_class: \"Freestyle\"\n }\n end",
"def should_allow_values(options)\n klass = self.name.gsub(/Test$/, '').constantize\n\n context \"#{klass}\" do\n options.each_pair do |attribute, values|\n [*values].each do |value|\n display_value = value.class == NilClass ? \"nil\" : \"\\\"#{value}\\\"\"\n \n should \"allow #{attribute} to be #{display_value}\" do\n instance = get_instance_of(klass)\n instance.send(\"#{attribute}=\", value)\n assert_nil instance.errors.on(attribute), \n \"Expected no errors when #{attribute} is set to #{display_value}, \n instead found error \\\"#{instance.errors.on(attribute)}\\\".\"\n end\n end\n end\n end\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_number_value(\"offsetInDays\", @offset_in_days)\n writer.write_enum_value(\"timeBasedAttribute\", @time_based_attribute)\n end",
"def gr_append_check? obj\n return false if obj.class!=self.class\n return false if !respond_to(\"each\")\n myEnum=to_enum\n objEnum=obj.to_enum\n while true\n begin\n myEle=myEnum.next\n rescue\n return true\n end\n begin\n objEle=objEnum.next\n rescue\n return false\n end\n return false if myEle!=objEle\n end\n return true\n end",
"def validate( value )\n raise ReadOnlyException.new(self) unless settable?\n @definition.type.validate(value)\n end",
"def valid?\n only_display_validator = EnumAttributeValidator.new('String', [\"DoNotDisplay\", \"Closed30Days\", \"Closed60Days\", \"Closed90Days\", \"Closed120Days\", \"AllClosed\"])\n return false unless only_display_validator.valid?(@only_display)\n return true\n end",
"def patrol_scrub=(patrol_scrub)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"disabled\", \"Enable at End of POST\", \"enabled\"])\n unless validator.valid?(patrol_scrub)\n fail ArgumentError, \"invalid value for \\\"patrol_scrub\\\", must be one of #{validator.allowable_values}.\"\n end\n @patrol_scrub = patrol_scrub\n end",
"def _class=(_class)\n validator = EnumAttributeValidator.new('String', [\"Other\", \"Absolute\", \"Possessory\", \"Qualified\", \"Good\"])\n unless validator.valid?(_class)\n fail ArgumentError, \"invalid value for '_class', must be one of #{validator.allowable_values}.\"\n end\n @_class = _class\n end",
"def valid?\n return false if !super\n quartile_method_validator = EnumAttributeValidator.new('String', ['Exclusive', 'Inclusive'])\n return false unless quartile_method_validator.valid?(@quartile_method)\n true\n end"
] | [
"0.7088127",
"0.64820594",
"0.6429773",
"0.6227689",
"0.61418885",
"0.5809922",
"0.57507086",
"0.5743216",
"0.5736045",
"0.5708027",
"0.57014966",
"0.56777334",
"0.5601988",
"0.55947953",
"0.55464065",
"0.55371004",
"0.55344343",
"0.5528221",
"0.5434983",
"0.54312384",
"0.5418137",
"0.5379602",
"0.53794384",
"0.53794384",
"0.53653747",
"0.53513694",
"0.53364015",
"0.5330548",
"0.5324624",
"0.53222466",
"0.5307476",
"0.53004855",
"0.52841866",
"0.52784383",
"0.52683413",
"0.5265264",
"0.525289",
"0.52094126",
"0.5189669",
"0.5185224",
"0.51700306",
"0.5146029",
"0.51444733",
"0.51369494",
"0.5134045",
"0.5133414",
"0.5130944",
"0.51203525",
"0.5117331",
"0.5108703",
"0.5108653",
"0.5106191",
"0.50937504",
"0.50937504",
"0.50840217",
"0.5082524",
"0.5074987",
"0.50655115",
"0.5064211",
"0.505987",
"0.50555235",
"0.50513357",
"0.5044483",
"0.5041556",
"0.5036054",
"0.5031193",
"0.5023556",
"0.5019361",
"0.49934402",
"0.4989093",
"0.49836317",
"0.49754748",
"0.49738207",
"0.49702868",
"0.49647367",
"0.49602023",
"0.4959052",
"0.49577102",
"0.49549797",
"0.49535498",
"0.49489576",
"0.49489233",
"0.4943718",
"0.494183",
"0.494042",
"0.4935984",
"0.49353147",
"0.4934332",
"0.49269903",
"0.49202663",
"0.49195725",
"0.49171844",
"0.49135497",
"0.49132174",
"0.4910008",
"0.49098906",
"0.49096495",
"0.49090025",
"0.49080157",
"0.49024847",
"0.49014568"
] | 0.0 | -1 |
Custom attribute writer method checking allowed values (enum). | def compensation_method=(compensation_method)
validator = EnumAttributeValidator.new('String', ["full_refund", "prorated_refund", "full_credit", "prorated_credit", "none"])
unless validator.valid?(compensation_method)
fail ArgumentError, "invalid value for 'compensation_method', must be one of #{validator.allowable_values}."
end
@compensation_method = compensation_method
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write_attribute_with_enum(attr, value)\n write_attribute_without_enum attr, converted_enum(attr, value)\n end",
"def attr_enum(name, enum, options={}, &block)\n raise ArgumentError, 'enum' unless enum && enum.respond_to?(:values)\n\n options = {\n :enum => enum,\n :validate => true\n }.merge(options)\n\n required = options[:required] == true\n converter = block_given? ? block : Converters.converter_for(:enum, options)\n\n attr_reader_with_converter name, converter, options\n\n validates name,\n :allow_blank => !required,\n :allow_nil => !required,\n :inclusion => { :in => enum.values } if options[:validate]\n\n attr_writer name\n\n add_attr(name, :enum, converter, options)\n end",
"def _attribute_enum?(attr)\n return false unless self.class.respond_to?(:defined_enums)\n self.class.defined_enums.with_indifferent_access.include?(attr)\n end",
"def nature_of_business=(nature_of_business)\n validator = EnumAttributeValidator.new('String', [\"personal\", \"agriculture_and_hunting\", \"forestry\", \"fishing\", \"agricultural_by_products\", \"coal_mining\", \"oil_mining\", \"iron_ore_mining\", \"other_metal_and_diamond_mining\", \"other_mineral_mining\", \"manufacturing_of_food_drink_tobacco\", \"manufacturing_of_textiles_leather_fur_furniture\", \"manufacture_of_wooden_products_furniture\", \"manufacture_of_paper_pulp_allied_products\", \"manufacture_of_chemicals_medical_petroleum_rubber_plastic_products\", \"manufacture_of_pottery_china_glass_stone\", \"manufacture_of_iron_steel_non_ferrous_metals_basic_industries\", \"manufacture_of_metal_products_electrical_and_scientific_engineering\", \"manufacture_of_jewelry_musical_instruments_toys\", \"electricity_gas_and_water\", \"construction\", \"wholesale_trade\", \"retail_trade\", \"catering_incl_hotels\", \"transport_storage\", \"communications\", \"finance_and_holding_companies\", \"insurance\", \"business_services\", \"real_estate_development_investment\", \"central_state_governments\", \"community_services_defence_police_prisons_etc\", \"social_services_education_health_care\", \"personal_services_leisure_services\", \"personal_services_domestic_laundry_repairs\", \"personal_services_embassies_international_organisations\"])\n unless validator.valid?(nature_of_business) || nature_of_business.empty?\n fail ArgumentError, \"invalid value for \\\"nature_of_business\\\", must be one of #{validator.allowable_values}.\"\n end\n @nature_of_business = nature_of_business\n end",
"def valid?\n type_validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n return false unless type_validator.valid?(@type)\n subtype_validator = EnumAttributeValidator.new('String', ['None', 'Across', 'Bottom', 'BottomLeft', 'BottomRight', 'Center', 'Clockwise', 'CounterClockwise', 'GradualAndCycleClockwise', 'GradualAndCycleCounterClockwise', 'Down', 'DownLeft', 'DownRight', 'FontAllCaps', 'FontBold', 'FontItalic', 'FontShadow', 'FontStrikethrough', 'FontUnderline', 'Gradual', 'Horizontal', 'HorizontalIn', 'HorizontalOut', 'In', 'InBottom', 'InCenter', 'InSlightly', 'Instant', 'Left', 'OrdinalMask', 'Out', 'OutBottom', 'OutCenter', 'OutSlightly', 'Right', 'Slightly', 'Top', 'TopLeft', 'TopRight', 'Up', 'UpLeft', 'UpRight', 'Vertical', 'VerticalIn', 'VerticalOut', 'Wheel1', 'Wheel2', 'Wheel3', 'Wheel4', 'Wheel8'])\n return false unless subtype_validator.valid?(@subtype)\n preset_class_type_validator = EnumAttributeValidator.new('String', ['Entrance', 'Exit', 'Emphasis', 'Path', 'MediaCall', 'OLEActionVerbs'])\n return false unless preset_class_type_validator.valid?(@preset_class_type)\n return false if @shape_index.nil?\n trigger_type_validator = EnumAttributeValidator.new('String', ['AfterPrevious', 'OnClick', 'WithPrevious'])\n return false unless trigger_type_validator.valid?(@trigger_type)\n restart_validator = EnumAttributeValidator.new('String', ['Always', 'WhenNotActive', 'Never', 'NotDefined'])\n return false unless restart_validator.valid?(@restart)\n after_animation_type_validator = EnumAttributeValidator.new('String', ['DoNotDim', 'Color', 'HideAfterAnimation', 'HideOnNextMouseClick'])\n return false unless after_animation_type_validator.valid?(@after_animation_type)\n true\n end",
"def enum_attr?(name)\n return false unless @enum_attrs\n @enum_attrs.key?(name)\n end",
"def classy_enum_attr(attribute, options={})\n enum = (options[:class_name] || options[:enum] || attribute).to_s.camelize.constantize\n allow_blank = options[:allow_blank] || false\n allow_nil = options[:allow_nil] || false\n default = ClassyEnum._normalize_default(options[:default], enum)\n\n # Add ActiveRecord validation to ensure it won't be saved unless it's an option\n validates_inclusion_of attribute,\n in: enum,\n allow_blank: allow_blank,\n allow_nil: allow_nil\n\n # Use a module so that the reader methods can be overridden in classes and\n # use super to get the enum value.\n mod = Module.new do\n\n # Define getter method that returns a ClassyEnum instance\n define_method attribute do\n enum.build(read_attribute(attribute), owner: self)\n end\n\n # Define setter method that accepts string, symbol, instance or class for member\n define_method \"#{attribute}=\" do |value|\n value = ClassyEnum._normalize_value(value, default, (allow_nil || allow_blank))\n super(value)\n end\n\n define_method :save_changed_attribute do |attr_name, arg|\n if attribute.to_s == attr_name.to_s && !attribute_changed?(attr_name)\n arg = enum.build(arg)\n current_value = clone_attribute_value(:read_attribute, attr_name)\n\n if arg != current_value\n if respond_to?(:set_attribute_was, true)\n set_attribute_was(attr_name, enum.build(arg, owner: self))\n else\n changed_attributes[attr_name] = enum.build(current_value, owner: self)\n end\n end\n else\n super(attr_name, arg)\n end\n end\n end\n\n include mod\n\n # Initialize the object with the default value if it is present\n # because this will let you store the default value in the\n # database and make it searchable.\n if default.present?\n after_initialize do\n value = read_attribute(attribute)\n\n if (value.blank? && !(allow_blank || allow_nil)) || (value.nil? && !allow_nil)\n send(\"#{attribute}=\", default)\n end\n end\n end\n\n end",
"def is_enum_param(name)\n [\"bookmarkType\", \"order\", \"role\"].include?(name)\n end",
"def valid?\n ENUM.include? @type.downcase.to_sym\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end",
"def set_enum_attrs(subset)\n raise ArgumentError, \"attrs is not a proper subset of available values\" unless subset.all? { |attr| attrs.include? attr }\n @enum_attrs = subset\n end",
"def country=(country)\n validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n unless validator.valid?(country)\n fail ArgumentError, \"invalid value for 'country', must be one of #{validator.allowable_values}.\"\n end\n @country = country\n end",
"def check_option!(name, definition)\n case name\n when :values\n raise AttributorException, \"Allowed set of values requires an array. Got (#{definition})\" unless definition.is_a? ::Array\n when :default\n raise AttributorException, \"Default value doesn't have the correct attribute type. Got (#{definition.inspect})\" unless type.valid_type?(definition) || definition.is_a?(Proc)\n options[:default] = load(definition) unless definition.is_a?(Proc)\n when :description\n raise AttributorException, \"Description value must be a string. Got (#{definition})\" unless definition.is_a? ::String\n when :required\n raise AttributorException, 'Required must be a boolean' unless definition == true || definition == false\n raise AttributorException, 'Required cannot be enabled in combination with :default' if definition == true && options.key?(:default)\n when :required_if\n raise AttributorException, 'Required_if must be a String, a Hash definition or a Proc' unless definition.is_a?(::String) || definition.is_a?(::Hash) || definition.is_a?(::Proc)\n raise AttributorException, 'Required_if cannot be specified together with :required' if options[:required]\n when :example\n unless definition.is_a?(::Regexp) || definition.is_a?(::String) || definition.is_a?(::Array) || definition.is_a?(::Proc) || definition.nil? || type.valid_type?(definition)\n raise AttributorException, \"Invalid example type (got: #{definition.class.name}). It must always match the type of the attribute (except if passing Regex that is allowed for some types)\"\n end\n when :custom_data\n raise AttributorException, \"custom_data must be a Hash. Got (#{definition})\" unless definition.is_a?(::Hash)\n else\n return :unknown # unknown option\n end\n\n :ok # passes\n end",
"def define_active_enum_write_method(attribute)\n class_eval <<-DEF\n def #{attribute}=(arg)\n if arg.is_a?(Symbol)\n super(self.class.active_enum_for(:#{attribute})[arg])\n else\n super\n end\n end\n DEF\n end",
"def check_enum(validation:, key:, schema:)\n return false if !validation[:required] && schema.nil? # Optional and not here, dont check\n return false unless validation[:values]\n return false if validation[:values].include?(schema)\n\n schema = 'nothing' if schema.nil?\n error! key, \"must be one of #{validation[:values].join(', ')}, but was #{schema}\"\n true\n end",
"def should_allow_values_for(attribute, *good_values)\n get_options!(good_values)\n good_values.each do |value|\n matcher = allow_value(value).for(attribute)\n should matcher.description do\n assert_accepts matcher, subject\n end\n end\n end",
"def validate_exclusion_of(attr); end",
"def valid_attribute_types\n\t\treturn self.must_attribute_types |\n\t\t self.may_attribute_types |\n\t\t self.operational_attribute_types\n\tend",
"def valid?\n status_validator = EnumAttributeValidator.new('String', [\"ACTIVE\", \"INACTIVE\"])\n return false unless status_validator.valid?(@status)\n country_validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n return false unless country_validator.valid?(@country)\n currency_validator = EnumAttributeValidator.new('String', [\"UNKNOWN_CURRENCY\", \"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n return false unless currency_validator.valid?(@currency)\n type_validator = EnumAttributeValidator.new('String', [\"PHYSICAL\", \"MOBILE\"])\n return false unless type_validator.valid?(@type)\n return true\n end",
"def update_allowed_values\n self.url_allowed = true if url_required\n self.description_allowed = true if description_required\n self.title_allowed = true if title_required\n\n TagSet::TAG_TYPES.each do |tag_type|\n required = eval(\"#{tag_type}_num_required\") || eval(\"self.#{tag_type}_num_required\") || 0\n allowed = eval(\"#{tag_type}_num_allowed\") || eval(\"self.#{tag_type}_num_allowed\") || 0\n if required > allowed\n eval(\"self.#{tag_type}_num_allowed = required\")\n end\n end\n end",
"def test_valid?\n assert_raise( RuntimeError ) { Tui::Model::Enum.new( 'lab1', { }, 1 ) }\n base = Tui::Model::Enum.new( 'lab1', { 'val1' => '1', 'val99' => '99' }, 'val99' )\n assert_false base.valid?( 1 )\n assert_true base.valid?( \"val1\" )\n ex = assert_raise( RuntimeError ) { base.value = 1; }\n assert_equal( 'Invalid value for model type Tui::Model::Enum!', ex.message )\n end",
"def validate_may_attributes\n\t\thash = (self.entry || {} ).merge( @values )\n\t\tattributes = hash.keys.map( &:to_sym ).uniq\n\t\tvalid_attributes = self.valid_attribute_oids +\n\t\t\tself.operational_attribute_oids +\n\t\t\tIGNORED_OPERATIONAL_ATTRS\n\n\t\tself.log.debug \"Validating MAY attributes: %p against the list of valid OIDs: %p\" %\n\t\t\t[ attributes, valid_attributes ]\n\t\tunknown_attributes = attributes - valid_attributes\n\t\tunknown_attributes.each do |oid|\n\t\t\tself.errors.add( oid, \"is not allowed by entry's objectClasses\" )\n\t\tend\n\tend",
"def allowed_attributes=(_arg0); end",
"def allowed_attributes=(_arg0); end",
"def validate_range(key, value, enum_values)\n values = value.instance_of?(Array) ? value : [value]\n values.each do |v|\n add_templated_error(key, \"'#{v}' is not a valid setting for '#{template.name_for(key)}'\") unless enum_values.include?(v)\n end\n end",
"def valid?\n return false if @class_id.nil?\n class_id_validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n return false unless class_id_validator.valid?(@class_id)\n return false if @object_type.nil?\n object_type_validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n return false unless object_type_validator.valid?(@object_type)\n true\n end",
"def allowed_values(value, pdef)\n if(pdef['AllowedValues'].include?(value))\n true\n else\n \"Not an allowed value: #{pdef['AllowedValues'].join(', ')}\"\n end\n end",
"def allowed_to_write(name)\n # no point allowing attribute writes if we can't save them?\n if allowed_to_save\n name = name.to_s\n validation_methods = self.class.write_validations(name) \n if validation_methods.nil?\n # We haven't registered any filters on this attribute, so allow the write.\n true\n elsif validation_methods.check :accessor => accessor, :model => self\n # One of the authentication methods worked, so allow the write.\n true\n else\n # We had filters but none of them passed. Disallow write.\n false\n end\n else\n false\n end\n end",
"def status_enum=(status)\n write_attribute(:status, status)\n end",
"def setting_attribute_is_allowed?(name, user)\n return false unless user.can_write?(self, name)\n (self.whitelisted_attributes && self.whitelisted_attributes.has_key?( name.to_sym)) ||\n (\n self.attribute_names.include?( name.to_s ) &&\n ( self.blacklisted_attributes.nil? ||\n ! self.blacklisted_attributes.has_key?( name.to_sym ) )\n )\n end",
"def valid?\n return false if !super\n status_validator = EnumAttributeValidator.new('String', ['NotDefined', 'Active', 'Resolved', 'Closed'])\n return false unless status_validator.valid?(@status)\n true\n end",
"def valid?\n MANDATORY_ATTRIBUTES[type].each{|a| return false unless self[a]}\n true\n end",
"def valid?\n return false if !super\n return false if @style.nil?\n style_validator = EnumAttributeValidator.new('String', ['Unknown', 'Percent05', 'Percent10', 'Percent20', 'Percent25', 'Percent30', 'Percent40', 'Percent50', 'Percent60', 'Percent70', 'Percent75', 'Percent80', 'Percent90', 'DarkHorizontal', 'DarkVertical', 'DarkDownwardDiagonal', 'DarkUpwardDiagonal', 'SmallCheckerBoard', 'Trellis', 'LightHorizontal', 'LightVertical', 'LightDownwardDiagonal', 'LightUpwardDiagonal', 'SmallGrid', 'DottedDiamond', 'WideDownwardDiagonal', 'WideUpwardDiagonal', 'DashedUpwardDiagonal', 'DashedDownwardDiagonal', 'NarrowVertical', 'NarrowHorizontal', 'DashedVertical', 'DashedHorizontal', 'LargeConfetti', 'LargeGrid', 'HorizontalBrick', 'LargeCheckerBoard', 'SmallConfetti', 'Zigzag', 'SolidDiamond', 'DiagonalBrick', 'OutlinedDiamond', 'Plaid', 'Sphere', 'Weave', 'DottedGrid', 'Divot', 'Shingle', 'Wave', 'Horizontal', 'Vertical', 'Cross', 'DownwardDiagonal', 'UpwardDiagonal', 'DiagonalCross', 'NotDefined'])\n return false unless style_validator.valid?(@style)\n true\n end",
"def enum?(field)\n !!self.enums[field.to_sym]\n end",
"def currency=(currency)\n validator = EnumAttributeValidator.new('String', [\"UNKNOWN_CURRENCY\", \"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n unless validator.valid?(currency)\n fail ArgumentError, \"invalid value for 'currency', must be one of #{validator.allowable_values}.\"\n end\n @currency = currency\n end",
"def enum_defined_for?(attribute)\n context = self.eh_params[:enum_contexts][attribute.to_s]\n !!(eh_params[:db_codes][context] && eh_params[:db_codes][context][attribute.to_s])\n # Returns true if the indicated attribute has an enum defined\n end",
"def object_type=(object_type)\n validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n unless validator.valid?(object_type)\n fail ArgumentError, \"invalid value for \\\"object_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @object_type = object_type\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', [\"\", \"APIC\", \"DCNM\", \"UCSFI\", \"UCSFIISM\", \"IMC\", \"IMCM4\", \"IMCM5\", \"IMCRack\", \"UCSIOM\", \"HX\", \"HyperFlexAP\", \"IWE\", \"UCSD\", \"IntersightAppliance\", \"IntersightAssist\", \"PureStorageFlashArray\", \"UCSC890\", \"NetAppOntap\", \"NetAppActiveIqUnifiedManager\", \"EmcScaleIo\", \"EmcVmax\", \"EmcVplex\", \"EmcXtremIo\", \"VmwareVcenter\", \"MicrosoftHyperV\", \"AppDynamics\", \"Dynatrace\", \"NewRelic\", \"ServiceNow\", \"ReadHatOpenStack\", \"CloudFoundry\", \"MicrosoftAzureApplicationInsights\", \"OpenStack\", \"MicrosoftSqlServer\", \"Kubernetes\", \"AmazonWebService\", \"AmazonWebServiceBilling\", \"MicrosoftAzureServicePrincipal\", \"MicrosoftAzureEnterpriseAgreement\", \"DellCompellent\", \"HPE3Par\", \"RedHatEnterpriseVirtualization\", \"NutanixAcropolis\", \"HPEOneView\", \"ServiceEngine\", \"HitachiVirtualStoragePlatform\", \"IMCBlade\", \"TerraformCloud\", \"TerraformAgent\", \"CustomTarget\", \"AnsibleEndpoint\", \"HTTPEndpoint\", \"SSHEndpoint\", \"CiscoCatalyst\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end",
"def compliance=(compliance)\n validator = EnumAttributeValidator.new('String', ['Pdf15', 'PdfA1b'])\n unless validator.valid?(compliance)\n fail ArgumentError, 'invalid value for \"compliance\", must be one of #{validator.allowable_values}.'\n end\n @compliance = compliance\n end",
"def supports_polymorphic_enum_handling(attribute_name)\n self.eh_params[:polymorphic_attribute] = \"#{attribute_name}_type\".to_sym\n end",
"def should_deny_values(options)\n klass = self.name.gsub(/Test$/, '').constantize\n\n context \"#{klass}\" do\n options.each_pair do |attribute, values|\n [*values].each do |value|\n display_value = value.class == NilClass ? \"nil\" : \"\\\"#{value}\\\"\"\n \n should \"not allow #{attribute} to be #{display_value}\" do\n instance = get_instance_of(klass)\n instance.send(\"#{attribute}=\", value)\n assert !instance.valid?, \n \"Expected #{klass} to be invalid when #{attribute} is set to #{display_value}\"\n assert instance.errors.on(attribute.to_sym), \n \"Expected errors on #{attribute} when set to #{display_value}\"\n end\n end\n end\n end\n end",
"def enum?\n true\n end",
"def kind=(kind)\n validator = EnumAttributeValidator.new('String', [\"UNKNOWN\", \"USER_CREATED\", \"INTERNAL\"])\n unless validator.valid?(kind)\n fail ArgumentError, \"invalid value for \\\"kind\\\", must be one of #{validator.allowable_values}.\"\n end\n @kind = kind\n end",
"def validate_attribute_syntax\n\t\[email protected] do |attribute, values|\n\t\t\t[ values ].flatten.each do |value|\n\t\t\t\tbegin\n\t\t\t\t\tself.get_converted_attribute( attribute.to_sym, value )\n\t\t\t\trescue => err\n\t\t\t\t\tself.log.error \"validation for %p failed: %s: %s\" %\n\t\t\t\t\t\t[ attribute, err.class.name, err.message ]\n\t\t\t\t\tattrtype = self.find_attribute_type( attribute )\n\t\t\t\t\tself.errors.add( attribute, \"isn't a valid %s value\" %\n\t\t\t\t\t\t[ attrtype.syntax ? attrtype.syntax.desc : attrtype.syntax_oid ] )\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"def valid?\n return false if @name.nil?\n return false if @name.to_s.length > 25\n return false if @based_on.nil?\n based_on_validator = EnumAttributeValidator.new('String', [\"MyCalendar\", \"Customer\", \"AllHours\", \"Custom\"])\n return false unless based_on_validator.valid?(@based_on)\n return false if !@application_order.nil? && @application_order > 32767\n return false if !@application_order.nil? && @application_order < 1\n return false if !@respond_hours.nil? && @respond_hours > 999\n return false if !@respond_hours.nil? && @respond_hours < 0\n return false if !@respond_percent.nil? && @respond_percent > 99999\n return false if !@respond_percent.nil? && @respond_percent < 0\n return false if !@plan_within.nil? && @plan_within > 999\n return false if !@plan_within.nil? && @plan_within < 0\n return false if !@plan_within_percent.nil? && @plan_within_percent > 99999\n return false if !@plan_within_percent.nil? && @plan_within_percent < 0\n return false if !@resolution_hours.nil? && @resolution_hours > 999\n return false if !@resolution_hours.nil? && @resolution_hours < 0\n return false if !@resolution_percent.nil? && @resolution_percent > 99999\n return false if !@resolution_percent.nil? && @resolution_percent < 0\n return true\n end",
"def valid?\n policy_validator = EnumAttributeValidator.new('Object', ['RMF', 'DIACAP', 'Reporting'])\n return false unless policy_validator.valid?(@policy)\n registration_type_validator = EnumAttributeValidator.new('Object', ['Assess and Authorize', 'Assess Only', 'Guest', 'Regular', 'Functional', 'Cloud Service Provider'])\n return false unless registration_type_validator.valid?(@registration_type)\n organization_name_validator = EnumAttributeValidator.new('Object', ['Army', 'Navy', 'Air Force', 'Marines', 'DoD', 'Defense Information Systems Agency'])\n return false unless organization_name_validator.valid?(@organization_name)\n system_type_validator = EnumAttributeValidator.new('Object', ['IS Major Application', 'IS Enclave', 'Platform IT', 'Platform IT System', 'Interconnection', 'AIS Application'])\n return false unless system_type_validator.valid?(@system_type)\n authorization_status_validator = EnumAttributeValidator.new('Object', ['Authority to Operate (ATO)', 'Interim Authority to Operate (IATO)', 'Interim Authority to Test (IATT)', 'Authority to Operate with Conditions (ATO) w/Conditions)', 'Denied Authority to Operate (DATO)', 'Not Yet Authorized', 'Unaccredited', 'Decommissioned'])\n return false unless authorization_status_validator.valid?(@authorization_status)\n confidentiality_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless confidentiality_validator.valid?(@confidentiality)\n integrity_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless integrity_validator.valid?(@integrity)\n availability_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless availability_validator.valid?(@availability)\n mac_validator = EnumAttributeValidator.new('Object', ['I', 'II', 'III'])\n return false unless mac_validator.valid?(@mac)\n dod_confidentiality_validator = EnumAttributeValidator.new('Object', ['Public', 'Sensitive', 'Classified'])\n return false unless dod_confidentiality_validator.valid?(@dod_confidentiality)\n true\n end",
"def enum?\n false\n end",
"def unassignable_value_for(attr)\n case attr.type\n when :integer\n attr.assignable_values.max + 1\n when :string\n assignable_value_for(attr) + '-unassignable'\n else\n raise \"Assignable values for :#{attr.type} attributes not supported\"\n end\n end",
"def define_value_methods!\n self.accepted_values.each do |(name, bit)|\n self.meta_class.class_eval <<-FLAG_METHODS\n\n def #{name}\n ((@value || 0) & #{bit}) != 0\n end\n alias :#{name}? :#{name}\n\n def #{name}=(new_value)\n boolean = self.to_boolean(new_value)\n current = self.#{name}\n if boolean ^ current\n self.value = ((@value || 0) ^ #{bit})\n end\n self.#{name}\n end\n\n FLAG_METHODS\n end\n end",
"def update_enum_attribute(database_id:, collection_id:, key:, elements:, required:, default:)\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'\n .gsub('{databaseId}', database_id)\n .gsub('{collectionId}', collection_id)\n .gsub('{key}', key)\n\n if database_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"databaseId\"')\n end\n\n if collection_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"collectionId\"')\n end\n\n if key.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"key\"')\n end\n\n if elements.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"elements\"')\n end\n\n if required.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"required\"')\n end\n\n if default.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"default\"')\n end\n\n params = {\n elements: elements,\n required: required,\n default: default,\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'PATCH',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::AttributeEnum\n )\n end",
"def replace_enumerations_in_hash(attrs, allow_multiple = true) #:nodoc:\n attrs.each do |attr, value|\n if options = enumerator_options_for(attr, value, allow_multiple)\n attrs.delete(attr)\n attrs.merge!(options)\n end\n end\n end",
"def as_enum\n # Should look like:\n # enum attribute_name: [\"one\", \"two\"]\n\n if is_enum?\n if (enum_options = properties[:enum_options]).present?\n enum_options_as_hash = Frontier::HashSingleLineDecorator.new array_as_hash(enum_options)\n \"enum #{name}: {#{enum_options_as_hash}}\"\n else\n raise(ArgumentError, \"No enum_options provided for attribute: #{name}\")\n end\n else\n raise(ArgumentError, \"Attempting to display field #{name} as enum, but is #{type}\")\n end\n end",
"def validate_marital_status(val)\n unless @valid_marital_statuses.include?(val)\n raise \"Invalid value: #{val}\"\n end\n end",
"def validate_marital_status(val)\n unless @valid_marital_statuses.include?(val)\n raise \"Invalid value: #{val}\"\n end\n end",
"def enumeration?\n @is_enumeration ||= @xml.xpath('./xs:restriction/xs:enumeration', {'xs' => 'http://www.w3.org/2001/XMLSchema'}).length > 0\n end",
"def pa_esigibilita=(pa_esigibilita)\n validator = EnumAttributeValidator.new('String', ['I', 'D', 'S', 'N'])\n unless validator.valid?(pa_esigibilita)\n fail ArgumentError, 'invalid value for \"pa_esigibilita\", must be one of #{validator.allowable_values}.'\n end\n @pa_esigibilita = pa_esigibilita\n end",
"def timeliness_validation_for(attr_names, type)\n super\n attr_names.each { |attr_name| define_timeliness_write_method(attr_name) }\n end",
"def validate_allowed(record)\n unknown = provided(record) - allowed\n\n return if unknown.empty?\n\n record.errors.add(\n options[:attribute],\n \"contains unknown options: #{unknown.join(', ')}\"\n )\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', ['Once', 'Hourly', 'Daily', 'Weekly', 'Monthly', 'Yearly'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end",
"def valid?\n source_validator = EnumAttributeValidator.new('Integer', [\"1\", \"2\"])\n return false unless source_validator.valid?(@source)\n return true\n end",
"def valid?(value)\n return false if self == Enum\n return true if value.equal?(LAZY_VALUE)\n self.values.include?(value.to_s)\n end",
"def smee=(smee)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(smee)\n fail ArgumentError, \"invalid value for \\\"smee\\\", must be one of #{validator.allowable_values}.\"\n end\n @smee = smee\n end",
"def allowed_status\n errors.add(:string, 'must be pending, accepted or declined.') unless %w[pending accepted declined].any?(status)\n end",
"def define_active_enum_write_method_multiple(attribute, column)\n class_eval <<-DEF\n def #{attribute}=(args)\n self.#{column} = args.map do |arg|\n self.class.active_enum_get_id_for_#{attribute}(arg)\n end\n end\n DEF\n end",
"def valid?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"alert\", \"notification\"])\n return false unless type_validator.valid?(@type)\n priority_validator = EnumAttributeValidator.new('String', [\"P1\", \"P2\", \"P3\", \"P4\", \"P5\"])\n return false unless priority_validator.valid?(@priority)\n return true\n end",
"def has_enums?\n !!eh_params[:has_enums]\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', ['active', 'notActive', 'unknown'])\n unless validator.valid?(type)\n fail ArgumentError, %Q'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end",
"def level=(level)\n validator = EnumAttributeValidator.new('String', [\"Unknown\", \"Inline\", \"Block\", \"Row\", \"Cell\"])\n if level.to_i == 0\n unless validator.valid?(level)\n raise ArgumentError, \"invalid value for 'level', must be one of #{validator.allowable_values}.\"\n end\n @level = level\n else\n @level = validator.allowable_values[level.to_i]\n end\n end",
"def mode=(mode)\n validator = EnumAttributeValidator.new('String', [\"default\", \"custom\"])\n unless validator.valid?(mode)\n fail ArgumentError, \"invalid value for 'mode', must be one of #{validator.allowable_values}.\"\n end\n @mode = mode\n end",
"def valid?\n type_validator = EnumAttributeValidator.new('String', ['active', 'notActive', 'unknown'])\n return false unless type_validator.valid?(@type)\n true\n end",
"def allowed_access_levels\n validator = lambda do |field|\n level = public_send(field) || ENABLED # rubocop:disable GitlabSecurity/PublicSend\n not_allowed = level > ENABLED\n self.errors.add(field, \"cannot have public visibility level\") if not_allowed\n end\n\n (FEATURES - %i(pages)).each {|f| validator.call(\"#{f}_access_level\")}\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Paragraph\", \"Character\", \"Table\", \"List\"])\n if type.to_i == 0\n unless validator.valid?(type)\n raise ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n else\n @type = validator.allowable_values[type.to_i]\n end\n end",
"def legal_entity_type=(legal_entity_type)\n validator = EnumAttributeValidator.new('String', [\"sole_proprietorship\", \"partnership\", \"privately_owned_company\", \"publicly_owned_company\", \"government_owned_entity\", \"trust\", \"ngo\", \"club_and_society\", \"go\", \"other\", \"financial_institution\", \"mto\"])\n unless validator.valid?(legal_entity_type) || legal_entity_type.empty?\n fail ArgumentError, \"invalid value for \\\"legal_entity_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @legal_entity_type = legal_entity_type\n end",
"def all_attributes_exists_with_enumerations?(attribute_names)\n exists = all_attributes_exists_without_enumerations?(attribute_names)\n exists ||= attribute_names.all? do |name|\n column_methods_hash.include?(name.to_sym) || reflect_on_enumeration(name)\n end\n end",
"def valid_setters\n methods = ScheduledActivity.instance_methods\n @valid_setters ||= methods.select do |m|\n methods.include?(:\"#{m}=\")\n end\n end",
"def valid?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"ITEM\", \"CATEGORY\", \"ITEM_VARIATION\", \"TAX\", \"DISCOUNT\", \"MODIFIER_LIST\", \"MODIFIER\"])\n return false unless type_validator.valid?(@type)\n return false if @id.nil?\n return false if @id.to_s.length < 1\n return true\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Weekly\", \"BiWeekly\", \"SemiMonthly\", \"Monthly\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end",
"def valid?\n return false if @value.nil?\n change_mode_validator = EnumAttributeValidator.new('String', [\"immediate\", \"delayed\"])\n return false unless change_mode_validator.valid?(@change_mode)\n invoicing_type_validator = EnumAttributeValidator.new('String', [\"Immediate\", \"Aggregated\"])\n return false unless invoicing_type_validator.valid?(@invoicing_type)\n return true\n end",
"def valid?\n type_validator = EnumAttributeValidator.new('String', [\"person\", \"business\"])\n return false unless type_validator.valid?(@type)\n return false if @country.nil?\n return false if @street.nil?\n return false if @postal_code.nil?\n return false if @city.nil?\n return false if @email.nil?\n return false if @ip.nil?\n identification_type_validator = EnumAttributeValidator.new('String', [\"DL\", \"PP\", \"ID\", \"OT\"])\n return false unless identification_type_validator.valid?(@identification_type)\n legal_entity_type_validator = EnumAttributeValidator.new('String', [\"sole_proprietorship\", \"partnership\", \"privately_owned_company\", \"publicly_owned_company\", \"government_owned_entity\", \"trust\", \"ngo\", \"club_and_society\", \"go\", \"other\", \"financial_institution\", \"mto\"])\n return false unless legal_entity_type_validator.valid?(@legal_entity_type)\n nature_of_business_validator = EnumAttributeValidator.new('String', [\"personal\", \"agriculture_and_hunting\", \"forestry\", \"fishing\", \"agricultural_by_products\", \"coal_mining\", \"oil_mining\", \"iron_ore_mining\", \"other_metal_and_diamond_mining\", \"other_mineral_mining\", \"manufacturing_of_food_drink_tobacco\", \"manufacturing_of_textiles_leather_fur_furniture\", \"manufacture_of_wooden_products_furniture\", \"manufacture_of_paper_pulp_allied_products\", \"manufacture_of_chemicals_medical_petroleum_rubber_plastic_products\", \"manufacture_of_pottery_china_glass_stone\", \"manufacture_of_iron_steel_non_ferrous_metals_basic_industries\", \"manufacture_of_metal_products_electrical_and_scientific_engineering\", \"manufacture_of_jewelry_musical_instruments_toys\", \"electricity_gas_and_water\", \"construction\", \"wholesale_trade\", \"retail_trade\", \"catering_incl_hotels\", \"transport_storage\", \"communications\", \"finance_and_holding_companies\", \"insurance\", \"business_services\", \"real_estate_development_investment\", \"central_state_governments\", \"community_services_defence_police_prisons_etc\", \"social_services_education_health_care\", \"personal_services_leisure_services\", \"personal_services_domestic_laundry_repairs\", \"personal_services_embassies_international_organisations\"])\n return false unless nature_of_business_validator.valid?(@nature_of_business)\n return false if @documents.nil?\n gender_validator = EnumAttributeValidator.new('String', [\"M\", \"F\", \"O\"])\n return false unless gender_validator.valid?(@gender)\n true\n end",
"def class_id=(class_id)\n validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n unless validator.valid?(class_id)\n fail ArgumentError, \"invalid value for \\\"class_id\\\", must be one of #{validator.allowable_values}.\"\n end\n @class_id = class_id\n end",
"def allow_value_matcher; end",
"def assert_white_list_setter(clazz, attr, value, whitelist_clazz)\n instance = clazz.new(attr => value)\n assert_kind_of whitelist_clazz, instance.send(attr)\n assert_equal value, instance.send(attr).value\n end",
"def raise_invalid(value)\n if value.is_a?(Numeric)\n raise EnumError, \"#{value.inspect} is out of bounds of #{self.class.name}\"\n else\n raise EnumError, \"#{value.inspect} is not valid for #{self.class.name}\"\n end\n end",
"def valid_parameter_for_conditional_formatting\n [\n :type,\n :format,\n :criteria,\n :value,\n :minimum,\n :maximum,\n :min_type,\n :mid_type,\n :max_type,\n :min_value,\n :mid_value,\n :max_value,\n :min_color,\n :mid_color,\n :max_color,\n :bar_color\n ]\n end",
"def valid_parameter_for_conditional_formatting\n %i[\n type\n format\n criteria\n value\n minimum\n maximum\n stop_if_true\n min_type\n mid_type\n max_type\n min_value\n mid_value\n max_value\n min_color\n mid_color\n max_color\n bar_color\n bar_negative_color\n bar_negative_color_same\n bar_solid\n bar_border_color\n bar_negative_border_color\n bar_negative_border_color_same\n bar_no_border\n bar_direction\n bar_axis_position\n bar_axis_color\n bar_only\n icon_style\n reverse_icons\n icons_only\n icons\n data_bar_2010\n ]\n end",
"def validate_enum_name(name)\n name.gsub(/[-\\s]/, \"_\").sub(/^\\d/, '_\\0')\n end",
"def oil_types=(vals = [])\n if vals.is_a?(Array)\n OilTypes.collect {|t| t[1]}.each do |type|\n if vals.member?(type)\n send(type+\"=\",true)\n else\n send(type+\"=\",false)\n end\n end\n end\n end",
"def sr_iov=(sr_iov)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(sr_iov)\n fail ArgumentError, \"invalid value for \\\"sr_iov\\\", must be one of #{validator.allowable_values}.\"\n end\n @sr_iov = sr_iov\n end",
"def appearance=(appearance)\n validator = EnumAttributeValidator.new('String', [\"Default\", \"BoundingBox\", \"Tags\", \"Hidden\"])\n if appearance.to_i == 0\n unless validator.valid?(appearance)\n raise ArgumentError, \"invalid value for 'appearance', must be one of #{validator.allowable_values}.\"\n end\n @appearance = appearance\n else\n @appearance = validator.allowable_values[appearance.to_i]\n end\n end",
"def validate_entities!(enum)\n unless enum.respond_to?(:each)\n raise Errors::InternalError, 'Validation cannot be performed on non-enumerable objects'\n end\n enum.each(&:valid!)\n enum\n rescue ::Occi::Core::Errors::MandatoryArgumentError, ::Occi::Core::Errors::ValidationError => ex\n logger.error \"Validation failed: #{ex.class} #{ex.message}\"\n raise Errors::ValidationError, ex.message\n end",
"def valid?\n frequency_validator = EnumAttributeValidator.new('String', [\"daily\", \"weekly\", \"monthly\", \"quarterly\", \"yearly\"])\n return false unless frequency_validator.valid?(@frequency)\n return true\n end",
"def attr_bool_writer *symbols\n attr_writer *symbols\n end",
"def should_allow_values(options)\n klass = self.name.gsub(/Test$/, '').constantize\n\n context \"#{klass}\" do\n options.each_pair do |attribute, values|\n [*values].each do |value|\n display_value = value.class == NilClass ? \"nil\" : \"\\\"#{value}\\\"\"\n \n should \"allow #{attribute} to be #{display_value}\" do\n instance = get_instance_of(klass)\n instance.send(\"#{attribute}=\", value)\n assert_nil instance.errors.on(attribute), \n \"Expected no errors when #{attribute} is set to #{display_value}, \n instead found error \\\"#{instance.errors.on(attribute)}\\\".\"\n end\n end\n end\n end\n end",
"def valid_attributes\n {\n name: \"Unlimited\",\n award_title_name: \"10k Unlimited\",\n scoring_class: \"Freestyle\"\n }\n end",
"def gr_append_check? obj\n return false if obj.class!=self.class\n return false if !respond_to(\"each\")\n myEnum=to_enum\n objEnum=obj.to_enum\n while true\n begin\n myEle=myEnum.next\n rescue\n return true\n end\n begin\n objEle=objEnum.next\n rescue\n return false\n end\n return false if myEle!=objEle\n end\n return true\n end",
"def valid?\n only_display_validator = EnumAttributeValidator.new('String', [\"DoNotDisplay\", \"Closed30Days\", \"Closed60Days\", \"Closed90Days\", \"Closed120Days\", \"AllClosed\"])\n return false unless only_display_validator.valid?(@only_display)\n return true\n end",
"def validate( value )\n raise ReadOnlyException.new(self) unless settable?\n @definition.type.validate(value)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_number_value(\"offsetInDays\", @offset_in_days)\n writer.write_enum_value(\"timeBasedAttribute\", @time_based_attribute)\n end",
"def patrol_scrub=(patrol_scrub)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"disabled\", \"Enable at End of POST\", \"enabled\"])\n unless validator.valid?(patrol_scrub)\n fail ArgumentError, \"invalid value for \\\"patrol_scrub\\\", must be one of #{validator.allowable_values}.\"\n end\n @patrol_scrub = patrol_scrub\n end",
"def valid?\n return false if !super\n quartile_method_validator = EnumAttributeValidator.new('String', ['Exclusive', 'Inclusive'])\n return false unless quartile_method_validator.valid?(@quartile_method)\n true\n end",
"def _class=(_class)\n validator = EnumAttributeValidator.new('String', [\"Other\", \"Absolute\", \"Possessory\", \"Qualified\", \"Good\"])\n unless validator.valid?(_class)\n fail ArgumentError, \"invalid value for '_class', must be one of #{validator.allowable_values}.\"\n end\n @_class = _class\n end"
] | [
"0.70875543",
"0.6483564",
"0.64317095",
"0.62286377",
"0.614331",
"0.5812138",
"0.5751908",
"0.57455283",
"0.5738135",
"0.57083595",
"0.57014704",
"0.5678817",
"0.56032133",
"0.55945593",
"0.55489385",
"0.553774",
"0.55357426",
"0.5529098",
"0.54367936",
"0.54300535",
"0.5420408",
"0.53795314",
"0.53784907",
"0.53784907",
"0.5367033",
"0.53525007",
"0.5337012",
"0.5328896",
"0.5324079",
"0.53208035",
"0.5309451",
"0.5301472",
"0.5285689",
"0.52807915",
"0.5269443",
"0.52680445",
"0.5253064",
"0.5209882",
"0.51896185",
"0.5186177",
"0.5170568",
"0.51485497",
"0.5144733",
"0.5138324",
"0.51360923",
"0.5134491",
"0.5133354",
"0.5121478",
"0.51169205",
"0.5109288",
"0.51086056",
"0.51077956",
"0.5095501",
"0.5095501",
"0.50859743",
"0.5083176",
"0.50744486",
"0.50654507",
"0.5065322",
"0.50621974",
"0.5058278",
"0.5051417",
"0.5045062",
"0.5041021",
"0.50379544",
"0.5033133",
"0.5023709",
"0.5019678",
"0.49936485",
"0.4990971",
"0.4984205",
"0.49753803",
"0.49737474",
"0.49708977",
"0.49637735",
"0.49611858",
"0.4960119",
"0.49598032",
"0.49557036",
"0.4954298",
"0.49502325",
"0.49472624",
"0.49459928",
"0.49425325",
"0.49410853",
"0.4938176",
"0.4935045",
"0.49347225",
"0.4927444",
"0.49219123",
"0.49186775",
"0.4917121",
"0.4913468",
"0.49129334",
"0.49121353",
"0.49115235",
"0.49096286",
"0.49081546",
"0.49079478",
"0.49028075",
"0.49024263"
] | 0.0 | -1 |
Custom attribute writer method checking allowed values (enum). | def partial_period_handling=(partial_period_handling)
validator = EnumAttributeValidator.new('String', ["bill_full", "bill_prorated", "bill_zero_amount", "no_bill"])
unless validator.valid?(partial_period_handling)
fail ArgumentError, "invalid value for 'partial_period_handling', must be one of #{validator.allowable_values}."
end
@partial_period_handling = partial_period_handling
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write_attribute_with_enum(attr, value)\n write_attribute_without_enum attr, converted_enum(attr, value)\n end",
"def attr_enum(name, enum, options={}, &block)\n raise ArgumentError, 'enum' unless enum && enum.respond_to?(:values)\n\n options = {\n :enum => enum,\n :validate => true\n }.merge(options)\n\n required = options[:required] == true\n converter = block_given? ? block : Converters.converter_for(:enum, options)\n\n attr_reader_with_converter name, converter, options\n\n validates name,\n :allow_blank => !required,\n :allow_nil => !required,\n :inclusion => { :in => enum.values } if options[:validate]\n\n attr_writer name\n\n add_attr(name, :enum, converter, options)\n end",
"def _attribute_enum?(attr)\n return false unless self.class.respond_to?(:defined_enums)\n self.class.defined_enums.with_indifferent_access.include?(attr)\n end",
"def nature_of_business=(nature_of_business)\n validator = EnumAttributeValidator.new('String', [\"personal\", \"agriculture_and_hunting\", \"forestry\", \"fishing\", \"agricultural_by_products\", \"coal_mining\", \"oil_mining\", \"iron_ore_mining\", \"other_metal_and_diamond_mining\", \"other_mineral_mining\", \"manufacturing_of_food_drink_tobacco\", \"manufacturing_of_textiles_leather_fur_furniture\", \"manufacture_of_wooden_products_furniture\", \"manufacture_of_paper_pulp_allied_products\", \"manufacture_of_chemicals_medical_petroleum_rubber_plastic_products\", \"manufacture_of_pottery_china_glass_stone\", \"manufacture_of_iron_steel_non_ferrous_metals_basic_industries\", \"manufacture_of_metal_products_electrical_and_scientific_engineering\", \"manufacture_of_jewelry_musical_instruments_toys\", \"electricity_gas_and_water\", \"construction\", \"wholesale_trade\", \"retail_trade\", \"catering_incl_hotels\", \"transport_storage\", \"communications\", \"finance_and_holding_companies\", \"insurance\", \"business_services\", \"real_estate_development_investment\", \"central_state_governments\", \"community_services_defence_police_prisons_etc\", \"social_services_education_health_care\", \"personal_services_leisure_services\", \"personal_services_domestic_laundry_repairs\", \"personal_services_embassies_international_organisations\"])\n unless validator.valid?(nature_of_business) || nature_of_business.empty?\n fail ArgumentError, \"invalid value for \\\"nature_of_business\\\", must be one of #{validator.allowable_values}.\"\n end\n @nature_of_business = nature_of_business\n end",
"def valid?\n type_validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n return false unless type_validator.valid?(@type)\n subtype_validator = EnumAttributeValidator.new('String', ['None', 'Across', 'Bottom', 'BottomLeft', 'BottomRight', 'Center', 'Clockwise', 'CounterClockwise', 'GradualAndCycleClockwise', 'GradualAndCycleCounterClockwise', 'Down', 'DownLeft', 'DownRight', 'FontAllCaps', 'FontBold', 'FontItalic', 'FontShadow', 'FontStrikethrough', 'FontUnderline', 'Gradual', 'Horizontal', 'HorizontalIn', 'HorizontalOut', 'In', 'InBottom', 'InCenter', 'InSlightly', 'Instant', 'Left', 'OrdinalMask', 'Out', 'OutBottom', 'OutCenter', 'OutSlightly', 'Right', 'Slightly', 'Top', 'TopLeft', 'TopRight', 'Up', 'UpLeft', 'UpRight', 'Vertical', 'VerticalIn', 'VerticalOut', 'Wheel1', 'Wheel2', 'Wheel3', 'Wheel4', 'Wheel8'])\n return false unless subtype_validator.valid?(@subtype)\n preset_class_type_validator = EnumAttributeValidator.new('String', ['Entrance', 'Exit', 'Emphasis', 'Path', 'MediaCall', 'OLEActionVerbs'])\n return false unless preset_class_type_validator.valid?(@preset_class_type)\n return false if @shape_index.nil?\n trigger_type_validator = EnumAttributeValidator.new('String', ['AfterPrevious', 'OnClick', 'WithPrevious'])\n return false unless trigger_type_validator.valid?(@trigger_type)\n restart_validator = EnumAttributeValidator.new('String', ['Always', 'WhenNotActive', 'Never', 'NotDefined'])\n return false unless restart_validator.valid?(@restart)\n after_animation_type_validator = EnumAttributeValidator.new('String', ['DoNotDim', 'Color', 'HideAfterAnimation', 'HideOnNextMouseClick'])\n return false unless after_animation_type_validator.valid?(@after_animation_type)\n true\n end",
"def enum_attr?(name)\n return false unless @enum_attrs\n @enum_attrs.key?(name)\n end",
"def classy_enum_attr(attribute, options={})\n enum = (options[:class_name] || options[:enum] || attribute).to_s.camelize.constantize\n allow_blank = options[:allow_blank] || false\n allow_nil = options[:allow_nil] || false\n default = ClassyEnum._normalize_default(options[:default], enum)\n\n # Add ActiveRecord validation to ensure it won't be saved unless it's an option\n validates_inclusion_of attribute,\n in: enum,\n allow_blank: allow_blank,\n allow_nil: allow_nil\n\n # Use a module so that the reader methods can be overridden in classes and\n # use super to get the enum value.\n mod = Module.new do\n\n # Define getter method that returns a ClassyEnum instance\n define_method attribute do\n enum.build(read_attribute(attribute), owner: self)\n end\n\n # Define setter method that accepts string, symbol, instance or class for member\n define_method \"#{attribute}=\" do |value|\n value = ClassyEnum._normalize_value(value, default, (allow_nil || allow_blank))\n super(value)\n end\n\n define_method :save_changed_attribute do |attr_name, arg|\n if attribute.to_s == attr_name.to_s && !attribute_changed?(attr_name)\n arg = enum.build(arg)\n current_value = clone_attribute_value(:read_attribute, attr_name)\n\n if arg != current_value\n if respond_to?(:set_attribute_was, true)\n set_attribute_was(attr_name, enum.build(arg, owner: self))\n else\n changed_attributes[attr_name] = enum.build(current_value, owner: self)\n end\n end\n else\n super(attr_name, arg)\n end\n end\n end\n\n include mod\n\n # Initialize the object with the default value if it is present\n # because this will let you store the default value in the\n # database and make it searchable.\n if default.present?\n after_initialize do\n value = read_attribute(attribute)\n\n if (value.blank? && !(allow_blank || allow_nil)) || (value.nil? && !allow_nil)\n send(\"#{attribute}=\", default)\n end\n end\n end\n\n end",
"def is_enum_param(name)\n [\"bookmarkType\", \"order\", \"role\"].include?(name)\n end",
"def valid?\n ENUM.include? @type.downcase.to_sym\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end",
"def set_enum_attrs(subset)\n raise ArgumentError, \"attrs is not a proper subset of available values\" unless subset.all? { |attr| attrs.include? attr }\n @enum_attrs = subset\n end",
"def country=(country)\n validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n unless validator.valid?(country)\n fail ArgumentError, \"invalid value for 'country', must be one of #{validator.allowable_values}.\"\n end\n @country = country\n end",
"def check_option!(name, definition)\n case name\n when :values\n raise AttributorException, \"Allowed set of values requires an array. Got (#{definition})\" unless definition.is_a? ::Array\n when :default\n raise AttributorException, \"Default value doesn't have the correct attribute type. Got (#{definition.inspect})\" unless type.valid_type?(definition) || definition.is_a?(Proc)\n options[:default] = load(definition) unless definition.is_a?(Proc)\n when :description\n raise AttributorException, \"Description value must be a string. Got (#{definition})\" unless definition.is_a? ::String\n when :required\n raise AttributorException, 'Required must be a boolean' unless definition == true || definition == false\n raise AttributorException, 'Required cannot be enabled in combination with :default' if definition == true && options.key?(:default)\n when :required_if\n raise AttributorException, 'Required_if must be a String, a Hash definition or a Proc' unless definition.is_a?(::String) || definition.is_a?(::Hash) || definition.is_a?(::Proc)\n raise AttributorException, 'Required_if cannot be specified together with :required' if options[:required]\n when :example\n unless definition.is_a?(::Regexp) || definition.is_a?(::String) || definition.is_a?(::Array) || definition.is_a?(::Proc) || definition.nil? || type.valid_type?(definition)\n raise AttributorException, \"Invalid example type (got: #{definition.class.name}). It must always match the type of the attribute (except if passing Regex that is allowed for some types)\"\n end\n when :custom_data\n raise AttributorException, \"custom_data must be a Hash. Got (#{definition})\" unless definition.is_a?(::Hash)\n else\n return :unknown # unknown option\n end\n\n :ok # passes\n end",
"def define_active_enum_write_method(attribute)\n class_eval <<-DEF\n def #{attribute}=(arg)\n if arg.is_a?(Symbol)\n super(self.class.active_enum_for(:#{attribute})[arg])\n else\n super\n end\n end\n DEF\n end",
"def check_enum(validation:, key:, schema:)\n return false if !validation[:required] && schema.nil? # Optional and not here, dont check\n return false unless validation[:values]\n return false if validation[:values].include?(schema)\n\n schema = 'nothing' if schema.nil?\n error! key, \"must be one of #{validation[:values].join(', ')}, but was #{schema}\"\n true\n end",
"def should_allow_values_for(attribute, *good_values)\n get_options!(good_values)\n good_values.each do |value|\n matcher = allow_value(value).for(attribute)\n should matcher.description do\n assert_accepts matcher, subject\n end\n end\n end",
"def validate_exclusion_of(attr); end",
"def valid_attribute_types\n\t\treturn self.must_attribute_types |\n\t\t self.may_attribute_types |\n\t\t self.operational_attribute_types\n\tend",
"def valid?\n status_validator = EnumAttributeValidator.new('String', [\"ACTIVE\", \"INACTIVE\"])\n return false unless status_validator.valid?(@status)\n country_validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n return false unless country_validator.valid?(@country)\n currency_validator = EnumAttributeValidator.new('String', [\"UNKNOWN_CURRENCY\", \"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n return false unless currency_validator.valid?(@currency)\n type_validator = EnumAttributeValidator.new('String', [\"PHYSICAL\", \"MOBILE\"])\n return false unless type_validator.valid?(@type)\n return true\n end",
"def update_allowed_values\n self.url_allowed = true if url_required\n self.description_allowed = true if description_required\n self.title_allowed = true if title_required\n\n TagSet::TAG_TYPES.each do |tag_type|\n required = eval(\"#{tag_type}_num_required\") || eval(\"self.#{tag_type}_num_required\") || 0\n allowed = eval(\"#{tag_type}_num_allowed\") || eval(\"self.#{tag_type}_num_allowed\") || 0\n if required > allowed\n eval(\"self.#{tag_type}_num_allowed = required\")\n end\n end\n end",
"def test_valid?\n assert_raise( RuntimeError ) { Tui::Model::Enum.new( 'lab1', { }, 1 ) }\n base = Tui::Model::Enum.new( 'lab1', { 'val1' => '1', 'val99' => '99' }, 'val99' )\n assert_false base.valid?( 1 )\n assert_true base.valid?( \"val1\" )\n ex = assert_raise( RuntimeError ) { base.value = 1; }\n assert_equal( 'Invalid value for model type Tui::Model::Enum!', ex.message )\n end",
"def validate_may_attributes\n\t\thash = (self.entry || {} ).merge( @values )\n\t\tattributes = hash.keys.map( &:to_sym ).uniq\n\t\tvalid_attributes = self.valid_attribute_oids +\n\t\t\tself.operational_attribute_oids +\n\t\t\tIGNORED_OPERATIONAL_ATTRS\n\n\t\tself.log.debug \"Validating MAY attributes: %p against the list of valid OIDs: %p\" %\n\t\t\t[ attributes, valid_attributes ]\n\t\tunknown_attributes = attributes - valid_attributes\n\t\tunknown_attributes.each do |oid|\n\t\t\tself.errors.add( oid, \"is not allowed by entry's objectClasses\" )\n\t\tend\n\tend",
"def allowed_attributes=(_arg0); end",
"def allowed_attributes=(_arg0); end",
"def validate_range(key, value, enum_values)\n values = value.instance_of?(Array) ? value : [value]\n values.each do |v|\n add_templated_error(key, \"'#{v}' is not a valid setting for '#{template.name_for(key)}'\") unless enum_values.include?(v)\n end\n end",
"def valid?\n return false if @class_id.nil?\n class_id_validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n return false unless class_id_validator.valid?(@class_id)\n return false if @object_type.nil?\n object_type_validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n return false unless object_type_validator.valid?(@object_type)\n true\n end",
"def allowed_values(value, pdef)\n if(pdef['AllowedValues'].include?(value))\n true\n else\n \"Not an allowed value: #{pdef['AllowedValues'].join(', ')}\"\n end\n end",
"def allowed_to_write(name)\n # no point allowing attribute writes if we can't save them?\n if allowed_to_save\n name = name.to_s\n validation_methods = self.class.write_validations(name) \n if validation_methods.nil?\n # We haven't registered any filters on this attribute, so allow the write.\n true\n elsif validation_methods.check :accessor => accessor, :model => self\n # One of the authentication methods worked, so allow the write.\n true\n else\n # We had filters but none of them passed. Disallow write.\n false\n end\n else\n false\n end\n end",
"def status_enum=(status)\n write_attribute(:status, status)\n end",
"def setting_attribute_is_allowed?(name, user)\n return false unless user.can_write?(self, name)\n (self.whitelisted_attributes && self.whitelisted_attributes.has_key?( name.to_sym)) ||\n (\n self.attribute_names.include?( name.to_s ) &&\n ( self.blacklisted_attributes.nil? ||\n ! self.blacklisted_attributes.has_key?( name.to_sym ) )\n )\n end",
"def valid?\n return false if !super\n status_validator = EnumAttributeValidator.new('String', ['NotDefined', 'Active', 'Resolved', 'Closed'])\n return false unless status_validator.valid?(@status)\n true\n end",
"def valid?\n MANDATORY_ATTRIBUTES[type].each{|a| return false unless self[a]}\n true\n end",
"def valid?\n return false if !super\n return false if @style.nil?\n style_validator = EnumAttributeValidator.new('String', ['Unknown', 'Percent05', 'Percent10', 'Percent20', 'Percent25', 'Percent30', 'Percent40', 'Percent50', 'Percent60', 'Percent70', 'Percent75', 'Percent80', 'Percent90', 'DarkHorizontal', 'DarkVertical', 'DarkDownwardDiagonal', 'DarkUpwardDiagonal', 'SmallCheckerBoard', 'Trellis', 'LightHorizontal', 'LightVertical', 'LightDownwardDiagonal', 'LightUpwardDiagonal', 'SmallGrid', 'DottedDiamond', 'WideDownwardDiagonal', 'WideUpwardDiagonal', 'DashedUpwardDiagonal', 'DashedDownwardDiagonal', 'NarrowVertical', 'NarrowHorizontal', 'DashedVertical', 'DashedHorizontal', 'LargeConfetti', 'LargeGrid', 'HorizontalBrick', 'LargeCheckerBoard', 'SmallConfetti', 'Zigzag', 'SolidDiamond', 'DiagonalBrick', 'OutlinedDiamond', 'Plaid', 'Sphere', 'Weave', 'DottedGrid', 'Divot', 'Shingle', 'Wave', 'Horizontal', 'Vertical', 'Cross', 'DownwardDiagonal', 'UpwardDiagonal', 'DiagonalCross', 'NotDefined'])\n return false unless style_validator.valid?(@style)\n true\n end",
"def enum?(field)\n !!self.enums[field.to_sym]\n end",
"def currency=(currency)\n validator = EnumAttributeValidator.new('String', [\"UNKNOWN_CURRENCY\", \"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n unless validator.valid?(currency)\n fail ArgumentError, \"invalid value for 'currency', must be one of #{validator.allowable_values}.\"\n end\n @currency = currency\n end",
"def enum_defined_for?(attribute)\n context = self.eh_params[:enum_contexts][attribute.to_s]\n !!(eh_params[:db_codes][context] && eh_params[:db_codes][context][attribute.to_s])\n # Returns true if the indicated attribute has an enum defined\n end",
"def object_type=(object_type)\n validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n unless validator.valid?(object_type)\n fail ArgumentError, \"invalid value for \\\"object_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @object_type = object_type\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', [\"\", \"APIC\", \"DCNM\", \"UCSFI\", \"UCSFIISM\", \"IMC\", \"IMCM4\", \"IMCM5\", \"IMCRack\", \"UCSIOM\", \"HX\", \"HyperFlexAP\", \"IWE\", \"UCSD\", \"IntersightAppliance\", \"IntersightAssist\", \"PureStorageFlashArray\", \"UCSC890\", \"NetAppOntap\", \"NetAppActiveIqUnifiedManager\", \"EmcScaleIo\", \"EmcVmax\", \"EmcVplex\", \"EmcXtremIo\", \"VmwareVcenter\", \"MicrosoftHyperV\", \"AppDynamics\", \"Dynatrace\", \"NewRelic\", \"ServiceNow\", \"ReadHatOpenStack\", \"CloudFoundry\", \"MicrosoftAzureApplicationInsights\", \"OpenStack\", \"MicrosoftSqlServer\", \"Kubernetes\", \"AmazonWebService\", \"AmazonWebServiceBilling\", \"MicrosoftAzureServicePrincipal\", \"MicrosoftAzureEnterpriseAgreement\", \"DellCompellent\", \"HPE3Par\", \"RedHatEnterpriseVirtualization\", \"NutanixAcropolis\", \"HPEOneView\", \"ServiceEngine\", \"HitachiVirtualStoragePlatform\", \"IMCBlade\", \"TerraformCloud\", \"TerraformAgent\", \"CustomTarget\", \"AnsibleEndpoint\", \"HTTPEndpoint\", \"SSHEndpoint\", \"CiscoCatalyst\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end",
"def compliance=(compliance)\n validator = EnumAttributeValidator.new('String', ['Pdf15', 'PdfA1b'])\n unless validator.valid?(compliance)\n fail ArgumentError, 'invalid value for \"compliance\", must be one of #{validator.allowable_values}.'\n end\n @compliance = compliance\n end",
"def supports_polymorphic_enum_handling(attribute_name)\n self.eh_params[:polymorphic_attribute] = \"#{attribute_name}_type\".to_sym\n end",
"def should_deny_values(options)\n klass = self.name.gsub(/Test$/, '').constantize\n\n context \"#{klass}\" do\n options.each_pair do |attribute, values|\n [*values].each do |value|\n display_value = value.class == NilClass ? \"nil\" : \"\\\"#{value}\\\"\"\n \n should \"not allow #{attribute} to be #{display_value}\" do\n instance = get_instance_of(klass)\n instance.send(\"#{attribute}=\", value)\n assert !instance.valid?, \n \"Expected #{klass} to be invalid when #{attribute} is set to #{display_value}\"\n assert instance.errors.on(attribute.to_sym), \n \"Expected errors on #{attribute} when set to #{display_value}\"\n end\n end\n end\n end\n end",
"def enum?\n true\n end",
"def kind=(kind)\n validator = EnumAttributeValidator.new('String', [\"UNKNOWN\", \"USER_CREATED\", \"INTERNAL\"])\n unless validator.valid?(kind)\n fail ArgumentError, \"invalid value for \\\"kind\\\", must be one of #{validator.allowable_values}.\"\n end\n @kind = kind\n end",
"def validate_attribute_syntax\n\t\[email protected] do |attribute, values|\n\t\t\t[ values ].flatten.each do |value|\n\t\t\t\tbegin\n\t\t\t\t\tself.get_converted_attribute( attribute.to_sym, value )\n\t\t\t\trescue => err\n\t\t\t\t\tself.log.error \"validation for %p failed: %s: %s\" %\n\t\t\t\t\t\t[ attribute, err.class.name, err.message ]\n\t\t\t\t\tattrtype = self.find_attribute_type( attribute )\n\t\t\t\t\tself.errors.add( attribute, \"isn't a valid %s value\" %\n\t\t\t\t\t\t[ attrtype.syntax ? attrtype.syntax.desc : attrtype.syntax_oid ] )\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"def valid?\n return false if @name.nil?\n return false if @name.to_s.length > 25\n return false if @based_on.nil?\n based_on_validator = EnumAttributeValidator.new('String', [\"MyCalendar\", \"Customer\", \"AllHours\", \"Custom\"])\n return false unless based_on_validator.valid?(@based_on)\n return false if !@application_order.nil? && @application_order > 32767\n return false if !@application_order.nil? && @application_order < 1\n return false if !@respond_hours.nil? && @respond_hours > 999\n return false if !@respond_hours.nil? && @respond_hours < 0\n return false if !@respond_percent.nil? && @respond_percent > 99999\n return false if !@respond_percent.nil? && @respond_percent < 0\n return false if !@plan_within.nil? && @plan_within > 999\n return false if !@plan_within.nil? && @plan_within < 0\n return false if !@plan_within_percent.nil? && @plan_within_percent > 99999\n return false if !@plan_within_percent.nil? && @plan_within_percent < 0\n return false if !@resolution_hours.nil? && @resolution_hours > 999\n return false if !@resolution_hours.nil? && @resolution_hours < 0\n return false if !@resolution_percent.nil? && @resolution_percent > 99999\n return false if !@resolution_percent.nil? && @resolution_percent < 0\n return true\n end",
"def valid?\n policy_validator = EnumAttributeValidator.new('Object', ['RMF', 'DIACAP', 'Reporting'])\n return false unless policy_validator.valid?(@policy)\n registration_type_validator = EnumAttributeValidator.new('Object', ['Assess and Authorize', 'Assess Only', 'Guest', 'Regular', 'Functional', 'Cloud Service Provider'])\n return false unless registration_type_validator.valid?(@registration_type)\n organization_name_validator = EnumAttributeValidator.new('Object', ['Army', 'Navy', 'Air Force', 'Marines', 'DoD', 'Defense Information Systems Agency'])\n return false unless organization_name_validator.valid?(@organization_name)\n system_type_validator = EnumAttributeValidator.new('Object', ['IS Major Application', 'IS Enclave', 'Platform IT', 'Platform IT System', 'Interconnection', 'AIS Application'])\n return false unless system_type_validator.valid?(@system_type)\n authorization_status_validator = EnumAttributeValidator.new('Object', ['Authority to Operate (ATO)', 'Interim Authority to Operate (IATO)', 'Interim Authority to Test (IATT)', 'Authority to Operate with Conditions (ATO) w/Conditions)', 'Denied Authority to Operate (DATO)', 'Not Yet Authorized', 'Unaccredited', 'Decommissioned'])\n return false unless authorization_status_validator.valid?(@authorization_status)\n confidentiality_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless confidentiality_validator.valid?(@confidentiality)\n integrity_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless integrity_validator.valid?(@integrity)\n availability_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless availability_validator.valid?(@availability)\n mac_validator = EnumAttributeValidator.new('Object', ['I', 'II', 'III'])\n return false unless mac_validator.valid?(@mac)\n dod_confidentiality_validator = EnumAttributeValidator.new('Object', ['Public', 'Sensitive', 'Classified'])\n return false unless dod_confidentiality_validator.valid?(@dod_confidentiality)\n true\n end",
"def enum?\n false\n end",
"def unassignable_value_for(attr)\n case attr.type\n when :integer\n attr.assignable_values.max + 1\n when :string\n assignable_value_for(attr) + '-unassignable'\n else\n raise \"Assignable values for :#{attr.type} attributes not supported\"\n end\n end",
"def define_value_methods!\n self.accepted_values.each do |(name, bit)|\n self.meta_class.class_eval <<-FLAG_METHODS\n\n def #{name}\n ((@value || 0) & #{bit}) != 0\n end\n alias :#{name}? :#{name}\n\n def #{name}=(new_value)\n boolean = self.to_boolean(new_value)\n current = self.#{name}\n if boolean ^ current\n self.value = ((@value || 0) ^ #{bit})\n end\n self.#{name}\n end\n\n FLAG_METHODS\n end\n end",
"def replace_enumerations_in_hash(attrs, allow_multiple = true) #:nodoc:\n attrs.each do |attr, value|\n if options = enumerator_options_for(attr, value, allow_multiple)\n attrs.delete(attr)\n attrs.merge!(options)\n end\n end\n end",
"def update_enum_attribute(database_id:, collection_id:, key:, elements:, required:, default:)\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'\n .gsub('{databaseId}', database_id)\n .gsub('{collectionId}', collection_id)\n .gsub('{key}', key)\n\n if database_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"databaseId\"')\n end\n\n if collection_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"collectionId\"')\n end\n\n if key.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"key\"')\n end\n\n if elements.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"elements\"')\n end\n\n if required.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"required\"')\n end\n\n if default.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"default\"')\n end\n\n params = {\n elements: elements,\n required: required,\n default: default,\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'PATCH',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::AttributeEnum\n )\n end",
"def as_enum\n # Should look like:\n # enum attribute_name: [\"one\", \"two\"]\n\n if is_enum?\n if (enum_options = properties[:enum_options]).present?\n enum_options_as_hash = Frontier::HashSingleLineDecorator.new array_as_hash(enum_options)\n \"enum #{name}: {#{enum_options_as_hash}}\"\n else\n raise(ArgumentError, \"No enum_options provided for attribute: #{name}\")\n end\n else\n raise(ArgumentError, \"Attempting to display field #{name} as enum, but is #{type}\")\n end\n end",
"def validate_marital_status(val)\n unless @valid_marital_statuses.include?(val)\n raise \"Invalid value: #{val}\"\n end\n end",
"def validate_marital_status(val)\n unless @valid_marital_statuses.include?(val)\n raise \"Invalid value: #{val}\"\n end\n end",
"def enumeration?\n @is_enumeration ||= @xml.xpath('./xs:restriction/xs:enumeration', {'xs' => 'http://www.w3.org/2001/XMLSchema'}).length > 0\n end",
"def pa_esigibilita=(pa_esigibilita)\n validator = EnumAttributeValidator.new('String', ['I', 'D', 'S', 'N'])\n unless validator.valid?(pa_esigibilita)\n fail ArgumentError, 'invalid value for \"pa_esigibilita\", must be one of #{validator.allowable_values}.'\n end\n @pa_esigibilita = pa_esigibilita\n end",
"def timeliness_validation_for(attr_names, type)\n super\n attr_names.each { |attr_name| define_timeliness_write_method(attr_name) }\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', ['Once', 'Hourly', 'Daily', 'Weekly', 'Monthly', 'Yearly'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end",
"def validate_allowed(record)\n unknown = provided(record) - allowed\n\n return if unknown.empty?\n\n record.errors.add(\n options[:attribute],\n \"contains unknown options: #{unknown.join(', ')}\"\n )\n end",
"def valid?\n source_validator = EnumAttributeValidator.new('Integer', [\"1\", \"2\"])\n return false unless source_validator.valid?(@source)\n return true\n end",
"def valid?(value)\n return false if self == Enum\n return true if value.equal?(LAZY_VALUE)\n self.values.include?(value.to_s)\n end",
"def smee=(smee)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(smee)\n fail ArgumentError, \"invalid value for \\\"smee\\\", must be one of #{validator.allowable_values}.\"\n end\n @smee = smee\n end",
"def allowed_status\n errors.add(:string, 'must be pending, accepted or declined.') unless %w[pending accepted declined].any?(status)\n end",
"def define_active_enum_write_method_multiple(attribute, column)\n class_eval <<-DEF\n def #{attribute}=(args)\n self.#{column} = args.map do |arg|\n self.class.active_enum_get_id_for_#{attribute}(arg)\n end\n end\n DEF\n end",
"def valid?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"alert\", \"notification\"])\n return false unless type_validator.valid?(@type)\n priority_validator = EnumAttributeValidator.new('String', [\"P1\", \"P2\", \"P3\", \"P4\", \"P5\"])\n return false unless priority_validator.valid?(@priority)\n return true\n end",
"def has_enums?\n !!eh_params[:has_enums]\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', ['active', 'notActive', 'unknown'])\n unless validator.valid?(type)\n fail ArgumentError, %Q'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end",
"def level=(level)\n validator = EnumAttributeValidator.new('String', [\"Unknown\", \"Inline\", \"Block\", \"Row\", \"Cell\"])\n if level.to_i == 0\n unless validator.valid?(level)\n raise ArgumentError, \"invalid value for 'level', must be one of #{validator.allowable_values}.\"\n end\n @level = level\n else\n @level = validator.allowable_values[level.to_i]\n end\n end",
"def mode=(mode)\n validator = EnumAttributeValidator.new('String', [\"default\", \"custom\"])\n unless validator.valid?(mode)\n fail ArgumentError, \"invalid value for 'mode', must be one of #{validator.allowable_values}.\"\n end\n @mode = mode\n end",
"def valid?\n type_validator = EnumAttributeValidator.new('String', ['active', 'notActive', 'unknown'])\n return false unless type_validator.valid?(@type)\n true\n end",
"def allowed_access_levels\n validator = lambda do |field|\n level = public_send(field) || ENABLED # rubocop:disable GitlabSecurity/PublicSend\n not_allowed = level > ENABLED\n self.errors.add(field, \"cannot have public visibility level\") if not_allowed\n end\n\n (FEATURES - %i(pages)).each {|f| validator.call(\"#{f}_access_level\")}\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Paragraph\", \"Character\", \"Table\", \"List\"])\n if type.to_i == 0\n unless validator.valid?(type)\n raise ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n else\n @type = validator.allowable_values[type.to_i]\n end\n end",
"def legal_entity_type=(legal_entity_type)\n validator = EnumAttributeValidator.new('String', [\"sole_proprietorship\", \"partnership\", \"privately_owned_company\", \"publicly_owned_company\", \"government_owned_entity\", \"trust\", \"ngo\", \"club_and_society\", \"go\", \"other\", \"financial_institution\", \"mto\"])\n unless validator.valid?(legal_entity_type) || legal_entity_type.empty?\n fail ArgumentError, \"invalid value for \\\"legal_entity_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @legal_entity_type = legal_entity_type\n end",
"def all_attributes_exists_with_enumerations?(attribute_names)\n exists = all_attributes_exists_without_enumerations?(attribute_names)\n exists ||= attribute_names.all? do |name|\n column_methods_hash.include?(name.to_sym) || reflect_on_enumeration(name)\n end\n end",
"def valid_setters\n methods = ScheduledActivity.instance_methods\n @valid_setters ||= methods.select do |m|\n methods.include?(:\"#{m}=\")\n end\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Weekly\", \"BiWeekly\", \"SemiMonthly\", \"Monthly\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end",
"def valid?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"ITEM\", \"CATEGORY\", \"ITEM_VARIATION\", \"TAX\", \"DISCOUNT\", \"MODIFIER_LIST\", \"MODIFIER\"])\n return false unless type_validator.valid?(@type)\n return false if @id.nil?\n return false if @id.to_s.length < 1\n return true\n end",
"def valid?\n return false if @value.nil?\n change_mode_validator = EnumAttributeValidator.new('String', [\"immediate\", \"delayed\"])\n return false unless change_mode_validator.valid?(@change_mode)\n invoicing_type_validator = EnumAttributeValidator.new('String', [\"Immediate\", \"Aggregated\"])\n return false unless invoicing_type_validator.valid?(@invoicing_type)\n return true\n end",
"def valid?\n type_validator = EnumAttributeValidator.new('String', [\"person\", \"business\"])\n return false unless type_validator.valid?(@type)\n return false if @country.nil?\n return false if @street.nil?\n return false if @postal_code.nil?\n return false if @city.nil?\n return false if @email.nil?\n return false if @ip.nil?\n identification_type_validator = EnumAttributeValidator.new('String', [\"DL\", \"PP\", \"ID\", \"OT\"])\n return false unless identification_type_validator.valid?(@identification_type)\n legal_entity_type_validator = EnumAttributeValidator.new('String', [\"sole_proprietorship\", \"partnership\", \"privately_owned_company\", \"publicly_owned_company\", \"government_owned_entity\", \"trust\", \"ngo\", \"club_and_society\", \"go\", \"other\", \"financial_institution\", \"mto\"])\n return false unless legal_entity_type_validator.valid?(@legal_entity_type)\n nature_of_business_validator = EnumAttributeValidator.new('String', [\"personal\", \"agriculture_and_hunting\", \"forestry\", \"fishing\", \"agricultural_by_products\", \"coal_mining\", \"oil_mining\", \"iron_ore_mining\", \"other_metal_and_diamond_mining\", \"other_mineral_mining\", \"manufacturing_of_food_drink_tobacco\", \"manufacturing_of_textiles_leather_fur_furniture\", \"manufacture_of_wooden_products_furniture\", \"manufacture_of_paper_pulp_allied_products\", \"manufacture_of_chemicals_medical_petroleum_rubber_plastic_products\", \"manufacture_of_pottery_china_glass_stone\", \"manufacture_of_iron_steel_non_ferrous_metals_basic_industries\", \"manufacture_of_metal_products_electrical_and_scientific_engineering\", \"manufacture_of_jewelry_musical_instruments_toys\", \"electricity_gas_and_water\", \"construction\", \"wholesale_trade\", \"retail_trade\", \"catering_incl_hotels\", \"transport_storage\", \"communications\", \"finance_and_holding_companies\", \"insurance\", \"business_services\", \"real_estate_development_investment\", \"central_state_governments\", \"community_services_defence_police_prisons_etc\", \"social_services_education_health_care\", \"personal_services_leisure_services\", \"personal_services_domestic_laundry_repairs\", \"personal_services_embassies_international_organisations\"])\n return false unless nature_of_business_validator.valid?(@nature_of_business)\n return false if @documents.nil?\n gender_validator = EnumAttributeValidator.new('String', [\"M\", \"F\", \"O\"])\n return false unless gender_validator.valid?(@gender)\n true\n end",
"def class_id=(class_id)\n validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n unless validator.valid?(class_id)\n fail ArgumentError, \"invalid value for \\\"class_id\\\", must be one of #{validator.allowable_values}.\"\n end\n @class_id = class_id\n end",
"def assert_white_list_setter(clazz, attr, value, whitelist_clazz)\n instance = clazz.new(attr => value)\n assert_kind_of whitelist_clazz, instance.send(attr)\n assert_equal value, instance.send(attr).value\n end",
"def allow_value_matcher; end",
"def raise_invalid(value)\n if value.is_a?(Numeric)\n raise EnumError, \"#{value.inspect} is out of bounds of #{self.class.name}\"\n else\n raise EnumError, \"#{value.inspect} is not valid for #{self.class.name}\"\n end\n end",
"def valid_parameter_for_conditional_formatting\n [\n :type,\n :format,\n :criteria,\n :value,\n :minimum,\n :maximum,\n :min_type,\n :mid_type,\n :max_type,\n :min_value,\n :mid_value,\n :max_value,\n :min_color,\n :mid_color,\n :max_color,\n :bar_color\n ]\n end",
"def valid_parameter_for_conditional_formatting\n %i[\n type\n format\n criteria\n value\n minimum\n maximum\n stop_if_true\n min_type\n mid_type\n max_type\n min_value\n mid_value\n max_value\n min_color\n mid_color\n max_color\n bar_color\n bar_negative_color\n bar_negative_color_same\n bar_solid\n bar_border_color\n bar_negative_border_color\n bar_negative_border_color_same\n bar_no_border\n bar_direction\n bar_axis_position\n bar_axis_color\n bar_only\n icon_style\n reverse_icons\n icons_only\n icons\n data_bar_2010\n ]\n end",
"def oil_types=(vals = [])\n if vals.is_a?(Array)\n OilTypes.collect {|t| t[1]}.each do |type|\n if vals.member?(type)\n send(type+\"=\",true)\n else\n send(type+\"=\",false)\n end\n end\n end\n end",
"def validate_enum_name(name)\n name.gsub(/[-\\s]/, \"_\").sub(/^\\d/, '_\\0')\n end",
"def sr_iov=(sr_iov)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(sr_iov)\n fail ArgumentError, \"invalid value for \\\"sr_iov\\\", must be one of #{validator.allowable_values}.\"\n end\n @sr_iov = sr_iov\n end",
"def appearance=(appearance)\n validator = EnumAttributeValidator.new('String', [\"Default\", \"BoundingBox\", \"Tags\", \"Hidden\"])\n if appearance.to_i == 0\n unless validator.valid?(appearance)\n raise ArgumentError, \"invalid value for 'appearance', must be one of #{validator.allowable_values}.\"\n end\n @appearance = appearance\n else\n @appearance = validator.allowable_values[appearance.to_i]\n end\n end",
"def validate_entities!(enum)\n unless enum.respond_to?(:each)\n raise Errors::InternalError, 'Validation cannot be performed on non-enumerable objects'\n end\n enum.each(&:valid!)\n enum\n rescue ::Occi::Core::Errors::MandatoryArgumentError, ::Occi::Core::Errors::ValidationError => ex\n logger.error \"Validation failed: #{ex.class} #{ex.message}\"\n raise Errors::ValidationError, ex.message\n end",
"def attr_bool_writer *symbols\n attr_writer *symbols\n end",
"def valid?\n frequency_validator = EnumAttributeValidator.new('String', [\"daily\", \"weekly\", \"monthly\", \"quarterly\", \"yearly\"])\n return false unless frequency_validator.valid?(@frequency)\n return true\n end",
"def valid_attributes\n {\n name: \"Unlimited\",\n award_title_name: \"10k Unlimited\",\n scoring_class: \"Freestyle\"\n }\n end",
"def should_allow_values(options)\n klass = self.name.gsub(/Test$/, '').constantize\n\n context \"#{klass}\" do\n options.each_pair do |attribute, values|\n [*values].each do |value|\n display_value = value.class == NilClass ? \"nil\" : \"\\\"#{value}\\\"\"\n \n should \"allow #{attribute} to be #{display_value}\" do\n instance = get_instance_of(klass)\n instance.send(\"#{attribute}=\", value)\n assert_nil instance.errors.on(attribute), \n \"Expected no errors when #{attribute} is set to #{display_value}, \n instead found error \\\"#{instance.errors.on(attribute)}\\\".\"\n end\n end\n end\n end\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_number_value(\"offsetInDays\", @offset_in_days)\n writer.write_enum_value(\"timeBasedAttribute\", @time_based_attribute)\n end",
"def gr_append_check? obj\n return false if obj.class!=self.class\n return false if !respond_to(\"each\")\n myEnum=to_enum\n objEnum=obj.to_enum\n while true\n begin\n myEle=myEnum.next\n rescue\n return true\n end\n begin\n objEle=objEnum.next\n rescue\n return false\n end\n return false if myEle!=objEle\n end\n return true\n end",
"def validate( value )\n raise ReadOnlyException.new(self) unless settable?\n @definition.type.validate(value)\n end",
"def valid?\n only_display_validator = EnumAttributeValidator.new('String', [\"DoNotDisplay\", \"Closed30Days\", \"Closed60Days\", \"Closed90Days\", \"Closed120Days\", \"AllClosed\"])\n return false unless only_display_validator.valid?(@only_display)\n return true\n end",
"def patrol_scrub=(patrol_scrub)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"disabled\", \"Enable at End of POST\", \"enabled\"])\n unless validator.valid?(patrol_scrub)\n fail ArgumentError, \"invalid value for \\\"patrol_scrub\\\", must be one of #{validator.allowable_values}.\"\n end\n @patrol_scrub = patrol_scrub\n end",
"def _class=(_class)\n validator = EnumAttributeValidator.new('String', [\"Other\", \"Absolute\", \"Possessory\", \"Qualified\", \"Good\"])\n unless validator.valid?(_class)\n fail ArgumentError, \"invalid value for '_class', must be one of #{validator.allowable_values}.\"\n end\n @_class = _class\n end",
"def valid?\n return false if !super\n quartile_method_validator = EnumAttributeValidator.new('String', ['Exclusive', 'Inclusive'])\n return false unless quartile_method_validator.valid?(@quartile_method)\n true\n end"
] | [
"0.7088127",
"0.64820594",
"0.6429773",
"0.6227689",
"0.61418885",
"0.5809922",
"0.57507086",
"0.5743216",
"0.5736045",
"0.5708027",
"0.57014966",
"0.56777334",
"0.5601988",
"0.55947953",
"0.55464065",
"0.55371004",
"0.55344343",
"0.5528221",
"0.5434983",
"0.54312384",
"0.5418137",
"0.5379602",
"0.53794384",
"0.53794384",
"0.53653747",
"0.53513694",
"0.53364015",
"0.5330548",
"0.5324624",
"0.53222466",
"0.5307476",
"0.53004855",
"0.52841866",
"0.52784383",
"0.52683413",
"0.5265264",
"0.525289",
"0.52094126",
"0.5189669",
"0.5185224",
"0.51700306",
"0.5146029",
"0.51444733",
"0.51369494",
"0.5134045",
"0.5133414",
"0.5130944",
"0.51203525",
"0.5117331",
"0.5108703",
"0.5108653",
"0.5106191",
"0.50937504",
"0.50937504",
"0.50840217",
"0.5082524",
"0.5074987",
"0.50655115",
"0.5064211",
"0.505987",
"0.50555235",
"0.50513357",
"0.5044483",
"0.5041556",
"0.5036054",
"0.5031193",
"0.5023556",
"0.5019361",
"0.49934402",
"0.4989093",
"0.49836317",
"0.49754748",
"0.49738207",
"0.49702868",
"0.49647367",
"0.49602023",
"0.4959052",
"0.49577102",
"0.49549797",
"0.49535498",
"0.49489576",
"0.49489233",
"0.4943718",
"0.494183",
"0.494042",
"0.4935984",
"0.49353147",
"0.4934332",
"0.49269903",
"0.49202663",
"0.49195725",
"0.49171844",
"0.49135497",
"0.49132174",
"0.4910008",
"0.49098906",
"0.49096495",
"0.49090025",
"0.49080157",
"0.49024847",
"0.49014568"
] | 0.0 | -1 |
Checks equality by comparing each attribute. | def ==(o)
return true if self.equal?(o)
self.class == o.class &&
timing == o.timing &&
plan == o.plan &&
amount == o.amount &&
quantity == o.quantity &&
billing == o.billing &&
amount_incl_vat == o.amount_incl_vat &&
compensation_method == o.compensation_method &&
partial_period_handling == o.partial_period_handling &&
start_date == o.start_date &&
cancel_change == o.cancel_change &&
add_ons == o.add_ons &&
remove_add_ons == o.remove_add_ons
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ==(other)\n attributes == other.attributes\n end",
"def ==(other) # :nodoc:\n @attrs == other.attrs\n end",
"def eql?(other)\n return true if self == other\n @@ATTRIBUTES.each do |att|\n return false unless self.send(att).eql?(other.send(att))\n end\n true\n end",
"def assert_equal_attributes(object, expected_attributes)\n expected_attributes.each do |index, value|\n assert_equal value, object[index], \"#{index}\"\n end\n end",
"def attr_equal?(o)\n self == o and\n self.instance_variables_compare(o).empty? and\n self.attributes == o.attributes\n end",
"def same_attributes?(spec)\n @@attributes.all? {|name, default| self.send(name) == spec.send(name) }\n end",
"def ==(other)\n self.class.valid_attrs.each do |attr|\n return false if read(attr) != other.read(attr)\n end\n true\n end",
"def ==(other)\n self.attributes == (other.respond(:attributes) || {} )\n end",
"def ==(other)\n other.present? && self.attributes == other.attributes\n end",
"def ==(other)\n return false if other.nil? || !other.respond_to?(:attributes)\n attributes == other.attributes\n end",
"def match?(attributes)\n attributes.each do |attr, val|\n return false if send(attr).to_s != val.to_s\n end\n true\n end",
"def ==(other)\n self.class == other.class &&\n self.attributes == other.attributes\n end",
"def ==(other)\n self.class == other.class &&\n attributes == other.attributes\n end",
"def ==(other)\n return super unless other.is_a?(self.class)\n\n attributes.all? { |name, value| value == other.send(name) }\n end",
"def changed?(comparison)\n attributes.any? do |attribute, value|\n next unless comparison.key?(attribute)\n comparison[attribute] != value\n end\n end",
"def ==(other)\n return false unless self.class == other.class\n self.attributes == other.attributes\n end",
"def ==(other)\n if other.kind_of? Details::Attribute\n self.name == other.name && self.value == other.value\n else\n self.value == other\n end\n end",
"def ==(other)\n return false unless other.instance_of? self.class\n attributes == other.attributes\n end",
"def ==(other)\n return super unless other.is_a?(self.class)\n\n attributes.all? { |name, value| value == other.attributes[name] }\n end",
"def ==(other)\n return super unless other.is_a?(self.class)\n\n attributes.all? { |name, value| value == other.attributes[name] }\n end",
"def ==(other)\n return super unless other.is_a?(self.class)\n\n attributes.all? { |name, value| value == other.attributes[name] }\n end",
"def ==(other)\n Attribute === other && \n !(Expression === other) &&\n relation == other.relation && \n name == other.name && \n self.alias == other.alias && \n original_relation == other.original_relation\n end",
"def ==(obj)\n if obj.instance_of?(self.class)\n compare_attributes = [\"category_id\", \"combo_item_id\", \"quantity\", \"sequence\"]\n compare_attributes.each do |field|\n if self.send(field) != obj.send(field)\n return false\n end\n end\n return true\n end\n return false\n end",
"def ==(other)\n return false if other.class != self.class\n attr_hash == other.attr_hash\n end",
"def ==(other)\n case other\n when Chair::Row\n @attributes == other.instance_variable_get('@attributes')\n when Array\n @attributes.values == other\n else false\n end\n end",
"def == other\n return false unless other.kind_of? self.class\n attribute_of.all? do |key, val|\n val.get == other.__send__(key)\n end\n end",
"def correct_combination?(attr1, attr2, attr3)\n result = false\n if attr1 == attr2 && attr2 == attr3\n result = true\n elsif attr1 != attr2 && attr2 != attr3 && attr1 != attr3\n result = true\n end\n return result\n end",
"def ==(other)\n return false if self.class != other.class\n return super if @_lazer_model.required_properties.empty?\n @_lazer_model.required_properties.each do |key_name|\n return false if read_attribute(key_name) != other.read_attribute(key_name)\n end\n true\n end",
"def eql?(other)\n other.is_a?(self.class) && !self.class.comparison_attrs.find{|a| send(a) != other.send(a)}\n end",
"def verify_attributes(hash, expected)\n return [] unless expected.attributes\n expected.attributes.map{ |a| verify_attribute_value(hash[a.name.to_s], a) }\n end",
"def assert_attributes obj, attr_hash\n default_attr_hash = {}\n if obj.respond_to? :default_attr_hash\n default_attr_hash = obj.default_attr_hash\n end\n default_attr_hash.merge(attr_hash).each_pair do |key, value|\n assert_equal value, obj.__send__(key), \"Attribute #{key} of #{obj}\"\n end\n end",
"def match_attributes(attrs)\n attrs = Saxxy::Helpers.stringify_keys(attrs)\n attributes.reduce(true) do |b, (k, v)|\n value = attrs[k]\n b && ((!value.nil? && match(v, value)) || (v.nil? && value.nil?))\n end\n end",
"def equal_set(expected)\n message = \"#{Helpers.inspect_records(@object)} has the same records as #{Helpers.inspect_records(expected)}\"\n \n left = @object.map(&:id).sort\n right = expected.map(&:id).sort\n \n test_case.assert(left != right, message)\n end",
"def ===(other)\n required = self.class.required_attributes\n\n other.respond_to?(:keys) && (common = other.keys & required) &&\n common.size == other.keys.size && common.size == required.size\n end",
"def bt_same_value?(other)\n bt_value_attributes == other.bt_value_attributes\n end",
"def ==(x)\n return true if object_id == x.object_id\n return false unless x.kind_of?(AttrArray)\n each_with_index do |a, n|\n return false unless a == x[n]\n end\n true\n end",
"def equal_set(expected)\n message = \"#{Helpers.inspect_records(@object)} does not have the same records as #{Helpers.inspect_records(expected)}\"\n \n left = @object.map(&:id).sort\n right = expected.map(&:id).sort\n \n test_case.assert(left == right, message)\n end",
"def compare_attributes(data_criteria, criteria)\n return false unless data_criteria['dataElementAttributes']&.any?\n\n data_criteria['dataElementAttributes'].map { |dc| dc.except('_id') }.include? criteria['dataElementAttributes'][attribute_index].except('_id')\n end",
"def ==(other)\n @klass == other.class && @attributes == strip_active_record(other)\n end",
"def ==(other)\n other.is_a?(self.class) &&\n other.attribute == attribute &&\n other.validation == validation &&\n other.expected == expected &&\n other.actual == actual\n end",
"def == other\n return false unless self.class == other.class\n [:unit, :frequency, :anchor, :weeks, :monthdays, :weekdays, :times].all? do |attribute|\n self.send(attribute) == other.send(attribute)\n end\n end",
"def compare_equal?(item, line_item)\n ![\n :ax_account_number,\n :ax_account_id,\n :ax_order_number,\n :ax_order_id,\n :email_address,\n :first_name,\n :last_name,\n :serial_number,\n :purch_order_form_num\n ].detect { |attr| item.send(attr) != line_item.send(attr) }\n end",
"def ==(b) # :nodoc:\n ( b.respond_to?(:result_attributes) &&\n result_attributes == b.result_attributes && \n @result_attributes.all?{ |k| send(k) == b.send(k) } )\n end",
"def validates_different(*attr_names)\n validates_with ValidatesAll::DifferenceValidator, _merge_attributes(attr_names)\n end",
"def identical?\n #Song.first.attributes.each { |v,k| Song.find(:all, :conditions => [\" #{v} like ?\", \"%blah%\"])}\n Song.find(:all, :conditions => [\"name = ? or length = ?\", \"#{self.name}\", self.length]) do |x| \n x.hash == self.hash\n end\n end",
"def diff?(model = self.class.find(id))\n self.class.diffable_attributes.each do |attribute|\n return true if send(attribute) != model.send(attribute)\n end\n return false\n end",
"def filter_attributes_match?(hash_one, hash_two)\n hash_one.all? do |key, value_one|\n value_two = hash_two[key]\n case\n when value_one == value_two\n true\n when value_one.is_a?(Hash) && value_two.is_a?(Hash)\n filter_attributes_match?(value_one, value_two)\n when hash_one[key].to_s == hash_two[key].to_s\n true\n when value_one.is_a?(String) && value_one.start_with?(\"eval:\")\n eval_attribute_value(value_one, value_two)\n else\n false\n end\n end\n end",
"def comparable_attributes\n#\t\tHashWithIndifferentAccess[attributes.select {|k,v| \n#\t\t\t!Abstract.incomparable_attribute_names.include?(k)}]\n\t\tHashWithIndifferentAccess[attributes.select {|k,v| db_fields.include?(k)}]\n\tend",
"def all_equal?\n a = self.first\n all? { |b| a == b }\n end",
"def check_attrs(attr_list)\r\n attrs = []\r\n attr_list.each do |attr_sym|\r\n attr = assigns(attr_sym.to_sym)\r\n assert_not_nil attr, \"Attribute @#{attr_sym} should not be nil\"\r\n assert !attr.new_record?, \"Should have saved the @#{attr_sym} obj\" if attr.class == ActiveRecord\r\n attrs << attr\r\n end\r\n attrs.length > 1 ? attrs : attrs[0]\r\n end",
"def check_attrs(attr_list)\r\n attrs = []\r\n attr_list.each do |attr_sym|\r\n attr = assigns(attr_sym.to_sym)\r\n assert_not_nil attr, \"Attribute @#{attr_sym} should not be nil\"\r\n assert !attr.new_record?, \"Should have saved the @#{attr_sym} obj\" if attr.class == ActiveRecord\r\n attrs << attr\r\n end\r\n attrs.length > 1 ? attrs : attrs[0]\r\n end",
"def attr_set?(cards, attr)\n array = []\n cards.each do |card|\n # evalutes the string 'attr' and returns the value\n array << card.send(attr)\n end\n\n # only return true if it's all the same or totally different\n return true if array.uniq.count == 1\n return true if array.uniq.count == 3\n return false\n end",
"def attribute_changed?(attribute_name)\n (self.diff['attributes']['new']||{})[attribute] != (self.diff['attributes']['old']||{})[attribute]\n end",
"def eql?(other)\n return false if (other.nil? or self.class != other.class)\n return false unless super(other)\n return false unless self.attributes == other.attributes\n return false unless self.nodes == other.nodes\n true\n end",
"def eql?(other)\n return false unless self.class == other.class\n self.key_attributes == other.key_attributes\n end",
"def uniquify_attributes(attributes)\n attributes.each do |ka|\n oldval = send(ka)\n next unless String === oldval\n newval = UniquifierCache.instance.get(self, oldval)\n set_property_value(ka, newval)\n logger.debug { \"Reset #{qp} #{ka} from #{oldval} to unique value #{newval}.\" }\n end\n end",
"def eql?(object)\n self.class.equal?(object.class) && attributes == object.attributes\n end",
"def multi_element_attr_check( elements )\n wanted = Array.new\n found = Array.new\n elements.each do |element|\n print \".\"\n e = $driver.find_element(element[0].to_sym, element[1])\n wanted << [ element[1], element[2], element[3] ]\n found << [ element[1], element[2], e.attribute(element[2]) ]\n end\n\n found.should == wanted\n end",
"def equals(rule)\n element == rule.element && attributes == rule.attributes\n end",
"def attr_reader(*args)\n super\n comparison_attrs.concat(args)\n end",
"def xml_nodes_match_attrs(xml_nodes, attrs, mismatches = [])\n attrs.each_with_index.each { |attr_set, idx|\n xn = xml_nodes[idx]\n attr_set.each { |(attr_key, attr_val)|\n # Either call method, or hash key, or recurse on children\n # p.name vs. p[:name]\n if :children == attr_key\n # recurse over children\n xml_nodes_match_attrs(xn.children, attr_val, mismatches)\n else\n # compare attrs\n xn_val = xn.methods.include?(attr_key) ? xn.send(attr_key) : xn[attr_key]\n if xn_val != attr_val\n mismatches << { node: xn.name_and_class_path, attr: \"#{ attr_key }: expected #{ attr_val.inspect }, got #{ xn_val.inspect }\" }\n end\n end\n }\n }\n mismatches\n end",
"def matches_state_attrs?\n @expected_attrs == state_attrs\n end",
"def equal_list(expected)\n message = \"#{Helpers.inspect_records(@object)} has the same records as #{Helpers.inspect_records(expected)}\"\n \n left = @object.map(&:id)\n right = expected.map(&:id)\n \n test_case.assert(left != right, message)\n end",
"def eql?(other)\n return false unless super(other)\n return false unless attributes == other.attributes\n return false unless content == other.content\n\n true\n end",
"def ==(other)\n return true if other.equal?(self)\n return false unless other.instance_of?(self.class)\n\n self.class.attributes.inject(true) do |memo, attribute|\n attribute_name = attribute.first\n attribute_type = attribute.last[:type]\n\n # Skip associations\n if attribute_type.include?(LazyResource::Resource) || (attribute_type.is_a?(::Array) && attribute_type.first.include?(LazyResource::Resource))\n memo\n else\n memo && self.send(:\"#{attribute_name}\") == other.send(:\"#{attribute_name}\")\n end\n end\n end",
"def matches? item, attributes\n\n attributes.map { |attribute, value|\n\n item.send(attribute) == value\n\n }.flatten == [true]\n\n end",
"def ==( other ) \n\t\t\tcomparison_attributes = lambda{ |area| [ area.area_desc, area.altitude, area.ceiling, area.circles, area.geocodes, area.polygons ]}\n\t\t\tcomparison_attributes.call( self ) == comparison_attributes.call( other )\n\t\tend",
"def all_obs_same_attr?(observations, attr)\n exemplar = observations.first.send(attr)\n observations.all? { |o| o.send(attr) == exemplar }\n end",
"def eql?(*) end",
"def eql?(other)\n return true if equal?(other)\n return false unless self == other\n [:id, :fide_id, :rating, :fide_rating, :title, :gender].each do |m|\n return false if self.send(m) && other.send(m) && self.send(m) != other.send(m)\n end\n true\n end",
"def match\n @matches = attributes_enumerator.map do |(type, value), index|\n attribute_name = self.class.names[index]\n attributes.store(\n attribute_name, type.match(value, context: @context.dup)\n )\n end\n return if (failures = @matches.select(&:invalid?)).empty?\n failures.unshift(failure).reduce(:merge!)\n end",
"def ==(val)\n if val.is_a?(Model)\n # Use normal comparison for a model\n super\n else\n # Compare to attributes otherwise\n attributes == val\n end\n end",
"def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n attribute == o.attribute &&\n statistics == o.statistics &&\n other == o.other &&\n total == o.total &&\n missing == o.missing &&\n term_count == o.term_count &&\n term_type == o.term_type &&\n terms == o.terms\n end",
"def ==(*several_variants)\n #This is a stub, used for indexing\n end",
"def is_equal?(a)\n @amount == a.amount && @code == a.code\n end",
"def equal_list(expected)\n message = \"#{Helpers.inspect_records(@object)} does not have the same records as #{Helpers.inspect_records(expected)}\"\n \n left = @object.map(&:id)\n right = expected.map(&:id)\n \n test_case.assert(left == right, message)\n end",
"def comparison_attributes\n except_list = ['id', 'updated_at', 'created_at', 'verified_at']\n except_list << 'alternative_phone' unless Spree::Config[:alternative_shipping_phone]\n except_list << 'company' unless Spree::Config[:company]\n\n a = attributes.except(*except_list)\n a.each{|k, v|\n if v.is_a?(String)\n v = v.downcase.strip.gsub(/\\s+/, ' ')\n a[k] = v.present? ? v : nil\n end\n }\n a['state_name'] = nil if a['state_name'].blank?\n a\n end",
"def multi_element_attr_match( elements )\n elements.each do |element|\n print \".\"\n wait_for_element(element[0].to_sym, element[1])\n check_attribute_match(element[0].to_sym, element[1], element[2], element[3])\n end\n end",
"def xml_should_eql(actual, expected)\n same = xml_cmp(actual, expected)\n actual.should.== expected unless same \nend",
"def test_equality_simple\n value1_ = ::Versionomy.create(:major => 2, :minor => 0, :release_type => :alpha, :alpha_version => 5)\n value2_ = ::Versionomy.create(:major => 2, :release_type => :alpha, :alpha_version => 5)\n assert_equal(value2_, value1_)\n assert_equal(value2_.hash, value1_.hash)\n end",
"def ==(other)\n other.is_a?(self.class) &&\n name == other.name &&\n attributes == other.attributes\n end",
"def changes(attrs1, attrs2)\n old_attrs = attrs1.slice(*GENERATED_ATTRS)\n new_attrs = attrs2.slice(*GENERATED_ATTRS)\n\n return if old_attrs == new_attrs\n old_attrs.each do |k, v|\n next if new_attrs[k] == v\n @changes << Change.new(nil, k, v, new_attrs[k]) \n end\n end",
"def tdiff_equal(node)\n if (self.class == node.class)\n case node\n when Nokogiri::XML::Attr\n (self.name == node.name && self.value == node.value)\n when Nokogiri::XML::Element, Nokogiri::XML::DTD\n self.name == node.name\n when Nokogiri::XML::Text, Nokogiri::XML::Comment\n self.text == node.text\n when Nokogiri::XML::ProcessingInstruction\n (self.name == node.name && self.content = self.content)\n else\n false\n end\n else\n false\n end\n end",
"def ==(other)\n name == other.name &&\n color == other.color &&\n age == other.age\n end",
"def more_desirable?(attribute_id1, attribute_id2)\n attribute_id1 < attribute_id2\n end",
"def isSame(tab)\n for x in 0..3\n for y in 0..3\n return(false) if (self.val(x,y) != tab.val(x,y)) ;\n end\n end\n return true ;\n end",
"def ==(other)\n # If the classes don't match, they cannot possibly be equal.\n if self.class != other.class\n return false\n end\n\n # If the persisted state doesn't match, they also can never be equal.\n if persisted? != other.persisted?\n return false\n end\n\n # When persisted, check the other's id to see if it's the same,\n # cannot possible be equals if they have different ids.\n if persisted? && id != other.id\n return false\n end\n\n # Finally, compare the attributes hash. If all key/values match,\n # they are considered equal.\n attributes == other.attributes\n end",
"def ==(other)\n self.class == other.class &&\n attributes[\"_id\"] == other.attributes[\"_id\"]\n end",
"def assert_same_values(expected, actual)\n actual.each_pair do |k,v|\n next unless expected[k]\n assert_equal expected[k], v, \"Values for #{k} are not matching\"\n end\n end",
"def assert_equivalent_xml(expected, actual)\n expected_xml = Nokogiri::XML(\"<test-xml>\\n#{expected}\\n</test-xml>\")\n actual_xml = Nokogiri::XML(\"<test-xml>\\n#{actual}\\n</test-xml>\")\n ignored_attributes = %w(style data-disable-with)\n\n equivalent = EquivalentXml.equivalent?(expected_xml, actual_xml, {\n ignore_attr_values: ignored_attributes\n }) do |a, b, result|\n if result === false && b.is_a?(Nokogiri::XML::Element)\n if b.attr('name') == 'utf8'\n # Handle wrapped utf8 hidden field for Rails 4.2+\n result = EquivalentXml.equivalent?(a.child, b)\n end\n if b.delete('data-disable-with')\n # Remove data-disable-with for Rails 5+\n # Workaround because ignoring in EquivalentXml doesn't work\n result = EquivalentXml.equivalent?(a, b)\n end\n if a.attr('type') == 'datetime' && b.attr('type') == 'datetime-local'\n a.delete('type')\n b.delete('type')\n # Handle new datetime type for Rails 5+\n result = EquivalentXml.equivalent?(a, b)\n end\n end\n result\n end\n\n assert equivalent, lambda {\n # using a lambda because diffing is expensive\n Diffy::Diff.new(\n sort_attributes(expected_xml.root),\n sort_attributes(actual_xml.root)\n ).to_s(:color)\n }\n end",
"def sync_duplicate_obj_attributes(obj1, obj2)\n duplicate_keys.each do |key|\n unless obj1[key].blank? && obj2[key].blank?\n if obj1[key].blank?\n obj1.send(\"#{key}=\", obj2[key])\n elsif obj2[key].blank?\n obj2.send(\"#{key}=\", obj1[key])\n else # Each obj has a value\n if obj1[key] != obj2[key]\n raise ArgumentError, \"#{key} attribute values on the two objects don't match: #{obj1[key]} vs #{obj2[key]}\"\n end\n end\n end\n end\n end",
"def eql?(other)\n return true if equal?(other)\n\n # two instances for different models cannot be equivalent\n return false unless other.kind_of?(model)\n\n # two instances with different keys cannot be equivalent\n return false if key != other.key\n\n # neither object has changed since loaded, so they are equivalent\n return true if repository == other.repository && !dirty? && !other.dirty?\n\n # get all the loaded and non-loaded properties that are not keys,\n # since the key comparison was performed earlier\n loaded, not_loaded = properties.select { |p| !p.key? }.partition do |property|\n attribute_loaded?(property.name) && other.attribute_loaded?(property.name)\n end\n\n # check all loaded properties, and then all unloaded properties\n (loaded + not_loaded).all? { |p| p.get(self) == p.get(other) }\n end",
"def assert_event_are_light_equal e1, e2\n return false if e1.class != e2.class\n\n [:subject, :event, :moodid,\n :mood, :music, :location, :taglist, :pickeyword,\n :preformatted, :backdated, :comments, :security, :allowmask,\n :screening,].each do |attr|\n return false if e1.send(attr) != e2.send(attr)\n end\n\n e1.compare_time(e2)\n end",
"def eql(expected)\n set_relativity(:eql, expected)\n end",
"def modified?( original )\n DATA_ATTRIBUTES.any? { |e| send( e ) != original.send( e )}\n end",
"def ==(other)\n @name == other.name && @amount == other.amount\n end",
"def ==(other)\n other.kind_of?(self.class) &&\n @name == other.name && @columns == other.columns && @unique == other.unique?\n end",
"def match_same_name_attributes(*options)\n\n options = options.extract_options!\n same_name_attributes = @from_table.columns.map(&:name) & @to_table.columns.map(&:name)\n\n if same_name_attributes\n same_name_attributes = columns_from_options(same_name_attributes, options)\n same_name_attributes.each do |same_name_attribute|\n from same_name_attribute, :to => same_name_attribute\n end\n end\n end",
"def equal_pair(key, request)\n if @event[\"required\"][key] == request[\"object_attributes\"][key] || event[\"required\"][key] == \"\"\n true\n else\n false\n end\n end",
"def assert_equal(att, value, error = [att, :not_equal])\n assert value === send(att), error\n end",
"def validate\n matched = {}\n duplicated_attributes = []\n attributes.each do |attribute|\n if matched.has_key?(attribute.name) && matched[attribute.name] == attribute.name_format\n duplicated_attributes << attribute.name unless duplicated_attributes.include?(attribute.name)\n else\n matched[attribute.name] = attribute.name_format\n end\n end\n if !duplicated_attributes.empty?\n raise ValidationError, \"An attribute with the same name and name format may only be specified once. The following attributes were specified multiple times: #{duplicated_attributes.join(',')}\"\n end\n end"
] | [
"0.7291717",
"0.7188103",
"0.70395297",
"0.7007927",
"0.68874705",
"0.6861532",
"0.6707156",
"0.6660597",
"0.66147524",
"0.658478",
"0.6584619",
"0.6580019",
"0.65543133",
"0.6543933",
"0.65068495",
"0.6479513",
"0.6456241",
"0.6415999",
"0.6412208",
"0.6412208",
"0.6412208",
"0.6411266",
"0.6380575",
"0.63775986",
"0.6260147",
"0.6246534",
"0.6240681",
"0.62150854",
"0.62014365",
"0.6186426",
"0.61837834",
"0.6164858",
"0.61304426",
"0.61149454",
"0.6097789",
"0.6083095",
"0.6078927",
"0.6067201",
"0.60053444",
"0.59974694",
"0.5994989",
"0.5991373",
"0.59856457",
"0.5985243",
"0.5977118",
"0.59521115",
"0.59428704",
"0.59311265",
"0.59247756",
"0.5921222",
"0.5921222",
"0.59095234",
"0.58795947",
"0.58789194",
"0.5870439",
"0.58598673",
"0.58571184",
"0.5856412",
"0.5855177",
"0.58480394",
"0.5847516",
"0.58370507",
"0.5799985",
"0.5795313",
"0.57880926",
"0.57823527",
"0.57788265",
"0.5776185",
"0.57670164",
"0.5759791",
"0.5758563",
"0.5753949",
"0.57518554",
"0.5750137",
"0.57385117",
"0.57309806",
"0.5729126",
"0.572618",
"0.57250285",
"0.57210624",
"0.5712646",
"0.5710082",
"0.57059866",
"0.57036847",
"0.5702592",
"0.5690256",
"0.5674193",
"0.56433815",
"0.5641553",
"0.56216776",
"0.56148046",
"0.5591313",
"0.5587681",
"0.55836356",
"0.5569298",
"0.5550885",
"0.5546161",
"0.5545665",
"0.55422115",
"0.5539372",
"0.5529004"
] | 0.0 | -1 |
Calculates hash code according to all attributes. | def hash
[timing, plan, amount, quantity, billing, amount_incl_vat, compensation_method, partial_period_handling, start_date, cancel_change, add_ons, remove_add_ons].hash
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def attr_hash\n Digest::MD5.hexdigest(\"#{@name}:#{@ruby_type}\")\n end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash\n code = 17\n code = 37*code + @x.hash\n code = 37*code + @y.hash\n # Add lines like this for each significant instance variable\n code # Return the resulting code\n end",
"def hash(*) end",
"def hash\n code = 17\n code = 37 * code\n self.instance_variables.each do |v|\n code += self.instance_variable_get(v).hash\n end\n code\n end",
"def hash_code; end",
"def calculate_hash!\n prefix = PREFIX_NAME_LOOKUP[self.type]\n # add special cases for refs\n self.hash_id = NodeId.sha1(\"#{prefix} #{self.size}\\0#{self.content}\")\n end",
"def hash() #:nodoc:\n prime = 31;\n result = 1;\n result = prime * result + @amount.to_i\n result = prime * result + @new_balance.to_i\n result = prime * result + (@date.nil? ? 0 : Bankjob.date_time_to_ofx(@date).hash);\n result = prime * result + (@raw_description.nil? ? 0 : @raw_description.hash);\n result = prime * result + (@type.nil? ? 0 : @type.hash);\n # don't use value date\n return result;\n end",
"def hash\n prime = 31\n result = 1\n result = result * prime + (@decision_target == nil ? 0 : @decision_target.hash)\n result = prime * result + (@string_id == nil ? 0 : @string_id.hash)\n result\n end",
"def hash\n @hash ||= begin\n result = 17\n result = 31 * result + self.class.hash\n result = 31 * result + ord\n result.is_a?(Fixnum) ? result : result.hash\n end\n end",
"def hash\n @hash ||= begin\n result = 17\n result = 31 * result + self.class.hash\n result = 31 * result + ord\n result.is_a?(Fixnum) ? result : result.hash\n end\n end",
"def hash; map{|el| \"#{el.name} @ #{el.hash}\"}; map(&:hash).reduce(:+) % 2**32; end",
"def hash\r\n a = 0\r\n @id.each_byte {|c| a += c.to_i}\r\n (a + @paired.to_i) * HASH_PRIME\r\n end",
"def hash\n raw = [name, type, values.join('/')].join(' ')\n Digest::MD5.hexdigest(raw)\n end",
"def hash\n size.hash ^ rank.hash\n end",
"def hash\n \"#{self.class.name}-#{self.id}-#{@__metadata__.cas}-#{@__attributes__.hash}\".hash\n end",
"def hash\n @hash || calculate_hash!\n end",
"def hash\n return name.hash ^ direction.hash ^ lhs.hash ^ rhs.hash\n end",
"def hash\n value = 0\n my_rows = @rows\n r_size = my_rows.size\n for i in 0..r_size-1 do\n a_row = my_rows[i]\n a_size = a_row.size\n for j in 0..a_size-1 do\n value ^= a_row[j].hash\n end\n end\n return value\n end",
"def hash\n id.hash + 32 * bs_request.hash\n end",
"def do_hash(input)\n a = OpenSSL::Digest.hexdigest(\"SHA224\", input).to_i % 19\n b = OpenSSL::Digest.hexdigest(\"SHA512\", input).to_i % 19\n [a, b]\n end",
"def hash\n type.hash ^ (id.hash >> 1)\n end",
"def hash\n [self.class, self.val, self.attribute].hash\n end",
"def hash\n 0\n end",
"def hash # :nodoc:\n identifier.hash ^ requirement.hash\n end",
"def hash\n self.class.hash ^ key_attributes.hash\n end",
"def hash\n return super unless has_size?\n\n res = 0\n each do |el|\n res += el.hash\n end\n return res\n end",
"def hash\n h = @e.nil? ? 0 : @e\n h = (h << 1) ^ @r.hash\n h = (h << 1) ^ @v.hash\n end",
"def hash() source.hash ^ (target.hash+1); end",
"def hash() source.hash ^ (target.hash+1); end",
"def hash\n\t\t\"#{@x}#{@y}\".hash\n\tend",
"def hash #:nodoc:\n __getobj__.hash ^ self.class.hash\n end",
"def hash\n Zlib.crc32(to_a.map(&:to_s).sort.to_s)\n end",
"def hash_code\n prime = 31\n result = 1\n result = prime * result + x\n result = prime * result + y\n return result;\n end",
"def hash\n self.class.hash ^ operand.hash\n end",
"def hash!\n\t\t@@email.downcase!\n\t\thash = Digest::MD5.hexdigest(@@email)\n\t\treturn hash\n\tend",
"def hash\n [anchor, cv, nullifier, proof, rk, spend_auth_sig].hash\n end",
"def hash\n ([self.class] + self.class.comparison_attrs.map{|x| send(x)}).hash\n end",
"def hash\n @symbols.hash + 37*positive?.hash\n end",
"def calculate_unique_hash\n unique = ''\n unique += self.content if self.content.present?\n unique += self.summary if self.summary.present?\n unique += self.title if self.title.present?\n self.unique_hash = Digest::MD5.hexdigest unique\n end",
"def hash()\n #This is a stub, used for indexing\n end",
"def hash\n # Memoizing such a simple hash value seems silly, however the\n # profiler showed the Card#hash method as having 22% of the runtime. My\n # memoizing the hash value that was reduced to 12%.\n return @hash unless @hash.nil?\n @hash = @value.hash ^ @suit.hash\n end",
"def hash=(_arg0); end",
"def block_hash\n\t\tdigest = Digest::SHA2.new\n\n\t\tdigest << '%d' % [ self.index ]\n\t\tdigest << self.timestamp.strftime( '%s%N' )\n\t\tdigest << self.payload\n\t\tdigest << self.payload_hash\n\t\tdigest << self.proof.to_s\n\t\tdigest << self.previous_hash\n\t\t\n\t\treturn digest.hexdigest\n\tend",
"def hash\n num = 0\n self.each do |k,v|\n if k.is_a?(Integer) && v.is_a?(Integer)\n num += k * 26 + v\n elsif k.is_a?(Integer) && !v.is_a?(Integer)\n num += k * 26 + ALPHA_NUMBERS[v.to_s.downcase]\n elsif v.is_a?(Integer) && !k.is_a?(Integer)\n num += v * 26 + ALPHA_NUMBERS[k.to_s.downcase]\n elsif !k.nil? && !v.nil?\n num += ALPHA_NUMBERS[k.to_s.downcase] * ALPHA_NUMBERS[v.to_s.downcase]\n end\n end\n num\n end",
"def hash\r\n\t\treturn @name.hash() + @type.hash()\r\n\tend",
"def hash\n return @hash_code if defined? @hash_code\n @hash_code = usual_equal_object.hash\n end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash\n [oct, pc].hash\n end",
"def hash\n excl = @excl ? 1 : 0\n hash = excl\n hash ^= @begin.hash << 1\n hash ^= @end.hash << 9\n hash ^= excl << 24;\n # Are we throwing away too much here for a good hash value distribution?\n return hash & Fixnum::MAX\n end",
"def hash\n code.hash\n end",
"def hash # :nodoc:\n name.hash ^ type.hash ^ requirement.hash\n end",
"def hash\n @vbits.hash\n end",
"def hash\n Digest::SHA256.hexdigest( \"#{nonce}#{time}#{difficulty}#{prev}#{data}\" )\n end",
"def hash\n if @sha512hash != nil\n return @sha512hash.to_i(16)\n else\n super\n end\n end",
"def calc_hash(pass)\n salt_cost = SCrypt::Engine.autodetect_cost(self[:salt])\n SCrypt::Engine.scrypt(pass, self[:salt], salt_cost, 32).unpack('H*').first\n end",
"def hash\n [lac, cid, radio, mcc, mnc, signal, psc, asu, ta].hash\n end",
"def calculate_checksum\n last_checksum = previous_event&.checksum\n attrs = attributes.except(\"checksum\", \"id\", \"updated_at\").merge(last_checksum: last_checksum)\n cs = Digest::SHA256.hexdigest(attrs.to_s)\n puts \"#{id} calculate_checksum: #{cs} <- #{attrs} \" if Rails.env.development?\n Rails.logger.info(\"#{id} calculate_checksum: #{cs} <- #{attrs} \")\n return cs\n end",
"def hash\n code.hash\n end",
"def hash\n\t\t[@a, @b, self.class::D].hash\n\tend",
"def consistent_hash\n Zlib.crc32(self.to_yaml, 0)\n end",
"def hash\n @hash[:perm_type].hash ^\n @hash[:perms].hash ^\n @hash[:inheritance].hash ^\n @hash[:target].hash\n end",
"def hash( *strs )\n return Digest::MD5.hexdigest( strs.join )\n end",
"def hash\n @rank.hash ^ @suit.hash\n end",
"def hash\n return Digest::MD5.hexdigest(self.describe(' '))\n end",
"def hash\n @real.hash ^ @image.hash\n end",
"def to_hash() end",
"def hash_length\n super\n end",
"def hash_hash(h)\n require 'digest/md5'\n Digest::MD5.hexdigest(Marshal::dump(h.sort))\n end",
"def hash() source.hash ^ target.hash; end",
"def hash\n [first_name, last_name, address_one, address_two, city, state, zip, phone, email, country_code].hash\n end",
"def calculate_hash(input, prep_hashes)\n result = 0\n input.unpack('U*').each do |x|\n result += prep_hashes.hash(x)\n end\n (result % MOD_VALUE).to_s(HEX)\nend",
"def c_hash\n sha256 = Digest::SHA256.new\n token = @code.token.token\n hashed_token = sha256.digest(token)\n first_half = hashed_token[0...hashed_token.length / 2]\n Base64.urlsafe_encode64(first_half).tr('=', '')\n end",
"def hash(block)\n Digest::SHA256.hexdigest(block.to_s.encode)\n end",
"def calculate_hash\n\t\toptions = {:firstname => firstname, :email => email, :phone => phone, :txnid => txnid, :surl => surl, :furl => furl, :productinfo => productinfo, :amount => amount}\n\t\tservice = PayuIndia::Helper.new(payment_gateway_key, payment_gateway_salt, options)\n\t\tself.hast = service.generate_checksum\n\tend",
"def hash\n [rank, suit].hash\n end",
"def hash\n self.class.hash ^ left.hash ^ right.hash\n end",
"def generate_hash(*args)\n Digest::SHA3.hexdigest(args.join(''))\n end",
"def hash_code\n hash_code = {}\n self.seq.each do |letter|\n hash_code.keys.include?(letter) ? hash_code[letter] += 1 : hash_code[letter] = 1\n end\n hash_code\n end",
"def hashify_attributes(attrs)\n Hash.new.tap{ |h| attrs.each{|a| h[a] = self.send(a)} }\n end",
"def hash\n\n self.h.fei.hash\n end",
"def hash\n shasum.hash\n end",
"def hash\n shasum.hash\n end",
"def hash\n shasum.hash\n end",
"def hash\n attributes.hash\n end",
"def hash\n attributes.hash\n end"
] | [
"0.7118691",
"0.70400536",
"0.70400536",
"0.70400536",
"0.70400536",
"0.70400536",
"0.70400536",
"0.70400536",
"0.68960655",
"0.67847186",
"0.6707762",
"0.670052",
"0.6688737",
"0.66705376",
"0.6489735",
"0.6462376",
"0.6462376",
"0.64444333",
"0.6413127",
"0.6395483",
"0.63898623",
"0.6372129",
"0.635671",
"0.63370055",
"0.62682766",
"0.62533766",
"0.6246914",
"0.6230963",
"0.62173444",
"0.6214272",
"0.6214131",
"0.61962456",
"0.619165",
"0.61866295",
"0.6185355",
"0.6185355",
"0.6153702",
"0.6145376",
"0.6144877",
"0.6139152",
"0.6128312",
"0.61224943",
"0.61217207",
"0.61205214",
"0.61041045",
"0.61000645",
"0.60937095",
"0.60931146",
"0.60818595",
"0.60811466",
"0.60500103",
"0.60322344",
"0.6022704",
"0.6020012",
"0.6020012",
"0.6020012",
"0.6020012",
"0.6020012",
"0.6020012",
"0.6020012",
"0.6020012",
"0.6020012",
"0.6020012",
"0.60178953",
"0.6014942",
"0.5997442",
"0.59880185",
"0.598736",
"0.59799886",
"0.5972682",
"0.5969595",
"0.5969411",
"0.59594935",
"0.5957466",
"0.59423596",
"0.5942144",
"0.59245354",
"0.5924357",
"0.5904946",
"0.59025365",
"0.58536685",
"0.5847055",
"0.58454466",
"0.5845053",
"0.58447546",
"0.5844059",
"0.5842638",
"0.5840575",
"0.58391696",
"0.5825819",
"0.5824118",
"0.5823615",
"0.58184344",
"0.5815284",
"0.58124787",
"0.5810309",
"0.5808056",
"0.5808056",
"0.5808056",
"0.5806852",
"0.5806852"
] | 0.0 | -1 |
Builds the object from hash | def build_from_hash(attributes)
return nil unless attributes.is_a?(Hash)
self.class.swagger_types.each_pair do |key, type|
if type =~ /\AArray<(.*)>/i
# check to ensure the input is an array given that the the attribute
# is documented as an array but the input is not
if attributes[self.class.attribute_map[key]].is_a?(Array)
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
end
elsif !attributes[self.class.attribute_map[key]].nil?
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
end # or else data not found in attributes(hash), not an issue as the data can be optional
end
self
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build(hash)\n obj = new\n hash.each_pair do |k,v|\n obj[k] = v if variables[k]\n end\n return obj\n end",
"def build_from_hash(attributes)\n\n end",
"def build_from_hash(hash)\n instance = self.new\n\n # Add the instance attributes dynamically from the hash. If the attribute\n # does not already exist, then don't re-add the attribute class and\n # variable, just set it with the value from the hash\n hash.keys.each do |key|\n class_eval { attr_accessor key } unless instance.methods.include?(key.to_sym)\n instance.instance_variable_set \"@#{key}\", hash[key]\n end\n\n instance\n end",
"def build(hash, track_changes = true)\n resource = fields.each_with_object(new) do |field, r|\n value = hash.fetch(field.to_s, hash[field.to_sym])\n r.send(\"#{field}=\", value)\n end\n resource.clear_changes! unless track_changes\n resource\n end",
"def initialize hash\n @hash = hash\n end",
"def build(params)\n return new(params) if params.is_a?(Hash)\n raise(\"unexpected parameter, expected Hash, received #{params.class}\")\n end",
"def initialize( hash )\n\t\t\t@hash = hash.dup\n\t\t\t@dirty = false\n\t\tend",
"def initialize(a_hash)\n from_h(a_hash)\n end",
"def initialize\n\t\t\t@hash = {}\n\t\tend",
"def initialize(hash)\n @hash = hash\n @converted = {}\n end",
"def initialize(hash)\n @short_code = hash[\"short_code\"]\n @name = hash[\"name\"]\n @id = hash[\"id\"]\n end",
"def initialize(hash)\n super(hash)\n end",
"def initialize\n @h = new_hash\n end",
"def new_from_hash(hash)\n if hash == nil\n self.class.new.assign(self)\n else\n hash_obj = hash\n if hash.instance_of?(Hash)\n hash_obj = self.class.new\n merge_hash_into_object(hash, hash_obj)\n end\n instance = self.class.new\n object_assign(instance, hash_obj)\n end\n end",
"def initialize(hash={})\n @hash = hash\n end",
"def initialize\n @hash = {}\n end",
"def initialize\n @hash = {}\n end",
"def initialize(hash)\r\n hash.each { |k, v|\r\n # Create getters and setters\r\n self.class.attr_accessor(k)\r\n # Set value for created variable\r\n self.send(\"#{k}=\", v)\r\n }\r\n self.class.all.push(self)\r\n end",
"def build!(hash)\n hash.must(::Hash) { raise ArgumentError, \"#{self} expects Hash, but got #{hash.class}\" }\n\n if hash.size != variables.size\n keys1 = variables.keys\n keys2 = hash.keys.map(&:to_s)\n minus = (keys1 - keys2).map{|i| \"-#{i}\"}\n plus = (keys2 - keys1).map{|i| \"+#{i}\"}\n \n msg = \"#{self} expects #{variables.size}, but got #{hash.size} (%s)\" % (minus + plus).join(\",\")\n raise Typed::SizeMismatch, msg\n end\n\n # 'build' just ignore unknown fields, but 'build!' raise errors\n obj = new\n hash.each_pair do |k,v|\n obj[k] = v\n end\n return obj\n end",
"def initialize(hash)\n @cw_id = hash[\"cw_id\"]\n @cik = hash[\"cik\"]\n @name = hash[\"company_name\"]\n @irs_number = hash[\"irs_number\"]\n @sic_code = hash[\"sic_code\"]\n @industry = hash[\"industry_name\"]\n @sic_sector = hash[\"sic_sector\"]\n @sector_name = hash[\"sector_name\"]\n @source_type = hash[\"source_type\"]\n @address = hash[\"raw_address\"]\n @country = hash[\"country_code\"]\n @state = hash[\"subdiv_code\"]\n @top_parent_id = hash[\"top_parent_id\"]\n @num_parents = hash[\"num_parents\"]\n @num_children = hash[\"num_children\"]\n @max_year = hash[\"max_year\"]\n @min_year = hash[\"min_year\"]\n end",
"def from_hash(hash)\n instance = allocate\n instance.instance_variable_set :@attributes, hash.freeze\n instance\n end",
"def from_hash(hash)\n hash = DEFAULTS.merge(hash)\n hash['spdx_id'] = hash.delete('spdx-id')\n ordered_array = hash.values_at(*members.map(&:to_s))\n new(*ordered_array)\n end",
"def initialize(hash=nil)\n @table = HashWithIndifferentAccess.new\n\n for k,v in hash\n @table[k] = v\n new_ostruct_member(k)\n end if hash\n end",
"def from_hash(hash)\n hash.each_pair do |key, value|\n\n # We need to catch hashes representing child objects\n # If the hash key:value is a of a Hash/BSON:Ordered hash\n if hash[key].class == Hash || hash[key].class == BSON::OrderedHash\n # If we have a classname we know we need to return to an object\n if hash[key][\"@classname\"]\n self.instance_variable_set(key, ::Object::full_const_get(hash[key][\"@classname\"]).new(hash[key])) unless key.to_s.start_with?(\"_\")\n else\n self.instance_variable_set(key, value) unless key.to_s.start_with?(\"_\")\n end\n else\n self.instance_variable_set(key, value) unless key.to_s.start_with?(\"_\")\n end\n end\n end",
"def from_hash(hash)\n hash.each_pair do |key, value|\n\n # We need to catch hashes representing child objects\n # If the hash key:value is a of a Hash/BSON:Ordered hash\n if hash[key].class == Hash || hash[key].class == BSON::OrderedHash\n # If we have a classname we know we need to return to an object\n if hash[key][\"@classname\"]\n self.instance_variable_set(key, ::Object::full_const_get(hash[key][\"@classname\"]).new(hash[key])) unless key.to_s.start_with?(\"_\")\n else\n self.instance_variable_set(key, value) unless key.to_s.start_with?(\"_\")\n end\n else\n self.instance_variable_set(key, value) unless key.to_s.start_with?(\"_\")\n end\n end\n end",
"def initialize(hash)\n @hash = hash\n @data = resourcify_data\n end",
"def from_hash hash\n @id= hash['id']\n\n @admin= hash['admin']\n @username= hash['username']\n @timezone= hash['timezone']\n @email_address= hash['email_address']\n\n @password = nil\n\n @created_at= DateTime.parse(hash['created_at'])\n @updated_at= DateTime.parse(hash['updated_at'])\n end",
"def hash_to_obj hash\n OpenStruct.new(hash) rescue raise ConfigError, \"Can't convert setup to object\"\n end",
"def initialize(hash)\n load_hash(hash)\n end",
"def from_hash( h)\n\t\th.each { |name,attributes|\n\t\t\tklass = Klass.new\n\t\t\tklass.from_hash( { name => attributes } )\n\t\t\tself.add_class( klass)\n\t\t}\n\n\t\t# this is an experiment in handling \"through\" attributes\n\t\t# i.e. enriching the model with the join classes\n\tend",
"def initialize(*args)\n super\n # hash = {}\n end",
"def build_object(resp)\n return resp unless resp.respond_to?(:merge)\n @build_object ||= final_object_class.new(resp.merge(additional_hash_to_serialize_after_response))\n end",
"def from_hash(hash)\n ordered_array = hash.values_at(*members.map(&:to_s))\n new(*ordered_array)\n end",
"def __convert hash #:nodoc:\n instance = self.class.new\n hash.each do |k, v|\n k = k.to_s if !k.respond_to?(:to_sym) && k.respond_to?(:to_s)\n instance.new_ostruct_member k\n if v.is_a?(Hash)\n v = v[\"type\"] == \"hash\" ? v[\"contents\"] : __convert(v)\n elsif v.is_a?(Array)\n v = v.map{|e| e.instance_of?(Hash) ? __convert(e) : e}\n end\n instance.send \"#{k}=\".to_sym, v\n end\n instance\n end",
"def initialize(hash)\n\t\t@id = hash['id']\n\t\t@first_name = hash['first_name']\n\t\t@last_name = hash['last_name']\n\t\t@mentor = hash['mentor']\n\tend",
"def initialize(hash={})\n @name = validate_name(hash[:name])\n @description = hash[:description]\n @snmp_opts = hash[:snmp_opts]\n\n save # Save a copy of self to Redis on creation\n end",
"def initialize\n @hash_dict = {}\n end",
"def initialize(hash=nil)\n @attributes = hash\n @attributes ||= {}\n end",
"def initialize(hash={})\n self.init_attrs_from_hash(hash)\n end",
"def from_hash(hash)\n apply_nested_hash(hash)\n end",
"def initialize(hash)\n # @id = hash[\"id\"]\n # @street_address = hash[\"street_address\"]\n # @city = hash[\"city\"]\n # @state = hash[\"state\"]\n # @zipcode = hash[\"zipcode\"]\n # @country = hash[\"country\"]\n\n #add in correct details\n end",
"def from_hash(hash)\n @data_object.user_acc_name = hash['user_acc_name']\n @data_object.user_affiliate = hash['user_affiliate']\n @user_over_13 = hash['user_over_13']\n\n contact.from_hash(hash)\n end",
"def initialize(hash)\n @name = hash[\"campaign\"] #decided to change it to \"name\" since this is the campaign class\n date_elements = hash[\"date\"].split(\"/\") #date is being passed in as a string, need this array to create the Date object in the next line\n @date = Date.new(date_elements[2].to_i + 2000, date_elements[0].to_i, date_elements[1].to_i) #added 2000 to year since the program was considering it as the year 15; this creates the date object\n @spend = hash[\"spend\"].to_f #use .to_f to make sure spend comes in as a float instead of a string\n @impressions = hash[\"impressions\"].to_i #need it as an integer for counting purposes later\n @actions = JSON.parse(hash[\"actions\"])#ensures that each action comes in as an array instead of a string\n @@all << self #shovels it into the all array\n end",
"def initialize(hash)\n hash.each do |k, v|\n self.send(\"#{k}=\", v) if self.respond_to?(\"#{k}=\")\n end\n @id = hash[\"id\"]\n end",
"def initialize (hash)\n hash.each {|key, value|\n self.class.attr_accessor(key)\n self.send((\"#{key}=\"), value)\n }\n @@all << self\n end",
"def initialize(hash={})\n @data = Hash.new\n hash.each do |key, value|\n self[key] = value\n end\n end",
"def create_from_hash(hash, opts={})\n create_opts = update_or_create_options(hash, opts)\n create { |instance| instance.set(create_opts) }\n end",
"def initialize(hash={})\n # assign the attributes here (???)\n hash.each do |k, v| # name = id, name, etc.\n self.send(\"#{k}=\", v)\n # self.k = v # there's no '.k' method\n #binding.pry\n end\n end",
"def initialize(hash) #.new\n @name = hash[:name][0]\n @region = hash[:region]\n @population = hash[:population]\n @capital = hash[:capital]\n @flag_link = hash[:flag_link]\n @@all << self\n #binding.pry\n end",
"def initialize(hash = {})\n super(hash)\n\n @action = extract_value(hash, :action)\n @clientId = extract_value(hash, :clientId)\n @clientIdAlias = extract_value(hash, :clientIdAlias)\n @clientIdAliasUsed = extract_boolean_value(hash, :clientIdAliasUsed)\n @expiresAt = extract_integer_value(hash, :expiresAt)\n @subject = extract_value(hash, :subject)\n @scopes = extract_value(hash, :scopes)\n @existent = extract_boolean_value(hash, :existent)\n @usable = extract_boolean_value(hash, :usable)\n @sufficient = extract_boolean_value(hash, :sufficient)\n @refreshable = extract_boolean_value(hash, :refreshable)\n @responseContent = extract_value(hash, :responseContent)\n @properties = extract_array_value(hash, :scopes) do |element|\n Authlete::Model::Property.parse(element)\n end\n end",
"def initialize( hash )\n\t\t@object_classes = self.parse_objectclasses( hash['objectClasses'] || [] )\n\t\t@attribute_types = self.parse_attribute_types( hash['attributeTypes'] || [] )\n\t\t@ldap_syntaxes = self.parse_ldap_syntaxes( hash['ldapSyntaxes'] || [] )\n\t\t@matching_rules = self.parse_matching_rules( hash['matchingRules'] || [] )\n\t\t@matching_rule_uses = self.parse_matching_rule_uses( hash['matchingRuleUse'] || [] )\n\tend",
"def from_hash(hash)\n super(hash)\n verify\n end",
"def objects_from_serialized_hash(hash) # :nodoc:\n klass, attributes = Helpers.to_class_and_attributes(hash)\n klass.from_seedable_attributes(attributes)\n end",
"def initialize (hash)\n @name = hash [:name]\n @color = hash [:color]\n @robots = hash [:robots]\n @moon_count = hash [:moon_count]\n @cats = hash [:cats]\n #@solar_rotation = solar_rotation .....I dont really understand what a solar rotation is.... it's confusing.....\n @distance_from_the_sun = hash [:distance_from_the_sun]\n end",
"def initialize(hash = nil)\n @arguments = 0\n return if hash.nil?\n @name = hash['name']\n @arguments = hash['arguments']\n end",
"def _from_hash(hsh)\n hsh.each do |k, v|\n v = restore_hash(v)\n v = v.map { |iv| restore_hash(iv) } if v.is_a?(Array)\n send(:\"#{k}=\", v)\n end\n self\n end",
"def from_hash(hash)\n struct = SparkleStruct.new\n struct._camel_keys_set(:auto_discovery)\n struct._load(hash)\n struct._camel_keys_set(nil)\n struct\n end",
"def from_hash(hash)\n struct = SparkleStruct.new\n struct._camel_keys_set(:auto_discovery)\n struct._load(hash)\n struct._camel_keys_set(nil)\n struct\n end",
"def initialize(hash={})\n self.attributes = hash\n end",
"def initialize(raw_hash)\n if valid_hash?(raw_hash)\n self.replace(raw_hash)\n @version, @cost, @salt, @checksum = split_hash(self)\n else\n raise Errors::InvalidHash.new(\"invalid hash\")\n end\n end",
"def initialize(raw_hash)\n if valid_hash?(raw_hash)\n self.replace(raw_hash)\n @version, @cost, @salt, @checksum = split_hash(self)\n else\n raise Errors::InvalidHash.new(\"invalid hash\")\n end\n end",
"def build(base, object, type = nil, selected_fields = nil)\n return object unless object.is_a?(Hash)\n if _loading?\n Factory.from_db(klass, object, nil, selected_fields)\n else\n Factory.build(klass, object)\n end\n end",
"def initialize(hash)\n super(hash)\n @size = hash[\"size\"]\n end",
"def initialize(raw_hash)\n if valid_hash?(raw_hash)\n self.replace(raw_hash)\n @cost, @salt, @digest = split_hash(self.to_s)\n else\n raise Errors::InvalidHash.new(\"invalid hash\")\n end\n end",
"def instantiate hash, extra_attributes={}\n return hash unless hash.kind_of? Hash\n# init = hash.values_at(*@singulars).compact.first\n init = hash[@singular]\n inits = hash[@plural]\n if init\n new init.merge extra_attributes\n elsif inits\n inits.map {|each| new each.merge extra_attributes}\n else\n hash\n end\n end",
"def from_hash(values)\n @data_object.team_challenge = values['team_challenge']\n @data_object.team_level = values['team_level']\n @data_object.team_name = values['team_name']\n\n# @mgr_email = values['mgr_email']\n\n names = values['tm_name']\n\n TeamMember::MEMBERS_PER_TEAM.times do |i|\n if names[i].empty?\n @members[i].clear\n else\n @members[i].tm_name = names[i]\n @members[i].tm_grade = values['tm_grade'][i].to_i\n @members[i].tm_dob_mon = values['tm_dob_mon'][i]\n @members[i].tm_dob_day = values['tm_dob_day'][i]\n @members[i].tm_dob_year = values['tm_dob_year'][i]\n @members[i].tm_sex = values['tm_sex'][i]\n end\n end\n end",
"def hash\n { hash: @hash, hashType: @hash_type }\n end",
"def initialize(raw_hash)\n raise Errors::InvalidHash, 'invalid hash' unless valid_hash?(raw_hash)\n\n replace(raw_hash)\n\n @cost, @salt, @digest = split_hash(to_s)\n end",
"def initialize( confighash={} )\n\t\tihash = internify_keys( untaint_values(confighash) )\n\t\tmergedhash = DEFAULTS.merge( ihash, &HashMergeFunction )\n\n\t\t@struct = ConfigStruct.new( mergedhash )\n\t\t@create_time = Time.now\n\t\t@name = nil\n\t\t@loader = nil\n\n\t\tsuper()\n\tend",
"def initialize(*args)\n @hash = HashWithIndifferentAccess.new(*args)\n end",
"def create(hash={})\n model = self.new(hash)\n model.save\n model\n end",
"def from_hash(hash:, klass:)\n validate_class_kit(klass)\n\n @hash_helper.indifferent!(hash)\n entity = klass.new\n attributes = @attribute_helper.get_attributes(klass)\n attributes.each do |attribute|\n key = attribute[:name]\n type = attribute[:type]\n\n #if the hash value is nil skip it\n next if hash[key].nil?\n\n value = if is_class_kit?(type)\n from_hash(hash: hash[key], klass: type)\n elsif type == Array\n hash[key].map do |array_element|\n if attribute[:collection_type].nil?\n array_element\n else\n if is_class_kit?(attribute[:collection_type])\n from_hash(hash: array_element, klass: attribute[:collection_type])\n else\n @value_helper.parse(type: attribute[:collection_type], value: array_element)\n end\n end\n end\n else\n hash[key]\n end\n\n entity.public_send(:\"#{key}=\", value)\n end\n\n entity\n end",
"def from_h(hash, converter = nil)\n instance = new\n\n hash.each do |k, v|\n v = convert(v, k, converter) if converter\n instance.instance_variable_set(:\"@#{k}\", v)\n end\n\n instance\n end",
"def initialize(hash_that_represents_json)\n\t\t@data = hash_that_represents_json\n\tend",
"def hash_for_merging(hash)\n new_hash = { id: hash['message_id'].to_i,\n date: Time.at(hash['date'].to_i),\n from: User.new(hash['from'], @bot),\n chat: Chat.new(hash['chat'], @bot) }\n\n type = TYPES.find { |t| hash[t.to_s] }\n new_hash[type] = hash[type.to_s] # TODO: fail if type not found\n\n new_hash\n end",
"def initialize(hash)\n @header = Msg::Header.new(hash)\n @body = Msg::Body.new(content_is_json?, hash)\n end",
"def build_resource(hash = {})\n self.resource = resource_class.new(hash)\n end",
"def initialize()\n @hash = {}\n @values = []\n end",
"def build\n fail \"Please provide a value for key, currently: #{key}\" if key.nil?\n\n if in_key\n { in_key.to_sym => { key => data } }\n else\n process_data\n transform_to_hash\n end\n end",
"def initialize(build)\n @build = build\n @hash = {}\n @already_run = []\n end",
"def new_from_hash_marketplace(h)\n self.url = h\n h=h.split('/')\n h=h[h.size-2]\n self.original_id = h\n return self\n end",
"def initialize(hash, type, dump)\n self.hash = hash\n self.type = type.to_sym\n self.dump = dump\n end",
"def initialize(hash_data, opts: {})\n @hsh = hash_data\n @opts = opts\n\n @title = @hsh[:title]\n @body = @hsh[:body_hash]\n end",
"def initialize(hash)\n @color = hash[:color]\n @scent = hash[:scent]\n end",
"def initialize(hash = nil)\n hash.each { |key, value| self[key] = value } if !hash.nil? && hash.is_a?(Hash)\n end",
"def create(hash)\n NotImplementedError\n end",
"def from_h(hash, converter = nil)\n instance = new\n\n hash.each do |k, v|\n v = instance.convert(v, k, converter) if converter\n instance.send(:\"#{k}=\", v)\n end\n\n instance\n end",
"def init_jaxb_json_hash(_o)\n super _o\n @id = String.from_json(_o['id']) unless _o['id'].nil?\n @version = String.from_json(_o['version']) unless _o['version'].nil?\n @description = String.from_json(_o['description']) unless _o['description'].nil?\n @url = String.from_json(_o['url']) unless _o['url'].nil?\n @name = String.from_json(_o['name']) unless _o['name'].nil?\n @organization = Org::Apache::Archiva::Metadata::Model::Organization.from_json(_o['organization']) unless _o['organization'].nil?\n @issueManagement = Org::Apache::Archiva::Metadata::Model::IssueManagement.from_json(_o['issueManagement']) unless _o['issueManagement'].nil?\n @scm = Org::Apache::Archiva::Metadata::Model::Scm.from_json(_o['scm']) unless _o['scm'].nil?\n @ciManagement = Org::Apache::Archiva::Metadata::Model::CiManagement.from_json(_o['ciManagement']) unless _o['ciManagement'].nil?\n if !_o['licenses'].nil?\n @licenses = Array.new\n _oa = _o['licenses']\n _oa.each { | _item | @licenses.push Org::Apache::Archiva::Metadata::Model::License.from_json(_item) }\n end\n if !_o['mailingLists'].nil?\n @mailingLists = Array.new\n _oa = _o['mailingLists']\n _oa.each { | _item | @mailingLists.push Org::Apache::Archiva::Metadata::Model::MailingList.from_json(_item) }\n end\n if !_o['dependencies'].nil?\n @dependencies = Array.new\n _oa = _o['dependencies']\n _oa.each { | _item | @dependencies.push Org::Apache::Archiva::Metadata::Model::Dependency.from_json(_item) }\n end\n @incomplete = Boolean.from_json(_o['incomplete']) unless _o['incomplete'].nil?\n end",
"def create_version_hash\n new_version = {}\n new_version['created'] = ''\n new_version['message'] = ''\n new_version['user'] = {}\n # user is #name, # address.\n new_version['user']['name'] = ''\n new_version['user']['address'] = ''\n new_version['state'] = {}\n new_version\n end",
"def create_from_hash hash\n values = values_from_hash hash\n unless obj = find(:first, :conditions => values)\n return nil if values[:id]\n obj = create!(values)\n raise ArgumentError, \"#{obj.errors.to_s}\" unless obj.errors.empty?\n end\n obj\n end",
"def initialize result_hash={}\n @result_hash = result_hash\n end",
"def create_hash(&block); end",
"def create_hash(&block); end",
"def initialize(attrs={})\n from_hash(attrs)\n end",
"def build_request_data(hash)\n {\n :attributes! => {\n addressinfo: { \"xsi:type\" => \"ns2:Map\" },\n },\n username: @username,\n password: @password,\n addressinfo: {\n item: [\n { key: 'name', value: hash[:name] },\n { key: 'address1', value: hash[:address1] },\n { key: 'address2', value: hash[:address2] },\n { key: 'city', value: hash[:city] },\n { key: 'state', value: hash[:state] },\n { key: 'zip', value: hash[:zip] },\n { key: 'fflno', value: hash[:fflno] },\n { key: 'fflexp', value: hash[:fflexp] }\n ]\n },\n testing: @testing\n }\n end",
"def init_jaxb_json_hash(_o)\n @groupId = String.from_json(_o['groupId']) unless _o['groupId'].nil?\n @artifactId = String.from_json(_o['artifactId']) unless _o['artifactId'].nil?\n @version = String.from_json(_o['version']) unless _o['version'].nil?\n @packaging = String.from_json(_o['packaging']) unless _o['packaging'].nil?\n @className = String.from_json(_o['className']) unless _o['className'].nil?\n if !_o['repositories'].nil?\n @repositories = Array.new\n _oa = _o['repositories']\n _oa.each { | _item | @repositories.push String.from_json(_item) }\n end\n @bundleVersion = String.from_json(_o['bundleVersion']) unless _o['bundleVersion'].nil?\n @bundleSymbolicName = String.from_json(_o['bundleSymbolicName']) unless _o['bundleSymbolicName'].nil?\n @bundleExportPackage = String.from_json(_o['bundleExportPackage']) unless _o['bundleExportPackage'].nil?\n @bundleExportService = String.from_json(_o['bundleExportService']) unless _o['bundleExportService'].nil?\n @classifier = String.from_json(_o['classifier']) unless _o['classifier'].nil?\n @includePomArtifacts = Boolean.from_json(_o['includePomArtifacts']) unless _o['includePomArtifacts'].nil?\n @queryTerms = String.from_json(_o['queryTerms']) unless _o['queryTerms'].nil?\n @bundleImportPackage = String.from_json(_o['bundleImportPackage']) unless _o['bundleImportPackage'].nil?\n @bundleRequireBundle = String.from_json(_o['bundleRequireBundle']) unless _o['bundleRequireBundle'].nil?\n @pageSize = Fixnum.from_json(_o['pageSize']) unless _o['pageSize'].nil?\n @selectedPage = Fixnum.from_json(_o['selectedPage']) unless _o['selectedPage'].nil?\n end",
"def initialize(order_hash)\n @id = order_hash['id']\n @number = order_hash['number']\n @special_instructions = order_hash['special_instructions']\n @total = order_hash['total']\n @total_quantity = order_hash['total_quantity']\n @created_at = order_hash['created_at']\n @updated_at = order_hash['updated_at']\n end",
"def from_db_hash *args\n from_hash *args\n end",
"def build_from_hash(attributes)\n return nil unless attributes.is_a?(Hash)\n self.class.swagger_types.each_pair do |key, type|\n if type =~ /^Array<(.*)>/i\n if attributes[self.class.attribute_map[key]].is_a?(Array)\n self.send(\"#{key}=\", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )\n else\n #TODO show warning in debug mode\n end\n elsif !attributes[self.class.attribute_map[key]].nil?\n self.send(\"#{key}=\", _deserialize(type, attributes[self.class.attribute_map[key]]))\n else\n # data not found in attributes(hash), not an issue as the data can be optional\n end\n end\n\n self\n end",
"def build_from_hash(attributes)\n return nil unless attributes.is_a?(Hash)\n self.class.swagger_types.each_pair do |key, type|\n if type =~ /^Array<(.*)>/i\n if attributes[self.class.attribute_map[key]].is_a?(Array)\n self.send(\"#{key}=\", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )\n else\n #TODO show warning in debug mode\n end\n elsif !attributes[self.class.attribute_map[key]].nil?\n self.send(\"#{key}=\", _deserialize(type, attributes[self.class.attribute_map[key]]))\n else\n # data not found in attributes(hash), not an issue as the data can be optional\n end\n end\n\n self\n end",
"def build_from_hash(attributes)\n return nil unless attributes.is_a?(Hash)\n self.class.swagger_types.each_pair do |key, type|\n if type =~ /^Array<(.*)>/i\n if attributes[self.class.attribute_map[key]].is_a?(Array)\n self.send(\"#{key}=\", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )\n else\n #TODO show warning in debug mode\n end\n elsif !attributes[self.class.attribute_map[key]].nil?\n self.send(\"#{key}=\", _deserialize(type, attributes[self.class.attribute_map[key]]))\n else\n # data not found in attributes(hash), not an issue as the data can be optional\n end\n end\n\n self\n end"
] | [
"0.8011074",
"0.7470833",
"0.7457607",
"0.7256629",
"0.72455454",
"0.70060325",
"0.6973257",
"0.6955014",
"0.69459796",
"0.69398683",
"0.69363195",
"0.6917627",
"0.6872358",
"0.6796184",
"0.6783521",
"0.67575246",
"0.67575246",
"0.67560464",
"0.67514306",
"0.67136854",
"0.66667664",
"0.6623634",
"0.661206",
"0.66098964",
"0.66098964",
"0.6591922",
"0.65713006",
"0.6547411",
"0.6524743",
"0.6524143",
"0.6513636",
"0.650189",
"0.6498057",
"0.6485853",
"0.6483371",
"0.6475685",
"0.6459916",
"0.6454491",
"0.6440182",
"0.6434778",
"0.6401363",
"0.63977015",
"0.6396885",
"0.63910425",
"0.63720834",
"0.6363958",
"0.63597506",
"0.6313429",
"0.6295958",
"0.62923384",
"0.62915224",
"0.62704456",
"0.62703115",
"0.62622243",
"0.62515473",
"0.6249854",
"0.6242987",
"0.6242987",
"0.62426233",
"0.62408733",
"0.62407595",
"0.62321323",
"0.62298346",
"0.622897",
"0.622756",
"0.62245685",
"0.62217826",
"0.6218501",
"0.6210329",
"0.62091905",
"0.620342",
"0.6201614",
"0.6178616",
"0.6166234",
"0.61611027",
"0.6140086",
"0.6126761",
"0.61154264",
"0.61059844",
"0.60980254",
"0.60971874",
"0.6090533",
"0.6064119",
"0.6061236",
"0.6060324",
"0.60599816",
"0.60420287",
"0.6039776",
"0.603712",
"0.6033585",
"0.6030829",
"0.6023582",
"0.6023582",
"0.6016123",
"0.60155296",
"0.6014705",
"0.6008574",
"0.60031897",
"0.60024095",
"0.60024095",
"0.60024095"
] | 0.0 | -1 |
Deserializes the data based on type | def _deserialize(type, value)
case type.to_sym
when :DateTime
DateTime.parse(value)
when :Date
Date.parse(value)
when :String
value.to_s
when :Integer
value.to_i
when :Float
value.to_f
when :BOOLEAN
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
true
else
false
end
when :Object
# generic object (usually a Hash), return directly
value
when /\AArray<(?<inner_type>.+)>\z/
inner_type = Regexp.last_match[:inner_type]
value.map { |v| _deserialize(inner_type, v) }
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
k_type = Regexp.last_match[:k_type]
v_type = Regexp.last_match[:v_type]
{}.tap do |hash|
value.each do |k, v|
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
end
end
else # model
temp_model = Reepay.const_get(type).new
temp_model.build_from_hash(value)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Telstra_Messaging.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = FattureInCloud.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = IFClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = WineShipping.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n DearInventoryRuby.const_get(type).build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Mooncard.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Aimastering.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Harbor1Client.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Intrinio.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Intrinio.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Intrinio.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Intrinio.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Intrinio.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Intrinio.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Intrinio.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Pier.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Pier.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Pier.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Pier.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Pier.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Pier.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Pier.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Pier.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Pier.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Pier.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = CrelateClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = CrelateClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = CrelateClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = CrelateClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = CrelateClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = WellsFargoAchClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ArtikCloud.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Dkron.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n MailSlurpClient.const_get(type).build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n MailSlurpClient.const_get(type).build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Esi.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Esi.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Esi.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Fastly.const_get(type)\n klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Fastly.const_get(type)\n klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Fastly.const_get(type)\n klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Fastly.const_get(type)\n klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n ::DateTime.parse(value)\n when :Date\n ::Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Models.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n ::DateTime.parse(value)\n when :Date\n ::Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Models.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Hubspot::Cms::Performance.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = SmoochApi.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Tradenity.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Tradenity.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = SamplifyAPIClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = OpsgenieClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = LemonWayClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = BudgeaClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = BudgeaClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n Nodeum.const_get(type).build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = TextMagic.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = TextMagic.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = TextMagic.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n Date.parse value\n when :Date\n Date.parse value\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else\n # model\n temp_model = GroupDocsViewerCloud.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n Date.parse value\n when :Date\n Date.parse value\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else\n # model\n temp_model = GroupDocsViewerCloud.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n Date.parse value\n when :Date\n Date.parse value\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else\n # model\n temp_model = GroupDocsViewerCloud.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ConnectWise.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ConnectWise.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ConnectWise.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ConnectWise.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ConnectWise.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ConnectWise.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ConnectWise.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ConnectWise.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ConnectWise.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ConnectWise.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ConnectWise.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ConnectWise.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ConnectWise.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ConnectWise.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = NSXT.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = NSXT.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = NSXT.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = TreezorClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = TreezorClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = TreezorClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = SwiftApi.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = SwiftApi.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = TripletexApi.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = unwiredClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Quandoo.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end"
] | [
"0.7330926",
"0.7274019",
"0.72504056",
"0.7245751",
"0.72291344",
"0.72291344",
"0.72291344",
"0.72291344",
"0.72291344",
"0.72291344",
"0.72291344",
"0.72291344",
"0.72291344",
"0.72291344",
"0.72291344",
"0.72291344",
"0.72291344",
"0.72291344",
"0.72291344",
"0.72291344",
"0.7218884",
"0.7213926",
"0.71909",
"0.7183136",
"0.71796805",
"0.71796805",
"0.71796805",
"0.71796805",
"0.71796805",
"0.71796805",
"0.71796805",
"0.71791923",
"0.71791923",
"0.71791923",
"0.71791923",
"0.71791923",
"0.71791923",
"0.71791923",
"0.71791923",
"0.71791923",
"0.71791923",
"0.71712995",
"0.71712995",
"0.71712995",
"0.71712995",
"0.71712995",
"0.71632504",
"0.71549904",
"0.71473306",
"0.71413666",
"0.71413666",
"0.7141116",
"0.7141116",
"0.7141116",
"0.7133874",
"0.7133874",
"0.7133874",
"0.7133874",
"0.71333444",
"0.71333444",
"0.7127688",
"0.7125744",
"0.71210617",
"0.71210617",
"0.71190786",
"0.71184087",
"0.711393",
"0.7113519",
"0.7113519",
"0.7113516",
"0.71119875",
"0.71119875",
"0.71119875",
"0.7105169",
"0.7105169",
"0.7105169",
"0.7104928",
"0.7104928",
"0.7104928",
"0.7104928",
"0.7104928",
"0.7104928",
"0.7104928",
"0.7104928",
"0.7104928",
"0.7104928",
"0.7104928",
"0.7104928",
"0.7104928",
"0.7104928",
"0.7102596",
"0.7102596",
"0.7102596",
"0.7101596",
"0.7101596",
"0.7101596",
"0.70996517",
"0.70996517",
"0.7097952",
"0.7097185",
"0.70965225"
] | 0.0 | -1 |
Returns the string representation of the object | def to_s
to_hash.to_s
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_s\n @object.to_s\n end",
"def to_s\n object.to_s\n end",
"def serialize(object)\n object.to_s\n end",
"def to_s\n self.inspect\n end",
"def to_s\n @string || @object.to_s('F')\n end",
"def to_s\n @string || @object.to_s('F')\n end",
"def to_s\n \"#<#{self.class.name}:#{object_id} #{info}>\"\n end",
"def to_s\n \"#<#{self.class.name}:#{object_id}> @names=#{names}>\"\n end",
"def to_s\n self.inspect\n end",
"def to_s\n toString()\n end",
"def to_s\r\n dump\r\n end",
"def to_s\n inspect\n end",
"def to_s\n toString\n end",
"def toString\n #Not sure if we want this or just use the getters for more\n #selective formatting\n end",
"def to_s\n\t\t\t@string\n\t\tend",
"def to_s\n stringify\n end",
"def to_s\n to_h.to_s\n end",
"def to_s\n @string\n end",
"def to_s\n @string\n end",
"def to_s\n @string\n end",
"def to_s\n @string\n end",
"def to_s\n @string\n end",
"def to_s\n @string\n end",
"def to_s\n @string\n end",
"def to_s\n @string\n end",
"def inspect\n serialize.to_s\n end",
"def inspect\n to_s\n end",
"def to_s\n @string ||= Builder::ToString.new(self).string\n end",
"def to_s\n self\n end",
"def to_s()\n serialize.to_s()\n end",
"def to_s()\n serialize.to_s()\n end",
"def to_s\n string\n end",
"def to_s\n inspect\n end",
"def to_s\n inspect\n end",
"def inspect\n to_s\n end",
"def inspect\n to_s\n end",
"def inspect\n to_s\n end",
"def inspect\n to_s\n end",
"def inspect\n to_s\n end",
"def inspect\n to_s\n end",
"def inspect\n to_s\n end",
"def inspect\n self.to_s\n end",
"def inspect\n self.to_s\n end",
"def inspect\n to_s\n end",
"def inspect\n to_s\n end",
"def to_s\n end",
"def to_s\n end",
"def to_s\n end",
"def to_s\n end",
"def inspect\n to_s.inspect\n end",
"def inspect()\n serialize.to_s()\n end",
"def inspect()\n serialize.to_s()\n end",
"def inspect\n return self.to_s\n end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end",
"def to_s; end"
] | [
"0.901024",
"0.89506465",
"0.84703195",
"0.83409667",
"0.8337169",
"0.8337169",
"0.8332247",
"0.82546586",
"0.8145818",
"0.8144667",
"0.81357557",
"0.812714",
"0.8093436",
"0.8086725",
"0.8073356",
"0.8039774",
"0.80308646",
"0.80064154",
"0.80064154",
"0.80064154",
"0.80064154",
"0.7962831",
"0.7962831",
"0.7962831",
"0.7962831",
"0.7954296",
"0.79446983",
"0.7919419",
"0.7909274",
"0.78848016",
"0.78848016",
"0.78841925",
"0.788328",
"0.788328",
"0.78758216",
"0.78758216",
"0.78758216",
"0.78758216",
"0.78758216",
"0.78758216",
"0.78758216",
"0.7866813",
"0.7866813",
"0.7865939",
"0.7865939",
"0.7850519",
"0.7850519",
"0.7850519",
"0.7850519",
"0.7808076",
"0.7784745",
"0.7784745",
"0.7767656",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824",
"0.77608824"
] | 0.0 | -1 |
to_body is an alias to to_hash (backward compatibility) | def to_body
to_hash
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_body\r\n to_hash\r\n end",
"def to_body\n to_hash\nend",
"def to_body\n to_hash\nend"
] | [
"0.84287274",
"0.8345594",
"0.8345594"
] | 0.0 | -1 |
Returns the object in the form of hash | def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
next if value.nil?
hash[param] = _to_hash(value)
end
hash
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_hash\n object\n end",
"def hash\r\n return to_s.hash\r\n end",
"def hash\n to_a.hash\n end",
"def hash\n [_hash, name, owner].hash\n end",
"def hash\n return to_s.hash\n end",
"def hash\n @hash\n end",
"def hash\n @hash.hash\n end",
"def hash\n @hash ||= self.to_a.hash\n end",
"def to_hash\n @hash\n end",
"def to_hash\n @hash\n end",
"def hash\n to_s.hash\n end",
"def to_hash\n @hash\n end",
"def to_h\n @object\n end",
"def to_h\n @object\n end",
"def to_h\n @object\n end",
"def to_h\n @object\n end",
"def to_h\n @object\n end",
"def to_h\n @object\n end",
"def to_h\n @object\n end",
"def to_h\n @object\n end",
"def to_h\n @object\n end",
"def to_h\n @object\n end",
"def to_h\n @object\n end",
"def to_h\n @object\n end",
"def to_h\n @object\n end",
"def to_h\n @object\n end",
"def to_h\n @hash\n end",
"def to_h\n @hash\n end",
"def hash\n to_h.hash ^ self.class.hash\n end",
"def as_hash\n @hash\n end",
"def __getobj__\n @hashobj\n end",
"def to_hash() end",
"def hash\n to_s.hash\n end",
"def hash\n to_s.hash\n end",
"def hash\n object_id\n end",
"def to_hash\n @_hash_\n end",
"def hash\n\t\treturn self.name.to_s.hash\n\tend",
"def to_hash\n to_a.hash\n end",
"def hash\n { hash: @hash, hashType: @hash_type }\n end",
"def hash\n data.hash\n end",
"def hash\n [self.class, to_h].hash\n end",
"def hash\n [self.class, to_h].hash\n end",
"def hash\n [self.class, to_h].hash\n end",
"def hash\r\n id.hash\r\n end",
"def hash\n \"#{self.class.name}-#{self.id}-#{@__metadata__.cas}-#{@__attributes__.hash}\".hash\n end",
"def hash\n attributes.hash\n end",
"def hash\n attributes.hash\n end",
"def hash\n attributes.hash\n end",
"def hash #:nodoc:\n __getobj__.hash ^ self.class.hash\n end",
"def hash\n self.to_f.hash\n end",
"def hash\n end",
"def hash\n end",
"def hash\n end",
"def to_hash\n return self\n end",
"def to_hash(object)\n validate_class_kit(object.class)\n\n @hash_helper.to_hash(object)\n end",
"def hash\n return @id.hash\n end",
"def to_h\n Hash[ self ]\n end",
"def to_hash\n Hash[self]\n end",
"def to_h\n @hash.dup\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def to_h\n @hash.dup\n end",
"def hash\n model.hash + key.hash\n end",
"def to_hash; end",
"def to_hash; end",
"def to_hash; end",
"def to_hash; end",
"def to_hash; end",
"def to_hash; end",
"def hash\n [self.class, to_s].hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n self.atoms.hash\n end",
"def to_h\n Hash[self]\n end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash\n\t\tvalue.hash\n\tend",
"def hash\n [description, routing_number, account_number, account_type, signatory, metadata, id, signature_url, bank_name, verified, date_created, date_modified, deleted, object].hash\n end",
"def hash\n @id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n self.class.name.hash\n end",
"def to_h\n @_hash.dup\n end",
"def hash\n\t\t[@id].hash\n\tend",
"def hash\n [self.class, to_s].hash\n end",
"def __hash\n @hash\n end"
] | [
"0.8270299",
"0.78767854",
"0.78726953",
"0.7802364",
"0.7789188",
"0.77806795",
"0.7775915",
"0.7767511",
"0.7760525",
"0.7760525",
"0.77559966",
"0.7731286",
"0.7713916",
"0.7713916",
"0.7713916",
"0.7713916",
"0.7713916",
"0.7713916",
"0.7713916",
"0.7713916",
"0.7713916",
"0.7713916",
"0.7713916",
"0.7713916",
"0.7713916",
"0.7713916",
"0.7647042",
"0.7647042",
"0.7626769",
"0.760354",
"0.7595938",
"0.7582562",
"0.7579971",
"0.7579971",
"0.7535553",
"0.7495252",
"0.7433835",
"0.7411177",
"0.73843014",
"0.73661345",
"0.73658615",
"0.73658615",
"0.73658615",
"0.73600674",
"0.7359121",
"0.73590857",
"0.73590857",
"0.73590857",
"0.7340058",
"0.73356754",
"0.7329828",
"0.7329828",
"0.7329828",
"0.73170114",
"0.730566",
"0.73028016",
"0.7294603",
"0.72854036",
"0.72643596",
"0.72637254",
"0.72620076",
"0.72620076",
"0.72620076",
"0.72620076",
"0.72620076",
"0.72620076",
"0.72620076",
"0.72620076",
"0.72620076",
"0.726188",
"0.72524244",
"0.72511965",
"0.72511965",
"0.72511965",
"0.72511965",
"0.72511965",
"0.72511965",
"0.72479564",
"0.72474235",
"0.72474235",
"0.7241066",
"0.7229342",
"0.7228758",
"0.7228758",
"0.7228758",
"0.7228758",
"0.7228758",
"0.7228758",
"0.7228758",
"0.7228758",
"0.7228758",
"0.7228758",
"0.7224175",
"0.72185695",
"0.72126305",
"0.72116995",
"0.71945405",
"0.71828544",
"0.7181684",
"0.7171822",
"0.71657544"
] | 0.0 | -1 |
Outputs nonarray value in the form of hash For object, use to_hash. Otherwise, just return the value | def _to_hash(value)
if value.is_a?(Array)
value.compact.map{ |v| _to_hash(v) }
elsif value.is_a?(Hash)
{}.tap do |hash|
value.each { |k, v| hash[k] = _to_hash(v) }
end
elsif value.respond_to? :to_hash
value.to_hash
else
value
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hash\n [value].hash\n end",
"def hash\n [value].hash\n end",
"def hash\n\t\tvalue.hash\n\tend",
"def hash\n value.hash\n end",
"def hash\n @value.hash\n end",
"def hash\r\n return to_s.hash\r\n end",
"def to_hash\n @value\n end",
"def to_hash\n @value\n end",
"def hash\n @hash || @hash = (value.hash * -1)\n end",
"def output_hash; end",
"def to_hash() end",
"def hash\n return to_s.hash\n end",
"def hash\n value_id.hash\n end",
"def to_hash\n call\n @hash = @value\n @hash\n end",
"def hash\n to_s.hash\n end",
"def hash\n to_s.hash\n end",
"def hash\n self.to_f.hash\n end",
"def hash\n to_s.hash\n end",
"def to_hash(obj = T.unsafe(nil)); end",
"def to_h\n @value\n end",
"def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map{ |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n end\n elsif value.respond_to? :to_hash\n value.to_hash\n else\n value\n end\n end",
"def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map{ |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n end\n elsif value.respond_to? :to_hash\n value.to_hash\n else\n value\n end\n end",
"def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map{ |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n end\n elsif value.respond_to? :to_hash\n value.to_hash\n else\n value\n end\n end",
"def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map{ |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n end\n elsif value.respond_to? :to_hash\n value.to_hash\n else\n value\n end\n end",
"def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map{ |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n end\n elsif value.respond_to? :to_hash\n value.to_hash\n else\n value\n end\n end",
"def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map { |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n end\n elsif value.respond_to? :to_hash\n value.to_hash\n else\n value\n end\n end",
"def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map { |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n end\n elsif value.respond_to? :to_hash\n value.to_hash\n else\n value\n end\n end",
"def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map { |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n end\n elsif value.respond_to? :to_hash\n value.to_hash\n else\n value\n end\n end",
"def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map { |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n end\n elsif value.respond_to? :to_hash\n value.to_hash\n else\n value\n end\n end",
"def value_to_hash(value, options = T.unsafe(nil)); end",
"def to_s\r\n to_hash.to_s\r\n end",
"def _to_hash(value)\r\n if value.is_a?(Array)\r\n value.compact.map{ |v| _to_hash(v) }\r\n elsif value.is_a?(Hash)\r\n {}.tap do |hash|\r\n value.each { |k, v| hash[k] = _to_hash(v) }\r\n end\r\n elsif value.respond_to? :to_hash\r\n value.to_hash\r\n else\r\n value\r\n end\r\n end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def to_s\n to_hash.to_s\nend",
"def to_s\n to_hash.to_s\nend",
"def to_h(value)\n return value unless @to_h\n @to_h.call value\n end",
"def to_hash\n Hash[to_a]\n end",
"def to_hash; end",
"def to_hash; end",
"def to_hash; end",
"def to_hash; end",
"def to_hash; end",
"def to_hash; end"
] | [
"0.6719518",
"0.6719518",
"0.666832",
"0.66565555",
"0.6586841",
"0.6452931",
"0.6414911",
"0.6414911",
"0.6382046",
"0.6346188",
"0.6302933",
"0.62237245",
"0.6151989",
"0.6101756",
"0.60795677",
"0.60795677",
"0.60717124",
"0.6035991",
"0.6021168",
"0.5936472",
"0.5903488",
"0.5903488",
"0.5903488",
"0.5903488",
"0.5903488",
"0.5890367",
"0.5890367",
"0.5884459",
"0.5884459",
"0.58669275",
"0.58533067",
"0.58355993",
"0.58215266",
"0.58215266",
"0.58215266",
"0.58215266",
"0.58215266",
"0.58215266",
"0.58215266",
"0.58215266",
"0.58215266",
"0.58215266",
"0.5803003",
"0.5803003",
"0.57983655",
"0.578115",
"0.577359",
"0.577359",
"0.577359",
"0.577359",
"0.577359",
"0.577359"
] | 0.0 | -1 |
Fetch a todoable list by ID for authenticated user | def find_list(id)
check_token
response = self.class.get("/lists/#{id}", headers: headers)
check_and_raise_errors(response)
Todoable::List.build_from_response(response.parsed_response)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def todo_list\n TodoList.find_by(user_id: current_user['sub'])\n end",
"def get(id:)\n list = client.get_list(id: id)\n\n Todoable::List.new(list)\n end",
"def get_list(id)\n record \"/todos/list/#{id}\"\n end",
"def set_todo_list\n begin\n @todo_list = current_user.todo_lists.where(project_id: params[:project_id]).find(params[:id])\n rescue => exception\n head 401\n end\n end",
"def index\n\t\t@list = current_user.lists.find(params[:list_id])\n @todos = @list.todos\n end",
"def show\n\t\t@to_do_list = ToDoList.find(params[:id])\n\t \tif(@to_do_list.user_id == current_user.id)\n\t\t respond_to do |format|\n\t\t format.html # show.html.erb\n\t\t format.json { render json: @to_do_list }\n\t\t end\n\t\telse\n\t\t \tredirect_to to_do_lists_path\n\t\tend\n end",
"def list_todo_items(opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n \n ]\n\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n {}\n \n )\n\n # resource path\n path = path_replace(\"/v1/users/self/todo\",\n )\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:get, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:get, path, query_params, form_params, headers)\n page_params_store(:get, path)\n response\n \n end",
"def show\n @todo = Todo.find(params[:id]) #not through before filter as we're checking there for user, in show it's read only so it's safe to show to all\n end",
"def get_items(projectid, todolistid)\n get(\"projects/#{projectid}/todolists/#{todolistid}.json\")\n end",
"def todos(id, sort = 'recent', options = {})\n deprecated(\"todos\", \"list_todos\")\n get(\"users/#{id}/todos\", { :sort => sort }.merge(options)).todos\n end",
"def load_todo(id)\n @list[:todos].find { |todo| todo[:id] == id }\nend",
"def user_todos user_id=\"self\", options={}\n response = get(\"/lists/#{user_id}/todos\", options)[\"response\"]\n Foursquared::Response::List.new(self, response[\"list\"])\n end",
"def list\n @todos = Todo.paginate(:all, :page => params[:page], :conditions => [\"user_id = ?\", session[:user_id]])\n end",
"def show\n @todo = @list.todos.find(params[:id])\n end",
"def find_todolist\n @todolist = Todolist.find(params[:todolist_id])\n end",
"def set_todo\n\t\t\t@list = current_user.lists.find(params[:list_id])\n @todo = @list.todos.find(params[:id])\n end",
"def set_todo\n # this will search todos of only current user, securing the project this way\n @todo = current_user.todos.find(params[:id])\n end",
"def load_todo(list, id)\n list[:todos].find { |todo| todo[:id] == id }\nend",
"def get_todos(data_store, id, list, mode)\n mode ? data_store.find_todos(id) : list[:todos]\nend",
"def show\n todo = Todo.find_by_id(params[:id])\n render json: todo.todos\n end",
"def show\n @todo_item = @todo_list.todo_items.find(params[:id])\n end",
"def lists(project_id, complete=nil)\n records \"todo-list\", \"/projects/#{project_id}/todos/lists\", :complete => complete\n end",
"def find_list\n @list = current_user.lists.find params[:id]\n end",
"def set_todo\n @todo = Todo.find(params[:id])\n return head :forbidden if @list.user_id != current_user.id && @share.is_write != true\n end",
"def set_todolist\n @todolists = Todolist.find(params[:id])\n end",
"def find_by_id(client, id, options: {})\n\n self.new(parse(client.get(\"/user_task_lists/#{id}\", options: options)).first, client: client)\n end",
"def index\n @tasks = current_user.lists.find(params[:list_id]).tasks\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tasks }\n end\n end",
"def index\n @todos = @user.todos\n end",
"def set_listtodo\n @listtodo = Listtodo.find(params[:id])\n end",
"def set_todoit_list\n @todoit_list = TodoitList.find(params[:id])\n end",
"def show\n @todo = @list.todos.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @todo }\n end\n end",
"def index\n @todo_lists = TodoList.where(work_id: params[:id]).order(\"created_at\").page(params[:page]).per(5)\n end",
"def index\n if(current_user.has_role?(:developer))\n @todos = Todo.where(developer_id: current_user.id, project_id: params[:project_id])\n else\n @todos = Todo.where(project_id: params[:project_id])\n end\n render json: @todos\n end",
"def set_todo\n @todo = Todo.find(params[:id])\n redirect_to login_path unless @todo.list.user == current_user\n end",
"def show\n @list_to_do = ListToDo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list_to_do }\n end\n end",
"def set_todoslist\n @todoslist = Todoslist.find(params[:id])\n end",
"def set_todo_list\n @todo_list = TodoList.find(params[:id])\n end",
"def set_todo_list\n @todo_list = TodoList.find(params[:id])\n end",
"def set_todo_list\n @todo_list = TodoList.find(params[:id])\n end",
"def set_todo_list\n @todo_list = TodoList.find(params[:id])\n end",
"def show\n # this gets the todo items listing params :id\n @listing = Listing.find(params[:id])\n end",
"def index\n @task_lists = @user.task_lists\n end",
"def list(user_id, opts = {})\n super(user_id, ListRequest.new(opts))\n end",
"def show\n @todo = Todo.find(params[:id])\n\n\t# make sure the current user owns this todo\n\tif @todo.user.id != current_user.id\n\t\trender :json => { :error => \"You don't have access to this item.\" }\n\telse\n\t\trespond_to do |format|\n\t\t format.html { render :partial => \"todo\", :locals => { :todo => @todo } }\n\t\t format.json { render json: @todo }\n\t\tend\n\tend\n end",
"def index\n @todoit_lists = TodoitList.all\n end",
"def set_todolist\n @todolist = Todolist.find(params[:id])\n end",
"def todos(project_id)\n return [] if project_id.blank? || !basecamp\n @todos[project_id] ||= Basecamp::TodoList.all(project_id, false)\n end",
"def items\n response = @client.request :get, \"#{LISTS_PATH}/#{@id}\"\n raise(StandardError, 'unexpected response') unless response\n response['items']&.map { |i| TodoableItem.new self, i, @client }\n end",
"def set_todolist\n @todolist = Todolist.find(params[:id])\n end",
"def index\n authenticate_user!\n @tasks = current_user.tasks\n end",
"def index\n if user_signed_in?\n @todo_lists = TodoList.where(:user_id => current_user.id).order(\"created_at DESC\")\n @others_lists = TodoList.where.not(:user_id => current_user.id).where(:private => false).order(\"created_at DESC\")\n @types = [\"star_border\", \"star\"]\n\n @favorites = current_user.favorites\n @ids = []\n\n @favorites.each do |fav|\n @ids << fav.id\n end\n end \n end",
"def list(id)\n get(\"lists/#{id}\").list\n end",
"def todo\n @tasks = TaskDecorator.decorate_collection Task.getReadyToDoTasks\n render \"v1/tasks/index\"\n end",
"def get_task_list(id)\n response = request(\n :expects => 200,\n :idempotent => true,\n :method => 'GET',\n :parser => Fog::ToHashDocument.new,\n :path => \"tasksList/#{id}\"\n )\n ensure_list! response.body, :Task\n response\n end",
"def show\n if params[:id].to_i == current_user.id\n redirect_to user_dishes_path(current_user)\n else\n @list = List.find_by(id: params[:id])\n end\n end",
"def index\n @todos = @list.todos.all\n end",
"def get_completed_todos\n return Todo.where({\"user_id\" => self.id, \"completed\" => true})\n end",
"def index\n ##@user = User.find_by_username(params[:user_id])\n \n @todos = Todo.where(user_id: current_user.id, closed: false )\n \n order = params[:order] || 'duedate'\n \n @todos = case order\n when 'created' then @todos.sort_by{ |t| t.created }\n when 'priority' then @todos.sort_by{ |t| t.priority }\n when 'duedate' then @todos.sort_by{ |t| t.duedate }\n end\n end",
"def index\n @todolist = Todolist.find(params[:todolist_id])\n @task = @todolist.tasks.find(params[:id])\n\n @tasks = @todolist.tasks.where(completed: false).order('created_at ASC')\n @completed_tasks = @todolist.tasks.where(completed: true).order('updated_at')\n end",
"def set_task\n @task = Task.includes(:todo).find(params[:id])\n @todo = @task.todo\n @list = @todo.list\n end",
"def get_all_withassigned(projectid)\n get(\"projects/#{projectid}/assigned_todos.json\")\n end",
"def index\n @todoitems = @todolist.todoitems.order(:created_at)\n end",
"def set_list\n @lists = List.where(user_id: params[:id])\n end",
"def get_list(list_id)\n rest(\"get\", \"lists/#{list_id}\")\n end",
"def show\n @todo_list = TodoList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @todo_list }\n end\n end",
"def index\n @tasks = Task.where(user_id: current_user.id)\n end",
"def index\n @todolists = Todolist.all\nend",
"def show\n @todo_list = TodoList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json=>@todo_list }\n end\n end",
"def show\n @todo = Todo.find(params[:id])\n end",
"def show\n @todo = Todo.find(params[:id])\n end",
"def show\n @todo = Todo.find(params[:id])\n end",
"def index\n @listitems = @todolist.listitems\nend",
"def set_todo\n @todo = Todo.global.find(params[:id])\n end",
"def index\n if params[:user_id].present?\n load_new_task\n @tasks = Task.where(user_id: params[:user_id])\n \n else\n @tasks = Task.all\n end\n end",
"def show\n @to_do = ToDo.find(params[:id])\n\n render json: @to_do\n end",
"def index\n\n if params[:user_id] && User.find(params[:user_id]) == current_user\n @tasks = @user.tasks\n elsif\n redirect_to missions_path\n flash[:notice] = \"Can't Do that\"\n else\n @tasks = Tasks.all\n end\n end",
"def show\n @todo = Todo.find(params[:id])\n #@todos = Todo.where(:id>=0).order(\"id asc\").page(params[:page]).per(3)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @todo }\n end\n end",
"def show\n @to_do = ToDo.find(params[:id])\n end",
"def index\n # @todos = Todo.all\n\n @todos = current_user.todos\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @todos }\n end\n end",
"def set_todo_list\n @todo_list = TodoList.find(params[:todo_list_id])\n end",
"def todo_object\n task = Todo.find_by_id(self.todo_id)\n return task\n end",
"def index\n if params[:user_id]\n @tasks = Task.where('user_id = ? AND (done = ? OR (updated_at > ?))', params[:user_id], '0', DateTime.now.beginning_of_day).all\n else\n @tasks = Task.where('done = ? OR (updated_at > ?)', 0, DateTime.now.beginning_of_day).all\n end\n end",
"def index\n @to_do = current_user.stuk_todo_tasks.where(state: 'to_do')\n @doing = current_user.stuk_todo_tasks.where(state: 'doing')\n @done = current_user.stuk_todo_tasks.where(state: 'done')\n end",
"def get_todo_restaurants\n @profile = Profile.find(params[:id])\n @restaurants = @profile.todos\n\n render status: 200, json: @restaurants\n end",
"def show\n json_response(@todo)\n end",
"def index\n authorize! :index, Todo\n if current_employee.admin?\n @todos = @project.todos\n else\n raise CanCan::AccessDenied.new(\"Not authorized!\", :read, Todo)\n end\n end",
"def my_index\n authorize! :read, Task\n @tasks = Task.where(:user_id => current_user.id).order(sort_column + \" \" + sort_direction).page(params[:page]).per(20)\n\n render \"index\"\n end",
"def index\n @tasks = Task.find_all_by_user_id(current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tasks }\n end\n end",
"def listings\n authorize! :read, @user\n end",
"def index\n @todoslists = Todoslist.all\n end",
"def set_todo_list\n @todo_list = TodoList.find(params[:todo_list_id])\n end",
"def show\n @todo = Todo.users(current_user.id).find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @todo }\n format.js { render :json=> @todo }\n end\n end",
"def index\n @lists = current_user.lists.all\n end",
"def set_todo_item\n @todo_list.todo_items.find(:id)\n end",
"def index\n @listtodos = Listtodo.all\n end",
"def show\n @task = current_user.lists.find(params[:list_id]).tasks.find(params[:id])\n\n respond_to do |format|\n format.js\n end\n end",
"def get_user_tasks\n render json: get_current_user.tasks\n end",
"def get_list(user, list)\n get(\"/#{user}/lists/#{list}.json\")\n end",
"def index\n @listas = Lista.where(user_id: current_user.id)\n end",
"def index\n set_url_params\n if @ass_by.to_i == current_user.id\n @todos = Todo.includes(:topic).where(assigned_by: @ass_by).order('done asc')\n elsif @ass_to.to_i == current_user.id\n @todos = Todo.includes(:topic).where(assigned_to: @ass_to).order('done asc')\n elsif current_user.adm? && @ass_to\n @todos = Todo.includes(:topic).where(assigned_to: @ass_to).order('done asc')\n elsif current_user.adm? && @ass_by\n @todos = Todo.includes(:topic).where(assigned_by: @ass_by).order('done asc')\n else\n @todos = current_user.todos.includes(:topic).order('done asc')\n end\n \n @todo = Todo.new\n # supressing the listing of todos associated with enqs/regs\n @list = 0\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @todos }\n end\n end"
] | [
"0.77521765",
"0.7702502",
"0.75598496",
"0.7233524",
"0.7153296",
"0.70743227",
"0.6940351",
"0.68954396",
"0.6869285",
"0.68367934",
"0.67996114",
"0.674782",
"0.67412746",
"0.6738131",
"0.6675571",
"0.6670432",
"0.66499364",
"0.66397166",
"0.6631923",
"0.6569772",
"0.65582144",
"0.65171474",
"0.6502763",
"0.64981866",
"0.6494403",
"0.64378446",
"0.64361525",
"0.64304554",
"0.64178824",
"0.63987374",
"0.6396425",
"0.63878775",
"0.6382232",
"0.63646746",
"0.63625103",
"0.6355967",
"0.63453394",
"0.63223535",
"0.63223535",
"0.63223535",
"0.6311891",
"0.6286109",
"0.62665987",
"0.6260942",
"0.62538826",
"0.6249708",
"0.6230367",
"0.6216302",
"0.62031096",
"0.62013423",
"0.61957",
"0.6192009",
"0.61809003",
"0.6165122",
"0.61485136",
"0.6147735",
"0.6115699",
"0.61087775",
"0.60971415",
"0.60968775",
"0.60946107",
"0.60938716",
"0.60855377",
"0.6081217",
"0.60732543",
"0.60720444",
"0.60401344",
"0.6019602",
"0.6019462",
"0.6019462",
"0.6019462",
"0.60177964",
"0.6014482",
"0.5993619",
"0.5990775",
"0.59712577",
"0.59648514",
"0.5961081",
"0.5956156",
"0.5953254",
"0.5951757",
"0.59490407",
"0.5948448",
"0.59472746",
"0.5943403",
"0.5940289",
"0.59390175",
"0.5938026",
"0.59327084",
"0.5924995",
"0.5924702",
"0.5921192",
"0.59196264",
"0.59187424",
"0.5915417",
"0.5906819",
"0.589833",
"0.5891863",
"0.58857054",
"0.58856034"
] | 0.70252156 | 6 |
Create a list with a name | def create_list(name:)
check_token
list = Todoable::List.new(name: name)
response = self.class.post(
'/lists', body: list.post_body, headers: headers
)
check_and_raise_errors(response)
attributes = response.parsed_response.merge!('items' => [])
Todoable::List.build_from_response(attributes)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_list(name)\n data = {\n list: {\n name: name\n }\n }\n rest(\"post\", \"lists\", data)\n end",
"def generate_list(name, count); end",
"def create_list(name)\n path = \"lists\"\n params = { list: { name: name }}\n list = request(path, params, :post)\n list_id = list[:id]\n # output full list again\n show_list(list_id)\n end",
"def create(name)\n Iterable.request(conf, '/lists').post(name: name)\n end",
"def new_list(list_name)\n list_name = {}\nend",
"def create_list(name)\n Wunderlist::List.new(name, false, self).save\n end",
"def create_list(name, item = nil, value = nil)\n lists = (storage.lists << List.new(name))\n storage.lists = lists\n output \"#{cyan(\"Boom!\")} Created a new list called #{yellow(name)}.\"\n save\n add_item(name, item, value) unless value.nil?\n end",
"def create_or_get_list(name)\n list = find_lists(name)&.first || handle_response(client.create_dashboard_list(name))\n get_list(list['id'])\n end",
"def add name\n\t\t\tif name.class == 'String'\n\t\t\t\tpush name\n\t\t\telse\n\t\t\t\tname.each do | n |\n\t\t\t\t\tpush n\n\t\t\t\tend\n\t\t\tend\n\t\tend",
"def create_list(name, template, options = {}, &blk)\n\t\t\t # create the new list\n\t\t\t new_list = Lists.create_list(@web, name, template, options)\n\t\t\t context_for_new_object(new_list, ListContext, &blk)\n\t\t\tend",
"def list_hash(name)\n { list: { name: name } }\n end",
"def names\n [name]\n end",
"def list(name, entries)\n values = entries[0..11].collect do |item|\n {\"listItem\" => item}\n end\n\n push(name, {\"list\" => values})\n end",
"def list_by_name(name)\n params = Hash.new\n params[:name] = name\n self.list(params)\n end",
"def new_list(list_name)\nlist_name = Hash.new\nend",
"def create_new_list(list_name) \n sql = \"INSERT INTO lists (name) VALUES ($1)\"\n result = query(sql, list_name)\n end",
"def create_a_list(name, quantity)\n #list = name.split(\", \")\n list_items = {}\n #list.each do |name|\n list_items[name] = quantity\n #end\n p list_items\n return list_items\nend",
"def list(name, &block)\n list_type = @compendium.type name.to_s.singularize.to_sym, &block\n\n add_property name.to_sym, list_type, true\n end",
"def create(name:)\n attributes = client.create_list(name: name)\n\n Todoable::List.new(attributes)\n end",
"def create_list(list)\n print_list(list)\n return list\nend",
"def to_list_name value\n (value.to_s.singularize + '_list').to_sym\n end",
"def create_list(name, source, opt_in_type)\n endpoint = \"/api/#{@version}/list/create/\"\n custom_params = {\n \"name\" => name,\n \"source\" => source,\n \"opt_in_type\" => opt_in_type\n }\n make_post_request(endpoint, custom_params)\n end",
"def create_list(name, amount, *traits_and_overrides)\n amount.times.map { create(name, *traits_and_overrides) }\n end",
"def list(name, type = :string)\n class_name = marshal_class_name(name, type)\n \n fields << {:name => name.to_s, :type => :list}\n class_eval \"def #{name}; @#{name} ||= ListProxy.new(self.store, field_key('#{name}'), Marshal::#{class_name}); end\"\n eval_writer(name)\n end",
"def initialize(name) #new listings will be initialized with a name\n @name = name\n end",
"def create_list(list_name,list_of_items)\n # create empty array\n list_name = []\n # for each item in string, use add item method to add item to grocery list (set default quantity to 1)\n shopping_items = list_of_items.split(' ')\n shopping_items.each do |thing_to_add|\n add_item_to_list(list_name,thing_to_add,1)\n end\n # print the list to the console\n print_list(list_name)\nend",
"def list(name)\n fsp[name] if XDES_LISTS.include?(name) || INODE_LISTS.include?(name)\n end",
"def list(name, type = :string)\n class_name = marshal_class_name(name, type)\n\n fields << {:name => name.to_s, :type => :list}\n class_eval \"def #{name}; @#{name} ||= ListProxy.new(self.redis, field_key('#{name}'), Marshal::#{class_name}); end\"\n eval_writer(name)\n end",
"def prepopulate_list\n\t\tname_list = ['ben', 'bob obobb', 'mary kate', 'kim possible', 'steve-o', 'jill and jack', 'veronica mars', 'danny trejo',\n\t\t 'jon snow', 'mario anluigi', 'ed obannon', 'amy winehouse', 'juan jones', 'walter okiefe', 'fred love']\n\t\tparty_list = ['tea party', 'conservative', 'neutral', 'liberal', 'socialist']\n\t\tjimbo = Human.new \"politician\", 'jimbo jones', 'democrat'\n\t\tgene = Human.new \"politician\", 'gene wilder', 'republican'\n\t\t@people_list << jimbo\n\t\t@people_list << gene\n\n\t\tname_list.map do |name|\n\t\t\trandom_party = party_list.sample\n\t\t\tname = Human.new \"voter\", name, random_party\n\t\t\t@people_list << name\n\t\tend\n\n\tend",
"def get_list(list_name)\n @lib.get_list(list_name)\n end",
"def <<(name)\n @names << name\n end",
"def create_list(name, source, opt_in_type)\n endpoint = \"/api/v1/list/create/\"\n base_params = base_params(endpoint)\n custom_params = {\n \"name\" => name,\n \"source\" => source,\n \"opt_in_type\" => opt_in_type\n }\n uri = post_api_uri(endpoint)\n http = setup_request(uri)\n result = http.post(uri.path, base_params.merge(custom_params).to_query)\n JSON.parse(result.body)\n end",
"def set_ListName(value)\n set_input(\"ListName\", value)\n end",
"def create_list(items)\n\n\tgrocery_list = {}\n\n\tlist_items = items.split(\" \")\n\n\t#best practice...\n\tlist_items.each do |item_name|\n\t\tgrocery_list = add_item(grocery_list, item_name)\n\tend\n\n\treturn grocery_list\nend",
"def names()\n names = []\n names.push \"q-\"\n return names\n end",
"def add_item(list,name,value)\n list = List.find(list)\n list.add(Item.new(name,value))\n say_set list.name, name, value\n end",
"def build_list_of_players\n [\n \"cliff\",\n \"anne\",\n \"harry\",\n \"sam\",\n \"devin\",\n \"ally\",\n \"bob\",\n \"jane\",\n \"jimmy\",\n \"dave\"\n ]\nend",
"def create_list(items)\r\n\r\n\tgrocery_list = {}\r\n\r\n\tlist_items = items.split(\" \")\r\n\r\n\t#best practice...\r\n\tlist_items.each do |item_name|\r\n\t\tgrocery_list = add_item(grocery_list, item_name)\r\n\tend\r\n\r\n\treturn grocery_list\r\nend",
"def list(name)\n lists.find { |list| ::File.basename(list.url) == name }\n end",
"def create_list\n\t{}\nend",
"def names\n\n get_list['list'].collect { |re, pa| re }\n end",
"def create_list\n list = {} \nend",
"def list(names)\n if names.size == 0 ; return ''\n elsif names.size == 1 ; return \"#{names[0][:name]}\"\n else ; first_elements = names[0..-2].map {|element| element[:name]}\n return \"#{first_elements.join(\", \")} & #{names[-1][:name]}\"\n end\nend",
"def add_list(list)\n @lists[list.title] = list\n end",
"def list_name\n @data['list_name']\n end",
"def list names\n names = names.map { |name| name[:name] }\n p names\n case\n when names.count == 0\n \"\"\n when names.count == 1\n names[0]\n when names.count == 2\n names[0] + \" & \" + names[1]\n when names.count > 2\n last = names.pop\n names.join(\", \") + \" & \" + last\n end\nend",
"def names\n @names ||= [@name]\n end",
"def deconstruct = [name]",
"def create_list(list = {})\n list\nend",
"def create_list(item, quantity = 1)\n\tlist = {}\n\tsplit_item = item.split(\" \")\n\tsplit_item.each do |item_name|\n\t\tlist[item_name] = quantity\n\tend\n\treturn list\nend",
"def names\n @names ||= []\n end",
"def add_list(name, type)\n List.new(name, type(type)).tap do |column|\n @data_columns << add_column(column)\n end\n end",
"def create_list(items)\n\n\tgrocery_list_hash = {}\n\tlist_array = items.split(\" \")\n\n\tlist_array.each do |item|\n\t\tgrocery_list_hash.store(item.to_sym, 1)\n\tend\n\n\tgrocery_list_hash\nend",
"def extract_listname(object)\n extract_list(object).list\n end",
"def list(*) end",
"def new_list(item_String, quantity = 1)\n $list = []\n array_strings = item_String.split\n array_strings.each do |element|\n \tlist_item = {\n \t\tquantity: quantity,\n \t\titem: element\n \t}\n \t $list.push(list_item) \n \tend\nend",
"def group_creator(name_list)\n\n\taccountability_groups = []\n\trandomized_names = name_list.shuffle #Used non-destructive shuffle so that I can call on list again for unit 2/3\n\n\twhile (randomized_names.length > 4)\n\t\taccountability_groups << randomized_names.pop(4)\t\n\tend\n\n\tcounter = 0\n\tuntil (randomized_names.length == 0)\n\t\taccountability_groups[counter] << randomized_names.pop\n\t\tcounter\t+= 1\n\tend\n\t\t\n\tcounter = 0\n\tuntil accountability_groups[counter] == nil\n\t\tputs \"Group \" + (counter + 1).to_s + \":\" ; puts accountability_groups[counter]\n\t\tputs\n\t\tcounter += 1 \n\tend\nend",
"def build_list(name, amount, *traits_and_overrides)\n amount.times.map { build(name, *traits_and_overrides) }\n end",
"def make_new_list\n list = {}\nend",
"def process_property_name\n return [create_name] unless @name.is_a?(Array)\n @name.inject([]) do |name, part|\n name << create_name(part)\n end\n end",
"def add_participant_list(list)\n participants_list\n participants_list_name.set list[:name]\n participants_list_permissions.select list[:visible]\n \n create\n end",
"def create_list(string, value=1)\n string.split(\" \").each do |item|\n $grocery_list[item] = value\n end\n # puts \"Initial list created:\"\n $grocery_list\nend",
"def list names\ncase names.size\n when 0\n \"\"\n when 1\n names[0][:name]\n when 2\n \"#{names[0][:name]} & #{names[1][:name]}\"\n else\n \"#{names[0..names.size-2].map { |x| x[:name] }.join(\", \")} & #{names[names.size-1][:name]}\"\n end\nend",
"def list(name, type, options = {})\n def_collection_accessors(name, List)\n set_attribute_default(name, options.fetch(:default, []))\n end",
"def new_student(list, name, grade, semester)\n\tlist.push( {:name => name, :grade => grade, :semester => semester} )\nend",
"def create_list(items)\n\tnew_list = {}\n\titem_arr = items.split\n\titem_arr.each do |item|\n\t\tadd_item(new_list, item)\n\tend\n\tprint_list(new_list)\n\t\nend",
"def add_item(list,name,quantity=1)\n list[name]=quantity\n return list\nend",
"def create_list(params={})\n @obj.post('create-list', @auth.merge(params))\n end",
"def make_item_list\n end",
"def set_listname\n @listname = Listname.find(params[:id])\n end",
"def create_list(starting_list)\n shopping_list = {}\n arry = starting_list.split(\" \")\n arry.each { |item_name| shopping_list[item_name] = 1}\n return shopping_list\nend",
"def create_list(string)\n\t groceries = string.split(\" \")\n\t list_items = Hash.new\n\t groceries.each do |items|\n\t \tlist_items[items] = 1\n\t end\n list_items\nend",
"def create_list(items)\n\tcurrent_items = items.split(' ')\n\tlist = {}\n\tcurrent_items.each do |item|\n\t\tlist[item] = 1 \n\tend\n\tlist \nend",
"def initialize name\n\t\t\t@tasks = Hash.new\n\t\t\t@completed_tasks = Hash.new\n\t\t\t@count = 0\n\t\t\t@completed_count = 0\n\t\t\t@name = name\n\t\t\tif !File.exists? Config[:lists_directory]\n\t\t\t\tDir.mkdir(Config[:lists_directory])\n\t\t\tend\n\t\t\tupdate\n\t\t\tConfig[:working_list_name] = name.downcase.gsub(/ /, '_')\n\t\t\tConfig[:working_list_exists] = true\n\t\t\tConfig.write\n\t\t\tputs \"Created List #{name}.\"\n\t\tend",
"def create_list(list)\n\tgroceries = []\n\tgroceries = list.split(' ')\n\tgrocery_list = {}\n\tgroceries.each do |item|\n\t\tgrocery_list[item] = 1\n\tend\n\tgrocery_list\nend",
"def add_names(*names)\n @names.push(*names)\n end",
"def names\n Array(@name)\n end",
"def list_name_alpha\n return list_name(true)\n end",
"def make_list (list, quantity = $default_quantity)\r\n list_arr = list.split\r\n list_arr.each do |list_item|\r\n $grocery_list[list_item] = quantity\r\n end\r\nend",
"def names\n [\n \"Charge de travail\" , #00\n \"Travail en groupe\" , #01\n \"Maths\" , #02\n \"Codage\" , #03\n \"Théorique\" , #04\n \"Technique\" , #05\n \"Satisfaction\" , #06\n \"Dur à valider\" , #07\n \"Fun\" , #08\n \"Pipo\" , #09\n \"Économie\" , #10\n \"fondamental\" , #11\n \"Difficile à suivre\" , #12\n \"Calcul\" , #13\n \"Professionalisant\" , #14\n \"Étendue du cours\" , #15\n \"Interactivité\" , #16\n \"Culture générale\" , #17\n ]\n end",
"def add(*names); end",
"def initialize list, names = ABBREVIATIONS\n @names = names\n @list = []\n list.each { |day|\n if day.class == Fixnum and 1 <= day and day <= 7\n @list << day\n elsif day.class == String and\n idx = ABBREVIATIONS.index(day) || FULL_NAMES.index(day)\n if idx == 0 then idx = 7 end\n @list << idx\n else\n raise ArgumentError, \"#{day} is not a valid day id.\"\n end\n }\n @list.uniq!\n @list.sort!\n end",
"def create_grocery_list(list, item_list)\n items = item_list.split\n items.each do |item|\n list.store(item, 1)\n end\n return list\n print_list(grocery_list)\nend",
"def list_names\n list_of_names = String.new\n Contacts.each { |contact| list_of_names = list_of_names + contact[1][:name_choices] + \", \" }\n return list_of_names\nend",
"def add(list, item_name, quantity)\n\tlist[item_name] = quantity\n\tlist\nend",
"def print_list(list_name)\n p list_name\nend",
"def list(refname=\"\", pattern=\"*\")\n list_internal(\"LIST\", refname, pattern)\n end",
"def list names\n names = names.map { |name| name[:name] }\n last_name = names.pop\n return last_name.to_s if names.empty?\n \"#{names.join(', ')} & #{last_name}\"\nend",
"def names\n map(&:name)\n end",
"def list_adder(list, item_name, quantity=1)\n\tlist.store(item_name, quantity)\n\tp list\nend",
"def create_list(items)\n list = {}\n arr = items.split(' ')#split string into indivdual strings\n arr.each do |item| list[item] = 1 end #iterate over arr in order to pass each string into the list\n \tlist \nend",
"def add_item(list, item_name, quantity = 1)\n\tlist[item_name] = quantity\n\tlist\nend",
"def add_item(list, item_name, quantity = 1)\n\tlist[item_name] = quantity\n\tlist\nend",
"def add_item(list, item_name, quantity = 1)\n\tlist[item_name] = quantity\n\tlist\nend",
"def list_of_names\n World.politicians.map { |p| p.name } + World.voters.map { |p| p.name}\nend",
"def add_item(name, quantity, list)\n list[name] = quantity\n p list\n return list\nend",
"def create_list(project_id, list)\n record \"/projects/#{project_id}/todos/create_list\", list\n end",
"def new_list\n list = {}\n return list\nend",
"def add_items(list, item_name, quantity=0)\r\n\tlist[item_name] = quantity\r\n\tlist\r\nend",
"def create_playlist(name)\n uri = 'https://api.deezer.com/user/me/playlists'\n headers = {params: {access_token: @access_token, title: name}}\n RestWrapper.perform_request(uri, :post, headers)\n end"
] | [
"0.74762064",
"0.74018234",
"0.7340271",
"0.72752887",
"0.723564",
"0.7056499",
"0.70011747",
"0.6907137",
"0.6852303",
"0.67961806",
"0.6737306",
"0.6697882",
"0.66905147",
"0.66521937",
"0.66191185",
"0.66169417",
"0.65872747",
"0.6578596",
"0.65366775",
"0.6420805",
"0.6397951",
"0.6390753",
"0.634422",
"0.63233715",
"0.6291012",
"0.6287072",
"0.62811106",
"0.6183558",
"0.6179644",
"0.61763495",
"0.61702406",
"0.61561465",
"0.6144915",
"0.613364",
"0.6093064",
"0.60810655",
"0.6053502",
"0.6051979",
"0.60322374",
"0.60250103",
"0.6005873",
"0.60026586",
"0.5998764",
"0.59938073",
"0.5978697",
"0.5967977",
"0.596666",
"0.59602576",
"0.59428465",
"0.5910571",
"0.59061545",
"0.59020144",
"0.5899576",
"0.58966273",
"0.58867115",
"0.58735436",
"0.5852391",
"0.58453554",
"0.58330286",
"0.58279663",
"0.58192253",
"0.5816577",
"0.5813227",
"0.580638",
"0.57922226",
"0.57897985",
"0.5743551",
"0.5743152",
"0.57410014",
"0.57372695",
"0.5734085",
"0.5730765",
"0.57304245",
"0.5724242",
"0.57224226",
"0.5719735",
"0.57110727",
"0.5694135",
"0.5669993",
"0.566645",
"0.5665732",
"0.5661084",
"0.5658707",
"0.56559646",
"0.5646821",
"0.5643669",
"0.56398135",
"0.56327575",
"0.56299096",
"0.56220186",
"0.56183624",
"0.561527",
"0.56147575",
"0.56147575",
"0.5612534",
"0.5612011",
"0.5611095",
"0.5604703",
"0.56034917",
"0.5585305"
] | 0.667133 | 13 |
Update a list with a new name | def update_list(list_id:, name:)
check_token
list = Todoable::List.new(name: name)
response = self.class.patch(
"/lists/#{list_id}",
body: list.post_body,
headers: headers,
format: :text
)
check_and_raise_errors(response)
# This endpoint returns a plaintext body: "<new name> updated", so
# while I'd like to return a List with ListItems, that would require
# first looking up the list which isn't ideal. So we'll return true, ask
# todoable to fix this endpoint, and make developers keep track of the
# name change
true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_list_name(id, new_name)\n sql = \"UPDATE lists SET name = $1 WHERE id = $2\"\n query(sql, new_name, id)\n end",
"def update_list(list_name, text)\n update_value(\"#{list_name}-list\", text)\n end",
"def rename_list(list_id, name)\n path = \"lists/#{list_id}\"\n params = { list: { name: name }}\n request(path, params, :put )\n \n # output full list again\n show_list(list_id)\n end",
"def update_list(list_id, name)\n data = {\n list: {\n name: name\n }\n }\n rest(\"patch\", \"lists/#{list_id}\", data)\n end",
"def update(list, item_name, quantity)\n\tlist[item_name] = quantity\nend",
"def update_list(list, item_name, quantity=1)\r\n list[item_name] = quantity\r\n list\r\nend",
"def update_list(item_name, item_list, quantity)\n add_list(item_name, item_list, quantity)\nend",
"def update_list(list, update_key, update_value)\r\n add_to_list(list, update_key, update_value)\r\n list\r\nend",
"def update_list(list, item_name, quantity)\n list[item_name.to_sym] = quantity\n list\n\nend",
"def set_ListName(value)\n set_input(\"ListName\", value)\n end",
"def update_quantity(list, item_name, new_quantity)\n list[item_name] = new_quantity\nend",
"def update_quantity(list, item_name, new_quantity)\n list[item_name] = new_quantity\nend",
"def update_name(id, name)\n @names[id] = name if @names[id]\n end",
"def update_quanity(list, item_name, new_quantity)\n\n\tlist[item_name] = new_quantity\n\tp list\nend",
"def updateList(movie_name)\n\t\t# if list already contains movie, delete movie at movie's index:\n\t\tif @searchSuggestionList.include? movie_name\n\t\t\[email protected]_at(@searchSuggestionList.index(movie_name))\n\t\tend\t\n\t\t\n\t\t# add the movie to the begnnining of the list:\n\t\[email protected](0, movie_name)\n\n\tend",
"def updated_quantity(list, item_name, quantity)\r\n\tlist[item_name] = quantity\r\n\tlist\r\nend",
"def update_item(list, name, quantity)\r\n # steps: \r\n # check if item is present\r\n if list[name] != nil\r\n # update with new amount\r\n list[name] = quantity\r\n end\r\n return list\r\n # output: list\r\nend",
"def update(id:, name:)\n list = client.update_list(id: id, name: name)\n\n Todoable::List.new(list)\n end",
"def update_quantity(list, item_name, quantity)\n\tlist[item_name] = quantity\n\tlist\nend",
"def update_quantity(list, item_name, quantity)\n\tlist[item_name] = quantity\n\tlist\nend",
"def update_qty(list, name, qty)\n list[name] = qty\n p list\nend",
"def update_qty(list, name, qty)\n list[name] = qty\n p list\nend",
"def update_quantity(list, item_name, quantity)\r\n list[item_name] = quantity\r\nend",
"def update_quantity(new_list, item_name, quantity)\r\n \r\n new_list[item_name] = quantity\r\nend",
"def update_item(list, name, change_in_quantity)\n normalize_string(name)\n if (list[name] + change_in_quantity <= 0)\n remove_item(list, name)\n else\n list[name] += change_in_quantity\n return list\n end\nend",
"def update_list(list, item, quantity)\n\tlist[item] = quantity\n\tp list\nend",
"def update_quantity(list, item_name, quantity)\n\tlist.each do |item, qty|\n\t\tif item === item_name\n\t\t\tlist[item] = quantity\n\t\tend\n\tend\nend",
"def new_list(list_name)\n list_name = {}\nend",
"def update_item(list_name, item_name, quantity)\r\n list_name[item_name] = quantity if list_name.has_key?(item_name)\r\nend",
"def set_listname\n @listname = Listname.find(params[:id])\n end",
"def update_item(list, item_name, new_qty)\n if list.has_key?(item_name)\n list[item_name] = new_qty\n else\n list = add_method(list, item_name, new_qty)\n end\n list\nend",
"def update_item_from_list(list, food, update_quantity)\n list[food] = update_quantity\n list\nend",
"def update!(**args)\n @names = args[:names] if args.key?(:names)\n end",
"def update_quantity(list, item_name, qty)\n list[item_name] = qty\nend",
"def update_movie_in_list(movie_name, opts)\n movie_list.where(movie_id: get_movie_id(movie_name)).update(opts)\n end",
"def update (list, item, quantity)\n\tlist[item] = quantity\nend",
"def update(list, item, quantity)\n\tlist[item] = quantity\nend",
"def update(list, item, quantity)\n\tlist[item] = quantity\n\tlist\nend",
"def update_quantity(list_name, item, value)\r\n# input: list, item name, new quantity\r\n# steps: find item in the hash and change quantity to new quantity\r\n list_name[item] = value\r\n# output: updated hash with new value for item key\r\n p list_name\r\nend",
"def update_list(item,quantity,list)\n list[item]=quantity\nend",
"def update_quantity(name, quantity, list)\n list[name] += quantity\nend",
"def update(list, item, quantity)\n list[item] = quantity\n list\nend",
"def update_names\n\t\tparams[:item].each do |key, item|\n\t\t\tcurrent_item = Item.find(key)\n\t\t\tcurrent_item.update(:claimed_by => item[:claimed_by])\n\t\tend\n\t\tflash[:success] = \"Names updated.\"\n\t\tredirect_to(:back)\n\tend",
"def update_quantity(list, item_name, quantity)\n\tlist[item_name] = quantity.to_i\n\tlist\nend",
"def update (list, item, qty)\n list[item] = qty\nend",
"def update!(**args)\n @list_items = args[:list_items] if args.key?(:list_items)\n end",
"def update(list, food_item, quantity)\n\tlist[food_item] = quantity\n\tlist\nend",
"def update_list(id, list)\n record \"/todos/update_list/#{id}\", :list => list\n end",
"def change_item_name(new_name:, **)\n self.name = new_name # This will generate the event!\n end",
"def update(list, item, quantity)\r\n\tif list[item] \r\n\tlist[item] = quantity\r\n\telse\r\n\t\tputs \"Your item is not on the list\"\r\n\tend\r\n\tlist\r\nend",
"def list_update(hash_items, item_name, quantity)\n hash_items[item_name] = quantity\n return hash_items\nend",
"def quanity(list,item_name,quanity)\r\n\tif (list.has_key?(item_name) )\r\n\t\tlist[item_name] = quanity\r\n\t\tp list\r\n\tend\r\nend",
"def update(attributes)\n @name = attributes.fetch('name')\n @id = self.id\n DB.exec(\"UPDATE stylists SET name = '#{@name}' WHERE id = #{@id};\")\n end",
"def update_item(list, item, new_quantity)\n\tlist[item] = new_quantity\n\tlist\nend",
"def update_it(new_list, item, amount)\n \n new_list[item] = amount\n \n new_list\nend",
"def update(list, item, quantity)\r\n\tif list.include?(item)\r\n\t\tlist[item] = quantity\r\n\tend\r\n\tp list\r\nend",
"def update_item (list,item,quantity)\n\tlist[item] = quantity\nend",
"def update(item,quantity,list)\n\tlist[item] = quantity\nend",
"def update(item, quantity, list)\n\t# steps: if the item is in the list\n\tif list.include? item.to_sym\n\t\t# update the quantity\n\t\tlist[item.to_sym] = quantity\n\telse \n\t\tadd_item(item, quantity, list)\n\tend\n\t# output: return the updated list\n\tlist\nend",
"def update_list(new_list,item,new_qty)\n new_list[item]=new_qty\n return new_list\nend",
"def add_item(list,name,value)\n list = List.find(list)\n list.add(Item.new(name,value))\n say_set list.name, name, value\n end",
"def update_quantity(list, key_name, quantity=1)\r\n\tlist[key_name] = quantity\r\n\treturn list\r\nend",
"def add_to_list(list)\n\n end",
"def add_to_list(list)\n\n end",
"def add_to_list(list)\n\n end",
"def update_item(list, string)\n\titem_to_update = string.split(\" \")\n\tlist[item_to_update[0].to_sym] = item_to_update[1].to_i\n\tlist\nend",
"def update_list(user, list, options={})\n post(\"/#{user}/lists/#{list}.json\", options)\n end",
"def update!(**args)\n @new_name = args[:new_name] if args.key?(:new_name)\n @prev_name = args[:prev_name] if args.key?(:prev_name)\n end",
"def update_qty(list_items, item_name, new_qty)\n raise ArguementError.new(\"This item does not exist\") unless list_items.include?(item_name)\n list_items[item_name] = item_qty\nend",
"def update(groceries_list, update_item, update_quantity)\n\tgroceries_list[update_item.to_sym] = update_quantity\nend",
"def update_item(list,item,quantity)\n list[item] = quantity\nend",
"def update_item(list,item,quantity)\n list[item] = quantity\nend",
"def update_quantity(list, item, updated_quantity)\n list[item] = updated_quantity\n list\nend",
"def add_new_items(list, item_name, quantity=1)\n list[item_name] = quantity\n list\nend",
"def add_item_to_list(list, new_food, quantity)\n list[new_food] = quantity\n list\nend",
"def add_to_list(list,item,quantity)\n\tupdate_item(list,item,quantity)\nend",
"def list_adder(list, item_name, quantity=1)\n\tlist.store(item_name, quantity)\n\tp list\nend",
"def update_quantity(list, item, quantity)\n\tlist[item] = quantity\n\tp list\nend",
"def add_list(list,new_item,quantity=1)\n list[new_item] = quantity\n list\nend",
"def update_quantity(list, item, quantity)\n\tlist[item] = quantity\n\tlist\nend",
"def list_add(list, item_name, quantity=1)\n list[item_name] = quantity\n p list\nend",
"def update_quantity(list, item, quant)\n list[item] = quant\nend",
"def update_quantity(list, item, quantity)\n list[item] = quantity\nend",
"def update_quantity (list, item, quantity)\n list[item] = quantity\nend",
"def update_quantity (list, item, quantity)\n list[item] = quantity\nend",
"def update_quantity(list, item, quantity)\n list[item] = quantity\nend",
"def rename_pets(uncustomized_pets_ordered, pets_to_update)\n counter = 1 # Because the pets are ordered by admittance date already, a counter can be used to properly number them\n uncustomized_pets_ordered.each do |pet|\n pet.name = \"#{pet.breed} #{counter}\"\n pets_to_update << pet\n counter += 1\n end\n end",
"def update_item(list, item, quantity)\n\tlist[item] = quantity\n\treturn list\nend",
"def update_instructor(list, name, subject)\n\tlist.each do |instructor|\n\t\tif instructor[:name] == name\n\t\t\tinstructor[:subject] = subject\n\t\tend\n\tend\nend",
"def list_add(list, item_name, quantity=1)\r\n list[item_name] = quantity\r\n p list\r\nend",
"def update_item(list, key, new_quant)\n list[key] = new_quant\n return list\nend",
"def update_list(access_token, list)\n url = Util::Config.get('endpoints.base_url') + sprintf(Util::Config.get('endpoints.list'), list.id)\n url = build_url(url)\n payload = list.to_json\n response = RestClient.put(url, payload, get_headers(access_token))\n Components::ContactList.create(JSON.parse(response.body))\n end",
"def rename(id, name = \"\")\n item = Item.find(id)\n item.class == Item ? item.update(:name => name) : item\n end",
"def update\n @list.append_items!(params.dig(:list, :items), current_user)\n redirect_to [@project, @randomization_scheme], notice: \"Items successfully added.\"\n end",
"def remove_item(list, item_name)\n\tlist.delete(item_name){|item| list[item] = item_name}\n\tp list\nend",
"def update(groceries_list, update_item, update_quantity)\n groceries_list[update_item.to_sym] = update_quantity\nend",
"def update (str,qty,list)\n list[str]=qty\n list\nend",
"def add_item(list,new_item,item_count)\n\tlist[new_item] = item_count\nend",
"def update_quantity(list, item, quantity)\nlist[item] = quantity\nlist\nend",
"def update_quantity(list, upd_item, new_quantity)\n# steps:\n # reassign key (item) a new value (quantity)\n list[upd_item] = new_quantity\n # return list\n list\nend"
] | [
"0.81797",
"0.7860275",
"0.77589995",
"0.74683636",
"0.73006225",
"0.72081065",
"0.71912116",
"0.71633226",
"0.708184",
"0.6998175",
"0.696739",
"0.696739",
"0.69560194",
"0.6950948",
"0.6833445",
"0.68270445",
"0.6822277",
"0.67883027",
"0.67880416",
"0.67880416",
"0.67512745",
"0.67512745",
"0.6724702",
"0.6720947",
"0.671333",
"0.66989815",
"0.6685823",
"0.6680427",
"0.6677632",
"0.6655132",
"0.6654332",
"0.6652917",
"0.6619805",
"0.66163677",
"0.6587653",
"0.65757614",
"0.6565527",
"0.65519273",
"0.6547325",
"0.65407723",
"0.6536265",
"0.65331787",
"0.65330935",
"0.65087616",
"0.6461587",
"0.64581794",
"0.6456635",
"0.64565474",
"0.6438199",
"0.64149415",
"0.6414038",
"0.64089334",
"0.6407272",
"0.640436",
"0.6403094",
"0.6393512",
"0.63582325",
"0.6357201",
"0.6345226",
"0.6323809",
"0.63159215",
"0.6305091",
"0.62873095",
"0.62873095",
"0.62873095",
"0.628429",
"0.62607545",
"0.6260241",
"0.6247646",
"0.6246252",
"0.6243016",
"0.6243016",
"0.6229019",
"0.6185147",
"0.6172902",
"0.6161891",
"0.6160141",
"0.61567855",
"0.6152563",
"0.6145523",
"0.6144748",
"0.6143051",
"0.612764",
"0.61272955",
"0.61272955",
"0.61232644",
"0.61218786",
"0.6120281",
"0.6118085",
"0.6116308",
"0.6112928",
"0.61067975",
"0.6103286",
"0.60985327",
"0.6097417",
"0.60952467",
"0.60932374",
"0.6089542",
"0.60833144",
"0.60741794"
] | 0.71924657 | 6 |
Delete a list and its items for an authenticated user | def delete_list(id:)
check_token
response = self.class.delete("/lists/#{id}", headers: headers)
check_and_raise_errors(response)
true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_list(user, list)\n delete(\"/#{user}/lists/#{list}.json\")\n end",
"def delete_list(params={})\n @obj.delete('delete', @auth.merge(params))\n end",
"def destroy\n authorize @list\n @list.destroy\n head :no_content\n end",
"def destroy\n @list = current_user.lists.find(list_params)\n @list.destroy\n flash[:success] = \"List deleted\"\n redirect_to current_user\n end",
"def destroy\n \t@list = current_user.lists.find params[:list_id]\n @item = @list.items.find(params[:id])\n @item.destroy\n respond_to do |format|\n format.html { redirect_to list_items_path(@list), notice: 'Item was successfully removed.' }\n #format.json { head :no_content }\n end\n end",
"def destroy\n @list = current_user.lists.find(params[:id])\n @list.destroy\n respond_with(@list, :location => my_lists_url)\n end",
"def destroy\n @item = current_user.lists.items.find(item_params)\n @item.destroy\n flash[:success] = \"Item deleted\"\n redirect_to current_user\n end",
"def remove_item(list_item,user_list)\n user_list.delete(list_item)\n user_list\nend",
"def destroy\n\n @user = current_user\n @list.user = @user\n @list.destroy\n\n respond_to do |format|\n #format.html { redirect_to root_url }\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end",
"def destroy\n\n # Obtain selected saved list\n @saved_list = SavedList.find(params[:id])\n @saved_list_users = SavedListUser.where(\"saved_list_id = ?\", @saved_list.id)\n\n # Destroy user saved list entries for all users in list\n @saved_list_users.each do |saved_list_user|\n saved_list_user.destroy\n end\n\n # Destroy saved list\n @saved_list.destroy\n\n respond_to do |format|\n format.html {\n redirect_to :action => 'index'\n flash[:notice] ='Saved list was successfully deleted.'\n }\n format.json { head :no_content }\n end\n end",
"def destroy\n\n # Obtain selected saved list\n @saved_list = SavedList.find(params[:id])\n @saved_list_users = SavedListUser.where(\"saved_list_id = ?\", @saved_list.id)\n\n # Destroy user saved list entries for all users in list\n @saved_list_users.each do |saved_list_user|\n saved_list_user.destroy\n end\n\n # Destroy saved list\n @saved_list.destroy\n\n respond_to do |format|\n format.html {\n redirect_to :action => 'index'\n flash[:notice] ='Saved list was successfully deleted.'\n }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list = List.find(params[:id])\n\n respond_to do |format|\n\n if @list.user == current_user\n\n @list.destroy\n\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n\n else\n\n format.html { redirect_to lists_url, alert: \"You cannot delete that list\" }\n format.json { head :no_content, status: :unauthorized }\n\n end\n\n end\n end",
"def destroy\n @list_id = @item.list.id\n @item.destroy\n @items = List.find(@list_id).items.order(\"id ASC\")\n end",
"def destroy\n @list_item = @list.list_items.find(params[:id])\n return error_status(true, :cannot_edit_listitem) unless (@list_item.can_be_deleted_by(@logged_user))\n \n @list_item.updated_by = @logged_user\n @list_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(list_items_url) }\n format.js\n format.xml { head :ok }\n end\n end",
"def destroy\n\t\tconditions = ['listitems.user_id = ? AND listitems.title = ?',\n\t\t\tcurrent_user.id, params[:id]]\n\t\titem_count = Listitem.count(:conditions=>conditions)\n\t\tif item_count > 0\n\t\t\tListitem.delete_all(conditions)\n\t\t\tflash[:notice] = \"The list\" + (params[:id].blank? ? '' : \" “#{params[:id]}”\") +\n\t\t\t\t\" has been permanently deleted. There were #{item_count} items referenced by it. (The items have not been deleted, only the list’s references to them.)\"\n\t\telse\n\t\t\tflash[:error] = 'No such list.'\n\t\tend\n\t\tredirect_to lists_path\n\tend",
"def destroy\n @list = List.find(params[:list_id])\n @list_item = @list.list_items.find(params[:id])\n @list_item.destroy\n\n if @list_item.destroy\n flash[:success] = \"Item deleted\"\n redirect_to list_path(@list)\n else\n flash[:error] = \"Item not deleted\"\n redirect_to list_path(@list)\n end\n end",
"def delete_user\n @saved_list = SavedList.find(params[:id])\n list_users = @saved_list.saved_list_users\n table_to_delete = list_users.where(\"user_id = ?\", params[:user_id].to_i)\n table_to_delete.first.delete\n redirect_to @saved_list\n end",
"def delete_item(list_item)\n @list.delete(list_item)\n @list\n end",
"def delete_list(id)\n query(\"DELETE FROM todos WHERE list_id = $1\", id)\n query(\"DELETE FROM lists WHERE id = $1\", id)\n end",
"def destroy\n begin\n @task_list = @active_project.task_lists.find(params[:id])\n rescue\n return error_status(true, :invalid_task_list)\n end\n \n authorize! :delete, @task_list\n\n @on_page = (params[:on_page] || '').to_i == 1\n @removed_id = @task_list.id\n @task_list.updated_by = @logged_user\n @task_list.destroy\n\n respond_to do |format|\n format.html {\n error_status(false, :success_deleted_task_list)\n redirect_to(task_lists_url)\n }\n format.js { index_lists(@logged_user.member_of_owner?) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @list = List.find(params[:id])\n @list.destroy\n flash[:notice] = \"List successfully deleted\"\n \n @lists = current_user.lists\n @feeds = current_user.feeds\n\n respond_to do |format|\n format.html { redirect_to(lists_url) }\n format.xml { head :ok }\n format.js {render :layout => false}\n end\n end",
"def destroy\n \t@to_do_list = ToDoList.find(params[:id])\n \t@to_do_list.destroy if @to_do_list.belongs_to_current_user?(current_user)\n\t redirect_to to_do_lists_url\n end",
"def destroy\n @list_item.destroy\n\n head :no_content\n end",
"def delete_list(id)\n record \"/todos/delete_list/#{id}\"\n end",
"def destroy\n \t@user = User.find(params[:user_id])\n \t@item = @user.items.find(params[:id])\n \[email protected]\n \tredirect_to @user\n \tend",
"def delete(list_id)\n Iterable.request(conf, \"/lists/#{list_id}\").delete\n end",
"def destroy\n Todoable.client.delete(path)\n list.items.delete(self)\n true\n end",
"def delete_user_todos\n user = self.id\n Todo.where({\"user_id\" => user}).delete_all\n end",
"def destroy_multiple\n\t @list.delete(params[:id])\n\t redirect_to '/tasks'\n\tend",
"def destroy\n current_user.selecteditems.destroy_all\n redirect_to display_cart_user_path(current_user.id)\n end",
"def destroy\n @list = List.find(params[:id])\n if current_list? @list\n set_current_list nil\n end\n @list.destroy\n flash[:notice] = 'Lista removida com sucesso!'\n redirect_to(new_list_path)\n end",
"def destroy\n begin\n @list = current_user.lists.find params[:list_id]\n @task = @list.tasks.find(params[:id])\n rescue\n current_user.lists.each do |list|\n begin\n @list=list\n @task = @list.tasks.find(params[:id])\n break\n rescue\n\n end\n end\n end\n #print '*'*50\n authorize! :read, @list\n authorize! :destroy, @task\n @task.destroy\n\n respond_to do |format|\n # format.html { render :test=>''}#redirect_to list_path(@list) }\n format.json { head :no_content }\n end\n end",
"def destroy\n #invalid authenticity token - form insecure - CSRF\n @item = Item.find(params[:id])\n @item.destroy\n redirect_to list_path(@item.list)\n end",
"def delete_item(list_id:, id:)\n path = \"lists/#{list_id}/items/#{id}\"\n request(method: :delete, path: path)\n end",
"def delete(item, list)\n\tlist.delete(item)\nend",
"def destroy\n @item = current_user.items.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = @user.items.find(params[:id])\n @item.destroy\n\n\n respond_to do |format|\n format.html { redirect_to user_items_path(@user) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list_item = ListItem.find(params[:id])\n @list_item.destroy\n\n respond_to do |format|\n format.html { render :nothing => true}\n format.json { head :no_content }\n end\n end",
"def destroy\n # @list=List.find(params[:list_id])\n @[email protected]_items.find(params[:id])\n @list_item.destroy\n respond_to do |format|\n format.html { redirect_to @list, notice: 'List item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_list(list_id)\n rest(\"delete\", \"lists/#{list_id}\")\n\n return true\n end",
"def delete\r\n Marketplace::Database.instance.call_users(self)\r\n Marketplace::Database.instance.delete_user(self)\r\n ImageUploader.delete_image(self.picture, settings.root) if self.picture != nil\r\n items = Marketplace::Database.instance.items_by_user(self)\r\n items.each{ |item| item.delete }\r\n end",
"def destroy\n @list_user.destroy\n respond_to do |format|\n format.html { redirect_to list_users_url, notice: 'List user was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n item = @list.list_items.find(params[:id])\n\n if item.destroy\n flash[:alert] = t('messages.list_item.success.delete', name: item.name)\n else\n flash[:notice] = t('messages.list_item.errors.delete')\n end\n\n redirect_to :back\n end",
"def deleteItems\n self.items.each do |item|\n item.delete\n end\n end",
"def destroy\n user = current_user\n item_id = Sneaker.find(params[:id])\n Wishlist.where(sneaker_id: params[:id]).destroy_all\n item_id.destroy\n redirect_to user_path(user)\n end",
"def destroy\n \n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to user_path(current_user.id) }\n format.json { head :ok }\n end\n end",
"def delete_item_from_list(list, food)\n list.delete(food)\n list\nend",
"def destroy\n @mydo_list.destroy\n respond_to do |format|\n format.html { redirect_to mydo_lists_url, notice: 'Mydo list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list_item.destroy\n redirect_to list_items_url \n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list = List.find(params[:list_id])\n @token = @list.tokens.find(params[:id])\n @token.destroy\n redirect_to list_path(@list)\n end",
"def destroy\n @item_list.destroy\n respond_to do |format|\n format.html { redirect_to item_lists_url, notice: 'Item list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete!(id:)\n client.delete_list(id: id)\n end",
"def delete_item(list, item)\n list.delete(item)\n list\nend",
"def delete_item(list, item)\n list.delete(item)\n list\nend",
"def remove list\n list_action list, \"remove\"\n end",
"def remove_shopping_list\n user_id = current_user.id\n yummly_id = params[:yummly_id]\n\n shopping_list = ShoppingList.find_by(yummly_id: yummly_id, user_id: user_id)\n shopping_list.destroy\n\n redirect_to recipes_url, notice: \"Removed recipe from your shopping lists\"\n end",
"def destroy\n @list = List.find(params[:id])\n @list.destroy\n\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @list = List.find(params[:id])\n @list.destroy\n\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list = List.find(params[:id])\n @list.destroy\n\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list = List.find(params[:id])\n @list.destroy\n\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end",
"def delete(items)\n item_ids = items.collect { |item| item.id }\n args = {ids: item_ids.to_json}\n return @client.api_helper.command(args, \"item_delete\")\n end",
"def delete_item(list, item)\n\tlist.delete(item)\n\tlist\nend",
"def destroy\n @list = @task.list\n @task.destroy\n redirect_to user_category_list_path(@list.category, @list)\n end",
"def destroy\n @mylist = Mylist.find(params[:id])\n @mylist.destroy\n\n respond_to do |format|\n format.html { redirect_to(mylists_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n\t\tcurrent_user\n\t\tcurrent_user.regexpressions.destroy_all\n\t\tcurrent_user.tasks.destroy_all\n\t\tcurrent_user.clouds.destroy_all\n\t\tcurrent_user.platforms.destroy_all\n\t\tcurrent_user.demos.destroy_all\n\t\tcurrent_user.favorites.destroy_all\n\tend",
"def delete_item(current_list, item)\n current_list.delete(item)\n current_list\nend",
"def delete_item(list,item)\n list.delete(item)\n list\nend",
"def delete_item(list,item)\n list.delete(item)\n list\nend",
"def delete\n if logged_in?\n @item = Item.find(params[:item_id])\n @order = Order.find_by(item: @item)\n @order.destroy\n redirect_to '/cart'\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to management_lists_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list_item.destroy\n respond_to do |format|\n format.html { redirect_to list_path(@list), notice: 'List item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mustdo_list.destroy\n respond_to do |format|\n format.html { redirect_to mustdo_lists_url, notice: 'Mustdo list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n authorize! :delete, @ml_list\n @ml_list.destroy\n respond_to do |format|\n format.html { redirect_to ml_lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n if ! @collection.delete?(@user, @client)\n render_json :status => :forbidden and return\n end\n @collection.destroy\n render_json :entry => @collection.to_hash(@user, @client)\n end",
"def destroy\n @list.destroy\n redirect_via_turbolinks_to lists_path\n end",
"def destroyItem(id)\n item = List.find(id)\n item.destroy\n end",
"def delete_item(list, item)\n del_list = list.delete(item)\nend",
"def destroy\n @mailee_list = Mailee::List.find(params[:id])\n @mailee_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(mailee_lists_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :ok }\n end\n end",
"def delete\n @@all_items.delete(@id)\n end",
"def delete(email, list_id = nil)\n query = \"email=#{CGI.escape(email)}\"\n query += \"&list_id=#{list_id}\" if list_id\n\n del \"#{@endpoint}?#{query}\", nil\n end",
"def delete_list(list)\n @lists[list.title].delete(list.title)\n end",
"def destroy\n @list = @project.lists.find(params[:id])\n @list.destroy\n\n respond_to do |format|\n format.html { redirect_to project_lists_url(@project) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list = List.find(params[:id])\n @list.destroy\n flash[:notice] = \"you have successfully destroyed.\"\n redirect_to root_url\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: 'Funcionario deletado com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def unsubscribe_from_list(user, list)\n delete(\"/#{user}/#{list}/subscribers.json\")\n end",
"def delete_list_item(client, uri, headers)\n # log what we are doing\n log(:info, \"Deleting Sharepoint list item at: #{uri}\")\n\n # send the delete request and return the response\n client.delete(uri, headers)\n end",
"def destroy\n user = @item.user\n @item.destroy\n respond_to do |format|\n format.html { redirect_to user_path(user) }\n format.json { head :no_content }\n end\n end",
"def remove_from_list_resource\n manage_list_resource(:remove)\n end",
"def delete_item(list,item)\n list.delete(item)\n return list\nend",
"def delete_item(list,item)\n list.delete(item)\nend",
"def delete_item(list,item)\n list.delete(item)\nend",
"def destroy\n @todoit_list.destroy\n respond_to do |format|\n format.html { redirect_to todoit_lists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to my_lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_item(list,item)\n\tlist.delete(item)\nend",
"def destroy\n @list_item.destroy\n respond_to do |format|\n format.html { redirect_to list_items_url, notice: 'List item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n item = Item.find(params[:id])\n if item.user == current_user\n item.destroy\n render json: {status: :ok}, status: :ok\n else\n render json: {errors: \"you can't do it\"}, status: :unprocessable_entity\n end\n end",
"def del_item(list, item_to_del)\n list.delete(item_to_del)\nend"
] | [
"0.8100903",
"0.79223645",
"0.767124",
"0.7668876",
"0.7663366",
"0.75563467",
"0.7552064",
"0.7412968",
"0.74017125",
"0.7314739",
"0.7314739",
"0.73095506",
"0.7244244",
"0.7240991",
"0.72336084",
"0.7213257",
"0.717839",
"0.71601725",
"0.7132194",
"0.7101568",
"0.7101266",
"0.7082544",
"0.70353633",
"0.69956946",
"0.69952434",
"0.6968094",
"0.6966418",
"0.6964955",
"0.69597924",
"0.69236326",
"0.6906003",
"0.6895892",
"0.68809694",
"0.68741596",
"0.6870616",
"0.6868154",
"0.684492",
"0.6825352",
"0.6818348",
"0.68182915",
"0.6815676",
"0.68027866",
"0.6793376",
"0.6790483",
"0.6787433",
"0.6785433",
"0.6777253",
"0.6775444",
"0.6749532",
"0.6746924",
"0.6746924",
"0.6746924",
"0.6740169",
"0.6739506",
"0.67367977",
"0.6712247",
"0.6712247",
"0.67074263",
"0.6705239",
"0.67039156",
"0.67015433",
"0.67015433",
"0.67015433",
"0.67014855",
"0.6701363",
"0.6700188",
"0.6695875",
"0.6691353",
"0.6688244",
"0.668799",
"0.668799",
"0.66806746",
"0.6678646",
"0.6676389",
"0.6674214",
"0.6672297",
"0.6672261",
"0.6669614",
"0.6657748",
"0.66545284",
"0.6652662",
"0.6652502",
"0.66491467",
"0.66482985",
"0.6643528",
"0.6636858",
"0.66317064",
"0.6624568",
"0.662325",
"0.6622959",
"0.6621183",
"0.66206855",
"0.6618791",
"0.66152996",
"0.66152996",
"0.6610222",
"0.66087914",
"0.66017854",
"0.65903157",
"0.65893704",
"0.65887624"
] | 0.0 | -1 |
You can bid on an offer if you don't own it and it is open | def can_bid_on?(offer)
owns = (self == offer.user)
in_transaction = offer.responses.any? { |r| r.status != 'open' }
offer.is_parent_offer? && !owns && !in_transaction
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def can_receive_bids?\n is_parent_offer? && bids.empty?\n end",
"def bought?\n # paym\n end",
"def pending_offers_as_buyer\n self.offers_as_buyer.pending\n end",
"def accepted_bid\n accepted_response.present? ? accepted_response.bid : nil\n end",
"def bidding_open?\n return self.auction_end.blank? || self.auction_end.future?\n end",
"def sell_pending\n end",
"def inbid?\n item = Item.find(item_id)\n if(item.expired? == false && inBid_notify == false)\n return true\n else\n return false\n end\n end",
"def offer\n nil\n end",
"def offer\n nil\n end",
"def bid(item, amount)\r\n if can_bid?(item, amount)\r\n previous_winner = item.current_winner\r\n previous_max_bid = item.highest_bid.nil? ? 0 : item.bidders[previous_winner]\r\n\r\n item.bidders[self] = amount\r\n\r\n # reduce money if user is new winner, otherwise nothing happens\r\n current_winner = item.current_winner\r\n current_max_bid = item.bidders[current_winner]\r\n\r\n previous_winner.credits += previous_max_bid unless previous_winner.nil?\r\n current_winner.credits -= current_max_bid\r\n#Do not always send mail for demo purposes\r\n=begin\r\n if !previous_winner.nil? && previous_winner != current_winner\r\n # we got a new winner\r\n\r\n Security::MailDispatcher.send_new_winner_mail(previous_winner.email, item) unless [nil, \"\"].include?(previous_winner.email)\r\n end\r\n=end\r\n else\r\n raise TradeError, \"INVALID_BID\" #Bid is too small or already exists or user doesn't have enough money.\r\n end\r\n end",
"def purchasing?\n auction.buy_it_now_price == amount\n end",
"def accepted_bid\n Bid.find(accepted_bid_id) if accepted_bid_id\n end",
"def ask?\n !bid?\n end",
"def ask?\n !bid?\n end",
"def sell_to_offer(offer,item)\r\n active = item.active?\r\n item.activate if !active\r\n #offer.from.credits +=offer.price*offer.quantity\r\n purchase = Purchase.create(item,offer.quantity,item.owner,offer.from)\r\n purchase.adapt_price_to_offer(offer)\r\n purchase.prepare\r\n PurchaseActivity.successful(purchase).log\r\n offer.delete\r\n item.deactivate if !active\r\n end",
"def faab?\n free_agent? && !waiver_bid.nil?\n end",
"def high_bid_is_copart_buy_now?\n get_high_bid_bid_type_code == BidType::AURORA_BUY_NOW_CODE\n end",
"def offer\n end",
"def offer\n end",
"def offer\n end",
"def can_buy?(item)\r\n item.buyable_by?(self)\r\n end",
"def waiver?\n free_agent? && !waiver_bid\n end",
"def can_buy?(item)\n item.buyable_by?(self)\n end",
"def bid\n @auction = Auction.find(params[:auction_id])\n @reward = Reward.find(params[:reward_id])\n @points_already_bid = current_user ? @reward.points_already_raised_by(current_user) : 0\n @donation = Donation.new\n @program = @auction.program\n @karma_page = false\n\n if @program\n @org = @program.organization\n @profile_fields = Profile.profile_fields(current_user, @org)[@org.url] # current_user could be nil\n if @program.auction_type == \"fixed\"\n @opportunities = Profile.fixed_opportunities_for(@org)\n @nonprofit = @org.nonprofits.first\n end\n end\n\n if current_user\n @current_karma = total_karma_for(current_user)\n else\n @current_karma = 0\n end\n\n if current_user && current_user.stripe_cus_id && !@org\n Stripe.api_key = ENV['STRIPE_SECRET_KEY']\n begin\n customer = Stripe::Customer.retrieve(current_user.stripe_cus_id)\n @default_card = customer.sources.retrieve(customer.default_card)\n rescue\n # If a similar Stripe object exists in live mode, but a test mode key was used to make this request.\n @default_card = nil\n end\n end\n end",
"def accepted(bid)\n @bid = bid\n \n mail :to => bid.bidder.email\n body :bid => bid\n end",
"def can_auction?(_company)\n true\n end",
"def hideOffer()\n @item['offer']['activate'] = false\n self.updateOffer()\n end",
"def can_request_purchase?\n true # TODO: Should this be !virginia_borrower? ?\n end",
"def buy?(buyer)\r\n if buyer.credits < self.price or not self.active or buyer == self.owner\r\n false\r\n return\r\n end\r\n owner.credits += self.price\r\n buyer.credits -= self.price\r\n self.owner.remove_owned(self)\r\n self.owner = buyer \r\n buyer.add_owned(self)\r\n self.active = false\r\n true \r\n end",
"def sell_to_current_winner\r\n if self.rank_one != nil\r\n winner = self.get_current_winner\r\n item.price = self.get_current_price\r\n item.take_ownership(winner)\r\n item.state = :pending\r\n winner.credits_in_auction -= self.get_current_bid\r\n winner.credits += (self.get_current_bid - self.get_current_price)\r\n EmailSender.win_auction(winner, item)\r\n else\r\n item.state = :inactive\r\n end\r\n end",
"def attemp_buying\n\n end",
"def buy_item(item)\r\n if !item.active || item.price > self.credits\r\n false\r\n else\r\n seller = item.owner\r\n price = item.price\r\n\r\n seller.give_credits(price)\r\n self.take_credits(price)\r\n seller.remove_item(item)\r\n self.add_item(item)\r\n item.active = false\r\n true\r\n end\r\n end",
"def place_offer(proposer, amount)\n\t\t\tif proposer.balance >= amount\n\t\t\t\tsell_to(proposer, amount) if @owner.decide(:consider_proposed_trade, game: @owner.game, player: @owner, proposer: proposer, property: self, amount: amount).is_yes?\n\t\t\tend\n\t\tend",
"def ready_to_exchange?\n self.balance >= self.promotion.points_to_exchange\n end",
"def owner_only_offers_reward?\n self.rewards_count == 1 && self.rewards.visible[0].sender == self.person\n end",
"def pending_offers_as_seller\n self.offers_as_seller.pending\n end",
"def offer_available?\n #return self.approved? && self.offers.last.present? && self.offers.last.effective?\n return self.offers.last.present? && self.offers.last.effective?\n end",
"def click_offer(id)\n # @todo: This should raise if the offer is not on the wall.\n raise NotImplementedError\n end",
"def buy_it_now\n\t\t# find item with respect to its ID\n @item = Item.find(params[:id])\n\n\t\t# can't buy closed item, security\n if @item.closed\n gflash :error => \"Unknown action\"\n else\n\t\t\t# can't buy your own items\n if current_user == @item.user\n gflash :error => \"You cannot buy your own item!\"\n elsif current_user.money >= @item.bin_price\n\t\t\t\t# if there are bids, refund highest bidder\n if @item.bids.first\n @highest_bid = @item.bids.sort_by{|b| b.price}.last\n highest_bidder = @highest_bid.bidder\n highest_bidder.update_attribute(:money, highest_bidder.money+@highest_bid.price)\n end\n\t\t\t\t\n\t\t\t\t# show pop up regarding BIN success\n gflash :success => \"Congratulations! You have bought the item.\"\n @item.closed = true\n\n\t\t\t\t# automatically replace the html to show the auction is now closed using ajax so\n\t\t\t\t# refreshing the page is not necessary, i.e. automatically update the auction closed box\n render :juggernaut => {:type => :send_to_all} do |page|\n page.replace_html :show_item_time, \"\"\n page.replace_html :bid_id, \"\"\n page.replace_html :highest_bid, \"Auction is closed!\"\n page.replace_html :show_item_bin_button, \"\"\n page.replace_html :show_item_watch, \"\"\n page.replace_html :show_item_stop, \"\"\n page.replace_html \"item_time_#{@item.id}\", :partial => 'items/search_time_ticker', :object => @item\n page.visual_effect :highlight, \"item_time_#{@item.id}\", :duration => 5\n end\n\n\t\t\t\t# update item attribute\n @item.update_attribute(:closed,true)\n\n\t\t\t\t# add money to the seller\n\t\t\t\tposter = @item.user\n poster.update_attribute(:money, [email protected]_price)\n\n\t\t\t\t# deduct the money from the buyer\n current_user.update_attribute(:money,[email protected]_price)\n\n\t\t\t\t# create new transaction\n\t\t\t\ttransaction = Transaction.new\n \t transaction.seller_id = poster.id\n \t transaction.buyer_id = current_user.id\n \t transaction.item_id = @item.id\n \t transaction.price = @item.bin_price\n \t transaction.save\n else\n gflash :error => \"Cannot afford to buy this item\"\n end\n end\n redirect_to :controller => 'items', :action => 'show', :id => params[:item_id]\n end",
"def offer\n self\n end",
"def pure_sell?(buy_it_now=false)\n if (self.btba_type.present? && self.btba_type.code == BtbaType::CODE_NO) && \n (self.high_bid_amount.present? && self.high_bid_amount > 0) && \n (self.min_bid_reserve.nil? || buy_it_now || (self.high_bid_amount >= self.min_bid_reserve))\n true\n else\n false\n end\n end",
"def give_bid(auction, bid)\r\n if Time.now > auction.due_date\r\n raise TradeException, \"Out of time\"\r\n elsif auction.bid.last != nil\r\n if auction.bid.last.owner != self\r\n auction.set_bid(self, bid)\r\n else\r\n auction.update_bid(self,bid)\r\n end\r\n else\r\n auction.set_bid(self,bid)\r\n end\r\n end",
"def is_a_winner?(bid_amount)\n bid_amount >= self.minimal_allowed_bid\n end",
"def bid\n @bid ||= if @event.at('bid')\n @event.at('bid').inner_text.to_i\n else\n false\n end\n end",
"def bid\n self.bids.last.nil? ? Bid.new : self.bids.last\n end",
"def valid_bid?\n unless Auction.find(Item.find(self.item_id).auction_id).end_date > (DateTime.now.to_time - 7.hours).to_datetime\n errors[:base] = \"It is now past the auction time and no more bids are allowed online.\"\n return false\n end\n # Check if there are any bids for this item yet.\n if !Bid.where(:item_id => self.item_id).empty?\n # Checks if there was an unsuccessful bid that is waiting but it's the first one\n if Bid.where(:item_id => self.item_id).count == 1 && Bid.where(:item_id => self.item_id).first.user_id.nil?\n if self.bid_amount >= Item.find(self.item_id).min_bid\n return true\n else \n errors[:base] = \"Invalid bid amount! Please make sure that your bid is at \n least as high as the starting bid.\"\n return false\n end\n end\n # Check that this bidder is not the one who made the highest bid, first\n if Bid.where(:item_id => self.item_id, :bid_amount => Item.find(self.item_id).min_bid).first.user_id==self.user_id\n \terrors[:base] = \"You are already the highest bidder!\"\n return false\n else\n # Now check that this bid amount is higher than the highest bid amount\n if self.bid_amount < Item.find(self.item_id).min_bid + Item.find(self.item_id).min_increase\n errors[:base] = \"Invalid bid amount! Please make sure that your bid is at \n least as high as the highest bid plus the minimum increase.\"\n return false\n else\n # If the bidder isn't already the highest bidder, the bid amount is not empty,\n # and the bid is more than the highest bid, return true because it's valid\n return true\n end\n end\n # there are no bids for the item, check that the bid is at least as much as the min bid\n else\n if self.bid_amount >= Item.find(self.item_id).min_bid\n return true\n else \n errors[:base] = \"Invalid bid amount! Please make sure that your bid is at \n least as high as the starting bid.\"\n return false\n end\n end\n end",
"def buy(amount)\n @bought_amount += amount if amount_remaining >= amount\n end",
"def winner(bid)\n @bid = bid\n mail to: bid.manager.email, subject: 'You won your Sealed Bid!'\n end",
"def bid\n @auction = Auction.find(params[:auction_id])\n @reward = Reward.find(params[:reward_id])\n @hours_already_bid = @reward.hours_already_bid_by(current_user)\n @hours_entry = HoursEntry.new\n @bid = Bid.new\n end",
"def can_supply?\n payment_received? || payment_on_account?\n end",
"def on_bid(bid)\r\n warn \"Bid \" + bid.to_s\r\n end",
"def accept\n\n @bid = @swarm_request.bids.find(params[:id])\n @bid.update_attributes(:accepted => true)\n @swarm_request.update_attributes(:auction_closed => true)\n \n UserMailer.accept_bid_notification(@bid).deliver\n # also update the bid with any details here?\n respond_to do |format|\n format.html { redirect_to(@swarm_request, :notice => 'Bid Accepted.') }\n format.xml { head :ok }\n end\n\n end",
"def reject_offer\n @auction = @current_user.auctions.find(params[:auction_id])\n @offer = @auction.offers.find(params[:offer_id])\n Alert.transaction do\n Alert.offer_to_reject_response!(@offer, @decision)\n if @decision\n @offer.reject!\n end\n end\n end",
"def cannot_edit(_offer)\n !session[:is_administrator] && _offer.unbilled_balance <= 0\n end",
"def free_storage_valid_thru_date\n sale_date =\n if self.auction_datum.present? && self.auction_datum.auction_date.present?\n self.yard.utc_sale_date_with_time_for_date(self.auction_datum.auction_date)\n elsif self.sale_confirmed_date.present?\n self.sale_confirmed_date\n else\n DateTime.now\n end\n # No bid history at all may be a data issue,\n # but as far as we're concerned here, it's \n # 3 business days.\n if self.bid_histories.empty?\n self.three_business_days_later_inclusive(sale_date)\n # Kiosk winners get 3 days\n elsif self.high_bid_is_kiosk?\n self.three_business_days_later_inclusive(sale_date)\n # Next scenarios depend on bid type existing\n elsif self.bid_histories.first.bid_type.present?\n bid_type_code = self.bid_histories.first.bid_type.code\n # Live Auction winners / prelim-bid winners / \n # counter-bid (offline) / Buy Now winners / Sale Now \n # winners get 7 days (counting sale_date).\n if bid_type_code == BidType::AURORA_LIVE_BID_CODE || \n bid_type_code == BidType::AURORA_PRELIM_BID_CODE || \n bid_type_code == BidType::AURORA_BUY_NOW_CODE || \n bid_type_code == BidType::FIGS_SALE_NOW_CODE ||\n !self.current_buyer_also_high_bidder?\n sale_date + 6.days\n # Unknown code was received, per Karla they get 3\n # days. (todo: important enough to email us so we know?)\n elsif bid_type_code.present?\n logger.info(\"Unknown bid type received, code is: #{bid_type_code}\")\n self.three_business_days_later_inclusive(sale_date)\n # Code not present also gets the three (we should prevent\n # this scenario in the api, but you know, safety first)\n else\n logger.info(\"BidType.code not present on bid type of description: #{self.bid_histories.first.bid_type.description}\")\n self.three_business_days_later_inclusive(sale_date)\n end\n # All other scenarios get 3 business days\n # (so incomplete data scenarios will get 3 days).\n else\n self.three_business_days_later_inclusive(sale_date)\n end\n end",
"def do_buy(number)\r\r\n $game_party.lose_currency(@gold_window.currency, number * buying_price)\r\r\n $game_party.gain_item(@item, number)\r\r\n end",
"def accept\n if @product.goaled?\n count = params.require(:count)\n @product.bids.not_accepted.oldest(count).each do |bid|\n bid.update! accepted_at: Time.current\n end\n redirect_to [current_role, @product]\n else\n redirect_to [current_role, @product],\n alert: 'Product is not goaled yet.'\n end\n end",
"def fixed_price?\n !auction?\n end",
"def deal_with_other_offers\n if self.selling?\n if self.sender.nil? == false\n self.sender.active_offers_for_textbook(self.textbook_id).each do |offer|\n offer.update_status(3)\n\n if self.sender_id == offer.sender_id\n\t Offer.notify_buyer_book_sold(offer.reciever,offer.sender,textbook)\n\t else\n\t Offer.notify_buyer_book_sold(offer.sender,offer.reciever,textbook)\n\t end\n\t end\n end\n\tif self.reciever.nil? == false\n\t self.reciever.active_offers_for_textbook(self.textbook_id).each do |offer|\n\t offer.update_status(4)\n\n if self.sender_id == offer.sender_id\n\t Offer.notify_seller_book_bought(offer.reciever,offer.sender,textbook)\n\t else\n\t Offer.notify_seller_book_bought(offer.sender, offer.reciever, textbook)\n\t end\n\t end\n\tend\n else\n if self.sender.nil? == false\n self.sender.active_offers_for_textbook(self.textbook_id).each do |offer|\n offer.update_status(4)\n\n if self.sender_id == offer.sender_id\n\t Offer.notify_seller_book_bought(offer.reciever, offer.sender, textbook)\n\t else\n\t Offer.notify_seller_book_bought(offer.sender, offer.reciever, textbook)\n\t end\n\t end\n\tend\n\tif self.reciever.nil? == false\n\t self.reciever.active_offers_for_textbook(self.textbook_id).each do |offer|\n\t offer.update_status(3)\n\n if self.sender_id == offer.sender_id\n Offer.notify_buyer_book_sold(offer.reciever, offer.sender, textbook)\n\t else\n Offer.notify_buyer_book_sold(offer.sender, offer.reciever, textbook)\n\t end\n\t end\n\tend\n end\n end",
"def cancel_bid\n @booking = Booking.find(params[:id])\n @booking.presenters.delete(current_user.presenter)\n flash[:success] = \"Success! You've withdrawn your bid.\"\n if @booking.presenters.count < 2\n @booking.help_required = false\n @booking.save\n end\n Notification.send_message(@booking.creator.user, \"#{current_user.presenter.get_private_full_name(current_user)} has withdrawn their bid.\", booking_path(@booking), :cancel_bid)\n redirect_to root_url\n end",
"def money_approved?\n true\n end",
"def high_bid_is_kiosk?\n return false if self.bid_histories.blank? || !self.member_id.present?\n last_bid = self.bid_histories.first\n last_bid.bid_amount == self.high_bid_amount &&\n last_bid.member_id == self.member_id &&\n ( last_bid.bid_source_code == BidHistory::BID_SOURCE_BID_BUTLER_KIOSK_DIFFERENT_YARD ||\n last_bid.bid_source_code == BidHistory::BID_SOURCE_BID_BUTLER_KIOSK_SAME_YARD ||\n last_bid.bid_source_code == BidHistory::BID_SOURCE_KIOSK_DIFFERENT_YARD ||\n last_bid.bid_source_code == BidHistory::BID_SOURCE_KIOSK_SAME_YARD )\n end",
"def done_bidding? \n return player_size_and_nil_check(config[:bids])\n end",
"def minimal_allowed_bid\n if self.winner_bid.positive?\n (self.winner_bid * MINIMAL_INCREASE_BID).to_i\n else\n self.minimal_bid\n end\n end",
"def set_bid\n @bid = @item.bids.find_by(id: params[:id])\n render json: { errors: { detail: \"Bid not found\" } }, status: :unauthorized and return unless @bid\n end",
"def pre_pay_offered\n end",
"def can_afford_to_bet?(amount)\n (self.balance >= amount)\n end",
"def buy!(buyer_planet, amount)\n raise GameLogicError.new(\"Cannot buy 0 or less! Wanted: #{amount}\") \\\n if amount <= 0\n amount = from_amount if amount > from_amount\n \n cost = (amount * to_rate).ceil\n buyer_source, bs_attr = self.class.resolve_kind(buyer_planet, to_kind)\n buyer_target, bt_attr = self.class.resolve_kind(buyer_planet, from_kind)\n if system?\n seller_target = nil\n else\n seller_target, _ = self.class.resolve_kind(planet, to_kind)\n end\n \n stats = CredStats.buy_offer(buyer_planet.player, cost) \\\n if seller_target.nil? && to_kind == KIND_CREDS\n \n buyer_has = buyer_source.send(bs_attr)\n raise GameLogicError.new(\"Not enough funds for #{buyer_source\n }! Wanted #{cost} #{bs_attr} but it only had #{buyer_has}.\"\n ) if buyer_has < cost\n \n # Used to determine whether to send notification or not.\n original_amount = from_amount\n \n # Subtract resource that buyer is paying with from him.\n buyer_source.send(:\"#{bs_attr}=\", buyer_has - cost)\n # Add resource that buyer has bought from seller.\n buyer_target.send(:\"#{bt_attr}=\", \n buyer_target.send(bt_attr) + amount)\n # Add resource that buyer is paying with to seller. Unless:\n # * its a system offer\n # * or #to_kind is creds and planet currently does not have an owner\n seller_target.send(\n :\"#{bs_attr}=\", seller_target.send(bs_attr) + cost\n ) unless seller_target.nil?\n # Reduce bought amount from offer.\n self.from_amount -= amount\n \n objects = [buyer_source, buyer_target]\n # We might not have seller target. See above.\n objects.push seller_target unless seller_target.nil?\n objects.uniq.each { |obj| self.class.save_obj_with_event(obj) }\n\n if from_amount == 0\n # Schedule creation of new system offer.\n CallbackManager.register(\n without_locking { galaxy },\n CALLBACK_MAPPINGS[from_kind],\n Cfg.market_bot_random_resource_cooldown_date\n ) if system?\n destroy!\n else\n save!\n end\n percentage_bought = amount.to_f / original_amount\n\n MarketRate.subtract_amount(galaxy_id, from_kind, to_kind, amount)\n\n # Create notification if:\n # * It's not a system notification\n # * Enough of the percentage was bought\n # * Sellers planet currently has a player.\n Notification.create_for_market_offer_bought(\n self, buyer_planet.player, amount, cost\n ) if ! system? &&\n percentage_bought >= CONFIG['market.buy.notification.threshold'] &&\n ! planet.player_id.nil?\n\n stats.save! unless stats.nil?\n\n amount\n end",
"def create_bid\n @instrument.bids.create!(user: current_user, price: @instrument.price)\n end",
"def bid\n bid_params = params.permit(:id, :bid_or_pass, :tricks_count, :trump_suit)\n game = Game.find(bid_params[:id])\n if bidder_has_passed?(bid_params)\n PassBid.new(game).call\n elsif bidder_has_made_bid?(bid_params)\n MakeBid.new(game, bid_params[:tricks_count], bid_params[:trump_suit]).call\n end\n\n redirect_to game\n end",
"def can_buy()\n event = Event.find_by(id: self.event_id)\n if Time.now > event.start_date then\n halt msg: 'can_buy() fail' \n false\n else\n true\n end\n end",
"def promo_offer?\n promotional_offer_id.present?\n end",
"def bid\n\t\t# initialize all variables\n\t\t@user = current_user\n\t\t@bids = Bid.find(:all, :conditions => {:item_id => params[:item_id]}, :order => \"price DESC\")\n\t\t@item = Item.find(params[:item_id])\n\t\t@admin = User.find_by_login(\"admin\")\n\t\tprice = params[:bid_price]\n\t\tmoney = @user.money\n\n\t\t# cannot bid when auction is closed\t\t \n\t\tif @item.closed\n\t\t gflash :error => \"This auction is closed.\"\n\t\t# must put in price\n\t\telsif !price\n\t\t\tgflash :error => \"Price cannot be empty\"\n\t\telse\n\t\t\t# if theres bids before this bid\n\t\t\tif (@bids.count > 0)\n\t\t\t\t# get highest of the bids\n\t\t\t\t@highest = @bids.first\n\n\t\t\t\t# if this bid is less than the current highest one, error\n\t\t\t\tif price.to_f <= @highest.price\n\t\t\t\t\tgflash :error => \"Bid price must be greater than the current price of the item!\"\n\t\t\t\telsif (@bids.first.bidder.id == current_user.id)\n\t\t\t\t\t# if highest bidder is already the user trying to bid again\n\t\t\t\t gflash :error => \"Cannot outbid yourself!\"\n\t\t \telsif (money < price.to_f)\n\t\t\t\t\t# if the user cannot afford the bid\n\t\t\t gflash :error => \"You cannot afford to pay this\"\n\t\t\t\telse\n\t\t\t\t\t# new highest bidder, the user\n\t\t\t\t\t@highest_bid = @user.bids.build(:item_id => params[:item_id], :price => params[:bid_price])\n\t\t\t\t\t@highest_bid.save\n\n\t\t\t\t\t# deduct money from the user since he is currently highest bidder\n\t\t\t\t\[email protected] = @user.money - price.to_f\n\t\t\t\t\[email protected]\n\n\t\t\t\t\t# show pop up regarding bid success\n\t\t\t\t\tgflash :success => \"Bid success. You are now the highest bidder!\"\n\n\t\t\t\t\t# automatically replace the html to show the new highest bidder using ajax so\n\t\t\t\t\t# refreshing the page is not necessary, i.e. automatically update highest bidder box\n\t\t\t\t\trender :juggernaut => {:type => :send_to_all} do |page|\n\t\t\t\t\t \tpage.replace_html :highest_bid, :partial => 'items/highest_bid_price', :object => @highest_bid\n\t\t\t\t\t page.visual_effect :highlight, \"highest_bid_div\", :duration => 5\n\t\t\t\t\t page.replace_html \"search_page_#{@item.id}\", :partial => 'items/searched_bid_price', :object => @highest_bid\n\t\t\t\t\t page.visual_effect :highlight, \"search_page_#{@item.id}\", :duration => 5\n\t\t\t\t\tend\n\n\t\t\t\t\t# if someone was outbidded by the current bid\n\t\t\t\t\tif @highest.bidder.id != @highest_bid.bidder.id\n\t\t\t\t\t\t# send message to the previous highest bidder\n\t\t\t\t\t \t@message = @admin.sent_messages.build(:receiver_id => @highest.bidder.id, :description => \"You have been OUTBIDDED by <a href='/profile/#{@highest_bid.bidder.login}'>#{@highest_bid.bidder.login}</a> for <a href='items/show/#{@highest_bid.item.id}'>#{@highest_bid.item.name}</a>\")\n\t\t\t\t\t @message.save\t\n\t\t\t\t\t @hbidder = User.find(@highest.bidder.id)\n\t\t\t\t\t @hbidder.money = @hbidder.money + @highest.price\n\t\t\t\t\t @hbidder.save \n\t\t\t\t\t @unread_messages = Message.find(:all, :conditions => {:receiver_id => @highest.bidder.id, :unread => true})\n\t\t\t\t\t @num_unread = @unread_messages.count\n\t\t\t\t\t render :juggernaut => {:type => :send_to_client, :client_id => @highest.bidder.id} do |page|\n\t\t\t\t\t\t\tpage.insert_html :top, :main_content, :partial => 'base/outbidded_message', :object => @highest_bid\n\t\t\t\t\t\t\tpage.visual_effect :fade, :no_message, :duration => 2\n\t\t\t\t\t\t\tpage.replace :inbox_link, :partial => 'update_inbox_link', :object => @num_unread\n\t\t\t\t\t\t\tpage.insert_html :top, :messages, :partial => 'base/insert_message', :object => @message\n\t\t\t\t\t\t\tpage.visual_effect :highlight, \"message_#{@message.id}\", :duration => 5\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t \tend\n\t\t\telse # if there are no other bids\n\t\t\t\tif price.to_f <= @item.start_price \n\t\t\t\t\t# if this bid is less than the current highest one, error\n\t\t\t\t\tgflash :error => \"Bid price must be greater than the current price of the item!\"\n\t\t\t\telsif money < price.to_f\n\t\t\t\t\t# if the user cannot afford the bid\t\n\t\t\t\t\tgflash :error => \"Cannot afford to bid with that price!\"\n\t\t\t\telse\n\t\t\t\t\t# since first one to bid, current bid is the highest\n\t\t\t\t\t@highest_bid = @user.bids.build(:item_id => params[:item_id], :price => params[:bid_price])\n\t\t\t\t\t@highest_bid.save\n\n\t\t\t\t\t# deduct money from the user since he is currently highest bidder\n\t\t\t\t\[email protected] = @user.money - price.to_f\n\t\t\t\t\[email protected]\n\n\t\t\t\t\t# show pop up regarding bid success\n\t\t\t\t\tgflash :success => \"Bid success. You are now the highest bidder!\"\n\n\t\t\t\t\t# automatically replace the html to show the new highest bidder using ajax so\n\t\t\t\t\t# refreshing the page is not necessary, i.e. automatically update highest bidder box\n\t\t\t\t\trender :juggernaut => {:type => :send_to_all } do |page|\n\t\t\t\t\t\tpage.replace_html :highest_bid, :partial => 'items/highest_bid_price', :object => @highest_bid\n\t\t\t\t\t\tpage.visual_effect :highlight, \"highest_bid_div\", :duration => 5\n\t\t\t\t\t\tpage.replace_html \"search_page_#{@item.id}\", :partial => 'items/searched_bid_price', :object => @highest_bid\n\t\t\t\t\t\tpage.visual_effect :highlight, \"search_page_#{@item.id}\", :duration => 5\n\t\t\t\t \tend\n\t\t\t\tend # end if price.to_f <= @item.start_price \n\t\t\tend # end if (@bids.count > 0)\n\t\tend # end if @item.closed\n\t\tredirect_to :controller => 'items', :action => 'show', :id => params[:item_id]\n\tend",
"def current_buyer_also_high_bidder?\n # No bid history is sell now, which is essentially 'true'\n # as the buyer didn't cahnge\n return true if self.bid_histories.empty?\n # Let's get our high bidder's id\n high_bidder_id = self.bid_histories.first.member_id\n # Well... are they the same?\n high_bidder_id == self.member_id\n end",
"def set_bid\n @booking = Booking.find(params[:id])\n @presenter = current_user.presenter\n \n if [email protected]_profile\n flash[:info] = \"You must create your profile before you can do this\"\n redirect_to edit_presenter_profile_path(@presenter) and return\n elsif @presenter.presenter_profile.bio.nil?\n flash[:info] = \"You must wait for your profile to be approved before you can do this\"\n redirect_to root_url and return\n end\n\n if @booking.presenters.include? @presenter\n flash[:info] = \"You have already expressed interest in this booking\"\n redirect_to root_url and return\n else\n @booking.presenters << @presenter\n @bid = @booking.bids.find_by(presenter: @presenter)\n @bid.bid_date = DateTime.now\n @bid.rate = params[:rate]\n @bid.save\n end\n\n Notification.send_message(@booking.creator.user, \"#{@presenter.first_name} has expressed an interest in this booking.\", booking_path(@booking), :bid)\n flash[:success] = \"You have successfully placed a bid on this booking.\"\n redirect_to root_url\n end",
"def offer\n # TODO: implement\n end",
"def unredeemable?\n payment_owed? && !(ProductStrategy === self.order.promotion.strategy) \n end",
"def set_item\n @bid_offer = BidOffer.find(params[:id])\n end",
"def pending!\n return false if purchased?\n\n assign_attributes(status: :pending)\n self.addresses.clear if addresses.any? { |address| address.valid? == false }\n save!\n\n if send_payment_request_to_buyer?\n after_commit { send_payment_request_to_buyer! }\n end\n\n true\n end",
"def set_bid\n unless self.top_bid\n bid = Bid.new\n bid.user_id = self.user.id\n bid.highest = self.starting_price\n bid.save\n self.bids << bid\n end\n end",
"def sell_confirmed\n end",
"def auto_accept_response!\n result = false\n if self.active? && self.has_expired? && self.responses_count >= 1 && \n self.offers_reward? && !self.owner_only_offers_reward?\n top = self.responses.active.find(:all, :conditions => [\"responses.up_votes_count >= 2 && responses.votes_sum >= 0\"],\n :order => \"responses.votes_sum ASC, responses.updated_at DESC\", :limit => 2)\n result = top.first.accept! unless top.first.nil?\n self.responses.reload if result\n end\n result\n end",
"def offer\n item.try(:offer)\n end",
"def place_bid_on(auction, max_amount)\n bid = bids.build(auction: auction, max_amount: max_amount)\n\n if bid.is_high_enough? and bid.is_within_time?\n auction.place_bid bid\n elsif !bid.is_within_time?\n raise Bid::InvalidBidError.new 'Auction time is over'\n else\n raise Bid::InvalidBidError.new 'Bid is too low'\n end\n\n bid\n end",
"def create\n \tbid_p = (params[:bid] || {}).merge({user:current_user})\n \tbegin\n\t\t @bid = @auction.bid(bid_p)\n\t\t respond_to do |format|\n\t\t if @bid.save\n\t\t format.html { redirect_to @auction, notice: t(:bid_created) }\n\t\t format.json { render json: @auction, status: :created, location: @bid }\n\t\t else\n\t\t format.html { render action: \"new\" }\n\t\t format.json { render json: @bid.errors, status: :unprocessable_entity }\n\t\t end\n\t\t end\n\t rescue Exception => e\n\t \tredirect_to @auction, notice: t(:auction_closed) if e.message == 'Auction Closed'\n\t end\n end",
"def unappliable_order?\n order.bought? == false\n end",
"def accept_bid\n @accepted_bid = Bid.find(params[:bid_id])\n @accepted_bid.status = 1\n @accepted_bid.save\n\n # Changing the project status to 'In Progress' and setting the project deadline\n @project = Project.find(params[:project_id])\n @project.status = 1\n @project.deadline = Date.today + Product.find(@project.product_id).duration\n @project.save\n\n # Rejecting all other project bids\n @rejected_bids = Bid.where(:project_id => @project.id, :status => 0)\n @rejected_bids.each do |bid|\n bid.status = 2\n bid.save\n end\n\n # what happens on dev's dashboard when client accepts a bid ?\n\n flash[:notice] = \"Bid accepted!\"\n redirect_to projects_dashboard_path\n end",
"def currently_winning_offer\n offers.where('user_id IS NOT NULL').order(cents: :desc, created_at: :asc).first\n end",
"def shares_available_for_purchase?\n if Stock.all.find_by(id: trade.stock_id).shares_available < trade.num_shares\n return false\n else\n return true\n end\n end",
"def check_offer\n offered_char = Character.find_by_name(offer)\n if offered_char != nil\n if offered_char.user_id != user_id\n self.update_attributes(offer: \"none\")\n end\n else \n self.update_attributes(offer: \"none\")\n end \n end",
"def offerer?(person)\n (share_type.is_offer? && author.eql?(person)) || (share_type.is_request? && !author.eql?(person))\n end",
"def online_special_ballot\n end",
"def awaiting_disbursement?\n financial_aid_approved? && !disbursed?\n end",
"def is_pending?\n self.status == WinnerStatus.pending\n end",
"def add_new_bid\n @product = Product.find(params[:id])\n bid = Bid.create\n\n if params[:max_bid].to_i >= @product.price\n @product.update_attributes(end_date: Time.now)\n respond_to do |format|\n format.html { redirect_to @product, notice: 'Purchased' }\n format.json { render :show, status: :ok, location: @product }\n end\n elsif params[:max_bid].to_i < @product.current_price\n respond_to do |format|\n format.html { redirect_to @product, alert: 'Your bid must be higher than the starting price !' }\n format.json { render :show, status: :ok, location: @product }\n end\n else\n bid.max_bid = params[:max_bid]\n bid.product_id = @product.id\n bid.user_id = current_user.id\n bid.save\n respond_to do |format|\n format.html { redirect_to @product, notice: 'Your bid has been placed' }\n format.json { render :show, status: :ok, location: @product }\n end\n end\n end",
"def set_bid(user, new_bid)\r\n if new_bid >= self.current_price + self.increment && new_bid >= self.minimal\r\n unless self.bid.empty?\r\n check_bids(user,new_bid)\r\n else\r\n raise TradeException, \"Not enough money!\" unless user.credits >= new_bid\r\n user.credits -= new_bid\r\n user.credits_in_auction += new_bid\r\n end\r\n tmp_bid = bid.last\r\n self.bid.push Models::Bid.new_bid(user,new_bid)\r\n user.add_activity\"has bid on item #{item.name} from #{item.owner}\"\r\n unless tmp_bid == nil\r\n send_email(tmp_bid) if tmp_bid.value < new_bid\r\n end\r\n else\r\n raise TradeException, \"Too small bid!\"\r\n end\r\n self.invariant\r\n end",
"def deactivate_item(id)\n item = Offer.get_offer(id)\n return false unless item.owner == self.working_for\n if !(identical = self.list_items_inactive.detect{|i| i == item }).nil?\n identical.quantity+=item.quantity\n item.delete\n else\n item.active = false\n item.expiration_date=nil\n end\n\n if !item.wishlist_users.empty?\n item.wishlist_users.each {|user| user.remove_from_wishlist(item); item.wishlist_users.delete(user)}\n end\n Activity.log(self, \"deactivate_item\", item, self.working_for)\n end",
"def buy_item(item, log = true)\n seller = item.owner\n\n if seller.nil?\n Analytics::ItemBuyActivity.with_buyer_item_price_success(self, item, false).log if log\n return false, \"item_no_owner\" #Item does not belong to anybody\n elsif self.credits < item.price\n Analytics::ItemBuyActivity.with_buyer_item_price_success(self, item, false).log if log\n return false, \"not_enough_credits\" #Buyer does not have enough credits\n elsif !item.active?\n Analytics::ItemBuyActivity.with_buyer_item_price_success(self, item, false).log if log\n return false, \"buy_inactive_item\" #Trying to buy inactive item\n elsif !seller.items.include?(item)\n Analytics::ItemBuyActivity.with_buyer_item_price_success(self, item, false).log if log\n return false, \"seller_not_own_item\" #Seller does not own item to buy\n end\n\n seller.release_item(item)\n\n TradingAuthority.settle_item_purchase(seller, self, item)\n\n item.deactivate\n self.attach_item(item)\n\n item.notify_change\n\n Analytics::ItemBuyActivity.with_buyer_item_price_success(self, item).log if log\n\n return true, \"Transaction successful\"\n end",
"def tied(bid)\n @bid = bid\n mail to: bid.manager.email, subject: 'Your Sealed Bid was a tie!'\n end",
"def billed_or_paid?\n status == PAID || status == BILLED\n end"
] | [
"0.6836891",
"0.6794581",
"0.66933584",
"0.6650531",
"0.65907526",
"0.6590148",
"0.6570641",
"0.6562806",
"0.6562806",
"0.6552732",
"0.64454174",
"0.64386225",
"0.6432306",
"0.6432306",
"0.64285624",
"0.642609",
"0.64209837",
"0.6394601",
"0.6394601",
"0.6394601",
"0.6363933",
"0.63206553",
"0.6303116",
"0.62710595",
"0.62649804",
"0.6256358",
"0.62317663",
"0.6200398",
"0.61988705",
"0.6178207",
"0.61714995",
"0.6154924",
"0.6124057",
"0.6091345",
"0.60911345",
"0.60819066",
"0.6077595",
"0.6051348",
"0.6050264",
"0.60393894",
"0.6032822",
"0.6029342",
"0.60246027",
"0.60215807",
"0.6009644",
"0.600751",
"0.598915",
"0.5920527",
"0.5919793",
"0.59188795",
"0.5902735",
"0.5884751",
"0.5874731",
"0.58646095",
"0.58611137",
"0.5859166",
"0.585336",
"0.5850988",
"0.58384234",
"0.5830531",
"0.5829717",
"0.58195037",
"0.58193654",
"0.58130014",
"0.5808311",
"0.5805201",
"0.5805166",
"0.5804574",
"0.5794236",
"0.5792051",
"0.57915807",
"0.577918",
"0.5772756",
"0.5758613",
"0.5754308",
"0.5749205",
"0.57488143",
"0.5742441",
"0.57375914",
"0.5733135",
"0.57255244",
"0.5723122",
"0.5722307",
"0.57192683",
"0.5718991",
"0.57175595",
"0.57165647",
"0.5715104",
"0.5710524",
"0.5691439",
"0.5690259",
"0.5680544",
"0.5677339",
"0.56601995",
"0.5651094",
"0.5647362",
"0.56433296",
"0.56389445",
"0.5629326",
"0.5627726"
] | 0.790385 | 0 |
Get the nearest node that contains the specified index. | def node_at(line, column)
tree_at(line, column).first
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_nearest_node(key) #:nodoc:\n x = anchor\n level = node_level(x)\n while level > 0\n level -= 1\n xnext = node_next(x, level)\n while node_compare(xnext, key) <= 0\n x = xnext\n xnext = node_next(x, level)\n end\n end\n x\n end",
"def find_nearest_node(key) #:nodoc:\n x = node_first\n level = node_level(x)\n while level > 0\n level -= 1\n xnext = node_next(x, level)\n while node_compare(xnext, key) <= 0\n x = xnext\n xnext = node_next(x, level)\n end\n end\n x\n end",
"def search_for(index)\n p index\n @structure.each do |node|\n if node.edge_id == index \n return node end\n end\n end",
"def find_node(index)\n counter = 0\n current_node = @first\n while counter < index \n current_node = current_node.next_node\n counter += 1\n end\n current_node\n\n end",
"def at(index) \n if(index == 0)\n return @head\n end\n count = 0\n node = @head\n while(node.next_node != nil)\n node = node.next_node\n count += 1\n if(count == index)\n return node\n end\n end\n return nil\n end",
"def find_nearest(key)\n node_value(find_nearest_node(key))\n end",
"def find_nearest(key)\n node_value(find_nearest_node(key))\n end",
"def node_at(index)\n if index >= self.size\n puts \"index out of range.\"\n else\n each_with_index do |node, i|\n return node if index == i \n end\n end\n end",
"def find_node_at(index)\n current_index = 0\n node = @head\n until current_index == index\n puts current_index\n node = node.next\n current_index += 1\n end\n puts \"returning node at #{current_index}\"\n node\n end",
"def at(index)\n node = @head\n index.times do\n node = node.next_node\n return nil if node.nil?\n end\n node\n end",
"def at(index)\n i = 0\n node = @head\n while i < index\n i += 1\n node = node.next_node\n end\n return node\n end",
"def at(index)\n if index >= @size\n return nil\n elsif index == 0\n return @head\n end\n search_index = @head\n index.times {\n search_index = search_index.next_node\n }\n return search_index\n end",
"def at(index)\n idx = 0;\n node = list\n while (node != nil)\n return node if idx == index\n idx += 1\n node = node.nextNode\n end\n nil\n end",
"def at(index)\n self.traverse_list_with_count do |node, count|\n if count == index\n return node\n elsif count > self.size\n print \"A node at the given index doesn't exist\"\n end\n end\n end",
"def node_at(index)\n node = head\n index.times { node = node.next_node }\n node\n end",
"def get_at_index(index)\n current_index = 0\n current_node = @head\n\n until current_index == index\n return nil if current_node.nil?\n current_node = current_node.next\n current_index += 1\n end\n return current_node.data\n end",
"def at(index)\n\t\tx = @head\n\t\ty = 0\n\t\tuntil x == nil\n\t\t\tif y == index\n\t\t\t\treturn x\n\t\t\tend\n\t\t\ty += 1\n\t\t\tx = x.next\n\t\tend\n\tend",
"def get_at_index(index)\n return nil if head == nil\n\n counter = 0\n\n node = head\n until counter == index || node.next.nil?\n node = node.next\n counter += 1\n end\n\n return counter == index ? node.data : nil\n end",
"def at(index)\n node = @head\n count = 0\n size.times do\n break if index == count\n node = node.next_node\n count += 1\n end\n return node.data\n end",
"def get_closest_node(id, num = 1)\n @link_table.closest_peers(id, num)\n end",
"def get(index)\n raise(StandardError, 'IndexError') if invalid_index?(index)\n\n find_node_by_index(index).data\n end",
"def nearest(element_id)\n nearest(element_id, from: target)\n end",
"def find_node(index)\n\n\t\t#start at the head\n\t\tcounter = 0\n\t\tcurrent_node = @head\n\n\t\t# crawl to index position\n\t\t# outputs each node value for visibility\n\t\twhile counter < index\n\t\t\tcurrent_node = current_node.next\n\t\t\tcounter += 1\n\t\tend\n\n\t\tputs \"Found node at index #{index} with value: #{current_node.data}\"\n\t\tcurrent_node\n\tend",
"def get_node(i=0)\n nodes.select {|a| a.number == i.to_i}.first\n end",
"def find(key)\n x = find_nearest_node(key)\n return node_value(x) if node_compare(x, key) == 0\n nil # nothing found\n end",
"def find(key)\n x = find_nearest_node(key)\n return node_value(x) if node_compare(x, key) == 0\n nil # nothing found\n end",
"def at(index)\n i = 0\n current_node = @head\n while i != index do\n current_node = current_node.next\n i += 1\n end\n return current_node.data\n end",
"def get_at_index(index)\n # initialize current to head\n current = @head\n # account for index being greater than list length\n if index + 1 > length\n return nil\n # otherwise, move current to index\n else \n index.times do \n current = current.next\n end\n end\n # return value at indexed node\n return current.data\n end",
"def find_at(index)\n return if (index + 1) > count || index < 0\n\n item = @head\n index.times { item = item.next }\n item.value\n end",
"def at_index( n )\n # return Node object at position n in the list\n # same as array[n]\n\n # node = @head\n # n.times do\n # node = node.next if node\n # end\n # node\n\n each{ |node, index| return node if index == n }\n\n # index = 0\n # while node\n # return node if index == n\n # node = node.next # i++\n # index += 1\n # end\n # nil\n end",
"def at(index) \n current_node = head\n\n index.times do\n current_node = current_node.next_node\n end\n current_node\n end",
"def at(index)\n return nil if @head.nil? \n return @head if index == 1\n return nil if index > self.size\n self.each_with_index do |current, ind|\n return current if ind == index\n end\n\n end",
"def nearest(geometry_index: nil, xy:)\n position = nil\n min_distance = 21_000_000 # max distance on earth in meters\n @geometries.each.with_index do |geometry, g_index|\n next unless geometry_index.nil? || geometry_index == g_index\n geometry.each.with_index do |coordinates, c_index|\n distance = xy.distance(coordinates).dim\n if distance < min_distance\n position = Position.new(geometries: geometries, geometry_index: g_index, coordinates_index: c_index)\n min_distance = distance\n end\n end\n end\n position\n end",
"def find(index)\n current = @root\n parent = @root\n\n while current.key != index\n # store a parent variable in memory so that we can access it for deletion\n parent = current\n\n # get the property to travese, either left_child or right_child\n # then set current to equal that traversal\n property = direction(index, current.key)\n current = current.send(property)\n\n # if the next node is nil then we need to exit out the loop as the index\n # does not exist in the tree\n if current.nil?\n return false\n end\n end\n\n # we've found the node! return it\n if block_given?\n yield parent, current, property\n else\n return current \n end\n end",
"def index_of_next_closest(q, from = 0)\n index_of_closest(1, q, from)\n end",
"def at(index)\n\t\t@current_node = @head\n\n\t\tindex.times do \n\t\t\t@current_node = @current_node.next_node\n\t\tend\n\n\t\treturn @current_node\n\tend",
"def at(index)\n\t\tlocation = @head.next_node\n\t\t(index).times do\n\t\t\tlocation = location.next_node\n\t\tend\n\t\tlocation\n\tend",
"def get_at_index(index)\n return nil if head == nil\n\n count = 0\n\n current_node = @head\n\n until count == index\n current_node = current_node.next\n count += 1\n end\n\n return current_node.data\n end",
"def min_child(index)\n ch_e = (index + 1) * 2\n ch_o = (index * 2) + 1\n\n if @nodes[ch_e] && @nodes[ch_o]\n @compare_fn[@nodes[ch_e][:value], @nodes[ch_o][:value]] ? ch_e : ch_o\n elsif @nodes[ch_e]\n ch_e\n elsif @nodes[ch_o]\n ch_o\n else\n nil\n end\n end",
"def next_open_index(index)\n (index...(index + @size)).each do |i|\n if i >= @size\n i = i % @size\n end\n\n if @nodes[i] == nil\n return i\n end\n end\n\n return -1\n end",
"def at(index)\n current = @head\n index.times do\n current = current.next_node\n end\n current\n end",
"def get_at_index(index)\r\n curr = @head\r\n count = 0 \r\n\r\n while count < index && curr\r\n count += 1\r\n curr = curr.next \r\n end\r\n\r\n if count == index \r\n return curr.data \r\n else \r\n return nil\r\n end\r\n end",
"def at_index(index)\n find_by_index(index)\n current\n end",
"def closest(object)\n\t\treturn nil if empty? # edgecase\n\t\tfirst_index(object)[1]\n\tend",
"def at(index)\n node = @head\n index.times { node = node.link } \n node\n end",
"def search_from_cursor(index)\n\t\tif index == cursor_index\n\t\t\tcursor_node\n\t\telsif index > cursor_index\n\t\t\tcurrent_node = cursor_node\n\t\t\t(index-cursor_index).times do |i|\n\t\t\t\tcurrent_node = current_node.next_node\n\t\t\tend\t\n\t\t\tupdate_cursor(node: current_node, index: index)\t\t\t\n\t\t\tcurrent_node\t\t\t\n\t\telse\n\t\t\tcurrent_node = cursor_node\n\t\t\t(index-cursor_index).times do |i|\n\t\t\t\tcurrent_node = current_node.previous_node\n\t\t\tend\t\n\t\t\tupdate_cursor(node: current_node, index: index)\t\t\t\n\t\t\tcurrent_node\n\t\tend\t\t\n\tend",
"def at(index)\n return @tail if index == -1\n return @head if index == 0\n\n counter = 1\n current_node = @head.next_node\n until counter == index\n current_node = current_node.next_node\n counter += 1\n end\n current_node\n end",
"def get_val_at_index(index)\n if index_valid?(index)\n current_node = @head\n i = 0\n while i < index\n current_node = current_node.next_node\n i += 1\n end\n current_node.val\n end\n end",
"def find_node( index )\n\n\n\t\tcount = 0\n\t\tcurrent_node = @head\n\t\tlast_node = nil\n\n\t\twhile count < index\n\n\n\t\traise \"No node at index\" if current_node.next.nil?\n\n\t\t\tprint_node( current_node, count )\n\n\t\t\tlast_node = current_node\n\t\t\tcurrent_node = current_node.next\n\t\t\tcount += 1\n\n\t\tend\n\n\t\tputs \"Weight: #{current_node.data[ 1 ]}\"\n\n\t\treturn last_node, count\n\n\tend",
"def at(index)\n current_node = @head\n index.times do\n current_node = current_node.next_node\n if current_node.next_node == nil\n puts \"no data\"\n break\n end\n end\n current_node\n end",
"def [](index)\n node = find_node(index)\n if node != nil then return node.value else return nil end\n end",
"def find_node(index)\n counter = 0\n current_node = @head\n\n while counter < index\n current_node = current_node.next\n puts \"Iterating through index #{counter} to find #{index}\"\n counter += 1\n end\n puts \"Found node at index #{index} with value: #{current_node.word}\"\n current_node\n end",
"def at(index)\n curr = head\n index.downto(1) do |_|\n break if curr.nil?\n\n curr = curr.next\n end\n curr\n end",
"def at(index, current_index = 0, node = @head)\n return 'Not a valid index' if index >= size || index.negative?\n return node if index == current_index\n\n at(index, current_index + 1, node.next_node)\n end",
"def get_at_index(index)\n return nil if @head.nil?\n\n current = @head\n index.times do\n return nil if current.next.nil?\n current = current.next\n end\n\n return current.data\n end",
"def get_at_index(index)\n count = 0\n\n current = @head\n\n until count == index\n return nil if current.nil?\n current = current.next\n count += 1\n end\n\n return current.data\n end",
"def get_at_index(index)\n current = @head\n count = 0\n while current != nil\n if count == index\n return current.data\n else\n current = current.next\n count += 1\n end\n end\n end",
"def get_at_index(index)\n return nil if @head.nil?\n\n current = @head\n count = 0\n\n until count == index || current.next.nil?\n current = current.next\n count += 1\n end\n\n return current.data || nil\n end",
"def min_child(index)\n left_child_index = left_child(index)\n right_child_index = right_child(index)\n min_child_index = left_child_index\n if right_child_index != INVALID_INDEX && @tree[right_child_index] < @tree[left_child_index]\n min_child_index = right_child_index\n end\n return min_child_index\n end",
"def at(index)\n if index >= self.size\n puts \"index out of range.\"\n else\n each_with_index do |node, i|\n return node.value\n end\n end\n end",
"def get(index) \n assert_in_range index\n node, previous = get_node(index)\n node.value\n end",
"def node_from_set(nodeset, index)\n if index.kind_of?(Integer)\n node = nodeset[index]\n elsif index.kind_of?(Symbol) && nodeset.respond_to?(index) \n node = nodeset.send(index)\n else\n raise \"Could not retrieve node using index #{index}.\"\n end\n \n return node\n end",
"def get_at_index(index)\n return nil if @head.nil?\n \n pointer = @head\n count = 0\n until pointer.next.nil? || count == index\n pointer = pointer.next\n count += 1\n end\n\n return pointer.data\n end",
"def get_at_index(index)\n counter = 0\n pointer = @head\n return nil if @head.nil?\n until counter == index || pointer.next.nil?\n pointer = pointer.next\n counter += 1\n end\n return pointer.data\n end",
"def find(index)\n x = index\n while @parent_array[x] != 0\n x = @parent_array[x]\n end\n return x\n end",
"def closest_point_index(*other)\n other = Point.new(*other)\n 0.upto(n - 1).sort_by { |i| Line.new(points[i], other).length }.first\n end",
"def nearest_index_at(time)\n return @index[time.to_i] if @index.key? time.to_i \n prev_i = -1\n i = data.find_index do |e| \n prev_i += 1\n e.timestamp > time.to_i\n end\n if i.nil?\n return prev_i unless prev_i < 0\n return nil\n elsif i.zero?\n return nil\n end\n i-1\n end",
"def get_at_index(index)\n return nil if @head.nil?\n current = @head\n index.times do\n return nil if current.nil?\n current = current.next\n end\n return current.data\n end",
"def closest_s(v)\n @nodes_s.map { |s| [s, v.distance_to(s)] }.min_by { |a| a[1] }.first\n end",
"def get_at_index(index)\n return nil unless @head\n\n current = @head\n\n index.times do\n return nil unless current.next\n current = current.next\n end\n return current.data\n end",
"def at(index)\n return nil if index < 0 || index > @size \n temp = @head\n index.times { temp = temp.next_node}\n temp\n end",
"def get_at_index(index)\n return nil if index > length\n return get_at_index_helper(index, 0, @head)\n end",
"def get_at_index(index)\n # return nil unless @head\n if @head == nil\n return nil\n end\n current = @head\n index.times do \n # return nil unless current.next\n if current.next == nil #check if index is out of bounds\n return nil\n end\n current = current.next\n end\n return current.data\n end",
"def get_at_index(index)\r\n return nil unless @head\r\n return nil if index < 0\r\n cursor = @head\r\n index.times do\r\n return nil unless cursor.next\r\n cursor = cursor.next\r\n end\r\n return cursor.data\r\n end",
"def at(index)\n each.with_index { |v, i| return v if i == index }\n return nil\n end",
"def nth(index)\n node = @current\n position = node\n if index > 0\n while index > 1 and node and node.next\n node = node.next\n index -= 1\n @current = node\n break if position.equal?(node)\n end\n elsif index < 0\n while index < 0 and node and node.prev\n node = node.prev\n index += 1\n @current = node\n break if position.equal?(node)\n end\n end\n current\n end",
"def find_node(calling_node, key)\n @router.touch(calling_node)\n return @router.get_closest_nodes(key)\n end",
"def get_at_index(index)\r\n \r\n # determine length\r\n if @head.nil?\r\n return nil\r\n else\r\n length = 1\r\n current = @head\r\n until current.next.nil?\r\n current = current.next\r\n length += 1\r\n end\r\n end\r\n \r\n # return nil if index reference is outside of list length\r\n if (index + 1) > length\r\n return nil\r\n end\r\n \r\n # return the value at given index\r\n current = @head\r\n index.times do\r\n current = current.next\r\n end\r\n \r\n return current.data\r\n end",
"def find_node( index )\n\n\n\t\tcount = 0\n\t\tcurrent_node = @head\n\t\tlast_node = nil\n\n\t\twhile count < index\n\n\n\t\traise \"No node at index\" if current_node.next.nil?\n\n\t\t\tprint_node( current_node, count )\n\n\t\t\tlast_node = current_node\n\t\t\tcurrent_node = current_node.next\n\t\t\tcount += 1\n\n\t\tend\n\n\t\tputs \"At index #{count}: #{current_node.word}\"\n\n\t\treturn last_node, count\n\n\tend",
"def get(index)\n if @llist\n node = @llist\n (index).times do\n node = node.next_node\n end\n node\n else\n# todo: handle unknown index\n end\n end",
"def [](index)\n ret = get_node_at_index(index)\n return ret.value if ret != nil\n return ret\n end",
"def find_closest(vertex)\n closest = @vertices.first\n closest_distance = Vertex.euclidean_distance(vertex, closest)\n @vertices.each do |v|\n distance = Vertex.euclidean_distance(vertex, v)\n if distance < closest_distance\n closest_distance = distance\n closest = v\n end\n end\n return closest\n end",
"def get_at_index(index, current=@head)\r\n if current.nil? || current.next.nil? || index == 0\r\n return current&.data\r\n end\r\n \r\n get_at_index(index - 1, current.next)\r\n end",
"def at(index)\n return nil if @head.nil? || index > self.size - 1\n current_node = @head\n (index).times do\n current_node = current_node.next\n end\n current_node.data\n end",
"def nearest_neighbor(target_vector)\n find_nearest_neighbors(target_vector, :results => 1).first\n end",
"def get_at_index(index)\n i = 0\n current = @head\n while current != nil\n if i == index\n return current.data\n end\n current = current.next\n i += 1\n end\n # puts \"Error: #{index} exceeds the linked list length.\"\n return nil\n end",
"def [](index)\n if index >= 0\n node = @head\n index.times do\n node = node.next if node\n end\n elsif index < 0\n node = last\n iter = (index * -1) - 1 # convert neg to pos and\n # - 1 bc node = last\n (iter).times do\n node = prev node\n end\n end\n node ? node.value : nil\n end",
"def at_index(index)\n if head == nil\n \"Theres nothing in the list\"\n else\n tmp = head\n i = 0\n while i != index\n tmp = tmp.next_node\n i += 1\n end\n tmp\n end\n end",
"def retNode(index)\n #puts \"Node Values: #{@nodeValues}\"\n if (@nodeValues.size > index)\n return @nodeValues[index]\n else\n return Hash.new\n end\n end",
"def search_index(replace_index)\n current_index = 0\n each do |node|\n return node if current_index == (replace_index-1)\n current_index += 1\n end\n end",
"def get_node(index)\n return [nil, @tail] if index == @size\n return [nil, nil] unless in_range? index\n \n previous = nil\n current = @head\n current_index = 0\n \n while current_index < index and current\n previous = current\n current = current.successor\n current_index += 1\n end\n \n [current, previous]\n end",
"def item_at(index)\n\t\t\telement = self.head\n\t\t\tcount = 0\n\t\t\twhile count < index\n\t\t\t\treturn nil if element.nil?\n\t\t\t\telement = element.next\n\t\t\t\tcount += 1\n\t\t\tend\n\t\t\telement\n\t\tend",
"def nth(index)\n node = @current\n if index > 0\n while index > 1 and node and node.next\n node = node.next\n index -= 1\n end\n @current = node\n elsif index < 0\n while index < 0 and node and node.prev\n node = node.prev\n index += 1\n end\n @current = node\n end\n current\n end",
"def at(index)\n head\n index.times do\n self.next_node\n end\n @current_node.data\n end",
"def get_at_index(index)\n count = 0\n current = head\n until count == index || current.nil?\n current = current.next\n count += 1\n end\n current_data = current.nil? ? nil : current.data\n return current_data\n end",
"def at(index)\n return \"Index out of range\" if index > self.size\n node = self.head\n if sign(index) == \"+\"\n (index).times do\n node = node.next\n end\n elsif sign(index) == \"-\"\n (index).times do\n node = node.prev\n end\n end\n node\n end",
"def find(value)\n find_root @indices.fetch(value)\n end",
"def find(index_key)\n index[index_key]\n end",
"def find(value, current_index = 0, node = @head)\n return nil if node.nil?\n return current_index if node.value == value\n\n find(value, current_index + 1, node.next_node)\n end",
"def get(key)\n found = @hash[key]\n\n if found\n @list.move_node_to_head(found)\n return found\n end\n\n -1\n end"
] | [
"0.71722895",
"0.7164428",
"0.70908165",
"0.69877434",
"0.6980247",
"0.69622743",
"0.69622743",
"0.69171876",
"0.68772894",
"0.6867266",
"0.68614256",
"0.68538165",
"0.68352306",
"0.67562836",
"0.6672253",
"0.6617807",
"0.659729",
"0.6583029",
"0.6477225",
"0.6408134",
"0.6408026",
"0.63797283",
"0.6365148",
"0.6359801",
"0.63369673",
"0.63369673",
"0.63357836",
"0.63288295",
"0.63170135",
"0.6314675",
"0.63049453",
"0.62881684",
"0.62877226",
"0.62645704",
"0.62606114",
"0.6256822",
"0.62490135",
"0.6248964",
"0.62410593",
"0.6239383",
"0.62198836",
"0.6214879",
"0.6206214",
"0.6196699",
"0.61687726",
"0.6166448",
"0.6156357",
"0.6147835",
"0.6145883",
"0.6145078",
"0.6140223",
"0.6132188",
"0.6086563",
"0.6082555",
"0.60705286",
"0.60603887",
"0.6058554",
"0.60437965",
"0.6037998",
"0.60371333",
"0.60348076",
"0.6029433",
"0.60284466",
"0.6015335",
"0.6007234",
"0.6004054",
"0.5996242",
"0.5988316",
"0.5986184",
"0.5986127",
"0.5970576",
"0.5964875",
"0.59621716",
"0.5946278",
"0.59419185",
"0.5909737",
"0.58851045",
"0.58726317",
"0.58687806",
"0.5860198",
"0.5846072",
"0.5836839",
"0.5832345",
"0.5829497",
"0.58070785",
"0.5804729",
"0.5779384",
"0.5778175",
"0.57594097",
"0.57439554",
"0.5728555",
"0.5710106",
"0.5704233",
"0.56894517",
"0.5685104",
"0.5681131",
"0.56630266",
"0.5660825",
"0.5654847",
"0.5651908"
] | 0.5900618 | 76 |
True if the specified location is inside a string. | def string_at?(line, column)
node = node_at(line, column)
# @todo raise InvalidOffset or InvalidRange or something?
return false if node.nil?
node.type == :str or node.type == :dstr
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def valid_substring?(string)\n [email protected]_at(string)\n end",
"def contains?(string)\n node = @root\n string.each_char do |letter|\n return false unless node[letter]\n node = node[letter]\n end\n\n node[@end_symbol] ? true : false\n end",
"def custom_include?(str, substr)\n # return true if substring is found anywhere\n # within the string. Return false otherwise.\n len = substr.length\n str.chars.each_with_index do |char, idx|\n return true if str[idx, len] == substr\n end\n false\nend",
"def assert_contains(expected_substring, string, *args)\r\n assert(string.include? expected_substring)\r\n end",
"def è_una_stringa?\n @contenuto.start_with? \"\\\"\" or\n @contenuto.start_with? \"'\" or\n @contenuto.start_with? \"%{\"\n end",
"def check_str(str,s)\n if str.include?s\n puts \"true\"\n else\n puts \"false\"\n end\nend",
"def coordinate?(s)\n COORDINATE_RE.match(s.to_s)\n end",
"def is_string_contains_another_string?(char_string, char_set)\n (char_string.sub(char_set, '**').index('**') ? true : false) if(valid_strings?(char_string, char_set))\nend",
"def contain_substr(input, substr)\n input.include?(substr) ? true : false\n end",
"def contains(input, substr)\n input.include?(substr) ? true : false\n end",
"def in_all_strings?(long_strings, substring)\n long_strings.each do |string|\n return false unless string.include?(substring)\n end\n\n return true\nend",
"def include?(str)\n @name.index(str) >= 0\n end",
"def in_all_strings?(long_strings, substring)\n long_strings.all? {|x| x.include?(substring) }\nend",
"def in_all_strings?(long_strings, substring)\n long_strings.all? { |string| string.include?(substring) }\nend",
"def in_all_strings?(long_strings, substring)\n long_strings.all? { |string| string.include?(substring) }\nend",
"def match_at? str, pos = 0\n MatchAt.match_at? str, self, pos\n end",
"def in_all_strings?(long_strings, substring)\n long_strings.all?{ |el| el.include?(substring)}\nend",
"def absolute?\n @string.start_with?(separator)\n end",
"def in_all_strings?(long_strings, short_string)\nend",
"def in_all_strings?(long_strings, substring)\n long_strings.all? {|string| string.include?(substring)}\nend",
"def in_all_strings?(long_strings, substring)\n long_strings.all? {|word| word.include?(substring)}\nend",
"def in_all_strings?(long_strings, substring)\n long_strings.all?{|str|str.include?(substring)}\n\nend",
"def taken?(location)\n position(location) != \" \"\n end",
"def startswith?(substring)\n self[0...substring.size] == substring\n end",
"def is_substring?(s1, s2) \n return s1.include?(s2)\nend",
"def contained?(regexp)\n strings.find{ |x| x =~ regexp }\n end",
"def custom_start_with?(string, substring)\n array_of_strings = string.split(\" \")\n array_of_strings.first == substring ? true : false\nend",
"def contains?(line, string)\n line.chomp.split('/' ).include?(string)\n end",
"def in_outs?(string)\n\t\t[\"def\",\"class\",\"module\",\"begin\",\"case\",\"if\",\"unless\",\"loop\",\"while\",\"until\",\"for\"].each{|x|\n\t\t\tif string.lstrip.slice(/^#{x}/)\n\t\t\t\t\treturn true\n\t\t\tend\n\t\t\t\n\t\t}\n\t\tfalse\n\tend",
"def in_all_strings?(long_strings, substring)\n long_strings.all? { |long_string| sub_string?(long_string, substring) }\nend",
"def structure?\n\t\trawString.start_with? 's'\n\tend",
"def include?(searchstring, substring)\n\nend",
"def is_a_partial_string?(containing_string, potentially_partial_string)\n return (containing_string.size > potentially_partial_string.size and containing_string.include?(potentially_partial_string) )\n end",
"def contains(str)\r\n ContainsText.new(str)\r\n end",
"def part_outside?\r\n return @name.scan(/\\[POUT\\]/).size > 0\r\n end",
"def string?(string, &block)\n string !~ /\\0/ && runner( String, string, &block )\n end",
"def contains(string)\n node = self.root\n string.each_char { |letter|\n if !node.has_key?(letter)\n return false\n end\n node = node[letter]\n }\n\n return node.has_key?(end_symbol)\n \n end",
"def in_all_strings?(long_strings, substring)\n long_strings.all? {|el| sub_string?(el, substring)}\nend",
"def is_substring?(s1, s2)\n s1.include?(s2) #disregarding efficiency, method is assumed to be given\nend",
"def in_both?(string)\n\t\t[\"elsif\",\"else\",\"when\",\"rescue\",\"ensure\"].each{|x|\n\t\treturn true if string.lstrip.slice(/^#{x}/)\n\t\t}\n\t\tfalse\n\tend",
"def include?(str)\n fa.accepts?(str)\n end",
"def substring?(long_string, short_string)\n\nend",
"def customStartWith(string, substring)\n result = false\n substrLen = substring.length\n target = string[0, substrLen]\n result = true if substring == target\n result\nend",
"def substring?(long_string, short_string)\n\n long_string.match(short_string) != nil\n\nend",
"def in_all_strings?(long_strings, substring)\n new_arr = long_strings.select {|s| s.include?(substring)}\n return new_arr == long_strings\nend",
"def string?\n @kind == :double_string_lit || @kind == :single_string_lit\n end",
"def includes_string?(string)\n word = \"Dino\"\n\n if string.include?(word)\n puts \"Sentence does include #{word}! :)\"\n else\n puts \"Sentence does not include #{word}! :(\"\n end\nend",
"def valid_play?(string)\n unless (\"a\"..\"z\").to_a.include?(string)\n return false\n end\n\n newFragment = @fragment + string\n\n # if @dictionary.empty?\n # dictionary\n # end\n\n wordIncludeFragment = dictionary.any? do |word|\n # debugger\n # puts '#{word}'\n word.start_with?(newFragment)\n end\n\n if wordIncludeFragment\n return true\n end\n\n false\n end",
"def str_include?(str, target_str)\n tmp = target_str.downcase\n if !!str.match(/#{tmp}/i)\n return true\n else\n return false\n end\n end",
"def in?(location)\n location['longitude'] >= @lo_long &&\n location['longitude'] <= @hi_long &&\n location['latitude'] >= @lo_lat &&\n location['latitude'] <= @hi_lat\n end",
"def in?(location)\n location['longitude'] >= @lo_long &&\n location['longitude'] <= @hi_long &&\n location['latitude'] >= @lo_lat &&\n location['latitude'] <= @hi_lat\n end",
"def in_all_strings?(long_strings, short_string)\n long_strings.all? do |long_string|\n long_string.include?(short_string)\n end\nend",
"def custom_start(string, substring)\n string_char = string.chars\n sub_char = substring.chars\n bool = true\n sub_char.each_with_index do |element, index|\n if element == string_char[index]\n bool = true\n else\n bool = false\n break\n end\n end\n\n p bool\nend",
"def nearby_az(string)\n\tif string.count(\"a\") == 0\n\t\treturn false\n\tend\n\tindex = string.index('a')\n\tsub_string = string[index,4]\n\n\tif sub_string.count(\"z\") > 0\n\t\treturn true\n\telse \n\t\treturn false\n\tend\nend",
"def exists_in_file?(relative_destination, string)\n path = destination_path(relative_destination)\n content = File.read(path)\n return content.include?(string)\n end",
"def startsWith(search, startstring)\n\treturn search.index(startstring) == 0\nend",
"def in_all_strings?(long_strings, substring)\n count = 0\n long_strings.each do |string|\n if sub_string?(string, substring)\n count += 1\n end\n end\n\n count == long_strings.length\nend",
"def substring?(long_string, short_string)\n length = short_string.length\n letters = long_string.chars\n letters.each_with_index do |letter, index|\n return true if letters[index...index + length].join == short_string\n end\n false\nend",
"def in_all_strings?(long_strings, substring)\n long_strings.map do |str|\n str.split.any?(substring)\n end.all?(true)\nend",
"def contains_any(str, fragments)\r\n return false unless Regexp.union(fragments) =~ str\r\n true\r\n end",
"def custom_includee(string, substring)\n string.split(substring).length != 1\nend",
"def str_start_with (orig_string, little_string)\n return !orig_string.match(/\\A#{Regexp.escape(little_string)}/).nil?\nend",
"def contains_any(str, fragments)\n return false unless Regexp.union(fragments)&.match?(str)\n true\n end",
"def name_is?(name)\n @location.name_is?(name)\n end",
"def round_over?\n is_word?(fragment)\n end",
"def start_with?(string)\n @message[:body].to_s.start_with?(string)\n end",
"def custom_start_with(string, substring)\n string[0, substring.length] == substring\nend",
"def on_call_contains(context, haystack, needle)\n haystack_str = on_call_string(context, haystack)\n needle_str = on_call_string(context, needle)\n\n return haystack_str.include?(needle_str)\n end",
"def is_string?\n @name.is_a?(String) && @stack.empty?\n end",
"def isInside(_pos)\n raise \"not defined\" ;\n end",
"def string_include?(val)\n return false if !val.is_a?(String)\n ret = false\n for a in self\n ret = true if a.is_a?(String) && val.include?(a)\n end\n return ret\n end",
"def complete_expression?(str); end",
"def valid?(string)\n scanner = UnicodeScanner.new(string)\n\n first_left_brace_match = scanner.scan_until(UNESCAPED_LEFT_BRACE)\n return true unless first_left_brace_match\n\n until scanner.eos?\n # Make sure there's a right brace to match with the left one.\n right_brace_match = scanner.scan_until(UNESCAPED_RIGHT_BRACE)\n return false unless right_brace_match\n\n right_brace_index = scanner.pos\n scanner.unscan # Reset to last time we saw a left brace.\n\n # If there are no more left braces, we're good.\n left_brace_match = scanner.scan_until(UNESCAPED_LEFT_BRACE)\n return true unless left_brace_match\n\n # Make sure the next right brace happens before the next left brace.\n left_brace_index = scanner.pos\n return false if left_brace_index < right_brace_index\n end\n end",
"def exists?(str)\n ::VIM::evaluate(%{exists(\"#{str}\")}).to_i != 0\n end",
"def yours?(str)\n str[0..1] == 'BA'\n end",
"def contain?(location)\n @map.map.with_index { |v, i| i }.include? location.x and\n @map[location.x].map.with_index { |v, i| i }.include? location.y\n end",
"def is_location_in_context?(iLocation)\n # * *iLocation* (_String_): Directory\n return $LOAD_PATH.include?(iLocation)\n end",
"def check_string( str )\r\n result = false\r\n return result unless validate_string(str)\r\n\r\n if str.include?( self.pattern )\r\n result = true\r\n end\r\n return result\r\n end",
"def include?(text)\n to_s.include? text\n end",
"def contains?(str)\n return false unless ::File.exist?(self)\n ::File.open(self, &:readlines).collect { |l| return true if l.match(str) }\n false\n end",
"def end_with?(string)\n to_s.end_with?(string.to_s)\n end",
"def contains_special(string)\n if (string.include?('!') || string.include?('#') || string.include?('$'))\n true\n else\n false\n end\nend",
"def at?(loc)\n\t\t\trequest.path_info.downcase.include? loc.to_s\n\t\tend",
"def contains_text(str)\n text.index(str)\n end",
"def include?(string)\n image.include?(string)\n end",
"def exists?(str)\n VIM.evaluate(%{exists(\"#{str}\")}).to_i != 0\n end",
"def contains str, settings\n return false unless settings.instance_of? String\n return false if settings.empty?\n settings.split('|').inject(false) { |r, t| true if str == t }\n end",
"def single_segment?(str)\n raise InvalidGSMString unless can_encode?(str)\n\n extended_chars = str.gsub(GSM_NOT_EXTENDED_REGEX, '').length\n (str.length + extended_chars) <= GSM_SEGMENT_LENGTH\n end",
"def include?(word)\n find_word(word) { |found, current| return found && current.is_word }\n end",
"def starts_with_consonant?(s)\n !!(s =~ /\\A[^aeiou\\W].*/i)\nend",
"def custom_start(str, sub_str)\n str_plc, sub_len = str, sub_str.length\n #str_plc.slice(0, sub_len) == sub_str\n str_plc[0, sub_len] == sub_str\nend",
"def starts_with?(s)\n index(s) == 0\n end",
"def is? str\n !!match(str)\n end",
"def string?(str)\n str.is_a?(String)\n end",
"def endswith?(substring)\n self[-substring.size..-1] == substring\n end",
"def starts_with_consonant?(s)\r\n !!(s[0] =~ /[bcdfghjklmnprstvwxyz]+/i)\r\nend",
"def located_here?(x,y)\n self.location == [x,y]\n end",
"def in_all_strings?(long_strings, short_string)\n # sliding window\n\n # check each long_string\n long_strings.each do |s|\n in_string = false\n n = s.length - short_string.length\n\n # check each substring of a long string\n # if equal to short string\n (0..n).each do |i|\n # if we encounter the shortstring in the substring\n # then we should move on to the next long string\n if s.slice(i, short_string.length) == short_string\n in_string = true\n break\n end\n end\n # if we didn't find a substring in this long string\n # then we know that not all substrings are in the long string\n if in_string == false\n return false\n end\n end\n\n true\nend",
"def has_sin?(string)\n return !(string.match(/(\\b)(\\w{3})-(\\w{3})-(\\w{3})/).nil?)\nend",
"def wordInStrings(word, strings)\n for string in strings do\n\n if string.include? word\n return true\n end\n end\n\n return false\nend"
] | [
"0.67478484",
"0.65356946",
"0.64449733",
"0.64311224",
"0.63585126",
"0.6252691",
"0.62215734",
"0.62133944",
"0.61819476",
"0.61453235",
"0.6102149",
"0.6092413",
"0.6060883",
"0.60585344",
"0.6058458",
"0.603991",
"0.60247666",
"0.6010176",
"0.60053724",
"0.5997736",
"0.5968802",
"0.59399855",
"0.592762",
"0.59257054",
"0.59188056",
"0.58998513",
"0.5886142",
"0.5875256",
"0.587337",
"0.5869026",
"0.58609414",
"0.5855745",
"0.58540225",
"0.5844017",
"0.58418244",
"0.58321136",
"0.5822349",
"0.5815999",
"0.5814841",
"0.57961124",
"0.57735246",
"0.5765956",
"0.5714964",
"0.5696719",
"0.5693199",
"0.56913126",
"0.56779027",
"0.5664724",
"0.5658974",
"0.5654574",
"0.5639036",
"0.56379586",
"0.562981",
"0.56189996",
"0.561544",
"0.5598235",
"0.5596762",
"0.55943424",
"0.5594287",
"0.5580513",
"0.55647564",
"0.5564506",
"0.55395883",
"0.5526",
"0.55248964",
"0.5517189",
"0.55106735",
"0.5508479",
"0.55067074",
"0.550228",
"0.55017513",
"0.549407",
"0.5492514",
"0.54886186",
"0.54880524",
"0.5482667",
"0.54824495",
"0.5479674",
"0.54771894",
"0.5475079",
"0.5469354",
"0.54564",
"0.54526",
"0.5438788",
"0.54326653",
"0.5419527",
"0.54186213",
"0.5413835",
"0.5401845",
"0.5401198",
"0.5395164",
"0.5391471",
"0.53901064",
"0.5384678",
"0.5384494",
"0.538183",
"0.53807807",
"0.53729886",
"0.53711236",
"0.53703874"
] | 0.6569834 | 1 |
Get an array of nodes containing the specified index, starting with the nearest node and ending with the root. | def tree_at(line, column)
offset = Position.line_char_to_offset(@code, line, column)
stack = []
inner_tree_at @node, offset, stack
stack
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def node_at(index)\n if index >= self.size\n puts \"index out of range.\"\n else\n each_with_index do |node, i|\n return node if index == i \n end\n end\n end",
"def at(index)\n node = @head\n index.times do\n node = node.next_node\n return nil if node.nil?\n end\n node\n end",
"def get_node(index)\n return [nil, @tail] if index == @size\n return [nil, nil] unless in_range? index\n \n previous = nil\n current = @head\n current_index = 0\n \n while current_index < index and current\n previous = current\n current = current.successor\n current_index += 1\n end\n \n [current, previous]\n end",
"def at(index)\n i = 0\n node = @head\n while i < index\n i += 1\n node = node.next_node\n end\n return node\n end",
"def closest_nodes_to_all(nodes, nodes_from, max_dist = nil)\n closest = []\n nodes_from.each do |node_from|\n closest += closest_nodes(nodes, node_from, max_dist)[0..5]\n end\n closest.uniq\n end",
"def find_node(index)\n counter = 0\n current_node = @first\n while counter < index \n current_node = current_node.next_node\n counter += 1\n end\n current_node\n\n end",
"def root(index)\n return index if index == @store[index]\n root(@store[index])\n end",
"def at(index)\n idx = 0;\n node = list\n while (node != nil)\n return node if idx == index\n idx += 1\n node = node.nextNode\n end\n nil\n end",
"def fetch_neighbors index\n # CONFIG\n total_articles = data.case_studies.length\n neighbors = []\n # SCRIPT\n if index === 1\n previous_article = fetch_article(total_articles)\n next_article = fetch_article(2)\n elsif index === total_articles\n previous_article = fetch_article(total_articles - 1)\n next_article = fetch_article(1)\n else\n previous_article = fetch_article(index - 1)\n next_article = fetch_article(index + 1)\n end\n neighbors.push(previous_article, next_article)\n # RETURN\n neighbors\n end",
"def closest_nodes(nodes, node_from, max_dist = nil)\n max_dist = [segment_length * 0.10, 2222].min if !max_dist\n closest = []\n nodes.each do |node_to|\n d = node_from.distance(node_to)\n closest << [node_to, d] if d and d <= max_dist\n end\n closest.sort_by! {|x| x[1]}\n closest.collect {|x| x[0]}.uniq\n end",
"def surrounding(index, directions = Grid::Movement, compact = true)\n result = directions.collect {|dir| neighbor(index, dir)} + [index]\n return result.compact.uniq if compact\n return result.uniq\n end",
"def root(idx)\n idx_value = @array[idx][:value]\n while idx != idx_value\n # OPTIMIZATION (line 67): Path compression. Make every other node in the path point to its grandparent. No reason not to do this! We're already hitting each node anyway.\n @array[idx][:value] = @array[idx_value][:value]\n # Keeps tree almost completely flat!\n idx = idx_value\n end\n @array[idx]\n end",
"def at(index)\n if index >= @size\n return nil\n elsif index == 0\n return @head\n end\n search_index = @head\n index.times {\n search_index = search_index.next_node\n }\n return search_index\n end",
"def at(index) \n current_node = head\n\n index.times do\n current_node = current_node.next_node\n end\n current_node\n end",
"def at(x)\n \tif x == 0\n \t\treturn @root\n \tend\n \tnode=@root\n for i in 1..x\n node=node.next_node\n end\n return node\n end",
"def find_nearest_node(key) #:nodoc:\n x = anchor\n level = node_level(x)\n while level > 0\n level -= 1\n xnext = node_next(x, level)\n while node_compare(xnext, key) <= 0\n x = xnext\n xnext = node_next(x, level)\n end\n end\n x\n end",
"def at(index)\n current_node = @head\n index.times do\n current_node = current_node.next_node\n if current_node.next_node == nil\n puts \"no data\"\n break\n end\n end\n current_node\n end",
"def roots\n self.where(parent: nil).order('index asc')\n end",
"def at_index( n )\n # return Node object at position n in the list\n # same as array[n]\n\n # node = @head\n # n.times do\n # node = node.next if node\n # end\n # node\n\n each{ |node, index| return node if index == n }\n\n # index = 0\n # while node\n # return node if index == n\n # node = node.next # i++\n # index += 1\n # end\n # nil\n end",
"def get_all_trees_from_preorder(array, start=0, end_index=array.size-1)\n #Pre-order visits root first. So 1st element is always root of the tree. next element could be left or right\n #Form all trees with next element being its left, then trees with next element as its right etc.\n # [1,2,3,4] => Use DP approach, bottom up approach. Go all the way down to last 2 nodes\n # 3 3\n # 4 and 4\n # Now 2 can be added as the root and left could be 3 and right could be 3\n # 4 4\n # And follow this till root\n if (start == array.size-1)\n return [Node.new(array[start])]\n end\n results = []\n trees = get_all_trees_from_preorder(array, start+1, end_index-1)\n trees.each do |tree|\n node1 = Node.new(array[start])\n node1.left = tree\n results << node1\n node2 = Node.new(array[start])\n node2.right = tree\n results << node2\n end\n results\nend",
"def find_nearest_node(key) #:nodoc:\n x = node_first\n level = node_level(x)\n while level > 0\n level -= 1\n xnext = node_next(x, level)\n while node_compare(xnext, key) <= 0\n x = xnext\n xnext = node_next(x, level)\n end\n end\n x\n end",
"def kth_to_last_node(i, root)\n nodes = [root]\n current = root\n\n while current = current.next\n nodes << current\n if nodes.length > i\n nodes.shift\n end\n end\n\n nodes.first\nend",
"def at(index)\n\t\t@current_node = @head\n\n\t\tindex.times do \n\t\t\t@current_node = @current_node.next_node\n\t\tend\n\n\t\treturn @current_node\n\tend",
"def find_node_at(index)\n current_index = 0\n node = @head\n until current_index == index\n puts current_index\n node = node.next\n current_index += 1\n end\n puts \"returning node at #{current_index}\"\n node\n end",
"def getChildrenIdx(idx)\n [2 * idx + 1, 2 * idx + 2]\n end",
"def search_for(index)\n p index\n @structure.each do |node|\n if node.edge_id == index \n return node end\n end\n end",
"def find(index)\n x = index\n while @parent_array[x] != 0\n x = @parent_array[x]\n end\n return x\n end",
"def at(index)\n i = 0\n current_node = @head\n while i != index do\n current_node = current_node.next\n i += 1\n end\n return current_node.data\n end",
"def node_at(index)\n node = head\n index.times { node = node.next_node }\n node\n end",
"def at(index)\n node = @head\n index.times { node = node.link } \n node\n end",
"def at(index)\n\t\tlocation = @head.next_node\n\t\t(index).times do\n\t\t\tlocation = location.next_node\n\t\tend\n\t\tlocation\n\tend",
"def at(index)\n node = @head\n count = 0\n size.times do\n break if index == count\n node = node.next_node\n count += 1\n end\n return node.data\n end",
"def next_open_index(index)\n (index...(index + @size)).each do |i|\n if i >= @size\n i = i % @size\n end\n\n if @nodes[i] == nil\n return i\n end\n end\n\n return -1\n end",
"def at(index) \n if(index == 0)\n return @head\n end\n count = 0\n node = @head\n while(node.next_node != nil)\n node = node.next_node\n count += 1\n if(count == index)\n return node\n end\n end\n return nil\n end",
"def traverse index_array\n\t\treturn self if index_array.size == 0\n\t\tchild = index_array.shift\n\t\treturn nil if child > @children.size\n\t\treturn @children[child - 1].traverse(index_array)\n\tend",
"def each_child_with_index(&block) # :yields: child_node, index\n children.each_with_index(&block)\n nil\n end",
"def each_child_with_index(&block) # :yields: child_node, index\n children.each_with_index(&block)\n nil\n end",
"def preceding_entries\n return [] if index.zero? # first entry\n\n tree.all_data[0..(index - 1)]\n end",
"def search_from_cursor(index)\n\t\tif index == cursor_index\n\t\t\tcursor_node\n\t\telsif index > cursor_index\n\t\t\tcurrent_node = cursor_node\n\t\t\t(index-cursor_index).times do |i|\n\t\t\t\tcurrent_node = current_node.next_node\n\t\t\tend\t\n\t\t\tupdate_cursor(node: current_node, index: index)\t\t\t\n\t\t\tcurrent_node\t\t\t\n\t\telse\n\t\t\tcurrent_node = cursor_node\n\t\t\t(index-cursor_index).times do |i|\n\t\t\t\tcurrent_node = current_node.previous_node\n\t\t\tend\t\n\t\t\tupdate_cursor(node: current_node, index: index)\t\t\t\n\t\t\tcurrent_node\n\t\tend\t\t\n\tend",
"def build_tree(arr, start_index = 0, end_index = arr.length - 1)\n return nil if start_index > end_index\n\n mid = (start_index + end_index) / 2\n curr_root = arr[mid].is_a?(Node) ? arr[mid] : Node.new(arr[mid])\n curr_root.left = build_tree(arr, start_index, mid - 1)\n curr_root.right = build_tree(arr, mid + 1, end_index)\n curr_root\n end",
"def at(index)\n return @tail if index == -1\n return @head if index == 0\n\n counter = 1\n current_node = @head.next_node\n until counter == index\n current_node = current_node.next_node\n counter += 1\n end\n current_node\n end",
"def nth(index)\n node = @current\n position = node\n if index > 0\n while index > 1 and node and node.next\n node = node.next\n index -= 1\n @current = node\n break if position.equal?(node)\n end\n elsif index < 0\n while index < 0 and node and node.prev\n node = node.prev\n index += 1\n @current = node\n break if position.equal?(node)\n end\n end\n current\n end",
"def at(index)\n return nil if index < 0 || index > @size \n temp = @head\n index.times { temp = temp.next_node}\n temp\n end",
"def index\n @nodes = Node.find(:all,:order => :lft)\n \n @node_list = []\n 0.upto(@nodes.size-1) do |i|\n node = @nodes[i]\n links = []\n if i > 0\n \tprev_node = @nodes[i-1]\n \tif prev_node.level == node.level\n links << {:link_type=> :arrow_right, :to => 'child_of', :dest_id => prev_node}\n \tend\n \tif prev_node.level < node.level\n links << {:link_type=> :arrow_left, :to => 'right_of', :dest_id => prev_node}\n \tend\n links << {:link_type=> :arrow_up, :to => 'left_of', :dest_id => prev_node}\n end\n if i < @nodes.size-1\n (i+1).upto(@nodes.size-1) do |n|\n if @nodes[n].level <= node.level\n links << {:link_type=> :arrow_down, :to => 'right_of', :dest_id => @nodes[n]}\n break\n end\n end\n end\n @node_list << [node,links]\n end\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @nodes }\n end\n end",
"def at(index)\n\t\tx = @head\n\t\ty = 0\n\t\tuntil x == nil\n\t\t\tif y == index\n\t\t\t\treturn x\n\t\t\tend\n\t\t\ty += 1\n\t\t\tx = x.next\n\t\tend\n\tend",
"def get_at_index(index)\n current_index = 0\n current_node = @head\n\n until current_index == index\n return nil if current_node.nil?\n current_node = current_node.next\n current_index += 1\n end\n return current_node.data\n end",
"def bfs(target_pos) #this is called on the root node \n tar_x, tar_y = target_pos \n\n arr = [self]\n\n until arr.empty?\n current_check = arr.shift \n return current_check if current_check.root_node == target_pos\n arr.concat(current_check.children)\n end\n nil\n end",
"def at(index)\n current = @head\n index.times do\n current = current.next_node\n end\n current\n end",
"def generate_indices(index=1.0,left=nil,right=nil)\n if not index.nil?\n raise \"index #{index} < left #{left}!\" if not left.nil? and index < left\n raise \"index #{index} > right #{right}!\" if not right.nil? and index > right\n end\n self[:index] = index\n \n left = index - 1.0 if left.nil?\n right = index + 1.0 if right.nil?\n \n lefts = []\n center = []\n rights = []\n # indices < index\n (@children.size/2).times { \n lefts.push rand_range(left+0.00001,index-0.0001)\n }\n # index\n center.push( index ) if @children.size % 2 != 0\n \n # indices > index\n (@children.size/2).times { \n rights.push rand_range(index,right)\n }\n \n indices = [lefts,center,rights].flatten.sort\n \n indices.each_index { |i|\n left = nil\n left = indices[i-1] if i-1 >= 0\n right = nil\n right = indices[i+1] if i+1 < indices.size\n if i < @children.size/2.0 and i+1 > @children.size/2.0\n right = index\n end\n if i >= @children.size/2.0 and i-1 < @children.size/2.0\n left = index\n end\n \n @children.get(i).generate_indices(indices[i],left,right)\n }\n end",
"def swim index\n parent_index = (index - 1) / 2\n\n # continue to bubble upward while we have not reached the root,\n # and while we are less than the parent element\n while (index > 0 && less_than?(index, parent_index))\n \n # swap the two values\n swap_values_at(index, parent_index)\n index = parent_index\n # set new parent index based on the bubble up\n parent_index = (index - 1) / 2\n end\n end",
"def [](index)\n get_node(index).element\n end",
"def context_node_neighbours(contextual_ast, depth=1)\n # TODO depth can be root\n target_node_sibling = contextual_ast.context_nodes[depth]\n node_to_be_searched = contextual_ast.context_nodes[depth - 1]\n previous_children = []\n node_to_be_searched.children.map do |child|\n break if child == target_node_sibling\n previous_children << child\n end\n previous_children\n end",
"def node_by_index(index)\n subject.to_xml.to_a[index]\nend",
"def at(index)\n if index >= self.size\n puts \"index out of range.\"\n else\n each_with_index do |node, i|\n return node.value\n end\n end\n end",
"def search root, target\n queue = [root]\n\n until queue.empty?\n current = queue.shift\n return current if current.x == target.x && current.y == target.y\n\n current.make_children.each { |child| queue << child }\n end\nend",
"def tree_nodes\n node_sets = completed_list.map.with_index do |item_set, index|\n item_set.map do |item|\n exclusive_index_at_which_substring_ends = index\n ParseForest::Node.new(item.production,\n item.position, \n exclusive_index_at_which_substring_ends)\n end\n end\n node_sets.flatten\n end",
"def left_child_node(index)\n index * 2 + 1\n end",
"def build_tree( arr, first_index = 0, last_index = arr.length - 1 )\n return nil if first_index > last_index\n \n middle_of_array = (first_index + last_index)/2\n \n root = Node.new(arr[middle_of_array])\n \n root.left_child = build_tree(arr, first_index, middle_of_array - 1)\n root.right_child = build_tree(arr, middle_of_array + 1, last_index)\n \n return root \n end",
"def find(index)\n current = @root\n parent = @root\n\n while current.key != index\n # store a parent variable in memory so that we can access it for deletion\n parent = current\n\n # get the property to travese, either left_child or right_child\n # then set current to equal that traversal\n property = direction(index, current.key)\n current = current.send(property)\n\n # if the next node is nil then we need to exit out the loop as the index\n # does not exist in the tree\n if current.nil?\n return false\n end\n end\n\n # we've found the node! return it\n if block_given?\n yield parent, current, property\n else\n return current \n end\n end",
"def get_neighbours(vertex)\n neighbours = []\n each(vertex) do |_, v|\n neighbours << v\n end\n neighbours\n end",
"def at(index)\n head\n index.times do\n self.next_node\n end\n @current_node.data\n end",
"def nearest(geometry_index: nil, xy:)\n position = nil\n min_distance = 21_000_000 # max distance on earth in meters\n @geometries.each.with_index do |geometry, g_index|\n next unless geometry_index.nil? || geometry_index == g_index\n geometry.each.with_index do |coordinates, c_index|\n distance = xy.distance(coordinates).dim\n if distance < min_distance\n position = Position.new(geometries: geometries, geometry_index: g_index, coordinates_index: c_index)\n min_distance = distance\n end\n end\n end\n position\n end",
"def index_of_next_closest(q, from = 0)\n index_of_closest(1, q, from)\n end",
"def find_nearest(key)\n node_value(find_nearest_node(key))\n end",
"def find_nearest(key)\n node_value(find_nearest_node(key))\n end",
"def each_with_index(&block)\n @tree.each_with_index(&block)\n end",
"def neighbours_into_start(node)\n # Find all arcs that include this node in the right place\n passable_nodes = []\n @arcs.get_arcs_by_node_id(node.node_id).each do |arc|\n if arc.end_node_id == node.node_id and arc.end_node_direction\n passable_nodes.push nodes[arc.begin_node_id]\n elsif arc.begin_node_id == node.node_id and !arc.begin_node_direction\n passable_nodes.push nodes[arc.end_node_id]\n end\n end\n return passable_nodes.uniq\n end",
"def root\n self.where(parent: nil).order('index asc').first\n end",
"def get(index)\n raise(StandardError, 'IndexError') if invalid_index?(index)\n\n find_node_by_index(index).data\n end",
"def postorder\n nodelets_array = []\n\n postorder_helper(@root, nodelets_array)\n \n return nodelets_array\n end",
"def nth(index)\n node = @current\n if index > 0\n while index > 1 and node and node.next\n node = node.next\n index -= 1\n end\n @current = node\n elsif index < 0\n while index < 0 and node and node.prev\n node = node.prev\n index += 1\n end\n @current = node\n end\n current\n end",
"def depth_first_search(adj_matrix, source_index, end_index)\n node_stack = [source_index]\n # The code uses a forever loop and then breaks when we encounter certain conditions.\n loop do\n curr_node = node_stack.pop\n return false if curr_node == nil\n return true if curr_node == end_index\n\n # Out of the adjacency matrix, pick the “children” of curr_node by checking the 1’s in the adjacency matrix\n children = (0..adj_matrix.length-1).to_a.select do |i| \n adj_matrix[curr_node][i] == 1\n end\n \n # Take those nodes and push them onto the end of the stack\n node_stack = node_stack + children\n end\n end",
"def inorder\n return [] if @root.nil?\n\n nodelets_array = []\n\n inorder_helper(@root, nodelets_array)\n\n return nodelets_array\n end",
"def getNthBTNode(root, n)\n que, top = [root], 0\n while top < que.size()\n curr = que[top]\n top += 1\n next if curr.nil?\n que << curr.left\n que << curr.right\n return que[n] if que.size() > n\n end\n end",
"def read(index)\n return if index.negative? || first_node.nil?\n\n current_index = 0\n current_node = first_node\n while current_index < index\n current_node = current_node.next_node\n current_index += 1\n\n return nil unless current_node\n end\n\n current_node.data\n end",
"def [](index)\n @tree[index]\n end",
"def find_node(index)\n\n\t\t#start at the head\n\t\tcounter = 0\n\t\tcurrent_node = @head\n\n\t\t# crawl to index position\n\t\t# outputs each node value for visibility\n\t\twhile counter < index\n\t\t\tcurrent_node = current_node.next\n\t\t\tcounter += 1\n\t\tend\n\n\t\tputs \"Found node at index #{index} with value: #{current_node.data}\"\n\t\tcurrent_node\n\tend",
"def get_at_index(index)\n return nil if head == nil\n\n counter = 0\n\n node = head\n until counter == index || node.next.nil?\n node = node.next\n counter += 1\n end\n\n return counter == index ? node.data : nil\n end",
"def find_element_children(index, el_depth, ordering)\n\t\tchildren = Array.new\n\t\ti = index + 1\n\t\tcurr_el = get_element_in_ordering(i, ordering)\n\t\twhile (curr_el == \"PlaceHolder\") #ignore nil elements\n\t\t\ti = i+1\n\t\t\tcurr_el = get_element_in_ordering(i, ordering)\n\t\tend\n\n\t\tif curr_el.is_a?(Node)\n\t\t\tcurr_child_depth = curr_el.depth\n\t\telse #if it's a note, it can't have children, so arbitrary big depth that'll get rest on the first node\n\t\t\tcurr_child_depth = 100000\n\t\tend\n\n\t\twhile (curr_el != nil && el_depth < curr_el.depth) #until you find something of equal or lesser depth\n\t\t\t#basically, include it if it's nested deeper (therefore in this loop,) but don't go into children of what you find)\n\t\t\tif curr_el.depth <= curr_child_depth && curr_el.is_a?(Node)\n\t\t\t\tnode_and_index = { node: curr_el, index: i}\n\t\t\t\tchildren.push(node_and_index)\n\t\t\t\tcurr_child_depth = curr_el.depth\n\t\t\telsif curr_el.depth <= curr_child_depth && (curr_el.is_a?(Note) || curr_el.is_a?(LinkCollection))\n\t\t\t\tnode_and_index = { node: curr_el, index: i}\n\t\t\t\tchildren.push(node_and_index)\n\t\t\t\tcurr_child_depth = 100000 \n\t\t\tend\n\t\t\t#if there's an indented note after some nodes, it will likely get ignored\n\n\t\t\ti = i+1\n\t\t\tcurr_el = get_element_in_ordering(i, ordering)\n\t\t\twhile (curr_el == \"PlaceHolder\") #ignore nil elements\n\t\t\t\ti = i+1\n\t\t\t\tcurr_el = get_element_in_ordering(i, ordering)\n\t\t\tend\n\t\tend\n\t\treturn children\n\tend",
"def [](index)\n if index >= 0\n node = @head\n index.times do\n node = node.next if node\n end\n elsif index < 0\n node = last\n iter = (index * -1) - 1 # convert neg to pos and\n # - 1 bc node = last\n (iter).times do\n node = prev node\n end\n end\n node ? node.value : nil\n end",
"def search_index(replace_index)\n current_index = 0\n each do |node|\n return node if current_index == (replace_index-1)\n current_index += 1\n end\n end",
"def [](index)\n node = find_node(index)\n if node != nil then return node.value else return nil end\n end",
"def roots\n select\n end",
"def get_at_index(index)\n return nil if @head.nil?\n\n current = @head\n index.times do\n return nil if current.next.nil?\n current = current.next\n end\n\n return current.data\n end",
"def at(index)\n return nil if @head.nil? \n return @head if index == 1\n return nil if index > self.size\n self.each_with_index do |current, ind|\n return current if ind == index\n end\n\n end",
"def find_nodes(target_types, ignoring = [])\n result = []\n look_for_types(target_types, ignoring) { |exp| result << exp }\n result\n end",
"def min_child(index)\n ch_e = (index + 1) * 2\n ch_o = (index * 2) + 1\n\n if @nodes[ch_e] && @nodes[ch_o]\n @compare_fn[@nodes[ch_e][:value], @nodes[ch_o][:value]] ? ch_e : ch_o\n elsif @nodes[ch_e]\n ch_e\n elsif @nodes[ch_o]\n ch_o\n else\n nil\n end\n end",
"def each_with_index\n return nil if @head.nil?\n node_index = 1 #I'll consider first node as 1 \n entry = @head\n until entry.nil?\n yield entry, node_index\n entry = entry.next\n node_index +=1\n end\n end",
"def get_node(i=0)\n nodes.select {|a| a.number == i.to_i}.first\n end",
"def get_at_index(index)\n return nil if head == nil\n\n count = 0\n\n current_node = @head\n\n until count == index\n current_node = current_node.next\n count += 1\n end\n\n return current_node.data\n end",
"def nodes_inorder\n ret = []\n inorder(root, ret)\n ret\n end",
"def left_child(index)\n left = index * 2 + 1\n if left >= @tree.length\n return INVALID_INDEX\n else\n return left\n end\n end",
"def to_a\n nodes.map(&:at)\n end",
"def left_child_index(i)\n i * 2\n end",
"def get_at_index(index)\n return nil if @head.nil?\n current = @head\n index.times do\n return nil if current.nil?\n current = current.next\n end\n return current.data\n end",
"def token_neighbors(word, index)\n start_pos = index - window < 0 ? 0 : index - window\n end_pos = (index + window >= tokens.size) ? tokens.size - 1 : index + window\n\n tokens[start_pos..end_pos].map do |neighbor|\n neighbor unless word == neighbor\n end.compact\n end",
"def nodes()\n self.root.nodes()\n end",
"def at(index)\n return nil if @head.nil? || index > self.size - 1\n current_node = @head\n (index).times do\n current_node = current_node.next\n end\n current_node.data\n end",
"def all\n result = []\n\n queue = []\n current_node = self.find_root\n queue << current_node\n\n until queue.empty?\n current_node = queue[0]\n result << current_node.val\n # use empty nodes to maintain two-childs for each node so it's easier to read the array output\n if current_node.val != \"E\"\n if current_node.left\n queue << current_node.left\n else\n # only insert an empty node when the other branch exists\n # prevents excessive empty nodes for external nodes\n queue << BSTNode.new(\"E\", parent = current_node) if current_node.right\n end\n if current_node.right\n queue << current_node.right\n else\n # only insert an empty node when the other branch exists\n # prevents excessive empty nodes for external nodes\n queue << BSTNode.new(\"E\", parent = current_node) if current_node.left\n end\n end\n queue.shift\n end\n\n result\n end",
"def each_child_with_index\n end",
"def place_nodes_into_pockets\n centroid_pockets = Array.new(@centroids.size) {[]}\n @centroids.each_with_index do |centroid, centroid_index|\n @nodes.each_with_index do |node, node_index|\n if node.closest_centroid == centroid\n centroid_pockets[centroid_index] << node_index\n #Store closest nodes in the centroid object\n centroid.nodes << node\n end\n end\n end\n @centroid_pockets = centroid_pockets\n end"
] | [
"0.6042243",
"0.602964",
"0.60155445",
"0.5871705",
"0.58069557",
"0.5804123",
"0.56935906",
"0.56935674",
"0.56849885",
"0.56557804",
"0.5644573",
"0.56325054",
"0.5613536",
"0.56030506",
"0.5582477",
"0.55813146",
"0.5580539",
"0.55789447",
"0.5574872",
"0.55604285",
"0.55579",
"0.5526673",
"0.55251586",
"0.54855967",
"0.5476566",
"0.5471758",
"0.54512703",
"0.5449397",
"0.5439739",
"0.5434677",
"0.54339385",
"0.5423638",
"0.54214454",
"0.54146147",
"0.54070145",
"0.54053116",
"0.54053116",
"0.53963625",
"0.53831786",
"0.5375905",
"0.5369768",
"0.53631085",
"0.5358428",
"0.53503805",
"0.534054",
"0.53240055",
"0.5299243",
"0.5296741",
"0.52929854",
"0.5288717",
"0.5278281",
"0.5271399",
"0.5270182",
"0.5245585",
"0.5228643",
"0.52116483",
"0.518567",
"0.5185395",
"0.5177888",
"0.51738876",
"0.5171618",
"0.51613927",
"0.516037",
"0.5153214",
"0.5153214",
"0.5141694",
"0.5127647",
"0.5126813",
"0.51267636",
"0.51217425",
"0.51144326",
"0.5094965",
"0.5092743",
"0.5083705",
"0.5081203",
"0.5061136",
"0.50594217",
"0.50557005",
"0.5052897",
"0.50410444",
"0.5039396",
"0.50371134",
"0.5036367",
"0.5024021",
"0.50203836",
"0.50171554",
"0.5017121",
"0.50121087",
"0.5010231",
"0.5009901",
"0.50085074",
"0.4996933",
"0.4994938",
"0.49919465",
"0.49914455",
"0.49889466",
"0.49886808",
"0.49879766",
"0.49847752",
"0.4982829",
"0.49713764"
] | 0.0 | -1 |
Helper macros to use internally | def output_internal_helper_macros
putd "/* -- INTERNAL HELPER MACROS -- */"
define_return_sequence_helper
define_custom_fake_sequence_helper
define_reset_fake_macro
define_declare_arg_helper
define_declare_all_func_common_helper
define_declare_return_value_history
define_save_arg_helper
define_room_for_more_history
define_save_ret_history_helper
define_save_arg_history_helper
define_history_dropped_helper
define_value_function_variables_helper
define_custom_fake_seq_variables_helper
define_increment_call_count_helper
define_return_fake_result_helper
define_extern_c_helper
define_reset_fake_helper
putd "/* -- END INTERNAL HELPER MACROS -- */"
puts
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def macro; end",
"def macro; end",
"def macro; raise NotImplementedError; end",
"def macro; raise NotImplementedError; end",
"def macro; raise NotImplementedError; end",
"def define_helpers; end",
"def define; end",
"def helpers; end",
"def helpers; end",
"def helpers; end",
"def formatPreprocessor(theLines)\n\n\talignEndifs(\t\ttheLines);\n\talignUndefineDefine(theLines);\n\talignDefineValue(\ttheLines);\n\talignContinuations(\ttheLines);\n\n\treturn theLines;\n\nend",
"def define_name_helpers; end",
"def execute\n\t\t\tres = instance_exec(@node, &Glyph::MACROS[@name]).to_s\n\t\t\tres.gsub(/\\\\*([\\[\\]\\|])/){\"\\\\#$1\"}# : res\n\t\tend",
"def expanded; end",
"def custom; end",
"def custom; end",
"def private; end",
"def expand\n\t\t\tblock = Glyph::MACROS[@name]\n\t\t\tmacro_error \"Undefined macro '#@name'\" unless block\n\t\t\tinstance_exec(@node, &block).to_s.gsub(/\\\\?([\\[\\]\\|])/){\"\\\\#$1\"}\n\t\tend",
"def constants() end",
"def find(macro_name); end",
"def macro hash\n hash.each do |key, value|\n value = value.latex!.to_latex_math\n define_latex_macro key, value\n define_symbol_macro key, value\n define_global_macro key, value\n end\nend",
"def define\n end",
"def define\n end",
"def transformed_argname=(_); end",
"def macros(env = default_environment)\n @macros ||= {}\n @macros[env] ||= {}\n end",
"def wrapped_in=(_arg0); end",
"def escaper=(_); end",
"def my955; end",
"def included_constants; end",
"def expanded_name; end",
"def __synchromesh_regulate_from_macro(opts, name, already_defined)\n if opts.key?(:regulate)\n yield name => opts[:regulate]\n elsif !already_defined\n yield name => ->(*_args) {}\n end\n end",
"def as_you_like_it_quote; end",
"def ITD07=(arg)",
"def transformed_argname; end",
"def ext=(_arg0); end",
"def ext=(_arg0); end",
"def ext=(_arg0); end",
"def PO108=(arg)",
"def PO106=(arg)",
"def helper_class=(_arg0); end",
"def PO104=(arg)",
"def wrapper; end",
"def prefix=(_arg0); end",
"def ITD03=(arg)",
"def code_point=(_); end",
"def _prefixes; end",
"def PO109=(arg)",
"def PO110=(arg)",
"def PO114=(arg)",
"def macro_expansion\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 77 )\n return_value = MacroExpansionReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n char_literal384 = nil\n __ID385__ = nil\n arguments386 = nil\n\n tree_for_char_literal384 = nil\n tree_for_ID385 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 780:5: '#' ID arguments\n char_literal384 = match( POUND, TOKENS_FOLLOWING_POUND_IN_macro_expansion_5511 )\n if @state.backtracking == 0\n\n tree_for_char_literal384 = @adaptor.create_with_payload( char_literal384 )\n root_0 = @adaptor.become_root( tree_for_char_literal384, root_0 )\n\n end\n __ID385__ = match( ID, TOKENS_FOLLOWING_ID_IN_macro_expansion_5514 )\n if @state.backtracking == 0\n\n tree_for_ID385 = @adaptor.create_with_payload( __ID385__ )\n @adaptor.add_child( root_0, tree_for_ID385 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_arguments_IN_macro_expansion_5516 )\n arguments386 = arguments\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, arguments386.tree )\n end\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 77 )\n\n end\n \n return return_value\n end",
"def ITD02=(arg)",
"def macro\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 68 )\n return_value = MacroReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n string_literal326 = nil\n variable_name327 = nil\n function_parameters328 = nil\n block329 = nil\n\n tree_for_string_literal326 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 705:5: 'macro' variable_name ( function_parameters )? block\n string_literal326 = match( MACRO, TOKENS_FOLLOWING_MACRO_IN_macro_4986 )\n if @state.backtracking == 0\n\n tree_for_string_literal326 = @adaptor.create_with_payload( string_literal326 )\n root_0 = @adaptor.become_root( tree_for_string_literal326, root_0 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_variable_name_IN_macro_4989 )\n variable_name327 = variable_name\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, variable_name327.tree )\n end\n # at line 705:28: ( function_parameters )?\n alt_80 = 2\n alt_80 = @dfa80.predict( @input )\n case alt_80\n when 1\n # at line 705:28: function_parameters\n @state.following.push( TOKENS_FOLLOWING_function_parameters_IN_macro_4991 )\n function_parameters328 = function_parameters\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, function_parameters328.tree )\n end\n\n end\n @state.following.push( TOKENS_FOLLOWING_block_IN_macro_4994 )\n block329 = block\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, block329.tree )\n end\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 68 )\n\n end\n \n return return_value\n end",
"def PO103=(arg)",
"def myletter\n \n end",
"def autofinish=(_arg0); end",
"def PRF04=(arg)",
"def define_kl_do\nend",
"def ITD04=(arg)",
"def parse_macro(d)\n if d[:body] =~ /define\\s+#{Regexp.quote(d[:name])}\\([^\\)]*\\)[ \\t]*(.*)/m\n d[:value] = join_define($1)\n end\n d[:comments] = d[:rawComments].strip\n end",
"def macro!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 48 )\n\n type = MACRO\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 169:9: 'macro'\n match( \"macro\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 48 )\n\n end",
"def alignDefineValue(theLines)\n\n\tsplitAndAlign(theLines, [/^(\\s*#define \\w+)\\s+(.*?)$/,\n\t\t\t\t\t\t\t /^(\\s*#define \\w+\\(.*?\\))\\s+(.*?)$/], \"\");\n\nend",
"def PO105=(arg)",
"def process_macro_call( call_exp )\n parameters = []\n body = nil\n macro_name = nil\n \n case call_exp.type.name\n when \"reference_exp\"\n macro_name = call_exp.name.text # NB: the label is being handled elsewhere!\n when \"macro_call\"\n macro_name = call_exp.macro_name.text\n parameters = call_exp.parameters \n body = call_exp.body if call_exp.slot_filled?(\"body\")\n else\n bug( \"why are you passing me a [#{call_exp.type}]?\" )\n end\n \n \n nyi( \"error handling for undefined macro call [#{macro_name}]\" ) unless @specifications.member?(macro_name) \n nyi( \"error handling for bad macro call [#{macro_name}]\" ) unless @specifications[macro_name].type == \"macro_spec\"\n macro_spec = @specifications[macro_name]\n \n #\n # Validate the parameter counts and then assign them to slots.\n \n if parameters.length != macro_spec.parameter_definitions.length then\n nyi( \"error handling for macro call parameter count mismatch (found #{parameters.length}; expected #{macro_spec.parameter_definitions.length})\" )\n end\n \n parameter_lookup = {}\n parameters.length.times do |i|\n parameter_lookup[macro_spec.parameter_definitions[i].text] = parameters[i]\n end\n \n #\n # Process the macro body by creating a copy with all variable and transclusion\n # nodes replaced appropriately.\n \n return macro_spec.expression.duplicate do |node|\n case node.type.name\n when \"transclusion\"\n nyi( \"error handling for missing macro_call body\" ) if body.nil?\n body\n \n when \"variable_exp\"\n nyi( \"error handling for non-existent macro parameter definition [#{node.name.text}] in [#{parameter_lookup.keys.join(\", \")}]\" ) unless parameter_lookup.member?(node.name.text)\n if node.label.nil? then\n parameter_lookup[node.name.text]\n else\n Grammar.group_exp( parameter_lookup[node.name.text], node.label )\n end\n \n else\n node\n end\n end\n end",
"def apply_macro(macro, docstring, call_params = T.unsafe(nil), full_source = T.unsafe(nil), block_source = T.unsafe(nil)); end",
"def text_macro hash\n hash.each do |key, value|\n value = \"\\\\text{#{value}}\".latex!\n define_latex_macro key, value\n define_symbol_macro key, value\n define_global_macro key, value\n end\nend",
"def initialize_macro_command\n raise NotImplementedError\n end",
"def execute\n\t\t\tinstance_exec(@node, &Glyph::MACROS[@name]).to_s\n\t\tend",
"def macro(spec)\n @c.macro(*spec.split('='))\n end",
"def third_party_processors; end",
"def defined_in; end",
"def PO113=(arg)",
"def define_format_helpers global_formats, strict_formats\n (all_formats = (global_formats + strict_formats.map {|s| s.last}.flatten).uniq)\n (all_formats = Hash[all_formats.zip(all_formats)]).each_key do |f|\n method_name = '%s?' % f.sub('.', '')\n define_method method_name do\n # Hash searching is a lot faster than String comparison\n all_formats[format]\n end\n private method_name\n end\n end",
"def PO107=(arg)",
"def __(value=\"Replace __ With Correct Value\", value19=:mu)\n if RUBY_VERSION < \"1.9\"\n value\n else\n (value19 == :mu) ? value : value19\n end\nend",
"def standalone=(_arg0); end",
"def _reduce_585(val, _values, result)\n identifier = val[1].to_sym\n\n self.env[identifier] = :lvar\n result = \"&#{identifier}\".to_sym\n \n result\nend",
"def _reduce_585(val, _values, result)\n identifier = val[1].to_sym\n\n self.env[identifier] = :lvar\n result = \"&#{identifier}\".to_sym\n \n result\nend",
"def CTT04=(arg)",
"def spec=(_arg0); end",
"def autofinish; end",
"def ITD06=(arg)",
"def macro\n :references_one\n end",
"def parse_macro( data )\n cmd, macros = data[0].chr, data[1..-1].split(\"\\0\" )\n return [cmd, Hash[*macros]]\n end",
"def transforming_body_expr=(_); end",
"def defs; end",
"def defs; end",
"def preproc=(_arg0); end",
"def PRF02=(arg)",
"def common\n \n end",
"def _reduce_582(val, _values, result)\n identifier = val[1].to_sym\n\n self.env[identifier] = :lvar\n result = \"&#{identifier}\".to_sym\n \n result\nend",
"def _reduce_582(val, _values, result)\n identifier = val[1].to_sym\n\n self.env[identifier] = :lvar\n result = \"&#{identifier}\".to_sym\n \n result\nend",
"def _reduce_582(val, _values, result)\n identifier = val[1].to_sym\n\n self.env[identifier] = :lvar\n result = \"&#{identifier}\".to_sym\n \n result\nend",
"def PO115=(arg)",
"def SE02=(arg)",
"def reserved_words=(_arg0); end",
"def whiny=(_arg0); end",
"def internal; end",
"def %(arg0)\n end",
"def %(arg0)\n end",
"def define_helper(scope, method, *args, **kwargs, &block); end"
] | [
"0.7449284",
"0.7449284",
"0.6381346",
"0.6381346",
"0.6381346",
"0.6027485",
"0.59765637",
"0.58085996",
"0.58085996",
"0.58085996",
"0.5782527",
"0.57596916",
"0.5733918",
"0.5702125",
"0.56943065",
"0.56943065",
"0.5671849",
"0.5612358",
"0.55247223",
"0.55237025",
"0.5497954",
"0.54865456",
"0.54865456",
"0.5478934",
"0.546954",
"0.5464449",
"0.54413277",
"0.54291695",
"0.5404982",
"0.5376346",
"0.53696156",
"0.53657633",
"0.53539795",
"0.530593",
"0.529969",
"0.529969",
"0.529969",
"0.5291645",
"0.5290258",
"0.52838516",
"0.5280969",
"0.5274632",
"0.5270287",
"0.52505034",
"0.52427757",
"0.5239643",
"0.5237797",
"0.5237417",
"0.52302164",
"0.5228784",
"0.52267677",
"0.52123797",
"0.52096593",
"0.52057916",
"0.52022636",
"0.5196622",
"0.51930153",
"0.5185546",
"0.5181994",
"0.5177707",
"0.516408",
"0.51562405",
"0.5156119",
"0.51498955",
"0.5141087",
"0.51406646",
"0.5138539",
"0.51371586",
"0.5137153",
"0.5135162",
"0.5130175",
"0.5127647",
"0.512628",
"0.5123999",
"0.51166207",
"0.51138276",
"0.51138276",
"0.510998",
"0.51077944",
"0.5101133",
"0.5095607",
"0.5087634",
"0.5083737",
"0.50828046",
"0.5082465",
"0.5082465",
"0.5080302",
"0.5077912",
"0.50756454",
"0.5072106",
"0.5072106",
"0.5072106",
"0.506916",
"0.5066944",
"0.50663805",
"0.5058634",
"0.50580853",
"0.50547093",
"0.50547093",
"0.50532806"
] | 0.6378281 | 5 |
multiline putd which adds a \ at the end of the generated macro | def putd_backslash str
putd(str + " \\")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def putc(*line)\n raise unless @state == :asm\n @outp.puts(formatDump(\" \" + line.join(''), lastComment))\n end",
"def join_define(text)\n text = text.split(\"\\n\\n\", 2).first || \"\"\n\n # Ruby 1.8 does not support negative lookbehind regex so let's\n # get the joined macro definition a slightly more awkward way\n text.split(/\\s*\\n\\s*/).inject(\"\\\\\") do |val, line|\n (val[-1] == ?\\\\) ? val = val.chop.strip + \" \" + line : val\n end.strip.gsub(/^\\s*\\\\*\\s*/, '')\n end",
"def put_a_line\n puts \"\\n\"\n puts \"/\\\\\" * 40\n puts \"\\n\"\n end",
"def lineBreak \n \"lineBreak\" \n end",
"def generate_separators()\n command = \"echo '================================================================================'\"\n return command + \"\\n\"\nend",
"def m (x)\nputs \"This is multi-line string. It's line1 \\\n It's line 2\\\n And this is\\n line3\n This line should not be mutated\"\nputs \"This is multi line interpolated string #{\nx\n}\"\nend",
"def section_seperator\n puts <<EOF\n\n\n\n=========================\n=========================\nEOF\nend",
"def m (x)\n\tputs \"This is multi-line string. It's line1 \\\n It's line 2\\\n And this is\\n line3\n This line should not be mutated\"\n\tputs \"This is multi line interpolated string #{\n\t\tx\n\t}\"\nend",
"def escape\n puts \"\"\n puts \" \" + \"_\" * 40\n puts \"\"\n end",
"def f_slash_comment\n emit_comment(parse(\"\\n\"))\nend",
"def add_linebreaks(definition)\n definition.gsub(\"\\r\", '<br>')\nend",
"def execute\n\t\t\tres = instance_exec(@node, &Glyph::MACROS[@name]).to_s\n\t\t\tres.gsub(/\\\\*([\\[\\]\\|])/){\"\\\\#$1\"}# : res\n\t\tend",
"def parse_macro(d)\n if d[:body] =~ /define\\s+#{Regexp.quote(d[:name])}\\([^\\)]*\\)[ \\t]*(.*)/m\n d[:value] = join_define($1)\n end\n d[:comments] = d[:rawComments].strip\n end",
"def macro; end",
"def macro; end",
"def sub_line_ending_backslashes(file_text)\n backslash_replacement = '# TAILOR REMOVED BACKSLASH'\n file_text.gsub!(/\\\\\\s*\\n?$/, backslash_replacement)\n\n file_text\n end",
"def formatPreprocessor(theLines)\n\n\talignEndifs(\t\ttheLines);\n\talignUndefineDefine(theLines);\n\talignDefineValue(\ttheLines);\n\talignContinuations(\ttheLines);\n\n\treturn theLines;\n\nend",
"def fancy_newline\n @results += '|'\n newline\n end",
"def change_quotemarks!\n local_copy.in_place :perl, \"s/\\\"/'/g\"\n end",
"def render_spacer\n puts \"\\n\"\n end",
"def reduce_backslash(_production, _range, _tokens, _children)\n # Double the backslash (because of escaping)\n string_literal('\\\\', true)\n end",
"def line_break\n append '(?:\\n|(?:\\r\\n))'\n end",
"def reduce_new_line(_production, _range, _tokens, _children)\n # TODO: control portability\n Regex::Character.new('\\n')\n end",
"def add_end()\n @asm_file << \"(END)\\n@END\\n0;JMP\\n\" \n end",
"def do__raw token\r\n if token.line and token.line.size > 0\r\n token.line.chomp + \"\\n\"\r\n else\r\n \"\\n\"\r\n end\r\n end",
"def rewrite_newline(exp)\n # New lines look like:\n # s(:newline, 21, \"test/sample.rb\", s(:call, nil, :private, s(:arglist)) )\n sexp = exp[3]\n rewrite(sexp)\n end",
"def multiline_arg; end",
"def clear_extra_newline_after_comments\n newlined_comments = @literals_and_comments_types.select { |k,| new_line_ending_comment?(k) }\n return if newlined_comments.empty?\n\n parametrized_sql.gsub!(/(#{newlined_comments.keys.join(\"}\\n|\")}}\\n)/, &:chop)\n end",
"def break_to_newline\n end",
"def handle_regexp_HARD_BREAK target\n \" \\n\"\n end",
"def line_feed\n write_raw \"\\n\"\n end",
"def expand\n\t\t\tblock = Glyph::MACROS[@name]\n\t\t\tmacro_error \"Undefined macro '#@name'\" unless block\n\t\t\tinstance_exec(@node, &block).to_s.gsub(/\\\\?([\\[\\]\\|])/){\"\\\\#$1\"}\n\t\tend",
"def lex_en_interp_backslash_delimited; end",
"def lex_en_interp_backslash_delimited; end",
"def lex_en_interp_backslash_delimited; end",
"def break_to_newline\n end",
"def enclose(*) end",
"def csv_multi_replacements\n [\n [/\\n\\n/ , \"\\n\"]\n ]\n end",
"def handle_regexp_HARD_BREAK target\n \"\\n\"\n end",
"def reduce_carriage_return(_production, _range, _tokens, _children)\n Regex::Character.new('\\r')\n end",
"def indent_atom; \" \"; end",
"def output_macro_name(macro_name, arg_count, has_varargs, has_calling_conventions, return_type)\n putd \"#define \" + macro_signature_for(macro_name, arg_count, has_varargs, has_calling_conventions, return_type)\nend",
"def alignDefineValue(theLines)\n\n\tsplitAndAlign(theLines, [/^(\\s*#define \\w+)\\s+(.*?)$/,\n\t\t\t\t\t\t\t /^(\\s*#define \\w+\\(.*?\\))\\s+(.*?)$/], \"\");\n\nend",
"def build_verbatim margin\n verbatim = super\n\n verbatim.format = :ruby if @section == 'Examples'\n\n verbatim\n end",
"def spacer\n puts \"\\n----------------------------\\n\"\nend",
"def lex_en_plain_backslash_delimited; end",
"def lex_en_plain_backslash_delimited; end",
"def lex_en_plain_backslash_delimited; end",
"def nl(*arg)\n arg[0].is_a?(Symbol) ? nl(tag(*arg)) : \" \\n #{arg[0]}\"\n end",
"def print_separator_line\nline = \"\"\n3.times do\n3.times { line << SEPARATOR[:horizontal] }\nline << SEPARATOR[:cross]\nend\nputs line[0...line.length - 1]\nprint \"\\t\"\nend",
"def lex_en_plain_backslash_delimited=(_arg0); end",
"def lex_en_plain_backslash_delimited=(_arg0); end",
"def lex_en_plain_backslash_delimited=(_arg0); end",
"def multiLineComment(comment, header = \"\")\r\n bar = \"\"\r\n hdrBar = \"\"\r\n\r\n # 3: 3 misc chars (/* )\r\n width = (@maxWidth - 3)\r\n\r\n width.times do\r\n bar += \"*\"\r\n end\r\n\r\n if (header.length > 0) # Generate a formatted header if it exists.\r\n hdrWidth = (@maxWidth - 6 - header.length) / 2\r\n\r\n hdrWidth.times do\r\n hdrBar += \" \"\r\n end # times\r\n end # if header\r\n\r\n output = <<EOF\r\n\r\n\r\n\r\n\r\n/* #{bar}\r\n#{hdrBar}-- #{header} --#{hdrBar}\r\n\r\n#{comment}\r\n\r\n#{bar} */\r\n\r\n\r\n\r\n\r\nEOF\r\n\r\n output\r\n\r\n end",
"def auto_close\n if @tg_end.size>1\n sz = @tg_end[-1][/^ +/].to_s.size\n if @spc.size <= sz\n ed = multi_end(nil).rstrip\n p \"AutE:#{ed}#{@row}\" if @dbg[:parse]\n @doc_out += [ed,(@doc_out[-1].to_s[-1,1]==\"\\n\" ? '' : \"\\n\"),@row]\n @row = ''\n true\n end\n end\n end",
"def line_sep(title=nil); print \"\\n#{title} ----\\n\\n\"; end",
"def line_sep(title=nil); print \"\\n#{title} ----\\n\\n\"; end",
"def append_block_breaks(out)\n out.sub!(TRAILING_WHITESPACE, EMPTY)\n out << NEWLINE unless out.end_with?(NEWLINE)\n end",
"def close_loud(command, add_newline, push_end = true)\n push_silent('end', true) if push_end\n @precompiled << command\n @template_tabs -= 1\n concat_merged_text(\"\\n\") if add_newline\n end",
"def surround\r\n puts '{'\r\n yield\r\n puts '}'\r\nend",
"def finish\n \"\\s?(,|})\"\n end",
"def separator\n puts \" \"\n puts pastel.bright_magenta(\"======================================================\")\n puts \" \"\n end",
"def separator\n puts \" \"\n puts pastel.bright_magenta(\"======================================================\")\n puts \" \"\n end",
"def separator\n puts \" \"\n puts pastel.bright_magenta(\"======================================================\")\n puts \" \"\n end",
"def surround\n\tputs \"{\"\n\tyield\n\tputs \"}\"\nend",
"def footer article\r\n\t\t\"}\\n}\"\r\n\tend",
"def esc\r\n \"\\\"#{self}\\\"\"\r\n end",
"def add_comment comment\n \"\\n###### #{comment} ######\\n\" \n end",
"def comment_block( *lines )\n self.blank_line\n self << %[#]\n self.indent( \"# \" ) do\n lines.each do |line|\n self << line unless line.nil?\n end\n\n yield( self ) if block_given?\n end\n self.blank_line\n end",
"def wrap(line, cols=80, tabsize=2)\n line = line.gsub(/\\t/, \" \" * tabsize) unless tabsize == nil\n line.gsub(/(.{1,#{cols}})( +|$\\r?\\n?)|(.{1,#{cols}})/, \"\\\\1\\\\3\\n\").split(/\\s*?\\n/)\n end",
"def new_line\n puts \"\\n\"\nend",
"def new_line\n puts \"\\n\"\nend",
"def emit_break(indent)\n\n # number of newlines to emit\n break_value = block_break_value\n\n add_to_doc(\"\\n\" * break_value)\n # add indent if there *was* a break\n add_to_doc(\" \" * indent) if indent >0 && break_value > 0\n end",
"def surround\n puts '{'\n yield\n puts '}'\nend",
"def code_with_trailing_space\n code.chomp+\" \"\n end",
"def backslash!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 15 )\n\n type = BACKSLASH\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 149:4: '\\\\\\\\'\n match( 0x5c )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 15 )\n\n end",
"def wrapped\n @lines.join(\"\\n\")\n end",
"def newline; end",
"def write_html(indent,part)\n# \"<!-- #{indent} --> #{' '*(if indent<0 then 0 else indent end)}#{part}\\n\"\n \"#{' '*(if indent<0 then 0 else indent end)}#{part}\\n\"\n end",
"def imitate_code(txt)\n \"%#{txt};;\"\n end",
"def to_s # {{{\n c = wrap( self.content.to_s.chomp )\n t = wrap( self.title.to_s.chomp )\n\n<<EOS\n|^\\___________________ [ #{self.source.to_s } ] _________________________________/^|\n\n\\t'#{t}'\n\n\\t#{c}\n\n|/^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\|\n\nEOS\n end",
"def hamlet_quote; end",
"def line\n\t\tl = @name\n\t\t(1..25).each do |i|\n\t\t\tl += \" &\"\n\t\t\tif i <= @number then\n\t\t\t\tl += \" \\\\!$\\\\times$\"\n\t\t\tend\n\t\tend\n\t\tl += \" \\\\\\\\\\n\"\n\t\treturn l\n\tend",
"def lex_en_interp_backslash_delimited=(_arg0); end",
"def lex_en_interp_backslash_delimited=(_arg0); end",
"def lex_en_interp_backslash_delimited=(_arg0); end",
"def munge_md text\n text.gsub(/<!(--)?(\\/?BOX)(--)?>/, \"===\\\\2===\\n\")\n end",
"def generate_end(format)\n case format\n when 'php'\n '];'\n else\n ''\n end\n end",
"def append_space\n return if @sb_last_was_whitespace\n\n @sb_last_was_whitespace = true\n\n @text_buffer << ' '\n @token_buffer << ' '\n end",
"def add_text(src, text)\n return if text.empty?\n\n if text == \"\\n\"\n @newline_pending += 1\n else\n src << \"_erbout.safe_append='\"\n src << \"\\n\" * @newline_pending if @newline_pending > 0\n src << escape_text(text)\n src << \"';\"\n\n @newline_pending = 0\n end\n end",
"def escape(line)\n s = line.sub(/\\s+$/, '').\n gsub(/\\\\/, \"\\\\bs\\?C-q\").\n gsub(/([_\\${}&%#])/, '\\\\\\\\\\1').\n gsub(/\\?C-q/, \"{}\").\n gsub(/\\^/, \"\\\\up{}\").\n gsub(/~/, \"\\\\sd{}\").\n gsub(/\\*/, \"$*$\").\n gsub(/<</, \"<{}<\").\n gsub(/>>/, \">{}>\").\n gsub(/\\[\\]/, \"$[\\\\,]$\").\n gsub(/,,/, \",{},\").\n gsub(/`/, \"\\\\bq{}\")\n s\nend",
"def test_two_slashes\n\texpect_error(\"\\n\\n\\n</x/>\", # on two lines due to rubymode.el\n\t\t /slash appears at both beginning and end/, 4)\n end",
"def rewrite before, after, reg = /\\#\\{(\\w+)\\}/, reg2 = '\\1'\n File.open(after, 'w') do |a|\n File.open(before) do |b|\n b.each do |line|\n a << line.gsub(reg) do\n if reg2.include? '\\1'\n reg2.gsub(%r!\\\\1!, Object.const_get($1))\n else\n reg2\n end\n end\n end\n end\n end\n end",
"def rewrite before, after, reg = /\\#\\{(\\w+)\\}/, reg2 = '\\1'\n File.open(after, 'w') do |a|\n File.open(before) do |b|\n b.each do |line|\n a << line.gsub(reg) do\n if reg2.include? '\\1'\n reg2.gsub(%r!\\\\1!, Object.const_get($1))\n else\n reg2\n end\n end\n end\n end\n end\n end",
"def rewrite before, after, reg = /\\#\\{(\\w+)\\}/, reg2 = '\\1'\n File.open(after, 'w') do |a|\n File.open(before) do |b|\n b.each do |line|\n a << line.gsub(reg) do\n if reg2.include? '\\1'\n reg2.gsub(%r!\\\\1!, Object.const_get($1))\n else\n reg2\n end\n end\n end\n end\n end\n end",
"def rewrite before, after, reg = /\\#\\{(\\w+)\\}/, reg2 = '\\1'\n File.open(after, 'w') do |a|\n File.open(before) do |b|\n b.each do |line|\n a << line.gsub(reg) do\n if reg2.include? '\\1'\n reg2.gsub(%r!\\\\1!, Object.const_get($1))\n else\n reg2\n end\n end\n end\n end\n end\n end",
"def rewrite before, after, reg = /\\#\\{(\\w+)\\}/, reg2 = '\\1'\n File.open(after, 'w') do |a|\n File.open(before) do |b|\n b.each do |line|\n a << line.gsub(reg) do\n if reg2.include? '\\1'\n reg2.gsub(%r!\\\\1!, Object.const_get($1))\n else\n reg2\n end\n end\n end\n end\n end\n end",
"def sequence_separator; end",
"def alignEndifs(theLines)\n\n\t# Collapse whitespace after #endif\n\t#\n\t# clang-format inserts IndentWidth spaces between a #endif\n\t# and its comment.\n\ttheLines.each do |theLine|\n\n\t\tif (theLine[:text] =~ /^(#endif\\s)\\s+/ && !theLine[:comment].empty?)\n\t\t\ttheLine[:text] = $1;\n\t\tend\n\n\tend\n\nend",
"def linebreak(amount=1)\n $stdout.print \"\\n\" * amount\n end"
] | [
"0.6350613",
"0.6183881",
"0.5949563",
"0.5913823",
"0.5894897",
"0.5766995",
"0.5741963",
"0.5734899",
"0.5700001",
"0.56970716",
"0.5639991",
"0.5623113",
"0.5552626",
"0.55322295",
"0.55322295",
"0.55085677",
"0.5505156",
"0.55037475",
"0.54967415",
"0.547591",
"0.54742944",
"0.54634315",
"0.545224",
"0.54350597",
"0.5424465",
"0.5406889",
"0.540108",
"0.538493",
"0.538066",
"0.53640246",
"0.53208137",
"0.5291283",
"0.528603",
"0.528603",
"0.528603",
"0.5271433",
"0.5255847",
"0.52522594",
"0.52438754",
"0.5238508",
"0.52306664",
"0.5224099",
"0.52128047",
"0.5211378",
"0.5210176",
"0.5182835",
"0.5182835",
"0.5182835",
"0.5181457",
"0.5173777",
"0.51722157",
"0.51722157",
"0.51722157",
"0.51623344",
"0.51486033",
"0.5139302",
"0.5139302",
"0.5133153",
"0.5123877",
"0.51193637",
"0.5116322",
"0.5112381",
"0.5112381",
"0.5112381",
"0.51061124",
"0.5099053",
"0.5097443",
"0.5083725",
"0.5057703",
"0.5041935",
"0.5039812",
"0.5039812",
"0.5038197",
"0.50360423",
"0.5032313",
"0.5030449",
"0.50279295",
"0.5025609",
"0.5022971",
"0.50064325",
"0.50054544",
"0.49853954",
"0.49850872",
"0.49840945",
"0.49840945",
"0.49840945",
"0.49836028",
"0.49676555",
"0.49603364",
"0.49590048",
"0.493912",
"0.49357533",
"0.4935622",
"0.4935622",
"0.4935622",
"0.4935622",
"0.4935622",
"0.49344105",
"0.49296218",
"0.49224865"
] | 0.58864075 | 5 |
define macro_name(RETURN_TYPE, FUNCNAME, ARG0,...) | def output_macro_name(macro_name, arg_count, has_varargs, has_calling_conventions, return_type)
putd "#define " + macro_signature_for(macro_name, arg_count, has_varargs, has_calling_conventions, return_type)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def macro_signature_for(macro_name, arg_count, has_varargs, has_calling_conventions, return_type)\n parameter_list = \"#{macro_name}(\"\n if return_type != \"\"\n parameter_list += return_type\n parameter_list += \", \"\n end\n parameter_list += \"CALLING_CONVENTION, \" if (has_calling_conventions)\n parameter_list += \"FUNCNAME\"\n\n arg_count.times { |i| parameter_list += \", ARG#{i}_TYPE\" }\n\n parameter_list += \", ...\" if has_varargs\n\n parameter_list += \") \\\\\"\n\n parameter_list\nend",
"def %(arg0)\n end",
"def %(arg0)\n end",
"def macro; end",
"def macro; end",
"def signature=(_arg0); end",
"def signature=(_arg0); end",
"def signature=(_arg0); end",
"def signature=(_arg0); end",
"def returns=(_arg0); end",
"def method_name=(_arg0); end",
"def method_name=(_arg0); end",
"def macro\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 68 )\n return_value = MacroReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n string_literal326 = nil\n variable_name327 = nil\n function_parameters328 = nil\n block329 = nil\n\n tree_for_string_literal326 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 705:5: 'macro' variable_name ( function_parameters )? block\n string_literal326 = match( MACRO, TOKENS_FOLLOWING_MACRO_IN_macro_4986 )\n if @state.backtracking == 0\n\n tree_for_string_literal326 = @adaptor.create_with_payload( string_literal326 )\n root_0 = @adaptor.become_root( tree_for_string_literal326, root_0 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_variable_name_IN_macro_4989 )\n variable_name327 = variable_name\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, variable_name327.tree )\n end\n # at line 705:28: ( function_parameters )?\n alt_80 = 2\n alt_80 = @dfa80.predict( @input )\n case alt_80\n when 1\n # at line 705:28: function_parameters\n @state.following.push( TOKENS_FOLLOWING_function_parameters_IN_macro_4991 )\n function_parameters328 = function_parameters\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, function_parameters328.tree )\n end\n\n end\n @state.following.push( TOKENS_FOLLOWING_block_IN_macro_4994 )\n block329 = block\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, block329.tree )\n end\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 68 )\n\n end\n \n return return_value\n end",
"def return_value=(_arg0); end",
"def function_define(name=\"\",&block)\n \"function #{name}() { #{block.call} }\" \n end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def transformed_argname; end",
"def funcname\n NAMES[@name][1]\n end",
"def output_custom_function_signature(arg_count, has_varargs, has_calling_conventions, is_value_function)\n return_type = is_value_function ? \"RETURN_TYPE\" : \"void\"\n ap_list = has_varargs ? \", va_list ap\" : \"\"\n calling_conv = has_calling_conventions ? \", CALLING_CONVENTION\" : \"\"\n putd_backslash \"CUSTOM_FFF_FUNCTION_TEMPLATE(#{return_type}#{calling_conv}, custom_fake, #{arg_type_list(arg_count)}#{ap_list});\"\nend",
"def process_macro_call( call_exp )\n parameters = []\n body = nil\n macro_name = nil\n \n case call_exp.type.name\n when \"reference_exp\"\n macro_name = call_exp.name.text # NB: the label is being handled elsewhere!\n when \"macro_call\"\n macro_name = call_exp.macro_name.text\n parameters = call_exp.parameters \n body = call_exp.body if call_exp.slot_filled?(\"body\")\n else\n bug( \"why are you passing me a [#{call_exp.type}]?\" )\n end\n \n \n nyi( \"error handling for undefined macro call [#{macro_name}]\" ) unless @specifications.member?(macro_name) \n nyi( \"error handling for bad macro call [#{macro_name}]\" ) unless @specifications[macro_name].type == \"macro_spec\"\n macro_spec = @specifications[macro_name]\n \n #\n # Validate the parameter counts and then assign them to slots.\n \n if parameters.length != macro_spec.parameter_definitions.length then\n nyi( \"error handling for macro call parameter count mismatch (found #{parameters.length}; expected #{macro_spec.parameter_definitions.length})\" )\n end\n \n parameter_lookup = {}\n parameters.length.times do |i|\n parameter_lookup[macro_spec.parameter_definitions[i].text] = parameters[i]\n end\n \n #\n # Process the macro body by creating a copy with all variable and transclusion\n # nodes replaced appropriately.\n \n return macro_spec.expression.duplicate do |node|\n case node.type.name\n when \"transclusion\"\n nyi( \"error handling for missing macro_call body\" ) if body.nil?\n body\n \n when \"variable_exp\"\n nyi( \"error handling for non-existent macro parameter definition [#{node.name.text}] in [#{parameter_lookup.keys.join(\", \")}]\" ) unless parameter_lookup.member?(node.name.text)\n if node.label.nil? then\n parameter_lookup[node.name.text]\n else\n Grammar.group_exp( parameter_lookup[node.name.text], node.label )\n end\n \n else\n node\n end\n end\n end",
"def function_signature(arg_count, has_varargs, has_calling_conventions, is_value_function)\n return_type = is_value_function ? \"RETURN_TYPE\" : \"void\"\n varargs = has_varargs ? \", ...\" : \"\"\n calling_conventions = has_calling_conventions ?\n \"#{return_type} FFF_GCC_FUNCTION_ATTRIBUTES CALLING_CONVENTION FUNCNAME(#{arg_val_list(arg_count)}#{varargs})\" :\n \"#{return_type} FFF_GCC_FUNCTION_ATTRIBUTES FUNCNAME(#{arg_val_list(arg_count)}#{varargs})\"\nend",
"def split_function_name(line)\n /(\\s*def\\s*)(\\S[^\\(]*)(\\(.*)/.match(line)\nend",
"def signature(*args); end",
"def transformed_argname=(_); end",
"def macro\n macro_name = shift_argument\n unless macro_name\n error(\"Usage: mortar generate:macro MACRONAME\\nMust specify MACRONAME.\")\n end\n \n macro_generator = Mortar::Generators::MacroGenerator.new\n macro_generator.generate_macro(macro_name, project, options)\n end",
"def apply_macro(macro, docstring, call_params = T.unsafe(nil), full_source = T.unsafe(nil), block_source = T.unsafe(nil)); end",
"def matcher_name=(_arg0); end",
"def __synchromesh_regulate_from_macro(opts, name, already_defined)\n if opts.key?(:regulate)\n yield name => opts[:regulate]\n elsif !already_defined\n yield name => ->(*_args) {}\n end\n end",
"def macro!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 48 )\n\n type = MACRO\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 169:9: 'macro'\n match( \"macro\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 48 )\n\n end",
"def name _args\n \"name _args;\" \n end",
"def parse_macro( data )\n cmd, macros = data[0].chr, data[1..-1].split(\"\\0\" )\n return [cmd, Hash[*macros]]\n end",
"def gensym(var_name = \"\")\n Macro.new.gensym(var_name)\nend",
"def create(macro_name, data, method_object = T.unsafe(nil)); end",
"def create_docstring(macro_name, data, method_object = T.unsafe(nil)); end",
"def /(arg0)\n end",
"def /(arg0)\n end",
"def *(arg0)\n end",
"def *(arg0)\n end",
"def fstype=(_arg0); end",
"def map_name=(_arg0); end",
"def template_name=(_arg0); end",
"def template_name=(_arg0); end",
"def %(*args); end",
"def %(*args); end",
"def macro_array_for(name)\n\t\t\treturn @macros_by_def[name.to_sym] if @macros_by_def[name.to_sym]\n\t\t\tkey = @macros_by_def.keys.select{|k| macro_eq?(k, name.to_sym) }[0] || name.to_sym\n\t\t\t@macros_by_def[key] = [] unless @macros_by_def[key]\n\t\t\t@macros_by_def[key]\n\t\tend",
"def method_signature\n case @opcode.arguments.size\n when 0\n @file.puts \" def #{method_name}\"\n when 1\n @file.puts \" def #{method_name}(arg1)\"\n when 2\n @file.puts \" def #{method_name}(arg1, arg2)\"\n end\n end",
"def macro(spec)\n @c.macro(*spec.split('='))\n end",
"def macro_expansion\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 77 )\n return_value = MacroExpansionReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n char_literal384 = nil\n __ID385__ = nil\n arguments386 = nil\n\n tree_for_char_literal384 = nil\n tree_for_ID385 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 780:5: '#' ID arguments\n char_literal384 = match( POUND, TOKENS_FOLLOWING_POUND_IN_macro_expansion_5511 )\n if @state.backtracking == 0\n\n tree_for_char_literal384 = @adaptor.create_with_payload( char_literal384 )\n root_0 = @adaptor.become_root( tree_for_char_literal384, root_0 )\n\n end\n __ID385__ = match( ID, TOKENS_FOLLOWING_ID_IN_macro_expansion_5514 )\n if @state.backtracking == 0\n\n tree_for_ID385 = @adaptor.create_with_payload( __ID385__ )\n @adaptor.add_child( root_0, tree_for_ID385 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_arguments_IN_macro_expansion_5516 )\n arguments386 = arguments\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, arguments386.tree )\n end\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 77 )\n\n end\n \n return return_value\n end",
"def type=(_arg0); end",
"def type=(_arg0); end",
"def type=(_arg0); end",
"def type=(_arg0); end",
"def type=(_arg0); end",
"def type=(_arg0); end",
"def type=(_arg0); end",
"def type=(_arg0); end",
"def type=(_arg0); end",
"def type=(_arg0); end",
"def type=(_arg0); end",
"def type=(_arg0); end",
"def type=(_arg0); end",
"def my_name() # Start of a function declaration\n return(\"Zoo Lander\") # Explicit return with parenthesis\nend",
"def register_macro(name, &block)\n @macros.store(name, block)\n end",
"def lex_macro name, value\n macros << [name, value]\n end",
"def human_name=(_arg0); end",
"def human_name=(_arg0); end",
"def function_header\n if token_is_not? :def\n return nil\n end\n require :def\n method_name = require :id\n require :open_parentheses\n argument_list = argument_list()\n require :close_parentheses\n { method_name: method_name.content, argument_list: argument_list }\n end",
"def parse_macros(*args)\n args.each_with_object([]) do |spec, macros|\n case spec\n when Hash\n add_macro_from_hash(macros, spec)\n else\n macros << Array(spec)\n end\n end\n end",
"def args=(_arg0); end",
"def args=(_arg0); end",
"def args=(_arg0); end",
"def args=(_arg0); end",
"def args=(_arg0); end",
"def name(*) end",
"def name(*) end",
"def command_name=(_arg0); end",
"def gen_stub_method(klassname, name, options)\n raise \"Stub method with body is invalid!\" if options[:body]\n\n args = options[:arguments].dup\n unless args_convertable?(args)\n raise \"ERROR: Cannot convert stub method #{klassname}::#{name}\"\n end\n\n returns = args.delete(:returns) || \"void\"\n\n out = \"\"\n out << \"{\\n\"\n out << \"VALUE __res__ = \" if returns != 'void'\n\n # TODO: move rb_intern out\n call_args = [\"@__obj__\", %{rb_intern(\"#{name}\")}, args.size] + \n args.map {|n, k| @model.typing.convert(k, n, :c2ruby) }\n\n out << %{rb_funcall(#{call_args.join(', ')});}\n\n # check return type\n if returns != 'void' \n out << @model.typing.convert(returns, '__res__', :ruby2c_checktype)\n retval = @model.typing.convert(returns, '__res__', :ruby2c) \n out << \"return #{retval};\\n\"\n end\n\n out << \"}\\n\"\n\n return out\n end",
"def function\n function = '\\w+\\(\\)'\n end",
"def print_name(arg1)\n puts \"#{arg1}\"\nend",
"def called_from=(_arg0); end",
"def called_from=(_arg0); end",
"def macro; raise NotImplementedError; end",
"def macro; raise NotImplementedError; end",
"def macro; raise NotImplementedError; end"
] | [
"0.7344821",
"0.6278074",
"0.6278074",
"0.6174589",
"0.6174589",
"0.57493454",
"0.57493454",
"0.57493454",
"0.57493454",
"0.5740502",
"0.56576455",
"0.56576455",
"0.55900216",
"0.5581706",
"0.55465806",
"0.54793566",
"0.54793566",
"0.54793566",
"0.54793566",
"0.54793566",
"0.54793566",
"0.54793566",
"0.54793566",
"0.54793566",
"0.54793566",
"0.54793566",
"0.54793566",
"0.54793566",
"0.54793566",
"0.54793566",
"0.54793566",
"0.54793566",
"0.5429066",
"0.53914875",
"0.5386764",
"0.5354226",
"0.5346806",
"0.53457224",
"0.53284705",
"0.53136605",
"0.5296018",
"0.527305",
"0.52696097",
"0.52033275",
"0.5200578",
"0.51365954",
"0.5124489",
"0.5111226",
"0.5100476",
"0.50766754",
"0.5076461",
"0.5076461",
"0.5074865",
"0.5074865",
"0.50731176",
"0.50204617",
"0.49736142",
"0.49736142",
"0.49690923",
"0.49690923",
"0.4955018",
"0.49489427",
"0.49349427",
"0.49289194",
"0.4925221",
"0.4925221",
"0.4925221",
"0.4925221",
"0.4925221",
"0.4925221",
"0.4925221",
"0.4925221",
"0.4925221",
"0.4925221",
"0.4925221",
"0.4925221",
"0.4925221",
"0.4912905",
"0.4878611",
"0.4870746",
"0.48662242",
"0.48662242",
"0.48593566",
"0.48563445",
"0.48536426",
"0.48536426",
"0.48536426",
"0.48536426",
"0.48536426",
"0.48403606",
"0.48403606",
"0.4840334",
"0.48236418",
"0.48193297",
"0.48138958",
"0.48115963",
"0.48115963",
"0.47956684",
"0.47956684",
"0.47956684"
] | 0.6908462 | 1 |
macro_name(RETURN_TYPE, FUNCNAME, ARG0,...) \ | def macro_signature_for(macro_name, arg_count, has_varargs, has_calling_conventions, return_type)
parameter_list = "#{macro_name}("
if return_type != ""
parameter_list += return_type
parameter_list += ", "
end
parameter_list += "CALLING_CONVENTION, " if (has_calling_conventions)
parameter_list += "FUNCNAME"
arg_count.times { |i| parameter_list += ", ARG#{i}_TYPE" }
parameter_list += ", ..." if has_varargs
parameter_list += ") \\"
parameter_list
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def output_macro_name(macro_name, arg_count, has_varargs, has_calling_conventions, return_type)\n putd \"#define \" + macro_signature_for(macro_name, arg_count, has_varargs, has_calling_conventions, return_type)\nend",
"def macro; end",
"def macro; end",
"def macro\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 68 )\n return_value = MacroReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n string_literal326 = nil\n variable_name327 = nil\n function_parameters328 = nil\n block329 = nil\n\n tree_for_string_literal326 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 705:5: 'macro' variable_name ( function_parameters )? block\n string_literal326 = match( MACRO, TOKENS_FOLLOWING_MACRO_IN_macro_4986 )\n if @state.backtracking == 0\n\n tree_for_string_literal326 = @adaptor.create_with_payload( string_literal326 )\n root_0 = @adaptor.become_root( tree_for_string_literal326, root_0 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_variable_name_IN_macro_4989 )\n variable_name327 = variable_name\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, variable_name327.tree )\n end\n # at line 705:28: ( function_parameters )?\n alt_80 = 2\n alt_80 = @dfa80.predict( @input )\n case alt_80\n when 1\n # at line 705:28: function_parameters\n @state.following.push( TOKENS_FOLLOWING_function_parameters_IN_macro_4991 )\n function_parameters328 = function_parameters\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, function_parameters328.tree )\n end\n\n end\n @state.following.push( TOKENS_FOLLOWING_block_IN_macro_4994 )\n block329 = block\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, block329.tree )\n end\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 68 )\n\n end\n \n return return_value\n end",
"def %(arg0)\n end",
"def %(arg0)\n end",
"def returns=(_arg0); end",
"def process_macro_call( call_exp )\n parameters = []\n body = nil\n macro_name = nil\n \n case call_exp.type.name\n when \"reference_exp\"\n macro_name = call_exp.name.text # NB: the label is being handled elsewhere!\n when \"macro_call\"\n macro_name = call_exp.macro_name.text\n parameters = call_exp.parameters \n body = call_exp.body if call_exp.slot_filled?(\"body\")\n else\n bug( \"why are you passing me a [#{call_exp.type}]?\" )\n end\n \n \n nyi( \"error handling for undefined macro call [#{macro_name}]\" ) unless @specifications.member?(macro_name) \n nyi( \"error handling for bad macro call [#{macro_name}]\" ) unless @specifications[macro_name].type == \"macro_spec\"\n macro_spec = @specifications[macro_name]\n \n #\n # Validate the parameter counts and then assign them to slots.\n \n if parameters.length != macro_spec.parameter_definitions.length then\n nyi( \"error handling for macro call parameter count mismatch (found #{parameters.length}; expected #{macro_spec.parameter_definitions.length})\" )\n end\n \n parameter_lookup = {}\n parameters.length.times do |i|\n parameter_lookup[macro_spec.parameter_definitions[i].text] = parameters[i]\n end\n \n #\n # Process the macro body by creating a copy with all variable and transclusion\n # nodes replaced appropriately.\n \n return macro_spec.expression.duplicate do |node|\n case node.type.name\n when \"transclusion\"\n nyi( \"error handling for missing macro_call body\" ) if body.nil?\n body\n \n when \"variable_exp\"\n nyi( \"error handling for non-existent macro parameter definition [#{node.name.text}] in [#{parameter_lookup.keys.join(\", \")}]\" ) unless parameter_lookup.member?(node.name.text)\n if node.label.nil? then\n parameter_lookup[node.name.text]\n else\n Grammar.group_exp( parameter_lookup[node.name.text], node.label )\n end\n \n else\n node\n end\n end\n end",
"def macro!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 48 )\n\n type = MACRO\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 169:9: 'macro'\n match( \"macro\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 48 )\n\n end",
"def return_value=(_arg0); end",
"def apply_macro(macro, docstring, call_params = T.unsafe(nil), full_source = T.unsafe(nil), block_source = T.unsafe(nil)); end",
"def macro_expansion\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 77 )\n return_value = MacroExpansionReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n char_literal384 = nil\n __ID385__ = nil\n arguments386 = nil\n\n tree_for_char_literal384 = nil\n tree_for_ID385 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 780:5: '#' ID arguments\n char_literal384 = match( POUND, TOKENS_FOLLOWING_POUND_IN_macro_expansion_5511 )\n if @state.backtracking == 0\n\n tree_for_char_literal384 = @adaptor.create_with_payload( char_literal384 )\n root_0 = @adaptor.become_root( tree_for_char_literal384, root_0 )\n\n end\n __ID385__ = match( ID, TOKENS_FOLLOWING_ID_IN_macro_expansion_5514 )\n if @state.backtracking == 0\n\n tree_for_ID385 = @adaptor.create_with_payload( __ID385__ )\n @adaptor.add_child( root_0, tree_for_ID385 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_arguments_IN_macro_expansion_5516 )\n arguments386 = arguments\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, arguments386.tree )\n end\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 77 )\n\n end\n \n return return_value\n end",
"def output_internal_helper_macros\n putd \"/* -- INTERNAL HELPER MACROS -- */\"\n\n define_return_sequence_helper\n define_custom_fake_sequence_helper\n define_reset_fake_macro\n define_declare_arg_helper\n define_declare_all_func_common_helper\n define_declare_return_value_history\n define_save_arg_helper\n define_room_for_more_history\n define_save_ret_history_helper\n define_save_arg_history_helper\n define_history_dropped_helper\n define_value_function_variables_helper\n define_custom_fake_seq_variables_helper\n define_increment_call_count_helper\n define_return_fake_result_helper\n define_extern_c_helper\n define_reset_fake_helper\n\n putd \"/* -- END INTERNAL HELPER MACROS -- */\"\n puts\nend",
"def parse_macro( data )\n cmd, macros = data[0].chr, data[1..-1].split(\"\\0\" )\n return [cmd, Hash[*macros]]\n end",
"def macro\n macro_name = shift_argument\n unless macro_name\n error(\"Usage: mortar generate:macro MACRONAME\\nMust specify MACRONAME.\")\n end\n \n macro_generator = Mortar::Generators::MacroGenerator.new\n macro_generator.generate_macro(macro_name, project, options)\n end",
"def split_function_name(line)\n /(\\s*def\\s*)(\\S[^\\(]*)(\\(.*)/.match(line)\nend",
"def create(macro_name, data, method_object = T.unsafe(nil)); end",
"def gensym(var_name = \"\")\n Macro.new.gensym(var_name)\nend",
"def my_name() # Start of a function declaration\n return(\"Zoo Lander\") # Explicit return with parenthesis\nend",
"def signature=(_arg0); end",
"def signature=(_arg0); end",
"def signature=(_arg0); end",
"def signature=(_arg0); end",
"def funcname\n NAMES[@name][1]\n end",
"def create_docstring(macro_name, data, method_object = T.unsafe(nil)); end",
"def output_custom_function_signature(arg_count, has_varargs, has_calling_conventions, is_value_function)\n return_type = is_value_function ? \"RETURN_TYPE\" : \"void\"\n ap_list = has_varargs ? \", va_list ap\" : \"\"\n calling_conv = has_calling_conventions ? \", CALLING_CONVENTION\" : \"\"\n putd_backslash \"CUSTOM_FFF_FUNCTION_TEMPLATE(#{return_type}#{calling_conv}, custom_fake, #{arg_type_list(arg_count)}#{ap_list});\"\nend",
"def function_define(name=\"\",&block)\n \"function #{name}() { #{block.call} }\" \n end",
"def method_name=(_arg0); end",
"def method_name=(_arg0); end",
"def find(macro_name); end",
"def function\n function = '\\w+\\(\\)'\n end",
"def demacro\n macro_string[2..-2]\n end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def name=(_arg0); end",
"def __synchromesh_regulate_from_macro(opts, name, already_defined)\n if opts.key?(:regulate)\n yield name => opts[:regulate]\n elsif !already_defined\n yield name => ->(*_args) {}\n end\n end",
"def function_signature(arg_count, has_varargs, has_calling_conventions, is_value_function)\n return_type = is_value_function ? \"RETURN_TYPE\" : \"void\"\n varargs = has_varargs ? \", ...\" : \"\"\n calling_conventions = has_calling_conventions ?\n \"#{return_type} FFF_GCC_FUNCTION_ATTRIBUTES CALLING_CONVENTION FUNCNAME(#{arg_val_list(arg_count)}#{varargs})\" :\n \"#{return_type} FFF_GCC_FUNCTION_ATTRIBUTES FUNCNAME(#{arg_val_list(arg_count)}#{varargs})\"\nend",
"def transformed_argname; end",
"def /(arg0)\n end",
"def /(arg0)\n end",
"def lex_macro name, value\n macros << [name, value]\n end",
"def matcher_name=(_arg0); end",
"def func_decl\n type_name\n @instruction.push(@enum.peek.value)\n match(:identifier)\n @instruction.push(@enum.peek.value)\n match(Token.new(:symbol, '('))\n parameter_list\n @instruction.push(@enum.peek.value)\n match(Token.new(:symbol, ')'))\n end",
"def function_header\n if token_is_not? :def\n return nil\n end\n require :def\n method_name = require :id\n require :open_parentheses\n argument_list = argument_list()\n require :close_parentheses\n { method_name: method_name.content, argument_list: argument_list }\n end",
"def transformed_argname=(_); end",
"def parse_macro(d)\n if d[:body] =~ /define\\s+#{Regexp.quote(d[:name])}\\([^\\)]*\\)[ \\t]*(.*)/m\n d[:value] = join_define($1)\n end\n d[:comments] = d[:rawComments].strip\n end",
"def macro_array_for(name)\n\t\t\treturn @macros_by_def[name.to_sym] if @macros_by_def[name.to_sym]\n\t\t\tkey = @macros_by_def.keys.select{|k| macro_eq?(k, name.to_sym) }[0] || name.to_sym\n\t\t\t@macros_by_def[key] = [] unless @macros_by_def[key]\n\t\t\t@macros_by_def[key]\n\t\tend",
"def name _args\n \"name _args;\" \n end",
"def macro(spec)\n @c.macro(*spec.split('='))\n end",
"def parse_function_return\n return_kw = expect(:KW_RETURN)\n value = nil\n\n unless peek?(:SEPARATOR)\n value = parse_expression\n end\n\n ret = StmtReturn.new(@curr_parsed_method, value, return_kw)\n\n @curr_parsed_method.returns << ret\n\n ret\n end",
"def new_function_text(line, matchdata, randomized_name)\n \"#{line}\n record = {}\n method(__method__).parameters.each{|arg| record[arg[1].to_s] = (eval arg[1].to_s)}\n RECORDER.push([\\\"#{matchdata[2]}\\\", record, \\\"called\\\"])\n x = #{randomized_name}(*(record.values))\n RECORDER.push([\\\"#{matchdata[2]}\\\", x, \\\"returned\\\"])\n return x\nend\n\n#{matchdata[1]}#{randomized_name}#{matchdata[3]}\n \"\nend",
"def signature(*args); end",
"def register_macro(name, &block)\n @macros.store(name, block)\n end",
"def parse_macros(*args)\n args.each_with_object([]) do |spec, macros|\n case spec\n when Hash\n add_macro_from_hash(macros, spec)\n else\n macros << Array(spec)\n end\n end\n end",
"def find_or_create(macro_name, data, method_object = T.unsafe(nil)); end",
"def template_name=(_arg0); end",
"def template_name=(_arg0); end",
"def execute\n\t\t\tres = instance_exec(@node, &Glyph::MACROS[@name]).to_s\n\t\t\tres.gsub(/\\\\*([\\[\\]\\|])/){\"\\\\#$1\"}# : res\n\t\tend",
"def code=(_arg0); end",
"def code=(_arg0); end",
"def compilesubroutine\n\n end",
"def parse_function(d)\n d[:args] = []\n\n rval, argline = d[:decl].split(/\\s*#{Regexp.quote(d[:name])}\\(\\s*/, 2)\n\n # clean up rval if it is like \"extern static int\" or \"GIT_EXTERN(int)\"\n while rval =~ /[A-Za-z0-9_]+\\(([^\\)]+)\\)$/i\n rval = $1\n end\n rval.gsub!(/extern|static/, '')\n rval.strip!\n d[:return] = { :type => rval }\n\n # we removed the opening parenthesis, which this is expecting\n argline = '(' + argline\n # clean up argline\n argline = argline.slice(1..-2) while argline[0] == ?( && argline[-1] == ?)\n d[:argline] = argline.strip\n d[:args] = []\n left = 0\n\n # parse argline\n (0 .. argline.length).each do |i|\n next unless argline[i] == ?, || argline.length == i\n\n s = argline.slice(left .. i)\n next unless s.count(\"(\") == s.count(\")\")\n\n s.chop! if argline[i] == ?,\n s.strip!\n\n if s =~ /\\(\\s*\\*\\s*(\\w+)\\s*\\)\\s*\\(/\n argname = $1\n d[:args] << {\n :name => argname,\n :type => s.sub(/\\s*#{Regexp.quote(argname)}\\s*/, '').strip\n }\n elsif s =~ /\\W(\\w+)$/\n argname = $1\n d[:args] << {\n :name => argname,\n :type => s[0 ... - argname.length].strip,\n }\n else\n # argline is probably something like \"(void)\"\n end\n\n left = i + 1\n end\n\n # parse comments\n if d[:rawComments] =~ /\\@(param|return)/i\n d[:args].each do |arg|\n param_comment = /\\@param\\s+#{Regexp.quote(arg[:name])}/.match(d[:rawComments])\n if param_comment\n after = param_comment.post_match\n end_comment = after.index(/(?:@param|@return|\\Z)/)\n arg[:comment] = after[0 ... end_comment].strip.gsub(/\\s+/, ' ')\n end\n end\n\n return_comment = /\\@return\\s+/.match(d[:rawComments])\n if return_comment\n after = return_comment.post_match\n d[:return][:comment] = after[0 ... after.index(/(?:@param|\\Z)/)].strip.gsub(/\\s+/, ' ')\n end\n else\n # support for TomDoc params\n end\n\n # add in inline parameter comments\n if d[:inlines] # array of [param line]/[comment] pairs\n d[:inlines].each do |inl|\n d[:args].find do |arg|\n if inl[0] =~ /\\b#{Regexp.quote(arg[:name])}$/\n arg[:comment] += \"\\n#{inl[1]}\"\n end\n end\n end\n end\n\n # generate function signature\n d[:sig] = d[:args].map { |a| a[:type].to_s }.join('::')\n\n # pull off function description\n if d[:rawComments] =~ /^\\s*(public|internal|deprecated):/i\n # support for TomDoc description\n else\n desc, comments = d[:rawComments].split(\"\\n\\n\", 2)\n d[:description] = desc.strip\n d[:comments] = comments || \"\"\n params_start = d[:comments].index(/\\s?\\@(?:param|return)/)\n d[:comments] = d[:comments].slice(0, params_start) if params_start\n end\n end",
"def gen_stub_method(klassname, name, options)\n raise \"Stub method with body is invalid!\" if options[:body]\n\n args = options[:arguments].dup\n unless args_convertable?(args)\n raise \"ERROR: Cannot convert stub method #{klassname}::#{name}\"\n end\n\n returns = args.delete(:returns) || \"void\"\n\n out = \"\"\n out << \"{\\n\"\n out << \"VALUE __res__ = \" if returns != 'void'\n\n # TODO: move rb_intern out\n call_args = [\"@__obj__\", %{rb_intern(\"#{name}\")}, args.size] + \n args.map {|n, k| @model.typing.convert(k, n, :c2ruby) }\n\n out << %{rb_funcall(#{call_args.join(', ')});}\n\n # check return type\n if returns != 'void' \n out << @model.typing.convert(returns, '__res__', :ruby2c_checktype)\n retval = @model.typing.convert(returns, '__res__', :ruby2c) \n out << \"return #{retval};\\n\"\n end\n\n out << \"}\\n\"\n\n return out\n end",
"def |(arg0)\n end",
"def |(arg0)\n end",
"def |(arg0)\n end",
"def ret(args,i)\n\tlines = \"@LCL\\nD=M\\n@FRAME\\nM=D\\n@5\\nA=D-A\\nD=M\\n@RET\\nM=D\\n\"\n\tlines += mac(false,'argument',\"0\")\n\tlines += \"@ARG\\nD=M+1\\n@SP\\nM=D\\n\"\n\tlines += indc(\"THAT\",\"FRAME\",\"1\")\n\tlines += indc(\"THIS\",\"FRAME\",\"2\")\n\tlines += indc(\"ARG\",\"FRAME\",\"3\")\n\tlines += indc(\"LCL\",\"FRAME\",\"4\")\n\tlines += \"@RET\\nA=M\\n0;JMP\\n\"\nend",
"def compile_subroutine_call\n consume(TokenType::IDENTIFIER)\n if check?('(')\n consume('(') # subroutineName\n compile_expression_list\n consume(')')\n elsif check?('.')\n consume('.')\n consume(TokenType::IDENTIFIER) # (className | varName)\n consume('(')\n compile_expression_list\n consume(')')\n end\n end",
"def macro; raise NotImplementedError; end",
"def macro; raise NotImplementedError; end",
"def macro; raise NotImplementedError; end",
"def say_hi( name = \"World\" )\n return \"rude\"\n \"Hello #{name}\"\nend",
"def fstype=(_arg0); end",
"def body=(_arg0); end",
"def body=(_arg0); end",
"def doc=(_arg0); end",
"def doc=(_arg0); end",
"def doc=(_arg0); end",
"def print_name(arg1)\n puts \"#{arg1}\"\nend",
"def function_Name\n\n puts \"Sample Function Name\"\n yield()\n puts \"monkey\"\n\nend",
"def map_name=(_arg0); end",
"def %(*args); end",
"def %(*args); end",
"def name(*) end",
"def name(*) end",
"def *(arg0)\n end"
] | [
"0.6904612",
"0.67198914",
"0.67198914",
"0.65299755",
"0.6259939",
"0.6259939",
"0.59508115",
"0.58626467",
"0.5840569",
"0.5732275",
"0.5701674",
"0.568185",
"0.56422156",
"0.5628717",
"0.56084174",
"0.5575177",
"0.5550959",
"0.5517609",
"0.5475656",
"0.5466418",
"0.5466418",
"0.5466418",
"0.5466418",
"0.54495347",
"0.5436472",
"0.5428226",
"0.5424747",
"0.54153085",
"0.54153085",
"0.5396087",
"0.53540325",
"0.5345788",
"0.53404385",
"0.53404385",
"0.53404385",
"0.53404385",
"0.53404385",
"0.53404385",
"0.53404385",
"0.53404385",
"0.53404385",
"0.53404385",
"0.53404385",
"0.53404385",
"0.53404385",
"0.53404385",
"0.53404385",
"0.53404385",
"0.53404385",
"0.53158605",
"0.5297931",
"0.5293614",
"0.52880895",
"0.52880895",
"0.5236901",
"0.5214961",
"0.5209483",
"0.5196252",
"0.51803493",
"0.51493275",
"0.51200557",
"0.5099564",
"0.50811",
"0.5071646",
"0.5037796",
"0.5037421",
"0.5037236",
"0.50357705",
"0.5017835",
"0.4997855",
"0.4997855",
"0.49934158",
"0.49755195",
"0.49755195",
"0.49706036",
"0.4954996",
"0.49509734",
"0.495047",
"0.495047",
"0.495047",
"0.49460047",
"0.49059638",
"0.49057102",
"0.49057102",
"0.49057102",
"0.49055988",
"0.49001172",
"0.48974383",
"0.48974383",
"0.48953432",
"0.48953432",
"0.48953432",
"0.48875976",
"0.48841",
"0.4872076",
"0.4868677",
"0.4868677",
"0.48667452",
"0.48667452",
"0.48597714"
] | 0.7313522 | 0 |
example: ARG0_TYPE arg0, ARG1_TYPE arg1 | def arg_val_list(args_count)
return "void" if (args_count == 0)
arguments = []
args_count.times { |i| arguments << "ARG#{i}_TYPE arg#{i}" }
arguments.join(", ")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def type _args\n \"type _args;\" \n end",
"def args(*) end",
"def type=(_arg0); end",
"def type=(_arg0); end",
"def type=(_arg0); end",
"def type=(_arg0); end",
"def type=(_arg0); end",
"def type=(_arg0); end",
"def type=(_arg0); end",
"def type=(_arg0); end",
"def type=(_arg0); end",
"def type=(_arg0); end",
"def type=(_arg0); end",
"def type=(_arg0); end",
"def type=(_arg0); end",
"def arguments=(_arg0); end",
"def types=(_arg0); end",
"def args=(_arg0); end",
"def args=(_arg0); end",
"def args=(_arg0); end",
"def args=(_arg0); end",
"def args=(_arg0); end",
"def type(*args); end",
"def arg_check(args, types = nil, server = nil)\n return args unless types\n\n args.each_with_index.map do |arg, i|\n next arg if types[i].nil? || types[i] == String\n\n if types[i] == Integer\n begin\n Integer(arg, 10)\n rescue ArgumentError\n nil\n end\n elsif types[i] == Float\n begin\n Float(arg)\n rescue ArgumentError\n nil\n end\n elsif types[i] == Time\n begin\n Time.parse arg\n rescue ArgumentError\n nil\n end\n elsif types[i] == TrueClass || types[i] == FalseClass\n if arg.casecmp('true').zero? || arg.downcase.start_with?('y')\n true\n elsif arg.casecmp('false').zero? || arg.downcase.start_with?('n')\n false\n end\n elsif types[i] == Symbol\n arg.to_sym\n elsif types[i] == Encoding\n begin\n Encoding.find arg\n rescue ArgumentError\n nil\n end\n elsif types[i] == Regexp\n begin\n Regexp.new arg\n rescue ArgumentError\n nil\n end\n elsif types[i] == Rational\n begin\n Rational(arg)\n rescue ArgumentError\n nil\n end\n elsif types[i] == Range\n begin\n if arg.include? '...'\n Range.new(*arg.split('...').map(&:to_i), true)\n elsif arg.include? '..'\n Range.new(*arg.split('..').map(&:to_i))\n end\n rescue ArgumentError\n nil\n end\n elsif types[i] == NilClass\n nil\n elsif [Discordrb::User, Discordrb::Role, Discordrb::Emoji].include? types[i]\n result = parse_mention arg, server\n result if result.instance_of? types[i]\n elsif types[i] == Discordrb::Invite\n resolve_invite_code arg\n elsif types[i].respond_to?(:from_argument)\n begin\n types[i].from_argument arg\n rescue StandardError\n nil\n end\n else\n raise ArgumentError, \"#{types[i]} doesn't implement from_argument\"\n end\n end\n end",
"def varargs(arg1,*rest)\n puts \"Got #{arg1} and #{rest.join(',')}\"\nend",
"def %(arg0)\n end",
"def %(arg0)\n end",
"def process(*_arg0, **_arg1); end",
"def format_arguments=(_arg0); end",
"def arguments(required, *optional)\n puts \"required: #{required}\"\n puts \"optional: #{optional}\"\nend",
"def arguments; end",
"def arguments; end",
"def arguments; end",
"def my_function(argument_a, argument_b, *args)\n puts argument_a\n puts argument_b\n p args.class.name # this is now an array\n puts args\nend",
"def myMethod1(arg0,*arg1)\n print arg0\n print arg1\nend",
"def varargs(arg1, *rest)\n puts \"Got #{arg1} and #{rest.join(', ')}\"\nend",
"def cmdarg=(_arg0); end",
"def cmdarg=(_arg0); end",
"def cmdarg=(_arg0); end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def fstype=(_arg0); end",
"def process_args(exp)\n args = []\n\n until exp.empty? do\n arg = exp.shift\n name = arg.first.to_s.sub(/^\\*/, '').intern\n type = arg.c_type\n @env.add name, type\n args << \"#{self.class.c_type(type)} #{name}\"\n end\n\n return \"(#{args.join ', '})\"\n end",
"def format_thrift_arg_strings ( args )\n params = []\n #puts args.inspect \n args.each do | arg | \n split = arg.split(' ')\n #next if i%2 > 0\n params.push( [split[1], convert_thrift_type_to_as3_type(split[0])] ) \n #puts i\n end\n #puts params.inspect\n #asdf.g\n params\nend",
"def valid_argument_list!(rest, *types)\n if rest.size == types.size\n result = rest.zip(types).collect do |arg, type|\n if String == type\n arg.to_s\n elsif Symbol == type\n arg.to_sym\n elsif Integer\n arg.to_i\n else\n raise OptionParser::InvalidArgument, arg\n end\n end\n result.size == 1 ? result[0] : result\n elsif rest.size < types.size\n raise OptionParser::MissingArgument\n else\n raise OptionParser::NeedlessArgument, rest\n end\n end",
"def method(arg_1, arg_2, *other_args)\n p arg_1 # \"a\"\n p arg_2 # \"b\"\n p other_args # []\nend",
"def signature=(_arg0); end",
"def signature=(_arg0); end",
"def signature=(_arg0); end",
"def signature=(_arg0); end",
"def transformed_argname; end",
"def parameters=(_arg0); end",
"def argument_types=(*value)\n end",
"def what_am_i arg arg2\n \nend",
"def PO110=(arg)",
"def params=(_arg0); end",
"def params=(_arg0); end",
"def varargs(arg1, *args)\n # \"arg1=#{arg1}, args=#{args.inspect}\"\n \"arg1 = #{arg1}, arg2 = #{args}\"\nend",
"def method(arg_1, arg_2, *other_args)\n p arg_1 # \"a\"\n p arg_2 # \"b\"\n p other_args # [\"c\", \"d\", \"e\"]\nend",
"def argument_types?(*value)\n true\n end",
"def hello(place=\"world\", *args)\n #...\n end",
"def typeOf _args\n \"typeOf _args;\" \n end",
"def test_string_argument\n\t\tc = Check.new\n\t\tassert c.check_arguments([1,'1',1])\n\tend",
"def foo2(arg1, arg2, *other_arg) \n print arg1 \n print other_arg \n p other_arg[0]\nend",
"def initialize(line)\n @argtype = line.split(\" \")[0].to_sym\n end",
"def args()\n #This is a stub, used for indexing\n end",
"def func4(*args)\n if args.length==0\n puts \"no arguments\\n\"\n elsif args.length==1\n puts (\"one arguemnet = \"+args[0]+\"\\n\")\n elsif args.length>1\n puts (\"more than arguments\")\n puts args\n end\nend",
"def method(arg1, arg2, *other_args)\n p arg1 # 'a'\n p arg2 # 'b'\n p other_args # []\nend",
"def process(*_arg0, **_arg1, &_arg2); end",
"def varargs(arg1, *rest)\n \"arg1=#{arg1}. rest=#{rest.inspect}\"\nend",
"def signature(*args); end",
"def foo(a, b)\n :two_args\n end",
"def argue(argument)\n argument\nend",
"def value_types=(_arg0); end",
"def my_args(first, *args, last)\n # Use the splat (i.e. *) in front of an \n # argument to take in any number of args\n # into an array (like gather in JS i.e. ...).\n # Unlike gather, it can be placed at the beginning,\n # the middle, or the end of a list of args\n puts(\"first: #{first}\")\n puts(\"args: #{args}\")\n puts(\"last: #{last}\")\nend",
"def PO111=(arg)",
"def common_call(args) # :nodoc:\n if args.size != arguments_spec.size\n raise ArgumentError, \"expected #{arguments_spec.size} arguments but got #{args.size}\"\n end\n\n filtered = []\n args.each_with_index do |v, i|\n filtered << Typelib.from_ruby(v, arguments_types[i])\n end\n CORBA.refine_exceptions(self) do\n yield(filtered)\n end\n end",
"def func *args\n puts \"Argument's length is #{args.length}\"\n for arg in args\n puts \"arg: #{arg}\"\n end\nend",
"def my_args(first, *args, last)\n # Use the splat '*' in front of an argument to take any number of args into\n # an array, just like gather (i.e. '...') in JavaScript. Unlike gather,\n # it can be placed at the beginning, middle, or end of a list of arguments.\n puts \"first: #{first}\"\n puts \"args: #{args}\"\n puts \"last: #{last}\"\nend",
"def **(arg0)\n end",
"def **(arg0)\n end",
"def PO103=(arg)"
] | [
"0.6980272",
"0.6963868",
"0.68407005",
"0.68407005",
"0.68407005",
"0.68407005",
"0.68407005",
"0.68407005",
"0.68407005",
"0.68407005",
"0.68407005",
"0.68407005",
"0.68407005",
"0.68407005",
"0.68407005",
"0.6825317",
"0.6805064",
"0.6760627",
"0.6760627",
"0.6760627",
"0.6760627",
"0.6760627",
"0.6754424",
"0.66284335",
"0.6540904",
"0.6537247",
"0.6537247",
"0.6452067",
"0.6450866",
"0.64484096",
"0.641035",
"0.641035",
"0.641035",
"0.6400703",
"0.63883185",
"0.63641906",
"0.6314385",
"0.6314385",
"0.6314385",
"0.6298218",
"0.6298218",
"0.6298218",
"0.6298218",
"0.6298218",
"0.6298218",
"0.6298218",
"0.6298218",
"0.6298218",
"0.6298218",
"0.6298218",
"0.6298218",
"0.6298218",
"0.6298218",
"0.6298218",
"0.6298218",
"0.6298218",
"0.6298218",
"0.6298218",
"0.6298218",
"0.6277971",
"0.62618273",
"0.6257147",
"0.6228207",
"0.6226921",
"0.62253004",
"0.62253004",
"0.62253004",
"0.62253004",
"0.62230885",
"0.621979",
"0.6210983",
"0.6202251",
"0.6198795",
"0.61747223",
"0.61747223",
"0.6161649",
"0.6161281",
"0.6139507",
"0.612106",
"0.6116417",
"0.61163056",
"0.61093855",
"0.6082984",
"0.6082025",
"0.60817075",
"0.6081368",
"0.6080251",
"0.6071874",
"0.6063553",
"0.60617554",
"0.60585696",
"0.6053738",
"0.605006",
"0.6048256",
"0.60466677",
"0.6032308",
"0.6027062",
"0.60185707",
"0.60185707",
"0.6016832"
] | 0.65724605 | 24 |
RETURN_TYPE (custom_fake)(ARG0_TYPE arg0);\ OR RETURN_TYPE (CALLING_CONVENTION custom_fake)(ARG0_TYPE arg0);\ void (custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2);\ | def output_custom_function_signature(arg_count, has_varargs, has_calling_conventions, is_value_function)
return_type = is_value_function ? "RETURN_TYPE" : "void"
ap_list = has_varargs ? ", va_list ap" : ""
calling_conv = has_calling_conventions ? ", CALLING_CONVENTION" : ""
putd_backslash "CUSTOM_FFF_FUNCTION_TEMPLATE(#{return_type}#{calling_conv}, custom_fake, #{arg_type_list(arg_count)}#{ap_list});"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def call_me(some_code)\n some_code.call\nend",
"def call(*) end",
"def call(*) end",
"def what_am_i arg arg2\n \nend",
"def internal_deliver(mode, method_name, return_type, *args, &b) \n exp = expectations.find(method_name, mode, *args)\n# exp = expectations.find(method_name.underscore, mode, *args) unless exp\n bl = record_call(method_name, mode, exp, *args, &b)\n is_value_type = return_type && return_type != System::Void.to_clr_type && return_type.is_value_type \n res = nil\n if exp\n block = exp.block || b\n res = instance.__send__(method_name, *args, &block) if exp.super_before?\n exp.event_recorder do |ev_nm, ev_ar, ev_h|\n recorder.record_event_raise ev_nm, mode, *ev_ar, &ev_h if ev_nm\n end if recorder && exp\n res = exp.execute *args, &bl\n res = instance.__send__(method_name, *args, &block) if !exp.super_before? and exp.call_super?\n end\n res ||= System::Activator.create_instance(return_type) if is_value_type \n res\n end",
"def call() end",
"def called_from=(_arg0); end",
"def called_from=(_arg0); end",
"def _stub(args, &ret)\n @klass.validate_call! args\n\n @expected << [args, ret]\n end",
"def internal_deliver(mode, method_name, return_type, *args, &b) \n res = nil \n is_value_type = return_type && return_type != System::Void.to_clr_type && return_type.is_value_type\n exp = expectations.find(method_name, mode, *args)\n# exp = expectations.find(method_name.underscore, mode, *args) unless exp\n exp.event_recorder do |ev_nm, ev_ar, ev_h|\n recorder.record_event_raise ev_nm, mode, *ev_ar, &ev_h if ev_nm\n end if recorder && exp\n bl = record_call(method_name, mode, exp, *args, &b)\n res = exp.execute *args, &bl if exp\n res ||= System::Activator.create_instance(return_type) if is_value_type \n res\n end",
"def dispatch(*_arg0); end",
"def generic_return(code)\n code.call\n return \"generic_return method finished\"\nend",
"def proxy(return_type); end",
"def call(*args); end",
"def care_bear(&carealot)\n carealot.call\nend",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def ruby_broken_function(event, context:)\n\nend",
"def do_something(something, something_else, another_thing)\n\nend",
"def meth(arg1)\nend",
"def meth(arg1,arg2)\nend",
"def meth(arg1,arg2)\nend",
"def stub_implementation; end",
"def monkey_trouble(a_smile, b_smile)\n # Please write your code in here\nend",
"def on_method_add_arg(call, args)\n call_name = call && call[0]\n first_arg = args && :args == args[0] && args[1]\n\n if :call == call_name && first_arg\n if args.length == 2\n # augment call if a single argument was used\n call = call.dup\n call[3] = args[1]\n end\n call\n elsif :fcall == call_name && first_arg\n name, line = call[1]\n case name\n when \"alias_method\"\n [:alias, args[1][0], args[2][0], line] if args[1] && args[2]\n when \"define_method\"\n [:def, args[1][0], line]\n when \"public_class_method\", \"private_class_method\", \"private\", \"public\", \"protected\"\n access = name.sub(\"_class_method\", \"\")\n\n if args[1][1] == 'self'\n klass = 'self'\n method_name = args[1][2]\n else\n klass = nil\n method_name = args[1][1]\n end\n\n [:def_with_access, klass, method_name, access, line]\n when \"scope\", \"named_scope\"\n [:rails_def, :scope, args[1][0], line]\n when /^attr_(accessor|reader|writer)$/\n gen_reader = $1 != 'writer'\n gen_writer = $1 != 'reader'\n args[1..-1].inject([]) do |gen, arg|\n gen << [:def, arg[0], line] if gen_reader\n gen << [:def, \"#{arg[0]}=\", line] if gen_writer\n gen\n end\n when \"has_many\", \"has_and_belongs_to_many\"\n a = args[1][0]\n kind = name.to_sym\n gen = []\n unless a.is_a?(Enumerable) && !a.is_a?(String)\n a = a.to_s\n gen << [:rails_def, kind, a, line]\n gen << [:rails_def, kind, \"#{a}=\", line]\n if (sing = a.chomp('s')) != a\n # poor man's singularize\n gen << [:rails_def, kind, \"#{sing}_ids\", line]\n gen << [:rails_def, kind, \"#{sing}_ids=\", line]\n end\n end\n gen\n when \"belongs_to\", \"has_one\"\n a = args[1][0]\n unless a.is_a?(Enumerable) && !a.is_a?(String)\n kind = name.to_sym\n %W[ #{a} #{a}= build_#{a} create_#{a} create_#{a}! ].inject([]) do |all, ident|\n all << [:rails_def, kind, ident, line]\n end\n end\n end\n else\n # super\n end\n end",
"def returns=(_arg0); end",
"def method(arg0)\n end",
"def method(arg0)\n end",
"def detect!(*args, &block); end",
"def invocation\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 32 )\n type_a = nil\n __IDENTIFIER20__ = nil\n\n begin\n # at line 952:5: calledclassbyinstance IDENTIFIER '(' ( arguments )? ')'\n @state.following.push( TOKENS_FOLLOWING_calledclassbyinstance_IN_invocation_1614 )\n calledclassbyinstance\n @state.following.pop\n __IDENTIFIER20__ = match( IDENTIFIER, TOKENS_FOLLOWING_IDENTIFIER_IN_invocation_1620 )\n # --> action\n\n \t if(@class_called.instance_methods[__IDENTIFIER20__.text].nil?)\n \t raise \"Method #{__IDENTIFIER20__.text} dont exist for instances of class #{@class_called.name} (inside #{@current_class.name}::#{@current_method.name if @current_method})\"\n \t end\n \t @method_called = @class_called.instance_methods[__IDENTIFIER20__.text]\n \t generate('era', nil, @class_called.name, @method_called.starting_fourfold)\n \t \n # <-- action\n match( T__28, TOKENS_FOLLOWING_T__28_IN_invocation_1632 )\n # at line 962:5: ( arguments )?\n alt_31 = 2\n look_31_0 = @input.peek( 1 )\n\n if ( look_31_0.between?( IDENTIFIER, INTEGER ) || look_31_0.between?( FLOAT, NULL ) || look_31_0 == T__28 || look_31_0 == T__41 || look_31_0.between?( T__49, T__51 ) )\n alt_31 = 1\n end\n case alt_31\n when 1\n # at line 962:5: arguments\n @state.following.push( TOKENS_FOLLOWING_arguments_IN_invocation_1638 )\n arguments\n @state.following.pop\n\n end\n match( T__29, TOKENS_FOLLOWING_T__29_IN_invocation_1645 )\n # --> action\n\n \t generate('gsb', @instance_called.address, @class_called.name, @method_called.starting_fourfold)\n \t type_a = @method_called.return_type\n \t @instance_called = nil\n \t @method_called = nil;\n \t @class_called = nil;\n \t \n # <-- action\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 32 )\n\n end\n \n return type_a\n end",
"def signature(*args); end",
"def call_hook(before, ok)\n logger.debug(\"call_hook: #{before} #{ok}\")\n end",
"def example_passed(_)\n end",
"def wrappers(*args, &block); end",
"def stubs=(_arg0); end",
"def Given(regexp_or_name, arg = nil, &proc)\n register_or_invoke('Given ', regexp_or_name, arg, proc)\nend",
"def returns_something?; @return_type || !@returned_arguments.empty? end",
"def verify_stubbed_calls; end",
"def mock_facade_method(object, message, ret_val: nil)\n expect(object).to receive(message).and_return(ret_val)\n end",
"def test_Method_InstanceMethods_to_proc\n\t\tpass\n\tend",
"def call(*)\n raise NotImplementedError\n end",
"def invoke(fun, args, normal, exception, name = \"\")\n invoke2(nil, fun, args, normal, exception, name)\n end",
"def _perform(args); end",
"def expected_method; end",
"def call\n func = get_func(Fiddle::TYPE_VOID)\n if func\n func.call(*@args)\n end\n end",
"def define_proxy_call(include_private, code_generator, name, target, *extra)\n defn = if NAME_COMPILABLE_REGEXP.match?(name)\n \"def #{name}(*args)\"\n else\n \"define_method(:'#{name}') do |*args|\"\n end\n\n extra = (extra.map!(&:inspect) << \"*args\").join(\", \")\n\n body = if CALL_COMPILABLE_REGEXP.match?(target)\n \"#{\"self.\" unless include_private}#{target}(#{extra})\"\n else\n \"send(:'#{target}', #{extra})\"\n end\n\n code_generator <<\n defn <<\n body <<\n \"end\" <<\n \"ruby2_keywords(:'#{name}') if respond_to?(:ruby2_keywords, true)\"\n end",
"def calls; end",
"def calls; end",
"def test_method procArg\n\tprocArg.call\nend",
"def callMe (functionParam)\n yield\n yield\nend",
"def say_hello(anything)\n# write code here\n puts anything\nend",
"def foo(...)\n bar(...)\nend",
"def on_method_add_arg(call, args)\n call_name = call && call[0]\n first_arg = args && args[0] == :args && args[1]\n\n if call_name == :call && first_arg\n if args.length == 2\n # augment call if a single argument was used\n call = call.dup\n call[3] = args[1]\n end\n call\n elsif call_name == :fcall && first_arg\n name, line = call[1]\n case name\n when 'alias_method' # this is an fcall\n [:alias, args[1][0], args[2][0], line] if args[1] && args[2]\n when 'define_method' # this is an fcall\n [:def, args[1][0], line]\n when 'public_class_method', 'private_class_method', 'private', 'public', 'protected'\n access = name.sub('_class_method', '')\n\n if args[1][1] == 'self'\n klass = 'self'\n method_name = args[1][2]\n else\n klass = nil\n method_name = args[1][1]\n end\n\n [:def_with_access, klass, method_name, access, line]\n end\n end\n end",
"def method_with_explicit_return\n :a_non_return_value\n return :return_value\n :another_non_return_value\n end",
"def flexmock_invoke_original(method, args)\n method_proc = @method_definitions[method]\n method_proc.call(*args)\n end",
"def some_method(with:, args:)\n # Floating comment\n end",
"def if_proc=(_arg0); end",
"def macro; raise NotImplementedError; end",
"def macro; raise NotImplementedError; end",
"def macro; raise NotImplementedError; end",
"def stub\n argc = @iseq[4][:arg_size]\n args = (1..argc).map{|i| \", VALUE arg#{i}\"}.join\n func_call_str = get_func_call('self.d', @func_name)\n casted_args = [\"(nabi_t)(VALUE)(0)\"] * (@local_size-argc-1)\n casted_args += argc.downto(1).map{|i| \"(nabi_t)(arg#{i})\"}\n casted_args.unshift(\"\") unless casted_args.empty?\n casted_args = casted_args.join(\", \")\n n_args = @local_size + 1 # locals + self\n tpl(\"method_stub\", name: @func_name, args: args, call_str: func_call_str, casted_args: casted_args).join(\"\\n\")\n end",
"def build_stubbed(name, *traits_and_overrides, &block); end",
"def call_a_proc(&my_proc)\n my_proc.call\nend",
"def hey_hey; end",
"def say_hello(anything)\n# write code here\n puts anything\nend",
"def say_hello\n return \"hello\"\nend",
"def called_from; end",
"def called_from; end",
"def call_action(kind, *args, &block)\n GenSpec::Matchers::GenerationMethodMatcher.for_method(kind, *args, &block)\n end",
"def stub_call(method:, message: :any, response:)\n savon.expects(method).with(message: message).returns(response)\n end",
"def invoke; end",
"def fire(object, *args); end",
"def apply_stubs(operation_name, stubs); end",
"def fake(method_name)\n if [email protected]?(method_name.to_sym)\n raise ArgumentError, \"#{@class_name} does not have a method '#{method_name}'\"\n end\n\n @args_array_by_method[method_name] = args_array = []\n define_singleton_method(method_name) do |*args|\n args_array << args\n yield(*args)\n end\n end",
"def new_function_call\n\t\t\t return create_function_call(SAPNW::RFC::FunctionCall)\n\t\t\tend",
"def talk_about(name, &myproc)\n puts \"tell me about #{name}\"\n myproc.call(name)\nend",
"def process_fcall(exp)\n method = exp.shift\n args = exp.shift\n\n str = without_result do\n generate_method_call(@model.encode_self, method, get_iter(), args)\n end\n\n resultify(str)\n end",
"def ignore_method_conflicts=(_arg0); end",
"def meth(\n # this is important\n important_arg,\n # a default, because we're not animals!\n default=nil)\nend",
"def fire(hook, *args); end",
"def say_hello(anything)\n #write code here\n puts anything\nend",
"def caller; end",
"def BlocksAndMethods(&argumento)\n\targumento.call\nend",
"def return_value=(_arg0); end",
"def call_sign; end",
"def foo(arg); end",
"def do_something(swim, bike, run)\nend",
"def shadow_proc_call!(expr, suffix=\"shadow\")\n #TODO: is there a better way to right this?\n return if(\"#{expr.procedure}\" == \"nondet\")\n procedure_id = ProcedureIdentifier.new(:name => \"#{expr.procedure}.#{suffix}\")\n expr.procedure.replace_with(procedure_id)\n end",
"def signature=(_arg0); end",
"def signature=(_arg0); end",
"def signature=(_arg0); end",
"def signature=(_arg0); end",
"def f(&code)\n code.class == Proc or raise\n end",
"def talk_about(name, &myproc) #so ruby (and us) know we are adding a proc prefix it with a ambersand &\n puts \"Let me tell you about #{name}\"\n myproc.call(name) #in the body it doesnt need a ambersand & only in the definition\nend"
] | [
"0.5956126",
"0.5877435",
"0.5877435",
"0.5621613",
"0.55576426",
"0.5556566",
"0.5543592",
"0.5543592",
"0.55231774",
"0.5517548",
"0.5503102",
"0.5486245",
"0.54757947",
"0.5459882",
"0.5450766",
"0.54363227",
"0.54363227",
"0.54363227",
"0.54363227",
"0.54363227",
"0.54363227",
"0.54363227",
"0.54363227",
"0.54349434",
"0.54117006",
"0.53984696",
"0.53745234",
"0.53745234",
"0.53458416",
"0.5315207",
"0.5313488",
"0.5312984",
"0.53100145",
"0.53100145",
"0.5279306",
"0.5277307",
"0.5270361",
"0.5263926",
"0.5263585",
"0.52620536",
"0.52558213",
"0.5246492",
"0.5240915",
"0.52288586",
"0.52270234",
"0.5220943",
"0.52140313",
"0.52115494",
"0.5200696",
"0.52006495",
"0.5199288",
"0.5195022",
"0.5187302",
"0.5187302",
"0.5186881",
"0.5162925",
"0.51601386",
"0.5151496",
"0.514904",
"0.51475054",
"0.5136981",
"0.5134516",
"0.5133981",
"0.5122116",
"0.5122116",
"0.5122116",
"0.5121874",
"0.5114961",
"0.5112392",
"0.51114446",
"0.5108886",
"0.510737",
"0.5099702",
"0.5099702",
"0.5086085",
"0.50825423",
"0.50804627",
"0.5079813",
"0.5075517",
"0.50754154",
"0.5072694",
"0.5069727",
"0.50691074",
"0.5067022",
"0.5058496",
"0.50537616",
"0.5051741",
"0.50510824",
"0.5050741",
"0.5049951",
"0.50479686",
"0.50361973",
"0.5035927",
"0.50315934",
"0.5029468",
"0.5029468",
"0.5029468",
"0.5029468",
"0.502777",
"0.50275975"
] | 0.5813386 | 3 |
example: RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1) OR RETURN_TYPE CALLING_CONVENTION FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1) | def function_signature(arg_count, has_varargs, has_calling_conventions, is_value_function)
return_type = is_value_function ? "RETURN_TYPE" : "void"
varargs = has_varargs ? ", ..." : ""
calling_conventions = has_calling_conventions ?
"#{return_type} FFF_GCC_FUNCTION_ATTRIBUTES CALLING_CONVENTION FUNCNAME(#{arg_val_list(arg_count)}#{varargs})" :
"#{return_type} FFF_GCC_FUNCTION_ATTRIBUTES FUNCNAME(#{arg_val_list(arg_count)}#{varargs})"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def single_returned_type(defn)\n returns = defn[3][1].rest.select do |child|\n child[0..2] == s(:call, nil, :returns)\n end\n if returns.count > 1\n raise 'Invalid stdlib class method definition: ' +\n \"#{@symbol_table.cclass}.#{defn[1]}\"\n elsif returns.count == 1\n returns[0][3][1][1]\n end\n end",
"def process_func_call(match, func, func_list, type_table)\n unless func_list.is_a? FunctionList\n raise \"Internal: func_list isn't a FunctionList\"\n end\n unless func.is_a? Function\n raise \"Can only call functions inside other functions\"\n end\n\n expr = process_expression(match[0], func.ident_list, type_table)\n unless expr.is_a?(FunctionExpression)\n raise \"Invalid function call expression?\"\n end\n\n instruction = FunctionCallInstruction.new(func, expr)\n func.add_instruction(instruction)\n\n return true\nend",
"def returns_something?; @return_type || !@returned_arguments.empty? end",
"def create_function(function_name, returning, definition, options = {})\n\n end",
"def parse_func\n return_type = parse_type\n @buffer.skip(/\\s*/)\n scan_or_fail(/\\w+/, 'Invalid function name')\n\n func = FunctionDecl.new(name: @buffer[0], entity: @entity, is_method: true, return_type: return_type, comment: @entity_comment)\n @buffer.skip(/\\s*/)\n\n scan_or_fail(/\\(/, 'Invalid function declaration. Expected (')\n until @buffer.scan(/\\)/)\n type = parse_type\n @buffer.skip(/\\s*/)\n\n # Special case for `x f(void)`` style prototypes\n break if type.name == :void && @buffer.scan(/\\)/)\n\n name = ''\n if type.name == :data && !type.size.nil?\n name = 'result'\n elsif type.name == :string && !type.size.nil?\n name = 'result'\n else\n name = @buffer.scan(/\\w+/)\n end\n param = Parameter.new(name: name, type: type)\n func.parameters << param\n @buffer.skip(/\\s*,\\s*/)\n end\n\n @buffer.skip(/;/)\n func\n end",
"def general_func_call\n @instruction.push(@enum.peek.value)\n match(Token.new(:symbol, '('))\n expr_list\n @instruction.push(@enum.peek.value)\n match(Token.new(:symbol, ')'))\n semicolon\n end",
"def function_call_statement\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 16 )\n\n\n value = nil\n\n\n name = nil\n args = nil\n chain = nil\n\n\n begin\n # at line 105:5: name= IDENT (args= function_arguments )? chain= function_call_statement_float\n name = match( IDENT, TOKENS_FOLLOWING_IDENT_IN_function_call_statement_813 )\n # at line 105:20: (args= function_arguments )?\n alt_27 = 2\n look_27_0 = @input.peek( 1 )\n\n if ( look_27_0 == T__34 )\n alt_27 = 1\n end\n case alt_27\n when 1\n # at line 105:20: args= function_arguments\n @state.following.push( TOKENS_FOLLOWING_function_arguments_IN_function_call_statement_817 )\n args = function_arguments\n @state.following.pop\n\n end\n @state.following.push( TOKENS_FOLLOWING_function_call_statement_float_IN_function_call_statement_822 )\n chain = function_call_statement_float\n @state.following.pop\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = FunctionCallStatementEval.new(name.text, args)\n value.chain = chain unless chain.nil?\n \n # <-- action\n end\n\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 16 )\n\n\n end\n\n return value\n end",
"def funcname\n NAMES[@name][1]\n end",
"def function_call\n unless tokens_are?(:id, :open_parentheses)\n return nil\n end\n\n method_name = @scanner.get_next_token.content\n @scanner.get_next_token # open parentheses\n params = parameter_list()\n\n require :close_parentheses\n require :new_line\n\n return { function_call: method_name, params: params }\n end",
"def get_function(type, name, function)\n func = function\n\n unless function\n func = case type\n when :key then \"(#{Misc::DOCUMENT_OFFSET}#{name} || #{Misc::ID_OFFSET}#{name})\"\n #when :value then \"(#{Misc::DOCUMENT_OFFSET}#{name} || #{name})\"\n when :value then \"(typeof #{name} != 'undefined' ? #{name} : #{Misc::DOCUMENT_OFFSET}#{name})\"\n end\n end\n\n return func\n end",
"def new_function_call\n\t\t\t return create_function_call(SAPNW::RFC::FunctionCall)\n\t\t\tend",
"def macro_signature_for(macro_name, arg_count, has_varargs, has_calling_conventions, return_type)\n parameter_list = \"#{macro_name}(\"\n if return_type != \"\"\n parameter_list += return_type\n parameter_list += \", \"\n end\n parameter_list += \"CALLING_CONVENTION, \" if (has_calling_conventions)\n parameter_list += \"FUNCNAME\"\n\n arg_count.times { |i| parameter_list += \", ARG#{i}_TYPE\" }\n\n parameter_list += \", ...\" if has_varargs\n\n parameter_list += \") \\\\\"\n\n parameter_list\nend",
"def type\n \"Function\"\n end",
"def invoke(fun, args, normal, exception, name = \"\")\n invoke2(nil, fun, args, normal, exception, name)\n end",
"def internal_call_function(scope, function_name, args, &block)\n\n the_loader = loader\n unless the_loader\n raise ArgumentError, _(\"Function %{class_name}(): cannot call function '%{function_name}' - no loader specified\") %\n { class_name: self.class.name, function_name: function_name }\n end\n\n func = the_loader.load(:function, function_name)\n if func\n Puppet::Util::Profiler.profile(function_name, [:functions, function_name]) do\n return func.call(scope, *args, &block)\n end\n end\n\n # Check if a 3x function is present. Raise a generic error if it's not to allow upper layers to fill in the details\n # about where in a puppet manifest this error originates. (Such information is not available here).\n loader_scope = closure_scope\n func_3x = Puppet::Parser::Functions.function(function_name, loader_scope.environment) if loader_scope.is_a?(Puppet::Parser::Scope)\n unless func_3x\n raise ArgumentError, _(\"Function %{class_name}(): Unknown function: '%{function_name}'\") %\n { class_name: self.class.name, function_name: function_name }\n end\n\n # Call via 3x API\n # Arguments must be mapped since functions are unaware of the new and magical creatures in 4x.\n # NOTE: Passing an empty string last converts nil/:undef to empty string\n result = scope.send(func_3x, Puppet::Pops::Evaluator::Runtime3FunctionArgumentConverter.map_args(args, loader_scope, ''), &block)\n\n # Prevent non r-value functions from leaking their result (they are not written to care about this)\n Puppet::Parser::Functions.rvalue?(function_name) ? result : nil\n end",
"def parse_function(d)\n d[:args] = []\n\n rval, argline = d[:decl].split(/\\s*#{Regexp.quote(d[:name])}\\(\\s*/, 2)\n\n # clean up rval if it is like \"extern static int\" or \"GIT_EXTERN(int)\"\n while rval =~ /[A-Za-z0-9_]+\\(([^\\)]+)\\)$/i\n rval = $1\n end\n rval.gsub!(/extern|static/, '')\n rval.strip!\n d[:return] = { :type => rval }\n\n # we removed the opening parenthesis, which this is expecting\n argline = '(' + argline\n # clean up argline\n argline = argline.slice(1..-2) while argline[0] == ?( && argline[-1] == ?)\n d[:argline] = argline.strip\n d[:args] = []\n left = 0\n\n # parse argline\n (0 .. argline.length).each do |i|\n next unless argline[i] == ?, || argline.length == i\n\n s = argline.slice(left .. i)\n next unless s.count(\"(\") == s.count(\")\")\n\n s.chop! if argline[i] == ?,\n s.strip!\n\n if s =~ /\\(\\s*\\*\\s*(\\w+)\\s*\\)\\s*\\(/\n argname = $1\n d[:args] << {\n :name => argname,\n :type => s.sub(/\\s*#{Regexp.quote(argname)}\\s*/, '').strip\n }\n elsif s =~ /\\W(\\w+)$/\n argname = $1\n d[:args] << {\n :name => argname,\n :type => s[0 ... - argname.length].strip,\n }\n else\n # argline is probably something like \"(void)\"\n end\n\n left = i + 1\n end\n\n # parse comments\n if d[:rawComments] =~ /\\@(param|return)/i\n d[:args].each do |arg|\n param_comment = /\\@param\\s+#{Regexp.quote(arg[:name])}/.match(d[:rawComments])\n if param_comment\n after = param_comment.post_match\n end_comment = after.index(/(?:@param|@return|\\Z)/)\n arg[:comment] = after[0 ... end_comment].strip.gsub(/\\s+/, ' ')\n end\n end\n\n return_comment = /\\@return\\s+/.match(d[:rawComments])\n if return_comment\n after = return_comment.post_match\n d[:return][:comment] = after[0 ... after.index(/(?:@param|\\Z)/)].strip.gsub(/\\s+/, ' ')\n end\n else\n # support for TomDoc params\n end\n\n # add in inline parameter comments\n if d[:inlines] # array of [param line]/[comment] pairs\n d[:inlines].each do |inl|\n d[:args].find do |arg|\n if inl[0] =~ /\\b#{Regexp.quote(arg[:name])}$/\n arg[:comment] += \"\\n#{inl[1]}\"\n end\n end\n end\n end\n\n # generate function signature\n d[:sig] = d[:args].map { |a| a[:type].to_s }.join('::')\n\n # pull off function description\n if d[:rawComments] =~ /^\\s*(public|internal|deprecated):/i\n # support for TomDoc description\n else\n desc, comments = d[:rawComments].split(\"\\n\\n\", 2)\n d[:description] = desc.strip\n d[:comments] = comments || \"\"\n params_start = d[:comments].index(/\\s?\\@(?:param|return)/)\n d[:comments] = d[:comments].slice(0, params_start) if params_start\n end\n end",
"def eval_function_call(args, current_cont)\n\t\t\tfunc_slot, func_args = args[:ast], args[:args]\n\t\t\tenv = args[:env]\n\t\t\t\n\t\t\tif func_slot.kind_of? LispSym\n\t\t\t\tbuildin_name = func_slot.val.to_sym\n\t\t\t\tif Buildins.singleton_methods.include? buildin_name\n\t\t\t\t\treturn current_cont.create_after Buildins.method(buildin_name), arg_ast: func_args, env: env\n\t\t\t\telse\n\t\t\t\t\treturn current_cont.heap[:error_handler].with message:\n\t\t\t\t\t\t\"Tried to call unknown buildin with the name \\\"#{buildin_name}\\\"\",\n\t\t\t\t\t\tast: LispPair.new(func_slot, func_args), backtrace: caller(0)\n\t\t\t\tend\n\t\t\telsif func_slot.kind_of? Continuation\n\t\t\t\t# If we got a continuation in the function slot eval its first argument and then\n\t\t\t\t# continue with that continuation.\n\t\t\t\treturn func_slot.create_before method(:eval), ast: func_args.first, env: env\n\t\t\telsif func_slot.kind_of? LispLambda\n\t\t\t\treturn current_cont.create_after method(:eval_lambda), lambda: func_slot, arg_ast: func_args, env: env\n\t\t\telse\n\t\t\t\treturn current_cont.heap[:error_handler].with message:\n\t\t\t\t\t\"Got unknown stuff in the function slot: #{Printer.print(func_slot)}\",\n\t\t\t\t\tast: LispPair.new(func_slot, func_args), backtrace: caller(0)\n\t\t\tend\n\t\tend",
"def what_am_i arg arg2\n \nend",
"def supports_returning?(type)\n true\n end",
"def supports_returning?(type)\n true\n end",
"def conditional_returned_types(defn)\n returns = defn[3][1].rest.select do |child|\n child[0] == :call and child[2] == :returned_if\n end\n if returns.any?\n returns.reduce({}) do |hash,rule|\n hash.merge({rule[3].rest.map { |arg| arg[1].to_s } .join('_') =>\n rule[1][1]})\n end\n end\n end",
"def output_custom_function_signature(arg_count, has_varargs, has_calling_conventions, is_value_function)\n return_type = is_value_function ? \"RETURN_TYPE\" : \"void\"\n ap_list = has_varargs ? \", va_list ap\" : \"\"\n calling_conv = has_calling_conventions ? \", CALLING_CONVENTION\" : \"\"\n putd_backslash \"CUSTOM_FFF_FUNCTION_TEMPLATE(#{return_type}#{calling_conv}, custom_fake, #{arg_type_list(arg_count)}#{ap_list});\"\nend",
"def function_declaration(kind)\n name = consume(:identifier, \"Expect #{kind} name.\")\n consume(:lparen, \"Expect '(' after #{kind} name.\")\n parameters = []\n if !check?(:rparen)\n loop do\n if parameters.length >= 8\n error(peek, 'Cannot have more than 8 parameters')\n end\n parameters << consume(:identifier, 'Expect parameter name')\n break unless match?(:comma)\n end\n end\n consume(:rparen, \"Expect ')' after parameters.\")\n\n consume(:lbrace, \"Expect '{' before #{kind} body\")\n body = block\n return Ringo::Function.new(name, parameters, body)\n end",
"def general_func_call(fn)\n \"#{@scanner.next.value} #{expr_list(fn)} #{@scanner.next.value}#{@scanner.next.value}\\n\"\n\n end",
"def capture_return_type\n matches = @code.scan(/^\\s*[+-]\\s*\\(([^\\(\\)]*)\\)/)\n return nil if matches.size != 1\n type = matches[0][0].to_s.gsub(TAILMATCH, '')\n\n if type == 'void' || type == 'IBAction'\n @returns = nil\n else\n @returns = type\n end\n end",
"def call *o\n raise ArgumentError.new(\"#{o.length} for #{arguments.length}\") unless o.length == arguments.length\n\n invoked = []\n \n arguments.each_with_index do |a,i|\n a.set o[i]\n \n ptr = a.for_invoke\n \n if a.value == nil\n # do not wrap nil, pass it as is !\n invoked << nil\n else\n invoked << ptr\n end\n end\n\n # call the function\n r = @lib.call(get_return_type,@name.to_s,*invoked)\n \n arguments.each do |a|\n a.set nil\n end\n \n return(@return_type.type == :void ? nil : @return_type.to_ruby(r))\n end",
"def create_function( name, arity, type=nil, &block ) # :yields: func, *args\n case type\n when :numeric\n type = SQLite::API::NUMERIC\n when :text\n type = SQLite::API::TEXT\n when :args\n type = SQLite::API::ARGS\n end\n\n callback = proc do |func,*args|\n block.call( FunctionProxy.new( func ), *args )\n end\n\n SQLite::API.create_function( @handle, name, arity, callback )\n SQLite::API.function_type( @handle, name, type ) if type\n\n self\n end",
"def get_arg_func(key, func, default) \n if (@args == nil) \n return default\n elsif @args[0].instance_of? Hash\n if @args[0][key]\n return func.call(@args[0][key])\n else\n return default\n end\n else \n return default\n end\n end",
"def function_type\n case @function_type\n when RUBY_3X\n 'Ruby 3.x API'\n when RUBY_4X\n 'Ruby 4.x API'\n else\n 'Puppet Language'\n end\n end",
"def callable_with?(args, callable=nil)\n signatures = @func.dispatcher.to_type\n callables = signatures.is_a?(Puppet::Pops::Types::PVariantType) ? signatures.types : [signatures]\n\n return true if callables.any? {|t| t.callable_with?(args) }\n return false unless block_given?\n args_type = Puppet::Pops::Types::TypeCalculator.singleton.infer_set(callable.nil? ? args : args + [callable])\n error_message = Puppet::Pops::Types::TypeMismatchDescriber.describe_signatures(@func.name, @func.signatures, args_type)\n yield error_message\n false\n end",
"def func_if(args)\n p1 = car(args)\n p2 = car(cdr(args))\n p3 = cdr(cdr(args))\n\n if _eval(p1) != @o_man.nil\n return _eval(p2)\n end\n\n return func_progn(p3)\n end",
"def checkDispatch(exp, symbs, tmap, c, callobj, statid, methid, args)\n #get type of the caller\n calltype = nil\n if callobj.nil?\n calltype = 'SELF_TYPE'\n else\n # Type check caller expression\n checkExp(callobj, symbs, tmap, c)\n calltype = callobj.type\n end\n\n #get class name to look up in implementation map\n methtype = calltype\n #if caller is SELF_TYPE, we look up enclosing class\n if calltype == 'SELF_TYPE'\n methtype = c\n end\n #if doing static dispatch, we look up the specified class\n if not statid.nil?\n # ERROR if caller expression does not conform to static type specified\n if not tmap.isChild(calltype, statid.name, c)\n puts \"ERROR: #{exp.line}: Type-Check: Caller type #{calltype} does not conform to static type #{statid.name}\"\n exit\n end\n methtype = statid.name\n end\n\n # Find method in imap\n meth=nil\n if not tmap.imap[methtype].nil?\n tmap.imap[methtype].each do |_,m|\n if m.name.name == methid.name\n meth = m\n break\n end\n end\n end\n\n # Method not found\n if meth.nil?\n puts \"ERROR: #{methid.line}: Type-Check: Unknown method \\\"#{methtype}@#{methid.name}\\\"\"\n exit\n end\n\n # Check number of arguments\n if meth.formals.size != args.size\n puts \"ERROR: #{exp.line}: Type-Check: Invalid number of arguments, got #{args.size} expected #{meth.formals.size}\"\n exit\n end\n\n # Type check each argument\n args.each do |subexp|\n checkExp(subexp, symbs, tmap, c)\n end\n\n # Check actuals against formals\n meth.formals.zip(args) do |formal, actual|\n if not tmap.isChild(actual.type, formal[1].name, c)\n puts \"ERROR: #{exp.line}: Type-Check: Invalid actual parameter type, got #{actual.type} expected #{formal[1].name}\"\n exit\n end\n end\n\n #if return type of method is SELF_TYPE, dispatch expression's type is type of the caller\n if meth.type.name == 'SELF_TYPE'\n exp.type = calltype\n else\n exp.type = meth.type.name\n end\nend",
"def translate_call(sexp)\n raise NotInlineableError unless inlineable? sexp\n arg1 = translate_generic_sexp sexp[1]\n arg2 = translate_generic_sexp sexp[3][1]\n res_type = ([arg1.value_type, arg2.value_type].include? :Float) ? :Float : :Fixnum\n s().with_value(s(:binary_oper,\n sexp[2], arg1.value_sexp, arg2.value_sexp), res_type)\n end",
"def func_decl\n type_name\n @instruction.push(@enum.peek.value)\n match(:identifier)\n @instruction.push(@enum.peek.value)\n match(Token.new(:symbol, '('))\n parameter_list\n @instruction.push(@enum.peek.value)\n match(Token.new(:symbol, ')'))\n end",
"def validate\n name = @name.to_sym\n unless support.key?(name)\n @errors << Sparkql::ParserError.new(token: @name,\n message: \"Unsupported function call '#{@name}' for expression\",\n status: :fatal)\n return\n end\n\n required_args = support[name][:args]\n total_args = required_args + Array(support[name][:opt_args]).collect { |args| args[:type] }\n\n if @args.size < required_args.size || @args.size > total_args.size\n @errors << Sparkql::ParserError.new(token: @name,\n message: \"Function call '#{@name}' requires #{required_args.size} arguments\",\n status: :fatal)\n return\n end\n\n count = 0\n @args.each do |arg|\n type = arg[:type] == :function ? arg[:return_type] : arg[:type]\n unless Array(total_args[count]).include?(type)\n @errors << Sparkql::ParserError.new(token: @name,\n message: \"Function call '#{@name}' has an invalid argument at #{arg[:value]}\",\n status: :fatal)\n end\n count += 1\n end\n\n if name == :cast\n type = @args.last[:value]\n unless VALID_CAST_TYPES.include?(type.to_sym)\n @errors << Sparkql::ParserError.new(token: @name,\n message: \"Function call '#{@name}' requires a castable type.\",\n status: :fatal)\n return\n end\n end\n\n substring_index_error?(@args[2][:value]) if name == :substring && !@args[2].nil?\n end",
"def on_call(ast_node, context)\n name, *args = *ast_node\n\n handler = name.gsub('-', '_')\n\n return send(\"on_call_#{handler}\", context, *args)\n end",
"def callop(*args)\n raw_result = common_call(args) do |filtered|\n return_typename, return_value = nil\n if !@void_return\n return_typename = orocos_return_typenames[0]\n return_value = result_value_for(return_types.first)\n end\n\n task.do_operation_call(name, return_typename, return_value,\n orocos_arguments_typenames, filtered)\n\n result = []\n if return_value\n result << return_value\n end\n inout_arguments.each do |index|\n result << filtered[index]\n end\n result\n end\n\n result = []\n raw_result.each_with_index do |v, i|\n result << Typelib.to_ruby(v, return_types[i])\n end\n if result.empty? then nil\n elsif result.size == 1 then result.first\n else result\n end\n end",
"def process_call(exp)\n receiver = exp.shift\n name = exp.shift\n\n receiver = process receiver\n\n case name\n # TODO: these need to be numerics\n # emacs gets confused by :/ below, need quotes to fix indentation\n when :==, :<, :>, :<=, :>=, :-, :+, :*, :\"/\", :% then\n args = process exp.shift[1]\n return \"#{receiver} #{name} #{args}\"\n when :<=>\n args = process exp.shift[1]\n return \"RB_COMPARE(#{receiver}, #{args})\"\n when :equal?\n args = process exp.shift\n return \"#{receiver} == #{args}\" # equal? == address equality\n when :[]\n args = process exp.shift\n return \"#{receiver}[#{args}]\"\n when :nil?\n exp.clear\n return receiver.to_s\n else\n args = process exp.shift\n\n if receiver.nil? and args.nil? then\n args = \"\"\n elsif receiver.nil? then\n # nothing to do \n elsif args.nil? or args.empty? then\n args = receiver\n else\n args = \"#{receiver}, #{args}\"\n end\n\n args = '' if args == 'rb_ary_new()' # HACK\n\n return \"#{name}(#{args})\"\n end\n end",
"def my_name() # Start of a function declaration\n return(\"Zoo Lander\") # Explicit return with parenthesis\nend",
"def call(fun, *args)\n call2(nil, fun, *args)\n end",
"def returns=(_arg0); end",
"def apply_args_conventions(*args)\n if args.size == 1 and args[0].kind_of?(CodeTree::AstNode)\n args[0]\n elsif args.size > 1 and args[0].kind_of?(Symbol)\n function = args.shift\n children = args.collect{|c| apply_args_conventions(c)}.flatten\n CodeTree::AstNode.coerce([function, children])\n elsif args.all?{|a| a.kind_of?(CodeTree::AstNode)}\n args\n elsif args.size == 1\n args[0]\n else\n raise ArgumentError, \"Unable to apply on #{args.inspect} (#{args.size})\", caller\n end\n end",
"def callable_arity(callable)\n # procs and lambdas respond to #arity\n return callable.arity if callable.respond_to?(:arity)\n\n callable.method(:call).arity\n end",
"def call_function(function_name, *args, &block)\n internal_call_function(closure_scope, function_name, args, &block)\n end",
"def functionName(parameter1, parameter2)\n puts parameter1\n puts parameter2\nend",
"def call(callable, *args)\n if callable.is_a?(String) || callable.is_a?(Symbol)\n proc = @library.macros(true)[callable.to_sym]\n fun = @library.functions(true)[callable.to_sym]\n if proc\n count = proc.arity >= 0 ? proc.arity : 0\n if args.count != count\n raise ArgumentError, \"Wrong number of arguments passed to macro (#{args.count} for #{count})\" \n end\n self.instance_exec(*args, &proc)\n elsif fun\n @builder.call(fun, *args.map{|arg| Convert(arg, fun.arg_types[args.index(arg)])})\n else\n raise NoMethodError, \"Function or macro, '#{function.to_s}', does not exist.\"\n end\n elsif callable.kind_of?(LLVM::Script::Function)\n @builder.call(callable, *args.map{|arg| Convert(arg, callable.arg_types[args.index(arg)])})\n elsif callable.kind_of?(LLVM::Value) && (callable.type.kind == :function || callable.type.kind == :pointer)\n @builder.call(callable, *args.map{|arg| Convert(arg)})\n else\n raise ArgumentError, \"Callable passed to call must be a LLVM::Value or a name of a Library function or macro.\"\n end\n end",
"def returned_type(defn)\n single_returned_type(defn) or conditional_returned_types(defn)\n end",
"def function_call_statement_float\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 17 )\n\n\n value = nil\n\n\n relation_type = nil\n name = nil\n args = nil\n chain = nil\n\n\n begin\n # at line 113:3: (relation_type= ( '.' | '::' ) name= IDENT (args= function_arguments )? chain= function_call_statement_float |)\n alt_29 = 2\n look_29_0 = @input.peek( 1 )\n\n if ( look_29_0 == T__43 || look_29_0 == T__46 )\n alt_29 = 1\n elsif ( look_29_0 == CLOSE || look_29_0.between?( IDENT, IF ) || look_29_0 == NL || look_29_0 == RETURN || look_29_0 == WHILE || look_29_0.between?( T__31, T__33 ) || look_29_0.between?( T__35, T__42 ) || look_29_0.between?( T__44, T__45 ) || look_29_0.between?( T__47, T__54 ) )\n alt_29 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n\n\n raise NoViableAlternative( \"\", 29, 0 )\n\n end\n case alt_29\n when 1\n # at line 113:5: relation_type= ( '.' | '::' ) name= IDENT (args= function_arguments )? chain= function_call_statement_float\n relation_type = @input.look\n\n if @input.peek(1) == T__43 || @input.peek(1) == T__46\n @input.consume\n @state.error_recovery = false\n\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n\n mse = MismatchedSet( nil )\n raise mse\n\n end\n\n\n name = match( IDENT, TOKENS_FOLLOWING_IDENT_IN_function_call_statement_float_856 )\n # at line 113:47: (args= function_arguments )?\n alt_28 = 2\n look_28_0 = @input.peek( 1 )\n\n if ( look_28_0 == T__34 )\n alt_28 = 1\n end\n case alt_28\n when 1\n # at line 113:47: args= function_arguments\n @state.following.push( TOKENS_FOLLOWING_function_arguments_IN_function_call_statement_float_860 )\n args = function_arguments\n @state.following.pop\n\n end\n @state.following.push( TOKENS_FOLLOWING_function_call_statement_float_IN_function_call_statement_float_865 )\n chain = function_call_statement_float\n @state.following.pop\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = FunctionCallStatementEval.new(name.text, args)\n value.relation_type = relation_type.text\n value.chain = chain unless chain.nil?\n \n # <-- action\n end\n\n\n when 2\n # at line 119:19: \n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value = nil \n # <-- action\n end\n\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 17 )\n\n\n end\n\n return value\n end",
"def c(arg1)\n puts \"arg1: #{arg1}\"\nend",
"def compile_subroutine_call\n consume(TokenType::IDENTIFIER)\n if check?('(')\n consume('(') # subroutineName\n compile_expression_list\n consume(')')\n elsif check?('.')\n consume('.')\n consume(TokenType::IDENTIFIER) # (className | varName)\n consume('(')\n compile_expression_list\n consume(')')\n end\n end",
"def fstype=(_arg0); end",
"def compile_call(scope, func, args, block = nil)\n return compile_yield(scope, args, block) if func == :yield\n\n # This is a bit of a hack. get_arg will also be called from\n # compile_eval_arg below, but we need to know if it's a callm\n fargs = get_arg(scope, func)\n\n return compile_callm(scope,:self, func, args,block) if fargs && fargs[0] == :possible_callm\n\n args = [args] if !args.is_a?(Array)\n @e.caller_save do\n @e.with_stack(args.length, true) do\n args.each_with_index do |a, i|\n param = compile_eval_arg(scope, a)\n @e.save_to_stack(param, i)\n end\n @e.movl(args.length, :ebx)\n @e.call(compile_eval_arg(scope, func))\n end\n end\n @e.evict_regs_for(:self)\n reload_self(scope)\n return [:subexpr]\n end",
"def call(address, sig, args, result_types)\n data = self._encode_function(sig, args)\n data_hex = RLP::Utils.encode_hex(data)\n response = eth_call(to: address, data: data_hex)\n return decode_abi(result_types, RLP::Utils.encode_hex(response[2..-1]))\n end",
"def send_as_function arg\n case arg\n when Symbol then __send__ arg\n when Array then __send__(*arg)\n else yield_or_eval(&arg)\n end\n end",
"def do_something(something, something_else, another_thing)\n\nend",
"def dispatch(*_arg0); end",
"def visitFunction func,args=nil\n type=func.type.accept(self)\n name=func.name.accept(self)\n args=func.args.collect{|arg| arg.accept(self)}\n body=func.body.accept(self)\n Function.new(name,type,args,body)\n end",
"def func4(*args)\n if args.length==0\n puts \"no arguments\\n\"\n elsif args.length==1\n puts (\"one arguemnet = \"+args[0]+\"\\n\")\n elsif args.length>1\n puts (\"more than arguments\")\n puts args\n end\nend",
"def callMe (functionParam)\n yield\n yield\nend",
"def method_missing(name, *args)\n return super unless name =~ /is_(.*)\\?/\n func_kind = /is_(.*)\\?/.match(name).captures.first\n matches = func_kind.to_sym == kind\n matches = (matches && is?(args.first)) if args.size == 1\n return matches\n end",
"def eval\n begin\n if !func_exist?(@name)\n raise NameError, \"Function #{@name} has not been declared.\"\n else\n if @@our_debug then puts \"#{debug_time} Function called : #{@name}\" end\n para = @@func_list[@name].para\n if @args[0] != nil and para[0] != nil\n #Making sure we only get Basic_container type objects in @args\n @args.each_with_index {|arg, idx| @args[idx] = convert_obj(arg)}\n scope_increase\n @@func_list[@name].para.each {|item| item.eval }\n @args.each_with_index {|arg, idx|\n Assign_class.new(para[idx].name, arg).eval\n }\n elsif para[0] != nil\n scope_increase\n para.each {|item| item.eval }\n else\n scope_increase\n end\n ret_value = @@func_list[@name].eval\n scope_decrease\n return convert_obj(ret_value)\n end\n Bool_class.new('bool', 'FALSE')\n rescue => error\n puts error.inspect\n end\n end",
"def FunctionCall(rest, parsed); end",
"def foo (a, b)\n a.call(b)\nend",
"def call\n @func[*@args]\n end",
"def call_function(function_name, *args, &block)\n # TRANSLATORS: do not translate variable name strings in these assertions\n Pal::assert_non_empty_string(function_name, 'function_name', false)\n Pal::assert_type(Pal::T_ANY_ARRAY, args, 'args', false)\n internal_evaluator.evaluator.external_call_function(function_name, args, topscope, &block)\n end",
"def trigger_function(type)\n case type\n when \"onClick\" then \"click\"\n when \"onChange\" then \"change\"\n when \"onFocus\" then \"focus\"\n when \"onFocusOut\" then \"blur\"\n else fail \"Undefined trigger function!\"\n end\n end",
"def func_Handler(funciones)\n\t#Manejo de la estructura.\n\tArgError = 0\n\tif (funciones.list_Arg != nil)\n\t\tArgError = listArg_Handler(funciones.list_Arg)\n\tend\n #si la funcion tiene firma verificamos\n firmError = 0\n firma=false\n\tif (funciones.firma != nil)\n\t\tfirma=true\n\t\tfirmError = firm_Handler(funciones.firma)\n\tend\n\n\tinstrError = linst_Handler(firma,funciones.list_inst,funciones.nombre)\n\treturn ArgError + instrError + firmError\nend",
"def return_type; end",
"def return_type; end",
"def return_type; end",
"def batman_ironman_lambda #checks number of arguments\n victor = lambda { return \"Batman will win!\" }\n victor.call\n \"Iron Man will win!\"\nend",
"def invoke(name, *args)\n fn = @functions[name]\n raise \"function not imported: #{name}\" if fn.nil?\n # p [name] + args\n result = fn.call(*args)\n \n result = FMod::RESULT[result]\n # p [name,result]\n unless result == :OK\n raise \"FMod Exception: #{result} when calling #{name}\"\n end\n return FMod::RESULT.index result\n end",
"def run(argarr)\n #$stderr.puts \"Calling function with arguments #{@args.class}\"\n callargs = Hash.new\n if @args.class == Array\n @args.each do |v|\n callargs[v] = argarr[v]\n end\n elsif @args.class == Symbol and argarr[@args].class == Hash\n argarr[@args].each do |k,v|\n callargs[k] = v\n end\n elsif @args.class == Symbol\n callargs[:__argument] = argarr[@args]\n end\n \n Function[@function].run(callargs)\n retarr = callargs[:__return]\n if ((!@returns) ^ (!retarr)) and (!@returns or !retarr)\n $stderr.puts \"Return from #{@function} failed - expectation was nil xor returns was nil\"\n $stderr.puts \"Non-fatal for now, but shame on you\"\n \n return\n elsif (!@returns) #and by extension retarr has to be nil\n return #this is ok\n elsif (@returns.class == Symbol and retarr.class != Array)\n argarr[@returns] = retarr\n return\n elsif (@returns.class == Array and retarr.class != Array)\n $stderr.puts \"Return from #{@function} failed - expectation was an array but returns wasn't\"\n $stderr.puts \"Invalid statement:\"\n YAML.dump(self, $stderr)\n $stderr.puts\n raise \"Function return error - returning from #{@function} expecting returns #{@returns}\"\n end\n #now we know @returns should be an array\n @returns.each do |r|\n argarr[r] = retarr.shift\n end\n end",
"def validate()\n name = @name.to_sym\n unless support.has_key?(name)\n @errors << Sparkql::ParserError.new(:token => @name, \n :message => \"Unsupported function call '#{@name}' for expression\",\n :status => :fatal )\n return\n end\n\n required_args = support[name][:args]\n total_args = required_args + Array(support[name][:opt_args]).collect {|args| args[:type]}\n\n if @args.size < required_args.size || @args.size > total_args.size\n @errors << Sparkql::ParserError.new(:token => @name, \n :message => \"Function call '#{@name}' requires #{required_args.size} arguments\",\n :status => :fatal )\n return\n end\n\n count = 0\n @args.each do |arg|\n type = arg[:type] == :function ? arg[:return_type] : arg[:type]\n unless Array(total_args[count]).include?(type)\n @errors << Sparkql::ParserError.new(:token => @name, \n :message => \"Function call '#{@name}' has an invalid argument at #{arg[:value]}\",\n :status => :fatal )\n end\n count +=1\n end\n\n if name == :cast\n type = @args.last[:value]\n if !VALID_CAST_TYPES.include?(type.to_sym)\n @errors << Sparkql::ParserError.new(:token => @name,\n :message => \"Function call '#{@name}' requires a castable type.\",\n :status => :fatal )\n return\n end\n end\n\n if name == :substring && !@args[2].nil?\n substring_index_error?(@args[2][:value])\n end\n end",
"def meth(arg1)\nend",
"def create_function(function_name, returning, definition, options = {})\n\n function_name = full_function_name(function_name, options)\n language = options[:language] || 'plpgsql'\n replace = if options[:replace] == false\n ''\n else\n 'OR REPLACE '\n end\n volatility = case options[:volatility]\n when :volatile, :stable, :immutable\n \"\\n #{options[:volatility].to_s.upcase}\"\n else\n \"\"\n end\n\n sql = <<-SQL.gsub(/^[ ]{6}/, \"\")\n CREATE #{replace}FUNCTION #{function_name}\n RETURNS #{returning}\n LANGUAGE #{language}#{volatility}\n AS $function$\n #{definition.strip}\n $function$\n SQL\n\n execute(sql)\n end",
"def cast_or_call(cc, mod, fun, *args)\n req = t[cc, mod.to_sym, fun.to_sym, args]\n write_berp(req)\n read_response\n end",
"def canonicalise_args(fun)\n procpars = fun[:params] || {}\n if procpars.size == 0 && @args_named.size > 0\n set_error 999, \"Parameters passed to method declared to take none.\"\n return\n end\n # Go through the declared arglist and populate the positional arglist\n procpars.each_with_index do |pp, i|\n argname = pp[:name]\n argtype = pp[:type]\n arg_named = @args_named.delete argname\n arg_numbered = @args_named.delete i.to_s\n set_error(999, \"You cannot set the parameter #{argname} both by name and position\") and return if arg_named && arg_numbered\n arg = @args_pos[i] || arg_named || arg_numbered\n # Type-check arg\n case argtype\n when 'bit'\n set_error(999, \"The arg #{argname} must be literally true or false (was #{arg.to_json})\") and return unless arg == true || arg == false\n when 'num'\n if !arg.is_a?(Numeric)\n if arg.is_a?(String) && (arg_conv = arg.to_i rescue nil).to_s == arg\n arg = arg_conv\n elsif arg.is_a?(String) && (arg_conv = arg.to_f rescue nil).to_s == arg\n arg = arg_conv\n else\n set_error(999, \"The arg #{argname} must be numeric (was #{arg.to_json})\") \n return\n end\n end\n when 'str'\n if !arg.is_a?(String)\n if arg.is_a?(Numeric)\n arg = arg.to_s\n else\n set_error(999, \"The arg #{argname} must be a string (was #{arg.to_json})\")\n return\n end\n end\n when 'arr'\n set_error(999, \"The arg #{argname} must be an array (was #{arg.to_json})\") and return unless arg.is_a?(Array)\n when 'obj'\n set_error(999, \"The arg #{argname} must be a JSON object (was #{arg.to_json})\") and return unless arg.is_a?(Hash)\n end\n # Set the positional arg\n @args_pos[i] ||= arg\n end\n # The positional arglist should now be populated. The named arglist should be exhausted.\n set_error(999, \"Excess parameters passed (#{@args_named.to_json})\") and return unless @args_named.size == 0\n end",
"def func_when(args)\n p1 = car(args)\n p2 = cdr(args)\n if _eval(p1) != @o_man.nil\n return func_progn(p2)\n end\n\n return @o_man.nil\n end",
"def command_type\n if arithmetic?\n \"C_ARITHMETIC\"\n else\n \"C_#{arg_0.upcase}\"\n end\n end",
"def check_function_type?(expression, expected)\n validate_manipulation_types(expression[:field_manipulations], expected)\n end",
"def run(argarr)\n callargs = Hash.new\n if @args.class == Array\n @args.each do |v|\n callargs[v] = argarr[v]\n end\n elsif @args.class == Symbol and argarr[@args].class == Hash\n argarr[@args].each do |k,v|\n callargs[k] = v\n end\n elsif @args.class == Symbol\n callargs[:__argument] = argarr[@args]\n end\n \n Function[@function].run(callargs)\n retarr = callargs[:__return]\n if ((!@returns) ^ (!retarr)) and (!@returns or !retarr)\n $stderr.puts \"Return from #{@function} failed - expectation was nil xor returns was nil\"\n $stderr.puts \"Non-fatal for now, but shame on you\"\n \n return\n elsif (!@returns) #and by extension retarr has to be nil\n return #this is ok\n elsif (@returns.class == Symbol and retarr.class != Array)\n argarr[@returns] = retarr\n return\n elsif (@returns.class == Array and retarr.class != Array)\n $stderr.puts \"Return from #{@function} failed - expectation was an array but returns wasn't\"\n $stderr.puts \"Invalid statement:\"\n YAML.dump(self, $stderr)\n $stderr.puts\n raise \"Function return error - returning from #{@function} expecting returns #{@returns}\"\n end\n #now we know @returns should be an array\n @returns.each do |r|\n argarr[r] = retarr.shift\n end\n end",
"def type_of_scala_function?(obj)\n if obj.java_kind_of? scala.Function0\n 0\n elsif obj.java_kind_of? scala.Function1\n 1\n elsif obj.java_kind_of? scala.Function2\n 2\n elsif obj.java_kind_of? scala.Function3\n 3\n elsif obj.java_kind_of? scala.Function4\n 4\n elsif obj.java_kind_of? scala.Function5\n 5\n elsif obj.java_kind_of? scala.Function6\n 6\n elsif obj.java_kind_of? scala.Function7\n 7\n elsif obj.java_kind_of? scala.Function8\n 8\n elsif obj.java_kind_of? scala.Function9\n 9\n elsif obj.java_kind_of? scala.Function10\n 10\n elsif obj.java_kind_of? scala.Function11\n 11\n elsif obj.java_kind_of? scala.Function12\n 12\n elsif obj.java_kind_of? scala.Function13\n 13\n elsif obj.java_kind_of? scala.Function14\n 14\n elsif obj.java_kind_of? scala.Function15\n 15\n elsif obj.java_kind_of? scala.Function16\n 16\n elsif obj.java_kind_of? scala.Function17\n 17\n elsif obj.java_kind_of? scala.Function18\n 18\n elsif obj.java_kind_of? scala.Function19\n 19\n elsif obj.java_kind_of? scala.Function20\n 20\n elsif obj.java_kind_of? scala.Function21\n 21\n elsif obj.java_kind_of? scala.Function22\n 22\n else\n false\n end\n end",
"def call_function(fn_name, args)\n case fn_name\n when 'hiera'\n val = @hiera.lookup(args[0], args[1], @scope)\n if val.nil?\n val = @scope[args[0]]\n end\n if val.nil? && !(args.length >= 2)\n # TODO: display exception coloured in output\n raise Exception, \"undefined variable '#{args[0]}' and no default\"\n end\n val\n when 'hiera_hash'\n @hiera.lookup(args[0], args[1], @scope, resolution_type = :hash)\n when 'template'\n erb, _ = make_erb(args[0])\n erb.result(self.get_binding())\n when 'warning'\n puts red(\"[WARNING]: #{args[0]}\")\n when 'fail'\n raise RuntimeError, args[0]\n else\n raise Exception, \"call_function: unknown function '#{fn_name}'\" if fn_name != 'hiera'\n end\n end",
"def argue(argument)\n return argument\nend",
"def func_decl\n @prog_code << \"#{type_name} \"\n\n fn_name = @scanner.next.value unless @scanner.peek.type != :identifier\n\n @prog_code << \"#{fn_name}\"\n @functions[fn_name] = Function.new unless @functions[fn_name] != nil\n @global_sym_tab[fn_name] = fn_name\n fn = @functions[fn_name]\n @prog_code << \"#{@scanner.next.value}\"\n parameter_list(fn)\n @prog_code << \"#{@scanner.next.value}\"\n\n return @functions[fn_name]\n end",
"def xx(arg1, arg2) \n puts arg2+arg1 \nend",
"def have_func(function, headers = [])\n headers = get_header_string(headers)\n\n erb_ptr = ERB.new(read_template('have_func_pointer.erb'))\n erb_std = ERB.new(read_template('have_func.erb'))\n\n ptr_code = erb_ptr.result(binding)\n std_code = erb_std.result(binding)\n\n # Check for just the function pointer first. If that fails, then try\n # to compile with the function declaration.\n try_to_compile(ptr_code) || try_to_compile(std_code)\n end",
"def signature(*args); end",
"def ∃⨍?(func_name); self.sql(\"SELECT does_func_exist('#{func_name}');\").rows[0][0]; end",
"def returnsomething\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 18 )\n\n begin\n # at line 613:5: expression\n @state.following.push( TOKENS_FOLLOWING_expression_IN_returnsomething_848 )\n expression\n @state.following.pop\n # --> action\n\n \trt = @stack_operands.pop\n rt_t = @stack_types.pop\n if(rt_t != @current_method.return_type)\n raise \"Invalid return type #{rt_t} in the #{@current_method.return_type} type method #{@current_class.name}::#{@current_method.name}\"\n end\n generate('ret', nil, nil ,rt )\n @is_returning = true\n free_avail(rt)\n free_avail_const(rt)\n \n \n # <-- action\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 18 )\n\n end\n \n return \n end",
"def meth(arg1,arg2)\nend",
"def meth(arg1,arg2)\nend",
"def method_call(return_type=nil, method_name=\"\", parameters=[], body_clause=[]) \n [\"public #{return_type || \"\"} #{method_name}(\" + parameters.map{|i| \"#{i[1]} #{i[0]}\"}.join(\", \") + \") {\",\n body_clause.indent, \"}\"]\nend",
"def rInvocation(type=nil)\n meth = @method.methClass.getMethod(@method, type)\n return '' if !meth\n meth.registerCaller(@method)\n res = meth.name + '('\n meth.args.each {|arg|\n res += '(' + arg.type + ')(' + rExp + '), '\n }\n res = res[0..-3] if meth.args.size > 0\n return res + ')'\nend",
"def method1 arg1, arg2\n return \"#{arg1} #{arg2}\"\nend",
"def callable?(callable, args)\n callable.is_a?(PAnyType) && callable.callable?(args)\n end",
"def method_missing(func_symbol, *args)\n\t\t\t\t\t\t\tfunc_name = func_symbol.to_s\n\t\t\t\t\t\t\traise \"DLL-function #{func_name} not found. Known functions: #{PP.pp(@functions.keys, \"\")}\" unless @functions.has_key? func_name\n\t\t\t\t\t\t\tfunction = @functions[func_name]\n\t\t\t\t\t\t\treturn process_function_call(function, args)\n\t\t\t\t\t\tend",
"def call_a_proc(&my_proc)\n my_proc.call\nend",
"def call_type\n return !@call_types.empty? ? @call_types[-1] : :instance_method\n end"
] | [
"0.57207525",
"0.5522323",
"0.5371888",
"0.5308808",
"0.53053224",
"0.5286602",
"0.52390224",
"0.51953083",
"0.51478446",
"0.50900024",
"0.507325",
"0.5060967",
"0.50418895",
"0.5026886",
"0.4963419",
"0.49342653",
"0.49314213",
"0.49300718",
"0.49287593",
"0.49287593",
"0.48964074",
"0.48812804",
"0.48693523",
"0.48640433",
"0.48532918",
"0.4848954",
"0.4834762",
"0.48218757",
"0.47996968",
"0.47928965",
"0.478688",
"0.47866622",
"0.47757775",
"0.4765376",
"0.47557807",
"0.47517237",
"0.47497818",
"0.47467422",
"0.473842",
"0.47353274",
"0.47306904",
"0.47200722",
"0.4719704",
"0.47132823",
"0.47059745",
"0.4693916",
"0.4690571",
"0.46852982",
"0.4682813",
"0.46776444",
"0.46699598",
"0.46689335",
"0.46495795",
"0.46331197",
"0.4631768",
"0.46266887",
"0.4625711",
"0.4623731",
"0.46200967",
"0.46107548",
"0.45984086",
"0.4579936",
"0.4569998",
"0.4568986",
"0.45685723",
"0.45657876",
"0.4561613",
"0.45609593",
"0.45609593",
"0.45609593",
"0.45585814",
"0.45552582",
"0.45323983",
"0.4529597",
"0.45288634",
"0.45187792",
"0.45134684",
"0.45070556",
"0.4506336",
"0.4495264",
"0.44939315",
"0.4492079",
"0.44874752",
"0.44760957",
"0.44698754",
"0.44620526",
"0.4453508",
"0.44497877",
"0.4449061",
"0.44489434",
"0.444794",
"0.4444609",
"0.4444609",
"0.4444548",
"0.4438036",
"0.44360808",
"0.44341668",
"0.44286993",
"0.44268885",
"0.4418567"
] | 0.5996886 | 0 |
invoke move on entity unless blocked by map | def move(entity, direction)
entity.move(direction) if entity
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def move_entity entity; end",
"def process_moving_entity(entity)\n unless @registry[entity.registry_id]\n puts \"#{entity} not in registry yet, no move to process\"\n yield\n return\n end\n\n before_x, before_y = entity.x, entity.y\n\n yield\n\n if moved = (entity.x != before_x || entity.y != before_y)\n update_grid_for_moved_entity(entity, before_x, before_y)\n # Note: Maybe we should only wake entities in either set\n # and not both. For now we'll wake them all\n (\n entities_bordering_entity_at(before_x, before_y) +\n entities_bordering_entity_at(entity.x, entity.y)\n ).each(&:wake!)\n end\n\n moved\n end",
"def move\n # Force evaluation of both update_x and update_y (no short-circuit)\n # If we're moving faster horizontally, do that first\n # Otherwise do the vertical move first\n moved = @space.process_moving_entity(self) do\n if @x_vel.abs > @y_vel.abs then move_x; move_y\n else move_y; move_x\n end\n end\n\n # Didn't move? Might be time to go to sleep\n if !moved && sleep_now?\n puts \"#{self} going to sleep...\"\n @moving = false\n end\n end",
"def move\n # Force evaluation of both update_x and update_y (no short-circuit)\n # If we're moving faster horizontally, do that first\n # Otherwise do the vertical move first\n moved = @space.process_moving_entity(self) do\n if @x_vel.abs > @y_vel.abs then move_x; move_y\n else move_y; move_x\n end\n end\n\n # Didn't move? Might be time to go to sleep\n @moving = false if !moved && sleep_now?\n\n moved\n end",
"def move; end",
"def move; end",
"def move\n super\n gravitize\n end",
"def partial_move_to_position(sx, sy, steps, wait=false, no_through = false)\n return unless $game_map.passable?(sx,sy,0)\n route = Pathfinder.create_path(Point.new(sx, sy), self, no_through)\n\n if route.list.size > steps\n route.list.slice!(steps...-1)\n end\n\n self.force_move_route(route)\n Fiber.yield while self.move_route_forcing if wait\n end",
"def update\n space.fall(self) if should_fall?\n move\n end",
"def execute\n return unless @robot.placed?\n\n original_position = @robot.position\n new_position = original_position.dup\n new_position.move\n\n @robot.position = new_position if @table.position_valid?(new_position)\n end",
"def process_cursor_move\n return unless super && @allow_change_enemy\n if Input.trigger?(:L)\n turn_page(-1)\n update_scene_index\n elsif Input.trigger?(:R)\n turn_page(1)\n update_scene_index\n end\n return true\n end",
"def turn!(x, y)\n\n # Policy pesimistis lock... but simple to implement. The best option to solve this problem \n # is force the thread wait only in the locks that represents de selected adjacent tile.\n @mutex.synchronize do\n\n tile = @tiles[x][y]\n location = Location.new(@n, @m, x, y)\n\n return if(tile.is_a?(Water) || tile.is_a_plant?())\n\n if tile.is_a_vegetarian?()\n\n if Utils.generate_random_percentage() <= Configurator[:vegetarian_move_probability]\n \n @tiles = VegetarianBehaviour.move(@tiles, location)\n end\n elsif tile.is_a_predator?()\n \n if Utils.generate_random_percentage() <= Configurator[:predator_move_probability]\n\n @tiles = PredatorBehaviour.move(@tiles, location)\n end\n else\n\n @tiles = GroundBehaviour.grow(@tiles, location)\n end\n end\n end",
"def move_if_needed\n positions.each {|dir, pos|\n t = tile_at(pos)\n if t\n @direction, @position = directions.invert[dir], pos\n # Update the image so that the user actually sees the bug\n # turning if it did.\n update_image\n t.on\n return true\n end\n }\n return false\n end",
"def move(direction, map)\n x = @x_location\n y = @y_location\n \n case direction\n when :north then y -= 1\n when :south then y += 1 \n when :west then x -= 1\n when :east then x += 1 \n end\n \n unless map[y][x].is_a_wall?\n @x_location = x\n @y_location = y\n end \n end",
"def move\n\n end",
"def standard_move\n pos.set(x,y)\n tar = move_towards_player\n sep = seperate_from_enemies\n sep.scalar(5.5, '*')\n tar.scalar(4.0, '*')\n apply_force(sep)\n apply_force(tar)\n if acc.x == 0 and acc.y == 0\n return\n else\n vel.add(acc)\n vel.limit(speed)\n end\n pos.add(vel)\n @x = pos.x\n @y = pos.y\n acc.scalar(0, '*')\n end",
"def move\n return false unless on_the_table?\n\n next_x, next_y = facing.next_move_position(x, y)\n unless falls_off?(next_x, next_y)\n self.x = next_x\n self.y = next_y\n true\n else\n false\n end\n end",
"def move\n \n end",
"def move\n \n end",
"def can_move_to?(x, y)\n old_x = @object.x\n old_y = @object.y\n @object.move(x, y)\n\n unless @object_pool.world.can_move_to?(x, y)\n terrain = @object_pool.world.world[y][x]\n @object.stats.add_message(\"Bump into a #{terrain.id} #{terrain.symbol} (#{@object.x}, #{@object.y})\")\n return false\n end\n\n @object_pool.same_point_objects(@object.x, @object.y, @object).each do |obj|\n case obj\n when Character\n obj.on_collision(@object)\n return false\n when Item\n break if @object.input.is_a?(AiInput)\n\n obj.on_collision(@object)\n end\n end\n\n true\n ensure\n @object.move(old_x, old_y)\n end",
"def move\n if inside_table?(next_move_x_y(next_move))\n update_position!(next_move_x_y(next_move))\n else\n almost_die\n end\n end",
"def update\n accelerate(0, 1) if should_fall?\n move\n end",
"def move_to_position(sx, sy, wait=false, no_through = false)\n return unless $game_map.passable?(sx,sy,0)\n route = Pathfinder.create_path(Point.new(sx, sy), self, no_through)\n self.force_move_route(route)\n Fiber.yield while self.move_route_forcing if wait\n end",
"def living_move\n simulate_move(opponent)\n end",
"def move!\n\t\tbounce! until !will_bounce? #TODO add surroundedness checking\n\t\t@x += @@target_coords[@direction][:dx]\n\t\t@y += @@target_coords[@direction][:dy]\n\tend",
"def move(direction)\n \n end",
"def move\n return unless placed?\n # We know place() will already ignore invalid placements, so just advance\n # the robot and let it fail silently if those positions are not on the board\n place(*next_position, direction)\n end",
"def move(left, top)\n # no-op\n end",
"def move(to,board)\n if self.legal?(to,board)\n @coords = to\n @moved = true\n else\n return false\n end\n end",
"def move\n move_by a, m\n end",
"def warp(map_id, x_pos, y_pos, direction)\n $game_temp.player_new_x = x_pos\n $game_temp.player_new_y = y_pos\n $game_temp.player_new_direction = direction\n $game_temp.player_new_map_id = map_id\n $game_temp.player_transferring = true\n end",
"def move\n\t\t'moved passed'\n\tend",
"def move\n return unless placed?\n # no need to use a loop since the length is only 2\n new_x = @pos_x + @direction[:x]\n new_y = @pos_y + @direction[:y]\n\n return unless valid_position?(new_x, new_y)\n set_position(new_x, new_y)\n end",
"def update_move\n if [email protected]? && @moves.size > 0\n @moves.shift if proccess_move(@moves[0])\n end\n end",
"def move(distance)\n self.position -= distance\n ensure_bounds\n end",
"def move\n\t\treturn \"INVALID COMMANDS, YOU CAN NOT MAKE THE ROBOT FALL OFF THE TABLE\" unless is_valid_move?\n\t\tcase @direction\n\t\twhen \"east\"\n\t\t\t@x_coordinate += 1\n\t\twhen \"west\"\n\t\t\t@x_coordinate -= 1\n\t\twhen \"south\"\n\t\t\t@y_coordinate -= 1\n\t\twhen \"north\"\n\t\t\t@y_coordinate += 1\n\t\telse\n\t\tend\n\t\ttrue\n\tend",
"def move\n origin = @table.find(self)\n\n # Check if the robot can move without falling off the table\n case @direction\n when Direction::NORTH\n movement = Coordinate.new(0, 1)\n when Direction::EAST\n movement = Coordinate.new(1, 0)\n when Direction::SOUTH\n movement = Coordinate.new(0, -1)\n when Direction::WEST\n movement = Coordinate.new(-1, 0)\n end\n destination = origin + movement\n return unless @table.contain? destination\n\n # Safe to move\n @table.place origin, nil\n @table.place destination, self\n end",
"def move_piece(from_row, from_column, to_row, to_column)\n piece = @state[from_row][from_column] \n new_location = [to_row, to_column]\n @state[to_row][to_column] = piece.class.new(piece.color, new_location)\n @state[from_row][from_column] = nil\n \n moved_piece = @state[to_row][to_column]\n if moved_piece.class == Pawn\n special_pawn_rules(moved_piece, from_row, to_column)\n end\n # Once a move has been made, disallow\n disallow_all_en_passant(piece.color) # taking en_passant on enemy pawns \n end",
"def execute\n if @robot.placed?\n new_position = @robot.current_position.go_to(@robot.current_position.direction)\n\n @robot.current_position = new_position if @table.position_is_valid?(new_position)\n end\n end",
"def perform_move(move)\n @board[*move] = self\n @board[*@location] = nil\n @location = move\n @king = true if in_end_row?\n move\n end",
"def move(x, y)\n if y != 0\n @y += y\n bounce if game_state.first_terrain_collision(self)\n end\n \n if x != 0\n @x += x\n turn if game_state.first_terrain_collision(self)\n end\n end",
"def move\n # Do not continue if robot isn't placed\n return cancel_action(\"Robot isn't placed on the surface yet\") unless placed?\n\n # Calculate target position. Cancel processing the method if it's outside current surface\n target_position = current_placement.position.add(current_placement.direction.to_unit_vector)\n return cancel_action(\"Robot can't drive outside the surface\") unless surface.position_on_surface?(target_position)\n\n # Set the current placement, calculate movement vector and pass it ot the mobility system.\n self.target_placement = NavigationEntities::Placement.new(target_position, current_placement.direction)\n mobility_system.move_by(target_position - current_placement.position)\n\n # Current mobility system is just a placeholder, so it's always executed\n if mobility_system.standby\n # Update information about current location.\n # TODO: Refactor this part when a real mobility system will be plugged in\n update_placement(target_placement)\n end\n end",
"def move_raw(x, y)\n old_location = self.location\n return_value = move_raw_async x, y\n 100.times do\n break unless self.location == old_location\n sleep 0.01\n end\n return_value\n end",
"def move\n @glade['add_point'].sensitive = false\n @locate_thread = @planning.locate(@start, @finish) {move_finished}\n end",
"def move_object_left(object)\n object.location_move_left unless is_wall?(object.location_left)\n end",
"def explore\n rover_bay.each do |r|\n if pass_path_check?(r)\n move(r)\n else\n raise \"There is a collision\\nin placement #{r.coordinate.inspect}, please revise instruction set #{r.command.inspect}\"\n end\n end\n end",
"def moving!\n end",
"def moves_for_key_held\n MOVES_FOR_KEY_HELD\n end",
"def move(to)\n @moved = true\n super(to)\n end",
"def valid_moves\n super\n end",
"def setup_move\n return unless PONY::ERRNO.check_sequence(current_act)\n stop_all_movements\n mx = @map_char.real_x + @acts[1]\n my = @map_char.real_y + @acts[2]\n goto(mx, my, @acts[3], @acts[4], @acts[5] || 0)\n end",
"def doMove _obj, _args\n \"_obj doMove _args;\" \n end",
"def moving?; @moving; end",
"def moving?; @moving; end",
"def move_obstacles(block)\r\n if block.y==500 || block.y==20\r\n block.vel_y*=-1\r\n end\r\n\r\n block.y+=block.vel_y\r\n\r\n end",
"def move!(start, end_pos)\n if self[start].moves.include?(end_pos)\n self[end_pos] = self[start]\n self[end_pos].pos = end_pos\n self[start] = NullPiece.new\n else\n puts \"Invalid Move! Try again.\"\n sleep(2)\n end\n end",
"def update_move\n self.x = screen_x\n self.y = screen_y\n update_move_arch if @type == Arched\n end",
"def move\n position_after_move = @position.new_coordinates_for_step_size(@direction.step_size_for_x_axis, @direction.step_size_for_y_axis)\n\n #ignore the command if robot is being out off tabletop\n if(@table_top.has_within_bounds?(position_after_move))\n @position = @position.new_coordinates_for(@direction.step_size_for_x_axis, @direction.step_size_for_y_axis)\n\n end\n end",
"def world_move\r\n PlayerCharacter.transaction do\r\n @pc.lock!\r\n if params[:id] == 'north' && WorldMap.exists?(:bigxpos => @pc[:bigx], :bigypos => @pc[:bigy] -1)\r\n flash[:notice] = \"Moved North\"\r\n @pc[:bigy] -= 1\r\n elsif params[:id] == 'south' && WorldMap.exists?(:bigxpos => @pc[:bigx], :bigypos => @pc[:bigy] +1)\r\n flash[:notice] = \"Moved South\"\r\n @pc[:bigy] += 1\r\n elsif params[:id] == 'west' && WorldMap.exists?(:bigxpos => @pc[:bigx] - 1, :bigypos => @pc[:bigy])\r\n flash[:notice] = \"Moved West\"\r\n @pc[:bigx] -= 1\r\n elsif params[:id] == 'east' && WorldMap.exists?(:bigxpos => @pc[:bigx] + 1,:bigypos => @pc[:bigy])\r\n flash[:notice] = \"Moved East\"\r\n @pc[:bigx] += 1\r\n else\r\n flash[:notice] = \"Unknown/invalid direction\"\r\n end\r\n @pc.save!\r\n end\r\n redirect_to main_game_path\r\n end",
"def move(new_position)\n yield(new_position, self) if block_given?\n self.position = new_position\n self.moved = true\n nil\n end",
"def move\n if @placed\n position = @face.move(@x, @y)\n x = position[0]\n y = position[1]\n if @table.validate(x, y)\n @x = x\n @y = y\n end\n end\n end",
"def robot_move\n state_execute do |robot|\n robot.move\n end\n end",
"def move()\n if @direction == \"up\"\n move_up()\n elsif @direction == \"down\"\n move_down()\n else\n #check if anyone is on current floor- which way do majority want to go from here?\n @direction = people_on_current_floor()\n if @direction == \"up\" #were more ppl on this floor wanting to go up\n move_up()\n elsif @direction == \"down\"\n move_down()\n else #no one on this floor, decide direction based on pending rqsts above and below...\n decide_direction()\n end\n end\n end",
"def move(loc)\n if self.move_animal_to_non_retail?(loc)\n false\n else\n @location_id = loc\n true\n end\n end",
"def move_direction(direction)\n\n #Convert the direction to a change in x and y coordinates. \n #Also set the direction we are leaving the current tile and the direction\n #we are entering the new tile (e.g. going north we leave the current tile\n #in the north direction and enter the next tile from the south \n dx, dy = 0, 0\n leave_dir, enterDir = nil, nil\n if direction == 'north' then\n dx, dy = 0, 1\n leave_dir, enter_dir = 'n', 's'\n self.facing = 0\n elsif direction == 'south'\n dx, dy = 0, -1\n leave_dir, enter_dir = 's', 'n'\n self.facing = 2\n elsif direction == 'east'\n dx, dy = 1, 0\n leave_dir, enter_dir = 'e', 'w'\n self.facing = 1\n elsif direction == 'west'\n dx, dy = -1, 0\n leave_dir, enter_dir = 'w', 'e'\n self.facing = 3\n end\n self.save!\n\n #The direction given was not one of the 4 cardinal directions\n if dx == 0 and dy == 0 then\n return false\n end\n\n #find the tile to be moved to\n x = self.tile.x + dx\n y = self.tile.y + dy\n target_tile = Tile.tile_at(x, y)\n\n if target_tile == nil then\n return false\n end\n\n #Make sure it is valid to walk over the tile\n target_tile_props = TILE_PROPERTIES[target_tile.tile_type.to_s]\n current_tile_props = TILE_PROPERTIES[self.tile.tile_type.to_s]\n leaving_traversable = current_tile_props[\"traversable\"][leave_dir]\n entering_traversable = target_tile_props[\"traversable\"][enter_dir]\n if leaving_traversable == 1 or leaving_traversable == 3 or\n entering_traversable == 1 or entering_traversable == 2 then\n return false\n end\n\n #update direction facing\n if y > self.tile.y then\n self.facing = 0\n elsif y < self.tile.y then\n self.facing = 2\n elsif x > self.tile.x then\n self.facing = 1\n elsif x < self.tile.x then\n self.facing = 3\n end\n\n\n # update battery & health according to tile property\n self.battery += TILE_PROPERTIES[target_tile.tile_type.to_s][\"batteffect\"][enter_dir]\n self.health += TILE_PROPERTIES[target_tile.tile_type.to_s][\"healtheffect\"][enter_dir]\n self.save!\n\n self.move_to(x, y)\n return true\n end",
"def move\n potential_move ||= winning_move\n potential_move ||= living_move\n potential_move ||= random_move\n end",
"def retutn_map_postions\n $game_temp.battle_move = true\n pos = $game_temp.battle_result == 1 ? $game_temp.escape_pos : $game_temp.end_pos\n @moving_actors = []\n for i in 0...$game_party.actors.size\n @moving_actors[i] = i == 0 ? $game_player : $game_player.caterpillar[i-1]\n @moving_actors[i].move_update.clear if i > 0\n end\n started_moving = false\n loop do\n if started_moving == true\n for i in 0...$game_party.actors.size\n set_battle_position(@moving_actors[i], @actors_pos[i])\n end\n else\n for i in 0...$game_party.actors.size\n set_battle_position(@moving_actors[i], pos)\n end\n @actors_pos = set_end_postion(pos)\n end\n started_moving = true\n update_basic(false, true, true)\n break if all_in_postion(@actors_pos)\n end\n set_plus_postion\n $game_temp.battle_move = false\n wait(10)\n end",
"def move?\n @moving\n end",
"def move(*args)\n begin\n move_no_cleanup(*args)\n rescue Orp::MovementAlreadyComplete\n warn \"Attempted to complete already completed movement\"\n nil\n rescue\n delete\n raise\n end\n end",
"def final_move_point(session, entity, to, block)\n map, index, catalyst = map_info session\n from = index[entity.id]\n path_inf = get_path map, catalyst, entity, from, to\n return false unless path_inf[:found]\n final = to\n final = check_path(path_inf, &block) if block\n [from, final, path_inf]\n end",
"def move_onto(a, b)\n reveal(a)\n reveal(b)\n move_single(a, b)\n end",
"def go!\n send_position_to_engine\n move_piece(bestmove)\n end",
"def class_update\n if can_drop_bomb? and closest_target\n drop_bomb if on_top_of?(closest_target)\n if facing_right_of?(closest_target)\n turn_left\n end\n if facing_left_of?(closest_target)\n turn_right\n end\n end\n go_forward\n loop_position\n end",
"def place\n next_move = {x: command.arguments[:x], y: command.arguments[:y]}\n if inside_table?(next_move_x_y(next_move, false))\n update_position!(next_move_x_y(next_move, false))\n update_direction!\n else\n almost_die\n end\n end",
"def move_to(coordinates, map = @map)\n # Prevents operations on nil.\n return if map.nil?\n \n system(\"clear\") unless ENV['TEST']\n\n y = coordinates.first; x = coordinates.second\n\n # Prevents moving onto nonexistent and impassable tiles.\n if (!map.in_bounds(y,x) || (!map.tiles[y][x].passable))\n describe_tile(self)\n return\n end\n\n @map = map\n @location = coordinates\n tile = @map.tiles[y][x]\n\n update_map\n\n if !(tile.monsters.empty?)\n # 50% chance of monster appearing\n monster_outcome = Random.rand(0..99)\n\n if (monster_outcome < 50)\n clone = tile.monsters[Random.rand(0..(tile.monsters.size-1))].clone\n battle(clone)\n end\n\n end\n\n describe_tile(self)\n end",
"def moved(player_position)\n if player_position = @location\n @player = false\n end\n end",
"def block\n winning_move(@opponent_mark) \n end",
"def move\n check_placed\n new_position = case facing\n when :north then @position.inc_y\n when :south then @position.dec_y\n when :east then @position.inc_x\n when :west then @position.dec_y\n end\n check_position(new_position)\n @position = new_position\n end",
"def moves_through!\n @moves_through = true\n end",
"def execute_move\n\t\traise RuntimeError, 'This must be implemented in child class'\n\tend",
"def move_player(member)\n refresh\n @move_update.clear if member.x == @x and member.y == @y\n @start_moving = false if @move_update.size <= 1\n return if moving?\n return unless need_update(member)\n move = @move_update.shift\n eval(move) if move != nil\n end",
"def walk\n if @headed_left\n move_left\n else\n move_right\n end\n end",
"def move_to(coordinates, map = @map)\n # Prevents operations on nil.\n return if map.nil?\n\n y = coordinates.first; x = coordinates.second\n\n # Save the map.\n @saved_maps[@map.name] = @map if @map\n\n # Even if the player hasn't moved, we still change to true.\n # This is because we want to re-display the minimap anyway.\n @moved = true\n\n # Prevents moving onto nonexistent and impassable tiles.\n return if !(map.in_bounds(y, x) && map.tiles[y][x].passable)\n\n @map = @saved_maps[map.name] ? @saved_maps[map.name] : map\n @location = coordinates\n tile = @map.tiles[y][x]\n\n update_map\n\n unless tile.monsters.empty?\n # 50% chance to encounter monster.\n if [true, false].sample\n clone = tile.monsters[Random.rand(0..(tile.monsters.size-1))].clone\n battle(clone)\n end\n end\n end",
"def update_nonmoving(last_moving)\r\n # If not moving\r\n unless moving?\r\n # If player was moving last time\r\n if last_moving\r\n update_encounter\r\n end\r\n update_action_trigger\r\n end\r\n end",
"def tryMove\n if @enemy\n collidesWithPlayer\n else\n collidesWithEnemy\n end\n detectCollision\n end",
"def lock_movements?\n true\n end",
"def move_rover()\n puts \"DEBUG: moving: #{@orientation}\" if DEBUG\n case @orientation\n when DIRECTION_EAST\n @position[:x] += 1 if @position[:x] < @map.width\n when DIRECTION_WEST\n @position[:x] -= 1 if @position[:x] > 0\n when DIRECTION_NORTH\n @position[:y] += 1 if @position[:y] < @map.height\n when DIRECTION_SOUTH\n @position[:y] -= 1 if @position[:y] > 0\n end\n puts \"DEBUG: position after move: #{@position}\" if DEBUG\n end",
"def tryMove\n #Resets the angle continuously to provide accurate data.\n @angle = Math.atan2(@y - @map.player.y, @x - @map.player.x) - Math::PI / 2\n #Sets axis of acceleration with relation to the direction.\n if @direction == 1\n @aceY = Math.sin(@angle - Math::PI / 2) / 4\n else\n @aceX = Math.cos(@angle - Math::PI / 2) / 4\n end\n #Adds acceleration to velocity.\n @velX += @aceX\n @velY += @aceY\n #Terminal velocity is 3.\n if @velX > 3\n velX = 3\n elsif @velX < -3\n velX = -3\n end\n #Checks for collision and moves the missile.\n collidesWithPlayer\n detectCollision\n end",
"def fast_dance(direction, tiles_hash)\n raise \"You can't move like that, oct :(\" if tiles_hash[direction] == nil\n tiles_hash[direction]\nend",
"def move_piece!(from_pos, to_pos)\n piece = self[from_pos]\n raise 'piece cannot move like that' unless piece.moves.include?(to_pos)\n\n piece.prev_pos = from_pos\n piece.moved_during_match ||= true\n\n self[to_pos] = piece\n self[from_pos] = nil\n piece.pos = to_pos\n\n nil\n end",
"def move(args)\n return if !@is_robot_availabe\n case @direction\n when \"NORTH\"\n if @pos_y + STEP <= TABLE_Y\n @pos_y += STEP\n return\n end\n \n when \"EAST\"\n if @pos_x + STEP <= TABLE_X\n @pos_x += STEP\n return\n end\n \n when \"SOUTH\"\n if @pos_y - STEP >= 0\n @pos_y -= STEP\n return\n end\n \n when \"WEST\"\n if @pos_x - STEP >= 0\n @pos_x -= STEP\n return\n end\n \n end\n puts \"Warning: Robot cannot move towards #{@direction} anymore. \"\n # return \"MOVE\" #for test\n end",
"def moves\n # overridden in slideable/stepable modules\n end",
"def make_move(left,top)\n # get destination selected\n dest = get_clicked_box(left,top)\n # try to make the move on the board; @game.user_move returns false if move is not allowed\n if @game.user_move(@selected_piece, dest)\n # move the piece on the GUI boars\n move_piece(@selected_piece,dest)\n de_highlight(@selected_piece)\n deselect_piece\n # switch player turn after the move\n @game.switch_turn\n else\n # if move not allowed deselect and de highlight the piece\n de_highlight(@selected_piece)\n deselect_piece\n end\nend",
"def MovingSomeShit(pos1, pos2)\n p = self[pos1]\n target = self[pos2]\n begin\n if p\n @moves = p\n if moves(pos2)\n if p && target\n Notice(p, target)\n else\n self[pos1], self[pos2] = self[pos2], self[pos1]\n end\n p\n return true\n end\n end\n end\n end",
"def update_move\n return unless @moving\n movinc = @move_speed == 0 ? 1 : @move_speed\n if Graphics.frame_count - @move_old > @move_delay or @move_speed != 0\n self.x += movinc if self.x < @destx\n self.x -= movinc if self.x > @destx\n self.y += movinc if self.y < @desty\n self.y -= movinc if self.y > @desty\n @move_old = Graphics.frame_count\n end\n if @move_speed > 1 # Check if sprite can't reach that point\n self.x = @destx if (@destx - self.x).abs % @move_speed != 0 and\n (@destx - self.x).abs <= @move_speed\n self.y = @desty if (@desty - self.y).abs % @move_speed != 0 and\n (@desty - self.y).abs <= @move_speed\n end\n if self.x == @destx and self.y == @desty\n @moving = false\n end\nend",
"def update_player_map\n @map.tiles[@location.first][location.second].seen = true\n #corners\n @map.tiles[@location.first + 1][@location.second - 1].seen = true\n @map.tiles[@location.first - 1][@location.second - 1].seen = true\n @map.tiles[@location.first + 1][@location.second + 1].seen = true\n @map.tiles[@location.first - 1][@location.second + 1].seen = true\n #cardinal directions\n @map.tiles[@location.first][@location.second + 1].seen = true\n @map.tiles[@location.first][@location.second - 1].seen = true\n @map.tiles[@location.first - 1][@location.second].seen = true\n @map.tiles[@location.first + 1][@location.second].seen = true\n\n #TODO Uncomment\n if !(@map.tiles[@location.first][location.second].monsters.empty?)\n here = @map.tiles[@location.first][location.second]\n #20% chance of monster appearing\n monster_outcome = Random.rand(here.monsters.size * 5)\n if (monster_outcome < here.monsters.size)\n system(\"clear\")\n battle(self, here.monsters[monster_outcome])\n end\n end\n end",
"def move(player, x, y)\n\n end",
"def move(*args)\n \t# Sending destination path\n \tputs \"MOVING\"\n \tmove_entity(*args[0].public_path)\n \tsuper\n end",
"def move_object_up(object)\n object.location_move_up unless is_wall?(object.location_up)\n end",
"def map_is_moving(opts = {})\n # puts \"map_is_moving #{opts}\"\n end"
] | [
"0.69359183",
"0.6908279",
"0.65862846",
"0.65085536",
"0.64431393",
"0.64431393",
"0.63592637",
"0.6269995",
"0.6250293",
"0.62378174",
"0.6220615",
"0.61999655",
"0.6195241",
"0.61748236",
"0.6166403",
"0.61662674",
"0.6129725",
"0.6120305",
"0.6120305",
"0.6104659",
"0.60579",
"0.6053777",
"0.6053316",
"0.6051121",
"0.60052955",
"0.60046065",
"0.5998174",
"0.5959207",
"0.59534943",
"0.5941069",
"0.5929729",
"0.59213084",
"0.5903662",
"0.59023327",
"0.5896518",
"0.5896214",
"0.58960474",
"0.58881724",
"0.58867675",
"0.58819354",
"0.5859613",
"0.58548725",
"0.58503735",
"0.58443743",
"0.58362186",
"0.583599",
"0.5830129",
"0.58245903",
"0.58232254",
"0.5813407",
"0.5811999",
"0.5810201",
"0.58031297",
"0.58031297",
"0.58022153",
"0.5801084",
"0.5777474",
"0.5776694",
"0.57680476",
"0.5763121",
"0.57603365",
"0.5755495",
"0.57518506",
"0.57506096",
"0.5739373",
"0.5739089",
"0.57373565",
"0.5736432",
"0.5735766",
"0.5726304",
"0.5725724",
"0.57227",
"0.5719931",
"0.56982267",
"0.569322",
"0.56910956",
"0.5687201",
"0.56811726",
"0.5674866",
"0.56634545",
"0.56632984",
"0.5658245",
"0.5640057",
"0.56357414",
"0.5634718",
"0.5633201",
"0.5631988",
"0.56292343",
"0.5627061",
"0.56206965",
"0.5618905",
"0.5617371",
"0.56120694",
"0.56109715",
"0.5596681",
"0.559622",
"0.55918926",
"0.55905455",
"0.55858195",
"0.55847454"
] | 0.65239 | 3 |
kick core websocket gameplay loop | def react!
@started_at = Time.now
EM.next_tick do
EM.add_periodic_timer(TICK_INTERVAL) do
@last_tick ||= 0
# puts "==== tick! last one was #{Time.now - @last_tick} ago"
@last_tick = Time.now
# moves = @next_moves
removals = @scheduled_removals.dup
removals.each do |entity|
entity_group = @entities.detect { |es| es.include?(entity) }
if entity_group
sockets.values.each do |s|
data = {depth: @entities.index(entity_group), entity_id: entity.guid }
transmit 'removal', data, s
end
end
puts ">>>> DELETING ENTITY"
entity_group.delete(entity) if entity_group
@scheduled_removals.delete(entity)
# recompute all fovs? (seems like we could at least limit to heroes on this level, but should really be a question of asking the heroes if the object is visible)
# timing of this could also be problematic
heroes.each { |h| h.build_fov_map }
end
# step!
@heroes.each { |h| h.update }
@next_moves.each do |entity, direction|
if move(entity, direction)
# entity.recompute_fov if entity.is_a?(Hero)
# end
# end
# moves.each do |entity, _|
sockets.values.each do |s|
if entity.is_a?(Roguecraft::Hero)
message_data = entity.attributes.merge({
visible: entity.now_visible,
invisible: entity.now_invisible
})
puts "=== currently visible: #{entity.now_visible.inspect}"
transmit 'move', message_data, s
end
end
end
end
@next_moves = {}
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def play socket\n end",
"def run(opts)\n\n EventMachine.run {\n @players = []\n @game = Game.new\n @turn_schedule = nil\n\n web_app = opts[:app]\n\n dispatch = Rack::Builder.app do\n map '/' do\n run web_app\n end\n end\n\n Rack::Server.start({\n app: dispatch,\n server: 'thin',\n Host: '0.0.0.0',\n Port: '8181'\n })\n\n EventMachine::WebSocket.start(:host => '0.0.0.0', :port => 8081) do |ws|\n ws.onopen do\n if @players.empty?\n @players << ws\n @players[0].send(JSON.dump(notification: \"Waiting for a challenger\", role_assign: 'x'))\n else\n @players << ws\n @turn_schedule = @players.cycle\n @turn_schedule.next\n @players[0].send(JSON.dump(unlock: true, notification: \"Now starting the game! Your move!\"))\n @players[1].send(JSON.dump(notification: \"Now starting the game! Please wait for your opponent to make their move\", role_assign: 'o'))\n end\n end\n ws.onclose do\n @players.each{|client| client.send(JSON.dump(notification: \"Your opponent has signed off\"))}\n end\n ws.onmessage do |msg|\n #parse the incoming string into JSON\n msg = JSON.parse(msg)\n @game.move(msg[\"role\"], msg[\"move\"].to_i)\n @turn_schedule.next.send(JSON.dump(opp_move: msg[\"move\"]))\n if message = @game.victor?\n @players.each{|player| player.send(JSON.dump(notification: message))}\n end\n end\n end\n }\n\nend",
"def start\n SocketController.init_game(self.users, self.id)\n end",
"def play\n while(true)\n system('clear')\n render_board\n board_update\n sleep(5)\n end\n end",
"def play\n \t@fragment = \"\"\n until @losses.keys.length == 1\n system(\"clear\")\n update_status\n play_round\n check_status\n puts \"Next round in 5 seconds...\".bold\n sleep(5)\n end\n final_status\n end",
"def run\n websocket.run\n end",
"def pong_everyone\n #log \"trying to pong\"\n if @sockets.length > 0 && !self.stopped?\n #log \"ponging\"\n broadcast_message(nil, \"PONG\", [build_handle_list])\n #sleep 5\n clean_handles\n end\n end",
"def pump_commands!\n loop do\n begin\n @socket.puts(@command_queue.pop)\n rescue StandardError # the player is deactivating\n @alive = false\n Thread.exit\n end\n end\n end",
"def game_loop\n end",
"def play\n\t\tgame_loop\n\tend",
"def play\n #turns = 0\n until over?\n turn\n end\nend",
"def run\n stop = false\n\n while not stop do\n frame_time = \"%10.6f\" % ((Time.now).to_f + @send_buffer_delay.to_f)\n stop = send \"frame start #{frame_time}\"\n\n if not Server.ships.nil?\n Server.ships.each do |ship|\n next if ship.dead?\n stop = send ship.output\n end\n end\n\n# $score.each do |s|\n# if rand(100) < 1\n# stop = send s[1].send_score(s[0], s[2], s[3])\n# end\n# end\n\n stop = send \"frame stop\"\n sleep 0.05\n end\n end",
"def guesser_ready(data)\n game = Game.find data['game_id']\n game.update status: 'playing'\n ActionCable.server.broadcast 'games', status: 'playing'\n end",
"def game_loop\n end",
"def main\r\n welcome\r\n process_cmd_line\r\n top_up_players\r\n\r\n play_game\r\n\r\n rescue Interrupt\r\n puts\r\n end",
"def perform_loop_step(message)\n puts \"message received: #{message}\"\n @turns_allowed = @turns_allowed -1\n if finished?\n perform_loop_update_for(Event.new(:killed, 'game over'))\n else\n perform_loop_update_for(message)\n end\n end",
"def run_game\n @num_players.times do\n accept_player_connection\n end\n\n loop do\n @players.each do |player_name,socket|\n socket.puts 'move'\n input = socket.gets\n if check_win(input)\n inform_players_of_win(player_name)\n report_results(player_name)\n @wrapper_connection.close\n return\n end\n end\n end\n end",
"def play\n\t# while $game_end == false\n\t\t9.times { \n\t\t\tif $game_end == false\n\t\t\t\tturns\n\t\t\tend\n\t\t}\nend",
"def run\n until game_over?\n # Get the next move from the player and update the game state.\n @board.play(get_valid_move,@players[0].sign)\n increment_turn\n end\n if(w = @board.win?)\n puts \"Game over #{w} wins!\"\n else\n puts \"Cat's game.\"\n end\n end",
"def play\n until board.king_in_checkmate?(:white) || board.king_in_checkmate?(:black) || board.stalemate?\n display.render\n input = get_start\n @board.piece_in_hand = @board[input]\n make_move(input)\n @board.switch_players!\n end\n display.render\n if board.king_in_checkmate?(:white)\n puts \"White is in Checkmate\\nBlack wins!\"\n elsif board.king_in_checkmate?(:black)\n puts \"Black is in Checkmate\\nWhite wins!\"\n else\n puts \"Stalemate!\"\n end\n rescue BadInputError, BadMoveError\n @board.drop_piece\n retry\n end",
"def play\n while true\n speel_game\n break unless speel_opnieuw?\n end\n puts \"Bedankt voor het spelen!\"\nend",
"def websocket; end",
"def websocket; end",
"def run\n start_game\n game_loop\n end_game\n end",
"def make_websocket\n require 'em-websocket'\n require 'sanitize'\n\nsoc = []\n\n\n\nEM::WebSocket.start(host: '10.20.4.130' , port: 4000) do |ws|\n\n ws.onopen{soc << ws;puts \"#{soc.length} clients present\";}\n ws.onmessage { |msg| ; soc.each do |s| \n msg = Sanitize.clean(msg.html_safe , :elements => %w(font) , :attributes => {'font' => ['color']})\n\t\t\t\ts.send(\"#{msg}\")\n\t\t\t\tend ; $redis.LPUSH 'msg', \"#{msg}\" }\n ws.onclose {puts \"Someone dissconected \" ; soc.delete(ws)}\n end\n end",
"def event_epoch()\n # Flush out idle clients, if any\n @clients.each do |_,client|\n if Time.now - client.var[:last_ping] > 300\n client.socket.close\n client = @clients.delete(client.socket)\n dispatch :connection_reset, client, \"ping timeout\"\n end\n end\nend",
"def play\n # unless the game is over players take turns\n take_turn until game_over?\n\n #start a new game if the game is over\n new_game_or_quit\n end",
"def play_game\n # WarAPI.play_turn()\n end",
"def play\n take_turn until @master.game_over?\n @master.show_board\n @robot.speak\n end",
"def wakeup!(client); end",
"def play\n puts \"#{name} got zoomies playing fetch!\"\n @hungry = true\n end",
"def heartbeat_loop\n loop do\n send_heartbeat\n sleep @heartbeat_interval\n next if @heartbeat_acked\n\n LOGGER.error { 'Heartbeat was not acked, reconnecting.' }\n @websocket.close\n break\n end\n end",
"def play\n\n until self.over?\n self.turn\n end\n\n if self.won?\n self.board.display\n puts \"Congratulations #{self.winner}!\"\n elsif self.draw?\n self.board.display\n puts \"Cat's Game!\"\n end\n end",
"def play\n until over? do\n turn;\n end\n\n if won?\n puts \"Congratulations #{winner}!\";\n replay\n elsif draw?\n puts \"Cat's Game!\";\n replay\n end\n end",
"def play\n\n until over?\n turn\n end\n\n if self.won?\n puts \"Congratulations #{self.winner}!\"\n elsif self.draw?\n puts \"Cat's Game!\"\n end\n\n end",
"def start\n @redis = Redis.new(:host => \"#{Settings.redis.host}\", :port => Settings.redis.port)\n\n \n Thread.new do\n EventMachine.run do\n \tputs '='*80, \"Starting websockets server at ws://#{Settings.websocket.host}:#{Settings.websocket.port}\", '='*80\n \n EventMachine::WebSocket.start(:host => \"#{Settings.websocket.host}\", :port => Settings.websocket.port) do |ws|\n ws.onopen do\n \n puts \"#{Time.now.strftime('%H:%M:%S')} : Client connected\", '-'*80\n SOCKETS << ws\n end\n\n ws.onclose do\n \n puts \"#{Time.now.strftime('%H:%M:%S')} : Client disconnected\", '-'*80\n SOCKETS.delete ws\n end\n end\n end\n end\n\n \n Thread.new do\n @redis.subscribe('ws') do |on|\n \n on.message do |chan, msg|\n \n puts \"#{msg}\"\n SOCKETS.each {|s| s.send msg} \n \n end\n end\n end\n\n sleep\n \n end",
"def play\n reset\n loop do\n break if @guesses == 0 || @win == true\n status_message\n enter_number\n evaluation_message\n end\n lose_message if @guesses == 0 && @win == false\n end",
"def start()\n while true\n @room = @room.play()\n end\n end",
"def kick(n, c, r)\n @socket << \"KICK #{c} #{n} :#{r}\"\n end",
"def run\n listen\n broadcast\n loop do\n sleep(10)\n @all_clients.each {|client| client.puts \"Krazy Joe #{KJ_VERBS.sample} #{KJ_POS.sample} #{KJ_NOUNS.sample}!\"} \n end\nend",
"def control_loop\n if stopping?\n unsubscribe!\n stopped!\n else\n attempt_recovery if paused?\n sleep(3)\n end\n end",
"def run_async\n # Handle heartbeats\n @heartbeat_interval = 1\n @heartbeat_active = false\n @heartbeat_thread = Thread.new do\n Thread.current[:discordrb_name] = 'heartbeat'\n loop do\n if @heartbeat_active\n send_heartbeat\n sleep @heartbeat_interval\n else\n sleep 1\n end\n end\n end\n\n @ws_thread = Thread.new do\n Thread.current[:discordrb_name] = 'websocket'\n\n # Initialize falloff so we wait for more time before reconnecting each time\n @falloff = 1.0\n\n loop do\n @should_reconnect = true\n websocket_connect\n\n break unless @should_reconnect\n\n if @reconnect_url\n # We got an op 7! Don't wait before reconnecting\n LOGGER.info('Got an op 7, reconnecting right away')\n else\n wait_for_reconnect\n end\n\n # Restart the loop, i. e. reconnect\n end\n\n LOGGER.warn('The WS loop exited! Not sure if this is a good thing')\n end\n\n debug('WS thread created! Now waiting for confirmation that everything worked')\n sleep(0.5) until @ws_success\n debug('Confirmation received! Exiting run.')\n end",
"def player_turn\n hit_loop(@player)\n end",
"def playGame\n \twhile not @players.empty?\n quitters = @rounds.playRound(@players)\n quitters.each do |player| # Remove quitters\n \[email protected](player)\n end\n @players.delete_if do |player| # Remove bankrupt players\n \tif player.isBankrupt\n \t printBankruptMessage(player)\n \t true\n \tend\n end\n end\n puts \"Game over. Thanks for playing! Byebye!\"\n end",
"def run\r\n Settings::DEFAULT_TRIGGERS.each_key{|k| load_trigger(k, true)}\r\n Settings::TRIGGERS.each_key{|k| load_trigger(k)}\r\n @socket = TCPSocket.open(self.server, self.port)\r\n\r\n $log.info(\"Initiating handshake with server...\")\r\n say \"USER #{nick} 0 * #{nick}\"\r\n say \"NICK #{nick}\"\r\n\r\n until @socket.eof? do\r\n msg = @socket.gets\r\n msg = (msg.split(\" \")[1] == \"PRIVMSG\" ? PrivateMessage.new(msg) : Message.new(msg))\r\n\r\n if msg.type == \"PRIVMSG\"\r\n cache_message(msg)\r\n fire_triggers(msg)\r\n end\r\n\r\n #keep alive\r\n if msg.parts[0] == \"PING\"\r\n say \"PONG :pingis\"\r\n else\r\n case msg.parts[1]\r\n when \"001\"\r\n $log.info(\"Processing connection to server...\")\r\n when \"376\"\r\n $log.info(\"Connected to server, joining channel...\")\r\n join_chan(self.chan)\r\n when \"366\"\r\n @in_chan = true\r\n $log.info(\"Successfully joined ##{self.chan}\")\r\n else\r\n end\r\n end\r\n #output to terminal window whatever the server is giving our socket\r\n $log.info(\"#{msg.stringify}\")\r\n end\r\n end",
"def play\n until over?\n turn\n end\n if winner\n puts \"Congratulations #{winner}!\"\n else\n puts \"Cats Game!\"\n end\n end",
"def run\n Lita.logger.debug 'Slack::run started'\n sleep\n rescue Interrupt\n Lita.logger.info 'Slack::shutting down'\n end",
"def connect_loop\n loop do\n @websocket.connect\n @websocket.thread.join\n break unless @should_reconnect.shift\n end\n end",
"def beginGameLoop\n @gameLoop.play\n end",
"def start_game\n # Infinite loop\n while\n # Draw the board on the terminal\n @board.print_board\n # Ask the player to choose where to draw the symbol\n @active_player.choose_spot\n # Check if the current player won\n if @board.check_win(@active_player.player_symbol)\n @board.print_board\n puts 'Has ganado'\n @active_player.victory\n # Ask if the player wants to play again\n play_again\n # If not, the loop is broken\n break\n else\n # Check if there is a draw\n if @board.check_draw\n puts 'Empate'\n play_again\n break\n end\n # If there isn't a draw the game switch the current player\n switch_player\n end\n end\n end",
"def play\n @hungry = true\n #p \"play method called\" #print notification to console\n end",
"def reactor_wakeup(client); end",
"def play()\n until over?() == true\n turn()\n end\n if draw?() != true\n puts \"Congratulations #{winner}!\"\n else\n puts \"Cat's Game!\"\n end\n end",
"def play\nturn until over?\nif won?\n puts \"Congratulations #{winner}!\"\nelsif draw? == true\n puts \"Game over! Thanks for playing.\"\nend\nend",
"def play\r\n turn until over?\r\n \r\n if won?\r\n puts \"Congratulations #{winner}!\"\r\n \r\n else\r\n puts \"Cat's Game!\"\r\n end\r\nend",
"def play\n until over? == true\n turn\n end\n\n if won? != false\n puts \"Congratulations #{winner}!\"\n else\n puts \"Cat's Game!\"\n end\n end",
"def play\n until self.over? do\n turn\n end\n\n if self.won?\n puts \"Congratulations #{self.winner}!\"\n elsif self.draw?\n puts \"Cat's Game!\"\n end\n end",
"def play\n start = Time.now\n until @board.won?\n @player ? round_player : round_ai\n @attempts += 1\n sleep(2)\n system(\"cls\")\n @board.render\n end\n finish = Time.now\n time_to_finish = finish - start\n declare_win(time_to_finish)\n end",
"def play_game\n loop do\n puts \"\\n\\n\"\n display_board\n player_turn\n check_game_status\n end\n end",
"def play\nuntil over? do\n turn\n end\nif won?\n puts \"Congratulations #{winner}!\"\nelsif draw?\nputs \"Cats Game!\"\nend\nend",
"def run\n\t stop = false\n\t\n\t while not stop do\n\t frame_time = \"%10.6f\" % ((Time.now).to_f + @send_buffer_delay.to_f)\n\t\tstop = send \"frame start #{frame_time}\"\n\n $items.each do |obj|\n next if obj.ship.dead?\n stop = send obj.output\n end\n\n\t $score.each do |s|\n\t if rand(100) < 1\n\t stop = send s[1].send_score(s[0], s[2], s[3])\n\t end\n\t end\n\n\t\tstop = send \"frame stop\"\n\t\tsleep 0.05\n\t end\n\tend",
"def play\n # counter = 0\n # until counter == 9\n # turn\n # counter += 1\n # end\n\n until over?\n turn\n end\n\n if won?\n puts \"Congratulations #{winner}!\"\n elsif draw?\n puts \"Cat's Game!\"\n end\n end",
"def play\n @hungry = true\n end",
"def play\n @hungry = true\n end",
"def play\n @hungry = true\n end",
"def unaway\n @socket << \"AWAY\"\n end",
"def start\n\t\tif @state == :READY\n\t\t\[email protected] do |p|\n\t\t\t\tputs \"#{p.username} starting game\"\n\t\t\t\tp.socket.send({\"startGame\" => true}.to_json)\n\t\t\tend\t\n\t\t\t@state = :PLAYING\n\t\tend\n\tend",
"def play_round \n @events.handle(:round) do\n reset_players\n\n take_bets\n deal\n play\n determine_winners\n \n @deck.reset!\n end\n end",
"def play\n until over?|| draw?\n @board = turn\n end\n unless winner.nil?\n puts \"Congratulations #{winner}!\"\n else\n puts \"Cat's Game!\"\n end\n end",
"def playGame()\n\n @@running = true\n setInput(nil)\n ipt = \"chompedinput\"\n\n broadcast(\"logging in ...\")\n\n # Login to ec2, start SSH session\n Net::SSH.start(@@host, @@user, password: @@password) do |session|\n\n broadcast(\"logged in!\")\n broadcast(\"obtaining pseudo terminal ...\")\n\n # Start the channel\n session.open_channel do |channel|\n\n # Get pseudo terminal\n channel.request_pty do |ch, success|\n if success\n broadcast(\"pty successfully obtained!\")\n ch.exec(\"./a.out\")\n else\n broadcast(\"could not obtain pty\")\n end\n end\n\n # Main loop\n # When channel has data via pty, print it\n channel.on_data do |ch, data|\n\n # allows for PTY data to buffer properly\n sleep(0.5)\n\n # Handler 1: Remove echoed input\n if ((@@input != \"\\n\") && (data.include? ipt))\n if (!data.include?(\"Quit\"))\n data = data.sub(ipt, \"\")\n end\n end\n\n # Handler 2: Check if data is empty, avoid extra user keystrokes\n if data.include?(\"out of money\")\n broadcast(\"#{data}\")\n getUserInput\n elsif (isEmpty(data) && @@input != \"\\n\")\n setInput(\"\\n\") \n elsif (!isEmpty(data) && (@@input == \"\\n\"))\n broadcast(\"#{data}\")\n if data.include?(\"does not have\")\n getUserInput\n end\n else\n if (!isEmpty(data))\n broadcast(\"#{data}\")\n end\n getUserInput\n end \n\n ipt = @@input\n if ipt != nil\n ipt = ipt.chomp\n end\n\n # When 2 is entered at main menu, trigger channel/sesion close\n if ((ipt == \"2\" || ipt == 2) && (data.include? \"Enter your selection (1-2)\")) || (!@@running)\n setInput(\"\\n\")\n channel.close()\n sleep(0.2)\n end\n\n channel.send_data(@@input) # Send input to PTY \n\n end # end on_data loop\n end # end channel block\n session.loop # Repeat session if processes running\n session.close()\n puts \"session.close called\"\n end # end SSH session\n end",
"def play\n until over?\n turn\n end\n\n if won?\n puts \"Congratulations #{winner}!\"\n elsif draw?\n puts \"Cat's Game!\"\n end\n end",
"def heartbeat\n end",
"def play_game\n @events.handle(:game) do\n until @players.empty?\n play_round\n\n # Remove the players that have no cash left.\n @players.reject! {|p| p.cash <= 0 }\n end\n end\n end",
"def play\n turn until over?\n if won?\n puts \"Congratulations #{winner}!\"\n else\n puts \"Cats Game!\"\n end\n end",
"def play\n until over? do\n turn\n end\n if draw?\n puts \"Cat's Game!\"\n else\n puts \"Congratulations #{winner}!\"\n end\nend",
"def kloop\n end",
"def play\n while !over?\n turn\n end\n if won?\n puts \"Congratulations #{winner}!\"\n else\n puts \"Cat's Game!\"\n end\n end",
"def start\n\t\tif @game_over\n\t\t\traise Exception.new(\"GAME #{@id} IS ALREADY OVER\")\n\t\tend\n\t\tplayer_number = 1\n\t\tloop do\n\t\t\t@game_over = player_turn @players[player_number], player_number\n\t\t\tplayer_number = player_number % 2 + 1\n\t\t\tbreak if @game_over\n\t\tend\n\tend",
"def game_over(data)\n ActionCable.server.broadcast 'games', status: 'finished'\n end",
"def play_game(game)\n\n\t\twhile game.totalHills > 1 and game.turn < 1000 \t\n\t \tgame.turn \n\t end\n\tend",
"def run\n begin\n @socket = TCPSocket.open(server, port)\n rescue => e\n puts \"An error occurred: #{e.message}\"\n exit 1\n end\n\n send 'USER ruben 0 * :Ruben'\n send \"NICK #{@nick}\"\n send \"JOIN ##{@channel}\"\n\n listen until @socket.eof?\n end",
"def play\n # letters to array [ [row, column, letter, points], [... ]\n letters = []\n params[:laid_letters].split('_').each_slice(4) do |ll|\n letters << [ll[0].to_i, ll[1].to_i, ll[2], ll[3].to_i]\n end\n logger.info '@@@@@@@@@@ ctrl letters: ' + letters.to_s\n\n # Check laying of letters\n @error = @turn.laid_oke(letters)\n if @error.blank?\n\n # Check the words\n @error = @turn.words_nok(letters)\n if @error.empty?\n\n # Update game and set next turn\n # @turn.started = Time.at( params[:js_start_time].to_i / 1000.0 )\n @turn.ended = Time.at(params[:js_time].to_i / 1000.0)\n # logger.info 'turn_ctrl - js_start_time: ' + @turn.started.to_s\n logger.info 'turn_ctrl - js_time: ' + @turn.ended.to_s\n @turn.update_turn(letters)\n @game.letters_to_board(letters)\n @turn = @game.goto_next(@turn) # @turn gets next_turn\n\n # to all players\n broadcast(letters)\n\n # Wrong words\n else\n render :play_error\n end\n\n # Laying not oke\n else\n render :play_error\n end\n # stop\n end",
"def start\r\n initialize_game\r\n until @game.over?\r\n take_turn\r\n end\r\n print_outcome\r\n end",
"def play\n # Game play asks for players input on a turn of the game\n # Game play checks if the game is over after every turn\n # Game play plays the first turn of the game\n # Game play plays the first few turns of the game\n # Game play checks if the game is won after every turn\n # Game play checks if the game is a draw after every turn\n while !over?\n turn\n end\n # Game play stops playing if someone has won\n # Game play congratulates the winner X\n # Game play congratulates the winner O\n if won?\n puts \"Congratulations #{winner}!\"\n # Game play stops playing in a draw\n # Game play prints \"Cat's Game!\" on a draw\n elsif draw?\n puts \"Cat's Game!\"\n end\n end",
"def goaway!\n goaway block: true\n end",
"def game_loop\n until win?\n who = turn(who)\n puts \"#{ who }'s turn\"\n piece = choose_piece\n move_coord = choose_square\n if piece.move(move_coord, who)\n @pieces = Piece.all\n Board.new(@pieces)\n else\n who = \"illegal\"\n end\n end\n end",
"def start_pong_loop\n Thread.new do\n loop do\n sleep 5\n # log \"pong all\"\n pong_everyone\n # log \"pong logsave\"\n save_chat_log\n end\n end\n end",
"def start_game\n\t\tself.game_is_started = true\n send_update\n end",
"def receive(websocket_message); end",
"def play\n until over?\n turn\n end\n\n if won?\n puts \"Congratulations #{winner}!\"\n\n else draw?\n puts \"Cat's Game!\"\n\n end\n end",
"def play\n while !over?\n \t turn\n end\n if won?\n \t puts \"Congratulations \"+ winner() +\"!\"\n else\n \t puts \"Cat's Game!\"\n end\n end",
"def play\n\t\t@current_turn = 0\n\t\t@current_player = @hunter\n\t\tplayers.each{|p| p.write(game_parameters)}\n\t\tuntil is_game_over?\n\t\t\tpre_turn_wall_count = @walls.size\n\t\t\treport_state_to_spectators\n\t\t\t@current_player.take_turn\n\t\t\t# Only print the board every 10 turns or if a wall was added or removed\n\t\t\tprint_minified_board() if @current_turn%10 == 0 || @walls.size != pre_turn_wall_count\n\t\t\tadvance_turn!\n\t\t\tprint \"#{@current_turn} \"\n\t\tend\n\t\tresult = report_winner\n\t\tcleanup_players!\n\t\tcleanup_spectators!\n\t\tresult\t# Returns this so the EvasionServer can save results\n\tend",
"def play\n while !over?\n turn\n end\n\n if won?\n puts \"Congratulations #{winner}!\"\n elsif draw?\n puts \"Cat's Game!\"\n end\n end",
"def play\n while !over?\n turn\n end\n if won?\n puts \"Congratulations #{ winner }!\"\n elsif draw?\n puts \"Cat's Game!\"\n else\n puts \"Game over\"\n end\n end",
"def start_a_game\n jeopardy_board\n play_game\nend",
"def play_loop\n puts \"Welcome to our game of Chess.\"\n puts \"You make moves by typing in the coordinate that you wish to move from, followed by the coordinate you're moving to\"\n\n turn = :white\n\n until board.checkmate?(turn)\n white_turn = turn == :white\n player = white_turn ? @white : @black\n puts self.board\n puts \"#{turn.to_s.capitalize}'s turn\".bold\n begin\n input = player.play_turn\n\n case input[:action]\n when :save\n save\n when :load\n load\n else\n board.is_color?(input[:start_pos],turn)\n self.board.move(input[:start_pos], input[:end_pos])\n end\n rescue InvalidMoveException => e\n puts e.message\n retry\n end\n turn = white_turn ? :black : :white\n end\n\n if board.checked?(:black)\n puts \"Checkmate! White Wins!\".bold\n elsif board.checked?(:white)\n puts \"Checkmate! Black Wins!\".bold\n else\n puts \"Stalemate. No one wins!\".bold\n end\n end",
"def game_loop\n again = true\n\n while again\n bet\n deal\n player_action\n dealer_action\n reveal_final_hand\n print_player_outcomes\n remove_players\n\n again = play_again?\n linebreak\n end\n\n exit_message\n\n end",
"def play\n\t\t\twhile !win && @turns < TURNS\n\t\t\t\tturn\n\t\t\tend\n\t\t\t# counter increments at start of turn, so must be less than max turns\n\t\t\tif win\n\t\t\t\tplay_again\n\t\t\telse\n\t\t\t\tputs \"\\n Sorry, you ran out of turns. The word was #{@secret_word}\"\n\t\t\t\tplay_again\n\t\t\tend\n\t\tend",
"def play\n until over?\n @board.display\n turn\n end\n @board.display\n puts draw? ? \"Cat's Game!\" : \"Congratulations #{winner}!\"\n end",
"def run\n until @socket.eof? do\n line = @socket.gets\n\n # Makes sure your bot doesn't timeout!\n if line.match(PING_MSG)\n say \"PONG #{ $~[1]}\"\n else\n bot_main(line)\n end\n end\n end",
"def play\n board_setup\n gameplay_setup\n end"
] | [
"0.6592833",
"0.63241875",
"0.62373143",
"0.6120532",
"0.6092128",
"0.604287",
"0.601848",
"0.60132366",
"0.6001739",
"0.5999792",
"0.5985935",
"0.59695977",
"0.5931094",
"0.59282905",
"0.5926197",
"0.59178203",
"0.5895238",
"0.5869406",
"0.5854603",
"0.5841808",
"0.5831969",
"0.5817005",
"0.5817005",
"0.58128697",
"0.5806067",
"0.5803678",
"0.57995075",
"0.5793161",
"0.57695454",
"0.5765262",
"0.57610184",
"0.5751396",
"0.5735782",
"0.57297766",
"0.57253313",
"0.57071686",
"0.56979585",
"0.5696548",
"0.5695932",
"0.56948864",
"0.5686551",
"0.56848246",
"0.5681442",
"0.56692755",
"0.5668136",
"0.56496805",
"0.56484",
"0.5638702",
"0.5637147",
"0.5633617",
"0.56274533",
"0.5624883",
"0.56220895",
"0.56184494",
"0.5611861",
"0.5611601",
"0.5596525",
"0.55959177",
"0.5589733",
"0.5589373",
"0.5587247",
"0.558717",
"0.5585623",
"0.5585623",
"0.5585623",
"0.5582395",
"0.5581621",
"0.5580045",
"0.55750966",
"0.55711406",
"0.556988",
"0.55632806",
"0.55610085",
"0.5560454",
"0.55597985",
"0.5556158",
"0.5555447",
"0.55456996",
"0.5541908",
"0.5535406",
"0.55299056",
"0.5528823",
"0.55212647",
"0.5520673",
"0.5516998",
"0.551604",
"0.5511398",
"0.55092037",
"0.5504681",
"0.5497839",
"0.549659",
"0.5495922",
"0.5490782",
"0.5485756",
"0.54840684",
"0.54837936",
"0.54803324",
"0.5480106",
"0.54790545",
"0.54779816",
"0.547027"
] | 0.0 | -1 |
scan for a pattern in a snippet, for each pattern found, assign the last word from rand_words array, to names variable (capitalize only if caps = true) | def craft_names(rand_words, snippet, pattern, caps=false) # caps defaults to false
names = snippet.scan(pattern).map do
word = rand_words.pop()
caps ? word.capitalize : word
end
return names * 2 # return the names variable twice as an array
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def craft_names(rand_words, snippet, pattern, caps = false)\n\tnames = snippet.scan(pattern).map do\n\t\tword = rand_words.pop()\n\t\tcaps ? word.capitalize : word\n\tend\n\t\n\treturn names * 2\t\nend",
"def craft_names(rand_words, snippet, pattern, caps=false)\nnames = snippet.scan(pattern).map do\n word = rand_words.pop()\n caps ? word.capitalize : word\nend\n\nreturn names * 2\nend",
"def craft_names(rand_words, snippet, pattern, caps=false)\n names = snippet.scan(pattern).map do\n word = rand_words.pop()\n caps ? word.capitalize : word\n end\n# unsure as to why 2 names are returned\n return names * 2\nend",
"def craft_params(rand_words, snippet, pattern)\n names = (0...snippet.scan(pattern).length).map do\n param_count = rand(3) + 1\n params = (0...param_count).map {|x| rand_words.pop() }\n params.join(', ')\n end\n\n return names * 2\nend",
"def craft_params(rand_words, snippet, pattern)\n names = (0...snippet.scan(pattern).length).map do\n param_count = rand(3) + 1\n params = (0...param_count).map {|x| rand_words.pop() }\n params.join(',')\n end\n\n return names * 2\nend",
"def craft_params(rand_words, snippet, pattern)\n\n# In the name variable for each number in the expression defined by\n# the range 0...snippet.scan(pattern).length do the following operations\n\tnames = (0...snippet.scan(pattern).length).map do\n\n# The number of parameters is randomly chosen\n\t\tparam_count = rand(3) + 1\n\t\t\n# Once the number is chosen then an array of that length is created\n# with random words\n\t\tparams = (0...param_count).map {|x| rand_words.pop() }\n\n# That array is joined together\n\t\tparams.join(', ')\n\tend\n\n# the variable is returned. It's into two because the substitution is \n# performed twice once for the code and the second time for the english!\n\treturn names * 2\nend",
"def generate\n while chars_left > 0\n word << sample_syllable\n normalize! if normalize\n end\n return @word.capitalize\n ensure\n cleanup!\n end",
"def rand_title_three\n Array.new(4) do\n rand_word(5).capitalize + ' '\n end.join(' ').rstrip!\nend",
"def word_picker\n dictionary = File.readlines('lib/5desk.txt')\n word = dictionary.sample(1)[0].chomp.downcase\n word = dictionary.sample(1)[0].chomp.downcase until word.length.between?(5, 12)\n word\n end",
"def catch_phrase\n translate('faker.company.buzzwords').collect { |list| sample(list) }.join(' ')\n end",
"def catch_phrase\n translate('faker.company.buzzwords').collect {|list| list.sample }.join(' ')\n end",
"def extract_names(content)\n names = []\n \n # Split content into words.\n words = content.split(/[^-_a-z0-9]+/i).select {|v| v.index(/^[-a-z]+$/i)}\n \n # Loop over each bigram and check if the words are title cased and if at\n # least one of the words is a first or last name.\n words.each_with_index do |first_name, index|\n surname = full_surname = words[index+1] || ''\n \n # Skip to the next word if we have a couple of the next words.\n if ['van', 'von'].index(surname)\n surname = words[index+2] || ''\n full_surname = \"#{full_surname} #{surname}\"\n end\n \n # Only look at two words that are titlecase and neither one is a stopword.\n next if !first_name.titlecase? || !surname.titlecase?\n next if !stopwords.index(first_name.upcase).nil? || !stopwords.index(surname.upcase).nil?\n \n # Check if either the first name or last name is a recognized common name.\n if Matlock::Data.first_name?(first_name) || Matlock::Data.surname?(surname)\n full_name = \"#{first_name} #{full_surname}\"\n names << full_name if names.index(full_name).nil?\n end\n end\n \n return names\n end",
"def next_words_for(word) \n if word.nil? or word.empty?\n generator_names \n else\n name_of_last_generator_inverse = word[-1].swapcase\n generator_names.find_all{|name| name != name_of_last_generator_inverse }.map{|name| word + name }\n end\n end",
"def word_substituter(tweet)\n newtweet = tweet.split \n dictionary.each do |phrase, subs|\n newtweet.map! do |word|\n if word == phrase\n word = subs\n elsif \n word == phrase.capitalize\n word = subs\n else \n word = word\n end\n end\n end \n newtweet.join(\" \")\nend",
"def create_title(inWord)\n\ti = 0\n\n\t# First word of the title is the seed\n\tnew_title = inWord\n\n\t# Next word is the most common word following the seed\n\tnext_word = mcw(inWord)\n\n\t# Track if a word has already been used\n\tword_pattern = Hash.new(0)\n\n\t# Add initial words\n\tword_pattern[inWord] += 1\n\tword_pattern[next_word] += 1\n\n\t# Create list of available words\n\tkeys = $bigrams.keys\n\n\tstop_flag = false\n\twhile !stop_flag and not next_word.nil? do\n\t\tnew_title += \" \" + next_word\n\t\tnew_word = mcw(next_word)\n\n\t\t# Check if next word has already been used\n\t\tif word_pattern[new_word] > 0\n\t\t\t# If word has already been used terminate song title to prevent repeating pattern\n\t\t\tword_possibilites = $bigrams[next_word]\n\n\t\t\t# Select key out of subsequent words\n\t\t\tnext_word_list = word_possibilites.keys\n\t\t\tnext_word = next_word_list[rand(next_word_list.length)]\n\t\t\t#stop_flag = true\n\t\tend\n\n\t\t# Add next word to list of used words\n\t\tword_pattern[next_word] += 1\n\t\ti += 1\n\tend\n\n\treturn new_title\nend",
"def random_capitalized_word\n attempts = 0\n # If you don't find a capitalized word after 15 attempts, just use\n # a lowercase word as there may be no capitals in the dicationary.\n until attempts > 15\n attempts += 1\n words = @dictionary.dictionary.keys\n random_choice = words[rand(words.length)]\n if random_choice[0] =~ /[A-Z]/\n return random_choice\n end\n end\n random_word\n end",
"def make_word\n @secret_word = File.readlines('dictionary.txt').sample.chomp.downcase.split('')\n @working_word = Array.new(@secret_word.length) { \"_\" }\n end",
"def titleize\n arr = %w(a an the by to)\n upcase_arr = %w(DX EDA AEDG LPD COP)\n r = gsub('_', ' ').gsub(/\\w+/) do |match|\n match_result = match\n if upcase_arr.include?(match.upcase)\n match_result = upcase_arr[upcase_arr.index(match.upcase)]\n elsif arr.include?(match)\n match_result = match\n else\n match_result = match.capitalize\n end\n match_result\n end\n\n r\n end",
"def summon_captain_planet(array)\n array.collect { |word| word.capitalize + \"!\" }\nend",
"def titleize(par)\n littleWords = [\"and\",\"over\",\"the\"]\n par.capitalize.split.map do |x|\n /(and|over|the)/.match(x) ? x : x.capitalize\n end.join(' ')\nend",
"def underscore_vars\r\n self.gsub(/\\b[a-z][a-z]*(?:[A-Z][a-z]*)(?:[A-Z][a-z]*)*\\b/) {|word|\r\n word.underscore\r\n }\r\n end",
"def rand_title_two\n 5.times.map do\n rand_word(8).capitalize + ' '\n end.join(' ').rstrip!\nend",
"def random_word(random_generator:, random_capitalize: true) # :nodoc:\n random_word = WORDSET[random_bits(random_generator: random_generator, n_bits: log2(WORDSET.length))].dup\n random_word.capitalize! if random_capitalize && (random_bits(random_generator: random_generator, n_bits: 1) == 1)\n random_word\n end",
"def choose_code_word\n dictionary = []\n File.readlines(\"word_list.txt\").each do |word|\n if word.length > 4 && word.length < 13\n dictionary.push(word.strip.downcase)\n end\n end\n @code_word = dictionary[rand(dictionary.length)]\n end",
"def get_the_word\n words = File.readlines(\"5desk.txt\")\n words = words.map do |word|\n word.strip\n end\n words = words.select do |word|\n (word.length > 4) && (word.length < 13)\n end\n words.sample.upcase.split(\"\")\n end",
"def select_word\n @answer = \"\"\n @word = \"\"\n while not is_valid?\n @word = IO.readlines(\"../5desk.txt\")[rand(61405)].chomp\n end\n @word.downcase!\n puts @word\n @word.scan(/./){@answer << '*'}\n puts @answer\n end",
"def stuff(input)\n\twords = input.split(\" \")\n\n\twords.each do |x| \n\t\tif x == 'the' || x == 'of' || x == 'and' || x == 'is' || x == 'a'\n\t\t\telse\n\t\t\t\t@acronym << x.to_s.chars.first.upcase + \".\"\n\t\tend\n\tend\nend",
"def titleize(phrase)\n little_words = ['the','a', 'an', 'and'] # Définition des little_words\n return phrase.split.map.with_index {|word, i| if (little_words.include?(word) && i!=0) then word else word.capitalize end}.join(\" \") # Met en majuscule toutes les première lettres de chaques mots en excluant les little_words qui ont un indice différent de 0\nend",
"def word_substituter(tweet) \n tweet_array = tweet.split\n \n # Iterate through tweet array, comparing with dictionary\n tweet_array.collect! do |word|\n dictionary().each do |key,val|\n if word == key || word == key.capitalize\n word = val\n end\n end\n word\n end\n \n # Convert array back to string\n tweet_array.join(\" \")\nend",
"def titleize(word)\n words = word.split(\" \")\n little_words = [\"and\", \"or\", \"the\", \"but\", \"over\"]\n first_word = words.first\n\n words.each do |word|\n banned_word = false\n\n # Check if the word is a little word \n little_words.each do |banned|\n if(banned == word)\n banned_word = true\n end\n end\n\n # If its the first word of the title or not a banned word it can be capitalized\n if((first_word == word) || (banned_word == false))\n word.capitalize!\n end\n end\n words.join(\" \")\nend",
"def suggest_def_name(how)\n how.gsub!(/_+/,'_') # double underscores to one\n how.gsub!(/^_/, '') # if it begins with undrscore kill it.\n how.gsub!(/\\s+/, '_') # kill spaces if for some strange reason exist\n how = how[0,1].downcase << how[1,how.size] #downcase firs char\n end",
"def guess(word_pattern, possible_words)\n all_words = possible_words.flatten\n guess = $avail_letters.sort_by {|c|\n all_words.select{|w|w.index c}.length}.last\n $avail_letters -= [guess]\n $guess = guess\nend",
"def word_substituter(tweet)\n tweetarr = tweet.split(' ')\n newtweet = []\n tweetarr.each do |word|\n if dictionary.key?(word.capitalize) \n newtweet << dictionary[word.capitalize].to_s\n \n else \n newtweet << word\n end\n \n end\n tweetstr = newtweet.join(' ')\n \n return tweetstr\nend",
"def getHighestAbilityLetterFrom pattern\n remainWords = []\n @currentBucket.each {|bucketWord|\n remainWords += [bucketWord] if pattern.match(bucketWord)\n }\n remainWords.each{|word|\n remainWords.delete word if (word.chars - @incorrectWord) != word.chars\n }\n remainWords = checkNewWords {|word| pattern.match(word)} if remainWords == []\n @currentBucket = remainWords\n\n dict = statisticLetter remainWords\n @missingWord.each {|letter| dict.delete letter}\n getSortListFrom dict\nend",
"def name_shuffle(str)\n\t#creates an array with each word as an element\n\tstr = str.split\n\t#reverse the order of the array, last being first\n\t#first being last\n\tstr = str.reverse()\n\t#creates a string from the array, joining the words\n\t#with a space\n\tstr = str.join(\" \")\n\t#returns the string\n\treturn str\nend",
"def get_word\n\t\tselection = IO.readlines(\"colors.txt\")\n\t\t@word = selection[rand(selection.length)].downcase.chomp\n\t\t@word_array= @word.chars.to_a\n\t\tputs \"Here's the word cheaty, #{@word.upcase}\"\n\tend",
"def summon_captain_planet(arr)\n arr.map {|word| word.capitalize + \"!\"}\nend",
"def get_word\n words = File.readlines(\"lib/5desk.txt\")\n words.each { |word| word.chomp! }\n words_list = words.select { |word| word.length.between?(5, 12)}\n\n words_list.sample.downcase.split(\"\")\n end",
"def create_title2(word)\n\treturn_title = word\n\ttemp = word\n\t# Use randomness to create a title\n\twhile rand_word(temp) != nil\n\t\treturn_title += \" \" + rand_word(temp)\n\t\ttemp = rand_word temp\n\tend\n\treturn return_title\nend",
"def selectWord\n\twords = [\n\t\t\"anvil\",\n\t\t\"black\",\n\t\t\"break\",\n\t\t\"clear\",\n\t\t\"doubt\",\n\t\t\"exist\",\n\t\t\"first\",\n\t\t\"girth\",\n\t\t\"heart\",\n\t\t\"icons\",\n\t\t\"joker\",\n\t\t\"loath\",\n\t\t\"mirth\",\n\t\t\"notch\",\n\t\t\"overt\",\n\t\t\"print\",\n\t\t\"qualm\",\n\t\t\"react\",\n\t\t\"solid\",\n\t\t\"trick\",\n\t\t\"until\",\n\t\t\"viola\",\n\t\t\"water\",\n\t\t\"young\",\n\t\t\"zebra\"\n\t]\n\treturn words[Random.rand(words.length)]\nend",
"def choose_word\n word_index = 0\n loop{\n word_index = rand(@text_file.length.to_i)\n if @text_file[word_index].length.to_i > 4 && @text_file[word_index].length.to_i < 12\n break\n end\n }\n @word = @text_file[word_index]\n end",
"def take_turn(pattern)\n\t\tpossible_words = expressions(pattern).map do |e|\n\t\t\tRegexp.new(\"^#{e}$\")\n\t\tend.map do |e|\n\t\t\tpossible_words(e, @letters)\n\t\tend\n\n\t\tguess = (best_letters(possible_words.flatten.uniq) & @letters).first\n\n\t\t@played_letters += [guess]\n\t\t@letters -= [guess]\n\t\tguess\n\tend",
"def test_words(words, last_word)\n repetitions = []\n\n words.each do |w|\n w = w.downcase\n repetitions.push(w) if w == last_word\n last_word = w\n end\n\n [repetitions, last_word]\nend",
"def output_random_group_order(collection) \n # group.shuffle.each bringing in collection as arguement\n collection.shuffle.each_with_index do |name, index| # adding collection because arguement variable\n puts \"#{index +1}. #{capitalize_multi_word_string(name)}\".colorize(select_random_color)\n # we're calling above and linking to bottom captialize_multi_word_string method instead of...\n # puts name.capitalize \n sleep(1) # wait until\n ESpeak::Speech.new(name).speak #takes in a string, the name. takes a speech object\n end\nend",
"def choose_word\n input = File.open(\"words.txt\", 'r')\n words = []\n input.readlines.each do |line|\n words.push(line.strip().downcase)\n end\n input.close()\n words[rand(words.length)]\n end",
"def join_multi_word_names(author_text)\n author_text.gsub(/\\b((?:van|von|der|den|de|di|le|el))\\s/si) {\n \"#{$1}_\"\n }\n end",
"def word_substituter(tweet)\n tweet.split.collect do |word|\n if dictionary.keys.include?(word.downcase)\n word = dictionary[word.downcase]\n else\n word\n end\n end.join(\" \")\nend",
"def titleize(s)\n#Nous créons un tableau avec tous les petits mots “end” ‘and’ ‘the’\nl_w = %w(end and the)\n\n#On met en majuscule chaque première lettre des mots entrées\nreturn s.capitalize.gsub(/(\\w+)/) do |word|\n#Met en maj les mots qui ne sont pas dans le tableau l_w\n l_w.include?(word) ? word : word.capitalize\n end\n end",
"def guess(word_pattern, possible_words)\r\n all_words = possible_words.flatten\r\n guess = $avail_letters.sort_by {|c|\r\n all_words.select{|w|w.index c}.length}.last\r\n $avail_letters -= [guess]\r\n $guess = guess\r\nend",
"def word_substituter(tweet)\n tweet.split.map { |word| \n dictionary[word.downcase] || word }.join(\" \")\n end",
"def create_title (word)\n\tp_title = word + ' '\n\tindex = 0\n\t#do until word key does not exist\n\twhile mcw(word) != -1\n\t\tp_array = p_title.split\n\t\tword = mcw(word)\n\t\t#If the sentence already contains word, break\n\t\tbreak if p_array.include? word\n\t\tp_title = p_title + word + ' ' #Concatenate new word to sentence\n\t\tindex += 1\n\tend\n\tp_title.gsub!(/\\s$/, '') #remove trailing whitespace\n\treturn p_title\nend",
"def titleize (string)\nstring.capitalize! # capitalize the first word in case it is part of the no words array\n words_no_cap = [\"and\", \"or\", \"the\", \"over\", \"to\", \"the\", \"a\", \"but\"]\n phrase = string.split(\" \").map {|word| \n if words_no_cap.include?(word) \n word\n else\n word.capitalize\n end\n }.join(\" \") # I replaced the \"end\" in \"end.join(\" \") with \"}\" because it wasn't working in Ruby 2.1.1\n phrase # returns the phrase with all the excluded words\nend",
"def title_case(title, minor_words = \"\")\n if title == nil\n return nil\n else \n minor_words_array = minor_words.split(' ').map do |word|\n word.downcase\n end \n title_array = title.split(\" \").map do |word|\n word.downcase\n end \n titled = title_array.map do |word| \n if !minor_words_array.include?(word)\n word.capitalize \n else \n word.downcase \n end\n end \n titled[0] = titled[0].capitalize \n titled.join(\" \")\n binding.pry\n end\nend",
"def join_multi_word_names(author_text)\n author_text.gsub(/\\b((?:van|von|der|den|de|di|le|el))\\s/i) {\n \"#{$1}_\"\n }\n end",
"def get_word\n word = @word_list[rand(@word_list.length)]\n @word = word.gsub(/\\s+/, \"\").downcase\n end",
"def chooseRandomWord() \n @randomWord = @wordsList[rand([email protected])]\n @randomWord.downcase\n \n #adding \"_\" to the letters array to display during the game\n randomWordSize = @randomWord.size - 1\n (1..randomWordSize).each do |i| \n @lettersDisplayArr.push(\" _ \")\n \n end\n beginGame()\n end",
"def word_substituter (tweet=\"some thing need to be shorten, like two too\")\n tweet= tweet.strip\n temp_a = tweet.split(\" \")\n words_can_b_sh = dictionary.keys\n #puts words_can_b_sh\n temp = \"\"\n# puts temp_a\n temp_a.each do |word|\n if words_can_b_sh.include?(word.downcase)\n temp << dictionary[word.downcase]\n else\n temp << word\n end\n temp << \" \"\n end\n temp.strip\nend",
"def title_case(string)\n no = 0\n no_cap = [\"a\",\"an\",\"the\",\"with\",\"and\",\"but\",\"or\",\"on\",\"in\",\"at\",\"to\"]\n split = string.split.map! do |word|\n no += 1\n if no < 2\n word.downcase.capitalize\n elsif word[0] == \"*\"\n word.sub!(\"*\",\"\")\n elsif word.include?('-')\n word.split('-').each{|i| i.capitalize!}.join('-')\n elsif no_cap.include?(word.downcase)\n word.downcase\n else\n word.capitalize\n end\n end\n split.join(' ')\nend",
"def titleize(title)\n\n word = title.split(\" \")\n\n cap = []\n\n word.each do |letters|\n\n #checking for specific words/conditions\n #simplest/most readable means to implement\n #could also have each word in an array and check against the array\n if letters == \"i\"\n cap << letters.capitalize\n elsif letters == \"day\"\n cap << letters.capitalize\n elsif letters == \"eat\"\n cap << letters.capitalize\n elsif letters == \"man\"\n cap << letters.capitalize\n elsif letters.length >= 4 and word.index != 0\n cap << letters.capitalize\n else\n cap << letters\n end\n\n end\n\n\n#making sure that every first word is capitalized\n cap[0] = cap[0].capitalize\n\n#making sure that \"Over\" is not capitalized\n#this is not optimal nor dyanmic, and needs to\n#be improved upon\n\n if cap[2] == \"Over\"\n cap[2] = \"over\"\n end\n\n#putting everything back together for the return\n cap = cap.join(' ')\n cap = cap.to_s\n return cap\n end",
"def set_word\n dic = File.read(\"dic.txt\").downcase.split\n dic.reject! {|word| word.length<5 || word.length>12}\n word = dic.sample\n end",
"def humanize(lower_case_and_underscored_word)\n result = lower_case_and_underscored_word.to_s.dup\n\n inflections.humans.each { |(rule, replacement)| break if result.gsub!(rule, replacement) }\n result.gsub(/_id$/, \"\").gsub(/_/, \" \").capitalize\n end",
"def humanize(lower_case_and_underscored_word)\n result = lower_case_and_underscored_word.to_s.dup\n\n inflections.humans.each { |(rule, replacement)| break if result.gsub!(rule, replacement) }\n result.gsub(/_id$/, \"\").gsub(/_/, \" \").capitalize\n end",
"def words_to_skip_capitalization_of\n\t\t[ \n\t\t'of','a','the','and','an','or','nor','but','if','then','else','when','up','at','from','by','on',\n\t\t'off','for','in','out','over','to'\n\t\t]\n\tend",
"def titleize(text)\n little_word = [\"and\", \"the\"]\n text.gsub(/[[:alpha]]+/) { |x| little_word.include?(x) & (Regexp.last_match.begin(0)> 0)? x : x.capitalize\n }\n\nend",
"def word_substituter(tweet)\n tweet.split(\" \").map do |word| # 1\n if dictionary.keys.include?(word.downcase)\n word = dictionary[word.downcase] # 2\n else\n word\n end\n end.join(\" \") # 3\nend",
"def choose_word\n @word = @lines[rand(0..(@lines.length - 1))].chomp\n choose_word if @word.length < 5 || @word.length > 12\n end",
"def word\n options = []\n case @theme\n when \"default\"\n options = [\"cast\", \"puppy\", \"pineapple\", \"bananas\"]\n @word_to_guess = options.sample\n when \"food\"\n options = [\"mango\", \"papaya\", \"guava\", \"apples\", \"lychee\"]\n @word_to_guess = options.sample\n when \"hacker\"\n options = [\"bandwidth\", \"synthesize\", \"bypass\", \"cyberpunk\", \"firewall\"]\n @word_to_guess = options.sample\n when \"game of thrones\"\n options = [\"stark\", \"lannister\", \"arya\", \"hodor\", \"meereen\"]\n @word_to_guess = options.sample\n when \"lord of the rings\"\n options = [\"lothorien\", \"galadriel\", \"frodo\", \"bombadil\", \"goldberry\"]\n @word_to_guess = options.sample\n end\n end",
"def analyze_name(tool_class, words)\n loader = tool_class.instance_variable_get(:@__loader)\n subtool_words = tool_class.instance_variable_get(:@__words).dup\n next_remaining = tool_class.instance_variable_get(:@__remaining_words)\n loader.split_path(words).each do |word|\n word = word.to_s\n subtool_words << word\n next_remaining = Loader.next_remaining_words(next_remaining, word)\n end\n [subtool_words, next_remaining]\n end",
"def titleize_wow(name)\n lowercase_words = %w{a an the and but or for nor of}\n name.split.each_with_index.map{|x, index| lowercase_words.include?(x) && index > 0 ? x : x.capitalize }.join(\" \")\nend",
"def remove_words(line)\n line.split(' ').map do |word|\n rand <= 0.3 ? '_' * word.size : word\n end.join(' ')\nend",
"def words_to_skip_capitalization_of\n [\n 'of','a','the','and','an','or','nor','but','if','then','else','when','up','at','from','by','on',\n 'off','for','in','out','over','to'\n ]\n end",
"def word_substituter(string)\ntweet=string.split(\" \")\ni = 0 \nwhile i < tweet.length \nif dictionary.keys.include?(tweet[i].downcase)\ntweet[i] = dictionary[tweet[i].downcase]\nend \ni+=1\nend\ntweet.join(\" \")\nend",
"def pick_random_word\n random_word = @words.sample.gsub!(/\\s+/, \"\")\n end",
"def generate(wordcount)\n if @dictionary.dictionary.empty?\n raise EmptyDictionaryError.new(\"The dictionary is empty! Parse a source file/string!\")\n end\n sentence = []\n sentence.concat(random_capitalized_word)\n (wordcount-1).times do\n word = weighted_random(sentence.last(@depth))\n if punctuation?(word)\n sentence[-1] = sentence.last.dup << word\n sentence.concat(random_capitalized_word)\n elsif word.nil?\n sentence.concat(random_capitalized_word)\n else\n sentence << word\n end\n end\n sentence.pop(sentence.length-wordcount)\n sentence.join(' ')\n end",
"def bulk_tweet_shortener(array)\n replace= []\n \n array.each do |string|\n replace << string.split.each do |word| \n if dictionary.has_key?(\"#{word}\") == true\n word.replace(dictionary[\"#{word}\"])\n else word\n end\n end\n \n end \n\n replace.collect do |tweet| puts tweet.join(\" \") end\nend",
"def get_acronym(word)\n acronym_str = \"\" # Create return var\n\n split_words = word.split(\" \") # Split words into array\n\n split_words.each do |word| # Loop each word and shovel first letter in acronym_str\n acronym_str += word[0].upcase\n end\n\n return acronym_str\n\nend",
"def titleize(title)\n results = []\n #get all the words\n bad_words = ['a', 'and', 'or', 'of', 'over', 'the']\n words = title.split(' ')\n # iterate over words with INDEX\n words.each_with_index do |word, i|\n word.downcase!\n if i == 0\n results << word.capitalize\n elsif bad_words.include?(word)\n results << word\n else\n results << word.capitalize\n end\n end\n #capitalize if first word\n #capitalize unless the included in the bad list\n results.join(' ')\nend",
"def titleize(title)\n title_array = title.split(\" \")\n for word in title_array\n if word == title_array[0]\n word = word.capitalize!\n elsif word.downcase == \"and\" or word.downcase == \"over\" or word.downcase == \"of\" or word.downcase == \"the\" or word.downcase == \"an\" or word.downcase == \"for\" or word.downcase == \"nor\" or word.downcase ==\"but\" or word.downcase ==\"or\" or word.downcase ==\"yet\" or word.downcase == \"so\" \n word = word.downcase!\n else word = word.capitalize!\n end\n end\n print title_array.join(\" \")\nend",
"def name_handler(name)\n name = name.downcase.chars #takes the input and makes it downcase and breaks it into an array to increment through\n name_new = name.map do |letter| #create a new array called name_new and start block to increment through each array\n letter_change(letter)\n end\n #Code addressing capitalization and swapping first / last\n namearr = name_new.join('').split #join the new_name array back into a string\n p namearr\n first_name = namearr[0] #assign first name to a new variable based on index\n last_name = namearr[1] #assign first name to a new variable based on index\n name_new = last_name.capitalize! + \" \" + first_name.capitalize! #capitalize and swap first for last\nend",
"def get_word\n dictionary_file = '5desk.txt'\n dictionary = File.readlines(dictionary_file)\n until @secret_word.length > 5 && @secret_word.length < 12\n @secret_word = dictionary.sample.rstrip.downcase\n end\n @secret_word\n end",
"def autocomplete(input, dictionary)\n mod_input = input.gsub(/[^a-zA-Z]/,\"\") \n dictionary.select { |word| word if word.start_with?(mod_input.downcase) || word.start_with?(mod_input.capitalize)}\n .first(5)\nend",
"def create_title(input)\n\trepeatArray = []\n currentTitle = input #Represents the song title string that has been generated thus far, we will be concatenating this with what we find\n prev = input #this represents the most recent word we have looked at\n count = 0\n\t#I found 200 to be a large enough number to repeat enough times to ensure that it would work without word limits, although it would take a long time\n while(count < 200) #Makes sure the created song title is less than 20 words long\n\t\t#Attempt at removing limit implementation\n\t\trepeatFound = false\n\t\trepeatCount = 0\n\t\trepeatLoop = 0\n\t\tif mcw(prev)!= nil #makes sure we havnt reached the end f the line (nil)\n \tprev = mcw(prev) # sets the previous word and calls mcw for the next most common word and changes prev to equal the newly found word\n\t\t\trepeatArray[repeatCount] = prev\n\t\t\twhile (repeatLoop < repeatArray.length)\n\t\t\t\tif (currentTitle.include? repeatArray[repeatLoop])\n\t\t\t\t\trepeatFound = true\n\t\t\t\tend\n\t\t\t\trepeatLoop+=1\n\t\t\tend\n\t\t\tif (!repeatFound)\n\t\t\t\tcurrentTitle << \" \" << prev #concatenates the newly found word onto the current title generated thus far, separating the new word with a space\n\t\t\tend\n \tend\n \tcount = count+1\n end\n return currentTitle #Returns the complete title when we are done\nend",
"def code_name(word)\n#set a new word to an empty string, we are going to fill it using the rest of the loop:\n\tnew_word = \"\"\n#start index at 0\n\ti = 0\n#loop through the string:\n\twhile i < word.length\n#letter is going to be the index of the word put in, starting at the 0 position until the end of the word's length\n\tletter = word[i]\n#if a space is found, add a space to the new word\n\t\tif letter == ' '\n\t\tnew_word += ' '\n#everything else, find the next letter or the next vowel or next edge case, and add it to the new word\n\t\telse\n\t\t letter == letter.downcase\n\t\tnew_word += vowels_and_edges(letter)\n \t\tend\n \t\ti += 1\n end\n#should result in a new word, when all strings are pieced together \n new_word\nend",
"def alias_generator(name)\n name_ord_reversed = name.split(' ').reverse\n name_ord_reversed = name_ord_reversed.join(\" \")\n name_ord_reversed = name_ord_reversed.split('')\n p name_ord_reversed\n vowels = \"aeiou\"\n vowels_array = vowels.split('')\n p vowels_array\n consonants = \"bcdfghjklmnpqrstvwxyz\"\n consonants_array = consonants.split('')\n p consonants_array\n index = 0 \n until index >= name.length do\n new_alias = []\n letter = name_ord_reversed[index]\n if letter == \" \"\n new_alias << letter\n elsif vowels.include? letter\n new_letter = vowels[index+1]\n new_alias << new_letter\n elsif consonants.include? letter\n new_letter = consonants[index+1]\n new_alias << new_letter\n end \n index += 1 \n end \n \n \n \n\n \nend",
"def titleize(string)\n stringarr = string.split(\" \")\n\n capwords = stringarr.map.with_index do |word, index|\n unless LITTLE_WORDS.include?(word) && index != 0\n word.capitalize\n else\n word\n end\n end\n capwords.join(\" \")\nend",
"def random_word\n wordpair = nil\n File.foreach(\"wordlist\").each_with_index do |line, number|\n wordpair = line if rand < 1.0/(number+1)\n end\n word = Word.new(wordpair.split(':')[0], wordpair.split(':')[1])\n return word\n end",
"def add_random_words(string, count = 5)\n words = string.dup.split\n ipsum = File.read(fixture_path('ipsum.txt')).split\n count.times do\n word = ipsum[Random.rand(ipsum.length)]\n index = Random.rand(words.length)\n words.insert(index, word)\n end\n words.join(' ')\nend",
"def titleize(title)\n\ttitle_split = title.split(\" \")\n\ttitle_split.map do |word|\n\t\tif word == \"over\"\n\t\t\t#word = word\n\t\t\treturn word\n\t\telsif word == \"and\"\n\t\t\t#word = word\n\t\t\treturn word\n\t\telsif word == \"the\" && title_split[0] != word\n\t\t\t#word = word\n\t\t\treturn word\n\t\telse\n\t\t\treturn word.capitalize\n\t\tend\n\tend\nend",
"def underscorize!\n self.replace(self.scan(/[A-Z][a-z]*/).join(\"_\").downcase)\n end",
"def get_word\r\n\t # Variable initialization\r\n\t wordArray = []\r\n\t count = 0\r\n\t random_int = 0\r\n\t \r\n\t # Stores each word that is on a new line into an array\r\n\t f = File.open(\"5desk.txt\", \"r\")\r\n\t f.each_line{ |line| wordArray << line }\r\n\t f.close\r\n\t \r\n\t # Selects the random word between the desired length of between 5 and 12 characters. \r\n\t # Note that this includes an extra delimiter at the end of each word\r\n\t until wordArray[random_int].length > 5 && wordArray[random_int].length < 14 do\r\n\t random_int = Random.new.rand(0..61405)\r\n\t end\r\n\t wordArray[random_int].chomp!\r\n\tend",
"def extract_name_from_text(text); end",
"def titleize(title)\n sm_words = ['a', 'and', 'of', 'over', 'the']\n title.capitalize.split(\" \").map{ |wrd| sm_words.include?(wrd) ? wrd : wrd.capitalize }.join(\" \")\nend",
"def weighted_random(lastword)\n # If word has no words in its dictionary (last word in source text file)\n # have it pick a random word to display instead.\n @dictionary.dictionary.fetch(lastword, NULL_OBJECT).sample\n end",
"def scramble_words(chars = WordChars)\n\t\tgsub(/(#{chars})(#{chars}+)(?=#{chars})/) { $1 + $2.randomize }\n\tend",
"def makeTitle()\n title = ''\n while title == ''\n tmpTitle = @sentences[:dialogue][rand(@sentences[:dialogue].size - 1)]\n quotedSections = tmpTitle.scan(QUOTED_TEXT_REGEX)\n if !quotedSections.nil? && !quotedSections[0].nil?\n title = quotedSections[0][0].gsub(STRIP_FROM_TITLE_REGEX, '')\n end\n end\n return title\nend",
"def spy_name(str)\n #CREATE VARIABLES FOR VOWELS AND CONSONANTS\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n consonants = [\"b\", \"c\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\", \"p\", \"q\", \"r\", \"s\", \"t\", \"v\", \"w\", \"x\", \"y\", \"z\"]\n #CHANGE STRING FIRST INTO ARRAY THAT MAKES EACH WORD A VALUE THEN REVERSE THEM. \n #THEN TURN ARRAY BACK INTO STRING AND DOWNCASE ANY LETTER.\n #THEN TURN STRING BACK INTO ARRAY THAT TAKES EACH INDIVIDUAL CHARACATER AS A VALUE.\n str = str.split(' ').reverse.join.downcase\n str = str.split('')\n #CREATE TEMPORARY VARIABLE STR_NEW TO EQUEL STR THEN CHANGE BUMP EACH \n #VOWEL AND CONSONANT TO THE NEXT ONE IN LINE. \n str_new = str.map do |char|\n if vowels.include?(char)\n vowels.rotate(1)[vowels.index(char)]\n elsif consonants.include?(char)\n consonants.rotate(1)[consonants.index(char)]\n else\n char\n end\n end\n #TURN ARRAY BACK INTO STRING.\n str_new.join\nend",
"def reverberate(str)\n \n new_str = str.split(\" \").map do |wrd|\n new_wrd = wrd.length > 3 ? reverberate_word(wrd) : wrd\n wrd.capitalize == wrd ? new_wrd.capitalize : new_wrd\n end\n\n new_str.join(\" \")\nend",
"def word_replace word, first_word\n if word =~ /^[A-Z]*$/ then\n \"_PROPER_\"#proper names\n elsif word =~ /^[A-Z|\\.]*$/ then\n if first_word then\n \"_FIRST_\"\n else\n \"_FNOCO_\" #first name or companies\n end\n elsif word =~ /^[A-Z].+$/ then\n if first_word then\n \"_FIRST_NAME_\"\n else\n \"_NAME_\"\n end\n elsif word =~ /^[0-9|\\-]*$/ then\n \"_NUM_\" #number\n else\n \"_RARE_\"\n end\nend",
"def fake_name(name)\n\n name_array = name.split('')\n\n name_array.map! do |letter|\n vowels = ['a','e','i','o','u', 'a']\n i = 0\n until i>vowels.length\n if i == 5\n letter = letter.next\n if vowels.include?(letter.downcase)\n letter = letter.next\n end\n break\n elsif letter.downcase == vowels[i]\n letter = vowels[i+1]\n break\n elsif letter.downcase == \" \"\n break\n else\n i += 1 \n end \n end\n letter\n end\n\n p name_array \n\n final_name = name_array.join.split(' ')\n\n final_name.map! do |letter|\n letter.capitalize\n end\n\n final_name2 = final_name.rotate.join(' ')\n\n return final_name2\n\nend",
"def create_title(word)\n\tcurrent = word\n\tword_num = 1 # begin word number at one\n\ttitle = \"\" # title begins as empty\n\ttitle += word # add current word\n\twhile word_num !=20 # while we have less than 20 words...\n\t\t\tif ($bigrams.has_key?(current)) # if the word exists in the bigram\n\t\t\t\tif (mcw(current) == nil)\n\t\t\t\t\t# do nothing and exit\n\t\t\t\t\tword_num = 20\n\t\t\t\telse\n\t\t\t\t\taddition = mcw(current) # thing to add is mcw\n\t\t\t\t\ttitle += \" \" # add space for readability\n\t\t\t\t\ttitle += addition # add addition to the title\n\t\t\t\t\tcurrent = addition # set current to the new wordtitle += addition # add the mcw\n\t\t\t\t\tword_num += 1 # increment by one and then go throuh\n\t\t\t\tend\n\t\t\telse word_num = 20 # otherwise, we exit\n\t\t\tend\n\t\tend\n\t\treturn title\nend"
] | [
"0.82401747",
"0.8130118",
"0.79906577",
"0.65076303",
"0.6469055",
"0.6358023",
"0.6070672",
"0.6006945",
"0.5979286",
"0.59258187",
"0.58767855",
"0.5865621",
"0.58184326",
"0.5786329",
"0.57666796",
"0.57271266",
"0.56742775",
"0.56160384",
"0.55847496",
"0.55594605",
"0.55531865",
"0.555135",
"0.5545367",
"0.553987",
"0.5534842",
"0.55163807",
"0.55106837",
"0.54987633",
"0.54981863",
"0.5495843",
"0.54837155",
"0.5479281",
"0.5472383",
"0.547169",
"0.54604757",
"0.54546154",
"0.54491705",
"0.544633",
"0.5424189",
"0.54124266",
"0.5407756",
"0.5405977",
"0.53975",
"0.5389742",
"0.53871477",
"0.53821987",
"0.53803605",
"0.53794014",
"0.53777415",
"0.53770727",
"0.537454",
"0.53636044",
"0.5362814",
"0.53583044",
"0.5346751",
"0.5341228",
"0.53328",
"0.5326718",
"0.53111285",
"0.5310749",
"0.5302484",
"0.5302484",
"0.53021294",
"0.5301992",
"0.53008693",
"0.5299057",
"0.52986366",
"0.52883935",
"0.5283989",
"0.5282462",
"0.5274617",
"0.5270014",
"0.5261505",
"0.5260436",
"0.52603847",
"0.5253603",
"0.5252352",
"0.5252215",
"0.52509975",
"0.5247115",
"0.52449",
"0.524454",
"0.5244236",
"0.5231831",
"0.52298534",
"0.52291936",
"0.52239853",
"0.5222188",
"0.52051944",
"0.52048975",
"0.52043754",
"0.5203647",
"0.5200944",
"0.51956975",
"0.51904935",
"0.51897025",
"0.5182654",
"0.51713777",
"0.5167611",
"0.51620764"
] | 0.8299373 | 0 |
Set types to each expressions | def check
set_superclasses!(@program.fclasses)
@program.fclasses.each{|k, v| check_fclass(v)}
type_expr!(@program.expr, {})
return @program.expr.type
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def expression_set(type, string)\n case type\n when :date\n date_expressions\n when :time\n time_expressions\n when :datetime\n # gives a speed-up for date string as datetime attributes\n if string.length < 11\n date_expressions + datetime_expressions\n else\n datetime_expressions + date_expressions\n end\n end\n end",
"def types(types); end",
"def evals_types\n call_path = \"evals/types\"\n data = build_post_data(\"\")\n perform_post(build_url(call_path), data)\n end",
"def types=(_arg0); end",
"def apply_types\n return unless _types\n\n _types.each do |rdf_type|\n unless resource.type.include? RDF::Vocabulary.find_term(rdf_type)\n resource << RDF::Statement.new(rdf_subject, RDF.type, RDF::Vocabulary.find_term(rdf_type))\n end\n end\n end",
"def replace_on(*types)\n types.map do |type|\n self.class.send :define_method, \"on_#{type}\" do |node|\n if captures = match?(node) # rubocop:disable Lint/AssignmentInCondition\n @match_index += 1\n execute_replacement(node, captures)\n end\n super(node)\n end\n end\n end",
"def replace_on(*types)\n types.map do |type|\n self.class.send :define_method, \"on_#{type}\" do |node|\n if captures = match?(node) # rubocop:disable Lint/AssignmentInCondition\n @match_index += 1\n execute_replacement(node, captures)\n end\n super(node)\n end\n end\n end",
"def types=(types)\n @types = Array(types) if types\n end",
"def prepare_types(elements)\n return if not elements\n elements.elements.each(\"typedef\") do\n |typedef|\n @types[typedef.attributes[\"name\"]]=typedef.attributes[\"basetype\"]\n format=typedef.elements[\"format\"].text\n if format =~ /^d-[0-9]+$/\n @decimals[typedef.attributes[\"name\"]]=format.sub(/^d-/,\"\").to_i\n end\n end\n end",
"def expressions; end",
"def compile_type_list(types)\n if Hash === types.last\n @types = types.pop\n end\n\n transform_simple_types(types)\n end",
"def add_expressions(*expressions); end",
"def type=(type); end",
"def infer_types!\n types = Array.new(ncols)\n each do |row| merge_types(types, row[:*].infer_string_types) end\n types.each.with_index do |type, i|\n colname = @colnames[i]\n if type <= Integer then\n @rownames.each do |_, rowid| @rows[rowid][colname] = Integer(@rows[rowid][colname]) end\n elsif type <= Float then\n @rownames.each do |_, rowid| @rows[rowid][colname] = Float(@rows[rowid][colname]) end\n end\n end\n self\n end",
"def elements=(elements)\n case elements\n when Hash\n @names = elements.keys\n @types = elements.class.new\n elements.each { |name, type| @types[name.to_sym] = LLVM::Script::Validate(type, :type) }\n @raw.element_types = @types.values\n when Array\n @names = []\n @types = elements.flatten.collect{ |type | LLVM::Script::Validate(type, :type) }\n @raw.element_types = @types\n else\n @names = []\n @types = []\n @raw.element_types = []\n end\n end",
"def all(*types); end",
"def type=(_); end",
"def type=(_); end",
"def type=(_); end",
"def type=(_); end",
"def type=(_); end",
"def create_types_effectivenesses\n @types.each do |type|\n I18n.locale = :en\n type_record = Type.find_by(name: type['name_en'])\n create_type_effectivenesses(type, type_record) if type_record\n end\n end",
"def transform_simple_types(types)\n @types ||= {}\n types.each do |type|\n @types[type.name.to_sym] = type\n end\n end",
"def set_type\n end",
"def value_types=(_arg0); end",
"def perform(&run_interp)\n @resolved_modifier = yield modifier\n @resolved_type = yield type\n expressions.each {|e| e.perform(&run_interp)}\n end",
"def type(val); @type = val; self; end",
"def type(env = {})\n @then_expr.type env\n end",
"def initialize(expr, type)\n @expr = expr\n @type = type\n freeze\n end",
"def literal_types\n %w[verbatim Vertatim code metacode] + math_environments\n end",
"def argument_types=(*value)\n end",
"def dtypes_set_function dtype_i, dtype_j\n str = <<SETFN\nstatic void #{dtypes_function_name(:set, dtype_i, dtype_j)}(size_t n, char* p1, size_t i1, char* p2, size_t i2) {\n for (; n > 0; --n) {\n #{dtypes_assign(dtype_i, dtype_j)}\n p1 += i1; p2 += i2;\n }\n}\n\nSETFN\n end",
"def interpoltype=(value)\n @interpoltype = value\n if defined? @interpolators\n self.build_interpolators\n end\n end",
"def oil_types=(vals = [])\n if vals.is_a?(Array)\n OilTypes.collect {|t| t[1]}.each do |type|\n if vals.member?(type)\n send(type+\"=\",true)\n else\n send(type+\"=\",false)\n end\n end\n end\n end",
"def expressions\n @expressions = operands.\n select {|op| op.is_a?(RDF::Resource) || op.is_a?(ShapeExpression) || op.is_a?(TripleExpression)}\n end",
"def tag_and_check_expr(node_type_name, expr, ast, in_hash)\n return if ast.is_a?(Array)\n unless ast.nil?\n old_usertype = ast.usertype\n ast.usertype = node_type_name.to_sym\n end\n\n success = check_expr(expr, ast, in_hash)\n unless success || ast.nil?\n ast.usertype = old_usertype\n end\n success\n end",
"def each_type\n types.values.each do |type|\n yield(type)\n end\n end",
"def types; end",
"def types; end",
"def types; end",
"def types; end",
"def types; end",
"def set_type_counts\n vars = \"\"\n Repo::REPO_TYPES.each do |t|\n vars << \"@#{t}_count = #{t.camelize.constantize}.count;\"\n end\n eval(vars)\n end",
"def break_types!(types)\n self.each_node do |node|\n # Need to break only in the case of a cast.\n if node.is_a?(Cast) then\n # node.type.break_types!(types)\n node.set_type!(node.type.break_types!(types))\n end\n end\n end",
"def each\n __types__.each {|t| yield t }\n end",
"def replace_sexp_with_type(sexp, type, function)\n Macro.new.replace_sexp_with_type(sexp, type, function)\nend",
"def set_types(column_types)\n raise NotImplementedError.new\n end",
"def emit_type(*children)\n emit(Parser::AST::Node.new(node.type, children))\n end",
"def types(array)\n yield(array)\nend",
"def handle(*types); end",
"def make_io_auto_variables(type, expr, data, index)\n expr = expr.eval(self)\n prefix = (type == :input ? \"I\" : \"O\")\n case expr.modifier\n when :all\n make_io_auto_variables_by_all(type, prefix, expr, data)\n when :each\n make_io_auto_variables_by_each(prefix, expr, data, index)\n end\n end",
"def initTypes\n raise NotImplementedError\n # local = new ArrayList<>();\n # localContext = new ArrayList<>();\n # dynamic = new ArrayList<>();\n #\n # for(int i=0; i<v.length; ++i) {\n # Extractor e = v[i];\n # if(e.isLocal() && e.isDynamic())\n # throw new RuntimeException(\"Extractors can't both be local and dynamic!\");\n # if(e.isLocal()) {\n # local.add(Pair.makePair(i,e));\n # //localContext.put(i,e);\n # } else if(e.isDynamic()) {\n # dynamic.add(Pair.makePair(i,e));\n # } else {\n # localContext.add(Pair.makePair(i,e));\n # }\n # }\n # if(DEBUG) {\n # log.info(\"Extractors: \"+this);\n # System.err.printf(\"Local: %d extractors\\n\",local.size());\n # System.err.printf(\"Local context: %d extractors\\n\",localContext.size());\n # System.err.printf(\"Dynamic: %d extractors\\n\",dynamic.size());\n # }\n end",
"def tokens(theTokenTypes)\n\t\truleset.token_types = theTokenTypes\n\tend",
"def type(node, type); end",
"def extract_parameter_types(type_expr)\n # No type\n if type_expr.nil?\n []\n # Multiple types to extract (ex. Variant[TargetSpec, String])\n elsif defined?(type_expr.keys)\n type_expr.keys.flat_map { |param| extract_parameter_types(param) }\n # Store cased value\n elsif defined?(type_expr.cased_value)\n [type_expr.cased_value]\n # Type alias, able to resolve alias\n elsif defined?(type_expr.resolved_type.name)\n [type_expr.resolved_type.name]\n # Nested type alias, recurse\n elsif defined?(type_expr.type)\n extract_parameter_types(type_expr.type)\n # Array conatins alias types\n elsif defined?(type_expr.types)\n type_expr.types.flat_map { |param| extract_parameter_types(param) }\n # Each element can be handled by a resolver above\n elsif defined?(type_expr.element_type)\n extract_parameter_types(type_expr.element_type)\n end\n end",
"def normalize_type_expression(type_expr, preserve_bang: false)\n case type_expr\n when /\\A!/\n # Handle the bang, normalize the inside\n \"#{preserve_bang ? \"!\" : \"\"}#{normalize_type_expression(type_expr[1..-1], preserve_bang: preserve_bang)}\"\n when /\\Atypes\\[.*\\]\\Z/\n # Unwrap the brackets, normalize, then re-wrap\n inner_type = type_expr[6..-2]\n if inner_type.start_with?(\"!\")\n nullable = false\n inner_type = inner_type[1..-1]\n elsif inner_type.end_with?(\".to_non_null_type\")\n nullable = false\n inner_type = inner_type[0...-17]\n else\n nullable = true\n end\n\n \"[#{normalize_type_expression(inner_type, preserve_bang: preserve_bang)}#{nullable ? \", null: true\" : \"\"}]\"\n when /\\Atypes\\./\n # Remove the prefix\n normalize_type_expression(type_expr[6..-1], preserve_bang: preserve_bang)\n when /\\A->/\n # Remove the proc wrapper, don't re-apply it\n # because stabby is not supported in class-based definition\n # (and shouldn't ever be necessary)\n unwrapped = type_expr\n .sub(/\\A->\\s?\\{\\s*/, \"\")\n .sub(/\\s*\\}/, \"\")\n normalize_type_expression(unwrapped, preserve_bang: preserve_bang)\n when \"Int\"\n \"Integer\"\n else\n type_expr\n end\n end",
"def types(types)\n select { |node| types.include?(node.type) }\n end",
"def types(types)\n select { |node| types.include?(node.type) }\n end",
"def format_types(typelist, brackets = T.unsafe(nil)); end",
"def types\n types = ActiveRDF::Query.new(N::SourceClass).distinct(:t).where(self,N::RDF::type,:t).execute\n # Add the \"default\" types if necessary\n self.class.default_types.each do |def_type|\n types << def_type unless(types.include?(def_type))\n end\n \n # Make a property list for the types.\n PropertyList.new(N::RDF::type, types, self, source_exists?)\n end",
"def types\n commit('types', nil)\n end",
"def cast_types; end",
"def convert_from(expression_type)\n expression_type.auto_conversion_to(@expression_type)\n end",
"def add(*types)\n __types__.add(*types)\n end",
"def compose_expression(expression_object, model:, column_name:, column_node:, column_type:)\n expression_object => {expressions:, value: raw_value}\n\n raise \"column_type not supplied (it was #{column_type})\" unless column_type.is_a?(Symbol)\n unless column_node.is_a?(::Arel::Nodes::Node) || column_node.is_a?(::Arel::Attributes::Attribute)\n raise \"column was not an Arel::Nodes::Node, it was a #{column_node.class}\"\n end\n\n last_type = column_type\n query_transforms = []\n\n field = column_node\n\n validate_basic_class(field, raw_value)\n case raw_value\n when String\n ::Arel::Nodes::Quoted.new(raw_value)\n else\n raw_value\n end => value\n\n raise CustomErrors::FilterArgumentError, 'Expressions must contain at least one function' if expressions.blank?\n\n # apply each expression in sequence, building up the query\n expressions.each_with_index do |name, index|\n expression = KNOWN_EXPRESSIONS.fetch(name.to_sym, nil)\n\n raise CustomErrors::FilterArgumentError, \"Expression function `#{name}` does not exist\" if expression.nil?\n\n context = {\n last: index == (expressions.length - 1),\n raw_value:\n }\n\n expression.validate_type(last_type, model, column_name)\n\n field = expression.transform_field(field, model, column_name)\n value = expression.transform_value(value, model, column_name, context)\n\n query_transform = expression.transform_query(model, column_name)\n validate_closure(query_transform, [:query])\n query_transforms << query_transform\n\n last_type = expression.new_type\n end\n\n [query_transforms, field, value]\n end",
"def types\n @stmt.types\n end",
"def test_set_unmatched_type\n set = SetVariableEval.new(@bool_var, @int_lit)\n assert_raise TypeError do\n set.eval\n end\n end",
"def explain!(*types); end",
"def register_mime_types(types)\n cr = Fl::Framework::Attachment::ClassRegistry.registry\n\n types.each do |tk, tv|\n av = (tv.is_a?(Array)) ? tv : [ tv ]\n av.each do |orm|\n cr.register(tk, self, orm)\n end\n end\n end",
"def add_subtypes_to_definitions\n # to augment all types definitions\n lolsoap_parser.types.each_value do |content|\n add_subtypes(content[:elements])\n end\n # we have to augment operations because some Requests are abstract, for instance:\n # ReportRequest which can be AccountPerformanceReportRequest etc...\n lolsoap_parser.operations.each_value do |content|\n content[:input][:body].each do |full_name|\n add_subtypes(lolsoap_parser.elements[full_name][:type][:elements])\n end\n end\n @grouped_subtypes = nil # we can reset this as its not needed anymore\n end",
"def create_types\n @types.each do |type|\n create_type(type) unless Type.where(name: type['name']).first\n end\n end",
"def test_set_method_types\n end",
"def set_expression(opts)\n opts = check_params(opts,[:expressions])\n super(opts)\n end",
"def cast_records!(*types, **options)\n where!(regclass.cast(:varchar).in(types.map(&:table_name))) if options[:filter]\n self.select_extra_values += [regclass.as(_record_class_attribute.to_s)]\n self.cast_records_value = (types.present? ? types : model.casted_dependents.values)\n self\n end",
"def build_selects_from_types(order); end",
"def type(*values)\n values.inject(self) { |res, val| res._type(val) or fail ArgumentError, \"Unknown value for type: #{val}\" }\n end",
"def type(*values)\n values.inject(self) { |res, val| res._type(val) or fail ArgumentError, \"Unknown value for type: #{val}\" }\n end",
"def type(*values)\n values.inject(self) { |res, val| res._type(val) or fail ArgumentError, \"Unknown value for type: #{val}\" }\n end",
"def look_for_types(target_types, ignoring = [], &blk)\n return if ignoring.include?(type)\n if target_types.include? type\n blk.call(self)\n else\n each_sexp do |elem|\n elem.look_for_types(target_types, ignoring, &blk)\n end\n end\n end",
"def set_model_props(m)\n fields_to_set = action.context_mapping.keys.map{|k| k.split(\":=>\").first} - [\"type\"]\n fields_to_set.each do |f| \n value = self.send f.to_sym\n m.send \"#{f}=\".to_sym, value\n end\n end",
"def types\n @types.dup\n end",
"def types\n @types.dup\n end",
"def enter_types(test_data)\n test_types = test_data[Org::ORG_RECORD_TYPES.name]\n test_types = [{ Org::ORG_RECORD_TYPE.name => ''}] unless test_types\n prep_fieldsets_for_test_data([fieldset(Org::ORG_RECORD_TYPES.name)], test_types)\n\n test_types.each_with_index do |test_type, index|\n wait_for_options_and_select(org_record_type_input(index), org_record_type_options(index), test_type[Org::ORG_RECORD_TYPE.name])\n end\n end",
"def process_method_field_types(fields)\n fields.each do |field|\n field_type = field[:type]\n next if STANDARD_TYPES.include?(field_type)\n @raw_types << field_type unless @raw_types.include?(field_type)\n end\n end",
"def break_types!(types)\n self.each_node do |node|\n node.break_types!(types)\n end\n end",
"def record_type(t)\n @type = t\n end",
"def set_value_by_type(definitions, value)\n value_type = definitions['type']\n if value.present?\n case value_type\n when 'string'\n value.gsub(/\\\"/, '')\n when 'integer'\n value.to_i\n when 'array'\n if value.is_a?(Array)\n value\n elsif value.is_a?(String)\n # try to split on commas to convert into array\n value.split(',')\n end\n else\n value\n end\n end\n end",
"def checkExp(exp, symbs, tmap, c)\n case exp.expr\n when 'identifier'\n #if symbol is not in table the identifier is undeclared\n if not symbs.include?(exp.args.name)\n puts \"ERROR: #{exp.args.line}: Type-Check: Undeclared identifier #{exp.args.name}\"\n exit\n else\n exp.type = symbs[exp.args.name]\n end\n\n when 'assign'\n checkExp(exp.args[1], symbs, tmap, c)\n #cannot assign to self\n if exp.args[0].name == 'self'\n puts \"ERROR: #{exp.line}: Type-Check: Cannot assign to self\"\n exit\n #if assignor not subclass of identifier\n elsif not tmap.isChild(exp.args[1].type, symbs[exp.args[0].name], c)\n puts \"ERROR: #{exp.line}: Type-Check: Bad assignment, #{exp.args[1].type} does not conform to #{symbs[exp.args[0].name]}\"\n exit\n else\n exp.type = exp.args[1].type\n end\n\n when 'true', 'false'\n exp.type = 'Bool'\n\n when 'integer'\n exp.type = 'Int'\n\n when 'string'\n exp.type = 'String'\n\n when 'new'\n #all types, including SELF_TYPE, are allowed here\n exp.type = exp.args.name\n\n when 'self_dispatch'\n checkDispatch(exp, symbs, tmap, c, nil, nil, exp.args[0], exp.args[1])\n\n when 'dynamic_dispatch'\n checkDispatch(exp, symbs, tmap, c, exp.args[0], nil, exp.args[1], exp.args[2])\n\n when 'static_dispatch'\n checkDispatch(exp, symbs, tmap, c, exp.args[0], exp.args[1], exp.args[2], exp.args[3])\n\n when 'if'\n checkExp(exp.args[0], symbs, tmap, c)\n # ERROR on non-Bool condition\n if exp.args[0].type != 'Bool'\n puts \"ERROR: #{exp.line}: Type-Check: Non-boolean condition\"\n exit\n end\n checkExp(exp.args[1], symbs, tmap, c)\n checkExp(exp.args[2], symbs, tmap, c)\n exp.type = tmap.lub(exp.args[1].type, exp.args[2].type, c)\n\n when 'block'\n exp.args.each do |e|\n checkExp(e, symbs, tmap, c)\n end\n exp.type = exp.args[exp.args.size-1].type\n\n when 'let'\n nsymbs = symbs.clone()\n # Bind each let binding\n exp.args[0].each do |bind|\n # can't bind self\n if bind.name.name == 'self'\n puts \"ERROR: #{exp.line}: Type-Check: Can't bind self in a let\"\n exit\n end\n # If there is an initializer, type check it\n if not bind.init.nil?\n checkExp(bind.init, nsymbs, tmap, c)\n if not tmap.isChild(bind.init.type, bind.type.name, c)\n puts \"ERROR: #{exp.line}: Type-Check: Initializer does not conform to declared type\"\n exit\n end\n end\n nsymbs[bind.name.name] = bind.type.name\n end\n checkExp(exp.args[1], nsymbs, tmap, c)\n exp.type = exp.args[1].type\n\n when 'case'\n checkExp(exp.args[0], symbs, tmap, c)\n nsymbs = symbs.clone()\n mtype = nil\n usedTypes = []\n #iterate over all case branches\n exp.args[1].each do |bind|\n #prevent self binding\n if bind.name.name == 'self'\n puts \"ERROR: #{bind.name.line}: Type-Check: Can't bind self in case expression\"\n exit\n end\n #prevent case checking for SELF_TYPE\n if bind.type.name == 'SELF_TYPE'\n puts \"ERROR: #{bind.type.line}: Type-Check: Can't use SELF_TYPE as case branch type\"\n exit\n end\n #prevent multiple branches checking same type\n if usedTypes.include? bind.type.name\n puts \"ERROR: #{bind.type.line}: Type-Check: #{bind.type.name} used twice as case branch type\"\n exit\n end\n usedTypes.push(bind.type.name)\n #bind case var and type check the branch\n nsymbs[bind.name.name] = bind.type.name\n checkExp(bind.body, nsymbs, tmap, c)\n #remove binding so it's not visible to other branches\n nsymbs[bind.name.name] = symbs[bind.name.name]\n #final type of case is least upper bound of all branch expressions\n if mtype.nil?\n mtype = bind.body.type\n else\n mtype = tmap.lub(mtype, bind.body.type, c)\n end\n end\n exp.type = mtype\n\n when 'while'\n checkExp(exp.args[0], symbs, tmap, c)\n #predicate of while must be Bool\n if exp.args[0].type != 'Bool'\n puts \"ERROR: #{exp.line}: Type-Check: Non-boolean loop condition\"\n exit\n end\n checkExp(exp.args[1], symbs, tmap, c)\n exp.type = 'Object'\n\n when 'isvoid'\n checkExp(exp.args, symbs, tmap, c)\n exp.type = 'Bool'\n\n when 'not'\n checkExp(exp.args, symbs, tmap, c)\n #not only operates on Bool\n if exp.args.type != 'Bool'\n puts \"ERROR: #{exp.line}: Type-Check: Can't perform not on #{exp.type}, expected Bool\"\n end\n exp.type = 'Bool'\n\n when 'negate'\n checkExp(exp.args, symbs, tmap, c)\n #negate only operates on Int\n if exp.args.type != 'Int'\n puts \"ERROR: #{exp.line}: Type-Check: Can't negate #{exp.type}, expected Int\"\n end\n exp.type = 'Int'\n\n when 'plus', 'minus', 'times', 'divide'\n checkExp(exp.args[0], symbs, tmap, c)\n checkExp(exp.args[1], symbs, tmap, c)\n #args must be Int for arithmetic\n if not (exp.args[0].type == \"Int\" and exp.args[1].type == \"Int\")\n puts \"ERROR: #{exp.line}: Type-Check: Non-integer arithmetic\"\n exit\n end\n exp.type = \"Int\"\n\n when 'eq', 'lt', 'le'\n checkExp(exp.args[0], symbs, tmap, c)\n checkExp(exp.args[1], symbs, tmap, c)\n #if one arg is Int, String, or Bool, the other must be same type\n #otherwise, the two args can be of any type\n sameComp = ['Int', 'String', 'Bool']\n if not ((sameComp.include?(exp.args[0].type) \\\n and sameComp.include?(exp.args[1].type) \\\n and exp.args[0].type == exp.args[1].type) \\\n or (not sameComp.include?(exp.args[0].type) \\\n and not sameComp.include?(exp.args[1].type)))\n puts \"ERROR: #{exp.line}: Type-Check: Can't compare #{exp.args[0].type} and #{exp.args[1].type}\"\n exit\n end\n exp.type = 'Bool'\n\n when 'internal'\n # do nothing\n\n else\n puts \"Unhandled expression: #{exp.expr}\"\n\n end\nend",
"def match_types(input, outnode, attrs, op)\n (0..op.input_arg.length - 1).each do |i|\n inType = input[i].out_data_types[input[i].definition.name]\n attrs[op.input_arg[i].type_attr] = inType if inType != 0 and op.input_arg[i].type_attr\n end\n\n (0..op.output_arg.length - 1).each do |i|\n argType = type_to_enum(op.output_arg[i].type)\n if op.output_arg[i].type_attr != \"\" and argType != 0\n attrs[op.output_arg[i].type_attr] = argType # TODO\n end\n end\n\n op.attr.each do |attribute|\n if attribute.type == \"type\"\n isTypeProvided = attrs[attribute.name]\n attrs[attribute.name] = type_to_enum(attribute.default_value) if !isTypeProvided\n end\n end\n\n op.output_arg.each do |arg|\n argType = type_to_enum(arg.type)\n outnode.out_data_types[outnode.definition.name] = attrs[arg.type_attr]\n # TODO\n end\n nil\n end",
"def type(type); end",
"def types\n Enumerator.new do |y|\n @types.each do |name, shape_class|\n y.yield(name, shape_class)\n end\n end\n end",
"def target_types=(value)\n @target_types = value\n end",
"def set_type(opts)\n opts = check_params(opts,[:types])\n super(opts)\n end",
"def explain_types; end",
"def format_types(list, brackets = T.unsafe(nil)); end",
"def types\n @stmt.types\n end",
"def break_types!(types)\n self.each_node do |node|\n # Need to break only in the case of a cast.\n if node.is_a?(Cast) then\n node.type.break_types!(types)\n end\n end\n end",
"def add(*types)\n @__types__.add(*types)\n end",
"def on_type_test_text(ast_node, context)\n nodes = XML::NodeSet.new\n\n context.each do |node|\n nodes << node if node.is_a?(XML::Text)\n end\n\n return nodes\n end",
"def add(*types)\n types.each do |mime_type|\n if mime_type.kind_of? MIME::Types\n add(*mime_type.defined_types)\n else\n if @type_variants.include?(mime_type.simplified)\n if @type_variants[mime_type.simplified].include?(mime_type)\n warn \"Type #{mime_type} already registered as a variant of #{mime_type.simplified}.\" unless defined? MIME::Types::STARTUP\n end\n end\n add_type_variant(mime_type)\n index_extensions(mime_type)\n end\n end\n end",
"def data=(values = [])\n @tag_name = values.first.is_a?(Cell) ? :strCache : :strLit\n values.each do |value|\n v = value.is_a?(Cell) ? value.value : value\n @pt << @type.new(v: v)\n end\n end"
] | [
"0.68392897",
"0.6173443",
"0.58851725",
"0.5774013",
"0.5740963",
"0.57252145",
"0.57252145",
"0.57085407",
"0.5682831",
"0.55939233",
"0.5567317",
"0.55449843",
"0.55209345",
"0.551837",
"0.5511317",
"0.5499792",
"0.5475987",
"0.5475987",
"0.5475987",
"0.5475987",
"0.5475987",
"0.5445055",
"0.5439803",
"0.5420311",
"0.5373082",
"0.5372909",
"0.53219265",
"0.5321814",
"0.53207153",
"0.53124624",
"0.5293413",
"0.5278822",
"0.5259456",
"0.52534163",
"0.5241594",
"0.51939994",
"0.5175288",
"0.5165391",
"0.5165391",
"0.5165391",
"0.5165391",
"0.5165391",
"0.51366264",
"0.5130453",
"0.5112587",
"0.5095233",
"0.50800294",
"0.506095",
"0.50555223",
"0.5040828",
"0.503936",
"0.5024271",
"0.50139093",
"0.50076497",
"0.5004181",
"0.5001515",
"0.50014627",
"0.50014627",
"0.5001447",
"0.4993827",
"0.4978142",
"0.49746642",
"0.49683934",
"0.4964261",
"0.49570474",
"0.49477243",
"0.49444228",
"0.49277687",
"0.49273777",
"0.49157602",
"0.49042228",
"0.4896411",
"0.48899364",
"0.48889872",
"0.4887985",
"0.48852617",
"0.48852617",
"0.48852617",
"0.487999",
"0.4878663",
"0.48779845",
"0.48779845",
"0.4875505",
"0.4871384",
"0.48713258",
"0.48707303",
"0.486542",
"0.48619226",
"0.48618007",
"0.48580098",
"0.48562974",
"0.48536035",
"0.485332",
"0.48506165",
"0.484568",
"0.4844979",
"0.48373684",
"0.48351982",
"0.48341864",
"0.48265025",
"0.48165005"
] | 0.0 | -1 |
Return true when t1 <: t2 | def subtype?(t1, t2)
return true if t1 == t2
fclass(t2) # Check existance of class t2
return fclass(t1).descendant_of?(t2)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def kind_of?(other)\n super || object.kind_of?(other)\n end",
"def <= (t)\n self == t || t.is_super_of?(self)\n end",
"def kind_of?(other)\n super || __getobj__.kind_of?(other)\n end",
"def assignable?(t, t2)\n if t.is_a?(Module)\n t = type(t)\n end\n t.is_a?(PAnyType) ? t.assignable?(t2) : false\n end",
"def evaluate_subtype?(other, type_bindings = nil, same_parameter_types = false)\n raise NotImplementedError\n end",
"def conforms_to?(type1, type2)\n get_cls = ->(type){\n if type.is_a?(TyParam)\n find_class('Object')\n else\n find_class(type.name)\n end\n }\n cls1, cls2 = get_cls[type1], get_cls[type2]\n return cls1 == cls2 || cls1.subclass_of?(cls2, self)\n end",
"def conforms(type1, type2)\n\tif type1 == \"SELF_TYPE\" and type2 == \"SELF_TYPE\"\n\t\treturn true\n\tend\n\n\tif type1 == \"SELF_TYPE\" and type2 != \"SELF_TYPE\"\n\t\treturn conforms(get_class_context(), type2)\n\tend\n\n\tif type1 != \"SELF_TYPE\" and type2 == \"SELF_TYPE\"\n\t\treturn false\n\tend\n\n\tif type1 != \"SELF_TYPE\" and type2 != \"SELF_TYPE\"\n\t\t# (T, T')\n\t\twhile true\n\t\t\tif type1 == type2\n\t\t\t\treturn true\n\t\t\tend\n\n\t\t\tif (type1 == \"Object\")\n\t\t\t\tbreak\n\t\t\telse\n\t\t\t\ttype1 = $p_map[type1]\n\t\t\tend\n\t\tend\n\n\t\treturn false\n\tend\nend",
"def assignable_PRubyType(t1, t2)\n return false unless t2.is_a?(Types::PRubyType)\n c1 = class_from_string(t1.ruby_class)\n c2 = class_from_string(t2.ruby_class)\n return false unless c1.is_a?(Class) && c2.is_a?(Class)\n !!(c2 <= c1)\n end",
"def extends?(type)\n @supertype && @supertype.type_of?(type) && @supertype\n end",
"def <=(other)\n @types.all? do |t|\n t <= other\n end\n end",
"def conforms(type1, type2)\n\twhile true\n\t\tif type1 == type2\n\t\t\treturn true\n\t\tend\n\n\t\tif (type1 == \"Object\")\n\t\t\tbreak\n\t\telse\n\t\t\ttype1 = $p_map[type1]\n\t\tend\n\tend\n\n\treturn false\nend",
"def assignable_Object(t, t2)\n false\n end",
"def subsume?(other)\n range_within_other?(other,self)\n end",
"def same_kind?(other)\n other.ordered_tree && other.ordered_tree.base_class == tree.base_class\n end",
"def include_range? other_range\n case other_range\n when Range\n if other_range.first >= self.first && other_range.last <= self.last\n return true\n else\n return false\n end\n else\n raise \"unsupported type\"\n end\n end",
"def contained?(other); end",
"def contained?(other); end",
"def contained?(other); end",
"def super_and_sub?(sup, sub); end",
"def superset_of?( other_collection )\n other.all? {|e| self.include? e }\n end",
"def assignable?(t, t2)\n # nil is assignable to anything\n if is_pnil?(t2)\n return true\n end\n\n if t.is_a?(Class)\n t = type(t)\n end\n\n if t2.is_a?(Class)\n t2 = type(t2)\n end\n\n @@assignable_visitor.visit_this(self, t, t2)\n end",
"def kind_of?(p0) end",
"def comparable?(other)\n kind_of?(other.class) || other.kind_of?(self.class)\n end",
"def matches_ancestors?(ancestors); end",
"def ==(other)\n return false unless super\n true\n end",
"def overlaps?(other); end",
"def overlaps?(other); end",
"def overlaps?(other); end",
"def same_types?(other)\n types == other.types\n end",
"def <= (t)\n self == t\n end",
"def <=(other)\n return @type <= other\n end",
"def is_a?(other)\n if other == Mongoid::Boolean || other.class == Mongoid::Boolean\n return true\n end\n super(other)\n end",
"def eql?(other)\n other.is_a?(AggregateGraph) ? super : false\n end",
"def ==(other)\n self.class == other.class && rules == other.rules && super\n end",
"def check_subtype(x, y, &recursively_check_subtype)\n raise NotImplementedError\n end",
"def trueish?\n %w(1 t).include? self\n end",
"def joinable?(other)\n kind_of?(other.class) || other.kind_of?(self.class)\n end",
"def comparable?\n left.class <=> right.class\n end",
"def java_kind_of?(other)\n return true if self.kind_of?(other)\n return false unless self.respond_to?(:java_class) && other.respond_to?(:java_class) &&\n other.kind_of?(Module) && !self.kind_of?(Module) \n return other.java_class.assignable_from?(self.java_class)\n end",
"def ==(other)\n # If lexically invalid, use regular literal testing\n return super unless self.valid?\n\n case other\n when Literal::DateTime\n return super unless other.valid?\n self.object == other.object\n when Literal::Time, Literal::Date\n false\n else\n super\n end\n end",
"def within?(other)\n range_within_other?(self,other)\n end",
"def compatible_with?(other)\n composition == other.composition\n end",
"def like?(other)\n if other.respond_to?(:simplified)\n @simplified == other.simplified\n else\n @simplified == Type.simplified(other)\n end\n end",
"def covers?(*args)\n other = coerce_range(*args)\n\n if other.instant?\n self.begin <= other.begin and other.end < self.end\n else\n self.begin <= other.begin and other.end <= self.end\n end\n end",
"def ==(other)\n self.class == other.class && rule == other.rule && super\n end",
"def instance_of?(p0) end",
"def nearly?(other); end",
"def child_of?(parent); end",
"def is_a?(p0) end",
"def eql?(ct); end",
"def eql?(ct); end",
"def look_same_as?(other)\n return nil unless other.kind_of?(Relvar)\n return false unless name == other.name\n super(other)\n end",
"def isSubtree(t1, t2)\n return true if t2.nil?\n return false if t1.nil?\n\n return true if(isIdentical(t1, t2))\n\n (isSubtree(t1.left, t2) || isSubtree(t1.right, t2))\nend",
"def allowed_type?(parent_node); end",
"def =~( other )\n\t\tunless other.is_a?( Arrow::AcceptParam )\n\t\t\tother = self.class.parse( other.to_s ) rescue nil\n\t\t\treturn false unless other\n\t\tend\n\n\t\t# */* returns true in either side of the comparison.\n\t\t# ASSUMPTION: There will never be a case when a type is wildcarded\n\t\t# and the subtype is specific. (e.g., */xml)\n\t\t# We gave up trying to read RFC 2045.\n\t\treturn true if other.type.nil? || self.type.nil?\n\n\t\t# text/html =~ text/html\n\t\t# text/* =~ text/html\n\t\t# text/html =~ text/*\n\t\tif other.type == self.type\n\t\t\treturn true if other.subtype.nil? || self.subtype.nil?\n\t\t\treturn true if other.subtype == self.subtype\n\t\tend\n\n\t\treturn false\n\tend",
"def ==(other)\n\t\tsuper &&\n\t\t tags == other.tags\n\t end",
"def possible_class_hierarchy_check?(lhs, rhs, method); end",
"def equal_by_tree?(g1, g2)\n check_pre((\n (graph_obj?(g1)) and\n (graph_obj?(g2))\n ))\n\n if not equal_by_dim?(g1, g2)\n return false\n end\n\n if comp_shape?(g1) and comp_shape?(g2)\n return (equal_by_tree?(g1.left, g2.left) and equal_by_tree?(g1.right, g2.right))\n elsif g1.range2d? and g2.range2d?\n return (equal_by_tree?(g1.x_range, g2.x_range) and equal_by_tree?(g1.y_range, g2.y_range))\n elsif g1.range1d? and g2.range1d?\n return (\n (g1.first == g2.first) and\n (g1.last == g2.last)\n )\n else\n return false\n end\nend",
"def eql?(other)\n super\n end",
"def eql?(other)\n super\n end",
"def overlap?(self_range, other_range)\n return true if self_range == other_range \n overlap_helper(self_range, other_range) || overlap_helper(other_range, self_range)\n end",
"def ===(other)\n return false unless self.type == other.type\n return true\n end",
"def subclass?(m,klass)\n m.ancestors.include?(klass)\n end",
"def meets?(*args)\n other = coerce_range(*args)\n self.begin == other.end or other.begin == self.end\n end",
"def is_or_is_ancestor_of?(other)\n other == self || is_ancestor_of?(other)\n end",
"def disjoint?(other); end",
"def disjoint?(other); end",
"def disjoint?(other); end",
"def accepts?(other)\n true\n end",
"def ==(other)\n (other.is_a? Interval) && (@start == other.start && @end == other.end)\n end",
"def eql?(t)\n self == t\n end",
"def instance?(t, o)\n assignable?(t, infer(o))\n end",
"def contains?(other_type)\n if !(kind_of_class <= other_type.kind_of_class)\n return false\n end\n\n modules_included = other_type.kind_of_modules.all? do |m|\n kind_of_class <= m ||\n kind_of_modules.any? { |self_m| self_m <= m }\n end\n if !modules_included\n return false\n end\n\n other_type.messages.all? do |m|\n responds_to_duck_message?(m)\n end\n end",
"def ==(other)\n # If lexically invalid, use regular literal testing\n return super unless self.valid?\n\n case other\n when Literal::Time\n return super unless other.valid?\n # Compare as strings, as time includes a date portion, and adjusting for UTC\n # can create a mismatch in the date portion.\n self.object.new_offset.strftime('%H%M%S.%L') == other.object.new_offset.strftime('%H%M%S.%L')\n when Literal::DateTime, Literal::Date\n false\n else\n super\n end\n end",
"def is_or_is_ancestor_of?(other)\n (other == self) or is_ancestor_of?(other)\n end",
"def ==(other)\n # If lexically invalid, use regular literal testing\n return super unless self.valid?\n\n case other\n when Literal::Date\n return super unless other.valid?\n self.object == other.object\n when Literal::Time, Literal::DateTime\n false\n else\n super\n end\n end",
"def ==(o)\n return true if self.equal?(o)\n self.class == o.class && super(o)\n end",
"def intersects?(*args)\n other = coerce_range(*args)\n raise ArgumentError, \"#{self.begin.class} expected, received #{other.begin.class}\" unless other.begin.kind_of?(self.begin.class)\n\n if other.instant?\n self.begin <= other.begin and other.end < self.end\n else\n other.begin < self.end and self.begin < other.end\n end\n end",
"def eql?(other)\n self.class == other.class and self == other\n end",
"def kind_of?(thing)\n ancestors.include? thing\n end",
"def eql?(p0) end",
"def eql?(p0) end",
"def eql?(p0) end",
"def eql?(p0) end",
"def eql?(p0) end",
"def eql?(p0) end",
"def eql?(p0) end",
"def eql?(other)\n self.class == other.class && self == other\n end",
"def eql?(other)\n self.class == other.class && self == other\n end",
"def eql?(other)\n self.class == other.class && self == other\n end",
"def eql?(other)\n self.class == other.class && self == other\n end",
"def == other\n\t\tcase other when FalseClass, self.class\n\t\t\ttrue\n\t\telse\n\t\t\tfalse\n\t\tend\n\tend",
"def ==(other)\n other.instance_of?(self.class) && eql?(other)\n end",
"def <=(other); end",
"def eql?(other) self.class == other.class and target==other.target and source==other.source; end",
"def eql?(other) self.class == other.class and target==other.target and source==other.source; end",
"def ===(other)\n return true if super\n return (self == other.content_class) if other.respond_to?(:content_class)\n false\n end",
"def intersect?(o)\n self.class == o.class && !(@to < o.numeric_from || o.numeric_to < @from)\n end",
"def eql?(other); end",
"def eql?(other); end"
] | [
"0.6692199",
"0.6642902",
"0.6426827",
"0.64179045",
"0.63976806",
"0.6364597",
"0.6364343",
"0.6313674",
"0.62850547",
"0.61794823",
"0.6166119",
"0.61381817",
"0.61233985",
"0.607093",
"0.6046963",
"0.6023686",
"0.6023686",
"0.6023686",
"0.6005221",
"0.59775126",
"0.5976119",
"0.5951167",
"0.5876082",
"0.58755505",
"0.5872669",
"0.587258",
"0.587258",
"0.587258",
"0.5804145",
"0.5800945",
"0.5775945",
"0.57285166",
"0.57210135",
"0.5686136",
"0.56750196",
"0.56591827",
"0.56547445",
"0.56366295",
"0.5635693",
"0.56324476",
"0.5630335",
"0.5629542",
"0.56289387",
"0.5622816",
"0.5615244",
"0.56035346",
"0.5602831",
"0.5577121",
"0.5574116",
"0.5570961",
"0.5570961",
"0.5566961",
"0.55595464",
"0.55562735",
"0.5545559",
"0.5538597",
"0.553759",
"0.553568",
"0.55326825",
"0.55326825",
"0.5522868",
"0.55086815",
"0.55071163",
"0.55063677",
"0.5489184",
"0.5486439",
"0.5486439",
"0.5486439",
"0.5479354",
"0.54714537",
"0.5469997",
"0.54647547",
"0.5462294",
"0.546215",
"0.5454795",
"0.54546016",
"0.54392827",
"0.5432151",
"0.5430451",
"0.542605",
"0.5425592",
"0.5425592",
"0.5425592",
"0.5424556",
"0.5424556",
"0.5424556",
"0.5424556",
"0.54202163",
"0.54202163",
"0.54202163",
"0.54202163",
"0.53986806",
"0.5384873",
"0.5376074",
"0.5375619",
"0.5375619",
"0.5369585",
"0.5366414",
"0.5365859",
"0.5365859"
] | 0.7655484 | 0 |
and b) the number of times it was repeated in that consecutive block. The output can be whatever format you choose (array with the letter in the first index and the count in the second, or perhaps a string with a letter and a number as a character). Example input: "rrSSrrrrPQr" would return "r4" or ["r", 4] Time: O(n) Space: O(1) | def most_repeated_letter(string)
letter = ""
count = 0
length = string.length
i = 0
current_count = 1
while i < length
if string[i] == string[i+1]
current_count += 1
else
if current_count > count
count = current_count
letter = string[i]
end
current_count = 1
end
i += 1
end
return "#{letter}#{count}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def num_repeats(string)\n \nidx1 = 0 #Made a counter for first loop\nidx2 = 0 #Made another counter for the second loop\nrepeat_count = 0 #Assigned a variable to tally the number of letters that had repeated in the string\ncurrent_repeat_count= []\nidx3 = 0\n while idx1 < string.length #The characters in the string will be scanned over and over again until it reaches the string.length\n idx2 = idx1 + 1 #the the second loop will always be 1 element ahead of the idx1 to scan them properly\n \n while idx2 < string.length #Same logic with the first loop\n unless current_repeat_count[idx3] == string[idx2]\n if string[idx1] == string[idx2] #if the current element of idx1 is the same with the current element of idx2, \n current_repeat_count << string[idx2]\n repeat_count = repeat_count + 1# repeat_count will increase by 1 each time\n end\n end\n \n idx2 = idx2 + 1 #idx2 will increase by 1 to go to the next element\n end\n idx1 = idx1 + 1 #after the first round of the first element pairs up with the rest of the elements, 1 will be added \n end #to go the next element to be compared with the rest\n \n return repeat_count #once it's done, the code returns the tally of repeated letters. \n\nend",
"def num_repeats(string)\n\n # number of repeating characters\n n = 0\n # tracks the character frequency\n repeats = Hash.new(0)\n\n string.each_char do |c|\n repeats[c] += 1\n if repeats[c] == 2\n n += 1\n end\n end\n n\nend",
"def how_many_times_is_repeated(str)\n #create hash to store key and value\n h={}\n #split up the string into individual characters and put it in an array\n arr = str.split(\"\")\n #for each character in the array, if it does not have a previous occurence in the 'h' hash, add it to the hash with a value of '1'\n arr.each do |n|\n if h.has_key?(n) == false\n h[n]=1\n #if it does have a previous occurence in the 'h' hash, add '1' to the previously occuring value of that key\n elsif h.has_key?(n) == true\n h[n]= h[n] +1\n end\n #return the completed hash\n end\n return h\nend",
"def num_repeats(string)\n string = string.gsub(\" \", \"\") \n # Get rid of spaces. Also if this contained numbers, symbols, etc would need to delete those too or they will be counted\n letters = string.split(\"\")\n holder = []\n\n i = 0\n count = 0\n while i < letters.length\n j = i+1\n while j < letters.length\n if letters[i] == letters[j] && !holder.include?(letters[i])\n count += 1\n holder << letters[i]\n end\n j += 1\n end\n i += 1\n end\ncount\nend",
"def num_repeats(string)\n i = 0 \n count = 0\n check = nil\n \n while i < string.length\n letter = string[i]\n i2 = 1 \n while i2 < string.length\n letter2 = string[i2]\n \n if i < i2\n if letter == letter2\n if check == nil\n check = letter\n count += 1\n elsif letter != check\n count += 1\n check = letter\n end\n end\n end\n \n i2 += 1\n end\n i += 1\n end\n return(count)\nend",
"def num_repeats(string)\n\t#Counter to track the number of numbers greater than 1\n\tcounter = 0\n\tletter_count = {}\n\t#Remove spaces by splitting the string into an array and then back again\n\tinput_line = string.scan(/[a-zA-Z]/).join.downcase\n\tfor x in 0...input_line.length do\n\t\tif letter_count.has_key?(input_line[x])\n\t\t\tletter_count[input_line[x]] += 1\n\t\telse\n\t\t\tletter_count[input_line[x]] = 1\n\t\tend\n\tend\n\tletter_count.each do |letter, count|\n\t\tif count > 1\n\t\t\tcounter += 1\n\t\t\tputs \"Test num_repeats: adding #{letter} to list\"\n\t\tend\n\tend\n\treturn counter\nend",
"def duplicate_count(str)\n arr = str.downcase.chars\n counts = {}\n arr.each do |char|\n if counts.include?(char)\n counts[char] += 1\n else\n counts[char] = 1\n end\n end\n output = 0\n counts.each_value do |num|\n output += 1 if num > 1\n end\n output\nend",
"def num_repeats(string)\n # Keep track of letters\n lettercount = []\n num_rpt_letters=0 \n \n # Walk through string\n i=0\n while i<string.length\n \n # Check whether letter has already been counted\n letterfound = false\n j=0\n \n while j<lettercount.length\n # If letter has already appeared, increment the count\n if string[i]==lettercount[j][0]\n lettercount[j][1]+=1\n letterfound = true\n break\n end\n j+=1\n end\n \n # Letter is not in lettercount, add it\n if !letterfound\n lettercount.push([string[i], 1])\n end\n \n i+=1\n end\n \n # Go through lettercount, and see how many appeared in our string more than once\n i=0\n while i<lettercount.length\n puts(lettercount[i][0] + lettercount[i][1].to_s)\n if lettercount[i][1] > 1\n num_rpt_letters += 1\n end\n i += 1\n end\n \n \n return num_rpt_letters\n \nend",
"def num_repeats(string)\n\tcount = 0\n\tdix = 0\n\tnew = \"\"\n\twhile dix < string.length\n\t\tletter = string[dix]\n\t\tunless new.include?(letter)\n\t\t\tnew = new + letter\n\t\telse\n\t\t #...\n\t\tend\n\t\tdix2 = dix + 1\n\t\twhile dix2 < string.length\n\t\t\tif letter == string[dix2]\n\t\t\t\tcount +=1\n\t\t\t\tbreak\n\t\t\tend\n\t\t\tdix2 +=1\n\t\tend\n\t\tdix += 1\n\tend\n\tputs(count.to_s)\n\treturn count\n\n\nend",
"def num_repeats(string)\nnums = Hash.new(0)\ncount = 0\n\nstring.each_char do |letter| nums[letter] += 1 end\n\nnums.keys.each do |key|\n\tif nums[key] > 1\n\t\tcount += 1\n\tend\nend\ncount\n\nend",
"def num_repeats(string)\r\n idx_str = 0\r\n idx2 = idx_str+1\r\n counter = 0\r\n repeated_letter = \"\"\r\n while idx_str < string.length\r\n if !repeated_letter.include? string[idx_str]\r\n while idx2 < string.length\r\n if string[idx_str] == string[idx2]\r\n repeated_letter += string[idx_str]\r\n counter +=1\r\n break\r\n end\r\n idx2 +=1\r\n end\r\n end\r\n idx_str += 1\r\n idx2 = idx_str+1\r\n end\r\n return counter\r\nend",
"def num_repeats(string)\n\n\ti = 0\n\tcount = 0\n\tcounted = []\n\t\n\twhile i < string.length - 1\n\t\tj = i + 1\n\t\twhile j < string.length\n\t\t\tif string[i] == string[j]\n\t\t\t\tk = 0\n\t\t\t\tis_counted = false\n\t\t\t\twhile k < counted.size\n\t\t\t\t\tif counted[k] == string[j]\n\t\t\t\t\t\tis_counted = true\n\t\t\t\t\tend\n\t\t\t\t\tk += 1\n\t\t\t\tend\n\n\t\t\t\tbreak if is_counted\n\t\t\t\t\n\t\t\t\tif !is_counted\n\t\t\t\t\tcount += 1\n\t\t\t\t\tcounted.push(string[i])\n\t\t\t\tend\n\t\t\tend\n\t\t\tj += 1\n\t\tend\n\n\t\ti += 1\n\tend\n\treturn count\nend",
"def num_repeats(string)\n tallies = {}\n\n (0..string.length - 1).each do |idx|\n letter = string[idx]\n tallies[letter] ||= 0\n tallies[letter] += 1\n end\n\n count_tallies_greater_than_two(tallies)\nend",
"def count_repeated_letters(word)\n # character: # of occurences\n occurences = Hash.new(0)\n count = 0\n\n word.each_char do |c|\n occurences[c] += 1\n if occurences[c] == 2\n count+=1\n end\n end\n count\nend",
"def num_repeats(string)\n\tio = 0\n\ti = io + 1\n\tyo = 0\n\ty = yo + 1\n\tletters = []\n\tcounter = 0\n\n\twhile io < string.length\n\t\twhile i <= string.length\n\t\t\tif string[io] == string[i]\n\t\t\t\tletters.push(string[io])\n\t\t\t\tio += 1\n\t\t\t\ti = io + 1\n\t\t\t\twhile yo < letters.length\n\t\t\t\t\t\tif string[io] == letters[yo]\n\t\t\t\t\t\t\tio += 1\n\t\t\t\t\t\t\ti = io + 1\n\t\t\t\t\t\t\tyo = 1\n\t\t\t\t\t\telse yo += 1\n\t\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\tcounter += 1\n\t\t\tend\n\n\t\ti += 1\n\t\tend\n\t\tio += 1\n\t\ti = io + 1\n\tend\n\treturn counter\n\nend",
"def count_SE_groups(a)\n return 1 if a.length == 1\n record = Hash.new\n len_elem = a[0].length\n if len_elem > 1\n a.length.times do |i|\n atemp = Array.new(2,\"\")\n len_elem.times do |j|\n atemp[j % 2] += a[i][j]\n end\n atemp = atemp[0].chars.sort!*\"\" + atemp[1].chars.sort!*\"\"\n a[i] = atemp\n end\n end\n p a.sort!\n count_of_groups = 0\n a.length.times do |i|\n count_of_groups += 1 if a[i + 1] != a[i]\n end\n count_of_groups\nend",
"def num_repeats(string)\n arr = string.split('')\n repeats = []\n arr.each_index { | i |\n if (string.index(arr[i]) < i) && !(repeats.include?(arr[i]))\n repeats << arr[i]\n end\n }\n \n repeats.count\n \nend",
"def num_repeats(string)\n\n\tletters = string.split('')\n\tfrequencies = Hash.new(0)\n\n\tletters.each do |letter|\n \tfrequencies[letter] += 1\n\tend\n\n\t#puts frequencies\n\n\ttarget_count = 0\n\tfrequencies.values.select do |value|\n\t\tif value > 1\n\t\t\ttarget_count += 1\n\t\tend\n\tend\n\t\n\tputs target_count\n\treturn target_count\nend",
"def count_occurrences(input)\n occurrences = Hash.new(0.0)\n\n last_char_read = nil\n\n input.each_char do |char|\n occurrences[last_char_read + char] += 1 if last_char_read != nil\n last_char_read = char\n end\n\n occurrences\n end",
"def num_repeats(string)\n h = Hash.new(0)\n string.each_char do |c| \n h[c] = h[c] ? h[c]+1 : 1\n end \n repeated = h.values.select {|n| n > 1 }\n return repeated.length\n \n \n # I'm just going to leave this right here so you remember how much time you wasted trying to write javascript in ruby. There's a method for everything!\n #\n # repeated = 0\n # i = 0\n # count = 0\n # while i < string.length\n # #count up the times a letter occurs in a string\n # j = 0\n # while j < string.length\n # if string[i] == string[j]\n # count += 1\n # end\n # j += 1 \n # #if the answer is greater than 1, increment repeated\n # if count > 1\n # repeated += 1\n # end\n # count = 0\n # i += 1\n # end \n \n # #split string into array\n # strArray = string.split(\"\")\n # #iterate over array\n # i = 0\n # while i < strArray.length\n # #for each letter the first letter matches, update counter\n # for j in strArray\n # if strArray[i] == j\n # counter += 1\n # end \n # #if counter > 1 \n # end\n # if counter > 1\n # #update repeated variable\n # repeated += 1\n # end \n # counter = 0\n # i += 1\n \n # puts repeated\n # return repeated\nend",
"def get_letter_count(string)\n letter_count = []\n \n i = 0\n while i < string.length\n letter = string[i]\n #check if letter has already been counted. If it has, add 1 to the count.\n #If it hasn't, add an entry for it\n j = 0\n letter_counted = false\n while j < letter_count.length\n if letter_count[j][0] == letter\n letter_count[j][1] += 1\n letter_counted = true\n break\n end\n j += 1\n end\n if !letter_counted\n letter_count.push([letter, 1])\n end\n \n i += 1\n end\n return letter_count\nend",
"def cnts a\n r = []\n found = false\n a.each do |x|\n r.each do |y|\n if y[0] === x\n y[1] += 1\n found = true\n break\n end\n end\n if !found\n r.push([x, 1])\n else\n found = false\n end\n end\n r\nend",
"def num_repeats(string)\n\ti = 0\n\tanswer = 0\n\tfreq = 0\n\n\twhile i < string.length\n\t\tletter = string[i]\n\t\tif string[i] == letter\n\t\t\tfreq += 1\n\t\tend\n\t\tif freq > 1\n\t\t\tanswer += 1\n\t\tend\n\tend\nend",
"def num_repeats(string)\n\tcount = {}\n\tstring.each_char {|x| count[x] = string.count(x)}\n\tcount.select! {|k, v| v > 1}\n\tcount.length\nend",
"def double_letter_count(string)\n repeating_letters = 0\n string.each_char.with_index do |char, i|\n if string[i] == string[i + 1]\n repeating_letters += 1\n end\n end\n return repeating_letters\nend",
"def num_repeats(string)\n found_letters = []\n idx1 = 0\n while idx1 < string.length\n idx2 = idx1 + 1\n while idx2 < string.length\n if string[idx1] == string[idx2] && !found_letters.include?(string[idx1])\n found_letters.push(string[idx1])\n end\n idx2 += 1\n end\n idx1 += 1\n end \n return found_letters.length\nend",
"def num_repeats(string)\n\trepeats = 0\n\tletters = []\n\n\tcurrentCount = 0\n\tcurrentLetter = \"\"\n\n\ti = 0\n\twhile i < string.length\n\tcurrentLetter = string[i]\n\n\tj = 0\n\twhile j < string.length\n\n\t\tif string[j] == currentLetter\n\t\t\tcurrentCount += 1\n\t\tend\n\t\tj += 1\n\tend\n\n\tif currentCount > 1\n\t\tif letters.include? (currentLetter)\n\t\telse\n\t\t\trepeats += 1\n\t\t\tletters.push(currentLetter)\n\t\tend\n\tend\n\n\tcurrentCount = 0\n\ti += 1\nend\n\nputs \"Repeat Count: #{repeats} \\nRepeated Letters: #{letters}\"\nreturn repeats\n\n\nend",
"def ordered_count(str)\n str.split('').uniq.map{|letter| [letter, str.count(letter)]}.to_a\nend",
"def num_repeats(string)\n count = []\n \n i = 0\n while i < string.length\n j = i + 1\n count [i] = 1\n while j < string.length\n if string[i] == string[j]\n count[i] = count[i] + 1\n h = j\n while h < string.length - 1\n string[h] = string[h+1]\n h = h + 1\n #puts(string) for testing earlier\n end\n string[string.length-1] = \"\"\n else\n j = j + 1\n end\n end\n if( string[i+1]!= '')\n i = i + 1 \n end\n end\n\n numRepeats = 0\n i = 0\n while i < count.length\n if count[i] > 1\n numRepeats += 1\n end \n i = i + 1 \n end\n \n return numRepeats\nend",
"def LetterCount(str)\n\n \n words = str.split(\" \")\n most = \"\"\n count = 0\n \n words.each do |word|\n hash = Hash.new(0)\n word.split(\"\").each {|letter| hash[letter] += 1} #must split word\n repeats = hash.select {|letter, count| count >= 2}.size\n if repeats > count\n count = repeats\n most = word\n end\n \n end\n \n return most\n \nend",
"def duplicate_count(text)\n characters = text.downcase.chars.each_with_object(Hash.new(0)) do |chr, hash|\n hash[chr] += 1\n end\n\n characters.values.select{|count| count > 1}.size\nend",
"def repetitionEncryption(letter)\n pattern = /(\\w+)[\\d\\W]+\\1\\b/i\n return letter.scan(pattern).size\nend",
"def RunLength(str)\n # convert str into array\n chars = str.split('') \n new_str = \"\"\n counter = 1\n # loop through the str array\n (0..(chars.length-1)).each do |idx|\n \t# find the repeating chars\n \tif chars[idx] == chars[idx+1]\n \t\t# increment the counter\n \t\tcounter += 1\n \t\tp counter\n \telse\n \t\t# if no repeating chars, \n \t\t# push number and chars to the new_str\n \t\t# if else condition scope????? why push everything in\n \t\t# else condition?????????????????\n \t\tnew_str << counter.to_s + chars[idx] # why this line is here????\n \t\tcounter = 1\n \t\tp new_str\n \tend\n end\n new_str\n end",
"def character_count(string) \n string.chars.group_by(&:chr).map { |character, count| [character, count.size] }\nend",
"def LetterCountI(str)\n\n str = str.split\n repeating_letters = []\n str.each do |word| \n word = word.split(\"\")\n letters = Hash.new(0)\n word.each { |letter| letters[letter] += 1 }\n selected_letters = letters.select { |key, value| value > 1 }\n repeating_letters << selected_letters.keys.length\n end\n if (repeating_letters.select {|l| l >= 1}).empty?\n return -1\n else\n max = repeating_letters.max\n return str[repeating_letters.index(max)]\n end\nend",
"def solution(s)\n return 0 if s.empty?\n t = 0\n ('A'..'Z').to_a.each do |c|\n t += s.count(c)\n end\n t + 1\nend",
"def count_code(str)\n times = 0\n str.size.times do |n|\n if n != (str.size - 1) && n != (str.size - 2) && n != (str.size - 3) && str[n] == \"c\" && str[n + 1] == \"o\" && str[n + 3] == \"e\"\n times += 1\n end\n end\n return times\nend",
"def duplicate_count(text)\n # create an array with properly formatted elements\n letters = text.downcase.split('')\n\n # make the hash deafult to 0 so that += will work correctly\n stats = Hash.new(0)\n\n # iterate over the array and count number of times each letter occur\n letters.each {|letter| stats[letter] += 1}\n\n # delete key-value pairs from the hash which occur only once\n stats.delete_if {|key, value| value == 1}\n\n # return the number of remaining key-value pairs\n return stats.values.count\nend",
"def repeatedString(s, n)\r\n # Write your code here\r\n numOfA = 0\r\n index = 0\r\n \r\n if s.length == 1 && s[0] == 'a'\r\n return n\r\n elsif s.length == 1 && s[0] != 'a'\r\n return 0\r\n \r\n else\r\n firstRoundUpperLimit = n < s.length ? n : s.length\r\n \r\n for i in 0 ... firstRoundUpperLimit\r\n if s[i] === 'a'\r\n numOfA = numOfA + 1\r\n end\r\n end\r\n\r\n if (numOfA > 0 && n > s.length) \r\n repeatingOccurrences = (n / s.length) - 1\r\n remainingOccurrences = n % s.length\r\n\r\n\r\n\r\n numOfA = numOfA + (numOfA * repeatingOccurrences)\r\n\r\n for j in 0 ... remainingOccurrences\r\n if s[j] === 'a'\r\n numOfA = numOfA + 1\r\n end\r\n end\r\n end\r\n\r\n \r\n end\r\n return numOfA\r\nend",
"def duplicate_count(text)\n text.downcase.chars.sort.join.scan(/(\\w)\\1{1,}/).size\nend",
"def count_letters(input_string)\n letter = input_string.scan /\\w/\n freq = Hash.new(0)\n\n # this will create a histogram count for each letter\n letter.each do |letter|\n freq[letter] += 1\n end\n\n\n\n # output letter and count\n freq.each do |letter, count|\n puts letter + \" \" + count.to_s\n end\n\nend",
"def count_as(string)\n string_array = string.split(\"\")\n count = 0\n\n string_array.each do |letter|\n if letter == \"a\"\n count += 1\n end\n end\n\n count\nend",
"def repeatedString(s, n)\n char_array = s.split('')\n count_of_a_in_string = 0\n char_array.each do |letter|\n if letter == \"a\"\n count_of_a_in_string += 1\n end\n end\n\n factor = n/s.length()\n reminder = n % s.length()\n count_of_a_in_final_string = factor * count_of_a_in_string\n\n reminder.times do |index|\n count_of_a_in_final_string += 1 unless s[index] != \"a\"\n end\n count_of_a_in_final_string\nend",
"def how_many(srt)\n arr = srt.split(\" \")\n count = {}\n\n #arr.map{ |s| \"#{s} #{arr.count s}\" }\n\n # arr.each do |s|\n # s.downcase!\n # count[s] = count.key?(s) ? count[s]+1 : 1\n # end\nend",
"def frequent_letters(string)\n output = []\n count_table = Hash.new(0)\n\n string.each_char do |char|\n count_table[char] += 1\n if count_table[char] == 3\n output.push(char)\n end\n end\n\n return output\nend",
"def digitcount(num)\n # Convert the number into an array, 1131 -> [1,1,3,1] so we can iterate through\n digits = num.to_s.chars.map(&:to_i)\n # Track the count of seen numbers\n count = 0\n # Track the n-1 array value\n prev = nil\n # The resulting string\n result = ''\n \n # For each digit\n digits.each do |d|\n if prev == d\n # If it's the same number as we've seen before we should inc the counter\n count += 1\n else\n # This isn't a match, so output the previous count and number, reset the counter and carry on\n result += count.to_s + prev.to_s if count > 0\n count = 1\n end\n # In the next loop iteration the previous is the current digit\n prev = d\n end\n \n # Return the result, don't forget the last digit we inspected\n return result += count.to_s + prev.to_s\nend",
"def duplicate_count(text)\n duplicates = text.downcase.scan(/[a-z0-9]/)\n d2 = Hash.new(0)\n duplicates.each { |i| d2.store(i, d2[i] + 1) }\n d2.select { |k,v| v > 1 }.count\nend",
"def hash_letter_freq( array )\n\n i = 0 # keeps track of outter loop\n hash = Hash.new()\n\n while( array.length > i )\n\n count = 1\n\n i2 = 1 + i # keeps track of inner while loop\n\n while( array.length > i2 ) # this will never check the last element of the array - otherwise have i2 check itself by doing i2 = i\n\n # puts(\"i #{i} | i2 #{i2}\") -- check if iteration is made right\n\n if( array[i] == array[i2] )\n count += 1\n end\n\n i2 += 1\n end # inner - while\n\n # alternative cond: hash.has_key?(\"#{array[i]}\") http://ruby-doc.org/core-1.9.3/Hash.html#method-i-has_key-3F\n if( hash[\"#{array[i]}\"] == nil ) # checks if key exists\n hash[\"#{array[i]}\"] = count\n end\n\n # for the last element in the array -- skipped by i2\n if( i2 == array.length )\n if( hash[\"#{array[i]}\"] == nil )\n hash[\"#{array[i]}\"] = 1\n end\n end\n\n\n i += 1\n end # while -outter\n\n # puts( hash )\n return hash\n\nend",
"def letter_counter2(string)\n string.split.each_with_object({}) do | word, hash| # word (calling on array)\n if hash.has_key?(word.size) \n hash[word.size] += 1\n else\n hash[word.size] = 1\n end\n end\nend",
"def duplicate_count(text)\n return 0 if text.empty?\n\n hash = Hash.new { 0 }\n text.split('').map(&:downcase).map(&:to_sym).each do |char|\n hash[char] += 1\n end\n\n hash.count { |_, v| v >= 2 }\nend",
"def counted_characters(str)\n arr = str.split('')\n new_arr = []\n counted = element_count(arr)\n\n counted.each do |k, v|\n new_arr << k if v > 2\n end\n new_arr\nend",
"def double_letter_count(string)\n\tcount = 0\t\n \t(0...string.length).each do |i|\n \tif string[i] == string[i-1]\n \t\tcount += 1\n end\n end\n \treturn count\nend",
"def count_letters(string)\n i = 0\n \n length = string.length\n count = 1\n \n summary_string = \"\"\n \n while i < length\n if string[i] == string[i+1]\n count += 1\n else\n summary_string << \"#{string[i]}#{count}\"\n count = 1\n end\n i += 1\n end\n \n if summary_string.length < length\n return summary_string\n else\n return string\n end\nend",
"def count_chars str\n # pass one, return the size of the string\n # str.size\n \n h = Hash.new\n a = Array.new\n str.each_char do |char|\n a << char\n end\n a.sort.each do |char|\n h.has_key?(char) ? h[char] +=1 : h[char] = 1\n end\n h\nend",
"def double_letter_count(string)\r\n repeats = 0\r\n oldChar = ''\r\n string.each_char do |char|\r\n if oldChar == char\r\n repeats += 1\r\n end\r\n oldChar = char\r\n end\r\n return repeats\r\nend",
"def duplicate_count(text)\n my_hash = {}\n result = 0\n text = text.downcase\n text.each_char { |char| my_hash[char] = text.count(char)}\n p my_hash\n my_hash.each_value { |value| result += 1 if value > 1 }\n return result\nend",
"def frequent_letters(string)\n array = []\n count = Hash.new(0)\n string.each_char { |c| count[c] += 1 }\n count.each { |k, v| array << k if v > 2}\n array\nend",
"def matching_characters(str)\n matching_letters = Hash.new([])\n unique_chars_count = 0\n str.each_char.with_index do |letter, idx|\n matching_letters[letter] += [idx] if str.count(letter) > 1\n end\n matching_letters.each do |letter, indices|\n current_count = str[indices.first + 1...indices.last].chars.uniq.size\n unique_chars_count = current_count if current_count > unique_chars_count\n end\n unique_chars_count\nend",
"def double_letter_count(string)\ncount = 0\narr = string.split(\"\")\n\ni = 0\nwhile i < arr.length\n\tif arr[i] == arr[i + 1]\n\t\tcount += 1\n\tend\n\ti += 1\nend\n\n\n\nreturn count\n\nend",
"def count_char(counts, string)\n (0...string.length).each do |i|\n if counts[string[i]]\n counts[string[i]] += 1\n else\n counts[string[i]] = 1\n end\n end\nend",
"def frequent_letters(string)\n hash = Hash.new(0)\n results = []\n\n string.each_char do |char|\n hash[char] += 1\n end\n\n hash.each do |k, v|\n if v > 2\n results << k\n end\n end\n\n return results\nend",
"def duplicate_count(text)\n characters = {}\n\n text.downcase.each_char do |chr|\n characters[chr] ? characters[chr] += 1 : characters[chr] = 1\n end\n\n characters.values.select{|count| count > 1}.size\nend",
"def count_index(to_count)\n\tmy_hash = Hash.new{|hash, key| hash[key] = []}\n\tcount = 0\n\tto_count.split('').each do |letter|\n\t\tcount += 1\n\t\tmy_hash[letter].push(count)\n\tend\n\tmy_hash\t\nend",
"def repeatedString(s, n)\n count = s.count(\"a\")\n rep = (n / s.length)\n if n % s.length != 0\n short_s = s.slice(0, n % s.length)\n return (count * rep) + short_s.count(\"a\")\n else\n return (count * rep)\n end\n \nend",
"def solve(input)\n data = input.chars\n buckets = []\n current = []\n data.each_with_index do |c, i|\n n = data[i + 1]\n current << c\n unless n == c\n buckets << current\n current = []\n end\n break if n.nil?\n end\n\n ret = ''\n buckets.each do |b|\n ret += b.count.to_s\n ret += b.first\n end\n ret\nend",
"def count_letters(str)\r\n index, result, equal_temp, temp = 0, [], [], str[0]\r\n str = str.downcase\r\n\r\n while index < str.length\r\n\r\n if temp == str[index + 1]\r\n equal_temp << temp\r\n else\r\n result << equal_temp\r\n equal_temp << temp\r\n equal_temp = []\r\n end\r\n\r\n temp = str[index + 1]\r\n index += 1\r\n end\r\n\r\n result\r\nend",
"def frequent_letters(string)\n frequent = []\n letters_count = Hash.new(0)\n\n string.each_char { | char | letters_count[char] += 1 }\n letters_count.each do | k, v |\n if v > 2\n frequent << k\n end\n end\n\n return frequent\nend",
"def ae_count(string)\n hash = Hash.new(0)\n string.each_char do |char|\n if char == 'a' || char == 'e'\n hash[char] += 1 \n end\n end\n\n hash\nend",
"def ordered_count(str)\n counter_hsh = Hash.new(0)\n str.chars.each { |letter| counter_hsh[letter] += 1 }\n counter_hsh.sort_by { |x| [str.chars.index(x), str.chars.count(x)] }\nend",
"def letter_frequency(s)\n s.downcase.scan(/[a-z]/).group_by(&:itself).\n transform_values(&:size).sort_by {|k,v| [-v, k]}\nend",
"def solution0(a)\n\n total_count = 0\n elem_counts = Hash.new(0)\n\n a.each do |elem|\n elem_counts[elem] += 1\n total_count += 1 if elem_counts[elem] == 2\n end\n\n return total_count\n\nend",
"def count_and_say(sequence)\n\treturn 0 if sequence == nil\n\tsequence = sequence.to_s\n\tn = sequence.to_s.size\n result = ''\n\ti = 1\n\trepeat = sequence[0]\n\ttimes = 1\n\twhile (i<=n) do\n\t\tif sequence[i] == repeat\n\t\t\ttimes += 1\n else\n \tresult += times.to_s + repeat.to_s\n \ttimes = 1\n repeat \t= sequence[i].to_i\n end\n i+=1\n end \n\treturn result \nend",
"def duplicate_count(text)\n i = 0\n newtext = text.downcase.each_char.to_a\n store = []\n\n while i < newtext.length\n char = newtext[i]\n pos = newtext.index(newtext[i])\n my_slice = newtext[(pos + 1)..(newtext.length - 1)]\n if my_slice.include?(char)\n store.push(char)\n end\n i += 1\n end\n return store.uniq.count\nend",
"def look_and_say(array)\n output = []\n count = 1\n current = array[0]\n (1...array.length).each do |index|\n if array[index] == current\n count += 1\n else\n output << [count, current]\n current = array[index]\n count = 1\n end\n end\n output << [count, current]\nend",
"def ae_count(str)\n ae_counter = Hash.new(0)\n my_hash = {}\n str.each_char do |char|\n if char == 'a' || char == 'e'\n ae_counter[char] += 1\n end\n end\n sorted = ae_counter.sort_by {|key, val| key}\n my_hash[sorted[0][0]] = sorted[0][1]\n my_hash[sorted[1][0]] = sorted[1][1]\n return my_hash\nend",
"def co_ecount(str)\n times = 0\n (str.length - 3).times do |i|\n if str[i] == \"c\" && str[i+1] == \"o\" && str[i+3] == \"e\"\n times += 1\n end\n end\n return times\nend",
"def repeatedString(s, n)\n s.count('a') * (n / s.size) + s[0, n % s.size].count('a')\nend",
"def repeatedString(s, n)\n len = s.length\n times = n / len\n nb = times * s.count('a')\n\n last = s[0..(n % len)]\n nb += last.count('a') if len != 1\n nb\nend",
"def letter_count(string)\n string.scan(/\\w/).reduce({}) do |counts, letter|\n counts.merge letter => string.count(letter)\n end\nend",
"def ae_count(str)\n # Write your code here\n arr=str.scan(/./)\n my_list = Hash.new(0)\n num = 1\n # puts \";Hey #{sentence}\"\n\n arr.each do |chr|\n if chr == 'e' || chr == 'a'\n my_list[chr] += num\n end\n end\n Hash[my_list.sort]\nend",
"def repeatedString(s, n)\n num_a = s.count(\"a\")\n if num_a == 0\n return 0\n end\n slen = s.length\n total = num_a*(n/slen)\n total += s[0...n%slen].count(\"a\")\nend",
"def find_key_lengths string\n array = []\n string_array = string.split(\"\")\n guess = (3..8).to_a #if generalizing, 8 can be string_array.length\n guess.each do |x|\n matches = 0\n string_array.each.with_index do |y, i|\n if string_array[i] == string_array[i + x]\n matches += 1\n end\n end\n array.push(matches)\n end\n array.map.with_index{|x, i| i + 3 if x >= (array.max)}.compact\nend",
"def occ(seq, b)\n # löchen alles anstatt was in b drin ist\n return seq.gsub(/^#{b}/, \"\").length\n end",
"def nb_dig(n, d)\n counter = 0\n string_of_squares(n).split(\"\").each { |c| counter += 1 if d == c.to_i }\n counter\nend",
"def countA(string)\n counter = 0\n string.each_char do |char|\n if char == \"a\"\n counter +=1\n end\n end\n return counter\nend",
"def count_letters(line, all_inputs)\n freq = Hash.new\n line.chars do |c|\n if freq.has_key?(c)\n freq[c] += 1\n else\n freq[c] = 1\n end\n end\n if freq.value?(2)\n two_letters = 1\n else\n two_letters = 0\n end\n if freq.value?(3)\n three_letters = 1\n else\n three_letters = 0\n end\n if freq.value?(4)\n puts \"4 letters!\"\n end\n #puts \"#{line.chars.sort} two_l=#{two_letters} three_l=#{three_letters}\"\n puts \"#{line} two_l=#{two_letters} three_l=#{three_letters}\"\n all_inputs[line] = {\n '2' => two_letters,\n '3' => three_letters\n }\n return two_letters, three_letters\nend",
"def duplicate_count(str)\n str.downcase.each_char.find_all { |c| str.downcase.count(c) > 1 }.uniq.size\nend",
"def frequent_letters(string)\n count = Hash.new(0)\n string.each_char { |char| count[char] += 1 }\n\n frequents = []\n count.each do |char, num|\n if num > 2\n frequents << char\n end\n end\n return frequents\nend",
"def count(r)\n c = Hash.new(0)\n r.each { |z| c[z] += 1}\n c\nend",
"def repeatedString(s, n)\n s.count('a') * n.div(s.size) + s.slice(0,n.remainder(s.size)).count('a')\nend",
"def char_count (arr, hash)\n arr.each_with_index do |k, i|\n hash[k] = 0\n end\n \n arr.each_with_index do |char, j|\n if hash.has_key?(char)\n hash[char] += 1\n end\n end\n\n return hash\nend",
"def letter_counts(word) =\n word.chars.each_with_object(Hash.new(0)) { |c, counts| counts[c] += 1 }",
"def duplicate_count(text)\n letters = text.downcase.chars\n count = letters.each_with_object(Hash.new(0)) { |let, hash| hash[let] += 1 }\n count.select { |k, v| v > 1}.size\n \n # text.downcase\n # .chars\n # .each_with_object(Hash.new(0)) { |let, hash| hash[let] += 1 }\n # .values\n # .count { |v| v > 1 }\n \n # count = Hash.new(0)\n # text.downcase.chars.each { |let| count[let] += 1 }\n # count.values.count { |v| v > 1 }\nend",
"def solve(array)\n alphabet = ('a'..'z').to_a.join\n results = []\n \n array.each do |string|\n count = 0\n string.downcase!\n string.chars.each_with_index do |char, index|\n count += 1 if string[index] == alphabet[index]\n end\n results << count\n end\n results \nend",
"def RunLength(str)\n cpy_str = str.chars.uniq.join\n cpy_str.chars.map {|char| str.scan(char).count.to_s + char}.join\nend",
"def custom_count(string, search_characters)\n total_chars = 0\n #\n search_characters.each_char do |sc|\n # split the string and review letter & sc\n letters = string.each_char { |letter| letter == sc ? total_chars += 1 : next }\n\n end # end of do (search chars)\n\n total_chars\nend",
"def duos(str)\n count = 0\n str.each_char.with_index do |char, idx|\n count += 1 if char == str[idx+1]\n end\n count\nend",
"def duos(str)\n count = 0\n str.each_char.with_index do |char,idx|\n\n count += 1 if str[idx+1] == char \n\n end\n count\n\nend",
"def letter_counter(string)\n hash = {}\n string.split.each do |word|\n if hash.has_key?(word.size)\n hash[word.size] += 1\n else \n hash[word.size] = 1\n end\n end\n hash\nend",
"def letter_counts(word)\n hash = Hash.new(0)\n word.chars {|letter| hash[letter] += 1}\n hash\nend"
] | [
"0.7440535",
"0.7399826",
"0.7308909",
"0.72962517",
"0.7215785",
"0.71923643",
"0.7158871",
"0.7152598",
"0.71241426",
"0.71065724",
"0.7075475",
"0.7053894",
"0.70304793",
"0.70052737",
"0.698804",
"0.6950817",
"0.694299",
"0.6937352",
"0.69308907",
"0.6916916",
"0.6892098",
"0.68883073",
"0.68384856",
"0.68040335",
"0.6797251",
"0.67955756",
"0.67837644",
"0.6778733",
"0.6775615",
"0.67602813",
"0.67578334",
"0.6729565",
"0.6728319",
"0.6721256",
"0.6719644",
"0.66943586",
"0.66908413",
"0.66833663",
"0.6678898",
"0.6664453",
"0.66638386",
"0.6654316",
"0.6631477",
"0.6623956",
"0.66082025",
"0.6594112",
"0.6586543",
"0.65811205",
"0.6579964",
"0.65633035",
"0.654514",
"0.65167344",
"0.65114576",
"0.65005213",
"0.64987993",
"0.6494078",
"0.6481697",
"0.6480377",
"0.6477983",
"0.6460583",
"0.6455175",
"0.6448595",
"0.6444506",
"0.644203",
"0.64407223",
"0.643445",
"0.6416503",
"0.6407001",
"0.64058685",
"0.64028317",
"0.6401493",
"0.6400379",
"0.6398262",
"0.63976663",
"0.6395315",
"0.63944113",
"0.639203",
"0.63847744",
"0.63787293",
"0.6376848",
"0.6374509",
"0.6367998",
"0.6367336",
"0.6363601",
"0.6361171",
"0.6356198",
"0.63527143",
"0.63509613",
"0.63505214",
"0.63449866",
"0.6338423",
"0.63310516",
"0.632868",
"0.63165206",
"0.6315982",
"0.63130766",
"0.63126826",
"0.6312229",
"0.63071585",
"0.63011366"
] | 0.65194833 | 51 |
Return the eval string. We get this as the parameter to the eval C call. A bit of checking is done to make sure everything is okay: we have to be in an EVAL type frame which has an iseq we have to have a prev frame which is a CFUNC the prev method name has to be 'eval' | def eval_string(frame)
return nil unless 'EVAL' == frame.type && frame.iseq
prev = frame.prev
return nil unless prev && 'CFUNC' == prev.type && 'eval' == prev.method
retval = prev.sp 3
retval = $1 if retval =~ /^\(eval "(.+)"\)/
retval
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def current_eval(string, ebinding=Mission.eval_binding)\n ebinding = ebinding.call if ebinding.is_a?(Proc)\n eval(string, ebinding)\n end",
"def eval(str)\n end",
"def eval(s, *rest)\n file, line = __find_caller__(caller())\n $__gen_code__[[file, line]] = {\n :binding => nil, \n :kind => :eval, \n :code => s\n }\n $__eval__.call(s, *rest)\n end",
"def expr_eval_to_s\n if @last_eval_state.nil?\n return \"<unevaluated>\"\n end\n \n str = ''\n if @offset\n str << \"#{@offset < 0 ? '-' : ''}0x#{@offset.abs.to_s(16)}\"\n end\n \n if @last_eval_state[:special] || @last_eval_state[:register]\n if @offset\n str << '+'\n end\n if @last_eval_state[:special]\n str << @last_eval_state[:special_tok]\n elsif @last_eval_state[:register]\n str << @last_eval_state[:reg_tok]\n end \n end\n \n str\n end",
"def eval_ex(e)\n case e\n when Symbol\n value = @var_tables.reverse_each.find{|var| break var[e] if var[e] }\n raise \"undefined variable: #{e}\" if value.nil?\n return value\n when Array\n method = e.first\n case method\n when :if0\n if0(e[1], e[2], e[3])\n when :fold\n fold(e[1], e[2], e[3])\n when *OP1\n send(method, e[1])\n when *OP2\n send(method, e[1], e[2])\n else\n raise \"unexpected expression method: #{method.inspect}\"\n end\n when Numeric\n e\n else\n raise \"unexpected expression: #{e.inspect}\"\n end\n end",
"def eval(expr, *rest) end",
"def process_call(exp)\n receiver = exp.shift\n method = exp.shift\n args = exp.shift\n\n iter = get_iter()\n\n #\n # RubyJS::inline(\"str\")\n #\n # A different form of Javascript inline. We have this form\n # because ``-style Javascript-inline has a different esacping\n # of \\. Sometimes we want no escaping, so\n #\n # RubyJS::inline %q(...) could be used.\n #\n if receiver == [:const, :RubyJS] and method == :inline and\n args[0] == :array and args.size == 2 and args[1].size == 2 and args[1][0] == :str and iter.nil?\n raise if @want_expression\n return @model.interpolate(args[1][1])\n end\n\n str = \n if $RUBYJS__OPTS.include?('OptimizeArithOps') and %w(> >= < <= + - * /).include?(method.to_s) and\n iter.nil? and args and args[0] == :array and args.size == 2\n without_result do \n want_expression do\n \"(#{process(receiver)})#{method.to_s}(#{process(args[1])})\"\n end\n end\n else\n without_result do \n generate_method_call_receiver_exp(receiver, method, iter, args)\n end\n end\n resultify(str)\n end",
"def instance_eval_for_cmethod frame_self, src\n frame_self.instance_eval(src)\n end",
"def process_xstr(exp)\n command = exp.shift\n return \"rb_funcall(rb_mKernel, rb_intern(\\\"`\\\"), 1, rb_str_new2(#{command.inspect}))\"\n end",
"def eval(*args) # :nodoc:\n Evaler.eval(args[0], *args)\n end",
"def process_call(exp)\n receiver = exp.shift\n name = exp.shift\n\n receiver = process receiver\n\n case name\n # TODO: these need to be numerics\n # emacs gets confused by :/ below, need quotes to fix indentation\n when :==, :<, :>, :<=, :>=, :-, :+, :*, :\"/\", :% then\n args = process exp.shift[1]\n return \"#{receiver} #{name} #{args}\"\n when :<=>\n args = process exp.shift[1]\n return \"RB_COMPARE(#{receiver}, #{args})\"\n when :equal?\n args = process exp.shift\n return \"#{receiver} == #{args}\" # equal? == address equality\n when :[]\n args = process exp.shift\n return \"#{receiver}[#{args}]\"\n when :nil?\n exp.clear\n return receiver.to_s\n else\n args = process exp.shift\n\n if receiver.nil? and args.nil? then\n args = \"\"\n elsif receiver.nil? then\n # nothing to do \n elsif args.nil? or args.empty? then\n args = receiver\n else\n args = \"#{receiver}, #{args}\"\n end\n\n args = '' if args == 'rb_ary_new()' # HACK\n\n return \"#{name}(#{args})\"\n end\n end",
"def context_for_eval; end",
"def evaluate_string(arguments)\n raise \"Unable to evaluate on Frame #{arguments.frameId}. Only the top-scope is supported\" unless arguments.frameId.nil? || arguments.frameId.zero?\n return nil if arguments.expression.nil? || arguments.expression.to_s.empty?\n return nil if puppet_session_state.actual.compiler.nil?\n\n # Ignore any log messages when evaluating watch expressions. They just clutter the debug console for no reason.\n suppress_log = arguments.context == 'watch'\n\n @evaluating_parser ||= ::Puppet::Pops::Parser::EvaluatingParser.new\n\n # Unfortunately the log supression is global so we can only do one evaluation at a time.\n result = nil\n @evaluate_string_mutex.synchronize do\n if suppress_log\n flow_control.assert_flag(:suppress_log_messages) if suppress_log\n # Even though we're suppressing log messages, we still need to save them to emit errors in a different format\n message_aggregator = LogMessageAggregator.new(hook_manager)\n message_aggregator.start!\n end\n begin\n result = @evaluating_parser.evaluate_string(puppet_session_state.actual.compiler.topscope, arguments.expression)\n if result.nil? && suppress_log\n # A nil result could indicate a failure. Check the message_aggregator\n msgs = message_aggregator.messages.select { |log| ERROR_LOG_LEVELS.include?(log.level) }.map(&:message)\n raise msgs.join(\"\\n\") unless msgs.empty?\n end\n ensure\n if suppress_log\n flow_control.unassert_flag(:suppress_log_messages)\n message_aggregator.stop!\n end\n end\n end\n # As this will be transmitted over JSON, force the output to a string\n result.nil? ? nil : result.to_s\n end",
"def __replace_eval__(line, gen_code)\n # class_eval\n if line =~ \n /(.*)((class_eval)|(module_eval)|(instance_eval)|(eval)) ?\\(?\"(.*)\"\\)? ?(.*)/\n printf \"%s%s {%s} %s\\n\", $1, $2, gen_code[:code], $8\n end\nend",
"def eval(*args); end",
"def eval(string, binding=nil, filename=nil, lineno=1)\n if binding\n if binding.kind_of? Proc\n binding = binding.binding\n elsif binding.respond_to? :to_binding\n binding = binding.to_binding\n end\n\n unless binding.kind_of? Binding\n raise ArgumentError, \"unknown type of binding\"\n end\n\n # shortcut for checking for a local in a binding!\n # This speeds rails up quite a bit because it uses this in rendering\n # a view A LOT.\n #\n # Rails always does this passing in a binding, so thats why the check\n # is here.\n #\n # TODO eval the AST rather than compiling. Thats slightly slower than\n # this, but handles infinitely more cases.\n=begin\n if m = /^\\s*defined\\? ([a-z_][A-Za-z0-9_]*)\\s*$/.match(string)\n local = m[1].to_sym\n if binding.variables.local_defined?(local)\n return \"local-variable\"\n else\n return nil\n end\n end\n=end\n\n filename ||= binding.static_scope.active_path\n passed_binding = true\n else\n binding = Binding.setup(Rubinius::VariableScope.of_sender,\n Rubinius::CompiledMethod.of_sender,\n Rubinius::StaticScope.of_sender)\n\n filename ||= \"(eval)\"\n passed_binding = false\n end\n\n cm = Rubinius::Compiler.compile_eval string, binding.variables, filename, lineno\n\n cm.scope = binding.static_scope.dup\n cm.name = :__eval__\n\n # This has to be setup so __FILE__ works in eval.\n script = Rubinius::CompiledMethod::Script.new(cm, filename, true)\n script.eval_binding = binding\n script.eval_source = string\n\n cm.scope.script = script\n\n be = Rubinius::BlockEnvironment.new\n be.under_context binding.variables, cm\n\n # Pass the BlockEnvironment this binding was created from\n # down into the new BlockEnvironment we just created.\n # This indicates the \"declaration trace\" to the stack trace\n # mechanisms, which can be different from the \"call trace\"\n # in the case of, say: eval(\"caller\", a_proc_instance)\n if binding.from_proc?\n be.proc_environment = binding.proc_environment\n end\n\n be.from_eval!\n \n yield cm, be if block_given?\n\n if passed_binding\n be.call\n else\n be.call_on_instance(self)\n end\n end",
"def to_s\n return \"exp(#{self.arg.to_s})\"\n end",
"def rInvocation(type=nil)\n meth = @method.methClass.getMethod(@method, type)\n return '' if !meth\n meth.registerCaller(@method)\n res = meth.name + '('\n meth.args.each {|arg|\n res += '(' + arg.type + ')(' + rExp + '), '\n }\n res = res[0..-3] if meth.args.size > 0\n return res + ')'\nend",
"def compile_eval_arg(scope, arg)\n if arg.respond_to?(:position) && arg.position != nil\n pos = arg.position.inspect\n if pos != @lastpos\n @e.comment(arg.position.inspect)\n if @trace\n compile_exp(scope,[:call,:puts,arg.position.inspect])\n end\n end\n @lastpos = pos\n end\n args = get_arg(scope,arg)\n atype = args[0]\n aparam = args[1]\n if atype == :ivar\n ret = compile_eval_arg(scope, :self)\n @e.load_instance_var(ret, aparam)\n return @e.result_value\n elsif atype == :possible_callm\n return compile_eval_arg(scope, [:callm, :self, arg,[]])\n end\n return @e.load(atype, aparam)\n end",
"def eval(string, binding=nil, filename=\"(eval)\", lineno=1)\n if !binding\n binding = Binding.setup(VariableScope.of_sender,\n CompiledMethod.of_sender,\n StaticScope.of_sender)\n\n elsif binding.__kind_of__ Proc\n binding = binding.binding\n elsif !binding.__kind_of__ Binding\n raise ArgumentError, \"unknown type of binding\"\n end\n\n context = Compiler::Context.new binding.variables, binding.code\n\n compiled_method = Compiler::Utils.compile_string string, context, filename, lineno\n compiled_method.scope = binding.static_scope\n compiled_method.name = :__eval__\n\n yield compiled_method if block_given?\n\n # This has to be setup so __FILE__ works in eval.\n script = CompiledMethod::Script.new\n script.path = filename\n compiled_method.scope.script = script\n\n # Internalize it now, since we're going to springboard to it as a block.\n compiled_method.compile\n\n be = BlockEnvironment.new\n be.under_context binding.variables, compiled_method\n\n # Pass the BlockEnvironment this binding was created from\n # down into the new BlockEnvironment we just created.\n # This indicates the \"declaration trace\" to the stack trace\n # mechanisms, which can be different from the \"call trace\"\n # in the case of, say: eval(\"caller\", a_proc_instance)\n if binding.from_proc? then\n be.proc_environment = binding.proc_environment\n end\n\n be.from_eval!\n be.call\n end",
"def compile_to_c\n operator_c_string + \"(\" + @expression.compile_to_c + \")\"\n end",
"def eval(obj, str)\n @extension.evaluate(obj, str)\n end",
"def evaluate( renderstate )\n\t\tcode = [ self.name.to_s, self.methodchain ].join( '' )\n\t\treturn renderstate.eval( code )\n\tend",
"def compile_to_ruby\n operator_ruby_string + \"(\" + @expression.compile_to_ruby + \")\"\n end",
"def compile_string(ctx, source)\n case ctx\n when Binding\n ERB.new(source, trim_mode: '->').result(ctx).split(\"\\n\")\n when Hash\n ERB.new(source, trim_mode: '->').result(\n OpenStruct.new(ctx).instance_eval { binding.of_caller(1) }\n ).split(\"\\n\")\n else\n raise TypeError, \"#{ctx.class} is not a valid type for compilation\"\n end\n end",
"def call\n eval(@code)\n end",
"def e *args\n do_conn(:eval, *args).to_ruby\n end",
"def evaluator(str,binding)\n a_value = 123\n eval(str,binding) #outputs 321\nend",
"def evaluate(expression)\n eval(expression).inspect\nend",
"def reset_eval_string\n @eval_string = ''.dup\n end",
"def eval\n execute\n end",
"def evaluate context = nil\n if Functions.available.include? self.to_sym\n send to_sym, *@args\n else\n args = @args.map { |e|\n e.parent = self.parent\n e = e.evaluate(context) if e.respond_to?(:evaluate)\n e.to_css\n } * ', '\n Node::Anonymous.new(\"#{to_sym}(#{args})\")\n end\n end",
"def eval_expression\n @input = eval(@input).to_s\n @output.text = @input\n end",
"def eval_expression\n @input = eval(@input).to_s\n @output.text = @input\n end",
"def eval_expression\n @input = eval(@input).to_s\n @output.text = @input\n end",
"def eval_function_call(args, current_cont)\n\t\t\tfunc_slot, func_args = args[:ast], args[:args]\n\t\t\tenv = args[:env]\n\t\t\t\n\t\t\tif func_slot.kind_of? LispSym\n\t\t\t\tbuildin_name = func_slot.val.to_sym\n\t\t\t\tif Buildins.singleton_methods.include? buildin_name\n\t\t\t\t\treturn current_cont.create_after Buildins.method(buildin_name), arg_ast: func_args, env: env\n\t\t\t\telse\n\t\t\t\t\treturn current_cont.heap[:error_handler].with message:\n\t\t\t\t\t\t\"Tried to call unknown buildin with the name \\\"#{buildin_name}\\\"\",\n\t\t\t\t\t\tast: LispPair.new(func_slot, func_args), backtrace: caller(0)\n\t\t\t\tend\n\t\t\telsif func_slot.kind_of? Continuation\n\t\t\t\t# If we got a continuation in the function slot eval its first argument and then\n\t\t\t\t# continue with that continuation.\n\t\t\t\treturn func_slot.create_before method(:eval), ast: func_args.first, env: env\n\t\t\telsif func_slot.kind_of? LispLambda\n\t\t\t\treturn current_cont.create_after method(:eval_lambda), lambda: func_slot, arg_ast: func_args, env: env\n\t\t\telse\n\t\t\t\treturn current_cont.heap[:error_handler].with message:\n\t\t\t\t\t\"Got unknown stuff in the function slot: #{Printer.print(func_slot)}\",\n\t\t\t\t\tast: LispPair.new(func_slot, func_args), backtrace: caller(0)\n\t\t\tend\n\t\tend",
"def rubyless_eval(params = @params)\n if @method =~ /^([A-Z]\\w+?)\\?$/\n return rubyless_class_scope($1)\n end\n\n rubyless_render(@method, params)\n rescue RubyLess::NoMethodError => err\n parser_continue(\"#{err.error_message} <span class='type'>#{err.method_with_arguments}</span> (#{node.klass} context)\")\n rescue RubyLess::Error => err\n parser_continue(err.message)\n end",
"def compile(wrap: :proc, bind: BindingHelper.empty_binding, locals: nil, pre: nil, post: nil, context_name: '_context')\n\t\t\t\tsrc=@src\n\t\t\t\tsrc=BindingHelper.local_extraction(locals, context_name: context_name)+src if locals\n\t\t\t\tsrc=pre+\"\\n\"+src if pre\n\t\t\t\tsrc<< post+\"\\n\" if post\n\t\t\t\tto_eval=case wrap\n\t\t\t\t\twhen :eval; @src\n\t\t\t\t\twhen :lambda; \"lambda { |#{context_name}| #{src} }\"\n\t\t\t\t\twhen :proc; \"Proc.new { |#{context_name}| #{src} }\"\n\t\t\t\t\twhen :module; \"Module.new { |#{context_name}| #{src} }\"\n\t\t\t\t\twhen :unbound\n\t\t\t\t\t\t#wrapping in a method allows us to pass a block to a code\n\t\t\t\t\t\t#calling yield\n\t\t\t\t\t\trequire 'dr/ruby_ext/meta_ext'\n\t\t\t\t\t\treturn Meta.get_unbound_evalmethod('eruby', src, args: context_name)\n\t\t\t\t\twhen :unbound_instance\n\t\t\t\t\t\t#here we wrap in a method that the calls instance_eval\n\t\t\t\t\t\trequire 'dr/ruby_ext/meta_ext'\n\t\t\t\t\t\treturn Meta.get_unbound_evalmethod('eruby', <<-RUBY, args: context_name)\n\t\t\t\t\t\t\tself.instance_eval do\n\t\t\t\t\t\t\t\t#{src}\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tRUBY\n\t\t\t\t\twhen :string\n\t\t\t\t\t\tsrc.to_s\n\t\t\t\t\telse \n\t\t\t\t\t\twarn \"wrap meth #{warn} not understood, defaulting to String\"\n\t\t\t\t\t\tsrc\n\t\t\t\t\tend\n\t\t\t\treturn eval(to_eval, bind, \"(wrap #{@filename})\")\n\t\t\tend",
"def eval\n @token = @lexer.next\n expression(0)\n end",
"def eval\n yield self\n end",
"def eval(str) # motor\n t = Tokenizer.new(str.to_s)\n while tok = t.next\n call(tok[1])\n end\n self\n end",
"def xp(s)\n begin\n puts s+\" #=>\"\n p eval(s)\n rescue\n puts $!\n end\n puts\nend",
"def operator_c_string\n operator_string + \" \"\n end",
"def receiver_name(sexp)\n if (global_call?(sexp))\n nil\n elsif (constant_call?(sexp))\n (receiver(sexp))[1]\n else\n receiver(sexp)\n end\n end",
"def compile_exp(scope, exp)\n return [:subexpr] if !exp || exp.size == 0\n\n if @trace\n @trace = false # A bit ugly, but prevents infinite recursion\n @e.comment(exp[0..1].inspect)\n compile_exp(scope,[:call,:puts,exp[0..1].inspect]) \n @trace = true\n end\n\n # check if exp is within predefined keywords list\n if(@@keywords.include?(exp[0]))\n return self.send(\"compile_#{exp[0].to_s}\", scope, *exp.rest)\n elsif @@oper_methods.member?(exp[0])\n return compile_callm(scope, exp[1], exp[0], exp[2..-1])\n else\n return compile_call(scope, exp[1], exp[2]) if (exp[0] == :call)\n return compile_callm(scope, exp[1], exp[2], exp[3]) if (exp[0] == :callm)\n return compile_call(scope, exp[0], exp.rest) if (exp.is_a? Array)\n end\n\n warning(\"Somewhere calling #compile_exp when they should be calling #compile_eval_arg? #{exp.inspect}\")\n res = compile_eval_arg(scope, exp[0])\n @e.save_result(res)\n return [:subexpr]\n end",
"def js_eval(str)\r\n\t #puts \"JS Eval: #{str}\"\r\n \t $jssh_socket.send(\"#{str};\\n\",0)\r\n\t value = read_socket()\r\n\t if md=/^(\\w+)Error:(.*)$/.match(value) \r\n\t eval \"class JS#{md[1]}Error\\nend\"\r\n\t raise (eval \"JS#{md[1]}Error\"), md[2]\r\n\t end\r\n\t #puts \"Value: #{value}\"\r\n\t value\r\n\t end",
"def __evaluate__(name)\n return nil unless name\n name.respond_to?(:call) ? name.call.to_sym : name.to_sym\n end",
"def eval_string\n # Toggle for extra computation level; i.e. variables (see f/b/r/l functions above)\n meta = false\n # Local holder for executable code strings\n eval_string_holder = []\n # Local holder for final JSON output code\n output = []\n # Check for invalid command sequence from above\n if @parsed_command_string\n # Go through the @parsed_command_string instance variable created above\n @parsed_command_string.each do | subcommand |\n # Checks to see if the commands are intended for the robot\n if subcommand[ 1 ].match( /((f|b|l|r) (10|20|30|40|50|60|70|80|90))/ )\n # Adds internal code to enable robot instructions to be inserted and appropriately formatted into the local output\n # holder array\n subcommand[ 1 ] = \"output.push( '#{ subcommand[ 1 ] }' )\"\n # Check for variable assignment, make sure it's not catching \"if\"\n elsif subcommand[ 1 ].match( /((f|b|l|r) x)/ ) && !subcommand[ 1 ].match( /if/ )\n # Toggle variable for extra computational level\n meta = true\n end\n # Adds code strings to be executed to local holder array\n eval_string_holder << subcommand[ 1 ]\n end\n # Combines the disparate bits of code with \";\" line separation character\n executable = eval_string_holder.join( \"; \" )\n # puts eval(eval( executable ))\n # Rescue loop\n begin\n # Execute code string; with extra layer if necessary\n meta ? eval( eval( executable ) ) : eval( executable ) \n # If there's an error...\n rescue Exception => exc\n # Beep\n print \"\\a\"\n # Execute the @rescue string instead ( defined in initilazation )\n eval( @rescue )\n end\n else\n # Beep\n print \"\\a\"\n # Rescue sequence\n eval( @rescue )\n end\n # Assign the contents of the output holder array ( formatted robot commands )to new @command_array \n # instance variable for access below\n @command_array = output\n end",
"def to_s\n (@value || call).to_s\n end",
"def evaluate_expression(expression, eval_string = '')\n if expression.is_a? Yarpler::Models::Expression\n eval_string << evaluate_expression_inner(expression).to_s\n elsif expression.is_a? Yarpler::Models::Field\n obj = @problem.objects[expression.variable].get_value(expression.attribute)\n if (obj.is_a? Yarpler::Models::Relation)\n obj = @problem.objects[obj.to.first.to_s].id\n end\n eval_string << obj.to_s\n elsif expression.is_a? Yarpler::Models::Literal\n eval_string << expression.value.to_s\n else\n fail Yarpler::Exceptions::InvalidWhereExpression.new, 'Where Expression is illegal'\n end\n eval_string\n end",
"def eval( code )\n\t\t# self.log.debug \"Evaling: %p\" [ code ]\n\t\treturn self.scope.instance_eval( code )\n\tend",
"def loadstring_and_call(s, bndng, filename, lineno)\n\n bottom = stack_top\n chunk = filename ? \"#{filename}:#{lineno}\" : 'line'\n\n err = Lib.luaL_loadbuffer(@pointer, s, s.bytesize, chunk)\n fail_if_error('eval:compile', err, bndng, filename, lineno)\n\n pcall(bottom, 0, bndng, filename, lineno) # arg_count is set to 0\n end",
"def eval\n begin\n if !func_exist?(@name)\n raise NameError, \"Function #{@name} has not been declared.\"\n else\n if @@our_debug then puts \"#{debug_time} Function called : #{@name}\" end\n para = @@func_list[@name].para\n if @args[0] != nil and para[0] != nil\n #Making sure we only get Basic_container type objects in @args\n @args.each_with_index {|arg, idx| @args[idx] = convert_obj(arg)}\n scope_increase\n @@func_list[@name].para.each {|item| item.eval }\n @args.each_with_index {|arg, idx|\n Assign_class.new(para[idx].name, arg).eval\n }\n elsif para[0] != nil\n scope_increase\n para.each {|item| item.eval }\n else\n scope_increase\n end\n ret_value = @@func_list[@name].eval\n scope_decrease\n return convert_obj(ret_value)\n end\n Bool_class.new('bool', 'FALSE')\n rescue => error\n puts error.inspect\n end\n end",
"def EvalDialString(dialString)\n if dialString =~ /^#\\{.*\\}$/\n #sys.Log(dialString[2..-2])\n\tres = eval dialString[2..-2].to_s\n\t#sys.Log(\"Result #{res}.\")\n return res\n else\n return dialString\n end\nend",
"def compile_exp(scope, exp)\n return [:subexpr] if !exp || exp.size == 0\n\n pos = exp.position rescue nil\n @e.lineno(pos) if pos\n trace(pos,exp)\n\n # check if exp is within predefined keywords list\n if(@@keywords.include?(exp[0]))\n return self.send(\"compile_#{exp[0].to_s}\", scope, *exp.rest)\n elsif @@oper_methods.member?(exp[0])\n return compile_callm(scope, exp[1], exp[0], exp[2..-1])\n else\n return compile_call(scope, exp[1], exp[2],exp[3]) if (exp[0] == :call)\n return compile_callm(scope, exp[1], exp[2], exp[3], exp[4]) if (exp[0] == :callm)\n return compile_call(scope, exp[0], exp.rest) if (exp.is_a? Array)\n end\n\n warning(\"Somewhere calling #compile_exp when they should be calling #compile_eval_arg? #{exp.inspect}\")\n res = compile_eval_arg(scope, exp[0])\n @e.save_result(res)\n return [:subexpr]\n end",
"def process_call(exp)\n receiver_node_type = exp.first.nil? ? nil : exp.first.first\n receiver = process exp.shift\n receiver = \"(#{receiver})\" if ASSIGN_NODES.include? receiver_node_type\n\n name = exp.shift\n args = []\n\n # this allows us to do both old and new sexp forms:\n exp.push(*exp.pop[1..-1]) if exp.size == 1 && exp.first.first == :arglist\n\n @calls.push name\n\n in_context :arglist do\n until exp.empty? do\n arg_type = exp.first.sexp_type\n is_empty_hash = (exp.first == s(:hash))\n arg = process exp.shift\n\n next if arg.empty?\n\n strip_hash = (arg_type == :hash and\n not BINARY.include? name and\n not is_empty_hash and\n (exp.empty? or exp.first.sexp_type == :splat))\n wrap_arg = Ruby2Ruby::ASSIGN_NODES.include? arg_type\n\n arg = arg[2..-3] if strip_hash\n arg = \"(#{arg})\" if wrap_arg\n\n args << arg\n end\n end\n\n case name\n when *BINARY then\n # CUSTOM\n \"#{receiver}#{name}#{args.join(', ')}\"\n when :[] then\n receiver ||= \"self\"\n \"#{receiver}[#{args.join(', ')}]\"\n when :[]= then\n receiver ||= \"self\"\n rhs = args.pop\n \"#{receiver}[#{args.join(', ')}] = #{rhs}\"\n when :\"-@\" then\n \"-#{receiver}\"\n when :\"+@\" then\n \"+#{receiver}\"\n # CUSTOM\n when :lambda then\n '->'\n # CUSTOM\n when :call then\n args = if args.empty?\n nil\n elsif args\n args.join(',')\n end\n\n \"#{receiver}[#{args}]\"\n else\n args = nil if args.empty?\n\n # CUSTOM\n args = if args and args.size == 1\n # It's safe to map a single arg to be spaced from\n # the receiver w/out parens in this context\n \" #{ args.first }\"\n elsif args\n \"(#{args.join(', ')})\"\n end\n\n receiver = \"#{receiver}.\" if receiver\n\n \"#{receiver}#{name}#{args}\"\n end\n ensure\n @calls.pop\n end",
"def to_s\n\t\t\"()\"\n\tend",
"def compile_eval_arg(scope, arg)\n if arg.respond_to?(:position) && arg.position != nil\n pos = arg.position.inspect\n if pos != @lastpos\n @e.lineno(arg.position)\n trace(arg.position,arg)\n end\n @lastpos = pos\n end\n args = get_arg(scope,arg)\n atype = args[0]\n aparam = args[1]\n if atype == :ivar\n ret = compile_eval_arg(scope, :self)\n @e.load_instance_var(ret, aparam)\n return @e.result_value\n elsif atype == :possible_callm\n return compile_eval_arg(scope,[:callm,:self,aparam,[]])\n end\n return @e.load(atype, aparam)\n end",
"def eval_expression\n if @input.to_i.zero?\n @input = eval(@input).to_s\n else\n @input = eval(@input).to_f.to_s\n end\n @output.text = @input\n end",
"def eval(_)\n value\n end",
"def eval(context)\n # The last value evaluated in a method is the return value.\n @nodes.map { |node| node.eval(context) }.last\n end",
"def sql_string\n StringExpression.new(self.op, *self.args)\n end",
"def execute_callstack\n @callstack.each_with_index do |statement,i|\n unless @binary_operators.include?(statement) || @unary_operators.include?(statement) || [\"(\", \")\"].include?(statement)\n values = statement.split(/(#{@comparison_operators.join(\"|\")})/)\n values.each_with_index do |val,j|\n if val =~ /.*\\(.*\\)/\n values[j] = eval(val)\n end\n end\n begin\n @callstack[i] = eval(values.join(\" \"))\n rescue Exception => e\n end\n end\n end\n exit_with_function_errors unless @function_errors.empty?\n eval @callstack.join(\" \")\n end",
"def f; @function.to_s; end",
"def _eval_utag(buffer, value)\n value = value.call.to_s if value.is_a?(Proc)\n buffer.safe_concat(value.to_s)\n end",
"def evaluate(expr)\n @api.function_for_object_method(self, :eval).call(@session, expr)\n end",
"def to_s\n format 'evaluate %s', tag_name(@recursive_name)\n end",
"def process_dasgn_curr(exp) # TODO: audit against obfuscator\n var = exp.shift\n @env.add var.to_sym, exp.c_type\n return var.to_s\n end",
"def evaluate(_interpreter, arg_stack)\n args = arg_stack.pop\n\n return @cached unless @cached.nil?\n\n if match_args_to_signature(args, @signature1)\n res = TextValue.new(args[0].to_s)\n elsif match_args_to_signature(args, @signature2)\n places = args[1].to_i\n value = args[0].to_f\n text = format('%.*f', places, value)\n res = TextValue.new(text)\n else\n raise BASICRuntimeError.new(:te_args_no_match, @name)\n end\n\n @cached = res if @constant && $options['cache_const_expr']\n res\n end",
"def process_fcall(exp)\n method = exp.shift\n args = exp.shift\n\n str = without_result do\n generate_method_call(@model.encode_self, method, get_iter(), args)\n end\n\n resultify(str)\n end",
"def to_text\n \"#{name}: #{call}\"\n end",
"def eval(input)\n unless input.respond_to?(:eof?)\n input = StringInput.new(input.to_s)\n end\n return_flag = nil\n result = \"\"\n while not input.eof?\n result = eval_command(parse_command(input))\n if @return_flag\n break\n end\n end\n return result\n end",
"def src\n \"#{@cur_method.first.first} | #{@cur_method.map(&:first)[1..-1].join('.')}\"\n end",
"def new_function_text(line, matchdata, randomized_name)\n \"#{line}\n record = {}\n method(__method__).parameters.each{|arg| record[arg[1].to_s] = (eval arg[1].to_s)}\n RECORDER.push([\\\"#{matchdata[2]}\\\", record, \\\"called\\\"])\n x = #{randomized_name}(*(record.values))\n RECORDER.push([\\\"#{matchdata[2]}\\\", x, \\\"returned\\\"])\n return x\nend\n\n#{matchdata[1]}#{randomized_name}#{matchdata[3]}\n \"\nend",
"def evaluate(interpreter, arg_stack)\n if previous_is_array(arg_stack)\n args = arg_stack.pop\n\n return @cached unless @cached.nil?\n\n if match_args_to_signature(args, @signature0)\n res = interpreter.error_code\n else\n raise BASICRuntimeError.new(:te_args_no_match, @name)\n end\n else\n res = interpreter.error_code\n end\n\n @cached = res if @constant && $options['cache_const_expr']\n res\n end",
"def evaluate(expr = '', locals: {})\n eval(expr, local_vars(binding, locals))\n rescue NoMethodError, TypeError => ex\n nil\n end",
"def call_method_from_string(str_method)\n eval(str_method)\nend",
"def compile(exp)\n \"\\\"#{compile!(exp)}\\\"\"\n end",
"def to_s\n evaluated_message.to_s\n end",
"def bb_eval(str, b = get_binding)\n b.eval(str)\n rescue StandardError, ScriptError => e\n at = e.backtrace\n locations = []\n locations << \"#{at.shift}: #{e.class} Exception(#{e.message})\"\n locations += at.map { |path| \"\\tfrom #{path}\" }\n\n errmsg(pr('eval.exception', text_message: locations.join(\"\\n\")))\n nil\n end",
"def generate_method_call_receiver_exp(recv_exp, method, iter, args)\n generate_method_call(receiver_exp(recv_exp), method, iter, args)\n end",
"def kl_eval(str)\n form = Kl::Reader.new(StringIO.new(str)).next\n @kl_env.__eval(form)\nend",
"def evaluation_detail\n name\n end",
"def this_method_name\n caller[0] =~ /`([^']*)'/ and $1\n end",
"def text_eval(text, src_file=@inclusion_stack[-1], context=@variable_dict, skip=0)\n text.items[skip..-1].reduce('') do |string, item|\n case item\n when Chars\n string.concat item.string.to_s\n when VariableSub\n var_name = item.var_name.to_s\n var_value = context[var_name]\n if var_value\n string.concat var_value\n else\n line, column = item.var_name.line_and_column\n raise \"Variable `#{var_name}' in #{src_file} at #{line}:#{column} is not defined.\"\n end\n when CommandSub\n command = text_eval(item.cmd_text, src_file, context)\n stdout, stderr, status = Open3.capture3(command, :chdir=>@variable_dict['BASE'])\n if status.success?\n string.concat stdout.chomp\n else\n line, column = text_line_and_column item.cmd_text\n raise \"Command `#{command}' in #{src_file} at #{line}:#{column} failed \" +\n \"with EXIT_STATUS:#{status.exitstatus} and STDERR:\\n#{stderr}\"\n end\n else # For Escaped Char\n string.concat item.to_s\n end\n string\n end\n end",
"def safe_eval_string(code)\n ruby = RubyLess.translate_string(self, code)\n eval(ruby)\n end",
"def to_s\n operator_string + \" \" + @expression.to_s\n end",
"def eval_string(s)\n forms = __apply(:\"read-from-string\", [s])\n result = nil\n forms.each { |f| result = __apply(:eval, [f]) }\n result\n end",
"def this_method_name\n caller[0] =~ /`([^']*)'/ and $1\n end",
"def this_method_name\n caller[0] =~ /`([^']*)'/ and $1\n end",
"def this_method_name\n caller[0] =~ /`([^']*)'/ and $1\n end",
"def eval_expression\n @evaluated_expression =\n ConlangWordGenerator::run_expression(@full_expression, @bindings)\n end",
"def eval\n @block.eval\n end",
"def generate_method_call(receiver, method, iter, args)\n\n method_name = @model.encode_method(method)\n @model.add_method_call(method_name)\n\n without_result do\n want_expression do\n if args.nil?\n # no arguments\n #\n # NOTE: We don't have to encode an iter of \"nil\" as \"nil\".\n # Instead we save us the space and check for undefined in the\n # method definition.\n \"#{receiver}.#{method_name}(#{iter})\"\n elsif args.first == :array\n # one or more arguments\n args_string = args[1..-1].map{|a| process(a)}.join(\",\")\n \"#{receiver}.#{method_name}(#{iter || @model.encode_nil},#{args_string})\"\n elsif args.first == :splat or args.first == :argscat\n #\n # puts(*a) # => [:fcall, :puts, [:splat, [:lvar, :a]]]]]]\n #\n # puts(1, *a) # => ... [:argscat, [:array, [:lit, 1]], [:lvar, :a]]\n #\n @model.add_method_call(__invoke = @model.encode_method('__invoke'))\n \"#{receiver}.#{__invoke}(#{iter || @model.encode_nil},'#{method_name}',#{ process(args) })\"\n else\n raise\n end\n end\n end\n end",
"def eval_expression\n eval(expression, binding)\n end",
"def evaluate_equation(string)\n actual_result = eval(string.chars.join(''))\n actual_result\n end",
"def zen\n begin\n p eval \"(40 + 2) / 2\"\n p eval \"(40 + 2) \\ 2\"\n p eval \"4, 8, 15, 16, 23, 42\"\n rescue SyntaxError => error\n puts error.backtrace\n end\nend",
"def on_call_string(context, expression = nil)\n if expression\n convert = process(expression, context)\n\n if convert.is_a?(XML::NodeSet)\n convert = convert[0]\n end\n else\n convert = context.first\n end\n\n if convert.respond_to?(:text)\n return convert.text\n else\n return to_string(convert)\n end\n end",
"def eval_file; end",
"def compile(str)\n @compiled[str]\n end"
] | [
"0.6169209",
"0.6132331",
"0.59505296",
"0.593356",
"0.5745648",
"0.57366455",
"0.5699014",
"0.5663234",
"0.5615437",
"0.56154007",
"0.5581526",
"0.5554907",
"0.55529386",
"0.551529",
"0.5507912",
"0.5504082",
"0.5475119",
"0.5472345",
"0.5456916",
"0.54453486",
"0.54262865",
"0.5414048",
"0.53996027",
"0.5387392",
"0.53821313",
"0.5372635",
"0.5367797",
"0.5323748",
"0.53223675",
"0.5301931",
"0.529407",
"0.5284215",
"0.52623665",
"0.5252576",
"0.5252576",
"0.5219883",
"0.5205227",
"0.5197378",
"0.5191456",
"0.5155785",
"0.51473325",
"0.513386",
"0.51177007",
"0.5111501",
"0.5095551",
"0.50926256",
"0.5071817",
"0.506989",
"0.50660646",
"0.5062365",
"0.5060592",
"0.50492734",
"0.5046578",
"0.50399745",
"0.50388217",
"0.5033973",
"0.50219274",
"0.5021606",
"0.50076425",
"0.50035226",
"0.499722",
"0.49953458",
"0.49920687",
"0.49907947",
"0.49901083",
"0.4984979",
"0.4980593",
"0.4962383",
"0.4960919",
"0.4958856",
"0.49550307",
"0.4943421",
"0.49307352",
"0.4929539",
"0.4926204",
"0.49230886",
"0.49194536",
"0.490156",
"0.48982126",
"0.48972037",
"0.48877567",
"0.4886435",
"0.48858756",
"0.48767853",
"0.48735425",
"0.48728576",
"0.48630416",
"0.48629865",
"0.4861886",
"0.4861886",
"0.4861886",
"0.48582375",
"0.4856434",
"0.4844578",
"0.48439336",
"0.4842166",
"0.48349902",
"0.48327523",
"0.48273432",
"0.4808007"
] | 0.76864433 | 0 |
Return true if frame1 and frame2 are at the same place. We use this for example in detecting tail recursion. | def location_equal(frame1, frame2)
frame1 && frame2 && frame1.source_location == frame2.source_location &&
frame1.pc_offset == frame2.pc_offset &&
frame1.source_container == frame2.source_container
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def location_equal(other_frame)\n # if self && other_frame \n # puts(self.vm_location.line, other_frame.vm_location.line, \n # self.vm_location.ip, other_frame.vm_location.ip, \n # self.vm_location.method.active_path, other_frame.vm_locaion.method.actionve_path)\n # end\n self && other_frame && self.vm_location.line == other_frame.vm_location.line &&\n self.vm_location.ip == other_frame.vm_location.ip && \n self.vm_location.method.active_path == other_frame.vm_location.method.active_path\n end",
"def second_shot_complete? frame\n frame.shot_2 != nil\n end",
"def same?(other)\n (from_end == other.from_end and\n to_end == other.to_end and\n overlap == other.overlap)\n end",
"def same?(other)\n (from_end == other.from_end and\n to_end == other.to_end and\n overlap == other.overlap)\n end",
"def same_pos?(pos1, pos2)\n pos1 = pos1.pos if pos1.respond_to?(:pos)\n pos2 = pos2.pos if pos2.respond_to?(:pos)\n pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z\n end",
"def same_pos?(pos1, pos2)\n pos1 = pos1.pos if pos1.respond_to?(:pos)\n pos2 = pos2.pos if pos2.respond_to?(:pos)\n pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z\n end",
"def crossing?(other)\n return false unless overlaps?(other)\n (@begin_pos <=> other.begin_pos) * (@end_pos <=> other.end_pos) == 1\n end",
"def crossing?(other); end",
"def crossing?(other); end",
"def crossing?(other); end",
"def finished?\n sorted_frames = frames.sort {|a,b| a.number <=> b.number}\n finished = true\n if sorted_frames.length == 10\n sorted_frames.zip(1..10).each do |frame_index_pair|\n if frame_index_pair[0].number != frame_index_pair[1]\n finished = false\n end\n end\n else\n finished = false\n end\n return finished\n end",
"def same_cursor_position?\n window.cursor[1] == @history.start_pos && \n window.cursor[0] == @history.line_number\n end",
"def current_stack_match?\n parent_stack = @stack[0..-2]\n\n return false unless dom_stubs[@stack].at_xpath(@xpath)\n\n parent_stack.empty? || !dom_stubs[parent_stack].at_xpath(@xpath)\n end",
"def coincident?(other)\n center.distance(other.center) == 0 and @r == other.r\n end",
"def same?(point, delta = POINT_DELTA)\n if ((@x + delta > point.x && @x - delta < point.x &&\n @y + delta > point.y && @y - delta < point.y))\n return true\n end\n return false\n end",
"def equal\n <<-CODE\n t1 = stack_pop();\n t2 = stack_pop();\n stack_push(t1 == t2 ? Qtrue : Qfalse);\n CODE\n end",
"def zip?(other)\n tail.equal? other.tail \n end",
"def ==(other)\n @prev_out == other.prev_out &&\n @prev_out_index == other.prev_out_index &&\n @script_sig == other.script_sig &&\n @sequence == other.sequence\n end",
"def eql?(other)\n return false unless other.captures_hash == captures_hash\n return false unless other.squares_hash == squares_hash\n return false unless other.turn == turn\n return false unless other.state == state\n\n true\n end",
"def fast_forward?\n branch_merge && ancestor != remote &&\n ancestor == @local_parent &&\n @local_parent.branch != remote.branch\n end",
"def frame?\n current_frame = []\n @scorecard.each do |key, value|\n current_frame << key if value.framescore[:roll_1].nil? || value.framescore[:roll_2].nil?\n end\n current_frame.sort\n # to get the current frame as an integer, use this:\n # p current_frame[0][-1].to_i\n current_frame[0]\n end",
"def overlap?(object1, object2)\n\t#upper left corner\n\tlx1 = object1.x\n\tly1 = object1.y\n\n\tlx2 = object2.x\n\tly2 = object2.y\n\t\n\t#lower right corner\n\trx1 = object1.x + object1.class::WIDTH\n\try1 = object1.y + object1.class::HEIGHT\n\n\trx2 = object2.x + object2.class::WIDTH\n\try2 = object2.y + object2.class::HEIGHT\n\n\tif rx1 - lx2 < 5 or\n\t\t\trx2 - lx1 < 5 then\n\t\treturn false\n\tend\n\n\tif ry1 - ly2 < 5 or\n\t\t\try2 - ly1 < 5 then\n\t\treturn false\n\tend\n\n\treturn true\nend",
"def is_one_away(a, b)\n ptr_a = 0\n ptr_b = 0\n one_away = false\n # 1)\n if a.length == b.length\n # 2)\n for i in 0...(a.length)\n if a[i] != b[i] && !one_away\n one_away = true\n elsif a[i] != b[i] && one_away\n return false\n end\n return true\n end\n else # 3)\n if (a.length - b.length).abs > 1\n return false\n elsif a.length > b.length\n for i in 0...(a.length)\n if a[i] == b[ptr_b]\n ptr_b += 1\n elsif a[i] != b[ptr_b] && !one_away\n one_away = true\n elsif a[i] != b[ptr_b] && one_away\n return false\n end\n end\n return true\n elsif a.length < b.length\n for i in 0...(b.length)\n if b[i] == a[ptr_a]\n ptr_a += 1\n elsif b[i] != a[ptr_a] && !one_away\n one_away = true\n elsif b[i] != a[ptr_a] && one_away\n return false\n end\n end\n return true\n end\n end\nend",
"def check_previous_hashes(block1, block2)\n unless block2.previous_hash.strip.eql? block1.current_hash.strip\n puts \"Line #{block2.block_number}: Previous hash was #{block2.previous_hash.strip},\n \tshould be #{block1.current_hash.strip}\"\n return false\n end\n true\n end",
"def duplicate?(new_seg)\n @segs.each do |seg|\n return true if new_seg == seg\n end\n false\n end",
"def leaf_similar(root1, root2)\n stack1 = [root1]\n stack2 = [root2]\n\n until stack1.empty? && stack2.empty?\n return false if dfs(stack1) != dfs(stack2)\n end\n\n stack1.empty? && stack2.empty?\nend",
"def circular?\n self.overlaps.size == self.segment_names.size\n end",
"def lane_equal other_sample\n [:genome, :protocol].each do |lane_data|\n # puts \"#{self.send(lane_data)}\"\n if self.send(lane_data) != other_sample.send(lane_data)\n return false\n end\n end\n true\n end",
"def equals?(position)\n @x == position.x && @y == position.y\n end",
"def skipping_frame?\n return @frame_to_skip > 0\n end",
"def done?\n @next_frame == @total_frames\n end",
"def overlaps?(other); end",
"def overlaps?(other); end",
"def overlaps?(other); end",
"def samedirection?(vector2)\n end",
"def are_colliding?(obj1, obj2)\n obj1.center_x == obj2.center_x && obj1.center_y == obj2.center_y\n end",
"def reverse?(other)\n (from_end == other.to_end and\n to_end == other.from_end and\n overlap == other.reverse_overlap)\n end",
"def hit_itself?\n # list.uniq removes all repeated elements from a list\n @positions.uniq.length != @positions.length\n end",
"def collision_between obj1, obj2\n\t\t\tif obj1.y + obj1.height < obj2.y ; return false ; end\n\t\t\tif obj1.y > obj2.y + obj2.height ; return false ; end\n\t\t\tif obj1.x + obj1.width < obj2.x ; return false ; end\n\t\t\tif obj1.x > obj2.x + obj2.width ; return false ; end\n\t\t\treturn true\n\t\tend",
"def overlap_ok?\n # if overlap: true\n end",
"def capture_stack?\n @capture_stack\n end",
"def intersects?(other)\n if origin <= other.origin\n vertices.each { |vertex| return true if vertex > other.origin }\n else\n other.vertices.each { |vertex| return true if vertex > origin }\n end\n false\n end",
"def same_scope?(other)\n Array(nil).all? do |attr|\n self.send(attr) == other.send(attr)\n end\n end",
"def framed?\n dim_type.outer_target == \"frame\"\n end",
"def reachable? begTile, endTile\n x = begTile.x\n y = begTile.y\n self.move_one begTile if @tiles.empty?\n return @tiles.include? endTile\n end",
"def separate?(other)\n center.distance(other.center) > @r + other.r\n end",
"def within_frame(frame_id)\n return unless @current_frame = find_frame(frame_id)\n yield\n true\n ensure\n @current_frame = nil\n end",
"def ==(other)\n return false unless other.is_a? MoveTreeNode\n\n @loc == other.loc\n end",
"def been_to?(matrix)\n previous_states.each do |state|\n return true if matrix[0] == state[0] &&\n matrix[1] == state[1] &&\n matrix[2] == state[2]\n end\n\n false\n end",
"def same?(other)\n bag == other.bag && path == other.path\n end",
"def eql? other\n other.is_a?(TraceContext) &&\n trace_id == other.trace_id &&\n new? == other.new? &&\n span_id == other.span_id &&\n sampled? == other.sampled? &&\n capture_stack? == other.capture_stack?\n end",
"def eql?(other)\n @left == other.left && @middle == other.middle && @right == other.right\n end",
"def complement?(other)\n (from_end == other.to_end and\n to_end == other.from_end and\n overlap == other.complement_overlap)\n end",
"def ==(other)\n stack == other.stack && options == other.options\n end",
"def ==(other)\n stack == other.stack && options == other.options\n end",
"def is_identical?(node1,node2)\n if (node1.nil? && node2.nil?)\n return true\n elsif !node1.nil? && !node2.nil?\n\n return node1.value == node2.value &&\n is_identical?(node1.left, node2.left) &&\n is_identical?(node1.right, node2.right)\n\n elsif (node1.nil? && !node2.nil?) || (node2.nil? && !node1.nil?)\n return false\n end\n\n end",
"def checkCollision?(other)\n refresh()\n other.refresh()\n \n xMin = @center_left[X]\n xMax = @center_right[X]\n yMin = @center_bottom[Y]\n yMax = @center_top[Y]\n\n xMax > other.center_left[X] && xMin < other.center_right[X] && \n yMin > other.center_top[Y] && yMax < other.center_bottom[Y]\n end",
"def contains_loop?()\n no_zeros = @hops.map { |hop| hop.ip }.find_all { |ip| ip != \"0.0.0.0\" }\n adjacents_removed = Path.new(@src, @dst)\n\n (0..(no_zeros.size-2)).each do |i|\n adjacents_removed << no_zeros[i] if no_zeros[i] != no_zeros[i+1]\n end\n adjacents_removed << no_zeros[-1] unless no_zeros.empty?\n\n return adjacents_removed.uniq.size != adjacents_removed.size\n end",
"def identical?(node1, node2)\n if node1.nil? || node2.nil?\n return false\n elsif node1.value != node2.value\n return false\n elsif node1.left_child.nil? && node2.left_child.nil? && node1.right_child.nil? && node2.right_child.nil?\n return true\n else\n left_identical = identical?(node1.left_child, node2.left_child)\n right_identical = identical?(node1.right_child, node2.right_child)\n return left_identical && right_identical\n end\nend",
"def over_roll?(pins)\n over_frame = @current_frame.over?(pins)\n last_frame = @frames.length == 10\n over_frame && (!last_frame || !@current_frame.strike?)\n end",
"def draw?\n\t$p1 == $p2\nend",
"def touch?( other )\n\t\tcommon_leaves = [ ]\n\t\tother.leaves.each do |leaf|\n\t\t\[email protected]?(leaf) and common_leaves << leaf\n\t\tend\n\t\tif common_leaves.size > 0\n\t\t\tcommon_leaves.first\n\t\telse\n\t\t\tfalse\n\t\tend\n\tend",
"def ==(other)\n self.class === other and @sequence == other.sequence\n end",
"def overlapping?(left, right)\n (tuples(left) & tuples(right)).any?\n end",
"def has_frame?(frame_name)\n frame_text = self.redirect {$ie.show_frames}\n !frame_text.match(\"#{frame_name}\").nil?\n end",
"def has_frame?(frame_name)\n frame_text = self.redirect {$ie.show_frames}\n !frame_text.match(\"#{frame_name}\").nil?\n end",
"def snapshots_match?(s1, s2)\n s1 == s2\n end",
"def same?(other)\n other.hour == @hour and other.minute == @minute and other.second == @second and other.millis == @millis\n end",
"def same_tracks_as?(other_pattern)\n @tracks.keys.each do |track_name|\n other_pattern_track = other_pattern.tracks[track_name]\n if other_pattern_track.nil? || @tracks[track_name].rhythm != other_pattern_track.rhythm\n return false\n end\n end\n\n @tracks.length == other_pattern.tracks.length\n end",
"def ignore_frame?(frame)\n\t\t\t\tif self.closed?\n\t\t\t\t\t# puts \"ignore_frame? #{frame.stream_id} -> #{valid_remote_stream_id?(frame.stream_id)} > #{@remote_stream_id}\"\n\t\t\t\t\tif valid_remote_stream_id?(frame.stream_id)\n\t\t\t\t\t\treturn frame.stream_id > @remote_stream_id\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend",
"def same_tracks_as?(other_pattern)\n @tracks.keys.each do |track_name|\n other_pattern_track = other_pattern.tracks[track_name]\n if other_pattern_track == nil || @tracks[track_name].rhythm != other_pattern_track.rhythm\n return false\n end\n end\n \n return @tracks.length == other_pattern.tracks.length\n end",
"def MovingSomeShit(pos1, pos2)\n p = self[pos1]\n target = self[pos2]\n begin\n if p\n @moves = p\n if moves(pos2)\n if p && target\n Notice(p, target)\n else\n self[pos1], self[pos2] = self[pos2], self[pos1]\n end\n p\n return true\n end\n end\n end\n end",
"def isSame(tab)\n for x in 0..3\n for y in 0..3\n return(false) if (self.val(x,y) != tab.val(x,y)) ;\n end\n end\n return true ;\n end",
"def one_away?(a, b)\n if(abs(a.length - b.length) > 1)\n false\n #replacement?\n elsif(a.length == b.length)\n if(a == b)\n true\n else\n one_operation?(a, b, :setbyte)\n end\n #insertion or deletion\n else\n if(a.length > b.length)\n one_operation?(a, b, :insert)\n else\n one_operation?(b, a, :insert)\n end\n end\n end",
"def colliding?(block)\n x2 > block.x1 &&\n x1 < block.x2 &&\n y2 > block.y1 &&\n y1 < block.y2 &&\n z2 > block.z1 &&\n z1 < block.z2\n end",
"def final_frame_complete?\n if roll_final_frame_first_strike? || roll_final_frame_second_strike? ||\n final_frame_spare?\n current_frame.length == 3\n else\n current_frame == 2\n end\n end",
"def collision?(other_position)\n collision = @visible && @position.within_diameter?(@diameter, other_position)\n @reward = @reward_function.call if collision\n return collision\n end",
"def has_route_a?(a, b)\n res = has_route_from_to?(a, b)\n reset_visited(a)\n\n if res\n return true\n end\n\n res = has_route_from_to?(b, a)\n reset_visited(b)\n res\nend",
"def similar_to?(other)\n self.composition == other.composition\n end",
"def equal_by_trans?(g1, g2)\n check_pre((\n (graph_obj?(g1)) and\n (graph_obj?(g2))\n ))\n\n # pick two points\n # sub p1 from p2\n # translate p2 by diff\n # check equal_by_tree\n\n if not equal_by_dim?(g1, g2)\n return false\n end\n\n p1 = shape_lowest_left_point(g1)\n p2 = shape_lowest_left_point(g2)\n\n tp1 = p1 - p2\n tg1 = g2.translate(tp1)\n\n return equal_by_tree?(g1, tg1)\nend",
"def gap?(this_slot, next_slot)\n !(next_slot.nil? || finish_of(this_slot) == start_of(next_slot))\n end",
"def intersects?(other)\n if !(self.x2 < other.x1) &&\n !(other.x2 < self.x1) &&\n !(self.y2 < other.y1) &&\n !(other.y2 < self.y1) &&\n !(self.z2 < other.z1) &&\n !(other.z2 < self.z1)\n return true\n else\n return false\n end\n end",
"def suitable_frame?(frame)\n renderer.frame_exists?(frame) && suitable_frame_by_colors?(frame)\n end",
"def backedge_target?(source)\n return false unless loopheader?\n # if the loopnest of the source is smaller than ours, it is certainly not in the same loop\n return false unless source.loopnest >= loopnest\n # if the source is in the same loop, our loops are a suffix of theirs\n # as loop nests form a tree, the suffices are equal if there first element is\n source_loop_index = source.loopnest - loopnest\n source.loops[source_loop_index] == self.loop\n end",
"def eql?(other)\n if( other.kind_of?(CallableRef) || (other.respond_to?(:name) && other.respond_to?(:depth)) )\n other.name == self.name && other.depth == self.depth\n else\n false\n end\n end",
"def deuce?\n @player1.points == 3 && @player2.points == 3\n end",
"def is_at?( x, y )\n return x == @x && y == @y\n end",
"def eql?(other_grid)\n return @id == other_grid.id\n #return @id == other_grid.id\n #result = false\n #if other_grid.x == @x && other_grid.y == @y \n # result = true\n # for y in 0...other_grid.y do\n # for x in 0...other_grid.x do\n # unless other_grid.block(x, y) == self.block(x, y)\n#\t result = false\n#\t break\n#\t end\n#\tend\n# end\n# end\n# result\n end",
"def look_same_as?(other)\n return nil unless other.kind_of?(self.class)\n (name == other.name) and (definition == other.definition)\n end",
"def same_time?(other)\n return false unless self.b == other.b\n return true if self.n.zero? && other.n.zero?\n self_div = Rational(self.n, self.d)\n other_div = Rational(other.n, other.d)\n self_div == other_div\n end",
"def eql?(other)\n return false unless other.respond_to?(:coords)\n equal = true\n self.coords.each_with_index do |c, i|\n if (c - other.coords.to_a[i])**2 > PRECISION\n equal = false\n break\n end\n end\n equal\n end",
"def notes_in_the_same_graph?\n if self.source_note.nil? \n return false\n end\n if self.target_note.nil? \n return false\n end\n return self.source_note.graph == self.target_note.graph\n end",
"def intersects?(other)\n return false if self.equal?(other)\n !(above?(other) || below?(other) || right_of?(other) || left_of?(other) || behind?(other) || in_front_of?(other))\n end",
"def one_away(first, second)\n if first.length == second.length\n return replaced?(first, second)\n elsif first.length + 1 == second.length\n return insert?(first, second)\n elsif first.length == second.length + 1\n return insert?(second, first)\n end\n\n false\nend",
"def two_pawns?\n @previous_piece.symbol == \" \\u265F \" && @active_piece.symbol == \" \\u265F \"\n end",
"def crash?\n @position.length != @position.uniq.length\n end",
"def equal?(point)\r\n return true if @x == point.x and @y == point.y\r\n return false\r\n end",
"def same_land?(other)\n land == other.land\n end",
"def betting_order?(screen_name_first, screen_name_second)\n if button?(screen_name_first)\n false\n elsif button?(screen_name_second)\n true\n else\n position(screen_name_first) < position(screen_name_second)\n end\n end",
"def same_length?\n @first.length == @second.length\n end"
] | [
"0.7118627",
"0.662954",
"0.6567314",
"0.6567314",
"0.6483421",
"0.6483421",
"0.6194595",
"0.6100733",
"0.6100733",
"0.6100733",
"0.604208",
"0.5976597",
"0.59662545",
"0.5863789",
"0.5811881",
"0.5798389",
"0.57770544",
"0.5776023",
"0.5766855",
"0.57663816",
"0.57617146",
"0.5753002",
"0.5724212",
"0.5715557",
"0.57137644",
"0.5699823",
"0.5699455",
"0.5698859",
"0.56982166",
"0.5685025",
"0.56848687",
"0.5682999",
"0.5682999",
"0.5682999",
"0.568074",
"0.56723666",
"0.56687623",
"0.5667594",
"0.56650984",
"0.56644475",
"0.56375724",
"0.5626143",
"0.560621",
"0.56049126",
"0.5594367",
"0.55839247",
"0.5575875",
"0.5574306",
"0.55697423",
"0.5561622",
"0.5559107",
"0.5558047",
"0.55511993",
"0.5549748",
"0.5549748",
"0.55471325",
"0.55398935",
"0.55245286",
"0.55171126",
"0.5516678",
"0.5515615",
"0.5513502",
"0.5492304",
"0.54857564",
"0.5480351",
"0.5480351",
"0.5479151",
"0.5478448",
"0.5473386",
"0.5472029",
"0.5471263",
"0.5470983",
"0.5466124",
"0.5465568",
"0.5457166",
"0.545517",
"0.5454802",
"0.5453441",
"0.54501915",
"0.54451966",
"0.544017",
"0.5436506",
"0.5435824",
"0.54348993",
"0.54316896",
"0.54311484",
"0.54255897",
"0.5421037",
"0.5417696",
"0.54169637",
"0.5416279",
"0.54158485",
"0.5412733",
"0.54095554",
"0.54074246",
"0.5402872",
"0.5401939",
"0.54007995",
"0.5398629",
"0.53968596"
] | 0.8015964 | 0 |
Print `count' frame entries | def print_stack_trace(frame, opts={})
opts = DEFAULT_STACK_TRACE_SETTINGS.merge(opts)
halfstack = (opts[:maxstack]+1) / 2
n = frame.stack_size
n = [n, opts[:count]].min if opts[:count]
if n > (halfstack * 2)
print_stack_trace_from_to(0, halfstack-1, frame, opts)
msg "... %d levels ..." % (n - halfstack*2)
last_frame = print_stack_trace_from_to(n - halfstack, n-1, frame, opts)
else
last_frame = print_stack_trace_from_to(0, n-1, frame, opts)
end
msg "(More stack frames follow...)" if last_frame.type != 'TOP'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show_frame(count)\n\n clear_screen()\n\n if count == 0\n 12.times {puts \" \"}\n elsif count == 1\n 9.times {puts \" \"}\n puts \" _________ \"\n 2.times {puts \" \"}\n elsif count == 2\n 3.times {puts \" \"}\n puts \" | \"\n puts \" | \"\n puts \" | \"\n puts \" | \"\n puts \" | \"\n puts \" | \"\n puts \" ____|____ \"\n 2.times {puts \" \"}\n elsif count == 3\n 2.times {puts \" \"}\n puts \" ______ \"\n puts \" | \"\n puts \" | \"\n puts \" | \"\n puts \" | \"\n puts \" | \"\n puts \" | \"\n puts \" ____|____ \"\n 2.times {puts \" \"}\n elsif count == 4\n 2.times {puts \" \"}\n puts \" ______ \"\n puts \" | | \"\n puts \" | | \"\n puts \" | \"\n puts \" | \"\n puts \" | \"\n puts \" | \"\n puts \" ____|____ \"\n 2.times {puts \" \"}\n elsif count == 5\n 2.times {puts \" \"}\n puts \" ______ \"\n puts \" | | \"\n puts \" | | \"\n puts \" | O \"\n puts \" | \"\n puts \" | \"\n puts \" | \"\n puts \" ____|____ \"\n 2.times {puts \" \"}\n elsif count == 6\n 2.times {puts \" \"}\n puts \" ______ \"\n puts \" | | \"\n puts \" | | \"\n puts \" | O \"\n puts \" | | \"\n puts \" | \"\n puts \" | \"\n puts \" ____|____ \"\n 2.times {puts \" \"}\n elsif count == 7\n 2.times {puts \" \"}\n puts \" ______ \"\n puts \" | | \"\n puts \" | | \"\n puts \" | O \"\n puts \" | /| \"\n puts \" | \"\n puts \" | \"\n puts \" ____|____ \"\n 2.times {puts \" \"}\n elsif count == 8\n 2.times {puts \" \"}\n puts \" ______ \"\n puts \" | | \"\n puts \" | | \"\n puts \" | O \"\n puts \" | /|\\\\ \"\n puts \" | \"\n puts \" | \"\n puts \" ____|____ \"\n 2.times {puts \" \"}\n elsif count == 9\n 2.times {puts \" \"}\n puts \" ______ \"\n puts \" | | \"\n puts \" | | \"\n puts \" | O \"\n puts \" | /|\\\\ \"\n puts \" | / \"\n puts \" | \"\n puts \" ____|____ \"\n 2.times {puts \" \"}\n elsif count == 10\n 2.times {puts \" \"}\n puts \" ______ \"\n puts \" | | \"\n puts \" | | \"\n puts \" | O \"\n puts \" | /|\\\\ \"\n puts \" | / \\\\ \"\n puts \" | \"\n puts \" ____|____ \"\n 2.times {puts \" \"}\n end\n\nend",
"def opx_print_tabulator_count(tab)\n opx_print(\"Tabulator Count\\n\")\n opx_print(YAML::dump(tab.tabulator_count))\n opx_print(\"\\n\")\n rescue => e\n opx_err(\"Fatal failure during YAML::dump of Tabulator Count\", e)\n end",
"def count\r\n\t\tputs \"There are \" + @yield.to_s + \" oranges.\"\r\n\tend",
"def print_log\n puts \"Nr | Codes #{\"-\" * (@code_length * 4 - 9)} | white hit | black hit |\"\n count = @max_rounds\n @max_rounds.times do\n count -= 1\n if count >= @log.length\n puts \"#{sprintf('%02d', count + 1)} |#{\" |\" * (@code_length)} | |\"\n else\n row = @log[count]\n code = row[:code].join(' | ')\n puts sprintf('%02d | %s | %d | %d |', count + 1, code, row[:hits][:white], row[:hits][:black])\n end\n end\n end",
"def inspect\n sprintf(\"#<%s:%#0x(%s)>\", self.class.name, __id__, count.to_s)\n end",
"def print_counts(hash)\n hash.each { |key, count| puts \"#{key} -- #{count}\\n---------\\n\" }\nend",
"def frames\n _nudge[3]\n end",
"def printState(count,md,mq,ac)\n\tputs(count.to_s(2))\n\tputs(\"MD:\" + md.join)\n\tputs(\"AC:\" + ac.join)\n\tputs(\"MQ:\" + mq.join)\nend",
"def show_basic\n puts \"#{@total_packet_count} total packets captured\"\n puts \"#{@rinda_packet_count} Rinda packets captured\"\n puts \"#{@drb_packet_count} DRb packets captured\"\n puts \"#{@drb_messages_sent} messages sent\"\n puts \"#{@drb_results_received} results received\"\n puts \"#{@drb_exceptions_raised} exceptions raised\"\n end",
"def printInfo(count, store)\n for i in 0..store.size-1\n print store[i]\n print \" => \"\n puts count[i]\n end #end for\nend",
"def print\n (1..5).each do |l|\n out = printByLine(l) + \"\\n\"\n STDOUT << (VROW.include?(l) ? out*@size : out )\n end\n end",
"def show_frame()\n\n 2.times {puts \" \"}\n puts \" ______ \"\n puts \" | | \"\n puts \" | | \"\n puts \" | O \"\n puts \" | /|\\\\ \"\n puts \" | / \\\\ \"\n puts \" | \"\n puts \" ____|____ \"\n 2.times {puts \" \"}\n\nend",
"def bubble_print_count\n @bubble.print_count\n end",
"def print_rotation_count\n @rotation_count += 1\n print \"\\r\\e#{@rotation_count} of #{@maximum_rotations} processed...\"\n $stdout.flush\n end",
"def print(list)\n\tlist.each do |key,value|\n\t\tputs \"There is #{value} count of #{key}\"\n\n end\nend",
"def show\n header(@keyword)\n counter(list).each_with_index do |el, index|\n print \"#{index + 1} - #{el.first}\"\n (20 - el.first.length).times { print '-' }\n print \"#{el[1]} views\"\n puts\n end\n end",
"def frame_count\n Rubinius::VM.backtrace(1).count\n end",
"def number_of_results(results)\n printf(\"\\n%<results>d results found.\\n\\n\", results: results.length)\n end",
"def level_print(message, count)\n\n if count > 0\n indention = \"\"\n indention += \" \" until indention.length() == 2*count\n print indention\n end\n\n puts message\nend",
"def show_frames\r\n jssh_command = \"var frameset = #{WINDOW_VAR}.frames;\r\n var elements_frames = new Array();\r\n for(var i = 0; i < frameset.length; i++)\r\n {\r\n var frames = frameset[i].frames;\r\n for(var j = 0; j < frames.length; j++)\r\n {\r\n elements_frames.push(frames[j].frameElement); \r\n }\r\n }\r\n elements_frames.length;\"\r\n \r\n jssh_command.gsub!(\"\\n\", \"\")\r\n $jssh_socket.send(\"#{jssh_command};\\n\", 0)\r\n length = read_socket().to_i \r\n \r\n puts \"There are #{length} frames\"\r\n \r\n frames = Array.new(length)\r\n for i in 0..length - 1 do\r\n frames[i] = Frame.new(self, :jssh_name, \"elements_frames[#{i}]\")\r\n end\r\n \r\n for i in 0..length - 1 do\r\n puts \"frame: name: #{frames[i].name}\"\r\n puts \" index: #{i+1}\"\r\n end\r\n end",
"def list_count\n\t\tThread.start do\n\t\t\tnotifier = @ts.notify 'write', [:old_n, nil]\n\t\t\tnotifier.each do |_, t|\n\t\t\t #puts t.last\n \t puts \"n: #{@ts.read([:old_n, nil]).sort.last} a: #{@ts.read([:a, nil]).last} b: #{@ts.read([:b, nil]).last} a*b: #{@ts.read([:a, nil]).last.to_i* @ts.read([:b, nil]).last.to_i}\"\n\t\t\tend\n\t\tend\n\tend",
"def count\n @tpl[:cnt]\n end",
"def count(stat, count, sample_rate=1); send stat, count, 'c', sample_rate end",
"def showPiles\n 3.times { |i| puts i.to_s + \" : \" + $piles[i].count().to_s}\nend",
"def print(counter)\n counter.each do |k,v|\n p \"Accountability Group\\# #{v}: #{k}\"\n end\nend",
"def frames; end",
"def tenth_frame; end",
"def counting\n puts \"hard to do right\"\n end",
"def print_list(hash)\n count = 1\n hash.each do |key, value|\n p count.to_s + \") \" + key + \": \" + value.to_s\n count += 1\n end\nend",
"def tvCount _args\n \"tvCount _args;\" \n end",
"def run events\n events.each do |event| \n interprete event\n end\n# return\n puts \"Statistics:\"\n @counts.each do |k,v|\n puts \"#{k.inspect} =>\"\n i = 0\n step = 6\n while i < v.size\n puts \"\\t#{v[i,step]}\"\n i += step\n end\n end\n end",
"def count; end",
"def count; end",
"def count; end",
"def frame_info(b, verbose = T.unsafe(nil)); end",
"def count\n Jhead.call(\"-c\", @match, @pattern).split(\"\\n\").size\n end",
"def print_details( result_counts, score )\n puts ('=' * 10) << \"\\n\"\n @groups.each_with_index { |group, index| group.each { |row| puts \"#{row} Group \" << (index + 1).to_s } }\n puts '-' * (@groups[0][0].length * 3)\n puts \"#{result_counts} Score\"\n puts \"\\nTotal Score: #{score}\\n\"\n end",
"def frame_count; motion.frame_count; end",
"def report(count)\n puts \"#{$count} html files were processed to #{Dir.getwd}/pages.csv\"\nend",
"def display_count(count)\n if count == 1\n #\"\"\n else\n count.to_s\n end\n end",
"def print_contents\n\t\tputs \"Artist: %s\" % [@artist]\n\t\tputs \"Album: %s\" % [@title]\n\t\tputs \"Released: %s\" % [@year]\n\n\t\tif @cd_count > 0\n\t\tputs \"CD(%d): %s\" % [@cd_count, @cd_id]\n\t\tend\n\n\t\tif @tape_count > 0\n\t\tputs \"Tape(%d): %s\" % [@tape_count, @tape_id]\n\t\tend\n\n\t\tif @vinyl_count > 0\n\t\tputs \"Vinyl(%d): %s\" % [@vinyl_count, @vinyl_id]\n\t\tend\n\n\tend",
"def count\n @stack.count\n end",
"def print_line(count)\n (1..count).each do |i| # or, equivalently, for i in (1..count)\n print \"*\" # This prints a single \"*\"\n end\n\n print \"\\n\" # This forces the output to the next like, like hitting \"return\" on the keyboard\nend",
"def length\n @traces.length\n end",
"def length; return @totalFrames; end",
"def print_tracks tracks\n i = 0\n for i in 0..tracks.length - 1 do\n\t puts '*********************************************'\n\t puts '**************** Track No. ' + (i + 1).to_s + ' ****************'\n\t print_track(tracks[i])\n\t puts ''\n end\nend",
"def print_tracks tracks\r\n\tindex = 0\r\n\ttimes = tracks.length\r\n\twhile (index < times)\r\n\t\tputs tracks[index].name\r\n\t\tputs tracks[index].location\r\n\t\tindex += 1\r\n\tend\r\nend",
"def print_list(list)\n\tlist.each do |item,count|\n\t\tputs \"#{item}: #{count}\"\n\tend\nend",
"def dump\n \"#{counter_tag}=#{length}\\x01#{super}\"\n end",
"def count\n @count ||= 0\n @count += 1\n end",
"def print_a_line(line_count, f)\n\tputs \"#{line_count} #{f.readline()} \"\nend",
"def flay_count filename\n count = `flay #{filename}|grep #{filename}|wc -l`\n return count.chomp.to_i\n end",
"def print_a_line(line_count, f)\n\tputs \"#{line_count} #{f.readline}\" # learn more about readline\nend",
"def print_list(list)\n\tmax_index = list.length;\n\ti=1\n\twhile i<=max_index\n\tprint \"#{i}. #{hash_to_string(list[i-1])}\".center(get_winsize)\n\tprint \"\\n\"\n\ti +=1\n\tend\nend",
"def print_neighbours_count\n @x.times{ |r|\n @y.times{|c| \n print @mat[r][c].count_neighbours.to_s + \" \"\n }\n print \"\\n\"\n }\n end",
"def print_output_head(index)\n puts \"\\nPrinting dataset for %.2f\" %\n (@meta_data.domain_z.lower + (index * @meta_data.domain_z.step))\n puts \"\\n\"\n end",
"def count\n puts 1\n puts 2\nend",
"def print_a_line(line_count, f)\n\tputs \"#{line_count} #{f.readline()}\"\nend",
"def print_a_line(line_count, f)\n\tputs \"#{line_count} #{f.readline()}\"\nend",
"def frame_count\n image.get(\"height\") / size.y\n end",
"def display_entity_counts\n @log.info @tracker.display\n end",
"def count\n end",
"def count\n end",
"def print_tracker(tracker)\n longest = \n (tracker.keys.max { |a, b| a.to_s.length <=> b.to_s.length }).to_s.length\n puts Time.now\n tracker.each do |id, count|\n printf(\"%-#{longest + 2}d %d\\n\", id, count)\n end\n puts \nend",
"def args(count)\n resp = count.times.map { |i| read(ip + 1 + i) }\n\n puts(([opcode] + resp).inspect) if debug\n\n resp\n end",
"def args(count)\n resp = sequence[ip+1, count]\n puts ([opcode] + resp).inspect\n resp\n end",
"def table_counts(tables)\r\n\ttables.each do |table|\r\n\t\tputs \"\"\r\n\t\tputs table['name']\r\n\t\tputs \"column count = #{table['cols'].length}\"\r\n\t\tputs \"type count = #{table['type'].length}\"\r\n\t\ti = 0\r\n\t\ttable['data'].each do |row|\r\n\t\t\tputs \"row #{i} = #{row.length}\"\r\n\t\t\ti += 1\r\n\t\tend\r\n\t\tputs \"\"\r\n\tend\r\nend",
"def display_info\n\t\tputs \"Total track number: #{@track_list.length}\"\n\t\tputs \"Total artist number: #{@artist_list.length}\"\n\t\tputs \"Last three played track:\"\n\t\t@last_played.each do |last_played_track|\n puts \"------------ Track Info -------------\"\n\t\t\tputs \"#{last_played_track.to_s}\"\n\t\tend\n\tend",
"def frame\n (@frame || 1).to_f\n end",
"def print_a_line(line_count, f)\n puts \"#{line_count} #{f.readline}\"\nend",
"def print_track\n clear_screen!\n puts \"RACE! GO FAST!!!111one\"\n liner = \"________________\"\n @length.times do\n liner += \"__\"\n end\n puts liner\n @players.times do |x_position|\n print \"Player #{x_position} \"\n @length.times do |y_position|\n print @track[x_position][y_position] + \"|\"\n end\n puts \"| FINISH\"\n end\n puts liner\n end",
"def stackshow\n puts \"#{@@stack.length} cards remaining\"\n for card in @@stack do\n card.show\n end\n end",
"def count\n count = 0\n each do |data|\n count += 1\n end\n count\n end",
"def print_a_line(line_count, f)\n puts \"#{line_count } #{f.readline()}\"\nend",
"def count\n each.count\n end",
"def display(hashName)\n system \"clear\" \n puts \"Aluno: Notas [ N1, N2, N3, Media ] cadastradas:\"\n puts \"----------------------------------\"\n hashName.each do |a, b|\n puts \"#{a}: \\t #{b}\"\n end\n puts \"----------------------------------\"\n countKeys = hashName.keys.count\n puts \"[ #{countKeys} ] aluno(s) cadastrado(s)\"\n voltar\nend",
"def insertion_print_count\n @insertion.print_count\n end",
"def count\n connection.zcard(key_label)\n end",
"def show_cars_count\n puts \"cars count: #{cars.size}\"\n end",
"def printTrainRecordsSummary count = 1, scale = 20\r\n\t\tdata = @trainTestStruct.trainingData.getDataStructure(true)\r\n\t\tLpr.p \"Print summary for #{@machineClass.name}\"\r\n\t\t(0...count).each{|index|\r\n\t\t\tLpr.s \"Record #{index} regular\"\r\n\t\t\tLpr.graphIt @trainTestStruct.trainingData.getDataStructure(true)[index], scale\r\n\t\t\tLpr.graphIt @trainTestStruct.testSets(index).getDataStructure(true)[index], scale\r\n\t\t}\r\n\tend",
"def to_s\n super.insert -2, \" (Count = #{count})\"\n end",
"def point_count\n puts \"#{@player1.name}'s points: #{@player1.point}\\n#{@player2.name}'s points: #{@player2.point}\"\n end",
"def print_nodes(path, counter)\n (0..(counter - 1)).each { |i| print path[i].value.to_s + ' ' }\n puts\n end",
"def print_hits\r\n puts \" ~ Hit Map: ~ \\n\"\r\n (0..h).each do |y|\r\n (0..w).each do |x|\r\n print @map[x][y].hits.to_s + \" \"\r\n end\r\n print \"\\n\"\r\n end\r\n end",
"def count\n raw_history['num_results']\n end",
"def count\n @count\n end",
"def display(count)\n puts \"-----------------------------------------------\"\n puts \"Spell slot: #{count}\"\n puts \"Character Class: #{self.character_class.class_name}\"\n puts \"Spell: #{self.spell.name}\"\n puts \"Description: #{self.spell.description}\"\n puts \"------------------------------------------------\"\n end",
"def tally_frames(old=0)\n if !tss.empty?\n # puts \"returning hits count #{hits.count}\"\n return hits.count\n else\n result=0\n snd.each do |sn|\n result += hits.count*sn.tally_frames(old)\n end\n # puts \"all in result #{result}\"\n return result\n end\n end",
"def print_a_line(line_count, f)\n puts \"#{line_count} #{f.readline()}\"\nend",
"def print_a_line(line_count, f)\n puts \"#{line_count} #{f.readline()}\"\nend",
"def print_a_line(line_count, f)\n puts \"#{line_count} #{f.readline()}\"\nend",
"def print_tracks tracks\n\tindex = 0\n\twhile index < tracks.length\n\t\tprint_track tracks[index]\n\t\tindex += 1\n\tend\nend",
"def print_stats\n puts \"==================================================\"\n puts \"================= Statistics =====================\"\n puts \"==================================================\"\n \n calc_stats()\n \n puts \"Total Records = #{@total_rec_cnt}\"\n puts \"Well Formed Records = #{@well_formed_rec_cnt}\"\n puts \"Malformed Records = #{@malformed_rec_cnt}\"\n puts \"Unique Business Records = #{@biz_rec_cnt}\"\n puts \"Unique User Records = #{@user_rec_cnt}\"\n puts \"\"\n end",
"def print_series_leaderboard\n\t\tputs \"Match number:#{@game_number} \\t#{@player1.name}:#{@player1.has_won}\\t#{@player2.name}:#{@player2.has_won}\\tDraw:#{@[email protected][email protected]_won}\"\n\tend",
"def output_counter(params)\n \"<p>#{kv(params[:stat].descr, params[:stat].value)}</p>\\n\"\n end",
"def print\n puts \"====== Pastes History ======\".green\n unless @links.empty?\n @links.each_with_index { |l, i| puts \"#{i+1}. #{l}\" }\n else\n puts \"your history is empty...\"\n end\n puts \"============================\".green\n end",
"def pretty_print(pp)\n super if defined? super\n\n pp.breakable\n pp.text \"Frame Selection:\"\n if !frame_mappings.empty?\n pp.nest(2) do\n pp.breakable\n pp.seplist(frame_mappings) do |mapping|\n pp.text \"#{mapping.first} => #{mapping.last}\"\n end\n end\n end\n end",
"def print_a_line(line_count, f)\n puts \"#{line_count} #{f.readline()}\"\nend",
"def encounter_balloon_frame_count\n TH::Encounter_Alert::Balloon_Frames\n end",
"def printArrayOutput(arrayToPrint , counter)\n \n puts \"After iteration \" + (10-counter).to_s + \":\"\n p arrayToPrint\n\n end"
] | [
"0.6398167",
"0.618714",
"0.61649483",
"0.6086265",
"0.6048901",
"0.60183513",
"0.59998345",
"0.59485203",
"0.5860821",
"0.5859112",
"0.5853356",
"0.5843102",
"0.5800844",
"0.57703024",
"0.57674855",
"0.5742932",
"0.5740459",
"0.57307523",
"0.57072306",
"0.56860375",
"0.56767106",
"0.56488496",
"0.56434494",
"0.5640246",
"0.56235194",
"0.56167907",
"0.5616244",
"0.5612855",
"0.5576442",
"0.556831",
"0.5564628",
"0.5558138",
"0.5558138",
"0.5558138",
"0.5546061",
"0.5545655",
"0.54955244",
"0.5468929",
"0.54606664",
"0.5451808",
"0.54481584",
"0.54428875",
"0.54415935",
"0.5438325",
"0.5423376",
"0.54182655",
"0.54122716",
"0.5412141",
"0.5411856",
"0.54118276",
"0.5406022",
"0.54028076",
"0.5397822",
"0.53977215",
"0.53963655",
"0.5395914",
"0.5395206",
"0.53907454",
"0.53907454",
"0.5388465",
"0.5368821",
"0.53633004",
"0.53633004",
"0.535787",
"0.5357741",
"0.5357208",
"0.53566104",
"0.53516537",
"0.5347301",
"0.533394",
"0.5329068",
"0.53215164",
"0.5317063",
"0.5315397",
"0.531069",
"0.52986693",
"0.52973664",
"0.52956647",
"0.5271837",
"0.5268902",
"0.5262806",
"0.5262408",
"0.5257742",
"0.5253887",
"0.52531755",
"0.52482754",
"0.52465606",
"0.52455246",
"0.5238864",
"0.5238864",
"0.5238864",
"0.5227416",
"0.52236915",
"0.5218926",
"0.5217769",
"0.52154243",
"0.5211933",
"0.52101284",
"0.52079445",
"0.52033025"
] | 0.53811044 | 60 |
creates new session for user with authentication | def create
params.inspect
params[:user][:email] = params[:user][:email].downcase
params.inspect
user = User.find_by(email: params[:user][:email])
if user && user.authenticate(params[:user][:password])
session[:user_id] = user.id.to_s
redirect_to recipes_path
else
flash[:danger]= "Invalid login credentials."
redirect_to login_path
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_session\n login, password = get_login_and_password\n create_session_with authenticate_user(login, password, :trace => true)\n end",
"def new_user_session(user)\n session = new_session\n session.login!(user)\n return session\n end",
"def create_session\n req_params = params[:user]\n unless req_params\n @msg = \"Login details not found\"\n render \"objects/msg.json\", status: :unauthorized and return\n end\n @user = User.find_by_email(req_params[:email])\n if @user && @user.authenticate(req_params[:password])\n session[:user_id] = @user.id\n render 'objects/user.json'\n else\n @msg = \"Email or password is invalid\"\n render \"objects/msg.json\", status: :unauthorized\n end\n end",
"def create\n reset_session\n u = User.authenticate(params[:session][:login], params[:session][:password])\n \n if u\n reset_session\n session[:user_id] = u.id\n session[:user_login] = u.login\n @current_user = User.find(session[:user_id])\n flash[:notice] = 'hi, again!'\n redirect_to dashboard_url\n else\n flash[:error] = 'Invalid login or password.'\n redirect_to root_url\n end\n end",
"def create_user_session\n password = '12345678'\n user = User.make!(\n password: password,\n password_confirmation: password\n )\n UserSession.create!(\n email: user.email,\n password: password\n )\n end",
"def create_session\n # byebug\n user = User.find_by(\n email: params[:email],\n password: params[:password]\n )\n\n if (user.nil?)\n redirect_to action: \"sign_in\"\n else\n session[:user_id] = user.id\n\n redirect_to \"/users/#{user.id}\"\n end\n\n end",
"def create\n action = LogUserIn.new :web\n @session = Session.new params[:session]\n\n if user = action.run(@session.login, @session.password)\n previous_path = session[:login_redirect_to]\n set_new_user_session user, @session.remember_me\n\n redirect_to previous_path || root_path\n else\n flash.now[:login_error] = true\n render action: \"new\"\n end\n end",
"def create_session\n @user = User.new(nickname: User.temp_user_name)\n @user.save\n session[:user_id] = @user.id\n @user\n end",
"def create\n @user = User.find_or_create_from_auth_hash(auth_hash)\n # self.current_user = @user\n session[:user] = @user.id\n redirect_to '/'\n end",
"def create\n #gets the user\n user = User.find_by_credentials(params[:user][:email], params[:user][:password])\n \n # if we found it, generate a new session token, change it on the user\n # instance as well as the cookie\n if !user.nil?\n log_in_user!(user)\n flash.now[:success] = \"Login successful\"\n redirect_to user_url(user)\n else\n flash.now[:error] = \"Invalid email/password combo\"\n redirect_to :new\n end\n end",
"def create\n if user = User.authenticate_with_credentials(params_for_login)\n # a session cookie is assigned to logged users\n session[:user_id] = user.id\n redirect_to session[:return_to]\n else\n redirect_to session[:return_to], flash: { error: \"Invalid email address\" }\n end\n end",
"def create_session\n self.current_user = authenticate_user(params[:user][:login], params[:user][:password], :trace => true)\n \n # store remember me in token\n if logged_in?\n if params[:user][:remember_me] == \"1\"\n current_user.remember_me unless current_user.remember_token?\n cookies[cookie_auth_token] = {\n :value => self.current_user.remember_token, :expires => self.current_user.remember_token_expires_at\n }\n end\n \n # callback :after_authentication_success\n self.send(:after_authentication_success, self.current_user) if self.respond_to?(:after_authentication_success)\n \n if !performed? && request.xhr?\n render :update do |page|\n # JS code to close modal\n # update page header to show user information\n end\n elsif !performed?\n flash[:notice] = MESSAGE_LOGIN_SUCCESS\n redirect_back_or_default(authentication_success_url || '/')\n end\n else\n # callback :after_authentication_error\n self.send(:after_authentication_error, self.current_user) if self.respond_to?(:after_authentication_error)\n if !performed? && request.xhr?\n render :update do |page|\n # JS code to re-display login dialog\n end\n elsif !performed?\n flash[:error] = user_class.is_suspended?(params[:user][:login], params[:user][:password]) ? \n \"Login nicht möglich, da Benutzer gesperrt wurde.\" : \n MESSAGE_LOGIN_ERROR\n render :action => 'new'\n end\n end\n end",
"def create\n\t\tuser = User.find_by(email: params[:login][:email])\n\n\t\tif user && user.authenticate(params[:login][:password])\n\t\t\tsession[:user_id] = user.id.to_s\n\t\t\tredirect_to root_path\n\t\telse\n\t\t\trender :new\n\t\tend\n\n\tend",
"def create\n if SessionService.authenticate(@user, params[:password])\n # TODO Add successful log in message\n logger.debug \"#{@user.email} is trying to create a API session\"\n root_path\n else\n logger.error \"** Failure** Attempt to login as #{params[:user_name]} - rejected\"\n render text: 'Login failed', status: :unauthorized\n end\n end",
"def create\n\t user = AdminUser.authenticate(params[:email], params[:password])\n\t logger.info 'session#create creating session'\n\t if user\n\t \tlogger.info 'session#create user authenticated'\n\t session[:user_id] = user.id\n\t redirect_to admin_category_index_path\n\t else\n\t flash.now.alert = \"Invalid email or password\"\n\t render \"new\", layout: \"login_layout\"\n\t end\n\tend",
"def create\n\t\tuser = User.where(:email => params[:email]).first\n\t\tif user.present? && user.authenticate(params[:password])\n\t\t\tsession[:user_id] = user.id\n\t\t\tredirect_to root_path\n\t\telse \n\t\t\tredirect_to new_session_path\n\t\tend\n\n\tend",
"def create\n @user = User.find_by(name: params[:username])\n if @user.authenticate(params[:password])\n session[:current_user_id] = @user.id\n end\n end",
"def create\n \tuser = User.find_by(email: params[:session][:email])\n \tif user && user.authenticate(params[:session][:password])\n \t\tlog_in user\n \t\tredirect_back_or user\n \telse\n \t\tredirect_to login_path, notice: \"Invalid email/password combination\"\n \tend\n end",
"def create\n \t@user = User.find_by(e_mail: params[:session][:email].downcase)\n \tif @user && @user.authenticate(params[:session][:password])\n \t\t# Login successful, save user_id to session and redirect to user page\n \t\tlog_in @user\n \t\tredirect_to home_path\n \telse\n \t\t# Login unsuccessful, redirect to Log In Page and display an error message\n \t\tflash.now[:danger] = 'Invalid email/password combination'\n render \"new\"\n \tend\n end",
"def create\n options = {:remember_me => true}.merge(params[:user_session])\n @user_session = UserSession.new(options)\n if @user_session.save\n redirect_back_or_default root_url\n else\n @failed = true\n render :action => :new\n end\n end",
"def create_session_with(user)\n @logged_in_recently = false\n self.current_user = user\n \n # store remember me in token\n if logged_in?\n @logged_in_recently = true\n if params[:user][:remember_me] == \"1\"\n current_user.remember_me unless current_user.remember_token?\n cookies[cookie_auth_token] = {\n :value => self.current_user.remember_token, :expires => self.current_user.remember_token_expires_at\n }\n end\n \n # callback :after_authentication_success\n self.send(:after_authentication_success, self.current_user) if self.respond_to?(:after_authentication_success)\n \n if !performed? && request.xhr?\n if return_to_url\n flash[:xhr_redirect] = true\n @return_to_url = return_to_url\n session[return_to_param] = nil\n end\n render :update do |page|\n page << close_modal_javascript\n page.replace status_dom_id, :partial => 'layouts/front/status_navigation'\n page << \"document.fire('authentication:success')\"\n page << \"document.fire('authentication:complete')\"\n page.redirect_to @return_to_url if @return_to_url\n end\n elsif !performed?\n flash[:notice] = MESSAGE_LOGIN_SUCCESS.t\n redirect_back_or_default('/')\n end\n else\n flash[:error] = MESSAGE_LOGIN_ERROR.t\n if request.xhr?\n render :update do |page|\n page.replace session_dom_id, :partial => 'new'\n page << \"document.fire('authentication:failure')\"\n page << \"document.fire('authentication:complete')\"\n end\n else\n render :action => 'new'\n end\n end\n end",
"def create\n @user_session = UserSession.new(params[:user_session])\n if @user_session.save\n flash[:notice] = \"Welcome #{@user_session.login}!\"\n redirect_to post_auth_redirect_url\n else\n flash.now[:error] = \"Couldn't locate a user with those credentials\"\n render :action => :new\n end\n end",
"def create\n user = User.find_by_credentials(params[:user][:name], params[:user][:password])\n if user \n #rails creates session cookie for us, session is a hash\n #generate new session token and set our session to that token\n login!(user)\n redirect_to chirps_url\n else\n # flash used for collecting errors \n # flash - lasts for now and the next response cycle, usually for redirects\n # flash.now - only persist for this response, usually for render\n\n #we want errors to render once but not again on refresh\n flash[:errors] = [\"Invalid username/password\"]\n # render :new\n redirect_to new_session_url\n end\n end",
"def create\n user = User\n .find_by(email: params[\"user\"][\"email\"])\n .try(:authenticate, params[\"user\"][\"password\"])\n # if the user was created, i.e., found an email password match, set session\n if user\n # sets an encrypted session cookie on the client side\n session[:user_id] = user.id\n render json: {\n status: :created,\n logged_in: true,\n user: user\n }\n else\n render json: { status: 401 }\n end\n end",
"def create\n user = User.authenticate(params[:email], params[:password])\n if user\n # token = (0...20).map { ('a'..'z').to_a[rand(26)] }.join\n #session[:token] = token\n session[:user_id] = user.id\n # user.update(session: token)\n redirect_to root_url, :notice => \"Logged in!\" \n else\n flash.now.alert = \"Invalid credentials.\"\n render \"new\"\n end\n end",
"def create\n\n\t\t# grab the authentication return\n\t\tauth = request.env[\"omniauth.auth\"]\n\n\t\t# now create a temporary user with the auth element etc\n\t\tuser = User.omniauth_create auth\n\n\t\t# now set the session_id \n\t\tsession[:id] = user.id\n\n\t\t# redirect back to the root which can successfully switch the pages of the application etc\n\t\tredirect_to root_url, :notice => \"Successful Authentication\"\t\n\tend",
"def create\n unless session[:user_id].present?\n user = User.create_user\n session[:user_id] = user.id\n end\n end",
"def create\n reset_session\n params[:user] ||= {}\n username = params[:user][:username].to_s\n password = params[:user][:password].to_s\n user = User.where('username = ? and crypted_password = ?', username, User.encrypt(password)).first\n\n params[:client_uid] = 'Web Platform' if request.format.html?\n \n if user && params[:client_uid]\n session_obj = Session.create(user_id:user.id, client_uid:params[:client_uid])\n session[:app_session_id] = session_obj.id\n session[:user_id] = user.id\n\n if request.format.html?\n redirect_to controller: 'main'\n elsif request.format.json?\n render json: {success: true, session: session_obj.to_json}\n end\n else\n if request.format.html?\n flash[:alert] = \"Cannot login, please try again\"\n render action: 'new'\n elsif request.format.json?\n render json: {success: false, message: 'Cannot login, please try again'}\n end\n end\n end",
"def new\n @session = User::Session.new\n end",
"def new\n @user_session = UserSession.new(:email => session[:user_real_account_email])\n end",
"def create\n user = User::FindForAuthenticate.call(params)\n\n render(\n status: 422,\n json: { error: 'Invalid login or password' }\n ) and return unless user\n\n begin\n session = UserSession.create!(user: user)\n render status: 200, json: { auth_key: session.auth_key }\n rescue ActiveRecord::RecordNotUnique\n render status: 422, json: { error: 'You already logged in' }\n end\n end",
"def login_user\n\t @user_session = UserSession.new\t \n\tend",
"def create\n\t\t# method interacts with session > new.html.erb view\n\t\tuser = User.where(email: params[:user_email]).first\n\t\tif user && user.authenticate(params[:password])\n\t\t\tsession[:user_id] = user.id.to_s\n\t\t\tredirect_to '/'\n\t\telse\n\t\t\tredirect_to :back\n\t\tend\n\tend",
"def create\n user = User.find_by(email: params[:session][:email].downcase)\n \n #if the user was found and the user.authenticate based on enetered password\n if user && user.authenticate(params[:session][:password])\n # we are saving user id into the session so the browsers cookies will handle this\n # this id will be used across sessions\n session[:user_id] = user.id\n \n # flash a success and redirect to the users page\n flash[:success] = \"You have successfully logged in\"\n redirect_to user_path(user)\n else\n # re render the login page, but since this is not a model backed form we wont have validation messages\n # add a message with flash\n flash.now[:danger] = \"Username or Password were incorrect\"\n render 'new'\n end\n end",
"def create\n\t\tuser = User.find_by_email(params[:session][:email].downcase)\n\t\tif user && user.authenticate(params[:session][:password])\n\t\t\t# login the user\n\t\t\tsign_in user\n\t\t\tflash[:success] = \"Signed in\";\n\t\t\tredirect_to root_path\n\t\telse\n\t\t\t# something went wrong\n\t\t\tflash[:failure] = \"Incorrect email/password\";\n\t\t\trender \"new\"\n\t\tend\n\tend",
"def create\n user = User.find_by_email(params[:session][:email])\n respond_to do |format|\n if user && user.authenticate(params[:session][:password])\n sign_in user # create a cookie\n format.json { render json: user.active_model_serializer.new(user, {}) }\n format.html { redirect_back_or user }\n else\n #raise SessionsController::InvalidAuth\n render 'new'\n end\n end\n end",
"def create\n @session = ::Session.authenticate(session_params)\n\n if @session.save\n render :show, status: :created, location: @session\n else\n render json: @session.errors, status: :unprocessable_entity\n end\n end",
"def create\n # find user from session cookie -> email, then authenticate\n @user = User.find_for_database_authentication(email: session_params[:email])\n if @user && @user.valid_password?(session_params[:password])\n sign_in(@user)\n # after signing in the user, refresh to show most updated saved user\n @user.reload\n render :show\n return\n end\n # return prevents login error\n invalid_login_attempt_error\n end",
"def set_session_for(user)\n UserSession.create(user)\n end",
"def create_session\n @connection.create_session(@config || {})\n end",
"def create\n # logging in can be done via email or username interchangeably\n user = User.find_by email: params[:session][:username].downcase\n # ||= only runs the find command if the user was not set by the above\n user ||= User.find_by username: params[:session][:username].downcase\n\n if user && user.authenticate(params[:session][:password])\n # Log the user in and redirect to the user's show page\n log_in user\n flash[:success] = \"Logged in as #{user.username}\"\n redirect_to user_url(user)\n else\n # Flash an error message\n flash.now[:danger] = 'Invalid email or password'\n render 'new'\n end\n end",
"def create\n \tuser = User.find_by(email: params[:session][:email].downcase)\n \tif user and user.authenticate(params[:session][:password])\n \t\tlog_in(user)\n # redirect_to \"/users/#{user.id}\"\n redirect_to '/'\n \telse\n \t\tflash.now[:danger] = \"Invalid email/password confirmation!\"\n \t\trender 'new'\n \tend\n end",
"def new\n @user_session = UserSession.new\n end",
"def new\n @user_session = UserSession.new\n end",
"def new\n @user_session = UserSession.new\n end",
"def new\n @user_session = UserSession.new\n end",
"def new\n @user_session = UserSession.new\n end",
"def new\n\t\t@user_session = UserSession.new\n\tend",
"def login_as(user)\n Session.create(users(user))\n end",
"def create\n user = User.find_by_email(params[:email])\n if user && user.authenticate(params[:password]) && user.confirm\n session[:user_id] = user.id\n session[:expires_at] = Time.now + 120.minutes\n redirect_to main_url\n else\n flash[:error] = \"Invalid username or password\"\n render \"new\"\n end\n end",
"def login_as(user)\n UserSession.create(users(user))\n end",
"def create\n @user = User.find_by(email: session_params[:email])\n if @user && @user.authenticate(session_params[:password])\n # Save the user ID in the session so it can be used in\n # subsequent requests\n session[:user_id] = @user.id\n flash[:notice] = \"Welcome, #{@user.email}!\"\n redirect_to statuses_path\n else\n flash[:alert] = \"Please log in again\"\n render \"new\"\n end\n end",
"def create\n @user = User.find_by(email: params[:session][:email].downcase)\n if @user&.authenticate(params[:session][:password]) # & for safe navigation\n log_in @user\n params[:session][:remember_me] == '1' ? remember(@user) : forget(@user)\n redirect_back_or @user\n else\n flash.now[:danger] = 'Invalid email/password combination'\n render 'new'\n end\n end",
"def create\n user = User.where(:username => params[:session][:username].downcase).first\n \n if user && user.authenticate(params[:session][:password])\n log_in user\n user['last_login'] = Time.now.to_datetime\n user.save\n flash[:success] = \"Welcome back #{user.username}!\"\n redirect_to home_path\n else\n # Otherwise, keep them on the login page.\n flash.now[:danger] = 'Invalid username or password'\n render 'new'\n end\n end",
"def create\n u = params[:username]\n p = params[:password]\n user_session = UserSession.new(:login => u, :password => p, :remember_me => true)\n if not user_session.save then\n return render :text => \"error\", :status => 401\n end\n\n ret = { :user => User.find_by_username_or_email(user_session.login) }\n ret[:redir] = URI.parse(session.delete(:return_to)).path if session.include? :return_to\n restful ret\n end",
"def create\n email = params[:session][\"email\"] # both will work ->: will use less memory\n password = params[:session][:password]\n user = User.authenticate(email, password)\n \n if user # if auth is successful\n session[:user_id] = user.id # this is a session\n flash[:notice] = \"You are logged in.\"\n redirect_to session[:referrer] || :root # to whatever is the root of your webserver ()\n #:referrer -> send to page that started from (if tried to edit if not logged in)\n else # if wrong credentials\n flash[:error] = \"add to your FAIL blog and Please try again!\"\n render :action => \"new\" # just shows def new end (at the beginning again)\n end\n end",
"def create\n\t\tuser = User.from_sso(cookies[:UTEP_SE], cookies[:UTEP_SA])\n\t\tlog_in(user) if user\n\t\tredirect_to root_url\n\tend",
"def create\n @user = User.where(username: params[:session][:username]).first\n if @user.password == params[:session][:password]\n session[:user_id][email protected]\n log_in @user\n puts \"my sess = #{session[:user_id]}\"\n redirect_to @user\n else\n flash[:alert] = \"Invalid Username/Password. Please try again\"\n redirect_to login_path\n end\n end",
"def create\n\n user = current_instance.users.where(username: params[:username]).first\n if user && user.authenticate(params[:password])\n session[:user_id] = user.id\n redirect_to root_path, notice: 'You have been successfully logged in to Unify.'\n else\n flash[:error] = 'Invalid username and/or password.'\n render :new\n end\n\n end",
"def create\n validate_params; return if performed?\n user = User.find_by(user_name: params[:session][:user_name])\n if user && user.authenticate(params[:session][:password])\n log_in user\n redirect_to root_path\n else\n flash.now[:error] = I18n.t('errors.log_in.create')\n render :new\n end\n end",
"def create\n if user = User.find_by_login(params[:login])\n # Save the user ID in the session so it can be used in subsequent requests\n session[:current_user_id] = user.id\n redirect_to root_url\n end\n end",
"def create\n \tuser = User.find_by :email => params[:email]\n \tif user.present? && user.authenticate(params[:password])\n \t\tsession[:user_id] = user.id\n \t\tredirect_to root_path\n \telse\n \t\tredirect_to login_path\n \tend\n end",
"def create\n user = User.find_by(email: params[:session][:email].downcase)\n if user && user.authenticate(params[:session][:password])\n log_in user\n redirect_to home_path\n else\n flash.now[:danger] = 'Invalid email/password combination'\n render 'new'\n end\n end",
"def create\n unless current_user_session.nil?\n redirect_to root_url, :notice => \"You are already logged in.\"\n return\n end\n @user_session = UserSession.new(params[:user_session])\n\n if @user_session.save\n redirect_to(@user_session.user, :notice => \"Login successful. Welcome!\") \n else\n render :action => \"new\" \n end\n end",
"def create\n email = params[:email]\n password = params[:password]\n\n user = User.find_by(email: email)\n if user && user.authenticate(password)\n session[:user_id] = user.id\n redirect_to root_path\n # logged in!\n else\n # Nope, something went wrong\n redirect_to login_path\n end\n end",
"def create\n \tuser = User.find_by(email: params[:session][:email])\n\n \tif user && user.authenticate(params[:session][:password])\n \t\trender text: user.auth_token, status: 200\n \t\telse\n \t\t\trender text: \"Invalid email or password\", status: 422\n \t\tend\t\n end",
"def create \n user = User.find_by(username: params[:user][:username])\n if user && user.authenticate(params[:user][:password])\n session[:user_id] = user.id \n redirect_to user_path(user)\n else\n redirect_to '/login'\n end\n end",
"def new\n if current_user\n redirect_to root_url\n end\n @user_session = UserSession.new\n end",
"def create\n user = User.find_by(username: params[:username])\n\n if user && user.authenticate(params[:password])\n\n session[:user_id] = user.id\n redirect_to(\"/\")\n else\n @failed_auth = true\n render(:new)\n end\n end",
"def create\n\t\tuser = User.find_by_email(params[:session][:email])\n\t\tif user && user.authenticate(params[:session][:password])\n\t\t\tsign_in user\n\t\t\tredirect_back_or user\n\t\telse\n\t\t\tflash.now[:error] = \"Invalid email/password combination\"\n\t\t\trender 'new'\n\t\tend\n\tend",
"def create\n user = User.authenticate(params[:session][:email],\n params[:session][:password])\n if user.nil?\n redirect_to root_path\n flash[:error] = \"Invalid email/password combination.\"\n @title = \"Sign in\"\n \n else\n # Sign the user in and redirect to the user's show page.\n sign_in user\n redirect_to '/users'\n end\n end",
"def create\n user = User.find_by(username: params[:username])\n if user.authenticate(params[:password])\n session[:current_user] = user.id\n redirect_to users_path\n else\n redirect_to login_path\n end\n end",
"def create\n @session = Session.new(session_params)\n\n respond_to do |format|\n if @session.save\n reset_session\n session[:user_id] = @session.user.id\n format.html { redirect_to root_path, notice: 'Login success!' }\n format.json { render :show, status: :created, location: @session }\n else\n format.html { render :new }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # identifies user by provided email\n user = User.find_by_email(params[:email])\n\n # if the provided passord matches the user, session is established\n if user && user.authenticate(params[:password])\n session[:user_id] = user.id\n redirect_to user, notice: 'You have successfully logged in!'\n else\n # if password doesnt match, session is not established\n redirect_to :root\n end\n end",
"def create\n\tuser = User.authenticate(params[:session][:username],\n\t\t\t\t\t\t\t params[:session][:password])\n\t\n\tif user.nil?\n\t\tflash.now[:error] = \"Invalid username/password combination.\"\n\t\t@title = \"Sign in\"\n\t\trender 'new'\n\telse\n\t\tsign_in user\n\t\tredirect_back_or user\n\tend\n end",
"def create_session\n session[:who_is_this] = \"admin\"\n end",
"def create\n if using_open_id?\n open_id_authentication(params[:openid_url])\n elsif params[:login]\n password_authentication(params[:login], params[:password])\n end\n# self.current_user = User.authenticate(params[:login], params[:password])\n# if logged_in?\n# session[:user] = User.find(self.current_user)\n# \n# redirect_to :controller => :users, :action => :show, :id => self.current_user\n# flash[:notice] = \"Logged in successfully\"\n# else\n# render :action => 'new'\n# end\n end",
"def create\r\n\t\t# find the user based on the email\r\n\t\tuser = User.find_by(email: params[:session][:email].downcase) # all our emails in our database is downcased\r\n\t\t# check if the email is valid\r\n\t\tif user && user.authenticate(params[:session][:password])\r\n\t\t\t# simulate logging in\r\n\t\t\tsession[:user_id] = user.id # saving the user id in the session. The browsers cookies is going to handle this\r\n\t\t\t# saving the users id in the session hash which is backed by the browser\r\n\t\t\t# display a message\r\n\t\t\tflash[:success] = \"You have successfully logged in\"\r\n\t\t\tredirect_to user_path(user)\r\n\t\telse\r\n\t\t\t# give a message since it is not a model back form\r\n\t\t\tflash.now[:danger] = \"There was something wrong with your login information\"\r\n\t\t\t# flash.new persists for one http request. When we redirect the message will display in the next screen\r\n\t\t\t# render the new template to login\r\n\t\t\trender 'new'\r\n\t\tend\r\n\tend",
"def create\n user = User.find_by_username(params[:username])\n \n if user && user.authenticate(params[:password])\n session[:event_id] = nil\n session[:family_id] = nil\n session[:user_id] = user.id\n redirect_to(:home)\n else\n flash[:notice] = \"Invalid username or password\"\n redirect_to(:new_login)\n end\n end",
"def create\n\n logger.debug \"### Processing new login details\"\n user = User.authenticate(params[:email], params[:password])\n\n if user\n\n logger.debug \"### Login details matched - creating login session\"\n session[:user_id] = user.id\n flash[:notice] = \"Logged in!\"\n redirect_to(session[:return_to] || home_index_path) \n session.delete(:return_to)\n else\n logger.debug \"### User details didn't match - login denied\"\n flash[:error] = \"Invalid email or password\"\n render \"new\"\n end\n\n end",
"def create\n @user_session = UserSession.new(user_session_params.to_h)\n if @user_session.save\n flash[:notice] = \"Login successfully!\"\n redirect_back_or root_path\n else\n redirect_to login_path,\n alert: \"A problem's occured while logging in, please try again.\"\n end\n end",
"def create\n user = User.find_by_email(params[:email])\n if user && user.authenticate(params[:password])\n session[:user_id] = user.id\n session[:authenticated] = true\n redirect_to root_url, :notice => \"Successfully logged in.\"\n return\n else\n flash.now.alert = \"Invalid email or password\"\n render 'new'\n end\n end",
"def create\n #this references the funciton we made in user.rb\n user = User.authenticate(params[:session][:email], params[:session][:password])\n if user.nil?\n flash[:login_error] = \"Couldn't find a user with those credentials\"\n redirect_to new_session_path\n else\n redirect_to user\n end\n end",
"def create\n user = User.find_by_email( params[:session][:email].downcase )\n\n if user and user.authenticate( params[:session][:password] )\n sign_in user \n redirect_to root_url\n else\n flash[:error] = \"invalid email/password\"\n render :action => 'new' \n end\n end",
"def create\n user = User.from_omniauth(env[\"omniauth.auth\"])\n session[:user_id] = user.id\n me=User.find(user.id)\n me.loggedin=true\n me.tutoring=false\n me.request=Request.new(class_name:\"3365f80a5cccb3e76443df3b736b26e8\")\n me.save\n render erb: :'sessions#create'\nend",
"def create\n user = User.find_by(email: params[:email])\n respond_to do |format|\n if signed_in?\n format.html { redirect_to(root_path, notice: 'Cannot login while already logged in.') }\n format.json { render(errors: 'Cannot login while already logged in', status: :unprocessable_entity) }\n elsif !user.nil? && user.authenticate(params[:password])\n sign_in(user[:id])\n format.html { redirect_to(root_path, notice: 'session was successfully created.') }\n format.json { render :show, status: :created, location: @session }\n else\n\n format.html { redirect_to(login_path, notice: 'Invalid login.') }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # Where do we want to redirect to with our new session\n path = cookies.encrypted[:continue] || success_path\n\n # Get auth hash from omniauth\n auth = request.env[OMNIAUTH]\n\n if auth.nil?\n return login_failure({})\n end\n\n # Find an authentication or create an authentication\n auth_model = ::Auth::Authentication.from_omniauth(auth)\n\n # adding a new auth to existing user\n if auth_model.nil? && signed_in?\n logger.info \"User signed in and re-authenticating\"\n\n ::Auth::Authentication.create_with_omniauth(auth, current_user.id)\n redirect_to path\n Auth::Authentication.after_login_block.call(current_user, auth[PROVIDER], auth)\n\n # new auth and new user\n elsif auth_model.nil?\n args = safe_params(auth.info)\n user = ::User.new(args)\n\n # Use last name and first name by preference\n fn = args[:first_name]\n if fn && !fn.empty?\n user.name = \"#{fn} #{args[:last_name]}\"\n end\n\n authority = current_authority\n\n existing = ::User.find_by_email(authority.id, user.email)\n user = existing if existing\n user.deleted = false if user.respond_to?(:deleted)\n\n user.authority_id = authority.id\n\n # now the user record is initialised (but not yet saved), give\n # the installation the opportunity to modify the user record or\n # reject the signup outright\n result = Auth::Authentication.before_signup_block.call(user, auth[PROVIDER], auth)\n\n logger.info \"Creating new user: #{result.inspect}\\n#{user.inspect}\"\n \n if result != false && user.save\n # user is created, associate an auth record or raise exception\n Auth::Authentication.create_with_omniauth(auth, user.id)\n\n # make the new user the currently logged in user\n remove_session\n new_session(user)\n\n # redirect the user to the page they were trying to access and\n # run any custom post-login actions\n redirect_to path\n Auth::Authentication.after_login_block.call(user, auth[PROVIDER], auth)\n else\n logger.info \"User save failed: #{user.errors.messages}\"\n\n # user save failed (db or validation error) or the before\n # signup block returned false. redirect back to a signup\n # page, where /signup is a required client side path.\n store_social(auth[UID], auth[PROVIDER])\n redirect_to '/signup/index.html?' + auth_params_string(auth.info)\n end\n\n # existing auth and existing user\n else\n begin\n # Log-in the user currently authenticating\n remove_session if signed_in?\n user = User.find_by_id(auth_model.user_id)\n new_session(user)\n redirect_to path\n Auth::Authentication.after_login_block.call(user, auth[PROVIDER], auth)\n rescue => e\n logger.error \"Error with user account. Possibly due to a database failure:\\nAuth model: #{auth_model.inspect}\\n#{e.inspect}\"\n raise e\n end\n end\n end",
"def create\n user = User.find_by(email: params[:email])\n if user && user.authenticate(params[:password])\n #if user exists (by their email) and their password is authenticated\n #then create a session with :user_id as the key and this particular users id as its value\n session[:user_id] = user.id\n redirect_to products_url, notice: \"You're logged in!\"\n else\n flash.now[:alert] = \"Invalid email or password\"\n render :new\n end\n end",
"def create\n user = User.find_by_login(params[:session][:login])\n if user && user.authenticate(params[:session][:password])\n sign_in user\n redirect_back_or user_path(user.login)\n else\n flash.now[:error] = \"Ungültige Passwort / Login Kombination\"\n render 'new'\n end\n end",
"def create\n user = User.authenticate(params[:email], params[:password])\n\tif user\n\t session[:user_id] = user.id\n\t redirect_to root_url, :notice => \"Logged in!\"\n\telse\n\t flash.now.alert = \"Invalid email or password\"\n\t render \"new\"\n\tend\n end",
"def create_session user_id\n @state.user_id = user_id\n end",
"def new\n auth_hash = request.env['omniauth.auth']\n session[:auth_provider] = auth_hash[:provider]\n\n # look up auth_field, auth_value of User by provider, from config/initializers/omniauth.rb\n # Currently CAS is our only provider\n auth_config = ResearchMatch::Application.config.auth_providers[session[:auth_provider].to_sym]\n if auth_config\n auth_field = auth_config[:auth_field].to_s\n auth_value = auth_hash[auth_config[:auth_value]].to_s\n session[:auth_field] = auth_field\n session[:auth_value] = auth_value\n else\n flash[:error] = \"There were problems identifying your auth provider. Please try again or contact support.\"\n redirect_to home_path\n return\n end\n\n\n user = User.where(auth_field => auth_value).first\n if user.present?\n UserSession.new(user).save\n session[:user_id] = user.id # TODO remove (use only @user_session)\n redirect_to dashboard_path\n else\n if session[:auth_provider].to_sym == :google_oauth2\n session[:info_hash] = auth_hash[:info]\n end\n puts 'redirect_to new_user_path'\n redirect_to new_user_path\n end\n end",
"def create\n\t\t#render 'new'\n\t\tuser = User.find_by(email: params[:session][:email].downcase)\n\t\tif user && user.authenticate(params[:session][:password])\n\t\t\tsession[:user_id] = user.id\n\t\t\tflash[:success] = \"You have successfully logged in!\"\n\t\t\tredirect_to user_path(user)\n\t\telse\n\t\t\t#when u render using flash.now and when u redirect_to using flash.\n\t\t\tflash.now[:danger] = \"There is something wrong with your login information!\"\n\t\t\trender 'new'\n\t\tend\n\tend",
"def create\n if user = User.authenticate_with_credentials(params[:email], params[:password])\n session[:user_id] = user.id\n redirect_to :root\n else\n @error_login='Invalid Username/password!'\n render :new, alert: @error_login\n end\n end",
"def generate_session(user)\n AuthController.clear_user_info(session, nil)\n session[:original_user] = @original_user\n session[:impersonate] = true\n session[:user] = user\n end",
"def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n session[:user] = {id: @user.id, auth_token: @user.generate_auth_token!}\n format.html { redirect_to main_welcome_url, notice: 'User was successfully created.' }\n else\n format.html { render action: \"new\" }\n end\n end\n end",
"def create\n user = User.find_by(username: params[:username])\n authenticated = user.try(:authenticate, params[:password])\n return head(:forbidden) unless authenticated\n @user = user\n session[:user_id] = @user.id\n end",
"def create\n # find the user based on email in params from post action. Downcase as all emails are downcased in database.\n user = User.find_by(email: params[:session][:email].downcase)\n # is user returned valid? If so, authenticate (.authenticate comes from bcrypt gem. Checks if the password matches.)\n if user && user.authenticate(params[:session][:password])\n # Save the user id in the session's hash (add a :user_id key & save the current user's id as the value)\n session[:user_id] = user.id\n # show success message & redirect to the logged in user's profile page\n flash[:success] = \"You have successfully logged in\"\n redirect_to user_path(user)\n # If either is false, then show fail message and render the login page again\n else\n flash.now[:danger] = \"There was something wrong with your login info\"\n render 'new'\n end\n end",
"def create\n user = User.find_by(:name => params[:name])\n if user && user.authenticate(params[:password])\n session[:user_id] = user.id\n redirect_to user_path(user)\n else\n render :new\n end\n end",
"def create\n user = User.find_by(name: params[:name])\n if user&.authenticate(params[:password])\n session[:user_id] = user.id\n redirect_to home_path\n else\n redirect_to login_path, alert: \"Invalid user/password combination\"\n end\n end",
"def create\n # Find the user\n user = User.find_by(email: params[:session][:email].downcase)\n # Get the password from the parameters\n password = params[:session][:password]\n # Try to authenticate the user\n if user && user.authenticate(password)\n flash[:success] = \"Welcome back #{user.username}\"\n # Store the user id in the session\n session[:user_id] = user.id\n # Redirect the user to its page\n redirect_to user_path(user)\n else\n # Since we are using render, there won't be another request, so we need to use flash.now\n flash.now[:danger] = \"Wrong email or password. Please try again.\"\n render :new\n end\n end"
] | [
"0.82554793",
"0.80660903",
"0.79936004",
"0.7928978",
"0.7843265",
"0.77816784",
"0.7773531",
"0.7729638",
"0.77070653",
"0.76557976",
"0.76029485",
"0.75800085",
"0.7536167",
"0.7524035",
"0.7520292",
"0.75050956",
"0.7503108",
"0.7490362",
"0.74879897",
"0.7483386",
"0.7472555",
"0.7471631",
"0.7465694",
"0.7465117",
"0.7460699",
"0.7460005",
"0.74557006",
"0.7448412",
"0.74430096",
"0.74327",
"0.74308205",
"0.74270904",
"0.7419994",
"0.7407651",
"0.73965937",
"0.7394836",
"0.7390758",
"0.7385828",
"0.73829454",
"0.73808175",
"0.73758346",
"0.7371274",
"0.73690146",
"0.73690146",
"0.73690146",
"0.73690146",
"0.73690146",
"0.7367808",
"0.73626435",
"0.73620325",
"0.7350998",
"0.7350375",
"0.734722",
"0.7346931",
"0.7341265",
"0.7328468",
"0.73253506",
"0.73226",
"0.7315966",
"0.7312705",
"0.7309077",
"0.7300553",
"0.72997516",
"0.72995573",
"0.729697",
"0.72876954",
"0.7286954",
"0.72853553",
"0.7281794",
"0.72800714",
"0.7278932",
"0.72772515",
"0.72728115",
"0.7264157",
"0.7260626",
"0.7260195",
"0.72595626",
"0.7256669",
"0.7252569",
"0.72515273",
"0.72430336",
"0.7239304",
"0.7237667",
"0.72354615",
"0.72321254",
"0.7225544",
"0.7220239",
"0.7205359",
"0.72024083",
"0.72021717",
"0.7195425",
"0.7188964",
"0.71856487",
"0.7177453",
"0.7174386",
"0.716881",
"0.7163822",
"0.7155634",
"0.71537626",
"0.7147162",
"0.7139946"
] | 0.0 | -1 |
logs user out of session/delete session | def destroy
session[:user_id]=nil
redirect_to root_path
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def log_out\n \tsession.delete(:user_id)\n \t@current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n\n end",
"def log_out \n session.clear\n @current_user = nil\n end",
"def log_out\n\t \tsession.delete(:user_id)\n\t \t@current_user =nil\n\t end",
"def log_out\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"def log_out\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"def log_out\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"def log_out\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"def log_out\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"def log_out\n session.delete(:user_id)\n @current_user = nil \n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\nend",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n session.delete(:user_name)\n session.delete(:user_email)\n @current_user = nil\n end",
"def log_out\n reset_session\n @current_user = nil\n end",
"def log_out\n\t\tsession.delete(:user_id)\n\t\t@current_user= nil\n\tend",
"def log_out\n session.delete(:user_id)\n session.delete(:user_type)\n session.delete(:user_email)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user=nil\n end",
"def log_out\n\t\tsession[:user_id] = nil\n\tend",
"def log_out\n\t\tsession.delete(:id)\n\t\t@current_user = nil\n\t\tadmin_session(false)\n\tend",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:username)\n session.delete(:token)\n @current_user = nil\n end",
"def log_out\n session[:user_id] = nil\n end",
"def log_out\n session.delete(:uid)\n @current_user = nil\n end",
"def log_out\n\t\t# current_user.delete_auth_token # won't work with curl, but html is good\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"def user_log_out\n user_forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n forget current_user\n session.delete :user_id\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n forget(@current_user)\n @current_user=nil\n end",
"def log_out\n\t\tforget(current_user) #call user.forget\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"def log_out\n forget(current_user)\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"def log_out\r\n forget(current_user)\r\n session.delete(:user_id)\r\n @current_user = nil\r\n end",
"def log_out\n session.delete(:user_id) #remove the user id from the browser cache\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n forget current_user\n reset_session\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n session.delete(:type)\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def user_log_out\n forget_user(current_user)\n session.delete(:user_id)\n @current_user = nil\n end",
"def log_out\n\t\tforget(current_user)\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"def log_out\n\t\tforget(current_user)\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"def log_out\n\t\tforget(current_user)\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"def log_out\n\t\tforget(current_user)\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"def log_out\n\t\tforget(current_user)\n\t\tsession.delete(:user_id)\n\t\t@current_user = nil\n\tend",
"def log_out\n forget(current_user)\n reset_session\n @current_user = nil\n end",
"def log_out\n session.delete(:user_id)\n cookies.delete :user_id\n end",
"def log_out\n if !current_user.nil?\n forget(current_user)\n\n session.delete(:user_id)\n session.delete(:user_type)\n @current_user = nil\n end\n end",
"def log_out\n session.delete(:user_credentials)\n @current_user = nil\n end",
"def log_out\n forget(current_user)\n session.delete(:session_database)\n session.delete(:user_id)\n @current_user = nil\n end"
] | [
"0.8847182",
"0.881492",
"0.8783745",
"0.8782671",
"0.8770488",
"0.87580764",
"0.87580764",
"0.87580764",
"0.87580764",
"0.8757814",
"0.8754921",
"0.8754602",
"0.8751901",
"0.8751888",
"0.8751888",
"0.8751888",
"0.8751888",
"0.8751888",
"0.8751888",
"0.8751888",
"0.8751888",
"0.8751888",
"0.8751888",
"0.8751888",
"0.8751888",
"0.8751888",
"0.8751888",
"0.8751888",
"0.8751888",
"0.8751888",
"0.8751888",
"0.8751888",
"0.8751888",
"0.8751888",
"0.8751888",
"0.8751888",
"0.87369597",
"0.8721643",
"0.87183887",
"0.87177765",
"0.87128615",
"0.8701772",
"0.87004626",
"0.86965466",
"0.86965466",
"0.86965466",
"0.86965466",
"0.86965466",
"0.866837",
"0.8653947",
"0.86372256",
"0.86252946",
"0.86158913",
"0.8613625",
"0.8611967",
"0.8610156",
"0.86055416",
"0.85932523",
"0.8578755",
"0.85637784",
"0.8563615",
"0.8542964",
"0.8542398",
"0.8535006",
"0.85282165",
"0.85282165",
"0.85282165",
"0.85282165",
"0.85282165",
"0.85282165",
"0.85282165",
"0.85282165",
"0.85282165",
"0.85282165",
"0.85282165",
"0.85282165",
"0.85282165",
"0.85282165",
"0.85282165",
"0.85282165",
"0.85282165",
"0.85282165",
"0.85282165",
"0.85282165",
"0.85282165",
"0.85282165",
"0.85282165",
"0.85282165",
"0.85282165",
"0.8528197",
"0.8526776",
"0.85254675",
"0.85254675",
"0.85254675",
"0.85254675",
"0.85254675",
"0.84954476",
"0.8489451",
"0.84569746",
"0.8445162",
"0.843927"
] | 0.0 | -1 |
Connects to the Browserstack REST API and makes a PUT request to update the session with the matching +session_id+ to 'passed'. It returns a string which can be used as a message for output confirming the action. | def passed(session_id)
check_before_update(session_id, status: "passed")
"Browserstack session #{session_id} status set to \e[32mpassed\e[0m 😀"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @current_session = CurrentSession.find(params[:id])\n\n if @current_session.update(params[:current_session])\n head :no_content\n else\n render json: @current_session.errors, status: :unprocessable_entity\n end\n end",
"def update\n @session = @event.sessions.find(params[:id])\n\n respond_to do |format|\n if @session.update_attributes(params[:session])\n format.html { redirect_to [@event, @session], notice: 'Session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @session_resource = SessionResource.find(params[:id])\n\n if @session_resource.update(session_resource_params)\n head :no_content\n else\n render json: @session_resource.errors, status: :unprocessable_entity\n end\n end",
"def update\n @session = Session.find(params[:id])\n\n respond_to do |format|\n if @session.update_attributes(params[:session])\n format.html { redirect_to @session, notice: 'Session was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @session = Session.find(params[:id])\n\n respond_to do |format|\n if @session.update_attributes(params[:session])\n format.html { redirect_to @session, notice: 'Session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @session = Session.find(params[:id])\n\n respond_to do |format|\n if @session.update_attributes(params[:session])\n format.html { redirect_to @session, notice: 'Session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @session = Session.find(params[:id])\n\n respond_to do |format|\n if @session.update_attributes(params[:session])\n format.html { redirect_to @session, notice: 'Session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n @session = Session.find(params[:id])\r\n\r\n\r\n json = ActiveSupport::JSON.decode(request.raw_post)\r\n logger.debug json\r\n\r\n #@session.pla\r\n\r\n #json = ActiveSupport::JSON.decode(request.raw_post)\r\n #@session.state = json['state']\r\n\r\n respond_to do |format|\r\n if @session.save\r\n format.html { redirect_to(@session, :notice => 'Session was successfully updated.') }\r\n format.xml { head :ok }\r\n format.json { head :ok }\r\n else\r\n format.html { render :action => \"edit\" }\r\n format.xml { render :xml => @session.errors, :status => :unprocessable_entity }\r\n format.json { render :json => @session.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n @session = Session.find(params[:id])\n\n respond_to do |format|\n if @session.update_attributes(params[:session])\n format.html { redirect_to @session, notice: 'Session was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @session.update(session_params)\n format.html { redirect_to game_session_path(@session), notice: 'Session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize @session\n respond_to do |format|\n if @session.update(session_params)\n format.html { redirect_to @session, notice: 'Session was successfully updated.' }\n format.json { render :show, status: :ok, location: @session }\n else\n format.html { render :edit }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @session = Session.find(params[:id])\n\n respond_to do |format|\n if @session.update_attributes(params[:session])\n flash[:notice] = 'Session was successfully updated.'\n format.html { \n if @session.course\n redirect_to(admin_course_session_path(@session.course, @session))\n else\n redirect_to(admin_session_path(@session))\n end\n }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @session.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @session = Session.find_by_id(params[:id])\n\n if @session.nil?\n render json: {message: \"404 Not Found\"}, status: :not_found\n else\n @session.update(session_params)\n end\n end",
"def update\n\n respond_to do |format|\n if @session.update_attributes(params[:session])\n format.html { redirect_to @session, notice: 'Session was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @session.update(session_params)\n format.html { redirect_to @session, notice: 'Session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ergo_session.update(ergo_session_params)\n format.html { redirect_to @ergo_session, notice: 'Ergo session was successfully updated.' }\n format.json { render :show, status: :ok, location: @ergo_session }\n else\n format.html { render :edit }\n format.json { render json: @ergo_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @session.update(session_params)\n format.html { redirect_to @session, notice: 'Session was successfully updated.' }\n format.json { render :show, status: :ok, location: @session }\n else\n format.html { render :edit }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @session.update(session_params)\n format.html { redirect_to @session, notice: 'Session was successfully updated.' }\n format.json { render :show, status: :ok, location: @session }\n else\n format.html { render :edit }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @session.update(session_params)\n format.html { redirect_to @session, notice: 'Session was successfully updated.' }\n format.json { render :show, status: :ok, location: @session }\n else\n format.html { render :edit }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @session.update(session_params)\n format.html { redirect_to @session, notice: 'Session was successfully updated.' }\n format.json { render :show, status: :ok, location: @session }\n else\n format.html { render :edit }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @session = Session.find(params[:id])\n authorize @session\n @session.update(session_params)\n redirect_to trainings_path\n end",
"def update\n respond_to do |format|\n if @admin_session.update(session_params)\n format.html { redirect_to @admin_session, notice: 'Session was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_session }\n else\n format.html { render :edit }\n format.json { render json: @admin_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n return unless restrict_to_hosts\n\n respond_to do |format|\n if @session.update(session_params)\n format.html { redirect_to [@event, @session], notice: 'Session was successfully updated.' }\n format.json { render :show, status: :ok, location: [@event, @session] }\n else\n format.html { render :edit }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_session_key\n @parameters['sessionKey'] = get_session_key\n end",
"def update\n respond_to do |format|\n if @lift_session.update(lift_session_params)\n format.html { redirect_to @lift_session, notice: 'Lift session was successfully updated.' }\n format.json { render :show, status: :ok, location: @lift_session }\n else\n format.html { render :edit }\n format.json { render json: @lift_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @yoga_session = YogaSession.find(params[:id])\n\n respond_to do |format|\n if @yoga_session.update_attributes(params[:yoga_session])\n format.html { redirect_to @yoga_session, notice: 'Yoga session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @yoga_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @study_session = StudySession.find(params[:study_session])\n\n respond_to do |format|\n if @study_session.update_attributes(params[:study_session])\n format.html { redirect_to [@study_session.course, @study_session], notice: 'Study session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @study_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def edit_session_with_http_info(id, start, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SessionApi.edit_session ...\"\n end\n # verify the required parameter 'id' is set\n fail ArgumentError, \"Missing the required parameter 'id' when calling SessionApi.edit_session\" if id.nil?\n # verify the required parameter 'start' is set\n fail ArgumentError, \"Missing the required parameter 'start' when calling SessionApi.edit_session\" if start.nil?\n # resource path\n local_var_path = \"/session/edit\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'id'] = id\n query_params[:'start'] = start\n query_params[:'boat_id'] = opts[:'boat_id'] if !opts[:'boat_id'].nil?\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InlineResponse20044')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SessionApi#edit_session\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n respond_to do |format|\n if @session_operation.update(session_operation_params)\n format.html { redirect_to @session_operation, notice: 'Session operation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @session_operation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @exercise_session.update(exercise_session_params)\n format.html { redirect_to @exercise_session, notice: 'Exercise session was successfully updated.' }\n format.json { render :show, status: :ok, location: @exercise_session }\n else\n format.html { render :edit }\n format.json { render json: @exercise_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def session(session_id)\n @session_id = session_id\n end",
"def update\n respond_to do |format|\n if @analysis_session.update(analysis_session_params)\n format.html { redirect_to @qa_session, notice: 'Analysis session was successfully updated.' }\n format.json { render :show, status: :ok, location: @analysis_session }\n else\n format.html { render :edit }\n format.json { render json: @analysis_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sevone_session.update(sevone_session_params)\n format.html { redirect_to @sevone_session, notice: 'Sevone session was successfully updated.' }\n format.json { render :show, status: :ok, location: @sevone_session }\n else\n format.html { render :edit }\n format.json { render json: @sevone_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @session\n @session.update_session(marshalize(@data))\n end\n end",
"def update!(**args)\n @zwieback_session_id = args[:zwieback_session_id] if args.key?(:zwieback_session_id)\n end",
"def update!(**args)\n @zwieback_session_id = args[:zwieback_session_id] if args.key?(:zwieback_session_id)\n end",
"def update\n @ykt_session = YktSession.find(params[:id])\n\n respond_to do |format|\n if @ykt_session.update_attributes(params[:ykt_session])\n format.html { redirect_to @ykt_session, notice: 'Ykt session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ykt_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put(path, params={}) # :nodoc:\n handle_response(@session.put(path, MultiJson.dump(params)))\n end",
"def update\n @sessions = SessionEvent.find(params[:id])\n if @sessions.update_attributes(session_event_params)\n flash[:success] = \"Your session has been updated\"\n redirect_to @sessions\n end\n respond_to do |format|\n if @session_event.update(session_event_params)\n format.html { redirect_to @session_event, notice: 'Session event was successfully updated.' }\n format.json { render :show, status: :ok, location: @session_event }\n else\n format.html { render :edit }\n format.json { render json: @session_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def write_session(env, sid, session, options); end",
"def update\n return if Settings.readonly \n\n respond_to do |format|\n if @session.update(session_params)\n format.html { redirect_to sessions_url, notice: 'Session was successfully updated.' }\n format.json { render :show, status: :ok, location: @session }\n else\n format.html { render :edit }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n java_session = @java_request.getSession(true)\n hash = @session_data.dup\n hash.delete_if do |k,v|\n if String === k\n case v\n when String, Numeric, true, false, nil\n java_session.setAttribute k, v\n true\n else\n if v.respond_to?(:java_object)\n java_session.setAttribute k, v\n true\n else\n false\n end\n end\n end\n end\n unless hash.empty?\n marshalled_string = Marshal.dump(hash)\n marshalled_bytes = marshalled_string.to_java_bytes\n java_session.setAttribute(RAILS_SESSION_KEY, marshalled_bytes)\n end\n end",
"def update\n respond_to do |format|\n if @otg_sess.update(otg_sess_params)\n format.html { redirect_to @otg_sess, notice: 'Otg sess was successfully updated.' }\n format.json { render :show, status: :ok, location: @otg_sess }\n else\n format.html { render :edit }\n format.json { render json: @otg_sess.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @game_session.update(game_session_params)\n format.html { redirect_to @game_session, notice: 'Game session was successfully updated.' }\n format.json { render :show, status: :ok, location: @game_session }\n else\n format.html { render :edit }\n format.json { render json: @game_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @session_info = args[:session_info] if args.key?(:session_info)\n end",
"def update\n @polling_session = PollingSession.find(params[:id])\n\n respond_to do |format|\n if @polling_session.update_attributes(params[:polling_session])\n format.html { redirect_to @polling_session, notice: 'Polling session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @polling_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @session_login.update(session_login_params)\n format.html { redirect_to @session_login, notice: \"Session login was successfully updated.\" }\n format.json { render :show, status: :ok, location: @session_login }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @session_login.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @discovery_session = DiscoverySession.find(params[:id])\n\n respond_to do |format|\n if @discovery_session.update_attributes(params[:discovery_session])\n format.html { redirect_to @discovery_session, notice: 'Discovery session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @discovery_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @pool_session = PoolSession.find(params[:id])\n if @pool_session.player1 == @pool_session.player2\n flash[:error] = \"You must specifify 2 separate players in a session\"\n render :action => \"edit\" \n else\n respond_to do |format|\n if @pool_session.update_attributes(params[:session])\n update_player_scores\n format.html { redirect_to(@pool_session, :notice => 'Session was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @pool_session.errors, :status => :unprocessable_entity }\n end\n end\n end\n end",
"def update\n @barcamp_session = BarcampSession.find(params[:id])\n\n respond_to do |format|\n if @barcamp_session.update_attributes(params[:barcamp_session])\n format.html { redirect_to(@barcamp_session, :notice => 'Barcamp session was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @barcamp_session.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @tutoring_session = TutoringSession.find(params[:id])\n\n respond_to do |format|\n if @tutoring_session.update_attributes(params[:tutoring_session])\n format.html { redirect_to @tutoring_session, notice: 'Tutoring session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tutoring_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @interview_session = InterviewSession.find(params[:id])\n\n respond_to do |format|\n if @interview_session.update_attributes(params[:interview_session])\n format.html { redirect_to(@interview_session, :notice => 'Interview session was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @interview_session.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @user_session.update(user_session_params)\n format.html { redirect_to @user_session, notice: 'User session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def save_session(session)\n \n end",
"def update\n respond_to do |format|\n if @class_session.update(class_session_params)\n format.html { redirect_to @class_session, notice: 'Class session was successfully updated.' }\n format.json { render :show, status: :ok, location: @class_session }\n else\n format.html { render :edit }\n format.json { render json: @class_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @class_session.update(class_session_params)\n format.html { redirect_to @class_session, notice: 'Class session was successfully updated.' }\n format.json { render :show, status: :ok, location: @class_session }\n else\n format.html { render :edit }\n format.json { render json: @class_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_session(data)\n update_attribute('data', data) \n end",
"def update\n if @scenario.update(scenario_params)\n \trender json: @scenario\n else\n \trender json: {status: 'ERROR', data: @scenario.errors}\n end\n end",
"def update\n\t\trespond_to do |format|\n\t\t\tif @class_session.update(class_session_params)\n\t\t\t\tformat.html { redirect_to @class_session, notice: 'Class session was successfully updated.' }\n\t\t\t\tformat.json { head :no_content }\n\t\t\telse\n\t\t\t\tformat.html { render action: 'edit' }\n\t\t\t\tformat.json { render json: @class_session.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def update\n respond_to do |format|\n if @guest_session_association.update(guest_session_association_params)\n format.html { redirect_to @guest_session_association, notice: 'Guest session association was successfully updated.' }\n format.json { render :show, status: :ok, location: @guest_session_association }\n else\n format.html { render :edit }\n format.json { render json: @guest_session_association.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_session\n auth = Knock::AuthToken.new(payload: to_token_payload)\n auth.token\n end",
"def update\n @training_session = TrainingSession.find(params[:id])\n\n respond_to do |format|\n if @training_session.update_attributes(params[:training_session])\n format.html { redirect_to @training_session, notice: 'Training session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @training_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def sessionChange(options={})\n assert_valid_keys(options, :sessionId, :amount)\n assert_keys_exists(options, :sessionId, :amount)\n execute(:sessionChange, options)\n end",
"def update\n respond_to do |format|\n if @training_session.update(training_session_params)\n format.html { redirect_to @training_session, notice: 'Training session was successfully updated.' }\n format.json { render :show, status: :ok, location: @training_session }\n else\n format.html { render :edit }\n format.json { render json: @training_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @session_state_info = args[:session_state_info] if args.key?(:session_state_info)\n @transcription_session_id = args[:transcription_session_id] if args.key?(:transcription_session_id)\n end",
"def update\n @session_info = SessionInfo.first\n\n respond_to do |format|\n if @session_info.update_attributes(params[:session_info])\n format.html { redirect_to session_information_path, notice: 'Session Info was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @session_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def edit(request)\n render do |xml|\n xml.h2 \"Update rack session\"\n xml.p \"Put marshalized and encoded with base64 ruby hash into the form\"\n xml.form({\n :action => action_path(:update),\n :method => 'post',\n :enctype => 'application/x-www-form-urlencoded'\n }) do |form|\n form.input(:type => 'hidden', :name =>'_method', :value => 'put')\n form.textarea(:cols => 40, :rows => 10, :name => 'data') {}\n form.p do |p|\n p.input(:type => 'submit', :value => \"Update\")\n end\n end\n end\n end",
"def update\n respond_to do |format|\n if @qa_session_file.update(qa_session_file_params)\n format.html { redirect_to @qa_session_file, notice: 'qa_session file was successfully updated.' }\n format.json { render :show, status: :ok, location: @qa_session_file }\n else\n format.html { render :edit }\n format.json { render json: @qa_session_file.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n contestID = params[:id]\n submissionID = params[:contestID]\n res = Contests.set_winner(contestID, submissionID)\n # email using mailjet\n contest = Contests.get_contest(contestID).first\n test = \"Congrats on winning the contest: #{contest[\"title\"]}, You have won $#{contest[\"price\"]}!\"\n system(\"curl -X POST --user \\\"7c80d03e683e8c7313d50629a9feafb7:434aaee16cb9e82e6ff117fc2716c2c7\\\" https://api.mailjet.com/v3/send/message -F from='[email protected]' -F [email protected] -F subject='Congrats on winning!' -F text='#{test}'\")\n redirect_to \"/contests/view/#{contestID}\"\n end",
"def set_session\n @session = FitnessSession.find(params[:id])\n end",
"def store_session(session_id, data)\n set(\"session:#{session_id}\", data)\n end",
"def update\n respond_to do |format|\n if @subject_session.update(subject_session_params)\n format.html { redirect_to @subject_session, notice: 'Subject session was successfully updated.' }\n format.json { render :show, status: :ok, location: @subject_session }\n else\n format.html { render :edit }\n format.json { render json: @subject_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @help_session_request.update(help_session_request_params)\n format.html { redirect_to @help_session_request, notice: 'Help session request was successfully updated.' }\n format.json { render :show, status: :ok, location: @help_session_request }\n else\n format.html { render :edit }\n format.json { render json: @help_session_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tsession.update(tsession_params)\n format.html { redirect_to @tsession, notice: 'Tsession was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tsession.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_session\n \n end",
"def update!(**args)\n @contextual_session_id = args[:contextual_session_id] if args.key?(:contextual_session_id)\n end",
"def update_bgp_session_with_http_info(id, default_route, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BGPApi.update_bgp_session ...'\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling BGPApi.update_bgp_session\"\n end\n # verify the required parameter 'default_route' is set\n if @api_client.config.client_side_validation && default_route.nil?\n fail ArgumentError, \"Missing the required parameter 'default_route' when calling BGPApi.update_bgp_session\"\n end\n # resource path\n local_var_path = '/bgp/sessions/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(default_route)\n\n # return_type\n return_type = opts[:debug_return_type]\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['x_auth_token']\n\n new_options = opts.merge(\n :operation => :\"BGPApi.update_bgp_session\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BGPApi#update_bgp_session\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n @user_session = UserSession.find(params[:id])\n\n respond_to do |format|\n if @user_session.update_attributes(params[:user_session])\n format.html { redirect_to(:controller=>'users', :action=>'edit') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user_session.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @plateau_session = PlateauSession.find(params[:id])\n\n respond_to do |format|\n if @plateau_session.update_attributes(params[:plateau_session])\n format.html { redirect_to(@plateau_session, :notice => 'Plateau session was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @plateau_session.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @session_info = args[:session_info] if args.key?(:session_info)\n @verification_code = args[:verification_code] if args.key?(:verification_code)\n end",
"def update\n respond_to do |format|\n if @session_note.update(session_note_params)\n format.html { redirect_to @session_note, notice: 'Session note was successfully updated.' }\n format.json { render :show, status: :ok, location: @session_note }\n else\n format.html { render :edit }\n format.json { render json: @session_note.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @session_plan_category.session_plans.find(params[:id]).update(session_plan_params)\n redirect_to session_plan_category_session_plans_path(@session_plan_category), notice: \"Session Plan updated successfully.\"\n else\n render 'edit'\n end\n end",
"def set_session\n @session = Session.find(params[:session_id])\n end",
"def post_params(path, params, session)\n post path, params, {\"rack.session\" => {\"uid\" => session['uid']}}\n end",
"def create_smite_api_session\n session_timestamp = Time.now.getutc.strftime(\"%Y%m%d%H%M%S\")\n session_string = \"#{ENV['SMITE_API_DEV_ID']}\" + 'createsession' + \"#{ENV['SMITE_API_AUTHKEY']}\" + session_timestamp\n session_signature = Digest::MD5.hexdigest(session_string)\n\n smite_session = RestClient.get(\"#{SMITE_PC_URL}/createsessionJson/#{ENV['SMITE_API_DEV_ID']}/#{session_signature}/#{session_timestamp}\")\n JSON.parse(smite_session)['session_id']\nend",
"def update\n respond_to do |format|\n if @pairing_session.update(pairing_session_params)\n format.html { redirect_to @pairing_session, notice: 'Pairing session was successfully updated.' }\n format.json { render :show, status: :ok, location: @pairing_session }\n else\n format.html { render :edit }\n format.json { render json: @pairing_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @program_session = ProgramSession.find(params[:id])\n\n respond_to do |format|\n if @program_session.update_attributes(params[:program_session])\n flash[:notice] = 'ProgramSession was successfully updated.'\n format.html { redirect_to(@program_session) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @program_session.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @session_time.update(session_time_params)\n format.html { redirect_to @session_time, notice: 'Session time was successfully updated.' }\n format.json { render :show, status: :ok, location: @session_time }\n else\n format.html { render :edit }\n format.json { render json: @session_time.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @session_replica.update(session_replica_params)\n format.html { redirect_to @session_replica}\n format.json { render :show, status: :ok, location: @session_replica }\n else\n format.html { render :edit }\n format.json { render json: @session_replica.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_session(env, sid)\n raise '#set_session needs to be implemented.'\n end",
"def update\n head :unauthorized\n end",
"def patch_recordings_screensession_with_http_info(recording_session_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RecordingApi.patch_recordings_screensession ...\"\n end\n \n \n # verify the required parameter 'recording_session_id' is set\n fail ArgumentError, \"Missing the required parameter 'recording_session_id' when calling RecordingApi.patch_recordings_screensession\" if recording_session_id.nil?\n \n \n \n \n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/recordings/screensessions/{recordingSessionId}\".sub('{format}','json').sub('{' + 'recordingSessionId' + '}', recording_session_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(opts[:'body'])\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: RecordingApi#patch_recordings_screensession\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def set_session\n @session = BatchConnect::Session.find(params[:id])\n end",
"def put(session=nil)\n if session.class.method_defined?(:j_del) && block_given?\n return @j_del.java_method(:put, [Java::IoVertxExtWeb::Session.java_class,Java::IoVertxCore::Handler.java_class]).call(session.j_del,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) }))\n end\n raise ArgumentError, \"Invalid arguments when calling put(session)\"\n end",
"def set_session(env, sid, session, options)\n raise '#set_session not implemented.'\n end",
"def update\r\n @ss_class_session_note = SsClassSessionNote.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @ss_class_session_note.update_attributes(params[:ss_class_session_note])\r\n format.html { redirect_to @ss_class_session_note, notice: 'Ss class session note was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @ss_class_session_note.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n respond_to do |format|\n if @dream_session.update(dream_session_params)\n format.html { redirect_to @dream_session, notice: 'Dream session was successfully updated.' }\n format.json { render :show, status: :ok, location: @dream_session }\n else\n format.html { render :edit }\n format.json { render json: @dream_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @session_type = SessionType.find(params[:id])\n\n respond_to do |format|\n if @session_type.update_attributes(params[:session_type])\n format.html { redirect_to @session_type, notice: 'Session type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @session_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\r\n @session = Session.find(params[:id])\r\n\r\n if((@session.state == \"won\") && (@session.updated_at.to_i + 3 < Time.now.to_i))\r\n @session.state = \"nextQuestion\"\r\n @session.save\r\n end\r\n\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.xml { render :xml => @session }\r\n #format.json { render :json => @session }\r\n format.json { render_for_api :in_progress_session, :json => @session, :root => :session }\r\n\t\t\r\n end\r\n end",
"def update\n respond_to do |format|\n if @csession.update(csession_params)\n format.html { redirect_to @csession, notice: 'Csession was successfully updated.' }\n format.json { render :show, status: :ok, location: @csession }\n else\n format.html { render :edit }\n format.json { render json: @csession.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.6618149",
"0.64700043",
"0.6253981",
"0.6246038",
"0.62323993",
"0.62320304",
"0.62320304",
"0.6228393",
"0.62149775",
"0.6205324",
"0.6197566",
"0.6141522",
"0.6126286",
"0.6120822",
"0.6082385",
"0.6081707",
"0.6031955",
"0.6031955",
"0.6031955",
"0.6031955",
"0.6023681",
"0.5965246",
"0.59648794",
"0.593892",
"0.5874263",
"0.5830896",
"0.5815599",
"0.5785139",
"0.57786345",
"0.57647973",
"0.5762867",
"0.57575303",
"0.57522506",
"0.57462436",
"0.5714427",
"0.5714427",
"0.5702852",
"0.5698682",
"0.56575286",
"0.56574196",
"0.56560326",
"0.5635582",
"0.562698",
"0.558395",
"0.55599093",
"0.553179",
"0.5517985",
"0.55018973",
"0.5496366",
"0.54958236",
"0.5495131",
"0.5475965",
"0.5473856",
"0.54268837",
"0.5418661",
"0.5418661",
"0.541599",
"0.5415599",
"0.54116064",
"0.5406491",
"0.5406182",
"0.54002297",
"0.5390418",
"0.53805923",
"0.5377082",
"0.53765017",
"0.5364025",
"0.5360113",
"0.5359209",
"0.53577244",
"0.53435457",
"0.5341401",
"0.5336283",
"0.5331557",
"0.5322885",
"0.53227335",
"0.53185076",
"0.53023547",
"0.5302157",
"0.5293902",
"0.5288193",
"0.5284035",
"0.5283688",
"0.52772963",
"0.5264368",
"0.5257019",
"0.52564466",
"0.5238418",
"0.52377075",
"0.5225587",
"0.5223415",
"0.52207536",
"0.52194595",
"0.5206999",
"0.5206329",
"0.5205063",
"0.5204637",
"0.52023715",
"0.51895666",
"0.5187294"
] | 0.6255669 | 2 |
Connects to the Browserstack REST API and makes a PUT request to update the session with the matching +session_id+ to 'failed'. It returns a string which can be used as a message for output confirming the action. | def failed(session_id)
check_before_update(session_id, status: "failed")
"Browserstack session #{session_id} status set to \e[31mfailed\e[0m 😢"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @session_resource = SessionResource.find(params[:id])\n\n if @session_resource.update(session_resource_params)\n head :no_content\n else\n render json: @session_resource.errors, status: :unprocessable_entity\n end\n end",
"def update\n @current_session = CurrentSession.find(params[:id])\n\n if @current_session.update(params[:current_session])\n head :no_content\n else\n render json: @current_session.errors, status: :unprocessable_entity\n end\n end",
"def update\n @session = Session.find_by_id(params[:id])\n\n if @session.nil?\n render json: {message: \"404 Not Found\"}, status: :not_found\n else\n @session.update(session_params)\n end\n end",
"def update\n @session = @event.sessions.find(params[:id])\n\n respond_to do |format|\n if @session.update_attributes(params[:session])\n format.html { redirect_to [@event, @session], notice: 'Session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @session = Session.find(params[:id])\n\n respond_to do |format|\n if @session.update_attributes(params[:session])\n format.html { redirect_to @session, notice: 'Session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @session = Session.find(params[:id])\n\n respond_to do |format|\n if @session.update_attributes(params[:session])\n format.html { redirect_to @session, notice: 'Session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @session = Session.find(params[:id])\n\n respond_to do |format|\n if @session.update_attributes(params[:session])\n format.html { redirect_to @session, notice: 'Session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @session.update(session_params)\n format.html { redirect_to game_session_path(@session), notice: 'Session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @session = Session.find(params[:id])\n\n respond_to do |format|\n if @session.update_attributes(params[:session])\n format.html { redirect_to @session, notice: 'Session was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @session.update(session_params)\n format.html { redirect_to @session, notice: 'Session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @session = Session.find(params[:id])\n\n respond_to do |format|\n if @session.update_attributes(params[:session])\n format.html { redirect_to @session, notice: 'Session was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize @session\n respond_to do |format|\n if @session.update(session_params)\n format.html { redirect_to @session, notice: 'Session was successfully updated.' }\n format.json { render :show, status: :ok, location: @session }\n else\n format.html { render :edit }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_error(error)\n session[:error] = error\nend",
"def set_session\n return render json: { message: \"ID is not a number\"}, status: 422 unless Number.is_integer?(params[:id])\n begin\n @session = Session.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n render json: { message: \"Session with this ID not found\"}, status: 404\n rescue\n render json: { error: \"System Error\" }, status: 500\n end\n \n end",
"def update\n respond_to do |format|\n if @ergo_session.update(ergo_session_params)\n format.html { redirect_to @ergo_session, notice: 'Ergo session was successfully updated.' }\n format.json { render :show, status: :ok, location: @ergo_session }\n else\n format.html { render :edit }\n format.json { render json: @ergo_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @session_operation.update(session_operation_params)\n format.html { redirect_to @session_operation, notice: 'Session operation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @session_operation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n if @session.update_attributes(params[:session])\n format.html { redirect_to @session, notice: 'Session was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @session = Session.find(params[:id])\n\n respond_to do |format|\n if @session.update_attributes(params[:session])\n flash[:notice] = 'Session was successfully updated.'\n format.html { \n if @session.course\n redirect_to(admin_course_session_path(@session.course, @session))\n else\n redirect_to(admin_session_path(@session))\n end\n }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @session.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n return unless restrict_to_hosts\n\n respond_to do |format|\n if @session.update(session_params)\n format.html { redirect_to [@event, @session], notice: 'Session was successfully updated.' }\n format.json { render :show, status: :ok, location: [@event, @session] }\n else\n format.html { render :edit }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def passed(session_id)\n check_before_update(session_id, status: \"passed\")\n \"Browserstack session #{session_id} status set to \\e[32mpassed\\e[0m 😀\"\n end",
"def edit_session_with_http_info(id, start, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SessionApi.edit_session ...\"\n end\n # verify the required parameter 'id' is set\n fail ArgumentError, \"Missing the required parameter 'id' when calling SessionApi.edit_session\" if id.nil?\n # verify the required parameter 'start' is set\n fail ArgumentError, \"Missing the required parameter 'start' when calling SessionApi.edit_session\" if start.nil?\n # resource path\n local_var_path = \"/session/edit\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'id'] = id\n query_params[:'start'] = start\n query_params[:'boat_id'] = opts[:'boat_id'] if !opts[:'boat_id'].nil?\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InlineResponse20044')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SessionApi#edit_session\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def error\n @error = session[:error]\n session.delete(:error)\n end",
"def update\n respond_to do |format|\n if @session.update(session_params)\n format.html { redirect_to @session, notice: 'Session was successfully updated.' }\n format.json { render :show, status: :ok, location: @session }\n else\n format.html { render :edit }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @session.update(session_params)\n format.html { redirect_to @session, notice: 'Session was successfully updated.' }\n format.json { render :show, status: :ok, location: @session }\n else\n format.html { render :edit }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @session.update(session_params)\n format.html { redirect_to @session, notice: 'Session was successfully updated.' }\n format.json { render :show, status: :ok, location: @session }\n else\n format.html { render :edit }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @session.update(session_params)\n format.html { redirect_to @session, notice: 'Session was successfully updated.' }\n format.json { render :show, status: :ok, location: @session }\n else\n format.html { render :edit }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def invalidSession(context)\n context.response << \"<html><head><meta http-equiv=REFRESH content='1; URL=#{context.baseURL}'></head><body><b>That session no longer exists (#{$$}:#{$$.to_s(16)}).<p>You are being forwarded to a <a href='#{context.baseURL}'>new session</a>.</b></body></html>\"\n end",
"def update\n respond_to do |format|\n if @admin_session.update(session_params)\n format.html { redirect_to @admin_session, notice: 'Session was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_session }\n else\n format.html { render :edit }\n format.json { render json: @admin_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n @session = Session.find(params[:id])\r\n\r\n\r\n json = ActiveSupport::JSON.decode(request.raw_post)\r\n logger.debug json\r\n\r\n #@session.pla\r\n\r\n #json = ActiveSupport::JSON.decode(request.raw_post)\r\n #@session.state = json['state']\r\n\r\n respond_to do |format|\r\n if @session.save\r\n format.html { redirect_to(@session, :notice => 'Session was successfully updated.') }\r\n format.xml { head :ok }\r\n format.json { head :ok }\r\n else\r\n format.html { render :action => \"edit\" }\r\n format.xml { render :xml => @session.errors, :status => :unprocessable_entity }\r\n format.json { render :json => @session.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n respond_to do |format|\n if @error_code.update(error_code_params)\n log_action('Update', current_user ? current_user.username : 'Anonymous', params[:id], 'Error Code')\n format.html { redirect_to @error_code, notice: 'Error code was successfully updated.' }\n format.json { render :show, status: :ok, location: @error_code }\n else\n format.html { render :edit }\n format.json { render json: @error_code.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @exercise_session.update(exercise_session_params)\n format.html { redirect_to @exercise_session, notice: 'Exercise session was successfully updated.' }\n format.json { render :show, status: :ok, location: @exercise_session }\n else\n format.html { render :edit }\n format.json { render json: @exercise_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @sessions = SessionEvent.find(params[:id])\n if @sessions.update_attributes(session_event_params)\n flash[:success] = \"Your session has been updated\"\n redirect_to @sessions\n end\n respond_to do |format|\n if @session_event.update(session_event_params)\n format.html { redirect_to @session_event, notice: 'Session event was successfully updated.' }\n format.json { render :show, status: :ok, location: @session_event }\n else\n format.html { render :edit }\n format.json { render json: @session_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @yoga_session = YogaSession.find(params[:id])\n\n respond_to do |format|\n if @yoga_session.update_attributes(params[:yoga_session])\n format.html { redirect_to @yoga_session, notice: 'Yoga session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @yoga_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @scenario.update(scenario_params)\n \trender json: @scenario\n else\n \trender json: {status: 'ERROR', data: @scenario.errors}\n end\n end",
"def set_error(error)\n slim(:error, locals:{message:error})\n session[:time] = Time.now.to_i\nend",
"def update\n @ykt_session = YktSession.find(params[:id])\n\n respond_to do |format|\n if @ykt_session.update_attributes(params[:ykt_session])\n format.html { redirect_to @ykt_session, notice: 'Ykt session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ykt_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def verify_session\n render status: 200, json: {error: false}\n end",
"def failure(oid, request, session)\n unauthorized\n end",
"def update\n @study_session = StudySession.find(params[:study_session])\n\n respond_to do |format|\n if @study_session.update_attributes(params[:study_session])\n format.html { redirect_to [@study_session.course, @study_session], notice: 'Study session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @study_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @session_login.update(session_login_params)\n format.html { redirect_to @session_login, notice: \"Session login was successfully updated.\" }\n format.json { render :show, status: :ok, location: @session_login }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @session_login.errors, status: :unprocessable_entity }\n end\n end\n end",
"def get_error()\n error = session[:message]\n session.destroy \n return error\n end",
"def update\n respond_to do |format|\n if @otg_sess.update(otg_sess_params)\n format.html { redirect_to @otg_sess, notice: 'Otg sess was successfully updated.' }\n format.json { render :show, status: :ok, location: @otg_sess }\n else\n format.html { render :edit }\n format.json { render json: @otg_sess.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tsession.update(tsession_params)\n format.html { redirect_to @tsession, notice: 'Tsession was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tsession.errors, status: :unprocessable_entity }\n end\n end\n end",
"def session_error\n\tflash[:error] = \"Authentication Error\"\n\tputs flash[:error]\n\tredirect_to URI(request.referer).path\nend",
"def update\n respond_to do |format|\n if @game_session.update(game_session_params)\n format.html { redirect_to @game_session, notice: 'Game session was successfully updated.' }\n format.json { render :show, status: :ok, location: @game_session }\n else\n format.html { render :edit }\n format.json { render json: @game_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @user_session.update(user_session_params)\n format.html { redirect_to @user_session, notice: 'User session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def cancel\n set_session\n\n if @session.cancel\n respond_to do |format|\n format.html { redirect_back allow_other_host: false, fallback_location: batch_connect_sessions_url, notice: t(\"dashboard.batch_connect_sessions_status_blurb_cancel_success\") }\n format.json { head :no_content }\n end\n else\n respond_to do |format|\n format.html { redirect_back allow_other_host: false, fallback_location: batch_connect_sessions_url, alert: t(\"dashboard.batch_connect_sessions_status_blurb_cancel_failure\") }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tutoring_session = TutoringSession.find(params[:id])\n\n respond_to do |format|\n if @tutoring_session.update_attributes(params[:tutoring_session])\n format.html { redirect_to @tutoring_session, notice: 'Tutoring session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tutoring_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n render status: 501, json: { errors: ['Action not implemented yet!'] }\n end",
"def update_bgp_session_with_http_info(id, default_route, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BGPApi.update_bgp_session ...'\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling BGPApi.update_bgp_session\"\n end\n # verify the required parameter 'default_route' is set\n if @api_client.config.client_side_validation && default_route.nil?\n fail ArgumentError, \"Missing the required parameter 'default_route' when calling BGPApi.update_bgp_session\"\n end\n # resource path\n local_var_path = '/bgp/sessions/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(default_route)\n\n # return_type\n return_type = opts[:debug_return_type]\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['x_auth_token']\n\n new_options = opts.merge(\n :operation => :\"BGPApi.update_bgp_session\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BGPApi#update_bgp_session\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def delete_session_with_http_info(account_id, session_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SessionsApi.delete_session ...'\n end\n # verify the required parameter 'account_id' is set\n if @api_client.config.client_side_validation && account_id.nil?\n fail ArgumentError, \"Missing the required parameter 'account_id' when calling SessionsApi.delete_session\"\n end\n # verify the required parameter 'session_id' is set\n if @api_client.config.client_side_validation && session_id.nil?\n fail ArgumentError, \"Missing the required parameter 'session_id' when calling SessionsApi.delete_session\"\n end\n # resource path\n local_var_path = '/accounts/{accountId}/sessions/{sessionId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type]\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['httpBasic']\n\n new_options = opts.merge(\n :operation => :\"SessionsApi.delete_session\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SessionsApi#delete_session\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def auth_failure\n logger.warn \"[SESS] auth failure: #{params[:message]}\"\n redirect_to new_session_path\n end",
"def update\n return if Settings.readonly \n\n respond_to do |format|\n if @session.update(session_params)\n format.html { redirect_to sessions_url, notice: 'Session was successfully updated.' }\n format.json { render :show, status: :ok, location: @session }\n else\n format.html { render :edit }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @polling_session = PollingSession.find(params[:id])\n\n respond_to do |format|\n if @polling_session.update_attributes(params[:polling_session])\n format.html { redirect_to @polling_session, notice: 'Polling session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @polling_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def handle_invalid_session_id\n do_nothing\n end",
"def update\n respond_to do |format|\n if @sevone_session.update(sevone_session_params)\n format.html { redirect_to @sevone_session, notice: 'Sevone session was successfully updated.' }\n format.json { render :show, status: :ok, location: @sevone_session }\n else\n format.html { render :edit }\n format.json { render json: @sevone_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @discovery_session = DiscoverySession.find(params[:id])\n\n respond_to do |format|\n if @discovery_session.update_attributes(params[:discovery_session])\n format.html { redirect_to @discovery_session, notice: 'Discovery session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @discovery_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @analysis_session.update(analysis_session_params)\n format.html { redirect_to @qa_session, notice: 'Analysis session was successfully updated.' }\n format.json { render :show, status: :ok, location: @analysis_session }\n else\n format.html { render :edit }\n format.json { render json: @analysis_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def reset_session_clock\n render json: { status: 'ok' }\n end",
"def update\n head :unauthorized\n end",
"def update\n @session = Session.find(params[:id])\n authorize @session\n @session.update(session_params)\n redirect_to trainings_path\n end",
"def update\n respond_to do |format|\n if @lift_session.update(lift_session_params)\n format.html { redirect_to @lift_session, notice: 'Lift session was successfully updated.' }\n format.json { render :show, status: :ok, location: @lift_session }\n else\n format.html { render :edit }\n format.json { render json: @lift_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n set_session\n\n if @session.destroy\n respond_to do |format|\n format.html { redirect_back allow_other_host: false, fallback_location: batch_connect_sessions_url, notice: t(\"dashboard.batch_connect_sessions_status_blurb_delete_success\") }\n format.json { head :no_content }\n end\n else\n respond_to do |format|\n format.html { redirect_back allow_other_host: false, fallback_location: batch_connect_sessions_url, alert: t(\"dashboard.batch_connect_sessions_status_blurb_delete_failure\") }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def session_expired\n render :template => 'components/session_expired', :layout => 'application', :status => 400\n true\n end",
"def destroy_session2_id\n url = \"https://208.65.111.144/rest/Session/logout/{'session_id':'#{get_session2}'}\"\n begin\n apiRequest(url)\n rescue Restclient::InternalServerError => e\n error_message = e.response[e.response.index('faultstring')+14..-3]\n if error_message != \"Session id is expired or doesn't exist\"\n puts \"Something went wrong trying to logout\"\n end\n end\n @@session_id = nil\n end",
"def update_session_key\n @parameters['sessionKey'] = get_session_key\n end",
"def call\n # Can not be both unrecognised and incorrect\n session[SESSION_KEY] = session[SESSION_KEY].except('unrecognised')\n add_fields(incorrect: true)\n end",
"def update\n @training_session = TrainingSession.find(params[:id])\n\n respond_to do |format|\n if @training_session.update_attributes(params[:training_session])\n format.html { redirect_to @training_session, notice: 'Training session was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @training_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def failure\n redirect_to new_user_session_path, alert: \"無法取得認證!\"\n end",
"def set_flash_failure(msg)\n session[:flash] = [false, msg]\n end",
"def update\n @session_type = SessionType.find(params[:id])\n\n respond_to do |format|\n if @session_type.update_attributes(params[:session_type])\n format.html { redirect_to @session_type, notice: 'Session type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @session_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\t\trespond_to do |format|\n\t\t\tif @class_session.update(class_session_params)\n\t\t\t\tformat.html { redirect_to @class_session, notice: 'Class session was successfully updated.' }\n\t\t\t\tformat.json { head :no_content }\n\t\t\telse\n\t\t\t\tformat.html { render action: 'edit' }\n\t\t\t\tformat.json { render json: @class_session.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def update\n respond_to do |format|\n if @qa_session_file.update(qa_session_file_params)\n format.html { redirect_to @qa_session_file, notice: 'qa_session file was successfully updated.' }\n format.json { render :show, status: :ok, location: @qa_session_file }\n else\n format.html { render :edit }\n format.json { render json: @qa_session_file.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @session_info = SessionInfo.first\n\n respond_to do |format|\n if @session_info.update_attributes(params[:session_info])\n format.html { redirect_to session_information_path, notice: 'Session Info was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @session_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def error\n expires_in 1.month, public: true\n set_metadata({ 'title' => translate('errors.error') })\n render status: request.env['PATH_INFO'][1, 3].to_i\n end",
"def error\n expires_in 1.month, public: true\n set_metadata({ 'title' => translate('errors.error') })\n render status: request.env['PATH_INFO'][1, 3].to_i\n end",
"def session(session_id)\n @session_id = session_id\n end",
"def postQueueError( queue_id, error)\n params = Hash.new\n params['queue_id'] = queue_id\n params['error'] = error\n return doCurl(\"post\",\"/queue/error\",params)\n end",
"def invalid_login_attempt\n \n set_flash_message(:alert, :invalid)\n data = {:code => \"NOK\"}\n render json: data \n # render json: flash[:alert], status: 401\n end",
"def update\n @pool_session = PoolSession.find(params[:id])\n if @pool_session.player1 == @pool_session.player2\n flash[:error] = \"You must specifify 2 separate players in a session\"\n render :action => \"edit\" \n else\n respond_to do |format|\n if @pool_session.update_attributes(params[:session])\n update_player_scores\n format.html { redirect_to(@pool_session, :notice => 'Session was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @pool_session.errors, :status => :unprocessable_entity }\n end\n end\n end\n end",
"def disable_my_session_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FrontendApi.disable_my_session ...'\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling FrontendApi.disable_my_session\"\n end\n # resource path\n local_var_path = '/sessions/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'X-Session-Token'] = opts[:'x_session_token'] if !opts[:'x_session_token'].nil?\n header_params[:'Cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type]\n\n # auth_names\n auth_names = opts[:debug_auth_names] || []\n\n new_options = opts.merge(\n :operation => :\"FrontendApi.disable_my_session\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: FrontendApi#disable_my_session\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def invalid_login_attempt\n set_flash_message(:error, :invalid)\n render json: flash[:error], status: 401\n end",
"def not_authorized(exception)\n if exception.backtrace[1].end_with?(\"save'\")\n render json: {error: \"Sorry, you are not authorized to perform this action. Did the session expire?\"}\n else\n super()\n end\n end",
"def update\n respond_to do |format|\n if @guest_session_association.update(guest_session_association_params)\n format.html { redirect_to @guest_session_association, notice: 'Guest session association was successfully updated.' }\n format.json { render :show, status: :ok, location: @guest_session_association }\n else\n format.html { render :edit }\n format.json { render json: @guest_session_association.errors, status: :unprocessable_entity }\n end\n end\n end",
"def error!(status, message)\n response.status = status\n response[\"Content-Type\"] = \"application/json\"\n response.write({error: message}.to_json)\n request.halt\n end",
"def failure\n return render json: {:message => \"Login Failed\" }, :status => :bad_request\n end",
"def failure\n msg_returned = request.params['message']\n login_failed msg_returned.nil? ? 'Auth0 login failed.' : msg_returned\n end",
"def write_session(env, sid, session, options); end",
"def update\n respond_to do |format|\n if @subject_session.update(subject_session_params)\n format.html { redirect_to @subject_session, notice: 'Subject session was successfully updated.' }\n format.json { render :show, status: :ok, location: @subject_session }\n else\n format.html { render :edit }\n format.json { render json: @subject_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def _error(message,code) \n status code\n response.headers['Content-Type'] = 'application/json'\n body({:error=>{:message=>message}}.to_json)\n end",
"def set_session(env, sid, session, options)\n raise '#set_session not implemented.'\n end",
"def error_update(err)\n session[\"errorSubject\"] = err\n session[:oldAll] = params[:subject]\n redirect_to subject_path(@subject, :q => @q)\n end",
"def update\n respond_to do |format|\n if @training_session.update(training_session_params)\n format.html { redirect_to @training_session, notice: 'Training session was successfully updated.' }\n format.json { render :show, status: :ok, location: @training_session }\n else\n format.html { render :edit }\n format.json { render json: @training_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def connectSession\n # not having valid device id or session number or device type. \n if (params.has_key?(:session_id) == false || params[:session_id].empty? ||\n params.has_key?(:did) == false || params[:did].empty? || \n params.has_key?(:dtype) == false || params[:dtype].empty? ||\n params.has_key?(:experiment_id) == false || params[:experiment_id].empty? ||\n (@experiment = UteExperiment.where(:experiment_code => params[:experiment_id]).first) == nil ||\n (@deviceType = DeviceType.where(name: params[:dtype]).first) == nil ||\n (@session = @experiment.ute_ex_sessions.where(:session_code => params[:session_id], :is_active => true).first) == nil)\n respond_to do |format|\n format.html { render text: 'Unauthorized', :status => :unauthorized }\n format.json { \n render :json => [], :status => :unauthorized \n }\n end\n return\n end\n\n @deviceId = params[:did]\n @sessionconnection = @session.ute_ex_session_connections.where(:device_id => @deviceId, :device_type => @deviceType.id).first\n if(@sessionconnection == nil)\n @sessionconnection = @session.ute_ex_session_connections.create(device_id: @deviceId, device_model: params[\"model\"], device_type: @deviceType.id, is_active: true, connected_at: Time.now.getutc.to_f);\n else\n @sessionconnection.is_active = true\n @sessionconnection.connected_at = Time.now.getutc.to_f\n @sessionconnection.save!\n end\n \n #torender = { \n # 'status' => 'OK',\n # 'created_at' => @session.created_at.to_time.to_f,\n # 'settings' => {\n # 'version' => 1.0,\n # 'maximumRecordingDuration' => 0,\n # 'sensors' => [\n # { :name => 'accelerometer', :freq => 50 },\n # { :name => 'magnetometer', :freq => 50 },\n # { :name => 'gyroscope', :freq => 50 },\n # { :name => 'gps', :freq => 1 }\n # ],\n # 'label' => {\n # 'type' => 'interval',\n # 'schema' => [\n # { 'set' => [ 'standing', 'sitting', 'walking', 'running' ], 'is_nullable' => true, 'only_can_select_one' => true }\n # ]\n # }\n # }\n # }.to_json \n torender = { \n 'status' => 'OK',\n 'created_at' => @sessionconnection.connected_at,\n 'settings' => @experiment.read_attribute(:settings)\n }.to_json \n respond_to do |format|\n format.html { render text: 'Session Status: Connected<br/>' + torender }\n format.json { \n render json: torender\n }\n end\n end",
"def update\n @interview_session = InterviewSession.find(params[:id])\n\n respond_to do |format|\n if @interview_session.update_attributes(params[:interview_session])\n format.html { redirect_to(@interview_session, :notice => 'Interview session was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @interview_session.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def failure\n flash[:error] = \"There was a problem authenticating your PIV.\" # params.permit(:message)[:message] is not helpful UX\n redirect_to url_for_sso_host(\"/login\")\n end",
"def update\n @barcamp_session = BarcampSession.find(params[:id])\n\n respond_to do |format|\n if @barcamp_session.update_attributes(params[:barcamp_session])\n format.html { redirect_to(@barcamp_session, :notice => 'Barcamp session was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @barcamp_session.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @class_session.update(class_session_params)\n format.html { redirect_to @class_session, notice: 'Class session was successfully updated.' }\n format.json { render :show, status: :ok, location: @class_session }\n else\n format.html { render :edit }\n format.json { render json: @class_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @class_session.update(class_session_params)\n format.html { redirect_to @class_session, notice: 'Class session was successfully updated.' }\n format.json { render :show, status: :ok, location: @class_session }\n else\n format.html { render :edit }\n format.json { render json: @class_session.errors, status: :unprocessable_entity }\n end\n end\n end",
"def client_error_status_code\n _undefined\n end"
] | [
"0.64133257",
"0.6306385",
"0.60378754",
"0.6013301",
"0.5861529",
"0.5861529",
"0.5860904",
"0.5860102",
"0.57726437",
"0.5761166",
"0.57418865",
"0.57270175",
"0.57232255",
"0.5702644",
"0.56772065",
"0.56475776",
"0.5637619",
"0.5624029",
"0.5623909",
"0.5598913",
"0.555303",
"0.5546285",
"0.55177325",
"0.55177325",
"0.55177325",
"0.55177325",
"0.55172145",
"0.54415363",
"0.5411932",
"0.5368314",
"0.53627884",
"0.53401655",
"0.5336799",
"0.5334885",
"0.5320159",
"0.53047097",
"0.5303964",
"0.5298608",
"0.52926344",
"0.5279035",
"0.52722996",
"0.5270188",
"0.5248634",
"0.523793",
"0.5237448",
"0.52366936",
"0.52324396",
"0.5217436",
"0.5205273",
"0.52035695",
"0.51918334",
"0.51872724",
"0.51562333",
"0.5153141",
"0.5151045",
"0.5147576",
"0.5140818",
"0.5130799",
"0.51253307",
"0.511305",
"0.51051813",
"0.5103808",
"0.5097216",
"0.507416",
"0.5070252",
"0.50570667",
"0.5051074",
"0.5043146",
"0.5042399",
"0.50326496",
"0.50243473",
"0.5012092",
"0.5009931",
"0.50086105",
"0.5006605",
"0.50064534",
"0.5000601",
"0.49967873",
"0.49944606",
"0.49905652",
"0.49896982",
"0.49859774",
"0.49771574",
"0.4975819",
"0.49750775",
"0.4969767",
"0.49686685",
"0.49650756",
"0.49623305",
"0.49598607",
"0.49580956",
"0.49551913",
"0.49551296",
"0.49550676",
"0.49542063",
"0.4946975",
"0.49440542",
"0.49420494",
"0.49420494",
"0.49350467"
] | 0.7079413 | 0 |
:reek:DuplicateMethodCall rubocop:disable Style/StringLiterals, Metrics/LineLength, Rails/OutputSafety | def sp_msg(section, args = {})
args = args.merge(sp_name: sp_name)
args = args.merge(sp_create_link: sp_create_link)
return t("service_providers.#{sp_alert_name}.#{section}", args).html_safe if sp.friendly_name == "The FMCSA Drug & Alcohol Clearinghouse" && custom_alert?
return t("service_providers.#{sp_alert_name}.#{section}", args) if custom_alert?
t("service_providers.default.#{section}", args)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def string()\n #This is a stub, used for indexing\n end",
"def as_you_like_it_quote; end",
"def private_method\n end",
"def string?; end",
"def to_s\n raise StandardError, \"#{self.class.name}#to_s accessed, must be redefined.\"\n end",
"def string() end",
"def string; end",
"def string; end",
"def string; end",
"def string; end",
"def string; end",
"def string; end",
"def string; end",
"def string; end",
"def string; end",
"def string\n end",
"def string\n end",
"def string\n end",
"def to_s # Now it dosen't throw the object code #can I have 2 definition of same method like default and the defined one\n \"Song: #@name #@artist (#@duration)\" #[#@lyrics]\"\n end",
"def funky_method\n \"#{self.id} #{self.title}\"\n end",
"def str; end",
"def str; end",
"def name_safe?; end",
"def to_s\n raise 'To be implemented in child classes'\n end",
"def to_s()\n #This is a stub, used for indexing\n end",
"def to_s()\n #This is a stub, used for indexing\n end",
"def to_s()\n #This is a stub, used for indexing\n end",
"def some_method\n \"some_method2\"\n end",
"def strings; end",
"def to_s\n super\n end",
"def formation; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def stringOutput\n\t\tend",
"def stringOutput\n\t\tend",
"def to_s\n raise NotImplementedError.new(\"#{self.class}#to_s\")\n end",
"def to_s\n\t\tsuper\n\tend",
"def old_method\n \"old improved method\"\nend",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def custom; end",
"def custom; end",
"def method_one\n end",
"def method_one\n end",
"def to_s\n super\n end",
"def schubert; end",
"def method_one; end",
"def string(*) end",
"def to_s\n raise NotImplementedError\n end",
"def writethis; end",
"def to_s\n return super\n end",
"def to_s\n raise NotImplementedError\n end",
"def text(*)\n super\n end",
"def to_s()\n #This is a stub, used for indexing\n end",
"def romeo_and_juliet_quote; end",
"def ignore_method_conflicts; end",
"def herebody_s; end",
"def probers; end",
"def implementation; end",
"def implementation; end",
"def refutal()\n end",
"def raw; end",
"def raw; end",
"def raw; end",
"def raw; end",
"def culprit\n @culprit\n end",
"def to_s\n\t\t\t@to_s_sym ? self.__send__(@to_s_sym) : super\n\t\tend",
"def export\n super.to_s\n end",
"def beautify; end",
"def beautify; end",
"def to_s; nil; end",
"def export\n super || ''\n end",
"def to_s\n raise NotImplementedError\n end",
"def to_s\n self.name.to_s || super\n end",
"def string\n @string\n end",
"def string\n @string\n end",
"def sonido()\n return super << \" miaaauuu\"\n end",
"def to_s\n\t\traise \"to_s: Not Implemented\"\n\tend",
"def compilereturn\n\n end",
"def str2; end"
] | [
"0.63121074",
"0.5843608",
"0.5812137",
"0.5678669",
"0.5661342",
"0.5610322",
"0.5600049",
"0.5575512",
"0.5575512",
"0.5575512",
"0.5575512",
"0.5575512",
"0.5575512",
"0.5575512",
"0.5575512",
"0.5575512",
"0.5569264",
"0.5569264",
"0.5569264",
"0.5546131",
"0.55445075",
"0.55403024",
"0.55403024",
"0.55309063",
"0.54852265",
"0.5451287",
"0.5451287",
"0.5451287",
"0.544614",
"0.5434913",
"0.54173636",
"0.5412165",
"0.5388096",
"0.5388096",
"0.5388096",
"0.5388096",
"0.5388096",
"0.5388096",
"0.5388096",
"0.5388096",
"0.5388096",
"0.5388096",
"0.5388096",
"0.5388096",
"0.53827906",
"0.53827906",
"0.53728855",
"0.53694665",
"0.5355407",
"0.535528",
"0.535528",
"0.535528",
"0.535528",
"0.535528",
"0.535528",
"0.535528",
"0.535528",
"0.535528",
"0.535528",
"0.535528",
"0.535528",
"0.5346754",
"0.5346754",
"0.5336216",
"0.5336216",
"0.5328689",
"0.5319722",
"0.52836996",
"0.52787226",
"0.52783734",
"0.5273809",
"0.5261073",
"0.5256133",
"0.52492636",
"0.5245639",
"0.5240087",
"0.52332073",
"0.52190286",
"0.5219013",
"0.5217595",
"0.5217595",
"0.52166134",
"0.5216027",
"0.5216027",
"0.5216027",
"0.5216027",
"0.5203164",
"0.51938367",
"0.5182594",
"0.51811767",
"0.51811767",
"0.51774424",
"0.5174658",
"0.51742667",
"0.517287",
"0.51697165",
"0.51697165",
"0.51642734",
"0.5152171",
"0.5149234",
"0.51489127"
] | 0.0 | -1 |
rubocop:enable Style/StringLiterals, Metrics/LineLength, Rails/OutputSafety | def sp_logo
sp.logo || DEFAULT_LOGO
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def string() end",
"def string?; end",
"def str; end",
"def str; end",
"def string()\n #This is a stub, used for indexing\n end",
"def string; end",
"def string; end",
"def string; end",
"def string; end",
"def string; end",
"def string; end",
"def string; end",
"def string; end",
"def string; end",
"def quoted_string; end",
"def strings; end",
"def input_string; end",
"def str2; end",
"def str2; end",
"def stringOutput\n\t\tend",
"def stringOutput\n\t\tend",
"def str1; end",
"def str1; end",
"def frozen_string_literal?; end",
"def String(p0) end",
"def string\n end",
"def string\n end",
"def string\n end",
"def string(*) end",
"def string\n @string\n end",
"def string\n @string\n end",
"def long_string\n \"#{name}\"\n end",
"def str3; end",
"def str3; end",
"def string=(code); end",
"def str(str); end",
"def str(str); end",
"def string=(_arg0); end",
"def safe_str\n \"\".html_safe # rubocop:disable Rails/OutputSafety # It's an empty string!\n end",
"def as_you_like_it_quote; end",
"def content=(string); end",
"def content=(string); end",
"def get_string_value\n\t\tend",
"def string(str); end",
"def beautify; end",
"def beautify; end",
"def final\n \"\"\n end",
"def encode_string_ex; end",
"def value\n #BaseData::PlainString.clean_value(self.strings.map(&:value).join)\n string = self.strings.map(&:value).join\n #string.metaclass.instance_eval do\n def string.clean_value\n BaseData::String.clean_value(self)\n end\n #end\n #debugger\n string\n end",
"def final\n \"\"\n end",
"def literalize(name); end",
"def romeo_and_juliet_quote; end",
"def use string\n @use = string.gsub(/^\\s*\\n/, '').gsub(/\\n\\s*$/, '')\nend",
"def possessify\n return \"#{self}'\" if self =~ /s$/\n return \"#{self}'s\"\n end",
"def frozen_string_literal; end",
"def frozen_string_literal; end",
"def processed_content\n self.to_s.letters.downcase\n end",
"def text(str); end",
"def hipsterfy(string)\r\n\r\nend",
"def name_safe?; end",
"def string= string\n #This is a stub, used for indexing\n end",
"def str1\n 'from string'\nend",
"def string_value\n join(\"\\0\")\n end",
"def string=(p0) end",
"def two_word_name; end",
"def to_str() end",
"def to_str() end",
"def to_s()\n #This is a stub, used for indexing\n end",
"def to_s()\n #This is a stub, used for indexing\n end",
"def to_s()\n #This is a stub, used for indexing\n end",
"def get_string(attr); end",
"def extract_frozen_string_literal; end",
"def herebody_s; end",
"def processed_content\n self.to_s.downcase.gsub(/[^a-z0-9]/, \"\")\n end",
"def report\n <<-STRINGSTRINGSTRING\nName: #{@name}\nAge: #{@age}\nAlive: #{@alive}\nSTRINGSTRINGSTRING\n end",
"def wookie_sentence; end",
"def to_s # {{{\n c = wrap( self.content.to_s.chomp )\n t = wrap( self.title.to_s.chomp )\n\n<<EOS\n|^\\___________________ [ #{self.source.to_s } ] _________________________________/^|\n\n\\t'#{t}'\n\n\\t#{c}\n\n|/^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\|\n\nEOS\n end",
"def to_str; end",
"def to_str; end",
"def to_str; end",
"def to_str; end",
"def to_str; end",
"def to_str; end",
"def to_str; end",
"def to_str; end",
"def to_str; end",
"def my_string\n'Hello World'\nend",
"def process\n @string\n end",
"def concat(string); end",
"def text\n other_phrased\n end",
"def _string\n\n _save = self.pos\n while true # choice\n _tmp = apply(:_dbl_string)\n break if _tmp\n self.pos = _save\n _tmp = apply(:_sgl_string)\n break if _tmp\n self.pos = _save\n break\n end # end choice\n\n set_failed_rule :_string unless _tmp\n return _tmp\n end",
"def printed_code\n self.code.gsub('/','-')\n end",
"def printed_code\n self.code.gsub('/','-')\n end",
"def carets(str)\n \"<#{str.to_s}>\"\n end",
"def to_s\n nil? ? '' : super\n end",
"def uglify\n self.gsub(' ', '_').downcase\n end",
"def compact_string\n s = [ATTRIBUTES.sort.collect{|a| send(a)}].join(\"|\").downcase.gsub(/\\s/, '')\n end",
"def text(string); end",
"def text(string); end",
"def frozen_string_literal_specified?; end",
"def processed_content\n self.to_s.downcase\n end"
] | [
"0.63708454",
"0.6247293",
"0.61979115",
"0.61979115",
"0.6178588",
"0.6156243",
"0.6156243",
"0.6156243",
"0.6156243",
"0.6156243",
"0.6156243",
"0.6156243",
"0.6156243",
"0.6156243",
"0.6078768",
"0.60410863",
"0.60108125",
"0.59613734",
"0.59613734",
"0.5927105",
"0.5927105",
"0.5890447",
"0.5890447",
"0.5882064",
"0.5869311",
"0.58662754",
"0.58662754",
"0.58662754",
"0.5865557",
"0.5815004",
"0.5815004",
"0.57866615",
"0.5783461",
"0.5783461",
"0.57453436",
"0.57290196",
"0.57290196",
"0.5721287",
"0.5711945",
"0.5709589",
"0.56431407",
"0.56431407",
"0.5624335",
"0.56223077",
"0.5610388",
"0.5610388",
"0.55888385",
"0.55848294",
"0.55816513",
"0.55804676",
"0.5577823",
"0.5577409",
"0.55605894",
"0.5538209",
"0.5532953",
"0.5532953",
"0.5524611",
"0.5515813",
"0.5487117",
"0.5463318",
"0.5438504",
"0.5436638",
"0.5429323",
"0.5408847",
"0.5387857",
"0.53865635",
"0.53865635",
"0.5372123",
"0.5372123",
"0.5372123",
"0.53679115",
"0.5352475",
"0.53389066",
"0.53270656",
"0.53099656",
"0.53009754",
"0.5300608",
"0.52921426",
"0.52921426",
"0.52921426",
"0.52921426",
"0.52921426",
"0.52921426",
"0.52921426",
"0.52921426",
"0.52921426",
"0.5280373",
"0.5278606",
"0.5276792",
"0.5273578",
"0.527187",
"0.526978",
"0.526978",
"0.52688986",
"0.5268563",
"0.52668005",
"0.5266274",
"0.5265795",
"0.5265795",
"0.52624506",
"0.526219"
] | 0.0 | -1 |
overriding to allow action on an on_hold task | def actions_available?(user)
actions_allowable?(user)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hold\n action('hold')\n end",
"def held(&block)\n @hold_callback = block\n end",
"def do_hold(last_check)\n if last_check.off?\n # If the status report says the Equipment is offline, try\n # resending the Task. If that doesn't work, fail and punt to the launcher.\n hold_failure! unless send_to_rhizome\n end\n end",
"def enter_pending; end",
"def block_if_on_hold\n raise \"Account is currently on hold. Messaging is disabled.\" if current_account.on_hold?\n end",
"def hold(job = ALL_JOBS)\n DRMAA.control(job, DRMAA::ACTION_HOLD)\n end",
"def hold(job = ALL_JOBS)\n DRMAA.control(job, DRMAA::ACTION_HOLD)\n end",
"def put_distribution_task_on_hold(appeal, appeal_type)\n distribution_task = DistributionTask.find_by(appeal_id: appeal.id, appeal_type: appeal_type)\n distribution_task.update!(status: \"on_hold\", placed_on_hold_at: Time.zone.now)\n distribution_task\n end",
"def cascade_closure_from_child_task?(child_task)\n return true if child_task&.type == TimedHoldTask.name\n\n super\n end",
"def wakeup() end",
"def choice_a_hold\n item_id = @item_list[@index]\n return action_b if item_id.nil?\n return play_buzzer_se if item_id == 0 || !GameData::Item[item_id].holdable\n\n play_decision_se\n @running = false\n @return_data = @item_list[@index]\n end",
"def wakeup; end",
"def performed?; end",
"def performed?; end",
"def on_hold?\n status == :inactive\n end",
"def on_task_complete(task)\n end",
"def busy?; end",
"def on_taken &block\n\t\t\t@on_taken = block\n\t\tend",
"def unmarked_mission(task)\n\t\tsuper if defined? super\n\t\treturn unless task.distribute? && task.self_owned?\n\n\t\tunless Distributed.updating?(self) || Distributed.updating?(task)\n\t\t Distributed.each_updated_peer(self, task) do |peer|\n\t\t\tpeer.transmit(:plan_set_mission, self, task, false)\n\t\t end\n\t\tend\n\t end",
"def on_busy(reason)\n end",
"def unreachable_event(event)\n delayed_events.delete_if { |_, _, _, signalled, _| signalled == event }\n super if defined? super\n end",
"def task\n end",
"def on_hold\n jobs_index(Job.on_hold)\n end",
"def actions_available?(user)\n return false if status == Constants.TASK_STATUSES.on_hold && !on_timed_hold?\n\n actions_allowable?(user)\n end",
"def take_off!\n\t\t@flying = true\n\t\tself\n\tend",
"def on_leave\n @_entered = false\n super\n end",
"def cancel_hold\n if self.status == 'Held'\n create_delivery('HoldCancelled', :details => \"The hold on this message has been removed without action.\")\n end\n end",
"def on_timeout\n trigger\n @active = false\n end",
"def handler(value)\n if value.zero?\n @up_callback.call if @up_callback\n else\n @last_press = Time.now\n @down_callback.call if @down_callback\n end\n\n if value.zero? && (Time.now - @last_press) > @hold_time\n @hold_callback.call if @hold_callback\n end\n end",
"def on_task_ready(task)\n end",
"def idle?; end",
"def take_it_for_a_spin\n @ktt_disabled = true\n end",
"def fired(event) # :nodoc:\n super\n task.fired_event(event)\n end",
"def fired(event) # :nodoc:\n super\n task.fired_event(event)\n end",
"def cancel_hold\n if self.status == 'Held'\n create_delivery('HoldCancelled', :details => \"The hold on this validation has been removed without action.\")\n end\n end",
"def behold_nothing_happens!\n behold! {}\n end",
"def poll(_) end",
"def xpending(key, group, *args, idle: T.unsafe(nil)); end",
"def default_do_task(task, times)\n self.village.increment_resources!(task, times)\n end",
"def lock_expired?; end",
"def doge_control_signal\r\n end",
"def cancel_enabled?; handle?(:cancel); end",
"def wait_hold_action(external_user, service_id, role_name, nodes)\n Log.info LOG_COMP, \"Waiting #{nodes} to be (HOLD, LCM_INIT)\"\n wait(nodes, 'HOLD', 'LCM_INIT')\n\n @lcm.trigger_action(:hold_cb,\n service_id,\n external_user,\n service_id,\n role_name)\n end",
"def alaram_operation action\n @state = action\n notify\nend",
"def fired(event) # :nodoc:\n super if defined? super\n task.fired_event(event)\n end",
"def unlock\n end",
"def release_actions; end",
"def touch_ended(touch); end",
"def notify_when_off_sick=(arg)\n @notify_when_off_sick = (arg ? true : false)\n end",
"def post_task\n end",
"def pending?; end",
"def onPause\n super\n end",
"def held?\n status == 'Held'\n end",
"def held?\n status == 'Held'\n end",
"def interrupt?; end",
"def wakeup()\n # don't wake if the task is currently processing\n @loop.wakeup() unless @loop.nil?\n end",
"def mask_as_done!\n @completed = true\n end",
"def isolate_from_interrupts; end",
"def resend_unlock_instructions; end",
"def action_b\n play_cancel_se\n @running = false\n end",
"def triggered(id, task) # :nodoc:\n\t task = local_object(task)\n\t Distributed.keep.ref(task)\n\n once do\n begin\n if trigger = triggers[id]\n trigger.last.call(task)\n end\n rescue Exception\n Distributed.warn \"#{self}: trigger handler #{trigger.last} failed with #{$!.full_message}\"\n ensure\n Distributed.keep.deref(task)\n end\n end\n\tend",
"def waiting; end",
"def waiting; end",
"def work\n stat :attempting_lock_on, item_id: object_id\n if @mutex.try_lock\n stat :has_lock_on, item_id: object_id\n chore\n stat :releasing_lock_on, item_id: object_id\n @mutex.unlock\n else\n stat :bailed_on, item_id: object_id\n end\n end",
"def touch_out\n deduct(CHARGE)\n @in_journey = false\n end",
"def blocks_to_hit\n super + (task.variable ? task.variable.checkers : [])\n end",
"def after_redeem() end",
"def place_hold\n request = {\n method: :put,\n url: \"#{endpoint_url(group_id)}/hold\",\n body: body,\n headers: headers,\n query: query,\n }\n\n submit request\n end",
"def off?; !self.on?; end",
"def dead?; end",
"def suspend(view)\n end",
"def set_hold\n @hold = Hold.find(params[:id])\n end",
"def send_unlock_instructions; end",
"def lift\n @mutex.lock\n\n @once ||= true\n\n @condition.broadcast\n ensure\n @mutex.unlock\n end",
"def run_task\n sweep_stairs\n end",
"def run_task\n sweep_stairs\n end",
"def across_pool_state\n super\n end",
"def signal\n end",
"def held?\n status.queued_held?\n end",
"def never\n to_unbound_task_predicate.never\n end",
"def resched\n action('resched')\n end",
"def set_hold\n @hold = Hold.find_by(id: params[:id])\n end",
"def allowed_to_wait_to_clear_pickup?\n true # Currently, transition is always allowed.\n end",
"def event; end",
"def event; end",
"def event; end",
"def on_timeout\n trigger\n reset\n end",
"def on_timeout\n trigger\n reset\n end",
"def on_completion(actor); end",
"def bringToLife\n @dead = false\n end",
"def on_enter\n end",
"def kick\n passive_mutex.synchronize do\n passive_cond.signal\n end\n end",
"def unlock; end",
"def remove_hold\n request = {\n method: :put,\n url: \"#{endpoint_url(group_id)}/unhold\",\n body: body,\n headers: headers,\n query: query,\n }\n\n submit request\n end",
"def signal_queue; end",
"def on_release(&blk)\n opts[:on_release] = blk\n end",
"def unresched\n action('unresched')\n end",
"def dead\n end",
"def checkTrigger\n\t end",
"def disable_until_finished_or_interrupted; end",
"def do_run\n ready\n aim\n fire!\n end"
] | [
"0.7364444",
"0.67987734",
"0.6677081",
"0.6055394",
"0.5993183",
"0.5986212",
"0.59062034",
"0.5881514",
"0.5874519",
"0.58523846",
"0.5814171",
"0.5761196",
"0.573183",
"0.573183",
"0.57186127",
"0.5683897",
"0.56623787",
"0.5642788",
"0.56292844",
"0.5625426",
"0.5608021",
"0.56031215",
"0.55915576",
"0.55677575",
"0.5566562",
"0.5552094",
"0.55256057",
"0.55214185",
"0.5513974",
"0.5496091",
"0.54627335",
"0.54512185",
"0.5443732",
"0.5443732",
"0.54436576",
"0.5426087",
"0.5412569",
"0.54077905",
"0.54077417",
"0.54070085",
"0.54063064",
"0.5399083",
"0.5392626",
"0.539237",
"0.53870183",
"0.53635514",
"0.5346004",
"0.5343352",
"0.53406256",
"0.53038406",
"0.53011334",
"0.5300951",
"0.53004926",
"0.53004926",
"0.52957803",
"0.5277823",
"0.52666545",
"0.5266267",
"0.525847",
"0.525267",
"0.52483606",
"0.5237117",
"0.5237117",
"0.52322763",
"0.5231907",
"0.5227901",
"0.5222795",
"0.52132356",
"0.52083796",
"0.5205402",
"0.520539",
"0.5202367",
"0.51996094",
"0.51895976",
"0.5187225",
"0.5187225",
"0.5186041",
"0.51789564",
"0.51788634",
"0.51729727",
"0.5157503",
"0.5156381",
"0.51519394",
"0.51408976",
"0.51408976",
"0.51408976",
"0.51338714",
"0.5119148",
"0.5118013",
"0.51126415",
"0.510616",
"0.51038414",
"0.509729",
"0.50955886",
"0.50938624",
"0.5093781",
"0.50903904",
"0.50897133",
"0.50880253",
"0.50879097",
"0.50870955"
] | 0.0 | -1 |
ensures this task gets completed when child TimedHoldTask is completed after 30 days | def cascade_closure_from_child_task?(child_task)
return true if child_task&.type == TimedHoldTask.name
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def when_timer_ends\n IhpTasksFactory.new(parent).create_ihp_tasks!\n update!(status: :completed)\n end",
"def on_end_task\n mutex.synchronize do\n @completed_task_count += 1 #if success\n break unless running?\n end\n end",
"def ensure_finished\n ensure_exists!\n unless end_time\n self.end_time = ::Time.now.utc\n @children.each(&:ensure_finished)\n end\n self\n end",
"def on_task_complete(task)\n end",
"def locked?\n finished? && Time.now.utc > finished_at + 30.minutes\n end",
"def perform\n tick(I18n.t('jobs.expire_analysis_tasks.progress_expiring'))\n Datasets::AnalysisTask.destroy_all ['created_at < ?', 2.weeks.ago]\n\n completed\n end",
"def finish\n @time = 0.0\n @trigger.()\n end",
"def do_hold(last_check)\n if last_check.off?\n # If the status report says the Equipment is offline, try\n # resending the Task. If that doesn't work, fail and punt to the launcher.\n hold_failure! unless send_to_rhizome\n end\n end",
"def finalize!\n update_attribute(:completed_at, Time.now)\n end",
"def update_task_if_children_tasks_are_completed\n if type == EducationDocumentSearchTask.name && children.last.completed?\n update!(status: Constants.TASK_STATUSES.completed)\n else\n update!(status: Constants.TASK_STATUSES.assigned)\n end\n end",
"def finish!(timing)\n self._time = timing || 0\n self._child_time = _calculate_child_time\n self._exclusive_time = _calculate_exclusive_time\n end",
"def time_is_up!\n Astute.logger.error \"Puppet agent took too long to run puppet task.\"\\\n \" Mark task as failed. #{task_details_for_log}\"\n self.task_status = 'failed'\n end",
"def complete_children\n if self.category.eql?('todo') and self.completed\n if self.children\n children = self.get_all_children\n children.each do |child|\n if child.completed.blank? or !child.completed\n child.update_attributes(:completed => true, :completed_at => self.completed_at, :zimbra_task_status => true)\n # MatterTask.update_all({:completed => true, :completed_at => self.completed_at}, {:id => child.id})\n end\n end\n end\n end\n end",
"def complete!\n update_attributes(completed_at: Time.now)\n pause! if running?\n end",
"def done?\n @lock.synchronize { @time >= @duration }\n end",
"def complete\n @task.task_completed\n @task.update_completed_at\n redirect_to task_path(@task.id)\n end",
"def lock_expired?; end",
"def completed()\n @completed=true\n @tCompleted=Time.now\n end",
"def check_child_task_end_date\n parent = self.parent if self.category.eql?('todo') && assoc_as == \"1\"\n if !parent.blank? and parent.category.eql?('todo')\n unless self.end_date.blank?\n self.errors.add(' ', 'Child task cannot have end date after parent-tasks end date' ) if self.end_date > parent.end_date\n else \n self.errors.add(' ', 'Child task end date cannot be blank' )\n end\n end\n end",
"def lock_timeout; end",
"def task_timeout?(ttl)\n @tasks.synchronize {\n __task_timeout?(ttl)\n }\n end",
"def on_timeout\n trigger\n @active = false\n end",
"def complete_task # mark_finished_tag_as_complete_by_Owner\n @tasks = Task.find(params[:id])\n @my_id = current_user.id # redundant_6\n # Check that the Task is not owned or currently accepted by current_user\n if @tasks.accepted_by_user_id != @my_id && @tasks.user_id == @my_id\n @tasks.update({ task_status: \"Completed\" })\n @tasks.touch(:task_completed_at)\n # touch a specific datetime_column in rails\n # http://stackoverflow.com/questions/1091311/touch-updated-at-column-in-rails-2-3-2\n # model.touch(:column_name)\n\n redirect_to my_task_path, notice: \"Confirm, TAG Completed :: Sending Payment\"\n # payment sent will initiate Stripe payment system\n # responding html, includ JSON later\n else\n redirect_to my_task_path, notice: 'TAG not marked as Completed, Please try again later'\n end\n end",
"def finalized_task(task)\n\t\tsuper if defined? super\n\t\tPlanModificationHooks.finalized_object(self, task) \n\t end",
"def close task\n update task\n unlock task.id\n end",
"def check_completed\n\t\tend",
"def taskTerminated(notification)\n # Log that we're ending\n puts(\"taskTerminated: #{@task.processIdentifier}\")\n \n # Release the task\n @task.release\n @task = nil\n \n # Output to UI the time summary\n @time_end = Time.now\n @results.textStorage.mutableString.appendString \"End time: #{@time_end.strftime(\"%H:%M:%S\")}\\n\"\n @results.textStorage.mutableString.appendString \"Duration: #{@time_end - @time_start} seconds\\n\"\n @results.textStorage.mutableString.appendString \"Duration: #{(@time_end - @time_start)/60} minutes\\n\"\n\tend",
"def finalized_plan_task(transaction, proxy); end",
"def run_completed\n end",
"def schedule_to_close_timeout; Float::INFINITY; end",
"def private_done?\n @time_source.call > @end_time\n end",
"def end_after_delay\n # this surrenders Thread execution, so Heroku might charge less, \n # time limit is in minutes (so we multiply by 60)\n sleep self.time_limit * 60 \n self.end!\n end",
"def work\n if @busy && @remaining_job_time > 0\n @remaining_job_time -= 1\n end\n end",
"def checking_in_number\n self.days_completed += 1\n self.check_in_current = true\n next_day = self.current_day + 1\n if next_day > self.days_to_complete # For real time feedback\n self.active = false \n self.inactive_cleanup\n end\n self.save\n\n # Since you already checked in, delete reminder to check in again\n sms_reminder_jobs = Delayed::Job.where(:owner_type => \"Micropost\", \n :owner_id => self.id, \n :owner_job_type => \"4 Hour Reminder\"\n )\n sms_reminder_jobs.each do |job|\n job.delete\n end\n end",
"def deliver!\n @delivery_time = Time.new + 30*60\n end",
"def check_timeouts\n if self.outdated?\n Match.transaction do\n self.status = :timeouted\n self.set_looser_winner\n self.save!\n self.update_rank\n end\n self.email_notify_outdated\n end\n end",
"def finished\n fin = Time.now\n @duration ||= calculate_duration(fin)\n fin\n end",
"def incompleted_task\n Notification.incompleted_task\n end",
"def calculate_duration_of(task) ; 5 ; end",
"def done\n completed + dead\n end",
"def on_task_ready(task)\n end",
"def on_timeout\n trigger\n reset\n end",
"def task_timeout?(task_ttl)\n @taskbox.task_timeout?(task_ttl)\n end",
"def waits_too_long?(account)\n is?(:asked) and self.asked <= 4.days.ago.to_date\n end",
"def notify_complete\n @mutex.synchronize do\n @task_running = false\n @task_complete = true\n @token.broadcast\n end\n end",
"def eventually(label, &block)\n current_time = Time.now\n timeout_treshold = current_time + TIMEOUT\n while (block.call == false) && (current_time <= timeout_treshold) do\n sleep 5\n current_time = Time.now\n end\n if (current_time > timeout_treshold)\n fail \"Action '#{label}' did not resolve within timeout: #{TIMEOUT}s\"\n end\nend",
"def perform\n if not self.last_run.nil? and Time.now.utc < self.last_run + self.interval - EXECUTION_TOLERANCE\n logger.warn \"Dropping task '#{self.id}' with last run on #{self.last_run} and interval #{self.interval}\"\n return :dropped\n end\n\n # If it's locked, see if the process is alive\n if !self.locked_tag.nil?\n begin\n Process.kill(0, self.locked_tag.to_i)\n # The process exists, return\n logger.warn \"Dropping task '#{self.id}' with last run on #{self.last_run} and interval #{self.interval}\"\n return :dropped\n rescue Errno::ESRCH => e\n # The process doesn't exist, go on\n end\n end\n\n begin\n self.locked_tag = Process.pid.to_s\n self.last_run = Time.now.utc\n self.save!\n rescue => err\n logger.error \"Could not update last run time for task '#{self.id}': #{err}\"\n return :error_saving\n end\n\n begin\n job = self.get_handler\n job.quota = self.interval / 2 if job.respond_to? :quota=\n result = job.perform || :success\n rescue => err\n logger.error \"Error executing task '#{self.id}': #{err}\"\n return :error_executing\n else\n logger.debug \"Task '#{self.id}' executed successfully\"\n return result\n ensure\n self.locked_tag = nil\n self.save!\n end\n end",
"def child_time_previously_collected?(question)\n answer_for(question, valid_response_exists?(\"PARTICIPANT_VERIF.CHILD_TIME\"))\n end",
"def calc_locked_out_till\n ends_on.since locked_out_duration\n end",
"def complete_termination\n self.deleted_at = Time.now.utc\n self.end_date = Date.today\n end",
"def complete!\n @completed_at = Time.now\n end",
"def complete!\n @completed_at = Time.now\n end",
"def client_tasks_closed\n self.find_all {|e| e.completed }\n end",
"def complete\n # check if an individual rep, complete reps of day if not\n if self.rep_parent.nil?\n self.repititions.\n where(:show_date => Date.current).each do |rep|\n rep.complete\n end\n return\n end\n\n if self.state != Activity::COMPLETE\n self.state = Activity::COMPLETE\n self.completed_date = DateTime.current\n self.save!\n self.rep_parent.count = self.rep_parent.count + 1\n self.rep_parent.save!\n end\n end",
"def lock_timeout_retry_delay; end",
"def wait(timeout = nil)\n synchronize do\n touch\n # TODO interruptions ?\n super timeout if incomplete?\n self\n end\n end",
"def children_time\n self.total_time - self.self_time - self.wait_time\n end",
"def handleTimeout\n\n return unless hastimer?\n\n @timer.keys.each do |timerType|\n\n # This is because @timer can be modified during an iteration\n next if (@timer[timerType].nil? || @timer[timerType].empty?)\n\n if Time.now > (@timer[timerType][\"Started\"] + ACTIONS[timerType][:TIMEOUT])\n\n writeLog(\"Reached timeout of type #{timerType}\")\n\n # close log File.\n if timerType.eql?(\"FINISH_LOG\")\n\n disableTimer(timerType)\n writeLog(\"Zipping log file.\")\n finishLogFile\n next\n end\n\n # we reached a timeout here. Must choose what to do\n # verify if limit has been exceeded\n if @timer[timerType][\"Tries\"] >= ACTIONS[timerType][:LIMIT]\n\n # Limit reached, finish transaction and generate an error. Insert this into LOG\n CFDP::CFDP_Indication(\"Transaction #{@ID} has detected an error. Error is: #{timerType}_LIMIT. Finishing transaction.\")\n writeLog(\"Transaction #{@ID} has detected an error. Error is: #{timerType}_LIMIT. Finishing transaction.\")\n CFDP::HKPacket.instance.updateVar(ACTIONS[timerType][:CONDITION])\n finish(\"FAILED\")\n else\n\n # Limit not reached, reset Timer, re-send things and update transaction\n resetTimer(timerType)\n\n # Verify action\n case timerType\n when \"EOF\", \"FINISHED\"\n\n # Must re-send PDU from that transaction and update limit counter.\n writeLog(\"#{timerType}_LIMIT reached, re-sending PDU\")\n CFDPEngine.instance.insertIntoBuffer(@pdus[timerType])\n @timer[timerType][\"Tries\"]+=1\n when \"NAK\"\n\n # check if my NAK has been responded\n nakPdu = verifyMissingPDU\n\n if nakPdu.nil?\n\n writeLog(\"NAK has been fully responded.\")\n disableTimer(\"NAK\")\n finish_downlink_transaction if haspdueof?\n next\n elsif nakPdu.pack == @pdus[\"NAK\"].pack\n\n writeLog(\"NAK_LIMIT reached, re-sending PDU\")\n @timer[timerType][\"Tries\"]+=1\n else\n\n writeLog(\"NAK partially responded. Generated new NAK #{nakPdu.pack.to_s}.\")\n writeLog(\"Overriding tries of type #{timerType} to 0.\")\n @pdus[\"NAK\"] = nakPdu\n @timer[timerType][\"Tries\"]=0\n end\n\n CFDPEngine.instance.insertIntoBuffer(nakPdu)\n end\n end\n end\n end\n end",
"def timer_ends_at\n # During task initialization, this is called by TimeableTask to schedule the TaskTimer.\n return @end_date if @end_date\n\n # Check for last existing associated TaskTimer\n task_timer = TaskTimer.where(task: self).order(:id).last\n return task_timer.submitted_at if task_timer\n\n # from_date should be appeal receipt date if the appeal is in the ESW docket\n from_date = appeal.receipt_date if appeal.evidence_submission_docket?\n\n # ...or from_date should be the date the hearing was scheduled if a hearing is present\n from_date ||= hearing.hearing_day&.scheduled_for if hearing.present?\n\n # ...or if no hearing is present, from_date should end when the hearing task was cancelled\n from_date ||= cancelled_schedule_hearing_task&.closed_at\n\n # if from_date is still nil, fall back to when this task was created\n from_date = ensure_from_date_set(from_date)\n\n # Add 90 days to the timer based on the date above\n from_date + 90.days\n end",
"def handle_child_workflow_execution_timed_out(event)\n handle_event(event,\n {:id_methods => [:workflow_execution, :workflow_id],\n :consume_symbol => :handle_completion_event,\n :decision_helper_scheduled => :scheduled_external_workflows,\n :handle_open_request => lambda do |event, open_request|\n exception = ChildWorkflowTimedOutException.new(event.id, open_request.description, nil)\n open_request.completion_handle.fail(exception)\n end\n })\n end",
"def wait_task(task,timeout=10)\n counter=timeout\n #puts task.data\n if task\n status=foreman_tasks.show('id'=> task.id)\n #puts status.data\n while counter!=0 and status.state != 'stopped'\n puts \"#{counter}: #{status.progress} #{status.state} #{status.result}\"\n sleep(60)\n counter= counter-1\n if counter==0\n return :timeout\n end\n status= foreman_tasks.show('id'=> task.id)\n end\n # TODO alarm somebody somehow if result is not 'success'\n puts \"Done: state=#{status.state} result=#{status.result}\"\n return :done\n else\n return :nosuchtask\n end \n end",
"def run(context)\n\t\tcontext.onTimerFinished\n\tend",
"def complete!(task_id)\n @tasks[task_id - 1].complete!\n end",
"def complete!(task_id)\n @tasks[task_id - 1].complete!\n end",
"def extend_lock!\n Resque.redis.expire(key, timeout)\n end",
"def update_balance dt\n @off_balance_timer.keys.each do |k|\n if @off_balance_timer[k] && (@off_balance_timer[k] -= dt) <= 0\n hear_line \"You have regained #{k.to_s}\"\n @off_balance_timer[k] = nil\n end\n end\n end",
"def lock_timeout_retry_delay=(_arg0); end",
"def done!\n @meta[Cworked_at] = nil\n put_meta\n\n # remove from both queues\n rcache.lrem(queue.working_cache_key, 0, trx_id)\n rcache.lrem(queue.retries_cache_key, 0, trx_id)\n end",
"def complete_task\n\n # Only add a completed_task index to the completed task array if it does not yet exist.\n if completed_task_ids.include? current_task_id\n logger.info( \"\\t #{current_task_id} \\tLesson: #{:lesson_id} \\tUser: #{user.name} has already been completed\" )\n else\n # Add the completed lesson id\n self.completed_task_ids << current_task_id\n\n # Add the completed points to this subscription\n self.points = points + Task.find_by_id(current_task_id).points\n end\n\n # We should always keep track of which task in this subscription was completed most recently.\n @last_completed_task_id = current_task_id\n self.current_task_id = next_task_id\n self.save!\n\n # Log the completion\n logger.info( \"COMPLETED: Task #{current_task_id}\" )\n self.points\n\n end",
"def eventually(deadline_duration = 3, check_interval = 0.05)\n deadline = Time.now + deadline_duration\n while Time.now < deadline\n if yield\n return\n else\n sleep(check_interval)\n end\n end\n raise 'Time limit exceeded'\n end",
"def on_timeout\n trigger\n reset\n end",
"def complete!\n @completed = true\n @completed_at = Time.now\n end",
"def release_task\n puts\n puts \"Release successful.\"\n end",
"def complete!\n now = Time.current\n transaction do\n transfer_items.each do |item|\n source.present? && source.destock!(item, now, self)\n destination.present? && destination.restock!(item, now, self)\n end\n update completed_at: now\n end\n end",
"def finish!\n Todoable.client.put(\"#{path}/finish\")\n true\n end",
"def complete\n # check that is not already complete\n if self.state != COMPLETE\n self.state = COMPLETE\n self.completed_date = DateTime.current\n self.save!\n end\n \n # call complete on each child\n self.children.each do |child| \n child.complete\n end\n\n # refresh parent completeness\n if !self.parent.nil?\n self.parent.is_complete? \n end\n end",
"def complete(time: Time.now - (4 * 60 * 60))\n if /^[a-z]+$/.match?(schedule)\n @pgsql.exec('UPDATE plan SET completed = $3 WHERE id = $1 AND part = $2', [@id, @part, time])\n else\n detach\n end\n end",
"def finished!\n t = Time.now.utc\n update_attribute(:finished_at, t)\n # Save errors counts\n if errs = error_messages\n BackupJobError.increment_errors_count(*errs)\n end\n backup_source.backup_complete!\n on_finish :errors => errs, :messages => messages\n end",
"def capture_holding_time(totem, waiting_since_hash_user_id)\n user_holding_time_in_seconds = Time.now.to_i - waiting_since_hash_user_id.to_i\n user_holding_time_in_minutes = user_holding_time_in_seconds / 60\n send_gauges_to_signalFX(\"totems:holding_time:#{totem}\",user_holding_time_in_minutes)\n end",
"def processing_running_task\n reset_undefined_retries!\n 'running'\n end",
"def added_child_object(child, relations, info) # :nodoc:\n\t super if defined? super\n\n if !task.invalidated_terminal_flag?\n if (relations.include?(EventStructure::Forwarding) || relations.include?(EventStructure::Signal)) && \n child.respond_to?(:task) && child.task == task\n\n task.invalidate_terminal_flag\n end\n end\n\tend",
"def recover_from_timeout(pid, name)\n with_dedicated_connection do |con|\n lock = select_one(<<~SQL, pid, name, connection: con)\n SELECT locktype, objid, pid, granted FROM pg_locks \\\n WHERE pid = ? AND locktype = 'advisory' AND objid = hashtext(?)\n SQL\n return false unless lock\n\n if lock['granted']\n logger&.info 'DBLock: Lock was acquired after all'\n true\n else\n res = select_value 'SELECT pg_cancel_backend(?)', pid, connection: con\n logger&.warn 'DBLock: Failed to cancel ungranted lock query' unless res == true\n false\n end\n end\n end",
"def schedule_check_in_deadline\n #if !ENV == test\n job = self.delay(run_at: 24.hours.from_now).check_in \n update_column(:delayed_job_id, job.id) # Update Delayed_job\n Delayed::Job.find_by(:id => job.id).\n update_columns(\n owner_type: \"Micropost\",\n owner_job_type: \"24 Hour Deadline\",\n owner_id: self.id,\n user_id: self.user_id,\n )\n end",
"def resurrectable?\n @state_mutex.synchronize {\n Time.now > @dead_since + ( @options[:resurrect_timeout] * 2 ** (@failures-1) )\n }\n end",
"def incomplete!\n self.update_attribute(:is_completed, false)\n # TODO: send an email to teacher about tasks reopening\n end",
"def done\r\n @mutex.synchronize {\r\n @done = true\r\n @tasks.clear\r\n @resource.broadcast\r\n }\r\n end",
"def process_virtually_until! time\n time_diff = time - self.processed_until\n\n if time_diff != 0\n add_resources!(resource_gains time_diff)\n\n if unit_queue_items_count > 0\n add_units!(unit_queue_items.first.recruit_units_between!(self.processed_until, time))\n end\n end\n\n self.processed_until = time\n end",
"def loner_lock_after_execution_period\n @loner_lock_after_execution_period || 0\n end",
"def create_timed_delete(timeout, port_entry)\n mtimer = EM.add_timer(timeout.to_i) do\n time_left = port_entry.lifetime_left\n if time_left > 0\n #puts \"object has #{time_left} seconds left, #{Time.now}\"\n create_timed_delete(time_left, port_entry)\n else\n #puts \"timed delete writer #{Time.now}\"\n @portentries.delete(@portentries.key(port_entry))\n end\n end\n port_entry.timer = mtimer\n end",
"def add_final_task\n if @terminated then\n raise RuntimeError.new( \"workflow '#{ label }' already terminated\" )\n else\n add_the_task( @task_list.count, '<workflow completed>', nil, nil )\n @terminated = true\n end\n end",
"def destroy\n @task.story.touch #update the story's timestamps since its hierarchy has been modified\n @task.destroy\n end",
"def take_time\n if self.completed?\n (complete_on - started_on) if complete_on && started_on\n end\n end",
"def post_task\n end",
"def possibly_set_as_completed\n # this is a guard against setting something completed that isn't and that will make this method fail\n return false unless available_in_merritt? # this also sets @mrt_results member variable so we don't have to redo the query again\n\n merritt_id = \"#{APP_CONFIG[:repository][:domain]}/d/#{@mrt_results['ark']}\"\n StashEngine.repository.harvested(identifier: resource.identifier, record_identifier: merritt_id)\n\n if StashEngine::RepoQueueState.where(resource_id: resource_id, state: 'completed').count < 1\n StashEngine.repository.class.update_repo_queue_state(resource_id: resource_id, state: 'completed')\n end\n\n update_size!\n ::StashEngine.repository.cleanup_files(resource)\n true\n end",
"def _on_completion\n\t\t\tself.update_attribute(:completed_at, DateTime.now)\n\t\t\tassignments.update_all(completed_at: DateTime.now)\n\t\t\tresolver.on_completion(self)\n\t\tend",
"def completed()\n end",
"def has_finish(electionId)\n @election = Election.find(electionId)\n (@election.finish_date.to_i - Time.now.to_i) <= 0\n end",
"def lock_timeout=(_arg0); end",
"def finish_instance\n @instance.finished_at = Time.now\n @failed && @instance.failed\n @instance.save!\n end",
"def checkpoint\n @remaining -= (now - @started_at)\n end"
] | [
"0.67195743",
"0.6183682",
"0.5961619",
"0.57686126",
"0.5704758",
"0.5607227",
"0.5600854",
"0.55446035",
"0.54580194",
"0.5446398",
"0.5433218",
"0.5348812",
"0.5287242",
"0.5234523",
"0.5199004",
"0.51821643",
"0.5163482",
"0.51630723",
"0.5146329",
"0.51411515",
"0.5134067",
"0.51330554",
"0.5132291",
"0.5127633",
"0.5125654",
"0.5123377",
"0.51230544",
"0.5082813",
"0.50757486",
"0.50745934",
"0.50700146",
"0.5067115",
"0.5065208",
"0.50603145",
"0.5052161",
"0.5051055",
"0.50498784",
"0.50466335",
"0.5028497",
"0.5022093",
"0.5018733",
"0.50169927",
"0.50071967",
"0.5006886",
"0.5006387",
"0.5003167",
"0.49958935",
"0.499134",
"0.49899194",
"0.49856344",
"0.4984726",
"0.4984726",
"0.4982805",
"0.49788442",
"0.49678278",
"0.49643776",
"0.4962696",
"0.49613878",
"0.4961199",
"0.49570328",
"0.49440265",
"0.4929975",
"0.492621",
"0.492621",
"0.49194738",
"0.49154013",
"0.4911997",
"0.49084863",
"0.49081516",
"0.49075237",
"0.48990196",
"0.48909408",
"0.48890328",
"0.48840964",
"0.4875543",
"0.48739782",
"0.4869231",
"0.48686123",
"0.48679194",
"0.48671472",
"0.48605368",
"0.48588553",
"0.48577863",
"0.48574308",
"0.48483223",
"0.48472717",
"0.48472255",
"0.48455012",
"0.48446494",
"0.48435548",
"0.48430797",
"0.4840249",
"0.48317614",
"0.48235252",
"0.48189178",
"0.48187798",
"0.4816356",
"0.48092696",
"0.4807133",
"0.47974375"
] | 0.68373746 | 0 |
before_create When an object is created, it doesn't have access to the parent to determine if the photo should be stored privately. After creation, that information is available. So, we rerun the path Proc. | def recalculate_path
self.photo.instance_variable_set('@path', self.class.photo_path(self.private))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def before_save\n\t\t\tself.name ||= ''\n\t\t\tself.filename ||= self.name.downcase.gsub(/[^a-z0-9]+/, '-')\n\t\t\tif self.parent.nil?\n\t\t\t\tself.path = ''\n\t\t\telsif self.parent.path.empty?\n\t\t\t\tself.path = filename\n\t\t\telse\n\t\t\t\tself.path = self.parent.path + '/' + self.filename\n\t\t\tend\n\t\tend",
"def photo__after_create_trigger\r\n\r\nif !@photo_cache.blank? && !@photo_cache[:tmp].blank?\r\n @photo_cache[:path] = File.join(FILES_DEST_PHOTO, 'cache', @photo_cache[:tmp])\r\nend\r\nif !@photo_cache.blank? && @photo_cache[:path]\r\n if File.exist?(@photo_cache[:path])\r\n File.rename(@photo_cache[:path], File.join(FILES_DEST_PHOTO, \"#{self.id}_#{self.photo__name}\"))\r\n else\r\n logger.warn(\"Should not happen! cache: #{@photo_cache.inspect} - name: #{self.photo__name}\")\r\n end\r\nend\r\n@photo_cache = {}\r\nend",
"def new_parent_crop_image_path parent, photo\n attrs = {\n source_photo_id: photo.id,\n parent_type: parent.model_name.plural\n }\n\n new_cropping_photo_path attrs\n end",
"def before_save\n # file = photo.queued_for_write[:original].path\n # self.taken_at = date_taken(file)\n # self.device_make = device(file)[0]\n # self.device_model = device(file)[1]\n # self.geo_lat = geo(file)[0]\n # self.geo_lon = geo(file)[1]\n # attachment_for(:photo).assign(file)\n end",
"def photo__path\r\nif !@photo_cache.blank? && !@photo_cache[:path].blank?\r\n @photo_cache[:path]\r\nelse\r\n File.join(FILES_DEST_PHOTO, \"#{self.id}_#{self.photo__name}\")\r\nend\r\nend",
"def create_photos\n end",
"def before_create\n if self.asset.nil? && self.viewable\n self.asset = self.viewable.asset if self.viewable.respond_to? :asset\n end\n end",
"def photo_path\n if doctor_image\n doctor_image.public_filename\n else\n self.doctor.photo_path\n end\n end",
"def set_realpath\n return super if Node.source.eql?(:node) || persisted?\n\n # binding.pry\n path_n = Pathname.new(path)\n path_n.mkdir unless path_n.exist?\n super\n end",
"def create\n run_callbacks :create do\n method = self.class.method_for(:create)\n path = request_path(:_owner_path => @owner_path)\n self.class.request(to_params.merge(:_method => method, :_path => path)) do |response|\n load_attributes_from_response(response)\n end\n end\n end",
"def path\n \"#{RAILS_ROOT}/photos/#{self.visit.user_id}/#{self.visit_id}\"\n \n# \"#{RAILS_ROOT}/public/images/#{self.class.to_s.underscore.pluralize}\"\n end",
"def create\n photo_io = params[:photo][:path]\n if photo_io \n file_ext = File.extname(photo_io.original_filename)\n content = photo_io.read\n new_name = Digest::SHA1.hexdigest(content) + file_ext\n path = Rails.root.join('app','assets','images', new_name).to_path\n File.new(path,'w').syswrite(content)\n end\n @photo = Photo.new do |p|\n photo = params[:photo]\n p.name = photo[:name]\n p.path = new_name if new_name\n p.descrption = photo[:descrption]\n end\n respond_to do |format|\n if @photo.save\n format.html { redirect_to photos_url}\n format.json { render json: @photo, status: :created, location: @photo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @photo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def before_create\n # Update the child object with its parents attrs\n unless self[:parent_id].to_i.zero?\n self[:depth] = parent[:depth].to_i + 1\n self[:root_id] = parent[:root_id].to_i\n end\n end",
"def before_create()\n end",
"def parent(user)\n BolFile.find_by(parent_recognizing_condition) || user.bol_files.create(parent_recognizing_condition)\n end",
"def parent_object_exists\n begin\n self.parent_class.constantize.find(self.parent_id)\n rescue\n self.errors.add(:parent_id,\"the #{self.parent_class} does not exist, Create it before trying to add an image to it\")\n end\n end",
"def before_save\r\n\t\t\tself.name ||= ''\r\n\t\t\tself.filename ||= self.name.downcase.gsub(/[^a-z0-9]+/, '-')\r\n\r\n# We're doing this manually in the below migration code\r\n#\t\t\tif self.parent.nil?\r\n#\t\t\t\tself.path = ''\r\n#\t\t\telsif self.parent.path.empty?\r\n#\t\t\t\tself.path = filename\r\n#\t\t\telse\r\n#\t\t\t\tself.path = self.parent.path + '/' + self.filename\r\n#\t\t\tend\r\n\r\n\t\t\tif self.sequence.nil? || self.sequence.zero?\r\n\t\t\t\tsiblings = Category.count(:id, :conditions => list_scope_condition)\r\n\t\t\t\tself.sequence = siblings + 1\r\n\t\t\tend\r\n\t\tend",
"def generate_parent\n @attachment = Attachment.new\n end",
"def before_create_file(_path, data, parent_node, modified)\n return true unless parent_node.is_a?(IAddressBook)\n\n validate_v_card(data, modified)\n true\n end",
"def create\n @gallery = Gallery.new(params[:gallery])\n @rights = {'Moderators' => 'moderators', 'Members' => 'members', 'Anybody' => 'all'}\n\n\n @gallery.creator_id = self.current_user.id\n @gallery.parent_id = params[:parent_id]\n @gallery.parent_type = params[:parent_type]\n @parent_object = Gallery.find_parent(params[:parent_type], params[:parent_id])\n set_session_parent_pictures_root_path(@gallery.get_parent_object)\n\n #prepare_pictures_attributes(@gallery)\n\n respond_to do |format|\n if @gallery.activate!\n\n flash[:notice] = I18n.t('galleries.controller.Gallery_successfully_created')\n #format.html { redirect_to(@gallery) }\n format.html { redirect_to(url_for_even_polymorphic(@gallery, :action => 'add_pics')) }\n format.xml { render :xml => @gallery}\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @gallery.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def photo\r\n\r\nif @photo_cache && @photo_cache[:tmp]\r\n @photo_cache[:path] = File.join(FILES_DEST_PHOTO, 'cache', @photo_cache[:tmp])\r\nend\r\nif @photo_cache && File.exists?(@photo_cache[:path])\r\n return File.read(@photo_cache[:path])\r\nelse\r\n File.open(self.photo__path, 'r').read unless self.new_record? || !File.exist?(self.photo__path)\r\nend\r\nend",
"def before_saving\n self.save_to_gallery(self.file, self.filename, self.photo_gallery_id, self.user_id)\n# self.save\n# end\n end",
"def set_path_based_on_parent!\n if self.class_type == 'variant'\n \":rails_root/public/assets/upload/variants/:id/:style/:basename.:extension\"\n elsif self.class_type == 'banner'\n \":rails_root/public/assets/upload/banner/:style/:basename.:extension\"\n elsif self.class_type == 'logo'\n \":rails_root/public/assets/upload/logo/:style/:basename.:extension\"\n end\n end",
"def photo_path\n \"/photo_store/people/#{id}.#{extension}\"\n end",
"def set_path\n unless self.parent_id.blank?\n parent = Comment.find(self.parent_id)\n self.story_id = parent.story_id\n self.depth = parent.depth + 1\n self.path = parent.path + \":\" + parent.id.to_s\n end\n save\n end",
"def create\n @persona = Persona.new(params[:persona])\n @persona.user_id = current_user.id\n @persona.avatar = params[:file]\n # @persona.avatar = File.open('somewhere')\n @persona.save!\n @persona.avatar.url # => '/url/to/file.png'\n @persona.avatar.current_path # => 'path/to/file.png'\n @persona.avatar.identifier # => 'file.png'\n\n respond_to do |format|\n if @persona.save\n format.html { redirect_to @persona, notice: 'Persona was successfully created.' }\n format.json { render json: @persona, status: :created, location: @persona }\n else\n format.html { render action: \"new\" }\n format.json { render json: @persona.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n@asset = current_user.assets.build(asset_params) \n if @asset.save \n flash[:notice] = \"Successfully uploaded the file.\" \n \n if @asset.folder #checking if we have a parent folder for this file \n redirect_to browse_path(@asset.folder) #then we redirect to the parent folder \n else \n redirect_to root_url \n end \n else \n render :action => 'new' \n end \n end",
"def create\n\n return unless parent.preview.exists?\n\n self.thumbs.each_pair do |name, thumb|\n thumb.create\n end\n end",
"def get_path\n if self.presentation.user.role==\"guest\"\n \"#{Rails.root}/public/guestdata/\"+self.presentation.user_id.to_s+\"/\"+self.presentation.id.to_s+\"/images/:filename\"\n else\n \"#{Rails.root}/public/userdata/\"+self.presentation.user.name.downcase.gsub(\" \", \"_\")+\"/\"+self.presentation.name.downcase.gsub(\" \", \"_\")+\"/images/:filename\"\n #\"#{Rails.root}/public/userdata/\"+self.presentation.user.name.downcase.gsub(\" \", \"_\")+\"/\"+self.presentation.name.downcase.gsub(\" \", \"_\")+\"/images/:attachment/:id_:style.:extension\"\n end\n end",
"def before_save\n if owner\n self.page = owner.page if page.nil?\n if page?\n self.depth = parent ? ((parent.depth || 0) + 1) : 0\n else\n self.depth = (owner.content_depth || 0) + 1\n end\n end\n super\n end",
"def prepare_path\n log(\"prepare_path\")\n FileUtils.mkdir_p(path) unless Dir.exist?(path)\n rescue Exception => e\n log(\"prepare_path\", \"ERROR #{e}\")\n notify( \"reader.error\", { :error => \"prepare_path\" } )\n end",
"def create\n @user = User.create_child(params[:user])\n if @user.errors.empty?\n Zfile.set_attachable(params[:avatar_id], @user.profile) if params[:avatar_id]\n else\n flash[:error] = I18n.t 'controllers.users.create.error', :user_full_name=>@user.profile_full_name \n end\n end",
"def after_create_save(record)\n if (nested? && nested.scope)\n parent = nested_parent_record(:read)\n record.send(\"#{nested.scope}\").send(:<<, parent) unless parent.nil?\n end\n end",
"def before_create(_params)\n nil\n end",
"def create\n unless params[:publication][:photo].nil?\n file = Rails.root.join(\"app\",\"assets\",\"images\",\"from_users\",session[:user].id.to_s(),params[:publication][:photo].original_filename)\n tmp = params[:publication][:photo].tempfile \n FileUtils.cp tmp.path, file \n p params[:publication]\n params[:publication][:photo] = File.join(\"from_users\",session[:user].id.to_s(),params[:publication][:photo].original_filename)\n end\n params[:publication][:user_id] = session[:user].id\n params[:publication][:not_validated] = 1\n @publication = Publication.new(params[:publication])\n respond_to do |format|\n if @publication.save\n format.html { redirect_to \"/publication/\"[email protected]_s() }\n else\n format.html { render action: \"new\" }\n format.json { render json: @publication.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_image_path\n case provider\n when 'facebook' then self.path = set_facebook_url\n when 'gravatar' then self.path = set_gravatar_url\n else\n self.path = set_gravatar_url\n self.provider = 'gravatar'\n end\n\n self.is_active = true if Avatar.where(user: user).count == 0\n end",
"def new_photos_for(user)\n new_content_for(user,:photo) \n end",
"def photo_path\n\"/photo_store/#{id}.#{extension}\"\nend",
"def store_dir\n \"photo/#{model.id}\"\n end",
"def create_path path\n if path.include? 'public' # path is absolute\n FileUtils.mkdir_p(\"#{path}\")\n else # path is relative\n FileUtils.mkdir_p(\"#{PUBLIC_IMAGES_ROOT}/#{path}\")\n end\n end",
"def create_or_update_path(path_attrs)\n path = Path.where(title: path_attrs[:title]).first\n\n if path.nil?\n path = Path.create!(path_attrs)\n Rails.logger.info \">>>> Created new path: #{path_attrs[:title]}!\"\n elsif path.attributes == path_attrs\n Rails.logger.info \"No changes to existing path: #{path_attrs[:title]}\"\n else\n path.update_attributes(path_attrs)\n Rails.logger.info \"Updated existing << PATH >>: #{path_attrs[:title]}\"\n end\n\n path\nend",
"def photo_path\n \t\"/photo_store/#{id}.#{extension}\"\n end",
"def create_photo_for_user(user)\n user.photos.create(\n user_id: user.id,\n title: \"Test Photo\",\n description: \"Bacon ipsum dolor sit amet beef shoulder frankfurter brisket short loin. Capicola shankle pork belly, turducken chuck doner leberkas short loin. Boudin strip steak pork loin shankle flank spare ribs shoulder. Ball tip leberkas beef shank jerky beef ribs tongue capicola short loin pork belly filet mignon ribeye pork doner.\",\n photo: fixture_file_upload(\"photos/photo1.jpg\")\n )\n end",
"def path\n \"#{parent_image.basepath}-#{width}-#{height}-#{x1}-#{x2}-#{y1}-#{y2}#{parent_image.extname}\"\n end",
"def after_create_save(record)\n if nested? && nested.scope\n parent = nested_parent_record(:read)\n record.send(nested.scope.to_s).send(:<<, parent) unless parent.nil?\n end\n end",
"def path; super; end",
"def path\n @path_klass.new(super)\n end",
"def make_userpic!\n self.cat_id = Content::CATEGORIES[:userpic][:id]\n self.relationshiptype_id = Relationshiptype.everyone\n self.save!\n if user.profile.userpic\n user.profile.userpic.update_attributes(:cat_id => Content::CATEGORIES[:image][:id])\n end\n user.profile.userpic_id = self.id\n user.profile.save!\n end",
"def photo_path\n \"/photo_store/#{id}.#{extension}\"\n end",
"def make_current\n\t\tself.parent_image = nil\n\tend",
"def photo__thumb_path\r\n\r\nFile.join(FILES_DEST_PHOTO__THUMBS, File.basename(self.photo__path))\r\nend",
"def create\n if self.send(self.class.parent_association_name).valid?\n self.send(self.class.parent_association_name).save!\n self.id = self.send(self.class.parent_association_name).id\n self.instance_variable_set(:@new_record, false)\n ret = self.save\n self.reload\n return ret\n else\n self.errors.add(self.class.parent_association_name, 'has errors')\n end\n end",
"def initial_path_setup\n repo_name = @repo.repo_name.gsub(/[.]+/, '-') || @repo.repo_name\n repo_path = Rails.root.join('storage', 'repos', @repo.username, @repo.supplier_project_id.to_s, repo_name)\n FileUtils.mkdir_p(repo_path) unless File.directory?(repo_path)\n Dir.chdir(repo_path)\n ActiveRecord::Base.connection_pool.with_connection do \n @repo.update(clone_path: repo_path)\n end\n end",
"def after_create_save(record)\n record.move_to_child_of record.parent.id unless record.parent.nil?\n end",
"def set_defaults\n self.name = path.split('/').last\n # self.owner = SegmentRoot.create(name: :test)\n end",
"def create\n\t\t# create Photo from the params\n\t\t@photo = Photo.new(photo_params)\n\t\[email protected]_setting = SecuritySetting.new\n\n\t\t# set the album if album_id exists in params\n\t\tif params.has_key?(:album_id)\n\t\t\[email protected]_id = params[:album_id]\n\t\tend\n\t\t\n\t\t# if albums exists then photo inherits albums security level\n\t\tif @photo.album != nil\n\t\t\[email protected]_setting.securitylevel_id = @photo.album.security_setting.securitylevel_id\n\t\telse\n\t\t# else set security level fromt the params\n\t\t\[email protected]_setting.securitylevel_id = params[:securitylevel_id]\n\t\tend\n\n\t\t# set the user for the photo\n\t\[email protected] = current_user\n\t\n\t\trespond_to do |format|\n\t \tif @photo.save\n\t \tActivityFeed.new.createActivityFeed(current_user,@photo,\"created\")\n\t \tif params.has_key?(:album_id)\n\t\t\t\t\tformat.html { redirect_to user_album_photo_path(@user,@photo.album,@photo), notice: 'photo was successfully updated.' }\n\t\t\t\telse\n\t\t\t\t\tformat.html { redirect_to user_photo_path(@user,@photo), notice: 'photo was successfully updated.' }\n\t\t\t\tend\n\t \tformat.json { render :show, status: :created, location: @photo }\n\t \telse\n\t \tformat.html { render :new }\n\t \tformat.json { render json: @photo.errors, status: :unprocessable_entity }\n\t \tend\n\t \tend\n end",
"def store_dir\n \"photos/#{model.id}/\"\n end",
"def before_create_file(path, data, parent_node, modified)\n return true unless parent_node.is_a?(ICalendar)\n\n validate_i_calendar(\n data,\n path,\n modified,\n @server.http_request,\n @server.http_response,\n true\n )\n true\n end",
"def create\n @photo = Photo.new(params[:photo])\n @photo.user = current_user\n\n respond_to do |format|\n if @photo.save\n format.html { redirect_to request.env[\"HTTP_REFERER\"] || @photo.photoable, notice: 'Photo added!' }\n format.json { render json: @photo, status: :created, location: @photo }\n else\n format.html { redirect_to request.env[\"HTTP_REFERER\"] }\n format.json { render json: @photo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def validate_if_segment\n return unless owner.type.nil?\n\n dirs = component_dir_paths.map { |p| base_name(p) }\n files = component_file_paths.map { |p| base_name(p) }\n (files - dirs).each { |path| search_path.join(path).mkdir }\n (dirs - files).each { |path| FileUtils.touch(search_path.join(\"#{path}.yml\")) }\n end",
"def store_only_new\n if !student\n @logger.info(\"student not in db!\")\n return nil\n end\n\n # Digest file and check if we already have this image\n return nil if photo_already_exists?\n\n # Then store it in S3\n s3_filename = store_object_in_s3\n return nil if s3_filename.nil?\n\n # And add a record referencing it in the database\n create_student_photo_record(s3_filename)\n end",
"def set_photo_from_external\n return true if photos.count.positive?\n return unless ( photo = photos_with_backfill.first )\n\n photos << photo\n Taxon.update_ancestor_photos( self, photo )\n end",
"def after_sign_up_path_for(resource)\n :pre_created\n end",
"def create\n @photo = current_user.photos.build(photo_params)\n @photo.image_url = upload_photo_and_return_name\n respond_to do |format|\n if @photo.save\n format.html { redirect_to root_url }\n format.json { render :show, status: :created, location: @photo }\n else\n format.html { render :new }\n format.json { render json: @photo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def uploader_create(params, request = nil)\n ability = Ability.new(request.env['warden'].user)\n\n if ability.can? :create, self\n self.user = request.env['warden'].user\n super\n else\n errors.add(:id, :access_denied)\n end\n end",
"def parent_process_image_file\n return @parent_process_image_file\n end",
"def create\n @photo = @project.photos.new(photo: params[:file])\n authorize! :create, @photo\n @photo.save!\n render :partial => \"show\"\n end",
"def autosets_owner_on_create\n has_owner # this will do nothing if the user has already set up has_owner :something\n # the hook runs before validation so we can validate_associated\n before_validation_on_create :autoset_owner\n end",
"def attachment_path_id\n ((respond_to?(:parent_id) and parent_id) or id) or 0\n end",
"def path\n @path ||= polymorphic_path @resources\n end",
"def find_or_create_by_invoice_attached_asset\n\t\t# Created w\n\n\n\tend",
"def after_write_path; end",
"def preservation_file\n if parent.try(:image_resource?)\n @file_set.primary_file\n else\n @file_set.preservation_file || @file_set.primary_file\n end\n end",
"def create\n render_create @parent.new data_params.merge(user: @current_user)\n end",
"def create\n @photo = current_user.photos.build(params[:photo])\n @photo.imageable = current_user\n\n respond_to do |format|\n if @photo.save\n format.html { redirect_to @photo, notice: 'Photo was successfully created.' }\n format.json { render json: @photo, status: :created, location: @photo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @photo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @album = Album.new(params[:album]) \n @album.user_id = @current_user.id \n respond_to do |format| \n if @album.save \n dir_path = \"#{RAILS_ROOT}/public/uploads/#{@current_user.login}/#{@album.id}\" \n if Dir[dir_path].size == 0\n Dir.mkdir(dir_path)\n end\n format.html { redirect_to(@album, :notice => 'Альбом создан') }\n format.xml { render :xml => @album, :status => :created, :location => @album }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @album.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\r\n @patient = Patient.new(params[:patient])\r\n\t\r\n respond_to do |format|\r\n if @patient.save\r\n \t#CREATE BLANK PROFILE PIC - ADDED BY UPINDER\r\n \t@patientID = @patient.id.to_s\r\n\r\n \t@target_directory = File.join(RAILS_ROOT,\"public/patients/photos\")\r\n \t@target_directory = File.join(@target_directory,@patientID)\r\n \t@target_path = File.join(@target_directory,\"pic.jpg\")\r\n \t@source_path = File.join(RAILS_ROOT,\"public/patients/photos\")\r\n \t@source_path = File.join(@source_path,\"missing_photo.jpg\")\r\n \tDir::mkdir(@target_directory)\r\n File.copy(@source_path,@target_path) \t\r\n \t#END BLANK PROFILE PIC\r\n flash[:notice] = 'Patient was successfully created.'\r\n \r\n APP_LOGGER_LOG.info \"PATIENT CREATED - for PATIENT ID \" + \r\n @patient[:medical_record_number] + \" by USER \" + self.current_user[:login]\r\n \r\n format.html { redirect_to(@patient) }\r\n format.xml { render :xml => @patient, :status => :created, :location => @patient }\r\n else\r\n format.html { render :action => \"new\" }\r\n format.xml { render :xml => @patient.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end",
"def build_path\n end",
"def image_fs_path(issue, basename)\n debugger\n dir_path = Rails.root.join('public', \"photos/#{@issue.date.strftime('%m-%d-%y')}\")\n if not File.exists?(dir_path)\n FileUtils.mkdir_p(dir_path)\n end\n \"#{dir_path}/#{basename}\"\nend",
"def before_destroy\n path = c_dir+\"#{self.code}.jpg\"\n FileUtils.rm path if File.exist? path\n end",
"def create\n paths = create_with_thumbnail(params['content'])\n @photo = Photo.create(:name => params['photo']['name'], :mimetype => params['content'].content_type, :path => paths[0], :thumbnail => paths[1])\n @photo.save()\n\n respond_to do |format|\n if @photo.save\n format.html { redirect_to(@photo, :notice => 'Photo was successfully created.') }\n format.xml { render :xml => @photo, :status => :created, :location => @photo }\n format.json { render :json => {'p_url' => \"#{PUZZUULE_URL_BASE}id=#{@photo.id}\"} }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @photo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def save_photo\n if @photo_data\n directory_name = File.join PHOTO_STORE, self.catalogue.id.to_s\n Dir.mkdir(directory_name) unless File.exists?(directory_name)\n self.image_url = self.id.to_s + @image_extension\n # Write the data out to a file\n name = File.join directory_name, image_url\n File.open(name, 'wb') do |f|\n f.write(@photo_data.read)\n end\n @photo_data = nil\n self.save\n end\n end",
"def profile_photo\n\tend",
"def on_create(&block)\n @callbacks[:new_file_created] = block\n\n # @callbacks(:new_file_created) = block\n end",
"def getPicturePath\n\t\t#return User.find(self.user_id)\n @profile = Profile.find(:first, :conditions => {:user_id => self.user_id})\n if @profile.avatar != '' and @profile.avatar!=nil\n return @profile.avatar\n else\n return @profile.picture_path\n end\n\t\t#return Profile.find(:first, :conditions => {:user_id => self.user_id}).picture_path\n\tend",
"def create\n @photo =Photo.new(:imageable_id=>params[:photo][:imageable_id], :imageable_type=>params[:photo][:imageable_type],:file_name=>params[:photo][:file_name],:photo_name=>params[:photo][:photo_name])\n if @photo.save\n \n redirect_to '/' + params[:photo][:imageable_type].pluralize.downcase + '/' + params[:photo][:imageable_id], notice: \"Photo was successfully created.\"\n else\n render :new\n end\n end",
"def initialize(primary_key, uuid, uti, note, backup)\n # Set this folder's variables\n super(primary_key, uuid, uti, note)\n\n # Gallery has no direct filename or path, just pointers to other pictures\n @filename = nil\n @filepath = nil\n @backup = backup\n\n # Add all the children\n add_gallery_children\n end",
"def photo_url\n defined?(object.photo) ? object.photo.url : ''\n end",
"def paperclip_path\n record = resourceable\n case record\n when Thinkspace::Casespace::Phase\n assignment = record.thinkspace_casespace_assignment\n space = assignment.thinkspace_common_space\n \"spaces/#{space.id}/assignments/#{assignment.id}/phases/#{record.id}/:filename\"\n when Thinkspace::Casespace::Assignment\n space = record.thinkspace_common_space\n \"spaces/#{space.id}/assignments/#{record.id}/:filename\"\n when Thinkspace::Common::Space\n \"spaces/#{record.id}/:filename\"\n else\n \"spaces/system/resource/:filename\"\n end\n end",
"def create\n if !check_session #Validate if the user session is active\n return #If not force return to trigger the redirect of the check_session function\n end\n @photo = Photo.new(photo_params) #Create a new photo object with the parameters set by the user in the create form\n @photo.owner_id = session[:user]['id'] #Set the logged user's id as owner\n resp = @photo.save(session[:user],nil) #Save the new Photo object\n if resp[0] #Validate if the response was successfull\n flash[:success] = t(:photo_creation_success_flash, photo: @photo.title) #Set the success message for the user\n redirect_to photos_path #Redirect the user to the photos list page\n elsif validate_authorized_access(resp[1]) #If the response was unsucessful, validate if it was caused by unauthorized access to the app or expired session\n if(resp[1].kind_of?(Array)) #If the response was unsucessful, validate if it was caused by an invalid Photo object sent to the model. If so the server would have returned an array with the errors\n flash[:warning] = Util.format_validation_errors(resp[1]) #Set the invalid object message for the user\n end\n flash[:danger] = t(:photo_creation_error_flash) #Set the error message for the user\n @photo = Photo.new #Reset the Photo object to an empty one\n redirect_to new_photo_path #Redirect the user to the Photo creation page\n else \n return #If not force return to trigger the redirect of the check_session function\n end\n rescue #Error Handilng code\n general_error_redirection('Controller: '+params[:controller]+'.'+action_name,$!)\n end",
"def new_folder\n #~ find_portfolio_and_folder\n folder_name = find_folder_name(@folder.id,params[:folder_name])\n folder_property = Folder.find_by_real_estate_property_id_and_parent_id(@folder.real_estate_property_id,0) if @folder\n portfolio_id = (folder_property && folder_property.portfolio_id) ? folder_property.portfolio_id : @portfolio.id\n folder=Folder.create(:name=>folder_name,:parent_id=>@folder.id,:portfolio_id=>portfolio_id,:user_id=>current_user.id,:real_estate_property_id=>@folder.real_estate_property_id)\n #to restrict the auto sharing inside the property folder\n unless params[:collaborators_list].blank?\n @member_emails =[]\n owner=Folder.find(params[:folder_id]).user.email\n email_ids = params[:collaborators_list].split(',')\n email_ids.each do |m|\n @member_emails << m.strip if m.strip != owner\n end\n email_ids = email_ids.reject{|email_id| current_user.email == email_id}\n share_folder(email_ids,folder)\n end\n if @folder.parent_id != 0\n shared_folders_1= SharedFolder.find(:all,:conditions=>['folder_id = ?',@folder.id])\n create_share_folders(shared_folders_1,folder)\n end\n Event.create_new_event(\"create\",current_user.id,nil,[folder],current_user.user_role(current_user.id),folder.name,nil)\n assign_params(\"asset_data_and_documents\",\"show_asset_files\")\n assign_options\n add_visual_effect_folder_file_name(\"Folder\",\"created\")\n end",
"def ltree_path_before_last_save\n public_send :attribute_before_last_save, ltree_path_column\n end",
"def create\n # set flag to mark that avatar set up\n if params[:user][:avatar].present?\n params[:user][:progress_status] = 0b00000001\n end\n super\n end",
"def load_path\n # TODO: Could this be used to load app dir and blueprint.yml?\n # If not remove it\n owner.before_load_path(rootpath, self) if owner.respond_to?(:before_load_path)\n create_assets\n validate_if_segment\n create_components\n end",
"def photo_load_from_params(att)\r\n\r\nval = att[:photo]\r\nif val\r\n if val == '_destroy'\r\n self.photo__name = nil\r\n self.photo = nil\r\n elsif val == '_forget'\r\n elsif val.size == 0\r\n att.delete(:photo)\r\n else\r\n self.photo__name = File.basename(val.original_filename).parameterize.sub(/(-)(\\w+)\\Z/, '.\\2')\r\n self.photo = val.read\r\n end\r\nelse\r\n if !att[:photo_tmp].blank? && !att[:photo_name].blank?\r\n self.photo__name = att[:photo_name]\r\n self.photo__cache[:name] = att[:photo_name]\r\n self.photo__cache[:tmp] = att[:photo_tmp]\r\n end\r\nend\r\nend",
"def thumbnail_path_for_user(user)\n (photo = photo_for_user(user)) && occasion_thumbnail(photo)\n end",
"def image\n @path\n end",
"def url_after_create\n # your special path\n end",
"def photo__after_destroy_trigger\r\n\r\nDir[File.join(FILES_DEST_PHOTO, \"#{self.id}_*\")].each{|f| File.delete(f)}\r\nDir[File.join(FILES_DEST_PHOTO__THUMBS, \"#{self.id}_*\")].each{|f| File.delete(f)}\r\nend",
"def photo_wrapper\n Cachy.cache(\"photo_#{@slug}\") { self.photo }\n end"
] | [
"0.65017766",
"0.6337799",
"0.60018194",
"0.5998204",
"0.59672207",
"0.5900859",
"0.58760893",
"0.5853009",
"0.58304757",
"0.5820224",
"0.5757632",
"0.56925106",
"0.56909657",
"0.565624",
"0.5602336",
"0.55588543",
"0.5539258",
"0.55024433",
"0.54894584",
"0.54750896",
"0.54749256",
"0.54677606",
"0.543319",
"0.5369819",
"0.53580934",
"0.53580624",
"0.5346159",
"0.5337626",
"0.5327475",
"0.5319359",
"0.5318278",
"0.5309433",
"0.52710336",
"0.52679574",
"0.52648264",
"0.5249219",
"0.52449435",
"0.5240455",
"0.52403164",
"0.52384704",
"0.5229855",
"0.5220209",
"0.5213105",
"0.5212526",
"0.5208593",
"0.52085626",
"0.5206514",
"0.5206481",
"0.5201608",
"0.5180774",
"0.51692325",
"0.5167126",
"0.51555145",
"0.51429766",
"0.5136016",
"0.51204205",
"0.5115542",
"0.51062286",
"0.5100653",
"0.5095757",
"0.5086962",
"0.50755066",
"0.5072286",
"0.5068781",
"0.5067488",
"0.5048714",
"0.5048608",
"0.50478846",
"0.5043546",
"0.50328773",
"0.5032433",
"0.5031666",
"0.502819",
"0.50182974",
"0.5018079",
"0.5016604",
"0.5013661",
"0.50126743",
"0.50082225",
"0.50050014",
"0.5003533",
"0.50003827",
"0.49954718",
"0.49933916",
"0.4992729",
"0.49837723",
"0.498193",
"0.4978763",
"0.4978039",
"0.497636",
"0.49760857",
"0.49755058",
"0.49720255",
"0.4970171",
"0.49695072",
"0.49657995",
"0.49638218",
"0.49553663",
"0.4953927",
"0.4951854"
] | 0.63130647 | 2 |
Write a method fibs which takes a number and returns that many members of the fibonacci sequence. Use iteration for this solution. | def fibs(num)
array = []
0.upto(num) do |i|
array << i if i.zero? || i == 1
array << array[i - 1] + array[i - 2] if i > 1
end
array
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fibs(n)\nend",
"def fibs(number)\n\n\tfibonacci=[1]\n\tcount=0\n\tnum1=1\n\tnum2=0\n\twhile fibonacci.size<number\n\t\tsum=num1+num2\n\t\tfibonacci.push(sum)\n\t\tnum2=num1\n\t\tnum1=sum\n\tend\n\n\treturn fibonacci\nend",
"def fibs (n) #Non-recursive\n\n\t# n = number of Fibonacci sequence members.\n\t# 0, 1, 1, 2, 3, 5, 8, 13, ..\t\n\tfib_seq = []\n\t(0..n).each do |i|\n\t\tif i == 0\n\t\t\tfib_seq << 0\n\t\telsif i == 1\n\t\t\tfib_seq << 1\n\t\telse\n\t\t\tfib_seq << fib_seq[i-2] + fib_seq[i-1]\n\t\tend\n\tend\n\tfib_seq\nend",
"def fib_iterative(n)\n\tnum = 0\n\tnext_num = 1\n\tpositions = 1..n\n\tpositions.each do |position|\n\t\tnum = next_num\n\t\tnext_num = next_num + num\n\tend\n\tretun num\nend",
"def fib(n) #n indicates # of elements we want in array\r\n a = 0\r\n b = 1\r\n fib_arr = []\r\n #loop starts iff n >= 1, but x starts from 0 (when n=1, x=0; n=2, x=0,1)\r\n n.times do |x| \r\n if x == 0\r\n fib_arr << a\r\n elsif x == 1\r\n fib_arr << b\r\n else\r\n c = a+b #c is the new fib # we are generating\r\n fib_arr << c\r\n a = b\r\n b = c\r\n end\r\n end\r\n return fib_arr\r\nend",
"def fibs_sum(n)\n\nend",
"def fibs_sum(n)\n\nend",
"def fibs_sum(n)\n\nend",
"def fibs_sum(n)\n\nend",
"def fibs_sum(n)\n\nend",
"def get_all_fibs(num)\n a = 1; b = 2; c = 0;\n fibs = [a, b];\n while ((c = a + b) < num)\n fibs << c;\n a = b;\n b = c;\n end\n fibs.select {|x| x.even?}.inject(:+)\nend",
"def fibonacci(how_many_numbers)\n fibonacci_sequence = []\n count = 0\n while count < how_many_numbers\n if count == 0\n fibonacci_sequence << 0\n count += 1\n elsif count == 1\n fibonacci_sequence << 1\n count += 1\n else\n fibonacci_sequence << fibonacci_sequence[-1] + fibonacci_sequence[-2]\n count += 1\n end\n end\n fibonacci_sequence\nend",
"def fib(n)\n n.times.each_with_object([0,1]) { |_, results| results << results[-2] + results[-1] }\nend",
"def gen_fibs3\n fibs = [0,1]\n n = 10\n a,b = 0,1\n (n-1).times do\n a,b = b,a+b\n fibs << b\n end\n fibs\nend",
"def fib(n)\n n.times.each_with_object([0,1]) { |num, obj| obj << obj[-2]+obj[-1]}\nend",
"def fib_iterate(n)\n\n fib_nums = []\n i = 0\n fib_nums << 0 if n > 0\n fib_nums << 1 if n > 1\n while i < n\n if i > 1\n fib_nums << fib_nums[i-1] + fib_nums[i-2]\n end\n i+= 1\n end\n\n fib_nums\nend",
"def fibo(n)\n\n first = 0\n second = 1\n total = 0\n\n (1...n).each do\n total = first + second\n first = second\n second = total\n end\n return total\nend",
"def fib_cheat(num)\n results = []\n (1..num).each {|num| results << fib_num(num)}\n results\nend",
"def iter_fib(number)\n v1 = 0\n v2 = 1\n (number-1).times.each do\n temp = v2\n v2 = v2 + v1\n v1 = temp\n end\n v2\nend",
"def iterative_fibs(n)\n return [] if n == 0\n return [0] if n == 1\n fibs = [0, 1]\n until fibs.length == n\n fibs << fibs[-1]+ fibs[-2]\n end\n fibs\nend",
"def fib(n)\n \nend",
"def fibs(num)\n return [] if num == 0\n return [0] if num == 1\n\n fibs = [0, 1]\n while fibs.count < num\n fibs << fibs[-1] + fibs[-2]\n end\n\n fibs\nend",
"def fibs(n)\n # fibs = [0, 1]\n # return [0] if n == 1\n # return fibs if n == 2\n\n # (n - 2).times do \n # fibs << fibs[-1] + fibs[-2]\n # end\n # return fibs\n\n return 0 if n == 1\n return 1 if n == 2\n\n return fibs(n - 1) + fibs(n - 2)\nend",
"def iterative_fibbys(n)\n return [] if n == 0\n return [0] if n == 1\n\n fibs = [0, 1]\n while fibs.count < n\n fibs << fibs[-2] + fibs[-1]\n end\n fibs\nend",
"def fib_number(n)\n fib_array = (1..n).collect { |num| nth_fibonacci num }\n fib_array.join().to_i\nend",
"def fibonacci\n\tresults, first, second, current = 0, 1, 2, 2\n\twhile current <= 4000000\n\t\tif current % 2 == 0\n\t\t\tresults += current\n\t\tend\n\t\tcurrent = first + second\n\t\tfirst, second = second, current\n\tend\n\treturn results\nend",
"def fibonacci(num)\n fib_nums = []\n (0...num).each do |i|\n if i == 0 || i == 1\n fib_nums << 1\n next\n end\n fib_nums << fib_nums[i-2] + fib_nums[i-1]\n end\n return fib_nums\nend",
"def fib(n)\n\n fib_array = []\n first = 0\n second = 1\n\n if n == 0\n fib_array << nil\n elsif n == 1\n fib_array << 0\n else\n fib_array << 0\n fib_array << 1\n if n >= 3\n (3..n).each do # Due to the zero index of\n # Ruby, we use 3 here to represent the\n # numbers after 0, 1, 1\n\n next_number = (first + second)\n first = second\n fib_array << second = next_number\n\n end\n end\n end\n return fib_array\n\nend",
"def fibs(n)\r\n\r\n fibs = [0, 1]\r\n until n == fibs.length\r\n fibs << fibs[-1] + fibs[-2]\r\n end\r\n fibs\r\n\r\nend",
"def fibs(n)\r\n\r\n fibs = [0, 1]\r\n until n == fibs.length\r\n fibs << fibs[-1] + fibs[-2]\r\n end\r\n fibs\r\n\r\nend",
"def fib(number)\n sequence = [0,1]\n number.times {sequence << sequence[-1] + sequence[-2]}\n sequence[-1]\n return sequence\nend",
"def fibs(n)\n\toutput = []\n\t(0..n).each do |num|\n\t\tif num < 2\n\t\t\toutput << num\n\t\telse\n\t\t\toutput << output[num - 2] + output[num - 1]\n\t\tend\n\tend\n\tprint output, \"\\n\\n\"\nend",
"def fib(n)\n\nend",
"def cool_fib(number)\n (0..number).inject([1,0]) {|i_arr| [i_arr.last, i_arr.first + i_arr.last]}.first\nend",
"def fibonacci (n)\r\n def calculation(n)\r\n a = 0\r\n b = 1\r\n\r\n # Compute Fibonacci number in the desired position.\r\n n.times do\r\n temp = a\r\n a = b\r\n # Add up previous two numbers in sequence.\r\n b = temp + b\r\n end\r\n\r\n return a\r\n\r\n end \r\n\r\n fib_results = []\r\n\r\n n.times do |n|\r\n\r\n result = calculation(n)\r\n fib_results << result\r\n end \r\n\r\n return fib_results\r\n\r\nend",
"def fib\n first, second, i = 1, 1, 2\n while second.to_s.size < 1000\n first, second = second, first + second\n i = i + 1\n end \n puts \"#{i}\"\nend",
"def fib(n)\n n.times.each_with_object([0,1]) { |num, obj| obj << obj[-2] + obj[-1] }\nend",
"def iterative_nth_fib(n)\n return 1 if n <= 2\n a = 1\n b = 1\n i = 3\n while i <= n\n new_a = b\n b = a + b\n a = new_a\n i += 1\n end\n b\nend",
"def fibonacci_iter(n)\n return [] if n == 0\n return [0] if n == 1\n fibs = [0, 1]\n while fibs.count < n\n fibs << fibs[-2] + fibs[-1]\n end\n fibs\nend",
"def fibs(num)\n fibs = [0,1]\n until fibs.size == num\n fibs << (fibs[-1] + fibs[-2])\n end\n fibs\nend",
"def fibs(n)\n return n if n <= 1\n fibs(n - 1) + fibs(n - 2)\nend",
"def fibs(i, f = [])\n for n in 0...i + 1\n n < 2? f << n : f << f[n-1] + f[n-2]\n end\n return f\nend",
"def fibs(n)\n fib_array = [0, 1]\n\n (2..n).each do |i|\n fib_array << fib_array[i - 1] + fib_array[i - 2]\n end\n fib_array[0..n]\nend",
"def fib(n)\nend",
"def fib(n)\nend",
"def fib_it(n)\n fib_array = [1, 1]\n return fib_array if n == 2\n return [1] if n == 1\n\n (3..n).count { fib_array << fib_array[-2] + fib_array[-1] }\n\n fib_array\nend",
"def fibs(num)\n return [] if num == 0\n return [0] if num == 1\n\n fibs = [0, 1]\n \n while fibs.count < num\n fibs << fibs[-1] + fibs[-2]\n end\n\n fibs\nend",
"def iter_fib(n)\n return n if n == 0 || n == 1\n\n two_before = 0\n one_before = 1\n\n for i in 2..n\n current = two_before + one_before\n two_before = one_before\n one_before = current\n end\n one_before\nend",
"def fib_test(num)\n\n return 1 if num == 1\n return 1 if num == 2\n arr = [1, 1]\n (3..num).map {|n| arr << fib_num(n-1) + fib_num(n-2) }\n # next_num = fib_num(num-1) + fib_num(num-2)\n # fib_test(num-1) + [next_num]\nend",
"def fib(num)\n fib_seq_arr = []\n\n (0..num).each do |number|\n fib_seq_arr << number if number <= 1\n fib_seq_arr << fib_seq_arr[-1] + fib_seq_arr[-2] if fib_seq_arr.length > 1\n end\n return fib_seq_arr\nend",
"def fib(n)\n fib_0 = 0\n fib_1 = 1\n (0...n).each do \n temp = fib_0\n fib_0 = fib_1\n fib_1 = temp + fib_1\n end\n return fib_1\nend",
"def fibonacci(n)\n fib_array = []\n fib_index = 1\n a, b = 1, 1\n while fib_index <= n\n c = a\n a = b\n b = c + b\n fib_array << c\n fib_index += 1\n end\n return fib_array\nend",
"def fibs(n, ary = [0,1])\n n.times { ary << ary[-2] + ary[-1] until ary.length == n }\n return ary\nend",
"def fib_itera(n)\n a, b = 0, 1\n \n if n == 0\n return 0\n elsif n == 1\n return 1\n end\n i = 1\n while i < n\n result = a + b\n a = b\n b = result\n i += 1 \n end\n\n result\nend",
"def fibonacci(n)\n \nend",
"def fib(n)\n if n == 0 || n == 1\n return n\n end\n\n number1 = 0\n number2 = 1\n number3 = 0\n\n (2..n).each do |index|\n number3 = number1 + number2\n number1 = number2\n number2 = number3\n end\n\n return number3\nend",
"def fib(number)\n #start with 0 and 1\n fibonacci = [0,1]\n n = number - 2\n a = 0\n b = 1\n n.times do\n num = a\n a = b\n b += num\n fibonacci << b\n end\n return fibonacci\n end",
"def fib_seq(n)\n return \"#{n} isn't a positive integer number\" if n < 1\n\n fib_array = []\n\n n.times do |number|\n number > 1 ? fib_array.push(fib_array[number - 1] + fib_array[number - 2]) : fib_array.push(number)\n end\n\n fib_array\nend",
"def fibs(limit, n=2)\n\t@a ||= []\n\tf = fib(n)\n\tif f < limit \n\t\[email protected](f) \n\t\tn += 1\n\t\tfibs(limit, n)\n\telse\n\t\t@a\n\tend\nend",
"def fibs(n)\n list = [0, 1]\n if n == 0\n return []\n elsif n == 1\n return [0]\n elsif n == 2\n return [0, 1]\n else \n counter = 2\n while counter < n\n sum = 0\n list.each_with_index do |element, index|\n if index >= list.length - 2\n sum += element\n end\n end\n list.push(sum)\n counter += 1\n end\n end\n return list\nend",
"def fibonacci(n)\n \nend",
"def fibs(num)\n arry = [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144]\n arry[num]\nend",
"def iterative_fib (num)\n fib_arr = []\n (1..num).each do |i|\n if i == 1 || i == 2\n fib_arr << 1\n else\n fib_arr << fib_arr[-1] + fib_arr[-2]\n end\n end\n fib_arr\nend",
"def fib(number)\n\narr = [0, 1]\n\n\ti = 0\n\t\n\twhile i < number - 2\t\t\n\t\tarr.push(arr[i] + arr[i+1])\n\t\ti += 1\n\tend\n\t\narr\t\nend",
"def fib(n) \n if n == 0\n return 0\n else\n\tfib_0 = 0\n\tfib_1 = 1\n\t(1..(n-1)).each do \n\t\ttemp = fib_0\n\t\tfib_0 = fib_1\n\t\tfib_1 = temp + fib_1\n\t\t\n\tend\n\treturn fib_1\n end\nend",
"def fib(n)\n # your work here\nend",
"def fib_iter(n)\n return n if n <= 1\n\n a = 0\n b = 1\n\n 2.upto(n) do |i|\n tmp = b\n b = a + b\n a = tmp\n end\n\n b\nend",
"def fib(n)\n\tfib_array = [0]\n\ta = 0\n\tb = 1\n\tif n >= 1\n\t\tfib_array << 1\n\tend \n\twhile fib_array.length < n\n\t\tif n > 1\n\t c = a + b \n\t\t fib_array << c \n\t\t a = b \n\t\t b = c \n\t\tend\n\tend \n\treturn fib_array \nend",
"def fib(n)\n return 1 if n <= 2\n \n fib_index = 3\n a, b = 1, 1\n \n while fib_index <= n\n c = a + b\n a = b\n b = c\n fib_index += 1\n end\n \n c\nend",
"def fib(x)\n fib_nums = [0,1]\n number = x - 2\n number.times do\n fib_nums << fib_nums[-2] + fib_nums[-1]\n end\n p fib_nums\nend",
"def iterative_fib(num)\r\n a = 0\r\n b = 1\r\n\r\n num.to_i.times do\r\n temp = a\r\n a = b\r\n # Add up previous two numbers in sequence\r\n b = temp + b\r\n end\r\n\r\n return b\r\nend",
"def fib(n)\n\n fib_seq = [0, 1]\n\n while n > 2\n fib_seq << fib_seq[fib_seq.length - 1] + fib_seq[fib_seq.length - 2]\n n -= 1\n end\n\n return fib_seq\n\nend",
"def iterative_fibonacci(n)\r\n return [] if n == 0\r\n return [0] if n == 1\r\n\r\n fibs = [0,1]\r\n \r\n while fibs.count < n\r\n fibs << fibs[-1] + fibs[-2]\r\n end\r\n\r\n fibs\r\n end",
"def fib_it count\n prev = 0\n curr = 1\n for i in 0...count do\n tmp = curr\n curr += prev\n prev = tmp\n end\n prev\nend",
"def fib(x)\n fibo_number = [0, 1]\n (x - 2).times do\n n = fibo_number[-1] + fibo_number[-2]\n fibo_number << n\n end\n puts fibo_number\nend",
"def fib (n)\n # return appropriate starter values if n is 0 or 1\n if n == 0 \n return 0\n elsif n == 1\n return 1\n end\n # set up initial constants\n prevNum = 0\n currNum = 1\n # Loop through fibonacci numbers, starting at index 2.\n 2.upto(n) do\n nextNum = prevNum + currNum\n prevNum = currNum\n currNum = nextNum\n end\n return currNum\nend",
"def fibonacci(n)\r\n return [] if n < 1\r\n return [1] if n == 1\r\n vet = [0, 1]\r\n (n - 2).times{vet << vet[vet.size-1] + vet[vet.size-2]}\r\n return vet\r\nend",
"def sim_fib(n)\n return '0' if n == 0\n return '01' if n == 1\n\n sim_fib(n - 1) + sim_fib(n - 2)\nend",
"def fibo_finder(n)\n fib_array = [0, 1]\n (2..n).each do |i|\n fib_array << fib_array[i-1] + fib_array[i-2]\n end\n fib_array[n]\nend",
"def fibonacci(n)\n # raise NotImplementedError\n raise ArgumentError if n < 0 || n == nil #error if negative\n\n i = 0\n fib_array = [0, 1] #all fibonacci sequences begin with 0 and 1\n until fib_array.length == n+1 #until the correct index is reached\n fib_array.push fib_array[i] + fib_array[i+1]\n i += 1\n end\n return fib_array[n] #return number at requested index\nend",
"def fib(number)\n array = []\n if number == 0\n return array\n elsif number == 1\n array << 0\n return array\n elsif number == 2\n array << 0\n array << 1\n return array\n elsif number > 2\n index = 2\n array << 0\n array << 1\n while index < number\n array << array[index - 1] + array[index - 2]\n index += 1\n end\n return array\n end \nend",
"def fib_method(n)\r\n\tfib_array = []\r\n\ti = 0\r\n\t\twhile i < n do\r\n\t\t\tif i == 0 || i == 1\r\n\t\t\tfib_array.push(i)\r\n\t\t\telse\r\n\t\t\tfib_array.push(fib_array[i-2] + fib_array[i-1])\r\n\t\t end\r\n\t\ti +=1 \r\n\tend \r\n\tfib_array\r\nend",
"def fib(n)\n \n seq = []\n idx = 0\n loop do \n \n if idx == 0 \n seq.push(0) \n elsif idx == 1\n seq.push(1) \n else\n seq[idx] = seq[idx-1] + seq[idx-2]\n end\n\n break if idx == n\n idx +=1\n end\n\n return seq\n\nend",
"def fibs(n)\n arr = []\n i = 0\n while i < n\n if i < 1\n arr << 0\n elsif i == 1\n arr << 1\n else\n arr << arr[i-1] + arr[i-2]\n end\n i += 1\n end\n arr\nend",
"def nthFibonacci(n)\r\n fibonacci = []\r\n a = 0 \r\n b = 1\r\n\r\n while n >= fibonacci.length\r\n fibonacci.push(a)\r\n fibonacci.push(b)\r\n a = a + b\r\n b = a + b\r\n end\r\n return fibonacci[n]\r\nend",
"def fibs(n)\n array = [0,1]\n return array[0..n] if n <= 1\n 2.upto(n) do |i|\n item = array[i - 1] + array[i - 2]\n array << item\n end\n array\nend",
"def fib(n)\n return 0 if n == 0\n return 1 if n == 1\n\n [fib(n-1),fib(n-2)].reduce(:+)\n\t\nend",
"def fibo_finder(n)\n start = [0,1]\n n.times {|i| start[i + 2] = start[i] + start[i + 1]}\n start[n]\nend",
"def fibonacci (n)\r\n seq = [0, 1]\r\n \r\n (2..n).each do |i|\r\n seq.push seq[i-1] + seq[i-2]\r\n end\r\n \r\n return seq\r\nend",
"def fibonacci_number(n)\n #define nth Fibonacci term\n fibonacci_lst=[0,1] #F1=1,F2=1\n for i in 2..n\n fibonacci_lst[i]=fibonacci_lst[i-1]+fibonacci_lst[i-2]\n end\n return fibonacci_lst[n]\nend",
"def fibonacci( n )\r\n fib_nums = []\r\n return n if n <= 1\r\n fib_nums << fibonacci( n - 1 )\r\n fib_nums << fibonacci( n - 2 )\r\n p \"#{fib_nums}\"\r\nend",
"def fibonacci(n)\n fib_array = [0,1]\n\tfib = n - 2\n fib.times do |fib|\n fib_array << fib_array[-1] + fib_array[-2]\n end\n\n\tif fib_array.count < 20\n \tp fib_array\n else\n \tp fib_array.last \n end\t\nend",
"def find_fibonaccis(limit)\n fib_array = []\n i = 1\n while i <= limit\n first_num = fib_array[i-1] ||= 1 # 1, \n second_num = fib_array[i] ||= 1 # 1, \n result = first_num + second_num\n if result > limit\n break\n end\n fib_array << result\n i += 1\n end\n fib_array\nend",
"def fibs(n)\n arr = [0, 1]\n (n-1).times do\n arr << arr[-1] + arr[-2]\n end\n return arr\nend",
"def iterative_fib(num)\r\n\treturn num if num < 2\r\n\tfib = [0, 1]\t\r\n\t(2..num).each do |digit|\r\n\t\tx = fib[digit - 1] + fib[digit - 2]\r\n\t\tfib << x\r\n\tend\r\n\treturn fib.last\r\nend",
"def fibo(n)\n a, b, c = 0, 0, 0\n for i in 1..n\n c, b = b, a\n a = i== 1 ? 1 : b + c\n end\n return a\nend",
"def fibs(n)\n result = []\n penultimate = 0\n last = 1\n ## skips iteration if n = 0\n 1.upto(n) do |num|\n if num == 1\n result << penultimate\n elsif num == 2\n result << last\n else\n next_num = penultimate + last\n penultimate = last\n last = next_num\n result << next_num\n end\n end\n return result\nend",
"def fibonaci(n)\n\tfi= [1, 1]\n\t(n-1).times do\n\t\tfi << fi[1]+fi.shift\n\tend\n\treturn fi[0]\nend",
"def fibonacci_numbers(num) #method takes one argument. The amount of fibonacci numbers you wish to generate.\r\n\tfib_arr = [0,1] #the fibonacci sequence begins with integers 0 and 1\r\n\t(num-2).times {fib_arr << fib_arr[-1] + fib_arr[-2]} #because the first two numbers are given we subtract 2 from the number of times we want to push numbers into our fib_arr.\r\n#we add the last two numbers in the sequence togther and push that to the fib_arr\r\n\treturn fib_arr #return array with new numbers\r\nend",
"def fibo(n)\n (1..n).inject([]) { |memo, i| [1, 2].include?(i) ? memo << i : memo << (memo.last + i) }\nend"
] | [
"0.8179819",
"0.81324905",
"0.8102675",
"0.79911506",
"0.79887795",
"0.79661435",
"0.79661435",
"0.79661435",
"0.79661435",
"0.79661435",
"0.7954532",
"0.79141074",
"0.7870756",
"0.78506565",
"0.78427285",
"0.7836909",
"0.7835531",
"0.7833199",
"0.7813367",
"0.77798784",
"0.77785724",
"0.7773973",
"0.7740188",
"0.7736898",
"0.77341175",
"0.7731711",
"0.7723888",
"0.77229017",
"0.77178",
"0.77178",
"0.77172965",
"0.77101",
"0.7707889",
"0.77044106",
"0.7703113",
"0.7701434",
"0.7700121",
"0.76976335",
"0.76941663",
"0.76907843",
"0.7687702",
"0.7681934",
"0.76803464",
"0.7676438",
"0.7676438",
"0.7674147",
"0.7670781",
"0.76648563",
"0.7663325",
"0.7652746",
"0.76522654",
"0.76507294",
"0.7649068",
"0.7643323",
"0.76430804",
"0.7641925",
"0.763096",
"0.7624786",
"0.7623032",
"0.76210797",
"0.7619776",
"0.7617236",
"0.76095754",
"0.7607364",
"0.7607238",
"0.7603736",
"0.7601239",
"0.7588444",
"0.75825495",
"0.75821817",
"0.75705105",
"0.7569818",
"0.7564394",
"0.75635195",
"0.7560088",
"0.7557184",
"0.75560844",
"0.75499696",
"0.75367093",
"0.7530947",
"0.75306267",
"0.7525835",
"0.75230384",
"0.7521401",
"0.7520654",
"0.7518034",
"0.75179183",
"0.75149417",
"0.7514601",
"0.7507691",
"0.7506812",
"0.7505733",
"0.75035536",
"0.750306",
"0.75006205",
"0.74972343",
"0.7493936",
"0.74930704",
"0.7491568",
"0.7490619"
] | 0.782208 | 18 |
Now write another method fibs_rec which solves the same problem recursively. This can be done in just 3 lines | def fibs_rec(num)
# base cases 0 and 1
return [0] if num.zero?
return [0, 1] if num == 1
array = fibs_rec(num - 1)
array << array[-2] + array[-1]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fibs_rec(num, fib = [0,1])\n if num == 1\n 0\n elsif num == fib.length\n fib\n else\n result = fib[fib.length - 2] + fib[fib.length - 1]\n fib.push(result)\n fibs_rec(num, fib)\n end\nend",
"def fibs_rec(n, result = [0, 1])\n if n > 1\n result << result[-2] + result[-1]\n fibs_rec(n-1, result)\n end\n result\nend",
"def fibs_rec(n)\n n == 0 || n == 1 ? n : fibs_rec(n-1) + fibs_rec(n-2)\n fibs(n)\nend",
"def fibs_rec(n, result = [0, 1])\n\tif n > 1\n\t\tresult << result[-2] + result[-1]\n\t\tfibs_rec(n - 1, result)\n\tend\n\tresult\nend",
"def fibs_rec!(num, ary)\n ary[0] = 0 if ary.empty?\n return 0 if num == 0\n return ary[1] = 1 if num == 1\n ary << next_fib_term = fibs_rec!(num - 1, ary) + fibs_rec!(num - 2, [])\n next_fib_term \nend",
"def fibs_rec(n)\n if n == 1\n [0]\n elsif n == 2\n [0,1]\n else\n fibs_rec(n-1) << fibs_rec(n-1)[-1] + fibs_rec(n-1)[-2]\n end\nend",
"def fibs_rec(n)\n\treturn n if n <= 1\n\tfibs_rec(n-1) + fibs_rec(n-2)\nend",
"def fibs_rec(n)\n return n if n <= 1\n return fibs_rec(n-2) + fibs_rec(n-1)\nend",
"def fibs_rec(n, fib_array=[0,1])\n return [0] if n == 1\n return fib_array if fib_array.length == n\n fib_array << fib_array[-1] + fib_array[-2]\n fibs_rec(n, fib_array)\nend",
"def fibs_rec(i)\n return i if i <= 1\n fibs_rec(i-2) + fibs_rec(i-1)\nend",
"def fib_rec(n)\n return 0 if n == 1\n return 1 if n == 2\n fib_rec(n - 1) + fib_rec(n - 2)\nend",
"def fibs_rec(n)\n n <= 1 ? n : fibs_rec(n - 1) + fibs_rec(n - 2)\nend",
"def fibs_rec n\n (n < 3) ? [1]*n : fibs_rec(n - 1) << fibs_rec(n - 1)[-1] + fibs_rec(n - 1)[-2]\nend",
"def fibs_rec(n)\n if n <= 2 then return n == 2 ? [0,1] : [0] end\n a = fibs_rec(n-1)\n return a << a[-1] + a[-2]\n\nend",
"def faster_fib_helper(solution_arr, current, n)\n # n is negative\n if n < 0\n raise ArgumentError, \"Fib(n) error - n must be 0 or larger.\"\n\n # base cases n = 0 , n = 1\n elsif n == 0 || n == 1\n return n\n\n # the other case we check for is if current has reached n\n # this means we can end the recursion\n # and the final return value will be the sum of the previous two\n # elements in solution_arr we have been saving up until this point\n elsif current == n\n # n or current works here since they're the same value at this point\n # can do this because now the array only holds two elements at a time.\n return solution_arr[0] + solution_arr[1]\n\n # otherwise we shovel the next fib # to the back of the array\n # again, found by summing the two elements in front\n # and recusively call the helper with current incremented\n else\n # we only have current number of elements at this point\n # we have to specifically save this in solution_arr, if we do it in the function call\n # it will create a new slot instead of re-using the old one i think\n solution_arr = [solution_arr[1], solution_arr[0] + solution_arr[1]]\n return faster_fib_helper(solution_arr, current + 1, n)\n end\n\nend",
"def fibs_rec(n)\n\tarr = [0,1]\n\tif n == 1\n\t\treturn arr[0]\n\telsif n == 2\n\t\treturn arr\n\telse\n\t\tarr = fibs_rec(n-1)\n\t\tarr << arr[-1] + arr[-2]\n\tend\n\nend",
"def fibs_rec(num)\n return [] if num == 0\n return [0] if num == 1\n return [0, 1] if num == 2\n\n prev_nums = fibs_rec(num - 1)\n prev_nums << prev_nums[-1] + prev_nums[-2]\nend",
"def fibs_rec2(n, i = 0, j = 1)\n\tn == 0 ? i : fibs_rec2(n-1, j, i+j)\nend",
"def fib_rec(n)\n # if n == 0\n # return 0\n # elsif n == 1\n # return 1\n # else\n # return fib_recur(n - 1) + fib_recur(n - 2)\n # end\n return [0] if n == 0\n return [0, 1] if n == 1\n [] << fib_rec(n - 1)\nend",
"def fibs_rec(i, j, cnt, n)\n if(cnt > n)\n return i\n else\n k = i + j\n print i, \", \"\n i = j\n j = k\n fibs_rec(i, j, cnt += 1, n)\n end\nend",
"def fibs_rec(number)\n return [0] if number.zero?\n\n return [0, 1] if number == 1\n\n result = fibs_rec(number - 1)\n result << result[-1] + result[-2]\nend",
"def fibs_rec(n, sequence = [0, 1])\n\tif n == 0\n\t\treturn 0\n\telsif n == 1\n\t\treturn 1\n\telse\n\t\tnew_num = sequence[-2] + sequence[-1]\n\t\tsequence << new_num\n\t\tfibs_rec(n-1, sequence)\n\tend\n\tsequence\nend",
"def rec_fib(n)\r\n return [0] if n == 0\r\n return [0,1] if n ==1\r\n return [0,1,1] if n ==2\r\n \r\n rec_fib(n-1) << (rec_fib(n-1)[-1] + rec_fib(n-2)[-1]) \r\n\r\nend",
"def fibs_rec(n, arr = [])\n arr.unshift(n - 1 <= 1 ? n - 1 : fibo(n - 2) + fibo(n - 3))\n return n - 1 > 0 ? fibs_rec(n - 1, arr) : arr\nend",
"def fib_rec(n)\n return nil if n < 1\n return [1] if n == 1\n return [1, 1] if n == 2\n current = [1, 1]\n recursive = fib_rec(n - 1)\n (recursive.length - 1).times do |el|\n current << recursive[el] + recursive[el + 1]\n end\n current\nend",
"def rec_fib(n)\n return [1] if n == 1\n return [1, 1] if n == 2\n fibs = rec_fib(n - 1)\n fibs << (fibs[-1] + fibs[-2])\nend",
"def fibs_rec(number, array=[1])\n\t\n\tif number>2 then array.push(array[-2]+array[-1]); \n\t\tfibs_rec(number-1, array);\n\telsif number==2\n\t\treturn [1,1]\n\tend\n\treturn array\nend",
"def fib_rec( n )\n $call_count += 1\n # Define the base case\n if n < 2\n return 1\n else\n # do the recursive calculation:\n return fib_rec( n - 1 ) + fib_rec( n - 2 )\n end\n\nend",
"def fib_rec(n)\n return (0..n).reduce([]) { |a, v| a << v } if n < 2\n prev = fib_rec(n - 1)\n prev << prev[-2] + prev[-1]\nend",
"def fibonacii_rec(n)\n return [0] if n == 1\n return [0, 1] if n == 2\n fibonacii_rec(n - 1) + [fibonacii_rec(n - 1)[-1] + fibonacii_rec(n - 1)[-2]]\nend",
"def fib_rec(n)\n return [0] if n == 1\n return [0, 1] if n == 2\n prev = fib_rec(n - 1)\n next_fib = prev[-1] + prev[-2]\n prev << next_fib\nend",
"def fib_helper(solution_arr, current, n)\n # n is negative\n if n < 0\n raise ArgumentError, \"Fib(n) error - n must be 0 or larger.\"\n\n # base cases n = 0 , n = 1\n elsif n == 0 || n == 1\n return n\n\n # the other case we check for is if current has reached n\n # this means we can end the recursion\n # and the final return value will be the sum of the previous two\n # elements in solution_arr we have been saving up until this point\n elsif current == n\n # n or current works here since they're the same value at this point\n return solution_arr[n - 1] + solution_arr[n - 2]\n\n # otherwise we shovel the next fib # to the back of the array\n # again, found by summing the two elements in front\n # and recusively call the helper with current incremented\n else\n # we only have current number of elements at this point\n solution_arr << (solution_arr[current - 1] + solution_arr[current - 2])\n return fib_helper(solution_arr, current + 1, n)\n end\nend",
"def fibs_rec(count)\n return [0,1,1].take(count) if count < 3\n prev_fibs = fibs_rec(count - 1)\n prev_fibs + [prev_fibs[-2] + prev_fibs[-1]]\nend",
"def fiboRec(no)\n if no == 0\n return [0]\n elsif no == 1\n return fiboRec(0).push(1)\n else\n arr = fiboRec(no-1)\n return arr.push(arr[no-1] + arr[no-2])\n end\nend",
"def fibs (n) #Non-recursive\n\n\t# n = number of Fibonacci sequence members.\n\t# 0, 1, 1, 2, 3, 5, 8, 13, ..\t\n\tfib_seq = []\n\t(0..n).each do |i|\n\t\tif i == 0\n\t\t\tfib_seq << 0\n\t\telsif i == 1\n\t\t\tfib_seq << 1\n\t\telse\n\t\t\tfib_seq << fib_seq[i-2] + fib_seq[i-1]\n\t\tend\n\tend\n\tfib_seq\nend",
"def fib_rec(n)\n return n if n <= 3\n\n return fib_rec(n-1) + fib_rec(n-2)\nend",
"def fib(n)\n return 0 if n == 0\n return 1 if n == 1\n \n\n fib(n - 1) + fib(n - 2)\nend",
"def recursive_fib(n, a=0, b=1)\r\n if n == 0\r\n return a\r\n else\r\n recursive_fib(n - 1, b, a + b)\r\n end\r\nend",
"def fibs(n)\nend",
"def fibs_rec(n)\n case n\n when 0\n return []\n when 1\n return [0]\n when 2\n return [0,1]\n else\n array = fibs_rec(n-1)\n # offset to n-3 and n-2 to acccount for 0 position start\n array.push(array[n-3] + array[n-2])\n return array\n end\nend",
"def sim_fib(n)\n return '0' if n == 0\n return '01' if n == 1\n\n sim_fib(n - 1) + sim_fib(n - 2)\nend",
"def fib_rec(sequence_length)\n if sequence_length == 0\n return [0]\n elsif sequence_length == 1\n return [0,1]\n end\n\n return fib_rec(sequence_length - 1) << fib_rec(sequence_length - 1)[-1] + fib_rec(sequence_length - 2)[-1]\n\n\nend",
"def fibs(n)\n return n if n <= 1\n fibs(n - 1) + fibs(n - 2)\nend",
"def recursive_fib n\n return 1 if n == 1 || n == 2\n recursive_fib(n-1) + recursive_fib(n-2)\nend",
"def fibb(i)\n if i==0 \n return 0\n elsif i==1\n return 1\n else\n prev1=0\n prev2=1\n curr = 0\n #(2..i).each do |x|\n (2..i).each do #so it works w/o x as well\n #2.upto(i) do\n curr = prev1 + prev2 #3 = 1 + 2\n prev1 = prev2 # 1 := 2\n prev2 = curr # 2 := 3\n end\n end\n return curr\nend",
"def show_fib(n)\n return 0 if n == 0\n return 1 if n == 1\n show_fib(n-1) + show_fib(n-2)\nend",
"def fib_r( n )\n\n $calls += 1\n\n puts \"fib_r( #{n} )\"\n\n # Define the base case (no more recursion)\n if n < 2\n puts \"return: fib_r( #{n} ) = 1\"\n return 1\n else\n # Recursive case\n\n if $memo.has_key?(n - 1)\n first = $memo[n-1]\n else\n first = fib_r( n - 1 )\n end\n\n if $memo.has_key?(n - 2)\n second = $memo[n-2]\n else\n second = fib_r( n - 2 )\n end\n\n\n puts \"return: fib_r(#{ n - 1 }) = #{first}, fib_r(#{ n - 2 }) = #{second}\"\n\n $memo[ n ] = first + second\n\n return first + second\n end\n\nend",
"def fibonacci_rec(n)\n return [1] if n == 1\n return [1, 1] if n == 2\n return [1, 1,2] if n == 3 \n fibonacci_rec(n-2) + [fibonacci_rec(n-1)[-1]] + [fibonacci_rec(n-1)[-2..-1].sum]\nend",
"def fib(n)\n # your implementation here\n if n==0 then\n 1\n elsif n==1 then\n 1\n else \n fib(n-2) + fib(n-1)\n end\nend",
"def find_fib_nth(n)\n if n == 0\n 1\n elsif n == 1\n 1\n else\n return (find_fib_nth(n - 2) + find_fib_nth(n - 1))\n end\nend",
"def fib(solutions, current, n) \n\n if n == 0 || n ==1 \n return n\n end \n\n if current == n \n return solutions[n-1] + solutions[n-2]\n end\n\n solutions << solutions[current-1] + solutions[current-2]\n\n return fib(solutions, current + 1, n)\nend",
"def fibonacci_rec(n)\n return [] if n == 0\n return [1] if n == 1\n return [1, 1] if n == 2\n\n fibs = fibonacci_rec(n - 1)\n last = fibs[-1]\n second_last = fibs[-2]\n\n fibs << last + second_last\nend",
"def fibo_finder(n) \n if n == 0\n return 0\n elsif n ==1\n return 1\n else\n return (fibo_finder(n - 1) + fibo_finder(n - 2))\n end\nend",
"def r_fib(n)\n return [1] if n == 1 \n return [1,1] if n == 2\n res = r_fib(n-1)\n res << res[-1] + res[-2]\nend",
"def fibs(n)\n # fibs = [0, 1]\n # return [0] if n == 1\n # return fibs if n == 2\n\n # (n - 2).times do \n # fibs << fibs[-1] + fibs[-2]\n # end\n # return fibs\n\n return 0 if n == 1\n return 1 if n == 2\n\n return fibs(n - 1) + fibs(n - 2)\nend",
"def fib(num)\n if num == 0\n return 0\n elsif num == 1\n return 1\n else\n result = fib(num - 1) + fib(num - 2)\n return result\n end\nend",
"def fibs_sum(n)\n\nend",
"def fibs_sum(n)\n\nend",
"def fibs_sum(n)\n\nend",
"def fibs_sum(n)\n\nend",
"def fibs_sum(n)\n\nend",
"def recursive_fib(number)\n _recursive_fib(number, 0, 1)\nend",
"def fib(n)\n if n == 0\n 0\n elsif n == 1 || n == 2\n 1\n else fib(n - 2) + fib(n - 1)\n end\nend",
"def fibo_finder(n)\n if n <= 1\n \tn\n else\n fibo_finder(n-1) + fibo_finder(n-2)\n end\nend",
"def _fib_dynamic(n, fibs)\n return 0 if n == 0\n return 1 if n == 1\n\n\n # puts \"BEFORE: N(#{n}: #{fibs}\"\n\n if fibs[n-1].nil?\n # puts \"calculating n1 for (#{n})\"\n fibs[n-1] = _fib_dynamic(n-1, fibs)\n end\n\n if fibs[n-2].nil?\n # puts \"calculating n2 for (#{n})\"\n fibs[n-2] = _fib_dynamic(n-2, fibs)\n end\n\n # puts \"AFTER: N(#{n}: #{fibs}\"\n return fibs[n-1] + fibs[n-2]\nend",
"def fibs(n)\n return [] if n == 0\n return [0] if n == 1\n return [0, 1] if n == 2\n prev_fibs = fibs(n - 1)\n prev_fibs << (prev_fibs[-1] + prev_fibs[-2])\nend",
"def fibs_sum(n) # my version\n return 1 if n == 1\n return 2 if n == 2\n\n current = single_fib(n)\n current += fibs_sum(n - 1)\nend",
"def fancy_fib(num, arr = [0,1])\n if arr.length != num\n arr= fancy_fib(num, arr.push(arr[-1]+ arr[-2]))\n end\n arr\nend",
"def fib(n)\n return 0 if n == 0\n return 1 if n == 1\n\n return fib(n-1) + fib(n-2)\nend",
"def fibonacci(n, fibs = {1 => 1, 2 => 1})\n return nil if n <= 0\n return fibs[n] if fibs[n]\n\n fib = fibonacci(n - 1, fibs) + fibonacci(n - 2, fibs)\n fibs[n] = fib\n\n fib\n end",
"def fib(n) \n if n == 0\n return 0\n else\n\tfib_0 = 0\n\tfib_1 = 1\n\t(1..(n-1)).each do \n\t\ttemp = fib_0\n\t\tfib_0 = fib_1\n\t\tfib_1 = temp + fib_1\n\t\t\n\tend\n\treturn fib_1\n end\nend",
"def fib(n)\n return 0 if n == 0\n return 1 if n == 1\n return 1 if n == 2\n # return 2 if n == 3\n fib(n - 1) + fib(n - 2)\nend",
"def fibs fib1 = 0, fib2 = 1\r\n fib1, fib2 = fib2, fib1 + fib2\r\n return 0 if fib1 > 4e6\r\n fib1 % 2 == 0 ? fibs(fib1, fib2) + fib1 : fibs(fib1, fib2)\r\nend",
"def fib(n)\n if n == 1\n return [0]\n elsif n == 2\n return [0, 1]\n else\n one_less = fib(n-1)\n one_less << one_less[-1] + one_less[-2]\n return one_less\n end\n\nend",
"def fibs(n)\n return [0] if n == 1\n return [0, 1] if n == 2\n fibs = fibs(n - 1)\n fibs << fibs[-2] + fibs[-1]\nend",
"def fib(n)\n #if n > 4000000\n #\treturn puts n\n #end\n return n if (0..1).include? n\n fib(n-1) + fib(n-2) if n > 1\nend",
"def fibs(num)\n return [] if num == 0\n return [0] if num == 1\n return [0, 1] if num == 2\n\n prev_fibs = fibs(num - 1)\n prev_fibs << prev_fibs[-1] + prev_fibs[-2]\n\n prev_fibs\nend",
"def fib(n)\n return 1 if n == 2\n return 0 if n == 1\n\n fib(n-1) + fib(n-2)\nend",
"def iterative_fibs(n)\n return [] if n == 0\n return [0] if n == 1\n fibs = [0, 1]\n until fibs.length == n\n fibs << fibs[-1]+ fibs[-2]\n end\n fibs\nend",
"def fib(n, a = 0, b = 1)\n return a if n == 0\n return b if n == 1 && a == 0\n\n fib(n - 1, b, a + b)\nend",
"def fib(n)\n return 0 if n == 0\n fib_helper(0, 1, n-1)\nend",
"def recursive_fib(num)\r\n\treturn num if num == 0 || num == 1\r\n\trecursive_fib(num - 1) + recursive_fib(num - 2)\r\nend",
"def fibo_rec(n)\n return n <= 1 ? n : fibo(n - 1) + fibo(n - 2)\nend",
"def fib(n)\n return 0 if n <= 0\n return 1 if n == 1\n\n fib(n - 1) + fib(n - 2)\nend",
"def fib(n)\r\n if n == 1 then\r\n 10\r\n elsif n == 0 then\r\n 1\r\n else\r\n fib(n - 1) + fib(n - 2)\r\n end\r\nend",
"def naive_fib(number)\n return -1 if number < 0\n return 0 if number == 0# && (@operations += 1)\n return 1 if number == 1# && (@operations += 1)\n naive_fib(number-1) + naive_fib(number-2)\nend",
"def fibo_rec(target_number)\n if target_number<1\n\t$series[0]=0\n return 0\n \n elsif target_number=1\n \t$series[1]=1\n \tfibo_rec 0\n return 1\n\n else\n\t\tans=fibo_rec(target_number-1)+(fibo_rec(target_number-2))\t\n\t\t$series[target_number]=ans\n\t\treturn ans\n\tend\n\treturn $series\nend",
"def fib(n)\n \nend",
"def fib(n)\n # your work here\nend",
"def fib(n)\n if n == 0\n return [0]\n elsif n == 1\n return [0, 1]\n else\n fib(n-1) << fib(n-1)[-2] + fib(n-1)[-1]\n end\nend",
"def fib(n)\n if n == 0 || n == 1\n return n\n else\n fib(n - 1) + fib(n - 2)\n end\n end",
"def fib(n)\n\n if n == 1 or n == 2\n return 1\n else\n return fib(n-1) + fib(n-2)\n end\n\nend",
"def fib(sum, curr, prev)\n if curr > 4_000_000\n puts sum\n return\n end\n if curr % 2 == 0\n sum += curr\n end\n fib(sum, prev + curr, curr)\nend",
"def fibs(n) ; PHI**n - PHA**n ; end",
"def iterative_fib (num)\n fib_arr = []\n (1..num).each do |i|\n if i == 1 || i == 2\n fib_arr << 1\n else\n fib_arr << fib_arr[-1] + fib_arr[-2]\n end\n end\n fib_arr\nend",
"def fib(n)\n # return base cases of 0, 1\n return n if n == 0 || n == 1\n # call the function again to add the previous two numbers\n return fib(n-2)+fib(n-1)\nend",
"def fib(n)\n if (n <= 1) \n return n;\n else\n return fib(n-1)+fib(n-2);\n end\nend",
"def fibs(i, f = [])\n for n in 0...i + 1\n n < 2? f << n : f << f[n-1] + f[n-2]\n end\n return f\nend",
"def fib \n arr = [0, 1]\n\n while arr[-1] + arr[-2] <= 4_000_000\n arr << arr[-1] + arr[-2]\n end\n arr.select(&:even?).inject(:+)\nend",
"def get_nth_fib(n)\n if n == 0 || n == 1\n return 0\n elsif n == 2\n return 1\n else\n return get_nth_fib(n-1) + get_nth_fib(n-2)\n end\n\nend"
] | [
"0.8324548",
"0.80892473",
"0.8088708",
"0.8064074",
"0.8042706",
"0.79955125",
"0.7937973",
"0.7918121",
"0.78814024",
"0.7879105",
"0.7877967",
"0.78698117",
"0.7847271",
"0.78340495",
"0.78315073",
"0.7810743",
"0.7729339",
"0.7728065",
"0.7709655",
"0.77081597",
"0.76709944",
"0.7653932",
"0.76514405",
"0.7645504",
"0.76104164",
"0.7601553",
"0.7585521",
"0.7570844",
"0.75435424",
"0.75206035",
"0.7514376",
"0.7499883",
"0.74852407",
"0.74754226",
"0.74728835",
"0.7467033",
"0.7428892",
"0.7428796",
"0.7425657",
"0.74121225",
"0.7410566",
"0.7400582",
"0.7370596",
"0.7357743",
"0.7336675",
"0.73250157",
"0.7310017",
"0.73099786",
"0.73064566",
"0.73022485",
"0.7289233",
"0.72869927",
"0.728345",
"0.72813857",
"0.7269806",
"0.7260961",
"0.7259285",
"0.7259285",
"0.7259285",
"0.7259285",
"0.7259285",
"0.72427136",
"0.7241923",
"0.723288",
"0.7231519",
"0.7229887",
"0.7225785",
"0.72253597",
"0.7219361",
"0.72184974",
"0.7218281",
"0.7214883",
"0.7212928",
"0.7209631",
"0.7208783",
"0.7205616",
"0.7203665",
"0.7198539",
"0.7197233",
"0.7191324",
"0.71909994",
"0.718682",
"0.71844465",
"0.7170181",
"0.7163152",
"0.71614265",
"0.71566427",
"0.71558815",
"0.715384",
"0.7134603",
"0.71341246",
"0.7132967",
"0.71326387",
"0.7130396",
"0.71300274",
"0.7129824",
"0.7125016",
"0.7121147",
"0.7120953",
"0.7117806"
] | 0.77247757 | 18 |
GET /purchases GET /purchases.json | def index
default = 1
page = params.fetch(:page, default)
@purchases = Purchase.mine(current_user, page)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @purchases = Purchase.where(user_id: get_current_user.id.to_i)\n\n render json: @purchases\n end",
"def index\n @purchases = Purchase.find_all_by_user_id(current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @purchases }\n end\n end",
"def index\n @purchases = Purchase.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @purchases }\n end\n end",
"def index\n @purchases = Purchase.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @purchases }\n end\n end",
"def index\n @purchases = current_user.purchases\n end",
"def index\n @purchases = current_user.purchases.all\n end",
"def index\n # We'll need to page this later!\n @purchases = current_user.purchases.all\n end",
"def index\n @purchases = purchases.recent\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @purchases }\n end\n end",
"def index\n @purchases = Purchase.all.order(purchase_date: :desc).order(created_at: :desc).paginate(:page => params[:page], per_page: 10)\n\n render json: {purchases: @purchases, total_pages: @purchases.total_pages, current_page: @purchases.current_page}\n end",
"def index\n @purchases=current_user.purchases\n end",
"def index\n @purchases = Purchase.all\n end",
"def index\n @purchases = Purchase.all\n end",
"def index\n @purchases = Purchase.all\n end",
"def index\n @orders = current_user.purchases\n end",
"def index\n @purchases = Purchase.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @purchases }\n end\n end",
"def show\n render json: @purchase_list\n end",
"def show\n @user = User.find(params[:user_id])\n @purchased_item = @user.purchased_items.find(params[:id])\n json_response(@purchased_item)\n end",
"def index\n @purchases = Purchase.all.includes(:products)\n end",
"def index\n @purchases = Purchase.all.includes(:products)\n end",
"def show\n @purchase = Purchase.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @purchase }\n end\n end",
"def show\n @purchase = Purchase.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @purchase }\n end\n end",
"def show\n @purchase = Purchase.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @purchase }\n end\n end",
"def show\n @purchase = Purchase.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @purchase }\n end\n end",
"def show\n @purchase = Purchase.find(params[:purchase_id])\n @purchase_item = @purchase.purchase_items.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @purchase_item }\n end\n end",
"def index\n @analytics_purchases = AnalyticsPurchase.all\n end",
"def show\n @shop_purchase = Shop::Purchase.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shop_purchase }\n end\n end",
"def show\n @purchaseorder = Purchaseorder.find(params[:id])\n @purchaseorder_items = @purchaseorder.purchaseorder_items.paginate(page: params[:page])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @purchaseorder }\n end\n end",
"def index\n @purchase_orders = current_user.purchase_orders\n @purchase_orders = @purchase_orders.map{ |purchase_order| purchase_order.attributes }\n render json: @purchase_orders\n end",
"def show\n render json: @purchase, methods: [:inventories]\n end",
"def index\n set_purchases\n @purchase = Purchase.new\n end",
"def index\n @book_purchases = BookPurchase.all\n end",
"def index\n @purchase_lists = PurchaseList.all\n render json: @purchase_lists\n end",
"def show\n @purchase = Purchase.find(params[:id])\n\n end",
"def index\n @ticket_purchases = TicketPurchase.all\n end",
"def my_purchases\n @orders = Effective::Order.deep.purchased_by(current_user)\n EffectiveOrders.authorized?(self, :index, Effective::Order.new(user: current_user))\n end",
"def index\n @purchases = Purchase.where(student_id: current_user.id)\n end",
"def history\n # retrieves a paginated list of the current user's purchases\n @purchases = current_user.purchases.page params[:page]\n end",
"def create\n @purchases = current_user.profile.purchases.new(purchases_params)\n\n respond_to do |format|\n if @purchases.save\n format.html { redirect_to purchases_url, notice: 'Purchase created with success.' }\n format.json { render :show, status: :created, location: @purchases }\n else\n format.html { render :new }\n format.json { render json: @purchases.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @purchased_items = PurchasedItem.all\n end",
"def purchases\n @orders = Order.all.where(buyer: current_user).order(\"created_at DESC\")\nend",
"def purchases(options = {})\n\t\t\twarn \"[DEPRECATED] Gateway#purchases is deprecated, please use Purchase.find instead\" unless options[:silence]\n\t\t\tModels::Purchase.find(options)\n\t\tend",
"def index\n if params.has_key?(:character_id)\n @character = Fundamental::Character.find(params[:character_id])\n raise ForbiddenError.new('Access Forbidden') unless admin? || staff? || current_character == @character\n raise NotFoundError.new('Page Not Found') if @character.nil?\n @shop_purchases = @character.purchases\n else\n raise ForbiddenError.new('Access Forbidden') unless admin? || staff?\n @shop_purchases = Shop::Purchase.all\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shop_purchases }\n end\n end",
"def show\n @material_purchase = MaterialPurchase.get(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @material_purchase }\n end\n end",
"def purchase_show\n if params[:product_id] == '0'\n @items = session[:cart]\n else\n @items = []\n @items << { 'product' => params[:product_id], 'quantity' => session[:quantity] }\n end\n @sum = 0\n @count = 0\n @items.each do |item|\n product = Product.find(item['product'])\n @sum += product.price * item['quantity'].to_i\n @count += item['quantity'].to_i\n end\n @address = BillAddress.find(params[:bill_address_id])\n @user = current_user\n end",
"def find_purchases\n \n if params[:id] \n purchase = Purchase.find_by_id(params[:id])\n @consumer_id = purchase.consumer_id if purchase\n elsif params[:consumer_id] \n @consumer_id = params[:consumer_id]\n else\n @consumer_id = nil\n end\n\n @purchases = Purchase.with_info(current_payer.id, @consumer_id) \n @pendings = @purchases.pending \n @pendings_count = @pendings.count\n \n end",
"def index\n @purchase_orders = PurchaseOrders.all\n end",
"def show\n unless @merchant\n render_404\n return\n end\n\n return if !authorize_merchant\n # if merchant_id is same as logged in\n @products = @merchant.products\n # orders\n @paid = @merchant.order_items.where(status: \"paid\")\n @complete = @merchant.order_items.where(status: \"complete\")\n @canceled = @merchant.order_items.where(status: \"canceled\")\n\n @purchases = @merchant.user.orders\n\n end",
"def show\n @purchase_order_item = PurchaseOrderItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @purchase_order_item }\n end\n end",
"def new\n @purchase = current_user.purchases.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @purchase }\n end\n end",
"def index\n @purchaseorders = Purchaseorder.all\n end",
"def show\n authorize @purchase_order\n render json: @purchase_order.attributes\n end",
"def show\n @purchase = Purchase.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @purchase }\n end\n end",
"def index\n @purchase_entries = PurchaseEntry.all\n end",
"def index\n @purchasedetails = Purchasedetail.all\n end",
"def index\n @user = User.find(params[:user_id])\n count = 0\n\n if(params.key?(\"title\"))\n @purchased_items = @user.purchased_items.where(title: params[:title])\n elsif(params.key?(\"price\"))\n @purchased_items = @user.purchased_items.where(price: params[:price])\n elsif(params.key?(\"inventory_count\"))\n @purchased_items = @user.purchased_items.where(inventory_count: params[:inventory_count])\n elsif(params.key?(\"id\"))\n @purchased_items = @user.purchased_items.where(id: params[:id])\n else\n @purchased_items = @user.purchased_items.all\n count = 1\n end\n\n if(count == 1)\n json_response_with_price(@total_price, @purchased_items)\n else\n json_response(@purchased_items)\n end\n end",
"def index\n @purchase_orders = PurchaseOrder.all\n end",
"def index\n @purchase_orders = PurchaseOrder.all\n end",
"def index\n @purchase_orders = PurchaseOrder.all\n end",
"def index\n @purchase_orders = PurchaseOrder.all\n end",
"def index\n @purchase_orders = PurchaseOrder.all\n end",
"def show\n @purchase_receipt = PurchaseReceipt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @purchase_receipt }\n end\n end",
"def show\n @purchasing_ad = PurchasingAd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @purchasing_ad }\n end\n end",
"def show\n @purchased_items = @sales_order.purchased_items\n end",
"def index\n @purchases = Purchase\n .where(\"EXTRACT(MONTH FROM transaction_date)=EXTRACT(MONTH FROM CURRENT_DATE) AND EXTRACT(YEAR FROM transaction_date)=EXTRACT(YEAR FROM CURRENT_DATE)\")\n .order(:created_at).reverse_order\n .pagination(params[:page])\n\n @suppliers = Supplier.order(:name)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @purchases }\n format.js\n end\n end",
"def show\n @purchase_requisition = PurchaseRequisition.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @purchase_requisition }\n end\n end",
"def index\n @purchase_data = PurchaseDatum.all\n end",
"def purchase(id)\n response = Shippo::API.post(\"#{url}/#{CGI.escape(id)}/purchase\")\n self.from(response)\n end",
"def show\n @purchases = Purchase.where(sale_id: @sale.id)\n @running_total = 0\n end",
"def billing\n request('billing', :get)\n end",
"def dashboard_purchase_orders_bidding\n user_id = current_user.id\n page_info = params[:page]\n \n @bidding_orders = OrdersHelper.my_purchases(user_id, 1, page_info)\n render \"dashboard/dashboard_purchases\" and return\n end",
"def index\n @q = Purchase.search params[:q]\n @purchase_scope = @q.result(:distinct => true)\n @purchases = @purchase_scope.includes(:basket => {:items => :product} ).paginate( :page => params[:page],:per_page => 20 ).to_a\n end",
"def create\n @purchase = Purchase.new(purchase_params)\n\n if @purchase.save\n render json: @purchase, status: :created, location: @purchase\n else\n render json: {errors: @purchase.errors}, status: :unprocessable_entity\n end\n end",
"def index\n if !@ok\n redirect_to '/admin'\n return\n end\n purchases = AdminSearchForm.search_purchases((params[:search] ? params[:search] : {:ordering => 0, :desc => 'true'}))\n @purchases = purchases.page(params[:page])\n end",
"def new\n @purchase = Purchase.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @purchase }\n end\n end",
"def new\n @purchase = Purchase.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @purchase }\n end\n end",
"def new\n @purchase = Purchase.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @purchase }\n end\n end",
"def new\n @product = Product.find(params[:product_id])\n @purchase = Purchase.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @purchase }\n end\n end",
"def destroy\n @purchase = @customer.purchases.find(params[:id])\n if @purchase.destroy\n render status: 200, json: { message: \"Purchase deleted.\" }\n else\n render status: 500, json: { message: \"Purchase could not be deleted.\" }\n end\n end",
"def show\n @breadcrumb = 'read'\n @product = $product\n @supplier = $supplier\n @purchase_price = PurchasePrice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @purchase_price }\n end\n end",
"def purchase\n @priceplans = Admin::Priceplan.all \n end",
"def index\n @purchase_options = PurchaseOption.all\n end",
"def destroy\n @purchases.destroy\n respond_to do |format|\n format.html { redirect_to purchases_url, notice: 'Purchase deleted with success.' }\n format.json { head :no_content }\n end\n end",
"def index\n\n @soaps = Soap.find(:all)\n @user = User.find(:first)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @purchase }\n end\n end",
"def show\n render json: @pricing\n end",
"def show\n @purchase_item_status = PurchaseItemStatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @purchase_item_status }\n end\n end",
"def set_purchase\n @purchase = current_resource_owner.purchases.find(params[:id])\n end",
"def index\n @group = Group.find(params[:group_id])\n @purchases = Purchase.all\n end",
"def data_from_purchases(purchases)\n\ttotal_of_sales = purchases.map { |hash| hash['price']}.reduce(:+) # sum over prices\n\ttotal_of_purchases = purchases.length # number of purchases\n\treturn total_of_purchases, total_of_sales\nend",
"def new\n @shop_purchase = Shop::Purchase.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @shop_purchase }\n end\n end",
"def products\n @page_title = \"Purchased Products - #{@customer.name} - Customers\"\n if params[:reading_level_id].blank? && params[:category_id].blank?\n options = {}\n else\n conditions = []\n conditions << \"products.reading_level_id = :reading_level_id\" unless params[:reading_level_id].blank?\n conditions << \"cp.category_id = :category_id\" unless params[:category_id].blank?\n options = { :conditions => [ conditions.join(' and '), \n { :reading_level_id => params[:reading_level_id], :category_id => params[:category_id] } ] \n }\n end\n @purchases = @customer.purchased_products(options).group_by {|p| p.name }\n end",
"def purchase\n response = GATEWAY.purchase(price_in_cents, credit_card, purchase_options)\n transactions.create!(:action => \"purchase\", :amount => price_in_cents, :response => response)\n #UserMailer.ordered(\"google.com\", response.params.to_s, User.find(cart.user_id), cart).deliver\n cart.update_attribute(:purchased_at, Time.now) if response.success?\n response.success?\n end",
"def dashboard_purchase_orders\n user_id = current_user.id\n #status = params[:status]\n page_info = params[:page]\n @user = current_user\n \n @bidding_orders = OrdersHelper.my_purchases(user_id, 1, page_info)\n #@forpaid_orders = OrdersHelper.my_purchases(user_id, 2, page_info)\n #@complete_orders = OrdersHelper.my_purchases(user_id, 3, page_info)\n #@all_orders = OrdersHelper.my_purchases(user_id, nil, page_info)\n #@closed_orders = OrdersHelper.my_purchases(user_id, -1, page_info)\n \n # get counts for all status orders\n @bidding_orders_count = OrdersHelper.get_purchase_orders_total_count_by_status(user_id, 1);\n @forpaid_orders_count = OrdersHelper.get_purchase_orders_total_count_by_status(user_id, 2);\n @complete_orders_count = OrdersHelper.get_purchase_orders_total_count_by_status(user_id, 3);\n @closed_orders_count = OrdersHelper.get_purchase_orders_total_count_by_status(user_id, -1);\n \n logger.debug \"---------- bid: \" + @bidding_orders_count.to_s + \"complete: \" + @complete_orders_count.to_s + \"---------------\"\n \n render \"dashboard/dashboard_purchases\" and return\n end",
"def create\n @purchase = Purchase.new(purchase_params)\n\n respond_to do |format|\n if @purchase.save\n format.json { render action: 'show', status: :created, location: @purchase }\n else\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @sell = Sell.find(params[:id])\n @repurchase = Repurchase.new\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @repurchase }\n end\n end",
"def my_purchases\n @listings = Listing.joins(:purchase).merge(Purchase.where(user_id: current_user.id)).page(params[:page]).per(30)\n end",
"def purchase billing, number\r\n # the base uri for api requests\r\n query_builder = Configuration.BASE_URI.dup\r\n\r\n # prepare query string for API call\r\n query_builder << \"/tns/{number}\"\r\n\r\n # process optional query parameters\r\n query_builder = APIHelper.append_url_with_template_parameters query_builder, {\r\n \"number\" => number,\r\n }\r\n\r\n # validate and preprocess url\r\n query_url = APIHelper.clean_url query_builder\r\n\r\n # prepare headers\r\n headers = {\r\n \"user-agent\" => \"Flowroute SDK 1.0\",\r\n \"content-type\" => \"application/json; charset=utf-8\"\r\n }\r\n\r\n response = CustomAuthUtility.append_custom_auth_params method:'PUT',\r\n query_url:query_url,\r\n body:\"{\\\"billing_method\\\": #{billing.to_json}}\",\r\n headers:headers\r\n\r\n # Error handling using HTTP status codes\r\n if response.code == 401\r\n raise APIException.new \"NOT AUTHORIZED\", 401, response.raw_body\r\n elsif response.code == 500\r\n raise APIException.new \"APPLICATION/SERVER ERROR\", 500, response.raw_body\r\n elsif !(response.code.between?(200,206)) # [200,206] = HTTP OK\r\n raise APIException.new \"HTTP Response Not OK\", response.code, response.raw_body\r\n end\r\n\r\n response.body\r\n end",
"def index\n if params[:from] == 'purchase_order'\n @purchases = current_user.purchase_ordered\n @from = 'purchase_order'\n else\n @purchases = current_user.purchase_received\n end \n end",
"def show\n if request.headers['X-PJAX'] and params[:_pjax] != 'data-pjax-container' # (ugly) the latter implies the whole page is requested\n render :partial => 'show'\n else\n find_purchases\n render :index, :id => params[:id]\n end\n\n end",
"def show\n @transactions = Transaction.where(user_id: params[:id])\n render json: @transactions\n end",
"def index\n if params[:market_id].nil? || params[:month].nil? || params[:year].nil?\n redirect_to customer_purchases_path(\n market_id: Market.first.id,\n month: Time.now.month,\n year: Time.now.year\n )\n end\n if (params[:per_page].nil? || params[:per_page].empty?)\n per_page = 4\n else\n per_page = params[:per_page]\n end\n if params[:page].nil? || params[:page].empty?\n page = 1\n else\n page = params[:page]\n end\n @customers = Customer\n .select(\"name,id\")\n .where(\"market_id = :market_id\", market_id: params[:market_id])\n .paginate(:per_page => per_page , page: page)\n @customer_purchases = CustomerPurchase\n .joins(:customer)\n .where(\"customers.id in (:ids)\", ids: @customers.map{|x| x.id })\n .where(\"customers.market_id = :market_id\", market_id: params[:market_id])\n .where(\"YEAR(date) = :year and MONTH(date) = :month\", year: params[:year], month: params[:month])\n end"
] | [
"0.80066895",
"0.77672255",
"0.76304215",
"0.76304215",
"0.7425575",
"0.73844385",
"0.7343369",
"0.73353374",
"0.7317721",
"0.7251758",
"0.7217834",
"0.7217834",
"0.7217834",
"0.7134681",
"0.70766836",
"0.70638627",
"0.70366734",
"0.6953153",
"0.6953153",
"0.69219077",
"0.69219077",
"0.69219077",
"0.68538314",
"0.67437273",
"0.66637397",
"0.66055876",
"0.65764457",
"0.6569599",
"0.6565167",
"0.6551683",
"0.6532351",
"0.6520344",
"0.64884174",
"0.6482389",
"0.64728385",
"0.6454689",
"0.6453109",
"0.6439704",
"0.6437327",
"0.6430331",
"0.6409809",
"0.63725775",
"0.63625485",
"0.6358111",
"0.63218606",
"0.63049316",
"0.62971926",
"0.6295671",
"0.6294072",
"0.629295",
"0.62778383",
"0.6266854",
"0.62579054",
"0.62554014",
"0.6253761",
"0.62466556",
"0.62466556",
"0.62466556",
"0.62466556",
"0.62466556",
"0.62428343",
"0.62414724",
"0.62136674",
"0.6192157",
"0.6137219",
"0.61143404",
"0.60997427",
"0.60973734",
"0.6087716",
"0.60867125",
"0.6085353",
"0.6054586",
"0.604781",
"0.6033918",
"0.6033918",
"0.6033918",
"0.6033123",
"0.6024864",
"0.60051715",
"0.60026866",
"0.60006624",
"0.5988669",
"0.5987953",
"0.5980516",
"0.5974948",
"0.59661615",
"0.5936668",
"0.5933979",
"0.59215474",
"0.59213644",
"0.5918029",
"0.5913138",
"0.5902935",
"0.58976376",
"0.58848196",
"0.58626425",
"0.5860378",
"0.5854735",
"0.583828",
"0.582083"
] | 0.67761844 | 23 |
POST /purchases POST /purchases.json | def create
begin
purchase = Purchase.new(history_params)
purchase.package = @package
purchase.user = current_user
# Get the credit card details submitted by the form
token = stripe_token_params
# Create the charge on Stripe's servers - this will charge the user's card
Purchase.transaction do
promo = ParamsHelper.parse_promo_code_query(params)
total = @package.total
if promo
total = promo.discount_price(total)
purchase.promo_code = promo
purchase.discount = @package.total - total
end
begin
charge = Stripe::Charge.create(
:amount =>(total * 100).to_i(), # amount in cents
:currency => "cad",
:source => token[:id],
:description => "#{@package.quantity} bids purchased"
)
purchase.transaction_id = charge.id
purchase.total = total
if purchase.save
render json: purchase
else
# This should NEVER happen, if it does, it requires immediate investigation
logger.fatal "Trying to create purchase #{purchase.inspect} resulted in errors: #{purchase.errors.full_messages}"
errors = errors_to_hash(purchase)
render json: errors, status: :unprocessable_entity
end
rescue Stripe::CardError => e
logger.warn "Card declined for purchase #{purchase.inspect}"
warn_exception(e)
errors = [ "Your credit card was declined by Stripe, please contact support"]
render json: errors, status: :unprocessable_entity
end
end
rescue ActiveRecord::RecordNotFound
render json: {:promo_code => "Promotion code is invalid"}, status: :bad_request
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def do_purchase\n user.purchases.create!(\n amount_in_cents: purchase_amount,\n employee_id: purchase_params.dig(:employee_id),\n qty: purchase_params.dig(:qty).to_i,\n venue_id: purchase_params.dig(:venue_id),\n tap_id: purchase_params.dig(:tap_id),\n description: purchase_params.dig(:description)\n )\n end",
"def create\n @purchases = current_user.profile.purchases.new(purchases_params)\n\n respond_to do |format|\n if @purchases.save\n format.html { redirect_to purchases_url, notice: 'Purchase created with success.' }\n format.json { render :show, status: :created, location: @purchases }\n else\n format.html { render :new }\n format.json { render json: @purchases.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @purchase = Purchase.new(purchase_params)\n\n if @purchase.save\n render json: @purchase, status: :created, location: @purchase\n else\n render json: {errors: @purchase.errors}, status: :unprocessable_entity\n end\n end",
"def create\n purchase = @order.purchases.first(:conditions => {\n :purchasable_id => params[:purchase][:purchasable_id],\n :purchasable_type => params[:purchase][:purchasable_type]\n })\n\n if purchase\n purchase.quantity += params[:purchase][:quantity].to_i\n purchase.save\n else\n @order.purchases << Purchase.new(params[:purchase])\n @order.save\n end\n\n if params[:redirect_to]\n flash[:success] = %{#{params[:purchase][:name]} has been added to your order. <a href=\"/order/purchases\">Proceed to checkout</a>.} unless params[:hide_flash]\n redirect_to params[:redirect_to]\n else\n redirect_to order_purchases_path\n end\n end",
"def purchases_params\n params.require(:purchases).permit(:description, :was_bought, :profile_id, product_purchases_attributes: [:name, :id, :_destroy, :product_id])\n end",
"def create\n @purchase = Purchase.new(purchase_params)\n\n respond_to do |format|\n if @purchase.save\n format.json { render action: 'show', status: :created, location: @purchase }\n else\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @purchase = Purchase.new(\n date: purchase_params[:date],\n brand: purchase_params[:brand],\n by_cup: purchase_params[:by_cup],\n fair_trade: purchase_params[:fair_trade],\n price: purchase_params[:price],\n rating: purchase_params[:rating],\n # check who the currently logged in user is\n user_id: get_current_user.id)\n\n if @purchase.save\n render json: {status: 201, purchase: @purchase}\n else\n puts @purchase.error\n render json: {status: 422, message: 'Unprocessable Entity'}\n end\n end",
"def create\n @purchase = Purchase.new(params[:purchase])\n\n respond_to do |format|\n if @purchase.save\n format.html { redirect_to @purchase, notice: 'Purchase was successfully created.' }\n format.json { render json: @purchase, status: :created, location: @purchase }\n else\n format.html { render action: \"new\" }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @purchase = Purchase.new(params[:purchase])\n\n respond_to do |format|\n if @purchase.save\n format.html { redirect_to @purchase, notice: 'Purchase was successfully created.' }\n format.json { render json: @purchase, status: :created, location: @purchase }\n else\n format.html { render action: \"new\" }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @purchase = Purchase.new(params[:purchase])\n\n respond_to do |format|\n if @purchase.save\n format.html { redirect_to @purchase, notice: 'Purchase was successfully created.' }\n format.json { render json: @purchase, status: :created, location: @purchase }\n else\n format.html { render action: \"new\" }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @purchase = Purchase.new(params[:purchase])\n\n respond_to do |format|\n if @purchase.save\n format.html { redirect_to @purchase, notice: 'Purchase was successfully created.' }\n format.json { render json: @purchase, status: :created, location: @purchase }\n else\n format.html { render action: \"new\" }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @purchase = Purchase.new(purchase_params)\n\n respond_to do |format|\n if @purchase.save\n format.html { redirect_to @purchase, notice: 'Purchase was successfully created.' }\n format.json { render :show, status: :created, location: @purchase }\n else\n format.html { render :new }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @purchase_item = PurchaseItem.find(params[:id])\n \n\n respond_to do |format|\n if @purchase_item.save\n format.html { redirect_to purchase_path(@purchase), notice: 'Purchase item was successfully created.' }\n format.json { render json: @purchase, status: :created, location: @purchase }\n else\n format.html { render action: \"new\" }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end",
"def purchase\n response = GATEWAY.purchase(price_in_cents, credit_card, purchase_options)\n transactions.create!(:action => \"purchase\", :amount => price_in_cents, :response => response)\n #cart.update_attribute(:purchased_at, Time.now) if response.success?\n response.success?\n end",
"def purchase\n response = GATEWAY.purchase(price_in_cents, credit_card, purchase_options)\n transactions.create!(:action => \"purchase\", :amount => price_in_cents, :response => response)\n #UserMailer.ordered(\"google.com\", response.params.to_s, User.find(cart.user_id), cart).deliver\n cart.update_attribute(:purchased_at, Time.now) if response.success?\n response.success?\n end",
"def create\n @purchase = current_user.purchases.build(params[:purchase])\n\n respond_to do |format|\n if @purchase.save\n Notifications.new_purchase(@purchase).deliver\n format.html { redirect_to @purchase, notice: 'Purchase was successfully created.' }\n format.json { render json: @purchase, status: :created, location: @purchase }\n else\n format.html { render action: \"new\" }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @customer_purchase = CustomerPurchase.new(customer_purchase_params)\n\n respond_to do |format|\n if @customer_purchase.save\n format.html { redirect_to @customer_purchase, notice: 'Customer purchase was successfully created.' }\n format.json { render :show, status: :created, location: @customer_purchase }\n else\n format.html { render :new }\n format.json { render json: @customer_purchase.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @shop_purchase = Shop::Purchase.new(params[:shop_purchase])\n\n respond_to do |format|\n if @shop_purchase.save\n format.html { redirect_to @shop_purchase, notice: 'Purchase was successfully created.' }\n format.json { render json: @shop_purchase, status: :created, location: @shop_purchase }\n else\n format.html { render action: \"new\" }\n format.json { render json: @shop_purchase.errors, status: :unprocessable_entity }\n end\n end\n end",
"def purchase_params\n params.require(:purchase).permit(:cost, :user_id, :group_id, :receipt_photo, item_ids: [] )\n end",
"def new\n @purchase = current_user.purchases.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @purchase }\n end\n end",
"def purchase(total)\n @price_in_cents = total\n response = process_purchase\n transactions.create!(:action => \"purchase\", :amount =>@price_in_cents, :response => response)\n #cart.update_attribute(:purchased_at, Time.now) if response.success?\n response.success?\n end",
"def purchase_param\r\n params.require(:purchase).permit(:item_id, :quantity, :date)\r\n end",
"def create\n @repurchase = Repurchase.new(params[:repurchase])\n\n respond_to do |format|\n if @repurchase.save\n format.html { redirect_to @repurchase, notice: 'Repurchase was successfully created.' }\n format.json { render json: @repurchase, status: :created, location: @repurchase }\n else\n format.html { render action: \"new\" }\n format.json { render json: @repurchase.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @analytics_purchase = AnalyticsPurchase.new(analytics_purchase_params)\n\n respond_to do |format|\n if @analytics_purchase.save\n format.html { redirect_to @analytics_purchase, notice: 'Analytics purchase was successfully created.' }\n format.json { render :show, status: :created, location: @analytics_purchase }\n else\n format.html { render :new }\n format.json { render json: @analytics_purchase.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @purchase = Purchase.new(params[:purchase])\n\n respond_to do |format|\n if @purchase.save\n flash[:notice] = 'Purchase was successfully created.'\n format.html { redirect_to(@purchase) }\n format.xml { render :xml => @purchase, :status => :created, :location => @purchase }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @purchase.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @purchased_item = PurchasedItem.new(purchased_item_params)\n\n respond_to do |format|\n if @purchased_item.save\n format.html { redirect_to @purchased_item, notice: 'Purchased item was successfully created.' }\n format.json { render :show, status: :created, location: @purchased_item }\n else\n format.html { render :new }\n format.json { render json: @purchased_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def purchase_params\n params.require(:purchase).permit(:amount, :description, :event_id, :user_id)\n end",
"def create\n @purchase = Purchase.new(params[:purchase])\n @purchase.status = Purchase.new_status\n @purchase.user = current_user\n\n respond_to do |format|\n if @purchase.save\n format.html { redirect_to @purchase, :notice => 'Tu compra ha sido realizada exitosamente' }\n format.json { render :json => @purchase, :status => :created, :location => @purchase }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @purchase.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def purchase_params\n params.require(:purchase).permit(:location_id, :total_price, :purchased_by_id, :reimbursed_by_id, :reimbursement_check_number, :reimbursement_status)\n end",
"def create\n @purchase_order = PurchaseOrder.new(purchase_order_params)\n\n if @purchase_order.save\n render :show, status: :created, location: @purchase_order\n else\n render json: @purchase_order.errors, status: :unprocessable_entity\n end\n end",
"def create\n @book_purchase = BookPurchase.new(book_purchase_params)\n\n respond_to do |format|\n if @book_purchase.save\n format.html { redirect_to @book_purchase, notice: 'Book purchase was successfully created.' }\n format.json { render :show, status: :created, location: @book_purchase }\n else\n format.html { render :new }\n format.json { render json: @book_purchase.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @group = Group.find(params[:group_id])\n @purchase = @group.purchases.build(purchase_params)\n @purchase.user = current_user\n if @purchase.make_purchase(purchase_params[:item_ids])\n redirect_to group_purchase_path(@group, @purchase), notice: 'purchase was successfully created!'\n else\n render action: 'new'\n end\n end",
"def purchase\n\n response = GATEWAY.purchase(price_in_cents, credit_card, purchase_options)\n \n #create_card_transaction(action: \"purchase\", amount: price_in_cents, response: response)\n \n #@registration.update_attribute(:purchased_at, Time.now) if response.success?\n #response.success?\n end",
"def purchase_params\n params.require(:purchase).permit(:order_id, :product_id, :quantity, :note)\n end",
"def create\n @purchaseorder = Purchaseorder.new(purchaseorder_params)\n\n respond_to do |format|\n if @purchaseorder.save\n format.html { redirect_to @purchaseorder, notice: 'Purchaseorder was successfully created.' }\n format.json { render :show, status: :created, location: @purchaseorder }\n else\n format.html { render :new }\n format.json { render json: @purchaseorder.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @purchaseorder = Purchaseorder.new(params[:purchaseorder])\n\n respond_to do |format|\n if @purchaseorder.save\n format.html { redirect_to @purchaseorder, notice: 'Purchaseorder was successfully created.' }\n format.json { render json: @purchaseorder, status: :created, location: @purchaseorder }\n else\n format.html { render action: \"new\" }\n format.json { render json: @purchaseorder.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @purchase_order = PurchaseOrder.new(purchase_order_params)\n\n respond_to do |format|\n if @purchase_order.save\n format.html { redirect_to @purchase_order, notice: \"Purchase order was successfully created.\" }\n format.json { render :show, status: :created, location: @purchase_order }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @purchase_order.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_to_purchases(purchase_record)\n @purchases << purchase_record\n end",
"def create\n @purchase = Purchase.new(params[:purchase])\n respond_to do |format|\n if @purchase.save\n flash[:notice] = 'Purchase was successfully created.'\n format.html { redirect_to(@purchase) }\n format.xml { render :xml => @purchase, :status => :created, :purchase => @purchase }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @purchase.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def purchase_params\n params.require(:purchase).permit(:amount)\n end",
"def purchase(id)\n response = Shippo::API.post(\"#{url}/#{CGI.escape(id)}/purchase\")\n self.from(response)\n end",
"def create\n @purchase_receipt = PurchaseReceipt.new(params[:purchase_receipt])\n\n respond_to do |format|\n if @purchase_receipt.save\n format.html { redirect_to @purchase_receipt, notice: 'Purchase receipt was successfully created.' }\n format.json { render json: @purchase_receipt, status: :created, location: @purchase_receipt }\n else\n format.html { render action: \"new\" }\n format.json { render json: @purchase_receipt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @purchases = Purchase.where(user_id: get_current_user.id.to_i)\n\n render json: @purchases\n end",
"def create\n @purchase = Purchase.new(purchase_params)\n @purchase.state = 1\n @purchase.current_total_price = 0\n @purchase.user_id = current_user.id\n @purchase.group = params[\"selected_group_name\"]\n @purchase.group_id = params[\"group_select\"]\n\n respond_to do |format|\n if @purchase.save\n format.html { redirect_to purchase_confirm_post_path(@purchase)}\n format.json { render action: 'facebook_post_confirmed', status: :created, location: @purchase }\n else\n format.html { render action: 'new' }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end",
"def purchase_params\n params.require(:purchase).permit(:spree_product_id, :spree_order_id, :amount)\n end",
"def create\n event_id = purchase_params[:event_id]\n @event = Event.find(event_id)\n @purchase = Purchase.new(purchase_params)\n\n respond_to do |format|\n if @purchase.save\n @event.update_total_balance\n # Update all user_event_balances\n @purchase.event.user_event_balances.each do |ueb|\n ueb.update_debt\n ueb.update_credit\n end\n\n format.html { redirect_to @event, success: 'Purchase was successfully created.' }\n format.json { render action: 'show', status: :created, location: @purchase }\n else\n format.html { render action: 'new' }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end",
"def make_payment\n payment_id = params[:payment_id]\n user_id = params[:user_id]\n offer_id = params[:offer_id]\n response = Subscription.make_payment(payment_id, user_id, offer_id)\n render json: response\n end",
"def create\n @purchase = Purchase.new(purchase_params)\n @purchase.update_associations(current_user, @vendor)\n # @purchase.vendor = @vendor\n # @purchase.added_by = current_user.id\n # @purchase.invoice.user = @purchase.user = current_user\n @purchase.state = \"ordered\"\n respond_to do |format|\n if @purchase.save\n format.html { redirect_to purchase_path(@purchase), notice: 'Purchase was successfully created.' }\n format.json { render action: 'show', status: :created, location: @purchase }\n else\n format.html { render action: 'new' }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n set_purchases\n @purchase = Purchase.new\n end",
"def create\n @purchase = Purchase.new(purchase_params)\n spree_order = ActiveRecord::Base.connection.select_one(\"select * from spree_line_items a left join spree_variants b on a.variant_id = b.id left join purchases c on a.order_id = c.spree_order_id where b.product_id = #{@purchase.spree_product_id} and c.amount is null\")\n @purchase.spree_order_id = spree_order[\"order_id\"] if spree_order\n\n respond_to do |format|\n if spree_order && @purchase.save\n format.html { redirect_to purchases_path, notice: t(\"activerecord.models.purchase\") + t(\"messages.successfully_created\") }\n format.json { render :show, status: :created, location: @purchase }\n else\n format.html { redirect_to purchases_path, alert: t(\"activerecord.models.purchase\") + t(\"messages.not_created\") }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n puts \"create*******\"\n puts purchase_params\n user = User.find(session[:user_id])\n email = user.email\n \tpackage_id = params[:purchase][:package]\n \tpurchase_package = Package.find package_id\n \tquantity = purchase_package.quantity.to_s\n \tamount = purchase_package.price.to_i\n \tStripeModel.chargeCreditCard(params[:stripeToken], email, quantity, amount)\n \n \t@purchase = Purchase.new purchase_params\n @purchase.email = email\n \[email protected] = quantity\n \[email protected] = amount\n \[email protected]\t#save method is overridden in the Purchase model\n\n redirect_to user_path(session[:user_id])\n end",
"def create\n @purchase_order_item = PurchaseOrderItem.new(params[:purchase_order_item])\n\n respond_to do |format|\n if @purchase_order_item.save\n format.html { redirect_to @purchase_order_item, notice: 'Purchase order item was successfully created.' }\n format.json { render json: @purchase_order_item, status: :created, location: @purchase_order_item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @purchase_order_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def purchase(trip, attributes = {})\n e = Expense.new(attributes)\n e.purchaser = self\n e.trip = trip\n e.save\n e\n end",
"def purchase(trip, attributes = {})\n e = Expense.new(attributes)\n e.purchaser = self\n e.trip = trip\n e.save\n e\n end",
"def purchase_params\n params.require(:purchase).permit(:product_id, :user_id, :receive_name, :addr, :phone, :memo, :total_cost, :trade_type, :payer, :status, :ship_cost, :ship_company,\n :trans_num, :quantity, :ordertype, :option, :detail)\n \n end",
"def rewardpurchase\n @reward = Reward.find(params[:id]).clone\n @rewardpurchase = @reward.rewardpurchases.create(params.permit(:reward_id,:user_id,:rewardname,:rewardbusiness,:rewardcost))\n @rewardpurchase.rewardname = @reward.name.dup\n @rewardpurchase.rewardbusiness = @reward.business.name.dup\n @rewardpurchase.rewardcost = @reward.cost.to_s.dup\n @rewardpurchase.user_id = current_user.id\n @rewardpurchase.rewarddescription = @reward.description\n \n \n if current_user.karma >= @reward.cost\n respond_to do |format|\n if @rewardpurchase.save\n current_user.purchase_reward(@reward.cost)\n format.html { redirect_to root_path, notice: 'Reward was successfully purchased.' }\n format.json { render json: @rewardpurchase, status: :created, location: @rewardpurchase }\n else\n format.html { redirect_to @reward}\n format.json { render json: @rewardpurchase.errors, status: :unprocessable_entity }\n end\n end\n else\n redirect_to :back, notice: \"You do not have enough points to purchase this reward.\"\n end\n end",
"def purchase_params\n params.require(:purchase).permit!#(:purchase_date, :vendor_name, :paid_status, :bill_no, :total_amount, :balance_amount)\n end",
"def create\n @purchasedetail = Purchasedetail.new(purchasedetail_params)\n\n respond_to do |format|\n if @purchasedetail.save\n format.html { redirect_to @purchasedetail, notice: 'Purchasedetail was successfully created.' }\n format.json { render :show, status: :created, location: @purchasedetail }\n else\n format.html { render :new }\n format.json { render json: @purchasedetail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def purchase_params\n params.require(:purchase).permit(:item_id, :slot_id)\n end",
"def index\n @purchases = Purchase.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @purchases }\n end\n end",
"def index\n @purchases = Purchase.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @purchases }\n end\n end",
"def purchase_params\n params.require(:purchase).permit(:from_currency, :to_currency, :amount_spent)\n end",
"def purchase\n if express_token.include?(\"paykey=AP\")\n\n else\n\n #processes payment for express payment and on site with credit card.\n response = process_purchase\n #creates a transaction to store info from express payment and paywith Credit card\n transactions.create!(:action => \"purchase\", :amount => price_in_cents, :response => response)\n #cart.update_attribute(:purchased_at, Time.now) if response.success?\n response.success?\n end\n end",
"def create\n @purchase_order = PurchaseOrder.new(purchase_order_params)\n @purchase_order.user = current_user\n @purchase_order.status = \"Espera\"\n\n if @purchase_order.save\n render json: {status: \"created\", purchase_order: @purchase_order.attributes}\n # render :show, status: :created, location: @purchase_order\n # format.html { redirect_to purchase_orders_path, notice: 'Purchase order was successfully created.' }\n # format.json { render :show, status: :created, location: @purchase_order }\n else\n render json: @purchase_order.errors, status: :unprocessable_entity\n # format.html { render :new }\n # format.json { render json: @purchase_order.errors, status: :unprocessable_entity }\n end\n end",
"def purchase(params)\n name = params[:customer]\n timestamp = params[:timestamp]\n amount = params[:amount]\n msg = \"\"\n #Nil check for mandatory fields\n if name.nil? || timestamp.nil? || amount.nil?\n msg = \"Customer name, amount or timestamp can't be blank\"\n puts \"Exception in User::purchase:: #{msg}\"\n return {\"status\" => STATUS_CODES[\"bad_request\"], \"result\" => msg}\n end\n unless show_registered_user({:name => name}).present?\n msg = \"User is not registered, kindly register first\"\n puts \"Exception in User::purchase:: #{msg}\"\n return {\"status\" => STATUS_CODES[\"bad_request\"], \"result\" => msg}\n end\n begin\n reward = avail_reward(timestamp, amount)\n index = @@usr_reward_array.find_index{|um| um[\"name\"] == name}\n\n @@usr_reward_array[index][\"reward\"] += reward\n @@usr_reward_array[index][\"purchase_count\"] += 1\n msg = \"Order placed successfully\"\n return {\"status\" => STATUS_CODES[\"success\"], \"result\" => msg}\n rescue Exception => e\n msg = \"Error in processing event, #{e.message}\"\n puts \"Exception in User::purchase:: #{msg}\"\n return {\"status\" => STATUS_CODES[\"error\"], \"result\" => msg}\n end \n end",
"def pending!(purchase)\n post(purchase, \"#{collection_path}/pending\")\n end",
"def pending!(purchase)\n post(purchase, \"#{collection_path}/pending\")\n end",
"def customer_purchase_params\n params.require(:customer_purchase).permit(:customer_id, :date, :quantity, :expected_payment, :actual_payment)\n end",
"def purchase_params\n params.require(:purchase).permit(:investor, :sold, :product_id)\n end",
"def purchase_params\n params.require(:purchase).permit(:by_cup, :date, :price, :brand, :rating, :fair_trade)\n end",
"def buy\n Stripe.api_key = ENV['STRIPE_API_KEY']\n session = Stripe::Checkout::Session.create({\n payment_method_types: ['card'],\n mode: 'payment',\n success_url: \"#{product_listings_url}/payments/success?eventId=#{@product_listing.id}\",\n cancel_url: \"#{product_listings_url}\",\n line_items: [\n {\n price_data: {\n currency: 'aud',\n product_data: {\n name: @product_listing.name\n },\n unit_amount: (@product_listing.price.to_f * 100).to_i\n },\n quantity: 1\n }\n ]\n\n })\n render json: session\n end",
"def create\n @purchase_request = PurchaseRequest.new(purchase_request_params)\n\n respond_to do |format|\n if @purchase_request.save\n format.html { redirect_to @purchase_request, notice: 'Purchase request was successfully created.' }\n format.json { render :show, status: :created, location: @purchase_request }\n else\n format.html { render :new }\n format.json { render json: @purchase_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @purchase_entry = PurchaseEntry.new(purchase_entry_params)\n\n respond_to do |format|\n if @purchase_entry.save\n format.html { redirect_to @purchase_entry, notice: 'Purchase entry was successfully created.' }\n format.json { render :show, status: :created, location: @purchase_entry }\n else\n format.html { render :new }\n format.json { render json: @purchase_entry.errors, status: :unprocessable_entity }\n end\n end\n end",
"def purchase_params\n params.fetch(:purchase, {}).permit(:email, :stripe_token)\n end",
"def index\n @purchases = Purchase.find_all_by_user_id(current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @purchases }\n end\n end",
"def add_purchase(post)\n post[:capture] = 'Y'\n end",
"def index\n @purchases=current_user.purchases\n end",
"def add_purchase(customer_id, product_id)\n item = DirectedEdge::Item.new(@database, \"customer#{customer_id}\")\n item.link_to(\"product#{product_id}\")\n item.save\n end",
"def purchase_params\n @purchase_params ||= params.require(:purchase).permit(\n :amount, :amount_in_cents, :employee_id, :qty,\n :venue_id, :tap_id, :description\n ).to_h\n end",
"def create\n @purchase_order = PurchaseOrder.new(purchase_order_params)\n\n respond_to do |format|\n if @purchase_order.save\n format.html { redirect_to [:admin, @purchase_order], notice: 'Purchase order was successfully created.' }\n format.json { render :show, status: :created, location: @purchase_order }\n else\n format.html { render :new }\n format.json { render json: @purchase_order.errors, status: :unprocessable_entity }\n end\n end\n end",
"def webhook\n payment_id = params[:data][:object][:payment_intent]\n payment = Stripe::PaymentIntent.retrieve(payment_id)\n receipt_url = payment.charges.data[0].receipt_url\n listing_id = payment.metadata.listing_id\n buyer_id = payment.metadata.user_id\n listing = Listing.find(listing_id)\n\n # Only changes deposit paid when payment has been successfully made.\n\n # Creates a purchase, which has the listing_id (technically don't need seller_id since that data is already stored in the Listings table in user_id column),\n # the buyer_id, payment_id, receipt_url and deposit_paid: to be true. But to make querying easier, added the seller_id in purchase table as well.\n paid = Purchase.create!(listing_id: listing_id, deposit_paid: true, buyer_id: buyer_id, seller_id: listing.user_id, payment_id: payment_id, receipt_url: receipt_url)\n end",
"def create\n @purchase = Purchase.new(purchase_params)\n @purchase.total_price = 0;\n @purchase.contact_name = @purchase.contact.raison\n\n respond_to do |format|\n if @purchase.save\n format.html { redirect_to @purchase, notice: 'Purchase was successfully created.' }\n format.json { render :show, status: :created, location: @purchase }\n else\n format.html { render :new }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post_buy_token\n # Whitelist parameters for buying tokens\n purchase_params \n end",
"def purchase\n #@cart = Cart.find(self.cart_id)\n #cart.update_attribute(:purchased_at, Time.now)\n if cart.tip && cart.tip > 0\n @amount = price_in_cents + tax_in_cents + tip_in_cents\n else\n @amount = price_in_cents + tax_in_cents\n end\n @transaction = transactions.first\n #response = GATEWAY.purchase((price_in_cents + tax_in_cents), credit_card,\n # purchase_options)\n\n response = GATEWAY.capture((@amount), @transaction.authorization)\n @transaction.update_attributes(:action => \"capture\",\n :amount => (@amount), :response => response)\n\n #cart.update_attribute(:purchased_at, Time.now) if response.success?\n # SWITCH TO ABOVE WHEN LIVE.\n ######## remove when live. ########\n #GATEWAY.void(response.authorization, purchase_options)\n ## uncomment when live\n response.success?\n end",
"def purchase_params\n params.require(:purchase).permit(:user_id, movie_purchases_attributes: [ :id, :movie_id, :quantity ])\n end",
"def new\n @product = Product.find(params[:product_id])\n @purchase = Purchase.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @purchase }\n end\n end",
"def purchase\n response = GATEWAY.purchase(self.price * 100, credit_card)\n transactions.create!(:price => self.price, :response => response)\n self.transaction_number = response.subscription_id if response.respond_to? :subscription_id\n self.status = response.success?\n create_transaction if self.status\n self.save\n end",
"def create\n @purchase_order = PurchaseOrder.new(purchase_order_params)\n @purchase_order.order_date = Time.now\n @purchase_order.user_id = current_user.id\n\n respond_to do |format|\n if @purchase_order.save\n format.html { \n flash[:notice] = 'La orden de compra se creó satisfactoriamente.'\n redirect_to purchase_orders_path\n }\n format.json { render :show, status: :created, location: @purchase_order }\n else\n format.html { render :new }\n format.json { render json: @purchase_order.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @purchases = current_user.purchases\n end",
"def material_purchase_params\n params.require(:material_purchase).permit(:user_id, :name, :cost, :units, :receipt)\n end",
"def create\n @purchase = Purchase.new purchase_attributes\n if @purchase.save\n @ok = true\n renewed = Purchase.find_by_id params[:renewed_id]\n if renewed\n renewed.users.each do |u|\n u.purchase_id = @purchase.id\n u.save\n Notification.send_to(\n u.id,\n I18n.t('notifications.account.renewed.title'),\n I18n.t('notifications.account.renewed.message', :expiration_date => TimeConvert.to_string(@purchase.expiration_date)),\n ''\n )\n end\n renewed.expiration_date = Time.zone.now\n renewed.save\n end\n else\n @ok = false\n @errors = @purchase.errors.messages.keys\n @errors << :ssn_code if @errors.include?(:base)\n end\n end",
"def purchase_postage(params = {})\n params[:credentials] =\n {\n username: self.username,\n password: self.password,\n :integration_id => '1e6c1e3a-dd09-4c28-b1ce-240e222a75da'\n }\n response = request('PurchasePostage', Stamps::Mapping::PurchasePostage.new(params))\n response.errors.empty? ? response.hash[:purchase_postage_response] : response\n end",
"def index\n @purchases = Purchase.all\n end",
"def index\n @purchases = Purchase.all\n end",
"def index\n @purchases = Purchase.all\n end",
"def purchase_one\n product = Product.find(params[:id])\n company = Company.first\n if product[:inventory_count] > 0\n if product.decrement!(:inventory_count)\n total = company[:money] + product[:price]\n\n company.update_!(money: total)\n render json: {\n status: :ok,\n message: 'Successfully bought'\n }.to_json\n else\n render json: {\n status: :internal_server_error,\n message: 'Error purchasing product'\n }\n end\n else\n render json: {\n status: :ok,\n message: 'Item is no longer available'\n } \n end\n end",
"def purchase_params\n params.require(:purchase).permit(:user_id, :purchase_option_id).merge(content_id: content_id)\n end",
"def successful_purchase_response\n end",
"def create\n @errors = []\n @compiled = []\n otp = params[:otp]\n totp = ROTP::TOTP.new(session[:secret_key])\n #Must be verified within 30 seconds\n respond_to do |format|\n\n unless totp.verify(otp, drift_behind: 30).nil?\n current_user.cart.cart_items.each do |cart_item|\n @purchase = current_user.purchases.build()\n @purchase.student = current_user\n @purchase.section = cart_item.section\n @purchase.price = cart_item.section.course.price\n unless @purchase.save\n @errors.append @purchase.errors\n else\n @compiled.append @purchase\n message = PurchaseMailer.enrollment_email(cart_item.section.teacher, current_user, cart_item.section).deliver!\n cart_item.destroy\n end\n end\n\n if @compiled.any?\n message = PurchaseMailer.purchase_email(current_user_auth, @compiled).deliver!\n end\n\n unless @errors.any?\n format.html { redirect_to purchases_url, notice: 'Purchase was successfully created.' }\n format.json { render :show, status: :created, location: purchases_url }\n else\n format.html { render :new }\n format.json { render json: @errors, status: :unprocessable_entity }\n end\n\n else\n format.html { redirect_to cart_path, notice: 'Incorrect password. Purchase declined.' }\n format.json { head :no_content }\n end\n end\n end",
"def create\n @purchase_list = PurchaseList.new(purchase_list_params)\n @purchase_list.save\n end"
] | [
"0.7372497",
"0.7361999",
"0.71180695",
"0.6974874",
"0.6905323",
"0.6883787",
"0.688361",
"0.68291336",
"0.68291336",
"0.68291336",
"0.6828237",
"0.6822894",
"0.6724764",
"0.6648243",
"0.663833",
"0.6632912",
"0.6583054",
"0.65470576",
"0.6493291",
"0.6436755",
"0.643611",
"0.64343905",
"0.64162266",
"0.6392957",
"0.6374955",
"0.63497245",
"0.6345042",
"0.63434863",
"0.633987",
"0.6335185",
"0.63349086",
"0.6317957",
"0.63115364",
"0.6302469",
"0.6295662",
"0.6295526",
"0.62882555",
"0.6287818",
"0.62817466",
"0.62745976",
"0.62631154",
"0.6241073",
"0.6240953",
"0.6164209",
"0.61579216",
"0.61493677",
"0.6148558",
"0.61464113",
"0.6138223",
"0.61247224",
"0.61174226",
"0.6116777",
"0.61028564",
"0.61028564",
"0.6100492",
"0.60993594",
"0.6091629",
"0.6086818",
"0.6055002",
"0.60489327",
"0.60489327",
"0.604089",
"0.60392773",
"0.6029698",
"0.60290575",
"0.6028037",
"0.6028037",
"0.60274786",
"0.60268724",
"0.6025006",
"0.60241807",
"0.6016062",
"0.6004389",
"0.5956924",
"0.5953663",
"0.5951472",
"0.5944687",
"0.59446406",
"0.594361",
"0.59415877",
"0.59310955",
"0.592828",
"0.59254414",
"0.59228003",
"0.59216267",
"0.5912962",
"0.59048766",
"0.5900575",
"0.5898669",
"0.5896752",
"0.5896352",
"0.58940107",
"0.58833194",
"0.58833194",
"0.58833194",
"0.586077",
"0.5846641",
"0.5845892",
"0.58436865",
"0.58375216"
] | 0.6361487 | 25 |
Never trust parameters from the scary internet, only allow the white list through. | def history_params
params.require(:history).permit(:brand, :last_4, :exp_month, :exp_year)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def valid_params_request?; end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def filtering_params\n params.permit(:email)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def url_whitelist; end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] | [
"0.6980957",
"0.6783065",
"0.6747844",
"0.6741468",
"0.67356336",
"0.6592548",
"0.65036845",
"0.64978707",
"0.64825076",
"0.64795035",
"0.64560914",
"0.64397955",
"0.6379666",
"0.6376688",
"0.6366702",
"0.6319728",
"0.6300833",
"0.6300629",
"0.6294277",
"0.6293905",
"0.6291174",
"0.62905735",
"0.6283171",
"0.6242344",
"0.62403613",
"0.6218049",
"0.62143815",
"0.62104696",
"0.61949855",
"0.6178671",
"0.6176147",
"0.6173327",
"0.6163395",
"0.6153005",
"0.6151833",
"0.6147288",
"0.61224324",
"0.6118827",
"0.61075264",
"0.61054534",
"0.6092497",
"0.6080082",
"0.60710967",
"0.60627776",
"0.60219413",
"0.60175914",
"0.60153484",
"0.60107356",
"0.60081726",
"0.60081726",
"0.60013986",
"0.6000165",
"0.59978646",
"0.59936947",
"0.59925723",
"0.5992084",
"0.59796256",
"0.5967569",
"0.5960056",
"0.59589803",
"0.5958441",
"0.5958401",
"0.5952607",
"0.5952406",
"0.5944409",
"0.59391016",
"0.593842",
"0.593842",
"0.5933845",
"0.59312123",
"0.5926475",
"0.59248453",
"0.59179676",
"0.59109294",
"0.59101623",
"0.5908172",
"0.59058356",
"0.5899052",
"0.5897749",
"0.5896101",
"0.58942914",
"0.58939576",
"0.5892063",
"0.5887407",
"0.588292",
"0.58797663",
"0.587367",
"0.58681566",
"0.5868038",
"0.5866578",
"0.58665025",
"0.58655846",
"0.58640826",
"0.5863465",
"0.5862226",
"0.586065",
"0.58581287",
"0.5854443",
"0.5854172",
"0.58507544",
"0.5849934"
] | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.