query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
If you don't specify these, it's possible to have issues when encodings mismatch on the server.
def setup_encoding # TODO: Deprecate and remove this setup - it should be the responsibility of the server to set this correctly. if @external_encoding and Encoding.default_external != @external_encoding warn "Updating Encoding.default_external from #{Encoding.default_external} to #{@external_encoding}" if $VERBOSE Encoding.default_external = @external_encoding end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ignore_encoding_error; end", "def force_default_encoding; end", "def encoding_found; end", "def encoding_found; end", "def default_encoding; end", "def default_encoding; end", "def meta_encoding; end", "def meta_encoding; end", "def encodings; end", "def suppress_encoding; end", "def ignore_encoding_error=(_arg0); end", "def force_header_encoding(s); s; end", "def force_encoding(*); self; end", "def force_utf32; end", "def force_utf32; end", "def force_utf32; end", "def encoding; end", "def encoding; end", "def encoding; end", "def encoding; end", "def encoding; end", "def encoding; end", "def encoding; end", "def encoding; end", "def encoding; end", "def encoding; end", "def encoding; end", "def encoding; end", "def encoding; end", "def encoding; end", "def encoding; end", "def fix_utf_errors\n self.encode('UTF-16', 'UTF-8', :invalid => :replace, :replace => '').encode('UTF-8', 'UTF-16')\n end", "def force_encoding(enc)\n end", "def force_default_encoding=(_arg0); end", "def default_encoding\n Encoding::UTF_8\n end", "def external_encoding; @_external_encoding || _external_encoding; end", "def found_encoding; end", "def found_encoding; end", "def fix_encoding(str)\n str.force_encoding(Encoding.default_external) if str.respond_to?(:force_encoding)\n str\nend", "def force_header_encoding(s); s.tap { s.force_encoding('UTF-8') }; end", "def force_encoding(*args) settings.force_encoding(*args) end", "def meta_encoding=(encoding); end", "def meta_encoding=(encoding); end", "def test_encoding\n assert_equal \"UTF-8\", @conn.encoding\n end", "def test_encoding\n assert_equal 'UTF-8', @conn.encoding\n end", "def content_encoding_hooks; end", "def content_encoding_hooks; end", "def default_encoding=(_arg0); end", "def internal_encoding()\n #This is a stub, used for indexing\n end", "def encoding(encoding); end", "def external_encoding()\n #This is a stub, used for indexing\n end", "def encoding\n # noop?\n end", "def encoding=(_arg0); end", "def encoding=(_arg0); end", "def encoding=(_arg0); end", "def encoding=(_arg0); end", "def encoding=(_arg0); end", "def encoding=(_arg0); end", "def encoding=(_arg0); end", "def configure_charsets \n\theaders[\"Content-Type\"] = \"text/html; charset=utf-8\" \n\tsuppress(ActiveRecord::StatementInvalid) do \n\t ActiveRecord::Base.connection.execute 'SET NAMES UTF8' \n\tend\n end", "def encode_string_ex; end", "def fix_encoding_errors!\n gsub!(BAD_ENCODING_PATTERNS) { |substring| BAD_ENCODING[substring] || substring } || self\n end", "def fix_encoding!(str)\n\t#str.force_encoding(\"UTF-8\")\n\t#pp str.encoding, str.valid_encoding?\n\tstr.encode!(\"UTF-16BE\", :invalid=>:replace, :replace=>\"?\")\n\tstr.encode!(\"UTF-8\")\nend", "def external_encoding\n Encoding.default_external\n end", "def charset; end", "def charset; end", "def charset; end", "def protect_encoding(x)\n x.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')\n end", "def mobile_encoding\n\t'ISO-8859-1'\nend", "def suppress_encoding=(_arg0); end", "def encoding_error?(parser = T.unsafe(nil)); end", "def determine_encodings!(*)\n @encoding ||= super\n end", "def force_encoding(string)\n string.force_encoding(encoding)\n end", "def utf8\n self.encode('UTF-8', 'binary', :invalid => :replace, :undef => :replace, :replace => '?')\n end", "def encoding\n\t'ISO-8859-1'\nend", "def configure_charsets\n content_type = headers[\"Content-Type\"] || 'text/html'\n if /^text\\//.match(content_type)\n headers[\"Content-Type\"] = \"#{content_type}; charset=utf-8\" \n end\n ActiveRecord::Base.connection.execute 'SET NAMES UTF8'\n end", "def try_with_encoding(string, encoding); end", "def try_with_encoding(string, encoding); end", "def force_utf8_encoding(msg)\n msg.respond_to?(:force_encoding) && msg.encoding.name != 'UTF-8' ? msg.force_encoding('UTF-8') : msg\nend", "def process_encoding(source)\n source.force_encoding(Encoding::UTF_8)\n end", "def fix_encoding\n self.title = EncodingManager.fix_encoding self.title\n self.url = EncodingManager.fix_encoding self.url\n self.author = EncodingManager.fix_encoding self.author\n self.content = EncodingManager.fix_encoding self.content\n self.summary = EncodingManager.fix_encoding self.summary\n self.guid = EncodingManager.fix_encoding self.guid\n end", "def encoding_line; end", "def minimal_set_encoding\n res1=self.hyphenated_set_encoding\n res2=self.set_escaped\n res1.size < res2.size ? res1 : res2\n end", "def force_utf8(buf) \n buf.force_encoding('ISO-8859-1').encode('UTF-8', 'UTF-8', replace: nil) \n end", "def convert_encoding(content); end", "def force_utf32=(_arg0); end", "def force_utf32=(_arg0); end", "def force_utf32=(_arg0); end", "def best_mime_encoding\n if self.is_ascii?\n :none\n elsif self.length > (self.mb_chars.length * 1.1)\n :base64\n else\n :quoted_printable\n end\n end", "def set_encoding\n Encoding.default_external = Encoding::UTF_8\n Encoding.default_internal = Encoding::UTF_8\n nil\n end", "def force_entry_names_encoding; end", "def fix_utf8\n str = force_encoding(\"UTF-8\")\n return str if str.valid_encoding?\n\n str.encode(\"UTF-8\", \"binary\",\n invalid: :replace, undef: :replace, replace: \"\")\n end", "def convert_encoding(content)\n return content if RUBY18\n if content =~ /\\A\\s*#.*coding:\\s*(\\S+)\\s*$/\n content.force_encoding($1)\n else\n content\n end\n end", "def configure_charsets # was: set_charset\n content_type = headers[\"Content-Type\"] || \"text/html\"\n if /^text\\//.match(content_type)\n headers[\"Content-Type\"] = \"#{content_type}; charset=utf-8\" \n end\n end", "def is_1_9_or_later?\n \"1.9\".respond_to?(:encoding)\n end", "def check_utf8\n if params.has_key? 'utf8' and params['utf8'] != '✓'\n render text: 'Bad Request', status: 400\n end\n end", "def _utf8(str)\n return str.force_encoding(Encoding::UTF_8)\nend", "def content_type_options\n {charset: 'utf-8'}\n end", "def utf8_safe\n encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')\n end", "def encoding=(enc); end" ]
[ "0.80756944", "0.7460794", "0.7404844", "0.7404844", "0.7377576", "0.7377576", "0.7376942", "0.7376942", "0.73288494", "0.7322891", "0.72067565", "0.7094008", "0.708283", "0.70693547", "0.70693547", "0.70693547", "0.6973361", "0.6973361", "0.6973361", "0.6973361", "0.6973361", "0.6973361", "0.6973361", "0.6973361", "0.6973361", "0.6973361", "0.6973361", "0.6973361", "0.6973361", "0.6973361", "0.6973361", "0.6962102", "0.6944573", "0.6848424", "0.6832905", "0.6791952", "0.6754662", "0.6754662", "0.67080605", "0.6704698", "0.6699071", "0.667492", "0.667492", "0.66349393", "0.6634433", "0.66305184", "0.66305184", "0.66213524", "0.66106206", "0.6590849", "0.6570871", "0.6533934", "0.6527471", "0.6527471", "0.65273666", "0.65273666", "0.65273666", "0.65273666", "0.65273666", "0.6526628", "0.6516677", "0.65041804", "0.65022564", "0.6500334", "0.6428984", "0.6428984", "0.6428984", "0.6425966", "0.641963", "0.6414694", "0.6409614", "0.63695705", "0.63621503", "0.635609", "0.634318", "0.6342423", "0.63422203", "0.63422203", "0.63175297", "0.62981826", "0.62976855", "0.6296729", "0.62781316", "0.62458473", "0.6245004", "0.6234539", "0.6234539", "0.6234539", "0.6195957", "0.61920583", "0.6175123", "0.6144373", "0.6143334", "0.61425275", "0.6126242", "0.6120428", "0.61129117", "0.6112849", "0.61060023", "0.6102051" ]
0.62735116
83
Create new client session
def save_session(username) consumer = fetch_consumer(username) consumer.session_token = SecureRandom.hex consumer.save! consumer.session_token.to_s end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_session\n @connection.create_session(@config || {})\n end", "def create\n @client = current_client\n @session = @client.session\n debug { \"SessionsController#create - #{@session.inspect}\"}\n raise \"ResourceOwner from token != session.owner\" if doorkeeper_token.resource_owner_id != @session.owner.id\n\n @client.update_attributes!(client_params)\n render json: @client, status: :created, serializer: Sso::ClientSerializer\n end", "def new_session\n @logger.info(\"Attempting to connect to WinRM (patched)...\")\n @logger.info(\" - Host: #{@host}\")\n @logger.info(\" - Port: #{@port}\")\n @logger.info(\" - Username: #{@username}\")\n\n client = ::WinRM::WinRMWebService.new(endpoint, :ssl, endpoint_options)\n client.set_timeout(@timeout_in_seconds)\n client.toggle_nori_type_casting(:off) #we don't want coersion of types\n client\n end", "def initialize_session\n puts 'initializing session with client'\n end", "def new_session\n open_session do |sess|\n sess.extend(SessionMethods)\n yield sess if block_given?\n end\n end", "def create_session\n raise NotImplementedError\n end", "def create_session\n login, password = get_login_and_password\n create_session_with authenticate_user(login, password, :trace => true)\n end", "def new_session(options={})\n if supports_sessions?\n api.rest_method('ADD_AUTHORIZATION', {\n :scope => 'session',\n :note => \"RHC/#{RHC::VERSION::STRING} (from #{Socket.gethostname rescue 'unknown'} on #{RUBY_PLATFORM})\",\n :reuse => true\n }, options)\n end\n end", "def create_session(params={})\n raise \"HornetQ::Client::Connection Already Closed\" unless @connection\n params ||= {}\n session = @connection.create_session(\n params[:username],\n params[:password],\n params[:xa] || false,\n params[:auto_commit_sends].nil? ? true : params[:auto_commit_sends],\n params[:auto_commit_acks].nil? ? true : params[:auto_commit_acks],\n params[:pre_acknowledge] || false,\n params[:ack_batch_size] || 1)\n (@sessions << session) if params.fetch(:managed, false)\n session\n end", "def create_consumer_session\n connection.create_session(@config || {})\n end", "def new\n @session = Session.new('')\n end", "def new_session(options)\n options[:source_profile] = options[:source_profile].to_sym\n options[:profile] = options[:profile].to_sym\n\n user_prof = user_profile(options[:source_profile], options[:config_file])\n options = user_prof.to_h.deep_merge(options).deep_symbolize_keys\n\n sb = SessionBuilder.new(\n mfa_device: mfa_device(options),\n session_duration_seconds: options[:duration],\n source_profile: user_prof\n )\n set_user_session_profile(options[:profile], sb.session_profile)\n end", "def create_session(config)\n options = (config[:options] || {}).dup\n session = Moped::Session.new(config[:hosts], options)\n session.use(config[:database])\n if authenticated?(config)\n session.login(config[:username], config[:password])\n end\n session\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 create_session(session_id, data)\n session_id = escape(session_id)\n new_session = new(session_id, data)\n new_session\n end", "def create!(*args)\n session = new(*args)\n session.save!\n session\n end", "def new_client(username , password)\n @client = Octokit::Client.new(:login => username, :password => password)\nend", "def new_session\n IntegrationSession.new\n end", "def open_session; end", "def new\n @session = Session.new\n end", "def create_session\n Puppet::HTTP::Session.new(self, build_resolvers)\n end", "def create!(*args)\n session = new(*args)\n session.save!\n end", "def create!(*args)\n session = new(*args)\n session.save!\n end", "def new\n\t\t@client = Client.new\n\tend", "def set_session\n session_id = SecureRandom.hex(4)\n @connections[:clients].each do |other_session, other_client|\n if session_id == other_session\n # session_id is not unique\n set_session\n end\n end\n session_id\n end", "def new\n @client = Client.new\n end", "def new\n @client = Client.new\n end", "def new\n @client = Client.new\n end", "def new\n @session = Session.new\n end", "def session_begin(cred, mode)\n #This is a stub, used for indexing\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_session\n session = IntegrationSession.new\n session.test_case = self\n return session\n end", "def create_session\n raw_token, enc_token = account.create_session(ip, meta_info)\n set_account_cache(account, raw_token)\n set_auth_token_cache(enc_token, raw_token)\n return raw_token\n end", "def start_session\n generate_token(:token)\n setup_session\n update_last_session\n end", "def new_user_session(user)\n session = new_session\n session.login!(user)\n return session\n end", "def create_client\n client_public, client_private = ZMQ::Util.curve_keypair\n store_known_client(client_public)\n\n {\n server_public_key: @public_key,\n public_key: client_public,\n private_key: client_private\n }\n end", "def create_new_id\n @new_session = true\n self.class.generate_unique_id\n end", "def create\n unathenticated_error if ! @api_consumer.is_a? Service\n service = @api_consumer\n\n @session = Session.create(service_id: service.id)\n\n invalid_request_error_check\n end", "def create_session(start, opts = {})\n data, _status_code, _headers = create_session_with_http_info(start, opts)\n return data\n end", "def create_session(location='', opts={})\n opts.merge!({:location => location})\n doc = do_request '/session/create', opts\n\n unless doc.get_elements('Errors').empty?\n raise OpenTokException.new doc.get_elements('Errors')[0].get_elements('error')[0].children.to_s\n end\n Session.new doc.root.get_elements('Session')[0].get_elements('session_id')[0].children[0].to_s\n end", "def new\n build_client\n end", "def create\n @session = SessionService.new(current_user).create_from_web! session_params\n\n respond_to do |format|\n format.html { redirect_to @session, notice: 'Session was successfully created.' }\n format.json { render json: @session, status: :created }\n end\n end", "def new_session\r\n session = ActionController::Integration::Session.new\r\n yield session if block_given?\r\n session\r\nend", "def get_new_session\n client = prepare_request(auth_url)\n\n login_response = do_request_and_handle_errors do\n client.request :login do |soap|\n soap.body = {:id => @user, :pw => @pass}\n end\n end\n\n @session = login_response.to_hash[:login_response][:login_return]\n @cookie = login_response.http.headers[\"Set-Cookie\"]\n\n false unless @session.instance_of? Nori::StringWithAttributes\n end", "def set_client\n @client = Client.find(params[:id])\n session[:client] = @client.id\n \n end", "def create_session(client_id, appointment_id)\n opentok_session = create_opentok_session(type: 'media_mode')\n return false unless opentok_session.present?\n\n client = Client.find_by(id: client_id)\n appointment = client.appointments.find_by(id: appointment_id)\n token = generate_token(opentok_session)\n appointment.video_session_uid = opentok_session.session_id\n appointment.video_session_token = token\n appointment.save(validate: false)\n { api_key: Opentok.api_key, session_id: appointment.video_session_uid, token: appointment.video_session_token }\n end", "def new\n @session = User::Session.new\n end", "def open_session\n @current_session = new_session\n @current_session.test_case = self\n yield @current_session if block_given?\n @current_session\n end", "def create_session(parms)\n @session = Session.new(parms)\n pp @session\n returnValue = false\n if people = People.auth(@session)\n session[:people] = people.id\n cookies[:people] = people.id\n unless people.id.nil?\n returnValue = true\n end\n end\n returnValue\n end", "def session(params={}, &proc)\n raise \"HornetQ::Client::session mandatory block missing\" unless proc\n session = nil\n begin\n session = create_session(params)\n proc.call(session)\n ensure\n session.close if session\n end\n end", "def create_session(conn, opts={})\n # If there is a parent payload, then use that in preference.\n return parent_payload.create_session(conn, opts) if (parent_payload)\n\n # If the payload we merged in with has an associated session factory,\n # allocate a new session.\n if (self.session)\n begin\n # if there's a create_session method then use it, as this\n # can form a factory for arb session types based on the\n # payload.\n if self.session.respond_to?('create_session')\n s = self.session.create_session(conn, opts)\n else\n s = self.session.new(conn, opts)\n end\n rescue ::Exception => e\n # We just wanna show and log the error, not trying to swallow it.\n print_error(\"#{e.class} #{e.message}\")\n elog('Could not allocate a new Session.', error: e)\n raise e\n end\n\n # Pass along the framework context\n s.framework = framework\n\n # Associate this system with the original exploit\n # and any relevant information\n s.set_from_exploit(assoc_exploit)\n\n # set injected workspace value if db is active\n if framework.db.active && wspace = framework.db.find_workspace(s.workspace)\n framework.db.workspace = wspace\n end\n\n # Pass along any associated payload uuid if specified\n if opts[:payload_uuid]\n s.payload_uuid = opts[:payload_uuid]\n s.payload_uuid.registered = false\n\n if framework.db.active\n payload_info = {\n uuid: s.payload_uuid.puid_hex,\n workspace: framework.db.workspace\n }\n if s.payload_uuid.respond_to?(:puid_hex) && (uuid_info = framework.db.payloads(payload_info).first)\n s.payload_uuid.registered = true\n s.payload_uuid.name = uuid_info['name']\n s.payload_uuid.timestamp = uuid_info['timestamp']\n else\n s.payload_uuid.registered = false\n end\n end\n end\n\n # If the session is valid, register it with the framework and\n # notify any waiters we may have.\n if (s)\n register_session(s)\n end\n\n return s\n end\n nil\n end", "def handle_connection(conn, opts={})\n create_session(conn, opts)\n end", "def opentok_session\n opentok.create_session(request.remote_addr).to_s\n end", "def connect!\n sessions\n self\n end", "def create_session(body, opts = {})\n data, _status_code, _headers = create_session_with_http_info(body, opts)\n data\n end", "def create_client(&callback)\n begin\n client_id = @server.generate_id\n end while @connected.containsKey(client_id)\n ping(client_id)\n @server.debug 'Created new client ?', client_id\n @server.trigger(:handshake, client_id)\n callback.call(client_id)\n end", "def create_session socket\n puts \"Creating new client\"\n # Delegate session handling to a thread\n Thread.new do\n # Wait for the socket to get a message\n done = false\n while !done do\n #puts \"Waiting for message\"\n message = get_message socket\n puts \"Got: #{message}\"\n # Check that the message isn't empty\n if message == \"\"\n done = true\n end\n\n send_message socket, message\n end\n\n puts \"Closing socket\"\n # Clean up\n socket.close\n end\nend", "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_session\n session[:who_is_this] = \"admin\"\n end", "def create_client\n\nend", "def create_write_and_return_new_session!\n require 'timeout'\n\n session = DropboxSession.new(api_key, api_secret)\n\n # grab the request token for session\n session.get_request_token\n\n template = Backup::Template.new(\n {:session => session, :cached_file => cached_file}\n )\n template.render(\"storage/dropbox/authorization_url.erb\")\n\n # wait for user to hit 'return' to continue\n Timeout::timeout(180) { STDIN.gets }\n\n # this will raise an error if the user did not\n # visit the authorization_url and grant access\n #\n # get the access token from the server\n # this will be stored with the session in the cache file\n session.get_access_token\n\n template.render(\"storage/dropbox/authorized.erb\")\n write_cache!(session)\n template.render(\"storage/dropbox/cache_file_written.erb\")\n\n session\n\n rescue => err\n raise Errors::Storage::Dropbox::AuthenticationError.wrap(\n err, 'Could not create or authenticate a new session'\n )\n end", "def create_session_with_http_info(start, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SessionApi.create_session ...\"\n end\n # verify the required parameter 'start' is set\n fail ArgumentError, \"Missing the required parameter 'start' when calling SessionApi.create_session\" if start.nil?\n # resource path\n local_var_path = \"/session/add\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'start'] = start\n query_params[:'boat_id'] = opts[:'boat_id'] if !opts[:'boat_id'].nil?\n query_params[:'trip_id'] = opts[:'trip_id'] if !opts[:'trip_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 => 'InlineResponse20043')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SessionApi#create_session\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def new\n @taster_session = TasterSession.new\n end", "def create\n @current_user = Client.find_by( :email => params[:email] )\n if @current_user.nil?\n @current_user = Trainer.find_by( :email => params[:email] )\n end\n\n if @current_user.present? && @current_user.authenticate( params[:password] )\n session[:user_id] = @current_user.id\n if @current_user.class == Trainer\n session[:type_of_person] = \"Trainer\"\n else\n session[:type_of_person] = \"Client\"\n end\n flash[:success] = \"Successfully logged in\"\n redirect_to @current_user\n else\n flash[:error] = \"Invalid email or password\"\n redirect_to login_path\n end\n end", "def create_session(timeout=nil)\n if timeout.class == Fixnum && !block_given?\n return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createSession, [Java::long.java_class]).call(timeout),::VertxWeb::Session)\n end\n raise ArgumentError, \"Invalid arguments when calling create_session(timeout)\"\n end", "def session(nonce, encrypted_session_key)\n sid = 0 # TODO(costan): FPGA session allocation\n nonce_hmac = @fpga.establish_session sid, nonce, encrypted_session_key\n server_session = Session.new @fpga, @disk, sid, @data_start,\n @tree, @tree_driver\n { :nonce_hmac => nonce_hmac, :session => server_session }\n end", "def new(*)\n # return new mock session\n BunnyMock::Session.new\n end", "def create_session user_id\n @state.user_id = user_id\n end", "def create\n session = Session.new\n session.name = params[:name]\n session.description = params[:description]\n session.start_time = params[:date]\n # TODO: need date\n # TODO: need topic\n session.active = true;\n # add ot_session.id\n ot_session = @@opentok.create_session({media_mode: :routed})\n session.session_id = ot_session.session_id\n # try and save the session\n saved = session.save\n # add moderators\n params[:moderators].each do |moderator|\n SessionUser.create(session_id: session.id, user_id: moderator[:id], role: 'moderator', center_stage: true)\n end\n # add subscribers\n params[:subscribers].each do |subscriber|\n puts subscriber\n SessionUser.create(session_id: session.id, user_id: subscriber[:id], role: 'publisher', center_stage: false)\n end\n if saved\n render json: {message: \"Event: #{session.name} successfully added\"}, status: 200\n else\n render json: {errors: session.errors.to_json}, status: 500\n end\n end", "def create_new_session\n session = reviewer_access_sessions.build\n session.save!\n session\n end", "def initialize(session, client_opts = {})\n @session = session\n @client = Client.new(session, client_opts)\n end", "def init_session\n if session\n if session.updated_at < Time.now - ::Gricer.config.max_session_duration\n self.session = Session.create previous_session: session, ip_address: @ip_address, agent: agent, requested_locale: @request_locale\n else\n self.session.touch\n end\n else\n self.is_first_in_session = true\n self.session = Session.create ip_address: @ip_address, agent: agent, requested_locale: @request_locale\n self.session.touch\n end\n \n session\n end", "def create\n \n # remove any existing session of this user\n # TODO: update custom validations in model to work with this\n @session = Session.where(\"sender_id = #{session_params[:sender_id]} OR recipient_id = #{session_params[:sender_id]}\").first\n @session.destroy if @session\n \n @session = Session.new(session_params)\n \n if @session.valid?\n @session.session_id = Session.createSession(request.remote_addr).to_s\n @session.sender_token = Session.generateToken(@session.session_id, @session.sender.id.to_s)\n @session.recipient_token = Session.generateToken(@session.session_id, @session.recipient.id.to_s)\n end\n\n respond_to do |format|\n if @session.save\n format.html { redirect_to @session, notice: 'Session was successfully created.' }\n format.json { render action: 'show', status: :created, location: @session }\n else\n format.html { render action: 'new' }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end", "def create(*args, &block)\n session = new(*args)\n session.save(&block)\n end", "def new(api_key = nil, secret_key = nil, session_key = nil)\n Session.create(api_key, secret_key, session_key)\n end", "def session\n @@session ||= []\n if @@session[self.id].nil?\n session = GData::Client::Calendar.new\n token = session.clientlogin(username,password)\n @@session[self.id] = session\n end\n @@session[self.id]\n end", "def start_session(endpoint); end", "def create(description, permitted_ips: nil)\n fail ArgumentError, 'description is required' unless description\n fail 'Cannot create session, please add the api_key to your configuration' unless @client.configuration.api_key\n\n params = {description: description, secret: @client.configuration.api_key}\n params[:permitted_ips] = permitted_ips if permitted_ips\n\n @resource.post(params)['Response']\n end", "def create_session_pool(params={})\n require 'hornetq/client/session_pool'\n SessionPool.new(self, params)\n end", "def create_client!\n Chef::ApiClient::Registration.new(node_name, client_path, http_api: rest).run\n end", "def initialize_session(params_hash)\n raise_error_unless_params_is_a_hash(params_hash)\n raise_error_if_params_are_empty(params_hash)\n request.method = :post\n request.uri = '_session'\n Couchdbtools.execute(request)\n end", "def create_session(ip, meta_info={})\n raw, enc = Authentication::TokenGenerator.generate(Authentication::Session, 'authentication_token')\n Authentication::Session.create({\n 'authentication_token' => enc,\n 'meta_info' => meta_info,\n 'ip' => ip,\n 'account_id' => self.id\n })\n return raw, enc\n end", "def establish_new_session(header_and_content_hash)\n @session = header_and_content_hash\n @step = 0\n @state = [:uninitiated]\n session_initiated \n @state << :initiated\n header_and_content_hash\n end", "def set_session\n \n end", "def create_session(params)\n driver.createSession(\n self.account_data,\n self.transaction_data(params),\n params[:transaction_type],\n params[:payment_type],\n params[:options] || {},\n { 'redirectUrl' => params[:success_url], 'silentErrorUrl' => params[:error_url] }\n )[0]\n end", "def create_session_with_http_info(account_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SessionsApi.create_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.create_session\"\n end\n # resource path\n local_var_path = '/accounts/{accountId}/sessions'.sub('{' + 'accountId' + '}', CGI.escape(account_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 # 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(opts[:'session'])\n\n # return_type\n return_type = opts[:debug_return_type] || 'Session'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['httpBasic']\n\n new_options = opts.merge(\n :operation => :\"SessionsApi.create_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(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SessionsApi#create_session\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def session\n Thread.current['clients_manager'].client('Website').session\n end", "def new(options = {})\n session = with(options)\n session.instance_variable_set(:@cluster, cluster.dup)\n\n if block_given?\n yield session\n else\n session\n end\n end", "def create\n config_opentok\n session = @opentok.create_session request.remote_addr\n params[:room][:sessionId] = session.session_id\n \n @room = Room.new(params[:room])\n\n respond_to do |format|\n if @room.save\n format.html { redirect_to @room, notice: 'Room was successfully created.' }\n format.json { render json: @room, status: :created, location: @room }\n else\n format.html { render action: \"new\" }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end", "def open_session\n s = Session.wrap(Cproton.pn_session(@impl))\n s.open\n return s\n end", "def open\n session = @@opentok.create_session({media_mode: :routed})\n @session = Session.create(session_id: session.session_id,\n active: true)\n render json: @session\n end", "def create\n return if Settings.readonly \n\n @session = Session.new(session_params)\n\n respond_to do |format|\n if @session.save\n format.html { redirect_to sessions_url, notice: 'Session was successfully created.' }\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 new\n @client = Client.new\n respond_with(@client)\n end", "def generateSession\n sessionId = SecureRandom.base58(24)\n @test.update(session_id: sessionId)\n\n # set expiry date to 15 minutes from now\n @test.update(session_expired_at: Time.now + 15*60)\n\n render json: sessionId\n end", "def createSession(groupID, authorID, validUntil)\n call :createSession, :groupID => groupID, :authorID => authorID, :validUntil => validUntil\n end", "def create_client(name, facebook_id, twitter_handle)\n puts name, facebook_id, twitter_handle\n # Point the HTTP POST method at the clients endpoint of Klipfolio's API.\n response = self.class.post(\"https://app.klipfolio.com/api/1.0/clients\", basic_auth: @auth, headers: { \"Content-Type\" => \"application/json\" },\n body: {\n \"name\": name,\n \"description\": \"\",\n \"seats\": 5,\n \"status\": \"active\"\n }.to_json)\n puts response.body\n puts \"Client was successfully created.\" if response.success?\n\n # Extract the new client's ID from the HTTP response so that it can be passed to the update_features & update_resources methods.\n client_id = response[\"meta\"][\"location\"]\n client_id.slice!(\"/clients/\")\n p client_id\n\n update_resources(client_id)\n update_features(client_id)\n update_company_properties(client_id, facebook_id, twitter_handle)\n create_group(client_id)\n share_dashboard(client_id)\n end", "def start_session(nick)\n usr = User.first(:nickname=>params[:nickname])\n p User.all\n if usr != nil\n sid = gen_sessionid\n\n #associate nick with sid & IP & communication password\n $sessions[nick] = {:ip=>@env['REMOTE_ADDR'], :sid=> sid, :lastrequest=> Time.now.to_i}\n\n #return JSON with sessionid\n return {:sid => sid}\n end\n return 'error'\nend", "def recreate_client\n @http.close\n create_client\n end", "def create\n\t\tclient = Client.find_by_email(params[:email])\n\t\t\tif client && client.authenticate(params[:password])\n\t\t\t\tsession[:client_id] = client.id\n \t\t\t\tredirect_to root_path \n \t\t\telse\n \t\t\t\trender \"new\" , alert: \"User Id And or Password Invalid\"\n \t\t\tend\n \tend", "def create(identity, client, scope, redirect_uri = nil, expires = nil, instance_name = \"default-client\", instance_description = \"default client\" )\n raise ArgumentError, \"Identity must be String or Integer\" unless String === identity || Integer === identity\n scope = Utils.normalize_scope(scope) & client.scope # Only allowed scope\n expires_at = Time.now.to_i + (expires || 300)\n fields = { :_id=>Server.secure_random, :identity=>identity, :scope=>scope,\n :client_id=>client.id, :redirect_uri=>client.redirect_uri || redirect_uri,\n :created_at=>Time.now.to_i, :expires_at=>expires_at, :granted_at=>nil,\n :access_token=>nil, :revoked=>nil ,\n :instance_name => instance_name, :instance_description => instance_description }\n collection.insert fields\n Server.new_instance self, fields\n end", "def create_session(channel_id, options={})\n match = post_json(\"sessions\", options.merge(\n :channel_id => channel_id.to_s\n ))[:body].match(%r{/sessions/([^/]+)})\n match[1] if match\n end" ]
[ "0.74348104", "0.7222111", "0.7107012", "0.6948435", "0.6908423", "0.6827826", "0.6774391", "0.6759977", "0.6673508", "0.660458", "0.653711", "0.65355337", "0.64882755", "0.64788604", "0.64762074", "0.6443971", "0.6440006", "0.6435148", "0.6417136", "0.6377964", "0.6377882", "0.63608176", "0.63608176", "0.635904", "0.6351099", "0.63506407", "0.63506407", "0.63506407", "0.63500756", "0.6341752", "0.6332186", "0.63298106", "0.6308273", "0.6291437", "0.6229401", "0.6200133", "0.6168531", "0.61684155", "0.6141573", "0.6133415", "0.6115365", "0.6104238", "0.6100711", "0.60858", "0.6075561", "0.60755503", "0.60737175", "0.6071932", "0.6071835", "0.6069743", "0.6067374", "0.60655504", "0.60505486", "0.6049496", "0.6045965", "0.6031222", "0.6022257", "0.6022107", "0.6013279", "0.6007621", "0.59974295", "0.59943354", "0.5984612", "0.59842515", "0.598349", "0.5954805", "0.5952929", "0.5951616", "0.5943534", "0.5943378", "0.59389323", "0.5926502", "0.59251964", "0.59164155", "0.5914322", "0.59090406", "0.5891738", "0.5881528", "0.5876181", "0.58756626", "0.5871296", "0.5870956", "0.5869024", "0.5865231", "0.5851666", "0.5842445", "0.5836396", "0.5835016", "0.58346087", "0.58319074", "0.5831226", "0.5822254", "0.58221465", "0.58207464", "0.58160275", "0.58148307", "0.5810963", "0.58072305", "0.58070284", "0.5798315", "0.579702" ]
0.0
-1
check user is admin or client
def check_admin(username) consumer = fetch_consumer(username) consumer.admin end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def admin_only\n current_client == current_user\n unless current_user.admin? || @client == current_user\n redirect_to clients_path, :alert => \"Access denied.\"\n end\n end", "def is_admin?(user)\n user.admin > 0\n end", "def admin_user?\n self.admin ==true\n end", "def admin? ; user.instance_of? User and user.role >= 2 ; end", "def is_admin?(user_id)\n\t\treturn admin == user_id\n\tend", "def admin?\n if self.login == \"admin\"\n return true\n else\n return false\n end\n end", "def is_admin_or_owner client, event\n # calls users_info on slack\n info = client.users_info(user: event.user_id ) \n info['user']['is_admin'] || info['user']['is_owner']\n end", "def is_admin?\n usertype == \"admin\" and id == 0\n end", "def normal_user?\n self.admin ==false\n end", "def user_admin?\n user_logged_in? && @current_user.type == 'Admin'\n end", "def admin_user?\n\t\treturn self.user_category == \"admin\"\n\tend", "def admin?\n user = check_user\n user.role == User.role_types['Admin']\n end", "def admin_user?\n \treturn self.user_category == \"admin\"\n end", "def admin_user\n (current_user.present? && current_user.admin?)\n end", "def admin?\n self.user_type == TYPES[:admin]\n end", "def admin?\n user.admin?\n end", "def admin_user?\n (current_user.role == 'admin') if logged_in?\n end", "def user_admin?\n \t@admin_user = Usuario.find(session[:user_id]).admin\n end", "def admin_user?\n session[:user][:uid] == APP_CONFIG[:admin]\n end", "def admin_user?\n current_user.admin\n end", "def checkAdmin\n current_user.present? && current_user.isAdmin\n end", "def is_admin?\n user_type == 'super_admin' || user_type == 'admin'\n end", "def admin?\n logged_in? && current_user.login == \"ej0c\"\n end", "def admin?\n return false\n # return (session[:user_id] && User.find(session[:user_id])[:login] == '') ? true : false\n end", "def admin_loggedin?\r\n @logged_in_user and @logged_in_user.admin?\r\n end", "def admin_user\n @current_user.admin?\n end", "def admin_required\n session[:user_id] && (user = User.find(session[:user_id])) && user.is_admin\n end", "def admin_user?\n if current_user != nil\n !!current_user.admin\n end\n end", "def is_admin?\n current_user ? current_user.login == 'admin' : false\n end", "def admin?\n @user = current_user.is_admin?\n end", "def admin_user?\n member_type == MEMBER_TYPE[:admin]\n end", "def is_admin?\n if login == \"ankit\"\n return true\n else\n return false\n end\n end", "def admin?\n User.admin_logged_in?\n end", "def admin?\n user.class.name == Admin.name\n end", "def current_user_is_admin\n\t\ttrue if current_user.admin == 't'\n\tend", "def is_admin?\n is_admin == 1\n end", "def admin?\n c_user = current_user\n not c_user.nil? and c_user.group==\"admin\"\n end", "def admin_access?\n admin?\n end", "def is_administrator?(user)\n user.admin == 2\n end", "def user_is_admin?\n\tbegin\n\t `gpresult /r /scope user`.split.include? \"Admin\"\n\trescue\n\t false\n\tend\n end", "def admin?\n\t\tuser_session.admin?\n\tend", "def current_admin?(user)\n current_user.admin?\n end", "def admin?\n\t\tcurrent_user.try(:admin)\n\tend", "def admin?\n current_user.admin?\n end", "def admin_user?\n unless (current_user && current_user.admin?)\n flash[:danger] = \"You are not an admin. You can not do that\"\n redirect_to :action => 'index'\n end\n end", "def eventunscrape?\n @user.is_admin?\n end", "def admin?\n return !new_record? && login == 'admin'\n end", "def admin_logged_in?\n current_user && current_user.admin?\n end", "def is_admin?\n current_user && current_user.try(:admin?)\n end", "def admin?\n logged_in? && current_user.admin?\n end", "def is_admin\n \tif current_user != nil\n\t \t \tif !current_user.admin\n redirect_to root_path, :alert => \"Acceso denegado\"\n\t \tend\n\t\t else\n redirect_to root_path, :alert => \"Acceso denegado\"\n\t\t end\n \t\t\n\n end", "def admin?\n logged_in? and current_user.admin?\n end", "def admin?\n @user.admin?\n end", "def current_user?(user)\n (user == self.current_user) || admin?\n end", "def admin?\n self.admin_user\n end", "def admin?\n return ( self.user_type == User::USER_TYPE_ADMIN )\n end", "def admin_user\n # get current user for session and check if they are an administrator\n check_admin_user = current_user\n return check_admin_user.admin?\n end", "def admin?\n self.email == \"vinti.uiet@gmail.com\" || self.email == \"parryg@hotmail.com\"\n end", "def admin?\n @current_user.admin?\n end", "def isuseradmin?\n if $credentials != nil\n isadminornot = User.where(:username => $credentials[0]).to_a.first\n @adminuser = \"#{isadminornot.username}\"\n if @adminuser == \"Admin\"\n return true\n else \n return false\n end\n end\n end", "def admin?\n if(@current_user)\n @current_user.admin?\n end\n end", "def is_admin?\n current_user && current_user.admin?\n end", "def admin?\n current_user.admin?\n end", "def admin?(user)\n user.role_names.include?('cmsadmin')\n end", "def admin?\n current_user && current_user.role?(\"admin\")\n end", "def admin?\n\tif session[:customer_id].nil?\n\t\treturn\n\telse\n signed_in? == true\n\t@current_customer == Customer.find_by_id(3)\n\tend\nend", "def user?(admin)\n admin&.id == self.admin_id\n end", "def current_user_admin?\n current_user && current_user.admin?\n end", "def admin_required\n self.current_user != :false && \n self.current_user.is_admin? ? true : access_denied\n end", "def admin_logged_in?\n User.admin_logged_in?\n end", "def admin_logged_in?\n User.admin_logged_in?\n end", "def isAdmin?\n return current_usuario != nil && current_usuario.admin\n end", "def check_if_should_be_admin\n end", "def user_is_owner_or_admin?\n record.user == user || user.try(:admin?)\n end", "def admin?\n self.role == 53\n end", "def admin?\n logged_in? && current_user.admin\n end", "def is_admin?\n current_user && current_user.site=='admin'\n end", "def is_admin?\n if valid_session?\n current_user.admin == true\n end\n end", "def is_admin?\n admin?\n end", "def admin_authorized?\n\t\tif @user\n\t\t\t@user.level >= ADMIN_USER_LEVEL \n\t\telse\n\t\t\tnil\n\t\tend\n\tend", "def is_admin?\n admin\n end", "def is_admin?\n admin\n end", "def admin_logged_in?\n #if session[:logged_in] == true && (session[:host_id] == 670999089 || session[:host_id] == 753452019 || session[:host_id] == 100000182246137)\n if session[:logged_in] == true && User.find(session[:id]).admin == true\n true\n else\n false\n end\n\n end", "def user_is_owner_or_admin?\n record.reading.user == user || user.try(:admin?)\n end", "def is_admin\n admin?\n end", "def admin_required\n current_user.respond_to?('is_admin') && current_user.send('is_admin')\n end", "def admin?\n if (User.find session[:user_id]).role == \"Admin\"\n true\n end\n end", "def is_admin?\n current_user && current_user.admin?\n end", "def is_admin?\n current_user && current_user.admin\n end", "def admin?\n !current_user.AdminScreen?\n end", "def check_admin\n # using the function above by grabbing the id\n @current_user = find_current_user\n # cross checking to see if user is also an admin\n unless @current_user.present? and @current_user.is_admin?\n #they're find so no additional code needed\n #if they're not admin\n redirect_to root_path\n end\n end", "def admin?; current_user.admin?; end", "def admin?; current_user.admin?; end", "def admin?\n \tself.role == \"admin\" || self.email == 'admin@mycrm.com'\n end", "def admin?\n return false unless authenticated?\n User.exists?(cas_username: session['cas']['user'])\n end", "def admin?\n role == 1\n end", "def is_admin?\n logged_in? && current_user && current_user.admin\n end", "def admin_required\n current_user.respond_to?('is_admin') && current_user.send('is_admin') || access_denied\n end", "def user_authorized?(user)\n user == current_user || is_admin?\n end", "def user_admin?\n unless current_user.present? && current_user.admin?\n redirect_to home_welcome_path and return\n end \n end", "def admin? \n (logged_in? && current_member.admin?) ? true : false\n end" ]
[ "0.79785734", "0.79475933", "0.79395527", "0.79364675", "0.7856753", "0.7847651", "0.7841373", "0.78309673", "0.7818261", "0.7785563", "0.7780675", "0.7764129", "0.7747446", "0.77405417", "0.77403396", "0.77308017", "0.77283233", "0.77134126", "0.77132547", "0.7696463", "0.7693583", "0.7692289", "0.7686036", "0.76624614", "0.76431876", "0.7641484", "0.76413727", "0.76329595", "0.7630573", "0.76260304", "0.76097214", "0.76091576", "0.76011646", "0.7599237", "0.75975627", "0.75930446", "0.75926566", "0.7589787", "0.7583068", "0.757283", "0.7569662", "0.75624824", "0.75592315", "0.75556797", "0.7548925", "0.7545512", "0.75398785", "0.75384724", "0.7536715", "0.75352585", "0.7527884", "0.7525544", "0.7520253", "0.75181097", "0.75141317", "0.7509593", "0.7505773", "0.750454", "0.75037175", "0.75033456", "0.7499136", "0.7498638", "0.7497066", "0.7492426", "0.74865186", "0.7482264", "0.7475971", "0.7475855", "0.747374", "0.7470267", "0.7470267", "0.7465682", "0.7464599", "0.7462608", "0.7457", "0.7453053", "0.74526966", "0.7446091", "0.74451286", "0.74445593", "0.74371105", "0.74371105", "0.7430604", "0.7429518", "0.74261993", "0.7420478", "0.7414872", "0.7413546", "0.74115336", "0.74102247", "0.74099207", "0.740501", "0.740501", "0.7402546", "0.7399554", "0.73989594", "0.7397437", "0.73941284", "0.73902965", "0.7380089", "0.73791105" ]
0.0
-1
Unlocks the current job, then lock for processing
def execute(callback) unlock(:server) runtime_lock.execute(callback) do yield end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unlock\n if job\n job.report_running if report_job_status\n job.set_status(\"Unlocking #{to_s}\")\n end\n\n attempt_unlock\n\n report(true)\n end", "def unlock\n locksmith.unlock # Only signal to release the lock\n end", "def unlock\n @locking = false\n end", "def unlock\n @mutex.unlock\n end", "def unlock\n self.is_locked = false\n self\n end", "def release_lock\n super\n end", "def unlock\n if @locking\n @locking_file.close\n end\n end", "def unlock\n if @locking\n @locking_file.close\n end\n end", "def unlock\n if @locking\n @locking_file.close\n end\n end", "def unlock(job_id)\n locked.del(job_id)\n end", "def unlock\n\t\t\treturn unless @locked\n\t\t\tif @nested_locks > 0\n\t\t\t\t@nested_locks -= 1\n\t\t\telse\n\t\t\t\tThread.critical = true\n\t\t\t\t@locked = false\n\t\t\t\tbegin\n\t\t\t\t\tt = @waiting.pop\n\t\t\t\t\tt.wakeup if t\n\t\t\t\trescue ThreadError\n\t\t\t\t\tretry\n\t\t\t\tend\n\t\t\t\tThread.critical = false\n\t\t\t\tbegin\n\t\t\t\t\tt.run if t\n\t\t\t\trescue ThreadError\n\t\t\t\tend\n\t\t\tend\n\t\t\tself\n\t\tend", "def unlock\n end", "def unlock; end", "def unlock\n FileUtils.rm(lock_file) if File.exist?(lock_file)\n reset!\n end", "def unlock\n unlock!\n self\n end", "def unlock\n FileUtils.rm(lock_file) if File.exist?(lock_file)\n reset!\n end", "def unlock!\n if @locked\n cleanup_lock_file!\n @locked = false\n true\n end\n end", "def unlock\n self.is_locked = false\n self.locked_at = nil\n save!\n end", "def unlock!\n self.locked_by = nil\n self.locked_at = nil\n save!\n end", "def unlock\n self.locked_at = nil\n self.locked_by = nil\n end", "def unlock\n return unless @locking\n\n @locking_file.close\n\n return unless File.exist?('/var/tmp/vcenter-importer-lock')\n\n File.delete('/var/tmp/vcenter-importer-lock')\n end", "def unlock\n self.locked_at = nil\n self.locked_by = nil\n 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 unlock\n self.locked_at = nil\n self.locked_by = nil\n end", "def unlock\n return unless locked?\n unlink_pid_file\n end", "def perform(*arguments)\n lock_until = acquire_lock!(*arguments)\n\n # Release loner lock as job has been dequeued\n release_loner_lock!(*arguments) if loner\n\n # Abort if another job holds the lock.\n return unless lock_until\n\n begin\n super(*arguments)\n ensure\n # Release the lock on success and error. Unless a lock_timeout is\n # used, then we need to be more careful before releasing the lock.\n now = Time.now.to_i\n if lock_until != true and lock_until < now\n # Eeek! Lock expired before perform finished. Trigger callback.\n lock_expired_before_release(*arguments)\n else\n release_lock!(*arguments)\n end\n end\n end", "def with_lock\n self.lock = 1\n yield\n self.lock = 0\n queue_available_jobs\n end", "def lock_job\n log(:at => \"lock_job\")\n job = nil\n while @running\n break if job = @queue.lock\n @queue.wait\n end\n job\n end", "def unlock(*args, &block)\n map_method(:unlock, args, &block)\n end", "def exclusive_unlock\n\t\t\treturn unless @locked\n\t\t\tif @nested_locks > 0\n\t\t\t\t@nested_locks -= 1\n\t\t\telse\n\t\t\t\tThread.exclusive do\n\t\t\t\t\t@locked = false\n\t\t\t\t\tbegin\n\t\t\t\t\t\tt = @waiting.pop\n\t\t\t\t\t\tt.wakeup if t\n\t\t\t\t\trescue ThreadError\n\t\t\t\t\t\tretry\n\t\t\t\t\tend\n\t\t\t\t\tyield\n\t\t\t\tend\n\t\t\tend\n\t\t\tself\n\t\tend", "def unlock(_uri, lock_info)\n locks = data\n locks.each_with_index do |lock, k|\n next unless lock.token == lock_info.token\n locks.delete_at(k)\n put_data(locks)\n return true\n end\n\n false\n end", "def release_lock\n return true unless @handle\n set_message ''\n @handle.flock(File::LOCK_UN)\n @handle.close\n @handle = nil\n true\n end", "def async_unlock(environment)\n job = Job.new(:unlock)\n async(:unlock, job, environment)\n job.ticket\n end", "def release\n locked? && release!\n end", "def result_unlock\n\n end", "def unlock\n if @mutex\n if @owner == Thread.current.object_id\n @count -= 1\n if @count == 0\n @owner = nil\n @mutex.unlock\n end\n end\n end\n end", "def lock\n post :lock\n end", "def lock\n self.is_locked = true\n self\n end", "def release\n return unless @lock_file # Skip if we don't have a file\n\n @lock_file.flock(File::LOCK_UN)\n File.delete( @lock_file )\n close_file\n end", "def lock!\n @locked = true\n end", "def lock!; end", "def lock!\n self.for_update!\n end", "def unlock(obj)\n logger\n if locked?(obj)\n RedisMutexer.config.redis.del(key(obj))\n end\n end", "def lock!\n @locked = true\n end", "def lock\n @locked = true\n self\n end", "def locked; end", "def release_advisory_lock(lock_id) # :nodoc:\n end", "def release_advisory_lock(lock_id) # :nodoc:\n end", "def lock\n @privkey = nil\n @locked = true\n end", "def unlock\n\t\tif (@lock == 0) \n\t\t\traise \"Cannot unlock unlocked engine\"\n\t\tend\n\t\t@lock -= 1\n\n\t\twhile (@lock == 0) \n\t\t\tactor = @scheduler.next()\n\t\t\tif (actor == nil) \n\t\t\t\treturn self.lock() # /* no actors */\n\t\t\tend\n\t\t\tresult = actor[:act].call\n\t\t\t# if (result != nil && result[:then] != nil) #/* actor returned a \"thenable\", looks like a Promise */\n\t\t\t# \tself.lock()\n\t\t\t# \tresult.then(self.unlock.bind(self))\n\t\t\t# end\n\t\tend\n\n\t\treturn self\n\tend", "def lock\n end", "def locked\n end", "def unlock\n if (!@owner.nil?)\n if (@owner[:locks].last == self)\n @owner[:locks].pop\n else\n if @owner[:locks].delete(self)\n @out_of_order_locks += 1\n raise EMutexOrder.new(self, \"Expected #{@owner[:locks].last}\")\n end\n # if called again let it pass\n end\n @owner = nil\n end\n super\n end", "def lock\n shaz_nolock_lock if !@nolock\n end", "def unlock_access!; end", "def resend_unlock_instructions\n if_access_locked { send_unlock_instructions }\n end", "def lock!\n freeze!\n @locked = true\n self\n end", "def with_lock\n lock!(true)\n yield\n ensure\n unlock!\n end", "def unlock_all!\n locks.active.each(&:unlock!)\n end", "def remove_lock\n Sidekiq.redis { |redis| redis.del(@locking_key) }\n end", "def unlock!\n if (lock_expire = @lock_expire) && owner_ident == (lock_full_ident = @locked_owner_id)\n @locked_owner_id = @lock_expire = nil\n removed = eval_safe(@eval_unlock, @ns_names, [lock_full_ident, SIGNAL_QUEUE_CHANNEL, @marsh_names])\n end\n return removed == @ns_names.length && self\n end", "def unlock!\n FileUtils.rm_f @path\n end", "def work\n if job = lock_job\n QC.log_yield(:action => \"work_job\", :job => job[:id]) do\n begin\n call(job)\n log(:action => \"finished_work\", :job => job[:id])\n rescue Object => e\n log(:action => \"failed_work\", :job => job[:id], :error => e.inspect)\n handle_failure(job, e)\n ensure\n @queue.delete(job[:id])\n log(:action => \"delete_job\", :job => job[:id])\n end\n end\n end\n end", "def unlock_all\n Delayed::Job.transaction do\n Delayed::Job.where(:locked_by => hostname).update_all(:locked_by => nil, :locked_at => nil)\n end\n end", "def unlocked?\n unlocked, _, @active_worker_timestamp = Sidekiq.redis do |redis| \n redis.multi do\n redis.setnx(@locking_key, @current_worker_timestamp)\n redis.expire(@locking_key, 600)\n redis.get(@locking_key)\n end\n end\n unlocked\n end", "def release_lock\n if File.exists? lock_file_name\n FileUtils.rm lock_file_name\n true\n else\n false\n end\n end", "def release_loner_lock!(*args)\n lock_redis.del(redis_loner_lock_key(*args))\n end", "def unlock!(key)\n ::DatabaseEntryLock.destroy_by(lock_key: key)\n end", "def pop_perform_unlocked(queue)\n item = pop(queue) or return\n\n job = Resque::Job.new(queue, item)\n if job.uniqueness.perform_locked?\n push(queue, item)\n nil\n else\n job\n end\n end", "def unlock(token)\n if lock_tokens.include? token\n remove_lock token\n @lock_info = nil\n\n :no_content\n else\n :forbidden\n end\n end", "def unlocked_release(id)\n lock_file = @machine_locks[id]\n if lock_file\n lock_file.close\n begin\n File.delete(lock_file.path)\n rescue Errno::EACCES\n # Another process is probably opened it, no problem.\n end\n\n @machine_locks.delete(id)\n end\n end", "def run_action_unlock(item)\n item = validate_item(item)\n ui.print \" Unlocking #{ui.color(item, :bold)}... \"\n content = load_json(File.read(item)).to_smash\n if content[:sfn_parameters_lock]\n content = unlock_content(content)\n content.delete(:sfn_lock_enabled)\n File.write(item, format_json(content))\n ui.puts ui.color(\"unlocked\", :green)\n else\n ui.puts ui.color(\"no-op\", :yellow)\n ui.warn \"Item is already unlocked! (#{item})\"\n end\n end", "def lock; end", "def lock; end", "def lock; end", "def try_lock\n end", "def lock\n # Flush everything to start with a clean state\n # and to protect the @locked variable\n flush\n\n with_flock(File::LOCK_EX) do\n replay\n result = yield\n flush\n result\n end\n end", "def with_lock\n lock\n begin\n yield if block_given?\n ensure\n unlock\n end\n end", "def lock(&block)\n # TODO: only use replace strategy when server is executing the lock\n return call_strategy unless (locked_token = locksmith.lock(&block))\n\n locked_token\n end", "def without_locking(&block)\n self.class.without_locking(&block)\n end", "def lock\n @mutex.lock\n end", "def unlock(token)\n unless(@lock_class)\n NotImplemented\n else\n token = token.slice(1, token.length - 2)\n if(token.nil? || token.empty?)\n BadRequest\n else\n lock = @lock_class.find_by_token(token)\n if(lock.nil? || lock.user != @user)\n Forbidden\n elsif(lock.path !~ /^#{Regexp.escape(@path)}.*$/)\n Conflict\n else\n lock.destroy\n NoContent\n end\n end\n end\n end", "def lock\n @unlocked = false\n \"Diary is now locked\"\n end", "def unlock_repo(lock_file)\n lock_file.close\n lock_file\n end", "def resend_unlock_instructions; end", "def after_perform_check_unique_lock(*args)\n create_job(args).uniqueness.ensure_unlock_perform\n end", "def release_lock( my_owner = oval )\n # Use my_owner = oval to make testing easier.\n with_watch( okey, xkey ) do\n owner = redis.get( okey )\n if owner == my_owner then\n redis.multi do |multi|\n multi.del( okey )\n multi.del( xkey )\n end\n end\n end\n end", "def release_restriction(job)\n tracking_key = tracking_key(*job.args)\n lock_key = lock_key(tracking_key)\n\n run_atomically(lock_key) do\n\n # decrement the count after a job has run\n decrement_running_count(tracking_key)\n\n end\n end", "def without_locking(&block)\n current = ActiveRecord::Base.lock_optimistically\n ActiveRecord::Base.lock_optimistically = false if current\n begin\n block.call\n ensure\n ActiveRecord::Base.lock_optimistically = true if current\n end\n end", "def do_LOCK(req, res)\n end", "def unlock_access!\n self.locked_at = nil\n self.failed_attempts = 0 if respond_to?(:failed_attempts=)\n self.unlock_token = nil if respond_to?(:unlock_token=)\n save(validate: false)\n end", "def delete!\n locksmith.delete! # Force delete the lock\n end", "def try_lock\n if locked_out?\n false\n else\n lock\n true\n end\n end", "def with_lock\n @zk_lock ||= @zk.locker(current_lock_path)\n\n begin\n @zk_lock.lock!(true)\n rescue Exception\n # handle shutdown case\n running? ? raise : return\n end\n\n if running?\n @zk_lock.assert!\n yield\n end\n ensure\n if @zk_lock\n begin\n @zk_lock.unlock!\n rescue => ex\n logger.warn(\"Failed to release lock: #{ex.inspect}\")\n end\n end\n end", "def work\n if @busy && @remaining_job_time > 0\n @remaining_job_time -= 1\n end\n end", "def unlock(token)\n return NotImplemented unless @lock_class\n\n token = token.slice(1, token.length - 2)\n if(token.nil? || token.empty?)\n BadRequest\n else\n lock = @lock_class.find_by_token(token)\n if(lock.nil? || lock.user != @user)\n Forbidden\n elsif(lock.path !~ /^#{Regexp.escape(@path)}.*$/)\n Conflict\n else\n lock.destroy\n NoContent\n end\n end\n end", "def ensure_exclusive\n acquire_locks\n write_pid\n end", "def toggle_locking(current_user)\n if can_toggle_locking?(current_user)\n is_locked? ? unlock : lock(current_user.id) # TODO: raise exception or report error here?\n end\n end", "def return_lock\n\t\t@@logger.info { \"Returning the lock to the database.\" } if have_logger?\n\t\tTournament.dataset.filter(:id => self.id, :locked => true).update(:locked => false) != 0\n\tend", "def synchronize\n lock(&block)\n end", "def lock(name, mode)\n yield\n end" ]
[ "0.80560195", "0.792052", "0.7761226", "0.7562767", "0.7459773", "0.73170596", "0.7281347", "0.72716385", "0.72716385", "0.722592", "0.7220226", "0.7204193", "0.71734554", "0.7151579", "0.71470064", "0.7051378", "0.69854", "0.69005275", "0.6865165", "0.68508303", "0.6839796", "0.68324864", "0.68144697", "0.67830235", "0.6747487", "0.6745388", "0.6734944", "0.67216086", "0.6697496", "0.6693929", "0.6631064", "0.6568856", "0.6562653", "0.65594435", "0.6499119", "0.64787495", "0.6436712", "0.6427665", "0.6406878", "0.63710386", "0.635337", "0.6348527", "0.6345148", "0.6343146", "0.63415194", "0.63317287", "0.6319225", "0.6319225", "0.63162535", "0.63066113", "0.6302154", "0.62942976", "0.6293796", "0.62791574", "0.6277867", "0.62518674", "0.62418836", "0.62219775", "0.62168735", "0.618464", "0.61823356", "0.6172796", "0.6136132", "0.61168325", "0.6110327", "0.6109148", "0.609913", "0.60823226", "0.6080562", "0.60762787", "0.6071585", "0.60611063", "0.6036245", "0.6036245", "0.6036245", "0.60259694", "0.60252756", "0.6012073", "0.6000663", "0.5984631", "0.59696734", "0.5961972", "0.59420323", "0.5901385", "0.58932775", "0.58929026", "0.5883139", "0.5875776", "0.58736706", "0.584458", "0.583452", "0.58279824", "0.581857", "0.580977", "0.5800963", "0.5786541", "0.57805747", "0.57691556", "0.5767045", "0.5755323", "0.5747692" ]
0.0
-1
Initialize a new Topping
def initialize(name, vegetarian: false) @name = name @vegetarian = vegetarian end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize\n @top = nil\n end", "def initialize(toppings = [Topping.new(\"cheese\", vegetarian: true)])\n @toppings = toppings\n end", "def initialize (toppings = [Pizza::Topping.new('cheese', vegetarian: true)])\n @toppings = toppings \n @delivery_time\n end", "def initialize(toppings=[Pizza::Topping.new('cheese', vegetarian: true)])\n \t\t@toppings = toppings\n \tend", "def initialize(ttl=TTL)\n @broadcast = BROADCAST\n @port = PORT\n @timeout = TIMEOUT\n @ttl = ttl\n\n @log = nil\n\n @listener = nil\n @queue = Queue.new\n\n @search_thread = nil\n @notify_thread = nil\n end", "def initialize\n super\n\n # defaults:\n self.foreground = false\n self.push_poll = 2\n self.feedback_poll = 60\n self.airbrake_notify = true\n self.check_for_errors = true\n self.batch_size = 5000\n self.queue = nil\n end", "def initialize\n @options = { :priority => 0 }\n @doing = @with = nil\n end", "def initialize(position, top_speed, acc, hf)\n @id = @@count + 1\n @position = position\n @speed = 0\n @top_speed = top_speed\n @acc = acc\n @hf = hf\n @nitro_used = false\n @running = true\n @@count = @id\n end", "def initialize\n\t\t@toppings = []\n\tend", "def initialize(hq, tank)\n @hq, @tank = hq, tank\n @goal = nil\n @timers = []\n @priorities = []\n # Satisfactory proximity of tank to its destination\n @proximity = 8\n end", "def initialize(head = nil, move = nil)\n self.move = move\n self.head = head\n self.tails = Set.new\n self.node = Opener::Node.instance(self.to_epd)\n end", "def construct_ping\n msg = Protocol::Ping.new\n msg.ctime = DateTime.now\n msg.guid = @driver.guid\n msg.name = @driver.name\n msg.connection_count = @supernode_table.size\n Routing.update_ping_from_routing(msg,@driver.routing)\n msg\n end", "def initialize(poller = CZTop::Poller.new)\n @readables = []\n @writables = []\n @poller = poller\n end", "def initialize() end", "def initialize(shell)\n super\n\n self.extensions = []\n self.bgjobs = []\n self.bgjob_id = 0\n\n # keep a lookup table to refer to transports by index\n @transport_map = {}\n\n end", "def initialize\n configure_trello\n end", "def initialize()\n @queue = Queue.new\n end", "def initialize(system = {})\n @state = system\n @state[:time] ||= 0\n super()\n end", "def initialize(head = nil)\n @head = head\n end", "def initialize(num_legs)\n\t\t@tabletop = []\n @num_legs = num_legs\n \tend", "def initialize(*) end", "def initialize(*) end", "def initialize(*) end", "def initialize(*) end", "def initialize(*) end", "def initialize\n \n end", "def initialize\n\t\t@ttt = Board.new\n\t\t@ttt.sample_board\n\t\t@x = Player.new(\"X\")\n\t\t@o = Player.new(\"O\")\n\t\t@player_number = 0 # player turn counter\n\tend", "def initialize(head = nil)\r\n\t\t@head = head\r\n\t\t@tail = nil\r\n\tend", "def initialize(position)\n player = :human\n @curren\n t_state = State.new(position, player)\n initialize_ai(1, 100)\n end", "def initialize\n initialize!\n end", "def initialize\n initialize!\n end", "def initialize; end", "def initialize; end", "def initialize; end", "def initialize; end", "def initialize; end", "def initialize; end", "def initialize; end", "def initialize; end", "def initialize; end", "def initialize; end", "def initialize; end", "def initialize(t)\n @task = t\n @timestamp = Timestamp.new\n end", "def initialize()\n end", "def initialize (starting_pos)\n # @starting_pos = starting_pos\n @root_node = PolyTreeNode.new(starting_pos)\n # kpf = KnightPathFinder.new([0, 0])\n @used_pos = [starting_pos]\n end", "def initialize(top_level, clazz, options, stats)\n @options = options\n @top_level = top_level\n @classes = Hash.new\n @progress = $stderr unless options.quiet\n @clazz = clazz\n @stats = stats\n end", "def initialize()\n @type = ''\n @destination = ''\n @tag = ''\n @data = ''\n @timeout = 10000\n end", "def initialize\r\n\r\n end", "def initialize\n # We start with an empty hash of stats\n @stats = {}\n end", "def initialize(online = false)\n @online = online\n end", "def initialize(options = {})\n super\n @queue_values = {}\n @key_assignments = {}\n @largest_seen_values = {}\n @smallest_seen_values = {}\n @rng_seed = options[:rng_seed] || Random.new_seed\n end", "def initialize\n init\n end", "def initialize args={}\n @args = args\n\n @context = @args[:context]\n @route_context = @args[:route_context]\n\n @router = @args[:router] || method(:df_route)\n @router_type = @args[:router_type]\n\n @proxies = OpenStruct.new\n @station = MailStation.new args\n\n @state = :state_inited\n end", "def initialize\r\n @time = :forever\r\n @timed_out = false\r\n @subscribers = Array.new\r\n @scheduler = Rufus::Scheduler.start_new\r\n end", "def initialize(waiter, customer, total, tip)\n @waiter = waiter\n @customer = customer\n @total = total\n @tip = tip\n @@all << self\nend", "def initialize\n reset\n initialize_ai(0, 100)\n end", "def initialize\n\t\t@head = nil\n\t\t@tail = nil\n\t\t@largo = 0\n\tend", "def initialize(options = {})\n @seq = 0\n @bind_port = 0\n @bind_host = nil\n @data_size = 56\n\n @ping_id = (Thread.current.object_id ^ Process.pid) & 0xffff\n\n super(options)\n end", "def initialize()\n @stack = Stack.new\n end", "def initialize\n end", "def initialize\n end", "def initialize\n end", "def initialize\n end", "def initialize\n end", "def initialize\n end", "def initialize\n end", "def initialize\n end", "def initialize\n end", "def initialize\n end", "def initialize(args = {Cmaxsize => 20, Cttl => nil}, ttlarg = nil)\n\t\t\t\tif args.kind_of? ::Hash\n\t\t\t\t\toargs = args\n\t\t\t\t\targs = Iowa::Hash.new\n\t\t\t\t\targs.step_merge!(oargs)\n\t\t\t\tend\n\t\t\t\targs.stringify_keys! if args.respond_to? :stringify_keys!\n\t\t\t\tbegin\n\t\t\t\t\t@max = args[Cmaxsize] || 20\n\t\t\t\t\t@maxttl = args[Cttl]\n\t\t\t\t\t@mutex = Mutex.new\n\t\t\t\trescue Exception\n\t\t\t\t\targs = {Cmaxsize => args || 20, Cttl => ttlarg}\n\t\t\t\t\tretry\n\t\t\t\tend\n\t\t\t\t@finalizers = []\n\t\t\t\t@head = Node.new\n\t\t\t\t@tail = Node.new\n\t\t\t\t@lookup = Hash.new\n\t\t\t\tnode_join(@head,@tail)\n\t\t\tend", "def initialize\n @id = self.class.uid\n @connections = Connections.new({}, {}, {})\n @error = Error.new(0.0, 0.0, 0.0)\n @trace = Trace.new({}, {}, {})\n\n @state = @old = @activation = 0.0\n @selfconnection = Synaptical::Connection.new(self, self, 0.0)\n @squash = Synaptical::Squash::Logistic\n @neighbors = {}\n @bias = rand * 0.2 - 0.1\n end", "def initialize\n end", "def initialize\n end", "def initialize\n end", "def initialize\n end", "def initialize\n end", "def initialize\n end", "def initialize\n \n end", "def initialize\n super\n @update_to_call = []\n Scheduler.start(:on_init, self.class)\n end", "def initialize(*params)\n super(*params) # Delegates to Plexus.\n @_options = (params.pop if params.last.is_a? Hash) || {}\n _delay { alias has_branch? has_edge? }\n end", "def initialize(info = {})\n super\n\n # Initialize the pending_connections counter to 0\n self.pending_connections = 0\n\n # Initialize the sessions counter to 0\n self.sessions = 0\n\n # Create the waiter event with auto_reset set to false so that\n # if a session is ever created, waiting on it returns immediately.\n self.session_waiter_event = Rex::Sync::Event.new(false, false)\n end", "def initialize\n @polling_frequency = Aeternitas::PollingFrequency::DAILY\n @before_polling = []\n @after_polling = []\n @guard_options = {\n key: ->(obj) { return obj.class.name.to_s },\n timeout: 10.minutes,\n cooldown: 5.seconds\n }\n @deactivation_errors = []\n @ignored_errors = []\n @queue = 'polling'\n @sleep_on_guard_locked = true\n end", "def initialize(*args)\n super\n mon_initialize\n end", "def initialize(socket, test_mode=false)\n @heap = Containers::PriorityQueue.new\n @mutex = Mutex.new\n @socket = socket # socket to send messages on\n @test_mode = test_mode\n @msg_buffer = []\n @job_set = Set.new\n end", "def initialize(session)\n @now = session || Hash.new\n @next = Hash.new\n super(@now)\n end", "def initialize(restart_callback, offline_stats)\n @restart_vote = restart_callback\n @restart_vote_timer = nil\n @restart_vote_count = 0\n @offline_stats = offline_stats\n @state = :created\n @mode = :initializing\n @queue = []\n end", "def initialize()\r\n\t\t@time = Timer.new # the time the user has made\r\n\t\t@penalty = Penalty.new # the penalty time on the map\r\n\t\tself.reset()\r\n\tend", "def initialize\n end", "def initialize ## initializing 3 variables that come with Twitter Trends info. Am I doing something wrong?\n @name= nil\n @query_trend= nil\n @promoted_content= nil\n end", "def initialize\n self[:start_time] = Time.now.to_f\n self[:time] = Time.now.to_f\n self[:trace] = []\n end", "def initialize()\r\n\r\n end", "def initialize(protein, base, toppings)\n @protein = protein\n @base = base\n @toppings = toppings\n end", "def initialize(protein, base, toppings)\n @protein = protein\n @base = base\n @toppings = toppings\n end", "def initialize(protein, base, toppings)\n @protein = protein\n @base = base\n @toppings = toppings\n end", "def initialize(options={})\n @timers = []\n @settings = options[:settings]\n @logger = options[:logger]\n @redis = options[:redis]\n @options = @settings.to_hash.fetch(:tessen, {})\n end", "def initialize(params={}, &proc)\n @proc = proc\n\n if params[:statistics]\n @message_count = 0\n @start_time = Time.now\n end\n end", "def initialize(username, status) #Each tweet will initialize with a username and a status. \n @username = username\n @status = status\n ALL_TWEETS << self #Every time a new tweet is created, it's added into the ALL_TWEETS array. In the initialize method, self refers to the tweet that was newly created. \n end", "def initialize\n \n end", "def initialize\n \n end", "def initialize(root, head)\n @root, @head = root, head\n end", "def initialize(pstack)\n super(pstack)\n end" ]
[ "0.67978287", "0.6734882", "0.6524095", "0.64332455", "0.63178706", "0.6309961", "0.63091785", "0.6182614", "0.61291856", "0.6102263", "0.60342616", "0.5961404", "0.5940597", "0.593372", "0.5926325", "0.58585566", "0.57854456", "0.57647914", "0.5760392", "0.57515204", "0.5747802", "0.5747802", "0.5747802", "0.5747802", "0.5747802", "0.57471037", "0.57362705", "0.5729566", "0.5726285", "0.57184714", "0.57184714", "0.5718339", "0.5718339", "0.5718339", "0.5718339", "0.5718339", "0.5718339", "0.5718339", "0.5718339", "0.5718339", "0.5718339", "0.5718339", "0.5709699", "0.57037985", "0.5701994", "0.5700969", "0.56957775", "0.5692066", "0.5691211", "0.568839", "0.5676169", "0.56673735", "0.56618375", "0.56514966", "0.56481284", "0.56422067", "0.56380945", "0.5631671", "0.56308985", "0.56165195", "0.56158406", "0.56158406", "0.56158406", "0.56158406", "0.56158406", "0.56158406", "0.56158406", "0.56158406", "0.56158406", "0.5612907", "0.5609689", "0.56070554", "0.56070554", "0.56070554", "0.56070554", "0.56070554", "0.56070554", "0.56057745", "0.5603818", "0.55992275", "0.55959076", "0.5589589", "0.55849946", "0.5580385", "0.55747753", "0.5571871", "0.55699164", "0.55664444", "0.5564923", "0.5564532", "0.5561899", "0.5561332", "0.5561332", "0.5561332", "0.55588937", "0.55555266", "0.55553734", "0.5555373", "0.5555373", "0.55545855", "0.55540156" ]
0.0
-1
... doctor.first_name = 'Carlos' = attr_accessor :first_name
def initialize(attributes = {}) @id = attributes[:id] # TODO: store other attributes as instanced variable (exercise) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attr_accessor(name)\n attr_reader(name)\n attr_writer(name)\n nil\n end", "def initialize\n @attribute = 'truite'\n @accessor = 'pouet'\n end", "def first_name=(first_name)\n @first_name = first_name\n end", "def first_name=(first_name)\n @first_name = first_name\n end", "def name=(name)\n # String.empty? does the same as String == \"\"\n raise_missing_attribute_error(\"name\") if name.nil? or name.empty?\n\n name = capitalize(name)\n # set the instance variable @name to be able to access it over person.name\n @name = name\n end", "def set_name\n person = CMU::Person.find(andrew_id)\n if !person.nil?\n self.first_name = person.first_name\n self.last_name = person.last_name\n end\n end", "def name\n return @name\nend\ndef age\n return @age\nend\n#setters, allows you to change or set something\ndef name=(name)\n @name = name\nend", "def first_name= (first_name)\n @first_name = first_name\n end", "def attr_accessor(*args)\n attr_reader(*args)\n attr_writer(*args)\n end", "def first_name=(s)\n write_attribute(:first_name, s.to_s.capitalize)\n end", "def firstname=(new_firstname)\n write_attribute(:firstname, uppercase_first_letter(new_firstname))\n end", "def name\n @name = self.firstname + \" \" + self.lastname \n end", "def attr_accessor(*fields)\n attr_reader *fields\n attr_writer *fields\n end", "def setter_method\n :\"#{self[:name]}=\"\n end", "def setter_method\n :\"#{self[:name]}=\"\n end", "def attr_accessor(sym, *more) end", "def first_name=(new_first_name)\n @first_name = new_first_name\n end", "def onetime_attr_accessor(_name)\n attr_reader(_name)\n onetime_attr_writer(_name)\n end", "def first_name=(value)\n write_attribute :first_name, value.titleize\n end", "def first_name\n @first_name\n end", "def first_name\n @first_name\n end", "def first_name\n @first_name\n end", "def first_name\n @first_name\n end", "def first_name\n @first_name\n end", "def first_name\n @first_name\n end", "def last_name=(lname)\n @last_name = lname\n end", "def name_setter\n @name\n end", "def attr_writer(sym, *more) end", "def test_setter_name\n student = Student.new( \"Andrew\", 15 )\n student.set_student_name( \"George\" )\n assert_equal( \"George\", student.student_name )\n end", "def define_attr_accessor(attr)\n attr_accessor(attr)\n end", "def setter\r\n @setter ||= Field.setter(@name)\r\n end", "def age=(value)\n @age = value\nend", "def age=(value)\n @age = value\nend", "def bits_attr_accessor name\n class_eval \"def #{name}; self.attributes[#{name.inspect}]; end;\", __FILE__, __LINE__\n class_eval \"def #{name}=(val); self.attributes[#{name.inspect}]=val; end;\", __FILE__, __LINE__\n end", "def doctor_name \n self.doctor.name # works with or without self \n end", "def cattr_accessor(*syms)\n cattr_reader(*syms) + cattr_writer(*syms)\n end", "def first_name=(input_first_name)\n @first_name = input_first_name\n end", "def first_name=(input_first_name)\n @first_name = input_first_name\n end", "def test_set_name\n @student1.name = \"Douglas\"\n assert_equal(\"Douglas\", @student1.name)\nend", "def __setter__\n \"#{self}=\"\n end", "def set_name=(name)\n @name=name\n end", "def field(name)\n attr_accessor name\n end", "def initialize\n\t\t@name = \"Jonathan\"\n\tend", "def setter\n @setter ||= :\"#{@name}=\"\n end", "def mattr_accessor(*syms)\n mattr_reader(*syms) + mattr_writer(*syms)\n end", "def first_name=(first_name)\n name = Name.new(first_name, 'Last')\n @first_name = name.first\n end", "def first_name\n return @first_name\n end", "def first_name\n return @first_name\n end", "def cattr_accessor(*syms)\n cattr_reader(*syms)\n cattr_writer(*syms)\n end", "def first_name\n @fname\n end", "def initialize(name, age)\n @name = name # directly uses the instance variable\n self.age = age # uses the setter method\n end", "def first_name\n\t\t@first_name\n\tend", "def internal_attr_accessor(*syms)\n internal_attr_reader(*syms)\n internal_attr_writer(*syms)\n end", "def first_name\n @first_name\n end", "def setter\n @setter ||= \"#{name}=\"\n end", "def lastname=(new_lastname)\n write_attribute(:lastname, uppercase_first_letter(new_lastname))\n end", "def name=(name, breed = \"Mutt\")\n@name = name\n@breed = breed\nend", "def full_name= full_name\n @full_name = full_name\n end", "def name\n return self.first_name\n end", "def name= (name_of_dog)\n # @name = name_of_dog\n @name = name_of_dog\n end", "def setter( name ) (name.to_s + '=').to_sym end", "def middlename=(new_middlename)\n write_attribute(:middlename, uppercase_first_letter(new_middlename))\n end", "def name=(dog_name)\n @name = dog_name\n end", "def name #use and initlizer to set name as an instance variable\n @name\nend", "def name=(n)\n @name = n\nend", "def set_name\n name = \"\"\n\n if self.firstname.blank? && self.lastname.blank?\n unless self.login.blank?\n name = self.login\n else\n name = self.email\n end\n else\n name = \"#{self.firstname} #{self.lastname}\"\n end\n\n self.update_column(:name, name)\n #self.name = \"Ferdinand\"\n end", "def name=(the_baby_name) \r\n @my_name = the_baby_name\r\n end", "def first_name\r\n @first_name\r\n end", "def set_attribute(name, value); end", "def attr_accessor( * )\n fail \"Remember, an Entity is immutable. Use a Services::Service to mutate the underlying data.\"\n end", "def test_set_student_name()\n student = Student.new(\"Raphael\", \"E23\")\n student.set_name(\"Daniel\")\n assert_equal(\"Daniel\", student.name)\n end", "def age=(v) self['Age'] = v end", "def class_attr_accessor(class_variable_name)\n self.class.send(:attr_accessor, class_variable_name)\nend", "def name= new_name\n @name = new_name\n end", "def username #for each attribute of a class you have two methods a reader and a writer method (same as a gettter and setter methods)\n return @username #the variable \"@username\" is ONLY created when the WRITER, NOT the reader is called; it's created when lana.username - \"lana\" is called ; if the reader is called and the variable is not in the initialize method and the writer method has not been called the program will give you an error; the @symbol is called an instance variable\n end", "def update_attrs(hashit)\n hashit.instance_variables.each do |name|\n singleton_class.class_eval {attr_accessor \"#{name[1..-1]}\"} #remove leading @ from varname\n send(\"#{name[1..-1]}=\", hashit.instance_variable_get(name))\n end\n end", "def vcattr_accessor(*syms) # :nodoc:\r\n vcattr_reader *syms\r\n vcattr_writer *syms\r\n end", "def attr_internal_accessor(*attrs)\n attr_internal_reader(*attrs)\n attr_internal_writer(*attrs)\n end", "def attr_internal_accessor(*attrs)\n attr_internal_reader(*attrs)\n attr_internal_writer(*attrs)\n end", "def attr_internal_accessor(*attrs)\n attr_internal_reader(*attrs)\n attr_internal_writer(*attrs)\n end", "def formal_firstname\n read_attribute :firstname\n end", "def created_by\r\n\t@myname = \"Vitaly Amos\"\r\n\t@myname\r\nend", "def first_name=(v)\n @first_name = alma_string v\n end", "def initialize\n @name=\"Abhinav\"\n end", "def initialize (value1)\n @name = value1\n# try self.name*****\n end", "def name\n name = self.first_name+' '+self.last_name\n end", "def firt_name=(n)\n write_attribute(:first_name, n.to_s.titleize)\n end", "def set_objects_to_acessor\n if !@sequence.empty?\n @sequence.each { |ele|\n self.class.__send__(:attr_accessor, ele.downcase)\n }\n end\n\nend", "def set_coach_name(new_name)\n @coach = new_name\nend", "def name(name)\n @name = name\nend", "def _setter_method\n :\"_#{self[:name]}=\"\n end", "def name=(name)\n\t@name = name\nend", "def initialize(person)\n @first_name = person[:first_name] # instance variable\n @last_name = person[:last_name]\n @age = person[:age]\n @credit_card = person[:credit_card]\n end", "def name=(new_name) \n @name = new_name\n end", "def initialize(first_name)\n @first_name = first_name\n end", "def last_name=(value)\n write_attribute :last_name, value.titleize\n end", "def attr; end", "def test_student_name_update()\n @student.name = \"Harry\"\n assert_equal(\"Harry\", @student.name())\n end", "def first_name_set(name)\n self.firstname.set name if nil_or_empty?(firstname[:value])\n end", "def test_set_student_name\n student = Student.new('Jordan', 'e33')\n student.set_student_name('Ian')\n assert_equal('Ian', student.student_name())\n end", "def _setter_method\n :\"_#{self[:name]}=\"\n end" ]
[ "0.7063225", "0.70529985", "0.67424804", "0.67424804", "0.6699787", "0.6659352", "0.66510713", "0.6628049", "0.6597046", "0.6586247", "0.65412384", "0.6521226", "0.65154845", "0.6430901", "0.6427275", "0.6397374", "0.6381212", "0.6381129", "0.6369219", "0.6357247", "0.6357247", "0.6357247", "0.6357247", "0.6357247", "0.6357247", "0.63527703", "0.63367754", "0.6334269", "0.6327873", "0.6326311", "0.62724024", "0.6249797", "0.6249797", "0.61941874", "0.6183983", "0.61809427", "0.6171794", "0.6171794", "0.61619025", "0.6157973", "0.6141742", "0.6135865", "0.61354727", "0.6134884", "0.6134535", "0.61263514", "0.6103012", "0.6103012", "0.61028975", "0.60988545", "0.6090331", "0.60875565", "0.6059869", "0.6044981", "0.6040838", "0.60377824", "0.6037068", "0.6032674", "0.6028393", "0.60161537", "0.6008103", "0.60036856", "0.597864", "0.59780216", "0.59769475", "0.59704834", "0.59701794", "0.5958668", "0.5950868", "0.5944521", "0.59426767", "0.5935677", "0.59245926", "0.59197164", "0.5914595", "0.5913972", "0.58976996", "0.5897622", "0.5897622", "0.5897622", "0.5897085", "0.5894538", "0.5891627", "0.58856046", "0.58778447", "0.5873881", "0.586656", "0.5864555", "0.5862447", "0.58572376", "0.5855988", "0.58509254", "0.5846064", "0.58353287", "0.58272517", "0.5817714", "0.58160955", "0.5814752", "0.5814481", "0.58095706", "0.5807624" ]
0.0
-1
this can be called on a object/instance of the class Doctor instance class (doctor.save) doctor must be an object/instance of this class (Doctor)
def save # Insert OR Update object values into DB # DB.execute("INSERT INTO .....") # @id = DB.last_insert_row_id # get the last id from the DB # OR # DB.execute("UPDATE .....") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_doctor\n @doctor = Doctor.find(params[:id])\n end", "def set_doctor\n @doctor = Doctor.find(params[:id])\n end", "def set_doctor\n @doctor = Doctor.find(params[:id])\n end", "def set_doctor\n @doctor = Doctor.find(params[:id])\n end", "def set_doctor\n @doctor = Doctor.find(params[:id])\n end", "def set_doctor\n @doctor = Doctor.find(params[:id])\n end", "def set_doctor\n @doctor = Doctor.find(params[:id])\n end", "def set_doctor\n @doctor = Doctor.find(params[:id])\n end", "def save\n # CREATE/UPDATE\n # TODO: CREATE if id is nil / UPDATE if there is id\n if @id.nil?\n # TODO: CREATE\n query = \"INSERT INTO doctors (name, age, specialty) \"\\\n \"VALUES ('#{@name}', #{@age}, '#{@specialty}')\"\n DB.execute(query)\n else\n # TODO: UPDATE\n query = \"UPDATE doctors SET name = '#{@name}', \"\\\n \"age = #{@age}, specialty = '#{@specialty}' \"\\\n \"WHERE id = #{@id}\"\n DB.execute(query)\n end\n self\n end", "def set_doctor\n @current_doctor = current_doctor.name\n @this_doctor_id=Doctor.where(\"name = ?\",@current_doctor)\n end", "def new\n @doctor = Doctor.new #create a new doctor\n end", "def set_doctor\n hospital = Hospital.find(params[:hospital_id])\n @doctor = hospital.doctors.find(params[:id])\n @ward = hospital.wards\n end", "def set_doctor\n if !Doctor.exists?(params[:id])\n flash[:notice] = \"Doctor does not exist\"\n redirect_to doctors_path\n else\n @doctor = Doctor.find(params[:id])\n end\n end", "def create\n @doctor = Doctor.new(doctor_params) # use fields of \n\n respond_to do |format|\n if @doctor.save # if there are no errors in the doctor data\n format.html { redirect_to new_doctor_path, notice: 'Doctor (' + @doctor.name + ') was successfully created.' } # redirect browser to that specific doctor's page and show \"sucessful\" message\n format.json { render :show, status: :created, location: @doctor }\n else # if there are errors when creading the doctor\n format.html { render :new }\n format.json { render json: @doctor.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @doctor = Doctor.new(params[:doctor])\n\n respond_to do |format|\n if @doctor.save\n update_specialties\n format.html { redirect_to @doctor, notice: 'Doctor was successfully created.' }\n format.json { render json: @doctor, status: :created, location: @doctor }\n else\n format.html { render action: \"new\" }\n format.json { render json: @doctor.errors, status: :unprocessable_entity }\n end\n end\n end", "def initialize(name)\n @name = name\n @appointment = appointment\n @doctor = doctor\n @@all_appointment << self\n save\n end", "def set_doctor_patient\n @doctor_patient = DoctorPatient.find(params[:id])\n end", "def create\n @doctor = Doctor.new(doctor_params)\n\n respond_to do |format|\n if @doctor.save\n format.html { redirect_to doctors_path, notice: 'Doctor was successfully created.' }\n else\n format.html { render :new }\n end\n end\n end", "def create\n authorize! :create, Doctor\n hospital = Hospital.find(params[:hospital_id])\n @ward = hospital.wards\n @doctor = hospital.doctors.create(doctor_params)\n respond_to do |format|\n if @doctor.save\n format.html { redirect_to hospital_path(hospital.id), notice: 'Doctor was successfully created.' }\n format.json { render :show, status: :created, location: @doctor }\n else\n format.html { render :new }\n format.json { render json: @doctor.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_our_doctor\n @our_doctor = OurDoctor.find(params[:id])\n end", "def create\n @doctor = Doctor.new(doctor_params)\n\n respond_to do |format|\n if @doctor.save\n format.html { redirect_to @doctor, notice: 'Doctor was successfully created.' }\n format.json { render :show, status: :created, location: @doctor }\n else\n format.html { render :new }\n format.json { render json: @doctor.errors, status: :unprocessable_entity }\n end\n end\n end", "def save\n #see if PID is not yet specified in DC. Note that according the rest of the code, the PID is put in DC when the object is first saved. \n #That means the below expression becomes true only if this is the object is saved first time.\n update_dc_id = get_dc.identifier == \"\"\n \n #Save the object. This generates the PID if this is a new object.\n status = super\n \n dc = get_dc\n if update_dc_id && status\n \n dc.identifier = self.pid\n \n #We need to set up the following field at some point.\n dc.creator = \"TODO\" if dc.creator == \"\"\n dc.created = \"TODO\" if dc.created == \"\"\n \n #Since the DC is updated, let's save the object again.\n status = super \n end\n \n #Return the save status.\n return status\n end", "def create\n @doctor = Doctor.new(params[:doctor])\n\n respond_to do |format|\n if @doctor.save\n format.html { redirect_to @doctor, notice: 'Doctor was successfully created.' }\n format.json { render json: @doctor, status: :created, location: @doctor }\n else\n format.html { render action: \"new\" }\n format.json { render json: @doctor.errors, status: :unprocessable_entity }\n end\n end\n end", "def save!\n end", "def the_doctor; end", "def set_doctor_appointment\n @doctor_appointment = DoctorAppointment.find(params[:id])\n end", "def create\n raise \n @doctor = Doctor.new(doctor_params)\n respond_to do |format|\n if @docotor.save\n format.html { redirect_to @doctor, notice: 'Staff was successfully created.' }\n format.json { render :show, status: :created, location: @docotor }\n else\n format.html { render :new }\n format.json { render json: @docotor.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ask_doctor = AskDoctor.find(params[:ask_doctor_id])\n @post = @ask_doctor.posts.build(post_params)\n if @post.save \n #Post saved, redirect to ask_doctor page\n redirect_to ask_doctor_posts_path(@ask_doctor, @post)\n else\n render :action => \"new\"\n end\n end", "def save\n\t\t\t\"save called - creating a new object.\"\n\t\tend", "def create\n @doctor = Doctor.new(params[:doctor])\n\n if @doctor.save\n render json: @doctor, status: :created, location: @doctor\n else\n render json: @doctor.errors, status: :unprocessable_entity\n end\n end", "def set_admin_doctor\n @admin_doctor = Doctor.find(params[:id])\n end", "def set_veterinary_doctor\n @veterinary_doctor = VeterinaryDoctor.find(params[:id])\n end", "def create\n if !current_user.role.eql? 'admin'\n go_to_root(\"Only Admin can create doctors\")\n end\n @new_doctor = User.new(doctor_params)\n err = check_error(@new_doctor)\n if !err.empty?\n redirect_to create_doctor_path, notice: err\n else \n @new_doctor.is_doctor = true\n @new_doctor.role = 'doctor'\n respond_to do |format|\n try_save(@new_doctor, format)\n end\n end\n end", "def set_vet_doctor\n @vet_doctor = VetDoctor.find(params[:id])\n end", "def initialize(date, doctor)\n @date = date\n @doctor = doctor\n doctor.add_appointment(self)\n end", "def create\n @doctor = Doctor.new(params[:doctor])\n\n respond_to do |format|\n if @doctor.save\n format.html { redirect_to(@doctor, :notice => t('record_created')) }\n format.xml { render :xml => @doctor, :status => :created, :location => @doctor }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @doctor.errors, :status => :unprocessable_entity }\n end\n end\n end", "def initialize(date, doctor)\n @date = date\n @doctor = doctor\n doctor.add_appointment(self) #upon instatiation, make an appointment through the Doctor class #add_appointment method, which in turn sets this appointment (passed as an argument) as belonging to the doctor\n end", "def save\n perform_save\n end", "def create\n @doctor = Doctor.find(params[:doctor_id])\n @patient = @doctor.patients.build(params.require(:patient).permit(:firstname, :lastname, :dob,:gender, :email, :phone, :address,:condition,:level,:search))\n\n if @patient.save\n redirect_to doctor_patient_url(@doctor, @patient)\n else\n render :action => \"new\"\n end\n end", "def persist\n \n end", "def save\n end", "def initialize (name) \n #has a name \n @name = name \n #gets called inside initialize when a new Dog is created \n self.save\n end", "def new_appointment(doctor, date)\n Appointment.new(date, self, doctor)\nend", "def new_appointment(doctor, date)\n Appointment.new(date, self, doctor)\nend", "def save\n self.class.save(self)\n end", "def save\n super save\n end", "def create\n doctor_params = params.require(:doctor).permit(:first_name, :last_name, :email, :password, :description, :image_url)\n @doctor = Doctor.new(doctor_params)\n if @doctor.save\n login(@doctor, 'doctors')\n flash[:success] = \"Profile created!\"\n redirect_to \"/doctors/#{@doctor.id}\"\n else\n flash[:error] = @doctor.errors.full_messages.join(\"---\")\n redirect_to '/doctors/new'\n end\n end", "def save!\n object.save!\n end", "def set_docter\n @docter = Docter.find(params[:id])\n end", "def create\n @patient = Patient.find(params[:patient_id])\n @booking= @patient.bookings.build(params.require(:booking).permit(:LoginName, :DoctorName, :AvailableDate, :Timings ,:Patient , :Doctor))\n if @booking.save\n \n \n redirect_to patient_booking_url(@patient, @booking)\n else\n render :action => \"new\"\n end\nend", "def save\n end", "def save\n end", "def save\n object.save\n end", "def save!\n raise \"#{self.inspect} failed to save\" unless self.save\n end", "def create\n @doctor=Doctor.find(params[:doctor_id])\n @department = @doctor.departments.create(department_params)\n respond_to do |format|\n if @department\n format.html { redirect_to doctor_department_path(@doctor,@department), notice: 'Department was successfully created.' }\n format.json { render :show, status: :created, location: @department }\n else\n format.html { render :new }\n format.json { render json: @department.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @doctor = Doctor.new(doctor_params)\n if @user.save\n #login this user when credentials are valid\n log_in_user(@user)\n #flash[:success] = \"Welcome to the O-HoAC\"\n #redirect_to(edit_user_path(@user))\n redirect_to edit_doctor_path(current_doctor)\n else\n render 'new'\n end\n end", "def save!\n raise Cooler::InvalidObject unless save\n end", "def save_object\n end", "def new_appointment(date, doctor)\n test = Appointment.new(date,self,doctor)\n test\nend", "def save\n\t DATA.execute(\"INSERT INTO diagnosis (name, timestamp, disease_id) VALUES ('#{name}', '#{timestamp}', #{disease_id})\")\n\t @id = DATA.last_insert_row_id\n \treturn self\n \tend", "def create\n @our_doctor = OurDoctor.new(our_doctor_params)\n\n respond_to do |format|\n if @our_doctor.save\n format.html { redirect_to @our_doctor, notice: 'Our doctor was successfully created.' }\n format.json { render :show, status: :created, location: @our_doctor }\n else\n format.html { render :new }\n format.json { render json: @our_doctor.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n # @doctor = Doctor.new(doctor_params)\n @centers = Center.all.order('name ASC')\n @doctor = current_user.doctors.build(doctor_params)\n\n respond_to do |format|\n if @doctor.save\n # format.html { redirect_to @doctor, notice: 'Doctor was successfully created.' }\n format.html { redirect_to doctors_path, notice: 'Doctor registrado exitosamente.'}\n format.json { render :show, status: :created, location: @doctor }\n else\n format.html { render :new }\n format.json { render json: @doctor.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @doctor = Doctor.new(params[:doctor])\n\n if @doctor.save\n response_message = {:message => \"Doctor created successfully.\"}\n else\n response_message = {:message => \"Doctor creation failed. Please try again!\"}\n end\n\n respond_to do |format|\n format.xml { render :xml => response_message }\n format.json { render :json => response_message }\n end\n end", "def save\n\t\tend", "def set_spree_doctor\n @spree_doctor = Spree::Doctor.friendly.find(params[:id])\n end", "def persisted?; end", "def persisted?; end", "def create\n @doctor_desease = DoctorDesease.new(params[:doctor_desease])\n\n respond_to do |format|\n if @doctor_desease.save\n format.html { redirect_to doctor_deseases_path, notice: I18n.t(:record_created) }\n format.json { render json: @doctor_desease, status: :created, location: @doctor_desease }\n else\n format.html { render action: \"new\" }\n format.json { render json: @doctor_desease.errors, status: :unprocessable_entity }\n end\n end\n end", "def save( defer=false )\n save_logic( defer ) \n end", "def dreport_association(a_dreport)\n self.dreport_id = a_dreport.id\n self.save!\n end", "def set_person\n @customer = Person.find(params[:id])\n @advisor = Person.find(params[:id])\n end", "def save \n if self.id \n self.update\n else\n sql = <<-SQL\n INSERT INTO dogs (name, breed) \n VALUES (?, ?)\n SQL\n DB[:conn].execute(sql, self.name, self.breed)\n @id = DB[:conn].execute(\"SELECT last_insert_rowid() FROM dogs\")[0][0]\n\n dog = Dog.new(id:@id, name: self.name, breed: self.breed)\n return dog\n end\n end", "def save\n self.new_record ? self.create : self.update\n end", "def save\n\n end", "def new_appointment(doctor,date)\n Appointment.new(self, doctor, date=\"\")\n\nend", "def save()\n saved = persister.save(@decorated, @id)\n\n if saved\n @id = saved.id\n self\n end\n end", "def save\n self.save! rescue false\n end", "def create\n @customer = Customer.new(customer_params)\n @advisor = Advisor.find_by(name: @customer.name, company: @customer.company)\n if @advisor.present?\n @advisor.update_attributes(is_disable: TRUE)\n end\n respond_to do |format|\n if @customer.save\n if @advisor.present?\n @person = Person.create(customer_id: @customer.id, advisor_id: @advisor&.id)\n end\n format.html { redirect_to new_customer_path, notice: 'データが新規作成されました。' }\n format.json { render :show, status: :created, location: @customer }\n else\n format.html { render :new }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "def correct_doctor\n @doctor = Doctor.find(params[:id])\n redirect_to(root_url) unless current_doctor?(@doctor)\n end", "def create_doctor\n @doctor = Doctor.new(doctor_params)\n if @doctor.save\n msg = { :status => status, :message => \"New Doctor Name Added.!\", :doc_list => @doctor }\n render json: msg, status: status\n else\n render :json => { :errors => @doctor.errors }, :status => 422\n end\n end", "def correct_doctor\n @doctor = current_doctor\n redirect_to login_panel_doctors_login_path unless current_doctor?(@doctor)\n end", "def initialize(date, patient, doctor) #initializes with a date, patient, and doctor\n @date = date\n @patient = patient #belongs to a patient\n @doctor = doctor #belongs to a doctor\n @@all << self\n end", "def create\n\n # physician = Physician.find(physician_id)\n # unless physician.patients.where(email: email).exists?\n # patient = Patient.find_or_create_by(email: email)\n # physician.appointments.create(patient: patient)\n\n unless Appointment.where(doctor_id: appointment_params[:doctor_id], appointment_date_id: appointment_params[:appointment_date_id], time_table_id: appointment_params[:time_table_id]).exists?\n # unless Appointment.where(doctor_id: requested_doctor, appointment_date_id: requested_date, time_table_id: requested_timing).exists?\n @appointment = Appointment.new(appointment_params)\n @patient_id = @current_patient.id\n end\n\n # if @appointment.try(:save)\n # if !@appointment.nil? && @appointment.save\n if @appointment && @appointment.save\n puts \"Im saving!\"\n redirect_to @appointment, notice: 'Appointment was successfully created.'\n else\n puts \"Failed saving!\"\n redirect_to new_appointment_url, notice: 'Appointment was NOT successfully created.'\n end\n end", "def owner\n @doctor = Doctor.find_by(id: params[:id])\n if current_doctor?(@doctor)\n\n else\n #redirect_to(signin_path)\n end\n #unless current_doctor?(@doctor)\n end", "def doctor_name \n self.doctor.name # works with or without self \n end", "def save(object)\n new_record?(object) ? create(object) : update(object)\n end", "def details_view_doctor\n @comment = Comment.new\n @user = User.first(:conditions => { :user_name => params[:user_id].to_s, :user_record_type => \"Patient\" })\n if @user.nil?\n redirect_to :controller => :doctors, :action => \"patient_details_login\", :error => \"ops! something went wrong..\"\n else\n @doctor = current_user.user_record\n @appointment = Appointment.first(:conditions => { :patient_id => @user.user_record.id, :date => Time.now.strftime(\"%Y-%m-%d\") })\n end\n end", "def save\n self.save! rescue false\n end", "def set_doctemp\n @doctemp = Doctemp.find(params[:id])\n end", "def save\n valid? && create\n end", "def save\n end", "def save\n end", "def save\n end", "def save\n if self.id.nil?\n create\n else\n update\n end\n end", "def create\n\n @patient = Patient.new(patient_params)\n if @patient.save\n session[:patient_id] = @patient.id\n redirect_to new_doctor_booking_path(params[:doctor])\n else\n render :new\n end \n end", "def new_appointment doctor, date\n Appointment.new self, doctor, date\n end", "def set_quotum_doctor\n @quotum_doctor = QuotumDoctor.find(params[:id])\n end", "def save; end", "def save; end", "def save; end", "def save; end" ]
[ "0.67024785", "0.67024785", "0.67024785", "0.67024785", "0.67024785", "0.67024785", "0.67024785", "0.67019695", "0.66758364", "0.6622188", "0.6370385", "0.636696", "0.63638794", "0.62718225", "0.6230397", "0.61923885", "0.61724335", "0.6166102", "0.61572105", "0.61377853", "0.61118734", "0.61056364", "0.6098673", "0.6087987", "0.60463065", "0.604599", "0.6013635", "0.600794", "0.59788096", "0.5953458", "0.5939753", "0.59246767", "0.59155756", "0.5904991", "0.5893352", "0.58913904", "0.5806087", "0.5805348", "0.579733", "0.5797149", "0.57953763", "0.5783416", "0.5776979", "0.57666814", "0.5757921", "0.5754741", "0.57540077", "0.5735043", "0.5727122", "0.5725054", "0.57208097", "0.57208097", "0.5707143", "0.5702633", "0.56988996", "0.56981075", "0.5691752", "0.5684448", "0.5650616", "0.56380725", "0.56351924", "0.5633789", "0.56242305", "0.5602399", "0.55904454", "0.55869985", "0.55869985", "0.55834055", "0.55765593", "0.55688184", "0.55572325", "0.5556703", "0.5544386", "0.5543949", "0.5538808", "0.5535368", "0.55349076", "0.5531519", "0.5526077", "0.5511057", "0.5509943", "0.55025095", "0.5501633", "0.5492719", "0.54818624", "0.5479563", "0.54785323", "0.54704535", "0.54695946", "0.5465047", "0.54644567", "0.545976", "0.545976", "0.5445431", "0.5443704", "0.5425971", "0.54250157", "0.5420359", "0.5420359", "0.5420359", "0.5420359" ]
0.0
-1
this can be called on a object/instance of the class Doctor
def destroy # delete object from the DB # DB.execute("DELETE .....") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def the_doctor; end", "def doors; end", "def doctorView \n end", "def droid; end", "def initialize(date, doctor)\n @date = date\n @doctor = doctor\n doctor.add_appointment(self) #upon instatiation, make an appointment through the Doctor class #add_appointment method, which in turn sets this appointment (passed as an argument) as belonging to the doctor\n end", "def new\n @doctor = Doctor.new #create a new doctor\n end", "def initialize(name) #instantianting a new object #pull name from attr_accessor \n @name = name #creates a new instance with name\n @@all << self #self is at that point \n #shovels all instances into @@all bc it wants all the collections of doctors available \n end", "def doctor_name \n self.doctor.name # works with or without self \n end", "def initialize(date, patient, doctor) #initializes with a date, patient, and doctor\n @date = date\n @patient = patient #belongs to a patient\n @doctor = doctor #belongs to a doctor\n @@all << self\n end", "def initialize(patient, date, doctor)\n @patient = patient\n @date = date\n @doctor = doctor\n\n @@all << self\n end", "def initialize(patient, doctor, date)\n @date = date\n @patient = patient\n @doctor = doctor\n @@all << self\n end", "def initialize(date, patient, doctor)\n @date = date\n @patient = patient\n @doctor = doctor\n @@all << self\n end", "def set_doctor\n @doctor = Doctor.find(params[:id])\n end", "def set_doctor\n @doctor = Doctor.find(params[:id])\n end", "def set_doctor\n @doctor = Doctor.find(params[:id])\n end", "def set_doctor\n @doctor = Doctor.find(params[:id])\n end", "def set_doctor\n @doctor = Doctor.find(params[:id])\n end", "def set_doctor\n @doctor = Doctor.find(params[:id])\n end", "def set_doctor\n @doctor = Doctor.find(params[:id])\n end", "def set_doctor\n @doctor = Doctor.find(params[:id])\n end", "def set_doctor\n hospital = Hospital.find(params[:hospital_id])\n @doctor = hospital.doctors.find(params[:id])\n @ward = hospital.wards\n end", "def initialize(date, doctor)\n @date = date\n @doctor = doctor\n doctor.add_appointment(self)\n end", "def initialize(patient, doctor, date) #initialized with a date, patient, doctor.\n @date = date\n @patient = patient\n @doctor = doctor\n @@all << self #The appt should be saved in the @@all array\n end", "def set_doctor\n @current_doctor = current_doctor.name\n @this_doctor_id=Doctor.where(\"name = ?\",@current_doctor)\n end", "def doctors_visit(patient_id)\n \nend", "def new_appointment(date, doctor)\n test = Appointment.new(date,self,doctor)\n test\nend", "def set_doctor_patient\n @doctor_patient = DoctorPatient.find(params[:id])\n end", "def doctor(state)\n false\n end", "def initialize(date, patient, doctor)\n @date = date # starts with date, patient, and doctor\n @patient = patient # allows access to each branch\n @doctor = doctor # this is the single source of truth\n @@all << self\n end", "def object; end", "def object; end", "def object; end", "def object; end", "def object; end", "def object; end", "def object; end", "def object; end", "def object; end", "def object; end", "def object; end", "def object; end", "def object; end", "def object; end", "def object; end", "def daa\n end", "def set_our_doctor\n @our_doctor = OurDoctor.find(params[:id])\n end", "def instance; end", "def instance; end", "def instance; end", "def set_docter\n @docter = Docter.find(params[:id])\n end", "def reflection; end", "def reflection; end", "def reflector; end", "def reflector; end", "def private; end", "def with_doctor?\n status == WITH_DOCTOR\n end", "def set_vet_doctor\n @vet_doctor = VetDoctor.find(params[:id])\n end", "def set_admin_doctor\n @admin_doctor = Doctor.find(params[:id])\n end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def show\n @doctor = Doctor.find(params[:doctor_id])\n @patient = @doctor.patients.find(params[:id])\n end", "def init(doctor)\n @doctor = doctor\n @clinic = @doctor.clinic\n @medical_records = []\n\n @requests = []\n end", "def new_appointment(doctor, date)\n Appointment.new(date, self, doctor)\nend", "def donors_setup\n end", "def accessibility; end", "def delegate_object; end", "def new_appointment(doctor, date)\n Appointment.new(date, self, doctor)\nend", "def index\n authorize! :create, Doctor\n hospital = Hospital.find(params[:hospital_id])\n @doctors = hospital.doctors\n end", "def refutal()\n end", "def doom(entity); @doomed << entity; end", "def show\n @doctor = Doctor.find_by(id: params[:id])\n end", "def object\n raise NotImplementedError\n end", "def show\n @doctor=Doctor.find_by_id(params[:doctor_id])\n end", "def initialize\n \n end", "def initialize (name) \n #has a name \n @name = name \n #gets called inside initialize when a new Dog is created \n self.save\n end", "def current_doctor?(doctor)\n doctor == current_doctor\n end", "def current_doctor?(doctor)\n doctor == current_doctor\n end", "def doctor(_state)\n errors = false\n\n methods.each do |method|\n next if !method.match? /doctor_config_.*/\n\n error = send method\n errors = errors || error\n end\n\n errors\n end", "def deco_class; end", "def set_veterinary_doctor\n @veterinary_doctor = VeterinaryDoctor.find(params[:id])\n end", "def scientist; end", "def initialize(name)\n @name = name\n @appointment = appointment\n @doctor = doctor\n @@all_appointment << self\n save\n end", "def get_doctor\n puts \"Which Doctor would you like more information about?\"\n Scrape.scrape_doctor\n end", "def getAdvocacy\n\t\t\n\tend", "def strategy; end", "def initialize\n\t\t@deaf = true\n\tend", "def buy_dog(name)\n Dog.new(name,self)\n end", "def new_appointment(doctor,date)\n Appointment.new(self, doctor, date=\"\")\n\nend", "def create\n authorize! :create, Doctor\n hospital = Hospital.find(params[:hospital_id])\n @ward = hospital.wards\n @doctor = hospital.doctors.create(doctor_params)\n respond_to do |format|\n if @doctor.save\n format.html { redirect_to hospital_path(hospital.id), notice: 'Doctor was successfully created.' }\n format.json { render :show, status: :created, location: @doctor }\n else\n format.html { render :new }\n format.json { render json: @doctor.errors, status: :unprocessable_entity }\n end\n end\n end", "def current_doctor\n @current_doctor ||= Doctor.find_by(id: session[:doctor_id])\n end", "def new_appointment(patient_class, date)\napps = Appointment.new(date, patient_class, self)\napps\nend", "def advisor_show\n end", "def doctor(_kitchen_state)\n false\n end", "def initialize # hook/callback/lifecycle event: because it is a method automatically fired by another method\n self.cry # explicit receiver of self - same as line below\n cry # implicit receiver of self - same as line above\n # Ruby will first check cry as a variable; when that fails, Ruby will assume it is a method on the class itself - implied \"self\"\n @birthdate = Time.now\n @@all << self # How does an object refer to itself? self! stores object ID\n end", "def record; end", "def record; end", "def record; end", "def owner\n @doctor = Doctor.find_by(id: params[:id])\n if current_doctor?(@doctor)\n\n else\n #redirect_to(signin_path)\n end\n #unless current_doctor?(@doctor)\n end", "def child_class\n Objekt\n end" ]
[ "0.7573614", "0.63717955", "0.6336559", "0.6176266", "0.6149293", "0.6114734", "0.61062366", "0.60507196", "0.6050536", "0.6036655", "0.60264516", "0.6020653", "0.6006742", "0.5993518", "0.5993518", "0.5993518", "0.5993518", "0.5993518", "0.5993518", "0.5993518", "0.59249836", "0.59203017", "0.58514994", "0.58444", "0.5804359", "0.5729252", "0.569106", "0.5664922", "0.5663275", "0.5650633", "0.5650633", "0.5650633", "0.5650633", "0.5650633", "0.5650633", "0.5650633", "0.5650633", "0.5650633", "0.5650633", "0.5650633", "0.5650633", "0.5650633", "0.5650633", "0.5650633", "0.5630254", "0.5610717", "0.56029296", "0.56029296", "0.56029296", "0.55979675", "0.5580148", "0.5580148", "0.55661196", "0.55661196", "0.5543513", "0.55250925", "0.5522971", "0.55134964", "0.5512495", "0.5512495", "0.5512495", "0.5512495", "0.5502512", "0.55014247", "0.547248", "0.54720396", "0.5468357", "0.54377747", "0.5419086", "0.541109", "0.5407556", "0.53821003", "0.53786296", "0.5366048", "0.53651065", "0.53609824", "0.5358559", "0.53571457", "0.53571457", "0.53533286", "0.53488994", "0.534668", "0.5345397", "0.533641", "0.533135", "0.53171086", "0.53139764", "0.5294409", "0.5290609", "0.52695626", "0.5267958", "0.52503824", "0.5243761", "0.52404463", "0.5239872", "0.52372116", "0.52370054", "0.52370054", "0.52370054", "0.52343506", "0.5229896" ]
0.0
-1
todo Manage diferent states of the page.
def find_page(url) found = Page.find_by_url(url) found if found #and (found.published?) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_page\n end", "def page; end", "def page; end", "def page; end", "def page; end", "def page; end", "def page; end", "def page; end", "def page; end", "def page; end", "def page; end", "def page; end", "def page; end", "def set_page\n @articlespage = 'active'\n end", "def page()\n session[:edit_mode] ||= 0\n# Initialize parts\n @parts = nil\n @js, @css = '', ''\n# find domain name in sites\n @site = dc_get_site\n# site is not defined. render 404 error\n return dc_render_404('Site!') if @site.nil?\n dc_set_options(@site.settings)\n# HOMEPAGE. When no parameters is set\n params[:path] = @site.homepage_link if params[:id].nil? and params[:path].nil?\n# Search for page \n pageclass = @site.page_table.classify.constantize\n if params[:id]\n @page = pageclass.find_by(subject_link: params[:id])\n elsif params[:path]\n# path may point direct to page's subject_link\n @page = pageclass.find_by(subject_link: params[:path])\n end\n# if @page is not found render 404 error\n return dc_render_404('Page!') unless @page\n dc_set_options @page.params\n# find design if defined. Otherwise design MUST be declared in site\n if @page.dc_design_id\n @design = DcDesign.find(@page.dc_design_id)\n return dc_render_404('Design!') unless @design\n end\n# Add to edit menu\n if session[:edit_mode] > 0\n session[:site_id] = @site.id\n session[:site_page_table] = @site.page_table\n session[:page_id] = @page.id\n end\n# perform check every hour. Perhaps if user has rights changes\n session[:last_check] ||= Time.now\n if (session[:last_check] - Time.now) > 3600\n # perform checks\n # TO BE DONE\n \n # update time\n session[:last_check] = Time.now\n end \n @page_title = @page.subject.empty? ? @site.page_title : @page.subject\n get_design_and_render @design\nend", "def build_current_page_state\n # Update the page with the attributes saved on the session\n @page.assign_attributes session[:page][@page_id] if session[:page][@page_id]\n if params[:site_page] && page_params.to_h.except(:dataset_setting, :dashboard_setting, :tags)\n @page.assign_attributes page_params.to_h.except(:dataset_setting, :dashboard_setting, :tags)\n end\n\n @page.tags_attributes = session[:tags_attributes][\"#{@page_id}\"] if session[:tags_attributes][\"#{@page_id}\"]\n end", "def page\n\n end", "def pages; end", "def activate\n\n Page.send :include, SiteTags \n \n Page.class_eval do\n def url_with_redirect\n if self.redirect.blank? \n url_without_redirect \n else\n if self.redirect =~ /^system_name:(.+)$/\n Page.current_site.pages.find_by_system_name($1).try(:url)\n else\n self.redirect\n end\n end\n end\n \n alias_method_chain :url, :redirect\n end\n \n \n ApplicationHelper.module_eval do\n def meta_label\n meta_errors? ? 'Méně' : 'Více'\n end\n end\n\n #ArchiveIndexTagsAndMethods.module_eval do\n # tag \"title\" do |tag|\n # setup_date_parts\n # page = tag.locals.page\n # unless @year.nil?\n # I18n.l(Date.new((@year || 1).to_i, (@month || 1).to_i, (@day || 1).to_i), :format => page.title)\n # else\n # page.title\n # end\n # end\n #end\n\n #ConditionalTags::CustomElement.send :include, SiteEvaluators\n \n \n Status.class_eval do\n \tclass << self\n \t\t@@loaded_statuses = []\n \t\n \t\tdef [](value)\n \t\t\tstatus = @@loaded_statuses.find {|st| st.symbol == value.to_s.downcase.intern }\n \t\t\tunless status\n\t\t\t\t\t\tstatuses = YAML::load(Radiant::Config['page.statuses']).invert\n\t\t\t\t\t\tstatus = Status.new(:id => statuses[value.to_s].to_i, :name => value.to_s.capitalize)\n\t\t\t\t\t\t@@loaded_statuses << status\n\t\t\t\t\tend\n\t\t\t\t\tstatus\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tdef find(id)\n\t\t\t\t\tstatus = @@loaded_statuses.find {|st| st.id == id.to_i }\n\t\t\t\t\tunless status\n\t\t\t\t\t\tstatuses = YAML::load(Radiant::Config['page.statuses'])\n\t\t\t\t\t\tif statuses.has_key?(id.to_i)\n\t\t\t\t\t\t\tstatus = Status.new(:id => id.to_i, :name => statuses[id.to_i].capitalize)\n\t\t\t\t\t\t\t@@loaded_statuses << status\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t# ActiveRecord::RecordNotFound.new(\"Status with ID #{id} not found\")\n\t\t\t\t\t\t\tstatus = Status.new(:id => id.to_i, :name => \"Unknown status ##{id}\")\n\t\t\t\t\t\tend\n\t\t\t\t\tend\t\t\t\t\t\n\t\t\t\t\tstatus\n\t\t\t\tend\n\t\t\n\t\t\t\tdef find_all\n\t\t\t\t\tstatuses = YAML::load(Radiant::Config['page.statuses'])\n\t\t\t\t\tstatuses.each_pair do |id, name|\n\t\t\t\t\t\tunless @@loaded_statuses.find {|st| st.id == id.to_i }\n\t\t\t\t\t\t\t@@loaded_statuses << Status.new(:id => id.to_i, :name => name.capitalize)\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\t\t@@loaded_statuses.dup\n\t\t\t\tend \n\t\t\t\t\n \tend\n end\n \n PagePart.class_eval do \n acts_as_list :scope => :page\n default_scope :order => 'position'\n \n def after_initialize\n #nothing\n end\n end\n \n \n \n admin.pages.edit.add :part_controls, 'admin/page_parts/additional_part_controls'\n\n Admin::PagesController.class_eval do\n before_filter :add_custom_admin_assets, :only => [:edit, :new]\n\n def add_custom_admin_assets\n include_stylesheet 'admin/custom_admin'\n @meta ||= []\n @meta << {:field => \"system_name\", :type => \"text_field\", :args => [{:class => 'textbox', :maxlength => 200}]}\n @meta << {:field => \"redirect\", :type => \"text_field\", :args => [{:class => 'textbox', :maxlength => 200}]}\n end\n end\n \n \n SiteController.class_eval do\n \n def export_pdf\n page = Page.find(params[:id])\n page_url = page.full_url + '?style=print'\n page_url += '#' + params[:selected] if params[:selected]\n pdf_file = \"/tmp/#{page.slug}_#{Time.now.to_i}.pdf\"\n if system(\"wkhtmltopdf #{page_url} #{pdf_file}\")\n send_file(pdf_file, :type=>\"application/pdf\")\n else\n render :inline => '<h1>Omlouváme se</h1><p>PDF se nepodařilo vygenerovat, zkuste to prosím znovu.</p>' \n end \n end\n end\n end", "def set_current_page_state\n session[:page][@page_id] = @page.attributes.except(:tags)\n end", "def set_resources\n set_site\n set_page\n\n build_current_page_state if action_name != 'new'\n end", "def paging_state\n end", "def draw_page_state\n return if @pages.size <= 1\n x = 0\n w = contents.width/2\n change_color normal_color\n contents.font.color.alpha = fp? ? 128 : 255\n self.draw_text(x, 0, w, line_height, \"<\")\n x += contents.text_size(\"<\").width + 5\n (0..@pages.size - 1).each { |i| x += draw_page_name(x, @pages[i]) }\n contents.font.color.alpha = lp? ? 128 : 255\n self.draw_text(x, 0, w, line_height, \">\")\n change_color(normal_color)\n end", "def set_page_keys\n @page_index = @vert_page_index = 0\n @item_pages = Bubs::InfoPages::ITEM_INFO_PAGES.clone\n @equipitem_pages = Bubs::InfoPages::EQUIP_INFO_PAGES.clone\n @item_pages.unshift(:ingredients)\n @equipitem_pages.unshift(:ingredients)\n refresh\n end", "def page_load; end", "def set_page_info\n unless user_signed_in? && (current_user.is_customer? || current_user.is_vendor? )\n @menus[:general_ledger][:active] = \"active\"\n end\n end", "def pages\n end", "def page; self end", "def draw_content\n change_color normal_color\n case selected_page\n when :overview;\n draw_overview_content\n when :stats;\n draw_stats_content\n when :skills;\n draw_skills_content\n when :drops;\n draw_drops_content\n else #nulla\n end\n end", "def selected_page\n end", "def set_page_data\n @page_title = \"Dragos | My Portfolio\"\n @seo_keywords = \"Dragos Portfolio\"\n end", "def set_published_state; end", "def state; end", "def state; end", "def state; end", "def state; end", "def state; end", "def state; end", "def state; end", "def state; end", "def states; end", "def wait_for_page_present(cls_name)\r\n case cls_name\r\n when 'data-manage'\r\n page_title = '视图管理列表'\r\n when 'shared-zones'\r\n page_title = '共享区列表'\r\n when 'share_zone_rr' # customized class_name\r\n page_title = '共享区记录列表'\r\n when 'zone_list' # customized class_name\r\n page_title = '区列表'\r\n when 'rr_list' # customized class_name\r\n page_title = '记录列表'\r\n when 'shared-rrs'\r\n page_title = '共享记录列表'\r\n when 'search'\r\n page_title = '全局搜索列表'\r\n when 'stub-zones'\r\n page_title = '存根区列表'\r\n when 'forward-zones'\r\n page_title = '转发区列表'\r\n when 'redirect-rrs'\r\n page_title = '重定向列表'\r\n when 'hint-zones'\r\n page_title = '根配置列表'\r\n when 'hint_zone_rr'\r\n page_title = '记录列表'\r\n when 'local-policies'\r\n page_title = '本地策略列表'\r\n when 'query-source'\r\n page_title = '请求源地址列表'\r\n when 'monitorsetting'\r\n page_title = '监测设置列表'\r\n when 'views'\r\n page_title = '视图管理列表'\r\n when 'sortlists' # customized class_name\r\n page_title = '记录排序列表'\r\n when 'acls'\r\n page_title = '访问控制列表'\r\n when 'ip-rrls'\r\n page_title = 'IP解析限速列表'\r\n when 'domain-rrls'\r\n page_title = '域名解析限速列表'\r\n when 'monitor_strategies'\r\n page_title = '策略列表'\r\n when 'redirections'\r\n page_title = 'URL转发列表'\r\n when 'users'\r\n page_title = '用户管理列表'\r\n when 'audit-logs'\r\n page_title = '操作日志列表'\r\n when 'warning_records'\r\n page_title = '告警记录'\r\n when 'data_backup_logs'\r\n page_title = '备份/恢复列表'\r\n end\r\n sleep 1\r\n begin\r\n page_open = Watir::Wait.until {ZDDI.browser.div(:id=>\"tableTitle\").span.text == page_title}\r\n return 'succeed' if page_open\r\n rescue\r\n # Watir::Wait.until 默认等待30s, 超时后报错.\r\n return 'fail'\r\n end\r\n end", "def page!\n save_and_open_page\n end", "def page!\n save_and_open_page\n end", "def set_page\n @page = Page.published.friendly.find(params[:id])\n @sections = @page.sections.published.sorted\n @subpages = @page.subpages.published.sorted\n end", "def page=(_arg0); end", "def page=(_arg0); end", "def page=(_arg0); end", "def mission(page)\n\tend", "def update_page(page)\n case page\n when 'previous'\n @bundle = previous_bundle\n when 'next'\n @bundle = next_bundle\n end\n end", "def set_pages_flag\n @pages_flag = true\n end", "def assign_pages!; end", "def change_page(p)\n self.page = p\n self\n end", "def page_revisions\n self.back_to_top\n page_revisions_button\n wait_for_ajax\n \n end", "def state\n end", "def show\n\n # if Order.where(user: current_user).last.nil?\n # @order = Order.create!(state: 'pending', user: current_user)\n # elsif Order.where(user: current_user).last.state == 'pending'\n # @order = Order.find_by(user: current_user)\n # elsif Order.where(user: current_user).last.state == 'paid'\n # @order = Order.create!(state: 'pending', user: current_user)\n # end\n\n\n\n\n\n render template: \"pages/#{params[:page]}\"\n end", "def init_page_variables\n @title = String(nil)\n @text = String(nil)\n @index = nil\n end", "def set_info\n @page_header = 'Insight Engine'\n @page_secondary = 'Let\\'s get a view at 10,000 feet.'\n @page_title = 'LeadAccount | Insight Engine'\n @page_icon = 'lightbulb'\n end", "def create_before\n return unless Spree::Config[:cms_page_status_default]\n @page.is_active = Spree::Config[:cms_page_status_default]\n end", "def set_resource_content\n @page = Page.available.homepage.first!\n end", "def sub_view\n page(NavTabBarPage).select_storytab(\"Action\")\n page(NavTabBarPage).flag_handler(\"Cancel\")\n page(NavTabBarPage).select_storytab(\"Action\")\n page(NavTabBarPage).sub_handler\n page(SubmissionPage).verify_page_elements\n page(SubmissionPage).select_action(\"Submissions\")\n page(SubmissionPage).select_action(\"Comments\")\n page(MorePage).backpage\n end", "def set_page(page)\n @tab_state = page\n @controller.change_tab(page)\n end", "def prepare_for_action\n # #don't save stuff between requests\n NotRelational::RepositoryFactory.instance.clear_session_cache\n @@page_blurbs =Set.new\n @renderer_params={}\n $current_weblab=nil\n @current_user=nil\n @displayed_blurb_names=Set.new\n # if BannedIp.is_banned?(request.remote_ip)\n # head(401)\n # return\n # end\n\n prepare_language_for_action\n prepare_powerbar_for_action\n prepare_rendermode_for_action\n prepare_weblab_for_action\n\n\n self.page_title=\"Rengine\"\n self.no_wrap=false\n return true\n end", "def show\n \n if Page.count==0\n ensure_homepage\n else\n @page = @page || Page.find_by_alias(app_path)\n # TODO: add the ability for the user to choose whether to render the page or use it as a redirect\n #path = @page.path == '/' ? 'index' : @page.path\n #redirect_to @page.url unless path==app_path\n end\n\n if @page.nil?\n if admin?\n flash[:notice]=\"The page you requested does not exist. Would you like to create it?\"\n @page = Page.new(:path=>app_path)\n @page_template = \"admin\"\n render :action=>'new'\n else\n render :file => \"#{RAILS_ROOT}/public/404.html\", :layout => false, :status => 404\n end\n else\n @app_path=@page.path\n @title = @page.title\n @page_description = @page.description\n\n # Even though the printable pages are rendered in a different layout\n # they also need a different template, since this template should only\n # have a single column\n \n if params[:print] && params[:print] == \"true\"\n @page_template = \"print\"\n elsif @page.url =~ /moving_from_caregivers_menu/\n @page_template = \"template_caregivers\"\n elsif @page.url =~ /moving_from_providers_menu/\n @page_template = \"template_providers\"\n else\n @page_template = @page.template.name\n end\n \n # This isn't really necessary, but it makes the print view very clean\n @pages = [@page]\n\n if params[:popup] && params[:popup] == \"true\"\n render :action => \"show\", :layout => false\n end \n\n if params[:save] && params[:save] == \"true\"\n render_for_save\n end \n \n #Setting the body_id to caregivers to access Noah's customized css. \n #Setting the body_id to caregivers to access Noah's customized css. \n if @page.template.name == 'template_caregivers'\n @body_id = \"Caregivers\" \n @other_perspective, @other_persepective_title = 'moving_from_providers_menu' + $1, 'Health Care Provider Perspective' if @page.url =~ /moving_from_caregivers_menu(.*)/\n elsif @page.template.name == 'template_providers'\n @body_id = \"Providers\" \n @other_perspective, @other_persepective_title = 'moving_from_caregivers_menu' + $1, 'Family Caregiver Perspective' if @page.url =~ /moving_from_providers_menu(.*)/\n elsif @page.template.name == 'template_caregivers_no_menu'\n @body_id = \"Caregivers\" \n elsif @page.template.name == 'template_providers_no_menu'\n @body_id = \"Providers\" \n elsif @page.template.name == 'template_index'\n @body_id = \"Home\" \n end\n \n @left_top_menu = Page.find_by_path 'left_top_menu' \n @left_bottom_menu = Page.find_by_path 'left_bottom_menu' \n \n \n @page_template, @page_type = 'template_pdf', 1 if @page.path == 'CaregiverTool'\n @page_template, @page_type = 'template_pdf', 2 if @page.path == 'ProviderTool'\n \n end\n end", "def test_pages\n oldpage = @current_page\n @current_page = nil\n for i in 0...pages.size\n if test_page_conditions(i)\n @current_page = i\n if oldpage != @current_page\n # Run only if the page actually changed\n @direction = current_page.graphic[:direction] || 2\n # Delete any interpreters there may be left trying to run the old page\n if oldpage\n if oldpage.has_trigger?(:parallel_process)\n $game.map.parallel_interpreters.delete_if { |i| i.event == self }\n else\n $game.map.event_interpreters.delete_if { |i| i.event == self }\n end\n end\n # Execute event if new page is Parallel Process or Autorun\n if current_page.has_trigger?(:parallel_process) || current_page.has_trigger?(:autorun)\n trigger\n end\n if current_page.automoveroute[:commands].size > 0\n # Wait 1 frame to start the new autonomous move route so the visuals have time to adjust to the new page.\n @automove_wait = 1\n end\n end\n break\n end\n end\n end", "def show\n unless params[:id].nil?\n @page = Page.find_by_param(params[:id])\n @ok = true\n else\n unless params[:name].nil? && params[:language].nil?\n session[:language] = Language.find_by_short_name(params[:language])\n # @page = Page.find_by_param_and_language_id(params[:name], session[:language].id)\n @page = Page.find_by_param(params[:name], :conditions => [\"language_id = ?\", session[:language].id])\n @ok = true\n else\n @page = Page.find(:first)\n @ok = false\n end\n end\n if session[:language].nil?\n session[:language] = Language.find(:first)\n end\n# Blog controller rendering is disabled \n# if @page.is_blog and false\n# redirect_to :controller => 'pages', :action => 'blog', :user => User.find(@page.user_id).login, :language => session[:language].short_name and true\n# else\n unless @page.nil?\n @main_position = @page.layout_template.positions.find(:first, :conditions => [\"main_position = 1\"])\n @items = @page.blocks.find(:first, :conditions => [\"position_id = ?\",@main_position.id]).items\n if @main_position.page_pagination > 0 and !@items.nil?\n @items = @items.paginate :page => params[:page], :per_page => @main_position.page_pagination, :order => '\"order\" DESC'\n end\n if @page.redirect.nil?\n respond_to do |format|\n format.html { render :layout => \"layouts/\"+@page.layout_template.name }\n format.xml { render :template => @page.layout_template.name }\n end\n else\n redirection = Page.find(@page.redirect)\n unless redirection.nil?\n redirect_to redirection.get_page_path\n else\n redirect_to \"/404.html\"\n end\n end\n else\n if @ok\n redirect_to \"/404.html\"\n else\n redirect_to new_page_path\n end\n end\n end", "def loadHandinPage()\n end", "def store\n $page.store\n end", "def store\n $page.store\n end", "def pages=(_arg0); end", "def show_pages\n false\n end", "def page\n get_page\n nil\n end", "def setup\n @page = pages(:homepage)\n end", "def show\n @title = @page.title\n @pages = @page.find_related_tags\n @case_studies = CaseStudy.tagged_with(@page.tag_list, :any => true)\n @locked = REDIS.exists(\"locks:pages:#{@page.id}\")\n if params[:mercury_frame] == 'true' && !@locked\n REDIS.setex(\"locks:pages:#{@page.id}\", 300, @page.canonical_title)\n elsif params[:mercury_frame] == 'true'\n render(text: \"<html><body><script type='text/javascript' charset='utf-8'>window.parent.document.location.href = '#{page_path(@page)}';</script></body></html>\", content_type: :html) and return\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @page }\n end\n end", "def set_info\n @page_header = 'Dashboard'\n @page_title = 'LeadAccount | Dashboard'\n @page_icon = 'dashboard'\n end", "def page\n nil\n end", "def view_profile_of_page(page_name)\n self.link(:class=>/lhnavigation_page_title_value/, :text=>page_name).fire_event(\"onmouseover\")\n wait_for_ajax #.wait_until { self.link(:class=>/lhnavigation_page_title_value/, :text=>page_name).parent.div(:class=>\"lhnavigation_selected_submenu_image\").visible? }\n self.div(:class=>\"lhnavigation_selected_submenu_image\").hover\n self.execute_script(\"$('#lhnavigation_submenu').css({left:'328px', top:'349px', display: 'block'})\")\n wait_for_ajax #.wait_until { self.link(:id=>\"lhavigation_submenu_edittitle\").visible? }\n self.link(:id=>\"lhnavigation_submenu_profile\").click\n wait_for_ajax #.button(:title=>\"Show debug info\").wait_until_present\n self.window(:title=>\"rSmart | Content Profile\").use\n ContentDetailsPage.new self\n end", "def template_page(site); end", "def page\n @page ||= Page.instance\nend", "def associate_page(page); end", "def page=(page)\n @page = page\n @objects = page.objects\n @font_stack = [build_fonts(page.fonts)]\n @xobject_stack = [page.xobjects]\n @content = {}\n @stack = [DEFAULT_GRAPHICS_STATE]\n end", "def set_page\n @page = Page.friendly.find(params[:id])\n @page_title = @page.title\n # TODO: Published page scope. Maybe add a association on Page so that a page has_one current_published_version.\n # This could be set in a after_save filter when updating page statuses.\n # @page = Page.friendly.find(params[:id]).versions.where_object(status: 1).last.reify\n rescue ActiveRecord::RecordNotFound\n if action_name == 'show' && Rails.env.production?\n redirect_to root_url, flash: { error: 'Record not found.' }\n else\n raise ActiveRecord::RecordNotFound\n end\n end", "def editstate\n\t\t@documents = Document.all\t\t\t\n\t\t@article = Article.find(params[:id])\n\t\t@have_sidebar = true\n\tend", "def turn_page\n puts \"Flipping the page...wow, you read fast!\"\n end", "def turn_page\n puts \"Flipping the page...wow, you read fast!\"\n end", "def states\n raise \"You must override the states method.\"\n end", "def set_page_metadata\n params[:id].tap do |page|\n if %w(home privacy styles terms).include? page\n page_title t(\"pages.#{page}.page_title\") unless page == 'home'\n page_author t(\"pages.#{page}.page_author\", default: '')\n page_description t(\"pages.#{page}.page_description\", default: '')\n extra_body_classes \"#{page}-page\"\n end\n end\n end", "def page\n obj\n end", "def initialize\n @page = 1\n end", "def current_page; end", "def current_page; end", "def update_page_on_show(page)\n if wants_refresh?\n page.update_frame_for(object)\n else\n page.push_frame_for(object)\n end\n end", "def set_page\n # Verify if the manager is editing a page or creating a new one\n @page = params[:site_page_id] ? SitePage.find(params[:site_page_id]) : (SitePage.new site_id: @site.id)\n\n @page_id = @page&.persisted? ? @page.id.to_s : :new\n end", "def post page_name\n redirect(\"/login?return_to=#{CGI::escape(@env['REQUEST_URI'])}\") and return unless logged_in?\n page_name_spc = page_name.gsub(/_/,' ')\n if input.submit = 'save'\n attrs = { :body => input.post_body, :title => input.post_title, :user_id =>@state.user.id }\n attrs[:readonly] = input.post_readonly if is_admin?\n @page = Page.find_by_title(page_name_spc)\n if @page.nil?\n # new page\n @page = Page.create(attrs)\n else\n @page.update_attributes(attrs)\n end\n redirect Show, input.post_title.gsub(/ /,'_')\n elsif input.submit == 'minor edit'\n attrs = { :body => input.post_body }\n attrs[:readonly] = input.post_readonly if is_admin?\n page = Page.find_by_title(page_name_spc)\n current_version = page.find_version(page.version)\n current_version.update_attributes(attrs)\n page.without_revision { page.update_attributes(attrs) }\n redirect Show, input.post_title.gsub(/ /,'_')\n else # cancel\n redirect Show, page_name\n end\n end", "def sub_flag\n page(MorePage).touch_subflag\n page(NavTabBarPage).flag_handler(\"Cancel\")\n page(MorePage).touch_subflag\n page(NavTabBarPage).flag_handler(\"Flag\")\n sleeper(25)\n page(MorePage).backpage\n sleeper(16)\n end", "def extra_state; end", "def open_pages\n make_calendars\n make_topics\n end", "def initialize(page_drop); end", "def sections(form_state = nil)\n if form_state.nil?\n return :general\n else\n case form_state\n when :general\n puts \"Hello world now 1 in perfect method case latest\" \n\t { :title=>'General Info', :next=>:reviewers, :prev=>nil}\n when :coauthors\n {:title=>'Co-Authors', :next=>:reviewers, :prev=>:general}\n when :reviewers\n {:title=>'Reviewers', :next=>:fees, :prev=>:general}\n when :fees\n {:title=>'Fees', :next=>:checklist, :prev=>:reviewers}\n when :checklist\n {:title=>'Checklist', :next=>:nil, :prev=>:fees}\n \n when :review\n {:title=>'Review', :next=>nil, :prev=>:nil}\n end\n end\n end", "def set_page\n\t\t@page = Page.find(params[:id])\n\tend", "def selected_page=(page)\n end" ]
[ "0.67010725", "0.6689271", "0.6689271", "0.6689271", "0.6689271", "0.6689271", "0.6689271", "0.6689271", "0.6689271", "0.6689271", "0.6689271", "0.6689271", "0.6689271", "0.64467865", "0.6426666", "0.6385554", "0.6363547", "0.63117373", "0.63002527", "0.62980294", "0.629646", "0.62457794", "0.6218561", "0.6202299", "0.6201351", "0.6193944", "0.61428505", "0.6131214", "0.6098856", "0.60665685", "0.6050471", "0.60169816", "0.5991682", "0.5991682", "0.5991682", "0.5991682", "0.5991682", "0.5991682", "0.5991682", "0.5991682", "0.59885144", "0.59679836", "0.59575886", "0.59575886", "0.5940586", "0.5910114", "0.5910114", "0.5910114", "0.5891662", "0.5890677", "0.5887722", "0.58735496", "0.587311", "0.5867711", "0.5832082", "0.58234704", "0.5797703", "0.5773461", "0.5748436", "0.5743482", "0.57282233", "0.5715152", "0.57122815", "0.57020944", "0.5696832", "0.56913966", "0.5685691", "0.5680893", "0.5680893", "0.5662433", "0.5656224", "0.5639352", "0.56270134", "0.5622538", "0.5620678", "0.5610728", "0.5608944", "0.5598581", "0.559025", "0.5580146", "0.55769175", "0.5572079", "0.5567066", "0.55664814", "0.55664814", "0.55638725", "0.55629", "0.5559608", "0.5559023", "0.5558293", "0.5558293", "0.55551434", "0.5550209", "0.55343175", "0.5525207", "0.5519459", "0.5513706", "0.55018926", "0.54987997", "0.5494706", "0.54795253" ]
0.0
-1
this allows 'dup' to work in a desirable way for these instances, ie use a dup'd properties hash instance for the dup, meaning it can be updated without affecting the state of the original.
def initialize_copy(other) super @values = @values.dup end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deep_dup\n puts \"warning: #{self.class}: deep_dup not implement\"\n end", "def deep_dup; end", "def dup\n obj = super\n obj.duplicated_from = self\n obj.resource = self.resource_file\n uhook_duplicated_object(obj)\n\n obj\n end", "def deep_dup\n duplicable? ? dup : self\n end", "def deep_dup\n duplicable? ? dup : self\n end", "def deep_dup\n # noinspection RubyMismatchedReturnType\n dup\n end", "def dup\n\n # duplicate self\n rta = super\n\n # iterate through array and dup each hash\n rta.each_with_index do |w_hash, index|\n\n # dup the hash at this index\n rta[index] = w_hash.dup\n\n # to be complete, also dup the key/values in the hash, in case another hash/array is nested\n w_hash.each_pair do |k, v|\n rta[index][k] = v.dup if v.is_a? Hash\n end\n end\n\n # now everything should have new object_id's\n rta\n end", "def deep_dup\n Marshal.load(Marshal.dump(self))\n end", "def deep_dup\n dup\n end", "def deep_dup\n inject(self.class.new) do |new_hash, (key, value)|\n key = key.respond_to?(:deep_dup) ? key.deep_dup : key.dup?\n value = value.respond_to?(:deep_dup) ? value.deep_dup : value.dup?\n new_hash[key] = value\n new_hash\n end\n end", "def dup\n HashWithIndifferentAccess.new(self)\n end", "def dup\r\n other = super\r\n [:@opts, :@description].each do |var|\r\n d = instance_variable_get(var).dup\r\n other.instance_variable_set(var, d)\r\n end\r\n other\r\n end", "def dup\n self.class.new(to_hash)\n end", "def duplicate\n enhance_settings\n\n p = self.dup\n p.category = 'COPY OF ' + category\n p.created_at = p.updated_at = nil\n p.url = url\n p.attachment = attachment\n\n # allow site to do some customization\n p.send( :duplicate_extra, self ) if p.respond_to?( :duplicate_extra )\n p.save!\n \n p\n end", "def hash_dup\n save\n end", "def dup( )\n\t\t\tMarshal.load(Marshal.dump(self))\n\t\tend", "def dup\n self.class.new(@value, **(@object || {}))\n end", "def try_dup\n self.dup\n end", "def dup\n other = super\n %w{tables table_alias unique_alias where tables key_value_tables}.each do |k|\n other.send(\"#{k}=\", other.send(k).dup)\n end\n other\n end", "def dup\n super.tap do |e|\n e.args = e.args.dup\n e.kwargs = e.kwargs.dup\n end\n end", "def dup\n copy(false)\n end", "def initialize_dup( * ) # :nodoc:\n\t\t@hash = deep_copy( @hash )\n\tend", "def dup\n self.class.new.tap { |obj| reverse_dup_copy obj }\n end", "def dup\n raise NotImplementedError.new(\"Method 'dup' not implemented by '#{self.class.name}'\")\n end", "def deep_dup\n self.class.new(@parameters.deep_dup, @logging_context).tap do |duplicate|\n duplicate.permitted = @permitted\n end\n end", "def dup\n self.class.new(\n self.class.attributes.keys.each_with_object({}) do |k, result|\n val = send(k)\n next if val.nil? || (val.respond_to?(:empty?) && val.empty?)\n\n result[k] = val.is_a?(Array) ? val.map(&:dup) : val.dup\n end\n )\n end", "def dup\n clone\n end", "def dup\n Marshal::load(Marshal.dump(self))\n end", "def dup\n super.tap { |duplicate| duplicate.slug = nil if duplicate.respond_to?(\"slug=\") }\n end", "def dup\n clone = super\n clone.name = \"Clone of #{self.name}\"\n clone.institution_default = false\n # The instance requires an ID for MetadataProfileElement validations.\n clone.save!\n self.elements.each { |e| clone.elements << e.dup }\n clone\n end", "def dup\n other = super\n other.instance_variable_set(:@ini, Hash.new {|h,k| h[k] = Hash.new})\n @ini.each_pair {|s,h| other[s].merge! h}\n other.taint if self.tainted?\n other\n end", "def dup\n Ably::Models::IdiomaticRubyWrapper.new(attributes.dup, stop_at: stop_at.keys)\n end", "def dup\n duplicate = ManyValues.new(@details, @attribute)\n duplicate.values = self.values.map { |v| v.dup }\n duplicate\n end", "def dup\n self.class.new.tap{|obj| obj.initialize_copi self }\n end", "def dup\n other = super\n other.instance_variable_set(:@ini, Hash.new { |h, k| h[k] = {} })\n @ini.each_pair { |s, h| other[s].merge! h }\n other.taint if tainted?\n other\n end", "def dup *args\n x = super()\n x.deepen_dup!\n unless args.empty?\n x._options= *args\n end\n x\n end", "def dup_for_reference\n dup.tap do |r|\n r.created_at = self.created_at\n # r.id = nil # done by dup\n # r.instance_variable_set(\"@association_cache\", self.instance_variable_get(:association_cache))\n end\n end", "def dup_for_reference\n dup.tap do |r|\n r.created_at = self.created_at\n r.instance_variable_set(\"@association_cache\", self.association_cache)\n end\n end", "def duplicate\n p = self.dup\n p.name = 'COPY OF ' + name\n p.deleted_at = nil\n p.created_at = p.updated_at = nil\n p.taxons = taxons\n\n p.product_properties = product_properties.map { |q| r = q.dup; r.created_at = r.updated_at = nil; r }\n\n image_dup = lambda { |i| j = i.dup; j.attachment = i.attachment.clone; j }\n\n variant = master.dup\n variant.sku = 'COPY OF ' + master.sku\n variant.deleted_at = nil\n variant.images = master.images.map { |i| image_dup.call i }\n p.master = variant\n\n # don't dup the actual variants, just the characterising types\n p.option_types = option_types if has_variants?\n\n # allow site to do some customization\n p.send(:duplicate_extra, self) if p.respond_to?(:duplicate_extra)\n p.save!\n p\n end", "def clone()\n clone = self.class.new\n attributes.each do |k, v|\n next if k == :id || k == :uuid\n clone.attribute_set(k, DataMapper::Ext.try_dup(v))\n end\n oproperties.each do |p|\n clone.oproperty_set(p.name, DataMapper::Ext.try_dup(p.value))\n end\n\n clone.uuid = UUIDTools::UUID.random_create\n return clone\n end", "def dup\n # noinspection RubyMismatchedReturnType\n self.class.new(object.presence)\n end", "def clone\n dup\n end", "def dup\n self.class.new(self, self.default)\n end", "def safe_dup(value); end", "def dup\n new_object = super\n new_object.send :initialize_attributes, @attributes\n new_object\n end", "def dupd\n\t\t\tpush [:dup]\n\t\t\tdip\n\t\tend", "def dup\n return super unless post_id\n clone = super\n clone.post_id = nil\n clone\n end", "def dup\n copy = self.class.new\n copy.hsts = hsts\n copy.x_frame_options = x_frame_options\n copy.x_content_type_options = x_content_type_options\n copy.x_xss_protection = x_xss_protection\n copy.x_download_options = x_download_options\n copy.x_permitted_cross_domain_policies = x_permitted_cross_domain_policies\n copy.csp = if csp.is_a?(Hash)\n self.class.deep_copy(csp)\n else\n csp\n end\n\n copy.hpkp = if hpkp.is_a?(Hash)\n self.class.deep_copy(hpkp)\n else\n hpkp\n end\n copy\n end", "def dup() end", "def dup\n self.class.new(options)\n end", "def dup\n end", "def dup\n end", "def duplicate()\n bug( \"you must override duplicate()\" )\n end", "def dup\n self\n end", "def dup\n self\n end", "def dup\n self\n end", "def __deep_copy__\n self.class.new(aliases, serializers, associations, aliased_associations) do |copy|\n each_pair do |key, value|\n copy.merge!(key => value.__deep_copy__)\n end\n end\n end", "def dup\n ret = self.class.new\n fields.each do |tag, field|\n val = self.__send__(field.name)\n ret.__send__(\"#{field.name}=\", val)\n end\n return ret\n end", "def dup\n repo = RDF::N3::Repository.new {|r| r << @mutable}\n self.class.new(repo) do |reasoner|\n reasoner.instance_variable_set(:@options, @options.dup)\n reasoner.instance_variable_set(:@formula, @formula.dup) if @formula\n end\n end", "def dup(*arguments)\n args = {}\n\n self.class.aggregated_properties.each do |arg|\n args[arg] = instance_variable_get(\"@#{arg}\")\n end\n \n arguments.each_with_index do |argv,i|\n args[self.class.aggregated_properties[i]] = argv\n end\n \n args.merge!(arguments.extract_options!)\n \n self.class.new(args)\n end", "def dup\n self.class.new nil, @opts, &@block\n end", "def dup; end", "def dup; end", "def dup; end", "def dup; end", "def dup\n a = self.class.new\n a.args = args.map { |arg| arg.dup }\n a.proc = self.proc.dup\n a.id = Utils.random_str\n a\n end", "def dup\n super.tap do |instance|\n instance.instance_variable_set(:@chain, instance.chain.dup)\n end\n end", "def copy_attributes(other, duplicator)\n self.course = duplicator.options[:destination_course]\n self.default_reference_time = duplicator.duplicate(other.default_reference_time)\n\n other_reference_times = other.reference_times - [other.default_reference_time]\n self.reference_times = duplicator.duplicate(other_reference_times).unshift(default_reference_time)\n\n self.title = other.title\n self.description = other.description\n self.published = duplicator.options[:unpublish_all] ? false : other.published\n self.base_exp = other.base_exp\n self.time_bonus_exp = other.time_bonus_exp\n end", "def copy\n self.class.new.tap do |obj|\n self.each_pair do |key, val|\n obj.set(key => (val.is_a?(Array) or val.is_a?(Hash)) ? val.clone : val)\n end\n end\n end", "def copy\n self.class.new.tap do |obj|\n self.each_pair do |key, val|\n obj.set(key => (val.is_a?(Array) or val.is_a?(Hash)) ? val.clone : val)\n end\n end\n end", "def deep_dup()\n # avoid validation by using a empty Hash for the intial value.\n c = Data.new({})\n c.instance_variable_set(:@root, deep_dup_value(@root))\n c\n end", "def dup\n super().extend IndifferentAccess\n end", "def clone\n self.class.new(@attributes.except(:_id).except(:versions).dup)\n end", "def deep_copy\n copy = dup\n copy.values = {}\n @values.each { |k, v| copy.values[k] = v.clone }\n copy\n end", "def __deep_copy__\n self.class.new(aliases, serializers) do |copy|\n each_pair do |key, value|\n copy.store(key, value.__deep_copy__)\n end\n end\n end", "def dup\n self.class.new(self, @loaded)\n end", "def dup(*) end", "def dup\n super.tap do |copy|\n copy.instance_variable_set(:@config, @config.dup)\n end\n end", "def dup\n self.class.new(color, board, pos)\n end", "def dup\n Settings.new(self)\n end", "def dup\n copy = super\n copy.clear_puzzle\n @puzzle.each_with_index do |entry, index|\n copy[index] = entry\n end\n copy\n end", "def clone\n @clone ||= super\n end", "def dup\n self.class.new(build_exclusive_url,\n :headers => headers.dup,\n :params => params.dup,\n :builder => builder.dup,\n :ssl => ssl.dup,\n :request => options.dup)\n end", "def dup\n h = super\n h.fields = @fields.dup\n h.mbox_from = @mbox_from\n h\n end", "def clone\n super\n end", "def dup_state\r\n @state.dup\r\n end", "def dup\n copy = Rubinius.invoke_primitive(:object_class, self).allocate\n\n Rubinius.invoke_primitive :object_copy_object, copy, self\n\n Rubinius.privately do\n copy.initialize_copy self\n end\n copy\n end", "def deep_dup\n #new_ops = operands.map(&:dup)\n new_ops = operands.map do |op|\n op.deep_dup\n end\n graph_name = RDF::Node.intern(new_ops.hash)\n log_debug(\"formula\") {\"dup: #{self.graph_name} to #{graph_name}\"}\n self.class.new(*new_ops, **@options.merge(graph_name: graph_name, formulae: formulae))\n end", "def duplicate\n dup = Order.new\n dup.parent = self\n self.children << dup\n\n [:email,\n :ship_address,\n :bill_address,\n :shipping_method,\n :special_instructions,\n :split_shipment_type,\n :dc_code,\n :order_type].each do |attr|\n value = self.send(attr)\n dup.send(\"#{attr.to_s}=\", value)\n end\n\n # assign line_items\n self.line_items.each { |li| dup.add_variant li.variant, li.quantity }\n\n # set name\n dup.order_name = \"Duplicate of #{self.number}: #{self.order_name}\"\n dup.save!\n dup\n end", "def push_dup; end", "def deep_dup(hash)\n hash.each_with_object({}) do |(key, value), dup|\n dup[key] = value.is_a?(Hash) ? deep_dup(value) : value\n end\n end", "def dup\n\n Workitem.new(Rufus::Json.dup(@h))\n end", "def dup\n tmp = self.class.new\n tmp.instance_variable_set(\"@labels\", deep_copy_label_hash(@labels))\n tmp\n end", "def dup\n Options.new(*structures)\n end", "def dup\n result = self.class.new(geometric_resolution, order)\n result.initialize_copy(self)\n result\n end", "def deep_dup(index = {})\n return index[object_id] if index.key? object_id\n\n deep_dup_enumerable(self, index) { |new, k, v| new[k] = v }\n end", "def duplicate\n dup.tap do |c|\n c.page = nil\n columns.each do |column|\n c.columns << column.duplicate\n end\n pictures.each do |picture|\n c.pictures << picture.duplicate\n end\n end\n end", "def my_dup(obj)\n return obj if obj.is_a?(Numeric)\n copy = (obj.class).new\n x = obj.instance_variables\n x.each do |var_name| #copy attributes\n y = obj.instance_variable_get(var_name.to_sym)\n copy.instance_variable_set(var_name.to_sym, y)\n end\n copy\nend", "def dup; return self.class.new(RAtlas::dup(@storage)); end", "def dup\n result = self.class.new(dimension, geometric_resolution, order)\n result.send(:initialize_copy, self)\n result\n end", "def duplicate\n @copy = self.deep_clone :no_duplicates => true, :never_clone => [:uuid, :updated_at,:created_at]\n @copy.static_page = self.static_page.duplicate\n self.sub_pages.each do |page| \n copy_of_page = page.duplicate\n @copy.sub_pages << copy_of_page\n copy_of_page.save\n end\n @copy.save\n @copy\n end" ]
[ "0.7873889", "0.7573002", "0.75136524", "0.75119525", "0.75119525", "0.748015", "0.7466466", "0.74377644", "0.7426024", "0.74219996", "0.7418329", "0.73522955", "0.7339464", "0.73213774", "0.73163086", "0.72770643", "0.7271726", "0.72697425", "0.7266225", "0.72660094", "0.72659874", "0.72259724", "0.72200835", "0.7212938", "0.7202005", "0.71897364", "0.7186006", "0.7175055", "0.7149656", "0.712522", "0.71123767", "0.709299", "0.7065742", "0.7045155", "0.70326513", "0.7011501", "0.69880116", "0.6958903", "0.6919187", "0.6875887", "0.6842462", "0.6838558", "0.68359995", "0.6832488", "0.68282783", "0.6818809", "0.681828", "0.68072176", "0.68042135", "0.67876446", "0.67790246", "0.67790246", "0.6776274", "0.6776193", "0.6776193", "0.6776193", "0.67688936", "0.6763997", "0.6748523", "0.6745493", "0.6725861", "0.6721207", "0.6721207", "0.6721207", "0.6721207", "0.67032284", "0.67018366", "0.6696694", "0.6685067", "0.6685067", "0.6681064", "0.66774815", "0.6662923", "0.66544634", "0.6643939", "0.6627104", "0.66267574", "0.6599721", "0.6591237", "0.6586039", "0.6577891", "0.65762526", "0.6561999", "0.6557091", "0.65285206", "0.65250915", "0.6522939", "0.65150946", "0.65137917", "0.6511882", "0.65111417", "0.65069467", "0.650394", "0.6501833", "0.65012676", "0.6497385", "0.64943033", "0.6493908", "0.6481575", "0.64656126", "0.6463815" ]
0.0
-1
Based on Matz's code for OpenStructinspect in the stdlib. Note the trick with the Threadlocal :__inspect_key__, which ruby internals appear to use but isn't documented anywhere. If you use it in the same way the stdlib uses it, you can override inspect without breaking its cycle avoidant behaviour
def inspect str = "#<#{self.class}" ids = (Thread.current[:__inspect_key__] ||= []) if ids.include?(object_id) return str << ' ...>' end ids << object_id begin first = true for k,v in @values str << "," unless first first = false str << " #{k}=#{v.inspect}" end if @lazy_values str << "," unless first str << " ..." end return str << '>' ensure ids.pop end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inspect\n id_text = __id__.to_s(16).rjust(14, ?0)\n addr_text = self.address.to_s(16).rjust(14, ?0)\n\n member_text = if ! null? && ::Snow::CStruct.long_inspect\n # Get member text\n all_members_text = (self.class::MEMBERS.map do |member|\n name = member.name\n type = member.type\n align = member.alignment\n length = member.length\n length_decl = length > 1 ? \"[#{length}]\" : ''\n\n values_text = if length > 1\n single_member_text = (0 ... length).map { |index|\n \"[#{ index }]=#{ self.__send__(member.name, index).inspect }\"\n }.join(', ')\n\n \"{ #{ single_member_text } }\"\n else\n self.__send__(member.name).inspect\n end\n\n \"#{ name }:#{ type }#{ length_decl }:#{ align }=#{ values_text }\"\n\n end).join('; ')\n\n \" #{all_members_text}\"\n else # member_text = if ...\n # Skip members\n ''\n end # member_text = if ...\n\n \"<#{ self.class }:0x#{ id_text } *0x#{ addr_text }:#{ self.bytesize }:#{ self.alignment }#{member_text}>\"\n end", "def inspect(*) end", "def inspect(*) end", "def inspect(*) end", "def inspect(*) end", "def inspect(*) end", "def inspect() \"~#{@obj.inspect}~\" ; end", "def inspect() end", "def inspect() end", "def inspect() end", "def inspect() end", "def inspect() end", "def inspect() end", "def inspect() end", "def inspect() end", "def inspect() end", "def inspect() end", "def inspect() end", "def inspect() end", "def inspect() end", "def inspect() end", "def inspect\n %(#<#{self.class} struct_namespace=#{struct_namespace} auto_struct=#{auto_struct}>)\n end", "def inspect; end", "def inspect; end", "def inspect; end", "def inspect; end", "def inspect; end", "def inspect; end", "def inspect; end", "def inspect; end", "def inspect; end", "def inspect; end", "def inspect; end", "def inspect; end", "def inspect; end", "def inspect; end", "def inspect; end", "def inspect; end", "def inspect; end", "def inspect; end", "def inspect; end", "def inspect; end", "def inspect; end", "def inspect; end", "def inspect; end", "def inspect; end", "def inspect; end", "def inspect; end", "def inspect; end", "def inspect; end", "def inspect; end", "def inspect\n\t\treturn \"#<%s:0x%0x %s(%s) %p -> %p >\" % [\n\t\t\tself.class.name,\n\t\t\tself.object_id / 2,\n\t\t\tself.name,\n\t\t\tself.oid,\n\t\t\tself.desc,\n\t\t\tself.attr_oids,\n\t\t]\n\tend", "def inspect\n self._inspect({})\n end", "def inspect\n redacted_string(:inspect)\n end", "def inspect\n redacted_string(:inspect)\n end", "def inspect\n inspection = serializable_hash.collect do |k,v|\n \"#{k}: #{respond_to?(:attribute_for_inspect) ? attribute_for_inspect(k) : v.inspect}\"\n end\n \"#<#{self.class} #{inspection.join(\", \")}>\"\n end", "def inspect\n\t\treturn \"#<%p:%#016x %s>\" % [\n\t\t\tself.class,\n\t\t\tself.object_id * 2,\n\t\t\tself.inspect_details,\n\t\t]\n\tend", "def inspect()\n #This is a stub, used for indexing\n end", "def inspect\n \"#{ self.class }:0x#{ '%x' % (object_id << 1) }: #{ name }\"\n end", "def fattr_inspect\n to_hash.inspect\n end", "def inspect\n @_inspect ||= begin\n \"#<\" <<\n self.class.inspect <<\n (\":0x%014x\" % object_id) <<\n \">\"\n end\n end", "def inspect() \n print @obj_name\n print \" which is \"\n print @obj_attr\n print \" & \"\n puts @obj_secondattr\n end", "def inspect\n deep_hash.inspect\n end", "def pretty_inspect\n self.inspect\n end", "def inspect\n\t\t\treturn \"#<%p:%#0x %s>\" % [\n\t\t\t\tself.class,\n\t\t\t\tself.object_id * 2,\n\t\t\t\tself.inspect_details,\n\t\t\t]\n\t\tend", "def inspect(options={})\n \"(TODO: def #{self.class}#inspect(options={}))\"\n end", "def inspect(key = \"\")\n str = \"Info:\\n\"\n Thread.current[InspectKey] ||= []\n for k,v in @table\n Thread.current[InspectKey] << v\n begin\n if v.is_a? Info\n str << \"#{key}#{k}: #{v.inspect(\" #{k}.\")}\\n\"\n else\n str << \"#{key}#{k}: #{v.inspect}\\n\"\n end\n ensure\n Thread.current[InspectKey].pop\n end\n end\n str\n end", "def inspect\n \"#<#{self.class}:#{type_sym}:#{object_id.to_s(16)}>\"\n end", "def inspect\n end", "def inspect\n end", "def inspect\n inspectables = self.class.inspectables\n if inspectables\n \"#<#{self.class}:0x#{object_id.to_s(16)} \" + inspectables.map {|i| \"@#{i}=\\\"#{send(i) rescue nil}\\\"\"}.join(' ') + \">\"\n else\n super\n end\n end", "def inspect\n inspectables = self.class.inspectables\n if inspectables\n \"#<#{self.class}:0x#{object_id.to_s(16)} \" + inspectables.map {|i| \"@#{i}=\\\"#{send(i) rescue nil}\\\"\"}.join(' ') + \">\"\n else\n super\n end\n end", "def inspect\n end", "def inspect\n end", "def inspect\n end", "def inspect\n end", "def inspect\n end", "def inspect\n end", "def inspect\n end", "def inspect\n end", "def inspect\n end", "def inspect\n end", "def inspect\n end", "def inspect\n end", "def inspect\n end", "def inspect; to_s; end", "def inspect; to_s; end", "def inspect; to_s; end", "def inspect; to_s; end", "def inspect; to_s; end", "def inspect\n\t\treturn %{#<%s:0x%0x %s>} % [\n\t\t\tself.class.name,\n\t\t\tself.object_id / 2,\n\t\t\tself.ivar_descriptions.join( ', ' ),\n\t\t]\n\tend", "def inspect\r\n @symbol.inspect\r\n end", "def inspect\n\t\treturn \"#<%s:0x%x (%s): %s>\" % [\n\t\t\tself.class.name,\n\t\t\tself.object_id * 2,\n\t\t\tself.loaded? ?\n\t\t\t self.extensions.map( &:name ).join( ', ' ) :\n\t\t\t 'not yet loaded',\n\t\t\tself.dn\n\t\t]\n\tend", "def inspect\n \"<#{self.class}:0x#{object_id.to_s(16)}>\"\n end", "def inspect\n att_info = []\n inspect_attributes.each do |att|\n next unless respond_to? att\n\n att_info << \"#{att}=#{send(att).inspect}\"\n end\n att_info << '..'\n \"\\#<#{self.class}:#{object_id} #{att_info.join(', ')}>\"\n end", "def inspect\n \"#<#{self.class} #{to_s}>\"\n end", "def inspect\n @hash.inspect\n end", "def inspect\n inspection = self.info.keys.map { |name|\n \"#{name}: #{attribute_for_inspect(name)}\"\n }.compact.join(\", \")\n \"#<#{self.class}:0x#{self.object_id.to_s(16)} #{inspection}>\"\n end", "def inspect(indent=\"\")\n em = extension_modules\n interesting_methods = self.interesting_methods\n im = interesting_methods.size > 0 ? \" (#{interesting_methods.join(\",\")})\" : \"\"\n tv = text_value\n tv = \"...#{tv[-20..-1]}\" if tv.size > 20\n\n indent +\n self.class.to_s.sub(/.*:/,'') +\n em.map{|m| \"+\"+m.to_s.sub(/.*:/,'')}*\"\" +\n \" offset=#{interval.first}\" +\n \", #{tv.inspect}\" +\n im + \" [#{terminal?}]\" +\n (elements && elements.size > 0 ?\n \":\" +\n (@elements||[]).map{|e|\n begin\n \"\\n\"+e.inspect(indent+\" \")\n rescue # Defend against inspect not taking a parameter\n \"\\n\"+indent+\" \"+e.inspect\n end\n }.join(\"\") :\n \"\"\n )\n end", "def inspect\n object_identifier\n end", "def inspect\n \"(#{self})\"\n end" ]
[ "0.66296273", "0.6444158", "0.6444158", "0.6444158", "0.6444158", "0.6444158", "0.6428228", "0.63086724", "0.63086724", "0.63086724", "0.63086724", "0.63086724", "0.63086724", "0.63086724", "0.63086724", "0.63086724", "0.63086724", "0.63086724", "0.63086724", "0.63086724", "0.63086724", "0.62440753", "0.61967844", "0.61967844", "0.61967844", "0.61967844", "0.61967844", "0.61967844", "0.61967844", "0.61967844", "0.61967844", "0.61967844", "0.61967844", "0.61967844", "0.61967844", "0.61967844", "0.61967844", "0.61967844", "0.61967844", "0.61967844", "0.61967844", "0.61967844", "0.61967844", "0.61967844", "0.61967844", "0.61967844", "0.61967844", "0.61967844", "0.61967844", "0.61967844", "0.61967844", "0.6137296", "0.612556", "0.60850084", "0.60850084", "0.6064663", "0.60159874", "0.6008972", "0.5959934", "0.59574926", "0.5956816", "0.5912328", "0.5891289", "0.58798", "0.58392644", "0.58377", "0.5830829", "0.58189774", "0.5795635", "0.5795635", "0.5788213", "0.5788213", "0.5782603", "0.5782603", "0.5782603", "0.5782603", "0.5782603", "0.5782603", "0.5782603", "0.5782603", "0.5782603", "0.5782603", "0.5782603", "0.5782603", "0.5782603", "0.57540804", "0.57540804", "0.57540804", "0.57540804", "0.57540804", "0.5750289", "0.5738628", "0.5735333", "0.57352364", "0.57350755", "0.57242954", "0.5723458", "0.5720708", "0.56713146", "0.5662382", "0.5661073" ]
0.0
-1
Returns current frame's `location.href`.
def url evaluate("document.location.href") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_url\n evaluate(\"window.top.location.href\")\n end", "def href\n `window.location.href`\n end", "def actual_url\n @browser.current_url\n end", "def current_url\n @rawpage.current_url\n end", "def current_url\n request.env['REQUEST_URI']\n end", "def current_url\n page.driver.browser.current_url\n end", "def url\n @browser.current_url\n end", "def get_location\n Native(`new URL(window.location.href)`)\n end", "def current_url\n page.driver.browser.current_url\n end", "def current_url\n page.current_url\n end", "def current_url\n page.current_url\n end", "def current_url\n webdriver.current_url\n end", "def url\n\n begin\n url = @driver.current_url\n\n rescue Exception => e\n @@logger.an_event.error \"get current url : #{e.message}\"\n raise Errors::Error.new(BROWSER_NOT_FOUND_URL, :values => {:browser => name}, :error => e)\n\n else\n @@logger.an_event.debug \"get current url : #{url}\"\n url\n end\n end", "def current_path\n current_url = page.current_url\n url_match = URL_REGEX.match(current_url)\n return url_match[4] if url_match\n\n # Special case: prepend a slash to the path to force a valid URL for things like\n # \"about:srcdoc\" iframe srcdoc pages.\n current_url = \"/#{current_url}\" if current_url[0] != '/'\n\n current_url\n end", "def current_path\n URI.parse(current_url).path\nend", "def current_url\n bridge.url\n end", "def current_url\n driver.current_url\n end", "def path\n `window.location.pathname`\n end", "def current_path\n return nil if current_url.nil?\n return current_url.gsub(\"http://www.example.com\",\"\")\n end", "def cururl\n Chrome.windows[1].get.tabs[Chrome.windows[1].get.active_tab_index.get].get.URL.get.strip\nend", "def get_page_url\n $driver.current_url\nend", "def solve(location)\n if location == :current\n request.url\n else\n location\n end\n end", "def iframe_redirect_js_code(target_url)\n \"window.top.location.href = #{ target_url.to_json };\"\n end", "def current_url; end", "def current_path\n url_for(params)\n end", "def current_url\n return Knj::Web.url\n end", "def current_location\n object.location\n end", "def back_url\n ref = request.referer\n pattern = /^#{root_url}.*/i\n unless pattern.match(ref).nil?\n url = ref\n else\n url = \"#{root_url.chop}#{url_for :controller => params[:controller], :action => 'index'}\"\n end\n \n url\n end", "def navigated_location\n session[:before_login] = request.original_url if request.get?\n end", "def url\n @driver.current_url\n end", "def current_url\n self.last_effective_url\n end", "def current_location\n return @history[-1]\n end", "def current_host\n return nil unless agent && agent.current_page\n uri = agent.current_page.uri\n \"#{uri.scheme}://#{uri.host}\"\n end", "def navigationUrl\n @url\n end", "def remaining_path\n @remaining_path || Bowser.window.location.path\n end", "def get_current_path\n decompress_value(session['app.current_path']).tap do |path|\n session.delete('app.current_path') if path.blank?\n end\n end", "def url\n driver.getCurrentUrl\n end", "def fetch_location\n session[:forwarding_url]\n end", "def url_for_frameset; end", "def url_for_frameset; end", "def last_uri\n session[:last_path]\n end", "def previous_url\n session[:forwarding_url] || root_path\n end", "def url()\r\n @window_url\r\n end", "def url\n @browser.url\n end", "def current_url(options = {})\n path = (options[:params] == true) ? request.fullpath : request.path\n \"#{current_host}#{path}\"\n end", "def get_current_location\n\t \tif Rails.env.test? || Rails.env.development?\n\t \t\t[43.648209, -79.397865] # Hello HackerYou!\n\t \telse\n\t \t\trequest.location\n\t \tend\n\t end", "def last_location\n session[:last_location] || root_url\n end", "def return_to_url\n session[:return_to]\n end", "def current_frame\n @current_frame\n end", "def get_current_loc\r\n\t\treturn driver.location\r\n\tend", "def back_url\n @back_marked ? session[:back_url] : session[:prev_url]\n end", "def stored_location_for(resource_or_scope)\n session[\"previous_html_url\"] || root_path\n end", "def url\n @browser.url\n end", "def path_to_back\n\t\t\t\tback_path = request.referer\n\t\t\t\treturn back_path if back_path && back_path != request.url\n\t\t\t\treturn path_to :index if self.class.actions.include?(:index)\n\t\t\t\t'/'\n\t\t\tend", "def http_referer\n uri_path(request.env['HTTP_REFERER']) rescue '/'\n end", "def final_url\n call_once\n @headers[\"location\"] || @request.getURI.to_string\n end", "def landing_url\n active_plugins.first_url_in_menu\n end", "def source\n current_frame.getWebResponse.getContentAsString\n end", "def full_path\n uri.request_uri\n end", "def path\n location.path\n end", "def path_to_back\n\t\t\t\tback_path = request.referer\n\t\t\t\treturn back_path if back_path && back_path != request.url\n\n\t\t\t\treturn path_to :index if self.class.actions.include?(:index)\n\n\t\t\t\t'/'\n\t\t\tend", "def base_url\n current_base_href = base_href.to_s.strip.empty? ? nil : URL.absolutify(base_href, URL.new(url).root_url)\n current_base_href || url\n end", "def current_url(overwrite={})\n url_for :only_path => false, :params => params.merge(overwrite)\n end", "def href\n if clickable?\n # current_piece.url > current_data_item.url > current_page.url\n return page_layout.href if get_content_param_by_key( :context ) > 0\n return self.collection_tag.running_data_item.path if self.collection_tag.running_data_item.present?\n return self.collection_tag.current_page_tag.path\n end\n end", "def path\n @location.path\n end", "def base_href\n parsed_search('base').first.attributes['href'].value rescue nil\n end", "def current_browser_tab(app_bundle_path)\n if app_bundle_path =~ /Safari/\n app = SBApplication.applicationWithBundleIdentifier 'com.apple.Safari'\n tab = app.windows[0].currentTab\n [tab.URL, tab.name]\n elsif app_bundle_path =~ /Chrome/\n app = SBApplication.applicationWithBundleIdentifier 'com.google.Chrome'\n tab = app.windows[0].activeTab\n [tab.URL, tab.title]\n else\n abort(\"unknown app: #{app_bundle_path}\")\n end\nend", "def uri_path(request)\n @dreamhost_fix ? env[\"SCRIPT_URL\"] : request.path_info\n end", "def main_location_uri\n main_location.present? ? main_location.get_hyperlink : nil\n end", "def get_galleries_url(_browser = @browser)\n actual_url = _browser.current_url\n return actual_url\n end", "def current_path\n @current_path ||= @deploy_to + '/current'\n end", "def previous_url\n session[:previous_url] = request.original_url\n end", "def capture_path\n session[:return_to] = request.path if request.method == \"GET\" && !devise_controller? && !request.xhr? && action_name != 'redirect'\n @referrer_url = request.env['HTTP_REFERER']\n end", "def redirect_url\n @data[:redirect_url]\n end", "def redirect_url\n @data[:redirect_url]\n end", "def url\n @current_controller.url_for :controller => @controller_name, :action => @action_name\n end", "def webpage_url\n @response.effective_url || @webpage_request.url\n end", "def path\n @global_page.path\n end", "def back_uri\n session[:prev_path] || '/admin'\n end", "def getFinalUrl(url)\n return Net::HTTP.get_response(URI(url))['location']\nend", "def referer\n @headers[\"HTTP_REFERER\"] || \"/\"\n end", "def base_href\n parsed.search('base').first.attributes['href'].value rescue nil\n end", "def current_stream_url\n @ole.CurrentStreamURL\n end", "def get_current_url\n remove_context_path(@current_url)\n end", "def goto_base_url\n @browser.goto base_url\n end", "def requested_url\n raise \"URL could not be detected.\" unless @args[:request_args][:url]\n @args[:request_args][:url]\n end", "def store_location\n session[\"return-to\"] = request.fullpath\n end", "def actual_uri\n redirects_to or uri\n end", "def here\n\n \"#{request.scheme}://#{request.host}:#{request.port}\" +\n \"#{request.fullpath}\"\n end", "def _back_url\n _filtered_referrer || \"javascript:history.back()\"\n end", "def redirect_back\n if request.referer && request.referer.include?(\"http://#{request.host}\")\n request.referer\n else\n url(:root)\n end\n end", "def app_path\n res = send_request_cgi({\n # default.a.get( check\n 'uri' => normalize_uri(target_uri.path, 'js', 'app.js'),\n\t 'method' => 'GET'\n })\n\n if res && res.code == 200 && res.body =~ /baseURL/\n data = res.body\n #word = data.scan(/\"#{string_to_split}\"\\] = \"([\\S\\s]*?)\"/)\n base_url = data.scan(/baseURL: '\\/([\\S\\s]*?)'/)[0]\n print_status(\"baseURL: #{base_url}\")\n return base_url\n else\n fail_with(Failure::NotVulnerable, 'baseURL not found!')\n end\n end", "def page_path_from_url(url)\n ::URI.parse(url).request_uri\n end", "def store_location\n session[:return_to] = request.fullpath\n end", "def store_location\n session[:return_to] = request.fullpath\n end", "def store_location\n session[:return_to] = request.fullpath\n end", "def store_location\n session[:return_to] = request.fullpath\n end", "def store_location\n session[:forward_url] = request.url if request.get?\n end", "def back\n return root_path unless request.env['HTTP_REFERER']\n :back\n end", "def hash\n `window.location.hash`\n end" ]
[ "0.80965084", "0.71785486", "0.6995556", "0.6910226", "0.6843511", "0.6820817", "0.6812508", "0.6775048", "0.6736839", "0.66783345", "0.66783345", "0.6664685", "0.65422636", "0.65134716", "0.64588803", "0.6351641", "0.6296681", "0.6283395", "0.62478876", "0.62277806", "0.61698705", "0.61464626", "0.610019", "0.6095856", "0.60705525", "0.6053053", "0.60314685", "0.6026382", "0.60241395", "0.6009853", "0.59964", "0.59932125", "0.599156", "0.5984196", "0.5978637", "0.5976827", "0.5933088", "0.59111863", "0.58901966", "0.58901966", "0.5851964", "0.5848523", "0.58160454", "0.5805324", "0.5804189", "0.5778078", "0.5756539", "0.5732787", "0.5728332", "0.57181287", "0.57135683", "0.5691123", "0.56773156", "0.5641226", "0.5632585", "0.561654", "0.56119394", "0.56047547", "0.55969137", "0.5576165", "0.5575675", "0.55744255", "0.5573302", "0.55530035", "0.5551768", "0.5547736", "0.55273306", "0.55228865", "0.55201215", "0.5519406", "0.5516563", "0.5507653", "0.5506234", "0.550233", "0.550233", "0.5499061", "0.5496458", "0.5486628", "0.5484697", "0.54845566", "0.5480582", "0.54683864", "0.5467767", "0.54593", "0.5439885", "0.5422817", "0.5417473", "0.5412907", "0.5408693", "0.5398663", "0.5380429", "0.5378919", "0.5360427", "0.53506035", "0.53506035", "0.53506035", "0.53506035", "0.53405064", "0.5339888", "0.533618" ]
0.724398
1
Returns current frame's title.
def title evaluate("document.title") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def currentWindowTitle\n begin\n return theBrowser.title\n rescue\n return nil\n end\n end", "def current_title\n evaluate(\"window.top.document.title\")\n end", "def getPageTitle(frameName = \"\" )\n container = getObjectFrameReference( \"\" , frameName )\n begin\n return container.title\n rescue\n return nil\n end\n \n end", "def title()\r\n @window_title\r\n end", "def title\n (\"\\0\" * 256).tap do |buffer|\n WIN[:get_title].call(buffer, buffer.length - 1)\n end.gsub \"\\0\", ''\n end", "def title\n (\"\\0\" * 256).tap do |buffer|\n WIN[:get_title].call(buffer, buffer.length - 1)\n end.gsub \"\\0\", ''\n end", "def getWindowTitle\n @windowTitle\n end", "def title\n _title = self[\"title\"]\n _title ? _title[\"$t\"] : nil\n end", "def page_title\n @web_browser.page_title\n end", "def title\n @global_page.title\n end", "def page_title\r\n @web_browser.page_title\r\n end", "def title\n base_title = app_name \n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "def title\n if @title.nil?\n BASE_TITLE\n else\n \"#{BASE_TITLE} | #{@title}\"\n end\n end", "def title\n connection.write(\"get_title\", false)\n end", "def title\n connection.write(\"get_title\", false)\n end", "def title\n connection.write(\"get_title\", false)\n end", "def title\n base_title = \"Let Me Sing Now, llc\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "def title\n @title_pages.each { |tp| tp.title and return tp.title }\n nil\n end", "def titler\n if @title.nil?\n $application_name\n else\n \"#{$application_name} : #{@title}\"\n end\n end", "def get_title\n base_title = get_name_or_logo\n @title.nil? ? base_title : \"#{base_title} | #{@title}\"\n end", "def get_subject_name\n navigation_tabs.all_tabs.last[:title]\n end", "def title\n @data.title ||= parsed_document.css('title').inner_html.gsub(/\\t|\\n|\\r/, '') rescue nil\n end", "def title\n Window.functions[__method__] ||= AU3_Function.new(\"WinGetTitle\", 'SSPI')\n buffer = \" \" * AutoItX3::BUFFER_SIZE\n buffer.wide!\n Window.functions[__method__].call(@title.wide, @text.wide, buffer, AutoItX3::BUFFER_SIZE - 1)\n buffer.normal.strip\n end", "def title\n @browser.title\n Logbook.message(\"Page title is #{@browser}\")\n end", "def title\n @browser.title\n end", "def title\n @title ||= self.class.non_namespaced_classname\n end", "def title\n base_title = \"H&H\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "def title\n base_title = \"Railstwitterclone\"\n if @title.nil?\n base_title\n else\n \"#{base_title} - #{@title}\"\n end\n end", "def title\n\t\tbase_title = title_extend\n\t\tif @title.nil?\n\t\t\tbase_title\n\t\telse\n\t\t\t\"#{base_title} | #{@title}\"\n\t\tend\n\tend", "def title\n base_title = \"Team DIET Tracker\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "def get_title\n @doc.css('title').text\n end", "def title\n browser.title\n end", "def title\n base_title = \"Remind me to live\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "def title\n @title ||= parsed_document.css('title').inner_text rescue nil\n end", "def title\n base_title = \"CloudSpokes Coding Challenges\"\n if @page_title.nil?\n base_title\n else\n \"#{base_title} - #{@page_title}\"\n end\n end", "def title\n base_title = \"Bejben\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "def title\n if has_local? :title\n locals[:title]\n else\n File.basename(logical_path).titleize\n end\n end", "def title\n base_title = \"An Andy Sharkey Production\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "def title\n @title ||= parsed.css('head title').inner_text rescue nil\n end", "def title\n\t base_title = \"Most epic website of all time, also celebrating beer.\"\n\t if @title.nil?\n\t base_title\n\t else\n\t \"#{base_title} | #{@title}\"\n\t end\n end", "def title\n base_title = \"LoveALLogy\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "def title\n base_title = \"My Site\"\n unless @title.nil?\n \"#{base_title} | #{@title}\"\n else\n base_title\n end\n\n end", "def title\n base_title = \"This app is a Toast Machine\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "def page_title( this_title = nil )\n content_for( :title ) { \"#{ SITE_ID }: #{ this_title.nil? ? I18n.t( controller.controller_name + '.title' ) : this_title }\" }\n end", "def title\n # Sets the browser title bar display\n base_title = \"Grademypitch\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "def title\n current_localization.name\n end", "def title\n @info[:Title]\n end", "def title\n base_title = \"Golo\"\n if@title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "def get_title()\n return @title\n end", "def title\n t = _title.text_value.gsub(\"::\", \"\")\n t.blank? ? self.text : t\n end", "def title\n base_title = \"Soccer_League Manager\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "def title\n @title ||= (Nokogiri::HTML.parse(@html).title).to_s.gsub(/\\n|\\t|\\r/,\"\")\n end", "def page_title\n @page_title ||= format_string(page[\"title\"]) || site_title\n end", "def title\n @doc.xpath(\"/html/head/title\").first&.text\n end", "def title\n base_title = \"Reseau Social ESMT\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "def page_title\n \n page_title = @renderer.title title()\n \n puts \"[Cutlist.page_title]: #{page_title}\" if $cutlister_debug\n \n page_title\n \n end", "def page_title\n page.title\n end", "def title\n @title ||= details.at(\"h1.header\").text.strip rescue nil\n end", "def title\n\n begin\n title ||= @driver.title\n\n rescue Exception => e\n @@logger.an_event.warn \"browser found title : #{e.message}\"\n # raise Errors::Error.new(BROWSER_NOT_FOUND_TITLE, :values => {:browser => name}, :error => e)\n \"title not found\"\n\n else\n\n @@logger.an_event.debug \"browser found title #{title}\"\n title\n\n ensure\n\n end\n end", "def title\n base_title = \"Operation Paws for Homes\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "def title\n return @title\n end", "def title\n return @title\n end", "def title\n return @title\n end", "def title\n return @title\n end", "def title\n return @title\n end", "def title\n return @title\n end", "def title\n return @title\n end", "def title\n @title ||= self.content.split(@@title_separator).first unless self.content.nil?\n end", "def title\n base_title = \"Syamantak Mukhopadhyay - Weblog\"\n if @title.nil?\n base_title\n else\n \"#{@title}\"\n end\n end", "def get_title()\n @title\n end", "def title title = nil\n if title\n @title = title.to_s\n else\n @title ||= name[/([^:]+)$/, 1]\n end\n end", "def f_title\n self.title[0]\n end", "def title\n base_title = \"StkUp - Simple, Purposeful Comparisons\"\n @title.nil? ? base_title : \"#{base_title} | #{@title}\"\n end", "def\n get_title()\n @title\n end", "def title()\n @markdown_document.title()\n end", "def title\n base_title = \"Cliqs\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "def title\n title_raw.downcase\n end", "def title\n @hash[\"Title\"]\n end", "def title\n return @title\n end", "def title\n @title ||= Utilities.longest_common_substring_in_array(titles.values) \n @title = titles[:og_title] unless title_ok?\n @title = titles[:html_title] unless title_ok?\n @title = titles[:from_doc] unless title_ok?\n\n @title\n end", "def page_title\n layout = controller.send(:_layout)\n base_title = I18n.t(\"layouts.#{layout}.title\", default: :'layouts.application.title')\n\n i18n_scope = \"#{params[:controller].gsub('/', '.')}.#{action_name}\"\n i18n_parts = [\n content_for(:page_title),\n I18n.t(:page_title, default: \"\", scope: i18n_scope).presence,\n I18n.t(:title, default: \"\", scope: i18n_scope).presence\n ]\n title_content = i18n_parts.compact.first\n [base_title, title_content].compact.join(' - ')\n end", "def current_stream_title\n @ole.CurrentStreamTitle\n end", "def title\n return nil\n end", "def title\n base_title = 'Statustar'\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "def title\n @lastresult[\"context\"][\"title\"]\n end", "def title\n base_title = \"Read-O-Meter: Track your reading\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "def get_title\n @title\n end", "def html_title\n @html_title || title\n end", "def title\n Praline::browser.title\n end", "def page_title\n return \"#{this_webapp.webapp_name} - #{@page_title}\" if @page_title\n return \"#{this_webapp.webapp_name}\"\n end", "def title\n content_from 'ns:title', :ns => self.registered_ns\n end", "def title\n base_title = \"Ruby on Rails Tutorial Sample App\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{h(@title)}\"\n end\n end", "def full_title(page_title)\n if page_title.empty?\n app_name\n else\n \"#{page_title} | #{app_name}\"\n end\n end", "def title\n name.capitalize.bold.sub('_', ' ')\n end", "def title\n @title ||= heirarchy.full_name\n end", "def title\n node.at(\"title\").text\n end", "def page_title\n title = t(\"#{controller_name}.#{action_name}.title\")\n html = <<-HTML\n <div class=\"page-header\">\n <h1>#{title}</h1>\n </div>\n HTML\n html.html_safe\n end", "def title\n return \"\" unless parent\n Array(parent.title).first.to_s\n end", "def title\n base_title = \"Temple Baptist Church, White House, TN\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "def title\r\n @headers['TITLE']\r\n end" ]
[ "0.80988544", "0.80489486", "0.77392864", "0.7659522", "0.7587632", "0.7587632", "0.7381258", "0.7353406", "0.7343722", "0.73325276", "0.72012085", "0.7177491", "0.71357876", "0.7127385", "0.7127385", "0.7127385", "0.711938", "0.71153504", "0.7100578", "0.707911", "0.707785", "0.7075291", "0.70666623", "0.70656526", "0.7052559", "0.70509243", "0.70301265", "0.70274264", "0.7027042", "0.702564", "0.70254904", "0.70152", "0.7009274", "0.69997364", "0.69710964", "0.6966802", "0.6936261", "0.6930213", "0.6919608", "0.69178677", "0.69170356", "0.6904917", "0.6900976", "0.6893497", "0.6879456", "0.6878501", "0.6873448", "0.6866476", "0.6863335", "0.6862772", "0.6861385", "0.6852732", "0.6846919", "0.6816073", "0.681534", "0.68135595", "0.68131495", "0.6811409", "0.68083584", "0.6799783", "0.67996126", "0.67996126", "0.67996126", "0.67996126", "0.67996126", "0.67996126", "0.67996126", "0.67949516", "0.67947555", "0.67842937", "0.67776096", "0.6768881", "0.6767766", "0.676536", "0.6764231", "0.67619205", "0.67602605", "0.67591864", "0.6748894", "0.6746856", "0.67385554", "0.6729103", "0.67235255", "0.6722135", "0.67168874", "0.6714042", "0.67020226", "0.6697117", "0.6695466", "0.6694506", "0.6689579", "0.6678593", "0.6671562", "0.6663113", "0.66600853", "0.66581136", "0.6658006", "0.66579676", "0.6655304", "0.664316" ]
0.75207907
6
If current frame is the main frame of the page (top of the tree).
def main? @parent_id.nil? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nav\n frame_text = self.redirect {$ie.show_frames}\n if frame_text =~ /mainFrameSet/ then $ie.frame(:id, 'main').frame(:id, 'navigationFrame')\n else $ie.frame(:id, 'navigationFrame')\n end\n end", "def parent_frame; end", "def nav\r\n frame_text = self.redirect {$ie.show_frames}\r\n if frame_text =~ /infoArea/ then $ie.frame(:name, 'infoArea').frame(:name, 'navTreeArea')\r\n else $ie.frame(:id, 'navigationFrame')\r\n end\r\n end", "def current_frame\n @current_frame\n end", "def top_level?\n top_level == self\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 current?(other_page)\n page == other_page\n end", "def root_page?\n current_page == root_page\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 current?(page)\n @current == page\n end", "def parent_frame\n logger.info 'EyesTargetLocator.parent_frame()'\n unless driver.frame_chain.empty?\n on_will_switch.will_switch_to_frame :parent_frame, nil\n logger.info 'Done! Switching to parent_frame...'\n __getobj__.parent_frame\n end\n logger.info 'Done!'\n driver\n end", "def is_current(page)\n if controller.controller_name == page\n 'class=current'\n end\n end", "def showFrames()\n=begin\n \n ff = @ie.document.frames\n\n log \"there are \" + ff.length.to_s + \" frames\" if $debuglevel >=0\n\n for f in 0 .. ff.length-1\n log \"Frame: \" + ff[f.to_s].name.to_s if $debuglevel >=0 \n log \"My parent is: \" + ff[f.to_s].parentWindow.name.to_s if $debuglevel >=0\n end \n\n #frame = @ie.document.frames[ frameName ].document\n \n=end\n end", "def main?\n main_container == self\n end", "def is_parent_page_active(page)\n current_page.url.match(page)\n end", "def if_self\n @global_page.id == self[:id]\n end", "def current_frame\n @callstack.top\n end", "def is_top_nav?\n\t\t!nav_id\n\tend", "def global?\n @parent.nil?\n end", "def aria_current?(url)\n return 'page' if current_page?(url)\n end", "def parent_frame\n @bridge.switch_to_parent_frame\n end", "def current?\n current_window == handle\n end", "def is_top_level?\n respond_to?(:includes_origen_top_level?)\n end", "def top?\n @type == :top\n end", "def top?\n @type == :top\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 current_page?\n form.has_submit_button?\n end", "def current?\n # If this is called before the plugins are loaded (i.e. by a plugin's application file), then\n # it is definitely not the top-level app\n if Origen.application_loaded?\n Origen.app == self\n else\n Origen.root == root\n end\n end", "def current_tab\n @current_tab ||= current_sublink.parent || InternalTab.new\n end", "def current_page?(page)\n @current_page == page\n end", "def current_page?(url); end", "def det\r\n if has_frame?('infoArea') then $ie.frame(:name, 'infoArea').frame(:name, 'detailArea')\r\n else $ie.frame(:index, 3)\r\n end\r\n end", "def top_level?\n self.parent.is_a?(Document) || self.parent.is_a?(DocumentType) ? true : false\n end", "def running?\n\t\tis_a_window = (@main_window == 0) ? \n\t\t\tfalse : (is_window(@main_window.handle) != 0)\n\t\t\n\t\t@log.debug(\"Main window: #{@main_window.handle}, is a window: #{is_a_window}\")\n\t\tis_a_window\n\tend", "def isMainWindow\n true\n end", "def current_page; end", "def current_page; end", "def is_page_active(page)\n current_page.url == page\n end", "def frame\n context.frame\n end", "def is_top_level\n return \"/plist/dict\" == @breadcrumb\n end", "def set_current_site\n Page.current_site = current_site\n true\n end", "def current?\n self.class.current == self\n end", "def current?\n self.class.current == self\n end", "def current?\n self.class.current == self\n end", "def current?\n !@is_past\n end", "def top()\n @view__.top\n end", "def first_page?\n current_page == 0\n end", "def has_frame?(frame_name)\n frame_name = frame_name.to_s\n available_frames.include?(frame_name) ||\n supercall(false, :has_frame?, frame_name)\n end", "def first_page?\n current_page == 1\n end", "def first_page?\n current_page == 1\n end", "def current?\n self.collection_tag.template_tag.page_generator.menu.id == self.model.id\n end", "def current_root_page\n return unless current\n\n current.pages.language_roots.first\n end", "def first_page?\n current_page == 1\n end", "def first_page?\n current_page == 1\n end", "def first_page?\n current_page == 1\n end", "def first_page?\n current_page == 1\n end", "def naked_top_level?; end", "def if_front_page\n view_context.request.path == '/'\n end", "def frame; end", "def switch_to_parent_frame\n driver.switch_to.parent_frame\n end", "def parent_browsing_context; end", "def past?\n self < self.class.current\n end", "def in_iframe?\n !!env[\"facebook.in_iframe\"]\n end", "def check_in_frame(options)\n frames = options.delete :target_frames\n\n Applitools::ArgumentGuard.is_a? options, 'options', Hash\n Applitools::ArgumentGuard.is_a? frames, 'target_frames: []', Array\n\n return yield if block_given? && frames.empty?\n\n original_frame_chain = driver.frame_chain\n logger.info 'Switching to target frame according to frames path...'\n driver.switch_to.frames(frames_path: frames)\n logger.info 'Done!'\n\n yield if block_given?\n\n logger.info 'Switching back into top level frame...'\n driver.switch_to.default_content\n return unless original_frame_chain\n logger.info 'Switching back into original frame...'\n driver.switch_to.frames frame_chain: original_frame_chain\n end", "def current_url\n evaluate(\"window.top.location.href\")\n end", "def correct_rameur?\n current_rameur == @rameur\n end", "def current?\n @current\n end", "def page_active?(symbol); selected_page == symbol; end", "def on_page?\n false\n end", "def frame\n world.nil? ? nil : world.frame\n end", "def has_current_application?\n not self.current_application.nil?\n end", "def root?\n context.root_component == self\n end", "def main_break?\r\n return $scene != self # Abort loop if sceen is changed\r\n end", "def is_current_page_home?\n puts \"url_home\"\n puts request.url\n if request.url == \"http://127.0.0.1:3000/\" #home url\n @home = true\n end\n end", "def frm\n self.frame(:src=>/TBD/)\n end", "def frm\n self.frame(:src=>/TBD/)\n end", "def frm\n self.frame(:src=>/TBD/)\n end", "def frm\n self.frame(:src=>/TBD/)\n end", "def first_page?\n current_page == pages.begin\n end", "def if_ancestor_or_self\n local_page_id = self[:id].to_s\n ids = @global_page.ancestor_ids + [@global_page.id.to_s]\n ids.include?(local_page_id)\n end", "def has_parent?\n !parent_context.nil?\n end", "def is_triage_frame(widget)\n return widget[\"type\"] == \"frame\" && widget[\"title\"] =~ /TRIAGE ?(.*)/\nend", "def top_level\n @top_level ||= begin\n t = toplevel_listeners.first\n t.controller ? t.controller : t if t\n end\n end", "def has_top_control?\n !self.hide_top_control && !self.is_static?\n end", "def toplevel_method\n true\nend", "def has_sidebar?\n content_for?(:layout_sidebar)\n end", "def is_present?\n lookup_context.template_exists?('sub_nav', controller_name, true)\n end", "def at_top?\n higher_siblings.empty?\n end", "def active? path \n \"active\" if current_page? path\n end", "def current_navigation\n @current_navigation\n end", "def frame_self(frame_postion=0)\n #This is a stub, used for indexing\n end", "def empty?\n @top == -1\n end", "def empty?\n @top == -1\n end", "def empty?\n @top == -1\n end", "def empty?\n @top == -1\n end", "def select_current\n ## vp is local there, so i can do $vp[0]\n #open_file $view[$sta] if $view[$sta]\n if $mode == \"forum\"\n display_forum $view[$cursor]\n else\n on_enter get_current_title\n end\nend", "def current_page\n @current_page\n end", "def before?(other)\n FXWindow.before?(other)\n end", "def sidebar_enabled?\n current_page = \"#{controller.controller_name}.#{controller.action_name}\"\n current_controller = controller.controller_name\n pages = %w(report_templates.new report_templates.edit )\n\n return pages.include?(current_page) || pages.include?(current_controller)\n end" ]
[ "0.68766874", "0.6859186", "0.65871674", "0.64006937", "0.6364613", "0.6326518", "0.6326518", "0.6212763", "0.616797", "0.61507756", "0.61222523", "0.6083357", "0.6049696", "0.60402966", "0.6029266", "0.6022104", "0.5998965", "0.59682083", "0.5939741", "0.59285015", "0.58986205", "0.5874052", "0.58432853", "0.58402866", "0.58076763", "0.58076763", "0.57638067", "0.57471895", "0.57302666", "0.57255626", "0.57095224", "0.5708206", "0.5676577", "0.566391", "0.5610373", "0.55869144", "0.5581287", "0.5581287", "0.55691725", "0.5563806", "0.5548757", "0.55461335", "0.55247825", "0.55247825", "0.55247825", "0.5512331", "0.55116796", "0.5504995", "0.5496412", "0.5477253", "0.5477253", "0.5472677", "0.54710037", "0.5467389", "0.5467389", "0.5467389", "0.5467389", "0.54618776", "0.545977", "0.5457271", "0.5451169", "0.5387472", "0.5376897", "0.5375748", "0.53571874", "0.53448427", "0.5332321", "0.5330239", "0.5329835", "0.5327557", "0.53257495", "0.5324087", "0.53172064", "0.5314474", "0.5314233", "0.53049016", "0.53049016", "0.53049016", "0.53049016", "0.5303737", "0.5300584", "0.5295341", "0.5295235", "0.52925813", "0.52903056", "0.5283118", "0.52771896", "0.5276652", "0.5276618", "0.52732074", "0.52721584", "0.52693367", "0.5260668", "0.5260668", "0.5260668", "0.5260668", "0.5252594", "0.5250183", "0.5246868", "0.52387357" ]
0.5468405
53
Execution context id which is used by JS, each frame has it's own context in which JS evaluates.
def execution_id value = @execution_id.value return if value.instance_of?(Object) value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def execution_context\n raise \"Execution Context is not available in detached frame \\\"#{frame.url}\\\" (are you trying to evaluate?)\" if @_detached\n\n @_context_promise.value\n end", "def execution_context\n @context\n end", "def current_execution_context\n @current_execution_context || self.project.current_execution_cycle.id\n end", "def context\n @context ||= ExecJS.compile source\n end", "def context\n @context ||= ExecJS.compile(source)\n end", "def eval_context(context, node); end", "def get_id\n id = Thread.current[:id] \n id = 1 if @java_flag\n id\n end", "def run_context\n nil\n end", "def thread_context\n Thread.current[:runshell_context] ||= Context.new(main_context.to_h)\n end", "def _execution_id\n attributes['id']\n end", "def context_for_eval; end", "def runshell_context\n Thread.current == Thread.main ?\n main_context :\n thread_context\n end", "def context\n Thread.current[:ctx] ||= {}\n Thread.current[:ctx]\n end", "def execution_context\n initialize_context!(Object.new)\n end", "def context\n Thread.current[NAME] ||= Hash.new\n end", "def request_id\n # This one set by Rack::RequestId middleware\n Thread.current[:request_id]\n end", "def last_context=(_arg0); end", "def context=(_arg0); end", "def context=(_arg0); end", "def context=(_arg0); end", "def context=(_arg0); end", "def context=(_arg0); end", "def context=(_arg0); end", "def context=(_arg0); end", "def context=(_arg0); end", "def context=(_arg0); end", "def context=(_arg0); end", "def frame\n context.frame\n end", "def context\n @context_stack.last\n end", "def context(key = nil)\n current_context = key.nil? ? @context.local : @context.local(key)\n\n # Rebuild/reset context after a fork\n #\n # We don't want forked processes to copy and retransmit spans\n # that were generated from the parent process. Reset it such\n # that it acts like a distributed trace.\n current_context.after_fork! do\n current_context = self.context = current_context.fork_clone\n end\n\n current_context\n end", "def frame_id(*args)\n #This is a stub, used for indexing\n end", "def pipeline_id\n respond_to?(:execution_context) && !execution_context.nil? ? execution_context.pipeline_id : \"main\"\n end", "def myid\n \"Arguments#{(@@arguments.index(self) || -1000) + 1}\"\n end", "def id; frame[:id]; end", "def context\n unless @instance_context\n @instance_context = CallContext.new(@version , @params['sid'])\n end\n @instance_context\n end", "def trace_id\n self.current_trace ? self.current_trace.id : nil\n end", "def context\n @_context ||= {\n :argv => START_CTX[:argv].map { |arg| arg.dup },\n :cwd => START_CTX[:cwd].dup,\n 0 => START_CTX[0].dup,\n }.tap do |ctx|\n rewrite_context(ctx)\n end\n end", "def thread_context(tid)\r\n Ragweed::Wrap32::open_thread(tid) do |h|\r\n Ragweed::Wrap32::get_thread_context(h)\r\n end\r\n end", "def context\n unless @instance_context\n @instance_context = CurrentCallContext.new(@version, )\n end\n @instance_context\n end", "def context\n Thread.current[NAME] ||= Array.new\n end", "def mainContext\n # return Context.find( context )\n return context\n end", "def current\n all_contexts[Thread.current.object_id]\n end", "def req_id(env)\n env.request.context[:request_id].to_s\n end", "def context_id\n params[\"#{ params[:constraint][:context_type].singularize }_id\"]\n end", "def parent_browsing_context=(_arg0); end", "def current=(context)\n all_contexts[Thread.current.object_id] = context\n end", "def running_contexts\n contexts = FakeTraceObserverHelpers::RUNNING_SERVER_CONTEXTS\n contexts.map{|k,v| v}.inspect\n end", "def thread_id()\n #This is a stub, used for indexing\n end", "def dispatch_id\n local_ip + '/' + Process.pid.to_s\n end", "def current_session_id(env)\n env[ENV_SESSION_OPTIONS_KEY][:id]\n end", "def engine_id\n\n @dict.fexp.context.engine_id\n end", "def context(name = current_context)\n named_context(name)&.context\n end", "def variables_scope_id\n current_variables_scope.guid\n end", "def context=(value); end", "def current_trace_id\n if @@spans.empty?\n nil\n else\n @@spans.slice(-1).trace_id\n end\n end", "def frame_locals(frame)\n #This is a stub, used for indexing\n end", "def irb_context\n IRB.CurrentContext\n end", "def describe_context(context)\n @current_context = context\n end", "def current_span_id()\n if @@spans.empty?\n nil\n else\n @@spans.slice(-1).id\n end\n # if Thread.current[:spans].empty?\n # nil\n # else\n # Thread.current[:spans].slice(-1).id\n # end\n end", "def caller\n Thread.current\n end", "def caller\n Thread.current\n end", "def context(status, header, body, request)\n @context = context_retriever(request)&.call(status, header, body)\n @data[:request_context] = @context[:context_id] \\\n if @context && @context[:context_id]\n @context\n end", "def frame(id); end", "def context(args)\n context = args.delete(:context)\n context || @my\n end", "def current_context_for(*args)\n ::Fiveruns::Dash.sync { context_finder.call(*args) }\n end", "def context; end", "def context; end", "def context; end", "def context; end", "def context; end", "def context; end", "def context; end", "def context; end", "def context; end", "def context; end", "def context; end", "def context; end", "def context; end", "def context; end", "def context; end", "def context; end", "def context; end", "def context; end", "def context; end", "def context; end", "def context; end", "def context; end", "def context=(context)\n raise(InvalidMixError, \"#@name context already set for this frame\") if context and @context\n @context = context\n end", "def current_frame\n @callstack.top\n end", "def context\n Byebug.current_context\n end", "def run_id()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n result = Native.RunMetadata_run_id(@handle.ptr)\n result\n end", "def context\n unless @instance_context\n @instance_context = CallContext.new(@version , @params['account_sid'], @params['sid'])\n end\n @instance_context\n end", "def compiled_identifier\n identifier\n end", "def trace_context\n ensure_exists!\n trace.trace_context.with span_id: span_id\n end", "def contexts\n JSON.parse(raw_contexts())[\"results\"][\"bindings\"].map{|x| x[\"contextID\"][\"value\"] }\n end", "def unit_of_work_id\n Thread.current[:lumberjack_logger_unit_of_work_id] \n end", "def context(&block); end", "def context(&block); end", "def context\n unless @instance_context\n @instance_context = TaskContext.new(@version , @params['workspace_sid'], @params['sid'])\n end\n @instance_context\n end", "def context\n @context ||= {}\n end" ]
[ "0.6845661", "0.64666", "0.6380627", "0.6309493", "0.62887275", "0.61380875", "0.6109944", "0.60675323", "0.5990168", "0.5939775", "0.5897475", "0.58891565", "0.5880571", "0.5878176", "0.5837324", "0.5814406", "0.5771475", "0.57363814", "0.57363814", "0.57363814", "0.57363814", "0.57363814", "0.57363814", "0.57363814", "0.57363814", "0.57363814", "0.57363814", "0.57108366", "0.57085204", "0.5703949", "0.5696439", "0.56189686", "0.56180966", "0.56126094", "0.5593089", "0.55764073", "0.55670387", "0.5566876", "0.5557736", "0.55099523", "0.55061775", "0.5496418", "0.5479245", "0.544398", "0.53930146", "0.5390008", "0.5389149", "0.53758126", "0.53722584", "0.5372116", "0.53704995", "0.5362005", "0.5344541", "0.5341399", "0.5337436", "0.53203434", "0.52991956", "0.5292364", "0.52903706", "0.52845013", "0.52845013", "0.5273489", "0.52660525", "0.5264065", "0.52625036", "0.5244161", "0.5244161", "0.5244161", "0.5244161", "0.5244161", "0.5244161", "0.5244161", "0.5244161", "0.5244161", "0.5244161", "0.5244161", "0.5244161", "0.5244161", "0.5244161", "0.5244161", "0.5244161", "0.5244161", "0.5244161", "0.5244161", "0.5244161", "0.5244161", "0.5244161", "0.52432895", "0.5242722", "0.52410394", "0.5233943", "0.522766", "0.52081597", "0.5201174", "0.5196212", "0.5189772", "0.51878756", "0.51878756", "0.51849157", "0.51633435" ]
0.5673979
31
GET /drug_stores GET /drug_stores.json
def index @drug_stores = DrugStore.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @stores = Store.all\n render json: @stores\n end", "def show\n render json: @store\n end", "def index\n @api_v1_stores = Store.all\n json_response(@api_v1_stores)\n end", "def index\n @stores = Store.all.includes(:admin)\n\n respond_to do |format|\n format.html\n format.json\n end\n end", "def show\n respond_to do |format|\n format.html do\n gon.stores = [\"AppEstablishmentStore\"] \n gon.jbuilder \n end\n\n format.json { render :show }\n end \n end", "def index\n @store = Store.find(params[:store_id])\n @dish_discounts = @store.dish_discounts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dish_discounts }\n end\n end", "def show\n render json: @store\n end", "def create\n @drug_store = DrugStore.new(drug_store_params)\n\n respond_to do |format|\n if @drug_store.save\n format.html { redirect_to @drug_store, notice: 'Drug store was successfully created.' }\n format.json { render :show, status: :created, location: @drug_store }\n else\n format.html { render :new }\n format.json { render json: @drug_store.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @admin_stores = Admin::Store.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_stores }\n end\n end", "def index\n @store = Store.find(params[:store_id])\n @dish_choices = @store.dish_choices\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dish_choices }\n end\n end", "def show\n @store = Store.find(params[:store_id])\n @dish_discount = @store.dish_discounts.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dish_discount }\n end\n end", "def show\n @store = Store.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @store }\n end\n end", "def show\n @store = Store.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @store }\n end\n end", "def show\n @store = Store.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @store }\n end\n end", "def show\n @store = Store.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @store }\n end\n end", "def index\n if current_user.admin?\n @stores = Store.all\n else\n @stores = current_user.stores\n end\n\n render json: @stores\n end", "def show\n @data_store = DataStore.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @data_store }\n end\n end", "def show\n @drug = Drug.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @drug }\n end\n end", "def show\n render json: @shop\n end", "def show\n @store = Store.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @store }\n end\n end", "def index\n @stores = @commerce.stores\n end", "def show\n @store = Store.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @store }\n end\n end", "def show\n json_response(@api_v1_store)\n end", "def show\n @datastore = Datastore.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @datastore }\n end\n end", "def show\n \n @shop = Shop.find(params[:id])\n @json = @shop.to_gmaps4rails\n \n @reviews = Review.where(:shop_id => params[:id] )\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @shop }\n end\n end", "def set_drug_store\n @drug_store = DrugStore.find(params[:id])\n end", "def index\n @bands = Band.all \n\t@tags = Store.find_by_sql(\"select DISTINCT tag from stores\")\n\t@stores = Store.find(:all, :order => \"created_at desc\")\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @stores }\n end\n end", "def index\n @stores = @stores.page(params[:page]).per(10)\n end", "def index\n @shop = Shop.find(1)\n render :json => @shop\n return\n end", "def show\n\t\t\t\t @store = Spree::Store.find(params[:id])\n\t\t\t\t respond_to do |format|\n\t\t\t\t format.html # show.html.erb\n\t\t\t\t format.json { render json: @store }\n\t\t\t\t end\n\t\t\t\t end", "def list_stores\n @stores = Store.where(\"level = ?\", 2)\n if @stores.present?\n render :index, status: :ok\n else\n @message = \"no store found\"\n render :error, status: :not_found\n end\n end", "def show\n @ski = Ski.find(params[:id])\n\n @inventory = Inventory.where(:ski_id => params[:id])\n\n @image = Image.where(:ski_id => params[:id])\n\n @spec = Spec.where(:ski_id => params[:id])\n\n @stores_array = [] \n @inventory.each do |inventory|\n if !@stores_array.include? inventory.store \n @stores_array.push inventory.store\n end\n end\n\n @images = Image.where(:ski_id => params[:id])\n\n @reviews = Review.where(:ski_id => params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ski }\n end\n end", "def index\n @stores = Store.all\n end", "def index\n @stores = Store.all\n end", "def index\n @stores = Store.all\n end", "def index\n @stores = Store.all\n end", "def index\n @stores = Store.all\n end", "def index\n @drug_store_branches = @drug_store.drug_store_branches\n end", "def index\n @stores = Store.all\n prepFormVariables\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @stores }\n end\n end", "def show\n @admin_store = Admin::Store.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_store }\n end\n end", "def json_stores\n @_json_stores ||= doc.xpath(\"/html/body/script[@class='tiddlywiki-tiddler-store']\")\n end", "def index\n @dish_features = @store.dish_features.includes(:store)\n end", "def index\n @drugs = Drug.all\n # @permitted_drugs = Drug.permitted.alphabetical.all\n # @prohibited_drugs = Drug.prohibited.alphabetical.all\n # @restricted_drugs = Drug.restricted.alphabetical.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @drugs }\n end\n end", "def index\n\n get_collections\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @deities }\n format.js {}\n end\n end", "def shops\n render :nothing => true and return if params[:id].nil?\n \n if ( params[:meta] == 'tattoos' )\n @shop = Shop.find(params[:id], :include => :tattoos)\n render :json => @shop.tattoos.to_json(:include => { :assets => { :only => [:id, :data_file_name] } })\n return\n end\n \n @shop = Shop.find(params[:id])\n render :json => @shop.to_json(:include => :assets)\n end", "def index\n @store = Store.find(params[:store_id])\n @menus = @store.menus\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @menus }\n end\n end", "def user_stores_get_all_stores user_id, page: nil, per_page: nil\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/{user_id}/stores\"\n\n # process optional query parameters\n query_builder = APIHelper.append_url_with_template_parameters query_builder, {\n \"user_id\" => user_id,\n }\n\n # process optional query parameters\n query_builder = APIHelper.append_url_with_query_parameters query_builder, {\n \"page\" => page,\n \"per_page\" => per_page,\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.get query_url, headers:headers\n\n # Error handling using HTTP status codes\n if response.code == 401\n raise APIException.new \"Unauthorized\", 401, response.raw_body\n elsif response.code == 404\n raise APIException.new \"Not Found\", 404, 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 index\n render json: Seller.all\n end", "def dresses\n render json: { collections: Collection.published_dresses }\n end", "def index\n @stores = @stores.full_text_search(params[:search]).with_pg_search_rank if params[:search].present?\n @stores = @stores.by_state(params[:state]) if params[:state].present?\n @stores = @stores.by_type(params[:type]) if params[:type].present?\n @stores = @stores.where(latitude: nil).or(Store.where(longitude: nil)) if params[:no_info]\n\n @stores = @stores.order(:name)\n\n respond_to do |format|\n format.html do\n @stores = @stores.page(params[:page])\n end\n format.json do\n @stores = @stores.limit(50)\n end\n format.csv do\n send_data @stores.to_csv, type: 'csv', filename: 'pins-export.csv'\n end\n end\n end", "def show\n @stores_report = Stores::Report.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stores_report }\n end\n end", "def show\n render json: @sale\n end", "def show\n #show each sexes items instead \n render json: @sex.items.to_json(include: [:store,:sex])\n end", "def index\n @stores = current_account.stores.find(:all)\t\n end", "def show\n @store = Store.find(params[:store_id])\n @dish_choice = @store.dish_choices.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dish_choice }\n end\n end", "def index\n @service_locations = ServiceLocation.all\n render json: @service_locations\n end", "def user_stores_get_single_store user_id, 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/{user_id}/stores/{id}\"\n\n # process optional query parameters\n query_builder = APIHelper.append_url_with_template_parameters query_builder, {\n \"user_id\" => user_id,\n \"id\" => id,\n }\n\n # process optional query parameters\n query_builder = APIHelper.append_url_with_query_parameters query_builder, {\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.get query_url, headers:headers\n\n # Error handling using HTTP status codes\n if response.code == 401\n raise APIException.new \"Unauthorized\", 401, response.raw_body\n elsif response.code == 404\n raise APIException.new \"Not Found\", 404, 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 show\n @created_stores = @user.created_stores.search(params[:search])\n @created_stores = @created_stores.by_state(params[:state]) if params[:state].present?\n @created_stores = @created_stores.by_type(params[:type]) if params[:type].present?\n @created_stores = @created_stores.order(:name).page(params[:page])\n end", "def index\n\t\t@stores = Store.all\n\tend", "def index\n\t\tbegin\n\t\t\tif params[:lat].present? && params[:lng].present?\n\t\t\t\t@address = Geokit::Geocoders::GoogleGeocoder.reverse_geocode \"#{params[:lat]},#{params[:lng]}\"\n\t\t\t\tparams[:postal_code] = @address.try(:zip) if @address.success\n\t\t\tend\n\t\t\t@search = Store.search do\n\t\t\t\tfulltext(params[:postal_code]) do\n\t\t\t\t\tfields(:postal_code)\n\t\t\t\tend\n\t\t\tend\n\t\t\tif @address.present?\n\t\t\t\t@stores = @search.results.sort_by{|s| s.distance_to([@address.lat,@address.lng])}\n\t\t\telse\n\t\t\t\t@stores = @search.results\n\t\t\tend\n\t\t\t\t@postal_code = params[:postal_code]\n\t\t\t\t@stores =\t@stores.first(5) if params[:type] == \"collection\"\n\t\t\trender :index, status: :ok\n\t\trescue Exception => e\n\t\t\terror_handling_bad_request(e)\n\t\tend\n\tend", "def index\n @supplysites = Supplysite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @supplysites }\n end\n end", "def index\n @sales = Sale.all\n\n render json: @sales\n end", "def index\n @online_stores = OnlineStore.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @online_stores }\n end\n end", "def index\n reviews = Review.all\n render json: reviews\n end", "def index\n reviews = Review.all\n render json: reviews\n end", "def index\n info = Aws.get_recipes_from_db\n render :json => info\n end", "def load_store(url)\n auth_by_platform_token!\n response = self.class.get(\"/stores\", { query: { url: url} })\n data = JSON.parse(response.body) rescue nil\n\n {\n status: response.code,\n data: data,\n }\n end", "def create\n @store = Store.new(store_params)\n\n @store.api_path = @store.name unless @store.api_path.present?\n\n # make sure the store can connect to shopify\n # will return 4xx code if shopify login is bad\n # 401 is bad api secret\n # 403 is bad api key\n # 404 implies bad store name\n\n # validate the return code\n adapter = @store.get_adapter\n return_data = adapter.validate_store(@store)\n if return_data[:return_code] != 200\n render json: return_data, :status => return_data[:return_code] and return\n end\n\n current_user.stores << @store\n\n if @store.save\n render json: @store, status: :created\n else\n render json: @store.errors, status: :unprocessable_entity\n end\n end", "def show\n @store = Store.find(params[:id])\n prepFormVariables\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @store }\n end\n end", "def show\n @store_section = StoreSection.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @store_section }\n end\n end", "def index\n\n get_collections\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @temples }\n format.js {}\n end\n end", "def show\n respond_to do |format|\n format.html { render action: 'show' }\n format.json { render json: @shop }\n end\n end", "def show\n render json: @service_location\n end", "def new\n @drug = Drug.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @drug }\n end\n end", "def new\n @datastore = Datastore.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @datastore }\n end\n end", "def index\n @stations = Station.all\n\n render json: @stations\n end", "def show\n render json: @service\n end", "def new\n\t\t\t\t @store = Store.new\n\n\t\t\t\t respond_to do |format|\n\t\t\t\t format.html # new.html.erb\n\t\t\t\t format.json { render json: @store }\n\t\t\t\t end\n\t\t\t\t end", "def view_product\n to_json(\n only: [:id, :title, :description, :key_information],\n methods: [:photo_url, :net_mrp, :mrp_per_unit, :quantity],\n :include => {\n store: {\n only: [:name, :id],\n methods: [:full_address]\n }\n }\n )\n end", "def new\n @data_store = DataStore.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @data_store }\n end\n end", "def index\n @drop_locations = DropLocation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @drop_locations }\n end\n end", "def new\n @store = Store.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @store }\n end\n end", "def new\n @store = Store.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @store }\n end\n end", "def new\n @store = Store.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @store }\n end\n end", "def new\n @store = Store.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @store }\n end\n end", "def new\n @store = Store.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @store }\n end\n end", "def index \n restaurant = Restaurant.all\n render json: restaurant\n end", "def stores\n unless @stores\n page = request(store_url)\n raise StoreRequestError unless page.code == \"200\"\n\n xml = Nokogiri::XML(page.body)\n \n @stores = {}\n \n xml.css('GotoURL SetFontStyle').each do |name_node|\n name = name_node.text\n url = name_node.parent.parent['url']\n store_id = url.match(/storeFrontId=([0-9]+)/)[1] rescue nil\n @stores[name] = store_id if store_id && name\n end\n end\n @stores\n end", "def index\n @q = params[:q]\n @q ||= \"\"\n @shops = Shop.search(@q).records\n\n\n respond_to do |format|\n format.html { render action: 'index' }\n format.json { render json: @shops, each_serializer: ShopListSerializer }\n end\n end", "def show\n response = Aws.list_recipe(params[:id])\n render :json => response\n end", "def index\n @sales = @saleService.all_to_json().as_json;\n end", "def index\n json_response(Spot.all)\n end", "def index\n @stores = Store.by_id\n @categories = Category.all\n\n end", "def shop_url(params)\n @shop = Shop.find(params.id)\n render json: params\n end", "def index\n @stores = Stock.all\n end", "def index\n json_response(Restaurant.all)\n end", "def get_store_items(storeid, item)\n \tresponse = Services::SupermarketClient.new.item_search(storeid, item)\n \tresponse.parsed_response[\"ArrayOfProduct_Commercial\"][\"Product_Commercial\"].each do |item|\n \t\tStoreItem.create(name: item[\"Itemname\"], image: item[\"ItemImage\"], description: item[\"ItemDescription\"], price: item[\"Pricing\"])\n end\n end", "def show\n @store = Store.find(params[:store_id])\n @menu = @store.menus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @menu }\n end\n end", "def index\n @supplemental_details = SupplementalDetail.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @supplemental_details }\n end\n end", "def destroy\n @drug_store.destroy\n respond_to do |format|\n format.html { redirect_to drug_stores_url, notice: 'Drug store was successfully destroyed.' }\n format.json { head :no_content }\n end\n end" ]
[ "0.6709867", "0.65023243", "0.64579064", "0.6446975", "0.64360434", "0.6435191", "0.6431837", "0.6297562", "0.6259508", "0.62141985", "0.6208471", "0.6195126", "0.6195126", "0.6195126", "0.6195126", "0.61933506", "0.61603856", "0.6156894", "0.6149985", "0.6133582", "0.61068344", "0.6104147", "0.6096711", "0.6066552", "0.6059198", "0.6054946", "0.6053103", "0.6029227", "0.5964349", "0.5959121", "0.5944963", "0.5934172", "0.59332967", "0.59332967", "0.59332967", "0.59332967", "0.59332967", "0.59200335", "0.5914349", "0.58444196", "0.5836585", "0.5834094", "0.58338463", "0.5833672", "0.5821287", "0.57836443", "0.57757777", "0.5763145", "0.57628536", "0.57566774", "0.5755791", "0.57474357", "0.57420415", "0.5735784", "0.5730569", "0.57226396", "0.57200116", "0.57142913", "0.5706926", "0.5694595", "0.56832916", "0.568259", "0.5681716", "0.5668978", "0.5668978", "0.566141", "0.5658119", "0.5638483", "0.5637255", "0.563099", "0.5617914", "0.56137925", "0.56137025", "0.5612724", "0.56125575", "0.5604909", "0.55993474", "0.55992156", "0.5596445", "0.5596306", "0.5591256", "0.5587014", "0.5587014", "0.5587014", "0.5587014", "0.5587014", "0.558622", "0.5584907", "0.5582892", "0.5573321", "0.5572977", "0.55646425", "0.5561448", "0.5560804", "0.55514914", "0.55509746", "0.5538574", "0.5535646", "0.5528868", "0.5523867" ]
0.7264478
0
GET /drug_stores/1 GET /drug_stores/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @drug_stores = DrugStore.all\n end", "def index\n @store = Store.find(params[:store_id])\n @dish_discounts = @store.dish_discounts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dish_discounts }\n end\n end", "def index\n @api_v1_stores = Store.all\n json_response(@api_v1_stores)\n end", "def show\n render json: @store\n end", "def show\n @store = Store.find(params[:store_id])\n @dish_discount = @store.dish_discounts.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dish_discount }\n end\n end", "def index\n @stores = Store.all\n render json: @stores\n end", "def show\n @drug = Drug.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @drug }\n end\n end", "def show\n render json: @store\n end", "def show\n @data_store = DataStore.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @data_store }\n end\n end", "def show\n @store = Store.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @store }\n end\n end", "def show\n @store = Store.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @store }\n end\n end", "def show\n @store = Store.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @store }\n end\n end", "def show\n @store = Store.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @store }\n end\n end", "def show\n respond_to do |format|\n format.html do\n gon.stores = [\"AppEstablishmentStore\"] \n gon.jbuilder \n end\n\n format.json { render :show }\n end \n end", "def show\n json_response(@api_v1_store)\n end", "def show\n @store = Store.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @store }\n end\n end", "def create\n @drug_store = DrugStore.new(drug_store_params)\n\n respond_to do |format|\n if @drug_store.save\n format.html { redirect_to @drug_store, notice: 'Drug store was successfully created.' }\n format.json { render :show, status: :created, location: @drug_store }\n else\n format.html { render :new }\n format.json { render json: @drug_store.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @datastore = Datastore.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @datastore }\n end\n end", "def show\n @store = Store.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @store }\n end\n end", "def index\n @stores = Store.all.includes(:admin)\n\n respond_to do |format|\n format.html\n format.json\n end\n end", "def index\n @store = Store.find(params[:store_id])\n @dish_choices = @store.dish_choices\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dish_choices }\n end\n end", "def set_drug_store\n @drug_store = DrugStore.find(params[:id])\n end", "def index\n @admin_stores = Admin::Store.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_stores }\n end\n end", "def show\n render json: @shop\n end", "def index\n @shop = Shop.find(1)\n render :json => @shop\n return\n end", "def show\n\t\t\t\t @store = Spree::Store.find(params[:id])\n\t\t\t\t respond_to do |format|\n\t\t\t\t format.html # show.html.erb\n\t\t\t\t format.json { render json: @store }\n\t\t\t\t end\n\t\t\t\t end", "def show\n @admin_store = Admin::Store.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_store }\n end\n end", "def index\n @bands = Band.all \n\t@tags = Store.find_by_sql(\"select DISTINCT tag from stores\")\n\t@stores = Store.find(:all, :order => \"created_at desc\")\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @stores }\n end\n end", "def show\n \n @shop = Shop.find(params[:id])\n @json = @shop.to_gmaps4rails\n \n @reviews = Review.where(:shop_id => params[:id] )\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @shop }\n end\n end", "def user_stores_get_single_store user_id, 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/{user_id}/stores/{id}\"\n\n # process optional query parameters\n query_builder = APIHelper.append_url_with_template_parameters query_builder, {\n \"user_id\" => user_id,\n \"id\" => id,\n }\n\n # process optional query parameters\n query_builder = APIHelper.append_url_with_query_parameters query_builder, {\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.get query_url, headers:headers\n\n # Error handling using HTTP status codes\n if response.code == 401\n raise APIException.new \"Unauthorized\", 401, response.raw_body\n elsif response.code == 404\n raise APIException.new \"Not Found\", 404, 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 show\n @store = Store.find(params[:store_id])\n @dish_choice = @store.dish_choices.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dish_choice }\n end\n end", "def new\n @drug = Drug.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @drug }\n end\n end", "def new\n @datastore = Datastore.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @datastore }\n end\n end", "def show\n @stores_report = Stores::Report.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stores_report }\n end\n end", "def new\n @data_store = DataStore.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @data_store }\n end\n end", "def index\n if current_user.admin?\n @stores = Store.all\n else\n @stores = current_user.stores\n end\n\n render json: @stores\n end", "def show\n response = Aws.list_recipe(params[:id])\n render :json => response\n end", "def new\n @store = Store.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @store }\n end\n end", "def new\n @store = Store.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @store }\n end\n end", "def new\n @store = Store.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @store }\n end\n end", "def new\n @store = Store.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @store }\n end\n end", "def new\n @store = Store.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @store }\n end\n end", "def new\n\t\t\t\t @store = Store.new\n\n\t\t\t\t respond_to do |format|\n\t\t\t\t format.html # new.html.erb\n\t\t\t\t format.json { render json: @store }\n\t\t\t\t end\n\t\t\t\t end", "def show\n @ski = Ski.find(params[:id])\n\n @inventory = Inventory.where(:ski_id => params[:id])\n\n @image = Image.where(:ski_id => params[:id])\n\n @spec = Spec.where(:ski_id => params[:id])\n\n @stores_array = [] \n @inventory.each do |inventory|\n if !@stores_array.include? inventory.store \n @stores_array.push inventory.store\n end\n end\n\n @images = Image.where(:ski_id => params[:id])\n\n @reviews = Review.where(:ski_id => params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ski }\n end\n end", "def index\n info = Aws.get_recipes_from_db\n render :json => info\n end", "def show\n @store = Store.find(params[:id])\n prepFormVariables\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @store }\n end\n end", "def index\n @stores = @stores.page(params[:page]).per(10)\n end", "def index\n @stores = @commerce.stores\n end", "def index\n @stores = Store.all\n prepFormVariables\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @stores }\n end\n end", "def show\n @store_section = StoreSection.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @store_section }\n end\n end", "def show\n @grocery = Grocery.find(params[:id])\n\n render json: @grocery\n end", "def index\n @drugs = Drug.all\n # @permitted_drugs = Drug.permitted.alphabetical.all\n # @prohibited_drugs = Drug.prohibited.alphabetical.all\n # @restricted_drugs = Drug.restricted.alphabetical.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @drugs }\n end\n end", "def index\n reviews = Review.all\n render json: reviews\n end", "def index\n reviews = Review.all\n render json: reviews\n end", "def show\n @store2product = Store2product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @store2product }\n end\n end", "def show\n params.require(%i[id])\n render json: Ingredient.find_by!(id: params[:id])\n end", "def shops\n render :nothing => true and return if params[:id].nil?\n \n if ( params[:meta] == 'tattoos' )\n @shop = Shop.find(params[:id], :include => :tattoos)\n render :json => @shop.tattoos.to_json(:include => { :assets => { :only => [:id, :data_file_name] } })\n return\n end\n \n @shop = Shop.find(params[:id])\n render :json => @shop.to_json(:include => :assets)\n end", "def show\n render json: @sale\n end", "def index\n @drug_store_branches = @drug_store.drug_store_branches\n end", "def show\n render json: @service\n end", "def create\n @store = Store.new(store_params)\n\n @store.api_path = @store.name unless @store.api_path.present?\n\n # make sure the store can connect to shopify\n # will return 4xx code if shopify login is bad\n # 401 is bad api secret\n # 403 is bad api key\n # 404 implies bad store name\n\n # validate the return code\n adapter = @store.get_adapter\n return_data = adapter.validate_store(@store)\n if return_data[:return_code] != 200\n render json: return_data, :status => return_data[:return_code] and return\n end\n\n current_user.stores << @store\n\n if @store.save\n render json: @store, status: :created\n else\n render json: @store.errors, status: :unprocessable_entity\n end\n end", "def show\n @gitem = Gitem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gitem }\n end\n end", "def index\n @stores = Store.all\n end", "def index\n @stores = Store.all\n end", "def index\n @stores = Store.all\n end", "def index\n @stores = Store.all\n end", "def index\n @stores = Store.all\n end", "def index\n\n get_collections\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @deities }\n format.js {}\n end\n end", "def show\n respond_to do |format|\n format.html { render action: 'show' }\n format.json { render json: @shop }\n end\n end", "def show\n @dataload_ga = DataloadGa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dataload_ga }\n end\n end", "def new\n @store = Store.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @store }\n end\n end", "def index \n restaurant = Restaurant.all\n render json: restaurant\n end", "def new\n @store = Store.find(params[:store_id])\n @dish_discount = @store.dish_discounts.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dish_discount }\n end\n end", "def index\n base_url = 'https://www.googleapis.com/books/v1/volumes?q=fiction&maxResults=20'\n and_key = '&key='\n key = ENV['GOOGLE_BOOKS_API_KEY'] \n googleurl = base_url + and_key + key\n\n response = RestClient.get(googleurl)\n @books = JSON.parse(response)\n\n respond_to do |format|\n format.html\n format.json { render json: @books }\n end\n\nend", "def index\n render json: Seller.all\n end", "def index\n @store = Store.find(params[:store_id])\n @menus = @store.menus\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @menus }\n end\n end", "def index\n @supplemental_details = SupplementalDetail.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @supplemental_details }\n end\n end", "def show\n render json: @recipe\n end", "def show\n #show each sexes items instead \n render json: @sex.items.to_json(include: [:store,:sex])\n end", "def index\n @dish_features = @store.dish_features.includes(:store)\n end", "def shop_url(params)\n @shop = Shop.find(params.id)\n render json: params\n end", "def drink\n @drinks = Item.select {|k,v| k.product_type_id == 4 }\n \n respond_to do |format|\n #format.html # index.html.erb\n format.json { render json: @drinks, :only => [:id, :name, :description, :price, :time], :include => {:product_type => { :only => [:id, :name]}}}\n end\n end", "def view_product\n to_json(\n only: [:id, :title, :description, :key_information],\n methods: [:photo_url, :net_mrp, :mrp_per_unit, :quantity],\n :include => {\n store: {\n only: [:name, :id],\n methods: [:full_address]\n }\n }\n )\n end", "def new\n @drug_test = DrugTest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @drug_test }\n end\n end", "def destroy\n @drug_store.destroy\n respond_to do |format|\n format.html { redirect_to drug_stores_url, notice: 'Drug store was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def show\n render json: @food_product\n end", "def show\n @gpath = Gpath.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gpath }\n end\n end", "def show\n recipe = Recipe.find(params[:id])\n # recipes = Recipe.find_by(params[:id])\n # render json: recipe\n render json: recipe\n end", "def show\n @shop = Wmall::Shop.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shop }\n end\n end", "def show\n render json: @service_location\n end", "def index\n render json: Album.find(params[:album_id]).reviews\n end", "def show\n @d_sale_item = DSaleItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @d_sale_item }\n end\n end", "def show\n @galeria = Galeria.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @galeria }\n end\n end", "def index\n\n get_collections\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @temples }\n format.js {}\n end\n end", "def show\n @client = Client.find(params[:id])\n @pets = @client.pets\n @json = @client.to_gmaps4rails\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end", "def load_store(url)\n auth_by_platform_token!\n response = self.class.get(\"/stores\", { query: { url: url} })\n data = JSON.parse(response.body) rescue nil\n\n {\n status: response.code,\n data: data,\n }\n end", "def index\n @supplysites = Supplysite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @supplysites }\n end\n end", "def show\n @store = Store.find(params[:store_id])\n @menu = @store.menus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @menu }\n end\n end", "def new\n @admin_store = Admin::Store.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_store }\n end\n end", "def show\n @data = @recipe.read(params[:id])\n render json: @data\n end", "def index\n @online_stores = OnlineStore.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @online_stores }\n end\n end" ]
[ "0.7030095", "0.65447104", "0.6540039", "0.6510994", "0.65091765", "0.6461106", "0.6447425", "0.6432432", "0.64111364", "0.6401272", "0.6401272", "0.6401272", "0.6401272", "0.6386951", "0.63640505", "0.6341184", "0.6339917", "0.63063395", "0.6279408", "0.6266929", "0.6247279", "0.6151383", "0.6136261", "0.6120204", "0.606502", "0.6031513", "0.6019759", "0.6003517", "0.59997016", "0.59898925", "0.5983198", "0.59744424", "0.59403515", "0.5914834", "0.59083354", "0.5880149", "0.58755285", "0.5871925", "0.5871925", "0.5871925", "0.5871925", "0.5871925", "0.58654374", "0.5858569", "0.5822042", "0.58194834", "0.5811311", "0.58093035", "0.5785224", "0.57735336", "0.5764087", "0.575046", "0.5749277", "0.5749277", "0.57344407", "0.5731822", "0.5730031", "0.5721594", "0.5719968", "0.5711442", "0.5710665", "0.5706468", "0.57052", "0.57052", "0.57052", "0.57052", "0.57052", "0.5685925", "0.5674993", "0.5673827", "0.5669513", "0.56586707", "0.5655794", "0.56552196", "0.5640125", "0.5638162", "0.56344676", "0.5630686", "0.56274176", "0.56179416", "0.5612397", "0.5608562", "0.5605942", "0.5604824", "0.5588252", "0.55873686", "0.5582331", "0.55799705", "0.55664283", "0.5565331", "0.55650425", "0.55636925", "0.5561379", "0.5561158", "0.5560218", "0.5557659", "0.55489254", "0.5547353", "0.5546782", "0.5545746", "0.5542449" ]
0.0
-1
POST /drug_stores POST /drug_stores.json
def create @drug_store = DrugStore.new(drug_store_params) respond_to do |format| if @drug_store.save format.html { redirect_to @drug_store, notice: 'Drug store was successfully created.' } format.json { render :show, status: :created, location: @drug_store } else format.html { render :new } format.json { render json: @drug_store.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(add_params = nil)\n params = {\n }\n api_call('/stores(.:format)',:post,params,add_params)\n end", "def create\n @store = Store.new(params.require(:store).permit(:break_even, :capacity, :city, :county_id, :manager_id,\n :name, :number, :number_of_lifts, :phone, :region_id,\n :state_id, :street_address, :zip))\n\n respond_to do |format|\n if @store.save\n format.html { redirect_to stores_url,\n notice: 'Store was successfully created.' }\n format.json { render json: @store, status: :created, location: @store }\n else\n prepFormVariables\n format.html { render action: \"new\" }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @store_add = StoreAdd.new(store_add_params)\n\n respond_to do |format|\n if @store_add.save\n format.html { redirect_to @store_add, notice: 'Store add was successfully created.' }\n format.json { render :show, status: :created, location: @store_add }\n else\n format.html { render :new }\n format.json { render json: @store_add.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @store = Store.new(params[:store])\n\n respond_to do |format|\n if @store.save\n format.html { redirect_to '/stores/admin', notice: 'Store was successfully created.' }\n format.json { render json: @store, status: :created, location: @store }\n else\n format.html { render action: \"new\" }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @store = Store.new(store_params)\n\n respond_to do |format|\n if @store.save\n format.html { redirect_to admin_partners_stores_url, notice: 'Store was successfully created.' }\n format.json { render action: 'show', status: :created, location: @store }\n else\n format.html { render action: 'new' }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @store = Store.new(params[:store])\n \n respond_to do |format|\n if @store.save\n format.html { redirect_to @store, notice: 'Store was successfully created.' }\n format.json { render json: @store, status: :created, location: @store }\n else\n format.html { render action: \"new\" }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def drug_store_params\n params.require(:drug_store).permit(:name, :email, :web_page_url, :logo_img_url)\n end", "def create\n @drug_store_branch = @drug_store.drug_store_branches.new(drug_store_branch_params)\n\n respond_to do |format|\n if @drug_store_branch.save\n format.html { redirect_to [@drug_store, @drug_store_branch], notice: 'Drug store branch was successfully created.' }\n format.json { render :show, status: :created, location: [@drug_store, @drug_store_branch] }\n else\n format.html { render :new }\n format.json { render json: @drug_store_branch.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @store = Store.new(params[:store])\n\n respond_to do |format|\n if @store.save\n format.html { redirect_to @store, :notice => 'Store was successfully created.' }\n format.json { render :json => @store, :status => :created, :location => @store }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @store.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @store = Store.new(params[:store])\n\n respond_to do |format|\n if @store.save\n format.html { redirect_to @store, notice: 'Store was successfully created.' }\n format.json { render json: @store, status: :created, location: @store }\n else\n format.html { render action: \"new\" }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @store = Store.new(params[:store])\n\n respond_to do |format|\n if @store.save\n format.html { redirect_to \"/admin/stores/\"+@store.id.to_s(), notice: 'Store was successfully created.' }\n format.json { render json: @store, status: :created, location: @store }\n else\n format.html { render action: \"new\" }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @store = Store.new(store_params)\n\n respond_to do |format|\n if @store.save\n format.html { redirect_to @store, notice: 'Store was successfully created.' }\n format.json { render :show, status: :created, location: @store }\n else\n format.html { render :new }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @store = Store.new(store_params)\n\n respond_to do |format|\n if @store.save\n format.html { redirect_to @store, notice: 'Store was successfully created.' }\n format.json { render :show, status: :created, location: @store }\n else\n format.html { render :new }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @store = Store.new(store_params)\n\n @store.api_path = @store.name unless @store.api_path.present?\n\n # make sure the store can connect to shopify\n # will return 4xx code if shopify login is bad\n # 401 is bad api secret\n # 403 is bad api key\n # 404 implies bad store name\n\n # validate the return code\n adapter = @store.get_adapter\n return_data = adapter.validate_store(@store)\n if return_data[:return_code] != 200\n render json: return_data, :status => return_data[:return_code] and return\n end\n\n current_user.stores << @store\n\n if @store.save\n render json: @store, status: :created\n else\n render json: @store.errors, status: :unprocessable_entity\n end\n end", "def create\n\t\t\t\t @store = Store.new(params[:store])\n\n\t\t\t\t respond_to do |format|\n\t\t\t\t if @store.save\n\t\t\t\t\tformat.html { redirect_to @store, notice: 'Store was successfully created.' }\n\t\t\t\t\tformat.json { render json: @store, status: :created, location: @store }\n\t\t\t\t else\n\t\t\t\t\tformat.html { render action: \"new\" }\n\t\t\t\t\tformat.json { render json: @store.errors, status: :unprocessable_entity }\n\t\t\t\t end\n\t\t\t\t end\n\t\t\t\t end", "def create\n @store = Store.new(store_params)\n\n respond_to do |format|\n if @store.save\n format.html { redirect_to @store, notice: 'Store was successfully created.' }\n format.json { render action: 'show', status: :created, location: @store }\n else\n format.html { render action: 'new' }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @store = Store.new(store_params)\n\n respond_to do |format|\n if @store.save\n format.html { redirect_to @store, notice: \"Loja cadastrada com sucesso!\" }\n format.json { render :show, status: :created, location: @store }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @product = Product.new(product_params)\n\n if params[:product][:store_ids].present?\n params[:product][:store_ids].each do |store_id|\n unless store_id.empty?\n store = Store.find(store_id)\n @product.stores << store\n end\n end\n end\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, notice: \"Product was successfully created.\" }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @drug = Drug.new(params[:drug])\n\n respond_to do |format|\n if @drug.save\n format.html { redirect_to @drug, notice: 'Drug was successfully created.' }\n format.json { render json: @drug, status: :created, location: @drug }\n else\n format.html { render action: \"new\" }\n format.json { render json: @drug.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @store = Store.new(store_params)\n\n respond_to do |format|\n if @store.save\n format.html { redirect_to @store, notice: 'Store was successfully created.' }\n params[:books].each{\n |id|\n StoreBook.create(:store_id=>@store.id,:book_id=>id)\n }\n format.json { render :show, status: :created, location: @store }\n else\n format.html { render :new }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @datastore = Datastore.new(params[:datastore])\n\n respond_to do |format|\n if @datastore.save\n format.html { redirect_to @datastore, notice: 'Datastore was successfully created.' }\n format.json { render json: @datastore, status: :created, location: @datastore }\n else\n format.html { render action: \"new\" }\n format.json { render json: @datastore.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_drug_store\n @drug_store = DrugStore.find(params[:id])\n end", "def index\n @drug_stores = DrugStore.all\n end", "def create\n @store = Store.new(store_params)\n\n respond_to do |format|\n if @store.save\n format.html { redirect_to account_stores_path(account_id: current_account.id), notice: 'Store was successfully created.' }\n format.json { render action: 'show', status: :created, location: @store }\n else\n format.html { render action: 'new' }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n params[:bubble_tea][:store_id] = params[:id] unless params[:bubble_tea][:store_id].present?\n @bubble_tea = BubbleTea.new(bubble_tea_params)\n\n if @bubble_tea.save\n # successful bubble tea drink creation\n render json: @bubble_tea\n else\n render plain: \"Failed to save drink.\"\n end\n end", "def create\n @store_to_visit = StoreToVisit.new(store_to_visit_params)\n\n respond_to do |format|\n if @store_to_visit.save\n format.html { redirect_to root_path, notice: 'Store to visit was successfully created.' }\n format.json { render :show, status: :created, location: @store_to_visit }\n else\n format.html { render :new }\n format.json { render json: @store_to_visit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @admin_store = Admin::Store.new(params[:admin_store])\n\n respond_to do |format|\n if @admin_store.save\n format.html { redirect_to @admin_store, notice: 'Store was successfully created.' }\n format.json { render json: @admin_store, status: :created, location: @admin_store }\n else\n format.html { render action: \"new\" }\n format.json { render json: @admin_store.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n post_params = {\n name: params[:name].downcase,\n units: params[:units] || 0\n }\n render json: Ingredient.create!(post_params), status: :created\n end", "def create\n @store = Store.new(store_params)\n @store.commerce = @commerce\n @seller = Seller.new\n respond_to do |format|\n if @store.save\n @seller.store=@store\n @seller.commerce = @commerce\n @seller.user_id=current_user.id\n @seller.slug=current_user.cedula\n puts \"DATOS DE VENDEDOR *******\"\n puts @seller.to_json\n @seller.save\n format.html { redirect_to owner_commerce_stores_path(@store.commerce.slug), notice: 'Tienda creada exitosamente.' }\n format.json { render :show, status: :created, location: @store }\n else\n format.html { render :new }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @itemstore = ItemStore.new(item_store_params)\n\n respond_to do |format|\n if @itemstore.save\n format.html { redirect_to @itemstore, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @itemstore }\n else\n format.html { render :new }\n format.json { render json: @itemstore.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @data_source = DataSource.find(params[:data_source_id])\n\n @data_store = @data_source.data_stores.create(params[:data_store])\n\n redirect_to data_source_path(@data_source)\n end", "def create\n @store = Store.find(params[:store_id])\n @dish_discount = @store.dish_discounts.create(params[:dish_discount])\n\n respond_to do |format|\n if @dish_discount.save\n format.html { redirect_to store_dish_discounts_url(@store), notice: 'Dish discount was successfully created.' }\n format.json { render json: @dish_discount, status: :created, location: @dish_discount }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dish_discount.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @cakestore = Cakestore.new(cakestore_params)\n\n respond_to do |format|\n if @cakestore.save\n format.html { redirect_to @cakestore, notice: 'Cakestore was successfully created.' }\n format.json { render :show, status: :created, location: @cakestore }\n else\n format.html { render :new }\n format.json { render json: @cakestore.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @admin_store = current_user.stores.build(admin_store_params)\n respond_to do |format|\n if @admin_store.save\n format.html { redirect_to admin_store_path(@admin_store), notice: 'Store was successfully created.' }\n format.json { render :show, status: :created, location: @admin_store }\n else\n format.html { render :new }\n format.json { render json: @admin_store.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @storepromotion = Storepromotion.new(storepromotion_params)\n\n respond_to do |format|\n if @storepromotion.save\n format.html { redirect_to @storepromotion, notice: 'Storepromotion was successfully created.' }\n format.json { render :show, status: :created, location: @storepromotion }\n else\n format.html { render :new }\n format.json { render json: @storepromotion.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @mstore = Mstore.new(mstore_params)\n\n respond_to do |format|\n if @mstore.save\n format.html { redirect_to @mstore, notice: 'Mstore was successfully created.' }\n format.json { render :show, status: :created, location: @mstore }\n else\n format.html { render :new }\n format.json { render json: @mstore.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @store = Store.new(store_params)\n @store.user = current_user\n respond_to do |format|\n if @store.save\n format.html { redirect_to @store, notice: 'Store was successfully created.' }\n format.json { render :show, status: :created, location: @store }\n else\n format.html { render :new }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @drugmaster = Drugmaster.new(drugmaster_params)\n\n respond_to do |format|\n if @drugmaster.save\n format.html { redirect_to @drugmaster, notice: 'Drugmaster was successfully created.' }\n format.json { render :show, status: :created, location: @drugmaster }\n else\n format.html { render :new }\n format.json { render json: @drugmaster.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @store = Store.new(store_params)\n\n respond_to do |format|\n if @store.save\n format.html { redirect_to [:phone, @store], notice: 'Store was successfully created.' }\n format.json { render action: 'show', status: :created, location: @store }\n else\n format.html { render action: 'new' }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @article = Article.new(params[:article])\n if !params[:stores].nil?\n # prevent assignment of empty element to stores reference\n params[:stores].delete_if { |x| x == \"\"}\n end\n \n if @article.price.nil?\n # user don't know the price of the article yet\n @article.price = 0\n end\n \n respond_to do |format|\n if @article.save\n if !params[:stores].nil?\n @stores = Store.find(params[:stores])\n @stores.each { |s|\n @article.stores << s\n }\n end\n \n format.html { redirect_to articles_path, notice: 'Article was successfully created.' }\n format.json { render json: @article, status: :created, location: @article }\n else\n format.html { render action: \"new\" }\n format.json { render json: @article.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @electronics_store = ElectronicsStore.new(electronics_store_params)\n\n respond_to do |format|\n if @electronics_store.save\n format.html { redirect_to @electronics_store, notice: 'Electronics store was successfully created.' }\n format.json { render :show, status: :created, location: @electronics_store }\n else\n format.html { render :new }\n format.json { render json: @electronics_store.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @store = Store.new(params[:store])\n\n respond_to do |format|\n if @store.save\n format.html { redirect_to(@store, :notice => 'Store was successfully created.') }\n format.xml { render :xml => @store, :status => :created, :location => @store }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @store.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @sale = Sale.new(sale_params)\n\n if @sale.save\n render json: @sale, status: :created, location: @sale\n else\n render json: @sale.errors, status: :unprocessable_entity\n end\n end", "def create\n @book_store = BookStore.new(book_store_params)\n\n respond_to do |format|\n if @book_store.save\n format.html { redirect_to @book_store, notice: 'Book store was successfully created.' }\n format.json { render :show, status: :created, location: @book_store }\n else\n format.html { render :new }\n format.json { render json: @book_store.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @shop = Shop.new(shop_params)\n\n if @shop.save\n render :show, status: :created, location: @shop\n else\n render json: @shop.errors, status: :unprocessable_entity\n end\n end", "def store_params\n params.require(:store).permit(:nombre, :direccion, :commerce_id)\n end", "def create\n @promo = Promo.new(params[:promo])\n brand = @promo.brand\n @promo.stores = brand.stores\n respond_to do |format|\n if @promo.save\n format.html { redirect_to @promo, notice: 'Promo was successfully created.' }\n format.json { render json: @promo, status: :created, location: @promo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @promo.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @shop = Shop.new(shop_params)\n @shopkeeper = current_user.shopkeeper\n @shop.shopkeeper_id = @shopkeeper.id\n\n if @shop.save\n render json: @shop, status: :created, location: @shop\n else\n render json: @shop.errors, status: :unprocessable_entity\n end\n end", "def create\n product_name = competitor_params[:title]\n honestbee_datas = get_honestbee_data (product_name)\n predict_catalog = get_predict_catalog ( product_name )\n save_data_in_postgres (predict_catalog)\n render :json => honestbee_datas\n end", "def create\n @store = Store.new(params[:store])\n @store.user_id = @user.id\n @store.categories = Category.find(params[:category_ids]) if params[:category_ids]\n respond_to do |format|\n if @store.save\n format.html { redirect_to(@store, :notice => 'Store was successfully created.') }\n format.xml { render :xml => @store, :status => :created, :location => @store }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @store.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n begin\n @api_v1_store = Store.create!(api_v1_store_params)\n\n json_response @api_v1_store, :created\n rescue => ex\n json_response({error: ex.message}, :unprocessable_entity)\n end\n end", "def create_store_with_http_info(request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: StoresApi.create_store ...\"\n end\n # verify the required parameter 'request' is set\n fail ArgumentError, \"Missing the required parameter 'request' when calling StoresApi.create_store\" if request.nil?\n # resource path\n local_var_path = \"/v2/user/customer/stores\".sub('{format}','json')\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'])\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 = @api_client.object_to_http_body(request)\n auth_names = ['api_key']\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 => 'LinksGetStoresLink')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: StoresApi#create_store\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @drug_test = DrugTest.new(params[:drug_test])\n @test_types = params[:test_types]\n @test_types_all = []\n @test_types.each do |id| \n @test_types_all +=[TestType.find_by_id(id)]\n end\n @drug_test.test_types=@test_types_all\n respond_to do |format|\n \n if @drug_test.save\n format.html { redirect_to @drug_test, notice: 'Teste de droga foi criado com sucesso.' }\n format.json { render json: @drug_test, status: :created, location: @drug_test }\n else\n format.html { render action: \"new\" }\n format.json { render json: @drug_test.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @drug = Drug.new(params[:drug])\n\n respond_to do |format|\n if @drug.save\n format.html { redirect_to(@drug, :notice => 'Drug was successfully created.') }\n format.xml { render :xml => @drug, :status => :created, :location => @drug }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @drug.errors, :status => :unprocessable_entity }\n end\n end\n end", "def drug_store_branch_params\n params.require(:drug_store_branch).permit(:drug_store_id, :name, :address, :latitude, :longitude)\n end", "def create\n @location = Location.find(params[:location_id])\n @shelf = @location.shelves.new\n respond_to do |format|\n if @shelf.save\n format.html { redirect_to @location, notice: 'Shelf added.' }\n format.js { render js: \"thot.increase_counter('#shc_#{@location.id}');\" }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lab.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @workshop = Workshop.new(workshop_params)\n puts \"====================================\"\n puts params['trainers']\n puts \"====================================\"\n trainers = params['trainers'].map do |id|\n Trainer.find(id)\n end\n @workshop.trainers << trainers\n\n\n respond_to do |format|\n if @workshop.save\n format.html { redirect_to @workshop, notice: 'Workshop was successfully created.' }\n format.json { render :show, status: :created, location: @workshop }\n else\n format.html { render :new }\n format.json { render json: @workshop.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n plant = Plant.create(plant_params)\n render json: plant, status: :created\n end", "def create\n @sets_and_rep = SetsAndRep.new(sets_and_rep_params)\n\n respond_to do |format|\n if @sets_and_rep.save\n format.html { redirect_to @sets_and_rep, notice: 'Sets and rep was successfully created.' }\n format.json { render :show, status: :created, location: @sets_and_rep }\n else\n format.html { render :new }\n format.json { render json: @sets_and_rep.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n render json: Beverage.create!(beverage_post_params), status: :created\n end", "def create\n\n # merge the raw post data into the params\n params.merge!(Rack::Utils.parse_nested_query(request.raw_post))\n\n url = params[:australia_post_api_connection][:shop]\n\n #try to find the shop preference using url\n preference = Preference.find_by_shop_url!(url)\n\n # recalculate the weight to include blanks\n calculated_weight = params[:australia_post_api_connection][:blanks].to_i * preference.default_weight.to_f\n calculated_weight += params[:australia_post_api_connection][:weight].to_f\n\n items = params[:australia_post_api_connection][:items]\n \n if (preference.offers_flat_rate)\n if (calculated_weight <= preference.under_weight)\n @service_list = Array.new\n @service_list.append({ name: \"Shipping\",\n code: \"Shipping\",\n price: preference.flat_rate.to_s}) \n respond_to do |format| \n format.js { render content_type: 'text/html', layout: false }\n format.html { render content_type: 'text/html', layout: false } \n end\n return #evil...\n end\n end\n \n weight = params[:australia_post_api_connection][:weight]\n \n if (preference.free_shipping_by_collection)\n subtract_weight = 0\n \n #get free shipping items weight and subtract total weight.\n item_array = items.split(',')\n \n app_shop = Shop.find_by_url(url)\n \n ShopifyAPI::Session.temp(app_shop.myshopify_domain, app_shop.token) do \n item_array.each do |item|\n variant = ShopifyAPI::VariantWithProduct.find(item) \n p = ShopifyAPI::Product.find(variant.product_id)\n \n p.collections.each do |col|\n fields = col.metafields\n field = fields.find { |f| f.key == 'free_shipping' && f.namespace ='AusPostShipping'}\n unless field.nil?\n subtract_weight += variant.grams if field.value == \"true\" \n end\n end\n \n p.smart_collections.each do |col|\n fields = col.metafields\n field = fields.find { |f| f.key == 'free_shipping' && f.namespace ='AusPostShipping'}\n unless field.nil?\n subtract_weight += variant.grams if field.value == \"true\" \n end\n end\n end\n end\n \n \n weight = weight.to_f - subtract_weight/1000\n end\n\n\n if (weight.to_f == 0.0)\n #no need to call australia post. no weight of item\n @service_list = Array.new\n @service_list.append({ name: \"Free Shipping\",\n code: \"Free Shipping\",\n price: \"0.0\"}) \n respond_to do |format| \n format.js { render content_type: 'text/html', layout: false }\n format.html { render content_type: 'text/html', layout: false } \n end\n return\n else \n @australia_post_api_connection = AustraliaPostApiConnection.new({:weight=> weight,\n :blanks => params[:australia_post_api_connection][:blanks],\n :from_postcode => preference.origin_postal_code,\n :country_code => params[:australia_post_api_connection][:country_code],\n :to_postcode => params[:australia_post_api_connection][:to_postcode],\n :height=>preference.height, :width=>preference.width, :length=>preference.length,\n :container_weight => preference.container_weight, :items => items\n })\n end\n \n @australia_post_api_connection.domestic = ( @australia_post_api_connection.country_code == \"AUS\" )\n\n # get country list from the API -- we'll format these if there were no errors\n @service_list = @australia_post_api_connection.data_oriented_methods(:service) # get the service list\n\n if @australia_post_api_connection.domestic\n shipping_methods = preference.shipping_methods_allowed_dom\n shipping_desc = preference.shipping_methods_desc_dom\n else\n shipping_methods = preference.shipping_methods_allowed_int\n shipping_desc = preference.shipping_methods_desc_int\n end\n\n respond_to do |format|\n if @australia_post_api_connection.save\n\n @countries = get_country_list(@australia_post_api_connection)\n # TODO right now we are not including the suboptions for each shipping type\n #filter out unwanted methods more efficiently?\n\n @service_list = Array.wrap( @service_list[1]['service'] ).inject([]) do |list, service|\n Rails.logger.debug(\"service code is \" + service['code'])\n if shipping_methods[service['code']]\n price_to_charge = service['price'].to_f\n shipping_name = shipping_desc[service['code']].blank? ? service['name'] : shipping_desc[service['code']]\n unless preference.nil?\n unless preference.surcharge_percentage.nil?\n if preference.surcharge_percentage > 0.0\n price_to_charge =(price_to_charge * (1 + preference.surcharge_percentage/100)).round(2)\n end\n end\n\n unless preference.surcharge_amount.nil?\n if preference.surcharge_amount > 0.0\n price_to_charge = (price_to_charge + preference.surcharge_amount).round(2)\n end\n end\n end\n\n list.append({ name: shipping_name,\n code: service['code'],\n price: price_to_charge})\n end\n \n list\n end\n\n # check if need to add free shipping option\n if (preference.free_shipping_option)\n @service_list.append({ name: preference.free_shipping_description,\n code: \"Free\",\n price: \"0.00\"})\n end\n format.js { render content_type: 'text/html', layout: false }\n format.html { render content_type: 'text/html', layout: false }\n else // if @australia_post_api_connection.save\n # set the flash\n\n flash.now[:error] = @australia_post_api_connection.api_errors.join(', ')\n # format.html { render action: \"new\" }\n # format.json { render json: @australia_post_api_connection.errors, status: :unprocessable_entity }\n # if (flash.now[:error].blank?)\n # format.html { render :text => \"api_error\" }\n # else\n format.html { render partial: \"trouble\", layout: false }\n # end\n end\n end\n end", "def create\n @store = Store.new(params[:store])\n @mapped_address = Address.find_by_id(params[:address_id])\n \n # if address is not found (nil), nothing was selected by the selectbox\n if @mapped_address.nil? \n # check if user want to assign the store with a new address\n if params[:street] != \"\"\n if params[:zipcode] != \"\"\n if params[:city] != \"\"\n @new_address = Address.new(:city => params[:city], :street => params[:street], :zipcode => params[:zipcode])\n @new_address.save\n @store.addresses << @new_address\n end\n end\n end\n else\n # can assign the selected address to store\n @store.addresses << @mapped_address\n end\n\n respond_to do |format|\n if @store.save\n format.html { redirect_to stores_path, notice: 'Store was successfully created.' }\n format.json { render json: @store, status: :created, location: @store }\n else\n format.html { render action: \"new\" }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def store_params\n params.require(:store).permit(:title, :address, :phone, :latitude, :longtitude)\n end", "def create\n \n @store_detail = StoreDetail.find(params[:store_detail_id])\n @addon = @store_detail.addons.build(params.require(:addon).permit(:addonName, :addonType, :addonSize, :actualPrice, :offerPrice, :quantityAvailable, :hit)) \n # @addon = StoreDetail.find(params[:store_detail_id]).addonDetails.build(params.require(:addon).permit(:addonName, :addonType, :addonSize, :actualPrice, :offerPrice, :quantityAvailable, :hit)) \n\n respond_to do |format|\n if @addon.save\n format.html { redirect_to store_detail_addons_url, notice: 'addon detail was successfully created.' }\n format.json { render :show, status: :created, location: @addon }\n else\n format.html { render :new }\n format.json { render json: @addon.errors, status: :unprocessable_entity }\n end\n end\n end", "def store_params\n params.require(:store).permit(:name, :address, :intro, :phone, :address, :country, :city, :district, :ophour, :latlng, :location_list , :service_list )\n end", "def create\n \n @store_detail = StoreDetail.find(params[:store_detail_id])\n @food = @store_detail.foods.build(params.require(:food).permit(:foodName, :foodType, :foodSize, :actualPrice, :offerPrice, :quantityAvailable, :hit)) \n # @food = StoreDetail.find(params[:store_detail_id]).foodDetails.build(params.require(:food).permit(:foodName, :foodType, :foodSize, :actualPrice, :offerPrice, :quantityAvailable, :hit)) \n\n respond_to do |format|\n if @food.save\n format.html { redirect_to store_detail_foods_url, notice: 'Food detail was successfully created.' }\n format.json { render :show, status: :created, location: @food }\n else\n format.html { render :new }\n format.json { render json: @food.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bicycle_shop = BicycleShop.new(bicycle_shop_params)\n\n respond_to do |format|\n if @bicycle_shop.save\n format.html { redirect_to @bicycle_shop, notice: 'Bicycle shop was successfully created.' }\n format.json { render :show, status: :created, location: @bicycle_shop }\n else\n format.html { render :new }\n format.json { render json: @bicycle_shop.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @shop = Shop.new(shop_params)\n\n respond_to do |format|\n if @shop.save\n format.html { redirect_to @shop, notice: 'Location was successfully created.' }\n format.json { render :show, status: :created, shop: @shop }\n else\n format.html { render :new }\n format.json { render json: @shop.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @store = Store.new(params[:admin_store])\n\n respond_to do |format|\n if @store.save\n format.html { redirect_to([:admin,@store], :notice => 'Store was successfully created.') }\n format.xml { render :xml => @store, :status => :created, :location => @store }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @store.errors, :status => :unprocessable_entity }\n end\n end\n end", "def store_params\n params.require(:store).permit(:code, :catalog, :name, :district, :city, :province, :country, :latitude, :longitude, :addr, :linkman, :contact_num)\n end", "def create\n @d_sale_item = DSaleItem.new(params[:d_sale_item])\n\n respond_to do |format|\n if @d_sale_item.save\n format.html { redirect_to @d_sale_item, notice: 'D sale item was successfully created.' }\n format.json { render json: @d_sale_item, status: :created, location: @d_sale_item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @d_sale_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @drug_administration = DrugAdministration.new(drug_administration_params)\n\n respond_to do |format|\n if @drug_administration.save\n format.html { redirect_to @drug_administration, notice: 'Drug administration was successfully created.' }\n format.json { render :show, status: :created, location: @drug_administration }\n else\n format.html { render :new }\n format.json { render json: @drug_administration.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @drug_store.destroy\n respond_to do |format|\n format.html { redirect_to drug_stores_url, notice: 'Drug store was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def new\n @store = Store.find(params[:store_id])\n @dish_discount = @store.dish_discounts.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dish_discount }\n end\n end", "def create\n @shop = Shop.new(params[:shop])\n\n respond_to do |format|\n if @shop.save\n format.html { redirect_to @shop, notice: 'Shop was successfully created.' }\n format.json { render json: @shop, status: :created, location: @shop }\n else\n format.html { render action: \"new\" }\n format.json { render json: @shop.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @shop = Shop.new(params[:shop])\n\n respond_to do |format|\n if @shop.save\n format.html { redirect_to @shop, notice: 'Shop was successfully created.' }\n format.json { render json: @shop, status: :created, location: @shop }\n else\n format.html { render action: \"new\" }\n format.json { render json: @shop.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @sales_rep = SalesRep.new(params[:sales_rep])\n\n respond_to do |format|\n if @sales_rep.save\n format.html { redirect_to @sales_rep, notice: 'Sales rep was successfully created.' }\n format.json { render json: @sales_rep, status: :created, location: @sales_rep }\n format.js {}\n else\n format.html { render action: \"new\" }\n format.json { render json: @sales_rep.errors, status: :unprocessable_entity }\n end\n end\n end", "def append_json_store(tiddlers)\n # Convert tiddler data from a hash into an array of hashes,\n # and make sure the title is included\n tiddlers = tiddlers.map do |title, fields|\n fields = { text: fields } if fields.is_a?(String)\n fields[:title] = title\n fields\n end\n\n # Create new script element\n new_store_node = Nokogiri::XML::Node.new('script', doc) do |node|\n node['class'] = 'tiddlywiki-tiddler-store'\n node['type'] = 'application/json'\n node.content = tiddlers.to_json\n end\n\n # Insert it after the others\n json_stores.last.add_next_sibling(new_store_node)\n\n # Clear these to ensure the tiddler data will be refreshed\n @_json_stores = nil\n @_tiddler_data_from_json = nil\n end", "def create\n @store_flavor = StoreFlavor.new(store_flavor_params)\n\n respond_to do |format|\n if @store_flavor.save\n format.html { redirect_to @store_flavor, notice: 'Store flavor was successfully created.' }\n format.json { render :show, status: :created, location: @store_flavor }\n else\n format.html { render :new }\n format.json { render json: @store_flavor.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @mall = Mall.new(mall_params)\n shops_in_mall = Shop.where(id: JSON.parse(params[:mall][:shops_in_mall])) if params[:mall][:shops_in_mall]\n @mall.shops << shops_in_mall\n\n respond_to do |format|\n if @mall.save\n format.html { redirect_to director_malls_path, notice: 'Mall was successfully created.' }\n format.json { render :show, status: :created, location: @mall }\n else\n format.html {\n @shops = Shop.to_options.to_json\n render :new\n }\n format.json { render json: @mall.errors, status: :unprocessable_entity }\n end\n end\n end", "def store_params\n params.permit(:store_uid, :city_id, :name, :level, :phone, :address, :store_building, :email, :store_category, :store_owner)\n store_data = {\n city_id: params.fetch(:city_id, nil).to_i,\n store_uid: params.fetch(:store_uid, nil).to_s,\n name: params.fetch(:name, nil).to_s,\n level: params.fetch(:level, 0).to_i,\n phone: params.fetch(:phone, nil).to_s,\n address: params.fetch(:address, nil).to_s,\n email: params.fetch(:email, nil).to_s,\n store_building: params.fetch(:store_building, nil).to_s,\n store_category: params.fetch(:store_category, nil).to_i,\n store_owner: params.fetch(:store_owner, nil).to_s,\n }\n end", "def store_params\n params.require(:store).permit(:name, :address)\n end", "def new\n\t\t\t\t @store = Store.new\n\n\t\t\t\t respond_to do |format|\n\t\t\t\t format.html # new.html.erb\n\t\t\t\t format.json { render json: @store }\n\t\t\t\t end\n\t\t\t\t end", "def create\n @invoice_drug = InvoiceDrug.new(invoice_drug_params)\n\n respond_to do |format|\n if @invoice_drug.save\n format.html { redirect_to @invoice_drug, notice: 'Invoice drug was successfully created.' }\n format.json { render :show, status: :created, location: @invoice_drug }\n else\n format.html { render :new }\n format.json { render json: @invoice_drug.errors, status: :unprocessable_entity }\n end\n end\n end", "def store_params\n params.require(:store).permit(:name, :contact_name, :contact_no, :address, :pin, :review, :rating, :active, :new_product_map => ['product_id', 'price'], :delete_product_map => ['product_id'])\n end", "def create\n @store_manager = StoreManager.new(store_manager_params)\n\n respond_to do |format|\n if @store_manager.save\n format.html { redirect_to @store_manager, notice: 'Store manager was successfully created.' }\n format.json { render :show, status: :created, location: @store_manager }\n else\n format.html { render :new }\n format.json { render json: @store_manager.errors, status: :unprocessable_entity }\n end\n end\n end", "def drug_params\n params.require(:drug).permit(:name, :trade_name, :effect, :concern, :drug_usage_id, :store_unit_id)\n end", "def create\n @men_shop_collection = MenShopCollection.new(men_shop_collection_params)\n\n respond_to do |format|\n if @men_shop_collection.save\n format.html { redirect_to @men_shop_collection, notice: 'Men shop collection was successfully created.' }\n format.json { render :show, status: :created, location: @men_shop_collection }\n else\n format.html { render :new }\n format.json { render json: @men_shop_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @supply = Supply.new(supply_params)\n\n respond_to do |format|\n if @supply.save\n format.html { redirect_to supplies_path, notice: 'Goods was successfully created.' }\n format.json { render :show, status: :created, location: @supply }\n else\n format.html { render :new }\n format.json { render json: @supply.errors, status: :unprocessable_entity }\n end\n end\n end", "def item_store_params\n params.require(:item_store).permit( :item_id, :store_id, :price, :stores_attributes => [ :id, :store_name ], :items_attributes => [ :id, :description, :barcode, :image_path ] )\n end", "def create\n @store_book = StoreBook.new(store_book_params)\n\n respond_to do |format|\n if @store_book.save\n format.html { redirect_to @store_book, notice: 'Store book was successfully created.' }\n format.json { render :show, status: :created, location: @store_book }\n else\n format.html { render :new }\n format.json { render json: @store_book.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @stores_report = Stores::Report.new(params[:stores_report])\n\n respond_to do |format|\n if @stores_report.save\n format.html { redirect_to @stores_report, notice: 'Report was successfully created.' }\n format.json { render json: @stores_report, status: :created, location: @stores_report }\n else\n format.html { render action: \"new\" }\n format.json { render json: @stores_report.errors, status: :unprocessable_entity }\n end\n end\n end", "def store_params\n params.require(:store).permit(:name)\n end", "def generate\n @store.save\n end", "def show\n respond_to do |format|\n format.html do\n gon.stores = [\"AppEstablishmentStore\"] \n gon.jbuilder \n end\n\n format.json { render :show }\n end \n end", "def create\n @wave = Wave.find(params[:wave_id])\n @surfer = @wave.surfers.create(surfers_params)\n\n redirect_to waves_path\n end", "def new\n @datastore = Datastore.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @datastore }\n end\n end", "def create\n @grocery = Grocery.new(grocery_params)\n\n if @grocery.save\n render json: @grocery, status: :created, location: @grocery\n else\n render json: @grocery.errors, status: :unprocessable_entity\n end\n end", "def create\n @set_station = SetStation.new(set_station_params)\n\n respond_to do |format|\n if @set_station.save\n format.html { redirect_to set_stations_path, notice: 'Set station was successfully created.' }\n format.json { render :index, status: :created, location: @set_stations }\n else\n format.html { render :new }\n format.json { render json: @set_station.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @shop = Shop.new(shop_params)\n\n respond_to do |format|\n if @shop.save\n format.html { redirect_to shops_url, notice: 'Shop #{@shop.name} was successfully created.' }\n format.json { render :show, status: :created, location: shops_url }\n else\n format.html { render :new }\n format.json { render json: @shop.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.65901494", "0.646261", "0.6295786", "0.62833464", "0.62730956", "0.62726563", "0.62284404", "0.6222316", "0.6216965", "0.62096083", "0.61872613", "0.617285", "0.617285", "0.6149776", "0.6136852", "0.6096941", "0.60839796", "0.60568315", "0.5993013", "0.59866303", "0.5952211", "0.5929214", "0.591753", "0.5885765", "0.5873394", "0.5854734", "0.58447367", "0.5836669", "0.58335674", "0.57977223", "0.57783693", "0.57724804", "0.57520384", "0.57422423", "0.57395333", "0.5726262", "0.571784", "0.5700714", "0.56563926", "0.56370306", "0.56328434", "0.5621093", "0.5604401", "0.55973995", "0.55828124", "0.5582223", "0.55692923", "0.5568653", "0.55678576", "0.5551304", "0.5523751", "0.5519261", "0.55184376", "0.5513174", "0.54849994", "0.54372233", "0.54363054", "0.54022276", "0.53888416", "0.53884697", "0.53759545", "0.53758574", "0.5373414", "0.5367475", "0.53584737", "0.53535014", "0.5350577", "0.5336415", "0.5333753", "0.53282446", "0.53244126", "0.5319718", "0.53180766", "0.531711", "0.5315906", "0.5315906", "0.53156626", "0.53138185", "0.53093386", "0.5308884", "0.5308546", "0.5305691", "0.5303366", "0.5302548", "0.5301173", "0.5296303", "0.5289568", "0.52883536", "0.528506", "0.5270488", "0.5269504", "0.52681375", "0.52670926", "0.526655", "0.526067", "0.5257778", "0.5257658", "0.5257553", "0.5257351", "0.52572584" ]
0.7323824
0
PATCH/PUT /drug_stores/1 PATCH/PUT /drug_stores/1.json
def update respond_to do |format| if @drug_store.update(drug_store_params) format.html { redirect_to @drug_store, notice: 'Drug store was successfully updated.' } format.json { render :show, status: :ok, location: @drug_store } else format.html { render :edit } format.json { render json: @drug_store.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n if @store.update(store_params)\n render json: @store\n else\n render json: @store.errors, status: :unprocessable_entity\n end\n end", "def update\n @store = Store.find(params[:id])\n\n respond_to do |format|\n if @store.update_attributes(params.require(:store).permit(:break_even, :capacity, :city, :county_id, :manager_id,\n :name, :number, :number_of_lifts, :phone, :region_id,\n :state_id, :street_address, :zip))\n format.html { redirect_to stores_url,\n notice: 'Store was successfully updated.' }\n format.json { head :no_content }\n else\n prepFormVariables\n format.html { render action: \"edit\" }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @store = Store.find(params[:id])\n\n respond_to do |format|\n if @store.update_attributes(params[:store])\n format.html { redirect_to stores_path, notice: 'Store was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @datastore = Datastore.find(params[:id])\n\n respond_to do |format|\n if @datastore.update_attributes(params[:datastore])\n format.html { redirect_to @datastore, notice: 'Datastore was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @datastore.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n begin\n @api_v1_store.update!(api_v1_store_params)\n head :no_content\n rescue => ex\n json_response({error: ex.message}, :unprocessable_entity)\n end\n end", "def update\n @store = Store.find(params[:id])\n\n respond_to do |format|\n if @store.update_attributes(params[:store])\n format.html { redirect_to '/stores/admin', notice: 'Store was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @store = Store.find(params[:id])\n\n respond_to do |format|\n if @store.update_attributes(params[:store])\n format.html { redirect_to @store, notice: 'Store was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @store = Store.find(params[:id])\n\n respond_to do |format|\n if @store.update_attributes(params[:store])\n format.html { redirect_to @store, notice: 'Store was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @store = Store.find(params[:id])\n\n respond_to do |format|\n if @store.update_attributes(params[:store])\n format.html { redirect_to @store, notice: 'Store was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @store = Store.find(params[:id])\n\n respond_to do |format|\n if @store.update_attributes(params[:store])\n format.html { redirect_to @store, notice: 'Store was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @store_add.update(store_add_params)\n format.html { redirect_to @store_add, notice: 'Store add was successfully updated.' }\n format.json { render :show, status: :ok, location: @store_add }\n else\n format.html { render :edit }\n format.json { render json: @store_add.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @store = Store.find(params[:id])\n\n respond_to do |format|\n if @store.update_attributes(params[:store])\n format.html { redirect_to @store, :notice => 'Store was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @store.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @data = @recipe.update(params[:id], recipe_params)\n render json: @data\n end", "def update\n respond_to do |format|\n if @store.update(store_params)\n format.html { redirect_to @store, notice: 'Store was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @drug = Drug.find(params[:id])\n\n respond_to do |format|\n if @drug.update_attributes(params[:drug])\n format.html { redirect_to @drug, notice: 'Drug was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @drug.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @store.update(store_params)\n format.html { redirect_to @store }\n format.json { render :show, status: :ok, store: @store }\n else\n format.html { render :edit }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n recipe.update(recipe_params)\n render json: recipe\n end", "def update\n @rental = Rental.find_by_id params[:rental][:id]\n store = Store.find_by_location params[:rental].delete(:location)\n params[:rental][:time] = parse_time(params[:rental].delete(:date), params[:rental].delete(:time))\n params[:rental][:store_id] = store.try(:id)\n if @rental.nil?\n render json: { errors: [\"Customer with id #{params[:customer][:id]} could not be found\"] }, status: 403\n elsif @rental.update_attributes params[:rental]\n render json: @rental\n else\n render json: { errors: @rental.errors.full_messages }, status: 422\n end\n # @new_quantities = params[:rental].delete(:quantities)\n # if @new_quantities && @rental\n # @rental.rental_bikes.destroy_all\n # build_rental_bikes(@new_quantities) if @rental\n # end\n # render json: @rental.to_json if @rental.try(:save)\n end", "def update\n ingredient.update(ingredient_params)\n render json: ingredient\n end", "def update\n @rental = Rental.find_by_id params[:rental][:id]\n store = Store.find_by_location params[:rental].delete(:location)\n time = parse_time params[:rental].delete(:date), params[:rental].delete(:time)\n params[:rental][:time] = time if time\n params[:rental][:store_id] = store.try(:id)\n if @rental.nil?\n customer_id = params[:customer][:id]\n render json: { errors: [\"Customer with id #{customer_id} could not be found\"] }, status: 403\n elsif @rental.update_attributes params[:rental]\n render json: @rental\n else\n render json: { errors: @rental.errors.full_messages }, status: 422\n end\n # @new_quantities = params[:rental].delete(:quantities)\n # if @new_quantities && @rental\n # @rental.rental_bikes.destroy_all\n # build_rental_bikes(@new_quantities) if @rental\n # end\n # render json: @rental.to_json if @rental.try(:save)\n end", "def update\n respond_to do |format|\n if @store.update(store_params)\n format.html { redirect_to @store, notice: 'Store was successfully updated.' }\n format.json { render :show, status: :ok, location: @store }\n else\n format.html { render :edit }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @store.update(store_params)\n format.html { redirect_to @store, notice: 'Store was successfully updated.' }\n format.json { render :show, status: :ok, location: @store }\n else\n format.html { render :edit }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n attributes = fulfillment_bill_params.clone\n puts attributes\n @store = Store.find(attributes[\"store_id\"])\n puts \"Found Store = #{@store.StoreName}\" if !@store.nil?\n attributes = attributes.merge(\"store_name\" => @store.StoreName)\n puts attributes\n respond_to do |format|\n if @fulfillment_bill.update(attributes)\n format.html { redirect_to @fulfillment_bill, notice: 'Fulfillment bill was successfully updated.' }\n format.json { render :show, status: :ok, location: @fulfillment_bill }\n else\n format.html { render :edit }\n format.json { render json: @fulfillment_bill.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @store.update(store_params)\n format.html { redirect_to action 'show', notice: 'Store was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @store.update(store_params)\n format.html { redirect_to [:phone, @store], notice: 'Store was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\t\t\t\t @store = Store.find(params[:id])\n\n\t\t\t\t respond_to do |format|\n\t\t\t\t if @store.update_attributes(params[:store])\n\t\t\t\t\tformat.html { redirect_to @store, notice: 'Store was successfully updated.' }\n\t\t\t\t\tformat.json { head :no_content }\n\t\t\t\t else\n\t\t\t\t\tformat.html { render action: \"edit\" }\n\t\t\t\t\tformat.json { render json: @store.errors, status: :unprocessable_entity }\n\t\t\t\t end\n\t\t\t\t end\n\t\t\t\t end", "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end", "def update\n @store_detail = StoreDetail.find(params[:store_detail_id])\n @food = Food.find(params[:id])\n respond_to do |format|\n if @food.update(food_params)\n format.html { redirect_to store_detail_food_url, notice: 'Food detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @food }\n else\n format.html { render :edit }\n format.json { render json: @food.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @data_store = DataStore.find(params[:id])\n\n respond_to do |format|\n if @data_store.update_attributes(params[:data_store])\n format.html { redirect_to @data_store.data_source, notice: 'Data store was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @data_store.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @cakestore.update(cakestore_params)\n format.html { redirect_to @cakestore, notice: 'Cakestore was successfully updated.' }\n format.json { render :show, status: :ok, location: @cakestore }\n else\n format.html { render :edit }\n format.json { render json: @cakestore.errors, status: :unprocessable_entity }\n end\n end\n end", "def update options={}\n client.put(\"/#{id}\", options)\n end", "def update\n @review = Review.find(params[:id])\n @review.update(review_params)\n render json: @review\n end", "def update\n respond_to do |format|\n if @drug_store_branch.update(drug_store_branch_params)\n format.html { redirect_to [@drug_store, @drug_store_branch], notice: 'Drug store branch was successfully updated.' }\n format.json { render :show, status: :ok, location: [@drug_store, @drug_store_branch] }\n else\n format.html { render :edit }\n format.json { render json: @drug_store_branch.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @drugmaster.update(drugmaster_params)\n format.html { redirect_to @drugmaster, notice: 'Drugmaster was successfully updated.' }\n format.json { render :show, status: :ok, location: @drugmaster }\n else\n format.html { render :edit }\n format.json { render json: @drugmaster.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n stores = []\n if params[:product][:store_ids].present?\n params[:product][:store_ids].each do |store_id|\n unless store_id.empty?\n store = Store.find(store_id)\n stores << store\n end\n end\n end\n\n unless stores.empty?\n @product.stores = stores\n else\n @product.stores.clear\n end\n \n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: \"Product was successfully updated.\" }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n render json: Item.update(params[\"id\"], params[\"item\"])\n end", "def update\n respond_to do |format|\n if @store.update(store_params)\n format.html { redirect_to account_stores_path(account_id: current_account.id), notice: 'Store was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @item.update(item_params)\n render status: 201, :json => @item, :include =>[{:location =>{:except=>[:id, :created_at, :updated_at]}}, {:food =>{:except =>[:id, :created_at, :updated_at]}}], :except => [:created_at, :updated_at, :food_id, :location_id]\n else\n render status: 404, json: { message: @item.errors}.to_json\n end\n\n \n end", "def update\n @admin_store = Admin::Store.find(params[:id])\n\n respond_to do |format|\n if @admin_store.update_attributes(params[:admin_store])\n format.html { redirect_to @admin_store, notice: 'Store was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_store.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @supermarket = Supermarket.find(params[:id]) \n respond_to do |format|\n if @supermarket.update(supermarket_params)\n format.json { render json: @supermarket, status: :ok }\n end\n end\n end", "def update\n render json: Company.update(params[\"id\"], params[\"company\"])\n end", "def update\n @sales_rep = SalesRep.find(params[:id])\n \n respond_to do |format|\n if @sales_rep.update_attributes(params[:sales_rep])\n format.html { redirect_to @sales_rep, notice: 'Sales rep was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sales_rep.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @review.update(review_params)\n render json: @review\n else\n render json: @review.errors, status: :unprocessable_entity\n end\nend", "def update\n binding.pry\n respond_to do |format|\n if @sets_and_rep.update(sets_and_rep_params)\n format.html { redirect_to @sets_and_rep, notice: 'Sets and rep was successfully updated.' }\n format.json { render :show, status: :ok, location: @sets_and_rep }\n else\n format.html { render :edit }\n format.json { render json: @sets_and_rep.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\n # update shops\n shops_edit = JSON.parse(params[:mall][:shops_in_mall])\n\n respond_to do |format|\n if @mall.update_with_shops(mall_params, shops_edit)\n format.html { redirect_to director_malls_path, notice: 'Mall was successfully updated.' }\n format.json { render :show, status: :ok, location: @mall }\n else\n format.html {\n @shops = Shop.to_options.to_json\n @shops_in_mall = @mall.shops.to_options.to_json\n render :edit\n }\n format.json { render json: @mall.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def update\n do_patch { return } # check if patch and do submission and return early if it is a patch (submission)\n # otherwise this is a PUT of the dataset metadata\n check_status { return } # check it's in progress, clone a submitted or raise an error\n respond_to do |format|\n format.json do\n dp = if @resource\n DatasetParser.new(hash: params['dataset'], id: @resource.identifier, user: @user) # update dataset\n else\n DatasetParser.new(hash: params['dataset'], user: @user, id_string: params[:id]) # upsert dataset with identifier\n end\n @stash_identifier = dp.parse\n ds = Dataset.new(identifier: @stash_identifier.to_s) # sets up display objects\n render json: ds.metadata, status: 200\n end\n end\n end", "def update\n @rental = Rental.friendly.find(params[:rental_id])\n \n\n respond_to do |format|\n if @feature.update(feature_params)\n format.html { redirect_to rental_path(@rental), notice: 'Feature was successfully updated.' }\n format.json { render :show, status: :ok, location: @feature }\n else\n format.html { render :edit }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @store_to_visit.update(store_to_visit_params)\n format.html { redirect_to root_path, notice: 'Store to visit was successfully updated.' }\n format.json { render :show, status: :ok, location: @store_to_visit }\n else\n format.html { render :edit }\n format.json { render json: @store_to_visit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(add_params = nil)\n params = {\n uid: uid,\n }\n api_call('/stores/:uid(.:format)',:put,params,add_params)\n end", "def update\n respond_to do |format|\n if @store.update(store_params)\n @stores = Store.by_id\n format.js {render layout: false, notice: 'Se modificó el estado de la tienda.'}\n format.html { redirect_to @store, notice: 'Store was successfully updated.' }\n format.json { render :show, status: :ok, location: @store }\n else\n format.html { render :edit }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @store_item.update(store_item_params)\n format.html { redirect_to @store_item, notice: 'Store item was successfully updated.' }\n format.json { render :show, status: :ok, location: @store_item }\n else\n format.html { render :edit }\n format.json { render json: @store_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @grocery = Grocery.find(params[:id])\n\n if @grocery.update(grocery_params)\n head :no_content\n else\n render json: @grocery.errors, status: :unprocessable_entity\n end\n end", "def update\n @set.update_attributes({ :data => params[:data] })\n render_json :entry => @set and return\n end", "def update\n @set.update_attributes({ :data => params[:data] })\n render_json :entry => @set and return\n end", "def update\n @store = Store.find(params[:store_id])\n @dish_discount = @store.dish_discounts.find(params[:id])\n\n respond_to do |format|\n if @dish_discount.update_attributes(params[:dish_discount])\n format.html { redirect_to store_dish_discounts_url(@store), notice: 'Dish discount was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dish_discount.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @store.update(store_params)\n format.html { redirect_to @store, notice: \"Loja atualizada com sucesso!\" }\n format.json { render :show, status: :ok, location: @store }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n json_response(@food_item.update!(food_item_params))\n end", "def update\n respond_to do |format|\n if @itemstore.update(item_store_params)\n format.html { redirect_to @itemstore, notice: 'Item was successfully updated.' }\n format.json { render :show, status: :ok, location: @itemstore }\n else\n format.html { render :edit }\n format.json { render json: @itemstore.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @shop = Shop.find(params[:id])\n\n if @shop.update(shop_params)\n head :no_content\n else\n render json: @shop.errors, status: :unprocessable_entity\n end\n end", "def update\n params[:book_shelf]['user'] = User.where(:id => params[:book_shelf]['user']).first\n params[:book_shelf]['book'] = Book.where(:id => params[:book_shelf]['book']).first\n @book_shelf = BookShelf.find(params[:id])\n respond_to do |format|\n if @book_shelf.update_attributes(params[:book_shelf])\n format.html { redirect_to @book_shelf, notice: 'Book shelf was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book_shelf.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @drug = Drug.find(params[:id])\n\n respond_to do |format|\n if @drug.update_attributes(params[:drug])\n format.html { redirect_to(@drug, :notice => 'Drug was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @drug.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @store.update(stock_params)\n format.html { redirect_to @store, notice: 'Stock was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @dataset.update_attributes(params[:dataset])\n format.html { redirect_to @dataset, notice: 'Dataset was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dataset.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend", "def update\n respond_to do |format|\n if @offer.update(offers_params)\n format.jsonapi { render :show, status: :ok, location: @offer }\n else\n format.jsonapi { render jsonapi: @offer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @store_detail = StoreDetail.find(params[:store_detail_id])\n @addon = Addon.find(params[:id])\n respond_to do |format|\n if @addon.update(addon_params)\n format.html { redirect_to store_detail_addon_url, notice: 'addon detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @addon }\n else\n format.html { render :edit }\n format.json { render json: @addon.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @store.update(store_params)\n format.html { redirect_to @store, notice: 'Store was successfully updated.' }\n params[:books].each{\n |id|\n StoreBook.create(:store_id=>@store.id,:book_id=>id)\n }\n format.json { render :show, status: :ok, location: @store }\n else\n format.html { render :edit }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @storeinfo.update(storeinfo_params)\n format.html { redirect_to @storeinfo, notice: 'Storeinfo was successfully updated.' }\n format.json { render :show, status: :ok, location: @storeinfo }\n else\n format.html { render :edit }\n format.json { render json: @storeinfo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize @store_detail, :update?\n respond_to do |format|\n if @store_detail.update(store_detail_params)\n format.html { redirect_to @store_detail, notice: 'Store detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @store_detail }\n else\n format.html { render :edit }\n format.json { render json: @store_detail.errors, status: :unprocessable_entity }\n end\n end\n end", "def jsonapi_update!(attributes)\n assign_jsonapi_attributes(attributes)\n save!\n end", "def update\n render json: Location.update(params[\"id\"], params[\"location\"])\n end", "def update # PATCH\n raise NotImplementedError\n end", "def update\n respond_to do |format|\n if @book_store.update(book_store_params)\n format.html { redirect_to @book_store, notice: 'Book store was successfully updated.' }\n format.json { render :show, status: :ok, location: @book_store }\n else\n format.html { render :edit }\n format.json { render json: @book_store.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @promo = Promo.find(params[:id])\n brand = Brand.find(params[:promo][:brand_id])\n @promo.stores = brand.stores\n respond_to do |format|\n if @promo.update_attributes(params[:promo])\n format.html { redirect_to @promo, notice: 'Promo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @promo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @storepromotion.update(storepromotion_params)\n format.html { redirect_to @storepromotion, notice: 'Storepromotion was successfully updated.' }\n format.json { render :show, status: :ok, location: @storepromotion }\n else\n format.html { render :edit }\n format.json { render json: @storepromotion.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @mstore.update(mstore_params)\n format.html { redirect_to @mstore, notice: 'Mstore was successfully updated.' }\n format.json { render :show, status: :ok, location: @mstore }\n else\n format.html { render :edit }\n format.json { render json: @mstore.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @store_flavor.update(store_flavor_params)\n format.html { redirect_to @store_flavor, notice: 'Store flavor was successfully updated.' }\n format.json { render :show, status: :ok, location: @store_flavor }\n else\n format.html { render :edit }\n format.json { render json: @store_flavor.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @gig_set.update(gig_set_params)\n format.html { redirect_to edit_gig_path(@gig_set.gig) }\n format.json { redirect_to edit_gig_path(@gig_set.gig) }\n else\n format.html { redirect_to edit_gig_path(@gig_set.gig), error: \"Couldn't update set\" }\n format.json { redirect_to edit_gig_path(@gig_set.gig), status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n @store.slug=nil\n if @store.update(store_params)\n format.html { redirect_to owner_commerce_stores_path(@store.commerce.slug), notice: 'Tienda actualizado exitosamente.' }\n format.json { render :show, status: :ok, location: @store }\n else\n format.html { render :edit }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def update #saves and redirects, saves changes\n @line_item = LineItem.find(params[:id])\n @line_item.quantity = params[:quantity]\n @line_item.size_id = params[:size_id]\n @line_item.save\n render json: @line_item\n end", "def update(id, attributes)\n # attributes = {name: 'chocolate and peanuts', calories: 10}\nend", "def update\n respond_to do |format|\n if @taxon.update(taxon_params)\n format.html { redirect_to taxons_path, notice: \"Species: '#{@taxon.common_name}' was successfully updated.\" }\n format.json { render :show, status: :ok, location: @taxon }\n else\n format.html { render :edit }\n format.json { render json: @taxon.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n save_relations\n if @ingredient.update(ingredient_params)\n format.html { redirect_to @ingredient.recipe, notice: 'Ingredient was successfully updated.' }\n format.json { render :show, status: :ok, location: @ingredient }\n else\n format.html { render :edit }\n format.json { render json: @ingredient.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @sale = Sale.find(params[:id])\n\n if @sale.update(sale_params)\n head :no_content\n else\n render json: @sale.errors, status: :unprocessable_entity\n end\n end", "def update\n product = Product.find(params[:id])\n product_details = params.permit(:title, :inventory_count, :price)\n\n product.update(product_details)\n\n render json: product\n end", "def update_store_with_http_info(store_id, request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: StoresApi.update_store ...\"\n end\n # verify the required parameter 'store_id' is set\n fail ArgumentError, \"Missing the required parameter 'store_id' when calling StoresApi.update_store\" if store_id.nil?\n # verify the required parameter 'request' is set\n fail ArgumentError, \"Missing the required parameter 'request' when calling StoresApi.update_store\" if request.nil?\n # resource path\n local_var_path = \"/v2/user/customer/stores/{storeId}\".sub('{format}','json').sub('{' + 'storeId' + '}', store_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'])\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 = @api_client.object_to_http_body(request)\n auth_names = ['api_key']\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: StoresApi#update_store\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n @shop_special_offer = Shop::SpecialOffer.find(params[:id])\n\n respond_to do |format|\n if @shop_special_offer.update_attributes(params[:shop_special_offer])\n format.html { redirect_to @shop_special_offer, notice: 'Special offer was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @shop_special_offer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @shelf.update(shelf_params)\n format.html { redirect_to house_shelves_path(params[:house_id]), notice: 'Shelf was successfully created.' } \n format.json { render :show, status: :ok, location: @shelf }\n else\n format.html { render :edit }\n format.json { render json: @shelf.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @article = Article.find(params[:id])\n \n if !params[:stores].nil?\n # prevent assignment of empty element to stores reference\n params[:stores].delete_if { |x| x == \"\"}\n end\n \n if @article.price.nil?\n # user don't know the price of the article yet\n @article.price = 0\n end\n \n if !params[:stores].nil?\n @stores = Store.find(params[:stores])\n @stores.each { |s|\n @article.stores.delete(s) # prohibit duplicate references to store\n @article.stores << s\n }\n end\n \n respond_to do |format|\n if @article.update_attributes(params[:article])\n if params[:list_id].empty?\n format.html { redirect_to articles_path, notice: 'Article was successfully updated.' }\n else\n format.html { redirect_to select_shoppinglist_path(params[:list_id]), notice: 'Article was successfully updated.' }\n end\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @article.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @admin_store.update(admin_store_params)\n format.html { redirect_to @admin_store, notice: 'Store was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_store }\n else\n format.html { render :edit }\n format.json { render json: @admin_store.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @store = Store.find(params[:id])\n\n respond_to do |format|\n if @store.update_attributes(params[:store])\n format.html { redirect_to(@store, :notice => 'Store was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @store.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @store_status.update(store_status_params)\n format.html { redirect_to @store_status, notice: 'Store status was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @store_status.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @animal.update(animal_params)\n respond_with(@shelter)\n end", "def update\n @client.update(client_params)\n render json: @client\n end", "def update\n respond_to do |format|\n if @measured_ingredient.update(measured_ingredient_params)\n format.html { redirect_to @measured_ingredient, notice: 'Measured ingredient was successfully updated.' }\n format.json { render :show, status: :ok, location: @measured_ingredient }\n else\n format.html { render :edit }\n format.json { render json: @measured_ingredient.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @recipe.allergies.destroy_all\n params[:recipe][:allergy].each do |key,value|\n if value[\"name\"] == \"1\"\n allergy = Allergy.find(key)\n @recipe.allergies << allergy\n end\n end\n\n if params[:recipe][:concentrate] == '1' || params[:recipe][:recipe_category_id] == RecipeCategory.find_by(name: \"Concentrates\").id\n @recipe.concentrate = true\n else\n @recipe.concentrate = false\n end\n\n respond_to do |format|\n if @recipe.update(recipe_params)\n @allergies = Allergy.all\n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n format.json { render :show, status: :ok, location: @recipe }\n else\n @allergies = Allergy.all\n format.html { render :edit }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @closet_item = ClosetItem.find(params[:id])\n\n respond_to do |format|\n if @closet_item.update_attributes(params[:closet_item])\n format.html { redirect_to @closet_item, notice: 'Closet item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @closet_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @store = Store.find(params[:id])\n @store.categories = Category.find(params[:category_ids]) if params[:category_ids]\n respond_to do |format|\n if @store.update_attributes(params[:store])\n format.html { redirect_to(@store, :notice => 'Store was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @store.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @shop_claim = ShopClaim.find(params[:id])\n\n if @shop_claim.update(shop_claim_params)\n head :no_content\n else\n render json: @shop_claim.errors, status: :unprocessable_entity\n end\n end" ]
[ "0.65545964", "0.6262163", "0.6226827", "0.6209489", "0.6165126", "0.61627114", "0.61604273", "0.61604273", "0.61604273", "0.61604273", "0.6131849", "0.61309266", "0.60972077", "0.60814285", "0.6067092", "0.6060184", "0.6058264", "0.60133386", "0.60096925", "0.60095274", "0.5991287", "0.5991287", "0.5980847", "0.59726024", "0.59690315", "0.59547013", "0.59528077", "0.5946079", "0.59285223", "0.592174", "0.5919269", "0.59162414", "0.5866865", "0.58602405", "0.58553916", "0.5847698", "0.58444136", "0.5840498", "0.5812333", "0.5810707", "0.58095145", "0.58047116", "0.5804237", "0.58010924", "0.57950443", "0.5794871", "0.5786407", "0.57862496", "0.57729477", "0.57660705", "0.5763976", "0.5759186", "0.57581544", "0.5756585", "0.5756585", "0.5755193", "0.5753691", "0.5749305", "0.57421845", "0.5712344", "0.5706438", "0.5704657", "0.5699626", "0.5699573", "0.56986284", "0.5692385", "0.5686162", "0.5681991", "0.5673925", "0.5669657", "0.5666582", "0.56652117", "0.56624734", "0.5662295", "0.5662181", "0.5659869", "0.5650597", "0.5649385", "0.56488675", "0.56437546", "0.5637233", "0.56356174", "0.5634229", "0.5627019", "0.562444", "0.56203717", "0.56180596", "0.56110245", "0.56098163", "0.5608753", "0.56079614", "0.5607286", "0.5605368", "0.56010246", "0.559687", "0.5596607", "0.5593649", "0.5592805", "0.5573925", "0.5555729" ]
0.6767939
0
DELETE /drug_stores/1 DELETE /drug_stores/1.json
def destroy @drug_store.destroy respond_to do |format| format.html { redirect_to drug_stores_url, notice: 'Drug store was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @datastore = Datastore.find(params[:id])\n @datastore.destroy\n\n respond_to do |format|\n format.html { redirect_to datastores_url }\n format.json { head :no_content }\n end\n end", "def destroy\n\t\t\t\t @store = Store.find(params[:id])\n\t\t\t\t @store.destroy\n\n\t\t\t\t respond_to do |format|\n\t\t\t\t format.html { redirect_to stores_url }\n\t\t\t\t format.json { head :no_content }\n\t\t\t\t end\n\t\t\t\t end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @store = Store.find(params[:id])\n @store.destroy\n\n respond_to do |format|\n format.html { redirect_to stores_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @store = Store.find(params[:id])\n @store.destroy\n\n respond_to do |format|\n format.html { redirect_to stores_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @store = Store.find(params[:id])\n @store.destroy\n\n respond_to do |format|\n format.html { redirect_to stores_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @store = Store.find(params[:id])\n @store.destroy\n\n respond_to do |format|\n format.html { redirect_to stores_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @store.destroy\n respond_to do |format|\n format.html { redirect_to stores_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @store.destroy\n respond_to do |format|\n format.html { redirect_to stores_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @store.destroy\n respond_to do |format|\n format.html { redirect_to stores_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @store.destroy\n respond_to do |format|\n format.html { redirect_to stores_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @store = Store.find(params[:id])\n @store.destroy\n\n respond_to do |format|\n format.html { redirect_to '/stores/admin' }\n format.json { head :no_content }\n end\n end", "def destroy\n @store = Store.find(params[:id])\n #tib_res = Tibbr::ExternalResource.find_by_resource_key({:resource => {:key => \"ID_#{@store.id}\", :resource_type => \"ad:store\"}, :client_id => session[:app_id]})\n # tib_res.destroy\n @store.destroy\n \n \n\n respond_to do |format|\n format.html { redirect_to stores_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @drug = Drug.find(params[:id])\n @drug.destroy\n\n respond_to do |format|\n format.html { redirect_to drugs_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Item.delete(params[\"id\"])\n end", "def destroy\n @store_add.destroy\n respond_to do |format|\n format.html { redirect_to store_adds_url, notice: 'Store add was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @store.destroy\n\n render json: @store\n end", "def destroy\n @store = Store.find(params[:id])\n @store.destroy\n\n respond_to do |format|\n format.html { redirect_to stores_url notice: 'Store was successfully deleted.'}\n format.json { head :no_content }\n end\n end", "def destroy\n @admin_store = Admin::Store.find(params[:id])\n @admin_store.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_stores_url }\n format.json { head :no_content }\n end\n end", "def user_stores_delete_single_store user_id, 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/{user_id}/stores/{id}\"\n\n # process optional query parameters\n query_builder = APIHelper.append_url_with_template_parameters query_builder, {\n \"user_id\" => user_id,\n \"id\" => id,\n }\n\n # process optional query parameters\n query_builder = APIHelper.append_url_with_query_parameters query_builder, {\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 == 401\n raise APIException.new \"Unauthorized\", 401, response.raw_body\n elsif response.code == 500\n raise APIException.new \"Internal Server Error\", 500, 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 destroy\n @store.destroy\n respond_to do |format|\n format.html { redirect_to stores_url, notice: \"Loja deletada com sucesso!\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @drug_test = DrugTest.find(params[:id])\n @drug_test.destroy\n\n respond_to do |format|\n format.html { redirect_to drug_tests_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @store_to_visit.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Store to visit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @store = Store.find(params[:id])\n @store.destroy\n\n respond_to do |format|\n format.html { redirect_to stores_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @data_store = DataStore.find(params[:id])\n @data_store.destroy\n\n respond_to do |format|\n format.html { redirect_to data_sources_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @store = Store.find(params[:store_id])\n @dish_discount = @store.dish_discounts.find(params[:id])\n @dish_discount.destroy\n\n respond_to do |format|\n format.html { redirect_to store_dish_discounts_url(@store) }\n format.json { head :no_content }\n end\n end", "def destroy\n\n #也要處理相關tags的刪除?\n\n @store.destroy\n respond_to do |format|\n format.html { redirect_to admin_stores_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @store.destroy\n respond_to do |format|\n format.html { redirect_to stocks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @store.destroy\n respond_to do |format|\n format.html { redirect_to phone_stores_url, notice: 'Store was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @store.destroy\n respond_to do |format|\n format.html { redirect_to stores_url, notice: 'Store was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @store.destroy\n respond_to do |format|\n format.html { redirect_to stores_url, notice: 'Store was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @store.destroy\n respond_to do |format|\n format.html { redirect_to stores_url, notice: 'Store was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @store.destroy\n respond_to do |format|\n format.html { redirect_to stores_url, notice: 'Store was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Alien.delete(params[\"id\"])\n end", "def destroy\n\t@store = current_account.stores.find(params[:id])\n @store.destroy\n respond_to do |format|\n format.html { redirect_to account_stores_path(account_id: current_account.id) }\n format.json { head :no_content }\n end\n end", "def destroy\n @store = Store.find(params[:id])\n @store.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/admin/stores\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @shelf.destroy\n\n respond_to do |format|\n format.html { redirect_to shelves_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @cakestore.destroy\n respond_to do |format|\n format.html { redirect_to cakestores_url, notice: 'Cakestore was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @drug_store_branch.destroy\n respond_to do |format|\n format.html { redirect_to drug_store_drug_store_branches_url, notice: 'Drug store branch was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_demo(id)\n delete_record \"/demos/#{id}\"\n end", "def destroy\n @shelf.destroy\n respond_to do |format|\n format.html { redirect_to shelves_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @store = Store.find(params[:id])\n @store.destroy\n\n respond_to do |format|\n format.html { redirect_to(stores_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @dataload_ga = DataloadGa.find(params[:id])\n @dataload_ga.destroy\n\n respond_to do |format|\n format.html { redirect_to dataload_gas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n begin\n @api_v1_store.destroy!\n head :no_content\n rescue => ex\n json_response({error: ex.message}, :unprocessable_entity)\n end\n end", "def destroy\n @store = Store.find(params[:id])\n @store.destroy\n\n respond_to do |format|\n format.html { redirect_to(stores_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @drug = Drug.find(params[:id])\n @drug.destroy\n\n respond_to do |format|\n format.html { redirect_to(drugs_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @store_item.destroy\n respond_to do |format|\n format.html { redirect_to store_items_url, notice: 'Store item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @bread_store.destroy\n respond_to do |format|\n format.html { redirect_to bread_store_managers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @store_detail = StoreDetail.find(params[:store_detail_id])\n @food = Food.find(params[:id])\n @food.destroy\n respond_to do |format|\n format.html { redirect_to store_detail_foods_path(@store_detail), notice: 'Food detail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @mstore.destroy\n respond_to do |format|\n format.html { redirect_to mstores_url, notice: 'Mstore was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @drugmaster.destroy\n respond_to do |format|\n format.html { redirect_to drugmasters_url, notice: 'Drugmaster was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n request(:delete)\n end", "def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end", "def destroy\n @store_section = StoreSection.find(params[:id])\n @store_section.destroy\n\n respond_to do |format|\n format.html { redirect_to store_sections_url }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(url)\n @deleted = true\nend", "def destroy\n @admin_store.destroy\n respond_to do |format|\n format.html { redirect_to admin_stores_url, notice: 'Store was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @glass_store_link.destroy\n respond_to do |format|\n format.html { redirect_to glass_store_links_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @admin_store = Store.find(params[:id])\n @admin_store.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_stores_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @storepromotion.destroy\n respond_to do |format|\n format.html { redirect_to storepromotions_url, notice: 'Storepromotion was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete!( opts = {} )\n http_action :delete, nil, opts\n end", "def remove\t\n\t\t\tbegin\t\t\t\t\t\t\t\n\t\t\t\tdatatoremove = Datastore.new\t\t\t\n\t\t\t\tdatatoremove.delete(params[:key])\n\t\t\t\trender :status => 200,\n\t \t\t:json => { :response => \"success\",\n\t \t :status => 200,\n\t \t :info => \"Successfully removed\", \n\t \t :data => {} }\n\t\t\trescue Exception => e\n\t\t\t\trender :status => :unprocessable_entity,\n\t \t :json => { :response => \"fail\",\n\t \t :status => 401,\n\t :info => e.message }\n\t\t\tend\n\t\tend", "def delete\n \n end", "def destroy\n @store = Store.find(params[:store_id])\n @dish_choice = @store.dish_choices.find(params[:id])\n @dish_choice.destroy\n\n respond_to do |format|\n format.html { redirect_to store_dish_choices_url(@store) }\n format.json { head :no_content }\n end\n end", "def destroy\n @gpath = Gpath.find(params[:id])\n @gpath.destroy\n\n respond_to do |format|\n format.html { redirect_to gpaths_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @tweet_store.destroy\n respond_to do |format|\n format.html { redirect_to tweet_stores_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Post.delete(params[\"id\"])\n end", "def destroy\n @dish_mixture.destroy\n respond_to do |format|\n format.html { redirect_to dish_mixtures_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @addeshop.destroy\n respond_to do |format|\n format.html { redirect_to addeshops_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to itemstores_url, notice: 'Item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @red.destroy\n respond_to do |format|\n format.html { redirect_to reds_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Company.delete(params[\"id\"])\n end", "def destroy\n @dish_feature.destroy\n respond_to do |format|\n format.html { redirect_to store_dish_features_url(@store) }\n format.json { head :no_content }\n end\n end", "def destroy\n @storage = @client.storages.find(params[:id])\n @storage.destroy\n\n respond_to do |format|\n format.html { redirect_to client_url(@client) }\n format.json { head :no_content }\n end\n end", "def delete\n\n end", "def destroy\n @sales_rep = SalesRep.find(params[:id])\n @sales_rep.destroy\n\n respond_to do |format|\n format.html { redirect_to sales_reps_url }\n format.json { head :no_content }\n end\n end", "def delete(context, name)\n res = context.transport.delete_request(context, \"blobstores/#{name}\")\n\n context.err(res.body) unless res.success?\n end", "def delete\n url = prefix + \"delete\" + id_param\n return response(url)\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end", "def delete_item(id)\n record \"/todos/delete_item/#{id}\"\n end", "def delete(id)\n request(:delete, \"/recipes/#{id}.json\")\n end", "def destroy\n @point_of_sale.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def delete\n render json: Location.delete(params[\"id\"])\n end", "def destroy\n @gethotelstaticdatagd = Gethotelstaticdatagd.find(params[:id])\n @gethotelstaticdatagd.destroy\n\n respond_to do |format|\n format.html { redirect_to gethotelstaticdatagds_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @storeinfo.destroy\n respond_to do |format|\n format.html { redirect_to storeinfos_url, notice: 'Storeinfo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete(path)\n RestClient.delete request_base+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 delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def destroy\n @goldmeasure.destroy\n respond_to do |format|\n format.html { redirect_to goldmeasures_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @store_detail = StoreDetail.find(params[:store_detail_id])\n @addon = Addon.find(params[:id])\n @addon.destroy\n respond_to do |format|\n format.html { redirect_to store_detail_addons_path(@store_detail), notice: 'addon detail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n delete_from_server single_url\n end", "def delete\n url = prefix + \"delete\"\n return response(url)\n end", "def delete\n url = prefix + \"delete\"\n return response(url)\n end", "def destroy\n @galaxies_elliptical_galaxy.destroy\n respond_to do |format|\n format.html { redirect_to galaxies_elliptical_galaxies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @grocery_item.destroy\n respond_to do |format|\n format.html { redirect_to grocery_items_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @data = @recipe.delete(params[:id])\n render json: @data\n end", "def destroy\n @gitem = Gitem.find(params[:id])\n @gitem.destroy\n\n respond_to do |format|\n format.html { redirect_to gitems_url }\n format.json { head :ok }\n end\n end", "def destroy\n @d_sale_item = DSaleItem.find(params[:id])\n #@d_sale_item.destroy\n\n respond_to do |format|\n format.html { redirect_to d_sale_items_url }\n format.json { head :ok }\n end\n end" ]
[ "0.7103534", "0.6975748", "0.6972588", "0.6972448", "0.6972448", "0.6972448", "0.6972448", "0.6964395", "0.6964395", "0.6964395", "0.6964395", "0.6918858", "0.6855227", "0.6850654", "0.6846446", "0.6846399", "0.68323153", "0.68154836", "0.6805286", "0.678241", "0.67671454", "0.67492694", "0.67469716", "0.6741814", "0.67302376", "0.6728738", "0.6709083", "0.6675368", "0.6667004", "0.66554815", "0.66554815", "0.66554815", "0.66554815", "0.66491365", "0.66491044", "0.6643557", "0.6625515", "0.6618197", "0.6610411", "0.6601789", "0.6593655", "0.65856516", "0.65796006", "0.65762573", "0.6574914", "0.6557485", "0.65482885", "0.65448755", "0.653075", "0.6503665", "0.6490145", "0.64842224", "0.6481075", "0.6462375", "0.6458856", "0.6455814", "0.6447348", "0.6431826", "0.6420178", "0.6419679", "0.6419143", "0.641883", "0.64177805", "0.6411167", "0.6406755", "0.6406281", "0.6401043", "0.639734", "0.6396406", "0.6386543", "0.6385057", "0.63844305", "0.6382669", "0.63817126", "0.63816553", "0.6379031", "0.63704836", "0.63700753", "0.6365449", "0.6365434", "0.6362506", "0.63621885", "0.63614166", "0.63593537", "0.6358942", "0.635204", "0.6349803", "0.6349803", "0.6349803", "0.6349803", "0.63492405", "0.634816", "0.63469625", "0.63461107", "0.63461107", "0.633542", "0.6334788", "0.63311875", "0.6330149", "0.6324545" ]
0.7445788
0
Use callbacks to share common setup or constraints between actions.
def set_drug_store @drug_store = DrugStore.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 drug_store_params params.require(:drug_store).permit(:name, :email, :web_page_url, :logo_img_url) 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
GET /user_game_levels GET /user_game_levels.json
def index @user_game_levels = UserGameLevel.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def levels\n response = JSON.parse(@client.get(\"/api/v1/levels\").body)\n return response[\"levels\"] || response\n end", "def get_levels\n if params[:levels_by_nf] == 'true'\n @foundation = Foundation.find_by(name: params[:name])\n if @foundation\n render json: {levels: @foundation.levels.pluck(:name)}, status: 200\n else\n render json: {\n levels: []\n }, status: 200\n end\n return\n end\n\n @foundation = Foundation.find_by(id: params[:id])\n if @foundation\n render template: 'levels/get_levels.json', status: 200\n else\n render json: {\n levels: []\n }, status: 200\n end\n end", "def index\n\t\tredirect_to(root_url) and return if current_user.nil?\n\n\t\t@levels = current_user.levels.all(:order => 'order_index DESC')\n\n\t\t#\n\t\t#@levels = Level.find(:all, :order => 'order_index')\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render :json => @levels }\n\t\tend\n\tend", "def index\n @levels = Level.where(:game_id => params[:game_id])\n @game = Game.find(params[:game_id])\n end", "def index\n @game_levels = GameLevel.all\n end", "def levels\n grant_id = params[:id]\n grant = Grant.find(grant_id)\n if grant == nil\n render :json => {}\n return\n end\n\n levels_array = []\n grant.funding_levels_csv.split(',').each do |token|\n limits = token.split(\"-\")\n if limits.length == 1\n limit = Integer(limits[0])\n levels_array.append([limit, limit])\n elsif limits.length == 2\n lower = Integer(limits[0])\n upper = Integer(limits[1])\n levels_array.append([lower, upper])\n end\n end\n\n # XXX: We're not supposed to be doing display formatting in the controller\n # like this.\n render :json => {\n pretty: funding_levels_pretty(grant),\n levels: levels_array\n }\n end", "def index\n @warp_user = Warp::User.find params[:user_id]\n @levels = @warp_user.levels\n #@warp_levels = Warp::Level.where user_id: @warp_user.id\n end", "def power_levels\n client.api.get_power_levels(id)\n end", "def index\n @levels = Level.order(:game_id)\n end", "def index\n @levels = Level.all\n end", "def index\n @levels = Level.all\n end", "def index\n @difficulty_levels = DifficultyLevel.all\n end", "def levels\n level_names = []\n properties[\"pages\"].each do |page|\n page[\"levels\"].each do |page_level_name|\n level_names << page_level_name\n end\n end\n\n Level.where(name: level_names)\n end", "def levels\n Access::Core.levels_hash.keys\n end", "def build_level(user)\n shell = user_science_level(user, @shell_science_id)\n shield = user_science_level(user, @shield_science_id)\n laser = user_science_level(user, @laser_science_id)\n ionen = user_science_level(user, @ionen_science_id)\n bomb = user_science_level(user, @bomb_science_id)\n pilot = user_science_level(user, @pilot_science_id)\n spy = user_science_level(user, @spy_science_id)\n return [shell, shield, laser, ionen, bomb, pilot, spy]\n end", "def build_level(user)\n shell=user_science_level(user, @shell_science_id)\n shield=user_science_level(user, @shield_science_id)\n laser=user_science_level(user, @laser_science_id)\n ionen=user_science_level(user, @ionen_science_id)\n bomb=user_science_level(user, @bomb_science_id)\n pilot=user_science_level(user, @pilot_science_id)\n spy=user_science_level(user, @spy_science_id)\n return [shell, shield, laser, ionen, bomb, pilot, spy]\n end", "def getLevels\n @level\n end", "def index\n unless @level.present?\n redirect_to @user.highest_repetition_level_unlocked.path\n return\n end\n @formatted_round_times = current_user&.round_times_for_level_id(@level.id) || []\n if current_user&.completed_repetition_level?(@level)\n @high_scores = @level.high_scores\n else\n @high_scores = []\n end\n render \"game_modes/repetition\"\n end", "def available_grade_levels_json\n params.require(:workspace_id)\n\n # schools\n school_ids = queries.supported_schools.map(&:id).select do |school_id|\n queries.is_authorized_for_school_id?(school_id)\n end\n schools_json = School.find(school_ids).as_json(only: [:id, :name])\n\n # grade levels (include if any of their schools would allow it)\n grade_levels_next_year = queries.supported_grade_levels_next_year.select do |grade_level_next_year|\n grade_level_now = GradeLevels.new.previous(grade_level_next_year)\n school_ids.any? {|school_id| queries.is_authorized_for_grade_level_now?(school_id, grade_level_now) }\n end\n\n render json: {\n schools: schools_json,\n grade_levels_next_year: grade_levels_next_year\n }\n end", "def levels\n @json[\"sleep\"].map {|sleep_json| sleep_json[\"levels\"][\"data\"]} # TODO what does it mean if there are more than one of these?\n end", "def get_access_levels(query_obj=nil)\n uri = URI.parse(@uri + \"/AccessLevels\")\n results = get(uri,query_obj)\n end", "def levels\n @levels ||= {}\n end", "def index\n @user_competency_levels = UserCompetencyLevel.all\n end", "def index\n @admin_levels = Admin::Level.all\n end", "def list_permission_levels\n pls = []\n PermissionLevel.order(\"value DESC\").each{|pl| \n if pl.value <= @user.permission_level.value\n pls << pl\n end\n }\n render :json => pls\n end", "def user_game_level_params\n params.require(:user_game_level).permit(:user_game_id, :game_level_id)\n end", "def levels(badge_name)\n badges.where(:name => badge_name).collect(&:level)\n end", "def complete_level\n if user_signed_in?\n current_user.completed_repetition_levels.create!(\n repetition_level_id: @level.id\n )\n end\n # TODO handle the very last level\n render json: {\n next: {\n href: @level.next_level.path,\n },\n high_scores: @level.high_scores.map do |user, score|\n [user.username, score]\n end\n }\n end", "def set_user_game_level\n @user_game_level = UserGameLevel.find(params[:id])\n end", "def data\n\t\t@levels = (params[:id].nil?) ? Level.all(:select => 'title,id', :order => 'order_index') : Level.find(params[:id], :select => 'title,id')\n\t\trespond_to do |format|\n\t\t\tformat.xml { render :xml => @levels }\n\t\t\tformat.json { render :json => @levels }\n\t\tend\n\tend", "def index\n @level = Level.find(params[:level_id])\n \n \n end", "def show\n @level = Level.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @level }\n end\n end", "def game\n @level = Level.find(params[:id])\n\n @items = []\n @tools = []\n State.all.each do |state| \n if state.state_category.name == \"Tools\"\n @tools << state\n else\n @items << state\n end\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @level }\n end\n end", "def index\n @skill_levels = SkillLevel.all\n end", "def recipebook\n @levels = Level.all\n\n respond_to do |format|\n format.html # recipebook.html.erb\n format.json { render json: @levels }\n end\n end", "def user_level_params\n params.require(:user_level).permit(:level)\n end", "def create\n @user_game_level = UserGameLevel.new(user_game_level_params)\n\n respond_to do |format|\n if @user_game_level.save\n format.html { redirect_to @user_game_level, notice: 'User game level was successfully created.' }\n format.json { render :show, status: :created, location: @user_game_level }\n else\n format.html { render :new }\n format.json { render json: @user_game_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n\n @sorter = LevelSorter.new(params)\n\n if @sorter.default?\n @featured_levels = [\n FeaturedLevel.newest,\n FeaturedLevel.hardest]\n @featured_levels << FeaturedLevel.random(:excluding => @featured_levels)\n\n @featured_levels.compact!\n end\n\n page_size = @sorter.default? ? 9 : 12\n\n @levels = Level.includes(:creator).\n order(\"#{@sorter.column} #{@sorter.direction}\").\n paginate(:page => params[:page], :per_page => page_size)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @levels }\n end\n end", "def levels_away_from_req(user, quest)\n difference = quest.level_requirement - user.total_level\n return difference.to_s\n end", "def index\n @health_levels = HealthLevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @health_levels }\n end\n end", "def system_portal_security_levels_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: PortalSecurityLevelsApi.system_portal_security_levels_get ...\"\n end\n # resource path\n local_var_path = \"/system/portalSecurityLevels\"\n\n # query parameters\n query_params = {}\n query_params[:'conditions'] = opts[:'conditions'] if !opts[:'conditions'].nil?\n query_params[:'orderBy'] = opts[:'order_by'] if !opts[:'order_by'].nil?\n query_params[:'childconditions'] = opts[:'childconditions'] if !opts[:'childconditions'].nil?\n query_params[:'customfieldconditions'] = opts[:'customfieldconditions'] if !opts[:'customfieldconditions'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].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\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 => 'Array<PortalSecurityLevel>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PortalSecurityLevelsApi#system_portal_security_levels_get\\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 @user_game_level.update(user_game_level_params)\n format.html { redirect_to @user_game_level, notice: 'User game level was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_game_level }\n else\n format.html { render :edit }\n format.json { render json: @user_game_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def user_levels(user, projects)\n # moved this case forward to shortcut project query execution\n return Access::Validate.levels([:owner]) if Access::Core.is_admin?(user)\n\n projects = Access::Validate.projects([projects])\n\n # always restricted to specified project(s)\n levels = Permission.where(project_id: projects)\n\n if Access::Core.is_guest?(user)\n # a guest user's permissions are only specified by :allow_logged_in\n levels = levels.where(user: nil, allow_logged_in: false, allow_anonymous: true)\n elsif !user.blank?\n # a logged in user can have their own permissions or\n # permissions specified by :allow_logged_in\n levels = levels.where('user_id = ? OR allow_logged_in IS TRUE', user.id)\n else\n raise ArgumentError, \"Invalid user to retrieve levels: '#{user}'.\"\n end\n\n levels = levels.pluck(:level)\n Access::Validate.levels(levels)\n end", "def index\n @reward_and_levels = RewardAndLevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reward_and_levels }\n end\n end", "def index\n @game = Game.find(current_user.game_setting_id || 1)\n authorize @game\n @levels = @game.levels\n @modes = @game.modes\n @strategies = @game.strategies\n @strategy = Strategy.new\n end", "def set_game_level\n @game_level = GameLevel.find(params[:id])\n end", "def list_access_levels request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_list_access_levels_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Identity::AccessContextManager::V1::ListAccessLevelsResponse.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def game_level_params\n params.require(:game_level).permit(:name, :level, :game_id, :description)\n end", "def level_items_list(type, levels)\n levels = levels.join(',') if levels.is_a?(Array)\n response = api_response(type, levels)\n\n # The vocabulary API call without specifying levels returns a Hash instead\n # of an Array, so this is a hacky way of dealing with it.\n if response[\"requested_information\"].is_a?(Hash)\n return response[\"requested_information\"][\"general\"]\n else\n return response[\"requested_information\"]\n end\n end", "def guild_achievements\r\n BnetApi::make_request('/wow/data/guild/achievements')\r\n end", "def grade_as_level\n User::GRADES[grade][:level]\n end", "def index\n @activity_levels = ActivityLevel.all\n end", "def getdifficulty\n @api.request 'getdifficulty'\n end", "def index\n @project_levels = ProjectLevel.all\n end", "def index\n @competency_levels = CompetencyLevel.all\n end", "def get_restriction_levels\n get_restrictions_data['levels']\n end", "def index\n @education_levels = EducationLevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @education_levels }\n end\n end", "def levels_chart_data\n data = ::Api::Charts::Sector.new(companies_scope(params)).companies_count_by_level\n\n render json: data.chart_json\n end", "def find_level\n determine_level(self.experience_points, self.user_quests.where(complete: true))\n end", "def list_groups\n if @user.permission_level.value == PermissionLevel.order(\"value DESC\").first.value\n render :json => Group.find(:all).map{|g| g}\n else\n render :json => @user.groups.map{|g| g}\n end\n end", "def show\n @admin_level = AdminLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_level }\n end\n end", "def game_status\n results = {}\n @room = @room = current_user.rooms.find(params[:id])\n @users = @room.users\n results = @room.to_json\n game_status = @room.game_status\n respond_to do |format|\n format.json { render json: game_status }\n end\n end", "def user_risk_levels\n return @user_risk_levels\n end", "def show\n\n\t\t@level = Level.find(params[:id])\n\n\t\t# Don't incriment titlescreen count\n\t\tif(@level.title != APP_CONFIG[\"DEFAULTS\"][\"TITLE_SCREEN_LEVEL\"])\n\t\t\t@level.update_attribute(:times_played, @level.times_played+1)\n\t\tend\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.js {\n\t\t\t\t# Make a key for the user to be able to submit a score once they're done\n\t\t\t\tunless current_user.nil?\n\t\t\t\t\tkey = EzCrypto::Key.with_password(APP_CONFIG[\"SECRET\"][\"TOKEN\"], params[:id], :algorithm => 'blowfish')\n\t\t\t\t\tcurrent_user.ScoreHash = key.encrypt64(Time.now.to_i.to_s)\n\t\t\t\t\tcurrent_user.save\n\t\t\t\tend\n\t\t\t\trender :json => @level.json\n\t\t\t}\n\t\tend\n\tend", "def index\n @app_user_satisfaction_levels = AppUserSatisfactionLevel.all\n end", "def user_reach_level(achievement, user)\n user_tree = TreeService::UserTreeFetcher.new(user, nil)\n user_tree.depth == achievement.settings['level']\n end", "def current_user_level\n current_user.level\n end", "def get_level(msg)\n player = verify_player msg\n return unless player\n msg.reply \"#{player.name} is level #{player.level}.\"\n end", "def index\n @level_progrations = LevelProgration.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @level_progrations }\n end\n end", "def set_level\n @level = Level.find(params[:id])\n @game = @level.game\n end", "def getdifficulty\n request :getdifficulty\n end", "def user_params\n params.require(:user).permit(:level)\n end", "def difficulty\n request('getdifficulty')\n end", "def show\n @level = Level.find(params[:id])\n authorize! :show, @level, :message => 'Acceso denegado.'\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @level }\n end\n end", "def level\r\n\tif $lvl == 1\r\n\t\tlevel2\r\n\telse \r\n\t\tif $lvl == 2\r\n\t\t\tlevel3\r\n\t\telse\r\n\t\t\tif $lvl == 3\r\n\t\t\t\tlevel4\r\n\t\t\tend\r\n\t\tend\t\r\n\tend\t\r\nend", "def levels_cache\n @_levels_cache ||= begin\n new_cache = Hash.new do |hash, key|\n hash[key] = level_for_context(key)\n end\n self.levels.each { |k, v| new_cache[k] = v }\n # Ensure there is always a default fallback\n new_cache[nil] = :info unless new_cache.include?(nil)\n new_cache\n end\n end", "def user_science_level(user, id)\n return user.science_instances.find_by(science_id: id).level\n end", "def user_science_level(user, id)\n return user.science_instances.find_by(science_id: id).level\n end", "def system_portal_security_levels_get(opts = {})\n data, _status_code, _headers = system_portal_security_levels_get_with_http_info(opts)\n return data\n end", "def get_level(key)\n case key\n when \"L\", \"l\" then 0 # Level L\n when \"M\", \"m\" then 1 # Level M\n when \"Q\", \"q\" then 2 # Level Q\n when \"H\", \"h\" then 3 # Level H\n end\n end", "def destroy\n @user_game_level.destroy\n respond_to do |format|\n format.html { redirect_to user_game_levels_url }\n format.json { head :no_content }\n end\n end", "def create\n @game_level = GameLevel.new(game_level_params)\n\n respond_to do |format|\n if @game_level.save\n format.html { redirect_to @game_level, notice: 'Game level was successfully created.' }\n format.json { render :show, status: :created, location: @game_level }\n else\n format.html { render :new }\n format.json { render json: @game_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def home\n check_medals()\n\n assert(current_user.kind_of?(User))\n \n return find_level(current_user.points)\n end", "def character_achievements\r\n BnetApi::make_request('/wow/data/character/achievements')\r\n end", "def set_user_level\n @user_level = UserLevel.find(params[:id])\n end", "def assessments_levels_chart_data\n data = ::Api::Charts::MQAssessment.new(\n @mq_assessment,\n enable_beta_mq_assessments: @company.show_beta_mq_assessments\n ).assessments_levels_data\n\n render json: data.chart_json\n end", "def new\n @level = Level.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @level }\n end\n end", "def new\n @level = Level.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @level }\n end\n end", "def new\n @level = Level.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @level }\n end\n end", "def set_level\n @level =\n if params.include? :key\n Level.find_by_key params[:key]\n else\n Level.find(params[:id])\n end\n @game = @level.game\n end", "def levels(levels)\n # need to keep nils, so don't remove them\n\n # flatten nested arrays\n levels = [levels].flatten\n\n # make array of levels unique and validate each\n # return the array of validated levels\n levels.uniq.map { |i| Access::Validate.level(i) }\n end", "def check_level_param\n if (!params[:level].blank? && params[:level].to_i.to_s == params[:level] && User.valid_level?(params[:level].to_i))\n @level = params[:level].to_i\n end\n\n return @level\n end", "def create\n @level = Level.new(level_params)\n sess = PlaySession.where(id:@level.session_id).first\n if(!sess)\n render :status => :bad_request, :text => \"Unknown session\" and return\n end\n respond_to do |format|\n if @level.save\n format.html { redirect_to @level, notice: 'Level was successfully created.' }\n format.json { render action: 'show', status: :created, location: @level }\n else\n format.html { render action: 'new' }\n format.json { render json: @level.errors, status: :unprocessable_entity }\n end\n end\n end", "def check_level\n if current_user.role_id == 1 || current_user.role_id == 2\n @the_client_id = params[:client_id]\n the_num = User.where(client_id: @the_client_id).count()\n payment_id = ClientInfo.where(id: @the_client_id).pluck(:payment_type)[0]\n the_set_count = PaymentType.where(id: payment_id).pluck(:users)[0]\n if the_set_count <= the_num\n respond_to do |format|\n format.html { redirect_to client_user_list_path, alert: 'Sorry! Client has exhausted his allowance, he should upgrade his package.' }\n end\n end\n else\n @the_client_id = current_user.client_id\n the_num = User.where(client_id: @the_client_id).count()\n payment_id = ClientInfo.where(id: @the_client_id).pluck(:payment_type)[0]\n the_set_count = PaymentType.where(id: payment_id).pluck(:users)[0]\n if the_set_count <= the_num\n respond_to do |format|\n format.html { redirect_to client_users_path, alert: 'Sorry! You have exhausted your allowance, please upgrade your package.' }\n end\n end\n end\n end", "def user_risk_levels=(value)\n @user_risk_levels = value\n end", "def user_only_levels(user, projects)\n projects = Access::Validate.projects([projects])\n raise ArgumentError, 'Must provide a user, nil is not valid.' if Access::Core.is_guest?(user)\n\n levels = Permission\n .where(project_id: projects)\n .where('user_id = ?', user.id)\n .pluck(:level)\n\n Access::Validate.levels(levels)\n end", "def index\n @phase_levels = PhaseLevel.all\n end", "def index\n if(params[:level_id] == nil)\n @replays = Replay.all(:order => 'level_id, score DESC')\n else\n @replays = Replay.where(:level_id => params[:level_id]).order(:score).reverse_order\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @replays }\n end\n end", "def index\n @referee_levels = RefereeLevel.all\n end", "def index\n @college_levels = CollegeLevel.all\n\n end" ]
[ "0.7679649", "0.74169904", "0.7085923", "0.69168246", "0.6909223", "0.67923754", "0.67761004", "0.6735388", "0.6557576", "0.6480894", "0.6480894", "0.64552176", "0.6388151", "0.63154495", "0.6302286", "0.6289503", "0.628408", "0.62678546", "0.62046224", "0.6203519", "0.6202161", "0.6186269", "0.6164321", "0.61629945", "0.61216146", "0.61187255", "0.61070406", "0.6061459", "0.60186297", "0.5963861", "0.59392655", "0.5881575", "0.58788085", "0.5876922", "0.5863967", "0.58456886", "0.58338284", "0.58099324", "0.5784621", "0.57397693", "0.5729629", "0.571681", "0.5664537", "0.56290036", "0.5611893", "0.5595589", "0.55872756", "0.5587026", "0.55813813", "0.5574441", "0.5551695", "0.5549417", "0.5549023", "0.55413973", "0.55396026", "0.55331874", "0.5518636", "0.5516442", "0.5514347", "0.5514201", "0.5503076", "0.5502341", "0.54988503", "0.54957134", "0.5486372", "0.54800546", "0.5479616", "0.54700184", "0.54656124", "0.5460001", "0.54565513", "0.54502106", "0.5449883", "0.54469246", "0.5430885", "0.5422114", "0.54203", "0.54203", "0.5404191", "0.5396316", "0.5393197", "0.53653264", "0.53650284", "0.5359774", "0.5349814", "0.5342991", "0.53377694", "0.5336811", "0.53367966", "0.5331211", "0.53280056", "0.5322088", "0.52996415", "0.52992785", "0.5299171", "0.5297098", "0.5294548", "0.52925724", "0.5289262", "0.52696186" ]
0.74439305
1
GET /user_game_levels/1 GET /user_game_levels/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def levels\n response = JSON.parse(@client.get(\"/api/v1/levels\").body)\n return response[\"levels\"] || response\n end", "def get_levels\n if params[:levels_by_nf] == 'true'\n @foundation = Foundation.find_by(name: params[:name])\n if @foundation\n render json: {levels: @foundation.levels.pluck(:name)}, status: 200\n else\n render json: {\n levels: []\n }, status: 200\n end\n return\n end\n\n @foundation = Foundation.find_by(id: params[:id])\n if @foundation\n render template: 'levels/get_levels.json', status: 200\n else\n render json: {\n levels: []\n }, status: 200\n end\n end", "def index\n @user_game_levels = UserGameLevel.all\n end", "def index\n @levels = Level.where(:game_id => params[:game_id])\n @game = Game.find(params[:game_id])\n end", "def index\n\t\tredirect_to(root_url) and return if current_user.nil?\n\n\t\t@levels = current_user.levels.all(:order => 'order_index DESC')\n\n\t\t#\n\t\t#@levels = Level.find(:all, :order => 'order_index')\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render :json => @levels }\n\t\tend\n\tend", "def index\n @game_levels = GameLevel.all\n end", "def index\n @warp_user = Warp::User.find params[:user_id]\n @levels = @warp_user.levels\n #@warp_levels = Warp::Level.where user_id: @warp_user.id\n end", "def index\n @levels = Level.order(:game_id)\n end", "def index\n @difficulty_levels = DifficultyLevel.all\n end", "def levels\n grant_id = params[:id]\n grant = Grant.find(grant_id)\n if grant == nil\n render :json => {}\n return\n end\n\n levels_array = []\n grant.funding_levels_csv.split(',').each do |token|\n limits = token.split(\"-\")\n if limits.length == 1\n limit = Integer(limits[0])\n levels_array.append([limit, limit])\n elsif limits.length == 2\n lower = Integer(limits[0])\n upper = Integer(limits[1])\n levels_array.append([lower, upper])\n end\n end\n\n # XXX: We're not supposed to be doing display formatting in the controller\n # like this.\n render :json => {\n pretty: funding_levels_pretty(grant),\n levels: levels_array\n }\n end", "def index\n @levels = Level.all\n end", "def index\n @levels = Level.all\n end", "def power_levels\n client.api.get_power_levels(id)\n end", "def show\n @level = Level.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @level }\n end\n end", "def index\n unless @level.present?\n redirect_to @user.highest_repetition_level_unlocked.path\n return\n end\n @formatted_round_times = current_user&.round_times_for_level_id(@level.id) || []\n if current_user&.completed_repetition_level?(@level)\n @high_scores = @level.high_scores\n else\n @high_scores = []\n end\n render \"game_modes/repetition\"\n end", "def index\n @level = Level.find(params[:level_id])\n \n \n end", "def complete_level\n if user_signed_in?\n current_user.completed_repetition_levels.create!(\n repetition_level_id: @level.id\n )\n end\n # TODO handle the very last level\n render json: {\n next: {\n href: @level.next_level.path,\n },\n high_scores: @level.high_scores.map do |user, score|\n [user.username, score]\n end\n }\n end", "def set_user_game_level\n @user_game_level = UserGameLevel.find(params[:id])\n end", "def index\n @admin_levels = Admin::Level.all\n end", "def game\n @level = Level.find(params[:id])\n\n @items = []\n @tools = []\n State.all.each do |state| \n if state.state_category.name == \"Tools\"\n @tools << state\n else\n @items << state\n end\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @level }\n end\n end", "def data\n\t\t@levels = (params[:id].nil?) ? Level.all(:select => 'title,id', :order => 'order_index') : Level.find(params[:id], :select => 'title,id')\n\t\trespond_to do |format|\n\t\t\tformat.xml { render :xml => @levels }\n\t\t\tformat.json { render :json => @levels }\n\t\tend\n\tend", "def levels\n @json[\"sleep\"].map {|sleep_json| sleep_json[\"levels\"][\"data\"]} # TODO what does it mean if there are more than one of these?\n end", "def index\n @user_competency_levels = UserCompetencyLevel.all\n end", "def show\n @admin_level = AdminLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_level }\n end\n end", "def create\n @user_game_level = UserGameLevel.new(user_game_level_params)\n\n respond_to do |format|\n if @user_game_level.save\n format.html { redirect_to @user_game_level, notice: 'User game level was successfully created.' }\n format.json { render :show, status: :created, location: @user_game_level }\n else\n format.html { render :new }\n format.json { render json: @user_game_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def user_game_level_params\n params.require(:user_game_level).permit(:user_game_id, :game_level_id)\n end", "def available_grade_levels_json\n params.require(:workspace_id)\n\n # schools\n school_ids = queries.supported_schools.map(&:id).select do |school_id|\n queries.is_authorized_for_school_id?(school_id)\n end\n schools_json = School.find(school_ids).as_json(only: [:id, :name])\n\n # grade levels (include if any of their schools would allow it)\n grade_levels_next_year = queries.supported_grade_levels_next_year.select do |grade_level_next_year|\n grade_level_now = GradeLevels.new.previous(grade_level_next_year)\n school_ids.any? {|school_id| queries.is_authorized_for_grade_level_now?(school_id, grade_level_now) }\n end\n\n render json: {\n schools: schools_json,\n grade_levels_next_year: grade_levels_next_year\n }\n end", "def recipebook\n @levels = Level.all\n\n respond_to do |format|\n format.html # recipebook.html.erb\n format.json { render json: @levels }\n end\n end", "def index\n @health_levels = HealthLevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @health_levels }\n end\n end", "def build_level(user)\n shell = user_science_level(user, @shell_science_id)\n shield = user_science_level(user, @shield_science_id)\n laser = user_science_level(user, @laser_science_id)\n ionen = user_science_level(user, @ionen_science_id)\n bomb = user_science_level(user, @bomb_science_id)\n pilot = user_science_level(user, @pilot_science_id)\n spy = user_science_level(user, @spy_science_id)\n return [shell, shield, laser, ionen, bomb, pilot, spy]\n end", "def build_level(user)\n shell=user_science_level(user, @shell_science_id)\n shield=user_science_level(user, @shield_science_id)\n laser=user_science_level(user, @laser_science_id)\n ionen=user_science_level(user, @ionen_science_id)\n bomb=user_science_level(user, @bomb_science_id)\n pilot=user_science_level(user, @pilot_science_id)\n spy=user_science_level(user, @spy_science_id)\n return [shell, shield, laser, ionen, bomb, pilot, spy]\n end", "def set_game_level\n @game_level = GameLevel.find(params[:id])\n end", "def levels\n level_names = []\n properties[\"pages\"].each do |page|\n page[\"levels\"].each do |page_level_name|\n level_names << page_level_name\n end\n end\n\n Level.where(name: level_names)\n end", "def getdifficulty\n @api.request 'getdifficulty'\n end", "def levels\n Access::Core.levels_hash.keys\n end", "def getLevels\n @level\n end", "def show\n\n\t\t@level = Level.find(params[:id])\n\n\t\t# Don't incriment titlescreen count\n\t\tif(@level.title != APP_CONFIG[\"DEFAULTS\"][\"TITLE_SCREEN_LEVEL\"])\n\t\t\t@level.update_attribute(:times_played, @level.times_played+1)\n\t\tend\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.js {\n\t\t\t\t# Make a key for the user to be able to submit a score once they're done\n\t\t\t\tunless current_user.nil?\n\t\t\t\t\tkey = EzCrypto::Key.with_password(APP_CONFIG[\"SECRET\"][\"TOKEN\"], params[:id], :algorithm => 'blowfish')\n\t\t\t\t\tcurrent_user.ScoreHash = key.encrypt64(Time.now.to_i.to_s)\n\t\t\t\t\tcurrent_user.save\n\t\t\t\tend\n\t\t\t\trender :json => @level.json\n\t\t\t}\n\t\tend\n\tend", "def list_permission_levels\n pls = []\n PermissionLevel.order(\"value DESC\").each{|pl| \n if pl.value <= @user.permission_level.value\n pls << pl\n end\n }\n render :json => pls\n end", "def levels\n @levels ||= {}\n end", "def update\n respond_to do |format|\n if @user_game_level.update(user_game_level_params)\n format.html { redirect_to @user_game_level, notice: 'User game level was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_game_level }\n else\n format.html { render :edit }\n format.json { render json: @user_game_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @skill_levels = SkillLevel.all\n end", "def set_level\n @level = Level.find(params[:id])\n @game = @level.game\n end", "def show\n @level = Level.find(params[:id])\n authorize! :show, @level, :message => 'Acceso denegado.'\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @level }\n end\n end", "def get_access_levels(query_obj=nil)\n uri = URI.parse(@uri + \"/AccessLevels\")\n results = get(uri,query_obj)\n end", "def index\n @game = Game.find(current_user.game_setting_id || 1)\n authorize @game\n @levels = @game.levels\n @modes = @game.modes\n @strategies = @game.strategies\n @strategy = Strategy.new\n end", "def new\n @level = Level.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @level }\n end\n end", "def new\n @level = Level.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @level }\n end\n end", "def new\n @level = Level.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @level }\n end\n end", "def difficulty\n request('getdifficulty')\n end", "def show\n @level = Level.find(params[:id])\n Level.increment_counter :view_count, @level.id\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @level }\n end\n end", "def getdifficulty\n request :getdifficulty\n end", "def levels(badge_name)\n badges.where(:name => badge_name).collect(&:level)\n end", "def index\n @reward_and_levels = RewardAndLevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reward_and_levels }\n end\n end", "def show\n @level_category = LevelCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @level_category }\n end\n end", "def index\n\n @sorter = LevelSorter.new(params)\n\n if @sorter.default?\n @featured_levels = [\n FeaturedLevel.newest,\n FeaturedLevel.hardest]\n @featured_levels << FeaturedLevel.random(:excluding => @featured_levels)\n\n @featured_levels.compact!\n end\n\n page_size = @sorter.default? ? 9 : 12\n\n @levels = Level.includes(:creator).\n order(\"#{@sorter.column} #{@sorter.direction}\").\n paginate(:page => params[:page], :per_page => page_size)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @levels }\n end\n end", "def set_level\n @level =\n if params.include? :key\n Level.find_by_key params[:key]\n else\n Level.find(params[:id])\n end\n @game = @level.game\n end", "def create\n @level = Level.new(level_params)\n sess = PlaySession.where(id:@level.session_id).first\n if(!sess)\n render :status => :bad_request, :text => \"Unknown session\" and return\n end\n respond_to do |format|\n if @level.save\n format.html { redirect_to @level, notice: 'Level was successfully created.' }\n format.json { render action: 'show', status: :created, location: @level }\n else\n format.html { render action: 'new' }\n format.json { render json: @level.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @level_goal = LevelGoal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @level_goal }\n end\n end", "def show\n @training_level = TrainingLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @training_level }\n end\n end", "def game_status\n results = {}\n @room = @room = current_user.rooms.find(params[:id])\n @users = @room.users\n results = @room.to_json\n game_status = @room.game_status\n respond_to do |format|\n format.json { render json: game_status }\n end\n end", "def user_level_params\n params.require(:user_level).permit(:level)\n end", "def create\n @game_level = GameLevel.new(game_level_params)\n\n respond_to do |format|\n if @game_level.save\n format.html { redirect_to @game_level, notice: 'Game level was successfully created.' }\n format.json { render :show, status: :created, location: @game_level }\n else\n format.html { render :new }\n format.json { render json: @game_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def game_level_params\n params.require(:game_level).permit(:name, :level, :game_id, :description)\n end", "def system_portal_security_levels_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: PortalSecurityLevelsApi.system_portal_security_levels_get ...\"\n end\n # resource path\n local_var_path = \"/system/portalSecurityLevels\"\n\n # query parameters\n query_params = {}\n query_params[:'conditions'] = opts[:'conditions'] if !opts[:'conditions'].nil?\n query_params[:'orderBy'] = opts[:'order_by'] if !opts[:'order_by'].nil?\n query_params[:'childconditions'] = opts[:'childconditions'] if !opts[:'childconditions'].nil?\n query_params[:'customfieldconditions'] = opts[:'customfieldconditions'] if !opts[:'customfieldconditions'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].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\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 => 'Array<PortalSecurityLevel>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PortalSecurityLevelsApi#system_portal_security_levels_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @activity_levels = ActivityLevel.all\n end", "def index\n @education_levels = EducationLevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @education_levels }\n end\n end", "def show\n @level_container = LevelContainer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @level_container }\n end\n end", "def levels_away_from_req(user, quest)\n difference = quest.level_requirement - user.total_level\n return difference.to_s\n end", "def index\n @competency_levels = CompetencyLevel.all\n end", "def index\n @level_progrations = LevelProgration.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @level_progrations }\n end\n end", "def destroy\n @user_game_level.destroy\n respond_to do |format|\n format.html { redirect_to user_game_levels_url }\n format.json { head :no_content }\n end\n end", "def level_items_list(type, levels)\n levels = levels.join(',') if levels.is_a?(Array)\n response = api_response(type, levels)\n\n # The vocabulary API call without specifying levels returns a Hash instead\n # of an Array, so this is a hacky way of dealing with it.\n if response[\"requested_information\"].is_a?(Hash)\n return response[\"requested_information\"][\"general\"]\n else\n return response[\"requested_information\"]\n end\n end", "def guild_achievements\r\n BnetApi::make_request('/wow/data/guild/achievements')\r\n end", "def index\n @project_levels = ProjectLevel.all\n end", "def new\n @level = Level.new\n @level.set_defaults\n bingo!(\"create_level_button\")\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @level }\n end\n end", "def new\n @admin_level = AdminLevel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_level }\n end\n end", "def grade_as_level\n User::GRADES[grade][:level]\n end", "def get_level(msg)\n player = verify_player msg\n return unless player\n msg.reply \"#{player.name} is level #{player.level}.\"\n end", "def check_level_param\n if (!params[:level].blank? && params[:level].to_i.to_s == params[:level] && User.valid_level?(params[:level].to_i))\n @level = params[:level].to_i\n end\n\n return @level\n end", "def last_attempt_for_any(levels, script_id: nil)\n level_ids = levels.pluck(:id)\n conditions = {\n user_id: id,\n level_id: level_ids\n }\n conditions[:script_id] = script_id unless script_id.nil?\n UserLevel.where(conditions).\n order('updated_at DESC').\n first\n end", "def set_user_level\n @user_level = UserLevel.find(params[:id])\n end", "def level\r\n\tif $lvl == 1\r\n\t\tlevel2\r\n\telse \r\n\t\tif $lvl == 2\r\n\t\t\tlevel3\r\n\t\telse\r\n\t\t\tif $lvl == 3\r\n\t\t\t\tlevel4\r\n\t\t\tend\r\n\t\tend\t\r\n\tend\t\r\nend", "def index\n if(params[:level_id] == nil)\n @replays = Replay.all(:order => 'level_id, score DESC')\n else\n @replays = Replay.where(:level_id => params[:level_id]).order(:score).reverse_order\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @replays }\n end\n end", "def set_level\n @level = Level.find(params[:id])\n end", "def show\n @orthodb_level = OrthodbLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @orthodb_level }\n end\n end", "def update\n respond_to do |format|\n if @game_level.update(game_level_params)\n format.html { redirect_to @game_level, notice: 'Game level was successfully updated.' }\n format.json { render :show, status: :ok, location: @game_level }\n else\n format.html { render :edit }\n format.json { render json: @game_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def find_level\n determine_level(self.experience_points, self.user_quests.where(complete: true))\n end", "def level_type\n @api_response['type']\n end", "def create\n if admin?\n @level = Level.new(level_params)\n\n respond_to do |format|\n if @level.save\n format.html { redirect_to @level, notice: 'Level was successfully created.' }\n format.json { render :show, status: :created, location: @level }\n else\n format.html { render :new }\n format.json { render json: @level.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "def show\n @educational_level = EducationalLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @educational_level }\n end\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @health_level }\n end\n end", "def create\n @level = Level.new(params[:level])\n\n respond_to do |format|\n if @level.save\n format.html { redirect_to @level, notice: 'Level was successfully created.' }\n format.json { render json: @level, status: :created, location: @level }\n else\n format.html { render action: \"new\" }\n format.json { render json: @level.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @level = Level.new(params[:level])\n\n respond_to do |format|\n if @level.save\n format.html { redirect_to @level, notice: 'Level was successfully created.' }\n format.json { render json: @level, status: :created, location: @level }\n else\n format.html { render action: \"new\" }\n format.json { render json: @level.errors, status: :unprocessable_entity }\n end\n end\n end", "def current_user_level\n current_user.level\n end", "def get_level(key)\n case key\n when \"L\", \"l\" then 0 # Level L\n when \"M\", \"m\" then 1 # Level M\n when \"Q\", \"q\" then 2 # Level Q\n when \"H\", \"h\" then 3 # Level H\n end\n end", "def list_groups\n if @user.permission_level.value == PermissionLevel.order(\"value DESC\").first.value\n render :json => Group.find(:all).map{|g| g}\n else\n render :json => @user.groups.map{|g| g}\n end\n end", "def new\n @level_container = LevelContainer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @level_container }\n end\n end", "def user_science_level(user, id)\n return user.science_instances.find_by(science_id: id).level\n end", "def user_science_level(user, id)\n return user.science_instances.find_by(science_id: id).level\n end", "def new\n @user = User.new\n\n # If a valid level is received, apply to the user to create.\n check_level_param\n @user.level = @level if(!@level.blank?)\n\n respond_to do |format|\n format.html\n end\n end", "def show\n @user = User.find_by_id(params[:id])\n\n if @user\n render json: @user.to_json(include: [:games]), status: 200\n else\n render json: {error: \"User not found\"}, status: 404\n end\n end" ]
[ "0.7429315", "0.7391055", "0.7305927", "0.7098908", "0.69656956", "0.6920374", "0.677276", "0.6653614", "0.65859896", "0.65767497", "0.6520773", "0.6520773", "0.6509786", "0.6464133", "0.6360373", "0.6352174", "0.6283946", "0.62469923", "0.6162511", "0.61332774", "0.6114295", "0.61127025", "0.6078401", "0.60415804", "0.6039304", "0.6038617", "0.6034", "0.60334444", "0.6029449", "0.6028523", "0.60152346", "0.60056645", "0.60017", "0.59833586", "0.59790045", "0.597892", "0.5976819", "0.5975504", "0.5947137", "0.59347546", "0.5929252", "0.5926932", "0.5918188", "0.58988047", "0.5896751", "0.5890626", "0.58899146", "0.58899075", "0.58505595", "0.585047", "0.58365685", "0.5808818", "0.57946414", "0.5783179", "0.5759273", "0.57423383", "0.57363003", "0.57331353", "0.57139844", "0.57134134", "0.5704181", "0.5700454", "0.5698853", "0.56841516", "0.5682348", "0.5677474", "0.5661543", "0.5657911", "0.56328106", "0.56324446", "0.56088865", "0.5607215", "0.55992323", "0.55941385", "0.5593266", "0.55899525", "0.5582753", "0.5578154", "0.5576756", "0.5552303", "0.55511236", "0.554694", "0.55428046", "0.55401033", "0.55393785", "0.5536136", "0.55349493", "0.55007344", "0.5491002", "0.54897803", "0.5487266", "0.54689217", "0.54689217", "0.54623973", "0.5460645", "0.54564613", "0.5451568", "0.5428271", "0.5428271", "0.5425117", "0.5419639" ]
0.0
-1
POST /user_game_levels POST /user_game_levels.json
def create @user_game_level = UserGameLevel.new(user_game_level_params) respond_to do |format| if @user_game_level.save format.html { redirect_to @user_game_level, notice: 'User game level was successfully created.' } format.json { render :show, status: :created, location: @user_game_level } else format.html { render :new } format.json { render json: @user_game_level.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_game_level_params\n params.require(:user_game_level).permit(:user_game_id, :game_level_id)\n end", "def create\n @game_level = GameLevel.new(game_level_params)\n\n respond_to do |format|\n if @game_level.save\n format.html { redirect_to @game_level, notice: 'Game level was successfully created.' }\n format.json { render :show, status: :created, location: @game_level }\n else\n format.html { render :new }\n format.json { render json: @game_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def user_level_params\n params.require(:user_level).permit(:level)\n end", "def create\n if admin?\n @level = Level.new(level_params)\n\n respond_to do |format|\n if @level.save\n format.html { redirect_to @level, notice: 'Level was successfully created.' }\n format.json { render :show, status: :created, location: @level }\n else\n format.html { render :new }\n format.json { render json: @level.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "def complete_level\n if user_signed_in?\n current_user.completed_repetition_levels.create!(\n repetition_level_id: @level.id\n )\n end\n # TODO handle the very last level\n render json: {\n next: {\n href: @level.next_level.path,\n },\n high_scores: @level.high_scores.map do |user, score|\n [user.username, score]\n end\n }\n end", "def game_level_params\n params.require(:game_level).permit(:name, :level, :game_id, :description)\n end", "def create\n @level = Level.new(params[:level])\n\n respond_to do |format|\n if @level.save\n format.html { redirect_to @level, notice: 'Level was successfully created.' }\n format.json { render json: @level, status: :created, location: @level }\n else\n format.html { render action: \"new\" }\n format.json { render json: @level.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @level = Level.new(params[:level])\n\n respond_to do |format|\n if @level.save\n format.html { redirect_to @level, notice: 'Level was successfully created.' }\n format.json { render json: @level, status: :created, location: @level }\n else\n format.html { render action: \"new\" }\n format.json { render json: @level.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n authorize! :create, :level\n type_class = level_params[:type].constantize\n\n # Set some defaults.\n params[:level].reverse_merge!(skin: type_class.skins.first) if type_class <= Blockly\n if type_class <= Grid\n params[:level][:maze_data] = Array.new(8){Array.new(8){0}}\n params[:level][:maze_data][0][0] = 2\n end\n if type_class <= Studio\n params[:level][:maze_data][0][0] = 16 # studio must have at least 1 actor\n params[:level][:soft_buttons] = nil\n params[:level][:timeout_after_when_run] = true\n params[:level][:success_condition] = Studio.default_success_condition\n params[:level][:failure_condition] = Studio.default_failure_condition\n end\n params[:level][:maze_data] = params[:level][:maze_data].to_json if type_class <= Grid\n params.merge!(user: current_user)\n\n begin\n @level = type_class.create_from_level_builder(params, level_params)\n rescue ArgumentError => e\n render status: :not_acceptable, text: e.message and return\n rescue ActiveRecord::RecordInvalid => invalid\n render status: :not_acceptable, text: invalid and return\n end\n\n render json: { redirect: edit_level_path(@level) }\n end", "def create\n @level = Level.new(level_params)\n sess = PlaySession.where(id:@level.session_id).first\n if(!sess)\n render :status => :bad_request, :text => \"Unknown session\" and return\n end\n respond_to do |format|\n if @level.save\n format.html { redirect_to @level, notice: 'Level was successfully created.' }\n format.json { render action: 'show', status: :created, location: @level }\n else\n format.html { render action: 'new' }\n format.json { render json: @level.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @admin_level = Admin::Level.new(admin_level_params)\n\n respond_to do |format|\n if @admin_level.save\n format.html { redirect_to edit_admin_level_path(@admin_level), notice: 'Level was successfully created.' }\n format.json { render :show, status: :created, location: @admin_level }\n else\n format.html { render :new }\n format.json { render json: @admin_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def final_form\n @user = User.find params[:user_id]\n @assessment = Assessment.find params[:assessment_id]\n\n # To accumulate levels\n level_name = @user.level.name\n beginner_id = Level.find_by(name: 'beginner').id\n specialist_id = Level.find_by(name: 'specialist').id\n master_id = Level.find_by(name: 'master').id\n expert_id = Level.find_by(name: 'expert').id\n\n session[:levels] = []\n case level_name\n when 'beginner'\n session[:levels] = [beginner_id, specialist_id, master_id, expert_id]\n when 'specialist'\n session[:levels] = [specialist_id, master_id, expert_id]\n when 'master'\n session[:levels] = [master_id, expert_id]\n when 'expert'\n session[:levels] = [expert_id]\n else\n # nothing here\n puts \"ZT-Error! incorrect Level name (assessments/new)\"\n end\n end", "def create\n authorize! :create, :level\n type_class = level_params[:type].constantize\n\n # Set some defaults.\n params[:level].reverse_merge!(skin: type_class.skins.first) if type_class <= Blockly\n params.merge!(user: current_user)\n\n begin\n @level = type_class.create_from_level_builder(params, level_params)\n rescue ArgumentError => e\n render status: :not_acceptable, text: e.message and return\n rescue ActiveRecord::RecordInvalid => invalid\n render status: :not_acceptable, text: invalid and return\n end\n\n render json: { redirect: level_url(@level) }.to_json\n end", "def create\n\n score = params[:score].to_i\n recording = ActiveSupport::JSON.decode(params[:record])\n # One of the entries in the record has a greater time than the score they're trying to submit\n\t\trecording.each do |record|\n\t\t\tif record['t'].to_i > score\n\t\t\t\trender :json => ['notice' => 'Error 503', 'status' => false] and return\n\t\t\tend\n end\n\n # Made it far enough to count as valid, increment times completed\n\t\t@level = Level.find(params[:level_id])\n @level.update_attribute(:times_completed, @level.times_completed+1)\n\n\n\t\trender(:json => [\"notice\" => \"Not signed in\", \"status\" => false]) and return unless current_user\n\t\trender(:json => [\"notice\" => \"Error 504\", \"status\" => false]) and return unless current_user.ScoreHash != \"\"\n\n\t\tscore_hash = current_user.ScoreHash\n\n\t\t# Remove the hash from the user so they can't resubmit for this level\n\t\tcurrent_user.update_attribute(:ScoreHash, \"\")\n\n\t\t# Check that they have a valid hash - uses the current_user.ScoreHash to decrypt the string\n\t\tbegin\n\t\t\tkey = EzCrypto::Key.with_password(APP_CONFIG[\"SECRET\"][\"TOKEN\"], params[:level_id], :algorithm => 'blowfish')\n\t\t\trequest_time = key.decrypt64(score_hash)\n\t\t\tputs \"RequestTime\" << request_time\n\t\t\tlevel_request_time = Time.at(request_time.to_i)\n\t\trescue Exception=>e\n\t\t\trender :json => ['notice' => 'Error 501', 'status' => false] and return\n\t\tend\n\n\n\n\t\t# Only 3 or less recording states - this is pretty impossible co\n\t\trender(:json => [\"notice\" => \"Error 505\", \"status\" => false]) and return unless recording.length > 3\n\n\t\t# Check if the user already has a record for this level\n\t\tprevious_score = Highscore.order('score').find_by_user_id_and_level_id(current_user.id, params[:level_id]) # with dynamic finder\n\n\t\tbegin\n\t\t\t# They don't have a score for this level\n\t\t\tif previous_score.nil?\n\t\t\t\t# Save the score\n\t\t\t\t@highscore = @level.highscores.build\n\t\t\t\t@highscore.user_id = current_user.id\n\t\t\t\t@highscore.score = score\n\t\t\t\t@highscore.playerRecord = ActiveSupport::JSON.encode(recording)\n\t\t\t\t@highscore.save\n\t\t\telse # Update level entry\n\t\t\t\trender(:json => [\"notice\" => \"Previous score better\", \"status\" => false]) and return unless previous_score.score.to_i > score\n\t\t\t\tprevious_score.score = score.to_s\n\t\t\t\tprevious_score.playerRecord = ActiveSupport::JSON.encode(recording)\n\t\t\t\tprevious_score.save\n\t\t\tend\n\t\trescue Exception=>e\n\t\t\trender :json => [\"notice\" => e, \"status\" => false]\n\t\tend\n\n\n\t\t# Alright it worked!\n\t\trender :json => [\"notice\" => \"Score saved\", \"status\" => true]\n\tend", "def user_params\n params.require(:user).permit(:level)\n end", "def index\n @user_game_levels = UserGameLevel.all\n end", "def create\n\t\t@level = Level.new(params[:level])\n\n\t\trespond_to do |format|\n\t\t\tif @level.save\n\t\t\t\tformat.html { redirect_to(@level, :notice => 'Level was successfully created.') }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\tend\n\t\tend\n\tend", "def create\n @level = Level.new(params[:level])\n authorize! :create, @level, :message => 'Acceso denegado.'\n\n respond_to do |format|\n if @level.save\n format.html { redirect_to @level, notice: t(\"activerecord.alerts.level.created\") }\n format.json { render json: @level, status: :created, location: @level }\n else\n format.html { render action: \"new\" }\n format.json { render json: @level.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_user_game_level\n @user_game_level = UserGameLevel.find(params[:id])\n end", "def create\n @admin_level = AdminLevel.new(params[:admin_level])\n\n respond_to do |format|\n if @admin_level.save\n format.html { redirect_to @admin_level, notice: 'Admin level was successfully created.' }\n format.json { render json: @admin_level, status: :created, location: @admin_level }\n else\n format.html { render action: \"new\" }\n format.json { render json: @admin_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def levels\n response = JSON.parse(@client.get(\"/api/v1/levels\").body)\n return response[\"levels\"] || response\n end", "def level_params\n params.require(:level).permit(:nodes_list, :links_list, :number_of_nodes, :name, :flower_id, :game_id, :level_index)\n end", "def update\n respond_to do |format|\n if @user_game_level.update(user_game_level_params)\n format.html { redirect_to @user_game_level, notice: 'User game level was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_game_level }\n else\n format.html { render :edit }\n format.json { render json: @user_game_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def get_levels\n if params[:levels_by_nf] == 'true'\n @foundation = Foundation.find_by(name: params[:name])\n if @foundation\n render json: {levels: @foundation.levels.pluck(:name)}, status: 200\n else\n render json: {\n levels: []\n }, status: 200\n end\n return\n end\n\n @foundation = Foundation.find_by(id: params[:id])\n if @foundation\n render template: 'levels/get_levels.json', status: 200\n else\n render json: {\n levels: []\n }, status: 200\n end\n end", "def user_competency_level_params\n params.require(:user_competency_level).permit(:user_id, :competency_id, :level_id, :started_date)\n end", "def create\n @user_competency_level = UserCompetencyLevel.new(user_competency_level_params)\n\n respond_to do |format|\n if @user_competency_level.save\n format.html { redirect_to @user_competency_level, notice: 'User competency level was successfully created.' }\n format.json { render :show, status: :created, location: @user_competency_level }\n else\n format.html { render :new }\n format.json { render json: @user_competency_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def game_type_params\n params[:game_type].permit(:name, :level1, :level2, :level3, :level4, :level5)\n end", "def build_level(user)\n shell = user_science_level(user, @shell_science_id)\n shield = user_science_level(user, @shield_science_id)\n laser = user_science_level(user, @laser_science_id)\n ionen = user_science_level(user, @ionen_science_id)\n bomb = user_science_level(user, @bomb_science_id)\n pilot = user_science_level(user, @pilot_science_id)\n spy = user_science_level(user, @spy_science_id)\n return [shell, shield, laser, ionen, bomb, pilot, spy]\n end", "def build_level(user)\n shell=user_science_level(user, @shell_science_id)\n shield=user_science_level(user, @shield_science_id)\n laser=user_science_level(user, @laser_science_id)\n ionen=user_science_level(user, @ionen_science_id)\n bomb=user_science_level(user, @bomb_science_id)\n pilot=user_science_level(user, @pilot_science_id)\n spy=user_science_level(user, @spy_science_id)\n return [shell, shield, laser, ionen, bomb, pilot, spy]\n end", "def level_params\n #params.require(:level).permit(:session_id, :data, :actions, :version)\n #I'm going to hell for this\n params.require(:level).permit!\n end", "def dungeon_level_params\n params.require(:dungeon_level).permit(:name)\n end", "def create_from_editor\n\t\trender(:json => [\"status\" => false, \"notice\" => [ [\"Not signed in\"] ]]) and return if current_user.nil?\n\n\t\t# Overwriting level?\n\t\t@level = Level.find_by_title(params[:levelName])\n\n\t\t# Create or update\n\t\tif @level.nil?\n\t\t\tLevel.create_from_editor(current_user, params[:levelName], params[:level_json])\n\t\telse\n\t\t\trender(:json => [\"status\" => false, \"notice\" => [[\"Cannot save over another users level\"]] ]) and return if @level.user.id != current_user.id\n\n\t\t\t@level.current_user = current_user\n\t\t\t@level.playable = false if current_user.name != APP_CONFIG[\"DEFAULTS\"][\"MASTER_USER_NAME\"]\n\t\t\t@level.json = params[:level_json]\n\t\t\tunless @level.save\n\t\t\t\trender(:json => [\"notice\" => @level.errors, \"status\" => false])\n\t\t\t\treturn\n\t\t\tend\n\t\tend\n\n\t\tif(current_user.name != APP_CONFIG[\"DEFAULTS\"][\"MASTER_USER_NAME\"])\n\t\t\tdir = \"#{APP_CONFIG[\"PATHS\"][\"LEVELS_DIRECTORY\"]}/_users/#{current_user.name}\"\n\t\telse\n\t\t\tdir = \"#{APP_CONFIG[\"PATHS\"][\"LEVELS_DIRECTORY\"]}\"\n\t\tend\n\n\t\t# Save level to file with same name\n\t\tFileUtils.mkdir_p \"#{dir}\"\n\n\t\tfile = File.new(\"#{dir}/#{params[:levelName]}.json\", \"w\")\n\t\tfile.write(params[:level_json])\n\t\tfile.close\n\n\t\t# Spit back info\n\t\trender(:json => [\"status\" => true, \"notice\" => @level])\n\tend", "def game_params\n params.require(:game).permit(:level_id, category_ids:[])\n end", "def level_params\n permitted_params = [\n :name,\n :type,\n :level_num,\n :user,\n :match_text,\n {concept_ids: []}\n ]\n permitted_params.concat(Level.serialized_properties.values.flatten)\n params[:level].permit(permitted_params)\n end", "def levels\n grant_id = params[:id]\n grant = Grant.find(grant_id)\n if grant == nil\n render :json => {}\n return\n end\n\n levels_array = []\n grant.funding_levels_csv.split(',').each do |token|\n limits = token.split(\"-\")\n if limits.length == 1\n limit = Integer(limits[0])\n levels_array.append([limit, limit])\n elsif limits.length == 2\n lower = Integer(limits[0])\n upper = Integer(limits[1])\n levels_array.append([lower, upper])\n end\n end\n\n # XXX: We're not supposed to be doing display formatting in the controller\n # like this.\n render :json => {\n pretty: funding_levels_pretty(grant),\n levels: levels_array\n }\n end", "def level_params\n \t\tparams.require(:level).permit(:level_name)\n \tend", "def create\n @skill_level = SkillLevel.new(skill_level_params)\n\n respond_to do |format|\n if @skill_level.save\n format.html { redirect_to @skill_level, notice: 'Skill level was successfully created.' }\n format.json { render :show, status: :created, location: @skill_level }\n else\n format.html { render :new }\n format.json { render json: @skill_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @user = User.new\n\n # If a valid level is received, apply to the user to create.\n check_level_param\n @user.level = @level if(!@level.blank?)\n\n respond_to do |format|\n format.html\n end\n end", "def create\n @orthodb_level = OrthodbLevel.new(params[:orthodb_level])\n\n respond_to do |format|\n if @orthodb_level.save\n format.html { redirect_to @orthodb_level, notice: 'Orthodb level was successfully created.' }\n format.json { render json: @orthodb_level, status: :created, location: @orthodb_level }\n else\n format.html { render action: \"new\" }\n format.json { render json: @orthodb_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def profile_update_level\n params.require(:profile).permit(:level)\n end", "def create\n @game = Game.new(game_params)\n @game.admin_id = session['user_id']\n @game.popularity = 1\n if @game.save\n flash[:success] = \"Great! New game created, let's add some levels to the game.\"\n #puts @game.id \n redirect_to leveldashboard_url(@game.id)\n else\n render \"new\"\n end\n end", "def create\n @app_user_satisfaction_level = AppUserSatisfactionLevel.new(app_user_satisfaction_level_params)\n\n respond_to do |format|\n if @app_user_satisfaction_level.save\n format.html { redirect_to @app_user_satisfaction_level, notice: 'App user satisfaction level was successfully created.' }\n format.json { render :show, status: :created, location: @app_user_satisfaction_level }\n else\n format.html { render :new }\n format.json { render json: @app_user_satisfaction_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @level = Level.new\n @level.set_defaults\n bingo!(\"create_level_button\")\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @level }\n end\n end", "def create\n party = []\n (1..6).each do |p_number|\n level = params[:dungeon_instance][\"hero#{p_number}_level\"].to_i\n party << level if level > 0\n end\n\n dungeon = Dungeon.new\n dungeon.generate( params[:dungeon_instance][:size].to_i, party,\n encounters_difficulty: params[:dungeon_instance][:difficulty].to_sym )\n # p dungeon.to_json\n\n @dungeon_instance = DungeonInstance.new( dungeon_instance_params.merge( dungeon_data: dungeon.to_json ) )\n\n respond_to do |format|\n if current_user.dungeon_instances << @dungeon_instance\n format.html { redirect_to dungeon_instance_play_path( @dungeon_instance ), notice: 'Dungeon instance was successfully created.' }\n else\n format.html { redirect_to dungeon_instances_path, error: 'Dungeon instance was successfully created.' }\n end\n end\n end", "def create\n @level = Level.new(params[:level])\n\n base64png = params[:level][:json]['backgroundUrl']\n filename = Digest::MD5.hexdigest(base64png) + \".png\"\n\n File.open(File.join('public','uploads','maps', filename), 'wb') do |f|\n f.write(Base64.decode64(base64png.sub('data:image/png;base64,','')))\n end\n\n @level.json[\"backgroundUrl\"] = \"/uploads/maps/#{filename}\"\n @level.creator = current_user\n\n respond_to do |format|\n if @level.save\n format.html { redirect_to(@level, :notice => 'Level was successfully created.') }\n format.json { render :json => @level, :status => :created, :location => @level }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @level.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @operation_level = OperationLevel.new(operation_level_params)\n authorize! :create, @operation_level\n \n respond_to do |format|\n if @operation_level.save\n format.html { redirect_to @operation_level, notice: 'Operation level was successfully created.' }\n format.json { render :show, status: :created, location: @operation_level }\n else\n format.html { render :new }\n format.json { render json: @operation_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def complete_lap\n if user_signed_in?\n current_user.completed_repetition_rounds.create!(\n repetition_round_params.merge(repetition_level_id: @level.id)\n )\n end\n render json: {}\n end", "def index\n @warp_user = Warp::User.find params[:user_id]\n @levels = @warp_user.levels\n #@warp_levels = Warp::Level.where user_id: @warp_user.id\n end", "def update_level\n user_level = 0\n tags = labels.with_private_scope\n .map { |l| [l.key, l.value].join ':' }\n\n levels = Level.all.order(id: :asc)\n levels.each do |lvl|\n break unless tags.include?(lvl.key + ':' + lvl.value)\n\n user_level = lvl.id\n end\n\n update(level: user_level)\n end", "def create\n @project_level = ProjectLevel.new(project_level_params)\n\n respond_to do |format|\n if @project_level.save\n format.html { redirect_to @project_level, notice: 'Project level was successfully created.' }\n format.json { render :show, status: :created, location: @project_level }\n else\n format.html { render :new }\n format.json { render json: @project_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @activity_level = ActivityLevel.new(activity_level_params)\n\n respond_to do |format|\n if @activity_level.save\n format.html { redirect_to @activity_level, notice: 'Activity level was successfully created.' }\n format.json { render :show, status: :created, location: @activity_level }\n else\n format.html { render :new }\n format.json { render json: @activity_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @levels = Level.where(:game_id => params[:game_id])\n @game = Game.find(params[:game_id])\n end", "def index\n @game_levels = GameLevel.all\n end", "def set_game_level\n @game_level = GameLevel.find(params[:id])\n end", "def update_level\n tags = []\n user_level = 0\n tags = labels.with_private_scope\n .map { |l| [l.key, l.value].join ':' }\n\n levels = Level.all.order(id: :asc)\n levels.each do |lvl|\n break unless tags.include?(lvl.key + ':' + lvl.value)\n\n user_level = lvl.id\n end\n\n update(level: user_level)\n end", "def levels\n @levels ||= {}\n end", "def index\n\t\tredirect_to(root_url) and return if current_user.nil?\n\n\t\t@levels = current_user.levels.all(:order => 'order_index DESC')\n\n\t\t#\n\t\t#@levels = Level.find(:all, :order => 'order_index')\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render :json => @levels }\n\t\tend\n\tend", "def create\n @ride_level = RideLevel.new(ride_level_params)\n\n respond_to do |format|\n if @ride_level.save\n format.html { redirect_to @ride_level, notice: 'Ride level was successfully created.' }\n format.json { render :show, status: :created, location: @ride_level }\n else\n format.html { render :new }\n format.json { render json: @ride_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def level_params\n params.require(:level).permit(:description, :short_description, :video_url, :classtype_id, :levelname, :length, :age, :gender, :sort_order, :jack_rabbit_name, :color, :image, :show_registration, :active)\n end", "def create\n @phase_level = PhaseLevel.new(phase_level_params)\n\n respond_to do |format|\n if @phase_level.save\n format.html { redirect_to @phase_level, notice: 'Phase level was successfully created.' }\n format.json { render :show, status: :created, location: @phase_level }\n else\n format.html { render :new }\n format.json { render json: @phase_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_level\n @level = Level.find(params[:id])\n @game = @level.game\n end", "def new\n @level = Level.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @level }\n end\n end", "def mem_level_params\n params.require(:mem_level).permit(:code, :name, :level, :score)\n end", "def new\n @level = Level.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @level }\n end\n end", "def new\n @level = Level.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @level }\n end\n end", "def game_params\n params.require(:game).permit(:category, :speeds, :levels)\n end", "def set_user_level\n @user_level = UserLevel.find(params[:id])\n end", "def create\n @educational_level = EducationalLevel.new(params[:educational_level])\n\n respond_to do |format|\n if @educational_level.save\n format.html { redirect_to @educational_level, notice: 'Educational level was successfully created.' }\n format.json { render json: @educational_level, status: :created, location: @educational_level }\n else\n format.html { render action: \"new\" }\n format.json { render json: @educational_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @mem_level = MemLevel.new(mem_level_params)\n\n respond_to do |format|\n if @mem_level.save\n format.html { redirect_to [:admin, @mem_level], notice: '会员等级创建成功.' }\n format.json { render action: 'show', status: :created, location: @mem_level }\n else\n format.html { render action: 'new' }\n format.json { render json: @mem_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @levels = levels\n @user = User.new(user_params)\n \n if (!current_user)\n @user.tipo = 4\n end\n\n if (current_user)\n if (((current_user.tipo.eql? 2) or (current_user.tipo.eql? 3)) && (@user.tipo.eql? 4))\n elsif (current_user.tipo.eql? 1)\n @user.entidade_id = @user.entidade_id\n else\n @user.entidade_id = current_user.entidade_id\n end\n end\n @user.status = 1\n\n respond_to do |format|\n if @user.save\n if (params[:modal])\n format.html { redirect_to '/reservas/new', notice: 'Usuário foi criado com sucesso.' }\n else\n format.html { redirect_to users_url, notice: 'Usuário foi criado com sucesso.' }\n end\n format.json { render :show, status: :created, location: @user }\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 level_params\n permitted_params = [\n :name,\n :type,\n :level_num,\n :user,\n :dsl_text,\n :encrypted,\n :published,\n {poems: []},\n {concept_ids: []},\n {soft_buttons: []},\n {examples: []}\n ]\n\n # http://stackoverflow.com/questions/8929230/why-is-the-first-element-always-blank-in-my-rails-multi-select\n params[:level][:soft_buttons].delete_if(&:empty?) if params[:level][:soft_buttons].is_a? Array\n permitted_params.concat(Level.serialized_properties.values.flatten)\n params[:level].permit(permitted_params)\n end", "def handle_new\n user_id = params[:assessment][:user_id]\n level_id = params[:assessment][:level_id]\n\n# if User.find(user_id).level.id == level_id\n# assessment = Assessment.new user_id: user_id, max_level: level_id\n# else\n# assessment = Assessment.find(params[:assessment][:id])\n# end\n\n assessment = Assessment.new user_id: user_id, max_level: level_id\n if assessment.save\n params[:assessment][:items][:user_tick].each do |behavior_id, user_tick|\n Item.create assessment_id: assessment.id, behavior_id: behavior_id, user_tick: user_tick\n end\n\n else\n\n end\n# render nothing: true\n redirect_to assessment, notice: 'Результаты БОРД успешно сохранены'\n end", "def create\n @level_goal = LevelGoal.new(params[:level_goal])\n\n respond_to do |format|\n if @level_goal.save\n format.html { redirect_to @level_goal, notice: 'Level goal was successfully created.' }\n format.json { render json: @level_goal, status: :created, location: @level_goal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @level_goal.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @training_level = TrainingLevel.new(params[:training_level])\n\n respond_to do |format|\n if @training_level.save\n format.html { redirect_to @training_level, :notice => t('successfully_created', :model => t('training_level.gender', :count => 1) ) }\n format.json { render json: @training_level, status: :created, location: @training_level }\n else\n format.html { render action: \"new\" }\n format.json { render json: @training_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def alter_user_level(user_level)\n \tself.user_level = user_level\n \tself.save\n end", "def display_level_up(new_skills)\n $game_message.new_page\n $game_message.add(sprintf(Vocab::LevelUp, @name, Vocab::level, @level))\n new_skills.each do |skill|\n $game_message.add(sprintf(Vocab::ObtainSkill, skill.name))\n end\n end", "def create\n @level_progration = LevelProgration.new(level_progration_params)\n\n respond_to do |format|\n if @level_progration.save\n format.html { redirect_to @level_progration, notice: 'Level progration was successfully created.' }\n format.json { render json: @level_progration, status: :created }\n else\n format.html { render action: 'new' }\n format.json { render json: @level_progration.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @reward_and_level = RewardAndLevel.new(reward_and_level_params)\n\n respond_to do |format|\n if @reward_and_level.save\n format.html { redirect_to @reward_and_level, notice: 'Reward and level was successfully created.' }\n format.json { render json: @reward_and_level, status: :created }\n else\n format.html { render action: 'new' }\n format.json { render json: @reward_and_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_level_names(levels)\n levels.each_with_index do |level, index|\n self['level_' + index.to_s + '_name'] = level\n end\n save\n end", "def set_level\n @level =\n if params.include? :key\n Level.find_by_key params[:key]\n else\n Level.find(params[:id])\n end\n @game = @level.game\n end", "def user_risk_levels=(value)\n @user_risk_levels = value\n end", "def destroy\n @user_game_level.destroy\n respond_to do |format|\n format.html { redirect_to user_game_levels_url }\n format.json { head :no_content }\n end\n end", "def level_params\n permitted_attributes(@level || Level.new)\n end", "def create\n @level2 = Level2.new(level2_params)\n\n respond_to do |format|\n if @level2.save\n format.html { redirect_to @level2, notice: 'Level2 was successfully created.' }\n format.json { render :show, status: :created, location: @level2 }\n else\n format.html { render :new }\n format.json { render json: @level2.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n respond_to do |format|\n if @health_level.save\n format.html { redirect_to @health_level, notice: 'Health level was successfully created.' }\n format.json { render json: @health_level, status: :created, location: @health_level }\n else\n format.html { render action: \"new\" }\n format.json { render json: @health_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def education_level_params\n params.require(:education_level).permit(:level)\n end", "def input_dosing_levels(levels)\n my_levels = levels.split(',')\n for i in 0..my_levels.size()-1\n add_level.click if i > 1\n dosing_factor_levels[i].set my_levels[i]\n end\n end", "def levels=(levels)\n @levels = levels\n clear_levels_cache!\n end", "def create\n @level_container = LevelContainer.new(params[:level_container])\n\n respond_to do |format|\n if @level_container.save\n format.html { redirect_to @level_container, notice: 'Level container was successfully created.' }\n format.json { render json: @level_container, status: :created, location: @level_container }\n else\n format.html { render action: \"new\" }\n format.json { render json: @level_container.errors, status: :unprocessable_entity }\n end\n end\n end", "def power_levels\n client.api.get_power_levels(id)\n end", "def create\n @energy_level = EnergyLevel.new(params[:energy_level])\n\n respond_to do |format|\n if @energy_level.save\n format.html { redirect_to @energy_level, :notice => 'Energy level was successfully created.' }\n format.json { render :json => @energy_level, :status => :created, :location => @energy_level }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @energy_level.errors, :status => :unprocessable_entity }\n end\n end\n end", "def level=(new_lvl)\n @level = new_lvl\n $game_party.quests.add_to_sort_array(:level, @id) if $game_party && \n $game_party.quests\n end", "def update\n respond_to do |format|\n if @game_level.update(game_level_params)\n format.html { redirect_to @game_level, notice: 'Game level was successfully updated.' }\n format.json { render :show, status: :ok, location: @game_level }\n else\n format.html { render :edit }\n format.json { render json: @game_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def levels(levels)\n # need to keep nils, so don't remove them\n\n # flatten nested arrays\n levels = [levels].flatten\n\n # make array of levels unique and validate each\n # return the array of validated levels\n levels.uniq.map { |i| Access::Validate.level(i) }\n end", "def create\n @competency_level = CompetencyLevel.new(competency_level_params)\n\n respond_to do |format|\n if @competency_level.save\n format.html { redirect_to @competency_level, notice: 'Competency level was successfully created.' }\n format.json { render :show, status: :created, location: @competency_level }\n else\n format.html { render :new }\n format.json { render json: @competency_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @envlevel = Envlevel.new(envlevel_params)\n @envlevel.save\n @envlevels = Envlevel.all.sort_by{|envlevel| envlevel.name.downcase}\n end", "def level_params\n params.fetch(:level, {})\n end", "def change_level\n if Group::LEVEL_TITLES.include?(params[:level])\n params[:level] = Group::LEVELS[Group::LEVEL_TITLES.index(params[:level])]\n end\n unless Group::LEVELS.include?(params[:level])\n flash[:notice] = 'invalid level'\n render(:update) do |page|\n update_flash(page, flash[:notice])\n end\n return\n end\n\n act_on_members do |gi|\n if gi.level == 'leader' && gi.group.leaders.count == 1\n @member_notices << \"Couldn't change #{gi.person.full_name}'s level from a leader, since that would result in a leaderless group!\"\n else\n @levels_to_update << gi.level # update old\n gi.level = params[:level]\n @levels_to_update << gi.level # update new\n @member_notices << \"#{gi.person.full_name} is now a #{params[:level]}\"\n end\n end\n end", "def index\n @levels = Level.order(:game_id)\n end", "def create\n submitter = CGI::unescape params[:added_by]\n user = Warp::User.find params[:user_id]\n #check if queue is closed or not\n if user.active == false then\n render plain: \"Sorry, @#{submitter} - it seems like the submission queue has been closed for now!\"\n return\n end\n code = params[:code]\n\n pattern = /(([a-hj-np-yA-Z0-9]{3}[-|\\s]){2}[a-hj-np-yA-Z0-9]{3})/\n matches = code.match(pattern)\n if matches != nil then\n code = matches[0]\n warp_level = Warp::Level.where(code: code, user_id: user.id)\n if warp_level == nil or warp_level == [] then\n\n warp_level = Warp::Level.new\n warp_level.added_by = submitter\n warp_level.code = code\n warp_level.user_id = user.id\n warp_level.save\n \n render plain: \"@#{submitter}, your level has been successfully added to our queue!\"\n else\n render plain: \"Sorry, @#{submitter}, it seems someone has added that level to the queue already!\"\n end\n else\n render plain: \"Sorry, you must've misspelled - try again @#{submitter}!\" \n end\n return\n \n \n\n respond_to do |format|\n if @warp_level.save\n format.html { redirect_to @warp_level, notice: 'Level was successfully created.' }\n format.json { render :show, status: :created, location: @warp_level }\n else\n format.html { render :new }\n format.json { render json: @warp_level.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.68166804", "0.66407984", "0.66223514", "0.6443282", "0.64159703", "0.6394431", "0.63865507", "0.63865507", "0.6385977", "0.6376677", "0.6305708", "0.62947303", "0.6218576", "0.6195919", "0.6159602", "0.61058134", "0.60856575", "0.6084296", "0.6029324", "0.60020775", "0.5996614", "0.5976308", "0.59544003", "0.5941798", "0.5941396", "0.59404165", "0.5916592", "0.59150505", "0.59023595", "0.59015256", "0.5871078", "0.58390474", "0.5833163", "0.5821603", "0.57922494", "0.57710534", "0.5758671", "0.5753807", "0.57479537", "0.5714577", "0.56854844", "0.5677559", "0.56684613", "0.5661705", "0.5656621", "0.56551504", "0.5624158", "0.56180406", "0.56154114", "0.5608705", "0.5600327", "0.55702746", "0.55679137", "0.556433", "0.5560302", "0.55536294", "0.554498", "0.55301464", "0.55082464", "0.5502313", "0.5494819", "0.54822266", "0.5482097", "0.54819417", "0.5481382", "0.5480073", "0.54676694", "0.54543096", "0.5450179", "0.5441118", "0.5440644", "0.54212415", "0.5418162", "0.5413631", "0.541348", "0.5408662", "0.5399145", "0.538665", "0.53832906", "0.53817165", "0.5381346", "0.5380637", "0.53796494", "0.53762335", "0.53728944", "0.5360269", "0.53578", "0.53509927", "0.534989", "0.53443444", "0.5343914", "0.5330835", "0.5324797", "0.53203994", "0.53143233", "0.53053814", "0.5292414", "0.52890944", "0.5279005", "0.52745634" ]
0.7171693
0
PATCH/PUT /user_game_levels/1 PATCH/PUT /user_game_levels/1.json
def update respond_to do |format| if @user_game_level.update(user_game_level_params) format.html { redirect_to @user_game_level, notice: 'User game level was successfully updated.' } format.json { render :show, status: :ok, location: @user_game_level } else format.html { render :edit } format.json { render json: @user_game_level.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @game_level.update(game_level_params)\n format.html { redirect_to @game_level, notice: 'Game level was successfully updated.' }\n format.json { render :show, status: :ok, location: @game_level }\n else\n format.html { render :edit }\n format.json { render json: @game_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @level = Level.find(params[:id])\n\n respond_to do |format|\n if @level.update_attributes(params[:level])\n format.html { redirect_to @level, notice: 'Level was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @level.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @level = Level.find(params[:id])\n\n respond_to do |format|\n if @level.update_attributes(params[:level])\n format.html { redirect_to @level, notice: 'Level was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @level.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n @level = Level.where(:id => params[:id])\n if(@level.nil?)\n render :status => :not_found, :text => \"Unknown level\" and return\n end\n if @level.update(level_params)\n format.html { redirect_to @level, notice: 'Level was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @level.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if admin?\n respond_to do |format|\n if @level.update(level_params)\n format.html { redirect_to @level, notice: 'Level was successfully updated.' }\n format.json { render :show, status: :ok, location: @level }\n else\n format.html { render :edit }\n format.json { render json: @level.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "def update\n if level_params[:name] &&\n @level.name != level_params[:name] &&\n @level.name.downcase == level_params[:name].downcase\n # do not allow case-only changes in the level name because that confuses git on OSX\n @level.errors.add(:name, 'Cannot change only the capitalization of the level name (it confuses git on OSX)')\n render json: @level.errors, status: :unprocessable_entity\n return\n end\n if @level.update(level_params)\n render json: { redirect: level_url(@level, show_callouts: true) }\n else\n render json: @level.errors, status: :unprocessable_entity\n end\n end", "def update\n @level = Level.find(params[:id])\n authorize! :update, @level, :message => 'Acceso denegado.'\n\n respond_to do |format|\n if @level.update_attributes(params[:level])\n format.html { redirect_to @level, notice: t(\"activerecord.alerts.level.updated\") }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @level.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @user_competency_level.update(user_competency_level_params)\n format.html { redirect_to @user_competency_level, notice: 'User competency level was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_competency_level }\n else\n format.html { render :edit }\n format.json { render json: @user_competency_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @admin_level.update(admin_level_params)\n format.html { redirect_to edit_admin_level_path(@admin_level), notice: 'Level was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_level }\n else\n format.html { render :edit }\n format.json { render json: @admin_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @admin_level = AdminLevel.find(params[:id])\n\n respond_to do |format|\n if @admin_level.update_attributes(params[:admin_level])\n format.html { redirect_to @admin_level, notice: 'Admin level was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize! :update, @operation_level\n respond_to do |format|\n if @operation_level.update(operation_level_params)\n format.html { redirect_to @operation_level, notice: 'Operation level was successfully updated.' }\n format.json { render :show, status: :ok, location: @operation_level }\n else\n format.html { render :edit }\n format.json { render json: @operation_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @app_user_satisfaction_level.update(app_user_satisfaction_level_params)\n format.html { redirect_to @app_user_satisfaction_level, notice: 'App user satisfaction level was successfully updated.' }\n format.json { render :show, status: :ok, location: @app_user_satisfaction_level }\n else\n format.html { render :edit }\n format.json { render json: @app_user_satisfaction_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n \t@level = Level.find(params[:id])\n \tif @level.update_attributes(level_params)\n \t\tredirect_to new_level_path\n \telse\n \t\trender 'edit'\n \tend\n end", "def profile_update_level\n params.require(:profile).permit(:level)\n end", "def update\n respond_to do |format|\n if @skill_level.update(skill_level_params)\n format.html { redirect_to @skill_level, notice: 'Skill level was successfully updated.' }\n format.json { render :show, status: :ok, location: @skill_level }\n else\n format.html { render :edit }\n format.json { render json: @skill_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize! :update, @impact_level\n respond_to do |format|\n if @impact_level.update(impact_level_params)\n format.html { redirect_to @impact_level, notice: 'Impact level was successfully updated.' }\n format.json { render :show, status: :ok, location: @impact_level }\n else\n format.html { render :edit }\n format.json { render json: @impact_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_level\n user_level = 0\n tags = labels.with_private_scope\n .map { |l| [l.key, l.value].join ':' }\n\n levels = Level.all.order(id: :asc)\n levels.each do |lvl|\n break unless tags.include?(lvl.key + ':' + lvl.value)\n\n user_level = lvl.id\n end\n\n update(level: user_level)\n end", "def update\n @orthodb_level = OrthodbLevel.find(params[:id])\n\n respond_to do |format|\n if @orthodb_level.update_attributes(params[:orthodb_level])\n format.html { redirect_to @orthodb_level, notice: 'Orthodb level was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @orthodb_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @health_level.update_attributes(params[:health_level])\n format.html { redirect_to @health_level, notice: 'Health level was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @health_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_user_game_level\n @user_game_level = UserGameLevel.find(params[:id])\n end", "def update\n @user = User.find(session[:id])\n\n if (nil != @user)\n @user.difficulty = params[:id]\n end\n\n respond_to do |format|\n if @user.save\n format.html { head :no_content }\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 @level_container = LevelContainer.find(params[:id])\n\n respond_to do |format|\n if @level_container.update_attributes(params[:level_container])\n format.html { redirect_to @level_container, notice: 'Level container was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @level_container.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @competency_level.update(competency_level_params)\n format.html { redirect_to @competency_level, notice: 'Competency level was successfully updated.' }\n format.json { render :show, status: :ok, location: @competency_level }\n else\n format.html { render :edit }\n format.json { render json: @competency_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_level\n tags = []\n user_level = 0\n tags = labels.with_private_scope\n .map { |l| [l.key, l.value].join ':' }\n\n levels = Level.all.order(id: :asc)\n levels.each do |lvl|\n break unless tags.include?(lvl.key + ':' + lvl.value)\n\n user_level = lvl.id\n end\n\n update(level: user_level)\n end", "def update\n @level_goal = LevelGoal.find(params[:id])\n\n respond_to do |format|\n if @level_goal.update_attributes(params[:level_goal])\n format.html { redirect_to @level_goal, notice: 'Level goal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @level_goal.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @risk_level = RiskLevel.find(params[:id])\n\n respond_to do |format|\n if @risk_level.update_attributes(params[:risk_level])\n format.html { redirect_to(current_risk_configuration, :notice => 'Risk level was successfully updated.') }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @risk_level.errors, :status => :unprocessable_entity }\n end\n end\n end", "def change_level\n if Group::LEVEL_TITLES.include?(params[:level])\n params[:level] = Group::LEVELS[Group::LEVEL_TITLES.index(params[:level])]\n end\n unless Group::LEVELS.include?(params[:level])\n flash[:notice] = 'invalid level'\n render(:update) do |page|\n update_flash(page, flash[:notice])\n end\n return\n end\n\n act_on_members do |gi|\n if gi.level == 'leader' && gi.group.leaders.count == 1\n @member_notices << \"Couldn't change #{gi.person.full_name}'s level from a leader, since that would result in a leaderless group!\"\n else\n @levels_to_update << gi.level # update old\n gi.level = params[:level]\n @levels_to_update << gi.level # update new\n @member_notices << \"#{gi.person.full_name} is now a #{params[:level]}\"\n end\n end\n end", "def update\n authorize! :update, @service_level\n respond_to do |format|\n if @service_level.update(service_level_params)\n format.html { redirect_to @service_level, notice: 'Service level was successfully updated.' }\n format.json { render :show, status: :ok, location: @service_level }\n else\n format.html { render :edit }\n format.json { render json: @service_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_level_\n end", "def update\n respond_to do |format|\n if @activity_level.update(activity_level_params)\n format.html { redirect_to @activity_level, notice: 'Activity level was successfully updated.' }\n format.json { render :show, status: :ok, location: @activity_level }\n else\n format.html { render :edit }\n format.json { render json: @activity_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @project_level.update(project_level_params)\n format.html { redirect_to @project_level, notice: 'Project level was successfully updated.' }\n format.json { render :show, status: :ok, location: @project_level }\n else\n format.html { render :edit }\n format.json { render json: @project_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_game_level\n @game_level = GameLevel.find(params[:id])\n end", "def user_game_level_params\n params.require(:user_game_level).permit(:user_game_id, :game_level_id)\n end", "def update\n @skill_level = SkillLevel.find(params[:id])\n\n respond_to do |format|\n if @skill_level.update_attributes(params[:skill_level])\n format.html { redirect_to(@skill_level, :notice => 'SkillLevel was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @skill_level.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @ride_level.update(ride_level_params)\n format.html { redirect_to @ride_level, notice: 'Ride level was successfully updated.' }\n format.json { render :show, status: :ok, location: @ride_level }\n else\n format.html { render :edit }\n format.json { render json: @ride_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @energy_level = EnergyLevel.find(params[:id])\n\n respond_to do |format|\n if @energy_level.update_attributes(params[:energy_level])\n format.html { redirect_to @energy_level, :notice => 'Energy level was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @energy_level.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @level2.update(level2_params)\n format.html { redirect_to @level2, notice: 'Level2 was successfully updated.' }\n format.json { render :show, status: :ok, location: @level2 }\n else\n format.html { render :edit }\n format.json { render json: @level2.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if User.update(current_user.id, :game_id => params[:id])\n format.json { head :no_content }\n end\n end\n end", "def update\n @game = current_user.games.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game].merge({ :user_id => current_user.id }))\n format.html { redirect_to games_path, notice: 'Game was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @user = User.find(params[:user_id])\n @game = @user.games.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to user_game_path(@user,@game), :notice => 'Game was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @game.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @training_level = TrainingLevel.find(params[:id])\n\n respond_to do |format|\n if @training_level.update_attributes(params[:training_level])\n format.html { redirect_to @training_level, :notice => t('successfully_updated', :model => t('training_level.gender', :count => 1) ) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @training_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_level\n @level = Level.find(params[:id])\n @game = @level.game\n end", "def update\n @supervisor_level = SupervisorLevel.find(params[:id])\n\n respond_to do |format|\n if @supervisor_level.update_attributes(params[:supervisor_level])\n format.html { redirect_to(@supervisor_level, :notice => 'Supervisor level was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @supervisor_level.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @member_level = MemberLevel.find(params[:id])\n if @member_level.update_attributes(member_level_params)\n flash[:notice] = 'Member Level was successfully updated.'\n redirect_to member_levels_path\n else\n flash[:error] = @member_level.errors.full_messages\n # format.js\n render \"edit\"\n end\n end", "def update\n @educational_level = EducationalLevel.find(params[:id])\n\n respond_to do |format|\n if @educational_level.update_attributes(params[:educational_level])\n format.html { redirect_to @educational_level, notice: 'Educational level was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @educational_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @education_level.update(education_level_params)\n format.html { redirect_to @education_level, notice: 'Education level was successfully updated.' }\n format.json { render :show, status: :ok, location: @education_level }\n else\n format.html { render :edit }\n format.json { render json: @education_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @level = args[:level] if args.key?(:level)\n end", "def update!(**args)\n @level = args[:level] if args.key?(:level)\n end", "def update\n respond_to do |format|\n if @referee_level.update(referee_level_params)\n format.html { redirect_to @referee_level, notice: 'Referee level was successfully updated.' }\n format.json { render :show, status: :ok, location: @referee_level }\n else\n format.html { render :edit }\n format.json { render json: @referee_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @education_level = EducationLevel.find(params[:id])\n\n respond_to do |format|\n if @education_level.update_attributes(params[:education_level])\n format.html { redirect_to @education_level, :notice => t('controllermessage.update') }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @education_level.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @requirement_level = RequirementLevel.find(params[:id])\n\n respond_to do |format|\n if @requirement_level.update_attributes(params[:requirement_level])\n flash[:notice] = 'RequirementLevel was successfully updated.'\n format.html { redirect_to(admin_requirement_level_url(@requirement_level)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @requirement_level.errors, :status => :unprocessable_entity }\n end\n end\n end", "def edit\n \t@level = Level.find(params[:id])\n @levels = Level.all\n end", "def update\n respond_to do |format|\n if @severity_level.update(severity_level_params)\n format.html do\n redirect_to @severity_level,\n notice: 'Severity level was successfully updated.'\n end\n format.json { render :show, status: :ok, location: @severity_level }\n else\n format.html { render :edit }\n format.json { render json: @severity_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @level_progration.update(level_progration_params)\n format.html { redirect_to @level_progration, notice: 'Level progration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @level_progration.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @mem_level.update(mem_level_params)\n format.html { redirect_to [:admin, @mem_level], notice: '会员等级信息更新成功.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @mem_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @feat = @person.feats.find(params[:id])\n level_old = @person.level\n\n if params[:feat][:completed] == '1'\n @feat.complete\n else\n @feat.uncomplete\n end\n sign = params[:feat][:completed] == '1' ? '+': '-'\n \n has_leveled = @person.level > level_old\n\n respond_to do |format|\n format.json { render :json => {\n :xpGained => \"#{sign}#{@feat.xp}\",\n :xpTotal => @person.xp,\n :next_level_ratio => @person.next_level_ratio,\n :extra_life => @person.level_to_string,\n :has_leveled => has_leveled,\n :completed => @feat.completed,\n :streak => @feat.calculate_streak}}\n \n end\n\n end", "def update\n @level_category = LevelCategory.find(params[:id])\n\n respond_to do |format|\n if @level_category.update_attributes(params[:level_category])\n format.html { redirect_to @level_category, notice: 'Level category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @level_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @reward_and_level.update(reward_and_level_params)\n format.html { redirect_to @reward_and_level, notice: 'Reward and level was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @reward_and_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @user_game.update(user_game_params)\n format.html { redirect_to @user_game, notice: 'User game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user_game.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @user_game.update(user_game_params)\n format.html { redirect_to @user_game, notice: 'User game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user_game.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_level\n @level =\n if params.include? :key\n Level.find_by_key params[:key]\n else\n Level.find(params[:id])\n end\n @game = @level.game\n end", "def edit\n @user = User.find(params[:id])\n @ranks = Rank.find_all_by_custom(true)\n @userlevels = UserLevel.find(:all)\n end", "def game_level_params\n params.require(:game_level).permit(:name, :level, :game_id, :description)\n end", "def update\n authorize! :update, @game_type, :message => 'Not authorized as an administrator.'\n respond_to do |format|\n if @game_type.update(game_type_params)\n format.html { redirect_to @game_type, notice: 'Game type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @game_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @phase_level.update(phase_level_params)\n format.html { redirect_to @phase_level, notice: 'Phase level was successfully updated.' }\n format.json { render :show, status: :ok, location: @phase_level }\n else\n format.html { render :edit }\n format.json { render json: @phase_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def edit\n @level = Level.find(params[:id])\n end", "def alter_user_level(user_level)\n \tself.user_level = user_level\n \tself.save\n end", "def update\n @systemuser = Systemuser.find(params[:id])\n\n if params[:systemuser][:group_id] == 4\n @systemuser.ro = 1\n else\n @systemuser.ro = 0\n end\n\n respond_to do |format|\n if @systemuser.update_attributes(params[:systemuser])\n format.html { redirect_to systemusers_path, notice: 'Wizard user was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @systemuser.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @price_level = PriceLevel.find(params[:id])\n\n respond_to do |format|\n if @price_level.update_attributes(params[:price_level])\n format.html { redirect_to @price_level, notice: 'Price level was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @price_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @replay = Replay.find(params[:id])\n @replay.level_id = params[:replay][:level_id]\n @replay.score = params[:replay][:score]\n @replay.player = params[:replay][:player]\n @replay.data = params[:replay][:data].read\n\n respond_to do |format|\n\n format.html { redirect_to replays_path, :notice => 'Replay was successfully updated.' }\n format.json { head :no_content }\n\n end\n end", "def update\n respond_to do |format|\n if @user_game.update(user_game_params)\n format.html { redirect_to @user_game, notice: 'User game was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_game }\n else\n format.html { render :edit }\n format.json { render json: @user_game.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @contamination_level.update(contamination_level_params)\n format.html { redirect_to @contamination_level, notice: 'Contamination level was successfully updated.' }\n format.json { render :show, status: :ok, location: @contamination_level }\n else\n format.html { render :edit }\n format.json { render json: @contamination_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @level_progression.update(level_progression_params)\n format.html { redirect_to @level_progression, notice: 'Level progression was successfully updated.' }\n format.json { render :show, status: :ok, location: @level_progression }\n else\n format.html { render :edit }\n format.json { render json: @level_progression.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n #Identify current level before being saved\n @old_level = @student.current_level\n \n respond_to do |format|\n\n if @student.update(student_params)\n\n #When saved, if current_level is different to the new current level\n if params[:current_level] != @old_level\n @skills = Skill.where(level_id: @student.current_level).all\n @student_skills = StudentSkill.where(student_id: @student).all\n #Delete all student_skills\n @student_skills.destroy_all\n #Add all skills for new level\n @skills.each do |skill|\n @student_skill = StudentSkill.new(\n student_id: @student.id,\n skill_id: skill.id,\n level_id: skill.level_id,\n competency_level_id: 1)\n @student_skill.save\n @student.update_attributes(competent_but_waiting: true)\n end\n\n @new_level = Level.find(@student.current_level)\n #Add certificate post to timeline\n @certificate = Post.new(\n student_id: @student.id,\n user_id: current_user.id,\n body: \"you graduated to #{@new_level.title}!\",\n certificate: true,\n level_id: @new_level.id\n )\n @certificate.save!\n end\n\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @knowledge_level.update(knowledge_level_params)\n format.html { redirect_to @knowledge_level, notice: 'Knowledge level was successfully updated.' }\n format.json { render :show, status: :ok, location: @knowledge_level }\n else\n format.html { render :edit }\n format.json { render json: @knowledge_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @amputation_level.update(amputation_level_params)\n format.html { redirect_to @amputation_level, notice: 'Amputation level was successfully updated.' }\n format.json { render :show, status: :ok, location: @amputation_level }\n else\n format.html { render :edit }\n format.json { render json: @amputation_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @levels_point.update(levels_point_params)\n format.html { redirect_to @levels_point, notice: 'Levels point was successfully updated.' }\n format.json { render :show, status: :ok, location: @levels_point }\n else\n format.html { render :edit }\n format.json { render json: @levels_point.errors, status: :unprocessable_entity }\n end\n end\n end", "def status_update\n current_user.gold = params[:gold]\n current_user.lives = params[:lives]\n current_user.income = params[:income]\n\n # Send out the updated user list to all clients\n update_user_list(current_game.id)\n end", "def update\n respond_to do |format|\n if @game_user.update(game_user_params)\n format.html { redirect_to @game_user, notice: 'Game user was successfully updated.' }\n format.json { render :show, status: :ok, location: @game_user }\n else\n format.html { render :edit }\n format.json { render json: @game_user.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @level = Level.find(params[:id])\n rating = params[:level][:rating].to_i\n @level.rating = rating\n if @level.save\n flash[:notice] = 'Level was successfully updated.'\n redirect_to :action => \"index\"\n else \n flash[:warning] = 'Invalid Options... Try again!'\n redirect_to :action => \"index\"\n end\n end", "def update\n authorize! :update, CompetenceTierGroup\n \n @competence_tier_group.update!(competence_tier_group_params)\n render json: {status: :ok}\n end", "def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n update_standings\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n id = User.find_by_fb_id(params[:id]).id\n @user_game = UserGame.find_by_user_id(id)\n\n respond_to do |format|\n if @user_game.update_attributes(params[:user_game])\n format.json { head :no_content }\n else\n format.json { render json: @user_game.errors }\n end\n end\n end", "def update\n respond_to do |format|\n @levels = levels\n @ra = Reserva.where(user_id: params[:id], status: 1)\n @r = Reserva.where(entidade_id: @user.entidade_id, status: 1)\n\n if @user.update(user_params)\n format.html { redirect_to users_url, notice: 'Atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @user }\n else\n format.html { render :edit }\n format.json { render json: '{\"msg\":\"Este já tem cadastro!\"}', status: :unprocessable_entity }\n end\n end\n end", "def update\n @game_stat = GameStat.find(params[:id])\n\n respond_to do |format|\n if @game_stat.update_attributes(params[:game_stat])\n format.html { redirect_to @game_stat, notice: 'Game stat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game_stat.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @player_game_stat = PlayerGameStat.find(params[:id])\n\n respond_to do |format|\n if @player_game_stat.update_attributes(params[:player_game_stat])\n format.html { redirect_to @player_game_stat, notice: 'Player game stat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @player_game_stat.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_level\n @level = Level.find(params[:id])\n end", "def update\n @user_game_preference = UserGamePreference.find(params[:id])\n\n respond_to do |format|\n if @user_game_preference.update_attributes(params[:user_game_preference])\n format.html { redirect_to @user_game_preference, :notice => 'User game preference was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @user_game_preference.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @facility.update(facility_params)\n if @facility.levels && @facility.levels.to_i > 0\n notice = 'Facility was successfully upgraded.'\n else\n notice = 'Facility was successfully managed.'\n end\n format.html { redirect_to @facility, notice: notice }\n format.json { render :show, status: :ok, location: @facility }\n else\n format.html { render :edit }\n format.json { render json: @facility.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @racy_level = args[:racy_level] if args.key?(:racy_level)\n end", "def update\n respond_to do |format|\n if @college_level.update(college_level_params)\n format.html { redirect_to @college_level, notice: 'College level was successfully updated.' }\n format.json { render :show, status: :ok, location: @college_level }\n else\n format.html { render :edit }\n format.json { render json: @college_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_user_level\n @user_level = UserLevel.find(params[:id])\n end", "def update\n\n respond_to do |format|\n if @educational_level.update_attributes(params[:educational_level])\n format.html { redirect_to(@educational_level, :notice => 'Educational level was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @educational_level.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n if not @game.locked\n parse_game_params\n\n respond_to do |format|\n if @game.update(:id => params[:id])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n else\n redirect_to root_path\n end\n end", "def user_level_params\n params.require(:user_level).permit(:level)\n end", "def update_level_channel(level, project_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'PUT'\n\t\targs[:path]['Level'] = level\n\t\targs[:path]['ProjectName'] = project_name\n\t\targs[:pattern] = '/projects/[ProjectName]/level_channels/[Level]'\n\t\targs[:query]['Action'] = 'UpdateLevelChannel'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'http'\n\t\tif optional.key? :level_channel_setting\n\t\t\targs[:body]['LevelChannelSetting'] = optional[:level_channel_setting]\n\t\tend\n\t\tself.run(args)\n\tend", "def update\n p '~~~update~~~'\n p user_params\n\n if @user.update(user_params)\n render json: @user.to_json(include: :rooms), status: :ok\n else\n render json: {error: @user.errors.full_messages.first}, status: :unprocessable_entity\n end\n end", "def update\n #if game exists, pass here to update state\n @game = Game.find_by(id: params[:id])\n @game.update(game_params)\n render json: @game, status: 201\n end", "def update\n # Allow updates only of pending games\n if @game.completed?\n head :forbidden\n return\n end\n \n user_id = user_session.current_user.id\n game_params = params.require(:game).permit(:player2_id, :status)\n \n # Register a player's resignation or add a second player according to the parameters\n # received.\n if game_params[:status]\n # Allow status updates only of ongoing games\n unless @game.ongoing?\n head :forbidden\n return\n end\n \n case game_params[:status].to_i\n when Game::P1_FORFEIT\n # Permit resignation of player 1 only by player 1.\n unless user_id == @game.player1.id\n head :forbidden\n return\n end\n @game.player1_forfeits\n when Game::P2_FORFEIT\n # Permit resignation of player 2 only by player 2.\n unless user_id == @game.player2.id\n head :forbidden\n return\n end\n @game.player2_forfeits\n \n else\n # Forbid updates to status other than resignations.\n head :forbidden\n return\n end\n \n elsif game_params[:player2_id]\n player2_id = game_params[:player2_id].to_i\n \n # Forbid setting second player if second player already exists or if current\n # user is different from would-be second player.\n unless @game.player2_id.nil? && user_id == player2_id\n head :forbidden\n return\n end\n \n @game.update!(player2_id: player2_id)\n \n # Broadcast message to clients directing them to update their lists\n # of waiting games.\n ActionCable.server.broadcast 'waiting_games', action: 'remove_game',\n user_id: user_id,\n game_id: @game.id\n else\n # Respond with bad-request status code if user does not try to update status or\n # add a second player.\n head :bad_request\n return\n end\n \n # Broadcast notice of game update to clients along with current game status.\n GameChannel.broadcast_to @game, user_id: user_id, status: @game.status,\n action: 'update_game'\n \n respond_to do |format|\n format.html { redirect_to @game }\n format.json { render :show, status: :ok, location: @game }\n end\n end", "def update\n if @game.user == current_user\n updated = @game.update(game_params)\n @notice = \"Game was sucessfully updated.\"\n else\n @notice = \"Game not updated since it belongs to another user.\"\n end\n respond_to do |format|\n if updated\n format.html { redirect_to @game, notice: @notice }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.7083745", "0.6962488", "0.69384944", "0.6766968", "0.67299163", "0.6706209", "0.6613066", "0.6599353", "0.65270686", "0.65017706", "0.64997035", "0.6496667", "0.6411599", "0.63944346", "0.63325256", "0.63192433", "0.6298037", "0.6285173", "0.62652344", "0.625497", "0.6230596", "0.6230232", "0.6198515", "0.619438", "0.61576575", "0.6151001", "0.6147462", "0.6146581", "0.6131878", "0.6128663", "0.61041045", "0.60988367", "0.60902476", "0.6040606", "0.60404706", "0.6038236", "0.6030613", "0.6019682", "0.60061675", "0.5989537", "0.59836704", "0.5934348", "0.5910565", "0.5903545", "0.5898286", "0.58850646", "0.58844966", "0.58844966", "0.5881335", "0.5880822", "0.5876157", "0.5873121", "0.5872574", "0.5871889", "0.58488655", "0.5846918", "0.5845551", "0.58190966", "0.5814914", "0.5814914", "0.58068264", "0.58065724", "0.5769837", "0.57686573", "0.5761525", "0.5754062", "0.5748682", "0.5747055", "0.5742194", "0.5739983", "0.5731537", "0.5728634", "0.5727145", "0.57150835", "0.570521", "0.56662726", "0.56474495", "0.56464326", "0.5646192", "0.5635538", "0.56325126", "0.563077", "0.5624275", "0.5599006", "0.55928266", "0.55918884", "0.5588801", "0.5583429", "0.5582585", "0.55749583", "0.55722237", "0.55662185", "0.55639386", "0.55622226", "0.5561529", "0.5555751", "0.5554569", "0.555042", "0.55436796", "0.5529257" ]
0.7388686
0
DELETE /user_game_levels/1 DELETE /user_game_levels/1.json
def destroy @user_game_level.destroy respond_to do |format| format.html { redirect_to user_game_levels_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @game_level.destroy\n respond_to do |format|\n format.html { redirect_to game_levels_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @level.destroy\n respond_to do |format|\n format.html { redirect_to levels_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @level = Level.find(params[:id])\n @level.destroy\n\n respond_to do |format|\n format.html { redirect_to levels_url }\n format.json { head :ok }\n end\n end", "def destroy\n @level = Level.find(params[:id])\n @level.destroy\n\n respond_to do |format|\n format.html { redirect_to levels_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @level = Level.find(params[:id])\n authorize! :destroy, @level, :message => 'Acceso denegado.'\n @level.destroy\n\n respond_to do |format|\n format.html { redirect_to levels_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @admin_level = AdminLevel.find(params[:id])\n @admin_level.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_levels_url }\n format.json { head :ok }\n end\n end", "def destroy\n if admin?\n @level.destroy\n respond_to do |format|\n format.html { redirect_to levels_url, notice: 'Level was successfully destroyed.' }\n format.json { head :no_content }\n end\n end\n end", "def destroy\n @admin_level.destroy\n respond_to do |format|\n format.html { redirect_to admin_levels_url, notice: 'Level was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @health_level.destroy\n\n respond_to do |format|\n format.html { redirect_to health_levels_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_competency_level.destroy\n respond_to do |format|\n format.html { redirect_to user_competency_levels_url, notice: 'User competency level was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @orthodb_level = OrthodbLevel.find(params[:id])\n @orthodb_level.destroy\n\n respond_to do |format|\n format.html { redirect_to orthodb_levels_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @level_goal = LevelGoal.find(params[:id])\n @level_goal.destroy\n\n respond_to do |format|\n format.html { redirect_to level_goals_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @level.destroy\n redirect_to(params[:redirect] || levels_url)\n end", "def destroy\n @level.destroy\n redirect_to(params[:redirect] || levels_url)\n end", "def destroy\n @activity_level.destroy\n respond_to do |format|\n format.html { redirect_to activity_levels_url, notice: 'Activity level was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @mem_level.destroy\n respond_to do |format|\n format.html { redirect_to admin_mem_levels_url, notice: '会员等级成功删除.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @referee_level.destroy\n respond_to do |format|\n format.html { redirect_to referee_levels_url, notice: 'Referee level was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n authorize! :destroy, @impact_level\n @impact_level.destroy\n respond_to do |format|\n format.html { redirect_to impact_levels_url, notice: 'Impact level was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @educational_level = EducationalLevel.find(params[:id])\n @educational_level.destroy\n\n respond_to do |format|\n format.html { redirect_to educational_levels_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @level_container = LevelContainer.find(params[:id])\n @level_container.destroy\n\n respond_to do |format|\n format.html { redirect_to level_containers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @app_user_satisfaction_level.destroy\n respond_to do |format|\n format.html { redirect_to app_user_satisfaction_levels_url, notice: 'App user satisfaction level was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @energy_level = EnergyLevel.find(params[:id])\n @energy_level.destroy\n\n respond_to do |format|\n format.html { redirect_to energy_levels_url }\n format.json { head :ok }\n end\n end", "def destroy\n @skill_level.destroy\n respond_to do |format|\n format.html { redirect_to skill_levels_url, notice: 'Skill level was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @level_category = LevelCategory.find(params[:id])\n @level_category.destroy\n\n respond_to do |format|\n format.html { redirect_to level_categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @competency_level.destroy\n respond_to do |format|\n format.html { redirect_to competency_levels_url, notice: 'Competency level was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @reward_and_level.destroy\n respond_to do |format|\n format.html { redirect_to reward_and_levels_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @training_level = TrainingLevel.find(params[:id])\n @training_level.destroy\n\n respond_to do |format|\n format.html { redirect_to training_levels_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @contamination_level.destroy\n respond_to do |format|\n format.html { redirect_to contamination_levels_url, notice: 'Contamination level was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n\t\t@level = Level.find(params[:id])\n\t\t@level.destroy\n\t\tredirect_to new_level_path\n\tend", "def destroy\n @phase_level.destroy\n respond_to do |format|\n format.html { redirect_to phase_levels_url, notice: 'Phase level was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @ride_level.destroy\n respond_to do |format|\n format.html { redirect_to ride_levels_url, notice: 'Ride level was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @project_level.destroy\n respond_to do |format|\n format.html { redirect_to project_levels_url, notice: 'Project level was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @amputation_level.destroy\n respond_to do |format|\n format.html { redirect_to amputation_levels_url, notice: 'Amputation level was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @tdwg_level_four.destroy\n respond_to do |format|\n format.html { redirect_to tdwg_level_fours_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @level2.destroy\n respond_to do |format|\n format.html { redirect_to level2s_url, notice: 'Level2 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n authorize! :destroy, @operation_level\n @operation_level.destroy\n respond_to do |format|\n format.html { redirect_to operation_levels_url, notice: 'Operation level was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @level_progration.destroy\n respond_to do |format|\n format.html { redirect_to level_progrations_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @education_level.destroy\n respond_to do |format|\n format.html { redirect_to education_levels_url, notice: 'Education level was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @education_level = EducationLevel.find(params[:id])\n @education_level.destroy\n\n respond_to do |format|\n format.html { redirect_to education_levels_url, :notice => t('controllermessage.delete') }\n format.json { head :no_content }\n end\n end", "def destroy\n @skill_level = SkillLevel.find(params[:id])\n @skill_level.destroy\n\n respond_to do |format|\n format.html { redirect_to(skill_levels_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @severity_level.destroy\n respond_to do |format|\n format.html do\n redirect_to severity_levels_url,\n notice: 'Severity level was successfully destroyed.'\n end\n format.json { head :no_content }\n end\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to user_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @knowledge_level.destroy\n respond_to do |format|\n format.html { redirect_to knowledge_levels_url, notice: 'Knowledge level was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n id = params[:id].to_i\n UserGame.find(id)\n @user_game.destroy\n respond_to do |format|\n format.html { redirect_to user_games_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @user = User.find(params[:user_id])\n @game = @user.games.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to user_games_url(@user) }\n format.json { head :ok }\n end\n end", "def destroy\n @game_stat = GameStat.find(params[:id])\n @game_stat.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end", "def destroy\n @supervisor_level = SupervisorLevel.find(params[:id])\n @supervisor_level.destroy\n\n respond_to do |format|\n format.html { redirect_to(supervisor_levels_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @risk_level = RiskLevel.find(params[:id])\n @risk_level.destroy\n\n respond_to do |format|\n format.html { redirect_to(current_risk_configuration) }\n format.json { head :ok }\n end\n end", "def destroy\n @college_level = CollegeLevel.find(params[:id])\n @college_level.destroy\n respond_to do |format|\n format.html { redirect_to college_levels_url, notice: 'College level was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @requirement_level = RequirementLevel.find(params[:id])\n @requirement_level.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_requirement_levels_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @sponsorship_level.destroy\n respond_to do |format|\n format.html { redirect_to sponsorship_levels_url, notice: 'Sponsorship level was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @achievement.destroy\n\n respond_to do |format|\n format.html { redirect_to achievements_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @price_level = PriceLevel.find(params[:id])\n @price_level.destroy\n\n respond_to do |format|\n format.html { redirect_to price_levels_url }\n format.json { head :no_content }\n end\n end", "def destroy\n authorize! :destroy, @service_level\n @service_level.destroy\n respond_to do |format|\n format.html { redirect_to service_levels_url, notice: 'Service level was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @game = current_user.games.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :ok }\n end\n end", "def destroy\n # process the user's credentials\n return render json: { errors: ['not authenticated'] }, status: 403 unless username_and_password?\n user_id = User.authenticate(params[:username], params[:password])\n return render json: { errors: ['not authenticated'] }, status: 403 if user_id.nil?\n\n game = Game.find(params[:id])\n return render json: { errors: ['not a participant'] }, status: 403 unless game.has_user(user_id)\n\n game.destroy\n head 204\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to dashboard_path }\n format.json { head :no_content }\n end\n end", "def destroyByUDID\n @game = Ongoing.find_by_user_id(params[:user_id])\n logger.info params[:user_id]\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content } \n end\n end", "def destroy\n @medium_dungeon = MediumDungeon.find(params[:id])\n @medium_dungeon.destroy\n\n respond_to do |format|\n format.html { redirect_to medium_dungeons_url }\n format.json { head :no_content }\n end\n end", "def destroy\n authorize! :destroy, @game_type, :message => 'Not authorized as an administrator.'\n @game_type.destroy\n respond_to do |format|\n format.html { redirect_to game_types_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @achievementuser = Achievementuser.find(params[:id])\n @achievementuser.destroy\n\n respond_to do |format|\n format.html { redirect_to achievementusers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @level_progression.destroy\n respond_to do |format|\n format.html { redirect_to level_progressions_url, notice: 'Level progression was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to admin_users_path(@admin), notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @player_game_stat = PlayerGameStat.find(params[:id])\n @player_game_stat.destroy\n\n respond_to do |format|\n format.html { redirect_to player_game_stats_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @levels_point.destroy\n respond_to do |format|\n format.html { redirect_to levels_points_url, notice: 'Levels point was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @dungeon_instance = @current_user.dungeon_instances.find(params[:id])\n @dungeon_instance.destroy\n respond_to do |format|\n format.html { redirect_to dungeon_instances_url, notice: 'Dungeon instance was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n game = @goal.game\n @goal.destroy\n respond_to do |format|\n format.html { redirect_to game_path(game) }\n format.json { head :no_content }\n end\n end", "def destroy\n @reqdifficulty.destroy\n respond_to do |format|\n format.html { redirect_to reqdifficulties_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: UserBoards.delete(params[\"id\"])\n end", "def destroy\n @user_game.destroy\n respond_to do |format|\n format.html { redirect_to user_games_url, notice: 'User game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @api_v1_menu.destroy\n render json: {message: 'deletado com sucesso'}\n end", "def destroy\n\tif(user_signed_in? && (current_user.id == @game.creator_id || current_user.is_admin))\n\t @n = @game.user_games.count\n\t @game.destroy\n\t respond_to do |format|\n\t format.html { redirect_to games_url }\n\t format.json { head :no_content }\n\t end\n\tend\n end", "def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end", "def destroy\n @dungeon.destroy\n respond_to do |format|\n format.html { redirect_to dungeons_url, notice: 'Dungeon was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @admin = current_user.admin\n User.update(current_user.id, :game_id => nil, :team_id => nil, :admin => false)\n if @game.users.length == 0\n Team.find(@game.team1.id).destroy\n Team.find(@game.team2.id).destroy\n @game.destroy\n elsif @admin\n User.update(@game.users[0].id, :admin => true)\n end\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @schedule_item_level = ScheduleItemLevel.find(params[:id])\n @schedule_item_level.destroy\n\n respond_to do |format|\n format.html { redirect_to(schedule_item_levels_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n id = User.find_by_fb_id(params[:id]).id\n @user_game = UserGame.find_by_user_id(id)\n @user_game.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @member_level = MemberLevel.find(params[:id])\n @member_level.destroy\n get_paginated_member_levels\n respond_to do |format|\n format.js\n end\n end", "def destroy\n @quest_tree = QuestTree.find(params[:id])\n @quest_tree.destroy\n\n respond_to do |format|\n format.html { redirect_to quest_trees_url }\n format.json { head :ok }\n end\n end", "def destroy\n @achievement_category = AchievementCategory.find(params[:id])\n @achievement_category.destroy\n\n respond_to do |format|\n format.html { redirect_to achievement_categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @pclevel = Pclevel.find(params[:id])\n @pclevel.destroy\n\n respond_to do |format|\n format.html { redirect_to(pclevels_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @medium_status_mod = MediumStatusMod.find(params[:id])\n @medium_status_mod.destroy\n\n respond_to do |format|\n format.html { redirect_to medium_status_mods_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @holdgame = Holdgame.find(params[:id])\n @holdgame.destroy\n\n respond_to do |format|\n format.html { redirect_to gamesmaps_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @holdgame = Holdgame.find(params[:id])\n @holdgame.destroy\n\n respond_to do |format|\n format.html { redirect_to gamesmaps_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @achievement.destroy\n respond_to do |format|\n format.html { redirect_to achievements_url, notice: 'Achievement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @achievement.destroy\n respond_to do |format|\n format.html { redirect_to achievements_url, notice: 'Achievement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_quest = UserQuest.find(params[:id])\n @user_quest.destroy\n\n respond_to do |format|\n format.html { redirect_to user_quests_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @admin_game.destroy\n respond_to do |format|\n format.html { redirect_to admin_games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team_member_achievement.destroy\n respond_to do |format|\n format.html { redirect_to team_member_achievements_url, notice: 'Team member achievement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @game_judge.destroy\n respond_to do |format|\n format.html { redirect_to game_judges_url }\n format.json { head :no_content }\n end\n end", "def destroy\n # @game = Game.find(params[:id])\n # @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @status.destroy\n respond_to do |format|\n format.html { redirect_to game_character_path(@game, @character), flash: { success: I18n.t('flash_messages.success.deleted', model: I18n.t('model.status')) } }\n format.json { head :no_content }\n end\n end", "def destroy\n @logistic = @user.logistics.find(params[:id])\n @logistic.destroy\n\n respond_to do |format|\n format.html { redirect_to user_logistics_path(@user) }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_step.destroy\n respond_to do |format|\n format.html { redirect_to user_steps_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @game = Game.get(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :ok }\n end\n end", "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to contest_games_path }\n format.json { head :no_content }\n end\n end" ]
[ "0.7574058", "0.73912174", "0.73760444", "0.7357212", "0.7175903", "0.71207124", "0.70038354", "0.6990399", "0.6952091", "0.6905523", "0.6818826", "0.6762851", "0.675949", "0.675949", "0.6747088", "0.6666204", "0.6618588", "0.65951085", "0.6594954", "0.65947294", "0.65925294", "0.6591634", "0.65906334", "0.6576939", "0.656999", "0.6550251", "0.65351224", "0.65192825", "0.6498616", "0.64927584", "0.6490089", "0.6475074", "0.6473519", "0.6428143", "0.64078003", "0.63760906", "0.6357797", "0.6344965", "0.6341268", "0.6331829", "0.6322184", "0.6280645", "0.6275464", "0.62717134", "0.6254877", "0.6238308", "0.6237025", "0.62210894", "0.6218345", "0.62067926", "0.61946106", "0.61884564", "0.61785334", "0.61781734", "0.6176717", "0.6175693", "0.6171431", "0.6170666", "0.6168716", "0.6162451", "0.6157062", "0.61395913", "0.61187637", "0.6115016", "0.609087", "0.6085637", "0.6067575", "0.6055605", "0.60408753", "0.6032628", "0.6027872", "0.60278696", "0.60247654", "0.5996043", "0.59870166", "0.59765893", "0.5974193", "0.5968454", "0.5964151", "0.5962708", "0.5936951", "0.59330106", "0.5931119", "0.59301883", "0.5925268", "0.5921852", "0.5921852", "0.5917699", "0.5917699", "0.5911054", "0.5908084", "0.59064", "0.59042037", "0.5902936", "0.5902282", "0.5890731", "0.58904964", "0.5887433", "0.5884031", "0.5878335" ]
0.7834086
0
Use callbacks to share common setup or constraints between actions.
def set_user_game_level @user_game_level = UserGameLevel.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 user_game_level_params params.require(:user_game_level).permit(:user_game_id, :game_level_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 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
GET /glass_store_links GET /glass_store_links.json
def index @glass_store_links = GlassStoreLink.all @glass_store_links.each do |glass_store_link| @glass = Glass.find(glass_store_link.glass_id) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_glass_store_link\n @glass_store_link = GlassStoreLink.find(params[:id])\n end", "def index\n render json: @links\n end", "def index\n links = all_links\n render json: { success: true, links: links }\n end", "def get_links(service)\n\t\treturn @transport.get_path(\"links\",service)\n\tend", "def links\n data['links']\n end", "def links\n json_hyperschema[\"links\"] || []\n end", "def index\n @links = Link.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @links }\n end\n end", "def links\n @data[\"_links\"]\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @link }\n end\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @link }\n end\n end", "def index\n @recommended_links = RecommendedLink.all\n\n render json: @recommended_links\n end", "def index\n @linkers = Linker.all\n end", "def links\n response = Clever.request :get, url\n response[:links]\n end", "def destroy\n @glass_store_link.destroy\n respond_to do |format|\n format.html { redirect_to glass_store_links_url }\n format.json { head :no_content }\n end\n end", "def show\n @link = Link.find(params[:id])\n paginate_all_links\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @link }\n end\n end", "def index\n if request.referrer.split('/').last == \"preview\"\n @deleted_from_preview = true\n end\n \n @links = Link.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @links }\n end\n end", "def handle_links(json) end", "def index\n @links = Link.all\n end", "def index\n @links = Link.all\n end", "def index\n @links = Link.all\n end", "def index\n @links = Link.all\n end", "def index\n @links = Link.all\n end", "def index\n @links = Link.all\n end", "def index\n @links = Link.all\n end", "def index\n @links = Link.all\n end", "def to_link_json\n {\n sys: {\n type: 'Link',\n linkType: 'Upload',\n id: id\n }\n }\n end", "def to_link_json\n {\n sys: {\n type: 'Link',\n linkType: 'Upload',\n id: id\n }\n }\n end", "def links\n param = {lat: lat.to_f, lng: lng.to_f, latlng: latlng}\n Hashie::Mash.new(EXTERNAL_LINKS.map{|key, pattern| [key, pattern % param]}.to_h)\n end", "def links\n @links.values\n end", "def glass_store_link_params\n params.require(:glass_store_link).permit(:glass_id, :store_id, :quantity)\n end", "def link\n\t\t\t@data['link']\n\t\tend", "def links()\n return @links\n end", "def all_links\n Link.all\n end", "def all_links\n Link.all\n end", "def all_links\n Link.all\n end", "def index\n @links = Link.paginate(page: params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @links }\n end\n end", "def index\n @links = {}\n @link_group_opts.each do |lo|\n links = Link.find_all_by_group(lo)\n @links[lo] = links\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @links }\n end\n end", "def index\n @sites = fetch_sites\n\n @formattedSites = @sites.map do |site|\n {\n 'title' => {'value' => site.name, 'link' => { 'url' => site.routes.first.host_with_scheme, 'external' => true}, 'searchable' => true, 'sortable' => true},\n 'template' => {'value' => site.site_template&.name, 'searchable' => true, 'sortable' => true},\n 'preview' => {'value' => site.routes.first.host_with_scheme, 'link' => { 'url' => site.routes.first.host_with_scheme, 'external' => true}, 'searchable' => true, 'sortable' => true},\n 'edit' => {'value' => edit_admin_site_site_step_path(site_slug: site.slug, id: :name), 'method' => 'get'},\n 'delete' => {'value' => admin_site_path(slug: site.slug), 'method' => 'delete'}\n }\n end\n\n gon.sites = @formattedSites\n\n respond_to do |format|\n format.html { render :index }\n format.json { render json: @sites }\n end\n end", "def links\n @user = User.find(params[:id])\n render json: {status: 'SUCCESS', message: 'List all Links in User', data: @user.links},status: :ok\n end", "def index\n @pending_recommended_links = PendingRecommendedLink.all\n\n render json: @pending_recommended_links\n end", "def create\n @glass_store_link = GlassStoreLink.new(glass_store_link_params)\n @stores = Store.all\n #@glass_store_link.glass_id = params[:glass_id]\n @glass = Glass.find_by_id(params[:glass_id])\n @glass_store_link2 = @glass_store_link.is_unique_for_same_glass_kind(@glass_store_link.store_id, @glass_store_link.glass_id)\n if(@glass_store_link2)\n @glass_store_link2.quantity = @glass_store_link2.quantity+ @glass_store_link.quantity\n @glass_store_link = @glass_store_link2\n end\n\n respond_to do |format|\n if @glass_store_link.save\n format.html { redirect_to @glass_store_link, notice: 'Glass store link was successfully created.' }\n format.json { render action: 'show', status: :created, location: @glass_store_link }\n else\n if (@@action_method==1)\n format.html { render action: 'new' }\n elsif(@@action_method==2)\n format.html { redirect_to :action=>'new2', :glass_id=> @glass_store_link.glass_id }\n end\n flash[:errors] = @glass_store_link.errors.empty? ? \"Error\" : @glass_store_link.errors.full_messages\n @@links_errors = @glass_store_link.errors\n format.json { render json: @glass_store_link.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @gmaps_links = []\n @round.albums.each do |album| \n album.places.each do |place|\n gmaps_link = place.address + ' ' + place.city + ' ' + place.state\n gmaps_link.gsub!(' ', '+')\n @gmaps_links << gmaps_link\n end\n end\n end", "def index\n @system_links = SystemLink.all\n end", "def links; end", "def links; end", "def update\n respond_to do |format|\n if @glass_store_link.update(glass_store_link_params)\n format.html { redirect_to @glass_store_link, notice: 'Glass store link was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @glass_store_link.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @link = Link.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @link }\n end\n end", "def index\n @links = @panel.links\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @links }\n end\n end", "def index\n @stores = Store.all\n render json: @stores\n end", "def bannerAll\n @links = Link.order(\"link asc\")\n respond_to do |format|\n format.html # bannerAll.html.erb\n format.json { render json: @link }\n end\n end", "def show\n respond_to do |format|\n format.html do\n gon.stores = [\"AppEstablishmentStore\"] \n gon.jbuilder \n end\n\n format.json { render :show }\n end \n end", "def index\n @demo_links = DemoLink.all\n end", "def links\n @links ||= []\n @links\n end", "def index\n @admin_stores = Admin::Store.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_stores }\n end\n end", "def index\n @services = Service.all\n @services_hash = @services.map do |s|\n {service: s, medium: s.medium.map { |media|\n media.as_json.merge({ media: url_for(media) })\n }, user: s.user.username, categories: s.categories}#, galleries: s.galleries\n \n end\n render json: @services_hash\n end", "def index\n @url_links = UrlLink.all\n end", "def show\n @link = Link.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @link }\n end\n end", "def links\n return @links\n end", "def links\n return @links\n end", "def links\n return @links\n end", "def index\n @online_stores = OnlineStore.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @online_stores }\n end\n end", "def show\n render json: @store\n end", "def all\n render json: Url.all\n end", "def links\n return nil unless @item and self.type == :query and @item['entry']['link']\n @item['entry']['link']\n end", "def index\n @store = Store.find(params[:store_id])\n @menus = @store.menus\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @menus }\n end\n end", "def show\n render json: @store\n end", "def __links_for_service(service)\n if service.is_a?(GridService)\n service.grid_service_links.select{|l| l.linked_grid_service.stack == service.stack }.map{ |l| l.linked_grid_service.name }\n else\n (service[:links] || []).select{|l| !l[:name].include? '/'}.map{|l| l[:name] }\n end\n end", "def index\n @api_v1_stores = Store.all\n json_response(@api_v1_stores)\n end", "def links\n return unless current_user\n\n {}.tap do |links|\n links[:accept] = accept_api_space_path(object) if can_accept?\n links[:add_data] = add_data_api_space_path(object) if can_edit?\n links[:show] = api_space_path(object) if can_access? || current_user.review_space_admin?\n links[:delete] = delete_api_space_path(object) if can_delete?\n links[:lock] = lock_api_space_path(object) if can_lock?\n links[:unlock] = unlock_api_space_path(object) if can_unlock?\n links[:update] = api_space_path(object) if can_update?\n links[:update_tags] = tags_api_space_path(object) if can_update?\n links[:apps] = api_apps_path(object) if can_access?\n links[:files] = api_files_path(object) if can_access?\n links[:workflows] = api_workflows_path(object) if can_access?\n links[:jobs] = api_jobs_path(object) if can_access?\n links[:members] = members_api_space_path(object) if can_access?\n links[:show_shared] = api_space_path(object.space) if object.confidential?\n\n if object.shared? && confidential_space\n links[:show_private] = api_space_path(confidential_space)\n end\n end\n end", "def index\n @publinks = Publink.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @publinks }\n end\n end", "def links\n\t\t@links.keys\n\tend", "def index\n @shop_section = ShopSection.find_by_short_url(\"brands\")\n @brands = Brand.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brands }\n end\n end", "def show\n @shop = Shop.find(params[:id])\n breadcrumbs.add @shop.name,nil\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shop }\n end\n end", "def sitemap_links\n each_sitemap_link.to_a\n end", "def index\n @social_media_links = SocialMediaLink.all\n\n render json: @social_media_links\n end", "def index\n @links = current_user.links.desc :created_at\n @title = 'Shared By You'\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @links }\n end\n end", "def links\n @links ||= lambda do \n raw_links.map do |link|\n hash = {}\n link.keys.each do |key|\n hash[key] = link[key]\n end\n hash\n end\n end.call\n end", "def show\n @online_store = OnlineStore.find(params[:id])\n @products = @online_store.products\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @online_store }\n end\n end", "def index\n @stores = Store.all\n @storesFollowed = Array.new\n \n @stores.each do |store|\n if (isfollowingstore? store)\n @storesFollowed << store\n\n end\n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @storesFollowed }\n end\n end", "def show\n @sterrenlink ||= @link_request.sterrenlinks.last\n end", "def show_links\r\n links = Document.new(self).get_links\r\n puts \"There are #{links.length} links\"\r\n index = 1\r\n links.each do |l|\r\n puts \"link: name: #{l.name}\"\r\n puts \" id: #{l.id}\"\r\n puts \" href: #{l.href}\"\r\n puts \" index: #{index}\"\r\n index += 1\r\n end\r\n end", "def links\n return unless current_user && !current_user.guest?\n\n {}.tap do |links|\n # GET user accessible licenses list - show this link when current user has licenses\n links[:licenses] = api_list_licenses_path(object) unless current_user.licenses.empty?\n end\n end", "def link\n object[\"link\"]\n end", "def show\n @link = Link.find_by_slug(params[:id])\n\n respond_to do |format|\n format.html { redirect_to @link.link }\n format.json { render json: @link }\n end\n end", "def links_feed\n end", "def sanger_phenotyping_details_links( colony_prefix, result_data=nil )\n sanger_phenotyping_setup\n links = JSON.parse( @@ms.cache.fetch(\"sanger-phenotyping-pheno_links\") )[colony_prefix]\n return links\nend", "def get_games\n @games_to_link = Game.all\n end", "def index\n @stores = Store.all.includes(:admin)\n\n respond_to do |format|\n format.html\n format.json\n end\n end", "def index\n\t\t@rlinks = Rlink.all\n\tend", "def index\n @bundlelinks = Bundlelink.my_bundles(current_user)\n end", "def index\n @links = Link.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @links }\n end\n end", "def show\n @jakeslink = Jakeslink.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @jakeslink }\n end\n end", "def new\n # pismo_grab_meta_data\n paginate_all_links\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end", "def links\n _links = parent_link.update({\n self: { href: @controller.polymorphic_url(collection_hierarchy) }\n })\n\n { _links: _links }\n end", "def load_collection\n current_site.links\n end", "def get(options = {})\n if @client.nil?\n return nil\n else\n r = @client.get(self, options)\n if r.is_a? Hash\n AbiquoAPI::LinkCollection.new(r, self.type, @client)\n else\n r\n end\n end\n end", "def links\n self[\"link\"].map { |l| l.href }\n end", "def links\n self[\"link\"].map { |l| l.href }\n end", "def shop_url(params)\n @shop = Shop.find(params.id)\n render json: params\n end", "def index\n #@shares = Share.all\n @stores = Store.find_my_stores(session[:user_id])\n @sharedStores = Store.find_my_share_stores(session[:user_id])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shares }\n end\n end" ]
[ "0.68160135", "0.6572148", "0.65378535", "0.6456903", "0.63367766", "0.6296662", "0.6205558", "0.6098075", "0.60904443", "0.60904443", "0.6042652", "0.59915334", "0.5979884", "0.59631354", "0.59516263", "0.59302264", "0.5912459", "0.5906209", "0.5906209", "0.5906209", "0.5906209", "0.5906209", "0.5906209", "0.5906209", "0.5906209", "0.58512807", "0.58512807", "0.58063644", "0.5799597", "0.5796027", "0.5786388", "0.57692015", "0.57653207", "0.57653207", "0.57653207", "0.57570386", "0.5756504", "0.5754543", "0.574909", "0.57402945", "0.5739161", "0.570903", "0.57048297", "0.57037073", "0.57037073", "0.57035285", "0.56980646", "0.56978554", "0.56954217", "0.56943357", "0.5671852", "0.5659627", "0.56543076", "0.5642903", "0.5641484", "0.5640843", "0.56358236", "0.5630335", "0.5630335", "0.5630335", "0.5629799", "0.56263465", "0.5616594", "0.55948955", "0.559322", "0.55928427", "0.5582737", "0.5553064", "0.5549112", "0.55362195", "0.5523929", "0.551983", "0.5516465", "0.5515893", "0.5514889", "0.5507036", "0.55036795", "0.54931617", "0.5490906", "0.5489892", "0.5489207", "0.54857266", "0.5482692", "0.54805577", "0.547625", "0.5469183", "0.54653484", "0.5461142", "0.5460407", "0.5444161", "0.54421985", "0.54289246", "0.54146415", "0.54113543", "0.540869", "0.5408659", "0.54071754", "0.54071754", "0.54050606", "0.5402797" ]
0.74833053
0
GET /glass_store_links/1 GET /glass_store_links/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @glass_store_links = GlassStoreLink.all\n @glass_store_links.each do |glass_store_link|\n @glass = Glass.find(glass_store_link.glass_id)\n end\n end", "def set_glass_store_link\n @glass_store_link = GlassStoreLink.find(params[:id])\n end", "def index\n render json: @links\n end", "def index\n links = all_links\n render json: { success: true, links: links }\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @link }\n end\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @link }\n end\n end", "def index\n @links = Link.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @links }\n end\n end", "def get_links(service)\n\t\treturn @transport.get_path(\"links\",service)\n\tend", "def links\n json_hyperschema[\"links\"] || []\n end", "def show\n @link = Link.find(params[:id])\n paginate_all_links\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @link }\n end\n end", "def links\n data['links']\n end", "def index\n @recommended_links = RecommendedLink.all\n\n render json: @recommended_links\n end", "def handle_links(json) end", "def show\n @link = Link.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @link }\n end\n end", "def show\n @link = Link.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @link }\n end\n end", "def to_link_json\n {\n sys: {\n type: 'Link',\n linkType: 'Upload',\n id: id\n }\n }\n end", "def to_link_json\n {\n sys: {\n type: 'Link',\n linkType: 'Upload',\n id: id\n }\n }\n end", "def link\n\t\t\t@data['link']\n\t\tend", "def index\n if request.referrer.split('/').last == \"preview\"\n @deleted_from_preview = true\n end\n \n @links = Link.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @links }\n end\n end", "def link(link_full_name)\n links = objects_from_response(:get, 'api/info.json', { :id => link_full_name })\n links.first\n end", "def index\n @linkers = Linker.all\n end", "def destroy\n @glass_store_link.destroy\n respond_to do |format|\n format.html { redirect_to glass_store_links_url }\n format.json { head :no_content }\n end\n end", "def create\n @glass_store_link = GlassStoreLink.new(glass_store_link_params)\n @stores = Store.all\n #@glass_store_link.glass_id = params[:glass_id]\n @glass = Glass.find_by_id(params[:glass_id])\n @glass_store_link2 = @glass_store_link.is_unique_for_same_glass_kind(@glass_store_link.store_id, @glass_store_link.glass_id)\n if(@glass_store_link2)\n @glass_store_link2.quantity = @glass_store_link2.quantity+ @glass_store_link.quantity\n @glass_store_link = @glass_store_link2\n end\n\n respond_to do |format|\n if @glass_store_link.save\n format.html { redirect_to @glass_store_link, notice: 'Glass store link was successfully created.' }\n format.json { render action: 'show', status: :created, location: @glass_store_link }\n else\n if (@@action_method==1)\n format.html { render action: 'new' }\n elsif(@@action_method==2)\n format.html { redirect_to :action=>'new2', :glass_id=> @glass_store_link.glass_id }\n end\n flash[:errors] = @glass_store_link.errors.empty? ? \"Error\" : @glass_store_link.errors.full_messages\n @@links_errors = @glass_store_link.errors\n format.json { render json: @glass_store_link.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @links = Link.all\n end", "def index\n @links = Link.all\n end", "def index\n @links = Link.all\n end", "def index\n @links = Link.all\n end", "def index\n @links = Link.all\n end", "def index\n @links = Link.all\n end", "def index\n @links = Link.all\n end", "def index\n @links = Link.all\n end", "def index\n @pending_recommended_links = PendingRecommendedLink.all\n\n render json: @pending_recommended_links\n end", "def index\n @links = Link.paginate(page: params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @links }\n end\n end", "def bannerAll\n @links = Link.order(\"link asc\")\n respond_to do |format|\n format.html # bannerAll.html.erb\n format.json { render json: @link }\n end\n end", "def links\n @data[\"_links\"]\n end", "def show\n @link = Link.find_by_slug(params[:id])\n\n respond_to do |format|\n format.html { redirect_to @link.link }\n format.json { render json: @link }\n end\n end", "def link\n object[\"link\"]\n end", "def links\n response = Clever.request :get, url\n response[:links]\n end", "def new\n # pismo_grab_meta_data\n paginate_all_links\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end", "def show\n \t\tshort_url = 'http://localhost:3000/'+params[:shortened_link]\n \t\turl = Link.find_by(shortened_link: short_url)\n \t\tif url\n \t\t\toriginal_url = url.given_link\n \t\t\tredirect_to \"#{original_url}\"\n \t\telse\n \t\t\trender json: \"Not found\"\n \t\tend\n \tend", "def show\n @link = Link.find(params[:id])\n\t\n\t@clicks = Click.count(:all, :conditions => [\"link_id = :link_id\", :link_id => @link.id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @link }\n end\n end", "def show\n @jakeslink = Jakeslink.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @jakeslink }\n end\n end", "def index\n @links = current_user.links.desc :created_at\n @title = 'Shared By You'\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @links }\n end\n end", "def update\n respond_to do |format|\n if @glass_store_link.update(glass_store_link_params)\n format.html { redirect_to @glass_store_link, notice: 'Glass store link was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @glass_store_link.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @sterrenlink ||= @link_request.sterrenlinks.last\n end", "def show\n @useful_link = UsefulLink.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @useful_link }\n end\n end", "def links\n @user = User.find(params[:id])\n render json: {status: 'SUCCESS', message: 'List all Links in User', data: @user.links},status: :ok\n end", "def index\n @links = @panel.links\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @links }\n end\n end", "def index\n @links = {}\n @link_group_opts.each do |lo|\n links = Link.find_all_by_group(lo)\n @links[lo] = links\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @links }\n end\n end", "def show\n @shop = Shop.find(params[:id])\n breadcrumbs.add @shop.name,nil\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shop }\n end\n end", "def index\n @url_links = UrlLink.all\n end", "def index\n @system_links = SystemLink.all\n end", "def index\n @api_v1_stores = Store.all\n json_response(@api_v1_stores)\n end", "def new\n @link = Link.new\n @links_a=ManRsc.all\n @links_b=@links_a\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end", "def show\n respond_to do |format|\n format.html do\n gon.stores = [\"AppEstablishmentStore\"] \n gon.jbuilder \n end\n\n format.json { render :show }\n end \n end", "def links; end", "def links; end", "def links_for_item(item)\n links = super(item)\n\n links.push({\n 'rel' => 'status',\n 'type' => api_media_type(:g5kitemjson),\n 'href' => uri_to(File.join(resource_path(item['uid']), 'status'))\n })\n links\n end", "def index\n @sites = fetch_sites\n\n @formattedSites = @sites.map do |site|\n {\n 'title' => {'value' => site.name, 'link' => { 'url' => site.routes.first.host_with_scheme, 'external' => true}, 'searchable' => true, 'sortable' => true},\n 'template' => {'value' => site.site_template&.name, 'searchable' => true, 'sortable' => true},\n 'preview' => {'value' => site.routes.first.host_with_scheme, 'link' => { 'url' => site.routes.first.host_with_scheme, 'external' => true}, 'searchable' => true, 'sortable' => true},\n 'edit' => {'value' => edit_admin_site_site_step_path(site_slug: site.slug, id: :name), 'method' => 'get'},\n 'delete' => {'value' => admin_site_path(slug: site.slug), 'method' => 'delete'}\n }\n end\n\n gon.sites = @formattedSites\n\n respond_to do |format|\n format.html { render :index }\n format.json { render json: @sites }\n end\n end", "def index\n @demo_links = DemoLink.all\n end", "def links\n return nil unless @item and self.type == :query and @item['entry']['link']\n @item['entry']['link']\n end", "def link\n @link\n end", "def index\n @shop_section = ShopSection.find_by_short_url(\"brands\")\n @brands = Brand.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brands }\n end\n end", "def show\n json_response(@api_v1_store)\n end", "def glass_store_link_params\n params.require(:glass_store_link).permit(:glass_id, :store_id, :quantity)\n end", "def show\n @link = @panel.links.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @link }\n end\n end", "def index\n \n @links_grid = initialize_grid(ClientNumber)\n \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @client_numbers }\n end\n end", "def show\n @link = Link.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @link }\n format.json { render :json => @link }\n end\n end", "def all\n render json: Url.all\n end", "def show\n render json: @store\n end", "def index\n @publinks = Publink.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @publinks }\n end\n end", "def href\n link.gsub(\".json\", \"\")\n end", "def all_links\n Link.all\n end", "def all_links\n Link.all\n end", "def all_links\n Link.all\n end", "def show\n @xlink = Xlink.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @xlink }\n end\n end", "def index\n @social_media_links = SocialMediaLink.all\n\n render json: @social_media_links\n end", "def index\n @urls = ShortenedUrl.order(\"updated_at ASC\").all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @urls }\n end\n end", "def index\n @services = Service.all\n @services_hash = @services.map do |s|\n {service: s, medium: s.medium.map { |media|\n media.as_json.merge({ media: url_for(media) })\n }, user: s.user.username, categories: s.categories}#, galleries: s.galleries\n \n end\n render json: @services_hash\n end", "def links()\n return @links\n end", "def links\n @links.values\n end", "def show\n @online_store = OnlineStore.find(params[:id])\n @products = @online_store.products\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @online_store }\n end\n end", "def show\n render json: @store\n end", "def links\n param = {lat: lat.to_f, lng: lng.to_f, latlng: latlng}\n Hashie::Mash.new(EXTERNAL_LINKS.map{|key, pattern| [key, pattern % param]}.to_h)\n end", "def sanger_phenotyping_details_links( colony_prefix, result_data=nil )\n sanger_phenotyping_setup\n links = JSON.parse( @@ms.cache.fetch(\"sanger-phenotyping-pheno_links\") )[colony_prefix]\n return links\nend", "def index\n @online_stores = OnlineStore.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @online_stores }\n end\n end", "def index\n\t\t@rlinks = Rlink.all\n\tend", "def new\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end", "def new\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end", "def new\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end", "def new\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end", "def new\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end", "def links\n @links ||= []\n @links\n end", "def show\n\t\trender json: @url, status: 200\n\tend", "def show\n render json: @url\n end", "def shop_url(params)\n @shop = Shop.find(params.id)\n render json: params\n end", "def get(options = {})\n if @client.nil?\n return nil\n else\n r = @client.get(self, options)\n if r.is_a? Hash\n AbiquoAPI::LinkCollection.new(r, self.type, @client)\n else\n r\n end\n end\n end", "def show\n @affiliate_link = AffiliateLink.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @affiliate_link }\n end\n end", "def create\n if @link.save\n render json: @link, status: :created, location: @link\n else\n render json: @link.errors, status: :unprocessable_entity\n end\n end", "def api_url\n ensure_full_data!\n @gapi[\"selfLink\"]\n end", "def index\n @admin_stores = Admin::Store.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_stores }\n end\n end" ]
[ "0.7269414", "0.6822114", "0.66408694", "0.6549453", "0.63980824", "0.63980824", "0.6312608", "0.63011116", "0.62857455", "0.62674475", "0.61972606", "0.6174476", "0.61673266", "0.61542404", "0.60944045", "0.60434026", "0.60434026", "0.6029031", "0.59953207", "0.59783363", "0.5973057", "0.5950598", "0.59475684", "0.5929444", "0.5929444", "0.5929444", "0.5929444", "0.5929444", "0.5929444", "0.5929444", "0.5929444", "0.59017044", "0.5876", "0.5852076", "0.5850593", "0.5836586", "0.5831975", "0.58237505", "0.5813638", "0.5807373", "0.5797164", "0.57957417", "0.5785678", "0.5769665", "0.57615197", "0.57316834", "0.572971", "0.5717327", "0.57116556", "0.5698348", "0.5693845", "0.567327", "0.56694067", "0.56678945", "0.5660728", "0.56534535", "0.56534535", "0.5651513", "0.56442976", "0.5643594", "0.56360495", "0.56317055", "0.5631044", "0.56310356", "0.5629909", "0.5619581", "0.5615009", "0.56100416", "0.5609507", "0.56089526", "0.560815", "0.5607208", "0.5604059", "0.5604059", "0.5604059", "0.5602706", "0.5591321", "0.559031", "0.55793554", "0.5570786", "0.5565926", "0.5563866", "0.5556489", "0.55559456", "0.5554389", "0.5539189", "0.5532972", "0.55294967", "0.55294967", "0.55294967", "0.55294967", "0.55294967", "0.5523535", "0.55187243", "0.5517412", "0.55169106", "0.5513346", "0.55105406", "0.5508531", "0.5498911", "0.5498511" ]
0.0
-1
POST /glass_store_links POST /glass_store_links.json
def create @glass_store_link = GlassStoreLink.new(glass_store_link_params) @stores = Store.all #@glass_store_link.glass_id = params[:glass_id] @glass = Glass.find_by_id(params[:glass_id]) @glass_store_link2 = @glass_store_link.is_unique_for_same_glass_kind(@glass_store_link.store_id, @glass_store_link.glass_id) if(@glass_store_link2) @glass_store_link2.quantity = @glass_store_link2.quantity+ @glass_store_link.quantity @glass_store_link = @glass_store_link2 end respond_to do |format| if @glass_store_link.save format.html { redirect_to @glass_store_link, notice: 'Glass store link was successfully created.' } format.json { render action: 'show', status: :created, location: @glass_store_link } else if (@@action_method==1) format.html { render action: 'new' } elsif(@@action_method==2) format.html { redirect_to :action=>'new2', :glass_id=> @glass_store_link.glass_id } end flash[:errors] = @glass_store_link.errors.empty? ? "Error" : @glass_store_link.errors.full_messages @@links_errors = @glass_store_link.errors format.json { render json: @glass_store_link.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n if @link.save\n render json: @link, status: :created, location: @link\n else\n render json: @link.errors, status: :unprocessable_entity\n end\n end", "def glass_store_link_params\n params.require(:glass_store_link).permit(:glass_id, :store_id, :quantity)\n end", "def set_glass_store_link\n @glass_store_link = GlassStoreLink.find(params[:id])\n end", "def create\n @link = Link.new(params[:link])\n\n respond_to do |format|\n if @link.save\n @response = { url: \"#{request.protocol}#{request.host_with_port}/#{Link.encode(@link.id)}\" }\n format.json { render json: @response, status: :created, location: @link }\n else\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @link = Link.new(params[:link])\n\n respond_to do |format|\n if (@entity.links << @link)\n flash[:notice] = 'Link was successfully created.'\n furl = link_url(@entity,@link)\n format.html { redirect_to furl}\n format.xml { head :created, :location => furl }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @link.errors.to_xml }\n end\n end\n end", "def create_links\n end", "def create_links\n end", "def create\n @check_link = CheckLink.new()\n\n @check_link.get_all_links(check_link_params['checked_url'])\n respond_to do |format|\n if @check_link.save\n format.html { redirect_to @check_link, notice: 'Check link was successfully created.' }\n format.json { render :show, status: :created, location: @check_link }\n else\n format.html { render :new }\n format.json { render json: @check_link.errors, status: :unprocessable_entity }\n end\n end\n end", "def handle_links(json) end", "def to_link_json\n {\n sys: {\n type: 'Link',\n linkType: 'Upload',\n id: id\n }\n }\n end", "def to_link_json\n {\n sys: {\n type: 'Link',\n linkType: 'Upload',\n id: id\n }\n }\n end", "def create\n @link = Link.new(params[:link])\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to @link, :notice => 'Ссылка была успешно создана' }\n format.mobile { redirect_to @link, :notice => 'Ссылка была успешно создана' }\n format.json { render :json => @link, :status => :created, :location => @link }\n else\n format.html { render :action => \"new\" }\n format.mobile { render :action => \"new\" }\n format.json { render :json => @link.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @link = current_user.links.build(link_params)\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to @link, notice: 'Review was successfully created.' }\n format.json { render :show, status: :created, location: @link }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n \t@url = Url.build(params[:link],request.base_url) \t\n \trender json: @url.to_json\n end", "def create\n @link = Link.new(params[:link])\n doc = Pismo::Document.new(@link.url) \n #grab metadata from doc\n if doc.title.nil?\n @link.name = doc.description\n else\n @link.name = doc.title\n end\n @link.favicon = doc.favicon\n\n #FOR OFFLINE USE\n #@link.name = \"Offline Description\"\n\n\n\n\n paginate_all_links\n respond_to do |format|\n if @link.save\n #if using bookmarklet foward back to link you came from\n if request.referer =~ /autosave/\n format.html { redirect_to @link.url }\n else\n #if using frontpage redirect to show all links \n format.html { redirect_to root_url+\"#show-links\", notice: 'Link was successfully created.' }\n end\n format.html { redirect_to @link.url, notice: 'Link was successfully created.' }\n format.json { render json: @link, status: :created, location: @link }\n else\n format.html { render action: \"new\" }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @test_link = TestLink.new(test_link_params)\n\n if @test_link.save\n render :show, status: :created, location: @test_link\n else\n render json: @test_link.errors, status: :unprocessable_entity\n end\n end", "def create\n @link = current_user.links.build(link_params) # using devise helper \"current_user\"\n logger.debug \" DEBUG :::::::: #{link_params.to_json}\"\n respond_to do |format|\n if @link.save\n format.html { redirect_to @link, notice: 'Link was successfully created.' }\n format.json { render :show, status: :created, location: @link }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @link = Link.new(link_params)\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to @link, notice: 'Link was successfully created.' }\n format.json { render :show, status: :created, location: @link }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @link = Link.new(link_params)\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to @link, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @link }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @link_builder = LinkBuilder.new(link_builder_params)\n\n respond_to do |format|\n if @link_builder.save\n format.html { redirect_to @link_builder, notice: \"Link builder was successfully created.\" }\n format.json { render :show, status: :created, location: @link_builder }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @link_builder.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @glass_store_links = GlassStoreLink.all\n @glass_store_links.each do |glass_store_link|\n @glass = Glass.find(glass_store_link.glass_id)\n end\n end", "def create\n @link = Link.new(params[:link])\n puts @link\n respond_to do |format|\n if @link.save\n format.html { redirect_to @link, notice: 'Link was successfully created.' }\n format.json { render json: @link, status: :created, location: @link }\n else\n format.html { render action: \"new\" }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def ajax_add_link\n\n # Create a new Link Instance\n link = Link.new\n\n # Update the fields of Link Instance\n link.funnel_id = params[:funnel_id]\n link.to_node_id = params[:to_operator_id].to_i\n\n if params[:from_operator_id].to_i === 0\n # If the link starts at the start node, set slink to 1\n link.start_link = 1\n else\n # Otherwise, set slink to 0 (false) and set from_operator_id\n link.start_link = 0\n link.from_node_id = params[:from_operator_id].to_i\n end\n\n # Save and verify Link and return correct JSON response\n if link.save!\n final_json = JSON.pretty_generate(result = {\n :success => true\n })\n else\n final_json = JSON.pretty_generate(result = {\n :success => false\n })\n end\n\n # Return JSON response\n render json: final_json\n\n end", "def create\n @link = current_user.links.build(link_params)\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to @link, notice: 'Link was successfully created.' }\n format.json { render :show, status: :created, location: @link }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @link = @campaign.links.new(link_params)\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to campaign_links_path, notice: 'Link was successfully created.' }\n format.json { render :show, status: :created, location: campaign_links_path }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @link_request = LinkRequest.new(link_request_params)\n\n respond_to do |format|\n if @link_request.save\n @link_request.sterrenlinks.create!\n format.html { redirect_to @link_request, notice: 'Link request was successfully created.' }\n format.json { render :show, status: :created, location: @link_request }\n else\n format.html { render :new }\n format.json { render json: @link_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @link = Link.new(params[:link])\n puts \"////////////////////////////\"\n puts params\n respond_to do |format|\n if @link.save\n format.html { redirect_to links_url, notice: t('links.create.notice') }\n format.json { render json: @link, status: :created, location: @link }\n else\n @links_a=ManRsc.all\n @links_b=linksb(params[:link][:link_a])\n format.html { render action: \"new\" }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @link = Link.new(link_params)\n\n respond_to do |format|\n if @link.save\n if @link.shortened.nil? or @link.shortened.empty?\n @link.assign_unique_shortened_string\n @link.save\n end\n current_user.links << @link\n current_user.save\n\n format.html { redirect_to @link, notice: 'Link was successfully created.' }\n format.json { render :show, status: :created, location: @link }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def new_service_links(service, row)\n new_link = service.links.find_or_initialize_by(label: row[\"links_label\"], url: row[\"links_url\"])\n if new_link.save\n puts \" 🟢 Link: created (id: #{new_link.id}).\"\n else\n abort(\" 🔴 Link: was not created. Exiting. #{new_link.errors.messages}\")\n end\n end", "def create\n @link = Link.new(link_params)\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to info_path(@link.slug), notice: \"Link was successfully created.\" }\n format.json { render :show, status: :created, location: @link }\n else\n format.html { redirect_to new_link_path, alert: @link.errors.full_messages.join(\", \") }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @useful_link = UsefulLink.new(params[:useful_link])\n\n respond_to do |format|\n if @useful_link.save\n format.html { redirect_to @useful_link, notice: 'Useful link was successfully created.' }\n format.json { render json: @useful_link, status: :created, location: @useful_link }\n else\n format.html { render action: \"new\" }\n format.json { render json: @useful_link.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @glass_store_link.destroy\n respond_to do |format|\n format.html { redirect_to glass_store_links_url }\n format.json { head :no_content }\n end\n end", "def create\n @link = Link.new(link_params)\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to edit_link_url(@link), notice: 'Link was successfully created.' }\n format.json { render :edit, status: :created, location: edit_link_url(@link) }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ordering_link = OrderingLink.new(ordering_link_params)\n\n respond_to do |format|\n if @ordering_link.save\n format.html { redirect_to @ordering_link, notice: 'Ordering link was successfully created.' }\n format.json { render :show, status: :created, location: @ordering_link }\n else\n format.html { render :new }\n format.json { render json: @ordering_link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @glass_store_link.update(glass_store_link_params)\n format.html { redirect_to @glass_store_link, notice: 'Glass store link was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @glass_store_link.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @link = Link.new(link_params)\n @link.user_id = session[:user_id]\n respond_to do |format|\n if @link.save\n format.html do\n redirect_to root_path,\n notice: \"Short Url is '#{@link.display_slug}'\"\n end\n format.json { render :show, status: :created, location: @link }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @demo_link = DemoLink.new(demo_link_params)\n\n respond_to do |format|\n if @demo_link.save\n format.html { redirect_to @demo_link, notice: 'Demo link was successfully created.' }\n format.json { render :show, status: :created, location: @demo_link }\n else\n format.html { render :new }\n format.json { render json: @demo_link.errors, status: :unprocessable_entity }\n end\n end\n end", "def store_all_links variable_name\r\n command 'storeAllLinks', variable_name\r\n end", "def create\n @link = current_user.links.build(link_params)\n \n @link.num = 2\n @link.user_name = current_user.nickname\n @link.description = current_user.description\n @link.description_permission = current_user.description_permission\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to @link, notice: '투표안건이 성공적으로 작성되었습니다.' }\n format.json { render :show, status: :created, location: @link }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @link = Link.new(params[:link])\n @link.user = current_user\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to @link, notice: 'Link was successfully created.' }\n format.json { render json: @link, status: :created, location: @link }\n else\n format.html { render action: \"new\" }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @link = current_user.links.new link_params\n create_and_respond(@link)\n end", "def create\n @recommended_link = RecommendedLink.new(recommended_link_params)\n\n if @recommended_link.save\n render json: @recommended_link, status: :created, location: @recommended_link\n else\n render json: @recommended_link.errors, status: :unprocessable_entity\n end\n end", "def create\n @jakeslink = Jakeslink.new(params[:jakeslink])\n\n respond_to do |format|\n if @jakeslink.save\n format.html { redirect_to @jakeslink, notice: 'Jakeslink was successfully created.' }\n format.json { render json: @jakeslink, status: :created, location: @jakeslink }\n else\n format.html { render action: \"new\" }\n format.json { render json: @jakeslink.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\tlink = current_user.links.new(link_params)\n\n\t\trespond_to do | format |\n\t\t\tif link.save\n\t\t\t\tformat.html{\n\t\t\t\t\tredirect_to link\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tformat.html{\n\t\t\t\t\trender action: \"new\"\n\t\t\t\t}\n\t\t\tend\n\t\tend \n\t\t\n\tend", "def create\n @link = Link.new(link_params)\n @link.active = true # make link active by default\n @link.admin_id = SecureRandom.uuid\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to link_admin_path(@link.admin_id), notice: \"Link was successfully created.\" }\n # format.json { render :show, status: :created, location: @link }\n else\n format.html { render :new, status: :unprocessable_entity }\n # format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @url_link = UrlLink.new(url_link_params)\n\n respond_to do |format|\n if @url_link.save\n format.html { redirect_to @url_link, notice: 'Url link was successfully created.' }\n format.json { render :show, status: :created, location: @url_link }\n else\n format.html { render :new }\n format.json { render json: @url_link.errors, status: :unprocessable_entity }\n end\n end\n end", "def test_should_create_link_via_API_JSON\r\n get \"/logout\"\r\n post \"/links.json\", :api_key => 'testapikey',\r\n :link => {:user_id => 1,\r\n :title => 'API Link 1',\r\n :url => 'http://www.api.com'}\r\n assert_response :created\r\n link = JSON.parse(response.body)\r\n check_new_link(link) \r\n end", "def create\n @link = Link.new(link_params)\n add_http\n if Link.find_by address: @link.address.downcase\n new_link = Link.find_by address: @link.address\n redirect_to root_path\n else\n @link.vote_score = 0\n respond_to do |format|\n if @link.save\n format.html { redirect_to @link, notice: 'Link was successfully created.' }\n format.json { render :show, status: :created, location: @link }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "def create\n @bundlelink = current_user.bundlelinks.new(bundlelink_params)\n\n respond_to do |format|\n if @bundlelink.save\n format.html { redirect_to @bundlelink, notice: 'Bundlelink was successfully created.' }\n format.json { render :show, status: :created, location: @bundlelink }\n else\n format.html { render :new }\n format.json { render json: @bundlelink.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n render json: @links\n end", "def create\n \n\t# Cria o hash MD5 da string do link\n params[:link][:token] = Digest::MD5.hexdigest(params[:link][:link]).encode('UTF-8')\n\t\n\t# Obtem o ID do usuario\n\tparams[:link][:user_id] = session[:user_id]\n\t\n\t# Verifica se este hash ja nao existe no banco. MD5 gera conflitos, mas como sao \n\t# poucos links, isto nao sera problema.\n\t@link = Link.find_by_token params[:link][:token]\n\t\n\t# Variavel de verificacao para saber se o link foi salvo\n\tsave = 0\n\t\n\t# Se o link nao existir no banco...\n\tif @link.nil? then\n\t\n\t\t# Obtem os dados do usuario (IP e user agent)\n\t params[:link][:ip] = request.env[\"REMOTE_ADDR\"].encode('UTF-8')\n\t params[:link][:user_agent] = request.env[\"HTTP_USER_AGENT\"].encode('UTF-8')\n\t \n\t # Cria o registro\n\t @link = Link.new(params[:link]) \n\t \n\t # Salva, verifica o salvamento e atualiza a variavel para verificacao do salvamento\n\t save = @link.save ? 1 : 0\n\tend\n \t\n respond_to do |format|\n if save == 1\n format.html { redirect_to @link, notice: 'Link adicionado com sucesso!' }\n format.json { render json: @link, status: :created, location: @link }\n else\n format.html { redirect_to @link, notice: 'Link ja adicionado anteriormente!' }\n format.json { render json: @link, status: :created, location: @link }\n end\n end\n end", "def link_data\n params.permit(links: [:url])\n .require(:links)\n .values\n end", "def create\n @link = current_user.links.new( link_params )\n # @link = Link.new( link_params )\n # @link.user = current_user\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to @link, notice: 'Link was successfully created.' }\n format.json { render :show, status: :created, location: @link }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @link = Link.new(params[:link])\n \n respond_to do |format|\n if @link.save\n flash[:notice] = 'Link was successfully created.'\n format.html { redirect_to(@link) }\n format.xml { render :xml => @link, :status => :created, :location => @link }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n # Get the user name and links that have been sent from the extension\n name = params[:name] # received as a string [to be checked]\n urls = params[:urls] # received as an array\n # binding.pry\n # urls = urls.gsub(/[\\[\\]]/, '').split(', ') # Just for testing with Postman\n # Find the corresponding user\n user = User.find_by(name: name)\n # Get access to all the sources\n sources = Source.all\n # Iterate over each of the urls if links received\n if urls\n urls.each do |url|\n # Check the url against each of the sources 'url_base'\n sources.each do |source|\n # If it matches then create a Links table entry with reference to the source and user matched\n regexp = Regexp.new(source.url_base)\n if url.match(regexp)\n Link.create!(url: url, user: user, source: source)\n end\n end\n end\n end\n end", "def create\n @link = Link.new(params[:link].merge(:created_by => current_user)) \n respond_to do |format|\n if @link.save!\n logger.warn(\"#{@link.id}\")\n publish :links, \"#{@link.id}\\0\"\n flash[:notice] = 'Link was successfully created.'\n format.html { redirect_to(@link) }\n format.xml { render :xml => @link, :status => :created, :location => @link }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @link = Link.new(link_params)\n @link.user = current_user\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to @link, notice: 'Link was successfully created.' }\n format.json { render :show, status: :created, location: @link }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def links\n json_hyperschema[\"links\"] || []\n end", "def create\n @linkpost = Linkpost.new(linkpost_params)\n\n respond_to do |format|\n if @linkpost.save\n format.html { redirect_to @linkpost, notice: 'Linkpost was successfully created.' }\n format.json { render action: 'show', status: :created, location: @linkpost }\n else\n format.html { render action: 'new' }\n format.json { render json: @linkpost.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_link(links)\n links = [links] if links.is_a?(String)\n self.class.get(\"/action/add/links/grabber0/start1/\"+links.join(\" \"))\n end", "def create\n @link_resource = LinkResource.new(link_resource_params)\n\n respond_to do |format|\n if @link_resource.save\n format.html { redirect_to @lab, notice: 'Link resource was successfully created.' }\n format.json { render action: 'show', status: :created, location: @link_resource }\n else\n format.html { render action: 'new' }\n format.json { render json: @link_resource.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if params[:long_url].blank? \n long_url = params[:link][:long_url]\n else\n long_url = params[:long_url]\n end\n if params[:domain_id].blank? \n domain_id = params[:link][:domain_id]\n else\n domain_id = params[:domain_id]\n end\n @link = Link.find_or_create_by_long_url_and_domain_id( long_url, domain_id )\n @link.ip_address = request.remote_ip\n @link.format = request.format.to_s\n\n respond_to do |format|\n if @link.save\n format.xml { render :xml => @link.to_xml(:only => [ :long_url, :short_url ]), :status => :created, :location => @link }\n format.json { render :json => @link.to_json(:only => [ :long_url, :short_url ]), :status => :created, :location => @link }\n else\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n format.json { render :json => @link.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new\n # pismo_grab_meta_data\n paginate_all_links\n @link = Link.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end", "def create\n long_url = params.include?(:long_url) ? params[:long_url] : params[:link][:long_url]\n domain_id = params.include?(:domain_id) ? params[:domain_id] : params[:link][:domain_id]\n @link = Link.find_or_create_by_long_url_and_domain_id( long_url, domain_id )\n @link.ip_address = request.remote_ip\n @link.user_id = current_user.id\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to(@link, :notice => 'Link was successfully created.') }\n format.xml { render :xml => @link, :status => :created, :location => @link }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end", "def add_to_database\n Link.add({\"assignment_id\" => \"#{self.assignment_id}\", \"link\" => \"#{self.link}\", \"type\" => \"#{self.type}\"})\n end", "def create\n @linkctr = Linkctr.new(linkctr_params)\n\n respond_to do |format|\n if @linkctr.save\n format.html { redirect_to @linkctr, notice: 'Linkctr was successfully created.' }\n format.json { render action: 'show', status: :created, location: @linkctr }\n else\n format.html { render action: 'new' }\n format.json { render json: @linkctr.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @link = Link.new(params[:link])\n\n respond_to do |format|\n if @link.save\n flash[:notice] = 'Link was successfully created.'\n format.html { redirect_to :controller => 'admin/links' }\n format.xml { render :xml => @link, :status => :created, :location => @link }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @link = Link.new(params[:link])\n\n respond_to do |format|\n if @link.save\n flash[:notice] = 'Link was successfully created.'\n format.html { redirect_to(@link) }\n format.xml { render :xml => @link, :status => :created, :location => @link }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @link = Link.new(params[:link])\n\n respond_to do |format|\n if @link.save\n flash[:notice] = 'Link was successfully created.'\n format.html { redirect_to(@link) }\n format.xml { render :xml => @link, :status => :created, :location => @link }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @system_link = SystemLink.new(system_link_params)\n\n respond_to do |format|\n if @system_link.save\n format.html { redirect_to @system_link, notice: 'System link was successfully created.' }\n format.json { render :show, status: :created, location: @system_link }\n else\n format.html { render :new }\n format.json { render json: @system_link.errors, status: :unprocessable_entity }\n end\n end\n end", "def save\n @link.Save\n end", "def create\n\t\trandom_str = SecureRandom.urlsafe_base64(10)\n\t\tlink = Link.create(url: params[\"link\"][\"url\"], random_string: random_str)\n\t\tredirect_to link_path(link.random_string)\n\tend", "def create\n @link = Link.new(params[:link])\n @link.user = @current_user\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to link_comments_url(@link), notice: 'Link was successfully created.' }\n format.json { render json: link_comments_url(@link), status: :created, location: link_comments_url(@link) }\n else\n format.html { render action: \"new\" }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @linker = Linker.new(linker_params)\n\n respond_to do |format|\n if @linker.save\n format.html { redirect_to @linker, notice: 'Linker was successfully created.' }\n format.json { render :show, status: :created, location: @linker }\n else\n format.html { render :new }\n format.json { render json: @linker.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @link = Link.new(link_params)\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to @link, notice: 'Link was successfully created.' }\n format.js { render js: 'window.top.location.reload(true);' }\n format.json { render :show, status: :created, location: @link }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def post_links\n return if @links.nil?\n\n if @links.empty?\n Rentlinx.client.unpost_links_for(self)\n else\n Rentlinx.client.post_links(@links)\n end\n end", "def create_digital_links\n digital_links.delete_all\n\n variant.digitals.each do |digital|\n self.quantity.times do\n digital_links.create!(:digital => digital)\n end \n end\n end", "def link_params\n params.require(:link).permit(:name, :streetaddress, :regionaladdress, :averageprice, :built, :floors, :suites, :bedroom => [], :amenities => [])\n end", "def create_raw\n\n @link = Link.new(link_params)\n\n # print params\n puts link_params\n\n # get HTML from saved source\n @link.html_from_url(link_params['html'])\n \n # retrieve thumbnail from URL\n @link.picture_from_url(link_params['screenshot'])\n\n respond_to do |format|\n if @link.save\n format.html { redirect_to @link, notice: 'Link was successfully created.' }\n format.json { render :show, status: :created, location: @link }\n else\n format.html { render :new }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_links(settings_list, jira_client)\n @settings_list.links.each do |linktype, target|\n link = jira_client.Issuelink.build\n if (target['direction'] == 'inward')\n link.save({\n :type => {:name => linktype},\n :inwardIssue => {:key => target['ticket']},\n :outwardIssue => {:key => @issue.key},\n })\n else\n link.save({\n :type => {:name => linktype},\n :inwardIssue => {:key => @issue.key},\n :outwardIssue => {:key => target['ticket']},\n })\n end\n end\n end", "def create\n\t\tnew_rlink = params.require(:rlink).permit(:link, :random_string)\n\t\trlink = Rlink.create(new_rlink)\n \tredirect_to rlink\n\tend", "def create\n @link = Link.new(params[:link])\n \n @link.user_id = current_user_id\n\n respond_to do |format|\n if @link.save\n @post = Post.find(@link.post_id);\n format.html { redirect_to @link, notice: 'Link was successfully created.' }\n format.json { render json: @link, status: :created, location: @link }\n format.js {}\n else\n format.html { render action: \"new\" }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\t@link = Link.new(params[:link])\n\t\t@link.def_user(current_user)\n\t\trespond_to do |format|\n\t\t#@link.type_values=params[:link][:values].to_json unless params[:link][:values].nil?\n\t\t\tif @link.save\n\t\t\t\tflash[:notice] = t(:ctrl_object_created, :typeobj => t(:ctrl_link), :ident => @link.ident)\n\t\t\t\tparams[:id]=@link.id\n\t\t\t\tshow_\n\t\t\t\tformat.html { render :action => \"show\" }\n\t\t\t\tformat.xml { render :xml => @link, :status => :created, :location => @link }\n\t\t\telse\n\t\t\t\tflash[:error] = t(:ctrl_object_not_created,:typeobj =>t(:ctrl_link), :msg => nil)\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def create\n @store = Store.new(params[:store])\n\n \n\n respond_to do |format|\n if @store.save\n # Create the tibbr resource for the store\n action_typ = \"og:comment\"\n publish_req = {:message=>{:rich_content=>\"New Store !\"}, :action_type=>action_typ, :client_id=> session[:app_id], :resource=>{:app_id => session[:app_id], :key => \"ID_#{@store.id}\", :title => \"#{@store.name}_#{@store.name}\",:description => \"test\", :scope => \"public\", :type => \"ad:store\", :owners => [@current_user.id], :url => \"#{APP_CONFIG[Rails.env]['retail']['root']}#stores/#{@store.country}/#{@store.city}/#{@store.id}\", :action_links => [{:url => \"#{APP_CONFIG[Rails.env]['retail']['root']}#stores/#{@store.country}/#{@store.city}/#{@store.id}\", :label => \"View\", :display_target => \"app\"}] }}.to_json;\n\n #encryptor = Encryptor.new(application_config_decrypt_key, \"\")\n encryptor = Encryptor.new(\"947aafe0-e8b1-11e2-9fa4-a4199b34c982\", \"\")\n signed_hash_string = encryptor.encrypt(publish_req)\n\n # Tibbr::ExternalResourceAction.publish ({:client_id=> session[:app_id], :signed_hash=> publish_req})\n \n Tibbr::ExternalResourceAction.publish ({:client_id=> session[:app_id], :signed_hash=> signed_hash_string})\n \n tib_res = Tibbr::ExternalResource.find_by_resource_key({:resource => {:key => \"ID_#{@store.id}\", :resource_type => \"ad:store\"}, :client_id => session[:app_id]})\n \n @store.tibbr_id = tib_res.id\n @store.tibbr_key = \"ID_#{@store.id}\"\n\n \n @store.save\n format.html { redirect_to @store, notice: 'Store was successfully created.' }\n format.json { render json: @store, status: :created, location: @store }\n else\n format.html { render action: \"new\" }\n format.json { render json: @store.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n links = all_links\n render json: { success: true, links: links }\n end", "def create\n @link = Link.new(link_params)\n @link.pot = current_pot\n @link.user = current_user\n \n respond_to do |format|\n if @link.save\n\n format.html do\n if params[:return_to].present?\n redirect_to params[:return_to]\n else\n redirect_to @link.pot, notice: 'Link wurde hinzugefügt.'\n end\n end\n format.json { render action: 'show', status: :created, location: @link }\n else\n format.html { render action: 'pots/new' }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @sitelink = Sitelink.new(sitelink_params)\n\n respond_to do |format|\n if @sitelink.save\n format.html { redirect_to @sitelink, notice: 'Sitelink was successfully created.' }\n format.json { render :show, status: :created, location: @sitelink }\n else\n format.html { render :new }\n format.json { render json: @sitelink.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @reporte_link = ReporteLink.new(reporte_link_params)\n\n respond_to do |format|\n if @reporte_link.save\n format.html { redirect_to @reporte_link, notice: 'Reporte link was successfully created.' }\n format.json { render :show, status: :created, location: @reporte_link }\n else\n format.html { render :new }\n format.json { render json: @reporte_link.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @listing = Listing.new(params[:listing])\n @listing.urls.append params[:url]\n\n respond_to do |format|\n if @listing.save\n format.html { redirect_to @listing, notice: 'Listing was successfully created.' }\n format.json { render json: @listing, status: :created, location: @listing }\n else\n format.html { render action: \"new\" }\n format.json { render json: @listing.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @link = @question.links.new(params[:link])\n @link.user_id = current_user.id\n\n respond_to do |format|\n if @link.save\n flash[:notice] = 'link was successfully created.'\n format.html { redirect_to(@question) }\n format.xml { render :xml => @link, :status => :created, :location => @link }\n else\n format.html { redirect_to @question }\n flash[:notice] = 'Link must start with \"http://\"'\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n \n unless Link.count > 10\n Link.create({:url => params[:url] , :name => params[:name] })\n end\n \n redirect_to :action => \"index\"\n end", "def new\n @link = Link.new\n @links_a=ManRsc.all\n @links_b=@links_a\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @link }\n end\n end", "def create\n @url = request.format.json? ? Url.new(original_link: params[:original_link]) : Url.new(url_params)\n\n respond_to do |format|\n if @url.save\n format.html { redirect_to @url, notice: 'URL was successfully created.' }\n format.json { render :show, status: :created, location: @url }\n else\n format.html { render :new }\n format.json { render json: @url.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @storylink = Storylink.new(params[:storylink])\n\n respond_to do |format|\n if @storylink.save\n format.html { redirect_to @storylink, notice: 'Storylink was successfully created.' }\n format.json { render json: @storylink, status: :created, location: @storylink }\n else\n format.html { render action: \"new\" }\n format.json { render json: @storylink.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @affiliate_link = AffiliateLink.new(params[:affiliate_link])\n\n respond_to do |format|\n if @affiliate_link.save\n format.html { redirect_to @affiliate_link, notice: 'Affiliate link was successfully created.' }\n format.json { render json: @affiliate_link, status: :created, location: @affiliate_link }\n else\n format.html { render action: \"new\" }\n format.json { render json: @affiliate_link.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @destination_linkset = DestinationLinkset.new(destination_linkset_params)\n\n respond_to do |format|\n if @destination_linkset.save\n format.html { redirect_to @destination_linkset, notice: 'Destination linkset was successfully created.' }\n format.json { render :show, status: :created, location: @destination_linkset }\n else\n format.html { render :new }\n format.json { render json: @destination_linkset.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @link = LinkCreator.new(link_params)\n Rails.logger.debug(link_params)\n\n @link.user = current_user\n \n respond_to do |format|\n if @link.save\n\n format.html do\n if params[:return_to].present?\n redirect_to params[:return_to]\n else\n redirect_to root_url, notice: 'Link wurde hinzugefügt.'\n end\n end\n format.json { render action: 'show', status: :created, location: @link }\n else\n format.html { render action: 'pots/new' }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @resources_and_link = ResourcesAndLink.new(params[:resources_and_link])\n\n respond_to do |format|\n if @resources_and_link.save\n format.html { redirect_to @resources_and_link, notice: 'Resources and link was successfully created.' }\n format.json { render json: @resources_and_link, status: :created, location: @resources_and_link }\n else\n format.html { render action: \"new\" }\n format.json { render json: @resources_and_link.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_link(key, name)\n passage = Passage.where(name: name).first\n\n self.links << Link.create({ key: key, passage: passage })\n end", "def postFlatpackLink( flatpack_id, keywords, location, linkText)\n params = Hash.new\n params['flatpack_id'] = flatpack_id\n params['keywords'] = keywords\n params['location'] = location\n params['linkText'] = linkText\n return doCurl(\"post\",\"/flatpack/link\",params)\n end" ]
[ "0.6705851", "0.644812", "0.6308752", "0.6285573", "0.6258482", "0.62554085", "0.62554085", "0.6111631", "0.60189956", "0.60105133", "0.60105133", "0.60094875", "0.600619", "0.6001159", "0.5993234", "0.5987758", "0.59798765", "0.5932593", "0.5914696", "0.59143496", "0.5909006", "0.5903945", "0.5877824", "0.58444357", "0.58420753", "0.5814176", "0.58100283", "0.57835954", "0.5766085", "0.5765292", "0.57625127", "0.5745159", "0.574091", "0.5731378", "0.57176644", "0.5691062", "0.5689238", "0.5687709", "0.5687094", "0.5649147", "0.56424993", "0.5638628", "0.563385", "0.5628359", "0.5618722", "0.56178963", "0.5605717", "0.55959296", "0.55949205", "0.5593266", "0.5587537", "0.5582072", "0.55782574", "0.5561701", "0.5556973", "0.5550509", "0.554598", "0.553298", "0.55327773", "0.5530888", "0.5526674", "0.55258054", "0.552521", "0.55217254", "0.55127954", "0.5512677", "0.55003935", "0.5498699", "0.5498699", "0.5496537", "0.5494107", "0.54921824", "0.5474127", "0.54713726", "0.5459423", "0.5456339", "0.54277843", "0.54123086", "0.5411091", "0.5393506", "0.5392782", "0.53919154", "0.53891045", "0.538805", "0.5376696", "0.53708655", "0.5369182", "0.5366868", "0.53659284", "0.53636837", "0.53575563", "0.53573394", "0.5347218", "0.5342352", "0.5330331", "0.5329361", "0.5319531", "0.5319217", "0.530596", "0.5296978" ]
0.6432219
2
PATCH/PUT /glass_store_links/1 PATCH/PUT /glass_store_links/1.json
def update respond_to do |format| if @glass_store_link.update(glass_store_link_params) format.html { redirect_to @glass_store_link, notice: 'Glass store link was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } format.json { render json: @glass_store_link.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n update_and_respond(@link, link_params)\n end", "def update\n @link = Link.find(params[:id])\n paginate_all_links\n respond_to do |format|\n if @link.update_attributes(params[:link])\n format.html { redirect_to root_url+\"#show-links\", notice: 'Link was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @link.update(link_params)\n format.html { redirect_to links_path}\n format.json { render :show, status: :ok, location: @link }\n else\n format.html { render :edit }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @link.update_attributes(params[:link])\n format.html { redirect_to @link, notice: 'Link was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_glass_store_link\n @glass_store_link = GlassStoreLink.find(params[:id])\n end", "def update\n respond_to do |format|\n if @link_resource.update(link_resource_params)\n format.html { redirect_to @lab, notice: 'Link resource was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @link_resource.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @link = @entity.links.find(params[:id])\n\n respond_to do |format|\n if @link.update_attributes(params[:link])\n flash[:notice] = 'Link was successfully updated.'\n format.html { redirect_to link_url(@link) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @link.errors.to_xml }\n end\n end\n end", "def update\n @link = Link.find(params[:id])\n\n respond_to do |format|\n if @link.update_attributes(params[:link])\n format.html { redirect_to @link, :notice => 'Ссылка была успешно обновлена' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @link.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @link = Link.find(params[:id])\n\n respond_to do |format|\n if @link.update_attributes(params[:link])\n format.html { redirect_to @link, notice: 'Link was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @link = Link.find(params[:id])\n\n respond_to do |format|\n if @link.update_attributes(params[:link])\n format.html { redirect_to @link, notice: 'Link was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bundlelink.update(bundlelink_params)\n format.html { redirect_to @bundlelink, notice: 'Bundlelink was successfully updated.' }\n format.json { render :show, status: :ok, location: @bundlelink }\n else\n format.html { render :edit }\n format.json { render json: @bundlelink.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @link.update(link_params)\n format.html { redirect_to @link.pot, flash: {success: 'Link wurde aktualisiert.'} }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @link.update(link_params)\n format.html { redirect_to @link, notice: \"Link was successfully updated.\" }\n format.json { render :show, status: :ok, location: @link }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @link = args[:link] if args.key?(:link)\n end", "def update\n respond_to do |format|\n if @link.update(link_params)\n\n format.html { redirect_to link_admin_path(@link.admin_id), notice: \"Link was successfully updated.\" }\n format.json { render :show, status: :ok, location: @link }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @link.update(link_params)\n format.html { redirect_to @link, notice: 'Link was successfully updated.' }\n format.json { render :show, status: :ok, location: @link }\n else\n format.html { render :edit }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @link.update(link_params)\n format.html { redirect_to @link, notice: 'Link was successfully updated.' }\n format.json { render :show, status: :ok, location: @link }\n else\n format.html { render :edit }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @link.update(link_params)\n format.html { redirect_to @link, notice: 'Link was successfully updated.' }\n format.json { render :show, status: :ok, location: @link }\n else\n format.html { render :edit }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @link.update(link_params)\n format.html { redirect_to @link, notice: 'Link was successfully updated.' }\n format.json { render :show, status: :ok, location: @link }\n else\n format.html { render :edit }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @link.update(link_params)\n format.html { redirect_to @link, notice: 'Link was successfully updated.' }\n format.json { render :show, status: :ok, location: @link }\n else\n format.html { render :edit }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @link.update(link_params)\n format.html { redirect_to @link, notice: '투표안건이 성공적으로 수정되었습니다.' }\n format.json { render :show, status: :ok, location: @link }\n else\n format.html { render :edit }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @link.update(link_params)\n format.html { redirect_to @link, notice: 'Review was successfully updated.' }\n format.json { render :show, status: :ok, location: @link }\n else\n format.html { render :edit }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @link.update(link_params)\n format.html do\n redirect_to new_link_path,\n notice: \"Link was successfully updated\"\n end\n format.json { render :show, status: :ok, location: @link }\n else\n format.html { render :edit }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @link.update(link_params)\n format.html { redirect_to campaign_links_path, notice: 'Link was successfully updated.' }\n format.json { render :show, status: :ok, location: campaign_links_path }\n else\n format.html { render :edit }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @link.update(link_params)\n format.html { redirect_to @link, notice: 'Post was successfully updated.' }\n format.json { render :show, status: :ok, location: @link }\n else\n format.html { render :edit }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @test_link.update(test_link_params)\n render :show, status: :ok, location: @test_link\n else\n render json: @test_link.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @system_link.update(system_link_params)\n format.html { redirect_to @system_link, notice: 'System link was successfully updated.' }\n format.json { render :show, status: :ok, location: @system_link }\n else\n format.html { render :edit }\n format.json { render json: @system_link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @link = args[:link] if args.key?(:link)\n @type = args[:type] if args.key?(:type)\n end", "def update\n puts link_params\n respond_to do |format|\n if @link.update(link_params)\n format.html { redirect_to @link, notice: 'Link was successfully updated.' }\n format.json { render :show, status: :ok, location: @link }\n else\n format.html { render :edit }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @api_v1_news_link.update(api_v1_news_link_params)\n format.html { redirect_to @api_v1_news_link, notice: 'News link was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_news_link }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_news_link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @link = Link.find(params[:id])\n\n respond_to do |format|\n if @link.update_attributes(params[:link])\n format.html { redirect_to(@link, :notice => 'Link was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @link = Link.find(params[:id])\n\n respond_to do |format|\n if @link.update_attributes(params[:link])\n format.html { redirect_to(@link, :notice => 'Link was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @link = Link.find(params[:id])\n\n respond_to do |format|\n if @link.update_attributes(params[:link])\n format.html { redirect_to(@link, :notice => 'Link was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @link = Link.find(params[:id])\n\n respond_to do |format|\n if @link.update_attributes(params[:link])\n format.html { redirect_to(@link, :notice => 'Link was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @useful_link = UsefulLink.find(params[:id])\n\n respond_to do |format|\n if @useful_link.update_attributes(params[:useful_link])\n format.html { redirect_to @useful_link, notice: 'Useful link was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @useful_link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @link = Link.find(params[:id])\n \n respond_to do |format|\n if @link.update_attributes(params[:link])\n flash[:notice] = 'Link was successfully updated.'\n format.html { redirect_to(@link) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @series = Series.find(params[:id])\n\n respond_to do |format|\n if @series.update_attributes(params[:series].merge({:version_attributes=>{},:thumbnail_attributes=>{:name=>params[:series][:name],:original_link=>params[:series][:thumbnail_link],:remote_image_url=>params[:series][:thumbnail_link]} }))\n format.html { redirect_to @series, :notice => 'Series was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @series.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @link.attributes = params[@type]\n\n respond_to do |format|\n if @commit_type == 'preview' && @link.valid?\n format.html { render :template => 'admin/shared/update_preview', :locals => { :record => @link }, :layout => 'admin/admin_preview' }\n format.xml { render :xml => @link, :status => :created, :location => @link }\n elsif @commit_type == 'save' && @link.save(:user => current_user)\n format.html { render 'admin/shared/update' }\n format.xml { head :ok }\n else\n format.html { render :template => 'admin/shared/edit', :locals => { :record => @link }, :status => :unprocessable_entity }\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @url_link.update(url_link_params)\n format.html { redirect_to @url_link, notice: 'Url link was successfully updated.' }\n format.json { render :show, status: :ok, location: @url_link }\n else\n format.html { render :edit }\n format.json { render json: @url_link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @link = Link.find(params[:id])\n\n respond_to do |format|\n if @link.update_attributes(params[:link])\n flash[:notice] = 'Link was successfully updated.'\n format.html { redirect_to(@link) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @link = Link.find(params[:id])\n\n respond_to do |format|\n if @link.update_attributes(params[:link])\n flash[:notice] = 'Link was successfully updated.'\n format.html { redirect_to(@link) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @jakeslink = Jakeslink.find(params[:id])\n\n respond_to do |format|\n if @jakeslink.update_attributes(params[:jakeslink])\n format.html { redirect_to @jakeslink, notice: 'Jakeslink was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @jakeslink.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @demo_link.update(demo_link_params)\n format.html { redirect_to @demo_link, notice: 'Demo link was successfully updated.' }\n format.json { render :show, status: :ok, location: @demo_link }\n else\n format.html { render :edit }\n format.json { render json: @demo_link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @ordering_link.update(ordering_link_params)\n format.html { redirect_to @ordering_link, notice: 'Ordering link was successfully updated.' }\n format.json { render :show, status: :ok, location: @ordering_link }\n else\n format.html { render :edit }\n format.json { render json: @ordering_link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @recommended_link = RecommendedLink.find(params[:id])\n\n if @recommended_link.update(recommended_link_params)\n head :no_content\n else\n render json: @recommended_link.errors, status: :unprocessable_entity\n end\n end", "def update!(**args)\n @document_link = args[:document_link] if args.key?(:document_link)\n @request_metadata = args[:request_metadata] if args.key?(:request_metadata)\n end", "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend", "def update\n respond_to do |format|\n if @shortlink.update(shortlink_params)\n format.html { redirect_to shortlinks_path, notice: 'Shortlink was successfully updated.' }\n format.json { render :show, status: :ok, location: @shortlink }\n else\n format.html { render :edit }\n format.json { render json: @shortlink.errors, status: :unprocessable_entity }\n end\n end\n end", "def glass_store_link_params\n params.require(:glass_store_link).permit(:glass_id, :store_id, :quantity)\n end", "def update\n unless is_owner? @link\n render :file => \"public/401.html\", :status => :unauthorized\n return\n end\n \n respond_to do |format|\n if @link.update(link_params)\n format.html { redirect_to @link, notice: 'Link was successfully updated.' }\n format.json { render :show, status: :ok, location: @link }\n else\n format.html { render :edit }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @resources_and_link = ResourcesAndLink.find(params[:id])\n\n respond_to do |format|\n if @resources_and_link.update_attributes(params[:resources_and_link])\n format.html { redirect_to @resources_and_link, notice: 'Resources and link was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @resources_and_link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @xlink = Xlink.find(params[:id])\n\n respond_to do |format|\n if @xlink.update_attributes(params[:xlink])\n format.html { redirect_to @xlink, notice: 'Xlink was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @xlink.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @linkctr.update(linkctr_params)\n format.html { redirect_to @linkctr, notice: 'Linkctr was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @linkctr.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @pending_recommended_link = PendingRecommendedLink.find(params[:id])\n\n if @pending_recommended_link.update(pending_recommended_link_params)\n head :no_content\n else\n render json: @pending_recommended_link.errors, status: :unprocessable_entity\n end\n end", "def patch(url, payload, headers={})\n RestClient.patch url, payload, headers\n end", "def update\n @link = Link.find(params[:id])\n\n respond_to do |format|\n params[:link].delete(\"uploaded_data\") #if params[:link][:uploaded_data] == ''\n if @link.update_attributes(params[:link])\n flash[:notice] = 'Link was successfully updated.'\n format.html { redirect_to :controller => 'admin/links', :action => 'index', :id => @link.id }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @link.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @metadata = args[:metadata] if args.key?(:metadata)\n @link = args[:link] if args.key?(:link)\n end", "def update\n\t\tupdated_info = params.require(:rlink).permit(:link, :random_string)\n\t\trlink = Rlink.find(params[:id])\n\t\trlink.update_attributes(updated_info)\n\t\tredirect_to rlink\n\tend", "def update!(**args)\n @child_link = args[:child_link] if args.key?(:child_link)\n @created = args[:created] if args.key?(:created)\n @id = args[:id] if args.key?(:id)\n @kind = args[:kind] if args.key?(:kind)\n @name = args[:name] if args.key?(:name)\n @permissions = args[:permissions] if args.key?(:permissions)\n @self_link = args[:self_link] if args.key?(:self_link)\n @starred = args[:starred] if args.key?(:starred)\n @updated = args[:updated] if args.key?(:updated)\n end", "def patch(data, options={})\n @hal_client.patch(href, data, options).tap do\n reset\n end\n end", "def update\n @link_type = LinkType.find(params[:id])\n\n respond_to do |format|\n if @link_type.update_attributes(params[:link_type])\n flash[:notice] = 'LinkType was successfully updated.'\n format.html { redirect_to(@link_type) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @link_type.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @link_attachment.update(link_attachment_params)\n format.html { redirect_to @link_attachment, notice: 'Link attachment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @link_attachment.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @affiliate_link = AffiliateLink.find(params[:id])\n\n respond_to do |format|\n if @affiliate_link.update_attributes(params[:affiliate_link])\n format.html { redirect_to @affiliate_link, notice: 'Affiliate link was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @affiliate_link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @link = Link.find(params[:id])\n\n respond_to do |format|\n if @link.update_attributes(params[:link])\n if request.referrer.split('/').last == \"preview\"\n format.html { redirect_to link_preview_path(@link), notice: 'Link was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { redirect_to @link, notice: 'Link was successfully updated.' }\n format.json { head :no_content }\n end\n else\n if request.referrer.split('/').last == \"preview\"\n @from_preview = true\n format.html { render \"form_preview\", :layout => \"preview\" }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "def update\n \n\n @client.redirect_urls << client_params[:add_redirect_url] if client_params[:add_redirect_url]\n \n @client.app_ids << BSON::ObjectId.new.to_s if client_params[:add_app_id]\n \n \n @client.versioned_update({\"redirect_urls\" => 1, \"app_ids\" => 1})\n\n if @client.op_success?\n render \"show\"\n else\n render \"edit\"\n end\n \n end", "def update!(**args)\n @alternate_link = args[:alternate_link] if args.key?(:alternate_link)\n @id = args[:id] if args.key?(:id)\n @title = args[:title] if args.key?(:title)\n end", "def update\n respond_to do |format|\n format.html { redirect_to @link_request, notice: 'Updates to requests are not allowed' }\n format.json { render json: [\"updates not allowed\"], status: :unprocessable_entity }\n end\n end", "def create\n @glass_store_link = GlassStoreLink.new(glass_store_link_params)\n @stores = Store.all\n #@glass_store_link.glass_id = params[:glass_id]\n @glass = Glass.find_by_id(params[:glass_id])\n @glass_store_link2 = @glass_store_link.is_unique_for_same_glass_kind(@glass_store_link.store_id, @glass_store_link.glass_id)\n if(@glass_store_link2)\n @glass_store_link2.quantity = @glass_store_link2.quantity+ @glass_store_link.quantity\n @glass_store_link = @glass_store_link2\n end\n\n respond_to do |format|\n if @glass_store_link.save\n format.html { redirect_to @glass_store_link, notice: 'Glass store link was successfully created.' }\n format.json { render action: 'show', status: :created, location: @glass_store_link }\n else\n if (@@action_method==1)\n format.html { render action: 'new' }\n elsif(@@action_method==2)\n format.html { redirect_to :action=>'new2', :glass_id=> @glass_store_link.glass_id }\n end\n flash[:errors] = @glass_store_link.errors.empty? ? \"Error\" : @glass_store_link.errors.full_messages\n @@links_errors = @glass_store_link.errors\n format.json { render json: @glass_store_link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @entity_index = args[:entity_index] if args.key?(:entity_index)\n @link_property_name = args[:link_property_name] if args.key?(:link_property_name)\n end", "def update\n respond_to do |format|\n if @quicklink.update(quicklink_params)\n format.html { redirect_to @quicklink, notice: 'Quicklink was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @quicklink.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @link.update(links_params)\n redirect_to link_path(@link)\n else\n flash[:errors] = @link.errors.full_messages\n render :edit\n end\n end", "def update!(**args)\n @alternate_link = args[:alternate_link] if args.key?(:alternate_link)\n @id = args[:id] if args.key?(:id)\n @thumbnail_url = args[:thumbnail_url] if args.key?(:thumbnail_url)\n @title = args[:title] if args.key?(:title)\n end", "def update!(**args)\n @alternate_link = args[:alternate_link] if args.key?(:alternate_link)\n @id = args[:id] if args.key?(:id)\n @thumbnail_url = args[:thumbnail_url] if args.key?(:thumbnail_url)\n @title = args[:title] if args.key?(:title)\n end", "def update!(**args)\n @link_data = args[:link_data] if args.key?(:link_data)\n @meta_data = args[:meta_data] if args.key?(:meta_data)\n @target_doc_data = args[:target_doc_data] if args.key?(:target_doc_data)\n @validation_status = args[:validation_status] if args.key?(:validation_status)\n end", "def update!(**args)\n @app_id = args[:app_id] if args.key?(:app_id)\n @client = args[:client] if args.key?(:client)\n @deep_link_id = args[:deep_link_id] if args.key?(:deep_link_id)\n @url = args[:url] if args.key?(:url)\n end", "def update!(**args)\n @app_id = args[:app_id] if args.key?(:app_id)\n @client = args[:client] if args.key?(:client)\n @deep_link_id = args[:deep_link_id] if args.key?(:deep_link_id)\n @url = args[:url] if args.key?(:url)\n end", "def update\n respond_to do |format|\n if @ivn_link.update(ivn_link_params)\n format.html { redirect_to admin_ivn_link_url(@ivn_link), notice: \"Ivn link was successfully updated.\" }\n format.json { render :show, status: :ok, location: @ivn_link }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @ivn_link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @href = args[:href] if args.key?(:href)\n @id = args[:id] if args.key?(:id)\n @kind = args[:kind] if args.key?(:kind)\n @name = args[:name] if args.key?(:name)\n end", "def api_update_link(action, model, attributes, html_options = nil, &block)\n i18n_key = \"#{model.model_name.singular}.%s.#{action.to_s.camelize(:lower)}\"\n url = \"/api/#{model.model_name.route_key.sub('_', '-')}/#{model.id}\"\n new_options = {\n title: t(i18n_key % 'button'),\n data: {\n remote: true, method: :patch, type: :jsonapi,\n params: {type: model.model_name.route_key, id: model.id, attributes: attributes},\n 'success-message': t((i18n_key % 'message') + 'Success', model: get_name_for(model))\n }\n }\n render_button(block_given? ? block : t(i18n_key % 'button'), action,\n i18n_key, url, html_options.deep_merge(new_options))\n end", "def update\n respond_to do |format|\n if @linkpost.update(linkpost_params)\n format.html { redirect_to @linkpost, notice: 'Linkpost was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @linkpost.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @file_link.update(file_link_params)\n format.html { redirect_to @file_link, notice: 'File link - объект успешно изменён.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @file_link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @deeplink_url = args[:deeplink_url] if args.key?(:deeplink_url)\n @provider_mid = args[:provider_mid] if args.key?(:provider_mid)\n end", "def update\n @link = Link.find_by_slug(params[:id])\n\n respond_to do |format|\n if @link.user != @current_user\n flash[:error] = 'Unable to update links owned by other users.'\n format.html { render action: \"show\" }\n format.json { head :no_content }\n elsif @link.update_attributes(params[:link])\n format.html { redirect_to link_comments_url(@link), notice: 'Link was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @room_room_attribute_link.update(room_room_attribute_link_params)\n format.html { redirect_to @room_room_attribute_link, notice: 'Room room attribute link was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @room_room_attribute_link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(attrs, path=nil)\n resp = api_client.put(path || url, JSON.dump(attrs))\n refresh(JSON.load(resp.body))\n end", "def put(href, additional_parameters = {})\n rest_connect do |base_uri, headers|\n href = \"#{base_uri}/#{href}\" unless begins_with_slash(href)\n new_path = URI.escape(href)\n req = Net::HTTP::Put.new(new_path, headers) \n req.set_content_type('application/json')\n req.body = additional_parameters.to_json\n req\n end\n end", "def update\n respond_to do |format|\n if @picture_link.update(picture_link_params)\n format.html { redirect_to @picture_link, notice: 'Picture link was successfully updated.' }\n format.json { render :show, status: :ok, location: @picture_link }\n else\n format.html { render :edit }\n format.json { render json: @picture_link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\t\tlink = current_user.links.find(params[:id])\n\n\t\trespond_to do | format |\n\t\t\tif link.update_attributes(link_params)\n\t\t\t\tformat.html{\n\t\t\t\t\tredirect_to link\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tformat.html{\n\t\t\t\t\trender action: \"edit\"\n\t\t\t\t}\n\t\t\tend\n\n\t\tend \n\tend", "def update\n respond_to do |format|\n if @set_compilation_link.update(set_compilation_link_params)\n format.html { redirect_to @set_compilation_link, notice: 'Set compilation link was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @set_compilation_link.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @href = args[:href] if args.key?(:href)\n @type = args[:type] if args.key?(:type)\n end", "def update!(**args)\n @href = args[:href] if args.key?(:href)\n @type = args[:type] if args.key?(:type)\n end", "def update!(**args)\n @href = args[:href] if args.key?(:href)\n @type = args[:type] if args.key?(:type)\n end", "def update!(**args)\n @href = args[:href] if args.key?(:href)\n @type = args[:type] if args.key?(:type)\n end", "def update!(**args)\n @href = args[:href] if args.key?(:href)\n @type = args[:type] if args.key?(:type)\n end", "def update!(**args)\n @href = args[:href] if args.key?(:href)\n @type = args[:type] if args.key?(:type)\n end", "def update!(**args)\n @href = args[:href] if args.key?(:href)\n @type = args[:type] if args.key?(:type)\n end", "def update!(**args)\n @href = args[:href] if args.key?(:href)\n @type = args[:type] if args.key?(:type)\n end", "def update!(**args)\n @href = args[:href] if args.key?(:href)\n @type = args[:type] if args.key?(:type)\n end", "def update!(**args)\n @href = args[:href] if args.key?(:href)\n @type = args[:type] if args.key?(:type)\n end", "def update!(**args)\n @href = args[:href] if args.key?(:href)\n @type = args[:type] if args.key?(:type)\n end" ]
[ "0.64537716", "0.64327043", "0.6407661", "0.63829696", "0.63622206", "0.6321147", "0.62963456", "0.6267089", "0.62629944", "0.62629944", "0.625568", "0.6173176", "0.6167491", "0.61569244", "0.6146763", "0.61368936", "0.61368936", "0.61368936", "0.61368936", "0.61368936", "0.6107374", "0.610106", "0.60646415", "0.6057325", "0.600926", "0.59912366", "0.5978648", "0.5971123", "0.59641874", "0.5947252", "0.594443", "0.594443", "0.594443", "0.594443", "0.5933134", "0.59166354", "0.59074426", "0.5893906", "0.587376", "0.58674276", "0.58674276", "0.58463085", "0.58342963", "0.5831139", "0.5825806", "0.58180577", "0.58101", "0.579129", "0.57884574", "0.57643163", "0.57544804", "0.5751072", "0.57368684", "0.57348025", "0.5718061", "0.5716169", "0.57105744", "0.57012314", "0.56955725", "0.568438", "0.5683106", "0.5681786", "0.5679735", "0.56753474", "0.56691206", "0.5668912", "0.5668627", "0.5654522", "0.5649949", "0.56467515", "0.56392044", "0.56390625", "0.56390625", "0.56380105", "0.56359166", "0.56359166", "0.56342286", "0.56257766", "0.56166095", "0.5611219", "0.5610502", "0.5610116", "0.5604614", "0.5604269", "0.56010467", "0.5591765", "0.5582732", "0.55686367", "0.5566151", "0.5563543", "0.5563543", "0.5563543", "0.5563543", "0.5563543", "0.5563543", "0.5563543", "0.5563543", "0.5563543", "0.5563543", "0.5563543" ]
0.7342254
0
DELETE /glass_store_links/1 DELETE /glass_store_links/1.json
def destroy @glass_store_link.destroy respond_to do |format| format.html { redirect_to glass_store_links_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete; rest_delete(link('self')); end", "def delete; rest_delete(link('self')); end", "def destroy\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to links_url }\n format.json { head :ok }\n end\n end", "def delete\n delete_from_server single_url\n end", "def deleteFlatpackLink( flatpack_id, gen_id)\n params = Hash.new\n params['flatpack_id'] = flatpack_id\n params['gen_id'] = gen_id\n return doCurl(\"delete\",\"/flatpack/link\",params)\n end", "def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: '투표안건이 성공적으로 삭제되었습니다.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @link = Link.find(params[:id])\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to links_url }\n format.json { head :ok }\n end\n end", "def delete\n client.delete(url)\n @deleted = true\nend", "def destroy\n @link = @entity.links.find(params[:id])\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to links_url }\n format.xml { head :ok }\n end\n end", "def destroy\n @link = Link.find(params[:id])\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to links_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @link = Link.find(params[:id])\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to links_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @link = Link.find(params[:id])\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to links_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @link_resource.destroy\n respond_to do |format|\n format.html { redirect_to @lab }\n format.json { head :no_content }\n end\n end", "def destroy\n @link.destroy\n respond_to do |format|\n format.html do\n redirect_to root_path,\n notice: \"Link was successfully deleted\"\n end\n format.json { head :no_content }\n end\n end", "def destroy \n Link.connection.execute(\"delete from links where id in (#{params[:id].join(',')})\") unless params[:id].blank?\n respond_to do |format|\n format.html { redirect_to(links_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n destroy_and_respond(@link)\n end", "def deleteEntityAffiliate_link( entity_id, gen_id)\n params = Hash.new\n params['entity_id'] = entity_id\n params['gen_id'] = gen_id\n return doCurl(\"delete\",\"/entity/affiliate_link\",params)\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: 'Link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: 'Link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: 'Link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: 'Link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: 'Link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: 'Link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: 'Link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: 'Link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: \"Link was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @linkctr.destroy\n respond_to do |format|\n format.html { redirect_to linkctrs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to campaign_links_path, notice: 'Link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @jakeslink = Jakeslink.find(params[:id])\n @jakeslink.destroy\n\n respond_to do |format|\n format.html { redirect_to jakeslinks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @store = Store.find(params[:id])\n #tib_res = Tibbr::ExternalResource.find_by_resource_key({:resource => {:key => \"ID_#{@store.id}\", :resource_type => \"ad:store\"}, :client_id => session[:app_id]})\n # tib_res.destroy\n @store.destroy\n \n \n\n respond_to do |format|\n format.html { redirect_to stores_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: 'Review was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @xlink = Xlink.find(params[:id])\n @xlink.destroy\n\n respond_to do |format|\n format.html { redirect_to xlinks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @check_link.destroy\n respond_to do |format|\n format.html { redirect_to check_links_url, notice: 'Check link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @bundlelink.destroy\n respond_to do |format|\n format.html { redirect_to bundlelinks_url, notice: 'Bundlelink was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete!\n Recliner.delete(uri)\n end", "def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to new_link_url, notice: \"Link was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @link = Link.find(params[:id])\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url+\"#show-links\", notice: 'Link was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @link = Link.find(params[:id])\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to links_url, notice: \"Link was successfully deleted.\" }\n format.json { head :no_content }\n end\n end", "def delete\n api_client.delete(url)\n end", "def destroy\n @bread_store.destroy\n respond_to do |format|\n format.html { redirect_to bread_store_managers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @link = Link.find(params[:id])\n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: 'Link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @affiliate_link = AffiliateLink.find(params[:id])\n @affiliate_link.destroy\n\n respond_to do |format|\n format.html { redirect_to affiliate_links_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @api_v1_news_link.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_news_links_url, notice: 'News link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n if @short_url.destroy\n render json: { status: \"Deleted\" }\n else\n render json: { head: \"no content\" }\n end \n end", "def destroy\n @shelf.destroy\n\n respond_to do |format|\n format.html { redirect_to shelves_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @gl.destroy\n respond_to do |format|\n format.html { redirect_to gls_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @url_link.destroy\n respond_to do |format|\n format.html { redirect_to url_links_url, notice: 'Url link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @shelf.destroy\n respond_to do |format|\n format.html { redirect_to shelves_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @online_store = OnlineStore.find(params[:id])\n @online_store.destroy\n\n respond_to do |format|\n format.html { redirect_to online_stores_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @externalformlink.destroy\n respond_to do |format|\n format.html { redirect_to externalformlinks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @link.destroy\n respond_to do |format|\n format.html { redirect_to links_url, notice: 'Post was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @demo_link.destroy\n respond_to do |format|\n format.html { redirect_to demo_links_url, notice: 'Demo link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @store.destroy\n respond_to do |format|\n format.html { redirect_to stores_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @store.destroy\n respond_to do |format|\n format.html { redirect_to stores_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @store.destroy\n respond_to do |format|\n format.html { redirect_to stores_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @store.destroy\n respond_to do |format|\n format.html { redirect_to stores_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @useful_link = UsefulLink.find(params[:id])\n @useful_link.destroy\n\n respond_to do |format|\n format.html { redirect_to useful_links_url }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(url)\n @deleted = true\n end", "def destroy\n @storage = @client.storages.find(params[:id])\n @storage.destroy\n\n respond_to do |format|\n format.html { redirect_to client_url(@client) }\n format.json { head :no_content }\n end\n end", "def destroy\n @file_link.destroy\n respond_to do |format|\n format.html { redirect_to file_links_url }\n format.json { head :no_content }\n end\n end", "def destroy\n return if new_record?\n \n @api.delete \"/items/#{shortcode_url}.json\"\n end", "def link_delete\n @linkalation = Linkalation.find_by_link_id_and_user_id(params[:link], current_user.id)\n\n @linkalation[0].destroy\n\n render :nothing => true\n end", "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def deleteFlatpackLinkAll( flatpack_id)\n params = Hash.new\n params['flatpack_id'] = flatpack_id\n return doCurl(\"delete\",\"/flatpack/link/all\",params)\n end", "def destroy\n @system_link.destroy\n respond_to do |format|\n format.html { redirect_to system_links_url, notice: 'System link was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @link = @panel.links.find(params[:id])\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to(@panel) }\n format.xml { head :ok }\n end\n end", "def destroy\n\t\t\t\t @store = Store.find(params[:id])\n\t\t\t\t @store.destroy\n\n\t\t\t\t respond_to do |format|\n\t\t\t\t format.html { redirect_to stores_url }\n\t\t\t\t format.json { head :no_content }\n\t\t\t\t end\n\t\t\t\t end", "def destroy\n @urlshortner.destroy\n respond_to do |format|\n format.html { redirect_to urlshortners_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @linkpost.destroy\n respond_to do |format|\n format.html { redirect_to linkposts_url }\n format.json { head :no_content }\n end\n end", "def delete\n CONNECTION.execute(\"DELETE FROM links WHERE id = #{self.id};\")\n end", "def destroy\n @link_attachment.destroy\n respond_to do |format|\n format.html { redirect_to link_attachments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @storylink = Storylink.find(params[:id])\n @storylink.destroy\n\n respond_to do |format|\n format.html { redirect_to storylinks_url }\n format.json { head :no_content }\n end\n end", "def delete(href, additional_parameters = {})\n rest_connect do |base_uri, headers|\n href = \"#{base_uri}/#{href}\" unless begins_with_slash(href)\n new_path = URI.escape(href)\n req = Net::HTTP::Delete.new(href, headers)\n req.set_content_type('application/json')\n req.body = additional_parameters.to_json\n req\n end\n end", "def destroy\n @link = Link.find(params[:id])\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to(links_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @link = Link.find(params[:id])\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to(links_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @link = Link.find(params[:id])\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to(links_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @link = Link.find(params[:id])\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to(links_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @link = Link.find(params[:id])\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to(links_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @link = Link.find(params[:id])\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to(links_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @quicklink.destroy\n respond_to do |format|\n format.html { redirect_to quicklinks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @store.destroy\n\n render json: @store\n end", "def destroy\n @store = Store.find(params[:id])\n @store.destroy\n\n respond_to do |format|\n format.html { redirect_to stores_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @store = Store.find(params[:id])\n @store.destroy\n\n respond_to do |format|\n format.html { redirect_to stores_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @store = Store.find(params[:id])\n @store.destroy\n\n respond_to do |format|\n format.html { redirect_to stores_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @store = Store.find(params[:id])\n @store.destroy\n\n respond_to do |format|\n format.html { redirect_to stores_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @store.destroy\n respond_to do |format|\n format.html { redirect_to stocks_url }\n format.json { head :no_content }\n end\n end", "def delete(path)\n repository = path.split(/\\//)[2]\n objectid = path.split(/\\//)[3]\n if storage_fetch(repository, objectid) && storage_delete(repository, objectid)\n ['200', {}, []]\n else\n ['404', {}, [\"Repository #{repository} or ObjectID #{objectid} not found: #{path}\"]]\n end\n end", "def destroy\n @datastore = Datastore.find(params[:id])\n @datastore.destroy\n\n respond_to do |format|\n format.html { redirect_to datastores_url }\n format.json { head :no_content }\n end\n end", "def delete\n self.class.delete self.href\n end", "def destroy\n @admin_store = Admin::Store.find(params[:id])\n @admin_store.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_stores_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Alien.delete(params[\"id\"])\n end", "def destroy\n @dataload_ga = DataloadGa.find(params[:id])\n @dataload_ga.destroy\n\n respond_to do |format|\n format.html { redirect_to dataload_gas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @sitelink.destroy\n respond_to do |format|\n format.html { redirect_to sitelinks_url, notice: 'Sitelink was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @gl = Gl.find(params[:id])\n @gl.destroy\n\n respond_to do |format|\n format.html { redirect_to gls_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @shortlink.destroy\n respond_to do |format|\n format.html { redirect_to shortlinks_url, notice: 'Shortlink was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @room_room_attribute_link.destroy\n respond_to do |format|\n format.html { redirect_to room_room_attribute_links_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @link_request.destroy\n respond_to do |format|\n format.html { redirect_to link_requests_url, notice: 'Link request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @link = Link.find_by_slug(params[:id])\n @link.comments.each do |c|\n c.destroy\n end\n @link.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url, notice: 'BLAM! Link was thoroughly destroyed!' }\n format.json { head :no_content }\n end\n end", "def destroy\n @gpath = Gpath.find(params[:id])\n @gpath.destroy\n\n respond_to do |format|\n format.html { redirect_to gpaths_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.72141606", "0.72141606", "0.6916389", "0.6848405", "0.67865056", "0.6749795", "0.6717293", "0.670681", "0.6705216", "0.6702807", "0.6702807", "0.6702807", "0.6688399", "0.66583216", "0.66334695", "0.6627897", "0.66239774", "0.66220963", "0.66187125", "0.66187125", "0.66187125", "0.66187125", "0.66187125", "0.66187125", "0.66187125", "0.66187125", "0.66110826", "0.6603529", "0.6600618", "0.65915835", "0.65719783", "0.6568764", "0.65537864", "0.6543392", "0.6542264", "0.6526325", "0.6523312", "0.6517412", "0.6510219", "0.65073115", "0.6501735", "0.6493456", "0.64784384", "0.6474219", "0.64718646", "0.6457079", "0.6449969", "0.643331", "0.6431102", "0.6419853", "0.6418331", "0.6415212", "0.64143986", "0.6413789", "0.6413789", "0.6413789", "0.6413789", "0.6411839", "0.64084584", "0.64058536", "0.64038193", "0.63990986", "0.6396235", "0.6395933", "0.63886595", "0.63861394", "0.63828397", "0.636789", "0.63649386", "0.63621515", "0.63566935", "0.6355497", "0.6353371", "0.6352856", "0.6344656", "0.6344656", "0.6344656", "0.6344656", "0.6344656", "0.6344656", "0.6342507", "0.6337135", "0.63362485", "0.63362485", "0.63362485", "0.63362485", "0.6336023", "0.6334815", "0.63313544", "0.6328735", "0.63277125", "0.6321076", "0.6312899", "0.63108146", "0.6305182", "0.6300634", "0.62940866", "0.62900275", "0.62764204", "0.62736154" ]
0.7869396
0
Use callbacks to share common setup or constraints between actions.
def set_glass_store_link @glass_store_link = GlassStoreLink.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 setup\n # override and do something appropriate\n end", "def after_actions(*logic)\n self.after_actions = logic\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 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 startcompany(action)\n @done = true\n action.setup\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 setup\n #implement in subclass;\n end", "def after_set_callback; 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 setup(easy)\n super\n easy.customrequest = @verb\n end", "def around_hooks; end", "def save_action; 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 shared_action(name, &block)\n @controller.shared_actions[name] = 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", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def duas1(action)\n action.call\n action.call\nend" ]
[ "0.6165152", "0.60463154", "0.59467196", "0.5917112", "0.5890387", "0.58345735", "0.57773316", "0.56991524", "0.56991524", "0.565454", "0.5622282", "0.54232633", "0.54119074", "0.54119074", "0.54119074", "0.53937256", "0.53801376", "0.5358599", "0.53412294", "0.5340814", "0.53314966", "0.53114754", "0.52984965", "0.52977055", "0.5296272", "0.5260649", "0.5245076", "0.52388334", "0.52388334", "0.52388334", "0.52388334", "0.52388334", "0.5235081", "0.52321917", "0.5228592", "0.5220735", "0.52198535", "0.52139324", "0.5208539", "0.5206585", "0.5178542", "0.5175199", "0.5173538", "0.5167041", "0.51614195", "0.51577675", "0.5153909", "0.51528823", "0.5152225", "0.51429904", "0.5141399", "0.51345575", "0.51145", "0.5114052", "0.5114052", "0.5110216", "0.5108656", "0.50935394", "0.5089196", "0.5081936", "0.5079627", "0.50675833", "0.5056105", "0.5053687", "0.5050475", "0.5050475", "0.503471", "0.5028311", "0.501982", "0.50157547", "0.5013552", "0.50014806", "0.50011593", "0.49976763", "0.4990292", "0.4990292", "0.49882022", "0.4981269", "0.49792367", "0.49766538", "0.4967978", "0.49667212", "0.4958987", "0.49572337", "0.49550423", "0.4954479", "0.4952353", "0.494726", "0.4944055", "0.4935437", "0.4931248", "0.49283475", "0.49281213", "0.49268973", "0.4921738", "0.49204507", "0.4918924", "0.49182287", "0.4916538", "0.49158585", "0.49156788" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def glass_store_link_params params.require(:glass_store_link).permit(:glass_id, :store_id, :quantity) 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
test comment ^^^ meta.function.method.withoutarguments.ruby keyword.control.def.ruby ^^^^^^ meta.function.method.withoutarguments.ruby entity.name.function.ruby ^ punctuation.separator.statement.ruby ^^^^^ variable.other.ruby ^ punctuation.separator.object.ruby ^^^^^ variable.other.ruby ^ keyword.operator.assignment.ruby ^ punctuation.section.array.begin.ruby ^ constant.numeric.ruby ^ punctuation.separator.object.ruby ^ constant.numeric.ruby ^ punctuation.section.array.end.ruby ^^^ keyword.control.ruby ^ comment.line.numbersign.ruby punctuation.definition.comment.ruby ^^^^^^^^^^^^^ comment.line.numbersign.ruby
def method # test comment # ^^^ meta.function.method.without-arguments.ruby keyword.control.def.ruby # ^^^^^^ meta.function.method.without-arguments.ruby entity.name.function.ruby # ^ comment.line.number-sign.ruby punctuation.definition.comment.ruby # ^^^^^^^^^^^^^ comment.line.number-sign.ruby hello, world = [1,2] # ^^^^^ variable.other.ruby # ^ punctuation.separator.object.ruby # ^^^^^ variable.other.ruby # ^ keyword.operator.assignment.ruby # ^ punctuation.section.array.begin.ruby # ^ constant.numeric.ruby # ^ punctuation.separator.object.ruby # ^ constant.numeric.ruby # ^ punctuation.section.array.end.ruby end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def method_without_parentheses *a, **b, &c # test comment\n# ^^^ meta.function.method.with-arguments.ruby keyword.control.def.ruby\n# ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.method.with-arguments.ruby entity.name.function.ruby\n# ^ meta.function.method.with-arguments.ruby storage.type.variable.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^^ meta.function.method.with-arguments.ruby storage.type.variable.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^ meta.function.method.with-arguments.ruby storage.type.variable.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ comment.line.number-sign.ruby punctuation.definition.comment.ruby\n# ^^^^^^^^^^^^^ comment.line.number-sign.ruby\n hello, world = [1,2]\n# ^^^^^ variable.other.ruby\n# ^ punctuation.separator.object.ruby\n# ^^^^^ variable.other.ruby\n# ^ keyword.operator.assignment.ruby\n# ^ punctuation.section.array.begin.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.separator.object.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.section.array.end.ruby\n end", "def method_without_parentheses a, b, c = [foo,bar,baz] # test comment\n# ^^^ meta.function.method.with-arguments.ruby keyword.control.def.ruby\n# ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.method.with-arguments.ruby entity.name.function.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby keyword.operator.assignment.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.section.array.begin.ruby\n# ^^^ meta.function.method.with-arguments.ruby variable.other.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^^^ meta.function.method.with-arguments.ruby variable.other.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^^^ meta.function.method.with-arguments.ruby variable.other.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.section.array.end.ruby\n# ^ comment.line.number-sign.ruby punctuation.definition.comment.ruby\n# ^^^^^^^^^^^^^ comment.line.number-sign.ruby\n hello, world = [1,2]\n# ^^^^^ variable.other.ruby\n# ^ punctuation.separator.object.ruby\n# ^^^^^ variable.other.ruby\n# ^ keyword.operator.assignment.ruby\n# ^ punctuation.section.array.begin.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.separator.object.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.section.array.end.ruby\n end", "def method_with_parentheses(a, b, c = [foo,bar,baz]) # test comment\n# ^^^ meta.function.method.with-arguments.ruby keyword.control.def.ruby\n# ^^^^^^^^^^^^^^^^^^^^^^^ meta.function.method.with-arguments.ruby entity.name.function.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.definition.parameters.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby keyword.operator.assignment.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.section.array.begin.ruby\n# ^^^ meta.function.method.with-arguments.ruby variable.other.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^^^ meta.function.method.with-arguments.ruby variable.other.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^^^ meta.function.method.with-arguments.ruby variable.other.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.section.array.end.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.definition.parameters.ruby\n# ^ comment.line.number-sign.ruby punctuation.definition.comment.ruby\n# ^^^^^^^^^^^^^ comment.line.number-sign.ruby\n hello, world = [1,2]\n# ^^^^^ variable.other.ruby\n# ^ punctuation.separator.object.ruby\n# ^^^^^ variable.other.ruby\n# ^ keyword.operator.assignment.ruby\n# ^ punctuation.section.array.begin.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.separator.object.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.section.array.end.ruby\n end", "def comment(string); end", "def comment(string); end", "def comment(string); end", "def comment(string); end", "def comment=(_arg0); end", "def comment=(_arg0); end", "def comment=(_arg0); end", "def comment=(_arg0); end", "def comment _args\n \"comment _args;\" \n end", "def comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 15)\n\n type = COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 148:3: ( ( '#' | '//' ) (~ '\\\\n' )* | '/*' ( . )* '*/' )\n alt_10 = 2\n look_10_0 = @input.peek(1)\n\n if (look_10_0 == ?#) \n alt_10 = 1\n elsif (look_10_0 == ?/) \n look_10_2 = @input.peek(2)\n\n if (look_10_2 == ?/) \n alt_10 = 1\n elsif (look_10_2 == ?*) \n alt_10 = 2\n else\n nvae = NoViableAlternative(\"\", 10, 2)\n raise nvae\n end\n else\n nvae = NoViableAlternative(\"\", 10, 0)\n raise nvae\n end\n case alt_10\n when 1\n # at line 148:5: ( '#' | '//' ) (~ '\\\\n' )*\n # at line 148:5: ( '#' | '//' )\n alt_7 = 2\n look_7_0 = @input.peek(1)\n\n if (look_7_0 == ?#) \n alt_7 = 1\n elsif (look_7_0 == ?/) \n alt_7 = 2\n else\n nvae = NoViableAlternative(\"\", 7, 0)\n raise nvae\n end\n case alt_7\n when 1\n # at line 148:7: '#'\n match(?#)\n\n when 2\n # at line 148:13: '//'\n match(\"//\")\n\n end\n # at line 148:20: (~ '\\\\n' )*\n while true # decision 8\n alt_8 = 2\n look_8_0 = @input.peek(1)\n\n if (look_8_0.between?(0x0000, ?\\t) || look_8_0.between?(0x000B, 0xFFFF)) \n alt_8 = 1\n\n end\n case alt_8\n when 1\n # at line 148:20: ~ '\\\\n'\n if @input.peek(1).between?(0x0000, ?\\t) || @input.peek(1).between?(0x000B, 0x00FF)\n @input.consume\n else\n mse = MismatchedSet(nil)\n recover(mse)\n raise mse\n end\n\n\n\n else\n break # out of loop for decision 8\n end\n end # loop for decision 8\n\n when 2\n # at line 149:5: '/*' ( . )* '*/'\n match(\"/*\")\n # at line 149:10: ( . )*\n while true # decision 9\n alt_9 = 2\n look_9_0 = @input.peek(1)\n\n if (look_9_0 == ?*) \n look_9_1 = @input.peek(2)\n\n if (look_9_1 == ?/) \n alt_9 = 2\n elsif (look_9_1.between?(0x0000, ?.) || look_9_1.between?(?0, 0xFFFF)) \n alt_9 = 1\n\n end\n elsif (look_9_0.between?(0x0000, ?)) || look_9_0.between?(?+, 0xFFFF)) \n alt_9 = 1\n\n end\n case alt_9\n when 1\n # at line 149:10: .\n match_any\n\n else\n break # out of loop for decision 9\n end\n end # loop for decision 9\n match(\"*/\")\n\n end\n \n @state.type = type\n @state.channel = channel\n # --> action\n skip \n # <-- action\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 15)\n\n end", "def test_comment_full_name\n 't1_cce66qf'\nend", "def SomeClass explainMore\n p \"no comment\"\n end", "def comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 49 )\n\n\n\n type = COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 228:11: '//' ( . )* ( '\\\\n' | '\\\\r' )\n match( \"//\" )\n\n # at line 228:16: ( . )*\n while true # decision 6\n alt_6 = 2\n look_6_0 = @input.peek( 1 )\n\n if ( look_6_0 == 0xa || look_6_0 == 0xd )\n alt_6 = 2\n elsif ( look_6_0.between?( 0x0, 0x9 ) || look_6_0.between?( 0xb, 0xc ) || look_6_0.between?( 0xe, 0xffff ) )\n alt_6 = 1\n\n end\n case alt_6\n when 1\n # at line 228:16: .\n match_any\n\n else\n break # out of loop for decision 6\n end\n end # loop for decision 6\n\n if @input.peek(1) == 0xa || @input.peek(1) == 0xd\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n\n end\n\n\n\n # --> action\n channel = HIDDEN;\n # <-- action\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 49 )\n\n\n end", "def comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 13 )\n\n type = COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 63:5: '#' (~ ( '\\\\r' | '\\\\n' ) )*\n match( 0x23 )\n # at line 63:9: (~ ( '\\\\r' | '\\\\n' ) )*\n while true # decision 22\n alt_22 = 2\n look_22_0 = @input.peek( 1 )\n\n if ( look_22_0.between?( 0x0, 0x9 ) || look_22_0.between?( 0xb, 0xc ) || look_22_0.between?( 0xe, 0xffff ) )\n alt_22 = 1\n\n end\n case alt_22\n when 1\n # at line 63:11: ~ ( '\\\\r' | '\\\\n' )\n if @input.peek( 1 ).between?( 0x0, 0x9 ) || @input.peek( 1 ).between?( 0xb, 0xc ) || @input.peek( 1 ).between?( 0xe, 0xff )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n\n else\n break # out of loop for decision 22\n end\n end # loop for decision 22\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__, 13 )\n\n end", "def lex_comment line\n # do nothing\n end", "def some_method(with:, args:)\n # Floating comment\n end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 35 )\n\n type = COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 350:9: '#' (~ ( '\\\\n' | '\\\\r' ) )*\n match( 0x23 )\n # at line 350:13: (~ ( '\\\\n' | '\\\\r' ) )*\n while true # decision 13\n alt_13 = 2\n look_13_0 = @input.peek( 1 )\n\n if ( look_13_0.between?( 0x0, 0x9 ) || look_13_0.between?( 0xb, 0xc ) || look_13_0.between?( 0xe, 0xffff ) )\n alt_13 = 1\n\n end\n case alt_13\n when 1\n # at line 350:13: ~ ( '\\\\n' | '\\\\r' )\n if @input.peek( 1 ).between?( 0x0, 0x9 ) || @input.peek( 1 ).between?( 0xb, 0xc ) || @input.peek( 1 ).between?( 0xe, 0xff )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n\n else\n break # out of loop for decision 13\n end\n end # loop for decision 13\n # --> action\n channel=HIDDEN;\n # <-- action\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__, 35 )\n\n end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def lex_en_line_comment=(_arg0); end", "def lex_en_line_comment=(_arg0); end", "def lex_en_line_comment=(_arg0); end", "def line_comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 78 )\n\n\n\n type = LINE_COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 608:8: '#' (~ ( '\\\\n' | '\\\\r' ) )* ( '\\\\r' )? '\\\\n'\n match( 0x23 )\n # at line 608:12: (~ ( '\\\\n' | '\\\\r' ) )*\n while true # decision 25\n alt_25 = 2\n look_25_0 = @input.peek( 1 )\n\n if ( look_25_0.between?( 0x0, 0x9 ) || look_25_0.between?( 0xb, 0xc ) || look_25_0.between?( 0xe, 0xffff ) )\n alt_25 = 1\n\n end\n case alt_25\n when 1\n # at line \n if @input.peek( 1 ).between?( 0x0, 0x9 ) || @input.peek( 1 ).between?( 0xb, 0xc ) || @input.peek( 1 ).between?( 0xe, 0xffff )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n\n end\n\n\n\n else\n break # out of loop for decision 25\n end\n end # loop for decision 25\n\n # at line 608:26: ( '\\\\r' )?\n alt_26 = 2\n look_26_0 = @input.peek( 1 )\n\n if ( look_26_0 == 0xd )\n alt_26 = 1\n end\n case alt_26\n when 1\n # at line 608:26: '\\\\r'\n match( 0xd )\n\n end\n match( 0xa )\n\n # --> action\n channel=HIDDEN;\n # <-- action\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 78 )\n\n\n end", "def verify_comment(line) \n end", "def lex_en_line_comment; end", "def lex_en_line_comment; end", "def lex_en_line_comment; end", "def lines_of_code; end", "def lines_of_code; end", "def multiline_comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 50 )\n\n\n\n type = MULTILINE_COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 229:21: '/*' ( . )* '*/'\n match( \"/*\" )\n\n # at line 229:26: ( . )*\n while true # decision 7\n alt_7 = 2\n look_7_0 = @input.peek( 1 )\n\n if ( look_7_0 == 0x2a )\n look_7_1 = @input.peek( 2 )\n\n if ( look_7_1 == 0x2f )\n alt_7 = 2\n elsif ( look_7_1.between?( 0x0, 0x2e ) || look_7_1.between?( 0x30, 0xffff ) )\n alt_7 = 1\n\n end\n elsif ( look_7_0.between?( 0x0, 0x29 ) || look_7_0.between?( 0x2b, 0xffff ) )\n alt_7 = 1\n\n end\n case alt_7\n when 1\n # at line 229:26: .\n match_any\n\n else\n break # out of loop for decision 7\n end\n end # loop for decision 7\n\n\n match( \"*/\" )\n\n\n # --> action\n channel = HIDDEN;\n # <-- action\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 50 )\n\n\n end", "def token!\n # at line 1:8: ( T__80 | T__81 | T__82 | EOL | LPAR | RPAR | LLAIZQ | LLADER | COMA | PUNTO | CORDER | CORIZQ | DELIM | ASIGNACION | DOUBLEDOT | COMILLA | OP_REL | OP_ARI | OP_LOG | K_ACCIONARCHIVO | K_ACCIONARREGLO | K_PACKAGE | K_CLASS | K_END | K_DEF | K_VAR | K_REQUIRE | K_IMPLEMENTS | K_EXTENDS | K_IMPRIMIR | K_CONVERSION | K_ASIGNACION | K_RETORNO | K_ACCIONSYS | K_INTERFACE | K_IF | K_TIMES | K_DO | K_EACH | K_ELSE | K_INVOKE | K_NEW | TIPO | K_REFERENCIA | K_INSPECCIONAR | K_MATEMATICA | K_NUM | K_RESIZE | K_ORDENAR | ModoOrd | K_BUSQUEDA | K_TIPOBUSQUEDA | K_WHERE | K_SPLIT | K_BEGIN | K_DIR | K_UNION | K_VISIBILIDAD | K_MODIFICADOR | K_ARRAY | K_PROPIEDAD | K_GET | K_SET | K_VALUE | K_INITIALIZE | K_FUNC | K_VOID | HexLiteral | DecimalLiteral | OctalLiteral | WS | LINE_COMMENT | Identificador )\n alt_28 = 73\n alt_28 = @dfa28.predict( @input )\n case alt_28\n when 1\n # at line 1:10: T__80\n t__80!\n\n\n when 2\n # at line 1:16: T__81\n t__81!\n\n\n when 3\n # at line 1:22: T__82\n t__82!\n\n\n when 4\n # at line 1:28: EOL\n eol!\n\n\n when 5\n # at line 1:32: LPAR\n lpar!\n\n\n when 6\n # at line 1:37: RPAR\n rpar!\n\n\n when 7\n # at line 1:42: LLAIZQ\n llaizq!\n\n\n when 8\n # at line 1:49: LLADER\n llader!\n\n\n when 9\n # at line 1:56: COMA\n coma!\n\n\n when 10\n # at line 1:61: PUNTO\n punto!\n\n\n when 11\n # at line 1:67: CORDER\n corder!\n\n\n when 12\n # at line 1:74: CORIZQ\n corizq!\n\n\n when 13\n # at line 1:81: DELIM\n delim!\n\n\n when 14\n # at line 1:87: ASIGNACION\n asignacion!\n\n\n when 15\n # at line 1:98: DOUBLEDOT\n doubledot!\n\n\n when 16\n # at line 1:108: COMILLA\n comilla!\n\n\n when 17\n # at line 1:116: OP_REL\n op_rel!\n\n\n when 18\n # at line 1:123: OP_ARI\n op_ari!\n\n\n when 19\n # at line 1:130: OP_LOG\n op_log!\n\n\n when 20\n # at line 1:137: K_ACCIONARCHIVO\n k_accionarchivo!\n\n\n when 21\n # at line 1:153: K_ACCIONARREGLO\n k_accionarreglo!\n\n\n when 22\n # at line 1:169: K_PACKAGE\n k_package!\n\n\n when 23\n # at line 1:179: K_CLASS\n k_class!\n\n\n when 24\n # at line 1:187: K_END\n k_end!\n\n\n when 25\n # at line 1:193: K_DEF\n k_def!\n\n\n when 26\n # at line 1:199: K_VAR\n k_var!\n\n\n when 27\n # at line 1:205: K_REQUIRE\n k_require!\n\n\n when 28\n # at line 1:215: K_IMPLEMENTS\n k_implements!\n\n\n when 29\n # at line 1:228: K_EXTENDS\n k_extends!\n\n\n when 30\n # at line 1:238: K_IMPRIMIR\n k_imprimir!\n\n\n when 31\n # at line 1:249: K_CONVERSION\n k_conversion!\n\n\n when 32\n # at line 1:262: K_ASIGNACION\n k_asignacion!\n\n\n when 33\n # at line 1:275: K_RETORNO\n k_retorno!\n\n\n when 34\n # at line 1:285: K_ACCIONSYS\n k_accionsys!\n\n\n when 35\n # at line 1:297: K_INTERFACE\n k_interface!\n\n\n when 36\n # at line 1:309: K_IF\n k_if!\n\n\n when 37\n # at line 1:314: K_TIMES\n k_times!\n\n\n when 38\n # at line 1:322: K_DO\n k_do!\n\n\n when 39\n # at line 1:327: K_EACH\n k_each!\n\n\n when 40\n # at line 1:334: K_ELSE\n k_else!\n\n\n when 41\n # at line 1:341: K_INVOKE\n k_invoke!\n\n\n when 42\n # at line 1:350: K_NEW\n k_new!\n\n\n when 43\n # at line 1:356: TIPO\n tipo!\n\n\n when 44\n # at line 1:361: K_REFERENCIA\n k_referencia!\n\n\n when 45\n # at line 1:374: K_INSPECCIONAR\n k_inspeccionar!\n\n\n when 46\n # at line 1:389: K_MATEMATICA\n k_matematica!\n\n\n when 47\n # at line 1:402: K_NUM\n k_num!\n\n\n when 48\n # at line 1:408: K_RESIZE\n k_resize!\n\n\n when 49\n # at line 1:417: K_ORDENAR\n k_ordenar!\n\n\n when 50\n # at line 1:427: ModoOrd\n modo_ord!\n\n\n when 51\n # at line 1:435: K_BUSQUEDA\n k_busqueda!\n\n\n when 52\n # at line 1:446: K_TIPOBUSQUEDA\n k_tipobusqueda!\n\n\n when 53\n # at line 1:461: K_WHERE\n k_where!\n\n\n when 54\n # at line 1:469: K_SPLIT\n k_split!\n\n\n when 55\n # at line 1:477: K_BEGIN\n k_begin!\n\n\n when 56\n # at line 1:485: K_DIR\n k_dir!\n\n\n when 57\n # at line 1:491: K_UNION\n k_union!\n\n\n when 58\n # at line 1:499: K_VISIBILIDAD\n k_visibilidad!\n\n\n when 59\n # at line 1:513: K_MODIFICADOR\n k_modificador!\n\n\n when 60\n # at line 1:527: K_ARRAY\n k_array!\n\n\n when 61\n # at line 1:535: K_PROPIEDAD\n k_propiedad!\n\n\n when 62\n # at line 1:547: K_GET\n k_get!\n\n\n when 63\n # at line 1:553: K_SET\n k_set!\n\n\n when 64\n # at line 1:559: K_VALUE\n k_value!\n\n\n when 65\n # at line 1:567: K_INITIALIZE\n k_initialize!\n\n\n when 66\n # at line 1:580: K_FUNC\n k_func!\n\n\n when 67\n # at line 1:587: K_VOID\n k_void!\n\n\n when 68\n # at line 1:594: HexLiteral\n hex_literal!\n\n\n when 69\n # at line 1:605: DecimalLiteral\n decimal_literal!\n\n\n when 70\n # at line 1:620: OctalLiteral\n octal_literal!\n\n\n when 71\n # at line 1:633: WS\n ws!\n\n\n when 72\n # at line 1:636: LINE_COMMENT\n line_comment!\n\n\n when 73\n # at line 1:649: Identificador\n identificador!\n\n\n end\n end", "def ml_comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 40)\n\n type = ML_COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 478:4: '/*' ( . )* '*/'\n match(\"/*\")\n # --> action\n if @input.peek(1) == ?* then type = DOC_COMMENT else channel = HIDDEN end \n # <-- action\n # at line 478:88: ( . )*\n loop do #loop 4\n alt_4 = 2\n look_4_0 = @input.peek(1)\n\n if (look_4_0 == ?*) \n look_4_1 = @input.peek(2)\n\n if (look_4_1 == ?/) \n alt_4 = 2\n elsif (look_4_1.between?(0x0000, ?.) || look_4_1.between?(?0, 0xFFFF)) \n alt_4 = 1\n\n end\n elsif (look_4_0.between?(0x0000, ?)) || look_4_0.between?(?+, 0xFFFF)) \n alt_4 = 1\n\n end\n case alt_4\n when 1\n # at line 478:88: .\n match_any\n\n else\n break #loop 4\n end\n end\n match(\"*/\")\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__, 40)\n\n end", "def comment_string\n @comment_syntax.string_for_method_entity self\n end", "def extract_magic_comments(processed_source); end", "def last_magic_comment(source); end", "def step\n case\n when bol? && check( /=begin/ )\n start_group( :comment, scan_until( /^=end#{EOL}/ ) )\n when bol? && check( /__END__#{EOL}/ )\n start_group( :comment, scan_until( /\\Z/ ) )\n else\n case\n when check( /def\\s+/ )\n start_group :keyword, scan( /def\\s+/ )\n start_group :method, scan_until( /(?=[;(\\s]|#{EOL})/ )\n when check( /class\\s+/ )\n start_group :keyword, scan( /class\\s+/ )\n start_group :class, scan_until( /(?=[;\\s<]|#{EOL})/ )\n when check( /module\\s+/ )\n start_group :keyword, scan( /module\\s+/ )\n start_group :module, scan_until( /(?=[;\\s]|#{EOL})/ )\n when check( /::/ )\n start_group :punct, scan(/::/)\n when check( /:\"/ )\n start_group :symbol, scan(/:/)\n scan_delimited_region :symbol, :symbol, \"\", true\n @allow_operator = true\n when check( /:'/ )\n start_group :symbol, scan(/:/)\n scan_delimited_region :symbol, :symbol, \"\", false\n @allow_operator = true\n when scan( /:[_a-zA-Z@$][$@\\w]*[=!?]?/ )\n start_group :symbol, matched\n @allow_operator = true\n when scan( /\\?(\\\\[^\\n\\r]|[^\\\\\\n\\r\\s])/ )\n start_group :char, matched\n @allow_operator = true\n when check( /(__FILE__|__LINE__|true|false|nil|self)[?!]?/ )\n if @selector || matched[-1] == ?? || matched[-1] == ?!\n start_group :ident,\n scan(/(__FILE__|__LINE__|true|false|nil|self)[?!]?/)\n else\n start_group :constant,\n scan(/(__FILE__|__LINE__|true|false|nil|self)/)\n end\n @selector = false\n @allow_operator = true\n when scan(/0([bB][01]+|[oO][0-7]+|[dD][0-9]+|[xX][0-9a-fA-F]+)/)\n start_group :number, matched\n @allow_operator = true\n else\n case peek(2)\n when \"%r\"\n scan_delimited_region :punct, :regex, scan( /../ ), true\n @allow_operator = true\n when \"%w\", \"%q\"\n scan_delimited_region :punct, :string, scan( /../ ), false\n @allow_operator = true\n when \"%s\"\n scan_delimited_region :punct, :symbol, scan( /../ ), false\n @allow_operator = true\n when \"%W\", \"%Q\", \"%x\"\n scan_delimited_region :punct, :string, scan( /../ ), true\n @allow_operator = true\n when /%[^\\sa-zA-Z0-9]/\n scan_delimited_region :punct, :string, scan( /./ ), true\n @allow_operator = true\n when \"<<\"\n saw_word = ( chunk[-1,1] =~ /[\\w!?]/ )\n start_group :punct, scan( /<</ )\n if saw_word\n @allow_operator = false\n return\n end\n\n float_right = scan( /-/ )\n append \"-\" if float_right\n if ( type = scan( /['\"]/ ) )\n append type\n delim = scan_until( /(?=#{type})/ )\n if delim.nil?\n append scan_until( /\\Z/ )\n return\n end\n else\n delim = scan( /\\w+/ ) or return\n end\n start_group :constant, delim\n start_group :punct, scan( /#{type}/ ) if type\n @heredocs << [ float_right, type, delim ]\n @allow_operator = true\n else\n case peek(1)\n when /[\\n\\r]/\n unless @heredocs.empty?\n scan_heredoc(*@heredocs.shift)\n else\n start_group :normal, scan( /\\s+/ )\n end\n @allow_operator = false\n when /\\s/\n start_group :normal, scan( /\\s+/ )\n when \"#\"\n start_group :comment, scan( /#[^\\n\\r]*/ )\n when /[A-Z]/\n start_group @selector ? :ident : :constant, scan( /\\w+/ )\n @allow_operator = true\n when /[a-z_]/\n word = scan( /\\w+[?!]?/ )\n if !@selector && KEYWORDS.include?( word )\n start_group :keyword, word\n @allow_operator = false\n elsif\n start_group :ident, word\n @allow_operator = true\n end\n @selector = false\n when /\\d/\n start_group :number,\n scan( /[\\d_]+(\\.[\\d_]+)?([eE][\\d_]+)?/ )\n @allow_operator = true\n when '\"'\n scan_delimited_region :punct, :string, \"\", true\n @allow_operator = true\n when '/'\n if @allow_operator\n start_group :punct, scan(%r{/})\n @allow_operator = false\n else\n scan_delimited_region :punct, :regex, \"\", true\n @allow_operator = true\n end\n when \"'\"\n scan_delimited_region :punct, :string, \"\", false\n @allow_operator = true\n when \".\"\n dots = scan( /\\.{1,3}/ )\n start_group :punct, dots\n @selector = ( dots.length == 1 )\n when /[@]/\n start_group :attribute, scan( /@{1,2}\\w*/ )\n @allow_operator = true\n when /[$]/\n start_group :global, scan(/\\$/)\n start_group :global, scan( /\\w+|./ ) if check(/./)\n @allow_operator = true\n when /[-!?*\\/+=<>(\\[\\{}:;,&|%]/\n start_group :punct, scan(/./)\n @allow_operator = false\n when /[)\\]]/\n start_group :punct, scan(/./)\n @allow_operator = true\n else\n # all else just falls through this, to prevent\n # infinite loops...\n append getch\n end\n end\n end\n end\n end", "def sl_comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 39)\n\n type = SL_COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 470:5: '//' ( ' $ANTLR ' SRC | (~ ( '\\\\r' | '\\\\n' ) )* ) ( '\\\\r' )? '\\\\n'\n match(\"//\")\n # at line 471:5: ( ' $ANTLR ' SRC | (~ ( '\\\\r' | '\\\\n' ) )* )\n alt_2 = 2\n alt_2 = @dfa2.predict(@input)\n case alt_2\n when 1\n # at line 471:7: ' $ANTLR ' SRC\n match(\" $ANTLR \")\n src!\n\n when 2\n # at line 472:6: (~ ( '\\\\r' | '\\\\n' ) )*\n # at line 472:6: (~ ( '\\\\r' | '\\\\n' ) )*\n loop do #loop 1\n alt_1 = 2\n look_1_0 = @input.peek(1)\n\n if (look_1_0.between?(0x0000, ?\\t) || look_1_0.between?(0x000B, ?\\f) || look_1_0.between?(0x000E, 0xFFFF)) \n alt_1 = 1\n\n end\n case alt_1\n when 1\n # at line 472:6: ~ ( '\\\\r' | '\\\\n' )\n if @input.peek(1).between?(0x0000, ?\\t) || @input.peek(1).between?(0x000B, ?\\f) || @input.peek(1).between?(0x000E, 0x00FF)\n @input.consume\n else\n mse = MismatchedSet(nil)\n recover(mse)\n raise mse\n end\n\n\n\n else\n break #loop 1\n end\n end\n\n end\n # at line 474:3: ( '\\\\r' )?\n alt_3 = 2\n look_3_0 = @input.peek(1)\n\n if (look_3_0 == ?\\r) \n alt_3 = 1\n end\n case alt_3\n when 1\n # at line 474:3: '\\\\r'\n match(?\\r)\n\n end\n match(?\\n)\n # --> action\n channel=HIDDEN;\n # <-- action\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__, 39)\n\n end", "def mysql_modsec_versioned_comment\n if self =~ /(--|\\/\\*|\\#)/\n delim=$1\n inj = self.gsub(\"#{delim}\", '')\n else\n inj=self\n end\n foo=\"/*!30#{rand(9).to_s+rand(9).to_s+rand(9).to_s}#{inj}*/\"\n foo += delim if delim\n return foo\n end", "def docufy(src,i)\n m = /RM_[A-z0-9]+/.match(src[i])\n name = m[0]\n name = name.sub(\"RM_\",\"RedisModule_\")\n proto = src[i].sub(\"{\",\"\").strip+\";\\n\"\n proto = proto.sub(\"RM_\",\"RedisModule_\")\n proto = linebreak_proto(proto, \" \");\n # Add a link target with the function name. (We don't trust the exact id of\n # the generated one, which depends on the Markdown implementation.)\n puts \"<span id=\\\"#{name}\\\"></span>\\n\\n\"\n puts \"### `#{name}`\\n\\n\"\n puts \" #{proto}\\n\"\n puts \"**Available since:** #{$since[name] or \"unreleased\"}\\n\\n\"\n comment = \"\"\n while true\n i = i-1\n comment = src[i]+comment\n break if src[i] =~ /\\/\\*/\n end\n comment = markdown(comment)\n puts comment+\"\\n\\n\"\nend", "def create_comment(string, &block); end", "def create_comment(string, &block); end", "def xxxtest_function_prototype_on_more_than_one_line\r\n length = initialize_length(\r\n <<-EOD\r\n func_prototype(\r\n int myCat,\r\n boolean huh\r\n );\r\n EOD\r\n )\r\n assert_equal(nil, length.counts['func_prototype'])\r\n assert_equal(5, length.counts['global'])\r\n end", "def comment?; end", "def comment?; end", "def method_help(method)\n method.comment.gsub(/^#\\s/m, '').strip\n end", "def test; end", "def source_line; end", "def my_name_is\n # and my code is here\n # two spaces for tabs in Ruby\nend", "def firstMethod()\n p \"hey this is first method ok\"\n p \"here i show how can create method in ruby\"\n p \" know time end \"\nend", "def wine_comment\n end", "def charm_failure\n slowly do\n\"\"\"\nDuncan barks, wags his tail, rolls over, does all his awesome tricks...\n\nBut the troll just looks on in disdain. \n\n'Go home, little dog, before I sqquish you.' \n\"\"\"\n end\n what_next\n end", "def hey_hey; end", "def method_source(mnemonic, flags, sample, prefix)\n\t\"\"\"// Mnemonic: #{sample}\n// Sets Flags: #{flags}\nfunc (p *GBProcessor) #{prefix}#{mnemonic}(opcode byte, params ...byte) {\n\n}\"\"\"\nend", "def function_definition\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 8 )\n\n\n value = nil\n\n\n name = nil\n type = nil\n a = nil\n\n\n begin\n # at line 51:5: OPEN type= variable_type name= IDENT ( '(' (type= variable_type name= IDENT ( ',' type= variable_type name= IDENT )* )? ')' )? ( CLOSE | NL (a= statement )* CLOSE )\n match( OPEN, TOKENS_FOLLOWING_OPEN_IN_function_definition_350 )\n @state.following.push( TOKENS_FOLLOWING_variable_type_IN_function_definition_354 )\n type = variable_type\n @state.following.pop\n name = match( IDENT, TOKENS_FOLLOWING_IDENT_IN_function_definition_358 )\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value = FunctionDefinitionEval.new(name.text, type) \n # <-- action\n end\n\n # at line 52:3: ( '(' (type= variable_type name= IDENT ( ',' type= variable_type name= IDENT )* )? ')' )?\n alt_17 = 2\n look_17_0 = @input.peek( 1 )\n\n if ( look_17_0 == T__34 )\n alt_17 = 1\n end\n case alt_17\n when 1\n # at line 52:5: '(' (type= variable_type name= IDENT ( ',' type= variable_type name= IDENT )* )? ')'\n match( T__34, TOKENS_FOLLOWING_T__34_IN_function_definition_366 )\n # at line 52:9: (type= variable_type name= IDENT ( ',' type= variable_type name= IDENT )* )?\n alt_16 = 2\n look_16_0 = @input.peek( 1 )\n\n if ( look_16_0 == IDENT || look_16_0.between?( TYPE_BOOL, TYPE_VOID ) )\n alt_16 = 1\n end\n case alt_16\n when 1\n # at line 53:5: type= variable_type name= IDENT ( ',' type= variable_type name= IDENT )*\n @state.following.push( TOKENS_FOLLOWING_variable_type_IN_function_definition_376 )\n type = variable_type\n @state.following.pop\n name = match( IDENT, TOKENS_FOLLOWING_IDENT_IN_function_definition_380 )\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value.add_argument(type, name.text) \n # <-- action\n end\n\n # at line 54:5: ( ',' type= variable_type name= IDENT )*\n while true # decision 15\n alt_15 = 2\n look_15_0 = @input.peek( 1 )\n\n if ( look_15_0 == T__40 )\n alt_15 = 1\n\n end\n case alt_15\n when 1\n # at line 54:6: ',' type= variable_type name= IDENT\n match( T__40, TOKENS_FOLLOWING_T__40_IN_function_definition_389 )\n @state.following.push( TOKENS_FOLLOWING_variable_type_IN_function_definition_393 )\n type = variable_type\n @state.following.pop\n name = match( IDENT, TOKENS_FOLLOWING_IDENT_IN_function_definition_397 )\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value.add_argument(type, name.text) \n # <-- action\n end\n\n\n else\n break # out of loop for decision 15\n end\n end # loop for decision 15\n\n\n end\n match( T__35, TOKENS_FOLLOWING_T__35_IN_function_definition_409 )\n\n end\n # at line 56:3: ( CLOSE | NL (a= statement )* CLOSE )\n alt_19 = 2\n look_19_0 = @input.peek( 1 )\n\n if ( look_19_0 == CLOSE )\n alt_19 = 1\n elsif ( look_19_0 == NL )\n alt_19 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n\n\n raise NoViableAlternative( \"\", 19, 0 )\n\n end\n case alt_19\n when 1\n # at line 56:5: CLOSE\n match( CLOSE, TOKENS_FOLLOWING_CLOSE_IN_function_definition_418 )\n\n when 2\n # at line 56:13: NL (a= statement )* CLOSE\n match( NL, TOKENS_FOLLOWING_NL_IN_function_definition_422 )\n # at line 56:16: (a= statement )*\n while true # decision 18\n alt_18 = 2\n look_18_0 = @input.peek( 1 )\n\n if ( look_18_0.between?( IDENT, IF ) || look_18_0 == RETURN || look_18_0 == WHILE )\n alt_18 = 1\n\n end\n case alt_18\n when 1\n # at line 56:17: a= statement\n @state.following.push( TOKENS_FOLLOWING_statement_IN_function_definition_427 )\n a = statement\n @state.following.pop\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value.add_statement(a) \n # <-- action\n end\n\n\n else\n break # out of loop for decision 18\n end\n end # loop for decision 18\n\n match( CLOSE, TOKENS_FOLLOWING_CLOSE_IN_function_definition_434 )\n\n end\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__, 8 )\n\n\n end\n\n return value\n end", "def base_docstring; end", "def c_generate_comment_header\nputs <<HERE\n/*\n * This file contains autogenerated routines for dispatching and disassembling\n * MIPS opcodes.\n *\n * The code has been generated by mipsgen.\n *\n * See scripts/mipsgen.rb for the code generator framework.\n * See codegen/cgen.rb for C specific information.\n */\n\nHERE\nend", "def test_method\n \"Here is the sample input\"\n end", "def _comment\n\n _save = self.pos\n while true # sequence\n _tmp = match_string(\"#\")\n unless _tmp\n self.pos = _save\n break\n end\n while true\n\n _save2 = self.pos\n while true # sequence\n _save3 = self.pos\n _tmp = apply(:_eol)\n _tmp = _tmp ? nil : true\n self.pos = _save3\n unless _tmp\n self.pos = _save2\n break\n end\n _tmp = get_byte\n unless _tmp\n self.pos = _save2\n end\n break\n end # end sequence\n\n break unless _tmp\n end\n _tmp = true\n unless _tmp\n self.pos = _save\n break\n end\n _tmp = apply(:_eol)\n unless _tmp\n self.pos = _save\n end\n break\n end # end sequence\n\n set_failed_rule :_comment unless _tmp\n return _tmp\n end", "def docstring_hash_flag; end", "def buzzword; end", "def buzzword; end", "def comments_hash_flag=(_arg0); end", "def get_comment(n, algebraic_structure)\n ret = <<EOS\n/**\n* Combine #{n} #{algebraic_structure}s into a product #{algebraic_structure}\n*/\nEOS\n ret.strip\nend", "def comments_hash_flag=(_arg0); end", "def test\n puts \"This is a Method........................................\"\nend", "def format_code(code,test)\n <<-EOS\n#!/usr/bin/env ruby\nrequire \\'minitest/autorun\\'\n \n#{code}\n\nclass UserCodeTest < Minitest::Test\n \n def test_assertions \n #{test}\n end\nend\n EOS\n end", "def docstring; end", "def docstring; end", "def comments; end", "def comments; end", "def comments; end", "def comments; end", "def comments; end", "def comments; end", "def line_comments_option; end", "def define_python_methods\r\n @p.Execute(\"\r\ndef foo(x):\r\n return x + x\r\n\r\ndef bar(x):\r\n return x * x\r\n\"\r\n )\r\nend", "def add_comment comment\n \"\\n###### #{comment} ######\\n\" \n end" ]
[ "0.74315435", "0.73857355", "0.7227881", "0.67796427", "0.67796427", "0.67796427", "0.67796427", "0.6574589", "0.6574589", "0.6574589", "0.6574589", "0.65241516", "0.6462989", "0.6428282", "0.6350332", "0.6297015", "0.6294113", "0.6287649", "0.6274447", "0.62367874", "0.62367874", "0.62367874", "0.62367874", "0.62367874", "0.622023", "0.6164555", "0.6164555", "0.6164555", "0.6164555", "0.6164555", "0.6164555", "0.6164555", "0.6164555", "0.6164555", "0.6164555", "0.6164555", "0.6164555", "0.6164555", "0.6164555", "0.6164555", "0.6164555", "0.6164555", "0.615651", "0.615651", "0.615651", "0.6139433", "0.61334705", "0.60995066", "0.60995066", "0.60995066", "0.6037562", "0.6037562", "0.60334957", "0.6030516", "0.60297215", "0.602446", "0.593931", "0.5938763", "0.58916605", "0.588871", "0.5817207", "0.58123237", "0.57842535", "0.57842535", "0.5774083", "0.57733095", "0.57733095", "0.5753766", "0.57492334", "0.5740995", "0.56771684", "0.56754667", "0.56707394", "0.5642529", "0.563147", "0.5625986", "0.5612579", "0.56053966", "0.55977255", "0.5596593", "0.55829316", "0.55813", "0.55756134", "0.55756134", "0.5575525", "0.55752724", "0.5575056", "0.5572762", "0.55711293", "0.5568454", "0.5568454", "0.55671483", "0.55671483", "0.55671483", "0.55671483", "0.55671483", "0.55671483", "0.55541235", "0.55501646", "0.55375206" ]
0.90345776
0
test comment ^^^ meta.function.method.witharguments.ruby keyword.control.def.ruby ^^^^^^^^^^^^^^^^^^^^^^^ meta.function.method.witharguments.ruby entity.name.function.ruby ^ meta.function.method.witharguments.ruby punctuation.definition.parameters.ruby ^ meta.function.method.witharguments.ruby storage.type.variable.ruby ^ meta.function.method.witharguments.ruby variable.parameter.function.ruby ^ meta.function.method.witharguments.ruby punctuation.separator.object.ruby ^^ meta.function.method.witharguments.ruby storage.type.variable.ruby ^ meta.function.method.witharguments.ruby variable.parameter.function.ruby ^ meta.function.method.witharguments.ruby punctuation.separator.object.ruby ^ meta.function.method.witharguments.ruby storage.type.variable.ruby ^ meta.function.method.witharguments.ruby variable.parameter.function.ruby ^ meta.function.method.witharguments.ruby punctuation.definition.parameters.ruby ^^^^^ variable.other.ruby ^ punctuation.separator.object.ruby ^^^^^ variable.other.ruby ^ keyword.operator.assignment.ruby ^ punctuation.section.array.begin.ruby ^ constant.numeric.ruby ^ punctuation.separator.object.ruby ^ constant.numeric.ruby ^ punctuation.section.array.end.ruby ^^^ keyword.control.ruby ^ comment.line.numbersign.ruby punctuation.definition.comment.ruby ^^^^^^^^^^^^^ comment.line.numbersign.ruby
def method_with_parentheses(a, b, c = [foo,bar,baz]) hello, world = [1,2] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def method # test comment\n# ^^^ meta.function.method.without-arguments.ruby keyword.control.def.ruby\n# ^^^^^^ meta.function.method.without-arguments.ruby entity.name.function.ruby\n# ^ comment.line.number-sign.ruby punctuation.definition.comment.ruby\n# ^^^^^^^^^^^^^ comment.line.number-sign.ruby\n hello, world = [1,2]\n# ^^^^^ variable.other.ruby\n# ^ punctuation.separator.object.ruby\n# ^^^^^ variable.other.ruby\n# ^ keyword.operator.assignment.ruby\n# ^ punctuation.section.array.begin.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.separator.object.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.section.array.end.ruby\n end", "def method_with_parentheses(a, b, c = [foo,bar,baz]) # test comment\n# ^^^ meta.function.method.with-arguments.ruby keyword.control.def.ruby\n# ^^^^^^^^^^^^^^^^^^^^^^^ meta.function.method.with-arguments.ruby entity.name.function.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.definition.parameters.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby keyword.operator.assignment.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.section.array.begin.ruby\n# ^^^ meta.function.method.with-arguments.ruby variable.other.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^^^ meta.function.method.with-arguments.ruby variable.other.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^^^ meta.function.method.with-arguments.ruby variable.other.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.section.array.end.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.definition.parameters.ruby\n# ^ comment.line.number-sign.ruby punctuation.definition.comment.ruby\n# ^^^^^^^^^^^^^ comment.line.number-sign.ruby\n hello, world = [1,2]\n# ^^^^^ variable.other.ruby\n# ^ punctuation.separator.object.ruby\n# ^^^^^ variable.other.ruby\n# ^ keyword.operator.assignment.ruby\n# ^ punctuation.section.array.begin.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.separator.object.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.section.array.end.ruby\n end", "def method_without_parentheses *a, **b, &c # test comment\n# ^^^ meta.function.method.with-arguments.ruby keyword.control.def.ruby\n# ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.method.with-arguments.ruby entity.name.function.ruby\n# ^ meta.function.method.with-arguments.ruby storage.type.variable.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^^ meta.function.method.with-arguments.ruby storage.type.variable.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^ meta.function.method.with-arguments.ruby storage.type.variable.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ comment.line.number-sign.ruby punctuation.definition.comment.ruby\n# ^^^^^^^^^^^^^ comment.line.number-sign.ruby\n hello, world = [1,2]\n# ^^^^^ variable.other.ruby\n# ^ punctuation.separator.object.ruby\n# ^^^^^ variable.other.ruby\n# ^ keyword.operator.assignment.ruby\n# ^ punctuation.section.array.begin.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.separator.object.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.section.array.end.ruby\n end", "def method_without_parentheses a, b, c = [foo,bar,baz] # test comment\n# ^^^ meta.function.method.with-arguments.ruby keyword.control.def.ruby\n# ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.method.with-arguments.ruby entity.name.function.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby keyword.operator.assignment.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.section.array.begin.ruby\n# ^^^ meta.function.method.with-arguments.ruby variable.other.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^^^ meta.function.method.with-arguments.ruby variable.other.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^^^ meta.function.method.with-arguments.ruby variable.other.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.section.array.end.ruby\n# ^ comment.line.number-sign.ruby punctuation.definition.comment.ruby\n# ^^^^^^^^^^^^^ comment.line.number-sign.ruby\n hello, world = [1,2]\n# ^^^^^ variable.other.ruby\n# ^ punctuation.separator.object.ruby\n# ^^^^^ variable.other.ruby\n# ^ keyword.operator.assignment.ruby\n# ^ punctuation.section.array.begin.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.separator.object.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.section.array.end.ruby\n end", "def token!\n # at line 1:8: ( T__80 | T__81 | T__82 | EOL | LPAR | RPAR | LLAIZQ | LLADER | COMA | PUNTO | CORDER | CORIZQ | DELIM | ASIGNACION | DOUBLEDOT | COMILLA | OP_REL | OP_ARI | OP_LOG | K_ACCIONARCHIVO | K_ACCIONARREGLO | K_PACKAGE | K_CLASS | K_END | K_DEF | K_VAR | K_REQUIRE | K_IMPLEMENTS | K_EXTENDS | K_IMPRIMIR | K_CONVERSION | K_ASIGNACION | K_RETORNO | K_ACCIONSYS | K_INTERFACE | K_IF | K_TIMES | K_DO | K_EACH | K_ELSE | K_INVOKE | K_NEW | TIPO | K_REFERENCIA | K_INSPECCIONAR | K_MATEMATICA | K_NUM | K_RESIZE | K_ORDENAR | ModoOrd | K_BUSQUEDA | K_TIPOBUSQUEDA | K_WHERE | K_SPLIT | K_BEGIN | K_DIR | K_UNION | K_VISIBILIDAD | K_MODIFICADOR | K_ARRAY | K_PROPIEDAD | K_GET | K_SET | K_VALUE | K_INITIALIZE | K_FUNC | K_VOID | HexLiteral | DecimalLiteral | OctalLiteral | WS | LINE_COMMENT | Identificador )\n alt_28 = 73\n alt_28 = @dfa28.predict( @input )\n case alt_28\n when 1\n # at line 1:10: T__80\n t__80!\n\n\n when 2\n # at line 1:16: T__81\n t__81!\n\n\n when 3\n # at line 1:22: T__82\n t__82!\n\n\n when 4\n # at line 1:28: EOL\n eol!\n\n\n when 5\n # at line 1:32: LPAR\n lpar!\n\n\n when 6\n # at line 1:37: RPAR\n rpar!\n\n\n when 7\n # at line 1:42: LLAIZQ\n llaizq!\n\n\n when 8\n # at line 1:49: LLADER\n llader!\n\n\n when 9\n # at line 1:56: COMA\n coma!\n\n\n when 10\n # at line 1:61: PUNTO\n punto!\n\n\n when 11\n # at line 1:67: CORDER\n corder!\n\n\n when 12\n # at line 1:74: CORIZQ\n corizq!\n\n\n when 13\n # at line 1:81: DELIM\n delim!\n\n\n when 14\n # at line 1:87: ASIGNACION\n asignacion!\n\n\n when 15\n # at line 1:98: DOUBLEDOT\n doubledot!\n\n\n when 16\n # at line 1:108: COMILLA\n comilla!\n\n\n when 17\n # at line 1:116: OP_REL\n op_rel!\n\n\n when 18\n # at line 1:123: OP_ARI\n op_ari!\n\n\n when 19\n # at line 1:130: OP_LOG\n op_log!\n\n\n when 20\n # at line 1:137: K_ACCIONARCHIVO\n k_accionarchivo!\n\n\n when 21\n # at line 1:153: K_ACCIONARREGLO\n k_accionarreglo!\n\n\n when 22\n # at line 1:169: K_PACKAGE\n k_package!\n\n\n when 23\n # at line 1:179: K_CLASS\n k_class!\n\n\n when 24\n # at line 1:187: K_END\n k_end!\n\n\n when 25\n # at line 1:193: K_DEF\n k_def!\n\n\n when 26\n # at line 1:199: K_VAR\n k_var!\n\n\n when 27\n # at line 1:205: K_REQUIRE\n k_require!\n\n\n when 28\n # at line 1:215: K_IMPLEMENTS\n k_implements!\n\n\n when 29\n # at line 1:228: K_EXTENDS\n k_extends!\n\n\n when 30\n # at line 1:238: K_IMPRIMIR\n k_imprimir!\n\n\n when 31\n # at line 1:249: K_CONVERSION\n k_conversion!\n\n\n when 32\n # at line 1:262: K_ASIGNACION\n k_asignacion!\n\n\n when 33\n # at line 1:275: K_RETORNO\n k_retorno!\n\n\n when 34\n # at line 1:285: K_ACCIONSYS\n k_accionsys!\n\n\n when 35\n # at line 1:297: K_INTERFACE\n k_interface!\n\n\n when 36\n # at line 1:309: K_IF\n k_if!\n\n\n when 37\n # at line 1:314: K_TIMES\n k_times!\n\n\n when 38\n # at line 1:322: K_DO\n k_do!\n\n\n when 39\n # at line 1:327: K_EACH\n k_each!\n\n\n when 40\n # at line 1:334: K_ELSE\n k_else!\n\n\n when 41\n # at line 1:341: K_INVOKE\n k_invoke!\n\n\n when 42\n # at line 1:350: K_NEW\n k_new!\n\n\n when 43\n # at line 1:356: TIPO\n tipo!\n\n\n when 44\n # at line 1:361: K_REFERENCIA\n k_referencia!\n\n\n when 45\n # at line 1:374: K_INSPECCIONAR\n k_inspeccionar!\n\n\n when 46\n # at line 1:389: K_MATEMATICA\n k_matematica!\n\n\n when 47\n # at line 1:402: K_NUM\n k_num!\n\n\n when 48\n # at line 1:408: K_RESIZE\n k_resize!\n\n\n when 49\n # at line 1:417: K_ORDENAR\n k_ordenar!\n\n\n when 50\n # at line 1:427: ModoOrd\n modo_ord!\n\n\n when 51\n # at line 1:435: K_BUSQUEDA\n k_busqueda!\n\n\n when 52\n # at line 1:446: K_TIPOBUSQUEDA\n k_tipobusqueda!\n\n\n when 53\n # at line 1:461: K_WHERE\n k_where!\n\n\n when 54\n # at line 1:469: K_SPLIT\n k_split!\n\n\n when 55\n # at line 1:477: K_BEGIN\n k_begin!\n\n\n when 56\n # at line 1:485: K_DIR\n k_dir!\n\n\n when 57\n # at line 1:491: K_UNION\n k_union!\n\n\n when 58\n # at line 1:499: K_VISIBILIDAD\n k_visibilidad!\n\n\n when 59\n # at line 1:513: K_MODIFICADOR\n k_modificador!\n\n\n when 60\n # at line 1:527: K_ARRAY\n k_array!\n\n\n when 61\n # at line 1:535: K_PROPIEDAD\n k_propiedad!\n\n\n when 62\n # at line 1:547: K_GET\n k_get!\n\n\n when 63\n # at line 1:553: K_SET\n k_set!\n\n\n when 64\n # at line 1:559: K_VALUE\n k_value!\n\n\n when 65\n # at line 1:567: K_INITIALIZE\n k_initialize!\n\n\n when 66\n # at line 1:580: K_FUNC\n k_func!\n\n\n when 67\n # at line 1:587: K_VOID\n k_void!\n\n\n when 68\n # at line 1:594: HexLiteral\n hex_literal!\n\n\n when 69\n # at line 1:605: DecimalLiteral\n decimal_literal!\n\n\n when 70\n # at line 1:620: OctalLiteral\n octal_literal!\n\n\n when 71\n # at line 1:633: WS\n ws!\n\n\n when 72\n # at line 1:636: LINE_COMMENT\n line_comment!\n\n\n when 73\n # at line 1:649: Identificador\n identificador!\n\n\n end\n end", "def comment _args\n \"comment _args;\" \n end", "def comment(string); end", "def comment(string); end", "def comment(string); end", "def comment(string); end", "def comment=(_arg0); end", "def comment=(_arg0); end", "def comment=(_arg0); end", "def comment=(_arg0); end", "def test_comment_full_name\n 't1_cce66qf'\nend", "def some_method(with:, args:)\n # Floating comment\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 function_definition\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 8 )\n\n\n value = nil\n\n\n name = nil\n type = nil\n a = nil\n\n\n begin\n # at line 51:5: OPEN type= variable_type name= IDENT ( '(' (type= variable_type name= IDENT ( ',' type= variable_type name= IDENT )* )? ')' )? ( CLOSE | NL (a= statement )* CLOSE )\n match( OPEN, TOKENS_FOLLOWING_OPEN_IN_function_definition_350 )\n @state.following.push( TOKENS_FOLLOWING_variable_type_IN_function_definition_354 )\n type = variable_type\n @state.following.pop\n name = match( IDENT, TOKENS_FOLLOWING_IDENT_IN_function_definition_358 )\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value = FunctionDefinitionEval.new(name.text, type) \n # <-- action\n end\n\n # at line 52:3: ( '(' (type= variable_type name= IDENT ( ',' type= variable_type name= IDENT )* )? ')' )?\n alt_17 = 2\n look_17_0 = @input.peek( 1 )\n\n if ( look_17_0 == T__34 )\n alt_17 = 1\n end\n case alt_17\n when 1\n # at line 52:5: '(' (type= variable_type name= IDENT ( ',' type= variable_type name= IDENT )* )? ')'\n match( T__34, TOKENS_FOLLOWING_T__34_IN_function_definition_366 )\n # at line 52:9: (type= variable_type name= IDENT ( ',' type= variable_type name= IDENT )* )?\n alt_16 = 2\n look_16_0 = @input.peek( 1 )\n\n if ( look_16_0 == IDENT || look_16_0.between?( TYPE_BOOL, TYPE_VOID ) )\n alt_16 = 1\n end\n case alt_16\n when 1\n # at line 53:5: type= variable_type name= IDENT ( ',' type= variable_type name= IDENT )*\n @state.following.push( TOKENS_FOLLOWING_variable_type_IN_function_definition_376 )\n type = variable_type\n @state.following.pop\n name = match( IDENT, TOKENS_FOLLOWING_IDENT_IN_function_definition_380 )\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value.add_argument(type, name.text) \n # <-- action\n end\n\n # at line 54:5: ( ',' type= variable_type name= IDENT )*\n while true # decision 15\n alt_15 = 2\n look_15_0 = @input.peek( 1 )\n\n if ( look_15_0 == T__40 )\n alt_15 = 1\n\n end\n case alt_15\n when 1\n # at line 54:6: ',' type= variable_type name= IDENT\n match( T__40, TOKENS_FOLLOWING_T__40_IN_function_definition_389 )\n @state.following.push( TOKENS_FOLLOWING_variable_type_IN_function_definition_393 )\n type = variable_type\n @state.following.pop\n name = match( IDENT, TOKENS_FOLLOWING_IDENT_IN_function_definition_397 )\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value.add_argument(type, name.text) \n # <-- action\n end\n\n\n else\n break # out of loop for decision 15\n end\n end # loop for decision 15\n\n\n end\n match( T__35, TOKENS_FOLLOWING_T__35_IN_function_definition_409 )\n\n end\n # at line 56:3: ( CLOSE | NL (a= statement )* CLOSE )\n alt_19 = 2\n look_19_0 = @input.peek( 1 )\n\n if ( look_19_0 == CLOSE )\n alt_19 = 1\n elsif ( look_19_0 == NL )\n alt_19 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n\n\n raise NoViableAlternative( \"\", 19, 0 )\n\n end\n case alt_19\n when 1\n # at line 56:5: CLOSE\n match( CLOSE, TOKENS_FOLLOWING_CLOSE_IN_function_definition_418 )\n\n when 2\n # at line 56:13: NL (a= statement )* CLOSE\n match( NL, TOKENS_FOLLOWING_NL_IN_function_definition_422 )\n # at line 56:16: (a= statement )*\n while true # decision 18\n alt_18 = 2\n look_18_0 = @input.peek( 1 )\n\n if ( look_18_0.between?( IDENT, IF ) || look_18_0 == RETURN || look_18_0 == WHILE )\n alt_18 = 1\n\n end\n case alt_18\n when 1\n # at line 56:17: a= statement\n @state.following.push( TOKENS_FOLLOWING_statement_IN_function_definition_427 )\n a = statement\n @state.following.pop\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value.add_statement(a) \n # <-- action\n end\n\n\n else\n break # out of loop for decision 18\n end\n end # loop for decision 18\n\n match( CLOSE, TOKENS_FOLLOWING_CLOSE_IN_function_definition_434 )\n\n end\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__, 8 )\n\n\n end\n\n return value\n end", "def lines_of_code; end", "def lines_of_code; end", "def test; end", "def comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 15)\n\n type = COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 148:3: ( ( '#' | '//' ) (~ '\\\\n' )* | '/*' ( . )* '*/' )\n alt_10 = 2\n look_10_0 = @input.peek(1)\n\n if (look_10_0 == ?#) \n alt_10 = 1\n elsif (look_10_0 == ?/) \n look_10_2 = @input.peek(2)\n\n if (look_10_2 == ?/) \n alt_10 = 1\n elsif (look_10_2 == ?*) \n alt_10 = 2\n else\n nvae = NoViableAlternative(\"\", 10, 2)\n raise nvae\n end\n else\n nvae = NoViableAlternative(\"\", 10, 0)\n raise nvae\n end\n case alt_10\n when 1\n # at line 148:5: ( '#' | '//' ) (~ '\\\\n' )*\n # at line 148:5: ( '#' | '//' )\n alt_7 = 2\n look_7_0 = @input.peek(1)\n\n if (look_7_0 == ?#) \n alt_7 = 1\n elsif (look_7_0 == ?/) \n alt_7 = 2\n else\n nvae = NoViableAlternative(\"\", 7, 0)\n raise nvae\n end\n case alt_7\n when 1\n # at line 148:7: '#'\n match(?#)\n\n when 2\n # at line 148:13: '//'\n match(\"//\")\n\n end\n # at line 148:20: (~ '\\\\n' )*\n while true # decision 8\n alt_8 = 2\n look_8_0 = @input.peek(1)\n\n if (look_8_0.between?(0x0000, ?\\t) || look_8_0.between?(0x000B, 0xFFFF)) \n alt_8 = 1\n\n end\n case alt_8\n when 1\n # at line 148:20: ~ '\\\\n'\n if @input.peek(1).between?(0x0000, ?\\t) || @input.peek(1).between?(0x000B, 0x00FF)\n @input.consume\n else\n mse = MismatchedSet(nil)\n recover(mse)\n raise mse\n end\n\n\n\n else\n break # out of loop for decision 8\n end\n end # loop for decision 8\n\n when 2\n # at line 149:5: '/*' ( . )* '*/'\n match(\"/*\")\n # at line 149:10: ( . )*\n while true # decision 9\n alt_9 = 2\n look_9_0 = @input.peek(1)\n\n if (look_9_0 == ?*) \n look_9_1 = @input.peek(2)\n\n if (look_9_1 == ?/) \n alt_9 = 2\n elsif (look_9_1.between?(0x0000, ?.) || look_9_1.between?(?0, 0xFFFF)) \n alt_9 = 1\n\n end\n elsif (look_9_0.between?(0x0000, ?)) || look_9_0.between?(?+, 0xFFFF)) \n alt_9 = 1\n\n end\n case alt_9\n when 1\n # at line 149:10: .\n match_any\n\n else\n break # out of loop for decision 9\n end\n end # loop for decision 9\n match(\"*/\")\n\n end\n \n @state.type = type\n @state.channel = channel\n # --> action\n skip \n # <-- action\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 15)\n\n end", "def step\n case\n when bol? && check( /=begin/ )\n start_group( :comment, scan_until( /^=end#{EOL}/ ) )\n when bol? && check( /__END__#{EOL}/ )\n start_group( :comment, scan_until( /\\Z/ ) )\n else\n case\n when check( /def\\s+/ )\n start_group :keyword, scan( /def\\s+/ )\n start_group :method, scan_until( /(?=[;(\\s]|#{EOL})/ )\n when check( /class\\s+/ )\n start_group :keyword, scan( /class\\s+/ )\n start_group :class, scan_until( /(?=[;\\s<]|#{EOL})/ )\n when check( /module\\s+/ )\n start_group :keyword, scan( /module\\s+/ )\n start_group :module, scan_until( /(?=[;\\s]|#{EOL})/ )\n when check( /::/ )\n start_group :punct, scan(/::/)\n when check( /:\"/ )\n start_group :symbol, scan(/:/)\n scan_delimited_region :symbol, :symbol, \"\", true\n @allow_operator = true\n when check( /:'/ )\n start_group :symbol, scan(/:/)\n scan_delimited_region :symbol, :symbol, \"\", false\n @allow_operator = true\n when scan( /:[_a-zA-Z@$][$@\\w]*[=!?]?/ )\n start_group :symbol, matched\n @allow_operator = true\n when scan( /\\?(\\\\[^\\n\\r]|[^\\\\\\n\\r\\s])/ )\n start_group :char, matched\n @allow_operator = true\n when check( /(__FILE__|__LINE__|true|false|nil|self)[?!]?/ )\n if @selector || matched[-1] == ?? || matched[-1] == ?!\n start_group :ident,\n scan(/(__FILE__|__LINE__|true|false|nil|self)[?!]?/)\n else\n start_group :constant,\n scan(/(__FILE__|__LINE__|true|false|nil|self)/)\n end\n @selector = false\n @allow_operator = true\n when scan(/0([bB][01]+|[oO][0-7]+|[dD][0-9]+|[xX][0-9a-fA-F]+)/)\n start_group :number, matched\n @allow_operator = true\n else\n case peek(2)\n when \"%r\"\n scan_delimited_region :punct, :regex, scan( /../ ), true\n @allow_operator = true\n when \"%w\", \"%q\"\n scan_delimited_region :punct, :string, scan( /../ ), false\n @allow_operator = true\n when \"%s\"\n scan_delimited_region :punct, :symbol, scan( /../ ), false\n @allow_operator = true\n when \"%W\", \"%Q\", \"%x\"\n scan_delimited_region :punct, :string, scan( /../ ), true\n @allow_operator = true\n when /%[^\\sa-zA-Z0-9]/\n scan_delimited_region :punct, :string, scan( /./ ), true\n @allow_operator = true\n when \"<<\"\n saw_word = ( chunk[-1,1] =~ /[\\w!?]/ )\n start_group :punct, scan( /<</ )\n if saw_word\n @allow_operator = false\n return\n end\n\n float_right = scan( /-/ )\n append \"-\" if float_right\n if ( type = scan( /['\"]/ ) )\n append type\n delim = scan_until( /(?=#{type})/ )\n if delim.nil?\n append scan_until( /\\Z/ )\n return\n end\n else\n delim = scan( /\\w+/ ) or return\n end\n start_group :constant, delim\n start_group :punct, scan( /#{type}/ ) if type\n @heredocs << [ float_right, type, delim ]\n @allow_operator = true\n else\n case peek(1)\n when /[\\n\\r]/\n unless @heredocs.empty?\n scan_heredoc(*@heredocs.shift)\n else\n start_group :normal, scan( /\\s+/ )\n end\n @allow_operator = false\n when /\\s/\n start_group :normal, scan( /\\s+/ )\n when \"#\"\n start_group :comment, scan( /#[^\\n\\r]*/ )\n when /[A-Z]/\n start_group @selector ? :ident : :constant, scan( /\\w+/ )\n @allow_operator = true\n when /[a-z_]/\n word = scan( /\\w+[?!]?/ )\n if !@selector && KEYWORDS.include?( word )\n start_group :keyword, word\n @allow_operator = false\n elsif\n start_group :ident, word\n @allow_operator = true\n end\n @selector = false\n when /\\d/\n start_group :number,\n scan( /[\\d_]+(\\.[\\d_]+)?([eE][\\d_]+)?/ )\n @allow_operator = true\n when '\"'\n scan_delimited_region :punct, :string, \"\", true\n @allow_operator = true\n when '/'\n if @allow_operator\n start_group :punct, scan(%r{/})\n @allow_operator = false\n else\n scan_delimited_region :punct, :regex, \"\", true\n @allow_operator = true\n end\n when \"'\"\n scan_delimited_region :punct, :string, \"\", false\n @allow_operator = true\n when \".\"\n dots = scan( /\\.{1,3}/ )\n start_group :punct, dots\n @selector = ( dots.length == 1 )\n when /[@]/\n start_group :attribute, scan( /@{1,2}\\w*/ )\n @allow_operator = true\n when /[$]/\n start_group :global, scan(/\\$/)\n start_group :global, scan( /\\w+|./ ) if check(/./)\n @allow_operator = true\n when /[-!?*\\/+=<>(\\[\\{}:;,&|%]/\n start_group :punct, scan(/./)\n @allow_operator = false\n when /[)\\]]/\n start_group :punct, scan(/./)\n @allow_operator = true\n else\n # all else just falls through this, to prevent\n # infinite loops...\n append getch\n end\n end\n end\n end\n end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def test_method\n \"Here is the sample input\"\n end", "def define_python_methods\r\n @p.Execute(\"\r\ndef foo(x):\r\n return x + x\r\n\r\ndef bar(x):\r\n return x * x\r\n\"\r\n )\r\nend", "def token!\n # at line 1:8: ( T__30 | T__31 | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | T__38 | T__39 | T__40 | T__41 | T__42 | T__43 | T__44 | T__45 | T__46 | T__47 | T__48 | T__49 | T__50 | T__51 | T__52 | T__53 | T__54 | INTEGER | FLOAT | BOOLEAN | STRING | CHAR | INIT | OPEN | CLOSE | TYPE_INT | TYPE_FLOAT | TYPE_STRING | TYPE_BOOL | TYPE_VOID | ENTITY | COMPONENT | SYSTEM | ENUM | IF | ELSE | RETURN | WHILE | IDENT | WS | COMMENT | MULTILINE_COMMENT | NL )\n alt_9 = 51\n alt_9 = @dfa9.predict( @input )\n case alt_9\n when 1\n # at line 1:10: T__30\n t__30!\n\n\n when 2\n # at line 1:16: T__31\n t__31!\n\n\n when 3\n # at line 1:22: T__32\n t__32!\n\n\n when 4\n # at line 1:28: T__33\n t__33!\n\n\n when 5\n # at line 1:34: T__34\n t__34!\n\n\n when 6\n # at line 1:40: T__35\n t__35!\n\n\n when 7\n # at line 1:46: T__36\n t__36!\n\n\n when 8\n # at line 1:52: T__37\n t__37!\n\n\n when 9\n # at line 1:58: T__38\n t__38!\n\n\n when 10\n # at line 1:64: T__39\n t__39!\n\n\n when 11\n # at line 1:70: T__40\n t__40!\n\n\n when 12\n # at line 1:76: T__41\n t__41!\n\n\n when 13\n # at line 1:82: T__42\n t__42!\n\n\n when 14\n # at line 1:88: T__43\n t__43!\n\n\n when 15\n # at line 1:94: T__44\n t__44!\n\n\n when 16\n # at line 1:100: T__45\n t__45!\n\n\n when 17\n # at line 1:106: T__46\n t__46!\n\n\n when 18\n # at line 1:112: T__47\n t__47!\n\n\n when 19\n # at line 1:118: T__48\n t__48!\n\n\n when 20\n # at line 1:124: T__49\n t__49!\n\n\n when 21\n # at line 1:130: T__50\n t__50!\n\n\n when 22\n # at line 1:136: T__51\n t__51!\n\n\n when 23\n # at line 1:142: T__52\n t__52!\n\n\n when 24\n # at line 1:148: T__53\n t__53!\n\n\n when 25\n # at line 1:154: T__54\n t__54!\n\n\n when 26\n # at line 1:160: INTEGER\n integer!\n\n\n when 27\n # at line 1:168: FLOAT\n float!\n\n\n when 28\n # at line 1:174: BOOLEAN\n boolean!\n\n\n when 29\n # at line 1:182: STRING\n string!\n\n\n when 30\n # at line 1:189: CHAR\n char!\n\n\n when 31\n # at line 1:194: INIT\n init!\n\n\n when 32\n # at line 1:199: OPEN\n open!\n\n\n when 33\n # at line 1:204: CLOSE\n close!\n\n\n when 34\n # at line 1:210: TYPE_INT\n type_int!\n\n\n when 35\n # at line 1:219: TYPE_FLOAT\n type_float!\n\n\n when 36\n # at line 1:230: TYPE_STRING\n type_string!\n\n\n when 37\n # at line 1:242: TYPE_BOOL\n type_bool!\n\n\n when 38\n # at line 1:252: TYPE_VOID\n type_void!\n\n\n when 39\n # at line 1:262: ENTITY\n entity!\n\n\n when 40\n # at line 1:269: COMPONENT\n component!\n\n\n when 41\n # at line 1:279: SYSTEM\n system!\n\n\n when 42\n # at line 1:286: ENUM\n enum!\n\n\n when 43\n # at line 1:291: IF\n if!\n\n\n when 44\n # at line 1:294: ELSE\n else!\n\n\n when 45\n # at line 1:299: RETURN\n return!\n\n\n when 46\n # at line 1:306: WHILE\n while!\n\n\n when 47\n # at line 1:312: IDENT\n ident!\n\n\n when 48\n # at line 1:318: WS\n ws!\n\n\n when 49\n # at line 1:321: COMMENT\n comment!\n\n\n when 50\n # at line 1:329: MULTILINE_COMMENT\n multiline_comment!\n\n\n when 51\n # at line 1:347: NL\n nl!\n\n\n end\n end", "def comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 13 )\n\n type = COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 63:5: '#' (~ ( '\\\\r' | '\\\\n' ) )*\n match( 0x23 )\n # at line 63:9: (~ ( '\\\\r' | '\\\\n' ) )*\n while true # decision 22\n alt_22 = 2\n look_22_0 = @input.peek( 1 )\n\n if ( look_22_0.between?( 0x0, 0x9 ) || look_22_0.between?( 0xb, 0xc ) || look_22_0.between?( 0xe, 0xffff ) )\n alt_22 = 1\n\n end\n case alt_22\n when 1\n # at line 63:11: ~ ( '\\\\r' | '\\\\n' )\n if @input.peek( 1 ).between?( 0x0, 0x9 ) || @input.peek( 1 ).between?( 0xb, 0xc ) || @input.peek( 1 ).between?( 0xe, 0xff )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n\n else\n break # out of loop for decision 22\n end\n end # loop for decision 22\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__, 13 )\n\n end", "def token!\n # at line 1:8: ( PROGRAM | PRINT | VAR | CTE | IF | ELSE | AND | OR | GT | GTE | LT | LTE | INTEGER | FLOAT | STRING | BOOLEAN | VOID | FUNCTION | FIN | RETURN | INPUT | WHILE | CLASS | WORD | NUM_I | NUM_F | BOOL | ID | LPAREN | RPAREN | LKEY | RKEY | EQUAL | DIF | SIMILAR | COMMA | DDOT | SEMI | PLUS | SUB | DIV | MUL | INHERITS | DOT | WHITESPACE )\n alt_10 = 45\n alt_10 = @dfa10.predict( @input )\n case alt_10\n when 1\n # at line 1:10: PROGRAM\n program!\n\n\n when 2\n # at line 1:18: PRINT\n print!\n\n\n when 3\n # at line 1:24: VAR\n var!\n\n\n when 4\n # at line 1:28: CTE\n cte!\n\n\n when 5\n # at line 1:32: IF\n if!\n\n\n when 6\n # at line 1:35: ELSE\n else!\n\n\n when 7\n # at line 1:40: AND\n and!\n\n\n when 8\n # at line 1:44: OR\n or!\n\n\n when 9\n # at line 1:47: GT\n gt!\n\n\n when 10\n # at line 1:50: GTE\n gte!\n\n\n when 11\n # at line 1:54: LT\n lt!\n\n\n when 12\n # at line 1:57: LTE\n lte!\n\n\n when 13\n # at line 1:61: INTEGER\n integer!\n\n\n when 14\n # at line 1:69: FLOAT\n float!\n\n\n when 15\n # at line 1:75: STRING\n string!\n\n\n when 16\n # at line 1:82: BOOLEAN\n boolean!\n\n\n when 17\n # at line 1:90: VOID\n void!\n\n\n when 18\n # at line 1:95: FUNCTION\n function!\n\n\n when 19\n # at line 1:104: FIN\n fin!\n\n\n when 20\n # at line 1:108: RETURN\n return!\n\n\n when 21\n # at line 1:115: INPUT\n input!\n\n\n when 22\n # at line 1:121: WHILE\n while!\n\n\n when 23\n # at line 1:127: CLASS\n class!\n\n\n when 24\n # at line 1:133: WORD\n word!\n\n\n when 25\n # at line 1:138: NUM_I\n num_i!\n\n\n when 26\n # at line 1:144: NUM_F\n num_f!\n\n\n when 27\n # at line 1:150: BOOL\n bool!\n\n\n when 28\n # at line 1:155: ID\n id!\n\n\n when 29\n # at line 1:158: LPAREN\n lparen!\n\n\n when 30\n # at line 1:165: RPAREN\n rparen!\n\n\n when 31\n # at line 1:172: LKEY\n lkey!\n\n\n when 32\n # at line 1:177: RKEY\n rkey!\n\n\n when 33\n # at line 1:182: EQUAL\n equal!\n\n\n when 34\n # at line 1:188: DIF\n dif!\n\n\n when 35\n # at line 1:192: SIMILAR\n similar!\n\n\n when 36\n # at line 1:200: COMMA\n comma!\n\n\n when 37\n # at line 1:206: DDOT\n ddot!\n\n\n when 38\n # at line 1:211: SEMI\n semi!\n\n\n when 39\n # at line 1:216: PLUS\n plus!\n\n\n when 40\n # at line 1:221: SUB\n sub!\n\n\n when 41\n # at line 1:225: DIV\n div!\n\n\n when 42\n # at line 1:229: MUL\n mul!\n\n\n when 43\n # at line 1:233: INHERITS\n inherits!\n\n\n when 44\n # at line 1:242: DOT\n dot!\n\n\n when 45\n # at line 1:246: WHITESPACE\n whitespace!\n\n\n end\n end", "def method_source(mnemonic, flags, sample, prefix)\n\t\"\"\"// Mnemonic: #{sample}\n// Sets Flags: #{flags}\nfunc (p *GBProcessor) #{prefix}#{mnemonic}(opcode byte, params ...byte) {\n\n}\"\"\"\nend", "def comment_string\n @comment_syntax.string_for_method_entity self\n end", "def comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 49 )\n\n\n\n type = COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 228:11: '//' ( . )* ( '\\\\n' | '\\\\r' )\n match( \"//\" )\n\n # at line 228:16: ( . )*\n while true # decision 6\n alt_6 = 2\n look_6_0 = @input.peek( 1 )\n\n if ( look_6_0 == 0xa || look_6_0 == 0xd )\n alt_6 = 2\n elsif ( look_6_0.between?( 0x0, 0x9 ) || look_6_0.between?( 0xb, 0xc ) || look_6_0.between?( 0xe, 0xffff ) )\n alt_6 = 1\n\n end\n case alt_6\n when 1\n # at line 228:16: .\n match_any\n\n else\n break # out of loop for decision 6\n end\n end # loop for decision 6\n\n if @input.peek(1) == 0xa || @input.peek(1) == 0xd\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n\n end\n\n\n\n # --> action\n channel = HIDDEN;\n # <-- action\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 49 )\n\n\n end", "def firstMethod()\n p \"hey this is first method ok\"\n p \"here i show how can create method in ruby\"\n p \" know time end \"\nend", "def docufy(src,i)\n m = /RM_[A-z0-9]+/.match(src[i])\n name = m[0]\n name = name.sub(\"RM_\",\"RedisModule_\")\n proto = src[i].sub(\"{\",\"\").strip+\";\\n\"\n proto = proto.sub(\"RM_\",\"RedisModule_\")\n proto = linebreak_proto(proto, \" \");\n # Add a link target with the function name. (We don't trust the exact id of\n # the generated one, which depends on the Markdown implementation.)\n puts \"<span id=\\\"#{name}\\\"></span>\\n\\n\"\n puts \"### `#{name}`\\n\\n\"\n puts \" #{proto}\\n\"\n puts \"**Available since:** #{$since[name] or \"unreleased\"}\\n\\n\"\n comment = \"\"\n while true\n i = i-1\n comment = src[i]+comment\n break if src[i] =~ /\\/\\*/\n end\n comment = markdown(comment)\n puts comment+\"\\n\\n\"\nend", "def hello_world(\"Hello World\", \"o\") \n \nend", "def SomeClass explainMore\n p \"no comment\"\n end", "def hello(name)\n #puts \"Hello #{name}!\"\nend", "def xxxtest_function_prototype_on_more_than_one_line\r\n length = initialize_length(\r\n <<-EOD\r\n func_prototype(\r\n int myCat,\r\n boolean huh\r\n );\r\n EOD\r\n )\r\n assert_equal(nil, length.counts['func_prototype'])\r\n assert_equal(5, length.counts['global'])\r\n end", "def p(string);end", "def comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 35 )\n\n type = COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 350:9: '#' (~ ( '\\\\n' | '\\\\r' ) )*\n match( 0x23 )\n # at line 350:13: (~ ( '\\\\n' | '\\\\r' ) )*\n while true # decision 13\n alt_13 = 2\n look_13_0 = @input.peek( 1 )\n\n if ( look_13_0.between?( 0x0, 0x9 ) || look_13_0.between?( 0xb, 0xc ) || look_13_0.between?( 0xe, 0xffff ) )\n alt_13 = 1\n\n end\n case alt_13\n when 1\n # at line 350:13: ~ ( '\\\\n' | '\\\\r' )\n if @input.peek( 1 ).between?( 0x0, 0x9 ) || @input.peek( 1 ).between?( 0xb, 0xc ) || @input.peek( 1 ).between?( 0xe, 0xff )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n\n else\n break # out of loop for decision 13\n end\n end # loop for decision 13\n # --> action\n channel=HIDDEN;\n # <-- action\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__, 35 )\n\n end", "def line_comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 78 )\n\n\n\n type = LINE_COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 608:8: '#' (~ ( '\\\\n' | '\\\\r' ) )* ( '\\\\r' )? '\\\\n'\n match( 0x23 )\n # at line 608:12: (~ ( '\\\\n' | '\\\\r' ) )*\n while true # decision 25\n alt_25 = 2\n look_25_0 = @input.peek( 1 )\n\n if ( look_25_0.between?( 0x0, 0x9 ) || look_25_0.between?( 0xb, 0xc ) || look_25_0.between?( 0xe, 0xffff ) )\n alt_25 = 1\n\n end\n case alt_25\n when 1\n # at line \n if @input.peek( 1 ).between?( 0x0, 0x9 ) || @input.peek( 1 ).between?( 0xb, 0xc ) || @input.peek( 1 ).between?( 0xe, 0xffff )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n\n end\n\n\n\n else\n break # out of loop for decision 25\n end\n end # loop for decision 25\n\n # at line 608:26: ( '\\\\r' )?\n alt_26 = 2\n look_26_0 = @input.peek( 1 )\n\n if ( look_26_0 == 0xd )\n alt_26 = 1\n end\n case alt_26\n when 1\n # at line 608:26: '\\\\r'\n match( 0xd )\n\n end\n match( 0xa )\n\n # --> action\n channel=HIDDEN;\n # <-- action\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 78 )\n\n\n end", "def test_dsl_5\n #---------------------------\n show Spock + (Lizard + Rock)\n #---------------------------\n assert_equal \\\n \"Rock crushes Lizard (winner Rock)\\n\" \\\n \"Spock vaporizes Rock (winner Spock)\\n\" \\\n \"Result = Spock\\n\", \\\n @out.string\n end", "def as_you_like_it_quote; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def variable_or_method_use(method)\n \t_IDENTIFIER13 = nil\n\n\n\n\n \t name = \"\"\n \t is_method = false\n\n\n # 254:7: ( 'this' '.' )? ( IDENTIFIER ) ( fragment_of_variable_or_method_name[name] )* ( '(' ')' )?\n # 254:7: ( 'this' '.' )?\n alt35 = 2\n # 254:7: ( 'this' '.' )?\n look_ahead35_0 = look_ahead(1)\n\n if look_ahead35_0 == :T58 \n alt35 = 1\n end\n case alt35\n when 1\n # 254:9: 'this' '.'\n match(:T58)\n match(:DOT)\n name << \"this.\" \n end\n # 255:9: IDENTIFIER\n _IDENTIFIER13 = @input.look_ahead(1)\n match(:IDENTIFIER)\n name << _IDENTIFIER13.text \n # 256:7: ( fragment_of_variable_or_method_name[name] )*\n while true\n alt36 = 2\n # ()* loopback of 256:7: ( fragment_of_variable_or_method_name[name] )*\n look_ahead36_0 = look_ahead(1)\n if look_ahead36_0 == :DOT \n alt36 = 1\n end\n case alt36\n when 1\n # 256:7: fragment_of_variable_or_method_name[name]\n fragment_of_variable_or_method_name(name)\n\n else\n break\n end\n end\n # 257:7: ( '(' ')' )?\n alt37 = 2\n # 257:7: ( '(' ')' )?\n look_ahead37_0 = look_ahead(1)\n\n if look_ahead37_0 == :LEFT_PARENTESIS \n # 257:7: ( '(' ')' )?\n look_ahead37_1 = look_ahead(2)\n\n if look_ahead37_1 == :RIGHT_PARENTESIS \n alt37 = 1\n end\n end\n case alt37\n when 1\n # 257:9: '(' ')'\n match(:LEFT_PARENTESIS)\n match(:RIGHT_PARENTESIS)\n is_method = true\n end\n\n if is_method\n method.add_method_call(name, _IDENTIFIER13.line)\n\n else\n method.add_use_of(name, _IDENTIFIER13.line)\n end\n \n\n\n\n end", "def code_point; end", "def auto_analyze=(_arg0); end", "def p15\n\t\nend", "def hey_hey; end", "def token!\n # at line 1:8: ( T__48 | T__49 | T__50 | T__51 | T__52 | CATEGORY_KEY | LINK_KEY | X_OCCI_ATTRIBUTE_KEY | X_OCCI_LOCATION_KEY | ACTION | ACTIONS | AMPERSAND | AT | ATTRIBUTES | BACKSLASH | CATEGORY | CLASS | COLON | DASH | DOT | EQUALS | GT | HASH | KIND | LINK | LOCATION | LT | MIXIN | PERCENT | PLUS | QUESTION | QUOTE | REL | SCHEME | SELF | SEMICOLON | SLASH | SQUOTE | TERM | TILDE | TITLE | UNDERSCORE | LBRACKET | RBRACKET | LOALPHA | UPALPHA | DIGIT | WS | ESC )\n alt_5 = 49\n alt_5 = @dfa5.predict( @input )\n case alt_5\n when 1\n # at line 1:10: T__48\n t__48!\n\n when 2\n # at line 1:16: T__49\n t__49!\n\n when 3\n # at line 1:22: T__50\n t__50!\n\n when 4\n # at line 1:28: T__51\n t__51!\n\n when 5\n # at line 1:34: T__52\n t__52!\n\n when 6\n # at line 1:40: CATEGORY_KEY\n category_key!\n\n when 7\n # at line 1:53: LINK_KEY\n link_key!\n\n when 8\n # at line 1:62: X_OCCI_ATTRIBUTE_KEY\n x_occi_attribute_key!\n\n when 9\n # at line 1:83: X_OCCI_LOCATION_KEY\n x_occi_location_key!\n\n when 10\n # at line 1:103: ACTION\n action!\n\n when 11\n # at line 1:110: ACTIONS\n actions!\n\n when 12\n # at line 1:118: AMPERSAND\n ampersand!\n\n when 13\n # at line 1:128: AT\n at!\n\n when 14\n # at line 1:131: ATTRIBUTES\n attributes!\n\n when 15\n # at line 1:142: BACKSLASH\n backslash!\n\n when 16\n # at line 1:152: CATEGORY\n category!\n\n when 17\n # at line 1:161: CLASS\n class!\n\n when 18\n # at line 1:167: COLON\n colon!\n\n when 19\n # at line 1:173: DASH\n dash!\n\n when 20\n # at line 1:178: DOT\n dot!\n\n when 21\n # at line 1:182: EQUALS\n equals!\n\n when 22\n # at line 1:189: GT\n gt!\n\n when 23\n # at line 1:192: HASH\n hash!\n\n when 24\n # at line 1:197: KIND\n kind!\n\n when 25\n # at line 1:202: LINK\n link!\n\n when 26\n # at line 1:207: LOCATION\n location!\n\n when 27\n # at line 1:216: LT\n lt!\n\n when 28\n # at line 1:219: MIXIN\n mixin!\n\n when 29\n # at line 1:225: PERCENT\n percent!\n\n when 30\n # at line 1:233: PLUS\n plus!\n\n when 31\n # at line 1:238: QUESTION\n question!\n\n when 32\n # at line 1:247: QUOTE\n quote!\n\n when 33\n # at line 1:253: REL\n rel!\n\n when 34\n # at line 1:257: SCHEME\n scheme!\n\n when 35\n # at line 1:264: SELF\n self!\n\n when 36\n # at line 1:269: SEMICOLON\n semicolon!\n\n when 37\n # at line 1:279: SLASH\n slash!\n\n when 38\n # at line 1:285: SQUOTE\n squote!\n\n when 39\n # at line 1:292: TERM\n term!\n\n when 40\n # at line 1:297: TILDE\n tilde!\n\n when 41\n # at line 1:303: TITLE\n title!\n\n when 42\n # at line 1:309: UNDERSCORE\n underscore!\n\n when 43\n # at line 1:320: LBRACKET\n lbracket!\n\n when 44\n # at line 1:329: RBRACKET\n rbracket!\n\n when 45\n # at line 1:338: LOALPHA\n loalpha!\n\n when 46\n # at line 1:346: UPALPHA\n upalpha!\n\n when 47\n # at line 1:354: DIGIT\n digit!\n\n when 48\n # at line 1:360: WS\n ws!\n\n when 49\n # at line 1:363: ESC\n esc!\n\n end\n end", "def sl_comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 39)\n\n type = SL_COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 470:5: '//' ( ' $ANTLR ' SRC | (~ ( '\\\\r' | '\\\\n' ) )* ) ( '\\\\r' )? '\\\\n'\n match(\"//\")\n # at line 471:5: ( ' $ANTLR ' SRC | (~ ( '\\\\r' | '\\\\n' ) )* )\n alt_2 = 2\n alt_2 = @dfa2.predict(@input)\n case alt_2\n when 1\n # at line 471:7: ' $ANTLR ' SRC\n match(\" $ANTLR \")\n src!\n\n when 2\n # at line 472:6: (~ ( '\\\\r' | '\\\\n' ) )*\n # at line 472:6: (~ ( '\\\\r' | '\\\\n' ) )*\n loop do #loop 1\n alt_1 = 2\n look_1_0 = @input.peek(1)\n\n if (look_1_0.between?(0x0000, ?\\t) || look_1_0.between?(0x000B, ?\\f) || look_1_0.between?(0x000E, 0xFFFF)) \n alt_1 = 1\n\n end\n case alt_1\n when 1\n # at line 472:6: ~ ( '\\\\r' | '\\\\n' )\n if @input.peek(1).between?(0x0000, ?\\t) || @input.peek(1).between?(0x000B, ?\\f) || @input.peek(1).between?(0x000E, 0x00FF)\n @input.consume\n else\n mse = MismatchedSet(nil)\n recover(mse)\n raise mse\n end\n\n\n\n else\n break #loop 1\n end\n end\n\n end\n # at line 474:3: ( '\\\\r' )?\n alt_3 = 2\n look_3_0 = @input.peek(1)\n\n if (look_3_0 == ?\\r) \n alt_3 = 1\n end\n case alt_3\n when 1\n # at line 474:3: '\\\\r'\n match(?\\r)\n\n end\n match(?\\n)\n # --> action\n channel=HIDDEN;\n # <-- action\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__, 39)\n\n end", "def buzzword; end", "def buzzword; end", "def test_additon_w_funcall\n# assert_eq \"helloworld\\n\", interpret(\"'hello' + echo('world')\")\n end", "def extract_magic_comments(processed_source); end", "def preprocess\n lineno = 0\n shouldWrite = false\n inFunction = false\n printer = File.open(RB_FILE,'w')\n scanner = File.open(TEX_FILE,'r')\n if printer && scanner\n printer.puts RB_REQUIRE\n scanner.each_line do |line|\n lineno = lineno + 1\n if (line.include? TEX_ENV_01_E) && !determineTexCommented(line, TEX_ENV_01_E)\n puts \"Encountered #{TEX_ENV_01_E} on line #{lineno}\"\n shouldWrite = false\n end\n if shouldWrite\n stripped = line.strip\n if (stripped.include? TEX_MOD) && !determineRubyCommented(stripped, TEX_MOD) && !inFunction\n printer.print appendLineNumberToTexPrintCall(stripped, lineno)\n elsif (stripped.include? RB_CLASS_CREATE) && !determineRubyCommented(stripped, RB_CLASS_CREATE) && !inFunction\n printer.print appendLineNumberToInitialization(stripped, lineno)\n elsif (stripped.include? RB_METHOD_S) && !determineRubyCommented(stripped, RB_METHOD_S) && !inFunction\n puts \"Processing function definition: found line containing #{stripped}\"\n inFunction = true\n extracted = extractFunctionMeta stripped\n $fcnref.store(extracted[0], extracted[1])\n $defstack.push 1\n if (stripped.include? '(') && (stripped.include? ')')\n puts \"Injection into formatted def as \\( \\)! Boo!\"\n else\n puts \"Injection into formatted def as _,_! This is preferrable.\"\n end\n printer.print appendLineNumberArgToFunctionDefinition stripped\n elsif inFunction\n puts \"Parsing #{stripped} inside function...\"\n printer.print stripped\n if (line.include? TEX_MOD) && !determineRubyCommented(line, \"Tex\")\n printer.print \", #{RBTEX_INSERT_LINE}\"\n end\n RB_KEYWORD_END.each do |kwd|\n if line.include? kwd\n puts \"Encountered '#{kwd}'; pushing onto stack...\"\n $defstack.push 1\n break\n end\n end\n if line.include? 'end'\n puts \"Encountered 'end'; popping off of stack...\"\n $defstack.pop\n end\n inFunction = $defstack.any?\n else\n print \"STRIPPED: #{stripped}\\t\"\n deffed = false\n printer.print stripped\n $fcnref.each do |fcn, args|\n if stripped.include? fcn\n if (line.include? '(') && (line.include? ')')\n\n else\n printer.print (args != 0) ? (\", #{lineno}\") : (\" #{lineno}\")\n break\n end\n end\n end\n end\n printer.puts \"\"\n end\n if (line.include? TEX_ENV_01_S) && !determineTexCommented(line, TEX_ENV_01_S)\n puts \"Encountered #{TEX_ENV_01_S} on line #{lineno}\"\n $rbenvs = $rbenvs + 1\n shouldWrite = true\n end\n end\n end\n printer.close\n scanner.close\n return 0\nend", "def token!\n # at line 1:8: ( RET | SCOPE | FRAGMENT | TREE_BEGIN | ROOT | BANG | RANGE | REWRITE | AT | LABEL_ASSIGN | LIST_LABEL_ASSIGN | T__67 | T__68 | T__69 | T__70 | T__71 | T__72 | T__73 | T__74 | T__75 | T__76 | T__77 | T__78 | T__79 | T__80 | T__81 | T__82 | T__83 | T__84 | T__85 | T__86 | T__87 | T__88 | T__89 | T__90 | T__91 | T__92 | T__93 | SL_COMMENT | ML_COMMENT | CHAR_LITERAL | STRING_LITERAL | DOUBLE_QUOTE_STRING_LITERAL | DOUBLE_ANGLE_STRING_LITERAL | INT | ARG_ACTION | ACTION | TOKEN_REF | RULE_REF | OPTIONS | TOKENS | WS )\n alt_21 = 52\n alt_21 = @dfa21.predict(@input)\n case alt_21\n when 1\n # at line 1:10: RET\n ret!\n\n when 2\n # at line 1:14: SCOPE\n scope!\n\n when 3\n # at line 1:20: FRAGMENT\n fragment!\n\n when 4\n # at line 1:29: TREE_BEGIN\n tree_begin!\n\n when 5\n # at line 1:40: ROOT\n root!\n\n when 6\n # at line 1:45: BANG\n bang!\n\n when 7\n # at line 1:50: RANGE\n range!\n\n when 8\n # at line 1:56: REWRITE\n rewrite!\n\n when 9\n # at line 1:64: AT\n at!\n\n when 10\n # at line 1:67: LABEL_ASSIGN\n label_assign!\n\n when 11\n # at line 1:80: LIST_LABEL_ASSIGN\n list_label_assign!\n\n when 12\n # at line 1:98: T__67\n t__67!\n\n when 13\n # at line 1:104: T__68\n t__68!\n\n when 14\n # at line 1:110: T__69\n t__69!\n\n when 15\n # at line 1:116: T__70\n t__70!\n\n when 16\n # at line 1:122: T__71\n t__71!\n\n when 17\n # at line 1:128: T__72\n t__72!\n\n when 18\n # at line 1:134: T__73\n t__73!\n\n when 19\n # at line 1:140: T__74\n t__74!\n\n when 20\n # at line 1:146: T__75\n t__75!\n\n when 21\n # at line 1:152: T__76\n t__76!\n\n when 22\n # at line 1:158: T__77\n t__77!\n\n when 23\n # at line 1:164: T__78\n t__78!\n\n when 24\n # at line 1:170: T__79\n t__79!\n\n when 25\n # at line 1:176: T__80\n t__80!\n\n when 26\n # at line 1:182: T__81\n t__81!\n\n when 27\n # at line 1:188: T__82\n t__82!\n\n when 28\n # at line 1:194: T__83\n t__83!\n\n when 29\n # at line 1:200: T__84\n t__84!\n\n when 30\n # at line 1:206: T__85\n t__85!\n\n when 31\n # at line 1:212: T__86\n t__86!\n\n when 32\n # at line 1:218: T__87\n t__87!\n\n when 33\n # at line 1:224: T__88\n t__88!\n\n when 34\n # at line 1:230: T__89\n t__89!\n\n when 35\n # at line 1:236: T__90\n t__90!\n\n when 36\n # at line 1:242: T__91\n t__91!\n\n when 37\n # at line 1:248: T__92\n t__92!\n\n when 38\n # at line 1:254: T__93\n t__93!\n\n when 39\n # at line 1:260: SL_COMMENT\n sl_comment!\n\n when 40\n # at line 1:271: ML_COMMENT\n ml_comment!\n\n when 41\n # at line 1:282: CHAR_LITERAL\n char_literal!\n\n when 42\n # at line 1:295: STRING_LITERAL\n string_literal!\n\n when 43\n # at line 1:310: DOUBLE_QUOTE_STRING_LITERAL\n double_quote_string_literal!\n\n when 44\n # at line 1:338: DOUBLE_ANGLE_STRING_LITERAL\n double_angle_string_literal!\n\n when 45\n # at line 1:366: INT\n int!\n\n when 46\n # at line 1:370: ARG_ACTION\n arg_action!\n\n when 47\n # at line 1:381: ACTION\n action!\n\n when 48\n # at line 1:388: TOKEN_REF\n token_ref!\n\n when 49\n # at line 1:398: RULE_REF\n rule_ref!\n\n when 50\n # at line 1:407: OPTIONS\n options!\n\n when 51\n # at line 1:415: TOKENS\n tokens!\n\n when 52\n # at line 1:422: WS\n ws!\n\n end\n end", "def lex_en_line_comment=(_arg0); end", "def lex_en_line_comment=(_arg0); end", "def lex_en_line_comment=(_arg0); end", "def codepoints()\n #This is a stub, used for indexing\n end", "def caller\n %x{\n function getErrorObject(){\n try { throw Error('') } catch(err) { return err; }\n }\n\n\n var err = getErrorObject();\n }\n stack = `err.stack`\n caller_lines = stack.split(\"\\n\")[4..-1]\n caller_lines.reject! { |l| l.strip.empty? }\n\n result_formatter = lambda do |filename, line, method=nil|\n \"#{filename}:#{line} in `(#{method ? method : 'unknown method'})'\"\n end\n\n caller_lines.map do |raw_line|\n if match = /\\s*at (.*) \\((\\S+):(\\d+):\\d+/.match(raw_line)\n method, filename, line = match.captures\n result_formatter[filename, line, method]\n elsif match = /\\s*at (\\S+):(\\d+):\\d+/.match(raw_line)\n filename, line = match.captures\n result_formatter[filename, line]\n # catch phantom/no 2nd line/col #\n elsif match = /\\s*at (.*) \\((\\S+):(\\d+)/.match(raw_line)\n method, filename, line = match.captures\n result_formatter[filename, line, method]\n elsif match = /\\s*at (.*):(\\d+)/.match(raw_line)\n filename, line = match.captures\n result_formatter[filename, line]\n # Firefox - Opal.modules[\"rspec/core/metadata\"]/</</</</def.$populate@http://192.168.59.103:9292/assets/rspec/core/metadata.self.js?body=1:102:13\n elsif match = /(.*?)@(\\S+):(\\d+):\\d+/.match(raw_line)\n method, filename, line = match.captures\n result_formatter[filename, line, method]\n # webkit - http://192.168.59.103:9292/assets/opal/rspec/sprockets_runner.js:45117:314\n elsif match = /(\\S+):(\\d+):\\d+/.match(raw_line)\n filename, line = match.captures\n result_formatter[filename, line]\n else\n \"#{filename}:-1 in `(can't parse this stack trace)`\"\n end\n end\n end", "def ruby_code(obj); end", "def method_definition(class_def)\n \t_IDENTIFIER7 = nil\n\n\n\n\n \t method = MethodDefinition.new\n\n\n # 123:5: modifier[method] ( type[method] )? IDENTIFIER parameters[method] ( method_body[method] | ';' )\n modifier(method)\n\n # 123:22: ( type[method] )?\n alt16 = 2\n # 123:22: ( type[method] )?\n look_ahead16_0 = look_ahead(1)\n\n if look_ahead16_0 == :IDENTIFIER \n # 123:22: ( type[method] )?\n look_ahead16_1 = look_ahead(2)\n\n if look_ahead16_1 == :IDENTIFIER || look_ahead16_1 == :LEFT_ANGULAR_BRACKET || (TOKENS[look_ahead16_1] >= 34 && TOKENS[look_ahead16_1] <= 35) \n alt16 = 1\n end\n end\n case alt16\n when 1\n # 123:23: type[method]\n type(method)\n\n end\n _IDENTIFIER7 = @input.look_ahead(1)\n match(:IDENTIFIER)\n parameters(method)\n\n # 123:68: ( method_body[method] | ';' )\n alt17 = 2\n # 123:68: ( method_body[method] | ';' )\n look_ahead17_0 = look_ahead(1)\n if look_ahead17_0 == :LEFT_BRACE \n alt17 = 1\n elsif look_ahead17_0 == :SEMICOLON \n alt17 = 2\n else\n raise \"Expected: 123:68: ( method_body[method] | ';' )\"\n end\n case alt17\n when 1\n # 123:69: method_body[method]\n method_body(method)\n\n when 2\n # 123:89: ';'\n match(:SEMICOLON)\n end\n\n method.name = _IDENTIFIER7.text\n method.line = _IDENTIFIER7.line\n class_def.add_member(method)\n \n\n\n\n end", "def test\n puts \"This is a Method........................................\"\nend", "def rubyify(sentence)\r\n\r\nend", "def do_methods\n @content.scan(%r%rb_define_\n (\n singleton_method |\n method |\n module_function |\n private_method\n )\n \\s*\\(\\s*([\\w\\.]+),\n \\s*\"([^\"]+)\",\n \\s*(?:RUBY_METHOD_FUNC\\(|VALUEFUNC\\(|\\(METHOD\\))?(\\w+)\\)?,\n \\s*(-?\\w+)\\s*\\)\n (?:;\\s*/[*/]\\s+in\\s+(\\w+?\\.(?:cpp|c|y)))?\n %xm) do |type, var_name, meth_name, function, param_count, source_file|\n\n # Ignore top-object and weird struct.c dynamic stuff\n next if var_name == \"ruby_top_self\"\n next if var_name == \"nstr\"\n\n var_name = \"rb_cObject\" if var_name == \"rb_mKernel\"\n handle_method(type, var_name, meth_name, function, param_count,\n source_file)\n end\n\n @content.scan(%r%rb_define_global_function\\s*\\(\n \\s*\"([^\"]+)\",\n \\s*(?:RUBY_METHOD_FUNC\\(|VALUEFUNC\\()?(\\w+)\\)?,\n \\s*(-?\\w+)\\s*\\)\n (?:;\\s*/[*/]\\s+in\\s+(\\w+?\\.[cy]))?\n %xm) do |meth_name, function, param_count, source_file|\n handle_method(\"method\", \"rb_mKernel\", meth_name, function, param_count,\n source_file)\n end\n\n @content.scan(/define_filetest_function\\s*\\(\n \\s*\"([^\"]+)\",\n \\s*(?:RUBY_METHOD_FUNC\\(|VALUEFUNC\\()?(\\w+)\\)?,\n \\s*(-?\\w+)\\s*\\)/xm) do |meth_name, function, param_count|\n\n handle_method(\"method\", \"rb_mFileTest\", meth_name, function, param_count)\n handle_method(\"singleton_method\", \"rb_cFile\", meth_name, function,\n param_count)\n end\n end", "def format_code(code,test)\n <<-EOS\n#!/usr/bin/env ruby\nrequire \\'minitest/autorun\\'\n \n#{code}\n\nclass UserCodeTest < Minitest::Test\n \n def test_assertions \n #{test}\n end\nend\n EOS\n end", "def esc!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 46)\n\n \n # - - - - main rule block - - - -\n # at line 504:7: '\\\\\\\\' ( 'n' | 'r' | 't' | 'b' | 'f' | '\\\"' | '\\\\'' | '\\\\\\\\' | '>' | 'u' XDIGIT XDIGIT XDIGIT XDIGIT | . )\n match(?\\\\)\n # at line 505:3: ( 'n' | 'r' | 't' | 'b' | 'f' | '\\\"' | '\\\\'' | '\\\\\\\\' | '>' | 'u' XDIGIT XDIGIT XDIGIT XDIGIT | . )\n alt_9 = 11\n alt_9 = @dfa9.predict(@input)\n case alt_9\n when 1\n # at line 505:5: 'n'\n match(?n)\n\n when 2\n # at line 506:5: 'r'\n match(?r)\n\n when 3\n # at line 507:5: 't'\n match(?t)\n\n when 4\n # at line 508:5: 'b'\n match(?b)\n\n when 5\n # at line 509:5: 'f'\n match(?f)\n\n when 6\n # at line 510:5: '\\\"'\n match(?\")\n\n when 7\n # at line 511:5: '\\\\''\n match(?\\')\n\n when 8\n # at line 512:5: '\\\\\\\\'\n match(?\\\\)\n\n when 9\n # at line 513:5: '>'\n match(?>)\n\n when 10\n # at line 514:5: 'u' XDIGIT XDIGIT XDIGIT XDIGIT\n match(?u)\n xdigit!\n xdigit!\n xdigit!\n xdigit!\n\n when 11\n # at line 515:5: .\n match_any\n\n end\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 46)\n\n end", "def source_line; end", "def extractFunctionMeta(line)\n res = \"\"\n numret = 0\n if line.include? '('\n mindex = line.index('(')\n sindex = line.index(')')\n res = line[3..(mindex - 1)]\n numret = line[(mindex - 1)..(sindex - 1)].length\n else\n spindex = (line.strip[3..line.length]).strip.index(' ')\n if spindex != nil\n res = line[3..spindex]\n numret = 2\n else\n res = line[3..line.length]\n numret = 0\n end\n end\n return res.strip, numret\nend", "def multiline_arg; end", "def test_ut_diff_result_02\n original_source_code = OriginalSourceCode.new(\n :original_file_id => 10,\n :line_number => 349898,\n :error_line => 4564,\n :line_content => \"123456\"\n )\n assert_equal(10,original_source_code.original_file_id)\n assert_equal(349898,original_source_code.line_number)\n assert_equal(4564,original_source_code.error_line)\n assert_equal(\"123456\",original_source_code.line_content)\n end", "def function_literal\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 70 )\n return_value = FunctionLiteralReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n string_literal333 = nil\n string_literal337 = nil\n variable_name334 = nil\n function_parameters335 = nil\n statement_block336 = nil\n variable_name338 = nil\n function_parameters339 = nil\n statement_block340 = nil\n\n tree_for_string_literal333 = nil\n tree_for_string_literal337 = nil\n\n begin\n # at line 715:3: ( 'function' ( variable_name )? function_parameters statement_block | '->' ( variable_name )? ( function_parameters )? statement_block )\n alt_86 = 2\n look_86_0 = @input.peek( 1 )\n\n if ( look_86_0 == FUNCTION )\n alt_86 = 1\n elsif ( look_86_0 == ARROW )\n alt_86 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 86, 0 )\n end\n case alt_86\n when 1\n root_0 = @adaptor.create_flat_list\n\n\n # at line 715:5: 'function' ( variable_name )? function_parameters statement_block\n string_literal333 = match( FUNCTION, TOKENS_FOLLOWING_FUNCTION_IN_function_literal_5064 )\n if @state.backtracking == 0\n\n tree_for_string_literal333 = @adaptor.create_with_payload( string_literal333 )\n root_0 = @adaptor.become_root( tree_for_string_literal333, root_0 )\n\n end\n # at line 715:17: ( variable_name )?\n alt_83 = 2\n look_83_0 = @input.peek( 1 )\n\n if ( look_83_0 == GET || look_83_0 == SET || look_83_0 == MACRO || look_83_0 == EACH || look_83_0.between?( DEF, OBJECT_DEF ) || look_83_0 == ID || look_83_0.between?( T__148, T__150 ) )\n alt_83 = 1\n end\n case alt_83\n when 1\n # at line 715:17: variable_name\n @state.following.push( TOKENS_FOLLOWING_variable_name_IN_function_literal_5067 )\n variable_name334 = variable_name\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, variable_name334.tree )\n end\n\n end\n @state.following.push( TOKENS_FOLLOWING_function_parameters_IN_function_literal_5070 )\n function_parameters335 = function_parameters\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, function_parameters335.tree )\n end\n @state.following.push( TOKENS_FOLLOWING_statement_block_IN_function_literal_5072 )\n statement_block336 = statement_block\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, statement_block336.tree )\n end\n\n when 2\n root_0 = @adaptor.create_flat_list\n\n\n # at line 716:5: '->' ( variable_name )? ( function_parameters )? statement_block\n string_literal337 = match( ARROW, TOKENS_FOLLOWING_ARROW_IN_function_literal_5078 )\n if @state.backtracking == 0\n\n tree_for_string_literal337 = @adaptor.create_with_payload( string_literal337 )\n root_0 = @adaptor.become_root( tree_for_string_literal337, root_0 )\n\n end\n # at line 716:11: ( variable_name )?\n alt_84 = 2\n look_84_0 = @input.peek( 1 )\n\n if ( look_84_0 == GET || look_84_0 == SET || look_84_0 == MACRO || look_84_0 == EACH || look_84_0.between?( DEF, OBJECT_DEF ) || look_84_0 == ID || look_84_0.between?( T__148, T__150 ) )\n alt_84 = 1\n end\n case alt_84\n when 1\n # at line 716:11: variable_name\n @state.following.push( TOKENS_FOLLOWING_variable_name_IN_function_literal_5081 )\n variable_name338 = variable_name\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, variable_name338.tree )\n end\n\n end\n # at line 716:26: ( function_parameters )?\n alt_85 = 2\n look_85_0 = @input.peek( 1 )\n\n if ( look_85_0 == LPAREN )\n alt_85 = 1\n end\n case alt_85\n when 1\n # at line 716:26: function_parameters\n @state.following.push( TOKENS_FOLLOWING_function_parameters_IN_function_literal_5084 )\n function_parameters339 = function_parameters\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, function_parameters339.tree )\n end\n\n end\n @state.following.push( TOKENS_FOLLOWING_statement_block_IN_function_literal_5087 )\n statement_block340 = statement_block\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, statement_block340.tree )\n end\n\n end# - - - - - - - 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__, 70 )\n\n end\n \n return return_value\n end", "def fix_syntax_errors!\n # 1.34\n # patch_file! \"common/on_actions/00_on_actions.txt\" do |content|\n # content.gsub(/(effect = )\"(.*?)\"/m){ $1 + \"{\" + $2 + \"}\" }\n # end\n end", "def test_dsl_4\n #-------------------------\n show Spock + Lizard + Rock\n #-------------------------\n assert_equal \\\n \"Lizard poisons Spock (winner Lizard)\\n\" \\\n \"Rock crushes Lizard (winner Rock)\\n\" \\\n \"Result = Rock\\n\", \\\n @out.string\n end", "def explain\n \n end", "def process_defn(exp)\n raise if @result_name\n method_name = exp.shift || raise\n exp = exp.shift || raise\n\n method_body = want_result do\n case exp.first\n when :ivar\n process(s(:block, exp))\n when :attrset\n process(s(:block, s(:args, :_), s(:iasgn, exp[1], s(:lvar, :_))))\n when :scope, :block, :fbody\n process(exp)\n else\n raise\n end\n end\n\n str = \"\"\n\n if @argument_variables.empty?\n str << \"function(){\"\n else\n args_str = ([block_name()] + @arguments_no_splat).join(\",\")\n str << \"function(#{args_str}){\"\n end\n\n raise if @local_variables.include?(@model.encode_self)\n raise if @argument_variables.include?(@model.encode_self)\n\n #\n # Add \"self\" to the local variables\n #\n @local_variables.add(@model.encode_self)\n @local_variables_need_no_initialization.add(@model.encode_self)\n\n #\n # declare local variables (except arguments)\n #\n to_declare = (@local_variables - @argument_variables).to_a\n to_declare << @result_name if @result_name\n unless to_declare.empty?\n str << \"var \" + to_declare.join(\",\") + sep()\n end\n\n #\n # initialize all local variables (that need initialization) to nil\n #\n to_initialize = (@local_variables - @argument_variables - @local_variables_need_no_initialization).to_a\n to_initialize << @result_name if @result_name\n unless to_initialize.empty?\n str << to_initialize.join(\"=\")\n str << \"=#{@model.encode_nil}#{sep()}\"\n end\n\n #\n # initialize \"self\"\n #\n str << \"#{@model.encode_self}=this#{sep()}\"\n\n #\n # If a block argument is given (&block) convert it to nil if it is\n # undefined. \n #\n if @block_arg_name\n str << \"#{@block_arg_name}=#{block_name()}==null?#{@model.encode_nil}:#{block_name()}#{sep()}\"\n end\n\n #\n # generate initialization code for each read instance variable\n #\n @read_instance_variables.each do |iv|\n str << \"if(#{@model.encode_self}.#{iv}==null)#{@model.encode_self}.#{iv}=#{@model.encode_nil}#{sep()}\"\n end\n\n # \n # Used in a zsuper call to refer to the methods \"arguments\"\n # \"arguments\" itself does not work due to iterators using functions.\n if @arguments_name\n str << \"var #{@arguments_name}=arguments#{sep()}\"\n end\n\n method_body << \"#{sep()}return #{@result_name}\" if @result_name\n\n if @iterators_used\n str << \"try{\" \n str << method_body \n\n #\n # Declare variable x?\n # No, catch introduced a new scope, so we don't have to\n # use a local or temporary variable here! \n #\n x = exception_name()\n iter_jump = @model.encode_globalattr(\"iter_jump\")\n return_value = @model.encode_attr(\"return_value\")\n scope = @model.encode_attr(\"scope\")\n uid = unique_method_scope()\n\n str << \"}catch(#{x}){\"\n # scope == null or scope == uid\n str << \"if(#{x} instanceof #{iter_jump} && (!#{x}.#{scope} || #{x}.#{scope}==#{uid}))return #{x}.#{return_value}#{sep()}\"\n str << \"throw(#{x})}\"\n else\n str << method_body\n end\n\n str << \"}\"\n\n return str\n end", "def generate_ruby sexp\n ruby = Ruby2Ruby.new.process(sexp)\n ruby.sub!(/\\A(def \\S+)\\(([^\\)]*)\\)/, '\\1 |\\2|') # move args\n ruby.sub!(/\\Adef[^\\n\\|]+/, 'proc { ') # strip def name\n ruby.sub!(/end\\Z/, '}') # strip end\n ruby.gsub!(/\\s+$/, '') # trailing WS bugs me\n ruby\n end", "def stest_method_1(test); end", "def test_dsl_3\n #------------------\n show Spock - Lizard\n #------------------\n assert_equal \\\n \"Lizard poisons Spock (loser Spock)\\n\" \\\n \"Result = Spock\\n\", \\\n @out.string\n end" ]
[ "0.8632499", "0.7251508", "0.71520406", "0.7132776", "0.61249", "0.60706925", "0.5999838", "0.5999838", "0.5999838", "0.5999838", "0.5949081", "0.5949081", "0.5949081", "0.5949081", "0.5947842", "0.58501226", "0.58395183", "0.5733192", "0.57169205", "0.57169205", "0.5703677", "0.567771", "0.5675377", "0.56570494", "0.56570494", "0.56570494", "0.56570494", "0.56570494", "0.56520915", "0.5649629", "0.5613543", "0.5576255", "0.5556384", "0.5544534", "0.5544432", "0.553849", "0.55208147", "0.5516307", "0.5515869", "0.55082434", "0.55034953", "0.55016196", "0.54848427", "0.5484692", "0.54805714", "0.54769754", "0.5473274", "0.5471955", "0.5471955", "0.5471955", "0.5471955", "0.5471955", "0.5471955", "0.5471955", "0.5471955", "0.5471955", "0.5471955", "0.5471955", "0.5471955", "0.5471955", "0.5471955", "0.5471955", "0.5471955", "0.5471955", "0.5470263", "0.5468117", "0.5465321", "0.5451514", "0.5405375", "0.5403367", "0.5402132", "0.5402078", "0.5402078", "0.53960156", "0.53939116", "0.5389703", "0.5387562", "0.53865236", "0.53865236", "0.53865236", "0.5386042", "0.53799105", "0.5377552", "0.5376092", "0.53751135", "0.5372889", "0.5367472", "0.5361751", "0.5361721", "0.53610635", "0.53271943", "0.5325602", "0.5311249", "0.5293163", "0.52922106", "0.5292137", "0.5291352", "0.52874273", "0.52869385", "0.5285972", "0.5284366" ]
0.0
-1
test comment ^^^ meta.function.method.witharguments.ruby keyword.control.def.ruby ^^^^^^^^^^^^^^^^^^^^^^^ meta.function.method.witharguments.ruby entity.name.function.ruby ^ meta.function.method.witharguments.ruby punctuation.definition.parameters.ruby ^ meta.function.method.witharguments.ruby variable.parameter.function.ruby ^ meta.function.method.witharguments.ruby punctuation.separator.object.ruby ^ meta.function.method.witharguments.ruby variable.parameter.function.ruby ^ meta.function.method.witharguments.ruby punctuation.separator.object.ruby ^ meta.function.method.witharguments.ruby variable.parameter.function.ruby ^ meta.function.method.witharguments.ruby keyword.operator.assignment.ruby ^ meta.function.method.witharguments.ruby punctuation.section.array.begin.ruby ^^^ meta.function.method.witharguments.ruby variable.other.ruby ^ meta.function.method.witharguments.ruby punctuation.separator.object.ruby ^^^ meta.function.method.witharguments.ruby variable.other.ruby ^ meta.function.method.witharguments.ruby punctuation.separator.object.ruby ^^^ meta.function.method.witharguments.ruby variable.other.ruby ^ meta.function.method.witharguments.ruby punctuation.section.array.end.ruby ^ meta.function.method.witharguments.ruby punctuation.definition.parameters.ruby ^^^^^ variable.other.ruby ^ punctuation.separator.object.ruby ^^^^^ variable.other.ruby ^ keyword.operator.assignment.ruby ^ punctuation.section.array.begin.ruby ^ constant.numeric.ruby ^ punctuation.separator.object.ruby ^ constant.numeric.ruby ^ punctuation.section.array.end.ruby ^^^ keyword.control.ruby ^ comment.line.numbersign.ruby punctuation.definition.comment.ruby ^^^^^^^^^^^^^ comment.line.numbersign.ruby
def method_with_parentheses(a, b, c = [foo,bar,baz]) # test comment # ^^^ meta.function.method.with-arguments.ruby keyword.control.def.ruby # ^^^^^^^^^^^^^^^^^^^^^^^ meta.function.method.with-arguments.ruby entity.name.function.ruby # ^ meta.function.method.with-arguments.ruby punctuation.definition.parameters.ruby # ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby # ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby # ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby # ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby # ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby # ^ meta.function.method.with-arguments.ruby keyword.operator.assignment.ruby # ^ meta.function.method.with-arguments.ruby punctuation.section.array.begin.ruby # ^^^ meta.function.method.with-arguments.ruby variable.other.ruby # ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby # ^^^ meta.function.method.with-arguments.ruby variable.other.ruby # ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby # ^^^ meta.function.method.with-arguments.ruby variable.other.ruby # ^ meta.function.method.with-arguments.ruby punctuation.section.array.end.ruby # ^ meta.function.method.with-arguments.ruby punctuation.definition.parameters.ruby # ^ comment.line.number-sign.ruby punctuation.definition.comment.ruby # ^^^^^^^^^^^^^ comment.line.number-sign.ruby hello, world = [1,2] # ^^^^^ variable.other.ruby # ^ punctuation.separator.object.ruby # ^^^^^ variable.other.ruby # ^ keyword.operator.assignment.ruby # ^ punctuation.section.array.begin.ruby # ^ constant.numeric.ruby # ^ punctuation.separator.object.ruby # ^ constant.numeric.ruby # ^ punctuation.section.array.end.ruby end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def method # test comment\n# ^^^ meta.function.method.without-arguments.ruby keyword.control.def.ruby\n# ^^^^^^ meta.function.method.without-arguments.ruby entity.name.function.ruby\n# ^ comment.line.number-sign.ruby punctuation.definition.comment.ruby\n# ^^^^^^^^^^^^^ comment.line.number-sign.ruby\n hello, world = [1,2]\n# ^^^^^ variable.other.ruby\n# ^ punctuation.separator.object.ruby\n# ^^^^^ variable.other.ruby\n# ^ keyword.operator.assignment.ruby\n# ^ punctuation.section.array.begin.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.separator.object.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.section.array.end.ruby\n end", "def method_without_parentheses a, b, c = [foo,bar,baz] # test comment\n# ^^^ meta.function.method.with-arguments.ruby keyword.control.def.ruby\n# ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.method.with-arguments.ruby entity.name.function.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby keyword.operator.assignment.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.section.array.begin.ruby\n# ^^^ meta.function.method.with-arguments.ruby variable.other.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^^^ meta.function.method.with-arguments.ruby variable.other.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^^^ meta.function.method.with-arguments.ruby variable.other.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.section.array.end.ruby\n# ^ comment.line.number-sign.ruby punctuation.definition.comment.ruby\n# ^^^^^^^^^^^^^ comment.line.number-sign.ruby\n hello, world = [1,2]\n# ^^^^^ variable.other.ruby\n# ^ punctuation.separator.object.ruby\n# ^^^^^ variable.other.ruby\n# ^ keyword.operator.assignment.ruby\n# ^ punctuation.section.array.begin.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.separator.object.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.section.array.end.ruby\n end", "def method_without_parentheses *a, **b, &c # test comment\n# ^^^ meta.function.method.with-arguments.ruby keyword.control.def.ruby\n# ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.method.with-arguments.ruby entity.name.function.ruby\n# ^ meta.function.method.with-arguments.ruby storage.type.variable.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^^ meta.function.method.with-arguments.ruby storage.type.variable.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^ meta.function.method.with-arguments.ruby storage.type.variable.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ comment.line.number-sign.ruby punctuation.definition.comment.ruby\n# ^^^^^^^^^^^^^ comment.line.number-sign.ruby\n hello, world = [1,2]\n# ^^^^^ variable.other.ruby\n# ^ punctuation.separator.object.ruby\n# ^^^^^ variable.other.ruby\n# ^ keyword.operator.assignment.ruby\n# ^ punctuation.section.array.begin.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.separator.object.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.section.array.end.ruby\n end", "def token!\n # at line 1:8: ( T__80 | T__81 | T__82 | EOL | LPAR | RPAR | LLAIZQ | LLADER | COMA | PUNTO | CORDER | CORIZQ | DELIM | ASIGNACION | DOUBLEDOT | COMILLA | OP_REL | OP_ARI | OP_LOG | K_ACCIONARCHIVO | K_ACCIONARREGLO | K_PACKAGE | K_CLASS | K_END | K_DEF | K_VAR | K_REQUIRE | K_IMPLEMENTS | K_EXTENDS | K_IMPRIMIR | K_CONVERSION | K_ASIGNACION | K_RETORNO | K_ACCIONSYS | K_INTERFACE | K_IF | K_TIMES | K_DO | K_EACH | K_ELSE | K_INVOKE | K_NEW | TIPO | K_REFERENCIA | K_INSPECCIONAR | K_MATEMATICA | K_NUM | K_RESIZE | K_ORDENAR | ModoOrd | K_BUSQUEDA | K_TIPOBUSQUEDA | K_WHERE | K_SPLIT | K_BEGIN | K_DIR | K_UNION | K_VISIBILIDAD | K_MODIFICADOR | K_ARRAY | K_PROPIEDAD | K_GET | K_SET | K_VALUE | K_INITIALIZE | K_FUNC | K_VOID | HexLiteral | DecimalLiteral | OctalLiteral | WS | LINE_COMMENT | Identificador )\n alt_28 = 73\n alt_28 = @dfa28.predict( @input )\n case alt_28\n when 1\n # at line 1:10: T__80\n t__80!\n\n\n when 2\n # at line 1:16: T__81\n t__81!\n\n\n when 3\n # at line 1:22: T__82\n t__82!\n\n\n when 4\n # at line 1:28: EOL\n eol!\n\n\n when 5\n # at line 1:32: LPAR\n lpar!\n\n\n when 6\n # at line 1:37: RPAR\n rpar!\n\n\n when 7\n # at line 1:42: LLAIZQ\n llaizq!\n\n\n when 8\n # at line 1:49: LLADER\n llader!\n\n\n when 9\n # at line 1:56: COMA\n coma!\n\n\n when 10\n # at line 1:61: PUNTO\n punto!\n\n\n when 11\n # at line 1:67: CORDER\n corder!\n\n\n when 12\n # at line 1:74: CORIZQ\n corizq!\n\n\n when 13\n # at line 1:81: DELIM\n delim!\n\n\n when 14\n # at line 1:87: ASIGNACION\n asignacion!\n\n\n when 15\n # at line 1:98: DOUBLEDOT\n doubledot!\n\n\n when 16\n # at line 1:108: COMILLA\n comilla!\n\n\n when 17\n # at line 1:116: OP_REL\n op_rel!\n\n\n when 18\n # at line 1:123: OP_ARI\n op_ari!\n\n\n when 19\n # at line 1:130: OP_LOG\n op_log!\n\n\n when 20\n # at line 1:137: K_ACCIONARCHIVO\n k_accionarchivo!\n\n\n when 21\n # at line 1:153: K_ACCIONARREGLO\n k_accionarreglo!\n\n\n when 22\n # at line 1:169: K_PACKAGE\n k_package!\n\n\n when 23\n # at line 1:179: K_CLASS\n k_class!\n\n\n when 24\n # at line 1:187: K_END\n k_end!\n\n\n when 25\n # at line 1:193: K_DEF\n k_def!\n\n\n when 26\n # at line 1:199: K_VAR\n k_var!\n\n\n when 27\n # at line 1:205: K_REQUIRE\n k_require!\n\n\n when 28\n # at line 1:215: K_IMPLEMENTS\n k_implements!\n\n\n when 29\n # at line 1:228: K_EXTENDS\n k_extends!\n\n\n when 30\n # at line 1:238: K_IMPRIMIR\n k_imprimir!\n\n\n when 31\n # at line 1:249: K_CONVERSION\n k_conversion!\n\n\n when 32\n # at line 1:262: K_ASIGNACION\n k_asignacion!\n\n\n when 33\n # at line 1:275: K_RETORNO\n k_retorno!\n\n\n when 34\n # at line 1:285: K_ACCIONSYS\n k_accionsys!\n\n\n when 35\n # at line 1:297: K_INTERFACE\n k_interface!\n\n\n when 36\n # at line 1:309: K_IF\n k_if!\n\n\n when 37\n # at line 1:314: K_TIMES\n k_times!\n\n\n when 38\n # at line 1:322: K_DO\n k_do!\n\n\n when 39\n # at line 1:327: K_EACH\n k_each!\n\n\n when 40\n # at line 1:334: K_ELSE\n k_else!\n\n\n when 41\n # at line 1:341: K_INVOKE\n k_invoke!\n\n\n when 42\n # at line 1:350: K_NEW\n k_new!\n\n\n when 43\n # at line 1:356: TIPO\n tipo!\n\n\n when 44\n # at line 1:361: K_REFERENCIA\n k_referencia!\n\n\n when 45\n # at line 1:374: K_INSPECCIONAR\n k_inspeccionar!\n\n\n when 46\n # at line 1:389: K_MATEMATICA\n k_matematica!\n\n\n when 47\n # at line 1:402: K_NUM\n k_num!\n\n\n when 48\n # at line 1:408: K_RESIZE\n k_resize!\n\n\n when 49\n # at line 1:417: K_ORDENAR\n k_ordenar!\n\n\n when 50\n # at line 1:427: ModoOrd\n modo_ord!\n\n\n when 51\n # at line 1:435: K_BUSQUEDA\n k_busqueda!\n\n\n when 52\n # at line 1:446: K_TIPOBUSQUEDA\n k_tipobusqueda!\n\n\n when 53\n # at line 1:461: K_WHERE\n k_where!\n\n\n when 54\n # at line 1:469: K_SPLIT\n k_split!\n\n\n when 55\n # at line 1:477: K_BEGIN\n k_begin!\n\n\n when 56\n # at line 1:485: K_DIR\n k_dir!\n\n\n when 57\n # at line 1:491: K_UNION\n k_union!\n\n\n when 58\n # at line 1:499: K_VISIBILIDAD\n k_visibilidad!\n\n\n when 59\n # at line 1:513: K_MODIFICADOR\n k_modificador!\n\n\n when 60\n # at line 1:527: K_ARRAY\n k_array!\n\n\n when 61\n # at line 1:535: K_PROPIEDAD\n k_propiedad!\n\n\n when 62\n # at line 1:547: K_GET\n k_get!\n\n\n when 63\n # at line 1:553: K_SET\n k_set!\n\n\n when 64\n # at line 1:559: K_VALUE\n k_value!\n\n\n when 65\n # at line 1:567: K_INITIALIZE\n k_initialize!\n\n\n when 66\n # at line 1:580: K_FUNC\n k_func!\n\n\n when 67\n # at line 1:587: K_VOID\n k_void!\n\n\n when 68\n # at line 1:594: HexLiteral\n hex_literal!\n\n\n when 69\n # at line 1:605: DecimalLiteral\n decimal_literal!\n\n\n when 70\n # at line 1:620: OctalLiteral\n octal_literal!\n\n\n when 71\n # at line 1:633: WS\n ws!\n\n\n when 72\n # at line 1:636: LINE_COMMENT\n line_comment!\n\n\n when 73\n # at line 1:649: Identificador\n identificador!\n\n\n end\n end", "def comment _args\n \"comment _args;\" \n end", "def comment=(_arg0); end", "def comment=(_arg0); end", "def comment=(_arg0); end", "def comment=(_arg0); end", "def comment(string); end", "def comment(string); end", "def comment(string); end", "def comment(string); end", "def comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 15)\n\n type = COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 148:3: ( ( '#' | '//' ) (~ '\\\\n' )* | '/*' ( . )* '*/' )\n alt_10 = 2\n look_10_0 = @input.peek(1)\n\n if (look_10_0 == ?#) \n alt_10 = 1\n elsif (look_10_0 == ?/) \n look_10_2 = @input.peek(2)\n\n if (look_10_2 == ?/) \n alt_10 = 1\n elsif (look_10_2 == ?*) \n alt_10 = 2\n else\n nvae = NoViableAlternative(\"\", 10, 2)\n raise nvae\n end\n else\n nvae = NoViableAlternative(\"\", 10, 0)\n raise nvae\n end\n case alt_10\n when 1\n # at line 148:5: ( '#' | '//' ) (~ '\\\\n' )*\n # at line 148:5: ( '#' | '//' )\n alt_7 = 2\n look_7_0 = @input.peek(1)\n\n if (look_7_0 == ?#) \n alt_7 = 1\n elsif (look_7_0 == ?/) \n alt_7 = 2\n else\n nvae = NoViableAlternative(\"\", 7, 0)\n raise nvae\n end\n case alt_7\n when 1\n # at line 148:7: '#'\n match(?#)\n\n when 2\n # at line 148:13: '//'\n match(\"//\")\n\n end\n # at line 148:20: (~ '\\\\n' )*\n while true # decision 8\n alt_8 = 2\n look_8_0 = @input.peek(1)\n\n if (look_8_0.between?(0x0000, ?\\t) || look_8_0.between?(0x000B, 0xFFFF)) \n alt_8 = 1\n\n end\n case alt_8\n when 1\n # at line 148:20: ~ '\\\\n'\n if @input.peek(1).between?(0x0000, ?\\t) || @input.peek(1).between?(0x000B, 0x00FF)\n @input.consume\n else\n mse = MismatchedSet(nil)\n recover(mse)\n raise mse\n end\n\n\n\n else\n break # out of loop for decision 8\n end\n end # loop for decision 8\n\n when 2\n # at line 149:5: '/*' ( . )* '*/'\n match(\"/*\")\n # at line 149:10: ( . )*\n while true # decision 9\n alt_9 = 2\n look_9_0 = @input.peek(1)\n\n if (look_9_0 == ?*) \n look_9_1 = @input.peek(2)\n\n if (look_9_1 == ?/) \n alt_9 = 2\n elsif (look_9_1.between?(0x0000, ?.) || look_9_1.between?(?0, 0xFFFF)) \n alt_9 = 1\n\n end\n elsif (look_9_0.between?(0x0000, ?)) || look_9_0.between?(?+, 0xFFFF)) \n alt_9 = 1\n\n end\n case alt_9\n when 1\n # at line 149:10: .\n match_any\n\n else\n break # out of loop for decision 9\n end\n end # loop for decision 9\n match(\"*/\")\n\n end\n \n @state.type = type\n @state.channel = channel\n # --> action\n skip \n # <-- action\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 15)\n\n end", "def token!\n # at line 1:8: ( T__30 | T__31 | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | T__38 | T__39 | T__40 | T__41 | T__42 | T__43 | T__44 | T__45 | T__46 | T__47 | T__48 | T__49 | T__50 | T__51 | T__52 | T__53 | T__54 | INTEGER | FLOAT | BOOLEAN | STRING | CHAR | INIT | OPEN | CLOSE | TYPE_INT | TYPE_FLOAT | TYPE_STRING | TYPE_BOOL | TYPE_VOID | ENTITY | COMPONENT | SYSTEM | ENUM | IF | ELSE | RETURN | WHILE | IDENT | WS | COMMENT | MULTILINE_COMMENT | NL )\n alt_9 = 51\n alt_9 = @dfa9.predict( @input )\n case alt_9\n when 1\n # at line 1:10: T__30\n t__30!\n\n\n when 2\n # at line 1:16: T__31\n t__31!\n\n\n when 3\n # at line 1:22: T__32\n t__32!\n\n\n when 4\n # at line 1:28: T__33\n t__33!\n\n\n when 5\n # at line 1:34: T__34\n t__34!\n\n\n when 6\n # at line 1:40: T__35\n t__35!\n\n\n when 7\n # at line 1:46: T__36\n t__36!\n\n\n when 8\n # at line 1:52: T__37\n t__37!\n\n\n when 9\n # at line 1:58: T__38\n t__38!\n\n\n when 10\n # at line 1:64: T__39\n t__39!\n\n\n when 11\n # at line 1:70: T__40\n t__40!\n\n\n when 12\n # at line 1:76: T__41\n t__41!\n\n\n when 13\n # at line 1:82: T__42\n t__42!\n\n\n when 14\n # at line 1:88: T__43\n t__43!\n\n\n when 15\n # at line 1:94: T__44\n t__44!\n\n\n when 16\n # at line 1:100: T__45\n t__45!\n\n\n when 17\n # at line 1:106: T__46\n t__46!\n\n\n when 18\n # at line 1:112: T__47\n t__47!\n\n\n when 19\n # at line 1:118: T__48\n t__48!\n\n\n when 20\n # at line 1:124: T__49\n t__49!\n\n\n when 21\n # at line 1:130: T__50\n t__50!\n\n\n when 22\n # at line 1:136: T__51\n t__51!\n\n\n when 23\n # at line 1:142: T__52\n t__52!\n\n\n when 24\n # at line 1:148: T__53\n t__53!\n\n\n when 25\n # at line 1:154: T__54\n t__54!\n\n\n when 26\n # at line 1:160: INTEGER\n integer!\n\n\n when 27\n # at line 1:168: FLOAT\n float!\n\n\n when 28\n # at line 1:174: BOOLEAN\n boolean!\n\n\n when 29\n # at line 1:182: STRING\n string!\n\n\n when 30\n # at line 1:189: CHAR\n char!\n\n\n when 31\n # at line 1:194: INIT\n init!\n\n\n when 32\n # at line 1:199: OPEN\n open!\n\n\n when 33\n # at line 1:204: CLOSE\n close!\n\n\n when 34\n # at line 1:210: TYPE_INT\n type_int!\n\n\n when 35\n # at line 1:219: TYPE_FLOAT\n type_float!\n\n\n when 36\n # at line 1:230: TYPE_STRING\n type_string!\n\n\n when 37\n # at line 1:242: TYPE_BOOL\n type_bool!\n\n\n when 38\n # at line 1:252: TYPE_VOID\n type_void!\n\n\n when 39\n # at line 1:262: ENTITY\n entity!\n\n\n when 40\n # at line 1:269: COMPONENT\n component!\n\n\n when 41\n # at line 1:279: SYSTEM\n system!\n\n\n when 42\n # at line 1:286: ENUM\n enum!\n\n\n when 43\n # at line 1:291: IF\n if!\n\n\n when 44\n # at line 1:294: ELSE\n else!\n\n\n when 45\n # at line 1:299: RETURN\n return!\n\n\n when 46\n # at line 1:306: WHILE\n while!\n\n\n when 47\n # at line 1:312: IDENT\n ident!\n\n\n when 48\n # at line 1:318: WS\n ws!\n\n\n when 49\n # at line 1:321: COMMENT\n comment!\n\n\n when 50\n # at line 1:329: MULTILINE_COMMENT\n multiline_comment!\n\n\n when 51\n # at line 1:347: NL\n nl!\n\n\n end\n end", "def some_method(with:, args:)\n # Floating comment\n end", "def test_comment_full_name\n 't1_cce66qf'\nend", "def comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 13 )\n\n type = COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 63:5: '#' (~ ( '\\\\r' | '\\\\n' ) )*\n match( 0x23 )\n # at line 63:9: (~ ( '\\\\r' | '\\\\n' ) )*\n while true # decision 22\n alt_22 = 2\n look_22_0 = @input.peek( 1 )\n\n if ( look_22_0.between?( 0x0, 0x9 ) || look_22_0.between?( 0xb, 0xc ) || look_22_0.between?( 0xe, 0xffff ) )\n alt_22 = 1\n\n end\n case alt_22\n when 1\n # at line 63:11: ~ ( '\\\\r' | '\\\\n' )\n if @input.peek( 1 ).between?( 0x0, 0x9 ) || @input.peek( 1 ).between?( 0xb, 0xc ) || @input.peek( 1 ).between?( 0xe, 0xff )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n\n else\n break # out of loop for decision 22\n end\n end # loop for decision 22\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__, 13 )\n\n end", "def step\n case\n when bol? && check( /=begin/ )\n start_group( :comment, scan_until( /^=end#{EOL}/ ) )\n when bol? && check( /__END__#{EOL}/ )\n start_group( :comment, scan_until( /\\Z/ ) )\n else\n case\n when check( /def\\s+/ )\n start_group :keyword, scan( /def\\s+/ )\n start_group :method, scan_until( /(?=[;(\\s]|#{EOL})/ )\n when check( /class\\s+/ )\n start_group :keyword, scan( /class\\s+/ )\n start_group :class, scan_until( /(?=[;\\s<]|#{EOL})/ )\n when check( /module\\s+/ )\n start_group :keyword, scan( /module\\s+/ )\n start_group :module, scan_until( /(?=[;\\s]|#{EOL})/ )\n when check( /::/ )\n start_group :punct, scan(/::/)\n when check( /:\"/ )\n start_group :symbol, scan(/:/)\n scan_delimited_region :symbol, :symbol, \"\", true\n @allow_operator = true\n when check( /:'/ )\n start_group :symbol, scan(/:/)\n scan_delimited_region :symbol, :symbol, \"\", false\n @allow_operator = true\n when scan( /:[_a-zA-Z@$][$@\\w]*[=!?]?/ )\n start_group :symbol, matched\n @allow_operator = true\n when scan( /\\?(\\\\[^\\n\\r]|[^\\\\\\n\\r\\s])/ )\n start_group :char, matched\n @allow_operator = true\n when check( /(__FILE__|__LINE__|true|false|nil|self)[?!]?/ )\n if @selector || matched[-1] == ?? || matched[-1] == ?!\n start_group :ident,\n scan(/(__FILE__|__LINE__|true|false|nil|self)[?!]?/)\n else\n start_group :constant,\n scan(/(__FILE__|__LINE__|true|false|nil|self)/)\n end\n @selector = false\n @allow_operator = true\n when scan(/0([bB][01]+|[oO][0-7]+|[dD][0-9]+|[xX][0-9a-fA-F]+)/)\n start_group :number, matched\n @allow_operator = true\n else\n case peek(2)\n when \"%r\"\n scan_delimited_region :punct, :regex, scan( /../ ), true\n @allow_operator = true\n when \"%w\", \"%q\"\n scan_delimited_region :punct, :string, scan( /../ ), false\n @allow_operator = true\n when \"%s\"\n scan_delimited_region :punct, :symbol, scan( /../ ), false\n @allow_operator = true\n when \"%W\", \"%Q\", \"%x\"\n scan_delimited_region :punct, :string, scan( /../ ), true\n @allow_operator = true\n when /%[^\\sa-zA-Z0-9]/\n scan_delimited_region :punct, :string, scan( /./ ), true\n @allow_operator = true\n when \"<<\"\n saw_word = ( chunk[-1,1] =~ /[\\w!?]/ )\n start_group :punct, scan( /<</ )\n if saw_word\n @allow_operator = false\n return\n end\n\n float_right = scan( /-/ )\n append \"-\" if float_right\n if ( type = scan( /['\"]/ ) )\n append type\n delim = scan_until( /(?=#{type})/ )\n if delim.nil?\n append scan_until( /\\Z/ )\n return\n end\n else\n delim = scan( /\\w+/ ) or return\n end\n start_group :constant, delim\n start_group :punct, scan( /#{type}/ ) if type\n @heredocs << [ float_right, type, delim ]\n @allow_operator = true\n else\n case peek(1)\n when /[\\n\\r]/\n unless @heredocs.empty?\n scan_heredoc(*@heredocs.shift)\n else\n start_group :normal, scan( /\\s+/ )\n end\n @allow_operator = false\n when /\\s/\n start_group :normal, scan( /\\s+/ )\n when \"#\"\n start_group :comment, scan( /#[^\\n\\r]*/ )\n when /[A-Z]/\n start_group @selector ? :ident : :constant, scan( /\\w+/ )\n @allow_operator = true\n when /[a-z_]/\n word = scan( /\\w+[?!]?/ )\n if !@selector && KEYWORDS.include?( word )\n start_group :keyword, word\n @allow_operator = false\n elsif\n start_group :ident, word\n @allow_operator = true\n end\n @selector = false\n when /\\d/\n start_group :number,\n scan( /[\\d_]+(\\.[\\d_]+)?([eE][\\d_]+)?/ )\n @allow_operator = true\n when '\"'\n scan_delimited_region :punct, :string, \"\", true\n @allow_operator = true\n when '/'\n if @allow_operator\n start_group :punct, scan(%r{/})\n @allow_operator = false\n else\n scan_delimited_region :punct, :regex, \"\", true\n @allow_operator = true\n end\n when \"'\"\n scan_delimited_region :punct, :string, \"\", false\n @allow_operator = true\n when \".\"\n dots = scan( /\\.{1,3}/ )\n start_group :punct, dots\n @selector = ( dots.length == 1 )\n when /[@]/\n start_group :attribute, scan( /@{1,2}\\w*/ )\n @allow_operator = true\n when /[$]/\n start_group :global, scan(/\\$/)\n start_group :global, scan( /\\w+|./ ) if check(/./)\n @allow_operator = true\n when /[-!?*\\/+=<>(\\[\\{}:;,&|%]/\n start_group :punct, scan(/./)\n @allow_operator = false\n when /[)\\]]/\n start_group :punct, scan(/./)\n @allow_operator = true\n else\n # all else just falls through this, to prevent\n # infinite loops...\n append getch\n end\n end\n end\n end\n end", "def function_definition\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 8 )\n\n\n value = nil\n\n\n name = nil\n type = nil\n a = nil\n\n\n begin\n # at line 51:5: OPEN type= variable_type name= IDENT ( '(' (type= variable_type name= IDENT ( ',' type= variable_type name= IDENT )* )? ')' )? ( CLOSE | NL (a= statement )* CLOSE )\n match( OPEN, TOKENS_FOLLOWING_OPEN_IN_function_definition_350 )\n @state.following.push( TOKENS_FOLLOWING_variable_type_IN_function_definition_354 )\n type = variable_type\n @state.following.pop\n name = match( IDENT, TOKENS_FOLLOWING_IDENT_IN_function_definition_358 )\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value = FunctionDefinitionEval.new(name.text, type) \n # <-- action\n end\n\n # at line 52:3: ( '(' (type= variable_type name= IDENT ( ',' type= variable_type name= IDENT )* )? ')' )?\n alt_17 = 2\n look_17_0 = @input.peek( 1 )\n\n if ( look_17_0 == T__34 )\n alt_17 = 1\n end\n case alt_17\n when 1\n # at line 52:5: '(' (type= variable_type name= IDENT ( ',' type= variable_type name= IDENT )* )? ')'\n match( T__34, TOKENS_FOLLOWING_T__34_IN_function_definition_366 )\n # at line 52:9: (type= variable_type name= IDENT ( ',' type= variable_type name= IDENT )* )?\n alt_16 = 2\n look_16_0 = @input.peek( 1 )\n\n if ( look_16_0 == IDENT || look_16_0.between?( TYPE_BOOL, TYPE_VOID ) )\n alt_16 = 1\n end\n case alt_16\n when 1\n # at line 53:5: type= variable_type name= IDENT ( ',' type= variable_type name= IDENT )*\n @state.following.push( TOKENS_FOLLOWING_variable_type_IN_function_definition_376 )\n type = variable_type\n @state.following.pop\n name = match( IDENT, TOKENS_FOLLOWING_IDENT_IN_function_definition_380 )\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value.add_argument(type, name.text) \n # <-- action\n end\n\n # at line 54:5: ( ',' type= variable_type name= IDENT )*\n while true # decision 15\n alt_15 = 2\n look_15_0 = @input.peek( 1 )\n\n if ( look_15_0 == T__40 )\n alt_15 = 1\n\n end\n case alt_15\n when 1\n # at line 54:6: ',' type= variable_type name= IDENT\n match( T__40, TOKENS_FOLLOWING_T__40_IN_function_definition_389 )\n @state.following.push( TOKENS_FOLLOWING_variable_type_IN_function_definition_393 )\n type = variable_type\n @state.following.pop\n name = match( IDENT, TOKENS_FOLLOWING_IDENT_IN_function_definition_397 )\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value.add_argument(type, name.text) \n # <-- action\n end\n\n\n else\n break # out of loop for decision 15\n end\n end # loop for decision 15\n\n\n end\n match( T__35, TOKENS_FOLLOWING_T__35_IN_function_definition_409 )\n\n end\n # at line 56:3: ( CLOSE | NL (a= statement )* CLOSE )\n alt_19 = 2\n look_19_0 = @input.peek( 1 )\n\n if ( look_19_0 == CLOSE )\n alt_19 = 1\n elsif ( look_19_0 == NL )\n alt_19 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n\n\n raise NoViableAlternative( \"\", 19, 0 )\n\n end\n case alt_19\n when 1\n # at line 56:5: CLOSE\n match( CLOSE, TOKENS_FOLLOWING_CLOSE_IN_function_definition_418 )\n\n when 2\n # at line 56:13: NL (a= statement )* CLOSE\n match( NL, TOKENS_FOLLOWING_NL_IN_function_definition_422 )\n # at line 56:16: (a= statement )*\n while true # decision 18\n alt_18 = 2\n look_18_0 = @input.peek( 1 )\n\n if ( look_18_0.between?( IDENT, IF ) || look_18_0 == RETURN || look_18_0 == WHILE )\n alt_18 = 1\n\n end\n case alt_18\n when 1\n # at line 56:17: a= statement\n @state.following.push( TOKENS_FOLLOWING_statement_IN_function_definition_427 )\n a = statement\n @state.following.pop\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value.add_statement(a) \n # <-- action\n end\n\n\n else\n break # out of loop for decision 18\n end\n end # loop for decision 18\n\n match( CLOSE, TOKENS_FOLLOWING_CLOSE_IN_function_definition_434 )\n\n end\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__, 8 )\n\n\n end\n\n return value\n end", "def token!\n # at line 1:8: ( PROGRAM | PRINT | VAR | CTE | IF | ELSE | AND | OR | GT | GTE | LT | LTE | INTEGER | FLOAT | STRING | BOOLEAN | VOID | FUNCTION | FIN | RETURN | INPUT | WHILE | CLASS | WORD | NUM_I | NUM_F | BOOL | ID | LPAREN | RPAREN | LKEY | RKEY | EQUAL | DIF | SIMILAR | COMMA | DDOT | SEMI | PLUS | SUB | DIV | MUL | INHERITS | DOT | WHITESPACE )\n alt_10 = 45\n alt_10 = @dfa10.predict( @input )\n case alt_10\n when 1\n # at line 1:10: PROGRAM\n program!\n\n\n when 2\n # at line 1:18: PRINT\n print!\n\n\n when 3\n # at line 1:24: VAR\n var!\n\n\n when 4\n # at line 1:28: CTE\n cte!\n\n\n when 5\n # at line 1:32: IF\n if!\n\n\n when 6\n # at line 1:35: ELSE\n else!\n\n\n when 7\n # at line 1:40: AND\n and!\n\n\n when 8\n # at line 1:44: OR\n or!\n\n\n when 9\n # at line 1:47: GT\n gt!\n\n\n when 10\n # at line 1:50: GTE\n gte!\n\n\n when 11\n # at line 1:54: LT\n lt!\n\n\n when 12\n # at line 1:57: LTE\n lte!\n\n\n when 13\n # at line 1:61: INTEGER\n integer!\n\n\n when 14\n # at line 1:69: FLOAT\n float!\n\n\n when 15\n # at line 1:75: STRING\n string!\n\n\n when 16\n # at line 1:82: BOOLEAN\n boolean!\n\n\n when 17\n # at line 1:90: VOID\n void!\n\n\n when 18\n # at line 1:95: FUNCTION\n function!\n\n\n when 19\n # at line 1:104: FIN\n fin!\n\n\n when 20\n # at line 1:108: RETURN\n return!\n\n\n when 21\n # at line 1:115: INPUT\n input!\n\n\n when 22\n # at line 1:121: WHILE\n while!\n\n\n when 23\n # at line 1:127: CLASS\n class!\n\n\n when 24\n # at line 1:133: WORD\n word!\n\n\n when 25\n # at line 1:138: NUM_I\n num_i!\n\n\n when 26\n # at line 1:144: NUM_F\n num_f!\n\n\n when 27\n # at line 1:150: BOOL\n bool!\n\n\n when 28\n # at line 1:155: ID\n id!\n\n\n when 29\n # at line 1:158: LPAREN\n lparen!\n\n\n when 30\n # at line 1:165: RPAREN\n rparen!\n\n\n when 31\n # at line 1:172: LKEY\n lkey!\n\n\n when 32\n # at line 1:177: RKEY\n rkey!\n\n\n when 33\n # at line 1:182: EQUAL\n equal!\n\n\n when 34\n # at line 1:188: DIF\n dif!\n\n\n when 35\n # at line 1:192: SIMILAR\n similar!\n\n\n when 36\n # at line 1:200: COMMA\n comma!\n\n\n when 37\n # at line 1:206: DDOT\n ddot!\n\n\n when 38\n # at line 1:211: SEMI\n semi!\n\n\n when 39\n # at line 1:216: PLUS\n plus!\n\n\n when 40\n # at line 1:221: SUB\n sub!\n\n\n when 41\n # at line 1:225: DIV\n div!\n\n\n when 42\n # at line 1:229: MUL\n mul!\n\n\n when 43\n # at line 1:233: INHERITS\n inherits!\n\n\n when 44\n # at line 1:242: DOT\n dot!\n\n\n when 45\n # at line 1:246: WHITESPACE\n whitespace!\n\n\n end\n end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 49 )\n\n\n\n type = COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 228:11: '//' ( . )* ( '\\\\n' | '\\\\r' )\n match( \"//\" )\n\n # at line 228:16: ( . )*\n while true # decision 6\n alt_6 = 2\n look_6_0 = @input.peek( 1 )\n\n if ( look_6_0 == 0xa || look_6_0 == 0xd )\n alt_6 = 2\n elsif ( look_6_0.between?( 0x0, 0x9 ) || look_6_0.between?( 0xb, 0xc ) || look_6_0.between?( 0xe, 0xffff ) )\n alt_6 = 1\n\n end\n case alt_6\n when 1\n # at line 228:16: .\n match_any\n\n else\n break # out of loop for decision 6\n end\n end # loop for decision 6\n\n if @input.peek(1) == 0xa || @input.peek(1) == 0xd\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n\n end\n\n\n\n # --> action\n channel = HIDDEN;\n # <-- action\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 49 )\n\n\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 comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 35 )\n\n type = COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 350:9: '#' (~ ( '\\\\n' | '\\\\r' ) )*\n match( 0x23 )\n # at line 350:13: (~ ( '\\\\n' | '\\\\r' ) )*\n while true # decision 13\n alt_13 = 2\n look_13_0 = @input.peek( 1 )\n\n if ( look_13_0.between?( 0x0, 0x9 ) || look_13_0.between?( 0xb, 0xc ) || look_13_0.between?( 0xe, 0xffff ) )\n alt_13 = 1\n\n end\n case alt_13\n when 1\n # at line 350:13: ~ ( '\\\\n' | '\\\\r' )\n if @input.peek( 1 ).between?( 0x0, 0x9 ) || @input.peek( 1 ).between?( 0xb, 0xc ) || @input.peek( 1 ).between?( 0xe, 0xff )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n\n else\n break # out of loop for decision 13\n end\n end # loop for decision 13\n # --> action\n channel=HIDDEN;\n # <-- action\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__, 35 )\n\n end", "def lines_of_code; end", "def lines_of_code; end", "def line_comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 78 )\n\n\n\n type = LINE_COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 608:8: '#' (~ ( '\\\\n' | '\\\\r' ) )* ( '\\\\r' )? '\\\\n'\n match( 0x23 )\n # at line 608:12: (~ ( '\\\\n' | '\\\\r' ) )*\n while true # decision 25\n alt_25 = 2\n look_25_0 = @input.peek( 1 )\n\n if ( look_25_0.between?( 0x0, 0x9 ) || look_25_0.between?( 0xb, 0xc ) || look_25_0.between?( 0xe, 0xffff ) )\n alt_25 = 1\n\n end\n case alt_25\n when 1\n # at line \n if @input.peek( 1 ).between?( 0x0, 0x9 ) || @input.peek( 1 ).between?( 0xb, 0xc ) || @input.peek( 1 ).between?( 0xe, 0xffff )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n\n end\n\n\n\n else\n break # out of loop for decision 25\n end\n end # loop for decision 25\n\n # at line 608:26: ( '\\\\r' )?\n alt_26 = 2\n look_26_0 = @input.peek( 1 )\n\n if ( look_26_0 == 0xd )\n alt_26 = 1\n end\n case alt_26\n when 1\n # at line 608:26: '\\\\r'\n match( 0xd )\n\n end\n match( 0xa )\n\n # --> action\n channel=HIDDEN;\n # <-- action\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 78 )\n\n\n end", "def token!\n # at line 1:8: ( RET | SCOPE | FRAGMENT | TREE_BEGIN | ROOT | BANG | RANGE | REWRITE | AT | LABEL_ASSIGN | LIST_LABEL_ASSIGN | T__67 | T__68 | T__69 | T__70 | T__71 | T__72 | T__73 | T__74 | T__75 | T__76 | T__77 | T__78 | T__79 | T__80 | T__81 | T__82 | T__83 | T__84 | T__85 | T__86 | T__87 | T__88 | T__89 | T__90 | T__91 | T__92 | T__93 | SL_COMMENT | ML_COMMENT | CHAR_LITERAL | STRING_LITERAL | DOUBLE_QUOTE_STRING_LITERAL | DOUBLE_ANGLE_STRING_LITERAL | INT | ARG_ACTION | ACTION | TOKEN_REF | RULE_REF | OPTIONS | TOKENS | WS )\n alt_21 = 52\n alt_21 = @dfa21.predict(@input)\n case alt_21\n when 1\n # at line 1:10: RET\n ret!\n\n when 2\n # at line 1:14: SCOPE\n scope!\n\n when 3\n # at line 1:20: FRAGMENT\n fragment!\n\n when 4\n # at line 1:29: TREE_BEGIN\n tree_begin!\n\n when 5\n # at line 1:40: ROOT\n root!\n\n when 6\n # at line 1:45: BANG\n bang!\n\n when 7\n # at line 1:50: RANGE\n range!\n\n when 8\n # at line 1:56: REWRITE\n rewrite!\n\n when 9\n # at line 1:64: AT\n at!\n\n when 10\n # at line 1:67: LABEL_ASSIGN\n label_assign!\n\n when 11\n # at line 1:80: LIST_LABEL_ASSIGN\n list_label_assign!\n\n when 12\n # at line 1:98: T__67\n t__67!\n\n when 13\n # at line 1:104: T__68\n t__68!\n\n when 14\n # at line 1:110: T__69\n t__69!\n\n when 15\n # at line 1:116: T__70\n t__70!\n\n when 16\n # at line 1:122: T__71\n t__71!\n\n when 17\n # at line 1:128: T__72\n t__72!\n\n when 18\n # at line 1:134: T__73\n t__73!\n\n when 19\n # at line 1:140: T__74\n t__74!\n\n when 20\n # at line 1:146: T__75\n t__75!\n\n when 21\n # at line 1:152: T__76\n t__76!\n\n when 22\n # at line 1:158: T__77\n t__77!\n\n when 23\n # at line 1:164: T__78\n t__78!\n\n when 24\n # at line 1:170: T__79\n t__79!\n\n when 25\n # at line 1:176: T__80\n t__80!\n\n when 26\n # at line 1:182: T__81\n t__81!\n\n when 27\n # at line 1:188: T__82\n t__82!\n\n when 28\n # at line 1:194: T__83\n t__83!\n\n when 29\n # at line 1:200: T__84\n t__84!\n\n when 30\n # at line 1:206: T__85\n t__85!\n\n when 31\n # at line 1:212: T__86\n t__86!\n\n when 32\n # at line 1:218: T__87\n t__87!\n\n when 33\n # at line 1:224: T__88\n t__88!\n\n when 34\n # at line 1:230: T__89\n t__89!\n\n when 35\n # at line 1:236: T__90\n t__90!\n\n when 36\n # at line 1:242: T__91\n t__91!\n\n when 37\n # at line 1:248: T__92\n t__92!\n\n when 38\n # at line 1:254: T__93\n t__93!\n\n when 39\n # at line 1:260: SL_COMMENT\n sl_comment!\n\n when 40\n # at line 1:271: ML_COMMENT\n ml_comment!\n\n when 41\n # at line 1:282: CHAR_LITERAL\n char_literal!\n\n when 42\n # at line 1:295: STRING_LITERAL\n string_literal!\n\n when 43\n # at line 1:310: DOUBLE_QUOTE_STRING_LITERAL\n double_quote_string_literal!\n\n when 44\n # at line 1:338: DOUBLE_ANGLE_STRING_LITERAL\n double_angle_string_literal!\n\n when 45\n # at line 1:366: INT\n int!\n\n when 46\n # at line 1:370: ARG_ACTION\n arg_action!\n\n when 47\n # at line 1:381: ACTION\n action!\n\n when 48\n # at line 1:388: TOKEN_REF\n token_ref!\n\n when 49\n # at line 1:398: RULE_REF\n rule_ref!\n\n when 50\n # at line 1:407: OPTIONS\n options!\n\n when 51\n # at line 1:415: TOKENS\n tokens!\n\n when 52\n # at line 1:422: WS\n ws!\n\n end\n end", "def token!\n # at line 1:8: ( T__48 | T__49 | T__50 | T__51 | T__52 | CATEGORY_KEY | LINK_KEY | X_OCCI_ATTRIBUTE_KEY | X_OCCI_LOCATION_KEY | ACTION | ACTIONS | AMPERSAND | AT | ATTRIBUTES | BACKSLASH | CATEGORY | CLASS | COLON | DASH | DOT | EQUALS | GT | HASH | KIND | LINK | LOCATION | LT | MIXIN | PERCENT | PLUS | QUESTION | QUOTE | REL | SCHEME | SELF | SEMICOLON | SLASH | SQUOTE | TERM | TILDE | TITLE | UNDERSCORE | LBRACKET | RBRACKET | LOALPHA | UPALPHA | DIGIT | WS | ESC )\n alt_5 = 49\n alt_5 = @dfa5.predict( @input )\n case alt_5\n when 1\n # at line 1:10: T__48\n t__48!\n\n when 2\n # at line 1:16: T__49\n t__49!\n\n when 3\n # at line 1:22: T__50\n t__50!\n\n when 4\n # at line 1:28: T__51\n t__51!\n\n when 5\n # at line 1:34: T__52\n t__52!\n\n when 6\n # at line 1:40: CATEGORY_KEY\n category_key!\n\n when 7\n # at line 1:53: LINK_KEY\n link_key!\n\n when 8\n # at line 1:62: X_OCCI_ATTRIBUTE_KEY\n x_occi_attribute_key!\n\n when 9\n # at line 1:83: X_OCCI_LOCATION_KEY\n x_occi_location_key!\n\n when 10\n # at line 1:103: ACTION\n action!\n\n when 11\n # at line 1:110: ACTIONS\n actions!\n\n when 12\n # at line 1:118: AMPERSAND\n ampersand!\n\n when 13\n # at line 1:128: AT\n at!\n\n when 14\n # at line 1:131: ATTRIBUTES\n attributes!\n\n when 15\n # at line 1:142: BACKSLASH\n backslash!\n\n when 16\n # at line 1:152: CATEGORY\n category!\n\n when 17\n # at line 1:161: CLASS\n class!\n\n when 18\n # at line 1:167: COLON\n colon!\n\n when 19\n # at line 1:173: DASH\n dash!\n\n when 20\n # at line 1:178: DOT\n dot!\n\n when 21\n # at line 1:182: EQUALS\n equals!\n\n when 22\n # at line 1:189: GT\n gt!\n\n when 23\n # at line 1:192: HASH\n hash!\n\n when 24\n # at line 1:197: KIND\n kind!\n\n when 25\n # at line 1:202: LINK\n link!\n\n when 26\n # at line 1:207: LOCATION\n location!\n\n when 27\n # at line 1:216: LT\n lt!\n\n when 28\n # at line 1:219: MIXIN\n mixin!\n\n when 29\n # at line 1:225: PERCENT\n percent!\n\n when 30\n # at line 1:233: PLUS\n plus!\n\n when 31\n # at line 1:238: QUESTION\n question!\n\n when 32\n # at line 1:247: QUOTE\n quote!\n\n when 33\n # at line 1:253: REL\n rel!\n\n when 34\n # at line 1:257: SCHEME\n scheme!\n\n when 35\n # at line 1:264: SELF\n self!\n\n when 36\n # at line 1:269: SEMICOLON\n semicolon!\n\n when 37\n # at line 1:279: SLASH\n slash!\n\n when 38\n # at line 1:285: SQUOTE\n squote!\n\n when 39\n # at line 1:292: TERM\n term!\n\n when 40\n # at line 1:297: TILDE\n tilde!\n\n when 41\n # at line 1:303: TITLE\n title!\n\n when 42\n # at line 1:309: UNDERSCORE\n underscore!\n\n when 43\n # at line 1:320: LBRACKET\n lbracket!\n\n when 44\n # at line 1:329: RBRACKET\n rbracket!\n\n when 45\n # at line 1:338: LOALPHA\n loalpha!\n\n when 46\n # at line 1:346: UPALPHA\n upalpha!\n\n when 47\n # at line 1:354: DIGIT\n digit!\n\n when 48\n # at line 1:360: WS\n ws!\n\n when 49\n # at line 1:363: ESC\n esc!\n\n end\n end", "def comment_string\n @comment_syntax.string_for_method_entity self\n end", "def sl_comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 39)\n\n type = SL_COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 470:5: '//' ( ' $ANTLR ' SRC | (~ ( '\\\\r' | '\\\\n' ) )* ) ( '\\\\r' )? '\\\\n'\n match(\"//\")\n # at line 471:5: ( ' $ANTLR ' SRC | (~ ( '\\\\r' | '\\\\n' ) )* )\n alt_2 = 2\n alt_2 = @dfa2.predict(@input)\n case alt_2\n when 1\n # at line 471:7: ' $ANTLR ' SRC\n match(\" $ANTLR \")\n src!\n\n when 2\n # at line 472:6: (~ ( '\\\\r' | '\\\\n' ) )*\n # at line 472:6: (~ ( '\\\\r' | '\\\\n' ) )*\n loop do #loop 1\n alt_1 = 2\n look_1_0 = @input.peek(1)\n\n if (look_1_0.between?(0x0000, ?\\t) || look_1_0.between?(0x000B, ?\\f) || look_1_0.between?(0x000E, 0xFFFF)) \n alt_1 = 1\n\n end\n case alt_1\n when 1\n # at line 472:6: ~ ( '\\\\r' | '\\\\n' )\n if @input.peek(1).between?(0x0000, ?\\t) || @input.peek(1).between?(0x000B, ?\\f) || @input.peek(1).between?(0x000E, 0x00FF)\n @input.consume\n else\n mse = MismatchedSet(nil)\n recover(mse)\n raise mse\n end\n\n\n\n else\n break #loop 1\n end\n end\n\n end\n # at line 474:3: ( '\\\\r' )?\n alt_3 = 2\n look_3_0 = @input.peek(1)\n\n if (look_3_0 == ?\\r) \n alt_3 = 1\n end\n case alt_3\n when 1\n # at line 474:3: '\\\\r'\n match(?\\r)\n\n end\n match(?\\n)\n # --> action\n channel=HIDDEN;\n # <-- action\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__, 39)\n\n end", "def esc!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 46)\n\n \n # - - - - main rule block - - - -\n # at line 504:7: '\\\\\\\\' ( 'n' | 'r' | 't' | 'b' | 'f' | '\\\"' | '\\\\'' | '\\\\\\\\' | '>' | 'u' XDIGIT XDIGIT XDIGIT XDIGIT | . )\n match(?\\\\)\n # at line 505:3: ( 'n' | 'r' | 't' | 'b' | 'f' | '\\\"' | '\\\\'' | '\\\\\\\\' | '>' | 'u' XDIGIT XDIGIT XDIGIT XDIGIT | . )\n alt_9 = 11\n alt_9 = @dfa9.predict(@input)\n case alt_9\n when 1\n # at line 505:5: 'n'\n match(?n)\n\n when 2\n # at line 506:5: 'r'\n match(?r)\n\n when 3\n # at line 507:5: 't'\n match(?t)\n\n when 4\n # at line 508:5: 'b'\n match(?b)\n\n when 5\n # at line 509:5: 'f'\n match(?f)\n\n when 6\n # at line 510:5: '\\\"'\n match(?\")\n\n when 7\n # at line 511:5: '\\\\''\n match(?\\')\n\n when 8\n # at line 512:5: '\\\\\\\\'\n match(?\\\\)\n\n when 9\n # at line 513:5: '>'\n match(?>)\n\n when 10\n # at line 514:5: 'u' XDIGIT XDIGIT XDIGIT XDIGIT\n match(?u)\n xdigit!\n xdigit!\n xdigit!\n xdigit!\n\n when 11\n # at line 515:5: .\n match_any\n\n end\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 46)\n\n end", "def token!\n # at line 1:8: ( T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | T__31 | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | T__38 | T__39 | T__40 | T__41 | T__42 | T__43 | T__44 | T__45 | T__46 | T__47 | T__48 | T__49 | T__50 | T__51 | T__52 | T__53 | T__54 | T__55 | T__56 | T__57 | T__58 | T__59 | ST | ND | RD | TH | DIGIT | WS | EOL | LETTER )\n alt_7 = 56\n alt_7 = @dfa7.predict( @input )\n case alt_7\n when 1\n # at line 1:10: T__12\n t__12!\n\n when 2\n # at line 1:16: T__13\n t__13!\n\n when 3\n # at line 1:22: T__14\n t__14!\n\n when 4\n # at line 1:28: T__15\n t__15!\n\n when 5\n # at line 1:34: T__16\n t__16!\n\n when 6\n # at line 1:40: T__17\n t__17!\n\n when 7\n # at line 1:46: T__18\n t__18!\n\n when 8\n # at line 1:52: T__19\n t__19!\n\n when 9\n # at line 1:58: T__20\n t__20!\n\n when 10\n # at line 1:64: T__21\n t__21!\n\n when 11\n # at line 1:70: T__22\n t__22!\n\n when 12\n # at line 1:76: T__23\n t__23!\n\n when 13\n # at line 1:82: T__24\n t__24!\n\n when 14\n # at line 1:88: T__25\n t__25!\n\n when 15\n # at line 1:94: T__26\n t__26!\n\n when 16\n # at line 1:100: T__27\n t__27!\n\n when 17\n # at line 1:106: T__28\n t__28!\n\n when 18\n # at line 1:112: T__29\n t__29!\n\n when 19\n # at line 1:118: T__30\n t__30!\n\n when 20\n # at line 1:124: T__31\n t__31!\n\n when 21\n # at line 1:130: T__32\n t__32!\n\n when 22\n # at line 1:136: T__33\n t__33!\n\n when 23\n # at line 1:142: T__34\n t__34!\n\n when 24\n # at line 1:148: T__35\n t__35!\n\n when 25\n # at line 1:154: T__36\n t__36!\n\n when 26\n # at line 1:160: T__37\n t__37!\n\n when 27\n # at line 1:166: T__38\n t__38!\n\n when 28\n # at line 1:172: T__39\n t__39!\n\n when 29\n # at line 1:178: T__40\n t__40!\n\n when 30\n # at line 1:184: T__41\n t__41!\n\n when 31\n # at line 1:190: T__42\n t__42!\n\n when 32\n # at line 1:196: T__43\n t__43!\n\n when 33\n # at line 1:202: T__44\n t__44!\n\n when 34\n # at line 1:208: T__45\n t__45!\n\n when 35\n # at line 1:214: T__46\n t__46!\n\n when 36\n # at line 1:220: T__47\n t__47!\n\n when 37\n # at line 1:226: T__48\n t__48!\n\n when 38\n # at line 1:232: T__49\n t__49!\n\n when 39\n # at line 1:238: T__50\n t__50!\n\n when 40\n # at line 1:244: T__51\n t__51!\n\n when 41\n # at line 1:250: T__52\n t__52!\n\n when 42\n # at line 1:256: T__53\n t__53!\n\n when 43\n # at line 1:262: T__54\n t__54!\n\n when 44\n # at line 1:268: T__55\n t__55!\n\n when 45\n # at line 1:274: T__56\n t__56!\n\n when 46\n # at line 1:280: T__57\n t__57!\n\n when 47\n # at line 1:286: T__58\n t__58!\n\n when 48\n # at line 1:292: T__59\n t__59!\n\n when 49\n # at line 1:298: ST\n st!\n\n when 50\n # at line 1:301: ND\n nd!\n\n when 51\n # at line 1:304: RD\n rd!\n\n when 52\n # at line 1:307: TH\n th!\n\n when 53\n # at line 1:310: DIGIT\n digit!\n\n when 54\n # at line 1:316: WS\n ws!\n\n when 55\n # at line 1:319: EOL\n eol!\n\n when 56\n # at line 1:323: LETTER\n letter!\n\n end\n end", "def extract_magic_comments(processed_source); end", "def token!\n # at line 1:8: ( AMP | AMP_ASGN | GEQ | AND | GET | GREATER | HAT | HAT_ASGN | QMARK | ARROW | RBRACE | ASGN | IF | RBRACK | IN | BL_END | INCR | BREAK | INSTANCEOF | RETURN | IS_DEFINED | RPAREN | CASE | RSHIFT | CATCH | RSHIFT3 | COLON | LBRACE | RSHIFT3_ASGN | COMMA | LBRACK | RSHIFT_ASGN | LEQ | SEMI | CONST | LESS | SET | CONTINUE | LET | DECR | LPAREN | DEFAULT | LSHIFT | STAR | DELETE | LSHIFT_ASGN | STAR_ASGN | MACRO | SWITCH | MINUS | THIS | DO | MINUS_ASGN | THROW | DOT | TILDE | TRUE | NEQ | TRY | NEQQ | TYPEOF | NEW | EACH | NOT | UNDEFINED | ELSE | NULL | UNLESS | EQ | UNTIL | EQQ | OR | FALSE | OR_ASGN | VAR | FINALLY | VOID | FOR | PIPE | WHILE | PIPE_ASGN | WITH | FUNCTION | PLUS | YIELD | PLUS_ASGN | IS_UNDEFINED | POUND | DEF | CLASS_DEF | OBJECT_DEF | T__148 | T__149 | T__150 | MOD | SLASH | DOC | STRING | NUMBER | NEWLINE | IVAR | ID | WS | EJS )\n alt_72 = 104\n alt_72 = @dfa72.predict( @input )\n case alt_72\n when 1\n # at line 1:10: AMP\n amp!\n\n when 2\n # at line 1:14: AMP_ASGN\n amp_asgn!\n\n when 3\n # at line 1:23: GEQ\n geq!\n\n when 4\n # at line 1:27: AND\n and!\n\n when 5\n # at line 1:31: GET\n get!\n\n when 6\n # at line 1:35: GREATER\n greater!\n\n when 7\n # at line 1:43: HAT\n hat!\n\n when 8\n # at line 1:47: HAT_ASGN\n hat_asgn!\n\n when 9\n # at line 1:56: QMARK\n qmark!\n\n when 10\n # at line 1:62: ARROW\n arrow!\n\n when 11\n # at line 1:68: RBRACE\n rbrace!\n\n when 12\n # at line 1:75: ASGN\n asgn!\n\n when 13\n # at line 1:80: IF\n if!\n\n when 14\n # at line 1:83: RBRACK\n rbrack!\n\n when 15\n # at line 1:90: IN\n in!\n\n when 16\n # at line 1:93: BL_END\n bl_end!\n\n when 17\n # at line 1:100: INCR\n incr!\n\n when 18\n # at line 1:105: BREAK\n break!\n\n when 19\n # at line 1:111: INSTANCEOF\n instanceof!\n\n when 20\n # at line 1:122: RETURN\n return!\n\n when 21\n # at line 1:129: IS_DEFINED\n is_defined!\n\n when 22\n # at line 1:140: RPAREN\n rparen!\n\n when 23\n # at line 1:147: CASE\n case!\n\n when 24\n # at line 1:152: RSHIFT\n rshift!\n\n when 25\n # at line 1:159: CATCH\n catch!\n\n when 26\n # at line 1:165: RSHIFT3\n rshift_3!\n\n when 27\n # at line 1:173: COLON\n colon!\n\n when 28\n # at line 1:179: LBRACE\n lbrace!\n\n when 29\n # at line 1:186: RSHIFT3_ASGN\n rshift_3_asgn!\n\n when 30\n # at line 1:199: COMMA\n comma!\n\n when 31\n # at line 1:205: LBRACK\n lbrack!\n\n when 32\n # at line 1:212: RSHIFT_ASGN\n rshift_asgn!\n\n when 33\n # at line 1:224: LEQ\n leq!\n\n when 34\n # at line 1:228: SEMI\n semi!\n\n when 35\n # at line 1:233: CONST\n const!\n\n when 36\n # at line 1:239: LESS\n less!\n\n when 37\n # at line 1:244: SET\n set!\n\n when 38\n # at line 1:248: CONTINUE\n continue!\n\n when 39\n # at line 1:257: LET\n let!\n\n when 40\n # at line 1:261: DECR\n decr!\n\n when 41\n # at line 1:266: LPAREN\n lparen!\n\n when 42\n # at line 1:273: DEFAULT\n default!\n\n when 43\n # at line 1:281: LSHIFT\n lshift!\n\n when 44\n # at line 1:288: STAR\n star!\n\n when 45\n # at line 1:293: DELETE\n delete!\n\n when 46\n # at line 1:300: LSHIFT_ASGN\n lshift_asgn!\n\n when 47\n # at line 1:312: STAR_ASGN\n star_asgn!\n\n when 48\n # at line 1:322: MACRO\n macro!\n\n when 49\n # at line 1:328: SWITCH\n switch!\n\n when 50\n # at line 1:335: MINUS\n minus!\n\n when 51\n # at line 1:341: THIS\n this!\n\n when 52\n # at line 1:346: DO\n do!\n\n when 53\n # at line 1:349: MINUS_ASGN\n minus_asgn!\n\n when 54\n # at line 1:360: THROW\n throw!\n\n when 55\n # at line 1:366: DOT\n dot!\n\n when 56\n # at line 1:370: TILDE\n tilde!\n\n when 57\n # at line 1:376: TRUE\n true!\n\n when 58\n # at line 1:381: NEQ\n neq!\n\n when 59\n # at line 1:385: TRY\n try!\n\n when 60\n # at line 1:389: NEQQ\n neqq!\n\n when 61\n # at line 1:394: TYPEOF\n typeof!\n\n when 62\n # at line 1:401: NEW\n new!\n\n when 63\n # at line 1:405: EACH\n each!\n\n when 64\n # at line 1:410: NOT\n not!\n\n when 65\n # at line 1:414: UNDEFINED\n undefined!\n\n when 66\n # at line 1:424: ELSE\n else!\n\n when 67\n # at line 1:429: NULL\n null!\n\n when 68\n # at line 1:434: UNLESS\n unless!\n\n when 69\n # at line 1:441: EQ\n eq!\n\n when 70\n # at line 1:444: UNTIL\n until!\n\n when 71\n # at line 1:450: EQQ\n eqq!\n\n when 72\n # at line 1:454: OR\n or!\n\n when 73\n # at line 1:457: FALSE\n false!\n\n when 74\n # at line 1:463: OR_ASGN\n or_asgn!\n\n when 75\n # at line 1:471: VAR\n var!\n\n when 76\n # at line 1:475: FINALLY\n finally!\n\n when 77\n # at line 1:483: VOID\n void!\n\n when 78\n # at line 1:488: FOR\n for!\n\n when 79\n # at line 1:492: PIPE\n pipe!\n\n when 80\n # at line 1:497: WHILE\n while!\n\n when 81\n # at line 1:503: PIPE_ASGN\n pipe_asgn!\n\n when 82\n # at line 1:513: WITH\n with!\n\n when 83\n # at line 1:518: FUNCTION\n function!\n\n when 84\n # at line 1:527: PLUS\n plus!\n\n when 85\n # at line 1:532: YIELD\n yield!\n\n when 86\n # at line 1:538: PLUS_ASGN\n plus_asgn!\n\n when 87\n # at line 1:548: IS_UNDEFINED\n is_undefined!\n\n when 88\n # at line 1:561: POUND\n pound!\n\n when 89\n # at line 1:567: DEF\n def!\n\n when 90\n # at line 1:571: CLASS_DEF\n class_def!\n\n when 91\n # at line 1:581: OBJECT_DEF\n object_def!\n\n when 92\n # at line 1:592: T__148\n t__148!\n\n when 93\n # at line 1:599: T__149\n t__149!\n\n when 94\n # at line 1:606: T__150\n t__150!\n\n when 95\n # at line 1:613: MOD\n mod!\n\n when 96\n # at line 1:617: SLASH\n slash!\n\n when 97\n # at line 1:623: DOC\n doc!\n\n when 98\n # at line 1:627: STRING\n string!\n\n when 99\n # at line 1:634: NUMBER\n number!\n\n when 100\n # at line 1:641: NEWLINE\n newline!\n\n when 101\n # at line 1:649: IVAR\n ivar!\n\n when 102\n # at line 1:654: ID\n id!\n\n when 103\n # at line 1:657: WS\n ws!\n\n when 104\n # at line 1:660: EJS\n ejs!\n\n end\n end", "def SomeClass explainMore\n p \"no comment\"\n end", "def test; end", "def auto_analyze=(_arg0); end", "def p15\n\t\nend", "def test_dsl_5\n #---------------------------\n show Spock + (Lizard + Rock)\n #---------------------------\n assert_equal \\\n \"Rock crushes Lizard (winner Rock)\\n\" \\\n \"Spock vaporizes Rock (winner Spock)\\n\" \\\n \"Result = Spock\\n\", \\\n @out.string\n end", "def lex_en_line_comment=(_arg0); end", "def lex_en_line_comment=(_arg0); end", "def lex_en_line_comment=(_arg0); end", "def define_python_methods\r\n @p.Execute(\"\r\ndef foo(x):\r\n return x + x\r\n\r\ndef bar(x):\r\n return x * x\r\n\"\r\n )\r\nend", "def xxxtest_function_prototype_on_more_than_one_line\r\n length = initialize_length(\r\n <<-EOD\r\n func_prototype(\r\n int myCat,\r\n boolean huh\r\n );\r\n EOD\r\n )\r\n assert_equal(nil, length.counts['func_prototype'])\r\n assert_equal(5, length.counts['global'])\r\n end", "def variable_or_method_use(method)\n \t_IDENTIFIER13 = nil\n\n\n\n\n \t name = \"\"\n \t is_method = false\n\n\n # 254:7: ( 'this' '.' )? ( IDENTIFIER ) ( fragment_of_variable_or_method_name[name] )* ( '(' ')' )?\n # 254:7: ( 'this' '.' )?\n alt35 = 2\n # 254:7: ( 'this' '.' )?\n look_ahead35_0 = look_ahead(1)\n\n if look_ahead35_0 == :T58 \n alt35 = 1\n end\n case alt35\n when 1\n # 254:9: 'this' '.'\n match(:T58)\n match(:DOT)\n name << \"this.\" \n end\n # 255:9: IDENTIFIER\n _IDENTIFIER13 = @input.look_ahead(1)\n match(:IDENTIFIER)\n name << _IDENTIFIER13.text \n # 256:7: ( fragment_of_variable_or_method_name[name] )*\n while true\n alt36 = 2\n # ()* loopback of 256:7: ( fragment_of_variable_or_method_name[name] )*\n look_ahead36_0 = look_ahead(1)\n if look_ahead36_0 == :DOT \n alt36 = 1\n end\n case alt36\n when 1\n # 256:7: fragment_of_variable_or_method_name[name]\n fragment_of_variable_or_method_name(name)\n\n else\n break\n end\n end\n # 257:7: ( '(' ')' )?\n alt37 = 2\n # 257:7: ( '(' ')' )?\n look_ahead37_0 = look_ahead(1)\n\n if look_ahead37_0 == :LEFT_PARENTESIS \n # 257:7: ( '(' ')' )?\n look_ahead37_1 = look_ahead(2)\n\n if look_ahead37_1 == :RIGHT_PARENTESIS \n alt37 = 1\n end\n end\n case alt37\n when 1\n # 257:9: '(' ')'\n match(:LEFT_PARENTESIS)\n match(:RIGHT_PARENTESIS)\n is_method = true\n end\n\n if is_method\n method.add_method_call(name, _IDENTIFIER13.line)\n\n else\n method.add_use_of(name, _IDENTIFIER13.line)\n end\n \n\n\n\n end", "def method_source(mnemonic, flags, sample, prefix)\n\t\"\"\"// Mnemonic: #{sample}\n// Sets Flags: #{flags}\nfunc (p *GBProcessor) #{prefix}#{mnemonic}(opcode byte, params ...byte) {\n\n}\"\"\"\nend", "def codepoints()\n #This is a stub, used for indexing\n end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def method_definition(class_def)\n \t_IDENTIFIER7 = nil\n\n\n\n\n \t method = MethodDefinition.new\n\n\n # 123:5: modifier[method] ( type[method] )? IDENTIFIER parameters[method] ( method_body[method] | ';' )\n modifier(method)\n\n # 123:22: ( type[method] )?\n alt16 = 2\n # 123:22: ( type[method] )?\n look_ahead16_0 = look_ahead(1)\n\n if look_ahead16_0 == :IDENTIFIER \n # 123:22: ( type[method] )?\n look_ahead16_1 = look_ahead(2)\n\n if look_ahead16_1 == :IDENTIFIER || look_ahead16_1 == :LEFT_ANGULAR_BRACKET || (TOKENS[look_ahead16_1] >= 34 && TOKENS[look_ahead16_1] <= 35) \n alt16 = 1\n end\n end\n case alt16\n when 1\n # 123:23: type[method]\n type(method)\n\n end\n _IDENTIFIER7 = @input.look_ahead(1)\n match(:IDENTIFIER)\n parameters(method)\n\n # 123:68: ( method_body[method] | ';' )\n alt17 = 2\n # 123:68: ( method_body[method] | ';' )\n look_ahead17_0 = look_ahead(1)\n if look_ahead17_0 == :LEFT_BRACE \n alt17 = 1\n elsif look_ahead17_0 == :SEMICOLON \n alt17 = 2\n else\n raise \"Expected: 123:68: ( method_body[method] | ';' )\"\n end\n case alt17\n when 1\n # 123:69: method_body[method]\n method_body(method)\n\n when 2\n # 123:89: ';'\n match(:SEMICOLON)\n end\n\n method.name = _IDENTIFIER7.text\n method.line = _IDENTIFIER7.line\n class_def.add_member(method)\n \n\n\n\n end", "def code_point; end", "def docufy(src,i)\n m = /RM_[A-z0-9]+/.match(src[i])\n name = m[0]\n name = name.sub(\"RM_\",\"RedisModule_\")\n proto = src[i].sub(\"{\",\"\").strip+\";\\n\"\n proto = proto.sub(\"RM_\",\"RedisModule_\")\n proto = linebreak_proto(proto, \" \");\n # Add a link target with the function name. (We don't trust the exact id of\n # the generated one, which depends on the Markdown implementation.)\n puts \"<span id=\\\"#{name}\\\"></span>\\n\\n\"\n puts \"### `#{name}`\\n\\n\"\n puts \" #{proto}\\n\"\n puts \"**Available since:** #{$since[name] or \"unreleased\"}\\n\\n\"\n comment = \"\"\n while true\n i = i-1\n comment = src[i]+comment\n break if src[i] =~ /\\/\\*/\n end\n comment = markdown(comment)\n puts comment+\"\\n\\n\"\nend", "def multiline_comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 50 )\n\n\n\n type = MULTILINE_COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 229:21: '/*' ( . )* '*/'\n match( \"/*\" )\n\n # at line 229:26: ( . )*\n while true # decision 7\n alt_7 = 2\n look_7_0 = @input.peek( 1 )\n\n if ( look_7_0 == 0x2a )\n look_7_1 = @input.peek( 2 )\n\n if ( look_7_1 == 0x2f )\n alt_7 = 2\n elsif ( look_7_1.between?( 0x0, 0x2e ) || look_7_1.between?( 0x30, 0xffff ) )\n alt_7 = 1\n\n end\n elsif ( look_7_0.between?( 0x0, 0x29 ) || look_7_0.between?( 0x2b, 0xffff ) )\n alt_7 = 1\n\n end\n case alt_7\n when 1\n # at line 229:26: .\n match_any\n\n else\n break # out of loop for decision 7\n end\n end # loop for decision 7\n\n\n match( \"*/\" )\n\n\n # --> action\n channel = HIDDEN;\n # <-- action\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 50 )\n\n\n end", "def chunk_char!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 14 )\n\n \n # - - - - main rule block - - - -\n # at line 68:3: (~ ( '>' | '<' | '#' | '`' | '\\\"' | '\\\\'' | '|' | '(' | ')' | '$' | ';' | ' ' | '?' | '*' | '~' | '\\\\\\\\' | '\\\\t' | '{' | '}' | '\\\\n' | '\\\\r' ) | '\\\\\\\\' . )\n alt_23 = 2\n look_23_0 = @input.peek( 1 )\n\n if ( look_23_0.between?( 0x0, 0x8 ) || look_23_0.between?( 0xb, 0xc ) || look_23_0.between?( 0xe, 0x1f ) || look_23_0 == 0x21 || look_23_0.between?( 0x25, 0x26 ) || look_23_0.between?( 0x2b, 0x3a ) || look_23_0 == 0x3d || look_23_0.between?( 0x40, 0x5b ) || look_23_0.between?( 0x5d, 0x5f ) || look_23_0.between?( 0x61, 0x7a ) || look_23_0.between?( 0x7f, 0xffff ) )\n alt_23 = 1\n elsif ( look_23_0 == 0x5c )\n alt_23 = 2\n else\n raise NoViableAlternative( \"\", 23, 0 )\n end\n case alt_23\n when 1\n # at line 68:5: ~ ( '>' | '<' | '#' | '`' | '\\\"' | '\\\\'' | '|' | '(' | ')' | '$' | ';' | ' ' | '?' | '*' | '~' | '\\\\\\\\' | '\\\\t' | '{' | '}' | '\\\\n' | '\\\\r' )\n if @input.peek( 1 ).between?( 0x0, 0x8 ) || @input.peek( 1 ).between?( 0xb, 0xc ) || @input.peek( 1 ).between?( 0xe, 0x1f ) || @input.peek(1) == 0x21 || @input.peek( 1 ).between?( 0x25, 0x26 ) || @input.peek( 1 ).between?( 0x2b, 0x3a ) || @input.peek(1) == 0x3d || @input.peek( 1 ).between?( 0x40, 0x5b ) || @input.peek( 1 ).between?( 0x5d, 0x5f ) || @input.peek( 1 ).between?( 0x61, 0x7a ) || @input.peek( 1 ).between?( 0x7f, 0xff )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n\n when 2\n # at line 70:5: '\\\\\\\\' .\n match( 0x5c )\n match_any\n\n end\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 14 )\n\n end", "def as_you_like_it_quote; end", "def token!\n # at line 1:8: ( STRING | SHELL_STRING | CMD_OUTPUT | SPACE | COMMAND_END | VARIABLE | GLOB | CHUNK | OPEN_PAR | CLOSE_PAR | PIPELINE_OPERATOR | REDIRECT | COMMENT )\n alt_25 = 13\n alt_25 = @dfa25.predict( @input )\n case alt_25\n when 1\n # at line 1:10: STRING\n string!\n\n when 2\n # at line 1:17: SHELL_STRING\n shell_string!\n\n when 3\n # at line 1:30: CMD_OUTPUT\n cmd_output!\n\n when 4\n # at line 1:41: SPACE\n space!\n\n when 5\n # at line 1:47: COMMAND_END\n command_end!\n\n when 6\n # at line 1:59: VARIABLE\n variable!\n\n when 7\n # at line 1:68: GLOB\n glob!\n\n when 8\n # at line 1:73: CHUNK\n chunk!\n\n when 9\n # at line 1:79: OPEN_PAR\n open_par!\n\n when 10\n # at line 1:88: CLOSE_PAR\n close_par!\n\n when 11\n # at line 1:98: PIPELINE_OPERATOR\n pipeline_operator!\n\n when 12\n # at line 1:116: REDIRECT\n redirect!\n\n when 13\n # at line 1:125: COMMENT\n comment!\n\n end\n end", "def preprocess\n lineno = 0\n shouldWrite = false\n inFunction = false\n printer = File.open(RB_FILE,'w')\n scanner = File.open(TEX_FILE,'r')\n if printer && scanner\n printer.puts RB_REQUIRE\n scanner.each_line do |line|\n lineno = lineno + 1\n if (line.include? TEX_ENV_01_E) && !determineTexCommented(line, TEX_ENV_01_E)\n puts \"Encountered #{TEX_ENV_01_E} on line #{lineno}\"\n shouldWrite = false\n end\n if shouldWrite\n stripped = line.strip\n if (stripped.include? TEX_MOD) && !determineRubyCommented(stripped, TEX_MOD) && !inFunction\n printer.print appendLineNumberToTexPrintCall(stripped, lineno)\n elsif (stripped.include? RB_CLASS_CREATE) && !determineRubyCommented(stripped, RB_CLASS_CREATE) && !inFunction\n printer.print appendLineNumberToInitialization(stripped, lineno)\n elsif (stripped.include? RB_METHOD_S) && !determineRubyCommented(stripped, RB_METHOD_S) && !inFunction\n puts \"Processing function definition: found line containing #{stripped}\"\n inFunction = true\n extracted = extractFunctionMeta stripped\n $fcnref.store(extracted[0], extracted[1])\n $defstack.push 1\n if (stripped.include? '(') && (stripped.include? ')')\n puts \"Injection into formatted def as \\( \\)! Boo!\"\n else\n puts \"Injection into formatted def as _,_! This is preferrable.\"\n end\n printer.print appendLineNumberArgToFunctionDefinition stripped\n elsif inFunction\n puts \"Parsing #{stripped} inside function...\"\n printer.print stripped\n if (line.include? TEX_MOD) && !determineRubyCommented(line, \"Tex\")\n printer.print \", #{RBTEX_INSERT_LINE}\"\n end\n RB_KEYWORD_END.each do |kwd|\n if line.include? kwd\n puts \"Encountered '#{kwd}'; pushing onto stack...\"\n $defstack.push 1\n break\n end\n end\n if line.include? 'end'\n puts \"Encountered 'end'; popping off of stack...\"\n $defstack.pop\n end\n inFunction = $defstack.any?\n else\n print \"STRIPPED: #{stripped}\\t\"\n deffed = false\n printer.print stripped\n $fcnref.each do |fcn, args|\n if stripped.include? fcn\n if (line.include? '(') && (line.include? ')')\n\n else\n printer.print (args != 0) ? (\", #{lineno}\") : (\" #{lineno}\")\n break\n end\n end\n end\n end\n printer.puts \"\"\n end\n if (line.include? TEX_ENV_01_S) && !determineTexCommented(line, TEX_ENV_01_S)\n puts \"Encountered #{TEX_ENV_01_S} on line #{lineno}\"\n $rbenvs = $rbenvs + 1\n shouldWrite = true\n end\n end\n end\n printer.close\n scanner.close\n return 0\nend", "def buzzword; end", "def buzzword; end", "def p(string);end", "def ruby_code(obj); end", "def ml_comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 40)\n\n type = ML_COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 478:4: '/*' ( . )* '*/'\n match(\"/*\")\n # --> action\n if @input.peek(1) == ?* then type = DOC_COMMENT else channel = HIDDEN end \n # <-- action\n # at line 478:88: ( . )*\n loop do #loop 4\n alt_4 = 2\n look_4_0 = @input.peek(1)\n\n if (look_4_0 == ?*) \n look_4_1 = @input.peek(2)\n\n if (look_4_1 == ?/) \n alt_4 = 2\n elsif (look_4_1.between?(0x0000, ?.) || look_4_1.between?(?0, 0xFFFF)) \n alt_4 = 1\n\n end\n elsif (look_4_0.between?(0x0000, ?)) || look_4_0.between?(?+, 0xFFFF)) \n alt_4 = 1\n\n end\n case alt_4\n when 1\n # at line 478:88: .\n match_any\n\n else\n break #loop 4\n end\n end\n match(\"*/\")\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__, 40)\n\n end", "def generalized_delimiter!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 110 )\n\n \n # - - - - main rule block - - - -\n # at line 991:3: ( NESTED_PARENTHESES | NESTED_BRACKETS | NESTED_BRACES | NESTED_ANGLES | ( '!' | '@' | '~' | '`' | '^' | '&' | '*' | '-' | '+' | '=' | '|' | ':' | ';' | '.' | ',' | '?' | '/' | '\\\"' | '\\\\'' ) )\n alt_65 = 5\n case look_65 = @input.peek( 1 )\n when 0x28 then alt_65 = 1\n when 0x5b then alt_65 = 2\n when 0x7b then alt_65 = 3\n when 0x3c then alt_65 = 4\n when 0x21, 0x22, 0x26, 0x27, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x3a, 0x3b, 0x3d, 0x3f, 0x40, 0x5e, 0x60, 0x7c, 0x7e then alt_65 = 5\n else\n raise NoViableAlternative( \"\", 65, 0 )\n end\n case alt_65\n when 1\n # at line 991:5: NESTED_PARENTHESES\n nested_parentheses!\n\n when 2\n # at line 992:5: NESTED_BRACKETS\n nested_brackets!\n\n when 3\n # at line 993:5: NESTED_BRACES\n nested_braces!\n\n when 4\n # at line 994:5: NESTED_ANGLES\n nested_angles!\n\n when 5\n # at line 995:5: ( '!' | '@' | '~' | '`' | '^' | '&' | '*' | '-' | '+' | '=' | '|' | ':' | ';' | '.' | ',' | '?' | '/' | '\\\"' | '\\\\'' )\n if @input.peek( 1 ).between?( 0x21, 0x22 ) || @input.peek( 1 ).between?( 0x26, 0x27 ) || @input.peek( 1 ).between?( 0x2a, 0x2f ) || @input.peek( 1 ).between?( 0x3a, 0x3b ) || @input.peek(1) == 0x3d || @input.peek( 1 ).between?( 0x3f, 0x40 ) || @input.peek(1) == 0x5e || @input.peek(1) == 0x60 || @input.peek(1) == 0x7c || @input.peek(1) == 0x7e\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n # --> action\n scan_until_delimiter( @input.peek( -1 ) ) \n # <-- action\n\n end\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 110 )\n\n end", "def token!\n # at line 1:8: ( T__8 | T__9 | T__10 | T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | T__31 | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | T__38 | T__39 | T__40 | T__41 | T__42 | T__43 | DIGIT | WS | EOL | LETTER )\n alt_3 = 40\n alt_3 = @dfa3.predict( @input )\n case alt_3\n when 1\n # at line 1:10: T__8\n t__8!\n\n when 2\n # at line 1:15: T__9\n t__9!\n\n when 3\n # at line 1:20: T__10\n t__10!\n\n when 4\n # at line 1:26: T__11\n t__11!\n\n when 5\n # at line 1:32: T__12\n t__12!\n\n when 6\n # at line 1:38: T__13\n t__13!\n\n when 7\n # at line 1:44: T__14\n t__14!\n\n when 8\n # at line 1:50: T__15\n t__15!\n\n when 9\n # at line 1:56: T__16\n t__16!\n\n when 10\n # at line 1:62: T__17\n t__17!\n\n when 11\n # at line 1:68: T__18\n t__18!\n\n when 12\n # at line 1:74: T__19\n t__19!\n\n when 13\n # at line 1:80: T__20\n t__20!\n\n when 14\n # at line 1:86: T__21\n t__21!\n\n when 15\n # at line 1:92: T__22\n t__22!\n\n when 16\n # at line 1:98: T__23\n t__23!\n\n when 17\n # at line 1:104: T__24\n t__24!\n\n when 18\n # at line 1:110: T__25\n t__25!\n\n when 19\n # at line 1:116: T__26\n t__26!\n\n when 20\n # at line 1:122: T__27\n t__27!\n\n when 21\n # at line 1:128: T__28\n t__28!\n\n when 22\n # at line 1:134: T__29\n t__29!\n\n when 23\n # at line 1:140: T__30\n t__30!\n\n when 24\n # at line 1:146: T__31\n t__31!\n\n when 25\n # at line 1:152: T__32\n t__32!\n\n when 26\n # at line 1:158: T__33\n t__33!\n\n when 27\n # at line 1:164: T__34\n t__34!\n\n when 28\n # at line 1:170: T__35\n t__35!\n\n when 29\n # at line 1:176: T__36\n t__36!\n\n when 30\n # at line 1:182: T__37\n t__37!\n\n when 31\n # at line 1:188: T__38\n t__38!\n\n when 32\n # at line 1:194: T__39\n t__39!\n\n when 33\n # at line 1:200: T__40\n t__40!\n\n when 34\n # at line 1:206: T__41\n t__41!\n\n when 35\n # at line 1:212: T__42\n t__42!\n\n when 36\n # at line 1:218: T__43\n t__43!\n\n when 37\n # at line 1:224: DIGIT\n digit!\n\n when 38\n # at line 1:230: WS\n ws!\n\n when 39\n # at line 1:233: EOL\n eol!\n\n when 40\n # at line 1:237: LETTER\n letter!\n\n end\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 function_literal\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 70 )\n return_value = FunctionLiteralReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n string_literal333 = nil\n string_literal337 = nil\n variable_name334 = nil\n function_parameters335 = nil\n statement_block336 = nil\n variable_name338 = nil\n function_parameters339 = nil\n statement_block340 = nil\n\n tree_for_string_literal333 = nil\n tree_for_string_literal337 = nil\n\n begin\n # at line 715:3: ( 'function' ( variable_name )? function_parameters statement_block | '->' ( variable_name )? ( function_parameters )? statement_block )\n alt_86 = 2\n look_86_0 = @input.peek( 1 )\n\n if ( look_86_0 == FUNCTION )\n alt_86 = 1\n elsif ( look_86_0 == ARROW )\n alt_86 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 86, 0 )\n end\n case alt_86\n when 1\n root_0 = @adaptor.create_flat_list\n\n\n # at line 715:5: 'function' ( variable_name )? function_parameters statement_block\n string_literal333 = match( FUNCTION, TOKENS_FOLLOWING_FUNCTION_IN_function_literal_5064 )\n if @state.backtracking == 0\n\n tree_for_string_literal333 = @adaptor.create_with_payload( string_literal333 )\n root_0 = @adaptor.become_root( tree_for_string_literal333, root_0 )\n\n end\n # at line 715:17: ( variable_name )?\n alt_83 = 2\n look_83_0 = @input.peek( 1 )\n\n if ( look_83_0 == GET || look_83_0 == SET || look_83_0 == MACRO || look_83_0 == EACH || look_83_0.between?( DEF, OBJECT_DEF ) || look_83_0 == ID || look_83_0.between?( T__148, T__150 ) )\n alt_83 = 1\n end\n case alt_83\n when 1\n # at line 715:17: variable_name\n @state.following.push( TOKENS_FOLLOWING_variable_name_IN_function_literal_5067 )\n variable_name334 = variable_name\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, variable_name334.tree )\n end\n\n end\n @state.following.push( TOKENS_FOLLOWING_function_parameters_IN_function_literal_5070 )\n function_parameters335 = function_parameters\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, function_parameters335.tree )\n end\n @state.following.push( TOKENS_FOLLOWING_statement_block_IN_function_literal_5072 )\n statement_block336 = statement_block\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, statement_block336.tree )\n end\n\n when 2\n root_0 = @adaptor.create_flat_list\n\n\n # at line 716:5: '->' ( variable_name )? ( function_parameters )? statement_block\n string_literal337 = match( ARROW, TOKENS_FOLLOWING_ARROW_IN_function_literal_5078 )\n if @state.backtracking == 0\n\n tree_for_string_literal337 = @adaptor.create_with_payload( string_literal337 )\n root_0 = @adaptor.become_root( tree_for_string_literal337, root_0 )\n\n end\n # at line 716:11: ( variable_name )?\n alt_84 = 2\n look_84_0 = @input.peek( 1 )\n\n if ( look_84_0 == GET || look_84_0 == SET || look_84_0 == MACRO || look_84_0 == EACH || look_84_0.between?( DEF, OBJECT_DEF ) || look_84_0 == ID || look_84_0.between?( T__148, T__150 ) )\n alt_84 = 1\n end\n case alt_84\n when 1\n # at line 716:11: variable_name\n @state.following.push( TOKENS_FOLLOWING_variable_name_IN_function_literal_5081 )\n variable_name338 = variable_name\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, variable_name338.tree )\n end\n\n end\n # at line 716:26: ( function_parameters )?\n alt_85 = 2\n look_85_0 = @input.peek( 1 )\n\n if ( look_85_0 == LPAREN )\n alt_85 = 1\n end\n case alt_85\n when 1\n # at line 716:26: function_parameters\n @state.following.push( TOKENS_FOLLOWING_function_parameters_IN_function_literal_5084 )\n function_parameters339 = function_parameters\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, function_parameters339.tree )\n end\n\n end\n @state.following.push( TOKENS_FOLLOWING_statement_block_IN_function_literal_5087 )\n statement_block340 = statement_block\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, statement_block340.tree )\n end\n\n end# - - - - - - - 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__, 70 )\n\n end\n \n return return_value\n end", "def comments_hash_flag=(_arg0); end", "def comment_keywords\n if self =~ /(select)/i\n foo=$1\n newstr = self.gsub(foo, \"/*#{foo}*/\")\n else\n newstr = self\n end\n if newstr =~ /(update)/i\n foo=$1\n newstr = newstr.gsub!(foo, \"/*#{foo}*/\")\n end\n if newstr =~ /(insert)/i\n foo=$1\n newstr = newstr.gsub!(foo, \"/*#{foo}*/\")\n end\n if newstr =~ /(delete)/i\n foo=$1\n newstr = newstr.gsub!(foo, \"/*#{foo}*/\")\n end\n if newstr =~ /(union)/i\n foo=$1\n newstr = newstr.gsub!(foo, \"/*#{foo}*/\")\n end\n if newstr =~ /[, ](concat)/i\n foo=$1\n newstr = newstr.gsub!(foo, \"/*#{foo}*/\")\n end\n if newstr =~ /(group_concat)/i\n foo=$1\n newstr = newstr.gsub!(foo, \"/*#{foo}*/\")\n end\n if newstr =~ /(information_schema)/i\n foo=$1\n newstr = newstr.gsub!(foo, \"/*#{foo}*/\")\n end\n if newstr =~ /(cast)/i\n foo=$1\n newstr = newstr.gsub!(foo, \"/*#{foo}*/\")\n end\n if newstr =~ /(convert)/i\n foo=$1\n newstr = newstr.gsub!(foo, \"/*#{foo}*/\")\n end\n if newstr =~ /(substring)/i\n foo=$1\n newstr = newstr.gsub!(foo, \"/*#{foo}*/\")\n end\n if newstr =~ /(sleep)/i\n foo=$1\n newstr = newstr.gsub!(foo, \"/*#{foo}*/\")\n end\n if newstr =~ /(benchmark)/i\n foo=$1\n newstr = newstr.gsub!(foo, \"/*#{foo}*/\")\n end\n return newstr\n end", "def comments_hash_flag=(_arg0); end", "def test_method\n \"Here is the sample input\"\n end", "def create_comment(string, &block); end", "def create_comment(string, &block); end", "def test_test_el__debug_ruby_eval_report\n actual = with_temp_buffer_string {\n el4r_lisp_eval %q((progn\n(el4r-debug-ruby-eval-report \"nil\")\n(el4r-debug-ruby-eval-report \"true\")\n(el4r-debug-ruby-eval-report \"false\")\n(el4r-debug-ruby-eval-report \"1 + 6\")\n(el4r-debug-ruby-eval-report \"\\\"String\\\"\")\n))\n }\n expected = <<EOB\nnil\n => nil\ntrue\n => t\nfalse\n => nil\n1 + 6\n => 7\n\"String\"\n => \"String\"\nEOB\n assert_equal(expected, actual)\n end", "def fix_syntax_errors!\n # 1.34\n # patch_file! \"common/on_actions/00_on_actions.txt\" do |content|\n # content.gsub(/(effect = )\"(.*?)\"/m){ $1 + \"{\" + $2 + \"}\" }\n # end\n end", "def token!\n # at line 1:8: ( T__10 | T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | CONSTANT | ID | TEMPLATE | STRING | COMMENT | WS )\n alt_12 = 16\n alt_12 = @dfa12.predict(@input)\n case alt_12\n when 1\n # at line 1:10: T__10\n t__10!\n\n when 2\n # at line 1:16: T__11\n t__11!\n\n when 3\n # at line 1:22: T__12\n t__12!\n\n when 4\n # at line 1:28: T__13\n t__13!\n\n when 5\n # at line 1:34: T__14\n t__14!\n\n when 6\n # at line 1:40: T__15\n t__15!\n\n when 7\n # at line 1:46: T__16\n t__16!\n\n when 8\n # at line 1:52: T__17\n t__17!\n\n when 9\n # at line 1:58: T__18\n t__18!\n\n when 10\n # at line 1:64: T__19\n t__19!\n\n when 11\n # at line 1:70: CONSTANT\n constant!\n\n when 12\n # at line 1:79: ID\n id!\n\n when 13\n # at line 1:82: TEMPLATE\n template!\n\n when 14\n # at line 1:91: STRING\n string!\n\n when 15\n # at line 1:98: COMMENT\n comment!\n\n when 16\n # at line 1:106: WS\n ws!\n\n end\n end", "def test_additon_w_funcall\n# assert_eq \"helloworld\\n\", interpret(\"'hello' + echo('world')\")\n end", "def token!\n # at line 1:8: ( T__62 | T__63 | T__64 | T__65 | STRING | TO_INT | TO_FLOAT | READ | PRINT | PRINTL | PRINTLN | TRUE | FALSE | FOR | IF | ELSE | ELIF | ELSEIF | WHILE | DO | RETURN | EXIT | BREAK | CONTINUE | CLASS | SUPERCLASS | NEW | ID | INT | COMMENT | WS | LB | RB | LCB | RCB | QUOTE | COMMA | DOT | COLON | SEMICOLON | ASSIGN | PLUS | MINUS | MUL | DIV | MOD | EQ | NE | LT | GT | LE | GE | AND | OR | NOT | QM )\n alt_16 = 56\n alt_16 = @dfa16.predict( @input )\n case alt_16\n when 1\n # at line 1:10: T__62\n t__62!\n\n when 2\n # at line 1:16: T__63\n t__63!\n\n when 3\n # at line 1:22: T__64\n t__64!\n\n when 4\n # at line 1:28: T__65\n t__65!\n\n when 5\n # at line 1:34: STRING\n string!\n\n when 6\n # at line 1:41: TO_INT\n to_int!\n\n when 7\n # at line 1:48: TO_FLOAT\n to_float!\n\n when 8\n # at line 1:57: READ\n read!\n\n when 9\n # at line 1:62: PRINT\n print!\n\n when 10\n # at line 1:68: PRINTL\n printl!\n\n when 11\n # at line 1:75: PRINTLN\n println!\n\n when 12\n # at line 1:83: TRUE\n true!\n\n when 13\n # at line 1:88: FALSE\n false!\n\n when 14\n # at line 1:94: FOR\n for!\n\n when 15\n # at line 1:98: IF\n if!\n\n when 16\n # at line 1:101: ELSE\n else!\n\n when 17\n # at line 1:106: ELIF\n elif!\n\n when 18\n # at line 1:111: ELSEIF\n elseif!\n\n when 19\n # at line 1:118: WHILE\n while!\n\n when 20\n # at line 1:124: DO\n do!\n\n when 21\n # at line 1:127: RETURN\n return!\n\n when 22\n # at line 1:134: EXIT\n exit!\n\n when 23\n # at line 1:139: BREAK\n break!\n\n when 24\n # at line 1:145: CONTINUE\n continue!\n\n when 25\n # at line 1:154: CLASS\n class!\n\n when 26\n # at line 1:160: SUPERCLASS\n superclass!\n\n when 27\n # at line 1:171: NEW\n new!\n\n when 28\n # at line 1:175: ID\n id!\n\n when 29\n # at line 1:178: INT\n int!\n\n when 30\n # at line 1:182: COMMENT\n comment!\n\n when 31\n # at line 1:190: WS\n ws!\n\n when 32\n # at line 1:193: LB\n lb!\n\n when 33\n # at line 1:196: RB\n rb!\n\n when 34\n # at line 1:199: LCB\n lcb!\n\n when 35\n # at line 1:203: RCB\n rcb!\n\n when 36\n # at line 1:207: QUOTE\n quote!\n\n when 37\n # at line 1:213: COMMA\n comma!\n\n when 38\n # at line 1:219: DOT\n dot!\n\n when 39\n # at line 1:223: COLON\n colon!\n\n when 40\n # at line 1:229: SEMICOLON\n semicolon!\n\n when 41\n # at line 1:239: ASSIGN\n assign!\n\n when 42\n # at line 1:246: PLUS\n plus!\n\n when 43\n # at line 1:251: MINUS\n minus!\n\n when 44\n # at line 1:257: MUL\n mul!\n\n when 45\n # at line 1:261: DIV\n div!\n\n when 46\n # at line 1:265: MOD\n mod!\n\n when 47\n # at line 1:269: EQ\n eq!\n\n when 48\n # at line 1:272: NE\n ne!\n\n when 49\n # at line 1:275: LT\n lt!\n\n when 50\n # at line 1:278: GT\n gt!\n\n when 51\n # at line 1:281: LE\n le!\n\n when 52\n # at line 1:284: GE\n ge!\n\n when 53\n # at line 1:287: AND\n and!\n\n when 54\n # at line 1:291: OR\n or!\n\n when 55\n # at line 1:294: NOT\n not!\n\n when 56\n # at line 1:298: QM\n qm!\n\n end\n end", "def rubyify(sentence)\r\n\r\nend", "def verify_comment(line) \n end" ]
[ "0.85339177", "0.7283759", "0.71949273", "0.62480134", "0.60588056", "0.594318", "0.594318", "0.594318", "0.594318", "0.5935349", "0.5935349", "0.5935349", "0.5935349", "0.58191425", "0.58144915", "0.5764691", "0.57327837", "0.5720057", "0.5716596", "0.568763", "0.56681824", "0.5657993", "0.5657993", "0.5657993", "0.5657993", "0.5657993", "0.5638476", "0.56273645", "0.56031793", "0.5575978", "0.5575978", "0.55722505", "0.5551374", "0.55244076", "0.5523265", "0.5522683", "0.55022305", "0.5440103", "0.54302925", "0.5414899", "0.5413963", "0.541373", "0.54128677", "0.5405782", "0.53949946", "0.5392972", "0.5392972", "0.5392972", "0.5392418", "0.5383379", "0.5377728", "0.53771156", "0.5363525", "0.53627586", "0.53627586", "0.53627586", "0.53627586", "0.53627586", "0.53627586", "0.53627586", "0.53627586", "0.53627586", "0.53627586", "0.53627586", "0.53627586", "0.53627586", "0.53627586", "0.53627586", "0.53627586", "0.53627586", "0.53623", "0.5346136", "0.5335879", "0.5334892", "0.5325613", "0.5321359", "0.5318278", "0.5317937", "0.53175044", "0.53175044", "0.5316297", "0.5312424", "0.53121185", "0.53105366", "0.5307009", "0.53065556", "0.5298454", "0.5294849", "0.5294166", "0.5293896", "0.5291515", "0.5271906", "0.5271906", "0.5270522", "0.5266249", "0.52606875", "0.5257014", "0.5249914", "0.5237309", "0.5236525" ]
0.7403491
1
test comment ^^^ meta.function.method.witharguments.ruby keyword.control.def.ruby ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.method.witharguments.ruby entity.name.function.ruby ^ meta.function.method.witharguments.ruby variable.parameter.function.ruby ^ meta.function.method.witharguments.ruby punctuation.separator.object.ruby ^ meta.function.method.witharguments.ruby variable.parameter.function.ruby ^ meta.function.method.witharguments.ruby punctuation.separator.object.ruby ^ meta.function.method.witharguments.ruby variable.parameter.function.ruby ^ meta.function.method.witharguments.ruby keyword.operator.assignment.ruby ^ meta.function.method.witharguments.ruby punctuation.section.array.begin.ruby ^^^ meta.function.method.witharguments.ruby variable.other.ruby ^ meta.function.method.witharguments.ruby punctuation.separator.object.ruby ^^^ meta.function.method.witharguments.ruby variable.other.ruby ^ meta.function.method.witharguments.ruby punctuation.separator.object.ruby ^^^ meta.function.method.witharguments.ruby variable.other.ruby ^ meta.function.method.witharguments.ruby punctuation.section.array.end.ruby ^ punctuation.separator.statement.ruby ^^^^^ variable.other.ruby ^ punctuation.separator.object.ruby ^^^^^ variable.other.ruby ^ keyword.operator.assignment.ruby ^ punctuation.section.array.begin.ruby ^ constant.numeric.ruby ^ punctuation.separator.object.ruby ^ constant.numeric.ruby ^ punctuation.section.array.end.ruby ^^^ keyword.control.ruby ^ comment.line.numbersign.ruby punctuation.definition.comment.ruby ^^^^^^^^^^^^^ comment.line.numbersign.ruby
def method_without_parentheses a, b, c = [foo,bar,baz] # test comment # ^^^ meta.function.method.with-arguments.ruby keyword.control.def.ruby # ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.method.with-arguments.ruby entity.name.function.ruby # ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby # ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby # ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby # ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby # ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby # ^ meta.function.method.with-arguments.ruby keyword.operator.assignment.ruby # ^ meta.function.method.with-arguments.ruby punctuation.section.array.begin.ruby # ^^^ meta.function.method.with-arguments.ruby variable.other.ruby # ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby # ^^^ meta.function.method.with-arguments.ruby variable.other.ruby # ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby # ^^^ meta.function.method.with-arguments.ruby variable.other.ruby # ^ meta.function.method.with-arguments.ruby punctuation.section.array.end.ruby # ^ comment.line.number-sign.ruby punctuation.definition.comment.ruby # ^^^^^^^^^^^^^ comment.line.number-sign.ruby hello, world = [1,2] # ^^^^^ variable.other.ruby # ^ punctuation.separator.object.ruby # ^^^^^ variable.other.ruby # ^ keyword.operator.assignment.ruby # ^ punctuation.section.array.begin.ruby # ^ constant.numeric.ruby # ^ punctuation.separator.object.ruby # ^ constant.numeric.ruby # ^ punctuation.section.array.end.ruby end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def method # test comment\n# ^^^ meta.function.method.without-arguments.ruby keyword.control.def.ruby\n# ^^^^^^ meta.function.method.without-arguments.ruby entity.name.function.ruby\n# ^ comment.line.number-sign.ruby punctuation.definition.comment.ruby\n# ^^^^^^^^^^^^^ comment.line.number-sign.ruby\n hello, world = [1,2]\n# ^^^^^ variable.other.ruby\n# ^ punctuation.separator.object.ruby\n# ^^^^^ variable.other.ruby\n# ^ keyword.operator.assignment.ruby\n# ^ punctuation.section.array.begin.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.separator.object.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.section.array.end.ruby\n end", "def method_with_parentheses(a, b, c = [foo,bar,baz]) # test comment\n# ^^^ meta.function.method.with-arguments.ruby keyword.control.def.ruby\n# ^^^^^^^^^^^^^^^^^^^^^^^ meta.function.method.with-arguments.ruby entity.name.function.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.definition.parameters.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby keyword.operator.assignment.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.section.array.begin.ruby\n# ^^^ meta.function.method.with-arguments.ruby variable.other.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^^^ meta.function.method.with-arguments.ruby variable.other.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^^^ meta.function.method.with-arguments.ruby variable.other.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.section.array.end.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.definition.parameters.ruby\n# ^ comment.line.number-sign.ruby punctuation.definition.comment.ruby\n# ^^^^^^^^^^^^^ comment.line.number-sign.ruby\n hello, world = [1,2]\n# ^^^^^ variable.other.ruby\n# ^ punctuation.separator.object.ruby\n# ^^^^^ variable.other.ruby\n# ^ keyword.operator.assignment.ruby\n# ^ punctuation.section.array.begin.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.separator.object.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.section.array.end.ruby\n end", "def method_without_parentheses *a, **b, &c # test comment\n# ^^^ meta.function.method.with-arguments.ruby keyword.control.def.ruby\n# ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.method.with-arguments.ruby entity.name.function.ruby\n# ^ meta.function.method.with-arguments.ruby storage.type.variable.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^^ meta.function.method.with-arguments.ruby storage.type.variable.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^ meta.function.method.with-arguments.ruby storage.type.variable.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ comment.line.number-sign.ruby punctuation.definition.comment.ruby\n# ^^^^^^^^^^^^^ comment.line.number-sign.ruby\n hello, world = [1,2]\n# ^^^^^ variable.other.ruby\n# ^ punctuation.separator.object.ruby\n# ^^^^^ variable.other.ruby\n# ^ keyword.operator.assignment.ruby\n# ^ punctuation.section.array.begin.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.separator.object.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.section.array.end.ruby\n end", "def token!\n # at line 1:8: ( T__80 | T__81 | T__82 | EOL | LPAR | RPAR | LLAIZQ | LLADER | COMA | PUNTO | CORDER | CORIZQ | DELIM | ASIGNACION | DOUBLEDOT | COMILLA | OP_REL | OP_ARI | OP_LOG | K_ACCIONARCHIVO | K_ACCIONARREGLO | K_PACKAGE | K_CLASS | K_END | K_DEF | K_VAR | K_REQUIRE | K_IMPLEMENTS | K_EXTENDS | K_IMPRIMIR | K_CONVERSION | K_ASIGNACION | K_RETORNO | K_ACCIONSYS | K_INTERFACE | K_IF | K_TIMES | K_DO | K_EACH | K_ELSE | K_INVOKE | K_NEW | TIPO | K_REFERENCIA | K_INSPECCIONAR | K_MATEMATICA | K_NUM | K_RESIZE | K_ORDENAR | ModoOrd | K_BUSQUEDA | K_TIPOBUSQUEDA | K_WHERE | K_SPLIT | K_BEGIN | K_DIR | K_UNION | K_VISIBILIDAD | K_MODIFICADOR | K_ARRAY | K_PROPIEDAD | K_GET | K_SET | K_VALUE | K_INITIALIZE | K_FUNC | K_VOID | HexLiteral | DecimalLiteral | OctalLiteral | WS | LINE_COMMENT | Identificador )\n alt_28 = 73\n alt_28 = @dfa28.predict( @input )\n case alt_28\n when 1\n # at line 1:10: T__80\n t__80!\n\n\n when 2\n # at line 1:16: T__81\n t__81!\n\n\n when 3\n # at line 1:22: T__82\n t__82!\n\n\n when 4\n # at line 1:28: EOL\n eol!\n\n\n when 5\n # at line 1:32: LPAR\n lpar!\n\n\n when 6\n # at line 1:37: RPAR\n rpar!\n\n\n when 7\n # at line 1:42: LLAIZQ\n llaizq!\n\n\n when 8\n # at line 1:49: LLADER\n llader!\n\n\n when 9\n # at line 1:56: COMA\n coma!\n\n\n when 10\n # at line 1:61: PUNTO\n punto!\n\n\n when 11\n # at line 1:67: CORDER\n corder!\n\n\n when 12\n # at line 1:74: CORIZQ\n corizq!\n\n\n when 13\n # at line 1:81: DELIM\n delim!\n\n\n when 14\n # at line 1:87: ASIGNACION\n asignacion!\n\n\n when 15\n # at line 1:98: DOUBLEDOT\n doubledot!\n\n\n when 16\n # at line 1:108: COMILLA\n comilla!\n\n\n when 17\n # at line 1:116: OP_REL\n op_rel!\n\n\n when 18\n # at line 1:123: OP_ARI\n op_ari!\n\n\n when 19\n # at line 1:130: OP_LOG\n op_log!\n\n\n when 20\n # at line 1:137: K_ACCIONARCHIVO\n k_accionarchivo!\n\n\n when 21\n # at line 1:153: K_ACCIONARREGLO\n k_accionarreglo!\n\n\n when 22\n # at line 1:169: K_PACKAGE\n k_package!\n\n\n when 23\n # at line 1:179: K_CLASS\n k_class!\n\n\n when 24\n # at line 1:187: K_END\n k_end!\n\n\n when 25\n # at line 1:193: K_DEF\n k_def!\n\n\n when 26\n # at line 1:199: K_VAR\n k_var!\n\n\n when 27\n # at line 1:205: K_REQUIRE\n k_require!\n\n\n when 28\n # at line 1:215: K_IMPLEMENTS\n k_implements!\n\n\n when 29\n # at line 1:228: K_EXTENDS\n k_extends!\n\n\n when 30\n # at line 1:238: K_IMPRIMIR\n k_imprimir!\n\n\n when 31\n # at line 1:249: K_CONVERSION\n k_conversion!\n\n\n when 32\n # at line 1:262: K_ASIGNACION\n k_asignacion!\n\n\n when 33\n # at line 1:275: K_RETORNO\n k_retorno!\n\n\n when 34\n # at line 1:285: K_ACCIONSYS\n k_accionsys!\n\n\n when 35\n # at line 1:297: K_INTERFACE\n k_interface!\n\n\n when 36\n # at line 1:309: K_IF\n k_if!\n\n\n when 37\n # at line 1:314: K_TIMES\n k_times!\n\n\n when 38\n # at line 1:322: K_DO\n k_do!\n\n\n when 39\n # at line 1:327: K_EACH\n k_each!\n\n\n when 40\n # at line 1:334: K_ELSE\n k_else!\n\n\n when 41\n # at line 1:341: K_INVOKE\n k_invoke!\n\n\n when 42\n # at line 1:350: K_NEW\n k_new!\n\n\n when 43\n # at line 1:356: TIPO\n tipo!\n\n\n when 44\n # at line 1:361: K_REFERENCIA\n k_referencia!\n\n\n when 45\n # at line 1:374: K_INSPECCIONAR\n k_inspeccionar!\n\n\n when 46\n # at line 1:389: K_MATEMATICA\n k_matematica!\n\n\n when 47\n # at line 1:402: K_NUM\n k_num!\n\n\n when 48\n # at line 1:408: K_RESIZE\n k_resize!\n\n\n when 49\n # at line 1:417: K_ORDENAR\n k_ordenar!\n\n\n when 50\n # at line 1:427: ModoOrd\n modo_ord!\n\n\n when 51\n # at line 1:435: K_BUSQUEDA\n k_busqueda!\n\n\n when 52\n # at line 1:446: K_TIPOBUSQUEDA\n k_tipobusqueda!\n\n\n when 53\n # at line 1:461: K_WHERE\n k_where!\n\n\n when 54\n # at line 1:469: K_SPLIT\n k_split!\n\n\n when 55\n # at line 1:477: K_BEGIN\n k_begin!\n\n\n when 56\n # at line 1:485: K_DIR\n k_dir!\n\n\n when 57\n # at line 1:491: K_UNION\n k_union!\n\n\n when 58\n # at line 1:499: K_VISIBILIDAD\n k_visibilidad!\n\n\n when 59\n # at line 1:513: K_MODIFICADOR\n k_modificador!\n\n\n when 60\n # at line 1:527: K_ARRAY\n k_array!\n\n\n when 61\n # at line 1:535: K_PROPIEDAD\n k_propiedad!\n\n\n when 62\n # at line 1:547: K_GET\n k_get!\n\n\n when 63\n # at line 1:553: K_SET\n k_set!\n\n\n when 64\n # at line 1:559: K_VALUE\n k_value!\n\n\n when 65\n # at line 1:567: K_INITIALIZE\n k_initialize!\n\n\n when 66\n # at line 1:580: K_FUNC\n k_func!\n\n\n when 67\n # at line 1:587: K_VOID\n k_void!\n\n\n when 68\n # at line 1:594: HexLiteral\n hex_literal!\n\n\n when 69\n # at line 1:605: DecimalLiteral\n decimal_literal!\n\n\n when 70\n # at line 1:620: OctalLiteral\n octal_literal!\n\n\n when 71\n # at line 1:633: WS\n ws!\n\n\n when 72\n # at line 1:636: LINE_COMMENT\n line_comment!\n\n\n when 73\n # at line 1:649: Identificador\n identificador!\n\n\n end\n end", "def comment _args\n \"comment _args;\" \n end", "def comment(string); end", "def comment(string); end", "def comment(string); end", "def comment(string); end", "def comment=(_arg0); end", "def comment=(_arg0); end", "def comment=(_arg0); end", "def comment=(_arg0); end", "def comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 15)\n\n type = COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 148:3: ( ( '#' | '//' ) (~ '\\\\n' )* | '/*' ( . )* '*/' )\n alt_10 = 2\n look_10_0 = @input.peek(1)\n\n if (look_10_0 == ?#) \n alt_10 = 1\n elsif (look_10_0 == ?/) \n look_10_2 = @input.peek(2)\n\n if (look_10_2 == ?/) \n alt_10 = 1\n elsif (look_10_2 == ?*) \n alt_10 = 2\n else\n nvae = NoViableAlternative(\"\", 10, 2)\n raise nvae\n end\n else\n nvae = NoViableAlternative(\"\", 10, 0)\n raise nvae\n end\n case alt_10\n when 1\n # at line 148:5: ( '#' | '//' ) (~ '\\\\n' )*\n # at line 148:5: ( '#' | '//' )\n alt_7 = 2\n look_7_0 = @input.peek(1)\n\n if (look_7_0 == ?#) \n alt_7 = 1\n elsif (look_7_0 == ?/) \n alt_7 = 2\n else\n nvae = NoViableAlternative(\"\", 7, 0)\n raise nvae\n end\n case alt_7\n when 1\n # at line 148:7: '#'\n match(?#)\n\n when 2\n # at line 148:13: '//'\n match(\"//\")\n\n end\n # at line 148:20: (~ '\\\\n' )*\n while true # decision 8\n alt_8 = 2\n look_8_0 = @input.peek(1)\n\n if (look_8_0.between?(0x0000, ?\\t) || look_8_0.between?(0x000B, 0xFFFF)) \n alt_8 = 1\n\n end\n case alt_8\n when 1\n # at line 148:20: ~ '\\\\n'\n if @input.peek(1).between?(0x0000, ?\\t) || @input.peek(1).between?(0x000B, 0x00FF)\n @input.consume\n else\n mse = MismatchedSet(nil)\n recover(mse)\n raise mse\n end\n\n\n\n else\n break # out of loop for decision 8\n end\n end # loop for decision 8\n\n when 2\n # at line 149:5: '/*' ( . )* '*/'\n match(\"/*\")\n # at line 149:10: ( . )*\n while true # decision 9\n alt_9 = 2\n look_9_0 = @input.peek(1)\n\n if (look_9_0 == ?*) \n look_9_1 = @input.peek(2)\n\n if (look_9_1 == ?/) \n alt_9 = 2\n elsif (look_9_1.between?(0x0000, ?.) || look_9_1.between?(?0, 0xFFFF)) \n alt_9 = 1\n\n end\n elsif (look_9_0.between?(0x0000, ?)) || look_9_0.between?(?+, 0xFFFF)) \n alt_9 = 1\n\n end\n case alt_9\n when 1\n # at line 149:10: .\n match_any\n\n else\n break # out of loop for decision 9\n end\n end # loop for decision 9\n match(\"*/\")\n\n end\n \n @state.type = type\n @state.channel = channel\n # --> action\n skip \n # <-- action\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 15)\n\n end", "def test_comment_full_name\n 't1_cce66qf'\nend", "def comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 13 )\n\n type = COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 63:5: '#' (~ ( '\\\\r' | '\\\\n' ) )*\n match( 0x23 )\n # at line 63:9: (~ ( '\\\\r' | '\\\\n' ) )*\n while true # decision 22\n alt_22 = 2\n look_22_0 = @input.peek( 1 )\n\n if ( look_22_0.between?( 0x0, 0x9 ) || look_22_0.between?( 0xb, 0xc ) || look_22_0.between?( 0xe, 0xffff ) )\n alt_22 = 1\n\n end\n case alt_22\n when 1\n # at line 63:11: ~ ( '\\\\r' | '\\\\n' )\n if @input.peek( 1 ).between?( 0x0, 0x9 ) || @input.peek( 1 ).between?( 0xb, 0xc ) || @input.peek( 1 ).between?( 0xe, 0xff )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n\n else\n break # out of loop for decision 22\n end\n end # loop for decision 22\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__, 13 )\n\n end", "def step\n case\n when bol? && check( /=begin/ )\n start_group( :comment, scan_until( /^=end#{EOL}/ ) )\n when bol? && check( /__END__#{EOL}/ )\n start_group( :comment, scan_until( /\\Z/ ) )\n else\n case\n when check( /def\\s+/ )\n start_group :keyword, scan( /def\\s+/ )\n start_group :method, scan_until( /(?=[;(\\s]|#{EOL})/ )\n when check( /class\\s+/ )\n start_group :keyword, scan( /class\\s+/ )\n start_group :class, scan_until( /(?=[;\\s<]|#{EOL})/ )\n when check( /module\\s+/ )\n start_group :keyword, scan( /module\\s+/ )\n start_group :module, scan_until( /(?=[;\\s]|#{EOL})/ )\n when check( /::/ )\n start_group :punct, scan(/::/)\n when check( /:\"/ )\n start_group :symbol, scan(/:/)\n scan_delimited_region :symbol, :symbol, \"\", true\n @allow_operator = true\n when check( /:'/ )\n start_group :symbol, scan(/:/)\n scan_delimited_region :symbol, :symbol, \"\", false\n @allow_operator = true\n when scan( /:[_a-zA-Z@$][$@\\w]*[=!?]?/ )\n start_group :symbol, matched\n @allow_operator = true\n when scan( /\\?(\\\\[^\\n\\r]|[^\\\\\\n\\r\\s])/ )\n start_group :char, matched\n @allow_operator = true\n when check( /(__FILE__|__LINE__|true|false|nil|self)[?!]?/ )\n if @selector || matched[-1] == ?? || matched[-1] == ?!\n start_group :ident,\n scan(/(__FILE__|__LINE__|true|false|nil|self)[?!]?/)\n else\n start_group :constant,\n scan(/(__FILE__|__LINE__|true|false|nil|self)/)\n end\n @selector = false\n @allow_operator = true\n when scan(/0([bB][01]+|[oO][0-7]+|[dD][0-9]+|[xX][0-9a-fA-F]+)/)\n start_group :number, matched\n @allow_operator = true\n else\n case peek(2)\n when \"%r\"\n scan_delimited_region :punct, :regex, scan( /../ ), true\n @allow_operator = true\n when \"%w\", \"%q\"\n scan_delimited_region :punct, :string, scan( /../ ), false\n @allow_operator = true\n when \"%s\"\n scan_delimited_region :punct, :symbol, scan( /../ ), false\n @allow_operator = true\n when \"%W\", \"%Q\", \"%x\"\n scan_delimited_region :punct, :string, scan( /../ ), true\n @allow_operator = true\n when /%[^\\sa-zA-Z0-9]/\n scan_delimited_region :punct, :string, scan( /./ ), true\n @allow_operator = true\n when \"<<\"\n saw_word = ( chunk[-1,1] =~ /[\\w!?]/ )\n start_group :punct, scan( /<</ )\n if saw_word\n @allow_operator = false\n return\n end\n\n float_right = scan( /-/ )\n append \"-\" if float_right\n if ( type = scan( /['\"]/ ) )\n append type\n delim = scan_until( /(?=#{type})/ )\n if delim.nil?\n append scan_until( /\\Z/ )\n return\n end\n else\n delim = scan( /\\w+/ ) or return\n end\n start_group :constant, delim\n start_group :punct, scan( /#{type}/ ) if type\n @heredocs << [ float_right, type, delim ]\n @allow_operator = true\n else\n case peek(1)\n when /[\\n\\r]/\n unless @heredocs.empty?\n scan_heredoc(*@heredocs.shift)\n else\n start_group :normal, scan( /\\s+/ )\n end\n @allow_operator = false\n when /\\s/\n start_group :normal, scan( /\\s+/ )\n when \"#\"\n start_group :comment, scan( /#[^\\n\\r]*/ )\n when /[A-Z]/\n start_group @selector ? :ident : :constant, scan( /\\w+/ )\n @allow_operator = true\n when /[a-z_]/\n word = scan( /\\w+[?!]?/ )\n if !@selector && KEYWORDS.include?( word )\n start_group :keyword, word\n @allow_operator = false\n elsif\n start_group :ident, word\n @allow_operator = true\n end\n @selector = false\n when /\\d/\n start_group :number,\n scan( /[\\d_]+(\\.[\\d_]+)?([eE][\\d_]+)?/ )\n @allow_operator = true\n when '\"'\n scan_delimited_region :punct, :string, \"\", true\n @allow_operator = true\n when '/'\n if @allow_operator\n start_group :punct, scan(%r{/})\n @allow_operator = false\n else\n scan_delimited_region :punct, :regex, \"\", true\n @allow_operator = true\n end\n when \"'\"\n scan_delimited_region :punct, :string, \"\", false\n @allow_operator = true\n when \".\"\n dots = scan( /\\.{1,3}/ )\n start_group :punct, dots\n @selector = ( dots.length == 1 )\n when /[@]/\n start_group :attribute, scan( /@{1,2}\\w*/ )\n @allow_operator = true\n when /[$]/\n start_group :global, scan(/\\$/)\n start_group :global, scan( /\\w+|./ ) if check(/./)\n @allow_operator = true\n when /[-!?*\\/+=<>(\\[\\{}:;,&|%]/\n start_group :punct, scan(/./)\n @allow_operator = false\n when /[)\\]]/\n start_group :punct, scan(/./)\n @allow_operator = true\n else\n # all else just falls through this, to prevent\n # infinite loops...\n append getch\n end\n end\n end\n end\n end", "def token!\n # at line 1:8: ( T__30 | T__31 | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | T__38 | T__39 | T__40 | T__41 | T__42 | T__43 | T__44 | T__45 | T__46 | T__47 | T__48 | T__49 | T__50 | T__51 | T__52 | T__53 | T__54 | INTEGER | FLOAT | BOOLEAN | STRING | CHAR | INIT | OPEN | CLOSE | TYPE_INT | TYPE_FLOAT | TYPE_STRING | TYPE_BOOL | TYPE_VOID | ENTITY | COMPONENT | SYSTEM | ENUM | IF | ELSE | RETURN | WHILE | IDENT | WS | COMMENT | MULTILINE_COMMENT | NL )\n alt_9 = 51\n alt_9 = @dfa9.predict( @input )\n case alt_9\n when 1\n # at line 1:10: T__30\n t__30!\n\n\n when 2\n # at line 1:16: T__31\n t__31!\n\n\n when 3\n # at line 1:22: T__32\n t__32!\n\n\n when 4\n # at line 1:28: T__33\n t__33!\n\n\n when 5\n # at line 1:34: T__34\n t__34!\n\n\n when 6\n # at line 1:40: T__35\n t__35!\n\n\n when 7\n # at line 1:46: T__36\n t__36!\n\n\n when 8\n # at line 1:52: T__37\n t__37!\n\n\n when 9\n # at line 1:58: T__38\n t__38!\n\n\n when 10\n # at line 1:64: T__39\n t__39!\n\n\n when 11\n # at line 1:70: T__40\n t__40!\n\n\n when 12\n # at line 1:76: T__41\n t__41!\n\n\n when 13\n # at line 1:82: T__42\n t__42!\n\n\n when 14\n # at line 1:88: T__43\n t__43!\n\n\n when 15\n # at line 1:94: T__44\n t__44!\n\n\n when 16\n # at line 1:100: T__45\n t__45!\n\n\n when 17\n # at line 1:106: T__46\n t__46!\n\n\n when 18\n # at line 1:112: T__47\n t__47!\n\n\n when 19\n # at line 1:118: T__48\n t__48!\n\n\n when 20\n # at line 1:124: T__49\n t__49!\n\n\n when 21\n # at line 1:130: T__50\n t__50!\n\n\n when 22\n # at line 1:136: T__51\n t__51!\n\n\n when 23\n # at line 1:142: T__52\n t__52!\n\n\n when 24\n # at line 1:148: T__53\n t__53!\n\n\n when 25\n # at line 1:154: T__54\n t__54!\n\n\n when 26\n # at line 1:160: INTEGER\n integer!\n\n\n when 27\n # at line 1:168: FLOAT\n float!\n\n\n when 28\n # at line 1:174: BOOLEAN\n boolean!\n\n\n when 29\n # at line 1:182: STRING\n string!\n\n\n when 30\n # at line 1:189: CHAR\n char!\n\n\n when 31\n # at line 1:194: INIT\n init!\n\n\n when 32\n # at line 1:199: OPEN\n open!\n\n\n when 33\n # at line 1:204: CLOSE\n close!\n\n\n when 34\n # at line 1:210: TYPE_INT\n type_int!\n\n\n when 35\n # at line 1:219: TYPE_FLOAT\n type_float!\n\n\n when 36\n # at line 1:230: TYPE_STRING\n type_string!\n\n\n when 37\n # at line 1:242: TYPE_BOOL\n type_bool!\n\n\n when 38\n # at line 1:252: TYPE_VOID\n type_void!\n\n\n when 39\n # at line 1:262: ENTITY\n entity!\n\n\n when 40\n # at line 1:269: COMPONENT\n component!\n\n\n when 41\n # at line 1:279: SYSTEM\n system!\n\n\n when 42\n # at line 1:286: ENUM\n enum!\n\n\n when 43\n # at line 1:291: IF\n if!\n\n\n when 44\n # at line 1:294: ELSE\n else!\n\n\n when 45\n # at line 1:299: RETURN\n return!\n\n\n when 46\n # at line 1:306: WHILE\n while!\n\n\n when 47\n # at line 1:312: IDENT\n ident!\n\n\n when 48\n # at line 1:318: WS\n ws!\n\n\n when 49\n # at line 1:321: COMMENT\n comment!\n\n\n when 50\n # at line 1:329: MULTILINE_COMMENT\n multiline_comment!\n\n\n when 51\n # at line 1:347: NL\n nl!\n\n\n end\n end", "def some_method(with:, args:)\n # Floating comment\n end", "def comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 49 )\n\n\n\n type = COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 228:11: '//' ( . )* ( '\\\\n' | '\\\\r' )\n match( \"//\" )\n\n # at line 228:16: ( . )*\n while true # decision 6\n alt_6 = 2\n look_6_0 = @input.peek( 1 )\n\n if ( look_6_0 == 0xa || look_6_0 == 0xd )\n alt_6 = 2\n elsif ( look_6_0.between?( 0x0, 0x9 ) || look_6_0.between?( 0xb, 0xc ) || look_6_0.between?( 0xe, 0xffff ) )\n alt_6 = 1\n\n end\n case alt_6\n when 1\n # at line 228:16: .\n match_any\n\n else\n break # out of loop for decision 6\n end\n end # loop for decision 6\n\n if @input.peek(1) == 0xa || @input.peek(1) == 0xd\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n\n end\n\n\n\n # --> action\n channel = HIDDEN;\n # <-- action\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 49 )\n\n\n end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 35 )\n\n type = COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 350:9: '#' (~ ( '\\\\n' | '\\\\r' ) )*\n match( 0x23 )\n # at line 350:13: (~ ( '\\\\n' | '\\\\r' ) )*\n while true # decision 13\n alt_13 = 2\n look_13_0 = @input.peek( 1 )\n\n if ( look_13_0.between?( 0x0, 0x9 ) || look_13_0.between?( 0xb, 0xc ) || look_13_0.between?( 0xe, 0xffff ) )\n alt_13 = 1\n\n end\n case alt_13\n when 1\n # at line 350:13: ~ ( '\\\\n' | '\\\\r' )\n if @input.peek( 1 ).between?( 0x0, 0x9 ) || @input.peek( 1 ).between?( 0xb, 0xc ) || @input.peek( 1 ).between?( 0xe, 0xff )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n\n else\n break # out of loop for decision 13\n end\n end # loop for decision 13\n # --> action\n channel=HIDDEN;\n # <-- action\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__, 35 )\n\n end", "def token!\n # at line 1:8: ( PROGRAM | PRINT | VAR | CTE | IF | ELSE | AND | OR | GT | GTE | LT | LTE | INTEGER | FLOAT | STRING | BOOLEAN | VOID | FUNCTION | FIN | RETURN | INPUT | WHILE | CLASS | WORD | NUM_I | NUM_F | BOOL | ID | LPAREN | RPAREN | LKEY | RKEY | EQUAL | DIF | SIMILAR | COMMA | DDOT | SEMI | PLUS | SUB | DIV | MUL | INHERITS | DOT | WHITESPACE )\n alt_10 = 45\n alt_10 = @dfa10.predict( @input )\n case alt_10\n when 1\n # at line 1:10: PROGRAM\n program!\n\n\n when 2\n # at line 1:18: PRINT\n print!\n\n\n when 3\n # at line 1:24: VAR\n var!\n\n\n when 4\n # at line 1:28: CTE\n cte!\n\n\n when 5\n # at line 1:32: IF\n if!\n\n\n when 6\n # at line 1:35: ELSE\n else!\n\n\n when 7\n # at line 1:40: AND\n and!\n\n\n when 8\n # at line 1:44: OR\n or!\n\n\n when 9\n # at line 1:47: GT\n gt!\n\n\n when 10\n # at line 1:50: GTE\n gte!\n\n\n when 11\n # at line 1:54: LT\n lt!\n\n\n when 12\n # at line 1:57: LTE\n lte!\n\n\n when 13\n # at line 1:61: INTEGER\n integer!\n\n\n when 14\n # at line 1:69: FLOAT\n float!\n\n\n when 15\n # at line 1:75: STRING\n string!\n\n\n when 16\n # at line 1:82: BOOLEAN\n boolean!\n\n\n when 17\n # at line 1:90: VOID\n void!\n\n\n when 18\n # at line 1:95: FUNCTION\n function!\n\n\n when 19\n # at line 1:104: FIN\n fin!\n\n\n when 20\n # at line 1:108: RETURN\n return!\n\n\n when 21\n # at line 1:115: INPUT\n input!\n\n\n when 22\n # at line 1:121: WHILE\n while!\n\n\n when 23\n # at line 1:127: CLASS\n class!\n\n\n when 24\n # at line 1:133: WORD\n word!\n\n\n when 25\n # at line 1:138: NUM_I\n num_i!\n\n\n when 26\n # at line 1:144: NUM_F\n num_f!\n\n\n when 27\n # at line 1:150: BOOL\n bool!\n\n\n when 28\n # at line 1:155: ID\n id!\n\n\n when 29\n # at line 1:158: LPAREN\n lparen!\n\n\n when 30\n # at line 1:165: RPAREN\n rparen!\n\n\n when 31\n # at line 1:172: LKEY\n lkey!\n\n\n when 32\n # at line 1:177: RKEY\n rkey!\n\n\n when 33\n # at line 1:182: EQUAL\n equal!\n\n\n when 34\n # at line 1:188: DIF\n dif!\n\n\n when 35\n # at line 1:192: SIMILAR\n similar!\n\n\n when 36\n # at line 1:200: COMMA\n comma!\n\n\n when 37\n # at line 1:206: DDOT\n ddot!\n\n\n when 38\n # at line 1:211: SEMI\n semi!\n\n\n when 39\n # at line 1:216: PLUS\n plus!\n\n\n when 40\n # at line 1:221: SUB\n sub!\n\n\n when 41\n # at line 1:225: DIV\n div!\n\n\n when 42\n # at line 1:229: MUL\n mul!\n\n\n when 43\n # at line 1:233: INHERITS\n inherits!\n\n\n when 44\n # at line 1:242: DOT\n dot!\n\n\n when 45\n # at line 1:246: WHITESPACE\n whitespace!\n\n\n end\n end", "def line_comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 78 )\n\n\n\n type = LINE_COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 608:8: '#' (~ ( '\\\\n' | '\\\\r' ) )* ( '\\\\r' )? '\\\\n'\n match( 0x23 )\n # at line 608:12: (~ ( '\\\\n' | '\\\\r' ) )*\n while true # decision 25\n alt_25 = 2\n look_25_0 = @input.peek( 1 )\n\n if ( look_25_0.between?( 0x0, 0x9 ) || look_25_0.between?( 0xb, 0xc ) || look_25_0.between?( 0xe, 0xffff ) )\n alt_25 = 1\n\n end\n case alt_25\n when 1\n # at line \n if @input.peek( 1 ).between?( 0x0, 0x9 ) || @input.peek( 1 ).between?( 0xb, 0xc ) || @input.peek( 1 ).between?( 0xe, 0xffff )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n\n end\n\n\n\n else\n break # out of loop for decision 25\n end\n end # loop for decision 25\n\n # at line 608:26: ( '\\\\r' )?\n alt_26 = 2\n look_26_0 = @input.peek( 1 )\n\n if ( look_26_0 == 0xd )\n alt_26 = 1\n end\n case alt_26\n when 1\n # at line 608:26: '\\\\r'\n match( 0xd )\n\n end\n match( 0xa )\n\n # --> action\n channel=HIDDEN;\n # <-- action\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 78 )\n\n\n end", "def function_definition\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 8 )\n\n\n value = nil\n\n\n name = nil\n type = nil\n a = nil\n\n\n begin\n # at line 51:5: OPEN type= variable_type name= IDENT ( '(' (type= variable_type name= IDENT ( ',' type= variable_type name= IDENT )* )? ')' )? ( CLOSE | NL (a= statement )* CLOSE )\n match( OPEN, TOKENS_FOLLOWING_OPEN_IN_function_definition_350 )\n @state.following.push( TOKENS_FOLLOWING_variable_type_IN_function_definition_354 )\n type = variable_type\n @state.following.pop\n name = match( IDENT, TOKENS_FOLLOWING_IDENT_IN_function_definition_358 )\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value = FunctionDefinitionEval.new(name.text, type) \n # <-- action\n end\n\n # at line 52:3: ( '(' (type= variable_type name= IDENT ( ',' type= variable_type name= IDENT )* )? ')' )?\n alt_17 = 2\n look_17_0 = @input.peek( 1 )\n\n if ( look_17_0 == T__34 )\n alt_17 = 1\n end\n case alt_17\n when 1\n # at line 52:5: '(' (type= variable_type name= IDENT ( ',' type= variable_type name= IDENT )* )? ')'\n match( T__34, TOKENS_FOLLOWING_T__34_IN_function_definition_366 )\n # at line 52:9: (type= variable_type name= IDENT ( ',' type= variable_type name= IDENT )* )?\n alt_16 = 2\n look_16_0 = @input.peek( 1 )\n\n if ( look_16_0 == IDENT || look_16_0.between?( TYPE_BOOL, TYPE_VOID ) )\n alt_16 = 1\n end\n case alt_16\n when 1\n # at line 53:5: type= variable_type name= IDENT ( ',' type= variable_type name= IDENT )*\n @state.following.push( TOKENS_FOLLOWING_variable_type_IN_function_definition_376 )\n type = variable_type\n @state.following.pop\n name = match( IDENT, TOKENS_FOLLOWING_IDENT_IN_function_definition_380 )\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value.add_argument(type, name.text) \n # <-- action\n end\n\n # at line 54:5: ( ',' type= variable_type name= IDENT )*\n while true # decision 15\n alt_15 = 2\n look_15_0 = @input.peek( 1 )\n\n if ( look_15_0 == T__40 )\n alt_15 = 1\n\n end\n case alt_15\n when 1\n # at line 54:6: ',' type= variable_type name= IDENT\n match( T__40, TOKENS_FOLLOWING_T__40_IN_function_definition_389 )\n @state.following.push( TOKENS_FOLLOWING_variable_type_IN_function_definition_393 )\n type = variable_type\n @state.following.pop\n name = match( IDENT, TOKENS_FOLLOWING_IDENT_IN_function_definition_397 )\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value.add_argument(type, name.text) \n # <-- action\n end\n\n\n else\n break # out of loop for decision 15\n end\n end # loop for decision 15\n\n\n end\n match( T__35, TOKENS_FOLLOWING_T__35_IN_function_definition_409 )\n\n end\n # at line 56:3: ( CLOSE | NL (a= statement )* CLOSE )\n alt_19 = 2\n look_19_0 = @input.peek( 1 )\n\n if ( look_19_0 == CLOSE )\n alt_19 = 1\n elsif ( look_19_0 == NL )\n alt_19 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n\n\n raise NoViableAlternative( \"\", 19, 0 )\n\n end\n case alt_19\n when 1\n # at line 56:5: CLOSE\n match( CLOSE, TOKENS_FOLLOWING_CLOSE_IN_function_definition_418 )\n\n when 2\n # at line 56:13: NL (a= statement )* CLOSE\n match( NL, TOKENS_FOLLOWING_NL_IN_function_definition_422 )\n # at line 56:16: (a= statement )*\n while true # decision 18\n alt_18 = 2\n look_18_0 = @input.peek( 1 )\n\n if ( look_18_0.between?( IDENT, IF ) || look_18_0 == RETURN || look_18_0 == WHILE )\n alt_18 = 1\n\n end\n case alt_18\n when 1\n # at line 56:17: a= statement\n @state.following.push( TOKENS_FOLLOWING_statement_IN_function_definition_427 )\n a = statement\n @state.following.pop\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value.add_statement(a) \n # <-- action\n end\n\n\n else\n break # out of loop for decision 18\n end\n end # loop for decision 18\n\n match( CLOSE, TOKENS_FOLLOWING_CLOSE_IN_function_definition_434 )\n\n end\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__, 8 )\n\n\n end\n\n return value\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 sl_comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 39)\n\n type = SL_COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 470:5: '//' ( ' $ANTLR ' SRC | (~ ( '\\\\r' | '\\\\n' ) )* ) ( '\\\\r' )? '\\\\n'\n match(\"//\")\n # at line 471:5: ( ' $ANTLR ' SRC | (~ ( '\\\\r' | '\\\\n' ) )* )\n alt_2 = 2\n alt_2 = @dfa2.predict(@input)\n case alt_2\n when 1\n # at line 471:7: ' $ANTLR ' SRC\n match(\" $ANTLR \")\n src!\n\n when 2\n # at line 472:6: (~ ( '\\\\r' | '\\\\n' ) )*\n # at line 472:6: (~ ( '\\\\r' | '\\\\n' ) )*\n loop do #loop 1\n alt_1 = 2\n look_1_0 = @input.peek(1)\n\n if (look_1_0.between?(0x0000, ?\\t) || look_1_0.between?(0x000B, ?\\f) || look_1_0.between?(0x000E, 0xFFFF)) \n alt_1 = 1\n\n end\n case alt_1\n when 1\n # at line 472:6: ~ ( '\\\\r' | '\\\\n' )\n if @input.peek(1).between?(0x0000, ?\\t) || @input.peek(1).between?(0x000B, ?\\f) || @input.peek(1).between?(0x000E, 0x00FF)\n @input.consume\n else\n mse = MismatchedSet(nil)\n recover(mse)\n raise mse\n end\n\n\n\n else\n break #loop 1\n end\n end\n\n end\n # at line 474:3: ( '\\\\r' )?\n alt_3 = 2\n look_3_0 = @input.peek(1)\n\n if (look_3_0 == ?\\r) \n alt_3 = 1\n end\n case alt_3\n when 1\n # at line 474:3: '\\\\r'\n match(?\\r)\n\n end\n match(?\\n)\n # --> action\n channel=HIDDEN;\n # <-- action\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__, 39)\n\n end", "def lines_of_code; end", "def lines_of_code; end", "def esc!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 46)\n\n \n # - - - - main rule block - - - -\n # at line 504:7: '\\\\\\\\' ( 'n' | 'r' | 't' | 'b' | 'f' | '\\\"' | '\\\\'' | '\\\\\\\\' | '>' | 'u' XDIGIT XDIGIT XDIGIT XDIGIT | . )\n match(?\\\\)\n # at line 505:3: ( 'n' | 'r' | 't' | 'b' | 'f' | '\\\"' | '\\\\'' | '\\\\\\\\' | '>' | 'u' XDIGIT XDIGIT XDIGIT XDIGIT | . )\n alt_9 = 11\n alt_9 = @dfa9.predict(@input)\n case alt_9\n when 1\n # at line 505:5: 'n'\n match(?n)\n\n when 2\n # at line 506:5: 'r'\n match(?r)\n\n when 3\n # at line 507:5: 't'\n match(?t)\n\n when 4\n # at line 508:5: 'b'\n match(?b)\n\n when 5\n # at line 509:5: 'f'\n match(?f)\n\n when 6\n # at line 510:5: '\\\"'\n match(?\")\n\n when 7\n # at line 511:5: '\\\\''\n match(?\\')\n\n when 8\n # at line 512:5: '\\\\\\\\'\n match(?\\\\)\n\n when 9\n # at line 513:5: '>'\n match(?>)\n\n when 10\n # at line 514:5: 'u' XDIGIT XDIGIT XDIGIT XDIGIT\n match(?u)\n xdigit!\n xdigit!\n xdigit!\n xdigit!\n\n when 11\n # at line 515:5: .\n match_any\n\n end\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 46)\n\n end", "def comment_string\n @comment_syntax.string_for_method_entity self\n end", "def token!\n # at line 1:8: ( RET | SCOPE | FRAGMENT | TREE_BEGIN | ROOT | BANG | RANGE | REWRITE | AT | LABEL_ASSIGN | LIST_LABEL_ASSIGN | T__67 | T__68 | T__69 | T__70 | T__71 | T__72 | T__73 | T__74 | T__75 | T__76 | T__77 | T__78 | T__79 | T__80 | T__81 | T__82 | T__83 | T__84 | T__85 | T__86 | T__87 | T__88 | T__89 | T__90 | T__91 | T__92 | T__93 | SL_COMMENT | ML_COMMENT | CHAR_LITERAL | STRING_LITERAL | DOUBLE_QUOTE_STRING_LITERAL | DOUBLE_ANGLE_STRING_LITERAL | INT | ARG_ACTION | ACTION | TOKEN_REF | RULE_REF | OPTIONS | TOKENS | WS )\n alt_21 = 52\n alt_21 = @dfa21.predict(@input)\n case alt_21\n when 1\n # at line 1:10: RET\n ret!\n\n when 2\n # at line 1:14: SCOPE\n scope!\n\n when 3\n # at line 1:20: FRAGMENT\n fragment!\n\n when 4\n # at line 1:29: TREE_BEGIN\n tree_begin!\n\n when 5\n # at line 1:40: ROOT\n root!\n\n when 6\n # at line 1:45: BANG\n bang!\n\n when 7\n # at line 1:50: RANGE\n range!\n\n when 8\n # at line 1:56: REWRITE\n rewrite!\n\n when 9\n # at line 1:64: AT\n at!\n\n when 10\n # at line 1:67: LABEL_ASSIGN\n label_assign!\n\n when 11\n # at line 1:80: LIST_LABEL_ASSIGN\n list_label_assign!\n\n when 12\n # at line 1:98: T__67\n t__67!\n\n when 13\n # at line 1:104: T__68\n t__68!\n\n when 14\n # at line 1:110: T__69\n t__69!\n\n when 15\n # at line 1:116: T__70\n t__70!\n\n when 16\n # at line 1:122: T__71\n t__71!\n\n when 17\n # at line 1:128: T__72\n t__72!\n\n when 18\n # at line 1:134: T__73\n t__73!\n\n when 19\n # at line 1:140: T__74\n t__74!\n\n when 20\n # at line 1:146: T__75\n t__75!\n\n when 21\n # at line 1:152: T__76\n t__76!\n\n when 22\n # at line 1:158: T__77\n t__77!\n\n when 23\n # at line 1:164: T__78\n t__78!\n\n when 24\n # at line 1:170: T__79\n t__79!\n\n when 25\n # at line 1:176: T__80\n t__80!\n\n when 26\n # at line 1:182: T__81\n t__81!\n\n when 27\n # at line 1:188: T__82\n t__82!\n\n when 28\n # at line 1:194: T__83\n t__83!\n\n when 29\n # at line 1:200: T__84\n t__84!\n\n when 30\n # at line 1:206: T__85\n t__85!\n\n when 31\n # at line 1:212: T__86\n t__86!\n\n when 32\n # at line 1:218: T__87\n t__87!\n\n when 33\n # at line 1:224: T__88\n t__88!\n\n when 34\n # at line 1:230: T__89\n t__89!\n\n when 35\n # at line 1:236: T__90\n t__90!\n\n when 36\n # at line 1:242: T__91\n t__91!\n\n when 37\n # at line 1:248: T__92\n t__92!\n\n when 38\n # at line 1:254: T__93\n t__93!\n\n when 39\n # at line 1:260: SL_COMMENT\n sl_comment!\n\n when 40\n # at line 1:271: ML_COMMENT\n ml_comment!\n\n when 41\n # at line 1:282: CHAR_LITERAL\n char_literal!\n\n when 42\n # at line 1:295: STRING_LITERAL\n string_literal!\n\n when 43\n # at line 1:310: DOUBLE_QUOTE_STRING_LITERAL\n double_quote_string_literal!\n\n when 44\n # at line 1:338: DOUBLE_ANGLE_STRING_LITERAL\n double_angle_string_literal!\n\n when 45\n # at line 1:366: INT\n int!\n\n when 46\n # at line 1:370: ARG_ACTION\n arg_action!\n\n when 47\n # at line 1:381: ACTION\n action!\n\n when 48\n # at line 1:388: TOKEN_REF\n token_ref!\n\n when 49\n # at line 1:398: RULE_REF\n rule_ref!\n\n when 50\n # at line 1:407: OPTIONS\n options!\n\n when 51\n # at line 1:415: TOKENS\n tokens!\n\n when 52\n # at line 1:422: WS\n ws!\n\n end\n end", "def SomeClass explainMore\n p \"no comment\"\n end", "def test_dsl_5\n #---------------------------\n show Spock + (Lizard + Rock)\n #---------------------------\n assert_equal \\\n \"Rock crushes Lizard (winner Rock)\\n\" \\\n \"Spock vaporizes Rock (winner Spock)\\n\" \\\n \"Result = Spock\\n\", \\\n @out.string\n end", "def test; end", "def auto_analyze=(_arg0); end", "def token!\n # at line 1:8: ( T__48 | T__49 | T__50 | T__51 | T__52 | CATEGORY_KEY | LINK_KEY | X_OCCI_ATTRIBUTE_KEY | X_OCCI_LOCATION_KEY | ACTION | ACTIONS | AMPERSAND | AT | ATTRIBUTES | BACKSLASH | CATEGORY | CLASS | COLON | DASH | DOT | EQUALS | GT | HASH | KIND | LINK | LOCATION | LT | MIXIN | PERCENT | PLUS | QUESTION | QUOTE | REL | SCHEME | SELF | SEMICOLON | SLASH | SQUOTE | TERM | TILDE | TITLE | UNDERSCORE | LBRACKET | RBRACKET | LOALPHA | UPALPHA | DIGIT | WS | ESC )\n alt_5 = 49\n alt_5 = @dfa5.predict( @input )\n case alt_5\n when 1\n # at line 1:10: T__48\n t__48!\n\n when 2\n # at line 1:16: T__49\n t__49!\n\n when 3\n # at line 1:22: T__50\n t__50!\n\n when 4\n # at line 1:28: T__51\n t__51!\n\n when 5\n # at line 1:34: T__52\n t__52!\n\n when 6\n # at line 1:40: CATEGORY_KEY\n category_key!\n\n when 7\n # at line 1:53: LINK_KEY\n link_key!\n\n when 8\n # at line 1:62: X_OCCI_ATTRIBUTE_KEY\n x_occi_attribute_key!\n\n when 9\n # at line 1:83: X_OCCI_LOCATION_KEY\n x_occi_location_key!\n\n when 10\n # at line 1:103: ACTION\n action!\n\n when 11\n # at line 1:110: ACTIONS\n actions!\n\n when 12\n # at line 1:118: AMPERSAND\n ampersand!\n\n when 13\n # at line 1:128: AT\n at!\n\n when 14\n # at line 1:131: ATTRIBUTES\n attributes!\n\n when 15\n # at line 1:142: BACKSLASH\n backslash!\n\n when 16\n # at line 1:152: CATEGORY\n category!\n\n when 17\n # at line 1:161: CLASS\n class!\n\n when 18\n # at line 1:167: COLON\n colon!\n\n when 19\n # at line 1:173: DASH\n dash!\n\n when 20\n # at line 1:178: DOT\n dot!\n\n when 21\n # at line 1:182: EQUALS\n equals!\n\n when 22\n # at line 1:189: GT\n gt!\n\n when 23\n # at line 1:192: HASH\n hash!\n\n when 24\n # at line 1:197: KIND\n kind!\n\n when 25\n # at line 1:202: LINK\n link!\n\n when 26\n # at line 1:207: LOCATION\n location!\n\n when 27\n # at line 1:216: LT\n lt!\n\n when 28\n # at line 1:219: MIXIN\n mixin!\n\n when 29\n # at line 1:225: PERCENT\n percent!\n\n when 30\n # at line 1:233: PLUS\n plus!\n\n when 31\n # at line 1:238: QUESTION\n question!\n\n when 32\n # at line 1:247: QUOTE\n quote!\n\n when 33\n # at line 1:253: REL\n rel!\n\n when 34\n # at line 1:257: SCHEME\n scheme!\n\n when 35\n # at line 1:264: SELF\n self!\n\n when 36\n # at line 1:269: SEMICOLON\n semicolon!\n\n when 37\n # at line 1:279: SLASH\n slash!\n\n when 38\n # at line 1:285: SQUOTE\n squote!\n\n when 39\n # at line 1:292: TERM\n term!\n\n when 40\n # at line 1:297: TILDE\n tilde!\n\n when 41\n # at line 1:303: TITLE\n title!\n\n when 42\n # at line 1:309: UNDERSCORE\n underscore!\n\n when 43\n # at line 1:320: LBRACKET\n lbracket!\n\n when 44\n # at line 1:329: RBRACKET\n rbracket!\n\n when 45\n # at line 1:338: LOALPHA\n loalpha!\n\n when 46\n # at line 1:346: UPALPHA\n upalpha!\n\n when 47\n # at line 1:354: DIGIT\n digit!\n\n when 48\n # at line 1:360: WS\n ws!\n\n when 49\n # at line 1:363: ESC\n esc!\n\n end\n end", "def lex_en_line_comment=(_arg0); end", "def lex_en_line_comment=(_arg0); end", "def lex_en_line_comment=(_arg0); end", "def multiline_comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 50 )\n\n\n\n type = MULTILINE_COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 229:21: '/*' ( . )* '*/'\n match( \"/*\" )\n\n # at line 229:26: ( . )*\n while true # decision 7\n alt_7 = 2\n look_7_0 = @input.peek( 1 )\n\n if ( look_7_0 == 0x2a )\n look_7_1 = @input.peek( 2 )\n\n if ( look_7_1 == 0x2f )\n alt_7 = 2\n elsif ( look_7_1.between?( 0x0, 0x2e ) || look_7_1.between?( 0x30, 0xffff ) )\n alt_7 = 1\n\n end\n elsif ( look_7_0.between?( 0x0, 0x29 ) || look_7_0.between?( 0x2b, 0xffff ) )\n alt_7 = 1\n\n end\n case alt_7\n when 1\n # at line 229:26: .\n match_any\n\n else\n break # out of loop for decision 7\n end\n end # loop for decision 7\n\n\n match( \"*/\" )\n\n\n # --> action\n channel = HIDDEN;\n # <-- action\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 50 )\n\n\n end", "def extract_magic_comments(processed_source); end", "def xxxtest_function_prototype_on_more_than_one_line\r\n length = initialize_length(\r\n <<-EOD\r\n func_prototype(\r\n int myCat,\r\n boolean huh\r\n );\r\n EOD\r\n )\r\n assert_equal(nil, length.counts['func_prototype'])\r\n assert_equal(5, length.counts['global'])\r\n end", "def test_method\n \"Here is the sample input\"\n end", "def ml_comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 40)\n\n type = ML_COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 478:4: '/*' ( . )* '*/'\n match(\"/*\")\n # --> action\n if @input.peek(1) == ?* then type = DOC_COMMENT else channel = HIDDEN end \n # <-- action\n # at line 478:88: ( . )*\n loop do #loop 4\n alt_4 = 2\n look_4_0 = @input.peek(1)\n\n if (look_4_0 == ?*) \n look_4_1 = @input.peek(2)\n\n if (look_4_1 == ?/) \n alt_4 = 2\n elsif (look_4_1.between?(0x0000, ?.) || look_4_1.between?(?0, 0xFFFF)) \n alt_4 = 1\n\n end\n elsif (look_4_0.between?(0x0000, ?)) || look_4_0.between?(?+, 0xFFFF)) \n alt_4 = 1\n\n end\n case alt_4\n when 1\n # at line 478:88: .\n match_any\n\n else\n break #loop 4\n end\n end\n match(\"*/\")\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__, 40)\n\n end", "def token!\n # at line 1:8: ( T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | T__31 | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | T__38 | T__39 | T__40 | T__41 | T__42 | T__43 | T__44 | T__45 | T__46 | T__47 | T__48 | T__49 | T__50 | T__51 | T__52 | T__53 | T__54 | T__55 | T__56 | T__57 | T__58 | T__59 | ST | ND | RD | TH | DIGIT | WS | EOL | LETTER )\n alt_7 = 56\n alt_7 = @dfa7.predict( @input )\n case alt_7\n when 1\n # at line 1:10: T__12\n t__12!\n\n when 2\n # at line 1:16: T__13\n t__13!\n\n when 3\n # at line 1:22: T__14\n t__14!\n\n when 4\n # at line 1:28: T__15\n t__15!\n\n when 5\n # at line 1:34: T__16\n t__16!\n\n when 6\n # at line 1:40: T__17\n t__17!\n\n when 7\n # at line 1:46: T__18\n t__18!\n\n when 8\n # at line 1:52: T__19\n t__19!\n\n when 9\n # at line 1:58: T__20\n t__20!\n\n when 10\n # at line 1:64: T__21\n t__21!\n\n when 11\n # at line 1:70: T__22\n t__22!\n\n when 12\n # at line 1:76: T__23\n t__23!\n\n when 13\n # at line 1:82: T__24\n t__24!\n\n when 14\n # at line 1:88: T__25\n t__25!\n\n when 15\n # at line 1:94: T__26\n t__26!\n\n when 16\n # at line 1:100: T__27\n t__27!\n\n when 17\n # at line 1:106: T__28\n t__28!\n\n when 18\n # at line 1:112: T__29\n t__29!\n\n when 19\n # at line 1:118: T__30\n t__30!\n\n when 20\n # at line 1:124: T__31\n t__31!\n\n when 21\n # at line 1:130: T__32\n t__32!\n\n when 22\n # at line 1:136: T__33\n t__33!\n\n when 23\n # at line 1:142: T__34\n t__34!\n\n when 24\n # at line 1:148: T__35\n t__35!\n\n when 25\n # at line 1:154: T__36\n t__36!\n\n when 26\n # at line 1:160: T__37\n t__37!\n\n when 27\n # at line 1:166: T__38\n t__38!\n\n when 28\n # at line 1:172: T__39\n t__39!\n\n when 29\n # at line 1:178: T__40\n t__40!\n\n when 30\n # at line 1:184: T__41\n t__41!\n\n when 31\n # at line 1:190: T__42\n t__42!\n\n when 32\n # at line 1:196: T__43\n t__43!\n\n when 33\n # at line 1:202: T__44\n t__44!\n\n when 34\n # at line 1:208: T__45\n t__45!\n\n when 35\n # at line 1:214: T__46\n t__46!\n\n when 36\n # at line 1:220: T__47\n t__47!\n\n when 37\n # at line 1:226: T__48\n t__48!\n\n when 38\n # at line 1:232: T__49\n t__49!\n\n when 39\n # at line 1:238: T__50\n t__50!\n\n when 40\n # at line 1:244: T__51\n t__51!\n\n when 41\n # at line 1:250: T__52\n t__52!\n\n when 42\n # at line 1:256: T__53\n t__53!\n\n when 43\n # at line 1:262: T__54\n t__54!\n\n when 44\n # at line 1:268: T__55\n t__55!\n\n when 45\n # at line 1:274: T__56\n t__56!\n\n when 46\n # at line 1:280: T__57\n t__57!\n\n when 47\n # at line 1:286: T__58\n t__58!\n\n when 48\n # at line 1:292: T__59\n t__59!\n\n when 49\n # at line 1:298: ST\n st!\n\n when 50\n # at line 1:301: ND\n nd!\n\n when 51\n # at line 1:304: RD\n rd!\n\n when 52\n # at line 1:307: TH\n th!\n\n when 53\n # at line 1:310: DIGIT\n digit!\n\n when 54\n # at line 1:316: WS\n ws!\n\n when 55\n # at line 1:319: EOL\n eol!\n\n when 56\n # at line 1:323: LETTER\n letter!\n\n end\n end", "def test_additon_w_funcall\n# assert_eq \"helloworld\\n\", interpret(\"'hello' + echo('world')\")\n end", "def variable_or_method_use(method)\n \t_IDENTIFIER13 = nil\n\n\n\n\n \t name = \"\"\n \t is_method = false\n\n\n # 254:7: ( 'this' '.' )? ( IDENTIFIER ) ( fragment_of_variable_or_method_name[name] )* ( '(' ')' )?\n # 254:7: ( 'this' '.' )?\n alt35 = 2\n # 254:7: ( 'this' '.' )?\n look_ahead35_0 = look_ahead(1)\n\n if look_ahead35_0 == :T58 \n alt35 = 1\n end\n case alt35\n when 1\n # 254:9: 'this' '.'\n match(:T58)\n match(:DOT)\n name << \"this.\" \n end\n # 255:9: IDENTIFIER\n _IDENTIFIER13 = @input.look_ahead(1)\n match(:IDENTIFIER)\n name << _IDENTIFIER13.text \n # 256:7: ( fragment_of_variable_or_method_name[name] )*\n while true\n alt36 = 2\n # ()* loopback of 256:7: ( fragment_of_variable_or_method_name[name] )*\n look_ahead36_0 = look_ahead(1)\n if look_ahead36_0 == :DOT \n alt36 = 1\n end\n case alt36\n when 1\n # 256:7: fragment_of_variable_or_method_name[name]\n fragment_of_variable_or_method_name(name)\n\n else\n break\n end\n end\n # 257:7: ( '(' ')' )?\n alt37 = 2\n # 257:7: ( '(' ')' )?\n look_ahead37_0 = look_ahead(1)\n\n if look_ahead37_0 == :LEFT_PARENTESIS \n # 257:7: ( '(' ')' )?\n look_ahead37_1 = look_ahead(2)\n\n if look_ahead37_1 == :RIGHT_PARENTESIS \n alt37 = 1\n end\n end\n case alt37\n when 1\n # 257:9: '(' ')'\n match(:LEFT_PARENTESIS)\n match(:RIGHT_PARENTESIS)\n is_method = true\n end\n\n if is_method\n method.add_method_call(name, _IDENTIFIER13.line)\n\n else\n method.add_use_of(name, _IDENTIFIER13.line)\n end\n \n\n\n\n end", "def chunk_char!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 14 )\n\n \n # - - - - main rule block - - - -\n # at line 68:3: (~ ( '>' | '<' | '#' | '`' | '\\\"' | '\\\\'' | '|' | '(' | ')' | '$' | ';' | ' ' | '?' | '*' | '~' | '\\\\\\\\' | '\\\\t' | '{' | '}' | '\\\\n' | '\\\\r' ) | '\\\\\\\\' . )\n alt_23 = 2\n look_23_0 = @input.peek( 1 )\n\n if ( look_23_0.between?( 0x0, 0x8 ) || look_23_0.between?( 0xb, 0xc ) || look_23_0.between?( 0xe, 0x1f ) || look_23_0 == 0x21 || look_23_0.between?( 0x25, 0x26 ) || look_23_0.between?( 0x2b, 0x3a ) || look_23_0 == 0x3d || look_23_0.between?( 0x40, 0x5b ) || look_23_0.between?( 0x5d, 0x5f ) || look_23_0.between?( 0x61, 0x7a ) || look_23_0.between?( 0x7f, 0xffff ) )\n alt_23 = 1\n elsif ( look_23_0 == 0x5c )\n alt_23 = 2\n else\n raise NoViableAlternative( \"\", 23, 0 )\n end\n case alt_23\n when 1\n # at line 68:5: ~ ( '>' | '<' | '#' | '`' | '\\\"' | '\\\\'' | '|' | '(' | ')' | '$' | ';' | ' ' | '?' | '*' | '~' | '\\\\\\\\' | '\\\\t' | '{' | '}' | '\\\\n' | '\\\\r' )\n if @input.peek( 1 ).between?( 0x0, 0x8 ) || @input.peek( 1 ).between?( 0xb, 0xc ) || @input.peek( 1 ).between?( 0xe, 0x1f ) || @input.peek(1) == 0x21 || @input.peek( 1 ).between?( 0x25, 0x26 ) || @input.peek( 1 ).between?( 0x2b, 0x3a ) || @input.peek(1) == 0x3d || @input.peek( 1 ).between?( 0x40, 0x5b ) || @input.peek( 1 ).between?( 0x5d, 0x5f ) || @input.peek( 1 ).between?( 0x61, 0x7a ) || @input.peek( 1 ).between?( 0x7f, 0xff )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n\n when 2\n # at line 70:5: '\\\\\\\\' .\n match( 0x5c )\n match_any\n\n end\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 14 )\n\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 token!\n # at line 1:8: ( AMP | AMP_ASGN | GEQ | AND | GET | GREATER | HAT | HAT_ASGN | QMARK | ARROW | RBRACE | ASGN | IF | RBRACK | IN | BL_END | INCR | BREAK | INSTANCEOF | RETURN | IS_DEFINED | RPAREN | CASE | RSHIFT | CATCH | RSHIFT3 | COLON | LBRACE | RSHIFT3_ASGN | COMMA | LBRACK | RSHIFT_ASGN | LEQ | SEMI | CONST | LESS | SET | CONTINUE | LET | DECR | LPAREN | DEFAULT | LSHIFT | STAR | DELETE | LSHIFT_ASGN | STAR_ASGN | MACRO | SWITCH | MINUS | THIS | DO | MINUS_ASGN | THROW | DOT | TILDE | TRUE | NEQ | TRY | NEQQ | TYPEOF | NEW | EACH | NOT | UNDEFINED | ELSE | NULL | UNLESS | EQ | UNTIL | EQQ | OR | FALSE | OR_ASGN | VAR | FINALLY | VOID | FOR | PIPE | WHILE | PIPE_ASGN | WITH | FUNCTION | PLUS | YIELD | PLUS_ASGN | IS_UNDEFINED | POUND | DEF | CLASS_DEF | OBJECT_DEF | T__148 | T__149 | T__150 | MOD | SLASH | DOC | STRING | NUMBER | NEWLINE | IVAR | ID | WS | EJS )\n alt_72 = 104\n alt_72 = @dfa72.predict( @input )\n case alt_72\n when 1\n # at line 1:10: AMP\n amp!\n\n when 2\n # at line 1:14: AMP_ASGN\n amp_asgn!\n\n when 3\n # at line 1:23: GEQ\n geq!\n\n when 4\n # at line 1:27: AND\n and!\n\n when 5\n # at line 1:31: GET\n get!\n\n when 6\n # at line 1:35: GREATER\n greater!\n\n when 7\n # at line 1:43: HAT\n hat!\n\n when 8\n # at line 1:47: HAT_ASGN\n hat_asgn!\n\n when 9\n # at line 1:56: QMARK\n qmark!\n\n when 10\n # at line 1:62: ARROW\n arrow!\n\n when 11\n # at line 1:68: RBRACE\n rbrace!\n\n when 12\n # at line 1:75: ASGN\n asgn!\n\n when 13\n # at line 1:80: IF\n if!\n\n when 14\n # at line 1:83: RBRACK\n rbrack!\n\n when 15\n # at line 1:90: IN\n in!\n\n when 16\n # at line 1:93: BL_END\n bl_end!\n\n when 17\n # at line 1:100: INCR\n incr!\n\n when 18\n # at line 1:105: BREAK\n break!\n\n when 19\n # at line 1:111: INSTANCEOF\n instanceof!\n\n when 20\n # at line 1:122: RETURN\n return!\n\n when 21\n # at line 1:129: IS_DEFINED\n is_defined!\n\n when 22\n # at line 1:140: RPAREN\n rparen!\n\n when 23\n # at line 1:147: CASE\n case!\n\n when 24\n # at line 1:152: RSHIFT\n rshift!\n\n when 25\n # at line 1:159: CATCH\n catch!\n\n when 26\n # at line 1:165: RSHIFT3\n rshift_3!\n\n when 27\n # at line 1:173: COLON\n colon!\n\n when 28\n # at line 1:179: LBRACE\n lbrace!\n\n when 29\n # at line 1:186: RSHIFT3_ASGN\n rshift_3_asgn!\n\n when 30\n # at line 1:199: COMMA\n comma!\n\n when 31\n # at line 1:205: LBRACK\n lbrack!\n\n when 32\n # at line 1:212: RSHIFT_ASGN\n rshift_asgn!\n\n when 33\n # at line 1:224: LEQ\n leq!\n\n when 34\n # at line 1:228: SEMI\n semi!\n\n when 35\n # at line 1:233: CONST\n const!\n\n when 36\n # at line 1:239: LESS\n less!\n\n when 37\n # at line 1:244: SET\n set!\n\n when 38\n # at line 1:248: CONTINUE\n continue!\n\n when 39\n # at line 1:257: LET\n let!\n\n when 40\n # at line 1:261: DECR\n decr!\n\n when 41\n # at line 1:266: LPAREN\n lparen!\n\n when 42\n # at line 1:273: DEFAULT\n default!\n\n when 43\n # at line 1:281: LSHIFT\n lshift!\n\n when 44\n # at line 1:288: STAR\n star!\n\n when 45\n # at line 1:293: DELETE\n delete!\n\n when 46\n # at line 1:300: LSHIFT_ASGN\n lshift_asgn!\n\n when 47\n # at line 1:312: STAR_ASGN\n star_asgn!\n\n when 48\n # at line 1:322: MACRO\n macro!\n\n when 49\n # at line 1:328: SWITCH\n switch!\n\n when 50\n # at line 1:335: MINUS\n minus!\n\n when 51\n # at line 1:341: THIS\n this!\n\n when 52\n # at line 1:346: DO\n do!\n\n when 53\n # at line 1:349: MINUS_ASGN\n minus_asgn!\n\n when 54\n # at line 1:360: THROW\n throw!\n\n when 55\n # at line 1:366: DOT\n dot!\n\n when 56\n # at line 1:370: TILDE\n tilde!\n\n when 57\n # at line 1:376: TRUE\n true!\n\n when 58\n # at line 1:381: NEQ\n neq!\n\n when 59\n # at line 1:385: TRY\n try!\n\n when 60\n # at line 1:389: NEQQ\n neqq!\n\n when 61\n # at line 1:394: TYPEOF\n typeof!\n\n when 62\n # at line 1:401: NEW\n new!\n\n when 63\n # at line 1:405: EACH\n each!\n\n when 64\n # at line 1:410: NOT\n not!\n\n when 65\n # at line 1:414: UNDEFINED\n undefined!\n\n when 66\n # at line 1:424: ELSE\n else!\n\n when 67\n # at line 1:429: NULL\n null!\n\n when 68\n # at line 1:434: UNLESS\n unless!\n\n when 69\n # at line 1:441: EQ\n eq!\n\n when 70\n # at line 1:444: UNTIL\n until!\n\n when 71\n # at line 1:450: EQQ\n eqq!\n\n when 72\n # at line 1:454: OR\n or!\n\n when 73\n # at line 1:457: FALSE\n false!\n\n when 74\n # at line 1:463: OR_ASGN\n or_asgn!\n\n when 75\n # at line 1:471: VAR\n var!\n\n when 76\n # at line 1:475: FINALLY\n finally!\n\n when 77\n # at line 1:483: VOID\n void!\n\n when 78\n # at line 1:488: FOR\n for!\n\n when 79\n # at line 1:492: PIPE\n pipe!\n\n when 80\n # at line 1:497: WHILE\n while!\n\n when 81\n # at line 1:503: PIPE_ASGN\n pipe_asgn!\n\n when 82\n # at line 1:513: WITH\n with!\n\n when 83\n # at line 1:518: FUNCTION\n function!\n\n when 84\n # at line 1:527: PLUS\n plus!\n\n when 85\n # at line 1:532: YIELD\n yield!\n\n when 86\n # at line 1:538: PLUS_ASGN\n plus_asgn!\n\n when 87\n # at line 1:548: IS_UNDEFINED\n is_undefined!\n\n when 88\n # at line 1:561: POUND\n pound!\n\n when 89\n # at line 1:567: DEF\n def!\n\n when 90\n # at line 1:571: CLASS_DEF\n class_def!\n\n when 91\n # at line 1:581: OBJECT_DEF\n object_def!\n\n when 92\n # at line 1:592: T__148\n t__148!\n\n when 93\n # at line 1:599: T__149\n t__149!\n\n when 94\n # at line 1:606: T__150\n t__150!\n\n when 95\n # at line 1:613: MOD\n mod!\n\n when 96\n # at line 1:617: SLASH\n slash!\n\n when 97\n # at line 1:623: DOC\n doc!\n\n when 98\n # at line 1:627: STRING\n string!\n\n when 99\n # at line 1:634: NUMBER\n number!\n\n when 100\n # at line 1:641: NEWLINE\n newline!\n\n when 101\n # at line 1:649: IVAR\n ivar!\n\n when 102\n # at line 1:654: ID\n id!\n\n when 103\n # at line 1:657: WS\n ws!\n\n when 104\n # at line 1:660: EJS\n ejs!\n\n end\n end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def p(string);end", "def method_source(mnemonic, flags, sample, prefix)\n\t\"\"\"// Mnemonic: #{sample}\n// Sets Flags: #{flags}\nfunc (p *GBProcessor) #{prefix}#{mnemonic}(opcode byte, params ...byte) {\n\n}\"\"\"\nend", "def comment_keywords\n if self =~ /(select)/i\n foo=$1\n newstr = self.gsub(foo, \"/*#{foo}*/\")\n else\n newstr = self\n end\n if newstr =~ /(update)/i\n foo=$1\n newstr = newstr.gsub!(foo, \"/*#{foo}*/\")\n end\n if newstr =~ /(insert)/i\n foo=$1\n newstr = newstr.gsub!(foo, \"/*#{foo}*/\")\n end\n if newstr =~ /(delete)/i\n foo=$1\n newstr = newstr.gsub!(foo, \"/*#{foo}*/\")\n end\n if newstr =~ /(union)/i\n foo=$1\n newstr = newstr.gsub!(foo, \"/*#{foo}*/\")\n end\n if newstr =~ /[, ](concat)/i\n foo=$1\n newstr = newstr.gsub!(foo, \"/*#{foo}*/\")\n end\n if newstr =~ /(group_concat)/i\n foo=$1\n newstr = newstr.gsub!(foo, \"/*#{foo}*/\")\n end\n if newstr =~ /(information_schema)/i\n foo=$1\n newstr = newstr.gsub!(foo, \"/*#{foo}*/\")\n end\n if newstr =~ /(cast)/i\n foo=$1\n newstr = newstr.gsub!(foo, \"/*#{foo}*/\")\n end\n if newstr =~ /(convert)/i\n foo=$1\n newstr = newstr.gsub!(foo, \"/*#{foo}*/\")\n end\n if newstr =~ /(substring)/i\n foo=$1\n newstr = newstr.gsub!(foo, \"/*#{foo}*/\")\n end\n if newstr =~ /(sleep)/i\n foo=$1\n newstr = newstr.gsub!(foo, \"/*#{foo}*/\")\n end\n if newstr =~ /(benchmark)/i\n foo=$1\n newstr = newstr.gsub!(foo, \"/*#{foo}*/\")\n end\n return newstr\n end", "def verify_comment(line) \n end", "def test_test_el__debug_ruby_eval_report\n actual = with_temp_buffer_string {\n el4r_lisp_eval %q((progn\n(el4r-debug-ruby-eval-report \"nil\")\n(el4r-debug-ruby-eval-report \"true\")\n(el4r-debug-ruby-eval-report \"false\")\n(el4r-debug-ruby-eval-report \"1 + 6\")\n(el4r-debug-ruby-eval-report \"\\\"String\\\"\")\n))\n }\n expected = <<EOB\nnil\n => nil\ntrue\n => t\nfalse\n => nil\n1 + 6\n => 7\n\"String\"\n => \"String\"\nEOB\n assert_equal(expected, actual)\n end", "def create_comment(string, &block); end", "def create_comment(string, &block); end", "def generalized_delimiter!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 110 )\n\n \n # - - - - main rule block - - - -\n # at line 991:3: ( NESTED_PARENTHESES | NESTED_BRACKETS | NESTED_BRACES | NESTED_ANGLES | ( '!' | '@' | '~' | '`' | '^' | '&' | '*' | '-' | '+' | '=' | '|' | ':' | ';' | '.' | ',' | '?' | '/' | '\\\"' | '\\\\'' ) )\n alt_65 = 5\n case look_65 = @input.peek( 1 )\n when 0x28 then alt_65 = 1\n when 0x5b then alt_65 = 2\n when 0x7b then alt_65 = 3\n when 0x3c then alt_65 = 4\n when 0x21, 0x22, 0x26, 0x27, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x3a, 0x3b, 0x3d, 0x3f, 0x40, 0x5e, 0x60, 0x7c, 0x7e then alt_65 = 5\n else\n raise NoViableAlternative( \"\", 65, 0 )\n end\n case alt_65\n when 1\n # at line 991:5: NESTED_PARENTHESES\n nested_parentheses!\n\n when 2\n # at line 992:5: NESTED_BRACKETS\n nested_brackets!\n\n when 3\n # at line 993:5: NESTED_BRACES\n nested_braces!\n\n when 4\n # at line 994:5: NESTED_ANGLES\n nested_angles!\n\n when 5\n # at line 995:5: ( '!' | '@' | '~' | '`' | '^' | '&' | '*' | '-' | '+' | '=' | '|' | ':' | ';' | '.' | ',' | '?' | '/' | '\\\"' | '\\\\'' )\n if @input.peek( 1 ).between?( 0x21, 0x22 ) || @input.peek( 1 ).between?( 0x26, 0x27 ) || @input.peek( 1 ).between?( 0x2a, 0x2f ) || @input.peek( 1 ).between?( 0x3a, 0x3b ) || @input.peek(1) == 0x3d || @input.peek( 1 ).between?( 0x3f, 0x40 ) || @input.peek(1) == 0x5e || @input.peek(1) == 0x60 || @input.peek(1) == 0x7c || @input.peek(1) == 0x7e\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n # --> action\n scan_until_delimiter( @input.peek( -1 ) ) \n # <-- action\n\n end\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 110 )\n\n end", "def as_you_like_it_quote; end", "def p15\n\t\nend", "def code_point; end", "def define_python_methods\r\n @p.Execute(\"\r\ndef foo(x):\r\n return x + x\r\n\r\ndef bar(x):\r\n return x * x\r\n\"\r\n )\r\nend", "def fix_syntax_errors!\n # 1.34\n # patch_file! \"common/on_actions/00_on_actions.txt\" do |content|\n # content.gsub(/(effect = )\"(.*?)\"/m){ $1 + \"{\" + $2 + \"}\" }\n # end\n end", "def comments_hash_flag=(_arg0); end", "def comments_hash_flag=(_arg0); end", "def format_code(code,test)\n <<-EOS\n#!/usr/bin/env ruby\nrequire \\'minitest/autorun\\'\n \n#{code}\n\nclass UserCodeTest < Minitest::Test\n \n def test_assertions \n #{test}\n end\nend\n EOS\n end", "def method_definition(class_def)\n \t_IDENTIFIER7 = nil\n\n\n\n\n \t method = MethodDefinition.new\n\n\n # 123:5: modifier[method] ( type[method] )? IDENTIFIER parameters[method] ( method_body[method] | ';' )\n modifier(method)\n\n # 123:22: ( type[method] )?\n alt16 = 2\n # 123:22: ( type[method] )?\n look_ahead16_0 = look_ahead(1)\n\n if look_ahead16_0 == :IDENTIFIER \n # 123:22: ( type[method] )?\n look_ahead16_1 = look_ahead(2)\n\n if look_ahead16_1 == :IDENTIFIER || look_ahead16_1 == :LEFT_ANGULAR_BRACKET || (TOKENS[look_ahead16_1] >= 34 && TOKENS[look_ahead16_1] <= 35) \n alt16 = 1\n end\n end\n case alt16\n when 1\n # 123:23: type[method]\n type(method)\n\n end\n _IDENTIFIER7 = @input.look_ahead(1)\n match(:IDENTIFIER)\n parameters(method)\n\n # 123:68: ( method_body[method] | ';' )\n alt17 = 2\n # 123:68: ( method_body[method] | ';' )\n look_ahead17_0 = look_ahead(1)\n if look_ahead17_0 == :LEFT_BRACE \n alt17 = 1\n elsif look_ahead17_0 == :SEMICOLON \n alt17 = 2\n else\n raise \"Expected: 123:68: ( method_body[method] | ';' )\"\n end\n case alt17\n when 1\n # 123:69: method_body[method]\n method_body(method)\n\n when 2\n # 123:89: ';'\n match(:SEMICOLON)\n end\n\n method.name = _IDENTIFIER7.text\n method.line = _IDENTIFIER7.line\n class_def.add_member(method)\n \n\n\n\n end", "def test_init\n assert_raise(ArgumentError ) do \n tok = Tokenizer.new\n end\n \n tok = Tokenizer.new(\"test.as\")\n assert_equal( 11,tok.buffer.size ) #counts empty lines\n #assert_equal( tok.buffer[6], nil )\n assert_equal( tok.buffer[5], nil )\n assert_equal( tok.buffer[4].to_s, \"break:\" )\n assert_equal( tok.buffer[3], [\"break:\", \";\"] )\n assert_equal( tok.buffer[2].join(\" \"), \";This is also a comment\" )\n assert_equal( tok.buffer[1].join(\" \"), \";\" )\n assert_equal( tok.buffer[0].join(\" \"), \"; This is a comment\" )\n end", "def docufy(src,i)\n m = /RM_[A-z0-9]+/.match(src[i])\n name = m[0]\n name = name.sub(\"RM_\",\"RedisModule_\")\n proto = src[i].sub(\"{\",\"\").strip+\";\\n\"\n proto = proto.sub(\"RM_\",\"RedisModule_\")\n proto = linebreak_proto(proto, \" \");\n # Add a link target with the function name. (We don't trust the exact id of\n # the generated one, which depends on the Markdown implementation.)\n puts \"<span id=\\\"#{name}\\\"></span>\\n\\n\"\n puts \"### `#{name}`\\n\\n\"\n puts \" #{proto}\\n\"\n puts \"**Available since:** #{$since[name] or \"unreleased\"}\\n\\n\"\n comment = \"\"\n while true\n i = i-1\n comment = src[i]+comment\n break if src[i] =~ /\\/\\*/\n end\n comment = markdown(comment)\n puts comment+\"\\n\\n\"\nend", "def test_dsl_4\n #-------------------------\n show Spock + Lizard + Rock\n #-------------------------\n assert_equal \\\n \"Lizard poisons Spock (winner Lizard)\\n\" \\\n \"Rock crushes Lizard (winner Rock)\\n\" \\\n \"Result = Rock\\n\", \\\n @out.string\n end", "def function_literal\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 70 )\n return_value = FunctionLiteralReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n string_literal333 = nil\n string_literal337 = nil\n variable_name334 = nil\n function_parameters335 = nil\n statement_block336 = nil\n variable_name338 = nil\n function_parameters339 = nil\n statement_block340 = nil\n\n tree_for_string_literal333 = nil\n tree_for_string_literal337 = nil\n\n begin\n # at line 715:3: ( 'function' ( variable_name )? function_parameters statement_block | '->' ( variable_name )? ( function_parameters )? statement_block )\n alt_86 = 2\n look_86_0 = @input.peek( 1 )\n\n if ( look_86_0 == FUNCTION )\n alt_86 = 1\n elsif ( look_86_0 == ARROW )\n alt_86 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 86, 0 )\n end\n case alt_86\n when 1\n root_0 = @adaptor.create_flat_list\n\n\n # at line 715:5: 'function' ( variable_name )? function_parameters statement_block\n string_literal333 = match( FUNCTION, TOKENS_FOLLOWING_FUNCTION_IN_function_literal_5064 )\n if @state.backtracking == 0\n\n tree_for_string_literal333 = @adaptor.create_with_payload( string_literal333 )\n root_0 = @adaptor.become_root( tree_for_string_literal333, root_0 )\n\n end\n # at line 715:17: ( variable_name )?\n alt_83 = 2\n look_83_0 = @input.peek( 1 )\n\n if ( look_83_0 == GET || look_83_0 == SET || look_83_0 == MACRO || look_83_0 == EACH || look_83_0.between?( DEF, OBJECT_DEF ) || look_83_0 == ID || look_83_0.between?( T__148, T__150 ) )\n alt_83 = 1\n end\n case alt_83\n when 1\n # at line 715:17: variable_name\n @state.following.push( TOKENS_FOLLOWING_variable_name_IN_function_literal_5067 )\n variable_name334 = variable_name\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, variable_name334.tree )\n end\n\n end\n @state.following.push( TOKENS_FOLLOWING_function_parameters_IN_function_literal_5070 )\n function_parameters335 = function_parameters\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, function_parameters335.tree )\n end\n @state.following.push( TOKENS_FOLLOWING_statement_block_IN_function_literal_5072 )\n statement_block336 = statement_block\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, statement_block336.tree )\n end\n\n when 2\n root_0 = @adaptor.create_flat_list\n\n\n # at line 716:5: '->' ( variable_name )? ( function_parameters )? statement_block\n string_literal337 = match( ARROW, TOKENS_FOLLOWING_ARROW_IN_function_literal_5078 )\n if @state.backtracking == 0\n\n tree_for_string_literal337 = @adaptor.create_with_payload( string_literal337 )\n root_0 = @adaptor.become_root( tree_for_string_literal337, root_0 )\n\n end\n # at line 716:11: ( variable_name )?\n alt_84 = 2\n look_84_0 = @input.peek( 1 )\n\n if ( look_84_0 == GET || look_84_0 == SET || look_84_0 == MACRO || look_84_0 == EACH || look_84_0.between?( DEF, OBJECT_DEF ) || look_84_0 == ID || look_84_0.between?( T__148, T__150 ) )\n alt_84 = 1\n end\n case alt_84\n when 1\n # at line 716:11: variable_name\n @state.following.push( TOKENS_FOLLOWING_variable_name_IN_function_literal_5081 )\n variable_name338 = variable_name\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, variable_name338.tree )\n end\n\n end\n # at line 716:26: ( function_parameters )?\n alt_85 = 2\n look_85_0 = @input.peek( 1 )\n\n if ( look_85_0 == LPAREN )\n alt_85 = 1\n end\n case alt_85\n when 1\n # at line 716:26: function_parameters\n @state.following.push( TOKENS_FOLLOWING_function_parameters_IN_function_literal_5084 )\n function_parameters339 = function_parameters\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, function_parameters339.tree )\n end\n\n end\n @state.following.push( TOKENS_FOLLOWING_statement_block_IN_function_literal_5087 )\n statement_block340 = statement_block\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, statement_block340.tree )\n end\n\n end# - - - - - - - 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__, 70 )\n\n end\n \n return return_value\n end", "def buzzword; end", "def buzzword; end", "def preprocess\n lineno = 0\n shouldWrite = false\n inFunction = false\n printer = File.open(RB_FILE,'w')\n scanner = File.open(TEX_FILE,'r')\n if printer && scanner\n printer.puts RB_REQUIRE\n scanner.each_line do |line|\n lineno = lineno + 1\n if (line.include? TEX_ENV_01_E) && !determineTexCommented(line, TEX_ENV_01_E)\n puts \"Encountered #{TEX_ENV_01_E} on line #{lineno}\"\n shouldWrite = false\n end\n if shouldWrite\n stripped = line.strip\n if (stripped.include? TEX_MOD) && !determineRubyCommented(stripped, TEX_MOD) && !inFunction\n printer.print appendLineNumberToTexPrintCall(stripped, lineno)\n elsif (stripped.include? RB_CLASS_CREATE) && !determineRubyCommented(stripped, RB_CLASS_CREATE) && !inFunction\n printer.print appendLineNumberToInitialization(stripped, lineno)\n elsif (stripped.include? RB_METHOD_S) && !determineRubyCommented(stripped, RB_METHOD_S) && !inFunction\n puts \"Processing function definition: found line containing #{stripped}\"\n inFunction = true\n extracted = extractFunctionMeta stripped\n $fcnref.store(extracted[0], extracted[1])\n $defstack.push 1\n if (stripped.include? '(') && (stripped.include? ')')\n puts \"Injection into formatted def as \\( \\)! Boo!\"\n else\n puts \"Injection into formatted def as _,_! This is preferrable.\"\n end\n printer.print appendLineNumberArgToFunctionDefinition stripped\n elsif inFunction\n puts \"Parsing #{stripped} inside function...\"\n printer.print stripped\n if (line.include? TEX_MOD) && !determineRubyCommented(line, \"Tex\")\n printer.print \", #{RBTEX_INSERT_LINE}\"\n end\n RB_KEYWORD_END.each do |kwd|\n if line.include? kwd\n puts \"Encountered '#{kwd}'; pushing onto stack...\"\n $defstack.push 1\n break\n end\n end\n if line.include? 'end'\n puts \"Encountered 'end'; popping off of stack...\"\n $defstack.pop\n end\n inFunction = $defstack.any?\n else\n print \"STRIPPED: #{stripped}\\t\"\n deffed = false\n printer.print stripped\n $fcnref.each do |fcn, args|\n if stripped.include? fcn\n if (line.include? '(') && (line.include? ')')\n\n else\n printer.print (args != 0) ? (\", #{lineno}\") : (\" #{lineno}\")\n break\n end\n end\n end\n end\n printer.puts \"\"\n end\n if (line.include? TEX_ENV_01_S) && !determineTexCommented(line, TEX_ENV_01_S)\n puts \"Encountered #{TEX_ENV_01_S} on line #{lineno}\"\n $rbenvs = $rbenvs + 1\n shouldWrite = true\n end\n end\n end\n printer.close\n scanner.close\n return 0\nend", "def token!\n # at line 1:8: ( STRING | SHELL_STRING | CMD_OUTPUT | SPACE | COMMAND_END | VARIABLE | GLOB | CHUNK | OPEN_PAR | CLOSE_PAR | PIPELINE_OPERATOR | REDIRECT | COMMENT )\n alt_25 = 13\n alt_25 = @dfa25.predict( @input )\n case alt_25\n when 1\n # at line 1:10: STRING\n string!\n\n when 2\n # at line 1:17: SHELL_STRING\n shell_string!\n\n when 3\n # at line 1:30: CMD_OUTPUT\n cmd_output!\n\n when 4\n # at line 1:41: SPACE\n space!\n\n when 5\n # at line 1:47: COMMAND_END\n command_end!\n\n when 6\n # at line 1:59: VARIABLE\n variable!\n\n when 7\n # at line 1:68: GLOB\n glob!\n\n when 8\n # at line 1:73: CHUNK\n chunk!\n\n when 9\n # at line 1:79: OPEN_PAR\n open_par!\n\n when 10\n # at line 1:88: CLOSE_PAR\n close_par!\n\n when 11\n # at line 1:98: PIPELINE_OPERATOR\n pipeline_operator!\n\n when 12\n # at line 1:116: REDIRECT\n redirect!\n\n when 13\n # at line 1:125: COMMENT\n comment!\n\n end\n end", "def token!\n # at line 1:8: ( T__8 | T__9 | T__10 | T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | T__31 | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | T__38 | T__39 | T__40 | T__41 | T__42 | T__43 | DIGIT | WS | EOL | LETTER )\n alt_3 = 40\n alt_3 = @dfa3.predict( @input )\n case alt_3\n when 1\n # at line 1:10: T__8\n t__8!\n\n when 2\n # at line 1:15: T__9\n t__9!\n\n when 3\n # at line 1:20: T__10\n t__10!\n\n when 4\n # at line 1:26: T__11\n t__11!\n\n when 5\n # at line 1:32: T__12\n t__12!\n\n when 6\n # at line 1:38: T__13\n t__13!\n\n when 7\n # at line 1:44: T__14\n t__14!\n\n when 8\n # at line 1:50: T__15\n t__15!\n\n when 9\n # at line 1:56: T__16\n t__16!\n\n when 10\n # at line 1:62: T__17\n t__17!\n\n when 11\n # at line 1:68: T__18\n t__18!\n\n when 12\n # at line 1:74: T__19\n t__19!\n\n when 13\n # at line 1:80: T__20\n t__20!\n\n when 14\n # at line 1:86: T__21\n t__21!\n\n when 15\n # at line 1:92: T__22\n t__22!\n\n when 16\n # at line 1:98: T__23\n t__23!\n\n when 17\n # at line 1:104: T__24\n t__24!\n\n when 18\n # at line 1:110: T__25\n t__25!\n\n when 19\n # at line 1:116: T__26\n t__26!\n\n when 20\n # at line 1:122: T__27\n t__27!\n\n when 21\n # at line 1:128: T__28\n t__28!\n\n when 22\n # at line 1:134: T__29\n t__29!\n\n when 23\n # at line 1:140: T__30\n t__30!\n\n when 24\n # at line 1:146: T__31\n t__31!\n\n when 25\n # at line 1:152: T__32\n t__32!\n\n when 26\n # at line 1:158: T__33\n t__33!\n\n when 27\n # at line 1:164: T__34\n t__34!\n\n when 28\n # at line 1:170: T__35\n t__35!\n\n when 29\n # at line 1:176: T__36\n t__36!\n\n when 30\n # at line 1:182: T__37\n t__37!\n\n when 31\n # at line 1:188: T__38\n t__38!\n\n when 32\n # at line 1:194: T__39\n t__39!\n\n when 33\n # at line 1:200: T__40\n t__40!\n\n when 34\n # at line 1:206: T__41\n t__41!\n\n when 35\n # at line 1:212: T__42\n t__42!\n\n when 36\n # at line 1:218: T__43\n t__43!\n\n when 37\n # at line 1:224: DIGIT\n digit!\n\n when 38\n # at line 1:230: WS\n ws!\n\n when 39\n # at line 1:233: EOL\n eol!\n\n when 40\n # at line 1:237: LETTER\n letter!\n\n end\n end", "def t__15!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 6)\n\n type = T__15\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 21:9: ')'\n match(?))\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__, 6)\n\n end", "def lex_en_line_comment; end" ]
[ "0.8579387", "0.74072075", "0.7207451", "0.62161624", "0.6124276", "0.60473174", "0.60473174", "0.60473174", "0.60473174", "0.60101485", "0.60101485", "0.60101485", "0.60101485", "0.59200907", "0.58432525", "0.58233386", "0.5794839", "0.57923937", "0.5786963", "0.5758313", "0.57143515", "0.57143515", "0.57143515", "0.57143515", "0.57143515", "0.5699495", "0.5678743", "0.5675834", "0.56617993", "0.563714", "0.5622586", "0.55840313", "0.55840313", "0.554981", "0.55419165", "0.55357987", "0.5513044", "0.54915637", "0.5484687", "0.54839766", "0.5478792", "0.54755336", "0.54755336", "0.54755336", "0.5471612", "0.54658866", "0.54307216", "0.5430342", "0.54249513", "0.54190016", "0.54148203", "0.54146844", "0.54125357", "0.5411245", "0.54029566", "0.5399796", "0.5399796", "0.5399796", "0.5399796", "0.5399796", "0.5399796", "0.5399796", "0.5399796", "0.5399796", "0.5399796", "0.5399796", "0.5399796", "0.5399796", "0.5399796", "0.5399796", "0.5399796", "0.5399796", "0.5398124", "0.53975946", "0.5377436", "0.53706086", "0.5370531", "0.53678066", "0.53678066", "0.5362846", "0.5361363", "0.5359386", "0.53400743", "0.53221375", "0.5318115", "0.53093654", "0.53085405", "0.53051883", "0.53031284", "0.530197", "0.5301265", "0.53004557", "0.53003967", "0.52972573", "0.52972573", "0.5295769", "0.5295337", "0.52902216", "0.52788496", "0.5273896" ]
0.72911394
2
test comment ^^^ meta.function.method.witharguments.ruby keyword.control.def.ruby ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.method.witharguments.ruby entity.name.function.ruby ^ meta.function.method.witharguments.ruby storage.type.variable.ruby ^ meta.function.method.witharguments.ruby variable.parameter.function.ruby ^ meta.function.method.witharguments.ruby punctuation.separator.object.ruby ^^ meta.function.method.witharguments.ruby storage.type.variable.ruby ^ meta.function.method.witharguments.ruby variable.parameter.function.ruby ^ meta.function.method.witharguments.ruby punctuation.separator.object.ruby ^ meta.function.method.witharguments.ruby storage.type.variable.ruby ^ meta.function.method.witharguments.ruby variable.parameter.function.ruby ^ punctuation.separator.statement.ruby ^^^^^ variable.other.ruby ^ punctuation.separator.object.ruby ^^^^^ variable.other.ruby ^ keyword.operator.assignment.ruby ^ punctuation.section.array.begin.ruby ^ constant.numeric.ruby ^ punctuation.separator.object.ruby ^ constant.numeric.ruby ^ punctuation.section.array.end.ruby ^^^ keyword.control.ruby ^ comment.line.numbersign.ruby punctuation.definition.comment.ruby ^^^^^^^^^^^^^ comment.line.numbersign.ruby
def method_without_parentheses *a, **b, &c # test comment # ^^^ meta.function.method.with-arguments.ruby keyword.control.def.ruby # ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.method.with-arguments.ruby entity.name.function.ruby # ^ meta.function.method.with-arguments.ruby storage.type.variable.ruby # ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby # ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby # ^^ meta.function.method.with-arguments.ruby storage.type.variable.ruby # ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby # ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby # ^ meta.function.method.with-arguments.ruby storage.type.variable.ruby # ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby # ^ comment.line.number-sign.ruby punctuation.definition.comment.ruby # ^^^^^^^^^^^^^ comment.line.number-sign.ruby hello, world = [1,2] # ^^^^^ variable.other.ruby # ^ punctuation.separator.object.ruby # ^^^^^ variable.other.ruby # ^ keyword.operator.assignment.ruby # ^ punctuation.section.array.begin.ruby # ^ constant.numeric.ruby # ^ punctuation.separator.object.ruby # ^ constant.numeric.ruby # ^ punctuation.section.array.end.ruby end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def method # test comment\n# ^^^ meta.function.method.without-arguments.ruby keyword.control.def.ruby\n# ^^^^^^ meta.function.method.without-arguments.ruby entity.name.function.ruby\n# ^ comment.line.number-sign.ruby punctuation.definition.comment.ruby\n# ^^^^^^^^^^^^^ comment.line.number-sign.ruby\n hello, world = [1,2]\n# ^^^^^ variable.other.ruby\n# ^ punctuation.separator.object.ruby\n# ^^^^^ variable.other.ruby\n# ^ keyword.operator.assignment.ruby\n# ^ punctuation.section.array.begin.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.separator.object.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.section.array.end.ruby\n end", "def method_with_parentheses(a, b, c = [foo,bar,baz]) # test comment\n# ^^^ meta.function.method.with-arguments.ruby keyword.control.def.ruby\n# ^^^^^^^^^^^^^^^^^^^^^^^ meta.function.method.with-arguments.ruby entity.name.function.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.definition.parameters.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby keyword.operator.assignment.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.section.array.begin.ruby\n# ^^^ meta.function.method.with-arguments.ruby variable.other.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^^^ meta.function.method.with-arguments.ruby variable.other.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^^^ meta.function.method.with-arguments.ruby variable.other.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.section.array.end.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.definition.parameters.ruby\n# ^ comment.line.number-sign.ruby punctuation.definition.comment.ruby\n# ^^^^^^^^^^^^^ comment.line.number-sign.ruby\n hello, world = [1,2]\n# ^^^^^ variable.other.ruby\n# ^ punctuation.separator.object.ruby\n# ^^^^^ variable.other.ruby\n# ^ keyword.operator.assignment.ruby\n# ^ punctuation.section.array.begin.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.separator.object.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.section.array.end.ruby\n end", "def method_without_parentheses a, b, c = [foo,bar,baz] # test comment\n# ^^^ meta.function.method.with-arguments.ruby keyword.control.def.ruby\n# ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.method.with-arguments.ruby entity.name.function.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^ meta.function.method.with-arguments.ruby variable.parameter.function.ruby\n# ^ meta.function.method.with-arguments.ruby keyword.operator.assignment.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.section.array.begin.ruby\n# ^^^ meta.function.method.with-arguments.ruby variable.other.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^^^ meta.function.method.with-arguments.ruby variable.other.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.separator.object.ruby\n# ^^^ meta.function.method.with-arguments.ruby variable.other.ruby\n# ^ meta.function.method.with-arguments.ruby punctuation.section.array.end.ruby\n# ^ comment.line.number-sign.ruby punctuation.definition.comment.ruby\n# ^^^^^^^^^^^^^ comment.line.number-sign.ruby\n hello, world = [1,2]\n# ^^^^^ variable.other.ruby\n# ^ punctuation.separator.object.ruby\n# ^^^^^ variable.other.ruby\n# ^ keyword.operator.assignment.ruby\n# ^ punctuation.section.array.begin.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.separator.object.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.section.array.end.ruby\n end", "def comment _args\n \"comment _args;\" \n end", "def comment(string); end", "def comment(string); end", "def comment(string); end", "def comment(string); end", "def token!\n # at line 1:8: ( T__80 | T__81 | T__82 | EOL | LPAR | RPAR | LLAIZQ | LLADER | COMA | PUNTO | CORDER | CORIZQ | DELIM | ASIGNACION | DOUBLEDOT | COMILLA | OP_REL | OP_ARI | OP_LOG | K_ACCIONARCHIVO | K_ACCIONARREGLO | K_PACKAGE | K_CLASS | K_END | K_DEF | K_VAR | K_REQUIRE | K_IMPLEMENTS | K_EXTENDS | K_IMPRIMIR | K_CONVERSION | K_ASIGNACION | K_RETORNO | K_ACCIONSYS | K_INTERFACE | K_IF | K_TIMES | K_DO | K_EACH | K_ELSE | K_INVOKE | K_NEW | TIPO | K_REFERENCIA | K_INSPECCIONAR | K_MATEMATICA | K_NUM | K_RESIZE | K_ORDENAR | ModoOrd | K_BUSQUEDA | K_TIPOBUSQUEDA | K_WHERE | K_SPLIT | K_BEGIN | K_DIR | K_UNION | K_VISIBILIDAD | K_MODIFICADOR | K_ARRAY | K_PROPIEDAD | K_GET | K_SET | K_VALUE | K_INITIALIZE | K_FUNC | K_VOID | HexLiteral | DecimalLiteral | OctalLiteral | WS | LINE_COMMENT | Identificador )\n alt_28 = 73\n alt_28 = @dfa28.predict( @input )\n case alt_28\n when 1\n # at line 1:10: T__80\n t__80!\n\n\n when 2\n # at line 1:16: T__81\n t__81!\n\n\n when 3\n # at line 1:22: T__82\n t__82!\n\n\n when 4\n # at line 1:28: EOL\n eol!\n\n\n when 5\n # at line 1:32: LPAR\n lpar!\n\n\n when 6\n # at line 1:37: RPAR\n rpar!\n\n\n when 7\n # at line 1:42: LLAIZQ\n llaizq!\n\n\n when 8\n # at line 1:49: LLADER\n llader!\n\n\n when 9\n # at line 1:56: COMA\n coma!\n\n\n when 10\n # at line 1:61: PUNTO\n punto!\n\n\n when 11\n # at line 1:67: CORDER\n corder!\n\n\n when 12\n # at line 1:74: CORIZQ\n corizq!\n\n\n when 13\n # at line 1:81: DELIM\n delim!\n\n\n when 14\n # at line 1:87: ASIGNACION\n asignacion!\n\n\n when 15\n # at line 1:98: DOUBLEDOT\n doubledot!\n\n\n when 16\n # at line 1:108: COMILLA\n comilla!\n\n\n when 17\n # at line 1:116: OP_REL\n op_rel!\n\n\n when 18\n # at line 1:123: OP_ARI\n op_ari!\n\n\n when 19\n # at line 1:130: OP_LOG\n op_log!\n\n\n when 20\n # at line 1:137: K_ACCIONARCHIVO\n k_accionarchivo!\n\n\n when 21\n # at line 1:153: K_ACCIONARREGLO\n k_accionarreglo!\n\n\n when 22\n # at line 1:169: K_PACKAGE\n k_package!\n\n\n when 23\n # at line 1:179: K_CLASS\n k_class!\n\n\n when 24\n # at line 1:187: K_END\n k_end!\n\n\n when 25\n # at line 1:193: K_DEF\n k_def!\n\n\n when 26\n # at line 1:199: K_VAR\n k_var!\n\n\n when 27\n # at line 1:205: K_REQUIRE\n k_require!\n\n\n when 28\n # at line 1:215: K_IMPLEMENTS\n k_implements!\n\n\n when 29\n # at line 1:228: K_EXTENDS\n k_extends!\n\n\n when 30\n # at line 1:238: K_IMPRIMIR\n k_imprimir!\n\n\n when 31\n # at line 1:249: K_CONVERSION\n k_conversion!\n\n\n when 32\n # at line 1:262: K_ASIGNACION\n k_asignacion!\n\n\n when 33\n # at line 1:275: K_RETORNO\n k_retorno!\n\n\n when 34\n # at line 1:285: K_ACCIONSYS\n k_accionsys!\n\n\n when 35\n # at line 1:297: K_INTERFACE\n k_interface!\n\n\n when 36\n # at line 1:309: K_IF\n k_if!\n\n\n when 37\n # at line 1:314: K_TIMES\n k_times!\n\n\n when 38\n # at line 1:322: K_DO\n k_do!\n\n\n when 39\n # at line 1:327: K_EACH\n k_each!\n\n\n when 40\n # at line 1:334: K_ELSE\n k_else!\n\n\n when 41\n # at line 1:341: K_INVOKE\n k_invoke!\n\n\n when 42\n # at line 1:350: K_NEW\n k_new!\n\n\n when 43\n # at line 1:356: TIPO\n tipo!\n\n\n when 44\n # at line 1:361: K_REFERENCIA\n k_referencia!\n\n\n when 45\n # at line 1:374: K_INSPECCIONAR\n k_inspeccionar!\n\n\n when 46\n # at line 1:389: K_MATEMATICA\n k_matematica!\n\n\n when 47\n # at line 1:402: K_NUM\n k_num!\n\n\n when 48\n # at line 1:408: K_RESIZE\n k_resize!\n\n\n when 49\n # at line 1:417: K_ORDENAR\n k_ordenar!\n\n\n when 50\n # at line 1:427: ModoOrd\n modo_ord!\n\n\n when 51\n # at line 1:435: K_BUSQUEDA\n k_busqueda!\n\n\n when 52\n # at line 1:446: K_TIPOBUSQUEDA\n k_tipobusqueda!\n\n\n when 53\n # at line 1:461: K_WHERE\n k_where!\n\n\n when 54\n # at line 1:469: K_SPLIT\n k_split!\n\n\n when 55\n # at line 1:477: K_BEGIN\n k_begin!\n\n\n when 56\n # at line 1:485: K_DIR\n k_dir!\n\n\n when 57\n # at line 1:491: K_UNION\n k_union!\n\n\n when 58\n # at line 1:499: K_VISIBILIDAD\n k_visibilidad!\n\n\n when 59\n # at line 1:513: K_MODIFICADOR\n k_modificador!\n\n\n when 60\n # at line 1:527: K_ARRAY\n k_array!\n\n\n when 61\n # at line 1:535: K_PROPIEDAD\n k_propiedad!\n\n\n when 62\n # at line 1:547: K_GET\n k_get!\n\n\n when 63\n # at line 1:553: K_SET\n k_set!\n\n\n when 64\n # at line 1:559: K_VALUE\n k_value!\n\n\n when 65\n # at line 1:567: K_INITIALIZE\n k_initialize!\n\n\n when 66\n # at line 1:580: K_FUNC\n k_func!\n\n\n when 67\n # at line 1:587: K_VOID\n k_void!\n\n\n when 68\n # at line 1:594: HexLiteral\n hex_literal!\n\n\n when 69\n # at line 1:605: DecimalLiteral\n decimal_literal!\n\n\n when 70\n # at line 1:620: OctalLiteral\n octal_literal!\n\n\n when 71\n # at line 1:633: WS\n ws!\n\n\n when 72\n # at line 1:636: LINE_COMMENT\n line_comment!\n\n\n when 73\n # at line 1:649: Identificador\n identificador!\n\n\n end\n end", "def comment=(_arg0); end", "def comment=(_arg0); end", "def comment=(_arg0); end", "def comment=(_arg0); end", "def test_comment_full_name\n 't1_cce66qf'\nend", "def some_method(with:, args:)\n # Floating comment\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 test; end", "def test_method\n \"Here is the sample input\"\n end", "def function_definition\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 8 )\n\n\n value = nil\n\n\n name = nil\n type = nil\n a = nil\n\n\n begin\n # at line 51:5: OPEN type= variable_type name= IDENT ( '(' (type= variable_type name= IDENT ( ',' type= variable_type name= IDENT )* )? ')' )? ( CLOSE | NL (a= statement )* CLOSE )\n match( OPEN, TOKENS_FOLLOWING_OPEN_IN_function_definition_350 )\n @state.following.push( TOKENS_FOLLOWING_variable_type_IN_function_definition_354 )\n type = variable_type\n @state.following.pop\n name = match( IDENT, TOKENS_FOLLOWING_IDENT_IN_function_definition_358 )\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value = FunctionDefinitionEval.new(name.text, type) \n # <-- action\n end\n\n # at line 52:3: ( '(' (type= variable_type name= IDENT ( ',' type= variable_type name= IDENT )* )? ')' )?\n alt_17 = 2\n look_17_0 = @input.peek( 1 )\n\n if ( look_17_0 == T__34 )\n alt_17 = 1\n end\n case alt_17\n when 1\n # at line 52:5: '(' (type= variable_type name= IDENT ( ',' type= variable_type name= IDENT )* )? ')'\n match( T__34, TOKENS_FOLLOWING_T__34_IN_function_definition_366 )\n # at line 52:9: (type= variable_type name= IDENT ( ',' type= variable_type name= IDENT )* )?\n alt_16 = 2\n look_16_0 = @input.peek( 1 )\n\n if ( look_16_0 == IDENT || look_16_0.between?( TYPE_BOOL, TYPE_VOID ) )\n alt_16 = 1\n end\n case alt_16\n when 1\n # at line 53:5: type= variable_type name= IDENT ( ',' type= variable_type name= IDENT )*\n @state.following.push( TOKENS_FOLLOWING_variable_type_IN_function_definition_376 )\n type = variable_type\n @state.following.pop\n name = match( IDENT, TOKENS_FOLLOWING_IDENT_IN_function_definition_380 )\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value.add_argument(type, name.text) \n # <-- action\n end\n\n # at line 54:5: ( ',' type= variable_type name= IDENT )*\n while true # decision 15\n alt_15 = 2\n look_15_0 = @input.peek( 1 )\n\n if ( look_15_0 == T__40 )\n alt_15 = 1\n\n end\n case alt_15\n when 1\n # at line 54:6: ',' type= variable_type name= IDENT\n match( T__40, TOKENS_FOLLOWING_T__40_IN_function_definition_389 )\n @state.following.push( TOKENS_FOLLOWING_variable_type_IN_function_definition_393 )\n type = variable_type\n @state.following.pop\n name = match( IDENT, TOKENS_FOLLOWING_IDENT_IN_function_definition_397 )\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value.add_argument(type, name.text) \n # <-- action\n end\n\n\n else\n break # out of loop for decision 15\n end\n end # loop for decision 15\n\n\n end\n match( T__35, TOKENS_FOLLOWING_T__35_IN_function_definition_409 )\n\n end\n # at line 56:3: ( CLOSE | NL (a= statement )* CLOSE )\n alt_19 = 2\n look_19_0 = @input.peek( 1 )\n\n if ( look_19_0 == CLOSE )\n alt_19 = 1\n elsif ( look_19_0 == NL )\n alt_19 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n\n\n raise NoViableAlternative( \"\", 19, 0 )\n\n end\n case alt_19\n when 1\n # at line 56:5: CLOSE\n match( CLOSE, TOKENS_FOLLOWING_CLOSE_IN_function_definition_418 )\n\n when 2\n # at line 56:13: NL (a= statement )* CLOSE\n match( NL, TOKENS_FOLLOWING_NL_IN_function_definition_422 )\n # at line 56:16: (a= statement )*\n while true # decision 18\n alt_18 = 2\n look_18_0 = @input.peek( 1 )\n\n if ( look_18_0.between?( IDENT, IF ) || look_18_0 == RETURN || look_18_0 == WHILE )\n alt_18 = 1\n\n end\n case alt_18\n when 1\n # at line 56:17: a= statement\n @state.following.push( TOKENS_FOLLOWING_statement_IN_function_definition_427 )\n a = statement\n @state.following.pop\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value.add_statement(a) \n # <-- action\n end\n\n\n else\n break # out of loop for decision 18\n end\n end # loop for decision 18\n\n match( CLOSE, TOKENS_FOLLOWING_CLOSE_IN_function_definition_434 )\n\n end\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__, 8 )\n\n\n end\n\n return value\n end", "def step\n case\n when bol? && check( /=begin/ )\n start_group( :comment, scan_until( /^=end#{EOL}/ ) )\n when bol? && check( /__END__#{EOL}/ )\n start_group( :comment, scan_until( /\\Z/ ) )\n else\n case\n when check( /def\\s+/ )\n start_group :keyword, scan( /def\\s+/ )\n start_group :method, scan_until( /(?=[;(\\s]|#{EOL})/ )\n when check( /class\\s+/ )\n start_group :keyword, scan( /class\\s+/ )\n start_group :class, scan_until( /(?=[;\\s<]|#{EOL})/ )\n when check( /module\\s+/ )\n start_group :keyword, scan( /module\\s+/ )\n start_group :module, scan_until( /(?=[;\\s]|#{EOL})/ )\n when check( /::/ )\n start_group :punct, scan(/::/)\n when check( /:\"/ )\n start_group :symbol, scan(/:/)\n scan_delimited_region :symbol, :symbol, \"\", true\n @allow_operator = true\n when check( /:'/ )\n start_group :symbol, scan(/:/)\n scan_delimited_region :symbol, :symbol, \"\", false\n @allow_operator = true\n when scan( /:[_a-zA-Z@$][$@\\w]*[=!?]?/ )\n start_group :symbol, matched\n @allow_operator = true\n when scan( /\\?(\\\\[^\\n\\r]|[^\\\\\\n\\r\\s])/ )\n start_group :char, matched\n @allow_operator = true\n when check( /(__FILE__|__LINE__|true|false|nil|self)[?!]?/ )\n if @selector || matched[-1] == ?? || matched[-1] == ?!\n start_group :ident,\n scan(/(__FILE__|__LINE__|true|false|nil|self)[?!]?/)\n else\n start_group :constant,\n scan(/(__FILE__|__LINE__|true|false|nil|self)/)\n end\n @selector = false\n @allow_operator = true\n when scan(/0([bB][01]+|[oO][0-7]+|[dD][0-9]+|[xX][0-9a-fA-F]+)/)\n start_group :number, matched\n @allow_operator = true\n else\n case peek(2)\n when \"%r\"\n scan_delimited_region :punct, :regex, scan( /../ ), true\n @allow_operator = true\n when \"%w\", \"%q\"\n scan_delimited_region :punct, :string, scan( /../ ), false\n @allow_operator = true\n when \"%s\"\n scan_delimited_region :punct, :symbol, scan( /../ ), false\n @allow_operator = true\n when \"%W\", \"%Q\", \"%x\"\n scan_delimited_region :punct, :string, scan( /../ ), true\n @allow_operator = true\n when /%[^\\sa-zA-Z0-9]/\n scan_delimited_region :punct, :string, scan( /./ ), true\n @allow_operator = true\n when \"<<\"\n saw_word = ( chunk[-1,1] =~ /[\\w!?]/ )\n start_group :punct, scan( /<</ )\n if saw_word\n @allow_operator = false\n return\n end\n\n float_right = scan( /-/ )\n append \"-\" if float_right\n if ( type = scan( /['\"]/ ) )\n append type\n delim = scan_until( /(?=#{type})/ )\n if delim.nil?\n append scan_until( /\\Z/ )\n return\n end\n else\n delim = scan( /\\w+/ ) or return\n end\n start_group :constant, delim\n start_group :punct, scan( /#{type}/ ) if type\n @heredocs << [ float_right, type, delim ]\n @allow_operator = true\n else\n case peek(1)\n when /[\\n\\r]/\n unless @heredocs.empty?\n scan_heredoc(*@heredocs.shift)\n else\n start_group :normal, scan( /\\s+/ )\n end\n @allow_operator = false\n when /\\s/\n start_group :normal, scan( /\\s+/ )\n when \"#\"\n start_group :comment, scan( /#[^\\n\\r]*/ )\n when /[A-Z]/\n start_group @selector ? :ident : :constant, scan( /\\w+/ )\n @allow_operator = true\n when /[a-z_]/\n word = scan( /\\w+[?!]?/ )\n if !@selector && KEYWORDS.include?( word )\n start_group :keyword, word\n @allow_operator = false\n elsif\n start_group :ident, word\n @allow_operator = true\n end\n @selector = false\n when /\\d/\n start_group :number,\n scan( /[\\d_]+(\\.[\\d_]+)?([eE][\\d_]+)?/ )\n @allow_operator = true\n when '\"'\n scan_delimited_region :punct, :string, \"\", true\n @allow_operator = true\n when '/'\n if @allow_operator\n start_group :punct, scan(%r{/})\n @allow_operator = false\n else\n scan_delimited_region :punct, :regex, \"\", true\n @allow_operator = true\n end\n when \"'\"\n scan_delimited_region :punct, :string, \"\", false\n @allow_operator = true\n when \".\"\n dots = scan( /\\.{1,3}/ )\n start_group :punct, dots\n @selector = ( dots.length == 1 )\n when /[@]/\n start_group :attribute, scan( /@{1,2}\\w*/ )\n @allow_operator = true\n when /[$]/\n start_group :global, scan(/\\$/)\n start_group :global, scan( /\\w+|./ ) if check(/./)\n @allow_operator = true\n when /[-!?*\\/+=<>(\\[\\{}:;,&|%]/\n start_group :punct, scan(/./)\n @allow_operator = false\n when /[)\\]]/\n start_group :punct, scan(/./)\n @allow_operator = true\n else\n # all else just falls through this, to prevent\n # infinite loops...\n append getch\n end\n end\n end\n end\n end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comments=(_arg0); end", "def comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 15)\n\n type = COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 148:3: ( ( '#' | '//' ) (~ '\\\\n' )* | '/*' ( . )* '*/' )\n alt_10 = 2\n look_10_0 = @input.peek(1)\n\n if (look_10_0 == ?#) \n alt_10 = 1\n elsif (look_10_0 == ?/) \n look_10_2 = @input.peek(2)\n\n if (look_10_2 == ?/) \n alt_10 = 1\n elsif (look_10_2 == ?*) \n alt_10 = 2\n else\n nvae = NoViableAlternative(\"\", 10, 2)\n raise nvae\n end\n else\n nvae = NoViableAlternative(\"\", 10, 0)\n raise nvae\n end\n case alt_10\n when 1\n # at line 148:5: ( '#' | '//' ) (~ '\\\\n' )*\n # at line 148:5: ( '#' | '//' )\n alt_7 = 2\n look_7_0 = @input.peek(1)\n\n if (look_7_0 == ?#) \n alt_7 = 1\n elsif (look_7_0 == ?/) \n alt_7 = 2\n else\n nvae = NoViableAlternative(\"\", 7, 0)\n raise nvae\n end\n case alt_7\n when 1\n # at line 148:7: '#'\n match(?#)\n\n when 2\n # at line 148:13: '//'\n match(\"//\")\n\n end\n # at line 148:20: (~ '\\\\n' )*\n while true # decision 8\n alt_8 = 2\n look_8_0 = @input.peek(1)\n\n if (look_8_0.between?(0x0000, ?\\t) || look_8_0.between?(0x000B, 0xFFFF)) \n alt_8 = 1\n\n end\n case alt_8\n when 1\n # at line 148:20: ~ '\\\\n'\n if @input.peek(1).between?(0x0000, ?\\t) || @input.peek(1).between?(0x000B, 0x00FF)\n @input.consume\n else\n mse = MismatchedSet(nil)\n recover(mse)\n raise mse\n end\n\n\n\n else\n break # out of loop for decision 8\n end\n end # loop for decision 8\n\n when 2\n # at line 149:5: '/*' ( . )* '*/'\n match(\"/*\")\n # at line 149:10: ( . )*\n while true # decision 9\n alt_9 = 2\n look_9_0 = @input.peek(1)\n\n if (look_9_0 == ?*) \n look_9_1 = @input.peek(2)\n\n if (look_9_1 == ?/) \n alt_9 = 2\n elsif (look_9_1.between?(0x0000, ?.) || look_9_1.between?(?0, 0xFFFF)) \n alt_9 = 1\n\n end\n elsif (look_9_0.between?(0x0000, ?)) || look_9_0.between?(?+, 0xFFFF)) \n alt_9 = 1\n\n end\n case alt_9\n when 1\n # at line 149:10: .\n match_any\n\n else\n break # out of loop for decision 9\n end\n end # loop for decision 9\n match(\"*/\")\n\n end\n \n @state.type = type\n @state.channel = channel\n # --> action\n skip \n # <-- action\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 15)\n\n end", "def lines_of_code; end", "def lines_of_code; end", "def define_python_methods\r\n @p.Execute(\"\r\ndef foo(x):\r\n return x + x\r\n\r\ndef bar(x):\r\n return x * x\r\n\"\r\n )\r\nend", "def firstMethod()\n p \"hey this is first method ok\"\n p \"here i show how can create method in ruby\"\n p \" know time end \"\nend", "def SomeClass explainMore\n p \"no comment\"\n end", "def method_source(mnemonic, flags, sample, prefix)\n\t\"\"\"// Mnemonic: #{sample}\n// Sets Flags: #{flags}\nfunc (p *GBProcessor) #{prefix}#{mnemonic}(opcode byte, params ...byte) {\n\n}\"\"\"\nend", "def xxxtest_function_prototype_on_more_than_one_line\r\n length = initialize_length(\r\n <<-EOD\r\n func_prototype(\r\n int myCat,\r\n boolean huh\r\n );\r\n EOD\r\n )\r\n assert_equal(nil, length.counts['func_prototype'])\r\n assert_equal(5, length.counts['global'])\r\n end", "def comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 13 )\n\n type = COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 63:5: '#' (~ ( '\\\\r' | '\\\\n' ) )*\n match( 0x23 )\n # at line 63:9: (~ ( '\\\\r' | '\\\\n' ) )*\n while true # decision 22\n alt_22 = 2\n look_22_0 = @input.peek( 1 )\n\n if ( look_22_0.between?( 0x0, 0x9 ) || look_22_0.between?( 0xb, 0xc ) || look_22_0.between?( 0xe, 0xffff ) )\n alt_22 = 1\n\n end\n case alt_22\n when 1\n # at line 63:11: ~ ( '\\\\r' | '\\\\n' )\n if @input.peek( 1 ).between?( 0x0, 0x9 ) || @input.peek( 1 ).between?( 0xb, 0xc ) || @input.peek( 1 ).between?( 0xe, 0xff )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n\n else\n break # out of loop for decision 22\n end\n end # loop for decision 22\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__, 13 )\n\n end", "def hello_world(\"Hello World\", \"o\") \n \nend", "def comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 49 )\n\n\n\n type = COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 228:11: '//' ( . )* ( '\\\\n' | '\\\\r' )\n match( \"//\" )\n\n # at line 228:16: ( . )*\n while true # decision 6\n alt_6 = 2\n look_6_0 = @input.peek( 1 )\n\n if ( look_6_0 == 0xa || look_6_0 == 0xd )\n alt_6 = 2\n elsif ( look_6_0.between?( 0x0, 0x9 ) || look_6_0.between?( 0xb, 0xc ) || look_6_0.between?( 0xe, 0xffff ) )\n alt_6 = 1\n\n end\n case alt_6\n when 1\n # at line 228:16: .\n match_any\n\n else\n break # out of loop for decision 6\n end\n end # loop for decision 6\n\n if @input.peek(1) == 0xa || @input.peek(1) == 0xd\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n\n end\n\n\n\n # --> action\n channel = HIDDEN;\n # <-- action\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 49 )\n\n\n end", "def hello(name)\n #puts \"Hello #{name}!\"\nend", "def auto_analyze=(_arg0); end", "def p(string);end", "def token!\n # at line 1:8: ( T__30 | T__31 | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | T__38 | T__39 | T__40 | T__41 | T__42 | T__43 | T__44 | T__45 | T__46 | T__47 | T__48 | T__49 | T__50 | T__51 | T__52 | T__53 | T__54 | INTEGER | FLOAT | BOOLEAN | STRING | CHAR | INIT | OPEN | CLOSE | TYPE_INT | TYPE_FLOAT | TYPE_STRING | TYPE_BOOL | TYPE_VOID | ENTITY | COMPONENT | SYSTEM | ENUM | IF | ELSE | RETURN | WHILE | IDENT | WS | COMMENT | MULTILINE_COMMENT | NL )\n alt_9 = 51\n alt_9 = @dfa9.predict( @input )\n case alt_9\n when 1\n # at line 1:10: T__30\n t__30!\n\n\n when 2\n # at line 1:16: T__31\n t__31!\n\n\n when 3\n # at line 1:22: T__32\n t__32!\n\n\n when 4\n # at line 1:28: T__33\n t__33!\n\n\n when 5\n # at line 1:34: T__34\n t__34!\n\n\n when 6\n # at line 1:40: T__35\n t__35!\n\n\n when 7\n # at line 1:46: T__36\n t__36!\n\n\n when 8\n # at line 1:52: T__37\n t__37!\n\n\n when 9\n # at line 1:58: T__38\n t__38!\n\n\n when 10\n # at line 1:64: T__39\n t__39!\n\n\n when 11\n # at line 1:70: T__40\n t__40!\n\n\n when 12\n # at line 1:76: T__41\n t__41!\n\n\n when 13\n # at line 1:82: T__42\n t__42!\n\n\n when 14\n # at line 1:88: T__43\n t__43!\n\n\n when 15\n # at line 1:94: T__44\n t__44!\n\n\n when 16\n # at line 1:100: T__45\n t__45!\n\n\n when 17\n # at line 1:106: T__46\n t__46!\n\n\n when 18\n # at line 1:112: T__47\n t__47!\n\n\n when 19\n # at line 1:118: T__48\n t__48!\n\n\n when 20\n # at line 1:124: T__49\n t__49!\n\n\n when 21\n # at line 1:130: T__50\n t__50!\n\n\n when 22\n # at line 1:136: T__51\n t__51!\n\n\n when 23\n # at line 1:142: T__52\n t__52!\n\n\n when 24\n # at line 1:148: T__53\n t__53!\n\n\n when 25\n # at line 1:154: T__54\n t__54!\n\n\n when 26\n # at line 1:160: INTEGER\n integer!\n\n\n when 27\n # at line 1:168: FLOAT\n float!\n\n\n when 28\n # at line 1:174: BOOLEAN\n boolean!\n\n\n when 29\n # at line 1:182: STRING\n string!\n\n\n when 30\n # at line 1:189: CHAR\n char!\n\n\n when 31\n # at line 1:194: INIT\n init!\n\n\n when 32\n # at line 1:199: OPEN\n open!\n\n\n when 33\n # at line 1:204: CLOSE\n close!\n\n\n when 34\n # at line 1:210: TYPE_INT\n type_int!\n\n\n when 35\n # at line 1:219: TYPE_FLOAT\n type_float!\n\n\n when 36\n # at line 1:230: TYPE_STRING\n type_string!\n\n\n when 37\n # at line 1:242: TYPE_BOOL\n type_bool!\n\n\n when 38\n # at line 1:252: TYPE_VOID\n type_void!\n\n\n when 39\n # at line 1:262: ENTITY\n entity!\n\n\n when 40\n # at line 1:269: COMPONENT\n component!\n\n\n when 41\n # at line 1:279: SYSTEM\n system!\n\n\n when 42\n # at line 1:286: ENUM\n enum!\n\n\n when 43\n # at line 1:291: IF\n if!\n\n\n when 44\n # at line 1:294: ELSE\n else!\n\n\n when 45\n # at line 1:299: RETURN\n return!\n\n\n when 46\n # at line 1:306: WHILE\n while!\n\n\n when 47\n # at line 1:312: IDENT\n ident!\n\n\n when 48\n # at line 1:318: WS\n ws!\n\n\n when 49\n # at line 1:321: COMMENT\n comment!\n\n\n when 50\n # at line 1:329: MULTILINE_COMMENT\n multiline_comment!\n\n\n when 51\n # at line 1:347: NL\n nl!\n\n\n end\n end", "def token!\n # at line 1:8: ( PROGRAM | PRINT | VAR | CTE | IF | ELSE | AND | OR | GT | GTE | LT | LTE | INTEGER | FLOAT | STRING | BOOLEAN | VOID | FUNCTION | FIN | RETURN | INPUT | WHILE | CLASS | WORD | NUM_I | NUM_F | BOOL | ID | LPAREN | RPAREN | LKEY | RKEY | EQUAL | DIF | SIMILAR | COMMA | DDOT | SEMI | PLUS | SUB | DIV | MUL | INHERITS | DOT | WHITESPACE )\n alt_10 = 45\n alt_10 = @dfa10.predict( @input )\n case alt_10\n when 1\n # at line 1:10: PROGRAM\n program!\n\n\n when 2\n # at line 1:18: PRINT\n print!\n\n\n when 3\n # at line 1:24: VAR\n var!\n\n\n when 4\n # at line 1:28: CTE\n cte!\n\n\n when 5\n # at line 1:32: IF\n if!\n\n\n when 6\n # at line 1:35: ELSE\n else!\n\n\n when 7\n # at line 1:40: AND\n and!\n\n\n when 8\n # at line 1:44: OR\n or!\n\n\n when 9\n # at line 1:47: GT\n gt!\n\n\n when 10\n # at line 1:50: GTE\n gte!\n\n\n when 11\n # at line 1:54: LT\n lt!\n\n\n when 12\n # at line 1:57: LTE\n lte!\n\n\n when 13\n # at line 1:61: INTEGER\n integer!\n\n\n when 14\n # at line 1:69: FLOAT\n float!\n\n\n when 15\n # at line 1:75: STRING\n string!\n\n\n when 16\n # at line 1:82: BOOLEAN\n boolean!\n\n\n when 17\n # at line 1:90: VOID\n void!\n\n\n when 18\n # at line 1:95: FUNCTION\n function!\n\n\n when 19\n # at line 1:104: FIN\n fin!\n\n\n when 20\n # at line 1:108: RETURN\n return!\n\n\n when 21\n # at line 1:115: INPUT\n input!\n\n\n when 22\n # at line 1:121: WHILE\n while!\n\n\n when 23\n # at line 1:127: CLASS\n class!\n\n\n when 24\n # at line 1:133: WORD\n word!\n\n\n when 25\n # at line 1:138: NUM_I\n num_i!\n\n\n when 26\n # at line 1:144: NUM_F\n num_f!\n\n\n when 27\n # at line 1:150: BOOL\n bool!\n\n\n when 28\n # at line 1:155: ID\n id!\n\n\n when 29\n # at line 1:158: LPAREN\n lparen!\n\n\n when 30\n # at line 1:165: RPAREN\n rparen!\n\n\n when 31\n # at line 1:172: LKEY\n lkey!\n\n\n when 32\n # at line 1:177: RKEY\n rkey!\n\n\n when 33\n # at line 1:182: EQUAL\n equal!\n\n\n when 34\n # at line 1:188: DIF\n dif!\n\n\n when 35\n # at line 1:192: SIMILAR\n similar!\n\n\n when 36\n # at line 1:200: COMMA\n comma!\n\n\n when 37\n # at line 1:206: DDOT\n ddot!\n\n\n when 38\n # at line 1:211: SEMI\n semi!\n\n\n when 39\n # at line 1:216: PLUS\n plus!\n\n\n when 40\n # at line 1:221: SUB\n sub!\n\n\n when 41\n # at line 1:225: DIV\n div!\n\n\n when 42\n # at line 1:229: MUL\n mul!\n\n\n when 43\n # at line 1:233: INHERITS\n inherits!\n\n\n when 44\n # at line 1:242: DOT\n dot!\n\n\n when 45\n # at line 1:246: WHITESPACE\n whitespace!\n\n\n end\n end", "def comment_string\n @comment_syntax.string_for_method_entity self\n end", "def test_dsl_5\n #---------------------------\n show Spock + (Lizard + Rock)\n #---------------------------\n assert_equal \\\n \"Rock crushes Lizard (winner Rock)\\n\" \\\n \"Spock vaporizes Rock (winner Spock)\\n\" \\\n \"Result = Spock\\n\", \\\n @out.string\n end", "def test_additon_w_funcall\n# assert_eq \"helloworld\\n\", interpret(\"'hello' + echo('world')\")\n end", "def variable_or_method_use(method)\n \t_IDENTIFIER13 = nil\n\n\n\n\n \t name = \"\"\n \t is_method = false\n\n\n # 254:7: ( 'this' '.' )? ( IDENTIFIER ) ( fragment_of_variable_or_method_name[name] )* ( '(' ')' )?\n # 254:7: ( 'this' '.' )?\n alt35 = 2\n # 254:7: ( 'this' '.' )?\n look_ahead35_0 = look_ahead(1)\n\n if look_ahead35_0 == :T58 \n alt35 = 1\n end\n case alt35\n when 1\n # 254:9: 'this' '.'\n match(:T58)\n match(:DOT)\n name << \"this.\" \n end\n # 255:9: IDENTIFIER\n _IDENTIFIER13 = @input.look_ahead(1)\n match(:IDENTIFIER)\n name << _IDENTIFIER13.text \n # 256:7: ( fragment_of_variable_or_method_name[name] )*\n while true\n alt36 = 2\n # ()* loopback of 256:7: ( fragment_of_variable_or_method_name[name] )*\n look_ahead36_0 = look_ahead(1)\n if look_ahead36_0 == :DOT \n alt36 = 1\n end\n case alt36\n when 1\n # 256:7: fragment_of_variable_or_method_name[name]\n fragment_of_variable_or_method_name(name)\n\n else\n break\n end\n end\n # 257:7: ( '(' ')' )?\n alt37 = 2\n # 257:7: ( '(' ')' )?\n look_ahead37_0 = look_ahead(1)\n\n if look_ahead37_0 == :LEFT_PARENTESIS \n # 257:7: ( '(' ')' )?\n look_ahead37_1 = look_ahead(2)\n\n if look_ahead37_1 == :RIGHT_PARENTESIS \n alt37 = 1\n end\n end\n case alt37\n when 1\n # 257:9: '(' ')'\n match(:LEFT_PARENTESIS)\n match(:RIGHT_PARENTESIS)\n is_method = true\n end\n\n if is_method\n method.add_method_call(name, _IDENTIFIER13.line)\n\n else\n method.add_use_of(name, _IDENTIFIER13.line)\n end\n \n\n\n\n end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def comment; end", "def as_you_like_it_quote; end", "def code_point; end", "def comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 35 )\n\n type = COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 350:9: '#' (~ ( '\\\\n' | '\\\\r' ) )*\n match( 0x23 )\n # at line 350:13: (~ ( '\\\\n' | '\\\\r' ) )*\n while true # decision 13\n alt_13 = 2\n look_13_0 = @input.peek( 1 )\n\n if ( look_13_0.between?( 0x0, 0x9 ) || look_13_0.between?( 0xb, 0xc ) || look_13_0.between?( 0xe, 0xffff ) )\n alt_13 = 1\n\n end\n case alt_13\n when 1\n # at line 350:13: ~ ( '\\\\n' | '\\\\r' )\n if @input.peek( 1 ).between?( 0x0, 0x9 ) || @input.peek( 1 ).between?( 0xb, 0xc ) || @input.peek( 1 ).between?( 0xe, 0xff )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n\n else\n break # out of loop for decision 13\n end\n end # loop for decision 13\n # --> action\n channel=HIDDEN;\n # <-- action\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__, 35 )\n\n end", "def line_comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 78 )\n\n\n\n type = LINE_COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 608:8: '#' (~ ( '\\\\n' | '\\\\r' ) )* ( '\\\\r' )? '\\\\n'\n match( 0x23 )\n # at line 608:12: (~ ( '\\\\n' | '\\\\r' ) )*\n while true # decision 25\n alt_25 = 2\n look_25_0 = @input.peek( 1 )\n\n if ( look_25_0.between?( 0x0, 0x9 ) || look_25_0.between?( 0xb, 0xc ) || look_25_0.between?( 0xe, 0xffff ) )\n alt_25 = 1\n\n end\n case alt_25\n when 1\n # at line \n if @input.peek( 1 ).between?( 0x0, 0x9 ) || @input.peek( 1 ).between?( 0xb, 0xc ) || @input.peek( 1 ).between?( 0xe, 0xffff )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n\n end\n\n\n\n else\n break # out of loop for decision 25\n end\n end # loop for decision 25\n\n # at line 608:26: ( '\\\\r' )?\n alt_26 = 2\n look_26_0 = @input.peek( 1 )\n\n if ( look_26_0 == 0xd )\n alt_26 = 1\n end\n case alt_26\n when 1\n # at line 608:26: '\\\\r'\n match( 0xd )\n\n end\n match( 0xa )\n\n # --> action\n channel=HIDDEN;\n # <-- action\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 78 )\n\n\n end", "def lex_en_line_comment=(_arg0); end", "def lex_en_line_comment=(_arg0); end", "def lex_en_line_comment=(_arg0); end", "def format_code(code,test)\n <<-EOS\n#!/usr/bin/env ruby\nrequire \\'minitest/autorun\\'\n \n#{code}\n\nclass UserCodeTest < Minitest::Test\n \n def test_assertions \n #{test}\n end\nend\n EOS\n end", "def test\n puts \"This is a Method........................................\"\nend", "def multiline_arg; end", "def docufy(src,i)\n m = /RM_[A-z0-9]+/.match(src[i])\n name = m[0]\n name = name.sub(\"RM_\",\"RedisModule_\")\n proto = src[i].sub(\"{\",\"\").strip+\";\\n\"\n proto = proto.sub(\"RM_\",\"RedisModule_\")\n proto = linebreak_proto(proto, \" \");\n # Add a link target with the function name. (We don't trust the exact id of\n # the generated one, which depends on the Markdown implementation.)\n puts \"<span id=\\\"#{name}\\\"></span>\\n\\n\"\n puts \"### `#{name}`\\n\\n\"\n puts \" #{proto}\\n\"\n puts \"**Available since:** #{$since[name] or \"unreleased\"}\\n\\n\"\n comment = \"\"\n while true\n i = i-1\n comment = src[i]+comment\n break if src[i] =~ /\\/\\*/\n end\n comment = markdown(comment)\n puts comment+\"\\n\\n\"\nend", "def stest_method_1(test); end", "def p15\n\t\nend", "def hey_hey; end", "def sl_comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 39)\n\n type = SL_COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 470:5: '//' ( ' $ANTLR ' SRC | (~ ( '\\\\r' | '\\\\n' ) )* ) ( '\\\\r' )? '\\\\n'\n match(\"//\")\n # at line 471:5: ( ' $ANTLR ' SRC | (~ ( '\\\\r' | '\\\\n' ) )* )\n alt_2 = 2\n alt_2 = @dfa2.predict(@input)\n case alt_2\n when 1\n # at line 471:7: ' $ANTLR ' SRC\n match(\" $ANTLR \")\n src!\n\n when 2\n # at line 472:6: (~ ( '\\\\r' | '\\\\n' ) )*\n # at line 472:6: (~ ( '\\\\r' | '\\\\n' ) )*\n loop do #loop 1\n alt_1 = 2\n look_1_0 = @input.peek(1)\n\n if (look_1_0.between?(0x0000, ?\\t) || look_1_0.between?(0x000B, ?\\f) || look_1_0.between?(0x000E, 0xFFFF)) \n alt_1 = 1\n\n end\n case alt_1\n when 1\n # at line 472:6: ~ ( '\\\\r' | '\\\\n' )\n if @input.peek(1).between?(0x0000, ?\\t) || @input.peek(1).between?(0x000B, ?\\f) || @input.peek(1).between?(0x000E, 0x00FF)\n @input.consume\n else\n mse = MismatchedSet(nil)\n recover(mse)\n raise mse\n end\n\n\n\n else\n break #loop 1\n end\n end\n\n end\n # at line 474:3: ( '\\\\r' )?\n alt_3 = 2\n look_3_0 = @input.peek(1)\n\n if (look_3_0 == ?\\r) \n alt_3 = 1\n end\n case alt_3\n when 1\n # at line 474:3: '\\\\r'\n match(?\\r)\n\n end\n match(?\\n)\n # --> action\n channel=HIDDEN;\n # <-- action\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__, 39)\n\n end", "def buzzword; end", "def buzzword; end", "def caller\n %x{\n function getErrorObject(){\n try { throw Error('') } catch(err) { return err; }\n }\n\n\n var err = getErrorObject();\n }\n stack = `err.stack`\n caller_lines = stack.split(\"\\n\")[4..-1]\n caller_lines.reject! { |l| l.strip.empty? }\n\n result_formatter = lambda do |filename, line, method=nil|\n \"#{filename}:#{line} in `(#{method ? method : 'unknown method'})'\"\n end\n\n caller_lines.map do |raw_line|\n if match = /\\s*at (.*) \\((\\S+):(\\d+):\\d+/.match(raw_line)\n method, filename, line = match.captures\n result_formatter[filename, line, method]\n elsif match = /\\s*at (\\S+):(\\d+):\\d+/.match(raw_line)\n filename, line = match.captures\n result_formatter[filename, line]\n # catch phantom/no 2nd line/col #\n elsif match = /\\s*at (.*) \\((\\S+):(\\d+)/.match(raw_line)\n method, filename, line = match.captures\n result_formatter[filename, line, method]\n elsif match = /\\s*at (.*):(\\d+)/.match(raw_line)\n filename, line = match.captures\n result_formatter[filename, line]\n # Firefox - Opal.modules[\"rspec/core/metadata\"]/</</</</def.$populate@http://192.168.59.103:9292/assets/rspec/core/metadata.self.js?body=1:102:13\n elsif match = /(.*?)@(\\S+):(\\d+):\\d+/.match(raw_line)\n method, filename, line = match.captures\n result_formatter[filename, line, method]\n # webkit - http://192.168.59.103:9292/assets/opal/rspec/sprockets_runner.js:45117:314\n elsif match = /(\\S+):(\\d+):\\d+/.match(raw_line)\n filename, line = match.captures\n result_formatter[filename, line]\n else\n \"#{filename}:-1 in `(can't parse this stack trace)`\"\n end\n end\n end", "def method_definition(class_def)\n \t_IDENTIFIER7 = nil\n\n\n\n\n \t method = MethodDefinition.new\n\n\n # 123:5: modifier[method] ( type[method] )? IDENTIFIER parameters[method] ( method_body[method] | ';' )\n modifier(method)\n\n # 123:22: ( type[method] )?\n alt16 = 2\n # 123:22: ( type[method] )?\n look_ahead16_0 = look_ahead(1)\n\n if look_ahead16_0 == :IDENTIFIER \n # 123:22: ( type[method] )?\n look_ahead16_1 = look_ahead(2)\n\n if look_ahead16_1 == :IDENTIFIER || look_ahead16_1 == :LEFT_ANGULAR_BRACKET || (TOKENS[look_ahead16_1] >= 34 && TOKENS[look_ahead16_1] <= 35) \n alt16 = 1\n end\n end\n case alt16\n when 1\n # 123:23: type[method]\n type(method)\n\n end\n _IDENTIFIER7 = @input.look_ahead(1)\n match(:IDENTIFIER)\n parameters(method)\n\n # 123:68: ( method_body[method] | ';' )\n alt17 = 2\n # 123:68: ( method_body[method] | ';' )\n look_ahead17_0 = look_ahead(1)\n if look_ahead17_0 == :LEFT_BRACE \n alt17 = 1\n elsif look_ahead17_0 == :SEMICOLON \n alt17 = 2\n else\n raise \"Expected: 123:68: ( method_body[method] | ';' )\"\n end\n case alt17\n when 1\n # 123:69: method_body[method]\n method_body(method)\n\n when 2\n # 123:89: ';'\n match(:SEMICOLON)\n end\n\n method.name = _IDENTIFIER7.text\n method.line = _IDENTIFIER7.line\n class_def.add_member(method)\n \n\n\n\n end", "def arguments; end", "def arguments; end", "def arguments; end", "def test_dsl_3\n #------------------\n show Spock - Lizard\n #------------------\n assert_equal \\\n \"Lizard poisons Spock (loser Spock)\\n\" \\\n \"Result = Spock\\n\", \\\n @out.string\n end", "def token!\n # at line 1:8: ( RET | SCOPE | FRAGMENT | TREE_BEGIN | ROOT | BANG | RANGE | REWRITE | AT | LABEL_ASSIGN | LIST_LABEL_ASSIGN | T__67 | T__68 | T__69 | T__70 | T__71 | T__72 | T__73 | T__74 | T__75 | T__76 | T__77 | T__78 | T__79 | T__80 | T__81 | T__82 | T__83 | T__84 | T__85 | T__86 | T__87 | T__88 | T__89 | T__90 | T__91 | T__92 | T__93 | SL_COMMENT | ML_COMMENT | CHAR_LITERAL | STRING_LITERAL | DOUBLE_QUOTE_STRING_LITERAL | DOUBLE_ANGLE_STRING_LITERAL | INT | ARG_ACTION | ACTION | TOKEN_REF | RULE_REF | OPTIONS | TOKENS | WS )\n alt_21 = 52\n alt_21 = @dfa21.predict(@input)\n case alt_21\n when 1\n # at line 1:10: RET\n ret!\n\n when 2\n # at line 1:14: SCOPE\n scope!\n\n when 3\n # at line 1:20: FRAGMENT\n fragment!\n\n when 4\n # at line 1:29: TREE_BEGIN\n tree_begin!\n\n when 5\n # at line 1:40: ROOT\n root!\n\n when 6\n # at line 1:45: BANG\n bang!\n\n when 7\n # at line 1:50: RANGE\n range!\n\n when 8\n # at line 1:56: REWRITE\n rewrite!\n\n when 9\n # at line 1:64: AT\n at!\n\n when 10\n # at line 1:67: LABEL_ASSIGN\n label_assign!\n\n when 11\n # at line 1:80: LIST_LABEL_ASSIGN\n list_label_assign!\n\n when 12\n # at line 1:98: T__67\n t__67!\n\n when 13\n # at line 1:104: T__68\n t__68!\n\n when 14\n # at line 1:110: T__69\n t__69!\n\n when 15\n # at line 1:116: T__70\n t__70!\n\n when 16\n # at line 1:122: T__71\n t__71!\n\n when 17\n # at line 1:128: T__72\n t__72!\n\n when 18\n # at line 1:134: T__73\n t__73!\n\n when 19\n # at line 1:140: T__74\n t__74!\n\n when 20\n # at line 1:146: T__75\n t__75!\n\n when 21\n # at line 1:152: T__76\n t__76!\n\n when 22\n # at line 1:158: T__77\n t__77!\n\n when 23\n # at line 1:164: T__78\n t__78!\n\n when 24\n # at line 1:170: T__79\n t__79!\n\n when 25\n # at line 1:176: T__80\n t__80!\n\n when 26\n # at line 1:182: T__81\n t__81!\n\n when 27\n # at line 1:188: T__82\n t__82!\n\n when 28\n # at line 1:194: T__83\n t__83!\n\n when 29\n # at line 1:200: T__84\n t__84!\n\n when 30\n # at line 1:206: T__85\n t__85!\n\n when 31\n # at line 1:212: T__86\n t__86!\n\n when 32\n # at line 1:218: T__87\n t__87!\n\n when 33\n # at line 1:224: T__88\n t__88!\n\n when 34\n # at line 1:230: T__89\n t__89!\n\n when 35\n # at line 1:236: T__90\n t__90!\n\n when 36\n # at line 1:242: T__91\n t__91!\n\n when 37\n # at line 1:248: T__92\n t__92!\n\n when 38\n # at line 1:254: T__93\n t__93!\n\n when 39\n # at line 1:260: SL_COMMENT\n sl_comment!\n\n when 40\n # at line 1:271: ML_COMMENT\n ml_comment!\n\n when 41\n # at line 1:282: CHAR_LITERAL\n char_literal!\n\n when 42\n # at line 1:295: STRING_LITERAL\n string_literal!\n\n when 43\n # at line 1:310: DOUBLE_QUOTE_STRING_LITERAL\n double_quote_string_literal!\n\n when 44\n # at line 1:338: DOUBLE_ANGLE_STRING_LITERAL\n double_angle_string_literal!\n\n when 45\n # at line 1:366: INT\n int!\n\n when 46\n # at line 1:370: ARG_ACTION\n arg_action!\n\n when 47\n # at line 1:381: ACTION\n action!\n\n when 48\n # at line 1:388: TOKEN_REF\n token_ref!\n\n when 49\n # at line 1:398: RULE_REF\n rule_ref!\n\n when 50\n # at line 1:407: OPTIONS\n options!\n\n when 51\n # at line 1:415: TOKENS\n tokens!\n\n when 52\n # at line 1:422: WS\n ws!\n\n end\n end", "def test_dsl_2\n #------------------\n show Spock + Lizard\n #------------------\n assert_equal \\\n \"Lizard poisons Spock (winner Lizard)\\n\" \\\n \"Result = Lizard\\n\", \\\n @out.string\n end", "def test_dsl_4\n #-------------------------\n show Spock + Lizard + Rock\n #-------------------------\n assert_equal \\\n \"Lizard poisons Spock (winner Lizard)\\n\" \\\n \"Rock crushes Lizard (winner Rock)\\n\" \\\n \"Result = Rock\\n\", \\\n @out.string\n end", "def verify_comment(line) \n end", "def extract_magic_comments(processed_source); end", "def preprocess\n lineno = 0\n shouldWrite = false\n inFunction = false\n printer = File.open(RB_FILE,'w')\n scanner = File.open(TEX_FILE,'r')\n if printer && scanner\n printer.puts RB_REQUIRE\n scanner.each_line do |line|\n lineno = lineno + 1\n if (line.include? TEX_ENV_01_E) && !determineTexCommented(line, TEX_ENV_01_E)\n puts \"Encountered #{TEX_ENV_01_E} on line #{lineno}\"\n shouldWrite = false\n end\n if shouldWrite\n stripped = line.strip\n if (stripped.include? TEX_MOD) && !determineRubyCommented(stripped, TEX_MOD) && !inFunction\n printer.print appendLineNumberToTexPrintCall(stripped, lineno)\n elsif (stripped.include? RB_CLASS_CREATE) && !determineRubyCommented(stripped, RB_CLASS_CREATE) && !inFunction\n printer.print appendLineNumberToInitialization(stripped, lineno)\n elsif (stripped.include? RB_METHOD_S) && !determineRubyCommented(stripped, RB_METHOD_S) && !inFunction\n puts \"Processing function definition: found line containing #{stripped}\"\n inFunction = true\n extracted = extractFunctionMeta stripped\n $fcnref.store(extracted[0], extracted[1])\n $defstack.push 1\n if (stripped.include? '(') && (stripped.include? ')')\n puts \"Injection into formatted def as \\( \\)! Boo!\"\n else\n puts \"Injection into formatted def as _,_! This is preferrable.\"\n end\n printer.print appendLineNumberArgToFunctionDefinition stripped\n elsif inFunction\n puts \"Parsing #{stripped} inside function...\"\n printer.print stripped\n if (line.include? TEX_MOD) && !determineRubyCommented(line, \"Tex\")\n printer.print \", #{RBTEX_INSERT_LINE}\"\n end\n RB_KEYWORD_END.each do |kwd|\n if line.include? kwd\n puts \"Encountered '#{kwd}'; pushing onto stack...\"\n $defstack.push 1\n break\n end\n end\n if line.include? 'end'\n puts \"Encountered 'end'; popping off of stack...\"\n $defstack.pop\n end\n inFunction = $defstack.any?\n else\n print \"STRIPPED: #{stripped}\\t\"\n deffed = false\n printer.print stripped\n $fcnref.each do |fcn, args|\n if stripped.include? fcn\n if (line.include? '(') && (line.include? ')')\n\n else\n printer.print (args != 0) ? (\", #{lineno}\") : (\" #{lineno}\")\n break\n end\n end\n end\n end\n printer.puts \"\"\n end\n if (line.include? TEX_ENV_01_S) && !determineTexCommented(line, TEX_ENV_01_S)\n puts \"Encountered #{TEX_ENV_01_S} on line #{lineno}\"\n $rbenvs = $rbenvs + 1\n shouldWrite = true\n end\n end\n end\n printer.close\n scanner.close\n return 0\nend", "def source_line; end", "def test_ut_diff_result_02\n original_source_code = OriginalSourceCode.new(\n :original_file_id => 10,\n :line_number => 349898,\n :error_line => 4564,\n :line_content => \"123456\"\n )\n assert_equal(10,original_source_code.original_file_id)\n assert_equal(349898,original_source_code.line_number)\n assert_equal(4564,original_source_code.error_line)\n assert_equal(\"123456\",original_source_code.line_content)\n end", "def extractFunctionMeta(line)\n res = \"\"\n numret = 0\n if line.include? '('\n mindex = line.index('(')\n sindex = line.index(')')\n res = line[3..(mindex - 1)]\n numret = line[(mindex - 1)..(sindex - 1)].length\n else\n spindex = (line.strip[3..line.length]).strip.index(' ')\n if spindex != nil\n res = line[3..spindex]\n numret = 2\n else\n res = line[3..line.length]\n numret = 0\n end\n end\n return res.strip, numret\nend", "def token!\n # at line 1:8: ( T__48 | T__49 | T__50 | T__51 | T__52 | CATEGORY_KEY | LINK_KEY | X_OCCI_ATTRIBUTE_KEY | X_OCCI_LOCATION_KEY | ACTION | ACTIONS | AMPERSAND | AT | ATTRIBUTES | BACKSLASH | CATEGORY | CLASS | COLON | DASH | DOT | EQUALS | GT | HASH | KIND | LINK | LOCATION | LT | MIXIN | PERCENT | PLUS | QUESTION | QUOTE | REL | SCHEME | SELF | SEMICOLON | SLASH | SQUOTE | TERM | TILDE | TITLE | UNDERSCORE | LBRACKET | RBRACKET | LOALPHA | UPALPHA | DIGIT | WS | ESC )\n alt_5 = 49\n alt_5 = @dfa5.predict( @input )\n case alt_5\n when 1\n # at line 1:10: T__48\n t__48!\n\n when 2\n # at line 1:16: T__49\n t__49!\n\n when 3\n # at line 1:22: T__50\n t__50!\n\n when 4\n # at line 1:28: T__51\n t__51!\n\n when 5\n # at line 1:34: T__52\n t__52!\n\n when 6\n # at line 1:40: CATEGORY_KEY\n category_key!\n\n when 7\n # at line 1:53: LINK_KEY\n link_key!\n\n when 8\n # at line 1:62: X_OCCI_ATTRIBUTE_KEY\n x_occi_attribute_key!\n\n when 9\n # at line 1:83: X_OCCI_LOCATION_KEY\n x_occi_location_key!\n\n when 10\n # at line 1:103: ACTION\n action!\n\n when 11\n # at line 1:110: ACTIONS\n actions!\n\n when 12\n # at line 1:118: AMPERSAND\n ampersand!\n\n when 13\n # at line 1:128: AT\n at!\n\n when 14\n # at line 1:131: ATTRIBUTES\n attributes!\n\n when 15\n # at line 1:142: BACKSLASH\n backslash!\n\n when 16\n # at line 1:152: CATEGORY\n category!\n\n when 17\n # at line 1:161: CLASS\n class!\n\n when 18\n # at line 1:167: COLON\n colon!\n\n when 19\n # at line 1:173: DASH\n dash!\n\n when 20\n # at line 1:178: DOT\n dot!\n\n when 21\n # at line 1:182: EQUALS\n equals!\n\n when 22\n # at line 1:189: GT\n gt!\n\n when 23\n # at line 1:192: HASH\n hash!\n\n when 24\n # at line 1:197: KIND\n kind!\n\n when 25\n # at line 1:202: LINK\n link!\n\n when 26\n # at line 1:207: LOCATION\n location!\n\n when 27\n # at line 1:216: LT\n lt!\n\n when 28\n # at line 1:219: MIXIN\n mixin!\n\n when 29\n # at line 1:225: PERCENT\n percent!\n\n when 30\n # at line 1:233: PLUS\n plus!\n\n when 31\n # at line 1:238: QUESTION\n question!\n\n when 32\n # at line 1:247: QUOTE\n quote!\n\n when 33\n # at line 1:253: REL\n rel!\n\n when 34\n # at line 1:257: SCHEME\n scheme!\n\n when 35\n # at line 1:264: SELF\n self!\n\n when 36\n # at line 1:269: SEMICOLON\n semicolon!\n\n when 37\n # at line 1:279: SLASH\n slash!\n\n when 38\n # at line 1:285: SQUOTE\n squote!\n\n when 39\n # at line 1:292: TERM\n term!\n\n when 40\n # at line 1:297: TILDE\n tilde!\n\n when 41\n # at line 1:303: TITLE\n title!\n\n when 42\n # at line 1:309: UNDERSCORE\n underscore!\n\n when 43\n # at line 1:320: LBRACKET\n lbracket!\n\n when 44\n # at line 1:329: RBRACKET\n rbracket!\n\n when 45\n # at line 1:338: LOALPHA\n loalpha!\n\n when 46\n # at line 1:346: UPALPHA\n upalpha!\n\n when 47\n # at line 1:354: DIGIT\n digit!\n\n when 48\n # at line 1:360: WS\n ws!\n\n when 49\n # at line 1:363: ESC\n esc!\n\n end\n end", "def do_methods\n @content.scan(%r%rb_define_\n (\n singleton_method |\n method |\n module_function |\n private_method\n )\n \\s*\\(\\s*([\\w\\.]+),\n \\s*\"([^\"]+)\",\n \\s*(?:RUBY_METHOD_FUNC\\(|VALUEFUNC\\(|\\(METHOD\\))?(\\w+)\\)?,\n \\s*(-?\\w+)\\s*\\)\n (?:;\\s*/[*/]\\s+in\\s+(\\w+?\\.(?:cpp|c|y)))?\n %xm) do |type, var_name, meth_name, function, param_count, source_file|\n\n # Ignore top-object and weird struct.c dynamic stuff\n next if var_name == \"ruby_top_self\"\n next if var_name == \"nstr\"\n\n var_name = \"rb_cObject\" if var_name == \"rb_mKernel\"\n handle_method(type, var_name, meth_name, function, param_count,\n source_file)\n end\n\n @content.scan(%r%rb_define_global_function\\s*\\(\n \\s*\"([^\"]+)\",\n \\s*(?:RUBY_METHOD_FUNC\\(|VALUEFUNC\\()?(\\w+)\\)?,\n \\s*(-?\\w+)\\s*\\)\n (?:;\\s*/[*/]\\s+in\\s+(\\w+?\\.[cy]))?\n %xm) do |meth_name, function, param_count, source_file|\n handle_method(\"method\", \"rb_mKernel\", meth_name, function, param_count,\n source_file)\n end\n\n @content.scan(/define_filetest_function\\s*\\(\n \\s*\"([^\"]+)\",\n \\s*(?:RUBY_METHOD_FUNC\\(|VALUEFUNC\\()?(\\w+)\\)?,\n \\s*(-?\\w+)\\s*\\)/xm) do |meth_name, function, param_count|\n\n handle_method(\"method\", \"rb_mFileTest\", meth_name, function, param_count)\n handle_method(\"singleton_method\", \"rb_cFile\", meth_name, function,\n param_count)\n end\n end", "def test\n\n end", "def esc!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 46)\n\n \n # - - - - main rule block - - - -\n # at line 504:7: '\\\\\\\\' ( 'n' | 'r' | 't' | 'b' | 'f' | '\\\"' | '\\\\'' | '\\\\\\\\' | '>' | 'u' XDIGIT XDIGIT XDIGIT XDIGIT | . )\n match(?\\\\)\n # at line 505:3: ( 'n' | 'r' | 't' | 'b' | 'f' | '\\\"' | '\\\\'' | '\\\\\\\\' | '>' | 'u' XDIGIT XDIGIT XDIGIT XDIGIT | . )\n alt_9 = 11\n alt_9 = @dfa9.predict(@input)\n case alt_9\n when 1\n # at line 505:5: 'n'\n match(?n)\n\n when 2\n # at line 506:5: 'r'\n match(?r)\n\n when 3\n # at line 507:5: 't'\n match(?t)\n\n when 4\n # at line 508:5: 'b'\n match(?b)\n\n when 5\n # at line 509:5: 'f'\n match(?f)\n\n when 6\n # at line 510:5: '\\\"'\n match(?\")\n\n when 7\n # at line 511:5: '\\\\''\n match(?\\')\n\n when 8\n # at line 512:5: '\\\\\\\\'\n match(?\\\\)\n\n when 9\n # at line 513:5: '>'\n match(?>)\n\n when 10\n # at line 514:5: 'u' XDIGIT XDIGIT XDIGIT XDIGIT\n match(?u)\n xdigit!\n xdigit!\n xdigit!\n xdigit!\n\n when 11\n # at line 515:5: .\n match_any\n\n end\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 46)\n\n end", "def function_literal\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 70 )\n return_value = FunctionLiteralReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n string_literal333 = nil\n string_literal337 = nil\n variable_name334 = nil\n function_parameters335 = nil\n statement_block336 = nil\n variable_name338 = nil\n function_parameters339 = nil\n statement_block340 = nil\n\n tree_for_string_literal333 = nil\n tree_for_string_literal337 = nil\n\n begin\n # at line 715:3: ( 'function' ( variable_name )? function_parameters statement_block | '->' ( variable_name )? ( function_parameters )? statement_block )\n alt_86 = 2\n look_86_0 = @input.peek( 1 )\n\n if ( look_86_0 == FUNCTION )\n alt_86 = 1\n elsif ( look_86_0 == ARROW )\n alt_86 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 86, 0 )\n end\n case alt_86\n when 1\n root_0 = @adaptor.create_flat_list\n\n\n # at line 715:5: 'function' ( variable_name )? function_parameters statement_block\n string_literal333 = match( FUNCTION, TOKENS_FOLLOWING_FUNCTION_IN_function_literal_5064 )\n if @state.backtracking == 0\n\n tree_for_string_literal333 = @adaptor.create_with_payload( string_literal333 )\n root_0 = @adaptor.become_root( tree_for_string_literal333, root_0 )\n\n end\n # at line 715:17: ( variable_name )?\n alt_83 = 2\n look_83_0 = @input.peek( 1 )\n\n if ( look_83_0 == GET || look_83_0 == SET || look_83_0 == MACRO || look_83_0 == EACH || look_83_0.between?( DEF, OBJECT_DEF ) || look_83_0 == ID || look_83_0.between?( T__148, T__150 ) )\n alt_83 = 1\n end\n case alt_83\n when 1\n # at line 715:17: variable_name\n @state.following.push( TOKENS_FOLLOWING_variable_name_IN_function_literal_5067 )\n variable_name334 = variable_name\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, variable_name334.tree )\n end\n\n end\n @state.following.push( TOKENS_FOLLOWING_function_parameters_IN_function_literal_5070 )\n function_parameters335 = function_parameters\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, function_parameters335.tree )\n end\n @state.following.push( TOKENS_FOLLOWING_statement_block_IN_function_literal_5072 )\n statement_block336 = statement_block\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, statement_block336.tree )\n end\n\n when 2\n root_0 = @adaptor.create_flat_list\n\n\n # at line 716:5: '->' ( variable_name )? ( function_parameters )? statement_block\n string_literal337 = match( ARROW, TOKENS_FOLLOWING_ARROW_IN_function_literal_5078 )\n if @state.backtracking == 0\n\n tree_for_string_literal337 = @adaptor.create_with_payload( string_literal337 )\n root_0 = @adaptor.become_root( tree_for_string_literal337, root_0 )\n\n end\n # at line 716:11: ( variable_name )?\n alt_84 = 2\n look_84_0 = @input.peek( 1 )\n\n if ( look_84_0 == GET || look_84_0 == SET || look_84_0 == MACRO || look_84_0 == EACH || look_84_0.between?( DEF, OBJECT_DEF ) || look_84_0 == ID || look_84_0.between?( T__148, T__150 ) )\n alt_84 = 1\n end\n case alt_84\n when 1\n # at line 716:11: variable_name\n @state.following.push( TOKENS_FOLLOWING_variable_name_IN_function_literal_5081 )\n variable_name338 = variable_name\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, variable_name338.tree )\n end\n\n end\n # at line 716:26: ( function_parameters )?\n alt_85 = 2\n look_85_0 = @input.peek( 1 )\n\n if ( look_85_0 == LPAREN )\n alt_85 = 1\n end\n case alt_85\n when 1\n # at line 716:26: function_parameters\n @state.following.push( TOKENS_FOLLOWING_function_parameters_IN_function_literal_5084 )\n function_parameters339 = function_parameters\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, function_parameters339.tree )\n end\n\n end\n @state.following.push( TOKENS_FOLLOWING_statement_block_IN_function_literal_5087 )\n statement_block340 = statement_block\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, statement_block340.tree )\n end\n\n end# - - - - - - - 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__, 70 )\n\n end\n \n return return_value\n end", "def process_defn(exp)\n raise if @result_name\n method_name = exp.shift || raise\n exp = exp.shift || raise\n\n method_body = want_result do\n case exp.first\n when :ivar\n process(s(:block, exp))\n when :attrset\n process(s(:block, s(:args, :_), s(:iasgn, exp[1], s(:lvar, :_))))\n when :scope, :block, :fbody\n process(exp)\n else\n raise\n end\n end\n\n str = \"\"\n\n if @argument_variables.empty?\n str << \"function(){\"\n else\n args_str = ([block_name()] + @arguments_no_splat).join(\",\")\n str << \"function(#{args_str}){\"\n end\n\n raise if @local_variables.include?(@model.encode_self)\n raise if @argument_variables.include?(@model.encode_self)\n\n #\n # Add \"self\" to the local variables\n #\n @local_variables.add(@model.encode_self)\n @local_variables_need_no_initialization.add(@model.encode_self)\n\n #\n # declare local variables (except arguments)\n #\n to_declare = (@local_variables - @argument_variables).to_a\n to_declare << @result_name if @result_name\n unless to_declare.empty?\n str << \"var \" + to_declare.join(\",\") + sep()\n end\n\n #\n # initialize all local variables (that need initialization) to nil\n #\n to_initialize = (@local_variables - @argument_variables - @local_variables_need_no_initialization).to_a\n to_initialize << @result_name if @result_name\n unless to_initialize.empty?\n str << to_initialize.join(\"=\")\n str << \"=#{@model.encode_nil}#{sep()}\"\n end\n\n #\n # initialize \"self\"\n #\n str << \"#{@model.encode_self}=this#{sep()}\"\n\n #\n # If a block argument is given (&block) convert it to nil if it is\n # undefined. \n #\n if @block_arg_name\n str << \"#{@block_arg_name}=#{block_name()}==null?#{@model.encode_nil}:#{block_name()}#{sep()}\"\n end\n\n #\n # generate initialization code for each read instance variable\n #\n @read_instance_variables.each do |iv|\n str << \"if(#{@model.encode_self}.#{iv}==null)#{@model.encode_self}.#{iv}=#{@model.encode_nil}#{sep()}\"\n end\n\n # \n # Used in a zsuper call to refer to the methods \"arguments\"\n # \"arguments\" itself does not work due to iterators using functions.\n if @arguments_name\n str << \"var #{@arguments_name}=arguments#{sep()}\"\n end\n\n method_body << \"#{sep()}return #{@result_name}\" if @result_name\n\n if @iterators_used\n str << \"try{\" \n str << method_body \n\n #\n # Declare variable x?\n # No, catch introduced a new scope, so we don't have to\n # use a local or temporary variable here! \n #\n x = exception_name()\n iter_jump = @model.encode_globalattr(\"iter_jump\")\n return_value = @model.encode_attr(\"return_value\")\n scope = @model.encode_attr(\"scope\")\n uid = unique_method_scope()\n\n str << \"}catch(#{x}){\"\n # scope == null or scope == uid\n str << \"if(#{x} instanceof #{iter_jump} && (!#{x}.#{scope} || #{x}.#{scope}==#{uid}))return #{x}.#{return_value}#{sep()}\"\n str << \"throw(#{x})}\"\n else\n str << method_body\n end\n\n str << \"}\"\n\n return str\n end" ]
[ "0.8669121", "0.7291724", "0.7146618", "0.6158466", "0.6070861", "0.6070861", "0.6070861", "0.6070861", "0.6063512", "0.60394895", "0.60394895", "0.60394895", "0.60394895", "0.6017666", "0.5932104", "0.5873244", "0.57960224", "0.57834524", "0.5782268", "0.5730857", "0.5725715", "0.5725715", "0.5725715", "0.5725715", "0.5725715", "0.5691599", "0.568579", "0.568579", "0.5651271", "0.5608601", "0.56002617", "0.5599173", "0.55980814", "0.55847025", "0.5584685", "0.5576441", "0.5571991", "0.55715257", "0.556807", "0.5567195", "0.55584663", "0.555472", "0.55367345", "0.55329376", "0.55242425", "0.55199546", "0.55199546", "0.55199546", "0.55199546", "0.55199546", "0.55199546", "0.55199546", "0.55199546", "0.55199546", "0.55199546", "0.55199546", "0.55199546", "0.55199546", "0.55199546", "0.55199546", "0.55199546", "0.55199546", "0.551594", "0.5503111", "0.5490544", "0.54807395", "0.5455431", "0.5455431", "0.5455431", "0.54526645", "0.5446478", "0.54427457", "0.5440037", "0.5431387", "0.5427729", "0.54273623", "0.5411427", "0.5388339", "0.5388339", "0.5383024", "0.5382035", "0.5371806", "0.5371806", "0.5371806", "0.5363085", "0.53624105", "0.5362168", "0.53606856", "0.5358427", "0.53553015", "0.5350997", "0.5347647", "0.5342037", "0.5338846", "0.5334493", "0.53314406", "0.53301454", "0.5328341", "0.53257453", "0.53255314" ]
0.7183241
2
use callbacks to share common setup or constraints between actions.
def set_dashboard @dashboard = current_user.dashboards.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 run_actions; end", "def action_hook; end", "def callbacks; end", "def callbacks; end", "def actions; end", "def define_action_hook; end", "def add_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 setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def post_setup\n end", "def define_action_helpers; end", "def before_setup; end", "def setup_handler\n end", "def action_run\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 workflow\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 action_methods; end", "def action_methods; end", "def action_methods; end", "def execute(setup)\n @action.call(setup)\n end", "def before_dispatch(env); 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 set_actions\n actions :all\n end", "def process_action(...)\n send_action(...)\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(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 action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\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 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 startcompany(action)\n @done = true\n action.setup\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(resources) ; 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 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 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 setup(_context)\n end", "def define_action_helpers?; end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def determine_valid_action\n\n end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n # override and do something appropriate\n end", "def config(action, *args); end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(: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 after_actions(*logic)\n self.after_actions = logic\n end", "def pre_task\n end", "def setup(&block)\n define_method(:setup, &block)\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 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 setup_signals; end", "def setup\n @setup_proc.call(self) if @setup_proc\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 setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def after_set_callback; end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def duas1(action)\n action.call\n action.call\nend", "def matt_custom_action_begin(label); end", "def initialize(*args)\n super\n @action = :set\nend", "def before_action \n end", "def release_actions; end", "def around_hooks; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "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 action\n end", "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_generate_callbacks; end", "def advice\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", "def lookup_action; end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\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 setup\n #implement in subclass;\n end", "def setup\n # override this if needed\n end", "def action\n end", "def callback_phase\n super\n end", "def callback\n\n end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def callback\n end", "def save_action; end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def perform_action(data); end", "def setup(items)\n\tend", "def action(unit)\n\tend", "def prepare_for_execution(evt,config)\n # here for sub-classes to override.\n end", "def apply_actions!\n\t @entity.apply_actions!(params[:entity])\n\t\t\tset_async_actions!\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 setup(&blk)\n @setup_block = blk\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def do_adapter_specific_setup; end" ]
[ "0.621042", "0.60981137", "0.6067648", "0.59914476", "0.59914476", "0.59525734", "0.5909465", "0.5891942", "0.58147264", "0.57994914", "0.5528828", "0.55052435", "0.54776007", "0.54693365", "0.5458017", "0.54283196", "0.5421073", "0.5387869", "0.5378564", "0.5378564", "0.5378564", "0.5374056", "0.53702337", "0.5364776", "0.5348244", "0.5319594", "0.53176576", "0.53085935", "0.5297624", "0.5297624", "0.5297624", "0.5297624", "0.5297624", "0.5294575", "0.5287826", "0.528652", "0.52824813", "0.5269837", "0.5268748", "0.52607715", "0.5249208", "0.5248002", "0.5244947", "0.52365446", "0.5233526", "0.52280366", "0.522399", "0.52172875", "0.52145755", "0.52039254", "0.5194803", "0.51938015", "0.51938015", "0.51871824", "0.5180268", "0.51755536", "0.5174899", "0.5173178", "0.51630294", "0.5160484", "0.5152999", "0.5141686", "0.5141686", "0.5137029", "0.51299673", "0.51263815", "0.51141775", "0.5111775", "0.5109675", "0.5105874", "0.5094734", "0.5094358", "0.5089378", "0.5086936", "0.5084036", "0.50813276", "0.5080544", "0.5073215", "0.5070363", "0.50676835", "0.5064225", "0.50625443", "0.5061958", "0.5058245", "0.50528103", "0.5050698", "0.5045225", "0.50435156", "0.50423545", "0.5039176", "0.50344956", "0.50288814", "0.50233203", "0.5008441", "0.49951577", "0.49940816", "0.4993669", "0.49935883", "0.49920303", "0.49872664", "0.49870536" ]
0.0
-1
never trust parameters from the scary internet, only allow the white list through.
def dashboard_params # remove single/double quotes from name which cause chart's to fail: params[:dashboard][:name] = params[:dashboard][:name].gsub(/'/, '').gsub(/"/, '') unless params[:dashboard][:name].blank? params.require(:dashboard).permit( :name, widgets_attributes: [:id, :_destroy, :chart_id] ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def allowed_params\n ALLOWED_PARAMS\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\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 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 strong_params\n params.require(:community).permit(param_whitelist)\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\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 param_whitelist\n [:rating, :review]\n end", "def strong_params\n params.require(:education).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 permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "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 url_whitelist; end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n 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 allowed_params\n params.require(:allowed).permit(:email)\n end", "def valid_params_request?; end", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\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=(_arg0); end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def check_params; true; end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\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 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 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_allowlist; end", "def permit( params, whitelist, name = nil )\n raise 'Parametrization not yet configured' unless @configured\n whitelist ||= []\n px = params.respond_to?( :permit ) ? params : ActionController::Parameters.new( params )\n px = dig(px, name)\n px.permit( *whitelist )\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def permitted_params\n []\n end", "def filtered_parameters; end", "def whitelist(params)\n send_request_of_type(GlobalConstant::PrivateOpsApi.private_ops_api_type, 'post', '/token-sale/whitelist', params)\n end", "def param_whitelist\n whitelist = [\n :comment,\n :old_progress, :new_progress,\n :metric_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:metric_id)\n end\n \n whitelist\n end", "def valid_params?; end", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\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 check_params\n true\n end", "def allow_anon\n end", "def param_whitelist\n [\n :school_name,\n :school_id,\n :degree,\n :started_at,\n :finished_at,\n majors: [],\n minors: []\n ]\n end", "def whitelist; end", "def whitelist_person_params\n params.require(:person).permit(:family, :pre_title, :given_name, :dates, :post_title, :epithet, :dates_of_office, same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\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 anonymous_filter_params\n p = params.required('payload')\n # p.permit!('controls_params')\n # p.permit!('columns_params')\n # p.permit!('sorting')\n # p.permit!('global_config')\n p.permit(\n 'name',\n 'controls_list' => [],\n 'controls_hl_mode' => [],\n 'controls_params' => {},\n 'columns_list' => [],\n 'columns_params' => {},\n 'sorting' => {},\n 'global_config' => {}\n ).merge(permit_hashes(p, [\n 'controls_params',\n 'columns_params',\n 'sorting',\n 'global_config'\n ]))\n end", "def url_allowlist=(_arg0); end", "def filter_parameters; end", "def filter_parameters; end", "def valid_for_params_auth?; end", "def list_params\n params.permit(:name)\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 quote_params\n params.permit!\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "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 blacklisted_params\n params.keys.each_with_object({}) do |param, hash|\n param = param.to_sym\n hash[param] = nil unless WHITELIST_PAGINATION_PARAMS.include?(param)\n end\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 case_insensitive_params\n params.require(:case_insensitive).permit(:name)\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 resource_params\n params[resource_singular_name].try(:permit, self.class.param_whitelist)\n end", "def secure_params\n return @secure_params if @secure_params\n\n defn = implementation_class.definition\n field_list = [:master_id] + defn.field_list_array\n\n res = params.require(controller_name.singularize.to_sym).permit(field_list)\n res[implementation_class.external_id_attribute.to_sym] = nil if implementation_class.allow_to_generate_ids?\n @secure_params = res\n end", "def active_code_params\n params[:active_code].permit\n end", "def whitelist_place_params\n params.require(:place).permit(:place_name, :unlock, :auth, :is_deep_checked, :parent_ADM4, :parent_ADM3, :parent_ADM2, :parent_ADM1, :parent_country, feature_code: [], same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\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 sensitive_params=(params)\n @sensitive_params = params\n end", "def filtering_params\n params.permit(:email)\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def source_params\n params.require(:source).permit(all_allowed_params)\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def admin_review_params\n params.fetch(:review, {}).permit(whitelisted_params)\n end", "def devise_parameter_sanitizer; end", "def secure_params(require_param, permit_keys)\n params.require(require_param).permit(*permit_keys)\n end", "def address_params\n #funky strong params block taken from https://github.com/rails/rails/issues/9454#issuecomment-14167664\n params.require(:address).permit(:id, :name, :address, :telephone, :agent).tap do |whitelisted|\n whitelisted[:address] = params[:address][:address]\n end\n end", "def list_params\n params.permit(:list_name)\n end", "def valid_access_params\n params.require(:valid_access).permit(:wish_list_id, :user_id)\n end", "def form_params\n # Remove role and privilege ids as these are managed by the app not by\n # the active record associations\n params[:user].delete :role_ids\n params[:user].delete :privilege_ids\n params.require(:user).permit(user_allowable_params)\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def backend_user_params\n params.permit!\n end", "def less_active_member_params\n clean_params = params.require(:less_active_member).permit(:surname, :given_name, :current_address, :new_address, :new_phone, :reference, :new_note, :resources, tag_list: [])\n clean_params.merge!({current_user_id: current_user.id}) unless current_user.nil?\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 initialize( params )\n super( Parametrization.permit( params, whitelist, model_name ) )\n @params = @params.with_indifferent_access # After building the internal params hash, make it a little friendlier.\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def secure_params\n return @secure_params if @secure_params\n\n @implementation_class = implementation_class\n resname = @implementation_class.name.ns_underscore.gsub('__', '_').singularize.to_sym\n @secure_params = params.require(resname).permit(*permitted_params)\n end" ]
[ "0.71857256", "0.7074159", "0.70514226", "0.691041", "0.6892328", "0.6847316", "0.6694351", "0.66658026", "0.6661469", "0.6598603", "0.65809244", "0.65768236", "0.6571983", "0.6558189", "0.65302294", "0.6505491", "0.6487933", "0.6457244", "0.6441075", "0.64410084", "0.6408059", "0.64055103", "0.6365178", "0.6358468", "0.6353142", "0.63208234", "0.63140696", "0.62949824", "0.6285556", "0.62691766", "0.6261457", "0.626046", "0.62351215", "0.62255114", "0.62009597", "0.61950284", "0.61825645", "0.6159748", "0.6145141", "0.61402243", "0.61262316", "0.61241716", "0.61063087", "0.6102738", "0.6091", "0.6090252", "0.6076414", "0.6071487", "0.60602546", "0.605314", "0.6026321", "0.6007217", "0.6000838", "0.59963655", "0.5980867", "0.5969897", "0.5960052", "0.5958561", "0.5958561", "0.59507614", "0.59499586", "0.59499", "0.59327877", "0.59225345", "0.59042126", "0.59033936", "0.58988154", "0.5897058", "0.58907485", "0.58844674", "0.58808804", "0.58749443", "0.58749443", "0.58747697", "0.587342", "0.5868106", "0.58647984", "0.5862163", "0.58407557", "0.5836158", "0.5833512", "0.5823237", "0.58204687", "0.5820099", "0.58192843", "0.58177865", "0.58151865", "0.58085006", "0.58084536", "0.5807595", "0.58052796", "0.5796726", "0.57958037", "0.5793828", "0.5788203", "0.5779625", "0.57795614", "0.5775383", "0.5774397", "0.5769569", "0.576713" ]
0.0
-1
Reverse the IP address for the inaddr.arpa zone
def reverse_ip(ipaddress) reverse_ip = IPAddr.new ipaddress reverse_ip.reverse end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reverses\n if @family == Socket::AF_INET\n if self.length == 32\n [ self.reverse ]\n else\n boundary = self.length % 8 == 0 && self.length != 0 ? self.length / 8 - 1 : self.length / 8\n divisor = (boundary + 1) * 8\n count = (self.last.to_i - self.first.to_i) / (1 << 32 - divisor)\n res = []\n (0..count).each do |i|\n octets = IPAddr.new(first.to_i + ((1<<32-divisor)*i), Socket::AF_INET).to_s.split('.')[0..boundary]\n res << \"#{octets.reverse * '.'}.in-addr.arpa\"\n end\n res\n end\n elsif @family == Socket::AF_INET6\n if self.length == 128\n [ self.reverse ]\n else\n boundary = self.length % 16 == 0 && self.length != 0 ? self.length / 4 - 1 : self.length / 4\n divisor = (boundary + 1) * 4\n count = (self.last.to_i - self.first.to_i) / (1 << 128-divisor)\n res = []\n (0..count).each do |i|\n baseaddr = self.first.to_i + (1<<128-divisor)*i\n octets = (\"%032x\" % baseaddr).split('')[0..boundary]\n res << octets.reverse * '.' + '.ip6.arpa'\n end\n res\n end\n end\n end", "def reverse(*ips)\n get(\"/dns/reverse\", ips: ips.join(\",\"))\n end", "def abs_adr(ip)\n Verneuil::Address.new(ip, self)\n end", "def _to_string(addr)\n \"%d.%d.%d.%d\" % [ (addr >> 24) & 0xff, (addr >> 16) & 0xff, (addr >> 8) & 0xff, (0xff&addr) ] \n end", "def reverse_zone(s,a)\ntextTest = File.open(a+\".arpa\",'w')\ntextTest.puts \"; \n;BIND data file for \" + s+ \" reverse lookup\n$TTL\t604800\n@\tIN\tSOA\t\"+s+\" webmaster@\"+s+\". (\n\t\t\t \"+datum+\"\t\t; Serial\n\t\t\t 604800\t\t; Refresh\n\t\t\t 86400\t\t; Retry\n\t\t\t2419200\t\t; Expire\n\t\t\t 604800 )\t; Negative Cache TTL\n;\n@\tIN\tNS\tns1.\"+s+\"\n\"+a+\"\tIN\tPTR\t ns1.\"+s+\".\"\n\n\ntextTest.close\nend", "def get_arpa(c,ip)\narpa = ip\n\tif c >= 8 && c < 16\n\t\tarpa = ip.split(\".\")\n\t\tarpa = arpa.last(3).reverse\n\t\tarpa = arpa.join(\".\").to_s\n\telsif c >= 16 && c < 24\n\t\tarpa = ip.split(\".\").last(2).reverse\n\t\tarpa= arpa.join(\".\").to_s\n\telse c >= 24\n\t\tarpa = arpa.split(\".\").last\n\t\treturn arpa\n\t\t\n\tend\n\t\t \nend", "def rcptto(to_addr); end", "def to_ipaddr\n unless ip_addr?\n lookup = `host #{to_s} | grep address`.split(/\\s+/)\n return to_s unless lookup.length == 4\n lookup[3]\n else \n to_s\n end\n end", "def save_ip_addr\n self.ip_address = IPAddr.new(self.ip_address).to_i.to_s(16).rjust(8, \"0\")\n end", "def reverse_name_lookup(ip, type = :A)\n # look for all the zones\n type = type.to_sym if type.class != Symbol\n dns_name = String.new\n @dns.domains.each do |zone|\n @dns.domains.get(zone.id).records.each do | record |\n if record.data == ip and record.type.to_sym == type\n dns_name = record.name\n break\n end\n end\n end\n return dns_name\n end", "def convert_record(line)\n record = line.split(' ')\n if record[1] == 'A' || record[1] == 'AAAA'\n ip = IPAddr.new record[2]\n name = ip.reverse\n puts name + \". PTR \" + record[0]\n end\nend", "def anonymize\n ipv4 = (m = value.match(/\\d+\\.\\d+\\.\\d+\\.\\d+$/)) ? m[0] : \"\"\n ipv6 = value.gsub(ipv4, \"\")\n ipv6 += \":\" if ipv4.present? && ipv6.present?\n ipv4 = ipv4.gsub(/\\.\\d+$/, \".0\")\n ipv6 = ipv6.gsub(/:(\\d|[a-f])*:(\\d|[a-f])*:(\\d|[a-f])*:(\\d|[a-f])*:(\\d|[a-f])*$/, \"::\")\n IPAddress.new([ipv6, ipv4].keep_if { |ip| ip.present? }.join)\n end", "def binary_to_ipv4(ipv4addr)\n ia = ipv4addr.to_s.split('.')\n if ia.size != 4\n return \"0.0.0.0\"\n end\n output = \"\"\n i = 1\n for octett in ia\n output = output + octett.to_s.to_i(2).to_s\n if i < 4\n output = output + \".\"\n end\n i += 1\n end\n output\n end", "def decode(base_addr=0, eip=base_addr)\n decode_blocks(base_addr, eip).to_s\n end", "def ip\n ip = nil\n\n unless valid?\n return nil\n end\n\n begin\n case name\n when /\\.in-addr\\.arpa$/\n name_without_suffix = name.sub(/\\.in-addr\\.arpa$/, '')\n quads = name_without_suffix.split('.')\n if quads.size == 4\n quads.reverse!\n ip = quads.join('.')\n end\n when /\\.ip6\\.arpa$/\n name_without_suffix = name.sub(/\\.ip6\\.arpa$/, '')\n nibbles = name_without_suffix.split('.')\n nibbles.each do |nibble|\n if nibble.empty?\n raise DnsRecord::EmptyNibbleError\n end\n end\n if nibbles.size == 32\n n = nibbles.reverse!\n ip = \\\n n[0..3].join('') + \":\" +\n n[4..7].join('') + \":\" +\n n[8..11].join('') + \":\" +\n n[12..15].join('') + \":\" +\n n[16..19].join('') + \":\" +\n n[20..23].join('') + \":\" +\n n[24..27].join('') + \":\" +\n n[28..31].join('')\n \n ip = NetAddr::CIDR.create(ip).ip(:Short => true)\n end\n end\n rescue DnsRecord::EmptyNibbleError\n ip = nil\n end\n\n ip\n end", "def reverse_dns_lookup (ip)\n\t\tputs \"Retrieve the hostname by the reverse DNS lookup on IP: #{ip}\"\n\t\thostname = ip\n\t\tbegin\n\t\t\thostname = Socket.gethostbyaddr(ip.split('.').collect{ |x| x.to_i}.pack(\"CCCC\"))[0]\n\t\t\treturn hostname.downcase\n\t\trescue => ee\n\t\t\tputs \"Exception on method reverse_dns_lookup: #{ee}\" if @verbose\n\t\t\treturn hostname\n\t\tend\n\tend", "def release_address(env,eip)\n h = JSON.parse(eip)\n # Use association_id and allocation_id for VPC, use public IP for EC2\n if h['association_id']\n env[:aws_compute].disassociate_address(nil,h['association_id'])\n env[:aws_compute].release_address(h['allocation_id'])\n else\n env[:aws_compute].disassociate_address(h['public_ip'])\n env[:aws_compute].release_address(h['public_ip'])\n end\n end", "def release_address(env,eip)\n h = JSON.parse(eip)\n # Use association_id and allocation_id for VPC, use public IP for EC2\n if h['association_id']\n env[:aws_compute].disassociate_address(nil,h['association_id'])\n env[:aws_compute].release_address(h['allocation_id'])\n else\n env[:aws_compute].disassociate_address(h['public_ip'])\n env[:aws_compute].release_address(h['public_ip'])\n end\n end", "def arpa()\n\n base = self.ip()\n netmask = self.bits()\n\n if (@version == 4)\n net = base.split('.')\n\n if (netmask)\n while (netmask < 32)\n net.pop\n netmask = netmask + 8\n end\n end\n\n arpa = net.reverse.join('.')\n arpa << \".in-addr.arpa.\"\n\n elsif (@version == 6)\n fields = base.split(':')\n net = []\n fields.each do |field|\n (field.split(\"\")).each do |x|\n net.push(x)\n end\n end\n\n if (netmask)\n while (netmask < 128)\n net.pop\n netmask = netmask + 4\n end\n end\n\n arpa = net.reverse.join('.')\n arpa << \".ip6.arpa.\"\n\n end\n\n return(arpa)\n end", "def fetch_dns_ptr(zone_name)\n \n @o = ''\n # find out the range we are parsing in this zone.\n ranges = []\n zone_name.split(\".\").map{|a| \n # Make sure it's request for arpa zone which should be all number\n if ! (a =~ /^\\d+$/).nil?\n if ranges.empty?\n ranges << a\n else\n ranges.insert(0, a)\n end\n end\n }\n \n # After look through zone name, if it's not a arpa zone, we'll return nil\n if ranges.empty?\n return @o\n end\n \n # Use later to determine how many number from ip we need\n zone_class = ranges.length\n \n # Now we have the range from zone name, let's use Networking class to help us find all interfaces\n # Find out wether it's class a, b, c or d\n netmask = 32 # start with D class netmask\n for i in (ranges.length..4-1)\n # Get the netmask correctly\n netmask = netmask - 8\n # Set the empty ip slot to 0\n ranges[i] = 0;\n end\n \n # Build the address\n range_address = ranges.join(\".\") + \"/#{netmask}\"\n \n # Call in cidr, find all interface under this range.\n interfaces = Networking.get_interfaces_in_range(range_address).sort{|a,b| a.ip <=> b.ip}\n\n # Find asset for each interface\n # If asset is Server, we need to look up two things\n # 1. If ip is drac, we will add \"-d\" to the hostname\n # 2. Maybe for vip, we need to ptr to it, but on the second thought, that shouldn't be. \n for interface in interfaces\n\n # Build the ip correct for this zone\n ips = []\n ip_parts = interface.ip_to_string.split(\".\")\n for i in (zone_class..4-1)\n # Insert reversely\n ips.insert(0, ip_parts[i])\n end\n ip = ips.join(\".\")\n \n # If it's a drac and type = server, we transform the hostname\n if ( interface.drac_ip? && interface.asset.resource_type == 'Server')\n name = convert_to_drac_name(interface.asset.name)\n else\n # Check to see if there is multiple vips poing to this ip, if so raise exception.\n # If only one ip, then we'll point PTR record to that vip.\n if interface.vips.length > 1\n #raise \"#{interface.ip_to_string} has more than one vip \" + interface.vips.collect{|a| a.name}.inspect + \" pointing to it\"\n @o += \";#{interface.ip_to_string} has more than one vip \" + interface.vips.collect{|a| a.name}.inspect + \" pointing to it.\\n\"\n @o += \";Picking the first one.\\n\"\n name = interface.vips[0].name \n elsif interface.vips.length == 1\n name = interface.vips[0].name\n # Network asset with named interface\n elsif interface.asset.resource_type == 'Network' and interface.name and interface != interface.asset.primary_interface and ! interface.name.empty?\n name = interface.name + '.' + interface.asset.name\n else\n name = interface.asset.name \n end\n \n end\n \n @o += \"#{ip}\\t\\tPTR\\t\\t#{name}.\\n\"\n\n end\n\n return @o\n\n rescue Exception => exc\n flash[:interface] = \"##ERROR## Fetch failed following reason: #{exc.message}\\n\"\n\n \n end", "def addr_ntoa(addr)\n # IPv4\n if (addr.length == 4)\n return addr.unpack('C4').join('.')\n end\n\n # IPv6\n if (addr.length == 16)\n return compress_address(addr.unpack('n8').map{ |c| \"%x\" % c }.join(\":\"))\n end\n\n raise RuntimeError, \"Invalid address format\"\n end", "def transform\n unless is_valid_ipv4_address?\n raise Valshamr::InvalidIPv4Error, \"Expected IPv4 address in the form of x[xx].x[xx].x[xx].x[xx], but received: #{@ip_address}.\"\n end\n\n octets = @ip_address.split \".\"\n octets.map! { |octet| convert_decimal_octet_to_hexadecimal octet.to_i }\n\n new_ip = construct_hexadecimal_portions octets\n\n \"::#{new_ip}\"\n end", "def decrypt_server_ip(serverip)\n ipkey = 0x03081e11\n decodedip = (serverip ^ ipkey).to_s(16).rjust(8, '0')\n IPAddr.new(decodedip.hex, Socket::AF_INET).to_s\nend", "def ip_v4_address; end", "def IPAddress(str)\n IPAddress::parse str\nend", "def IPAddress(str)\n IPAddress::parse str\nend", "def arp_daddr_ip\n\t\tself[:arp_dest_ip].to_x\n\tend", "def ip2long(ip)\n long = 0\n ip.split(/\\./).reverse.each_with_index do |x, i|\n long += x.to_i << (i * 8)\n end\n long\n end", "def int2ip(intip)\n ip_segments = [3, 2, 1, 0].map { |i| (intip & (255 << i*8)) >> i*8 }\n (ip_str= ip_segments.join('.')) =~ IP_REGEXP ? ip_str : ''\n end", "def ip2long(ip)\n long = 0\n ip.split( /\\./ ).reverse.each_with_index do |x, i|\n long += x.to_i << ( i * 8 )\n end\n long\n end", "def ip_string(ipint)\n octets = []\n 4.times do\n octet = ipint & 0xFF\n octets.unshift(octet.to_s)\n ipint = ipint >> 8\n end\n ip = octets.join('.')\n\t\treturn ip\n\tend", "def ip_string(ipint)\n octets = []\n 4.times do\n octet = ipint & 0xFF\n octets.unshift(octet.to_s)\n ipint = ipint >> 8\n end\n ip = octets.join('.')\n\t\treturn ip\n\tend", "def ipv4_addr_to_string(uint32)\n \"#{(uint32 & 0xff000000) >> 24}.#{(uint32 & 0x00ff0000) >> 16}.#{(uint32 & 0x0000ff00) >> 8}.#{uint32 & 0x000000ff}\"\n end", "def ntoa\n Dnet.addr_ntoa(self)\n end", "def end_ip\n\t\taddr = read_attribute(:end_ip)\n\t\tIP.new([(read_attribute(:ip_v4))?\"v4\":\"v6\",addr]).to_s\n\tend", "def decode_ip(data_received, answer_offset, answer_data_length)\n host_str = \"\"\n \n i = 0\n while i < answer_data_length\n byte_read = data_received.slice(answer_offset + i, data_received.length - (answer_offset + i)).unpack(\"C\")\n\n host_str << byte_read[0].to_s\n if i < answer_data_length - 1\n host_str << \".\"\n end\n i = i + 1\n end\n\n return host_str\nend", "def to_wmasked_ip_s\n ai = NetAddr.ip_to_i(@ipaddr.ip)\n mi = NetAddr.ip_to_i(@ipaddr.wildcard_mask)\n NetAddr.i_to_ip(ai & mi)\n end", "def arpa\n TestLab::Utility.arpa(self.address)\n end", "def resolve(adr)\n adr.ip = program.size\n end", "def ipaddr; end", "def ip(options=nil)\n known_args = [:Objectify, :Short]\n objectify = false\n short = false\n\n if (options)\n if (!options.kind_of?(Hash))\n raise ArgumentError, \"Expected Hash, but \" +\n \"#{options.class} provided.\"\n end\n NetAddr.validate_args(options.keys,known_args)\n\n if( options.has_key?(:Short) && options[:Short] == true )\n short = true\n end\n\n if( options.has_key?(:Objectify) && options[:Objectify] == true )\n objectify = true\n end\n end\n\n\n if (!objectify)\n ip = NetAddr.ip_int_to_str(@ip, @version)\n ip = NetAddr.shorten(ip) if (short && @version == 6)\n else\n ip = NetAddr.cidr_build(@version,@ip)\n end\n\n return(ip)\n end", "def address_for(network); end", "def ip_address_with_mask\n ip_address.try(:to_cidr_s)\n end", "def ip_from_num(i)\n \"192.168.90.#{i+IP_OFFSET}\"\nend", "def in_addr(addr)\n if addr =~ /^(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)$/\n (($1.to_i << 24) + ($2.to_i << 16) + ($3.to_i << 8) + ($4.to_i))\n else\n nil\n end\n end", "def GetIpFromId(id)\n \"192.168.0.#{id+1}\"\n end", "def normalize_ip(ip)\n case ip\n when nil then nil\n when String then IPAddr.new(ip)\n when Integer then IPAddr.new(ip, Socket::AF_INET)\n when IPAddr then ip\n else raise ArgumentError, \"IP must be a String, IPAddr, or Integer, not: #{ip.inspect}\"\n end\n end", "def end_ip= attr\n\t\tip = IP.parse(attr)\n\t\twrite_attribute(:end_ip, ip.to_hex) unless ((ip.proto==\"v4\")!=read_attribute(:ip_v4)) \n\tend", "def disable_nat(ip_addr)\n raise 'not implemented'\n end", "def generate_ip\n crc32 = Zlib.crc32(self.id.to_s)\n offset = crc32.modulo(255)\n\n octets = [ 192..192,\n 168..168,\n 0..254,\n 1..254 ]\n ip = Array.new\n for x in 1..4 do\n ip << octets[x-1].to_a[offset.modulo(octets[x-1].count)].to_s\n end\n \"#{ip.join(\".\")}/24\"\n end", "def arp_daddr_ip= ip\n\t\tself[:arp_dest_ip].read_quad(ip)\n\tend", "def ipaddr?; end", "def forward_zone(s)\ntextTest = File.open( s+\".zone\",'w')\n\t\ttextTest.puts \";\n; BIND data file for \" + s+ \" zone\n;\n$TTL\t604800\n@\tIN\tS\t\"+s+\" webmaster@\"+s+\". (\n\t\t\t \"+datum+\"1\t\t; Serial\n\t\t\t 604800\t\t; Refresh\n\t\t\t 86400\t\t; Retry\n\t\t\t2419200\t\t; Expire\n\t\t\t 604800 )\t; Negative Cache TTL\n;\n@\tIN\tNS\tns1.\"+s+\"\n@\tIN\tA\t\"+get_own_ip+\"\n\" \n\ntextTest.close\nend", "def get_ipaddr(dns_query, parsed_dns, length)\n address = \"\"\n case length\n when IPV4_ADDR_LENGTH\n address = dns_query[parsed_dns[:index], length].unpack(\"CCCC\").join('.')\n when IPV6_ADDR_LENGTH\n address = dns_query[parsed_dns[:index], length].unpack(\"nnnnnnnn\").map{|v| sprintf(\"%x\", v)}.join(':')\n end\n parsed_dns[:index] += length\n return address\n end", "def generate_reverse_udp(opts={})\n combined_asm = %Q^\n cld ; Clear the direction flag.\n call start ; Call start, this pushes the address of 'api_call' onto the stack.\n #{asm_block_api}\n start:\n pop ebp\n #{asm_reverse_udp(opts)}\n #{asm_block_recv(opts)}\n ^\n Metasm::Shellcode.assemble(Metasm::X86.new, combined_asm).encode_string\n end", "def disassociate_address( options = {} )\n options = { :public_ip => '' }.merge(options)\n raise ArgumentError, \"No ':public_ip' provided\" if options[:public_ip].nil? || options[:public_ip].empty?\n params = { \"PublicIp\" => options[:public_ip] }\n return response_generator(:action => \"DisassociateAddress\", :params => params)\n end", "def ip\n orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true # turn off reverse DNS resolution temporarily\n UDPSocket.open do |s|\n s.connect '64.233.187.99', 1\n s.addr.last\n end\n ensure\n Socket.do_not_reverse_lookup = orig\n end", "def str_ip(num)\n return nil unless num\n \"#{num >> 24}.#{(num >> 16) & 0xFF}.#{(num >> 8) & 0xFF}.#{num & 0xFF}\"\n end", "def disassociate_address(public_ip)\n link = generate_request(\"DisassociateAddress\", \n \"PublicIp\" => public_ip.to_s)\n request_info(link, RightBoolResponseParser.new(:logger => @logger))\n rescue Exception\n on_exception\n end", "def disassociate_address(public_ip)\n link = generate_request(\"DisassociateAddress\", \n \"PublicIp\" => public_ip.to_s)\n request_info(link, RightBoolResponseParser.new(:logger => @logger))\n rescue Exception\n on_exception\n end", "def end_addr\n start_addr + length - 4\n end", "def ip_string\n\t\t\"#{settings.subnet}.#{settings.nodes_ip_offset + @ip}\"\n\tend", "def ip_address(env)\n ip_address_record(env)[:address]\n end", "def to_s\n @ip_string\n end", "def public_ip_v4_address; end", "def private_ip_v4_address; end", "def to_source; \"* = $#{@addr.to_s(16)}\"; end", "def typecast_value_ipaddr(value)\n case value\n when IPAddr\n value\n when String\n IPAddr.new(value)\n else\n raise Sequel::InvalidValue, \"invalid value for inet/cidr: #{value.inspect}\"\n end\n end", "def typecast_value_ipaddr(value)\n case value\n when IPAddr\n value\n when String\n IPAddr.new(value)\n else\n raise Sequel::InvalidValue, \"invalid value for inet/cidr: #{value.inspect}\"\n end\n end", "def get_internal_ip_address\r\n sock = UDPSocket.new\r\n sock.connect('1.0.0.1', 1) #@igd_location.split('//').last.split('/').first.split(':').first\r\n return sock.addr.last\r\n rescue Exception\r\n return \"127.0.0.1\"\r\n end", "def get_ip(remote_address)\n return \"\" unless remote_address\n\n #Capture the first three octects of the IP address and replace the forth\n #with 0, e.g. 124.455.3.123 becomes 124.455.3.0\n regex = /^([^.]+\\.[^.]+\\.[^.]+\\.).*/\n if matches = remote_address.scan(regex)\n return matches[0][0] + \"0\"\n else\n return \"\"\n end\nend", "def overlay_ip\n self.overlay_cidr.split('/')[0] if self.overlay_cidr\n end", "def ip_to_node ip\n #Get the lines from nta where node is with that IP\n node_ip_lines = $nodes_to_addrs.select{ |line| line =~ /#{ip}/ }\n\n if (node_ip_lines[0] == nil)\n puts \"ERROR: Could not find the IP = #{ip} in the nodes_to_addrs.txt file\"\n return nil\n end\n\n #Remove the IP and whitespace from string\n node_ip_lines[0].split[0...1].join(' ')\nend", "def arp_dest_ip= i; typecast \"arp_dest_ip\", i; end", "def get_peeraddr\n Socket.unpack_sockaddr_in(get_peername).reverse\n end", "def generate_reverse_tcp(opts={})\n asm = asm_reverse_tcp(opts)\n buf = Metasm::Shellcode.assemble(Metasm::X64.new, asm).encode_string\n apply_prepends(buf)\n end", "def ip(value)\n merge(bkip: value.to_s)\n end", "def to_s(options=nil)\n known_args = [:IP, :Short]\n short = false\n orig_ip = false\n\n if (options)\n if (!options.kind_of? Hash)\n raise ArgumentError, \"Expected Hash, but #{options.class} provided.\"\n end\n NetAddr.validate_args(options.keys,known_args)\n\n if (options.has_key?(:Short) && options[:Short] == true)\n short = true\n end\n\n if (options.has_key?(:IP) && options[:IP] == true)\n orig_ip = true\n end\n end\n\n if (!orig_ip)\n ip = NetAddr.ip_int_to_str(@network, @version)\n else\n ip = NetAddr.ip_int_to_str(@ip, @version)\n end\n ip = NetAddr.shorten(ip) if (short && @version == 6)\n mask = NetAddr.mask_to_bits(@netmask)\n\n return(\"#{ip}/#{mask}\")\n end", "def last(options=nil)\n known_args = [:Objectify, :Short]\n objectify = false\n short = false\n\n if (options)\n if (!options.kind_of?(Hash))\n raise ArgumentError, \"Expected Hash, but \" +\n \"#{options.class} provided.\"\n end\n NetAddr.validate_args(options.keys,known_args)\n\n if( options.has_key?(:Short) && options[:Short] == true )\n short = true\n end\n\n if( options.has_key?(:Objectify) && options[:Objectify] == true )\n objectify = true\n end\n\n end\n\n ip_int = @network | @hostmask\n if (!objectify)\n ip = NetAddr.ip_int_to_str(ip_int, @version)\n ip = NetAddr.shorten(ip) if (short && !objectify && @version == 6)\n else\n ip = NetAddr.cidr_build(@version,ip_int)\n end\n\n return(ip)\n end", "def ipaddress\n resolve.nil? || resolve.empty? ? nil : resolve\n end", "def ipv4_to_txt(ipv4)\n IPAddr.new(ipv4, Socket::AF_INET).to_s\nend", "def enrich_reverse_dns\n return if data_type != \"ip\"\n\n self.reverse_dns_names = ReverseDnsName.build_by_ip(data)\n end", "def ipaddr(iface=nil)\n @ipaddr[iface || default_iface]\n end", "def remove_ip(ip)\n send_req({a: :nul, key: ip})\n end", "def getIpFromNum(ii)\n \"172.31.0.#{100+ii}\"\nend", "def reverse(input); end", "def ToHex(ip)\n tmp = Ops.add(\n \"00000000\",\n Builtins.substring(\n Builtins.toupper(Builtins.tohexstring(ToInteger(ip))),\n 2\n )\n )\n Builtins.substring(tmp, Ops.subtract(Builtins.size(tmp), 8))\n end", "def reverse_binary\n binary.reverse\n end", "def generate_reverse_tcp(opts={})\n asm = asm_reverse_tcp(opts)\n buf = Metasm::Shellcode.assemble(Metasm::X86.new, asm).encode_string\n apply_prepends(buf)\n end", "def address(public_ip)\n addresses(public_ip)[0]\n end", "def ip_address; end", "def ip_address; end", "def ip_address; end", "def ip_address; end", "def ip_address; end", "def ip_address; end", "def disassociate_address(public_ip)\n action = 'DisassociateAddress'\n params = {\n 'Action' => action,\n 'PublicIp' => public_ip\n }\n\n response = send_query_request(params)\n response.is_a?(Net::HTTPSuccess)\n end", "def arp_dest_ip; self[:arp_dest_ip].to_s; end", "def to_integer\n ip_address.to_i\n end", "def subnet_mask\n @mask_addr.to_ip\n end" ]
[ "0.68461573", "0.6763319", "0.6297015", "0.6206993", "0.61474293", "0.6120734", "0.60907465", "0.6047302", "0.6026123", "0.5990444", "0.58971715", "0.5872474", "0.58502626", "0.58052695", "0.5774855", "0.57199717", "0.5684227", "0.5684227", "0.56642294", "0.5632766", "0.5607812", "0.5534904", "0.5528665", "0.5521004", "0.5504638", "0.5504638", "0.548826", "0.54804224", "0.5462831", "0.54580927", "0.5455443", "0.5455443", "0.54395443", "0.5438327", "0.5433711", "0.5372374", "0.53628886", "0.5352775", "0.5350163", "0.5348923", "0.5348569", "0.5331655", "0.5315614", "0.5315405", "0.5272605", "0.5259317", "0.52485234", "0.524636", "0.5238747", "0.52365065", "0.52340704", "0.52304065", "0.5226842", "0.5213478", "0.5205416", "0.5201587", "0.51999545", "0.51952416", "0.5189573", "0.5189573", "0.5188587", "0.5170692", "0.5167215", "0.5157723", "0.5153245", "0.5137937", "0.5134453", "0.5132727", "0.5132727", "0.5130896", "0.5118078", "0.5110018", "0.5109555", "0.51086354", "0.50878465", "0.508519", "0.5081798", "0.5065713", "0.5055591", "0.5053491", "0.5052026", "0.5051528", "0.5048346", "0.5047281", "0.5045557", "0.504301", "0.5033805", "0.5033343", "0.50101876", "0.50034785", "0.5000856", "0.5000856", "0.5000856", "0.5000856", "0.5000856", "0.5000856", "0.49853393", "0.4983278", "0.4976281", "0.49745303" ]
0.8084351
0
Use callbacks to share common setup or constraints between actions.
def set_goal @goal = Goal.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
Only allow a trusted parameter "white list" through.
def goal_params params.require(:goal).permit(:futsal_game_id, :team_id, :goal_id, :own_goal, :assist_id, :goalkeeper_id, :time, :video_link, :picture) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def expected_permitted_parameter_names; end", "def param_whitelist\n [:role, :title]\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def permitted_params\n []\n end", "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 filtered_parameters; end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n 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 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 [:rating, :review]\n end", "def valid_params?; end", "def permitted_params\n declared(params, include_missing: false)\n end", "def permitted_params\n declared(params, include_missing: false)\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 filter_parameters; end", "def filter_parameters; end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def check_params; true; end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def list_params\n params.permit(:name)\n end", "def check_params\n true\n end", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "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 additional_permitted_params\n []\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def resource_params\n params[resource_singular_name].try(:permit, self.class.param_whitelist)\n end", "def allow_params_authentication!; 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 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 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 paramunold_params\n params.require(:paramunold).permit!\n end", "def param_params\n params.require(:param).permit(:param_category_id, :param_table_id, :name, :english_name, :weighting, :description)\n end", "def quote_params\n params.permit!\n end", "def list_params\n params.permit(:list_name)\n end", "def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end", "def all_params; end", "def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end", "def source_params\n params.require(:source).permit(all_allowed_params)\n end", "def user_params\n end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\n end", "def permitted_params\n @wfd_edit_parameters\n end", "def user_params\r\n end", "def param_whitelist\n whitelist = [\n :comment,\n :old_progress, :new_progress,\n :metric_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:metric_id)\n end\n \n whitelist\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def get_params\n\t\t\n\t\treturn ActionController::Parameters.new(self.attributes).permit(:first_name, :last_name, :email, :provider)\n\n\tend", "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 valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end", "def params_permit\n params.permit(:id)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\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 filter_params\n params.permit(*resource_filter_permitted_params)\n end", "def community_params\n params.permit(:profile_image, :name, :description, :privacy_type, :viewed_by, {tags: []}, {features: []}, {admins: []}, :members, :location, :beacon, :creator, :ambassadors, :current_events, :past_events, :feed, :category, :address, :allow_member_post_to_feed, :allow_member_post_to_events)\n end", "def specialty_params\n\t\tparams.require(:specialty).permit(*Specialty::DEFAULT_ACCESSIBLE_ATTRIBUTES)\n\tend", "def authorize_params\n super.tap do |params|\n %w[display scope auth_type].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "def feature_params_filter\n params.require(:feature).permit(:name, :cat, :lower, :upper, :opts, :category, :description, :company, :active, :unit, :icon)\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 argument_params\n params.require(:argument).permit(:name)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def property_params\n params.permit(:name, :is_available, :is_approved, :owner_id)\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 sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end", "def whitelist_person_params\n params.require(:person).permit(:family, :pre_title, :given_name, :dates, :post_title, :epithet, :dates_of_office, same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end", "def parameters\n nil\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def sequence_param_whitelist\n default_param_whitelist << \"show_index\"\n end", "def resource_filter_permitted_params\n raise(NotImplementedError, 'resource_filter_permitted_params method not implemented')\n end", "def normal_params\n reject{|param, val| param_definitions[param][:internal] }\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 special_device_list_params\n params.require(:special_device_list).permit(:name)\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" ]
[ "0.7121987", "0.70541996", "0.69483954", "0.6902367", "0.6733912", "0.6717838", "0.6687021", "0.6676254", "0.66612333", "0.6555296", "0.6527056", "0.6456324", "0.6450841", "0.6450127", "0.6447226", "0.6434961", "0.64121825", "0.64121825", "0.63913447", "0.63804525", "0.63804525", "0.6373396", "0.6360051", "0.6355191", "0.62856233", "0.627813", "0.62451434", "0.6228103", "0.6224965", "0.6222941", "0.6210244", "0.62077755", "0.61762565", "0.61711127", "0.6168448", "0.6160164", "0.61446255", "0.6134175", "0.6120522", "0.6106709", "0.60981655", "0.6076113", "0.60534036", "0.60410434", "0.6034582", "0.6029977", "0.6019861", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.60184896", "0.60157263", "0.6005857", "0.6003803", "0.60012573", "0.59955895", "0.5994598", "0.5993604", "0.5983824", "0.5983166", "0.5977431", "0.597591", "0.5968824", "0.5965953", "0.59647584", "0.59647584", "0.59566855", "0.59506303", "0.5950375", "0.59485626", "0.59440875", "0.5930872", "0.5930206", "0.5925668", "0.59235454", "0.5917905", "0.59164816", "0.5913821", "0.59128743", "0.5906617", "0.59053683", "0.59052664", "0.5901591", "0.58987755", "0.5897456", "0.58970183", "0.58942604" ]
0.0
-1
GET /police_units GET /police_units.json
def index @police_units = PoliceUnit.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def foods_units\n get('/foods/units.json')\n end", "def units\n @units = Item.select(\"DISTINCT unit\").where(\"unit like ?\", \"%#{params[:q]}%\").limit(20).map(&:unit)\n @units += Detail.select(\"DISTINCT unit\").where(\"unit like ?\", \"%#{params[:q]}%\").limit(20).map(&:unit)\n @units = @units.uniq\n respond_to do |format|\n format.json { render json: @units }\n end\n end", "def index\n response = HTTParty.get(\"https://casa-core.herokuapp.com/api/units\", :headers => { \"Authorization\" => AUTH, \"Host\" => HOST})\n @units = JSON.parse(response.body)\n return @units\n end", "def units\n attribute('yweather:units')\n end", "def all_units\n services.map{|el| el[:units]} \n end", "def units\n self.ListUnits.first.map { |u| map_unit(u) }\n end", "def unit_of_measurement_find_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UnitOfMeasurementApi.unit_of_measurement_find ...\"\n end\n # resource path\n local_var_path = \"/UnitsOfMeasurement\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml']\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(: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 => 'Array<UnitOfMeasurement>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UnitOfMeasurementApi#unit_of_measurement_find\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def units(units=nil)\n cur_page.units(units)\n end", "def units\n @formulation = (params[:formulation] || '').upcase\n drug = Drug.find_by_name(@formulation) rescue nil\n render plain: \"per dose\" and return unless drug && !drug.units.blank?\n render plain: drug.units\n end", "def units\n return @units\n end", "def get_units\n @agency, @depts = params[:agency], params[:dept]\n render :layout => false\n end", "def units\n @units = SQF.units @this\n @units\n end", "def user_units\n @user.units\n end", "def available_units\n # After manual set, duplicate map for form select lists\n all_units = ['gram', 'kg', 'lb', 'oz', 'liter', 'gal', 'qt', 'pt', 'us_fl_oz', 'tsp', 'tbsp', 'cup', 'each'].map { |unit| [unit, unit] }.sort\n return all_units\n\tend", "def playableUnits \n \"playableUnits\" \n end", "def index\n @units = Unit.all\n end", "def index\n @units = Unit.all\n end", "def index\n @units = Unit.all\n end", "def index\n @units = Unit.all\n end", "def index\n @units = Unit.all\n end", "def index\n @units = Unit.all\n end", "def unit(unit_id=nil, opts = {})\n units = connection.get(connection.build_url(\"units\", opts.merge(:unitids => unit_id))).body\n units.map!{|hash| hash.values.first}\n units.each{|u| u.extend UnitMethods; u._cloud_connect = self;}\n units.first\n end", "def allowed_units\n @converter.list_units(true)\n end", "def units=(value)\n @units = value\n end", "def units\n\t\tret = []\n\t\t@db.smembers('sgt-structure:' + @id + ':units').each do |uid|\n\t\t\tret.push(getUnit(@db, uid))\n\t\tend\n\t\tret\n\tend", "def unit_of_measurement_count_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UnitOfMeasurementApi.unit_of_measurement_count ...\"\n end\n # resource path\n local_var_path = \"/UnitsOfMeasurement/count\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml']\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(: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 => 'InlineResponse200')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UnitOfMeasurementApi#unit_of_measurement_count\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def set_police_unit\n @police_unit = PoliceUnit.find(params[:id])\n end", "def get_upgrade_units_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UpgradeApi.get_upgrade_units ...\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling UpgradeApi.get_upgrade_units, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling UpgradeApi.get_upgrade_units, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = \"/upgrade/upgrade-units\"\n\n # query parameters\n query_params = {}\n query_params[:'component_type'] = opts[:'component_type'] if !opts[:'component_type'].nil?\n query_params[:'current_version'] = opts[:'current_version'] if !opts[:'current_version'].nil?\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'group_id'] = opts[:'group_id'] if !opts[:'group_id'].nil?\n query_params[:'has_warnings'] = opts[:'has_warnings'] if !opts[:'has_warnings'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'metadata'] = opts[:'metadata'] if !opts[:'metadata'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n query_params[:'upgrade_unit_type'] = opts[:'upgrade_unit_type'] if !opts[:'upgrade_unit_type'].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 => 'UpgradeUnitListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UpgradeApi#get_upgrade_units\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def unit\n return @units[@index]\n end", "def unit\n return @units[@index]\n end", "def emission_units\n data['emission_units']\n end", "def index\n @units = if params[:order] == 'updated'\n Unit.order('updated_at ' + params[:updated_direction])\n elsif params[:order] == 'created'\n Unit.order('created_at ' + params[:created_direction])\n elsif params[:order] == 'note_updated'\n Unit.order('note_updated_at ' + params[:note_updated_direction])\n elsif params[:order] == 'first_name'\n Unit.joins(:resident).order('residents.first_name ' + params[:first_name_direction])\n elsif params[:order] == 'last_name'\n Unit.joins(:resident).order('residents.last_name ' + params[:last_name_direction])\n elsif params[:order] == 'name'\n Unit.order('name ' + params[:name_direction])\n elsif params[:order] == 'address'\n Kaminari.paginate_array(Address.joins(:street, :units).order(\"streets.name #{params[:address_direction]}\").order(\"addresses.street_number #{params[:address_direction]}\").map(&:units).flatten)\n else\n Unit.order('created_at desc')\n end.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @units }\n end\n end", "def police_unit_params\n params.require(:police_unit).permit(:name)\n end", "def transfer_unit\n if !params[:ic_number].nil?\n user = User.find_by_ic_number(params[:ic_number])\n departments = user.units.active.collect(&:name)\n render :json=>[departments] if departments\n end\n end", "def show\n @units = @commercial_lead.units\n end", "def show\n @unit_of_measure = UnitOfMeasure.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit_of_measure }\n end\n end", "def show\n @unit = Unit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit }\n end\n end", "def show\n @unit = Unit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit }\n end\n end", "def show\n @unit = Unit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit }\n end\n end", "def show\n query = {\n 'id' => unit_params[:id]\n }\n response = HTTParty.get(\"https://casa-core.herokuapp.com/api/units/?id\", :query => query, :headers => { \"Authorization\" => AUTH, \"Host\" => HOST})\n\n if response.code == 200\n @unit = JSON.parse(response.body)\n else\n redirect_to unit_path(params[:id]), notice: 'Hmm...thats strange...try that again.'\n end\n end", "def index\n @base_units = BaseUnit.all\n end", "def unit_mappings\n {\n ApiUnitSystem.US => { :duration => \"milliseconds\", :distance => \"miles\", :elevation => \"feet\", :height => \"inches\", :weight => \"pounds\", :measurements => \"inches\", :liquids => \"fl oz\", :blood_glucose => \"mg/dL\" },\n ApiUnitSystem.UK => { :duration => \"milliseconds\", :distance => \"kilometers\", :elevation => \"meters\", :height => \"centimeters\", :weight => \"stone\", :measurements => \"centimeters\", :liquids => \"mL\", :blood_glucose => \"mmol/l\" },\n ApiUnitSystem.METRIC => { :duration => \"milliseconds\", :distance => \"kilometers\", :elevation => \"meters\", :height => \"centimeters\", :weight => \"kilograms\", :measurements => \"centimeters\", :liquids => \"mL\", :blood_glucose => \"mmol/l\" }\n }\n end", "def get_org_unit_properties(org_unit_id)\n path = \"/d2l/api/lp/#{$lp_ver}/orgstructure/#{org_unit_id}\"\n _get(path)\n # return json of org_unit properties\nend", "def unit_params\n params.fetch(:unit, {})\n end", "def index\n @standard_units = StandardUnit.all\n end", "def available_units\n return 0 if status == NO_SPACE\n\n 999\n end", "def unit_rules\n Rules.raw[\"units\"][type]\n end", "def show\n @unit = Unit.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit }\n end\n end", "def getuom\n @deliverable_type = DeliverableType.find(params[:id])\n respond_to do |format|\n format.json { render :json => @deliverable_type.uom}\n end\n end", "def index\n hash = cookies[:city_hash]\n @city = City.find_by(city_hash: hash)\n @units = @city.units\n\n render json: @units, status: :ok\n end", "def units _args\n \"units _args;\" \n end", "def get_usage_rum_units_with_http_info(start_hr, opts = {})\n\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_rum_units ...'\n end\n # verify the required parameter 'start_hr' is set\n if @api_client.config.client_side_validation && start_hr.nil?\n fail ArgumentError, \"Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_rum_units\"\n end\n # resource path\n local_var_path = '/api/v1/usage/rum'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'start_hr'] = start_hr\n query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?\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;datetime-format=rfc3339'])\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] || 'UsageRumUnitsResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]\n\n new_options = opts.merge(\n :operation => :get_usage_rum_units,\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 :api_version => \"V1\"\n )\n\n data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UsageMeteringAPI#get_usage_rum_units\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def total_units\n return @total_units\n end", "def units\n definitions = unit_counts\n\n units = []\n definitions.each do |type, count, flank|\n klass = \"Unit::#{type.camelcase}\".constantize\n count.times do\n unit = klass.new(:level => 1, :location => @planet, :flank => flank)\n unit.skip_validate_technologies = true\n\n units.push unit\n end\n end\n\n units\n end", "def units(*list)\n @units.concat(makelist(list)) unless list.empty?\n @units\n end", "def units\n game.squares.each_with_object([]) do |square, collection|\n square.units.each do |unit|\n collection << unit if unit.player_number == number\n end\n end\n end", "def report_unit_statuses\n u_times = Unit.all.map do |u|\n { :id => u.id, :state => u.state, :duration => u.duration, :time_available => u.time_available }\n end\n respond_to do |format|\n format.html { render nothing: true }\n format.js { respond_with(u_times) }\n end\n end", "def show\n @electoral_unit = ElectoralUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @electoral_unit }\n end\n end", "def index\n @org_units = OrgUnit.all\n end", "def units\n q = \"select distinct unit_id from master_files m inner join master_file_locations l on l.master_file_id=m.id\"\n q << \" where location_id = #{id}\"\n return Location.connection.query(q).flatten\n end", "def getAllUnits\n deep_copy(@allUnits)\n end", "def base_unit\n units[0]\n end", "def index\n @units = @gang.units.order( :id )\n @can_add_units = can_add_units\n end", "def completed_units\n return @completed_units\n end", "def unit_of_measurement_find_one_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UnitOfMeasurementApi.unit_of_measurement_find_one ...\"\n end\n # resource path\n local_var_path = \"/UnitsOfMeasurement/findOne\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml']\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(: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 => 'UnitOfMeasurement')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UnitOfMeasurementApi#unit_of_measurement_find_one\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_measurements\n render json: @data_source.measurements\n end", "def units(auth_name: nil, category: nil, allow_deprecated: false)\r\n # Create pointer to read the count output parameter\r\n out_result_count = FFI::MemoryPointer.new(:int)\r\n\r\n # Result is an array of pointers to structures\r\n pp_units = Api.proj_get_units_from_database(Context.current, auth_name, category, allow_deprecated ? 1 : 0, out_result_count)\r\n count = out_result_count.read(:int)\r\n array_p_units = pp_units.read_array_of_pointer(count)\r\n\r\n result = Array.new(count)\r\n count.times do |i|\r\n unit_info = Api::PROJ_UNIT_INFO.new(array_p_units[i])\r\n\r\n result[i] = Unit.new(unit_info[:auth_name],\r\n unit_info[:code],\r\n unit_info[:name],\r\n unit_info[:category],\r\n unit_info[:conv_factor],\r\n unit_info[:proj_short_name],\r\n unit_info[:deprecated])\r\n end\r\n\r\n Api.proj_unit_list_destroy(pp_units)\r\n\r\n result\r\n end", "def index\n @unit_type = UnitType.all\n\n respond_to do |format|\n format.json { render json: @unit_type }\n format.xml { render xml: @unit_type }\n end\n end", "def units_hash\n {\n \"_hrs\" => \"hours\",\n \"_hours\"=>\"hours\",\n \"_min\"=>\"minutes\",\n \"_minutes\"=>\"minutes\",\n \"_ppm\"=>\"ppm\",\n \"_ppb\"=>\"ppb\",\n \"_mgm3\"=>\"mg/m3\",\n \"_f\"=>\"&deg;f\",\n \"_c\"=>\"&deg;c\",\n \"_rh\"=>\"% rh\",\n \"_utf\"=>\"\"\n }\n end", "def find_units(modids)\n # TODO: Rename unit_search?\n units = connection.get(connection.build_url(\"units/search\", :modids => modids)).body\n units.map!{|hash| hash.values.first}\n units.each{|u| u.extend UnitMethods; u._cloud_connect = self;}\n end", "def index\n @programme_units = ProgrammeUnit.all\n end", "def measurements_get(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: MeasurementApi#measurements_get ...\"\n end\n \n # resource path\n path = \"/measurements\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'access_token'] = opts[:'access_token'] if opts[:'access_token']\n query_params[:'user_id'] = opts[:'user_id'] if opts[:'user_id']\n query_params[:'client_id'] = opts[:'client_id'] if opts[:'client_id']\n query_params[:'connector_id'] = opts[:'connector_id'] if opts[:'connector_id']\n query_params[:'variable_id'] = opts[:'variable_id'] if opts[:'variable_id']\n query_params[:'source_id'] = opts[:'source_id'] if opts[:'source_id']\n query_params[:'start_time'] = opts[:'start_time'] if opts[:'start_time']\n query_params[:'value'] = opts[:'value'] if opts[:'value']\n query_params[:'unit_id'] = opts[:'unit_id'] if opts[:'unit_id']\n query_params[:'original_value'] = opts[:'original_value'] if opts[:'original_value']\n query_params[:'original_unit_id'] = opts[:'original_unit_id'] if opts[:'original_unit_id']\n query_params[:'duration'] = opts[:'duration'] if opts[:'duration']\n query_params[:'note'] = opts[:'note'] if opts[:'note']\n query_params[:'latitude'] = opts[:'latitude'] if opts[:'latitude']\n query_params[:'longitude'] = opts[:'longitude'] if opts[:'longitude']\n query_params[:'location'] = opts[:'location'] if opts[:'location']\n query_params[:'created_at'] = opts[:'created_at'] if opts[:'created_at']\n query_params[:'updated_at'] = opts[:'updated_at'] if opts[:'updated_at']\n query_params[:'error'] = opts[:'error'] if opts[:'error']\n query_params[:'limit'] = opts[:'limit'] if opts[:'limit']\n query_params[:'offset'] = opts[:'offset'] if opts[:'offset']\n query_params[:'sort'] = opts[:'sort'] if opts[:'sort']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\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']\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 = ['quantimodo_oauth2']\n result = @api_client.call_api(:GET, 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 => 'inline_response_200_13')\n if Configuration.debugging\n Configuration.logger.debug \"API called: MeasurementApi#measurements_get. Result: #{result.inspect}\"\n end\n return result\n end", "def get_units(dimension)\n nil\n end", "def unit_t\n I18n.t \"#{self.unit_s}\", :count => 1\n end", "def show\n @item_unit = ItemUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item_unit }\n end\n end", "def show\n @extent_unit = ExtentUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @extent_unit }\n end\n end", "def unit_params\n params.require(:unit).permit(:user_id, :building_id, :floor_number, :side, :unit_number, :area, :resident_count)\n end", "def total_units=(value)\n @total_units = value\n end", "def portal_units_for(planet)\n player_id, ally_player_ids, planet_ids, ally_planet_ids =\n get_ids_from_planet(planet)\n volume = teleported_volume_for(planet)\n\n pick_units(\n player_id, planet_ids, ally_player_ids, ally_planet_ids, volume\n )\n rescue NoUnitsError\n []\n end", "def index\n @display_units = DisplayUnit.all\n end", "def index\n authorize Unit\n @units_version = Unit.version\n @units = Unit.all\n render\n end", "def index\n @quotation_units = QuotationUnit.all\n end", "def index\n @unit_measures = UnitMeasure.all\n end", "def update\n respond_to do |format|\n if @police_unit.update(police_unit_params)\n format.html { redirect_to @police_unit, notice: 'Police unit was successfully updated.' }\n format.json { render :show, status: :ok, location: @police_unit }\n else\n format.html { render :edit }\n format.json { render json: @police_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @police_unit = PoliceUnit.new(police_unit_params)\n\n respond_to do |format|\n if @police_unit.save\n format.html { redirect_to @police_unit, notice: 'Police unit was successfully created.' }\n format.json { render :show, status: :created, location: @police_unit }\n else\n format.html { render :new }\n format.json { render json: @police_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @resource = Resource.find(params[:resource_id])\n @incident = Incident.find(@resource.incident_id)\n @demob = Demob.find(params[:id])\n @logistics_units = @demob.units[0..5]\n @finance_units = @demob.units[6..8]\n @other_units = @demob.units[9..10]\n @plans_units = @demob.units[11..13]\n end", "def get_upgrade_units_stats_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UpgradeApi.get_upgrade_units_stats ...\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling UpgradeApi.get_upgrade_units_stats, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling UpgradeApi.get_upgrade_units_stats, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = \"/upgrade/upgrade-units-stats\"\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n query_params[:'sync'] = opts[:'sync'] if !opts[:'sync'].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 => 'UpgradeUnitTypeStatsList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UpgradeApi#get_upgrade_units_stats\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def parse_units\n # extract the unit suffix\n if self =~ /(\\d[\\d_]*(?:\\.\\d+)?)\\s*([a-zA-Z]+\\b|%(?= \\s|$))/\n units = $2.downcase\n num = $1 #.to_f\n num = num[\".\"] ? num.to_f : num.to_i\n\n case units\n when \"%\"\n # 0.01\n num / 100.0\n when \"k\"\n # 10**3\n num.thousand\n when \"m\", \"mm\"\n # 10**6\n num.million\n when \"b\", \"bn\"\n # 10**9\n num.billion\n when \"gib\", \"gb\", \"g\"\n num * 2**30\n when \"mib\", \"mb\"\n num * 2**20\n when \"kib\", \"kb\"\n num * 2**10\n when \"t\", \"tb\"\n # 10**12\n num.trillion\n when \"q\"\n # 10**15\n num.quadrillion\n when \"Q\"\n # 10**18\n num.quintillion\n when \"min\"\n # 1.minute\n num.minutes\n when \"hours\", \"h\", \"hr\", \"hrs\"\n # 1.hour\n num.hours\n when \"d\", \"days\", \"dy\"\n num.days\n else\n raise \"Invalid units: #{units.inspect}, in: #{self.inspect}\"\n end\n else\n raise \"Couldn't find any units to parse! (expecting: '<a number><some letters>')\"\n end\n end", "def units=(list)\n @units = makelist(list)\n end", "def index\n @units = Unit.search.\n institution(current_institution).\n include_children(false).\n order(\"#{Unit::IndexFields::TITLE}.sort\").\n limit(9999)\n end", "def index\n @breadcrumbs = [[t(:units)]]\n @units = @units.order(:name).page(params[:page])\n end", "def show\n @retail_unit = RetailUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @retail_unit }\n end\n end", "def initialize\n @converter = Converter.new\n @all_units = @converter.list_units\n end", "def index\n @army_units = ArmyUnit.all\n end", "def units_per_package\n unit_factor = self.service.displayed_pricing_map.unit_factor\n units_per_package = unit_factor || 1\n\n return units_per_package\n end", "def get_upgrade_units(opts = {})\n data, _status_code, _headers = get_upgrade_units_with_http_info(opts)\n return data\n end", "def get_adapter_unit_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AdapterApi.get_adapter_unit_list ...'\n end\n allowable_values = [\"allpages\", \"none\"]\n if @api_client.config.client_side_validation && opts[:'inlinecount'] && !allowable_values.include?(opts[:'inlinecount'])\n fail ArgumentError, \"invalid value for \\\"inlinecount\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/api/v1/adapter/Units'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'$orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?\n query_params[:'$top'] = opts[:'top'] if !opts[:'top'].nil?\n query_params[:'$skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n query_params[:'$select'] = opts[:'select'] if !opts[:'select'].nil?\n query_params[:'$expand'] = opts[:'expand'] if !opts[:'expand'].nil?\n query_params[:'$apply'] = opts[:'apply'] if !opts[:'apply'].nil?\n query_params[:'$count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'$inlinecount'] = opts[:'inlinecount'] if !opts[:'inlinecount'].nil?\n query_params[:'at'] = opts[:'at'] if !opts[:'at'].nil?\n query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].nil?\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', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\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] || 'AdapterUnitResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"AdapterApi.get_adapter_unit_list\",\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(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AdapterApi#get_adapter_unit_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def unit_params\n params.\n require(:unit).\n permit(:user_building_id, :unit_number, :sqfootage, :number_bedrooms,\n :number_bathrooms, :number_rooms, :number_occupants)\n end", "def unit_params\n params.require(:unit).permit(:short_label, :long_label, :universe)\n end", "def index\n @rented_units = appointment.rented_units\n end" ]
[ "0.77088684", "0.6707797", "0.66707706", "0.65505856", "0.6391909", "0.6391407", "0.6386095", "0.63806885", "0.63610554", "0.62738866", "0.62525475", "0.6187228", "0.6159946", "0.6151872", "0.6151586", "0.61315656", "0.61315656", "0.61315656", "0.61315656", "0.61315656", "0.61315656", "0.6023731", "0.6014118", "0.59929025", "0.59398806", "0.5939512", "0.59395033", "0.59342813", "0.5919565", "0.5919565", "0.59140676", "0.58972204", "0.58780444", "0.5855358", "0.58461267", "0.5835669", "0.5833793", "0.5833793", "0.5833793", "0.58250254", "0.5815694", "0.5802297", "0.57991", "0.57927305", "0.57853377", "0.5784965", "0.5784804", "0.57820994", "0.57746047", "0.5744697", "0.57427275", "0.5734679", "0.57284045", "0.570963", "0.570388", "0.5701562", "0.5683614", "0.5661534", "0.5657149", "0.5656696", "0.5654891", "0.5652749", "0.5649693", "0.5642181", "0.56119305", "0.5609397", "0.56032884", "0.5568121", "0.5565491", "0.5557565", "0.55527484", "0.55384964", "0.5535503", "0.5521946", "0.5519586", "0.5504593", "0.55026174", "0.5492267", "0.5488738", "0.54884946", "0.5481702", "0.54809195", "0.5472289", "0.5470677", "0.5456329", "0.5453153", "0.5436423", "0.5428763", "0.5424023", "0.54224944", "0.5421174", "0.5412907", "0.5412823", "0.5411813", "0.54103476", "0.5410308", "0.5406201", "0.5398883", "0.53905535", "0.53902054" ]
0.7100343
1
GET /police_units/1 GET /police_units/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def foods_units\n get('/foods/units.json')\n end", "def index\n @police_units = PoliceUnit.all\n end", "def units\n @units = Item.select(\"DISTINCT unit\").where(\"unit like ?\", \"%#{params[:q]}%\").limit(20).map(&:unit)\n @units += Detail.select(\"DISTINCT unit\").where(\"unit like ?\", \"%#{params[:q]}%\").limit(20).map(&:unit)\n @units = @units.uniq\n respond_to do |format|\n format.json { render json: @units }\n end\n end", "def index\n response = HTTParty.get(\"https://casa-core.herokuapp.com/api/units\", :headers => { \"Authorization\" => AUTH, \"Host\" => HOST})\n @units = JSON.parse(response.body)\n return @units\n end", "def unit_of_measurement_find_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UnitOfMeasurementApi.unit_of_measurement_find ...\"\n end\n # resource path\n local_var_path = \"/UnitsOfMeasurement\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml']\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(: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 => 'Array<UnitOfMeasurement>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UnitOfMeasurementApi#unit_of_measurement_find\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n query = {\n 'id' => unit_params[:id]\n }\n response = HTTParty.get(\"https://casa-core.herokuapp.com/api/units/?id\", :query => query, :headers => { \"Authorization\" => AUTH, \"Host\" => HOST})\n\n if response.code == 200\n @unit = JSON.parse(response.body)\n else\n redirect_to unit_path(params[:id]), notice: 'Hmm...thats strange...try that again.'\n end\n end", "def unit_of_measurement_find_one_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UnitOfMeasurementApi.unit_of_measurement_find_one ...\"\n end\n # resource path\n local_var_path = \"/UnitsOfMeasurement/findOne\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml']\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(: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 => 'UnitOfMeasurement')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UnitOfMeasurementApi#unit_of_measurement_find_one\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n @unit = Unit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit }\n end\n end", "def show\n @unit = Unit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit }\n end\n end", "def show\n @unit = Unit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit }\n end\n end", "def set_police_unit\n @police_unit = PoliceUnit.find(params[:id])\n end", "def show\n @unit = Unit.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit }\n end\n end", "def show\n @unit_of_measure = UnitOfMeasure.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit_of_measure }\n end\n end", "def show\n @electoral_unit = ElectoralUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @electoral_unit }\n end\n end", "def getuom\n @deliverable_type = DeliverableType.find(params[:id])\n respond_to do |format|\n format.json { render :json => @deliverable_type.uom}\n end\n end", "def show\n @retail_unit = RetailUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @retail_unit }\n end\n end", "def unit(unit_id=nil, opts = {})\n units = connection.get(connection.build_url(\"units\", opts.merge(:unitids => unit_id))).body\n units.map!{|hash| hash.values.first}\n units.each{|u| u.extend UnitMethods; u._cloud_connect = self;}\n units.first\n end", "def show\n @item_unit = ItemUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item_unit }\n end\n end", "def show\n @extent_unit = ExtentUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @extent_unit }\n end\n end", "def index\n @units = Unit.all\n end", "def index\n @units = Unit.all\n end", "def index\n @units = Unit.all\n end", "def index\n @units = Unit.all\n end", "def index\n @units = Unit.all\n end", "def index\n @units = Unit.all\n end", "def find_single(scope) \n JSON[RestClient.get \"#{@site}/unit/#{scope}\", :accept=>'json'][0]\n end", "def get_units\n @agency, @depts = params[:agency], params[:dept]\n render :layout => false\n end", "def index\n hash = cookies[:city_hash]\n @city = City.find_by(city_hash: hash)\n @units = @city.units\n\n render json: @units, status: :ok\n end", "def units\n @formulation = (params[:formulation] || '').upcase\n drug = Drug.find_by_name(@formulation) rescue nil\n render plain: \"per dose\" and return unless drug && !drug.units.blank?\n render plain: drug.units\n end", "def unit_of_measurement_count_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UnitOfMeasurementApi.unit_of_measurement_count ...\"\n end\n # resource path\n local_var_path = \"/UnitsOfMeasurement/count\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml']\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(: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 => 'InlineResponse200')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UnitOfMeasurementApi#unit_of_measurement_count\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n @unit = Unit.find(params[:id])\n @item = Item.find(@unit.item_id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit }\n end\n end", "def new\n @unit = Unit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unit }\n end\n end", "def new\n @unit = Unit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unit }\n end\n end", "def new\n @unit = Unit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unit }\n end\n end", "def create\n @police_unit = PoliceUnit.new(police_unit_params)\n\n respond_to do |format|\n if @police_unit.save\n format.html { redirect_to @police_unit, notice: 'Police unit was successfully created.' }\n format.json { render :show, status: :created, location: @police_unit }\n else\n format.html { render :new }\n format.json { render json: @police_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @unit = Unit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unit}\n end\n end", "def index\n @units = if params[:order] == 'updated'\n Unit.order('updated_at ' + params[:updated_direction])\n elsif params[:order] == 'created'\n Unit.order('created_at ' + params[:created_direction])\n elsif params[:order] == 'note_updated'\n Unit.order('note_updated_at ' + params[:note_updated_direction])\n elsif params[:order] == 'first_name'\n Unit.joins(:resident).order('residents.first_name ' + params[:first_name_direction])\n elsif params[:order] == 'last_name'\n Unit.joins(:resident).order('residents.last_name ' + params[:last_name_direction])\n elsif params[:order] == 'name'\n Unit.order('name ' + params[:name_direction])\n elsif params[:order] == 'address'\n Kaminari.paginate_array(Address.joins(:street, :units).order(\"streets.name #{params[:address_direction]}\").order(\"addresses.street_number #{params[:address_direction]}\").map(&:units).flatten)\n else\n Unit.order('created_at desc')\n end.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @units }\n end\n end", "def police_unit_params\n params.require(:police_unit).permit(:name)\n end", "def transfer_unit\n if !params[:ic_number].nil?\n user = User.find_by_ic_number(params[:ic_number])\n departments = user.units.active.collect(&:name)\n render :json=>[departments] if departments\n end\n end", "def single_usage\r\n meter = get_meters[3]\r\n date_ranges = get_date_ranges\r\n dtps = Meter.get_daily_time_periods [meter]\r\n\r\n# usage = meter.usage_by_meter(date_ranges, dtps)\r\n# usage = meter.usage_by_time(date_ranges, dtps)\r\n usage = meter.detailed_usage_by_meter(date_ranges, dtps)\r\n# usage = meter.detailed_usage_by_time(date_ranges, dtps)\r\n\r\n render :json => usage\r\n\r\n# redirect_to action: 'index'\r\n end", "def show\n @title = \"Prima Lingua: #{@section.name}\"\n if params[:unit_id]\n @overview_unit = Unit.find(params[:unit_id])\n else\n @overview_unit = @section.lesson.unit\n end\n respond_to do |format|\n format.html { render_flex_layout }\n format.json { render :json => @section }\n end\n end", "def get_org_unit_properties(org_unit_id)\n path = \"/d2l/api/lp/#{$lp_ver}/orgstructure/#{org_unit_id}\"\n _get(path)\n # return json of org_unit properties\nend", "def unit\n return @units[@index]\n end", "def unit\n return @units[@index]\n end", "def show\n @study_unit = StudyUnit.find(params[:id])\n @logical_products = @study_unit.logical_products\n @data_collections = @study_unit.data_collections\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @study_unit }\n end\n end", "def show\n @unit_type = UnitType.find(params[:id])\n respond_to do |format|\n format.json { render json: @unit_type }\n format.xml { render xml: @unit_type }\n end\n end", "def index\n @base_units = BaseUnit.all\n end", "def get\n\t\t\t result = Status.find_by(windmillid: params[:windmillid]) \n \t\t\trender json: [result.as_json(only: [:status,:power,:gen,:frequency,:rotor,:wind,:pitch])]\n\tend", "def update\n respond_to do |format|\n if @police_unit.update(police_unit_params)\n format.html { redirect_to @police_unit, notice: 'Police unit was successfully updated.' }\n format.json { render :show, status: :ok, location: @police_unit }\n else\n format.html { render :edit }\n format.json { render json: @police_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def get_measurements\n render json: @data_source.measurements\n end", "def show\n @units = @commercial_lead.units\n end", "def index\n @unit_type = UnitType.all\n\n respond_to do |format|\n format.json { render json: @unit_type }\n format.xml { render xml: @unit_type }\n end\n end", "def playableUnits \n \"playableUnits\" \n end", "def index\n @standard_units = StandardUnit.all\n end", "def new\n @unit_of_measure = UnitOfMeasure.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unit_of_measure }\n end\n end", "def units\n attribute('yweather:units')\n end", "def show\n @log_unit = LogUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @log_unit }\n end\n end", "def units\n self.ListUnits.first.map { |u| map_unit(u) }\n end", "def base_unit\n units[0]\n end", "def measurements_get(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: MeasurementApi#measurements_get ...\"\n end\n \n # resource path\n path = \"/measurements\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'access_token'] = opts[:'access_token'] if opts[:'access_token']\n query_params[:'user_id'] = opts[:'user_id'] if opts[:'user_id']\n query_params[:'client_id'] = opts[:'client_id'] if opts[:'client_id']\n query_params[:'connector_id'] = opts[:'connector_id'] if opts[:'connector_id']\n query_params[:'variable_id'] = opts[:'variable_id'] if opts[:'variable_id']\n query_params[:'source_id'] = opts[:'source_id'] if opts[:'source_id']\n query_params[:'start_time'] = opts[:'start_time'] if opts[:'start_time']\n query_params[:'value'] = opts[:'value'] if opts[:'value']\n query_params[:'unit_id'] = opts[:'unit_id'] if opts[:'unit_id']\n query_params[:'original_value'] = opts[:'original_value'] if opts[:'original_value']\n query_params[:'original_unit_id'] = opts[:'original_unit_id'] if opts[:'original_unit_id']\n query_params[:'duration'] = opts[:'duration'] if opts[:'duration']\n query_params[:'note'] = opts[:'note'] if opts[:'note']\n query_params[:'latitude'] = opts[:'latitude'] if opts[:'latitude']\n query_params[:'longitude'] = opts[:'longitude'] if opts[:'longitude']\n query_params[:'location'] = opts[:'location'] if opts[:'location']\n query_params[:'created_at'] = opts[:'created_at'] if opts[:'created_at']\n query_params[:'updated_at'] = opts[:'updated_at'] if opts[:'updated_at']\n query_params[:'error'] = opts[:'error'] if opts[:'error']\n query_params[:'limit'] = opts[:'limit'] if opts[:'limit']\n query_params[:'offset'] = opts[:'offset'] if opts[:'offset']\n query_params[:'sort'] = opts[:'sort'] if opts[:'sort']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\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']\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 = ['quantimodo_oauth2']\n result = @api_client.call_api(:GET, 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 => 'inline_response_200_13')\n if Configuration.debugging\n Configuration.logger.debug \"API called: MeasurementApi#measurements_get. Result: #{result.inspect}\"\n end\n return result\n end", "def all_units\n services.map{|el| el[:units]} \n end", "def index\n @study_units = StudyUnit.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @study_units }\n end\n end", "def units(units=nil)\n cur_page.units(units)\n end", "def index\n authorize Unit\n @units_version = Unit.version\n @units = Unit.all\n render\n end", "def v1_measurements_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: MeasurementsApi.v1_measurements_get ...\"\n end\n # resource path\n local_var_path = \"/v1/measurements\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'access_token'] = opts[:'access_token'] if opts[:'access_token']\n query_params[:'variableName'] = opts[:'variable_name'] if opts[:'variable_name']\n query_params[:'variableCategoryName'] = opts[:'variable_category_name'] if opts[:'variable_category_name']\n query_params[:'source'] = opts[:'source'] if opts[:'source']\n query_params[:'value'] = opts[:'value'] if opts[:'value']\n query_params[:'lastUpdated'] = opts[:'last_updated'] if opts[:'last_updated']\n query_params[:'unit'] = opts[:'unit'] if opts[:'unit']\n query_params[:'startTime'] = opts[:'start_time'] if opts[:'start_time']\n query_params[:'createdAt'] = opts[:'created_at'] if opts[:'created_at']\n query_params[:'updatedAt'] = opts[:'updated_at'] if opts[:'updated_at']\n query_params[:'endTime'] = opts[:'end_time'] if opts[:'end_time']\n query_params[:'groupingWidth'] = opts[:'grouping_width'] if opts[:'grouping_width']\n query_params[:'groupingTimezone'] = opts[:'grouping_timezone'] if opts[:'grouping_timezone']\n query_params[:'limit'] = opts[:'limit'] if opts[:'limit']\n query_params[:'offset'] = opts[:'offset'] if opts[:'offset']\n query_params[:'sort'] = opts[:'sort'] if opts[:'sort']\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 = ['oauth2']\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 => 'Measurement')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: MeasurementsApi#v1_measurements_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def new\n @electoral_unit = ElectoralUnit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @electoral_unit }\n end\n end", "def hours\n render json: Pings::Selector.new.hours(params)\n end", "def get_upgrade_units_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UpgradeApi.get_upgrade_units ...\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling UpgradeApi.get_upgrade_units, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling UpgradeApi.get_upgrade_units, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = \"/upgrade/upgrade-units\"\n\n # query parameters\n query_params = {}\n query_params[:'component_type'] = opts[:'component_type'] if !opts[:'component_type'].nil?\n query_params[:'current_version'] = opts[:'current_version'] if !opts[:'current_version'].nil?\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'group_id'] = opts[:'group_id'] if !opts[:'group_id'].nil?\n query_params[:'has_warnings'] = opts[:'has_warnings'] if !opts[:'has_warnings'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'metadata'] = opts[:'metadata'] if !opts[:'metadata'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n query_params[:'upgrade_unit_type'] = opts[:'upgrade_unit_type'] if !opts[:'upgrade_unit_type'].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 => 'UpgradeUnitListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UpgradeApi#get_upgrade_units\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def room_descriptions_method\r\n my_port = 8081\r\n htttproomnumber = $roomnumber\r\n roomsNtext = \"/#{htttproomnumber}\"\r\n rooms_message = \"/rooms#{roomsNtext}\"\r\n url = URI.parse(\"http://localhost:#{my_port}#{rooms_message}\")\r\n req = Net::HTTP::Get.new(url.to_s)\r\n res = Net::HTTP.start(url.host, url.port){|http|\r\n http.request(req)\r\n }\r\n my_json = JSON.parse(res.body) \r\n return my_json[\"room\"].to_s\r\nend", "def new\n @extent_unit = ExtentUnit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @extent_unit }\n end\n end", "def get_usage_rum_units_with_http_info(start_hr, opts = {})\n\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_rum_units ...'\n end\n # verify the required parameter 'start_hr' is set\n if @api_client.config.client_side_validation && start_hr.nil?\n fail ArgumentError, \"Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_rum_units\"\n end\n # resource path\n local_var_path = '/api/v1/usage/rum'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'start_hr'] = start_hr\n query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?\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;datetime-format=rfc3339'])\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] || 'UsageRumUnitsResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]\n\n new_options = opts.merge(\n :operation => :get_usage_rum_units,\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 :api_version => \"V1\"\n )\n\n data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UsageMeteringAPI#get_usage_rum_units\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @programme_units = ProgrammeUnit.all\n end", "def show\n @resource = Resource.find(params[:resource_id])\n @incident = Incident.find(@resource.incident_id)\n @demob = Demob.find(params[:id])\n @logistics_units = @demob.units[0..5]\n @finance_units = @demob.units[6..8]\n @other_units = @demob.units[9..10]\n @plans_units = @demob.units[11..13]\n end", "def index\n @floor_plans = @product.floor_plans\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @floor_plans }\n end\n end", "def destroy\n @police_unit.destroy\n respond_to do |format|\n format.html { redirect_to police_units_url, notice: 'Police unit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def new\n @item_unit = ItemUnit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @item_unit }\n end\n end", "def show\n @measurement = Measurement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @measurement }\n end\n end", "def show\n @standard_measurement = StandardMeasurement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @standard_measurement }\n end\n end", "def index\n @handbook_structual_units = HandbookStructualUnit.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @handbook_structual_units }\n end\n end", "def report_unit_statuses\n u_times = Unit.all.map do |u|\n { :id => u.id, :state => u.state, :duration => u.duration, :time_available => u.time_available }\n end\n respond_to do |format|\n format.html { render nothing: true }\n format.js { respond_with(u_times) }\n end\n end", "def get_routing_utilization_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutingApi.get_routing_utilization ...\"\n end\n \n # resource path\n local_var_path = \"/api/v2/routing/utilization\".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 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 \n auth_names = ['PureCloud OAuth']\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 => 'Utilization')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: RoutingApi#get_routing_utilization\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def unit_params\n params.fetch(:unit, {})\n end", "def index\n @units = @gang.units.order( :id )\n @can_add_units = can_add_units\n end", "def show\n @tenure = Tenure.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tenure }\n end\n end", "def select_unit_by_id(unit_id)\n @units[unit_id]\n end", "def select_unit_by_id(unit_id)\n @units[unit_id]\n end", "def show\n @unidade_metrica = UnidadeMetrica.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unidade_metrica }\n end\n end", "def new\n @retail_unit = RetailUnit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @retail_unit }\n end\n end", "def index\n get_data\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @unit_of_measures }\n format.js\n end\n end", "def assign_unit \n if !params[:ic_number].nil?\n @val = params[:transfer_from][:agency]\n user = User.find_by_ic_number(params[:ic_number])\n departments = user.units.active.collect(&:name)\n render :json=>[departments] if departments\n end\n end", "def set_unit\n @unit = Unit.friendly.find(params[:id])\n end", "def show\n @handbook_structual_unit = HandbookStructualUnit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @handbook_structual_unit }\n end\n end", "def get_routing_utilization_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutingApi.get_routing_utilization ...\"\n end\n \n # resource path\n local_var_path = \"/api/v2/routing/utilization\".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 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 \n auth_names = ['PureCloud Auth']\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 => 'Utilization')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: RoutingApi#get_routing_utilization\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n @city_measurement = CityMeasurement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @city_measurement }\n end\n end", "def get_adapter_unit_by_moid_with_http_info(moid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AdapterApi.get_adapter_unit_by_moid ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling AdapterApi.get_adapter_unit_by_moid\"\n end\n # resource path\n local_var_path = '/api/v1/adapter/Units/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.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', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\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] || 'AdapterUnit'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"AdapterApi.get_adapter_unit_by_moid\",\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(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AdapterApi#get_adapter_unit_by_moid\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def lookup(woeid, unit = Units::CELSIUS)\n acceptable_units = [Units::CELSIUS, Units::FARENHEIT]\n unit = Units::CELSIUS unless acceptable_units.include?(unit)\n\n url = ROOT + \"?q=select%20*%20from%20weather.forecast%20\"\n url += \"where%20woeid%3D#{woeid}%20and%20u%3D'#{unit}'&format=json\"\n\n doc = get_response url\n Response.new woeid, url, doc\n end", "def show\n @organizational_unit = resource\n\n# @compliance = EmployeeComplianceStatusCubicle.query do\n# select :employee_id, :employee_name, :requirement_status, :all_measures\n# by :mandatory\n# where :requirement_id=>BSON::ObjectId(id)\n# order_by :compliant, :employee_name\n# end\n# puts resource.class.name.underscore + \"_id[\" + params[:id] + \"]\"\n\n if request.xhr?\n render :partial=>\"/admin/organizational_units/show\"\n else\n index\n end\n end", "def show\r\n @uom = Uom.find(params[:id])\r\n end", "def index\n @org_units = OrgUnit.all\n end", "def show\n @quality_lot_gauge = QualityLotGauge.find(params[:quality_lot_gauge_id])\n @quality_lot_gauge_result = @quality_lot_gauge.quality_lot_gauge_results.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @quality_lot_gauge_result }\n end\n end", "def unit_t\n I18n.t \"#{self.unit_s}\", :count => 1\n end" ]
[ "0.7347725", "0.6999178", "0.665674", "0.6631179", "0.64239013", "0.6416045", "0.63548094", "0.6345466", "0.6345466", "0.6345466", "0.63292897", "0.6275956", "0.626924", "0.61934394", "0.61554784", "0.60439914", "0.6037014", "0.6022603", "0.5972396", "0.59405184", "0.59405184", "0.59405184", "0.59405184", "0.59405184", "0.59405184", "0.59102273", "0.58923435", "0.58758944", "0.58722925", "0.58509594", "0.5831419", "0.58287716", "0.58287716", "0.58287716", "0.5813015", "0.58085495", "0.5789077", "0.5788489", "0.57865244", "0.57781214", "0.5757085", "0.57459795", "0.57437724", "0.57437724", "0.5727891", "0.5724649", "0.5708692", "0.570459", "0.57019365", "0.56969875", "0.5696245", "0.568093", "0.5674303", "0.56736135", "0.5662163", "0.5646289", "0.5639081", "0.5638996", "0.5625783", "0.55773544", "0.55713594", "0.5567017", "0.5566089", "0.5545696", "0.55351716", "0.55160856", "0.5509563", "0.5505356", "0.54980034", "0.5493305", "0.5492899", "0.54888564", "0.54772127", "0.54737365", "0.5466871", "0.5459232", "0.54516107", "0.545055", "0.5450467", "0.5443824", "0.5438244", "0.54366106", "0.54315984", "0.5426839", "0.54212964", "0.54212964", "0.542035", "0.54173887", "0.541315", "0.5407589", "0.54009867", "0.5391182", "0.538868", "0.5382494", "0.53690416", "0.53542036", "0.53425133", "0.5341303", "0.5331143", "0.5329667", "0.53292245" ]
0.0
-1
POST /police_units POST /police_units.json
def create @police_unit = PoliceUnit.new(police_unit_params) respond_to do |format| if @police_unit.save format.html { redirect_to @police_unit, notice: 'Police unit was successfully created.' } format.json { render :show, status: :created, location: @police_unit } else format.html { render :new } format.json { render json: @police_unit.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def police_unit_params\n params.require(:police_unit).permit(:name)\n end", "def unit_params\n params.require(:unit).permit(:user_id, :building_id, :floor_number, :side, :unit_number, :area, :resident_count)\n end", "def unit_params\n params.require(:unit).permit(:short_label, :long_label, :universe)\n end", "def foods_units\n get('/foods/units.json')\n end", "def create\n @unit = Unit.new(params[:unit])\n\n respond_to do |format|\n if @unit.save\n format.html { redirect_to @unit, notice: 'Unit was successfully created.' }\n format.json { render json: @unit, status: :created, location: @unit }\n else\n format.html { render action: \"new\" }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @unit = Unit.new(params[:unit])\n\n respond_to do |format|\n if @unit.save\n format.html { redirect_to @unit, notice: 'Unit was successfully created.' }\n format.json { render json: @unit, status: :created, location: @unit }\n else\n format.html { render action: \"new\" }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @property = @user.properties.new(params[:property])\n @number_of_units = params[:number_of_units].to_i\n \n respond_to do |format|\n if @property.save\n @number_of_units.times do |unit|\n @property.units.build(:name => unit.to_s, :bedrooms=>1, :bathrooms=>1, :square_feet => 1000, :base_rent=>1000)\n end\n if (@property.save)\n flash[:notice] = 'Property and units created!'\n else\n flash[:notice] = 'Property creted, but errors creating units.'\n end\n format.html { redirect_to(@property) }\n format.xml { render :xml => @property, :status => :created, :location => @property }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @property.errors, :status => :unprocessable_entity }\n end\n end\n end", "def unit_params\n params.require(:unit).permit(:date, :value)\n end", "def unit_params\n params.require(:unit).permit(:name)\n end", "def create\n @unit_of_measure = UnitOfMeasure.create(params[:unit_of_measure])\n get_data\n end", "def create\n @retail_unit = RetailUnit.new(params[:retail_unit])\n\n respond_to do |format|\n if @retail_unit.save\n format.html { redirect_to @retail_unit, notice: 'Retail unit was successfully created.' }\n format.json { render json: @retail_unit, status: :created, location: @retail_unit }\n else\n format.html { render action: \"new\" }\n format.json { render json: @retail_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @item = Item.find(params[:item_id])\n @unit = @item.units.create(params[:unit])\n \n redirect_to item_path(@item)\n end", "def rented_unit_params\n params.require(:rented_unit).permit(:unit_no, :unit_model, :price, :bedrooms, :bathrooms, :half_baths, :square_footage, :leased, :appointment_id, :notes, :spanstart, :spanend)\n end", "def create\n # @unit = Unit.new(params[:unit])\n @unit = current_user.units.build(params[:unit])\n\n respond_to do |format|\n if @unit.save\n # format.html { redirect_to @unit, notice: 'Unit was successfully created.' }\n format.html { redirect_to units_path, notice: 'Pomyślnie utworzono jednostkę.' }\n format.json { render json: @unit, status: :created, location: @unit }\n else\n # format.html { render action: \"new\" }\n format.html { redirect_to units_path, :flash => { :error => 'Nie udało się utworzyć jednostki' } }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @electoral_unit = ElectoralUnit.new(params[:electoral_unit])\n\n respond_to do |format|\n if @electoral_unit.save\n format.html { redirect_to @electoral_unit, notice: 'Electoral unit was successfully created.' }\n format.json { render json: @electoral_unit, status: :created, location: @electoral_unit }\n else\n format.html { render action: \"new\" }\n format.json { render json: @electoral_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def unit_params\n params.require(:unit).permit(:libe, :amount, :points, :weapon)\n end", "def unit_params\n params.fetch(:unit, {}).permit(:name)\n end", "def set_police_unit\n @police_unit = PoliceUnit.find(params[:id])\n end", "def unit_params\n params.require(:unit).permit(:name, :circle_id)\n end", "def unit_params\n params.fetch(:unit, {})\n end", "def unit_of_measure_params\n params.require(:unit_of_measure).permit(:name, :description, :code, :uom_type, :ratio, :uom_category_id)\n end", "def create\n @base_unit = BaseUnit.new(base_unit_params)\n\n respond_to do |format|\n if @base_unit.save\n format.html { redirect_to @base_unit, notice: 'Tray type was successfully created.' }\n format.json { render action: 'show', status: :created, location: @base_unit }\n else\n format.html { render action: 'new' }\n format.json { render json: @base_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n authorize Unit\n @unit = Unit.new(unit_params)\n\n if @unit.save\n render status: :created\n else\n render json: {errors: @unit.errors}, status: :unprocessable_entity\n end\n end", "def unit_params\n params.require(:unit).permit(:name, :weight, :package_dimensions)\n end", "def create\n @unit_of_measure = UnitOfMeasure.new(params[:unit_of_measure])\n\n respond_to do |format|\n if @unit_of_measure.save\n format.html { redirect_to @unit_of_measure, notice: t(:unit_of_measure_created) }\n format.json { render json: @unit_of_measure, status: :created, location: @unit_of_measure }\n else\n format.html { render action: \"new\" }\n format.json { render json: @unit_of_measure.errors, status: :unprocessable_entity }\n end\n end\n end", "def unit_params\n params.require(:unit).permit(:featured, :number, :avail_date, :category_id, :building_id, :title, :description, :bedrooms, :bathrooms, :price, :link, :image, :phoneNum)\n end", "def create\n @extent_unit = ExtentUnit.new(params[:extent_unit])\n\n respond_to do |format|\n if @extent_unit.save\n format.html { redirect_to @extent_unit, notice: 'Extent unit was successfully created.' }\n format.json { render json: @extent_unit, status: :created, location: @extent_unit }\n else\n format.html { render action: \"new\" }\n format.json { render json: @extent_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def unit_params\n params.\n require(:unit).\n permit(:user_building_id, :unit_number, :sqfootage, :number_bedrooms,\n :number_bathrooms, :number_rooms, :number_occupants)\n end", "def create\n @item_unit = ItemUnit.new(params[:item_unit])\n\n respond_to do |format|\n if @item_unit.save\n format.html { redirect_to @item_unit, notice: 'Item unit was successfully created.' }\n format.json { render json: @item_unit, status: :created, location: @item_unit }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n post_params = {\n name: params[:name].downcase,\n units: params[:units] || 0\n }\n render json: Ingredient.create!(post_params), status: :created\n end", "def unit_params\n params.require(:unit).permit(:Unitcode, :name, :Unitaccuracy, :Roundingtype,:fbillstatus,:Creator,:CreateDate,:Approver,:ApproverDate)\n end", "def create\n # I was not able to get this working. I suspected a change may have occurred in the API that hasn't been published to docs.\n # Used https://www.hurl.it/ to test requests to the API. Was getting a success response, but\n # never saw the newly created unit in either my SDK or in the stage environment. Could be in the DB but missing an attribute/flag that allows\n # association to the property and/or allows for display.\n puts 'test1'\n #@unit = Unit.new(params)\n puts 'XYZ'\n puts params[:name]\n puts 'ABC'\n end", "def create\n @unit = Unit.new(unit_params)\n respond_to do |format|\n if @unit.save\n Unit.transaction do\n auth = Signet::Rails::Factory.create_from_env :google, request.env\n client = Google::APIClient.new\n client.authorization = auth\n plusDomain = client.discovered_api('plusDomains')\n @result = client.execute(:api_method => plusDomain.circles.insert,\n :parameters => {'userId' => 'me'},\n :body =>MultiJson.dump('displayName' => @unit.name),\n :headers => {'Content-Type' => 'application/json'}\n )\n @unit.update_column(:circle_id, @result.data.id)\n end\n format.html { redirect_to @unit, notice: 'Unit was successfully created.' }\n format.json { render action: 'show', status: :created, location: @unit }\n else\n format.html { render action: 'new' }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def unit_params\n params.require(:unit).permit(:title, :description, :use, :typology, :component_id, :ancestry, :parent_id)\n end", "def create\n @unit_measure = UnitMeasure.new(unit_measure_params)\n\n respond_to do |format|\n if @unit_measure.save\n format.html { redirect_to @unit_measure, notice: 'Unit measure was successfully created.' }\n format.json { render :show, status: :created, location: @unit_measure }\n else\n format.html { render :new }\n format.json { render json: @unit_measure.errors, status: :unprocessable_entity }\n end\n end\n end", "def units\n @units = Item.select(\"DISTINCT unit\").where(\"unit like ?\", \"%#{params[:q]}%\").limit(20).map(&:unit)\n @units += Detail.select(\"DISTINCT unit\").where(\"unit like ?\", \"%#{params[:q]}%\").limit(20).map(&:unit)\n @units = @units.uniq\n respond_to do |format|\n format.json { render json: @units }\n end\n end", "def units\n @formulation = (params[:formulation] || '').upcase\n drug = Drug.find_by_name(@formulation) rescue nil\n render plain: \"per dose\" and return unless drug && !drug.units.blank?\n render plain: drug.units\n end", "def punit_params\n params.require(:punit).permit(:price, :amount, :product_id)\n end", "def update\n params.require(%i[id units])\n retrieve_and_validate_put.update!(units: params[:units])\n head :no_content\n end", "def unit_of_measure_params\n params.require(:unit_of_measure).permit(:unit_id, :unit_description, :unit_status, :created_by, :updated_by)\n end", "def create\n @standard_unit = StandardUnit.new(standard_unit_params)\n\n if @standard_unit.save\n render :show, status: :created, location: @standard_unit\n else\n render json: @standard_unit.errors, status: :unprocessable_entity\n end\n end", "def measurements_post(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: MeasurementApi#measurements_post ...\"\n end\n \n # resource path\n path = \"/measurements\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'access_token'] = opts[:'access_token'] if opts[:'access_token']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\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']\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 = @api_client.object_to_http_body(opts[:'body'])\n \n\n auth_names = ['quantimodo_oauth2']\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 => 'inline_response_200_13')\n if Configuration.debugging\n Configuration.logger.debug \"API called: MeasurementApi#measurements_post. Result: #{result.inspect}\"\n end\n return result\n end", "def standard_unit_params\n params.require(:standard_unit).permit(:name)\n end", "def create\n @unit = Unit.new(unit_params)\n @unit.name = @unit.name.downcase\n\n respond_to do |format|\n if @unit.save\n format.html { redirect_to new_food_path, notice: 'Unit was successfully created.' }\n format.json { render action: 'show', status: :created, location: @unit }\n else\n flash[:error] = \"Unit can't be an empty string.\"\n format.html { redirect_to new_food_path }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @police_units = PoliceUnit.all\n end", "def assign_unit \n if !params[:ic_number].nil?\n @val = params[:transfer_from][:agency]\n user = User.find_by_ic_number(params[:ic_number])\n departments = user.units.active.collect(&:name)\n render :json=>[departments] if departments\n end\n end", "def unit_params\n params.require(:unit).permit(:name, :role, :power, :movement, :shooting_skill, :strength, :combat_skill, :attacks, :wounds, :leadership, :armor_save, :invul_shooting, :invul_combat, :single_model_point_cost, :model_count_increment, :power_for_each_increment, :min_model_count, :max_model_count, :detachment_id)\n end", "def update\n respond_to do |format|\n if @police_unit.update(police_unit_params)\n format.html { redirect_to @police_unit, notice: 'Police unit was successfully updated.' }\n format.json { render :show, status: :ok, location: @police_unit }\n else\n format.html { render :edit }\n format.json { render json: @police_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @unit = Unit.new(params[:unit])\n if session[:resident_id]\n @unit.resident_id = session[:resident_id]\n session[:resident_id] = nil\n end\n\n respond_to do |format|\n if @unit.save\n format.html { redirect_to @unit, notice: 'Unit was successfully created.' }\n format.json { render json: @unit, status: :created, location: @unit }\n else\n format.html { render action: \"new\" }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def unit_of_measurement_replace_or_create_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UnitOfMeasurementApi.unit_of_measurement_replace_or_create ...\"\n end\n # resource path\n local_var_path = \"/UnitsOfMeasurement/replaceOrCreate\".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 local_header_accept = ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\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', 'application/x-www-form-urlencoded', 'application/xml', 'text/xml']\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[:'data'])\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 => 'UnitOfMeasurement')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UnitOfMeasurementApi#unit_of_measurement_replace_or_create\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def units=(value)\n @units = value\n end", "def part_measurement_params\n params.require(:part_measurement).permit(:name, :unit, :value)\n end", "def measurement_type_params\n params.require(:measurement_type).permit(:name, :units, :description)\n end", "def unit_params \n params.require(:unit).permit(:name, :unit, :create_user, :edit_user, :comment)\n end", "def create\n @quotation_unit = QuotationUnit.new(quotation_unit_params)\n\n respond_to do |format|\n if @quotation_unit.save\n format.html { redirect_to @quotation_unit, notice: 'Quotation unit was successfully created.' }\n format.json { render :show, status: :created, location: @quotation_unit }\n else\n format.html { render :new }\n format.json { render json: @quotation_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @pupil_measurement = PupilMeasurement.new(pupil_measurement_params)\n\n respond_to do |format|\n if @pupil_measurement.save\n format.html { redirect_to @pupil_measurement, notice: \"Pupil measurement was successfully created.\" }\n format.json { render :show, status: :created, location: @pupil_measurement }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @pupil_measurement.errors, status: :unprocessable_entity }\n end\n end\n end", "def unit_params\n params.require(:unit).permit(:name, :type, :attack, :defence)\n end", "def transfer_unit\n if !params[:ic_number].nil?\n user = User.find_by_ic_number(params[:ic_number])\n departments = user.units.active.collect(&:name)\n render :json=>[departments] if departments\n end\n end", "def cat_uni_measure_unit_params\n params.require(:cat_uni_measure_unit).permit(:key, :description)\n end", "def create\n @timeunit = Timeunit.new(params[:timeunit])\n\n respond_to do |format|\n if @timeunit.save\n format.html { redirect_to(@timeunit, :notice => 'Timeunit was successfully created.') }\n format.xml { render :xml => @timeunit, :status => :created, :location => @timeunit }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @timeunit.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @rent_unit = RentUnit.new(rent_unit_params)\n\n respond_to do |format|\n if @rent_unit.save\n format.html { redirect_to @rent_unit, notice: 'Rent unit was successfully created.' }\n format.json { render :show, status: :created, location: @rent_unit }\n else\n format.html { render :new }\n format.json { render json: @rent_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def medical_unit_params\n params.permit(:name, :location, :speciality, :image)\n end", "def new\n @unit = Unit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unit }\n end\n end", "def new\n @unit = Unit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unit }\n end\n end", "def new\n @unit = Unit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unit }\n end\n end", "def unit_params\n params.require(:unit).permit(\n :address1, :address2, :city, :state, :zip_code, :time_zone, :attach_consent_form,\n :use_consent_form, :consent_form, :url_consent_form, :home_address1, :home_address2, :home_zip_code,\n :home_state, :home_city, :home_map_url, :home_name, { health_form_coordinator_ids: [] }\n )\n end", "def new\n @unit = Unit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unit}\n end\n end", "def create\n @measurement = Measurement.new( measurement_params )\n\n # TODO \n unless @measurement.save\n render status: 500, json: @measurement.errors.full_messages\n end\n \n data = {\n circles: @measurement.circles.to_json \n }\n render status: :ok, json: @measurement if @measurement.valid?\n \n end", "def create\n @unit_name = UnitName.new(unit_name_params)\n\n respond_to do |format|\n if @unit_name.save\n format.html { redirect_to @unit_name, notice: 'Unit name was successfully created.' }\n format.json { render action: 'show', status: :created, location: @unit_name }\n else\n format.html { render action: 'new' }\n format.json { render json: @unit_name.errors, status: :unprocessable_entity }\n end\n end\n end", "def unit_params\n params.require(:unit).permit(:name, :subsystem_id)\n end", "def unit_measure_params\n params.require(:unit_measure).permit(:nominal_reference, :unit_measure_id, :conversion_id, :metric_id)\n end", "def create\n @unit = Unit.new(unit_params)\n authorize @unit\n begin\n ActiveRecord::Base.transaction do\n @unit.save!\n end\n rescue => e\n render partial: \"shared/validation_messages\",\n locals: { object: @unit.errors.any? ? @unit : e },\n status: :bad_request\n else\n RefreshOpensearchJob.perform_later\n toast!(title: \"Unit created\",\n message: \"The unit \\\"#{@unit.title}\\\" has been created.\")\n render \"shared/reload\"\n end\n end", "def rent_unit_params\n params.require(:rent_unit).permit(:name)\n end", "def measurement_unit_params\n params.require(:measurement_unit).permit(:name, :lock)\n end", "def create\n @page_title = \"Power Units\"\n @power_unit = PowerUnit.new(params[:power_unit])\n\n respond_to do |format|\n if @power_unit.save\n flash[:notice] = 'PowerUnit was successfully created.'\n format.html { redirect_to(@power_unit) }\n format.xml { render :xml => @power_unit, :status => :created, :location => @power_unit }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @power_unit.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @recipe_ingredients_unit = RecipeIngredientsUnit.new(recipe_ingredients_unit_params)\n\n respond_to do |format|\n if @recipe_ingredients_unit.save\n format.html { redirect_to recipe_ingredients_units_path, notice: 'Recipe ingredients unit was successfully created.' }\n format.json { render :show, status: :created, location: @recipe_ingredients_unit }\n else\n format.html { render :new }\n format.json { render json: @recipe_ingredients_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n add_gang_to_unit\n\n @can_pay_unit = @unit.points <= @player.pp\n\n Unit.transaction do\n respond_to do |format|\n if @can_pay_unit && @unit.save\n\n after_unit_update( :create,\n amount: @unit.amount, unit_libe: @unit.libe, gang_name: @gang.name )\n\n pay_unit( @unit.points )\n\n check_maintenance_status!\n\n format.html { redirect_to gang_units_path( @gang ), notice: t( '.success' ) }\n else\n set_units_rules_data\n flash[ :alert ] = @can_pay_unit ? '' : I18n.t( 'units.alert.cant_pay' )\n set_hash_for_vue( true )\n format.html { render :new }\n end\n end\n end\n\n end", "def create\n @article = Article.new(article_params)\n respond_to do |format|\n if @article.save\n @article_unit = ArticlesUnit.create(article: @article,\n unit_id: params[:articles_units][:unit_id],\n value: params[:articles_units][:value])\n format.html { redirect_to @article, notice: \"L'Article a été créé avec succès.\" }\n format.json { render :show, status: :created, location: @article }\n else\n format.html { render :new }\n format.json { render json: @article.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @study_unit = StudyUnit.new(params[:study_unit])\n\n respond_to do |format|\n if @study_unit.save\n format.html { redirect_to @study_unit, notice: 'Study unit was successfully created.' }\n format.json { render json: @study_unit, status: :created, location: @study_unit }\n else\n format.html { render action: \"new\" }\n format.json { render json: @study_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @storage_unit = StorageUnit.new(storage_unit_params)\n\n respond_to do |format|\n if @storage_unit.save\n format.html { redirect_to @storage_unit, notice: 'Storage unit was successfully created.' }\n format.json { render :show, status: :created, location: @storage_unit }\n else\n format.html { render :new }\n format.json { render json: @storage_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def police_station_params\n params.require(:police_station).permit(:name, :tel, :location)\n end", "def units=(list)\n @units = makelist(list)\n end", "def create\n @workout_unit = WorkoutUnit.new(workout_unit_params)\n @workout_unit.user_id = current_user.id\n respond_to do |format|\n if @workout_unit.save\n format.html { redirect_to @workout_unit, notice: 'Workout unit was successfully created.' }\n format.json { \n render :json => @workout_unit.as_json(:include => :workout_unit_type), action: 'show', status: :created, location: @workout_unit \n }\n else\n format.html { render action: 'new' }\n format.json { render json: @workout_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_Units(value)\n set_input(\"Units\", value)\n end", "def set_Units(value)\n set_input(\"Units\", value)\n end", "def destroy\n @police_unit.destroy\n respond_to do |format|\n format.html { redirect_to police_units_url, notice: 'Police unit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def army_unit_params\n params.require(:army_unit).permit(:unit_id, :army_id)\n end", "def create\n @first_level_unit = FirstLevelUnit.new(first_level_unit_params)\n\n respond_to do |format|\n if @first_level_unit.save\n format.html { redirect_to admin_first_level_units_path, notice: 'First level unit was successfully created.' }\n format.json { render :show, status: :created, location: @first_level_unit }\n else\n format.html { render :new }\n format.json { render json: @first_level_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def quotation_unit_params\n params.require(:quotation_unit).permit(:quotation_unit_name)\n end", "def base_unit_params\n params.require(:base_unit).permit(:name, :base_width, :base_length)\n end", "def unit_category_params\n params.require(:unit_category).permit(:name, :counterparty_id, :tax_id)\n end", "def dataunit_params\n params.require(:dataunit).permit(:geoValue, :dataValue, :dataset_id, :user_id)\n end", "def create\n @rented_unit = appointment.rented_units.new(rented_unit_params)\n\n respond_to do |format|\n if @rented_unit.save\n format.html { redirect_to [building, listing, appointment, @rented_unit], notice: 'Rented unit was successfully created.' }\n format.json { render :show, status: :created, location: @rented_unit }\n else\n format.html { render :new }\n format.json { render json: @rented_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @unit_of_measure = UnitOfMeasure.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unit_of_measure }\n end\n end", "def create\n @currentunit = Currentunit.new(currentunit_params)\n\n respond_to do |format|\n if @currentunit.save\n format.html { redirect_to @currentunit, notice: 'Currentunit was successfully created.' }\n format.json { render :show, status: :created, location: @currentunit }\n else\n format.html { render :new }\n format.json { render json: @currentunit.errors, status: :unprocessable_entity }\n end\n end\n end", "def unit_params\n #params.require(:unit).permit(:name, :email, :cname)\n params.permit(:id, :name, :email, :cname)\n end", "def update\n @unit = Unit.find(params[:id])\n\n if @unit.update(unit_params)\n render :create, status: :ok\n else\n render json: {errors: @unit.errors}, status: :unprocessable_entity\n end\n end", "def create\n @unit = Unit.new(unit_params)\n @unit.organization = current_organization\n respond_to do |format|\n if @unit.save\n format.html { redirect_to units_url, notice: \"#{t(:unit)} #{t(:was_succfully_created)}\" }\n else\n flash.now[:danger] = \"#{t(:failed_to_create)} #{t(:unit)}\"\n format.html { render action: 'new' }\n end\n end\n end", "def new\n @extent_unit = ExtentUnit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @extent_unit }\n end\n end", "def create\n @unit_product = UnitProduct.new(unit_product_params)\n\n respond_to do |format|\n if @unit_product.save\n format.html { redirect_to @unit_product, notice: \"Unit product was successfully created.\" }\n format.json { render :show, status: :created, location: @unit_product }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @unit_product.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.68024886", "0.6286745", "0.61887956", "0.61375326", "0.6131262", "0.6131262", "0.6064084", "0.6011934", "0.599415", "0.5967944", "0.5943915", "0.59236676", "0.5913525", "0.59119546", "0.59108055", "0.5897829", "0.5892359", "0.5868904", "0.5855435", "0.5854826", "0.5852203", "0.58486164", "0.5848065", "0.5831348", "0.5829464", "0.58279705", "0.58208454", "0.5809349", "0.5805871", "0.57983094", "0.578053", "0.5774499", "0.5764448", "0.5748585", "0.5735091", "0.5718531", "0.56672406", "0.5662207", "0.5656062", "0.5650305", "0.5642781", "0.56312484", "0.5626961", "0.5615424", "0.5609645", "0.5605038", "0.5588269", "0.55818844", "0.5570638", "0.55683637", "0.5564844", "0.556417", "0.5557475", "0.5553068", "0.55476105", "0.55264664", "0.5525033", "0.5514664", "0.5510673", "0.55063516", "0.550099", "0.54996705", "0.549581", "0.549581", "0.549581", "0.5479875", "0.5475019", "0.54548323", "0.54530364", "0.54485995", "0.5448086", "0.5431842", "0.5418117", "0.53968865", "0.53920144", "0.53802794", "0.5377817", "0.5362344", "0.5351476", "0.5349136", "0.5348293", "0.5348097", "0.5348019", "0.5338154", "0.5338154", "0.53368115", "0.5330748", "0.53239137", "0.5310993", "0.53041995", "0.5292261", "0.52904934", "0.5288293", "0.52855766", "0.52852994", "0.52816474", "0.52792346", "0.5276515", "0.5275205", "0.5273669" ]
0.70055985
0
PATCH/PUT /police_units/1 PATCH/PUT /police_units/1.json
def update respond_to do |format| if @police_unit.update(police_unit_params) format.html { redirect_to @police_unit, notice: 'Police unit was successfully updated.' } format.json { render :show, status: :ok, location: @police_unit } else format.html { render :edit } format.json { render json: @police_unit.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n params.require(%i[id units])\n retrieve_and_validate_put.update!(units: params[:units])\n head :no_content\n end", "def update\n url = 'https://casa-core.herokuapp.com/api/units/' + params[:id]\n query = {\n 'name' => params[:name]\n }\n response = HTTParty.put(url, :query => query, :headers => { \"Authorization\" => AUTH, \"Host\" => HOST})\n\n if response.code == 200\n redirect_to unit_path(params[:id]), notice: 'Unit was successfully updated.'\n else\n redirect_to unit_path(params[:id]), notice: 'Sheesh! Minor hiccup...run that again!'\n end\n end", "def update\n @jobtype = Jobtype.find(params[:id])\n\n if @jobtype.update_attributes(params[:unit])\n render_json \"success\"\n else\n render_error \"failure\"\n end\n end", "def update\n respond_to do |format|\n if @unit.update(unit_params)\n format.html { redirect_to @unit, notice: 'Unit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @unit.update(unit_params)\n format.html { redirect_to @unit, notice: 'Unit was successfully updated.' }\n format.json { render :show, status: :ok, location: @unit }\n else\n format.html { render :edit }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @unit = Unit.find(params[:id])\n \n if params[:unit].andand[:note].present? && (@unit.note.blank? || (@unit.note != params[:unit][:note]))\n @unit.note_updated_by = current_person\n @unit.note_updated_at = Time.now\n end\n\n respond_to do |format|\n if @unit.update_attributes(params[:unit])\n format.html { redirect_to @unit, notice: 'Unit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @unit = Unit.find(params[:id])\n\n if @unit.update(unit_params)\n render :create, status: :ok\n else\n render json: {errors: @unit.errors}, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @pol.update(pol_params)\n format.json { render :show, status: :ok, location: @pol }\n else\n format.json { render json: @pol.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @extent_unit = ExtentUnit.find(params[:id])\n\n respond_to do |format|\n if @extent_unit.update_attributes(params[:extent_unit])\n format.html { redirect_to @extent_unit, notice: 'Extent unit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @extent_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @base_unit.update(base_unit_params)\n format.html { redirect_to @base_unit, notice: 'Tray type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @base_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @electoral_unit = ElectoralUnit.find(params[:id])\n\n respond_to do |format|\n if @electoral_unit.update_attributes(params[:electoral_unit])\n format.html { redirect_to @electoral_unit, notice: 'Electoral unit was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @electoral_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @retail_unit = RetailUnit.find(params[:id])\n\n respond_to do |format|\n if @retail_unit.update_attributes(params[:retail_unit])\n format.html { redirect_to @retail_unit, notice: 'Retail unit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @retail_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @unit_of_measure = UnitOfMeasure.find(params[:id])\n\n respond_to do |format|\n if @unit_of_measure.update_attributes(params[:unit_of_measure])\n format.html { redirect_to @unit_of_measure, notice: t(:unit_of_measure_updated) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @unit_of_measure.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_single_poll(id,polls__question__,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n :polls__question__,\n :polls__description__,\n \n ]\n\n # verify existence of params\n raise \"id is required\" if id.nil?\n raise \"polls__question__ is required\" if polls__question__.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :id => id,\n :polls__question__ => polls__question__\n )\n\n # resource path\n path = path_replace(\"/v1/polls/{id}\",\n :id => id)\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(:put, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:put, path, query_params, form_params, headers)\n page_params_store(:put, path)\n response\n \n end", "def update\n respond_to do |format|\n if @unit.update(unit_params)\n format.html { redirect_to new_food_path, notice: 'Unit was successfully updated.' }\n format.json { head :no_content }\n else\n flash[:error] = \"Unit can't be an empty string.\"\n format.html { redirect_to new_food_path }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @unit_name.update(unit_name_params)\n format.html { redirect_to @unit_name, notice: 'Unit name was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @unit_name.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @standard_unit.update(standard_unit_params)\n render :show, status: :ok, location: @standard_unit\n else\n render json: @standard_unit.errors, status: :unprocessable_entity\n end\n end", "def update\n @item_unit = ItemUnit.find(params[:id])\n\n respond_to do |format|\n if @item_unit.update_attributes(params[:item_unit])\n format.html { redirect_to @item_unit, notice: 'Item unit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @currentunit.update(currentunit_params)\n format.html { redirect_to @currentunit, notice: 'Currentunit was successfully updated.' }\n format.json { render :show, status: :ok, location: @currentunit }\n else\n format.html { render :edit }\n format.json { render json: @currentunit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @unit.update(unit_params)\n format.html { redirect_to @unit, notice: '修改成功!.' }\n format.json { render :show, status: :ok, location: @unit }\n else\n format.html { render :edit }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @first_level_unit.update(first_level_unit_params)\n format.html { redirect_to admin_first_level_units_path, notice: 'First level unit was successfully updated.' }\n format.json { render :show, status: :ok, location: @first_level_unit }\n else\n format.html { render :edit }\n format.json { render json: @first_level_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @recipe_ingredients_unit.update(recipe_ingredients_unit_params)\n format.html { redirect_to recipe_ingredients_units_path, notice: 'Recipe ingredients unit was successfully updated.' }\n format.json { render :show, status: :ok, location: @recipe_ingredients_unit }\n else\n format.html { render :edit }\n format.json { render json: @recipe_ingredients_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @unit.update(unit_params)\n format.html { redirect_to @unit, notice: 'Unit was successfully update@datasheet.' }\n format.json { render :show, status: :ok, location: @unit }\n else\n format.html { render :edit }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @unit_measure.update(unit_measure_params)\n format.html { redirect_to @unit_measure, notice: 'Unit measure was successfully updated.' }\n format.json { render :show, status: :ok, location: @unit_measure }\n else\n format.html { render :edit }\n format.json { render json: @unit_measure.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @unit = Unit.find(params[:id])\n\n respond_to do |format|\n if @unit.update_attributes(params[:unit])\n # format.html { redirect_to @unit, notice: 'Unit was successfully updated.' }\n format.html { redirect_to units_path, notice: 'Pomyślnie zaktualizowano jednostkę.' }\n format.json { head :no_content }\n else\n # format.html { render action: \"edit\" }\n format.html { redirect_to units_path, :flash => { :error => 'Nie udało się zaktualizować jednostki' } }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @unit = Unit.find(params[:id])\n\n respond_to do |format|\n if @unit.update_attributes(params[:unit])\n if params[:commit] == \"Save\"\n format.html { redirect_to @unit, notice: '<div class=\"alert alert-success\">Unit was successfully updated.</div>' }\n else\n @unit.toggle(current_user)\n format.html {\n redirect_to @unit, notice: \"<div class='alert alert-success'>Unit was successfully #{@unit.status_label}</div>\"\n }\n format.json { head :no_content }\n end\n else\n format.html { render action: \"edit\" }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_police_unit\n @police_unit = PoliceUnit.find(params[:id])\n end", "def update\n @contract = Contract.find(params[:id])\n @units = Unit.unsold(params[:tower_id])\n respond_to do |format|\n if @contract.update_attributes(params[:contract])\n format.html { redirect_to tower_contract_path(@contract.unit.tower, @contract), notice: 'Contract was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @contract.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @lot = Lot.find(params[:id])\n\n respond_to do |format|\n if @lot.update_attributes(params[:lot])\n format.html { redirect_to myadmin_lots_path, :notice => 'Lot was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @lot.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @unit = Unit.find(params[:id])\n @item = Item.find(@unit.item_id)\n respond_to do |format|\n if @unit.update_attributes(params[:unit])\n format.html { redirect_to @item, notice: 'Unit was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @unit_fuel.update(unit_fuel_params)\n format.html { redirect_to @unit_fuel, notice: (t 'unit_fuels.title')+(t 'actions.updated') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @unit_fuel.errors, status: :unprocessable_entity }\n end\n end\n end", "def UpdateTicket params = {}\n \n APICall(path: 'tickets.json',method: 'PUT',payload: params.to_json)\n \n end", "def update\n respond_to do |format|\n if @army_unit.update(army_unit_params)\n format.html { redirect_to @army_unit, notice: 'Army unit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @army_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @programme_unit.update(programme_unit_params)\n format.html { redirect_to @programme_unit, notice: 'Programme unit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @programme_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update # PATCH\n raise NotImplementedError\n end", "def update\n respond_to do |format|\n if @org_unit.update(org_unit_params)\n format.html { redirect_to @org_unit, notice: 'Org unit was successfully updated.' }\n format.json { render :show, status: :ok, location: @org_unit }\n else\n format.html { render :edit }\n format.json { render json: @org_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @commercial_unit.update(commercial_unit_params)\n format.html { redirect_to @commercial_unit, notice: 'Commercial unit was successfully updated.' }\n format.json { render :show, status: :ok, location: @commercial_unit }\n else\n format.html { render :edit }\n format.json { render json: @commercial_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @workout_unit.update(workout_unit_params)\n format.html { redirect_to @workout_unit, notice: 'Workout unit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @workout_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n p = trial_params.clone\n if p[\"question_ids\"].nil?\n p[\"question_ids\"] = []\n end\n\n respond_to do |format|\n if @trial.update(p)\n format.html { redirect_to @trial, notice: 'Trial was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trial.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @police_station.update(police_station_params)\n format.html { redirect_to @police_station, notice: 'Police station was successfully updated.' }\n format.json { render :show, status: :ok, location: @police_station }\n else\n format.html { render :edit }\n format.json { render json: @police_station.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @platoon.update(platoon_params)\n format.html { redirect_to @platoon, notice: 'Platoon was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @platoon.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @unit_of_measure = UnitOfMeasure.find(params[:id])\n @unit_of_measure.update_attributes(params[:unit_of_measure])\n get_data\n end", "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end", "def update\n respond_to do |format|\n # {:name => poll_params[:name]}\n if @poll.update(poll_params)\n format.html { redirect_to admin_path(@poll), notice: 'Poll was successfully updated.' }\n format.json { render :show, status: :ok, location: admin_path(@poll) }\n else\n format.html { render :edit }\n format.json { render json: @poll.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @quotation_unit.update(quotation_unit_params)\n format.html { redirect_to @quotation_unit, notice: 'Quotation unit was successfully updated.' }\n format.json { render :show, status: :ok, location: @quotation_unit }\n else\n format.html { render :edit }\n format.json { render json: @quotation_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @cat_poly.update(cat_poly_params)\n format.html { redirect_to @cat_poly, notice: 'Cat poly was successfully updated.' }\n format.json { render :show, status: :ok, location: @cat_poly }\n else\n format.html { render :edit }\n format.json { render json: @cat_poly.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @study_unit = StudyUnit.find(params[:id])\n\n respond_to do |format|\n if @study_unit.update_attributes(params[:study_unit])\n format.html { redirect_to @study_unit, notice: 'Study unit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @study_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @subset.update(subset_params)\n format.html { redirect_to @subset, notice: 'Subset was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @subset.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @timeunit = Timeunit.find(params[:id])\n\n respond_to do |format|\n if @timeunit.update_attributes(params[:timeunit])\n format.html { redirect_to(@timeunit, :notice => 'Timeunit was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @timeunit.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @floor = Floor.find(params[:id])\n params[:floor][:location_id] = params[:floor][:loc_id]\n params[:floor].delete :loc_id\n respond_to do |format|\n if @floor.update_attributes(params[:floor])\n format.html { redirect_to floors_path, notice: 'Floor was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @floor.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @politician.update(politician_params)\n format.html { redirect_to @politician, notice: 'Politician was successfully updated.' }\n format.json { render :show, status: :ok, location: @politician }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @politician.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @barangay_political.update(barangay_political_params)\n format.html { redirect_to @barangay_political, notice: 'Barangay political was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @barangay_political.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @info_polen = InfoPolen.find(params[:id])\n\n respond_to do |format|\n if @info_polen.update_attributes(params[:info_polen])\n format.html { redirect_to @info_polen, notice: 'Info polen was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @info_polen.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @info_polen = InfoPolen.find(params[:id])\n\n respond_to do |format|\n if @info_polen.update_attributes(params[:info_polen])\n format.html { redirect_to @info_polen, notice: 'Info polen was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @info_polen.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @politicalcommittee = Politicalcommittee.find(params[:id])\n\n respond_to do |format|\n if @politicalcommittee.update_attributes(params[:politicalcommittee])\n format.html { redirect_to @politicalcommittee, notice: 'Politicalcommittee was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @politicalcommittee.errors, status: :unprocessable_entity }\n end\n end\n end", "def UpdateField params = {}\n \n APICall(path: 'ticket_fields.json',method: 'PUT',payload: params.to_json)\n \n end", "def update\n respond_to do |format|\n if @unlimited.update(unlimited_params)\n format.html { redirect_to @unlimited, notice: 'Unlimited was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @unlimited.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @special_requirement.update(special_requirement_params)\n format.html { redirect_to @special_requirement, notice: 'Special requirement was successfully updated.' }\n format.json { render :show, status: :ok, location: @special_requirement }\n else\n format.html { render :edit }\n format.json { render json: @special_requirement.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\n @laboratory = Laboratory.find(params[:id])\n\n if @laboratory.update!(laboratory_params)\n render json: @laboratory\n else \n render json: @laboratory.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @lunch.update(lunch_params)\n format.html { redirect_to @lunch, notice: 'Lunch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @lunch.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @plato = Plato.find(params[:id])\n\n if @plato.update(plato_params)\n head :no_content\n else\n render json: @plato.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @rent_unit.update(rent_unit_params)\n format.html { redirect_to @rent_unit, notice: 'Rent unit was successfully updated.' }\n format.json { render :show, status: :ok, location: @rent_unit }\n else\n format.html { render :edit }\n format.json { render json: @rent_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_rest\n @question_localized = QuestionLocalized.find(params[:id])\n\n respond_to do |format|\n if @question_localized.update_attributes(params[:question_localized])\n flash[:notice] = 'QuestionLocalized was successfully updated.'\n format.html { redirect_to(@question_localized) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @question_localized.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @poll_options_set = PollOptionsSet.find(params[:id])\n\n respond_to do |format|\n if @poll_options_set.update_attributes(params[:poll_options_set])\n format.html { redirect_to @poll_options_set, notice: 'Poll options set was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @poll_options_set.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @quantity_unit = QuantityUnit.find(params[:id])\n\n respond_to do |format|\n if @quantity_unit.update_attributes(params[:quantity_unit])\n flash[:notice] = 'QuantityUnit was successfully updated.'\n format.html { redirect_to(@quantity_unit) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @quantity_unit.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @political_party.update(political_party_params)\n format.html { redirect_to @political_party, notice: 'Political party was successfully updated.' }\n format.json { render :show, status: :ok, location: @political_party }\n else\n format.html { render :edit }\n format.json { render json: @political_party.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @api_v1_exercise.update(api_v1_exercise_params)\n format.html { redirect_to @api_v1_exercise, notice: 'Exercise was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_exercise }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_exercise.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @user_hour_requirement = UserHourRequirement.find(params[:id])\n\n respond_to do |format|\n if @user_hour_requirement.update_attributes(params[:user_hour_requirement])\n format.html { redirect_to @user_hour_requirement, :notice => 'User hour requirement was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @user_hour_requirement.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @dataunit.update(dataunit_params)\n format.html { redirect_to @dataunit, notice: 'Dataunit was successfully updated.' }\n format.json { render :show, status: :ok, location: @dataunit }\n else\n format.html { render :edit }\n format.json { render json: @dataunit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @storage_unit.update(storage_unit_params)\n format.html { redirect_to @storage_unit, notice: 'Storage unit was successfully updated.' }\n format.json { render :show, status: :ok, location: @storage_unit }\n else\n format.html { render :edit }\n format.json { render json: @storage_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @teaching_unit.update(teaching_unit_params)\n format.html { redirect_to @teaching_unit, notice: 'Teaching unit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @teaching_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n # @person = Person.find(params[:id])\n # @person.pct_complete = @person.requirement_progress\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, :notice => 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "def police_unit_params\n params.require(:police_unit).permit(:name)\n end", "def update(&block)\n validate_request()\n\n # Params includes all of the PATCH data at the top level along with other\n # other Rails-injected params like 'id', 'action', 'controller'. These\n # are harmless given no namespace collision and we're only interested in\n # the 'Operations' key for the actual patch data.\n #\n render(json: yield(self.safe_params()[:id], self.safe_params().to_hash()))\n end", "def update\n respond_to do |format|\n if @non_political_expenditure.update(non_political_expenditure_params)\n format.html { redirect_to @non_political_expenditure, notice: 'Non political expenditure was successfully updated.' }\n format.json { render :show, status: :ok, location: @non_political_expenditure }\n else\n format.html { render :edit }\n format.json { render json: @non_political_expenditure.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n render json: Location.update(params[\"id\"], params[\"location\"])\n end", "def update\n respond_to do |format|\n if @floor_plan.update(floor_plan_params)\n format.html { redirect_to location_path(@location), notice: 'Floor plan was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @floor_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @capitol.update(capitol_params)\n format.html { redirect_to root_path, notice: 'Capitol was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @capitol.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @police_station.update(police_station_params)\n format.html { redirect_to @police_station, notice: \"Comisaría actualizada con éxito\" }\n format.json { render :show, status: :ok, location: @police_station }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @police_station.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n \n if @poll.update(poll_params)\n format.html { redirect_to polls_url, notice: 'Poll was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render 'edit' }\n format.json { render json: @poll.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @politeness = args[:politeness] if args.key?(:politeness)\n end", "def update\n @poll = Poll.find(params[:id])\n\n respond_to do |format|\n if @poll.update_attributes(params[:poll])\n format.html { redirect_to @poll, notice: 'Poll was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @poll.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @poll = Poll.find(params[:id])\n\n respond_to do |format|\n if @poll.update_attributes(params[:poll])\n format.html { redirect_to @poll, notice: 'Poll was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @poll.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @rented_unit.update(rented_unit_params)\n format.html { redirect_to [building, listing, appointment, @rented_unit], notice: 'Rented unit was successfully updated.' }\n format.json { render :show, status: :ok, location: @rented_unit }\n else\n format.html { render :edit }\n format.json { render json: @rented_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @measurement.update(correct_parameters_for_mongo)\n format.html { redirect_to @measurement, notice: \"Measurement was successfully updated.\" }\n format.json { render :show, status: :ok, location: @measurement }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @measurement.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @base_unit = args[:base_unit] if args.key?(:base_unit)\n @base_unit_conversion_factor = args[:base_unit_conversion_factor] if args.key?(:base_unit_conversion_factor)\n @base_unit_description = args[:base_unit_description] if args.key?(:base_unit_description)\n @display_quantity = args[:display_quantity] if args.key?(:display_quantity)\n @tiered_rates = args[:tiered_rates] if args.key?(:tiered_rates)\n @usage_unit = args[:usage_unit] if args.key?(:usage_unit)\n @usage_unit_description = args[:usage_unit_description] if args.key?(:usage_unit_description)\n end", "def update\n respond_to do |format|\n if @operation.update(operation_params)\n format.html { redirect_to @operation, notice: 'Operation was successfully updated.' }\n format.json { render :json => @operation.to_json(:include => :task) }\n else\n format.html { render json: @operation.errors, status: :unprocessable_entity }\n format.json { render json: @operation.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @opt10075.update(opt10075_params)\n format.html { redirect_to @opt10075, notice: 'Opt10075 was successfully updated.' }\n format.json { render :show, status: :ok, location: @opt10075 }\n else\n format.html { render :edit }\n format.json { render json: @opt10075.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @my_time_trial = MyTimeTrial.find(params[:id])\n\n respond_to do |format|\n if @my_time_trial.update_attributes(params[:my_time_trial])\n format.html { redirect_to @my_time_trial, :notice => 'My time trial was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @my_time_trial.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @timing = Timing.find(params[:id])\n if @timing.update_attributes(params[:timing].slice(:start, :stop, :days, :active))\n render json: @timing\n else\n render json: { error: 'error: could not update timing' }\n end\n end", "def update\n respond_to do |format|\n if @commecial_unit.update(commecial_unit_params)\n format.html { redirect_to @commecial_unit, notice: 'Commecial unit was successfully updated.' }\n format.json { render :show, status: :ok, location: @commecial_unit }\n else\n format.html { render :edit }\n format.json { render json: @commecial_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @pitch.update(pitch_params)\n api_success\n else\n api_fail @pitch.errors, :unprocessable_entity\n end\n end", "def update\n @quantity = Quantity.find(params[:id])\n\n respond_to do |format|\n if @quantity.update_attributes(params[:quantity])\n format.html { redirect_to @quantity, notice: 'Quantity was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @quantity.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @quantity = Quantity.find(params[:id])\n\n respond_to do |format|\n if @quantity.update_attributes(params[:quantity])\n format.html { redirect_to @quantity, notice: 'Quantity was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @quantity.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @pilot.update(pilot_params)\n format.html { redirect_to @pilot, notice: 'Pilot was successfully updated.' }\n format.json { render :show, status: :ok, location: @pilot }\n else\n format.html { render :edit }\n format.json { render json: @pilot.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @pilot.update(pilot_params)\n format.html { redirect_to @pilot, notice: 'Pilot was successfully updated.' }\n format.json { render :show, status: :ok, location: @pilot }\n else\n format.html { render :edit }\n format.json { render json: @pilot.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def update\n @pot = Pot.find(params[:id])\n\n respond_to do |format|\n if @pot.update_attributes(params[:pot])\n format.html { redirect_to @pot, notice: 'Pot was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pot.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @specie = Specie.find(params[:id])\n\n respond_to do |format|\n if @specie.update_attributes(params[:specie])\n format.html { redirect_to @specie, notice: 'Specie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @specie.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @running_measurement.update(running_measurement_params)\n format.html { redirect_to @running_measurement, notice: 'Running measurement was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @running_measurement.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.725439", "0.66535574", "0.64343554", "0.64299977", "0.63783497", "0.6377676", "0.6337713", "0.63096845", "0.62711847", "0.62492824", "0.61797994", "0.6176337", "0.6156407", "0.6142014", "0.61223763", "0.6110088", "0.61057603", "0.60966545", "0.6091156", "0.60808694", "0.6072894", "0.6050967", "0.6026533", "0.60235095", "0.60214156", "0.6018599", "0.60138714", "0.5995993", "0.5971713", "0.59428704", "0.59358716", "0.59300095", "0.59246784", "0.59204584", "0.59169054", "0.5915264", "0.5903454", "0.5898388", "0.58918643", "0.58756846", "0.5865038", "0.5858834", "0.58533835", "0.5844661", "0.5842951", "0.5839551", "0.5838907", "0.58292645", "0.58219355", "0.58214545", "0.5820626", "0.5817787", "0.5817161", "0.5817161", "0.58118755", "0.5802199", "0.5793999", "0.57806206", "0.57776326", "0.57718366", "0.5771266", "0.57700664", "0.57686186", "0.5768438", "0.5763677", "0.57596225", "0.5758183", "0.57549524", "0.57460165", "0.57326496", "0.573216", "0.5731738", "0.5730595", "0.57280415", "0.57258004", "0.57206875", "0.57102984", "0.57076186", "0.56927776", "0.56926215", "0.5688333", "0.5687664", "0.5687664", "0.5685296", "0.5675868", "0.5674118", "0.5672822", "0.5672328", "0.5671793", "0.56710964", "0.5665403", "0.56632763", "0.566205", "0.566205", "0.5661247", "0.56611294", "0.56587833", "0.5656552", "0.56555486", "0.5649395" ]
0.7327537
0
DELETE /police_units/1 DELETE /police_units/1.json
def destroy @police_unit.destroy respond_to do |format| format.html { redirect_to police_units_url, notice: 'Police unit was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n url = 'https://casa-core.herokuapp.com/api/units/' + params[:id]\n response = HTTParty.delete(url, :headers => { \"Authorization\" => AUTH, \"Host\" => HOST})\n redirect_to units_url, notice: 'Unit was successfully deleted.'\n end", "def destroy\n @base_unit.destroy\n respond_to do |format|\n format.html { redirect_to base_units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @unit.destroy\n respond_to do |format|\n format.html { redirect_to units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @retail_unit = RetailUnit.find(params[:id])\n @retail_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to retail_units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @unit = Unit.find(params[:id])\n @unit.destroy\n\n respond_to do |format|\n format.html { redirect_to units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @unit = Unit.find(params[:id])\n @unit.destroy\n\n respond_to do |format|\n format.html { redirect_to units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @unit = Unit.find(params[:id])\n @unit.destroy\n\n respond_to do |format|\n format.html { redirect_to units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @unit = Unit.find(params[:id])\n @unit.destroy\n\n respond_to do |format|\n format.html { redirect_to units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @unit = Unit.find(params[:id])\n @unit.destroy\n\n respond_to do |format|\n format.html { redirect_to units_url }\n format.json { head :ok }\n end\n end", "def destroy\n @extent_unit = ExtentUnit.find(params[:id])\n @extent_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to extent_units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @electoral_unit = ElectoralUnit.find(params[:id])\n @electoral_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to electoral_units_url }\n format.json { head :ok }\n end\n end", "def destroy\n @first_level_unit.destroy\n respond_to do |format|\n format.html { redirect_to first_level_units_url, notice: 'First level unit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @unit = @lab_rack.units.find(params[:id])\n @unit.destroy\n \n redirect_to @lab_rack, :notice => \"Unit has been deleted\"\n end", "def destroy\n @item_unit = ItemUnit.find(params[:id])\n @item_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to item_units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @unit_name.destroy\n respond_to do |format|\n format.html { redirect_to unit_names_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @pol.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n if @unit.destroy\n head :no_content\n else\n render json: {errors: @unit.errors}, status: :unprocessable_entity\n end\n end", "def destroy\n @unit.destroy\n respond_to do |format|\n format.html { redirect_to new_food_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @unit.destroy\n respond_to do |format|\n format.html { redirect_to units_url, notice: 'Unit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @unit.destroy\n respond_to do |format|\n format.html { redirect_to units_url, notice: 'Unit was successfully destroye@datasheet.' }\n format.json { head :no_content }\n end\n end", "def api_remove\n data_hash = make_hash\n delete_hash = { division: data_hash[:division][:value] }\n handler.remove(delete_hash, path, subscriber_id)\n end", "def destroy\n @army_unit.destroy\n respond_to do |format|\n format.html { redirect_to army_units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @study_unit = StudyUnit.find(params[:id])\n @study_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to study_units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n if @unit.blank?\n render json: {error: \"Can't delete unit\"}, status: :unprocessable_entity\n else\n @unit.destroy\n render json: {notice: \"Deleted!\"}, :status => 204\n end\n\n end", "def destroy\n @unit_of_measure.destroy\n respond_to do |format|\n format.html { redirect_to unit_of_measures_url, notice: 'Unit of measure was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_course_template(org_unit_id)\n path = \"/d2l/api/lp/#{$lp_ver}/coursetemplates/#{org_unit_id}\"\n _delete(path)\n puts '[+] Course template data deleted successfully'.green\nend", "def destroy\n @unit.destroy\n respond_to do |format|\n format.html { redirect_to units_url, notice: '删除成功!' }\n format.json { head :no_content }\n end\n end", "def destroy\n @unit_measure.destroy\n respond_to do |format|\n format.html { redirect_to unit_measures_url, notice: 'Unit measure was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @floor_plan.destroy\n respond_to do |format|\n format.html { redirect_to location_path(@location) }\n format.json { head :no_content }\n end\n end", "def destroy\n @timeunit = Timeunit.find(params[:id])\n @timeunit.destroy\n\n respond_to do |format|\n format.html { redirect_to(timeunits_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @unit_fuel.destroy\n respond_to do |format|\n format.html { redirect_to unit_fuels_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @log_unit = LogUnit.find(params[:id])\n @log_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to log_units_url }\n format.json { head :no_content }\n end\n end", "def delete_course_by_id(org_unit_id)\n path = \"/d2l/api/lp/#{$lp_ver}/courses/#{org_unit_id}\" # setup user path\n # ap path\n _delete(path)\n puts '[+] Course data deleted successfully'.green\nend", "def destroy\n @dataunit.destroy\n respond_to do |format|\n format.html { redirect_to dataunits_url, notice: 'Dataunit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @building_id = @unit.building_id\n @unit.destroy\n respond_to do |format|\n format.html { redirect_to building_path(@building_id) }\n format.json { head :no_content }\n end\n end", "def destroy\n @teaching_unit.destroy\n respond_to do |format|\n format.html { redirect_to teaching_units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @clase_unit.destroy\n respond_to do |format|\n format.html { redirect_to clase_units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @standard_measurement = StandardMeasurement.find(params[:id])\n @standard_measurement.destroy\n\n respond_to do |format|\n format.html { redirect_to standard_measurements_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @exercise_plan = ExercisePlan.find(params[:id])\n @exercise_plan.destroy\n\n respond_to do |format|\n format.html { redirect_to exercise_plans_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @pupil_measurement.destroy\n respond_to do |format|\n format.html { redirect_to pupil_measurements_url, notice: \"Pupil measurement was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @quotation_unit.destroy\n respond_to do |format|\n format.html { redirect_to quotation_units_url, notice: 'Quotation unit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @storage_unit = StorageUnit.find(params[:id])\n @storage_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to(storage_units_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @police_station.destroy\n respond_to do |format|\n format.html { redirect_to police_stations_url, notice: \"Comisaría eliminada con éxito.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @programme_unit.destroy\n respond_to do |format|\n format.html { redirect_to programme_units_url }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def delete(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 @client.post({\n 'action' => 'del',\n 'object' => 'htpl',\n 'values' => name,\n }.to_json)\n end", "def destroy\n @lot = Lot.find(params[:id])\n @lot.destroy\n\n respond_to do |format|\n format.html { redirect_to myadmin_lots_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @storage_unit.destroy\n respond_to do |format|\n format.html { redirect_to storage_units_url, notice: 'Storage unit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @commecial_unit.destroy\n respond_to do |format|\n format.html { redirect_to commecial_units_url, notice: 'Commecial unit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @aliquotum = Aliquotum.find(params[:id])\n @aliquotum.destroy\n\n respond_to do |format|\n format.html { redirect_to aliquota_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @commercial_unit.destroy\n respond_to do |format|\n format.html { redirect_to commercial_units_url, notice: 'Commercial unit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @trial.destroy\n respond_to do |format|\n format.html { redirect_to trials_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @employing_unit = EmployingUnit.find(params[:id])\n @employing_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to employing_units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @police_station.destroy\n respond_to do |format|\n format.html { redirect_to police_stations_url, notice: 'Police station was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @recipe_ingredients_unit.destroy\n respond_to do |format|\n format.html { redirect_to recipe_ingredients_units_url, notice: 'Recipe ingredients unit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end", "def destroy\n @api_v1_exercise.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_exercises_url, notice: 'Exercise was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @barangay_political.destroy\n respond_to do |format|\n format.html { redirect_to barangay_politicals_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @currentunit.destroy\n respond_to do |format|\n format.html { redirect_to currentunits_url, notice: 'Currentunit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @k_measurement.destroy\n respond_to do |format|\n format.html { redirect_to k_measurements_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Alien.delete(params[\"id\"])\n end", "def destroy\n @unidade_metrica = UnidadeMetrica.find(params[:id])\n @unidade_metrica.destroy\n\n respond_to do |format|\n format.html { redirect_to unidade_metricas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @unit_of_measure = UnitOfMeasure.find(params[:id])\n @unit_of_measure.destroy\n get_data\n end", "def destroy\n @common_expense_subunit.destroy\n respond_to do |format|\n format.html { redirect_to common_expense_subunits_url, notice: 'Common expense subunit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @rent_unit.destroy\n respond_to do |format|\n format.html { redirect_to rent_units_url, notice: 'Rent unit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @quantity_unit = QuantityUnit.find(params[:id])\n @quantity_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to(quantity_units_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n authorize! :manage, Measurement\n \n @measurement.destroy\n respond_to do |format|\n format.html { redirect_to measurements_url, notice: 'Measurement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @my_time_trial = MyTimeTrial.find(params[:id])\n @my_time_trial.destroy\n\n respond_to do |format|\n format.html { redirect_to my_time_trials_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @running_measurement.destroy\n respond_to do |format|\n format.html { redirect_to running_measurements_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @city_measurement = CityMeasurement.find(params[:id])\n @city_measurement.destroy\n\n respond_to do |format|\n format.html { redirect_to city_measurements_url }\n format.json { head :ok }\n end\n end", "def destroy\n @unit.destroy\n respond_to do |format|\n format.html { redirect_to units_url, notice: \"#{t(:unit)} #{t(:was_successfully_deleted)}\" }\n end\n end", "def destroy\n @measurement.destroy\n respond_to do |format|\n format.html { redirect_to measurements_url, notice: 'Measurement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @measurement.destroy\n respond_to do |format|\n format.html { redirect_to measurements_url, notice: 'Measurement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @measurement.destroy\n respond_to do |format|\n format.html { redirect_to measurements_url, notice: 'Measurement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @measurement.destroy\n respond_to do |format|\n format.html { redirect_to measurements_url, notice: \"Measurement was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @unique_whiteline.destroy\n respond_to do |format|\n format.html { redirect_to unique_whitelines_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @unit_action.destroy\n respond_to do |format|\n format.html { redirect_to unit_actions_url, notice: 'Unit action was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @physical_unit = Probe::PhysicalUnit.find(params[:id])\n @physical_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to(physical_units_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @moresmalltrial = Moresmalltrial.find(params[:id])\n @moresmalltrial.destroy\n\n respond_to do |format|\n format.html { redirect_to moresmalltrials_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @floor = Floor.find(params[:id])\n @floor.destroy\n\n respond_to do |format|\n format.html { redirect_to floors_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @body_measurement.destroy\n respond_to do |format|\n format.html { redirect_to body_measurements_url }\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 @three60.destroy\n respond_to do |format|\n format.html { redirect_to edit_admin_good_url(@good, anchor: \"three60\") }\n format.json { head :no_content }\n end\n end", "def destroy\n @tenure = Tenure.find(params[:id])\n @tenure.destroy\n\n respond_to do |format|\n format.html { redirect_to tenures_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @account_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to account_units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @weather_measure.destroy\n respond_to do |format|\n format.html { redirect_to weather_measures_url, notice: 'Weather measure was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @ad_unit = AdUnit.find(params[:id])\n @ad_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to ad_units_url }\n format.json { head :ok }\n end\n end", "def destroy\n @org_unit.destroy\n respond_to do |format|\n format.html { redirect_to org_units_url, notice: 'Org unit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy_rest\n @item_usage = ItemUsage.find(params[:id])\n @item_usage.destroy\n\n respond_to do |format|\n format.html { redirect_to(item_usages_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @measurement = Measurement.find(params[:id])\n @measurement.destroy\n\n respond_to do |format|\n format.html { redirect_to body_measurements_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @info_polen = InfoPolen.find(params[:id])\n @info_polen.destroy\n\n respond_to do |format|\n format.html { redirect_to info_polens_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @info_polen = InfoPolen.find(params[:id])\n @info_polen.destroy\n\n respond_to do |format|\n format.html { redirect_to info_polens_url }\n format.json { head :no_content }\n end\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n @non_political_expenditure.destroy\n respond_to do |format|\n format.html { redirect_to non_political_expenditures_url, notice: 'Non political expenditure was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @medium_trial = MediumTrial.find(params[:id])\n @medium_trial.destroy\n\n respond_to do |format|\n format.html { redirect_to medium_trials_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @quatum.destroy\n respond_to do |format|\n format.html { redirect_to quata_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @dbh_measurement.destroy\n respond_to do |format|\n format.html { redirect_to dbh_measurements_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @portion = Portion.find(params[:id])\n @portion.destroy\n\n respond_to do |format|\n format.html { redirect_to portions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @floor.destroy\n respond_to do |format|\n format.html { redirect_to floors_url, notice: I18n.t('floors.destroy') }\n format.json { head :no_content }\n end\n end", "def destroy\n @patient_exercise = PatientExercise.find(params[:id])\n @patient_exercise.destroy\n\n respond_to do |format|\n format.html { redirect_to patient_exercises_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.7377552", "0.7196428", "0.7112594", "0.70558965", "0.70533097", "0.70533097", "0.70533097", "0.70533097", "0.7045154", "0.704073", "0.70177144", "0.6928192", "0.69131756", "0.6911436", "0.6890533", "0.68621445", "0.6824292", "0.68233156", "0.6813879", "0.6808456", "0.6801776", "0.6801728", "0.67887366", "0.6788106", "0.67585915", "0.6744141", "0.67403775", "0.67022216", "0.669747", "0.66828966", "0.6676511", "0.6668005", "0.66542864", "0.6635555", "0.6630394", "0.66189903", "0.6603127", "0.65904254", "0.65859485", "0.6579154", "0.6579033", "0.65736085", "0.65727615", "0.6572103", "0.6564385", "0.6558789", "0.65568817", "0.65471023", "0.65455145", "0.6541706", "0.65406865", "0.65386206", "0.65359706", "0.6532707", "0.6531899", "0.6529521", "0.6524662", "0.6521591", "0.6517724", "0.651378", "0.65080166", "0.650687", "0.6504789", "0.65033185", "0.6501867", "0.6496365", "0.64921474", "0.6486972", "0.64847887", "0.6480932", "0.64804924", "0.64777493", "0.64777493", "0.64777493", "0.6475713", "0.6473928", "0.6466955", "0.64639515", "0.6453269", "0.6450587", "0.6446976", "0.64457834", "0.6436757", "0.6432002", "0.6431795", "0.64293885", "0.6428416", "0.64272034", "0.6427159", "0.6413968", "0.64120364", "0.64120364", "0.64110357", "0.6410638", "0.6409775", "0.640965", "0.6409316", "0.64091486", "0.6405984", "0.6403753" ]
0.74588656
0
Use callbacks to share common setup or constraints between actions.
def set_police_unit @police_unit = PoliceUnit.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 police_unit_params params.require(:police_unit).permit(:name) 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
Must refactor this to make the test for just first or last name pass.
def full_name "#{first_name} #{last_name}" if first_name || last_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def first_name\n super || (name and name.split.first)\n end", "def full_name_first_last\n return self.first_name unless (self.last_name.length > 0)\n return (self.first_name + \" \" + self.last_name)\n end", "def full_name_last_first\n return self.first_name unless (self.last_name.length > 0)\n return (self.last_name + \", \" + self.first_name)\n end", "def get_first_and_last_name\n if first_name && last_name && !first_name.empty? && !last_name.empty?\n [first_name, last_name]\n elsif description.present?\n [\n description.split(' ')[0],\n description.split(' ')[1]\n ]\n else\n [name[0..4], ''] # Return just the first 5 char from the username, just to increase the chances\n end\n end", "def name\n if first_name.present? && last_name.present?\n first_name + \" \" + last_name\n elsif first_name.present? && last_name.blank?\n first_name\n elsif first_name.blank? && last_name.present?\n last_name\n else\n \"No Name\"\n end\n end", "def first_name_same_first_and_last_letter\n first_name[0] == first_name[-1]\n end", "def first_name_neutral; end", "def first_name_last_initial\n if name.split.count > 1\n first_name + ' ' + last_name[0].upcase + '.'\n else\n first_name\n end\n end", "def full_name\n if self.first_name.present? and self.last_name.present?\n \"#{self.first_name} #{self.last_name}\"\n else\n self.first_name\n end\n end", "def first_name_before_last\n first_name < last_name\n end", "def full_name\n if self.first_name && self.last_name \n self.first_name + \" \" + self.last_name \n else\n \"unknown\"\n end\n end", "def full_name\n\n return \"#{first_name} #{last_name}\".strip if (first_name || last_name)\n \"Anonymouse\"\n end", "def full_name\n if self.first_name && self.last_name\n \"#{self.first_name} #{self.last_name}\"\n elsif self.first_name.present?\n \"#{self.first_name}\"\n elsif self.last_name.present?\n \"#{self.last_name}\"\n else\n \"No Name\"\n end\n end", "def given\n first_name.given.try(:first) || first_name.text\n end", "def first_name\n self.name.blank? ? \"\" : self.name.split(\" \")[0]\n end", "def format_name(first, last)\n\n if (first == \"\" || last == \"\")\n nil\n else\n first_name = (first.gsub /\\s/, '')[0] + last\n first_name.downcase.gsub /\\s/, ''\n end\nend", "def first_name\n self.name.split[0] if self.name\n end", "def format_name(first, last)\n if first == \"\" || last == \"\"\n \tnil\n else \n \tfirst.gsub!(/[^A-Za-z]/, '')\n \tlast.gsub!(/[^A-Za-z]/, '')\n \tfirst = first.strip\n\tlast = last.split.join(\"\").strip\n\tuser_name = first[0] + last\n\tuser_name = user_name.downcase \n end\n user_name\nend", "def format_name(first, last)\n\tuser_name = \"\"\n\tif !first.empty? && !last.empty?\n\t \tuser_name = first.strip[0].downcase + last.strip.split.join('')\n\telse\n\t\treturn nil\n\tend\n\tuser_name.downcase\nend", "def fake_name (first_name, last_name)\n \"#{last_name} #{first_name}\"\nend", "def displayed_name\n first_name.present? || last_name.present? ? \"#{last_name}#{first_name.blank? ? '' : ', ' + first_name}\" : 'NAME NOT PROVIDED'\n end", "def validate_first_and_last_name\n error_message = \"\"\n error_message += \"First/Last Name should be Alphanumeric, hyphen or period only!\" if $IS_PARTNER_BAC &&\n !last_name.blank? && !first_name.blank? &&\n (last_name.match(/\\.{2}|\\-{2}|^[\\-\\.]+$/) ||\n !last_name.match(/^[A-Za-z0-9\\-\\.]*$/)) &&\n (first_name.match(/\\.{2}|\\-{2}|^[\\-\\.]+$/) ||\n !first_name.match(/^[A-Za-z0-9\\-\\.]*$/))\n\n error_message += \"First/Last Name should be Alphanumeric, hyphen, space or period only!\" if !$IS_PARTNER_BAC &&\n facility.details[:patient_name_format_validation] &&\n !last_name.blank? && !first_name.blank? &&\n (last_name.match(/\\.{2}|\\-{2}|\\s{2}|^[\\-\\.\\s]+$/) ||\n !last_name.match(/^[A-Za-z0-9\\-\\s\\.]*$/)) &&\n (first_name.match(/\\.{2}|\\-{2}|\\s{2}|^[\\-\\.\\s]+$/) ||\n !first_name.match(/^[A-Za-z0-9\\-\\s\\.]*$/))\n \n errors.add(:base, error_message) unless error_message == \"\"\n end", "def full_name\n if (first_name && last_name) && (!first_name.blank? && !last_name.blank?)\n \" #{first_name} #{last_name}\"\n else\n \" #{nickname}\"\n end\n end", "def full_name\n middle_name ? first_name + \" \" + middle_name + \" \" + last_name : first_name + \" \" + last_name\n end", "def first_name\n @first_name ||= @data[:givenname].last\n end", "def neutral_first_name; end", "def full_name\n \tif self.first_name != nil and self.last_name != nil\n \t\tself.first_name + \" \" + self.last_name\n \telse\n \t\t\"User does not have a full name\"\n \tend\n end", "def format_name(first, last)\n\n if first.length == 0\n p nil\n elsif last.length == 0\n p nil\n else\n # this will remove all empty spaces\n first_name = first.gsub(/[^A-Za-z]/,\"\")\n last_name = last.gsub(/[^A-Za-z]/, \"\")\n # this will get the first letter in first name\n first_inlast = first_name[0]\n # this will return the first letter of the name + the last name\n full_name = first_inlast + last_name\n # this will return the full name lowercased along with deleting white spaces\n lowercase_name = full_name.downcase\n # remove_allcharacters = full_name.gsub(/[^a-zA-Z0-9\\-]/,\"\")\n p lowercase_name\n end\nend", "def full_name(first, last)\n\tfirst + \" \" + last\nend", "def has_same_name?(first, last)\n is_same_word(first,self.firstname) and is_same_word(last, self.lastname)\n end", "def test_full_name\n\t\tassert_equal \"David Rosillo\", @user.full_name\n\tend", "def firstname; preferred_name; end", "def first_last\r\n firstname + (nickname && (nickname.size > 0) ? \" (#{nickname}) \" : \" \") + lastname\r\n end", "def name?\n first_name? || last_name?\n end", "def proper_name #returns lastname, firstname\n \treturn self.last_name + ', ' + self.first\n end", "def first_name\n # self.name.split[0] atau\n \tself.name.split.first\n end", "def full_name\n if (forename != '' && surname != '')\n forename+' '+surname\n elsif (forename != '')\n forename\n elsif (email != '')\n email\n end\n end", "def full_name\n if !first_name && !last_name\n return \"New User\"\n else\n return first_name + \" \" + last_name\n end\n end", "def proper_name\n \tfirst_name + \" \" + last_name\n end", "def full_name(first_name, last_name, title)\n\n # Example comment line\n\n # name is not defined yet and left as blank\n name = nil\n\n #'AND'logic is used here. if a title and first name and last name are given then return in that order with a space between text\n if title && first_name && last_name\n name = title + \" \" + first_name + \" \" + last_name\n #otherwise look for the given title and given last name and return in that order with space \n elsif title && last_name\n name = title + \" \" + last_name\n #otherwise look for the given first name and given last name and return in that order with space \n elsif first_name && last_name\n name = first_name + \" \" + last_name\n #otherwise look for only first name given and return only first name\n elsif first_name\n name = first_name\n #otherwise lastly if all previous arguments fail then it's not possible for it to be a name and will return the error message specified. \n else\n raise \"Oh no, that doesn't look like a name\"\n end\n #argument to return that is currently specified to 'nil'\n return name\nend", "def name\n if first_name.blank? and last_name.blank?\n \"(no name)\"\n else\n \"#{self.last_name}, #{self.first_name}\"\n end\n end", "def proper_name\n first_name + \" \" + last_name\n end", "def proper_name\n first_name + \" \" + last_name\n end", "def proper_name\n first_name + \" \" + last_name\n end", "def proper_name\n first_name + \" \" + last_name\n end", "def proper_name\n first_name + \" \" + last_name\n end", "def full_name\n if last_name != nil\n first_name + \" \" + last_name\n else\n first_name\n end\n end", "def last_name_first\n self.last_name + ', ' + self.first_name\n end", "def first_name; end", "def first_name; end", "def first_name; end", "def first_name; end", "def first_name\n name ? name.split(' ',2)[0] : ''\n end", "def first_name\n name ? name.split(' ',2)[0] : ''\n end", "def full_name\n \treturn \"#{first_name} #{last_name}\".strip if(first_name || last_name) \n \t\"Anonymous\"\n end", "def test_get_first_name_returns_name\r\n name_gen = NameGenerator2.new([\"first\"], [\"last\"])\r\n\r\n fn = name_gen.get_first_name(\"don\")\r\n assert_equal(\"first\", fn)\r\n end", "def proper_name\n\t\tfirst_name + \" \" + last_name\n\tend", "def full_name(first_name, last_name)\n name = first_name.capitalize + \" \" + last_name.capitalize\n return name\nend", "def firstname_first\n person.fullname_unknown? ? login : person.firstname_first rescue login\n end", "def proper_name # method to get the full name of user\n first_name + \" \" + last_name\n end", "def full_name\n full_name = first_name\n full_name += ' ' + middle_name if middle_name\n full_name += ' ' + last_name\n end", "def full_name\r\n last_name.blank? ? \"#{first_name} #{mi}\" : \"#{last_name}, #{first_name} #{mi}\"\r\n end", "def name\n if first_name.present? || last_name.present?\n [first_name, last_name].join(\" \").strip\n else\n username\n end\n end", "def first_name_last_name\n \"#{first_name} #{last_name}\"\n end", "def last_name\n super || (name and name.split.last)\n end", "def full_name\n [first_name, last_name].select(&:'present?').join(' ')\n end", "def first_name\n self.name.split(' ').first\n end", "def first_name_is_valid?\n return false unless not_nil_and_string(self.first_name)\n return self.first_name.length > 0\n end", "def full_name(first_name, last_name)\n first_name.capitalize + ' ' + last_name.capitalize\nend", "def first_name\n name.split.first\n end", "def name\n name = ''\n name = first_name if first_name\n name = name + ' ' + last_name if last_name\n name\n end", "def display_name\n last_name.blank? ?\n (first_name.blank? ? email : first_name) :\n (first_name.blank? ? last_name : (first_name + ' ' + last_name))\n end", "def format_name(first, last)\n return nil if last.empty? || first.empty?\n first = first.gsub(/[^A-Za-z]/, '')\n last = last.gsub(/[^A-Za-z]/, '')\n (first[0] + last).downcase\nend", "def format_name(first, last)\n return nil if last.empty? || first.empty?\n first = first.gsub(/[^A-Za-z]/, '')\n last = last.gsub(/[^A-Za-z]/, '')\n (first[0] + last).downcase\nend", "def full_name\n \tif !self.first_name.nil? && !self.last_name.nil?\n\t\t\"#{self.first_name.titleize} #{self.last_name.titleize}\"\n\telsif !self.oauth_user_name.nil?\n\t\tself.oauth_user_name\n\telse\n\tend\n end", "def format_name(first, last)\n if first.empty? || last.empty?\n nil\n else\n formatted_first = first.delete(' ')\n formatted_last = last.delete(' ')\n return (formatted_first[0] + formatted_last).downcase\n end\nend", "def full_name(first_name, last_name)\n first_name + \" \" + last_name\nend", "def full_name(first_name, last_name)\n first_name + \" \" + last_name\nend", "def first_and_last_name\n \"#{first_name} #{last_name}\"\n end", "def full_name\n firstname.capitalize() + \" \" + lastname.capitalize()\n end", "def check_if_full_name(full_name, full_name_split, first_name)\n if full_name_split.length > 1\n check_name_in_database(full_name, first_name)\n else\n puts \"\"\n puts \"Give me your full name, jackass!\".print_slowly\n get_user_name\n end\nend", "def first_name?\n first_name.present?\n end", "def first_name_is_valid\n errors.add(:first_name,'Invalid empty string for first name.') unless first_name_is_valid?\n end", "def format_name(first, last)\n if (first.empty? || last.empty?)\n nil\n else\n (first.gsub(/\\s+/, '')[0]+last.gsub(/\\s+/, '')).downcase\n end\nend", "def format_name(first, last)\n first.empty? || last.empty? ? nil :\n (first.gsub(/[^A-z]/, \"\")[0] + last.gsub(/[^A-z]/, \"\")).downcase\nend", "def first_name_and_last_name\n \"#{first_name}-#{last_name}\"\n end", "def first_last_name\n names = name.split\n names.first + \" \" + names.last\n end", "def format_name(first, last)\n if first.length == 0\n p nil\n elsif last.length == 0\n p nil\n else\n first_name = first.delete(\" \")\n last_name = last.delete(\" \")\n first_init = first_name[0]\n name_temp = first_init + last_name\n name_v1 = name_temp.delete(\" \").downcase\n p name_v1\n end\nend", "def list_first_and_last_name(first_name, middle_name, last_name)\n puts \"First Name: #{first_name}, Middle Name: #{middle_name}, Last Name: #{last_name}\"\nend", "def list_first_and_last_name(first_name, middle_name, last_name)\n puts \"First Name: #{first_name}, Middle Name: #{middle_name}, Last Name: #{last_name}\"\nend", "def format_name(first, last)\n if last == '' || first == ''\n word = nil\n else\n user_name = ''\n user_name += first.gsub(' ', '').gsub(/[^0-9A-Za-z]/, '')[0]\n user_name += (last.gsub(' ','').gsub(/[^0-9A-Za-z]/, ''))\n user_name.gsub(/\\d/, '').downcase\n end\nend", "def first_name_men; end", "def display_name\n first_name.blank? || last_name.blank? ? email : first_name + \" \" + last_name\n end", "def first_name(full_name)\n full_name.partition(', ').last\n end", "def first_last\n first_name + \" \" + last_name\n end", "def format_name(first, last)\n\tf_return = \"\"\n\tl_return = \"\"\n\tif first[0]\n\t\tf_return = first.gsub(\" \", \"\")\n\t\tf_return =f_return.gsub(/[^A-Za-z]/, '')\n\t\tf_return = f_return[0].downcase\n\telse\n\t\tf_return = \"\"\n\tend\n\tif last[0]\n\t\tl_return = last.gsub(\" \", \"\")\n\t\tl_return = l_return.gsub(/[^A-Za-z]/, '')\n\t\tl_return.downcase!\n\telse\n\t\tlast = \"\"\n\tend\n if f_return[0] && l_return[0]\n \treturn f_return+l_return\n else\n \treturn nil\n end\nend", "def determine_name_parts(name)\n @first_name = name[0..name.index(\" \")].strip.downcase\n @last_name = name[name.index(\" \")..name.length].strip.downcase\n end", "def full_name\n \"#{firstname} #{lastname}\".strip\n end", "def full_name(first_name, last_name, title)\n\n# #shows that at first we are not placing anything in for name\n# name = nil\n\n# #if all three are present do title then first then last\n if title && first_name && last_name\n name = title + \" \" + first_name + \" \" + last_name\n# #if first missing, title then last, with a space\n elsif title && last_name\n name = title + \" \" + last_name\n# #if title missing, first then last\n elsif first_name && last_name\n name = first_name + \" \" + last_name\n# #if only first name is in, just puts the first name\n elsif first_name\n name = first_name\n# #if anything else is put in, puts the \"oh no\" sentence\n else\n \"Oh no, that doesn't look like a name\"\n end\n# #tells the terminal to return whatever is put in the puts\n return name\nend", "def full_name\n name = first_name.strip # required\n name << \" #{middle_name.strip}\" if !middle_name.nil?\n name << \" #{last_name.strip}\" # required\n name << \" #{mother_last_name.strip}\" if !mother_last_name.nil?\n\n # capitalize each word and return the capitalized version\n name.split.map(&:capitalize).join(' ')\n end" ]
[ "0.74373317", "0.7412166", "0.73751235", "0.7364687", "0.7344664", "0.7300716", "0.7276813", "0.72759324", "0.726786", "0.72499263", "0.7236219", "0.7231581", "0.72306216", "0.7229518", "0.71942973", "0.7190315", "0.7189695", "0.71855974", "0.7151715", "0.7151385", "0.7126773", "0.71102184", "0.7094527", "0.7083799", "0.7079933", "0.70781827", "0.70780706", "0.70775187", "0.7062532", "0.7061318", "0.70584047", "0.7051059", "0.7043991", "0.7035271", "0.70301044", "0.7027941", "0.7023332", "0.7019496", "0.70185953", "0.7017844", "0.7011715", "0.7004329", "0.7004329", "0.7004329", "0.7004329", "0.7003992", "0.6996776", "0.69965076", "0.69962865", "0.69962865", "0.69962865", "0.6995341", "0.6985839", "0.6985839", "0.6980436", "0.6976913", "0.69761634", "0.69751984", "0.6972355", "0.6970345", "0.696938", "0.69625664", "0.6959685", "0.69536173", "0.6940452", "0.6939848", "0.6937788", "0.693654", "0.6931743", "0.6928548", "0.6921865", "0.6916924", "0.6914192", "0.6914192", "0.69088566", "0.6908626", "0.6907757", "0.6907757", "0.6902429", "0.6899029", "0.6899007", "0.6895275", "0.6895104", "0.6892262", "0.6889785", "0.688791", "0.6881846", "0.68815666", "0.68806946", "0.68806946", "0.687649", "0.6875232", "0.68748564", "0.6863987", "0.6861058", "0.68609315", "0.68592674", "0.6857336", "0.68567413", "0.68560785" ]
0.72286993
14
GET /students/1 GET /students/1.json
def show @report=Student.where(:student_id=>params[:id]) if @report.blank? flash[:warning]="Student with id #{params[:id]} not found" redirect_to '/managers/options' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_student\n @student = Student.find(params[:std_id])\n render json: @student\n end", "def show\n student = Student.find(params[:id])\n render json: student\nend", "def show\n @student = User.find params[:id]\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @student }\n end\n end", "def get_students\n @course = Course.find(params[:course_id])\n\n render json: @course.students\n end", "def index\n @students = Student.all\n render json: @students\n end", "def show\n @student = Student.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student }\n end\n end", "def show\n @student = Student.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student }\n end\n end", "def show\n @student = Student.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student }\n end\n end", "def show\n @student = Student.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student }\n end\n end", "def show\n @student = Student.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student }\n end\n end", "def show\n @student = Student.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student }\n end\n end", "def show\n @student = Student.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student }\n end\n end", "def show\n @student = Student.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student }\n end\n end", "def show\n @student = Student.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @student }\n end\n end", "def show\n @student = Student.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @student }\n end\n end", "def my_students(query={})\n self.simple_client.get(\"/api/v1/students?#{query.to_query}\")\n end", "def index\n @students = Student.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @students }\n end\n end", "def index\n @students = Student.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @students }\n end\n end", "def show\n respond_to do |format|\n format.json {\n\n @student = User.find_by_id(params[:id])\n\n if @student\n render :json => @student\n else\n render :nothing => true, :status => 200, :content_type => 'text/html'\n end\n }\n end\n end", "def show\n # @student = Student.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student }\n end\n end", "def index\n @students = Student.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @students }\n end\n end", "def index\n puts render json: @user.students, each_serializer: UserSerializer\n end", "def index\n @students = Student.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @students }\n end\n end", "def show\n student = Student.find(params[:id])\n\n render json: {status: 'SUCCESS', message:\"Student listed with name #{student.name}\", data:student}, status: :ok\n end", "def show\n render json: @student\n end", "def show\n @student_user = StudentUser.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student_user }\n end\n end", "def index\n @students = current_user.groups[0].students\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @students }\n end\n end", "def show\n @student = Student.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n \n \n format.json { render json: @student }\n end\n end", "def school_students(query={})\n self.simple_client.get(\"/api/v1/schools/my/students?#{query.to_query}\")\n end", "def show\n student = Student.find(params[:id])\n render json: { status: '200', message: \"Loaded Student with id #{params[:id]}\", data: student }, status: :ok\n rescue ActiveRecord::RecordNotFound\n render json: { status: '404', error: \"No Student with id #{params[:id]}\", data: student }, status: :not_found\n end", "def show\r\n @student1 = Student1.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @student1 }\r\n end\r\n end", "def index\n @students = Student.all\n respond_to do |format|\n format.html { render :index }\n format.json { render json: @students.pluck(:id, :firstname, :lastname) }\n end\n end", "def index\n @students = Student.all\n respond_to do |format|\n\t\t\tformat.html { render :index }\n\t\t\tformat.json { render json: Oj.dump(@students) }\n\t\tend\n end", "def show\n @student = Student.find(params[:id])\n @times = times\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student }\n end\n end", "def show\n @student_major = StudentMajor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student_major }\n end\n end", "def students\n @course = Course.find(params[:id])\n\t\t@students = @course.students\n\t\t@other_students = Student.find(:all, :conditions => [\"id not in (select student_id from courses_students where course_id=?)\", @course.id])\n\n respond_to do |format|\n format.html # students.html.erb\n format.json { render :json => @students }\n end\n end", "def show\n @course = Course.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student }\n end\n end", "def show\n student = StudentEntity.find_by(id: params[:id])\n if student.present?\n render json: student, staus: :ok\n else\n render json: {msg: \"not found\"}, staus: :not_found\n end\n end", "def show\n @indexstudent = Indexstudent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @indexstudent }\n end\n end", "def index\n if request.format == \"json\"\n @students = Student.all.order(:last_name)\n end\n end", "def show\n @dojo_student = DojoStudent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dojo_student }\n end\n end", "def show\n @enrolled_student = EnrolledStudent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @enrolled_student }\n end\n end", "def show\n @online_student = OnlineStudent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @online_student }\n end\n end", "def show\n @student_test = StudentTest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student_test }\n end\n end", "def show\n @studentgrade = Studentgrade.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @studentgrade }\n end\n end", "def get_student\n @student = Student.find(params[:student_id])\n end", "def index\n @students = Student.paginate(page: params[:page], per_page: 2)\n #respond_with(@students)\n respond_to do |format|\n format.json {render json: {\"students\": @students}}\n format.html #index.html.erb\n end\n end", "def student_show\n @course = Course.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n \n end", "def show\n @student = Student.find(params[:id])\n\n _load_constants\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student }\n end\n end", "def index\n @student_profiles = StudentProfile.all \n render json: @student_profiles\n end", "def students\n student_size = User.all.length\n current_offset = (params[:payload][:pagenumber] - 1)*10\n direction = params[:payload][:direction]\n\n respond_to do |format|\n format.json {\n if current_offset + direction < student_size && current_offset + direction >= 0\n offset = current_offset + direction\n @students = User.all.offset(offset).take(10) \n render :json => @students\n else\n render :nothing => true, :status => 200, :content_type => 'text/html'\n end\n }\n end\n\tend", "def show\n @studentset = Studentset.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @studentset }\n end\n end", "def index\n @online_students = OnlineStudent.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @online_students }\n end\n end", "def student\n\n\t\tif(params[:student_user_id].eql?('null') || params[:classroom_id].eql?('null') )\n\t\t\trender json: {status: \"error\", error: \"invalid-student-user-or-classroom\"}\n\t\telse\n\t\t\tstudent = StudentUser.joins(:classrooms)\n\t\t\t\t.joins(\"inner join teacher_users t on classrooms.teacher_user_id = t.id\")\n\t\t\t\t.where(\"t.id = ?\", @current_teacher_user.id)\n\t\t\t\t.where(\"classrooms.id = ?\", params[:classroom_id])\n\t\t\t\t.where(\"student_users.id = ?\" , params[:student_user_id])\n\t\t\t\t.first\n\n\t\t\tif(!student.nil?)\n\t\t\t\tstudent = student.as_json\n\t\t\t\tstudent.delete(\"salt\")\n\t\t student.delete(\"password_digest\")\n\t\t student.delete(\"oauth_expires_at\")\n\t\t student.delete(\"oauth_token\")\n\t\t student.delete(\"updated_at\")\n\t\t student.delete(\"create_at\")\n\n\t\t\t\trender json: {status: \"success\", student: student}\n\t\t\t\n\t\t\telse\n\n\t\t\t\trender json: {status: \"error\", error: \"invalid-student-user-or-classroom\"}\n\n\t\t\tend\n\t\tend\n\t\t\n\t\t\n\tend", "def index\n @student_entities = StudentEntity.all\n render json: @student_entities, status: :ok\n end", "def show\n respond_to do |format|\n format.html\n format.json {render json: @student, serializer: StudentSerializer, include: '**'}\n end\n end", "def show\n render json: @student_type\n end", "def index\n # We will be creating a new student object to use with Register URL form\n @student = Student.new \n @students = Student.paginate(:page => params[:page], :per_page => 10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @urls }\n end\n end", "def show\n @student_source = StudentSource.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student_source }\n end\n end", "def index\n @students = Student.all(:order => \"family_name\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @students }\n end\n end", "def show\n @camp = Camp.find(params[:id])\n @students = Student.all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @camp }\n end\n end", "def show\n @student = Student.find(params[:id])\n end", "def show\n @student = Student.find(params[:id])\n end", "def show\n @student = Student.find(params[:id])\n end", "def show\n @student = Student.find(params[:id])\n end", "def show\n @student = Student.find(params[:id])\n end", "def show\n \n if current_user.teacher.nil?\n @students = []\n @groups = []\n else\n @student = current_user.teacher.students.find(params[:id])\n @groups = current_user.teacher.groups\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student }\n end\n end", "def show\n @student = current_user.groups[0].students.find(params[:id])\n\n respond_to do |format|\n format.js\n format.html # show.html.erb\n format.json { render json: @student }\n end\n end", "def index\n @students = Student.all\n respond_to do |format|\n format.html\n format.json {render json: StudentsDatatable.new(view_context)}\n end\n end", "def index\n @user = User.find(session[:user_id])\n @schools = @user.schools\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @schools }\n end\n end", "def show\n @student = find_student # Load the student mentioned by id in the route\n end", "def index\n # logger.info \"☻ request query parameters: #{request.query_parameters}\"\n\n # logger.info \"--> #{request.fullpath}\"\n # logger.info \"--> GITHUB_KEY: #{ENV['GITHUB_KEY']}\"\n # logger.info \"--> GITHUB_SECRET: #{ENV['GITHUB_SECRET']}\"\n\n class_name = params[:class_name] || \"unknown\"\n year = params[:year] || \"2011\"\n semester = params[:semester] || \"summer\"\n\n if params[:class_name]\n @students = Student.where(class_name: class_name, year: year, semester: semester)\n else\n @students = Student.where(year: 2011, semester: \"summer\", class_name: \"unallocated\")\n end\n\n # @students = Student.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @students }\n end\n end", "def index\n @student_types = StudentType.all\n\n render json: @student_types\n end", "def show\n add_breadcrumb @student.login, student_path(@student.login)\n @student_data = gon.jbuilder template: 'app/views/students/show.json.jbuilder', as: 'student_data' if request.format.symbol != :json\n end", "def show\n @student_availability = StudentAvailability.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student_availability }\n end\n end", "def show\n @student = Student.find(params[:id])\n\n render :show\nend", "def show\n @student = Student.find_by_id(params[:id])\n end", "def show\n @study = Study.find(params[:id])\n render json: @study\n end", "def show\n @student = Student.find(params[:id])\n\n if (@student.family_id && @student.family_id > 0)\n @family = Family.find(@student.family_id)\n end\n\n @resound_process = ResoundProcess.find_by_student_id(@student.id)\n\n @instruments = Instrument.all\n @instrument_names = Instrument.all.collect { |instrument| [instrument.name, instrument.id] }\n\n @student_instrument = StudentInstrument.new\n @student_availability = StudentAvailability.new\n @preferred_teacher = PreferredTeacher.new\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student }\n end\n end", "def new\n @student = Student.find(params[:student_id])\n @inschool = @student.inschools.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @inschool }\n end\n end", "def index\n @student_sources = StudentSource.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @student_sources }\n end\n end", "def index\n @students = Student.all\n end", "def index\n @students = Student.all\n end", "def index\n @students = Student.all\n end", "def index\n @students = Student.all\n end", "def index\n @students = Student.all\n end", "def index\n @students = Student.all\n end", "def index\n @students = Student.all\n end", "def index\n @students = Student.all\n end", "def index\n @students = Student.all\n end", "def index\n @students = Student.all\n end", "def index\n @students = Student.all\n end", "def index\n @students = Student.all\n end", "def index\n @students = Student.all\n end", "def index\n @students = Student.all\n end", "def index\n @students = Student.all\n end", "def index\n @students = Student.all\n end", "def index\n @students = Student.all\n end", "def index\n @students = Student.all\n end", "def index\n @students = Student.all\n end", "def index\n @students = Student.all\n end" ]
[ "0.799139", "0.7715401", "0.7640336", "0.7618208", "0.7568598", "0.7556323", "0.7556323", "0.7556323", "0.7556323", "0.7556323", "0.7556323", "0.7556323", "0.7556323", "0.74949914", "0.74949914", "0.74892485", "0.7465394", "0.7465394", "0.7444688", "0.74417126", "0.7441199", "0.74343264", "0.7420528", "0.7383386", "0.7379092", "0.7370451", "0.73154", "0.72715455", "0.72680193", "0.72667634", "0.7247089", "0.72074413", "0.71730655", "0.71450543", "0.7097319", "0.70742226", "0.70718807", "0.7023225", "0.7017611", "0.7011665", "0.70080554", "0.70009315", "0.69892734", "0.697968", "0.6953463", "0.6943077", "0.69257814", "0.69124985", "0.6903087", "0.68742", "0.68661463", "0.6846542", "0.68331784", "0.6810104", "0.68082446", "0.6795169", "0.6779224", "0.67459494", "0.67383367", "0.6736866", "0.6723677", "0.6719131", "0.6719131", "0.6719131", "0.6719131", "0.6719131", "0.66977245", "0.66731566", "0.66576105", "0.6654157", "0.6650997", "0.6625387", "0.6616364", "0.6605661", "0.6586676", "0.658519", "0.6580153", "0.6574691", "0.6562013", "0.65429676", "0.65301895", "0.65244573", "0.65244573", "0.65244573", "0.65244573", "0.65244573", "0.65244573", "0.65244573", "0.65244573", "0.65244573", "0.65244573", "0.65244573", "0.65244573", "0.65244573", "0.65244573", "0.65244573", "0.65244573", "0.65244573", "0.65244573", "0.65244573", "0.65244573" ]
0.0
-1
GET /students/new GET /students/new.json
def new @student = Student.new @possible_classes = Gclass.all.map {|elem| elem.gclass} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @student }\n end\n end", "def new\n # @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "def new\n @student_user = StudentUser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student_user }\n end\n end", "def new\n @student = current_user.students.build(params[:student])\n\n respond_to do |format|\n format.html # new.html.erb\n format.js # new.js.erb\n format.json { render json: @student }\n end\n end", "def new\n @student_major = StudentMajor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student_major }\n end\n end", "def new\n @student = Student.find(params[:student_id])\n @inschool = @student.inschools.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @inschool }\n end\n end", "def new\n @online_student = OnlineStudent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @online_student }\n end\n end", "def new\n @student_test = StudentTest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student_test }\n end\n end", "def new\n @indexstudent = Indexstudent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @indexstudent }\n end\n end", "def new\n @studentgrade = Studentgrade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @studentgrade }\n end\n end", "def new\n @enrolled_student = EnrolledStudent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @enrolled_student }\n end\n end", "def new\r\n @student1 = Student1.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @student1 }\r\n end\r\n end", "def new\n @studentset = Studentset.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @studentset }\n end\n end", "def new\n\t\t@student = Student.new\n\t\tnew_setup()\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\tend\n end", "def new\n @dojo_student = DojoStudent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dojo_student }\n end\n end", "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, :notice => 'Student was successfully created.' }\n format.json { render :json => @student, :status => :created, :location => @student }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @student.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, :notice => 'Student was successfully created.' }\n format.json { render :json => @student, :status => :created, :location => @student }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @student.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new\n @student_source = StudentSource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student_source }\n end\n end", "def new\n @student_pastor = StudentPastor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student_pastor }\n end\n end", "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @points_spent = PointsSpent.new\n @student = Student.find(params[:student_id]) if params[:student_id]\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @points_spent }\n end\n end", "def new\n @supervision.student = Student.find(params[:student_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @supervision }\n end\n end", "def new\n @usuario = Usuario.new\n @student = Student.new\n @student.usuario = @usuario\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "def new\n @studnet = Studnet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @studnet }\n end\n end", "def create\n # @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @student = Student.find(params[:student_id])\n @lunchdetention = @student.lunchdetentions.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lunchdetention }\n end\n end", "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to root_path, notice: 'Student details were successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @student = Student.new\n end", "def new\n current_user.update_student_info\n @subsidy = Subsidy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subsidy }\n end\n end", "def new\n @school = School.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @school }\n end\n end", "def new\n @school = School.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @school }\n end\n end", "def new\n @student = Student.new\n end", "def new\n @student = Student.new\n end", "def new\n @student = Student.new\n end", "def new\n @student = Student.new\n end", "def new\n @student = Student.new\n end", "def new\n @student = Student.new\n end", "def new\n\t\t@student = Student.new\n\tend", "def new\n\t\t@student = Student.new\n\tend", "def new\n\t\t@student = Student.new\n\tend", "def new\n @inschool = Inschool.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @inschool }\n end\n end", "def new \n @student = Student.new\n end", "def new\n @study = Study.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @study }\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render action: 'show', status: :created, location: @student }\n else\n format.html { render action: 'new' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render action: 'show', status: :created, location: @student }\n else\n format.html { render action: 'new' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @student_availability = StudentAvailability.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student_availability }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @student }\n end\n end", "def new\n @stundent = Stundent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stundent }\n end\n end", "def new\n @grade = Grade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @grade }\n end\n end", "def new\n # Don't want to be able to select student here, but not sure how to disable it\n @students = Student.where(:name => \"xxxx\")\n @subject = Subject.new\n @b_id = @subject.id\n\n respond_with(@resources, @students, @subject, @b_id)\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student Info was successfully created.' }\n format.json { render action: 'show', status: :created, location: @student }\n else\n format.html { render action: 'new' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @people_student = People::Student.new(people_student_params)\n\n respond_to do |format|\n if @people_student.save\n format.html { redirect_to @people_student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @people_student }\n else\n format.html { render :new }\n format.json { render json: @people_student.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @study = Study.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @study }\n end\n end", "def create\n @student = Student.new(student_params)\n\n if @student.save\n render :show, status: :created, location: @student\n else\n render json: @student.errors, status: :unprocessable_entity\n end\n end", "def new\n @newuser = Newuser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newuser }\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @student = Student.new\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @student }\n end\n end", "def create_new_student(student_name)\n object = controller_create(:student)\n fail format(\"Student '%s' not created.\", student_name) if object.nil?\n\n PrcLib.info(format(\"'student': '%s' created with id %s\",\n student_name,\n object[:id]))\n object\n end", "def create\n @student = current_user.students.build(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to root_url, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student,\n notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors,\n status: :unprocessable_entity }\n end\n end\n end", "def new\n # @student_category = StudentCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student_category }\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: '生徒情報が追加されました' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = current_user.students.create(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Registro Exitoso.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @study_course = StudyCourse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @study_course }\n end\n end", "def create\n @student = Student.new(student_params)\n\n if @student.save\n render json: @student, status: :created\n else\n render json: @student.errors, status: :unprocessable_entity\n end\n end", "def new\n @nurse = Nurse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nurse }\n end\n end", "def create\n @student = @school.students.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to manage_school_school_path(@school), notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @usernew = Usernew.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @usernew }\n end\n end", "def new\n\tif session[:user].nil?\n\t\tredirect_to('/login/login')\n\tend\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @student }\n end\n end" ]
[ "0.8022949", "0.8022949", "0.8022949", "0.8022949", "0.8022949", "0.8022949", "0.8022949", "0.8022949", "0.8022949", "0.8022949", "0.8022949", "0.79333663", "0.79333663", "0.7850608", "0.7614127", "0.7548974", "0.75125027", "0.74463147", "0.7424611", "0.7406299", "0.7399139", "0.73621935", "0.7343533", "0.7329588", "0.73249674", "0.73132336", "0.7283329", "0.7281672", "0.7281672", "0.7272385", "0.72084963", "0.7174396", "0.7174396", "0.7174396", "0.7174396", "0.7174396", "0.7174396", "0.7174396", "0.71739095", "0.71728224", "0.71442306", "0.7136478", "0.7132032", "0.7129785", "0.71275526", "0.7123697", "0.7109873", "0.7082929", "0.7082929", "0.7080369", "0.7080369", "0.7080369", "0.7080369", "0.7080369", "0.7080369", "0.70733553", "0.70733553", "0.70733553", "0.7072116", "0.70701236", "0.70314145", "0.7024961", "0.70245606", "0.7019924", "0.7019043", "0.7019043", "0.7019043", "0.7019043", "0.70189583", "0.70092016", "0.7001835", "0.69950646", "0.6994519", "0.69756603", "0.6967261", "0.695864", "0.69529784", "0.6951853", "0.6951853", "0.6951853", "0.6951853", "0.6951853", "0.6951853", "0.6951853", "0.6951853", "0.6951853", "0.6951853", "0.6951853", "0.6940415", "0.6935113", "0.6923755", "0.6917468", "0.69172716", "0.69042885", "0.6901813", "0.69009286", "0.6887624", "0.68781596", "0.68717664", "0.6870466", "0.6863696" ]
0.0
-1
POST /students POST /students.json
def create answer = Student.createNew(params[:student]) redirect_to teachers_path, notice: "Student wasn't created! Please bind at least one teacher to class #{gcl} before." unless answer redirect_to "/gclasses/#{Gclass.where(:gclass=>params[:student][:gclass]).first.id}", notice: "Student was successfully created." end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @student = Student.new(student_params)\n\n if @student.save\n render json: @student, status: :created\n else\n render json: @student.errors, status: :unprocessable_entity\n end\n end", "def create\n @student = current_user.students.create(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Registro Exitoso.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, :notice => 'Student was successfully created.' }\n format.json { render :json => @student, :status => :created, :location => @student }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @student.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, :notice => 'Student was successfully created.' }\n format.json { render :json => @student, :status => :created, :location => @student }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @student.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @student = current_user.students.build(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to root_url, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\tp = params[:student]\n\t\thash = { :original_name => p['original_name'], :sort_name => Student.make_sort_name(p['original_name']), :other_name => p['other_name'],\n\t\t\t:gender => p['gender'] == 'Male' ? 'M' : 'F', :born => VagueDate.factory(p['born']).to_s, :died => VagueDate.factory(p['died']).to_s,\n\t\t\t:home_town => p['home_town']['town'], :home_state => p['home_town']['state'], :home_country => p['home_town']['country'],\n\t\t\t:biographical_notes => p['biographical_notes'], :quotes => p['quotes'], :additional_notes => p['additional_notes'], :private_notes => p['private_notes'], :is_stub => 0\n\t\t}\n\n\t\t@student = Student.new(hash)\n\t\t@student.generate_unique_name()\n\n\t\trespond_to do |format|\n\t\t\tif @student.save\n\t\t\t\tmarriages = parse_array(p['marriage'])\n\t\t\t\tmarriages.each {|marriage|\n\t\t\t\t\tif !marriage['name'].blank?\n\t\t\t\t\t\tMarriage.create_marriage(@student, { :name => marriage['name'] }, marriage['date'])\n\t\t\t\t\tend\n\t\t\t\t}\n\t\t\t\tresidences = parse_array(p['residence'])\n\t\t\t\tresidences.each {|residence|\n\t\t\t\t\tif !residence.blank?\n\t\t\t\t\t\tStudentResidence.create_residence(@student, residence)\n\t\t\t\t\tend\n\t\t\t\t}\n\t\t\t\tBrowse.student_changed(@student, nil)\n\t\t\t\tsolr().add_object(@student.to_solr())\n\n\t\t\t\tformat.html { redirect_to(@student, :notice => 'The student was successfully created.') }\n\t\t\telse\n\t\t\t\tformat.html {\n\t\t\t\t\t@page_title = 'Student'\n\t\t\t\t\tnew_setup()\n\t\t\t\t\trender :action => \"new\"\n\t\t\t\t}\n\t\t\tend\n\t\tend\n\tend", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: \"Student was successfully created.\" }\n format.json { render json :show, status: :created, location: @student }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n if @student.save\n render :show, status: :created, location: @student\n else\n render json: @student.errors, status: :unprocessable_entity\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student,\n notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors,\n status: :unprocessable_entity }\n end\n end\n end", "def create\n @people_student = People::Student.new(people_student_params)\n\n respond_to do |format|\n if @people_student.save\n format.html { redirect_to @people_student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @people_student }\n else\n format.html { render :new }\n format.json { render json: @people_student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to root_path, notice: 'Student details were successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n # @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n validate_student(student_params)\n begin\n student = Student.create!(student_params)\n\n render json: {status: 'SUCCESS', message:\"Student registered Successfully with name #{student.name}\", data:student.reload}, status: :ok\n rescue => error\n render json: {message: error}\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render action: 'show', status: :created, location: @student }\n else\n format.html { render action: 'new' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render action: 'show', status: :created, location: @student }\n else\n format.html { render action: 'new' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = @school.students.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to manage_school_school_path(@school), notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student Info was successfully created.' }\n format.json { render action: 'show', status: :created, location: @student }\n else\n format.html { render action: 'new' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: '生徒情報が追加されました' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n @student.user_id = current_user.id\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Estudiante ha sido satisfactoriamente creado.' }\n format.json { render action: 'show', status: :created, location: @student }\n else\n format.html { render action: 'new' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @studentgrade = Studentgrade.new(params[:student])\n\n respond_to do |format|\n if @studentgrade.save\n format.html { redirect_to @studentgrade, notice: 'Student was successfully created.' }\n format.json { render json: @studentgrade, status: :created, location: @studentgrade }\n else\n format.html { render action: \"new\" }\n format.json { render json: @studentgrade.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = current_user.students.build(student_params)\n @student.status = 'imcomplete'\n respond_to do |format|\n if @student.save\n format.html { redirect_to students_url, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student_entity = StudentEntity.new(student_entity_params)\n\n respond_to do |format|\n if @student_entity.save\n format.json { render :show, status: :created, location: @student_entity }\n else\n format.json { render json: @student_entity.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @manage_student = Manage::Student.new(manage_student_params)\n\n respond_to do |format|\n if @manage_student.save\n format.html { redirect_to @manage_student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @manage_student }\n else\n format.html { render :new }\n format.json { render json: @manage_student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = current_user.students.build(student_params)\n # @student = Student.new(student_params)\n # @student.user_id = current_user.id\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to admissions_url, success: 'Student record was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to [:admin, @student], notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = @current_lop.students.build(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to lop_students_url, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @admin_student = Admin::Student.new(admin_student_params)\n\n respond_to do |format|\n if @admin_student.save\n format.html { redirect_to @admin_student, notice: \"Student was successfully created.\" }\n format.json { render :show, status: :created, location: @admin_student }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @admin_student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(admin_student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @enrolled_student = EnrolledStudent.new(params[:enrolled_student])\n\n respond_to do |format|\n if @enrolled_student.save\n format.html { redirect_to @enrolled_student, notice: 'Enrolled student was successfully created.' }\n format.json { render json: @enrolled_student, status: :created, location: @enrolled_student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @enrolled_student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n @schools_students = SchoolsStudent.new\n @schools_students.student_id = @student.id\n @schools_students.school_id = params[:school_id]\n @schools_students.save!\n\n @contract = Contract.new\n @contract.student_id = @student.id\n @contract.save!\n\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render action: 'show', status: :created, location: @student }\n else\n format.html { render action: 'new' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n student_ids = params[:student_ids].to_a\n student_ids.each_with_index do |student_id|\n student = Student.where(id: student_id.to_i).first\n @team.students << student\n end\n end", "def create\n @student_test = StudentTest.new(params[:student_test])\n\n respond_to do |format|\n if @student_test.save\n format.html { redirect_to @student_test, notice: 'Student test was successfully created.' }\n format.json { render json: @student_test, status: :created, location: @student_test }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student_test.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(params[:student])\n @student.save\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to students_url, notice: 'Student was successfully created.' }\n else\n format.html { render :new }\n end\n end\n end", "def create\n @dojo_student = DojoStudent.new(params[:dojo_student])\n\n respond_to do |format|\n if @dojo_student.save\n format.html { redirect_to @dojo_student, notice: 'Dojo student was successfully created.' }\n format.json { render json: @dojo_student, status: :created, location: @dojo_student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dojo_student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @studen = Studen.new(studen_params)\n\n respond_to do |format|\n if @studen.save\n format.html { redirect_to @studen, notice: 'Studen was successfully created.' }\n format.json { render :show, status: :created, location: @studen }\n else\n format.html { render :new }\n format.json { render json: @studen.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student_type = StudentType.new(student_type_params)\n\n if @student_type.save\n render json: @student_type, status: :created, location: @student_type\n else\n render json: @student_type.errors, status: :unprocessable_entity\n end\n end", "def create\n @student_interest = StudentInterest.new(student_interest_params)\n\n respond_to do |format|\n if @student_interest.save\n format.html { redirect_to @student_interest, notice: 'Student interest was successfully created.' }\n format.json { render action: 'show', status: :created, location: @student_interest }\n else\n format.html { render action: 'new' }\n format.json { render json: @student_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.find(params[:student_id])\n @grade = @student.grades.new(grade_params)\n respond_to do |format|\n if @grade.save\n format.html { redirect_to student_grades_path, notice: 'Grade was successfully created.' }\n format.json { render :show, status: :created, location: @grade }\n else\n format.html { render :new }\n format.json { render json: @grade.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @map_student = MapStudent.new(map_student_params)\n\n respond_to do |format|\n if @map_student.save\n format.html { redirect_to @map_student, notice: 'Map student was successfully created.' }\n format.json { render :show, status: :created, location: @map_student }\n else\n format.html { render :new }\n format.json { render json: @map_student.errors, status: :unprocessable_entity }\n end\n end\n end", "def student\n\n\t\tif(params[:student_user_id].eql?('null') || params[:classroom_id].eql?('null') )\n\t\t\trender json: {status: \"error\", error: \"invalid-student-user-or-classroom\"}\n\t\telse\n\t\t\tstudent = StudentUser.joins(:classrooms)\n\t\t\t\t.joins(\"inner join teacher_users t on classrooms.teacher_user_id = t.id\")\n\t\t\t\t.where(\"t.id = ?\", @current_teacher_user.id)\n\t\t\t\t.where(\"classrooms.id = ?\", params[:classroom_id])\n\t\t\t\t.where(\"student_users.id = ?\" , params[:student_user_id])\n\t\t\t\t.first\n\n\t\t\tif(!student.nil?)\n\t\t\t\tstudent = student.as_json\n\t\t\t\tstudent.delete(\"salt\")\n\t\t student.delete(\"password_digest\")\n\t\t student.delete(\"oauth_expires_at\")\n\t\t student.delete(\"oauth_token\")\n\t\t student.delete(\"updated_at\")\n\t\t student.delete(\"create_at\")\n\n\t\t\t\trender json: {status: \"success\", student: student}\n\t\t\t\n\t\t\telse\n\n\t\t\t\trender json: {status: \"error\", error: \"invalid-student-user-or-classroom\"}\n\n\t\t\tend\n\t\tend\n\t\t\n\t\t\n\tend", "def create\n # binding.pry\n @student_id = StudentId.new(student_id_params)\n\n respond_to do |format|\n if @student_id.save\n if @enrolment\n format.html { redirect_to enrolment_student_ids_path(@enrolment), notice: 'Student was successfully created.' }\n else\n format.html { redirect_to student_ids_url, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student_id }\n end\n else\n format.html { render :new }\n format.json { render json: @student_id.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.find(params[:student_id])\n @inschool = @student.inschools.create(params[:inschool])\n\n respond_to do |format|\n if @inschool.save\n StudentMailer.mailer_inschool(@student, @inschool).deliver\n format.html { redirect_to :back, notice: 'Inschool was successfully created and an email sent was sent to the teacher.' }\n format.json { render json: @inschool, status: :created, location: @inschool }\n else\n format.html { render action: \"new\" }\n format.json { render json: @inschool.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n @student_instrument = StudentInstrument.new(params[:student_instrument])\n\n @student = Student.find(params[:student_instrument][:student_id])\n\n respond_to do |format|\n if @student_instrument.save\n format.html { redirect_to @student, notice: 'Instrument was successfully added.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n relate_with_courses\n format.html { redirect_to admin_student_path(@student), notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n unless current_user.instructor\n render :nothing => true, :status => :unauthorized\n end\n \n # create team\n team = Team.create(name: params[:team_name], course: $selected_course)\n\n # add students to teams\n student_ids = params[:student_ids]\n student_ids.each do |student_id|\n StudentTeam.create(student_id: student_id, team: team)\n end\n\n render json: { success: true }\n end", "def create\n @studenttest = Studenttest.new(studenttest_params)\n\n respond_to do |format|\n if @studenttest.save\n format.html { redirect_to @studenttest, notice: 'Studenttest was successfully created.' }\n format.json { render :show, status: :created, location: @studenttest }\n else\n format.html { render :new }\n format.json { render json: @studenttest.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n hash = params[:post]\n student_id = hash[:student_id].to_i\n\n # check if student already has request submitted\n if Request.where(student_id: student_id).size > 0\n respond_to do |format|\n format.html { redirect_to Request.where(student_id: student_id).take, notice: 'You already have this request:' }\n format.json { render :show, status: 400 }\n end\n # check that student is registered\n elsif Student.where(id_num: student_id).size == 0\n respond_to do |format|\n format.html { redirect_to requests_path, notice: \"Invalid ID number: #{student_id}\" }\n format.json { render :show, status: 400 }\n end\n # create request\n else\n @request = Request.new(request_params)\n @request.student_id = student_id\n\n respond_to do |format|\n if @request.save\n format.html { redirect_to '/requests', notice: 'Request was successfully created.' }\n format.json { render :show, status: :created, location: @request }\n else\n format.html { render :new }\n format.json { render json: @request.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: '学生资料创建成功.' }\n format.json { render json: @student, status: :created, location: @student }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n flash[:notice] = 'Student was successfully created.'\n format.html { redirect_to(students_url) }\n format.xml { render :xml => @student, :status => :created, :location => @student }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end", "def index\n @students = Student.all\n render json: @students\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n add_model_error_to_flash @student\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n @user = User.find_by_id(params[:user])\n @student.user = @user\n @department = Department.find_by_id(params[:department])\n @student.department = @department\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n @student.kundenstatus = 1\n @student.percentage = 1\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student_major = StudentMajor.new(student_major_params)\n\n respond_to do |format|\n if @student_major.save\n format.html { redirect_to @student_major, notice: 'Student major was successfully created.' }\n format.json { render json: @student_major, status: :created, location: @student_major }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student_major.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @find_student = FindStudent.new(find_student_params)\n\n respond_to do |format|\n if @find_student.save\n format.html { redirect_to @find_student, notice: 'Find student was successfully created.' }\n format.json { render :show, status: :created, location: @find_student }\n else\n format.html { render :new }\n format.json { render json: @find_student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @group_student = GroupStudent.new(group_student_params)\n\n respond_to do |format|\n if @group_student.save\n format.html { redirect_to @group_student, notice: 'Group student was successfully created.' }\n format.json { render :show, status: :created, location: @group_student }\n else\n format.html { render :new }\n format.json { render json: @group_student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_new_student(student_name)\n object = controller_create(:student)\n fail format(\"Student '%s' not created.\", student_name) if object.nil?\n\n PrcLib.info(format(\"'student': '%s' created with id %s\",\n student_name,\n object[:id]))\n object\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully created.' }\n format.json { render :show, status: :created, location: @student }\n # Add the course just created to this student's courses, better use the drop down list \n if params[:course] != nil then\n @student.courses << Course.find(params[:course][:id])\n end\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n \n respond_to do |format|\n if @student.save\n format.html { redirect_to convert_path(@student) }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n \n end", "def index\n puts render json: @user.students, each_serializer: UserSerializer\n end", "def create\n @student = Student.new(student_params)\n @teachers = Teacher.all\n respond_to do |format|\n if @student.save\n format.html { redirect_to @student, notice: \"Student was successfully created.\" }\n else\n format.html { render :new, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student_availability = StudentAvailability.new(params[:student_availability])\n\n @student = Student.find(params[:student_availability][:student_id])\n\n respond_to do |format|\n if @student_availability.save\n format.html { redirect_to @student, notice: 'Student availability was successfully created.' }\n format.json { render json: @student_availability, status: :created, location: @student_availability }\n else\n format.html { render action: \"new\" }\n format.json { render json: @student_availability.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\tif session[:user].nil?\n\t\tredirect_to('/login/login')\n\tend\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to(@student, :notice => 'Student was successfully created.') }\n format.xml { render :xml => @student, :status => :created, :location => @student }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n\t\t#for each student, create student params\n\t\t@student = Student.create!(student_params)\n\t\t#once created, go back to students path\n\t\tredirect_to students_path\n\t#wrap up \"create\" action\n\tend", "def create\n @ststu = Ststu.new(ststu_params)\n\n respond_to do |format|\n if @ststu.save\n format.html { redirect_to @ststu, notice: 'Ststu was successfully created.' }\n format.json { render :show, status: :created, location: @ststu }\n else\n format.html { render :new }\n format.json { render json: @ststu.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(student_params)\n\n respond_to do |format|\n if @student.save\n\n #-CONNECT THE SCHOOL AND THE STUDENT IF @school IS PRESENT\n @student.schools << @school if @school\n\n format.html { redirect_to school_student_path(@student.school,@student), notice: 'Student creation successful.' }\n format.json { render :show, status: :created, location: @student }\n else\n format.html { render :new }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end", "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n flash[:success] = t('student.created')\n format.html { redirect_to(students_path) }\n format.xml { render :xml => @student, :status => :created, :location => @student }\n else\n flash[:error] = t('default_error_message')\n format.html { render :action => \"new\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.new(params[:student])\n\n respond_to do |format|\n if @student.save\n format.html { redirect_to(@student, :notice => 'Student was successfully created.') }\n format.xml { render :xml => @student, :status => :created, :location => @student }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @student = @group.students.new(student_params)\n respond_to do |format|\n if @student.save\n format.html { redirect_to group_students_path(@group), notice: 'Student was successfully created.' }\n else\n format.html { redirect_to group_students_path(@group), notice: \"Student couldn't be created\" }\n end\n end\n end" ]
[ "0.7277736", "0.7135355", "0.71114737", "0.71114737", "0.70372117", "0.70311", "0.70311", "0.70311", "0.70311", "0.70311", "0.70311", "0.70311", "0.6981121", "0.6974331", "0.6952658", "0.6951065", "0.6949918", "0.6949918", "0.6949918", "0.6949918", "0.6949918", "0.6949918", "0.6949918", "0.6949918", "0.6949918", "0.6949918", "0.6949918", "0.6940942", "0.6932588", "0.6918164", "0.6892295", "0.6883351", "0.6882861", "0.6882436", "0.68339634", "0.68103856", "0.6717371", "0.66683", "0.6653532", "0.66420585", "0.6641761", "0.66399556", "0.66340095", "0.66279477", "0.6611542", "0.66086227", "0.65808", "0.65620685", "0.65428996", "0.6535506", "0.6500749", "0.65003365", "0.6497407", "0.6492629", "0.6485156", "0.646409", "0.64620304", "0.6460147", "0.64575857", "0.6456369", "0.6453041", "0.64384305", "0.6405534", "0.63815874", "0.63750523", "0.6373127", "0.63543797", "0.63534796", "0.6346592", "0.63433206", "0.63270456", "0.63200545", "0.6318902", "0.6315283", "0.62979764", "0.6293227", "0.6293075", "0.6289927", "0.6289095", "0.62654173", "0.6256478", "0.62537503", "0.624758", "0.62471265", "0.62385845", "0.62088925", "0.62085474", "0.6205631", "0.6205631", "0.6205631", "0.6205631", "0.6205631", "0.6205631", "0.6205631", "0.6205631", "0.6205631", "0.6205631", "0.6205631", "0.6205619", "0.6204784", "0.61990607" ]
0.0
-1
PUT /students/1 PUT /students/1.json
def update @student = Student.find(params[:id]) respond_to do |format| if @student.update_attributes(params[:student]) format.html { redirect_to @student, notice: params[:student]}#'Debug: #{params[:student]} Student was successfully updated.' } format.json { head :ok } else format.html { render action: "edit" } format.json { render json: @student.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n if @student.update(student_params)\n render json: @student\n else\n render json: @student.errors, status: :unprocessable_entity\n end\n end", "def update\n begin\n student = Student.find(params[:id])\n student.update_attributes!(student_params)\n\n render json: {status: 'SUCCESS', message:\"Student updated Successfully with name #{student.name}\", data:student}, status: :ok\n rescue => error\n render json: {status: 'ERROR', message:'Student Update failed!', data:error}, status: :unprocessable_entity\n end\n end", "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to students_path, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @student = User::Student.find(params[:id])\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to user_student_path(@user, @student), notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: user_student_path(@user, @student) }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student, :notice => 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @student.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student, :notice => 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @student.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n # @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @student = Student.find(params[:id])\n @student.update_attributes(params[:student])\n end", "def update\n if @student.update(student_params)\n render :show, status: :ok, location: @student\n else\n render json: @student.errors, status: :unprocessable_entity\n end\n end", "def update\n student = Student.find(params[:id])\n if student.update(student_params)\n render json: { status: '200', message: \"Updated Student with id #{params[:id]}\", data: student }, status: :ok\n else\n render json: { status: '422', error: 'Student not updated', data: student.errors }, status: :unprocessable_entity\n end\n rescue ActiveRecord::RecordNotFound\n render json: { status: '404', error: \"No Student with id #{params[:id]}\", data: student }, status: :not_found\n end", "def update\n respond_to do |format|\n if @student_entity.update(student_entity_params)\n format.json { render :show, status: :ok, location: @student_entity }\n else\n format.json { render json: @student_entity.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to students_url, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student,\n notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors,\n status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: \"Student was successfully updated.\" }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: \"Student was successfully updated.\" }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: \"Student was successfully updated.\" }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\r\n @student1 = Student1.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @student1.update_attributes(params[:student1])\r\n format.html { redirect_to @student1, notice: 'Student1 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: @student1.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n student_ids = params[:student_ids].to_a\n student_ids.each_with_index do |student_id|\n student = Student.where(id: student_id.to_i).first\n @team.students << student\n end\n end", "def update\n Student.find(params[:id]).update(student_params)\n redirect_to \"/dojos\"\n end", "def update\n @student_user = StudentUser.find(params[:id])\n\n respond_to do |format|\n if @student_user.update_attributes(params[:student_user])\n format.html { redirect_to @student_user, notice: 'Student user was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student_user.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to login_index_path, notice: 'Elev adus la zi.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @student = Student.find(params[:student_id])\n @inschool = @student.inschools.find(params[:id])\n\n respond_to do |format|\n if @inschool.update_attributes(params[:inschool])\n format.html { redirect_to :back, notice: 'Inschool was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @inschool.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @student_type = StudentType.find(params[:id])\n\n if @student_type.update(student_type_params)\n head :no_content\n else\n render json: @student_type.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to lop_students_url, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @student = Student.find(params[:id])\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Студент був успішно оновлений.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @people_student.update(people_student_params)\n format.html { redirect_to @people_student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @people_student }\n else\n format.html { render :edit }\n format.json { render json: @people_student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @dojo_student = DojoStudent.find(params[:id])\n\n respond_to do |format|\n if @dojo_student.update_attributes(params[:dojo_student])\n format.html { redirect_to @dojo_student, notice: 'Dojo student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dojo_student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n flash[:success] = t('student.updated')\n format.html { redirect_to(students_path) }\n format.xml { head :ok }\n else\n flash[:error] = t('default_error_message')\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to [:admin, @student], notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @admin.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @student_major = StudentMajor.find(params[:id])\n\n respond_to do |format|\n if @student_major.update_attributes(student_major_params)\n format.html { redirect_to @student_major, notice: 'Student major was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student_major.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Estudiante ha sido satisfactoriamente actualizado.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @student = current_user.students.find(params[:id])\n respond_to do |format|\n if @student.update_attributes(params[:student])\n flash[:notice] = 'Student record is successfully updated.'\n format.html { redirect_to(students_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to school_student_path(@student.school,@student), notice: 'Student update successful.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'El estudiante fue actualizado.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to manage_school_school_path(@school), notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Se actualizó el registro de alumna satisfactoriamente.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @student = current_user.teacher.students.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n StdTeacher.where(\"idStd = ? AND idTeacher = ?\", @student.id, current_user.teacher.id).update_all(idGroup: @student.idGroup)\n format.html { redirect_to students_path, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to(@student, :notice => 'Student was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @indexstudent = Indexstudent.find(params[:id])\n\n respond_to do |format|\n if @indexstudent.update_attributes(params[:indexstudent])\n format.html { redirect_to @indexstudent, notice: 'Indexstudent was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @indexstudent.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to admissions_url, success: 'Student record was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @student = set_student\n @student.update(students_params(:first_name,:last_name))\n redirect_to student_path(@student)\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to admin_student_path(@student), notice: 'student was successfully updated.' }\n format.json { render action: 'show', status: :updated, location: @student }\n #format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n flash[:notice] = 'Student was successfully updated.'\n format.html { redirect_to(@student) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n flash[:notice] = 'Student was successfully updated.'\n format.html { redirect_to(@student) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n flash[:notice] = 'Student was successfully updated.'\n format.html { redirect_to(@student) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(admin_student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @manage_student.update(manage_student_params)\n format.html { redirect_to @manage_student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @manage_student }\n else\n format.html { render :edit }\n format.json { render json: @manage_student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @student_test = StudentTest.find(params[:id])\n\n respond_to do |format|\n if @student_test.update_attributes(params[:student_test])\n format.html { redirect_to @student_test, notice: 'Student test was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student_test.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student_interest.update(student_interest_params)\n format.html { redirect_to @student_interest, notice: 'Student interest was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @student_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student, notice: '学生资料更新成功.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student]) and\n @student.usuario.update_attributes(params[:student][:usuario_attributes])\n format.html { redirect_to [:admin, @student], notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: \"Student was successfully updated.\" }\n else\n format.html { render :edit, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @admin_student.update(admin_student_params)\n format.html { redirect_to @admin_student, notice: \"Student was successfully updated.\" }\n format.json { render :show, status: :ok, location: @admin_student }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @admin_student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @exam_student.update(exam_student_params)\n format.html { redirect_to @exam_student, notice: 'Exam student was successfully updated.' }\n format.json { render :show, status: :ok, location: @exam_student }\n else\n format.html { render :edit }\n format.json { render json: @exam_student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\t\t#for each student, find the student using student id\n\t\t@student = Student.find(params[:id])\n\t\t#update the student using the student params\n\t\t@student.update(student_params)\n\t\t#go back to the student path when done\n\t\tredirect_to student_path(@student)\n\t#wraps up \"update\" action\n\tend", "def update\n @enrolled_student = EnrolledStudent.find(params[:id])\n\n respond_to do |format|\n if @enrolled_student.update_attributes(params[:enrolled_student])\n format.html { redirect_to @enrolled_student, notice: 'Enrolled student was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @enrolled_student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n\n if @student.update_attributes(params[:student])\n format.html {render :action=>\"show\"}#redirect_to(\"/students/#{@student.id}\")\n else \n format.html { render :action =>\"edit\"}\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n\n end\n\n end", "def update\n\tif session[:user].nil?\n\t\tredirect_to('/login/login')\n\tend\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to(@student, :notice => 'Student was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student_id.update(student_id_params)\n if @enrolment\n format.html { redirect_to enrolment_student_ids_path(@enrolment), notice: 'Student was successfully updated.' }\n else\n format.html { redirect_to @student_id, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student_id }\n end\n else\n format.html { render :edit }\n format.json { render json: @student_id.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @studentset = Studentset.find(params[:id])\n\n respond_to do |format|\n if @studentset.update_attributes(params[:studentset])\n format.html { redirect_to @studentset, notice: 'Studentset was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @studentset.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @find_student.update(find_student_params)\n format.html { redirect_to @find_student, notice: 'Find student was successfully updated.' }\n format.json { render :show, status: :ok, location: @find_student }\n else\n format.html { render :edit }\n format.json { render json: @find_student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student.update(student_params)\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n add_model_error_to_flash @student\n format.html { render :edit }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @student = Student.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to(@student, :notice => 'Alumno guardado con éxito.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @online_student = OnlineStudent.find(params[:id])\n\n respond_to do |format|\n if @online_student.update_attributes(params[:online_student])\n format.html { redirect_to @online_student, notice: 'Online student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @online_student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @class_student.update(class_student_params)\n format.html { redirect_to @class_student, notice: 'Class student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @class_student.errors, status: :unprocessable_entity }\n end\n end\n end", "def put(*args)\n request :put, *args\n end", "def update_student(id, fields)\n list = query_student(:id => id)\n list[0].merge(fields) if list.length == 1\n save_data\n end", "def update\n @student = Student.find(params[:id])\n\n if (@student.family_id && @student.family_id > 0)\n @family = Family.find(@student.family_id)\n end\n\n @resound_process = ResoundProcess.find_by_student_id(@student.id)\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n current_student.update_attributes!(student_params)\n redirect_to student_path, notice: 'Update was successful!'\n end", "def update\n respond_to do |format|\n if @studentinfo.update(studentinfo_params)\n format.html { redirect_to @studentinfo, notice: 'Studentinfo was successfully updated.' }\n format.json { render :show, status: :ok, location: @studentinfo }\n else\n format.html { render :edit }\n format.json { render json: @studentinfo.errors, status: :unprocessable_entity }\n end\n end\n end", "def put!\n request! :put\n end", "def update\n @student = current_district.students.find(params[:id])\n\n respond_to do |format|\n if @student.update_attributes(params[:student])\n flash[:notice] = \"#{edit_obj_link(@student)} was successfully updated.\".html_safe\n format.html { redirect_to(index_url_with_page) }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end" ]
[ "0.7224749", "0.6994907", "0.6908403", "0.69019437", "0.68976754", "0.688167", "0.688167", "0.6871342", "0.6871342", "0.6871342", "0.6871342", "0.6871342", "0.68621904", "0.68586385", "0.679477", "0.6747145", "0.66869766", "0.6664319", "0.66471314", "0.66471314", "0.66471314", "0.66471314", "0.66471314", "0.66471314", "0.66471314", "0.66471314", "0.66471314", "0.66471314", "0.66471314", "0.66471314", "0.66471314", "0.66471314", "0.66471314", "0.66471314", "0.66471314", "0.6641787", "0.6641602", "0.6641602", "0.6641602", "0.66201067", "0.66201067", "0.66201067", "0.65852135", "0.6561423", "0.6525334", "0.6499478", "0.648758", "0.6487238", "0.6485199", "0.64755464", "0.64717233", "0.64706564", "0.6469952", "0.6463142", "0.6463142", "0.6456478", "0.64529073", "0.6444644", "0.64414656", "0.6434185", "0.6431226", "0.6427138", "0.6422372", "0.6406241", "0.6401256", "0.63991827", "0.6389006", "0.637877", "0.63618505", "0.6357043", "0.6334674", "0.6334674", "0.6334674", "0.6325575", "0.63137484", "0.6311403", "0.63095874", "0.6308565", "0.6298875", "0.62749654", "0.627339", "0.6250547", "0.62435395", "0.6241937", "0.62368447", "0.62334615", "0.6228328", "0.6225528", "0.62245524", "0.6223741", "0.6218563", "0.6195791", "0.61884445", "0.6179527", "0.61769736", "0.61648905", "0.61569816", "0.6143456", "0.61345863", "0.6107514" ]
0.65117097
45
DELETE /students/1 DELETE /students/1.json
def destroy gclass = Gclass.findClassIdByStudent params[:id] @stu = Student.destroy_student params[:id] redirect_to "/gclasses/#{gclass}", notice: "Student destroyed." end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @student.delete\n respond_to do |format|\n format.html { redirect_to students_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @student = Student.find(params[:id])\n @student.destroy\n\n respond_to do |format|\n format.html { redirect_to students_url }\n format.json { head :ok }\n end\n end", "def destroy\n # @student = Student.find(params[:id])\n @student.destroy\n\n respond_to do |format|\n format.html { redirect_to students_url }\n format.json { head :ok }\n end\n end", "def destroy\n @student = Student.find(params[:id])\n @student.destroy\n\n respond_to do |format|\n format.html { redirect_to students_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @student = Student.find(params[:id])\n @student.destroy\n\n respond_to do |format|\n format.html { redirect_to students_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @student = Student.find(params[:id])\n @student.destroy\n\n respond_to do |format|\n format.html { redirect_to students_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @student = Student.find(params[:id])\n @student.destroy\n\n respond_to do |format|\n format.html { redirect_to students_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @student = Student.find(params[:id])\n @student.destroy\n\n respond_to do |format|\n format.html { redirect_to students_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @student = Student.find(params[:id])\n @student.destroy\n\n respond_to do |format|\n format.html { redirect_to students_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @student = Student.find(params[:id])\n @student.destroy\n\n respond_to do |format|\n format.html { redirect_to students_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @student = Student.find(params[:id])\n @student.destroy\n\n respond_to do |format|\n format.html { redirect_to students_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @student = Student.find(params[:id])\n @student.destroy\n\n respond_to do |format|\n format.html { redirect_to students_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url }\n format.json { head :no_content }\n end\n end", "def destroy\n student.destroy\n respond_to do |format|\n format.html { redirect_to admin_students_path }\n format.json { head :no_content }\n end\n end", "def destroy\n Student.delete(params[:id])\n respond_to do |format|\n format.html { redirect_to students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @dojo_student = DojoStudent.find(params[:id])\n @dojo_student.destroy\n\n respond_to do |format|\n format.html { redirect_to dojo_students_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: \"Student was successfully deleted.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: \"Student was successfully removed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @student_entity.destroy\n render json: {msg: 'deleted successfully'}, status: 200\n end", "def destroy\n @student = Student.find(params[:id])\n @student.destroy\n\n respond_to do |format|\n format.html { redirect_to login_index_url }\n format.json { head :ok }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to user_students_url(@user), notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @student1 = Student1.find(params[:id])\r\n @student1.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to student1s_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def delete\n\n @student = Student.find(params[:id])\n @student.destroy\n redirect_to \"/students/\"\n\n end", "def destroy\n begin\n student = Student.find(params[:id])\n student.destroy!\n\n render json: {status: 'SUCCESS', message:\"Student deleted Successfully with name #{student.name}\"}, status: :ok\n rescue => error\n render json: {status: 'ERROR', message:'Student Update failed!', data:error}, status: :unprocessable_entity\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: 'Se borró el registro de alumna satisfactoriamente.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @indexstudent = Indexstudent.find(params[:id])\n @indexstudent.destroy\n\n respond_to do |format|\n format.html { redirect_to indexstudents_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url,\n notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: \"Student was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: \"Student was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: \"Student was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student = @current_lop.students.find(params[:id])\n if @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html {\n flash[:success] = \"Estudante apagado.\"\n redirect_to students_url\n }\n format.json { head :no_content }\n end\n end", "def destroy\n @student = current_user.students.find(params[:id])\n @student.destroy\n respond_to do |format|\n format.html { redirect_to(students_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to import_students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student_user = StudentUser.find(params[:id])\n @student_user.destroy\n\n respond_to do |format|\n format.html { redirect_to student_users_url }\n format.json { head :no_content }\n end\n end", "def destroy\n\t\tStudent.delete_student_by_id(params[:id])\n\n\t\trender :json => params[:id]\n\tend", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: '生徒情報は削除されました' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student = Student.find(params[:id])\n @student.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_students_url, notice: 'Student was successfully destroyed' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to active_students_url, notice: 'Student was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student = Student.find(params[:id])\n @student.destroy\n\n respond_to do |format|\n format.html { redirect_to(students_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @student = Student.find(params[:id])\n @student.destroy\n\n respond_to do |format|\n format.html { redirect_to(students_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @student = Student.find(params[:id])\n @student.destroy\n\n respond_to do |format|\n format.html { redirect_to(students_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @student = Student.find(params[:id])\n @student.destroy\n\n respond_to do |format|\n format.html { redirect_to(students_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @student = Student.find(params[:id])\n @student.destroy\n\n respond_to do |format|\n format.html { redirect_to(students_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @student = Student.find(params[:id])\n @student.destroy\n\n respond_to do |format|\n format.html { redirect_to(students_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to admin_students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to admin_students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to admin_students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to @student.school, notice: 'Student deletion successful.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student = Student.find(params[:id])\n @student.destroy\n flash[:notice] = \"Student has been deleted successfully\"\n respond_to do |format|\n format.html { redirect_to students_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to group_students_path(@group), notice: 'Student was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student = Student.find(params[:id])\n id = @student.usuario_id\n @usuario = Usuario.find(id)\n @usuario.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_students_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to visitors_url, notice: 'El estudiante fue borrado.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student_test = StudentTest.find(params[:id])\n @student_test.destroy\n\n respond_to do |format|\n format.html { redirect_to student_tests_url }\n format.json { head :ok }\n end\n end", "def destroy\n Student.find(params[:id]).destroy\n # respond_to do |format|\n # format.html { redirect_to student_url, notice: 'Student was successfully removed.' }\n # format.json { head :no_content }\n # end\n redirect_to students_path\n end", "def destroy\n @people_student.destroy\n respond_to do |format|\n format.html { redirect_to people_students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @class_student.destroy\n respond_to do |format|\n format.html { redirect_to class_students_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @student = Student.find(params[:id])\n @student.destroy\n end", "def destroy\n @student_interest.destroy\n respond_to do |format|\n format.html { redirect_to student_interests_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student = Student.find(params[:id])\n @student.destroy\n respond_to do |format|\n format.html { redirect_to students_url, notice: 'Студент був видалений.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student = Student.find(params[:student_id])\n @lunchdetention = Lunchdetention.find(params[:id])\n @lunchdetention.destroy\n\n respond_to do |format|\n format.html { redirect_to student_url(@student) }\n format.json { head :no_content }\n end\n end", "def destroy\n @admin_student.destroy\n respond_to do |format|\n format.html { redirect_to admin_students_url, notice: \"Student was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @manage_student.destroy\n respond_to do |format|\n format.html { redirect_to manage_students_url, notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student_major = StudentMajor.find(params[:id])\n @student_major.destroy\n\n respond_to do |format|\n format.html { redirect_to student_majors_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @studentgrade = Studentgrade.find(params[:id])\n @studentgrade.destroy\n\n respond_to do |format|\n format.html { redirect_to students_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @student = Student.find(params[:student_id])\n @inschool = Inschool.find(params[:id])\n @inschool.destroy\n\n respond_to do |format|\n format.html { redirect_to student_url(@student) }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n format.html { redirect_to manage_school_school_path(@school), notice: 'Student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student.destroy\n respond_to do |format|\n flash[:notice] = 'Record mahasiswa berhasil dihapus, #{undo_link(@student)}'\n format.html { redirect_to students_url }\n format.json { head :no_content }\n end\n end", "def destroy\n delete_with_references(@student,students_path)\n end", "def destroy\n @find_student.destroy\n respond_to do |format|\n format.html { redirect_to find_students_url, notice: 'Find student was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @online_student = OnlineStudent.find(params[:id])\n @online_student.destroy\n\n respond_to do |format|\n format.html { redirect_to online_students_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @enrolled_student = EnrolledStudent.find(params[:id])\n @enrolled_student.destroy\n\n respond_to do |format|\n format.html { redirect_to enrolled_students_url }\n format.json { head :ok }\n end\n end", "def destroy\n StdTeacher.where(\"idStd = ? AND idTeacher = ?\", params[:id], current_user.teacher.id).delete_all\n #@student = current_user.teacher.students.find(params[:id])\n #@student.destroy\n\n respond_to do |format|\n format.html { redirect_to students_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @student = Student.find(params[:id])\n @student.destroy\n redirect_to students_path\n end" ]
[ "0.78189677", "0.7671591", "0.7663451", "0.76590925", "0.7656559", "0.7656559", "0.7656559", "0.7656559", "0.7656559", "0.7656559", "0.7656559", "0.7656559", "0.76210016", "0.76210016", "0.76210016", "0.76210016", "0.7596511", "0.7527479", "0.7474381", "0.74670345", "0.74657214", "0.7436673", "0.7429383", "0.74029773", "0.7402762", "0.7365853", "0.7350311", "0.73380286", "0.7337508", "0.7334012", "0.7331625", "0.7331625", "0.7331625", "0.73301256", "0.73301256", "0.73301256", "0.73301256", "0.73301256", "0.73301256", "0.73301256", "0.73301256", "0.73301256", "0.73301256", "0.73301256", "0.73301256", "0.73301256", "0.73301256", "0.73301256", "0.73301256", "0.73301256", "0.73301256", "0.73301256", "0.73301256", "0.73301256", "0.73301256", "0.73301256", "0.7328982", "0.73135406", "0.73094577", "0.73089963", "0.729855", "0.72849154", "0.72802883", "0.7276763", "0.7269418", "0.72563416", "0.72563416", "0.72563416", "0.72563416", "0.72563416", "0.72563416", "0.7248087", "0.7248087", "0.7248087", "0.7245499", "0.72396886", "0.7227089", "0.7223203", "0.72103417", "0.7210215", "0.7199589", "0.71952444", "0.7192329", "0.7184763", "0.7176694", "0.7176233", "0.7163803", "0.714964", "0.7111615", "0.7106181", "0.71009827", "0.7093194", "0.70882285", "0.70844805", "0.7075086", "0.7060988", "0.7058718", "0.7056978", "0.70479053", "0.7045811", "0.7045361" ]
0.0
-1
GET /team_years GET /team_years.json
def index @team_years = TeamYear.all # ## Get TeamYears grouped by year # @year_groups = {} # get unique team_years @yrs = @team_years.map{|ty| ty.year }.uniq! # for each unique season @yrs.each{|yr| # create the array we'll feed the final hash @year_bucket = [] # for each team_season in each year @team_years.where( year: yr).each{|row| @year_bucket << row.attributes } @year_groups[yr.to_sym] = @year_bucket#.sort_by{|hsh| -hsh[:year] } } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_team_years_participated ( team_key )\n get_api_resource \"#{@@api_base_url}team/#{team_key}/years_participated\"\n end", "def index\n @team_years = TeamYear.all\n end", "def years(make)\n make_id = get_object_id make\n response = get_url \"Years/#{make_id}\"\n response_obj = JSON.parse response\n response_obj[\"GetYearsResult\"].map{|r| r[\"Year\"]}\n end", "def get_district_teams ( district_key, year )\n get_api_resource \"#{@@api_base_url}district/#{district_key}/#{year}/teams\"\n end", "def get_team_years_participated_with_http_info(team_key, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TeamApi.get_team_years_participated ...'\n end\n # verify the required parameter 'team_key' is set\n if @api_client.config.client_side_validation && team_key.nil?\n fail ArgumentError, \"Missing the required parameter 'team_key' when calling TeamApi.get_team_years_participated\"\n end\n # resource path\n local_var_path = '/team/{team_key}/years_participated'.sub('{' + 'team_key' + '}', CGI.escape(team_key.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[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<Integer>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['apiKey']\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(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TeamApi#get_team_years_participated\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def uni_years\n @uni_years = UniYear.where(university_id: params[:university_id])\n \n respond_to do |format|\n format.json { render json: @uni_years }\n end\n end", "def get_teams_by_year_with_http_info(year, page_num, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TeamApi.get_teams_by_year ...'\n end\n # verify the required parameter 'year' is set\n if @api_client.config.client_side_validation && year.nil?\n fail ArgumentError, \"Missing the required parameter 'year' when calling TeamApi.get_teams_by_year\"\n end\n # verify the required parameter 'page_num' is set\n if @api_client.config.client_side_validation && page_num.nil?\n fail ArgumentError, \"Missing the required parameter 'page_num' when calling TeamApi.get_teams_by_year\"\n end\n # resource path\n local_var_path = '/teams/{year}/{page_num}'.sub('{' + 'year' + '}', CGI.escape(year.to_s)).sub('{' + 'page_num' + '}', CGI.escape(page_num.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[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<Team>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['apiKey']\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(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TeamApi#get_teams_by_year\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def years_by_make(make)\n make_request :get, '/years/byMake/' + make.to_s\n end", "def common_team_years(\n league_id=NbaStats::Constants::LEAGUE_ID_NBA\n )\n NbaStats::Resources::CommonTeamYears.new(\n get(COMMON_TEAM_YEARS_PATH, {\n :LeagueID => league_id\n })\n )\n end", "def index\n @years = Year.all\n end", "def index\n @years = Year.all\n end", "def index\n @ab_teams = AbTeam.all\n @years = AbTeam.pluck(:year).map{|x| x}.uniq.sort\n \n end", "def get_team_years_participated(team_key, opts = {})\n data, _status_code, _headers = get_team_years_participated_with_http_info(team_key, opts)\n data\n end", "def organization_teams\n get(\"/organizations/#{@default_org_slug}/teams/\")\n end", "def set_team_year\n @team_year = TeamYear.find(params[:id])\n end", "def set_team_year\n @team_year = TeamYear.find(params[:id])\n end", "def get_years\n year = slice_year\n till_year = year.to_i - @past_years\n years = []\n year.to_i.downto(till_year) { |y| years << y }\n years\n end", "def season(year, **options) = get(\"/seasons/#{year}\", **{ sportId: 1 }.merge(options))", "def index\n @built_years = BuiltYear.all\n end", "def get_teams_by_year_keys_with_http_info(year, page_num, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TeamApi.get_teams_by_year_keys ...'\n end\n # verify the required parameter 'year' is set\n if @api_client.config.client_side_validation && year.nil?\n fail ArgumentError, \"Missing the required parameter 'year' when calling TeamApi.get_teams_by_year_keys\"\n end\n # verify the required parameter 'page_num' is set\n if @api_client.config.client_side_validation && page_num.nil?\n fail ArgumentError, \"Missing the required parameter 'page_num' when calling TeamApi.get_teams_by_year_keys\"\n end\n # resource path\n local_var_path = '/teams/{year}/{page_num}/keys'.sub('{' + 'year' + '}', CGI.escape(year.to_s)).sub('{' + 'page_num' + '}', CGI.escape(page_num.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[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<String>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['apiKey']\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(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TeamApi#get_teams_by_year_keys\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def team_year_params\n params.require(:team_year).permit(:year, :team, :wins, :losses, :win_percentage, :offensive_rating, :defensive_rating, :season_outcome, :team_url, :team_home_url)\n end", "def get_team_matches_by_year_with_http_info(team_key, year, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TeamApi.get_team_matches_by_year ...'\n end\n # verify the required parameter 'team_key' is set\n if @api_client.config.client_side_validation && team_key.nil?\n fail ArgumentError, \"Missing the required parameter 'team_key' when calling TeamApi.get_team_matches_by_year\"\n end\n # verify the required parameter 'year' is set\n if @api_client.config.client_side_validation && year.nil?\n fail ArgumentError, \"Missing the required parameter 'year' when calling TeamApi.get_team_matches_by_year\"\n end\n # resource path\n local_var_path = '/team/{team_key}/matches/{year}'.sub('{' + 'team_key' + '}', CGI.escape(team_key.to_s)).sub('{' + 'year' + '}', CGI.escape(year.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[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<Match>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['apiKey']\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(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TeamApi#get_team_matches_by_year\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_team ( team_key )\n get_api_resource \"#{@@api_base_url}team/#{team_key}\"\n end", "def get_team_list ( page = 1 )\n get_api_resource \"#{@@api_base_url}teams/#{page}\"\n end", "def team\n @team = Team.find(params[:team_id])\n set_date_and_year\n @results = Result.all(\n :conditions => [ \"team_id = ? and year = ? and competition_result = false and team_competition_result = false\", @team.id, @date.year ]\n )\n respond_to do |format|\n format.html\n format.json { render :json => @results.to_json }\n format.xml { render :xml => @results.to_xml }\n end\n end", "def index\n @years = Year.order(:id)\n end", "def get_team_matches_by_year_with_http_info(team_key, year, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: MatchApi.get_team_matches_by_year ...'\n end\n # verify the required parameter 'team_key' is set\n if @api_client.config.client_side_validation && team_key.nil?\n fail ArgumentError, \"Missing the required parameter 'team_key' when calling MatchApi.get_team_matches_by_year\"\n end\n # verify the required parameter 'year' is set\n if @api_client.config.client_side_validation && year.nil?\n fail ArgumentError, \"Missing the required parameter 'year' when calling MatchApi.get_team_matches_by_year\"\n end\n # resource path\n local_var_path = '/team/{team_key}/matches/{year}'.sub('{' + 'team_key' + '}', CGI.escape(team_key.to_s)).sub('{' + 'year' + '}', CGI.escape(year.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[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<Match>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['apiKey']\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(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: MatchApi#get_team_matches_by_year\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def teams\n render json: @team_query\n end", "def index\n @time_of_years = TimeOfYear.all\n end", "def get_teams_by_year_simple_with_http_info(year, page_num, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TeamApi.get_teams_by_year_simple ...'\n end\n # verify the required parameter 'year' is set\n if @api_client.config.client_side_validation && year.nil?\n fail ArgumentError, \"Missing the required parameter 'year' when calling TeamApi.get_teams_by_year_simple\"\n end\n # verify the required parameter 'page_num' is set\n if @api_client.config.client_side_validation && page_num.nil?\n fail ArgumentError, \"Missing the required parameter 'page_num' when calling TeamApi.get_teams_by_year_simple\"\n end\n # resource path\n local_var_path = '/teams/{year}/{page_num}/simple'.sub('{' + 'year' + '}', CGI.escape(year.to_s)).sub('{' + 'page_num' + '}', CGI.escape(page_num.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[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<TeamSimple>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['apiKey']\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(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TeamApi#get_teams_by_year_simple\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def teams(org)\n get \"/orgs/#{org}/teams\"\n end", "def set_league_year\n @league_year = LeagueYear.find(params[:id])\n end", "def team_year_params\n params.require(:team_year).permit(:athlete_id, :team_id, :year)\n end", "def index\n @acedemic_years = AcedemicYear.all\n end", "def index\n @teams = @organization.teams\n end", "def index\n @teams = Team.all\n render json: @teams\n end", "def get_year\n @year ||= params[:year] ? params[:year].to_i : Time.now.year\n end", "def get_content_years\n @board = Board.find(params[:id]) rescue nil\n #list = ContentYear.where(:board_id => @Board.id,:publisher_id => current_user.id).map {|u| Hash[value: u.id, name: u.name]}\n list = @board.content_years.map {|u| Hash[value: u.id, name: u.name]} rescue []\n render json: list\n end", "def index\n @teams = @club.teams\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end", "def get_teams_by_league(league_id)\n response = parse_api_request(\"#{BASE_URL}teams/league/#{league_id}\")[\"teams\"]\nend", "def index\n @sponsor_years = SponsorYear.all\n end", "def index\n @schoolyears = Schoolyear.all\n end", "def get_team_events_statuses_by_year_with_http_info(team_key, year, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TeamApi.get_team_events_statuses_by_year ...'\n end\n # verify the required parameter 'team_key' is set\n if @api_client.config.client_side_validation && team_key.nil?\n fail ArgumentError, \"Missing the required parameter 'team_key' when calling TeamApi.get_team_events_statuses_by_year\"\n end\n # verify the required parameter 'year' is set\n if @api_client.config.client_side_validation && year.nil?\n fail ArgumentError, \"Missing the required parameter 'year' when calling TeamApi.get_team_events_statuses_by_year\"\n end\n # resource path\n local_var_path = '/team/{team_key}/events/{year}/statuses'.sub('{' + 'team_key' + '}', CGI.escape(team_key.to_s)).sub('{' + 'year' + '}', CGI.escape(year.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[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Hash<String, TeamEventStatus>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['apiKey']\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(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TeamApi#get_team_events_statuses_by_year\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_games(year, input)\r\n page = 1\r\n query = 'https://www.balldontlie.io/api/v1/games' + '?seasons[]=' + year.to_s + '&team_ids[]=' + input.to_s + '&page=' + page.to_s\r\n response_meta = HTTParty.get(query)[\"meta\"]\r\n response_data = HTTParty.get(query)[\"data\"]\r\n total_pages = response_meta[\"total_pages\"]\r\n games_hash = {}\r\n\r\n while page <= total_pages\r\n\r\n #Go back and maximize the per_page limit to minimize the number of calls\r\n query = 'https://www.balldontlie.io/api/v1/games' + '?seasons[]=' + year.to_s + '&team_ids[]=' + input.to_s + '&page=' + page.to_s + '&per_page=50'\r\n HTTParty.get(query)[\"data\"].each do |i|\r\n\r\n\r\n #change formatting of date\r\n date = i[\"date\"].split(\"-\")\r\n day_value = date[2].split(/T/).shift\r\n key_date = \"#{date[0]}/#{date[1]}/#{day_value}\"\r\n formatted_date = \"#{date[1]}/#{day_value}/#{date[0]}\"\r\n\r\n \r\n\r\n games_hash[key_date] = {\r\n \"date\" => formatted_date,\r\n \"home_team\" => i[\"home_team\"][\"full_name\"],\r\n \"visitor_team\" => i[\"visitor_team\"][\"full_name\"],\r\n \"home_team_score\" => i[\"home_team_score\"],\r\n \"visitor_team_score\" => i[\"visitor_team_score\"]\r\n }\r\n \r\n\r\n end\r\n page += 1 \r\n end\r\n games_hash\r\n end", "def competition_by_year\n \tresult = CompetitionResult.group_by_year(:created_at, format: '%Y').count\n \trender json: [{ name: 'Count', data: result}]\n end", "def security_advisories_year_year_get_with_http_info(year, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi.security_advisories_year_year_get ...\"\n end\n # verify the required parameter 'year' is set\n if @api_client.config.client_side_validation && year.nil?\n fail ArgumentError, \"Missing the required parameter 'year' when calling DefaultApi.security_advisories_year_year_get\"\n end\n # resource path\n local_var_path = \"/security/advisories/year/{year}\".sub('{' + 'year' + '}', year.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'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['psirt_openvuln_api_auth']\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 if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#security_advisories_year_year_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_team_awards_by_year_with_http_info(team_key, year, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TeamApi.get_team_awards_by_year ...'\n end\n # verify the required parameter 'team_key' is set\n if @api_client.config.client_side_validation && team_key.nil?\n fail ArgumentError, \"Missing the required parameter 'team_key' when calling TeamApi.get_team_awards_by_year\"\n end\n # verify the required parameter 'year' is set\n if @api_client.config.client_side_validation && year.nil?\n fail ArgumentError, \"Missing the required parameter 'year' when calling TeamApi.get_team_awards_by_year\"\n end\n # resource path\n local_var_path = '/team/{team_key}/awards/{year}'.sub('{' + 'team_key' + '}', CGI.escape(team_key.to_s)).sub('{' + 'year' + '}', CGI.escape(year.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[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<Award>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['apiKey']\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(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TeamApi#get_team_awards_by_year\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @grad_years = GradYear.all\n end", "def team\n @team = Team.find(params[:team_id])\n set_date_and_year\n @results = Result.all(\n :conditions => [ \"team_id = ? and year = ? and competition_result = false and team_competition_result = false\", @team.id, @date.year ]\n )\n end", "def years(tech=nil) \n if tech\n tdata = nil\n @techs.each do |t|\n if t.name == tech\n tdata = t\n end\n end\n if tdata\n return tdata.years\n else\n return 0\n end\n # TODO: return just the time we worked with that technology\n end\n return (@to - @from).to_i / 365\n end", "def index\n @teams = Team.all\n render :json => @teams\n end", "def year_ranking\n ranked_albums = SortCollection.sort_albums('year')\n render json: ranked_albums.sort_by(&:last).reverse[0...5].to_h, status: 200\n end", "def index\n @mp_years = MpYear.all\n end", "def get_players_by_team(team_id)\n response = parse_api_request(\"#{BASE_URL}players/2018/#{team_id}\")[\"players\"]\nend", "def get_teams\r\n response = HTTParty.get('https://www.balldontlie.io/api/v1/teams')[\"data\"]\r\n response.each do |i|\r\n team = Team.new\r\n \r\n team.full_name = i[\"full_name\"]\r\n team.division = i[\"division\"]\r\n team.conference = i[\"conference\"]\r\n\r\n team.save\r\n\r\n end \r\n end", "def get_teams_by_year(year, page_num, opts = {})\n data, _status_code, _headers = get_teams_by_year_with_http_info(year, page_num, opts)\n data\n end", "def academic_years\n Education::AcademicYear.where(id: education_cohorts.pluck(:academic_year_id))\n end", "def index\n @firework_years = FireworkYear.all\n end", "def timeyears\n if self[:timeyears].nil?\n return \"\"\n else\n return self[:timeyears].to_i.to_s\n end\n end", "def get_team_matches_by_year_keys_with_http_info(team_key, year, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TeamApi.get_team_matches_by_year_keys ...'\n end\n # verify the required parameter 'team_key' is set\n if @api_client.config.client_side_validation && team_key.nil?\n fail ArgumentError, \"Missing the required parameter 'team_key' when calling TeamApi.get_team_matches_by_year_keys\"\n end\n # verify the required parameter 'year' is set\n if @api_client.config.client_side_validation && year.nil?\n fail ArgumentError, \"Missing the required parameter 'year' when calling TeamApi.get_team_matches_by_year_keys\"\n end\n # resource path\n local_var_path = '/team/{team_key}/matches/{year}/keys'.sub('{' + 'team_key' + '}', CGI.escape(team_key.to_s)).sub('{' + 'year' + '}', CGI.escape(year.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[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<String>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['apiKey']\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(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TeamApi#get_team_matches_by_year_keys\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def history_years_by_make(make)\n make_request :get, '/histyears/byMake/' + make.to_s\n end", "def index\n @teams = @competition.teams.sort_by{|t| t.number}\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end", "def get_winners\n json = get_json('http://oscars.yipitdata.com/')\n json.results.collect do |films_array|\n find_winner(films_array.films).tap do |winner|\n winner[:year] = films_array.year[0,4]\n end\n end\n end", "def show\n @player = Player.find(params[:id])\n if @player.games.count >= 1\n @last_team_name = @player.games.find(:last).team_name\n @year = @player.games.first.date.year\n @newest_year = @player.games.last.date.year\n else\n @last_team_name = \"Your team name\"\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player }\n end\n end", "def years_needed\n 30\n end", "def index\n @teams = Team.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end", "def index\n @teams = Team.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end", "def index\n @parliaments = Parliament.sorted_start_year\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @parliaments }\n end\n end", "def index\n game = Game.all\n\n render json: game, include: :teams\n end", "def index\n @teams = Team.page(params[:page])\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end", "def get_team_matches_by_year_keys_with_http_info(team_key, year, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: MatchApi.get_team_matches_by_year_keys ...'\n end\n # verify the required parameter 'team_key' is set\n if @api_client.config.client_side_validation && team_key.nil?\n fail ArgumentError, \"Missing the required parameter 'team_key' when calling MatchApi.get_team_matches_by_year_keys\"\n end\n # verify the required parameter 'year' is set\n if @api_client.config.client_side_validation && year.nil?\n fail ArgumentError, \"Missing the required parameter 'year' when calling MatchApi.get_team_matches_by_year_keys\"\n end\n # resource path\n local_var_path = '/team/{team_key}/matches/{year}/keys'.sub('{' + 'team_key' + '}', CGI.escape(team_key.to_s)).sub('{' + 'year' + '}', CGI.escape(year.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[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<String>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['apiKey']\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(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: MatchApi#get_team_matches_by_year_keys\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @teams = Team.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @teams }\n end\n end", "def index\n @teams = Team.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @teams }\n end\n end", "def years\n use_date = params[:dt] || \"created_at\"\n @age_limit = (params[:years] || \"2\").to_i.years.ago\n date_format = \"'%Y-%m'\"\n @dates = AudioMessage.active\n .where(\"audio_messages.#{use_date} > ?\",@age_limit)\n .group(\"date_format(audio_messages.#{use_date},#{date_format})\")\n .order(\"audio_messages.#{use_date} DESC\")\n .count\n @speakers_by_date = {}\n @dates.keys.each do |date|\n @speakers_by_date[date] =\n generate_speaker_list_with_counts_for_date(date,date_format,use_date)\n end\n # Peek at most recent load date\n @latest_addition_date = AudioMessage.maximum('created_at')\n end", "def year\n @year = params[:id].to_i\n date_format = \"'%Y'\"\n @speakers = generate_speaker_list_with_counts_for_date(@year,date_format,\"event_date\")\n end", "def index\n @leagues = League.all\n render json: @leagues, status: :ok\n end", "def team(id)\n get \"/teams/#{id}\"\n end", "def get_fbs_teams_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TeamsApi.get_fbs_teams ...'\n end\n # resource path\n local_var_path = '/teams/fbs'\n\n # query parameters\n query_params = {}\n query_params[:'year'] = opts[:'year'] if !opts[:'year'].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\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(: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 => 'Array<Team>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TeamsApi#get_fbs_teams\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def amy_years\n (Time.now.year - 1977).ordinalize\n end", "def year_groups\n respond_with get_tags_for_contexts([\"year_groups\"], params[:exclude_tags])\n end", "def destroy\n @team_year.destroy\n respond_to do |format|\n format.html { redirect_to team_years_url }\n format.json { head :no_content }\n end\n end", "def set_yearly_info\n @yearly_info = YearlyInfo.find(params[:id])\n end", "def year\n self.range('year')\n end", "def get_team_event_list ( team_key, year )\n get_api_resource \"#{@@api_base_url}team/#{team_key}/#{year}/events\"\n end", "def faith_years\n (Time.now.year - 1991).ordinalize\n end", "def index\n @year_groups = YearGroup.all\n end", "def league_year_params\n params.require(:league_year).permit(:league_id, :start_date, :end_date, :season_name, :season_type, :current_season, :season_year)\n end", "def years_count(make, model, raw_parameters={}, &block)\n Edmunds::Api.get(\"/api/vehicle/v2/#{make}/#{model}/years/count\") do |request|\n request.raw_parameters = raw_parameters\n\n request.allowed_parameters = {\n submodel: Edmunds::Vehicle::SUBMODEL_REGEX,\n category: Edmunds::Vehicle::VEHICLE_CATEGORIES,\n state: %w[new used future],\n year: ((1990.to_s)..(Date.current.year.to_s)),\n view: %w[basic full],\n fmt: %w[json]\n }\n\n request.default_parameters = { view: 'basic', fmt: 'json' }\n\n request.required_parameters = %w[fmt]\n\n request.result_function = block || ->(edmunds_hash) do\n edmunds_hash[:yearsCount]\n end\n end\n end", "def get_team_matches_by_year_simple_with_http_info(team_key, year, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TeamApi.get_team_matches_by_year_simple ...'\n end\n # verify the required parameter 'team_key' is set\n if @api_client.config.client_side_validation && team_key.nil?\n fail ArgumentError, \"Missing the required parameter 'team_key' when calling TeamApi.get_team_matches_by_year_simple\"\n end\n # verify the required parameter 'year' is set\n if @api_client.config.client_side_validation && year.nil?\n fail ArgumentError, \"Missing the required parameter 'year' when calling TeamApi.get_team_matches_by_year_simple\"\n end\n # resource path\n local_var_path = '/team/{team_key}/matches/{year}/simple'.sub('{' + 'team_key' + '}', CGI.escape(team_key.to_s)).sub('{' + 'year' + '}', CGI.escape(year.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[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<MatchSimple>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['apiKey']\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(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TeamApi#get_team_matches_by_year_simple\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_team_stats()\n query_params = { }\n headers = {}\n body = nil\n\n path = \"/team/stats\"\n\n @client.request(\n method: :get,\n path: path,\n query: query_params,\n headers: headers,\n body: body)\n end", "def get_teams( org )\n teams = Homework.get(\"/orgs/#{org}/teams\", :headers => @auth)\n teams.each do |team|\n puts team['id']\n end\n end", "def create\n @team_year = TeamYear.new(team_year_params)\n\n respond_to do |format|\n if @team_year.save\n format.html { redirect_to @team_year, notice: 'Team year was successfully created.' }\n format.json { render :show, status: :created, location: @team_year }\n else\n format.html { render :new }\n format.json { render json: @team_year.errors, status: :unprocessable_entity }\n end\n end\n end", "def school_years\n load_school_years\n @school_years.sort { |s1, s2| s1.start_date.year <=> s2.start_date.year } \n end", "def find_years(current_id)\n find(:all, :conditions => [\"#{_(:id)} <= ?\",current_id]).collect{ |y| [y.description] }\n end", "def get_teams_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TeamsApi.get_teams ...'\n end\n # resource path\n local_var_path = '/teams'\n\n # query parameters\n query_params = {}\n query_params[:'conference'] = opts[:'conference'] if !opts[:'conference'].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\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(: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 => 'Array<Team>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TeamsApi#get_teams\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_years_to_date_collection\n (get_system_asset_starting_year..Date.today.year).to_a\n end", "def get_project_teams(project_id_or_key)\n get(\"projects/#{project_id_or_key}/teams\")\n end", "def create\n @team_year = TeamYear.new(team_year_params)\n\n respond_to do |format|\n if @team_year.save\n format.html { redirect_to @team_year, notice: 'Team year was successfully created.' }\n format.json { render action: 'show', status: :created, location: @team_year }\n else\n format.html { render action: 'new' }\n format.json { render json: @team_year.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @variables = Variable.all\n @years = {'2011' => '', '2012' => '', '2013' => '', '2014' => ''}\n end", "def show\n @team = Team.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @league }\n end\n end" ]
[ "0.8241581", "0.744053", "0.71287674", "0.70271456", "0.7022471", "0.68313533", "0.66481465", "0.6623735", "0.66005033", "0.65320617", "0.65320617", "0.6421576", "0.6400581", "0.6306302", "0.62922055", "0.62922055", "0.6290931", "0.62324244", "0.62201345", "0.6197621", "0.61892134", "0.6185903", "0.61783034", "0.61685896", "0.6167948", "0.61140746", "0.6098589", "0.609102", "0.60647976", "0.60483897", "0.6048152", "0.6042444", "0.6029455", "0.60127723", "0.5998319", "0.5968131", "0.5967839", "0.5965354", "0.5962358", "0.59564966", "0.5953042", "0.5952464", "0.59514326", "0.5949847", "0.59459585", "0.5944536", "0.59347755", "0.5927207", "0.59127194", "0.59062886", "0.59061825", "0.5899287", "0.5894649", "0.5890075", "0.5880915", "0.5867029", "0.58648527", "0.58641165", "0.5861159", "0.5858313", "0.58446336", "0.58147097", "0.58043414", "0.57970876", "0.57806116", "0.5779031", "0.5779031", "0.57765114", "0.5766541", "0.5762704", "0.5759814", "0.57478094", "0.57478094", "0.5744612", "0.5738435", "0.5738164", "0.57374114", "0.57277894", "0.57263833", "0.57219005", "0.5718068", "0.5715961", "0.57139874", "0.57099646", "0.57064086", "0.57057935", "0.5703251", "0.57010347", "0.56966263", "0.5694585", "0.5694313", "0.5693694", "0.56921", "0.56861925", "0.56747174", "0.566676", "0.5661435", "0.56602216", "0.5657891", "0.5648987" ]
0.66145504
8
index GET /team_years/1 GET /team_years/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @team_years = TeamYear.all\n end", "def index\n @years = Year.all\n end", "def index\n @years = Year.all\n end", "def index\n @years = Year.order(:id)\n end", "def index\n @team_years = TeamYear.all\n\n #\n ## Get TeamYears grouped by year\n #\n @year_groups = {}\n\n # get unique team_years\n @yrs = @team_years.map{|ty| ty.year }.uniq!\n # for each unique season\n @yrs.each{|yr|\n # create the array we'll feed the final hash\n @year_bucket = []\n # for each team_season in each year\n @team_years.where( year: yr).each{|row|\n @year_bucket << row.attributes\n }\n @year_groups[yr.to_sym] = @year_bucket#.sort_by{|hsh| -hsh[:year] }\n }\n\n\n end", "def index\n @built_years = BuiltYear.all\n end", "def index\n @ab_teams = AbTeam.all\n @years = AbTeam.pluck(:year).map{|x| x}.uniq.sort\n \n end", "def get_team_years_participated ( team_key )\n get_api_resource \"#{@@api_base_url}team/#{team_key}/years_participated\"\n end", "def index\n @schoolyears = Schoolyear.all\n end", "def index\n @time_of_years = TimeOfYear.all\n end", "def index\n @teams = Team.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end", "def index\n @teams = Team.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end", "def index\n @teams = Team.all\n render :json => @teams\n end", "def index\n @teams = Team.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @teams }\n end\n end", "def index\n @teams = Team.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @teams }\n end\n end", "def index\n @acedemic_years = AcedemicYear.all\n end", "def index\n @sponsor_years = SponsorYear.all\n end", "def index\n @teams = Team.all\n render json: @teams\n end", "def index\n @firework_years = FireworkYear.all\n end", "def index\n @grad_years = GradYear.all\n end", "def index\n @year_groups = YearGroup.all\n end", "def index\n @teams = @organization.teams\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = @club.teams\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end", "def index\n\t\t@teams = Team.all\n\t\trender '/teams/index.json.jbuilder'\n\tend", "def index\n @mp_years = MpYear.all\n end", "def index\n @team_challenges = TeamChallenge.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @team_challenges }\n end\n end", "def index\n @teams = Team.page(params[:page])\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end", "def uni_years\n @uni_years = UniYear.where(university_id: params[:university_id])\n \n respond_to do |format|\n format.json { render json: @uni_years }\n end\n end", "def index\n @parliaments = Parliament.sorted_start_year\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @parliaments }\n end\n end", "def index\n @teams = @competition.teams.sort_by{|t| t.number}\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end", "def index\n @leagues = League.all\n render json: @leagues, status: :ok\n end", "def index\n @team_people = TeamPerson.all\n end", "def index\n\t\t@teams = Team.all\n\tend", "def index\n\t\t@team = Team.find(params[:team_id])\n\tend", "def index\n @variables = Variable.all\n @years = {'2011' => '', '2012' => '', '2013' => '', '2014' => ''}\n end", "def index\n if current_user_total?\n @teams = Team.order(:description).page(params[:page]).per(5)\n else\n ids = []\n tus = TeamUser.where(user_id: current_user.id)\n tus.each do |tu| # user_id | team_id\n ids << tu.team_id # [1, 6, 7]\n end\n\n return @teams = Team.where(id: ids).order(:description).page(params[:page]).per(5)\n end\n=======\n\n # GET /teams\n # GET /teams.json\n def index\n @teams = Team.order(:description).page(params[:page]).per(5)\n>>>>>>> d0c6183c3349cba16c54d8ce4c0fb5ee26c49700\n end\n\n # GET /teams/1\n # GET /teams/1.json\n def show\n<<<<<<< HEAD\n=======\n @team = Team.find(params[:id])\n>>>>>>> d0c6183c3349cba16c54d8ce4c0fb5ee26c49700\n end", "def index\n @year_classes = YearClass.all\n end", "def index\n @games_teams = GamesTeam.all\n end", "def index\n # @teams = Team.all\n \n redirect_to \"/members\"\n\n # respond_to do |format|\n # format.html # index.html.erb\n # format.json { render json: @teams }\n # end\n end", "def index\n @user_teams = UserTeam.all\n end", "def team\n @team = Team.find(params[:team_id])\n set_date_and_year\n @results = Result.all(\n :conditions => [ \"team_id = ? and year = ? and competition_result = false and team_competition_result = false\", @team.id, @date.year ]\n )\n respond_to do |format|\n format.html\n format.json { render :json => @results.to_json }\n format.xml { render :xml => @results.to_xml }\n end\n end", "def index\n @tournamentteams = Tournamentteam.all\n end", "def index\n @leagues = League.all\n if !League.first.nil?\n @last_season = League.first.seasons.last\n end\n respond_to do |format|\n format.html #index.html.erb\n end\n end", "def index\n @worker_salaries = WorkerSalary.paginate(:page => params[:page], :per_page => per_page).order('year desc')\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @worker_salaries }\n end\n end", "def index\n @match_teams = MatchTeam.all\n end", "def index\n @leagues = League.all\n end", "def index\n @leagues = League.all\n end", "def index\n @leagues = League.all\n end", "def index\n @leagues = League.all\n end", "def index\n @leagues = League.all\n end", "def index\n @leagues = League.all\n end", "def index\n @leagues = League.all\n end", "def index\n @fiscal_years = FiscalYear.all\n end", "def index\n @student_teams = StudentTeam.all\n end", "def index\n @signature_years = SignatureYear.all\n end", "def index\n game = Game.all\n\n render json: game, include: :teams\n end", "def index\n @nhl_teams = @pool.nhl_teams\n end", "def index\n @teams_players = TeamsPlayer.all\n end", "def index\n @teams = Team.order(:id).page(params[:page]).per(10)\n end", "def index\n @team = Team.find(params[:team_id])\n @players = @team.players\n end", "def index\n @team_players = TeamPlayer.all\n end", "def team\n @team = Team.where(id: params[:team_id]).first\n respond_to do |format|\n format.html do\n if @team.nil?\n flash[:notice] = \"No team with id #{params[:team_id]}\"\n return redirect_to(teams_path)\n end\n\n assign_team_results @team, @year\n render layout: !request.xhr?\n end\n\n format.json do\n return(render(status: :not_found, body: \"\")) unless @team\n assign_team_results @team, @year\n render json: @event_results.to_json\n end\n\n format.xml do\n return(render(status: :not_found, body: \"\")) unless @team\n assign_team_results @team, @year\n render xml: @event_results.to_xml\n end\n end\n end", "def index\n @labs = Lab.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @labs }\n end\n end", "def index\n @labs = Lab.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @labs }\n end\n end", "def index\n @laboratories = Laboratory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @laboratories }\n end\n end", "def index\n @dance_teams = DanceTeam.all\n end", "def index\n @coaches_teams = CoachesTeam.all\n end", "def index\n\t\t@teams = Team.order(\"name ASC\").all\n\n\t\t# Pulls upcoming fixtures in Premier League\n\t\t@data = party_time(\"http://api.statsfc.com/premier-league/fixtures.json?key=DThzCPsM_TI0XUGeUOJqr26JHwtYXVIfYvSSb0ui&timezone=America/New_York&limit=10\")\n\n\t\t# Pulls top scorers in Premier League\n\t\t@data2 = party_time(\"http://api.statsfc.com/top-scorers.json?key=DThzCPsM_TI0XUGeUOJqr26JHwtYXVIfYvSSb0ui&competition=premier-league&year=2013/2014&limit=10\")\t\n\n\t\t# Pulls news articles about the league through Google RSS\n\t\tdata = party_time(\"https://news.google.com/news/feeds?q=barclays+premier+league&output=rss\")\n\t\t@articles = data[\"rss\"][\"channel\"][\"item\"]\n\tend", "def index\n @team = Team.find(params[:team_id])\n @sprints = @team.sprints.find(:all)\n\n respond_to do |format|\n format.html\n format.json\n end\n end", "def show\n @player = Player.find(params[:id])\n if @player.games.count >= 1\n @last_team_name = @player.games.find(:last).team_name\n @year = @player.games.first.date.year\n @newest_year = @player.games.last.date.year\n else\n @last_team_name = \"Your team name\"\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player }\n end\n end", "def index\n @teams = Team.all.order(:name)\n if params[:all]\n json_response(TeamSerializer, @teams)\n else\n @teams_paginated = @teams.page(current_page, per_page).per(per_page)\n json_response(TeamSerializer, @teams_paginated, options(@teams))\n end\n end", "def index\n @liasons = Liason.all\n end", "def index\n @teams = current_user.teams\n end", "def index\n @teams = current_user.teams\n end", "def index\n @conferences = @league.conferences\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @conferences }\n end\n end", "def index\n @teams = Team.all(:order => \"school\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @teams }\n end\n end", "def years(make)\n make_id = get_object_id make\n response = get_url \"Years/#{make_id}\"\n response_obj = JSON.parse response\n response_obj[\"GetYearsResult\"].map{|r| r[\"Year\"]}\n end" ]
[ "0.82920885", "0.7637988", "0.7637988", "0.73149335", "0.72832507", "0.71298736", "0.70979303", "0.7072276", "0.70589054", "0.7044989", "0.6923835", "0.6923835", "0.6917807", "0.6908079", "0.6908079", "0.6898542", "0.6888238", "0.6886169", "0.6875952", "0.6838489", "0.6836939", "0.6836645", "0.6833151", "0.6833151", "0.6833151", "0.6833151", "0.6833151", "0.6833151", "0.6833151", "0.6833151", "0.6833151", "0.6833151", "0.6833151", "0.6833151", "0.6833151", "0.6833151", "0.6833151", "0.6833151", "0.6833151", "0.6833151", "0.6833151", "0.6833151", "0.6833151", "0.6833151", "0.6833151", "0.6833151", "0.6830227", "0.679723", "0.67879266", "0.6739998", "0.6731366", "0.66844606", "0.66802245", "0.66740453", "0.6672789", "0.66589266", "0.66265553", "0.6598697", "0.6595148", "0.65713084", "0.6569155", "0.65414494", "0.65332615", "0.6530444", "0.65259653", "0.6519649", "0.6484618", "0.6482502", "0.6458886", "0.6450199", "0.6450199", "0.6450199", "0.6450199", "0.6450199", "0.6450199", "0.6450199", "0.6441962", "0.64330965", "0.6430657", "0.64043427", "0.63962257", "0.6395846", "0.6390343", "0.63867915", "0.6382475", "0.63719636", "0.6358728", "0.6358728", "0.6349743", "0.6344332", "0.634211", "0.6340497", "0.632164", "0.63168085", "0.6307388", "0.6293054", "0.62924683", "0.62924683", "0.62826407", "0.6271927", "0.6269296" ]
0.0
-1
POST /team_years POST /team_years.json
def create @team_year = TeamYear.new(team_year_params) respond_to do |format| if @team_year.save format.html { redirect_to @team_year, notice: 'Team year was successfully created.' } format.json { render :show, status: :created, location: @team_year } else format.html { render :new } format.json { render json: @team_year.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @team_year = TeamYear.new(team_year_params)\n\n respond_to do |format|\n if @team_year.save\n format.html { redirect_to @team_year, notice: 'Team year was successfully created.' }\n format.json { render action: 'show', status: :created, location: @team_year }\n else\n format.html { render action: 'new' }\n format.json { render json: @team_year.errors, status: :unprocessable_entity }\n end\n end\n end", "def team_year_params\n params.require(:team_year).permit(:year, :team, :wins, :losses, :win_percentage, :offensive_rating, :defensive_rating, :season_outcome, :team_url, :team_home_url)\n end", "def team_year_params\n params.require(:team_year).permit(:athlete_id, :team_id, :year)\n end", "def get_team_years_participated ( team_key )\n get_api_resource \"#{@@api_base_url}team/#{team_key}/years_participated\"\n end", "def create\n @year = Year.new(year_params)\n\n respond_to do |format|\n if @year.save\n format.html { redirect_to @year, notice: 'Year was successfully created.' }\n format.json { render :show, status: :created, location: @year }\n else\n format.html { render :new }\n format.json { render json: @year.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @year = Year.new(year_params)\n\n respond_to do |format|\n if @year.save\n format.html { redirect_to @year, notice: 'Year was successfully created.' }\n format.json { render :show, status: :created, location: @year }\n else\n format.html { render :new }\n format.json { render json: @year.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @year = Year.new(year_params)\n\n respond_to do |format|\n if @year.save\n format.html { redirect_to @year, notice: 'Year was successfully created.' }\n format.json { render action: 'show', status: :created, location: @year }\n else\n format.html { render action: 'new' }\n format.json { render json: @year.errors, status: :unprocessable_entity }\n end\n end\n end", "def get_team_years_participated_with_http_info(team_key, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TeamApi.get_team_years_participated ...'\n end\n # verify the required parameter 'team_key' is set\n if @api_client.config.client_side_validation && team_key.nil?\n fail ArgumentError, \"Missing the required parameter 'team_key' when calling TeamApi.get_team_years_participated\"\n end\n # resource path\n local_var_path = '/team/{team_key}/years_participated'.sub('{' + 'team_key' + '}', CGI.escape(team_key.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[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<Integer>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['apiKey']\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(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TeamApi#get_team_years_participated\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @built_year = BuiltYear.new(built_year_params)\n\n respond_to do |format|\n if @built_year.save\n format.html { redirect_to @built_year, notice: 'Built year was successfully created.' }\n format.json { render action: 'show', status: :created, location: @built_year }\n else\n format.html { render action: 'new' }\n format.json { render json: @built_year.errors, status: :unprocessable_entity }\n end\n end\n end", "def league_year_params\n params.require(:league_year).permit(:league_id, :start_date, :end_date, :season_name, :season_type, :current_season, :season_year)\n end", "def set_team_year\n @team_year = TeamYear.find(params[:id])\n end", "def set_team_year\n @team_year = TeamYear.find(params[:id])\n end", "def index\n @team_years = TeamYear.all\n end", "def create\n @mp_year = MpYear.new(mp_year_params)\n\n respond_to do |format|\n if @mp_year.save\n format.html { redirect_to mp_years_path, notice: 'Mp year was successfully created.' }\n format.json { render :show, status: :created, location: @mp_year }\n else\n format.html { render :new }\n format.json { render json: @mp_year.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @time_of_year = TimeOfYear.new(time_of_year_params)\n\n respond_to do |format|\n if @time_of_year.save\n format.html { redirect_to @time_of_year, notice: 'Time of year was successfully created.' }\n format.json { render :show, status: :created, location: @time_of_year }\n else\n format.html { render :new }\n format.json { render json: @time_of_year.errors, status: :unprocessable_entity }\n end\n end\n end", "def year_params\n params.require(:year).permit(:id, :year)\n end", "def create\n @pupil_has_year = PupilHasYear.new(pupil_has_year_params)\n\n respond_to do |format|\n if @pupil_has_year.save\n format.html { redirect_to pupil_has_years_path, notice: 'Pupil has year was successfully created.' }\n format.json { render :show, status: :created, location: @pupil_has_year }\n else\n format.html { render :new }\n format.json { render json: @pupil_has_year.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @sponsor_year = SponsorYear.new(sponsor_year_params)\n\n respond_to do |format|\n if @sponsor_year.save\n format.html { redirect_to @sponsor_year, notice: 'Sponsor year was successfully created.' }\n format.json { render :show, status: :created, location: @sponsor_year }\n else\n format.html { render :new }\n format.json { render json: @sponsor_year.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @year_group = YearGroup.new(year_group_params)\n\n respond_to do |format|\n if @year_group.save\n format.html { redirect_to @year_group, notice: 'Year group was successfully created.' }\n format.json { render :show, status: :created, location: @year_group }\n else\n format.html { render :new }\n format.json { render json: @year_group.errors, status: :unprocessable_entity }\n end\n end\n end", "def uni_years\n @uni_years = UniYear.where(university_id: params[:university_id])\n \n respond_to do |format|\n format.json { render json: @uni_years }\n end\n end", "def create\n @yearly_info = current_user.yearly_info.build(yearly_info_params)\n\n respond_to do |format|\n if @yearly_info.save\n format.html { redirect_to @yearly_info, notice: 'Yearly info was successfully created.' }\n format.json { render action: 'show', status: :created, location: @yearly_info }\n else\n format.html { render action: 'new' }\n format.json { render json: @yearly_info.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @response = HTTParty.get('http://laxapi.herokuapp.com/api/teams')\n CreateTeamService.new.create_team_objects(@response)\n render :json => {\n :message => \" #{Team.count} teams have been created\",\n status: 200\n }\n end", "def get_teams\r\n response = HTTParty.get('https://www.balldontlie.io/api/v1/teams')[\"data\"]\r\n response.each do |i|\r\n team = Team.new\r\n \r\n team.full_name = i[\"full_name\"]\r\n team.division = i[\"division\"]\r\n team.conference = i[\"conference\"]\r\n\r\n team.save\r\n\r\n end \r\n end", "def create\n @team = Team.new(params[:team])\n\n if @team.save\n render json: @team, status: :created, location: @team\n else\n render json: @team.errors, status: :unprocessable_entity\n end\n end", "def year_params\n params.require(:year).permit(:id)\n end", "def year_params\n params.require(:year).permit(:value)\n end", "def destroy\n @team_year.destroy\n respond_to do |format|\n format.html { redirect_to team_years_url }\n format.json { head :no_content }\n end\n end", "def create_yearly_data\n number = @slide_number.to_i + 1\n yearly_data = Nokogiri::HTML(\n open(\n \"#{ENV['API_DOMAIN_2']}#{Time.now.year}-horoscope\"\n )\n ).css(\"div.shareable-section-wrapper.shareable-yearly\").last\n return {} if yearly_data.blank?\n inner_data = yearly_data.css(\"div[#{number}] p\")\n final_data = \"\"\n inner_data.css(\"p\").each do |para|\n final_data = final_data + para.text + \"</br></br></t>\"\n end\n\n data = {\n sign: @sign_name.to_s,\n duration: \"yearly\",\n horoscope_text: final_data\n } if final_data\n Horoscope.create(data) if final_data and data\n end", "def update\n respond_to do |format|\n if @team_year.update(team_year_params)\n format.html { redirect_to @team_year, notice: 'Team year was successfully updated.' }\n format.json { render :show, status: :ok, location: @team_year }\n else\n format.html { render :edit }\n format.json { render json: @team_year.errors, status: :unprocessable_entity }\n end\n end\n end", "def built_year_params\n params.require(:built_year).permit(:year, :gearbox, :engine_displacement)\n end", "def acedemic_year_params\n params.require(:acedemic_year).permit(:year, :start_date, :end_date, :grade_ids => [], :fee_ids => [])\n end", "def create\n @firework_year = FireworkYear.new(firework_year_params)\n\n respond_to do |format|\n if @firework_year.save\n format.html { redirect_to @firework_year, notice: 'Firework year was successfully created.' }\n format.json { render :show, status: :created, location: @firework_year }\n else\n format.html { render :new }\n format.json { render json: @firework_year.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\t# league admin can add\n\t\t# anyone can add (own team) as pending iff league is addable\n\t\tds = DivisionSeason.find params[:division_season_id]\n\t\tteam = Team.find team[:team_id]\n\n\t\tif can? :manage_teams, ds\n\t\t\tTeamDSService.add_team(ds, team)\n\t\telse\n\t\t\tauthorize! :add_team, ds\n\t\t\tTeamDSService.add_pending_team(ds, team)\n\t\tend\n\n\t\trespond_with tdsr\n\tend", "def create\n @schoolyear = Schoolyear.new(schoolyear_params)\n\n respond_to do |format|\n if @schoolyear.save\n format.html { redirect_to @schoolyear, notice: 'Schoolyear was successfully created.' }\n format.json { render :show, status: :created, location: @schoolyear }\n else\n format.html { render :new }\n format.json { render json: @schoolyear.errors, status: :unprocessable_entity }\n end\n end\n end", "def get_teams_by_year_with_http_info(year, page_num, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TeamApi.get_teams_by_year ...'\n end\n # verify the required parameter 'year' is set\n if @api_client.config.client_side_validation && year.nil?\n fail ArgumentError, \"Missing the required parameter 'year' when calling TeamApi.get_teams_by_year\"\n end\n # verify the required parameter 'page_num' is set\n if @api_client.config.client_side_validation && page_num.nil?\n fail ArgumentError, \"Missing the required parameter 'page_num' when calling TeamApi.get_teams_by_year\"\n end\n # resource path\n local_var_path = '/teams/{year}/{page_num}'.sub('{' + 'year' + '}', CGI.escape(year.to_s)).sub('{' + 'page_num' + '}', CGI.escape(page_num.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[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<Team>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['apiKey']\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(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TeamApi#get_teams_by_year\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def team_params\n params.require(:team).permit(:logo_url, :city, :name, :wins, :losses, :conference_rank)\n end", "def get_district_teams ( district_key, year )\n get_api_resource \"#{@@api_base_url}district/#{district_key}/#{year}/teams\"\n end", "def create\n @grad_year = GradYear.new(grad_year_params)\n\n respond_to do |format|\n if @grad_year.save\n format.html { redirect_to @grad_year, notice: 'Grad year was successfully created.' }\n format.json { render :show, status: :created, location: @grad_year }\n else\n format.html { render :new }\n format.json { render json: @grad_year.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n @leagues = League.all.order(:name)\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ultimate_team = UltimateTeam.new(params[:ultimate_team])\n\n respond_to do |format|\n if @ultimate_team.save\n format.html { redirect_to @ultimate_team, notice: 'Ultimate team was successfully created.' }\n format.json { render json: @ultimate_team, status: :created, location: @ultimate_team }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ultimate_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n puts \"IN CREATE ACTION\"\n if(current_user.role == \"guest\")\n redirect_to login_url and return\n end\n @coaches = Coach.all\n @divisions = Division.all\n @organizations = Organization.all\n @students = Student.all\n @team = Team.new(team_params)\n\n unless current_user.coach.nil?\n @team_organization = current_user.coach.organization\n #@team_name = @team.organization.short_name + \" \" + (@team.organization.teams.count+1).to_s\n @team.organization_id = @team_organization.id\n #@team.name = @team_name\n end\n\n puts \"TEAM IS #{@team.valid?} -- #{@team.to_yaml}\"\n \n respond_to do |format|\n if @team.save\n params[:team][:student_teams_attributes].each do |sta|\n st = StudentTeam.new\n puts \"PREVIEW -- #{@team.id} :: #{sta[1][1]}\"\n # @team.student_teams.each do |st|\n st.team_id = 86\n st.student_id = sta[1][1]\n if st.save\n puts \"StudentTeam ID: #{st.id}\"\n else\n puts \"FAIL\"\n end\n end\n format.html { redirect_to edit_team_url(@team), notice: 'Team was successfully created.' }\n format.json { render action: 'show', status: :created, location: @team }\n else\n format.html { render action: 'new' }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_league_year\n @league_year = LeagueYear.find(params[:id])\n end", "def yearly_info_params\n params.require(:yearly_info).permit(:essay, :comments, :year, :role)\n end", "def ab_team_params\n params.require(:ab_team).permit(:skater_id, :team_id, :year)\n end", "def firework_year_params\n params.require(:firework_year).permit(:year)\n end", "def season_params\n params.permit(:year_start, :year_end, :team_id)\n end", "def create\n @team = Team.new(params[:team])\n @team.wins = 0\n @team.losses = 0\n @team.points = 0\n \n respond_to do |format|\n if @team.save\n if params[:user_id]\n user = User.find(params[:user_id])\n user.team_id = @team.id\n user.save\n else\n current_user.team_id = @team.id\n current_user.save\n end \n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render json: @team, status: :created, location: @team }\n else\n format.html { render action: \"new\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @team_year.destroy\n respond_to do |format|\n format.html { redirect_to team_years_url, notice: 'Team year was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def create\n unless current_user.instructor\n render :nothing => true, :status => :unauthorized\n end\n \n # create team\n team = Team.create(name: params[:team_name], course: $selected_course)\n\n # add students to teams\n student_ids = params[:student_ids]\n student_ids.each do |student_id|\n StudentTeam.create(student_id: student_id, team: team)\n end\n\n render json: { success: true }\n end", "def create_teams_for_sport(sport, num_players)\n current_year = Time.new.year\n classes = (current_year..current_year+4).to_a # for the players\n\n College.all.each do |c|\n team = Team.new\n team.college = c # for now\n team.name = c.name\n team.description = sport.description\n team.sport = sport\n\n # players\n create_players(team, classes, num_players)\n team.save \n end \nend", "def index\n @team_years = TeamYear.all\n\n #\n ## Get TeamYears grouped by year\n #\n @year_groups = {}\n\n # get unique team_years\n @yrs = @team_years.map{|ty| ty.year }.uniq!\n # for each unique season\n @yrs.each{|yr|\n # create the array we'll feed the final hash\n @year_bucket = []\n # for each team_season in each year\n @team_years.where( year: yr).each{|row|\n @year_bucket << row.attributes\n }\n @year_groups[yr.to_sym] = @year_bucket#.sort_by{|hsh| -hsh[:year] }\n }\n\n\n end", "def create\n @team = Team.new(params.required(:team).permit!)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render json: @team, status: :created, location: @team }\n else\n format.html { render action: \"new\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.create({:name => params[:name], :status => params[:status]})\n\n if request.xhr?\n render :json => @team\n end\n end", "def create\n @year_class = YearClass.new(year_class_params)\n\n respond_to do |format|\n if @year_class.save\n format.html { redirect_to @year_class, notice: 'Year class was successfully created.' }\n format.json { render :show, status: :created, location: @year_class }\n else\n format.html { render :new }\n format.json { render json: @year_class.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @acedemic_year = AcedemicYear.new(acedemic_year_params)\n acedemic_year_last = AcedemicYear.try(:last)\n respond_to do |format|\n if @acedemic_year.save\n if @acedemic_year.present?\n if acedemic_year_last.present?\n list_grades = acedemic_year_last.grades.map{ |g| {name: g.name, acedemic_year_id: @acedemic_year.id} }\n Grade.create(list_grades)\n Term.create([\n {name: \"First Term\", acedemic_year_id: @acedemic_year.id},\n {name: \"Second Term\", acedemic_year_id: @acedemic_year.id},\n {name: \"Third Term\", acedemic_year_id: @acedemic_year.id}\n ])\n end\n end\n format.html { redirect_to @acedemic_year, notice: 'Academic year was successfully created.' }\n format.json { render :show, status: :created, location: @acedemic_year }\n else\n format.html { render :new }\n format.json { render json: @acedemic_year.errors, status: :unprocessable_entity }\n end\n end\n end", "def years(make)\n make_id = get_object_id make\n response = get_url \"Years/#{make_id}\"\n response_obj = JSON.parse response\n response_obj[\"GetYearsResult\"].map{|r| r[\"Year\"]}\n end", "def create\n @team = Team.new(params[:team])\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, :notice => 'Team was successfully created.' }\n format.json { render :json => @team, :status => :created, :location => @team }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @team.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @signature_year = SignatureYear.new(signature_year_params)\n respond_to do |format|\n if @signature_year.save\n format.html { redirect_to @signature_year, notice: t('.success') }\n format.json { render :show, status: :created, location: @signature_year }\n else\n format.html { render :new }\n format.json { render json: @signature_year.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n respond_to do |format|\n if @team.save\n format.html { redirect_to '/teams', notice: 'Team was successfully created.' }\n format.json { render :index, status: :created }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n year = params[:year]\n timeframe_type = params[:type]\n\n timeframe = Timeframe.new(year: year, timeframe_type: timeframe_type)\n respond_to do |format|\n if timeframe.save\n TimeframeLog.create_timeframe_log(timeframe.year, timeframe.id, timeframe.timeframe_type)\n format.json { render json: \"Timeframe successfully created!\", status: :ok }\n else\n format.json { render json: \"Error!\", status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @family_year = FamilyYear.new(family_year_params)\n\n respond_to do |format|\n if @family_year.save\n format.html { redirect_to @family_year, notice: tr(\"family_year_created\") }\n else\n format.html { render :new }\n end\n end\n end", "def new_school_year(school_year)\n activate_school_year(school_year) if @active.nil?\n @school_years << school_year if school_year.valid?\n school_year.save!\n school_year\n end", "def sponsor_year_params\n params.require(:sponsor_year).permit(:sponsor_id, :year_id, :sponsor_level_id)\n end", "def create\n @league = League.new(league_params)\n if @league.save\n render json: @league\n else\n render error: { error: \"Unable to create league.\"}, status: 400\n end\n end", "def create_team\n new_team_code = genTeamCode(current_user.id)\n team_params = {\n :team_name => params[:teamname],\n :team_code => new_team_code,\n :advisor_users_id => current_user.id,\n }\n team = Team.new(team_params)\n team.save\n\n current_user.update_attribute( :team_name, params[:teamname] )\n current_user.update_attribute( :team_code, new_team_code)\n\n flash.now[:flash] = 'Team Created'\n render '/advisor/index'\n end", "def new\n @budget = Budget.new\n @budget.year = Time.new.year\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @budget }\n end\n end", "def create\n @team = Team.new(params[:team])\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render json: @team, status: :created, location: @team }\n else\n format.html { render action: \"new\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(params[:team])\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render json: @team, status: :created, location: @team }\n else\n format.html { render action: \"new\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(params[:team])\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render json: @team, status: :created, location: @team }\n else\n format.html { render action: \"new\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def year_group_params\n params.require(:year_group).permit(:name, :code)\n end", "def update\n respond_to do |format|\n if @team_year.update(team_year_params)\n format.html { redirect_to @team_year, notice: 'Team year was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @team_year.errors, status: :unprocessable_entity }\n end\n end\n end", "def get_team_years_participated(team_key, opts = {})\n data, _status_code, _headers = get_team_years_participated_with_http_info(team_key, opts)\n data\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team created successfully.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Group was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @academic_year = AcademicYear.new(params[:academic_year])\n\n if @academic_year.save\n @academic_years = AcademicYear.paginate :page=>params[:page], :per_page=>15\n\n flash[:notice] = t('flash_msg48')\n else\n @error = true\n end\n end", "def create\n\n \t\t\t@team = Team.new team_params\n\n \t\t\tif @team.save\n\n \t\t\t\trender json: @team,status: :created\n\n \t\t\telse\n\n \t\t\t\trender json: {error: true,errors: @team.errors},status: :unprocessable_entity\n\n \t\t\tend\n\n \t\tend", "def create\n @team = Team.new(team_params)\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n study_period_params.permit!\n @study_period = StudyPeriod.new(study_period_params)\n @study_period.study_year = @year\n\n respond_to do |format|\n if @study_period.save\n format.html { redirect_to new_study_year_study_process_graphic_path(current_user.current_year, @study_period), notice: 'Учебный отрезок успешно создан.' }\n format.json { render action: 'show', status: :created, location: @study_period }\n else\n format.html { render action: 'new' }\n format.json { render json: @study_period.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @league = League.new(league_params)\n @league.league_owner_id = current_user.id\n\n respond_to do |format|\n if @league.save\n format.html { redirect_to :action => \"addteam\", :id => @league.id }\n format.json { render :show, status: :created, location: @league.addteam }\n format.js { }\n else\n format.html { render :new }\n format.json { render json: @league.errors, status: :unprocessable_entity }\n end\n end\n end", "def team_params\n\t\tparams.require(:team).permit(:name, :contested_opinions, :uncontested_opinions, :contested_objections, :uncontested_objections, :comments, :initiators, :following, :active, :bookmarks, :hot_topics, :categories, :key_words, :levels, :range, :today, :last_week, :last_month)\n\tend", "def create\n @turma = current_colegio.turmas.create(turma_params)\n authorize @turma\n \n @turma.ano_vigencia = Time.now.year\n @turma.save\n respond_with(@turma)\n end", "def create\n @thermo_oil_distribution_year = ThermoOilDistributionYear.new(params[:thermo_oil_distribution_year])\n\n respond_to do |format|\n if @thermo_oil_distribution_year.save\n format.html { redirect_to @thermo_oil_distribution_year, notice: 'Thermo oil distribution year was successfully created.' }\n format.json { render json: @thermo_oil_distribution_year, status: :created, location: @thermo_oil_distribution_year }\n else\n format.html { render action: \"new\" }\n format.json { render json: @thermo_oil_distribution_year.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @user_team = UserTeam.new(user_team_params)\n\n respond_to do |format|\n if @user_team.save\n format.html { redirect_to @user_team, notice: 'User team was successfully created.' }\n format.json { render action: 'show', status: :created, location: @user_team }\n else\n format.html { render action: 'new' }\n format.json { render json: @user_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def team\n @team = Team.find(params[:team_id])\n set_date_and_year\n @results = Result.all(\n :conditions => [ \"team_id = ? and year = ? and competition_result = false and team_competition_result = false\", @team.id, @date.year ]\n )\n respond_to do |format|\n format.html\n format.json { render :json => @results.to_json }\n format.xml { render :xml => @results.to_xml }\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to root_path, notice: 'Team was successfully created.' }\n format.json { render action: 'show', status: :created, location: @team }\n else\n format.html { render action: 'new' }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def time_of_year_params\n params.require(:time_of_year).permit(:months_id)\n end", "def create\n #create competitors too\n @team = Team.new(params[:team])\n\n my_competitors = params[:competitors]\n (1..8).each do |n|\n if params.has_key?(\"captain_\" + n.to_s)\n my_competitors[n-1][:captain] = true;\n else\n my_competitors[n-1][:captain] = false;\n end\n end\n\n my_competitors.each do |comp|\n @team.competitors.build(comp) unless comp[\"name\"].nil? or comp[\"name\"].empty?\n end\n @team.tournaments << Tournament.find(params[:tournament_id]) unless params[:tournament_id].empty?\n\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to(@team, :notice => 'Team was successfully created.') }\n format.xml { render :xml => @team, :status => :created, :location => @team }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @team.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @fiscal_year = FiscalYear.new(fiscal_year_params)\n\n respond_to do |format|\n if @fiscal_year.save\n format.html { redirect_to @fiscal_year, notice: 'Fiscal year was successfully created.' }\n format.json { render :show, status: :created, location: @fiscal_year }\n else\n format.html { render :new }\n format.json { render json: @fiscal_year.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n authorize @team\n current_user.update team: @team\n\n respond_to do |format|\n if @team.persisted?\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n student_ids = params[:student_ids].to_a\n student_ids.each_with_index do |student_id|\n student = Student.where(id: student_id.to_i).first\n @team.students << student\n end\n end" ]
[ "0.7126538", "0.68674433", "0.68016756", "0.667947", "0.65270364", "0.65270364", "0.6486491", "0.6351944", "0.62293893", "0.6184752", "0.6135743", "0.6135743", "0.6118629", "0.61119145", "0.60461664", "0.6036638", "0.60352916", "0.59885275", "0.59883964", "0.5967399", "0.5892771", "0.5881894", "0.5875299", "0.5871886", "0.5841483", "0.5822739", "0.58212596", "0.5815774", "0.58105576", "0.5809652", "0.5796309", "0.57829976", "0.5762536", "0.5761054", "0.5747985", "0.5742142", "0.5713865", "0.57127255", "0.57051706", "0.5699919", "0.5683947", "0.5681893", "0.56814945", "0.56746906", "0.5669834", "0.5669438", "0.5668313", "0.56611294", "0.5658665", "0.5641716", "0.5625218", "0.5609691", "0.5603331", "0.5584131", "0.55834776", "0.5581647", "0.5565276", "0.55584645", "0.55579984", "0.55539256", "0.5548995", "0.5542206", "0.55311906", "0.55275095", "0.5524949", "0.5521467", "0.5517198", "0.55124736", "0.55124736", "0.55124736", "0.5501476", "0.5494932", "0.5491306", "0.54836047", "0.5483599", "0.5483331", "0.5483331", "0.5483331", "0.5483331", "0.5483331", "0.5483331", "0.5483331", "0.5483331", "0.548311", "0.54821044", "0.5474592", "0.5472597", "0.5466988", "0.54617184", "0.5458786", "0.54543865", "0.5453843", "0.54506165", "0.544757", "0.54446155", "0.5442431", "0.5433381", "0.54285854", "0.54281896", "0.54238707" ]
0.7204664
0
PATCH/PUT /team_years/1 PATCH/PUT /team_years/1.json
def update respond_to do |format| if @team_year.update(team_year_params) format.html { redirect_to @team_year, notice: 'Team year was successfully updated.' } format.json { render :show, status: :ok, location: @team_year } else format.html { render :edit } format.json { render json: @team_year.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @team_year.update(team_year_params)\n format.html { redirect_to @team_year, notice: 'Team year was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @team_year.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:id])\n\n if @team.update_attributes(params[:team])\n head :no_content\n else\n render json: @team.errors, status: :unprocessable_entity\n end\n end", "def update\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params.required(:team).permit!)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @year.update(year_params)\n format.html { redirect_to @year, notice: 'Year was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @year.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_team_year\n @team_year = TeamYear.find(params[:id])\n end", "def set_team_year\n @team_year = TeamYear.find(params[:id])\n end", "def update\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render json: @team }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to organization_teams_path(@team.organization_id), notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to competition_team_url(@competition, @team), notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to @team, :notice => 'Team was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @team.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to @team, :notice => 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @team.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to @team, :notice => 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @team.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @year.update(year_params)\n format.html { redirect_to @year, notice: 'Year was successfully updated.' }\n format.json { render :show, status: :ok, location: @year }\n else\n format.html { render :edit }\n format.json { render json: @year.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @year.update(year_params)\n format.html { redirect_to @year, notice: 'Year was successfully updated.' }\n format.json { render :show, status: :ok, location: @year }\n else\n format.html { render :edit }\n format.json { render json: @year.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @yearly_info.update(yearly_info_params)\n format.html { redirect_to @yearly_info, notice: 'Yearly info was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @yearly_info.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @ultimate_team = UltimateTeam.find(params[:id])\n\n respond_to do |format|\n if @ultimate_team.update_attributes(params[:ultimate_team])\n format.html { redirect_to @ultimate_team, notice: 'Ultimate team was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ultimate_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_team\n @team.update(team_params)\n end", "def update\n\t\tteam_id = params[:id]\n\t\t@team = Team.find(team_id)\n\t\tif @team.update(team_params)\n\t\t\trender json: @team\n\t\telse\n\t\t\trender json: {\n\t\t\t\terror: {\n\t\t\t\t\tmessage: @team.errors.full_messages.to_sentence\n\t\t\t\t}\n\t\t\t}\n\t\tend\n\tend", "def update\n if :opr == 'edit'\n update\n else\n @team = Team.find_by_id(params[:id])\n @team.update_attributes({:id => params[:id], :name => params[:name], :status => params[:status]})\n\n if request.xhr?\n render :json => @team\n end\n end\n end", "def update\n @league = League.find(params[:league_id])\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\n if @team.update(team_params)\n\n render json: @team,status: :ok\n\n else\n\n render json: {error: true,errors: @team.errors},status: :unprocessable_entity\n\n end\n\n \t\tend", "def update_team\n \n end", "def update\n respond_to do |format|\n if team.update(team_params)\n format.html { redirect_to team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: team.errors, status: ':unprocessable_entity' }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @built_year.update(built_year_params)\n format.html { redirect_to @built_year, notice: 'Built year was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @built_year.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to league_team_path, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n team_name = params[:name]\n team_description = params[:description]\n team_id = params[:id]\n\n respond_to do |format|\n if OkrTeam.where(id: team_id).update_all(name: team_name, description: team_description)\n format.json { render json: 'Team is updated successfully!', status: :ok }\n else\n format.json { render json: 'Error!', status: :unprocessable_entity }\n end\n end\n end", "def update\n @team = @club.teams.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to club_path(@club), notice: 'Mannschaft wurde aktualisiert.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to teams_path, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @mp_year.update(mp_year_params)\n format.html { redirect_to mp_years_path, notice: 'Mp year was successfully updated.' }\n format.json { render :show, status: :ok, location: @mp_year }\n else\n format.html { render :edit }\n format.json { render json: @mp_year.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to user_path(current_user), notice: 'Team information was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to user_root_url, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @time_of_year.update(time_of_year_params)\n format.html { redirect_to @time_of_year, notice: 'Time of year was successfully updated.' }\n format.json { render :show, status: :ok, location: @time_of_year }\n else\n format.html { render :edit }\n format.json { render json: @time_of_year.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @user_team.update(user_team_params)\n format.html { redirect_to @user_team, notice: 'User team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to [@race, @team], notice: I18n.t(:update, scope: 'messages.crud', model: Team.model_name.human) }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: \"Team was successfully updated.\" }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @firework_year.update(firework_year_params)\n format.html { redirect_to @firework_year, notice: 'Firework year was successfully updated.' }\n format.json { render :show, status: :ok, location: @firework_year }\n else\n format.html { render :edit }\n format.json { render json: @firework_year.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n define_team_user\n end", "def update\n respond_to do |format|\n @team.name = team_params[:name]\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def get_team_years_participated ( team_key )\n get_api_resource \"#{@@api_base_url}team/#{team_key}/years_participated\"\n end", "def update\n @leagues = League.all.order(:name)\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team_person.update(team_person_params)\n format.html { redirect_to @team_person, notice: 'Team person was successfully updated.' }\n format.json { render :show, status: :ok, location: @team_person }\n else\n format.html { render :edit }\n format.json { render json: @team_person.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n t = params[:project][:team]\n team_id = t[:team_id]\n @team = Team.find(team_id)\n @project = Project.find(params[:id])\n params[:project].delete :team\n\n respond_to do |format|\n if @project.update_attributes(params[:project]) and \n @team.update_attribute(:project_id,@project.id)\n format.html { redirect_to admin_projects_url, notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "def team_year_params\n params.require(:team_year).permit(:athlete_id, :team_id, :year)\n end", "def get_team_years_participated_with_http_info(team_key, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TeamApi.get_team_years_participated ...'\n end\n # verify the required parameter 'team_key' is set\n if @api_client.config.client_side_validation && team_key.nil?\n fail ArgumentError, \"Missing the required parameter 'team_key' when calling TeamApi.get_team_years_participated\"\n end\n # resource path\n local_var_path = '/team/{team_key}/years_participated'.sub('{' + 'team_key' + '}', CGI.escape(team_key.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[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<Integer>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['apiKey']\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(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TeamApi#get_team_years_participated\\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 @pupil_has_year.update(pupil_has_year_params)\n format.html { redirect_to pupil_has_years_path, notice: 'Pupil has year was successfully updated.' }\n format.json { render :show, status: :ok, location: @pupil_has_year }\n else\n format.html { render :edit }\n format.json { render json: @pupil_has_year.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n flash[:success] = 'Team was successfully updated.'\n format.html { redirect_to @team}\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @users = User.active\n @projects = Project.active\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:team][:team_id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n if params[:players]\n TeamPlayers.update(params[:players], team_name: @team.name)\n end\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @my_team.update(my_team_params)\n format.html { redirect_to @my_team, notice: 'My team was successfully updated.' }\n format.json { render :show, status: :ok, location: @my_team }\n else\n format.html { render :edit }\n format.json { render json: @my_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @swim_team = SwimTeam.find(params[:id])\n\n respond_to do |format|\n if @swim_team.update_attributes(params[:swim_team])\n format.html { redirect_to swim_teams_path(), notice: 'Swim team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @swim_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @team_challenge = TeamChallenge.find(params[:id])\n\n respond_to do |format|\n if @team_challenge.update_attributes(params[:team_challenge])\n format.html { redirect_to @team_challenge, :notice => 'Team challenge was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @team_challenge.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @sponsor_year.update(sponsor_year_params)\n format.html { redirect_to @sponsor_year, notice: 'Sponsor year was successfully updated.' }\n format.json { render :show, status: :ok, location: @sponsor_year }\n else\n format.html { render :edit }\n format.json { render json: @sponsor_year.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def team_year_params\n params.require(:team_year).permit(:year, :team, :wins, :losses, :win_percentage, :offensive_rating, :defensive_rating, :season_outcome, :team_url, :team_home_url)\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n render_success format, 'updated', :ok\n else\n render_errors format, @team.errors, :edit\n end\n end\n end", "def update_team(opts)\n HelloSign::Resource::Team.new post('/team', :body => opts)\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @ab_team.update(ab_team_params)\n format.html { redirect_to @ab_team, notice: 'Record was updated' }\n else\n format.html { render :edit }\n format.json { render json: @ab_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @user_team = Team.where(\"league_id = ?\", @league.id)[0]\n respond_to do |format|\n if @league.update(league_params)\n format.html { redirect_to team_path(@user_team.id), notice: 'League was successfully updated.' }\n format.json { render :show, status: :ok, location: @league }\n else\n format.html { render :edit }\n format.json { render json: @league.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize @team, :update?\n\n @team_form = Team::Form.new(team: @team, attributes: team_params)\n\n respond_to do |format|\n if @team_form.save\n format.html { redirect_to team_url(subdomain: @team.subdomain, auth_token: GenerateLoginToken.call(user: current_user)), notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to(@team, :notice => 'Team was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @team.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update_attributes(params[:team])\n flash[:notice] = 'Team was successfully updated.'\n @changed << @team.id\n\n format.html { redirect_to teams_path }\n format.js { render 'shared/index'; flash.discard }\n format.json { head :no_content }\n else\n @edited << @team.id\n\n format.html { render action: 'edit', template: 'shared/edit' }\n format.js { render 'team' }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @acedemic_year.update(acedemic_year_params)\n format.html { redirect_to @acedemic_year, notice: 'Academic year was successfully updated.' }\n format.json { render :show, status: :ok, location: @acedemic_year }\n else\n format.html { render :edit }\n format.json { render json: @acedemic_year.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @colleague = Colleague.find(params[:id])\n\n respond_to do |format|\n if @colleague.update_attributes(params[:colleague])\n format.html { redirect_to @colleague, notice: 'Colleague was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @colleague.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @colleague = Colleague.find(params[:id])\n\n respond_to do |format|\n if @colleague.update_attributes(params[:colleague])\n format.html { redirect_to @colleague, notice: 'Colleague was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @colleague.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n study_period_params.permit!\n @study_period.study_year = @year\n respond_to do |format|\n if @study_period.update(study_period_params)\n format.html { redirect_to study_year_study_periods_path(current_user.current_year), notice: 'Учебный отрезок успешно обновлен.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @study_period.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.7258103", "0.6863658", "0.67249566", "0.6508965", "0.6507997", "0.6507997", "0.6499393", "0.6488017", "0.6484749", "0.6467119", "0.64489543", "0.64489543", "0.6444716", "0.6444716", "0.6444716", "0.6444716", "0.6444716", "0.6444716", "0.64426476", "0.64426476", "0.64086086", "0.6406046", "0.6389143", "0.6386081", "0.63818794", "0.6372276", "0.6357502", "0.6355298", "0.63359517", "0.63323224", "0.63323224", "0.6323234", "0.6320536", "0.6313849", "0.6256327", "0.6253747", "0.62530416", "0.6228679", "0.6225055", "0.62156284", "0.6213421", "0.6211986", "0.6211986", "0.6211986", "0.6211986", "0.6211986", "0.6211986", "0.6211986", "0.6211986", "0.6211986", "0.6211986", "0.6211986", "0.6211986", "0.6211986", "0.6211986", "0.6211986", "0.6211986", "0.6211986", "0.6211986", "0.6211986", "0.6211986", "0.6211986", "0.6211986", "0.6211986", "0.6211986", "0.62119395", "0.6202204", "0.6193976", "0.6167883", "0.61635685", "0.614779", "0.61396664", "0.61358446", "0.61345327", "0.61204404", "0.6103889", "0.6089549", "0.60771877", "0.6075845", "0.6065569", "0.6064643", "0.6063547", "0.6047991", "0.6029041", "0.60281", "0.60206324", "0.6017204", "0.60167533", "0.6014189", "0.60108286", "0.60056657", "0.5991337", "0.5989933", "0.5981824", "0.59764475", "0.59759104", "0.59729433", "0.596348", "0.596348", "0.5961233" ]
0.72314394
1
DELETE /team_years/1 DELETE /team_years/1.json
def destroy @team_year.destroy respond_to do |format| format.html { redirect_to team_years_url, notice: 'Team year was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @team_year.destroy\n respond_to do |format|\n format.html { redirect_to team_years_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @built_year.destroy\n respond_to do |format|\n format.html { redirect_to built_years_url }\n format.json { head :no_content }\n end\n end", "def destroy\n team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @yearly_info.destroy\n respond_to do |format|\n format.html { redirect_to yearly_infos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ultimate_team = UltimateTeam.find(params[:id])\n @ultimate_team.destroy\n\n respond_to do |format|\n format.html { redirect_to ultimate_teams_url }\n format.json { head :ok }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :ok }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to leagues_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @year.destroy\n respond_to do |format|\n format.html { redirect_to years_url, notice: 'Year was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @year.destroy\n respond_to do |format|\n format.html { redirect_to years_url, notice: 'Year was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = @club.teams.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to club_teams_url(@club.id) }\n format.json { head :no_content }\n end\n end", "def destroy\n @time_of_year.destroy\n respond_to do |format|\n format.html { redirect_to time_of_years_url, notice: 'Time of year was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team_has_d.destroy\n respond_to do |format|\n format.html { redirect_to team_has_ds_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to competition_teams_url(@competition) }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n head :no_content\n end", "def destroy\n @team_division = TeamDivision.find(params[:id])\n @team_division.destroy\n\n respond_to do |format|\n format.html { redirect_to team_divisions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_team.destroy\n respond_to do |format|\n format.html { redirect_to user_teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @firework_year.destroy\n respond_to do |format|\n format.html { redirect_to firework_years_url, notice: 'Firework year was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete(_team)\n # stub\n end", "def destroy\n @nhl_team.destroy\n respond_to do |format|\n format.html { redirect_to pool_nhl_teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team_challenge = TeamChallenge.find(params[:id])\n @team_challenge.destroy\n\n respond_to do |format|\n format.html { redirect_to team_challenges_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to league_teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to user_root_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @swim_team = SwimTeam.find(params[:id])\n @swim_team.destroy\n\n respond_to do |format|\n format.html { redirect_to swim_teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n match_day_team = MatchDayTeam.find(params[:id])\n match_day_team.destroy\n head 204\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to organization_teams_url(@organization), notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to team_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n\n if @team.destroy\n\n render json: {team: {id: params[:id].to_i}},status: :ok\n\n else\n\n render json: {error: true,errors: @team.errors},status: :unprocessable_entity\n\n end\n\n \t\tend", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to view_teams_path, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @thermo_oil_distribution_year = ThermoOilDistributionYear.find(params[:id])\n @thermo_oil_distribution_year.destroy\n\n respond_to do |format|\n format.html { redirect_to thermo_oil_distribution_years_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @mp_year.destroy\n respond_to do |format|\n format.html { redirect_to mp_years_url, notice: 'Mp year was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @cold_production_year = ColdProductionYear.find(params[:id])\n @cold_production_year.destroy\n\n respond_to do |format|\n format.html { redirect_to cold_production_years_url }\n format.json { head :no_content }\n end\n end", "def destroy\n authorize @team, :destroy?\n\n @team.destroy\n respond_to do |format|\n format.html { redirect_to root_url(subdomain: ENV[\"DEFAULT_SUBDOMAIN\"]), notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @rink_league = RinkLeague.find(params[:id])\n @rink_league.destroy\n\n respond_to do |format|\n format.html { redirect_to rink_leagues_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @sponsor_year.destroy\n respond_to do |format|\n format.html { redirect_to sponsor_years_url, notice: 'Sponsor year was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team_person.destroy\n respond_to do |format|\n format.html { redirect_to team_people_url, notice: 'Team person was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n team = @player.team\n @player.destroy\n respond_to do |format|\n format.html { redirect_to team }\n format.json { head :no_content }\n end\n end", "def destroy\n @league.destroy\n respond_to do |format|\n format.html { redirect_to leagues_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @league.destroy\n respond_to do |format|\n format.html { redirect_to leagues_url }\n format.json { head :no_content }\n end\n end", "def destroy_team\n post('/team/destroy')\n end", "def destroy_team\n post('/team/destroy')\n end", "def destroy\n @signature_year.destroy\n respond_to do |format|\n format.html { redirect_to signature_years_url, notice: t('.success') }\n format.json { head :no_content }\n end\n end", "def destroy\n @local_league = LocalLeague.find(params[:id])\n @local_league.destroy\n\n respond_to do |format|\n format.html { redirect_to local_leagues_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @league.fantasy_teams.delete_all\n @league.draft_picks.delete_all\n @league.destroy\n respond_to do |format|\n format.html { redirect_to leagues_url, notice: 'League was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team_test = TeamTest.find(params[:id])\n @team_test.destroy\n\n respond_to do |format|\n format.html { redirect_to team_tests_url }\n format.json { head :ok }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @grad_year.destroy\n respond_to do |format|\n format.html { redirect_to grad_years_url, notice: 'Grad year was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @ab_team.destroy\n respond_to do |format|\n format.html { redirect_to ab_teams_url, notice: 'Record was destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @games_team.destroy\n respond_to do |format|\n format.html { redirect_to games_teams_url, notice: 'Games team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n\t\t@team.destroy\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to teams_url }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend", "def delete\n render json: Company.delete(params[\"id\"])\n end", "def destroy\n @my_team.destroy\n respond_to do |format|\n format.html { redirect_to my_teams_url, notice: 'My team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n (kick and return) if not is_god?\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @colleague = Colleague.find(params[:id])\n @colleague.destroy\n\n respond_to do |format|\n format.html { redirect_to colleagues_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @colleague = Colleague.find(params[:id])\n @colleague.destroy\n\n respond_to do |format|\n format.html { redirect_to colleagues_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @teamstat.destroy\n respond_to do |format|\n format.html { redirect_to teamstats_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.gamers.each do |g|\n g.team= nil\n g.save!\n end\n @team.destroy\n ###\n ###\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @manage_team.destroy\n respond_to do |format|\n format.html { redirect_to manage_teams_url }\n format.json { head :no_content }\n end\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n @nba_team = NbaTeam.find(params[:id])\n @nba_team.destroy\n\n respond_to do |format|\n format.html { redirect_to nba_teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @pupil_has_year.destroy\n respond_to do |format|\n format.html { redirect_to pupil_has_years_url, notice: 'Pupil has year was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @academic_year = AcademicYear.find(params[:id])\n @academic_year.destroy\n\n respond_to do |format|\n format.html { redirect_to(academic_years_url) }\n format.xml { head :ok }\n end\n end" ]
[ "0.7851154", "0.73274475", "0.7215139", "0.7191586", "0.716026", "0.7109318", "0.7105632", "0.7105632", "0.7105632", "0.7105632", "0.7089488", "0.7089488", "0.7089488", "0.7089488", "0.7089488", "0.7089488", "0.7089488", "0.7089488", "0.7089488", "0.7089488", "0.7089488", "0.7089488", "0.7088344", "0.7070162", "0.7070162", "0.706329", "0.7053677", "0.7037629", "0.70056397", "0.6950703", "0.6945411", "0.6920297", "0.69101804", "0.68964976", "0.6885816", "0.68769336", "0.6868625", "0.6861616", "0.685725", "0.6853276", "0.6849956", "0.6849956", "0.6849956", "0.6849956", "0.6849956", "0.6849956", "0.6849956", "0.6849956", "0.6849956", "0.6849956", "0.6849956", "0.6849956", "0.6849956", "0.6849956", "0.6849956", "0.6849956", "0.6849956", "0.6849956", "0.6849956", "0.6849956", "0.6849956", "0.6849956", "0.6835688", "0.68321073", "0.6829985", "0.6820391", "0.68127894", "0.68102723", "0.68026555", "0.677751", "0.6772161", "0.67707396", "0.67685986", "0.67660177", "0.67582786", "0.67561567", "0.67561567", "0.6754852", "0.6754852", "0.6753077", "0.67497605", "0.67469734", "0.67455536", "0.67446023", "0.67442715", "0.67431074", "0.67406785", "0.67389244", "0.6736821", "0.6732202", "0.6729095", "0.67248863", "0.67248863", "0.6724523", "0.6723648", "0.67224497", "0.67158616", "0.6702039", "0.6700545", "0.66956365" ]
0.75810444
1
Use callbacks to share common setup or constraints between actions.
def set_team_year @team_year = TeamYear.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 team_year_params params.require(:team_year).permit(:year, :team, :wins, :losses, :win_percentage, :offensive_rating, :defensive_rating, :season_outcome, :team_url, :team_home_url) 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
Initializes Configuration instance with nil values unless config file was created previously
def initialize @config = config_from_file || empty_config end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize\n create_config unless File.exists?(config_file)\n load_settings\n set_domain\n end", "def create_config\n self.config = {} if !self.config\n end", "def create_config\n self.config = {} if !self.config\n end", "def _init_configuration\n\t\t# Set defaults\n\t\t@setup = { \"create\" => false, \"environment\" => false, \"test\" => true, \"destroy\" => false }\n\t\t@config = false\n\tend", "def initialize\n @config = DEFAULT_CONFIG.deep_dup\n end", "def initialize\n self.reset\n\n if File.exist? SETTING_FILE\n\n # Sometimes on the _development_ environment\n # the settings file gets corrupted...\n # Well, that's a shame!\n begin\n @values = YAML::load_file SETTING_FILE\n rescue\n self.reset\n end\n\n # Strange error that sometimes appear\n # (@values becomes `false`)\n if not @values.class == Hash\n self.reset\n end\n end\n self.save\n end", "def load_configuration\n @config = {\n :start_date => Date.today - 1,\n :data_dir => default_data_dir\n }\n\n if File.exist?(config_file)\n @config = YAML.load_file(config_file)\n end\n\n @config\n end", "def initialize(*args)\n initialize_config unless instance_variable_defined?(:@config)\n super\n end", "def initialize\n\n # Set some defaults\n self.auth_location = 'usa'\n self.use_service_net = 'false'\n self.retention_days = 7\n\n config_file = find_config_file\n raise \"Unable to find configuration file\" if config_file.nil?\n\n File.open(config_file, 'r') do |file|\n while (line = file.gets)\n key, value = line.strip.split('=', 2)\n send(:\"#{key}=\", value)\n end\n end\n\n end", "def init_default_config\n configuration.project_id ||= (Cloud.configure.project_id || ErrorReporting::Project.default_project_id)\n configuration.credentials ||= Cloud.configure.credentials\n configuration.service_name ||= ErrorReporting::Project.default_service_name\n configuration.service_version ||= ErrorReporting::Project.default_service_version\n configuration.ignore_classes = Array(configuration.ignore_classes)\n end", "def init_default_config\n configuration.project_id ||= Debugger.default_project_id\n configuration.credentials ||= Debugger.default_credentials\n configuration.service_name ||= Debugger.default_service_name\n configuration.service_version ||= Debugger.default_service_version\n end", "def initialize\n @path = File.join(File.expand_path('.'), FILE_NAME)\n unless File.exist?(@path)\n @path = (ENV['ASPELLBEE_CONFIG_PATH'] || File.join(File.expand_path('~'), FILE_NAME))\n end\n @data = load_config_file\n end", "def load_config\n # Nothing in base class. This should be used to load the configuration from\n # disk if saved to a file.\n configuration || {}\n end", "def initialize\n @configurations = {}\n end", "def initialize(file = DEFAULTS['cfg'])\n @everything = YAML.load(ERB.new(IO.read(file)).result)\n raise \"malformed yarb config\" unless @everything.is_a?(Hash)\n @config = DEFAULTS.merge(@everything[RAILS_ENV] || {})\n rescue\n puts \"error reading config file: #{$!}, using defaults\"\n @config = DEFAULTS\n end", "def load_configuration!\n unless @configured\n load Rails.root.join( *Parametrization::Config::DEFAULT_CONFIG_PATH )\n end\n end", "def initialize \n @Attributes = Hash.new \n @ConfigurationFilename = \"configuration.txt\" \n load_attributes \n end", "def initialize(config_path = nil)\n @config = Configuration.new(config_path)\n @errors = {}\n end", "def initialize\n message.info \"Loading configuration...\"\n @config ||= validate(config_file)\n aws_config\n end", "def load_config!\n if options[:config]\n config_inst = Config.new(options[:config])\n elsif self.class.const_defined?(:DEFAULT_CONFIGURATION_FILES)\n path = self.class.const_get(:DEFAULT_CONFIGURATION_FILES).detect do |check|\n full_check = File.expand_path(check)\n File.exists?(full_check)\n end\n config_inst = Config.new(path) if path\n end\n if config_inst\n options.delete(:config)\n defaults_inst = Smash[\n config_class.new(\n defaults.to_smash\n ).to_smash.find_all do |key, value|\n defaults.key?(key)\n end\n ]\n config_data = config_inst.data\n config_inst = Smash[\n config_inst.to_smash.find_all do |key, value|\n config_data.key?(key)\n end\n ]\n options_inst = Smash[\n config_class.new(\n options.to_smash\n ).to_smash.find_all do |key, value|\n options.key?(key)\n end\n ]\n @options = config_class.new(\n defaults_inst.to_smash.deep_merge(\n config_inst.to_smash.deep_merge(\n options_inst.to_smash\n )\n )\n ).to_smash\n else\n @options = config_class.new(\n defaults.to_smash.deep_merge(\n options.to_smash\n )\n ).to_smash\n end\n options\n end", "def initialize(config=nil)\n super()\n read_config(config) if !config.nil?\n end", "def initialize(config=nil)\n super()\n read_config(config) if !config.nil?\n end", "def reset\n @config_file = nil\n set_defaults\n load_from_file if config_file\n end", "def load_config!\n if(options[:config])\n config_inst = config_class.new(options[:config])\n elsif(self.class.const_defined?(:DEFAULT_CONFIGURATION_FILES))\n path = self.class.const_get(:DEFAULT_CONFIGURATION_FILES).detect do |check|\n full_check = File.expand_path(check)\n File.exists?(full_check)\n end\n config_inst = config_class.new(path) if path\n end\n if(config_inst)\n options.delete(:config)\n @options = config_class.new(\n defaults.to_smash.deep_merge(\n config_inst.to_smash.deep_merge(\n options.to_smash\n )\n )\n ).to_smash\n else\n @options = config_class.new(\n defaults.to_smash.deep_merge(\n options.to_smash\n )\n ).to_smash\n end\n options\n end", "def init\n # Guard against doing this more than once.\n unless @config.nil?\n return\n end\n\n if Config.config_files.nil?\n raise \"No configuration file provided, set LapisLazuli::WorldModule::Config.config_files\"\n end\n\n load_config(Config.config_files)\n # In case there was no config file found an empty @config needs to be set to prevent infinite looping.\n if @config.nil?\n warn 'Unable to find a configuration file, defaulting to empty config.yml.'\n @config = {}\n end\n\n @metadata = Runtime.instance.set_if(self, :metadata) do\n log.debug \"Creating metadata storage\"\n Storage.new(\"metadata\")\n end\n end", "def initialize(config_file=nil)\n @config_file = config_file\n @params = {}\n @groups = []\n \n if(self.config_file)\n self.validate_config()\n self.import_config()\n end\n end", "def initialize\n @mutex = Mutex.new\n @config_hash = {}\n set_defaults\n end", "def empty_config\n nil\n end", "def initialize(config)\n raise TypeError, \"'config' needs to be a string\" unless config.is_a?(String)\n raise TypeError, \"Configuration file '#{config}' cannot be found\" unless File.exist? config\n\n begin\n # open base config\n @config = load(config)\n # set default value if key? does not exist\n @config.default = nil\n @@config = config\n rescue StandardError => e\n print_error \"Fatal Error: cannot load configuration file '#{config}' : #{e.message}\"\n print_more e.backtrace\n exit(1)\n end\n\n @@instance = self\n end", "def initialize(*args)\n super\n attribute_will_change!(:configuration) if configuration\n end", "def initialize(conf = nil)\n @conf = conf || default_config\n end", "def initialize()\n @config = YAML.load_file('config.yaml')\n @puppetdb = @config['puppetdb']\n @servicenow = @config['servicenoe']\n @syslog = @config['syslog']\n end", "def init\n return if @@tone_data != nil\n if (!FileTest.exist?(TONE_DATA))\n raise StandardError.new(\"Configuration file '#{TONE_DATA}' was not found!\\n\")\n end\n \n # since this is a YAML file, we can append new keys to it.\n @@tone_data = YAML.load(File.read(TONE_DATA))\nend", "def initialize\n @configuration = Configuration.new\n end", "def initialize_config(file_path = nil)\n @config = read_config_file(file_path)\n alias_server_attributes\n\n @https ||= {}\n end", "def init_config\n unless instance_variable_defined? :@hatt_configuration\n @hatt_configuration = TCFG::Base.new\n\n # build up some default configuration\n @hatt_configuration.tcfg_set 'hatt_services', {}\n @hatt_configuration.tcfg_set 'hatt_globs', DEFAULT_HATT_GLOBS\n\n @hatt_configuration.tcfg_set_env_var_prefix 'HATT_'\n end\n\n if hatt_config_file_path\n # if a config file was specified, we assume it exists\n @hatt_configuration.tcfg_config_file hatt_config_file_path\n else\n Log.warn 'No configuration file specified or found. Make a hatt.yml file and point hatt at it.'\n end\n @hatt_configuration.tcfg_set 'hatt_config_file', hatt_config_file_path\n\n normalize_services_config @hatt_configuration\n\n nil\n end", "def load_config()\n self.config = Kitchenplan::Config.new().config\n end", "def initialize\n\t\t@configurations = Array.new\n\tend", "def initializeDefaultParams()\n @fcName = nil # Flowcell name\n @baseCallsDir = nil # BaseCalls dir of the flowcell\n @useBasesMask = nil # Custom value to provide to BCL->FastQ convertor\n @sampleSheet = nil # Path to SampleSheet.csv\n\n yamlConfigFile = PathInfo::CONFIG_DIR + \"/config_params.yml\" \n @configReader = YAML.load_file(yamlConfigFile)\n @queue = SchedulerInfo::CASAVA_QUEUE # The processing queue on the cluster\n end", "def initialize(config_file = nil, meta_tree = nil)\n @meta = meta_tree || { :dir => true }\n begin\n if config_file: load(config_file)\n else @cfg = {} end\n rescue StandardError => e\n $log.puts \"Exception loading ConfigSpace: #{e.inspect}\"\n raise e\n end\n end", "def initialize(config)\n self.config = config.clone\n\n self.source = config['source']\n self.dest = config['destination']\n\n self.partial_build = config['partial_site']\n\n self.reset\n end", "def init!\n # check if configuration file is already created\n unless File.exist?(CONFIG_FILE)\n puts \"=> [PagSeguro] The configuration could not be found at #{CONFIG_FILE.inspect}\"\n return\n end\n \n # The developer mode is enabled? So install it!\n developer_mode_install! if developer?\n end", "def load_config\n if ::File.file?(CONFIG_PATH)\n config = ::OpenStruct.new\n config.reflected_validations = @@reflected_validations\n silence_warnings do\n eval(::IO.read(CONFIG_PATH), binding, CONFIG_PATH)\n end\n end\n end", "def initialize( configFileDNE=Conf.filename_proposal )\n#p :xxx\n raise unless configFileDNE\n @configFileDNE = configFileDNE.dup.strip.gsub('\\\\', '/')\n @instant_save = false\n @section = nil\n \n if File.file?( @configFileDNE )\n dataFromFile = read\n self.replace( dataFromFile ) if dataFromFile\n end\n#exit\n self.section = nil unless self.has_key?(nil) # section \"nil\" always needed\n\n super()\n save() # writeable?\n end", "def initialize(file = nil)\n @file_name = file ? file : File.join(Dir.home, '.dodona.yml')\n @config = if !File.exist? file_name\n {}\n else\n YAML.load_file file_name\n end\n @config = DEFAULTS.merge(@config)\n end", "def set_defaults!\n __load_config( DEFAULTS )\n end", "def initialize\n set_config\n end", "def init!\n # check if configuration file is already created\n puts \"=> [MoIP] Sandbox mode enabled\" if sandbox?\n unless File.exist?(CONFIG_FILE)\n puts \"=> [Moip] The configuration could not be found at #{CONFIG_FILE.inspect}\"\n return\n end\n end", "def defaults\n return @config if @config\n\n @config = Configatron::Store.new\n file_path = File.expand_path('../../../config/xpaths.yml', __FILE__)\n hash_config = YAML::load_file(file_path)\n\n @config.configure_from_hash(hash_config)\n @config.lock!\n @config\n end", "def configuration\n @configuration ||= begin\n ConfigFile.new(GLOBAL_CONFIG).merge_file(LOCAL_CONFIG)\n rescue TypeError\n raise AssistedWorkflow::Error, \"Error on loading .awconfig files. Please check the content format.\"\n end\n end", "def load_configuration\n if self.config_file && File.exists?(self.config_file)\n configure_with_config_file\n else\n self.config_by = :environment\n super\n end\n\n # respect autorun and log_level env vars regardless of config method\n self.autorun = detect_autorun\n self.log_level = :info if log_level.blank?\n self.log_level = ENV['LIBRATO_LOG_LEVEL'] if ENV['LIBRATO_LOG_LEVEL']\n end", "def initialize(filename, environment = nil)\n raise \"Config #{filename} not found\" unless File.exist? filename\n @filename = filename\n @environment = environment || current_environment\n end", "def default_configuration=(_arg0); end", "def config\n @config ||= OpenStruct.new(YAML.load_file(self.config_path))\n end", "def config_file_defaults\n Chef::Config[:knife].save(true) # this is like \"dup\" to a (real) Hash, and includes default values (and user set values)\n end", "def initialize\n options = parse_options\n CONFIG[:user] = options[:user]\n $config = CONFIG.merge(YAML.load_file(\"#{options[:prefix]}/#{options[:'config-dir']}/config.yml\").rekey) rescue CONFIG.clone\n $config.merge!(options)\n [:'config-dir', :'pid-file', :'log-file', :'spool-dir'].each {|item| $config[item] = \"#{$config[:prefix]}/#{$config[item]}\".sub(/\\/\\//, '/') }\n $messages = MESSAGES.merge(YAML.load_file(\"#{$config[:'config-dir']}/messages.yml\").rekey) rescue MESSAGES.clone\n $recipients = YAML.load_file(\"#{$config[:'config-dir']}/recipients.yml\") rescue {}\n end", "def initialize\n @configuring = false\n @validating = false\n end", "def initialize( custom_config = {} )\n config = config_file.merge custom_config\n config = symbolize_keys config\n\n config[:username] = config[:api_key] if config[:api_key]\n config[:headers] ||= {}\n config[:request] ||= {}\n config[:response] ||= {}\n\n config[:headers][:accept] ||= \"application/hal+json\"\n\n # Copy the config into this Configuration instance.\n config.each { |k, v| self[k] = v }\n\n super()\n\n configure_user_agent\n configure_cache\n\n validate\n end", "def initializeDefaultParams()\n @fcName = nil # Flowcell name\n @baseCallsDir = nil # BaseCalls dir of the flowcell\n @useBasesMask = nil # Custom value to provide to BCL->FastQ convertor\n @sampleSheet = nil # Path to SampleSheet.csv\n yamlConfigFile = File.dirname(File.expand_path(File.dirname(__FILE__))) +\n \"/config/config_params.yml\" \n @configReader = YAML.load_file(yamlConfigFile)\n @queue = \"high\" # The processing queue on the cluster\n end", "def load!\n add!(File.join(DEFAULT_CONFIGURATION_DIRECTORY, DEFAULT_CONFIGURATION_FILE_NAME))\n end", "def initialize(config, facility, location, zip_file_name, inbound_file_information = nil)\n @config_yml = YAML::load(File.open(config))\n @facility = facility\n @location = location\n @zip_file_name = zip_file_name\n @inbound_file_information = inbound_file_information\n end", "def config_file_settings\n Chef::Config[:knife].save(false) # this is like \"dup\" to a (real) Hash, and does not include default values (just user set values)\n end", "def optional_config_file\n if ::File.exists?(@options.to_s)\n @options = @global.load_ruby_config(::File.expand_path(@options))\n end\n end", "def merge_with_default(config, config_file, unset_nil:); end", "def initialize\n @config = OpenStruct.new\n end", "def initialize\n bootstrap unless File.exist?(file)\n load_attributes\n end", "def initialize(defaults,cmd_opts)\n @fields = defaults\n if !cmd_opts[:config_file].nil?\n path = cmd_opts[:config_file]\n else\n path = defaults[:config_file]\n end\n data = YAML.load_file(path)\n # Now combine data:\n # defaults, config file, command line (low->high priority)\n data.each do |k,v|\n if EXPECTED.include? k.to_sym\n @fields[k.to_sym] = v\n else\n STDERR.puts \"Warning: unknown section '#{k}' in config file\"\n end\n end\n cmd_opts.each do |k,v|\n @fields[k] = v\n end\n end", "def initialize(config_file = nil)\n if config_file.nil?\n @mail = @password = ''\n return\n end\n\n config = load_yaml_file(config_file)\n unless config.has_key?('mail') && config.has_key?('password')\n raise ConfigurationError, \"#{config_file}: Invalid configuration file\"\n end\n\n @mail = config['mail']\n @password = config['password']\n end", "def initialize()\n @config_file=\"projects.yml\"\n @config = YAML.load_file(@config_file)\n end", "def initialize attributes={}\n self.config = attributes[:config]\n end", "def initialize(options = { })\n @options = DEFAULT_OPTIONS.merge(options)\n \n load_config\n end", "def init_default_attributes\n self.config_params ||= DEFAULT_CONFIG_PARAMS\n self.has_inventory = true\n end", "def load_config\n @config = YAML.safe_load(ERB.new(File.read(config_path)).result)\n @queue_ahead = @config[\"queue_ahead\"] || Task::DEFAULT_QUEUE_AHEAD_MINUTES\n @queue_name = @config[\"queue_name\"] || \"default\"\n @time_zone = @config[\"tz\"] || Time.zone.tzinfo.name\n @config.delete(\"queue_ahead\")\n @config.delete(\"queue_name\")\n @config.delete(\"tz\")\n end", "def init_config()\n options_apply_filter(\"DEFAULT\")\n end", "def init_run_conf\n exclusively do\n if @next_run_conf\n @run_conf = @next_run_conf\n @next_run_conf = nil\n else\n @run_conf = new_run_conf\n end\n\n @run_conf.save\n end\n end", "def config\n ensure_config_exists\n @config ||= (YAML.load_file(config_file) || {})\n end", "def initialize(configuration_file_location)\t\t\r\n\t\tfile = File.new( configuration_file_location )\r\n\t\tdoc = REXML::Document.new file\r\n\t\t\r\n\t\t@visitor = doc.elements[\"honeyCConfiguration/visitor\"].text\r\n\t\t@queuer = doc.elements[\"honeyCConfiguration/queuer\"].text\r\n\t\t@analysis_engine = doc.elements[\"honeyCConfiguration/analysisEngine\"].text\r\n\tend", "def initialize\n define_os\n define_path\n read_settings\n end", "def config\n\t\t\t@config ||= begin\n\t\t\t\tfile = File.join(self.location, \"config.yaml\")\n\t\t\t\tif File.exists?(file)\n\t\t\t\t\tYAML::load_file(file)\n\t\t\t\telse\n\t\t\t\t\t{}\n\t\t\t\tend\n\t\t\tend\n\t\tend", "def initialize\n @tree = YAML::parse(File.open(CONFIG_FILE))\n end", "def init\n Config.load_yaml\n Log.init\n reset\n end", "def initialize(options={})\n self.config_file = options[:config_file] || 'config/librato.yml'\n super()\n self.log_prefix = '[librato-rails] '\n end", "def config\n @config ||= Config.create ConfigLoader.new(root, CONFIG_FILE).to_hash, options.merge_config\n end", "def load_config\n cfg = File.open(CONFIG) { |yf| YAML::load( yf ) } if File.exists?(CONFIG)\n # => Ensure loaded data is a hash. ie: YAML load was OK\n if cfg.class != Hash\n raise \"ERROR: Configuration - invalid format or parsing error.\"\n else\n if cfg['login'].nil?\n raise \"ERROR: Configuration: login not defined.\"\n end\n end\n\n return cfg\nend", "def initialize(config={})\n @configuration = config\n end", "def initialize(hash_or_file = self.class.source, section = nil)\n #puts \"new! #{hash_or_file}\"\n case hash_or_file\n when nil\n raise Errno::ENOENT, \"No file specified as Settingslogic source\"\n when Hash\n self.replace hash_or_file\n else\n file_contents = open(hash_or_file).read\n hash = file_contents.empty? ? {} : YAML.load(ERB.new(file_contents).result).to_hash\n if self.class.namespace\n hash = hash[self.class.namespace] or return missing_key(\"Missing setting '#{self.class.namespace}' in #{hash_or_file}\")\n end\n self.replace hash\n end\n @section = section || self.class.source # so end of error says \"in application.yml\"\n create_accessors!\n end", "def configure_from_options\n if @options[:config]\n config = Configuration.new(@path, @options[:config])\n config.from_options\n end\n end", "def load_config\n @configuration = Configuration.find :first\n end", "def reset\n Configuration.new\n end", "def initialize(config = {})\n init_config(config)\n end", "def test_initialize_filename\n assert_nothing_raised do\n dfp_api = DfpApi::Api.new(DEFAULT_CONFIG_FILENAME)\n check_config_data(dfp_api.config)\n end\n end", "def initialize(config = {})\n init_config(config)\n end", "def initialize(config = {})\n init_config(config)\n end", "def load_default_config\n # Load the default\n path = File.join(::Lyricli.root, \"config\", @defaults_path)\n\n if File.exist?(path)\n file = File.new(path, \"r\")\n @config = MultiJson.decode(file.read)\n else\n @config = {}\n end\n end", "def initialize(config = nil)\n self.config = config || Cartage::Config.load(:default)\n end", "def config\n raise ScribdFuError, \"#{ConfigPath} does not exist\" unless File.file?(ConfigPath)\n\n # Load the config file and strip any whitespace from the values\n @config ||= YAML.load_file(ConfigPath).each_pair{|k,v| {k=>v.to_s.strip}}.symbolize_keys!\n end", "def initialize(conf)\n super(conf) ;\n setupFiles() ;\n @tripId = 0 ;\n @cleanUp = getConf(:cleanUp) ;\n end", "def process_configuration\n self.configuration = YAML::load(File.read('.codecom.yml'))\n end", "def load_config\n if params[:config].given?\n @config = File.open(File.expand_path(params[:config].value)) { |f| JSON.load(f) }\n\n @config.each do |key, value|\n if params.has_key?(key) and params[key].values == params[key].defaults\n params[key].values = [*value]\n params[key].given = true\n end\n end\n\n end\n end", "def from_config\n config ||= YAML::load(File.open((File.join(File.dirname(__FILE__), 'config.yml'))))\nend" ]
[ "0.7210453", "0.71546143", "0.71546143", "0.70793617", "0.70626146", "0.70488423", "0.6986784", "0.6969369", "0.681132", "0.6809749", "0.67693996", "0.67334914", "0.67288727", "0.6713797", "0.6652697", "0.66519606", "0.6637692", "0.6631253", "0.66237146", "0.6612343", "0.6612132", "0.6612132", "0.6598716", "0.65860486", "0.6568586", "0.6525838", "0.65099376", "0.6504098", "0.6501996", "0.6488579", "0.6485058", "0.64628625", "0.6440942", "0.64271367", "0.6424772", "0.6392624", "0.6359599", "0.6359391", "0.63523906", "0.6329361", "0.6319198", "0.6311225", "0.6307182", "0.63071054", "0.6297543", "0.629741", "0.6268646", "0.6262381", "0.62552994", "0.6251855", "0.623396", "0.62268686", "0.6221234", "0.62171805", "0.62151664", "0.6211203", "0.62025523", "0.61889815", "0.61817616", "0.61807567", "0.61742616", "0.6172982", "0.6168163", "0.61679846", "0.61597335", "0.6150034", "0.61476237", "0.61366284", "0.6135937", "0.613354", "0.6128778", "0.6127435", "0.6120302", "0.6114342", "0.61132437", "0.61094016", "0.6107211", "0.6106408", "0.6103939", "0.61035156", "0.60958177", "0.6085177", "0.60799617", "0.60594106", "0.6056872", "0.6051533", "0.60443866", "0.604359", "0.6041726", "0.60416746", "0.60416746", "0.60416746", "0.60416746", "0.60400176", "0.603534", "0.6033363", "0.6025177", "0.60224044", "0.6020238", "0.6019858" ]
0.80591923
0
Resets configuration instance to initial values
def reset @config = empty_config end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset\n Configuration.new\n end", "def reset\n self.configuration = Configuration.new\n end", "def reset_config\n config.reset_to_defaults\n end", "def reset\n @config = Config.new\n end", "def reset\n @configuration = Configuration.new\n end", "def reset\n configure({})\n end", "def reset!\n @config = Configuration.new\n end", "def reset\n CONFIGURATION_DEFAULTS.each { |k, v| send(\"#{k}=\", v) }\n self\n end", "def reset!\n self.configuration = Configuration.new\n end", "def reset_configuration\n @configuration = nil\n end", "def reset\n @config = nil\n end", "def reset\n @@config_instance = nil\n end", "def reset_config\n\t\t\t@config = {}\n\t\tend", "def reset!\n configure do |c|\n DEFAULTS.each { |k, v| c.send(\"#{k}=\", v) }\n end\n end", "def reset\n @config = {}\n write_config\n end", "def reset_configuration!\n @configuration = Auth::Configuration.new\n end", "def reset_config!\n @log = nil\n @logger = nil\n @log_level = nil\n end", "def reset_config!\n @log = nil\n @logger = nil\n @log_level = nil\n end", "def clear\n self.configuration = {}\n end", "def reset\n self.configuration = ({})\n config_contexts.values.each(&:reset)\n end", "def reset\n reset_adapters\n reset_config\n reset_handlers\n reset_hooks\n end", "def reset\n @config_file = nil\n set_defaults\n load_from_file if config_file\n end", "def reset!\n @orm = @namespace = @source = @setting_class = nil\n self.config = nil\n self.raise_missing = nil\n self.report_missing = nil\n self.typecast_on_write = nil\n self.password_secret = nil\n end", "def reset\n @config = nil\n @client = nil\n end", "def reset\n VALID_CONFIG_OPTIONS.each { |opt| self.reset_attribute(opt) }\n end", "def reset!\n @defaults.each { |key, value| instance_variable_set(key, value) }\n end", "def reset!\n @defaults.each { |key, value| instance_variable_set(key, value) }\n end", "def reset!\n tap { set_defaults }\n end", "def reset!\n @_store = {:default => Configatron::Store.new}\n end", "def reset!\n @defaults.each do |k, v|\n instance_variable_set(k, v)\n end\n end", "def reset\n reset_config\n reset_driver\n end", "def reset_conf(&block)\n reset_conf_sub\n yield\n\n # reset again to go back to default setting later. Otherwise,\n # above setting is kept later.\n reset_conf_sub\n end", "def reload_configuration!\n @configuration = nil\n end", "def reload_configuration!\n @configuration = nil\n end", "def reload_config\n @config = nil\n end", "def reset\n VALID_CONFIG_OPTIONS.each { |opt| self.send(\"#{opt}=\", nil) }\n self.logger = nil\n end", "def reset!\n Whitehouse::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", Whitehouse::Default.options[key])\n end\n self\n end", "def reset!\n @options = defaults\n end", "def reset!\n @options = defaults\n end", "def reset!\n reset_endpoints!\n reset_routes!\n reset_validations!\n end", "def reset\n self.instance_variables.each do |var|\n instance_variable_set(var, nil)\n end\n initialize\n end", "def reset_defaults; end", "def reset\n self.tap do |c|\n c.base_uri = DEFAULT_BASE_URI\n c.endpoint = DEFAULT_END_POINT\n c.api_secret = DEFAULT_API_SECRET\n c.api_key = DEFAULT_API_KEY\n end\n end", "def reset!\n DeskApi::Configuration.keys.each do |key|\n send(\"#{key}=\", DeskApi::Default.options[key])\n end\n self\n end", "def reset!\n self.api_key \t = DEFAULT_API_KEY\n self.adapter = DEFAULT_ADAPTER\n self.endpoint = DEFAULT_ENDPOINT\n self.user_agent = DEFAULT_USER_AGENT\n self\n end", "def reset\n keys.each do |key|\n instance_variable_set(:\"@#{key}\", defaults[key])\n self\n end\n end", "def reset\n initialize(@options)\n end", "def reset(options={})\n options = {\n :clear => true\n }.merge(options)\n\n registry.each do |option|\n if option.respond_to?(:reset)\n option.reset\n end\n end\n\n config.clear if options[:clear]\n self\n end", "def reset\n initialize\n @log = nil\n @default_model = nil\n end", "def reset!\n initialize\n end", "def reset\n set Exchange::Configuration::DEFAULTS[key]\n end", "def clear\n reset_defaults\n self\n end", "def reset(scope = :all)\n configuration.reset(scope)\n end", "def reset\n self.adapter = DEFAULT_ADAPTER\n self.user_login = DEFAULT_USER_LOGIN\n self.user_password = DEFAULT_USER_PASSWORD\n self.endpoint = DEFAULT_ENDPOINT\n self.format = DEFAULT_FORMAT\n self.proxy = DEFAULT_PROXY\n self.cookie = DEFAULT_COOKIE\n self.user_agent = DEFAULT_USER_AGENT\n self\n end", "def reset\n self.company_id = DEFAULT_COMPANY_ID\n self.user_key = DEFAULT_USER_KEY\n self.secret_key = DEFAULT_SECRET_KEY\n self.endpoint = DEFAULT_ENDPOINT\n end", "def reset_initial_values\n @initial_values.clear if @initial_values\n @missing_initial_values.clear if @missing_initial_values\n end", "def reset\n self.adapter = DEFAULT_ADAPTER\n self.username = DEFAULT_USERNAME\n self.password = DEFAULT_PASSWORD\n self.organization = DEFAULT_ORGANIZATION\n self.endpoint = DEFAULT_ENDPOINT\n self.version = DEFAULT_VERSION\n self.path_prefix = DEFAULT_PATH_PREFIX\n self.proxy = DEFAULT_PROXY\n self.user_agent = DEFAULT_USER_AGENT\n self.connection_options = DEFAULT_CONNECTION_OPTIONS\n self\n end", "def reset\n self.adapter = DEFAULT_ADAPTER\n self.connection_options = DEFAULT_CONNECTION_OPTIONS\n self.client_id = DEFAULT_CLIENT_ID\n self.client_secret = DEFAULT_CLIENT_SECRET\n self.endpoint = DEFAULT_ENDPOINT\n self.authorize_endpoint = DEFAULT_AUTHORIZE_ENDPOINT\n self.token_endpoint = DEFAULT_TOKEN_ENDPOINT\n self.gateway = DEFAULT_GATEWAY\n self.access_token = DEFAULT_ACCESS_TOKEN\n self.proxy = DEFAULT_PROXY\n self.user_agent = DEFAULT_USER_AGENT\n self\n end", "def reset\n self.adapter = DEFAULT_ADAPTER\n self.client_id = DEFAULT_CLIENT_ID\n self.client_secret = DEFAULT_CLIENT_SECRET\n self.endpoint = DEFAULT_ENDPOINT\n self.user_agent = DEFAULT_USER_AGENT\n self\n end", "def reset!\n Foxkit::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", Foxkit::Default.options[key])\n end\n self\n end", "def reset!\n @options = {}\n end", "def reset\n set(default_preferences)\n end", "def reset!\n Unleashed::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", Unleashed::Default.options[key])\n end\n\n self\n end", "def reset\n self.adapter = DEFAULT_ADAPTER\n self.endpoint = DEFAULT_ENDPOINT\n self.proxy = DEFAULT_PROXY\n self.user_agent = DEFAULT_USER_AGENT\n self\n end", "def reset!\n @setting_objects = @setting_templates.map { |k, _| [k, []] }.to_h\n @settings.values.each(&:reset!)\n end", "def reset!\n instance.reset!\n end", "def reset!\n instance.reset!\n end", "def reset\n self.options = nil\n self.option_processors = nil\n end", "def reset\n (@settings||{}).each do |name,instance| \n remove_setter(name)\n remove_getter(name)\n remove_boolean_getter(name)\n instance.destroy\n end\n @settings = Hash.new\n end", "def reset\n @options = VALID_OPTIONS_KEYS.inject({}) do |opts, k|\n default_option = OnTheSnow::Config.const_get(\"DEFAULT_#{k.upcase}\")\n self.send(\"#{k}=\", default_option)\n opts[k.to_s] = default_option #unless default_option.nil?\n opts\n end\n self\n end", "def reset\n self.api_key = DEFAULT_API_KEY\n self.api_version = DEFAULT_API_VERSION\n self.endpoint = DEFAULT_ENDPOINT\n self.adapter = DEFAULT_ADAPTER\n end", "def reset!\n self.instance_variables.each { |variable| instance_variable_set(variable, nil) }\n self\n end", "def reset\n # Empty, but subclasses will override this.\n end", "def reset!\n self.api_username = DEFAULT_API_USERNAME\n self.api_key = DEFAULT_API_KEY\n self.adapter = DEFAULT_ADAPTER\n self.endpoint = DEFAULT_ENDPOINT\n self.user_agent = DEFAULT_USER_AGENT\n self.raise_errors = DEFAULT_RAISE_ERRORS\n self\n end", "def reset\n @params = initial_params\n self\n end", "def reset!\n Gocdkit::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", Gocdkit::Default.options[key])\n end\n self\n end", "def reset\n self.adapter = DEFAULT_ADAPTER\n self.endpoint = DEFAULT_ENDPOINT\n self.proxy = DEFAULT_PROXY\n self.user_agent = DEFAULT_USER_AGENT\n # self.response = DEFAULT_RESPONSE\n self.faraday_options = DEFAULT_FARADAY_OPTIONS\n self.login = DEFAULT_LOGIN\n self.pass = DEFAULT_PASS\n self\n end", "def reset!\n @options = Name.defaults.dup\n end", "def reset\n self.request_headers = DEFAULT_REQUEST_HEADERS\n self.endpoint = DEFAULT_ENDPOINT\n self.monitoringdata_endpoint = DEFAULT_MONITORINGDATA_ENDPOINT\n self.applogs_endpoint = DEFAULT_APPLOGS_ENDPOINT\n self.apikey = DEFAULT_APIKEY\n end", "def reset\n self.client_account = DEFAULT_CLIENT_ACCOUNT\n self.client_secret = DEFAULT_CLIENT_SECRET\n self.user_agent = DEFAULT_USER_AGENT\n self.endpoint = DEFAULT_ENDPOINT\n self.adapter = DEFAULT_ADAPTER\n self.connection_type = DEFAULT_CONNECTION\n end", "def reset!\n CodesWholesale::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", CodesWholesale::Default.options[key])\n end\n self\n end", "def reset!\n defaults = Settler.config[self.key]\n self.label = defaults['label']\n self.value = defaults['value']\n self.editable = defaults['editable']\n self.deletable = defaults['deletable']\n self.deleted = false\n save(:validate => false)\n end", "def reset!\n HeiaHeia::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", HeiaHeia::Default.options[key])\n end\n self\n end", "def reset\n @options = Marshal.load(@default)\nend", "def reset\n providers.clear\n configured_providers.each { |k, v| self[k] = v }\n self.default = configured_default\n end", "def reset!\n self.instance.reset!\n end", "def reset!\n self.instance.reset!\n end", "def tcfg_reset\n @tcfg_resolved_config = nil\n end", "def reset\n VALID_OPTIONS_KEYS.each{|k| send(\"#{k}=\", nil)}\n self.endpoint = DEFAULT_ENDPOINT\n self.proxy = DEFAULT_PROXY\n self.api_version = DEFAULT_API_VERSION\n self\n end", "def reset_conf_sub\n Juli::Util::Config.instance_variable_set('@singleton__instance__', nil)\n $_repo = nil\n end", "def reset\n self.api_key = DEFAULT_API_KEY\n self.user_agent = DEFAULT_USER_AGENT\n self.search_query_defaults = DEFAULT_SEARCH_SETTINGS\n self\n end", "def reset\n self.user_agent = DEFAULT_USER_AGENT\n self.environment = DEFAULT_ENVIRONMENT\n self.api_version = DEFAULT_API_VERSION\n self.server_url = DEFAULT_SERVER_URL\n self.client_name = DEFAULT_CLIENT_NAME\n self.client_key = DEFAULT_CLIENT_KEY\n self.connection_options = DEFAULT_CONNECTION_OPTIONS\n self.middleware = DEFAULT_MIDDLEWARE\n self.accept = DEFAULT_ACCEPT\n self\n end", "def reset!\n Promisepay::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", Promisepay::Default.options[key])\n end\n self\n end", "def reset!\n HabitatSupervisor::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", HabitatSupervisor::Default.options[key])\n end\n self\n end", "def reset\n @git = nil\n @configuration = nil\n end", "def reset\n self.adapter = DEFAULT_ADAPTER\n self.connection_options = DEFAULT_CONNECTION_OPTIONS\n self.consumer_key = DEFAULT_CONSUMER_KEY\n self.consumer_secret = DEFAULT_CONSUMER_SECRET\n self.endpoint = DEFAULT_ENDPOINT\n self.xauth_username = DEFAULT_XAUTH_USERNAME\n self.xauth_password = DEFAULT_XAUTH_PASSWORD\n self.proxy = DEFAULT_PROXY\n self.user_agent = DEFAULT_USER_AGENT\n self.logger = DEFAULT_LOGGER\n self\n end", "def reset_config\n configure do |config|\n config.provider = :payu\n\n # payu configuration\n config.pos_id = 999\n config.pos_auth_key = 'pos_auth_key'\n config.key1 = 'key1'\n config.key2 = 'key2'\n\n config.test_mode = false\n end\n end", "def reset\n\t\t\tself.access_token = DEFAULT_ACCESS_TOKEN\n\t\t\tself.authorization_endpoint = DEFAULT_AUTHORIZATION_ENDPOINT\n\t\t\tself.client_id = DEFAULT_CLIENT_ID\n\t\t\tself.client_secret = DEFAULT_CLIENT_SECRET\n\t\t\tself.endpoint = DEFAULT_ENDPOINT\n\t\t\tself.proxy = DEFAULT_PROXY\n\t\t\tself.user_agent = DEFAULT_USER_AGENT\n\t\tend", "def reset\n self.api_key = nil\n self.endpoint = DEFAULT_ENDPOINT\n self.user_agent = DEFAULT_USER_AGENT\n self.platform_client_id = nil\n self.platform_client_secret = nil\n self\n end", "def reload_config!\n @config = nil\n load_config!\n self\n end" ]
[ "0.8442297", "0.83911383", "0.8345757", "0.82853997", "0.82737195", "0.82721204", "0.825779", "0.8239228", "0.82293814", "0.8137434", "0.8110226", "0.8109662", "0.8011063", "0.7871168", "0.77363336", "0.7604266", "0.75576735", "0.75576735", "0.7519718", "0.75136846", "0.74923813", "0.7445896", "0.7443977", "0.7434011", "0.73840755", "0.73702717", "0.73702717", "0.73540133", "0.7344203", "0.7332175", "0.7330726", "0.72976106", "0.7289405", "0.7289405", "0.72658145", "0.71998274", "0.71355736", "0.71136546", "0.71136546", "0.7045906", "0.70452857", "0.7038708", "0.7035636", "0.70291656", "0.7024834", "0.7017064", "0.7015772", "0.7015416", "0.6997582", "0.69919884", "0.6988102", "0.69652736", "0.69559455", "0.693261", "0.69296646", "0.6915319", "0.6895036", "0.6894439", "0.68936634", "0.68828017", "0.6881594", "0.6881059", "0.68768555", "0.68752885", "0.68676347", "0.6847454", "0.6847454", "0.684102", "0.6836478", "0.68330944", "0.68147737", "0.6813957", "0.68061525", "0.6806084", "0.6794706", "0.6792598", "0.6786613", "0.6780241", "0.67767036", "0.6776336", "0.6773604", "0.6769683", "0.67622435", "0.67621285", "0.67568743", "0.6753287", "0.6753287", "0.67525166", "0.6747112", "0.67193466", "0.6716054", "0.67095315", "0.670652", "0.6699275", "0.66951585", "0.66915065", "0.66913295", "0.6685372", "0.6679588", "0.6676265" ]
0.85413563
0
Sets absolute path of cloud path
def cloud_path=(path) raise Error::InvalidCloudPath unless File.directory?(path) @config[:cloud_path] = File.expand_path(path) config_to_file end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def path_set(path)\n absolute_path = (Pathname.new(uri.path) + path).to_s\n rebuild_uri :path => absolute_path\n end", "def set_path(path)\n path\n end", "def path=(new_path)\n super\n if new_path[0..0] != '/' # addressable adds a / but scp-style uris are altered by this behavior\n @path = path.sub(%r|^/+|,'')\n @normalized_path = nil\n validate\n end\n path\n end", "def initialize path\n @absolute_path = File.expand_path(path)\n end", "def set_path\n @file_path = @s3_local_object.body.path\n end", "def path=(path=\"\")\n path = Dir.pwd if not path or path.empty?\n @path = File.expand_path(path)\n end", "def set_path\n self.path = File.join(self.store_dir, self.filename)\n end", "def absolute_path(options = {})\n if !@absolute_path\n # Pre-conditions\n raise ArgumentError.new(\"No document root set\") if @document_root.nil?\n\n @absolute_path = filename.sub(%r{^#@document_root}, '').sub(/^\\/?/, '/')\n @absolute_path = \"#{Juicer::Asset::Path.host_with_scheme(options[:host])}#@absolute_path\"\n end\n\n path_with_cache_buster(@absolute_path, options)\n end", "def local_path_to_file=(value)\n @attributes[:local_path_to_file] = value\n reset_attributes\n calculate_attributes\n value\n end", "def post_configure\n super\n @path = File.expand_path(path)\n end", "def absolute_path(path)\n File.join(self.mounting_point.path, 'public', path)\n end", "def path=(path)\n @path = File.expand_path(path)\n end", "def local_path=(v)\n return unless v\n @local_path = Pathname.new(v)\n raise \"No absolute paths\" if @local_path.absolute?\n raise \"No dots\" if @local_path.to_s =~ /\\.\\/|\\.\\\\/\n @local_path\n end", "def fix_path!\n @path = path.sub(/^\\~\\//, \"#{ENV['HOME']}/\")\n end", "def set_path(path)\n @path = path\n end", "def path=(value)\n @path = value\n end", "def path=(value)\n @path = value\n end", "def path=(value)\n @path = value\n end", "def path=(value)\n @path = value\n end", "def root=(value)\n @root = Utils::Kernel.Pathname(value).realpath\n end", "def path=(path = nil)\n path = Dir.pwd if not path or path.strip.empty?\n @path = File.expand_path(path)\n end", "def path=(path)\n path = \"#{path}/\" unless path[path.size - 1, 1] == '/'\n @paths = { :default => path }\n end", "def path=(path)\n @path= path\n end", "def root_path(path) File.join(root, path) end", "def set_default_path\n unless @resource_config[:path]\n suffix = self.to_s.split('::').last\n @resource_config[:path] = Utility.underscore(suffix)\n end\n end", "def path=(_); end", "def path=(_); end", "def path=(_); end", "def path=(_); end", "def path=(_); end", "def path=(_); 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 path(path)\n @path = path\n end", "def setPath(path)\n @currentPath = path.clone\n @root = @currentPath.getRoot unless path.empty?\n end", "def ascp_path=(v)\n @path_to_ascp=v\n end", "def set_path(v)\n @path = v\n end", "def absolute_path(path)\n path = Pathname.new(path)\n return Pathname.new(@config.base_path) + path unless path.absolute?\n path\n end", "def path(arg=nil)\n # set_or_return is a magic function from Chef that does most of the heavy\n # lifting for attribute access.\n set_or_return(:path, arg, kind_of: [String])\n end", "def set_path_to_cartocss_project_folder(path)\n @style_path = path\n end", "def fetch(storage_path, local_path)\n super\n FileUtils.cp absolute_path(storage_path), local_path\n end", "def url\n host = @uploader.ucloud_cdn_host || @uploader.ucloud_bucket_host\n return nil unless host\n [host, @path].join(\"/\")\n end", "def set_ca_path(opts)\n opts = check_params(opts,[:ca_paths])\n super(opts)\n end", "def full_path\n container.root.join(path)\n end", "def full_path\n container.root.join(path)\n end", "def path=(new_path)\n location = self.class.new_location(conn_id, new_path, :default => :Root)\n if !location.path.empty?\n @location = location\n location_changed!\n end\n end", "def capath=(value)\n Curl.set_option(:capath, value_for(value, :string), handle)\n end", "def path=(new_path)\n begin\n self.dev_path = Sys::Filesystem.mount_point new_path\n @dev_stat = nil\n rescue SystemCallError\n self.dev_path = nil\n end\n super\n end", "def set_root_path!\n raise 'IRONNAILS_ROOT is not set' unless defined?(::IRONNAILS_ROOT)\n raise 'IRONNAILS_ROOT is not a directory' unless File.directory?(::IRONNAILS_ROOT)\n\n @root_path =\n # Pathname is incompatible with Windows, but Windows doesn't have\n # real symlinks so File.expand_path is safe.\n if ENV['OS'] == 'Windows_NT'.freeze\n File.expand_path(::IRONNAILS_ROOT)\n\n # Otherwise use Pathname#realpath which respects symlinks.\n else\n Pathname.new(::IRONNAILS_ROOT).realpath.to_s\n end\n\n Object.const_set(:RELATIVE_IRONNAILS_ROOT, ::IRONNAILS_ROOT.dup) unless defined?(::RELATIVE_IRONNAILS_ROOT)\n\n ::IRONNAILS_ROOT.replace @root_path\n end", "def root=(path)\n self.config[:root] = path\n end", "def path=(path)\n @path = to_pathname(path)\n end", "def config_path=(value)\n @config_path = value\n end", "def fullpath\n File.join(@root, @path)\n end", "def fullpath\n @fullpath = File.join(root, path)\n end", "def compiled_path=(path); end", "def path=(p)\n @path = p\n end", "def project_path path, strict=true\n path_under 'root', path, strict\n end", "def adjust_cb_path\n if @opts[:path]\n @opts[path] = File.join(Dir.pwd, @opts[:path])\n else\n @opts[:path] = Dir.pwd\n end\n end", "def path=(new_path)\n @path = Pathname.new(new_path).expand_path\n end", "def _ROOT_FILE_STORE\n return \"/home/cesteam/cloudstorge/\"\nend", "def public_path=(path)\n if path == 'auto'\n path = self.public_path = if in_rails?\n Rails.public_path\n else\n # TODO other frameworks handling in here\n \"public\"\n end\n end\n\n # getting rid of the trailing slash\n if path.slice(path.size-1, path.size) == '/'\n path = path.slice(0, path.size-1)\n end\n\n @public_path = path.dup\n end", "def path(path)\n return self if path.nil?\n return root.path(path[1..-1]) if path[0] == ?/\n root.path(\"#{@path}#{path}\")\n end", "def full_path\n self.read_attribute(:full_path) || self.assign_full_path\n end", "def full_path_set\n self.full_path = self.parent ? \"#{self.parent.full_path}/#{self.slug}\".squeeze(\"/\") : \"/#{self.slug}\".squeeze(\"/\")\n end", "def save_path_with_own_path\n File.join(save_path, path)\n end", "def site_creation_default_managed_path=(value)\n @site_creation_default_managed_path = value\n end", "def set_hostpath\n @hostpath = \"#{request.scheme}://#{request.host}:#{request.port}\"\n end", "def relativize_root_path(path)\n path.to_s.sub(/^#{Regexp.escape(@root)}/, '$root')\n end", "def attach_canonical_path\n self.paths |= [self.canonical_path]\n nil\n end", "def path=(v)\n check_path(v)\n set_path(v)\n v\n end", "def rebase(base_path)\n path = Pathname.new(filename).relative_path_from(Pathname.new(base_path)).to_s\n\n Juicer::Asset::Path.new(path,\n :base => base_path,\n :hosts => hosts,\n :document_root => document_root)\n end", "def absolute_path\n if is_url?\n # Use the last path component without the query string plus the name\n # of the resource in Base64. This should be both mildly readable and\n # also unique per invocation.\n url_part = URI(path).path.split(/\\//).last\n base64_name = Base64.strict_encode64(name).gsub(/\\=/, '')\n ::File.join(Chef::Config[:file_cache_path], \"#{base64_name}_#{url_part}\")\n else\n ::File.expand_path(path, Chef::Config[:file_cache_path])\n end\n end", "def set_system(name)\n system_dir = File.join(base_systems_dir, name)\n unless File.directory?(system_dir)\n err \"CloudFoundry system path '#{system_dir.red}` does not exist\"\n end\n \n say \"CloudFoundry system set to #{system_dir.green}\"\n common_config.target_system = system_dir\n common_config.save\n end", "def absolute_uri_path(path)\n \"#{root_uri}#{path}\"\n end", "def file=(value)\n begin\n #Kdb.open do |kdb|\n backend_root = Kdb::Key.new Kdbtools::MOUNTPOINTS_PATH\n backend_root.add_basename @resource[:name]\n\n # mountconf = Kdb::KeySet.new\n # kdb.get mountconf, backend_root\n perform_kdb_action backend_root do |mountconf|\n\n if path_key.nil?\n raise Puppet::Error, \"path key not found in backend config\"\n end\n\n path_key.value = @resource[:file]\n\n # kdb.set mountconf, backend_root\n end\n rescue\n Puppet.debug \"could not set file within backend, fallback to recreate mountpoint\"\n # fallback, recreate mountpoint\n recreate\n end\n end", "def path= (input_path)\n @path = input_path\n update_files\n @path\n end", "def root_path(*path) File.join(root, *path) end", "def path=(value)\r\n result = Api.proj_context_set_database_path(self.context, value, nil, nil)\r\n unless result == 1\r\n Error.check_context(self.context)\r\n end\r\n self\r\n end", "def abspath path\n if path[0] != '/'\n @homedir + '/' + path\n else\n path\n end\n end", "def default_location(path)\n @default_location = File.expand_path(path)\n end", "def path_external\n @path_external ||= File.join(folder_external_documents, external_name)\n end", "def set_root_path!\n raise 'APP_ROOT is not set' unless defined?(::APP_ROOT)\n raise 'APP_ROOT is not a directory' unless File.directory?(::APP_ROOT)\n\n @root_path =\n # Pathname is incompatible with Windows, but Windows doesn't have\n # real symlinks so File.expand_path is safe.\n if RUBY_PLATFORM =~ /(:?mswin|mingw)/\n File.expand_path(::APP_ROOT)\n\n # Otherwise use Pathname#realpath which respects symlinks.\n else\n Pathname.new(::APP_ROOT).realpath.to_s\n end\n\n Object.const_set(:RELATIVE_APP_ROOT, ::APP_ROOT.dup) unless defined?(::RELATIVE_APP_ROOT)\n ::APP_ROOT.replace @root_path\n end", "def path\n @path ||= filters.uri_escape(absolute_url) if absolute_url\n end", "def path\n @path ||= filters.uri_escape(absolute_url) if absolute_url\n end", "def absolute_url\n domain + path\n end", "def path=(path)\n path = Pathname.new(path)\n\n if path.absolute?\n relative = path.relative_path_from(directory)\n else\n relative = path\n end\n\n if relative.to_s.include?('..')\n fail IllegalDirectoryError.new(path, directory)\n end\n\n set_attributes_from_filename!(relative)\n end", "def path=(path)\n path = Pathname.new(path)\n\n if path.absolute?\n relative = path.relative_path_from(directory)\n else\n relative = path\n end\n\n if relative.to_s.include?('..')\n fail IllegalDirectoryError.new(path, directory)\n end\n\n set_attributes_from_filename!(relative)\n end", "def set_root() = self.destination_root = name", "def absolutepath\n if absolute?\n self\n elsif to_s == \".\"\n realpath\n else\n parent.absolutepath + self.basename\n end\n end", "def set_filename(req, res)\n original_root = @root.dup\n if req.path_info.start_with?(\"/#{ ViteRuby.config.public_output_dir }/\")\n @root = ViteRuby.config.root.join(ViteRuby.config.public_dir)\n end\n super.tap { @root = original_root }\n end", "def absolute_path(path, reference = @pwd)\n path = File.expand_path(File.join(reference, path)) unless path.start_with? '/'\n path\n end", "def effective(p)\n\t\t\tp = if(p.is_a?(Pathname)) then p else Pathname.new(p) end\n\t\t\tif(p.absolute?) then p else @root + p end\n\t\tend", "def update_path\n update_column :path, file.url unless url?\n end", "def path_set(new_path)\n if new_path.is_a?(Array)\n new_path = new_path.join(File::PATH_SEPARATOR)\n end\n ENV[\"PATH\"] = new_path\n end", "def api_path(path)\n \"#{options[:base_path]}/#{path}\" || \"/#{path}\"\n end", "def initialize path\n @image_path = Pathname.new(path).expand_path\n end", "def root_file_path; end", "def project_root(path)\n @project_root = path\n end", "def MakeAbsolute()\n return ProjectPath.new(AbsolutePath())\n end", "def path(arg = nil)\n set_or_return(:path,\n arg,\n kind_of: String,\n default: ::File.join('/etc/default', app_name))\n end", "def zk_root=(path)\n @@mutex.synchronize { @@zk_root = path.dup.freeze }\n end" ]
[ "0.65640116", "0.6447197", "0.63692504", "0.6271299", "0.6270105", "0.62292993", "0.6225625", "0.61635387", "0.6145113", "0.61386853", "0.61344", "0.6098893", "0.6085709", "0.6024676", "0.60211545", "0.6008003", "0.59889364", "0.59889364", "0.59889364", "0.59530973", "0.592807", "0.5920178", "0.58984655", "0.5893623", "0.5891283", "0.5877818", "0.5877818", "0.5877818", "0.5877818", "0.5877818", "0.5877818", "0.58751285", "0.58747584", "0.5861835", "0.5842951", "0.58393", "0.5834758", "0.5819893", "0.5815954", "0.5789963", "0.5779247", "0.57623386", "0.57393324", "0.57393324", "0.57021993", "0.5700442", "0.5696288", "0.56908834", "0.56814694", "0.5676442", "0.56727755", "0.5667269", "0.5651616", "0.56390333", "0.563279", "0.56325275", "0.5622387", "0.5618519", "0.5616107", "0.56017643", "0.5601108", "0.5597991", "0.5595962", "0.55956924", "0.55850464", "0.5567862", "0.55655277", "0.55647045", "0.55511755", "0.5545467", "0.55447406", "0.55404747", "0.5539258", "0.55306107", "0.5519481", "0.5517667", "0.5511382", "0.551096", "0.5509672", "0.54904586", "0.54852295", "0.5483574", "0.5483574", "0.5482956", "0.5480405", "0.5480405", "0.54678667", "0.5465669", "0.5455118", "0.5454457", "0.54462355", "0.54443675", "0.54413414", "0.5434443", "0.54318756", "0.54282504", "0.54202294", "0.54190445", "0.54123425", "0.5409915" ]
0.75120026
0
GET /oauth_tokens GET /oauth_tokens.xml
def index @oauth_tokens = OauthToken.all respond_to do |format| format.html # index.html.erb format.xml { render :xml => @oauth_tokens } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tokens\n\t\tresource = \"/oauth/access_token\"\n\t\t\n\t\tbegin\n\t\t\tresponse = @connection.post resource do |request|\n\t\t\t\trequest.params['client_id'] = @api_key\n\t\t\t\trequest.params['client_secret'] = @secret_key\n\t\t\t\trequest.params['grant_type'] = @grant_type\n\t\t\t\trequest.params['scope'] = @scope\n\t\t\tend\n\t\t\t\n\t\t\tresult = process_response(response)\n\t\t\t\n\t\t\tif result[:access_token].nil? || result[:refresh_token].nil?\n\t\t\t\traise RuntimeError, \"Unable to complete oauth: #{response[:error]}\"\n\t\t\telse \n\t\t\t\t@access_token = result[:access_token]\n\t\t\t\t@refresh_token = result[:refresh_token]\n\t\t\tend\n\t\trescue => e\n\t\t\traise RuntimeError, e.to_s\n\t\tend\n\tend", "def get_tokens\n resource = \"/oauth/access_token\"\n\n begin\n response = @connection.post resource do |request|\n request.params['client_id'] = @api_key\n request.params['client_secret'] = @secret_key\n request.params['grant_type'] = @grant_type\n request.params['scope'] = 'SPEECH,STTC,TTS'\n end\n\n result = process_response(response)\n\n if result[:access_token].nil? || result[:refresh_token].nil?\n raise RuntimeError, \"Unable to complete oauth: #{response[:error]}\"\n else\n @access_token = result[:access_token]\n @refresh_token = result[:refresh_token]\n end\n rescue => e\n raise RuntimeError, e.to_s\n end\n end", "def index\n @oauth_remote_access_tokens = User.current.oauth_remote_access_tokens.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @oauth_remote_access_tokens }\n end\n end", "def find_oauth_access_token\n end", "def fetchTokens\n self.class.request.get \"#{id}/tokens\" \n end", "def obtain_tokens(fqdn, client_id, client_secret, scope, tokens_file)\n read_tokens(tokens_file)\n \n response = RestClient.post \"#{fqdn}/oauth/access_token\", :grant_type => 'client_credentials', :client_id => client_id, :client_secret => client_secret, :scope => scope\n\t\n from_json = JSON.parse(response.to_str)\n @access_token = from_json['access_token']\n @refresh_token = from_json['refresh_token']\n write_tokens(tokens_file)\nend", "def exchange_oauth_tokens\n end", "def get(url)\n raise OAuthUnauthorized if !access_token\n access_token.get(url)\n end", "def get(url)\n raise OAuthUnauthorized if !access_token\n access_token.get(url)\n end", "def oauth_token\n @json['oauthToken']\n end", "def fetch_access_token\n client.unauthenticated_request(:POST, '/v1/security/oauth2/token',\n grant_type: 'client_credentials',\n client_id: client.client_id,\n client_secret: client.client_secret)\n end", "def index\n @access_tokens = AccessToken.all\n\n @oauth = oauth\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @access_tokens }\n end\n end", "def xauth_token\n consumer = oauth_consumer\n request_token = consumer.get_request_token\n consumer.get_access_token(\n request_token, {},\n {\n :x_auth_mode => 'client_auth',\n :x_auth_username => cred['username'],\n :x_auth_password => cred['password']\n }\n )\n end", "def oauth_access_token\n session[:access_token]\n end", "def token_url\n \"#{sk_url}/oauth/token\"\n end", "def get_access_token\n @oauth_access_token = oauth_request.get_access_token\n @authenticated_user_uri = oauth_consumer.token_request_response[\"Content-Location\"]\n end", "def get_request_token( oauth_callback = TWOAUTH_CALLBACK )\n\t\tself.consumer.get_request_token( :oauth_callback => oauth_callback )\n\tend", "def get_token\n begin\n @response = RestClient.post(\n @consumer[:token_request_url],\n client_id: @consumer[:client_id],\n client_secret: @consumer[:client_secret],\n grant_type: @consumer[:grant_type],\n resource: @consumer[:resource]\n )\n\n @consumer[:token] = 'Bearer ' + JSON.parse(@response)['access_token']\n @consumer[:token_expiry] = JSON.parse(@response)['expires_on']\n rescue => error\n puts(\"ERROR - Token Request Failed - #{error}\")\n end\n @consumer[:token]\n end", "def rack_oauth!(name)\n oauth_instance(name).get_access_token!(oauth_request_env)\n end", "def request_token\n consumer.get_request_token(:oauth_callback => Koprol.callback_url)\n end", "def new\n @oauth_token = OauthToken.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @oauth_token }\n end\n end", "def access_token\n OAuth::AccessToken.new(consumer, oauth_token, oauth_token_secret)\n end", "def get_token\n get(TOKEN_URL)\n end", "def request_oauth_token\n request_token_hash = {\n \"oauth_consumer_key\" => \"#{@consumer_key}\",\n \"oauth_signature_method\" => \"HMAC-SHA1\",\n \"oauth_timestamp\" => timestamp,\n \"oauth_nonce\" => nonce,\n \"oauth_version\" => \"1.0\",\n \"oauth_callback\" => \"oob\",\n }\n\n # set signature\n request_token_hash[\"oauth_signature\"] = generate_oauth_signature(generate_signature_base_string(\"POST\", @request_token_url, request_token_hash))\n\n # post with auth header\n result = MyHttp.post(@request_token_url, nil, {\n \"Authorization\" => \"OAuth #{generate_auth_header(request_token_hash)}\",\n })\n\n auth_token_string = result.body.strip\n if result.is_a? Net::HTTPSuccess\n return string_param_to_hash(auth_token_string)\n else\n status = result.code\n return nil\n end\n end", "def token\n oauth_merged_params[:oauth_token]\n end", "def oauth_url\n @oauth_url || File.join(host, \"oauth20/token\")\n end", "def remote_oauth_token\n token = client_application.client_credentials.get_token(:scope => SCOPE_FOR_A_SERVICE_TO_TALK_TO_AUTHORIZATOR_SERVICE)\n raise Response::Error::AccessToken.new(data:(token && token.params)) if (!token or token.token.empty?)\n token\n end", "def request_access_token\n # An `OAuth::Consumer` object can make requests to the service on\n # behalf of the client application.\n\n # Ask service for a URL to send the user to so that they may authorize\n # us.\n request_token = CONSUMER.get_request_token\n authorize_url = request_token.authorize_url\n\n # Launchy is a gem that opens a browser tab for us\n Launchy.open(authorize_url)\n\n # Because we don't use a redirect URL; user will receive a short PIN\n # (called a **verifier**) that they can input into the client\n # application. The client asks the service to give them a permanent\n # access token to use.\n puts \"Login, and type your verification code in\"\n oauth_verifier = gets.chomp\n access_token = request_token.get_access_token(\n :oauth_verifier => oauth_verifier\n )\nend", "def oauth_token\n read_attribute(oauth_token_field)\n end", "def get_access_token()\n url = URI.parse(TOKEN_ENDPOINT)\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n req = Net::HTTP::Post.new(url.path)\n req.basic_auth(@clientId, @clientSecret)\n req.set_form_data({'grant_type' => 'client_credentials'})\n res = http.request(req)\n JSON.parse(res.body)['access_token']\n end", "def list_access_tokens\n client.make_request('/list-access-tokens', 'post', params: {})\n end", "def get_access_token_json\n HTTParty.post(get_request_access_token_url)\n end", "def get_request_token(oauth_callback)\n @myspacecontext.get_request_token(oauth_callback)\n end", "def get_access_token\n uri = URI.parse(@token_url)\n http = Net::HTTP.new(uri.host, uri.port)\n req = Net::HTTP::Post.new(uri.request_uri)\n auth = Base64.encode64(@login + ':' + @password).gsub(\"\\n\", \"\")\n req['Authorization'] = \"Basic #{auth}\"\n send = 'grant_type=client_credentials'\n req.body = send\n res = http.request(req)\n if res.code == \"200\"\n data = res.body\n result = JSON.parse(data)\n @access_token = result['access_token']\n else\n puts \"Invalid getting access token\"\n exit\n end\n end", "def bearer_token\n # Put the url together\n url = \"#{API_HOST}#{TOKEN_PATH}\"\n\n raise \"Please set your CLIENT_ID\" if CLIENT_ID.nil?\n raise \"Please set your CLIENT_SECRET\" if CLIENT_SECRET.nil?\n\n # Build our params hash\n params = {\n client_id: CLIENT_ID,\n client_secret: CLIENT_SECRET,\n grant_type: GRANT_TYPE\n }\n\n response = HTTP.post(url, params: params)\n parsed = response.parse\n\n \"#{parsed['token_type']} #{parsed['access_token']}\"\nend", "def show\n @oauth_remote_access_token = OauthRemoteAccessToken.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @oauth_remote_access_token }\n end\n end", "def request_token\n consumer.get_request_token(:oauth_callback => Etsy.callback_url)\n end", "def request_token\n consumer.get_request_token(:oauth_callback => Etsy.callback_url)\n end", "def token\n @api.get(\"#{Paths::TOKENS}\")\n end", "def oauth_token\n @oauth_token ||= begin\n # Bearer tokens according to http://tools.ietf.org/html/draft-ietf-oauth-v2-bearer-03\n authorization_header = request.env['HTTP_AUTHORIZATION']\n if authorization_header =~ /^\\s*Bearer\\s+(.*)/\n token_string = $1\n else\n token_string = params[:oauth_token]\n token_string ||= params[:access_token] # Legacy parameter\n end\n if token_string\n token = Token.where(:access_token => token_string).\n all(:include => :user).first\n if token.nil? or token.expired?\n logger.error(\"Invalid OAuth token\")\n headers['WWW-Authenticate'] = %(Bearer error=\"invalid_token\")\n halt 403, 'Invalid OAuth token'\n end\n token\n end\n end\n end", "def oauth_application(token)\n request(\n __method__,\n :get,\n \"#{api_base}/oauth2/applications/@me\",\n Authorization: token\n )\n end", "def get(url)\n login unless token\n response = client.request(request(url, token))\n end", "def access_token\n end", "def get_token\n consumer = OAuth::Consumer.new('jzICjLlLF3dLrGVaVal0w', '3ydl3o44K4MaR8sFAk2gWtTTzHfFc7PzZjelP0XIoik', {\n :site => 'https://api.twitter.com',\n :scheme => :header\n })\n token_hash = {\n :oauth_token => '14615533-Qy2ck9vrfqsNdUp5cGi5PpHyrqBRmh7aXP6qcUr9w',\n :oauth_token_secret => 'tECZ96ci1nXrvs3OkxSEbZyQtngQWslhgGeuTgEFJwU'\n }\n\n OAuth::AccessToken.from_hash(consumer, token_hash)\nend", "def get_access\n path = '/v3/oauth/authorize'\n data = \"consumer_key=#{Consumer_key}&code=#{Token}\"\n return pocket_api(path,data)\nend", "def get_token (params)\n client = OAuth2::Client.new(params[:APP_ID], params[:APP_SECRET], :site => params[:OAUTH_URL])\n\n begin\n token = client.password.get_token(params[:USER_EMAIL], params[:USER_PASSWD], :scope => params[:SCOPE]).token\n rescue => e\n puts \"Error: Can't get oauth token, check credentials for '#{params[:NAME]}'\"\n puts \"#{e.message}\"\n abort \"Aborting script\"\n end\n return token\nend", "def request_tokens(auth_code)\n @token = @oauth_client.auth_code.get_token auth_code, redirect_uri: @url\n tokens\n end", "def bearer_token\n # Put the url together\n url = \"#{API_HOST}#{TOKEN_PATH}\"\n\n raise \"Please set your CLIENT_ID\" if CLIENT_ID.nil?\n raise \"Please set your CLIENT_SECRET\" if CLIENT_SECRET.nil?\n\n # Build our params hash\n params = {\n client_id: CLIENT_ID,\n client_secret: CLIENT_SECRET,\n grant_type: GRANT_TYPE\n }\n\n response = HTTP.post(url, params: params)\n parsed = response.parse\n\n \"#{parsed['token_type']} #{parsed['access_token']}\"\nend", "def access_token\n @access_token ||= begin\n if oauth_options[:oauth_verifier]\n request_token.get_access_token(:oauth_verifier => oauth_options[:oauth_verifier])\n else\n request_token.get_access_token\n end\n end\n end", "def get_access_token(options={})\n response=consumer.token_request(consumer.http_method,(consumer.access_token_url? ? consumer.access_token_url : consumer.access_token_path),self,options)\n OAuth::AccessToken.new(consumer,response[:oauth_token],response[:oauth_token_secret])\n end", "def bearer_token\n # Put the url together\n url = \"#{API_HOST}#{TOKEN_PATH}\"\n\n raise \"Please set your CLIENT_ID\" if CLIENT_ID.nil?\n raise \"Please set your CLIENT_SECRET\" if CLIENT_SECRET.nil?\n\n # Build our params hash\n params = {\n client_id: CLIENT_ID,\n client_secret: CLIENT_SECRET,\n grant_type: GRANT_TYPE\n }\n\n response = HTTP.post(url, params: params)\n parsed = response.parse\n\n \"#{parsed['token_type']} #{parsed['access_token']}\"\nend", "def token_auth\n user = User.find_by_login_and_single_access_token(params[:login], params[:token])\n respond_to do |format|\n if user\n format.xml { render :xml => \"ok\" }\n else\n format.xml { render :xml => \"fail\" }\n end\n end\n end", "def index\n @access_tokens = page(access_token_list)\n end", "def fetch_access_token\n JSON.parse(File.read('/opt/gluu-server/etc/certs/api_token.json'))['token']\n end", "def get_user_info\n get(\"/api/v1/oauth_user_info.json\")\n end", "def get_token_response(url)\n JSON.parse(access_token.get(\"/#{api_version}#{url}\").body)\n end", "def gettoken(url,username,password,tenant)\n url1 = \"#{url}/identity/api/tokens\"\n uri = URI.parse(url1)\n request = Net::HTTP::Post.new(uri)\n request.content_type = \"application/json\"\n request[\"Accept\"] = \"application/json\"\n request.body = JSON.dump({\n \"username\" => username,\n \"password\" => password,\n \"tenant\" => tenant\n })\n\n req_options = {\n use_ssl: uri.scheme == \"https\",\n verify_mode: OpenSSL::SSL::VERIFY_NONE,\n }\n\n response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|\n http.request(request)\n end\n\n token_output = response.body\n token_json = JSON.parse(token_output)\n vra_token = token_json[\"id\"]\n return vra_token\n end", "def fetch_access_token\n uri = URI.parse Sendible::API::URL + \"/v1/auth?app_id=#{CGI.escape(Sendible.application_id)}&access_key=#{CGI.escape(access_key)}\"\n get = Net::HTTP::Get.new(uri.request_uri)\n response = Net::HTTP.start(uri.host, uri.port) do |http|\n http.request(get)\n end\n response.body\n end", "def scim_oauth_access_token\n @attributes[:scim_oauth_access_token]\n end", "def fetch_token\n response = RestClient.get \"https://#{Autoscout24Client.config[:username]}:#{Autoscout24Client.config[:password]}@sts.idm.telekom.com/rest-v1/tokens/odg\", {:accept => :json}\n JSON.parse(response)[\"token\"]\n end", "def retrieve_tokens\n return false unless oauth_credentials_valid?(@current_user)\n\n tokens = OpenStruct.new(get_tokens(@current_user, 'watch'))\n @watch_token = tokens.action_token\n @access_token = tokens.access_token\n\n !(@watch_token.nil? || @access_token.nil?)\n end", "def get_access_token name = nil\n oauth_instance(name).get_access_token(oauth_request_env)\n end", "def tokens\n (@token.is_a? OAuth2::AccessToken) ? @token.to_hash : @token\n end", "def tokens_path\n @tokens_path || \"/requests/tokens/\"\n end", "def bearer_token\n # Put the url together\n url = \"#{API_HOST}#{TOKEN_PATH}\"\n\n # Build our params hash\n params = {\n client_id: @client_id,\n client_secret: @client_secret,\n grant_type: GRANT_TYPE\n }\n\n response = HTTP.post(url, params: params)\n parsed = response.parse\n\n \"#{parsed['token_type']} #{parsed['access_token']}\"\n end", "def oauth_access_token(client_id, client_secret, options={})\n url = self.format_url('/oauth/access_token', {\n :client_id => client_id,\n :client_secret => client_secret\n }.merge(options || {}))\n \n response = self.perform_get(url)\n response_hash = {}\n response.split('&').each do |value|\n value_pair = value.split('=')\n response_hash[value_pair[0]] = value_pair[1]\n end\n response_hash\n end", "def oauth\n request_token = @oauth_consumer.get_request_token\n authorize_url = request_token.authorize_url(:oauth_consumer_key => \n Netflix::Client.consumer_key)\n Launchy.open(authorize_url)\n puts \"Go to browser, a page has been opened to establish oauth\"\n printf \"Pin from Netflix:\"\n pin = gets.chomp\n access_token = request_token.get_access_token(:oauth_verifier => pin)\n end", "def rest_token_endpoint; end", "def access_token\n @config[\"token\"]\n end", "def token_url(params = nil)\n connection.build_url(oauth_token_path, params).to_s\n end", "def get_access_token(username, password)\n response = @oauth_connection.post do |req|\n req.url '/oauth/token', :grant_type => 'password', :client_id => api_key, :client_secret => api_secret, :username => username, :password => password\n end\n\n @oauth_token = OAuthToken.new(response.body)\n configure_oauth\n @oauth_token\n end", "def tokeninfo(token)\n $client.authorization.update_token!(token)\n oauth2 = $client.discovered_api('oauth2','v2')\n\n puts $client.execute(oauth2.tokeninfo, token).response.body\nend", "def access_token\n @oauth_access_token ||= ::OAuth::AccessToken.new(consumer, @access_token, @access_secret)\n end", "def retrieve(options = {})\n body = options.fetch(:body, {})\n\n @client.post(\"oauth/token?grant_type=client_credentials\", body, options)\n end", "def oauth_request(params)\n logger.verbose('Resorting to OAuth to fulfill token request.')\n OAuthRequest.new(@authority.token_endpoint, params)\n end", "def request_access_token(oauth_verifier)\n access_token_hash = {\n \"oauth_consumer_key\" => \"#{@consumer_key}\",\n \"oauth_token\" => \"#{@oauth_token[\"oauth_token\"]}\",\n \"oauth_signature_method\" => \"HMAC-SHA1\",\n \"oauth_timestamp\" => timestamp,\n \"oauth_nonce\" => nonce,\n \"oauth_version\" => \"1.0\",\n \"oauth_verifier\" => \"#{oauth_verifier}\",\n }\n\n # set signature\n access_token_hash[\"oauth_signature\"] = generate_oauth_signature(generate_signature_base_string(\"POST\", @access_token_url, access_token_hash))\n\n # post with auth header\n result = MyHttp.post(@access_token_url, nil, {\n \"Authorization\" => \"OAuth #{generate_auth_header(access_token_hash)}\",\n })\n\n access_token_string = result.body.strip\n if result.is_a? Net::HTTPSuccess\n return string_param_to_hash(access_token_string)\n else\n status = result.code\n return nil\n end\n end", "def access_token\n @auth.access_token\n end", "def get_request_token(consumer, callback)\n request_token = consumer.get_request_token({\n :scope => 'http://orkut.gmodules.com/social/rest',\n :oauth_callback => callback},\n :scope => 'http://orkut.gmodules.com/social')\n end", "def inactive_tokens\n client.get('/inactive_tokens')\n end", "def auth\r\n OAuth2\r\n end", "def oauth\n {\n consumer_key: @consumer_key,\n consumer_secret: @consumer_secret,\n token: @token,\n token_secret: @token_secret\n }\n end", "def oauth2_access_token\n belongs_to :client, :null => false\n\n string :token, :null => false\n string :scope\n datetime :expires_at\n end", "def get_token(code)\n uri = URI.parse(URL[\"oauth_access\"])\n params = { :client_id => CLIENT_ID,\n :client_secret => CLIENT_SECRET,\n :code => code\n }\n uri.query = URI.encode_www_form( params )\n return JSON.parse(uri.open.read)\n end", "def oauth_authentication; end", "def show\n @access_token = AccessToken.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @access_token }\n end\n end", "def get_client_token\n request = Typhoeus::Request.new(\n TOKEN_ENDPOINT,\n method: :post,\n body: {\n 'grant_type' => \"client_credentials\",\n 'client_id' => ID,\n 'client_secret' => SECRET,\n })\n request.run\n response = request.response\n access_token = response.body.access_token\n end", "def get_token(options)\n\t\tmethod = \"GET\"\n\t\tendpoint = \"auditlogtoken\"\n\t\turi = ApiUri::build_uri(endpoint, options)\n\t\treturn @client.request_json(method, uri)\n\tend", "def index \n @tokens = @user.tokens\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tokens }\n end\n end", "def access_token\n @access_token\n end", "def access_tokens(app_ids)\n endpoint = '/user/accessTokens'\n app_ids = app_ids.join(',') if app_ids.is_a?(Array)\n\n response = Client.execute(:get, endpoint, session, appIds: app_ids)\n response.dig(:user, :access_tokens).map do |access_token|\n OpenStruct.new(access_token)\n end\n end", "def token\n @access_token.token\n end", "def index\n sessions = request do\n api.request(\n :expects => 200,\n :headers => headers,\n :method => :get,\n :path => \"/oauth/sessions\"\n ).body\n end\n styled_header(\"OAuth Sessions\")\n styled_array(sessions.map { |session|\n [session[\"description\"], session[\"id\"]]\n })\n end", "def start_oauth\n @consumer = OAuth::Consumer.new('l9tUlXD0IOoGhC9HnDJBA', '9YZWGkxQJgieQ3Ta89mPE4xpXXhryEbRD9GS0WAt4',{:site=>\"http://twitter.com\" })\n @req_token = @consumer.get_request_token(:oauth_callback=>\"http://127.0.0.1:3000/a2\")\n Rails.logger.warn \"First Request #{@req_token.inspect}\"\n session[:request_token] = @req_token.token\n session[:request_token_secret] = @req_token.secret\n redirect_to @req_token.authorize_url\nend", "def get_auth_token\n log_step \"start\", \"get_auth_token\"\n login_url = \"https://login.microsoft.com\"\n token_url = \"#{login_url}/#{@tenant}/oauth2/token?api-version=1.0\"\n body = {\n client_id: @client_id,\n client_secret: @client_secret,\n grant_type: 'client_credentials',\n resource: @resource\n }\n response = HTTParty.post \"#{token_url}\", body: body\n @access_token = response['access_token']\n log_step 'auth_token', @access_token\nend", "def oauth_app_access_token(client_id, client_secret)\n self.oauth_access_token(client_id, client_secret, :type => 'client_cred')\n end", "def token\n auth_client.token(settings.oauth2_token).tap do |token|\n settings.save_oauth2_token(token.to_hash)\n end\n end", "def get_access_token(verifier)\n result = connection.set_tokens_from_post('oauth2/token', verifier)\n @name = get_account_name(result)\n [ connection.access_token, connection.access_token_secret, @name ]\n end", "def api_token\n client.get(\"/user/api_token\").fetch(\"result\")\n end", "def connection_for_application\n oauth_client.client_credentials.get_token\n end", "def oauth_consumer\n @oauth_consumer\n end" ]
[ "0.7360809", "0.73178715", "0.69142103", "0.6913528", "0.6738037", "0.6737193", "0.67218316", "0.65898293", "0.65898293", "0.6588971", "0.6574", "0.6526953", "0.64884716", "0.6401391", "0.638914", "0.63251615", "0.63213825", "0.6287768", "0.62388456", "0.62256736", "0.62131375", "0.62033886", "0.6199203", "0.61984056", "0.61983186", "0.6192676", "0.6190854", "0.61886054", "0.6182917", "0.6180677", "0.6170825", "0.6170032", "0.6167261", "0.61657614", "0.6163723", "0.61486685", "0.61102235", "0.61102235", "0.61075556", "0.60832244", "0.60811627", "0.6059966", "0.6055191", "0.6043115", "0.60377544", "0.60335076", "0.60312283", "0.6030542", "0.60303617", "0.6026471", "0.6022865", "0.6016094", "0.6001243", "0.5993946", "0.5986627", "0.5981184", "0.5974242", "0.59689033", "0.5941614", "0.5938482", "0.5936279", "0.59198254", "0.5913266", "0.5911401", "0.5911043", "0.5899448", "0.5894683", "0.58823985", "0.58798426", "0.58782893", "0.58640116", "0.585882", "0.5835066", "0.5831822", "0.5824958", "0.5816345", "0.58151877", "0.58107847", "0.5810026", "0.58031964", "0.5801017", "0.5798537", "0.57958186", "0.5788279", "0.57859707", "0.57792556", "0.5773581", "0.57733023", "0.5770154", "0.57584363", "0.5752159", "0.57375056", "0.5732739", "0.57273066", "0.57198805", "0.5717952", "0.57025075", "0.5700871", "0.56970626", "0.5693682" ]
0.71752983
2
GET /oauth_tokens/1 GET /oauth_tokens/1.xml
def show if params[:id] == 'foursquare_categories' foursquare_categories render :action => :foursquare_categories return end @oauth_token = OauthToken.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @oauth_token } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tokens\n\t\tresource = \"/oauth/access_token\"\n\t\t\n\t\tbegin\n\t\t\tresponse = @connection.post resource do |request|\n\t\t\t\trequest.params['client_id'] = @api_key\n\t\t\t\trequest.params['client_secret'] = @secret_key\n\t\t\t\trequest.params['grant_type'] = @grant_type\n\t\t\t\trequest.params['scope'] = @scope\n\t\t\tend\n\t\t\t\n\t\t\tresult = process_response(response)\n\t\t\t\n\t\t\tif result[:access_token].nil? || result[:refresh_token].nil?\n\t\t\t\traise RuntimeError, \"Unable to complete oauth: #{response[:error]}\"\n\t\t\telse \n\t\t\t\t@access_token = result[:access_token]\n\t\t\t\t@refresh_token = result[:refresh_token]\n\t\t\tend\n\t\trescue => e\n\t\t\traise RuntimeError, e.to_s\n\t\tend\n\tend", "def get_tokens\n resource = \"/oauth/access_token\"\n\n begin\n response = @connection.post resource do |request|\n request.params['client_id'] = @api_key\n request.params['client_secret'] = @secret_key\n request.params['grant_type'] = @grant_type\n request.params['scope'] = 'SPEECH,STTC,TTS'\n end\n\n result = process_response(response)\n\n if result[:access_token].nil? || result[:refresh_token].nil?\n raise RuntimeError, \"Unable to complete oauth: #{response[:error]}\"\n else\n @access_token = result[:access_token]\n @refresh_token = result[:refresh_token]\n end\n rescue => e\n raise RuntimeError, e.to_s\n end\n end", "def index\n @oauth_tokens = OauthToken.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @oauth_tokens }\n end\n end", "def find_oauth_access_token\n end", "def exchange_oauth_tokens\n end", "def index\n @oauth_remote_access_tokens = User.current.oauth_remote_access_tokens.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @oauth_remote_access_tokens }\n end\n end", "def obtain_tokens(fqdn, client_id, client_secret, scope, tokens_file)\n read_tokens(tokens_file)\n \n response = RestClient.post \"#{fqdn}/oauth/access_token\", :grant_type => 'client_credentials', :client_id => client_id, :client_secret => client_secret, :scope => scope\n\t\n from_json = JSON.parse(response.to_str)\n @access_token = from_json['access_token']\n @refresh_token = from_json['refresh_token']\n write_tokens(tokens_file)\nend", "def fetch_access_token\n client.unauthenticated_request(:POST, '/v1/security/oauth2/token',\n grant_type: 'client_credentials',\n client_id: client.client_id,\n client_secret: client.client_secret)\n end", "def fetchTokens\n self.class.request.get \"#{id}/tokens\" \n end", "def xauth_token\n consumer = oauth_consumer\n request_token = consumer.get_request_token\n consumer.get_access_token(\n request_token, {},\n {\n :x_auth_mode => 'client_auth',\n :x_auth_username => cred['username'],\n :x_auth_password => cred['password']\n }\n )\n end", "def oauth_token\n @json['oauthToken']\n end", "def new\n @oauth_token = OauthToken.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @oauth_token }\n end\n end", "def get(url)\n raise OAuthUnauthorized if !access_token\n access_token.get(url)\n end", "def get(url)\n raise OAuthUnauthorized if !access_token\n access_token.get(url)\n end", "def rack_oauth!(name)\n oauth_instance(name).get_access_token!(oauth_request_env)\n end", "def get_request_token( oauth_callback = TWOAUTH_CALLBACK )\n\t\tself.consumer.get_request_token( :oauth_callback => oauth_callback )\n\tend", "def show\n @oauth_remote_access_token = OauthRemoteAccessToken.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @oauth_remote_access_token }\n end\n end", "def oauth_access_token\n session[:access_token]\n end", "def get_token\n begin\n @response = RestClient.post(\n @consumer[:token_request_url],\n client_id: @consumer[:client_id],\n client_secret: @consumer[:client_secret],\n grant_type: @consumer[:grant_type],\n resource: @consumer[:resource]\n )\n\n @consumer[:token] = 'Bearer ' + JSON.parse(@response)['access_token']\n @consumer[:token_expiry] = JSON.parse(@response)['expires_on']\n rescue => error\n puts(\"ERROR - Token Request Failed - #{error}\")\n end\n @consumer[:token]\n end", "def get_access_token\n uri = URI.parse(@token_url)\n http = Net::HTTP.new(uri.host, uri.port)\n req = Net::HTTP::Post.new(uri.request_uri)\n auth = Base64.encode64(@login + ':' + @password).gsub(\"\\n\", \"\")\n req['Authorization'] = \"Basic #{auth}\"\n send = 'grant_type=client_credentials'\n req.body = send\n res = http.request(req)\n if res.code == \"200\"\n data = res.body\n result = JSON.parse(data)\n @access_token = result['access_token']\n else\n puts \"Invalid getting access token\"\n exit\n end\n end", "def request_oauth_token\n request_token_hash = {\n \"oauth_consumer_key\" => \"#{@consumer_key}\",\n \"oauth_signature_method\" => \"HMAC-SHA1\",\n \"oauth_timestamp\" => timestamp,\n \"oauth_nonce\" => nonce,\n \"oauth_version\" => \"1.0\",\n \"oauth_callback\" => \"oob\",\n }\n\n # set signature\n request_token_hash[\"oauth_signature\"] = generate_oauth_signature(generate_signature_base_string(\"POST\", @request_token_url, request_token_hash))\n\n # post with auth header\n result = MyHttp.post(@request_token_url, nil, {\n \"Authorization\" => \"OAuth #{generate_auth_header(request_token_hash)}\",\n })\n\n auth_token_string = result.body.strip\n if result.is_a? Net::HTTPSuccess\n return string_param_to_hash(auth_token_string)\n else\n status = result.code\n return nil\n end\n end", "def index\n @access_tokens = AccessToken.all\n\n @oauth = oauth\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @access_tokens }\n end\n end", "def get_token\n get(TOKEN_URL)\n end", "def request_token\n consumer.get_request_token(:oauth_callback => Koprol.callback_url)\n end", "def get_access_token\n @oauth_access_token = oauth_request.get_access_token\n @authenticated_user_uri = oauth_consumer.token_request_response[\"Content-Location\"]\n end", "def tokeninfo(token)\n $client.authorization.update_token!(token)\n oauth2 = $client.discovered_api('oauth2','v2')\n\n puts $client.execute(oauth2.tokeninfo, token).response.body\nend", "def token_url\n \"#{sk_url}/oauth/token\"\n end", "def get_access_token()\n url = URI.parse(TOKEN_ENDPOINT)\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n req = Net::HTTP::Post.new(url.path)\n req.basic_auth(@clientId, @clientSecret)\n req.set_form_data({'grant_type' => 'client_credentials'})\n res = http.request(req)\n JSON.parse(res.body)['access_token']\n end", "def get_access_token name = nil\n oauth_instance(name).get_access_token(oauth_request_env)\n end", "def bearer_token\n # Put the url together\n url = \"#{API_HOST}#{TOKEN_PATH}\"\n\n raise \"Please set your CLIENT_ID\" if CLIENT_ID.nil?\n raise \"Please set your CLIENT_SECRET\" if CLIENT_SECRET.nil?\n\n # Build our params hash\n params = {\n client_id: CLIENT_ID,\n client_secret: CLIENT_SECRET,\n grant_type: GRANT_TYPE\n }\n\n response = HTTP.post(url, params: params)\n parsed = response.parse\n\n \"#{parsed['token_type']} #{parsed['access_token']}\"\nend", "def token_auth\n user = User.find_by_login_and_single_access_token(params[:login], params[:token])\n respond_to do |format|\n if user\n format.xml { render :xml => \"ok\" }\n else\n format.xml { render :xml => \"fail\" }\n end\n end\n end", "def gettoken(url,username,password,tenant)\n url1 = \"#{url}/identity/api/tokens\"\n uri = URI.parse(url1)\n request = Net::HTTP::Post.new(uri)\n request.content_type = \"application/json\"\n request[\"Accept\"] = \"application/json\"\n request.body = JSON.dump({\n \"username\" => username,\n \"password\" => password,\n \"tenant\" => tenant\n })\n\n req_options = {\n use_ssl: uri.scheme == \"https\",\n verify_mode: OpenSSL::SSL::VERIFY_NONE,\n }\n\n response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|\n http.request(request)\n end\n\n token_output = response.body\n token_json = JSON.parse(token_output)\n vra_token = token_json[\"id\"]\n return vra_token\n end", "def access_token\n end", "def get_token (params)\n client = OAuth2::Client.new(params[:APP_ID], params[:APP_SECRET], :site => params[:OAUTH_URL])\n\n begin\n token = client.password.get_token(params[:USER_EMAIL], params[:USER_PASSWD], :scope => params[:SCOPE]).token\n rescue => e\n puts \"Error: Can't get oauth token, check credentials for '#{params[:NAME]}'\"\n puts \"#{e.message}\"\n abort \"Aborting script\"\n end\n return token\nend", "def access_token\n OAuth::AccessToken.new(consumer, oauth_token, oauth_token_secret)\n end", "def remote_oauth_token\n token = client_application.client_credentials.get_token(:scope => SCOPE_FOR_A_SERVICE_TO_TALK_TO_AUTHORIZATOR_SERVICE)\n raise Response::Error::AccessToken.new(data:(token && token.params)) if (!token or token.token.empty?)\n token\n end", "def get_request_token(oauth_callback)\n @myspacecontext.get_request_token(oauth_callback)\n end", "def request_access_token\n # An `OAuth::Consumer` object can make requests to the service on\n # behalf of the client application.\n\n # Ask service for a URL to send the user to so that they may authorize\n # us.\n request_token = CONSUMER.get_request_token\n authorize_url = request_token.authorize_url\n\n # Launchy is a gem that opens a browser tab for us\n Launchy.open(authorize_url)\n\n # Because we don't use a redirect URL; user will receive a short PIN\n # (called a **verifier**) that they can input into the client\n # application. The client asks the service to give them a permanent\n # access token to use.\n puts \"Login, and type your verification code in\"\n oauth_verifier = gets.chomp\n access_token = request_token.get_access_token(\n :oauth_verifier => oauth_verifier\n )\nend", "def request_token\n consumer.get_request_token(:oauth_callback => Etsy.callback_url)\n end", "def request_token\n consumer.get_request_token(:oauth_callback => Etsy.callback_url)\n end", "def token\n oauth_merged_params[:oauth_token]\n end", "def show\n @access_token = AccessToken.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @access_token }\n end\n end", "def get_token\n consumer = OAuth::Consumer.new('jzICjLlLF3dLrGVaVal0w', '3ydl3o44K4MaR8sFAk2gWtTTzHfFc7PzZjelP0XIoik', {\n :site => 'https://api.twitter.com',\n :scheme => :header\n })\n token_hash = {\n :oauth_token => '14615533-Qy2ck9vrfqsNdUp5cGi5PpHyrqBRmh7aXP6qcUr9w',\n :oauth_token_secret => 'tECZ96ci1nXrvs3OkxSEbZyQtngQWslhgGeuTgEFJwU'\n }\n\n OAuth::AccessToken.from_hash(consumer, token_hash)\nend", "def get_access\n path = '/v3/oauth/authorize'\n data = \"consumer_key=#{Consumer_key}&code=#{Token}\"\n return pocket_api(path,data)\nend", "def get_access_token(options={})\n response=consumer.token_request(consumer.http_method,(consumer.access_token_url? ? consumer.access_token_url : consumer.access_token_path),self,options)\n OAuth::AccessToken.new(consumer,response[:oauth_token],response[:oauth_token_secret])\n end", "def oauth_token\n read_attribute(oauth_token_field)\n end", "def token\n @api.get(\"#{Paths::TOKENS}\")\n end", "def get_access_token_json\n HTTParty.post(get_request_access_token_url)\n end", "def get_access_token! name = nil\n oauth_instance(name).get_access_token!(oauth_request_env)\n end", "def access_token\n @access_token ||= begin\n if oauth_options[:oauth_verifier]\n request_token.get_access_token(:oauth_verifier => oauth_options[:oauth_verifier])\n else\n request_token.get_access_token\n end\n end\n end", "def fetch_access_token\n JSON.parse(File.read('/opt/gluu-server/etc/certs/api_token.json'))['token']\n end", "def bearer_token\n # Put the url together\n url = \"#{API_HOST}#{TOKEN_PATH}\"\n\n raise \"Please set your CLIENT_ID\" if CLIENT_ID.nil?\n raise \"Please set your CLIENT_SECRET\" if CLIENT_SECRET.nil?\n\n # Build our params hash\n params = {\n client_id: CLIENT_ID,\n client_secret: CLIENT_SECRET,\n grant_type: GRANT_TYPE\n }\n\n response = HTTP.post(url, params: params)\n parsed = response.parse\n\n \"#{parsed['token_type']} #{parsed['access_token']}\"\nend", "def bearer_token\n # Put the url together\n url = \"#{API_HOST}#{TOKEN_PATH}\"\n\n raise \"Please set your CLIENT_ID\" if CLIENT_ID.nil?\n raise \"Please set your CLIENT_SECRET\" if CLIENT_SECRET.nil?\n\n # Build our params hash\n params = {\n client_id: CLIENT_ID,\n client_secret: CLIENT_SECRET,\n grant_type: GRANT_TYPE\n }\n\n response = HTTP.post(url, params: params)\n parsed = response.parse\n\n \"#{parsed['token_type']} #{parsed['access_token']}\"\nend", "def oauth_application(token)\n request(\n __method__,\n :get,\n \"#{api_base}/oauth2/applications/@me\",\n Authorization: token\n )\n end", "def oauth_url\n @oauth_url || File.join(host, \"oauth20/token\")\n end", "def fetch_access_token\n uri = URI.parse Sendible::API::URL + \"/v1/auth?app_id=#{CGI.escape(Sendible.application_id)}&access_key=#{CGI.escape(access_key)}\"\n get = Net::HTTP::Get.new(uri.request_uri)\n response = Net::HTTP.start(uri.host, uri.port) do |http|\n http.request(get)\n end\n response.body\n end", "def get_token_response(url)\n JSON.parse(access_token.get(\"/#{api_version}#{url}\").body)\n end", "def get_client_token\n request = Typhoeus::Request.new(\n TOKEN_ENDPOINT,\n method: :post,\n body: {\n 'grant_type' => \"client_credentials\",\n 'client_id' => ID,\n 'client_secret' => SECRET,\n })\n request.run\n response = request.response\n access_token = response.body.access_token\n end", "def scim_oauth_access_token\n @attributes[:scim_oauth_access_token]\n end", "def get(url)\n login unless token\n response = client.request(request(url, token))\n end", "def auth\r\n OAuth2\r\n end", "def rest_token_endpoint; end", "def get_user_info\n get(\"/api/v1/oauth_user_info.json\")\n end", "def request_access_token(oauth_verifier)\n access_token_hash = {\n \"oauth_consumer_key\" => \"#{@consumer_key}\",\n \"oauth_token\" => \"#{@oauth_token[\"oauth_token\"]}\",\n \"oauth_signature_method\" => \"HMAC-SHA1\",\n \"oauth_timestamp\" => timestamp,\n \"oauth_nonce\" => nonce,\n \"oauth_version\" => \"1.0\",\n \"oauth_verifier\" => \"#{oauth_verifier}\",\n }\n\n # set signature\n access_token_hash[\"oauth_signature\"] = generate_oauth_signature(generate_signature_base_string(\"POST\", @access_token_url, access_token_hash))\n\n # post with auth header\n result = MyHttp.post(@access_token_url, nil, {\n \"Authorization\" => \"OAuth #{generate_auth_header(access_token_hash)}\",\n })\n\n access_token_string = result.body.strip\n if result.is_a? Net::HTTPSuccess\n return string_param_to_hash(access_token_string)\n else\n status = result.code\n return nil\n end\n end", "def oauth2_access_token\n belongs_to :client, :null => false\n\n string :token, :null => false\n string :scope\n datetime :expires_at\n end", "def oauth_token\n @oauth_token ||= begin\n # Bearer tokens according to http://tools.ietf.org/html/draft-ietf-oauth-v2-bearer-03\n authorization_header = request.env['HTTP_AUTHORIZATION']\n if authorization_header =~ /^\\s*Bearer\\s+(.*)/\n token_string = $1\n else\n token_string = params[:oauth_token]\n token_string ||= params[:access_token] # Legacy parameter\n end\n if token_string\n token = Token.where(:access_token => token_string).\n all(:include => :user).first\n if token.nil? or token.expired?\n logger.error(\"Invalid OAuth token\")\n headers['WWW-Authenticate'] = %(Bearer error=\"invalid_token\")\n halt 403, 'Invalid OAuth token'\n end\n token\n end\n end\n end", "def bearer_token\n # Put the url together\n url = \"#{API_HOST}#{TOKEN_PATH}\"\n\n # Build our params hash\n params = {\n client_id: @client_id,\n client_secret: @client_secret,\n grant_type: GRANT_TYPE\n }\n\n response = HTTP.post(url, params: params)\n parsed = response.parse\n\n \"#{parsed['token_type']} #{parsed['access_token']}\"\n end", "def token\n auth_client.token(settings.oauth2_token).tap do |token|\n settings.save_oauth2_token(token.to_hash)\n end\n end", "def fetch_token\n response = RestClient.get \"https://#{Autoscout24Client.config[:username]}:#{Autoscout24Client.config[:password]}@sts.idm.telekom.com/rest-v1/tokens/odg\", {:accept => :json}\n JSON.parse(response)[\"token\"]\n end", "def tokens\n (@token.is_a? OAuth2::AccessToken) ? @token.to_hash : @token\n end", "def get_token(options)\n\t\tmethod = \"GET\"\n\t\tendpoint = \"auditlogtoken\"\n\t\turi = ApiUri::build_uri(endpoint, options)\n\t\treturn @client.request_json(method, uri)\n\tend", "def access_token\n @config[\"token\"]\n end", "def get_access_token(verifier)\n result = connection.set_tokens_from_post('oauth2/token', verifier)\n @name = get_account_name(result)\n [ connection.access_token, connection.access_token_secret, @name ]\n end", "def tokens_path\n @tokens_path || \"/requests/tokens/\"\n end", "def start_oauth\n @consumer = OAuth::Consumer.new('l9tUlXD0IOoGhC9HnDJBA', '9YZWGkxQJgieQ3Ta89mPE4xpXXhryEbRD9GS0WAt4',{:site=>\"http://twitter.com\" })\n @req_token = @consumer.get_request_token(:oauth_callback=>\"http://127.0.0.1:3000/a2\")\n Rails.logger.warn \"First Request #{@req_token.inspect}\"\n session[:request_token] = @req_token.token\n session[:request_token_secret] = @req_token.secret\n redirect_to @req_token.authorize_url\nend", "def retrieve(options = {})\n body = options.fetch(:body, {})\n\n @client.post(\"oauth/token?grant_type=client_credentials\", body, options)\n end", "def access_token; self; end", "def access_token\n @auth.access_token\n end", "def get_access_token(username, password)\n response = @oauth_connection.post do |req|\n req.url '/oauth/token', :grant_type => 'password', :client_id => api_key, :client_secret => api_secret, :username => username, :password => password\n end\n\n @oauth_token = OAuthToken.new(response.body)\n configure_oauth\n @oauth_token\n end", "def access_token\n @access_token\n end", "def retrieve_token\n puts \"Picking up new token.\"\n parsed_json = {}\n until parsed_json[\"access_token\"]\n results = `curl -X -vvv -d 'client_id=MY_CLIENT_KEY&client_secret=MY_CLIENT_SECRET&grant_type=client_credentials' -X POST 'https://connect.gettyimages.com/oauth2/token/'`\n parsed_json = JSON.parse results\n end\n @token = parsed_json[\"access_token\"]\n end", "def token\n @access_token.token\n end", "def access_token\n @oauth_access_token ||= ::OAuth::AccessToken.new(consumer, @access_token, @access_secret)\n end", "def get_auth_token\n log_step \"start\", \"get_auth_token\"\n login_url = \"https://login.microsoft.com\"\n token_url = \"#{login_url}/#{@tenant}/oauth2/token?api-version=1.0\"\n body = {\n client_id: @client_id,\n client_secret: @client_secret,\n grant_type: 'client_credentials',\n resource: @resource\n }\n response = HTTParty.post \"#{token_url}\", body: body\n @access_token = response['access_token']\n log_step 'auth_token', @access_token\nend", "def request(path, method = :get, params = {})\n\t\n\t\t# google uses a refresh_token\n\t\t# we need to request a new access_token using the\n\t\t# refresh_token if it has expired\n\t\tif provider == \"google_oauth2\" and refresh_token and token_expires_at < DateTime.now\n\t\t\thttp = Net::HTTP.new(\"accounts.google.com\", 443)\n\t\t\thttp.use_ssl = true\n\t\t\tres, data = http.post(\"/o/oauth2/token\", \n\t\t\t{\n\t\t\t\trefresh_token: refresh_token,\n\t\t\t\tclient_id: creds['id'],\n\t\t\t\tclient_secret: creds['key'],\n\t\t\t\tgrant_type: 'refresh_token'\n\t\t\t}.map { |k,v| \"#{k}=#{v}\" }.join('&'))\n\t\t\tresponse = JSON.parse(data)\n\t\t\texp = response['expires_in'].seconds.from_now\n\t\t\tupdate_attributes({ token_expires_at: exp, access_token: response['access_token']})\n\t\tend\n\t\t\n\t\tif provider == \"twitter\"\n\t\t\tclient = OAuth::Consumer.new(creds['id'], creds['key'],\n\t\t\t\t{\n\t\t\t\t\tsite: creds['url'],\n\t\t\t\t\tssl: {ca_path: \"/etc/ssl/certs\"},\n\t\t\t\t\tscheme: :header\n\t\t\t\t})\n\t\t\ttoken_hash = {\n\t\t\t\toauth_token: access_token,\n\t\t\t\toauth_token_secret: access_token_secret\n\t\t\t}\n\t\t\ttoken = OAuth::AccessToken.from_hash(client, token_hash)\n\t\t\tlogger.debug params.inspect\n\t\t\tresp = token.request(method, creds['url'] + path, params[:params])\n\t\t\treturn JSON.parse(resp.body)\n\t\telse\n\t\t\tclient = OAuth2::Client.new(creds['id'], creds['key'], site: creds['url'], ssl: {ca_path: \"/etc/ssl/certs\"})\n\t\t\ttoken = OAuth2::AccessToken.new(client, access_token, header_format: \"OAuth %s\")\n\t\n\t\t\tcase method\n\t\t\twhen :get\n\t\t\t\treturn token.get(path).parsed\n\t\t\t\n\t\t\twhen :post\n\t\t\t\treturn token.post(path, params).parsed\n\t\t\n\t\t\twhen :delete\n\t\t\t\treturn token.delete(path).parsed\n\t\t\tend\n\t\tend\n\tend", "def getOauthToken(subdomain, username, password, identifier, header, cli_id)\n\tpayload = {token: {\n client_id: cli_id,\n scopes: ['read', 'write']\n }\n }\n\turi = URI.parse(\"https://\"+subdomain+\".zendesk.com/api/v2/oauth/tokens.json\")\n\thttp = Net::HTTP.new(uri.host, uri.port)\n\thttp.use_ssl = true\n\trequest = Net::HTTP::Post.new(uri.request_uri, header)\n\trequest.basic_auth(username, password)\n\trequest.body = payload.to_json\n\tresponse = http.request(request)\n\tdata = JSON.parse(response.body)\n\tputs \"Retrieving r/w token\"\n\tputs data\n\treturn data[\"token\"][\"full_token\"]\nend", "def get_token\n LastFM.get( \"auth.getToken\", {}, :secure )\n end", "def token_url(params = nil)\n connection.build_url(oauth_token_path, params).to_s\n end", "def me\n users(request(\"users/authenticate.xml\", :auth => true))\n end", "def oauth_request(params)\n logger.verbose('Resorting to OAuth to fulfill token request.')\n OAuthRequest.new(@authority.token_endpoint, params)\n end", "def api_token\n client.get(\"/user/api_token\").fetch(\"result\")\n end", "def get_request_token(consumer, callback)\n request_token = consumer.get_request_token({\n :scope => 'http://orkut.gmodules.com/social/rest',\n :oauth_callback => callback},\n :scope => 'http://orkut.gmodules.com/social')\n end", "def request_tokens(auth_code)\n @token = @oauth_client.auth_code.get_token auth_code, redirect_uri: @url\n tokens\n end", "def oauth\n request_token = @oauth_consumer.get_request_token\n authorize_url = request_token.authorize_url(:oauth_consumer_key => \n Netflix::Client.consumer_key)\n Launchy.open(authorize_url)\n puts \"Go to browser, a page has been opened to establish oauth\"\n printf \"Pin from Netflix:\"\n pin = gets.chomp\n access_token = request_token.get_access_token(:oauth_verifier => pin)\n end", "def get_access_token\n\t\treturn @credentials.get_access_token\n\tend", "def twitter_auth\n consumer = OAuth::Consumer.new Twitter.options[:consumer_key],\n Twitter.options[:consumer_secret],\n { :site => 'http://twitter.com/',\n :request_token_path => '/oauth/request_token',\n :access_token_path => '/oauth/access_token',\n :authorize_path => '/oauth/authorize'}\n\n request_token = consumer.get_request_token\n system(\"open\", request_token.authorize_url)\n print \"Enter the number they give you: \"\n pin = STDIN.readline.chomp\n\n access_token = request_token.get_access_token(:oauth_verifier => pin)\n\n puts access_token.get('/account/verify_credentials.json')\n return access_token\nend", "def request_token\n authconfig=Configuration.new\n authconfig.base_path=\"\"\n authClient=ApiClient.new(authconfig)\n authApi=AsposeDiagramCloud::OAuthApi.new(authClient)\n config=@api_client.config\n data, _status_code, _headers=authApi.o_auth_post(config.api_key['grant_type'],config.api_key['app_sid'],config.api_key['api_key'])\n #print(data.access_token)\n @api_client.default_headers[\"Authorization\"] =\"Bearer \" + data.access_token\n end", "def request_token\n authconfig=Configuration.new\n authconfig.base_path=\"\"\n authClient=ApiClient.new(authconfig)\n authApi=AsposeDiagramCloud::OAuthApi.new(authClient)\n config=@api_client.config\n data, _status_code, _headers=authApi.o_auth_post(config.api_key['grant_type'],config.api_key['app_sid'],config.api_key['api_key'])\n #print(data.access_token)\n @api_client.default_headers[\"Authorization\"] =\"Bearer \" + data.access_token\n end", "def get_access_token! env\n params = session(env).delete(:access_token_params)\n ::OAuth::AccessToken.from_hash consumer, params if params\n end", "def token\n @token ||= Rails.cache.fetch('osu_api_token', expires_in: 23.hours) do\n logger.debug(\"Fetching new OAuth2 Token from OSU API : #{@url}\")\n json = post(url_encoded_connection,\n ENV.fetch(OSU_API_OAUTH2_TOKEN),\n client_id: @key,\n client_secret: @secret,\n grant_type: 'client_credentials')\n json['access_token']\n end\n end", "def token_uri; end" ]
[ "0.69459975", "0.6941522", "0.6887504", "0.68795717", "0.6638988", "0.66004336", "0.6593189", "0.6554155", "0.6470296", "0.6461716", "0.6358654", "0.6358113", "0.6357234", "0.6357234", "0.63467234", "0.630794", "0.62951463", "0.6260778", "0.62469316", "0.6231196", "0.6226835", "0.61947584", "0.61738765", "0.61689734", "0.6160072", "0.6157455", "0.6141112", "0.61328477", "0.6132627", "0.6123571", "0.6113934", "0.61130667", "0.61096805", "0.6109324", "0.6105006", "0.61018854", "0.60874575", "0.60722226", "0.6062677", "0.6062677", "0.60529184", "0.6050099", "0.6022467", "0.60166174", "0.5993848", "0.598717", "0.5985653", "0.5975077", "0.5970877", "0.5965801", "0.5961678", "0.59601706", "0.59502745", "0.59364194", "0.5934536", "0.5927153", "0.5914326", "0.5907887", "0.58951014", "0.58929634", "0.58883727", "0.5886853", "0.5885966", "0.5871453", "0.58695257", "0.58559996", "0.5838949", "0.5837364", "0.58314013", "0.58209085", "0.5802704", "0.5793367", "0.5792858", "0.57705367", "0.5770404", "0.57696086", "0.5765628", "0.57654417", "0.5756473", "0.5755038", "0.5752011", "0.5735875", "0.5735569", "0.5711566", "0.56971574", "0.5694064", "0.5687033", "0.5686089", "0.5683577", "0.56828463", "0.5675385", "0.56725866", "0.5666725", "0.566633", "0.5660267", "0.56461006", "0.56432325", "0.56432325", "0.5637973", "0.56377", "0.5637364" ]
0.0
-1
GET /oauth_tokens/new GET /oauth_tokens/new.xml
def new @oauth_token = OauthToken.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @oauth_token } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @access_token = AccessToken.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @access_token }\n end\n end", "def new\n @api_token = ApiToken.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @api_token }\n end\n end", "def new\n @oauth_remote_service_provider = OauthRemoteServiceProvider.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @oauth_remote_service_provider }\n end\n end", "def get_new_access_token\n now = Time.now\n params = {\n body: {\n grant_type: 'urn:ietf:params:oauth:grant-type:uma-ticket',\n ticket: retrieve_ticket,\n client_id: key_info['oxtrust_client_id'],\n client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer',\n client_assertion: generate_json_web_token(now),\n scope: 'oxtrust-api-read oxtrust-api-write'\n }\n }\n req = HTTParty.post('https://localhost/oxauth/restv1/token', params)\n if req.code == 200\n token = req['access_token']\n save_access_token(token, now.to_i + 86_400)\n token\n else\n Puppet.err(\n \"Gluu API HTTP #{req.code}: #{req['error_description']}\",\n )\n end\n end", "def new\n @access_token = AccessToken.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @access_token }\n end\n end", "def new\n @verifier = params[:oauth_verifier]\n render \"oauth/new\"\n end", "def new\n @consumer = oauth_consumer\n \n @request_token = @consumer.get_request_token\n \n session[:request_token]=@request_token.token\n session[:request_token_secret]=@request_token.secret\n \n @authorize_url = @request_token.authorize_url({\n :oauth_consumer_key => NETFLIX_KEY,\n :application_name => NETFLIX_APP_NAME,\n :oauth_callback => url_for(:controller => :netflix, :action => :create)\n })\n \n redirect_to @authorize_url\n end", "def new\n @user = User.new\n @token = params[:token] if params.key? :token\n\n respond_to do |format|\n format.html {}\n format.xml { render :xml => @user }\n end\n end", "def get_tokens\n\t\tresource = \"/oauth/access_token\"\n\t\t\n\t\tbegin\n\t\t\tresponse = @connection.post resource do |request|\n\t\t\t\trequest.params['client_id'] = @api_key\n\t\t\t\trequest.params['client_secret'] = @secret_key\n\t\t\t\trequest.params['grant_type'] = @grant_type\n\t\t\t\trequest.params['scope'] = @scope\n\t\t\tend\n\t\t\t\n\t\t\tresult = process_response(response)\n\t\t\t\n\t\t\tif result[:access_token].nil? || result[:refresh_token].nil?\n\t\t\t\traise RuntimeError, \"Unable to complete oauth: #{response[:error]}\"\n\t\t\telse \n\t\t\t\t@access_token = result[:access_token]\n\t\t\t\t@refresh_token = result[:refresh_token]\n\t\t\tend\n\t\trescue => e\n\t\t\traise RuntimeError, e.to_s\n\t\tend\n\tend", "def create\n begin\n token = session[:pending_oauth_access_request][:request_token].get_access_token\n provider_id = session[:pending_oauth_access_request][:provider_id]\n respond_to do |format|\n if OauthRemoteAccessToken.create(:token_object => token,\n :oauth_remote_service_provider_id => provider_id,\n :user_id => current_user.id)\n clear_request_session_info\n flash[:notice] = \"You have sucessfully authorized us to use this service.\"\n format.html { redirect_to(oauth_remote_access_tokens_url) }\n format.xml { render :xml => @oauth_remote_access_token, :status => :created, :location => @oauth_remote_access_token }\n else\n flash[:notice] = \"There was a problem creating this token.\"\n format.html { redirect_to(oauth_remote_access_tokens_url) }\n format.xml { render :xml => @oauth_remote_access_token.errors, :status => :unprocessable_entity }\n end\n end\n rescue NoMethodError # raised if session does not contain oauth_access_request key\n redirect_to_error\n rescue Net::HTTPServerException => e # raised by get token if authorization declined by user\n redirect_to_error\n rescue Errno::ETIMEDOUT => e # network failure with provider, possibly due to bad url\n redirect_to_error\n end\n end", "def get_tokens\n resource = \"/oauth/access_token\"\n\n begin\n response = @connection.post resource do |request|\n request.params['client_id'] = @api_key\n request.params['client_secret'] = @secret_key\n request.params['grant_type'] = @grant_type\n request.params['scope'] = 'SPEECH,STTC,TTS'\n end\n\n result = process_response(response)\n\n if result[:access_token].nil? || result[:refresh_token].nil?\n raise RuntimeError, \"Unable to complete oauth: #{response[:error]}\"\n else\n @access_token = result[:access_token]\n @refresh_token = result[:refresh_token]\n end\n rescue => e\n raise RuntimeError, e.to_s\n end\n end", "def create\n @oauth_token = OauthToken.new(params[:oauth_token])\n\n respond_to do |format|\n if @oauth_token.save\n format.html { redirect_to([:scaffold, @oauth_token], :notice => 'Oauth token was successfully created.') }\n format.xml { render :xml => @oauth_token, :status => :created, :location => @oauth_token }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @oauth_token.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new\n begin\n provider = OauthRemoteServiceProvider.find(params[:oauth_remote_service_provider_id])\n consumer = OAuth::Consumer.new(provider.consumer_key, \n provider.consumer_secret,\n {:site => provider.site_url})\n # contact the remote service, for request token, returns request token object\n request_token = consumer.get_request_token\n # this means one pending oauth request peruser, might want to replace with db table\n session[:pending_oauth_access_request] = {:provider_id => params[:oauth_remote_service_provider_id], \n :request_token => request_token }\n # redirect to providers site for user authentication\n respond_to do |format|\n format.html { redirect_to(request_token.authorize_url) }\n format.xml { redirect_to(request_token.authorize_url) }\n end\n rescue ActiveRecord::RecordNotFound # raised if cannot find remote provider\n redirect_to_error\n rescue Net::HTTPServerException => e # consumer not setup properlly, key or secret are faulty\n redirect_to_error\n rescue Errno::ETIMEDOUT => e # network failure with provider, possibly due to bad url\n redirect_to_error\n end\n end", "def exchange_oauth_tokens\n end", "def new\n @token = Token.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @token }\n end\n end", "def index\n @oauth_tokens = OauthToken.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @oauth_tokens }\n end\n end", "def new\n next_url = AppConfig.facebook_app_url + \"facebook/callback\"\n #next_url += (\"?request_ids=\" + params[:request_ids]) unless params[:request_ids].nil?\n @auth_url = Authentication.auth.client.web_server.authorize_url(\n :redirect_uri => next_url, :scope => AppConfig.facebook_perms\n )\n end", "def create\n #request_token = @client.request_token(:oauth_callback => 'http://127.0.0.1:3000/twitter/new')\n #request_token = @client.request_token(:oauth_callback => 'https://gentle-snow-7462.herokuapp.com/twitter/new')\n request_token = @client.request_token(:oauth_callback => TWITTER_CALLBACK_URL)\n\n session['oauth_request_token_token'] = request_token.token\n session['oauth_request_token_secret'] = request_token.secret\n\n redirect_to request_token.authorize_url\n end", "def obtain_tokens(fqdn, client_id, client_secret, scope, tokens_file)\n read_tokens(tokens_file)\n \n response = RestClient.post \"#{fqdn}/oauth/access_token\", :grant_type => 'client_credentials', :client_id => client_id, :client_secret => client_secret, :scope => scope\n\t\n from_json = JSON.parse(response.to_str)\n @access_token = from_json['access_token']\n @refresh_token = from_json['refresh_token']\n write_tokens(tokens_file)\nend", "def create\n require 'digest/sha1'\n \n @access_token = AccessToken.new\n @access_token.user_id = current_user.id\n @access_token.last_access = Time.now\n @access_token.token = Digest::SHA1.hexdigest Time.now.to_s\n @access_token.active = true\n \n respond_to do |format|\n if @access_token.save\n format.html { redirect_to(@access_token, :notice => 'Access token was successfully created.') }\n format.xml { render :xml => @access_token, :status => :created, :location => @access_token }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @access_token.errors, :status => :unprocessable_entity }\n end\n end\n end", "def getNewToken(parameters = {})\n parameters.merge!({\n :client_id => @client_id,\n :client_secret => @client_secret\n })\n headers = {\n :content_type => \"application/x-www-form-urlencoded\",\n :accept => \"application/json\"\n }\n begin\n response = Transport.post(\"#{@fqdn}#{@suburl}\", parameters, headers)\n rescue RestClient::Exception => e\n raise(OAuthException, \"Problem obtaining a token: #{e.response || e.message}\", e.backtrace)\n end\n\n begin\n OAuthToken.createFromJson(response)\n rescue Exception => e\n raise(OAuthException, \"Error parsing the token response data: #{e}\", e.backtrace)\n end\n end", "def get_new_access_token\n client, auth = google_api_client_auth\n print(\"1. Open this page:\\n%s\\n\\n\" % auth.authorization_uri)\n print(\"2. Enter the authorization code shown in the page: \")\n system( 'open \"'+auth.authorization_uri+'\"' )\n auth.code = $stdin.gets.chomp\n auth.fetch_access_token!\n auth.access_token\n end", "def new\n @identity = Identity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @identity }\n end\n end", "def find_oauth_access_token\n end", "def fetch_access_token\n client.unauthenticated_request(:POST, '/v1/security/oauth2/token',\n grant_type: 'client_credentials',\n client_id: client.client_id,\n client_secret: client.client_secret)\n end", "def request_oauth_token\n request_token_hash = {\n \"oauth_consumer_key\" => \"#{@consumer_key}\",\n \"oauth_signature_method\" => \"HMAC-SHA1\",\n \"oauth_timestamp\" => timestamp,\n \"oauth_nonce\" => nonce,\n \"oauth_version\" => \"1.0\",\n \"oauth_callback\" => \"oob\",\n }\n\n # set signature\n request_token_hash[\"oauth_signature\"] = generate_oauth_signature(generate_signature_base_string(\"POST\", @request_token_url, request_token_hash))\n\n # post with auth header\n result = MyHttp.post(@request_token_url, nil, {\n \"Authorization\" => \"OAuth #{generate_auth_header(request_token_hash)}\",\n })\n\n auth_token_string = result.body.strip\n if result.is_a? Net::HTTPSuccess\n return string_param_to_hash(auth_token_string)\n else\n status = result.code\n return nil\n end\n end", "def new\n @user_openid = UserOpenid.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user_openid }\n end\n end", "def new_token(token)\n puts(token.to_json)\n @api.post(\"#{Paths::TOKENS}\", :body => token)\n end", "def generate_request_token\n\n #FIXME change IP == \"#{IP}mob/twitter/generate_access_token\"\n request_token = TwitterAccount.twitter_consumer.get_request_token(:oauth_callback => \"http://localhost:3000/mob/twitter/generate_access_token\"\n )\n\n url = request_token.authorize_url\n redirect_to(url)\n end", "def get_token\n begin\n @response = RestClient.post(\n @consumer[:token_request_url],\n client_id: @consumer[:client_id],\n client_secret: @consumer[:client_secret],\n grant_type: @consumer[:grant_type],\n resource: @consumer[:resource]\n )\n\n @consumer[:token] = 'Bearer ' + JSON.parse(@response)['access_token']\n @consumer[:token_expiry] = JSON.parse(@response)['expires_on']\n rescue => error\n puts(\"ERROR - Token Request Failed - #{error}\")\n end\n @consumer[:token]\n end", "def get_request_token( oauth_callback = TWOAUTH_CALLBACK )\n\t\tself.consumer.get_request_token( :oauth_callback => oauth_callback )\n\tend", "def token_url\n \"#{sk_url}/oauth/token\"\n end", "def createToken(opts = {})\n headers = opts\n if headers[:old_token]\n headers[:refresh_token] = headers[:old_token].refresh_token\n headers[:grant_type] = \"refresh_token\"\n headers.delete(:old_token)\n end\n\n default_headers = {\n :grant_type => @grant_type,\n :client_id => @client_id,\n :client_secret => @client_secret,\n :scope => @scope\n }\n\n headers = default_headers.merge(headers)\n\n response = RestClient.post \"#{@fqdn}#{@endpoint}\", headers\n json = JSON.parse(response)\n expiry = Time.now.to_i + json['expires_in'].to_i\n return OAuthToken.new(json['access_token'], expiry, json['refresh_token'])\n end", "def index\n @oauth_remote_access_tokens = User.current.oauth_remote_access_tokens.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @oauth_remote_access_tokens }\n end\n end", "def create_token\n return api_call('request-token',{\"apiKey\"=> @@_api_key });\n end", "def fetchTokens\n self.class.request.get \"#{id}/tokens\" \n end", "def create_request_token(params={})\n RequestToken.create :client_application => self, :callback_url=>self.token_callback_url\n end", "def create_oauth_application(token, name, redirect_uris)\n request(\n __method__,\n :post,\n \"#{api_base}/oauth2/applications\",\n { name: name, redirect_uris: redirect_uris }.to_json,\n Authorization: token,\n content_type: :json\n )\n end", "def create_oauth_application(token, name, redirect_uris)\n request(\n __method__,\n :post,\n \"#{api_base}/oauth2/applications\",\n { name: name, redirect_uris: redirect_uris }.to_json,\n Authorization: token,\n content_type: :json\n )\n end", "def get_token\n consumer = OAuth::Consumer.new('jzICjLlLF3dLrGVaVal0w', '3ydl3o44K4MaR8sFAk2gWtTTzHfFc7PzZjelP0XIoik', {\n :site => 'https://api.twitter.com',\n :scheme => :header\n })\n token_hash = {\n :oauth_token => '14615533-Qy2ck9vrfqsNdUp5cGi5PpHyrqBRmh7aXP6qcUr9w',\n :oauth_token_secret => 'tECZ96ci1nXrvs3OkxSEbZyQtngQWslhgGeuTgEFJwU'\n }\n\n OAuth::AccessToken.from_hash(consumer, token_hash)\nend", "def new\n @last_id = LastId.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @last_id }\n end\n end", "def new\n @omatsuri = Omatsuri.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @omatsuri }\n end\n end", "def create_request_token(params={})\n\t\tRequestToken.create :client_application => self, :callback_url=>self.token_callback_url\n\tend", "def get_request_token(oauth_callback)\n @myspacecontext.get_request_token(oauth_callback)\n end", "def retrieve_token\n puts \"Picking up new token.\"\n parsed_json = {}\n until parsed_json[\"access_token\"]\n results = `curl -X -vvv -d 'client_id=MY_CLIENT_KEY&client_secret=MY_CLIENT_SECRET&grant_type=client_credentials' -X POST 'https://connect.gettyimages.com/oauth2/token/'`\n parsed_json = JSON.parse results\n end\n @token = parsed_json[\"access_token\"]\n end", "def oauth2_token_client_credentials\n @token = Oauth2Token.create(:client_application => @client_application, :scope=>params[:scope])\n render :json => @token\n end", "def build_token(access_token)\n return OAuth2::AccessToken.new CLIENT, access_token\n end", "def new\n @user_token = UserToken.new\n client = Fitgem::Client.new(:consumer_key => MY_CONSUMER_KEY, :consumer_secret => MY_CONSUMER_SECRET)\n request_token = client.request_token\n @user_token.request_token = request_token\n @user_token.token = request_token.token\n @user_token.secret = request_token.secret\n @user_token.save\n @auth_url = \"http://www.fitbit.com/oauth/authorize?oauth_token=#{@user_token.token}\"\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dashboard }\n end\n end", "def new\n @provider = Provider.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @provider }\n end\n end", "def get_new_token\n auth = 'Basic ' + Base64.strict_encode64( session[:client_id] + \":\" + session[:client_secret]).chomp\n \n rcResultJson = RestClient.post(\n session[:token_url],\n {\n grant_type: 'refresh_token', \n refresh_token: session[:refresh_token], \n },\n {\n :Authorization => auth\n }\n )\n rcResult = JSON.parse(rcResultJson)\n\n session[:patient_id] = rcResult[\"patient\"]\n session[:access_token] = rcResult[\"access_token\"]\n session[:refresh_token] = rcResult[\"refresh_token\"]\n session[:token_expiration] = (Time.now.to_i + rcResult[\"expires_in\"].to_i )\n rescue StandardError => exception\n # binding.pry \n err = \"Failed to refresh token: \" + exception.message\n redirect_to root_path, alert: err\n end", "def new\n @twitterfeed = Twitterfeed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @twitterfeed }\n end\n end", "def new\n if current_haka_user\n flash.notice = \"Olet jo kirjautunut sisään.\"\n redirect_to registrations_root_path and return\n end\n\n request = OneLogin::RubySaml::Authrequest.new\n redirect_to(request.create(saml_settings))\n end", "def request_token\n consumer.get_request_token(:oauth_callback => Koprol.callback_url)\n end", "def get_new_token\n binding.pry \n auth = 'Basic ' + Base64.strict_encode64( session[:client_id] +\":\"+session[:client_secret]).chomp\n \n rcResultJson = RestClient.post(\n session[:token_url],\n {\n grant_type: 'refresh_token', \n refresh_token: session[:refresh_token], \n },\n {\n :Authorization => auth\n }\n )\n rcResult = JSON.parse(rcResultJson)\n\n session[:patient_id] = rcResult[\"patient\"]\n session[:access_token] = rcResult[\"access_token\"]\n session[:refresh_token] = rcResult[\"refresh_token\"]\n session[:token_expiration] = Time.now.to_i + rcResult[\"expires_in\"].to_i \n rescue => exception\n binding.pry \n err = \"Failed to refresh token\"\n redirect_to root_path, flash: { error: err }\n end", "def get_access_token\n uri = URI.parse(@token_url)\n http = Net::HTTP.new(uri.host, uri.port)\n req = Net::HTTP::Post.new(uri.request_uri)\n auth = Base64.encode64(@login + ':' + @password).gsub(\"\\n\", \"\")\n req['Authorization'] = \"Basic #{auth}\"\n send = 'grant_type=client_credentials'\n req.body = send\n res = http.request(req)\n if res.code == \"200\"\n data = res.body\n result = JSON.parse(data)\n @access_token = result['access_token']\n else\n puts \"Invalid getting access token\"\n exit\n end\n end", "def new\n @account = Account.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @account, callback: params[:callback] }\n format.xml { render xml: @account }\n end\n end", "def request_token\n consumer.get_request_token(:oauth_callback => Etsy.callback_url)\n end", "def request_token\n consumer.get_request_token(:oauth_callback => Etsy.callback_url)\n end", "def oauth2_token_client_credentials\n @token = Oauth2Token.create :client_application=>@client_application, :user=>@client_application.user, :scope=>params[:scope]\n render :json=>@token\n end", "def oauth2_token_client_credentials\n @token = Oauth2Token.create :client_application=>@client_application, :user=>@client_application.user, :scope=>params[:scope]\n render :json=>@token\n end", "def access_token\n OAuth::AccessToken.new(consumer, oauth_token, oauth_token_secret)\n end", "def get_token\n get(TOKEN_URL)\n end", "def create\n begin\n req = EvernoteAPI::Request.new(new_evernote_path(:only_path => false),\n session[:request_token])\n # Now verify with Yammer and get the final access token for user\n @result = \"Congratulations - access to Evernote is now set up!\"\n begin\n access_token = req.verify(params[:oauth_verifier])\n # save in db for next time\n current_user.evernote = access_token.token, access_token.secret\n if current_user.evernote\n redirect_to :show\n else\n @result = \"login or database error - Evernote setup failed.\"\n end\n rescue\n @result = \"Evernote authorization failed!\"\n end\n rescue\n flash[:error] = $!\n @result = \"We're sorry but something went wrong.\"\n end\n render \"oauth/show\"\n end", "def gen_tokens\n self.access_token = SecureRandom.hex(16)\n end", "def retrieve(options = {})\n body = options.fetch(:body, {})\n\n @client.post(\"oauth/token?grant_type=client_credentials\", body, options)\n end", "def create_oauth_application(name, redirect_uris)\n response = JSON.parse(API.create_oauth_application(@token, name, redirect_uris))\n [response['id'], response['secret']]\n end", "def create_oauth_application(name, redirect_uris)\n response = JSON.parse(API.create_oauth_application(@token, name, redirect_uris))\n [response['id'], response['secret']]\n end", "def on_new_oauth!(oauth_response)\n authentications.new(\n \"uid\" => oauth_response[\"uid\"],\n \"provider\" => oauth_response[\"provider\"]\n )\n self\n end", "def rest_token_endpoint; end", "def init\n init_oauth_access_token\n end", "def new\n authorize! :create, NotificationTemplate.new\n\n @notification_template = NotificationTemplate.new\n @supported_events = Notifier.supported_events\n @supported_formats = Notifier.supported_formats\n #prepare some help text arrays for available tokens\n @available_tokens = self.notification_tokens\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @notification_template }\n end\n end", "def create\n puts \"MESSAGE 14 IN CREATE\"\n @auth = request.env['omniauth.auth']['credentials']\n # The following statement saves the tokens to the database\n Token.create(\n access_token: @auth['token'],\n refresh_token: @auth['refresh_token'],\n expires_at: Time.at(@auth['expires_at']).to_datetime)\n end", "def request_token\n @token = current_client_application.create_request_token\n if @token\n render :text => @token.to_query\n else\n render :nothing => true, :status => 401\n end\n end", "def generate_access_token\n @user = current_user\n begin \n request_token = OAuth::RequestToken.new(TwitterAccount.twitter_consumer,\n params[\"oauth_token\"], params[\"oauth_verifier\"])\n if @user.twitter_account\n @user.twitter_account.delete\n end\n t_account = @user.create_twitter_account(request_token)\n\n unless t_account.new_record?\n flash[:notice] = 'You are now connected to twitter $green'\n l = Log.new\n l.user_id_1 = @user.id\n name_1 = if @user.name.nil? then @user.email.split('@')[0] else @user.name end\n l.message = \"#{name_1.humanize} is now connected to twitter account\"\n l.loggingtype = 0\n l.save\n\n else \n flash[:notice] = 'Couldn\\'t connect to twitter $red'\n end \n redirect_to controller: 'users', action: 'connect_social_accounts'\n\n rescue \n flash[:notice] = 'Couldn\\'t connect to twitter $red'\n redirect_to controller: 'users', action: 'connect_social_accounts'\n end \n end", "def access_token\n end", "def new\n @atom = Atom.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @atom }\n end\n end", "def fresh_token\n refresh! if token_expired?\n access_token\n end", "def get_access_token()\n url = URI.parse(TOKEN_ENDPOINT)\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n req = Net::HTTP::Post.new(url.path)\n req.basic_auth(@clientId, @clientSecret)\n req.set_form_data({'grant_type' => 'client_credentials'})\n res = http.request(req)\n JSON.parse(res.body)['access_token']\n end", "def request_access_token\n # An `OAuth::Consumer` object can make requests to the service on\n # behalf of the client application.\n\n # Ask service for a URL to send the user to so that they may authorize\n # us.\n request_token = CONSUMER.get_request_token\n authorize_url = request_token.authorize_url\n\n # Launchy is a gem that opens a browser tab for us\n Launchy.open(authorize_url)\n\n # Because we don't use a redirect URL; user will receive a short PIN\n # (called a **verifier**) that they can input into the client\n # application. The client asks the service to give them a permanent\n # access token to use.\n puts \"Login, and type your verification code in\"\n oauth_verifier = gets.chomp\n access_token = request_token.get_access_token(\n :oauth_verifier => oauth_verifier\n )\nend", "def oauth_request(params)\n logger.verbose('Resorting to OAuth to fulfill token request.')\n OAuthRequest.new(@authority.token_endpoint, params)\n end", "def oauth_url\n @oauth_url || File.join(host, \"oauth20/token\")\n end", "def token_generate\n res = call('auth.token_generate')\n\n return unless res || res['token']\n\n res['token']\n end", "def xauth_token\n consumer = oauth_consumer\n request_token = consumer.get_request_token\n consumer.get_access_token(\n request_token, {},\n {\n :x_auth_mode => 'client_auth',\n :x_auth_username => cred['username'],\n :x_auth_password => cred['password']\n }\n )\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 request_token\n request = { query: { code: ENV['GOOGL_CODE'], \n client_id: ENV['GOOGL_CLIENT_ID'], \n client_secret: ENV['GOOGL_CLIENT_SECRET'],\n redirect_uri: ENV['GOOGL_REDIRECT_URI'],\n grant_type: \"authorization_code\" } }\n\n result = self.class.post(\"/oauth2/v3/token\", request)\n\n result.parsed_response\n end", "def bearer_token\n # Put the url together\n url = \"#{API_HOST}#{TOKEN_PATH}\"\n\n raise \"Please set your CLIENT_ID\" if CLIENT_ID.nil?\n raise \"Please set your CLIENT_SECRET\" if CLIENT_SECRET.nil?\n\n # Build our params hash\n params = {\n client_id: CLIENT_ID,\n client_secret: CLIENT_SECRET,\n grant_type: GRANT_TYPE\n }\n\n response = HTTP.post(url, params: params)\n parsed = response.parse\n\n \"#{parsed['token_type']} #{parsed['access_token']}\"\nend", "def new\n redirect_to user_saml_omniauth_authorize_path\n end", "def token_url(params = nil)\n connection.build_url(oauth_token_path, params).to_s\n end", "def fresh_token\n refresh! if expired?\n access_token\n end", "def new\n @bb_auth_user = BbAuthUser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bb_auth_user }\n end\n end", "def add_oauth(req, consumer, atok, asec)\r\n access_token = OAuth::AccessToken.new(consumer, atok, asec)\r\n consumer.sign!(req, access_token)\r\nend", "def new\n @account = current_user.accounts.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n end\n end", "def create\n client.authorization_code = params[:code]\n access_token = client.access_token!\n puts access_token\n end", "def oauth\n request_token = @oauth_consumer.get_request_token\n authorize_url = request_token.authorize_url(:oauth_consumer_key => \n Netflix::Client.consumer_key)\n Launchy.open(authorize_url)\n puts \"Go to browser, a page has been opened to establish oauth\"\n printf \"Pin from Netflix:\"\n pin = gets.chomp\n access_token = request_token.get_access_token(:oauth_verifier => pin)\n end", "def new_token\n\t\t\tSecureRandom.urlsafe_base64\n\t\tend", "def new_token\n\t\t\tSecureRandom.urlsafe_base64\n\t\tend", "def new_token\n\t\t\tSecureRandom.urlsafe_base64\n\t\tend", "def new_token\n\t\t\tSecureRandom.urlsafe_base64\n\t\tend", "def new_token\n\t\t\tSecureRandom.urlsafe_base64\n\t\tend", "def token_uri; end" ]
[ "0.67472833", "0.64514196", "0.63993466", "0.63331604", "0.62461716", "0.618578", "0.61620504", "0.613908", "0.61387736", "0.6074876", "0.6041273", "0.6035804", "0.5994502", "0.5948608", "0.5906072", "0.58988297", "0.5896042", "0.589371", "0.58553654", "0.58504736", "0.5849075", "0.58455664", "0.57630444", "0.5756178", "0.5740954", "0.5695221", "0.56860244", "0.5664981", "0.5652806", "0.56496304", "0.56422764", "0.56286263", "0.5622471", "0.55794585", "0.5575423", "0.55555165", "0.5554755", "0.55491257", "0.55491257", "0.5539675", "0.5538429", "0.5529524", "0.55023056", "0.5497912", "0.54965574", "0.5483472", "0.54759747", "0.54649633", "0.5462536", "0.5459124", "0.54556954", "0.54537946", "0.5450166", "0.54459316", "0.54448617", "0.5440656", "0.54401356", "0.54401356", "0.5438768", "0.5438768", "0.54352903", "0.5431627", "0.5423727", "0.5423123", "0.54169226", "0.54045755", "0.54045755", "0.53936356", "0.5376628", "0.5369754", "0.5369602", "0.53630626", "0.5358588", "0.5353346", "0.53515244", "0.534023", "0.533735", "0.53344196", "0.53333825", "0.53327376", "0.5330818", "0.5324011", "0.5321723", "0.5321402", "0.5321071", "0.5319124", "0.5309247", "0.5306241", "0.530359", "0.53004515", "0.5299276", "0.5296901", "0.52958053", "0.5295357", "0.52941453", "0.52941453", "0.52941453", "0.52941453", "0.52941453", "0.529377" ]
0.76072115
0
POST /oauth_tokens POST /oauth_tokens.xml
def create @oauth_token = OauthToken.new(params[:oauth_token]) respond_to do |format| if @oauth_token.save format.html { redirect_to([:scaffold, @oauth_token], :notice => 'Oauth token was successfully created.') } format.xml { render :xml => @oauth_token, :status => :created, :location => @oauth_token } else format.html { render :action => "new" } format.xml { render :xml => @oauth_token.errors, :status => :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exchange_oauth_tokens\n end", "def get_tokens\n resource = \"/oauth/access_token\"\n\n begin\n response = @connection.post resource do |request|\n request.params['client_id'] = @api_key\n request.params['client_secret'] = @secret_key\n request.params['grant_type'] = @grant_type\n request.params['scope'] = 'SPEECH,STTC,TTS'\n end\n\n result = process_response(response)\n\n if result[:access_token].nil? || result[:refresh_token].nil?\n raise RuntimeError, \"Unable to complete oauth: #{response[:error]}\"\n else\n @access_token = result[:access_token]\n @refresh_token = result[:refresh_token]\n end\n rescue => e\n raise RuntimeError, e.to_s\n end\n end", "def get_tokens\n\t\tresource = \"/oauth/access_token\"\n\t\t\n\t\tbegin\n\t\t\tresponse = @connection.post resource do |request|\n\t\t\t\trequest.params['client_id'] = @api_key\n\t\t\t\trequest.params['client_secret'] = @secret_key\n\t\t\t\trequest.params['grant_type'] = @grant_type\n\t\t\t\trequest.params['scope'] = @scope\n\t\t\tend\n\t\t\t\n\t\t\tresult = process_response(response)\n\t\t\t\n\t\t\tif result[:access_token].nil? || result[:refresh_token].nil?\n\t\t\t\traise RuntimeError, \"Unable to complete oauth: #{response[:error]}\"\n\t\t\telse \n\t\t\t\t@access_token = result[:access_token]\n\t\t\t\t@refresh_token = result[:refresh_token]\n\t\t\tend\n\t\trescue => e\n\t\t\traise RuntimeError, e.to_s\n\t\tend\n\tend", "def post(url, params = {})\n raise OAuthUnauthorized if !access_token\n access_token.post(url, params)\n end", "def post(url, params = {})\n raise OAuthUnauthorized if !access_token\n access_token.post(url, params)\n end", "def request_oauth_token\n request_token_hash = {\n \"oauth_consumer_key\" => \"#{@consumer_key}\",\n \"oauth_signature_method\" => \"HMAC-SHA1\",\n \"oauth_timestamp\" => timestamp,\n \"oauth_nonce\" => nonce,\n \"oauth_version\" => \"1.0\",\n \"oauth_callback\" => \"oob\",\n }\n\n # set signature\n request_token_hash[\"oauth_signature\"] = generate_oauth_signature(generate_signature_base_string(\"POST\", @request_token_url, request_token_hash))\n\n # post with auth header\n result = MyHttp.post(@request_token_url, nil, {\n \"Authorization\" => \"OAuth #{generate_auth_header(request_token_hash)}\",\n })\n\n auth_token_string = result.body.strip\n if result.is_a? Net::HTTPSuccess\n return string_param_to_hash(auth_token_string)\n else\n status = result.code\n return nil\n end\n end", "def oauth_v2_token_post(opts = {})\n data, _status_code, _headers = oauth_v2_token_post_with_http_info(opts)\n data\n end", "def obtain_tokens(fqdn, client_id, client_secret, scope, tokens_file)\n read_tokens(tokens_file)\n \n response = RestClient.post \"#{fqdn}/oauth/access_token\", :grant_type => 'client_credentials', :client_id => client_id, :client_secret => client_secret, :scope => scope\n\t\n from_json = JSON.parse(response.to_str)\n @access_token = from_json['access_token']\n @refresh_token = from_json['refresh_token']\n write_tokens(tokens_file)\nend", "def create\n begin\n token = session[:pending_oauth_access_request][:request_token].get_access_token\n provider_id = session[:pending_oauth_access_request][:provider_id]\n respond_to do |format|\n if OauthRemoteAccessToken.create(:token_object => token,\n :oauth_remote_service_provider_id => provider_id,\n :user_id => current_user.id)\n clear_request_session_info\n flash[:notice] = \"You have sucessfully authorized us to use this service.\"\n format.html { redirect_to(oauth_remote_access_tokens_url) }\n format.xml { render :xml => @oauth_remote_access_token, :status => :created, :location => @oauth_remote_access_token }\n else\n flash[:notice] = \"There was a problem creating this token.\"\n format.html { redirect_to(oauth_remote_access_tokens_url) }\n format.xml { render :xml => @oauth_remote_access_token.errors, :status => :unprocessable_entity }\n end\n end\n rescue NoMethodError # raised if session does not contain oauth_access_request key\n redirect_to_error\n rescue Net::HTTPServerException => e # raised by get token if authorization declined by user\n redirect_to_error\n rescue Errno::ETIMEDOUT => e # network failure with provider, possibly due to bad url\n redirect_to_error\n end\n end", "def new\n @oauth_token = OauthToken.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @oauth_token }\n end\n end", "def update_tokens(oauth_params)\n# binding.pry\n self.oauth_token = oauth_params.credentials.token\n # facebook, google provide this; twitter, linkedin don't\n self.oauth_expires_at = Time.at(oauth_params.credentials.expires_at) if oauth_params.credentials.expires_at\n # twitter\n self.oauth_secret = oauth_params.credentials.secret if oauth_params.credentials.secret\n end", "def post_access_token(opts = {})\r\n data, _status_code, _headers = post_access_token_with_http_info(opts)\r\n return data\r\n end", "def oauth2_token_client_credentials\n @token = Oauth2Token.create :client_application=>@client_application, :user=>@client_application.user, :scope=>params[:scope]\n render :json=>@token\n end", "def oauth2_token_client_credentials\n @token = Oauth2Token.create :client_application=>@client_application, :user=>@client_application.user, :scope=>params[:scope]\n render :json=>@token\n end", "def oauth2_token_client_credentials\n @token = Oauth2Token.create(:client_application => @client_application, :scope=>params[:scope])\n render :json => @token\n end", "def request_access_token(oauth_verifier)\n access_token_hash = {\n \"oauth_consumer_key\" => \"#{@consumer_key}\",\n \"oauth_token\" => \"#{@oauth_token[\"oauth_token\"]}\",\n \"oauth_signature_method\" => \"HMAC-SHA1\",\n \"oauth_timestamp\" => timestamp,\n \"oauth_nonce\" => nonce,\n \"oauth_version\" => \"1.0\",\n \"oauth_verifier\" => \"#{oauth_verifier}\",\n }\n\n # set signature\n access_token_hash[\"oauth_signature\"] = generate_oauth_signature(generate_signature_base_string(\"POST\", @access_token_url, access_token_hash))\n\n # post with auth header\n result = MyHttp.post(@access_token_url, nil, {\n \"Authorization\" => \"OAuth #{generate_auth_header(access_token_hash)}\",\n })\n\n access_token_string = result.body.strip\n if result.is_a? Net::HTTPSuccess\n return string_param_to_hash(access_token_string)\n else\n status = result.code\n return nil\n end\n end", "def post_xml_64(xml=:example_response)\n post \"/auth/saml/callback\", {'SAMLResponse' => load_xml_64(xml)}\nend", "def add_oauth(req, consumer, atok, asec)\r\n access_token = OAuth::AccessToken.new(consumer, atok, asec)\r\n consumer.sign!(req, access_token)\r\nend", "def create\n #request_token = @client.request_token(:oauth_callback => 'http://127.0.0.1:3000/twitter/new')\n #request_token = @client.request_token(:oauth_callback => 'https://gentle-snow-7462.herokuapp.com/twitter/new')\n request_token = @client.request_token(:oauth_callback => TWITTER_CALLBACK_URL)\n\n session['oauth_request_token_token'] = request_token.token\n session['oauth_request_token_secret'] = request_token.secret\n\n redirect_to request_token.authorize_url\n end", "def api_post(url, oauth_token, params = {})\n RestClient.reset_before_execution_procs\n RestClient.add_before_execution_proc do |req, _|\n req[\"Authorization\"] = \"OAuth #{ oauth_token }\"\n end\n send_params = { client_id: @client_id, client_secret: @client_secret }.merge(params)\n result = RestClient.post url, send_params.to_json, content_type: :json, accept: :json\n case response.code\n when 200\n JSON.parse(result.body)[\"response_data\"]\n else\n { error: JSON.parse(result.body), status: result.code }\n end\n rescue RestClient::Exception => e\n { error: JSON.parse(e.response.body), status: e.response.code }\n end", "def add_oauth(req)\n @consumer.sign!(req, @access_token)\nend", "def request_token(params)\n header = {}\n\n if @endpoint_auth == :basic\n header = { authorization: 'Basic ' + Base64.encode64(\"#{@client_id}:#{@client_secret}\") }\n else\n params[:client_id] = @client_id\n params[:client_secret] = @client_secret\n end\n\n request = Net::HTTP::Post.new(@token_endpoint, header)\n request.form_data = params\n Net::HTTP.start(@host.hostname, @host.port, use_ssl: true) { |http| http.request(request) }\n end", "def post(url, params = {})\n post_auth_hash = {\n \"oauth_consumer_key\" => \"#{@consumer_key}\",\n \"oauth_token\" => \"#{@access_token[\"oauth_token\"]}\",\n \"oauth_signature_method\" => \"HMAC-SHA1\",\n \"oauth_timestamp\" => timestamp,\n \"oauth_nonce\" => nonce,\n \"oauth_version\" => \"1.0\",\n }\n\n # set signature\n post_auth_hash[\"oauth_signature\"] = generate_access_signature(generate_signature_base_string(\"POST\", url, post_auth_hash, params))\n\n # post with auth header\n return MyHttp.post(url, params, {\n \"Authorization\" => \"OAuth #{generate_auth_header(post_auth_hash)}\",\n \"Content-Type\" => \"application/x-www-form-urlencoded\",\n })\n end", "def request(options)\n raise HyvesException, 'You need an access token to make requests' if access_token.nil?\n options = default_request_options.merge(options)\n access_token.post('/', options)\n end", "def post(path, data = {})\n self.class.post path, :body => data.merge(:u => access_token)\n end", "def post_token_request()\r\n # Create REST request header\r\n header = get_header()\r\n begin\r\n # Post REST request \r\n response = RestClient.post(@token_request_uri, @token_request_body, header) \r\n if (response.code == 200 || response.code == 201)\r\n return JSON.parse(response.body)\r\n else\r\n @logger.trace(\"Rest client response from ADD API ['#{response}']\")\r\n raise (\"Failed to get AAD token: http code \" + response.code.to_s)\r\n end\r\n rescue RestClient::ExceptionWithResponse => ewr\r\n @logger.trace(\"Rest client response from ADD API ['#{ewr.response}']\")\r\n raise (\"Failed to get AAD token: http code \" + ewr.response.code.to_s)\r\n end\r\n end", "def oauth_request(params)\n logger.verbose('Resorting to OAuth to fulfill token request.')\n OAuthRequest.new(@authority.token_endpoint, params)\n end", "def index\n @oauth_tokens = OauthToken.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @oauth_tokens }\n end\n end", "def token\n oauth_merged_params[:oauth_token]\n end", "def update_token\n params = {\n client_id: client_id,\n client_secret: client_secret,\n grant_type: 'refresh_token',\n refresh_token: refresh_token\n }\n request(:post, 'oauth2/token', params, true)\n end", "def get_new_access_token\n now = Time.now\n params = {\n body: {\n grant_type: 'urn:ietf:params:oauth:grant-type:uma-ticket',\n ticket: retrieve_ticket,\n client_id: key_info['oxtrust_client_id'],\n client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer',\n client_assertion: generate_json_web_token(now),\n scope: 'oxtrust-api-read oxtrust-api-write'\n }\n }\n req = HTTParty.post('https://localhost/oxauth/restv1/token', params)\n if req.code == 200\n token = req['access_token']\n save_access_token(token, now.to_i + 86_400)\n token\n else\n Puppet.err(\n \"Gluu API HTTP #{req.code}: #{req['error_description']}\",\n )\n end\n end", "def request_api_token(client_id, client_secret, options = {})\n options.merge!({\n body: {\n grant_type: 'client_credentials',\n client_id: client_id,\n client_secret: client_secret,\n scope: 'alexa::proactive_events'\n }\n })\n\n HTTParty.post(ACCESS_TOKEN_REQUEST_URL, options)\n end", "def set_tokens_from_post(path, verifier=nil)\n query = create_query_string_from_hash({\n \"code\" => verifier,\n \"grant_type\" => \"authorization_code\",\n \"redirect_uri\" => callback_url\n })\n response = post(path+query)\n require_server_success_response(response)\n result = JSON::parse(response.body)\n # We only get an access token with OAuth2 so we set the\n # access_token_secret to N/A so authenticated checks don't break\n set_tokens(result['access_token'].to_s, \"N/A\")\n raise \"Unable to verify code\" unless !@verifier.nil? || authenticated?\n result\n end", "def xauth_token\n consumer = oauth_consumer\n request_token = consumer.get_request_token\n consumer.get_access_token(\n request_token, {},\n {\n :x_auth_mode => 'client_auth',\n :x_auth_username => cred['username'],\n :x_auth_password => cred['password']\n }\n )\n end", "def post(path, params = {})\n response = access_token.post(path, params.stringify_keys, header)\n parse_response(response)\n end", "def create_token\n ong=Ong.find(params[:ong_id])\n initiative=Initiative.find(params[:initiative_id])\n @api = AdwordAuth.create_adwords_api(ong)\n\n token_params=@api.authorize({\n :oauth2_callback => create_token_ong_adword_auths_url(ong)+ \"?initiative_id=#{initiative.id}\" ,\n :oauth2_verification_code => params[:code]\n })\n token_params.delete(:id_token)\n @adword_auth = AdwordAuth.new(token_params)\n @adword_auth.ong=ong\n respond_to do |format|\n if @adword_auth.save\n format.html { \n flash[:auth_adwords] = true\n redirect_to [ong, initiative], notice: 'Autorización Correcta' \n }\n \n else\n format.html { \n flash[:auth_adwords] = false\n redirect_to [ong, initiative], notice: 'Autorización Correcta' \n }\n \n end\n end\n end", "def create_user_token(username, password)\n body = {\n grant_type: 'password',\n username: username,\n password: password\n }\n @client.post('/auth/oauth2/token', body, {}, {'Content-Type' => 'application/x-www-form-urlencoded'})\n end", "def oauth_token\n @json['oauthToken']\n end", "def create\n require 'digest/sha1'\n \n @access_token = AccessToken.new\n @access_token.user_id = current_user.id\n @access_token.last_access = Time.now\n @access_token.token = Digest::SHA1.hexdigest Time.now.to_s\n @access_token.active = true\n \n respond_to do |format|\n if @access_token.save\n format.html { redirect_to(@access_token, :notice => 'Access token was successfully created.') }\n format.xml { render :xml => @access_token, :status => :created, :location => @access_token }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @access_token.errors, :status => :unprocessable_entity }\n end\n end\n end", "def request_token\n authconfig=Configuration.new\n authconfig.base_path=\"\"\n authClient=ApiClient.new(authconfig)\n authApi=AsposeDiagramCloud::OAuthApi.new(authClient)\n config=@api_client.config\n data, _status_code, _headers=authApi.o_auth_post(config.api_key['grant_type'],config.api_key['app_sid'],config.api_key['api_key'])\n #print(data.access_token)\n @api_client.default_headers[\"Authorization\"] =\"Bearer \" + data.access_token\n end", "def request_token\n authconfig=Configuration.new\n authconfig.base_path=\"\"\n authClient=ApiClient.new(authconfig)\n authApi=AsposeDiagramCloud::OAuthApi.new(authClient)\n config=@api_client.config\n data, _status_code, _headers=authApi.o_auth_post(config.api_key['grant_type'],config.api_key['app_sid'],config.api_key['api_key'])\n #print(data.access_token)\n @api_client.default_headers[\"Authorization\"] =\"Bearer \" + data.access_token\n end", "def oauth_v2_token_post_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AuthAndRegistrationApi.oauth_v2_token_post ...'\n end\n # resource path\n local_var_path = '/oauth/v2/token'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(opts[:'oauth_token_request'])\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 => 'Token')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AuthAndRegistrationApi#oauth_v2_token_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def find_oauth_access_token\n end", "def post(url, params)\n params = convert_hash_keys(params)\n @access_token = params.delete('access_token') if params['access_token']\n return connection.post(url, params)\n end", "def token\n auth_client.token(settings.oauth2_token).tap do |token|\n settings.save_oauth2_token(token.to_hash)\n end\n end", "def create_oauth_application(token, name, redirect_uris)\n request(\n __method__,\n :post,\n \"#{api_base}/oauth2/applications\",\n { name: name, redirect_uris: redirect_uris }.to_json,\n Authorization: token,\n content_type: :json\n )\n end", "def create_oauth_application(token, name, redirect_uris)\n request(\n __method__,\n :post,\n \"#{api_base}/oauth2/applications\",\n { name: name, redirect_uris: redirect_uris }.to_json,\n Authorization: token,\n content_type: :json\n )\n end", "def new_token(token)\n puts(token.to_json)\n @api.post(\"#{Paths::TOKENS}\", :body => token)\n end", "def post(url, token, params, headers)\n puts \"post to #{url}\"\n uri = URI.parse(url)\n\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n\n req = Net::HTTP::Post.new(uri.path, headers)\n req['Authorization'] = \"token #{token}\" if token\n\n return http.request(req, params)\nend", "def token_url\n \"#{sk_url}/oauth/token\"\n end", "def bearer_token\n # Put the url together\n url = \"#{API_HOST}#{TOKEN_PATH}\"\n\n raise \"Please set your CLIENT_ID\" if CLIENT_ID.nil?\n raise \"Please set your CLIENT_SECRET\" if CLIENT_SECRET.nil?\n\n # Build our params hash\n params = {\n client_id: CLIENT_ID,\n client_secret: CLIENT_SECRET,\n grant_type: GRANT_TYPE\n }\n\n response = HTTP.post(url, params: params)\n parsed = response.parse\n\n \"#{parsed['token_type']} #{parsed['access_token']}\"\nend", "def set_access_token\n access_tokens.create(token: SecureRandom.urlsafe_base64(20))\n end", "def request_token\n request = { query: { code: ENV['GOOGL_CODE'], \n client_id: ENV['GOOGL_CLIENT_ID'], \n client_secret: ENV['GOOGL_CLIENT_SECRET'],\n redirect_uri: ENV['GOOGL_REDIRECT_URI'],\n grant_type: \"authorization_code\" } }\n\n result = self.class.post(\"/oauth2/v3/token\", request)\n\n result.parsed_response\n end", "def fetch_access_token\n client.unauthenticated_request(:POST, '/v1/security/oauth2/token',\n grant_type: 'client_credentials',\n client_id: client.client_id,\n client_secret: client.client_secret)\n end", "def post(body)\n url = @endpoint + token_path\n params = {\n :headers => {'Content-Type' => 'application/x-www-form-urlencoded', 'Accept' => 'application/json'},\n :url => url,\n :body => body\n }\n\n Connection.new(:post, params).fetch\n end", "def request_token\n url = \"#{root_url}/oauth/authenticate\"\n body = {\n username: IdentityConfig.store.usps_ipp_username,\n password: IdentityConfig.store.usps_ipp_password,\n grant_type: 'implicit',\n response_type: 'token',\n client_id: IdentityConfig.store.usps_ipp_client_id,\n scope: 'ivs.ippaas.apis',\n }\n\n faraday.post(url, body) do |req|\n req.options.context = { service_name: 'usps_token' }\n end.body\n end", "def call_token_api(params, clientId, clientSecret)\n return call_api(\"/api/auth/token\", {\n \"parameters\" => URI.encode_www_form(params),\n \"clientId\" => clientId,\n \"clientSecret\" => clientSecret\n })\nend", "def rack_oauth!(name)\n oauth_instance(name).get_access_token!(oauth_request_env)\n end", "def get_access_token_json\n HTTParty.post(get_request_access_token_url)\n end", "def create\n client.authorization_code = params[:code]\n access_token = client.access_token!\n puts access_token\n end", "def created_token(token)\n @token = token\n @access_token = token.oauth_access_token\n\n mail(to: @token.user.email, from: Settings.mailer.from)\n end", "def save_access_token(token, now)\n File.open('/opt/gluu-server/etc/certs/api_token.json', 'w') do |f|\n JSON.dump(\n {\n token: token,\n exp: now\n },\n f,\n )\n end\n end", "def create_request_token(params={})\n RequestToken.create :client_application => self, :callback_url=>self.token_callback_url\n end", "def post(xmldoc)\n headers = {'Content-Type' => 'text/xml'}\n check_response( @httpcli.post(@endpoint, xmldoc, headers) )\n end", "def oauth_app_access_token(client_id, client_secret)\n self.oauth_access_token(client_id, client_secret, :type => 'client_cred')\n end", "def auth2_request(url, data)\r\n byte_array = data.encode('UTF-8')\r\n headers = {\r\n 'Content-Type' => 'application/x-www-form-urlencoded',\r\n }\r\n response = connection.post(url, byte_array, headers)\r\n json_response = JSON.parse(response.body)\r\n json_to_oauth2request(json_response)\r\n end", "def request_token\n username = @credentials['username']\n password = @credentials['password']\n # app_name = @credentials['app_name']\n app_name = @credentials['app_name']\n vendor_name = @credentials['vendor_name']\n bus_num = @credentials['bus_num']\n scope = @credentials['scope']\n\n payload_hash = {\n 'grant_type' => 'password',\n 'username' => username,\n 'password' => password,\n 'scope' => scope\n }\n\n # The user name for inContact's API takes the form\n # app_api_name = \"#{app_name}\" + \"@\" + \"#{vendor_name}\" + \":\" + \"#{bus_num}\"\n api_app_name = \"#{app_name}\" + \"@\" + \"#{vendor_name}\"\n\n puts \"Authorizing... \\n\"\n\n # Specify token URL.\n url = URI('https://api.incontact.com/InContactAuthorizationServer/Token')\n # url = URI('https://api-c71.nice-incontact.com/InContactAuthorizationServer/Token')\n\n # Create connection object\n connection = Net::HTTP.new(url.host, url.port)\n # At *work*:\n # connection = Net::HTTP.new(url.host, url.port, 'asqproxy.vzbi.com', 80)\n # For *Fiddler*\n # connection = Net::HTTP.new(url.host, url.port, '127.0.0.1', 8888)\n\n connection.use_ssl = true\n # Uncomment the following line to tell Ruby to ignore invalid security certs.\n # connection.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n # Create post object\n post = Net::HTTP::Post.new(url)\n\n # OAuth 2 token requests are usually the 'user' + 'pass' base64 encoded\n post.basic_auth(api_app_name, bus_num)\n\n # get the POST post _fileheaders\n # post['Content-Type'] = 'audio/flac'\n post['Content-Type'] = 'application/json; charset=UTF-8'\n post['Accept'] = 'application/json'\n # \"Accept-Encoding\" => \"gzip, deflate, sdch, br\",\n post['Accept-Encoding'] = 'none'\n post['Connection'] = 'keep-alive'\n\n # Prepare the HTTP message body to be posted with the request.\n # Convert the payload_hash hash to a json string.\n payload = payload_hash.to_json\n # It will be the message body (payload) of the HTTP post.\n post.body = payload\n\n # Make the HTTP post request and store the response.\n # The 'begin' & 'rescue' is an aborted attempt to put\n # error/exception handling around the http post\n # *begin*\n # *rescue* StandardError\n # *end*\n response = connection.request(post)\n\n # http_status_code = response.code.to_i\n http_status_code = response.code.strip\n if http_status_code.chr != '2'\n # Show me http status code\n puts \"/n http_status_code: #{http_status_code}\"\n end\n\n if response.is_a?(Net::HTTPSuccess)\n puts \"response is a Net::HTTPSuccess object\"\n # if response is OK then parese it to a Ruby data structure\n access_token_hash = JSON.parse(response.body)\n # access_token = access_token_hash['access_token']\n end\n\n access_token_hash\n end", "def create_set_and_add_token\n token = SecureRandom.urlsafe_base64\n @user.token = token\n response.headers['X-AUTH-TOKEN'] = token\n end", "def create_access_token(id:, type: nil)\n params = {\n id: id,\n type: type\n }\n client.make_request('/create-access-token', 'post', params: params)\n end", "def get_user_tokens(code)\n request = Typhoeus::Request.new(\n TOKEN_ENDPOINT,\n method: :post,\n body: {\n 'grant_type' => \"authorization_code\",\n 'client_id' => ID,\n 'client_secret' => SECRET,\n 'code' => code\n },\n headers: {\n 'Api-Key' => ID\n })\n request.run\n end", "def createToken(opts = {})\n headers = opts\n if headers[:old_token]\n headers[:refresh_token] = headers[:old_token].refresh_token\n headers[:grant_type] = \"refresh_token\"\n headers.delete(:old_token)\n end\n\n default_headers = {\n :grant_type => @grant_type,\n :client_id => @client_id,\n :client_secret => @client_secret,\n :scope => @scope\n }\n\n headers = default_headers.merge(headers)\n\n response = RestClient.post \"#{@fqdn}#{@endpoint}\", headers\n json = JSON.parse(response)\n expiry = Time.now.to_i + json['expires_in'].to_i\n return OAuthToken.new(json['access_token'], expiry, json['refresh_token'])\n end", "def createToken(options = {}) # rubocop:disable Style/MethodName\n # Options inlclude: :RetUrl(String), :Username(String),\n # :Password(String), :Persist(Boolean)\n\n response = self.class.post('/', :body => self.class.build_XML_request('Auth.CreateToken', self, options))\n\n self.class.response_valid? response\n response['YourMembership_Response']['Auth.CreateToken']\n end", "def add_oauth(req)\n access_token = OAuth::AccessToken.new(@consumer,@auth[:token],@auth[:token_secret])\n @consumer.sign!(req,access_token)\n end", "def generate_request_token\n\n #FIXME change IP == \"#{IP}mob/twitter/generate_access_token\"\n request_token = TwitterAccount.twitter_consumer.get_request_token(:oauth_callback => \"http://localhost:3000/mob/twitter/generate_access_token\"\n )\n\n url = request_token.authorize_url\n redirect_to(url)\n end", "def create_request_token(params={})\n\t\tRequestToken.create :client_application => self, :callback_url=>self.token_callback_url\n\tend", "def generate_access_token\n @user = current_user\n begin \n request_token = OAuth::RequestToken.new(TwitterAccount.twitter_consumer,\n params[\"oauth_token\"], params[\"oauth_verifier\"])\n if @user.twitter_account\n @user.twitter_account.delete\n end\n t_account = @user.create_twitter_account(request_token)\n\n unless t_account.new_record?\n flash[:notice] = 'You are now connected to twitter $green'\n l = Log.new\n l.user_id_1 = @user.id\n name_1 = if @user.name.nil? then @user.email.split('@')[0] else @user.name end\n l.message = \"#{name_1.humanize} is now connected to twitter account\"\n l.loggingtype = 0\n l.save\n\n else \n flash[:notice] = 'Couldn\\'t connect to twitter $red'\n end \n redirect_to controller: 'users', action: 'connect_social_accounts'\n\n rescue \n flash[:notice] = 'Couldn\\'t connect to twitter $red'\n redirect_to controller: 'users', action: 'connect_social_accounts'\n end \n end", "def request_token\n consumer.get_request_token(:oauth_callback => Koprol.callback_url)\n end", "def post_request(uri, body, token)\n http = build_http(uri)\n request = Net::HTTP::Post.new(uri.request_uri, initheader = build_headers(token))\n request.body = body\n return http.request(request)\t\t\n end", "def prepare_access_token(oauth_token, oauth_token_secret)\n consumer = OAuth::Consumer.new(\"zuDJxQuK96WA2s0k0g3tqHr6r\", \"PhiNIibo53GYGhXgoWJ1UDBoKDVGqhaeCmTiSWCwz3VKucxfTD\",\n { :site => \"https://api.twitter.com\",\n :scheme => :header\n })\n # now create the access token object from passed values\n token_hash = { :oauth_token => oauth_token,\n :oauth_token_secret => oauth_token_secret\n }\n access_token = OAuth::AccessToken.from_hash(consumer, token_hash )\n \n RestClient.add_before_execution_proc do |req, params|\n access_token.sign! req\n end\n\n return access_token\nend", "def oauth_access_token\n session[:access_token]\n end", "def post(access_token, path, args={}, headers={})\n run :post, access_token, path, args, headers\n end", "def access_token\n end", "def runTokenRenewalPost\n msg = Thread.current.to_s\n renew = Stopwatch.new(msg)\n renew.start\n payload = \"grant_type=#{@grant_type}&scope=#{@scope}&client_id=#{@key}&client_secret=#{@secret}\"\n response = RestClient.post @token_server,\n payload,\n {\n :content_type => \"application/x-www-form-urlencoded\"\n }\n ensure\n # make sure to print the elapsed time for the renewal.\n renew.stop\n logger.info(\"WAPI: renew token post: stopwatch: \"+renew.pretty_summary)\n end", "def access_token\n OAuth::AccessToken.new(consumer, oauth_token, oauth_token_secret)\n end", "def list_access_tokens\n client.make_request('/list-access-tokens', 'post', params: {})\n end", "def token(client_id, client_secret, code, redirect_url, grant_type, options = {})\n body = options.has_key?(:body) ? options[:body] : {}\n body[:client_id] = client_id\n body[:client_secret] = client_secret\n body[:code] = code\n body[:redirect_url] = redirect_url\n body[:grant_type] = grant_type\n\n response = @client.post \"/auth/token\", body, options\n\n return response\n end", "def rest_token_endpoint; end", "def get_access_token(username, password)\n response = @oauth_connection.post do |req|\n req.url '/oauth/token', :grant_type => 'password', :client_id => api_key, :client_secret => api_secret, :username => username, :password => password\n end\n\n @oauth_token = OAuthToken.new(response.body)\n configure_oauth\n @oauth_token\n end", "def accept\n #Fetch the 'code' query parameter from the callback\n code = params[:code]\n state = params[:state]\n \n if !state.eql?(STATE)\n #Reject the request as it may be a result of CSRF\n else \n #Get token object, passing in the authorization code from the previous step\n token = client.auth_code.get_token(code, :redirect_uri => REDIRECT_URI)\n \n #save token to xml file\n File.open(TOKEN_FILE, 'w') do |file| \n file.write(token.token)\n end\n end\n end", "def remote_oauth_token\n token = client_application.client_credentials.get_token(:scope => SCOPE_FOR_A_SERVICE_TO_TALK_TO_AUTHORIZATOR_SERVICE)\n raise Response::Error::AccessToken.new(data:(token && token.params)) if (!token or token.token.empty?)\n token\n end", "def create\n @access_token = AccessToken.new(params[:access_token])\n\n respond_to do |format|\n if @access_token.save\n format.html { redirect_to @access_token, notice: 'Access token was successfully created.' }\n format.json { render json: @access_token, status: :created, location: @access_token }\n else\n format.html { render action: \"new\" }\n format.json { render json: @access_token.errors, status: :unprocessable_entity }\n end\n end\n end", "def oauth2_access_token\n belongs_to :client, :null => false\n\n string :token, :null => false\n string :scope\n datetime :expires_at\n end", "def request_token\n consumer.get_request_token(:oauth_callback => Etsy.callback_url)\n end", "def request_token\n consumer.get_request_token(:oauth_callback => Etsy.callback_url)\n end", "def create\n oauth_verifier = params[:oauth_verifier]\n\n if oauth_verifier\n request_token = session[:tumblr_request_token]\n access_token = request_token.get_access_token(\n :oauth_verifier => oauth_verifier) \n\n self.current_user.tumblr_access_token = access_token.token\n self.current_user.tumblr_access_token_secret = access_token.secret\n\n self.current_user.save!\n end\n\n rescue => ex\n handle_exception(ex)\n end", "def bearer_token\n # Put the url together\n url = \"#{API_HOST}#{TOKEN_PATH}\"\n\n # Build our params hash\n params = {\n client_id: @client_id,\n client_secret: @client_secret,\n grant_type: GRANT_TYPE\n }\n\n response = HTTP.post(url, params: params)\n parsed = response.parse\n\n \"#{parsed['token_type']} #{parsed['access_token']}\"\n end", "def request_wepay_access_token(code, redirect_uri)\n response = WEPAY.oauth2_token(code, redirect_uri)\n if response['error']\n raise \"Error - \"+ response['error_description']\n elsif !response['access_token']\n raise \"Error requesting access from WePay\"\n else\n self.wepay_access_token = response['access_token']\n self.save\n\n\t#create WePay account\n self.create_wepay_account\n end\nend", "def get_access_token()\n url = URI.parse(TOKEN_ENDPOINT)\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n req = Net::HTTP::Post.new(url.path)\n req.basic_auth(@clientId, @clientSecret)\n req.set_form_data({'grant_type' => 'client_credentials'})\n res = http.request(req)\n JSON.parse(res.body)['access_token']\n end", "def start_oauth\n @consumer = OAuth::Consumer.new('l9tUlXD0IOoGhC9HnDJBA', '9YZWGkxQJgieQ3Ta89mPE4xpXXhryEbRD9GS0WAt4',{:site=>\"http://twitter.com\" })\n @req_token = @consumer.get_request_token(:oauth_callback=>\"http://127.0.0.1:3000/a2\")\n Rails.logger.warn \"First Request #{@req_token.inspect}\"\n session[:request_token] = @req_token.token\n session[:request_token_secret] = @req_token.secret\n redirect_to @req_token.authorize_url\nend", "def create\n puts \"MESSAGE 14 IN CREATE\"\n @auth = request.env['omniauth.auth']['credentials']\n # The following statement saves the tokens to the database\n Token.create(\n access_token: @auth['token'],\n refresh_token: @auth['refresh_token'],\n expires_at: Time.at(@auth['expires_at']).to_datetime)\n end" ]
[ "0.6542739", "0.6441123", "0.63619876", "0.6182132", "0.6182132", "0.6179219", "0.6123826", "0.611147", "0.6108818", "0.5926301", "0.5889381", "0.5874254", "0.5844551", "0.5844551", "0.581556", "0.5786762", "0.5779585", "0.57456774", "0.57453525", "0.5706898", "0.56471556", "0.5621546", "0.56197256", "0.5610584", "0.5594471", "0.5593442", "0.55891484", "0.55829656", "0.556046", "0.5559639", "0.5553697", "0.5542766", "0.5507038", "0.5482973", "0.54813564", "0.5467214", "0.5456476", "0.54561555", "0.54531044", "0.5448939", "0.5448939", "0.54396", "0.5434547", "0.543163", "0.54312485", "0.54259837", "0.54259837", "0.5418661", "0.54165", "0.5408595", "0.54022723", "0.5401346", "0.53942686", "0.539024", "0.538328", "0.5377042", "0.537525", "0.5371173", "0.53564095", "0.53561217", "0.53519696", "0.53431994", "0.53425616", "0.5342302", "0.5341377", "0.5337073", "0.53355306", "0.53333294", "0.53205234", "0.53183395", "0.5310452", "0.530625", "0.5292928", "0.52890754", "0.5276395", "0.52753735", "0.5270952", "0.52684045", "0.5267769", "0.52652246", "0.5263192", "0.5255848", "0.5253359", "0.52522343", "0.5247357", "0.52442074", "0.52366984", "0.5231051", "0.5228166", "0.5225174", "0.52232283", "0.52225655", "0.5220208", "0.5220208", "0.5190106", "0.5186918", "0.51835275", "0.5179732", "0.5179644", "0.5178694" ]
0.6152711
6
PUT /oauth_tokens/1 PUT /oauth_tokens/1.xml
def update @oauth_token = OauthToken.find(params[:id]) respond_to do |format| if @oauth_token.update_attributes(params[:oauth_token]) format.html { redirect_to([:scaffold, @oauth_token], :notice => 'Oauth token was successfully updated.') } format.xml { head :ok } else format.html { render :action => "edit" } format.xml { render :xml => @oauth_token.errors, :status => :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exchange_oauth_tokens\n end", "def update_tokens(oauth_params)\n# binding.pry\n self.oauth_token = oauth_params.credentials.token\n # facebook, google provide this; twitter, linkedin don't\n self.oauth_expires_at = Time.at(oauth_params.credentials.expires_at) if oauth_params.credentials.expires_at\n # twitter\n self.oauth_secret = oauth_params.credentials.secret if oauth_params.credentials.secret\n end", "def refresh_oauth2_token!\n ensure_oauth2_token(true)\n save!\n end", "def update\n @access_token = AccessToken.find(params[:id])\n\n respond_to do |format|\n if @access_token.update_attributes(params[:access_token])\n format.html { redirect_to(@access_token, :notice => 'Access token was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @access_token.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_token\n params = {\n client_id: client_id,\n client_secret: client_secret,\n grant_type: 'refresh_token',\n refresh_token: refresh_token\n }\n request(:post, 'oauth2/token', params, true)\n end", "def refresh_single_use_oauth2_token!\n assign_single_use_oauth2_token\n save!\n end", "def update_token\n client.authorization.update_token!(oauth_data)\n if client.authorization.refresh_token && client.authorization.expired?\n client.authorization.fetch_access_token!\n end\n end", "def test_should_update_project_via_API_XML\r\n get \"/logout\"\r\n put \"/projects/1.xml\", :project => {:user_id => 1,\r\n :url => 'http://www.apiproject.com',\r\n :name => 'API Project',\r\n :description => 'API Project Desc' }\r\n assert_response 401\r\n end", "def test_should_update_invite_via_API_XML\r\n get \"/logout\"\r\n put \"/invites/1.xml\", :invite => {:message => 'API Invite 1',\r\n :accepted => false,\r\n :email => 'test@email.com',\r\n :user_id => 1 }\r\n assert_response 401\r\n end", "def add_oauth(req, consumer, atok, asec)\r\n access_token = OAuth::AccessToken.new(consumer, atok, asec)\r\n consumer.sign!(req, access_token)\r\nend", "def add_oauth(req)\n @consumer.sign!(req, @access_token)\nend", "def update_token\n\trequire 'date'\n\ttil = Time.at(settings.exp) - Time.now\n\tleft = (til/60).to_i\n\tp left\n\tif left < 5\n\t\tres = RestClient.post( \"https://auth.exacttargetapis.com/v1/requestToken\",\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t:clientId => settings.clientId,\n\t\t\t\t\t\t\t\t:clientSecret => settings.clientSecret,\n\t\t\t\t\t\t\t\t:refreshToken => settings.refreshToken,\n\t\t\t\t\t\t\t\t:accessType => \"offline\"\n\t\t\t\t\t\t\t })\n\t\t@res = JSON.parse(res)\n\t\tsettings.oauthToken = @res[\"accessToken\"]\n\t\tsettings.exp = Time.now + @res[\"expiresIn\"]\n\t\tsettings.refreshToken = @res[\"refreshToken\"]\n\tend\t\nend", "def update\n respond_to do |format|\n if @model.update(access_token_params)\n format.html { redirect_to @model, notice: 'Access token was successfully updated.' }\n format.json { render :show, status: :ok, location: @model }\n else\n format.html { render :edit }\n format.json { render json: @model.errors, status: :unprocessable_entity }\n end\n end\n end", "def test_put_expenses_1_xml\n @parameters = {:expense => {:description => 'NewDescription'}}\n if ActiveRecord::VERSION::MAJOR < 4\n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/expenses/1.xml',\n {:expense => {:description => 'NewDescription'}},\n {:success_code => :ok})\n end\n\n assert_no_difference('Expense.count') do\n put '/expenses/1.xml', @parameters, credentials('admin')\n end\n\n expense = Expense.find(1)\n assert_equal \"NewDescription\", expense.description\n end", "def update_oauth_application(token, name, redirect_uris, description = '', icon = nil)\n request(\n __method__,\n :put,\n \"#{api_base}/oauth2/applications\",\n { name: name, redirect_uris: redirect_uris, description: description, icon: icon }.to_json,\n Authorization: token,\n content_type: :json\n )\n end", "def update_oauth_application(token, name, redirect_uris, description = '', icon = nil)\n request(\n __method__,\n :put,\n \"#{api_base}/oauth2/applications\",\n { name: name, redirect_uris: redirect_uris, description: description, icon: icon }.to_json,\n Authorization: token,\n content_type: :json\n )\n end", "def exchange!(params={})\n\t\tOauthToken.transaction do\n\t\t\ttoken = Oauth2Token.create! user: user,client_application: client_application, scope: scope\n\t\t\tinvalidate!\n\t\t\ttoken\n\t\tend\n\tend", "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 @access_token = AccessToken.find(params[:id])\n\n respond_to do |format|\n if @access_token.update_attributes(params[:access_token])\n format.html { redirect_to @access_token, notice: 'Access token was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @access_token.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_token(data, token)\n base_url = flutterwave_object.base_url \n response = put_request(\"#{base_url}/tokens/#{token}\", data.to_json)\n return response\n end", "def put(path, data = {})\n self.class.put path, :body => data.merge(:u => access_token)\n end", "def save_access_token(token, now)\n File.open('/opt/gluu-server/etc/certs/api_token.json', 'w') do |f|\n JSON.dump(\n {\n token: token,\n exp: now\n },\n f,\n )\n end\n end", "def refresh_access_token\n self.expires_at = Time.now + 3600 \n save\n end", "def update\n @token = @user.tokens.find(params[:id])\n\n respond_to do |format|\n if @token.update_attributes(params[:token])\n format.html { redirect_to [@user,@token], notice: 'Token was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @token.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @id_token = args[:id_token] if args.key?(:id_token)\n @provider_id = args[:provider_id] if args.key?(:provider_id)\n @redirect_uri = args[:redirect_uri] if args.key?(:redirect_uri)\n @tenant_id = args[:tenant_id] if args.key?(:tenant_id)\n @token = args[:token] if args.key?(:token)\n @token_type = args[:token_type] if args.key?(:token_type)\n end", "def update_access_token\n response = fetch_access_token\n store_access_token(response.result)\n end", "def set_OAuthTokenSecret(value)\n set_input(\"OAuthTokenSecret\", value)\n end", "def set_OAuthTokenSecret(value)\n set_input(\"OAuthTokenSecret\", value)\n end", "def put(url, params)\n params = convert_hash_keys(params)\n @access_token = params.delete('access_token') if params['access_token']\n return connection.put(url, params)\n end", "def update_spotify_tokens\n tokens = SpotifyApi.refresh_tokens(spotify_refresh_token)\n\n if tokens\n self.spotify_access_token = tokens['access_token']\n self.spotify_refresh_token = tokens['refresh_token']\n save\n end\n end", "def test_put_invoices_1_xml\n @parameters = {:invoice => {:number => 'NewNumber'}}\n \n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/invoices/1.xml',\n {:invoice => {:number => 'NewNumber'}},\n {:success_code => :ok})\n \n assert_no_difference('Invoice.count') do\n put '/invoices/1.xml', @parameters, credentials('admin')\n end\n \n invoice = Invoice.find(1)\n assert_equal \"NewNumber\", invoice.number\n \n end", "def put(path, args={})\n inject_token_auth_headers!(args)\n response = self.class.put(request_url(path), args)\n update_token_auth_headers(response)\n return response\n end", "def create\n @oauth_token = OauthToken.new(params[:oauth_token])\n\n respond_to do |format|\n if @oauth_token.save\n format.html { redirect_to([:scaffold, @oauth_token], :notice => 'Oauth token was successfully created.') }\n format.xml { render :xml => @oauth_token, :status => :created, :location => @oauth_token }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @oauth_token.errors, :status => :unprocessable_entity }\n end\n end\n end", "def refresh_access_token\n\t\t\t\trequire \"open-uri\"\n\t\t\t\trequire \"net/http\"\n\t\t\t\trequire \"openssl\"\n\t\t\t\trequire \"base64\"\n\n\t\t\t\turi = URI.parse(\"#{self.add_on.jive_url}/oauth2/token\")\n\t\t\t\thttp = Net::HTTP.new(uri.host, uri.port)\n\t\t\t\thttp.use_ssl = true\n\n\t\t\t\trequest = Net::HTTP::Post.new(uri.request_uri)\n\t\t\t\trequest.basic_auth self.add_on.client_id, self.add_on.client_secret\n\t\t\t\trequest.set_form_data({\n\t\t\t\t\t\"refresh_token\" => \"#{self.refresh_token}\",\n\t\t\t\t\t\"grant_type\" => \"refresh_token\",\n\t\t\t\t})\n\n\t\t\t\tresponse = http.request(request)\n\t\t\t\tjson_body = JSON.parse(response.body)\n\n\t\t\t\tif (response.code.to_i != 200)\n\t\t\t\t\traise RuntimeError, json_body[\"error\"].to_s.upcase\n\t\t\t\tend\n\n\t\t\t\tself.access_token = json_body[\"access_token\"]\n\t\t\t\tself.expires_in = json_body[\"expires_in\"]\n\t\t\t\tself.expires_at = json_body[\"expires_in\"].to_i.seconds.from_now\n\t\t\t\tself.save\n\t\t\tend", "def updateapnstoken\n @user = User.find_by_authentication_token(params[:auth_token])\n uph = {apns_device_token: params[:apns_token]}\n respond_to do |format|\n if @user.update_attributes(uph)\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!(**args)\n @access_token = args[:access_token] if args.key?(:access_token)\n @expires_in = args[:expires_in] if args.key?(:expires_in)\n @scope = args[:scope] if args.key?(:scope)\n @token_type = args[:token_type] if args.key?(:token_type)\n end", "def new\n @oauth_token = OauthToken.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @oauth_token }\n end\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end", "def set_AccessToken(value)\n set_input(\"AccessToken\", value)\n end" ]
[ "0.65999633", "0.6258865", "0.6148939", "0.59960383", "0.5980706", "0.58664656", "0.57274854", "0.57202005", "0.56818384", "0.5681778", "0.5681412", "0.56549394", "0.5645008", "0.56274855", "0.55983543", "0.55884033", "0.55884033", "0.5565079", "0.5562939", "0.5548942", "0.5530658", "0.5508895", "0.5498223", "0.5467904", "0.54447734", "0.5420211", "0.54030085", "0.54002625", "0.5399987", "0.539241", "0.5391733", "0.53861153", "0.5377745", "0.5363669", "0.5327114", "0.5326279", "0.5308625", "0.5305839", "0.53017664", "0.53017664", "0.53017664", "0.53017664", "0.53017664", "0.53017664", "0.53017664", "0.53017664", "0.53017664", "0.53017664", "0.53017664", "0.53017664", "0.53017664", "0.53017664", "0.53017664", "0.53017664", "0.5301659", "0.5301659", "0.5301659", "0.5301659", "0.5301659", "0.5301659", "0.5301659", "0.5301659", "0.5301659", "0.5301659", "0.5301659", "0.5301659", "0.5301659", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164", "0.5301164" ]
0.64856654
1
DELETE /oauth_tokens/1 DELETE /oauth_tokens/1.xml
def destroy @oauth_token = OauthToken.find(params[:id]) @oauth_token.destroy respond_to do |format| format.html { redirect_to(scaffold_oauth_tokens_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @access_token = AccessToken.find(params[:id])\n @access_token.destroy\n\n respond_to do |format|\n format.html { redirect_to(access_tokens_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @oauth_remote_access_token = OauthRemoteAccessToken.find(params[:id])\n @oauth_remote_access_token.destroy\n\n respond_to do |format|\n format.html { redirect_to(oauth_remote_access_tokens_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n delete(\"/2.0/oauth_providers/#@consumer_key\")['success']\n end", "def destroy\n @access_token = AccessToken.find(params[:id])\n @access_token.destroy\n\n respond_to do |format|\n format.html { redirect_to access_tokens_url }\n format.json { head :no_content }\n end\n end", "def delete_access_token(id:)\n client.make_request('/delete-access-token', 'post', params: {id: id})\n end", "def destroy\n @oauth_client = OauthClient.find(params[:id])\n @oauth_client.destroy\n\n respond_to do |format|\n format.html { redirect_to oauth_clients_url }\n format.json { head :no_content }\n format.xml { head :no_content }\n end\n end", "def revoke\n oauth_access_token.revoke\n head :ok\n end", "def revoke_oauth_token\n current_user.revoke_token\n end", "def destroy\n @api_token = ApiToken.find(params[:id])\n \n @api_token.destroy unless @api_token.user_id != current_user.id\n\n respond_to do |format|\n format.html { redirect_to(api_tokens_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @model.destroy\n respond_to do |format|\n format.html { redirect_to access_tokens_url, notice: 'Access token was successfully destroyed.' }\n format.json { head :no_content }\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 @token = @user.tokens.find(params[:id])\n @user.tokens.delete(@token)\n @user.save\n\n respond_to do |format|\n format.html { redirect_to user_tokens_url }\n format.json { head :no_content }\n end\n end", "def delete(path, data = {})\n self.class.delete path, :body => data.merge(:u => access_token)\n end", "def delete(url, params)\n params = convert_hash_keys(params)\n @access_token = params.delete('access_token') if params['access_token']\n return connection.delete(url)\n end", "def destroy\n result = access_token.delete(\"/api/v1/emails/#{params[:id]}\")\n display_api_response( result )\n respond_with(\"\",:location => :back)\n end", "def destroy\n @token.destroy\n\n head :no_content\n end", "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end", "def destroy\n # Delete the user access tokens on logout\n User.find(session[:user_id]).delete\n # Delete the session as well\n session = {}\n \n redirect_to root_path\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 @facebook_token.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @oauth_remote_service_provider = OauthRemoteServiceProvider.find(params[:id])\n @oauth_remote_service_provider.destroy\n\n respond_to do |format|\n format.html { redirect_to(oauth_remote_service_providers_url) }\n format.xml { head :ok }\n end\n end", "def delete_access_token(access_token_id)\n @redis.del(auth_domain_key(access_token_id))\n end", "def destroy\n @oauth_account.destroy\n respond_to do |format|\n format.html { redirect_to oauth_accounts_url, notice: 'Oauth account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def teardown\n client.item.remove(access_token) if access_token\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 delete\n request('delete').auth_required!\n end", "def destroy_current_access_token\n AccessToken.find(current_access_token_id).destroy\n end", "def tenant_delete(tenant_id)\n\t\n\t\tdelete_call = Curl::Easy.http_delete(\"#{@ip_address}:#{@port_2}/v2.0/tenants/#{tenant_id}\"\n\t\t) do |curl|\n\t\t\tcurl.headers['x-auth-token'] = @token\n\t\t\tcurl.headers['userId'] = tenant_id\n\t\t end\n\t\t\n\t\tputs \"invoked tenant delete\"\n\tend", "def delete operation, *args\n request(args) do |attrs, headers|\n @oauth_access_token.send(:delete, \"/#{API_VERSION}/#{operation}.#{API_FORMAT}\", headers)\n end\n end", "def nuke_auth_token\n\t\t\tfile = get_access_token_file\n\t\t\t@logger.info \"Removing persisted access token: #{file}\"\n\t\t\tFile.delete file\n\t\t\tset_access_token(nil)\n\t\t\tset_auth_header ''\n\t\tend", "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 @token = Token.find(params[:id])\n @token.destroy\n\n head :no_content\n end", "def destroy\n\n api_key = ApiKey.where(access_token: token).first\n\n api_key.access_token = ''\n api_key.expires_at = Time.now\n\n if api_key.save\n render json: {}, status: 200\n else\n render json: {}, status: 422\n end\n end", "def destroy\n @api_key.destroy\n\n respond_to do |format|\n format.html { redirect_to(api_keys_url) }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end", "def delete\n user = getUserByAuthToken(request)\n user.soft_delete\n head :no_content\n end", "def destroy\n @token = Token.find(params[:id])\n @token.destroy\n \n respond_to do |format|\n format.html { redirect_to tokens_url }\n format.json { head :ok }\n end\n end", "def delete\n api_client.delete(url)\n end", "def delete\n execute_request('DELETE') do |uri, headers|\n HTTP.http_client.delete(uri, header: headers)\n end\n end", "def destroy\n @tm_dev1 = TmDev1.find(params[:id])\n @tm_dev1.destroy\n\n respond_to do |format|\n format.html { redirect_to(tm_dev1s_url) }\n format.xml { head :ok }\n end\n end", "def delete\n request(:delete)\n end", "def destroy \n Services::OpenIdConnectionService.new(@app).destroy \n\n @app.destroy\n respond_to do |format|\n format.html { redirect_to apps_url, notice: 'App was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_token(token = nil)\n token = token || settings.token\n delete \"authToken/#{token.to_s}\"\n end", "def delete_apn_token\n if params[:id] == current_user.id.to_s\n # A user can delete tokens for themself\n @user = current_user\n return render_error(500, \"must specify a token to remove\") unless token = params.delete(:token)\n\n # remove the token from the user's collection\n @user.pull(:bh => token)\n\n @status = 200\n else\n @status = 401\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def delete_access_token(account_number, token)\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 << '/accounts/{account_number}/access-tokens/{token}'\r\n\r\n # process optional query parameters\r\n query_builder = APIHelper.append_url_with_template_parameters query_builder, {\r\n 'account_number' => account_number,\r\n 'token' => token\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' => 'APIMATIC 2.0',\r\n 'X-Auth-Token' => Configuration.x_auth_token\r\n }\r\n\r\n # invoke the API call request to fetch the response\r\n response = Unirest.delete query_url, headers: headers\r\n\r\n # Error handling using HTTP status codes\r\n if response.code == 401\r\n raise APIException.new 'You are not authenticated', 401, response.raw_body\r\n elsif response.code == 403\r\n raise APIException.new 'This action needs a valid WSSE header', 403, response.raw_body\r\n elsif response.code == 404\r\n raise APIException.new 'Resource not found', 404, response.raw_body\r\n elsif response.code == 400\r\n raise APIException.new 'Http bad request', 400, 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 destroy\n @user=User.where(:authentication_token=>params[:api_key]).first\n @user.reset_authentication_token!\n render :json => { :message => [\"Session deleted.\"] }, :success => true, :status => :ok\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 @globus_token.destroy\n\n respond_to do |format|\n format.html { redirect_to globus_tokens_url, notice: \"Globus token was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @app_config = AppConfig.find(params[:id])\n @app_config.destroy\n\n respond_to do |format|\n format.html { redirect_to(app_configs_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @token.destroy\n respond_to do |format|\n format.html { redirect_to admin_tokens_url, notice: 'Token was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete(path, params={}, args={})\n inject_token_auth_headers!(args)\n response = self.class.delete(request_url(path, params), args)\n update_token_auth_headers(response)\n return response\n end", "def remove_oauth_credentials\n self.oauth_token = nil\n self.oauth_secret = nil\n self.oauth_expires_at = nil\n end", "def delete\n url = prefix + \"delete\"\n return response(url)\n end", "def delete\n url = prefix + \"delete\"\n return response(url)\n end", "def delete\n token = existing_payload[:token]\n\n checkin_params = { token: token, return_to: cdl_checkin_success_iiif_auth_api_url(params[:id]) }\n redirect_to \"#{Settings.cdl.url}/checkin?#{checkin_params.to_param}\"\n end", "def destroy\n @identity = Identity.find(params[:id])\n @identity.destroy\n\n respond_to do |format|\n format.html { redirect_to(identities_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @apn_token.destroy\n respond_to do |format|\n format.html { redirect_to apn_tokens_url, notice: 'Apn token was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete(url, headers)\n conn = create_connection_object(url)\n\n http = conn.delete(:head => add_authorization_to_header(headers, @auth))\n\n action = proc do\n response = Response.new(http.response.parsed, http)#.response.raw)\n yield response if block_given?\n end\n\n http.callback &action\n http.errback &action \n end", "def deletebookmark\n\t\t\t\tbookmark = Bookmark.find_by_id(params[:id])\n\t\t\t\tif bookmark.user_id == doorkeeper_token.resource_owner_id\n\t\t\t\t\tbookmark.destroy\n\t\t\t\t\thead :ok\n\t\t\t\telse\n\t\t\t\t\trender :status => 504\n\t\t\t\tend\n\t\t\tend", "def destroy\n @bb_auth_user = BbAuthUser.find(params[:id])\n @bb_auth_user.destroy\n\n respond_to do |format|\n format.html { redirect_to(bb_auth_users_url) }\n format.xml { head :ok }\n end\n end", "def delete_token(token)\n delete token_path(token)\n end", "def destroy\n current_user.remove_token\n render json: { status: :success, data: 'Successfully signed out' }\n end", "def delete\n client.delete(url)\n @deleted = true\nend", "def destroy\n @identity.destroy\n\n head :no_content\n end", "def disconnect_oauth\n return unless !id_changed? && encrypted_password_changed? && oauth_user?\n authentications.destroy_all\n end", "def destroy\n @adword_auth.destroy\n respond_to do |format|\n format.html { redirect_to adword_auths_url }\n format.json { head :no_content }\n end\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def clear_expired_tokens\n access_tokens.where(\"token_expire < ?\", Time.now).destroy_all\n end", "def clear_expired_tokens\n access_tokens.where(\"token_expire < ?\", Time.now).destroy_all\n end", "def destroy\r\n @secret = Secret.find(params[:id])\r\n @secret.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(:action => 'index') }\r\n format.xml { head :ok }\r\n end\r\n end", "def delete_account\n @connection.request({\n :method => 'DELETE'\n }) \n end", "def delete()\n @client.make_request(:delete, @client.concat_user_path(\"#{DOMAIN_PATH}/#{domain_id}/endpoints/#{id}\"))[0]\n end", "def destroy\n\t\tcookies.delete(:auth_token)\n\t\tredirect_to root_url\n\tend", "def delete(url)\n setup_or_refresh_rest_session\n @session.delete(url: url)\n end", "def delete_existing_access_token_if_exists\n if existing_token = OauthRemoteAccessToken.find(:first, :conditions => ['oauth_remote_service_provider_id = ? AND user_id = ?',\n self.oauth_remote_service_provider_id, \n self.user_id])\n existing_token.destroy\n end\n return true\n end", "def delete\n delete_from_server single_url\n end", "def destroy\n @user_token = UserToken.find(params[:id])\n @user_token.destroy\n\n respond_to do |format|\n format.html { redirect_to user_tokens_url }\n format.json { head :ok }\n end\n end", "def delete_workset (token, workset_name)\n Rails.logger.debug \"delete_workset #{workset_name}\"\n\n url = URI.parse(\"#{APP_CONFIG['registry_url']}/worksets/#{workset_name}\")\n http = Net::HTTP.new(url.host, url.port)\n if Rails.env.development?\n http.set_debug_output($stdout)\n end\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Delete.new(url.request_uri)\n request.add_field(\"Authorization\", \"Bearer #{token}\")\n request.add_field(\"Accept\", \"application/vnd.htrc-workset+xml\")\n response = http.request(request)\n\n case response\n when Net::HTTPUnauthorized then\n raise Exceptions::SessionExpiredError.new(\"Session expired. Please login again\")\n when Net::HTTPSuccess then\n # Do nothing\n else\n raise Exceptions::SystemError.new(\"Error deleting workset (HTTP #{response.code})\")\n end\n\n end", "def destroy\n unless User.admin_by_token?(request.cookies[\"token\"])\n render json: { error: \"invalid_token\" }, status: :unauthorized\n return\n end\n\n @resource.destroy\n head :no_content\n end", "def destroy\n @big_auth_user = BigAuth::User.find(params[:id])\n @big_auth_user.destroy\n\n respond_to do |format|\n format.html { redirect_to(big_auth_users_url) }\n format.xml { head :ok }\n end\n end", "def destroy_omniauth\n organization = Maestrano::Connector::Rails::Organization.find_by_id(params[:organization_id])\n if organization && is_admin?(current_user, organization)\n organization.oauth_uid = nil\n organization.oauth_token = nil\n organization.refresh_token = nil\n organization.sync_enabled = false\n organization.save\n end\n\n redirect_to root_url\n end", "def destroy\n # invalidate the token\n client.logout\n\n # client is not valid anymore\n @client = nil\n\n # reset client for records\n Confluence::Record.client = nil\n end", "def delete\n Iterable.request(conf, base_path).delete\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def logout\n auth_token = get_connection_object.headers['X-Auth-Token']\n raise \"Can't find any authorization token to logout.\" unless auth_token\n @response = delete(\"/auth/#{auth_token}\")\n if @response.has_key?(\"success\") and @response['success']\n get_connection_object.headers.delete(\"X-Auth-Token\")\n end\n @response\n end", "def logout\n response = @session.delete\n @auth_token = nil\n @rest.default_headers = { 'Content-Type' => 'application/json' }\n response\n end", "def delete\n url = prefix + \"delete\"\n return response(url)\n end", "def delete\n url = prefix + \"delete\"\n return response(url)\n end", "def revoke\n @token = current_user.tokens.where(token: params[:token]).first!\n @token.invalidate!\n\n respond_with(@token) do |format|\n format.html { redirect_to([:client_applications], notice: \"You've revoked the authorization for the application '#{@token.client_application.name}'.\") }\n end\n end", "def destroy\n @identity.destroy\n respond_to do |format|\n format.html { redirect_to identities_url }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete_access_key(resource_options)\n nil\n end", "def delete endpoint\n do_request :delete, endpoint\n end", "def delete\n client.delete(url)\n @deleted = true\n end", "def destroy\n conf.delete 'api'\n end", "def destroy\n @authentication = current_user.authentications.find(params[:id])\n @authentication.destroy\n\n respond_to do |format|\n format.html { redirect_to(authentications_url) }\n format.xml { head :ok }\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 head :unauthorized\n end" ]
[ "0.71823555", "0.70962703", "0.6857149", "0.68087286", "0.66814786", "0.6642044", "0.65404487", "0.6453824", "0.6433901", "0.6418886", "0.6412061", "0.64109045", "0.6392825", "0.63533264", "0.62944674", "0.6272732", "0.6258594", "0.62504417", "0.6247066", "0.6230055", "0.6218287", "0.619444", "0.61289895", "0.61129653", "0.611081", "0.611081", "0.611081", "0.611081", "0.60899055", "0.6077595", "0.60684925", "0.60671574", "0.6034392", "0.6032228", "0.6030495", "0.6020093", "0.6016062", "0.60046613", "0.60019004", "0.59948045", "0.5990846", "0.598898", "0.59873676", "0.59778136", "0.5974973", "0.5932132", "0.5931614", "0.59312874", "0.592146", "0.5907436", "0.5905384", "0.59023595", "0.58924466", "0.5886049", "0.5883819", "0.58804476", "0.58804476", "0.58802116", "0.5875305", "0.5874823", "0.58724", "0.5870835", "0.5869679", "0.58617383", "0.5861111", "0.585668", "0.5855003", "0.5834119", "0.5821624", "0.58200395", "0.58097005", "0.58097005", "0.5794965", "0.5794726", "0.57930684", "0.5792228", "0.57909095", "0.5778196", "0.5775108", "0.5771884", "0.5766923", "0.5764915", "0.5761222", "0.57554", "0.57457495", "0.5741271", "0.5738234", "0.57352597", "0.57342315", "0.57340956", "0.57340956", "0.5728763", "0.57251525", "0.57165945", "0.5715264", "0.5710345", "0.5705308", "0.5698556", "0.56950384", "0.5694289" ]
0.74273103
0
pennies caculation is off in either direction in the 15th or 16th decimal place. I thought there were supposed to be no decimal places with %. round fixed the problem, but shouldn't be necessary
def tell_change(change) puts "You will need to give the customer" if change[:dollars] !=0 puts "#{change[:dollars]} dollars" else puts "" end if change[:quarters] != 0 puts "#{change[:quarters]} quarters" else puts "" end if change[:dimes] != 0 puts "#{change[:dimes]} dimes" else puts "" end if change[:nickels] != 0 puts "#{change[:nickels]} nickels" else puts "" end if change[:pennies] != 0 puts "#{change[:pennies]} pennies" else puts "" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def round_to_nearest_cash_value; end", "def kw_per_ton_to_cop(kw_per_ton)\n \n return 3.517/kw_per_ton\n \nend", "def round_off_percentage_px_increase\n (@percentage_px_increase*100).round\n end", "def cop_to_kw_per_ton(cop)\n \n return 3.517/cop\n \nend", "def round() end", "def irgrasassaturadas\n vag=(cgrasassa * 100) / 70\n vag.round(2)\n end", "def round; self.dup.round!; end", "def solve(meal_cost, tip_percent, tax_percent)\n\n result = meal_cost * (1 + tip_percent.to_f / 100 + tax_percent.to_f / 100)\n puts result.round()\n \nend", "def percent_correct\n # Check for divide by zero. Than calculate the percentage otherwise.\n if @turns.size == 0\n 0.0\n else\n # Calculate percentage, truncate value to one decimal place.\n ((number_correct.to_f / @turns.size.to_f) * 100.0).truncate(1)\n end\n end", "def irpolialcoholesp\n vag=(valorpolialcoholesp * 100) / 90\n vag.round(2)\n end", "def percent_ptn(kcal)\n (kcal * 100 / tee(kcal)).round(2)\n end", "def solve(meal_cost, tip_percent, tax_percent)\n puts (meal_cost+(meal_cost*tip_percent/100)+(meal_cost*tax_percent/100)).round\nend", "def irhidratos\n vag=(hcarbono * 100) / 260\n vag.round(2)\n end", "def solve(meal_cost, tip_percent, tax_percent)\r\n puts (meal_cost + meal_cost*tip_percent/100 + meal_cost*tax_percent/100).round\r\nend", "def round\n self.dup.round!\n end", "def solution(value)\n # enter your solution here\n value.round(2)\nend", "def valorenergeticoKcalp\n\t\tvag=(valorenergeticoKcal * 70) / 100\n\t\tvag.round(2)\n\tend", "def irpoliinsaturadas\n vag=(grasaspoli * 100) / 70\n vag.round(2)\n end", "def dround(x)\r\n ((1000.0*x).round/1000.0).to_f\r\nend", "def solution(value)\n value.round(2)\nend", "def c2f(c)\n (c*9.0/5+32).to_f.round(2)\nend", "def solve(meal_cost, tip_percent, tax_percent)\n total = meal_cost + (meal_cost * tip_percent)/100 + (meal_cost * tax_percent)/100\n puts total.round() \nend", "def ToDonate (pay_amount)\n\tdecimal = pay_amount.modulo(1).round(2)\n\tif decimal < 0.50\n\t\tto_donate = 0.50-decimal\n\telsif decimal < 1.00\n\t\tto_donate = 1.00 - decimal\n\telse \n\t\tto_donate = 0;\n\tend\n\tto_donate = (to_donate).round(2)\nend", "def format_pct_value(ror)\n (ror * 100).round(1)\n end", "def decimal_places; end", "def round\n end", "def rounding_method; end", "def valorpolialcoholesp\n\t\tvag=(polialcoholes * 70) / 100\n vag.round(2)\n\tend", "def valorenergeticoKJp\n\t\tvag=(valorenergeticoKJ * 70) / 100\n\t\tvag.round(2)\n\tend", "def irgrasas\n vag=(cgrasas * 100) / 70\n vag.round(2)\n end", "def price_adjustment \n price_adjustment_fixed / 100.0 \n end", "def cents_deviation ratio\n unaltered = cents_of_unaltered ratio\n deviation = (ratio.cents % 1200) - unaltered\n\n # Account for extreme displacements, such as cDs\n if unaltered == 0.0 && deviation > 600.0\n deviation -= 1200.0\n end\n\n if deviation < 0\n \"#{deviation.round}\"\n else\n \"+#{deviation.round}\"\n end\n end", "def cigaret_price\n 0.30\n end", "def eround(decimal_points = 0)\n (\"%.#{decimal_points}e\" % self).to_f\n end", "def irpolialcoholes\n vag=(polialcoholes * 100) / 90\n vag.round(2)\n end", "def cut_factor\r\n return 0.0\r\n end", "def horizontal_brighting_correction_factor\n adjusted_global_horizontal_irradiance = @global_horizontal_irradiance < SMALL_VALUE_FOR_SKY_DIFFUSE_IRRADIANCE ? SMALL_VALUE_FOR_SKY_DIFFUSE_IRRADIANCE : @global_horizontal_irradiance\n # In PVLIB_MatLab as well as PVLIB_Python, there is a following adjustment. \n # However, all the negative numbers are already converted to SMALL_VALUE_FOR_SKY_DIFFUSE_IRRADIANCE in the above statement, \n # the following statement doesn't do anything. \n # I'm just writing it to remind that it is there in PVLIB_MatLab and PVLIB_Python. \n # adjusted_global_horizontal_irradiance = @global_horizontal_irradiance < BigDecimal('0') ? BigDecimal('0') : @global_horizontal_irradiance\n bigdecimal_sqrt(horizontal_beam_irradiance / adjusted_global_horizontal_irradiance)\n end", "def ir_hidratos \n\t\t@hidratos_ir = hidratos\n\t\t@ir_hidratos = (@hidratos_ir/260.to_f)*100\n\t\t@ir_hidratos.round(1)\n\tend", "def fahr_freezing_temp\n puts (32 - 32) * 0.5556#.round\nend", "def por_carbo\n\t\t\t(@carbohidratos/suma_gramos)*100\n\t\tend", "def ir_azucares \n\t\t@ir_azucares = (@azucares/90.to_f)*100\n\t\t@ir_azucares.round(1)\n\tend", "def valormonograsasp\n\t\tvag=(grasasmono * 70) / 100\n vag.round(2)\n\tend", "def res_ptn(kcal)\n (tee(kcal) * 0.15).round(2)\n end", "def three_pt_pct\n return 0.0 if three_p.zero? || three_p_a.zero? \n\n (three_p.to_f/three_p_a).round(3)\n end", "def conversion_precision; end", "def por_carbohidratos\n \taux_carbohidratos = 0.0\n\t\ti = 1\n\t \twhile i < @lista_alimentos.size do\n\t\t\taux_carbohidratos += @lista_alimentos[i].carbohidratos * @lista_cantidades[i]\n\t\t\ti+=1\n\t\tend\n\t\treturn ((aux_carbohidratos/total_nutrientes)*100.0).round(2)\n\tend", "def covered_percent\n # Make sure that weird rounding error from #15, #23 and #24 does not occur again!\n total_lines.zero? ? 0 : 100.0 * covered_lines / total_lines\n end", "def irpoliinsaturadasp\n vag=(valorgrasaspolip * 100) / 70\n vag.round(2)\n end", "def irazucaresp\n vag=(valorazucaresp * 100) / 90\n vag.round(2)\n end", "def gross_single\n gross_single_base.round(2)\n end", "def fixed_charges\n 20.0\n end", "def valoralmidonp\n\t\tvag=(almidon * 70) / 100\n vag.round(2)\n\tend", "def value_round(resolution,value)\n y=1\n resolution.times {|n| y=y*10}\n if resolution == 0\n value = (value.round)/y\n else\n value = (value.round)/(y*1.0)\n end\nend", "def irhidratosp\n vag=(valorhidratosp * 100) / 260\n vag.round(2)\n end", "def obp \n\t\t# prevent divide by zero\n\t\tif (self[:at_bats] != 0)\t\t\n\t\t\t((self[:hits] + self[:walks] + self[:hit_by_pitch])/(self[:at_bats] + self[:walks] + self[:hit_by_pitch] + self[:sacrifice_flies].to_f)).round(3)\n\t\telse\n\t\t\t0\n\t\tend\n\tend", "def deviating_rounding_amount\n self.EventLog.lines.last[/avvik: \\d\\.\\d\\d/][/\\d.\\d\\d/].to_f\n rescue\n 0\n end", "def decimal\n @decimal ||= implied_probability.decimal\n end", "def decimal\n @decimal ||= implied_probability.decimal\n end", "def mround(zeroes = false)\n if !zeroes\n y = self.round(2)\n y.modulo(1) == 0 ? y.to_i.to_s : '%.2f' % y\n else\n '%.2f' % self\n end\n end", "def formatted_covered_percent\n covered_percent.round(2)\n end", "def display_pct()\n\t sprintf('%0.3f', self.pct())\n\tend", "def calc_upg_gigjoules_ch4 (val1 = 0.03778, val2 = calc_upg_ch4)\n\t\t(val1 * val2).round 2 \n\tend", "def chp_potential_elec(val1 = total_mwh_ch4, val2 = 0.3)\n\t\t(val1 * val2).round 2\n\tend", "def cost_in_dollars\n self.cost / 100.to_f\n end", "def round_prec(digits)\n #This is a stub, used for indexing\n end", "def two_pt_pct\n return 0.0 if two_pt.zero? || two_pt_a.zero?\n\n (two_pt.to_f/two_pt_a).round(3)\n end", "def irproteinas\n vag=(proteinas * 100) / 50\n vag.round(2)\n end", "def irproteinasp\n vag=(valorproteinasp * 100) / 50\n vag.round(2)\n end", "def ir_grasa_saturada \n\t\t@ir_grasa_saturada = (@saturadas/20.to_f)*100\n\t\t@ir_grasa_saturada.round(1)\n\tend", "def decimals; num_dec; 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 roundcent(amount)\n return ((amount * 100).round)/100\n end", "def default_rate_in_pounds\n default_rate_pence / 100\n end", "def percent_val\n dollar_amt ? ((dollar_amt / Contract.sum(:dollar_amt)) * 100) : nil\n end", "def covered_percent; end", "def covered_percent; end", "def final_rate_adjustment rate\n (rate/100.0).ceil - 0.01\n end", "def irmonograsas\n vag=(grasasmono * 100) / 70\n vag.round(2)\n end", "def net_total\n net_total_base.round(2)\n end", "def round(degrees_F = 68, exponent = 2) \r\n ((convert degrees_F) * 10.0 ** exponent).round / 10.0 ** exponent\r\n# convert degrees_F.round(exponent) \r\nend", "def ir_proteina\n @ir_proteina = (@proteinas/50.to_f)*100\n @ir_proteina.round(1)\n end", "def fix_invoice_rounding_amount\n invoice.RoundingAmount -= deviating_rounding_amount\n invoice\n end", "def calc_potential_cars_fueled(val1= calc_upg_ch4, val2= 1035)\n\t\t(val1 / val2).round 1\n\tend", "def round_float(float, places); end", "def to_pennies(dec)\n pennies = (dec * 100).to_int\n return pennies\n end", "def percentage\n 0.0\n end", "def irazucares\n vag=(azucares * 100) / 90\n vag.round(2)\n end", "def value\n (\n 0.7 * (annual_income / average_income) +\n 0.3 * (base_manpower / avearge_manpower)\n ).round(6)\n end", "def percent_of_goal_raised\n ( ( 100.0 * self.funds_raised ) / self.fundraising_goal ).round\n end", "def iralmidonp\n vag=(valoralmidonp * 100) / 90\n vag.round(2)\n end", "def cents; end", "def calc_potential_wtruck_fueled(val1= calc_upg_ch4, val2= 35750)\n\t\t(val1 / val2).round 1\n\tend", "def calc_upg_mwh_ch4(val1= calc_upg_gigjoules_ch4, val2= 3.6)\n\t\t(val1 / val2).round 2\n\tend", "def price_in_cents\n (cart.total_price*100).round\n end", "def adapt_gross\n return if self.vendor.net_prices || self.tax == self.item.tax_profile.value\n \n net_cents = self.total_cents / ( 1.0 + ( self.item.tax_profile.value / 100.0 ) )\n self.total_cents = (net_cents * ( 1.0 + ( self.tax / 100.0 ) )).round(2)\n end", "def prop_c\n bases_c / length.to_f\n end", "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 remaining_percent\n (remaining_pints.to_f)/(124.to_f)\n end", "def iralmidon\n vag=(almidon * 100) / 90\n vag.round(2)\n end", "def calculoIMC(peso, altura)\n return '%.2f' % (peso.to_f/(altura.to_f * altura.to_f))\nend", "def prec_f() end" ]
[ "0.6706973", "0.65944606", "0.6501503", "0.6462197", "0.64513975", "0.64154905", "0.6414341", "0.64071375", "0.6406625", "0.6393201", "0.63717073", "0.63387334", "0.6331217", "0.6319613", "0.63056934", "0.6304878", "0.63010496", "0.629392", "0.62868536", "0.6282284", "0.62660384", "0.6257927", "0.6251979", "0.6249566", "0.62396693", "0.6219598", "0.62063223", "0.6202592", "0.618736", "0.61806166", "0.61757016", "0.61673003", "0.6154465", "0.61493856", "0.6134155", "0.6131857", "0.6130192", "0.61068135", "0.60956305", "0.6082315", "0.6067336", "0.6060511", "0.60481167", "0.6048112", "0.6040737", "0.6033534", "0.6027686", "0.60273266", "0.60197765", "0.60166144", "0.60085106", "0.5989787", "0.5983349", "0.59826237", "0.59779334", "0.59716415", "0.5968486", "0.5968486", "0.5963883", "0.5956887", "0.5955999", "0.59499043", "0.5946543", "0.5944839", "0.5939009", "0.5938175", "0.5937132", "0.5936795", "0.59336233", "0.59309417", "0.5915678", "0.591472", "0.5909825", "0.5904347", "0.59009916", "0.59009916", "0.5900635", "0.58952194", "0.5892082", "0.589088", "0.5878736", "0.587703", "0.5875708", "0.58728534", "0.5868716", "0.586553", "0.586286", "0.58605134", "0.5855274", "0.58506495", "0.58498615", "0.58435637", "0.5828827", "0.5827489", "0.5820189", "0.5810978", "0.580927", "0.58083594", "0.5800875", "0.58007276", "0.58003926" ]
0.0
-1
Gets the data of a widget GET widget_data
def widget_data widget = Widget.find(params[:widget_id]) data = widget.get_filtered_dataset false, 10000 render json: {id: widget.id, visualization: widget.visualization, name: widget.name, description: widget.description, data: data['data']}.to_json end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def widget_data\n widget = WidgetService.widget(params[:widget_id])\n render json: {\n id: widget.id,\n dataset: widget.dataset,\n visualization: widget.widget_config,\n name: widget.name,\n description: widget.description,\n metadata: widget.metadata\n }\n end", "def widget_data\n widget = Widget.find(params[:widget_id])\n datasets = []\n @site.contexts.each {|c| c.context_datasets.each {|cd| datasets << cd.dataset_id}}\n if datasets.include? widget.dataset_id # To get only a widget for a dataset for this site\n data = widget.get_filtered_dataset false, 10000\n render json: {id: widget.id,\n visualization: widget.visualization,\n name: widget.name,\n description: widget.description,\n data: data['data']}.to_json\n else\n render json: {}\n end\n end", "def getData\n @widget = Widget.find(params[:id])\n wtype = WidgetType.find(@widget.widget_type_id)\n \n # Return a hash of datas obtained from each source\n srcdata = {}\n str2lst(@widget.sources).each do |source_id|\n src = Source.find(source_id)\n # TBD: There is a TS call inside. Make this non-blocking, also catch error and put error in the hash\n sdata = src.getData()\n logger.debug(\"getData():sdata = #{sdata}\")\n srcdata[source_id] = sdata\n end\n logger.debug(\"getData():srcdata = #{srcdata}\")\n\n metadata = WidgetType.getMetaData(srcdata)\n data = {:srcdata => srcdata, :metadata => metadata}\n\n # The final returned hash looks like this\n # data -> {\n # srcdata -> { ... },\n # metadata -> { ... }\n # };\n render :json => {:data => data}\n end", "def data\n @field.widget.value_from_formdata(@form.data, @html_name)\n end", "def load_widget_data\n if @current_template && @account\n # Build query of only the necessary ids, from the widgets \n unless @current_template.required_article_ids.blank? \n @registers[:widget_data] = @current_template.parsed_widget_data( hash_by_id(Article.find_by_ids(@current_template.required_article_ids.reject{ |i| i.blank? }, :account_id => @account.account_resource_id)) )\n end\n end\n end", "def get_data()\n\t\tself.data[:control_widget][:pages_list] = Page.all\n\tend", "def get(id)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'id', id);\n\t\t\tclient.queue_service_action_call('widget', 'get', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def data\n retrieve_data\n end", "def data\n attributes['data']\n end", "def widget\n html = \"<div class='widget'>\"\n html += provider.widget(internal_id)\n html += \"</div>\"\n return html.html_safe\n end", "def data\n @data\n end", "def data\n @data\n end", "def data\n @data\n end", "def widget_page\n @widget = WidgetService.widget(params[:widget_id])\n @title = @widget.name\n @description = @widget.description\n\n render :widget_page, layout: 'standalone'\n end", "def data\n @data\n end", "def data\n @data\n end", "def data\n @data\n end", "def data\n @data\n end", "def data\n attributes.fetch(:data)\n end", "def data\n attributes.fetch(:data)\n end", "def render\n data\n end", "def data\n self[:data]\n end", "def data\n @data\n end", "def data\r\n @data\r\n end", "def get_widgets_list\n dataset_array = []\n @site.contexts.each {|c| c.context_datasets.each {|d| dataset_array << d.dataset_id}}\n dataset_array.uniq!\n widgets = WidgetService.from_datasets dataset_array\n widgets.map do |w|\n { id: w.id, name: w.name,\n visualization: w.widget_config, description: w.description }\n end\n end", "def find_widget widget_description\n @form.find_widget widget_description\n end", "def widget\n @widget = \"#{params[:name].camelize}Widget\".constantize.new(current_user)\n respond_to do |format|\n format.js\n end\n end", "def find_widget widget_description\n @widgets.find widget_description\n end", "def data\n @datas\n end", "def get_data()\t\n\tend", "def data\n timestamp = @timestamp.call\n time_str = @time_str.call\n @data ||= listings.map do |listing|\n {\n id: listing['id'],\n timestamp: timestamp,\n time_str: time_str,\n title: listing.css('h2 > a > span.atcui-truncate.ymm > span').text,\n # price: listing.css('.primary-price').text.delete(\"$\").delete(\",\"),\n price: listing.css('.primary-price span').text.delete(\"$\").delete(\",\"),\n mileage: listing.css('.mileage .atcui-bold').text.delete(\",\"),\n color: listing.css('.color .atcui-block').text,\n distance: listing.css('.distance-cont').text.split(' ')[0],\n image: listing.css('.media-img').css('img')[0]['src'],\n link: \"http://www.autotrader.com#{listing.css('a').first['href']}\"\n }\n end\n end", "def get_data(options)\r\n data = options[:data]\r\n\r\n data\r\n end", "def get_widget_by_id(id, board_id)\n if id == nil\n raise 'Widget ID not found!'\n end\n widgets_url = URI(\"https://api.miro.com/v1/boards/#{board_id}/widgets/#{id}\")\n result = send_get(widgets_url)\n widget = JSON.parse(result)\n puts CIGREEN + \"GOT WIDGET: \" + CEND + \"#{result}\"\n return widget\nend", "def getProperties\n @widget = Widget.find(params[:id])\n wtype = WidgetType.find(@widget.widget_type_id)\n\n # Return a hash of properties obtained from each source\n # TBD: Currently used for cal widget. Can be used to send authentication tokens\n srcdata = {}\n str2lst(@widget.sources).each do |source_id|\n src = Source.find(source_id)\n sdata = src.getProperties()\n #logger.debug(\"getProperties():sdata = #{sdata}\")\n srcdata[source_id] = sdata\n end\n\n data = {:srcdata => srcdata}\n #logger.debug(\"getProperties():data = #{data}\")\n\n # The final returned hash looks like this\n # data -> {\n # srcdata -> { ... },\n # };\n render :json => {:data => data}\n end", "def get_data(key=nil)\n @data ||= {}\n @data[key]\n end", "def data\n return @content.data\n end", "def data\n @data ||= @_data.respond_to?(:call) ? @_data.call() : @_data\n end", "def get\n data[\"_value\"]\n end", "def relic_to_widget_data(relic, with_photo = true)\n data = {\n :id => relic.id,\n :latitude => relic.latitude,\n :longitude => relic.longitude,\n :identification => relic.identification,\n :street => relic.street,\n :place => relic.place.name\n }\n data[:main_photo] = relic.main_photo if with_photo\n data\n end", "def data\n if key?('data') && !self['data'].nil?\n self['data']\n else\n request_params\n end\n end", "def show\n @pwidget = Pwidget.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pwidget }\n end\n end", "def jmaki_load_widget(name)\n # Return previously parsed content (if any)\n if !@jmaki_widgets\n @jmaki_widgets = { }\n end\n previous = @jmaki_widgets[name]\n if previous\n return previous\n end\n content = \"\"\n filename = JMAKI_RESOURCES + name.tr('.', '/') + \"/widget.json\"\n File.open(filename, \"r\") do |file|\n while line = file.gets(nil)\n content += line\n end\n end\n current = jmaki_parse_json(content, filename)\n @jmaki_widgets[name] = current\n current\n end", "def data\n @payload['data']\n end", "def getData\n rNewContent, rNewMetadata = @ContentMetadataPanel.getData\n rNewTags = createTagsFromPanel\n\n return rNewContent, rNewMetadata, rNewTags\n end", "def data\n @content\n end", "def itemized_data\n data\n end", "def get_data(key) \n return @data[key]\n end", "def data\n self.load if @data.nil?\n @data\n end", "def data\n construct_url\n JSON.parse(response)\n end", "def custom_data\n return @custom_data\n end", "def widget_attrs(widget)\n {}\n end", "def shell_registry_getvaldata(key, valname, view)\n a = shell_registry_getvalinfo(key, valname, view)\n a[\"Data\"] || nil\n end", "def getData\n\t \t@data = {'command' => @command, 'params' => @params}\n \treturn @data\n\t end", "def data\n update_data\n @data\n end", "def render_widget_for(widget_id, opts={}, &block) \n ### DISCUSS: let user pass widget OR/and widget_id ?\n if widget_id.kind_of? Apotomo::StatefulWidget\n widget = widget_id\n else\n widget = apotomo_root.find_by_id(widget_id)\n raise \"Couldn't render non-existent widget `#{widget_id}`\" unless widget\n end\n \n \n \n widget.opts = opts unless opts.empty?\n \n #yield target\n \n content = widget.render_content &block\n \n ### DISCUSS: this happens multiple times when calling #render_widget more than once!\n freeze_apotomo_root!\n \n return content\n end", "def plugin_data\n @plugin_data ||= Plugins.data_for_view(@page, form_values: form_values, donation_band: @url_params[:donation_band])\n end", "def get_coordinates(widget)\n x = widget[\"x\"]\n y = widget[\"y\"]\n return x, y\nend", "def widgets\n @widgets\n end", "def get_data(resource_type, name)\n raise NotImplementedError, :get_data\n end", "def plugin_data\n @plugin_data ||= Plugins.data_for_view(@page, form_values: member_data, donation_band: @url_params[:donation_band])\n end", "def collect_data( data )\n data\n end", "def load_profile_widget\n # get name of widget to load\n @widget_name = params[:name]\n user_id = params[:user_id]\n content_id = params[:content_id] # HTML widgets also pass a content_id which is used to identify content in the db \n if content_id\n @content = HtmlContent.find_by_content_id(content_id)\n if !@content\n # create content\n HtmlContent.create(:title=>'New Content', :body=>'Add Some Content', :content_id=>content_id)\n @content = HtmlContent.find_by_content_id(content_id)\n end\n render :template=>'widgets/html_content_home', :layout => 'widget'\n else\n if params[:include_friends]\n include_friends = true\n end\n if params[:only_statuses]\n only_statuses = true\n end\n render :template=>'widgets/' + @widget_name, :locals=>{:include_friends=>include_friends, :only_statuses=>only_statuses, :user_id=>user_id}, :layout => 'widget'\n end\n end", "def data\n @data_js ||= (App::load_data path)\n end", "def widget\n end", "def widget\n end", "def getData(data_of, id)\n url_data = stringGetUrlPath(data_of)\n url_request = \"#{url_data}/#{id}\"\n response_data = readData(url_request)\n return response_data\n end", "def render_widget\n user_id = params[:user_id]\n @group_id = params[:group_id]\n layout_id = params[:widget_id]\n @layout = WidgetLayout.find(layout_id)\n @widget_name = params[:name]\n render :template=>'widgets/'+ @widget_name, :locals=>{:user_id=>user_id}, :layout => 'widget'\n end", "def data\n @data ||= JSON.parse(self['raw']) \n end", "def data\n @data ||= ManageData.new data: url.to_s, list: @list\n end", "def data\n @data ||= self.class.unmarshal(read_attribute('data')) || {}\n end", "def set_data(params)\n\t\t#if this is the first time, need to initialize the hash\n\t\tif !self.data[:control_widget] then self.data[:control_widget] = {} end\n\t\t\n\t\tself.data[:control_widget][:choice_1_label_1] = params[:choice_1_label_1]\n\t\tself.data[:control_widget][:choice_1_dest1_page_id] = params[:choice_1_dest1_page_id]\n\t\tself.data[:control_widget][:choice_2_label_1] = params[:choice_2_label_1]\n\t\tself.data[:control_widget][:choice_2_dest2_page_id] = params[:choice_2_dest2_page_id]\n\tend", "def get_view_data(page=1, arguments=\"\")\n\n session_data = {}\n session_data.store(:me, context.user.username) if not context.nil? and not context.user.nil?\n if not context.nil? and context.instance_variable_defined?(\"@current_profile\")\n session_data.store(:current_profile, context.instance_variable_get(\"@current_profile\"))\n end\n if not context.nil? and context.instance_variable_defined?(\"@current_content\")\n session_data.store(:current_content, context.instance_variable_get(\"@current_content\")) \n end \n\n data = view.get_data(page, arguments, session_data)\n\n return data\n\n end", "def data_popup\n authorize %i[stash_engine admin_datasets]\n respond_to do |format|\n @identifier = Identifier.find(params[:id])\n @internal_datum = if params[:internal_datum_id]\n InternalDatum.find(params[:internal_datum_id])\n else\n InternalDatum.new(identifier_id: @identifier.id)\n end\n setup_internal_data_list\n format.js\n end\n end", "def data\n @data_t\n end", "def widget_form_params\n params.fetch(:widget_form, {})\n end", "def data\r\n @obj.read_var(@name)\r\n end", "def show\n @widget = Widget.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @widget }\n end\n end", "def find_widget_index widget_description\n @form.find_widget_index widget_description\n end", "def internal_data # nodoc\n _data\n end", "def get_data(doctype,type=Hash)\n verify_doctype(doctype)\n Store.get_store(store_index(doctype)).get_data(docname(doctype), type)\n end", "def call\n data\n end", "def get_data_here(iFormat)\n rData = nil\n\n case iFormat\n when Wx::DF_TEXT\n rData = @DataAsText\n when DataObjectSelection.getDataFormat\n rData = @Data\n else\n log_bug \"Asked unknown format: #{iFormat}\"\n end\n\n return rData\n end", "def set_widget\n if !logged_in?\n userresponse = RestClient::Request.new({\n method: :get,\n url: ENV['API_URL'] + 'widgets/visible?client_id='+ ENV['CLIENT_ID'] + '&client_secret=' + ENV['CLIENT_SECRET'] +'&term=',\n headers: { content_type: 'application/json'}\n }).execute do |userresponse, request, result|\n case userresponse.code\n when 400\n [ :error, JSON.parse(userresponse) ]\n when 200\n [ :success, JSON.parse(userresponse) ]\n json=JSON.parse(userresponse)\n rec = Array.new\n json[\"data\"][\"widgets\"].each do |item|\n widget= Widget.new \n widget.id=item[\"id\"]\n widget.name=item[\"name\"]\n widget.description=item[\"description\"]\n widget.kind=item[\"kind\"]\n widget.userid=item[\"user\"][\"id\"]\n widget.username=item[\"user\"][\"name\"]\n widget.owner=item[\"owner\"]\n rec << widget\n end\n @widgetlist= WidgetList.new\n @widgetlist.widgets = rec\n else\n fail \"Invalid response #{userresponse.to_str} received.\"\n end\n end\n else\n response = RestClient::Request.new({\n method: :get,\n url: ENV['API_URL'] + '/widgets',\n headers: { Authorization: session[:access_token], content_type: 'application/json'}\n }).execute do |response, request, result|\n case response.code\n when 400\n [ :error, JSON.parse(response) ]\n when 200\n [ :success, JSON.parse(response) ]\n json=JSON.parse(response)\n rec = Array.new\n json[\"data\"][\"widgets\"].each do |item|\n widget= Widget.new \n widget.id=item[\"id\"]\n widget.name=item[\"name\"]\n widget.description=item[\"description\"]\n widget.kind=item[\"kind\"]\n widget.userid=item[\"user\"][\"id\"]\n widget.username=item[\"user\"][\"name\"]\n widget.owner=item[\"owner\"]\n rec << widget\n end\n @widgetlist= WidgetList.new\n @widgetlist.widgets = rec\n else\n fail \"Invalid response #{response.to_str} received.\"\n end\n end\n end\n end", "def widget_url(callback = 'initWidget')\n %(#{configuration.url}/api/v1/widgets/user.js?access_token=#{api.token}&callback=#{callback})\n end", "def form_field_data\n @attributes[:form_field_data]\n end", "def data\n @data ||= {}\n end", "def data\n @data ||= {}\n end", "def data\n @data ||= {}\n end", "def data; end", "def data; end", "def data; end", "def data; end", "def data; end", "def data; end", "def data; end", "def data; end", "def data; end", "def data; end", "def data; end", "def data; end" ]
[ "0.76490235", "0.75053275", "0.698634", "0.62444645", "0.6195724", "0.6006288", "0.59895575", "0.5933267", "0.58755213", "0.57870096", "0.562851", "0.562851", "0.562851", "0.56216526", "0.5617045", "0.56114966", "0.56114966", "0.56114966", "0.5600424", "0.5600424", "0.5567163", "0.5555462", "0.5549352", "0.5548134", "0.5536846", "0.54391176", "0.5431127", "0.5394267", "0.53695416", "0.536078", "0.5331792", "0.5309325", "0.5301691", "0.5296217", "0.52661043", "0.5264187", "0.52542686", "0.52539843", "0.5248648", "0.524229", "0.5224631", "0.5219165", "0.52145034", "0.52145016", "0.5209743", "0.52059627", "0.51942545", "0.5189547", "0.5173453", "0.51510084", "0.51482666", "0.51425666", "0.51404977", "0.51281536", "0.512755", "0.51143456", "0.5100859", "0.5091827", "0.5088684", "0.5077824", "0.50583404", "0.5057304", "0.5056192", "0.5052691", "0.5052691", "0.5029377", "0.50279975", "0.50176066", "0.5010628", "0.5006128", "0.5002425", "0.5001817", "0.49857625", "0.4976329", "0.49708995", "0.49686456", "0.49590644", "0.4951336", "0.4943353", "0.4940379", "0.49283415", "0.49120274", "0.4911947", "0.49111506", "0.489395", "0.48899028", "0.48874652", "0.48874652", "0.4881689", "0.4881689", "0.4881689", "0.4881689", "0.4881689", "0.4881689", "0.4881689", "0.4881689", "0.4881689", "0.4881689", "0.4881689", "0.4881689" ]
0.75109273
1
Get hash of all active root level campuses/ORUs, sorted by ordering in unit_hier table
def getActiveCampuses return Unit.join(:unit_hier, :unit_id=>:id). filter(:ancestor_unit=>'root', :is_direct=>1).exclude(:status=>["hidden", "archived"]). order_by(:ordering).to_hash(:id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unit_hash\n end", "def roothash\n root_node._hash || recalculate_hash_at(root_node)\n end", "def lands_hash\n []\n end", "def index\n @first_level_units = FirstLevelUnit.active.order(:organization_id)\n end", "def x_get_tree_roots\n u = User.current_user\n user_groups = u.report_admin_user? ? nil : u.miq_groups\n having_report_results(user_groups).sort\n end", "def generate_hash\n @groups.flatten.inject([]) {|hash, stone| hash << stone.to_s}.sort.hash\n end", "def initialize\n\t\t\t@roots = {}\n\t\t\t@ordered = Array.new\n\t\tend", "def all_hiera_data\n {}\n end", "def root_hash\n self[1]\n end", "def x_get_tree_roots\n objects = [\n {:id => \"sis\", :text => _(\"Analysis Profiles\"), :icon => \"fa fa-search\", :tip => _(\"Analysis Profiles\")},\n {:id => \"z\", :text => _(\"Zones\"), :icon => \"pficon pficon-zone\", :tip => _(\"Zones\")}\n ]\n objects.push(:id => \"msc\", :text => _(\"Schedules\"), :icon => \"fa fa-clock-o\", :tip => _(\"Schedules\"))\n objects\n end", "def getUnitHeader(unit, pageName=nil, attrs=nil)\n if !attrs then attrs = JSON.parse(unit[:attrs]) end\n r = UnitHier.where(unit_id: unit.id).where(ancestor_unit: $activeCampuses.keys).first\n campusID = (unit.type=='campus') ? unit.id : r ? r.ancestor_unit : 'root'\n header = {\n :campusID => campusID,\n :campusName => $unitsHash[campusID].name,\n :campuses => $activeCampuses.values.map { |c| {id: c.id, name: c.name} }.unshift({id: \"\", name: \"eScholarship at...\"}),\n :logo => getLogoData(attrs['logo']),\n :nav_bar => getNavBar(unit.id, pageName, attrs['nav_bar']),\n :social => {\n :facebook => attrs['facebook'],\n :twitter => attrs['twitter'],\n :rss => attrs['rss']\n },\n :breadcrumb => (unit.type!='campus') ?\n traverseHierarchyUp([{name: unit.name, id: unit.id, url: \"/uc/\" + unit.id}]) + getPageBreadcrumb(unit, pageName)\n : getPageBreadcrumb(unit, pageName)\n }\n\n # if this unit doesn't have a nav_bar, get the next unit up the hierarchy's nav_bar\n if !header[:nav_bar] and unit.type != 'campus'\n ancestor = $hierByUnit[unit.id][0].ancestor\n until header[:nav_bar] || ancestor.id == 'root'\n header[:nav_bar] = JSON.parse(ancestor[:attrs])['nav_bar']\n ancestor = $hierByUnit[ancestor.id][0].ancestor\n end\n end\n\n return header\nend", "def location_tree\n #@locations = Location.all\n # puts \"location_tree\"\n @locations = Location.where(ancestry: nil).order(location_type: :desc)\n #@locations = Location.where(id: 1)\n end", "def root_hash\n self.node_hash root_node_id\n end", "def full_hierarchy\n hierarchy = []\n current_location = self\n hierarchy << current_location.name\n while(1)\n if (current_location.location)\n location = current_location.location\n hierarchy << location.name\n current_location = location\n else\n break\n end\n end\n hierarchy.reverse.map {|h| h}.join(\", \")\n end", "def to_hash\n root.to_hash\n end", "def test_sort_by_ancestry_full_tree\n AncestryTestDatabase.with_model do |model|\n n1, n2, n3, n4, n5, n6 = build_tree(model)\n\n records = model.sort_by_ancestry(model.all.ordered_by_ancestry_and(:id => :desc))\n assert_equal [n1, n5, n6, n2, n4, n3].map(&:id), records.map(&:id)\n end\n end", "def child_keys() []; end", "def aws_ou_list\n output = {}\n root_ou_id = @aws_org_client.list_roots.roots[0].id\n\n ou_recurse = lambda do |ous|\n ous.each do |ou_name, ou_id|\n children = aws_ou_list_children(ou_id, ou_name)\n unless children.empty?\n output.merge!(children)\n ou_recurse.call(children)\n end\n end\n end\n ou_recurse.call(root: root_ou_id)\n\n output\n end", "def to_tree_hash\n TreeHash.new(self)\n end", "def hash\n @children.hash\n end", "def build_struct_tree data\n data.to_hashugar\n end", "def build_hash_tree(tree_scope)\n tree = ActiveSupport::OrderedHash.new\n id_to_hash = {}\n\n tree_scope.each do |ea|\n h = id_to_hash[ea.id] = ActiveSupport::OrderedHash.new\n (id_to_hash[ea._ct_parent_id] || tree)[ea] = h\n end\n tree\n end", "def hash\n self.atoms.hash\n end", "def x_get_tree_roots\n objects = []\n objects.push(configured_systems)\n count_only_or_objects(false, objects + FILTERS.values)\n end", "def order_tree\n @tree.each do | country, country_hash|\n if country != 'count'\n country_hash.each do | region, region_hash |\n @tree[country][region] = order_hash(@tree[country][region]) if region != 'count'\n end\n @tree[country] = order_hash(@tree[country])\n end\n end\n @tree = order_hash(@tree)\n end", "def get_values_for_verification\n \t@intermediate_nodes = self.get_intermediate_nodes\n @array = []\n\n @intermediate_nodes.each do |node|\n @array << node.sha.to_s\n if node.is_right_child\n @array << \"rchild\"\n else\n @array << \"lchild\"\n end\n end\n\n \t@array << Node.get_root_node.sha.to_s\n @array << \"root\"\n\n \treturn @array\n #return @intermediate_nodes\n end", "def hash_by_uri\n @hash_by_uri ||= begin\n result = {}\n flatten_hierarchy.each do |c|\n result[c.uri.to_s]=c\n end\n result\n end\n end", "def node_subhashes(node)\n l_hash = node.left ? node.left._hash : self.class.null_hash_at(node.depth + 1)\n r_hash = node.right ? node.right._hash : self.class.null_hash_at(node.depth + 1)\n [l_hash, r_hash]\n end", "def all_structural_subhashes\n hashes = []\n self.deep_each do |node|\n hashes << node.structural_hash\n end\n hashes\n end", "def all_component_hash(item=nil)\n hash = {}\n items = []\n if(!item.nil?)\n items = item.components\n else\n for comp in @all_components\n if(comp.component_parents.empty?)\n items.push(comp)\n end\n end\n end\n for comp in items\n hash[comp] = all_component_hash(comp)\n end\n return hash\n end", "def tes_gettree\n tree = []\n Accounts.matches_by_account_id(0).to_a.each { |a|\n a.get_tree { |b| tree.push b.rev_index }\n }\n tree_d = []\n Accounts.matches_by_account_id(0).to_a.each { |a|\n a.get_tree_debug { |b| tree_d.push b.rev_index }\n }\n\n assert_equal 389, tree.count\n assert_equal 389, tree_d.count\n end", "def hash\n [_hash, name, owner].hash\n end", "def subministry_campuses_old(top = true)\n unless @subministry_campuses\n @subministry_campuses = top ? [] : self.ministry_campuses\n self.children.each do |ministry|\n @subministry_campuses += ministry.subministry_campuses(false)\n end\n end\n return @subministry_campuses\n end", "def test_sort_by_ancestry_with_block_full_tree\n AncestryTestDatabase.with_model :extra_columns => {:rank => :integer} do |model|\n n1, n2, n3, n4, n5, n6 = build_ranked_tree(model)\n\n records = model.sort_by_ancestry(model.all.order(:id => :desc), &RANK_SORT)\n assert_equal [n1, n5, n3, n2, n4, n6].map(&:id), records.map(&:id)\n end\n end", "def test_sort_by_ancestry_missing_parent_middle_of_tree\n AncestryTestDatabase.with_model do |model|\n n1, _, _, n4, n5, _ = build_tree(model)\n\n records = model.sort_by_ancestry([n5, n4, n1])\n if CORRECT\n assert_equal [n1, n4, n5].map(&:id), records.map(&:id)\n else\n assert_equal [n1, n5, n4].map(&:id), records.map(&:id)\n end\n end\n end", "def users4order\n [self] + children.select { |child| child.children.count == 0 }\n end", "def get_tree(lang = I18n.default_locale)\n t = arel_table\n all_trans = locale(lang).select(t[:key]).where(t[:key].matches(\"%.%\")).all\n\n tree = LazyHash.build_hash\n all_trans = all_trans.map{|x| x.key.split(\".\")[0..-2].join(\".\")}.uniq\n all_trans.each do |x|\n LazyHash.add(tree, x, {})\n end\n\n # Generate a new clean hash without the proc's from LazyHash.\n # Includes a root level for convenience, to be exactly like the\n # structure of a .yml file which has the \"en\" root key for example.\n {\"index\" => eval(tree.inspect)}\n end", "def hash\n [unit_id, name, archived, type, enable_pos_targets, menu_id, ac_area_id, ac_area_exit_id, menu_item_id, enable_payout, tickets_use_cart, tickets_cart_max_size, tickets_allow_barcode_by_keyboard, ticket_site_mapping_label_config, tickets_swap_to_chip, tickets_allow_search, tickets_emit_access_check, ac_check_sell_product, ac_check_use_turnstyle, self_service_card_payment_type_id, self_service_cash_payment_type_id, self_service_cashless_payment_type_id, payment_type_ids, chip_ids].hash\n end", "def all_associated_faculty\n self.self_and_descendants.collect(&:associated_faculty).flatten.sort {|x,y| x.sort_name <=> y.sort_name }.uniq\n end", "def usage_by_top_level_dir\n @attributes[:usage_by_top_level_dir]\n end", "def collected_org_keys\n self.organizations.collect { |org| org.organization_key }\n end", "def get_hash(machines)\n branch = get_branch_id\n hash = Digest::SHA1.hexdigest(machines.sort.join)\n \"#{branch}__#{hash}\"\n end", "def child_exam_paper_structures\n exam_paper_structures.where(level: 1).order(\"order_index ASC\")\n end", "def test_root_hash_when_its_empty\n assert_equal(\n 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',\n MT::Tree.new.root_hash\n )\n end", "def getAllUnits\n deep_copy(@allUnits)\n end", "def org_tree_node(o = nil)\n orgs = {}\n @org_ids ||= {}\n (o ? o.children : Organization.find(Organization.find(organization_id).parent).children).order('name').each do |org|\n # collect roles associated with each org\n @org_ids[org.id] ||= {}\n orgs[org.id] = org_tree_node(org)\n end\n orgs\n end", "def roots\n self.where(parent: nil).order('index asc')\n end", "def git_checksum_hash(tree, prefix=nil)\n\n tree.contents.each do |obj|\n if obj.class == Grit::Blob\n item = [prefix, obj.name].join\n @currenthash[item] = Digest::MD5.hexdigest(obj.data)\n #puts \"#{item} : \" + @currenthash[item]\n else\n git_checksum_hash(obj, [prefix, obj.name, \"/\"].join)\n end\n end\n\n return @currenthash\n end", "def tree_hash\n serializable_hash.merge(children: children.map(&:serializable_hash))\n end", "def tree_hash\n serializable_hash.merge(children: children.map(&:serializable_hash))\n end", "def hash\n @relative_name.hash\n end", "def test_sort_by_ancestry_with_block_full_tree_sql_sort\n AncestryTestDatabase.with_model :extra_columns => {:rank => :integer} do |model|\n n1, n2, n3, n4, n5, n6 = build_ranked_tree(model)\n\n records = model.sort_by_ancestry(model.all.ordered_by_ancestry_and(:rank))\n assert_equal [n1, n5, n3, n2, n4, n6].map(&:id), records.map(&:id)\n end\n end", "def unique_hierarchy(data)\n headings = %w(title h1 h2 h3 h4 h5 h6)\n headings.map { |heading| data[heading.to_sym] }.compact.join(' > ')\n end", "def unique_ministry_campuses_old(top = true)\n unless @unique_ministry_campuses\n res = lambda {\n @unique_ministry_campuses = ministry_campuses.clone\n @unique_campuses = campuses.clone\n subministry_campuses(top).each do |mc|\n @unique_ministry_campuses << mc unless @unique_campuses.include?(mc.campus)\n @unique_campuses << mc.campus\n end\n @unique_ministry_campuses\n }\n @unique_ministry_campuses = (Rails.env.production? ? Rails.cache.fetch([self, 'unique_ministry_campuses']) {res.call} : res.call)\n end\n return @unique_ministry_campuses\n end", "def firstAlphabetical\n @leaf\n end", "def x_get_tree_roots(count_only, _options)\n objects = Rbac.filtered(VmdbDatabase.my_database.evm_tables).to_a\n # storing table names and their id in hash so they can be used to build links on summary screen in top 5 boxes\n @sb[:vmdb_tables] = {}\n objects.each do |o|\n @sb[:vmdb_tables][o.name] = o.id\n end\n count_only_or_objects(count_only, objects, \"name\")\n end", "def test_sort_by_ancestry_no_parents_same_level\n AncestryTestDatabase.with_model do |model|\n _, _, n3, n4, n5, _ = build_tree(model)\n\n records = [n5, n4, n3]\n # records = model.sort_by_ancestry(model.all.ordered_by_ancestry_and(:id => :desc).offset(3).take(3))\n assert_equal [n5, n4, n3].map(&:id), records.map(&:id)\n end\n end", "def sub_units\n SubUnit.where(id: sub_unit_ids).order(:name)\n end", "def disk_hash_tree\n tree_size = SpStore::Merkle::HashTreeHelper.full_tree_node_count @blocks\n node_hashes = Array.new(tree_size+1)\n File.open(disk_hash_file, 'rb') do |file|\n file.seek(hash_byte_size, IO::SEEK_SET)\n (1..tree_size).each do |idx|\n node_hashes[idx] = file.read(hash_byte_size)\n end\n end\n node_hashes\n end", "def getAllTransNameKeys\n parents = self.getAllParents\n allRecs = parents.concat([self])\n treeKeys = (allRecs).map { |rec| rec.name_key if rec}\n end", "def tree_map_for(ref)\n @access.tree(ref)\n rescue Grit::GitRuby::Repository::NoSuchShaFound\n []\n end", "def hojas_arbol_nodo\n children_array = []\n\n nivel_categoria = @especie.categoria_taxonomica.nivel1\n ancestry = @especie.is_root? ? @especie.id : \"#{@especie.ancestry_ascendente_directo}/%#{@especie.id}%\"\n\n taxones = Especie.select_basico(['ancestry_ascendente_directo', 'conteo', 'categorias_taxonomicas.nivel1']).datos_basicos.\n categoria_conteo_join.where(\"categoria='7_00' OR categoria IS NULL\").where(\"ancestry_ascendente_directo LIKE '#{ancestry}'\").\n where(\"nombre_categoria_taxonomica IN ('#{CategoriaTaxonomica::CATEGORIAS_OBLIGATORIAS.join(\"','\")}')\").\n where(\"nivel1=#{nivel_categoria + 1} AND nivel3=0 AND nivel4=0\"). # Con estas condiciones de niveles aseguro que es una categoria principal\n where(estatus: 2)\n\n taxones.each do |t|\n children_hash = hash_arbol_nodo(t)\n\n # Acumula el resultado del json anterior una posicion antes de la actual\n children_array << children_hash\n end\n\n render :json => children_array.to_json\n end", "def tree_ordered_names\n tree_order_name_ids.collect { |name_id| queried_names[queried_names.index { |name| name[:id] == name_id }] }\n end", "def build_nested_administrative_units\n administrative_unit_array = []\n accumulator = {}\n administrative_units = FedoraObjectAggregationKey.aggregation_by(as_of: metrics.report_end_date,\n predicate: 'creator#administrative_unit')\n administrative_units.each do |administrative_unit|\n aggregation_keys = administrative_unit.fetch(:aggregation_key).split('::')\n # remove header (University of NotreDame)\n aggregation_keys.shift\n # create nested hash of department with colleges and count\n department_name = aggregation_keys.shift\n count = administrative_unit.fetch(:object_count)\n accumulator[department_name] ||= {}\n # Check if it is department or college level\n college = aggregation_keys.present? ? aggregation_keys.shift : 'non-departmental'\n accumulator[department_name][college] ||= 0\n accumulator[department_name][college] += count.to_i\n administrative_unit_array << accumulator\n end\n metrics.obj_by_administrative_unit = administrative_unit_array.reduce(&:deep_merge)\n end", "def hash\n members.hash\n end", "def branches\n if ancestor_ids.empty? then\n nil\n else\n read_attribute(self.base_class.ancestry_column).to_s.split(',')\n end\n end", "def sorted_keys\n keys=nil\n transaction{\n keys=@@global_state.keys.sort\n }\n return keys\n end", "def all_chunk_hashes\n\t\t\n\t\tbegin\n\t\t\t@all_chunk_map = \"\"\n\t\t\t0.upto(num_chunks-1) { |i|\n\t\t\t\t@all_chunk_map += sha1_chunk(i)\n\t\t\t}\n\n\t\tend unless @all_chunk_map\n\t\t@all_chunk_map\n\tend", "def tree(root = '')\n build_hash(files(root), root)\n end", "def to_h\n @root.to_h\n end", "def cache_ancestry\n self.names_depth_cache = path.map(&:name).join('/')\n end", "def full_ancestry\n return id.to_s unless ancestry\n path_ids.join('/')\n end", "def to_hash\n memoize(:to_hash) do\n _process_hashed(structures.inject({}) { |acc, elem| Utils.merge(acc, elem) })\n end\n end", "def fetch_member_orders_by_druid_and_constituent_parents\n @constituent_info = {}\n @member_orders_by_druid =\n ActiveRecord::Base.connection.execute(constituent_druid_sql).map do |row|\n parsed_constituent_druids = JSON.parse(row['constituent_druids'])\n parsed_constituent_druids.each do |constituent_druid|\n @constituent_info[constituent_druid] = { parent_druids: [] } unless @constituent_info.key?(constituent_druid)\n @constituent_info[constituent_druid][:parent_druids] << row['vobj_external_identifier']\n end\n [row['vobj_external_identifier'], parsed_constituent_druids, row['constituent_druids_count']]\n end\n end", "def unit_idlers\n world.units.active.find_all { |u|\n unit_isidler(u)\n }\n end", "def enzymes\n @data.keys.sort\n end", "def hashed_rooster\r\nend", "def create_stable_hash(folder_commits)\n stable_hash = {}\n folder_commits.first.each_key {|key| stable_hash[key] = [0] }\n return stable_hash\n end", "def hash\n [is_bot, is_tor_node, is_threat, is_eu, location, currency_code, currency_name, region_area, subregion_area].hash\n end", "def armors_hash()\n return @armors\n end", "def x_get_tree_roots\n objects = []\n objects << {:id => \"compliance\", :text => _(\"Compliance Policies\"), :icon => \"pficon pficon-history\", :tip => _(\"Compliance Policies\")}\n objects << {:id => \"control\", :text => _(\"Control Policies\"), :icon => \"fa fa-shield\", :tip => _(\"Control Policies\")}\n\n # Push folder node ids onto open_nodes array\n objects.each { |o| open_node(\"xx-#{o[:id]}\") }\n\n count_only_or_objects(false, objects)\n end", "def bases_hash\n if self.read_bases =~ /\\+/\n bases_hash = indels_to_hash('+')\n elsif self.read_bases =~ /-/\n bases_hash = indels_to_hash('-')\n else\n bases_hash = snp_base_hash(self.read_bases)\n end\n # some indels will have ref base in the read and using\n # sum of hash values is going to give wrong additional coverage\n # from indels so including actual coverage from pileup\n # bases_hash keys are :A, :C, :G, :T, :N, :ref and :indel\n bases_hash\n end", "def names\n @lock.synchronize do\n @root_objects.keys\n end\n end", "def common_account_chain(in_root_account)\n rid = in_root_account.id\n accts = self.associated_accounts.where(\"accounts.id = ? OR accounts.root_account_id = ?\", rid, rid)\n return [] if accts.blank?\n children = accts.inject({}) do |hash,acct|\n pid = acct.parent_account_id\n if pid.present?\n hash[pid] ||= []\n hash[pid] << acct\n end\n hash\n end\n\n enrollment_account_ids = in_root_account.\n all_enrollments.\n current_and_concluded.\n where(user_id: self).\n joins(:course).\n distinct.\n pluck(:account_id)\n\n longest_chain = [in_root_account]\n while true\n break if enrollment_account_ids.include?(longest_chain.last.id)\n\n next_children = children[longest_chain.last.id]\n break unless next_children.present? && next_children.count == 1\n longest_chain << next_children.first\n end\n longest_chain\n end", "def branches\n if ancestor_ids.empty? then\n nil\n else\n read_attribute(self.base_class.structure_column).to_s.split(',')\n end\n end", "def all_clubs\n (self.clubs.includes(:teams).to_a + self.administrated_clubs.includes(:teams).to_a).uniq.sort do |club0, club1|\n club0.name <=> club1.name\n end\n end", "def owner_chains\n if owners == []\n [[self.id]]\n else\n owners.map(&:c).map(&:owner_chains).reduce(:+).map{|i| [self.id]+i}\n end\n end", "def find_unique all_hash\n unique = []\n\n all_hash.each_pair do |full_name, cm|\n unique << cm if full_name == cm.full_name\n end\n\n unique\n end", "def bins\n Set.new @tree.values\n end", "def sorted_keys; end", "def all_in_tree\n accounts = Array.new\n accounts += ancestors\n accounts += sibling_accounts\n accounts += children\n accounts << self\n return accounts\n end", "def all\n root.branch\n end", "def check_tree\n @trees = {}\n @blobs = {}\n \n data = @base.lib.ls_tree(@objectish)\n\n data['tree'].each do |key, tree| \n @trees[key] = Git::Object::Tree.new(@base, tree[:sha], tree[:mode]) \n end\n \n data['blob'].each do |key, blob| \n @blobs[key] = Git::Object::Blob.new(@base, blob[:sha], blob[:mode]) \n end\n\n {\n :trees => @trees,\n :blobs => @blobs\n }\n end", "def ministry_list\n root_ministry.descendants.pluck(:id)\n end", "def roots\n base_set_class.find(:all, :conditions => \"#{scope_condition} AND (#{parent_col_name} IS NULL OR #{parent_col_name} = 0)\", :order => \"#{left_col_name}\")\n end", "def hash\n folder.hash ^ name.hash # eXclusive OR operator\n end", "def top_level_components\n @top_level_components ||=\n begin\n required_components\n\n @top_level_components = [ ]\n _env['CABAR_TOP_LEVEL_COMPONENTS'].split(/\\s+/).each do | c_name |\n c = \n @component_by_name[c_name] || \n (raise Cabar::Error, \"Cannot find component #{c_name.inspect}\")\n\n @top_level_components << c\n end\n @top_level_components\n end\n end", "def x_get_tree_roots\n count_only_or_objects(false, StorageCluster.all)\n end", "def test_sort_by_ancestry_with_block_no_parents_all_children\n AncestryTestDatabase.with_model :extra_columns => {:rank => :integer} do |model|\n _, _, n3, n4, n5, n6 = build_ranked_tree(model)\n\n records = model.sort_by_ancestry(model.all.ordered_by_ancestry_and(:rank).offset(2), &RANK_SORT)\n if CORRECT || records[0] == n5\n assert_equal [n5, n3, n4, n6].map(&:id), records.map(&:id)\n else\n assert_equal [n4, n6, n5, n3].map(&:id), records.map(&:id)\n end\n end\n end" ]
[ "0.59638363", "0.5772861", "0.57499564", "0.5585494", "0.5489596", "0.54625857", "0.54336286", "0.5419081", "0.5408177", "0.54011816", "0.53897583", "0.537059", "0.533043", "0.5322176", "0.53209484", "0.5305482", "0.52887946", "0.52430654", "0.5200968", "0.5196734", "0.51893866", "0.517811", "0.51772267", "0.51667976", "0.5155369", "0.51411045", "0.5140544", "0.5120617", "0.51174563", "0.5099977", "0.50854605", "0.5082804", "0.5070937", "0.5068272", "0.5067392", "0.5062996", "0.50453895", "0.5023635", "0.5022165", "0.50211495", "0.50100386", "0.4996432", "0.49858215", "0.4982912", "0.49823838", "0.49563465", "0.4950742", "0.49433354", "0.4938076", "0.4938076", "0.49330425", "0.49275792", "0.4927543", "0.4927078", "0.4920707", "0.49113026", "0.48938483", "0.48926786", "0.4890084", "0.48878002", "0.48876742", "0.48839533", "0.48774135", "0.4872299", "0.48703036", "0.4867931", "0.48662928", "0.48598576", "0.4858464", "0.48511073", "0.48485574", "0.48407108", "0.48390192", "0.48379683", "0.4835107", "0.4830434", "0.48252618", "0.48221833", "0.48203218", "0.48141345", "0.4811835", "0.4804197", "0.48005182", "0.47920105", "0.47917268", "0.4782208", "0.47784397", "0.4777049", "0.47766554", "0.47709078", "0.4752356", "0.4743584", "0.47412774", "0.4737631", "0.47368374", "0.47331977", "0.47255257", "0.47208554", "0.47176644" ]
0.718914
1
Parses and formats data availability statement. Returns [text, (link)]
def getDataAvail(itemAttrs) ds = itemAttrs["data_avail_stmnt"] or return nil case ds["type"] when "publicRepo" return "The data associated with this publication are available at: ", ds["url"] when "publicRepoLater" return "Associated data will be made available after this publication is published." when "suppFiles" return "The data associated with this publication are in the supplemental files." when "withinManuscript" return "The data associated with this publication are within the manuscript." when "onRequest" return "The data associated with this publication are available upon request." when "thirdParty" return "The data associated with this publication are managed by: #{ds["contact"]}" when "notAvail" return "The data associated with this publication are not available for this reason: #{ds["reason"]}" else raise "Unknown data_avail_stmnt type #{ds["type"].inspect}" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def availability_link()\n $tracer.trace(format_method(__method__))\n\n tag = ToolTag.new(@tag.a.className(create_ats_regex_string('ats-avail_link')), format_method(__method__))\n if !tag.exists\n tag = ToolTag.new(@tag.span.className(create_ats_regex_string('ats-avail_link')), format_method(__method__))\n end\n\n return tag\n\n end", "def ordered_availability_link()\n $tracer.trace(format_method(__method__))\n tag = ToolTag.new(@tag.a.className(create_ats_regex_string('ats-avail_link')), format_method(__method__))\n\n if !tag.exists\n tag = ToolTag.new(@tag.span.className(create_ats_regex_string('ats-avail_link')), format_method(__method__))\n end\n return tag\n end", "def extract_availability(place_text)\n if place_text.match(/Avail Now/i)\n Date.today\n else\n date_string = place_text.match(/Avail[ a-zA-Z]* [0-9]{1,2} (January|February|March|April|May|June|July|August|September|October|November|December)/i).to_s\n Date.parse(date_string)\n end\n end", "def formatAvailability(data)\n result = \"\"\n data.each do |day, time_list|\n # determine the day\n case day\n when \"1\"\n result += \"Monday: \"\n when \"2\"\n result += \"Tuesday: \"\n when \"3\"\n result += \"Wednesday: \"\n when \"4\"\n result += \"Thursday: \"\n when \"5\"\n result += \"Friday: \"\n when \"6\"\n result += \"Saturday: \"\n when \"7\"\n result += \"Sunday: \"\n end\n\n for time in time_list do\n result += \"#{format24Hour(time)} \"\n end\n end\n return result\n end", "def online_avail_data(url, note, materials = nil)\n if url.start_with?(CLASSIC_JOSIAH_URL)\n url = url.gsub(CLASSIC_JOSIAH_URL, NEW_JOSIAH_URL)\n else\n url = url\n if !url.start_with?(\"http://\") && !url.start_with?(\"https://\")\n url = \"http://#{url}\"\n end\n end\n\n label = \"\"\n if note == nil && materials == nil\n label = \"Available online\"\n elsif note == nil && materials != nil\n label = materials\n elsif note != nil && materials == nil\n label = note\n else\n label = \"#{note} (#{materials})\"\n end\n\n {url: url, text: label}\nend", "def display_availability\n puts\n puts \"Availability:\"\n @availability.each { |day, status| puts \" * #{day}: #{status}\"}\n end", "def parse_available\n if @input.match?(/Nincs (.*?) \\/ No match\\n/)\n @input.scan(/Nincs (.*?) \\/ No match\\n/)\n @ast[\"status:available\"] = true\n end\n end", "def process_availability(avail_json)\n browseable_libraries = ENV['BROWSEABLE_LIBRARIES'] || \"\"\n availability = JSON.parse(avail_json)\n return \"Online\" if availability[\"online\"].present?\n #return \"Available\" if availability[\"availAt\"].present?\n #return \"Not Available\" if availability[\"unavailAt\"].present?\n # Temporary for covid-19: don't show the availability for non-online items. Since the call number index\n # doesn't include holding info, we can't determine the actual availability.\n return \"\" if availability[\"availAt\"].present? || availability[\"unavailAt\"].present?\n end", "def extract_sla(uri, pattern = %r{at least (\\d+(?:\\.\\d+)?)%}im)\n result = { uri: uri.to_s }\n\n doc = Nokogiri::HTML(open(uri))\n pattern.match(doc.to_s) do |match|\n result['availability'] = (match[1].to_d / 100).to_s\n end\n result\n end", "def extract_landed_aircraft_status(section)\n # We are aiming at find detail string in a structure like:\n # ...\n # <th ...>Status</th>\n # <td ...>\n # <span ...>Landed over 2 hours ago ...</span>\n # ...\n # </td>\n # ...\n # ...\n extract_aircraft_status_raw_text(section).gsub(' (track log & graph)', '')\n end", "def availability\n if more_attributes['sla'] && more_attributes['sla']['availability']\n BigDecimal(more_attributes['sla']['availability'].to_s)\n else\n 0.95\n end\n end", "def availability\n @availability ||= begin\n xml = @client.fetch(:record_availability, :id => self.id)\n doc = Nokogiri::XML(xml)\n\n returning({}) do |hash|\n doc.xpath('//holding').each do |xdata|\n holding = xdata.xpath('name').text\n hash[holding] = xdata.xpath('available').text == 'true'\n end\n end\n end\n end", "def availability_label()\n $tracer.trace(format_method(__method__))\n return ToolTag.new(@tag.td.className(create_ats_regex_string('ats-avail_label')), format_method(__method__))\n end", "def available_for_download_link\n $tracer.trace(__method__)\n return ToolTag.new(a.with.innerText(\"/Available for Download \\\\(\\\\d+\\\\)/\"), __method__)\n end", "def test_v_availability_simple\n blob = <<ICS\nBEGIN:VCALENDAR\nBEGIN:VEVENT\nUID:lalala\nDTSTART:20110101T120000Z\nDTEND:20110101T130000Z\nEND:VEVENT\nEND:VCALENDAR\nICS\n\n vavail = <<ICS\nBEGIN:VCALENDAR\nBEGIN:VAVAILABILITY\nDTSTART:20110101T000000Z\nDTEND:20120101T000000Z\nBEGIN:AVAILABLE\nDTSTART:20110101T000000Z\nDTEND:20110101T010000Z\nEND:AVAILABLE\nEND:VAVAILABILITY\nEND:VCALENDAR\nICS\n\n assert_free_busy_report(\n \"FREEBUSY;FBTYPE=BUSY-UNAVAILABLE:20110101T110000Z/20110101T120000Z\\n\" \\\n \"FREEBUSY:20110101T120000Z/20110101T130000Z\\n\" \\\n 'FREEBUSY;FBTYPE=BUSY-UNAVAILABLE:20110101T130000Z/20110103T110000Z',\n blob,\n nil,\n vavail\n )\n end", "def test_v_availability_irrelevant\n blob = <<ICS\nBEGIN:VCALENDAR\nBEGIN:VEVENT\nUID:lalala\nDTSTART:20110101T120000Z\nDTEND:20110101T130000Z\nEND:VEVENT\nEND:VCALENDAR\nICS\n\n vavail = <<ICS\nBEGIN:VCALENDAR\nBEGIN:VAVAILABILITY\nDTSTART:20150101T000000Z\nDTEND:20160101T000000Z\nBEGIN:AVAILABLE\nDTSTART:20150101T000000Z\nDTEND:20150101T010000Z\nEND:AVAILABLE\nEND:VAVAILABILITY\nEND:VCALENDAR\nICS\n\n assert_free_busy_report(\n 'FREEBUSY:20110101T120000Z/20110101T130000Z',\n blob,\n nil,\n vavail\n )\n end", "def fulltext_links\n\n links = []\n\n ebscolinks = @record.fetch('FullText',{}).fetch('Links',{})\n if ebscolinks.count > 0\n ebscolinks.each do |ebscolink|\n if ebscolink['Type'] == 'pdflink'\n link_label = 'PDF Full Text'\n link_icon = 'PDF Full Text Icon'\n link_url = ebscolink['Url'] || 'detail'\n links.push({url: link_url, label: link_label, icon: link_icon, type: 'pdf'})\n end\n end\n end\n\n htmlfulltextcheck = @record.fetch('FullText',{}).fetch('Text',{}).fetch('Availability',{})\n if htmlfulltextcheck == '1'\n link_url = 'detail'\n link_label = 'Full Text in Browser'\n link_icon = 'Full Text in Browser Icon'\n links.push({url: link_url, label: link_label, icon: link_icon, type: 'html'})\n end\n\n if ebscolinks.count > 0\n ebscolinks.each do |ebscolink|\n if ebscolink['Type'] == 'ebook-pdf'\n link_label = 'PDF eBook Full Text'\n link_icon = 'PDF eBook Full Text Icon'\n link_url = ebscolink['Url'] || 'detail'\n links.push({url: link_url, label: link_label, icon: link_icon, type: 'ebook-pdf'})\n end\n end\n end\n\n if ebscolinks.count > 0\n ebscolinks.each do |ebscolink|\n if ebscolink['Type'] == 'ebook-epub'\n link_label = 'ePub eBook Full Text'\n link_icon = 'ePub eBook Full Text Icon'\n link_url = ebscolink['Url'] || 'detail'\n links.push({url: link_url, label: link_label, icon: link_icon, type: 'ebook-epub'})\n end\n end\n end\n\n items = @record.fetch('Items',{})\n if items.count > 0\n items.each do |item|\n if item['Group'] == 'Url'\n if item['Data'].include? 'linkTerm=&quot;'\n link_start = item['Data'].index('linkTerm=&quot;')+15\n link_url = item['Data'][link_start..-1]\n link_end = link_url.index('&quot;')-1\n link_url = link_url[0..link_end]\n link_label_start = item['Data'].index('link&gt;')+8\n link_label = item['Data'][link_label_start..-1]\n link_label = link_label.strip\n else\n link_url = item['Data']\n link_label = item['Label']\n end\n link_icon = 'Catalog Link Icon'\n links.push({url: link_url, label: link_label, icon: link_icon, type: 'cataloglink'})\n end\n end\n end\n\n if ebscolinks.count > 0\n ebscolinks.each do |ebscolink|\n if ebscolink['Type'] == 'other'\n link_label = 'Linked Full Text'\n link_icon = 'Linked Full Text Icon'\n link_url = ebscolink['Url'] || 'detail'\n links.push({url: link_url, label: link_label, icon: link_icon, type: 'smartlinks+'})\n end\n end\n end\n\n ft_customlinks = @record.fetch('FullText',{}).fetch('CustomLinks',{})\n if ft_customlinks.count > 0\n ft_customlinks.each do |ft_customlink|\n link_url = ft_customlink['Url']\n link_label = ft_customlink['Text']\n link_icon = ft_customlink['Icon']\n links.push({url: link_url, label: link_label, icon: link_icon, type: 'customlink-fulltext'})\n end\n end\n\n links\n end", "def parse_link; end", "def group_as_text(group,document,items)\n output = ''\n reading = ''\n bwith = ''\n if document['abbound_with_json']\n bwith = t('blacklight.catalog.abbound_with')\n end\n multi_vol = document['multivol_b']\n on_site_count = 0\n reserve_item = false\n noncirc = false\n aeon_codes = []\n not_spif = 0 \n spif = 0 \n pda = 'no'\n if group == \"Rare\"\n reading = ' for Reading Room Delivery'\n noncirc = true \n end\n items.each do |i|\n if group == \"Rare\"\n aeon_codes << i['location']['code'] unless aeon_codes.include?(i['location']['code'])\n end\n if !i[\"circ\"].present?\n noncirc = true\n end\n reserve_item = (i['location']['code'].include?(',res') || i['location']['code'].include?('oclc,afrp') || i['location']['name'].include?('Reserve'))\n if i[\"location\"][\"name\"] !~ /Spacecraft Planetary Imaging Facility/\n not_spif += 1 \n end\n if i[\"location\"][\"name\"] =~ /Non-Circulating/\n noncirc = true \n end\n if i[\"location\"][\"name\"] =~ /Spacecraft Planetary Imaging Facility/\n noncirc = true \n spif += 1 \n end\n if !i[\"call\"].blank? && !i[\"call\"].include?('No call number') && i[\"call\"] == ' Available for the Library to Purchase'\n pda = 'yes'\n end\n if pda == 'yes'\n output += \"\\n\" + i[\"call\"]\n elsif i[\"location\"][\"name\"] != 'Library Technical Services Review Shelves' && !document['url_pda_display'].present?\n output += \"\\n\" + i[\"location\"][\"name\"]\n end\n if !i[\"call\"].blank? && !i[\"call\"].include?('No call number') && i[\"call\"] == ' Available for the Library to Purchase'\n pda = 'yes'\n end\n if !i[\"call\"].blank? && !i[\"call\"].include?('No call number') && i[\"call\"] != ''\n if pda != 'yes'\n output += \"\\n\" + i[\"call\"]\n end\n end\n if i[\"items\"].present?\n if i['items']['tempLoc'].present?\n i['items']['tempLoc'].each do |t|\n output += \"\\n\" + t['enum'] + \"Temporarily shelved in \" + t['location']['name']\n end\n end\n end\n if i['boundWith'].present?\n bw = i['boundWith']\n bwenums = []\n bw.each do |k,v|\n @mi = v['masterBibId']\n @mt = v[\"masterTitle\"]\n bwenums << v[\"masterEnum\"]\n end\n output += \"This item is bound with another item. Requests must be made to that item: #{@mt}\"\n + bwenums.join(', ')\n end\n if i['order'].present?\n output += \"\\n\" + i['order']\n end\n if i['holdings'].present?\n libhas = i['holdings'].join(\"\\n\")\n output += \"\\n\" + \"Library has: #{libhas}\"\n end\n if i['indexes'].present?\n indexes = i['indexes'].join(\"\\n\")\n output += \"\\n\" + \"Indexes: #{indexes}\"\n end\n if i['supplements'].present?\n supplements = i['supplements'].join(\"\\n\")\n output += \"\\n\" + \"Supplements: #{supplements}\"\n end\n if i['notes'].present?\n notes = i['notes'].join(\"\\n\")\n output += \"\\n\" + \"Notes: #{notes}\"\n end\n if !i['recents'].nil? && i['recents'].size == 1\n current = i['recents'][0]\n output += \"\\n\" + \"Current Issues: #{current}\"\n elsif !i['recents'].nil? && i['recents'].size > 1\n current = i['recents'].join(\"\\n\")\n output += \"\\n\" + \"Current Issues: #{current}\"\n end\n istatus = solr_status(i,noncirc,pda)\n output += istatus unless istatus.nil?\n end\n output\n end", "def get_specific_listing_info a, info\n parsed_listing = Nokogiri::HTML(a.get(info[:link]).body)\n additional_info = parsed_listing.css('dl').text.split(\"\\n\")\n additional_info.each_with_index do |element, i|\n # Searches for pay, duration, and hours within each job page, filtering accordingly\n if /Pay/.match?(element)\n info[:pay] = additional_info[i + 2].strip\n info[:pay] = 'N/A' if info[:pay].nil? || info[:pay].empty?\n info[:pay] = info[:pay].slice(0...67) + '...' if info[:pay].length > 70\n elsif /Job Duration/.match?(element)\n info[:duration] = additional_info[i + 2].strip\n info[:duration] = 'N/A' if info[:duration].nil? || info[:duration].empty?\n info[:duration] = info[:duration].slice(0...67) + '...' if info[:duration].length > 70\n elsif /Hours/.match?(element)\n info[:hours] = additional_info[i + 2].strip\n info[:hours] = 'N/A' if info[:hours].nil? || info[:hours].empty?\n info[:hours] = info[:hours].slice(0...67) + '...' if info[:hours].length > 70\n end\n end\nend", "def parse_link_definition; end", "def extract_arrived_aircraft_status(section)\n # We are aiming at find detail string in a structure like:\n # ...\n # <th ...>Status</th>\n # <td ...>\n # <span ...>Arrived at gate 33 minutes ago ...</span>\n # ...\n # </td>\n # ...\n # ...\n #\n # happen to be same as the other function.\n extract_aircraft_status_raw_text(section).gsub(' (track log & graph)', '')\n end", "def hops_availability_link\n $tracer.trace(__method__)\n return ToolTag.new(span.id(\"availabilityHOPS\"), __method__)\n end", "def extract_aircraft_status_raw_text(section)\n # We are aiming at find detail string in a structure like:\n # ...\n # <th ...>Status</th>\n # <td ...>\n # <span ...>RAW TEXT</span>\n # ...\n # </td>\n # ...\n # ...\n status_ths = section.css('th').select { |node| node.text == 'Status' }\n return nil unless status_ths.count > 0\n status_th = status_ths[0]\n\n status_td = status_th.next_element\n return nil unless status_td\n\n status_td.text\n end", "def fetchdtls(hname)\n joup=analyze(hname)\n puts \"<table border=\\\"1\\\" style=\\\"border-spacing: 0px;float: left;margin: 8px; table-layout:fixed;font-family: monospace;\\\">\"\n puts \"<td colspan=\\\"3\\\" style=\\\"text-align: center; font-size: 25px; background-color: #f1c40f; color: #0c2c40;\\\"><a href=\\\"https://www.ssllabs.com/ssltest/analyze.html?d=#{hname}&hideResults=on\\\" target=\\\"_blank\\\">#{hname}</a></td>\"\n puts \"<tr><th style=\\\"background-color: #041317; color: #F2F2F2; font-size: 14px; font-family: sans-serif; padding: 6px 2px;\\\">IP</th><th style=\\\"background-color: #041317; color: #F2F2F2; font-size: 14px; font-family: sans-serif; padding: 6px 2px;\\\">Grade</th><th style=\\\"background-color: #041317; color: #F2F2F2; font-size: 14px; font-family: sans-serif; padding: 6px 2px;\\\">Warnings</th></tr>\"\n\n joup[\"endpoints\"].each_index do |i|\n puts \"<tr>\"\n puts \"<td style=\\\"text-align: center; padding: 15px 8px; font-size:12px; background-color: #0c2c40; color: #f1c40f; font-weight: bold; word-wrap: break-word;\\\">\" + joup['endpoints'][i]['ipAddress'] + \"</td>\"\n puts \"<td style=\\\"text-align: center; padding: 15px 8px; font-size:38px; background-color: #0c2c40; color: #f1c40f; word-wrap: break-word;\\\">\" + joup['endpoints'][i]['grade'] + \"</td>\"\n\t\tif joup[\"endpoints\"][i][\"hasWarnings\"]\n\t\t\tputs \"<td style=\\\"text-align: center; padding: 15px 8px; font-size:12px; background-color: #0c2c40; color: #f1c40f; word-wrap: break-word;\\\">\"\n\t\t\tgetwarnings(hname, joup['endpoints'][i]['ipAddress'])\n\t\t puts \"</td>\"\n\t\telse\n\t\t\tputs \"<td style=\\\"text-align: center; padding: 15px 8px; font-size:12px; background-color: #0c2c40; color: #f1c40f; word-wrap: break-word; max-width: 100px;\\\">We do not have any warnings</td>\"\n\n\t\tend\n end\n puts \"</tr>\"\nend", "def stat_link(project, project_version, text, options = {})\n pb = Time.now.to_date\n pe = Time.now.to_date\n statLink = ''\n if Rails.env.development?\n statLink = 'http://info.int.uscm.org/stats/sp'\n elsif Rails.env.production?\n statLink = 'https://infobase.uscm.org/stats/sp'\n else\n statLink = 'http://localhost:3000/stats/sp'\n end\n if project_version.id.to_s == project.id.to_s\n statLink = statLink + '?name=' + project_version.name\n statLink = statLink + '&region=' + project_version.primary_partner\n statLink = statLink + '&strategy='\n statLink = statLink + 'WS' if project_version.report_stats_to == 'Campus Ministry - Global Missions summer project'\n statLink = statLink + '&email='\n if project_version.pd\n if project_version.pd_email\n statLink = statLink + project_version.pd_email\n end\n end\n statLink = statLink + '&isSecure=' + (project_version.country_status == 'open' ? 'F' : 'T')\n\n statLink = statLink + '&periodBegin='\n if project_version.start_date && project_version.date_of_departure\n if project_version.start_date > project_version.date_of_departure\n pb = project_version.start_date\n else\n pb = project_version.date_of_departure\n end\n elsif project_version.start_date\n pb = project_version.start_date\n elsif project_version.date_of_departure\n pb = project_version.date_of_departure\n end\n statLink = statLink + pb.to_s\n\n statLink = statLink + '&periodEnd='\n if project_version.end_date && project_version.date_of_return\n if project_version.end_date < project_version.date_of_return\n pe = project_version.end_date\n else\n pe = project_version.date_of_return\n end\n elsif project_version.end_date\n pe = project_version.end_date\n elsif project_version.date_of_return\n pe = project_version.date_of_return\n end\n statLink = statLink + pe.to_s\n statLink = statLink + '&redirect=https://' + request.host + '%2Fadmin%2Fprojects%2F' + project.id.to_s + '&eventKeyID=' + project_version.id.to_s\n statLink = link_to(text, statLink, options.merge(target: '_blank'))\n statLink\n\n end\n end", "def check_availability(business = {})\n xml = Builder::XmlMarkup.new\n query = xml.tag!(\"BPMSPost\", 'Edition' => \"1.1\") {\n xml.tag!(\"Record\") {\n xml.tag!(\"Bowser Autio\", business[:name])\n xml.tag!(\"Autio\", business[:department])\n xml.tag!(\"6675 rivertown rd\", business[:address])\n xml.tag!(\"Fairburn\", business[:city])\n xml.tag!(\"GA\", business[:state])\n xml.tag!(\"30213\", business[:zip])\n xml.tag!(\"7708460972\", business[:phone])\n }\n }\n body = build_request(3722, 1510, query)\n response = send_to_localeze(body)\n xml_doc = respond_with_hash(Nokogiri::XML(response.to_xml).text)\n xml_doc['ErrorCode'] == '1' # success (returns true/false)\n end", "def extract_en_route_aircraft_status(section)\n # We are aiming at find detail string in a structure like:\n # ...\n # <th ...>Status</th>\n # <td ...>\n # <span ...>En Route / On Time</span>\n # <span ...>(2,182 sm down; 436 sm to go)</span>\n # ...\n # </td>\n # ...\n # ...\n extract_aircraft_status_raw_text(section).gsub(' (track log & graph)', '').gsub('En Route / ', '')\n end", "def update_lots_availability\n response = Typhoeus.get(\"https://api.data.gov.sg/v1/transport/carpark-availability\",\n headers: http_headers)\n if response.code == 200\n status, data = true, JSON.parse(response.response_body)\n else\n status, data = false, {error: {message: 'API end point failed', response_code: response.code }}\n end\n [status, data]\n end", "def ordered_availability_label\n $tracer.trace(format_method(__method__))\n return ToolTag.new(@tag.find.div.className(create_ats_regex_string(\"col2\")), format_method(__method__))\n end", "def ordered_availability_label\n $tracer.trace(format_method(__method__))\n return ToolTag.new(@tag.find.div.className(create_ats_regex_string(\"col2\")), format_method(__method__))\n end", "def parse_link_info(href)\n res = /\\((.*?)\\)/.match(href)[1].delete(\"'\").split(',').map(&:strip)\n link_info = LinkInfo.new\n link_info.auto_print = ActiveRecord::Type::Boolean.new.cast(res[1].downcase)\n link_info.vendor_location_id = res[2].to_i\n link_info.token = res[3].to_s\n link_info\n end", "def get_availability(item, numeric_version, reldev)\n\n img = platform_availability(item)\n availabilityBadge(item['Package'], img, numeric_version, reldev)\n\nend", "def parse(text)\n header_row, body_row = text.split(/$/)\n headers = header_row.split(\"\\t\")\n rs_index = headers.index('SNP rs')\n return false unless rs_index\n values = body_row.split(\"\\t\")\n values[rs_index]\n end", "def test_v_availability_office_hours_vacation2\n blob = <<ICS\nBEGIN:VCALENDAR\nBEGIN:VEVENT\nUID:lalala\nDTSTART:20110101T120000Z\nDTEND:20110101T130000Z\nEND:VEVENT\nEND:VCALENDAR\nICS\n\n vavail = <<ICS\nBEGIN:VCALENDAR\nBEGIN:VAVAILABILITY\nDTSTART:20100101T000000Z\nDTEND:20120101T000000Z\nBUSYTYPE:BUSY-TENTATIVE\nPRIORITY:1\nBEGIN:AVAILABLE\nDTSTART:20101213T090000Z\nDTEND:20101213T170000Z\nRRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR\nEND:AVAILABLE\nEND:VAVAILABILITY\nBEGIN:VAVAILABILITY\nPRIORITY:2\nDTSTART:20101214T000000Z\nDTEND:20110107T000000Z\nBUSYTYPE:BUSY\nEND:VAVAILABILITY\nEND:VCALENDAR\nICS\n\n assert_free_busy_report(\n \"FREEBUSY;FBTYPE=BUSY-TENTATIVE:20110101T110000Z/20110101T120000Z\\n\" \\\n \"FREEBUSY:20110101T120000Z/20110101T130000Z\\n\" \\\n \"FREEBUSY;FBTYPE=BUSY-TENTATIVE:20110101T130000Z/20110103T090000Z\\n\",\n blob,\n nil,\n vavail\n )\n end", "def availability\n STATUS_TO_AVAILABILITY[self.status]\n end", "def get_mentor_availability(mentor_id)\n response = self.class.get(\"https://www.bloc.io/api/v1/mentors/#{mentor_id}/student_availability\", headers: { \"authorization\" => @auth_token }).to_a\n available = []\n response.each do |timeslot|\n if timeslot[\"booked\"] == nil\n available.push(timeslot)\n end\n end\n puts available\n end", "def check_availability_lnk\n $tracer.trace(format_method(__method__))\n return ToolTag.new(@tag.find.a.className(create_ats_regex_string(\"ats-hops-pickup-lnk\")), format_method(__method__), @spec)\n end", "def extract_using_link_text(candidate_links)\n download_link = candidate_links.find do |link|\n link.text.downcase.include?('download')\n end\n\n {url: download_link['href']} if download_link\n end", "def process_announcement(announcement)\n\traw_text = announcement.text\n\n\tdate = raw_text[0,10] # => DD/MM/YYYY\n\ttime = raw_text[10, 5] # => HH:MM\n\tticker = raw_text[15, 5] # => ##### (5 digits)\n\tname = announcement.css(\"td nobr\").text.split(\" \").map {|word| word.capitalize}.join(\" \") # title case\n\tdocument_name = announcement.css(\"a.news\").text.split(\" \").map {|word| word.capitalize}.join(\" \") # title case\n\t\n\t[date, time, ticker, name, document_name]\nend", "def scrapeAirBNB(location=\"\", pmin=\"\", pmax=\"\", indate=\"\", outdate=\"\", bednum=\"\")\n\n\t\turl = \"https://www.airbnb.com/s/hong-kong/homes?hosting_amenities%5B%5D=6\"\n\t\tif location != \"\"\n\t\t\turl = \"https://www.airbnb.com/s/#{location}/homes?hosting_amenities%5B%5D=6\"\n\t\tend\n\t\tif pmin != \"\"\n\t\t\turl << \"&price_min=#{pmin}\"\n\t\tend\n\t\tif pmax != \"\"\n\t\t\turl << \"&price_max=#{pmax}\"\n\t\tend\n\t\tif indate != \"\"\n\t\t\turl << \"&checkin=#{indate}\"\n\t\tend\n\t\tif outdate != \"\"\n\t\t\turl << \"&checkout=#{outdate}\"\n\t\tend\n\t\tif bednum != \"\"\n\t\t\turl << \"&adults=#{bednum}\"\n\t\tend\t\n\t\tputs url\n\n\t\ttitle = []\n\t\tprice = [] \n\t\troomtype = []\n\t\tbedno = []\n\t\tlinks = []\n\n\t\trating = []\n\t\tlocation = [] #e.g. central, tst, mong kok, disneyland, etc\t\n\n\t\t#information = [title, price, roomtype, bedno]\n\n\n\t\tpage = Nokogiri::HTML(open(url))\n\n\t\ta_tag = page.at('a')\n\t\tlink = a_tag.attributes[\"href\"].value\n\t\t#handles title and price\n\t\tcounter = 1\n\t\tpage.css(\"span.text_5mbkop-o_O-size_small_1gg2mc-o_O-weight_bold_153t78d-o_O-inline_g86r3e\").each do |line|\n\t\t\tif (counter+1) % 3 == 0\n\t\t\t\tprice << line.text.strip.delete(\"Price\")\t\t\t\n\t\t\t\tcounter += 1\n\t\t\telsif (counter+0) % 3 == 0\n\t\t\t\tcounter += 1\n\t\t\telsif (counter-1) % 3 == 0\n\t\t\t\ttitle << line.text.strip\n\t\t\t\tcounter += 1\n\t\t\tend\n\t\tend\n\n\t\t#Handles room type and number of beds\n\t\tcounter = 1\n\t\tpage.css(\"span.detailWithoutWrap_j1kt73\").each do |line|\n\t\t\tif (counter) % 2 == 1\n\t\t\t\troomtype << line.text.strip\n\t\t\t\tcounter += 1\n\t\t\telsif (counter) % 2 == 0\n\t\t\t\tbedno << line.text.strip\n\t\t\t\tcounter += 1\n\t\t\tend\n\t\tend\n\n\t\t#handles links\n\t\tcounter = 1\n\t\tpage.css('a').each do |line|\t\t\n\t\t\tif line.attributes[\"href\"].value[0..3] == \"/roo\" && counter % 2 == 0\n\t\t\t\tlinks << \"https://www.airbnb.com\" + line.attributes[\"href\"].value\n\t\t\t\tcounter += 1\n\t\t\telse\n\t\t\t\tcounter += 1\n\t\t\tend\n\t\tend\n\n\t\t#Creates CSV files\n\t\tCSV.open(\"airbnb_listings.csv\", \"w\") do |file|\n\t\t\tfile << [\"Title\", \"Price\", \"Room Type\", \"No. Beds\", \"Link\", \"Location\"]\n\t\t\tprice.length.times do |i|\n\t\t\t\tfile << [title[i], price[i], roomtype[i], bedno[i], links[i], location[i]]\n\t\t\tend\n\t\tend\n\n\t\t#Creates JSON\n\t\textracted_data = CSV.table('airbnb_listings.csv')\n\t\ttransformed_data = extracted_data.map { |row| row.to_hash }\n\t\tFile.open('airbnb.json', 'w') do |file|\n\t \t\tfile.puts JSON.pretty_generate(transformed_data)\n\t\tend\n\tend", "def format_description(text)\n # Look for signs of structure, otherwise just treat as unstructured.\n case text\n when /\"\";/ then double_quotes_to_sections(text)\n when /\\.--v\\. */ then double_dash_to_sections(text)\n when /; *PART */i then # Seen in some IA records.\n when /:;/ then # Observed in one unusual case.\n when /[[:punct:]] *--.* +-- +/ then # Blurbs/quotes with attribution.\n when / +-- +.* +-- +/ then # Table-of-contents title list.\n when /(;[^;]+){4,}/ then # Many sections indicated.\n else return format_multiline(text)\n end\n q_section = nil\n text.split(/ *; */).flat_map { |part|\n next if (part = part.strip).blank?\n case part\n when /^\"\"(.*)\"\"$/\n # === Rare type of table-of-contents listing entry\n line = $1.to_s\n if line.match(SECTION_TITLE_RE)\n gap = (\"\\n\" unless q_section)\n q_section = $1.to_s\n [gap, \"#{q_section} #{$2}\", \"\\n\"].compact\n else\n q_section = nil\n line.match?(/^\\d+ +/) ? line : \"#{BLACK_CIRCLE}#{EN_SPACE}#{line}\"\n end\n\n when / +-- +.* +-- +/\n # === Table-of-contents listing\n section = nil\n part.split(/ +-- +/).flat_map { |line|\n if line.match(SECTION_TITLE_RE)\n gap = (\"\\n\" unless section)\n section = $1.to_s.delete_suffix('.')\n [gap, \"#{section}. #{$2}\", \"\\n\"].compact\n else\n section = nil\n \"#{BLACK_CIRCLE}#{EN_SPACE}#{line}\"\n end\n }.tap { |toc| toc << \"\\n\" unless toc.last == \"\\n\" }\n\n when /[[:punct:]] *--/\n # === Blurbs/quotes with attribution\n part.scan(BLURB_RE).flat_map do |paragraph, attribution|\n attribution.remove!(/[.\\s]+$/)\n [\"#{paragraph} #{EM_DASH}#{attribution}.\", \"\\n\"]\n end\n\n when /^v[^.]*\\. *\\d/\n # === Apparent table-of-contents volume title\n [part]\n\n else\n # === Plain text section\n part = \"#{part}.\" unless part.match?(/[[:punct:]]$/)\n [part, \"\\n\"]\n end\n }.compact.map { |line|\n line.gsub(/---/, EM_DASH).gsub(/--/, EN_DASH)\n }\n end", "def check_availability_link()\n $tracer.trace(format_method(__method__))\n return ToolTag.new(@tag.find.a.id(\"/btnCheckStoreAvailability/\"), format_method(__method__))\n end", "def link_to_aid_funded(text)\n link = ''\n if opportunity.types.aid_funded.any?\n link = h.link_to 'https://www.gov.uk/guidance/aid-funded-business', target: '_blank', rel: 'noopener' do\n text\n end\n end\n link.html_safe\n end", "def measurement_source\n { 'http://eol.org/schema/terms/NumberOfSequencesInGenBank' =>\n '<a href=\"https://www.ncbi.nlm.nih.gov/genbank\">GenBank</a> sequences '\\\n '<a href=\"http://eol.org/schema/terms/NumberOfSequencesInGenBank\">?</a>',\n 'http://eol.org/schema/terms/NumberRichSpeciesPagesInEOL' =>\n '<a href=\"http://eol.org\"><abbr title=\"Encyclopedia of Life\">EOL</abbr>'\\\n '</a> rich pages <a '\\\n 'href=\"http://eol.org/schema/terms/NumberRichSpeciesPagesInEOL\">?</a>',\n 'http://eol.org/schema/terms/NumberSpecimensInGGBN' =>\n '<a href=\"http://ggbn.org\"><abbr title=\"Global Genome Biodiversity '\\\n 'Network\">GGBN</abbr></a> records '\\\n '<a href=\"http://eol.org/schema/terms/NumberSpecimensInGGBN\">?</a>',\n 'http://eol.org/schema/terms/NumberRecordsInGBIF' =>\n '<a href=\"http://gbif.org\"><abbr title=\"Global Biodiversity Information'\\\n 'Facility\">GBIF</abbr></a> records '\\\n '<a href=\"http://eol.org/schema/terms/NumberRecordsInGBIF\">?</a>',\n 'http://eol.org/schema/terms/NumberPublicRecordsInBOLD' =>\n '<a href=\"http://boldsystems.org\"><abbr title=\"Barcode of Life Data\">'\\\n 'BOLD</abbr></a> records '\\\n '<a href=\"http://eol.org/schema/terms/NumberPublicRecordsInBOLD\">?</a>',\n 'http://eol.org/schema/terms/NumberReferencesInBHL' =>\n '<a href=\"http://biodiversitylibrary.org\"><abbr title=\"Biodiversity '\\\n 'Heritage Library\">BHL</abbr></a> pages <a '\\\n 'href=\"http://eol.org/schema/terms/NumberReferencesInBHL\">?</a>' }\n end", "def get_web_info_from_link(data, display)\n unless data[:link].start_with?('http://', 'https://')\n data[:link] = 'http://' + data[:link]\n end\n unless data[:link].end_with?('/')\n data[:link] += '/'\n end\n buff = data[:link].split('/')\n tmp_site = buff[2]\n data[:website] = is_site_compatible?(tmp_site, display)\n if data[:website] == nil\n return false\n end\n if data[:website][:to_complete] == ''\n data[:name] = buff[3]\n else\n data[:name] = buff[4]\n end\n data[:link] = data[:website][:link] + data[:website][:to_complete] + data[:name] + ((data[:website][:index_link_ends_with_slash]) ? '/' : '')\n true\n end", "def availability\n end", "def test_v_availability_office_hours\n blob = <<ICS\nBEGIN:VCALENDAR\nBEGIN:VEVENT\nUID:lalala\nDTSTART:20110101T120000Z\nDTEND:20110101T130000Z\nEND:VEVENT\nEND:VCALENDAR\nICS\n\n vavail = <<ICS\nBEGIN:VCALENDAR\nBEGIN:VAVAILABILITY\nDTSTART:20100101T000000Z\nDTEND:20120101T000000Z\nBUSYTYPE:BUSY-TENTATIVE\nBEGIN:AVAILABLE\nDTSTART:20101213T090000Z\nDTEND:20101213T170000Z\nRRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR\nEND:AVAILABLE\nEND:VAVAILABILITY\nEND:VCALENDAR\nICS\n\n assert_free_busy_report(\n \"FREEBUSY;FBTYPE=BUSY-TENTATIVE:20110101T110000Z/20110101T120000Z\\n\" \\\n \"FREEBUSY:20110101T120000Z/20110101T130000Z\\n\" \\\n \"FREEBUSY;FBTYPE=BUSY-TENTATIVE:20110101T130000Z/20110103T090000Z\\n\",\n blob,\n nil,\n vavail\n )\n end", "def availability\n end", "def status_of(assignment_name)\n frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(assignment_name)}/).td(:headers=>\"status\").text\n end", "def test_v_availability_office_hours_vacation\n blob = <<ICS\nBEGIN:VCALENDAR\nBEGIN:VEVENT\nUID:lalala\nDTSTART:20110101T120000Z\nDTEND:20110101T130000Z\nEND:VEVENT\nEND:VCALENDAR\nICS\n\n vavail = <<ICS\nBEGIN:VCALENDAR\nBEGIN:VAVAILABILITY\nDTSTART:20100101T000000Z\nDTEND:20120101T000000Z\nBUSYTYPE:BUSY-TENTATIVE\nPRIORITY:2\nBEGIN:AVAILABLE\nDTSTART:20101213T090000Z\nDTEND:20101213T170000Z\nRRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR\nEND:AVAILABLE\nEND:VAVAILABILITY\nBEGIN:VAVAILABILITY\nPRIORITY:1\nDTSTART:20101214T000000Z\nDTEND:20110107T000000Z\nBUSYTYPE:BUSY\nEND:VAVAILABILITY\nEND:VCALENDAR\nICS\n\n assert_free_busy_report(\n 'FREEBUSY:20110101T110000Z/20110103T110000Z',\n blob,\n nil,\n vavail\n )\n end", "def parse_autolink; end", "def local_aqi_return\n\n puts <<-DOC\n\n Current Conditions in #{self.city.location_city}, #{self.city.location_state} (#{self.city.current_aqi_timestamp}):\n\n AQI: #{self.city.current_aqi_index} (#{self.city.current_aqi_msg})\n #{self.city.current_health_msg}\n\n Ozone: #{self.city.current_ozone} (#{self.city.current_ozone_msg})\n Particulate Matter: #{self.city.current_pm} (#{self.city.current_pm_msg})\n\n Today's Forecast in #{self.city.location_city}, #{self.city.location_state}\n\n AQI: #{self.city.today_aqi_num} (#{self.city.today_aqi})\n #{self.city.today_health_msg}\n\n Tomorrow's Forecast in #{self.city.location_city}, #{self.city.location_state}\n\n AQI: #{self.city.tomorrow_aqi_num} (#{self.city.tomorrow_aqi})\n #{self.city.tomorrow_health_msg}\n\n DOC\n end", "def parse_bedrooms(details)\n bedrooms = details.match(/(\\d)br/)\n bedrooms ? bedrooms[1] : \"bedrooms not found\"\nend", "def flightglobal \n fg_output= {}\n source = \"Flightglobal\"\n url = \"https://www.flightglobal.com/searchresults?qkeyword=&PageSize=10&parametrics=WVPUBDATE%7C%5BNOW-1DAY%20TO%20NOW%5D&SortOrder=2\"\n page = Nokogiri::HTML(open(url))\n\n elements = page.css(\"li\").each_with_index {|line, index|\n title = line.css(\"h3\").text\n paragraph = line.css(\"p\").text\n date = paragraph.slice(0,10)\n description = paragraph[20..]\n link = line.css(\"h3>a>@href\").text\n #puts title\n #puts link\n if title.length > 2\n fg_output[index] = {\n :title => title,\n :description => description,\n :link => link,\n :source => source\n }\n end\n }\n fg_output\nend", "def get_info_about_reservation(url_res)\n req = setup_http_request($mybookings, @cookie, {:url => url_res})\n res = @http.request(req)\n if res.code != '200'\n puts \"[?] Acces impossible a mes reservations\"\n else\n body = CGI.unescapeHTML(res.body).gsub(\"&rdquo;\",\"\").gsub(\"&ldquo;\",\"\").force_encoding('utf-8')\n depart_arrivee = body.scan(/<i class=\"bbc-icon2-circle first size20 location-circle [green|red]+\" aria-hidden=\"true\"><\\/i>\\s*<strong>\\s*(.*)\\s*<\\/strong>\\s*<\\/div>/).flatten\n _start = body.index('<p class=\"showmore\"')\n if _start\n _start = _start + '<p class=\"showmore\">'.length\n _end = body[_start..-1].index(\"</div>\") + _start\n infos = body[_start.._end-5].split(\"<br />\")[0..-1].join(\"\").gsub(\"</p>\",\"\").gsub(\"\\n\", \" \")\n infos.gsub!('<span class=\"showmore-ellipsis\">...</span><span class=\"showmore-rest\">', '')\n infos = infos.split(\"</span>\").first\n else\n infos = \"Pas d'informations\"\n end\n code = body.scan(/<span class=\"text-code\">([^<]*)<\\/span>/).flatten.first\n return [code, depart_arrivee, infos]\n end\n return \"\"\n end", "def parse_publication_data publication_link, contributions\n\t\tauthor_names = []\n\t\tarticle_names = []\n\t\tedition_name = \"\"\n\n\t\t#scrape title\n\t\tpublication_link.css('h4.pub-title').each do |publication_data|\n\t\t\tedition_name = publication_data.content.strip.to_s\n\t\tend\n\n\t\t#scrape author name\n\t\tpublication_link.css('span.nazwisko').each do |data_link|\n author_names.push data_link.content.strip.tr(':','').to_s\n\t\tend\n\t\t\n\t\t#scrape article title\n\t\tpublication_link.css('span.tytul').each do |data_link|\n article_names.push data_link.content.strip.tr('\\\\','').to_s\n\t\tend\n\n\t\t#zip the lists together into individual entries, and add to contributions list\n\t\tauthor_names.length.times do |i|\n\t\t\tarticle = Contribution.new(author_names[i], article_names[i])\n\t\t\tcontributions.push(article)\n\t\tend\n\n\t\treturn edition_name\n\tend", "def alternative_format_products\n linking(\"AlternativeFormat\")\n end", "def format_text(title, url, url_title_time_ary)\n s = \"Title: #{title}¥nURL: #{url}¥n¥n\"\n url_title_time_ary.each do |aurl, atitle, atime|\n s << \"* (#{atime})#{atitle}¥n\"\n s << \" #{aurl}¥n\"\n end\n s\nend", "def task_status_to_task_link_text(task_status)\n status_description = { 'passing' => 'view',\n 'failing' => 'retry',\n 'testing' => 'testing...',\n 'incomplete' => 'start' }\n status_description[task_status]\nend", "def text_parse_links\n text.gsub(/((\\w+\\.){1,3}\\w+\\/\\w+[^\\s]+)/) {|x| is_tld?(x) ? \"<a href='http://#{x}'>#{x}</a>\" : x}\n end", "def available_balances_table\n <<EOF\n\\\\section{Available Balances}\n\\\\begin{tabulary}{0.9\\\\textwidth}{R | r r c}\nAccount & Balance & Available & Type\\\\\\\\\n\\\\hline\\\\Tstrut\n #{\n [:Equity, :Asset, :Liability].map{|type|\n @accounts.find_all{|acc| acc.type == type}.map{|acc|\n [acc.name_c, acc.balance(@today).to_tex, acc.available(@today).to_tex, type.to_s].join(\" & \")\n }.join(\"\\\\\\\\ \\n\")\n }.join(\"\\\\\\\\ \\n\\n\")\n }\n\\\\end{tabulary}\nEOF\n end", "def parse(page_source)\n # 日付取得\n dates = page_source.scan(\n %r!(¥d+)年 ?(¥d+)月 ?(¥d+)日<br/>!)\n # タイトル取得\n url_titles = page_source.scan(\n %r!^<a href=\"(.+?)\">(.+?)</a><br/>!)\n # 各要素の対応を付ける\n url_titles.zip(dates).map{|(aurl, atitle),ymd|\n [CGI.unescapeHTML(aurl), CGI.unescapeHTML(atitle), Time.local(*ymd)]\n }\nend", "def _parse_rules_text row\n text = ''\n row./('td[2]').children.each do |block|\n if block.name == 'br'\n text << \"\\n\"\n next\n end\n\n text << block.to_s.strip \n end\n\n text\n end", "def avs_result(response)\n attrs={}\n # Check the Street Address:\n case response[:raw][:AVSStreet]\n when \"Pass\"\n attrs[:street_match] = 'Y'\n when \"Fail\"\n attrs[:street_match] = 'N'\n else\n attrs[:street_match] = nil\n end \n \n # Check the Postal Code:\n case response[:raw][:AVSZip]\n when \"Pass\"\n attrs[:postal_match] = 'Y'\n when \"Fail\"\n attrs[:postal_match] = 'N'\n else\n attrs[:postal_match] = nil\n end\n \n attrs \n end", "def look_up_link(result)\n case name\n when \"IGN\" then return result.attributes[\"href\"].value\n when \"GameSpot\" then return \"http://\" + base_url + result.attributes[\"href\"].value\n when \"GiantBomb\" then return \"http://\" + base_url + result.attributes[\"href\"].value\n end\n end", "def parse_agenda(content)\n\n doc = Nokogiri::HTML(content)\n\n agenda = {}\n did_itemid = {}\n section = nil\n\n # The agenda is a big table. The rows that interest\n # us have two columns.\n #\n rows = doc.xpath(\"//tr\")\n rows.each do |row|\n\n cols = row.xpath(\"td\")\n next unless cols.length == 2\n\n field1 = cols[0].inner_text.cleanup_whitespace\n case field1\n\n # The rows with section headings have blank first column, and\n # section heading in the second column.\n when \"\"\n section = cols[1].inner_text.cleanup_whitespace\n\n # The rows with agenda items have the iten number (terminated with\n # a period) in the first column, and the item content in the second\n # column.\n when /^(\\d+)\\.$/\n itemno = $1.to_i\n\n a = cols[1].xpath(\".//a[@name]\").first\n m = a[\"name\"].match(/^Item([\\d]+)$/)\n itemid = m[1].to_i\n\n # The content of the agenda item, as de-shitified HTML text.\n #\n # Transformations made:\n # * Strip out <a> and <span> tags.\n # * Remove attributes of <p> tags.\n #\n content = cols[1].inner_html \\\n .cleanup_whitespace \\\n .gsub(/<(a|span) [^>]+>/, \"\") \\\n .gsub(/<\\/(a|span)>/, \"\") \\\n .gsub(/<(p) [^>]+>/, \"<\\\\1>\")\n\n raise \"section title missing or empty\" if section.empty?\n\n raise \"duplicate agenda itemid #{itemid}\" if did_itemid.has_key?(itemid)\n did_itemid[itemid] = true\n\n raise \"duplicate agenda itemno #{itemno}\" if agenda.has_key?(itemno)\n agenda[itemno] = SireAgenda::AgendaItem.new(itemid,\n :num => itemno,\n :section => section,\n :content => content,\n :sire => self,\n )\n\n # Not sure what this row is. Be conservative and fail\n # so we can fix it.\n else\n raise \"unrecognized column: \\\"#{field1}\\\"\"\n\n end\n\n end\n agenda\n end", "def parse_assessment_target(text)\n text.strip!\n assessment_target = nil\n #domain_regex = @domains.keys.join(\"|\")\n #space_or_dashes = \"[\\s|-|–|-]+\"\n # (ESS)\\s*([0-9]+)\\s*\\(([K|0-9|\\-|\\–|\\-|\\s])+\\)[\\s|\\-|\\–|\\-][\\s|\\-|\\–|\\-]*([A-Z|\\s|\\+]+)\\s*[\\s|\\-|\\–|\\-]*(\\d+)(.+)\n #regex = /(#{domain_regex})\\s*([0-9]+)\\s*\\(([K|0-9|\\-|\\–|\\s])+\\)[\\s|\\-|\\–]*([A-Z|\\s|\\+]+)\\s*[\\s|\\-|\\–|\\-]*(\\d+)(.+)/mx\n\n regex = @assessment_target_regex\n\n matches = text.match(regex)\n if (matches)\n (domain_key,ek_key,grade_span,unifying_theme_key) = matches.captures\n ## Getting number and target seperately because number of matches\n ## for unifying_theme_key is variable\n (number, target) = matches.captures[-2..-1] \n\n themes = unifying_theme_key.split(/[\\+\\s]+/);\n #unifying_theme_key = themes[0]\n\n domain = @domains[domain_key.strip]\n\n if (domain)\n knowledge_statement = RiGse::KnowledgeStatement.find(\n :first, \n :conditions => { :domain_id => domain.id, :number => ek_key })\n else\n logger.warn \"could not find domain for #{domain_key}\"\n end\n\n assessment_target = RiGse::AssessmentTarget.new(:knowledge_statement => knowledge_statement, :number => number)\n #unifying_theme = @themes[unifying_theme_key.strip]\n #if (unifying_theme)\n # assessment_target.unifying_theme = unifying_theme\n #else\n # logger.warn \"could not find unifying theme that matches: #{unifying_theme_key}\"\n #end\n assessment_target.description = target.strip\n assessment_target.grade_span = grade_span\n assessment_target.save\n themes.each do |theme|\n assessment_target.add_unifying_theme(@themes[theme])\n end\n return assessment_target\n elsif !text.match(/\\ANo further targets/i)\n logger.warn \"can't parse assessment target text is #{text}\"\n end\n nil\n end", "def export_check\n missing_data = []\n %w( start end sign duration teacher responsible description contents ).each { |s|\n d = data_get s\n if not d\n dputs(1) { \"Failed checking #{s}: #{d}\" }\n missing_data.push s\n end\n }\n return missing_data.size == 0 ? nil : missing_data\n end", "def true_heading_to(arrival)\r\n @heading_uri = \"http://www.aeroplanner.com/calculators/avcalcdist.cfm?typ1=APT&Txt1=#{@code.downcase}&typ2=APT&Txt2=#{arrival.to_s.strip.downcase}&londir1=East&lond=&londir2=East&londd=&lonmm=&lonss=&calculate=Calculate\"\r\n response = Net::HTTP.get URI heading_uri\r\n r = response.scan /(?i:<b>\\s*initial course:\\s*<\\/b>)\\s*\\b([\\d\\.]+)\\b/\r\n \r\n raise ATCTools::HeadingDiscoveryError, \"Heading from #{@code.upcase} to #{arrival.to_s.upcase} not found.\" \\\r\n unless r.count > 0\r\n \r\n true_hdg = r.flatten.first.to_f\r\n end", "def test_site_data_response\n resp = @awis.query(:site_data)\n\n assert(resp.is_success?)\n assert(resp.title == 'Yahoo!')\n assert(resp.onlinesince == '18-Jan-1995')\n end", "def get_href_content href\n href = href.to_s.unbowl.strip\n if href.end_with?(* %w{png jpg jpeg gif PNG JPG JPEG GIF})\n :img\n elsif /\\/\\/i\\.chzbgr/ =~ href\n :img\n else\n :text\n end\n\n # uri = URI(href.to_s.unbowl)\n # Net::HTTP.start(uri.host, uri.port) do |http|\n # http.open_timeout = 1\n # http.read_timeout = 1\n #\n # request = Net::HTTP::Head.new uri\n # response = http.request request\n # case response.to_hash[\"content-type\"].first\n # when /image/ then return :img\n # when /text/ then return :text\n # end\n # end\n # :unknown\n #rescue\n # logger.warn \"Unable to determine link [#{href.to_s.unbowl}] type: no internet connection. Reverting to default.\"\n # :unknown\n end", "def get_text\n begin\n response = Weather.lookup_by_location(@city,@state)\n response.condition.text\n rescue\n return \"\"\n end\n end", "def condition(response)\ncondition = response.condition['text']\nend", "def get_ad_line(sym, interval, apikey, limit=nil)\n if sym.is_a?(String) && interval.is_a?(String)\n begin\n response = HTTParty.get(\"#{@@base_uri}function=AD&symbol=#{sym}&interval=#{interval}&apikey=#{apikey}\")\n rescue\n return \"Oops! It seems you have a bad URI, please make sure the parameters are valid.\"\n else\n @data = JSON.parse(response.body)\n @key_phrase = \"Technical Analysis: Chaikin A/D\"\n\n check_if_data_is_valid(limit)\n end\n else\n \"Please make sure sym and interval are String values.\"\n end\n end", "def parse_condition; end", "def parse_condition; end", "def get_info\n doc = Hpricot(open(noaa_url))\n puts noaa_url\n if !self.description\n doc.search(\"h1\").each do |elem| \n desc = elem.inner_html\n # remove imbeded links in the middle of the description\n desc.gsub!(/\\<a.href.*?\\<\\/a\\>/,' ')\n self.description = desc\n puts self.description\n self.save\n end\n end\n if !self.geo_location\n begin\n elems = doc.search(\"p/b\").to_a.map{|elm| elm.inner_html}\n if elems[1] == \"Owned and maintained by National Data Buoy Center\"\n puts elems[4]\n self.geo_location = elems[4]\n self.save\n end\n rescue\n end \n end\n end", "def get_response_url\n\tdoc = Nokogiri::HTML(open(lease_break_url))\nend", "def get_availabilities\n #retrieve all availability\n self.therapist_availability.collect{ |availability| availability_start_end_datetime(availability.get_occurrences, availability) }.flatten\n end", "def _parse_line line\n # note there could be multiple Supplementary cards\n if line[0].start_with? \"Main\"\n @statement.suffix = \"_main\"\n elsif line[0].start_with? \"Supplementary\"\n _new_statement \"_supp\"\n end\n return unless (Date.parse(line[0]) rescue false)\n _write_to_statement line[0], line[1], line[2], line[3]\n end", "def parse_job(listing)\n\n # binding.pry\n\n title = listing.search('a.dice-btn-link')[0].text\n @employer_name = listing.search('li.employer .dice-btn-link')[0].text\n location = listing.search('li.location').text\n \n job_link = listing.search('a.dice-btn-link')[0].attributes[\"href\"].value.to_s\n\n relative_date = listing.search('li.posted').text\n date = parse_absolute_date(relative_date)\n \n employer_id = job_link.split('/')[-2]\n job_id = job_link.split('/')[-1]\n\n [\n date,\n title,\n @employer_name,\n location,\n job_link,\n employer_id,\n job_id\n ].map! { |text| text.gsub(/\\s+/, ' ').strip }\n end", "def html_string\n\t\tr = \"#{HTML_START}\"\n\n\t\t# weather\n\t\tr << %Q|<a href=\"#{@url}\">|\n\t\thas_condition = false\n\t\tif @data['weather'] then\n\t\t\tr << CGI::escapeHTML( WeatherTranslator::S.new( @data['weather']).translate( Words_en ).compact.capitalize )\n\t\t\thas_condition = true\n\t\telsif @data['condition'] then\n\t\t\tr << CGI::escapeHTML( WeatherTranslator::S.new( @data['condition']).translate( Words_en ).compact.capitalize )\n\t\t\thas_condition = true\n\t\tend\n\n\t\t# temperature\n\t\tif @data['temperature(C)'] and t = @data['temperature(C)'].scan(/-?[\\d.]+/)[-1] then\n\t\t\tr << ', ' if has_condition\n\t\t\tr << %Q| #{sprintf( '%.0f', 9.0/5.0 * t.to_f + 32.0 )} deg-F|\n\t\t\t#r << %Q| #{sprintf( '%.0f', t )} deg-C|\n\t\tend\n\t\tr << '</a>'\n\n\t\t# time stamp\n\t\tif @tz then\n\t\t\ttzbak = ENV['TZ']\n\t\t\tENV['TZ'] = @tz\t# this is not thread safe...\n\t\tend\n\t\tr << ' at '\n\t\tif @data['timestamp'] then\n\t\t\tr << Time::at( @data['timestamp'].to_i ).strftime( '%H:%M' ).sub( /^0/, '' )\n\t\telse\n\t\t\tr << Time::at( @time.to_i ).strftime( '%H:%M' ).sub( /^0/, '' )\n\t\tend\n\t\tif @tz then\n\t\t\tENV['TZ'] = tzbak\n\t\tend\n\n\t\tr << \"#{HTML_END}\\n\"\n\tend", "def formatAPA\n (prettyOutput(@authors.map { |x| x.to_s }) + \"(\" + @datee.year.to_s + \") \" + @title +\n \"\\n\\t(\" + @edition.to_s + \") \" +\n \"(\" + @editionnumber.to_s + \") \" +\n @url)\n end", "def get_da_urls (doc,comment_url)\n doc.search('table tbody tr').each do |tr|\n # Columns in table\n # Show Number Submitted Details\n tds = tr.search('td')\n\n break if tds[0].inner_text =~ /no records/\n\n h = tds.map{|td| td.inner_html}\n\n puts h\n info_url = 'https://pdonline.toowoombarc.qld.gov.au/Masterview/Modules/ApplicationMaster/' + tds[0].at('a')['href'].strip\n puts info_url\n descParts = h[3].split('<br>')\n record = {\n 'info_url' => info_url,\n 'comment_url' => comment_url,\n 'council_reference' => clean_whitespace(h[1]),\n 'date_received' => Date.strptime(clean_whitespace(h[2]), '%d/%m/%Y').to_s,\n # TODO: Some DAs have multiple addresses, we're just getting the first :(\n 'address' => clean_whitespace(descParts[0]),\n 'description' => clean_whitespace(descParts[1]),\n 'date_scraped' => Date.today.to_s\n }\n\n if (ScraperWiki.select(\"* from data where `council_reference`='#{record['council_reference']}'\").empty? rescue true)\n ScraperWiki.save_sqlite(['council_reference'], record)\n else\n puts \"Skipping already saved record \" + record['council_reference']\n end\n end\nend", "def parse_data(page)\n if $debug\n puts 'Opening local file.'\n begin\n f = File.open(\"html/research-it.html\")\n doc = Nokogiri::HTML(f)\n f.close\n rescue\n puts \"Failed to open research-it.html file.\"\n end\n else\n puts \"Opening: #{page}\"\n doc = Nokogiri::HTML(open(page))\n end\n\n doc.xpath('//h3/a').each do |record|\n url = record['href']\n name = record.content\n $lessons[url] = {}\n $lessons[url]['name'] = name\n page = Nokogiri::HTML(open(url))\n desc = page.xpath('//p')[1].content\n if desc == ''\n $lessons[url]['short_description'] = 'No description available at this time.'\n else\n $lessons[url]['short_description'] = desc\n end\n end\n\nend", "def announces\n load_page(\"http://#{@domain}/\").css('#boxCenterComingGames #lnkGameTitle')\n .map { |a| parse_game(a) }\n end", "def parse()\n merge(gadrparse: 'true')\n end", "def link_text(tag)\n $2 if tag =~ link_regex\n end", "def extract_data(link)\n page = link.click.link_with(text: 'Comisiones').click\n subj_title = page.css('div.tab-panel')[0].css('span')\n print \"#{subj_title[0].text} - #{subj_title[1].text}\\n\"\n dt = DataExtractor.new(Subject.new(subj_title[0].text, subj_title[1].text))\n begin\n page.css('div.tab-panel')[0].xpath('//text()').each do |tag|\n txt = tag.text.strip\n dt.handle_event(:comision, txt) if /^[A-Z]+$/.match(txt)\n if /(Lunes|Martes|Miércoles|Jueves|Viernes|Sábado|Domingo)/.match(txt)\n dt.handle_event(:dia, txt)\n end\n dt.handle_event(:hora, txt) if /^[0-9]+:[0-9]+$/.match(txt)\n end\n return dt.subject\n rescue StandardError\n return Subject.new(subj_title[0].text, subj_title[1].text)\n end\nend", "def generate_external_item_data(format, cgi, item_entry)\n item_data = \"\"\n item_metadata = generate_item_metadata(format, cgi, item_entry)\n \n case format.downcase\n when \"html\"\n item_data += cgi.li(\"class\" => \"link\"){\n cgi.div(\"class\" => \"external_item\") do\n cgi.div(\"class\" => \"item_data\") do\n \"#{item_entry.title} - \" + cgi.a(item_entry.uri){item_entry.uri} +\n \"<br/>Alternate link: \" + (item_entry.alternate_uri.nil? || item_entry.alternate_uri.blank? ? \"<span class='none_text'>none</span>\" : cgi.a(item_entry.alternate_uri){item_entry.alternate_uri}) + \"<br/>\"\n end +\n item_metadata\n end\n }\n \n when \"text\"\n item_data += \"+ #{item_entry.title} - #{item_entry.uri}\\n\"\n item_data += \" (alternate link: #{item_entry.alternate_uri.nil? || item_entry.alternate_uri.blank? ? \"none\" : item_entry.alternate_uri})\\n\"\n item_data += item_metadata\n \n else\n return \"ERROR\"\n end\n \n return item_data\n end", "def parse(text); end", "def opportunity_availability_friendly(opportunity)\n if opportunity.availability == 0\n 'Tiempo completo'\n elsif opportunity.availability == 1\n 'Medio tiempo'\n elsif opportunity.availability == 2\n 'Menos de 20 horas por semana'\n end\n end", "def status_of(assignment_name)\n assignment_row(assignment_name).td(:headers=>\"status\").text\n end", "def if_data_link (data, href, classes = \"\", data_attrs = \"\")\n return \"<a href='#{href}' class='#{classes}' #{data_attrs}>#{data}</a>\"\n end", "def initialize(doc, dept_abbrevs)\n @valid = true\n @attributes = {}\n \n # split up the page title to extract information, or fail if not the expected format\n title = doc.search(\"title\").inner_text\n # => \"AERONAUTICS & ASTRONAUTICS A A 101 A ?? Joseph M Blakely ??Other?? AU07\"\n title = title.split(\"??\")\n # => [\"AERONAUTICS & ASTRONAUTICS A A 101 A \", \" Joseph M Blakely \", \"Other\", \" AU07\"]\n return @valid = false if title.size < 4\n \n @attributes[:instructor_name] = title[1].strip\n @attributes[:instructor_type] = title[2].strip\n \n # get quarter ('AU07') and convert it to the format used in the time schedule ('AUT2007')\n quarter = title[3].strip\n if (quarter =~ /97|98|99/)\n year_prefix = '19'\n else\n year_prefix = '20'\n end\n quarter.sub!(/AU/, \"AUT#{year_prefix}\"); quarter.sub!(/WI/, \"WIN#{year_prefix}\"); quarter.sub!(/SP/, \"SPR#{year_prefix}\"); quarter.sub!(/SU/, \"SUM#{year_prefix}\")\n @attributes[:quarter] = quarter\n \n # get the course number, or fail\n match = title[0].match(/\\d+/)\n return @valid = false unless match\n @attributes[:number] = match[0].strip\n @attributes[:section] = match.post_match.strip if match.post_match\n \n # match the dept abbrev using the list passed to us (guaranteed to be sorted long to short).\n # this is the only way to separate department name from department abbrev. fail if no match\n title_and_abbrev = match.pre_match.strip\n dept = nil\n dept_abbrevs.each do |abbrev|\n match = title_and_abbrev.match(\" #{Regexp::escape(abbrev)}$\") \n break dept = match[0].strip if match\n end\n unless dept\n #puts \"FAILED on \" + title_and_abbrev\n return @valid = false\n end\n @attributes[:dept] = dept\n \n # parse the eval scores table\n table = doc.search(\"table\")\n caption = table.search(\"caption\").inner_text\n # => \"Form B: Large Lecture?????\\\"39\\\" surveyed ?? \\\"56\\\" enrolled\"\n caption = caption.split(/\\?+/)\n # => [\"Form B: Large Lecture\", \"\\\"39\\\" surveyed \", \" \\\"56\\\" enrolled\"]\n @attributes[:course_type] = caption[0].strip\n @attributes[:surveyed] = caption[1].match(/\\d+/)[0].to_i\n @attributes[:enrolled] = caption[2].match(/\\d+/)[0].to_i\n @attributes[:stats] = {}\n rows = table.search(\"tr\")\n rows.each do |row|\n row = row.inner_text\n # => \"The course as a whole: 28%38%28%3%3%0% 3.93\"\n key = nil\n key = :whole if row =~ /whole:/\n key = :content if row =~ /content:|taught:/\n key = :contribution if row =~ /contribution:/\n key = :effectiveness if row =~ /effectiveness:/\n key = :interest if row =~ /interest:|enthusiastic:/\n key = :learned if row =~ /learned:/\n key = :grading if row =~ /techniques:/\n next unless key\n row = row.split(/ |:/).reverse # sometimes there is no space after \"whole:\"\n # [\"3.93\", \"28%38%28%3%3%0%\", \"whole:\", \"a\", \"as\", \"course\", \"The\"]\n median = row[0].to_f\n scores = row[1].split('%').reverse\n # => [\"0\", \"3\", \"3\", \"28\", \"38\", \"28\"]\n scores.map! { |x| x = x.to_i }\n @attributes[:stats][key] = {:median => median, :scores => scores}\n end\n end", "def available_contents\n description['available_contents']\n end", "def check_online?\n url = @record.fulltext_link[:url]\n # SFX URLs observed in the wild: owens.mit.edu/sfx_local,\n # sfx.mit.edu/sfx_local, library.mit.edu/?func=service-sfx\n url.present? && (\n @record.fulltext_link[:label] == 'Check SFX for availability'\n )\n end", "def list_status\n if self.available_on.nil?\n nil\n elsif self.tba?\n 'TBA'\n elsif self.upcoming?\n 'Upcoming'\n elsif self.new?\n 'New'\n elsif self.recent?\n 'Recent'\n elsif self.backlist?\n 'Backlist'\n else\n nil\n end\n end" ]
[ "0.5885033", "0.5722336", "0.57221526", "0.57125634", "0.5372328", "0.5294211", "0.52822787", "0.51872814", "0.5184706", "0.5175481", "0.5075883", "0.50668", "0.50181067", "0.49541885", "0.4951227", "0.49414322", "0.4936676", "0.49350795", "0.4915281", "0.48589793", "0.4832735", "0.482988", "0.4824299", "0.47692975", "0.473841", "0.47227848", "0.4715838", "0.47108337", "0.47104713", "0.47078222", "0.47078222", "0.46827298", "0.4679635", "0.46778217", "0.46725366", "0.46716616", "0.46665904", "0.4656212", "0.46548352", "0.46541196", "0.46477854", "0.46458685", "0.46279585", "0.46219575", "0.46151417", "0.4614829", "0.46124178", "0.46112615", "0.46109325", "0.4595513", "0.45857114", "0.45844907", "0.45758423", "0.45722988", "0.45689622", "0.4564694", "0.45538038", "0.454142", "0.4534786", "0.45227492", "0.45159566", "0.45087475", "0.44981948", "0.4493053", "0.44913533", "0.44901147", "0.44753692", "0.44718146", "0.4467742", "0.44499722", "0.44399843", "0.44326642", "0.44244242", "0.44235244", "0.4419631", "0.44114426", "0.44114426", "0.4410836", "0.4408974", "0.44068062", "0.44039077", "0.43974245", "0.43806687", "0.4376921", "0.43750894", "0.43707064", "0.4369678", "0.4364597", "0.436232", "0.43567342", "0.43505216", "0.43456694", "0.4341475", "0.4331019", "0.43241388", "0.4322105", "0.4321828", "0.4310919", "0.4299157" ]
0.5191186
8
Move pending PDF files to their published location
def movePendingFiles(itemID) noSplashKey = calcNoSplashKey(itemID) pvwPfx = getEnv("S3_PREVIEW_PREFIX") pvwLin = $s3Bucket.object("#{pvwPfx}/#{itemID}/#{itemID}_noSplash_#{noSplashKey}.pdf") pvwSplash = $s3Bucket.object("#{pvwPfx}/#{itemID}/#{itemID}.pdf") # If there's no preview file to move, we have nothing to do pvwLin.exists? or return # Move the preview splash file, if present contentPfx = getEnv("S3_CONTENT_PREFIX") if pvwSplash.exists? newSplash = $s3Bucket.object("#{contentPfx}/#{itemID}/#{itemID}.pdf") puts " movePending: copying #{pvwSplash.key} to #{newSplash.key}" copyContentFile(itemID, pvwSplash, newSplash) pvwSplash.delete end # Move the linearized file newLin = $s3Bucket.object("#{contentPfx}/#{itemID}/#{itemID}_noSplash_#{noSplashKey}.pdf") puts " movePending: copying #{pvwLin.key} to #{newLin.key}" copyContentFile(itemID, pvwLin, newLin) pvwLin.delete end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rebuild_pdf\n page_paths = (1..document.page_count).map {|i| \"#{document.slug}_#{i}.pdf\" }\n #`pdftk #{page_paths.join(' ')} cat output #{@pdf}`\n `pdftailor stitch --output #{@pdf} #{page_paths.join(' ')} 2>&1`\n\n if File.exists? @pdf\n asset_store.save_pdf(document, @pdf, access)\n File.open( @pdf,'r') do | fh |\n document.update_file_metadata( fh.read )\n end\n end\n end", "def download_all_files files,dest\n return if files.empty?\n RubyUtil::partition files do |sub|\n cmd = \"mv -t #{dest} \"\n cmd += sub.map { |f| \"\\\"#{f.full_path}\\\"\" }.join(' ')\n exec_cmd(cmd) \n end\n # update files object !\n files.map! { |f| f.path = dest; f }\n end", "def process_two_phase_pending_objects\n prefix = \"#{path.base_name}/#{path.two_phase_pending}\"\n collection = amazon_s3.bucket.objects(prefix: prefix)\n\n collection.each do |s3_object|\n _, _, filename = s3_object.key.split('/')\n object_type, _, _ = filename.split('_')\n\n contents = s3_object.get.body.read\n\n s3_object.move_to(\"#{path.base_name_w_bucket}/#{path.pending}/#{filename}\")\n end\n end", "def update_pdf_destinations!\n return unless sort == 'Script'\n irrelevant_items.destroy_all\n quarantine_added = []\n # not very elegant, but other attempts at it failed due to\n # Rails caching of SQL queries\n missing_items_outside_quarantine.each do |i|\n quarantine_added.push(i.pdf_destination)\n i.update(quarantine: true)\n end\n quarantine_added\n end", "def dest_pdf\n @zip_path[0..-5] << '.pdf'\n end", "def copy_files(dest_dir)\n @package.documents.each do |file|\n ActiveRecord::Base.logger.debug \"copying file #{file.attach.path} in #{File.join(dest_dir, \"\")}\"\n FileUtils.cp(file.attach.path, File.join(dest_dir, \"\"))\n end\n end", "def post_conversion(original, tmp_output)\n # puts \"==== POST ====\"\n dirname = File.dirname(original)\n basename = File.basename(original, File.extname(original))\n real_output = File.join(dirname, basename + '.pdf')\n FileUtils.mv(tmp_output, real_output)\n # puts \"Copied #{tmp_output} to #{real_output}\"\n\n FileUtils.rm(tmp_filepath(original))\n # puts \"Deleted #{tmp_filepath(original)}\"\n end", "def remove_pdf\n begin\n File.delete \"public/pdfs/legal_briefs/\" + self.id.to_s + \".pdf\" \n rescue Errno::ENOENT\n # if file is not there, just ignore\n end\n end", "def combine_pdf_files\n create_process(process: \"COMBINE_PDF_FILES\")\n end", "def move_epub\n origin = manifest.filename\n target = preview? ? origin + '-preview' : origin\n FileUtils.mv(File.join('epub', \"#{origin}.epub\"),\n File.join('ebooks', \"#{target}.epub\"))\n end", "def delete_older_files_from_cloud(story, story_revision, directory)\r\n if Rails.env == 'production'\r\n directory.files.all(:prefix=> \"stories/#{story.id}/pdf\").each do |file|\r\n file.destroy if (File.basename(file.key, File.extname(file.key)) != story.to_param + story_revision)\r\n end\r\n directory.files.all(:prefix=> \"stories/#{story.id}/epub\").each do |file|\r\n file.destroy if (File.basename(file.key, File.extname(file.key)) != story.to_param + story_revision)\r\n end\r\n end\r\n end", "def stage_attached_files(publication)\n uploaded_files = []\n publication.publication_files.each do |f|\n temp_file_path = File.join(Rails.root, 'tmp/publishing_staged_uploads', f.key, f.filename.to_s)\n temp_file_directory = File.dirname(temp_file_path)\n FileUtils.mkdir_p(temp_file_directory) unless File.directory?(temp_file_directory)\n File.open(temp_file_path, 'wb') do |file|\n file.write(f.download)\n end\n uploaded_files << { path: temp_file_path, content_type: f.content_type }\n end\n uploaded_files\n end", "def publish(args)\n if args.length == 0\n Dir.foreach('_drafts') do |filename|\n FileUtils.mv \"_drafts/#{filename}\", \"_posts/#{filename}\", :force => true\n end\n else\n args.each do |name|\n Dir.foreach('_drafts') do |filename|\n if filename.include? name\n FileUtils.mv \"_drafts/#{filename}\", \"_posts/#{filename}\", :force => true\n exec \"git add . && git commit -m 'Publish #{filename}'\"\n end\n end\n end\n end\n end", "def generate_pdf(filename)\n @destination_path = \"#{Rails.root}/public/files/\"+filename.remove('pptx')+'pdf'\n Libreconv.convert( @files.to_s, @destination_path, nil, 'pdf:writer_pdf_Export')\n # Docsplit.extract_pdf(@files.to_s)\n\n # Creates the manipulated pptx file physically\n FileUtils.mv @files.to_s, \"#{Rails.root}/public/files/\"+filename\n @destination_path\n end", "def dragged\n $dz.begin(\"Running PDFSeparate...\")\n numitems = $items.count\n pdfDir = defined?( ENV['pdfDir'] ) ? ENV['pdfDir'] : \"emails\"\n $dz.save_value(\"pdfDir\", pdfDir)\n progloc = defined?( ENV['progloc'] ) ? ENV['progloc'] : \"/opt/homebrew/bin/pdfseparate\"\n $dz.save_value(\"progloc\", progloc)\n\n #\n # Below line switches the progress display to determinate mode so we can show progress\n #\n $dz.determinate(true)\n $dz.percent(1)\n \n #\n # Index over all of the given presentations.\n #\n for index in 0 ... numitems\n #\n # Get the note text.\n #\n file = $items[index]\n itemDir = File.dirname(file)\n \n #\n # Create the subdirectory if it doesn't exist.\n #\n if ! File.directory?(\"#{itemDir}/#{pdfDir}\") then\n Dir.mkdir \"#{itemDir}/#{pdfDir}\"\n end\n\n #\n # Split the PDF file\n #\n `#{progloc} '#{file}' '#{itemDir}/#{pdfDir}/%d.pdf'`\n \n #\n # Update the percentage done.\n #\n $dz.percent((index/numitems)*100)\n end\n\n #\n # The below line tells Dropzone to end with a notification \n # center notification with the text \"Splitting Up Complete\".\n #\n $dz.finish(\"Splitting Up Complete\")\n \n # You should always call $dz.url or $dz.text last in your script. The below $dz.text line places text on the clipboard.\n # If you don't want to place anything on the clipboard you should still call $dz.url(false)\n $dz.url(false)\nend", "def move_files(file_names, directory)\n\tputs 'Moving files to the public directory...'\n\n\tcounter = 0\n\tpath = File.expand_path(directory + '/sheets')\n\n\tfile_names.each do |name|\n\t\tFileUtils.move(name, path);\n\t\tcounter += 1\n\tend\n\t\n\tputs 'done, moved ' + counter.to_s + ' files'\nend", "def cleanDownloads()\n dir(\"#{DOWNLOADS_DIR}/*\").each do |path|\n if path != PREV_DOWNLOADS_DIR\n # colourFile(path)\n moveOldDownload(path)\n end\n end\n end", "def move_files_to_destination!(files_array)\n files_array.each do |file|\n new_destination = \"#{@destinaton}/'dirty_#{file}'\"\n system(\"mv #{file} #{new_destination}\")\n destroy_dirty_file!(file)\n end\n puts \"=> #{files_array.count} files copied to #{@destination} and original files destroyed\"\n end", "def findPdfFiles(file, srcDir, destDir) \n\n # puts \"looking at: #{srcDir}/#{file}\";\n\n srcFile = \"#{srcDir}/#{file}\";\n destFile = \"#{destDir}/#{file}\";\n\n if (File.directory?(srcFile)) then\n system(\"mkdir #{destFile}\");\n Dir.entries(srcFile).sort().each() { | aFile |\n next if (aFile =~ /^\\.$/);\n next if (aFile =~ /^\\.\\.$/);\n next if (aFile =~ /^\\.svn$/);\n next if (aFile =~ /^target$/);\n findPdfFiles(aFile, srcFile, destFile);\n }\n else \n if (srcFile =~ /\\.pdf/) then\n convertPdf(file, srcDir, destDir);\n elsif (srcFile =~ /SD2-18_VPNServiceModel\\.xls/) then\n copyFileToTarget(file, srcDir, destDir);\n end\n end\n\nend", "def remove_moved_files\n scan_for_merges.each do |file|\n if File.amp_lexist?(@repo.working_join(file))\n UI.debug(\"removing #{file}\")\n File.unlink(@repo.working_join(file))\n end\n end\n end", "def test_post_move_file\n\n src = 'folder1/FileTest.pdf'\n dest = 'folder3/folder1/FileTest.pdf'\n versionId = nil\n storage = 'First Storage'\n destStorage = 'First Storage'\n request = PostMoveFileRequest.new(src, dest, versionId, storage, destStorage)\n\n result = @storage_api.post_move_file(request)\n assert result.code == 200, 'Error while moving document'\n\n end", "def main()\n res = @s.execute_get(@s.url_for(\"var/search/needsprocessing.json\"))\n unless res.code == '200'\n raise \"Failed to retrieve list to process [#{res.code}]\"\n end\n\n process_results = JSON.parse(res.body)['results']\n log \"processing #{process_results.size} entries\"\n unless process_results.size > 0\n return\n end\n\n # Create some temporary directories.\n Dir.mkdir DOCS_DIR unless File.directory? DOCS_DIR\n Dir.mkdir PREV_DIR unless File.directory? PREV_DIR\n Dir.mkdir PDFS_DIR unless File.directory? PDFS_DIR\n\n # Create a temporary file in the DOCS_DIR for all the pending files and outputs all the filenames in the terminal.\n Dir.chdir DOCS_DIR\n queued_files = process_results.collect do |result|\n FileUtils.touch result['_path']\n end\n\n log \" \"\n log \"Starts a new batch of queued files: #{queued_files.join(', ')}\"\n\n Dir['*'].each do |id|\n FileUtils.rm_f id\n log \"processing #{id}\"\n\n begin\n meta_file = @s.execute_get @s.url_for(\"p/#{id}.json\")\n unless meta_file.code == '200'\n raise \"Failed to process: #{id}\"\n end\n\n meta = JSON.parse meta_file.body\n mime_type = meta['_mimeType']\n given_extension = meta[\"sakai:fileextension\"]\n extension = determine_file_extension_with_mime_type(mime_type, given_extension)\n filename = id + extension\n log \"with filename: #{filename}\"\n\n if ignore_processing?(mime_type) || extension.eql?('')\n if extension.eql?('')\n log \"ignoring processing of #{filename}, no preview can be generated for files without a known mime type\"\n log \"The file's original extension was #{given_extension}, and it's mime type is #{mime_type}\"\n else\n log \"ignoring processing of #{filename}, no preview can be generated for #{mime_type} files\"\n end\n else\n # Making a local copy of the file.\n content_file = @s.execute_get @s.url_for(\"p/#{id}\")\n unless ['200', '204'].include? content_file.code\n raise \"Failed to process file: #{id}, status: #{content_file.code}\"\n end\n File.open(filename, 'wb') { |f| f.write content_file.body }\n\n if process_as_image? extension\n extension = output_extension extension\n page_count = 1\n filename_thumb = 'thumb' + extension\n\n content = resize_and_write_file filename, filename_thumb, 900\n post_file_to_server id, content, :normal, page_count, extension\n\n content = resize_and_write_file filename, filename_thumb, 180, 225\n post_file_to_server id, content, :small, page_count, extension\n\n FileUtils.rm_f DOCS_DIR + \"/#{filename_thumb}\"\n else\n begin\n # Check if user wants autotagging\n user_id = meta[\"sakai:pool-content-created-for\"]\n user_file = @s.execute_get @s.url_for(\"/system/me?uid=#{user_id}\")\n unless user_file.code == '200'\n raise \"Failed to get user: #{uid}\"\n end\n user = JSON.parse(user_file.body)\n if user[\"user\"][\"properties\"][\"isAutoTagging\"] != \"false\"\n # Get text from the document\n Docsplit.extract_text filename, :ocr => false\n text_content = IO.read(id + \".txt\")\n terms = extract_terms(text_content)\n tags = \"\"\n terms.each_with_index do |t, i|\n tags += \"- #{t}\\n\"\n terms[i] = \"/tags/#{t}\"\n end\n # Generate tags for document\n @s.execute_post @s.url_for(\"p/#{id}\"), {':operation' => 'tag', 'key' => terms}\n log \"Generate tags for #{id}, #{terms}\"\n admin_id = \"admin\"\n origin_file_name = meta[\"sakai:pooled-content-file-name\"]\n if not terms.nil? and terms.length > 0 and user[\"user\"][\"properties\"][\"sendTagMsg\"] and user[\"user\"][\"properties\"][\"sendTagMsg\"] != \"false\"\n msg_body = \"We have automatically added the following tags for #{origin_file_name}:\\n\\n #{tags}\\n\\nThese tags were created to aid in the discoverability of your content.\\n\\nRegards, \\nThe Sakai Team\"\n @s.execute_post(@s.url_for(\"~#{admin_id}/message.create.html\"), {\n \"sakai:type\" => \"internal\",\n \"sakai:sendstate\" => \"pending\",\n \"sakai:messagebox\" => \"outbox\",\n \"sakai:to\" => \"internal:#{user_id}\",\n \"sakai:from\" => \"#{admin_id}\",\n \"sakai:subject\" => \"We've added some tags to #{origin_file_name}\",\n \"sakai:body\" => msg_body,\n \"_charset_\" => \"utf-8\",\n \"sakai:category\" => \"message\"\n })\n log \"sending message from #{admin_id} user to #{user_id}\"\n end\n end\n rescue Exception => msg\n log \"failed to generate document tags: #{msg}\", :warn\n end\n\n # Generating image previews of the document.\n if only_first_page? extension\n Docsplit.extract_images filename, :size => '1000x', :format => :jpg, :pages => 1\n else\n Docsplit.extract_images filename, :size => '1000x', :format => :jpg\n end\n\n # Skip documents with a page count of 0, just to be sure.\n next if Dir[id + '_*'].size == 0\n\n Dir.mkdir PREV_DIR + \"/#{id}\" unless File.directory? PREV_DIR + \"/#{id}\"\n\n # Moving these previews to another directory: \"PREVS_DIR/filename/index.jpg\".\n Dir[id + '_*'].each_with_index do |preview, index|\n FileUtils.mv \"#{id}_#{index + 1}.jpg\", \"#{PREV_DIR}/#{id}/#{index}.jpg\"\n end\n\n Dir.chdir PREV_DIR + \"/#{id}\"\n page_count = Dir[\"*\"].size\n\n # Upload each preview and create+upload a thumbnail.\n for index in (0..page_count - 1)\n filename_p = \"#{index}.jpg\"\n # Upload the generated preview of this page.\n nbytes, content = File.size(filename_p), nil\n File.open(filename_p, \"rb\") { |f| content = f.read nbytes }\n post_file_to_server id, content, :large, index + 1\n\n # Generate 2 thumbnails and upload them to the server.\n filename_thumb = File.basename(filename_p, '.*') + '.normal.jpg'\n content = resize_and_write_file filename_p, filename_thumb, 700\n post_file_to_server id, content, :normal, index + 1\n\n filename_thumb = File.basename(filename_p, '.*') + '.small.jpg'\n content = resize_and_write_file filename_p, filename_thumb, 180, 225\n post_file_to_server id, content, :small, index + 1\n end\n\n FileUtils.remove_dir PREV_DIR + \"/#{id}\"\n end\n # Pass on the page_count\n @s.execute_post @s.url_for(\"p/#{id}\"), {\"sakai:pagecount\" => page_count, \"sakai:hasPreview\" => \"true\"}\n\n # Change to the documents directory otherwise we won't find the next file.\n Dir.chdir DOCS_DIR\n end\n\n #SAKAI TO PDF\n # We check if mimetype is sakaidoc\n if(mime_type == \"x-sakai/document\")\n if (File.exist?(\"../wkhtmltopdf\"))\n # Go to PDF Dir\n Dir.chdir PDFS_DIR\n\n #delay in secs\n $delay = \"20\"\n\n #filename with extension\n filename_p = id + \".pdf\"\n\n # We parse the structure data to var structure (we do not need the rest)\n structure = JSON.parse meta['structure0']\n\n # Create var and add beginning of code line to run\n line = \"../wkhtmltopdf \"\n\n # Go through structure and add the pagelink for each page id\n structure.each do |page|\n link = \"content#l=\" + page[0] + \"&p=\" + id\n link = @s.url_for(link)\n link = \"'\" + link + \"' \"\n line += link\n end\n\n # Fetch cookie value to get access to all content\n # USERNAME PASSWORD SERVER\n $username = \"admin\"\n auth = \"../auth.sh \" + $username + \" \" + $pw + \" \" + $preview_referer\n cookietoken = `#{auth}`\n\n # Append end of line containing arguments for print css, delay and authentication\n line += filename_p + \" --print-media-type --redirect-delay \" + $delay + \"000 --cookie 'sakai-trusted-authn' \" + cookietoken\n\n # Run the command line (run wkhtmltopdf)\n `#{line}`\n\n # We read the content from the pdf in the PDF directory\n content = open(filename_p, 'rb') { |f| f.read }\n\n # We post it to server through this function\n post_pdf_to_server id, content\n @s.execute_post @s.url_for(\"p/#{id}\"), {\"sakai:processing_failed\" => \"false\"}\n #Change dir\n Dir.chdir DOCS_DIR\n else\n @s.execute_post @s.url_for(\"p/#{id}\"), {\"sakai:processing_failed\" => \"true\"}\n log \"PDF Converter (wkhtmltopdf) not present in directory\"\n log \"Cannot convert Sakai document to PDF\"\n log \"Continuing without conversion\"\n end\n end\n rescue Exception => msg\n # Output a timestamp + the error message whenever an exception is raised\n # and flag this file as failed for processing.\n log \"error generating preview/thumbnail (ID: #{id}): #{msg.inspect}\\n#{msg.backtrace.join(\"\\n\")}\", :warn\n @s.execute_post @s.url_for(\"p/#{id}\"), {\"sakai:processing_failed\" => \"true\"}\n ensure\n # No matter what we flag the file as processed and delete the temp copied file.\n @s.execute_post @s.url_for(\"p/#{id}\"), {\"sakai:needsprocessing\" => \"false\"}\n FileUtils.rm_f DOCS_DIR + \"/#{filename}\"\n end\n end\n\n FileUtils.remove_dir PDFS_DIR\n FileUtils.remove_dir PREV_DIR\n FileUtils.remove_dir DOCS_DIR\nend", "def stamp_pdf!\n stamp_filename = self.instance.application_for_offering.composite_report.get_part(:stamp)\n command = \"pdftk #{self.versions[:pdf].path} stamp #{stamp_filename} output #{self.versions[:pdf].path}-stamped\"\n RAILS_DEFAULT_LOGGER.info { \"Stamping PDF file:\\n #{command}\"}\n res = `#{command}`\n out = $?\n if out.success?\n `mv #{self.versions[:pdf].path} #{self.versions[:pdf].path}-unstamped`\n `mv #{self.versions[:pdf].path}-stamped #{self.versions[:pdf].path}`\n end\n return out\n end", "def deleteContentFiles(itemID)\n noSplashKey = calcNoSplashKey(itemID)\n\n # Remove the preview files if present\n pvwPfx = getEnv(\"S3_PREVIEW_PREFIX\")\n pvwLin = $s3Bucket.object(\"#{pvwPfx}/#{itemID}/#{itemID}_noSplash_#{noSplashKey}.pdf\")\n pvwLin.exists? and pvwLin.delete\n pvwSplash = $s3Bucket.object(\"#{pvwPfx}/#{itemID}/#{itemID}.pdf\")\n pvwSplash.exists? and pvwSplash.delete\n\n # Remove the published files if present\n contentPfx = getEnv(\"S3_CONTENT_PREFIX\")\n newSplash = $s3Bucket.object(\"#{contentPfx}/#{itemID}/#{itemID}.pdf\")\n newSplash.exists? and newSplash.delete\n newLin = $s3Bucket.object(\"#{contentPfx}/#{itemID}/#{itemID}_noSplash_#{noSplashKey}.pdf\")\n newLin.exists? and newLin.delete\nend", "def move_multimedia_files_to_trash\n if self.multimedia_path\n\n FileUtils.mkdir_p(dir_for_deleted)\n FileUtils.mv(Dir.glob(File.join(class_multimedia_path, self.multimedia_path, \"*.*\")), dir_for_deleted)\n\n logger.info \"Moviendo #{File.join(class_multimedia_path, self.multimedia_path, \"*.*\")} a #{dir_for_deleted}\"\n\n FileUtils.rm_rf(File.join(class_multimedia_path, self.multimedia_path))\n\n # Los videos de la webtv dejarán de funcionar porque están en el mismo directorio\n self.webtv_videos.update_all(\"published_at=NULL, document_id=NULL\") if self.respond_to?('webtv_videos')\n self.gallery_photos.update_all(\"document_id=NULL\") if self.respond_to?('gallery_photos')\n self.album.update_attributes(:document_id => nil, :draft => true) if self.respond_to?('album') && self.album\n end\n return true\n end", "def next_draft_to_publish\n Dir.glob(\"_drafts/publish_*\").min_by {|f| File.mtime(f)}\nend", "def linkfile\n curfile = File.last_added(\"#{Downloads_path}/*.pdf\")\n unless curfile # no last file found\n growl(\"Sorry, no PDFs found in that directory\")\n exit(0)\n end\n\n f = MacTypes::FileURL.path(curfile)\n Selection[0].linked_files.add(f,{:to =>Selection[0]})\n Selection[0].auto_file\n\n growl(\"PDF added\", \"File added successfully to #{Selection[0].cite_key.get}\")\nend", "def copy_pdf_export_to_distribution(options)\n # Create distribution dir if it doesn't exist yet\n output_base_dir = options['output'] || config.compute_base_dir(:pdf_export_distribution_dir)\n FileUtils.mkdir_p(output_base_dir)\n\n # Delete all files in distribution dir\n delete_files(\n 'base-dir' => output_base_dir,\n 'file-selector' => \"*\",\n 'file-extension' => config.compute_file_extension(:pdf_extension),\n )\n\n # Copy exported files into distribution dir\n input_base_dir = config.compute_base_dir(options['base-dir'] || :pdf_export_dir)\n input_file_selector = config.compute_file_selector(options['file-selector'] || :all_files)\n input_file_extension = config.compute_file_extension(options['file-extension'] || :pdf_extension)\n\n Repositext::Cli::Utils.copy_files(\n input_base_dir,\n input_file_selector,\n input_file_extension,\n output_base_dir,\n options['file_filter'],\n \"Copying exported PDF files to distribution directory\",\n options.merge(\n :output_path_lambda => lambda { |input_filename|\n File.join(output_base_dir, File.basename(input_filename))\n }\n )\n )\n end", "def archive!\n DocumentArchive.create!(:consumer_id => self.consumer_id, :suggested_standard_document_id => self.suggested_standard_document_id, :rejected_at => Time.now, :suggested_at => self.suggested_at, :source => self.source, :file_content_type => self.file_content_type, :cloud_service_full_path => self.cloud_service_full_path, :original_file_name => self.original_file_name)\n end", "def rebuild_pptx\n Zip::File.open(@files.to_s, Zip::File::CREATE) { |zipfile|\n @slides.each do |f|\n if f.changed\n # Temporary file to store the manipulated xml\n temp_file = Tempfile.new(f.slide_file_name)\n # Store the manipulated xml inside the file\n temp_file.write(f.raw_xml)\n temp_file.close\n # Collect temporary files to unlink them later\n @temp_files << temp_file\n # Replace the original slide with the new one\n zipfile.replace(f.slide_xml_path, temp_file.path)\n end\n end\n }\n end", "def google_move_file(client)\n notify \"Command : Google move file\"\n # result : error message\n # google treat folders as files\n src_files = move_copy_file_source\n dest_path = CGI::unescape(@fields[:dst_path].to_s)\n result = client.move_files(src_files,dest_path)\n\n end", "def distribute_pdf_export_remove_pdf_type(options)\n file_rename_proc = Proc.new { |input_filename|\n input_filename.sub(/\\.[^\\.]+\\.pdf\\z/, \".pdf\")\n }\n Repositext::Cli::Utils.rename_files(\n config.compute_base_dir(:pdf_export_distribution_dir),\n config.compute_file_selector(:all_files),\n config.compute_file_extension(:pdf_extension),\n file_rename_proc,\n options['file_filter'],\n \"Removing pdf type from filenames\",\n options\n )\n end", "def move_root_files\n docs = \"#{@dir}/usr/share/doc/#{@ctrl[:package]}\"\n files = Dir.entries(@dir).select {|f| !File.directory?(f) }\n return unless files.any?\n\n FileUtils.mkdir_p(docs)\n\n # move all the files from the root of the package\n files.each do |file|\n file = File.join(@dir, file)\n next unless File.exist?(file)\n\n FileUtils.mv(file, docs)\n @log.info \"#{file} => usr/share/doc/#{pkgname}\"\n end\n end", "def mv!(to)\n files.map{|file| file.mv! to }\n end", "def move_files(from_path, to_path)\n # move into the new dir - and mv files to the in_process_dir\n pwd = FileUtils.pwd\n begin\n FileUtils.mkdir_p(to_path) if not Dir.exists? to_path\n Dir.chdir(from_path)\n FileUtils.mv Dir.glob(\"*\"), to_path, :force => true\n Dir.chdir(to_path)\n begin\n #remove from_path as files are now \"in process\"\n FileUtils.rm_r(from_path)\n rescue\n logger.warn \"failed to rm #{from_path}\"\n end\n ensure\n if FileUtils.pwd() != pwd\n if Dir.exists? pwd\n FileUtils.chdir(pwd)\n else\n FileUtils.chdir( student_work_dir() )\n end\n end\n end\n end", "def convert_files_to_pdf(from_path, dest_path)\n #\n # Get access to all files to process (ensure we only work with <no>.[cover|document|code|image] etc...)\n #\n in_process_files = Dir.entries(from_path).select { | f | (f =~ /^\\d{3}\\.(cover|document|code|image)/) == 0 }\n if in_process_files.length < 1\n logger.error \"Cannot convert files to PDF: No files found in #{from_path}\"\n return nil\n end\n\n #\n # Map each process file to have extra info i.e.:\n #\n # file.idx = 0..n\n # file.path = actual file dir sitting in in_process directory\n # file.ext = file extension\n # file.type = cover/image/code/document\n # file.actualfile = actual file variable that can be used - File.open(path)\n #\n files = []\n in_process_files.each do | file |\n # file0.code.png\n idx = file.split('.').first.to_i\n type = file.split('.').second\n path = File.join(\"#{from_path}\", \"#{file}\")\n ext = File.extname(path).downcase\n actualfile = File.open(path)\n files << { :idx => idx, :type => type, :path => path, :ext => ext, :actualfile => actualfile }\n end\n\n # ensure the dest_path exists\n if not Dir.exists? dest_path\n FileUtils.mkdir_p(dest_path)\n end\n\n #\n # Begin processing...\n #\n pdf_paths = []\n files.each do | file |\n outpath = \"#{dest_path}/#{file[:idx]}.#{file[:type]}.pdf\"\n\n convert_to_pdf(file, outpath)\n\n pdf_paths[file[:idx]] = outpath\n begin\n file[:actualfile].close\n rescue\n end\n end\n\n pdf_paths\n end", "def move_document\n Dir.mkdir(target_dir) if (!File.directory?(target_dir))\n # Only want to move the .html, .css, .png and .js files, not the .haml templates.\n html_css_files = temp_dir(\"*.{html,css,js,png}\")\n Dir[html_css_files].each { |f| mv f, target_dir }\n mv temp_dir + \"/resources\", target_dir, :force => true if (File.directory?(temp_dir + \"/resources\"))\n mv temp_dir + \"/assets\", target_dir, :force => true if (File.directory?(temp_dir + \"/assets\"))\n end", "def download\n #TODO: add time frame for downloading at a specific time\n src_url = get_pdfs_webpage_urlstr ;\t# puts src_url\n \n pdf_urls = []\n begin\n open(src_url) {\n |page| page_content = page.read().force_encoding(\"ISO-8859-1\").encode(\"UTF-8\")\n doc = Nokogiri::HTML.parse(page_content) #HTree(page_content).to_rexml\n doc.xpath(\"//a\").map do |elem| #doc.root.each_element('//a') do |elem |\n #puts elem\n #a = elem.attribute(\"href\").value\n a = elem['href']\n #puts a\n if a =~ /.pdf$/\n pdf_urls << File.join(src_url.slice(0,src_url.rindex('/')),a)\n pdf_urls.uniq!\n end\n end\n }\n # p(pdf_urls)\n rescue => e\n puts \"#{src_url} failed to open! #{e}\"\n raise \"please check URL #{src_url}\"\n end\n \n ## should NOT be apparent to the user.\n urls_file = \"#{get_newspaper_sym}#{self.object_id}\"\t## same file not allowing the multithreading, ensure singularity.\n f = File.new(urls_file , \"w\") ; f.puts pdf_urls ; f.close\n repo = target_dir ;# puts repo\n system(\"wget -nv -i \" + urls_file +\" -P \" + repo)\t## download using wget tool\n File.delete urls_file if File.exists? urls_file\t## clean\n end", "def commit\n # TODO\n # Update ./docProps\n # app.xml slides, notes, counts, etc\n # core.xml Times\n entries.each do |path, buffer|\n path = path.to_s\n if @original_files.include? path\n @zip.replace_buffer path, buffer\n else\n @zip.add_buffer path, buffer\n end\n end\n @zip.commit\n end", "def sync\n puts \"Current pages: #{jekyll.join(', ')}\"\n puts \"New pages: #{dropbox.join(', ')}\"\n \n to_delete = jekyll - dropbox\n to_delete.map {|p| delete \"#{@dir}/#{p}\"}\n \n dropbox.map {|p| create \"#{@dir}/#{p}\"}\n end", "def purgeFiles\n Dir[\"#{@pagespath}/*\"].reject{ |f| f[\"#{@pagespath}/.keep\"] }.each do |filename|\n File.delete filename\n end\n\n Dir[\"#{@assetpath}/*\"].reject{ |f| f[\"#{@pagespath}/.keep\"] }.each do |filename|\n File.delete filename\n end\n end", "def update_index\n index_files = []\n index_files << upload(\"specs.4.8.gz\", specs_index)\n log \"Uploaded all specs index\"\n index_files << upload(\"latest_specs.4.8.gz\", latest_index)\n log \"Uploaded latest specs index\"\n index_files << upload(\"prerelease_specs.4.8.gz\", prerelease_index)\n log \"Uploaded prerelease specs index\"\n\n index_files.each do |file|\n tuf_repo.replace_file(file, 'targets/unclaimed', 'targets')\n end\n\n # For now assume all files are unclaimed\n pending_files = tuf_pending_store.pending\n pending_files.each do |file|\n puts \"Adding file: #{file.path}\"\n tuf_repo.add_file(file, 'targets/unclaimed', 'targets')\n end\n tuf_repo.publish!\n tuf_pending_store.clear(pending_files)\n end", "def convertPdf(file, srcDir, destDir)\n\n # first do the conversion...\n inFileName = \"#{srcDir}/#{file}\";\n outFileName = \"#{destDir}/#{file}\";\n puts \"converting: [#{inFileName}]\";\n puts \"\\tto: [#{outFileName}]\";\n\n inFile = File.open(inFileName,\"r\");\n inFileContents = inFile.read();\n inFileContents.gsub!(/\\.doc\\)/, \".pdf)\");\n outFile = File.open(outFileName,\"w\");\n outFile.write(inFileContents);\n inFile.close();\n outFile.close();\n\n # no walk through the document looking for links to report\n inFile = File.open(inFileName,\"r\");\n inFile.each_line() { | aLine |\n if (aLine =~ /\\/F\\([^\\)]*\\.doc\\)\\>\\>/) then\n aLine.chomp!();\n aLink = aLine.sub(/^.*\\/F\\(/,\"\");\n aLink = aLink.sub(/\\.doc\\)\\>\\>/,\".doc\");\n if (!$links.has_key?(aLink)) then\n\t$links[aLink] = Hash.new();\n end\n $links[aLink][inFileName] = true;\n end\n }\n inFile.close();\n\n puts \"\\t\\tdone\";\nend", "def mirror_missing_destination_files\n # Find the id of the domain we are mirroring\n source_domain = SourceDomain.find_by_namespace(@source_mogile.domain)\n\n # Get the max fid from the mirror db\n # This will only be nonzero if we are doing an incremental\n max_fid = MirrorFile.max_fid\n\n # Process source files in batches.\n Log.instance.info(\"Searching for files in domain [ #{source_domain.namespace} ] whose fid is larger than [ #{max_fid} ].\")\n SourceFile.where('dmid = ? AND fid > ?', source_domain.dmid, max_fid).includes(:domain, :fileclass).find_in_batches(batch_size: 1000) do |batch|\n # Create an array of MirrorFiles which represents files we have mirrored.\n remotefiles = batch.collect { |file| MirrorFile.new(fid: file.fid, dkey: file.dkey, length: file.length, classname: file.classname) }\n\n # Insert the mirror files in a batch format.\n Log.instance.debug('Bulk inserting mirror files.')\n MirrorFile.import remotefiles\n\n # Figure out which files need copied over\n # (either because they are missing or because they have been updated)\n batch_copy_missing_destination_files(remotefiles)\n\n # Show our progress so people know we are working\n summarize\n\n # Quit if program exit has been requested.\n return true if SignalHandler.instance.should_quit\n end\n end", "def pre_sync\n #move\n end", "def add_file_from_server(pdflink)\n file_download_service = FileDownloadService.new\n file = file_download_service.fetch_file_from_server(File.basename(URI.parse(pdflink).path))\n file.original_filename = File.basename(pdflink)\n file.content_type = 'application/pdf'\n file ? add_file(file, true) : false\n FileUtils.remove_file(file.path)\n end", "def move_files(tmpdir)\n entries_at_depth(tmpdir, new_resource.strip_components).each do |source|\n target = ::File.join(new_resource.destination, ::File.basename(source))\n # If we are in keep_existing mode, the target might exist already.\n # This is not a great solution and won't have exactly the same behavior\n # as the other providers, but it's something at least.\n FileUtils.rm_rf(target) if ::File.exist?(target)\n # At some point this might need to fall back to a real copy.\n ::File.rename(source, target)\n end\n end", "def adjust_pending_uploads\n return unless parent.respond_to?(:pending_uploads)\n parent.pending_uploads = [] if parent.pending_uploads.blank?\n parent.pending_uploads = (parent.pending_uploads || []) - files\n end", "def create_all\n for i in 0..Pdf.get_pdf_file_count do\n pdf = Pdf.create_pdf(i.to_s, @client, @settings)\n pdf_file_name = Pdf.get_pdf_file_name(Pdf::PDFS.keys[i], @client)\n pdf.render_file(\"#{Rails.root}/app/assets/generated-pdfs/#{pdf_file_name}\")\n end\n generate_zip(@client)\n end", "def remove_files(enc_files, directory)\n\tputs 'Removing files from public directory that are no longer present in home...'\n\tnames = Array.new\n\tc = 0\n\n\tpath = File.expand_path(directory + '/sheets')\n\n\tDir.entries(path).each do |f|\n\t\tif f.include? '.enc'\n\t\t\tnames << f\n\t\tend\n\tend\n\n\tnames.each do |n|\n\t\tunless enc_files.include? n\n\t\t\t#if the file exists in the public directory but not here, delete it\n\t\t\tFileUtils.remove(path + '/' + n)\n\n\t\t\tputs 'Removed ' + n + ' from public directory'\n\t\t\tc += 1\n\t\tend\n\tend\n\n\tputs \"done, removed \" + c.to_s + ' files'\nend", "def create_final_contract(address, final_contract, files_to_load, table_of_contents)\n files_to_load.unshift(\"table_of_contents.pdf\")\n files_to_load.each do |file|\n\n final_contract << CombinePDF.load(file)\n end\n\n final_contract.save \"#{address}_final_contract.pdf\"\nend", "def preprocess_autopublish_drafts\n puts \"Beginning pre-process step for drafts.\"\n drafts.each do |d|\n if d.autopublish?\n puts \"Autopublishing draft: #{d.title} / #{d.slug}\"\n d.publish!\n end\n end\n end", "def rename_uncompressed_docs\n Dir.chdir @plugin_directory\n \n # if the docs dir is empty, remove it\n Dir.rmdir(@docs_path) if Dir[File.join @docs_path, '*'].empty?\n \n docs = Dir['*' + File.basename(@plugin_directory) + '*']\n \n if docs.empty?\n # dive a maximum number of 5 levels deep to find the 'holder' directory\n 5.times do\n directories = Dir[docs.empty? ? \"*\" : File.join(docs, '*')].reject {|fn| not File.directory?(fn) }\n \n if directories.length == 1\n docs = directories[0]\n else\n break\n end\n end\n \n # check if the holder directory is inside the docs dir\n # if so, we have to move things around for the renaming\n if not docs.empty? and docs.start_with? @docs_dir and docs != @docs_dir\n temp_dir = File.join @plugin_directory, 'temp'\n FileUtils.move File.join(@plugin_directory, docs), temp_dir\n docs = 'temp'\n \n FileUtils.rmdir @docs_path\n end\n end\n \n if docs.empty? or (docs.class == String and File.basename(docs) == @docs_dir)\n $stderr.puts \"Error finding docs directory or already exists\"\n else\n FileUtils.mv(File.join(@plugin_directory, docs), File.join(@plugin_directory, @docs_dir))\n end\n end", "def upload_directory(locale, directory)\n @log.debug \"Looking for files in #{directory}\"\n Dir.chdir(directory)\n \n #Get all document ids by locale\n @id_checksum_hash = get_id_checksum_hash(locale)\n \n #Loop through every deliverable and upload its content\n Dir.glob(\"*\") do | deliverable_dir |\n @log.debug \"Descending into #{locale}/#{deliverable_dir}\"\n \n #Upload the deliverable metadata\n deliverable_metadata = nil\n Dir.glob(\"#{deliverable_dir}/deliverable_metadata.json\") do | metadata_file |\n @log.debug \"Attempting to upload metadata for #{locale}/#{metadata_file}\"\n id = get_deliverable_metadata_id(locale, Settings[:CURRENT_VERSION], deliverable_dir)\n deliverable_metadata = create_doc_from_json(id, metadata_file)\n end\n \n #Upload the toc file\n Dir.glob(\"#{deliverable_dir}/*.toc\") do | toc_file |\n @log.debug \"Attempting to upload ToC for #{locale}/#{toc_file}\"\n id = get_toc_id(locale, Settings[:CURRENT_VERSION], deliverable_dir)\n create_plain_file(toc_file, id, locale)\n end\n \n #Upload the html files and their referenced dependencies\n Dir.glob (\"#{deliverable_dir}/**/*.{html,htm}\") do | html_file |\n @log.debug \"Attempting to upload html for #{locale}/#{html_file}\"\n create_html_document(directory, html_file, locale, deliverable_metadata)\n \n @log.debug \"Attempting to upload dependencies for #{locale}/#{html_file}\"\n upload_referenced_images(directory, html_file, locale)\n end\n end\n end", "def process_pdf\n\t\tif before_generate_pdf.blank?\n\t\t\tself.ready_for_pdf_generation = nil\n\t\telse\n\t\t\tself.ready_for_pdf_generation = Time.now.to_i \n\t\tend\n\tend", "def upload_latest_copy\n upload_to_s3(report_files, prefix)\n end", "def clean_download_dir\n dir('~/Downloads/*').each do |path|\n trash path if File.mtime(path) < TWO_WEEKS_AGO\n end\n end", "def upload_pdf(form_contents:, form_submission:, station_id:)\n pdf_path = PdfFill::Filler.fill_ancillary_form(form_contents, \"#{form_submission.id}-#{station_id}\", '5655')\n fsr_pdf = File.open(pdf_path)\n\n file_name = \"#{DateTime.now.strftime('%Y%m%dT%H%M%S')}_#{user[:ssn].last(4)}_#{user[:last_name].tr(' ', '_')}\"\n\n file_transfer_path =\n \"#{base_path}/_api/Web/GetFolderByServerRelativeUrl('#{base_path}/Submissions')\" \\\n \"/Files/add(url='#{file_name}.pdf',overwrite=true)\"\n\n with_monitoring do\n response = sharepoint_file_connection.post(file_transfer_path) do |req|\n req.headers['Content-Type'] = 'octet/stream'\n req.headers['Content-Length'] = fsr_pdf.size.to_s\n req.body = Faraday::UploadIO.new(fsr_pdf, 'octet/stream')\n end\n\n File.delete(pdf_path)\n\n response\n end\n end", "def process\n begin\n @pdf = document.slug + '.pdf'\n pdf_contents = asset_store.read_pdf document\n File.open(@pdf, 'wb') {|f| f.write(pdf_contents) }\n case input['task']\n when 'text' then process_text\n when 'images' then process_images\n end\n rescue Exception => e\n LifecycleMailer.exception_notification(e,options).deliver_now\n raise e\n end\n document.id\n end", "def read_drafts(dir); end", "def convertPDF(itemID)\n item = Item[itemID]\n isPending = Item[itemID].status == \"pending\"\n contentPfx = getEnv(isPending ? \"S3_PREVIEW_PREFIX\" : \"S3_CONTENT_PREFIX\")\n\n # Skip non-published items (e.g. embargoed, withdrawn)\n if !item || !%w{published pending}.include?(item.status)\n puts \" Not generating splash for #{item.status} item.\"\n DisplayPDF.where(item_id: itemID).delete # delete splash pages when item gets withdrawn\n deleteContentFiles(itemID)\n return\n end\n\n # If item is transitioning from pending to published, move the old files.\n !isPending and movePendingFiles(itemID)\n\n # Generate the splash instructions, for cache checking\n attrs = JSON.parse(item.attrs)\n instrucs = splashInstrucs(itemID, item, attrs)\n instrucDigest = Digest::MD5.base64digest(instrucs.to_json)\n\n # See if current splash page is adequate\n if File.exist?(arkToFile(itemID, \"meta/base.meta.xml\"))\n origFile = arkToFile(itemID, \"content/base.pdf\")\n else\n origFile = arkToFile(itemID, \"next/content/base.pdf\")\n end\n if !File.exist?(origFile)\n puts \" Missing content file; skipping splash.\"\n return\n end\n origSize = File.size(origFile)\n origTimestamp = File.mtime(origFile)\n\n contentPfx = getEnv(isPending ? \"S3_PREVIEW_PREFIX\" : \"S3_CONTENT_PREFIX\")\n\n dbPdf = DisplayPDF[itemID]\n # It's odd, but comparing timestamps by value isn't reliable. Converting them to strings is though.\n if !$forceMode && dbPdf &&\n dbPdf.orig_size == origSize &&\n dbPdf.orig_timestamp.to_s == origTimestamp.to_s &&\n dbPdf.splash_info_digest == instrucDigest\n puts \" Original unchanged; retaining existing splash version.\"\n #copyPatches(itemID, contentPfx) # FIXME - remove this when s3 transition is complete\n return\n end\n puts \" Updating splash.\"\n\n # Linearize the original PDF\n linFile, linDiff, splashLinFile, splashLinDiff = nil, nil, nil, nil\n begin\n # First, linearize the original file. This will make the first page display quickly in our\n # pdf.js view on the item page.\n linFile = Tempfile.new([\"linearized_#{itemID}_\", \".pdf\"], TEMP_DIR)\n system(\"/apps/eschol/bin/qpdf --linearize #{origFile} #{linFile.path}\")\n code = $?.exitstatus\n code == 0 || code == 3 or raise(\"Error #{code} linearizing.\")\n linSize = File.size(linFile.path)\n\n # Then generate a splash page, and linearize that as well.\n splashLinFile = Tempfile.new([\"splashLin_#{itemID}_\", \".pdf\"], TEMP_DIR)\n splashLinSize = 0\n begin\n splashLinSize = splashGen(itemID, instrucs, linFile, splashLinFile.path)\n rescue Exception => e\n if e.to_s =~ /Internal Server Error|Error 500/\n puts \" Warning: splash generator failed; falling back to plain.\"\n else\n raise\n end\n end\n\n\n # New S3 location\n # Note 2019-02-24: It's important to use TempFile.path here - otherwise Ruby S3 SDK is ridiculously slow.\n # See https://stackoverflow.com/questions/48930354/awss3-put-object-very-slow-with-aws-sdk-ruby\n $s3Bucket.object(\"#{contentPfx}/#{itemID}/#{itemID}_noSplash_#{calcNoSplashKey(itemID)}.pdf\").\n upload_file(linFile.path, { metadata: { sha256: calcSha256(linFile) },\n content_type: \"application/pdf\",\n storage_class: \"INTELLIGENT_TIERING\" })\n\n mainFile = splashLinSize > 0 ? splashLinFile : linFile\n $s3Bucket.object(\"#{contentPfx}/#{itemID}/#{itemID}.pdf\").\n upload_file(mainFile.path, { metadata: { sha256: calcSha256(mainFile) },\n content_type: \"application/pdf\",\n storage_class: \"INTELLIGENT_TIERING\" })\n\n # Update the database\n DisplayPDF.where(item_id: itemID).delete\n DisplayPDF.create(item_id: itemID,\n orig_size: origSize,\n orig_timestamp: origTimestamp,\n linear_size: linSize,\n splash_info_digest: splashLinSize > 0 ? instrucDigest : nil,\n splash_size: splashLinSize\n )\n\n puts sprintf(\" Splash updated: lin=%d/%d = %.1f%%; splashLin=%d/%d = %.1f%%\",\n linSize, origSize, linSize*100.0/origSize,\n splashLinSize, origSize, splashLinSize*100.0/origSize)\n rescue\n # If splashing fails, fall back and put the original file into S3 so we can still\n # access it from the front-end\n $s3Bucket.object(\"#{contentPfx}/#{itemID}/#{itemID}.pdf\").\n upload_file(origFile, { metadata: { sha256: calcSha256(origFile) },\n content_type: \"application/pdf\",\n storage_class: \"INTELLIGENT_TIERING\" })\n $s3Bucket.object(\"#{contentPfx}/#{itemID}/#{itemID}_noSplash_#{calcNoSplashKey(itemID)}.pdf\").\n upload_file(origFile, { metadata: { sha256: calcSha256(origFile) },\n content_type: \"application/pdf\",\n storage_class: \"INTELLIGENT_TIERING\" })\n DisplayPDF.where(item_id: itemID).delete\n raise\n ensure\n linFile and linFile.unlink\n linDiff and linDiff.unlink\n splashLinFile and splashLinFile.unlink\n splashLinDiff and splashLinDiff.unlink\n end\nend", "def push(slide)\n n = to_a.size + 1\n # Paths within the zip file of new files we have to write.\n slide_path = Pathname.new(\"/ppt/slides/slide#{n}.xml\")\n slide_rels_path = Pathname.new(\"/ppt/slides/_rels/slide#{n}.xml.rels\")\n slide_notes_path = Pathname.new(\"/ppt/notesSlides/notesSlide#{n}.xml\")\n slide_notes_rels_path = Pathname.new(\"/ppt/notesSlides/_rels/notesSlide#{n}.xml.rels\")\n\n # Update ./ppt\n # !!! CREATE !!!\n # ./slides\n # Create new files\n # ./slide(\\d+).xml file\n @doc.copy slide_path, slide.path\n # ./_rels/slide(\\d+).xml.rels\n @doc.copy slide_rels_path, slide.rels.path\n # ./notesSlides\n # Create new files\n # ./notesSlide(\\d+).xml file\n @doc.copy slide_notes_path, slide.notes.path\n # ./_rels/notesSlide(\\d+).xml.rels\n @doc.copy slide_notes_rels_path, slide.notes.rels.path\n \n # !!! UPDATES !!!\n # Update the notes in the new slide to point at the new notes\n @doc.edit_xml slide_rels_path do |xml|\n # TODO - Move this rel logic into the parts so that we don't have to repeat ourselves when calculating this stuff out.\n xml.at_xpath(\"//xmlns:Relationship[@Type='#{Notes::REL_TYPE}']\")['Target'] = slide_notes_path.relative_path_from(slide_path.dirname)\n end\n\n # Update teh slideNotes reference to point at the new slide\n @doc.edit_xml slide_notes_rels_path do |xml|\n xml.at_xpath(\"//xmlns:Relationship[@Type='#{Slide::REL_TYPE}']\")['Target'] = slide_path.relative_path_from(slide_notes_path.dirname)\n end\n\n # ./_rels/presentation.xml.rels\n # Update Relationship ids\n # Insert a new one slideRef\n @doc.edit_xml @doc.presentation.rels.path do |xml|\n # Calucate the next id\n next_id = xml.xpath('//xmlns:Relationship[@Id]').map{ |n| n['Id'] }.sort.last.succ\n # TODO - Figure out how to make this more MS idiomatic up 9->10 instead of incrementing\n # the character....\n # Insert that into the slide and crakc open the presentation.xml file\n types = xml.at_xpath('/xmlns:Relationships')\n types << Nokogiri::XML::Node.new(\"Relationship\", xml).tap do |n|\n n['Id'] = next_id\n n['Type'] = Slide::REL_TYPE\n n['Target'] = slide_path.relative_path_from(@doc.presentation.path.dirname)\n end\n # ./presentation.xml\n # Update attr\n # p:notesMasterId\n # Insert attr\n # p:sldId, increment, etc.\n @doc.edit_xml '/ppt/presentation.xml' do |xml|\n slides = xml.at_xpath('/p:presentation/p:sldIdLst')\n next_slide_id = slides.xpath('//p:sldId[@id]').map{ |n| n['id'] }.sort.last.succ\n slides << Nokogiri::XML::Node.new(\"p:sldId\", xml).tap do |n|\n # TODO - Fix the ID that's jacked up.\n n['id'] = next_slide_id\n n['r:id'] = next_id\n end\n end\n end\n\n # Update ./[Content-Types].xml with new slide link and slideNotes link\n @doc.edit_xml @doc.content_types.path do |xml|\n types = xml.at_xpath('/xmlns:Types')\n types << Nokogiri::XML::Node.new(\"Override\", xml).tap do |n|\n n['PartName'] = slide_path\n n['ContentType'] = Slide::CONTENT_TYPE\n end\n types << Nokogiri::XML::Node.new(\"Override\", xml).tap do |n|\n n['PartName'] = slide_notes_path\n n['ContentType'] = Notes::CONTENT_TYPE\n end\n end\n\n # Great, that's all done, so lets return the slide eh?\n slide slide_path\n end", "def process_pending_objects\n prefix = \"#{path.base_name}/#{path.pending}\"\n collection = amazon_s3.bucket.objects(prefix: prefix)\n\n collection.map do |s3_object|\n _, _, filename = s3_object.key.split('/')\n object_type, _, _ = filename.split('_')\n\n content = amazon_s3.convert_download('json', s3_object.get.body.read).first\n s3_object.move_to(\"#{path.base_name_w_bucket}/#{path.ready}/#{filename}\")\n\n # return the content of file to create the requests\n { object_type => content }\n end.flatten\n end", "def copyMotionX(newFiles,baseFolderGPX, folderDownload)\n puts \"\\n6. (165). Copying MotionX gpx files\\n from #{folderDownload} to Massaged Folder and \\nadding to newFiles, the list of files to be processed.\"\n i = 0\n folderNew = \"167. folderDownload: #{folderDownload}\"\n today = Time.now.strftime(\"%Y%m%d\")\n puts \n Find.find(folderDownload) do |fx|\n # puts \"166. fx: #{fx}. File.file?(fx): #{File.file?(fx)}. \"\n next if !File.file?(fx) # the directory we're looking in is added to the fx list, so skip it. # Was Find.prune if … which didn't work\n Find.prune if File.extname(fx) != '.gpx' # get errors trying to process other files on card.\n puts \"\\n174. fx: #{fx}. \\nFile.basename(fx): \\n #{File.basename(fx)}\"\n # Establish file name\n # 2015.03.19 MotionX changed file naming and they don't come with date first anymore, so will have to extract date from file. \n # Read first <time> and set it to firstTime or \n \n # then extract and set dotTime to be added to beginning of filename while keeping the rest of the filenam\n \n dotDate = motionXdate(fx)\n puts \"#{lineNum}. dotDate: #{dotDate}\"\n #REDO THIS AS NEEDED\n yearFile = dotDate[0..3]\n # puts \"185. yearFile: #{yearFile}\"\n dateFile = dotDate.gsub(\".\",\"\")\n puts \"dateFile: #{dateFile}\"\n # puts \"188. folderNew:\"\n puts folderNew = \"#{baseFolderGPX}#{yearFile} Massaged\" # MIGHT MOVE THIS FROM THE TWO DEFS\n \n newBasename = \"#{dotDate} - #{File.basename(fx)}\" # \n # puts \"\\n\\n184. newBasename: #{newBasename}\"\n \n # if today==File.basename(fx, \".TEMP.gpx\")\n # puts \"\\n194. today: #{today}. dateFile: #{dateFile}\"\n if today==dateFile\n # puts \"193.. fx: #{fx}\"\n fileshortnew = newBasename + \".TEMP\" \n fnew = \"#{folderNew}/#{fileshortnew}.gpx\"\n puts \"201.. fnew: #{fnew}.\"\n else # all but today's file\n fnew = \"#{folderNew}/#{newBasename}.gpx\"\n # puts \"204. fnew: #{fnew}.\"\n end # today==. Add TEMP to today's files\n puts \"207.. fx: #{fx}. \"\n if !File.exists?(fnew)\n puts \"209.. fnew: #{fnew}. \"\n newFiles << fnew\n FileUtils.cp(fx, fnew) \n i =+ 1\n end # !File.exists?(fnew). add to newFiles \n \n \n end # Find.find(folderDownload) do |fx|. The basic grind\n puts \"\\n7. (#{lineNum}). Copying and renaming finished. #{i} gpx files copied to #{folderNew}.\\n\" \n # puts \"\\n160. newFiles: #{newFiles}.\\n Not exactly the same as newFiles below.\"\n return newFiles \nend", "def move_files_to(from_folder)\n\n Dir.glob(\"#{from_folder}/*\") do |filename|\n to_path = \"#{timestamped(filename)}\"\n delete_file_if_there(to_path)\n move_file(filename, to_path)\n end\n end", "def aggregate(pdf_paths, final_pdf_path)\n logger.debug \"Trying to aggregate PDFs to #{final_pdf_path}\"\n\n did_compile = false\n exec = \"pdftk #{pdf_paths.join ' '} cat output '#{final_pdf_path}' dont_ask compress\"\n Terminator.terminate 180 do\n did_compile = system exec\n end\n\n if !did_compile\n logger.error \"Failed to aggregate PDFs to #{final_pdf_path}. Command was:\\n\\t#{exec}\"\n end\n did_compile\n end", "def update_file_path\n if self.season_changed? || self.year_changed?\n old_url_part = \"#{SEASON_PATH_NAMES.rassoc(self.season_was).first}-#{self.year_was}\"\n course_ids = self.assignments.pluck(:course_id).uniq\n \n course_ids.each do |course_id|\n course = Course.find(course_id)\n old_path = File.join(course.storage_path, old_url_part)\n \n if File.directory?(old_path)\n new_path = File.join(course.storage_path, self.url_part)\n \n FileUtils.mv old_path, new_path\n end\n end\n end\n end", "def move_file\n\n end", "def sync_down\n existing = list_files\n new_objects = []\n self.objects.each do |obj|\n filename = filename_from_key(obj.key)\n existing.delete( filename )\n file = directory + filename\n if !File.exists?(file)\n puts \"Downloading file #{file} with key #{obj.key})\"\n new_objects << s3_client.get_object({ bucket: bucket, key: obj.key }, target: directory + filename_from_key(obj.key) )\n end\n end\n\n existing.each do |file|\n puts \"Deleting file #{file}\"\n File.delete( directory + file )\n end\n\n # Return true if the directory changed\n (new_objects.count > 0) || (existing.count > 0)\n end", "def fileMoveOldXlsx()\n oldXlsx()\n downloadDir = '~/Downloads'\n Dir.chdir(File.expand_path(downloadDir))\n puts \"Checking Downloads Directory for .xlsx files to clean before initiating Fixit...\"\n Dir.glob(\"*.xlsx\") {|file|\n if file\n puts \"Storing file name '#{file}' with .xlsx extension into OLD_XLSX_DATA on Desktop...\"\n temp_data_path = '~/Desktop/OLD_XLSX_DATA'\n FileUtils.mv(\"#{file}\", File.expand_path(temp_data_path))\n else\n puts \"No .xlsx files found in ~/Downloads...\"\n end\n }\nend", "def pdf_fs_path(issue, basename)\n #debugger\n dir_path = Rails.root.join('public', 'pdfs')\n if not File.exists?(dir_path)\n FileUtils.mkdir_p(dir_path)\n end\n \"#{dir_path}/#{basename}\"\nend", "def download_files\n path = Conf::directories.tmp\n manager = @current_source.file_manager\n manager.start do\n @current_source.folders.each do |folder|\n files = @files[folder]\n puts \"folder => #{folder}, Files => #{files}\" if @opts[:v]\n next if files.empty? \n # download into the TMP directory by folder\n spath = File.join(path, @current_source.name.to_s,folder)\n manager.download_files files,spath,v: true\n move_files folder\n @current_source.schema.insert_files files,folder\n SignalHandler.check { Logger.<<(__FILE__,\"WARNING\",\"SIGINT Catched. Abort.\")}\n end\n end\n end", "def remove_unimported_pages\n end", "def replaced_files; end", "def complete_upload\n @page.s3_object_key = params[:s3_object_key]\n @page.original_s3_object_key = params[:original_s3_object_key]\n @page.original_file_md5 = params[:original_file_md5]\n @page.final_file_md5 = params[:final_file_md5]\n\n errors = []\n begin\n if @page.complete_upload!\n @page.document.enqueue_create_notification_for_completed_page(current_user, @page)\n @page.update_document_initial_pages_completion\n\n # recreate pdf, because document's page have changed. \n @page.document.share_with(:with_user_id => nil, :by_user_id => current_user.id)\n @page.recreate_document_pdf\n\n #When document is initially uploaded, there are a lot of pages uploaded together, we don't want to recreate cache upon every page upload (to get new set of s3 keys). We will just recreate it once the entire set of pages is uploaded\n if @page.document.initial_pages_completed?\n DocumentCacheService.update_cache([:document], @page.document.consumer_ids_for_owners)\n end\n else\n errors << @page.errors.full_messages\n end\n\n rescue AASM::InvalidTransition\n errors << 'S3 Object does not exist'\n end\n\n respond_to do |format|\n if errors.empty?\n format.json { render json: @page }\n else\n format.json { render json: { errors: errors.flatten },\n status: :unprocessable_entity\n }\n end\n end\n end", "def deletePDF\n\n\t\tFileUtils.rm_rf('./storage/PDFs/docraptor-ruby.pdf')\n\n\tend", "def convert_upload_jpgs\n\n page=Page.find(params[:page][:id])\n page.save!\n\n page.save_file(params[:page][:result_jpg], :jpg)\n page.save_file(params[:page][:result_sjpg], :s_jpg)\n\n push_app_status ## send status-update to application main page via private_pub gem, fayes,\n push_converted_page(page)\n\n render :nothing => true\n\n end", "def move_files_to_daily(from_folder)\n to_folder = from_folder + DAILY_FOLDER\n\n create_folder_if_needed(to_folder)\n\n Dir.glob(\"#{from_folder}/*\") do |filename|\n to_path = \"/#{to_folder}/#{File.basename(filename)}\"\n delete_file_if_there(to_path)\n move_file(filename, to_path)\n end\n end", "def move(cloud_file, to_path, root=\"auto\")\n payload = {\n root: root,\n from_path: cloud_file.path,\n to_path: to_path\n }\n\n connexion = Dropbox.start(:move, access_token)\n res = connexion.post do |req|\n req.url \"fileops/move\"\n req.body = payload\n end\n\n response = format_response(res)\n #tree_cache(response)\n end", "def obsolete_files\n out = (existing_files - new_files - new_dirs + replaced_files).to_a\n Jekyll::Hooks.trigger :clean, :on_obsolete, out\n out\n end", "def move_files\n source_dir = Item.new(Path.new(params[:source]))\n dest_dir = Item.new(Path.new(params[:dest]))\n type = params[:type]\n response = {}\n response[:source_dir] = source_dir\n response[:dest_dir] = dest_dir\n if source_dir.move_files_to(dest_dir, type)\n response[:msg] = \"Success\"\n render json: response, status: 200\n else\n response[:msg] = \"Fail\"\n render json: response, status: 402\n end\n end", "def regenerate_pdf(sender)\n write_to_ly_file\n run_lilypond_task(sender)\n reload_pdf\n end", "def clearCachedContentFiles\n #N Without this, the (local) source cached content file won't be deleted\n @sourceLocation.clearCachedContentFile()\n #N Without this, the (remote) source cached content file won't be deleted\n @destinationLocation.clearCachedContentFile()\n end", "def move_captures\n # this is for counting the number of objects moved. Starts at zero.\n iterations = 0\n # scrn_dir is the default screenshot save location on OS X.\n scrn_dir = \"/Users/#{@username}/Desktop\"\n contents = Dir.entries(scrn_dir)\n\n contents.each do |file|\n if (File.extname(file).include? '.png') && (file.include? 'Screen Shot')\n file_src = \"#{scrn_dir}/#{file}\"\n puts \"Moving #{file} to archived captures.\"\n FileUtils.mv(file_src, sub_dir)\n iterations += 1\n end\n end\n return iterations\nend", "def notify_file_mv(src, dst)\r\n notify_file_cp(src, dst)\r\n notify_file_rm(src)\r\n end", "def finish_page_dir\n return unless @page_dir\n\n @files << @page_dir\n\n page_dir = Pathname(@page_dir)\n begin\n page_dir = page_dir.expand_path.relative_path_from @root\n rescue ArgumentError\n # On Windows, sometimes crosses different drive letters.\n page_dir = page_dir.expand_path\n end\n\n @page_dir = page_dir\n end", "def move_articles_to_reader\n log(\"move_articles_to_reader\")\n FileUtils.mv( Dir.glob(\"#{APP_SUPPORT_TMPDIR}/*\"), path, { :force => true } )\n end", "def post_move(filename,src_repo,data)\n curl_post(\"#{self.host}/api2/repos/#{src_repo}/file/?p=#{filename}\",data).body_str\n end", "def download\n if Rails.env.production?\n redirect_to @upload.archive.expiring_url(10)\n else\n redirect_to @upload.archive.url\n end\n end", "def publish!\n self.published = true\n self.downloads = 0\n \n # upgrade if necessary\n if upgrade_needed? || current_version.nil?\n upgrade_version!\n else\n save(:validate => false)\n end\n end", "def existing_files; end", "def mirror_engine_files\n \n begin\n initialize_base_public_directory\n \n log.debug \"Attempting to copy public engine files from '#{source_public_dir}'\"\n \n # if there is no public directory, just return after this file\n return if !File.exist?(source_public_dir)\n\n source_files = Dir[source_public_dir + \"/**/*\"]\n source_dirs = source_files.select { |d| File.directory?(d) }\n source_files -= source_dirs \n \n log.debug \"source dirs: #{source_dirs.inspect}\"\n\n # Create the engine_files/<something>_engine dir if it doesn't exist\n if !File.exists?(self.destination_public_dir)\n # Create <something>_engine dir with a message\n log.debug \"Creating #{self.destination_public_dir} public dir\"\n FileUtils.mkdir_p(self.destination_public_dir)\n end\n\n # create all the directories, transforming the old path into the new path\n source_dirs.uniq.each { |dir|\n begin \n # strip out the base path and add the result to the public path, i.e. replace \n # ../script/../vendor/plugins/engine_name/public/javascript\n # with\n # engine_name/javascript\n #\n relative_dir = dir.gsub(File.join(root, \"public\"), name)\n target_dir = File.join(Engines.public_dir, relative_dir)\n unless File.exist?(target_dir)\n log.debug \"Creating directory '#{target_dir}'\"\n FileUtils.mkdir_p(target_dir)\n end\n rescue Exception => e\n raise \"Could not create directory #{target_dir}: \\n\" + e\n end\n }\n\n # copy all the files, transforming the old path into the new path\n source_files.uniq.each { |file|\n begin\n # change the path from the ENGINE ROOT to the public directory root for this engine\n target = file.gsub(File.join(root, \"public\"), destination_public_dir)\n unless File.exist?(target) && FileUtils.identical?(file, target)\n log.debug \"copying file '#{file}' to '#{target}'\"\n FileUtils.cp(file, target)\n end \n rescue Exception => e\n raise \"Could not copy #{file} to #{target}: \\n\" + e \n end\n }\n rescue Exception => e\n log.warn \"WARNING: Couldn't create the engine public file structure for engine '#{name}'; Error follows:\"\n log.warn e\n end\n end", "def add_pdf_to_db\n @progression = get_progression(9, 13)\n end", "def download_work_papers\n review = @conclusion_draft_review.review\n review.zip_all_work_papers current_organization\n\n redirect_to review.relative_work_papers_zip_path\n end", "def reprocess!\n self.file = self.storage.retrieve(self.path)\n process\n end", "def batch_copy_missing_destination_files(files)\n dest_domain = DestDomain.find_by_namespace(@dest_mogile.domain)\n\n files.each do |file|\n # Quit if no results\n break if file.nil?\n\n # Quit if program exit has been requested.\n break if SignalHandler.instance.should_quit\n\n # Look up the source file's key in the destination domain\n destfile = DestFile.find_by_dkey_and_dmid(file.dkey, dest_domain.dmid)\n if destfile\n # File exists!\n # Check that the source and dest file sizes match\n if file.length != destfile.length\n # File exists but has been modified. Copy it over.\n begin\n Log.instance.debug(\"Key [ #{file.dkey} ] is out of date. Updating.\")\n stream_copy(file)\n @updated += 1\n @copied_bytes += file.length\n rescue => e\n @failed += 1\n Log.instance.error(\"Error updating [ #{file.dkey} ]: #{e.message}\\n#{e.backtrace}\")\n end\n else\n Log.instance.debug(\"key [ #{file.dkey} ] is up to date.\")\n @uptodate += 1\n end\n else\n # File does not exist. Copy it over.\n begin\n Log.instance.debug(\"key [ #{file.dkey} ] does not exist... creating.\")\n stream_copy(file)\n @added += 1\n @copied_bytes += file.length\n rescue => e\n @failed += 1\n Log.instance.error(\"Error adding [ #{file.dkey} ]: #{e.message}\\n#{e.backtrace}\")\n end\n end\n end\n end", "def move_origional_file\n if File.exist? @origional_file\n $logger.info \" moving previous (orig->processed)\\n #{@origional_file} ->\\n #{processed_file}\"\n FileUtils.mkdir_p(File.dirname(processed_file))\n FileUtils.mv @origional_file, processed_file\n end\n end", "def deletePDF\n\t\t\n\t\trequire 'fileutils'\n\n\t\tFileUtils.rm_rf('./storage/PDFs/docraptor-ruby.pdf')\n\n\tend", "def fix\n path = Rails.root.join(\"public/system/files/#{self.id}/original/#{self.file_file_name}\")\n Formatador.display_line(\"Uploading file at: [green]#{path}[/]\")\n if File.exists?(path)\n self.attached_file.store!(File.open(path))\n self.update_attribute(:attached_file, self.file_file_name)\n Formatador.display_line(\"[yellow]Done![/]\")\n else\n Formatador.display_line(\"[red]ERROR: [/]File does not exist!\")\n end\n end", "def publish!(repository_client, publication)\n files = stage_attached_files(publication)\n response = repository_work(repository_client, publication, files).publish\n publication.update(pub_url: publication_url(repository_client, response: response[:response]))\n publication.publish!\n end" ]
[ "0.6199648", "0.6034519", "0.5940353", "0.5876566", "0.58104545", "0.57956475", "0.5758618", "0.57388127", "0.56893677", "0.5676972", "0.56698865", "0.5658122", "0.562783", "0.56124794", "0.5606567", "0.5584885", "0.55458784", "0.55362004", "0.55171365", "0.5503927", "0.54940104", "0.5487329", "0.54444605", "0.54374236", "0.5405149", "0.5402815", "0.5390512", "0.53786576", "0.53677434", "0.5328375", "0.5323678", "0.53185284", "0.52830017", "0.5280695", "0.5279585", "0.5265652", "0.52421606", "0.5235795", "0.52280486", "0.52264255", "0.52232695", "0.5222436", "0.5202438", "0.51838", "0.51796573", "0.5160276", "0.5150999", "0.5130161", "0.51211715", "0.51180655", "0.51159424", "0.5109998", "0.5107675", "0.5088951", "0.5086595", "0.5085182", "0.50805235", "0.50775343", "0.5077326", "0.50744885", "0.5074352", "0.5074252", "0.5072674", "0.50659573", "0.5065427", "0.5062345", "0.5052371", "0.50519794", "0.50396854", "0.50356054", "0.5026906", "0.5015781", "0.5001321", "0.4999027", "0.49957824", "0.4995277", "0.4994582", "0.49915013", "0.4985845", "0.49837983", "0.49785548", "0.49784932", "0.49729478", "0.4964257", "0.49633378", "0.49615338", "0.4960953", "0.4956625", "0.49518946", "0.49483025", "0.4947786", "0.49398693", "0.49315584", "0.49298733", "0.49296626", "0.4925721", "0.49252626", "0.49238586", "0.4923094", "0.4916042" ]
0.6521535
0
Delete files for withdrawn item
def deleteContentFiles(itemID) noSplashKey = calcNoSplashKey(itemID) # Remove the preview files if present pvwPfx = getEnv("S3_PREVIEW_PREFIX") pvwLin = $s3Bucket.object("#{pvwPfx}/#{itemID}/#{itemID}_noSplash_#{noSplashKey}.pdf") pvwLin.exists? and pvwLin.delete pvwSplash = $s3Bucket.object("#{pvwPfx}/#{itemID}/#{itemID}.pdf") pvwSplash.exists? and pvwSplash.delete # Remove the published files if present contentPfx = getEnv("S3_CONTENT_PREFIX") newSplash = $s3Bucket.object("#{contentPfx}/#{itemID}/#{itemID}.pdf") newSplash.exists? and newSplash.delete newLin = $s3Bucket.object("#{contentPfx}/#{itemID}/#{itemID}_noSplash_#{noSplashKey}.pdf") newLin.exists? and newLin.delete end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_files\n self.bruse_files.each do |file|\n file.destroy\n end\n end", "def delete_file\n unless $list_Item.curselection.empty?\n idx = $list_Item.curselection\n idx = idx[0]\n $bucket_item = $bucket_items[idx]\n ok_delete = Tk.messageBox('type' => 'okcancel',\n 'icon' => 'warning',\n 'title' => 'Delete Bucket',\n 'message' => 'Delete item?')\n if ok_delete == 'ok'\n begin\n $s3.bucket($bucket).objects(prefix: $bucket_item).batch_delete!\n $item_text.delete('1.0','end')\n $save_file_button.state = 'disabled'\n $delete_file_button.state = 'disabled'\n $item_public_read.state = 'disabled'\n $item_public_write.state = 'disabled'\n rescue => e\n Tk.messageBox('type' => 'ok',\n 'icon' => 'error',\n 'title' => 'Delete File',\n 'message' => \"Cannot Delete File #{e}\")\n end\n end\n end\n end", "def delete_file_parts\n #TODO implementation\n end", "def delete(filename); end", "def clean_debris \n objdirs = File.join(\"**/\", \"obj\")\n userfiles = File.join(\"**/\", \"*.vcxproj.user\")\n\n delete_list = FileList.new(objdirs, userfiles)\n delete_list.each do |file|\n puts \"Removing #{file}\"\n FileUtils.rm_rf(\"#{file}\")\n end\nend", "def clean_debris \n objdirs = File.join(\"**/\", \"obj\")\n userfiles = File.join(\"**/\", \"*.vcxproj.user\")\n\n delete_list = FileList.new(objdirs, userfiles)\n delete_list.each do |file|\n puts \"Removing #{file}\"\n FileUtils.rm_rf(\"#{file}\")\n end\nend", "def delete_extra_files( filelist )\n\t\t\tdescription = humanize_file_list( filelist, '\t ' )\n\t\t\tlog \"Files to delete:\\n \", description\n\t\t\task_for_confirmation( \"Really delete them?\", false ) do\n\t\t\t\tfilelist.each do |f|\n\t\t\t\t\trm_rf( f, :verbose => true )\n\t\t\t\tend\n\t\t\tend\n\t\tend", "def del\n File.delete(@file)\n end", "def delete_files\n\t\t\tFileUtils.rm_rf(@clean_image)\n\t\t\tFileUtils.rm_rf(@image) if pdf?\n\t\tend", "def delete_file\n File.unlink file\n end", "def delete_file\n File.unlink file\n end", "def delete_extra_files( filelist )\n\tdescription = humanize_file_list( filelist, ' ' )\n\tlog \"Files to delete:\\n \", description\n\task_for_confirmation( \"Really delete them?\", false ) do\n\t\tfilelist.each do |f|\n\t\t\trm_rf( f, :verbose => true )\n\t\tend\n\tend\nend", "def delete_file\n @file = []\n end", "def delete_files(uuids)\n Uploadcare::FileList.batch_delete(uuids)\n end", "def gp_delete_file(aid)\n data = Asn1Ber.encode [{:class => :application, :primitive => true,\n :number => 0x0F, :value => aid}]\n response = iso_apdu! :cla => 0x80, :ins => 0xE4, :p1 => 0x00, :p2 => 0x80,\n :data => data\n delete_confirmation = response[1, response[0]]\n delete_confirmation\n end", "def delete_nsec3_files()\n w = Dir.new(@working)\n w.each {|f|\n if ((f.index(\"audit\")) && (f.index(\"#{Process.pid}\")))\n begin\n File.delete(@working + File::SEPARATOR + f.untaint)\n rescue Exception => e\n print \"Can't delete temporary auditor file #{f}, error : #{e}\\n\"\n end\n end\n }\n end", "def delete_file(file)\n delete_attachment(file)\n end", "def _delete(uploaded_file, context)\n remove(uploaded_file, context)\n end", "def delete\n File.delete(file_name)\n rescue\n # ignore\n end", "def cleanup\n FileUtils.rm_f Dir.glob(File.join(config.folder, '*.items'))\n end", "def delete_file(basepath = MP3_STORAGE_PATH)\n FileUtils.rm_rf(\"#{basepath}/#{id}\")\n end", "def destroy\n @file_item = FileItem.cs(self.current_scope).find_by_path(params[:id])\n @file_item.destroy\n\n respond_to do |format|\n format.html { redirect_to file_items_url }\n format.json { head :ok }\n end\n end", "def remove(filename); end", "def delete_files#:doc:\n sizes.keys.each do |size|\n File.delete(save_path_with_filename(size))\n end\n rescue\n ensure\n return true\n end", "def delete(*filenames); end", "def delete(filename)\n File.delete File.join(@base_path, filename)\n end", "def delete_file \n #pp \"deleting file_asset: path is\" + full_filepath\n File.delete(full_filepath) if File.exists?(full_filepath)\n end", "def delete_current_presentation(file_id, user)\n delete_url = \"https://www.googleapis.com/drive/v2/files/#{file_id}\"\n headers = { 'Authorization': \"Bearer #{user.google_access_token}\", 'Content-type': 'application/json' }\n rest_resource = RestClient::Resource.new(delete_url, :headers => headers)\n rest_resource.delete\n end", "def delete_file(uid, info = {})\n if info[\"multipart_id\"]\n multipart_upload = object(uid).multipart_upload(info[\"multipart_id\"])\n abort_multipart_upload(multipart_upload)\n\n delete [object(\"#{uid}.info\")]\n else\n delete [object(uid), object(\"#{uid}.info\")]\n end\n end", "def destroy_file\n File.delete full_file_path\n rescue\n end", "def delete_files(files)\n not_found = []\n files.each do |file|\n file_stored = Files.where({ '_id' => file[:uuid]}).first\n if file_stored.nil?\n logger.error 'File not found ' + file.to_s\n not_found << file\n else\n if file_stored['pkg_ref'] == 1\n # Referenced only once. Delete in this case\n file_stored.destroy\n del_ent_dict(file_stored, :files)\n file_md5 = Files.where('md5' => file_stored['md5'])\n if file_md5.size.to_i.zero?\n # Remove files from grid\n grid_fs = Mongoid::GridFs\n grid_fs.delete(file_stored['grid_fs_id'])\n end\n else\n # Referenced above once. Decrease counter\n file_stored.update_attributes(pkg_ref: file_stored['pkg_ref'] - 1)\n end\n # file_stored.destroy\n # del_ent_dict(file_stored, :files)\n #\n # # Remove files from grid\n # grid_fs = Mongoid::GridFs\n # grid_fs.delete(file_stored['grid_fs_id'])\n end\n end\n not_found\n end", "def delete_opml_file\n if self.filename.present?\n Feedbunch::Application.config.uploads_manager.delete self.user_id, OpmlExporter::FOLDER, self.filename\n end\n end", "def delete_service_files(resource)\n file get_service_script_name(resource) do\n action :delete\n only_if { get_service_script_name != nil }\n end\nend", "def delete_files\n #TODO delete original file\n unless filename.blank?\n File.delete(splash_file(:full_path => true)) if File.exists?(splash_file(:full_path => true))\n File.delete(flv_file(:full_path => true)) if File.exists?(flv_file(:full_path => true))\n File.delete(original_file) if File.exists?(original_file)\n end\n end", "def destroy(item)\n raise StandardError unless @mode == :update\n @attached.delete(item)\n @remove_file.puts(XML.generate({ :id => item.is_a?(String) ? item : item.id }, false))\n end", "def delete\n begin \n # file_assets\n file_assets.each do |file_asset|\n file_asset.delete\n end\n # We now reload the self to update that the child assets have been removed...\n reload()\n # Call ActiveFedora Deleted via super \n super()\n rescue Exception => e\n raise \"There was an error deleting the resource: \" + e.message\n end\n end", "def remove_files\n @batch.each_open_file_path do |path|\n 3.times do |i| \n begin \n File.unlink(path)\n break \n rescue Errno::EACCES # sometimes windows does not like this. let's wait and retry.\n sleep(1) # just in case it's open by something else..\n next unless i == 2 \n $stderr.puts \"Cannot remove #{path}...giving up.\"\n end \n end\n end\n end", "def RenDeletingFiles\n\t#arquivo = File.new(\"arquivo1.txt\", \"w\")\n\t#arquivo.close()\n\t#File.delete(\"arquivo1.txt\")\nend", "def delete_files\n return if id.nil?\n return unless File.exist?(directory_path)\n\n FileUtils.rm_rf(directory_path)\n s3_delete_files\n end", "def destroy\n remove_files(@path + \"*\")\n end", "def delete\n ::File.unlink(@path)\n end", "def remove\n rows = self.open_import_file\n field = rows.first\n rows.each do |row|\n item_identifier = row['item_identifier'].to_s.strip\n if item = Item.where(:item_identifier => item_identifier).first\n item.destroy\n end\n end\n end", "def remove file\n file.delete\n @files -= [file]\n end", "def destroy\n item = Item.find(params[:item_id])\n user = User.find(item[:user_id])\n if(user && user[:username] == session['username'])\n if (item.item_type == 'file')\n FileUploader.delete_file item.path\n end\n Item.delete(params[:item_id])\n end\n end", "def destroy\n @feefile = Feefile.find(params[:id])\n directory= \"uploads\"\n path =File.join(directory,@feefile.feefilename)\n File.delete(path)\n @feefile.destroy\n \n\n respond_to do |format|\n format.html { redirect_to(feefiles_url) }\n format.xml { head :ok }\n end\n end", "def removed_cookbook_file(path)\n end", "def delete\n msg = FileOperations.id_exist?(self) ? FileOperations.delete(self) : 'Product\n Not Found'\n puts msg\n end", "def delete\n Modeles::File.delete @fileInTable.id\n @errors = nil\n @fileInTable = nil\n @path = nil\n @user = nil\n @group = nil\n @userRights = nil\n @groupRights = nil\n @othersRights = nil\n end", "def _delete_unused_associations_file(file)\n if file && File.file?(file)\n File.unlink(file)\n end\n end", "def delete\n File::unlink @path+\".lock\" rescue nil\n File::unlink @path+\".new\" rescue nil\n File::unlink @path rescue nil\n end", "def delete_file(filename)\r\n DeleteFile.new(filename)\r\n end", "def delete\n @uppity_file = PostedFile.get(params[:id])\n @uppity_file.destroy\n redirect_to(posts_index_url)\n end", "def delete_from_disk; end", "def deleteItems\n self.items.each do |item|\n item.delete\n end\n end", "def delete_file(no_raise: true)\n __debug_items(binding)\n return if destroyed? || attached_file.nil?\n file_attacher.destroy\n file_attacher.set(nil)\n rescue => error\n log_exception(error, __method__)\n re_raise_if_internal_exception(error)\n raise error unless no_raise\n end", "def delete (fei)\n\n fei_path = compute_file_path(fei)\n\n #ldebug { \"delete() for #{fei.to_debug_s} at #{fei_path}\" }\n\n File.delete(fei_path)\n end", "def delete_extra_files( *filelist )\n\t\tdescription = humanize_file_list( filelist, '\t ' )\n\t\tself.prompt.say \"Files to delete:\"\n\t\tself.prompt.say( description )\n\n\t\tif self.prompt.yes?( \"Really delete them?\" ) {|q| q.default(false) }\n\t\t\tfilelist.each do |f|\n\t\t\t\trm_rf( f, verbose: true )\n\t\t\tend\n\t\tend\n\tend", "def destroy\n file&.delete\n end", "def delete_file_and_folder!( file_path )\n FileUtils.rm_f file_path\n boundary = adapter_path + '/'\n loop do\n file_path = File.dirname file_path\n break unless file_path.index boundary\n FileUtils.rmdir file_path\n end\n end", "def delete!\n safe_close\n File.delete(@file_path)\n end", "def deleteIgnoreFile(fileName)\n @fileAccess.deleteIgnoreFile(fileName)\n end", "def delete(uploaded_file, context = {})\n _delete(uploaded_file, context)\n uploaded_file\n end", "def delete_item\n\nend", "def delete_files(*files)\n files = files.flatten\n unless files.empty?\n @perforce.run(\"delete\", \"-c\", @number, *files)\n end\n end", "def delete_item(access_token)\n @client.item.remove(access_token)\n end", "def delete\n File::unlink @path+\".lock\" rescue nil\n File::unlink @path+\".new\" rescue nil\n File::unlink @path rescue Errno::ENOENT\n end", "def item_delete(delete_item)\n @items.delete_if {|e| e.description == delete_item.capitalize}\n conf_message(delete_item, \"removed\")\n end", "def destroy\n @f = F.find(params[:id])\n if @f\n filename = version_path + '/' + @f.name\n if File.exists?(filename)\n puts \"delete #{filename}\"\n puts File.delete(filename)\n end\n \n #if not delete last file, must reorder all file sn \n if @f.sn != @package.fs.size\n @package.fs.each do |x|\n if x.sn > @f.sn\n x.sn -= 1\n x.save\n end\n end\n end\n \n @f.destroy\n end\n \n redirect_to software_package_fs_path(@software, @package) \n end", "def delete\n @file = nil\n # file.delete\n end", "def delete_item(item)\n @chores.delete(item)\n end", "def delete_file_from_database(file_id)\n $db.execute(\"DELETE FROM files WHERE id = ?\", file_id)\n $db.execute(\"DELETE FROM file_share_table WHERE file_id = ?\", file_id)\nend", "def remove_imagekit_file\n service.class.delete_ik_file(self)\n end", "def clean_up\n @files.each {|file| FileUtils.remove(file.path)}\n end", "def destroy\n @file = Asset.find_by(uid: params[:id])\n unless @file.editable_by?(@context)\n type = :warning\n text = \"You have no permission to deleted this Asset \\\"#{@file.prefix}\\\"\"\n path = api_assets_path\n\n render json: { path: path, message: { type: type, text: text } }, adapter: :json\n return\n end\n\n UserFile.transaction do\n @file.reload\n\n if @file.license.present? && !@file.apps.empty?\n type = :error\n text = \"This asset contains a license, and has been included in one or more apps. \" \\\n \"Deleting it would render the license inaccessible to these apps, \" \\\n \"breaking reproducibility. You can either first remove the license \" \\\n \"(allowing these existing apps to run without requiring a license) \" \\\n \"or contact the precisionFDA team to discuss other options.\"\n path = api_asset_path(@file)\n\n render json: { path: path, message: { type: type, text: text } }, adapter: :json\n return\n end\n @file.destroy\n end\n\n DNAnexusAPI.new(@context.token).call(@file.project, \"removeObjects\", objects: [@file.dxid])\n\n type = :success\n text = \"Asset \\\"#{@file.prefix}\\\" has been successfully deleted\"\n path = api_assets_path\n\n render json: { path: path, message: { type: type, text: text } }, adapter: :json\n end", "def remove_file\n\n @source_files_id = params[:source] + '_files'\n @source = TaliaCore::Source.find(N::URI.from_encoded(params[:source]))\n\n TaliaFile.find(params[:talia_file_uri]).destroy\n end", "def delete(command)\n pp @client.files.delete(clean_up(command[1]))\n end", "def delete_file(uid, info = {})\n grid_info = files_collection.find(filename: uid).first\n bucket.delete(grid_info[:_id]) if grid_info\n end", "def delete(files)\n # sync before we delete\n sync\n Array.wrap(files).each do |f|\n info \"removing #{f}\"\n FileUtils.rm(f)\n error \"#{f} wasn't removed\" if File.exists?(f)\n end\n end", "def destroy\n @client = Client.find(params[:id])\n Client.transaction do\n FileUtils.rm Dir[\"#{Rails.root}/public/files/logo_files/\"+@client.logo.to_s]\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully deleted.' }\n format.json { head :no_content }\n end\n end\n end", "def cleanup\n FileUtils.rm_f(@path)\n delete\n end", "def delete_files_and_empty_parent_directories\n style_names = reflection.styles.map{|style| style.name} << :original\n # If the attachment was set to nil, we need the original value\n # to work out what to delete.\n if column_name = reflection.column_name_for_stored_attribute(:file_name)\n interpolation_params = {:basename => record.send(\"#{column_name}_was\")}\n else\n interpolation_params = {}\n end\n style_names.each do |style_name|\n path = interpolate_path(style_name, interpolation_params) or\n next\n FileUtils.rm_f(path)\n begin\n loop do\n path = File.dirname(path)\n FileUtils.rmdir(path)\n end\n rescue Errno::EEXIST, Errno::ENOTEMPTY, Errno::ENOENT, Errno::EINVAL, Errno::ENOTDIR\n # Can't delete any further.\n end\n end\n end", "def purge\n ::FileUtils.rm(@fname)\n end", "def delete_uploaded_file(new_file)\n if version_name.blank? && Refinery::PhotoGallery.delete_uploaded_file\n filename_to_delete = File.join(Rails.root.to_s,Refinery::PhotoGallery.photo_gallery_dir_relative_to_root, store_dir, filename )\n File.delete(filename_to_delete)\n end\n end", "def delete_from(grocery, item)\n grocery.delete(item)\n grocery\nend", "def rm_file(file)\n @files.delete(file.path)\n end", "def deleteItem\n\t\tif @public_id\n\t\t\tCloudinary::Uploader.destroy(@public_id)\n\t\tend\n\tend", "def remove(uploaded_file, context)\n uploaded_file.delete\n end", "def deleteFile(file_path)\n puts \"Delete file: \" + file_path.to_s\n File.delete(file_path) if File.exist?(file_path)\nend", "def remove_item(file_name)\n frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(file_name)}/).link(:href=>/doRemoveitem/).click\n end", "def delete_one(file)\n files_collection.find(:_id => file.id).delete_one\n chunks_collection.find(:files_id => file.id).delete_many\n end", "def delete(permanent = false)\n if permanent\n @session.execute!(\n :api_method => @session.drive.files.delete,\n :parameters => {\"fileId\" => self.id})\n else\n @session.execute!(\n :api_method => @session.drive.files.trash,\n :parameters => {\"fileId\" => self.id})\n end\n return nil\n end", "def clear\n if ::File.exists?(@file) \n @log.info(\"Deleted id list file.\")\n ::File.delete(@file)\n end\n end", "def erase\n HDB.verbose and puts \"Erasing successfully-copied files\"\n unlinkable = @files.collect do |x|\n f = get_real_filename(x)\n File.directory?(f) or File.symlink?(f)\n end\n # TODO: unlink them now.\n # TODO: rmdir directories, starting with child nodes first\n raise \"erase unimplemented\"\n end", "def remove_files\n resource.formats.each do |fmt|\n converted_csv = fmt.converted_csv_file\n File.unlink(converted_csv) if File.exist?(converted_csv)\n diff = fmt.diff_file\n File.unlink(diff) if File.exist?(diff)\n end\n end", "def rm_file(file)\n @files.delete(file.path)\n end", "def delete_file(path)\n \n puts \"Sending path via MCollective Files client\"\n @mc.delete(:path => path)\n printrpcstats\n \n end", "def deleteUploadFile\n\n filepath = Rails.root.join(path, file_name)\n\n if File.exist? filepath \n File.delete filepath\n end\n\n end", "def delete_package_file_if_necessary\n # Unless, other packages reference the package on the filesystem\n unless Package.where(:installer_item_location => self.installer_item_location).length > 1\n begin\n FileUtils.remove(Munki::Application::PACKAGE_DIR + self.installer_item_location)\n rescue\n logger.error \"Unable to remove #{self.installer_item_location} from filesystem\"\n end\n end\n end", "def delete_fs_item\n d \"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\"\n d \"Delete a file or folder\"\n d \"vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\"\n \n err_str = ''\n begin # a one time loop to allow break\n \n generic_ty = Integer(params[:sel_kind]) rescue generic_ty = FSTYPE_INVALID\n elem_id = Integer(params[:sel_id]) rescue elem_id = -1\n if ( elem_id <= 0 )\n err_str = 'Invalid index'\n break\n end\n \n if ( generic_ty == FSTYPE_FILE )\n to_upd = Dfile.find_by_id( elem_id )\n if ( to_upd )\n kindname = to_upd.fileType()\n parent_id = to_upd.directory_id\n our_name = to_upd.name\n if to_upd.destroy\n reponse = { action_id: params[:action_id],\n new_id: elem_id,\n new_name: our_name,\n parent_id: parent_id,\n kind_name: kindname\n }\n render :json => reponse, :layout => false, :status => 200 and return\n else\n err_str = 'Failed to delete file'\n break\n end\n else\n err_str = 'File does not exist'\n break\n end\n elsif ( generic_ty == FSTYPE_DIR )\n to_upd = Directory.find_by_id( elem_id )\n if ( to_upd )\n parent_id = to_upd.parent_id\n our_name = to_upd.name\n if to_upd.destroy\n reponse = { action_id: params[:action_id],\n new_id: elem_id,\n new_name: our_name,\n parent_id: parent_id,\n kind_name: 'directory'\n }\n render :json => reponse, :layout => false, :status => 200 and return\n else\n err_str = 'Failed to delete directory'\n break\n end\n else\n err_str = 'Directory does not exist'\n break\n end\n else\n err_str = 'Invalid entry type'\n break\n end\n \n end until true # a one time loop to allow break\n render json: err_str, status: :unprocessable_entity and return\n end", "def remove_item(id)\n return nil if self.class.mode == :sandbox\n\n query = { \"type\" => \"delete\", \"id\" => id.to_s, \"version\" => Time.now.to_i }\n doc_request query\n end" ]
[ "0.6786215", "0.66417307", "0.6447713", "0.64057434", "0.632493", "0.632493", "0.6320871", "0.6271678", "0.62684005", "0.6254861", "0.6254861", "0.6230634", "0.621647", "0.6210378", "0.6100743", "0.6067716", "0.60552436", "0.60392725", "0.60035914", "0.59971553", "0.59946644", "0.59903073", "0.5971742", "0.59602076", "0.59545946", "0.594228", "0.59171456", "0.59117186", "0.59072196", "0.5905166", "0.59017974", "0.58802235", "0.5864645", "0.5862442", "0.58599", "0.5859849", "0.5857375", "0.5844924", "0.5824508", "0.58241075", "0.58219606", "0.5819198", "0.580725", "0.57953715", "0.57888687", "0.5780238", "0.57791317", "0.57755786", "0.5769397", "0.5760465", "0.5758443", "0.575801", "0.5756644", "0.57534623", "0.5748198", "0.57465297", "0.57432556", "0.5733316", "0.57327193", "0.57306176", "0.57269204", "0.5716105", "0.5715461", "0.5706546", "0.5701087", "0.56898856", "0.5680256", "0.56671953", "0.5665719", "0.5664357", "0.5661319", "0.5654087", "0.5651954", "0.56475246", "0.563704", "0.5630756", "0.5630579", "0.5627017", "0.56257516", "0.5620358", "0.5618976", "0.56111634", "0.56096065", "0.5605074", "0.56018686", "0.559586", "0.5587916", "0.5585996", "0.55776674", "0.55760807", "0.5576018", "0.5574185", "0.55730987", "0.55669373", "0.5564097", "0.5554185", "0.5551861", "0.55502504", "0.5548099", "0.5547859" ]
0.6251912
11
Main driver for PDF display version generation
def convertPDF(itemID) item = Item[itemID] isPending = Item[itemID].status == "pending" contentPfx = getEnv(isPending ? "S3_PREVIEW_PREFIX" : "S3_CONTENT_PREFIX") # Skip non-published items (e.g. embargoed, withdrawn) if !item || !%w{published pending}.include?(item.status) puts " Not generating splash for #{item.status} item." DisplayPDF.where(item_id: itemID).delete # delete splash pages when item gets withdrawn deleteContentFiles(itemID) return end # If item is transitioning from pending to published, move the old files. !isPending and movePendingFiles(itemID) # Generate the splash instructions, for cache checking attrs = JSON.parse(item.attrs) instrucs = splashInstrucs(itemID, item, attrs) instrucDigest = Digest::MD5.base64digest(instrucs.to_json) # See if current splash page is adequate if File.exist?(arkToFile(itemID, "meta/base.meta.xml")) origFile = arkToFile(itemID, "content/base.pdf") else origFile = arkToFile(itemID, "next/content/base.pdf") end if !File.exist?(origFile) puts " Missing content file; skipping splash." return end origSize = File.size(origFile) origTimestamp = File.mtime(origFile) contentPfx = getEnv(isPending ? "S3_PREVIEW_PREFIX" : "S3_CONTENT_PREFIX") dbPdf = DisplayPDF[itemID] # It's odd, but comparing timestamps by value isn't reliable. Converting them to strings is though. if !$forceMode && dbPdf && dbPdf.orig_size == origSize && dbPdf.orig_timestamp.to_s == origTimestamp.to_s && dbPdf.splash_info_digest == instrucDigest puts " Original unchanged; retaining existing splash version." #copyPatches(itemID, contentPfx) # FIXME - remove this when s3 transition is complete return end puts " Updating splash." # Linearize the original PDF linFile, linDiff, splashLinFile, splashLinDiff = nil, nil, nil, nil begin # First, linearize the original file. This will make the first page display quickly in our # pdf.js view on the item page. linFile = Tempfile.new(["linearized_#{itemID}_", ".pdf"], TEMP_DIR) system("/apps/eschol/bin/qpdf --linearize #{origFile} #{linFile.path}") code = $?.exitstatus code == 0 || code == 3 or raise("Error #{code} linearizing.") linSize = File.size(linFile.path) # Then generate a splash page, and linearize that as well. splashLinFile = Tempfile.new(["splashLin_#{itemID}_", ".pdf"], TEMP_DIR) splashLinSize = 0 begin splashLinSize = splashGen(itemID, instrucs, linFile, splashLinFile.path) rescue Exception => e if e.to_s =~ /Internal Server Error|Error 500/ puts " Warning: splash generator failed; falling back to plain." else raise end end # New S3 location # Note 2019-02-24: It's important to use TempFile.path here - otherwise Ruby S3 SDK is ridiculously slow. # See https://stackoverflow.com/questions/48930354/awss3-put-object-very-slow-with-aws-sdk-ruby $s3Bucket.object("#{contentPfx}/#{itemID}/#{itemID}_noSplash_#{calcNoSplashKey(itemID)}.pdf"). upload_file(linFile.path, { metadata: { sha256: calcSha256(linFile) }, content_type: "application/pdf", storage_class: "INTELLIGENT_TIERING" }) mainFile = splashLinSize > 0 ? splashLinFile : linFile $s3Bucket.object("#{contentPfx}/#{itemID}/#{itemID}.pdf"). upload_file(mainFile.path, { metadata: { sha256: calcSha256(mainFile) }, content_type: "application/pdf", storage_class: "INTELLIGENT_TIERING" }) # Update the database DisplayPDF.where(item_id: itemID).delete DisplayPDF.create(item_id: itemID, orig_size: origSize, orig_timestamp: origTimestamp, linear_size: linSize, splash_info_digest: splashLinSize > 0 ? instrucDigest : nil, splash_size: splashLinSize ) puts sprintf(" Splash updated: lin=%d/%d = %.1f%%; splashLin=%d/%d = %.1f%%", linSize, origSize, linSize*100.0/origSize, splashLinSize, origSize, splashLinSize*100.0/origSize) rescue # If splashing fails, fall back and put the original file into S3 so we can still # access it from the front-end $s3Bucket.object("#{contentPfx}/#{itemID}/#{itemID}.pdf"). upload_file(origFile, { metadata: { sha256: calcSha256(origFile) }, content_type: "application/pdf", storage_class: "INTELLIGENT_TIERING" }) $s3Bucket.object("#{contentPfx}/#{itemID}/#{itemID}_noSplash_#{calcNoSplashKey(itemID)}.pdf"). upload_file(origFile, { metadata: { sha256: calcSha256(origFile) }, content_type: "application/pdf", storage_class: "INTELLIGENT_TIERING" }) DisplayPDF.where(item_id: itemID).delete raise ensure linFile and linFile.unlink linDiff and linDiff.unlink splashLinFile and splashLinFile.unlink splashLinDiff and splashLinDiff.unlink end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @staticdcs = Staticdc.all\n @sdc_dir = \"/usr/local/projects/pdf_test/\"\n @public_pdf_address = display_pdfs(\"public\")\n # @uva_pdf_address = display_pdfs(uva)\n\n end", "def setup \n @pdf_name = \"pdf name\"\n @options = { :pdf_layout => \"reports_layout.pdf.erb\", :pdf_template => \"reports/report.pdf.erb\", \n :render_options => {\n :header_right => 'Page [page] of [toPage]',\n :grayscale => true,\n :page_size => 'Letter'} \n } \n @page = \"<html><head><head><body><b>Hello</b> World</body></html>\" \n \n TooRendermonkey.configure = {\n :uri => \"http://localhost:4567/generate\",\n :api_key => \"835a3161dc4e71b\",\n :hash_key => \"sQQTe93eWcpV4Gr5HDjKUh8vu2aNDOvn3+suH1Tc4P4=\"\n } \n end", "def generate_pdf_version!\n HardCopyGenerators::FormDataGenerator.new(self).run\n end", "def main\n ARGV.each do |arg|\n make_pdf arg\n end\nend", "def generate\n add_intro\n add_blood_pressure_intro\n add_blood_pressure_list\n add_blood_pressure_outro\n add_medications_intro\n add_medications_list\n add_about\n\n @pdf\n end", "def show\n require \"prawn\"\n\n Prawn::Document.generate(\"hello.pdf\") do\n text \"Hello World!\"\n end\n end", "def show\n @cv = Cv.find(params[:id])\n respond_to do |format|\n format.html\n format.pdf do\n render pdf: \"cv. #{@cv_params}\",\n page_size: 'A4',\n template: \"cvs/show.html.erb\",\n layout: \"pdf.html\",\n lowquality: true,\n zoom: 1,\n dpi: 75\n end\n end\n end", "def show_document\n\tprint_header\n\tprint_document\n\tprint_footer\nend", "def viewer( pdf )\n\tProcess.fork do\n\t\tENV['DISPLAY'] = ':0.1'\n\t\texec \"evince #{pdf}\"\n\tend if `lsof #{pdf}`.empty?\nend", "def pdftk; end", "def show\n @bg_gray = true\n respond_to do |format|\n format.html\n format.pdf do\n render :pdf => 'obj_vend_pdf', \n :template => 'vendedors/obj_vend_pdf.html.erb',\n :layout => 'pdf.html.erb',\n :orientation => 'Portrait',# default Portrait\n :page_size => 'Legal'\n end\n end\n end", "def show\n respond_to do |format|\n format.html\n format.pdf do\n render pdf: \"specs\",\n encoding: \"UTF-8\",\n layout: \"pdf.html.erb\"\n end\n end\n end", "def outputPageFile(fltCompName)\n # Initialize the name, row, and column parameters\n $nextColumnHeader = fltCompName + ccdd.getRootStructureTableNames()[0]\n $lastSubStructureName = $nextColumnHeader\n $columnStep = 20\n $maxColumnLength = $columnStep\n $columnOffset = -$columnStep - 1\n $maxNumRows = 46\n $rowCount = $maxNumRows\n $columnCount = 0\n $inMiddleOfArray = false\n\n # Check if structure data is provided\n if $numStructRows != 0\n # Build the page file name and open the page output file\n baseName = \"auto_\" + fltCompName + ccdd.getRootStructureTableNames()[0]\n pageFileName = ccdd.getOutputPath() + baseName + \".page\"\n pageFile = ccdd.openOutputFile(pageFileName)\n\n # Check if the page output file successfully opened\n if pageFile != nil\n # Begin building the page display. The \"page\" statement must be on\n # the first row\n ccdd.writeToFileLn(pageFile, \"page \" + baseName)\n ccdd.writeToFileLn(pageFile, \"\")\n outputFileCreationInfo(pageFile)\n ccdd.writeToFileLn(pageFile, \"color default (orange, default)\")\n ccdd.writeToFileLn(pageFile, \"color mnedef (text (white, black) )\")\n ccdd.writeToFileLn(pageFile, \"color subpage (lightblue, blue)\")\n ccdd.writeToFileLn(pageFile, \"color array_fmt (royalblue, black)\")\n ccdd.writeToFileLn(pageFile, \"\")\n\n # Output the telemetry display definitions\n outputMnemonics(pageFile, fltCompName)\n\n # Close the page output file\n ccdd.closeFile(pageFile)\n # The page output file cannot be opened\n else\n # Display an error dialog\n ccdd.showErrorDialog(\"<html><b>Error opening telemetry output file '</b>\" + pageFileName + \"<b>'\")\n end\n end\nend", "def generate_pdf(pdf_path, show_id)\n @progress.fraction = 0.0\n @progress.visible = true\n @btnOK.sensitive = false\n @btnCancel.sensitive = false\n \n thd = Thread.new(pdf_path, @progress, @db, show_id) do |path, progress, db, show|\n @log.info \"Creating booklet for show (#{show_id}) in #{pdf_path}\"\n \n pdf = ShowBookletPDF.new\n pdf.render_booklet db, show do |pct|\n progress.set_fraction(pct)\n end\n File.open(path, \"wb\") do |f|\n f.write pdf.render\n end\n \n progress.fraction = 1.0\n @log.info \"Done creating booklet for show (#{show_id}) in #{pdf_path}\"\n dlg = Gtk::MessageDialog.new(@mainWindow, \n Gtk::Dialog::DESTROY_WITH_PARENT, \n Gtk::MessageDialog::INFO, \n Gtk::MessageDialog::BUTTONS_CLOSE, \n \"Your PDF file has been created...\")\n dlg.run\n dlg.destroy\n progress.visible = false\n @btnOK.sensitive = true\n @btnCancel.sensitive = true\n \n # Now, we want to actually display the pdf\n system(\"evince #{pdf_path}\") if @chkShowPDF.active?\n end\n \n end", "def testem_page\n testem_fields(\n \"#{Prawn::DATADIR}/images/reports/CEM2030-2012_Page_01.pdf\"\n # \"#{Rails.root}/app/assets/images/reports/testem_fields.pdf\"\n # \"#{Rails.root}/app/assets/pdfs/testem.png\"\n )\n start_new_page\n end", "def show\n respond_to do |format|\n format.html\n format.pdf {\n render pdf: 'show',\n layout: 'pdf_report.html',\n page_size: (params[:visit_report_print_size] == 'A5' ? 'A5' : 'A4' rescue 'A4'),\n zoom: RUBY_PLATFORM =~ /win32/ ? 1.3 : 1,\n disable_smart_shrinking: RUBY_PLATFORM =~ /win32/ ? true : false,\n print_media_type: true,\n dpi: 300,\n no_background: false, \n encoding: 'utf8',\n image: true,\n margin: { top: (params[:visit_report_print_size] == 'A4' ? (@print_setting.visit_report_margin_top.to_i rescue \"\") : (@print_setting.a_five_visit_report_margin_top.to_i rescue \"\") ),\n bottom: (params[:visit_report_print_size] == 'A4' ? (@print_setting.visit_report_margin_bottom.to_i rescue \"\") : (@print_setting.a_five_visit_report_margin_bottom.to_i rescue \"\")),\n left: (params[:visit_report_print_size] == 'A4' ? (@print_setting.visit_report_margin_left rescue \"\") : (@print_setting.a_five_visit_report_margin_left rescue \"\")),\n right: (params[:visit_report_print_size] == 'A4' ? (@print_setting.visit_report_margin_right rescue \"\") : (@print_setting.a_five_visit_report_margin_right rescue \"\" ) )},\n show_as_html: params[:debug].present?\n }\n end\n\n end", "def to_pdf(options = {})\n # reset version if not specified\n @version = 1.5 if @version.to_f == 0.0\n # set info for merged file\n @info[:ModDate] = @info[:CreationDate] = Time.now.strftime \"D:%Y%m%d%H%M%S%:::z'00\"\n @info[:Subject] = options[:subject] if options[:subject]\n @info[:Producer] = options[:producer] if options[:producer]\n # rebuild_catalog\n catalog = rebuild_catalog_and_objects\n # add ID and generation numbers to objects\n renumber_object_ids\n\n out = []\n xref = []\n indirect_object_count = 1 # the first object is the null object\n # write head (version and binanry-code)\n out << \"%PDF-#{@version}\\n%\\xFF\\xFF\\xFF\\xFF\\xFF\\x00\\x00\\x00\\x00\".force_encoding(Encoding::ASCII_8BIT)\n\n # collect objects and set xref table locations\n loc = 0\n out.each { |line| loc += line.bytesize + 1 }\n @objects.each do |o|\n indirect_object_count += 1\n xref << loc\n out << object_to_pdf(o)\n loc += out.last.bytesize + 1\n end\n xref_location = loc\n # xref_location = 0\n # out.each { |line| xref_location += line.bytesize + 1}\n out << \"xref\\n0 #{indirect_object_count}\\n0000000000 65535 f \\n\"\n xref.each { |offset| out << (out.pop + (\"%010d 00000 n \\n\" % offset)) }\n out << out.pop + 'trailer'\n out << \"<<\\n/Root #{false || \"#{catalog[:indirect_reference_id]} #{catalog[:indirect_generation_number]} R\"}\"\n out << \"/Size #{indirect_object_count}\"\n out << \"/Info #{@info[:indirect_reference_id]} #{@info[:indirect_generation_number]} R\"\n out << \">>\\nstartxref\\n#{xref_location}\\n%%EOF\"\n # when finished, remove the numbering system and keep only pointers\n remove_old_ids\n # output the pdf stream\n out.join(\"\\n\".force_encoding(Encoding::ASCII_8BIT)).force_encoding(Encoding::ASCII_8BIT)\n end", "def show\n @specification = @chapter.specification\n @keywords = Keyword.where(project_id: @specification.project_id)\n respond_to do |format|\n format.html\n format.pdf do\n render pdf: \"specs\",\n encoding: \"UTF-8\",\n layout: \"pdf.html.erb\"\n end\n end\n end", "def hcfa1500_pdf\n @claim = Claim.find(params[:claim_id])\n @patient = Claim.patientdetail(params[:visitid],params[:claim_id]).first\n @referal_provider = Claim.claim_referal(@patient.patient_id).first\n @secondary_policy = Policy.find_by_patient_id_and_carrier_type(@patient.patientid,'Secondary')\n @secondary_policy.decrypt_demographics if @secondary_policy\n @selected_procedure_codes = Patient.selected_procedure_codes(params[:visitid])\n @selected_icd_codes = Visit.selected_icd_codes_for_cpt(@selected_procedure_codes.collect{|x|x.charge_entry_id}) if @selected_procedure_codes != []\n\n @selected_diagnosis_codes = Patient.ordered_visit_diag_codes(params[:visitid])\n @practice = Practice.find(session[:practice_id])\n @visit = Visit.find(params[:visitid])\n @doctor = @visit.doctor\n @place_of_service = PLACE_OF_SERVICE_CODES\n @location = @visit.location\n\n @pdf = PDF::Writer.new\n @pdf.select_font \"Courier\"\n\n helvetica = 'Helvetica'\n helvetica_Bold = 'Helvetica-Bold'\n helvetica_Bold_Oblique = 'Helvetica-BoldOblique'\n\n\n unless (params[:official])\n @pdf.fill_color Color::RGB::Gray90\n\n for x1, y1, x2, y2 in Hcfa1500Constants::GREYAREAWITHOUTERLINE\n @pdf.rectangle(x1, y1, x2, y2).close_fill_stroke\n end\n\n for x1, y1, x2, y2 in Hcfa1500Constants::GREYAREA\n @pdf.rectangle(x1, y1, x2, y2).close_fill\n end\n\n @pdf.fill_color Color::RGB::Black\n \n for x1, y1, x2, y2 in Hcfa1500Constants::DOTTEDHORIZONTALLINE\n while x1 <= x2-3\n @pdf.line(x1, y1, x1+3, y2)\n x1+=6\n end\n end\n\n for x1, y1, x2, y2 in Hcfa1500Constants::DOTTEDVERTICALLINE\n while y1 <= y2-2\n @pdf.line(x1, y1, x2, y1+2)\n y1+=4\n end\n end\n\n for x1, y1, x2, y2 in Hcfa1500Constants::DASHLINES\n @pdf.line(x1, y1, x2, y2).stroke_style(:pattern ==[2,1])\n end\n \n for width, lines in Hcfa1500Constants::LINES\n for x1, y1, x2, y2 in lines\n @pdf.line(x1, y1, x2, y2)\n end\n end\n\n draw_special \n for x, y in Hcfa1500Constants::CHECKBOXES\n @pdf.rectangle(x, y, 10, 10).stroke#, stroke=1\n end\n \n for font, size, label in Hcfa1500Constants::LABELS\n for x, y, text in label\n @pdf.select_font font\n @pdf.add_text(x,y,text, size)\n end\n end\n end\n\n carrier_address = ''\n if (@patient.carrier_address and @patient.carrier_city and @patient.carrier_state and @patient.carrier_zipcode)\n carrier_address += @patient.carrier_apt_suite + \" \" if @patient.carrier_apt_suite\n carrier_address += @patient.carrier_address_line1.to_s + \" , \" if @patient.carrier_address_line1 \n carrier_address += @patient.carrier_address + \", \" + @patient.carrier_city + \", \" + @patient.carrier_state + \" \" + @patient.carrier_zipcode\n assign_carrier(@patient.car_name,@patient.carrier_pobox,carrier_address)\n end\n\n @pdf.select_font \"Courier\"\n populate_hcfa\n send_data @pdf.render,\n :filename => @patient.first_name + \"_\" + @patient.last_name + \"-\" + @visit.treated_at.strftime(\"%Y%m%d\") + \".pdf\",\n :type => \"application/pdf\"\n end", "def generate_print_pdf\n marks = self.mark_hash\n extra_marks = self.extra_marks\n total_mark = self.get_total_mark\n overall_comment = self.overall_comment\n submission = self.submission\n grouping = submission.grouping\n assignment = grouping.assignment\n\n # Make folder for temporary files\n workdir = \"tmp/print/#{self.id}\"\n FileUtils.mkdir_p(workdir)\n\n # Constants used for PDF generation\n logo_width = 80\n line_space = 12\n annotation_size = 20\n\n # Generate front page\n Prawn::Document.generate(\"#{workdir}/front.pdf\") do\n # Add MarkUs logo\n image Rails.root.join('app/assets/images/markus_logo_big.png'),\n at: [bounds.width - logo_width, bounds.height],\n width: logo_width\n\n font_families.update(\n 'Open Sans' => {\n normal: Rails.root.join('vendor/assets/stylesheets/fonts/OpenSansEmoji.ttf'),\n bold: Rails.root.join('vendor/assets/stylesheets/fonts/OpenSans-Bold.ttf')\n }\n )\n font 'Open Sans'\n\n # Title\n formatted_text [{\n text: \"#{assignment.short_identifier}: #{assignment.description}\", size: 20, styles: [:bold]\n }]\n move_down line_space\n\n # Group members\n grouping.accepted_students.includes(:user).find_each do |student|\n text \"#{student.user_name} - #{student.first_name} #{student.last_name}\"\n end\n move_down line_space\n\n # Marks\n assignment.ta_criteria.order(:position).find_each do |criterion|\n mark = marks.dig(criterion.id, :mark)\n if criterion.is_a? RubricCriterion\n formatted_text [{ text: \"#{criterion.name}:\", styles: [:bold] }]\n indent(10) do\n criterion.levels.order(:mark).find_each do |level|\n styles = level.mark == mark ? [:bold] : [:normal]\n formatted_text [{\n text: \"• #{level.mark} / #{criterion.max_mark} #{level.name}: #{level.description}\",\n styles: styles\n }]\n end\n end\n else\n formatted_text [{\n text: \"#{criterion.name}: #{mark || '-'} / #{criterion.max_mark}\",\n styles: [:bold]\n }]\n text criterion.description if criterion.description.present?\n end\n end\n\n extra_marks.each do |extra_mark|\n text \"#{extra_mark.description}: #{extra_mark.extra_mark}#{extra_mark.unit == 'percentage' ? '%' : ''}\"\n end\n move_down line_space\n\n formatted_text [{ text: \"#{I18n.t('results.total_mark')}: #{total_mark} / #{assignment.max_mark}\",\n styles: [:bold] }]\n move_down line_space\n\n # Annotations and overall comments\n formatted_text [{ text: Annotation.model_name.human.pluralize, styles: [:bold] }]\n submission.annotations.order(:annotation_number).includes(:annotation_text).each do |annotation|\n text \"#{annotation.annotation_number}. #{annotation.annotation_text.content}\"\n end\n move_down line_space\n\n formatted_text [{ text: Result.human_attribute_name(:overall_comment), styles: [:bold] }]\n if overall_comment.present?\n text overall_comment\n else\n text I18n.t(:not_applicable)\n end\n end\n\n # Copy all PDF submission files to workspace\n input_files = submission.submission_files.where(\"filename LIKE '%.pdf'\").order(:path, :filename)\n grouping.access_repo do |repo|\n input_files.each do |sf|\n contents = sf.retrieve_file(repo: repo)\n FileUtils.mkdir_p(File.join(workdir, sf.path))\n f = File.open(File.join(workdir, sf.path, sf.filename), 'wb')\n f.write(contents)\n f.close\n end\n end\n\n combined_pdf = CombinePDF.new\n # Simultaneouly do two things:\n # 1. Generate combined_pdf, a concatenation of all PDF submission files\n # 2. Generate annotations.pdf, a PDF containing only markers for annotations.\n # These will be overlaid onto combined_pdf.\n Prawn::Document.generate(\"#{workdir}/annotations.pdf\", skip_page_creation: true) do\n total_num_pages = 0\n input_files.each do |input_file|\n # Process the submission file\n input_pdf = CombinePDF.load(File.join(workdir, input_file.path, input_file.filename))\n combined_pdf << input_pdf\n\n num_pages = input_pdf.pages.size\n num_pages.times do\n start_new_page\n end\n\n # Create markers for the annotations.\n # TODO: remove where clause after investigating how PDF annotations might have a nil page attribute\n input_file.annotations.where.not(page: nil).order(:annotation_number).each do |annotation|\n go_to_page(total_num_pages + annotation.page)\n width, height = bounds.width, bounds.height\n x1, y1 = annotation.x1 / 1.0e5 * width, annotation.y1 / 1.0e5 * height\n\n float do\n transparent(0.5) do\n fill_color 'AAAAAA'\n fill_rectangle([x1, height - y1], annotation_size, annotation_size)\n end\n\n bounding_box([x1, height - y1], width: annotation_size, height: annotation_size) do\n move_down 5\n text annotation.annotation_number.to_s, color: '000000', align: :center\n end\n end\n end\n\n total_num_pages += num_pages\n end\n end\n\n # Combine annotations and submission files\n annotations_pdf = CombinePDF.load(\"#{workdir}/annotations.pdf\")\n combined_pdf.pages.zip(annotations_pdf.pages) do |combined_page, annotation_page|\n combined_page.fix_rotation # Fix rotation metadata, useful for scanned pages\n combined_page << annotation_page\n end\n\n # Finally, insert cover page at the front\n combined_pdf >> CombinePDF.load(\"#{workdir}/front.pdf\")\n\n # Delete old files\n FileUtils.rm_rf(workdir)\n combined_pdf\n end", "def initialize(options = {})\n paper = options[:paper] || \"LETTER\"\n orientation = options[:orientation] || :portrait\n version = options[:version] || PDF_VERSION_13\n\n @mutex = Mutex.new\n @current_id = @current_font_id = 0\n\n # Start the document\n @objects = []\n @callbacks = []\n @font_families = {}\n @fonts = {}\n @stack = []\n @state_stack = StateStack.new\n @loose_objects = []\n @current_text_state = \"\"\n @options = {}\n @destinations = {}\n @add_loose_objects = {}\n @images = []\n @word_space_adjust = nil\n @current_stroke_style = PDF::Writer::StrokeStyle.new(1)\n @page_numbering = nil\n @arc4 = nil\n @encryption = nil\n @file_identifier = nil\n\n @columns = {}\n @columns_on = false\n @insert_mode = nil\n\n @catalog = PDF::Writer::Object::Catalog.new(self)\n @outlines = PDF::Writer::Object::Outlines.new(self)\n @pages = PDF::Writer::Object::Pages.new(self)\n\n @current_node\t= @pages\n @procset = PDF::Writer::Object::Procset.new(self)\n @info = PDF::Writer::Object::Info.new(self)\n @page = PDF::Writer::Object::Page.new(self)\n @current_text_render_style = 0\n @first_page = @page\n\n @version = version\n\n # Initialize the default font families.\n init_font_families\n\n @font_size = 10\n @pageset = [@pages.first_page]\n\n if paper.kind_of?(Array)\n if paper.size == 4\n size = paper # Coordinate Array\n else\n size = [0, 0, PDF::Writer.cm2pts(paper[0]), PDF::Writer.cm2pts(paper[1])]\n # Paper size in centimeters has been passed\n end\n else\n size = PAGE_SIZES[paper.upcase].dup\n end\n size[3], size[2] = size[2], size[3] if orientation == :landscape\n\n @pages.media_box = size\n\n @page_width = size[2] - size[0]\n @page_height = size[3] - size[1]\n @y = @page_height\n\n # Also set the margins to some reasonable defaults -- 1.27 cm, 36pt,\n # or 0.5 inches.\n margins_pt(36)\n\n # Set the current writing position to the top of the first page\n @y = absolute_top_margin\n # Get the ID of the page that was created during the instantiation\n # process.\n\n fill_color! Color::RGB::Black\n stroke_color! Color::RGB::Black\n\n yield self if block_given?\n end", "def show\n @manual = Manual.find_by_id(params[:id]) || Manual.find_by_slug(params[:id])\n\n\traise ActiveRecord::RecordNotFound, \"No record found for ID=#{params[:id]}\" unless @manual\n\n respond_to do |format|\n format.html do\n # show.html.erb\n if params[:print]\n render :layout => 'print'\n end\n end\n format.pdf {\n File.open(cover=Rails.root.join(\"tmp/#{@manual.id}.html\"), \"w\") do |fp|\n\t\t fp << <<-EOS\n<html>\n<head>\n<style>\nH1 {\n\tfont-size: 36pt;\n\tmargin: 120pt 30pt 0 30pt;\n\tfont-family: Arial;\n\ttext-align: center;\n}\nblockquote {\n\tmargin: 5pt 30pt 0 30pt;\n\tfont-size: 18pt;\n\tfont-family: Arial;\n\ttext-align: center;\n\tpadding: 0;\n}\n</style>\n</head>\n<body>\n<h1>#{@manual.title}</h1>\n<blockquote>#{CGI.escapeHTML @manual.summary}</blockquote>\n</body>\n</html>\nEOS\n end\n system(Rails.root.join(\"bin\", \"wkhtmltopdf-amd64\"),\n\t\t\t\t'--header-center', @manual.title,\n\t\t\t\t'--header-line',\n\t\t\t\t'--javascript-delay', '800',\n\t\t\t\t'--outline-depth', '3',\n\t\t\t\t'cover', cover,\n\t\t\t\t'toc', '--xsl-style-sheet', Rails.root.join('data', 'toc.xslt'), \n\t\t\t\turl_for(:print => 'yes'),\n\t\t\t\tout=Rails.root.join(\"public\", \"#{@manual.to_param}.pdf\"))\n send_file out, :disposition => 'attachment'\n }\n format.json { render :json => @manual }\n end\n end", "def print\n design_print = @design.design_prints.where(language: World.language).first_or_create\n design_print.regenerate! if design_print.regenerate?\n send_file_if_present design_print.file, type: \"application/pdf\", disposition: \"inline\"\n end", "def help # defines the helptext to be printed when option \"-h\" is used\nputs <<HELPTEXT\n\nNAME\n txt2pdf\n\nSYNOPSIS\n txt2pdf [-h] (filename)\n\nDESCRIPTION\n Reads a text file (if supplied as the first argument) and creates\n a pdf file with the same name but with .pdf as extension in the\n current directory via the program pdflatex (the only requirement\n besides ruby itself). If \"-h\" is the first argument, then the program\n displays the helptext and exits.\n\n The program can also read the input text from STDIN (STanDard IN) and\n create the pdf file in the user's home directory. When this method is\n used, no argument is given to the program and the text is simply piped\n directly into the program like this:\n\n $ echo \"Hello\" | txt2pdf\n\n This would create a pdf file with only \"Hello\" and the page number\n at the bottom of the resulting pdf page.\n\n With this, you could map a key binding in your window manager to\n create a pdf file from the text you selected in any program, be it the\n terminal, your browser or your text editor. In my wm of choice, i3,\n I have added the following to my i3 config:\n\n bindsym $mod+p exec xclip -o | txt2pdf\n \n This would create a pdf file from the text I have selected as I hit\n the \"Window button\" and \"p\".\n\nOPTIONS\n -h Show this help text\n\nCOPYRIGHT:\n By Geir Isene (https://isene.org) 2019. No rights reserved.\n\nHELPTEXT\nend", "def generate_pdf_data\n pages = 0\n\n # Render the PDF data to string\n pdf_data = WickedPdf.new.pdf_from_string(\n ResumeRenderer.new(self).render_theme(self.current_theme, layout: 'pdf_page'),\n {\n disable_external_links: true,\n disable_internal_links: true,\n print_media_type: true,\n outline: { outline: true }\n }\n )\n\n # Extract the PDF metadata\n meta_dump = nil\n IO.popen(\"#{ENV['PDFTK_BIN']} - dump_data_utf8 output -\", \"w+\") do |pipe|\n pipe.write pdf_data\n pipe.close_write\n meta_dump = pipe.read\n end\n\n # Mutate some PDF metadata values\n # meta_dump.gsub!(/^InfoBegin\\nInfoKey:\\ Creator\\nInfoValue:\\ .+\\n/, \"InfoBegin\\nInfoKey: Creator\\nInfoValue: JibJob PDF Renderer\\n\")\n # meta_dump.gsub!(/^InfoBegin\\nInfoKey:\\ Producer\\nInfoValue:\\ .+\\n/, \"InfoBegin\\nInfoKey: Producer\\nInfoValue: https://jibjob.co\\n\")\n\n # # Inject updated PDF metadata back\n # begin\n # dump_tmpfile = Tempfile.new(\"jibjob-resume-#{self.id}\")\n # dump_tmpfile.write(meta_dump)\n # dump_tmpfile.rewind\n # IO.popen(\"#{ENV['PDFTK_BIN']} - update_info_utf8 #{dump_tmpfile.path} output - uncompress\", \"w+\") do |pipe|\n # pipe.write pdf_data\n # pipe.close_write\n # pdf_data = pipe.read\n # end\n # ensure\n # dump_tmpfile.close\n # dump_tmpfile.unlink\n # end\n\n # Fetch some PDF metadata values\n pages = meta_dump.match(/^NumberOfPages:\\ (\\d+)\\n/)[1].to_i\n\n # Return PDF data wrapper\n { content: pdf_data,\n pages: pages\n }\n end", "def generate_pdf\n\t\t\t\n\n\t\tfile_name = get_file_name\n\t\tfile_name = \"test\"\n\t \n\t ac = ActionController::Base.new\n\t \n\t pdf = ac.render_to_string pdf: file_name,\n template: \"#{ Auth::OmniAuth::Path.pathify(self.class.name).pluralize}/pdf/show.pdf.erb\",\n locals: {:object => self},\n layout: \"pdf/application.html.erb\",\n quiet: true,\n header: {\n \thtml: {\n \t\ttemplate:'/layouts/pdf/header.html.erb',\n \t\tlayout: '/layouts/pdf/empty_layout.html.erb',\n \t\tlocals: {:object => self}\n \t}\n },\n footer: {\n \t\thtml: { \n \t\t\ttemplate:'/layouts/pdf/footer.html.erb',\n \t\t\tlayout: '/layouts/pdf/empty_layout.html.erb',\n \t\tlocals: {:object => self}\n }\n } \n\n save_path = Rails.root.join('public',\"#{file_name}.pdf\")\n\t\tFile.open(save_path, 'wb') do |file|\n\t\t file << pdf\n\t\tend\n\n\t Tempfile.open(file_name) do |f| \n\t\t f.binmode\n\t\t f.write pdf\n\t\t f.close \n\t\t #IO.write(\"#{Rails.root.join(\"public\",\"test.pdf\")}\",pdf)\n\t\t response = Cloudinary::Uploader.upload(File.open(f.path), :public_id => file_name, :upload_preset => \"report_pdf_files\")\n\t\t puts \"response is-------------------------------------------------------------->: #{response}\"\n\t\t self.latest_version = response['version'].to_s\n\t\t self.pdf_url = response[\"url\"]\n\t\tend\n\n\t\tself.skip_pdf_generation = true\n\t\t\n\t\t#self.save\t\t\n\t\tafter_generate_pdf\n\n\tend", "def pdf\n #render layout: false\n Car.find(params[:id])\n Prawn::Document.generate(\"app/assets/pdf/#{@car.targa}.pdf\") do |f|\n f.text \"Hello Worldd!\"\n end\n end", "def run\n\t\tself.print_hosts # generate all the host_*.html files\n\t\tself.print_index # generate the index.html file\n\t\tself.print_vulns # generate all the vuln_*.html files\n\t\tself.print_vuln_overview # generate the vuln_overview.html file\n\tend", "def generate_content\n @pdf = Prawn::Document.new(\n info: self.metadata,\n top_margin: @format[:header_size] + @format[:top_margin],\n bottom_margin: @format[:footer_size] + @format[:bottom_margin]\n )\n add_page_body\n add_page_header\n add_page_footer\n add_page_numbering\n end", "def render_file filename: \"SimpleCV\", path: nil\n output_path = File.join(path || Dir.pwd, \"#{filename.chomp('.pdf')}.pdf\")\n Layout.new(config: @config).render_file(output_path)\n output_path\n end", "def render\n generate_content\n @pdf.render\n end", "def show_title\n respond_to do |format|\n format.html\n format.pdf do\n render pdf: @document.name ,\n template: \"layouts/title.html.erb\",\n locals: {:document => @document},\n layout: 'layouts/application.pdf.erb',\n :margin => { :bottom => 0, :top => 0, :left => 0, :right =>0 },\n show_as_html: params.key?('debug')\n\n end\n end\n end", "def rebuild_pdf\n page_paths = (1..document.page_count).map {|i| \"#{document.slug}_#{i}.pdf\" }\n #`pdftk #{page_paths.join(' ')} cat output #{@pdf}`\n `pdftailor stitch --output #{@pdf} #{page_paths.join(' ')} 2>&1`\n\n if File.exists? @pdf\n asset_store.save_pdf(document, @pdf, access)\n File.open( @pdf,'r') do | fh |\n document.update_file_metadata( fh.read )\n end\n end\n end", "def index_pdf\n @study = Study.find(params[:study_id])\n @project = Project.find(@study.project_id)\n @study_extforms = StudyExtractionForm.where(:study_id => @study.id).all\t\n @study_qs = StudyKeyQuestion.where(:study_id => @study.id).all\n @study_questions = []\n @study_qs.each{|i| @study_questions << KeyQuestion.find(i.key_question_id)}\n @study_questions.sort! { |a,b| a.question_number <=> b.question_number }\t\n @primary_publication = PrimaryPublication.where(:study_id => @study.id).first\n @secondary_publications = SecondaryPublication.where(:study_id => @study.id).all\t\n @study_arms = Arm.where(:study_id => @study.id).all\t\n @outcomes = Outcome.where(:study_id => @study.id).all\n @adverse_events = AdverseEvent.where(:study_id => @study.id).all\n @categorical_outcomes = Outcome.where(:study_id => @study.id, :outcome_type => \"Categorical\").all\n @continuous_outcomes = Outcome.where(:study_id => @study.id, :outcome_type => \"Continuous\").all\t\t\n @outcomes = Outcome.where(:study_id => @study.id).all\n # get the study title, which is the same as the primary publication for the study\n @study_title = PrimaryPublication.where(:study_id => @study.id).first\n @study_title = @study_title.nil? ? \"\" : @study_title.title.to_s\t\n @baseline_characteristic_custom_fields = BaselineCharacteristic.where(:study_id => @study.id).all\n @extraction_forms = StudyExtractionForm.where(:study_id => @study.id).all \n render :pdf => @study_title, :template => 'studies/show_print.html.erb', :layout => \"print\", :disable_javascript => true, :header => {:center => \"SRDR Extracted Study Data\"}\n end", "def generate_pdf(client_info)\n Prawn::Document.new do\n fill_color \"2E64FE\"\n indent(10) do\n text \"Zimmedari<br/> ka<br/> Humsafar\",:size => 40, :inline_format => true\n end\n image \"#{Rails.root}/app/assets/images/logo.png\" ,:image_width => 60, :image_height => 60, :at => [350,750]\n\n client_info.each_with_index do |client,index|\n fill_color \"000000\"\n if client_info.length != 1\n pad(10) { text \"\\n Client #{index+1} Feedback Information\", align: :center, :size => 32 }\n else\n pad(10) { text \"\\n #{client.name}'s Feedback Information\", align: :center, :size => 32 }\n end\n stroke_horizontal_rule\n pad(10) { text \"<b>Personal Infirmation : </b>\", :size => 20,:inline_format => true }\n indent(30) do\n data = [[ \"<b>Name:</b> #{client.name}\",\"<b>Mobile:</b> #{client.mobile}\"],\n [\"<b>Address:</b> #{client.address}\",\"<b>Phone:</b> #{client.phone}\"],\n [\"<b>Pincode:</b> #{client.pincode}\",\"<b>Email:</b> #{client.email}\"],\n [\"<b>Date Of Birth:</b> #{client.date_of_birth.strftime(\"%F\") rescue \"\"}\",\"<b>Client Anniversary Date:</b> #{client.anniversary_date.strftime(\"%F\") rescue \"\"}\"]]\n table data, :cell_style => { :inline_format => true,:borders => [], :width => 250 }\n end\n pad(10) { text \"<b>Education & Job details : </b>\",:size => 20, :inline_format => true }\n indent(30) do\n data = [[\"<b>Education:</b> #{client.education}\",\"<b>Occupation:</b> #{client.occupation}\"],\n [\"<b>Name Of Company:</b> #{client.name_of_company}\",\"<b>Job Post:</b> #{client.job_post}\"],\n [\"<b>Job Experience:</b> #{client.job_expirience_year}\",\"<b>Income:</b> #{client.income}\"],\n [\"<b>Economical Liability:</b> #{client.economical_liability}\",\"<b>Retirement Age:</b> #{client.retirement_age}\"],\n [\"<b>How many years intend to work:</b> #{client.intend_to_work}\",\"\"]]\n table data, :cell_style => { :inline_format => true,:borders => [], :width => 250 }\n end\n pad(10){text \"<b>Child Details</b>\", :size => 20,:inline_format => true }\n indent(30) do\n pad(5){text \"<b>Number of Child: </b> #{client.number_of_child}\", :inline_format => true }\n data = []\n if !client.child_infos.nil?\n client.child_infos.each_with_index do |child,i|\n if !child.date_of_birth.nil?\n data << [\"<b>Child #{i+1} Age:</b> #{child.age}\",\"<b>Child #{i+1} Date of Birth:</b> #{child.date_of_birth.strftime(\"%F\") rescue \"\"}\"]\n else\n data << [\"<b>Child #{i+1} Age:</b> #{child.age}\",\"<b>Child #{i+1} Date of Birth: </b>\"]\n end\n\n end\n if data.blank?\n pad(5){text \"<b>No Child Information</b>\", :inline_format => true }\n else\n table data, :cell_style => { :inline_format => true,:borders => [], :width => 250 }\n end\n end\n end\n start_new_page\n pad(10){text \"<b>Personal Assets</b>\", :size => 20,:inline_format => true }\n indent(30) do\n if !client.house.nil?\n data = [[\"<b>House Owned:</b> #{client.house.owned}\",\"<b>Four Wheeler:</b> #{client.vehicle.four_wheeler}\"],\n [\"<b>House Rented:</b> #{client.house.rented}\",\"<b>Two Wheeler:</b> #{client.vehicle.two_wheeler}\"],\n [\"<b>House Co Provider:</b> #{client.house.co_provider}\",\"<b>No Vehicle:</b> #{client.vehicle.none}\"]]\n else\n data = [[\"<b>House Owned:</b> \",\"<b>Four Wheeler:</b> \"],\n [\"<b>House Rented:</b> \",\"<b>Two Wheeler:</b> \"],\n [\"<b>House Co Provider:</b>\",\"<b>No Vehicle:</b>\"]]\n end\n table data, :cell_style => { :inline_format => true,:borders => [], :width => 250 }\n end\n pad(10){text \"<b>Future Goal</b>\", :size => 20,:inline_format => true }\n indent(30) do\n data = [[\"<b>Short Term Goal:</b> #{client.short_term_goal}\",\"<b>Long Term Goal:</b> #{client.long_term_goal}\"]]\n table data, :cell_style => { :inline_format => true,:borders => [], :width => 250 }\n end\n pad(10){text \"<b>Plan</b>\", :size => 20,:inline_format => true }\n indent(30) do\n data = [[\"<b>Child Education:</b> #{client.plan_child_education}\",\"<b>Child Merriage:</b> #{client.plan_child_marriage}\"],\n [\"<b>Retirement Fund:</b> #{client.plan_retirement_fund}\",\"\"]]\n table data, :cell_style => { :inline_format => true,:borders => [], :width => 250 }\n end\n pad(10){text \"<b>Investment</b>\", :size => 20,:inline_format => true }\n indent(30) do\n if !client.investment_type.nil?\n data = [[\"<b>Fix Income:</b> #{client.investment_type.fix_income}%\",\"<b>Equity:</b> #{client.investment_type.equity}%\"],\n [\"<b>Gold:</b> #{client.investment_type.gold}%\",\"<b>Land and Estate:</b> #{client.investment_type.land_and_estate}%\"]]\n else\n data = [[\"<b>Fix Income:</b> 0%\",\"<b>Equity:</b> 0%\"],\n [\"<b>Gold:</b> 0%\",\"<b>Land and Estate:</b> 0%\"]]\n end\n table data, :cell_style => { :inline_format => true,:borders => [], :width => 250 }\n end\n if client_info.length != 1\n start_new_page\n end\n string = \"page <page> of <total>\"\n # Green page numbers 1 to 7\n options = { :at => [bounds.right - 150, 0],\n :width => 150,\n :align => :right,\n :page_filter => (1..7),\n :start_count_at => 1,\n :color => \"0000ff\" }\n number_pages string, options\n end\n end.render\n end", "def generate_pdf\n\t\t\n\t\tfile_name = get_pdf_file_name\n\n\t\tac = ActionController::Base.new\n\n\t\tpdf = ac.render_to_string pdf: file_name,\n\t template: \"#{ Auth::OmniAuth::Path.pathify(self.class.name).pluralize}/pdf/show.pdf.erb\",\n\t locals: {:receipt => self, :organization => self.payable_to_organization},\n\t layout: \"pdf/application.html.erb\",\n \tquiet: true,\n\t header: {\n\t \thtml: {\n\t \t\ttemplate:'/layouts/pdf/receipt_header.pdf.erb',\n\t \t\tlayout: \"pdf/application.html.erb\",\n\t \t\tlocals: {:receipt => self, :organization => self.payable_to_organization}\n\t \t}\n\t },\n\t footer: {\n\t \t\thtml: { \n\t \t\t\ttemplate:'/layouts/pdf/receipt_footer.pdf.erb',\n\t \t\t\tlayout: \"pdf/application.html.erb\",\n\t \t\tlocals: {:receipt => self, :organization => self.payable_to_organization}\n\t }\n\t } \n\n #save_path = Rails.root.join('public',\"#{file_name}.pdf\")\n\t\t#File.open(save_path, 'wb') do |file|\n\t\t# file << pdf\n\t\t# self.pdf_urls = [save_path]\n\t\t# self.pdf_url = save_path\n\t\t#end\n\t\tTempfile.open(file_name) do |f| \n\t\t f.binmode\n\t\t f.write pdf\n\t\t f.close \n\t\t #IO.write(\"#{Rails.root.join(\"public\",\"test.pdf\")}\",pdf)\n\t\t response = Cloudinary::Uploader.upload(File.open(f.path), :public_id => file_name, :upload_preset => \"report_pdf_files\")\n\t\t puts \"response is: #{response}\"\n\t\t self.latest_version = response['version'].to_s\n\t\t self.pdf_url = response[\"secure_url\"]\n\t\tend\n\t\tself.skip_pdf_generation = true\n\t\t\n\t\tafter_generate_pdf\n\n\tend", "def show\n @product = Product.all\n# respond_to do |format|\n# format.html # show.html.erb\n# format.xml { render :xml => @product }\n# end\n\tprawnto :filename => 'Report-Products.pdf', :inline => false\n\n end", "def show\n if params[:download]\n send_pdf(download: true)\n elsif params[:preview]\n send_pdf\n end\n end", "def get_pdf(x)\n end", "def process_pdf\n puts \"In #process_pdf\"\n # TODO refactor this so we're not passing so many arguments to the method\n respond \"```\\nAttempting PDF compilation. Reticulating splines etc...\\n```\"\n WhedonWorker.perform_async(@config.papers, @config.site_host, @config.site_name, @nwo, @issue_id)\nend", "def open_in_viewer\n fork { exec \"#{Seee::Config.application_paths[:pdf_viewer]} \\\"#{current_path}\\\"\" }\n end", "def show\n @lablocational = Lablocational.all\n# respond_to do |format|\n# format.html # show.html.erb\n# format.xml { render :xml => @lablocational }\n# end\n\tprawnto :filename => 'Report-LocationalLab.pdf', :inline => false\n\n end", "def to_pdf requester, user, questionnaire, url_prefix, short_version=false\n font_families.update(\n \"DejaVuSans\" => { # Using DejaVuSans because it provides the 'filled_check_box' and the 'check_box' icons.\n :bold => \"#{Rails.root}/public/data/fonts/DejaVuSans-Bold.ttf\",\n :bold_italic => \"#{Rails.root}/public/data/fonts/DejaVuSans-BoldOblique.ttf\",\n :italic => \"#{Rails.root}/public/data/fonts/DejaVuSans-Oblique.ttf\",\n :normal => \"#{Prawn::BASEDIR}/data/fonts/DejaVuSans.ttf\"\n }\n )\n font \"DejaVuSans\"\n self.font_size = 9\n\n #check_box = \"\\xE2\\x98\\x90\"\n #filled_check_box = \"\\xE2\\x98\\x91\"\n\n ap = ApplicationProfile.first\n current_instance = (ap && ap.sub_title) || Rails.root.to_s.split('/')[3].split('-').first\n ap_logo = ap && ap.logo && ap.logo.path\n fallback_logo = Dir.glob(\"public/assets/logos/#{current_instance.split('-').first}*\", File::FNM_CASEFOLD).first\n logo = ap_logo || \"#{Rails.root}/#{fallback_logo}\"\n image logo, position: :right, width: 150 if logo\n text \"#{current_instance.upcase}\", size: 14, style: :bold\n\n move_down 10\n\n banner = questionnaire.header.path\n if banner.present? && File.exist?(banner)\n image banner, :position => :left, :width => 550\n end\n\n move_down 20\n\n authorization = AuthorizedSubmitter.find_by_questionnaire_id_and_user_id(questionnaire.id, user.id)\n I18n.locale = authorization.language\n questionnaire_field = ( questionnaire.questionnaire_fields.find_by_language(authorization.language) || questionnaire.questionnaire_fields.find_by_is_default_language(true) )\n text \"#{questionnaire_field.title.html_safe}\", :size => 16, :style => :bold\n #text \"Language: #{questionnaire.language_english_name}\"\n\n move_down 18\n\n text \"#{OrtSanitize.white_space_cleanse(questionnaire_field.introductory_remarks).gsub(\"\\n\", \"\\n\\n\")}\", :inline_format => true\n\n start_new_page\n\n fields = {}\n\n puts \"#{Time.now} - Started generating #{short_version ? \"short\" : \"\"} PDF for - #{questionnaire_field.title} - for #{user.full_name}\"\n logger.info \"#{Time.now} - Started generating #{short_version ? \"short\" : \"\"} PDF for - #{questionnaire_field.title} - for #{user.full_name}\"\n\n begin\n sections = questionnaire.sections\n sections.each_with_index do |section, i|\n fields.clear\n section.objects_fields_in authorization.language, fields\n answers = section.section_and_descendants_answers_for(user).select{ |ans| ans.filled_answer? }\n root_section_to_pdf(authorization.language, section, user, fields, answers, url_prefix, short_version)\n\n # new page for every new root section (if we're doing a short_version pdf only add the new page if the answers aren't empty)\n # the last check on the if is related with checking if there is any content for the next page\n if i < sections.size-1 && (!short_version || !answers.empty?) && page.content.stream !=\"/DeviceRGB cs\\n0.000 0.000 0.000 scn\\n/DeviceRGB CS\\n0.000 0.000 0.000 SCN\\nq\\n\" && cursor != 720.0\n # puts \"the cursor is here #{cursor}\"\n start_new_page\n end\n end\n\n #footer [ margin_box.left, margin_box.bottom + 25 ] do\n repeat(:all, :dynamic => true) do\n draw_text \"#{questionnaire_field.title} [#{user.full_name}, #{user.country}]\", :size => 7, :at => [0, -15]\n draw_text \"Page #{page_number} of #{page_count}\", :size => 8, :at => [500, (questionnaire.title.size > 50 ? -6 : -15)]\n end\n\n pdf_file = questionnaire.pdf_files.find_by_user_id_and_is_long(user.id, !short_version) || PdfFile.new(:questionnaire => questionnaire, :user => user, :is_long => !short_version)\n if !pdf_file.new_record? && File.exist?(pdf_file.location)\n FileUtils.rm(pdf_file.location)\n end\n\n sanitized_title = questionnaire.title[0,35].strip.\n gsub!(/[^0-9A-Za-z.\\-]/, '_')\n\n pdf_file.name = \"#{sanitized_title}_#{short_version ? \"short\" : \"long\"}_#{DateTime.now.strftime(\"%d%m%Y\")}.pdf\"\n location_rel = \"private/questionnaires/#{questionnaire.id}/users/#{user.id}/\"\n location_abs = \"#{Rails.root}/#{location_rel}\"\n if !File.directory? location_abs\n FileUtils.mkdir_p(location_abs)\n end\n pdf_file.location = location_rel + pdf_file.name\n pdf_file.save\n render_file pdf_file.location\n\n if File.directory?(\"#{Rails.root}/private/questionnaires/#{questionnaire.id}/users/#{user.id}/generating_#{short_version ? \"short\" : \"long\"}_pdf\")\n FileUtils.rmdir(\"#{Rails.root}/private/questionnaires/#{questionnaire.id}/users/#{user.id}/generating_#{short_version ? \"short\" : \"long\"}_pdf\")\n end\n\n puts \"#{Time.now.to_s} - PDF Successfully generated - #{questionnaire_field.title} - for #{user.full_name}\"\n logger.info \"#{Time.now.to_s} - PDF Successfully generated - #{questionnaire_field.title} - for #{user.full_name}\"\n\n rescue => e\n UserMailer.pdf_generation_failed(requester, user, questionnaire, e.message).deliver\n\n logger.info \"#{Time.now.to_s} - PDF failed to generate - #{questionnaire_field.title} - for #{user.full_name} - with error: #{e.message}\"\n logger.info e.backtrace\n\n if File.directory?(\"#{Rails.root}/private/questionnaires/#{questionnaire.id}/users/#{user.id}/generating_#{short_version ? \"short\" : \"long\"}_pdf\")\n FileUtils.rmdir(\"#{Rails.root}/private/questionnaires/#{questionnaire.id}/users/#{user.id}/generating_#{short_version ? \"short\" : \"long\"}_pdf\")\n end\n\n return\n end\n\n # mail the requester about the pdf being generated. (can be the user or an admin)\n UserMailer.pdf_generated(requester, questionnaire, user).deliver\n end", "def generate_pdf \n pdf = ParkirPdf.new(@billing)\n pdf.render\n end", "def build_pdf_rendering(file_set_id)\n file_set_document = query_for_rendering(file_set_id)\n paged_resource_id = file_set_document.dig(:is_page_of_ssi)\n\n {\n \"@id\"=> pdf_hyrax_paged_resource_path(paged_resource_id),\n \"label\"=> \"Download as PDF\",\n \"format\"=> \"application/pdf\"\n }\n end", "def generate_pdf\n output_path ||= CurationConcerns::DerivativePath.derivative_path_for_reference(curation_concern, 'pdf')\n output_file_dir = File.dirname(output_path)\n FileUtils.mkdir_p(output_file_dir) unless File.directory?(output_file_dir)\n curation_concern.render_pdf(output_path)\n end", "def licensereport\n\t\t@licenses = License.find(:all)\t\t\n html = render :layout => false \n\tkit = PDFKit.new(html)\n\n\tkit.stylesheets << RAILS_ROOT + '/public/stylesheets/styles.css' \n\n\tsend_data(kit.to_pdf, :filename => \"licensereport.pdf\", :type => 'application/pdf')\n\tend", "def show_file_version\n\t\t\tputs \" Version: #{@elf_version.to_h}\"\n\t\tend", "def render\n @pdf.render\n end", "def index\n @page_title = \"VDW Datasets\"\n @datasets = Dataset.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @datasets }\n format.pdf\n end\n end", "def render(debug = false)\n add_page_numbers\n @compression = false if $DEBUG or debug\n @arc4.init(@encryption_key) unless @arc4.nil?\n\n check_all_here\n\n xref = []\n\n content = \"%PDF-#{@version}\\n%âãÏÓ\\n\"\n pos = content.size\n\n objects.each do |oo|\n cont = oo.to_s\n content << cont\n xref << pos\n pos += cont.size\n end\n\n# pos += 1 # Newline character before XREF\n\n content << \"\\nxref\\n0 #{xref.size + 1}\\n0000000000 65535 f \\n\"\n xref.each { |xx| content << \"#{'%010d' % [xx]} 00000 n \\n\" }\n content << \"\\ntrailer\\n\"\n content << \" << /Size #{xref.size + 1}\\n\"\n content << \" /Root 1 0 R\\n /Info #{@info.oid} 0 R\\n\"\n # If encryption has been applied to this document, then add the marker\n # for this dictionary\n if @arc4 and @encryption\n content << \"/Encrypt #{@encryption.oid} 0 R\\n\"\n end\n\n if @file_identifier\n content << \"/ID[<#{@file_identifier}><#{@file_identifier}>]\\n\"\n end\n content << \" >>\\nstartxref\\n#{pos}\\n%%EOF\\n\"\n content\n end", "def preview_doc\n @tpl = Template.find(params[\"template_id\"]) \n output = @tpl.render_by_model_id(params[:id], 'print', 'www.freightoperations.com:8080')\n render(:text => output, :layout => false) \n end", "def render_document; end", "def initialize ()\n\t\t\t\t@template_info =\n\t\t\t\t{\n\t\t\t\t\t:name => \"talking_points\",\n\t\t\t\t\t:author => \"hammackj\",\n\t\t\t\t\t:version => \"0.0.2\",\n\t\t\t\t\t:renderer => \"PDF\",\n\t\t\t\t\t:description => \"Generates a Talking Points NessusReport\"\n\t\t\t\t}\n\t\t\tend", "def make_pdf(opts = {})\r\n @pdf = true\r\n @debug_pdf = params[:debug_pdf]\r\n params[:format] = 'html'\r\n html = render_to_string(:action => \"#{opts.delete(:action) || params[:action]}.html.erb\", :layout => (opts.delete(:layout) || 'pdf')) # layout not taken\r\n if !@debug_pdf\r\n html.gsub!(/\\/images\\//, Rails.root.join('public', 'images/').to_s)\r\n else\r\n render(:text => html, :layout => false) and return\r\n end\r\n kit = PDFKit.new(html, opts.merge(:encoding => 'UTF-8'))\r\n kit.stylesheets << Rails.root.join('public', 'stylesheets', 'pdf.css')\r\n return kit.to_pdf\r\n end", "def show\n @patient = Patient.find(params[:id])\n\n @doc=RGhost::Document.new\n @doc.barcode_code39(@patient.pid, :x => 0, :y=> 27, :text => {:size => 10}) \n @doc.render :png, :logfile => \"/tmp/logfile.txt\", :debug => true, :filename => \"/tmp/barcode.png\"\n\n @pdf = Prawn::Document.new\n barcode = \"/tmp/barcode.png\"\n @pdf.image barcode, :at => [0,750], :width => 450\n\n @pdf.move_down(40)\n @pdf.text(@patient.name)\n @pdf.text(@patient.address)\n\n @pdf.render_file('prawn.pdf')\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @patient }\n end\n end", "def show\n respond_to do |format|\n format.html\n format.pdf {\n render pdf: @export_budget.title,\n formats: [:html],\n template: 'export_budgets/create_pdf.html.haml',\n show_as_html: params.key?('debug')\n }\n end\n end", "def w_to_pdf(s)\n fn = rem_ext(s,'.w')\n puts \"dir: #{File.dirname(fn)}\"\n doc_dir = File.dirname(fn)!='.' ? './pdf' : '../source/pdf'\n cd(File.dirname(fn)) do\n fn = File.basename(fn)\n 2.times do\n puts \"nuweb -o -l #{fn}.w\"\n puts `nuweb -o -l #{fn}.w`\n puts \"latex -halt-on-error #{fn}.tex\"\n puts `latex -halt-on-error #{fn}.tex`\n puts \"dvipdfm -o #{rep_dir(doc_dir,fn)}.pdf #{fn}.dvi\"\n puts `dvipdfm -o #{rep_dir(doc_dir,fn)}.pdf #{fn}.dvi`\n end\n end\n end", "def to_pdf\n file = get_path()\n ext = File.extname(file)\n if ['.png', '.gif', '.jpg'].include?(ext.downcase)\n # image\n \"<center><p><img src='#{make_path(file)}'></p></center>\"\n else\n # other file\n source = escape_xml(File.read(File.join(@base, file)))\n \"<table width='100%' border='0' cellpadding='10'><tr>\"+\n \"<td bgcolor='#F0F0F0'><pre>#{source}</pre>\"+\n \"</td></tr></table><p></p>\"\n end\n end", "def preview\n frm.button(:value=>\"Preview\").click\n @@file_number=0\n AssignmentStudentPreview.new(@browser)\n end", "def preview\n frm.button(:value=>\"Preview\").click\n @@file_number=0\n AssignmentStudentPreview.new(@browser)\n end", "def splitpdf\n require 'pashua'\n include Pashua\n docu = Document.path.get[0]\n dname = Document.name.get[0][0..-5]\n page = Document.get[0].current_page.get.index.get\n\n # configuring Pashua dialogue\n config = \"\n *.title = researchr\n fb.type = textfield\n fb.default = 1\n fb.label = Starting on page #{page}, how many pages to extract?\\n\n xb.type = checkbox\n xb.label = last page number, instead of number of pages\n db.type = cancelbutton\n db.label = Cancel\n db.tooltip = Closes this window without taking action\\n\"\n\n pagetmp = pashua_run config\n exit if pagetmp['cancel'] == 1\n\n startpage = page.to_i\n tmppage = pagetmp['fb'].to_i\n if pagetmp['xb'] == \"1\"\n endpage = tmppage\n else\n endpage = pagetmp['fb'].to_i + startpage - 1\n end\n\n outfile = \"#{Downloads_path}/#{dname[0..-5]}-split.pdf\"\n\n `pdfmanipulate split \"#{docu}\" #{startpage}-#{endpage} -o \"#{outfile}\"`\n puts \"pdfmanipulate split \\\"#{docu}\\\" #{startpage}-#{endpage} -o \\\"#{outfile}\\\"\"\n growl(\"File extracted and put in Downloads directory\")\nend", "def show\n\t\tif params[:id] == 'pdf'\n render :pdf => \"file_name\",\n :orientation => 'Portrait',\n :margin => { :top => 8.5,\n :bottom => 8.5,\n :left => 6,\n :right => 6\n },\n :template => 'analyzers/report.erb',\n :disposition => 'attachment' \n return\n end\n\tend", "def display document\n page do |io|\n text = document.accept formatter(io)\n io.write text\n end\n end", "def show\n @study = Study.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @study }\n #format.csv {send_data @study.samples.to_csv, :filename => \"#{@study.identifier}_samples.csv\"}\n format.csv { send_data @study.samples_for_csv, :filename => \"#{@study.identifier}_samples.csv\"} \n #format.pdf { render :layout => false }\n #format.csv { send_data @study.samples.to_csv(), :filename => \"#{@study.identifier}_samples.csv\" }\n #format.tsv { send_data @study.samples.to_tsv(), :filename => \"#{@study.samples}_samples.tsv\" }\n end\n\n # TODO\n\n # # create a unique PDF filename\n # pdf_uuid = UUIDTools::UUID.timestamp_create().to_s\n # pdf_uuid_filename = Rails.root.join('app/assets/images/labels', \"#{pdf_uuid}.pdf\").to_s\n\n # # create a pdf but don't display it\n # pdf_file = render_to_string :pdf => pdf_uuid_filename, \n # :template => 'plans/show.pdf.erb' ,\n # :layout => 'pdf',\n # :save_only => true\n # # save to a file\n # File.open(pdf_uuid_filename, 'wb') do |file|\n # file << pdf_file\n # end\n # # create full URL path to created file \n # @plan.url = request.url[0, request.url.index(\"plans\")] + 'pdf/' + CGI::escape(\"#{pdf_uuid}.pdf\")\n # @plan.save!\n # # render the page again with the link being displayed\n # redirect_to :back\n\n end", "def show\n \n respond_to do|format|\n format.html\n format.pdf do \n pdf = PackagePdf.new(@package)\n send_data pdf.render, filename: \"package_#{@package.pack_nr}.pdf\",\n type: \"application/pdf\",\n disposition: \"inline\"\n end\n \n end\n end", "def render_pdf\n Payday::PdfRenderer.render(self)\n end", "def render\n FileUtils.makedirs(directory)\n\n Prawn::Document.generate(filename, page_size: \"A4\") do |pdf|\n pdf.font \"fonts/Aller_Lt.ttf\"\n pdf.font_size 18\n pdf.text \"Invoice number #{@order.order_number}\"\n pdf.move_down 24\n pdf.font_size 10\n pdf.text \"Invoice created at: #{@order.created_at}\"\n pdf.move_down 24\n\n address_top = 700\n\n pdf.bounding_box([0, address_top], width: 200, height: 200) do\n pdf.text \"#{COMPANY_NAME}\\n14 Murrayfield Drive\\nEdinburgh\\nMidlothian\\nEH12 6EB\\nUnited Kingdom\\nCompany no. SC391840\\nVAT no. 111 7832 38\", leading: 4\n end\n\n pdf.bounding_box([300, address_top], width: 200, height: 200) do\n pdf.text(\"Customer:\\n\" + @order.user.business_name + \"\\n\" + @order.address.strip + \"\\n\" + @order.postcode + \"\\n\" + @order.country.to_s + \"\\nCustomer VAT number: #{@order.customer_vat_number}\", leading: 4)\n end\n\n cells = []\n headers = [\"Product\", \"Price\"]\n headers <<= \"Sterling\" if @order.sterling_in_euros\n cells << headers\n @order.order_lines.each do |line|\n cells << [line.description, euros_from_cents(line.amount)]\n end\n tax_line = [@order.tax_description, euros_from_cents(@order.tax_amount)]\n tax_line <<= @order.tax_amount / @order.sterling_in_euros if @order.sterling_in_euros\n cells << tax_line\n total_line = [\"Order total:\", euros_from_cents(@order.total)]\n total_line <<= @order.total / @order.sterling_in_euros if @order.sterling_in_euros\n cells << total_line\n\n t = Prawn::Table.new(cells, pdf)\n t.draw\n\n if @order.sterling_in_euros\n pdf.move_down 24\n pdf.text \"1 GBP = #{@order.sterling_in_euros} EUR\"\n end\n\n logopath = \"#{Rails.root}/public/images/my-chalet-finder-logo.png\"\n pdf.bounding_box([300, 770], width: 126, height: 22) do\n pdf.image logopath, width: 126, height: 22\n end\n end\n end", "def finalize_standard_report\n render_pdf\n end", "def show\n respond_to do |format|\n format.html\n format.pdf do\n render pdf: 'test_name',\n formats: [:html],\n template: 'export_budgets/show',\n show_as_html: params.key?('debug')\n end\n end\n\n end", "def show\n respond_to do |format|\n format.html\n format.pdf { render pdf: \"Apolice\",\n header: {center: \"lllL\"},\n footer: { center: \"[page] de [topage]\" }\n }\n end\n end", "def index\n# @plans = Plan.find(:all)\n @plans = Plan.recent\n \n respond_to do |format|\n format.html # index.html.erb\n format.pdf do\n# send_data PlanDrawer::draw_by_date( @plans ), :filename => 'plan.pdf', :type => 'application/pdf', :disposition => 'inline'\n send_data PlanDrawer::draw_by_worker( @plans ), :filename => 'plan.pdf', :type => 'application/pdf', :disposition => 'inline'\n end\n format.xml { render :xml => @plans }\n end\n end", "def print_version()\n (version,packager,name) = get_version()\n puts name+\" v. \"+version+\" \"+packager\n exit\nend", "def show\n\n respond_to do |format|\n format.html\n format.pdf do\n render pdf: \"ID No. #{@lucky_draw.id}\",\n page_size: 'A4',\n template: \"lucky_draws/show_pdf.html.erb\",\n layout: \"pdf.html\",\n orientation: \"Landscape\",\n lowquality: true,\n zoom: 1,\n dpi: 75\n end\n end\n end", "def display document\n page do |io|\n f = formatter(io)\n f.width = @width if @width and f.respond_to?(:width)\n text = document.accept f\n\n io.write text\n end\n end", "def show\n # respond_to do |format|\n # format.html\n # format.pdf do\n # pdf = Prawn::Document.new\n # send_data pdf.render, filename: 'report.pdf', type: 'application/pdf'\n # end\n # end\n\n end", "def show\n respond_to do |format|\n format.html\n format.pdf do\n render :pdf => \"file_name\",\n :layout => 'pdf.html.erb',\n :page_size => 'Letter',\n :footer => {:right => '[page] de [topage]', :font_size => 7}\n end\n end\n end", "def show\n respond_to do |format|\n format.html\n format.pdf do\n render :pdf => \"file_name\",\n :layout => 'pdf.html.erb',\n :page_size => 'Letter',\n :footer => {:right => '[page] de [topage]', :font_size => 7}\n end\n end\n end", "def print_usage(options)\n puts\n puts \"Usage: \"+$0+\" -[\"+options+\"]\"\n puts\n puts \"-V:\\tDisplay version information\"\n puts \"-h:\\tDisplay usage information\"\n puts \"-a:\\tProcess all PDFs\"\n puts \"-d:\\tSet PDF directory\"\n puts \"-f:\\tProcess a file\"\n puts \"-l:\\tList all pdf files\"\n puts \"-p:\\tSet product\"\n puts \"-r:\\tSet release\"\n puts \"-o:\\tOutput to file\"\n puts \"-t:\\tOutput in TXT mode\"\n puts \"-c:\\tOutput in CSV mode\"\n puts \"-x:\\tOutput in XLS mode\"\n puts \"-v:\\tVerbose mode\"\n puts\n return\nend", "def store_setup #:nodoc:\n record = 0x00A1 # Record identifier\n length = 0x0022 # Number of bytes to follow\n\n iPaperSize = @paper_size # Paper size\n iScale = @print_scale # Print scaling factor\n iPageStart = @page_start # Starting page number\n iFitWidth = @fit_width # Fit to number of pages wide\n iFitHeight = @fit_height # Fit to number of pages high\n grbit = 0x00 # Option flags\n iRes = 0x0258 # Print resolution\n iVRes = 0x0258 # Vertical print resolution\n numHdr = @margin_header # Header Margin\n numFtr = @margin_footer # Footer Margin\n iCopies = 0x01 # Number of copies\n\n fLeftToRight = @page_order # Print over then down\n fLandscape = @orientation # Page orientation\n fNoPls = 0x0 # Setup not read from printer\n fNoColor = @black_white # Print black and white\n fDraft = @draft_quality # Print draft quality\n fNotes = @print_comments# Print notes\n fNoOrient = 0x0 # Orientation not set\n fUsePage = @custom_start # Use custom starting page\n\n grbit = fLeftToRight\n grbit |= fLandscape << 1\n grbit |= fNoPls << 2\n grbit |= fNoColor << 3\n grbit |= fDraft << 4\n grbit |= fNotes << 5\n grbit |= fNoOrient << 6\n grbit |= fUsePage << 7\n\n\n numHdr = [numHdr].pack('d')\n numFtr = [numFtr].pack('d')\n\n if @byte_order != 0 && @byte_order != ''\n numHdr = numHdr.reverse\n numFtr = numFtr.reverse\n end\n\n header = [record, length].pack('vv')\n data1 = [iPaperSize, iScale, iPageStart,\n iFitWidth, iFitHeight, grbit, iRes, iVRes].pack(\"vvvvvvvv\")\n\n data2 = numHdr + numFtr\n data3 = [iCopies].pack('v')\n\n prepend(header, data1, data2, data3)\n\n end", "def show\n respond_to do |format|\n format.html\n format.pdf do\n render pdf: @document.name,\n template: \"documents/plain.pdf.erb\",\n locals: {:document => @document},\n layout: 'layouts/application.pdf.erb',\n :margin => { :bottom => 45, :top => 66, :left => 0, :right=>0 },\n header: {\n html: {\n template: 'documents/templates/header.pdf.erb',\n layout: 'plain.html.erb',\n locals: { :document => @document }\n }\n },\n footer: {\n html: {\n template:'documents/templates/document_footer.pdf.erb',\n locals: { :document => @document },\n }\n },\n show_as_html: params.key?('debug')\n end\n end\n end", "def show\n @program = Program.find(params[:id] , :order => \"program_exercises.position\", :include => [:program_exercises])\n \t\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @program}\n format.pdf do\n \tsend_data ProgramDrawer.draw(@program), :filename => 'yourprogram.pdf', :type => 'application/pdf', :disposition => 'inline'\n \t end\n end\n end", "def printout\n raise WedgieError, \"can't print #{content_type}\" unless content_type == 'text/x-clinical'\n pdf = FPDF.new('P','mm','A4')\n pdf.SetFont('Arial','',10)\n clinical_objects.each do |obj|\n pdf.AddPage\n obj.gen_pdf(pdf)\n end\n return pdf\n end", "def stream\n render_layout\n\n pdf_content\n end", "def dump_pdf(start_state)\n puts \"parsed script:\\n\\n#{start_state.describe_state_machine}\"\n start_state.generate_pdf(\"_SKIP_parseScript#{@@counter}.pdf\")\n @@counter+=1\n end", "def render_document(input, outdir, outname, format, vars)\r\n \r\n \r\n #TODO: Clarify the following\r\n # on Windows, Tempdir contains a drive letter. But drive letter\r\n # seems not to work in pandoc -> pdf if the path separator ist forward\r\n # slash. There are two options to overcome this\r\n #\r\n # 1. set tempdir such that it does not contain a drive letter\r\n # 2. use Dir.mktempdir but ensure that all provided file names\r\n # use the platform specific SEPARATOR\r\n #\r\n # for whatever Reason, I decided for 2.\r\n \r\n tempfile = input\r\n tempfilePdf = \"#{@tempdir}/x.TeX.md\".to_osPath\r\n tempfileHtml = \"#{@tempdir}/x.html.md\".to_osPath\r\n outfilePdf = \"#{outdir}/#{outname}.pdf\".to_osPath\r\n outfileDocx = \"#{outdir}/#{outname}.docx\".to_osPath\r\n outfileHtml = \"#{outdir}/#{outname}.html\".to_osPath\r\n outfileRtf = \"#{outdir}/#{outname}.rtf\".to_osPath\r\n outfileLatex = \"#{outdir}/#{outname}.latex\".to_osPath\r\n outfileText = \"#{outdir}/#{outname}.txt\".to_osPath\r\n outfileSlide = \"#{outdir}/#{outname}.slide.html\".to_osPath \r\n \r\n #todo: handle latexStyleFile by configuration\r\n latexStyleFile = File.dirname(File.expand_path(__FILE__))+\"/../../ZSUPP_Styles/default.latex\"\r\n latexStyleFile = File.expand_path(latexStyleFile).to_osPath\r\n\r\n vars_string=vars.map.map{|key, value| \"-V #{key}=#{value.esc}\"}.join(\" \")\r\n \r\n @log.info(\"rendering #{outname} as [#{format.join(', ')}]\")\r\n \r\n if $?.success? then\r\n \r\n if format.include?(\"pdf\") then\r\n ReferenceTweaker.new(\"pdf\").prepareFile(tempfile, tempfilePdf)\r\n \r\n cmd=\"pandoc -S #{tempfilePdf.esc} --toc --standalone --latex-engine xelatex --number-sections #{vars_string}\" +\r\n \" --template #{latexStyleFile.esc} --ascii -o #{outfilePdf.esc}\"\r\n `#{cmd}`\r\n end\r\n \r\n if format.include?(\"latex\") then\r\n \r\n ReferenceTweaker.new(\"pdf\").prepareFile(tempfile, tempfilePdf)\r\n \r\n cmd=\"pandoc -S #{tempfilePdf.esc} --toc --standalone --latex-engine xelatex --number-sections #{vars_string}\" +\r\n \" --template #{latexStyleFile.esc} --ascii -o #{outfileLatex.esc}\"\r\n `#{cmd}`\r\n end\r\n \r\n if format.include?(\"html\") then\r\n \r\n ReferenceTweaker.new(\"html\").prepareFile(tempfile, tempfileHtml)\r\n \r\n cmd=\"pandoc -S #{tempfileHtml.esc} --toc --standalone --self-contained --ascii --number-sections #{vars_string}\" +\r\n \" -o #{outfileHtml.esc}\"\r\n \r\n `#{cmd}`\r\n end\r\n \r\n if format.include?(\"docx\") then\r\n \r\n ReferenceTweaker.new(\"html\").prepareFile(tempfile, tempfileHtml)\r\n \r\n cmd=\"pandoc -S #{tempfileHtml.esc} --toc --standalone --self-contained --ascii --number-sections #{vars_string}\" +\r\n \" -o #{outfileDocx.esc}\"\r\n `#{cmd}`\r\n end\r\n \r\n if format.include?(\"rtf\") then\r\n \r\n ReferenceTweaker.new(\"html\").prepareFile(tempfile, tempfileHtml)\r\n \r\n cmd=\"pandoc -S #{tempfileHtml.esc} --toc --standalone --self-contained --ascii --number-sections #{vars_string}\" +\r\n \" -o #{outfileRtf.esc}\"\r\n `#{cmd}`\r\n end\r\n \r\n if format.include?(\"txt\") then\r\n \r\n ReferenceTweaker.new(\"pdf\").prepareFile(tempfile, tempfileHtml)\r\n \r\n cmd=\"pandoc -S #{tempfileHtml.esc} --toc --standalone --self-contained --ascii --number-sections #{vars_string}\" +\r\n \" -t plain -o #{outfileText.esc}\"\r\n `#{cmd}`\r\n end\r\n \r\n if format.include?(\"slide\") then\r\n \r\n ReferenceTweaker.new(\"slide\").prepareFile(tempfile, tempfilePdf)\r\n \r\n cmd=\"pandoc -S #{tempfileHtml.esc} --toc --standalone --number #{vars_string}\" +\r\n \" --ascii -t dzslides --slide-level 2 -o #{outfileSlide.esc}\"\r\n `#{cmd}`\r\n end\r\n else\r\n \r\n @log.error \"failed to perform #{cmd}\"\r\n #TODO make a try catch block kere\r\n \r\n end\r\n \r\n end", "def show\n @customer = Customer.all\n# respond_to do |format|\n# format.html # show.html.erb\n# format.xml { render :xml => @customer }\n# end\n\tprawnto :filename => 'Report-Customers.pdf', :inline => false\n end", "def show\n respond_to do |format|\n format.html\n\n # Require on a .pdf request\n format.pdf do\n\n # Use open-uri to open images via url\n require \"open-uri\"\n\n # Create a blank pdf document with var pdf\n pdf = Prawn::Document.new\n\n # Home address\n pdf.text \"#{@home.address}\", size: 16, style: :bold\n pdf.move_down 15 \n pdf.stroke_horizontal_rule\n\n # Check to see if there is a home image.\n if @home.image_outside.present?\n # If present print image\n pdf.image open(\"#{@home.image_outside}\"), :width => 270, :at => [0, 670]\n end\n if @home.image_inside.present?\n # If present print image\n pdf.image open(\"#{@home.image_inside}\"), :width => 270, :at => [280, 670]\n end\n\n pdf.image open(\"https://chart.googleapis.com/chart?chs=100x100&cht=qr&chl=http://homey.io/homes/#{@home.id}\"), :width => 55, :at => [480, 745]\n \n table_data = \n [[\"<b>Price</b>\", \"$#{@home.price}\"], \n [\"<b>Beds</b>\", \"#{@home.beds}\"], \n [\"<b>Baths</b>\", \"#{@home.baths}\"],\n [\"<b>House Size</b>\", \"#{@home.house_size} square ft.\"],\n [\"<b>Lot Size</b>\", \"#{@home.lot_size} acres\"],\n [\"<b>Year Built</b>\", \"#{@home.year}\"]]\n pdf.move_down(230)\n pdf.table(table_data, :width => 280, :cell_style => { :inline_format => true }) \n pdf.bounding_box([300, 455], :width => 230) do\n pdf.text \"#{@home.description}\", size: 11\n end\n\n # Print the static map\n pdf.image open(\"http://maps.google.com/maps/api/staticmap?size=600x500&sensor=false&zoom=15&markers=#{@home.latitude}%2C#{@home.longitude}\"), :width => 280, :at => [0, 280]\n pdf.draw_text \"Made with <3 by Homey.io\", size: 11, :at => [0,0]\n \n # Render the pdf and set the filename to the address\n # Make the pdf render in the browser\n send_data pdf.render, filename: \"#{@home.address}.pdf\",\n type: \"application/pdf\", disposition: \"inline\"\n end\n end\n end", "def show\n respond_to do |format|\n format.html\n # display a pdf that already exists\n format.pdf do\n render pdf: \"license_agreement\",\n template: \"licenses/license.pdf.erb\",\n locals: {:license => @license}\n end\n end\n end", "def to_pdf_data; end", "def show\n respond_to do |format|\n format.html \n format.pdf do\n render :pdf => \"Formato\",\n :template => 'created_formats/pdf/formatos.pdf.erb',\n :layout => 'pdf.html.erb',\n margin: {\n top: 15\n },\n\n :show_as_html => params[:debug].present?\n end\n end\n end", "def pdf_template\n 'pro/subscriptions/invoices.pdf.haml'\n end", "def index\n page_title = params[:page]\n @page = @wiki.find_or_new_page(page_title)\n if @page.new_record?\n edit\n render :action => 'edit' and return\n end\n @content = @page.content_for_version(params[:version])\n if params[:export] == 'html'\n export = render_to_string :action => 'export', :layout => false\n send_data(export, :type => 'text/html', :filename => \"#{@page.title}.html\")\n return\n elsif params[:export] == 'txt'\n send_data(@content.text, :type => 'text/plain', :filename => \"#{@page.title}.txt\")\n return\n end\n render :action => 'show'\n end", "def getpdf\n # source info page: https://github.com/usgpo/link-service\n\n #Query: bill number, bill type, congress, bill version OR most recent\n #Parameters:\n #collection: Required - Value is bills.\n #billtype: Required - Values are hr, s, hjres, sjres, hconres, sconres, hres, sres.\n #billversion: Optional - If bill version is not provided, the most recent version of a bill is returned. Values are as, cps, fph, lth, ppv, rds, rhv,\n # rhuc, ash, eah, fps, lts, pap, rev, rih, sc, eas, hdh, nat, pwah, reah, ris, ath, eh, hds, oph, rah, res, rsv, ats, eph, ihv, ops, ras, renr, rth,\n # cdh, enr, iph, pav, rch, rfh, rts, cds, esv, ips, pch, rcs, rfs, s_p, cph, fah, isv, pcs, rdh, rft, sas, mostrecent. <-----\n #billnum: Required - This is the numerical bill number. Sample value is 1027.\n #congress: Required - This is the numerical Congress number. Sample value is 112.\n #link-type: Optional - This is the format of the returned document. Default is pdf. Other values are xml, html, mods, premis, contentdetail.\n\n #Examples:\n #https://api.fdsys.gov/link?collection=bills&billtype=hr&billversion=ih&billnum=1&congress=112\n #https://api.fdsys.gov/link?collection=bills&billtype=hconres&billnum=17&congress=112&link-type=xml\n\n # the above api accepts mostrecent as an argument, which is why I will be using it (that way I dont have to infer version through status, which would\n # be overhead).\n\n # replace tempfile location by a location in a folder under meritmoot. After returning the file to the user\n # check the last checked time. If its been a bit (like 2 hours), go through and delete all files that havent been\n # accessed in, like, a day.\n\n # I have noticed that some pdfs dont load on meritmoot.com. I am gueeesssssssing this is due to timeout. This is probably extendable in javascript.\n # extend it to 15 seconds.\n\n #capture crap\n logWatch(\"GetBillPdf\") { |log|\n require 'net/http'\n require 'time'\n billType = params['billtype']\n billNum = params['billnum']\n billCongress = params['congress']\n billVersion = 'mostrecent'\n billVersion = params['billversion'] if not params['billversion'].nil?\n\n theFile = nil\n prefix = \"moot-pdf\"\n theFileName = \"#{prefix}-#{billCongress}-#{billType}-#{billNum}-#{billVersion}.pdf\"\n\n #figure out if we allready have it\n files = Dir.entries(\"/tmp\")\n files.select!{ |name| name == theFileName }\n p \"files: #{files}\"\n if files.length == 1\n theFile = \"/tmp/\" + theFileName\n theFile = File.open(theFile)\n createTime = theFile.ctime\n billUpdateTime = Mmbill.find_by(bill_id: \"#{billType}#{billNum}-#{billCongress}\".downcase)\n if billUpdateTime == nil\n logWatch(\"pdfs_related_Mmbill_not_found\"){ \n p(\"#{billType}#{billNum}-#{billCongress} - #{theFileName}\")\n }\n billUpdateTime = Time.new(1990) #something a long time ago\n else \n billUpdateTime = Time.parse(billUpdateTime.bulk['history']['active_at'])\n end\n\n #outdated?\n if createTime > billUpdateTime\n #No just pass it back\n send_file(theFile, filename: theFileName, type: 'application/pdf', disposition: 'inline')\n else\n #Yes it is outdated. delete it\n theFile.close\n File.delete(\"/tmp/\" + theFileName)\n theFile = nil\n end\n end\n if theFile == nil\n theFile = File.open(\"/tmp/\" + theFileName, \"w\", :encoding => 'ascii-8bit')\n #https://api.fdsys.gov/link?collection=bills&billtype=sres&billversion=mostrecent&billnum=14&congress=116\n Net::HTTP.get_response(URI.parse(\"https://api.fdsys.gov/link?collection=bills&billtype=#{billType}&billversion=#{billVersion}&billnum=#{billNum}&congress=#{billCongress}\")) do |r|\n p \"code: #{r.code}\"\n ApiController.passingAround(r, theFile)\n end\n send_file(theFile, filename: theFileName, type: 'application/pdf', disposition: 'inline')\n theFile.close()\n end\n #bit of cleanup.\n #delete old ones\n files = Dir.entries(\"/tmp\")\n #select ones we handle, and that are three days since last accesssed\n files.select!{|name| name[prefix] != nil and File.atime(\"/tmp/\" + name) < Time.now - ( 3 * 24 * 60 * 60 ) }\n for rejectFile in files\n #rejectFile.close\n File.delete(\"/tmp/#{rejectFile}\")\n end\n }\n end", "def output_version\n puts \"#{File.basename($0)} version #{BM_VERSION}\"\n end", "def pdf=(klass); end", "def pdf_file\n ActiveSupport::Deprecation.warn('This API has changed: Please use order.pdf_invoice.pdf instead')\n pdf_invoice.pdf\n end", "def index\n prawnto :prawn => {\n :page_size => PdfSpecs::PAGE_SIZE, # (Handy Dandy page size)\n :margin => PdfSpecs::PAGE_MARGIN # Top, Right, Bottom, Left\n }\n @dispatch_centers = DispatchCenter.find(:all, :order => :name)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @dispatch_centers }\n format.pdf # index.pdf.prawn\n end\n end", "def printout()\n user_training_rows = @user_training.user_training_rows\n .includes(:exercise, :training_step_type)\n .sort_by_part_order\n .all\n if user_training_rows.size < 1\n flash[:error] = I18n.t(:no_detail_to_process)\n redirect_to( user_trainings_path() ) and return\n end\n title = I18n.t('trainings.show_title').gsub( \"{TRAINING_TITLE}\", @user_training.description )\n\n # == OPTIONS setup + RENDERING phase ==\n base_filename = \"#{I18n.t('trainings.training')}_#{@user_training.description}\"\n filename = create_unique_filename( base_filename ) + '.pdf'\n options = {\n report_title: title,\n meta_info_subject: 'training model printout',\n meta_info_keywords: \"Goggles, #{base_filename}\",\n header_row: TrainingDecorator.decorate( @user_training ),\n detail_rows: TrainingRowDecorator.decorate_collection( user_training_rows )\n }\n send_data( # == Render layout & send data:\n TrainingPrintoutLayout.render( options ),\n type: 'application/pdf',\n filename: filename\n )\n end", "def show\n @exercice = Exercice.find(params[:id])\n content = render_to_string(:template => \"/exercices/show.pdf.erb\", :layout => true)\n puts content\n puts \"###################################################################\"\n target = \"/var/www/ludo/public/pdf/temp.pdf\"\n File.open(target, \"w+\") do |f|\n f.write(content)\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exercice }\n format.pdf { render pdf: @exercice }\n end\n end", "def show\n @sticker_configuration = StickerConfiguration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sticker_configuration }\n format.pdf { generate_documentation([stickerconfiguration: [cle: 'valeur']]) }\n end\n end" ]
[ "0.6356347", "0.62784755", "0.6270002", "0.6260341", "0.6241639", "0.6205919", "0.6183901", "0.6047671", "0.60359865", "0.5997929", "0.5948304", "0.59422046", "0.59321773", "0.58846617", "0.58519673", "0.58256805", "0.5791354", "0.57863605", "0.5763888", "0.5758017", "0.5733082", "0.5719052", "0.5717387", "0.57120234", "0.5704363", "0.568742", "0.56698704", "0.5640225", "0.5617053", "0.56135887", "0.56121683", "0.5605941", "0.55934256", "0.55892277", "0.556429", "0.55614024", "0.5556568", "0.5553427", "0.5552884", "0.55484813", "0.5539513", "0.553584", "0.5533493", "0.5530211", "0.55281764", "0.55255866", "0.5496314", "0.5486782", "0.5480599", "0.5476881", "0.54657125", "0.5461095", "0.54563564", "0.545291", "0.5441424", "0.54243463", "0.54232526", "0.54216516", "0.54187965", "0.5415981", "0.5415981", "0.541424", "0.5408676", "0.5405445", "0.5395308", "0.53908104", "0.5388503", "0.5388171", "0.53873265", "0.5386953", "0.5385249", "0.53830034", "0.5379016", "0.5378485", "0.5371275", "0.5368961", "0.53679544", "0.53679544", "0.53677803", "0.5367048", "0.53650695", "0.5363702", "0.5355371", "0.53547657", "0.53487474", "0.5336634", "0.53351253", "0.53345823", "0.5330847", "0.5328159", "0.53204674", "0.5314243", "0.53134525", "0.5307635", "0.53043205", "0.5304178", "0.53009987", "0.5300565", "0.5300306", "0.52996576", "0.5298941" ]
0.0
-1
Uses the same Logger instance as ActiveRecord.
def logger ::ActiveRecord::Base.logger end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize\n ActiveRecord::Base.logger = Logger.new(STDOUT)\n end", "def setup_database_logger\n ActiveRecord::Base.logger = PuppetHerald.logger\n nil\n end", "def log_to(stream, colorize=true)\n ActiveRecord::Base.logger = Logger.new(stream)\n ActiveRecord::Base.clear_active_connections!\n ActiveRecord::Base.colorize_logging = colorize\nend", "def logger=(lggr)\n ActiveRecord::Base.logger = lggr\n end", "def db_logger\n self.class.database_logger\n end", "def log_to(stream)\n ActiveRecord::Base.logger = Logger.new(stream)\n ActiveRecord::Base.clear_active_connections!\n end", "def redirect_log(options={})\n ActiveRecord::Base.logger = Logger.new(options.fetch(:to, STDERR))\n ActiveRecord::Base.clear_active_connections!\n ActiveRecord::Base.colorize_logging = options.fetch(:colorize, true)\nend", "def enable_activerecord_sql_logging\n ActiveRecord::Base.logger.level = 0\nend", "def logger=(logger); end", "def logger=(logger); end", "def log=(logger); end", "def disable_activerecord_sql_logging\n ActiveRecord::Base.logger.level = 1\nend", "def init_rails!\n log_level = (\"ActiveSupport::BufferedLogger::Severity::\"+Rails::Application.config.log_level.to_s.upcase).constantize\n @logger = ActiveSupport::BufferedLogger.new(File.join(Rails.root, \"log\", \"#{@name.underscore}.log\"), log_level)\n\n #NOTE/TODO: I noticed in the Rails docs, they will eventually make ActionView use a seperate logger\n # than ActionController, so this will eventually need to be added in here\n [Rails, ActiveRecord::Base, ActionController::Base, ActionMailer::Base].each do |logged_module|\n #just in case there is a logger there, close it\n logged_module.logger.close rescue nil\n logged_module.logger = @logger\n end\n\n #reestablish db connection\n ActiveRecord::Base.establish_connection\n end", "def database_logger \n # NOTE:: Having an instance variable here, causes problems\n # when having two Sinatra Apps, each with their own db setup.\n # the instance variable retains only the last setup, so the\n # first setup is overwritten.\n @database_logger ||= ::DataMapper::Logger.new(dm_logger_path, dm_logger_level)\n end", "def logger\n @_logger ||= Logger.new(self)\n end", "def configure_logging\n @logger = Logging.logger[self]\n end", "def log\n @log ||= Logging.logger[self]\n end", "def use_logger(logger)\n adapter.logger = logger\n end", "def logger\n @logger ||= self.class.logger\n end", "def logger=(logger)\n db.connection.instance_variable_set(:@logger, logger)\n end", "def logger=(logr); @logger = logr end", "def logger ; @log end", "def _logger\n @logger ||= Log4r::Logger.new(self.class.to_s)\n end", "def logger\n @logger ||= Logger.new(self)\n end", "def initialize(logfile_path=nil)\n if logfile_path\n ar_logger = Logger.new(logfile_path)\n ar_logger.level = Logger::INFO\n ActiveRecord::Base.logger = ar_logger\n end\n end", "def logger\r\n self.class.logger\r\n end", "def logger \n klass = self.class\n klass.logger\n end", "def log\n Logger.instance\n end", "def logger\n Rails.logger ||= ::Logger.new(STDOUT)\n @logger ||= Rails.logger\n end", "def logger\n @logger ||= Rails.logger\n end", "def logger\n @logger ||= Rails.logger\n end", "def logger\n @logger ||= Rails.logger\n end", "def logger\n self.class.logger\n end", "def logger\n RAILS_DEFAULT_LOGGER\n end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; end", "def logger; settings.logger; end", "def get_logger; @logger; end", "def logger; LOGGER; end", "def logger; settings(:logger); end", "def logger\n @logger ||= Logging.logger_for(self.class.name)\n end", "def logger\n @logger ||= build_logger\n end", "def logger\n @logger ||= set_logger\n end", "def logger\n adapter.logger if adapter\n end", "def initialize\n self.models = {}\n self.object_map = {}\n self.fixture_name_map = {}\n\n # Lower the logging level since we are about to create many records.\n _logger = Logger.new(STDOUT)\n _logger.level = Logger::ERROR\n ActiveRecord::Base.logger = _logger\n end", "def logger\n adapter.logger\n end", "def logger\n adapter.logger\n end", "def logger\n @logger\n end", "def logger\n initialize_logger unless @logger\n @logger\n end", "def log\n self.class.log\n end", "def logger\n reset_logger! unless defined? @@logger\n @@logger\n end", "def log_row(row)\n #overwrite this class\n end", "def logger=(writer); end", "def logger=(writer); end", "def logger=(writer); end", "def logger=(writer); end", "def logger=(writer); end", "def logger\n @log\n end", "def logger\n @log\n end", "def logger\n @__logger\n end", "def reset_logging\n\t\tTreequel.reset_logger\n\tend", "def log\n\t\t\t@log_proxy ||= ClassNameProxy.new( self.class )\n\t\tend", "def log\n\t\t\t@log_proxy ||= ClassNameProxy.new( self.class )\n\t\tend", "def log\n\t\t\t@log_proxy ||= ClassNameProxy.new( self.class )\n\t\tend", "def log\n\t\t\t@log_proxy ||= ClassNameProxy.new( self.class )\n\t\tend", "def log\n\t\t\t@log_proxy ||= ClassNameProxy.new( self.class )\n\t\tend", "def log\n @logger ||= Logger.new(nil)\n @logger\n end", "def logger\n @logger ||= _new_logger\n end", "def attach_to(logger)\n logger.extend ActiveSupport::Logger.broadcast(ActiveSupport::Logger.new(self))\n end", "def logger\n @logger ||= Doing.logger\n end", "def logger\n @logger ||= Logging.get_logger(self)\n end", "def logger=\n # NOTE: in the future this could be overwritten by someone looking to overwrite with their\n # own logger.\n raise 'Logger cannot be overwritten'\n end", "def log=(log); end", "def logger\n @logger\n end", "def logger\n @logger\n end", "def logger\n LOGGER\n end", "def log\n Engine.logger\n end", "def initialize logger = Nacreon.log\n\t\t\tself.log = logger\n\t\tend", "def log= logger\n @log = logger\n end", "def log= logger\n @log = logger\n end", "def use_logger(logger)\n @logger = logger\n end", "def use_logger(logger)\n @logger = logger\n end", "def logger\n @logger ||= create_logger\n end" ]
[ "0.75238466", "0.69362867", "0.6859795", "0.684676", "0.67984843", "0.6709869", "0.6704235", "0.64878684", "0.64028716", "0.64028716", "0.6385451", "0.6347033", "0.6296572", "0.6265681", "0.6176897", "0.61532813", "0.6151292", "0.6148919", "0.61380625", "0.6129229", "0.61104786", "0.61015403", "0.6098254", "0.6096878", "0.6091482", "0.6057439", "0.60561913", "0.6045641", "0.6044572", "0.6030195", "0.6030195", "0.6013199", "0.5979891", "0.59683144", "0.5961669", "0.5961669", "0.5961669", "0.5961669", "0.5961669", "0.5961669", "0.5961669", "0.5961669", "0.5961669", "0.5961669", "0.5961669", "0.5961669", "0.5961669", "0.5961669", "0.5961669", "0.5961669", "0.5961669", "0.5961669", "0.5961669", "0.5934", "0.5915401", "0.5905041", "0.58979726", "0.5888724", "0.58818907", "0.5878575", "0.5876285", "0.58740604", "0.5871434", "0.5871434", "0.5867335", "0.58655804", "0.5851179", "0.5850086", "0.58494586", "0.5832534", "0.5832534", "0.5832534", "0.5832534", "0.5832534", "0.5832475", "0.5832475", "0.5829773", "0.5825535", "0.5817695", "0.5817695", "0.5817695", "0.5817695", "0.5817695", "0.581437", "0.5807291", "0.58048725", "0.57930714", "0.57609004", "0.57600313", "0.5756311", "0.57559514", "0.57559514", "0.57472503", "0.5745679", "0.573131", "0.57091326", "0.57091326", "0.5707519", "0.5707519", "0.570587" ]
0.7409393
1
Generate scope at top level e.g. User.on_standby
def on_standby(name = :null_state) # Why where(nil)? # http://stackoverflow.com/questions/18198963/with-rails-4-model-scoped-is-deprecated-but-model-all-cant-replace-it name = :userdb if user_db? context = where(nil) context.standby_target = name || :null_state context.optional = false context end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scope_level; end", "def scope_name; end", "def scopes; end", "def scope; end", "def scope; end", "def scope; end", "def scope; end", "def scope; end", "def scope; end", "def scope; end", "def scope; end", "def scope; end", "def scope; end", "def scope\n @scope ||= Array(@root_scope) + [Inflector.underscore(name)]\n end", "def scope_options; end", "def scope_options; end", "def scope\n @scope ||= \"study.#{app_name}\"\n end", "def scope\n @scope ||= {}\n end", "def scope\n @scope ||= {}\n end", "def policy_scopes; end", "def scope_condition() \"1\" end", "def scope=(_); end", "def prov_scope(opts)\n scope = []\n # Request date (created since X days ago)\n scope << [:created_recently, opts[:time_period].to_i] if opts[:time_period].present?\n # Select requester user across regions\n scope << [:with_requester, current_user.id] unless approver?\n scope << [:with_requester, opts[:user_choice]] if opts[:user_choice] && opts[:user_choice] != \"all\"\n\n scope << [:with_approval_state, opts[:applied_states]] if opts[:applied_states].present?\n scope << [:with_type, MiqRequest::MODEL_REQUEST_TYPES[model_request_type_from_layout].keys]\n scope << [:with_request_type, opts[:type_choice]] if opts[:type_choice] && opts[:type_choice] != \"all\"\n scope << [:with_reason_like, opts[:reason_text]] if opts[:reason_text].present?\n\n scope\n end", "def default_scope; end", "def base_scope\n ApplicationRecord.none\n end", "def scope\n read_attr :scope, :to_sym\n end", "def scope() binding end", "def scope(level = @skl_level)\n return @skl_levelcache[level][:scope]\n end", "def apply_standard_scope\n each_sort do |attribute, direction|\n @scope = resource.adapter.order(@scope, attribute, direction)\n end\n @scope\n end", "def scope\n @scope ||= %i[evil client errors] << \\\n Tram::Policy::Inflector.underscore(model.to_s).to_sym\n end", "def scopes\n @@scopes ||= {}\n end", "def scope_condition() {} end", "def scopes\n @scopes ||= {}\n end", "def stradivari_scopes\n @_stradivari_scopes ||= {}\n end", "def scope *args\n [main_scope, args, graphite_identifier].flatten.compact.map(&:to_s).join('.')\n end", "def try_to_set_scope\n #this is a commodity method\n if self.featurable.is_a?(Account)\n self.scope = \"AccountPlan\"\n end\n end", "def global_scope; @scope = :global end", "def scopes\n read_inheritable_attribute(:scopes) || write_inheritable_attribute(:scopes, {})\n end", "def scope(*args); end", "def create_with_scope(name); end", "def scope!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 2)\n\n type = SCOPE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 8:9: 'scope'\n match(\"scope\")\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__, 2)\n\n end", "def scope_by(&block)\n raise 'Cannot define scope after scope has been called.' if @scope\n\n @scope_block = block\n end", "def doe_scope\n scope = \"none\"\n @envelopeLevel.each_index do |index|\n @envelopeLevel[index].each do |name|\n if (@commandName == name )\n scope = \"envelope\"\n end\n end\n end\n\n @hvacLevel.each_index do |index|\n @hvacLevel[index].each do |name|\n if (@commandName == name )\n scope = \"hvac\"\n end\n end\n end\n return scope\n end", "def all_scopes\n @all_scopes ||=\n {'identity' => (auth['scope'] || apps_permissions_users_list[user_id].to_h['scopes'].to_a.join(',')).to_s.split(',')}\n .merge(auth['scopes'].to_h)\n end", "def scope(*)\n self['scope'] || self['current_account'].travel_plans\n end", "def scope\n @scope\n end", "def scope\n @scope\n end", "def define_scopes(custom_plural = T.unsafe(nil)); end", "def dynamic_scopes\n self.scopes.select { |name, args| args.present? }\n end", "def scope\n parameter[:scope]\n end", "def available_scopes\n (default_scopes << Doorkeeper.config.optional_scopes.to_a).flatten.uniq\n end", "def scope=(_arg0); end", "def scope=(_arg0); end", "def scope=(_arg0); end", "def local_scope; @scope = :local end", "def scopeName _args\n \"scopeName _args;\" \n end", "def scope\n klass\n end", "def scope() yield end", "def skip_policy_scope; end", "def default_visible_key_scope\n lambda { all }\n end", "def scope_test\n end", "def scope\n finder_or_run(:scope)\n end", "def l_scope(*sections, &block)\r\n ArkanisDevelopment::SimpleLocalization::Language.with_app_scope(*sections, &block)\r\n end", "def newscope(parent, options = {})\n raise _('having multiple named scopes is not supported when scripting')\n end", "def build_scope_from_columns\n self.scope\n end", "def scope\n @attributes[:scope]\n end", "def define_scope_method(name)\n singleton_class.class_eval do\n ruby2_keywords(\n define_method(name) do |*args|\n scoping = _declared_scopes[name]\n scope = instance_exec(*args, &scoping[:scope])\n extension = scoping[:extension]\n to_merge = scope || queryable\n criteria = to_merge.empty_and_chainable? ? to_merge : with_default_scope.merge(to_merge)\n criteria.extend(extension)\n criteria\n end\n )\n end\n end", "def read_scope(user)\n self\n end", "def current_scope\n params[:scope].try(:to_sym) || railgun_resource.default_scope.try(:key)\n end", "def custom_scope_get scope_name\n\t\t\tThread.current[SESSION].custom_scope_get scope_name\n\t\tend", "def scopes\n scope_names.to_a.sort\n end", "def on_optional_standby(name = :null_state)\n # Why where(nil)?\n # http://stackoverflow.com/questions/18198963/with-rails-4-model-scoped-is-deprecated-but-model-all-cant-replace-it\n context = where(nil)\n name = :userdb if user_db?\n context.standby_target = name || :null_state\n context.optional = true\n context\n end", "def scope\n Pundit.policy_scope!(user, record.class)\n end", "def scope=(value)\n @scope = value\n end", "def scope=(value)\n @scope = value\n end", "def scope=(value)\n @scope = value\n end", "def scope=(value)\n @scope = value\n end", "def scope=(value)\n @scope = value\n end", "def scope=(value)\n @scope = value\n end", "def scope\n @options[:scope]\n end", "def scopes\n self.class.scopes\n end", "def apply_scopes(*)\n relation = super\n relation = relation.accessible_by(current_ability) if scope_accessible?\n relation\n end", "def dynamic_scopes\n self.scope_definition.select { |_k, v| v.present? }\n end", "def constant_scopes_cache; end", "def create_country_specific_gon_variables\n employee_country = current_employee.present? ? current_employee.operating_country : nil\n yard_uid_management = employee_country.nil? ? nil : UidManagement.uid_manager_for(Yard, employee_country)\n gon.copartYards =\n if yard_uid_management.present?\n Yard.for_country_uid(yard_uid_management.min_number, yard_uid_management.max_number)\n .copart_yards\n .for_employee(current_employee).as_json(include_basic: 'yes', list: true)\n else\n []\n end\n gon.showYardFilter = gon.copartYards.size > 1\n gon.facilities = Facility.includes(:country).for_country(employee_country)\n .non_residential.ordered_by(\"name\", Facility::SORT_ASCENDING).as_json(include_basic: \"yes\") #this should become a current_user based scope when that is all set up\n gon.sellers = Seller.for_country(employee_country)\n .ordered_by(\"name\", Seller::SORT_ASCENDING).as_json\n gon.members = MemberResource.find_by_ids(@vehicles.map(&:member_id)\n .compact.uniq).map {|m| {id: m.id, member_name: m.full_name}} if params[:state_as_string].present? && Vehicle.is_requesting_for_post_auction_stage?(params[:state_as_string])\n gon.showSellerFilter = gon.sellers.size > 1\n end", "def scope &block\n env.scope(&block)\n end", "def scope &block\n env.scope(&block)\n end", "def scope &block\n env.scope(&block)\n end", "def scope_condition\n {}\n end", "def scope_condition\n {}\n end", "def scope\n nodename = Facter.value('hostname')\n fact_values = Facter.to_hash\n node = Puppet::Node.new(nodename, :facts => Puppet::Node::Facts.new(\"facts\", fact_values))\n compiler = Puppet::Parser::Compiler.new(node)\n # configure compiler with facts and node related data\n # Set all global variables from facts\n fact_values.each {|param, value| compiler.topscope[param] = value }\n # Configured trusted data (even if there are none)\n compiler.topscope.set_trusted(node.trusted_data)\n # Set the facts hash\n # compiler.topscope.set_facts(fact_values)\n\n # pretend that the main class (named '') has been evaluated\n # since it is otherwise not possible to resolve top scope variables\n # using '::' when rendering. (There is no harm doing this for the other actions)\n #\n compiler.topscope.class_set('', compiler.topscope)\n scope = Puppet::Parser::Scope.new(compiler)\n scope.source = Puppet::Resource::Type.new(:node, nodename)\n scope.parent = compiler.topscope\n scope\n end", "def current_base\n current = @@policies\n @@scopes.each do |scope|\n next unless scope\n current[scope] = {} unless current[scope]\n current = current[scope]\n end\n current\n end", "def current_user_scope\n current_user\n end", "def scope_name name\n name.to_s.pluralize.to_sym\n end", "def regulate_scope(name, &block)\n name, block = __synchromesh_parse_regulator_params(name, block)\n singleton_class.send(:define_method, :\"__secure_remote_access_to_#{name}\") do |this, acting_user, *args|\n r = this.send(name, *args)\n r = ReactiveRecordPsuedoRelationArray.new(r) if r.is_a? Array\n __set_synchromesh_permission_granted(this, r, r, acting_user, args, &block)\n end\n end", "def people_scope\n Person.all.order_by_full_name\n end", "def ransackable_scopes(_auth_object = nil)\n %i(grades)\n end", "def scopes\n @scopes ||= config[:scopes] || []\n end", "def devise_scope(scope); end", "def default_scope=(_arg0); end" ]
[ "0.68267345", "0.6562429", "0.6387693", "0.63002384", "0.63002384", "0.63002384", "0.63002384", "0.63002384", "0.63002384", "0.63002384", "0.63002384", "0.63002384", "0.63002384", "0.6229262", "0.6078659", "0.6078659", "0.60506463", "0.59416234", "0.59416234", "0.5915341", "0.590717", "0.5866602", "0.5802465", "0.57929003", "0.57842034", "0.5783224", "0.5777146", "0.57419765", "0.56930697", "0.5641733", "0.55886275", "0.5569025", "0.5563654", "0.55542827", "0.5550687", "0.5547846", "0.5547331", "0.55288297", "0.5524319", "0.55107087", "0.549728", "0.54933095", "0.5483751", "0.54830027", "0.5474255", "0.54713213", "0.54713213", "0.5458605", "0.5448816", "0.5446877", "0.54332435", "0.54329425", "0.54329425", "0.54329425", "0.5431711", "0.5420108", "0.53946567", "0.5394565", "0.5376758", "0.5375843", "0.53640133", "0.53284866", "0.5320101", "0.53177136", "0.5300287", "0.5299221", "0.52985287", "0.52957004", "0.52949625", "0.5281189", "0.5274594", "0.5262848", "0.5262315", "0.5254528", "0.5254528", "0.5254528", "0.5254528", "0.5254528", "0.5254528", "0.52491856", "0.524497", "0.5240598", "0.5233726", "0.5233036", "0.52298695", "0.5226652", "0.5226652", "0.5226652", "0.52227175", "0.52227175", "0.5215501", "0.5211566", "0.5208371", "0.5208124", "0.51964486", "0.5190663", "0.51792645", "0.51781905", "0.51747936", "0.5170427" ]
0.584348
22
Generate scope at top level e.g. User.on_optional_standby
def on_optional_standby(name = :null_state) # Why where(nil)? # http://stackoverflow.com/questions/18198963/with-rails-4-model-scoped-is-deprecated-but-model-all-cant-replace-it context = where(nil) name = :userdb if user_db? context.standby_target = name || :null_state context.optional = true context end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scope_level; end", "def scope_name; end", "def scope_options; end", "def scope_options; end", "def scope\n @scope ||= Array(@root_scope) + [Inflector.underscore(name)]\n end", "def prov_scope(opts)\n scope = []\n # Request date (created since X days ago)\n scope << [:created_recently, opts[:time_period].to_i] if opts[:time_period].present?\n # Select requester user across regions\n scope << [:with_requester, current_user.id] unless approver?\n scope << [:with_requester, opts[:user_choice]] if opts[:user_choice] && opts[:user_choice] != \"all\"\n\n scope << [:with_approval_state, opts[:applied_states]] if opts[:applied_states].present?\n scope << [:with_type, MiqRequest::MODEL_REQUEST_TYPES[model_request_type_from_layout].keys]\n scope << [:with_request_type, opts[:type_choice]] if opts[:type_choice] && opts[:type_choice] != \"all\"\n scope << [:with_reason_like, opts[:reason_text]] if opts[:reason_text].present?\n\n scope\n end", "def scopes; end", "def scope; end", "def scope; end", "def scope; end", "def scope; end", "def scope; end", "def scope; end", "def scope; end", "def scope; end", "def scope; end", "def scope; end", "def scope\n @scope ||= \"study.#{app_name}\"\n end", "def default_scope; end", "def policy_scopes; end", "def available_scopes\n (default_scopes << Doorkeeper.config.optional_scopes.to_a).flatten.uniq\n end", "def scope\n @scope ||= {}\n end", "def scope\n @scope ||= {}\n end", "def scope_condition() \"1\" end", "def base_scope\n ApplicationRecord.none\n end", "def apply_standard_scope\n each_sort do |attribute, direction|\n @scope = resource.adapter.order(@scope, attribute, direction)\n end\n @scope\n end", "def define_scopes(custom_plural = T.unsafe(nil)); end", "def scope\n read_attr :scope, :to_sym\n end", "def dynamic_scopes\n self.scopes.select { |name, args| args.present? }\n end", "def scope=(_); end", "def scope *args\n [main_scope, args, graphite_identifier].flatten.compact.map(&:to_s).join('.')\n end", "def optionals\r\n %w[\r\n scope\r\n ]\r\n end", "def scope\n @scope ||= %i[evil client errors] << \\\n Tram::Policy::Inflector.underscore(model.to_s).to_sym\n end", "def skip_policy_scope; end", "def newscope(parent, options = {})\n raise _('having multiple named scopes is not supported when scripting')\n end", "def scope() binding end", "def scope(level = @skl_level)\n return @skl_levelcache[level][:scope]\n end", "def scopes\n read_inheritable_attribute(:scopes) || write_inheritable_attribute(:scopes, {})\n end", "def scope\n finder_or_run(:scope)\n end", "def all_scopes\n @all_scopes ||=\n {'identity' => (auth['scope'] || apps_permissions_users_list[user_id].to_h['scopes'].to_a.join(',')).to_s.split(',')}\n .merge(auth['scopes'].to_h)\n end", "def try_to_set_scope\n #this is a commodity method\n if self.featurable.is_a?(Account)\n self.scope = \"AccountPlan\"\n end\n end", "def create_with_scope(name); end", "def scope_condition() {} end", "def stradivari_scopes\n @_stradivari_scopes ||= {}\n end", "def scope(*)\n self['scope'] || self['current_account'].travel_plans\n end", "def dynamic_scopes\n self.scope_definition.select { |_k, v| v.present? }\n end", "def default_scope=(_arg0); end", "def scope\n parameter[:scope]\n end", "def current_scope\n params[:scope].try(:to_sym) || railgun_resource.default_scope.try(:key)\n end", "def scope=(_arg0); end", "def scope=(_arg0); end", "def scope=(_arg0); end", "def scopeName _args\n \"scopeName _args;\" \n end", "def doe_scope\n scope = \"none\"\n @envelopeLevel.each_index do |index|\n @envelopeLevel[index].each do |name|\n if (@commandName == name )\n scope = \"envelope\"\n end\n end\n end\n\n @hvacLevel.each_index do |index|\n @hvacLevel[index].each do |name|\n if (@commandName == name )\n scope = \"hvac\"\n end\n end\n end\n return scope\n end", "def scopes\n @scopes ||= {}\n end", "def scopes\n @@scopes ||= {}\n end", "def default_visible_key_scope\n lambda { all }\n end", "def select_scope(scope)\n if [Scopes::SCOPE_PRIVATE, Scopes::SCOPE_PUBLIC, nil].include?(scope)\n Scopes::SCOPE_PRIVATE\n else\n scope\n end\n end", "def extra_scopes()\n @scopes_added_by_common_scopes\n end", "def scope!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 2)\n\n type = SCOPE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 8:9: 'scope'\n match(\"scope\")\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__, 2)\n\n end", "def selected_scope\n (params[:scope] || :default).to_sym\n end", "def scope_test\n end", "def global_scope; @scope = :global end", "def scope\n @scope\n end", "def scope\n @scope\n end", "def local_scope; @scope = :local end", "def apply_scopes(*)\n relation = super\n relation = relation.accessible_by(current_ability) if scope_accessible?\n relation\n end", "def scope\n @options[:scope]\n end", "def custom_scope_get scope_name\n\t\t\tThread.current[SESSION].custom_scope_get scope_name\n\t\tend", "def scope(*args); end", "def scope\n Pundit.policy_scope!(user, record.class)\n end", "def trailing_dots_to_scope_name!\n @hsh = self.class.tdtsn @hsh, scope_name\n end", "def scope\n @attributes[:scope]\n end", "def people_scope\n Person.all.order_by_full_name\n end", "def scope_by(&block)\n raise 'Cannot define scope after scope has been called.' if @scope\n\n @scope_block = block\n end", "def build_scope_from_columns\n self.scope\n end", "def scope_condition\n {}\n end", "def scope_condition\n {}\n end", "def standard_agency1(scope, prefix, mandate)\n case scope\n when \"national\"\n ret = NATIONAL&.dig(@lang, gb_mandate_suffix(prefix, mandate).to_sym,\n :admin) || nil\n ret = ret.join(\" \") if ret && ret.is_a?(Array)\n ret\n when \"sector\"\n SECTOR&.dig(@lang, prefix.to_sym, :admin) || nil\n when \"local\"\n LOCAL&.dig(@lang, prefix.to_sym) || nil \n when \"enterprise\", \"social-group\"\n @issuer || nil\n when \"professional\" then \"PROFESSIONAL STANDARD\" # TODO\n end\n end", "def define_scope_method(name)\n singleton_class.class_eval do\n ruby2_keywords(\n define_method(name) do |*args|\n scoping = _declared_scopes[name]\n scope = instance_exec(*args, &scoping[:scope])\n extension = scoping[:extension]\n to_merge = scope || queryable\n criteria = to_merge.empty_and_chainable? ? to_merge : with_default_scope.merge(to_merge)\n criteria.extend(extension)\n criteria\n end\n )\n end\n end", "def policy_scope(target, options={})\n policy(target, options).scope\n end", "def scope\n scope!(operator) if @scopes.empty?\n scope!(\"AND\") if @scopes.last.is_a?(NestedScope)\n @scopes.last\n end", "def static_scopes\n scopes = self.scope_definition\n .select { |_k, v| v.blank? }\n .keys\n scopes | [:first, :last, :all]\n end", "def scope=(value)\n @scope = value\n end", "def scope=(value)\n @scope = value\n end", "def scope=(value)\n @scope = value\n end", "def scope=(value)\n @scope = value\n end", "def scope=(value)\n @scope = value\n end", "def scope=(value)\n @scope = value\n end", "def create_country_specific_gon_variables\n employee_country = current_employee.present? ? current_employee.operating_country : nil\n yard_uid_management = employee_country.nil? ? nil : UidManagement.uid_manager_for(Yard, employee_country)\n gon.copartYards =\n if yard_uid_management.present?\n Yard.for_country_uid(yard_uid_management.min_number, yard_uid_management.max_number)\n .copart_yards\n .for_employee(current_employee).as_json(include_basic: 'yes', list: true)\n else\n []\n end\n gon.showYardFilter = gon.copartYards.size > 1\n gon.facilities = Facility.includes(:country).for_country(employee_country)\n .non_residential.ordered_by(\"name\", Facility::SORT_ASCENDING).as_json(include_basic: \"yes\") #this should become a current_user based scope when that is all set up\n gon.sellers = Seller.for_country(employee_country)\n .ordered_by(\"name\", Seller::SORT_ASCENDING).as_json\n gon.members = MemberResource.find_by_ids(@vehicles.map(&:member_id)\n .compact.uniq).map {|m| {id: m.id, member_name: m.full_name}} if params[:state_as_string].present? && Vehicle.is_requesting_for_post_auction_stage?(params[:state_as_string])\n gon.showSellerFilter = gon.sellers.size > 1\n end", "def standard_agency(scope, prefix, mandate)\n case scope\n when \"national\"\n NATIONAL&.dig(@lang, gb_mandate_suffix(prefix, mandate).to_sym,\n :admin) || nil\n when \"sector\"\n SECTOR&.dig(@lang, prefix.to_sym, :admin) || nil\n when \"local\"\n \"#{LOCAL&.dig(@lang, prefix.to_sym) || 'XXXX'}#{@labels[\"local_issuer\"]}\" \n when \"enterprise\", \"social-group\"\n @issuer || nil\n when \"professional\" then \"PROFESSIONAL STANDARD\" # TODO\n end\n end", "def pundit_scope(*scope)\n @pundit_api_scope ||= scope\n end", "def default_hidden_key_scope\n lambda { none }\n end", "def read_scope(user)\n self\n end", "def ransackable_scopes(_auth_object = nil)\n %i(grades)\n end", "def create_without_scope(name); end", "def protected_scope(*args)\n self.scope_without_resource_definition_addition(*args)\n end", "def scope_chain\n scope ? [[scope]] : [[]]\n end", "def devise_scope(scope); end", "def current_user_scope\n current_user\n end" ]
[ "0.69047415", "0.6576953", "0.627777", "0.627777", "0.6260164", "0.6244723", "0.6184267", "0.61768425", "0.61768425", "0.61768425", "0.61768425", "0.61768425", "0.61768425", "0.61768425", "0.61768425", "0.61768425", "0.61768425", "0.61379915", "0.6134263", "0.60131955", "0.59738773", "0.5972566", "0.5972566", "0.5917981", "0.58739454", "0.5834822", "0.58258075", "0.5823969", "0.57883537", "0.57832265", "0.57687336", "0.5713751", "0.56798166", "0.566703", "0.56384087", "0.5635364", "0.5622426", "0.5604873", "0.5603548", "0.5593403", "0.55927527", "0.55894387", "0.55798185", "0.55789846", "0.5572919", "0.5561434", "0.5559532", "0.5547357", "0.5543499", "0.5536037", "0.5536037", "0.5536037", "0.5508211", "0.55065316", "0.55048496", "0.5500092", "0.548383", "0.5480354", "0.5479466", "0.54769194", "0.5436223", "0.5431752", "0.54270715", "0.5419831", "0.5419831", "0.5419432", "0.5408662", "0.540079", "0.53987324", "0.5391785", "0.5379169", "0.5378743", "0.53776246", "0.5373805", "0.53649735", "0.53619766", "0.5361483", "0.5361483", "0.5350248", "0.53462017", "0.53305835", "0.53241694", "0.5308118", "0.5287044", "0.5287044", "0.5287044", "0.5287044", "0.5287044", "0.5287044", "0.5276423", "0.52710027", "0.52603364", "0.525987", "0.5259219", "0.5253522", "0.5247633", "0.524749", "0.5247204", "0.5238189", "0.52349126" ]
0.535244
78
Getter (reader) for persons name
def name @name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name_reader\n @name\n end", "def name\n person_name\n end", "def name # getter method (or reader method)\n @name\n end", "def retrieve_name\n return @name\n end", "def get_name\n @name\n end", "def get_name\n @name\n end", "def get_name\n @name\n end", "def get_name\n @name\n end", "def name\n if person\n person.name\n else\n \"\"\n end\n end", "def reader_name\n self[:reader_name].read_string\n end", "def get_name\n return @name\n end", "def get_name\n\t\t@name\n\tend", "def personal_name\n data[:personal_name]\n end", "def get_name\n @name\n end", "def get_name()\n @name\n end", "def get_name()\n @name\n end", "def what_is_name\n @name\n end", "def\n get_name()\n @name\n end", "def getName\n @name\n end", "def getName\n @name\n end", "def student_name\n return @name\n end", "def get_name\n\t\treturn @name\n\tend", "def get_name\n\t\treturn @name\n\tend", "def get_name\n\t\treturn @name\n\tend", "def display_name\n read_attribute :name\n end", "def display_name\n read_attribute :name\n end", "def getName; @name; end", "def name \r\n @my_name \r\n end", "def get_name\n return \"Irene\"\nend", "def name\n read_attribute(:name)\n end", "def name\n @name\n end", "def last_name\n return person.last_name\n end", "def name() return @name end", "def name() return @name end", "def name; @names.first; end", "def name \n @name\n end", "def name \n @name\n end", "def name\n @name \n end", "def name\n @name\nend", "def first_name\n # return person's first name\n return @first_name\n end", "def get_first_name(person)\n first_name = person[:first_name]\n first_name\nend", "def get_name\r\n self.name\r\n end", "def name\n@name\nend", "def get_nombre # la convencion de ruby es def nombre\n @nombre # el nombre es implicito\n end", "def name\n self[:first_name] + \" \" + self[:last_name]\n end", "def name \n @name\n end", "def name \n @name\n end", "def name\n full_name\n end", "def name\n @name||=data.name\n end", "def get_name\n # The last sentence in a function is always returned so no need to mention return\n @name\n end", "def name\n name = PersonName.where(person_id: patient.id)\\\n .order(:date_created)\\\n .first\n\n given_name = na\n\n \"#{name.given_name} #{name.family_name}\"\n end", "def formal_firstname\n read_attribute :firstname\n end", "def full_name(person)\n name = person[\"first_name\"] + \" \" + person[\"last_name\"]\n return name\nend", "def name\n data.name\n end", "def name\n return @name\n end", "def name\n return @name\n end", "def name\n read_attribute(:name).try(:titleize)\n end" ]
[ "0.7642878", "0.7585027", "0.736689", "0.7025312", "0.69717634", "0.69717634", "0.69717634", "0.69717634", "0.69607306", "0.69304323", "0.691972", "0.6883458", "0.6841571", "0.6814168", "0.6791215", "0.6791215", "0.6763607", "0.6752909", "0.6725936", "0.6725936", "0.6702952", "0.6684561", "0.6684561", "0.6684561", "0.66267586", "0.66267586", "0.6619666", "0.65935636", "0.6569526", "0.6559715", "0.6557187", "0.65530133", "0.6539935", "0.6539935", "0.6538526", "0.65377545", "0.65377545", "0.65345484", "0.653108", "0.65105915", "0.65056497", "0.6498262", "0.6488769", "0.6480494", "0.6474065", "0.6470554", "0.6470554", "0.6467138", "0.6465618", "0.64627546", "0.6460522", "0.64530754", "0.6452051", "0.6447625", "0.64307225", "0.64307225", "0.64250547" ]
0.64907753
77
Setter (writer) for the job of the person
def job= (work) @job = work end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def job=(person_job)\n @job = person_job\n end", "def job=(job)\n @job = job\n end", "def job=(job)\n @job = job\n end", "def job=(job_name)\n @job = job_name\n end", "def job=(job_title)\n @job = job_title\n end", "def write_subject\n self.subject ||= self.class.instance_variable_get(\"@job_name\")\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"subject\", @subject)\n writer.write_object_value(\"task\", @task)\n writer.write_object_value(\"taskProcessingresult\", @task_processingresult)\n writer.write_object_value(\"workflow\", @workflow)\n end", "def update(job)\n mass_assign(job)\n self\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"distributeForStudentWork\", @distribute_for_student_work)\n writer.write_object_value(\"resource\", @resource)\n end", "def set_job\n @job = Job.find(params[:id])\n if @job.processing? && S3Store.read(S3Store::OUTPUT_BUCKET, \"#{@job.model_path}.out\")\n @job.solution_path = \"#{@job.model_path}.out\"\n @job.finished!\n @job.save\n end\n @job\n end", "def <<(scrape_job) save scrape_job end", "def set_writer\n @writer = Writer.find(params[:id])\n end", "def set_writer\n @writer = Writer.find(params[:id])\n end", "def writer=(value) # :nodoc:\n raise ArgumentError, \"writer may not be nil\" if value.nil?\n @writer = value.to_sym\n end", "def set_job\n @job = Job.find(params[:job_id])\n end", "def job # this is a getter\n @job\n end", "def set_job\n begin\n @job = current_user.works.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n redirect_to mentor_jobs_path, notice: '접근 권한이 없습니다.'\n rescue NoMethodError\n redirect_to root_path, notice: '멘토 등록은 063-650-1757로 연락 주세요^^'\n end\n end", "def set_information\n update_parameters\n @job = Job.new\n @job.r_script = RScript.find(session[:r_script_id])\n @job.r_script.parameters.each do |parameter|\n @job.job_parameters << JobParameter.new(:parameter_id => parameter.id) unless parameter.kind == 'Dataset'\n end\n if current_user and default_queue = current_user.preferences.find_by_kind('default_queue') then @job.jobs_queue_id = default_queue.value end\n\n respond_to do |format|\n format.html \n format.xml { render :xml => @job }\n end\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"completedDateTime\", @completed_date_time)\n writer.write_object_value(\"progress\", @progress)\n writer.write_enum_value(\"status\", @status)\n writer.write_string_value(\"storageLocation\", @storage_location)\n writer.write_date_time_value(\"submittedDateTime\", @submitted_date_time)\n writer.write_string_value(\"userId\", @user_id)\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_userjob\n @userjob = Userjob.find(params[:id])\n end", "def writer\n @writer\n end", "def set_job\n @job = @company.jobs.find(params[:id])\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"schedule\", @schedule)\n writer.write_object_value(\"schema\", @schema)\n writer.write_object_value(\"status\", @status)\n writer.write_collection_of_object_values(\"synchronizationJobSettings\", @synchronization_job_settings)\n writer.write_string_value(\"templateId\", @template_id)\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def generate_output_of ( job )\n @job = job\n generate_output\n end", "def writer\n :\"#{reader}=\"\n end", "def writer\n :\"#{reader}=\"\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"createdBy\", @created_by)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"tasks\", @tasks)\n end", "def set_job\n @job = Job.find_by_id(params[:id])\n end", "def job_id=(value)\n @job_id = value.to_s\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job_name(*); end", "def writer\n @writer ||= ThreadSettings.current.writer || Kithe.indexable_settings.writer_instance!\n end", "def set_myjob\n @myjob = Myjob.find(params[:id])\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"assignedDateTime\", @assigned_date_time)\n writer.write_string_value(\"assignerUserId\", @assigner_user_id)\n writer.write_enum_value(\"assignmentType\", @assignment_type)\n writer.write_object_value(\"dueDateTime\", @due_date_time)\n writer.write_object_value(\"notes\", @notes)\n end", "def set_job\n @job = current_user.jobs.find(params[:id]) if current_user\n @job = Job.find(params[:id])\n end", "def writer; end", "def copies_per_job=(value)\n @copies_per_job = value\n end", "def update_job job\n job.check_number = '0' if job.check_number.blank?\n job.pages_from = 1\n job.payer = Payer.find_by_payer(\"No Payer\")\n return job\n end", "def update_job job\n job.check_number = '0' if job.check_number.blank?\n job.pages_from = 1\n job.payer = Payer.find_by_payer(\"No Payer\")\n return job\n end", "def set_job\n @job = Admin.find(params[:id])\n end", "def update!(**args)\n @job = args[:job] if args.key?(:job)\n end", "def update!(**args)\n @job = args[:job] if args.key?(:job)\n end", "def job_assign(email, subject, job)\n @job = job\n @member = DailyMember.find(job.daily_member_id) unless job.daily_member_id.nil?\n mail(to: email, subject: subject)\n end", "def set_job\n @job = @company.jobs.find(params[:id])\n end", "def save\n now = Time.now\n\n data = {\n :id => @id,\n :desc => @desc,\n :ctime => Timestamp.dump(@ctime) || Timestamp.dump(now),\n :mtime => Timestamp.dump(now),\n :ppg_filename => @ppg_filename,\n }\n jobinfo.write(YAML.dump(data))\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"approvalId\", @approval_id)\n writer.write_date_time_value(\"completedDateTime\", @completed_date_time)\n writer.write_object_value(\"createdBy\", @created_by)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"customData\", @custom_data)\n writer.write_string_value(\"status\", @status)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"draftTimeOff\", @draft_time_off)\n writer.write_object_value(\"sharedTimeOff\", @shared_time_off)\n writer.write_string_value(\"userId\", @user_id)\n end", "def set_job\n if current_user\n @job = Job.includes(submissions: :stage_transitions).find(params[:id])\n @submissions = JSON.parse(@job.submissions.to_json(include: [:stage_transitions]))\n @submitted_candidates = @job.submissions.pluck(:person_id)\n @person_id = Person.find_by(email_address: current_user&.email).try(:id)\n end\n @job = Job.find_by(id: params[:id])\n end", "def update\n @job.modifier = current_user\n respond_to do |format|\n if @job.update(job_params)\n format.html { redirect_to @job, notice: 'Job was successfully updated.' }\n format.json { render :show, status: :ok, location: @job }\n else\n format.html { render :edit }\n format.json { render json: @job.errors, status: :unprocessable_entity }\n end\n end\n end", "def writer(*args)\n attr_writer(*args)\n args\n end", "def mark_as_done # a writer, i overwrote the one by default\n @done = true\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"assignedTo\", @assigned_to)\n writer.write_string_value(\"managerActionMessage\", @manager_action_message)\n writer.write_string_value(\"senderMessage\", @sender_message)\n writer.write_enum_value(\"state\", @state)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"assignedTo\", @assigned_to)\n writer.write_date_time_value(\"closedDateTime\", @closed_date_time)\n writer.write_object_value(\"createdBy\", @created_by)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_object_value(\"dataSubject\", @data_subject)\n writer.write_enum_value(\"dataSubjectType\", @data_subject_type)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"history\", @history)\n writer.write_object_value(\"insight\", @insight)\n writer.write_date_time_value(\"internalDueDateTime\", @internal_due_date_time)\n writer.write_object_value(\"lastModifiedBy\", @last_modified_by)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_collection_of_object_values(\"notes\", @notes)\n writer.write_collection_of_primitive_values(\"regulations\", @regulations)\n writer.write_collection_of_object_values(\"stages\", @stages)\n writer.write_enum_value(\"status\", @status)\n writer.write_object_value(\"team\", @team)\n writer.write_enum_value(\"type\", @type)\n end", "def jid=(jid)\n attributes[:jid] = jid\n end", "def job_uuid=(uuid)\n @raw_data[:job] ||= {}\n @raw_data[:job].update(uuid: uuid)\n end", "def construction_method\n :writer\n end", "def job \n @job\n end" ]
[ "0.75722456", "0.6977642", "0.6971576", "0.6968285", "0.6562866", "0.6288532", "0.61274505", "0.58658063", "0.580209", "0.57968163", "0.5796787", "0.57782245", "0.57782245", "0.57683635", "0.5756003", "0.57535094", "0.57321936", "0.57262135", "0.5723125", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5715939", "0.5706175", "0.5676693", "0.5672699", "0.56613904", "0.5660045", "0.56576353", "0.56530744", "0.56334645", "0.56334645", "0.5612987", "0.5609846", "0.5603677", "0.56013495", "0.56013495", "0.56013495", "0.5600739", "0.55979186", "0.55885947", "0.5585925", "0.5570617", "0.55557466", "0.5550499", "0.5543136", "0.5543136", "0.55284727", "0.5524286", "0.5524286", "0.551218", "0.54862505", "0.5470682", "0.5458648", "0.5453501", "0.5451396", "0.54377395", "0.5416716", "0.5402913", "0.540026", "0.5388548", "0.53751665", "0.5371675", "0.5366104", "0.5363321" ]
0.67599744
4
Getter (reader) for the job of the person
def job @job end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def job # this is a getter\n @job\n end", "def job\n @job\n end", "def job\n @job\n end", "def job \n @job\n end", "def job=(person_job)\n @job = person_job\n end", "def job\n fetch('games.final_fantasy_xiv.jobs')\n end", "def job_resource(job)\n if job['wrapped']\n job['wrapped']\n else\n job['class']\n end\n end", "def job\n job_uuid && Jobber::Job::Base.find_job(job_uuid)\n end", "def job\n post_types.where(slug: 'job').first.try(:posts)\n end", "def fetch_job\n @job = Job.find(params.require(:id))\n end", "def find_job\n @job = Job.find(params[:job_id])\n end", "def job=(job)\n @job = job\n end", "def job_get(organization, jobid)\n uri = server_uri(\"/organizations/#{organization}/jobs/#{jobid}\")\n res_data = api_get(uri)\n @logger.debug res_data\n\n return res_data\n end", "def job=(job)\n @job = job\n end", "def load_job\n @job = Job.find(params[:job_id])\n end", "def get_job(id)\n conn = @client.get do |req|\n req.url \"/api/v2/job/#{id}\"\n req.headers[\"Authorization\"] = @token\n end\n conn.body\n end", "def populate_by_job(job=self.job)\n self.estimator = job.estimator\n self.csr = job.csr\n self.quoter = job.quoter\n self.contact = job.contact\n end", "def find_job(job_id)\n response = HTTParty.get(\"#{@host}/api/jobs/#{job_id}\")\n\n return response['job']\n end", "def job=(job_name)\n @job = job_name\n end", "def get( name )\n @jobs.each { |job| return job if job[:name] == name }\n nil\n end", "def job_parser\n @job_parser || Job\n end", "def current_job\n return @job_current\n end", "def get_job (job_id)\n\n @cron_jobs[job_id] || @non_cron_jobs[job_id]\n end", "def get(jid)\n results = @client.call('get', jid)\n Job.new(@client, JSON.parse(results)) unless results.nil?\n end", "def job\n\t\tjid = @db.hget('sgt-unit:'+@id, 'job')\n\t\treturn nil if jid == nil\n\t\tgetJob(@db, jid)\n\tend", "def to_job\n job = Patriot::JobStore::Job.new(self.job_id)\n job.read_command(self)\n return job\n end", "def job(id, options = {})\n objectify get(\"/job/#{id}\", options)['joblist']['job']\n end", "def getJob(db, jid)\n\tjob = JobAbstract.new(db, jid)\n\ttype = job.type\n\t\n\t#if type == 'build'\n\t#\treturn JobBuild.new(db, jid)\n\t#end\n\t\n\tjob\nend", "def job_id\n @gapi.job_reference.job_id\n end", "def fetch_job\n JSON.parse(RestClient.get(url).body)\n end", "def get_job(job, ds = nil)\n (jobs_to_run + jobs_running).find do |j|\n if ds.nil?\n j[:ds].nil? and j[:job] == job\n else\n (! j[:ds].nil?) and j[:ds].name == ds.name and j[:job] == job\n end\n end\n end", "def show\n @job = Job.find(params[:id])\n end", "def show\n @job = Job.find(params[:id])\n end", "def job(job_name)\n jobs job_name\n end", "def get_job job_id, location: nil\n # The get operation is considered idempotent\n execute backoff: true do\n service.get_job @project, job_id, location: location\n end\n end", "def job\n job_name.constantize.new({\n :context => self\n })\n end", "def get_job\n begin\n s, sproc, clazz = selector\n # Take the job from TS using the job selector\n job = take s, 0, false\n\n # Remove job from envelope\n sproc_meth = sproc.respond_to?(:process) ? :process : :call\n job = sproc.send sproc_meth, job\n\n yield job['job']\n rescue Rinda::RequestExpiredError => e\n # This happens when the lookup expires, it's an OK exception\n # TODO use wait time in take?\n sleep @job_search_timeout\n end\n end", "def [](key)\n @jobs[key]\n end", "def get_job_id\n # check if the job ID has already been set (the job name will not change\n # during execution, so it is safe to assume that the job ID won't change)\n if not defined? @job_id or @job_id == '' or @job_id == nil\n result = veeamconfig('job', 'list').lines\n if result.length > 1\n result.each_with_index do |line, index|\n # skip the first line of output, since it is just the table setup\n next if index == 0\n\n # split line into array by space\n bits = line.split(' ')\n # pull out the repository name\n job_name = bits[0]\n\n # parse and return the job ID\n @job_id = bits[1].tr('{}', '') if job_name == @resource[:job_name]\n return @job_id\n end\n\n # return false if the job doesn't exist\n false\n else\n # return false if there are no jobs that exist\n false\n end\n else\n # return the job ID if it's already set\n @job_id\n end\n end", "def job_params\n params[:job]\n end", "def get_job(uuid, username, password)\n jobs = get_json('jobs.json', username, password)\n job = jobs['jobs'].find { |j| j['uuid'] == uuid }\n\n if job['jobURL']\n job.merge!(get_json(job['jobURL'], username, password, ''))\n end\n\n fail \"Could not find job with UUID=#{uuid}\" unless job\n job\nend", "def get_single_job_sample(client)\n response = client[\"jobs/#{$job_id}\"].get\n\n p ''\n p 'Get single job'\n p response\nend", "def job\n return nil if self.job_id.nil?\n Delayed::Job.find(self.job_id)\n end", "def job(job,params={})\n if (@job[extract_job(job)] && !params[:force])\n return @job[extract_job(job)]\n end\n @job[extract_job(job)] = get_job(job)\n end", "def job\n operation_ids = operations.map(&:id)\n ja_ids = JobAssociation.where(operation_id: operation_ids).map(&:job_id).uniq\n jobs = Job.find(ja_ids).select(&:active?)\n raise ProtocolError, 'Cannot resolve the current Job' if jobs.length > 1\n\n jobs.last\n end", "def show\n @job = Job.find(params[:id])\n @company = Company.find(@job.company_id)\n end", "def data\n @github.jobs[0..3] + @stackoverflow.jobs[0..3] + @acuk.jobs[0..3]\n end", "def job_id\n raise NotImplementedError\n end", "def job_type_name\r\n job_type.job_name rescue nil\r\n end", "def set_job\n @job = @company.jobs.find(params[:id])\n end", "def job\n JenkinsApi::Client::Job.new(self)\n end", "def job\n JenkinsApi::Client::Job.new(self)\n end", "def set_job\n @job = @company.jobs.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def get_job(job_id)\n client = IotHubApiClient.new(@options)\n res = client.get(jobs_path(job_id), @api_version_param)\n JobResponse.new(response_json(res))\n end", "def job\r\n @profile[:gear].soul_crystal.name.gsub(\"Soul of the \", \"\").delete!(\"\\n\\t\")\r\n end", "def show_job_details(job)\n @scraper.scrape_details(job)\n job.print_info\n job\n end", "def show\n @job_id = @part.job.id\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def job=(job_title)\n @job = job_title\n end", "def show\n @user = User.find(params[:id])\n @jobs = @user.jobs\n end", "def reader_name\n self[:reader_name].read_string\n end", "def find_job(job_id)\n find_users.each do |user|\n user.find_jobs.each do |job|\n return job if job.id == job_id\n end\n end\n\n return nil\n end", "def job= (work)\n @job = work\n end", "def job_id\n async && async.job_id\n end", "def show\n @job = @user.jobs.find_by_id!(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @job }\n end\n end", "def get_job_status(job)\n status = nil\n if job.present?\n if job.is_a?(Hash)\n job = job.stringify_keys\n actor = @registered_jobs[job['id']]\n status = actor.status\n else\n actor = @registered_jobs[job.to_i]\n status = actor.status\n end\n end\n status\n end", "def get_job\n jobs = Job.all.map {|job| job.name}\n input = PROMPT.select(\"Choose your job:\", jobs)\n chosen_job = Job.find_by(name: input)\n return chosen_job\nend", "def set_job\n if current_user\n @job = Job.includes(submissions: :stage_transitions).find(params[:id])\n @submissions = JSON.parse(@job.submissions.to_json(include: [:stage_transitions]))\n @submitted_candidates = @job.submissions.pluck(:person_id)\n @person_id = Person.find_by(email_address: current_user&.email).try(:id)\n end\n @job = Job.find_by(id: params[:id])\n end", "def access_current_job\n if job = @job\n yield job\n end\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end", "def set_job\n @job = Job.find(params[:id])\n end" ]
[ "0.7379256", "0.68132335", "0.68132335", "0.6462181", "0.6274558", "0.62360686", "0.62170976", "0.60695523", "0.60430247", "0.6016825", "0.59843475", "0.594709", "0.59391296", "0.59321153", "0.5923242", "0.5911251", "0.5880522", "0.58699405", "0.585709", "0.5849762", "0.5821462", "0.58146435", "0.5805783", "0.5805174", "0.5759845", "0.57585335", "0.57484895", "0.57441133", "0.57142836", "0.5713626", "0.5712897", "0.57094604", "0.57094604", "0.56948423", "0.5670897", "0.5650177", "0.5644096", "0.564322", "0.5621665", "0.5592657", "0.55919814", "0.55856454", "0.5585013", "0.5579686", "0.556964", "0.5555059", "0.5538363", "0.5534705", "0.5528498", "0.55106866", "0.55103254", "0.55103254", "0.5506323", "0.5485236", "0.5485236", "0.5485236", "0.5480688", "0.54745996", "0.54673535", "0.5446998", "0.5444355", "0.5433118", "0.5430884", "0.54287255", "0.54274017", "0.5401754", "0.5387414", "0.53841347", "0.53663677", "0.53483033", "0.5345216", "0.5345088", "0.53376174", "0.53376174", "0.53376174", "0.53376174", "0.53376174", "0.53376174", "0.53376174", "0.53376174", "0.53376174", "0.53376174", "0.53376174", "0.53376174", "0.53376174", "0.53376174", "0.53376174", "0.53376174", "0.53376174", "0.53376174", "0.53376174", "0.53376174", "0.53376174", "0.53376174", "0.53376174", "0.53376174", "0.53376174", "0.53376174", "0.53376174", "0.53376174" ]
0.68591297
1
A strict Java 8 requirement (1.8) should prompt the user to install an OpenJDK 1.8 distribution. Versions newer than Java 8 are not completely backwards compatible, and contain breaking changes such as strong encapsulation of JDKinternal APIs and a modified version scheme (.0 not 1.).
def suggestion if fits_latest? JAVA_SUGGESTION_MAP.fetch(JAVA_SUGGESTION_MAP.keys.max) else JAVA_SUGGESTION_MAP.fetch("1.8") end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def java_8_or_later?\n @version >= VERSION8\n end", "def required_ruby_version\n spec.required_ruby_version || Gem::Requirement.default\n end", "def required_ruby_version=(req)\n @required_ruby_version = Gem::Requirement.create req\n end", "def platform_require\n fail NotImplementedError,\n 'Abstract method must returns `Gem::Requirement`'\n end", "def required_ruby_version\n spec.required_ruby_version\n end", "def required_rubygems_version\n spec.required_rubygems_version\n end", "def requirement\n \"~> #{major}\"\n end", "def version_gte_8?\n version >= v80\n end", "def major_version\n '1.8'\n end", "def required_rubygems_version\n spec.required_rubygems_version || Gem::Requirement.default\n end", "def require_version(name, current, required)\n print \"Checking for #{name} >= #{required}... \"\n\n if version_greater_than(current, required)\n puts 'yes'\n else\n abort 'no'\n end\n end", "def has_java_version?(ver)\n java_version.start_with? \"1.#{ver}\"\n end", "def test_method_prereleasep\n value_ = ::Versionomy.create([1, 9, 2, 'a', 2], :rubygems)\n assert_equal(true, value_.prerelease?)\n value_ = ::Versionomy.create([1, 9, 2, 2], :rubygems)\n assert_equal(false, value_.prerelease?)\n end", "def requirement\n Gem::Requirement.new('~>' + pharos_version.segments.first(2).join('.') + (pharos_version.prerelease? ? '.0-a' : '.0'))\n end", "def install_jdk\n release = find_openjdk(@configuration)\n uri = release['binaries'][0]['package']['link']\n @version = release['release_name']\n download_start_time = Time.now\n\n print \"-----> Downloading OpenJDK #{@version} from #{uri} \"\n\n LibertyBuildpack::Util::Cache::ApplicationCache.new.get(uri) do |file| # TODO: Use global cache\n puts \"(#{(Time.now - download_start_time).duration})\"\n expand file\n end\n end", "def prefer_indep_over_os_packages?; @prefer_indep_over_os_packages end", "def ruby21!\n require_ruby_version \"~> 2.1\"\n end", "def version_constraint(gem_name); end", "def restrictive_version_specified_gem?(node); end", "def check_required_features\n unless Puppet.features.yard?\n raise RuntimeError, \"The 'yard' gem must be installed in order to use this face.\"\n end\n\n unless Puppet.features.rgen?\n raise RuntimeError, \"The 'rgen' gem must be installed in order to use this face.\"\n end\n\n if RUBY_VERSION.match(/^1\\.8/)\n raise RuntimeError, \"This face requires Ruby 1.9 or greater.\"\n end\n end", "def required_rubygems_version=(req)\n @required_rubygems_version = Gem::Requirement.create req\n end", "def pour_bottle?\n quiet_system(\"/usr/libexec/java_home --version 1.8 --failfast\")\n end", "def need_inspec_core_bin?(gem_version)\n return true if gem_version.nil? # latest version\n Gem::Requirement.new('>= 4').satisfied_by?(Gem::Version.new(gem_version))\n end", "def supported_pkgs\n {\"rpm\"=>1, \"deb\"=>1}\nend", "def kex_byte_requirement; end", "def required_version\n fetch(:chef_version) || nil\n end", "def satisfied_by?(req_vers, new_vers)\n req = LibGems::Requirement.new(req_vers)\n req_vers.sub(/^= /,'') == new_vers.sub(/^= /,'') ||\n req.satisfied_by?(LibGems::Version.new(new_vers))\n end", "def require_ruby_version *versions\n spec_extras[:required_ruby_version] = versions\n end", "def test_prerelease?(_)\n false\n end", "def install\n bin.install \"java-switcher\"\n end", "def ensure_rbenv_ruby(ruby_version)\n ensure_rbenv\n ensure_packages \"curl\", \"build-essential\", \"libxslt1-dev\", \"libxml2-dev\", \"libssl-dev\"\n\n dep \"rbenv ruby: #{ruby_version}\" do\n met? { `bash -lc 'which ruby'`.include?(\"rbenv\") && `rbenv versions`.include?(ruby_version) }\n meet do\n puts \"Compiling Ruby will take a few minutes.\"\n shell \"rbenv install #{ruby_version}\"\n shell \"rbenv rehash\"\n end\n end\n end", "def install_dependencies\n raise 'Not implemented'\n end", "def rhel8?(node = __getnode)\n node[\"platform_family\"] == \"rhel\" && node[\"platform_version\"].to_f >= 8.0 && node[\"platform_version\"].to_f < 9.0\n end", "def test_method_prereleasep\n value_ = ::Versionomy.create([1, 9, 2, 'a2'], :semver)\n assert_equal(true, value_.prerelease?)\n value_ = ::Versionomy.create([1, 9, 2], :semver)\n assert_equal(false, value_.prerelease?)\n end", "def pre_0_12?\n VersionRequirement.new('< 0.12.0-alpha').satisfied_by?(version)\n end", "def version_less_than_seventeen?\n verify_gem_version(celluloid_version, '0.17', operator: '<')\n end", "def install\n case distro\n when RHEL\n dist_install( \"java-1.#{jdk_major_minor}.0-openjdk\",\n \"java-1.#{jdk_major_minor}.0-openjdk-devel\" )\n when Debian\n if jdk_major_minor >= 8 &&\n distro.is_a?( Ubuntu ) &&\n version_gte?( distro.ubuntu_version, [16,4] )\n # FIXME: This jdk-headless package option may be(come)\n # available on upstream Debian as well.\n dist_install( \"openjdk-#{jdk_major_minor}-jdk-headless\" )\n else\n dist_install( \"openjdk-#{jdk_major_minor}-jdk\" )\n end\n when Arch\n dist_install( \"jdk#{jdk_major_minor}-openjdk\" )\n else\n raise ContextError, \"Unknown distro type\"\n end\n end", "def confirm_or_prompt_for_system_requirements\n generate_generatable_options\n validate_root_dns_maps_to_core_ip\n ensure_security_group_prepared\n validate_compute_flavor(core_server_flavor)\n admin_emails\n confirm_or_upload_release\n confirm_or_upload_stemcell\n end", "def all_required_packages(selection, with_rock_release_prefix = false)\n raise RuntimeError, \"#{self.class} needs to overwrite all_required_packages\"\n end", "def install_ruby\n # remove the bootstrap version of ruby to install the best available one.\n remove_packages %w(ruby ruby1.8 ruby1.9.1 ruby2.0)\n install_ruby_20 || install_ruby_19\n end", "def install\n should = @resource.should(:ensure)\n self.debug \"Ensuring => #{should}\"\n wanted = @resource[:name]\n\n # XXX: We don't actually deal with epochs here.\n case should\n when true, false, Symbol\n # pass\n else\n # Add the package version\n wanted = \"#{wanted}-#{should}\"\n end\n\n #This has been tested with following zypper versions\n #SLE 10.2: 0.6.104\n #SLE 11.0: 1.0.8\n #OpenSuse 10.2: 0.6.13\n #OpenSuse 11.2: 1.2.8\n #Assume that this will work on newer zypper versions\n\n #extract version numbers and convert to integers\n major, minor, patch = zypper_version.scan(/\\d+/).map{ |x| x.to_i }\n self.debug \"Detected zypper version #{major}.#{minor}.#{patch}\"\n\n #zypper version < 1.0 does not support --quiet flag\n quiet = \"--quiet\"\n if major < 1\n quiet = \"--terse\"\n end\n\n license = \"--auto-agree-with-licenses\"\n noconfirm = \"--no-confirm\"\n\n #zypper 0.6.13 (OpenSuSE 10.2) does not support auto agree with licenses\n if major < 1 and minor <= 6 and patch <= 13\n zypper quiet, :install, noconfirm, wanted\n else\n zypper quiet, :install, license, noconfirm, wanted\n end\n\n unless self.query\n raise Puppet::ExecutionFailure.new(\n \"Could not find package #{self.name}\"\n )\n end\n end", "def version_requirement_satisfied?(current_version, new_version)\n target_version_already_installed?(current_version, new_version)\n end", "def yosemite_or_newer?\n Gem::Version.new(`sw_vers -productVersion`) >= Gem::Version.new('10.10')\nend", "def test_standard_to_rubygems_inequality_comparison\n assert_operator(::Versionomy.parse('1.2.4'), :>, ::Versionomy.parse('1.2.3', :rubygems))\n assert_operator(::Versionomy.parse('1.2b2'), :<, ::Versionomy.parse('1.2.beta.3', :rubygems))\n assert_operator(::Versionomy.parse('1.2b2'), :<, ::Versionomy.parse('1.2', :rubygems))\n end", "def installed_version\n raise NotImplementedError\n end", "def installChefdk(distro,version,exit)\n if exit == 1 then\n puts version\n `wget https://packages.chef.io/files/stable/chefdk/3.8.14/#{distro}/#{version}/chefdk_3.8.14-1_amd64.deb -O ~/chefdk.deb`\n `sudo dpkg -i ~/chefdk.deb`\n return true\n else\n return true\n end\nend", "def test_prerelease?(version)\n !@version.stable? && @version.major == version.major && @version.minor == version.minor && @version.patch == version.patch\n end", "def requires_version(cmd, version_)\n v = check_version(version_)\n unless v[0]\n raise NoMethodError, format('%s is not supported in Bugzilla %s', cmd, v[1])\n end\n end", "def ruby20!\n require_ruby_version \"~> 2.0\"\n end", "def version_supported?\n\tKitchenplan::Log.debug \"#{self.class} : Is platform version lower than #{@lowest_version_supported}?\"\n\treturn false if self.version.to_s < @lowest_version_supported\n\ttrue\n end", "def version_supported?\n\tKitchenplan::Log.debug \"#{self.class} : Is platform version lower than #{@lowest_version_supported}?\"\n\treturn false if self.version.to_s < @lowest_version_supported\n\ttrue\n end", "def version_supported?\n\tKitchenplan::Log.debug \"#{self.class} : Is platform version lower than #{@lowest_version_supported}?\"\n\treturn false if self.version.to_s < @lowest_version_supported\n\ttrue\n end", "def ruby23!\n require_ruby_version \"~> 2.3\"\n end", "def ruby22!\n require_ruby_version \"~> 2.2\"\n end", "def java_9_or_later?\n @version >= VERSION9\n end", "def install_sol11_pkg(options,pkg_name)\n pkg_test = %x[which #{pkg_name}]\n if pkg_test.match(/no #{pkg_name}/)\n message = \"Information:\\tChecking Package \"+pkg_name+\" is installed\"\n command = \"pkg info #{pkg_name} 2>&1| grep \\\"Name:\\\" |awk \\\"{print \\\\\\$3}\\\"\"\n output = execute_command(options,message,command)\n if not output.match(/#{pkg_name}/)\n message = \"Information:\\tChecking publisher is online\"\n command = \"pkg publisher | grep online\"\n output = execute_command(options,message,command)\n if output.match(/online/)\n message = \"Information:\\tInstalling Package \"+pkg_name\n command = \"pkg install #{pkg_name}\"\n execute_command(options,message,command)\n end\n end\n end\n return\nend", "def pe_version_check(master, min_version, action=:skip)\n assert_message = \"This test requires PE #{min_version} or above!\"\n\n if get_pe_version(master) < min_version\n if action == :skip\n skip_test(assert_message)\n elsif action == :fail\n fail_test(assert_message)\n end\n end\nend", "def check_for_requirements; end", "def bump_major_version; end", "def get_java_ospkg_name (platform, version, type)\n pfx = \"#{platform.downcase == 'rhel' ? \"java-1.#{version}.0-\" :''}\"\n case platform.downcase\n when 'rhel'\n sfx = (type.downcase == 'jre' ? '' :'-devel')\n else\n sfx = \"-#{version}-\".concat(type.downcase == 'jre' ? 'jre' :'jdk')\n end\n \"#{pfx}openjdk#{sfx}\"\n end", "def gem_available?(name)\n Gem::Specification.find_by_name(name)\nrescue Gem::LoadError\n puts \"[*] - esearchy requires #{name}.\"\n if RUBY_PLATFORM =~ /mingw|mswin/\n \tsystem \"gem install #{name}\"\n else\n \tsystem \"sudo gem install #{name}\"\n end\nend", "def require_rubygems_version *versions\n spec_extras[:required_rubygems_version] = versions\n end", "def updated_gemfile_requirement(req)\n return req unless latest_resolvable_version\n return req if existing_version && no_change_in_version?\n return req if !existing_version && new_version_satisfies?(req)\n\n requirements =\n req[:requirement].split(\",\").map { |r| Gem::Requirement.new(r) }\n\n new_req =\n if requirements.any?(&:exact?)\n \"= #{latest_resolvable_version}\"\n elsif requirements.any? { |r| r.to_s.start_with?(\"~>\") }\n tw_req = requirements.find { |r| r.to_s.start_with?(\"~>\") }\n update_twiddle_version(tw_req, latest_resolvable_version).to_s\n else\n update_gemfile_range(requirements).map(&:to_s).join(\", \")\n end\n\n req.merge(requirement: new_req)\n end", "def check_requirement(requirement)\n if paths_for_extconf = Creosote::Package.installed(requirement, :default_only => true)\n puts \"requirement #{requirement} is already installed at #{paths_for_extconf.inspect}.\"\n paths_for_extconf = [paths_for_extconf].flatten\n add_extconf_args_for requirement, paths_for_extconf\n else\n puts \"requirement #{requirement} is not yet installed. Installing...\"\n paths_for_extconf = Creosote::Package.install(requirement, :default => true)\n paths_for_extconf = [paths_for_extconf].flatten\n add_extconf_args_for requirement, paths_for_extconf\n end\n end", "def major_upgrade?(to)\n nil unless installed?\n major_version(installed_version?) != major_version(to)\n end", "def update_greatest_version(requirement, version_to_be_permitted)\n if version_to_be_permitted.is_a?(String)\n version_to_be_permitted =\n Gem::Version.new(version_to_be_permitted)\n end\n op, version = requirement.requirements.first\n version = version.release if version.prerelease?\n\n index_to_update =\n version.segments.map.with_index { |seg, i| seg.zero? ? 0 : i }.max\n\n new_segments = version.segments.map.with_index do |_, index|\n if index < index_to_update\n version_to_be_permitted.segments[index]\n elsif index == index_to_update\n version_to_be_permitted.segments[index] + 1\n else 0\n end\n end\n\n Gem::Requirement.new(\"#{op} #{new_segments.join('.')}\")\n end", "def running_jruby_1_7_or_later\n RUBY_PLATFORM == 'java' && !JRUBY_VERSION.match(/[0-1]\\.[0-6]/)\nend", "def java_10_or_later?\n @version >= VERSION10\n end", "def is_1_9_or_later?\n \"1.9\".respond_to?(:encoding)\n end", "def bump_minor_version; end", "def get_version_req(dep)\n req = get_key_or_sym(dep, :version_requirement)\n req ||= get_key_or_sym(dep, :version_range)\n req\n end", "def install_ruby_dependencies(rubie)\n pkgs = []\n case rubie\n when /^ruby-/, /^ree-/, /^rbx-/, /^kiji/\n case node['platform']\n when \"debian\",\"ubuntu\"\n pkgs = %w{ build-essential openssl libreadline6 libreadline6-dev\n zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev\n sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev\n ncurses-dev automake libtool bison ssl-cert }\n pkgs += %w{ subversion } if rubie =~ /^ruby-head$/\n when \"suse\"\n pkgs = %w{ gcc-c++ patch zlib zlib-devel libffi-devel\n sqlite3-devel libxml2-devel libxslt-devel }\n if node['platform_version'].to_f >= 11.0\n pkgs += %w{ libreadline5 readline-devel libopenssl-devel }\n else\n pkgs += %w{ readline readline-devel openssl-devel }\n end\n pkgs += %w{ git subversion autoconf } if rubie =~ /^ruby-head$/\n when \"centos\",\"redhat\",\"fedora\",\"scientific\",\"amazon\"\n pkgs = %w{ gcc-c++ patch readline readline-devel zlib zlib-devel\n libyaml-devel libffi-devel openssl-devel }\n pkgs += %w{ git subversion autoconf } if rubie =~ /^ruby-head$/\n end\n when /^jruby-/\n # TODO: need to figure out how to pull in java recipe only when needed. For\n # now, users of jruby will have to add the \"java\" recipe to their run_list.\n #include_recipe \"java\"\n case node['platform']\n when \"debian\",\"ubuntu\"\n pkgs += %w{ g++ ant }\n end\n end\n\n pkgs.each do |pkg|\n package pkg do\n action :nothing\n end.run_action(:install)\n end\nend", "def requires_auto_minor_engine_version_upgrade\n data.requires_auto_minor_engine_version_upgrade\n end", "def prepare_for_installation; end", "def valid_gemspec?; end", "def debian_version\n super ||\n ( version_gte?( ubuntu_version, [18,4] ) && '10' ) ||\n ( version_gte?( ubuntu_version, [15,4] ) && '8' ) ||\n ( version_gte?( ubuntu_version, [14,4] ) && '7' ) ||\n ( version_gte?( ubuntu_version, [12,4] ) && '6' )\n end", "def needs_syck?\n !LanguageSupport.using_engine?('jruby') &&\n LanguageSupport.using_version?('1.9.2')\n end", "def prerelease?\n @prerelease || requirement.prerelease?\n end", "def update_twiddle_version(requirement, version_to_be_permitted)\n old_version = requirement.requirements.first.last\n updated_v = at_same_precision(version_to_be_permitted, old_version)\n Gem::Requirement.new(\"~> #{updated_v}\")\n end", "def latest_version?\n @requirement.none?\n end", "def latest_version?\n @requirement.none?\n end", "def version_available?(package_name, desired_version, arch = nil)\n version(package_name, arch, true, false) do |v|\n return true if desired_version == v\n end\n\n false\n end", "def if_true(condition)\r\n if condition\r\n yield\r\n else\r\n # When not including the gems, we still want our Gemfile.lock\r\n # to include them, so we scope them to an unsupported platform.\r\n platform :ruby_18, &proc\r\n end\r\nend", "def min_licensing_version\n nil\n end", "def min_licensing_version\n nil\n end", "def installable_platform?\n Gem::Platform.match_spec? spec\n end", "def pd_version_satisfies?(*constraints)\n pd_version = Gem::Version.new(@driver.version)\n Gem::Requirement.new(*constraints).satisfied_by?(pd_version)\n end", "def test_rubygems_to_standard_inequality_comparison\n assert_operator(::Versionomy.parse('1.2.3', :rubygems), :<, ::Versionomy.parse('1.2.4'))\n assert_operator(::Versionomy.parse('1.2.b.3', :rubygems), :>, ::Versionomy.parse('1.2b2'))\n assert_operator(::Versionomy.parse('1.2', :rubygems), :>, ::Versionomy.parse('1.2b1'))\n end", "def version_less_than_eigthteen?\n verify_gem_version(celluloid_version, '0.18', operator: '<')\n end", "def install_package(target_package_path); raise NotImplementedError; end", "def version_specified_gem?(node); end", "def install(packagename, force=false)\n\t\t\t\traise(InstallError, \"Automated package installation is not implemented on OpenBSD\")\n\t\t\tend", "def check_osx_ips(options)\n python_bin = \"/usr/bin/python\"\n pip_bin = \"/usr/bin/pip\"\n setup_url = \"https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py\"\n if not File.symlink?(pip_bin)\n message = \"Information:\\tInstalling Pip\"\n command = \"/usr/bin/easy_install --prefix=/usr pip\"\n execute_command(options,message,command)\n message = \"Information:\\tUpdating Setuptools\"\n command = \"wget #{setup_url} -O |sudo #{python_bin}\"\n execute_command(options,message,command)\n ['simplejson\",\"coverage\",\"pyOpenSSL\",\"mercurial'].each do |module_name|\n message = \"information:\\tInstalling Python module \"+module_name\n command = \"#{pip_bin} install #{module_name}\"\n execute_command(options,message,command)\n end\n end\n python_ver = %x[#{python_bin} --version |awk '{print $2}']\n python_ver = python_ver.chomp.split(/\\./)[0..1].join(\".\")\n module_dir = \"/usr/local/lin/python\"+python_ver+\"/site-packages\"\n pkg_dest_dir = module_dir+\"/pkg\"\n check_dir_exists(options,pkg_dest_dir)\n hg_bin = \"/usr/local/bin/hg\"\n if not File.exist?(hg_bin)\n message = \"Information:\\tInstalling Mercurial\"\n command = \"brew install mercurial\"\n execute_command(options,message,command)\n end\n pkgrepo_bin = \"/usr/local/bin/pkgrepo\"\n if not File.exist?(pkgrepo_bin)\n ips_url = \"https://hg.java.net/hg/ips~pkg-gate\"\n message = \"Information:\\tDownloading IPS source code\"\n command = \"cd #{options['workdir']} ; hg clone #{ips_url} ips\"\n execute_command(options,message,command)\n end\n return\nend", "def compatible?\n available? && Gem::Version.new(RUBY_VERSION) >= Gem::Version.new(VERSION::MINIMUM_RUBY_VERSION)\n end", "def version_required(gem_def)\n return Gem::Dependency.instance_methods.map(&:to_sym).include?(:requirement) ? gem_def.requirement : gem_def.version_requirements\nend", "def has_version?; end", "def test_bad_jruby_deps\n check_deps_fail \"notapackage\" => :jruby if which('jruby')\n end", "def test_bad_jruby_deps\n check_deps_fail \"notapackage\" => :jruby if which('jruby')\n end", "def supported_versions\n raise NotImplementedError\n end", "def install_gem; end", "def valid_for_platform?; true; end" ]
[ "0.6014146", "0.58819664", "0.573308", "0.5730352", "0.57230943", "0.5674882", "0.56210905", "0.5617931", "0.55993146", "0.5578023", "0.55430055", "0.55418116", "0.5535801", "0.55250776", "0.5522423", "0.5507627", "0.5492896", "0.546494", "0.54272753", "0.540666", "0.5398961", "0.5394427", "0.5365238", "0.53622407", "0.53603876", "0.5356291", "0.5340715", "0.5322981", "0.5318458", "0.5313306", "0.5292475", "0.52882403", "0.5270805", "0.5261823", "0.5260622", "0.5241945", "0.5237653", "0.52235436", "0.5220491", "0.52106583", "0.5208263", "0.5199195", "0.51768464", "0.51729393", "0.5170119", "0.5148046", "0.51387805", "0.51380086", "0.51291734", "0.51221627", "0.51221627", "0.51221627", "0.5105413", "0.5095172", "0.5089287", "0.50850457", "0.5072255", "0.50717473", "0.50572234", "0.50434417", "0.5029329", "0.5027223", "0.50239116", "0.50210726", "0.5015705", "0.50045156", "0.50028515", "0.500253", "0.49958825", "0.49860114", "0.49824664", "0.49750653", "0.49724776", "0.497168", "0.4968403", "0.49682388", "0.49643737", "0.49639872", "0.496326", "0.49621224", "0.49621224", "0.495899", "0.49582553", "0.49564946", "0.49564946", "0.49507204", "0.4941599", "0.49408624", "0.4940032", "0.49263215", "0.49259168", "0.49072438", "0.48925847", "0.48830163", "0.4879935", "0.4872562", "0.48679495", "0.48679495", "0.48671877", "0.48664948", "0.48504668" ]
0.0
-1
before_action to prevent undefined routes from throwing errors
def index if (params[:subcategory_id]) render json: Item.where(subcategory_id: params[:subcategory_id]).as_json(:include => :photos) elsif (params[:category_id]) render json: Item.find_by_category_id(params[:category_id]).as_json(:include => :photos) else render json: Item.search(params).as_json(:include => :photos) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def undefined_route\n routing_error!\n end", "def routing_error\n render_not_found\n end", "def no_routes\n end", "def handle_route_not_found\n raise ActionController::RoutingError.new(params[:path])\n end", "def before_anyway\n set_path\n set_current\n # allows us to extend the definition of non-existence\n raise Sinatra::NotFound unless found?\n end", "def routing_error\n redirect_to \"/404\"\n end", "def not_found\n raise ActionController::RoutingError.new('Not Found')\n end", "def not_found\n raise ActionController::RoutingError.new 'Not Found'\n end", "def not_found\n raise ActionController::RoutingError.new 'Not found'\n end", "def not_found\n raise ActionController::RoutingError, 'Not Found'\n end", "def routing_mismatch\n raise ::ActionController::RoutingError,\"URL not supported\"\n end", "def not_found\n raise ActionController::RoutingError.new('Not Found')\n end", "def not_found\n raise ActionController::RoutingError.new('Not Found')\n end", "def not_found\n raise ActionController::RoutingError.new('Not Found')\n end", "def not_found\n raise ActionController::RoutingError.new('Not Found')\n end", "def not_found\n raise ActionController::RoutingError.new('Not Found')\n end", "def not_found\n raise ActionController::RoutingError.new('Not Found')\n end", "def no_routes\n # no need to do anything here either.\n end", "def require_resource!(resource_name)\n Deployd::Application.send :before, %r{/#{route_key}(/)?(.)*} do\n class_name = \"#{resource_name.singularize.classify.pluralize}Controller\"\n\n unless Deployd::Controllers.constants.include?(class_name.to_sym)\n content_type :json\n halt 404, { status: 'error', data: 'The URI requested is invalid' }.to_json\n end\n end\n end", "def route_not_found\n return redirect_to root_url(area: nil), status: 301\n end", "def not_found! redirect = root_path\n raise ActionController::RoutingError.new(\"Sorry, I could not find the requested item!\")\n end", "def not_found\n raise ActionController::RoutingError.new('Page Not Found. Please contact the system administrator.')\n end", "def raise_not_found!\n\n raise ActionController::RoutingError.new(\"No route matches #{params[:unmatched_route]}\")\n\n end", "def rescue_action_in_public(exception)\n return super unless exception.is_a? ::ActionController::RoutingError\n render_404\n end", "def unavailable! redirect = root_path\n raise Exceptional::NotAllowed.new(\"Sorry, I was unable to perform the action you requested!\")\n end", "def before_action \n end", "def error_route_not_found\n render 'errors/route_not_found', status: :not_found rescue last_chance\n end", "def route_not_found\n report_to_rollbar(\"#{request.method}:#{request.original_url} - Unknown/Unauthenticated route accessed\") if Rails.env.production?\n flash[:error] = t('errors.404_main') if current_user.present?\n respond_to do |format|\n format.html { redirect_to '/' }\n format.js { render :js => \"App.Helpers.navigateTo('/', true);\" }\n end\n end", "def route_eval\n super\n rescue ActiveRecord::RecordNotFound\n not_found\n end", "def bad_route\n redirect_to '/index.html', alert: \"Sorry, the url: #{request.fullpath} was not found\"\n logger.error \"Bad route requested for #{request.fullpath}\"\n end", "def raise_not_found\n\t\traise ActionController::RoutingError.new(\"No route matches #{params[:unmatched_route]}\")\n\tend", "def render_404\n raise ActionController::RoutingError.new('Not Found')\n end", "def failsafe_action\n super\n end", "def handle_unverified_request\n unless action_name == \"fire_object_search\" || action_name == \"fire_populate_drop_down\" \n super\n end\n end", "def rescue_action(exception)\n case exception.class.name\n when 'ActiveRecord::RecordInvalid'\n render_invalid_record(exception.record)\n when 'ActionController::RoutingError',\n 'ActionController::UnknownAction',\n 'ActiveRecord::RecordNotFound'\n render_404\n else\n if exception.message =~ /undefined local variable or method `simple[_a-z]*_page_path'/\n render :text => \"You must install this plugin's routes! Add the line 'map.from_plugin :simple_pages' to your config/routes.rb\", :layout => true and return\n end\n super\n end\n end", "def test_defaults_via\n assert_nothing_raised(ActionController::RoutingError) do\n @rs_defaults_via.generate :controller => :bug\n end\n end", "def not_allowed! redirect = root_url\n raise Exceptional::Unauthorized.new(\"Sorry, I was could not perform the action you requested!\")\n end", "def routing_error\n raise ActionController::RoutingError.new(params[:path])\n end", "def ensure_proper_setup(route = nil)\n route = \"#{self::HOME}*\" if route.nil?\n\n before(route) do\n if !route.start_with?(\"/onboarding_erb\") && !Services.onboarding_service.correct_setup?\n logger.debug(\"User is not yet onboarded. Directing them to `/onboarding`\")\n redirect(\"/onboarding_erb\")\n elsif route.start_with?(\"/onboarding_erb\") && Services.onboarding_service.correct_setup?\n session[:user] = nil # Cleanup user's session, to enforce reloading the access tokens.\n redirect(\"/\")\n else\n logger.debug(\"User is onboarded, accessing #{route}\")\n end\n end\n end", "def index\n raise ActionController::RoutingError.new('Not Found')\n end", "def custom_routes; end", "def routing_error\n head 400\n end", "def not_found\n raise ActionController::RoutingError.new('Not Found')\n rescue\n render_404\n end", "def allowed_routes\n introspector.routes.keep_if(&method(:allow_route?))\n end", "def not_found\n raise ActionController::RoutingError.new('Permalink Not Found')\n end", "def root\n super\n if @remaining_path == \"/\" && !is_get?\n always{method_not_allowed(\"GET\")}\n end\n end", "def no_route\n self.response[:body] = \"route not found for: '#{self.env['REQUEST_URI']}'\"\n self.response[:status_code] = 404\n end", "def edit; raise ActionController::RoutingError.new('Not Found'); end", "def suggest\n raise ActionController::RoutingError.new('Not Found')\n end", "def check_404\n end", "def not_found(path)\n raise ActionController::RoutingError.new(\"Route not found for #{path}\")\n end", "def external_routes; end", "def authorize_user\n if !user_signed_in? || !current_user.admin?\n raise ActionController::RoutingError.new(\"Not Found\")\n end\n end", "def before_each(req)\n if dealership(req).nil? then not_found\n elsif !authenticated?(req) then unauthenticated\n elsif !authorized?(role(req), session_user(req)) then unauthorized\n else super\n end\n end", "def before_dispatch(env); end", "def anchored_routes; end", "def not_found\n rescue_404(ActionController::RoutingError.new(\"No route matches #{request.request_method} #{request.path}\"))\n end", "def routes_not_found\n respond_to do |f|\n f.html{ render :template => \"errors/404\", :status => 404}\n end\n end", "def argument_not_found\n static_404_page\n end", "def match_before_compilation(request) #:nodoc:\n raise NotCompiledError, \"The routes have not been compiled yet\"\n end", "def not_found\n return app_not_found unless core.request?\n render_core_exception :not_found\n end", "def not_found(message='Not Found')\n raise ActionController::RoutingError.new(message)\n end", "def rescue_undefined_method\n redirect_to(:action => \"index\")\n flash[:notice] = \"Sorry, something went wrong (undefined method). \" +\n \"Please try again.\"\n end", "def before_dispatch(_env)\n end", "def bad_request\n #redirect_to \"#{Rails.root}/public/400.html\"\n raise ActionController::RoutingError.new('Bad Request')\n end", "def page_not_found # rubocop:disable Lint/UselessMethodDefinition\n super\n end", "def redirect_internal() redirect_to \"/nothing\"; end", "def allow_only_standard_requests\n if params[:format] && ([\"html\", \"js\", \"json\", \"xml\", \"rss\"].exclude?(params[:format]))\n raise ActionController::RoutingError.new('No route matches \"'+request.url+'\"')\n end\n end", "def allow_path_state\n super\n end", "def redirect_to_error\n render 'posts/404', :status => 404, :layout => false and return\n end", "def try_route\n\t\t\t\thttp_method = request.http_method\n\t\t\t\thttp_method = :GET if http_method == :HEAD\n\t\t\t\treturn unless available_endpoint\n\n\t\t\t\troute = available_endpoint[http_method]\n\t\t\t\treturn unless route || available_endpoint.allow\n\n\t\t\t\thalt(405, nil, 'Allow' => available_endpoint.allow) unless route\n\t\t\t\tstatus 200\n\t\t\t\texecute_route route\n\t\t\t\ttrue\n\t\t\tend", "def before_filter; end", "def routes_for!(place_or_object_place_was_built_from)\n routes_for(place_or_object_place_was_built_from).tap do |routes|\n routes.each do |route|\n fail_unless_route_is_ok route\n end\n end\n end", "def admin_required\n redirect_to(\"/\") unless admin?\n end", "def route_error\n \t@route_err = \"What the heck! I don't know that one, are you sure that's the address you wanted? Click me to return to the home page.\"\n end", "def user_not_authorized\n redirect_to((request.referrer || root_path) ,notice: \"Authorization error.\")\n end", "def htmlf_navigation_behavior(error)\n if get?\n raise error\n elsif has_errors? && default_action\n render :partial => default_action.to_s, :status => :unprocessable_entity\n else\n render :partial => 'show'\n end\n end", "def show\n redirect_to '/404'\n end", "def ensure_route(route)\n unless self.routes.member?(route) or route.blank?\n self.routes << route\n end\n end", "def prepare_routes\n return if Rails.configuration.eager_load || Rails.env == \"test\" \n begin\n Rails.application.routes_reloader.reload! \n rescue SystemStackError\n # NOP -- Supressing Stack Level Too deep error\n # caused by models being loaded lazily during development mode.\n end\n end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def advanced_search\n raise ActionController::RoutingError.new('Not Found')\n end", "def redirect_user_404\n redirect_to '/404'\n end", "def page_not_found\n render_404\n end", "def rescue_action_in_public( e )\n\t\tif e.is_a?(ActionController::UnknownAction)\n\t\t\t# We're going to redirect them to the index\n\t\t\tredirect_to( :action => 'index' ) and return\n\t\telse\n\t\t\t# Use the application controller's handler\n\t\t\tsuper(e)\n\t\tend\n\tend", "def not_authenticated\n redirect_to root_landing_url\n end", "def load_singular_resource\n raise Exception.new(\"#{params[:controller].capitalize} controller has not implemented load_singular_resource\")\n end", "def validate_routes\n return unless time_segment\n self.time_segment.delete_routing_set_errors\n self.time_segment.check_routing_set_percent_is_100\n end", "def rescue_action_in_public exception\n case exception\n when Hobo::PermissionDeniedError \n redirect_to :controller => :front, :action => :index\n else\n # **TODO Fix to the \"when\" to catch the correct exception;\n # in the meantime, catch every exception\n redirect_to :controller => :front, :action => :index\n end\n end", "def before_request\n end", "def only_render_implemented_actions\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n raise AbstractController::ActionNotFound unless action_methods.include?(params[:action])\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n end" ]
[ "0.73105997", "0.687186", "0.6716984", "0.6653653", "0.6593902", "0.64705294", "0.6462371", "0.64621884", "0.64583254", "0.6444509", "0.64311355", "0.64149696", "0.64149696", "0.64149696", "0.64149696", "0.64149696", "0.64149696", "0.6354106", "0.63457304", "0.6261043", "0.62584275", "0.62569135", "0.6240038", "0.62337166", "0.6227815", "0.6212397", "0.6197521", "0.619595", "0.6181198", "0.61435986", "0.61181664", "0.6087201", "0.6042405", "0.6032538", "0.6029371", "0.6027485", "0.6011821", "0.60059655", "0.5998541", "0.59961355", "0.597147", "0.59526926", "0.5916923", "0.5914301", "0.588615", "0.58642393", "0.58625466", "0.5840175", "0.58373976", "0.58211637", "0.5806411", "0.580033", "0.5791832", "0.5766646", "0.57544243", "0.5754119", "0.5707773", "0.5706285", "0.57033896", "0.57016855", "0.56944", "0.56854665", "0.5684305", "0.56808084", "0.56682235", "0.5664816", "0.5656325", "0.5651848", "0.56501025", "0.5638942", "0.5624957", "0.5624421", "0.56214887", "0.56139916", "0.5602114", "0.5593352", "0.55824053", "0.5563707", "0.5553599", "0.5553414", "0.5544269", "0.5544269", "0.5544269", "0.5544269", "0.5544269", "0.5544269", "0.5544269", "0.5544269", "0.5544269", "0.5544269", "0.5544269", "0.554422", "0.55323505", "0.55300564", "0.5529689", "0.5524132", "0.55197746", "0.55193603", "0.55175245", "0.55021286", "0.5496877" ]
0.0
-1
Adds a pattern to the grammar.
def add_pattern(pattern) @patterns << pattern end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_pattern( pattern )\n type_check( pattern, Elements::Pattern )\n assert( !name_defined?(name), \"name [#{name}] is already in use\" )\n \n @patterns[pattern.name] = pattern\n end", "def <<(pattern)\n @patterns << pattern\n end", "def add pattern\n\t\t\tnode = @root\n\n\t\t\t# If this is a string process each character\n\t\t\tif String(pattern) == pattern\n\t\t\t\tpattern.each_char do |char|\n\t\t\t\t\tif node.goto(char) == nil\n\t\t\t\t\t\tnode = node.add(char)\n\t\t\t\t\telse\n\t\t\t\t\t\tnode = node.goto(char)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\telse # Otherwise, pattern should support \"each\" method.\n\t\t\t\tfor item in pattern\n\t\t\t\t\tif node.goto(item) == nil\n\t\t\t\t\t\tnode = node.add(item)\n\t\t\t\t\telse\n\t\t\t\t\t\tnode = node.goto(item)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tif block_given?\n\t\t\t\tnode.output = yield pattern\n\t\t\telse\n\t\t\t\tnode.output = [pattern]\n\t\t\tend\n\t\tend", "def add(pattern, value)\n @subs << Substitution.new(pattern, value)\n end", "def define_pattern(name, block)\n pattern_node = TmGrammar::Pattern.new(grammar, block).evaluate\n pattern_node.name = name\n node.add_pattern(pattern_node)\n end", "def add_pattern(features, identifier = '')\n\t\t@patterns << create_pattern(features, identifier)\n\tend", "def add_rule(pattern, replace = nil, &proc)\n\t\t\tif replace\n\t\t\t\t@rules << @rule.new(pattern, replace)\n\t\t\telse\n\t\t\t\t@rules << @rule.new(pattern, proc)\n\t\t\tend\n\t\tend", "def match(*pattern, &block)\n\t\t\t@rules << Rule.new(pattern, block)\n\t\tend", "def add_special(pattern, name)\n @am.add_special(pattern, name)\n end", "def push(pat)\n Origen.interface.record_pattern_reference(pat)\n end", "def pattern=(pattern)\n @pattern = pattern\n substitute_variables! # TODO: Remove this call\n end", "def add_file_pattern(name, pattern_string)\n if name.to_s !~ FILE_PATTERN_NAME_REGEX\n raise ArgumentError.new(\"A file pattern name must match this regex: #{ FILE_PATTERN_NAME_REGEX.inspect }\")\n end\n @file_patterns[name.to_sym] = pattern_string.to_s\n end", "def add(pattern, dest, options)\n [:add, pattern, dest, options]\nend", "def add_pattern(prefix, pattern, &block)\n @trie[prefix] ||= {}\n @trie[prefix][pattern] = block\n end", "def apply_to(pattern)\n @pattern = pattern\n end", "def generate_pattern(pattern)\n plist.dict do\n append_single('begin', pattern.begin)\n append_dictionary('beginCaptures', pattern.begin_captures)\n append_dictionary('captures', pattern.captures)\n append_single('comment', pattern.comment)\n append_single('contentName', pattern.content_name)\n append_single('disabled', 1) if pattern.disabled\n append_single('end', pattern.end)\n append_dictionary('endCaptures', pattern.end_captures)\n append_single('include', pattern.include)\n append_single('match', pattern.match)\n append_single('name', pattern.name)\n append_array('patterns', pattern.patterns)\n end\n end", "def apply_pattern(pattern)\n raise \"Not a pattern\" unless pattern.instance_of?(Pattern)\n if self.matches?(pattern.regexp)\n self.assign_tag(pattern.tag_id, 2, pattern.id)\n true\n else\n false\n end\n end", "def add_route(pattern, method, controller_class, action_name)\n @routes << Route.new(pattern, method, controller_class, action_name)\n end", "def add_route(pattern, method, controller_class, action_name)\n @routes << Route.new(pattern, method, controller_class, action_name)\n end", "def add_route(pattern, method, controller_class, action_name)\n @routes << Route.new(pattern, method, controller_class, action_name)\n end", "def add_route(pattern, method, controller_class, action_name)\n @routes << Route.new(pattern, method, controller_class, action_name)\n end", "def add_route(pattern, method, controller_class, action_name)\n @routes << Route.new(pattern, method, controller_class, action_name)\n end", "def add_route(pattern, method, controller_class, action_name)\n @routes << Route.new(pattern, method, controller_class, action_name)\n end", "def add_route(pattern, method, controller_class, action_name)\n @routes << Route.new(pattern, method, controller_class, action_name)\n end", "def add_route(pattern, method, controller_class, action_name)\n @routes << Route.new(pattern, method, controller_class, action_name)\n end", "def add_route(pattern, method, controller_class, action_name)\n @routes << Route.new(pattern, method, controller_class, action_name)\n end", "def add_route(pattern, method, controller_class, action_name)\n @routes << Route.new(pattern, method, controller_class, action_name)\n end", "def add_route(pattern, method, controller_class, action_name)\n @routes << Route.new(pattern, method, controller_class, action_name)\n end", "def add(pattern, dest, options)\n options[:prio]=255 unless options[:prio] # default\n @route[pattern]=RouteEntry.new(dest, options)\n end", "def add_route(pattern, method, controller_class, action_name)\n new_route = Route.new(pattern, method, controller_class, action_name)\n @routes << new_route\n end", "def initialize(pattern)\n @pattern = pattern\n end", "def add_regexp_handling(pattern, name)\n @attribute_manager.add_regexp_handling(pattern, name)\n end", "def pattern_create(length, sets = nil)\n Rex::Text.pattern_create(length, sets)\n end", "def Pattern(*pattern)\n (self.class)::B._clear_bindings!(caller_locations(1,1)[0].label)\n ::PatternMatching::PatternMatch.new(*pattern)\n end", "def add_regexp_handling pattern, name, exclusive = false\n bitmap = @attributes.bitmap_for(name)\n @regexp_handlings << [pattern, bitmap]\n @exclusive_bitmap |= bitmap if exclusive\n end", "def handle(pattern, &block)\n @routes << [pattern, block]\n end", "def add(term)\n root.add Buffer.new(normalize(term) + delimiter), term\n end", "def +(object)\n if object.is_a?(Pattern)\n Pattern.new(self, size: size + object.size) { |y, d|\n each { |v| y << v }\n object.each { |v| y << v }\n }\n else\n map { |v| v.respond_to?(:+) ? v + object : v }\n end\n end", "def pattern\n @pattern ||= Pattern.patterns[pattern_name]\n end", "def add_special(pattern, name)\n @attribute_manager.add_special(pattern, name)\n end", "def placePattern(pattern, disposition, context)\n\n end", "def p(pattern)\n Parslet::Pattern.new(pattern)\n end", "def pattern(value_=nil)\n if value_\n @pattern = value_\n else\n @pattern\n end\n end", "def consume(pattern)\n if input.match?(pattern)\n append input.scan(pattern)\n end\n end", "def add(klass)\n pattern = klass.new\n yield pattern if block_given?\n pattern.accumulation = self\n pattern.parent = @current\n self << pattern\n pattern\n end", "def add(klass, string)\n if string.is_a? Regexp\n patterns[string] = klass\n else\n table[string] = klass\n end\n end", "def add_matching(pattern)\n self.class.glob(pattern).each do |fn|\n self << fn unless excluded_from_list?(fn)\n end\n end", "def lex_rule start_state, regexp, action = nil\n rules << Rule.new(start_state, regexp, action)\n end", "def add_rule(name, *param_types, &func)\n rule = { name: name.to_s.dup.freeze,\n param_types: param_types.dup.freeze }.freeze\n regexp = mk_regexp_from_rule(rule)\n @rules.push([regexp, rule, func])\n return self\n end", "def include(pattern)\n includes << pattern\n end", "def validate_pattern (pattern)\n\tpattern = \"ABAB\" if pattern.nil? or !PATTERNS.include?(pattern) \n\tp \"======pattern=#{pattern}==\"\n\t@pattern = pattern\nend", "def add_blacklist(p)\n raise ArgumentError.new(\"Nil Pattern\") if p.nil?\n @black_list << create_regex(p)\n end", "def initialize(pattern, rep_name, block, params = {})\n # TODO: remove me\n unless pattern.is_a?(Nanoc::Int::StringPattern) || pattern.is_a?(Nanoc::Int::RegexpPattern)\n raise 'Can only create rules with patterns'\n end\n\n @pattern = pattern\n @rep_name = rep_name.to_sym\n @snapshot_name = params[:snapshot_name]\n\n @block = block\n end", "def initialize( name, pattern, *args, &block )\n\t\t\t@pattern = pattern\n\n\t\t\tsuper( name, *args, &block )\n\t\tend", "def append(pattern, file, where=:bottom)\n was = sftp.file.open(file, \"r\") { |f| f.read }\n\n if was.include?(pattern)\n log \"'%s' already match your pattern\" % file\n return false\n else\n pattern += \"\\n\" unless pattern[-1] == ?\\n\n replacement = case where\n when :top, :start then pattern+was\n when :bottom, :end then was+pattern\n else raise \"%s is not a valid, available values are (:top, :start, :bottom, :end)\" % where.inspect\n end\n end\n\n log \"append to '%s' in '%s'\" % [where, file]\n sftp.file.open(file, \"w\") { |f| f.write(replacement) }\n end", "def pattern_params\n params.require(:pattern).permit(:name, :difficulty, :description, :yarn, :category_id)\n end", "def plus_asgn!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 86 )\n\n type = PLUS_ASGN\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 207:13: '+='\n match( \"+=\" )\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__, 86 )\n\n end", "def initialize(name, pattern)\n @name, @pattern = name, pattern\n end", "def add\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 58 )\n return_value = AddReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n char_literal264 = nil\n char_literal265 = nil\n mult263 = nil\n mult266 = nil\n\n tree_for_char_literal264 = nil\n tree_for_char_literal265 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 626:5: mult ( ( '+' | '-' ) mult )*\n @state.following.push( TOKENS_FOLLOWING_mult_IN_add_4145 )\n mult263 = mult\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, mult263.tree )\n end\n # at line 626:10: ( ( '+' | '-' ) mult )*\n while true # decision 64\n alt_64 = 2\n alt_64 = @dfa64.predict( @input )\n case alt_64\n when 1\n # at line 626:13: ( '+' | '-' ) mult\n # at line 626:13: ( '+' | '-' )\n alt_63 = 2\n look_63_0 = @input.peek( 1 )\n\n if ( look_63_0 == PLUS )\n alt_63 = 1\n elsif ( look_63_0 == MINUS )\n alt_63 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 63, 0 )\n end\n case alt_63\n when 1\n # at line 626:15: '+'\n char_literal264 = match( PLUS, TOKENS_FOLLOWING_PLUS_IN_add_4152 )\n if @state.backtracking == 0\n\n tree_for_char_literal264 = @adaptor.create_with_payload( char_literal264 )\n root_0 = @adaptor.become_root( tree_for_char_literal264, root_0 )\n\n end\n\n when 2\n # at line 626:22: '-'\n char_literal265 = match( MINUS, TOKENS_FOLLOWING_MINUS_IN_add_4157 )\n if @state.backtracking == 0\n\n tree_for_char_literal265 = @adaptor.create_with_payload( char_literal265 )\n root_0 = @adaptor.become_root( tree_for_char_literal265, root_0 )\n\n end\n\n end\n @state.following.push( TOKENS_FOLLOWING_mult_IN_add_4163 )\n mult266 = mult\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, mult266.tree )\n end\n\n else\n break # out of loop for decision 64\n end\n end # loop for decision 64\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__, 58 )\n\n end\n \n return return_value\n end", "def replace pattern, substitute\n if pattern.is_a? Regexp\n ArelExtensions::Nodes::RegexpReplace.new self, pattern, substitute\n else\n ArelExtensions::Nodes::Replace.new self, pattern, substitute\n end\n end", "def lex_group start_state, regexp, action = nil\n rule = Rule.new(start_state, regexp, action)\n rule.group = group\n self.group << rule\n end", "def is_pattern?\n @pattern\n end", "def create\n @pattern = Pattern.new(pattern_params)\n\n respond_to do |format|\n if @pattern.save\n format.html { redirect_to @pattern, notice: 'Pattern was successfully created.' }\n format.json { render :show, status: :created, location: @pattern }\n else\n format.html { render :new }\n format.json { render json: @pattern.errors, status: :unprocessable_entity }\n end\n end\n end", "def make_pattern pattern\n state = :close\n rule = ''\n last_ch = ''\n pattern.split('').each do |ch|\n case ch\n when '('\n state = :open\n rule << '('\n when ')'\n state = :close\n rule << ')'\n else\n case state\n when :open\n case last_ch\n when '('\n else\n rule << '|'\n end\n rule << ch\n when :close\n rule << \"[#{ch}]\"\n end\n end\n last_ch = ch\n end\n Regexp.new rule\nend", "def add_whitelist(p)\n raise ArgumentError.new(\"Nil Pattern\") if p.nil?\n @white_list << create_regex(p)\n end", "def add_matching(pattern)\n Dir[pattern].each do |fn|\n\tself << fn unless exclude?(fn)\n end\n end", "def add(rule); end", "def relate_pattern(geom, pattern)\n check_geometry(geom)\n bool_result(FFIGeos.GEOSRelatePattern_r(Geos.current_handle_pointer, ptr, geom.ptr, pattern))\n end", "def file_pattern( pattern )\n self.class_eval { @file_pattern = pattern }\n end", "def glob=(pattern)\n @glob = pattern\n if pattern.kind_of?(Regexp)\n @pattern = pattern\n else\n @pattern = scan_string\n end\n end", "def set_pattern\n @pattern = Pattern.find(params[:id])\n end", "def set_pattern\n @pattern = Pattern.find(params[:id])\n end", "def at(pattern, &block)\n @tests << [pattern, block]\n end", "def pattern\n Regexp.union(pattern_classifiers.map(&:pattern))\n end", "def load_pattern(pattern_name, pattern_group = \"default\", parent_binding = nil)\n load_from_file_in_template(pattern_name, parent_binding, pattern_group, :pattern)\n end", "def load_pattern(pattern_name, pattern_group = \"default\", parent_binding = nil)\n load_from_file_in_template(pattern_name, parent_binding, pattern_group, :pattern)\n end", "def query_pattern(pattern, **options, &block)\n return super unless pattern.graph_name == DEFAULT_GRAPH\n\n if block_given?\n pattern = pattern.dup\n pattern.graph_name = nil\n\n each_statement do |statement|\n yield statement if (statement.graph_name == DEFAULT_GRAPH ||\n statement.graph_name.nil?) && pattern === statement\n end\n else\n enum_for(:query_pattern, pattern, options)\n end\n end", "def add_sample_grammar(anEngine)\n anEngine.build_grammar do\n add_terminals('a', 'b', 'c')\n add_production('S' => 'A')\n add_production('A' => 'a A c')\n add_production('A' => 'b')\n end\n end", "def pattern_template\n \"*\"\n end", "def pattern(name, x, y, width, height)\n push('defs')\n push(\"pattern #{name} \" + sprintf('%g %g %g %g', x, y, width, height))\n push('graphic-context')\n yield\n ensure\n pop('graphic-context')\n pop('pattern')\n pop('defs')\n end", "def add\n match '+'\n term\n emit_ln 'ADD (SP)+, D1'\nend", "def pattern(base, string)\n pattern = Pattern.new(base, string)\n interval = @midi.interval\n return proc do |b|\n note, duration = pattern[b]\n length = interval * duration - (interval * 0.10)\n play(note, length) if note\n end\n end", "def pattern\n @pattern\n end", "def add_regexp(regexp)\n starting_chars = regexp.starting_chars\n if starting_chars.kind_of? Symbol \n scanning_table.default = regexp\n else\n common_chars = starting_chars.select { |c| scanning_table.has_key? c } \n starting_chars = starting_chars - common_chars\n starting_chars.each { |c| scanning_table[c] = regexp }\n colliding_states = common_chars.map { |c| scanning_table[c] }\n colliding_states.uniq!\n colliding_states.zip(common_chars).each { |r,c| scanning_table[c] = RegexpSpecification.mix(regexp,r) }\n end\t\n \n if @built\n build\n end\n \n self\n end", "def next_regex regex\n if regex.is_a? Symbol\n regex = @text_patterns[regex]\n raise \"Pattern specified #{regex} does not exist in text_patterns \" unless regex\n end\n @last_regex = regex\n find_more\n end", "def plus!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 39 )\n\n\n\n type = PLUS\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 60:7: '+'\n match( 0x2b )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 39 )\n\n\n end", "def plus!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 30 )\n\n type = PLUS\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 164:8: '+'\n match( 0x2b )\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__, 30 )\n\n end", "def plus!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 84 )\n\n type = PLUS\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 205:8: '+'\n match( 0x2b )\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__, 84 )\n\n end", "def rule(pattern, *dependencies, &block)\n if block.nil?\n Rule.new(pattern, *dependencies)\n else\n Rule.new(pattern, *dependencies) do |rule|\n rule.define(&block)\n end\n end\n end", "def plus!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 48 )\n\n type = PLUS\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 374:8: '+'\n match( 0x2b )\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 pattern; end", "def pattern; end", "def pattern; end", "def match(pattern, options = {})\n options = {:use_prefix => true, :use_suffix => true, :method => :execute}.merge(options)\n @matchers << Match.new(pattern, options[:use_prefix], options[:use_suffix], options[:method])\n end", "def pattern2regex(pattern)\n tail = pattern\n prefix = String.new\n while !tail.empty? do\n head, sep, tail = tail.partition(/[\\*\\?]/)\n prefix = prefix + Regexp.quote(head)\n case sep\n when '*'\n prefix += '.*'\n when '?'\n prefix += '.'\n when ''\n else\n fail \"Unpexpcted sep:#{sep}\"\n end\n end\n Regexp.new(\"^\" + prefix + \"$\", true)\n end", "def on_match_pattern_p(node); end", "def initialize(pattern, *options)\n case pattern\n when ::Regexp, PCRE2::Regexp\n @source = pattern.source\n else\n @source = pattern\n end\n\n @pattern_ptr = Lib.compile_pattern(source, options)\n end", "def pattern_params\n params.require(:pattern).permit(:name, :digital, :cut, :category, :notions, :fabrics)\n end", "def parse_pattern(pattern)\n return pattern if pattern.is_a?(Regexp)\n\n pattern = pattern.split(/\\//).map do |part|\n if /^:/ =~ part\n \"(?<#{part.sub(\":\", \"\")}>\\\\d+)\"\n else\n part\n end\n end.join(\"/\")\n\n Regexp.new(\"^#{pattern}$\")\n end", "def add_matching(pattern)\n Dir[ pattern ].each do |fn|\n self << fn unless exclude?(fn)\n end\n end" ]
[ "0.7800182", "0.7321851", "0.71719074", "0.69735104", "0.6959845", "0.6906946", "0.6666397", "0.6614245", "0.64810014", "0.63464284", "0.622856", "0.6212766", "0.62013966", "0.6123034", "0.6087397", "0.60434186", "0.6042121", "0.60168535", "0.60168535", "0.60168535", "0.60168535", "0.5956891", "0.5956891", "0.5956891", "0.5956891", "0.5956891", "0.5956891", "0.5956891", "0.5941413", "0.5906269", "0.58644253", "0.5852554", "0.5816925", "0.5804317", "0.5761293", "0.5743219", "0.57303673", "0.5664124", "0.5615645", "0.5609047", "0.5585035", "0.555443", "0.5523664", "0.5500602", "0.545087", "0.5421269", "0.5413738", "0.54125744", "0.5382058", "0.53565747", "0.5337999", "0.53141886", "0.53000057", "0.5270936", "0.52675843", "0.5260948", "0.52599865", "0.52375585", "0.5225795", "0.52202934", "0.5218404", "0.52143294", "0.5206997", "0.5196592", "0.5188652", "0.51884633", "0.51836175", "0.51823753", "0.5181685", "0.51704234", "0.5168021", "0.5168021", "0.5167397", "0.51427865", "0.5135101", "0.5135101", "0.5134239", "0.51312333", "0.51212364", "0.5120576", "0.51204586", "0.51092285", "0.509767", "0.50967145", "0.50895697", "0.5086853", "0.50819355", "0.5080811", "0.5074294", "0.5074055", "0.506469", "0.506469", "0.506469", "0.505719", "0.50534403", "0.5042616", "0.5039086", "0.5037231", "0.5030107", "0.5027041" ]
0.8067763
0
tests to make sure the facebook callback gets routes to the create method in sessions
def test_routes assert_routing '/auth/:provider/callback', { :controller => 'sessions', :action => 'create', :provider => ':provider' } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ensure_facebook_connect\n set_facebook_session()\n if facebook_session && facebook_session.user.id\n @user = User.find_or_create_by_facebook_id(facebook_session.user.id)\n else\n redirect_to :controller=>:account, :action=>:login, :next_url=>request.request_uri\n end\n end", "def create_fb\n if current_facebook_user\n current_facebook_user.fetch\n if logged_in_member\n logged_in_member.update_attribute(:fb_user_id, current_facebook_user.id)\n redirect_to logged_in_member\n else\n @member = Member.find_or_initialize_with_facebook(current_facebook_user)\n conference_delegate = ConferenceDelegate.find_by_signature(params[:signature]) if !params[:signature].blank?\n if @member.new_record?\n @member.conference_delegate = conference_delegate\n @member.auth_service = 'Facebook'\n render :template => \"sessions/register_email\"\n else\n if conference_delegate && conference_delegate.member.nil? && @member.conference_delegate.nil?\n conference_delegate.update_attribute(:member, @member)\n end\n login_member!(@member)\n end\n end\n else\n redirect_to new_session_path\n end\n end", "def Managerfb\n session[:check] = 1\n redirect_to '/auth/facebook'\n end", "def facebookcheck\n auth=request.env[\"omniauth.auth\"]\n session[:auth] = auth\n if (session[:check] == 1)\n redirect_to '/create/manager'\n elsif (session[:check] == 2)\n redirect_to '/create/tenant'\n else\n #differentiates the redirection for the log in of a tenant or manager\n if Manager.where(:provider => auth[\"provider\"], :uid => auth[\"uid\"]).exists?\n user=Manager.find_by(:provider => auth[\"provider\"], :uid => auth[\"uid\"])\n session[:user_id] = user.id\n redirect_to '/managers/show'\n elsif Tenant.where(:provider => auth[\"provider\"], :uid => auth[\"uid\"]).exists?\n user = Tenant.find_by(:provider => auth[\"provider\"], :uid => auth[\"uid\"]) \n session[:user_id] = user.id\n redirect_to '/tenants/show'\n #redirects incorrect sign ins\n else\n flash[:notice] = 'Incorrect login information.'\n redirect_to '/signin'\n end\n end\n end", "def facebook\n callback\n end", "def facebook_request\n redirect_to facebook_authenticate_url\n end", "def createF\r\n user = User.omniauth(env['omniauth.auth'])\r\n session[:user_id] = user.id\r\n Action.create(info: current_user.username + ' has logged in using facebook.', user_email: current_user.email)\r\n redirect_to user\r\n end", "def facebook_callback\n if params[:error_reason]\n redirect_to :controller => :home, :action => :index\n return\n end\n oauth_info = OauthToken.get_oauth_info('facebook')\n uri = URI.parse(\"https://graph.facebook.com/oauth/access_token\")\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n new_params = {:client_id => oauth_info['consumer_key'],\n :client_secret => oauth_info['consumer_secret'],\n :redirect_uri => oauth_info['callback'],\n :code => params[:code]}\n \n request = Net::HTTP::Post.new(uri.request_uri)\n request.set_form_data(new_params)\n response = http.request(request)\n \n fields = response.body.split('=')\n access_token = fields[1]\n\n oauth_token = OauthToken.find_by_token_and_site_token(access_token,'facebook')\n \n if current_user and oauth_token.present? and oauth_token.user and current_user != oauth_token.user\n redirect_to :controller => :oauth, :action => :duplicate_users, :id => oauth_token.id\n return\n end\n\n # Create the Oauth token\n if oauth_token\n oauth_token.update_attributes({:site_token => 'facebook',\n :site_name => \"Facebook\",\n :token => access_token}) \n oauth_token.get_user_info\n else\n oauth_token = OauthToken.create({:user_id => (current_user ? current_user.id : nil),\n :site_token => 'facebook',\n :site_name => \"Facebook\",\n :token => access_token}) \n oauth_token.get_user_info\n \n TrackedAction.add(:connected_to_third_party_site, oauth_token.user)\n TrackedAction.add(:connected_to_facebook, oauth_token.user)\n oauth_token.user.give_level_up_credits(10)\n end\n\n OauthToken.delay.autofollow_friends(oauth_token.id)\n\n flash[:authenticated_facebook] = 1\n if !session[:redirect_after_oauth].blank?\n redirect_to session[:redirect_after_oauth]\n session[:redirect_after_oauth] = nil\n else\n redirect_to :controller => :home, :action => :index\n end\n end", "def facebook_authenticatable\n\t\t\troutes.with_options(:controller => 'facebook_auth', :name_prefix => nil) do |auth|\n\t auth.send(:\"new_#{mapping.name}_session\", mapping.path_names[:sign_in], :action => 'create', :conditions => {:method => :get})\n\t # auth.send(:\"#{mapping.name}_session\", mapping.path_names[:sign_in], :action => 'create', :conditions => {:method => :post})\n\t # auth.send(:\"destroy_#{mapping.name}_session\", mapping.path_names[:sign_out], :action => 'destroy', :conditions => { :method => :get })\n\t\t\tend\n\t\tend", "def create\n @facebook_url = FacebookUrl\n p 'fb url'\n puts @facebook_url\n token_info = FacebookAuth.get_user_info_from_cookies(cookies)\n puts \"cookies: #{cookies.inspect}\"\n if (token_info)\n p 'cookie token'\n @user = User.add_facebook(token_info)\n redirect_to :action => 'show', :id => @user.id\n elsif (params[:code]) \n p 'params[:code]'\n token_info = FacebookAuth.get_access_token_info(params[:code])\n @user = User.add_facebook(token_info)\n redirect_to :action => 'show', :id => @user.id\n else\n p 'redirecting to fb'\n render :layout => false, :inline => \"<html><head>\\n<script type=\\\"text/javascript\\\">\\nwindow.top.location.href = '<%=raw(@facebook_url) %>';\\n</script>\\n\"\n #https://graph.facebook.com/oauth/authorize?client_id=163086873741036&redirect_uri=http://apps.facebook.com/friends_mapper/&scope=user_location,friends_location,publish_stream\n end\n \n end", "def facebook\n\n end", "def facebook_callback\n hash = request.env[\"omniauth.auth\"]\n if hash\n email = hash[\"info\"][\"email\"]\n username = hash[\"info\"][\"nickname\"]\n gender = hash[\"extra\"][\"raw_info\"][\"gender\"]\n provider = hash[\"provider\"]\n gid = hash[\"uid\"]\n token = hash[\"credentials\"][\"token\"]\n auth = Authentication.find_by_provider_and_gid(provider, gid)\n if !gamer_signed_in?\n if auth\n if auth.gamer\n flash[:success] = t(:signed_in_fb)\n sign_in_and_redirect(:gamer, auth.gamer)\n else\n flash[:error] = t(:no_account)\n redirect_to \"/gamers/sign_up\"\n end\n else\n gamer = Gamer.find_by_email(email)\n if gamer\n Authentication.create_with_omniauth(provider, gid,\n token, nil, email, gamer.id)\n flash[:success] = t(:signed_in_fb)\n sign_in_and_redirect(:gamer, gamer)\n else\n session[\"devise.token\"] = token\n session[\"devise.gid\"] = gid\n session[\"devise.token_secret\"] = nil\n flash[:info] = t(:continue_reg_fb)\n redirect_to controller: \"social_registrations\",\n action: \"new_social\", email: email, username: username,\n gender: gender, provider: provider\n end\n end\n else\n if !auth\n Authentication.create_with_omniauth(provider,gid,\n token, nil, email, current_gamer.id)\n flash[:success] = t(:logged_in_to_fb)\n redirect_to \"/gamers/edit\"\n else\n Authentication.update_token(current_gamer.id, provider, token)\n redirect_to \"/games/post_facebook\"\n end\n end\n else\n flash[:error] = t(:oops_error_fb)\n redirect_to root_url\n end\n end", "def create\n client = Facebook.auth(callback_facebook_url).client\n client.authorization_code = params[:code]\n access_token = client.access_token!\n user = FbGraph::User.me(access_token).fetch\n authenticate Facebook.identify(user)\n# redirect_to dashboard_url\n redirect_to root_url\n end", "def facebook\n end", "def facebook\n handle_oauth\n end", "def create\n\t\tauth = request.env[\"omniauth.auth\"] #when press the link fb_login, response that is received from callback is stored in auth var\n\t\tsession[:omniauth] = auth.except('extra') #session var with info from response, except extra- info that we dont need\n\t\tcurrent_user = User.sign_in_from_omniauth(auth)\n\t\tsession[:user_id] = current_user.id\n\t\tredirect_to root_url, flash: { notice: \"#{current_user.name}, welcome to Like Machine.\"}\n\tend", "def test_fb_user_signup_then_login_logout_multiple_times\n @user.email = @fb_user['email']\n\n # Step 1\n params = {\n 'vrid' => @user.vrid,\n 'merge_history' => true\n }\n\n assign_http(Config[\"turtle\"][\"host\"])\n\n get '/auth/facebook', params\n assert_response(@response, 302)\n assert_match(/https:\\/\\/www\\.facebook\\.com/, @response['location'])\n\n login_fb_user!(@fb_user, @user)\n assert(@user.oauth_token)\n\n lookup_user_by_id(@user.id)\n fb_uid = @parsed_response['facebook_uid']\n\n # Step 2\n get_user_info(@user.oauth_token)\n assert(@parsed_response['accounts'].length >= 1, @parsed_response)\n fb_account = @parsed_response['accounts'].first\n assert_equal('FacebookAccount', fb_account['type'], fb_account)\n assert(fb_account['identifier'], fb_account)\n\n get_dragon_user(@user.id)\n assert_response(@response, :success)\n\n assert(@parsed_response['facebook_uid'], @parsed_response)\n assert_equal(fb_uid, @parsed_response['facebook_uid'], @parsed_response)\n\n # Step 3\n turtle_response = @user.logout\n assert_response(turtle_response, :redirect)\n\n get_dragon_user(@user.id)\n assert_response(@response, :success)\n\n assert(@parsed_response['facebook_uid'], @parsed_response)\n assert_equal(fb_uid, @parsed_response['facebook_uid'], @parsed_response)\n\n # Step 4\n params = {\n 'vrid' => @user.vrid,\n 'merge_history' => true\n }\n\n assign_http(Config[\"turtle\"][\"host\"])\n\n get '/auth/facebook', params\n assert_response(@response, 302)\n assert_match(/https:\\/\\/www\\.facebook\\.com/, @response['location'])\n\n login_fb_user!(@fb_user, @user)\n assert(@user.oauth_token)\n\n get_user_info(@user.oauth_token)\n assert(@parsed_response['accounts'].length >= 1, @parsed_response)\n fb_account = @parsed_response['accounts'].first\n assert_equal('FacebookAccount', fb_account['type'], fb_account)\n assert(fb_account['identifier'], fb_account)\n\n get_dragon_user(@user.id)\n assert_response(@response, :success)\n\n assert(@parsed_response['facebook_uid'], @parsed_response)\n assert_equal(fb_uid, @parsed_response['facebook_uid'], @parsed_response)\n end", "def fb_auth\n session[:sign_up_reason] = nil\n\n if params[:return_to]\n set_after_sign_in_location(params[:return_to])\n elsif params[:spree_user_return_to]\n set_after_sign_in_location(params[:spree_user_return_to])\n elsif is_user_came_from_current_app\n set_after_sign_in_location(request.referrer)\n end\n\n if params[:redeem_via_fb_state]\n session[:redeem_via_fb_state] = params[:redeem_via_fb_state]\n end\n\n if params[:new_modal_fb_state]\n session[:new_modal_fb_state] = params[:new_modal_fb_state]\n end\n\n if params[:show_promocode_modal]\n session[:show_promocode_modal] = params[:show_promocode_modal]\n # reset current modal popup\n set_after_sign_in_location(root_path)\n end\n\n session[:auto_apply] = params[:auto_apply] if params.key?(:auto_apply)\n session[:auto_apply_promo] = params[:auto_apply_promo] if params.key?(:auto_apply_promo)\n\n # Capture PLEASE REMIND ME ABOUT MY SALE events to push onto customer.io later.\n session[:email_reminder_promo] = params[:email_reminder_promo] if params.key?(:email_reminder_promo)\n\n\n redirect_to spree.spree_user_omniauth_authorize_url(provider: :facebook, scope: 'email,public_profile,user_friends')\n end", "def facebook_callback\n user_data = parse_facebook_user_data\n token = sign_user_token(user_data[\"email\"],\"facebook\")\n\n user = User.find_by_token(token)\n if user\n set_current_user(user)\n else\n user = User.new(:email => user_data[\"email\"],\n :nick => user_data[\"first_name\"],\n :token => token)\n user.save!\n\n set_current_user(user)\n end\n redirect_to :controller => \"sales_management\",\n :action => \"index\",\n :user_id => user.id\n end", "def ensure_authenticated\n if current_facebook_user.nil? && params[:Caller].blank?\n redirect_to url_for(:controller => \"login\")\n else\n if params[:Caller]\n phone = params[:Caller].match(/(\\d){10}$/)[0]\n @user = Phone.find_by_number(phone).try(:user)\n unless @user\n redirect_to url_for(:controller => \"login\", :action => \"not_found\", :format => :xml)\n return\n end\n offline_client = Mogli::Client.new(@user.facebook_access_token, nil)\n fb_user = Mogli::User.find(@user.facebook_id, offline_client) # reusing current_facebook_user breaks use in else, somehow\n else\n @user = User.find_or_create_by_facebook_id(current_facebook_user.id)\n #not the best place, but ...\n set_access_token\n current_facebook_user.fetch\n end\n @feed = FbFeed.new(@user)\n logger.debug(\"twilio, #{ @feed }\")\n logger.debug(\"url = https://graph.facebook.com/#{ @user.facebook_id }/home?access_token=#{ @user.facebook_access_token }\")\n end\n end", "def signup_with_facebook\n @status, @msg, @data = UserValidator.signup_with_facebook(params)\n @status, @msg, @data = UserManager.signup_with_facebook(params) if @status\n end", "def facebook\n handle_auth \"facebook\"\n end", "def create\n counter_fixation # Counter session fixation (but save forwarding url)\n if Rails.application.config.deny_login\n flash.now[:danger] = t('sessions.login_disabled')\n render 'new', status: :forbidden\n elsif request.env['omniauth.auth'].present?\n omniauth_login\n elsif params[:session][:provider] == 'local'\n local_login\n else\n flash.now[:danger] = t('sessions.incorrect_login_info')\n render 'new'\n end\n end", "def create_from_oauth\n if stored_anonymous_user?\n user, from_registration = update_from_omniauth(env[\"omniauth.auth\"], params[:provider])\n else\n user, from_registration = create_from_omniauth(env[\"omniauth.auth\"], params[:provider])\n end\n\n if user.errors.any?\n redirect_to_registration_page(user)\n else\n change_global_user_id(user.id)\n sign_in(user)\n fandom_play_login(user)\n \n if from_registration\n log_data = { 'form_data' => env[\"omniauth.auth\"], 'user_id' => current_user.id }\n log_synced(\"registration from oauth\", adjust_user_and_log_data_with_utm(user, log_data))\n\n set_account_up()\n cookies[:from_registration] = true \n end\n\n if $site.force_facebook_tab && !request_is_from_mobile_device?(request)\n redirect_to request.site.force_facebook_tab\n else\n redirect_after_oauth_successful_login()\n end\n end\n end", "def test_sign_up_facebook\n aaaaaaaaaaaaaaaaaaaaaaaaaaa\n puts \"+++++++++++++++++++facebook_sign_up+++++++++++++++++++\"\n puts \"000000000000000000000\", params.inspect\n puts \"111111111111111111111\", params[:user][:device_token]\n begin\n if request.format(request) == '*/*'\n if params[:facebook_id].present?\n @user = User.where(:facebook_id => params[:facebook_id]).first\n if @user.present?\n if @user.sign_in_count == 0\n flag = true\n else\n flag = false\n end\n render :json => {:success => \"true\", :message => \"signed in successfully\",:is_braintree_info_added => @user.merchant_id.present? ? \"true\" : \"false\", :user => {:id => @user.id,:sign_up_first_time => flag, :name => @user.name, :username => @user.username, :email => @user.email, :street_address => @user.street_address, :city => @user.city, :state => @user.state, :zip_code => @user.zip_code, :token => @user.session_token, :profile => {:user_id => @user.id, :about_yourself => @user.profile.about_yourself, :phone_number => @user.profile.phone_number, :distance => @user.profile.distance, :location_status => @user.profile.location_status,:push_notifications => @user.profile.push_notifications, :profile_image => {:pic_url => @user.profile.profile_image.present? ? @user.profile.profile_image.pic.url : \"\"}}}}\n @user.update_attributes(:sign_in_count => @user.sign_in_count + 1, :device_token => params[:user][:device_token])\n else\n random_str = SecureRandom.hex\n @user = User.new(:name => params[:user][:name], :username => params[:user][:username], :email => params[:user][:email], :password => params[:user][:password], :facebook_id => params[:facebook_id], :device_token => params[:user][:device_token], :session_token => random_str)\n if @user.save\n if @user.sign_in_count == 0\n flag = true\n else\n flag = false\n end\n @profile = Profile.create(:about_yourself => params[:user][:profile][:about_yourself], :phone_number => params[:user][:profile][:phone], :distance => params[:user][:profile][:distance], :user_id => @user.id) if @user.present?\n create_customer_to_braintree(@user)\n render :json => {:success => \"true\", :message => \"user has been successfully created\",:is_braintree_info_added => @user.merchant_id.present? ? \"true\" : \"false\", :user => {:id => @user.id,:sign_up_first_time => flag, :name => @user.name, :username => @user.username, :email => @user.email, :street_address => @user.street_address, :city => @user.city, :state => @user.state, :zip_code => @user.zip_code, :token => @user.session_token, :profile => {:user_id => @user.id, :about_yourself => @profile.about_yourself, :phone_number => @profile.phone_number, :distance => @profile.distance, :location_status => @user.profile.location_status, :push_notifications => @user.profile.push_notifications,:profile_image => {:pic_url => @user.profile.profile_image.present? ? @user.profile.profile_image.pic.url : \"\"}}}}\n @user.update_attributes(:sign_in_count => @user.sign_in_count + 1)\n else\n render :json => {:success => \"false\", :message => \"cant create user\"}\n end\n end\n else\n render :json => {:success => \"false\", :message => \"cant create user facebook id does not exist\"}\n end\n end\n rescue Exception => e\n return render :json => {:success => \"false\", :message => \"#{e.message}\"}\n end\n\n end", "def create_fb_url_with_creds(indv_u_id, ac_token, decoded_state: nil)\n url = FACEBOOK_URL + \"?individual_user_id=#{indv_u_id}&secret=#{ac_token}\"\n if decoded_state\n url += \"pathway=#{decoded_state['pathway']}\" +\n \"&gift_template_id=#{decoded_state['gift_template_id']}\" \n end\n \n #Creates facebook oauth dialog url\n #--PE 10/30/14\n def create_oauth_url(cb_url, encoded_auth_state)\n oauth_url = \"https://www.facebook.com/dialog/oauth/?client_id=\" +\n \"#{APP_ID}&redirect_uri=#{cb_url}&state=#{encoded_auth_state}\"\n end\n\n #########\n protected\n ######### \n\n #Renew the access_token after API failure --PE July 17, 2012\n def rescue_api_error\n session.delete(:access_token)\n\t session.delete(:individual_user_id)\n\t oauth = Koala::Facebook::OAuth.new(APP_ID, APP_SECRET, AUTH_CALLBACK)\n\t redirect_to(:action => \"exit_portal\", :url => oauth.url_for_oauth_code)\n end\n\n #Redirect to app index page after connection is reset --PE July 23, 2012\n def rescue_connection_reset\n redirect_to(:action => \"index\")\n flash[:notice] = \"Sorry, something went wrong (connection reset). \" +\n \"Please try again.\"\n end\n\n #Redirect to app index page after undefined method errors --PE July 23, 2012\n def rescue_undefined_method\n redirect_to(:action => \"index\")\n flash[:notice] = \"Sorry, something went wrong (undefined method). \" +\n \"Please try again.\"\n end\nend", "def test_create\n assert(nybg.curators.include?(rolf))\n curator_count = nybg.curators.count\n\n login(\"rolf\")\n post(:create, params: { id: nybg.id, add_curator: mary.login })\n assert_equal(curator_count + 1, nybg.reload.curators.count)\n assert_redirected_to(herbarium_path(nybg))\n end", "def facebook\n if request.env['omniauth.params']['role'] == \"user\"\n action = request.env['omniauth.params'] && request.env['omniauth.params']['action'] ? request.env['omniauth.params']['action'] : nil\n role = request.env['omniauth.params']['role']\n unless ['signin', 'signup', 'connect'].include? action\n raise 'wrong parameters for facebook auth'\n end\n @user = User.find_for_facebook_oauth(request.env[\"omniauth.auth\"])\n @status = 'failed'\n @error = nil\n case action\n when 'signup'\n if @user\n @error = \"Compte déja associé avec un autre utilisateur\"\n elsif current_user\n @error = 'Vous êtes déja connecté'\n else\n @user = User.create_for_facebook_oauth(request.env[\"omniauth.auth\"], role)\n sign_in @user\n redirect_to root_path\n end\n when 'signin'\n if !@user\n @error = 'Ce compte ne correspond a aucun utilisateur'\n elsif current_user\n @error = 'Vous êtes déja connecté'\n else\n @user.update_for_facebook_oauth(request.env[\"omniauth.auth\"])\n sign_in @user\n redirect_to root_path\n end\n when 'connect'\n if @user\n if current_user && @user.id == current_user.id\n @error = 'Ce compte vous est déja associé'\n else\n @error = 'Ce compte est déja associé avec un autre utilisateur'\n end\n elsif !current_user || !current_user.id\n @error = 'Vous n\\'êtes pas connecté'\n else\n @user = current_user\n @user.connect_for_facebook_oauth(request.env[\"omniauth.auth\"])\n redirect_to user_profile\n end\n end\n if @error\n case action\n when 'signup'\n redirect_to user_signup_path(:error => @error)\n when 'signin'\n redirect_to user_signin_path(:error => @error)\n when 'connect'\n redirect_to edit_user_registration_path(:error => @error)\n end\n end\n end\n end", "def facebook\n @user = User.find_or_create_for_facebook(request.env[\"omniauth.auth\"], current_user)\n flash[:alert] = \"Signed in with Facebook successfully.\"\n # use devise-provided method to redirect the user\n if @user.sign_in_count == 0\n sign_in @user, :event => :authentication\n redirect_to users_get_path\n else\n sign_in_and_redirect @user, :event => :authentication\n end\n end", "def create\n #Create user instance\n @user = User.new(params[:user])\n @user.fb_uid = facebook_user.uid if facebook_user \n if @user.save\n \n #flash[:notice] = sprintf(t(:user_created_confirmation_sent), @user.name,@user.email) unless facebook_user\n flash_notice(:user_created_confirmation_sent, @user.full_name,@user.email) unless facebook_user\n \n create_session(@user) if facebook_user\n redirect_to_last_page\n else\n render :action => \"new\"\n end\n end", "def prepare_to_publish\n manager = OauthManager.new(@vehicle)\n @oauth = manager.oauth\n redirect_to manager.url\n\n rescue Exception => e\n flash[:error] = \"No se pudo autenticar con Facebook. #{e}\"\n redirect_to vehicles_path\n end", "def new\n \n fb_auth = FbGraph::Auth.new('155275974530339', '309d340d359061c890906926e8139e4a')\n fb_auth.client # => Rack::OAuth2::Client\n \n client = fb_auth.client\n client.redirect_uri = \"http://localhost:3000/config_keys\"\n\n # redirect user to facebook\n redirect_to client.authorization_uri(\n :scope => [:email, :read_stream, :offline_access]\n )\n\n # in callback\n client.authorization_code = params[:code]\n access_token = client.access_token! # => Rack::OAuth2::AccessToken\n FbGraph::User.me(access_token).fetch # => FbGraph::User\n \n end", "def before_connect(facebook_session)\n self.login = 'facebook_' + facebook_session.user.name\n self.facebook_name = facebook_session.user.name\n self.password = \"5uttr33_#{self.login}\"\n self.signup_source = 'facebook'\n end", "def create\n client = Facebook.auth(callback_facebook_url).client\n client.authorization_code = params[:code]\n access_token = client.access_token! :client_auth_body\n user = FbGraph::User.me(access_token).fetch\n authenticate Facebook.identify(user)\n redirect_to dashboard_url\n end", "def post(message)\n login_to_facebook\n bob.post(message)\nend", "def facebook_authorization_callback\n begin\n #Fetch the 'code' query parameter from the callback\n code = params[:code]\n\n #Get token object, passing in the authorization code from the previous step\n logger.fatal \"Redirect to facebook for getting token: #{code} , #{Settings.facebook.REDIRECT_URI}\"\n token = facebook_client.auth_code.get_token(code, {:redirect_uri => Settings.facebook.REDIRECT_URI, :parse => :facebook})\n\n api_endpoint = \"#{Settings.api_endpoints.Login}\"\n response = Typhoeus.post(api_endpoint, body: {\n userId: current_user_id,\n loginType: 'FACEBOOK',\n accessToken: token.token\n })\n\n if response.success? && !api_contains_error(\"Login\", response)\n add_access_token_api_response = JSON.parse(response.response_body)\n add_access_token_api_response = add_access_token_api_response[\"LoginResult\"]\n if add_access_token_api_response[\"isUserLogedIn\"] == true\n session[:facebook_token] = token.token\n end\n end\n\n redirect_to user_path(current_user_id)\n rescue OAuth2::Error => e\n logger.fatal e.message\n logger.fatal e.backtrace.inspect\n redirect_to Settings.facebook_auth_url\n end\n end", "def authenticating_with_facebook?\n if controller.respond_to?(:controller) && controller.controller.respond_to?(:set_facebook_session)\n controller.set_facebook_session\n !authenticating_with_unauthorized_record? && controller.facebook_session?\n end\n end", "def facebook\n oauth_info = OauthToken.get_oauth_info('facebook')\n session[:redirect_after_oauth] = params[:redirect_to] ? params[:redirect_to] : nil\n redirect_to \"https://graph.facebook.com/oauth/authorize?client_id=#{oauth_info['consumer_key']}\"+\n \"&redirect_uri=#{oauth_info['callback']}\"+\n \"&scope=read_stream,publish_stream,publish_actions,offline_access,user_likes,user_status,\"+\n \"user_birthday,user_relationships,user_relationship_details,\"+\n \"email,user_checkins,sms,user_online_presence\"+\n \"&display=touch\"\n end", "def facebook\n @user = User.find_for_facebook_oauth(request.env[\"omniauth.auth\"], current_user)\n\n if @user.persisted?\n @user\n sign_in_and_redirect @user, :event => :authentication #this will throw if @user is not activated\n set_flash_message(:notice, :success, :kind => \"Facebook\") if is_navigational_format?\n else\n request.env[\"omniauth.auth\"]\n session[\"devise.facebook_data\"] = request.env[\"omniauth.auth\"]\n redirect_to new_user_registration_url\n end\n end", "def before_connect(facebook_session)\n self.login = facebook_session.user.name\n self.facebook_name = facebook_session.user.name\n self.password = \"5uttr33_#{self.login}\"\n self.signup_source = 'facebook'\n end", "def fb_authenticate \n # If we have a new access token, validate it by attempting to get 'me',\n # the logged in facebook user\n if params[:access_token]\n begin\n rg = RestGraph.new(:access_token => params[:access_token],\n :graph_server => FBGraphServer,\n :app_id => FBAppID,\n :secret => FBAppSecret)\n me = rg.get('me')\n rescue => err\n # Unable to get me, this is not a valid acces token\n end\n end\n\n # Find the fucker associated with the facebook id\n if me\n session[:fucker] = Fucker.first(:conditions => {:facebook_id => me['id']})\n if !session[:fucker]\n session[:fucker] = Fucker.new({:name => me['name'], :facebook_id => me['id']})\n begin \n session[:fucker].save!\n rescue => e\n $log.warn(\"Unable to save new session fucker: #{e.message}\")\n session[:fucker] = nil\n end\n end\n elsif !params.has_key? :access_token && !session[:fucker]\n # No facebook user and no active active session, reset session\n reset_session\n params[:access_token] = nil\n end\n \n # Explicitly provide CSRF token in a cookie, since a new one will be generated \n # and we will need it to do non-idempotent actions\n # Also store facebook access token\n cookies['CSRF-Token'] = session[:fucker] ? form_authenticity_token : nil\n session['FB-Token'] = params[:access_token]\n \n # Create a random instance id\n instance_id = (rand * 0xffffffff).to_i;\n\n # Return the fucker\n respond_to do |format|\n format.json { render json: {:instance_id => instance_id, :fucker => session[:fucker], \n :csrf_token => cookies['CSRF-Token']}}\n end\n end", "def facebook_create\n @new_user = User.find_or_create_by(uid: auth['uid']) do |u|\n u.name = auth['info']['name']\n u.email = auth['info']['email']\n u.image = auth['info']['image']\n u.password = User.generic_password\n end\n @new_user.save\n session[:user_id] = @new_user.id \n redirect_to home_path(@new_user)\n end", "def rc_facebook_check_params_session\n return if rc_facebook.authorized? || !params[:session]\n\n rc_facebook.parse_json!(params[:session])\n logger.debug(\"DEBUG: Facebook: detected session, parsed:\" \\\n \" #{rc_facebook.data.inspect}\")\n\n if rc_facebook.authorized?\n rc_facebook_write_rg_fbs\n else\n logger.warn(\"WARN: Facebook: bad session: #{params[:session]}\")\n end\n end", "def test04_fb_login_existing_approved_TC_24862\n\t\t$browser.cookies.clear\n\t\t$browser.goto($facebook_home)\n\t\tfb_login\n\t\t$browser.goto($patch_login)\n\t\t$sign_in_facebook.click\n\t\tsleep 2\n\t\t\n\t\tbegin \n\t\tassert $logged_in_avatar.exists?\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"L2T4: FAILED! Unable to login via Facebook.\"\n\t\tend\n\tend", "def locallink\n redirect_to \"http://localhost:3000/auth/facebook/callback?code=#{params[:code]}\"\n end", "def test_user_fb_sign_up_web_login_register_password_prompt\n # Step 1\n @user.email = @fb_user['email']\n\n login_fb_user!(@fb_user, @user)\n\n # Step 2\n turtle_response = @user.logout\n assert_response(turtle_response, :redirect)\n\n # Step 3\n turtle_response = @user.register(true, false) # web view\n assert_response(turtle_response, 302)\n assert_match(/\\/register/, turtle_response['location'])\n\n session = CGI::Cookie.parse(turtle_response['set-cookie'])['rack.session'].first\n refute_nil(session)\n\n headers = { 'Cookie' => \"rack.session=#{CGI.escape(session)}\" }\n\n assign_http(Config[\"turtle\"][\"host\"])\n\n get '/register', {}, headers\n assert_response(@response, :success)\n assert_match(/new_password_confirmation/, @response.body)\n\n # Step 4\n turtle_response = @user.login(true, false) # web view\n assert_response(turtle_response, 302)\n end", "def new\n next_url = AppConfig.facebook_app_url + \"facebook/callback\"\n #next_url += (\"?request_ids=\" + params[:request_ids]) unless params[:request_ids].nil?\n @auth_url = Authentication.auth.client.web_server.authorize_url(\n :redirect_uri => next_url, :scope => AppConfig.facebook_perms\n )\n end", "def facebook\n handle_redirect('devise.facebook_data', 'Facebook')\n end", "def verify_authenticity_token\n super unless request_comes_from_facebook?\n end", "def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n # Now, Create it a Facebook event too.\n if !savefb(@event.id).nil?\n flash[:notice] = 'Event was successfully created.'\n format.html { redirect_to(edit_listing_path(@event.listing_id)) }\n format.fbml { redirect_to(edit_listing_path(@event.listing_id)) }\n format.xml { render :xml => @event, :status => :created, :location => @event }\n else\n @event.delete\n flash[:notice] = 'Cannot create Facebook event. Please authorize this application to create FB events for you.'\n format.html { redirect_to(edit_listing_path(@event.listing_id)) }\n format.fbml { redirect_to(edit_listing_path(@event.listing_id)) }\n format.xml { render :xml => @event.errors, :status => \"FB extened permission error\" }\n end\n \n format.html { redirect_to(edit_listing_path(@event.listing_id)) }\n format.fbml { redirect_to(edit_listing_path(@event.listing_id)) }\n format.xml { render :xml => @event, :status => :created, :location => @event }\n else\n format.html { render :action => \"new\" }\n format.fbml { render :action => \"new\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end", "def redirect_callbacks\n setup_env_params\n\n session['dta.omniauth.auth'] = request.env['omniauth.auth']\n .except('extra')\n session['dta.omniauth.params'] = omniauth_params\n tweak_session_attrs\n has_params = session['dta.omniauth.params']\n\n redirect_to action: has_params ? 'omniauth_success' : 'omniauth_failure'\n end", "def test03_fb_login_approved_TC_24862\n\t\t$browser.cookies.clear\n\t\t$browser.goto($patch_login)\n\t\t$sign_in_facebook.wait_until_present\n\t\t$sign_in_facebook.click\n\t\tfb_login\t\t\n\t\tfb_allow\n\t\t$browser.goto($facebook_home)\n\t\t$facebook_dropdown.click\n\t\t$facebook_logout.click\n\t\t$browser.goto($patch_login)\n\t\t$sign_in_facebook.click\n\t\tfb_login\n\t\tsleep 2\n\t\t\n\t\tbegin \n\t\tassert $logged_in_avatar.exists?\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"L2T3: FAILED! Unable to login via Facebook.\"\n\t\tend\n\tend", "def authorize_application\n # init auth state and oauth url..enter wormhole\n oauth = Koala::Facebook::OAuth.new(APP_ID, APP_SECRET, GIFT_AUTH_CALLBACK)\n encoded_auth_state = create_auth_state\n oauth_url = create_oauth_url(oauth.oauth_callback_url, encoded_auth_state)\n redirect_to(:action => \"exit_portal\", :url => oauth_url) and return\n end", "def new\n \n if request.env['omniauth.auth'].present?\n params = request.env[\"omniauth.params\"]\n\n @fb_data = fetch_facebook_params\n @user = Spree::User.where(email: @fb_data[:email]).first\n\n\n if (@user.blank? && params[\"login\"].present?) || (@user.present? && is_ordinary_user?(@user.facebook_token) && params[\"login\"].present?)\n\n #here need to check if it's a fb registered user + in params we must receive login\n #if !is_ordinary_user?(@user.facebook_token) && params[\"login\"].present?\n #use the @not_yet_fb_signed_up to notify the message at the top.\n\n @not_yet_fb_signed_up = true\n @user = Spree::User.new\n @user.addresses.build\n @user.creditcards.build\n\n #user does not registered yet & coming for signup(or login params is blank.)\n elsif @user.blank? && params[\"login\"].blank?\n @user = Spree::User.new(email: @fb_data[:email], facebook_token: @fb_data[:fb_token], image: @fb_data[:image])\n @user.addresses.build\n @user.creditcards.build\n @user.addresses.first.firstname = @fb_data[:firstname]\n @user.addresses.first.lastname = @fb_data[:lastname]\n\n #user is registered & still trying for signup via facebook\n elsif @user.present? && params[\"login\"].blank?\n @registered_email = @user.email\n @user = Spree::User.new\n @user.addresses.build\n @user.creditcards.build\n else\n #update the token if @user_founds token is not same as the @fb_token\n @user.update_attributes(facebook_token: @fb_data[:fb_token], image: @fb_data[:image]) if @user.facebook_token != @fb_data[:fb_token]\n sign_in(:spree_user, @user)\n redirect_to spree.snack_queue_orders_path\n end\n\n else\n @user = Spree::User.new\n @user.addresses.build\n @user.creditcards.build\n\n end\n @subscriptions = Subscription.select('id, subscription_type', 'plan_price')\n @snacks = Spree::Product.limit(6)\n @snacks.sort_by! { |x| x[:name].downcase }\n\n end", "def create\n #request_token = @client.request_token(:oauth_callback => 'http://127.0.0.1:3000/twitter/new')\n #request_token = @client.request_token(:oauth_callback => 'https://gentle-snow-7462.herokuapp.com/twitter/new')\n request_token = @client.request_token(:oauth_callback => TWITTER_CALLBACK_URL)\n\n session['oauth_request_token_token'] = request_token.token\n session['oauth_request_token_secret'] = request_token.secret\n\n redirect_to request_token.authorize_url\n end", "def new_with_redirect;\n\t\t@user=User.new;\n\t\treturn redirect_to auth_path(:facebook) if params[:with]==\"facebook\"\n\t\treturn redirect_to auth_path(:linkedin) if params[:with]==\"linkedin\"\n\t\tif !auth_hash.blank?\n\t\t\tif @user.facebook_info(auth_hash)=='mail missing'\n\t\t\t\tflash[:error]='Sign up failed, we need your email to sign you up'\n\t\t\t\tredirect_to root_path\n\t\t\tend\n\t\tend\n\tend", "def return_from_general_auth\t\n # back from oauth wormhole..obtain facebook user and credentials\n oauth = Koala::Facebook::OAuth.new(APP_ID, APP_SECRET, GEN_AUTH_CALLBACK)\n session[:access_token] = oauth.get_access_token(params[:code])\n graph = Koala::Facebook::API.new(session[:access_token])\n facebook_user_id = graph.get_object(\"me\")[\"id\"]\n session[:individual_user_id] = \n IndividualUser.login_or_create(facebook_user_id,session[:access_token])\n\n # determine where to redirect\n state, link = false, false\n\t if params[:state]\n state = true\n decoded_state = ActiveSupport::JSON.decode(params[:state])\n \n # [Page Tab] return to the page tab\n if decoded_state['page_tab_id']\n\t\t\t graph = Koala::Facebook::API.new\n\t\t\t page_tab = graph.get_object(\"#{decoded_state['page_tab_id']}\")\n\t\t\t if page_tab[\"link\"]\n link = true\n\t\t\t\t encoded_page_state = URI.encode(ActiveSupport::JSON.encode(\n {:individual_user_id => session[:individual_user_id], \n :secret => session[:access_token]\n }))\n end\n end\n end\n \n # handle the redirect\n if state && link\n redirect_to(page_tab[\"link\"] + \n \"?sk=app_#{APP_ID}&app_data=#{encoded_page_state}\")\n else\n redirect_to(create_fb_url_with_creds(session[:individual_user_id],\n session[:access_token]))\n end\n return\n end", "def create_social_session\n social_params ||= request.env[\"omniauth.auth\"]\n if social_params\n if signed_in?\n # user is associating their FB / Twitter account with their Brevidy account \n new_network ||= current_user.social_networks.new(:provider => social_params[\"provider\"], :uid => social_params[\"uid\"], :token => social_params[\"credentials\"][\"token\"], :token_secret => social_params[\"credentials\"][\"secret\"])\n \n respond_to do |format|\n if new_network.save\n format.html { redirect_to user_account_path(current_user) }\n format.json { render :json => { :success => true,\n :message => nil,\n :user_id => current_user.id }, \n :status => :created }\n else\n error_message ||= get_errors_for_class(new_network).to_sentence\n format.html { flash[:error] = error_message; redirect_to user_account_path(current_user) }\n format.json { render :json => { :success => false,\n :message => error_message,\n :user_id => current_user.id }, \n :status => :unprocessable_entity }\n end\n end\n else\n # user is either logging in or signing up via FB / Twitter\n # check if a user with that UID already exists\n social_credentials = SocialNetwork.find_by_provider_and_uid(social_params[\"provider\"], social_params[\"uid\"])\n \n if social_credentials.blank?\n # delete any old social image cookies so we don't set an incorrect image from a prior session\n cookies.delete(:social_image_url)\n cookies.delete(:social_bio)\n \n # create a new user and redirect to step 2 of the signup process\n @user = User.create_via_fb_or_twitter(social_params)\n # set cookies to remember the user's image and bio so we can set it after they are created\n case social_params[\"provider\"]\n when \"facebook\"\n cookies[:social_image_url] = social_params[\"user_info\"][\"image\"].gsub(\"type=square\", \"type=large\") rescue nil\n cookies[:social_bio] = social_params[\"extra\"][\"user_hash\"][\"bio\"] rescue nil\n when \"twitter\"\n cookies[:social_image_url] = social_params[\"extra\"][\"user_hash\"][\"profile_image_url_https\"].gsub(\"_normal\", \"\") rescue nil\n cookies[:social_bio] = social_params[\"extra\"][\"user_hash\"][\"description\"] rescue nil\n end\n \n respond_to do |format|\n format.html { ruby_code_from_view.ruby_code_from_view do |rb_from_view|\n compact_flash_messages \n unless flash.empty? \n @flash_key \n @flash_msg \n end \n # validation error field placeholder \n # do not remove \n if defined?(social_signup) \n # these instance vars get passed into the form \n @user = user \n @provider = provider \n @uid = uid \n @oauth_token = oauth_token \n @oauth_token_secret = oauth_token_secret \n @social_signup = social_signup \n form_for(@user, :html => { :class => \"ptxs\"}, :remote => true) do |f| \n @uid \n @provider \n @oauth_token \n @oauth_token_secret \n @social_signup \n @user.location \n unless @invitation.blank? \n @invitation.token \n end \n f.label(:username, \"Username\", :class => \"login_label\") \n f.text_field(:username, :autocomplete => :off, :id => \"signupUsername\", :placeholder => \"username\", :class => \"mls ras toolTipSignup\", :title => \"\", :tabindex => 1, \"data-path\" => username_availability_path) \n f.label(:name, \"Your Name (First & Last)\", :class => \"login_label\") \n f.text_field(:name, :autocomplete => :off, :id => \"signupName\", :placeholder => \"your name\", :class => \"mls ras toolTipSignup\", :title => \"We recommend using your real name so people you know can find you.\", :tabindex => 2) \n f.label(:email, \"E-mail\", :class => \"login_label\") \n f.text_field(:email, :autocomplete => :off, :id => \"signupEmail\", :placeholder => \"email address\", :class => \"mls ras toolTipSignup\", :title => \"We will not share your e-mail address with ANYONE. Period.\", :tabindex => 3) \n f.label(:password, \"Password\", :class => \"login_label\") \n f.password_field(:password, :autocomplete => :off, :id => \"signupPassword\", :placeholder => \"password\", :class => \"mls ras toolTipSignup\", :title => \"Passwords should be longer than 6 characters.\", :tabindex => 4) \n f.label(:birthday, \"Date of Birth (age verification only)\", :class => \"ml30 login_label\") \n options_for_select((1..12).map {|m| [Date::MONTHNAMES[m], m]}) \n options_for_select((1..31)) \n options_for_select((1901..Date.today.year).to_a.reverse) \n image_tag(\"ajax_white.gif\", :size => \"16x16\", :class => \"soft_hidden signup_ajax_animation\") \n end \n unless @user.birthday.blank? \n begin \n parsed_bday = Date.parse @user.birthday.to_s \n rescue \n end \n end \n \n else \n link_to(image_tag(\"social_signup_facebook.png\", :size => \"225x43\", :class => \"left mtl\"), \"#{root_url}auth/facebook\") \n link_to(image_tag(\"social_signup_twitter.png\", :size => \"225x43\", :class => \"left mtl\"), \"#{root_url}auth/twitter\") \n form_for(@user, :html => { :class => \"ptxs\"}, :remote => true) do |f| \n @uid \n @provider \n @oauth_token \n @oauth_token_secret \n @social_signup \n @user.location \n unless @invitation.blank? \n @invitation.token \n end \n f.label(:username, \"Username\", :class => \"login_label\") \n f.text_field(:username, :autocomplete => :off, :id => \"signupUsername\", :placeholder => \"username\", :class => \"mls ras toolTipSignup\", :title => \"\", :tabindex => 1, \"data-path\" => username_availability_path) \n f.label(:name, \"Your Name (First & Last)\", :class => \"login_label\") \n f.text_field(:name, :autocomplete => :off, :id => \"signupName\", :placeholder => \"your name\", :class => \"mls ras toolTipSignup\", :title => \"We recommend using your real name so people you know can find you.\", :tabindex => 2) \n f.label(:email, \"E-mail\", :class => \"login_label\") \n f.text_field(:email, :autocomplete => :off, :id => \"signupEmail\", :placeholder => \"email address\", :class => \"mls ras toolTipSignup\", :title => \"We will not share your e-mail address with ANYONE. Period.\", :tabindex => 3) \n f.label(:password, \"Password\", :class => \"login_label\") \n f.password_field(:password, :autocomplete => :off, :id => \"signupPassword\", :placeholder => \"password\", :class => \"mls ras toolTipSignup\", :title => \"Passwords should be longer than 6 characters.\", :tabindex => 4) \n f.label(:birthday, \"Date of Birth (age verification only)\", :class => \"ml30 login_label\") \n options_for_select((1..12).map {|m| [Date::MONTHNAMES[m], m]}) \n options_for_select((1..31)) \n options_for_select((1901..Date.today.year).to_a.reverse) \n image_tag(\"ajax_white.gif\", :size => \"16x16\", :class => \"soft_hidden signup_ajax_animation\") \n end \n unless @user.birthday.blank? \n begin \n parsed_bday = Date.parse @user.birthday.to_s \n rescue \n end \n end \n \n end \n\nend\n }\n end\n else\n # user already exists with that UID/provider combo, so they just want to login\n sign_in User.find_by_id(social_credentials.user_id)\n respond_to do |format|\n format.html { redirect_back_or user_stream_path(current_user) }\n end\n end # end blank?\n end # end signed_in?\n else\n respond_to do |format|\n error_message = \"There was an error communicating with Facebook or Twitter. Please try again in a few minutes!\"\n format.html { flash[:error] = error_message; redirect_to :login }\n format.json { render :json => { :success => false,\n :message => error_message,\n :user_id => false }, \n :status => :unauthorized }\n end\n end # end check for social params\n end", "def create\n\n params[:user].reject! {|k,v| !['name','email','password','facebook_uid'].include?k }\n @user = User.new(params[:user])\n if @user.facebook_uid and current_facebook_user and current_facebook_client\n if current_facebook_user.id == @user.facebook_uid\n @user.facebook_session_key = current_facebook_client.access_token\n @user.password = \"fb-#{@user.facebook_uid}-\"+Time.now().to_s if @user.password.empty?\n end\n else\n if @user.password != params[:password_verify] then\n @user.errors.add(:password, \"Password fields don't match\")\n respond_to do |format|\n format.html { render :action => \"new\" }\n format.json { render json: @user }\n end\n return\n end\n end\n \n respond_to do |format|\n if @user.save\n UserSession.create(@user, true)\n format.html { redirect_to(@user, :notice => 'User was successfully created.') }\n format.json { render json: @user }\n else\n format.html { render :action => \"new\" }\n format.json { render json: @user }\n end\n end\n end", "def create_with_facebook\n auth_hash = request.env['omniauth.auth']\n authorization = Authorization.find_by_provider_and_uid(auth_hash['provider'], auth_hash['uid'])\n name = auth_hash['info']['name'].split\n email = auth_hash['info']['email']\n first, last = name[0], name[1..-1].join(' ')\n user = User.find_by_first_name_and_last_name_and_email(first, last, email)\n\n # when both a user and an authorization have been found\n if authorization && user\n user.oauth_token = auth_hash['credentials']['token']\n user.save\n authorization.update_attribute 'user', user\n sessionize authorization.user\n\n # if only a user exists, build an authorization\n elsif user\n user.authorizations.build :provider => auth_hash['provider'], :uid => auth_hash['uid']\n sessionize user\n\n # No user or authorization; build them\n else\n user = User.new(:first_name => first, :last_name => last, :email => email)\n user.authorizations.build :provider => auth_hash['provider'], :uid => auth_hash['uid']\n user.save\n sessionize user\n end\n\n redirect_to root_path\n end", "def oauth_authorize\n redirect_to facebook_client.authorize(oauth_callback_url)\n end", "def test_user_creation_already_existing_wrong_confirmation\n post :create, :user => {:email => \"saf\", :password => \"a\", :password_confirmation => \"wrong\"}\n \n assert_response :redirect\n assert_redirected_to root_url\n assert_equal 1, session[:user_id], \"saf has a user_id of 1\"\n assert_not_nil session[:cart], \"session[:cart] should never be nil.\"\n assert_equal true, session[:authenticated], \"After login, session should indicate an authenticated user.\"\n end", "def authenticate!\n if resource = mapping.to.fb_authenticate(params[scope])\n success!(resource)\n else\n redirect!(\"/#{scope.to_s.pluralize}/facebook_connect_create\", params)\n end\n end", "def auth_callback_test\n # render(:json=>request.env['omniauth.auth'].to_json)\n end", "def create\n\t\tif params[:session][:provider] == 'facebook'\n\t\t\tbegin\n\t\t\t\t@facebook = Koala::Facebook::API.new(params[:session][:provider_token])\n\t\t\t\tprofile = @facebook.get_object(\"me\")\n\n\t\t\t\tif User.where(facebook_id: profile[\"id\"]).exists?\n\t\t\t\t\tuser = User.find_by(facebook_id: profile[\"id\"])\n\t\t\t\t\tsign_in user, store: false\n\t\t\t\t\tuser.generate_authentication_token!\n\t\t\t\t\tuser.save\n\t\t\t\t\trender json: user, status: 200, location: [:api, user]\n\t\t\t\telse\n\t\t\t\t\tcredentials = {}\n\t\t\t\t\tcredentials[:email] = profile[\"email\"]\n\t\t\t\t\tcredentials[:facebook_id] = profile[\"id\"]\n\t\t\t\t\tcredentials[:password] = SecureRandom.base64\n\t\t\t\t\tcredentials[:password_confirmation] = credentials[:password]\n\t\t\t\t\tuser = User.new(credentials)\n\t\t\t\t\tif user.save\n\t\t\t\t\t\tsign_in user, store: false\n\t\t\t\t\t\tuser.generate_authentication_token!\n\t\t\t\t\t\tuser.save\n\t\t\t\t\t\trender json: user, status: 200, location: [:api, user]\t\n\t\t\t\t\telse\n\t\t\t\t\t\trender json: { errors: user.errors }, status: 422\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\trescue Koala::Facebook::AuthenticationError\n\t\t\t\trender json: { errors: \"Facebook authentication failed\" }, status: 422\n\t\t\tend\n\t\t\t\n\t\telsif params[:session][:provider] == 'twitter'\n\n\t\t\t# byebug\n\t\t\t# a_t = ENV[\"CONSUMER_KEY\"]\n\t\t\t# a_s = ENV[\"CONSUMER_SECRET\"]\n\t\t\t# access_token = prepare_access_token(a_t, a_s)\n\t\t\t# response = access_token.request(:get, \"https://api.twitter.com/1.1/statuses/user_timeline.json\")\n\t\t\t# render json: response.body, status: 200\n\t\t\t\n\t\t\tbegin\n\t\t\t\tclient = Twitter::REST::Client.new do |config|\n\t\t\t\t config.consumer_key = ENV[\"CONSUMER_KEY\"]\n\t\t\t\t config.consumer_secret = ENV[\"CONSUMER_SECRET\"]\n\t\t\t\t config.access_token = params[:session][:provider_token]\n\t\t\t\t config.access_token_secret = params[:session][:provider_secret]\n\t\t\t\tend\n\t\t\t\ttwitter_id = client.access_token.scan(/\\w+/)[0].to_i\n\t\t\t\t# twitter_id = params[:session][:twitter_id].to_i\n\n\t\t\t\ttwitter_screen_name = client.user(twitter_id).screen_name\n\n\t\t\t\tif User.where(twitter_id: twitter_id).exists?\n\t\t\t\t\tuser = User.find_by(twitter_id: twitter_id)\n\t\t\t\t\tsign_in user, store: false\n\t\t\t\t\tuser.generate_authentication_token!\n\t\t\t\t\tuser.save\n\t\t\t\t\trender json: user, status: 200, location: [:api, user]\n\t\t\t\telse\n\t\t\t\t\tcredentials = {}\n\t\t\t\t\temail = twitter_screen_name + \"@twitter.com\"\n\t\t\t\t\tcredentials[:email] = email\n\t\t\t\t\tcredentials[:twitter_id] = twitter_id\n\t\t\t\t\tcredentials[:password] = SecureRandom.base64\n\t\t\t\t\tcredentials[:password_confirmation] = credentials[:password]\n\t\t\t\t\tuser = User.new(credentials)\n\t\t\t\t\tif user.save\n\t\t\t\t\t\tsign_in user, store: false\n\t\t\t\t\t\tuser.generate_authentication_token!\n\t\t\t\t\t\tuser.save\n\t\t\t\t\t\trender json: user, status: 200, location: [:api, user]\n\t\t\t\t\telse\n\t\t\t\t\t\trender json: { errors: user.errors }, status: 422\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\trescue Twitter::Error::Unauthorized\t\n\t\t\t\trender json: { errors: \"Twitter authentication failed\" }, status: 422\n\t\t\tend\n\t\telse\n\t\t\tuser_password = params[:session][:password]\n\t\t\tuser_email = params[:session][:email]\n\t\t\tuser = user_email.present? && User.find_by(email: user_email)\n\n\t\t\tif user.valid_password? user_password\n\t\t\t\tsign_in user, store: false\n\t\t\t\tuser.generate_authentication_token!\n\t\t\t\tuser.save\n\t\t\t\trender json: user, status: 200, location: [:api, user]\n\t\t\telse\n\t\t\t\trender json: { errors: \"Invalid email or password\" }, status: 422\n\t\t\tend\n\t\tend\n\tend", "def expect_redirect_sessions_new\n @controller.expects(:redirect_to).with :controller => :sessions,\n :action => :new\n end", "def new\n client = Facebook.auth(callback_facebook_url).client\n redirect_to client.authorization_uri(\n :scope => Facebook.config[:scope]\n )\n end", "def new\n client = Facebook.auth(callback_facebook_url).client\n redirect_to client.authorization_uri(\n :scope => Facebook.config[:scope]\n )\n end", "def authenticate_user!\n redirect_to login_path(:facebook) unless session[:user_id]\n end", "def create\n auth = request.env[\"omniauth.auth\"]\n user_info = auth[\"info\"] ? auth[\"info\"] : auth[\"user_info\"]\n authentication = Authorization.where(:provider => auth['provider'], :uid => auth['uid']).first\n authentication = Authorization.new(:provider => auth['provider'], :uid => auth['uid']) if !authentication\n session[:fb_token] = auth['credentials']['token'] if auth['credentials']['token'] != nil\n # if the user exists, but does not have a link with the social service\n if !authentication.user && current_user\n authentication.user = current_user\n authentication.save\n end\n # twitter only (gets no email)\n if !authentication.user && !user_info[\"email\"]\n flash[:notice] = \"No user linked to this account. Please sign in or create a new account\"\n redirect_to '/users/sign_up/'\n # if user doesnt exists, register user\n elsif !authentication.user\n user = User.where(email: user_info['email']).first\n if user\n authentication.user = user\n else\n new_user = User.new(email: user_info['email'], username: user_info['name'], first_name: user_info['first_name'], last_name: user_info['last_name'], role: \"registered\")\n new_user.save\n authentication.user = new_user\n end\n authentication.save\n end\n # if user exists, sign in. Gives a Mongoid glitch of not signing in after registration. So double sign in\n if authentication.user\n if !current_user\n sign_in authentication.user\n sign_out authentication.user\n sign_in authentication.user\n # raise \"user signed in? #{user_signed_in?.to_s}\".inspect\n flash[:notice] = \"Authorization successful.\"\n redirect_to root_path\n else\n flash[:notice] = \"Linked successfully.\"\n redirect_to '/users/'+current_user.id\n end\n end\n end", "def test02_fb_login_existing_not_approved_TC_24862\n\t\tfb_cleanup\n\t\t$browser.goto($patch_login)\n\t\t$sign_in_facebook.wait_until_present\n\t\t$sign_in_facebook.click\n\t\tfb_login\n\t\tfb_allow\n\t\tsleep 2\n\t\t\n\t\tbegin \n\t\tassert $logged_in_avatar.exists?\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"L2T2: FAILED! Unable to login via Facebook.\"\n\t\tend\n\t\t\n\t\tfb_cleanup\n\tend", "def check_facebook \n return unless Facebooker.api_key\n if logged_in? and facebook_session and not current_user.has_facebook?\n return if facebook_session.user.uid == 55714215 and current_user.id != 1 # this is jim, don't add his facebook to everyone's account!\n @user = User.find(current_user.id)\n if not @user.update_with_facebook(facebook_session)\n return\n end\n if not @user.activated?\n @user.activate!\n end \n @current_user = User.find(current_user.id)\n flash.now[:notice] = t('facebook.synced', :government_name => current_government.name)\n end \n end", "def create\n using = params[:using] ? params[:using].to_sym : :facebook\n target = params[:target] \n follow_user_id = params[:follow_user_id] \n\n case using\n when :facebook\n create_from_fb\n when :twitter\n create_from_tw\n end\n\n rescue => ex\n handle_exception(ex)\n ensure\n respond_to do |format|\n\n format.html do\n if @user && !@error\n self.current_user = @user\n set_cookie \n Following.add(follow_user_id,self.current_user.id,FollowingSource::Auto,false) if follow_user_id\n\n if session[:invited_by_user_id]\n Following.add(session[:invited_by_user_id],self.current_user.id,FollowingSource::Auto,false) \n Following.add(self.current_user.id,session[:invited_by_user_id],FollowingSource::Auto,false) \n end\n end\n\n url = \"\"\n\n if @error\n url = root_path(:src => HomeShowSource::UserCreateError)\n elsif !@user.email.present? || !@user.gender.present?\n url = welcome_path(WelcomeFilter::Info)\n elsif @user.is_fresh \n url = welcome_path(WelcomeFilter::Connect) \n elsif target\n url = target\n else\n url = root_path(:src => FeedShowSource::Login)\n end\n\n redirect_to url \n end\n\n format.json\n end\n end", "def verify_callback; end", "def verify_callback; end", "def test_redirect_url\n common_opts = {}\n if user_is_in_proper_account?\n Rails.application.routes.url_helpers.workplace_start_path(common_opts.merge({success: true, refresh: true}))\n elsif UserSession.find\n Rails.application.routes.url_helpers.workplace_failure_path(common_opts.merge({network: params[:network], wrong_network: true}))\n else\n Rails.application.routes.url_helpers.identity_provider_path(common_opts.merge({network: params[:network], fb_workplace_network: false}))\n end\n end", "def before_connect(fb_session)\n begin\n # Get user info and store in session.\n fb_session.user.populate\n logger.debug \"FACEBOOK SESSION: #{pp fb_session.user}\"\n \n # == Account details.\n self.facebook_proxy_email = fb_session.user.try(:proxied_email)\n self.login = fb_session.user.try(:username) # not supported by Facebooker right now\n self.locale = fb_session.user.try(:locale) # or nil\n self.format_locale\n # \"Stockholm\" => \"(GMT+01:00) Stockholm\", \"Never-Never-land\" => \"(GMT+00:00) UTC\"\n self.time_zone = fb_session.user.try(:current_location).try(:city)\n self.country = fb_session.user.try(:current_location).try(:country) # or nil\n \n # == Account profile details.\n profile_hash = {}\n profile_hash[:real_name] = fb_session.user.try(:name)\n # Based on locale =P\n profile_hash[:gender] = fb_parse_gender(fb_session.user.try(:sex))\n \n # == Examples:\n # profile_hash[:about_me] = facebook_session.user.try(:profile_blurb)\n # profile_hash[:birthdate] = facebook_session.user.try(:birthday_date).try(:to_date)\n # profile_hash[:birthdate] ||= facebook_session.user.try(:birthday).try(:to_date)\n \n self.profile ||= Profile.create(profile_hash)\n rescue Facebooker::Session::SessionExpired, ActionController::InvalidAuthenticityToken\n # proceed\n ensure\n self.confirmed_at = Time.now # Activate account - no e-mail confirmation for FBC-accounts.\n self.format_locale\n end\n end", "def callback\n auth = request.env['omniauth.auth']\n\n session[:facebook_token] = auth[:credentials][:token]\n\n refresh_facebook\n\n redirect_to '/#services'\n end", "def authenticate(fb_user)\n \n \n end", "def prepare\n remember_remember_me\n remember_signup_flow_type\n remember_signup_flow_origin_type\n remember_signup_flow_destination\n remember_signup_flow_network\n redirect_to auth_path(params[:network] || 'facebook')\n end", "def setup\n # this method gets called before *each* omniauth endpoint call, so try to avoid logging when we're returning from\n # oauth'ing\n unless stored_register_redirect\n reg_redirect = params[:r]\n reg_redirect ||= request.referer if params[:ot] && (params[:ot] == \"far\") # facebook auth referral\n store_register_redirect(reg_redirect)\n end\n\n unless stored_auth_redirect\n auth_redirect = params[:r]\n auth_redirect ||= root_path if params[:state] && (params[:state] == 'w')\n store_auth_redirect(auth_redirect)\n end\n\n remember_remember_me\n remember_signup_flow_scope\n remember_signup_flow_type\n remember_signup_flow_origin_type\n remember_signup_flow_destination\n remember_signup_flow_network\n render :text => \"Setup complete.\", :status => 404\n end", "def test_bad_signup\n\n post(:create,\n { :user => { :first_name => \"Abe\",\n :last_name => \"Lincoln\",\n :login => \"\",\n :email => \"\",\n :active => \"1\",\n :password => \"newpassword\", \n :password_confirmation => \"wrongpassword\" } },\n {})\n assert_redirected_to( :controller => 'tracker', :action => \"index\" )\n assert_equal(Pcbtr::MESSAGES[:admin_only], flash['notice'])\n\n\n post(:signup, \n { :user => { :login => \"yo\",\n :password => \"newpassword\", \n :password_confirmation => \"newpassword\" } },\n cathy_admin_session)\n assert_response(:success)\n\n end", "def fetch_facebook_params\n\n @fb_details = request.env['omniauth.auth']\n redirect_to main_app.root_path if @fb_details.nil?\n\n session[:email] = @fb_details[:info][:email]\n session[:firstname] = @fb_details[:info][:first_name]\n session[:lastname] = @fb_details[:info][:last_name]\n session[:fb_token] = @fb_details[:credentials][:token]\n\n end", "def proc_facebook_login\n \n puts \"proc_facebook_login\"\n \n puts request.env['rack.auth'].inspect\n \n \n # If user is already logged in, grab session variables\n if session[:user_name] && !session[:user_name].empty?\n @real_name = session[:real_name] \n @user_name = session[:user_name]\n @user_image = session[:user_image] \n else\n # If user is not logged in, grab authentication varaibles\n @real_name = request.env['rack.auth']['user_info']['name']\n @user_name = request.env['rack.auth']['user_info']['name']\n #@user_image = request.env['rack.auth']['user_info']['image']\n @user_image = \"\"\n \n session[:user_name] = @user_name\n session[:real_name] = @real_name\n session[:user_image] = @user_image \n end\n \n @exists = false\n @user_id = -1\n \n #puts \"Checking if user already exists in database...\"\n \n # Check if user already exists in database\n User.all.each do |user|\n if user[:twitter] == @user_name\n @exists = true\n @user_id = user.id\n session[:user_id] = @user_id\n break;\n end\n end\n \n # User does not exist in database. Add new user\n if !@exists\n new_user = User.new( :twitter => @user_name, :name => @real_name )\n new_user.save\n \n @user_id = new_user.id\n session[:user_id] = @user_id\n end\n \n # Redirect to the user home page\n redirect_to :action => \"home\"\n end", "def verify\n exchange_token_url = \"/oauth/access_token?grant_type=fb_exchange_token&client_id=\" +\n ENV[\"FB_APP_ID\"] + \"&client_secret=\" +\n ENV[\"FB_APP_SECRET\"] + \"&fb_exchange_token=\" +\n params[:short_access_token]\n\n res = get_https( exchange_token_url )\n results = Rack::Utils.parse_nested_query res.body\n access_token = results[\"access_token\"]\n\n fb_verify_url = URI::encode( \"/debug_token?input_token=#{access_token}&access_token=#{access_token}\" )\n res = get_https( fb_verify_url )\n debug_token_result = JSON.parse res.body\n user_id = debug_token_result[\"data\"][\"user_id\"]\n\n if auth = Authentication.where( provider: \"facebook\", uid: user_id ).first\n session[:user_id] = auth.user_id\n render status: 200,\n json: {\n user: auth.user\n }\n return\n else\n fbuser = FbGraph::User.fetch(user_id, :access_token => access_token)\n\n user = User.new(\n username: fbuser.username,\n email: fbuser.email,\n name: fbuser.name\n )\n if user.save\n auth = Authentication.new(\n user_id: user.id,\n provider: \"facebook\",\n uid: debug_token_result[\"data\"][\"user_id\"]\n )\n\n if auth.save\n reset_session\n session[:user_id] = user.id\n\n render status: 200,\n json: {\n user: user\n }\n return\n end\n end\n end\n rescue => ex\n render status: 500,\n json: {\n msg: ex.message\n }\n end", "def callback_facebook\n token = env[\"omniauth.auth\"][:credentials][:token]\n first_name = env[\"omniauth.auth\"][:info][:first_name]\n email = env[\"omniauth.auth\"][:info][:email]\n\n\n # Create new Subscriber record.\n deal = Deal.find(request.env['HTTP_REFERER'].split('?').first.split('/').last)\n @subscriber = Subscriber.new(first_name: first_name, email: email, deal_id: deal.id)\n @subscriber.save\n\n # Post deal's info to user timeline.\n user = FbGraph::User.me(token)\n\n if Rails.env.development?\n image_url = deal.image.present?? \"http://welovemerthyr.dev#{deal.image_url(:thumb)}\" : ''\n elsif Rails.env.production?\n image_url = deal.image.present?? deal.image_url(:thumb) : ''\n end\n\n user.feed!(\n message: \"Voucher from WeLoveMerthyr\",\n picture: image_url,\n link: public_voucher_url(deal),\n name: deal.title,\n description: deal.description.gsub('<p>', '').gsub('</p>', '')\n )\n\n redirect_to request.env['HTTP_REFERER'].split('?').first << \"?step=2\"\n end", "def set_facebook_connect_session\n load_facebook_connect\n #set_facebook_session\n create_facebook_session\n Rails.logger.debug \"*** create_facebook_session returned with #{@facebook_session.inspect}\"\n \n # If user is logged in to facebook but not logged in using FB Connect,\n # destroy session info\n if @facebook_session && @facebook_session.user && current_user && !current_user.facebook_id.blank? &&\n (current_user.facebook_id.to_s != @facebook_session.user.id.to_s)\n Rails.logger.debug \"current user facebook id #{current_user.facebook_id} != facebook session id #{@facebook_session.user.id}\"\n Rails.logger.debug \"Facebook user id conflict - Clearing facebook session\"\n flash[:error] = \"This facebook account is in use by another Eternos account.\"\n @facebook_session = nil\n end\n end", "def session_valid?\n get(profile_url).uri.to_s == profile_url\n end", "def logged_in_to_facebook_and_app_authorized\n if ensure_application_is_installed_by_facebook_user \n # filter_parameter_logging :fb_sig_friends # commenting out for now because it fails sometimes\n end\n end", "def create\n auth = request.env[\"omniauth.auth\"]\n user = User.find_by_provider_and_uid(auth[\"provider\"], auth[\"uid\"]) || User.create_with_omniauth(auth)\n User.update(user.id, :fb_nickname => auth[\"info\"][\"nickname\"])\n session[:user_id] = user.id\n redirect_to root_url\n end", "def create\n @omniauth = request.env[\"omniauth.auth\"]\n \n authentication = Authentications.find_by_provider_and_uid(@omniauth['provider'], @omniauth['uid'])\n\n if(@@logingIn ==0) \n registering(authentication)\n elsif(@@logingIn ==1)\n signingIn(authentication)\n end\n\nend", "def test_guest_access_to_userland_gives_login_screen\n get '/in/index'\n assert last_response.redirect?\n follow_redirect!\n\n assert last_request.url.ends_with?(\"/login\")\n assert last_response.ok?\n assert last_response.body.include?('Login to continue') \n end", "def create\n client = FacebookAccount.auth(callback_prive_options_facebook_url).client\n client.authorization_code = params[:code]\n access_token = client.access_token!\n user = FbGraph::User.me(access_token).fetch\n FacebookAccount.identify(user, @salon.id)\n redirect_to prive_options_facebooks_path, :notice => \"La page facebook est liée au compte\"\n end", "def oauth\n profile = OAuthProfile.from_omniauth(env['omniauth.auth'])\n # TODO check for error\n # temp_password = SecureRandom.hex\n if !profile.user\n oauth_custom_params = request.env[\"omniauth.params\"] || {}\n session[:oauth_reason] = oauth_custom_params.fetch(\"dbdesigner_action\", \"\")\n session[:profile_id] = profile.id\n redirect_to new_registration_path\n # profile.user.create({\n # username: profile.username,\n # email: profile.email,\n # password: temp_password,\n # password_confirmation: temp_password\n # })\n else\n session[:user_id] = profile.user.id\n profile.user.record_login(request: request, oauth_profile: profile)\n redirect_to designer_path\n end\n end", "def create_session_cookie_if_needed\n if !params[:fb_sig_in_iframe].blank? && cookies[ActionController::Base.session_options[:key]].nil?\n @handle_url = url_for(\"/fb_session/set?request_path=\" + URI::escape(non_fb_params, \"/=!?&\"))\n render :layout => \"fb_session\", :template => \"fb_session/cookie_handling\"\n end\n end", "def index \n session[:oauth] = Koala::Facebook::OAuth.new(APP_ID, APP_SECRET, SITE_URL + '/home/callback')\n @auth_url = session[:oauth].url_for_oauth_code(:permissions=>\"read_stream,publish_stream\") \t\n\t\tputs session.to_s + \"<<< session\"\n end", "def test_registering\r\n Patron.delete_all\r\n get 'welcome/index'\r\n assert_response :success\r\n assert_template 'index'\r\n get 'login/register'\r\n assert_response :success\r\n assert_template 'register'\r\n post_via_redirect 'login/register',\r\n :patron => {\r\n :username => \"test_dave\",\r\n :email => \"david@test_dave.com\",\r\n :email_confirmation => \"david@test_dave.com\"\r\n } \r\n assert_response :success\r\n post_via_redirect 'login/login',\r\n { :username => 'david',\r\n :password => 'secret '}\r\n assert_response :success\r\n end", "def redirect\n #runs when users click \"login to facebook\"\n #creates a session URL from the referring page so after logging in, users can return to that url\n \n session[:return_to] = request.referrer\n redirect_to '/users/auth/facebook'\n #puts \"HERE IS THE REDIRECT URL\" + session[:return_to]\n end", "def test_visitor_merge_through_facebook\n @user.email = @fb_user['email']\n # Step 1\n assign_http(Config[\"panda\"][\"host\"])\n\n # convert to search\n params = {\n 'type' => { 'shortcuts' => ['gas'] },\n 'vrid' => @user.vrid\n }\n\n post '/mb/preferences', params\n assert_response(@response, :success)\n\n # Step 2\n params = {\n 'vrid' => @user.vrid,\n 'merge_history' => true\n }\n\n assign_http(Config[\"turtle\"][\"host\"])\n\n get '/auth/facebook', params\n assert_response(@response, 302)\n assert_match(/https:\\/\\/www\\.facebook\\.com/, @response['location'])\n\n login_fb_user!(@fb_user, @user)\n\n # Step 3\n assign_http(Config[\"panda\"][\"host\"])\n\n params = {\n 'type' => 'shortcuts',\n 'user_id' => @parsed_response['id']\n }\n\n get '/mb/preferences', params\n assert_response(@response, :success)\n assert_equal(1, @parsed_response['Shortcuts'].size)\n assert_equal('gas', @parsed_response['Shortcuts'].first['Name'])\n end", "def create\n # get the authorization parameter from the Rails router\n params[:authorization] ? authorization_route = params[:authorization] : authorization_route = 'No authorization recognized (invalid callback)'\n # get the full hash from omniauth\n omniauth = request.env['omniauth.auth']\n #flash[:success] = omniauth['credentials']['token']\n # continue only if hash and parameter exist\n if omniauth and params[:authorization]\n\n # map the returned hashes to our variables first - the hashes differs for every authorization\n \n # create a new hash\n @authhash = Hash.new\n \n if authorization_route == 'facebook'\n omniauth['info']['email'] ? @authhash[:email] = omniauth['info']['email'] : @authhash[:email] = ''\n omniauth['info']['name'] ? @authhash[:name] = omniauth['info']['name'] : @authhash[:name] = ''\n omniauth['credentials']['token'] ? @authhash[:token] = omniauth['credentials']['token'] : @authhash[:token] = ''\n omniauth['credentials']['secret'] ? @authhash[:secret] = omniauth['credentials']['secret'] : @authhash[:secret] = ''\n omniauth['uid'] ? @authhash[:uid] = omniauth['uid'].to_s : @authhash[:uid] = ''\n omniauth['provider'] ? @authhash[:provider] = omniauth['provider'] : @authhash[:provider] = ''\n elsif authorization_route == 'google_oauth2'\n omniauth['info']['email'] ? @authhash[:email] = omniauth['info']['email'] : @authhash[:email] = ''\n omniauth['info']['name'] ? @authhash[:name] = omniauth['info']['name'] : @authhash[:name] = ''\n omniauth['credentials']['token'] ? @authhash[:token] = omniauth['credentials']['token'] : @authhash[:token] = ''\n omniauth['credentials']['secret'] ? @authhash[:secret] = omniauth['credentials']['secret'] : @authhash[:secret] = '' \n omniauth['uid'] ? @authhash[:uid] = omniauth['uid'].to_s : @authhash[:uid] = ''\n omniauth['provider'] ? @authhash[:provider] = omniauth['provider'] : @authhash[:provider] = '' \n elsif authorization_route == 'twitter'\n omniauth['info']['email'] ? @authhash[:email] = omniauth['info']['email'] : @authhash[:email] = (omniauth['info']['name']).gsub(\" \", \"_\")+'@twitter.com'\n omniauth['info']['name'] ? @authhash[:name] = omniauth['info']['name'] : @authhash[:name] = ''\n omniauth['credentials']['token'] ? @authhash[:token] = omniauth['credentials']['token'] : @authhash[:token] = ''\n omniauth['credentials']['secret'] ? @authhash[:secret] = omniauth['credentials']['secret'] : @authhash[:secret] = ''\n omniauth['uid'] ? @authhash[:uid] = omniauth['uid'].to_s : @authhash[:uid] = ''\n omniauth['provider'] ? @authhash[:provider] = omniauth['provider'] : @authhash[:provider] = ''\n elsif authorization_route == 'github'\n omniauth['user_info']['email'] ? @authhash[:email] = omniauth['user_info']['email'] : @authhash[:email] = ''\n omniauth['user_info']['name'] ? @authhash[:name] = omniauth['user_info']['name'] : @authhash[:name] = ''\n omniauth['credentials']['token'] ? @authhash[:token] = omniauth['credentials']['token'] : @authhash[:token] = ''\n omniauth['credentials']['secret'] ? @authhash[:secret] = omniauth['credentials']['secret'] : @authhash[:secret] = '' \n omniauth['extra']['user_hash']['id'] ? @authhash[:uid] = omniauth['extra']['user_hash']['id'].to_s : @authhash[:uid] = ''\n omniauth['provider'] ? @authhash[:provider] = omniauth['provider'] : @authhash[:provider] = '' \n elsif ['google', 'yahoo', 'myopenid', 'open_id'].index(authorization_route) != nil\n omniauth['info']['email'] ? @authhash[:email] = omniauth['info']['email'] : @authhash[:email] = ''\n omniauth['info']['name'] ? @authhash[:name] = omniauth['info']['name'] : @authhash[:name] = ''\n omniauth['credentials']['token'] ? @authhash[:token] = omniauth['credentials']['token'] : @authhash[:token] = ''\n omniauth['credentials']['secret'] ? @authhash[:secret] = omniauth['credentials']['secret'] : @authhash[:secret] = ''\n omniauth['uid'] ? @authhash[:uid] = omniauth['uid'].to_s : @authhash[:uid] = ''\n omniauth['provider'] ? @authhash[:provider] = omniauth['provider'] : @authhash[:provider] = ''\n else \n # debug to output the hash that has been returned when adding new authorizations\n render :text => omniauth.to_yaml\n return\n end \n \n if @authhash[:uid] != '' and @authhash[:provider] != ''\n \n auth = Authorization.find_by_provider_and_uid(@authhash[:provider], @authhash[:uid])\n\n # if the user is currently signed in, he/she might want to add another account to signin\n if signed_in?\n if auth\n flash[:notice] = 'Your account at ' + @authhash[:provider].capitalize + ' is already connected with this site.'\n redirect_to root_path\n else\n current_user.add_authorization(@authhash)\n flash[:notice] = 'Your ' + @authhash[:provider].capitalize + ' account has been added for signing in at this site.'\n redirect_to root_path\n end\n else\n if auth\n # signin existing user\n # in the session his user id and the authorization id used for signing in is stored\n sign_in_ auth.user\n #session[:authorization_id] = auth.id\n \n flash[:notice] = 'Signed in successfully via ' + @authhash[:provider].capitalize + '.'\n redirect_back_or root_url\n else\n # this is a new user; show signup; @authhash is available to the view and stored in the sesssion for creation of a new user\n #session[:authhash] = @authhash\n #render signup_authorizations_path\n #crappy way to bypass password requirement for user, potential loophole\n password = SecureRandom.hex\n user = User.new(name: @authhash[:name], email: @authhash[:email], password: password, password_confirmation: password)\n user.authorizations.build(provider: @authhash[:provider], uid: @authhash[:uid], token: @authhash[:token], secret: @authhash[:secret])\n user.save\n flash[:success] = \"Hi #{user.name}! You've signed up via #{@authhash[:provider]}.\"\n sign_in_ user\n redirect_back_or root_path \n end\n end\n else\n flash[:error] = 'Error while authenticating via ' + authorization_route + '/' + @authhash[:provider].capitalize + '. The authorization returned invalid data for the user id.'\n redirect_to signin_path\n end\n else\n flash[:error] = 'Error while authenticating via ' + authorization_route.capitalize + '. The authorization did not return valid data.'\n redirect_to signin_path\n end\n end" ]
[ "0.67118686", "0.6650865", "0.65736324", "0.6565333", "0.65608835", "0.6557786", "0.6541051", "0.65158635", "0.6480104", "0.63783103", "0.6358162", "0.63418084", "0.63207096", "0.6272569", "0.62436783", "0.62429714", "0.62318665", "0.62291586", "0.6212518", "0.61860704", "0.61809784", "0.6139913", "0.61223364", "0.611404", "0.60815823", "0.60630697", "0.60399556", "0.60164243", "0.6016102", "0.60020745", "0.59866565", "0.598561", "0.5981026", "0.5978071", "0.59576845", "0.59575415", "0.5954631", "0.59489906", "0.5946586", "0.59386504", "0.5911075", "0.59054977", "0.5898118", "0.5896957", "0.58912283", "0.588756", "0.5877013", "0.58555984", "0.584316", "0.58391494", "0.5826425", "0.57986206", "0.57938784", "0.5790932", "0.57878816", "0.57878697", "0.57787544", "0.57766074", "0.5764933", "0.57560384", "0.5737958", "0.572995", "0.5728689", "0.5721162", "0.57195675", "0.5700022", "0.56970114", "0.56970114", "0.56829447", "0.56813425", "0.5679768", "0.5672547", "0.5670682", "0.5654352", "0.5654352", "0.5653903", "0.5651477", "0.56514734", "0.5639295", "0.5633456", "0.5610151", "0.56025255", "0.5602481", "0.55944556", "0.55919737", "0.55831844", "0.55736554", "0.55634034", "0.55567276", "0.5555784", "0.5549362", "0.5548026", "0.55438876", "0.55355084", "0.5535166", "0.5534755", "0.5534524", "0.5521951", "0.5491265", "0.54870653" ]
0.6253739
14
Common actions to delete graphics at their cached uri location Delete an image
def delete(preset, format) only_provides(*graphics_mime_types) raise NotFound unless content_type && preset_exists?(preset) if full_request_path.index(preset_request_path) == 0 && File.exists?(full_request_path) success = FileUtils.rm(full_request_path) rescue nil cleanup_empty_dirs!(preset_request_path) if success end raise NoContent end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n request(:delete, \"/computing/image/#{uuid}\")\n true\n end", "def delete(session, id)\n write_task('rvpe.image.delete', session) do\n err_msg = \"You don't have permission to delete the image.\"\n sanity_check(session, id, err_msg) do\n call_one_xmlrpc('one.image.delete', session, id)\n end\n end\n end", "def delete_cache_and_img\n # -- out with the old -- #\n\n finger = self.fingerprint_changed? ? self.fingerprint_was : self.fingerprint\n imgfinger = self.image_fingerprint_changed? ? self.image_fingerprint_was : self.image_fingerprint\n\n if finger && imgfinger\n # -- delete our old cache -- #\n Rails.cache.delete(\"img:\"+[self.asset.id,imgfinger,self.output.code].join(\":\"))\n\n # -- delete our AssetOutput -- #\n path = self.asset.image.path(self)\n\n if path\n # this path could have our current values in it. make sure we've\n # got old fingerprints\n path = path.gsub(self.asset.image_fingerprint,imgfinger).gsub(self.fingerprint,finger)\n\n self.asset.image.delete_path(path)\n end\n end\n\n true\n end", "def delete_image!(albid, imgid) \n img = image(albid, imgid)\n source, target = _(img[:path]), _(albid, 'trash', imgid)\n FileUtils.mv(source, target) unless img[:deleted]\n !img[:deleted]\n end", "def delete_image\n\t\t@delete_image ||= \"0\"\n\tend", "def destroy\n output = \"oneimage delete #{resource[:name]} \", self.class.login\n `#{output}`\n end", "def destroy\n @image_attrib.destroy\n end", "def undelete_image!(albid, imgid)\n img = image(albid, imgid)\n source, target = _(img[:path]), _(albid, imgid)\n FileUtils.mv(source, target) if img[:deleted]\n img[:deleted]\n end", "def delete_image(image_name)\n File.delete(image_name)\n end", "def destroy_image?\n self.image.clear if @image_delete == \"1\"\n end", "def delete_image(id)\n uri = URI.parse(\"http://\" + @location.host + \":\" + @location.port.to_s + \"/v2/images/\" + id)\n return delete_request(uri, @token)\n end", "def destroy\n @image = Image.find(params[:id])\n \n imagen = @image.filename\n \n #function in manage_images.rb\n remove_image_file(imagen)\n \n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :ok }\n end\n end", "def delete_cache_and_img_and_fingerprint\n self.delete_cache_and_img\n\n # why do we bother clearing our fingerprint if the AssetOutput itself\n # is about to get deleted? If we don't, the after_commit handler will\n # rewrite the same cache we just deleted.\n self.fingerprint = ''\n end", "def delete(key)\n instrument :delete, key: key do\n map = find_map_by_key(key)\n if map\n client.image.image_delete(map.imgur_id)\n map.destroy!\n end\n end\n end", "def delete_image_attachment\n @image = ActiveStorage::Attachment.find(params[:id])\n @image.purge\n redirect_back(fallback_location: items_path)\n end", "def unload_image(image_handle)\n end", "def delete_storage(request, params)\n # --- Get the Image ---\n image = ImageOCCI.new(\n Image.build_xml(params[:id]),\n @client)\n\n # --- Delete the Image ---\n rc = image.delete\n if OpenNebula.is_error?(rc)\n return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]\n end\n\n return \"\", 204\n end", "def remove_image # :norobots:\n pass_query_params\n if @image = find_or_goto_index(Image, params[:image_id]) and\n @observation = find_or_goto_index(Observation, params[:observation_id])\n if !check_permission!(@observation)\n flash_error(:runtime_image_remove_denied.t(:id => @image.id))\n elsif !@observation.images.include?(@image)\n flash_error(:runtime_image_remove_missing.t(:id => @image.id))\n else\n @observation.remove_image(@image)\n @observation.log_remove_image(@image)\n Transaction.put_observation(\n :id => @observation,\n :del_image => @image\n )\n flash_notice(:runtime_image_remove_success.t(:id => @image.id))\n end\n redirect_to(:controller => 'observer', :action => 'show_observation',\n :id => @observation.id, :params => query_params)\n end\n end", "def delete_stored_image\n deleted_files_on_session(params[:name]) << params[:delete_file] unless deleted_files_on_session(params[:name]).include?(params[:delete_file])\n render :text=> \"success\"\n end", "def image_delete\n @image_delete ||= \"0\"\n end", "def destroy\n @image_path = ImagePath.find(params[:id])\n @image_path.destroy\n\n respond_to do |format|\n format.html { redirect_to(image_paths_url) }\n format.xml { head :ok }\n end\n end", "def delete_image(image_id)\n delete(\"cloud-instances/#{guid}/images/#{image_id}\")\n end", "def img(uuid, delete = true)\n log(\"image #{uuid}\")\n lock(:img) do\n delete ? @cache[:img].delete(uuid) : @cache[:img].fetch(uuid, nil)\n end\n end", "def destroy\n @img = Img.find(params[:id])\n @img.destroy\n\n respond_to do |format|\n format.html { redirect_to(imgs_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @graphic.destroy\n end", "def delete(major,minor)\n major = major.to_sym\n if minor\n delete_hash = minor\n else\n if storage.hash_exists?(major)\n delete_hash = storage.find(major)\n else\n puts 'Delete hash not found in storage.'\n puts 'Use: imgurr delete <id> <delete_hash>'\n return\n end\n end\n if ImgurAPI.delete(delete_hash)\n puts 'Successfully deleted image from Imgur'\n storage.delete(major)\n storage.save\n else\n puts 'Unauthorized Access. Wrong delete hash?'\n end\n end", "def delete_image\n @page.first('span[data-vh-id=\"remove\"]').click\n end", "def delete!\n response = @connection.csreq(\"DELETE\",@connection.svrmgmthost,\"#{@connection.svrmgmtpath}/images/#{URI.escape(self.id.to_s)}\",@connection.svrmgmtport,@connection.svrmgmtscheme)\n CloudServers::Exception.raise_exception(response) unless response.code.match(/^20.$/)\n true\n end", "def deleteEntityImage( entity_id, gen_id)\n params = Hash.new\n params['entity_id'] = entity_id\n params['gen_id'] = gen_id\n return doCurl(\"delete\",\"/entity/image\",params)\n end", "def destroy\n @image.destroy\n end", "def destroy\n @image.destroy\n end", "def delete(*names)\n Tk.execute(:image, :delete, *names)\n end", "def destroy\n @cached_photo = CachedPhoto.find(params[:id])\n @cached_photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(cached_photos_url) }\n format.xml { head :ok }\n end\n end", "def before_destroy\n path = c_dir+\"#{self.code}.jpg\"\n FileUtils.rm path if File.exist? path\n end", "def delete_image tags\n all_images_by_tags( tags ).each { | image | image.deregister } \n end", "def destroy\n @image = Gui::Image.find(params[:id])\n @image.destroy\n redirect_to gui_panels_path\n\n # respond_to do |format|\n # format.html { redirect_to gui_images_url }\n # format.json { head :no_content }\n # end\n end", "def remove_image\n pass_query_params\n @image = find_or_goto_index(Image, params[:image_id])\n return unless @image\n\n @observation = find_or_goto_index(Observation, params[:observation_id])\n return unless @observation\n\n if !check_permission!(@observation)\n flash_error(:runtime_image_remove_denied.t(id: @image.id))\n elsif !@observation.images.include?(@image)\n flash_error(:runtime_image_remove_missing.t(id: @image.id))\n else\n @observation.remove_image(@image)\n @image.log_remove_from(@observation)\n flash_notice(:runtime_image_remove_success.t(id: @image.id))\n end\n redirect_with_query(controller: \"observer\",\n action: \"show_observation\", id: @observation.id)\n end", "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n head :no_content\n end", "def destroy_image(key)\n return unless key.is_a?(String) && !key.empty?\n name, ext = key.split('.')\n self.transaction do\n record = find_by_name name\n # do nothing if not found\n return unless record\n if record.refcount > 1\n record.refcount -= 1\n record.save\n else\n if record.keep_till && record.keep_till > Time.now\n record.refcount = 0\n record.save\n else\n record.purge_image_data\n record.delete\n end\n end\n end\n cleanup_temporary_image\n end", "def destroy\n @raw_image.destroy\n redirect_to admin_raw_images_path\n end", "def destroy\n @picture.destroy\n\n head :no_content\n end", "def deleteImagur(delete_hash)\n response = RestClient.get('http://api.imgur.com/2/delete/'+delete_hash)\n case response.code\n when 200\n return 1\n else\n return 0\n end\n end", "def img(key, delete = true)\n log(\"image #{key}\")\n lock(:img) do\n delete ? @cache[:img].delete(key) : @cache[:img].fetch(key, nil)\n end\n end", "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n redirect_to console_images_path\n end", "def removeImage\n @groof = Greenroof.find(params[:id])\n if not (@groof.images.first.nil?)\n\n\n directory = \"/public/greenroofs/photos/\" + params[:id]\n photoFilename = @groof.images.first.photo\n thumbFilename = @groof.images.first.thumb\n photoPath = Dir.pwd + directory + \"/\" + photoFilename\n thumbPath = Dir.pwd + directory + \"/\" + thumbFilename\n File.delete(photoPath)\n File.delete(thumbPath)\n @groof.images.first.delete\n end\n redirect_to greenroof_path(@groof)\n end", "def destroy_image # :norobots:\n if @image = find_or_goto_index(Image, params[:id].to_s)\n next_state = nil\n # decide where to redirect after deleting image\n if this_state = find_query(:Image)\n set_query_params(this_state)\n this_state.current = @image\n next_state = this_state.next\n end\n if !check_permission!(@image)\n redirect_to(:action => 'show_image', :id => @image.id,\n :params => query_params)\n else\n @image.log_destroy\n @image.destroy\n Transaction.delete_image(:id => @image)\n flash_notice(:runtime_image_destroy_success.t(:id => params[:id].to_s))\n if next_state\n redirect_to(:action => 'show_image', :id => next_state.current_id,\n :params => set_query_params(next_state))\n else\n redirect_to(:action => 'list_images')\n end\n end\n end\n end", "def delete_cache_files; end", "def delete_cache_files; end", "def destroy\n\t\timage = Image.find(params[:id])\n\t\timage.destroy\n\t\tredirect_to :back\n\tend", "def destroy\n @family_image.destroy\n\n head :no_content\n end", "def destroy\n @drawable = Drawable.find(params[:id])\n @drawable.destroy\n\n respond_to do |format|\n format.html { redirect_to drawables_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @action_graphic = ActionGraphic.find(params[:id])\n @action_graphic.destroy\n\n respond_to do |format|\n format.html { redirect_to(action_graphics_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n Image.find(params[:id]).destroy\n redirect_to :action => 'index' \n end", "def destroy\n @graphic = Graphic.find(params[:id])\n @graphic.destroy\n\n respond_to do |format|\n format.html { redirect_to(graphics_url) }\n format.xml { head :ok }\n end\n end", "def destroy_image\n @image = find_or_goto_index(Image, params[:id].to_s)\n return unless @image\n\n next_state = nil\n # decide where to redirect after deleting image\n if (this_state = find_query(:Image))\n query_params_set(this_state)\n this_state.current = @image\n next_state = this_state.next\n end\n if !check_permission!(@image)\n redirect_with_query(action: \"show_image\", id: @image.id)\n else\n @image.log_destroy\n @image.destroy\n flash_notice(:runtime_image_destroy_success.t(id: params[:id].to_s))\n if next_state\n query_params_set(next_state)\n redirect_with_query(action: \"show_image\", id: next_state.current_id)\n else\n redirect_to(action: \"list_images\")\n end\n end\n end", "def delete name,params=nil\n\n # Skip hook calls made by update\n skiphook = (params && params[:skiphook])\n\n images = self.image(name)\n return nil if images.nil?\n o = absolute(images[:original])\n\n if params.nil? || (!params[:width] && !params[:height])\n File.delete(o) if File.exists?(o)\n [:widths,:heights].each do |w|\n images[w].each do |i|\n File.delete(absolute(name,\n (w==:widths ? :width : :height) => i))\n end\n end\n @hooks.delete(:original => images[:original],\n :sized => images[:widths]+images[:heights]) if @hooks && !skiphook\n return o\n\n else\n w,h = params[:width],params[:height]\n n = nil\n if w\n n = absolute(name,:width => w)\n File.delete(n)\n @hooks.delete(:sized => [n]) if @hooks && !skiphook\n elsif h\n n = absolute(name,:height => h)\n File.delete(n)\n @hooks.delete(:sized => [n]) if @hooks && !skiphook\n else\n raise 'Error #2 '+@@errors[2]\n end\n return n\n\n end\n end", "def home_image_delete\n\t\timage = HomeImage.find(params[:image_id])\n\t\timage_id = image.home_id\n\t\timage.destroy\n\t\tflash[:msg] = \"Success! Image Deleted Successfully\"\n\t\tredirect_to \"/home/show/\"+image_id.to_s\n\tend", "def destroy_image(action_handler, image_spec, image_options, machine_options={})\n raise \"#{self.class} does not implement destroy_image\"\n end", "def delete_image_files\n [ :original , :medium , :thumb ].each do |size|\n path = image_path(size, true)\n File.delete(path) if path\n end\n end", "def destroy\n @image = Image.find(params[:id])\n checkaccountobject(\"images\",@image)\n cloud = Oecloud.new(:zone => @image.zone, :image => @image)\n if cloud.deregisterimage\n @image.destroy\n end\n\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :ok }\n end\n end", "def toggle_delete_image!(albid, imgid)\n if image(albid, imgid)[:deleted]\n undelete_image!(albid, imgid)\n :undeleted\n else\n delete_image!(albid, imgid)\n :deleted\n end\n end", "def delete_pxe_image_types\n pxe_image_type_button_operation('destroy', 'deletion')\n end", "def delete_associated_image(parameters)\n eachImageField(parameters) do |image, fieldName|\n if image.present? and image[:assets].blank? and image[:id].blank?\n image_var = send(fieldName)\n image_var.destroy if image_var\n end\n end\n end", "def destroy\n @web_display_car_image.destroy\n\n head :no_content\n end", "def remove_cached_images\n UserAssetService.remove_assets_from_remote(\"branding_groups/#{self.id}\")\n end", "def picture_delete\n @memorial = Memorial.find(params[:id])\n p = Picture.find(params[:picture])\n p.destroy\n redirect_to :action => \"show\", :id => @memorial\n end", "def destroy\n @img_info = ImgInfo.find(params[:id])\n @img_info.destroy\n\n respond_to do |format|\n format.html { redirect_to(img_infos_url) }\n format.xml { head :ok }\n end\n end", "def delete\n [filename, thumbnail_name].each do |name|\n image = \"#{DIRECTORY}/#{name}\"\n File.delete(image) if File.exists?(image)\n end\n end", "def delete\n [filename, thumbnail_name].each do |name|\n image = \"#{DIRECTORY}/#{name}\"\n File.delete(image) if File.exists?(image)\n end\n end", "def destroy\n\t\t@img = ReportImage.find(params[:id])\n\t\t@img.destroy\n\n\t\trender :json => @img\n\tend", "def destroy\n @map_image = MapImage.find(params[:id])\n @map_image.destroy\n\n respond_to do |format|\n format.html { redirect_to(map_images_url) }\n format.xml { head :ok }\n end\n end", "def link_to_destroy(path)\n link_to image_tag('icons/001_05.png',\n :size => ICON_SIZE,\n :alt => 'Delete'), path,\n :confirm => 'Are you sure?', :method => :delete\n end", "def destroy\n @image = ImagePost.find(params[:id])\n @image.destroy\n track_activity @image\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :no_content }\n end\n end", "def remove_image!\n begin\n super\n rescue Fog::Storage::Rackspace::NotFound\n end\n end", "def remove_images\n remove_images_from_object(Observation, params)\n end", "def destroy\r\n image = @adoption_image\r\n @adoption_image.destroy\r\n respond_to do |format|\r\n format.html { redirect_to image.adoption, notice: 'A imagem foi removida com sucesso.' }\r\n end\r\n end", "def remove_picture(picture)\n end", "def destroy\n @imagem = Imagem.find(params[:id])\n @imagem.destroy\n\n respond_to do |format|\n format.html { redirect_to imagems_url }\n format.json { head :ok }\n end\n end", "def destroy\n #Finds selected image\n @image = Image.find(params[:id])\n #destroy image\n @image.destroy\n respond_to do |format|\n format.html { redirect_to '/admin' }\n format.json { head :ok }\n end\n end", "def destroy\n @image_url = ImageUrl.find(params[:id])\n @image_url.destroy\n\n respond_to do |format|\n format.html { redirect_to image_urls_url }\n format.json { head :no_content }\n end\n end", "def destroy_image\n unless self.image_id.blank?\n unless (image = HopeUpdateImage.find(self.image_id)) && image.destroy\n logger.error \"#destroy <HopeUpdateImage># id:#{self.image_id} failure\"\n end\n end\n end", "def destroy\n @loc_image.destroy\n respond_to do |format|\n format.html { redirect_to loc_images_url }\n format.json { head :no_content }\n end\n end", "def purge_image\n image.purge_later\n end", "def destroy\n if @article.img_path != ''\n File.delete('app/assets/images/' + @article.img_path) if File.exist?('app/assets/images/' + @article.img_path)\n end\n @article.destroy\n respond_to do |format|\n format.html { redirect_to articles_url, notice: 'Article was successfully destroyed.' }\n format.json { head :no_content }\n end\n\n\n end", "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n\n redirect_to new_flat_image_path(@image.flat)\n\n end", "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_images_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_images_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @image_reference.destroy\n respond_to do |format|\n format.html { redirect_to image_references_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @img.destroy\n respond_to do |format|\n format.html { redirect_to imgs_url, notice: \"Img was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @thumb.destroy\n\n head :no_content\n end", "def delete\n begin \n # file_assets\n file_assets.each do |file_asset|\n file_asset.delete\n end\n # We now reload the self to update that the child assets have been removed...\n reload()\n # Call ActiveFedora Deleted via super \n super()\n rescue Exception => e\n raise \"There was an error deleting the resource: \" + e.message\n end\n end", "def before_destroy\n \n begin\n del_html = \"#{SHIP_LABELS_STORE}/#{File.basename(self.label)}\"\n del_graphic = \"#{SHIP_LABELS_STORE}/label#{File.basename(self.label).gsub(\".html\", \".gif\")}\"\n FileUtils.rm del_html, :force => true\n FileUtils.rm del_graphic, :force => true\n rescue\n return true\n end\n\n end", "def destroy\n @photo = Photo.find(params[:id])\n File.delete(Rails.root.join(\"app\",'assets','images',@photo.path))\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to photos_url }\n format.json { head :no_content }\n end\n end", "def clear\r\n System.instance.remove_item(self.id)\r\n\r\n unless self.picture =~ /default_item\\.png$/\r\n File.delete(Helpers::absolute_path(self.picture.sub(\"/images\", \"../public/images\"), __FILE__))\r\n end\r\n end", "def delete photo_id\n @flickr.photos.delete(photo_id: photo_id)\n end", "def destroy\n ApiAction.new.destroy_image(@logo.uuid_image)\n @logo.destroy\n respond_to do |format|\n format.html { redirect_to campaign_path(@logo.campaign), notice: 'Logo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @image = Image.find(params[:id])\n if @image.destroy\n flash[:notice] = \"Successfully deleted image!\"\n redirect_to images_path\n else\n flash[:alert] = \"Error updating image!\"\n end\n end", "def destroy\n @image = Image.find(params[:id])\n if @image.destroy\n flash[:notice] = t(:image_deleted)\n else\n flash[:error] = t(:image_not_deleted)\n end\n\n respond_to do |format|\n format.html { redirect_back_or_default(admin_images_path) }\n format.xml { head :ok }\n end\n end", "def image_destroy\n result = RestaurantManage.image_destroy(@restaurant, params[:pic_id])\n get_restaurant()\n render json: result\n end", "def destroy\n @imgcomment = Imgcomment.find(params[:id])\n @imgcomment.destroy\n\n respond_to do |format|\n format.html { redirect_to imgcomments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @sys_image = resource_find(params[:id])\n @username = User.find(@sys_image.user_id).username\n if @sys_image.destroy\n delete_resource(@sys_image, \"ndz\")\n OMF::Workspace.remove_sysimage(@sys_image) \n flash[:success] = t(\"amazing.sys_image.deleted\")\n else\n #flash[:error] = \"Error deleting System image\" \n flash[:error] = t(\"errors.sys_image.updated\")\n end\n\n redirect_to(sys_images_path) \n end" ]
[ "0.70272464", "0.6893424", "0.67356974", "0.67155087", "0.66464293", "0.65887046", "0.6575255", "0.6556879", "0.65383995", "0.6536389", "0.6523167", "0.6509614", "0.65048635", "0.6493033", "0.6482597", "0.64684194", "0.6458578", "0.6441083", "0.6427903", "0.63980234", "0.63953096", "0.6393778", "0.63872963", "0.6386489", "0.6384399", "0.63785475", "0.6369104", "0.63609356", "0.6356424", "0.6349129", "0.6349129", "0.63411945", "0.6333592", "0.6316532", "0.63127947", "0.63050187", "0.6299804", "0.6294876", "0.62689173", "0.62687343", "0.62669593", "0.62619644", "0.62508106", "0.6250035", "0.6247362", "0.6238628", "0.62350994", "0.62350994", "0.62282276", "0.6209665", "0.6209303", "0.6183761", "0.6171186", "0.61675113", "0.6151598", "0.6149654", "0.6135903", "0.61329216", "0.6109667", "0.6107741", "0.6106039", "0.6098425", "0.6096258", "0.6090351", "0.60896254", "0.60888135", "0.6079813", "0.60753864", "0.60753864", "0.6075324", "0.6054458", "0.6054195", "0.60504025", "0.6043745", "0.6041702", "0.6037729", "0.6033019", "0.6032082", "0.60279876", "0.6027963", "0.6026658", "0.6025544", "0.60243917", "0.602245", "0.60185564", "0.60130227", "0.6009528", "0.60028183", "0.6002245", "0.60006803", "0.59932387", "0.5987071", "0.5986643", "0.59778786", "0.59738284", "0.59714293", "0.59660816", "0.59655845", "0.59646064", "0.5960554", "0.5950724" ]
0.0
-1
Delete all images for a preset
def delete_preset_items(preset) only_provides(*graphics_mime_types) raise NotFound unless preset_exists?(preset) files = Dir.glob(preset_request_path / "**" / "*.{#{graphics_mime_types.join(',')}}") success = files.all? { |file| FileUtils.rm(file) rescue nil } cleanup_empty_dirs!(preset_request_path) if success raise NoContent end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_image_files\n [ :original , :medium , :thumb ].each do |size|\n path = image_path(size, true)\n File.delete(path) if path\n end\n end", "def remove_all_images\n self.cover_image.purge if self.cover_image.attached?\n self.images.each {|image| image.purge} if self.images.attached?\n end", "def delete_image tags\n all_images_by_tags( tags ).each { | image | image.deregister } \n end", "def delete_all_uploaded_images\n images_dir = FileUploader.file_dir('article', id)\n FileUtils.rm_rf(images_dir) if File.directory?(images_dir)\n end", "def remove_images\n rm_r images_dir\n end", "def remove_images\n @sample.cover_image.purge if sample_params[:remove_cover_image] == '1'\n image_to_remove_ids = params['image_to_remove_ids']\n if image_to_remove_ids.present?\n image_to_remove_ids.each do |image_to_remove_id|\n @sample.images.find(image_to_remove_id).purge\n end\n end\n end", "def prune_images\n if self.images.present?\n self.assets.where('id <> ?',self.default_image_id).destroy_all\n end\n end", "def remove_images(object, name)\n FileUtils.rm Dir.glob(File.join(path_for(object.has_image_id), name + '*'))\n Dir.rmdir path_for(object.has_image_id)\n rescue SystemCallError \n end", "def delete_all_images\n fog_storage = get_fog_storage\n bucket = get_bucket\n \n directory = fog_storage.directories.get(bucket)\n \n return_string = \"\" \n \n directory.files.each do |file|\n \n return_string += file.key\n \n if ( file.key.to_s.start_with? \"uploads/quiz/#{quiz_id}/quiz_question_images/\")\n file.destroy\n end \n end\n \n return return_string\n end", "def clear_images(user_id)\n Dir.glob(\"public/images/#{user_id.to_s}_*\") do |my_file|\n File.delete(my_file)\n end\n end", "def delete_files\n\t\t\tFileUtils.rm_rf(@clean_image)\n\t\t\tFileUtils.rm_rf(@image) if pdf?\n\t\tend", "def delete\n [filename, thumbnail_name].each do |name|\n image = \"#{DIRECTORY}/#{name}\"\n File.delete(image) if File.exists?(image)\n end\n end", "def delete\n [filename, thumbnail_name].each do |name|\n image = \"#{DIRECTORY}/#{name}\"\n File.delete(image) if File.exists?(image)\n end\n end", "def delete_images(old_images)\n old_images.each do |name, image|\n image.delete(:all) if image && image != send(name)\n end\n end", "def destroy\n all.each { |file| FileUtils.rm_f(file) }\n end", "def delete(*names)\n Tk.execute(:image, :delete, *names)\n end", "def clear\n @uploaders.each do |uploader| \n full_preview_path = \"#{Rails.root}/public/uploads/tmp/#{uploader.preview.cache_name}\"\n cache_dir = File.expand_path('..', full_preview_path)\n uploader.remove!\n Dir.delete(cache_dir)\n end\n\n @uploaders.clear\n @downloaded_images.clear\n end", "def save_images\n images.each { |n| (n.should_destroy?) ? n.destroy : n.save(false)\t}\n end", "def cleanup_nontarget_files\n\n delete_dir = File.expand_path(File.join(app.build_dir, 'Resources/', 'Base.lproj/', 'assets/', 'images/'))\n\n puts_blue \"Cleaning up excess image files from target '#{options.Target}'\"\n puts_red \"Images for the following targets are being deleted from the build directory:\"\n\n (options.Targets.keys - [options.Target]).each do |target|\n\n puts_red \"#{target.to_s}\"\n Dir.glob(\"#{delete_dir}/**/#{target}-*.{jpg,png,gif}\").each do |f|\n puts_red \" Deleting #{File.basename(f)}\"\n File.delete(f)\n end\n end\n\n puts_red \"\\nImages prefixed all- are being deleted if a corresponding #{options.Target}- exists.\"\n\n Dir.glob(\"#{delete_dir}/**/all-*.{jpg,png,gif}\").each do |f|\n if File.exist?( f.sub(\"all-\", \"#{options.Target}-\") )\n puts_red \" Deleting #{File.basename(f)}\"\n File.delete(f)\n end\n end\n\n\n end", "def save_images \n post_images.each do |n|\n if n.should_destroy?\n \tn.destroy\n else\n \tn.save(false)\t\n end\t\n end\n end", "def delete_pxe_image_types\n pxe_image_type_button_operation('destroy', 'deletion')\n end", "def delete_all_sprites\n self.sprites.each{|sprite|\n sprite.visible = false\n sprite.dispose\n }\n @sprites = []\n end", "def remove_math_images_folder\n math_images.remove_folder\n end", "def clean\n (config.keys - ['image']).each { |name|\n env = env(name, name)\n env.clean!\n }\n end", "def toast_sufia_uploaded_file\n file_sets.each do |fs|\n Sufia::UploadedFile.where(file_set_uri: fs.uri.to_s).destroy_all\n end\n end", "def delete_associated_image(parameters)\n eachImageField(parameters) do |image, fieldName|\n if image.present? and image[:assets].blank? and image[:id].blank?\n image_var = send(fieldName)\n image_var.destroy if image_var\n end\n end\n end", "def clean_generated_images(image_version)\n @process_runner.execute!(\"docker rmi #{@repository_name}:latest #{@repository_name}:#{image_version}\")\n end", "def cleanup_derivatives\n deleted_files = []\n raster_derivatives = resource.file_metadata.select { |file| file.derivative? || file.thumbnail_file? || file.cloud_derivative? }\n raster_derivatives.each do |file|\n storage_adapter.delete(id: file.file_identifiers.first)\n deleted_files << file.id\n end\n cleanup_derivative_metadata(derivatives: deleted_files)\n generate_mosaic unless deleted_files.empty?\n end", "def delete_image(image_name)\n File.delete(image_name)\n end", "def remove_cached_images\n UserAssetService.remove_assets_from_remote(\"branding_groups/#{self.id}\")\n end", "def remove_images\n remove_images_from_object(Observation, params)\n end", "def stage_clear\n stage_safe!\n Dir['*'].each do |path|\n #p path\n FileUtils.rm_r(path)\n end\n end", "def delete_all\n target.clear\n end", "def clear\r\n System.instance.remove_item(self.id)\r\n\r\n unless self.picture =~ /default_item\\.png$/\r\n File.delete(Helpers::absolute_path(self.picture.sub(\"/images\", \"../public/images\"), __FILE__))\r\n end\r\n end", "def run()\n\n # Figure out which tags actually to reset.\n if @tags.nil? or @tags == 'all'\n @tags = @@default_tags\n elsif @tags.is_a?(String)\n @tags = @tags.split(',')\n end\n\n # Create the command to delete all the metatags\n command = 'exiftool'\n parameter = ' -overwrite_original'\n @tags.each do |current_tag|\n parameter << \" -#{current_tag}=\"\n end\n parameter << ' ' \n\n `#{command} #{parameter} #{@filename}`\n self.log('info', \"Cleaning tags '#{@tags.join(', ').to_s}' from file '#{@filename}'.\")\n end", "def destroy\n @album = Album.find(params[:id])\n @album.images.clear\n @album.save!\n @album.destroy\n Image.all(:conditions => {:album_id => params[:id]}).each do |x| \n x.album_id = nil\n x.save\n end\n respond_to do |format|\n format.html { redirect_to(albums_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n request(:delete, \"/computing/image/#{uuid}\")\n true\n end", "def deleted_images(albid)\n Dir[_(albid, \"trash\", \"*.jpg\")].collect do |f|\n image(albid, File.basename(f))\n end\n end", "def destroy\n remove_files(@path + \"*\")\n end", "def remove_photos\n self.photos.clear\n end", "def delete_files\n self.bruse_files.each do |file|\n file.destroy\n end\n end", "def delete_pic\n self.posts.each do |post|\n post.pic.destroy\n end\n end", "def destroy\n @image_attrib.destroy\n end", "def delete_collection\n FileUtils.rm_r @src_path\n FileUtils.rm_r @store_path if store_exist?\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 remove_photos(db, selected)\n\n photos = selected.split(\",\")\n\n photos.each do |photo|\n delete_s3_file(photo)\n delete_db_record(db, photo)\n end\n\nend", "def clear_skim_files_list\n @skim_files = nil\n end", "def delete_thumbnails\n Jhead.call(\"-dt\", @match, @pattern)\n end", "def destroy\n @image.destroy\n end", "def destroy\n @image.destroy\n end", "def index\n assets = current_user.assets.all\n \n assets.each do |asset|\n if asset.tempfile == true\n asset.destroy\n end\n end\n \n @assets = current_user.assets.all\n end", "def clear\n Dir[File.join(@output_dir, '*')].each do |path|\n File.delete(path)\n end\n end", "def after_destroy\n bundle_dir = File.join( self.userfolder, self.bundle_src_folder )\n logger.info(\"==================> Remove all bundle files for: \" + bundle_dir )\n %x[rm -f -R #{bundle_dir}]\n \n # delete bundle image file name\n %x[rm #{fq_bundle_image_filename('*')}]\n \n #delete sample audio prompt\n %x[rm #{fq_bundle_sample_prompt}]\n end", "def remove_images # :norobots:\n remove_images_from_object(Observation, params)\n end", "def delete_assets!\n SsObject.in_solar_system(self).delete_all\n Wreckage.in_zone(self).delete_all\n Unit.in_zone(self).delete_all\n end", "def destroy\n @image_set = ImageSet.find(params[:id])\n @image_set.destroy\n\n respond_to do |format|\n format.html { redirect_to(image_sets_url) }\n format.xml { head :ok }\n end\n end", "def cleanupSprites\n @spriteManager.cleanupSprites\n end", "def cleanup\n FileUtils.rm(autoinst_path, force: true)\n FileUtils.rm(definition_path, force: true)\n FileUtils.rm(libvirt_definition_path, force: true)\n if provider == :libvirt\n # Due a bug in vagrant-libvirt the images will not cleanuped correctly\n # in the /var/lib/libvirt directory. This has to be done manually\n # (including DB update)\n system \"sudo virsh vol-delete #{IMAGE_BOX_NAME} default\"\n end\n end", "def clear\n @imgs.clear\n @tilesets.clear\n @sounds.clear\n @songs.clear\n @fonts.clear\n end", "def clean_up\n @files.each {|file| FileUtils.remove(file.path)}\n end", "def dispose_pictures\n for sprite in @picture_sprites\n sprite.dispose\n end\n end", "def destroy_attached_files\n Paperclip.log(\"Deleting attachments.\")\n each_attachment do |name, attachment|\n attachment.send(:flush_deletes)\n end\nend", "def destroy_image?\n self.image.clear if @image_delete == \"1\"\n end", "def cleanup_derivatives\n deleted_files = []\n image_derivatives = resource.file_metadata.select { |file| (file.derivative? || file.thumbnail_file?) && file.mime_type.include?(image_mime_type) }\n image_derivatives.each do |file|\n storage_adapter.delete(id: file.id)\n deleted_files << file.id\n end\n cleanup_derivative_metadata(derivatives: deleted_files)\n end", "def destroy\n @import_avatar.destroy\n end", "def destroy\n @gallery.pics.each do |pic|\n Cloudinary::Uploader.destroy(pic.public_id.split(\"/\").last.split(\".\")[0] ,@auth) if pic.public_id.present?\n pic.delete\n end\n @gallery.delete\n respond_to do |format|\n format.html { redirect_to galleries_url, notice: 'Gallery was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete(preset, format)\n only_provides(*graphics_mime_types)\n raise NotFound unless content_type && preset_exists?(preset)\n if full_request_path.index(preset_request_path) == 0 && File.exists?(full_request_path)\n success = FileUtils.rm(full_request_path) rescue nil\n cleanup_empty_dirs!(preset_request_path) if success\n end\n raise NoContent\n end", "def dump_show_img\n FileUtils.rm_rf(Dir.glob(\"#{project.image_for('', 'show_image_desk')}/*\"))\n FileUtils.rm_rf(Dir.glob(\"#{project.image_for('', 'show_image_mob')}/*\"))\n FileUtils.rm_rf(Dir.glob(\"#{project.image_for('', 'show')}/*\"))\n end", "def destroy\n @raw_image.destroy\n redirect_to admin_raw_images_path\n end", "def destroy\n output = \"oneimage delete #{resource[:name]} \", self.class.login\n `#{output}`\n end", "def clean\n # TODO: help?\n # TODO: check for unknown args\n\n # Can give the following\n # Error response from daemon: conflict: unable to delete cfc459985b4b (cannot be forced)\n # image is being used by running container a7108a524a4d\n command = \"docker images -q -f='dangling=true' | xargs docker rmi --force\"\n run command\nend", "def destroy_multiple\n @photos = Photo.where(id: params[:photo_ids]).with_attached_images\n @photos.destroy_all\n respond_to do |format|\n format.html { redirect_to photos_path, notice: 'Selected photos were successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n stop\n [ @resource['instances_dir'] + \"/\" + @resource[:name],\n @resource['instances_dir'] + \"/\" + \"_\" + @resource[:name]\n ].each do |dir|\n FileUtils.rm_rf(dir) if File.directory?(dir)\n end\n end", "def clean_up\n #Delete every thing but the most recent config[:screenshot_max_keep] screenshots\n max_screenshots = self.config[:screenshot_max_keep] || 5\n #Delete the last created one while they count is more then the max\n while self.admo_screenshots.count > max_screenshots\n self.admo_screenshots.order_by('created_at asc').first.destroy\n end\n end", "def before_destroy\n path = c_dir+\"#{self.code}.jpg\"\n FileUtils.rm path if File.exist? path\n end", "def delete_all_files\n @import.delete_all_files\n head :no_content\n end", "def delete_software_image(opts)\n opts = check_params(opts,[:image_filenames])\n super(opts)\n end", "def application_teardown\n if File.exists?(IMG_DIR)\n FileUtils.rm_rf(IMG_DIR)\n end\n end", "def purge_image\n image.purge_later\n end", "def destroy\n @image = Image.find(params[:id])\n \n imagen = @image.filename\n \n #function in manage_images.rb\n remove_image_file(imagen)\n \n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :ok }\n end\n end", "def remove\n\t\t#Clean up unused rtwork\n\t\tif Artwork.find_by_majorpost_uuid(params[:majorpost_uuid])\n\t\t\tResque.enqueue(Image::ArtworkCleanup, params[:majorpost_uuid])\n\t\tend\n\tend", "def delete_cache_and_img_and_fingerprint\n self.delete_cache_and_img\n\n # why do we bother clearing our fingerprint if the AssetOutput itself\n # is about to get deleted? If we don't, the after_commit handler will\n # rewrite the same cache we just deleted.\n self.fingerprint = ''\n end", "def destroy\n @pin.galleries.each do |f|\n f.photo = nil\n end\n @pin.destroy\n respond_to do |format|\n format.html { redirect_to my_cars_path, notice: 'Destruido correctamente' }\n format.json { head :no_content }\n end\n end", "def delete(*filenames); end", "def clean_remote\n to_delete = remote_assets - local_compiled_assets\n to_delete.each do |f|\n delete_remote_asset(bucket.files.get(f))\n end\n end", "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n redirect_to console_images_path\n end", "def remove_photos(db, selected)\n\n photos = selected.split(\",\")\n\n photos.each do |photo|\n photo = \"imageuploader/\" + photo\n b2_delete_file(photo)\n delete_db_record(db, photo)\n end\n\nend", "def uninstall(assets); end", "def delete_prefixed(prefix)\n instrument :delete_prefixed, prefix: prefix do\n maps = ActiveStorage::ImgurKeyMapping.by_prefix_key(prefix)\n maps.each do |map|\n client.image.image_delete(map.imgur_id)\n map.destroy!\n end\n end\n end", "def delete_exif\n Jhead.call(\"-de\", @match, @pattern)\n end", "def remove_imagekit_file\n service.class.delete_ik_file(self)\n end", "def delete_all\n @configuration = nil\n end", "def delete_all\n @configuration = nil\n end", "def remove_image( image_id )\n image_id = image_id.to_s.upcase\n upload_key = UPLOAD_PATH % image_id\n hires_key = HIRES_PATH % image_id\n lowres_key = LOWRES_PATH % image_id\n\n client.delete_objects(\n bucket: aws.bucket,\n delete: {\n objects: [\n {key: upload_key},\n {key: hires_key},\n {key: lowres_key}\n ]\n }\n )\n end", "def cleanup\n self.image = nil\n GC.start\n end", "def cleanup\n self.image = nil\n GC.start\n end", "def purge\n self.files.each do |f|\n f.destroy\n end\n self.commits.each do |c|\n c.destroy\n end\n end", "def remove_uploaded_file\n remove_image!\n end", "def destroy_all\n all.each(&:destroy)\n end", "def cleanup_derivatives\n deleted_files = []\n pyramidal_derivatives = resource.file_metadata.select { |file| file.derivative? && file.mime_type.include?(\"image/tiff\") }\n pyramidal_derivatives.each do |file|\n storage_adapter.delete(id: file.file_identifiers.first)\n deleted_files << file.id\n end\n cleanup_derivative_metadata(derivatives: deleted_files)\n end" ]
[ "0.7357561", "0.723533", "0.72171783", "0.7209806", "0.7114806", "0.7089455", "0.6977054", "0.6963914", "0.69578016", "0.68049896", "0.6802123", "0.6690086", "0.6690086", "0.6666248", "0.6600262", "0.6584008", "0.65323263", "0.65041995", "0.6495861", "0.649185", "0.647351", "0.64664894", "0.6419996", "0.6414129", "0.63874805", "0.63730824", "0.63626444", "0.635578", "0.6344049", "0.63243914", "0.6315629", "0.63064265", "0.62986594", "0.6293296", "0.6293109", "0.6283002", "0.62395316", "0.62329847", "0.6219845", "0.6217382", "0.62060237", "0.62003946", "0.6200347", "0.6197625", "0.61962074", "0.6195965", "0.61889017", "0.6185305", "0.61555153", "0.61555153", "0.61279565", "0.6125057", "0.61053824", "0.60907906", "0.6084441", "0.60777235", "0.6062546", "0.6058405", "0.6023957", "0.601968", "0.59816724", "0.5979766", "0.5979357", "0.59594035", "0.5959311", "0.5956282", "0.59543175", "0.595427", "0.5936211", "0.592408", "0.5922269", "0.5915526", "0.5896193", "0.5895408", "0.58896416", "0.58685696", "0.5866437", "0.58545625", "0.5849322", "0.58478796", "0.58397657", "0.5838603", "0.58379745", "0.58346426", "0.5825184", "0.5825014", "0.5824338", "0.58141255", "0.5805304", "0.58020437", "0.57972956", "0.57963926", "0.57963926", "0.57825506", "0.57778376", "0.57778376", "0.57777977", "0.5777567", "0.57760286", "0.5773729" ]
0.7409171
0
Stub method to implement in your application
def authenticate Merb.logger.info!("No authentication has been setup for GraphicsSlice") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stub_implementation; end", "def stubs; end", "def stubbed?\n raise NotImplementedError\n end", "def implementation; end", "def implementation; end", "def initialize stub_method\n @stub_method = stub_method\n end", "def stubs=(_arg0); end", "def macro; raise NotImplementedError; end", "def macro; raise NotImplementedError; end", "def macro; raise NotImplementedError; end", "def spec; end", "def spec; end", "def verify_stubbed_calls; end", "def hunter_stub\n\tend", "def get_context(*params); raise('Stub or mock required.') end", "def stub\n Ablerc::StubGenerator.new({:options => options}.merge(stub_options))\n end", "def get(*params); raise('Stub or mock required.') end", "def stub(options)\n Ablerc.stub_options = options\n end", "def stubbed_params=(_arg0); end", "def stub!\n return if stub?\n self.status = :stub\n self.store\n end", "def private; end", "def stub_server_interface\n @handler.stubs(:accept_header ).returns \"format_one,format_two\"\n @handler.stubs(:content_type_header).returns \"text/yaml\"\n @handler.stubs(:set_content_type ).returns \"my_result\"\n @handler.stubs(:set_response ).returns \"my_result\"\n @handler.stubs(:path ).returns \"/my_handler/my_result\"\n @handler.stubs(:http_method ).returns(\"GET\")\n @handler.stubs(:params ).returns({})\n @handler.stubs(:content_type ).returns(\"text/plain\")\n end", "def call\n raise NotImplementedError,\n \"Override #call and implement your application logic.\"\n end", "def wrapper; end", "def call\n raise NotImplementedError\n end", "def call\n raise NotImplementedError\n end", "def call\n raise NotImplementedError\n end", "def call\n # implement in subclasses\n end", "def __mock_reset; end", "def new_stub_for method_name\n response = Response.new(Http::Request.new, Http::Response.new)\n response.request_type = method_name\n response.request_options = {}\n send(\"simulate_#{method_name}_response\", response)\n response.signal_success\n response\n end", "def new_stub_for method_name\n response = Response.new(Http::Request.new, Http::Response.new)\n response.request_type = method_name\n response.request_options = {}\n send(\"simulate_#{method_name}_response\", response)\n response.signal_success\n response\n end", "def private_method\n end", "def implement_me\n flunk('Test not yet implemented.')\n end", "def __dummy_test__\n end", "def custom; end", "def custom; end", "def internal; end", "def get_version(*params); raise('Stub or mock required.') end", "def get_available(*params); raise('Stub or mock required.') end", "def stub_everything(name = 'stub')\n mock(name, :null_object => true)\n end", "def stub_system_calls\n Kernel.stubs(:system).returns(true)\n end", "def run; raise NotImplementedError; end", "def run; raise NotImplementedError; end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def service; raise NotImplementedError; end", "def realize_self\n raise NotImplementedError\n end", "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 verify?; raise NotImplementedError; end", "def original_method; end", "def apply_stubs(operation_name, stubs); end", "def overrides; end", "def get_usage(*params); raise('Stub or mock required.') 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 mock_methods_for_testing! #:nodoc:\n request.headers['mock_methods'].each do |method_name, return_value|\n (class << self; self; end).instance_eval do\n define_method(method_name) { |*not_used| return_value }\n end\n end\n end", "def stub_for method_name\n @stubs[method_name] ||= new_stub_for(method_name)\n end", "def delegating_method; end", "def call(*)\n raise NotImplementedError\n end", "def stub_for method_name\n @stubs ||= {}\n @stubs[method_name] ||= new_stub_for(method_name)\n end", "def self_test; end", "def self_test; end", "def expected_method; end", "def special\n override\n end", "def call(_rc)\n raise NotImplementedError\n end", "def configure\n not_implemented(__method__)\n end", "def handle\n raise \"Not implemented yet!\"\n end", "def weber; end", "def _stub(args, &ret)\n @klass.validate_call! args\n\n @expected << [args, ret]\n end", "def proxy; end", "def proxy; end", "def proxy; end", "def stubbing(object, method_name)\n @stubs[object.object_id][method_name]\n end", "def build_stubbed(name, *traits_and_overrides, &block); end", "def respond(); end", "def get_block(*params); raise('Stub or mock required.') end", "def sandbox; end", "def sandbox; end", "def get_contract(*params); raise('Stub or mock required.') end", "def call() end", "def code\n fail NotImplementedError\n end", "def interface; end", "def interface; end", "def get_hash(*params); raise('Stub or mock required.') end", "def invoke\r\n # TODO: rename to more appropriate one 2007/05/10 by shino\r\n raise 'must be implemented in subclasses'\r\n end", "def patch; end", "def patch; end", "def get_response\n raise NotImplementedError.new(\"method not overriden\")\n end", "def driver; end", "def get_transaction(*params); raise('Stub or mock required.') end", "def get_header(*params); raise('Stub or mock required.') end", "def support\n raise \"Not implemented\"\n end", "def awaken!\n\t\traise 'Not implemented'\n\tend" ]
[ "0.823849", "0.7136965", "0.6987884", "0.6866697", "0.6866697", "0.6817563", "0.6753811", "0.66756946", "0.66756946", "0.66756946", "0.6632635", "0.6632635", "0.6590306", "0.65612626", "0.6508226", "0.64300346", "0.64279985", "0.6407063", "0.6400375", "0.6390919", "0.6334291", "0.6332352", "0.6325281", "0.6310007", "0.6309459", "0.63062257", "0.63062257", "0.6291226", "0.6269628", "0.62544143", "0.62544143", "0.62442005", "0.623386", "0.62334627", "0.6231178", "0.6231178", "0.62259513", "0.6222988", "0.61663884", "0.6121257", "0.60822153", "0.60587925", "0.60587925", "0.605861", "0.605861", "0.605861", "0.605861", "0.6046791", "0.60414296", "0.6031707", "0.6031707", "0.6031707", "0.6031707", "0.6031707", "0.6031707", "0.6031707", "0.6031707", "0.5989079", "0.5968493", "0.59649044", "0.5955307", "0.5947227", "0.5928975", "0.59247494", "0.59207", "0.5915947", "0.59035295", "0.5887497", "0.5885392", "0.5885392", "0.5883875", "0.5878837", "0.5874904", "0.5873013", "0.58605415", "0.58573204", "0.5855012", "0.58541954", "0.58541954", "0.58541954", "0.5852061", "0.58471566", "0.5842395", "0.58380336", "0.58220094", "0.58220094", "0.5819664", "0.58184654", "0.58184224", "0.5813995", "0.5813995", "0.5806809", "0.5803499", "0.5799334", "0.5799334", "0.57965034", "0.57933486", "0.5782051", "0.57742685", "0.57738775", "0.5770391" ]
0.0
-1
Render a preset pass :doc_id to enable referencing in SofaCache
def show(preset, source_path, format) only_provides(*graphics_mime_types) raise NotFound unless source_path && preset_exists?(preset) img = ImMagick::Image.file(source_path) render_preset(preset, img) if image_path = save_file(img) store_cache_reference!(params[:doc_id], GraphicsSlice[:expire_cache] || 0) if respond_to?(:store_cache_reference!) && params[:doc_id] send_file(image_path, :disposition => 'inline', :type => content_type_for(format)) else raise NotFound end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render_document; end", "def preview_doc\n @tpl = Template.find(params[\"template_id\"]) \n output = @tpl.render_by_model_id(params[:id], 'print', 'www.freightoperations.com:8080')\n render(:text => output, :layout => false) \n end", "def preview\r\n\t\t\trender(\"option_#{self.id}_preview\")\r\n\t\tend", "def set_doc\n @doc = @repository.docs.find_by_slug(params[:id])\n end", "def render_scaffold\n (@collection.scaffold || '')\n .gsub('{{DATE}}', Time.now.strftime('%Y-%m-%d'))\n .gsub('{{TITLE}}', (@args[2] || ''))\n end", "def show(preset, character_data, format)\n only_provides(*graphics_mime_types)\n raise NotFound unless content_type && preset_exists?(preset)\n runner = send(:\"#{rubify(preset)}_preset\", character_data) \n raise InternalServerError unless runner.is_a?(ImMagick::Command::Runner)\n image_path = save_file(runner).filename\n store_cache_reference!(params[:doc_id], GraphicsSlice[:expire_cache] || 0) if respond_to?(:store_cache_reference!) && params[:doc_id]\n send_file(image_path, :disposition => 'inline', :type => content_type_for(format))\n end", "def show\n @response, @document = fetch params[:id]\n\n @children = @document.children(limit: 100).select { |child| child.published? }\n\n # assets ordered by label, excludes preservation only files\n @assets = @document.assets(ordered: true)\n\n @presenter = DRI::ObjectInCatalogPresenter.new(@document, view_context)\n\n supported_licences\n\n @reader_group = governing_reader_group(@document.collection_id) unless @document.collection?\n\n if @document.published?\n Gabba::Gabba.new(GA.tracker, request.host).event(@document.root_collection_id, \"View\", @document.id, 1, true)\n end\n\n respond_to do |format|\n format.html { setup_next_and_previous_documents }\n format.json do\n options = {}\n options[:with_assets] = true if can?(:read, @document)\n formatter = DRI::Formatters::Json.new(@document, options)\n render json: formatter.format(func: :as_json)\n end\n format.ttl do\n options = {}\n options[:with_assets] = true if can?(:read, @document)\n formatter = DRI::Formatters::Rdf.new(@document, options)\n render text: formatter.format({format: :ttl})\n end\n format.rdf do\n options = {}\n options[:with_assets] = true if can?(:read, @document)\n formatter = DRI::Formatters::Rdf.new(@document, options)\n render text: formatter.format({format: :xml})\n end\n format.js { render layout: false }\n\n additional_export_formats(@document, format)\n end\n end", "def setviewer \n #the view script.\n \n view = params[:value] \n #Gets the first resource in the set and sets the new view for it.\n resource = session[:application].get(params[:setid]).resources[0] \n #it will add a triple in the repository where the subject will be the resource uri, the predicate\n #will be explorator:view and the object will be the view script. \n resource.explorator::view=view \n \n #render nothing\n render :text => ''\n end", "def render\n render_with_markaby\n end", "def set_doc\n @doc = Doc.find(params[:id])\n end", "def set_doc_artefact\n @doc_artefact = DocArtefact.find(params[:id])\n end", "def link_to_document(doc, opts={:label=>nil, :counter => nil, :results_view => true})\n opts[:label] ||= blacklight_config.index.show_link.to_sym\n label = render_document_index_label doc, opts\n\n # WE must get to proper route so comment out doc-- solr document which defaults to id\n link_to label, doc, { :'data-counter' => opts[:counter] }.merge(opts.reject { |k,v| [:label, :counter, :results_view].include? k })\n # name = document_partial_name(doc)\n # url = \"medusa_premis/\" + name.pluralize + \"/\" + doc.id\n # link_to label, url, { :'data-counter' => opts[:counter] }.merge(opts.reject { |k,v| [:label, :counter, :results_view].include? k })\n end", "def rendered=(_arg0); end", "def set_document\n @document = Document.friendly.find(params[:id])\n end", "def set_document\n @document = Document.friendly.find(params[:id])\n end", "def url_for_document doc, options = {}\n require 'cgi'\n if respond_to?(:blacklight_config) and\n blacklight_config.show.route and\n (!doc.respond_to?(:to_model) or doc.to_model.is_a? SolrDocument)\n route = blacklight_config.show.route.merge(action: :show, id: doc).merge(options)\n route[:controller] = controller_name if route[:controller] == :current\n route\n else\n # This branch is the one executed for a search results index page \n if doc and doc[\"DocId\"]\n # IF doc exists and has this field\n Rails.logger.debug(\"Route - returning doc #{doc['DocId']}\" )\n # One mechanism is to return the doc itself (Ruby can recognize that it is an object and create the appropriate url)\n # In that case, the url would be catalog/id\n # but here, we want to ensure we pass the DocId parameter and we are escaping the ID in the parameter \n # Additionally, we tried updating the doc id to be the escaped uri, but that did not work correctly\n # What we are doing here is passing the local name (which has no slashes, etc. that could throw either apache or ruby off)\n # and then utilizing the normal behavior for showing a document but passing in the parameter as well\n # Code on the solr document helper side knows to expect that parameter and utilize that for the solr document id if it exists\n # Not passing in a local name in the url would make the code expect this was some search query, and without a query it jsut\n # goes back to the front page\n id = doc[\"DocId\"]\n uri_sliced = id.split(\"/\")\n local_name = uri_sliced.last\n uri_escaped = CGI::escape(id)\n # This was there originally before but let's try it without this, this would be useful if we were passing back doc\n # instead of passing the parameter in the URL\n # doc[\"id\"] = local_name \n \"/catalog/\" + local_name + \"?DocId=\" + id\n else \n #Does what this code would do without our updates \n doc \n end\n \n end\n end", "def set_doc_template\n @doc_template = DocTemplate.find(params[:id])\n end", "def set_document\n @document = Document.friendly.find(params[:id])\n end", "def preview\n #for debug\n params[:d] = 'www.rubyecommerce.com'\n \n the_website=the_menu=the_layout=the_theme = nil\n the_website = Website.find_by_url(params[:d])\n if params[:c]\n the_menu = Menu.find_by_id(params[:c])\n else\n the_menu = Menu.find_by_id(the_website.index_page) \n end\n the_theme = TemplateTheme.find(the_menu.find_theme_id(is_preview=true))\n do_preview(the_theme.id, the_theme.layout_id, the_menu.id)\n render :text => File.read(\"#{Rails.public_path}/shops/#{the_theme.file_name('html')}\")\n end", "def link_to_document(doc, opts={:label=>nil, :counter => nil, :results_view => true})\n opts[:label] ||= blacklight_config.index.show_link.to_sym\n label = render_document_index_label doc, opts\n name = document_partial_name(doc)\n url = name.pluralize + \"/\" + doc[\"id\"]\n link_to label, url, { :'data-counter' => opts[:counter] }.merge(opts.reject { |k,v| [:label, :counter, :results_view].include? k })\n end", "def generator_for store\n generator = RDoc::Generator::Darkfish.new store, @options\n generator.file_output = false\n generator.asset_rel_path = '..'\n\n rdoc = RDoc::RDoc.new\n rdoc.store = store\n rdoc.generator = generator\n rdoc.options = @options\n\n @options.main_page = store.main\n @options.title = store.title\n\n generator\n end", "def preview\n \n # @lg = PageTag::PageGenerator.previewer( @menu, @theme, {:resource=>(@resource.nil? ? nil:@resource),:controller=>self})\n # html = @lg.generate\n # css,js = @lg.generate_assets \n #insert css to html\n # style = %Q!<style type=\"text/css\">#{css}</style>!\n #editor_panel require @theme, @editors, @editor ...\n # html.insert(html.index(\"</head>\"),style)\n # html.insert(html.index(\"</body>\"),@editor_panel)\n # respond_to do |format|\n # format.html {render :text => html}\n # end\n \n end", "def set_document\n @document = Document.find(params[:id])\n add_breadcrumb @document, client_document_path(@document)\n rescue ActiveRecord::RecordNotFound\n render_404\n end", "def show_title\n respond_to do |format|\n format.html\n format.pdf do\n render pdf: @document.name ,\n template: \"layouts/title.html.erb\",\n locals: {:document => @document},\n layout: 'layouts/application.pdf.erb',\n :margin => { :bottom => 0, :top => 0, :left => 0, :right =>0 },\n show_as_html: params.key?('debug')\n\n end\n end\n end", "def show\n transform_id if /^nyu_\\d{4}_\\d{5}$/.match(params[:id])\n @response, @document = fetch_document(params[:id])\n\n respond_to do |format|\n format.html { setup_next_and_previous_documents }\n format.json { render json: { response: { document: @document } } }\n additional_export_formats(@document, format)\n end\n end", "def show\n #raise params.inspect\n @book = Book.find(params[:id])\n #html = render_to_string :layout => false \n\n #html = render_to_string :layout => false \n #kit = PDFKit.new(html, :page_size => 'Legal')\n #kit.stylesheets << RAILS_ROOT + '/public/stylesheets/scaffold.css'\n #send_data(kit.to_pdf, :filename => \"#{@book.id}\", :type => 'application/pdf')\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end", "def show\n @response, @document = search_service.fetch params[:id]\n @documents = [ @document ]\n set_bag_name \n logger.info \"es287_debug #{__FILE__}:#{__LINE__}:#{__method__} params = #{params.inspect}\"\n respond_to do |format|\n format.endnote_xml { render :layout => false } #wrapped render :layout => false in {} to allow for multiple items jac244\n format.endnote { render :layout => false } #wrapped render :layout => false in {} to allow for multiple items jac244\n format.html {setup_next_and_previous_documents}\n format.rss { render :layout => false }\n format.ris { render 'ris', :layout => false }\n #format.ris { render \"ris\", :layout => false }\n # Add all dynamically added (such as by document extensions)\n # export formats.\n @document.export_formats.each_key do | format_name |\n # It's important that the argument to send be a symbol;\n # if it's a string, it makes Rails unhappy for unclear reasons.\n format.send(format_name.to_sym) { render :body => @document.export_as(format_name), :layout => false }\n end\n\n end\n end", "def show\n if params['token']\n @document = Document.find_by_viewing_token(params[:token])\n else \n @document = Document.find(params[:id])\n\n message = \"You do not have access to the document <strong>'#{@document.title}'</strong> at this time. If you are interested in viewing this document, please let us know.\"\n authorize! :read, @document, :message => message.html_safe\n end\n\n # @document.update_viewer_uuid!\n\n # session_key = Crocodoc::Session.create(@document.viewer_uuid, {\n # 'is_editable' => true,\n # 'user' => {\n # 'id' => current_user.id,\n # 'name' => current_user.name\n # },\n # 'filter' => 'all',\n # 'is_admin' => true,\n # 'is_downloadable' => true,\n # 'is_copyprotected' => false,\n # 'is_demo' => false,\n # 'sidebar' => 'visible'\n # })\n\n respond_to do |format|\n format.html #{ redirect_to \"https://crocodoc.com/view/\" + session_key } # show.html.erb\n format.pdf { doc_raptor_send }\n format.json { render json: @document, :options => {:except => [:body], :methods => [:preview]} }\n format.xml { render xml: @document, :options => {:except => [:body], :methods => [:preview]} } \n end\n end", "def doc=(doc)\n @doc = doc\n @meta = @doc.at_xpath('/a:akomaNtoso/a:act/a:meta', a: NS)\n @body = @doc.at_xpath('/a:akomaNtoso/a:act/a:body', a: NS)\n\n @@acts[@doc] = self\n\n extract_id_uri\n end", "def set_document\n @document = Document.cached_find(params[:legal_document_id])\n end", "def url_for_map doc, options = {}\n require 'cgi'\n \n # This branch is the one executed for a search results index page \n if doc and doc[\"DocId\"]\n # IF doc exists and has this field\n Rails.logger.debug(\"Route - returning doc #{doc['DocId']}\" )\n # One mechanism is to return the doc itself (Ruby can recognize that it is an object and create the appropriate url)\n # In that case, the url would be catalog/id\n # but here, we want to ensure we pass the DocId parameter and we are escaping the ID in the parameter \n # Additionally, we tried updating the doc id to be the escaped uri, but that did not work correctly\n # What we are doing here is passing the local name (which has no slashes, etc. that could throw either apache or ruby off)\n # and then utilizing the normal behavior for showing a document but passing in the parameter as well\n # Code on the solr document helper side knows to expect that parameter and utilize that for the solr document id if it exists\n # Not passing in a local name in the url would make the code expect this was some search query, and without a query it jsut\n # goes back to the front page\n id = doc[\"DocId\"]\n uri_sliced = id.split(\"/\")\n local_name = uri_sliced.last\n uri_escaped = CGI::escape(id)\n # This was there originally before but let's try it without this, this would be useful if we were passing back doc\n # instead of passing the parameter in the URL\n # doc[\"id\"] = local_name \n \"/maps/\" + local_name + \"?DocId=\" + id\n else \n #Does what this code would do without our updates \n doc \n end\n \n \n end", "def set_docenza_sezione_materia\n @docenza_sezione_materia = DocenzaSezioneMateria.find(params[:id])\n end", "def rendered_views=(_arg0); end", "def _cornell_render_document_index_label doc\n\n # Rewriting because we can't get the above to work properly....\n label = doc[\"title_display\"]\n title = doc['fulltitle_display']\n vern = doc['fulltitle_vern_display']\n\n if title.present?\n label = title\n end\n\n if vern.present? && !title.nil?\n label = vern + ' / ' + label\n else\n if vern.present?\n label = vern\n end\n end\n\n label ||= doc['id']\n end", "def show \n render :file => cache_file and return if cached_file?\n \n @document = Document.find_by_path(request_path)\n \n raise ActiveRecord::RecordNotFound unless @document and (@document.published? or @document.allowed? current_user, 'read')\n\n respond_to do |format|\n format.html do\n setup_view_environment\n render :template => view_for\n end\n format.xml { render :xml => @document.to_xml(:only => [:title, :summary, :body, :published_at, :permalink]) }\n format.rss { render :template => 'pages/feed.rss.builder' }\n end\n\n cache_this_page!\n end", "def preview\n order = current_user.orders.find_by_cookbook_id(params[:id])\n @cookbook = (order) ? order.cookbook : current_cookbook\n preview_path = \"#{PDF_PREVIEW_FOLDER}/preview_cookbook-#{@cookbook.id}_#{Time.now.to_i}.pdf\"\n session[:preview_filename] = preview_path\n preview = CookbookPreviewWorker.new(\n cookbook: @cookbook, \n filename: preview_path\n )\n preview.cookbook\n render \"previews/preview\"\n end", "def set_freelancer_document\n @freelancer_document = FreelancerDocument.find(params[:id])\n end", "def render\n @document.playback_attributes @attributes\n renderer.render(@template_name, self)\n end", "def set_document\n @document = Document.find_by(slug: params[:id])\n end", "def set_document\n @document = Document.find(params[:id])\n @case = @document.case\n set_breadcrumbs\n add_breadcrumb @document, document_path(@document)\n rescue ActiveRecord::RecordNotFound\n render_404\n end", "def markup_context=(_arg0); end", "def set_template\n end", "def url_for_document(doc, _options = {})\n if respond_to?(:blacklight_config) && doc.respond_to?(:[])\n display_type = doc[blacklight_config.show.display_type_field].presence\n if display_type == 'Collection' || display_type == 'Institution'\n { controller: display_type.downcase.pluralize, action: :show, id: doc }\n else\n doc\n end\n else\n doc\n end\n end", "def set_docfile\n @docfile = Docfile.find(params[:id])\n end", "def show\n @preset = Preset.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @preset }\n end\n end", "def fulldoc_template; end", "def set_freelance_doc\n @freelance_doc = FreelanceDoc.find(params[:id])\n end", "def link_to_document(doc, field_or_opts = nil, opts={:label=>nil, :counter => nil, :results_view => true})\n # opts[:label] ||= blacklight_config.index.show_link.to_sym unless blacklight_config.index.show_link == nil\n # label = _cornell_render_document_index_label doc, opts\n if params[:controller] == 'bookmarks'\n label = field_or_opts\n docID = doc.id\n link_to label, '/bookmarks/' + docID\n else\n # link_to label, doc, { :'data-counter' => opts[:counter] }.merge(opts.reject { |k,v| [:label, :counter, :results_view].include? k })\n super\n end\n end", "def set_docu_template\n @docu_template = DocuTemplate.find(params[:id])\n end", "def global_template_data\n {'__design_id' => @stylesheet.design_id}\n end", "def decorate_resource( rsrc )\n rsrc.label = self.channum\n rsrc.title = self.name\n end", "def _render_\n document.to_s\n end", "def render_document_view(document, options = {})\n options.symbolize_keys!\n\n # Render based on active_source -- unless an alternative is passed in\n @active_source ||= active_source\n options[:source] ||= @active_source\n\n template = options.delete(:template) || raise('Must specify template')\n formats = determine_formats(document, @active_source, options.delete(:format))\n partial_list = formats.map { |format| \"/_formats/#{format}/#{template}\" }\n\n @add_row_style = options[:style]\n view = render_first_available_partial(partial_list, options.merge(document: document))\n @add_row_style = nil\n\n view\n end", "def url_for_document(doc, opt = nil)\n opt = opt ? opt.dup : {}\n canon = opt.delete(:canonical)\n lens = opt.delete(:lens)\n lens = Blacklight::Lens.canonical_for(lens || doc) if canon\n if !lens && !doc.is_a?(Blacklight::Document)\n doc\n elsif !lens && (rte = blacklight_config_for(doc).show.route).is_a?(Hash)\n rte = rte.merge(action: :show, id: doc.id).merge(opt)\n rte[:controller] = params[:controller] if rte[:controller] == :current\n rte\n else\n lens ||= lens_key_for(doc)\n { controller: lens, action: :show, id: doc.id }.merge(opt)\n end\n end", "def set_design\n if(Gooey::Design.where({name:params[:id]}).exists?)\n @design = Gooey::Design.where({name:params[:id]})[0]\n else\n @design = Gooey::Design.find(params[:id])\n end\n end", "def url_for_document(doc, options = {})\n return doc unless routable?(doc)\n\n route = blacklight_config.view_config(:show).route.merge(action: :show, id: doc).merge(options)\n route[:controller] = params[:controller] if route[:controller] == :current\n route\n end", "def build_pdf_rendering(file_set_id)\n file_set_document = query_for_rendering(file_set_id)\n pdf_path = file_set_document.to_h.with_indifferent_access.dig(:parent_path_tesi).to_s + '/pdf'\n\n {\n \"@id\"=> pdf_path,\n \"label\"=> \"Download as PDF\",\n \"format\"=> \"application/pdf\"\n }\n end", "def preview_index\n preview_path = \"#{PDF_PREVIEW_FOLDER}/preview_index-#{current_cookbook.id}_#{Time.now.to_i}.pdf\"\n session[:preview_filename] = preview_path\n preview = CookbookPreviewWorker.new(\n cookbook: current_cookbook, \n filename: preview_path\n )\n preview.index\n render \"previews/preview\"\n end", "def set_document\r\n @document = Document.find(params[:id])\r\n end", "def url_for_document doc, options = {}\n if respond_to?(:blacklight_config) && doc.respond_to?(:[])\n display_type = doc[blacklight_config.show.display_type_field].presence\n if display_type == 'Collection' || display_type == 'Institution'\n {controller: display_type.downcase.pluralize, action: :show, id: doc}\n else\n doc\n end\n else\n doc\n end\n end", "def design_doc\n database.get(\"_design/#{design_doc_slug}\")\n end", "def set_document\n @document = Document.find_by(:object_key => params[:id])\n if @document.nil?\n redirect_to '/404'\n return\n end\n end", "def setup \n @pdf_name = \"pdf name\"\n @options = { :pdf_layout => \"reports_layout.pdf.erb\", :pdf_template => \"reports/report.pdf.erb\", \n :render_options => {\n :header_right => 'Page [page] of [toPage]',\n :grayscale => true,\n :page_size => 'Letter'} \n } \n @page = \"<html><head><head><body><b>Hello</b> World</body></html>\" \n \n TooRendermonkey.configure = {\n :uri => \"http://localhost:4567/generate\",\n :api_key => \"835a3161dc4e71b\",\n :hash_key => \"sQQTe93eWcpV4Gr5HDjKUh8vu2aNDOvn3+suH1Tc4P4=\"\n } \n end", "def set_doc_file\n @doc_file = DocFile.find(params[:id])\n end", "def set_document\n @document = Document.find_by(:object_key => params[:id])\n\n unless @document\n @status = :fail\n @data = {id: \"Document #{params[:id]} not found.\"}\n render status: :not_found, json: json_response(:fail, data: @data)\n end\n end", "def designer\r\n @page = Page.find(params[:id])\r\n data = File.read(\"#{Rails.public_path}/#{@page.project_id}/#{@page.page_name}.html\")\r\n @page.update_attribute(:html , data)\r\n render 'designer'\r\n end", "def set_adoc_name\n @adoc_name = AdocName.find(params[:id])\n end", "def generate_solr_document\n super.tap do |solr_doc|\n solr_doc['member_works_count_isi'] = member_works_count\n solr_doc['title_ssort'] = sort_title\n solr_doc['creator_ssort'] = object.creator.first\n solr_doc['generic_type_sim'] = [\"Collection\"]\n solr_doc['banner_path_ss'] = banner_path\n solr_doc['source_collection_title_for_collections_ssim'] = source_collection\n solr_doc['deposit_collection_titles_tesim'] = deposit_collection\n solr_doc['deposit_collection_ids_tesim'] = object.deposit_collection_ids\n end\n end", "def set_document\n @document = Document.find(params[:id])\n end", "def id\n \"#{doc.id}#excerpt\"\n end", "def preview\n preview_path = \"#{PDF_PREVIEW_FOLDER}/preview_extra_page-#{@extra_page.id}_#{Time.now.to_i}.pdf\"\n session[:preview_filename] = preview_path\n preview = CookbookPreviewWorker.new(\n cookbook: current_cookbook, \n filename: preview_path\n )\n preview.extra_page @extra_page.id\n render \"previews/preview\"\n end", "def preview_title_and_toc\n preview_path = \"#{PDF_PREVIEW_FOLDER}/preview_title_toc-#{current_cookbook.id}_#{Time.now.to_i}.pdf\"\n session[:preview_filename] = preview_path\n preview = CookbookPreviewWorker.new(\n cookbook: current_cookbook, \n filename: preview_path\n )\n preview.title_and_toc\n render \"previews/preview\"\n end", "def index\n @setid = params[:setid]\n #returns the resource view. Notes that it was passed a set as parameter and not a resource itself.\n @view = session[:application].get(params[:setid]).resources[0].explorator::view\n end", "def prezi( prezi_id, label = 'Link to presentation', size = [512,384] )\n\t%Q|<object class=\"prezi\" id=\"prezi_#{prezi_id}\" name=\"prezi_#{prezi_id}\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"#{size[0]}\" height=\"#{size[1]}\"><param name=\"movie\" value=\"http://prezi.com/bin/preziloader.swf\"><param name=\"allowfullscreen\" value=\"true\"><param name=\"allowscriptaccess\" value=\"always\"><param name=\"bgcolor\" value=\"#ffffff\"><param name=\"flashvars\" value=\"prezi_id=#{prezi_id}&amp;lock_to_path=1&amp;color=ffffff&amp;autoplay=no\"><embed id=\"preziEmbed_#{prezi_id}\" name=\"preziEmbed_#{prezi_id}\" src=\"http://prezi.com/bin/preziloader.swf\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" allowscriptaccess=\"always\" width=\"#{size[0]}\" height=\"#{size[1]}\" bgcolor=\"#ffffff\" flashvars=\"prezi_id=#{prezi_id}&amp;lock_to_path=1&amp;color=ffffff&amp;autoplay=no\"></embed></object><div class=\"prezi\"><a href=\"http://prezi.com/#{prezi_id}/\">#{label}</div>|\nend", "def show_documentation req, res\n store, path = documentation_source req.path\n\n if_modified_since req, res, store.cache_path\n\n generator = generator_for store\n\n case path\n when nil, '', 'index.html' then\n res.body = generator.generate_index\n when 'table_of_contents.html' then\n res.body = generator.generate_table_of_contents\n when 'js/search_index.js' then\n documentation_search store, generator, req, res\n else\n documentation_page store, generator, path, req, res\n end\n ensure\n res.content_type ||= 'text/html'\n end", "def render_viewer_in_context(document, block)\n canvas = choose_canvas_id(block)\n if params[:controller] == 'spotlight/catalog'\n render partial: current_exhibit.required_viewer.to_partial_path,\n locals: { document: document, block: block, canvas: canvas }\n else\n render partial: current_exhibit.required_viewer.default_viewer_path,\n locals: { document: document, block: block, canvas: canvas }\n end\n end", "def set_document\r\n @document = Document.find(params[:id])\r\n end", "def url_for_document doc, options = {}\n if respond_to?(:blacklight_config) and\n blacklight_config.show.route and\n (!doc.respond_to?(:to_model) or doc.to_model.is_a? SolrDocument)\n route = blacklight_config.show.route.merge(action: :show, id: doc).merge(options)\n route[:controller] = controller_name if route[:controller] == :current\n route\n else\n doc\n end\n end", "def set_document\n @document = Document.find(params[:id])\n end", "def set_document\n @document = Document.find(params[:id])\n end", "def set_document\n @document = Document.find(params[:id])\n end", "def set_document\n @document = Document.find(params[:id])\n end", "def compile_fragment(doc)\n evaluate_option(:writer, doc) do\n value = render_filter(get)\n write_fragment(doc, value)\n end\n end", "def link_to_document(doc, opts={:label=>Blacklight.config[:index][:show_link].to_sym, :counter => nil})\n label = case opts[:label]\n when Symbol\n doc.get(opts[:label])\n when String\n opts[:label]\n else\n raise 'Invalid label argument'\n end\n link_to_with_data(label, catalog_path(doc[:id]), {:method => :put, :data => {:counter => opts[:counter]}})\n end", "def generate_solr_document\n super.tap do |solr_doc|\n # account\n solr_doc[Solrizer.solr_name('account', :displayable)] = object.account.to_json\n solr_doc[Solrizer.solr_name('account_type', :facetable)] = object.account.map { |a| a.account_type.first }.reject(&:blank?)\n # contact\n solr_doc[Solrizer.solr_name('contact_label', :facetable)] = object.contact.map { |c| c.label.first }.reject(&:blank?)\n solr_doc[Solrizer.solr_name('contact', :displayable)] = object.contact.to_json\n # template files\n solr_doc['template_path_ss'] = object.members.select {\n |m| m.resource_type.include? ('Data paper template')}.\n map{ |f| Hyrax::Engine.routes.url_helpers.download_path(f.id)\n }\n end\n end", "def label(field, _opts = {})\n if field != @document.id\n super\n else\n render_citation(@document)\n end\n end", "def prepare_render\n @content = '## Página no encontrada'\n event = Event.find(params[:event_id])\n if (event)\n pages = event.pages.select{ |page| page.path == params[:page_path]}\n unless(pages.empty?)\n @content = MarkdownEventParser.add_event_details(event, pages[0].content)\n end\n end\n @content = MARKDOWN.render(@content)\n render\n end", "def document=(_arg0); end", "def document=(_arg0); end", "def document=(_arg0); end", "def document=(_arg0); end", "def document=(_arg0); end", "def document=(_arg0); end", "def document=(_arg0); end", "def document=(_arg0); end", "def document=(_arg0); end", "def build_pdf_rendering(file_set_id)\n file_set_document = query_for_rendering(file_set_id)\n paged_resource_id = file_set_document.dig(:is_page_of_ssi)\n\n {\n \"@id\"=> pdf_hyrax_paged_resource_path(paged_resource_id),\n \"label\"=> \"Download as PDF\",\n \"format\"=> \"application/pdf\"\n }\n end", "def show\n \n # @response, @document = get_solr_response_for_doc_id(params[:id], )\n @response, @document = get_solr_doc_with_gated_discovery(params[:id])\n folder_siblings(@document)\n\n \n respond_to do |format|\n format.html {setup_next_and_previous_documents}\n\n # Add all dynamically added (such as by document extensions)\n # export formats.\n @document.export_formats.each_key do | format_name |\n # It's important that the argument to send be a symbol;\n # if it's a string, it makes Rails unhappy for unclear reasons. \n format.send(format_name.to_sym) { render :text => @document.export_as(format_name), :layout => false }\n end\n \n end\n rescue Blacklight::Exceptions::InvalidSolrID\n flash[:notice]= \"You do not have sufficient access privileges to read this document, which has been marked private.\"\n redirect_to(\"/\") and return false\n end", "def show\n @response = search_service.fetch(params[:id]).first\n @document = @response.documents.first\n if @document.generic_file?\n @document = nil\n raise DRI::Exceptions::BadRequest, \"Invalid object type DRI::GenericFile\"\n end\n\n @children = @document.children(limit: 100).select { |child| child.published? }\n\n # assets ordered by label, excludes preservation only files\n @assets = @document.assets(ordered: true)\n @file_display_type_count = @document.file_display_type_count(published_only: true)\n @presenter = DRI::ObjectInCatalogPresenter.new(@document, view_context)\n supported_licences\n @reader_group = governing_reader_group(@document.collection_id) unless @document.collection?\n\n if @document.doi\n doi = DataciteDoi.where(object_id: @document.id).current\n @doi = doi.doi if doi.present? && doi.minted?\n end\n\n if @document.published?\n dimensions = { collection: @document.root_collection_id, object: @document.id }\n dimensions[:organisation] = @document.depositing_institute.name if @document.depositing_institute.present?\n @dimensions = dimensions\n @track_download = true\n end\n\n respond_to do |format|\n format.html { @search_context = setup_next_and_previous_documents }\n format.json do\n options = {}\n options[:with_assets] = true if can?(:read, @document)\n options[:with_metadata] = true\n formatter = DRI::Formatters::Json.new(self, @document, options)\n render json: formatter.format(func: :as_json)\n end\n format.ttl do\n options = {}\n options[:with_assets] = true if can?(:read, @document)\n options[:with_metadata] = true\n formatter = DRI::Formatters::Rdf.new(self, @document, options)\n render plain: formatter.format({format: :ttl})\n end\n format.rdf do\n options = {}\n options[:with_assets] = true if can?(:read, @document)\n options[:with_metadata] = true\n formatter = DRI::Formatters::Rdf.new(self, @document, options)\n render plain: formatter.format({format: :xml})\n end\n format.js { render layout: false }\n\n additional_export_formats(@document, format)\n end\n end", "def show\n @response, @document = get_solr_response_for_doc_id params[:id]\n respond_to do |format|\n format.html {setup_next_and_previous_documents}\n format.rss { render :layout => false }\n # Add all dynamically added (such as by document extensions)\n # export formats.\n @document.export_formats.each_key do | format_name |\n # It's important that the argument to send be a symbol;\n # if it's a string, it makes Rails unhappy for unclear reasons.\n format.send(format_name.to_sym) { render :text => @document.export_as(format_name), :layout => false }\n end\n\n end\n end" ]
[ "0.5854299", "0.5738233", "0.55672073", "0.55521834", "0.5502645", "0.5494652", "0.54903424", "0.5471691", "0.5463941", "0.5455128", "0.54450744", "0.5430332", "0.54270226", "0.5425831", "0.5425831", "0.5391101", "0.5360389", "0.53223485", "0.52882814", "0.52721", "0.52658117", "0.52638453", "0.5239487", "0.52379954", "0.52280194", "0.5213963", "0.5181336", "0.51790434", "0.51753557", "0.51736635", "0.5162025", "0.5161006", "0.5154318", "0.5152095", "0.5136761", "0.51363033", "0.512075", "0.51055235", "0.50913227", "0.50876415", "0.5081937", "0.5080929", "0.5080203", "0.50798243", "0.50788265", "0.50749475", "0.50736547", "0.5073315", "0.5072781", "0.50708264", "0.5070384", "0.50630546", "0.5060264", "0.5054012", "0.5047786", "0.50471103", "0.5042504", "0.5039375", "0.50374585", "0.50326663", "0.5031788", "0.50304544", "0.50248605", "0.50165474", "0.5006684", "0.5005329", "0.50037366", "0.49950024", "0.49945113", "0.49887654", "0.49880177", "0.4979093", "0.49750084", "0.496881", "0.49627322", "0.4960449", "0.4958214", "0.4957263", "0.49554232", "0.49554232", "0.49554232", "0.49554232", "0.4948749", "0.4946271", "0.49460134", "0.49363157", "0.4933476", "0.49291468", "0.49291468", "0.49291468", "0.49291468", "0.49291468", "0.49291468", "0.49291468", "0.49291468", "0.49291468", "0.49262637", "0.49143726", "0.49134248", "0.4911126" ]
0.5724434
2
Return a JSON object with image information add &metadata=true for image metadata add &presets=true for preset url for this image add &relative=true for relative urls instead of absolute
def info(preset, source_path, format) url_opts = { :storage => params[:storage], :preset => preset, :format => format } relative_uri = url_for_image(params[:relative_path], url_opts) absolute_path = Merb.dir_for(:public) / relative_uri base_url = params[:relative] ? '' : (request.protocol + "://" + request.host) information = {} information[:format] = format information[:preset] = preset information[:exists] = File.file?(absolute_path) information[:metadata] = slice.metadata_for(absolute_path) if information[:exists] && params[:metadata] if params[:presets] preset_names.inject(information[:presets] ||= {}) do |presets, preset_name| preset_uri = url_for_external_image(params[:relative_path], url_opts.merge(:preset => preset_name)) presets[preset_name] = base_url + preset_uri presets end end self.content_type = :json information.to_json end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_image_metadata\n {}\n end", "def info(preset, source_uri, format)\n url_opts = { :storage => params[:storage], :preset => preset, :format => format }\n relative_uri = url_for_external_image(params[:relative_path], url_opts)\n absolute_path = Merb.dir_for(:public) / relative_uri\n base_url = params[:relative] ? '' : (request.protocol + \"://\" + request.host)\n \n information = {}\n information[:source] = source_uri\n information[:format] = format\n information[:preset] = preset\n information[:exists] = File.file?(absolute_path)\n information[:metadata] = slice.metadata_for(absolute_path) if information[:exists] && params[:metadata]\n \n if params[:presets]\n preset_names.inject(information[:presets] ||= {}) do |presets, preset_name|\n preset_uri = url_for_external_image(params[:relative_path], url_opts.merge(:preset => preset_name))\n presets[preset_name] = base_url + preset_uri\n presets\n end\n end\n \n self.content_type = :json\n information.to_json\n end", "def imagga_images_info\n self.images.non_installation.collect do |image|\n image_options = { :image_url => image.filename.to_s }\n image_options.merge! pattern: image.pattern.name if image.pattern.present?\n image_options.merge! thumb_url: image.s3_path if image.s3_path.present?\n { :url => image.filename.to_s.gsub('https','http').gsub('-dev',''), :id => image.filename.path, :filepath => image.filename.path, :metadata => self.specifications_hash.merge(image_options) }\n end.flatten\n end", "def tineye_images_info\n self.images.non_installation.collect do |image|\n image_options = { :image_url => image.filename.to_s }\n image_options.merge! pattern: image.pattern.name if image.pattern.present?\n image_options.merge! thumb_url: image.s3_path if image.s3_path.present?\n { :url => image.filename.to_s, :filepath => image.filename.path, :metadatum => self.specifications_hash.merge(image_options) }\n end.flatten\n end", "def info( options =nil )\n json = request 'images.getInfo', options, :ImageID => image_id, :ImageKey => key\n \n image = upper_hash_to_lower_hash( json['Image'] )\n image.merge!( :image_id => image[\"id\"] )\n \n OpenStruct.new( image ) \n end", "def image_hash\n @image_hash ||= begin\n image_meta = page[\"image\"]\n\n case image_meta\n when Hash\n { \"path\" => nil }.merge!(image_meta)\n when String\n { \"path\" => image_meta }\n else\n { \"path\" => nil }\n end\n end\n end", "def image_hash\n @image_hash ||= begin\n image_meta = page[\"image\"]\n\n case image_meta\n when Hash\n { \"path\" => nil }.merge!(image_meta)\n when String\n { \"path\" => image_meta }\n else\n { \"path\" => nil }\n end\n end\n end", "def images\n {\n thumbnail: object.thumbnail.url(:large),\n logo: object.logo.url(:medium),\n white_logo: object.white_logo.url(:medium)\n }\n end", "def get_images\n {}\n end", "def extra_images(options)\n {}\n end", "def image_hash; end", "def img_properties\n par = params[:image]\n if !par\n # json webservice call, not coming from rails form. Change all keys from camelcased to underscores\n par = params\n %w(pageUrl originalUrl calibrateLength calibrateUnit calibrateCoords).each do |p|\n par[p.underscore] = par[p]\n par.delete(p)\n end\n end\n par\n end", "def as_json(*args)\n {\n 'image' => parent_image,\n 'url' => url,\n 'path' => path,\n 'pathWithQuery' => path_with_query,\n 'width' => width,\n 'height' => height,\n 'x1' => x1,\n 'x2' => x2,\n 'y1' => y1,\n 'y2' => y2\n }\n end", "def image_embed\n return unless image\n {\n kind: 'image',\n title: image['url'],\n image: image\n }\n end", "def extract_image_data(instagram_metadata)\n {\n url: instagram_metadata.link,\n external_id: instagram_metadata.id,\n large_url: instagram_metadata.images.standard_resolution.url,\n name: instagram_metadata.caption && instagram_metadata.caption.text,\n tags: instagram_metadata.tags,\n user: instagram_metadata.user,\n original_datetime: Time.at(instagram_metadata.created_time.to_i).to_datetime,\n original_metadata: instagram_metadata,\n media_type: instagram_metadata.type,\n video_url: instagram_metadata.videos && instagram_metadata.videos.standard_resolution.url\n }\n end", "def get_images_data\t\t\t\t\t\t\n\t\t{ payload: { 'makes' => makes_dropdown, 'images' => images_array('none').compact}, success: true}\n\tend", "def image\n return unless object.image.attached?\n\n # object.image.blob.attributes\n # .slice('filename', 'byte_size')\n # .merge(url: image_url)\n # .tap { |attrs| attrs['name'] = attrs.delete('filename') }\n object.image.service_url\n \n end", "def get_image\n {\n \"attachments\": [\n {\n \"fallback\": \"Alex Trabek and Sean Connery.\",\n \"color\": \"#36a64f\",\n \"pretext\": \"\",\n \"author_name\": \"Trabek\",\n \"text\": \"\",\n \"image_url\": \"http://www2.pictures.zimbio.com/mp/GWnfFL2ID3Fl.jpg\",\n \"ts\": 123456789\n }\n ]\n }.to_json\n end", "def to_jq_upload\n {\n \"name\" => read_attribute(:image),\n \"size\" => image.size,\n \"url\" => image.url,\n \"thumbnail_url\" => image.thumb.url,\n \"show_url\" => property_photo_path(property_id: property.id, id: id),\n }\n end", "def images\n if !@images\n @images = {}\n @images[:thumb] = self.thumb_image if self.thumb_image\n @images[:tiny_image] = self.tiny_image if self.tiny_image\n @images[:small] = self.small_image if self.small_image \n @images[:medium] = self.medium_image if self.medium_image\n @images[:large] = self.large_image if self.large_image\n end\n end", "def build_empty_image\n {\n id: id, src: '', displayPath: '', thumbnail: '',\n thumbnailWidth: 127, thumbnailHeight: 180,\n caption: '', isSelected: false, editPath: '', mimeType: ''\n }\n end", "def build_empty_image\n {\n id: id, src: '', displayPath: '', thumbnail: '',\n thumbnailWidth: 127, thumbnailHeight: 180,\n caption: '', isSelected: false, editPath: '', mimeType: ''\n }\n end", "def to_api\n\n results = {\n 'client_id' => id,\n 'name' => name,\n 'nation_builder' => nation_builder_crm_authentication ? nation_builder_crm_authentication.to_api : nil\n }\n\n Client::IMAGE_SIZES.each do |label, size|\n results[\"image_#{label}\"] = avatar(label)\n end\n\n return results;\n end", "def as_json options={}\n t_url = ProductImage.get_thumbnail_image_path(self.product_id,true)\n t_url = \"\" if t_url.nil?\n \n f_url = ProductImage.get_fullsize_image_path(self.product_id,true)\n f_url = \"\" if f_url.nil?\n \n options[:except] = [:updated_at,:origin,:brand_id,:price]\n j = super options\n j[\"thumbnail_url\"] = t_url\n j[\"fullsize_url\"] = f_url\n j[\"created_at\"] = j[\"created_at\"].to_i\n \t \n return j\n\tend", "def image\n image = Weatherman::Image.new(attribute('image'))\n do_convertions(image, [:width, :to_i], [:height, :to_i], :title, :link, :url)\n end", "def images; end", "def container_images\n add_properties(\n # TODO: (bpaskinc) old save matches on [:image_ref, :container_image_registry_id]\n # TODO: (bpaskinc) should match on digest when available\n # TODO: (mslemr) provider-specific class exists (openshift), but specs fail with them (?)\n :model_class => ::ContainerImage,\n :manager_ref => %i[image_ref],\n :delete_method => :disconnect_inv\n )\n add_common_default_values\n end", "def image\n self['image'] || self['image_src']\n end", "def image\n response[\"image\"]\n end", "def create\n @image = Image.new(image_params)\n respond_to do |format|\n if @image.save\n format.json { render :json => { url: @image.image.url} }\n else\n \n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "def to_h\n if image_meta && image_meta['width'] && image_meta['height']\n { pid: id, src: file.url, msrc: file.tiny.url, w: image_meta['width'], h: image_meta['height'] }\n else\n # Choose some plausible default if the metadata is missing.\n { pid: id, src: file.large.url, msrc: file.tiny.url, w: 1440, h: 900 }\n end\n end", "def marketplace_image_my_images_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: VnfsApi.marketplace_image_my_images ...'\n end\n # resource path\n local_var_path = '/1.0.0/marketplace/image/my_images/'\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'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oAuth2']\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 => 'InlineResponse2009')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VnfsApi#marketplace_image_my_images\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def metadata(options: DEFAULT_OPTIONS)\n output = %x(exiftool #{options} -json #{file.path.shellescape})\n json = JSON.parse(output).first\n json = json.except(\"SourceFile\")\n ExifTool::Metadata.new(json.with_indifferent_access)\n end", "def images\n @images ||= {}\n end", "def get_mp_child_image_info mp_child\n\n resource = Resource.new\n resource.location, resource.rtype =\n mp_child.attr(\"src\").to_s, BookReaderHelper::IMAGE\n resource\n\n end", "def details( options =nil )\n json = request 'images.getEXIF', options,\n :ImageID => image_id, :ImageKey => key\n \n image = upper_hash_to_lower_hash( json['Image'] )\n image.merge!( :image_id => image[\"id\"] )\n \n OpenStruct.new( image )\n end", "def as_json(options = {})\n {\n :id => id,\n :user_id => user_id,\n :latitude => latitude,\n :longitude => longitude,\n :thumbnail => file.url(:thumb),\n :small => file.url(:small),\n\t\t\t:smaller => file.url(:smaller),\n :medium => file.url(:medium),\n :original => file.url\n }\n end", "def to_jq_upload\n { \n \"name\" => read_attribute(:image),\n \"size\" => image.size,\n \"url\" => image.url,\n \"id\" => id,\n \"album_id\" => album_id,\n \"thumbnail_url\" => image.thumb_x.url,\n \"delete_url\" => \"...\",\n \"delete_type\" => \"DELETE\"\n }\n end", "def image_metadata\n return @image_metadata unless @image_metadata.nil?\n count = page_count\n array = []\n (1..page_count).each do |page|\n logical_value = @doc.xpath(\"//mets:structMap[@TYPE='Logical']/mets:div/mets:div[@ORDER='#{page}']\").first.attr(\"TYPE\")\n physical_value = @doc.xpath(\"//mets:structMap[@TYPE='Physical']/mets:div/mets:div[@ORDER='#{page}']\").first.attr(\"TYPE\")\n array << {id: page, physical: physical_value, logical: logical_value}\n end\n @image_metadata = array\n @image_metadata\n end", "def images\n @picturesandmeta = Pictureandmeta.all\n @kind = Kind.find(params[:kind_id])\n Rails.logger.info(\"Kind: #{@kind.inspect}\")\n end", "def to_jq_upload\n {\n \"name\" => read_attribute(:image_name),\n \"size\" => image.size,\n \"url\" => image.url,\n \"thumbnail_url\" => image.thumb('80x80#').url,\n \"delete_url\" => shot_path(:id => id),\n \"delete_type\" => \"DELETE\" \n }\n end", "def marketplace_image_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: VnfsApi.marketplace_image ...'\n end\n # resource path\n local_var_path = '/1.0.0/marketplace/image'\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'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oAuth2']\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 => 'InlineResponse2009')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VnfsApi#marketplace_image\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @image_attrib = ImageAttrib.new(image_attrib_params)\n\n if @image_attrib.save\n render :show, status: :created, location: @image_attrib\n else\n render json: @image_attrib.errors, status: :unprocessable_entity\n end\n end", "def photo_format; end", "def container_images\n add_properties(\n # TODO: (bpaskinc) old save matches on [:image_ref, :container_image_registry_id]\n # TODO: (bpaskinc) should match on digest when available\n # TODO: (mslemr) provider-specific class exists (openshift), but specs fail with them (?)\n :model_class => ::ContainerImage,\n :manager_ref => %i[image_ref],\n :delete_method => :disconnect_inv,\n :custom_reconnect_block => custom_reconnect_block\n )\n add_common_default_values\n end", "def info_get_metadata_with_http_info(image_file, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: InfoApi.info_get_metadata ...'\n end\n # verify the required parameter 'image_file' is set\n if @api_client.config.client_side_validation && image_file.nil?\n fail ArgumentError, \"Missing the required parameter 'image_file' when calling InfoApi.info_get_metadata\"\n end\n # resource path\n local_var_path = '/image/get-info/metadata'\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', 'text/json', 'application/xml', 'text/xml'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])\n\n # form parameters\n form_params = {}\n form_params['imageFile'] = image_file\n\n # http body (model)\n post_body = nil\n auth_names = ['Apikey']\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 => 'ImageMetadata')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: InfoApi#info_get_metadata\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def image; end", "def wiki_image_data(image)\n RestClient.get(image['image_url'], :accept => image['image_content_type'])\n end", "def images\n @images ||= ApiFactory.new 'Projects::Images'\n end", "def image\n @data['images']&.first\n end", "def output\n { images: images, stemcells: [], repository_bases: repository_bases }\n end", "def image\n end", "def image\n end", "def image\n return @children['image'][:value]\n end", "def images_with_urls images\n result_images = []\n\n images.each do |image|\n url = image.file_url\n result = image.as_json\n result[\"url\"] = url\n result_images << result\n end\n result_images\n end", "def img_params\n\n end", "def extract_image_properties(request)\n http_request = request.to_http_info(@api_client.config)\n make_request(http_request, :POST, 'ImagingResponse')\n end", "def images\n @images ||= Hash.new\n end", "def urls( options =nil )\n json = request 'images.getURLs', options, :ImageID => image_id, :ImageKey => key\n \n image = upper_hash_to_lower_hash( json['Image'] )\n image.merge!( :image_id => image[\"id\"] )\n \n OpenStruct.new( image ) \n end", "def image hash = {}\n hash = { :id => hash} if hash.is_a? String\n home hash.update :action => 'image', :trailing_slash => false\n end", "def convert_image(image)\n Image.new(\n :id => image[\"id\"],\n :name => image[\"name\"],\n :owner_id => image[\"owner\"],\n :description => image[\"description\"],\n :architecture => \"i386\",\t# TODO: parse this from supportedInstanceType IDs w/ HW profile lookup\n :state => @@IMAGE_STATE_MAP[image[\"state\"]]\n )\n end", "def create \n @image ||= Image.new(image_params)\n if @image.save\n render json: {\"url\" => @image.image_url(:resized), \"success\" => true}\n else\n render json: @image.errors, status: :unprocessable_entity\n end\n end", "def info_file\n @info_file ||= File.join(image_dir, '_info.json')\n end", "def image_url\n\t\t\t@data[\"image\"][\"source\"]\n\t\tend", "def update_image_attributes\n if imageable.present?\n self.width, self.height = `identify -format \"%wx%h\" #{url.file.path}`.split(/x/)\n end\n end", "def as_json(options = {})\n {\n id: self.id,\n name: self.product_name,\n small_image: self.small_image_url,\n small_image_retina: self.small_image_retina_url,\n splash_image: self.splash_image_url,\n splash_image_retina: self.splash_image_retina_url\n }\n end", "def images_across_projs\n # return a list of Images (only) that are linked through ImageDescriptions, spanning all projects\n # Image.find(:all) \n false\n end", "def to_jq_upload\n {\n \"name\" => read_attribute(:image),\n \"size\" => image.size,\n \"url\" => image.url,\n \"thumbnail_url\" => image.thumb.url,\n \"delete_url\" => admin_archive_path(self),\n \"delete_type\" => \"DELETE\" \n }\n end", "def create\n par = img_properties\n logger.info(\"parameters: #{par.inspect}\")\n valid = true\n\n begin\n url = par[:original_url] || par[:url]\n\n @image = Image.new do |i|\n #specify all properties to copy explicitly\n i.user = @user\n # set optional parameters\n i.name = par[:name] if !par[:name].blank?\n i.ref = par[:ref] if !par[:ref].blank?\n i.original_url = url if url\n i.page_url = par[:page_url] if !par[:page_url].blank?\n i.source = par[:source] if !par[:source].blank?\n i.image_type = Image::TYPE_LS\n end\n\n # this may fail\n @image.remote_upload_url = url\n\n # set calibration data if specified\n if !par[:calibrate_length].blank?\n @image.calibrate_length = par[:calibrate_length].to_f\n @image.calibrate_unit = par[:calibrate_unit].to_i if !par[:calibrate_unit].blank?\n @image.calibrate_coords = par[:calibrate_coords] if !par[:calibrate_coords].blank?\n @image.ppi = calculate_ppi(@image)\n end\n\n rescue CarrierWave::DownloadError\n @image.errors.add(:remote_upload_url, \"^This url doesn't appear to be valid\")\n valid = false\n rescue CarrierWave::IntegrityError\n @image.errors.add(:remote_upload_url, \"^This url does not appear to point to a valid image\")\n valid = false\n rescue StandardError\n @image.errors.add(:remote_upload_url, \"There does not appear to be an image at this url\")\n valid = false\n end\n\n if valid && @image.save\n # update product if set\n @image.user_product = par[:product] if par[:product]\n\n render :json => @image.js_serialize, :callback => params[:callback]\n else\n render :json => { :error => 403, :messages => prepare_errors(@image), :callback => params[:callback]}, :status => 200\n end\n end", "def images\n end", "def upload_image\n @image = Image.create(image_path: params[:upload][:image])\n p @image\n render json: @image\n end", "def show\n @image_set = ImageSet.find(params[:id])\n\n render json: @image_set\n end", "def my_images(options = {})\n images options.merge(:owners => 'self')\n end", "def create_json\n respond_to do | wants |\n wants.json do\n _create do | image, image_placement |\n if image.save && image_placement.save\n render :layout => false, :json => { :status => 'UPLOADED', :image_url => url_for(:action=>'show', :id=>image_placement.id, :only_path => true)} \n # returning application/json, text/x-json, text/json cause Firefox 3 to try to open an app\n # returning text/html or application/xhtml+xml causes ampersands (&) in json \n # strings to get html_escape (&amp;)\n response.content_type = Mime::HTML\n else\n render :layout => false, :json => { :status => 'FAILED'}\n # otherwise Rails returns application/json and Firefox 3 tries to open an app\n response.content_type = Mime::HTML\n end\n end\n end\n end\n end", "def to_jq_upload\n {\n \"id\" => id,\n \"name\" => read_attribute(:image),\n \"size\" => image.size,\n \"url\" => image.url,\n \"thumbnail_url\" => image.thumb.url,\n \"delete_url\" => picture_path(:id => id),\n \"delete_type\" => \"DELETE\"\n }\n end", "def image\n options.fetch(:image, nil)\n end", "def images\n\t\t\timages = {}\n\t\t\tDir.chdir( File.join self.settings.public_dir, \"assets/images\" )\n\t\t\tDir.glob(\"*{#{Media::Image::FORMATS.join(',')}}\").each do |i|\n\t\t\t\tif i.match(/^site-1619-(.+)/)\n\t\t\t\t\tname = File.basename($1, File.extname($1))\n\t\t\t\t\timage = Media::Base.new(i)\n\t\t\t\t\timage.referrer = \"images\"\n\t\t\t\t\timages[name] = image.result\n\t\t\t\tend\n\t\t\tend\n\n\t\t\timages\n\t\tend", "def images\n @images ||= begin\n json_file = File.join(\n File.dirname(__FILE__), %w(.. .. .. data), \"#{config[:compute_provider][:name]}.json\"\n )\n if File.exist?(json_file)\n Smash.new(JSON.load(IO.read(json_file)))\n else\n warn(\"Failed to load defaults for #{config[:compute_provider][:name]} provider.\")\n Smash.new\n end\n end\n end", "def images\n images = []\n JSON.parse(resource['/offerings/image'].get)[\"images\"].each do |img|\n images << Image.new(img)\n end\n return images\n end", "def getimagesinfo\n trek = Trek.find_by_id(params[:id])\n send_data(trek.get_images_info.to_json,\n {:type => \"application/json\", :disposition => \"inline\"})\n end", "def restaurant_image\n if !check_step_info(@restaurant)\n return\n end\n\n render json: {:success => true, :attachmentPartial => render_to_string('restaurant_manage/restaurant_image', :layout => false ) }\n end", "def create_remote\n img = {}\n data = {}\n if params[:data].present?\n data = JSON.parse(params[:data]).symbolize_keys\n img = data[:image].symbolize_keys\n else\n img = params[:image]\n end\n model = @imageable.class\n former_image = @imageable.respond_to?(:images) ? nil : @imageable.image\n kind = img[:kind]\n kind = model::IMAGE_KINDS.keys.first if kind.blank? && model.const_defined?(:IMAGE_KINDS)\n image = Image.new(imageable: @imageable, kind: kind, legend: img[:legend].to_s, zoomable: (img[:zoomable].present? ? img[:zoomable] : true))\n if Figaro.env.s3_enabled.to_bool\n # Special field for carrierwave_direct's business\n image.img.key = data[:key]\n end\n if request.xhr?\n if image.save_and_process!\n former_image.try :destroy if former_image\n #image[:url] = image.img.url\n return render(json: image, status: :ok)\n end\n Rails.logger.error \"[Image Creation Error #{Time.zone.now.xmlschema}] #{image.errors.full_messages}\"\n errors = image.errors[:img]\n render json: [{ error: errors }], status: :error\n else\n if image.save_and_process!\n former_image.try :destroy if former_image\n #image[:url] = image.img.url\n if Figaro.env.s3_enabled.to_bool && Figaro.env.js_upload_enabled.to_bool && Figaro.env.js_s3_iframe_enabled.to_bool\n return render(nothing: true)\n end\n return redirect_to({ action: :assist, id: image })\n end\n Rails.logger.error \"[Image Creation Error #{Time.zone.now.xmlschema}] #{image.errors.full_messages}\"\n redirect_to parent_url, alert: \"L’image n’a pas pu être créée\"\n end\n end", "def to_info_hash\n return {} if @output.empty?\n meta = @output.split(\" \")\n # Count backwards as an image's path may contain a space\n {\n path: meta[0..-9].join(\" \"),\n format: meta[-8],\n dimensions: meta[-7].split(\"x\").map(&:to_i),\n depth: meta[-5],\n size: meta[-3]\n }\n end", "def get_rep_image(instances)\n rep = {}\n if instances && instances.is_a?(Array)\n instances.each do |instance|\n unless instance['digital_object'].blank? || instance['digital_object']['_resolved'].blank?\n it = instance['digital_object']['_resolved']\n unless !it['publish'] || it['file_versions'].blank?\n it['file_versions'].each do |ver|\n if ver['is_representative'] && ver['xlink_show_attribute'] == 'embed' && ver['publish']\n rep['title'] = strip_mixed_content(it['title'])\n rep['uri'] = ver['file_uri']\n end\n end\n end\n end\n end\n end\n rep\n end", "def image\n @args['Image']\n end", "def create\n @image = Image.new(image_params)\n\n respond_to do |format|\n if @image.save\n format.json { render json: @image, status: :created, location: [:admin, @image] }\n else\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "def media_presets\n site.data.dig('picture', 'media_presets') || {}\n end", "def image_option_response\n self.filtered_responses.map do |q|\n ENV['URL']+q.image_resp.url\n end\n end", "def as_json(options = {})\n if (photos.length > 0)\n photo = photos.max_by{|a| a.rating}\n pics = {\n :thumbnail => photo.file.url(:thumb),\n :small => photo.file.url(:small),\n\t\t\t\t:smaller => photo.file.url(:smaller),\n :medium => photo.file.url(:medium),\n :original => photo.file.url\n }\n else\n pics = {}\n end\n {\n :id => id,\n :user_id => user_id,\n :name => name,\n :radius => radius,\n :latitude => latitude,\n :longitude => longitude\n }.merge(pics)\n end", "def featured_image\n if object.featured_image.attached?\n {\n url: rails_blob_url(object.featured_image)\n }\n end\n end", "def meta_image(*args)\n if args.any?\n @meta_image = args.first\n else\n image = find_meta_image\n if image.is_a?(Image)\n dynamic_image_url(image, size: \"1200x\", only_path: false)\n else\n image\n end\n end\n end", "def image(name)\n @parts.push(image: \"#{Bioturk::Application.config.image_server_interface}#{name}\")\n end", "def to_jq_upload\n {\n \"name\" => read_attribute(:picture_name),\n \"size\" => picture.size,\n \"url\" => picture.url,\n \"thumbnail_url\" => picture.thumb('80x80#').url,\n \"delete_url\" => product_picture_path(:id => id),\n \"delete_type\" => \"DELETE\" \n }\n end", "def get_image_properties(request)\n http_request = request.to_http_info(@api_client.config)\n make_request(http_request, :GET, 'ImagingResponse')\n end", "def info(session, id)\n read_task('rvpe.image.info', session) do\n rc = call_one_xmlrpc('one.image.info', session, id)\n raise rc[1] unless rc[0]\n\n unless image_is_public?(rc[1])\n unless image_is_owned_by_session_owner?(rc[1], session)\n msg = \"You don't have permission to access the image.\"\n admin_session(session, true, msg) do; end\n end\n end\n\n doc = weave_image_size_to_xml(rc[1])\n [true, doc.to_s]\n end\n end", "def show\n @image = Image.find(params[:id])\n\n render json: @image\n end", "def show\n @image = Image.find(params[:id])\n\n render json: @image\n end", "def map_info_to_exif\n map = OpenStruct.new\n map.title = 'Title'\n map.description = 'Caption-Abstract'\n map.tags = 'Subject'\n map.latitude = 'GPSLatitude'\n map.longitude = 'GPSLongitude'\n map.location = 'Location'\n map.country = 'Country'\n map.url = 'UserComment'\n\n map\nend", "def image\n\n end", "def convert_image_get_image_info_with_http_info(input_file, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ConvertImageApi.convert_image_get_image_info ...'\n end\n # verify the required parameter 'input_file' is set\n if @api_client.config.client_side_validation && input_file.nil?\n fail ArgumentError, \"Missing the required parameter 'input_file' when calling ConvertImageApi.convert_image_get_image_info\"\n end\n # resource path\n local_var_path = '/convert/image/get-info'\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', 'text/json', 'application/xml', 'text/xml'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])\n\n # form parameters\n form_params = {}\n form_params['inputFile'] = input_file\n\n # http body (model)\n post_body = nil\n auth_names = ['Apikey']\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 => 'GetImageInfoResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConvertImageApi#convert_image_get_image_info\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end" ]
[ "0.7031549", "0.6963861", "0.690066", "0.68072295", "0.6803236", "0.650662", "0.650662", "0.64883614", "0.6450161", "0.6448246", "0.638009", "0.6376391", "0.6346044", "0.63023746", "0.6302329", "0.6246139", "0.62407583", "0.6240012", "0.6201065", "0.61896676", "0.6154038", "0.6154038", "0.61332434", "0.6114904", "0.6109065", "0.60996366", "0.6073207", "0.6069886", "0.6065656", "0.6010928", "0.5991168", "0.59896237", "0.59778666", "0.5926887", "0.59212303", "0.5916988", "0.5888345", "0.58824575", "0.5882329", "0.5879582", "0.5859769", "0.5853071", "0.58467615", "0.5843833", "0.58431804", "0.5838026", "0.58369166", "0.58336735", "0.5824901", "0.5820827", "0.58155143", "0.5808591", "0.5808591", "0.58004373", "0.5774532", "0.57686263", "0.57686067", "0.5768257", "0.5761575", "0.5752695", "0.5751205", "0.57502764", "0.5739074", "0.57317024", "0.57157207", "0.56979656", "0.56960094", "0.5681436", "0.5677893", "0.5676206", "0.5674628", "0.5670603", "0.56566125", "0.565485", "0.5653426", "0.5650755", "0.5646953", "0.56451374", "0.5640602", "0.56361073", "0.5633261", "0.5618324", "0.5617215", "0.5617209", "0.5616299", "0.5614356", "0.56108075", "0.5601312", "0.55949575", "0.5587397", "0.55862486", "0.5581775", "0.5575639", "0.55755997", "0.5573205", "0.55702335", "0.55702335", "0.5569381", "0.55668795", "0.5560114" ]
0.7020652
1
Return the internal url for the given image location.
def image_location url_opts = { :storage => params[:storage] || 'default', :preset => params[:preset] || 'default', :format => params[:format] || 'jpg' } raise BadRequest if request.raw_post.blank? base_url = params[:relative] ? '' : (request.protocol + "://" + request.host) image_uri = base_url + url_for_image(request.raw_post.strip, url_opts) self.status, headers["Location"] = 301, image_uri if params[:redirect] image_uri end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def image_url(source)\n abs_path = image_path(source)\n unless abs_path =~ /^http/\n abs_path = \"#{request.protocol}#{request.host_with_port}#{abs_path}\"\n end\n abs_path\n end", "def image_url\n return \"\" if @path.nil? || @path.empty?\n \"#{images_scheme}://#{images_host}/\" << if m = /^(pv4|pfk|p7s|p6o|p3w|p7s|p)\\/(.*)$/.match(@path)\n \"p/\" << m[2]\n else\n @path\n end\n end", "def image_url\n return unless image.attached?\n\n url_for(image)\n end", "def image_url\n is_processed ?\n FileSystem.url(image_path) : \n orig_image_url\n end", "def image_url\n is_processed ?\n FileSystem.url(image_path) : \n orig_image_url\n end", "def image_url(source)\n URI.join(root_url, image_path(source))\n end", "def image_location\n url_opts = { :storage => params[:storage] || 'default', :preset => params[:preset] || 'default', :format => params[:format] || 'jpg' }\n raise BadRequest if request.raw_post.blank?\n base_url = params[:relative] ? '' : (request.protocol + \"://\" + request.host)\n image_uri = base_url + url_for_external_image(request.raw_post.strip, url_opts)\n self.status, headers[\"Location\"] = 301, image_uri if params[:redirect]\n image_uri\n end", "def image_url\n image_uri\n end", "def image_url(page, image_src)\r\n image_uri = URI.parse(image_src)\r\n if image_uri.absolute?\r\n image_uri\r\n elsif image_uri.relative?\r\n root = URI::Generic.build :scheme => page.url.scheme, :host => page.url.host \r\n URI.join root.to_s, image_uri.to_s\r\n else\r\n raise BasiliskImageError, \"Could not parse image src.\"\r\n end\r\n rescue\r\n raise BasiliskImageError, \"Could not parse image src.\"\r\n end", "def image_url\n rails_blob_url(object.image)\n # This helper gets the URL from the file we pass to it\n end", "def image_location\n src || ''\n end", "def image_url\n Image.find(image_id).url\n end", "def imgurl\n picref.imgurl if picref\n end", "def unit_url\n is_processed ?\n FileSystem.url(unit_path) :\n orig_image_url\n end", "def full_image_uri\n return nil if image.nil?\n return image if image.start_with?('http://')\n return 'http://bookmarket.webhop.org/' + image\n end", "def image_url\n return @image_url\n end", "def image_url(ver)\n url_for_file_column(self, \"image\", ver)\n end", "def path_to_image(source)\n path = super(source)\n if @generate_urls_with_host\n protocol = request.protocol()\n path = protocol + request.host_with_port() + path\n end\n return path\n end", "def giant_url\n is_processed ?\n FileSystem.url(giant_path) : \n orig_image_url\n end", "def image_url(options = {})\n base_url = options[:base_url] || self.base_url || Configuration.DEFAULT_BASE_URL\n base_url << \"/\" if base_url[-1,1] != \"/\"\n base_url << image_path(options)\n end", "def cms_image_url(img_key)\n cms_host = 'http://local.amaysim2.com.au/' #TODO load from compass.yml\n \"#{cms_host}#{CMS_IMAGES[img_key]}\"\n end", "def image_url\n image.url\n end", "def feature_img_url(image)\n return image if image.match(/^#{URI.regexp(%w[http https])}$/)\n\n image_url(['homepage', image].join('/'))\n end", "def image_url\n # It's just stored in public/data/slug.jpg or whatever the relevant file\n # extension is\n image = Dir[\"public/data/#{slug}.*\"].first.split(\"/\").last\n # That's accessed publicly over the website as /data/slug.jpg or whatever\n \"/data/#{image}\"\n end", "def image_url\n if image.present?\n image\n else\n \"http://loremflickr.com/320/240/#{CGI.escape name}\"\n end\n end", "def square_url\n is_processed ?\n FileSystem.url(square_path) : \n orig_image_url\n end", "def url() processed_image.try(:url) || fallback_url end", "def photo_url\n src = details.at('#img_primary img')['src'] rescue nil\n\n if src =~ /^(http:.+@@)/ || src =~ /^(http:.+?)\\.[^\\/]+$/\n $1 + '.jpg'\n end\n end", "def image_url\n object.image_url\n end", "def url\n URI.join(request.url, @picture.image.url)\n end", "def image_url(path, options=nil)\n p = image_path(path)\n if options\n my_rewrite_url(p, options)\n else\n p\n end\n end", "def url\n source_url || reporter.photo_urlformat(uniqueid, 's')\n end", "def image_url\n image.url.split('?').first if image\n end", "def image_url\n image.url.split('?').first if image\n end", "def image_url\n self.filename.url \n end", "def image_uri\n return \"/image_store/#{id}.#{image_type}\"\n end", "def image_url source\n source.delete_prefix!('/')\n\n if source.starts_with?('uploads')\n path_to_url source\n elsif !source.starts_with?('http')\n path_to_url asset_pack_path(\"media/images/#{source}\")\n else\n source\n end\n end", "def img_url(url= \"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR7G9JTqB8z1AVU-Lq7xLy1fQ3RMO-Tt6PRplyhaw75XCAnYvAYxg\")\n self[:img_url] || url\n end", "def full_img_url\n @full_image_url ||= nil\n if @full_image_url.nil?\n filename = \"#{reg_num}_1.jpg\"\n @full_image_url = File.exist?(\"#{RAILS_ROOT}/public/vehicles/#{filename}\") ? \"http://www.reeds.co.za/vehicles/#{filename}\" : \"\"\n end\n @full_image_url\n end", "def get_image_url\n image_url = Storage.get_file_url(ENV['AWS_S3_DIR_PAGES'], self.issue_id, self.filename )\n return image_url\n end", "def absolute_url\n\t\treturn \"#{$domain}/#{self.photo.url}\"\n\tend", "def image_url(path)\n @@image_url_cache ||= {}\n @@image_url_cache[path] ||= client.get_temporary_link(normalize_path(path)).link\n end", "def get_image_url(page_doc)\n\timage_url = page_doc.css('body center:nth-child(1) a img')\n\n\tif image_url.nil? or image_url.length == 0\n\t\treturn nil\n\tend\n\n\treturn @base_url + image_url[0][\"src\"]\nend", "def get_image_url (origin_url)\n begin\n html = open(origin_url).read\n urls = URI.extract(html)\n .select { |lnk| lnk[/\\.jpg$|\\.png$|\\.gif$|\\.jpeg/m] }\n return urls.empty? ? nil : urls[0]\n rescue Exception => e\n puts \"[ERROR] in 'DavidGetter#get_image': #{e}\"\n return nil\n end\n end", "def imgurl\n return url unless fake_url?\n # The more complicated case: we have an IR with image data, but no URL.\n # So we lookup the corresponding URL on AWS. If it exists, we return that;\n # Otherwise, we CREATE it on AWS first, then return it.\n #\n # Does the resource exist? If so, we just return the link\n path = \"uploads/reference/#{id}.png\"\n obj = S3_BUCKET.objects[path]\n unless obj.exists?\n puts 'Creating AWS file ' + path\n # The nut of the problem: take the image in the thumbdata, upload it to aws, and return the link\n b64 = thumbdata.sub 'data:image/png;base64,', ''\n img = Magick::Image.read_inline(b64).first\n S3_BUCKET.objects[path].write img.to_blob, {:acl => :public_read}\n end\n obj.public_url.to_s\n end", "def url\n url = \"http://#{country_imghost}/images/P/#{asin}\"\n url << \".\" << country_imgcode << \".\"\n \n url << \"_\" << @transforms.join(\"_\") << \"_\" << \".jpg\"\n end", "def image_url(sprite)\n path = Pathname.new(sprite.path)\n if rails?\n \"sprites/#{sprite.filename}\"\n elsif @root\n \"/#{path.relative_path_from(@root)}\"\n else\n path.relative_path_from(@destination).to_s\n end\n end", "def image_url(image_id)\n uri = \"#{@api_url}/#{@project_id}/images/#{image_id}?access_token=#{@access_token}\"\n result = get uri\n result['ok'] ? result['result']['url'] : false\n end", "def image_url(style='original')\n ENV[\"domain\"] + self.picture.image.url(:original) if self.picture.present?\n end", "def thumbnail_url document\n document.derivative_paths[:thumbnail].relative_path.to_s\n end", "def info_url_for(image)\n path = url(image)\n signature = sign_path(path)\n\n File.join(Imgproxy.config.endpoint.to_s, \"info\", signature, path)\n end", "def uri(image)\n image.dig('medium', 'uri')\n end", "def image_url(i, thumb = false)\n native_url = thumb ? i.image.px350.url : i.image.url\n native_url.gsub(IMAGE_HOST_S3, IMAGE_HOST_CDN)\n end", "def image_url\n\t\t\t@data[\"image\"][\"source\"]\n\t\tend", "def attachment_url(attachment)\r\n unless attachment.url == \"/geo_infos/original/missing.png\"\r\n \"#{root_url}#{attachment.url.gsub(/^\\//, '')}\"\r\n else\r\n \"\"\r\n end\r\n end", "def url_of(image)\n return image if image.is_a? String\n return image.to_s if image.is_a? URI\n\n adapter = adapters.find { |a| a.applicable?(image) }\n\n return adapter.url(image) if adapter\n\n raise NotFound, \"Can't found URL adapter for #{image.inspect}\"\n end", "def image_url\n return object.image.service_url if object.image.attached?\n nil\n end", "def optimized_image_url\n unless image.url.present?\n # if this method is called too soon after an image is\n # uploaded, might need to reload the record to\n # have the url available\n reload\n end\n if Rails.application.config.use_cloudinary\n options = {height: 800, crop: \"scale\", quality: \"auto\"}\n image_url = Cloudinary::Utils.cloudinary_url image, options\n else\n image_url = image.url\n end\n image_url\n end", "def url\n @url ||= case @location_type\n when :country\n URI.join(BASE_URL, country_url(id))\n when :region\n URI.join(BASE_URL, region_url(id))\n else\n raise \"invalid location type: #{@location_type}\"\n end\n end", "def image_url\n return '' if product_images.empty?\n product_images[0].filename.url\n end", "def picurl\n picurl = object.imgurl\n (picurl.present? && sample_page) ? valid_url(picurl, sample_page) : picurl\n end", "def image_url\n\t\t\t@data[\"originalimage\"][\"source\"] if @data[\"originalimage\"]\n\t\tend", "def image_url_imgly(link_url)\n image_url_redirect link_url, \"http://img.ly/show/full/\", \"\\r\\n\"\n end", "def image_url\n image.present? ? image.url : ''\n end", "def image_url\n url_for(object.profile_pic)\n end", "def location_to_url # :nodoc:\n @location.to_url\n end", "def thumbnail_value_from_document\n url = super\n return if url.blank?\n return unless url.match? URI::DEFAULT_PARSER.make_regexp # do not try to resolve invalid URLs\n\n return view_context.image_proxy_path(url: url) if url.to_s.start_with?('http://')\n\n url\n end", "def image_path(src)\n src.gsub!(/\\s/, '')\n src =~ %r{^\\s*(/|http)} ? src : uri_root_path('images', src)\n end", "def image_url(source, options = T.unsafe(nil)); end", "def image_path(source)\n compute_public_path(source, 'images', 'png')\n end", "def image_path(source)\n compute_public_path(source, 'images')\n end", "def thumbnail_url\n \n PLACEHOLDER_PROJECT_IMAGE_URL\n\n end", "def image_path(image)\r\n image.rel_path\r\n end", "def site_image_url(src)\n rewrite_asset_path(src.expand_url(\"#{account_site_assets_url}/images/\"))\n end", "def thumbnail_url\n is_processed ? \n FileSystem.url(thumbnail_path) :\n orig_image_url\n end", "def thumbnail_url\n is_processed ? \n FileSystem.url(thumbnail_path) :\n (orig_thumb_url.present? ? orig_thumb_url : orig_image_url)\n end", "def docGetImagePath(url, dirPath)\n imageFileName = Pathname(url).basename.to_s\n return dirPath + \"images/\" + imageFileName\nend", "def url(size = default_style)\n image_id = instance.send(\"#{name}_#{:file_name}\")\n\n return @url_generator.for(size, {}) if image_id.nil? || image_id.empty? # Show Paperclip's default missing image path\n\n Imgurapi::Image.new(id: image_id).url(size: size, use_ssl: imgur_session.use_ssl?)\n end", "def image_url\n image.url(:medium)\n end", "def image_path\n thumbnail_url\n end", "def image_url\n product.images.first.try(:attachment).try(:url)\n end", "def smart_map_image_url map\n if url_responsive? map.image\n map.image\n else\n url = \"http://image.www.gametracker.com/images/maps/160x120/tf2/#{map.name}.jpg\"\n if url_responsive? url\n url\n else\n \"unkown_image.jpg\"\n end\n end\n end", "def display_img_url(url)\n url.sub(/s90$/, 's360') \n # recipe_response = Faraday.get(\"http://api.yummly.com/v1/api/recipe/#{id}\",\n # _app_id: ENV['YUMMLY_APP_ID'],\n # _app_key: ENV['YUMMLY_APP_KEY'])\n # image = JSON.parse(recipe_response.body)['images'].try(:first)\n # image['hostedLargeUrl'].present? ? image['hostedLargeUrl'] : image['hostedMediumUrl'] if image.present?\n end", "def unwatermarked_url\n return nil if api_response[\"article_image_url\"].nil?\n Source::URL.parse(api_response[\"article_image_url\"])\n end", "def url(options = {})\n image = image_file\n\n raise MissingImageFileError, \"Missing image file for #{inspect}\" if image.nil?\n\n image = processed_image(image, options)\n image = encoded_image(image, options)\n\n image.url(options.except(*TRANSFORMATION_OPTIONS).merge(name: name))\n rescue MissingImageFileError, WrongImageFormatError => e\n log_warning e.message\n nil\n end", "def default_url\n file_path = [\n 'fallbacks',\n ([model.class.to_s.underscore, mounted_as, version_name].compact.join('_') + '.png')\n ].join '/'\n\n 'http://' + ENV['HOST'] + ActionController::Base.helpers.image_path(file_path)\n end", "def get_groupme_image_url(img)\n return img if img.respond_to?(:to_str) &&\n URI.parse(img).host == IMAGE_HOST\n\n io = img.respond_to?(:read) ? img : io_from_url(img)\n groupme_url_from_io io\n end", "def result_image_url\n safe_image_url( :searchresult )\n end", "def image_uri\n return \"/image_store/#{id}.#{profile_image}\"\n end", "def get_image_url(str, domain)\n ary = str.split('/')\n if ary[0] == ''\n domain + str\n else\n str\n end\n end", "def thumbnail_url document\n return document.thumbnail_path if document.try(:thumbnail_path).present?\n if document.id == document.thumbnail_id\n representative_document = document\n else\n representative_document = ::SolrDocument.find(document.thumbnail_id)\n end\n\n thumbnail_file_id = representative_document.original_file_id\n if thumbnail_file_id\n Hyrax.config.iiif_image_url_builder.call(thumbnail_file_id, nil, '250,')\n else\n raise 'thumbnail_file_id is nil'\n end\n\n rescue\n image_path 'default.png'\n end", "def thumbnail_url\n company.image.url(:thumbnail)\n end", "def collection_image_url(image_pid, destination_site = %w(commonwealth), target_width = 1100, target_height = 450)\n image_info = get_image_metadata(image_pid)\n output_aspect = target_width.to_f / target_height.to_f\n if image_info[:aspect_ratio] > output_aspect\n top = 0\n height = image_info[:height]\n width = (height * output_aspect).round\n else\n width = (image_info[:width].to_f * 0.90).round # 90% so we don't get borders\n reduction_percent = (target_width.to_f / width.to_f).round(3)\n height = (target_height / reduction_percent).round\n # use the top section if this is a newspaper page, otherwise use the middle\n top = destination_site.include?('newspapers') ? 200 : (image_info[:height] - height) / 2\n end\n left = (image_info[:width] - width) / 2\n region = \"#{left},#{top},#{width},#{height}\"\n size_width = image_info[:width] < target_width ? image_info[:width] : target_width\n iiif_image_url(image_pid, { region: region, size: \"#{size_width},\" })\n end", "def relative_url_fragment_to_jpg\n return \"/#{IMAGEDB_FOLDER}/#{self.id}.jpg\"\n end", "def photo_url\r\n infoxml = get_info\r\n return infoxml.at('photosurl').inner_text\r\n end", "def url\n return nil unless @uploader.upyun_bucket_host\n\n [@uploader.upyun_bucket_host, @path].join(\"/\")\n end", "def image_from_url\n io = open(URI.parse(image_url))\n def io.original_filename; base_uri.path.split('/').last; end\n self.image = io.original_filename.blank? ? nil : io\n rescue # catch url errors with validations instead of exceptions (Errno::ENOENT, OpenURI::HTTPError, etc...) \n end", "def server_image_url(filename)\n uri = \"#{@api_url}/#{@project_id}/images/get_upload_url?filename=#{filename}&access_token=#{@access_token}\"\n get uri\n end", "def avatar_url\n attachment = @object.avatar_attachment\n return if attachment.nil?\n\n Rails.application.routes.url_helpers.rails_blob_url(attachment, only_path: true)\n end", "def img_src_to_full_url(permalink, node)\n return unless valid_img?(node) && !node.attributes['src'].value.urlish?\n node.attributes['src'].value = URI.join(permalink, node.attributes['src'].value).to_s\n end" ]
[ "0.7859339", "0.76939267", "0.7672241", "0.7546523", "0.7546523", "0.74603087", "0.7318159", "0.7304334", "0.7295035", "0.72645384", "0.7262479", "0.72599655", "0.72440857", "0.7239856", "0.7204256", "0.7164402", "0.7145168", "0.7133312", "0.71148044", "0.7112707", "0.7105587", "0.7096045", "0.70857006", "0.702144", "0.7009423", "0.70037955", "0.6965407", "0.6962768", "0.69592464", "0.6942824", "0.6939514", "0.69348305", "0.69307137", "0.69307137", "0.6920321", "0.6916875", "0.69055927", "0.6892628", "0.68889856", "0.68889815", "0.68821615", "0.68751836", "0.6870831", "0.6866125", "0.68391424", "0.6836884", "0.68367165", "0.6833359", "0.6824821", "0.6808484", "0.679631", "0.67793775", "0.67709446", "0.67523676", "0.67402077", "0.6735189", "0.67325884", "0.6717578", "0.67018735", "0.6701335", "0.6689822", "0.6686454", "0.6680611", "0.6668401", "0.6660044", "0.66543823", "0.66541934", "0.6635786", "0.6632593", "0.66319823", "0.6613247", "0.6612936", "0.6600321", "0.6599034", "0.6592819", "0.65884596", "0.6586254", "0.6585382", "0.65797746", "0.6579763", "0.6578176", "0.6577234", "0.65658325", "0.65615225", "0.6556914", "0.65498257", "0.65495336", "0.6531673", "0.65308183", "0.6520973", "0.6516184", "0.651254", "0.6512041", "0.650884", "0.650789", "0.6499425", "0.6496959", "0.64720285", "0.6458482", "0.644197" ]
0.7138603
17
A preset method needs to have a _preset postfix in its name and recieves a ImMagick::Image instance to work with.
def default_preset(img) img.crop_resized(128, 128, params[:gravity]).quality(75) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def imagemagick?; end", "def imagemagick7?; end", "def test_mosaic\n Pikl::Image.open(SAMPLE_IMAGE) do |img|\n img.mosaic(3,3)\n end\n end", "def show(preset, character_data, format)\n only_provides(*graphics_mime_types)\n raise NotFound unless content_type && preset_exists?(preset)\n runner = send(:\"#{rubify(preset)}_preset\", character_data) \n raise InternalServerError unless runner.is_a?(ImMagick::Command::Runner)\n image_path = save_file(runner).filename\n store_cache_reference!(params[:doc_id], GraphicsSlice[:expire_cache] || 0) if respond_to?(:store_cache_reference!) && params[:doc_id]\n send_file(image_path, :disposition => 'inline', :type => content_type_for(format))\n end", "def set_img\n\n end", "def default_processor_type\n :image_magick\n end", "def image; end", "def process_image(path)\n picture_name = File.basename(path)\n thumbnail_dir = File.join(File.dirname(path), \"thumbnails\")\n thumbnail_path = File.join(thumbnail_dir, \"#{File.basename(picture_name, File.extname(picture_name))}.jpg\")\n Dir.mkdir(thumbnail_dir) unless File.exist?(thumbnail_dir)\n\n image_optim = ImageOptim.new\n\n image = MiniMagick::Image.open(path)\n image_prop = {\n \"name\" => picture_name,\n \"thumb\" => \"thumbnails/#{picture_name}\",\n \"height\" => image.height,\n \"width\" => image.width\n }\n\n return image_prop if File.exist?(thumbnail_path)\n\n# -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace RGB\n\n image.format \"jpeg\" unless File.extname(picture_name) == \"jpg\"\n image.combine_options do |b|\n b.resize \"#{MAX_DIMENSION}>\"\n b.sampling_factor \"4:2:0\"\n b.strip\n b.interlace \"JPEG\"\n b.colorspace \"RGB\"\n b.quality 85\n end\n image.write thumbnail_path\n\n image_optim.optimize_image!(path)\n image_optim.optimize_image!(thumbnail_path)\n\n image_prop\nend", "def setup\n size 640, 360\n @image = load_image \"test.jpg\"\n @image_mask = load_image \"mask.jpg\"\n @image.mask @image_mask\nend", "def with_minimagick(image)\n image = ::MiniMagick::Image.new(image.path, image)\n image = image.layers.first if image.layers.any?\n image = image.pages.first if image.pages.any?\n yield image\n tempfile = image.instance_variable_get(\"@tempfile\")\n tempfile.open if tempfile.is_a?(Tempfile) # for aws-sdk\n tempfile\n end", "def preprocess_image(path)\n MiniMagick::Tool::Convert.new.yield_self do |convert|\n convert << path\n\n if config.localization_preprocessing != :none\n # general preprocessing\n convert.colorspace \"Gray\"\n convert.normalize\n\n if config.localization_preprocessing == :full\n # try to reduce shadows (based on https://legacy.imagemagick.org/Usage/compose/#divide)\n convert.stack do |stack|\n convert.clone 0\n convert.sample \"25%\"\n convert.blur \"30x10\"\n convert.resize \"400%\"\n end\n convert.compose \"DivideSrc\"\n convert.composite\n\n # remove short vertical features\n convert.morphology \"Close\", \"3x6: 1,-,1 1,-,1 1,-,1 1,-,1 1,-,1 1,-,1\"\n # remove small features and flaws\n convert.morphology \"Close:3\", \"Square:1\"\n end\n\n convert.threshold \"50%\"\n end\n\n convert.depth 8\n convert << \"gray:-\"\n\n MiniMagick::Shell.new.run(convert.command)\n end.first\n end", "def show(preset, source_path, format)\n only_provides(*graphics_mime_types)\n raise NotFound unless source_path && preset_exists?(preset)\n img = ImMagick::Image.file(source_path)\n render_preset(preset, img)\n if image_path = save_file(img)\n store_cache_reference!(params[:doc_id], GraphicsSlice[:expire_cache] || 0) if respond_to?(:store_cache_reference!) && params[:doc_id]\n send_file(image_path, :disposition => 'inline', :type => content_type_for(format))\n else\n raise NotFound\n end\n end", "def choose_processor\n self.processor = if MiniMagick::Utilities.which('mogrify')\n :mogrify\n elsif MiniMagick::Utilities.which('gm')\n :gm\n else\n nil\n end\n end", "def choose_processors\n [:thumbnail]\n end", "def portfolio_img img, type\n if img.is_a?(String)\n img\n elsif type == 'thumb'\n image_generator(height: '350', width: '200')\n else\n image_generator(height: '600', width: '400')\n end\n end", "def determine_preset_name\n @params.first.include?('.') ? 'default' : @params.shift\n end", "def img(*) # :nodoc:\n raise \"no!\"\n end", "def graphicsmagick?; end", "def spotimage\n\n if ! @commandline.argument('first').empty? && files = findfiles() then\n colorname = @commandline.option('colorname')\n colorspec = @commandline.option('colorspec')\n if colorname && ! colorname.empty? && colorspec && ! colorspec.empty? then\n files.each do |filename|\n s = SpotColorImage.new(self)\n s.registercolor(colorspec,colorname)\n s.convertgrayimage(filename)\n end\n else\n report(\"provide --colorname=somename --colorspec=c,m,y,k\")\n end\n else\n report(\"provide filename (png, jpg, pdf)\")\n end\n\n end", "def get_preset\n pricingoptions.find_by(:preset => true) || pricingoptions.first\n end", "def test01()\n thePresets = \"AlphaOnly8bpcInt Gray8bpcInt Gray16bpcInt Gray32bpcFloat AlphaSkipFirstRGB8bpcInt AlphaSkipLastRGB8bpcInt AlphaPreMulFirstRGB8bpcInt AlphaPreMulBGRA8bpcInt AlphaPreMulLastRGB8bpcInt AlphaPreMulLastRGB16bpcInt AlphaSkipLastRGB16bpcInt AlphaSkipLastRGB32bpcFloat AlphaPreMulLastRGB32bpcFloat CMYK8bpcInt CMYK16bpcInt CMYK32bpcFloat PlatformDefaultBitmapContext\"\n begin\n result = MIMeta.listpresets\n if result != thePresets\n puts \"MIMeta.listpresets returned #{result}\"\n end\n\n rescue RuntimeError => e\n $errorcode = Smig.exitvalue\n unless $errorcode.zero?\n puts \"Exit string: \" + Smig.exitstring\n puts $teststring + \" Exit status: \" + $errorcode.to_s\n end\n puts e.message\n puts e.backtrace.to_s\n end\nend", "def image_magick(image)\n Open3.capture3(\n \"convert\", image.cached, # What to convert?\n \"-resize\", \"#{image.width}x#{image.height}^\", # resizing\n \"-gravity\", \"center\", \"-crop\", \"#{image.width}x#{image.height}+0+0\", # cropping\n \"-background\", \"#ffffff\", # background color in case image was transparent\n \"+repage\", \"-flatten\", # Discard canvas size and squash into single layer\n image.resized # Target path of output\n )\n end", "def small(input) # Method that returns the image\n self.images[input].variant(resize: \"300x300\").processed # Resizing the image and return it\n end", "def image\n end", "def image\n end", "def image(path,options={})\n set RGhost::Image.for(path,options)\n end", "def set name, value, match_image, flags, gtype, destructive\n if gtype == IMAGE_TYPE\n value = Operation.imageize match_image, value\n\n # in non-destructive mode, make sure we have a unique copy\n if (flags & ARGUMENT_MODIFY) != 0 &&\n !destructive\n value = value.copy.copy_memory\n end\n elsif gtype == ARRAY_IMAGE_TYPE\n value = value.map { |x| Operation.imageize match_image, x }\n end\n\n super name, value\n end", "def set_cover_image(format)\n case format\n when \"Book\"\n return \"cornell/virtual-browse/book_cvr.png\"\n when \"Journal/Periodical\"\n return \"cornell/virtual-browse/journal_cvr.png\"\n when \"Manuscript/Archive\"\n return \"cornell/virtual-browse/manuscript_cvr.png\"\n when \"Map\"\n return \"cornell/virtual-browse/map_cvr.png\"\n when \"Musical Recording\"\n return \"cornell/virtual-browse/musical_recording_cvr.png\"\n when \"Musical Score\"\n return \"cornell/virtual-browse/musical_score_cvr.png\"\n when \"Non-musical Recording\"\n return \"cornell/virtual-browse/non_musical_cvr.png\"\n when \"Thesis\"\n return \"cornell/virtual-browse/thesis_cvr.png\"\n when \"Video\"\n return \"cornell/virtual-browse/video_cvr.png\"\n when \"Microform\"\n return \"cornell/virtual-browse/microform_cvr.png\"\n else\n return \"cornell/virtual-browse/generic_cvr.png\"\n end\n\n end", "def cover_image\n end", "def method_missing(mth, val)\n @img.define(mth.to_s.tr('_', '-'), val)\n end", "def meta_image(*args)\n if args.any?\n @meta_image = args.first\n else\n image = find_meta_image\n if image.is_a?(Image)\n dynamic_image_url(image, size: \"1200x\", only_path: false)\n else\n image\n end\n end\n end", "def convert!(image, format, page = nil, &block)\n with_minimagick(image) do |img|\n img.format(format.downcase, page, &block)\n end\n end", "def image\n\n end", "def default_image\n end", "def preset=(preset)\n validator = EnumAttributeValidator.new('String', [\"general\", \"pop\", \"jazz\", \"classical\"])\n unless validator.valid?(preset)\n fail ArgumentError, \"invalid value for 'preset', must be one of #{validator.allowable_values}.\"\n end\n @preset = preset\n end", "def set_image(image_file_name)\n\t\t\tbegin\n\t\t\t\t@image = ImageList.new(image_file_name)\n\t\t\t\t@file_name = \"#{File.dirname(image_file_name)}/scanned_#{File.basename(image_file_name)}\"\n\t\t\t\t@image.normalize.resize!(50,50).threshold(MaxRGB*0.55).write(@file_name)\n\t\t\t\t@image = ImageList.new(@file_name)\n\t\t\t\treturn true if scan\n\t\t\t\treturn false\n\t\t\trescue\n\t\t\t\traise InvalidImage, \"Invalid image - could not be processed by RMagick\"\n\t\t\tend\n\t\tend", "def image\n @image ||= MiniMagick::Image.open(source_path)\n end", "def create_eq_preset(eq_preset_name)\n IITEQPreset.new(@ole.CreateEQPreset(eq_preset_name))\n end", "def create\n @preset = Preset.new(params[:preset])\n @preset.user_id = current_user.id\n respond_to do |format|\n if @preset.save\n format.html { redirect_to @preset, notice: 'Preset was successfully created.' }\n format.json { render json: @preset, status: :created, location: @preset }\n else\n format.html { render action: \"new\" }\n format.json { render json: @preset.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_element pic\n controller_name == 'temp_listings' ? get_pixi_image(pic) : get_pixi_image(pic, 'large')\n end", "def set_normal_image\n self.image_normal = 'pets/' + name.downcase + '.png'\n end", "def call(file, *args, format: nil, quality: nil, &block)\n pipeline = ImageProcessing::MiniMagick.source(file)\n pipeline = pipeline.convert(format) if format\n pipeline = pipeline.quality(quality) if quality\n pipeline = pipeline.custom(&block)\n\n send(@method, pipeline, *args)\n end", "def image_style_from_method_name(method_name)\n if method_name.to_s.match(/_image\\z/) && style = method_name.to_s.sub(/_image\\z/, '')\n #possible_styles = Spree::Image.attachment_definitions[:attachment][:styles]\n #style if style.in? possible_styles.with_indifferent_access\n style\n end\n end", "def mosaic_command\n temp_file = Tempfile.new\n temp_file.write(raster_paths.join(\"\\n\"))\n temp_file.rewind\n yield \"#{access_key} #{secret_access_key} LC_ALL=C.UTF-8 LANG=C.UTF-8 cogeo-mosaic create #{temp_file.path} -o #{output_path}\"\n temp_file.close\n end", "def thumbnail_image\n end", "def image(arg=nil)\n set_or_return(:image, arg, :kind_of => String)\n end", "def image\n r = super\n if r.nil? and not @_generating\n generate\n return super\n end\n r\n end", "def image_generator=(generator)\n @@image_generator = generator\n end", "def set_image\n @image = Image.find(params[:id]).decorate\n end", "def image=(img)\n @image__ = img\n end", "def generate(site)\n return unless site.config['mini_magick']\n\n site.config['mini_magick'].each_pair do |name, preset|\n \n Dir.chdir preset['source'] do\n if preset['recursive'] == false \n #false\n root = '.'\n else\n #true or nil\n root = '**'\n end\n\n puts 'Add images for later processing:'\n puts Dir.pwd\n Dir.glob(File.join(root, \"*.{png,jpg,jpeg,gif,PNG,JPG,JPEG,GIF}\")) do |source|\n puts ' ' + source\n site.static_files << GeneratedImageFile.new(site, site.source, preset['destination'], source, preset.clone)\n end\n end\n end\n end", "def processPhotoJob(image)\n image.regenerate_styles!\n end", "def image\n end", "def image\n end", "def image(name, identifier=nil, &block)\n define_method(\"#{name}_element\") do\n return call_block(&block) if block_given?\n platform.image_for(identifier.clone)\n end\n define_method(\"#{name}?\") do\n return call_block(&block).exists? if block_given?\n platform.image_for(identifier.clone).exists?\n end\n alias_method \"#{name}_image\".to_sym, \"#{name}_element\".to_sym\n end", "def item_by_name\n IITEQPreset.new(@ole.ItemByName)\n end", "def covert(uploader)\n # image process\n unless (uploader.file.content_type =~ /image/).nil?\n if !jpep?(uploader.file)\n require \"mini_magick\"\n # covert to jpeg\n image = MiniMagick::Image.open(uploader.path)\n image.format(\"jpg\")\n uploader.cache!(File.open(image.path))\n image.destroy! # remove /tmp from MinMagick generate\n end\n end\n uploader\n end", "def media_presets\n site.data.dig('picture', 'media_presets') || {}\n end", "def covert(uploader)\n # image process\n unless (uploader.file.content_type =~ /image/).nil?\n if !jpep?(uploader.file)\n require \"mini_magick\"\n # covert to jpeg\n image = MiniMagick::Image.open(uploader.path)\n image.format(\"jpg\")\n uploader.cache!(File.open(image.path))\n image.destroy! # remove /tmp from MinMagick generate\n end\n end\n uploader\n end", "def image_style_from_method_name(method_name)\n if method_name.to_s.match(/_image$/) && style = method_name.to_s.sub(/_image$/, '')\n possible_styles = Spree::Image.attachment_definitions[:attachment][:styles]\n style if style.in? possible_styles.with_indifferent_access\n end\n end", "def quality(percentage)\n manipulate! do |img|\n img.write(current_path){ self.quality = percentage }\n img = yield(img) if block_given?\n img\n end\nend", "def manipulate!(save_image = false)\n cache_stored_file! if !cached?\n @_gimage ||= ::GraphicsMagick::Image.new(current_path)\n @_gimage = yield(@_gimage)\n @_image.write(current_path) if save_image\n @_gimage\n rescue => e\n raise CarrierWave::ProcessingError.new(\"Failed to manipulate file! #{e}\")\n end", "def images; end", "def create\n\n # original code\n\n # @image_set = ImageSet.create(image_set_params)\n\n # render json: @image_set\n\n# code for imageMagick\n @image_set = current_user.image_sets.guild(image_set_params)\n authorize @image_set\n if @image_set.save\n # to handle multiple image upload on create\n if params[:images]\n params[:images].each {|image|\n @image_set.images.create(image: image)\n }\n end\n flash[:notice] = \"Your image set has been created.\"\n redirect_to @image_set\n else\n flash[:alert] = \"Something went wrong.\"\n render 'new'\n end\n\n end", "def info(preset, source_path, format)\n url_opts = { :storage => params[:storage], :preset => preset, :format => format }\n relative_uri = url_for_image(params[:relative_path], url_opts)\n absolute_path = Merb.dir_for(:public) / relative_uri\n base_url = params[:relative] ? '' : (request.protocol + \"://\" + request.host)\n \n information = {}\n information[:format] = format\n information[:preset] = preset\n information[:exists] = File.file?(absolute_path)\n information[:metadata] = slice.metadata_for(absolute_path) if information[:exists] && params[:metadata]\n \n if params[:presets]\n preset_names.inject(information[:presets] ||= {}) do |presets, preset_name|\n preset_uri = url_for_external_image(params[:relative_path], url_opts.merge(:preset => preset_name))\n presets[preset_name] = base_url + preset_uri\n presets\n end\n end\n \n self.content_type = :json\n information.to_json\n end", "def main()\n img = ImageList.new($input)\n convert = ImageList.new\n page = Magick::Rectangle.new(0,0,0,0)\n $total_ops = (img.rows * img.columns).to_f\n\n for i in 0..img.rows\n for j in 0..img.columns\n pixel = generate_hex_pixel(rgb_to_hex(img.pixel_color(j,i)))\n convert << pixel\n page.x = j * pixel.columns\n page.y = i * pixel.rows\n pixel.page = page\n progress()\n end\n end\n\n puts 'Writing image, this could take a while...'\n convert.mosaic.write($output)\nend", "def auto_orient!(image)\n with_minimagick(image) do |img|\n img.combine_options do |cmd|\n yield cmd if block_given?\n cmd.auto_orient\n end\n end\n end", "def image _args\n \"image _args;\" \n end", "def magic(options = nil)\n options.nil? ? \"/images/#{@name}-full.png\" : \"/images/#{@name}-#{options}.png\"\n end", "def poster(input, output)\n \n input = input \n output = output \n \n scale(input, output)\n\n #Demonstrate the Image#polaroid method\n img = Magick::Image.read(output).first\n result = img.posterize\n \n #Write \n result.write(output)\n\nend", "def image\n MiniMagick::Image.open(filename)\n rescue MiniMagick::Invalid\n # Proceed as if this is not an image\n nil\n end", "def create\n @preset = Preset.new(params[:preset])\n\n respond_to do |format|\n if @preset.save\n flash[:notice] = 'Preset was successfully created.'\n format.html { redirect_to(@preset) }\n format.xml { render :xml => @preset, :status => :created, :location => @preset }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @preset.errors, :status => :unprocessable_entity }\n end\n end\n end", "def initialize( initial=nil, design: nil,\n colors: nil )\n if initial\n ## pass image through as-is\n img = initial\n else\n ## note: unwrap inner image before passing on to super c'tor\n img = Pixelart::Image.parse( design, colors: colors ).image\n end\n\n super( img.width, img.height, img )\nend", "def pbLoadPokemonBitmapSpecies(pokemon, species, back=false, scale=nil)\n ret=nil\n if scale==nil\n scale=1\n if defined?(POKEMONSPRITESCALE)\n scale=POKEMONSPRITESCALE if POKEMONSPRITESCALE != nil\n end\n end\n if pokemon.isEgg?\n bitmapFileName=sprintf(\"Graphics/Battlers/%segg\",getConstantName(PBSpecies,species)) rescue nil\n if !pbResolveBitmap(bitmapFileName)\n bitmapFileName=sprintf(\"Graphics/Battlers/%03degg\",species)\n if !pbResolveBitmap(bitmapFileName)\n bitmapFileName=sprintf(\"Graphics/Battlers/egg\")\n end\n end\n bitmapFileName=pbResolveBitmap(bitmapFileName)\n else\n bitmapFileName=pbCheckPokemonBitmapFiles([species,back,\n (pokemon.isFemale?),\n pokemon.isShiny?,\n (pokemon.form rescue 0),\n (pokemon.isShadow? rescue false),\n (pokemon.isDelta? rescue false)])\n # Alter bitmap if supported\n alterBitmap=(MultipleForms.getFunction(species,\"alterBitmap\") rescue nil)\n end\n if bitmapFileName && alterBitmap\n animatedBitmap=AnimatedBitmap.new(bitmapFileName)\n copiedBitmap=animatedBitmap.copy\n animatedBitmap.dispose\n copiedBitmap.each {|bitmap|\n alterBitmap.call(pokemon,bitmap)\n }\n ret=copiedBitmap\n if defined?(DynamicPokemonSprite) # if EBS code exists\n animatedBitmap=AnimatedBitmapWrapper.new(bitmapFileName,scale)\n animatedBitmap.prepareStrip\n for i in 0...animatedBitmap.totalFrames\n alterBitmap.call(pokemon,animatedBitmap.alterBitmap(i))\n end\n animatedBitmap.compileStrip\n ret=animatedBitmap\n end\n elsif bitmapFileName\n ret=AnimatedBitmap.new(bitmapFileName)\n ret=AnimatedBitmapWrapper.new(bitmapFileName,scale) if defined?(DynamicPokemonSprite) # if EBS code exists\n end\n return ret\nend", "def setup\n size 200, 200\n @a = load_image 'construct.jpg'\n @b = load_image 'wash.jpg'\n @offset = 0.0\nend", "def create_banner_image(color)\n banner_file = \"theme/specktre_#{color}.png\"\n if ! File.file?(banner_file)\n\n puts(\"Building the banner file for #{color}\")\n\n red = (color.to_i(16) >> 16) % 256\n green = (color.to_i(16) >> 8) % 256\n blue = (color.to_i(16) % 256)\n\n start_color = (\n red * 0.9 * 65536 +\n green * 0.9 * 256 +\n blue * 0.9).to_i().to_s(16)\n end_color = (\n [red * 1.05, 255].min.to_i() * 65536 +\n [green * 1.05, 255].min.to_i() * 256 +\n [blue * 1.05, 255].min.to_i()).to_s(16)\n\n if !system(\"specktre new --size=3000x250 --start=#{start_color} --end=#{end_color} --squares --name=#{banner_file}\")\n raise RuntimeError, \"Error running the Specktre process for #{color}!\"\n end\n\n if !system(\"optipng #{banner_file}\")\n raise RuntimeError, \"Error running optipng on #{banner_file}\"\n end\n end\nend", "def img!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 21 )\n\n type = IMG\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 348:7: 'img'\n match( \"img\" )\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__, 21 )\n\n end", "def create_frame_and_thumbnail\n if (File.extname(self.image_sequence) == \".mha\")\n file_path = Rails.root.join(dir_path, self.image_sequence)\n result = system(Rails.root.join('scripts','mha_to_png','bin',\"MhaToPng #{file_path} 1\").to_s)\n base_name = File.basename(file_path, \".mha\")\n image = MiniMagick::Image.open(\"#{dir_path}/#{base_name}_frame.png\")\n image.resize \"200x200\"\n image.format \"png\"\n image.write \"#{dir_path}/#{base_name}_thumbnail.png\"\n File.chmod(0644, \"#{dir_path}/#{base_name}_thumbnail.png\")\n self.thumbnail = \"#{base_name}_thumbnail.png\"\n self.frame = \"#{base_name}_frame.png\"\n end\n end", "def default_preset(string)\n generate_label(string, :pointsize => 18, :alpha => true)\n end", "def create_thumbnails()\n # {{{\n begin\n @@logger.log('IMAGE UP | Importing image')\n image_renderer = @@image_renderer.new(@media_asset)\n \n id = @media_asset.media_asset_id\n ext = @media_asset.extension.dup.downcase\n path = Aurita.project_path(:public, :assets, \"asset_#{id}.#{ext}\")\n \n @@logger.log(\"IMAGE UP | Path is #{path}\")\n # Every image needs a jpeg base image (esp. needed for PDF): \n STDERR.puts \"Importing #{path} using #{image_renderer.class.inspect}\"\n image_renderer.import(path)\n image_renderer.create_image_variants(@@variants)\n\n if ext == 'pdf' then\n image_renderer.create_pdf_preview()\n elsif @media_asset.is_video? then\n dest = Aurita.project_path(:public, :assets, \"asset_#{id}.jpg\")\n # File.open(source, 'w')\n # system \"ffmpeg -i #{path} -ar 22050 -ab 32 -acodec mp3\n # -s 480x360 -vcodec flv -r 25 -qscale 8 -f flv -y #{ dest }\"\n system(\"ffmpeg -i '#{path}' -ss 00:00:10 -vframes 1 -f image2 -vcodec mjpeg '#{dest}'\")\n ext = 'jpg'\n end\n rescue ::Exception => e\n STDERR.puts('Error when trying to create image versions: ' << e.message)\n e.backtrace.each { |m| \n STDERR.puts(m)\n }\n end\n end", "def camaleon_image_optimizer_on_active(plugin)\n end", "def bmp=(arg1)\n bmp(arg1)\n end", "def image\n options.fetch(:image, nil)\n end", "def pre_cache_images\r\n @code.each do |line|\r\n if line =~ /.*\\.(\\w*)\\((['\"].*['\"]),?(\\d*)\\)/\r\n case $1\r\n when 'picture', 'title'\r\n eval(\"RPG::Cache.#{$1}(#{$2})\")\r\n when 'panorama', 'fog', 'plane'\r\n folder = $1 == 'plane' ? 'picture' : $1\r\n eval(\"RPG::Cache.#{folder}(#{$2},#{$3.to_i})\")\r\n end \r\n end\r\n end\r\n end", "def process_cover_qrcode(cover, qrcode_path)\n @image = Magick::ImageList.new(\"#{Rails.root}/public/images/flyers/qrcode-with-image.jpg\")\n\n insert_image(\n full_path: \"#{Rails.root}/public#{qrcode_path}\",\n width: 415, height: 415,\n longitude: 823, latitude: 212\n )\n\n if Rails.env.development?\n cover_full_path = \"#{Rails.root}/public#{cover}\"\n else\n cover_full_path = \"#{cover}\"\n end\n\n if cover_full_path.present?\n insert_image(\n full_path: cover_full_path,\n width: 750, height: 750,\n longitude: 40, latitude: 40\n )\n end\n\n image.format = 'jpeg'\n self\n end", "def image()\n @image__\n end", "def is_processed_image? picture\n model.class.to_s.underscore == \"pimage\"\n end", "def pbLoadPokemonBitmapSpecies(pokemon,species,back=false)\n ret = nil\n if pokemon.egg?\n bitmapFileName = sprintf(\"Graphics/Battlers/%segg_%d\",getConstantName(PBSpecies,species),pokemon.form) rescue nil\n if !pbResolveBitmap(bitmapFileName)\n bitmapFileName = sprintf(\"Graphics/Battlers/%03degg_%d\",species,pokemon.form)\n if !pbResolveBitmap(bitmapFileName)\n bitmapFileName = sprintf(\"Graphics/Battlers/%segg\",getConstantName(PBSpecies,species)) rescue nil\n if !pbResolveBitmap(bitmapFileName)\n bitmapFileName = sprintf(\"Graphics/Battlers/%03degg\",species)\n if !pbResolveBitmap(bitmapFileName)\n bitmapFileName = sprintf(\"Graphics/Battlers/egg\")\n end\n end\n end\n end\n bitmapFileName = pbResolveBitmap(bitmapFileName)\n else\n bitmapFileName = pbCheckPokemonBitmapFiles([species,back,(pokemon.isFemale?),\n pokemon.isShiny?,(pokemon.form rescue 0),(pokemon.isShadow? rescue false)])\n # Alter bitmap if supported\n alterBitmap = (MultipleForms.getFunction(species,\"alterBitmap\") rescue nil)\n end\n if bitmapFileName && alterBitmap\n animatedBitmap = AnimatedBitmap.new(bitmapFileName)\n copiedBitmap = animatedBitmap.copy\n animatedBitmap.dispose\n copiedBitmap.each {|bitmap| alterBitmap.call(pokemon,bitmap) }\n ret = copiedBitmap\n elsif bitmapFileName\n ret = AnimatedBitmap.new(bitmapFileName)\n end\n return ret\nend", "def set_preset_color\n @preset_color = PresetColor.find(params[:id])\n end", "def create\n @preset = Preset.new(preset_params)\n @preset.user_id = current_user.id\n @preset.channel_id = @channel.id\n \n respond_to do |format|\n if @preset.save\n format.html { redirect_to @preset, notice: 'Preset was successfully created.' }\n format.json { render :show, status: :created, location: @preset }\n else\n format.html { render :new }\n format.json { render json: @preset.errors, status: :unprocessable_entity }\n end\n end\n end", "def pbLoadPokemonBitmapSpecies(pokemon, species, back=false)\n ret=nil\n if pokemon.isEgg?\n bitmapFileName=sprintf(\"Graphics/Battlers/%segg\",getConstantName(PBSpecies,species)) rescue nil\n if !pbResolveBitmap(bitmapFileName)\n bitmapFileName=sprintf(\"Graphics/Battlers/%03degg\",species)\n if !pbResolveBitmap(bitmapFileName)\n bitmapFileName=sprintf(\"Graphics/Battlers/egg\")\n end\n end\n bitmapFileName=pbResolveBitmap(bitmapFileName)\n else\n bitmapFileName=pbCheckPokemonBitmapFiles([species,back,\n (pokemon.isFemale?),\n pokemon.isShiny?,\n (pokemon.form rescue 0),\n (pokemon.isShadow? rescue false)])\n # Alter bitmap if supported\n alterBitmap=(MultipleForms.getFunction(species,\"alterBitmap\") rescue nil)\n end\n if bitmapFileName && alterBitmap\n animatedBitmap=AnimatedBitmap.new(bitmapFileName)\n copiedBitmap=animatedBitmap.copy\n animatedBitmap.dispose\n copiedBitmap.each {|bitmap|\n alterBitmap.call(pokemon,bitmap)\n }\n ret=copiedBitmap\n elsif bitmapFileName\n ret=AnimatedBitmap.new(bitmapFileName)\n end\n return ret\nend", "def imageNamed(name)\n sugarcube568_imageNamed(name) || imageNamed_old(name)\n end", "def pbLoadPokemonBitmapSpecies(pokemon,species,back=false)\n ret = nil\n if pokemon.egg?\n bitmapFileName = sprintf(\"Graphics/Battlers/%segg_%d\",getConstantName(PBSpecies,species),pokemon.form) rescue nil\n if !pbResolveBitmap(bitmapFileName)\n bitmapFileName = sprintf(\"Graphics/Battlers/%03degg_%d\",species,pokemon.form)\n if !pbResolveBitmap(bitmapFileName)\n bitmapFileName = sprintf(\"Graphics/Battlers/%segg\",getConstantName(PBSpecies,species)) rescue nil\n if !pbResolveBitmap(bitmapFileName)\n bitmapFileName = sprintf(\"Graphics/Battlers/%03degg\",species)\n if !pbResolveBitmap(bitmapFileName)\n bitmapFileName = sprintf(\"Graphics/Battlers/egg\")\n end\n end\n end\n end\n bitmapFileName = pbResolveBitmap(bitmapFileName)\n else\n bitmapFileName = pbCheckPokemonBitmapFiles([species,back,(pokemon.female?),\n pokemon.shiny?,(pokemon.form rescue 0),pokemon.shadowPokemon?])\n # Alter bitmap if supported\n alterBitmap = (MultipleForms.getFunction(species,\"alterBitmap\") rescue nil)\n end\n if bitmapFileName && alterBitmap\n animatedBitmap = AnimatedBitmap.new(bitmapFileName)\n copiedBitmap = animatedBitmap.copy\n animatedBitmap.dispose\n copiedBitmap.each { |bitmap| alterBitmap.call(pokemon,bitmap) }\n ret = copiedBitmap\n elsif bitmapFileName\n ret = AnimatedBitmap.new(bitmapFileName)\n end\n return ret\nend", "def image_png\r\ndirectory = File.expand_path File.dirname(__FILE__)\r\nspecific_filename = directory + \"/\" + \"Media/shop.png\"\r\nend", "def make_thumbnails\n return true unless defined?(IMAGEMAGICK_CONVERT) && is_local?\n system(\"#{IMAGEMAGICK_CONVERT} -resize #{THUMBNAIL_SIZE} #{filename} #{filename('s')}\")\n true\n end", "def image=(image)\n self.image.assign image.tempfile\n end", "def image\n TmdbImage.new(@imdb_id.gsub(/^tt/, ''), @api_key, @logger, @filespec) rescue nil\n end", "def imageNamed(name)\n imageNamed568(name) || imageNamed_old(name)\n end", "def convert_standalone_image(el, _opts, img); end", "def set_defaults\n self.main_image ||= Placeholder.image_generator(height: '600', width: '400')\n self.thumb_image ||= Placeholder.image_generator(height: '350', width: '200')\n end" ]
[ "0.6250311", "0.5998414", "0.58087075", "0.5551515", "0.5542982", "0.5494588", "0.54826796", "0.5481536", "0.54781044", "0.547226", "0.5440048", "0.5402712", "0.53583354", "0.5357549", "0.53539926", "0.5351549", "0.5337047", "0.5309052", "0.5308399", "0.51889366", "0.518272", "0.51801664", "0.51362604", "0.5120648", "0.5120648", "0.51051676", "0.5079647", "0.5067039", "0.50668997", "0.50479037", "0.502823", "0.50263727", "0.50248533", "0.5022365", "0.5020657", "0.50032216", "0.50018024", "0.499801", "0.49851626", "0.49788162", "0.49622136", "0.495903", "0.49400878", "0.492035", "0.49056828", "0.4903881", "0.49034363", "0.4902805", "0.49020904", "0.49017045", "0.4899958", "0.48972473", "0.48912045", "0.48912045", "0.48605418", "0.4852626", "0.4835985", "0.4828085", "0.4825782", "0.48255807", "0.4825093", "0.48146752", "0.48143855", "0.4808867", "0.4803449", "0.48010135", "0.4795046", "0.47890934", "0.47887322", "0.47879332", "0.47820374", "0.47812688", "0.47792977", "0.47735605", "0.47728685", "0.47723657", "0.47598988", "0.47519833", "0.47502562", "0.47497225", "0.47332823", "0.47311765", "0.4730407", "0.47298858", "0.4729634", "0.4729619", "0.47265595", "0.4724344", "0.47235107", "0.47140792", "0.47065318", "0.47019112", "0.47012693", "0.4696222", "0.46801275", "0.46790594", "0.46571854", "0.46551147", "0.46483186", "0.46457168" ]
0.57679087
3
The absolute path derived from the request where files will be stored
def base_request_path Merb.dir_for(:public) / slice_url(:images_delete_all) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def request_path\n @request_path ||= ::File.expand_path(::File.join(root_dir, ::Rack::Utils.unescape(path_info)))\n end", "def root_file_path; end", "def path\n file.url\n end", "def original_fullpath; end", "def file_path\n dir\n end", "def path\n \"/#{UPLOAD_DIR}/#{filename}\"\n end", "def requested_file(request)\n request_uri = request.split(\" \")[1]\n path = URI.unescape(URI(request_uri).path)\n\n clean = []\n\n # Split the path into components\n parts = path.split(\"/\")\n\n parts.each do |part|\n # skip any empty or current current directory (\".\") path components\n next if part.empty? || part == \".\"\n # If the path component goes up one directory level (\"..\"),\n # remove the last clean component\n # Otherwise, add the component to the Array of clean components\n part == \"..\" ? clean.pop : clean << part\n end\n\n # return the web root joined to the client path\n\n File.join(WEB_ROOT, *clean)\nend", "def get_file_path\n @path\n end", "def file_path\n end", "def path\n '/c/document_library/get_file?folderId=%i&name=%s' % [self.folderid, self.name]\n end", "def path\n @file.path\n end", "def root_path\n Pathname.new(upload_path_value).join(search_directory)\n end", "def file_path; end", "def file_path\n File.dirname(__FILE__) + '/' + @file_name\n end", "def path\n (public_path + sitemaps_path + filename).expand_path.to_s\n end", "def store_dir\n \"uploads/#{model.request_id}\"\n end", "def path\n @file\n end", "def file_path\n dir_name + file_name\n end", "def path\n\t\trequest.original_fullpath\n\tend", "def full_path_from_current_attributes\r\n path = self.class.upload_options[:directory].\r\n gsub(Regexp.new(\"^(#{RAILS_ROOT})?/?\"), RAILS_ROOT + '/') + '/' +\r\n instance_directory + '/' + send(self.class.upload_options[:filename])\r\n path.gsub(/\\/+/, '/')\r\n end", "def path\n @file\n end", "def path\n http_url @store.rdoc.generator.file_dir\n end", "def path\n request.path\n end", "def local_file_for(request)\n request.squeeze!('/')\n serve_path, from = served.detect { |path, _| request.start_with?(path) }\n\n return if !from\n\n path = File.join(expand_from(from), request.sub(serve_path, ''))\n return if !File.file?(path)\n\n path\n end", "def base_path\n [attachment_options[:path_prefix], attachment_path_id].join(\"/\")\n end", "def path\n @file.path\n end", "def path\n @filename\n end", "def generate_storage_path\n update_column(:file, File.join(File.dirname(request.file),\n \"#{id}-response.xml\"))\n end", "def full_file_path\n Rails.root.join('uploads', filepath).to_s\n end", "def path\n ::File.join(@folder, @file)\n end", "def path\n self.file.to_s\n end", "def requested_file(request)\n uri = request.split(\" \")[1]\n clean_path = []\n parts = uri.split(\"/\")\n\n # skip if path component includes current directory (\".\")\n parts.each do |part|\n next if part.empty? || part == '.'\n\n # removes last component if path goes one directory level up (\"..\"), pass; else append to clean_path\n part == '..' ? next : clean_path << part\n end\n File.join(ROOT, *clean_path)\nend", "def file_dir\n 'files'\n end", "def file_path\n Merb::Config[:upload_dir] / self.hash[0..1] / (self.hash[2..-1] + '-' + self.size.to_s )\n end", "def base_path\n File.join(attachment_options[:path_prefix], attachment_path_id)\n end", "def public_path\n # TODO: this might present an attack vector if the file is outside the web_root\n options[:web_root].to_s + '/' + self.relative_path.gsub(\"\\\\\", \"/\")\n end", "def file_path\n @file_path ||= lookup_file_path\n end", "def absolute_path\n if is_url?\n # Use the last path component without the query string plus the name\n # of the resource in Base64. This should be both mildly readable and\n # also unique per invocation.\n url_part = URI(path).path.split(/\\//).last\n base64_name = Base64.strict_encode64(name).gsub(/\\=/, '')\n ::File.join(Chef::Config[:file_cache_path], \"#{base64_name}_#{url_part}\")\n else\n ::File.expand_path(path, Chef::Config[:file_cache_path])\n end\n end", "def path\n @path ||= filters.uri_escape(absolute_url) if absolute_url\n end", "def path\n @path ||= filters.uri_escape(absolute_url) if absolute_url\n end", "def local_path\n check_and_copy_local_file_to_rails_public\n File.join('ajaxlibs', library_name, version, file_name)\n end", "def web_file_path \n afilePath = building.web_path + SAVE_PATH + id.to_s\n if file_suffix != \"\" && file_suffix != nil\n afilePath = afilePath + \".\" + file_suffix \n end\n\n afilePath\n end", "def path_in_dir(file)\n \"#{@req.env['PATH_INFO']}/#{file}\".gsub('//', '/')\n end", "def path\n http_url RDoc::RDoc.current.generator.file_dir\n end", "def file_path\n File.join(dir,filename)\n end", "def current_file_path\n clurl = AssetSettings[:local_assets][@file_id].last\n clurl.sub(/\\A#{AssetSettings[:local_assets].assets_url_prefix}/,\n '') if clurl\n end", "def path\n # TODO: is this trip really necessary?!\n data.fetch(\"path\") { relative_path }\n end", "def path\n File.join(self.folder, self.filename)\n end", "def local_file_path\n afilePath = building.local_path + SAVE_PATH + id.to_s\n\n if file_suffix != \"\" && file_suffix != nil\n afilePath = afilePath + \".\" + file_suffix\n end\n\n afilePath \n end", "def path\n location.path\n end", "def base_path\n Dir.pwd + \"/\"\n end", "def path\n return self.saved? ? @realfile.path : nil\n end", "def full_path\n path\n end", "def current_file_path\n current_file.to_path\n end", "def path_in_public\n (sitemaps_path + filename).to_s\n end", "def local_path\n @io.local_path\n end", "def path\n @base\n end", "def path\n return @path\n end", "def path\n real_path = Pathname.new(root).realpath.to_s\n full_path.sub(%r{^#{real_path}/}, '')\n end", "def path\n return @path\n end", "def path\n return @path\n end", "def path\n return @path\n end", "def access_path\n @tempfile_path || path\n end", "def requested_file(request_line)\n request_uri = request_line.split(\" \")[1]\n # Make it vulnerable\n request_uri = request_uri.gsub(\"%c1%1c\", \"/\")\n path = URI.unescape(URI(request_uri).path)\n\n File.join(WEB_ROOT, path)\nend", "def file_path\n\t\tself.class.file_path\n\tend", "def base_request_path\n Merb.dir_for(:public) / slice_url(:external_delete_all)\n end", "def relative_path(options = {})\n File.join(self.site.content_dir(options), sanitize_filename(self.name))\n end", "def path\n data.fetch(\"path\") { relative_path }\n end", "def dir_path\n RAILS_ROOT + '/temp_files/' + Digest::MD5.hexdigest(self.id.to_s)[0..1] + '/'\n end", "def file_path(was=false)\n if was\n self.site.directory_path.join(name_was)\n else\n self.site.directory_path.join(name)\n end\n end", "def path\n @path\n end", "def path\n @path\n end", "def path\n @path\n end", "def path\n @path\n end", "def path\n \"%s/%s\" % [dirname, filename]\n end", "def upload_full_path\n @upload_full_path ||= File.join(@upload_file_path, name)\n end", "def stored_file_path\n File.join(path, stored_name)\n end", "def path(request)\n request.path\n end", "def _FILESDIR; Config._FILES; end", "def path\n data.path\n end", "def path\n data.path\n end", "def requested_file(request_line)\n request_uri = request_line.split(' ')[1]\n path = URI.unescape(URI(request_uri).path)\n\n clean = []\n\n parts = path.split('/')\n parts.each do |part|\n next if part.empty? || part == '.'\n part == '..' ? clean.pop : clean << part\n end\n\n File.join(@root, *clean)\n end", "def path\n ensure_valid\n @path\n end", "def file\n File.join(root, FILENAME)\n end", "def path\n @directory.path\n end", "def full_path\n container.root.join(path)\n end", "def full_path\n container.root.join(path)\n end", "def files_path\n File.expand_path(\"#{Config.project_root}/files\")\n end", "def current_path\n file.try(:path)\n end", "def document_attachment\n \"#{Rails.root}/uploads/#{document.url}\"\n end", "def where_to_save\n output_dir = @template_options[OUTPUT_DIR]\n # assume absolute\n full_path = output_dir\n if (Pathname.new(output_dir)).relative?\n full_path = File.expand_path(output_dir, Dir.pwd)\n end\n return full_path\n end", "def path\n File.join(STORAGE_PATH, @resource.subject_uri.path)\n end", "def file_path\n public_filename =~ ScribdFu::S3 ? public_filename : \"#{RAILS_ROOT}/public#{public_filename}\"\n end", "def fullpath\n File.expand_path( @file )\n end", "def relative_path; end", "def relative_path; end", "def relative_path; end", "def relative_path; end", "def relative_path; end", "def filepath\n @filepath\n end" ]
[ "0.7482371", "0.7432581", "0.7416603", "0.73115605", "0.73073536", "0.72727", "0.7268213", "0.7244649", "0.72251505", "0.7214889", "0.7193956", "0.7193439", "0.7189038", "0.71808606", "0.7142374", "0.71413803", "0.71373826", "0.71269643", "0.71257263", "0.709214", "0.70904994", "0.70844424", "0.7074764", "0.7057446", "0.70503974", "0.7048383", "0.70430934", "0.7026792", "0.70226836", "0.7021491", "0.70160735", "0.7014882", "0.699946", "0.69824284", "0.6980502", "0.6979317", "0.6967652", "0.69572324", "0.6951291", "0.6951291", "0.69371563", "0.69341135", "0.69326115", "0.69263726", "0.69112086", "0.6893027", "0.68839175", "0.6877919", "0.6861416", "0.68528306", "0.6851069", "0.6846926", "0.6846789", "0.68404084", "0.6831367", "0.6826142", "0.6807495", "0.68029964", "0.68010885", "0.6794258", "0.6794258", "0.6794258", "0.67935604", "0.6791075", "0.6778556", "0.67748874", "0.6765747", "0.6764471", "0.6751027", "0.67505205", "0.6738436", "0.6738436", "0.6738436", "0.6738436", "0.67349446", "0.67347", "0.67312944", "0.6730746", "0.672053", "0.6715697", "0.6715697", "0.67144084", "0.6713306", "0.67117983", "0.6710869", "0.67040443", "0.67040443", "0.6702487", "0.67013323", "0.66988975", "0.6698885", "0.6697714", "0.66943663", "0.6691723", "0.66897917", "0.66897917", "0.66897917", "0.66897917", "0.66897917", "0.66825" ]
0.683855
54