query
stringlengths 7
6.41k
| document
stringlengths 12
28.8k
| metadata
dict | negatives
sequencelengths 30
30
| negative_scores
sequencelengths 30
30
| document_score
stringlengths 5
10
| document_rank
stringclasses 2
values |
---|---|---|---|---|---|---|
GET /property_between_floor_slaps GET /property_between_floor_slaps.json | def index
@property_between_floor_slaps = PropertyBetweenFloorSlap.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_property_between_floor_slap\n @property_between_floor_slap = PropertyBetweenFloorSlap.find(params[:id])\n end",
"def property_between_floor_slap_params\n params.require(:property_between_floor_slap).permit(:between_floor_slap_id, :property_id, :quality_id)\n end",
"def create\n @property_between_floor_slap = PropertyBetweenFloorSlap.new(property_between_floor_slap_params)\n\n respond_to do |format|\n if @property_between_floor_slap.save\n format.html { redirect_to @property_between_floor_slap, notice: 'Property between floor slap was successfully created.' }\n format.json { render :show, status: :created, location: @property_between_floor_slap }\n else\n format.html { render :new }\n format.json { render json: @property_between_floor_slap.errors, status: :unprocessable_entity }\n end\n end\n end",
"def south_greater_than_north_roads\n north = 78\n east = -100\n south = 79\n west = -101\n OverpassGraph.get_roads(north, east, south, west, [], [])\nend",
"def index\n @floor_plans = @location.floor_plans\n end",
"def surface_bounds\n\n sql = \"select \"\\\n \"min(surface_longitude) as min_longitude, \"\\\n \"min(surface_latitude) as min_latitude, \"\\\n \"max(surface_longitude) as max_longitude, \"\\\n \"max(surface_latitude) as max_latitude \"\\\n \"from well where \"\\\n \"surface_longitude between -180 and 180 and \"\\\n \"surface_latitude between -90 and 90 and \"\\\n \"surface_longitude is not null and \"\\\n \"surface_latitude is not null\"\n\n corners = @gxdb[sql].all[0]\n\n {\n name: \"surface_bounds\",\n location: {\n type: \"polygon\",\n coordinates: [[\n [corners[:min_longitude], corners[:min_latitude]], #LL\n [corners[:min_longitude], corners[:max_latitude]], #UL\n [corners[:max_longitude], corners[:max_latitude]], #UR\n [corners[:max_longitude], corners[:min_latitude]], #LR\n [corners[:min_longitude], corners[:min_latitude]] #LL\n ]]\n }\n }\n end",
"def index\n if params[:ax] && params[:ay] && params[:bx] && params[:by]\n @properties = Property.find_by_coordinates(\n upper_x: params[:ax],\n upper_y: params[:ay],\n bottom_x: params[:bx],\n bottom_y: params[:by]\n )\n else\n @properties = Property.all #in this case is much necessary to implement pagination system\n end\n\n respond_with :api, :v1, @properties, status: :ok\n end",
"def bounds\n \t@data['bounds']\n end",
"def index\n return render status: :bad_request, json: {message: \"Missing required param 'latitude'.\"} if params[:latitude].blank?\n return render status: :bad_request, json: {message: \"Missing required param 'longitude'.\"} if params[:longitude].blank?\n\n range = params[:range].blank? ? 10000 : params[:range]\n start_time = params[:start_time].blank? ? Time.now : params[:start_time]\n end_time = params[:end_time].blank? ? 1.day.from_now : params[:end_time]\n\n near = ParkingPlace.near([params[:latitude], params[:longitude]], range, :units => :km)\n\n time_slots = TimeSlot\n .includes(:parking_place).references(:parking_place).merge(near)\n .where('start_time <= ? AND end_time >= ?', start_time, end_time)\n .paginate(:page => params[:page], :per_page => params[:per_page])\n\n render json: time_slots, each_serializer: TimeSlotIndexSerializer\n end",
"def index\n \tif @current_user\n \t\tsetting_distance = Setting.first.mile_for_list\n # raise setting_distance.inspect\n \t\tif params[:lat].present? && params[:lon].present?\n # @property = Property.where.not(is_active: false,status:'Sold').order(\"id DESC\").includes(:property_detail).distance(params[:lat].to_f,params[:lon].to_f,distance)\n @property = Property.where.not(is_active: false,status:'Sold').includes(:property_detail).order(\"id DESC\").near(\"#{params[:lat]},#{params[:lon]}\",setting_distance)\n\n # @property = Property.where(is_active: true).distance(params[:lat].to_f,params[:lon].to_f,distance)\n \t\t\t# @property.delete_if {|x| x.status == \"Sold\" || x.is_active == false }\n \t\telse\n \t\t\t@property = Property.where(status: \"For Sale\",is_active: true).order(\"id DESC\").includes(:property_detail)\n \t\tend\n \t\tif @property.present?\n \t\t\trender :file => 'api/v1/property/index'\n \t\telse\n \t\t\trender_json({\"status\" => \"Fail\", \"message\" => \"No property found.\"}.to_json)\n \t\tend\n \tend\n end",
"def elevators_at_floor(floor)\n\t\televators.select{|elevator| elevator.floor.eql? floor}\n\tend",
"def get_bounds\n [ @min, @max ]\n end",
"def midtown_roads\n midtown_north = 40.764104432913086\n midtown_east = -73.97675156593323\n midtown_south = 40.75897668730365\n midtown_west = -73.98523807525635\n OverpassGraph.get_roads(midtown_north, midtown_east, midtown_south, midtown_west, [], [])\nend",
"def index\n @sightings = Sighting.where(date: params[:start_date]..params[:end_date])\n render json: @sightings\n end",
"def compute_bounds(stations)\n north = south = stations.first['lat']\n east = west = stations.first['lon']\n stations.each do |station|\n lat = station['lat']\n lon = station['lon']\n north = lat if lat > north\n south = lat if lat < south\n east = lon if lon > east\n west = lon if lon < west\n end\n [[north,west],[south,east]]\nend",
"def show\n @companies = Company.where('floor_id = ?', @floor.id)\n @spaces = MeetingRoom.where('floor_id = ?', @floor.id)\n end",
"def houses\n @request[:property_type] = 'houses'\n self\n end",
"def hanover_roads\n hanover_north = 43.7031803975023\n hanover_east = -72.28413820266724\n hanover_south = 43.69828604529516\n hanover_west = -72.29262471199036\n OverpassGraph.get_roads(hanover_north, hanover_east, hanover_south, hanover_west, [], [])\nend",
"def index\n @shooting_ranges = ShootingRange.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @shooting_ranges }\n end\n end",
"def show\n @rooms = Room.all.where(floor_id: @floor.id)\n\n # преобразование массива точек в строку для SVG.js (для полигонов этажей):\n # @showPointsOfFloor = []\n # polygons_ids = Polygon.all.where(imageable_id: @floor.id).map{ |i| i.id }\n # polygons_ids.each do |i|\n # @showPointsOfFloor << Point.all.where(polygon_id: i)\n # .sort_by{ |j| j[:priority] }\n # .map{ |j| \"#{j.ox}, #{j.oy}\" }\n # .join(\" \")\n # end\n\n # преобразование массива точек в строку для SVG.js (для полигонов аудиторий):\n @showPointsOfRooms = []\n @showNamesOfRooms = []\n polygons_ids = Polygon.all.where(imageable_id: Room.all.where(floor_id: @floor.id))\n polygons_ids.each do |i|\n @showPointsOfRooms << Point.all.where(polygon_id: i.id )\n .sort_by{ |j| j[:priority] }\n .map{ |j| \"#{j.ox}, #{j.oy}\" }\n .join(\" \")\n @showNamesOfRooms << Room.all.where(id: i.imageable_id)[0].name\n end\n end",
"def ranges\n attributes.fetch(:ranges)\n end",
"def get_locations\n splits = SplitLocationFinder.splits(params).where.not(course_id: @event.course_id)\n render json: splits, each_serializer: SplitLocationSerializer\n end",
"def get_locations\n splits = SplitLocationFinder.splits(params).where.not(course_id: @event.course_id)\n render json: splits, each_serializer: SplitLocationSerializer\n end",
"def get_around_estates\n\n\t\t# center_x = 121.7155930000\n\t\t# center_y = 25.1215410000\n\t\t# delta_x = 0.00772495\n\t\t# delta_y = 0.01102129\n\n\t\tcenter_x = params[:center_x].to_f\n \tcenter_y = params[:center_y].to_f\n \tdelta_x = params[:delta_x].to_f\n \tdelta_y = params[:delta_y].to_f\n\n\n \tcritera = \"x_long IS NOT NULL and y_lat IS NOT NULL\"\n \tborder = \"and x_long > #{center_x - delta_x} and x_long < #{center_x + delta_x} and y_lat > #{center_y - delta_y} and y_lat < #{center_y + delta_y}\" \n\n \titems = Realestate.select(\"id, estate_group, x_long, y_lat\").where(\"#{critera} #{border}\").paginate(:page => 1, :per_page => 10)\n\n \trender :json => items\n\n\tend",
"def range_from_params(json)\n return ::Time.now,::Time.now if json.empty?\n obj = JSON(json)\n min = ::Time.parse(obj['start'].to_s).at_beginning_of_day\n max = ::Time.parse(obj['end'].to_s).at_end_of_day\n min,max = max,min if min > max\n return min, max\n end",
"def screen_params_for_range_limit\n if (params['range_end'].nil?) ||\n (params['range_start'].nil?) ||\n (params['range_start'].to_i > params['range_end'].to_i)\n render plain: \"Calls to range_limit should have a range_start \" +\n \"and a range_end parameter, and range_start \" +\n \"should be before range_end.\", status: 406\n end\n end",
"def range\n #@lines = Line.where(:no=> params[:id])\n line_range = params[:id].split(\"-\")\n @stanzas = Stanza.where(:section_id=>line_range[0]..line_range[2],:runningno=>line_range[1]..line_range[3]).order('no')\n lines = Array.new\n @stanzas.each {|s| lines << s.cached_lines }\n respond_to do |format|\n format.html #range.html.erb\n format.json {render :json => lines.to_json(:only =>[:line, :stanza_id],:methods=>[:section,:runningno,:share_url,:no])}\n end\n end",
"def hit_floor\n return nil if rising?\n what_object_hit_me_on_the :side => :bottom, :restrict => Standable, :look_ahead => 10, :margin_of_error => 25\n end",
"def get_league_standings_by_league(league_id)\n response = parse_api_request(\"#{BASE_URL}standings/#{league_id}\")[\"standings\"]\nend",
"def getInArea\n max=params[:max]||100\n\tlimit=params[:limit]||200\n\tif params[:mcc] then mcc=\" mcc=\"+params[:mcc]+\" AND \" else mcc=\"\" end\n\tif params[:mnc] then mnc=\" mnc=\"+params[:mnc]+\" AND \" else mnc=\"\" end\n if params[:BBOX]\n bbox=params[:BBOX].split(',')\n r=Rect.new bbox[0].to_f,bbox[1].to_f,bbox[2].to_f,bbox[3].to_f\n else\n r=Rect.new -180.to_f,-90.to_f,180.to_f,90.to_f\n end\n @cells=Cell.find_by_sql(\"SELECT * from cells where \"+mcc+mnc+\" lat>=\"+r.minLat.to_s+\" and lat<=\"+r.maxLat.to_s+\" and lon>=\"+r.minLon.to_s+\" and lon<=\"+r.maxLon.to_s+\" LIMIT \"+limit.to_s)\n if params[:fmt]==\"xml\"\n render(:action=>\"listXml\",:layout=>false)\n elsif params[:fmt]==\"txt\"\n\t\theaders['Content-Type'] = \"text/plain\" \n render(:action=>\"listCsv\",:layout=>false)\n else\n render(:action=>\"listKml\",:layout=>false)\n end\n end"
] | [
"0.69060063",
"0.61157036",
"0.5888169",
"0.5649257",
"0.5491359",
"0.5422482",
"0.5376796",
"0.5331189",
"0.53073645",
"0.52703154",
"0.5230716",
"0.52174205",
"0.52156436",
"0.52033854",
"0.51998276",
"0.5193905",
"0.51654613",
"0.51582396",
"0.5149543",
"0.510811",
"0.51012236",
"0.5085275",
"0.5085275",
"0.50812286",
"0.50643563",
"0.50605315",
"0.5056479",
"0.50534093",
"0.50363153",
"0.50339663"
] | 0.78588855 | 0 |
POST /property_between_floor_slaps POST /property_between_floor_slaps.json | def create
@property_between_floor_slap = PropertyBetweenFloorSlap.new(property_between_floor_slap_params)
respond_to do |format|
if @property_between_floor_slap.save
format.html { redirect_to @property_between_floor_slap, notice: 'Property between floor slap was successfully created.' }
format.json { render :show, status: :created, location: @property_between_floor_slap }
else
format.html { render :new }
format.json { render json: @property_between_floor_slap.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @property_between_floor_slaps = PropertyBetweenFloorSlap.all\n end",
"def set_property_between_floor_slap\n @property_between_floor_slap = PropertyBetweenFloorSlap.find(params[:id])\n end",
"def property_between_floor_slap_params\n params.require(:property_between_floor_slap).permit(:between_floor_slap_id, :property_id, :quality_id)\n end",
"def create\n @shooting_range = ShootingRange.new(params[:shooting_range])\n\n respond_to do |format|\n if @shooting_range.save\n format.html { redirect_to(@shooting_range, :notice => 'Shooting range was successfully created.') }\n format.xml { render :xml => @shooting_range, :status => :created, :location => @shooting_range }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @shooting_range.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @blank_wall = BlankWall.new(blank_wall_params)\n budget_range = blank_wall_params[:budget_range].split(\",\")\n @blank_wall.min_budget = budget_range[0]\n @blank_wall.max_budget = budget_range[1]\n respond_to do |format|\n if @blank_wall.save\n format.html { redirect_to @blank_wall, notice: 'Blank wall was successfully created.' }\n format.json { render :show, status: :created, location: @blank_wall }\n else\n format.html { render :new }\n format.json { render json: @blank_wall.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @property_between_floor_slap.update(property_between_floor_slap_params)\n format.html { redirect_to @property_between_floor_slap , notice: 'Property between floor slap was successfully updated.' }\n format.json { render :show, status: :ok, location: @property_between_floor_slap }\n else\n format.html { render :edit }\n format.json { render json: @property_between_floor_slap.errors, status: :unprocessable_entity }\n end\n end\n end",
"def test_mid_left_two_unit_per_floor_no_corridor\n num_finished_spaces = 1\n args_hash = {}\n args_hash['num_floors'] = 3\n args_hash['num_units'] = 6\n args_hash['level'] = 'Middle'\n args_hash['corridor_position'] = 'None'\n args_hash['horz_location'] = 'Left'\n expected_num_del_objects = {}\n expected_num_new_objects = { 'BuildingUnit' => 1, 'Surface' => 6, 'ThermalZone' => 1, 'Space' => 1, 'SpaceType' => 1, 'PeopleDefinition' => num_finished_spaces, 'People' => num_finished_spaces, 'ScheduleConstant' => 1, 'ShadingSurfaceGroup' => 1, 'ShadingSurface' => 2, 'ExternalFile' => 1, 'ScheduleFile' => 1 }\n expected_values = { 'FinishedFloorArea' => 900 * 1, 'BuildingHeight' => 8, 'Beds' => 3.0, 'Baths' => 2.0, 'NumOccupants' => 3.39, 'EavesDepth' => 2, 'NumAdiabaticSurfaces' => 3 }\n _test_measure(nil, args_hash, expected_num_del_objects, expected_num_new_objects, expected_values, __method__)\n end",
"def create\n @floor = Floor.new(params[:floor])\n\n respond_to do |format|\n if @floor.save\n format.html { redirect_to @floor, notice: 'Floor was successfully created.' }\n format.json { render json: @floor, status: :created, location: @floor }\n else\n format.html { render action: \"new\" }\n format.json { render json: @floor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @property_between_floor_slap.destroy\n respond_to do |format|\n format.html { redirect_to property_between_floor_slaps_url, notice: 'Property between floor slap was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def test_mid_left_one_unit_per_floor_no_corridor\n num_finished_spaces = 1\n args_hash = {}\n args_hash['num_floors'] = 3\n args_hash['num_units'] = 3\n args_hash['level'] = 'Middle'\n args_hash['corridor_position'] = 'None'\n args_hash['horz_location'] = 'Left'\n expected_num_del_objects = {}\n expected_num_new_objects = { 'BuildingUnit' => 1, 'Surface' => 6, 'ThermalZone' => 1, 'Space' => 1, 'SpaceType' => 1, 'PeopleDefinition' => num_finished_spaces, 'People' => num_finished_spaces, 'ScheduleConstant' => 1, 'ShadingSurfaceGroup' => 1, 'ShadingSurface' => 2, 'ExternalFile' => 1, 'ScheduleFile' => 1 }\n expected_values = { 'FinishedFloorArea' => 900 * 1, 'BuildingHeight' => 8, 'Beds' => 3.0, 'Baths' => 2.0, 'NumOccupants' => 3.39, 'EavesDepth' => 2, 'NumAdiabaticSurfaces' => 2 }\n _test_measure(nil, args_hash, expected_num_del_objects, expected_num_new_objects, expected_values, __method__)\n end",
"def test_range_overlap_for_intersecting_ranges\n segment = basic_segment\n segment.instance_variable_set(:@start_time, 1.0)\n segment.instance_variable_set(:@end_time, 3.0)\n\n assert_in_delta(1.0, segment.send(:range_overlap, 2.0..4.0))\n end",
"def build_geographies\n build_start_or_end_area unless start_or_end_area\n build_trip_within_area unless trip_within_area\n end",
"def create\n @floor = Floor.new(floor_params)\n\n respond_to do |format|\n if @floor.save\n editorData = @floor.editor_data\n editorData = editorData.split(\"<END>\").map{|i| i.split(\"<NEXT>\")}\n editorData.each do |obj|\n if obj[0] == 'submain'\n object = Room.new(name: obj[1],\n description: obj[2],\n capacity: obj[3],\n computers: obj[4],\n roomtype_id: Roomtype.all.where(id: obj[5].to_i)[0],\n floor_id: @floor.id)\n object.save\n elsif obj[0] == 'main'\n object = @floor\n end\n polygon = Polygon.new(imageable: object)\n polygon.save\n points = obj[6].split(\" \").map{|i| i.split(\",\")}\n for i in 0 ... points.size\n point = Point.create(ox: points[i][0].to_f,\n oy: points[i][1].to_f,\n priority: i,\n polygon: polygon\n )\n point.save\n end\n end\n\n format.html { redirect_to @floor, notice: t('flash.floor.create') }\n format.json { render :show, status: :created, location: @floor }\n else\n format.html { render :new }\n format.json { render json: @floor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def test_mid_left_two_unit_per_floor_single_corridor\n num_finished_spaces = 1\n args_hash = {}\n args_hash['num_floors'] = 3\n args_hash['num_units'] = 6\n args_hash['level'] = 'Middle'\n args_hash['corridor_position'] = 'Single Exterior (Front)'\n args_hash['horz_location'] = 'Left'\n expected_num_del_objects = {}\n expected_num_new_objects = { 'BuildingUnit' => 1, 'Surface' => 6, 'ThermalZone' => 1, 'Space' => 1, 'SpaceType' => 1, 'PeopleDefinition' => num_finished_spaces, 'People' => num_finished_spaces, 'ScheduleConstant' => 1, 'ShadingSurfaceGroup' => 2, 'ShadingSurface' => 3, 'ExternalFile' => 1, 'ScheduleFile' => 1 }\n expected_values = { 'FinishedFloorArea' => 900 * 1, 'BuildingHeight' => 8, 'Beds' => 3.0, 'Baths' => 2.0, 'NumOccupants' => 3.39, 'EavesDepth' => 2, 'NumAdiabaticSurfaces' => 3 }\n _test_measure(nil, args_hash, expected_num_del_objects, expected_num_new_objects, expected_values, __method__)\n end",
"def create\n @salary_range = SalaryRange.new(params[:salary_range])\n\n respond_to do |format|\n if @salary_range.save\n format.html { redirect_to @salary_range, notice: 'Salary range was successfully created.' }\n format.json { render json: @salary_range, status: :created, location: @salary_range }\n else\n format.html { render action: \"new\" }\n format.json { render json: @salary_range.errors, status: :unprocessable_entity }\n end\n end\n end",
"def houses\n @request[:property_type] = 'houses'\n self\n end",
"def test_mid_left_two_unit_per_floor_double_corridor\n num_finished_spaces = 1\n args_hash = {}\n args_hash['num_floors'] = 3\n args_hash['num_units'] = 6\n args_hash['level'] = 'Middle'\n args_hash['corridor_position'] = 'Double-Loaded Interior'\n args_hash['horz_location'] = 'Left' # Forces single front corridor\n expected_num_del_objects = {}\n expected_num_new_objects = { 'BuildingUnit' => 1, 'Surface' => 6, 'ThermalZone' => 1, 'Space' => 1, 'SpaceType' => 1, 'PeopleDefinition' => num_finished_spaces, 'People' => num_finished_spaces, 'ScheduleConstant' => 1, 'ShadingSurfaceGroup' => 2, 'ShadingSurface' => 3, 'ExternalFile' => 1, 'ScheduleFile' => 1 }\n expected_values = { 'FinishedFloorArea' => 900 * 1, 'BuildingHeight' => 8, 'Beds' => 3.0, 'Baths' => 2.0, 'NumOccupants' => 3.39, 'EavesDepth' => 2, 'NumAdiabaticSurfaces' => 3 }\n _test_measure(nil, args_hash, expected_num_del_objects, expected_num_new_objects, expected_values, __method__)\n end",
"def test_mid_left_one_unit_per_floor_single_corridor\n num_finished_spaces = 1\n args_hash = {}\n args_hash['num_floors'] = 3\n args_hash['num_units'] = 3\n args_hash['level'] = 'Middle'\n args_hash['corridor_position'] = 'Single Exterior (Front)'\n args_hash['horz_location'] = 'Left'\n expected_num_del_objects = {}\n expected_num_new_objects = { 'BuildingUnit' => 1, 'Surface' => 6, 'ThermalZone' => 1, 'Space' => 1, 'SpaceType' => 1, 'PeopleDefinition' => num_finished_spaces, 'People' => num_finished_spaces, 'ScheduleConstant' => 1, 'ShadingSurfaceGroup' => 2, 'ShadingSurface' => 3, 'ExternalFile' => 1, 'ScheduleFile' => 1 }\n expected_values = { 'FinishedFloorArea' => 900 * 1, 'BuildingHeight' => 8, 'Beds' => 3.0, 'Baths' => 2.0, 'NumOccupants' => 3.39, 'EavesDepth' => 2, 'NumAdiabaticSurfaces' => 2 }\n _test_measure(nil, args_hash, expected_num_del_objects, expected_num_new_objects, expected_values, __method__)\n end",
"def test_top_left_one_unit_per_floor_no_corridor\n num_finished_spaces = 1\n args_hash = {}\n args_hash['num_floors'] = 3\n args_hash['num_units'] = 3\n args_hash['level'] = 'Top'\n args_hash['corridor_position'] = 'None'\n args_hash['horz_location'] = 'Left'\n expected_num_del_objects = {}\n expected_num_new_objects = { 'BuildingUnit' => 1, 'Surface' => 6, 'ThermalZone' => 1, 'Space' => 1, 'SpaceType' => 1, 'PeopleDefinition' => num_finished_spaces, 'People' => num_finished_spaces, 'ScheduleConstant' => 1, 'ShadingSurfaceGroup' => 2, 'ShadingSurface' => 6, 'ExternalFile' => 1, 'ScheduleFile' => 1 }\n expected_values = { 'FinishedFloorArea' => 900 * 1, 'BuildingHeight' => 8, 'Beds' => 3.0, 'Baths' => 2.0, 'NumOccupants' => 3.39, 'EavesDepth' => 2, 'NumAdiabaticSurfaces' => 1 }\n _test_measure(nil, args_hash, expected_num_del_objects, expected_num_new_objects, expected_values, __method__)\n end",
"def test_top_left_two_unit_per_floor_no_corridor\n num_finished_spaces = 1\n args_hash = {}\n args_hash['num_floors'] = 3\n args_hash['num_units'] = 6\n args_hash['level'] = 'Top'\n args_hash['corridor_position'] = 'None'\n args_hash['horz_location'] = 'Left'\n expected_num_del_objects = {}\n expected_num_new_objects = { 'BuildingUnit' => 1, 'Surface' => 6, 'ThermalZone' => 1, 'Space' => 1, 'SpaceType' => 1, 'PeopleDefinition' => num_finished_spaces, 'People' => num_finished_spaces, 'ScheduleConstant' => 1, 'ShadingSurfaceGroup' => 2, 'ShadingSurface' => 6, 'ExternalFile' => 1, 'ScheduleFile' => 1 }\n expected_values = { 'FinishedFloorArea' => 900 * 1, 'BuildingHeight' => 8, 'Beds' => 3.0, 'Baths' => 2.0, 'NumOccupants' => 3.39, 'EavesDepth' => 2, 'NumAdiabaticSurfaces' => 2 }\n _test_measure(nil, args_hash, expected_num_del_objects, expected_num_new_objects, expected_values, __method__)\n end",
"def floor_params\n params.require(:floor).permit(:building_id, :floor)\n end",
"def test_range_overlap_for_non_intersecting_ranges\n segment = basic_segment\n segment.instance_variable_set(:@start_time, 1.0)\n segment.instance_variable_set(:@end_time, 3.0)\n\n assert_in_delta(0.0, segment.send(:range_overlap, 4.0..5.0))\n end",
"def setBoundaries(boundaries)\n @boundaries = boundaries\n end",
"def create\n @arrival_range = ArrivalRange.new(params[:arrival_range])\n\n respond_to do |format|\n if @arrival_range.save\n format.html { redirect_to @arrival_range, notice: 'Arrival range was successfully created.' }\n format.json { render json: @arrival_range, status: :created, location: @arrival_range }\n else\n format.html { render action: \"new\" }\n format.json { render json: @arrival_range.errors, status: :unprocessable_entity }\n end\n end\n end",
"def hit_floor\n return nil if rising?\n what_object_hit_me_on_the :side => :bottom, :restrict => Standable, :look_ahead => 10, :margin_of_error => 25\n end",
"def create\n @pharmacy_range = PharmacyRange.new(params[:pharmacy_range])\n\n respond_to do |format|\n if @pharmacy_range.save\n format.html { redirect_to(@pharmacy_range, :notice => 'PharmacyRange was successfully created.') }\n format.xml { render :xml => @pharmacy_range, :status => :created, :location => @pharmacy_range }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @pharmacy_range.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def define_bounds\n\tminLat = 900\n\tminLng = 900\n\tmaxLat = -900\n\tmaxLng = -900\n\t\n\t@locations.map do |location|\n\t\tif location.lat < minLat\n\t\t\tminLat = location.lat\n\t\tend\n\t\tif location.lng < minLng\n\t\t\tminLng = location.lng\n\t\tend\n\t\tif location.lat > maxLat\n\t\t\tmaxLat = location.lat\n\t\tend\n\t\tif location.lng > maxLng\n\t\t\tmaxLng = location.lng\n\t\tend\n\tend\n\t@marker_bounds[\"n\"] = maxLat\n\t@marker_bounds[\"s\"] = minLat\n\t@marker_bounds[\"e\"] = maxLng\n\t@marker_bounds[\"w\"] = minLng\n\t@marker_bounds[\"maxLat\"] = maxLat\n\t@marker_bounds[\"minLat\"] = minLat\n\t@marker_bounds[\"maxLng\"] = maxLng\n\t@marker_bounds[\"minLng\"] = minLng\nend",
"def create\n @fixture = @league.fixture.new(fixture_params)\n\n respond_to do |format|\n if @fixture.home == @fixture.away\n format.html {redirect_to new_fixture_path(league_id: @league)}\n flash[:notice] = \"Home team and away team cannot be the same\"\n \n elsif @fixture.save\n format.html { redirect_to @league, notice: 'Fixture was successfully created.' }\n format.json { render :show, status: :created, location: @fixture }\n\n if @fixture.homegoals > @fixture.awaygoals\n @fixture.home.update_attribute(:MP, @fixture.home.MP + 1)\n @fixture.home.update_attribute(:W, @fixture.home.W + 1)\n @fixture.home.update_attribute(:Pts, @fixture.home.Pts + 3)\n\n @fixture.away.update_attribute(:MP, @fixture.away.MP + 1)\n @fixture.away.update_attribute(:L, @fixture.away.L + 1)\n\n elsif @fixture.homegoals < @fixture.awaygoals\n @fixture.away.update_attribute(:MP, @fixture.away.MP + 1)\n @fixture.away.update_attribute(:W, @fixture.away.W + 1)\n @fixture.away.update_attribute(:Pts, @fixture.away.Pts + 3)\n\n @fixture.home.update_attribute(:MP, @fixture.home.MP + 1)\n @fixture.home.update_attribute(:L, @fixture.home.L + 1)\n else\n @fixture.away.update_attribute(:MP, @fixture.away.MP + 1)\n @fixture.away.update_attribute(:D, @fixture.away.D + 1)\n @fixture.away.update_attribute(:Pts, @fixture.away.Pts + 1)\n\n @fixture.home.update_attribute(:MP, @fixture.home.MP + 1)\n @fixture.home.update_attribute(:D, @fixture.home.D + 1)\n @fixture.home.update_attribute(:Pts, @fixture.home.Pts + 1)\n end\n\n else\n format.html {redirect_to new_fixture_path(league_id: @league)}\n flash[:notice] = @fixture.errors.full_messages.to_sentence\n end\n end\n end",
"def test_top_left_two_unit_per_floor_single_corridor\n num_finished_spaces = 1\n args_hash = {}\n args_hash['num_floors'] = 3\n args_hash['num_units'] = 6\n args_hash['level'] = 'Top'\n args_hash['corridor_position'] = 'Single Exterior (Front)'\n args_hash['horz_location'] = 'Left'\n expected_num_del_objects = {}\n expected_num_new_objects = { 'BuildingUnit' => 1, 'Surface' => 6, 'ThermalZone' => 1, 'Space' => 1, 'SpaceType' => 1, 'PeopleDefinition' => num_finished_spaces, 'People' => num_finished_spaces, 'ScheduleConstant' => 1, 'ShadingSurfaceGroup' => 3, 'ShadingSurface' => 7, 'ExternalFile' => 1, 'ScheduleFile' => 1 }\n expected_values = { 'FinishedFloorArea' => 900 * 1, 'BuildingHeight' => 8, 'Beds' => 3.0, 'Baths' => 2.0, 'NumOccupants' => 3.39, 'EavesDepth' => 2, 'NumAdiabaticSurfaces' => 2 }\n _test_measure(nil, args_hash, expected_num_del_objects, expected_num_new_objects, expected_values, __method__)\n end",
"def screen_params_for_range_limit\n if (params['range_end'].nil?) ||\n (params['range_start'].nil?) ||\n (params['range_start'].to_i > params['range_end'].to_i)\n render plain: \"Calls to range_limit should have a range_start \" +\n \"and a range_end parameter, and range_start \" +\n \"should be before range_end.\", status: 406\n end\n end"
] | [
"0.6934517",
"0.68359023",
"0.65886587",
"0.55116165",
"0.5449827",
"0.5305369",
"0.5082544",
"0.50723386",
"0.5067619",
"0.50580436",
"0.50201815",
"0.50010294",
"0.49929175",
"0.49878052",
"0.49708432",
"0.4954112",
"0.49523896",
"0.49491084",
"0.49345988",
"0.49335435",
"0.4928445",
"0.49142134",
"0.49101967",
"0.48856503",
"0.48794472",
"0.48666015",
"0.48507547",
"0.48369616",
"0.48314998",
"0.48266935"
] | 0.6978419 | 0 |
PATCH/PUT /property_between_floor_slaps/1 PATCH/PUT /property_between_floor_slaps/1.json | def update
respond_to do |format|
if @property_between_floor_slap.update(property_between_floor_slap_params)
format.html { redirect_to @property_between_floor_slap , notice: 'Property between floor slap was successfully updated.' }
format.json { render :show, status: :ok, location: @property_between_floor_slap }
else
format.html { render :edit }
format.json { render json: @property_between_floor_slap.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_property_between_floor_slap\n @property_between_floor_slap = PropertyBetweenFloorSlap.find(params[:id])\n end",
"def update\n @floor = Floor.find(params[:id])\n params[:floor][:location_id] = params[:floor][:loc_id]\n params[:floor].delete :loc_id\n respond_to do |format|\n if @floor.update_attributes(params[:floor])\n format.html { redirect_to floors_path, notice: 'Floor was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @floor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @floor = Floor.find(params[:id])\n\n respond_to do |format|\n if @floor.update_attributes(params[:floor])\n format.html { redirect_to @floor, notice: 'Floor was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @floor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @floor.update(floor_params)\n format.html { redirect_to floors_path, notice: I18n.t('floors.update') }\n format.json { render :show, status: :ok, location: @floor }\n else\n format.html { render :edit }\n format.json { render json: @floor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def property_between_floor_slap_params\n params.require(:property_between_floor_slap).permit(:between_floor_slap_id, :property_id, :quality_id)\n end",
"def update\n @location_property = LocationProperty.find(params[:id])\n\n respond_to do |format|\n if @location_property.update_attributes(params[:location_property])\n format.html { redirect_to @location_property, notice: 'Location property was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @location_property.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @floor_plan.update(floor_plan_params)\n format.html { redirect_to location_path(@location), notice: 'Floor plan was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @floor_plan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @floor_stage.update(floor_stage_params)\n format.html { redirect_to @floor_stage, notice: 'Stage was successfully updated.' }\n format.json { render :show, status: :ok, location: @floor_stage }\n else\n format.html { render :edit }\n format.json { render json: @floor_stage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n #@opportunity = Opportunity.find(params[:id])\n #@floor = @opportunity.floor\n #@building = @floor.building\n\n respond_to do |format|\n if @opportunity.update_attributes(params[:opportunity])\n flash[:notice] = 'Opportunity was successfully updated.'\n format.html { redirect_to(opportunity_path(@opportunity)) }\n format.xml { head :ok }\n else\n flash[:error] = 'Opportunity could not be updated.'\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @opportunity.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @min_num_bathrooms = args[:min_num_bathrooms] if args.key?(:min_num_bathrooms)\n @min_num_bedrooms = args[:min_num_bedrooms] if args.key?(:min_num_bedrooms)\n end",
"def update\n respond_to do |format|\n if @property_closet.update(property_closet_params)\n format.html { redirect_to @property_closet, notice: 'Property closet was successfully updated.' }\n format.json { render :show, status: :ok, location: @property_closet }\n else\n format.html { render :edit }\n format.json { render json: @property_closet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @shooting_range = ShootingRange.find(params[:id])\n\n respond_to do |format|\n if @shooting_range.update_attributes(params[:shooting_range])\n format.html { redirect_to(@shooting_range, :notice => 'Shooting range was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @shooting_range.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @floor_plan.update(floor_plan_params)\n format.html { redirect_to @floor_plan, notice: 'Floor plan was successfully updated.' }\n format.json { render :show, status: :ok, location: @floor_plan }\n else\n format.html { render :edit }\n format.json { render json: @floor_plan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @floor_plan.update(floor_plan_params)\n format.html { redirect_to :back, notice: 'Floor plan was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @floor_plan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @property_interior_closure.update(property_interior_closure_params)\n format.html { redirect_to @property_interior_closure, notice: 'Property interior closure was successfully updated.' }\n format.json { render :show, status: :ok, location: @property_interior_closure }\n else\n format.html { render :edit }\n format.json { render json: @property_interior_closure.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @rectangle = args[:rectangle] if args.key?(:rectangle)\n @strict_restriction = args[:strict_restriction] if args.key?(:strict_restriction)\n end",
"def update\n if @api_v1_property.update(api_v1_property_params)\n render :show, status: :ok, location: @api_v1_property\n else\n render json: @api_v1_property.errors, status: :unprocessable_entity\n end\n end",
"def create\n @property_between_floor_slap = PropertyBetweenFloorSlap.new(property_between_floor_slap_params)\n\n respond_to do |format|\n if @property_between_floor_slap.save\n format.html { redirect_to @property_between_floor_slap, notice: 'Property between floor slap was successfully created.' }\n format.json { render :show, status: :created, location: @property_between_floor_slap }\n else\n format.html { render :new }\n format.json { render json: @property_between_floor_slap.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @stolen_property.update(stolen_property_params)\n format.html { redirect_to @stolen_property, notice: 'Stolen property was successfully updated.' }\n format.json { render :show, status: :ok, location: @stolen_property }\n else\n format.html { render :edit }\n format.json { render json: @stolen_property.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @roadmap = Roadmap.find(@roadmap_step.roadmap_id)\n\n respond_to do |format|\n if @roadmap_step.update(roadmap_step_params)\n format.html { redirect_to @roadmap, notice: 'Roadmap step was successfully updated.' }\n format.json { render :show, status: :ok, location: @roadmap_step }\n else\n format.html { render :edit }\n format.json { render json: @roadmap_step.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @wall_plate.update(wall_plate_params)\n format.html { redirect_to @wall_plate, notice: 'Wall plate was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @wall_plate.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @building = args[:building] if args.key?(:building)\n @city = args[:city] if args.key?(:city)\n @floor = args[:floor] if args.key?(:floor)\n @latitude = args[:latitude] if args.key?(:latitude)\n @longitude = args[:longitude] if args.key?(:longitude)\n @section = args[:section] if args.key?(:section)\n @simple_name = args[:simple_name] if args.key?(:simple_name)\n end",
"def update\n respond_to do |format|\n if @horizontal_property.update(horizontal_property_params)\n format.html { redirect_to @horizontal_property.act, notice: 'Horizontal property was successfully updated.' }\n format.json { render :show, status: :ok, location: @horizontal_property.act }\n else\n format.html { render :edit }\n format.json { render json: @horizontal_property.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @line_property.update(line_property_params)\n format.html { redirect_to @line_property, notice: 'Line property was successfully updated.' }\n format.json { render :show, status: :ok, location: @line_property }\n else\n format.html { render :edit }\n format.json { render json: @line_property.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @bounding_marker = args[:bounding_marker] if args.key?(:bounding_marker)\n @conjoined_category = args[:conjoined_category] if args.key?(:conjoined_category)\n @distance_to_next_lane = args[:distance_to_next_lane] if args.key?(:distance_to_next_lane)\n @flow = args[:flow] if args.key?(:flow)\n @lane_connection = args[:lane_connection] if args.key?(:lane_connection)\n @lane_divider_crossing = args[:lane_divider_crossing] if args.key?(:lane_divider_crossing)\n @lane_follows_segment_begin_fraction = args[:lane_follows_segment_begin_fraction] if args.key?(:lane_follows_segment_begin_fraction)\n @lane_follows_segment_end_fraction = args[:lane_follows_segment_end_fraction] if args.key?(:lane_follows_segment_end_fraction)\n @lane_number = args[:lane_number] if args.key?(:lane_number)\n @lane_token = args[:lane_token] if args.key?(:lane_token)\n @metadata = args[:metadata] if args.key?(:metadata)\n @restriction = args[:restriction] if args.key?(:restriction)\n @shared = args[:shared] if args.key?(:shared)\n @stop_line = args[:stop_line] if args.key?(:stop_line)\n @surface = args[:surface] if args.key?(:surface)\n @type = args[:type] if args.key?(:type)\n @width = args[:width] if args.key?(:width)\n end",
"def update\n respond_to do |format|\n if @floor_ammenity.update(floor_ammenity_params)\n format.html { redirect_to @floor_ammenity, notice: 'Ammenity was successfully updated.' }\n format.json { render :show, status: :ok, location: @floor_ammenity }\n else\n format.html { render :edit }\n format.json { render json: @floor_ammenity.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @mini_map_road = MiniMapRoad.find(params[:id])\n\n respond_to do |format|\n if @mini_map_road.update_attributes(params[:mini_map_road])\n format.html { redirect_to @mini_map_road, notice: 'Mini map road was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mini_map_road.errors, status: :unprocessable_entity }\n end\n end\n end",
"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",
"def update\n respond_to do |format|\n if @property_sector.update(property_sector_params)\n format.html { redirect_to @property_sector, notice: 'Property sector was successfully updated.' }\n format.json { render :show, status: :ok, location: @property_sector }\n else\n format.html { render :edit }\n format.json { render json: @property_sector.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @arrival_range = ArrivalRange.find(params[:id])\n\n respond_to do |format|\n if @arrival_range.update_attributes(params[:arrival_range])\n format.html { redirect_to @arrival_range, notice: 'Arrival range was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @arrival_range.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.6611928",
"0.64026827",
"0.6253212",
"0.6180711",
"0.59178376",
"0.58830047",
"0.5867793",
"0.581085",
"0.5779907",
"0.57641405",
"0.5741139",
"0.57381433",
"0.56444305",
"0.5617428",
"0.5576063",
"0.5557531",
"0.5538262",
"0.55241364",
"0.551262",
"0.5512446",
"0.5505184",
"0.5502735",
"0.5500453",
"0.5497089",
"0.5496625",
"0.54917157",
"0.5487882",
"0.5485683",
"0.5484792",
"0.5475621"
] | 0.69383144 | 0 |
DELETE /property_between_floor_slaps/1 DELETE /property_between_floor_slaps/1.json | def destroy
@property_between_floor_slap.destroy
respond_to do |format|
format.html { redirect_to property_between_floor_slaps_url, notice: 'Property between floor slap was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @floor_plan.destroy\n respond_to do |format|\n format.html { redirect_to location_path(@location) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @floor = Floor.find(params[:id])\n @floor.destroy\n\n respond_to do |format|\n format.html { redirect_to floors_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @floor.destroy\n respond_to do |format|\n format.html { redirect_to floors_url, notice: I18n.t('floors.destroy') }\n format.json { head :no_content }\n end\n end",
"def destroy\n @location_property = LocationProperty.find(params[:id])\n @location_property.destroy\n\n respond_to do |format|\n format.html { redirect_to location_properties_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @location_granularity.destroy\n respond_to do |format|\n format.html { redirect_to location_granularities_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @spatial_coverages = SpatialCoverages.find(params[:id])\n @spatial_coverages.destroy\n\n respond_to do |format|\n format.html { redirect_to spatial_coverage_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @floor.destroy\n respond_to do |format|\n format.html { redirect_to @floor.building, notice: t('flash.floor.delete') }\n format.json { head :no_content }\n end\n end",
"def destroy\n @property.photos.delete_all\n @property.features_properties.delete_all\n @property.destroy\n respond_to do |format|\n format.html { redirect_to properties_url, notice: 'Property was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @floor_ammenity.destroy\n respond_to do |format|\n format.html { redirect_to floor_ammenities_url, notice: 'Ammenity was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @floor = Floor.find(params[:id])\n @floor.destroy\n\n respond_to do |format|\n format.html { redirect_to(floors_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @medium_road = MediumRoad.find(params[:id])\n @medium_road.destroy\n\n respond_to do |format|\n format.html { redirect_to medium_roads_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @shooting_range = ShootingRange.find(params[:id])\n @shooting_range.destroy\n\n respond_to do |format|\n format.html { redirect_to(shooting_ranges_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @income_loss_house_property.destroy\n respond_to do |format|\n format.html { redirect_to income_loss_house_properties_url, notice: 'Income loss house property was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mostsmallroad = Mostsmallroad.find(params[:id])\n @mostsmallroad.destroy\n\n respond_to do |format|\n format.html { redirect_to mostsmallroads_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @property.destroy\n respond_to do |format|\n format.html { redirect_to runner_home_path, notice: 'Property was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @r_property_definition.destroy\n respond_to do |format|\n format.html { redirect_to r_property_definitions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_property.destroy\n respond_to do |format|\n format.html { redirect_to line_properties_url, notice: 'Line property was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @roadmap_step.destroy\n respond_to do |format|\n format.html { redirect_to roadmap_steps_url, notice: 'Roadmap step was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @horizontal_property.destroy\n respond_to do |format|\n format.html { redirect_to act_path(@act), notice: 'Horizontal property was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mini_map_road = MiniMapRoad.find(params[:id])\n @mini_map_road.destroy\n\n respond_to do |format|\n format.html { redirect_to mini_map_roads_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @area_attribute.destroy\n respond_to do |format|\n format.html { redirect_to area_attributes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @property_closet.destroy\n respond_to do |format|\n format.html { redirect_to property_closets_url, notice: 'Property closet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n #@property = Property.find(params[:id])\n @property.destroy\n\n respond_to do |format|\n format.html { redirect_to properties_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n onesecgroup('delete', resource[:name])\n @property_hash.clear\n end",
"def destroy\n debug('Removing location')\n crm('configure', 'delete', @resource[:name])\n @property_hash.clear\n end",
"def destroy\n @property_detail.destroy\n respond_to do |format|\n format.html { redirect_to property_details_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @floor_stage.destroy\n respond_to do |format|\n format.html { redirect_to floor_stages_url, notice: 'Stage was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ride_level.destroy\n respond_to do |format|\n format.html { redirect_to ride_levels_url, notice: 'Ride level was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @subcellular_location = SubcellularLocation.find(params[:id])\n @subcellular_location.destroy\n\n respond_to do |format|\n format.html { redirect_to subcellular_locations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @property = Property.find(params[:id])\n @property.destroy\n\n head :no_content\n end"
] | [
"0.6767104",
"0.6629417",
"0.65859383",
"0.6548821",
"0.65027034",
"0.6496672",
"0.6478902",
"0.64782614",
"0.6418464",
"0.6389761",
"0.63772845",
"0.63682294",
"0.63654083",
"0.63643336",
"0.6358095",
"0.634887",
"0.6343281",
"0.6322753",
"0.6319015",
"0.63171756",
"0.6308039",
"0.62873155",
"0.62790143",
"0.6263358",
"0.625515",
"0.6240062",
"0.6237045",
"0.62345713",
"0.6210892",
"0.62071127"
] | 0.78118306 | 0 |
Unregisters the webhook with Jive | def unregister_webhook
require "open-uri"
require "net/http"
require "openssl"
return if self.add_on.nil? # Can't do it without a token!
return if self.oauth_token.nil? # Can't do it without a token!
uri = URI.parse("#{self.add_on.jive_url}/api/core/v3/webhooks/#{self.webhook_id}")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(uri.request_uri)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer #{self.oauth_token.access_token}"
response = http.request(request)
# Need 2XX status code
if !response.code.to_i.between?(200, 299)
errors[:base] << "#{request.inspect} => #{response.body}"
return false
end
true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unsubscribe_request_hook(name)\n EasyPost::Hooks.unsubscribe(:request, name)\n end",
"def delete_webhook(target_url)\n Uploadcare::Webhook.delete(target_url)\n end",
"def unsubscribe_response_hook(name)\n EasyPost::Hooks.unsubscribe(:response, name)\n end",
"def unregisterHook\n if !session[:user_id]\n flash[:notice] = \"Need to login first\"\n redirect_to :action=> 'login'\n end\n\n #redirect_to :controller=>\"room\", :action=> 'registerHook' #, :params[:registerHook].url => url, :params[:registerHook].token=>token\n\n begin\n am = session[:am]\n acc = Account.find_by_username(session[:user_id])\n if(acc.nil?)\n flash[:notice] = \"Need to login first\"\n redirect_to :action=> 'login'\n return\n end\n am.keepalive(acc.username, acc.password)\n result = am.unregisterHook()\n flash[:result] = \"unregisterHook result success: \" + result\n redirect_to :action => 'accountManager'\n rescue Exception => msg\n flash[:notice] = msg\n end\n end",
"def destroy\n @webhook_endpoint.destroy\n respond_to do |format|\n format.html { redirect_to webhook_endpoints_url, notice: 'Webhook endpoint was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def unsubscribe_all_request_hooks\n EasyPost::Hooks.unsubscribe_all(:request)\n end",
"def destroy\n @bitpay_webhook.destroy\n respond_to do |format|\n format.html { redirect_to bitpay_webhooks_url, notice: 'Bitpay webhook was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @m_webhook.destroy\n respond_to do |format|\n format.html { redirect_to m_webhooks_url, notice: 'M webhook was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def unsubscribe\n unregister\n end",
"def unregister_stripe_webhook_if_necessary\n return unless previous_changes.include?(:stripe_secret_key)\n\n # secret key was changed\n\n # if we HAD a secret key\n if previous_changes[:stripe_secret_key][0].present?\n domain = default_url_options[:host]\n manager = StripeWebhook::Manager.new(previous_changes[:stripe_secret_key][0], domain)\n manager.unregister_callback\n end\n end",
"def unregister\n user_to_be_removed = @event.users.find(current_user)\n if user_to_be_removed\n @event.users.delete(user_to_be_removed)\n end\n #flash[:notice] = \"Unregistered for #{@event.title}\"\n respond_to do |format|\n format.js\n end\n end",
"def deregister_inbound_handler(handler)\n\t\t@inbound_handlers.delete(handler)\n\tend",
"def unregister\n client.post('/v1/push/deregister', body: {\n uuid: user_id, device_id: id, push_type: type\n })\n end",
"def delete_webhook(id)\n make_json_api_request :delete, \"v2/#{account_id}/webhooks/#{id}\"\n end",
"def un_register\n unless @unregistered\n @unregistered = true\n RightLinkLog.info(\"SEND [un_register]\")\n @amq.fanout('registration', :no_declare => @options[:secure]).publish(@serializer.dump(UnRegister.new(@identity)))\n end\n true\n end",
"def unsubscribe_all_response_hooks\n EasyPost::Hooks.unsubscribe_all(:response)\n end",
"def unregister\n puts \"APN::Device.unregister\"\n http_delete(\"/api/device_tokens/#{self.token}\")\n end",
"def app_uninstalled\n puts(\"yolo\")\n # data = request.body.read\n # # env[\"HTTP_X_SHOPIFY_HMAC_SHA256\"]\n # puts(\"Putsing REQUESTXXXXX\")\n # verified = verify_webhook(data, ENV[\"HTTP_X_SHOPIFY_HMAC_SHA256\"])\n json_obj = request.params.to_json\n # other_obj = request.to_json\n\n # puts(\"inspect\")\n # puts(params.inspect)\n\n puts(\"about to put the request params:\")\n # puts(json_obj)\n # puts(other_obj)\n\n if hmac_valid?(request.raw_post)\n puts(\"Valid hmac!!!\")\n puts(\"Valid hmac!!!2\")\n shop_domain = params['uninstall']['myshopify_domain']\n\n uninstall_call({\"shop_domain\" => shop_domain})\n\n return \"Complete\"\n else\n puts(\"not valid\")\n return head :unauthorized\n end\n end",
"def unsubscribe()\n end",
"def delete(id)\n Mailgun.submit :delete, webhook_url(id)\n end",
"def remove(domain, action)\n fail Mailgun::ParameterError('Domain not provided to remove webhook from') unless domain\n fail Mailgun::ParameterError('Action not provided to identify webhook to remove') unless action\n @client.delete(\"domains/#{domain}/webhooks/#{action}\").to_h['message'] == 'Webhook has been deleted'\n rescue Mailgun::CommunicationError\n false\n end",
"def user_cleaned_hook(hook_data)\n unsubscribe_hook(hook_data)\n end",
"def unregister_middleware(key); end",
"def unregister\n @is_registered = false\n self\n end",
"def destroy_omniauth\n return redirect_to root_url unless is_admin\n\n shop_name = current_organization.oauth_uid\n token = current_organization.oauth_token\n current_organization.clear_omniauth\n Shopify::Webhooks::WebhooksManager.queue_destroy_webhooks(current_organization.uid, shop_name, token) unless shop_name.blank? || current_organization.uid.blank? || token.blank?\n\n redirect_to root_url\n end",
"def on_twitter_engine_unregister_user(e, who)\n pre = '<Twitter::Engine>'\n @log.info(\"#{pre} Unregistering user: #{who} (xmpp).\")\n end",
"def delete_webhook\n # find the next sprint using that webhook, and recreate webhook in that sprint.user's name\n # delete webhook if no other sprint is using that webhook\n if webhook\n webhook.sprints.count > 1 ? webhook.sprints.where.not(user: user)[0].post_webhook : webhook.destroy\n end\n user.delete_wh_by_sprint(self)\n end",
"def unsubscribe; end",
"def unsubscribe\n end",
"def destroy\n @registration_request.destroy\n\n head :no_content\n end"
] | [
"0.6840325",
"0.6647022",
"0.64943475",
"0.64802325",
"0.6425156",
"0.6414358",
"0.64120054",
"0.64065605",
"0.63679594",
"0.6276741",
"0.62552524",
"0.62387514",
"0.623862",
"0.62308806",
"0.61917335",
"0.6186117",
"0.6183866",
"0.6099072",
"0.60828346",
"0.6080911",
"0.60728943",
"0.6064133",
"0.6033521",
"0.60170585",
"0.60161984",
"0.59966135",
"0.5994762",
"0.5983008",
"0.5964398",
"0.5954033"
] | 0.7900918 | 0 |
Registers the webhook with Jive | def register_webhook
require "open-uri"
require "net/http"
require "openssl"
uri = URI.parse("#{self.add_on.jive_url}/api/core/v3/webhooks")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
#http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(uri.request_uri)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer #{self.oauth_token.access_token}"
body = {
"callback" => self.callback,
"object" => self.object,
}
body["events"] = self.events if !self.events.to_s.empty?
request.body = body.to_json
response = http.request(request)
# Need 2XX status code
if !response.code.to_i.between?(200, 299)
errors[:base] << "#{request.inspect} => #{response.body}"
return false
end
json_body = JSON.parse(response.body)
self.webhook_id = json_body["id"]
true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_webhook(project_id_or_key, name, hook_url, params = {})\n params[:name] = name\n params[:hook_url] = hook_url\n post(\"projects/#{project_id_or_key}/webhooks\", params)\n end",
"def webhook\n @config = ZipMoney::Configuration \n @_webhook = ZipMoney::WebHook if @_webhook.nil?\n @_webhook\n end",
"def post_webhook\n HTTParty.post(\n \"https://api.trello.com/1/tokens/#{user.token}/webhooks/?key=#{ENV['TRELLO_KEY']}\",\n query: {\n description: \"Sprint webhook user#{user.id}\",\n callbackURL: \"#{ENV['BASE_URL']}webhooks\",\n idModel: trello_ext_id\n },\n headers: { \"Content-Type\" => \"application/json\" }\n )\n end",
"def webhooks\n @webhooks ||= WebhookRegistry.new\n end",
"def initialize webhook\n @nfe_webhook = @nfe_account.nfe_webhook\n @webhook = webhook\n \n response = update\n end",
"def create\n Webhook.log(params)\n \n render text: \"\\nhello chargify\\n\\n\", layout: false, status: 200, :content_type => 'application/xml'\n\n # respond_to do |format|\n # if @webhook.save\n # format.html { redirect_to @webhook, notice: 'Webhook was successfully created.' }\n # format.json { render json: @webhook, status: :created, location: @webhook }\n # else\n # format.html { render action: \"new\" }\n # format.json { render json: @webhook.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"def webhook\r\n WebhookController.instance\r\n end",
"def create_hook!\n hook = client.create_hook(\n full_name,\n 'web',\n {\n url: Constants::HOOK_URL,\n content_type: 'json'\n },\n {\n events: ['release'],\n active: true\n }\n )\n\n self.github_hook_id = hook.id\n end",
"def send_webhook!(tag)\n response = Net::HTTP.post(\n URI(\"https://webhook.site/b069a239-60dd-47ec-9dba-1f4295639a8d\"),\n { tag: tag.name }.to_json,\n \"Content-Type\": \"application/json\"\n )\n\n raise WebhookError unless response.is_a?(Net::HTTPSuccess)\n end",
"def webhook(request)\n WebHook.new(request, self)\n end",
"def register_webhook!(trigger, name, url)\n trigger = trigger.to_s.camelize(:lower).to_sym\n raise ArgumentError, \"Invalid hook trigger #{trigger}\" unless ALLOWED_HOOKS.include?(trigger)\n if trigger == :function\n response = client.fetch_function(name)\n # if it is either an error (which has no results) or there is a result but\n # no registered item with a URL (which implies either none registered or only cloud code registered)\n # then create it.\n if response.results.none? { |d| d.has_key?(\"url\") }\n response = client.create_function(name, url)\n else\n # update it\n response = client.update_function(name, url)\n end\n warn \"Webhook Registration warning: #{response.result[\"warning\"]}\" if response.result.has_key?(\"warning\")\n warn \"Failed to register Cloud function #{name} with #{url}\" if response.error?\n return response\n else # must be trigger\n response = client.fetch_trigger(trigger, name)\n # if it is either an error (which has no results) or there is a result but\n # no registered item with a URL (which implies either none registered or only cloud code registered)\n # then create it.\n if response.results.none? { |d| d.has_key?(\"url\") }\n # create it\n response = client.create_trigger(trigger, name, url)\n else\n # update it\n response = client.update_trigger(trigger, name, url)\n end\n\n warn \"Webhook Registration warning: #{response.result[\"warning\"]}\" if response.result.has_key?(\"warning\")\n warn \"Webhook Registration error: #{response.error}\" if response.error?\n return response\n end\n end",
"def create_webhook(post_url, include_received_email, events)\n include_received_email = include_received_email ? true : false\n url = \"v2/#{account_id}/webhooks\"\n\n make_json_api_request :post, url, private_generate_resource(\n \"webhooks\",\n {\n \"post_url\" => post_url,\n \"include_received_email\" => include_received_email,\n \"events\" => events\n }\n )\n end",
"def webhook\n\t\tpayload = {event: params, company_id: params[:company_id]}\n\t\tBraintree::WebhookService.new.instrument(payload)\n\t\thead :ok\n\t# rescue StandardError\n\t\t# head :unauthorized\n\tend",
"def create\n @m_webhook = MWebhook.new(m_webhook_params)\n\n respond_to do |format|\n if @m_webhook.save\n format.html { redirect_to @m_webhook, notice: 'M webhook was successfully created.' }\n format.json { render :show, status: :created, location: @m_webhook }\n else\n format.html { render :new }\n format.json { render json: @m_webhook.errors, status: :unprocessable_entity }\n end\n end\n end",
"def on(webhook, &block)\n webhooks.on(webhook, &block)\n end",
"def send_incoming_webhook(key, feature, channel_id)\n payload = $redis.get(\"payload:#{key}\")\n if payload.nil?\n payload = {\n :text => \"\"\n }\n attachments = []\n attachments << build_attachment(key, feature)\n payload[:attachments] = attachments\n $redis.setex(\"payload:#{key}\", 60*60*24, payload.to_json)\n else\n payload = JSON.parse(payload)\n end\n payload[:channel] = channel_id\n HTTParty.post(ENV[\"INCOMING_WEBHOOK_URL\"], :body => payload.to_json)\nend",
"def create\n @webhook_endpoint = WebhookEndpoint.new(webhook_endpoint_params)\n\n respond_to do |format|\n if @webhook_endpoint.save\n format.html { redirect_to @webhook_endpoint, notice: 'Webhook endpoint was successfully created.' }\n format.json { render :show, status: :created, location: @webhook_endpoint }\n else\n format.html { render :new }\n format.json { render json: @webhook_endpoint.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\tStripe::WebhookService.new.instrument(params)\n\t\thead :ok\n\t# rescue StandardError\n\t\t# head :unauthorized\n\tend",
"def create_webhook(channel_id, name: :undef, avatar: :undef)\n avatar_data = if avatar != :undef && !avatar.nil?\n \"data:#{avatar.content_type};base64,#{Base64.encode64(avatar.io.read)}\"\n else\n :undef\n end\n json = filter_undef({ name: name, avatar: avatar_data })\n route = Route.new(:POST, '/channels/%{channel_id}/webhooks', channel_id: channel_id)\n request(route, json: json)\n end",
"def add_hook(url)\n post(\"/hooks\", :body => {:url => url})\n end",
"def set_webhook\n @webhook = Webhook.find(params[:id])\n end",
"def set_webhook\n @webhook = Webhook.find(params[:id])\n end",
"def create(domain, action, url = '')\n res = @client.post(\"domains/#{domain}/webhooks\", id: action, url: url)\n res.to_h['webhook']['url'] == url && res.to_h['message'] == 'Webhook has been created'\n end",
"def create\n if !valid_signatures?\n render json: { message: \"Invalid sigs\" }, status: 400\n return\n end\n #idempotent\n if !WebhookEvent.find_by(source: params[:source], external_id: external_id).nil?\n render json: { message: \"Already processed #{ external_id }\"}\n return\n end\n\n event = WebhookEvent.create(webhook_params)\n ProcessEventsJob.perform_later(event.id) \n render json: params\n end",
"def webhook url\n @webhook_uri = url\n end",
"def send_webhook\n config = Rails.application.config_for(:webhooks)\n\n return unless config.webhooks\n\n config.webhooks.each do |_k, webhook|\n next if webhook.nil?\n\n url = URI(webhook)\n headers = { 'content-type' => 'application/json' }\n payload = {\n 'job_id' => id,\n 'job_type' => kind,\n 'status' => status,\n 'results' => results.count\n }.to_json\n res = Net::HTTP.post(URI(url), payload, headers)\n\n res.code\n end\n end",
"def create_webhook(target_url, event: 'file.uploaded', is_active: true, signing_secret: nil)\n options = { target_url: target_url, event: event, is_active: is_active, signing_secret: signing_secret }\n Uploadcare::Webhook.create(**options.compact)\n end",
"def create_webhook(access_token:, events:)\n client(token: access_token).post(\n 'v1/webhooks',\n {\n url: \"#{ENV['APP_URL']}/webhooks\",\n events: events\n }.to_json\n )\n end",
"def create\n @hook = Hook.new(params[:hook])\n @hook.save\n respond_with(@hook)\n end",
"def create(id, url=default_webhook_url)\n params = {:id => id, :url => url}\n Mailgun.submit :post, webhook_url, params\n end"
] | [
"0.6617718",
"0.656444",
"0.65150595",
"0.64781016",
"0.64551556",
"0.6398318",
"0.63663626",
"0.63569754",
"0.63287765",
"0.63153994",
"0.6296852",
"0.6244124",
"0.62091345",
"0.61630535",
"0.6134478",
"0.61271334",
"0.6125525",
"0.6123998",
"0.6104226",
"0.6083307",
"0.60763174",
"0.60763174",
"0.6062172",
"0.606017",
"0.6048484",
"0.60398114",
"0.6007024",
"0.5992883",
"0.5989739",
"0.59872854"
] | 0.8315143 | 0 |
Refresh one feed source and return the updated feed items | def refresh
FeedSource.find(params[:feed_source_id]).refresh
feed_sources = params[:feed_sources]
@feed_source_titles = {}
FeedSource.find(feed_sources).each { |source| @feed_source_titles[source.id] = source.title}
@feed_items = FeedItem.where("feed_source_id IN (?)", feed_sources).order(pub_date: :desc).limit(20).offset(0)
@feed_items = @feed_items.sort_by{ |item| item.pub_date.to_i }.reverse
render :index
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def refresh_feed(feed)\n FeedRefreshManager.refresh feed, self\n end",
"def refresh\n Feed.update_all\n # @feeds = Feed.all\n # feed_array = []\n # @feeds.each do |f|\n # EntryFeed.create_from_feed(f)\n # end\n\n redirect_to blogs_path\n flash[:notice] = \"Blogs successfully updated\"\n end",
"def feed_items(feed_title) \n # update last_viewed_at \n @client.query \"UPDATE feeds SET last_viewed_at = now() where title = '#{e feed_title}'\"\n query = \"SELECT items.title, guid, feed, feed_title, pub_date, word_count, starred, unread from items where items.feed_title = '#{e feed_title}' order by pub_date asc\"\n @client.query(query)\n end",
"def refresh\n # FIXME\n end",
"def update\n @feed = current_user.feeds.find params[:id]\n current_user.refresh_feed @feed\n\n head :ok\n rescue => e\n handle_error e\n end",
"def refresh\n fetch_api_data\n self\n end",
"def feed!\n http_fetch(feed_url)\n end",
"def update_from_feed(auth_feed=nil)\n # If there are existing entries, then create a feed \n # object using the most recent entry's data and use Feedzirra's update method\n # to only fetch those new entries\n if entries.any?\n feed = Feedzirra::Feed.update(create_feed_for_update)\n add_entries(feed.new_entries) if valid_parse_result(feed) && !feed.is_a?(Array) && feed.updated?\n else\n # Fetch whole feed (may not be entire feed - depends on source)\n feed = auth_feed || Feedzirra::Feed.fetch_and_parse(feed_url_s)\n # Can return error status code on parse error\n add_entries(feed.entries) if valid_parse_result(feed)\n end\n # Save latest feed attributes for updates\n if valid_parse_result(feed)\n update_attributes(:etag => feed.etag, :last_modified => feed.last_modified, :feed_url_s => feed.feed_url)\n end\n end",
"def refresh(force=false)\n # check headers and etag and last modified\n raise \"Missing feed_url\" if feed_url.nil?\n ff = Feedbase::FetchFeed.new(feed_url)\n headers = ff.headers\n if !force \n if last_etag && (headers[:etag] == last_etag)\n puts \"-- #{feed_url} -- ETag cache hit\"\n return\n end\n end\n data = ff.fetch \n params = data[:feed_params].merge(:alpha_title => make_alpha_title(data[:feed_params][:title])) \n if params[:feed_url] != self[:feed_url]\n if x = self.class.filter(:feed_url => params[:feed_url]).first\n raise Redirected.new(\"Redirected to existing feed: #{x.feed_url}\")\n end\n end\n params.delete(:feed_url) \n begin Sequel::DatabaseError\n update params\n rescue StandardError # PGError\n puts \"The offending record is #{self.inspect}\"\n raise\n end\n\n Feedbase::FeedDownload.create({feed_id: feed_id}.merge(data[:download_params])) \n items_created = data[:items].\n select {|item| Feedbase::Item[:guid => item[:guid]].nil?}.\n map { |item|\n params = {\n feed_id: feed_id,\n title: item[:title].encode(\"utf-8\"), \n guid: item[:guid], \n link: item[:link],\n content: item[:content],\n author: item[:author],\n word_count: item[:word_count],\n pub_date: item[:pub_date]\n }\n Feedbase::Item.create params\n }\n # caller can extract an item count from this\n items_created\n end",
"def update_from_feed()\n\t\t\n\t@links = Link.all \n\n\t@links.each do |link| \n\n\t\tfeed = Feedzirra::Feed.fetch_and_parse(link.url)\n\n\t\tputs \"pulling feeds\"\n\t\tfeed.entries.each do |entry|\n\n\t\t\tif entry.published > link.updated_at\n\n\t\t\t\tif entry.url =~ /^#{URI::regexp}$/\n\t\t\t\t\tfind_keywords(entry.url, link.tags)\n\t\t\t\t\tputs entry.url\t\n\t\t\t\telse\n\t\t\t\t\tputs \"bad url\"\n\t\t\t\t\tputs entry.url\t\n\t\t\t\tend\n\t\t\t\t\t\n\t\t\tend\n\t\tend\n\n\tend\n\nend",
"def refresh\n load if changed?\n end",
"def refresh\n do_refresh\n end",
"def refresh\n do_refresh\n end",
"def refresh\n response = Clever.request :get, url\n refresh_from response[:data]\n self\n end",
"def update!\n raise(RuntimeError, \"can't fetch without a uri.\") unless @uri\n\n res = @http.get(@uri, \"Accept\" => \"application/atom+xml\")\n\n if @etag and res['etag'] == @etag\n # we're already all up to date\n return self\n elsif res.code == \"410\"\n raise Atom::FeedGone, \"410 Gone (#{@uri})\"\n elsif res.code != \"200\"\n raise Atom::HTTPException, \"Unexpected HTTP response code: #{res.code}\"\n end\n\n # we'll be forgiving about feed content types.\n res.validate_content_type([\"application/atom+xml\",\n \"application/xml\",\n \"text/xml\"])\n\n @etag = res[\"ETag\"] if res[\"ETag\"]\n\n xml = res.body\n\n coll = REXML::Document.new(xml)\n\n update_el = REXML::XPath.first(coll, \"/atom:feed/atom:updated\", { \"atom\" => Atom::NS } )\n\n # the feed hasn't been updated, don't do anything.\n if update_el and self.updated and self.updated >= Time.parse(update_el.text)\n return self\n end\n\n coll = self.class.parse(coll.root, self.base.to_s)\n merge! coll\n\n if abs_uri = next_link\n @next = self.class.new(abs_uri.to_s, @http)\n end\n\n if abs_uri = previous_link\n @prev = self.class.new(abs_uri.to_s, @http)\n end\n\n self\n end",
"def update!\n # Don't do anything if this option is set\n return if self.configurations[:disable_update_from_remote]\n\n if !FeedTools.feed_cache.nil? &&\n !FeedTools.feed_cache.set_up_correctly?\n FeedTools.feed_cache.initialize_cache()\n end\n if !FeedTools.feed_cache.nil? &&\n !FeedTools.feed_cache.set_up_correctly?\n raise \"Your feed cache system is incorrectly set up. \" +\n \"Please see the documentation for more information.\"\n end\n if self.http_headers.blank? && !(self.cache_object.nil?) &&\n !(self.cache_object.http_headers.nil?)\n @http_headers = YAML.load(self.cache_object.http_headers)\n @http_headers = {} unless @http_headers.kind_of? Hash\n elsif self.http_headers.blank?\n @http_headers = {}\n end\n if self.expired? == false\n @live = false\n else\n load_remote_feed!\n \n # Handle autodiscovery\n if self.http_headers['content-type'] =~ /text\\/html/ ||\n self.http_headers['content-type'] =~ /application\\/xhtml\\+xml/\n\n autodiscovered_url = nil\n ['atom', 'rss', 'rdf'].each do |type|\n autodiscovered_url =\n FeedTools::HtmlHelper.extract_link_by_mime_type(self.feed_data,\n \"application/#{type}+xml\")\n break unless autodiscovered_url.nil?\n end\n \n if autodiscovered_url != nil\n begin\n autodiscovered_url = FeedTools::UriHelper.resolve_relative_uri(\n autodiscovered_url, [self.href])\n rescue Exception\n end\n if self.href == autodiscovered_url\n raise FeedAccessError,\n \"Autodiscovery loop detected: #{autodiscovered_url}\"\n end\n self.feed_data = nil\n \n self.href = autodiscovered_url\n if FeedTools.feed_cache.nil?\n self.cache_object = nil\n else\n self.cache_object =\n FeedTools.feed_cache.find_by_href(autodiscovered_url)\n end\n self.update!\n else\n html_body = FeedTools::XmlHelper.try_xpaths(self.xml_document, [\n \"html/body\"\n ])\n if html_body != nil\n raise FeedAccessError,\n \"#{self.href} does not appear to be a feed.\"\n end\n end\n else\n ugly_redirect = FeedTools::XmlHelper.try_xpaths(self.xml_document, [\n \"redirect/newLocation/text()\"\n ], :select_result_value => true)\n if !ugly_redirect.blank?\n if self.href == ugly_redirect\n raise FeedAccessError,\n \"Ugly redirect loop detected: #{ugly_redirect}\"\n end\n self.feed_data = nil\n self.href = ugly_redirect\n if FeedTools.feed_cache.nil?\n self.cache_object = nil\n else\n self.cache_object =\n FeedTools.feed_cache.find_by_href(ugly_redirect)\n end\n self.update!\n end\n end\n \n # Reset everything that needs to be reset.\n @xml_document = nil\n @encoding_from_feed_data = nil\n @root_node = nil\n @channel_node = nil\n @id = nil\n @title = nil\n @subtitle = nil\n @copyright = nil\n @link = nil\n @time_to_live = nil\n @entries = nil\n \n if self.configurations[:lazy_parsing_enabled] == false\n self.full_parse()\n end\n end\n end",
"def refresh\n response = Clever.request :get, url, nil, headers\n refresh_from response[:data]\n\n @links = response[:links].map do\n |link| { :\"#{link[:rel]}\" => link[:uri] }\n end.reduce({}, :merge)\n self\n end",
"def reload\n reset\n fetch\n end",
"def reload\n reset\n fetch\n end",
"def cache_feeds\n puts \"Caching feeds... (can be slow)\"\n feeds = Conf.feeds.map do |uri|\n # silly to need this, but if the feed fails to fetch,\n # don't kill the ruby thread ...\n begin\n feed = FeedTools::Feed.open( uri )\n { :uri => uri, :title => feed.title, \n :items => feed.items.map { |item| { :title => item.title, :author => item.author.name, :published => item.published, :link => item.link } } }\n rescue FeedTools::FeedAccessError\n puts uri\n next\n end\n end\n feeds.each { |feed|\n new = CachedFeed.find_or_initialize_by_uri( feed[:uri] )\n new.parsed_feed = feed\n new.save!\n }\n end",
"def feed\n @feeddata\n end",
"def refresh\n do_refresh\n self\n end",
"def refresh\n @data = read_data\n end",
"def refresh \n @result, @processedMovies, @errors = Movie.refresh_listings\n end",
"def reload\n resp = api_client.get(url)\n refresh(JSON.load(resp.body))\n end",
"def refresh\n end",
"def update_from_feed(feed_url)\n\t\tputs \"pulling feeds\"\n\t\tfeed = Feedzirra::Feed.fetch_and_parse(feed_url)\n\t\t# feed.last_modified - if it's been modified since last time\n\t\tfeed.entries.each do |entry|\n\t\t\t# if the post occured after it was last checked\n\t\t\tfind_keywords(entry.url)\n\t\t\tputs entry.url\n\t\t\t# call the keyword check and save on the actual post url\t\n\t\tend\nend",
"def index\n @feed_sources = FeedSource.all\n end",
"def refresh_all\n success_count = 0\n error_count = 0\n Topic.find_all_external.each do |topic|\n permalink = topic.permalink\n begin\n refresh_topic(topic)\n success_count += 1\n rescue\n log.error \"Error refreshing news for '#{permalink}': #{$!}\"\n error_count += 1\n end\n end #each\n if error_count > 0\n STDERR.puts \"*** #{error_count} errors occurred while refreshing \" +\n \"the news data.\"\n STDERR.puts \"See the intranet log for details.\"\n end #if\n log.info \"#{success_count} news topics were updated successfully.\"\n end",
"def refresh!\n load if changed?\n end"
] | [
"0.73419046",
"0.6547046",
"0.6506305",
"0.6465421",
"0.64161277",
"0.6409836",
"0.6389569",
"0.6370014",
"0.63508123",
"0.63415533",
"0.6319646",
"0.6308639",
"0.6308639",
"0.6303377",
"0.62841046",
"0.62739736",
"0.6230807",
"0.6220272",
"0.6220272",
"0.6210587",
"0.61971664",
"0.6152941",
"0.615167",
"0.61497784",
"0.61359155",
"0.6120495",
"0.61023414",
"0.60840863",
"0.60592896",
"0.60578537"
] | 0.82401633 | 0 |
Store page title options that are used on I18n interpolation. | def page_title_options
@page_title_options ||= {}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def title=(t)\n @options[:title] = t\n end",
"def page_title(options = {})\n return \"\" if @page.title.blank?\n\n options = {\n prefix: \"\",\n suffix: \"\",\n separator: \"\"\n }.update(options)\n title_parts = [options[:prefix]]\n title_parts << if response.status == 200\n @page.title\n else\n response.status\n end\n title_parts << options[:suffix]\n title_parts.reject(&:blank?).join(options[:separator]).html_safe\n end",
"def title\n options.fetch(:title)\n end",
"def render_page_title options={}\n default_options = {\n :prefix => \"\",\n :seperator => \"|\"\n }\n default_options.update(options)\n unless current_page.title.blank?\n h(\"#{default_options[:prefix]} #{default_options[:seperator]} #{current_page.title}\")\n else\n h(\"\")\n end\n end",
"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",
"def page_title!(title)\n @_page_title = title\n end",
"def set_page_title(title)\n @page_title = title\n end",
"def title\n return @options[:title]\n end",
"def page_title(value = nil, default: true, **opt)\n @page_title = nil if opt.present?\n @page_title = page_value(value, **opt) if value\n @page_title ||= page_value(:title, **opt, default: default)\n end",
"def page_title\n @page_title ||= format_string(page[\"title\"]) || site_title\n end",
"def set_page_title(title, opts={})\n @page_title = title\n @page_title_override = title if opts[:override]\n @_no_auto_title = true if opts[:no_auto_title]\n end",
"def set_titles\n DynamicUrl.all.each do |url|\n if request.host == url.url\n @title = url.title\n @subtitle = url.subtitle\n end\n end\n\n # set default title if title could not be fetched\n @title ||= MySettings.title\n @subtitle ||= MySettings.subtitle\n end",
"def title(page_title)\n content_for(:title) do\n \"#{page_title} - #{MySettings.company_full_name}\"\n end\n end",
"def set_page_title(title)\n\t\t@page_title = @current_action.titleize + title\n\tend",
"def title(page_title, show_title: true)\n content_for(:title) { h(page_title.to_s) }\n @show_title = show_title\n end",
"def page_title(title=nil)\n # DEPRECATED: setting title\n if title\n page_title!(title)\n else\n @_page_title\n end\n end",
"def title(value = nil)\n value ? options[:title] = value : options[:title]\n end",
"def title=(title)\n title = nil unless title.present?\n settings.title = title\n end",
"def page_title\n @page_title || TaliaCore::SITE_NAME\n end",
"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",
"def title(page_title, show_title = true)\n content_for(:title) { h(page_title.to_s) }\n @show_title = show_title\n end",
"def page_title=(title)\n @content_for_page_title = title\n end",
"def set_page_title(hash, order = nil, type = :title)\n @page_title = page_meta_string_builder(type, hash, order)\n end",
"def title(title, global=true)\n global ? (before << \"Backend.app.setTitle(#{title.to_json});\") : config[:title] = title\n end",
"def title\n @title ||= Utilities.longest_common_substring_in_array(titles.values) \n @title = titles[:og_title] unless title_ok?\n @title = titles[:html_title] unless title_ok?\n @title = titles[:from_doc] unless title_ok?\n\n @title\n end",
"def page_meta_title(value = nil, default: true, **opt)\n @page_meta_title = nil if opt.present?\n @page_meta_title = page_value(value, **opt) if value\n @page_meta_title ||= page_value(:label, **opt, default: default)\n end",
"def title(page_title)\n\t\t\tmode = \"[DEV] \" unless ::Rails.env.production?\n\t\t\tcontent_for(:title) { mode.to_s + page_title + \" | \" }\n\t\tend",
"def title_help \n\n\t\t#Define general page title\n\t\tbase_title = \"Rex Ruby on Rails Learning | PagesHelper\"\n\t\tif(@title.nil?)\n\t\t\tbase_title\n\t\telse\n\t\t\tbase_title = \"Rex Ruby on Rails Learning | #{@title} | PagesHelper\"\n\t\tend\n\tend",
"def page_title\n title = \"Amplify\"\n title.prepend(\"#{@page_title} | \") if @page_title\n title\n end",
"def title=(title)\n title = nil if title.blank?\n @settings.title = title\n end"
] | [
"0.731271",
"0.73069143",
"0.7233398",
"0.72106487",
"0.716158",
"0.7127059",
"0.709165",
"0.7079146",
"0.7051273",
"0.7026661",
"0.69825894",
"0.6956374",
"0.68932176",
"0.6877517",
"0.68723416",
"0.6852441",
"0.68501896",
"0.68482125",
"0.6831096",
"0.67903167",
"0.6788046",
"0.6786792",
"0.67839396",
"0.6774203",
"0.67703056",
"0.67603725",
"0.6753015",
"0.6752929",
"0.6743295",
"0.6729598"
] | 0.84882396 | 0 |
Override in the subclass to provide a place to do initialization of game logic, load files, set up state, etc | def game_setup
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize()\n @tileset = Gosu::Image.load_tiles(\"media/tileset.png\", TILE_WIDTH, TILE_HEIGHT, tileable: true)\n\n # Load images here so they will only be loaded once per game\n @enemyAnimation = *Gosu::Image.load_tiles(\"media/enemy_char.png\", Enemy::WIDTH, Enemy::HEIGHT)\n @portalAnimation = *Gosu::Image.load_tiles(\"media/portal.png\", Portal::WIDTH, Portal::HEIGHT)\n @diamondImg = Gosu::Image.new(\"media/diamond.png\")\n\n # Load all the stages in to an array\n @stages = Dir.glob('stages/*').select { |e| File.file? e }\n @finalStage = false\n end",
"def initialize(*args)\n super\n @game = Game.new\n\n @changelog = self.load_changelog\n\n @mods = config[:mods]\n @channel_name = config[:channel]\n @settings_file = config[:settings]\n @games_dir = config[:games_dir]\n\n @idle_timer_length = config[:allowed_idle]\n @invite_timer_length = config[:invite_reset]\n\n @idle_timer = self.start_idle_timer\n\n @game_timer_minutes = nil\n @game_timer = nil\n end",
"def initialize\n\t \t# loading or not loading should be the key here.\n end",
"def initialize()\n original_dir = Dir.pwd\n Dir.chdir(__dir__)\n\n classes_before = ObjectSpace.each_object(Class).to_a\n Dir[\"../model/game/*\"].each {|file|\n require_relative file\n }\n Dir.chdir(original_dir)\n\n classes_after = ObjectSpace.each_object(Class).to_a\n @modes_loaded = classes_after - classes_before\n\n @game_started = false\n @observer_views = []\n @players = []\n @clients_players = Hash.new\n @board = nil\n @clients_board = nil\n @player_playing = nil\n @clients_player_playing_index = nil\n @AI_players = 0\n # http://docs.ruby-lang.org/en/2.0.0/Hash.html\n @game_history = Hash.new(-1)\n @turn = 1\n @online_mode = false\n @player_name = nil\n @player_id = 1\n @save_requests_received = Hash.new(0)\n @turn_which_save_was_requested = -1\n @continuing_game = false\n end",
"def initialise(loadfile)\n\n # Initialise steps\n\n phases = Phases.new\n $commands = Commands.new\n \n if $testing == 1\n require_relative 'Testing.rb'\n require_relative '../Extra/Parser.rb'\n end\n \n if $debugplay == 1\n $debug.debugplay\n end\n \n # Initialise graphics if graphics mode is on\n #if $graphics == 1\n #require 'RMagick'\n require_relative '../Graphics/GraphicsHandler.rb'\n #graphicsinit\n #end\n \n #system(\"unzip ../Resources/Images.zip\")\n \n \n # Load game\n if $loadgame == true\n loadgame(loadfile)\n end\n \n # Set command authentication levels\n IO.foreach(\"cards.txt\") { |line| puts line }\n \nend",
"def initialize_game\n setup_boards\n end",
"def start\n DataManager.create_game_objects\n $game_party.setup_starting_members\n $game_map.setup(Config::Starting_Map_ID)\n $game_player.moveto(Config::X_Pos, Config::Y_Pos)\n $game_player.followers.visible = false\n $game_player.refresh\n $game_player.make_encounter_count\n\n @character_name = $game_player.character_name\n @character_index = $game_player.character_index\n $game_player.set_graphic('', 0)\n\n $game_system.menu_disabled = true\n Graphics.frame_count = 0\n\n super\n create_foreground\n create_background\n create_command_window\n play_title_music\n end",
"def initialize \n # Keep track of hooks and what object owns what\n @hooks = {}\n @cmds = {}\n @modules = {}\n\n # Prevent access to hooks when other things are\n # editing or using them.\n @hooks_mutex = Mutex.new\n end",
"def initialize \n super(ScreenWidth, ScreenHeight, false)\n self.caption = \"Mad Pokemon\"\n $window = self\n\n @@images = Hash.new\n @@fonts = Hash.new \n load_images\n load_fonts\n\n @@fading_off = false\n @@fading_on = false\n @@end_fade = 0\n @@start_fade = 0\n\n @@change_game_state = nil\n\n @@game_state = MenuState.new\n end",
"def on_init; end",
"def on_init; end",
"def initialize\n Game.engine.draw(Game.engine.markdown.parse('# Bandit Mayhem'))\n selection = Game.engine.prompt.select('Select an option', 'New game', 'Load game', 'Quit')\n\n case selection\n when 'New game'\n save_name = Game.engine.prompt.ask('Enter save name:', default: 'bandit-mayhem')\n\n Game.player = Player.new(name: 'Nigel', health: 30, x: 1, y: 5, map: BanditMayhem::Map::Map.new('lynwood/strick_household'))\n\n # intro\n Cinematic.new('intro').play\n\n @quit = false\n when 'Load game'\n Game.load_save if File.exist?(DEFAULT_SAVE)\n # TODO fix\n # Game.player = Player.new(name: 'Nigel', health: 30, x: 1, y: 5, map: BanditMayhem::Map::Map.new('lynwood/strick_household'))\n @quit = false\n when 'Quit'\n @quit = true\n end\n end",
"def post_init\n end",
"def load_game\n require './game/setup.rb'\n end",
"def initialize(parent_wnd)\r\n super(parent_wnd)\r\n \r\n @core_game = nil\r\n @splash_name = File.join(@resource_path, \"icons/mariazza_title_trasp.png\")\r\n @algorithm_name = \"AlgCpuMariazza\" \r\n #core game name (created on base class)\r\n @core_name_class = 'CoreGameMariazza'\r\n \r\n # game commands\r\n @game_cmd_bt_list = []\r\n\r\n ## NOTE: don't forget to initialize variables also in ntfy_base_gui_start_new_game\r\n end",
"def initialize\n @imgs = {}\n @global_imgs = {}\n @tilesets = {}\n @global_tilesets = {}\n @sounds = {}\n @global_sounds = {}\n @songs = {}\n @global_songs = {}\n @fonts = {}\n @global_fonts = {}\n\n @prefix = File.expand_path(File.dirname($0)) + '/data/'\n @img_dir = 'img/'\n @tileset_dir = 'tileset/'\n @sound_dir = 'sound/'\n @song_dir = 'song/'\n @font_dir = 'font/'\n @separator = '_'\n @retro_images = false\n end",
"def initialize fps, title\n # The sprite and sound managers.\n @spriteManager = SpriteManager.new\n @soundManager = SoundManager.new 3\n\n # Number of frames per second.\n @framesPerSecond = fps\n\n # Title in the application window.\n @windowTitle = title\n\n # create and set timeline for the game loop\n buildAndSetGameLoop\n end",
"def initialize!\n $sfxengine = SoundEngine.new\n\n GameMode.enter_name_input =\n Text.new(\n Settings.winX/2,\n Settings.winY/2,\n Settings.fontsize,\n Color.new(0, 255, 0, 0.8),\n Settings.fontfile,\n \"\")\n GameMode.enter_name_headline =\n Text.new(\n Settings.winX/2,\n Settings.winY*0.35,\n Settings.fontsize,\n Color.new(0, 255, 0, 0.8),\n Settings.fontfile,\n \"enter name\")\n\n GameMode.fader = Rect.new(0, 0, Settings.winX, Settings.winY)\n GameMode.fader.colors = ColorList.new(4) { |i| Color.new(0, 0, 0, 0.8) }\n\n @ingame_timer = Timer.new\n @external_timer = Timer.new\n @engine_running = true\n @score_object = Score.new\n\n $gfxengine.prepare # TODO put to end, remove things mouse depends on!\n @mouse = Mouse.new(100, 100, Settings.mousedef)\n @score_object.cur_level = 0\n start_level @score_object.cur_level\n @textbuffer = \"\"\n GameMode.set_mode(GameMode::NORMAL)\n end",
"def run_init_script; end",
"def init; end",
"def init; end",
"def init; end",
"def init; end",
"def loadGame()\n\nend",
"def Init()\n end",
"def post_init\n\tend",
"def post_init\n end",
"def at_init\n\n\t\tend",
"def init\n\t\t## Pathfind\n\t\t#@pathfind = Pathfind.new\n\n\t\t## Add player\n\t\t@player = Player.new #spawn: @room.get_spawn\n\n\t\t## Song controller\n\t\t@song = SongController.new\n\n\t\t## Only load one level\n\t\t@level = load_level @level_name\n\n\t\t#@room = @levels[@level_name].rooms.first unless (@levels[:first].nil?)\n\t\t@room = @level.get_room @room_name\n\t\t@player.move_to_spawn @room.get_spawn\n\n\t\tputs \"Level: #{@level.name}\"\n\t\tputs \" Room: #{@room.name}\"\n\t\tputs \"INSTANCE_COUNT:\\n\\tsolid:\\t\\t#{@room.instances[:solid].size}\"\n\t\tputs \"\\tpassable:\\t#{@room.instances[:passable].size}\"\n\n\t\t## Init Pathfinder\n\t\t#@pathfind.pathfind_init\n\t\t## Add Solid blocks to pathfind grid (bootstrap it)\n\t\t#@pathfind.add_solids @room.get_instances(:solid)\n\n\t\ttracker0 = Tracker.new pos: @player.pos, track: @player\n\t\ttracker1 = Tracker.new pos: @player.pos, track: tracker0\n\t\ttracker2 = Tracker.new pos: @player.pos, track: tracker1\n\t\ttracker3 = Tracker.new pos: @player.pos, track: tracker2\n\t\ttracker4 = Tracker.new pos: @player.pos, track: tracker3\n\t\ttracker5 = Tracker.new pos: @player.pos, track: tracker4\n\n\t\t@entities = [\n\t\t\t@player,\n\t\t\tEnemy.new,\n\t\t\ttracker0, tracker1, tracker2, tracker3, tracker3, tracker4, tracker5\n\t\t]\n\n\t\t## Move camera to player\n\t\t$camera.center_on x: @player.pos(:x), y: @player.pos(:y)\n\n\t\t## Font for FPS display\n\t\t@font_fps = Gosu::Font.new 32\n\n\t\t## For consequtive updating of entities, instead of all at once\n\t\t#@update_entity_index = 0\n\tend",
"def initialize\n @game_settings = GameSettings.new\n super 920, 480\n self.caption = GAME_TITLE\n @settings_hovered = Options::START_SCREEN[0]\n @title_font, @subtitle_font = Gosu::Font.new(50), Gosu::Font.new(20)\n @background_image = Gosu::Image.new(\"media/background1.jpg\", :tileable => true)\n @blank_card = Gosu::Image.new(\"media/card.png\", :tileable => true)\n @button_option = Gosu::Image.new(\"media/button.png\", :tileable => true)\n @deck = Deck.new\n @playing_cards = Array.new\n @computer_signal = ComputerTimer.new\n @players_created, @mes, @false_mes, @true_mes, @trying_mes = false, false, false, false, false\n @hint = []\n #players\n @pressed, @p1, @p2 = nil, nil, nil\n @game_timer = Timers.new\n end"
] | [
"0.7197501",
"0.6927094",
"0.68548703",
"0.68363637",
"0.67903966",
"0.6709493",
"0.6681035",
"0.66754824",
"0.6657464",
"0.6593433",
"0.6593433",
"0.6568565",
"0.6536359",
"0.6532853",
"0.65298796",
"0.6522084",
"0.6518121",
"0.6491702",
"0.64911246",
"0.64601445",
"0.64601445",
"0.64601445",
"0.64601445",
"0.6441526",
"0.6423529",
"0.6421361",
"0.64070183",
"0.63972855",
"0.63967264",
"0.6387362"
] | 0.7465463 | 0 |
Called on an instance of the subclass, this will run the game_setup method and then begin the show loop on the delegate | def game_start
game_setup
@console_delegate.show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def game_setup\n end",
"def start\n DataManager.create_game_objects\n $game_party.setup_starting_members\n $game_map.setup(Config::Starting_Map_ID)\n $game_player.moveto(Config::X_Pos, Config::Y_Pos)\n $game_player.followers.visible = false\n $game_player.refresh\n $game_player.make_encounter_count\n\n @character_name = $game_player.character_name\n @character_index = $game_player.character_index\n $game_player.set_graphic('', 0)\n\n $game_system.menu_disabled = true\n Graphics.frame_count = 0\n\n super\n create_foreground\n create_background\n create_command_window\n play_title_music\n end",
"def viewDidLoad \n super\n self.new_game \n self.init_views\n\n end",
"def run\n game = Game.new\n game.game_start\nend",
"def run\r\n @log.debug \"Run the tester...\"\r\n @dlg_box = CupSingleGameWin.new(@options)\r\n @dlg_box.create\r\n end",
"def Main\n #Begin preinitialization\n preInit()\n\n #Render Game Window and begin drawing onto the screen.\n\n DEBUG.cout(\"Initializing Game Window...\", 0, false)\n window = GameWindow.new\n window.show\n\n #End game and return to desktop\n return nil\nend",
"def setup (game)\n\t\t# #@height = hgt\n\t\t# #@width = wdth\n\t\t# flash[:notice] = \"hello world\"\n\t\t#super.initialize(game)\n\t\trequire 'Time'\n\t\tt = Time.utc(nil,nil,days,hours,minutes,nil)\n\t\t@turn_speed = t\n\tend",
"def beginGameLoop\n @gameLoop.play\n end",
"def run\n start_game\n game_loop\n end_game\n end",
"def start_game\n begin\n @game_text.intro\n\n # Run the tutorial\n ActionDirector.new(@world, @player).call({command: :talk, target: :jerry})\n\n # The main game\n while @player.alive? && @world.has_hostiles?\n @player.in_battle? ? battle_loop : game_loop\n end\n\n @player.alive? ? @player.win : @player.defeat\n rescue SystemExit, Interrupt # Catpure ctrl+c exit, end gracefully\n @game_text.exit\n end\n end",
"def initialize fps, title\n # The sprite and sound managers.\n @spriteManager = SpriteManager.new\n @soundManager = SoundManager.new 3\n\n # Number of frames per second.\n @framesPerSecond = fps\n\n # Title in the application window.\n @windowTitle = title\n\n # create and set timeline for the game loop\n buildAndSetGameLoop\n end",
"def game_loop\n end",
"def start\n super\n create_menu_background()\n if MENU_CONFIG::IMAGE_BG != \"\"\n @bg = Sprite.new\n @bg.bitmap = Cache.picture(MENU_CONFIG::IMAGE_BG)\n @bg.opacity = MENU_CONFIG::IMAGE_BG_OPACITY\n end\n \n create_command_window()\n @status_window = Window_Party_Status.new(0, 0, 480,424, $game_party.members)\n @menu_info_window = Window_Menu_Info.new(0,424,640,56)\n end",
"def play\n board_setup\n gameplay_setup\n end",
"def start\n main_loop\n end",
"def start\n # start a new game using @config\n end",
"def main\n raise 'You forgot to call super in initialize of your scene' unless @object_to_dispose\n # Store the last scene and store self in $scene\n @__last_scene = $scene if $scene != self\n $scene = self\n yield if block_given? # Ensure we call the on_scene_switch in call_scene\n # Tell the interface is running\n @running = true\n # Main processing\n main_begin\n main_process\n main_end\n # Reset $scene unless it was already done\n $scene = @__last_scene if $scene == self\n Scheduler.start(:on_scene_switch, self.class)\n end",
"def run\n @music.play(:repeats => -1)\n\thook_run()\n\thook_quit()\n\t# Handling input\n\tloop do\n\t @queue.each do |event|\n\t\thandle(event)\n end\n\t# Draw the image to screen\n\t@intro_screen.blit(@screen,[0,0])\n\t@screen.flip()\n end\n end",
"def play\n\t\tgame_loop\n\tend",
"def setup_display\n gameboard.build_display\n build_white_side\n build_black_side\n end",
"def game_loop\n end",
"def main\n\t\tstart\n\t\twhile self == SceneManager.scene\n\t\t\tGraphics.update\n\t\t\tController.keyboard.update\n\t\t\tupdate\n\t\t\tController.wait_next_frame\n\t\tend\n\t\tterminate\n\tend",
"def play\n \n end",
"def start\n super\n create_menu_background()\n if MENU_CONFIG::IMAGE_BG != \"\"\n @bg = Sprite.new\n @bg.bitmap = Cache.picture(MENU_CONFIG::IMAGE_BG)\n @bg.opacity = MENU_CONFIG::IMAGE_BG_OPACITY\n end\n \n @title_window = Window_Outline_Title.new(0, 0, 640, 56)\n @content_window = Window_Outline.new(0, 56, 640, 424)\n \n # Create Window \n @list_window = Window_Outline_List.new(0, 0, 400, 400, Vocab::tutorials_strings)\n width_remain = (640 - @list_window.width)/2\n @list_window.x = width_remain.floor\n height_remain = (480 - @list_window.height)/2\n @list_window.y = height_remain.floor\n end",
"def main\n create_graphics\n curr_scene = $scene\n check_up\n while @running && curr_scene == $scene\n Graphics.update\n update\n end\n dispose\n # Unload title related pictures\n RPG::Cache.load_title(true)\n RPG::Cache.load_interface(true)\n ::Scheduler.start(:on_scene_switch, ::Scene_Title) if !@running && $scene.is_a?(Scene_Map)\n end",
"def start!\n @window = Window.new width, height, fullscreen?\n window.caption = name\n window.scene = Scenes.generate(first_scene)\n window.show\n end",
"def play\n #calls to all the methods that produce game!\n end",
"def run \n Engine::play(Beginning)\nend",
"def start_run\n # Abstract\n end",
"def start_run\n # Abstract\n end"
] | [
"0.68360984",
"0.6639908",
"0.6451325",
"0.62993324",
"0.61970586",
"0.6163759",
"0.6157443",
"0.6131971",
"0.6095512",
"0.6061154",
"0.6006015",
"0.60039425",
"0.5999125",
"0.5988099",
"0.5987031",
"0.59720844",
"0.59613466",
"0.59466904",
"0.5942263",
"0.59374255",
"0.5935373",
"0.5887371",
"0.58749026",
"0.5868839",
"0.585444",
"0.5838807",
"0.58384335",
"0.5825603",
"0.5811942",
"0.5811942"
] | 0.77794194 | 0 |
Gets the chat property value. The chat between the user and Teams app. | def chat
return @chat
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def chat_info\n return @chat_info\n end",
"def chat\n @_chat || payload && payload['chat']\n end",
"def chat=(value)\n @chat = value\n end",
"def chat\n @_chat ||=\n if payload\n if payload.is_a?(Hash)\n payload['chat'] || payload['message'] && payload['message']['chat']\n else\n payload.try(:chat) || payload.try(:message).try!(:chat)\n end\n end\n end",
"def chat_id\n return @chat_id\n end",
"def chat_id\n return @chat_id\n end",
"def chat_type\n return @chat_type\n end",
"def chat_display_name\n return @chat_display_name\n end",
"def chat_info=(value)\n @chat_info = value\n end",
"def chat_id=(value)\n @chat_id = value\n end",
"def chat_id=(value)\n @chat_id = value\n end",
"def set_chat\n @chat = Chat.get_one(params[:app_token], params[:number])\n end",
"def chat_type=(value)\n @chat_type = value\n end",
"def conversation_member_user\n return @conversation_member_user\n end",
"def conversation_person\n\t\treturn nil unless (mode? :conversation)\n\t\treturn @talking_to\n\tend",
"def set_chat\n @chat = @application.chats.find_by!(number: params[:id])\n end",
"def chat_params\n params[:chat]\n end",
"def property_conversation property, account\n # super\n unless valid_conversation_target? account\n raise ArgumentError, \"Account must be a tenant or system account, was: #{account}\"\n end\n conversations_about(property).find_for(account).first\n end",
"def conversation_id\n return @conversation_id\n end",
"def conversation_id\n return @conversation_id\n end",
"def teamchat?\n return @teamchat\n end",
"def has_chatter=(value)\n @has_chatter = value\n end",
"def property_conversations\n @property_conversations ||= sender.conversations_about(property)\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end"
] | [
"0.71748775",
"0.7054701",
"0.7045065",
"0.7031462",
"0.7023305",
"0.7023305",
"0.67733926",
"0.6639497",
"0.6575313",
"0.6302959",
"0.6302959",
"0.6287643",
"0.5960013",
"0.5855995",
"0.5847797",
"0.58272797",
"0.57949525",
"0.57499456",
"0.57348585",
"0.57348585",
"0.5711575",
"0.5625744",
"0.55913454",
"0.5562799",
"0.5562799",
"0.5562799",
"0.5562799",
"0.5562799",
"0.5562799",
"0.5562799"
] | 0.7338721 | 0 |
Sets the chat property value. The chat between the user and Teams app. | def chat=(value)
@chat = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_chat\n @chat = Chat.get_one(params[:app_token], params[:number])\n end",
"def set_chat\n @chat = @application.chats.find_by!(number: params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def chat_info=(value)\n @chat_info = value\n end",
"def chat_id=(value)\n @chat_id = value\n end",
"def chat_id=(value)\n @chat_id = value\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def chat_type=(value)\n @chat_type = value\n end",
"def set_chat_message\n @chat_message = ChatMessage.find(params[:id])\n end",
"def set_chat_room\n @chat_room = current_user.chat_rooms.find(params[:id])\n \n end",
"def set_chat_room\n @chat_room_user = ChatRoomUser.find(chat_room_user_params)\n end",
"def set_smpl_chat\n @smpl_chat = SmplChat.find(params[:id])\n end",
"def set_chat\n @chat_room = ChatRoom.find(params[:id])\n end",
"def has_chatter=(value)\n @has_chatter = value\n end",
"def chat\n @_chat || payload && payload['chat']\n end",
"def set_chatroom\n @chatroom = Chatroom.find(params[:chatroom_id])\n end",
"def set_coffee_chat\n @coffee_chat = CoffeeChat.find(params[:id])\n end",
"def set_direct_chat\n @direct_chat = DirectChat.find(params[:id]) rescue nil\n return res_with_error(\"Chat not found\", :not_found) unless @direct_chat\n end",
"def set_chat_room\n @chat_room = ChatRoom.find(params[:id])\n end",
"def set_chat_room\n @chat_room = ChatRoom.find(params[:id])\n end"
] | [
"0.75856173",
"0.7266743",
"0.7255754",
"0.7255754",
"0.7255754",
"0.7255754",
"0.7255754",
"0.7255754",
"0.7255754",
"0.7255754",
"0.7255754",
"0.7255754",
"0.7255754",
"0.71931034",
"0.7139131",
"0.7139131",
"0.7018493",
"0.6961826",
"0.67970365",
"0.6774398",
"0.66801286",
"0.6664401",
"0.66429245",
"0.6637469",
"0.65708447",
"0.65598893",
"0.6543329",
"0.65381527",
"0.64922804",
"0.64922804"
] | 0.8534229 | 0 |
Instantiates a new userScopeTeamsAppInstallation and sets the default values. | def initialize()
super
@odata_type = "#microsoft.graph.userScopeTeamsAppInstallation"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def installed_apps()\n return MicrosoftGraph::Me::JoinedTeams::Item::InstalledApps::InstalledAppsRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def initialize\n @initted = false\n @h_steam_user = @@dll_SteamAPI_GetHSteamUser.call\n return if (@steam_user_stats = @@dll_SteamInternal_FindOrCreateUserInterface.call(@h_steam_user, STEAMUSERSTATS_INTERFACE_VERSION)) == 0\n return if (@steam_apps = @@dll_SteamInternal_FindOrCreateUserInterface.call(@h_steam_user, STEAMAPPS_INTERFACE_VERSION)) == 0\n\n @initted = true\n end",
"def create_application_token!(user)\n ApplicationToken.create_token(\n current_user: current_user,\n user_id: user.id,\n params: { application: \"default\" }\n )\n end",
"def initialize_user_settings_defaults\n self.disabled_sports = []\n self.locale = 'en'\n self.device_ids = []\n end",
"def initialize()\n super\n @odata_type = \"#microsoft.graph.windowsAppXAppAssignmentSettings\"\n end",
"def initialize(*args)\n super\n\n @apps = {}\n fields = %w[AppID name StateFlags Universe installdir LastUpdated\n UpdateResult SizeOnDisk buildid LastOwner BytesToDownload BytesDownloaded\n AutoUpdateBehavior AllowOtherDownloadsWhileRunning UserConfig\n MountedDepots\n ]\n \n options[:steam_home].gsub!('~', ENV['HOME'])\n Dir.glob(\"#{options[:steam_home]}/steam/SteamApps/*.acf\") do |file|\n acf = SteamCodec::ACF::loadFromFile(File.open(file))\n @apps[acf.get('AppID')] = fields.map do |field|\n [field.downcase, acf.get(field)]\n end.to_h\n end\n end",
"def initialize()\n super\n @odata_type = \"#microsoft.graph.iosVppAppAssignmentSettings\"\n end",
"def teams_app_settings=(value)\n @teams_app_settings = value\n end",
"def user_set_to_default_app_type\n return if @current_user.app_type_valid?\n\n current_user.app_type_id = all_user_app_type_ids.first\n current_user.save\n end",
"def init_teams\n init_org if @org.blank?\n @team = Team.where('name is NOT NULL').first_or_create(name: 'development', org_id: @org.id)\n end",
"def initialize(bot:, user:)\n super\n @settings = user.student_settings\n end",
"def initial_onboarding_user_api_token\n ENV[\"FASTLANE_CI_INITIAL_ONBOARDING_USER_API_TOKEN\"]\n end",
"def add_default_team_memberships\n if transaction_include_action?(:create)\n team_memberships.create!(employee_id: company.employees.solo_employee.id)\n team_memberships.create!(employee_id: company.employees.out_of_office_employee.id)\n end\n end",
"def init\n init_oauth_access_token\n end",
"def initialize()\n super\n @odata_type = \"#microsoft.graph.aadUserConversationMember\"\n end",
"def initialize(user = nil, scope)\n @user = user\n @scope = scope\n end",
"def default_options\n { \"token_credential_uri\" => self.class::TOKEN_CREDENTIAL_URI,\n \"audience\" => self.class::AUDIENCE,\n \"scope\" => self.class::SCOPE }\n end",
"def initialize(app_id, app_secret, api_key, email, password)\n\n merge!(\n {\n applicationCredentials: {\n applicationId: app_id,\n applicationSecret: app_secret\n },\n userCredentials: {\n apiKey: api_key,\n email: email,\n password: password \n }\n }\n )\n end",
"def initialize()\n super\n @odata_type = \"#microsoft.graph.windowsUniversalAppXContainedApp\"\n end",
"def init_settings\n merge_in_user_settings(copy_hash(DEFAULT_SETTINGS))\n end",
"def initialize()\n super\n @odata_type = \"#microsoft.graph.macOsLobAppAssignmentSettings\"\n end",
"def initialize(company, product_family, product, teams, team, user, time_period)\n self.company = company\n self.teams = teams\n self.team = team\n self.user = user\n self.product_family = product_family\n self.product = product\n self.time_period = time_period\n end",
"def add_user_to_org(org_id, app_id, user_id)\n app_user = Application\n end",
"def initialize()\n super\n @odata_type = \"#microsoft.graph.windowsUniversalAppX\"\n end",
"def initialize(options = {})\n requires!(options, :global_user_name, :global_password, :term_type)\n super\n end",
"def new\n @app_user = @app.app_users.build\n end",
"def initialize(api_user, api_secret, workflow=nil)\n\n @api_user = api_user\n @api_secret = api_secret\n @workflow = nil \n @min = 0.9 \n\n end",
"def initialize()\n super\n @odata_type = \"#microsoft.graph.application\"\n end",
"def init\n\t\tuser_credentials = {\n\t\t\t:access_token => access_token,\n\t\t\t:refresh_token => refresh_token,\n\t\t\t:expires_at => Time.now + expires_in\n\t\t}\n\n client_id = '694fc2f618facf30b3b41726ee6d0ac04c650669ca3d114cb0bae4223cecade3'\n client_secret = '3e7cfd07d829211ac50dd6486fe677ca76e965f25ad7d68e67e845e0d4a213e7'\n\t\tCoinbase::OAuthClient.new(client_id, client_secret, user_credentials)\n\tend",
"def init_usersettings\n UserSetting.create(:user => self)\n end"
] | [
"0.54527813",
"0.52849585",
"0.5226986",
"0.51630723",
"0.51314735",
"0.5057966",
"0.50249255",
"0.5002965",
"0.50024647",
"0.49959233",
"0.4945063",
"0.4878081",
"0.48780555",
"0.48567334",
"0.48553476",
"0.48341924",
"0.48106268",
"0.48098832",
"0.47992164",
"0.479649",
"0.47846857",
"0.47554588",
"0.47512",
"0.47380596",
"0.47124124",
"0.46949703",
"0.46791098",
"0.46760303",
"0.46587422",
"0.46470279"
] | 0.74524724 | 0 |
GPS version Returns an array of projects that are similar if project exists | def project_exists
if self.check_project_exists == true
return (Project.select{ |proj| proj.project_type == self.project_type } && Project.select{ |proj| proj.street1.to_f.between?((self.street1.to_f - 0.02), (self.street1.to_f + 0.02))} && Project.select{ |proj| proj.street2.to_f.between?((self.street2.to_f - 0.02), (self.street2.to_f + 0.02 ))})
else
return []
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def known_omnibus_projects\n # iterate through min/max versions for all product names\n # and collect the name for both versions\n projects = %w{ 0.0.0 1000.1000.1000 }.collect do |v|\n @version = v\n omnibus_project\n end\n # remove duplicates and return multiple known names or return the single\n # project name\n projects.uniq || projects\n end",
"def check_project_exists\n\n # if latitude is within +/- 2 ten-thounsandths of another project's latitude it is the same\n (Project.select{ |proj| proj.project_type == self.project_type }.count > 0 && Project.select{ |proj| proj.street1.to_f.between?((self.street1.to_f - 0.002), (self.street1.to_f + 0.002))}.count > 0 && Project.select{ |proj| proj.street2.to_f.between?((self.street2.to_f - 0.02), (self.street2.to_f + 0.02))}.count > 0)\n end",
"def projects\n map(&:projects).flatten.uniq.sort\n end",
"def ring_projects\n @ring_projects ||= [\n ObsProject.new(\"#{name}#{RINGS_PREFIX}0-Bootstrap\", '0'),\n ObsProject.new(\"#{name}#{RINGS_PREFIX}1-MinimalX\", '1'),\n ObsProject.new(\"#{name}#{RINGS_PREFIX}2-TestDVD\", '2') ]\n end",
"def check_projects\n # Nasledujici kod si vyzaduje urcitou pozornost a vysvetleni komentarem. Jeho smyslem je z pole @projects_current\n # odebrat vsechny projekty, ktere jsou jiz hotove (pocet odpracovanych dni je vetsi nebo roven poctu dni potrebnemu\n # k dokonceni projektu) a tyto projekty umistit do pomocneho pole currently_done.\n # V podmince bloku metody reject! vyuzivame toho, ze pokud jeste neni odpracovan dostatecny pocet dni, bude hned\n # prvni cast podminky vyhodnocena jako false a diky zkracenemu vyhodnocovani vyrazu se druha cast podminky vubec\n # neprovede. V pripade, ze uz je odpracovano dostatecne mnozstvi dni, pridani zkoumaneho projektu do currently_done\n # se provede a vyslednou hodnotou celeho bloku bude objekt currently_done samotny, coz v podminkovem kontextu\n # znamena pravdivou hodnotu, a tedy projekt bude metodou reject! odebran z @projects_current.\n # Pokud vam takovato konstrukce pripada ponekud slozita a nepruhledna, nevadi, muzete si predstavit, ze bychom\n # misto toho pouzili nasledujici kod -- vysledek by byl stejny:\n # currently_done = @projects_current.select { |project| project.man_days_done >= project.man_days }\n # @projects_current.reject! { |project| project.man_days_done >= project.man_days }\n currently_done = []\n @projects_current.reject! { |project| project.man_days_done >= project.man_days && currently_done << project }\n\n currently_done.each do |project|\n project.state = :done\n @projects_done << project\n @budget += project.price\n end\n end",
"def check_by_project\n _r = false\n # global_project_breakdown returns multidimensional array containing different project in each line\n # Each line contains 5 elements: Project Id, max_order_total, max_order_price, Net amount sum by project & Item net price\n a = global_project_breakdown(purchase_order_items.order(:project_id))\n d = a.detect { |f| (f[1] > 0 && (f[3] > f[1])) || (f[2] > 0 && (f[4] > f[2])) }\n _r = d.nil? ? false : true\n end",
"def project_versions(project,issues)\n issues.collect(&:fixed_version).compact.uniq\n end",
"def compute_knowns\n Set.new(@files.map { |f| Albacore::Project.new f }.map { |p| p.id })\n end",
"def find_projects\n \turi = URI(BASE_URL+\"projects.json?limit=100\")\n \treq = Net::HTTP::Get.new(uri)\n \treq['Authorization']=BASIC_AUTHORIZATION\n \tres = Net::HTTP.start(uri.hostname, uri.port) {|http|\n \t http.request(req)\n \t}\n\n \tprojects_full_json = JSON.parse(res.body)[\"projects\"]\n \tres = []\n \tprojects_full_json.each do |json_project|\n \t\tp = ProjectForm.new(json_project)\n \t\tres << p\n \tend\n\n \tres.each do |project|\n #Recorremos los proyectos, si no existen los creamos, en otro caso los actualizamos.\n project_db = Project.find_or_create_by(:identifier=>project.identifier)\n\n project_db.update(\n :name => project.name,\n :description => project.description,\n :identifier => project.identifier,\n :trackers=>[]\n );\n\n correspond = Correspond.where(:id_remote=>project.id,:remote_type=>0).first_or_create\n correspond.id_local=project_db.id\n correspond.remote_type=0\n correspond.save\n\n if(!project_db.errors.empty?)\n puts project_db.errors.full_messages\n end\n end\n return res\n end",
"def ring_projects\n @ring_projects ||= strategy.rings.each_with_index.map do |r,idx|\n ObsProject.new(\"#{rings_project_name}:#{idx}-#{r}\", \"#{idx}-#{r}\")\n end\n end",
"def projects\n uri = self.uri\n query = Ruta::Sparql.select.where(\n [:proj, RDF.type, Ruta::Class.project],\n [:proj, RDF::FOAF.member, :mir],\n [:mir, Ruta::Property.has_member, uri]\n )\n projs = []\n query.each_solution { |sol| projs.push(sol.proj.as(Organisation)) }\n projs\n end",
"def cross_project\n []\n end",
"def projects_by_path\n strong_memoize(:projects_by_path) do\n Project.eager_load(:route, namespace: [:route])\n .where_full_path_in(unique_project_paths)\n .index_by(&:full_path)\n end\n end",
"def projects_tracked\n timings = Timing.for_period_of_time(self.id, 1.month.ago, Time.now)\n if timings.present?\n timings.map(&:project_id).uniq\n else\n []\n end\n end",
"def projects(params = nil)\n params = params.merge({ :current_user => @options[:current_user]})\n params = params.except(:manufacturer_id, :catg_slug, :office_id, :max_matches)\n params[:order] ||= 'recently_active'\n\n @projects_response = ProjectsIndexPresenter.new(params[:current_user], params).response\n projects = @projects_response[:projects] || []\n projects\n end",
"def project?(p)\r\n projects.include?(p)\r\n end",
"def projects_supported\n @pledges = Pledge.all\n project_list = {}\n @pledges.each do |pledge|\n if pledge.user_id == self.id\n if project_list.has_key?(pledge.project_id)\n project_list[pledge.project_id] += pledge.dollar_amount\n else\n project_list[pledge.project_id] = pledge.dollar_amount\n end\n end\n end\n return project_list\n end",
"def show\n @projects = @dataset.experiments.collect { |experiment| experiment.project }.uniq\n end",
"def project_by_name(project_name)\n projects.find { |project| project['name'].casecmp(project_name) == 0 }\n end",
"def projects\n PivotalTracker::Project.all\n end",
"def is_a_conditional_version_project?(project_name)\n @version_projects ||= group_conditional_custom_field.possible_values\n @version_projects.include?(project_name)\n end",
"def reachable_projects\n path.ascend.find_all { |p| p.exist? && p.directory? }.flat_map do |dir|\n dir.children.select { |p| p.extname == '.xcodeproj' }\n end\n end",
"def my_projects\n # Look at all the project\n # see which project's creator is equal to self\n Project.all.select do |project|\n project.creator == self\n end\n end",
"def find_projects\n #binding.pry\n ProjectBacker.all.select do |element|\n element.backer == self\n end\n end",
"def project_all\n prj = { '_id' => 0 }\n prj.merge!(make_grp_prj_periods[1])\n prj.merge!(make_grp_prj_nodes[1])\n prj.merge!(project_bookingnet)\n prj.merge!(project_baselist) unless @sensitivity >= 2\n prj.merge!(project_standardcost) unless @sensitivity >= 1\n { '$project' => prj }\n end",
"def reachable_projects\n path.ascend.find_all{ |p| p.directory? }.flat_map do |dir|\n dir.children.select{ |p| p.extname == '.xcodeproj' }\n end\n end",
"def open_projects\n Project.where(status: :open, service_id: services)\n end",
"def assign_new_projects\n # IMPLEMENTUJTE TUTO METODU\n # Pro kazdeho volneho programatora hledejte projekt k prideleni nasledovne:\n # - Pokud existuje nejaky projekt v @projects_waiting, vyberte prvni takovy.\n # (Nezapomente mu zmenit stav a presunout jej do @projects_current.)\n # - Pokud ne, vyberte takovy projekt z @projects_current, na kterem zbyva\n # nejvice nedodelane prace.\n @programmers.each_with_index do |prg,i|\n if @programmers[i].project == nil #programator bez projektu\n if @projects_waiting.length > 0\n cur_prj=@projects_waiting.shift\n cur_prj.state=:current\n @programmers[i].project=cur_prj\n @projects_current << cur_prj\n else\n if @projects_current.length >0\n #p \"vyber ten kde je nejvic prace\"\n #p @projects_current\n @projects_current.sort! { |a,b| (a.man_days-a.man_days_done) <=> (b.man_days-b.man_days_done) }\n # @projects_current.sort_by! {|rem| -(rem.man_days - rem.man_days_done) }\n @programmers[i].project=@projects_current[0] if @projects_current.length >0\n end\n end\n end\n end\n end",
"def find_all_issues\n version_id_sql = \"project_id =\\\"#{@project.id}\\\" \" + \\\n \"AND name = \\\"#{@version}\\\"\"\n # obtaining the unique ID from the chosen project version\n version = Version.all(conditions: [version_id_sql]).at(0).id.to_s \\\n if Version.all(conditions: [version_id_sql]) != []\n issues_sql = \"project_id = \\\"#{@project.id}\\\" \" + \\\n \"AND fixed_version_id = \\\"#{version}\\\"\"\n populate_issues_array(issues_sql)\n end",
"def available_projects_list\n uri = \"#{@api_url}?access_token=#{@access_token}\"\n get uri\n end"
] | [
"0.6690948",
"0.6394917",
"0.5990774",
"0.5943927",
"0.5851132",
"0.5848677",
"0.5834253",
"0.5830118",
"0.57999",
"0.5787687",
"0.5622428",
"0.56071115",
"0.56039155",
"0.5595532",
"0.55241996",
"0.5422615",
"0.5381047",
"0.53718483",
"0.53706586",
"0.5354612",
"0.5352882",
"0.5342946",
"0.5293814",
"0.5279979",
"0.5276979",
"0.5258821",
"0.5254504",
"0.52481335",
"0.52318716",
"0.52317464"
] | 0.64128435 | 1 |
GPS version check for projects that have similar streets reversing street order as necessary. | def check_project_exists
# if latitude is within +/- 2 ten-thounsandths of another project's latitude it is the same
(Project.select{ |proj| proj.project_type == self.project_type }.count > 0 && Project.select{ |proj| proj.street1.to_f.between?((self.street1.to_f - 0.002), (self.street1.to_f + 0.002))}.count > 0 && Project.select{ |proj| proj.street2.to_f.between?((self.street2.to_f - 0.02), (self.street2.to_f + 0.02))}.count > 0)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compare_build_vers(loc_ver,rem_ver)\n if loc_ver.to_s.match(/No/)\n result = 0\n else\n if rem_ver.to_s.match(/-/) and !rem_ver.to_s.match(/beta/)\n if $verbose == 1\n puts \"Local build date: \"+loc_ver.to_s\n puts \"Remote build date: \"+rem_ver.to_s\n end\n if rem_ver.to_time > loc_ver.to_time\n result = 0\n else\n result = 1\n end\n else\n if $verbose == 1\n puts \"Local build version: \"+loc_ver\n puts \"Remote build version: \"+rem_ver\n end\n if loc_ver !~ /No/\n loc_ver = Versionomy.parse(loc_ver)\n rem_ver = Versionomy.parse(rem_ver)\n if rem_ver > loc_ver\n result = 0\n else\n result = 1\n end\n else\n result = 2\n end\n end\n end\n if result == 0\n puts \"Remote version of build is newer than local\"\n else\n if result == 1\n puts \"Local version of build is up to date\"\n else\n puts \"Local version could not be accurately determined\"\n end\n end\n return result\nend",
"def nmap_version_at_least?(test_ver=nil)\n raise ArgumentError, \"Cannot compare a Float, use a String or Integer\" if test_ver.kind_of? Float\n unless test_ver.to_s[/^([0-9]+(\\x2e[0-9]+)?)/n]\n raise ArgumentError, \"Bad Nmap comparison version: #{test_ver.inspect}\"\n end\n test_ver_str = test_ver.to_s\n tnum_arr = $1.split(/\\x2e/n)[0,2].map {|x| x.to_i}\n installed_ver = get_nmap_ver()\n vtag = installed_ver.split[2] # Should be [\"Nmap\", \"version\", \"X.YZTAG\", \"(\", \"http..\", \")\"]\n return false if (vtag.nil? || vtag.empty?)\n return false unless (vtag =~ /^([0-9]+\\x2e[0-9]+)/n) # Drop the tag.\n inum_arr = $1.split(/\\x2e/n)[0,2].map {|x| x.to_i}\n return true if inum_arr[0] > tnum_arr[0]\n return false if inum_arr[0] < tnum_arr[0]\n inum_arr[1].to_i >= tnum_arr[1].to_i\nend",
"def project_exists\n\n if self.check_project_exists == true\n return (Project.select{ |proj| proj.project_type == self.project_type } && Project.select{ |proj| proj.street1.to_f.between?((self.street1.to_f - 0.02), (self.street1.to_f + 0.02))} && Project.select{ |proj| proj.street2.to_f.between?((self.street2.to_f - 0.02), (self.street2.to_f + 0.02 ))})\n else\n return []\n end\n end",
"def direction_touching_number?\n return false unless @confirmed[:street_direction] && @confirmed[:street_number]\n\n @confirmed[:street_direction].min - 1 == @confirmed[:street_number].max\n end",
"def breaking_changes?(version)\n\t\t\tDownloadTV::VERSION.split(\".\").zip(version.split(\".\")).find_index { |x, y| y > x }&.< 2\n\t\tend",
"def address_correlate\n return nil unless (self.community.respond_to?(:launch_date) && Community.find_by_name(\"Lexington\").respond_to?(:launch_date))\n return nil if self.community.launch_date.to_date < Community.find_by_name(\"Lexington\").launch_date.to_date\n likeness = 0.94\n addr = []\n street = self.community.street_addresses\n street.each do |street_address|\n st_addr = street_address.address\n test = st_addr.jarowinkler_similar(address.split(\",\").first)\n if test > likeness\n likeness = test\n addr.clear\n addr << street_address\n elsif test == likeness\n addr << street_address\n end\n end\n\n if addr.empty?\n addr << create_st_address\n end\n\n addr.first\n end",
"def assigned_version_roadways\n version = assigned_version\n\n if version # you need to ensure that there is even an inspection that was moved through assigned\n typed_version = TransamAsset.get_typed_version(version)\n\n if version.respond_to? :reify # if the highway structure returns a version you can use its version to find the versions associated with roadways\n return typed_version.roadways\n else # otherwise you have a highway structure that is \"live\" ie what is the DB right now and you have to figure out what versions of roadways are associated\n # given the time of assignment\n # you know that if a roadway wasnt updated since the time of assignment that those roadways were like that at assignment. they can be included in roadways of the assigned version\n time_of_assignment = assigned_inspection_version.created_at\n results = typed_version.roadways.where('updated_at <= ?', time_of_assignment).to_a\n\n # therefore you only need to check roadways updated after time of assignment\n # for those roadways, you find the version that is closest and before the time of assignment\n # versions save the object BEFORE the change\n # therefore to get the version at time of assignment you need the first version that happened after the time of assignment\n typed_version.roadways.where('updated_at > ?', time_of_assignment).each do |roadway|\n ver = roadway.versions.where('created_at > ?', time_of_assignment).where.not(event: 'create').order(:created_at).first\n results << ver.reify if ver\n end\n return results\n end\n end\n end",
"def assume_parts\n # Check if unit is in street number\n # 1) If street number has - or / unit is the smallest length\n # 2) If street number is all nums except 1 letter, letter is unit\n search_for_unit_in_street_num if @parts[:unit].nil? && @parts[:street_number]\n\n # Search for the street_name elsewhere\n search_for_street_name if @parts[:street_name].nil?\n\n # set puerto rico as the state\n @parts[:state] = @parts[:country] if @parts[:state].nil? && @parts[:country] == 'pr'\n\n return if @parts[:bus].nil? || @parts[:bus].empty?\n\n search_for_label_in_bus if @parts[:street_label].nil?\n search_for_state_in_bus if @parts[:state].nil?\n\n end",
"def test_rbs_have_matching_osm_tests\n # List of tests that don't have a matching OSM test for a valid reason\n # No \"Warn\" will be issued for these\n # input the ruby file name, eg `xxxx.rb` NOT `test_xxx_rb`\n noMatchingOSMTests = ['ExampleModel.rb',\n 'autosize_hvac.rb',\n # Not enabled\n 'afn_single_zone_ac.rb']\n\n base_dir = $ModelDir\n all_ruby_paths = Dir.glob(File.join(base_dir, '*.rb'));\n all_ruby_filenames = all_ruby_paths.map{|p| File.basename(p)};\n\n all_ruby_filenames.each do |filename|\n if !noMatchingOSMTests.include?(filename)\n # Check if there is a matching OSM file\n matching_osm = File.join(base_dir, filename.sub('.rb', '.osm'))\n\n # If you want to be stricter than warn, uncomment this\n # assert File.exists?(matching_osm), \"There is no matching OSM test for #{filename}\"\n\n if File.exists?(matching_osm)\n v = OpenStudio::IdfFile.loadVersionOnly(matching_osm)\n # Seems like something we should definitely fix anyways, so throwing\n if not v\n fail \"Cannot find versionString in #{matching_osm}\"\n end\n\n # If there is a version, check that it's not newer than current bindings\n model_version = v.get.str\n\n if Gem::Version.new(model_version) > Gem::Version.new($SdkVersion)\n # Skip instead of fail\n skip \"Matching OSM Model version is newer than the SDK version used (#{model_version} versus #{$SdkVersion})\"\n end\n else\n # If there isn't a matching, we warn, but we'll still run it\n # It might make sense if you have just added it recently\n warn \"There is no matching OSM test for #{filename}\"\n end\n end\n end\n end",
"def compare_versions(local_version,depot_version,mode)\n if local_version.match(/-/)\n local_version = local_version.split(/-/)[1]\n end\n if depot_version.match(/-/)\n depot_version = depot_version.split(/-/)[1]\n end\n puts \"Current: \"+local_version\n puts \"Available: \"+depot_version\n if mode =~ /up|check/\n avail_fw = compare_ver(local_version,depot_version)\n if avail_fw.to_s != local_version.to_s\n puts \"Depot patch level is newer than installed version\"\n update_available = \"y\"\n else\n update_available = \"n\"\n puts \"Local patch level is up to date\"\n end\n else\n if depot_version.to_i < local_version.to_i\n puts \"Depot patch level is lower than installed version\"\n update_available = \"y\"\n else\n update_available = \"n\"\n puts \"Local patch level is up to date\"\n end\n end\n if mode == \"check\"\n exit\n end\n return update_available\nend",
"def street_areSame?(street)\n if(@street == street)\n true\n else\n false\n end\nend",
"def check_addresses\n\n if location = @found_params.entities.detect {|entity| entity.name == \"from\"} || @ride.start_address\n if @ride.start_address\n address = @ride.start_address\n else\n address = geocode(location.value)\n end\n\n @ride.start_address = address\n @ride.save\n\n geo = Geocoder.search(\"#{address.latitude},#{address.longitude}\").first.address_components\n @start_address_nice = geo.first[\"short_name\"] + \" \" + geo.second[\"short_name\"] + \" à \" + geo.third[\"short_name\"]\n\n\n @time = UberService.new(@ride).time_estimates\n @time = @time / 60 if @time.class == Fixnum\n\n end\n\n if location = @found_params.entities.detect {|entity| entity.name == \"to\"} || @ride.end_address\n if @ride.end_address\n address = @ride.end_address\n else\n address = geocode(location.value)\n end\n\n @ride.end_address = address\n @ride.save\n\n geo = Geocoder.search(\"#{address.latitude},#{address.longitude}\").first.address_components\n @end_address_nice = geo.first[\"short_name\"] + \" \" + geo.second[\"short_name\"] + \" à \" + geo.third[\"short_name\"]\n\n end\n\n if (location = @found_params.entities.detect {|entity| entity.name == \"address\"}) && (@ride.end_address || @ride.start_address)\n\n address = geocode(location.value)\n geo = Geocoder.search(\"#{address.latitude},#{address.longitude}\").first.address_components\n nice_address = geo.first[\"short_name\"] + \" \" + geo.second[\"short_name\"] + \" à \" + geo.third[\"short_name\"]\n\n\n if @ride.start_address\n @ride.end_address = address\n @end_address_nice = nice_address\n else\n @ride.end_address = address\n @start_address_nice = nice_address\n end\n\n @ride.save\n end\n\n if !@ride.end_address.nil? && !@ride.start_address.nil?\n @price = UberService.new(@ride).price_estimates\n end\n end",
"def compare_versions\n if @local_version && \n (@local_version.to_machine_format >= @website_version.to_machine_format)\n display_versions\n puts \"You have the most recent version.\"\n puts \"Exiting...\"\n exit 0\n end\nend",
"def test_version\n check_current_version(current_ways(:visible_way).id)\n check_current_version(current_ways(:used_way).id)\n check_current_version(current_ways(:way_with_versions).id)\n end",
"def gotPoint(lat,lon)\n\n nearby_place_found = false\n\n # call get_close_places to get nearby OSM places\n # (as per the grid squares)\n get_close_places(lat,lon).each do |place|\n\n #for each place\n plat,plon,name = place\n\n if is_close([lat, lon], [plat.to_f, plon.to_f])\n #It's vaguely close by. Let's do the actual distance calculation\n dist = spherical_distance([lat, lon], [plat.to_f, plon.to_f])\n if dist < Buffer\n nearby_place_found = true\n break\n end\n end\n end\n if not nearby_place_found\n #No nearby places found (which is the intersting case!)\n $missingcount+=1\n puts \"gpx point \" + $count.to_s + \" - No nearby place. \" + lat.to_s + \" \" + lon.to_s #+ \" \" + shortest_dist.to_s + \"km (\" + shortest_place.to_s + \" \" + splat.to_s + \" \" + splon.to_s + \")\"\n\n #Write a waypoint to the output GPX file\n File.open(OutputGPX, 'a') {|f| f.write( \"<wpt lat=\\\"\" + lat.to_s + \"\\\" lon=\\\"\" + lon.to_s + \"\\\"></wpt>\\n\" ) }\n\n end\nend",
"def highway_structure_version_roadways\n typed_version = TransamAsset.get_typed_version(highway_structure_version)\n if state == 'final'\n if highway_structure_version.respond_to? :reify\n typed_version.roadways\n else\n time_of_finalization = versions.last.created_at\n results = typed_version.roadways.where('updated_at <= ?', time_of_finalization).to_a\n\n typed_version.roadways.where('updated_at > ?', time_of_finalization).each do |roadway|\n ver = roadway.versions.where('created_at > ?', time_of_finalization).where.not(event: 'create').order(:created_at).first\n results << ver.reify if ver\n end\n return results\n end\n else\n return highway_structure.roadways\n end\n end",
"def needs_geocoding?\n self.new_record? || self.city_changed? || self.street_address_changed?\n end",
"def prerelease?(version)\n !!PRERELEASE_STRINGS.detect do |string|\n version.match(/[^\\w]#{string}[^\\w]/)\n end\n end",
"def sputnik?(expected_version = nil)\n Sputnik.new(ua).match? && detect_version?(full_version, expected_version)\n end",
"def solution_correct?\n current = params[:solution].strip\n current.gsub!(/\\/\\*[\\w\\s]*\\*\\//,\"\") \n current.gsub!(/--.*\\n/,\"\")\n existing = format_str(@lesson.solution.strip)\n current = format_str(current.strip)\n if existing == current\n return true\n else\n existing_arr = existing.split\n current_arr = current.split\n len= existing_arr.length\n err =[]\n j=0 \n for i in 0..len\n if existing_arr[i]!=current_arr[i]\n err[j]= existing_arr[i]\n j=j+1 \n end\n end\n return err\n end \n end",
"def no_change_in_version?\n latest_resolvable_version <= existing_version\n end",
"def valid_address?( delta = 1.0 )\n @required = [:ups_account, :ups_user, :ups_password]\n \n state = STATES.has_value?(@state.downcase) ? STATES.index(@state.downcase) : @state\n \n @data = String.new\n b = Builder::XmlMarkup.new :target => @data\n \n b.instruct!\n b.AccessRequest {|b|\n b.AccessLicenseNumber @ups_account\n b.UserId @ups_user\n b.Password @ups_password\n }\n b.instruct!\n b.AddressValidationRequest {|b|\n b.Request {|b|\n b.RequestAction \"AV\"\n b.TransactionReference {|b|\n b.CustomerContext \"#{@city}, #{state} #{@zip}\"\n b.XpciVersion API_VERSION\n }\n }\n b.Address {|b|\n b.City @city\n b.StateProvinceCode state\n b.PostalCode @zip\n }\n }\n \n \t get_response \"https://wwwcie.ups.com/ups.app/xml/AV\"\n \n \t\tif REXML::XPath.first(@response, \"//AddressValidationResponse/Response/ResponseStatusCode\").text == \"1\" && REXML::XPath.first(@response, \"//AddressValidationResponse/AddressValidationResult/Quality\").text.to_f >= delta\n \t\t return true\n \t\telse\n \t\t return false\n \t\tend\n end",
"def compare_for_near_match(guess_index)\n (0..3).each do |code_index|\n next unless guess[guess_index] == code[code_index]\n\n key.push(\"O\")\n code[code_index] = 0\n break\n end\n end",
"def routes_are_correct?\n @solution.each do |route|\n return false if route.demand > @vehicle_capacity\n end\n return true\n end",
"def scanSameNameWithDifferentSimilarTrackCount()\n problemCount = 0;\n SimilarTracksVersionControl.find(:all, :conditions => [\"version = ? and status = ? and similar_track_count > ?\" , 1, 1, 0]).each do |strack|\n puts \"track_id:\" + strack.track_id.to_s();\n \n\n scs = SimilarTracksVersionControl.find(:all, :order => \"similar_track_count desc\", :limit => 1, :conditions => [\"track_name = ? and track_artist_id = ? and track_id != ? and status = ? and similar_track_count > ?\", strack.track_name, strack.track_artist_id, strack.track_id, 1, 0]);\n status = 0;\n if (scs != nil and !scs.empty?)\n sc = scs.first;\n puts \"matched track_id:\" + sc.track_id.to_s();\n if (strack.similar_track_count < sc.similar_track_count)\n strack.same_name_with_different_similar_track_count_fix = sc.track_id;\n strack.status = 200;\n strack.save();\n puts \"need fix:\" + strack.similar_track_count.to_s + \" < \" + sc.similar_track_count.to_s;\n problemCount = problemCount + 1;\n end\n\n end\n \n \n end #end of loop\n puts \"total needs fix:\" + problemCount.to_s();\n \n end",
"def srss?\n lat != 0.0 && long != 0.0 #there should not be an airfield, somewhere in the ocean\n end",
"def in_same_release_line?(other)\n major == other.major &&\n # minor and patch always match if one or the other is nil (~>-like behavior)\n ( minor.nil? || other.minor.nil? || minor == other.minor ) &&\n ( patch.nil? || other.patch.nil? || patch == other.patch )\n end",
"def suitable_for_all?\n<<<<<<< HEAD:app/models/project.rb\n \treturn self.disciplines.count(:all) == Discipline.count(:all)\n=======\n \treturn self.disciplines.count(:all) == Discipline.count(:all)\n>>>>>>> 336471e6be257cf55c9afa2a65f928fde34e41fe:app/models/project.rb\n end",
"def internal_or_core?(pin); end",
"def remove_duplicate_direction\n spl = @parts[:street_name].split\n return unless @parts[:street_direction].include? spl.first\n\n @parts[:street_name] = spl[1..].join\n end"
] | [
"0.56617856",
"0.5622213",
"0.53688985",
"0.52612925",
"0.52385014",
"0.5199634",
"0.5196009",
"0.5139134",
"0.5099616",
"0.5096459",
"0.50687355",
"0.500505",
"0.4997049",
"0.49902913",
"0.4971103",
"0.4854134",
"0.48421282",
"0.48408216",
"0.48359808",
"0.48330972",
"0.48234797",
"0.47994715",
"0.47903886",
"0.47710383",
"0.47677606",
"0.4761987",
"0.47616184",
"0.47557905",
"0.47421023",
"0.47405288"
] | 0.65193725 | 0 |
Details: Finish the solution so that it sorts the passed in array of numbers. If the function passes in an empty array or null/nil value then it should return an empty array. For example: solution([1, 2, 10, 50, 5]) should return [1,2,5,10,50] solution(nil) should return [] | def solution(nums)
nums.to_a.sort
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sort_array(nums)\n nums.nil? ? [] : nums.sort\nend",
"def my_sort(nums, sorted=[])\n\t# get min\n\t# Remove min from nums\n\t# recursion until nums.size == 0 with new nums and new sorted\n\t# Return sorted\n\n\tmin = nums.min\n\tsorted << min\n\n\tnums.delete_if {|n| n == min}\n\n\tif nums.size > 0\n\t\tmy_sort nums, sorted\n\telse\n\t\tsorted\n\tend\nend",
"def sort some_array\n\trecursive_sort some_array, []\nend",
"def sort some_array\n\trecursive_sort some_array, []\nend",
"def sort_nums_ascending(arr)\n return arr.sort\nend",
"def sort some_array\n recursive_sort some_array, []\nend",
"def sort some_array\n recursive_sort some_array, []\nend",
"def sorting(numbers)\n numbers.sort\nend",
"def using_sort(array)\narray.sort\nend",
"def using_sort(array)\narray.sort\nend",
"def take_array(array)\r\n array.sort\r\nend",
"def sort1(array)\n\nend",
"def using_sort(array)\n array.sort\nend",
"def using_sort(array)\n array.sort\nend",
"def using_sort(array)\n array.sort\nend",
"def sort some_array\n\tsorted_array = []\n\trecursive_sort some_array, sorted_array\nend",
"def sort(arr)\n recursive_sort(arr, [])\n# This is called a \"wrapper\", a method that wraps up another method,\n# in this case the recursive_sort method. The sort method takes\n# one argument, the given array, which in turn is passed into the\n# recursive sort method along with an empty array as the second\n# argument.\nend",
"def merge_sort(arr)\n return arr if arr.length <= 1\nend",
"def using_sort(array)\n sorted_array=array.sort\nend",
"def recursive_sort_wrap some_array\n recursive_sort some_array, []\nend",
"def sort_array_asc(integers)\n integers.sort\nend",
"def sort arr\n recursive_sort arr, []\nend",
"def sort arr\n recursive_sort arr, []\nend",
"def merge_sort numbers, si=0, ei=nil\n\n # TODO: your cool code goes here\n\nend",
"def sort array # This \"wraps\" recursive_sort.\n recursive_sort array, []\nend",
"def sort(to_sort)\n # if the array is of length 0 or 1, consider it is already sorted\n if to_sort.length <= 1\n then return to_sort\n end\n\n # otherwise split the remaining elements in two\n # I had to look this line on the web (sourcerefactormycode.com)\n second_array = to_sort.slice!((to_sort.length / 2.0).round..to_sort.length)\n\n # recursive method call on both arrays\n first_sorted_array = sort(to_sort)\n second_sorted_array = sort(second_array)\n\n # merge the two sorted arrays together\n return merge(first_sorted_array, second_sorted_array)\nend",
"def lomuto(array)\n lomuto_sort(array, 0, array.length - 1)\nend",
"def merge_sort(numbers)\n # Base case\n # Rearrangement is no longer possible, there's only 1 element in `numbers`!\n return numbers if numbers.size == 1\n\n # Partition unsorted elements into groups\n # Continue until n sublists, each containing 1 element (i.e. all reached base case)\n mid = numbers.size / 2\n left = numbers[0...mid] # alternatively: numbers.take(mid)\n right = numbers[mid..-1] # alternatively: numbers.drop(mid)\n\n # Recursively break down sublists into smaller problems\n # until each list has 1 element\n left_nums = merge_sort(left)\n right_nums = merge_sort(right)\n\n # Merge individual sublists to produce sorted sublists when\n # left_nums && right_nums are available\n merge(left_nums, right_nums)\nend",
"def custom_sort (unsorted, sorted = [])\n return sorted.uniq if unsorted.length == 0\n smallest = unsorted[0]\n unsorted.each {|x| smallest = x if x <= smallest}\n\n unsorted.each {|x| sorted << x if x <= smallest }\n\n unsorted.delete(smallest)\n custom_sort(unsorted, sorted)\nend",
"def sort arr\n return arr if arr.length <= 1\n middle = arr.pop\n less = arr.select{|x| x < middle}\n more = arr.select{|x| x >= middle}\n sort(less) + [middle] + sort(more)\nend"
] | [
"0.79653484",
"0.66269785",
"0.6622227",
"0.6622227",
"0.6503862",
"0.64985967",
"0.64985967",
"0.64849895",
"0.64233613",
"0.64233613",
"0.63996476",
"0.6398528",
"0.6390439",
"0.6390439",
"0.6390439",
"0.6373231",
"0.6340254",
"0.6340031",
"0.63360506",
"0.6335004",
"0.63138276",
"0.6281494",
"0.6281494",
"0.62318563",
"0.623105",
"0.6217705",
"0.6201818",
"0.61959875",
"0.6182997",
"0.61746687"
] | 0.7088003 | 1 |
GET /regionextras GET /regionextras.json | def index
@regionextras = Regionextra.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_region\n respond_to do |format|\n format.json{ render :json => { :region => Region.all } }\n end\n end",
"def region\n @regions = @company.companyregions\n respond_with @regions\n end",
"def regions\n client.get_stats('/stats/regions')\n end",
"def show\n render json: @region\n end",
"def set_regionextra\n @regionextra = Regionextra.find(params[:id])\n end",
"def get_regions_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UniverseApi.get_regions ...\"\n end\n if opts[:'datasource'] && !['tranquility', 'singularity'].include?(opts[:'datasource'])\n fail ArgumentError, 'invalid value for \"datasource\", must be one of tranquility, singularity'\n end\n # resource path\n local_var_path = \"/universe/regions/\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'datasource'] = opts[:'datasource'] if !opts[:'datasource'].nil?\n query_params[:'user_agent'] = opts[:'user_agent'] if !opts[:'user_agent'].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 header_params[:'X-User-Agent'] = opts[:'x_user_agent'] if !opts[:'x_user_agent'].nil?\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<Integer>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UniverseApi#get_regions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def region\n @region ||= client.regions.get_from_uri(info[:region])\n end",
"def region\n @region ||= client.regions.get_from_uri(info[:region]) unless info[:region].nil?\n end",
"def regions\n @attributes[:regions]\n end",
"def regions\n @regions = Region.all\n\n render json: @regions.to_json(:include => :vertices)\n end",
"def index\n @regiones = Region.all\n\n render json: @regiones\n end",
"def region() ; info[:region] ; end",
"def region() ; info[:region] ; end",
"def describe_regions(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeRegions'\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? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\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",
"def regions(for_select = true)\n fetch_array_for $regions, for_select\n end",
"def describe_regions(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeRegions'\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? :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",
"def show\n @region = Region.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @region }\n end\n end",
"def index\n @especies_regiones = EspecieRegion.all\n end",
"def query_tax_region_jurisdictions(options={})\n path = \"/api/v2/compliance/taxregionjurisdictions\"\n get(path, options)\n end",
"def regions\n Vultr::Resource::Region.new(@faraday)\n end",
"def especies_por_region\n snib = Geoportal::Snib.new\n snib.params = params\n snib.especies\n self.resp = snib.resp\n end",
"def get_aws_region\n\n\n begin\n\n url = 'http://169.254.169.254/latest/dynamic/instance-identity/document'\n uri = URI(url)\n response = Net::HTTP.get(uri)\n\n hashOfLookupValues = JSON.parse(response)\n lookupRegion = hashOfLookupValues[\"region\"]\n\n rescue\n logonFailed('Unable to perform region lookup. Is this an EC2 instance? and does it have access to http://169.254.169.254')\n end\n\n return lookupRegion\n\n end",
"def describe_regions(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeRegions'\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? :host_id\n\t\t\targs[:query]['HostId'] = optional[:host_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tself.run(args)\n\tend",
"def query_tax_regions(options={})\n path = \"/api/v2/compliance/taxregions\"\n get(path, options)\n end",
"def _region_states(region_id)\n get('region/states', region_id)\n end",
"def getVendorsAndRegions\n fetch(@config[:finance_path], 'Finance.getVendorsAndRegions')\n end",
"def listRegions\n\t\t\treturn MU::Config.listRegions\n\t\tend",
"def get_regions()\n\t\t{\"include_regions\"=>@include_regions,\"exclude_regions\"=>@exclude_regions}\n\tend",
"def available_services_regions\n unless @regions\n @regions = []\n service_catalog.each do |service|\n next if service[\"type\"]==\"identity\"\n (service[\"endpoints\"] || []).each do |endpint|\n @regions << endpint['region']\n end\n end\n @regions.uniq!\n end\n @regions\n end",
"def find_region_by_service(id)\n self.class.get(\"/services/#{id}/regions.json?apikey=#{apikey}\") \n end"
] | [
"0.71900696",
"0.67239195",
"0.66143936",
"0.6611175",
"0.64833874",
"0.64386183",
"0.6378065",
"0.6367327",
"0.63036364",
"0.6268304",
"0.6228991",
"0.6211672",
"0.6211672",
"0.62070656",
"0.6194856",
"0.61833453",
"0.61815906",
"0.6171834",
"0.61537635",
"0.6150054",
"0.61448056",
"0.60963225",
"0.60608184",
"0.6008888",
"0.6007783",
"0.5971935",
"0.59665895",
"0.5958612",
"0.5958567",
"0.59136677"
] | 0.72709906 | 0 |
POST /regionextras POST /regionextras.json | def create
@regionextra = Regionextra.new(regionextra_params)
respond_to do |format|
if @regionextra.save
format.html { redirect_to @regionextra, notice: 'Regionextra was successfully created.' }
format.json { render :show, status: :created, location: @regionextra }
else
format.html { render :new }
format.json { render json: @regionextra.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def regionextra_params\n params.require(:regionextra).permit(:RegionID, :Name, :value)\n end",
"def set_regionextra\n @regionextra = Regionextra.find(params[:id])\n end",
"def create\n @region = Region.new(region_params)\n\n if @region.save\n render json: @region, status: :created, location: @region\n else\n render json: @region.errors, status: :unprocessable_entity\n end\n end",
"def create_region\n Region.create!(params[:record])\n render :json => {}\n end",
"def update\n respond_to do |format|\n if @regionextra.update(regionextra_params)\n format.html { redirect_to @regionextra, notice: 'Regionextra was successfully updated.' }\n format.json { render :show, status: :ok, location: @regionextra }\n else\n format.html { render :edit }\n format.json { render json: @regionextra.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @region = Region.new(region_params)\n @regions = Region.where('active_status=? and del_status=?', true, false)\n respond_to do |format|\n if @region.save\n format.js { flash[:success] = \"#{@region.region_desc} added successfully\" }\n format.html { redirect_to @region, notice: \"Region was successfully created.\" }\n format.json { render :show, status: :created, location: @region }\n else\n format.js { render :new }\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @regionextras = Regionextra.all\n end",
"def create_region\n @region = @company.companyregions.new(region_params)\n if @region.save\n render json: @region.as_json, status: :ok\n else\n render json: {region: @region.errors, status: :no_content}\n end\n end",
"def create\n @region = Region.new(region_params)\n\n respond_to do |format|\n if @region.save\n format.html { redirect_to regions_path, notice: 'Region was successfully created.' }\n format.json { render :show, status: :created, location: @region }\n else\n @region_areas = region_areas(@region, false)\n format.html { render :new }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @region = Region.new(params[:region])\n \n\n respond_to do |format|\n if @region.save\n format.html { redirect_to @region, flash: {success: \"Region was successfully created!\"}}\n format.json { render json: @region, status: :created, location: @region }\n else\n format.html { render action: \"new\" }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n end\n end\n end",
"def get_region\n respond_to do |format|\n format.json{ render :json => { :region => Region.all } }\n end\n end",
"def create\n @region = Region.new(region_params)\n\n respond_to do |format|\n if @region.save\n format.html { redirect_to @region, notice: 'Region was successfully created.' }\n format.json { render :show, status: :created, location: @region }\n else\n format.html { render :new }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @region = Region.new(region_params)\n\n respond_to do |format|\n if @region.save\n format.html { redirect_to @region, notice: 'Region was successfully created.' }\n format.json { render :show, status: :created, location: @region }\n else\n format.html { render :new }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n end\n end\n end",
"def especies_por_region\n snib = Geoportal::Snib.new\n snib.params = params\n snib.especies\n self.resp = snib.resp\n end",
"def create\n @region = Region.new(params[:region])\n\n respond_to do |format|\n if @region.save\n format.html { redirect_to @region, notice: 'Region was successfully created.' }\n format.json { render json: @region, status: :created, location: @region }\n else\n format.html { render action: \"new\" }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n end\n end\n end",
"def region\n @regions = @company.companyregions\n respond_with @regions\n end",
"def region_params\n params.require(:region).permit(:name, :website, :info)\n end",
"def region_params\n params.require(:region).permit(Region::REGISTRABLE_ATTRIBUTES +\n [region_areas_attributes: RegionArea::REGISTRABLE_ATTRIBUTES])\n end",
"def create(attributes = {})\n # Add the region\n @regions << Region.new(attributes)\n \n @regions.last\n end",
"def update_region\n Region.find(params[:record][:id]).update_attributes(params[:record])\n render :json => {}\n end",
"def destroy\n @regionextra.destroy\n respond_to do |format|\n format.html { redirect_to regionextras_url, notice: 'Regionextra was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def especie_region_params\n params[:especie_region]\n end",
"def region_params\n params.require(:region).permit(:name)\n end",
"def create\n @regionenvironment = Regionenvironment.new(regionenvironment_params)\n\n respond_to do |format|\n if @regionenvironment.save\n format.html { redirect_to @regionenvironment, notice: 'Regionenvironment was successfully created.' }\n format.json { render :show, status: :created, location: @regionenvironment }\n else\n format.html { render :new }\n format.json { render json: @regionenvironment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def describe_regions(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeRegions'\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? :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",
"def create\n @world_region = WorldRegion.new(world_region_params)\n\n respond_to do |format|\n if @world_region.save\n format.html { redirect_to @world_region, notice: 'World region was successfully created.' }\n format.json { render :show, status: :created, location: @world_region }\n else\n format.html { render :new }\n format.json { render json: @world_region.errors, status: :unprocessable_entity }\n end\n end\n end",
"def describe_regions(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeRegions'\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? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\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",
"def create\n @especie_region = EspecieRegion.new(especie_region_params)\n\n respond_to do |format|\n if @especie_region.save\n format.html { redirect_to @especie_region, notice: 'Especie region was successfully created.' }\n format.json { render action: 'show', status: :created, location: @especie_region }\n else\n format.html { render action: 'new' }\n format.json { render json: @especie_region.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post(cnpj, branch, contractId, body)\n self.class.post(\"/aldebaran-carriers/carriers/#{cnpj}/contracts/#{branch}/#{contractId}/regions\", :basic_auth => @auth, :body => body.to_json)\n end",
"def create\n \n @regional = Regional.new(regional_params.map{|k,v| {k.to_sym => v.class == ActionController::Parameters ? [v.to_hash] : v.to_s}}.reduce({}, :merge))\n\n respond_to do |format|\n if @regional.save\n format.html { redirect_to @regional, notice: 'Regional was successfully created.' }\n format.json { render :show, status: :created, location: @regional }\n else\n format.html { render :new }\n format.json { render json: @regional.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.6437806",
"0.6351956",
"0.6259945",
"0.61845803",
"0.60703605",
"0.60580385",
"0.60164356",
"0.5906255",
"0.58810335",
"0.5846377",
"0.5806539",
"0.5758439",
"0.5758439",
"0.57405806",
"0.5724111",
"0.571648",
"0.56633353",
"0.5647524",
"0.5631641",
"0.5614036",
"0.5608624",
"0.5580406",
"0.5531731",
"0.55294245",
"0.5501573",
"0.54915833",
"0.548991",
"0.5465243",
"0.5456323",
"0.5455803"
] | 0.67595834 | 0 |
PATCH/PUT /regionextras/1 PATCH/PUT /regionextras/1.json | def update
respond_to do |format|
if @regionextra.update(regionextra_params)
format.html { redirect_to @regionextra, notice: 'Regionextra was successfully updated.' }
format.json { render :show, status: :ok, location: @regionextra }
else
format.html { render :edit }
format.json { render json: @regionextra.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @region = Region.find(params[:id])\n\n if @region.update(region_params)\n head :no_content\n else\n render json: @region.errors, status: :unprocessable_entity\n end\n end",
"def update_region\n Region.find(params[:record][:id]).update_attributes(params[:record])\n render :json => {}\n end",
"def update\n @region = Region.find(params[:id])\n\n respond_to do |format|\n if @region.update_attributes(params[:region])\n format.html { redirect_to @region, flash: {success: \"Region was successfully updated!\"}}\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @region = Region.find(params[:id])\n\n respond_to do |format|\n if @region.update_attributes(params[:region])\n format.html { redirect_to @region, notice: 'Region was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @especie_region.update(especie_region_params)\n format.html { redirect_to @especie_region, notice: 'Especie region was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @especie_region.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @region.update(region_params)\n format.html { redirect_to regions_path, notice: 'Region was successfully updated.' }\n format.json { render :show, status: :ok, location: @region }\n else\n @region_areas = region_areas(@region, false)\n format.html { render :edit }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @region.update(region_params)\n format.html { redirect_to @region, notice: 'Region was successfully updated.' }\n format.json { render :show, status: :ok, location: @region }\n else\n format.html { render :edit }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @region.update(region_params)\n format.html { redirect_to @region, notice: 'Region was successfully updated.' }\n format.json { render :show, status: :ok, location: @region }\n else\n format.html { render :edit }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @regionenvironment.update(regionenvironment_params)\n format.html { redirect_to @regionenvironment, notice: 'Regionenvironment was successfully updated.' }\n format.json { render :show, status: :ok, location: @regionenvironment }\n else\n format.html { render :edit }\n format.json { render json: @regionenvironment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @region.update(region_params)\n format.js { flash[:success] = \"#{@region.region_desc} updated successfully\" }\n format.html { redirect_to @region, notice: \"Region was successfully updated.\" }\n format.json { render :show, status: :ok, location: @region }\n else\n format.js { render :edit }\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @region = args[:region] if args.key?(:region)\n end",
"def edit\n @region = Region.find_by_given_name(params[:region_name])\n @data = SolarSystem.where(region_id: @region.id).to_json(:except => [:region_id, :created_at, :updated_at])\n end",
"def update!(**args)\n @region_type = args[:region_type] if args.key?(:region_type)\n @regions = args[:regions] if args.key?(:regions)\n end",
"def update_region_of_service(*args)\n raise ArgumentError.new('The method `update_region_of_service` requires 2 arguments (service-id and region-code).') if args.size != 2\n self.class.put(\"/services/#{args[0]}/regions/#{args[-1]}.json?apikey=#{apikey}\", :body => {})\n end",
"def update\n options = {}\n redirect_url = send(\"#{ parent_type }_regions_url\", parent, options)\n\n if params[:cancel_button]\n redirect_to redirect_url\n else\n @region = Region.find(params[:id])\n\n respond_to do |format|\n if @region.update_attributes(params[:region])\n flash[:notice] = 'Region was successfully updated.'\n format.html { redirect_to redirect_url }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @region.errors, :status => :unprocessable_entity }\n end\n end\n end\n end",
"def update!(**args)\n @allowed_regions = args[:allowed_regions] if args.key?(:allowed_regions)\n end",
"def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def update\n\n @regions = Region.all\n if params[:regions]\n @location_regions = Region.find(params[:regions])\n else\n @location_regions = []\n end\n @location.regions = @location_regions\n\n respond_to do |format|\n if @location.update(location_params)\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { render :show, status: :ok, location: @location }\n else\n format.html { render :edit }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch_cloud_regions_with_http_info(moid, cloud_regions, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CloudApi.patch_cloud_regions ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CloudApi.patch_cloud_regions\"\n end\n # verify the required parameter 'cloud_regions' is set\n if @api_client.config.client_side_validation && cloud_regions.nil?\n fail ArgumentError, \"Missing the required parameter 'cloud_regions' when calling CloudApi.patch_cloud_regions\"\n end\n # resource path\n local_var_path = '/api/v1/cloud/Regions/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(cloud_regions)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CloudRegions'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CloudApi.patch_cloud_regions\",\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(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CloudApi#patch_cloud_regions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n @region = Region.find(params[:region_id])\n respond_to do |format|\n if @city.update(city_params)\n format.js\n else\n format.js { render :edit }\n end\n end\n end",
"def update\n respond_to do |format|\n if @regional.update(regional_params.keep_if{|p,q| q.class != ActionController::Parameters})\n @regional.address.update(regional_params[:address_attributes]) \n @regional.contact.update(regional_params[:contact_attributes])\n format.html { redirect_to @regional, notice: 'Regional was successfully updated.' }\n format.json { render :show, status: :ok, location: @regional }\n else\n format.html { render :edit }\n format.json { render json: @regional.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @world_region.update(world_region_params)\n format.html { redirect_to @world_region, notice: 'World region was successfully updated.' }\n format.json { render :show, status: :ok, location: @world_region }\n else\n format.html { render :edit }\n format.json { render json: @world_region.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_associated_regions\n Region.transaction(requires_new: true) do\n regions = Region.all\n regions.each do |region|\n region.recipe.ingredients.each do |ingredient|\n if ingredient.model.to_s == LandmarkSet.name && self.name == ingredient.attributes[:name]\n # Re-save the region so its geometry is updated.\n region.save!\n end\n end\n end\n end\n end",
"def update\n @pc_region = PcRegion.find(params[:id])\n\n respond_to do |format|\n if @pc_region.update_attributes(params[:pc_region])\n format.html { redirect_to @pc_region, notice: 'Pc_region was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pc_region.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @sub_region = SubRegion.find(params[:id])\n\n respond_to do |format|\n if @sub_region.update_attributes(params[:sub_region])\n flash[:notice] = 'SubRegion was successfully updated.'\n format.html { redirect_to(@sub_region) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sub_region.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @user_region.update(user_region_params)\n @user_regions = UserRegion.all\n format.js { render :file=> 'user_regions/update_user_region.js.erb', notice: 'region was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_region }\n else\n format.html { render :edit }\n format.json { render json: @user_region.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_regionextra\n @regionextra = Regionextra.find(params[:id])\n end",
"def update!(**args)\n @disallowed_regions = args[:disallowed_regions] if args.key?(:disallowed_regions)\n end",
"def update\n respond_to do |format|\n if @regional.update(regional_params)\n format.html { redirect_to @regional, notice: I18n.t('messages.updated') }\n format.json { render :show, status: :ok, location: @regional }\n else\n format.html { render :edit }\n format.json { render json: @regional.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @location_region.update(location_region_params)\n format.html { redirect_to(admin_location_regions_url, notice: 'Location region was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render action: \"edit\" }\n format.xml { render xml: @location_region.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.6586227",
"0.6577751",
"0.64481485",
"0.6431758",
"0.6291979",
"0.628427",
"0.623349",
"0.623349",
"0.61646736",
"0.6111565",
"0.60827404",
"0.6052583",
"0.603586",
"0.6031507",
"0.5999401",
"0.5952492",
"0.5939089",
"0.5910816",
"0.5901486",
"0.58903587",
"0.585253",
"0.5852369",
"0.5835801",
"0.5813839",
"0.5806399",
"0.5788464",
"0.5770221",
"0.57673746",
"0.5752853",
"0.5750001"
] | 0.6898627 | 0 |
DELETE /regionextras/1 DELETE /regionextras/1.json | def destroy
@regionextra.destroy
respond_to do |format|
format.html { redirect_to regionextras_url, notice: 'Regionextra was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_region\n Region.find(params[:id]).destroy\n render :json => {}\n end",
"def destroy\n @region.destroy\n\n head :no_content\n end",
"def destroy\n @region = Region.find(params[:id])\n @region.destroy\n\n respond_to do |format|\n format.html { redirect_to regions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @region = Region.find(params[:id])\n @region.destroy\n\n respond_to do |format|\n format.html { redirect_to regions_url flash: {success: \"Region was successfully deleted!\"}}\n format.json { head :no_content }\n end\n end",
"def destroy\n @region.destroy\n respond_to do |format|\n format.html { redirect_to regions_url, notice: 'Region was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @region.destroy\n respond_to do |format|\n format.html { redirect_to regions_url, notice: 'Region was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @region.destroy\n respond_to do |format|\n format.html { redirect_to regions_url, notice: 'Region was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @especie_region.destroy\n respond_to do |format|\n format.html { redirect_to especies_regiones_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sub_region = SubRegion.find(params[:id])\n @sub_region.destroy\n\n respond_to do |format|\n format.html { redirect_to(sub_regions_url) }\n format.xml { head :ok }\n end\n end",
"def delete(client, region = 'AWS_REGION')\r\n super\r\n api_id = get_id_for_api(@api_name)\r\n if api_id\r\n options = {\r\n rest_api_id: api_id\r\n }\r\n @client.delete_rest_api(options)\r\n puts \"Deleted API: #{@api_name} ID:#{api_id}\"\r\n else\r\n puts \"API Gateway Object #{@api_name} not found. Nothing to delete.\"\r\n end\r\n true\r\n end",
"def destroy\n @gce_region.destroy\n respond_to do |format|\n format.html { redirect_to gce_regions_url, notice: 'Gce region was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @region_utility.destroy\n respond_to do |format|\n format.html { redirect_to region_utilities_url, notice: 'Region utility was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pc_region = PcRegion.find(params[:id])\n @pc_region.destroy\n\n respond_to do |format|\n format.html { redirect_to pc_regions_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @world_region.destroy\n respond_to do |format|\n format.html { redirect_to world_regions_path, notice: 'World region was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def destroy\n @regionenvironment.destroy\n respond_to do |format|\n format.html { redirect_to regionenvironments_url, notice: 'Regionenvironment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @region = parent.regions.find(params[:id])\n @region.destroy\n \n options = {}\n redirect_url = send(\"#{ parent_type }_regions_url\", parent, options)\n\n respond_to do |format|\n format.html { redirect_to redirect_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @region_master.destroy\n respond_to do |format|\n format.html { redirect_to region_masters_url, notice: \"Region master was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @region = RegionTemplate.find(params[:id])\n @region.destroy\n\n respond_to do |format|\n format.html { redirect_to(region_templates_url) }\n format.xml { head :ok }\n end\n end",
"def delete(path)\n RestClient.delete request_base+path\n end",
"def destroy\n @join_region_to_place.destroy\n respond_to do |format|\n format.html { redirect_to edit_place_path(@place), notice: 'Le région a été retirée.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @regional.destroy\n respond_to do |format|\n format.html { redirect_to regionals_url, notice: 'Regional was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_region.destroy\n respond_to do |format|\n format.html { redirect_to user_regions_url, notice: 'User region was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @locations_region = Locations::Region.find(params[:id])\n @locations_region.destroy\n respond_to do |format|\n format.js { \n index\n render 'index'\n }\n end\n end",
"def destroy\n @regional.destroy\n respond_to do |format|\n format.html { redirect_to regionais_url, notice: I18n.t('messages.destroyed') }\n format.json { head :no_content }\n end\n end",
"def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end",
"def destroy\n @join_region_to_place.destroy\n respond_to do |format|\n format.html { redirect_to edit_admin_place_path(@place), notice: 'La région a été retirée.' }\n format.json { head :no_content }\n end\n end",
"def delete_and_give_me_a_json(additional_path, params = nil)\n if self.service_base_path != nil\n if params == nil\n params = Hash.new\n end\n params[:api_key] = self.access_token\n message = self.http_client.delete \"#{self.base_url}#{self.service_base_path}/#{additional_path}.json\", params\n trata_erro(message.content)\n end\n end",
"def destroy\n rid = params['id']\n if Aws.delete_recipe(rid) && Aws.delete_all_ingredients(rid)\n msg = {:notice => \"Recipe deleted!\"}\n render :json => msg\n else\n msg = {:notice => \"Error while deleting from DynamoDB!\"}\n render :json => msg\n end\n end",
"def delete\n super \"/templates/#{template_id}.json\", {}\n end"
] | [
"0.74677545",
"0.7150684",
"0.7055704",
"0.6934371",
"0.6837629",
"0.6837629",
"0.6837629",
"0.67998534",
"0.6740191",
"0.66453683",
"0.662495",
"0.6567241",
"0.6561294",
"0.65553993",
"0.6547393",
"0.654193",
"0.65335745",
"0.6477611",
"0.6430961",
"0.6404991",
"0.63848144",
"0.63839436",
"0.6359358",
"0.63361615",
"0.6295705",
"0.62942946",
"0.627642",
"0.62465286",
"0.62445503",
"0.62418735"
] | 0.7439709 | 1 |
End of preview. Expand
in Dataset Viewer.
No dataset card yet
- Downloads last month
- 14